Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(grid): update for mobile react #356

Merged
merged 4 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified db/TDesign.db
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
* */

import { TdGridItemProps } from './type';

export const gridItemDefaultProps: TdGridItemProps = { badge: null, layout: 'vertical' };
29 changes: 29 additions & 0 deletions packages/products/tdesign-mobile-react/src/grid/grid.en-US.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
:: BASE_DOC ::

## API


### Grid Props

name | type | default | description | required
-- | -- | -- | -- | --
className | String | - | className of component | N
style | Object | - | CSS(Cascading Style Sheets),Typescript:`React.CSSProperties` | N
align | String | center | options: left/center | N
border | Boolean | false | \- | N
column | Number | 4 | \- | N
gutter | Number | - | \- | N
theme | String | default | options: default/card | N


### GridItem Props

name | type | default | description | required
-- | -- | -- | -- | --
className | String | - | className of component | N
style | Object | - | CSS(Cascading Style Sheets),Typescript:`React.CSSProperties` | N
badge | Object | null | Typescript:`BadgeProps`,[Badge API Documents](./badge?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/grid/type.ts) | N
description | TNode | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
image | TNode | - | Typescript:`string \| object \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
layout | String | vertical | options: vertical/horizontal | N
text | TNode | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
29 changes: 29 additions & 0 deletions packages/products/tdesign-mobile-react/src/grid/grid.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
:: BASE_DOC ::

## API


### Grid Props

名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
className | String | - | 类名 | N
style | Object | - | 样式,TS 类型:`React.CSSProperties` | N
align | String | center | 内容对齐方式。可选项:left/center | N
border | Boolean | false | 是否显示边框 | N
column | Number | 4 | 每一行的列数量;为 0 时等于固定大小 | N
gutter | Number | - | 间隔大小 | N
theme | String | default | 宫格的风格。可选项:default/card | N


### GridItem Props

名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
className | String | - | 类名 | N
style | Object | - | 样式,TS 类型:`React.CSSProperties` | N
badge | Object | null | 透传至 Badge 属性。TS 类型:`BadgeProps`,[Badge API Documents](./badge?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/grid/type.ts) | N
description | TNode | - | 文本以外的更多描述,辅助信息。可以通过 Props 传入文本,也可以自定义标题节点。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
image | TNode | - | 图片,可以是图片地址,也可以自定义图片节点,如果传入对象则透传至 image 组件。TS 类型:`string \| object \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
layout | String | vertical | 内容布局方式。可选项:vertical/horizontal | N
text | TNode | - | 文本,可以通过 Props 传入文本,也可以自定义标题节点。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
33 changes: 33 additions & 0 deletions packages/products/tdesign-mobile-react/src/grid/type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/* eslint-disable */

/**
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
* */

import { BadgeProps } from '../badge';
import { TNode } from '../common';

export interface TdGridItemProps {
/**
* 透传至 Badge 属性
* @default null
*/
badge?: BadgeProps;
/**
* 文本以外的更多描述,辅助信息。可以通过 Props 传入文本,也可以自定义标题节点
*/
description?: TNode;
/**
* 图片,可以是图片地址,也可以自定义图片节点,如果传入对象则透传至 image 组件
*/
image?: TNode;
/**
* 内容布局方式
* @default vertical
*/
layout?: 'vertical' | 'horizontal';
/**
* 文本,可以通过 Props 传入文本,也可以自定义标题节点
*/
text?: TNode;
}
24 changes: 12 additions & 12 deletions packages/scripts/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -54108,7 +54108,6 @@
{
"id": 1778,
"platform_framework": [
"16",
"32",
"64"
],
Expand Down Expand Up @@ -54139,7 +54138,6 @@
"support_default_value": 0,
"field_category_text": "Props",
"platform_framework_text": [
"React(Mobile)",
"Angular(Mobile)",
"Miniprogram"
],
Expand All @@ -54151,7 +54149,8 @@
{
"id": 1712661601,
"platform_framework": [
"8"
"8",
"16"
],
"component": "Grid",
"field_category": 1,
Expand Down Expand Up @@ -54179,7 +54178,8 @@
"support_default_value": 0,
"field_category_text": "Props",
"platform_framework_text": [
"Vue(Mobile)"
"Vue(Mobile)",
"React(Mobile)"
],
"field_type_text": [
"Boolean"
Expand Down Expand Up @@ -54461,7 +54461,8 @@
{
"id": 1712661731,
"platform_framework": [
"8"
"8",
"16"
],
"component": "GridItem",
"field_category": 1,
Expand Down Expand Up @@ -54489,7 +54490,8 @@
"support_default_value": 0,
"field_category_text": "Props",
"platform_framework_text": [
"Vue(Mobile)"
"Vue(Mobile)",
"React(Mobile)"
],
"field_type_text": [
"Object"
Expand All @@ -54498,7 +54500,6 @@
{
"id": 2309,
"platform_framework": [
"16",
"32",
"64"
],
Expand Down Expand Up @@ -54528,7 +54529,6 @@
"support_default_value": 0,
"field_category_text": "Props",
"platform_framework_text": [
"React(Mobile)",
"Angular(Mobile)",
"Miniprogram"
],
Expand Down Expand Up @@ -54697,7 +54697,6 @@
{
"id": 1769,
"platform_framework": [
"16",
"32",
"64"
],
Expand Down Expand Up @@ -54728,7 +54727,6 @@
"support_default_value": 0,
"field_category_text": "Props",
"platform_framework_text": [
"React(Mobile)",
"Angular(Mobile)",
"Miniprogram"
],
Expand All @@ -54740,7 +54738,8 @@
{
"id": 1712661829,
"platform_framework": [
"8"
"8",
"16"
],
"component": "GridItem",
"field_category": 1,
Expand Down Expand Up @@ -54770,7 +54769,8 @@
"support_default_value": 0,
"field_category_text": "Props",
"platform_framework_text": [
"Vue(Mobile)"
"Vue(Mobile)",
"React(Mobile)"
],
"field_type_text": [
"String",
Expand Down
Loading