Skip to content

Commit

Permalink
chore(typography): move copyable to Text
Browse files Browse the repository at this point in the history
  • Loading branch information
uyarn committed Jan 31, 2024
1 parent a8da180 commit 81db28f
Show file tree
Hide file tree
Showing 16 changed files with 76 additions and 75 deletions.
Binary file modified db/TDesign.db
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { TdTextProps, TdTitleProps, TdParagraphProps } from './type';

export const textDefaultProps: TdTextProps = {
code: false,
copyable: false,
delete: false,
disabled: false,
ellipsis: false,
Expand All @@ -18,4 +19,4 @@ export const textDefaultProps: TdTextProps = {

export const titleDefaultProps: TdTitleProps = { ellipsis: false, level: 'h1' };

export const paragraphDefaultProps: TdParagraphProps = { copyable: false, ellipsis: false };
export const paragraphDefaultProps: TdParagraphProps = { ellipsis: false };
10 changes: 5 additions & 5 deletions packages/products/tdesign-react/src/typography/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ export interface TdTextProps {
* @default false
*/
code?: boolean;
/**
* 是否可复制,可通过配置参数自定义复制操作的具体功能和样式
* @default false
*/
copyable?: boolean | TypographyCopyable;
/**
* 是否添加删除线样式
* @default false
Expand Down Expand Up @@ -93,11 +98,6 @@ export interface TdParagraphProps {
* 段落内容
*/
content?: TNode;
/**
* 是否可复制,可通过配置参数自定义复制操作的具体功能和样式
* @default false
*/
copyable?: boolean | TypographyCopyable;
/**
* 是否省略展示,可通过配置参数自定义省略操作的具体功能和样式
* @default false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ className | String | - | 类名 | N
style | Object | - | 样式,Typescript:`React.CSSProperties` | N
children | TNode | - | children of text。Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N
code | Boolean | false | add code style | N
copyable | Boolean / Object | false | add copyable style。Typescript:`boolean \| TypographyCopyable` | N
delete | Boolean | false | add delete line style | N
disabled | Boolean | false | add disabled style | N
ellipsis | Boolean / Object | false | add ellipsis style。Typescript:`boolean \| TypographyEllipsis` | N
Expand Down Expand Up @@ -38,7 +39,6 @@ className | String | - | 类名 | N
style | Object | - | 样式,Typescript:`React.CSSProperties` | N
children | TNode | - | children of paragraph。Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N
content | TNode | - | content of paragraph。Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N
copyable | Boolean / Object | false | add copyable style。Typescript:`boolean \| TypographyCopyable` | N
ellipsis | Boolean / Object | false | add ellipsis style。Typescript:`boolean \| TypographyEllipsis` | N

### TypographyEllipsis
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ className | String | - | 类名 | N
style | Object | - | 样式,TS 类型:`React.CSSProperties` | N
children | TNode | - | 文本内容,同content。TS 类型:`string \| TNode`[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N
code | Boolean | false | 是否添加代码样式 | N
copyable | Boolean / Object | false | 是否可复制,可通过配置参数自定义复制操作的具体功能和样式。TS 类型:`boolean \| TypographyCopyable` | N
delete | Boolean | false | 是否添加删除线样式 | N
disabled | Boolean | false | 是否添加不可用样式 | N
ellipsis | Boolean / Object | false | 是否省略展示,可通过配置参数自定义省略操作的具体功能和样式。TS 类型:`boolean \| TypographyEllipsis` | N
Expand Down Expand Up @@ -38,7 +39,6 @@ className | String | - | 类名 | N
style | Object | - | 样式,TS 类型:`React.CSSProperties` | N
children | TNode | - | 段落内容,同 content。TS 类型:`string \| TNode`[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N
content | TNode | - | 段落内容。TS 类型:`string \| TNode`[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N
copyable | Boolean / Object | false | 是否可复制,可通过配置参数自定义复制操作的具体功能和样式。TS 类型:`boolean \| TypographyCopyable` | N
ellipsis | Boolean / Object | false | 是否省略展示,可通过配置参数自定义省略操作的具体功能和样式。TS 类型:`boolean \| TypographyEllipsis` | N

### TypographyEllipsis
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ export default {
content: {
type: [String, Function] as PropType<TdParagraphProps['content']>,
},
/** 是否可复制,可通过配置参数自定义复制操作的具体功能和样式 */
copyable: {
type: [Boolean, Object] as PropType<TdParagraphProps['copyable']>,
default: false as TdParagraphProps['copyable'],
},
/** 段落内容 */
default: {
type: [String, Function] as PropType<TdParagraphProps['default']>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ export default {
content: {
type: [String, Function] as PropType<TdTextProps['content']>,
},
/** 是否可复制,可通过配置参数自定义复制操作的具体功能和样式 */
copyable: {
type: [Boolean, Object] as PropType<TdTextProps['copyable']>,
default: false as TdTextProps['copyable'],
},
/** 文本内容 */
default: {
type: [String, Function] as PropType<TdTextProps['default']>,
Expand Down
10 changes: 5 additions & 5 deletions packages/products/tdesign-vue-next/src/typography/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ export interface TdTextProps {
* 文本内容
*/
content?: string | TNode;
/**
* 是否可复制,可通过配置参数自定义复制操作的具体功能和样式
* @default false
*/
copyable?: boolean | TypographyCopyable;
/**
* 文本内容
*/
Expand Down Expand Up @@ -93,11 +98,6 @@ export interface TdParagraphProps {
* 段落内容
*/
content?: string | TNode;
/**
* 是否可复制,可通过配置参数自定义复制操作的具体功能和样式
* @default false
*/
copyable?: boolean | TypographyCopyable;
/**
* 段落内容
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ name | type | default | description | required
-- | -- | -- | -- | --
code | Boolean | false | add code style | N
content | String / Slot / Function | - | content of text。Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
copyable | Boolean / Object | false | add copyable style。Typescript:`boolean \| TypographyCopyable` | N
default | String / Slot / Function | - | default slot of text。Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
delete | Boolean | false | add delete line style | N
disabled | Boolean | false | add disabled style | N
Expand All @@ -32,7 +33,6 @@ level | String | h1 | level of title。options: h1/h2/h3/h4/h5/h6 | N
name | type | default | description | required
-- | -- | -- | -- | --
content | String / Slot / Function | - | content of paragraph。Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
copyable | Boolean / Object | false | add copyable style。Typescript:`boolean \| TypographyCopyable` | N
default | String / Slot / Function | - | default slot of paragraph。Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
ellipsis | Boolean / Object | false | add ellipsis style。Typescript:`boolean \| TypographyEllipsis` | N

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
-- | -- | -- | -- | --
code | Boolean | false | 是否添加代码样式 | N
content | String / Slot / Function | - | 文本内容。TS 类型:`string \| TNode`[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
copyable | Boolean / Object | false | 是否可复制,可通过配置参数自定义复制操作的具体功能和样式。TS 类型:`boolean \| TypographyCopyable` | N
default | String / Slot / Function | - | 文本内容。TS 类型:`string \| TNode`[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
delete | Boolean | false | 是否添加删除线样式 | N
disabled | Boolean | false | 是否添加不可用样式 | N
Expand All @@ -32,7 +33,6 @@ level | String | h1 | 标题等级。可选项:h1/h2/h3/h4/h5/h6 | N
名称 | 类型 | 默认值 | 说明 | 必传
-- | -- | -- | -- | --
content | String / Slot / Function | - | 段落内容。TS 类型:`string \| TNode`[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
copyable | Boolean / Object | false | 是否可复制,可通过配置参数自定义复制操作的具体功能和样式。TS 类型:`boolean \| TypographyCopyable` | N
default | String / Slot / Function | - | 段落内容。TS 类型:`string \| TNode`[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
ellipsis | Boolean / Object | false | 是否省略展示,可通过配置参数自定义省略操作的具体功能和样式。TS 类型:`boolean \| TypographyEllipsis` | N

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ export default {
content: {
type: [String, Function] as PropType<TdParagraphProps['content']>,
},
/** 是否可复制,可通过配置参数自定义复制操作的具体功能和样式 */
copyable: {
type: [Boolean, Object] as PropType<TdParagraphProps['copyable']>,
default: false,
},
/** 段落内容 */
default: {
type: [String, Function] as PropType<TdParagraphProps['default']>,
Expand Down
5 changes: 5 additions & 0 deletions packages/products/tdesign-vue/src/typography/text-props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ export default {
content: {
type: [String, Function] as PropType<TdTextProps['content']>,
},
/** 是否可复制,可通过配置参数自定义复制操作的具体功能和样式 */
copyable: {
type: [Boolean, Object] as PropType<TdTextProps['copyable']>,
default: false,
},
/** 文本内容 */
default: {
type: [String, Function] as PropType<TdTextProps['default']>,
Expand Down
10 changes: 5 additions & 5 deletions packages/products/tdesign-vue/src/typography/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ export interface TdTextProps {
* 文本内容
*/
content?: string | TNode;
/**
* 是否可复制,可通过配置参数自定义复制操作的具体功能和样式
* @default false
*/
copyable?: boolean | TypographyCopyable;
/**
* 文本内容
*/
Expand Down Expand Up @@ -93,11 +98,6 @@ export interface TdParagraphProps {
* 段落内容
*/
content?: string | TNode;
/**
* 是否可复制,可通过配置参数自定义复制操作的具体功能和样式
* @default false
*/
copyable?: boolean | TypographyCopyable;
/**
* 段落内容
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ name | type | default | description | required
-- | -- | -- | -- | --
code | Boolean | false | add code style | N
content | String / Slot / Function | - | content of text。Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
copyable | Boolean / Object | false | add copyable style。Typescript:`boolean \| TypographyCopyable` | N
default | String / Slot / Function | - | default slot of text。Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
delete | Boolean | false | add delete line style | N
disabled | Boolean | false | add disabled style | N
Expand All @@ -32,7 +33,6 @@ level | String | h1 | level of title。options: h1/h2/h3/h4/h5/h6 | N
name | type | default | description | required
-- | -- | -- | -- | --
content | String / Slot / Function | - | content of paragraph。Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
copyable | Boolean / Object | false | add copyable style。Typescript:`boolean \| TypographyCopyable` | N
default | String / Slot / Function | - | default slot of paragraph。Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
ellipsis | Boolean / Object | false | add ellipsis style。Typescript:`boolean \| TypographyEllipsis` | N

Expand Down
2 changes: 1 addition & 1 deletion packages/products/tdesign-vue/src/typography/typography.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
-- | -- | -- | -- | --
code | Boolean | false | 是否添加代码样式 | N
content | String / Slot / Function | - | 文本内容。TS 类型:`string \| TNode`[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
copyable | Boolean / Object | false | 是否可复制,可通过配置参数自定义复制操作的具体功能和样式。TS 类型:`boolean \| TypographyCopyable` | N
default | String / Slot / Function | - | 文本内容。TS 类型:`string \| TNode`[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
delete | Boolean | false | 是否添加删除线样式 | N
disabled | Boolean | false | 是否添加不可用样式 | N
Expand All @@ -32,7 +33,6 @@ level | String | h1 | 标题等级。可选项:h1/h2/h3/h4/h5/h6 | N
名称 | 类型 | 默认值 | 说明 | 必传
-- | -- | -- | -- | --
content | String / Slot / Function | - | 段落内容。TS 类型:`string \| TNode`[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
copyable | Boolean / Object | false | 是否可复制,可通过配置参数自定义复制操作的具体功能和样式。TS 类型:`boolean \| TypographyCopyable` | N
default | String / Slot / Function | - | 段落内容。TS 类型:`string \| TNode`[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
ellipsis | Boolean / Object | false | 是否省略展示,可通过配置参数自定义省略操作的具体功能和样式。TS 类型:`boolean \| TypographyEllipsis` | N

Expand Down
86 changes: 43 additions & 43 deletions packages/scripts/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -68020,49 +68020,6 @@
"TNode"
]
},
{
"id": 1706638324,
"platform_framework": [
"1",
"2",
"4"
],
"component": "Paragraph",
"field_category": 1,
"field_name": "copyable",
"field_type": [
"4",
"8"
],
"field_default_value": "false",
"field_enum": "",
"field_desc_zh": "是否可复制,可通过配置参数自定义复制操作的具体功能和样式",
"field_desc_en": "add copyable style",
"field_required": 0,
"event_input": "",
"create_time": "2024-01-30 18:12:04",
"update_time": "2024-01-30 18:12:04",
"event_output": null,
"custom_field_type": "boolean | TypographyCopyable",
"syntactic_sugar": null,
"readonly": 1,
"html_attribute": 0,
"trigger_elements": "",
"deprecated": 0,
"version": "",
"test_description": null,
"support_default_value": 0,
"field_category_text": "Props",
"platform_framework_text": [
"Vue(PC)",
"React(PC)",
"Angular(PC)"
],
"field_type_text": [
"Boolean",
"Object"
]
},
{
"id": 1706635334,
"platform_framework": [
Expand Down Expand Up @@ -103171,6 +103128,49 @@
"TNode"
]
},
{
"id": 1706638324,
"platform_framework": [
"1",
"2",
"4"
],
"component": "Text",
"field_category": 1,
"field_name": "copyable",
"field_type": [
"4",
"8"
],
"field_default_value": "false",
"field_enum": "",
"field_desc_zh": "是否可复制,可通过配置参数自定义复制操作的具体功能和样式",
"field_desc_en": "add copyable style",
"field_required": 0,
"event_input": "",
"create_time": "2024-01-30 18:12:04",
"update_time": "2024-01-30 18:12:04",
"event_output": null,
"custom_field_type": "boolean | TypographyCopyable",
"syntactic_sugar": null,
"readonly": 1,
"html_attribute": 0,
"trigger_elements": "",
"deprecated": 0,
"version": "",
"test_description": null,
"support_default_value": 0,
"field_category_text": "Props",
"platform_framework_text": [
"Vue(PC)",
"React(PC)",
"Angular(PC)"
],
"field_type_text": [
"Boolean",
"Object"
]
},
{
"id": 1706635501,
"platform_framework": [
Expand Down

0 comments on commit 81db28f

Please sign in to comment.