// @definition CAT_UI.d.ts
interface ReactElement
{ type: T; props: P; key: string | null; }
interface Element extends ReactElement { }
interface ReactPortal extends ReactElement { children: ReactNode }
type ReactNode = ReactElement | string | number | Iterable | ReactPortal | boolean | null | undefined;
interface CSSProperties { [string]: any }
interface InputProps {
style?: CSSProperties;
className?: string | string[];
/**
* @zh 允许清空输入框
* @en Whether allow clear value
*/
allowClear?: boolean;
/**
* @zh 是否禁用
* @en Whether the input is disabled
*/
disabled?: boolean;
/**
* @zh 是否只读
* @en Whether the input is readOnly
*/
readOnly?: boolean;
/**
* @zh 默认值
* @en The initial input content
*/
defaultValue?: string;
/**
* @zh 输入框提示文字
* @en Input box prompt text
*/
placeholder?: string;
/**
* @zh 是否是错误状态.(废弃,下个大版本移除,使用 status='error' 替代)
* @en Whether the input is error.(Deprecated, removed in the next major version, use status='error' instead)
* @deprecated status="error"
*/
error?: boolean;
/**
* @zh 状态
* @en Status
* @version 2.45.0
*/
status?: 'error' | 'warning';
/**
* @zh 设置宽度自适应。minWidth 默认为 0,maxWidth 默认为 100%
* @en auto width. minWidth defaults to 0, maxWidth defaults to 100%
* @version 2.54.0
*/
autoWidth?: boolean | {
minWidth?: CSSProperties['minWidth'];
maxWidth?: CSSProperties['maxWidth'];
};
/**
/**
* @zh 输入时的回调
* @en Callback when user input
*/
onChange?: (value: string, e: any) => void;
/**
* @zh 点击清除按钮的回调
* @en Callback when click clear button
*/
onClear?: () => void;
/**
* @zh 按下回车键的回调
* @en Callback when press enter key
*/
onPressEnter?: (e: any) => void;
/**
* @zh 指定 normalize 执行的时机
* @en Specify the timing of normalize execution
* @version 2.50.0
* @defaultValue ['onBlur']
*/
normalizeTrigger?: ('onBlur' | 'onPressEnter')[];
/**
* @zh 在指定时机对用户输入的值进行格式化处理。前后值不一致时,会触发 onChange
* @en Format the value entered by the user at the specified time, and when the previous and subsequent values are inconsistent, onChange will be triggered
* @version 2.50.0
*/
normalize?: (value: string) => string;
/**
* @zh 输入框前添加元素
* @en The label text displayed before (on the left side of) the input field
*/
addBefore?: ReactNode;
/**
* @zh 输入框后添加元素
* @en The label text displayed after (on the right side of) the input field
*/
addAfter?: ReactNode;
/**
* @zh 添加前缀文字或者图标
* @en The prefix icon or text for the Input
*/
prefix?: ReactNode;
/**
* @zh 添加后缀文字或者图标
* @en The suffix icon or text for the Input
*/
suffix?: ReactNode;
/**
* @zh 输入框的值,受控模式
* @en The input content value
*/
value?: string;
/**
* @zh 输入框前添加元素的样式
* @en The additional css style of the `addBefore` element
*/
beforeStyle?: object;
/**
* @zh 输入框后添加元素的样式
* @en The additional css style of the `addAfter` element
*/
afterStyle?: object;
/**
* @zh 输入框的尺寸
* @en The size of the input box
* @defaultValue default
*/
size?: 'mini' | 'small' | 'default' | 'large';
/**
* @zh 自定义输入框高度
* @en Custom input height
*/
height?: number | string;
/**
* @zh 输入框最大输入的长度;设置 `errorOnly`为 `true` 后,超过 `maxLength` 会展示 `error` 状态,并不限制用户输入。
* @en The max content length;After setting `errorOnly` to `true`, if `maxLength` is exceeded, the `error` status will be displayed, and user input will not be restricted.
* @version `errorOnly` in 2.23.0
*/
maxLength?: number | {
length: number;
errorOnly?: boolean;
};
/**
* @zh 配合 `maxLength`,显示字数统计
* @en With `maxLength`, Show word count.
*/
showWordLimit?: boolean;
/**
* @zh `allowClear` 时配置清除按钮的图标。
* @en Configure the icon of the clear button when `allowClear`.
* @version 2.50.0
*/
clearIcon?: ReactNode;
}
interface ButtonProps {
style?: CSSProperties;
className?: string | string[];
children?: ReactNode;
/**
* @zh
* 按钮主要分为六种按钮类型:主要按钮、次级按钮、虚框按钮、文字按钮、线性按钮,`default` 为次级按钮。
* @en
* A variety of button types are available: `primary`, `secondary`, `dashed`,
* `text`, `linear` and `default` which is the secondary.
* @defaultValue default
*/
type?: 'default' | 'primary' | 'secondary' | 'dashed' | 'text' | 'outline';
/**
* @zh 按钮状态
* @en Status of the button
* @defaultValue default
*/
status?: 'warning' | 'danger' | 'success' | 'default';
/**
* @zh 按钮的尺寸
* @en Size of the button
* @defaultValue default
*/
size?: 'mini' | 'small' | 'default' | 'large';
/**
* @zh 按钮形状,`circle` - 圆形, `round` - 全圆角, `square` - 长方形
* @en Three button shapes are available: `circle`, `round` and `square`
* @defaultValue square
*/
shape?: 'circle' | 'round' | 'square';
/**
* @zh 添加跳转链接,设置此属性,button表现跟a标签一致
* @en The button behaves like `` with href as target url.
*/
href?: string;
/**
* @zh a 链接的 target 属性,href 存在时生效
* @en The target attribute of the link, which takes effect when href exists.
*/
target?: string;
/**
* @zh a 链接的原生属性,href 存在时生效
* @en The native attribute of the link, which takes effect when href exists
*/
anchorProps?: HTMLProps;
/**
* @zh 是否禁用
* @en Whether to disable the button
*/
disabled?: boolean;
/**
* @zh 按钮是否是加载状态
* @en Whether the button is in the loading state
*/
loading?: boolean;
/**
* @zh 当 loading 的时候,不改变按钮的宽度。
* @en The width of the button remains unchanged on loading
*/
loadingFixedWidth?: boolean;
/**
* @zh 设置按钮的图标
* @en Icon of the button
*/
icon?: ReactNode;
/**
* @zh 只有图标,按钮宽高相等。如果指定 `icon` 且没有 children,`iconOnly` 默认为 true
* @en Whether to show icon only, in which case the button width and height are equal. If `icon` is specified and there are no children, `iconOnly` defaults to `true`
*/
iconOnly?: boolean;
/**
* @zh 按钮宽度随容器自适应。
* @en Whether the width of the button should adapt to the container.
*/
long?: boolean;
/**
* @zh 点击按钮的回调
* @en Callback fired when the button is clicked
*/
onClick?: (e: Event) => void;
}
interface CheckboxProps {
style?: CSSProperties;
className?: string | string[];
/**
* @zh 是否禁用
* @en Whether to disable
*/
disabled?: boolean;
/**
* @zh 错误样式
* @en Whether to show in error style
*/
error?: boolean;
/**
* @zh 是否选中
* @en Whether the checkbox is checked
*/
checked?: boolean;
/**
* @zh 默认是否选中
* @en To set default checked
*/
defaultChecked?: boolean;
/**
* @zh 半选状态
* @en The indeterminate state of checkbox
*/
indeterminate?: boolean;
/**
* @zh 点击复选框的回调
* @en Callback when the state changes
*/
onChange?: (checked: boolean, e: Event) => void;
/**
* @zh 复选框的 value 属性
* @en To set checkbox value
*/
value?: T;
/**
* @zh 自定义 IconCheck
* @en Custom IconCheck
* @version 2.43.0
*/
icon?: ReactNode;
checkboxGroupValue?: T[];
onGroupChange?: (value: T, checked: boolean) => void;
isCheckboxGroup?: boolean;
children?: ReactNode | ((value: {
checked: boolean;
indeterminate: boolean;
}) => ReactNode);
}
interface SelectProps {
/**
* @zh 选择框的默认值
* @en To set default value
*/
defaultValue?: string | string[] | number | number[] | LabeledValue | LabeledValue[];
/**
* @zh 选择器的值(受控模式)
* @en To set value
*/
value?: string | string[] | number | number[] | LabeledValue | LabeledValue[];
/**
* @zh 输入框的值(受控模式)
* @en To set input value
*/
inputValue?: string;
/**
* @zh 是否开启多选模式或标签模式 (**`tags` 推荐使用 `mode: multiple; allowCreate: true` 替代,下一大版本将移除此模式**)
* @en Set mode of Select(**`tags` recommends using `mode: multiple; allowCreate: true` instead, this mode will be removed in the next major version**)
*/
mode?: 'multiple' | 'tags';
/**
* @zh 指定可选项
* @en Select options
* @version `extra` in 2.2.0
*/
options?: (string | number | {
label: ReactNode | string;
value: string | number;
disabled?: boolean;
extra?: any;
})[];
/**
* @zh 设置 `onChange` 回调中 `value` 的格式。默认是string,设置为true时候,value格式为: { label: string, value: string }
* @en Whether to embed label in value, turn the format of value from string to `{ value: string, label: ReactNode }`
*/
labelInValue?: boolean;
/**
* @zh 是否根据输入的值筛选数据。如果传入函数的话,接收 `inputValue` 和 `option` 两个参数,当option符合筛选条件时,返回 `true`,反之返回 `false`。
* @en If it's true, filter options by input value. If it's a function, filter options base on the function.
* @defaultValue true
*/
filterOption?: boolean | ((inputValue: string, option: ReactElement) => boolean);
/**
* @zh
* 定制回显内容。返回值将会显示在下拉框内。若 `value` 对应的 `Option` 不存在,则第一个参数是 null
* @en
* Customize the content that will be displayed in the Select.
* If the `Option` corresponding to `value` does not exist, the first parameter will be `null`
*/
renderFormat?: (option: OptionInfo | null, value: string | number | LabeledValue) => ReactNode;
/**
* @zh 是否默认高亮第一个选项
* @en Whether to highlight the first option by default
* @defaultValue true
*/
defaultActiveFirstOption?: boolean;
/**
* @zh 是否允许通过输入创建新的选项。
* @en Whether to allow new options to be created by input.
* @version 2.13.0, `{ formatter }` in 2.54.0
*/
allowCreate?: boolean | {
formatter: (inputValue: string, creating: boolean) => SelectProps['options'][number];
};
/**
* @zh 是否在隐藏的时候销毁 DOM 结构
* @en Whether to destroy the DOM when hiding
* @defaultValue true
*/
unmountOnExit?: boolean;
/**
* @zh 下拉框是否默认打开。
* @en Whether to show dropdown by default.
* @version 2.14.0
*/
defaultPopupVisible?: boolean;
/**
* @zh 控制下拉框是否打开。
* @en Whether to show dropdown.
* @version 2.6.0
*/
popupVisible?: boolean;
/**
* @zh 没有数据时显示的内容
* @en Specify content to show when no result matches.
*/
notFoundContent?: ReactNode;
/**
* @zh 在多选模式下自动分词的分隔符。
* @en Separator used to tokenize on `multiple` mode.
*/
tokenSeparators?: string[];
/**
* @zh 弹出框挂载的父节点。
* @en To set the container of the dropdown.
*/
getPopupContainer?: (node: HTMLElement) => Element;
/**
* @zh 触发方式。
* @en The trigger mode which executes the dropdown action.
* @defaultValue click
*/
trigger?: TriggerProps['trigger'];
/**
* @zh 自定义触发元素。
* @en The trigger element which executes the dropdown action.
* @version `() => ReactNode` in 2.31.0
*/
triggerElement?: ReactNode | ((params: {
value: any;
option: OptionInfo | OptionInfo[];
}) => ReactNode);
/**
* @zh 可以接受所有 `Trigger` 的 `Props`
* @en Pass all `Trigger` component properties
*/
triggerProps?: Partial;
/**
* @zh 自定义弹出内容。
* @en Customize dropdown content
*/
dropdownRender?: (menu: ReactNode) => ReactNode;
/**
* @zh 下拉列表的样式。
* @en The style of dropdown menu.
*/
dropdownMenuStyle?: CSSProperties;
/**
* @zh 下拉列表的类。
* @en The className of dropdown menu.
*/
dropdownMenuClassName?: string | string[];
/**
* @zh 传递虚拟滚动属性。
* @en Pass properties used by VirtualList.
* @version 2.1.0
*/
virtualListProps?: AvailableVirtualListProps;
/**
* @zh 点击选择框的回调
* @en Callback when select an option or input value change.
*/
onChange?: (value: any, option: OptionInfo | OptionInfo[]) => void;
/**
* @zh 选中选项时触发的回调,(只在 `multiple` 模式下触发)。
* @en Called when an option is selected. Only called for `multiple` mode.
* @version 2.52.0
*/
onSelect?: (value: string | number | LabeledValue, option: OptionInfo) => void;
/**
* @zh 取消选中的时候触发的回调,(只在 `multiple` 模式下触发)。
* @en Called when an option is deselected. Only called for `multiple` mode.
*/
onDeselect?: (value: string | number | LabeledValue, option: OptionInfo) => void;
/**
* @zh 点击清除时触发,参数是当前下拉框的展开状态。
* @en Called when clear
*/
onClear?: (visible: boolean) => void;
/**
* @zh 搜索时的回调
* @en Callback when input changed
*/
onSearch?: (value: string, reason: InputValueChangeReason) => void;
/**
* @zh 获得焦点时的回调
* @en Callback when get focus
*/
onFocus?: (e: any) => void;
/**
* @zh 失去焦点时的回调
* @en Callback when lose focus
*/
onBlur?: (e: any) => void;
/**
* @zh 下拉框的滚动监听函数,参数为滚动元素。
* @en Callback when dropdown scrolls.
*/
onPopupScroll?: (elem: any) => void;
/**
* @zh 下拉框收起展开时触发
* @en Callback when visibility of dropdown is changed.
*/
onVisibleChange?: (visible: boolean) => void;
/**
* @zh 输入框文本改变的回调。
* @en Callback when the value of input is changed.
* @version 2.3.0
*/
onInputValueChange?: (value: string, reason: InputValueChangeReason) => void;
/**
* @zh 输入框文本粘贴的回调。
* @en Callback when the you paste text in input box.
* @version 2.9.0
*/
onPaste?: (e: any) => void;
}
interface DrawerProps {
style?: CSSProperties;
className?: string | string[];
/**
* @zh 设置抽屉的 zIndex
* @en Set the zIndex of the drawer
* @version 2.42.0
*/
zIndex?: number;
children?: ReactNode;
/**
* @zh 设置外层容器的类名
* @en The additional class name of the container of the drawer dialog
*/
wrapClassName?: string | string[];
/**
* @zh 弹出框的标题(设置为 null 时,不显示标题栏)
* @en The title element. Drawer will not render the title element when `title` is `null`
*/
title?: ReactNode;
/**
* @zh 自定义按钮确认和取消按钮,为 null 的话没有按钮组
* @en The footer element. Drawer will not render the footer element when `footer` is `null`
*/
footer?: ReactNode;
/**
* @zh 头部的样式
* @en The additional css style for header
* @version 2.9.0
*/
headerStyle?: CSSProperties;
/**
* @zh 内容区域的样式
* @en The additional css style for content
* @version 2.9.0
*/
bodyStyle?: CSSProperties;
/**
* @zh 设置遮罩层的样式
* @en Style of the drawer mask
*/
maskStyle?: CSSProperties;
/**
* @zh 确认按钮文案
* @en Text of the OK button
*/
okText?: ReactNode;
/**
* @zh 取消按钮文案
* @en Text of the Cancel button
*/
cancelText?: ReactNode;
/**
* @zh 确认按钮的 props
* @en The props of `ok` button
* @version 2.26.0
*/
okButtonProps?: ButtonProps;
/**
* @zh 取消按钮的 props
* @en The props of `cancel` button
* @version 2.26.0
*/
cancelButtonProps?: ButtonProps;
/**
* @zh 抽屉的方向 `top` `right` `bottom` `left`
* @en The placement of the drawer: `top` `right` `bottom` `left`
* @defaultValue right
*/
placement?: 'top' | 'right' | 'bottom' | 'left';
/**
* @zh 抽屉的宽度,`placement`为 `left` `right` 时生效
* @en The width of the drawer dialog. Only works when `placement` is `left` or `right`
* @defaultValue 250
*/
width?: string | number;
/**
* @zh 抽屉的高度,`placement`为 `top` `bottom` 时生效
* @en The height of the drawer dialog. Only works when `placement` is `top` or `bottom`
* @defaultValue 250
*/
height?: string | number;
/**
* @zh 按 `ESC` 键关闭
* @en Whether to enable pressing `ESC` to close the drawer.
* @defaultValue true
* @version 2.10.0
*/
escToExit?: boolean;
/**
* @zh 是否显示遮罩
* @en Whether to show mask
* @defaultValue true
*/
mask?: boolean;
/**
* @zh 是否显示弹出框
* @en Visibility of the drawer
*/
visible?: boolean;
/**
* @zh 是否显示右上角关闭按钮
* @en Whether to show the close button on top-right of the drawer dialog
* @defaultValue true
*/
closable?: boolean;
/**
* @zh 自定义右上角关闭按钮
* @en Custom the close button on top-right of the drawer dialog
* @version 2.49.0
*/
closeIcon?: ReactNode;
/**
* @zh 点击蒙层是否可以关闭
* @en Whether to close the drawer when the mask is clicked
* @defaultValue true
*/
maskClosable?: boolean;
/**
* @zh 确认按钮是否为加载中状态
* @en Whether the OK button is in loading state
*/
confirmLoading?: boolean;
/**
* @zh 是否在初次打开对话框时才渲染 dom。
* @en Whether to render the drawer component only when it is opened initially.
* @defaultValue true
*/
mountOnEnter?: boolean;
/**
* @zh 是否在隐藏的时候销毁 DOM 结构
* @en Whether to unmount component when hidden
*/
unmountOnExit?: boolean;
/**
* @zh 点击确认按钮的回调
* @en Callback when the OK button is clicked
*/
onOk?: (e: Event) => void;
/**
* @zh 关闭弹出框的回调
* @en Callback when the Cancel button is clicked
*/
onCancel?: (e: MouseEvent | Event) => void;
/**
* @zh 抽屉打开之后的回调
* @en Callback when drawer is opened
*/
afterOpen?: () => void;
/**
* @zh 抽屉关闭之后的回调
* @en Callback when drawer is closed
*/
afterClose?: () => void;
/**
* @zh 指定弹出框挂载的父节点
* @en Parent node which the drawer should be rendered to.
* @defaultValue () => document.body
*/
getPopupContainer?: () => Element;
/**
* @zh 抽屉里的弹出框 `Select` `Tooltip` 等挂载的容器,默认挂载在对话框内。
* @en Set the mount node for popup such as `Select`, `Tooltip`, etc. Default to the drawer dialog.
*/
getChildrenPopupContainer?: (node: HTMLElement) => Element;
/**
* @zh 是否默认聚焦第一个可聚焦元素,只在 `focusLock` 开启时生效。
* @en Whether to focus on the first focusable element by default. Only works when `focusLock` is turned on.
* @defaultValue true
* @version 2.13.0
*/
autoFocus?: boolean;
/**
* @zh 是否将焦点锁定在弹出框内。
* @en Whether to lock the focus in the drawer box.
* @defaultValue true
* @version 2.13.0
*/
focusLock?: boolean;
}
interface TypographyProps {
style?: CSSProperties;
className?: string | string[];
children?: ReactNode;
}
interface CommonProps extends TypographyProps {
/**
* @zh 文本类型
* @en Text type
*/
type?: 'primary' | 'secondary' | 'success' | 'error' | 'warning';
/**
* @zh 粗体
* @en Bold style
*/
bold?: boolean;
/**
* @zh 禁用状态
* @en Disabled style
*/
disabled?: boolean;
/**
* @zh 标记样式
* @en Mark style
*/
mark?: boolean | {
color: string;
};
/**
* @zh 下划线样式
* @en Underline style
*/
underline?: boolean;
/**
* @zh 删除线样式
* @en Strikethrough style
*/
delete?: boolean;
/**
* @zh 代码块样式
* @en Code block style
*/
code?: boolean;
}
interface TypographyTextProps extends CommonProps {};
interface TypographyTitleProps extends CommonProps {
/**
* @zh 标题级别,相当于 `h1` `h2` `h3` `h4` `h5` `h6`
* @en Heading level, equivalent to `h1` `h2` `h3` `h4` `h5` `h6`
* @defaultValue 1
*/
heading?: 1 | 2 | 3 | 4 | 5 | 6;
}
interface TypographyParagraphProps extends CommonProps {
/**
* @zh 长引用
* @en Blockquote style
*/
blockquote?: boolean;
/**
* @zh
* 段落的的行高,长文本(大于5行)的时候推荐使用默认行高,短文本(小于等于3行)推荐使用 `close` 紧密的行高。
* @en
* The line height of the paragraph. The default line height is recommended for long text (more than 5 lines),
* and the close line height of `close` is recommended for short text (less than or equal to 3 lines).
* @defaultValue default
*/
spacing?: 'default' | 'close';
}
interface TableProps {
/** 是否显示单元格边框 */
borderCell?: boolean,
/** 默认展开所有可展开行 */
defaultExpandAllRows?: boolean,
/** 鼠标悬浮高亮 */
hover?: boolean,
/** 是否显示表头 */
showHeader?: boolean,
/** 斑马纹 */
stripe?: boolean,
/** 表格布局固定 */
tableLayoutFixed?: boolean,
/** 开启虚拟滚动 */
virtualized?: boolean,
/** 树形数据缩进 */
indentSize?: number,
/** 树形子节点字段名 */
childrenColumnName?: string,
/** 分页、排序、筛选变化回调 */
onChange?: (
pagination: any,
sorter: any | any[],
filters: any,
extra: { currentData: any[]; currentAllData: any[]; action: string }
) => void,
/** 分页位置 */
pagePosition?: 'br' | 'bl' | 'tr' | 'tl' | 'topCenter' | 'bottomCenter',
/** 表格尺寸 */
size?: 'default' | 'middle' | 'small' | 'mini',
/** 空数据提示 */
noDataElement?: string | ReactNode,
/** 空内容占位符 */
placeholder?: ReactNode,
/** 边框配置 */
border?: boolean | { wrapper?: boolean; headerCell?: boolean; bodyCell?: boolean; cell?: boolean },
className?: string | string[],
/** 列配置 */
columns?: any[],
/** 覆盖原生标签 */
components?: any,
/** 表格数据 */
data?: any[],
/** 默认展开行 key */
defaultExpandedRowKeys?: (string | number)[],
/** 受控展开行 key */
expandedRowKeys?: (string | number)[],
/** 展开列配置 */
expandProps?: {
expandRowByClick?: boolean;
strictTreeData?: boolean;
width?: number;
columnTitle?: ReactNode;
icon?: (props: { expanded: boolean; record: any }) => ReactNode;
rowExpandable?: (record: any) => boolean;
},
/** 加载状态 */
loading?: boolean | any,
/** 表头行事件 */
onHeaderRow?: (columns: any[], index: number) => any,
/** 分页配置 */
pagination?: any | boolean,
/** 行选择配置 */
rowSelection?: {
checkAll?: boolean;
checkCrossPage?: boolean;
checkStrictly?: boolean;
fixed?: boolean;
preserveSelectedRowKeys?: boolean;
columnWidth?: number;
type?: 'checkbox' | 'radio';
columnTitle?: string | ReactNode;
selectedRowKeys?: (string | number)[];
checkboxProps?: (record: any) => any;
onChange?: (selectedRowKeys: (string | number)[], selectedRows: any[]) => void;
onSelect?: (selected: boolean, record: any, selectedRows: any[]) => void;
onSelectAll?: (selected: boolean, selectedRows: any[]) => void;
renderCell?: (originNode: ReactNode, checked: boolean, record: any) => ReactNode;
},
/** 滚动配置 */
scroll?: { x?: number | string | boolean; y?: number | string | boolean },
/** 排序提示 */
showSorterTooltip?: boolean | any,
style?: CSSProperties,
/** 虚拟滚动配置 */
virtualListProps?: any,
/** 展开行渲染 */
expandedRowRender?: (record: any, index: number) => ReactNode,
/** 表格底部 */
footer?: (currentPageDate: any[]) => ReactNode,
/** 行展开关闭回调 */
onExpand?: (record: any, expanded: boolean) => void,
/** 展开行变化回调 */
onExpandedRowsChange?: (expandedRows: (string | number)[]) => void,
/** 表身行事件 */
onRow?: (record: any, index: number) => any,
/** 自定义分页 */
renderPagination?: (paginationNode?: ReactNode) => ReactNode,
/** 行类名 */
rowClassName?: (record: any, index: number) => string,
/** 行 key */
rowKey?: string | ((record: any) => string | number),
/** 总结栏 */
summary?: (currentData?: any[]) => ReactNode,
}
interface ModalProps {
/** 垂直水平居中 */
alignCenter?: boolean,
/** 是否默认聚焦首个可聚焦元素 */
autoFocus?: boolean,
/** 是否显示右上角关闭按钮 */
closable?: boolean,
/** 确认按钮加载状态 */
confirmLoading?: boolean,
/** 按ESC关闭 */
escToExit?: boolean,
/** 是否锁定焦点在弹窗内 */
focusLock?: boolean,
/** 是否显示遮罩 */
mask?: boolean,
/** 点击遮罩是否可关闭 */
maskClosable?: boolean,
/** 初次打开时才渲染DOM */
mountOnEnter?: boolean,
/** 简洁模式 */
simple?: boolean,
/** 隐藏后是否销毁DOM */
unmountOnExit?: boolean,
/** 是否可见 */
visible?: boolean,
/** 取消按钮文案 */
cancelText?: ReactNode,
/** 自定义关闭图标 */
closeIcon?: ReactNode,
/** 确认按钮文案 */
okText?: ReactNode,
/** 弹窗标题 */
title?: string | ReactNode,
/** 取消按钮Props */
cancelButtonProps?: ButtonProps,
className?: string | string[],
/** 遮罩样式 */
maskStyle?: CSSProperties,
/** 确认按钮Props */
okButtonProps?: ButtonProps,
/** 点击确认回调 */
onOk?: (e?: MouseEvent) => Promise | void,
style?: CSSProperties,
/** 弹窗外层类名 */
wrapClassName?: string | string[],
/** 弹窗外层样式 */
wrapStyle?: CSSProperties,
/** 关闭后回调 */
afterClose?: () => void,
/** 打开后回调 */
afterOpen?: () => void,
/** 自定义页脚 */
footer?: ReactNode | ((cancelButtonNode: ReactNode, okButtonNode: ReactNode) => ReactNode),
/** 内部弹出组件挂载容器 */
getChildrenPopupContainer?: (node: HTMLElement) => Element,
/** 弹窗挂载节点 */
getPopupContainer?: () => Element,
/** 自定义渲染弹窗 */
modalRender?: (modalNode: ReactNode) => ReactNode,
/** 关闭弹窗回调 */
onCancel?: () => void,
}
interface DOMAttributes {
children?: ReactNode | undefined;
dangerouslySetInnerHTML?: {
// Should be InnerHTML['innerHTML'].
// But unfortunately we're mixing renderer-specific type declarations.
__html: string | TrustedHTML;
} | undefined;
// Clipboard Events
onCopy?: ClipboardEventHandler | undefined;
onCopyCapture?: ClipboardEventHandler | undefined;
onCut?: ClipboardEventHandler | undefined;
onCutCapture?: ClipboardEventHandler | undefined;
onPaste?: ClipboardEventHandler | undefined;
onPasteCapture?: ClipboardEventHandler | undefined;
// Composition Events
onCompositionEnd?: CompositionEventHandler | undefined;
onCompositionEndCapture?: CompositionEventHandler | undefined;
onCompositionStart?: CompositionEventHandler | undefined;
onCompositionStartCapture?: CompositionEventHandler | undefined;
onCompositionUpdate?: CompositionEventHandler | undefined;
onCompositionUpdateCapture?: CompositionEventHandler | undefined;
// Focus Events
onFocus?: FocusEventHandler | undefined;
onFocusCapture?: FocusEventHandler | undefined;
onBlur?: FocusEventHandler | undefined;
onBlurCapture?: FocusEventHandler | undefined;
// Form Events
onChange?: FormEventHandler | undefined;
onChangeCapture?: FormEventHandler | undefined;
onBeforeInput?: InputEventHandler | undefined;
onBeforeInputCapture?: FormEventHandler | undefined;
onInput?: FormEventHandler | undefined;
onInputCapture?: FormEventHandler | undefined;
onReset?: FormEventHandler | undefined;
onResetCapture?: FormEventHandler | undefined;
onSubmit?: FormEventHandler | undefined;
onSubmitCapture?: FormEventHandler | undefined;
onInvalid?: FormEventHandler | undefined;
onInvalidCapture?: FormEventHandler | undefined;
// Image Events
onLoad?: ReactEventHandler | undefined;
onLoadCapture?: ReactEventHandler | undefined;
onError?: ReactEventHandler | undefined; // also a Media Event
onErrorCapture?: ReactEventHandler | undefined; // also a Media Event
// Keyboard Events
onKeyDown?: KeyboardEventHandler | undefined;
onKeyDownCapture?: KeyboardEventHandler | undefined;
/** @deprecated Use `onKeyUp` or `onKeyDown` instead */
onKeyPress?: KeyboardEventHandler | undefined;
/** @deprecated Use `onKeyUpCapture` or `onKeyDownCapture` instead */
onKeyPressCapture?: KeyboardEventHandler | undefined;
onKeyUp?: KeyboardEventHandler | undefined;
onKeyUpCapture?: KeyboardEventHandler | undefined;
// Media Events
onAbort?: ReactEventHandler | undefined;
onAbortCapture?: ReactEventHandler | undefined;
onCanPlay?: ReactEventHandler | undefined;
onCanPlayCapture?: ReactEventHandler | undefined;
onCanPlayThrough?: ReactEventHandler | undefined;
onCanPlayThroughCapture?: ReactEventHandler | undefined;
onDurationChange?: ReactEventHandler | undefined;
onDurationChangeCapture?: ReactEventHandler | undefined;
onEmptied?: ReactEventHandler | undefined;
onEmptiedCapture?: ReactEventHandler | undefined;
onEncrypted?: ReactEventHandler | undefined;
onEncryptedCapture?: ReactEventHandler | undefined;
onEnded?: ReactEventHandler | undefined;
onEndedCapture?: ReactEventHandler | undefined;
onLoadedData?: ReactEventHandler | undefined;
onLoadedDataCapture?: ReactEventHandler | undefined;
onLoadedMetadata?: ReactEventHandler | undefined;
onLoadedMetadataCapture?: ReactEventHandler | undefined;
onLoadStart?: ReactEventHandler | undefined;
onLoadStartCapture?: ReactEventHandler | undefined;
onPause?: ReactEventHandler | undefined;
onPauseCapture?: ReactEventHandler | undefined;
onPlay?: ReactEventHandler | undefined;
onPlayCapture?: ReactEventHandler | undefined;
onPlaying?: ReactEventHandler | undefined;
onPlayingCapture?: ReactEventHandler | undefined;
onProgress?: ReactEventHandler | undefined;
onProgressCapture?: ReactEventHandler | undefined;
onRateChange?: ReactEventHandler | undefined;
onRateChangeCapture?: ReactEventHandler | undefined;
onSeeked?: ReactEventHandler | undefined;
onSeekedCapture?: ReactEventHandler | undefined;
onSeeking?: ReactEventHandler | undefined;
onSeekingCapture?: ReactEventHandler | undefined;
onStalled?: ReactEventHandler | undefined;
onStalledCapture?: ReactEventHandler | undefined;
onSuspend?: ReactEventHandler | undefined;
onSuspendCapture?: ReactEventHandler | undefined;
onTimeUpdate?: ReactEventHandler | undefined;
onTimeUpdateCapture?: ReactEventHandler | undefined;
onVolumeChange?: ReactEventHandler | undefined;
onVolumeChangeCapture?: ReactEventHandler | undefined;
onWaiting?: ReactEventHandler | undefined;
onWaitingCapture?: ReactEventHandler | undefined;
// MouseEvents
onAuxClick?: MouseEventHandler | undefined;
onAuxClickCapture?: MouseEventHandler | undefined;
onClick?: MouseEventHandler | undefined;
onClickCapture?: MouseEventHandler | undefined;
onContextMenu?: MouseEventHandler | undefined;
onContextMenuCapture?: MouseEventHandler | undefined;
onDoubleClick?: MouseEventHandler | undefined;
onDoubleClickCapture?: MouseEventHandler | undefined;
onDrag?: DragEventHandler | undefined;
onDragCapture?: DragEventHandler | undefined;
onDragEnd?: DragEventHandler | undefined;
onDragEndCapture?: DragEventHandler | undefined;
onDragEnter?: DragEventHandler | undefined;
onDragEnterCapture?: DragEventHandler | undefined;
onDragExit?: DragEventHandler | undefined;
onDragExitCapture?: DragEventHandler | undefined;
onDragLeave?: DragEventHandler | undefined;
onDragLeaveCapture?: DragEventHandler | undefined;
onDragOver?: DragEventHandler | undefined;
onDragOverCapture?: DragEventHandler | undefined;
onDragStart?: DragEventHandler | undefined;
onDragStartCapture?: DragEventHandler | undefined;
onDrop?: DragEventHandler | undefined;
onDropCapture?: DragEventHandler | undefined;
onMouseDown?: MouseEventHandler | undefined;
onMouseDownCapture?: MouseEventHandler | undefined;
onMouseEnter?: MouseEventHandler | undefined;
onMouseLeave?: MouseEventHandler | undefined;
onMouseMove?: MouseEventHandler | undefined;
onMouseMoveCapture?: MouseEventHandler | undefined;
onMouseOut?: MouseEventHandler | undefined;
onMouseOutCapture?: MouseEventHandler | undefined;
onMouseOver?: MouseEventHandler | undefined;
onMouseOverCapture?: MouseEventHandler | undefined;
onMouseUp?: MouseEventHandler | undefined;
onMouseUpCapture?: MouseEventHandler | undefined;
// Selection Events
onSelect?: ReactEventHandler | undefined;
onSelectCapture?: ReactEventHandler | undefined;
// Touch Events
onTouchCancel?: TouchEventHandler | undefined;
onTouchCancelCapture?: TouchEventHandler | undefined;
onTouchEnd?: TouchEventHandler | undefined;
onTouchEndCapture?: TouchEventHandler | undefined;
onTouchMove?: TouchEventHandler | undefined;
onTouchMoveCapture?: TouchEventHandler | undefined;
onTouchStart?: TouchEventHandler | undefined;
onTouchStartCapture?: TouchEventHandler | undefined;
// Pointer Events
onPointerDown?: PointerEventHandler | undefined;
onPointerDownCapture?: PointerEventHandler | undefined;
onPointerMove?: PointerEventHandler | undefined;
onPointerMoveCapture?: PointerEventHandler | undefined;
onPointerUp?: PointerEventHandler | undefined;
onPointerUpCapture?: PointerEventHandler | undefined;
onPointerCancel?: PointerEventHandler | undefined;
onPointerCancelCapture?: PointerEventHandler | undefined;
onPointerEnter?: PointerEventHandler | undefined;
onPointerLeave?: PointerEventHandler | undefined;
onPointerOver?: PointerEventHandler | undefined;
onPointerOverCapture?: PointerEventHandler | undefined;
onPointerOut?: PointerEventHandler | undefined;
onPointerOutCapture?: PointerEventHandler | undefined;
onGotPointerCapture?: PointerEventHandler | undefined;
onGotPointerCaptureCapture?: PointerEventHandler | undefined;
onLostPointerCapture?: PointerEventHandler | undefined;
onLostPointerCaptureCapture?: PointerEventHandler | undefined;
// UI Events
onScroll?: UIEventHandler | undefined;
onScrollCapture?: UIEventHandler | undefined;
// Wheel Events
onWheel?: WheelEventHandler | undefined;
onWheelCapture?: WheelEventHandler | undefined;
// Animation Events
onAnimationStart?: AnimationEventHandler | undefined;
onAnimationStartCapture?: AnimationEventHandler | undefined;
onAnimationEnd?: AnimationEventHandler | undefined;
onAnimationEndCapture?: AnimationEventHandler | undefined;
onAnimationIteration?: AnimationEventHandler | undefined;
onAnimationIterationCapture?: AnimationEventHandler | undefined;
// Transition Events
onTransitionEnd?: TransitionEventHandler | undefined;
onTransitionEndCapture?: TransitionEventHandler | undefined;
}
interface AriaAttributes {
/** Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application. */
"aria-activedescendant"?: string | undefined;
/** Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute. */
"aria-atomic"?: Booleanish | undefined;
/**
* Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for an input and specifies how predictions would be
* presented if they are made.
*/
"aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined;
/** Indicates an element is being modified and that assistive technologies MAY want to wait until the modifications are complete before exposing them to the user. */
/**
* Defines a string value that labels the current element, which is intended to be converted into Braille.
* @see aria-label.
*/
"aria-braillelabel"?: string | undefined;
/**
* Defines a human-readable, author-localized abbreviated description for the role of an element, which is intended to be converted into Braille.
* @see aria-roledescription.
*/
"aria-brailleroledescription"?: string | undefined;
"aria-busy"?: Booleanish | undefined;
/**
* Indicates the current "checked" state of checkboxes, radio buttons, and other widgets.
* @see aria-pressed @see aria-selected.
*/
"aria-checked"?: boolean | "false" | "mixed" | "true" | undefined;
/**
* Defines the total number of columns in a table, grid, or treegrid.
* @see aria-colindex.
*/
"aria-colcount"?: number | undefined;
/**
* Defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid.
* @see aria-colcount @see aria-colspan.
*/
"aria-colindex"?: number | undefined;
/**
* Defines a human readable text alternative of aria-colindex.
* @see aria-rowindextext.
*/
"aria-colindextext"?: string | undefined;
/**
* Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.
* @see aria-colindex @see aria-rowspan.
*/
"aria-colspan"?: number | undefined;
/**
* Identifies the element (or elements) whose contents or presence are controlled by the current element.
* @see aria-owns.
*/
"aria-controls"?: string | undefined;
/** Indicates the element that represents the current item within a container or set of related elements. */
"aria-current"?: boolean | "false" | "true" | "page" | "step" | "location" | "date" | "time" | undefined;
/**
* Identifies the element (or elements) that describes the object.
* @see aria-labelledby
*/
"aria-describedby"?: string | undefined;
/**
* Defines a string value that describes or annotates the current element.
* @see related aria-describedby.
*/
"aria-description"?: string | undefined;
/**
* Identifies the element that provides a detailed, extended description for the object.
* @see aria-describedby.
*/
"aria-details"?: string | undefined;
/**
* Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.
* @see aria-hidden @see aria-readonly.
*/
"aria-disabled"?: Booleanish | undefined;
/**
* Indicates what functions can be performed when a dragged object is released on the drop target.
* @deprecated in ARIA 1.1
*/
"aria-dropeffect"?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined;
/**
* Identifies the element that provides an error message for the object.
* @see aria-invalid @see aria-describedby.
*/
"aria-errormessage"?: string | undefined;
/** Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed. */
"aria-expanded"?: Booleanish | undefined;
/**
* Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion,
* allows assistive technology to override the general default of reading in document source order.
*/
"aria-flowto"?: string | undefined;
/**
* Indicates an element's "grabbed" state in a drag-and-drop operation.
* @deprecated in ARIA 1.1
*/
"aria-grabbed"?: Booleanish | undefined;
/** Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element. */
"aria-haspopup"?: boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog" | undefined;
/**
* Indicates whether the element is exposed to an accessibility API.
* @see aria-disabled.
*/
"aria-hidden"?: Booleanish | undefined;
/**
* Indicates the entered value does not conform to the format expected by the application.
* @see aria-errormessage.
*/
"aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling" | undefined;
/** Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element. */
"aria-keyshortcuts"?: string | undefined;
/**
* Defines a string value that labels the current element.
* @see aria-labelledby.
*/
"aria-label"?: string | undefined;
/**
* Identifies the element (or elements) that labels the current element.
* @see aria-describedby.
*/
"aria-labelledby"?: string | undefined;
/** Defines the hierarchical level of an element within a structure. */
"aria-level"?: number | undefined;
/** Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region. */
"aria-live"?: "off" | "assertive" | "polite" | undefined;
/** Indicates whether an element is modal when displayed. */
"aria-modal"?: Booleanish | undefined;
/** Indicates whether a text box accepts multiple lines of input or only a single line. */
"aria-multiline"?: Booleanish | undefined;
/** Indicates that the user may select more than one item from the current selectable descendants. */
"aria-multiselectable"?: Booleanish | undefined;
/** Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous. */
"aria-orientation"?: "horizontal" | "vertical" | undefined;
/**
* Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship
* between DOM elements where the DOM hierarchy cannot be used to represent the relationship.
* @see aria-controls.
*/
"aria-owns"?: string | undefined;
/**
* Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value.
* A hint could be a sample value or a brief description of the expected format.
*/
"aria-placeholder"?: string | undefined;
/**
* Defines an element's number or position in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.
* @see aria-setsize.
*/
"aria-posinset"?: number | undefined;
/**
* Indicates the current "pressed" state of toggle buttons.
* @see aria-checked @see aria-selected.
*/
"aria-pressed"?: boolean | "false" | "mixed" | "true" | undefined;
/**
* Indicates that the element is not editable, but is otherwise operable.
* @see aria-disabled.
*/
"aria-readonly"?: Booleanish | undefined;
/**
* Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified.
* @see aria-atomic.
*/
"aria-relevant"?:
| "additions"
| "additions removals"
| "additions text"
| "all"
| "removals"
| "removals additions"
| "removals text"
| "text"
| "text additions"
| "text removals"
| undefined;
/** Indicates that user input is required on the element before a form may be submitted. */
"aria-required"?: Booleanish | undefined;
/** Defines a human-readable, author-localized description for the role of an element. */
"aria-roledescription"?: string | undefined;
/**
* Defines the total number of rows in a table, grid, or treegrid.
* @see aria-rowindex.
*/
"aria-rowcount"?: number | undefined;
/**
* Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid.
* @see aria-rowcount @see aria-rowspan.
*/
"aria-rowindex"?: number | undefined;
/**
* Defines a human readable text alternative of aria-rowindex.
* @see aria-colindextext.
*/
"aria-rowindextext"?: string | undefined;
/**
* Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.
* @see aria-rowindex @see aria-colspan.
*/
"aria-rowspan"?: number | undefined;
/**
* Indicates the current "selected" state of various widgets.
* @see aria-checked @see aria-pressed.
*/
"aria-selected"?: Booleanish | undefined;
/**
* Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.
* @see aria-posinset.
*/
"aria-setsize"?: number | undefined;
/** Indicates if items in a table or grid are sorted in ascending or descending order. */
"aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined;
/** Defines the maximum allowed value for a range widget. */
"aria-valuemax"?: number | undefined;
/** Defines the minimum allowed value for a range widget. */
"aria-valuemin"?: number | undefined;
/**
* Defines the current value for a range widget.
* @see aria-valuetext.
*/
"aria-valuenow"?: number | undefined;
/** Defines the human readable text alternative of aria-valuenow for a range widget. */
"aria-valuetext"?: string | undefined;
}
interface HTMLAttributes extends AriaAttributes, DOMAttributes {
// React-specific Attributes
defaultChecked?: boolean | undefined;
defaultValue?: string | number | readonly string[] | undefined;
suppressContentEditableWarning?: boolean | undefined;
suppressHydrationWarning?: boolean | undefined;
// Standard HTML Attributes
accessKey?: string | undefined;
autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {});
autoFocus?: boolean | undefined;
className?: string | undefined;
contentEditable?: Booleanish | "inherit" | "plaintext-only" | undefined;
contextMenu?: string | undefined;
dir?: string | undefined;
draggable?: Booleanish | undefined;
enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined;
hidden?: boolean | undefined;
id?: string | undefined;
lang?: string | undefined;
nonce?: string | undefined;
slot?: string | undefined;
spellCheck?: Booleanish | undefined;
style?: CSSProperties | undefined;
tabIndex?: number | undefined;
title?: string | undefined;
translate?: "yes" | "no" | undefined;
// Unknown
radioGroup?: string | undefined; // ,