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(tag): sync api #2684

Merged
merged 5 commits into from
Apr 9, 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
9 changes: 2 additions & 7 deletions src/check-tag/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import { TdCheckTagProps } from './type';
const props: TdCheckTagProps = {
/** 标签选中的状态,默认风格(theme=default)才有选中态 */
checked: {
type: null,
type: Boolean,
value: undefined,
},
/** 标签选中的状态,默认风格(theme=default)才有选中态,非受控属性 */
defaultChecked: {
type: null,
type: Boolean,
value: undefined,
},
/** 标签是否可关闭 */
Expand All @@ -25,11 +25,6 @@ const props: TdCheckTagProps = {
content: {
type: null,
},
/** 自定义组件样式 */
style: {
type: String,
value: '',
},
/** 标签禁用态,失效标签不能触发事件。默认风格(theme=default)才有禁用态 */
disabled: {
type: Boolean,
Expand Down
10 changes: 0 additions & 10 deletions src/check-tag/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export interface TdCheckTagProps {
/**
* 标签是否可关闭
* @default false
* @deprecated
*/
closable?: {
type: BooleanConstructor;
Expand All @@ -37,14 +36,6 @@ export interface TdCheckTagProps {
type: null;
value?: string | number | string[];
};
/**
* 自定义组件样式
* @default ''
*/
style?: {
type: StringConstructor;
value?: string;
};
/**
* 标签禁用态,失效标签不能触发事件。默认风格(theme=default)才有禁用态
* @default false
Expand All @@ -70,7 +61,6 @@ export interface TdCheckTagProps {
/**
* 标签类型,有三种:方形、圆角方形、标记型
* @default square
* @deprecated
*/
shape?: {
type: StringConstructor;
Expand Down
46 changes: 30 additions & 16 deletions src/tag/README.en-US.md
Original file line number Diff line number Diff line change
@@ -1,52 +1,66 @@
:: BASE_DOC ::

## API

### Tag Props

name | type | default | description | required
-- | -- | -- | -- | --
closable | Boolean | false | \- | N
style | Object | - | CSS(Cascading Style Sheets) | N
custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
closable | Boolean / Object | false | \- | N
disabled | Boolean | false | \- | N
external-classes | Array | - | `['t-class']` | N
icon | String / Object / Slot | - | \- | N
icon | String / Object / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
max-width | String / Number | - | \- | N
shape | String | square | optionssquare/round/mark | N
size | String | medium | optionssmall/medium/large/extra-large。Typescript:`SizeEnum` | N
theme | String | default | optionsdefault/primary/warning/danger/success | N
variant | String | dark | optionsdark/light/outline/light-outline | 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

### Tag Events

name | params | description
-- | -- | --
click | - | \-
close | - | \-
### Tag External Classes

className | Description
-- | --
t-class | \-


### CheckTag Props

name | type | default | description | required
-- | -- | -- | -- | --
style | Object | - | CSS(Cascading Style Sheets) | N
custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
checked | Boolean | undefined | \- | N
default-checked | Boolean | undefined | uncontrolled property | N
closable | Boolean | false | \- | N
content | String / Number / Array / Slot | - | Typescript:`string \| number \| string[]` | N
content | String / Number / Array / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
disabled | Boolean | false | \- | N
external-classes | Array | - | `['t-class']` | N
icon | String / Object / Slot | - | \- | N
shape | String | square | options:square/round/mark | N
size | String | medium | options:small/medium/large。Typescript:`SizeEnum` | N
variant | String | dark | `0.26.0`。options:dark/light/outline/light-outline | N
icon | String / Object / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/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-miniprogram/blob/develop/src/common/common.ts) | N
variant | String | dark | `0.26.0`。options: dark/light/outline/light-outline | N

### CheckTag Events

name | params | description
-- | -- | --
change | `(checked: boolean)` | \-
click | - | \-
close | - | \-
close | \- | \-
### CheckTag External Classes

className | Description
-- | --
t-class | \-

### CSS 变量

### CSS Variables
The component provides the following CSS variables, which can be used to customize styles.
Name | Default Value | Description
-- | -- | --
Expand Down Expand Up @@ -83,4 +97,4 @@ Name | Default Value | Description
--td-tag-square-border-radius | 8rpx | -
--td-tag-success-color | @success-color | -
--td-tag-success-light-color | @success-color-1 | -
--td-tag-warning-color | @warning-color | -
--td-tag-warning-color | @warning-color | -
39 changes: 23 additions & 16 deletions src/tag/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,19 @@ isComponent: true


## API

### Tag Props

名称 | 类型 | 默认值 | 说明 | 必传
名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
closable | Boolean / Object / Slot | false | 标签是否可关闭。 | N
style | Object | - | 样式 | N
custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
closable | Boolean / Object | false | 标签是否可关闭 | N
disabled | Boolean | false | 标签禁用态,失效标签不能触发事件。默认风格(theme=default)才有禁用态 | N
icon | String / Object / Slot | - | 标签中的图标,可自定义图标呈现 | N
icon | String / Object / Slot | - | 标签中的图标,可自定义图标呈现。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
max-width | String / Number | - | 标签最大宽度,宽度超出后会出现省略号。示例:'50px' / 80 | N
shape | String | square | 标签类型,有三种:方形、圆角方形、标记型。可选项:square/round/mark | N
size | String | medium | 标签尺寸。可选项:small/medium/large/extra-large。TS 类型:`SizeEnum` | 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

Expand All @@ -62,24 +65,27 @@ variant | String | dark | 标签风格变体。可选项:dark/light/outline/li
-- | -- | --
click | - | 点击时触发
close | - | 如果关闭按钮存在,点击关闭按钮时触发
### Tag External Classes

### Tag 外部样式类
类名 | 说明
-- | --
类名 | 描述
-- | --
t-class | 根节点样式类


### CheckTag Props

名称 | 类型 | 默认值 | 说明 | 必传
名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
style | Object | - | 样式 | N
custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
checked | Boolean | undefined | 标签选中的状态,默认风格(theme=default)才有选中态 | N
default-checked | Boolean | undefined | 标签选中的状态,默认风格(theme=default)才有选中态。非受控属性 | N
closable | Boolean | false | 标签是否可关闭 | N
content | String / Number / Array / Slot | - | 组件子元素;传入数组时:[选中内容,非选中内容]。TS 类型:`string \| number \| string[]` | N
content | String / Number / Array / Slot | - | 组件子元素;传入数组时:[选中内容,非选中内容]。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
disabled | Boolean | false | 标签禁用态,失效标签不能触发事件。默认风格(theme=default)才有禁用态 | N
icon | String / Object / Slot | - | 标签图标 | N
icon | String / Object / Slot | - | 标签图标。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
shape | String | square | 标签类型,有三种:方形、圆角方形、标记型。可选项:square/round/mark | N
size | String | medium | 标签尺寸。可选项:small/medium/large。TS 类型:`SizeEnum` | N
size | String | medium | 标签尺寸。可选项:small/medium/large。TS 类型:`SizeEnum`。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
variant | String | dark | `0.26.0`。标签风格变体。可选项:dark/light/outline/light-outline | N

### CheckTag Events
Expand All @@ -88,14 +94,15 @@ variant | String | dark | `0.26.0`。标签风格变体。可选项:dark/light
-- | -- | --
change | `(checked: boolean)` | 状态切换时触发
click | - | 点击标签时触发
close | - | 如果关闭按钮存在,点击关闭按钮时触发
close | \- | 如果关闭按钮存在,点击关闭按钮时触发
### CheckTag External Classes

### CheckTag 外部样式类
类名 | 说明
-- | --
类名 | 描述
-- | --
t-class | 根节点样式类

### CSS 变量

组件提供了下列 CSS 变量,可用于自定义样式。
名称 | 默认值 | 描述
-- | -- | --
Expand Down Expand Up @@ -132,4 +139,4 @@ t-class | 根节点样式类
--td-tag-square-border-radius | 8rpx | -
--td-tag-success-color | @success-color | -
--td-tag-success-light-color | @success-color-1 | -
--td-tag-warning-color | @warning-color | -
--td-tag-warning-color | @warning-color | -
12 changes: 1 addition & 11 deletions src/tag/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
* */

import { SizeEnum } from '../common/common';

export interface TdTagProps {
/**
* 标签是否可关闭
Expand All @@ -15,14 +13,6 @@ export interface TdTagProps {
type: null;
value?: boolean | object;
};
/**
* 自定义组件样式
* @default ''
*/
style?: {
type: StringConstructor;
value?: string;
};
/**
* 标签禁用态,失效标签不能触发事件。默认风格(theme=default)才有禁用态
* @default false
Expand Down Expand Up @@ -66,7 +56,7 @@ export interface TdTagProps {
*/
size?: {
type: StringConstructor;
value?: SizeEnum;
value?: 'small' | 'medium' | 'large' | 'extra-large';
};
/**
* 组件风格,用于描述组件不同的应用场景
Expand Down
Loading