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.
Original file line number Diff line number Diff line change
@@ -1,68 +1,69 @@
:: BASE_DOC ::

## API

### DialogCard Props

name | type | default | description | required
-- | -- | -- | -- | --
className | String | - | className of component | N
style | Object | - | CSS(Cascading Style Sheets),Typescript`React.CSSProperties` | N
`Pick<DialogProps, 'body' \| 'cancelBtn' \| 'closeBtn' \| 'confirmBtn' \| 'footer' \| 'header' \| 'theme' \| 'onCancel' \| 'onCloseBtnClick' \| 'onConfirm' \| 'confirmLoading'>` | TNode | - | extends `Pick<DialogProps, 'body' \| 'cancelBtn' \| 'closeBtn' \| 'confirmBtn' \| 'footer' \| 'header' \| 'theme' \| 'onCancel' \| 'onCloseBtnClick' \| 'onConfirm' \| 'confirmLoading'>`。Typescript`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
style | Object | - | CSS(Cascading Style Sheets),Typescript: `React.CSSProperties` | N
`Pick<DialogProps, 'body' \| 'cancelBtn' \| 'closeBtn' \| 'confirmBtn' \| 'footer' \| 'header' \| 'theme' \| 'onCancel' \| 'onCloseBtnClick' \| 'onConfirm' \| 'confirmLoading'>` | TNode | - | extends `Pick<DialogProps, 'body' \| 'cancelBtn' \| 'closeBtn' \| 'confirmBtn' \| 'footer' \| 'header' \| 'theme' \| 'onCancel' \| 'onCloseBtnClick' \| 'onConfirm' \| 'confirmLoading'>`。Typescript: `string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N


### Dialog Props

name | type | default | description | required
-- | -- | -- | -- | --
className | String | - | className of component | N
style | Object | - | CSS(Cascading Style Sheets),Typescript`React.CSSProperties` | N
attach | String / Function | - | Typescript`AttachNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
body | TNode | - | Typescript`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
cancelBtn | TNode | - | Typescript`string \| ButtonProps \| TNode \| null`,[Button API Documents](./button?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/dialog/type.ts) | N
children | TNode | - | Typescript`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
closeBtn | TNode | true | Typescript`string \| boolean \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
style | Object | - | CSS(Cascading Style Sheets),Typescript: `React.CSSProperties` | N
attach | String / Function | - | Typescript: `AttachNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
body | TNode | - | Typescript: `string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
cancelBtn | TNode | - | Typescript: `string \| ButtonProps \| TNode \| null`,[Button API Documents](./button?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/dialog/type.ts) | N
children | TNode | - | Typescript: `string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
closeBtn | TNode | true | Typescript: `string \| boolean \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
closeOnEscKeydown | Boolean | true | trigger dialog close event on `ESC` keydown | N
closeOnOverlayClick | Boolean | true | \- | N
confirmBtn | TNode | - | Typescript`string \| ButtonProps \| TNode \| null`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
confirmBtn | TNode | - | Typescript: `string \| ButtonProps \| TNode \| null`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
confirmLoading | Boolean | undefined | confirm button loading status | N
confirmOnEnter | Boolean | - | confirm on enter | N
destroyOnClose | Boolean | false | \- | N
dialogClassName | String | - | \- | N
dialogStyle | Object | - | Styles that apply to the dialog box itself。Typescript`Styles`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
draggable | Boolean | false | \- | N
footer | TNode | true | Typescript`boolean \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
dialogStyle | Object | - | Styles that apply to the dialog box itself。Typescript: `Styles`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
draggable | Boolean | false | not effective in `full-screen` mode | N
footer | TNode | true | Typescript: `boolean \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
forceRender | Boolean | false | to force render Dialog | N
header | TNode | true | Typescript`string \| boolean \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
header | TNode | true | Typescript: `string \| boolean \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
lazy | Boolean | false | Enable Dialog lazy loading, the contents of the dialog box are not rendered when enable | N
mode | String | modal | options: modal/modeless/normal/full-screen | N
placement | String | top | options: top/center | N
preventScrollThrough | Boolean | true | \- | N
showInAttachedElement | Boolean | false | \- | N
showOverlay | Boolean | true | \- | N
sizeDraggable | Boolean / Object | false | allow resizing dialog width/height, set max or min to limit size.。Typescript`boolean \| DialogSizeDragLimit` `interface DialogSizeDragLimit { maxWidth: number\|undefined, minWidth: number\|undefined, maxHeight: number\|undefined, minHeight: number\|undefined }`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/dialog/type.ts) | N
sizeDraggable | Boolean / Object | false | allow resizing dialog width/height, set max or min to limit size.。Typescript: `boolean \| DialogSizeDragLimit` `interface DialogSizeDragLimit { maxWidth: number\|undefined, minWidth: number\|undefined, maxHeight: number\|undefined, minHeight: number\|undefined }`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/dialog/type.ts) | N
theme | String | default | options: default/info/warning/danger/success | N
top | String / Number | - | \- | N
visible | Boolean | - | \- | N
width | String / Number | - | \- | N
zIndex | Number | - | \- | N
onBeforeClose | Function | | Typescript`() => void`<br/> | N
onBeforeOpen | Function | | Typescript`() => void`<br/> | N
onCancel | Function | | Typescript`(context: { e: MouseEvent }) => void`<br/> | N
onClose | Function | | Typescript`(context: DialogCloseContext) => void`<br/>[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/dialog/type.ts)。<br/>`type DialogEventSource = 'esc' \| 'close-btn' \| 'cancel' \| 'overlay'`<br/><br/>`interface DialogCloseContext { trigger: DialogEventSource; e: MouseEvent \| KeyboardEvent }`<br/> | N
onCloseBtnClick | Function | | Typescript`(context: { e: MouseEvent }) => void`<br/> | N
onClosed | Function | | Typescript`() => void`<br/> | N
onConfirm | Function | | Typescript`(context: { e: MouseEvent \| KeyboardEvent }) => void`<br/> | N
onEscKeydown | Function | | Typescript`(context: { e: KeyboardEvent }) => void`<br/> | N
onOpened | Function | | Typescript`() => void`<br/> | N
onOverlayClick | Function | | Typescript`(context: { e: MouseEvent }) => void`<br/> | N
onBeforeClose | Function | | Typescript: `() => void`<br/> | N
onBeforeOpen | Function | | Typescript: `() => void`<br/> | N
onCancel | Function | | Typescript: `(context: { e: MouseEvent }) => void`<br/> | N
onClose | Function | | Typescript: `(context: DialogCloseContext) => void`<br/>[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/dialog/type.ts)。<br/>`type DialogEventSource = 'esc' \| 'close-btn' \| 'cancel' \| 'overlay'`<br/><br/>`interface DialogCloseContext { trigger: DialogEventSource; e: MouseEvent \| KeyboardEvent }`<br/> | N
onCloseBtnClick | Function | | Typescript: `(context: { e: MouseEvent }) => void`<br/> | N
onClosed | Function | | Typescript: `() => void`<br/> | N
onConfirm | Function | | Typescript: `(context: { e: MouseEvent \| KeyboardEvent }) => void`<br/> | N
onEscKeydown | Function | | Typescript: `(context: { e: KeyboardEvent }) => void`<br/> | N
onOpened | Function | | Typescript: `() => void`<br/> | N
onOverlayClick | Function | | Typescript: `(context: { e: MouseEvent }) => void`<br/> | N

### DialogOptions

name | type | default | description | required
-- | -- | -- | -- | --
attach | String / Function | 'body' | Typescript`AttachNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
attach | String / Function | 'body' | Typescript: `AttachNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
className | String | - | \- | N
style | Object | - | Typescript`Styles`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
style | Object | - | Typescript: `Styles`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
`Omit<DialogProps, 'attach'>` | \- | - | extends `Omit<DialogProps, 'attach'>` | N

### DialogInstance
Expand All @@ -79,18 +80,16 @@ update | `(props: DialogOptions)` | \- | required

name | params | default | description
-- | -- | -- | --
options | \- | - | Typescript:`DialogOptions`

插件返回值:`DialogInstance`
options | \- | - | Typescript: `DialogOptions`

### dialog.confirm 或 DialogPlugin.confirm

name | params | default | description
-- | -- | -- | --
options | \- | - | Typescript`DialogOptions`
options | \- | - | Typescript: `DialogOptions`

### dialog.alert 或 DialogPlugin.alert

name | params | default | description
-- | -- | -- | --
options | Object | - | Typescript`Omit<DialogOptions, 'cancelBtn'>`
options | Object | - | Typescript: `Omit<DialogOptions, 'cancelBtn'>`
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
:: BASE_DOC ::

## API

### DialogCard Props

名称 | 类型 | 默认值 | 描述 | 必传
Expand Down Expand Up @@ -29,7 +30,7 @@ confirmOnEnter | Boolean | - | 是否在按下回车键时,触发确认事件
destroyOnClose | Boolean | false | 是否在关闭弹框的时候销毁子元素 | N
dialogClassName | String | - | 弹框元素类名,示例:'t-class-dialog-first t-class-dialog-second' | N
dialogStyle | Object | - | 作用于对话框本身的样式。TS 类型:`Styles`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
draggable | Boolean | false | 对话框是否可以拖拽(仅在非模态对话框时有效) | N
draggable | Boolean | false | 是否可以拖拽(对全屏对话框无效) | N
footer | TNode | true | 底部操作栏,默认会有“确认”和“取消”两个按钮。值为 true 显示默认操作按钮,值为 false 不显示任何内容,值类型为 Function 表示自定义底部内容。TS 类型:`boolean \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
forceRender | Boolean | false | 是否强制渲染Dialog | N
header | TNode | true | 头部内容。值为 true 显示空白头部,值为 false 不显示任何内容,值类型为 string 则直接显示值,值类型为 Function 表示自定义头部内容。TS 类型:`string \| boolean \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
Expand Down Expand Up @@ -81,8 +82,6 @@ update | `(props: DialogOptions)` | \- | 必需。更新弹框内容
-- | -- | -- | --
options | \- | - | TS 类型:`DialogOptions`

插件返回值:`DialogInstance`

### dialog.confirm 或 DialogPlugin.confirm

参数名称 | 参数类型 | 参数默认值 | 参数描述
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export interface TdDialogProps {
*/
dialogStyle?: Styles;
/**
* 对话框是否可以拖拽(仅在非模态对话框时有效
* 是否可以拖拽(对全屏对话框无效
* @default false
*/
draggable?: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ export interface UploadDisplayDragEvents {

export type ImageEvent = Event;

/**
* 通用全局类型
* */
export type PlainObject = { [key: string]: any };

export type OptionData = {
Expand All @@ -63,6 +60,9 @@ export type TreeOptionData<T = string | number> = {
content?: string | TNode;
} & PlainObject;

/**
* 通用全局类型
* */
export type SizeEnum = 'small' | 'medium' | 'large';

export type ShapeEnum = 'circle' | 'round';
Expand Down
Loading