diff --git a/components/_util/transButton.tsx b/components/_util/transButton.tsx index caced47cda..1de974b6c1 100644 --- a/components/_util/transButton.tsx +++ b/components/_util/transButton.tsx @@ -20,7 +20,7 @@ const TransButton = defineComponent({ inheritAttrs: false, props: { noStyle: { type: Boolean, default: undefined }, - onClick: Function, + onClick: [Function, Array], disabled: { type: Boolean, default: undefined }, autofocus: { type: Boolean, default: undefined }, }, diff --git a/components/affix/index.tsx b/components/affix/index.tsx index e6ee0e9726..fdfa691d86 100644 --- a/components/affix/index.tsx +++ b/components/affix/index.tsx @@ -54,8 +54,8 @@ export const affixProps = () => ({ }, prefixCls: String, /** 固定状态改变时触发的回调函数 */ - onChange: Function as PropType, - onTestUpdatePosition: Function as PropType, + onChange: [Function, Array] as PropType, + onTestUpdatePosition: [Function, Array] as PropType, }); export type AffixProps = Partial>>; diff --git a/components/alert/index.tsx b/components/alert/index.tsx index 2fae9e0181..3bbcc9e30a 100644 --- a/components/alert/index.tsx +++ b/components/alert/index.tsx @@ -57,7 +57,7 @@ export const alertProps = () => ({ banner: { type: Boolean, default: undefined }, icon: PropTypes.any, closeIcon: PropTypes.any, - onClose: Function as PropType, + onClose: [Function, Array] as PropType, }); export type AlertProps = Partial>>; diff --git a/components/anchor/Anchor.tsx b/components/anchor/Anchor.tsx index f5ffe30cee..eff222005f 100644 --- a/components/anchor/Anchor.tsx +++ b/components/anchor/Anchor.tsx @@ -59,8 +59,10 @@ export const anchorProps = () => ({ wrapperStyle: { type: Object as PropType, default: undefined as CSSProperties }, getCurrentAnchor: Function as PropType<() => string>, targetOffset: Number, - onChange: Function as PropType<(currentActiveLink: string) => void>, - onClick: Function as PropType<(e: MouseEvent, link: { title: any; href: string }) => void>, + onChange: [Function, Array] as PropType<(currentActiveLink: string) => void>, + onClick: [Function, Array] as PropType< + (e: MouseEvent, link: { title: any; href: string }) => void + >, }); export type AnchorProps = Partial>>; diff --git a/components/back-top/index.tsx b/components/back-top/index.tsx index fd00085c3a..67ac3d92a9 100644 --- a/components/back-top/index.tsx +++ b/components/back-top/index.tsx @@ -25,7 +25,7 @@ export const backTopProps = () => ({ duration: { type: Number, default: 450 }, target: Function as PropType<() => HTMLElement | Window | Document>, prefixCls: String, - onClick: Function as PropType, + onClick: [Function, Array] as PropType, // visible: { type: Boolean, default: undefined }, // Only for test. Don't use it. }); diff --git a/components/breadcrumb/BreadcrumbItem.tsx b/components/breadcrumb/BreadcrumbItem.tsx index a00d0e324e..65ae1205b9 100644 --- a/components/breadcrumb/BreadcrumbItem.tsx +++ b/components/breadcrumb/BreadcrumbItem.tsx @@ -12,7 +12,7 @@ export const breadcrumbItemProps = () => ({ href: String, separator: PropTypes.any, overlay: PropTypes.any, - onClick: Function as PropType, + onClick: [Function, Array] as PropType, }); export type BreadcrumbItemProps = Partial>>; diff --git a/components/button/buttonTypes.ts b/components/button/buttonTypes.ts index d4e49551d9..b846783786 100644 --- a/components/button/buttonTypes.ts +++ b/components/button/buttonTypes.ts @@ -37,10 +37,10 @@ export const buttonProps = () => ({ target: String, title: String, onClick: { - type: Function as PropType<(event: MouseEvent) => void>, + type: [Function, Array] as PropType<(event: MouseEvent) => void>, }, onMousedown: { - type: Function as PropType<(event: MouseEvent) => void>, + type: [Function, Array] as PropType<(event: MouseEvent) => void>, }, }); diff --git a/components/card/Card.tsx b/components/card/Card.tsx index d3484716f0..d79b6d348a 100644 --- a/components/card/Card.tsx +++ b/components/card/Card.tsx @@ -42,7 +42,7 @@ export const cardProps = () => ({ defaultActiveTabKey: String, cover: PropTypes.any, onTabChange: { - type: Function as PropType<(key: string) => void>, + type: [Function, Array] as PropType<(key: string) => void>, }, }); diff --git a/components/cascader/index.tsx b/components/cascader/index.tsx index 9328736c8b..f5261844c3 100644 --- a/components/cascader/index.tsx +++ b/components/cascader/index.tsx @@ -100,7 +100,7 @@ export function cascaderProps }, suffixIcon: PropTypes.any, options: Array as PropType, - 'onUpdate:value': Function as PropType<(value: ValueType) => void>, + 'onUpdate:value': [Function, Array] as PropType<(value: ValueType) => void>, }; } diff --git a/components/checkbox/interface.ts b/components/checkbox/interface.ts index e1599dd171..d1c2b8c3e0 100644 --- a/components/checkbox/interface.ts +++ b/components/checkbox/interface.ts @@ -41,9 +41,11 @@ export const checkboxGroupProps = () => { ...abstractCheckboxGroupProps(), defaultValue: { type: Array as PropType> }, value: { type: Array as PropType> }, - onChange: { type: Function as PropType<(checkedValue: Array) => void> }, + onChange: { + type: [Function, Array] as PropType<(checkedValue: Array) => void>, + }, 'onUpdate:value': { - type: Function as PropType<(checkedValue: Array) => void>, + type: [Function, Array] as PropType<(checkedValue: Array) => void>, }, }; }; @@ -63,9 +65,9 @@ export const abstractCheckboxProps = () => { indeterminate: { type: Boolean, default: undefined }, type: { type: String, default: 'checkbox' }, autofocus: { type: Boolean, default: undefined }, - onChange: Function as PropType<(e: CheckboxChangeEvent) => void>, - 'onUpdate:checked': Function as PropType<(checked: boolean) => void>, - onClick: Function as PropType, + onChange: [Function, Array] as PropType<(e: CheckboxChangeEvent) => void>, + 'onUpdate:checked': [Function, Array] as PropType<(checked: boolean) => void>, + onClick: [Function, Array] as PropType, skipGroup: { type: Boolean, default: false }, }; }; diff --git a/components/collapse/commonProps.ts b/components/collapse/commonProps.ts index 0924e88067..d75d480531 100644 --- a/components/collapse/commonProps.ts +++ b/components/collapse/commonProps.ts @@ -30,8 +30,8 @@ const collapseProps = () => ({ expandIconPosition: PropTypes.oneOf(tuple('left', 'right')), collapsible: { type: String as PropType }, ghost: { type: Boolean, default: undefined }, - onChange: Function as PropType<(key: Key | Key[]) => void>, - 'onUpdate:activeKey': Function as PropType<(key: Key | Key[]) => void>, + onChange: [Function, Array] as PropType<(key: Key | Key[]) => void>, + 'onUpdate:activeKey': [Function, Array] as PropType<(key: Key | Key[]) => void>, }); const collapsePanelProps = () => ({ @@ -51,7 +51,7 @@ const collapsePanelProps = () => ({ panelKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), collapsible: { type: String as PropType }, role: String, - onItemClick: { type: Function as PropType<(panelKey: Key) => void> }, + onItemClick: { type: [Function, Array] as PropType<(panelKey: Key) => void> }, }); export { collapseProps, collapsePanelProps }; diff --git a/components/date-picker/generatePicker/props.ts b/components/date-picker/generatePicker/props.ts index f64febfb08..d0ccbd3661 100644 --- a/components/date-picker/generatePicker/props.ts +++ b/components/date-picker/generatePicker/props.ts @@ -47,22 +47,28 @@ function commonProps() { panelRender: { type: Function as PropType<(originPanel: VueNode) => VueNode> }, // // Events onChange: { - type: Function as PropType<(value: DateType | string | null, dateString: string) => void>, + type: [Function, Array] as PropType< + (value: DateType | string | null, dateString: string) => void + >, + }, + 'onUpdate:value': { + type: [Function, Array] as PropType<(value: DateType | string | null) => void>, }, - 'onUpdate:value': { type: Function as PropType<(value: DateType | string | null) => void> }, - onOk: { type: Function as PropType<(value: DateType | string | null) => void> }, - onOpenChange: { type: Function as PropType<(open: boolean) => void> }, - 'onUpdate:open': { type: Function as PropType<(open: boolean) => void> }, - onFocus: { type: Function as PropType }, - onBlur: { type: Function as PropType }, - onMousedown: { type: Function as PropType }, - onMouseup: { type: Function as PropType }, - onMouseenter: { type: Function as PropType }, - onMouseleave: { type: Function as PropType }, - onClick: { type: Function as PropType }, - onContextmenu: { type: Function as PropType }, + onOk: { type: [Function, Array] as PropType<(value: DateType | string | null) => void> }, + onOpenChange: { type: [Function, Array] as PropType<(open: boolean) => void> }, + 'onUpdate:open': { type: [Function, Array] as PropType<(open: boolean) => void> }, + onFocus: { type: [Function, Array] as PropType }, + onBlur: { type: [Function, Array] as PropType }, + onMousedown: { type: [Function, Array] as PropType }, + onMouseup: { type: [Function, Array] as PropType }, + onMouseenter: { type: [Function, Array] as PropType }, + onMouseleave: { type: [Function, Array] as PropType }, + onClick: { type: [Function, Array] as PropType }, + onContextmenu: { type: [Function, Array] as PropType }, onKeydown: { - type: Function as PropType<(event: KeyboardEvent, preventDefault: () => void) => void>, + type: [Function, Array] as PropType< + (event: KeyboardEvent, preventDefault: () => void) => void + >, }, // WAI-ARIA role: String, @@ -204,7 +210,7 @@ function rangePickerProps() { placeholder: Array, mode: { type: Array as unknown as PropType<[PanelMode, PanelMode]> }, onChange: { - type: Function as PropType< + type: [Function, Array] as PropType< ( value: RangeValue | RangeValue | null, dateString: [string, string], @@ -212,10 +218,12 @@ function rangePickerProps() { >, }, 'onUpdate:value': { - type: Function as PropType<(value: RangeValue | RangeValue | null) => void>, + type: [Function, Array] as PropType< + (value: RangeValue | RangeValue | null) => void + >, }, onCalendarChange: { - type: Function as PropType< + type: [Function, Array] as PropType< ( values: RangeValue | RangeValue, formatString: [string, string], @@ -224,12 +232,14 @@ function rangePickerProps() { >, }, onPanelChange: { - type: Function as PropType< + type: [Function, Array] as PropType< (values: RangeValue | RangeValue, modes: [PanelMode, PanelMode]) => void >, }, onOk: { - type: Function as PropType<(dates: RangeValue | RangeValue) => void>, + type: [Function, Array] as PropType< + (dates: RangeValue | RangeValue) => void + >, }, }; } diff --git a/components/drawer/index.tsx b/components/drawer/index.tsx index 4f3325d35a..823493de54 100644 --- a/components/drawer/index.tsx +++ b/components/drawer/index.tsx @@ -82,9 +82,9 @@ export const drawerProps = () => ({ handle: PropTypes.any, /** @deprecated Use `@afterVisibleChange` instead */ afterVisibleChange: Function as PropType<(visible: boolean) => void>, - onAfterVisibleChange: Function as PropType<(visible: boolean) => void>, - 'onUpdate:visible': Function as PropType<(visible: boolean) => void>, - onClose: Function as PropType, + onAfterVisibleChange: [Function, Array] as PropType<(visible: boolean) => void>, + 'onUpdate:visible': [Function, Array] as PropType<(visible: boolean) => void>, + onClose: [Function, Array] as PropType, }); export type DrawerProps = Partial>>; diff --git a/components/dropdown/props.ts b/components/dropdown/props.ts index f983f2a429..b518ab7bc7 100644 --- a/components/dropdown/props.ts +++ b/components/dropdown/props.ts @@ -56,10 +56,10 @@ const dropdownProps = () => ({ minOverlayWidthMatchTrigger: { type: Boolean, default: undefined }, destroyPopupOnHide: { type: Boolean, default: undefined }, onVisibleChange: { - type: Function as PropType<(val: boolean) => void>, + type: [Function, Array] as PropType<(val: boolean) => void>, }, 'onUpdate:visible': { - type: Function as PropType<(val: boolean) => void>, + type: [Function, Array] as PropType<(val: boolean) => void>, }, }); @@ -76,7 +76,7 @@ const dropdownButtonProps = () => ({ title: String, loading: buttonTypesProps.loading, onClick: { - type: Function as PropType, + type: [Function, Array] as PropType, }, }); diff --git a/components/form/Form.tsx b/components/form/Form.tsx index 5c8221fc97..adbea67d87 100755 --- a/components/form/Form.tsx +++ b/components/form/Form.tsx @@ -58,15 +58,15 @@ export const formProps = () => ({ validateOnRuleChange: { type: Boolean, default: undefined }, // 提交失败自动滚动到第一个错误字段 scrollToFirstError: { type: [Boolean, Object] as PropType }, - onSubmit: Function as PropType<(e: Event) => void>, + onSubmit: [Function, Array] as PropType<(e: Event) => void>, name: String, validateTrigger: { type: [String, Array] as PropType }, size: { type: String as PropType }, - onValuesChange: { type: Function as PropType }, - onFieldsChange: { type: Function as PropType }, - onFinish: { type: Function as PropType }, - onFinishFailed: { type: Function as PropType }, - onValidate: { type: Function as PropType }, + onValuesChange: { type: [Function, Array] as PropType }, + onFieldsChange: { type: [Function, Array] as PropType }, + onFinish: { type: [Function, Array] as PropType }, + onFinishFailed: { type: [Function, Array] as PropType }, + onValidate: { type: [Function, Array] as PropType }, }); export type FormProps = Partial>>; diff --git a/components/form/FormItemLabel.tsx b/components/form/FormItemLabel.tsx index 2b0dd28a94..874a6675eb 100644 --- a/components/form/FormItemLabel.tsx +++ b/components/form/FormItemLabel.tsx @@ -18,7 +18,7 @@ export interface FormItemLabelProps { requiredMark?: RequiredMark; required?: boolean; prefixCls: string; - onClick: Function; + onClick: [Function, Function[]]; } const FormItemLabel: FunctionalComponent = (props, { slots, emit, attrs }) => { diff --git a/components/input-number/src/InputNumber.tsx b/components/input-number/src/InputNumber.tsx index 6817e3be8c..15e9e172ec 100644 --- a/components/input-number/src/InputNumber.tsx +++ b/components/input-number/src/InputNumber.tsx @@ -65,17 +65,17 @@ export const inputNumberProps = () => ({ /** Syntactic sugar of `formatter`. Config decimal separator of display. */ decimalSeparator: { type: String as PropType }, - onInput: { type: Function as PropType<(text: string) => void> }, - onChange: { type: Function as PropType<(value: ValueType) => void> }, - onPressEnter: { type: Function as PropType }, + onInput: { type: [Function, Array] as PropType<(text: string) => void> }, + onChange: { type: [Function, Array] as PropType<(value: ValueType) => void> }, + onPressEnter: { type: [Function, Array] as PropType }, onStep: { - type: Function as PropType< + type: [Function, Array] as PropType< (value: ValueType, info: { offset: ValueType; type: 'up' | 'down' }) => void >, }, - onBlur: { type: Function as PropType<(e: FocusEvent) => void> }, - onFocus: { type: Function as PropType<(e: FocusEvent) => void> }, + onBlur: { type: [Function, Array] as PropType<(e: FocusEvent) => void> }, + onFocus: { type: [Function, Array] as PropType<(e: FocusEvent) => void> }, }); export default defineComponent({ diff --git a/components/input-number/src/StepHandler.tsx b/components/input-number/src/StepHandler.tsx index f63beb2176..df8297863d 100644 --- a/components/input-number/src/StepHandler.tsx +++ b/components/input-number/src/StepHandler.tsx @@ -21,7 +21,7 @@ export default defineComponent({ prefixCls: String, upDisabled: Boolean, downDisabled: Boolean, - onStep: { type: Function as PropType<(up: boolean) => void> }, + onStep: { type: [Function, Array] as PropType<(up: boolean) => void> }, }, slots: ['upNode', 'downNode'], setup(props, { slots, emit }) { diff --git a/components/input/Group.tsx b/components/input/Group.tsx index 22557ed8fa..0248f29d9b 100644 --- a/components/input/Group.tsx +++ b/components/input/Group.tsx @@ -11,10 +11,10 @@ export default defineComponent({ prefixCls: String, size: { type: String as PropType }, compact: { type: Boolean, default: undefined }, - onMouseenter: { type: Function as PropType }, - onMouseleave: { type: Function as PropType }, - onFocus: { type: Function as PropType }, - onBlur: { type: Function as PropType }, + onMouseenter: { type: [Function, Array] as PropType }, + onMouseleave: { type: [Function, Array] as PropType }, + onFocus: { type: [Function, Array] as PropType }, + onBlur: { type: [Function, Array] as PropType }, }, setup(props, { slots }) { const { prefixCls, direction } = useConfigInject('input-group', props); diff --git a/components/input/Search.tsx b/components/input/Search.tsx index eb495e37bb..f48cb688fa 100644 --- a/components/input/Search.tsx +++ b/components/input/Search.tsx @@ -23,7 +23,7 @@ export default defineComponent({ // 不能设置默认值 https://github.com/vueComponent/ant-design-vue/issues/1916 enterButton: PropTypes.any, onSearch: { - type: Function as PropType< + type: [Function, Array] as PropType< (value: string, event?: ChangeEvent | MouseEvent | KeyboardEvent) => void >, }, diff --git a/components/input/inputProps.ts b/components/input/inputProps.ts index 01f9a75099..7b6feb6138 100644 --- a/components/input/inputProps.ts +++ b/components/input/inputProps.ts @@ -69,14 +69,14 @@ const inputProps = () => ({ bordered: { type: Boolean, default: undefined }, showCount: { type: [Boolean, Object] as PropType }, htmlSize: Number, - onPressEnter: Function as PropType, - onKeydown: Function as PropType, - onKeyup: Function as PropType, - onFocus: Function as PropType, - onBlur: Function as PropType, - onChange: Function as PropType, - onInput: Function as PropType, - 'onUpdate:value': Function as PropType<(val: string) => void>, + onPressEnter: [Function, Array] as PropType, + onKeydown: [Function, Array] as PropType, + onKeyup: [Function, Array] as PropType, + onFocus: [Function, Array] as PropType, + onBlur: [Function, Array] as PropType, + onChange: [Function, Array] as PropType, + onInput: [Function, Array] as PropType, + 'onUpdate:value': [Function, Array] as PropType<(val: string) => void>, valueModifiers: Object, hidden: Boolean, }); @@ -95,9 +95,11 @@ const textAreaProps = () => ({ rows: Number, autosize: { type: [Boolean, Object] as PropType, default: undefined }, autoSize: { type: [Boolean, Object] as PropType, default: undefined }, - onResize: { type: Function as PropType<(size: { width: number; height: number }) => void> }, - onCompositionstart: Function as PropType, - onCompositionend: Function as PropType, + onResize: { + type: [Function, Array] as PropType<(size: { width: number; height: number }) => void>, + }, + onCompositionstart: [Function, Array] as PropType, + onCompositionend: [Function, Array] as PropType, valueModifiers: Object, }); diff --git a/components/layout/Sider.tsx b/components/layout/Sider.tsx index cf3de3db39..c7236f0209 100644 --- a/components/layout/Sider.tsx +++ b/components/layout/Sider.tsx @@ -38,8 +38,8 @@ export const siderProps = () => ({ collapsedWidth: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), breakpoint: PropTypes.oneOf(tuple('xs', 'sm', 'md', 'lg', 'xl', 'xxl', 'xxxl')), theme: PropTypes.oneOf(tuple('light', 'dark')).def('dark'), - onBreakpoint: Function as PropType<(broken: boolean) => void>, - onCollapse: Function as PropType<(collapsed: boolean, type: CollapseType) => void>, + onBreakpoint: [Function, Array] as PropType<(broken: boolean) => void>, + onCollapse: [Function, Array] as PropType<(collapsed: boolean, type: CollapseType) => void>, }); export type SiderProps = Partial>>; diff --git a/components/mentions/index.tsx b/components/mentions/index.tsx index 85f3802fcf..9c0f856fbb 100644 --- a/components/mentions/index.tsx +++ b/components/mentions/index.tsx @@ -63,22 +63,22 @@ export const mentionsProps = () => ({ ...baseMentionsProps, loading: { type: Boolean, default: undefined }, onFocus: { - type: Function as PropType<(e: FocusEvent) => void>, + type: [Function, Array] as PropType<(e: FocusEvent) => void>, }, onBlur: { - type: Function as PropType<(e: FocusEvent) => void>, + type: [Function, Array] as PropType<(e: FocusEvent) => void>, }, onSelect: { - type: Function as PropType<(option: MentionsOptionProps, prefix: string) => void>, + type: [Function, Array] as PropType<(option: MentionsOptionProps, prefix: string) => void>, }, onChange: { - type: Function as PropType<(text: string) => void>, + type: [Function, Array] as PropType<(text: string) => void>, }, onPressenter: { - type: Function as PropType, + type: [Function, Array] as PropType, }, 'onUpdate:value': { - type: Function as PropType<(text: string) => void>, + type: [Function, Array] as PropType<(text: string) => void>, }, notFoundContent: PropTypes.any, defaultValue: String, diff --git a/components/menu/src/Menu.tsx b/components/menu/src/Menu.tsx index f695d2653d..2549445186 100644 --- a/components/menu/src/Menu.tsx +++ b/components/menu/src/Menu.tsx @@ -68,16 +68,16 @@ export const menuProps = () => ({ getPopupContainer: Function as PropType<(node: HTMLElement) => HTMLElement>, expandIcon: Function as PropType<(p?: { isOpen: boolean; [key: string]: any }) => any>, - onOpenChange: Function as PropType<(keys: Key[]) => void>, - onSelect: Function as PropType, - onDeselect: Function as PropType, + onOpenChange: [Function, Array] as PropType<(keys: Key[]) => void>, + onSelect: [Function, Array] as PropType, + onDeselect: [Function, Array] as PropType, onClick: [Function, Array] as PropType, - onFocus: Function as PropType, - onBlur: Function as PropType, - onMousedown: Function as PropType, - 'onUpdate:openKeys': Function as PropType<(keys: Key[]) => void>, - 'onUpdate:selectedKeys': Function as PropType<(keys: Key[]) => void>, - 'onUpdate:activeKey': Function as PropType<(key: Key) => void>, + onFocus: [Function, Array] as PropType, + onBlur: [Function, Array] as PropType, + onMousedown: [Function, Array] as PropType, + 'onUpdate:openKeys': [Function, Array] as PropType<(keys: Key[]) => void>, + 'onUpdate:selectedKeys': [Function, Array] as PropType<(keys: Key[]) => void>, + 'onUpdate:activeKey': [Function, Array] as PropType<(key: Key) => void>, }); export type MenuProps = Partial>>; diff --git a/components/menu/src/MenuItem.tsx b/components/menu/src/MenuItem.tsx index f8d9cc6a0d..008852e34d 100644 --- a/components/menu/src/MenuItem.tsx +++ b/components/menu/src/MenuItem.tsx @@ -21,11 +21,11 @@ export const menuItemProps = () => ({ danger: Boolean, title: { type: [String, Boolean], default: undefined }, icon: PropTypes.any, - onMouseenter: Function as PropType, - onMouseleave: Function as PropType, - onClick: Function as PropType, - onKeydown: Function as PropType, - onFocus: Function as PropType, + onMouseenter: [Function, Array] as PropType, + onMouseleave: [Function, Array] as PropType, + onClick: [Function, Array] as PropType, + onKeydown: [Function, Array] as PropType, + onFocus: [Function, Array] as PropType, }); export type MenuItemProps = Partial>>; diff --git a/components/menu/src/PopupTrigger.tsx b/components/menu/src/PopupTrigger.tsx index 1690651624..e1f3236aaa 100644 --- a/components/menu/src/PopupTrigger.tsx +++ b/components/menu/src/PopupTrigger.tsx @@ -26,7 +26,7 @@ export default defineComponent({ popupClassName: String, popupOffset: Array as PropType, disabled: Boolean, - onVisibleChange: Function as PropType<(visible: boolean) => void>, + onVisibleChange: [Function, Array] as PropType<(visible: boolean) => void>, }, slots: ['popup'], emits: ['visibleChange'], diff --git a/components/menu/src/SubMenu.tsx b/components/menu/src/SubMenu.tsx index 8d1ef33188..534ed0ebd3 100644 --- a/components/menu/src/SubMenu.tsx +++ b/components/menu/src/SubMenu.tsx @@ -34,9 +34,9 @@ export const subMenuProps = () => ({ internalPopupClose: Boolean, eventKey: String, expandIcon: Function as PropType<(p?: { isOpen: boolean; [key: string]: any }) => any>, - onMouseenter: Function as PropType, - onMouseleave: Function as PropType, - onTitleClick: Function as PropType<(e: MouseEvent, key: Key) => void>, + onMouseenter: [Function, Array] as PropType, + onMouseleave: [Function, Array] as PropType, + onTitleClick: [Function, Array] as PropType<(e: MouseEvent, key: Key) => void>, }); export type SubMenuProps = Partial>>; diff --git a/components/modal/Modal.tsx b/components/modal/Modal.tsx index b13b7edb6a..a31eb8cda4 100644 --- a/components/modal/Modal.tsx +++ b/components/modal/Modal.tsx @@ -41,10 +41,10 @@ export const modalProps = () => ({ title: PropTypes.any, closable: { type: Boolean, default: undefined }, closeIcon: PropTypes.any, - onOk: Function as PropType<(e: MouseEvent) => void>, - onCancel: Function as PropType<(e: MouseEvent) => void>, - 'onUpdate:visible': Function as PropType<(visible: boolean) => void>, - onChange: Function as PropType<(visible: boolean) => void>, + onOk: [Function, Array] as PropType<(e: MouseEvent) => void>, + onCancel: [Function, Array] as PropType<(e: MouseEvent) => void>, + 'onUpdate:visible': [Function, Array] as PropType<(visible: boolean) => void>, + onChange: [Function, Array] as PropType<(visible: boolean) => void>, afterClose: Function as PropType<() => void>, centered: { type: Boolean, default: undefined }, width: [String, Number], diff --git a/components/page-header/index.tsx b/components/page-header/index.tsx index 4da27e9a5f..6e8199c6ba 100644 --- a/components/page-header/index.tsx +++ b/components/page-header/index.tsx @@ -26,7 +26,7 @@ export const pageHeaderProps = () => ({ extra: PropTypes.any, avatar: PropTypes.object, ghost: { type: Boolean, default: undefined }, - onBack: Function as PropType, + onBack: [Function, Array] as PropType, }); export type PageHeaderProps = Partial>>; diff --git a/components/pagination/Pagination.tsx b/components/pagination/Pagination.tsx index 36c255ba62..2479965533 100644 --- a/components/pagination/Pagination.tsx +++ b/components/pagination/Pagination.tsx @@ -46,10 +46,10 @@ export const paginationProps = () => ({ role: String, responsive: Boolean, showLessItems: { type: Boolean, default: undefined }, - onChange: Function as PropType<(page: number, pageSize: number) => void>, - onShowSizeChange: Function as PropType<(current: number, size: number) => void>, - 'onUpdate:current': Function as PropType<(current: number) => void>, - 'onUpdate:pageSize': Function as PropType<(size: number) => void>, + onChange: [Function, Array] as PropType<(page: number, pageSize: number) => void>, + onShowSizeChange: [Function, Array] as PropType<(current: number, size: number) => void>, + 'onUpdate:current': [Function, Array] as PropType<(current: number) => void>, + 'onUpdate:pageSize': [Function, Array] as PropType<(size: number) => void>, }); export type PaginationPosition = 'top' | 'bottom' | 'both'; diff --git a/components/popconfirm/index.tsx b/components/popconfirm/index.tsx index 6bbe831f54..1d8e65b2ca 100644 --- a/components/popconfirm/index.tsx +++ b/components/popconfirm/index.tsx @@ -44,8 +44,8 @@ export const popconfirmProps = () => ({ default: undefined as ButtonProps & HTMLAttributes, }, showCancel: { type: Boolean, default: true }, - onConfirm: Function as PropType<(e: MouseEvent) => void>, - onCancel: Function as PropType<(e: MouseEvent) => void>, + onConfirm: [Function, Array] as PropType<(e: MouseEvent) => void>, + onCancel: [Function, Array] as PropType<(e: MouseEvent) => void>, }); export type PopconfirmProps = Partial>>; diff --git a/components/radio/Group.tsx b/components/radio/Group.tsx index 0548defaa5..8627a706ec 100644 --- a/components/radio/Group.tsx +++ b/components/radio/Group.tsx @@ -32,8 +32,8 @@ export const radioGroupProps = () => ({ buttonStyle: { type: String as PropType, default: 'outline' }, id: String, optionType: { type: String as PropType, default: 'default' }, - onChange: Function as PropType<(e: RadioChangeEvent) => void>, - 'onUpdate:value': Function as PropType<(val: any) => void>, + onChange: [Function, Array] as PropType<(e: RadioChangeEvent) => void>, + 'onUpdate:value': [Function, Array] as PropType<(val: any) => void>, }); export type RadioGroupProps = Partial>>; diff --git a/components/radio/Radio.tsx b/components/radio/Radio.tsx index 64c080d9c3..dc53525aae 100644 --- a/components/radio/Radio.tsx +++ b/components/radio/Radio.tsx @@ -18,12 +18,12 @@ export const radioProps = () => ({ name: String, id: String, autofocus: { type: Boolean, default: undefined }, - onChange: Function as PropType<(event: RadioChangeEvent) => void>, - onFocus: Function as PropType, - onBlur: Function as PropType, - onClick: Function as PropType, - 'onUpdate:checked': Function as PropType<(checked: boolean) => void>, - 'onUpdate:value': Function as PropType<(checked: boolean) => void>, + onChange: [Function, Array] as PropType<(event: RadioChangeEvent) => void>, + onFocus: [Function, Array] as PropType, + onBlur: [Function, Array] as PropType, + onClick: [Function, Array] as PropType, + 'onUpdate:checked': [Function, Array] as PropType<(checked: boolean) => void>, + 'onUpdate:value': [Function, Array] as PropType<(checked: boolean) => void>, }); export type RadioProps = Partial>>; diff --git a/components/rate/Star.tsx b/components/rate/Star.tsx index 0eb16b558f..cc22878324 100644 --- a/components/rate/Star.tsx +++ b/components/rate/Star.tsx @@ -13,8 +13,8 @@ export const starProps = { characterRender: Function, focused: { type: Boolean, default: undefined }, count: Number, - onClick: Function, - onHover: Function, + onClick: [Function, Array], + onHover: [Function, Array], }; export type StarProps = Partial>; diff --git a/components/rate/index.tsx b/components/rate/index.tsx index d7a7ad9566..41806dca10 100644 --- a/components/rate/index.tsx +++ b/components/rate/index.tsx @@ -29,12 +29,12 @@ export const rateProps = () => ({ tabindex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), direction: String as PropType, id: String, - onChange: Function as PropType<(value: number) => void>, - onHoverChange: Function as PropType<(value: number) => void>, - 'onUpdate:value': Function as PropType<(value: number) => void>, - onFocus: Function as PropType, - onBlur: Function as PropType, - onKeydown: Function as PropType, + onChange: [Function, Array] as PropType<(value: number) => void>, + onHoverChange: [Function, Array] as PropType<(value: number) => void>, + 'onUpdate:value': [Function, Array] as PropType<(value: number) => void>, + onFocus: [Function, Array] as PropType, + onBlur: [Function, Array] as PropType, + onKeydown: [Function, Array] as PropType, }); export type RateProps = Partial>>; diff --git a/components/select/index.tsx b/components/select/index.tsx index e013d27dfa..d2c058eee9 100644 --- a/components/select/index.tsx +++ b/components/select/index.tsx @@ -48,7 +48,7 @@ export const selectProps = () => ({ bordered: { type: Boolean, default: true }, transitionName: String, choiceTransitionName: { type: String, default: '' }, - 'onUpdate:value': Function as PropType<(val: SelectValue) => void>, + 'onUpdate:value': [Function, Array] as PropType<(val: SelectValue) => void>, }); export type SelectProps = Partial>>; diff --git a/components/slider/index.tsx b/components/slider/index.tsx index b1bc32d1e2..93d311df02 100644 --- a/components/slider/index.tsx +++ b/components/slider/index.tsx @@ -67,11 +67,11 @@ export const sliderProps = () => ({ autofocus: { type: Boolean, default: undefined }, handleStyle: { type: [Object, Array] as PropType }, trackStyle: { type: [Object, Array] as PropType }, - onChange: { type: Function as PropType<(value: Value) => void> }, - onAfterChange: { type: Function as PropType<(value: Value) => void> }, - onFocus: { type: Function as PropType }, - onBlur: { type: Function as PropType }, - 'onUpdate:value': { type: Function as PropType<(value: Value) => void> }, + onChange: { type: [Function, Array] as PropType<(value: Value) => void> }, + onAfterChange: { type: [Function, Array] as PropType<(value: Value) => void> }, + onFocus: { type: [Function, Array] as PropType }, + onBlur: { type: [Function, Array] as PropType }, + 'onUpdate:value': { type: [Function, Array] as PropType<(value: Value) => void> }, }); export type SliderProps = Partial>>; diff --git a/components/statistic/Countdown.tsx b/components/statistic/Countdown.tsx index ecba9fcea2..4befbd6aa2 100644 --- a/components/statistic/Countdown.tsx +++ b/components/statistic/Countdown.tsx @@ -16,8 +16,8 @@ export const countdownProps = () => { ...statisticProps(), value: [Number, String, Object] as PropType, format: String, - onFinish: Function as PropType<() => void>, - onChange: Function as PropType<(value?: countdownValueType) => void>, + onFinish: [Function, Array] as PropType<() => void>, + onChange: [Function, Array] as PropType<(value?: countdownValueType) => void>, }; }; diff --git a/components/steps/index.tsx b/components/steps/index.tsx index dad2b58e75..3469beabb6 100644 --- a/components/steps/index.tsx +++ b/components/steps/index.tsx @@ -30,8 +30,8 @@ export const stepsProps = () => ({ default: undefined as boolean | ProgressDotRender, }, type: String as PropType<'default' | 'navigation'>, - onChange: Function as PropType<(current: number) => void>, - 'onUpdate:current': Function as PropType<(current: number) => void>, + onChange: [Function, Array] as PropType<(current: number) => void>, + 'onUpdate:current': [Function, Array] as PropType<(current: number) => void>, }); export const stepProps = () => ({ @@ -41,7 +41,7 @@ export const stepProps = () => ({ disabled: { type: Boolean, default: undefined }, title: PropTypes.any, subTitle: PropTypes.any, - onClick: Function as PropType, + onClick: [Function, Array] as PropType, }); export type StepsProps = Partial>>; diff --git a/components/switch/index.tsx b/components/switch/index.tsx index b0c86a406d..c2f7114b7b 100644 --- a/components/switch/index.tsx +++ b/components/switch/index.tsx @@ -34,22 +34,22 @@ export const switchProps = () => ({ PropTypes.looseBool, ]).def(false), onChange: { - type: Function as PropType<(checked: CheckedType, e: Event) => void>, + type: [Function, Array] as PropType<(checked: CheckedType, e: Event) => void>, }, onClick: { - type: Function as PropType<(checked: CheckedType, e: Event) => void>, + type: [Function, Array] as PropType<(checked: CheckedType, e: Event) => void>, }, onKeydown: { - type: Function as PropType<(e: Event) => void>, + type: [Function, Array] as PropType<(e: Event) => void>, }, onMouseup: { - type: Function as PropType<(e: Event) => void>, + type: [Function, Array] as PropType<(e: Event) => void>, }, 'onUpdate:checked': { - type: Function as PropType<(checked: CheckedType) => void>, + type: [Function, Array] as PropType<(checked: CheckedType) => void>, }, - onBlur: Function as PropType, - onFocus: Function as PropType, + onBlur: [Function, Array] as PropType, + onFocus: [Function, Array] as PropType, }); export type SwitchProps = Partial>>; diff --git a/components/table/Table.tsx b/components/table/Table.tsx index 68dec9e8ae..7c23d4d27b 100644 --- a/components/table/Table.tsx +++ b/components/table/Table.tsx @@ -151,13 +151,13 @@ export const tableProps = () => { default: undefined, }, expandIcon: { type: Function as PropType, default: undefined }, - onExpand: { type: Function as PropType, default: undefined }, + onExpand: { type: [Function, Array] as PropType, default: undefined }, onExpandedRowsChange: { - type: Function as PropType, + type: [Function, Array] as PropType, default: undefined, }, 'onUpdate:expandedRowKeys': { - type: Function as PropType, + type: [Function, Array] as PropType, default: undefined, }, defaultExpandAllRows: { @@ -194,7 +194,7 @@ export const tableProps = () => { locale: { type: Object as PropType, default: undefined }, onChange: { - type: Function as PropType< + type: [Function, Array] as PropType< ( pagination: TablePaginationConfig, filters: Record, @@ -205,7 +205,7 @@ export const tableProps = () => { default: undefined, }, onResizeColumn: { - type: Function as PropType<(w: number, col: ColumnType) => void>, + type: [Function, Array] as PropType<(w: number, col: ColumnType) => void>, default: undefined, }, rowSelection: { type: Object as PropType, default: undefined }, diff --git a/components/table/hooks/useFilter/FilterSearch.tsx b/components/table/hooks/useFilter/FilterSearch.tsx index 9b47d0f097..78b95564d3 100644 --- a/components/table/hooks/useFilter/FilterSearch.tsx +++ b/components/table/hooks/useFilter/FilterSearch.tsx @@ -10,7 +10,7 @@ export default defineComponent({ inheritAttrs: false, props: { value: String, - onChange: Function as PropType<(e: InputEvent) => void>, + onChange: [Function, Array] as PropType<(e: InputEvent) => void>, filterSearch: Boolean, tablePrefixCls: String, locale: { type: Object as PropType, default: undefined as TableLocale }, diff --git a/components/tabs/src/TabNavList/OperationNode.tsx b/components/tabs/src/TabNavList/OperationNode.tsx index 22ec38af1c..fd6157364b 100644 --- a/components/tabs/src/TabNavList/OperationNode.tsx +++ b/components/tabs/src/TabNavList/OperationNode.tsx @@ -24,7 +24,9 @@ export const operationNodeProps = { editable: { type: Object as PropType }, locale: { type: Object as PropType, default: undefined as TabsLocale }, removeAriaLabel: String, - onTabClick: { type: Function as PropType<(key: Key, e: MouseEvent | KeyboardEvent) => void> }, + onTabClick: { + type: [Function, Array] as PropType<(key: Key, e: MouseEvent | KeyboardEvent) => void>, + }, }; export type OperationNodeProps = Partial>; diff --git a/components/tabs/src/TabNavList/TabNode.tsx b/components/tabs/src/TabNavList/TabNode.tsx index 5117ac9314..fdba0a6163 100644 --- a/components/tabs/src/TabNavList/TabNode.tsx +++ b/components/tabs/src/TabNavList/TabNode.tsx @@ -30,16 +30,16 @@ export default defineComponent({ active: { type: Boolean }, closable: { type: Boolean }, editable: { type: Object as PropType }, - onClick: { type: Function as PropType<(e: MouseEvent | KeyboardEvent) => void> }, + onClick: { type: [Function, Array] as PropType<(e: MouseEvent | KeyboardEvent) => void> }, onResize: { - type: Function as PropType< + type: [Function, Array] as PropType< (width: number, height: number, left: number, top: number) => void >, }, renderWrapper: { type: Function as PropType<(node: any) => any> }, removeAriaLabel: { type: String }, - // onRemove: { type: Function as PropType<() => void> }, - onFocus: { type: Function as PropType }, + // onRemove: { type: [Function, Array] as PropType<() => void> }, + onFocus: { type: [Function, Array] as PropType }, }, emits: ['click', 'resize', 'remove', 'focus'], setup(props, { expose, attrs }) { diff --git a/components/tabs/src/TabNavList/index.tsx b/components/tabs/src/TabNavList/index.tsx index e215682186..49f52dc8a3 100644 --- a/components/tabs/src/TabNavList/index.tsx +++ b/components/tabs/src/TabNavList/index.tsx @@ -45,9 +45,9 @@ export const tabNavListProps = () => { renderTabBar: { type: Function as PropType }, locale: { type: Object as PropType, default: undefined as TabsLocale }, onTabClick: { - type: Function as PropType<(activeKey: Key, e: MouseEvent | KeyboardEvent) => void>, + type: [Function, Array] as PropType<(activeKey: Key, e: MouseEvent | KeyboardEvent) => void>, }, - onTabScroll: { type: Function as PropType }, + onTabScroll: { type: [Function, Array] as PropType }, }; }; diff --git a/components/tabs/src/Tabs.tsx b/components/tabs/src/Tabs.tsx index 2a16924edd..69ef6753f4 100644 --- a/components/tabs/src/Tabs.tsx +++ b/components/tabs/src/Tabs.tsx @@ -55,20 +55,20 @@ export const tabsProps = () => { size: { type: String as PropType }, centered: Boolean, onEdit: { - type: Function as PropType< + type: [Function, Array] as PropType< (e: MouseEvent | KeyboardEvent | Key, action: 'add' | 'remove') => void >, }, - onChange: { type: Function as PropType<(activeKey: Key) => void> }, + onChange: { type: [Function, Array] as PropType<(activeKey: Key) => void> }, onTabClick: { - type: Function as PropType<(activeKey: Key, e: KeyboardEvent | MouseEvent) => void>, + type: [Function, Array] as PropType<(activeKey: Key, e: KeyboardEvent | MouseEvent) => void>, }, - onTabScroll: { type: Function as PropType }, - 'onUpdate:activeKey': { type: Function as PropType<(activeKey: Key) => void> }, + onTabScroll: { type: [Function, Array] as PropType }, + 'onUpdate:activeKey': { type: [Function, Array] as PropType<(activeKey: Key) => void> }, // Accessibility locale: { type: Object as PropType, default: undefined as TabsLocale }, - onPrevClick: Function as PropType, - onNextClick: Function as PropType, + onPrevClick: [Function, Array] as PropType, + onNextClick: [Function, Array] as PropType, tabBarExtraContent: PropTypes.any, }; }; diff --git a/components/tag/CheckableTag.tsx b/components/tag/CheckableTag.tsx index 001b6c02cc..4960ba19c9 100644 --- a/components/tag/CheckableTag.tsx +++ b/components/tag/CheckableTag.tsx @@ -7,12 +7,12 @@ const checkableTagProps = () => ({ prefixCls: String, checked: { type: Boolean, default: undefined }, onChange: { - type: Function as PropType<(checked: boolean) => void>, + type: [Function, Array] as PropType<(checked: boolean) => void>, }, onClick: { - type: Function as PropType<(e: MouseEvent) => void>, + type: [Function, Array] as PropType<(e: MouseEvent) => void>, }, - 'onUpdate:checked': Function as PropType<(checked: boolean) => void>, + 'onUpdate:checked': [Function, Array] as PropType<(checked: boolean) => void>, }); export type CheckableTagProps = Partial>>; diff --git a/components/tag/index.tsx b/components/tag/index.tsx index 7ad896a996..87741e2ae6 100644 --- a/components/tag/index.tsx +++ b/components/tag/index.tsx @@ -22,9 +22,9 @@ export const tagProps = () => ({ closeIcon: PropTypes.any, visible: { type: Boolean, default: undefined }, onClose: { - type: Function as PropType<(e: MouseEvent) => void>, + type: [Function, Array] as PropType<(e: MouseEvent) => void>, }, - 'onUpdate:visible': Function as PropType<(vis: boolean) => void>, + 'onUpdate:visible': [Function, Array] as PropType<(vis: boolean) => void>, icon: PropTypes.any, }); diff --git a/components/tooltip/abstractTooltipProps.ts b/components/tooltip/abstractTooltipProps.ts index 7d20ed2d64..78a14a5504 100644 --- a/components/tooltip/abstractTooltipProps.ts +++ b/components/tooltip/abstractTooltipProps.ts @@ -46,6 +46,6 @@ export default () => ({ default: undefined as BuildInPlacements, }, children: Array, - onVisibleChange: Function as PropType<(vis: boolean) => void>, - 'onUpdate:visible': Function as PropType<(vis: boolean) => void>, + onVisibleChange: [Function, Array] as PropType<(vis: boolean) => void>, + 'onUpdate:visible': [Function, Array] as PropType<(vis: boolean) => void>, }); diff --git a/components/transfer/ListBody.tsx b/components/transfer/ListBody.tsx index 0136bf2072..3e4bd5148e 100644 --- a/components/transfer/ListBody.tsx +++ b/components/transfer/ListBody.tsx @@ -13,9 +13,9 @@ export const transferListBodyProps = { disabled: { type: Boolean, default: undefined }, showRemove: { type: Boolean, default: undefined }, pagination: PropTypes.any, - onItemSelect: Function, - onScroll: Function, - onItemRemove: Function, + onItemSelect: [Function, Array], + onScroll: [Function, Array], + onItemRemove: [Function, Array], }; export type TransferListBodyProps = Partial>; diff --git a/components/transfer/ListItem.tsx b/components/transfer/ListItem.tsx index 267fba7f92..e6070b0da0 100644 --- a/components/transfer/ListItem.tsx +++ b/components/transfer/ListItem.tsx @@ -19,8 +19,8 @@ export const transferListItemProps = { prefixCls: String, disabled: { type: Boolean, default: undefined }, showRemove: { type: Boolean, default: undefined }, - onClick: Function, - onRemove: Function, + onClick: [Function, Array], + onRemove: [Function, Array], }; export type TransferListItemProps = Partial>; diff --git a/components/transfer/index.tsx b/components/transfer/index.tsx index 786bf10c66..1202fef2da 100644 --- a/components/transfer/index.tsx +++ b/components/transfer/index.tsx @@ -90,16 +90,16 @@ export const transferProps = () => ({ children: { type: Function as PropType<(props: TransferListBodyProps) => VueNode> }, oneWay: { type: Boolean, default: undefined }, pagination: { type: [Object, Boolean] as PropType, default: undefined }, - onChange: Function as PropType< + onChange: [Function, Array] as PropType< (targetKeys: string[], direction: TransferDirection, moveKeys: string[]) => void >, - onSelectChange: Function as PropType< + onSelectChange: [Function, Array] as PropType< (sourceSelectedKeys: string[], targetSelectedKeys: string[]) => void >, - onSearch: Function as PropType<(direction: TransferDirection, value: string) => void>, - onScroll: Function as PropType<(direction: TransferDirection, e: UIEvent) => void>, - 'onUpdate:targetKeys': Function as PropType<(keys: string[]) => void>, - 'onUpdate:selectedKeys': Function as PropType<(keys: string[]) => void>, + onSearch: [Function, Array] as PropType<(direction: TransferDirection, value: string) => void>, + onScroll: [Function, Array] as PropType<(direction: TransferDirection, e: UIEvent) => void>, + 'onUpdate:targetKeys': [Function, Array] as PropType<(keys: string[]) => void>, + 'onUpdate:selectedKeys': [Function, Array] as PropType<(keys: string[]) => void>, }); export type TransferProps = Partial>>; diff --git a/components/transfer/list.tsx b/components/transfer/list.tsx index 2a75f62491..a8317c933f 100644 --- a/components/transfer/list.tsx +++ b/components/transfer/list.tsx @@ -53,10 +53,10 @@ export const transferListProps = { selectAllLabel: PropTypes.any, showRemove: { type: Boolean, default: undefined }, pagination: PropTypes.any, - onItemSelect: Function, - onItemSelectAll: Function, - onItemRemove: Function, - onScroll: Function, + onItemSelect: [Function, Array], + onItemSelectAll: [Function, Array], + onItemRemove: [Function, Array], + onScroll: [Function, Array], }; export type TransferListProps = Partial>; diff --git a/components/transfer/search.tsx b/components/transfer/search.tsx index efac7a7007..f3c8932bed 100644 --- a/components/transfer/search.tsx +++ b/components/transfer/search.tsx @@ -11,7 +11,7 @@ export const transferSearchProps = { value: String, handleClear: Function, disabled: { type: Boolean, default: undefined }, - onChange: Function, + onChange: [Function, Array], }; export type TransferSearchProps = Partial>; diff --git a/components/tree-select/index.tsx b/components/tree-select/index.tsx index b61489e4cb..bf9de98735 100644 --- a/components/tree-select/index.tsx +++ b/components/tree-select/index.tsx @@ -62,9 +62,9 @@ export function treeSelectProps< bordered: { type: Boolean, default: undefined }, treeLine: { type: [Boolean, Object] as PropType, default: undefined }, replaceFields: { type: Object as PropType }, - 'onUpdate:value': { type: Function as PropType<(value: any) => void> }, - 'onUpdate:treeExpandedKeys': { type: Function as PropType<(keys: Key[]) => void> }, - 'onUpdate:searchValue': { type: Function as PropType<(value: string) => void> }, + 'onUpdate:value': { type: [Function, Array] as PropType<(value: any) => void> }, + 'onUpdate:treeExpandedKeys': { type: [Function, Array] as PropType<(keys: Key[]) => void> }, + 'onUpdate:searchValue': { type: [Function, Array] as PropType<(value: string) => void> }, }; } export type TreeSelectProps = Partial>>; diff --git a/components/tree/Tree.tsx b/components/tree/Tree.tsx index 9f2fb6d066..473fc6a503 100644 --- a/components/tree/Tree.tsx +++ b/components/tree/Tree.tsx @@ -133,9 +133,9 @@ export const treeProps = () => { blockNode: { type: Boolean, default: undefined }, openAnimation: PropTypes.any, onDoubleclick: baseTreeProps.onDblclick, - 'onUpdate:selectedKeys': Function as PropType<(keys: Key[]) => void>, - 'onUpdate:checkedKeys': Function as PropType<(keys: Key[]) => void>, - 'onUpdate:expandedKeys': Function as PropType<(keys: Key[]) => void>, + 'onUpdate:selectedKeys': [Function, Array] as PropType<(keys: Key[]) => void>, + 'onUpdate:checkedKeys': [Function, Array] as PropType<(keys: Key[]) => void>, + 'onUpdate:expandedKeys': [Function, Array] as PropType<(keys: Key[]) => void>, }; }; diff --git a/components/typography/Base.tsx b/components/typography/Base.tsx index 1e92bb145e..bae8060dcd 100644 --- a/components/typography/Base.tsx +++ b/components/typography/Base.tsx @@ -119,7 +119,7 @@ export const baseProps = () => ({ strong: { type: Boolean, default: undefined }, keyboard: { type: Boolean, default: undefined }, content: String, - 'onUpdate:content': Function as PropType<(content: string) => void>, + 'onUpdate:content': [Function, Array] as PropType<(content: string) => void>, }); const Base = defineComponent({ diff --git a/components/typography/Editable.tsx b/components/typography/Editable.tsx index 4f0fd9dbfc..0d549f659c 100644 --- a/components/typography/Editable.tsx +++ b/components/typography/Editable.tsx @@ -12,10 +12,10 @@ const editableProps = () => ({ value: String, maxlength: Number, autoSize: { type: [Boolean, Object] as PropType }, - onSave: Function as PropType<(val: string) => void>, - onCancel: Function as PropType<() => void>, - onEnd: Function as PropType<() => void>, - onChange: Function as PropType<(val: string) => void>, + onSave: [Function, Array] as PropType<(val: string) => void>, + onCancel: [Function, Array] as PropType<() => void>, + onEnd: [Function, Array] as PropType<() => void>, + onChange: [Function, Array] as PropType<(val: string) => void>, originContent: String, direction: String as PropType, }); diff --git a/components/upload/UploadList/ListItem.tsx b/components/upload/UploadList/ListItem.tsx index 229f4132aa..3a165397f3 100644 --- a/components/upload/UploadList/ListItem.tsx +++ b/components/upload/UploadList/ListItem.tsx @@ -42,9 +42,9 @@ export const listItemProps = () => { }) => VueNode >, itemRender: Function as PropType, - onPreview: Function as PropType<(file: UploadFile, e: Event) => void>, - onClose: Function as PropType<(file: UploadFile) => void>, - onDownload: Function as PropType<(file: UploadFile) => void>, + onPreview: [Function, Array] as PropType<(file: UploadFile, e: Event) => void>, + onClose: [Function, Array] as PropType<(file: UploadFile) => void>, + onDownload: [Function, Array] as PropType<(file: UploadFile) => void>, progress: Object as PropType, }; }; diff --git a/components/upload/interface.tsx b/components/upload/interface.tsx index 8e5d563223..ea5b203616 100755 --- a/components/upload/interface.tsx +++ b/components/upload/interface.tsx @@ -114,16 +114,16 @@ function uploadProps() { FileList: FileType[], ) => BeforeUploadValueType | Promise >, - onChange: Function as PropType<(info: UploadChangeParam>) => void>, - 'onUpdate:fileList': Function as PropType< + onChange: [Function, Array] as PropType<(info: UploadChangeParam>) => void>, + 'onUpdate:fileList': [Function, Array] as PropType< (fileList: UploadChangeParam>['fileList']) => void >, - onDrop: Function as PropType<(event: DragEvent) => void>, + onDrop: [Function, Array] as PropType<(event: DragEvent) => void>, listType: String as PropType, - onPreview: Function as PropType<(file: UploadFile) => void>, - onDownload: Function as PropType<(file: UploadFile) => void>, - onReject: Function as PropType<(fileList: FileType[]) => void>, - onRemove: Function as PropType< + onPreview: [Function, Array] as PropType<(file: UploadFile) => void>, + onDownload: [Function, Array] as PropType<(file: UploadFile) => void>, + onReject: [Function, Array] as PropType<(fileList: FileType[]) => void>, + onRemove: [Function, Array] as PropType< (file: UploadFile) => void | boolean | Promise >, /** @deprecated Please use `onRemove` directly */ @@ -164,9 +164,9 @@ export interface UploadState { function uploadListProps() { return { listType: String as PropType, - onPreview: Function as PropType<(file: UploadFile) => void>, - onDownload: Function as PropType<(file: UploadFile) => void>, - onRemove: Function as PropType<(file: UploadFile) => void | boolean>, + onPreview: [Function, Array] as PropType<(file: UploadFile) => void>, + onDownload: [Function, Array] as PropType<(file: UploadFile) => void>, + onRemove: [Function, Array] as PropType<(file: UploadFile) => void | boolean>, items: Array as PropType>>, progress: Object as PropType, prefixCls: String as PropType,