From 6727d2d3c0fa4c71e1c3fc84c91ce2142313688e Mon Sep 17 00:00:00 2001 From: Uyarn Date: Wed, 31 Jan 2024 01:28:14 +0800 Subject: [PATCH] feat: add typography --- db/TDesign.db | Bin 864256 -> 864256 bytes packages/products/tdesign-react/src/common.ts | 2 +- .../src/typography/defaultProps.ts | 9 + .../tdesign-react/src/typography/type.ts | 46 ++ .../src/typography/typography.en-US.md | 31 ++ .../src/typography/typography.md | 31 ++ .../src/typography/paragraph-props.ts | 19 + .../src/typography/text-props.ts | 21 + .../src/typography/title-props.ts | 28 ++ .../tdesign-vue-next/src/typography/type.ts | 50 ++ .../src/typography/typography.en-US.md | 26 ++ .../src/typography/typography.md | 26 ++ .../src/typography/paragraph-props.ts | 19 + .../tdesign-vue/src/typography/text-props.ts | 21 + .../tdesign-vue/src/typography/title-props.ts | 28 ++ .../tdesign-vue/src/typography/type.ts | 50 ++ .../src/typography/typography.en-US.md | 26 ++ .../tdesign-vue/src/typography/typography.md | 26 ++ packages/scripts/api.json | 441 ++++++++++++++++++ packages/scripts/config/files-combine.js | 6 +- packages/scripts/map.json | 12 + .../server/controllers/ComponentApi/const.ts | 6 +- 22 files changed, 921 insertions(+), 3 deletions(-) create mode 100644 packages/products/tdesign-react/src/typography/defaultProps.ts create mode 100644 packages/products/tdesign-react/src/typography/type.ts create mode 100644 packages/products/tdesign-react/src/typography/typography.en-US.md create mode 100644 packages/products/tdesign-react/src/typography/typography.md create mode 100644 packages/products/tdesign-vue-next/src/typography/paragraph-props.ts create mode 100644 packages/products/tdesign-vue-next/src/typography/text-props.ts create mode 100644 packages/products/tdesign-vue-next/src/typography/title-props.ts create mode 100644 packages/products/tdesign-vue-next/src/typography/type.ts create mode 100644 packages/products/tdesign-vue-next/src/typography/typography.en-US.md create mode 100644 packages/products/tdesign-vue-next/src/typography/typography.md create mode 100644 packages/products/tdesign-vue/src/typography/paragraph-props.ts create mode 100644 packages/products/tdesign-vue/src/typography/text-props.ts create mode 100644 packages/products/tdesign-vue/src/typography/title-props.ts create mode 100644 packages/products/tdesign-vue/src/typography/type.ts create mode 100644 packages/products/tdesign-vue/src/typography/typography.en-US.md create mode 100644 packages/products/tdesign-vue/src/typography/typography.md diff --git a/db/TDesign.db b/db/TDesign.db index 7a069d33670c20b9c722287f032b5bdf0e5572f1..836038ad004b8179e2d4709eaa3b1f0cb2839f97 100644 GIT binary patch delta 1588 zcmai!Z%7ky7{|ABw%vX^ufVlT%N0nJ*xhY6wF9$dSuZ0bh#+pbvs0F{IZKN=eQ{bT zw4(a?!WZighENuW4gdAW%EGrHfrS{fS%gHd1MB{Ix}DOyFJGQ}KKDG&_pW`OZl9-P z`R4AM1y$zm4pwB%B8!M@mdIK}Hd|yjh^$p)Z6b?`tbLdT5C2*kvbLKb8#C`3CL9pi zjE~~a@P51xzlC4Lui#O<0cY_Oi7$xbIY3NP@OF-4Qb4mT2sc8xzz0>4OW?hx7QvLJ zX2Cm6O@p_Z8USxJ)d?mwRSjNi3V>ItBIdwLO$~t;ic0wRf(ca>bj{$7#0-uR8w(uv zd^3JL=Tpu}>?_7OK08iw)fie6FW%zA5^#qkLFp-PIQ|Y!zxQ`nAdAEnNS;M z!%Q}L2&9HqmaXK^J_2Yi8 zx=sUAF4O^nx<{I!J-WAIorQ;_BWh5?5y@$*Le*C2PYn)#k4>o5)oV=yE;sj-D!i(d zThffD^fIhcfO2a5gkj17LNP73b5`qE{i3UOn|@JY zeY%IC=!_SVtrmDd8Cv-`jOhhdo&KN8DpL#cb}}dwL;2RQF2PFWx-N7RQM5aAYGO`} zQ;0jyg?Ngm2;M{RUV^6y-be7IDJ9ekPp&PDK2mDbV+*U}tfq@(ykrJmwp!tS3GYOm zW*1gr#1C1OUs5>8S?U6zW-itHG#TqpCB~B1{tse~}zR0e^vDg3;1BGA&gX3 v#19OQX5C#DcQUDK9w;?bJHww2f5C;(j27xM = T extends undefined ? ReactElement : (props: T) => ReactElement; // 1. TNode = ReactNode; 2. TNode = (props: T) => ReactNode -export type TNode = T extends undefined ? ReactNode : ReactNode | ((props: T) => ReactNode); +export type TNode = T extends undefined ? ReactNode | (() => ReactNode) : ReactNode | ((props: T) => ReactNode); export type AttachNodeReturnValue = HTMLElement | Element | Document; export type AttachNode = CSSSelector | ((triggerNode?: HTMLElement) => AttachNodeReturnValue); diff --git a/packages/products/tdesign-react/src/typography/defaultProps.ts b/packages/products/tdesign-react/src/typography/defaultProps.ts new file mode 100644 index 000000000..b37b1e07a --- /dev/null +++ b/packages/products/tdesign-react/src/typography/defaultProps.ts @@ -0,0 +1,9 @@ +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +import { TdTextProps, TdTitleProps } from './type'; + +export const textDefaultProps: TdTextProps = { code: false }; + +export const titleDefaultProps: TdTitleProps = { level: 'h1' }; diff --git a/packages/products/tdesign-react/src/typography/type.ts b/packages/products/tdesign-react/src/typography/type.ts new file mode 100644 index 000000000..7286087af --- /dev/null +++ b/packages/products/tdesign-react/src/typography/type.ts @@ -0,0 +1,46 @@ +/* eslint-disable */ + +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +import { TNode } from '../common'; + +export interface TdTextProps { + /** + * 文本内容,同content + */ + children?: TNode; + /** + * 是否添加代码样式 + * @default false + */ + code?: boolean; +} + +export interface TdTitleProps { + /** + * 段落内容,同 content + */ + children?: TNode; + /** + * 段落内容 + */ + content?: TNode; + /** + * 标题等级 + * @default h1 + */ + level?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'; +} + +export interface TdParagraphProps { + /** + * 段落内容,同 content + */ + children?: TNode; + /** + * 段落内容 + */ + content?: TNode; +} diff --git a/packages/products/tdesign-react/src/typography/typography.en-US.md b/packages/products/tdesign-react/src/typography/typography.en-US.md new file mode 100644 index 000000000..87bb7b9e6 --- /dev/null +++ b/packages/products/tdesign-react/src/typography/typography.en-US.md @@ -0,0 +1,31 @@ +:: BASE_DOC :: + +## API + +### Text Props + +name | type | default | description | required +-- | -- | -- | -- | -- +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 + +### Title Props + +name | type | default | description | required +-- | -- | -- | -- | -- +className | String | - | 类名 | N +style | Object | - | 样式,Typescript:`React.CSSProperties` | N +children | TNode | - | children of title。Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N +content | TNode | - | content of title。Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N +level | String | h1 | level of title。options: h1/h2/h3/h4/h5/h6 | N + +### Paragraph Props + +name | type | default | description | required +-- | -- | -- | -- | -- +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 diff --git a/packages/products/tdesign-react/src/typography/typography.md b/packages/products/tdesign-react/src/typography/typography.md new file mode 100644 index 000000000..32b4901e6 --- /dev/null +++ b/packages/products/tdesign-react/src/typography/typography.md @@ -0,0 +1,31 @@ +:: BASE_DOC :: + +## API + +### Text Props + +名称 | 类型 | 默认值 | 说明 | 必传 +-- | -- | -- | -- | -- +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 + +### Title Props + +名称 | 类型 | 默认值 | 说明 | 必传 +-- | -- | -- | -- | -- +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 +level | String | h1 | 标题等级。可选项:h1/h2/h3/h4/h5/h6 | N + +### Paragraph Props + +名称 | 类型 | 默认值 | 说明 | 必传 +-- | -- | -- | -- | -- +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 diff --git a/packages/products/tdesign-vue-next/src/typography/paragraph-props.ts b/packages/products/tdesign-vue-next/src/typography/paragraph-props.ts new file mode 100644 index 000000000..d3189dadd --- /dev/null +++ b/packages/products/tdesign-vue-next/src/typography/paragraph-props.ts @@ -0,0 +1,19 @@ +/* eslint-disable */ + +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +import { TdParagraphProps } from '../typography/type'; +import { PropType } from 'vue'; + +export default { + /** 段落内容 */ + content: { + type: [String, Function] as PropType, + }, + /** 段落内容 */ + default: { + type: [String, Function] as PropType, + }, +}; diff --git a/packages/products/tdesign-vue-next/src/typography/text-props.ts b/packages/products/tdesign-vue-next/src/typography/text-props.ts new file mode 100644 index 000000000..00ce14423 --- /dev/null +++ b/packages/products/tdesign-vue-next/src/typography/text-props.ts @@ -0,0 +1,21 @@ +/* eslint-disable */ + +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +import { TdTextProps } from '../typography/type'; +import { PropType } from 'vue'; + +export default { + /** 是否添加代码样式 */ + code: Boolean, + /** 文本内容 */ + content: { + type: [String, Function] as PropType, + }, + /** 文本内容 */ + default: { + type: [String, Function] as PropType, + }, +}; diff --git a/packages/products/tdesign-vue-next/src/typography/title-props.ts b/packages/products/tdesign-vue-next/src/typography/title-props.ts new file mode 100644 index 000000000..9b11509ed --- /dev/null +++ b/packages/products/tdesign-vue-next/src/typography/title-props.ts @@ -0,0 +1,28 @@ +/* eslint-disable */ + +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +import { TdTitleProps } from '../typography/type'; +import { PropType } from 'vue'; + +export default { + /** 段落内容 */ + content: { + type: [String, Function] as PropType, + }, + /** 标题内容 */ + default: { + type: [String, Function] as PropType, + }, + /** 标题等级 */ + level: { + type: String as PropType, + default: 'h1' as TdTitleProps['level'], + validator(val: TdTitleProps['level']): boolean { + if (!val) return true; + return ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(val); + }, + }, +}; diff --git a/packages/products/tdesign-vue-next/src/typography/type.ts b/packages/products/tdesign-vue-next/src/typography/type.ts new file mode 100644 index 000000000..bd27136f6 --- /dev/null +++ b/packages/products/tdesign-vue-next/src/typography/type.ts @@ -0,0 +1,50 @@ +/* eslint-disable */ + +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +import { TNode } from '../common'; + +export interface TdTextProps { + /** + * 是否添加代码样式 + * @default false + */ + code?: boolean; + /** + * 文本内容 + */ + content?: string | TNode; + /** + * 文本内容 + */ + default?: string | TNode; +} + +export interface TdTitleProps { + /** + * 段落内容 + */ + content?: string | TNode; + /** + * 标题内容 + */ + default?: string | TNode; + /** + * 标题等级 + * @default h1 + */ + level?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'; +} + +export interface TdParagraphProps { + /** + * 段落内容 + */ + content?: string | TNode; + /** + * 段落内容 + */ + default?: string | TNode; +} diff --git a/packages/products/tdesign-vue-next/src/typography/typography.en-US.md b/packages/products/tdesign-vue-next/src/typography/typography.en-US.md new file mode 100644 index 000000000..1cc0d382b --- /dev/null +++ b/packages/products/tdesign-vue-next/src/typography/typography.en-US.md @@ -0,0 +1,26 @@ +:: BASE_DOC :: + +## API + +### Text Props + +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 +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 + +### Title Props + +name | type | default | description | required +-- | -- | -- | -- | -- +content | String / Slot / Function | - | content of title。Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N +default | String / Slot / Function | - | default slot of title。Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N +level | String | h1 | level of title。options: h1/h2/h3/h4/h5/h6 | N + +### Paragraph Props + +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 +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 diff --git a/packages/products/tdesign-vue-next/src/typography/typography.md b/packages/products/tdesign-vue-next/src/typography/typography.md new file mode 100644 index 000000000..5efb5bbf6 --- /dev/null +++ b/packages/products/tdesign-vue-next/src/typography/typography.md @@ -0,0 +1,26 @@ +:: BASE_DOC :: + +## API + +### Text Props + +名称 | 类型 | 默认值 | 说明 | 必传 +-- | -- | -- | -- | -- +code | Boolean | false | 是否添加代码样式 | N +content | String / Slot / Function | - | 文本内容。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N +default | String / Slot / Function | - | 文本内容。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N + +### Title Props + +名称 | 类型 | 默认值 | 说明 | 必传 +-- | -- | -- | -- | -- +content | String / Slot / Function | - | 段落内容。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N +default | String / Slot / Function | - | 标题内容。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N +level | String | h1 | 标题等级。可选项:h1/h2/h3/h4/h5/h6 | N + +### Paragraph Props + +名称 | 类型 | 默认值 | 说明 | 必传 +-- | -- | -- | -- | -- +content | String / Slot / Function | - | 段落内容。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N +default | String / Slot / Function | - | 段落内容。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N diff --git a/packages/products/tdesign-vue/src/typography/paragraph-props.ts b/packages/products/tdesign-vue/src/typography/paragraph-props.ts new file mode 100644 index 000000000..d3189dadd --- /dev/null +++ b/packages/products/tdesign-vue/src/typography/paragraph-props.ts @@ -0,0 +1,19 @@ +/* eslint-disable */ + +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +import { TdParagraphProps } from '../typography/type'; +import { PropType } from 'vue'; + +export default { + /** 段落内容 */ + content: { + type: [String, Function] as PropType, + }, + /** 段落内容 */ + default: { + type: [String, Function] as PropType, + }, +}; diff --git a/packages/products/tdesign-vue/src/typography/text-props.ts b/packages/products/tdesign-vue/src/typography/text-props.ts new file mode 100644 index 000000000..00ce14423 --- /dev/null +++ b/packages/products/tdesign-vue/src/typography/text-props.ts @@ -0,0 +1,21 @@ +/* eslint-disable */ + +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +import { TdTextProps } from '../typography/type'; +import { PropType } from 'vue'; + +export default { + /** 是否添加代码样式 */ + code: Boolean, + /** 文本内容 */ + content: { + type: [String, Function] as PropType, + }, + /** 文本内容 */ + default: { + type: [String, Function] as PropType, + }, +}; diff --git a/packages/products/tdesign-vue/src/typography/title-props.ts b/packages/products/tdesign-vue/src/typography/title-props.ts new file mode 100644 index 000000000..9b11509ed --- /dev/null +++ b/packages/products/tdesign-vue/src/typography/title-props.ts @@ -0,0 +1,28 @@ +/* eslint-disable */ + +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +import { TdTitleProps } from '../typography/type'; +import { PropType } from 'vue'; + +export default { + /** 段落内容 */ + content: { + type: [String, Function] as PropType, + }, + /** 标题内容 */ + default: { + type: [String, Function] as PropType, + }, + /** 标题等级 */ + level: { + type: String as PropType, + default: 'h1' as TdTitleProps['level'], + validator(val: TdTitleProps['level']): boolean { + if (!val) return true; + return ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(val); + }, + }, +}; diff --git a/packages/products/tdesign-vue/src/typography/type.ts b/packages/products/tdesign-vue/src/typography/type.ts new file mode 100644 index 000000000..bd27136f6 --- /dev/null +++ b/packages/products/tdesign-vue/src/typography/type.ts @@ -0,0 +1,50 @@ +/* eslint-disable */ + +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +import { TNode } from '../common'; + +export interface TdTextProps { + /** + * 是否添加代码样式 + * @default false + */ + code?: boolean; + /** + * 文本内容 + */ + content?: string | TNode; + /** + * 文本内容 + */ + default?: string | TNode; +} + +export interface TdTitleProps { + /** + * 段落内容 + */ + content?: string | TNode; + /** + * 标题内容 + */ + default?: string | TNode; + /** + * 标题等级 + * @default h1 + */ + level?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'; +} + +export interface TdParagraphProps { + /** + * 段落内容 + */ + content?: string | TNode; + /** + * 段落内容 + */ + default?: string | TNode; +} diff --git a/packages/products/tdesign-vue/src/typography/typography.en-US.md b/packages/products/tdesign-vue/src/typography/typography.en-US.md new file mode 100644 index 000000000..553574e57 --- /dev/null +++ b/packages/products/tdesign-vue/src/typography/typography.en-US.md @@ -0,0 +1,26 @@ +:: BASE_DOC :: + +## API + +### Text Props + +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 +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 + +### Title Props + +name | type | default | description | required +-- | -- | -- | -- | -- +content | String / Slot / Function | - | content of title。Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N +default | String / Slot / Function | - | default slot of title。Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N +level | String | h1 | level of title。options: h1/h2/h3/h4/h5/h6 | N + +### Paragraph Props + +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 +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 diff --git a/packages/products/tdesign-vue/src/typography/typography.md b/packages/products/tdesign-vue/src/typography/typography.md new file mode 100644 index 000000000..14e25da37 --- /dev/null +++ b/packages/products/tdesign-vue/src/typography/typography.md @@ -0,0 +1,26 @@ +:: BASE_DOC :: + +## API + +### Text Props + +名称 | 类型 | 默认值 | 说明 | 必传 +-- | -- | -- | -- | -- +code | Boolean | false | 是否添加代码样式 | N +content | String / Slot / Function | - | 文本内容。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N +default | String / Slot / Function | - | 文本内容。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N + +### Title Props + +名称 | 类型 | 默认值 | 说明 | 必传 +-- | -- | -- | -- | -- +content | String / Slot / Function | - | 段落内容。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N +default | String / Slot / Function | - | 标题内容。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N +level | String | h1 | 标题等级。可选项:h1/h2/h3/h4/h5/h6 | N + +### Paragraph Props + +名称 | 类型 | 默认值 | 说明 | 必传 +-- | -- | -- | -- | -- +content | String / Slot / Function | - | 段落内容。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N +default | String / Slot / Function | - | 段落内容。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N diff --git a/packages/scripts/api.json b/packages/scripts/api.json index dc5df365a..7c12d9264 100644 --- a/packages/scripts/api.json +++ b/packages/scripts/api.json @@ -67938,6 +67938,127 @@ "Boolean" ] }, + { + "id": 1706635398, + "platform_framework": [ + "2" + ], + "component": "Paragraph", + "field_category": 1, + "field_name": "children", + "field_type": [ + "1", + "64" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "段落内容,同 content", + "field_desc_en": "children of paragraph", + "field_required": 0, + "event_input": "", + "create_time": "2024-01-30 17:23:18", + "update_time": "2024-01-30 17:23:18", + "event_output": null, + "custom_field_type": null, + "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": [ + "React(PC)" + ], + "field_type_text": [ + "String", + "TNode" + ] + }, + { + "id": 1706635275, + "platform_framework": [ + "1", + "2", + "4" + ], + "component": "Paragraph", + "field_category": 1, + "field_name": "content", + "field_type": [ + "1", + "64" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "段落内容", + "field_desc_en": "content of paragraph", + "field_required": 0, + "event_input": "", + "create_time": "2024-01-30 17:21:15", + "update_time": "2024-01-30 17:21:15", + "event_output": null, + "custom_field_type": null, + "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": [ + "String", + "TNode" + ] + }, + { + "id": 1706635334, + "platform_framework": [ + "1" + ], + "component": "Paragraph", + "field_category": 1, + "field_name": "default", + "field_type": [ + "1", + "64" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "段落内容", + "field_desc_en": "default slot of paragraph", + "field_required": 0, + "event_input": "", + "create_time": "2024-01-30 17:22:14", + "update_time": "2024-01-30 17:22:14", + "event_output": null, + "custom_field_type": null, + "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)" + ], + "field_type_text": [ + "String", + "TNode" + ] + }, { "id": 2834, "platform_framework": [ @@ -102845,6 +102966,164 @@ ], "field_type_text": [] }, + { + "id": 1706635543, + "platform_framework": [ + "2" + ], + "component": "Text", + "field_category": 1, + "field_name": "children", + "field_type": [ + "1", + "64" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "文本内容,同content", + "field_desc_en": "children of text", + "field_required": 0, + "event_input": "", + "create_time": "2024-01-30 17:25:43", + "update_time": "2024-01-30 17:25:43", + "event_output": null, + "custom_field_type": null, + "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": [ + "React(PC)" + ], + "field_type_text": [ + "String", + "TNode" + ] + }, + { + "id": 1706635187, + "platform_framework": [ + "1", + "2", + "4" + ], + "component": "Text", + "field_category": 1, + "field_name": "code", + "field_type": [ + "4" + ], + "field_default_value": "false", + "field_enum": "", + "field_desc_zh": "是否添加代码样式", + "field_desc_en": "add code style", + "field_required": 0, + "event_input": "", + "create_time": "2024-01-30 17:19:47", + "update_time": "2024-01-30 17:19:47", + "event_output": null, + "custom_field_type": null, + "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" + ] + }, + { + "id": 1706635518, + "platform_framework": [ + "1" + ], + "component": "Text", + "field_category": 1, + "field_name": "content", + "field_type": [ + "1", + "64" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "文本内容", + "field_desc_en": "content of text", + "field_required": 0, + "event_input": "", + "create_time": "2024-01-30 17:25:18", + "update_time": "2024-01-30 17:25:18", + "event_output": null, + "custom_field_type": null, + "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)" + ], + "field_type_text": [ + "String", + "TNode" + ] + }, + { + "id": 1706635501, + "platform_framework": [ + "1" + ], + "component": "Text", + "field_category": 1, + "field_name": "default", + "field_type": [ + "1", + "64" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "文本内容", + "field_desc_en": "default slot of text", + "field_required": 0, + "event_input": "", + "create_time": "2024-01-30 17:25:01", + "update_time": "2024-01-30 17:25:01", + "event_output": null, + "custom_field_type": null, + "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)" + ], + "field_type_text": [ + "String", + "TNode" + ] + }, { "id": 1719, "platform_framework": [ @@ -107053,6 +107332,168 @@ ], "field_type_text": [] }, + { + "id": 1706635433, + "platform_framework": [ + "2" + ], + "component": "Title", + "field_category": 1, + "field_name": "children", + "field_type": [ + "1", + "64" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "段落内容,同 content", + "field_desc_en": "children of title", + "field_required": 0, + "event_input": "", + "create_time": "2024-01-30 17:23:53", + "update_time": "2024-01-30 17:23:53", + "event_output": null, + "custom_field_type": null, + "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": [ + "React(PC)" + ], + "field_type_text": [ + "String", + "TNode" + ] + }, + { + "id": 1706635466, + "platform_framework": [ + "1", + "2", + "4" + ], + "component": "Title", + "field_category": 1, + "field_name": "content", + "field_type": [ + "1", + "64" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "段落内容", + "field_desc_en": "content of title", + "field_required": 0, + "event_input": "", + "create_time": "2024-01-30 17:24:26", + "update_time": "2024-01-30 17:24:26", + "event_output": null, + "custom_field_type": null, + "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": [ + "String", + "TNode" + ] + }, + { + "id": 1706635482, + "platform_framework": [ + "1" + ], + "component": "Title", + "field_category": 1, + "field_name": "default", + "field_type": [ + "1", + "64" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "标题内容", + "field_desc_en": "default slot of title", + "field_required": 0, + "event_input": "", + "create_time": "2024-01-30 17:24:42", + "update_time": "2024-01-30 17:24:42", + "event_output": null, + "custom_field_type": null, + "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)" + ], + "field_type_text": [ + "String", + "TNode" + ] + }, + { + "id": 1706635230, + "platform_framework": [ + "1", + "2", + "4" + ], + "component": "Title", + "field_category": 1, + "field_name": "level", + "field_type": [ + "1" + ], + "field_default_value": "h1", + "field_enum": "h1/h2/h3/h4/h5/h6", + "field_desc_zh": "标题等级", + "field_desc_en": "level of title", + "field_required": 0, + "event_input": "", + "create_time": "2024-01-30 17:20:30", + "update_time": "2024-01-30 17:20:30", + "event_output": null, + "custom_field_type": null, + "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": [ + "String" + ] + }, { "id": 1352, "platform_framework": [ diff --git a/packages/scripts/config/files-combine.js b/packages/scripts/config/files-combine.js index 4f1222288..fcdff3c53 100644 --- a/packages/scripts/config/files-combine.js +++ b/packages/scripts/config/files-combine.js @@ -129,7 +129,8 @@ const COMPONENT_API_MD_MAP = { list: ['Indexes', 'IndexesAnchor'], excludes: ['Miniprogram'] }, - Popup: ['Popup','$Popup'] + Popup: ['Popup','$Popup'], + Typography: ['Text', 'Title','Paragraph'], }; // 输出 TS 类型文件时,哪些需要文件需要合并输出,数据内容为组件/插件名称 @@ -292,6 +293,9 @@ const TYPES_COMBINE_MAP = { list: ['Indexes', 'IndexesAnchor'], excludes: ['Miniprogram'] }, + Typography: { + list: ['Typography','Text', 'Title','Paragraph'], + } }; exports.GLOBAL_COMPONENTS_CONFIG = GLOBAL_COMPONENTS_CONFIG; diff --git a/packages/scripts/map.json b/packages/scripts/map.json index a29c732fe..f69916831 100644 --- a/packages/scripts/map.json +++ b/packages/scripts/map.json @@ -710,6 +710,10 @@ "label": "分页全局配置", "type": "TS" }, + { + "value": "Paragraph", + "label": "段落" + }, { "value": "Popconfirm", "label": "气泡确认框" @@ -904,6 +908,10 @@ "value": "TagInput", "label": "标签输入框" }, + { + "value": "Text", + "label": "文本" + }, { "value": "Timeline", "label": "时间轴" @@ -933,6 +941,10 @@ "value": "TimeRangePickerPanel", "label": "时间范围选择器面板" }, + { + "value": "Title", + "label": "标题" + }, { "value": "Tooltip", "label": "文字提示" diff --git a/packages/server/controllers/ComponentApi/const.ts b/packages/server/controllers/ComponentApi/const.ts index 4d8b88419..c22751575 100644 --- a/packages/server/controllers/ComponentApi/const.ts +++ b/packages/server/controllers/ComponentApi/const.ts @@ -64,7 +64,7 @@ export const FIELD_TYPE_MAP: MapOptions = { [FUNCTION]: "Function", [TNODE]: "TNode", [Date]: "Date", - [FILE]: 'File', + [FILE]: "File", }; export const PLATFORM_FRAMEWORK: MapOptions = { @@ -264,6 +264,10 @@ export const COMPONENTS_PC: Array = [ { value: "Result", label: "结果" }, { value: "Skeleton", label: "骨架屏" }, { value: "Watermark", label: "水印" }, + { value: "Typography", label: "排版" }, + { value: "Text", label: "文本" }, + { value: "Title", label: "标题" }, + { value: "Paragraph", label: "段落" }, { value: "Anchor", label: "锚点" }, { value: "BackTop", label: "回到顶部" }, { value: "Container", label: "布局容器" },