-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
560ad9d
commit 8a5c107
Showing
15 changed files
with
281 additions
and
179 deletions.
There are no files selected for viewing
Binary file not shown.
24 changes: 24 additions & 0 deletions
24
packages/products/tdesign-mobile-react/src/tag/defaultProps.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/** | ||
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC | ||
* */ | ||
|
||
import { TdTagProps, TdCheckTagProps } from './type'; | ||
|
||
export const tagDefaultProps: TdTagProps = { | ||
closable: false, | ||
disabled: false, | ||
icon: undefined, | ||
shape: 'square', | ||
size: 'medium', | ||
theme: 'default', | ||
variant: 'dark', | ||
}; | ||
|
||
export const checkTagDefaultProps: TdCheckTagProps = { | ||
defaultChecked: undefined, | ||
closable: false, | ||
disabled: false, | ||
shape: 'square', | ||
size: 'medium', | ||
variant: 'dark', | ||
}; |
44 changes: 44 additions & 0 deletions
44
packages/products/tdesign-mobile-react/src/tag/tag.en-US.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
:: BASE_DOC :: | ||
|
||
## API | ||
|
||
### Tag Props | ||
|
||
name | type | default | description | required | ||
-- | -- | -- | -- | -- | ||
className | String | - | className of component | N | ||
style | Object | - | CSS(Cascading Style Sheets),Typescript:`React.CSSProperties` | N | ||
children | TNode | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N | ||
closable | Boolean | false | \- | N | ||
content | TNode | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N | ||
disabled | Boolean | false | \- | N | ||
icon | TElement | undefined | Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N | ||
maxWidth | String / Number | - | \- | N | ||
shape | String | square | options: square/round/mark | N | ||
size | String | medium | options: small/medium/large/extra-large | N | ||
theme | String | default | options: default/primary/warning/danger/success | N | ||
variant | String | dark | options: dark/light/outline/light-outline | N | ||
onClick | Function | | Typescript:`(context: { e: MouseEvent }) => void`<br/> | N | ||
onClose | Function | | Typescript:`(context: { e: MouseEvent }) => void`<br/> | N | ||
|
||
|
||
### CheckTag Props | ||
|
||
name | type | default | description | required | ||
-- | -- | -- | -- | -- | ||
className | String | - | className of component | N | ||
style | Object | - | CSS(Cascading Style Sheets),Typescript:`React.CSSProperties` | N | ||
checked | Boolean | undefined | \- | N | ||
defaultChecked | Boolean | undefined | uncontrolled property | N | ||
children | TNode | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N | ||
closable | Boolean | false | \- | N | ||
content | TNode | - | Typescript:`string \| number \| string[] \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N | ||
disabled | Boolean | false | \- | N | ||
icon | TElement | - | Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N | ||
shape | String | square | options: square/round/mark | N | ||
size | String | medium | options: small/medium/large。Typescript:`SizeEnum`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N | ||
uncheckedProps | Object | - | used to set unchecked tag props。Typescript:`TdTagProps` | N | ||
variant | String | dark | options: dark/light/outline/light-outline | N | ||
onChange | Function | | Typescript:`(checked: boolean) => void`<br/> | N | ||
onClick | Function | | Typescript:`(context: { e: MouseEvent }) => void`<br/> | N | ||
onClose | Function | | Typescript:`(context: { e: MouseEvent }) => void`<br/> | N |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
:: BASE_DOC :: | ||
|
||
## API | ||
|
||
### Tag Props | ||
|
||
名称 | 类型 | 默认值 | 描述 | 必传 | ||
-- | -- | -- | -- | -- | ||
className | String | - | 类名 | N | ||
style | Object | - | 样式,TS 类型:`React.CSSProperties` | N | ||
children | TNode | - | 组件子元素,同 `content`。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N | ||
closable | Boolean | false | 标签是否可关闭 | N | ||
content | TNode | - | 组件子元素。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N | ||
disabled | Boolean | false | 标签禁用态,失效标签不能触发事件。默认风格(theme=default)才有禁用态 | N | ||
icon | TElement | undefined | 标签中的图标,可自定义图标呈现。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N | ||
maxWidth | String / Number | - | 标签最大宽度,宽度超出后会出现省略号。示例:'50px' / 80 | N | ||
shape | String | square | 标签类型,有三种:方形、圆角方形、标记型。可选项:square/round/mark | N | ||
size | String | medium | 标签尺寸。可选项:small/medium/large/extra-large | N | ||
theme | String | default | 组件风格,用于描述组件不同的应用场景。可选项:default/primary/warning/danger/success | N | ||
variant | String | dark | 标签风格变体。可选项:dark/light/outline/light-outline | N | ||
onClick | Function | | TS 类型:`(context: { e: MouseEvent }) => void`<br/>点击时触发 | N | ||
onClose | Function | | TS 类型:`(context: { e: MouseEvent }) => void`<br/>如果关闭按钮存在,点击关闭按钮时触发 | N | ||
|
||
|
||
### CheckTag Props | ||
|
||
名称 | 类型 | 默认值 | 描述 | 必传 | ||
-- | -- | -- | -- | -- | ||
className | String | - | 类名 | N | ||
style | Object | - | 样式,TS 类型:`React.CSSProperties` | N | ||
checked | Boolean | undefined | 标签选中的状态,默认风格(theme=default)才有选中态 | N | ||
defaultChecked | Boolean | undefined | 标签选中的状态,默认风格(theme=default)才有选中态。非受控属性 | N | ||
children | TNode | - | 组件子元素。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N | ||
closable | Boolean | false | 标签是否可关闭 | N | ||
content | TNode | - | 组件子元素;传入数组时:[选中内容,非选中内容]。TS 类型:`string \| number \| string[] \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N | ||
disabled | Boolean | false | 标签禁用态,失效标签不能触发事件。默认风格(theme=default)才有禁用态 | N | ||
icon | TElement | - | 标签中的图标,可自定义图标呈现。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N | ||
shape | String | square | 标签类型,有三种:方形、圆角方形、标记型。可选项:square/round/mark | N | ||
size | String | medium | 标签尺寸。可选项:small/medium/large。TS 类型:`SizeEnum`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N | ||
uncheckedProps | Object | - | 透传标签未选态属性。TS 类型:`TdTagProps` | N | ||
variant | String | dark | 标签风格变体。可选项:dark/light/outline/light-outline | N | ||
onChange | Function | | TS 类型:`(checked: boolean) => void`<br/>状态切换时触发 | N | ||
onClick | Function | | TS 类型:`(context: { e: MouseEvent }) => void`<br/>点击标签时触发 | N | ||
onClose | Function | | TS 类型:`(context: { e: MouseEvent }) => void`<br/>如果关闭按钮存在,点击关闭按钮时触发 | N |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
/* eslint-disable */ | ||
|
||
/** | ||
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC | ||
* */ | ||
|
||
import { TNode, TElement, SizeEnum } from '../common'; | ||
import { MouseEvent } from 'react'; | ||
|
||
export interface TdTagProps { | ||
/** | ||
* 组件子元素,同 `content` | ||
*/ | ||
children?: TNode; | ||
/** | ||
* 标签是否可关闭 | ||
* @default false | ||
*/ | ||
closable?: boolean; | ||
/** | ||
* 组件子元素 | ||
*/ | ||
content?: TNode; | ||
/** | ||
* 标签禁用态,失效标签不能触发事件。默认风格(theme=default)才有禁用态 | ||
* @default false | ||
*/ | ||
disabled?: boolean; | ||
/** | ||
* 标签中的图标,可自定义图标呈现 | ||
*/ | ||
icon?: TElement; | ||
/** | ||
* 标签最大宽度,宽度超出后会出现省略号。示例:'50px' / 80 | ||
*/ | ||
maxWidth?: string | number; | ||
/** | ||
* 标签类型,有三种:方形、圆角方形、标记型 | ||
* @default square | ||
*/ | ||
shape?: 'square' | 'round' | 'mark'; | ||
/** | ||
* 标签尺寸 | ||
* @default medium | ||
*/ | ||
size?: 'small' | 'medium' | 'large' | 'extra-large'; | ||
/** | ||
* 组件风格,用于描述组件不同的应用场景 | ||
* @default default | ||
*/ | ||
theme?: 'default' | 'primary' | 'warning' | 'danger' | 'success'; | ||
/** | ||
* 标签风格变体 | ||
* @default dark | ||
*/ | ||
variant?: 'dark' | 'light' | 'outline' | 'light-outline'; | ||
/** | ||
* 点击时触发 | ||
*/ | ||
onClick?: (context: { e: MouseEvent<HTMLSpanElement> }) => void; | ||
/** | ||
* 如果关闭按钮存在,点击关闭按钮时触发 | ||
*/ | ||
onClose?: (context: { e: MouseEvent<SVGSVGElement> }) => void; | ||
} | ||
|
||
export interface TdCheckTagProps { | ||
/** | ||
* 标签选中的状态,默认风格(theme=default)才有选中态 | ||
*/ | ||
checked?: boolean; | ||
/** | ||
* 标签选中的状态,默认风格(theme=default)才有选中态,非受控属性 | ||
*/ | ||
defaultChecked?: boolean; | ||
/** | ||
* 组件子元素 | ||
*/ | ||
children?: TNode; | ||
/** | ||
* 标签是否可关闭 | ||
* @default false | ||
*/ | ||
closable?: boolean; | ||
/** | ||
* 组件子元素;传入数组时:[选中内容,非选中内容] | ||
*/ | ||
content?: [] | TNode; | ||
/** | ||
* 标签禁用态,失效标签不能触发事件。默认风格(theme=default)才有禁用态 | ||
* @default false | ||
*/ | ||
disabled?: boolean; | ||
/** | ||
* 标签中的图标,可自定义图标呈现 | ||
*/ | ||
icon?: TElement; | ||
/** | ||
* 标签类型,有三种:方形、圆角方形、标记型 | ||
* @default square | ||
*/ | ||
shape?: 'square' | 'round' | 'mark'; | ||
/** | ||
* 标签尺寸 | ||
* @default medium | ||
*/ | ||
size?: SizeEnum; | ||
/** | ||
* 透传标签未选态属性 | ||
*/ | ||
uncheckedProps?: TdTagProps; | ||
/** | ||
* 标签风格变体 | ||
* @default dark | ||
*/ | ||
variant?: 'dark' | 'light' | 'outline' | 'light-outline'; | ||
/** | ||
* 状态切换时触发 | ||
*/ | ||
onChange?: (checked: boolean) => void; | ||
/** | ||
* 点击标签时触发 | ||
*/ | ||
onClick?: (context: { e: MouseEvent<HTMLSpanElement> }) => void; | ||
/** | ||
* 如果关闭按钮存在,点击关闭按钮时触发 | ||
*/ | ||
onClose?: (context: { e: MouseEvent<HTMLSpanElement> }) => void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.