Skip to content
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.
2 changes: 1 addition & 1 deletion packages/products/tdesign-react/src/radio/radio.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ name | String | - | \- | N
options | Array | - | Typescript:`Array<RadioOption>` `type RadioOption = string \| number \| RadioOptionObj` `interface RadioOptionObj { label?: string \| TNode; value?: string \| number \| boolean; disabled?: boolean }`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/radio/type.ts) | N
readonly | Boolean | undefined | \- | N
size | String | medium | options: small/medium/large。Typescript:`SizeEnum`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N
theme | String | radio | component Style。options: radio/button | N
theme | String | radio | Determine the style of radio when using options API。options: radio/button | N
value | String / Number / Boolean | - | Typescript:`T` `type RadioValue = string \| number \| boolean`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/radio/type.ts) | N
defaultValue | String / Number / Boolean | - | uncontrolled property。Typescript:`T` `type RadioValue = string \| number \| boolean`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/radio/type.ts) | N
variant | String | outline | options: outline/primary-filled/default-filled | N
Expand Down
2 changes: 1 addition & 1 deletion packages/products/tdesign-react/src/radio/radio.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ name | String | - | HTML 元素原生属性 | N
options | Array | - | 单选组件按钮形式。RadioOption 数据类型为 string 或 number 时,表示 label 和 value 值相同。TS 类型:`Array<RadioOption>` `type RadioOption = string \| number \| RadioOptionObj` `interface RadioOptionObj { label?: string \| TNode; value?: string \| number \| boolean; disabled?: boolean }`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/radio/type.ts) | N
readonly | Boolean | undefined | 只读状态 | N
size | String | medium | 组件尺寸【讨论中】。可选项:small/medium/large。TS 类型:`SizeEnum`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N
theme | String | radio | 组件风格。可选项:radio/button | N
theme | String | radio | 用于在使用 options 方式渲染时决定组件的风格。可选项:radio/button | N
value | String / Number / Boolean | - | 选中的值。TS 类型:`T` `type RadioValue = string \| number \| boolean`。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/radio/type.ts) | N
defaultValue | String / Number / Boolean | - | 选中的值。非受控属性。TS 类型:`T` `type RadioValue = string \| number \| boolean`。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/radio/type.ts) | N
variant | String | outline | 单选组件按钮形式。可选项:outline/primary-filled/default-filled | N
Expand Down
2 changes: 1 addition & 1 deletion packages/products/tdesign-react/src/radio/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export interface TdRadioGroupProps<T = RadioValue> {
*/
size?: SizeEnum;
/**
* 组件风格
* 用于在使用 options 方式渲染时决定组件的风格
* @default radio
*/
theme?: 'radio' | 'button';
Expand Down
8 changes: 6 additions & 2 deletions packages/products/tdesign-react/src/upload/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export interface TdUploadProps<T extends UploadFile = UploadFile> {
*/
data?: Record<string, any> | ((files: UploadFile[]) => Record<string, any>);
/**
* 是否禁用
* 是否禁用组件
*/
disabled?: boolean;
/**
Expand Down Expand Up @@ -100,6 +100,10 @@ export interface TdUploadProps<T extends UploadFile = UploadFile> {
* 设置上传的请求头部,`action` 存在时有效
*/
headers?: { [key: string]: string };
/**
* 用于在上传图片场景下,透传属性配置至 Image 组件
*/
imageProps?: object;
/**
* 透传图片预览组件全部属性
*/
Expand Down Expand Up @@ -208,7 +212,7 @@ export interface TdUploadProps<T extends UploadFile = UploadFile> {
*/
uploadPastedFiles?: boolean;
/**
* 是否在请求时间超过 300ms 后显示模拟进度。上传进度有模拟进度和真实进度两种。一般大小的文件上传,真实的上传进度只有 0 和 100,不利于交互呈现,因此组件内置模拟上传进度。真实上传进度一般用于大文件上传
* 是否在请求时间超过 300ms 后显示模拟进度。上传进度有模拟进度和真实进度两种。一般大小的文件上传,真实的上传进度只有 0 和 100,不利于交互呈现,因此组件内置模拟上传进度。真实上传进度一般用于大文件上传
* @default true
*/
useMockProgress?: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ format | Function | - | to redefine `UploadFile` data structure。Typescript:
formatRequest | Function | - | redefine request data。Typescript:`(requestData: { [key: string]: any }) => { [key: string]: any }` | N
formatResponse | Function | - | redefine response data structure。Typescript:`(response: any, context: FormatResponseContext) => ResponseType ` `type ResponseType = { error?: string; url?: string; status?: 'fail' \| 'success'; files?: UploadFile[] } & Record<string, any>` `interface FormatResponseContext { file: UploadFile; currentFiles?: UploadFile[] }`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/upload/type.ts) | N
headers | Object | - | HTTP Request Header。Typescript:`{[key: string]: string}` | N
imageProps | Object | - | \- | N
imageViewerProps | Object | - | ImageViewer Component Props。Typescript:`ImageViewerProps`,[ImageViewer API Documents](./image-viewer?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/upload/type.ts) | N
inputAttributes | Object | - | add attributes to HTML element `input`。Typescript:`CSSProperties` | N
isBatchUpload | Boolean | false | make all files to be a whole package, files can only be replaced or deleted together, can not add more files | N
Expand Down
5 changes: 3 additions & 2 deletions packages/products/tdesign-react/src/upload/upload.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ beforeUpload | Function | - | 如果是自动上传模式 `autoUpload=true`,
cancelUploadButton | TNode | - | 批量文件/图片上传,`autoUpload=false` 场景下,透传“取消上传”按钮属性。TS 类型:`null \| ButtonProps \| TNode<{ disabled: boolean; cancelUploadText: string; cancelUpload: (ctx: { e: MouseEvent }) => void }>`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N
children | TNode | - | 非拖拽场景,指触发上传的元素,如:“选择文件”。如果是拖拽场景,则是指拖拽区域。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N
data | Object | - | 上传请求所需的额外字段,默认字段有 `file`,表示文件信息。可以添加额外的文件名字段,如:`{file_name: "custom-file-name.txt"}`。`autoUpload=true` 时有效。也可以使用 `formatRequest` 完全自定义上传请求的字段。TS 类型:`Record<string, any> \| ((files: UploadFile[]) => Record<string, any>)` | N
disabled | Boolean | undefined | 是否禁用 | N
disabled | Boolean | undefined | 是否禁用组件 | N
dragContent | TNode | - | 用于自定义拖拽区域,`theme=custom` 且 `draggable=true` 时有效。TS 类型:`TNode \| TNode<TriggerContext>`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N
draggable | Boolean | undefined | 是否启用拖拽上传,不同的组件风格默认值不同。`theme=file` 或 `theme=image` 时有效 | N
fileListDisplay | TElement | - | 用于完全自定义文件列表界面内容(UI),单文件和多文件均有效。TS 类型:`TNode<{ files: UploadFile[]; dragEvents?: UploadDisplayDragEvents }>`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N
Expand All @@ -28,6 +28,7 @@ format | Function | - | 转换文件 `UploadFile` 的数据结构,可新增或
formatRequest | Function | - | 用于新增或修改文件上传请求 参数。`action` 存在时有效。一个请求上传一个文件时,默认请求字段有 `file`。<br/>一个请求上传多个文件时,默认字段有 `file[0]/file[1]/file[2]/.../length`,其中 `length` 表示本次上传的文件数量。<br/>⚠️非常注意,此处的 `file[0]/file[1]` 仅仅是一个字段名,并非表示 `file` 是一个数组,接口获取字段时注意区分。<br/>可以使用 `name` 定义 `file` 字段的别名。<br/>也可以使用 `formatRequest` 自定义任意字段,如添加一个字段 `fileList` ,存储文件数组。TS 类型:`(requestData: { [key: string]: any }) => { [key: string]: any }` | N
formatResponse | Function | - | 用于格式化文件上传后的接口响应数据,`response` 便是接口响应的原始数据。`action` 存在时有效。<br/> 示例返回值:`{ error, url, status, files }` <br/> 此函数的返回值 `error` 会作为错误文本提醒,表示上传失败的原因,如果存在会判定为本次上传失败。<br/> 此函数的返回值 `url` 会作为单个文件上传成功后的链接。<br/> `files` 表示一个请求同时上传多个文件后的文件列表。TS 类型:`(response: any, context: FormatResponseContext) => ResponseType ` `type ResponseType = { error?: string; url?: string; status?: 'fail' \| 'success'; files?: UploadFile[] } & Record<string, any>` `interface FormatResponseContext { file: UploadFile; currentFiles?: UploadFile[] }`。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/upload/type.ts) | N
headers | Object | - | 设置上传的请求头部,`action` 存在时有效。TS 类型:`{[key: string]: string}` | N
imageProps | Object | - | 用于在上传图片场景下,透传属性配置至 Image 组件 | N
imageViewerProps | Object | - | 透传图片预览组件全部属性。TS 类型:`ImageViewerProps`,[ImageViewer API Documents](./image-viewer?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/upload/type.ts) | N
inputAttributes | Object | - | 用于添加属性到 HTML 元素 `input`。TS 类型:`CSSProperties` | N
isBatchUpload | Boolean | false | 多个文件是否作为一个独立文件包,整体替换,整体删除。不允许追加文件,只允许替换文件。`theme=file-flow` 时有效 | N
Expand All @@ -51,7 +52,7 @@ triggerButtonProps | Object | - | 透传选择按钮全部属性。TS 类型:`
uploadAllFilesInOneRequest | Boolean | false | 是否在同一个请求中上传全部文件,默认一个请求上传一个文件。多文件上传时有效 | N
uploadButton | TNode | - | 批量文件/图片上传,`autoUpload=false` 场景下,透传“点击上传”按钮属性。TS 类型:`null \| ButtonProps \| TNode<{ disabled: boolean; uploading: boolean; uploadFiles: () => void; uploadText: string }>`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N
uploadPastedFiles | Boolean | true | 是否允许粘贴上传剪贴板中的文件 | N
useMockProgress | Boolean | true | 是否在请求时间超过 300ms 后显示模拟进度。上传进度有模拟进度和真实进度两种。一般大小的文件上传,真实的上传进度只有 0 和 100,不利于交互呈现,因此组件内置模拟上传进度。真实上传进度一般用于大文件上传 | N
useMockProgress | Boolean | true | 是否在请求时间超过 300ms 后显示模拟进度。上传进度有模拟进度和真实进度两种。一般大小的文件上传,真实的上传进度只有 0 和 100,不利于交互呈现,因此组件内置模拟上传进度。真实上传进度一般用于大文件上传 | N
withCredentials | Boolean | false | 上传请求时是否携带 cookie | N
onCancelUpload | Function | | TS 类型:`() => void`<br/>点击「取消上传」时触发 | N
onChange | Function | | TS 类型:`(value: Array<T>, context: UploadChangeContext) => void`<br/>已上传文件列表发生变化时触发,`trigger` 表示触发本次的来源。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/upload/type.ts)。<br/>`interface UploadChangeContext { e?: MouseEvent \| ProgressEvent; response?: any; trigger: UploadChangeTrigger; index?: number; file?: UploadFile; files?: UploadFile[] }`<br/><br/>`type UploadChangeTrigger = 'add' \| 'remove' \| 'abort' \| 'progress-success' \| 'progress' \| 'progress-fail'`<br/> | N
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default {
return ['small', 'medium', 'large'].includes(val);
},
},
/** 组件风格 */
/** 用于在使用 options 方式渲染时决定组件的风格 */
theme: {
type: String as PropType<TdRadioGroupProps['theme']>,
default: 'radio' as TdRadioGroupProps['theme'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ name | String | - | \- | N
options | Array | - | Typescript:`Array<RadioOption>` `type RadioOption = string \| number \| RadioOptionObj` `interface RadioOptionObj { label?: string \| TNode; value?: string \| number \| boolean; disabled?: boolean }`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/radio/type.ts) | N
readonly | Boolean | undefined | \- | N
size | String | medium | options: small/medium/large。Typescript:`SizeEnum`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
theme | String | radio | component Style。options: radio/button | N
theme | String | radio | Determine the style of radio when using options API。options: radio/button | N
value | String / Number / Boolean | - | `v-model` and `v-model:value` is supported。Typescript:`T` `type RadioValue = string \| number \| boolean`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/radio/type.ts) | N
defaultValue | String / Number / Boolean | - | uncontrolled property。Typescript:`T` `type RadioValue = string \| number \| boolean`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/radio/type.ts) | N
variant | String | outline | options: outline/primary-filled/default-filled | N
Expand Down
2 changes: 1 addition & 1 deletion packages/products/tdesign-vue-next/src/radio/radio.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ name | String | - | HTML 元素原生属性 | N
options | Array | - | 单选组件按钮形式。RadioOption 数据类型为 string 或 number 时,表示 label 和 value 值相同。TS 类型:`Array<RadioOption>` `type RadioOption = string \| number \| RadioOptionObj` `interface RadioOptionObj { label?: string \| TNode; value?: string \| number \| boolean; disabled?: boolean }`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/radio/type.ts) | N
readonly | Boolean | undefined | 只读状态 | N
size | String | medium | 组件尺寸【讨论中】。可选项:small/medium/large。TS 类型:`SizeEnum`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
theme | String | radio | 组件风格。可选项:radio/button | N
theme | String | radio | 用于在使用 options 方式渲染时决定组件的风格。可选项:radio/button | N
value | String / Number / Boolean | - | 选中的值。支持语法糖 `v-model` 或 `v-model:value`。TS 类型:`T` `type RadioValue = string \| number \| boolean`。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/radio/type.ts) | N
defaultValue | String / Number / Boolean | - | 选中的值。非受控属性。TS 类型:`T` `type RadioValue = string \| number \| boolean`。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/radio/type.ts) | N
variant | String | outline | 单选组件按钮形式。可选项:outline/primary-filled/default-filled | N
Expand Down
2 changes: 1 addition & 1 deletion packages/products/tdesign-vue-next/src/radio/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export interface TdRadioGroupProps<T = RadioValue> {
*/
size?: SizeEnum;
/**
* 组件风格
* 用于在使用 options 方式渲染时决定组件的风格
* @default radio
*/
theme?: 'radio' | 'button';
Expand Down
8 changes: 6 additions & 2 deletions packages/products/tdesign-vue-next/src/upload/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default {
default: {
type: [String, Function] as PropType<TdUploadProps['default']>,
},
/** 是否禁用 */
/** 是否禁用组件 */
disabled: {
type: Boolean,
default: undefined,
Expand Down Expand Up @@ -93,6 +93,10 @@ export default {
headers: {
type: Object as PropType<TdUploadProps['headers']>,
},
/** 用于在上传图片场景下,透传属性配置至 Image 组件 */
imageProps: {
type: Object as PropType<TdUploadProps['imageProps']>,
},
/** 透传图片预览组件全部属性 */
imageViewerProps: {
type: Object as PropType<TdUploadProps['imageViewerProps']>,
Expand Down Expand Up @@ -197,7 +201,7 @@ export default {
type: Boolean,
default: true,
},
/** 是否在请求时间超过 300ms 后显示模拟进度。上传进度有模拟进度和真实进度两种。一般大小的文件上传,真实的上传进度只有 0 和 100,不利于交互呈现,因此组件内置模拟上传进度。真实上传进度一般用于大文件上传 */
/** 是否在请求时间超过 300ms 后显示模拟进度。上传进度有模拟进度和真实进度两种。一般大小的文件上传,真实的上传进度只有 0 和 100,不利于交互呈现,因此组件内置模拟上传进度。真实上传进度一般用于大文件上传 */
useMockProgress: {
type: Boolean,
default: true,
Expand Down
8 changes: 6 additions & 2 deletions packages/products/tdesign-vue-next/src/upload/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export interface TdUploadProps<T extends UploadFile = UploadFile> {
*/
default?: string | TNode;
/**
* 是否禁用
* 是否禁用组件
*/
disabled?: boolean;
/**
Expand Down Expand Up @@ -99,6 +99,10 @@ export interface TdUploadProps<T extends UploadFile = UploadFile> {
* 设置上传的请求头部,`action` 存在时有效
*/
headers?: { [key: string]: string };
/**
* 用于在上传图片场景下,透传属性配置至 Image 组件
*/
imageProps?: object;
/**
* 透传图片预览组件全部属性
*/
Expand Down Expand Up @@ -207,7 +211,7 @@ export interface TdUploadProps<T extends UploadFile = UploadFile> {
*/
uploadPastedFiles?: boolean;
/**
* 是否在请求时间超过 300ms 后显示模拟进度。上传进度有模拟进度和真实进度两种。一般大小的文件上传,真实的上传进度只有 0 和 100,不利于交互呈现,因此组件内置模拟上传进度。真实上传进度一般用于大文件上传
* 是否在请求时间超过 300ms 后显示模拟进度。上传进度有模拟进度和真实进度两种。一般大小的文件上传,真实的上传进度只有 0 和 100,不利于交互呈现,因此组件内置模拟上传进度。真实上传进度一般用于大文件上传
* @default true
*/
useMockProgress?: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ format | Function | - | to redefine `UploadFile` data structure。Typescript:
formatRequest | Function | - | redefine request data。Typescript:`(requestData: { [key: string]: any }) => { [key: string]: any }` | N
formatResponse | Function | - | redefine response data structure。Typescript:`(response: any, context: FormatResponseContext) => ResponseType ` `type ResponseType = { error?: string; url?: string; status?: 'fail' \| 'success'; files?: UploadFile[] } & Record<string, any>` `interface FormatResponseContext { file: UploadFile; currentFiles?: UploadFile[] }`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/upload/type.ts) | N
headers | Object | - | HTTP Request Header。Typescript:`{[key: string]: string}` | N
imageProps | Object | - | \- | N
imageViewerProps | Object | - | ImageViewer Component Props。Typescript:`ImageViewerProps`,[ImageViewer API Documents](./image-viewer?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/upload/type.ts) | N
inputAttributes | Object | - | add attributes to HTML element `input`。Typescript:`CSSProperties` | N
isBatchUpload | Boolean | false | make all files to be a whole package, files can only be replaced or deleted together, can not add more files | N
Expand Down
Loading