diff --git a/components/_util/Portal.tsx b/components/_util/Portal.tsx index c18749339..cde3e70e0 100644 --- a/components/_util/Portal.tsx +++ b/components/_util/Portal.tsx @@ -15,7 +15,7 @@ export default defineComponent({ inheritAttrs: false, props: { getContainer: PropTypes.func.isRequired, - didUpdate: PropTypes.func, + didUpdate: Function, }, setup(props, { slots }) { let isSSR = true; diff --git a/components/_util/PortalWrapper.tsx b/components/_util/PortalWrapper.tsx index 6f53b3740..66491fc73 100644 --- a/components/_util/PortalWrapper.tsx +++ b/components/_util/PortalWrapper.tsx @@ -52,10 +52,10 @@ export default defineComponent({ name: 'PortalWrapper', inheritAttrs: false, props: { - wrapperClassName: PropTypes.string, - forceRender: PropTypes.looseBool, + wrapperClassName: String, + forceRender: { type: Boolean, default: undefined }, getContainer: PropTypes.any, - visible: PropTypes.looseBool, + visible: { type: Boolean, default: undefined }, }, setup(props, { slots }) { diff --git a/components/_util/transButton.tsx b/components/_util/transButton.tsx index b0f8900e0..eca8c6991 100644 --- a/components/_util/transButton.tsx +++ b/components/_util/transButton.tsx @@ -19,10 +19,10 @@ const TransButton = defineComponent({ name: 'TransButton', inheritAttrs: false, props: { - noStyle: PropTypes.looseBool, - onClick: PropTypes.func, - disabled: PropTypes.looseBool, - autofocus: PropTypes.looseBool, + noStyle: { type: Boolean, default: undefined }, + onClick: Function, + disabled: { type: Boolean, default: undefined }, + autofocus: { type: Boolean, default: undefined }, }, setup(props, { slots, emit, attrs, expose }) { const domRef = ref(); diff --git a/components/alert/index.tsx b/components/alert/index.tsx index 7d99b9f35..ab8debcfd 100644 --- a/components/alert/index.tsx +++ b/components/alert/index.tsx @@ -44,7 +44,7 @@ export const alertProps = () => ({ */ type: PropTypes.oneOf(AlertTypes), /** Whether Alert can be closed */ - closable: PropTypes.looseBool, + closable: { type: Boolean, default: undefined }, /** Close text to show */ closeText: PropTypes.any, /** Content of Alert */ @@ -54,9 +54,9 @@ export const alertProps = () => ({ /** Trigger when animation ending of Alert */ afterClose: PropTypes.func.def(noop), /** Whether to show icon */ - showIcon: PropTypes.looseBool, - prefixCls: PropTypes.string, - banner: PropTypes.looseBool, + showIcon: { type: Boolean, default: undefined }, + prefixCls: String, + banner: { type: Boolean, default: undefined }, icon: PropTypes.any, closeIcon: PropTypes.any, onClose: Function as PropType, diff --git a/components/anchor/AnchorLink.tsx b/components/anchor/AnchorLink.tsx index 6981e0a07..8f747b800 100644 --- a/components/anchor/AnchorLink.tsx +++ b/components/anchor/AnchorLink.tsx @@ -7,10 +7,10 @@ import useConfigInject from '../_util/hooks/useConfigInject'; import { useInjectAnchor } from './context'; export const anchorLinkProps = { - prefixCls: PropTypes.string, + prefixCls: String, href: PropTypes.string.def('#'), title: PropTypes.any, - target: PropTypes.string, + target: String, }; export type AnchorLinkProps = Partial>; diff --git a/components/auto-complete/index.tsx b/components/auto-complete/index.tsx index 6ce8ef91f..c9765c35a 100644 --- a/components/auto-complete/index.tsx +++ b/components/auto-complete/index.tsx @@ -17,7 +17,7 @@ export const autoCompleteProps = { ...omit(selectProps(), ['loading', 'mode', 'optionLabelProp', 'labelInValue']), dataSource: PropTypes.array, dropdownMenuStyle: PropTypes.style, - // optionLabelProp: PropTypes.string, + // optionLabelProp: String, dropdownMatchSelectWidth: { type: [Number, Boolean], default: true }, }; @@ -32,12 +32,12 @@ const AutoComplete = defineComponent({ inheritAttrs: false, props: { ...autoCompleteProps, - prefixCls: PropTypes.string, - showSearch: PropTypes.looseBool, - transitionName: PropTypes.string, + prefixCls: String, + showSearch: { type: Boolean, default: undefined }, + transitionName: String, choiceTransitionName: PropTypes.string.def('zoom'), - autofocus: PropTypes.looseBool, - backfill: PropTypes.looseBool, + autofocus: { type: Boolean, default: undefined }, + backfill: { type: Boolean, default: undefined }, // optionLabelProp: PropTypes.string.def('children'), filterOption: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.func]).def(false), defaultActiveFirstOption: PropTypes.looseBool.def(true), diff --git a/components/avatar/Avatar.tsx b/components/avatar/Avatar.tsx index 130a62483..2294bbd73 100644 --- a/components/avatar/Avatar.tsx +++ b/components/avatar/Avatar.tsx @@ -15,18 +15,18 @@ import eagerComputed from '../_util/eagerComputed'; export type AvatarSize = 'large' | 'small' | 'default' | number | ScreenSizeMap; export const avatarProps = () => ({ - prefixCls: PropTypes.string, + prefixCls: String, shape: PropTypes.oneOf(tuple('circle', 'square')).def('circle'), size: { type: [Number, String, Object] as PropType, default: (): AvatarSize => 'default', }, - src: PropTypes.string, + src: String, /** Srcset of image avatar */ - srcset: PropTypes.string, + srcset: String, icon: PropTypes.any, - alt: PropTypes.string, - gap: PropTypes.number, + alt: String, + gap: Number, draggable: PropTypes.bool, crossOrigin: String as PropType<'' | 'anonymous' | 'use-credentials'>, loadError: { diff --git a/components/avatar/Group.tsx b/components/avatar/Group.tsx index a70c9cd9a..3806c1630 100644 --- a/components/avatar/Group.tsx +++ b/components/avatar/Group.tsx @@ -11,8 +11,8 @@ import useConfigInject from '../_util/hooks/useConfigInject'; import useProvideSize from '../_util/hooks/useSize'; export const groupProps = () => ({ - prefixCls: PropTypes.string, - maxCount: PropTypes.number, + prefixCls: String, + maxCount: Number, maxStyle: { type: Object as PropType, default: () => ({} as CSSProperties), diff --git a/components/back-top/index.tsx b/components/back-top/index.tsx index 05ee70a04..95fc4c2cd 100644 --- a/components/back-top/index.tsx +++ b/components/back-top/index.tsx @@ -24,9 +24,9 @@ export const backTopProps = { visibilityHeight: PropTypes.number.def(400), duration: PropTypes.number.def(450), target: Function as PropType<() => HTMLElement | Window | Document>, - prefixCls: PropTypes.string, - onClick: PropTypes.func, - // visible: PropTypes.looseBool, // Only for test. Don't use it. + prefixCls: String, + onClick: Function, + // visible: { type: Boolean, default: undefined }, // Only for test. Don't use it. }; export type BackTopProps = Partial>; diff --git a/components/badge/Badge.tsx b/components/badge/Badge.tsx index e2f0d0230..efd8e1cf9 100644 --- a/components/badge/Badge.tsx +++ b/components/badge/Badge.tsx @@ -15,21 +15,21 @@ import isNumeric from '../_util/isNumeric'; export const badgeProps = { /** Number to show in badge */ count: PropTypes.any, - showZero: PropTypes.looseBool, + showZero: { type: Boolean, default: undefined }, /** Max count to show */ overflowCount: PropTypes.number.def(99), /** whether to show red dot without number */ - dot: PropTypes.looseBool, - prefixCls: PropTypes.string, - scrollNumberPrefixCls: PropTypes.string, + dot: { type: Boolean, default: undefined }, + prefixCls: String, + scrollNumberPrefixCls: String, status: PropTypes.oneOf(tuple('success', 'processing', 'default', 'error', 'warning')), // sync antd@4.6.0 size: PropTypes.oneOf(tuple('default', 'small')).def('default'), - color: PropTypes.string, + color: String, text: PropTypes.any, offset: PropTypes.arrayOf(PropTypes.oneOfType([String, Number])), numberStyle: PropTypes.style, - title: PropTypes.string, + title: String, }; export type BadgeProps = Partial>; diff --git a/components/badge/Ribbon.tsx b/components/badge/Ribbon.tsx index 58d0f6aae..ddffd5e13 100644 --- a/components/badge/Ribbon.tsx +++ b/components/badge/Ribbon.tsx @@ -8,7 +8,7 @@ import PropTypes from '../_util/vue-types'; import useConfigInject from '../_util/hooks/useConfigInject'; export const ribbonProps = { - prefix: PropTypes.string, + prefix: String, color: { type: String as PropType> }, text: PropTypes.any, placement: PropTypes.oneOf(tuple('start', 'end')).def('end'), diff --git a/components/badge/ScrollNumber.tsx b/components/badge/ScrollNumber.tsx index b37e5ac4c..c2267a8df 100644 --- a/components/badge/ScrollNumber.tsx +++ b/components/badge/ScrollNumber.tsx @@ -8,9 +8,9 @@ import SingleNumber from './SingleNumber'; import { filterEmpty } from '../_util/props-util'; export const scrollNumberProps = { - prefixCls: PropTypes.string, + prefixCls: String, count: PropTypes.any, - component: PropTypes.string, + component: String, title: PropTypes.oneOfType([PropTypes.number, PropTypes.string, null]), show: Boolean, }; diff --git a/components/breadcrumb/Breadcrumb.tsx b/components/breadcrumb/Breadcrumb.tsx index c305ed977..01e312482 100644 --- a/components/breadcrumb/Breadcrumb.tsx +++ b/components/breadcrumb/Breadcrumb.tsx @@ -15,7 +15,7 @@ export interface Route { } export const breadcrumbProps = { - prefixCls: PropTypes.string, + prefixCls: String, routes: { type: Array as PropType }, params: PropTypes.any, separator: PropTypes.any, diff --git a/components/breadcrumb/BreadcrumbItem.tsx b/components/breadcrumb/BreadcrumbItem.tsx index 89c7b9b2d..91fd079f3 100644 --- a/components/breadcrumb/BreadcrumbItem.tsx +++ b/components/breadcrumb/BreadcrumbItem.tsx @@ -7,8 +7,8 @@ import DownOutlined from '@ant-design/icons-vue/DownOutlined'; import useConfigInject from '../_util/hooks/useConfigInject'; export const breadcrumbItemProps = { - prefixCls: PropTypes.string, - href: PropTypes.string, + prefixCls: String, + href: String, separator: PropTypes.any, overlay: PropTypes.any, }; diff --git a/components/breadcrumb/BreadcrumbSeparator.tsx b/components/breadcrumb/BreadcrumbSeparator.tsx index 6d2c44310..e15b26d24 100644 --- a/components/breadcrumb/BreadcrumbSeparator.tsx +++ b/components/breadcrumb/BreadcrumbSeparator.tsx @@ -5,7 +5,7 @@ import { flattenChildren } from '../_util/props-util'; import useConfigInject from '../_util/hooks/useConfigInject'; export const breadcrumbSeparatorProps = { - prefixCls: PropTypes.string, + prefixCls: String, }; export type BreadcrumbSeparatorProps = Partial>; diff --git a/components/button/button-group.tsx b/components/button/button-group.tsx index 7f36c1e83..b1ee9f4e9 100644 --- a/components/button/button-group.tsx +++ b/components/button/button-group.tsx @@ -8,7 +8,7 @@ import type { SizeType } from '../config-provider'; import UnreachableException from '../_util/unreachableException'; const buttonGroupProps = { - prefixCls: PropTypes.string, + prefixCls: String, size: { type: String as PropType, }, diff --git a/components/button/buttonTypes.ts b/components/button/buttonTypes.ts index 4d097fa0a..08df01c0d 100644 --- a/components/button/buttonTypes.ts +++ b/components/button/buttonTypes.ts @@ -21,7 +21,7 @@ export function convertLegacyProps(type?: LegacyButtonType): ButtonProps { } export const buttonProps = () => ({ - prefixCls: PropTypes.string, + prefixCls: String, type: PropTypes.oneOf(ButtonTypes), htmlType: PropTypes.oneOf(ButtonHTMLTypes).def('button'), shape: PropTypes.oneOf(ButtonShapes), @@ -32,14 +32,14 @@ export const buttonProps = () => ({ type: [Boolean, Object] as PropType, default: (): boolean | { delay?: number } => false, }, - disabled: PropTypes.looseBool, - ghost: PropTypes.looseBool, - block: PropTypes.looseBool, - danger: PropTypes.looseBool, + disabled: { type: Boolean, default: undefined }, + ghost: { type: Boolean, default: undefined }, + block: { type: Boolean, default: undefined }, + danger: { type: Boolean, default: undefined }, icon: PropTypes.any, - href: PropTypes.string, - target: PropTypes.string, - title: PropTypes.string, + href: String, + target: String, + title: String, onClick: { type: Function as PropType<(event: MouseEvent) => void>, }, diff --git a/components/card/Card.tsx b/components/card/Card.tsx index 434c616b4..30f95ef9b 100644 --- a/components/card/Card.tsx +++ b/components/card/Card.tsx @@ -24,7 +24,7 @@ export type CardSize = 'default' | 'small'; const { TabPane } = Tabs; export const cardProps = () => ({ - prefixCls: PropTypes.string, + prefixCls: String, title: PropTypes.any, extra: PropTypes.any, bordered: PropTypes.looseBool.def(true), @@ -39,8 +39,8 @@ export const cardProps = () => ({ type: Array as PropType, }, tabBarExtraContent: PropTypes.any, - activeTabKey: PropTypes.string, - defaultActiveTabKey: PropTypes.string, + activeTabKey: String, + defaultActiveTabKey: String, cover: PropTypes.any, onTabChange: { type: Function as PropType<(key: string) => void>, diff --git a/components/card/Meta.tsx b/components/card/Meta.tsx index af2f13d26..80aa6cf77 100644 --- a/components/card/Meta.tsx +++ b/components/card/Meta.tsx @@ -6,7 +6,7 @@ import useConfigInject from '../_util/hooks/useConfigInject'; export default defineComponent({ name: 'ACardMeta', props: { - prefixCls: PropTypes.string, + prefixCls: String, title: PropTypes.any, description: PropTypes.any, avatar: PropTypes.any, diff --git a/components/checkbox/interface.ts b/components/checkbox/interface.ts index 3b132e56f..30be1b8e4 100644 --- a/components/checkbox/interface.ts +++ b/components/checkbox/interface.ts @@ -51,9 +51,9 @@ export const abstractCheckboxProps = () => { indeterminate: { type: Boolean, default: undefined }, type: { type: String, default: 'checkbox' }, autofocus: { type: Boolean, default: undefined }, - onChange: PropTypes.func, - 'onUpdate:checked': PropTypes.func, - onClick: PropTypes.func, + onChange: Function, + 'onUpdate:checked': Function, + onClick: Function, skipGroup: { type: Boolean, default: false }, }; }; diff --git a/components/collapse/commonProps.ts b/components/collapse/commonProps.ts index e1ebcaf33..724dd03b3 100644 --- a/components/collapse/commonProps.ts +++ b/components/collapse/commonProps.ts @@ -6,32 +6,32 @@ export type CollapsibleType = 'header' | 'disabled'; export type ActiveKeyType = Array | string | number; const collapseProps = () => ({ - prefixCls: PropTypes.string, + prefixCls: String, activeKey: { type: [Array, Number, String] as PropType }, defaultActiveKey: { type: [Array, Number, String] as PropType }, - accordion: PropTypes.looseBool, - destroyInactivePanel: PropTypes.looseBool, - bordered: PropTypes.looseBool, - expandIcon: PropTypes.func, + accordion: { type: Boolean, default: undefined }, + destroyInactivePanel: { type: Boolean, default: undefined }, + bordered: { type: Boolean, default: undefined }, + expandIcon: Function, openAnimation: PropTypes.object, expandIconPosition: PropTypes.oneOf(tuple('left', 'right')), collapsible: { type: String as PropType }, - ghost: PropTypes.looseBool, + ghost: { type: Boolean, default: undefined }, }); const collapsePanelProps = () => ({ openAnimation: PropTypes.object, - prefixCls: PropTypes.string, + prefixCls: String, header: PropTypes.any, - headerClass: PropTypes.string, - showArrow: PropTypes.looseBool, - isActive: PropTypes.looseBool, - destroyInactivePanel: PropTypes.looseBool, + headerClass: String, + showArrow: { type: Boolean, default: undefined }, + isActive: { type: Boolean, default: undefined }, + destroyInactivePanel: { type: Boolean, default: undefined }, /** @deprecated Use `collapsible="disabled"` instead */ - disabled: PropTypes.looseBool, - accordion: PropTypes.looseBool, - forceRender: PropTypes.looseBool, - expandIcon: PropTypes.func, + disabled: { type: Boolean, default: undefined }, + accordion: { type: Boolean, default: undefined }, + forceRender: { type: Boolean, default: undefined }, + expandIcon: Function, extra: PropTypes.any, panelKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), collapsible: { type: String as PropType }, diff --git a/components/color-picker/ColorPicker.jsx b/components/color-picker/ColorPicker.jsx index e6ee88691..4a9467a1a 100644 --- a/components/color-picker/ColorPicker.jsx +++ b/components/color-picker/ColorPicker.jsx @@ -21,16 +21,16 @@ export default { event: 'change.value', //为了支持v-model直接返回颜色字符串 所以用了自定义的事件,与pickr自带change事件进行区分 }, props: { - prefixCls: PropTypes.string, - defaultValue: PropTypes.string, //默认值 + prefixCls: String, + defaultValue: String, //默认值 config: PropTypes.object, //pickr配置 - value: PropTypes.string, //颜色值 + value: String, //颜色值 locale: PropTypes.object, //双语包 - colorRounded: PropTypes.number, //颜色数值保留几位小数 + colorRounded: Number, //颜色数值保留几位小数 size: PropTypes.oneOf(['default', 'small', 'large']).def('default'), //尺寸 - getPopupContainer: PropTypes.func, //指定渲染容器 + getPopupContainer: Function, //指定渲染容器 disabled: PropTypes.looseBool.def(false), //是否禁用 - format: PropTypes.string, //颜色格式设置 + format: String, //颜色格式设置 alpha: PropTypes.looseBool.def(false), //是否开启透明通道 hue: PropTypes.looseBool.def(true), //是否开启色彩预选 }, diff --git a/components/comment/index.tsx b/components/comment/index.tsx index ccc67af22..1b2bbbee3 100644 --- a/components/comment/index.tsx +++ b/components/comment/index.tsx @@ -14,7 +14,7 @@ export const commentProps = { /** The main content of the comment */ content: PropTypes.any, /** Comment prefix defaults to '.ant-comment' */ - prefixCls: PropTypes.string, + prefixCls: String, /** A datetime element containing the time to be displayed */ datetime: PropTypes.any, }; diff --git a/components/config-provider/context.ts b/components/config-provider/context.ts index 5cfcb4f0f..17855b264 100644 --- a/components/config-provider/context.ts +++ b/components/config-provider/context.ts @@ -93,7 +93,7 @@ export const configProviderProps = () => ({ input: { type: Object as PropType<{ autocomplete: string }>, }, - autoInsertSpaceInButton: PropTypes.looseBool, + autoInsertSpaceInButton: { type: Boolean, default: undefined }, locale: { type: Object as PropType, default: undefined as Locale, @@ -110,7 +110,7 @@ export const configProviderProps = () => ({ space: { type: Object as PropType<{ size: SizeType | number }>, }, - virtual: PropTypes.looseBool, + virtual: { type: Boolean, default: undefined }, dropdownMatchSelectWidth: { type: [Number, Boolean], default: true }, form: { type: Object as PropType<{ diff --git a/components/descriptions/index.tsx b/components/descriptions/index.tsx index 43522abb2..82f1a6324 100644 --- a/components/descriptions/index.tsx +++ b/components/descriptions/index.tsx @@ -29,13 +29,13 @@ import { flattenChildren } from '../_util/props-util'; import useConfigInject from '../_util/hooks/useConfigInject'; export const DescriptionsItemProps = { - prefixCls: PropTypes.string, + prefixCls: String, label: PropTypes.any, - span: PropTypes.number, + span: Number, }; const descriptionsItemProp = { - prefixCls: PropTypes.string, + prefixCls: String, label: PropTypes.any, labelStyle: PropTypes.style, contentStyle: PropTypes.style, @@ -129,8 +129,8 @@ function getRows(children: VNode[], column: number) { } export const descriptionsProps = { - prefixCls: PropTypes.string, - bordered: PropTypes.looseBool, + prefixCls: String, + bordered: { type: Boolean, default: undefined }, size: PropTypes.oneOf(tuple('default', 'middle', 'small')).def('default'), title: PropTypes.any, extra: PropTypes.any, @@ -139,7 +139,7 @@ export const descriptionsProps = { default: (): number | Partial> => DEFAULT_COLUMN_MAP, }, layout: PropTypes.oneOf(tuple('horizontal', 'vertical')), - colon: PropTypes.looseBool, + colon: { type: Boolean, default: undefined }, labelStyle: PropTypes.style, contentStyle: PropTypes.style, }; diff --git a/components/drawer/index.tsx b/components/drawer/index.tsx index 29c08b6f7..87cd12394 100644 --- a/components/drawer/index.tsx +++ b/components/drawer/index.tsx @@ -35,21 +35,21 @@ export interface PushState { const defaultPushState: PushState = { distance: 180 }; export const drawerProps = () => ({ - autofocus: PropTypes.looseBool, - closable: PropTypes.looseBool, + autofocus: { type: Boolean, default: undefined }, + closable: { type: Boolean, default: undefined }, closeIcon: PropTypes.any, - destroyOnClose: PropTypes.looseBool, - forceRender: PropTypes.looseBool, + destroyOnClose: { type: Boolean, default: undefined }, + forceRender: { type: Boolean, default: undefined }, getContainer: PropTypes.any, - maskClosable: PropTypes.looseBool, - mask: PropTypes.looseBool, + maskClosable: { type: Boolean, default: undefined }, + mask: { type: Boolean, default: undefined }, maskStyle: PropTypes.object, /** @deprecated Use `style` instead */ wrapStyle: { type: Object as PropType, default: undefined as CSSProperties }, style: { type: Object as PropType, default: undefined as CSSProperties }, class: PropTypes.any, /** @deprecated Use `class` instead */ - wrapClassName: PropTypes.string, + wrapClassName: String, size: { type: String as PropType, }, @@ -58,14 +58,14 @@ export const drawerProps = () => ({ bodyStyle: PropTypes.object, contentWrapperStyle: PropTypes.object, title: PropTypes.any, - visible: PropTypes.looseBool, + visible: { type: Boolean, default: undefined }, width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), - zIndex: PropTypes.number, - prefixCls: PropTypes.string, + zIndex: Number, + prefixCls: String, push: PropTypes.oneOfType([PropTypes.looseBool, { type: Object as PropType }]), placement: PropTypes.oneOf(PlacementTypes), - keyboard: PropTypes.looseBool, + keyboard: { type: Boolean, default: undefined }, extra: PropTypes.any, footer: PropTypes.any, footerStyle: PropTypes.object, @@ -77,7 +77,7 @@ export const drawerProps = () => ({ }, handle: PropTypes.any, /** @deprecated Use `@afterVisibleChange` instead */ - afterVisibleChange: PropTypes.func, + afterVisibleChange: Function, }); export type DrawerProps = Partial>>; diff --git a/components/dropdown/props.ts b/components/dropdown/props.ts index 32868489b..9e24eba81 100644 --- a/components/dropdown/props.ts +++ b/components/dropdown/props.ts @@ -32,12 +32,12 @@ const dropdownProps = () => ({ >, }, overlay: PropTypes.any, - visible: PropTypes.looseBool, - disabled: PropTypes.looseBool, + visible: { type: Boolean, default: undefined }, + disabled: { type: Boolean, default: undefined }, align: { type: Object as PropType }, - getPopupContainer: PropTypes.func, - prefixCls: PropTypes.string, - transitionName: PropTypes.string, + getPopupContainer: Function, + prefixCls: String, + transitionName: String, placement: PropTypes.oneOf( tuple( 'topLeft', @@ -50,14 +50,14 @@ const dropdownProps = () => ({ 'bottomRight', ), ), - overlayClassName: PropTypes.string, + overlayClassName: String, overlayStyle: PropTypes.style, - forceRender: PropTypes.looseBool, - mouseEnterDelay: PropTypes.number, - mouseLeaveDelay: PropTypes.number, - openClassName: PropTypes.string, - minOverlayWidthMatchTrigger: PropTypes.looseBool, - destroyPopupOnHide: PropTypes.looseBool, + forceRender: { type: Boolean, default: undefined }, + mouseEnterDelay: Number, + mouseLeaveDelay: Number, + openClassName: String, + minOverlayWidthMatchTrigger: { type: Boolean, default: undefined }, + destroyPopupOnHide: { type: Boolean, default: undefined }, onVisibleChange: { type: Function as PropType<(val: boolean) => void>, }, @@ -72,11 +72,11 @@ const dropdownButtonProps = () => ({ type: buttonTypesProps.type, size: PropTypes.oneOf(tuple('small', 'large')), htmlType: buttonTypesProps.htmlType, - href: PropTypes.string, - disabled: PropTypes.looseBool, - prefixCls: PropTypes.string, + href: String, + disabled: { type: Boolean, default: undefined }, + prefixCls: String, icon: PropTypes.any, - title: PropTypes.string, + title: String, loading: buttonTypesProps.loading, onClick: { type: Function as PropType, diff --git a/components/empty/index.tsx b/components/empty/index.tsx index f95be1001..8bba90dbd 100644 --- a/components/empty/index.tsx +++ b/components/empty/index.tsx @@ -85,7 +85,7 @@ Empty.PRESENTED_IMAGE_DEFAULT = defaultEmptyImg; Empty.PRESENTED_IMAGE_SIMPLE = simpleEmptyImg; Empty.inheritAttrs = false; Empty.props = { - prefixCls: PropTypes.string, + prefixCls: String, image: PropTypes.any, description: PropTypes.any, imageStyle: PropTypes.object, diff --git a/components/form/Form.tsx b/components/form/Form.tsx index 5ce8f0292..fd7eb1658 100755 --- a/components/form/Form.tsx +++ b/components/form/Form.tsx @@ -64,21 +64,21 @@ export const formProps = { layout: PropTypes.oneOf(tuple('horizontal', 'inline', 'vertical')), labelCol: { type: Object as PropType }, wrapperCol: { type: Object as PropType }, - colon: PropTypes.looseBool, + colon: { type: Boolean, default: undefined }, labelAlign: PropTypes.oneOf(tuple('left', 'right')), - labelWrap: PropTypes.looseBool, - prefixCls: PropTypes.string, + labelWrap: { type: Boolean, default: undefined }, + prefixCls: String, requiredMark: { type: [String, Boolean] as PropType, default: undefined }, /** @deprecated Will warning in future branch. Pls use `requiredMark` instead. */ - hideRequiredMark: PropTypes.looseBool, + hideRequiredMark: { type: Boolean, default: undefined }, model: PropTypes.object, rules: { type: Object as PropType<{ [k: string]: ValidationRule[] | ValidationRule }> }, validateMessages: PropTypes.object, - validateOnRuleChange: PropTypes.looseBool, + validateOnRuleChange: { type: Boolean, default: undefined }, // 提交失败自动滚动到第一个错误字段 scrollToFirstError: { type: [Boolean, Object] as PropType }, - onSubmit: PropTypes.func, - name: PropTypes.string, + onSubmit: Function, + name: String, validateTrigger: { type: [String, Array] as PropType }, size: { type: String as PropType }, onValuesChange: { type: Function as PropType }, diff --git a/components/form/FormItem.tsx b/components/form/FormItem.tsx index 84330d9c1..7a4dc03fa 100644 --- a/components/form/FormItem.tsx +++ b/components/form/FormItem.tsx @@ -82,22 +82,22 @@ function getPropByPath(obj: any, namePathList: any, strict?: boolean) { }; } export const formItemProps = { - htmlFor: PropTypes.string, - prefixCls: PropTypes.string, + htmlFor: String, + prefixCls: String, label: PropTypes.any, help: PropTypes.any, extra: PropTypes.any, labelCol: { type: Object as PropType }, wrapperCol: { type: Object as PropType }, hasFeedback: PropTypes.looseBool.def(false), - colon: PropTypes.looseBool, + colon: { type: Boolean, default: undefined }, labelAlign: PropTypes.oneOf(tuple('left', 'right')), prop: { type: [String, Number, Array] as PropType> }, name: { type: [String, Number, Array] as PropType> }, rules: PropTypes.oneOfType([Array, Object]), autoLink: PropTypes.looseBool.def(true), - required: PropTypes.looseBool, - validateFirst: PropTypes.looseBool, + required: { type: Boolean, default: undefined }, + validateFirst: { type: Boolean, default: undefined }, validateStatus: PropTypes.oneOf(tuple('', 'success', 'warning', 'error', 'validating')), validateTrigger: { type: [String, Array] as PropType }, messageVariables: { type: Object as PropType> }, diff --git a/components/input/ClearableLabeledInput.tsx b/components/input/ClearableLabeledInput.tsx index efcde5072..bf949fc00 100644 --- a/components/input/ClearableLabeledInput.tsx +++ b/components/input/ClearableLabeledInput.tsx @@ -15,22 +15,22 @@ export default defineComponent({ name: 'ClearableLabeledInput', inheritAttrs: false, props: { - prefixCls: PropTypes.string, + prefixCls: String, inputType: PropTypes.oneOf(tuple('text', 'input')), value: PropTypes.any, defaultValue: PropTypes.any, - allowClear: PropTypes.looseBool, + allowClear: { type: Boolean, default: undefined }, element: PropTypes.any, - handleReset: PropTypes.func, - disabled: PropTypes.looseBool, + handleReset: Function, + disabled: { type: Boolean, default: undefined }, direction: { type: String as PropType }, size: { type: String as PropType }, suffix: PropTypes.any, prefix: PropTypes.any, addonBefore: PropTypes.any, addonAfter: PropTypes.any, - readonly: PropTypes.looseBool, - focused: PropTypes.looseBool, + readonly: { type: Boolean, default: undefined }, + focused: { type: Boolean, default: undefined }, bordered: PropTypes.looseBool.def(true), triggerFocus: { type: Function as PropType<() => void> }, hidden: Boolean, diff --git a/components/input/Group.tsx b/components/input/Group.tsx index 30b9e8b51..681fcd4cc 100644 --- a/components/input/Group.tsx +++ b/components/input/Group.tsx @@ -8,9 +8,9 @@ import useConfigInject from '../_util/hooks/useConfigInject'; export default defineComponent({ name: 'AInputGroup', props: { - prefixCls: PropTypes.string, + prefixCls: String, size: { type: String as PropType }, - compact: PropTypes.looseBool, + compact: { type: Boolean, default: undefined }, onMouseenter: { type: Function as PropType }, onMouseleave: { type: Function as PropType }, onFocus: { type: Function as PropType }, diff --git a/components/input/Password.tsx b/components/input/Password.tsx index 250e5bb67..f2fc07774 100644 --- a/components/input/Password.tsx +++ b/components/input/Password.tsx @@ -24,11 +24,11 @@ export default defineComponent({ inheritAttrs: false, props: { ...inputProps, - prefixCls: PropTypes.string, - inputPrefixCls: PropTypes.string, + prefixCls: String, + inputPrefixCls: String, action: PropTypes.string.def('click'), visibilityToggle: PropTypes.looseBool.def(true), - iconRender: PropTypes.func, + iconRender: Function, }, setup(props, { slots, attrs, expose }) { const visible = ref(false); diff --git a/components/input/Search.tsx b/components/input/Search.tsx index fb8c1ad57..cb7793c9a 100644 --- a/components/input/Search.tsx +++ b/components/input/Search.tsx @@ -18,7 +18,7 @@ export default defineComponent({ inheritAttrs: false, props: { ...inputProps, - inputPrefixCls: PropTypes.string, + inputPrefixCls: String, // 不能设置默认值 https://github.com/vueComponent/ant-design-vue/issues/1916 enterButton: PropTypes.any, onSearch: { diff --git a/components/input/inputProps.ts b/components/input/inputProps.ts index c2f4250a8..ccc817ee3 100644 --- a/components/input/inputProps.ts +++ b/components/input/inputProps.ts @@ -5,9 +5,9 @@ import omit from '../_util/omit'; import type { LiteralUnion, VueNode } from '../_util/type'; export const inputDefaultValue = Symbol() as unknown as string; const inputProps = { - id: PropTypes.string, - prefixCls: PropTypes.string, - inputPrefixCls: PropTypes.string, + id: String, + prefixCls: String, + inputPrefixCls: String, defaultValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), value: { type: [String, Number, Symbol] as PropType, @@ -47,30 +47,30 @@ const inputProps = { >, default: 'text', }, - name: PropTypes.string, + name: String, size: { type: String as PropType }, - disabled: PropTypes.looseBool, - readonly: PropTypes.looseBool, + disabled: { type: Boolean, default: undefined }, + readonly: { type: Boolean, default: undefined }, addonBefore: PropTypes.any, addonAfter: PropTypes.any, prefix: PropTypes.any, suffix: PropTypes.any, - autofocus: PropTypes.looseBool, - allowClear: PropTypes.looseBool, + autofocus: { type: Boolean, default: undefined }, + allowClear: { type: Boolean, default: undefined }, lazy: PropTypes.looseBool.def(true), - maxlength: PropTypes.number, - loading: PropTypes.looseBool, - bordered: PropTypes.looseBool, + maxlength: Number, + loading: { type: Boolean, default: undefined }, + bordered: { type: Boolean, default: undefined }, showCount: { type: [Boolean, Object] as PropType }, htmlSize: Number, - onPressEnter: PropTypes.func, - onKeydown: PropTypes.func, - onKeyup: PropTypes.func, - onFocus: PropTypes.func, - onBlur: PropTypes.func, - onChange: PropTypes.func, - onInput: PropTypes.func, - 'onUpdate:value': PropTypes.func, + onPressEnter: Function, + onKeydown: Function, + onKeyup: Function, + onFocus: Function, + onBlur: Function, + onChange: Function, + onInput: Function, + 'onUpdate:value': Function, valueModifiers: Object, hidden: Boolean, }; @@ -90,8 +90,8 @@ const textAreaProps = { 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: PropTypes.func, - onCompositionend: PropTypes.func, + onCompositionstart: Function, + onCompositionend: Function, valueModifiers: Object, }; diff --git a/components/layout/Sider.tsx b/components/layout/Sider.tsx index cdd1e38db..f9d12c9b1 100644 --- a/components/layout/Sider.tsx +++ b/components/layout/Sider.tsx @@ -24,11 +24,11 @@ const dimensionMaxMap = { export type CollapseType = 'clickTrigger' | 'responsive'; export const siderProps = { - prefixCls: PropTypes.string, - collapsible: PropTypes.looseBool, - collapsed: PropTypes.looseBool, - defaultCollapsed: PropTypes.looseBool, - reverseArrow: PropTypes.looseBool, + prefixCls: String, + collapsible: { type: Boolean, default: undefined }, + collapsed: { type: Boolean, default: undefined }, + defaultCollapsed: { type: Boolean, default: undefined }, + reverseArrow: { type: Boolean, default: undefined }, zeroWidthTriggerStyle: PropTypes.style, trigger: PropTypes.any, width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), diff --git a/components/layout/layout.tsx b/components/layout/layout.tsx index ba1ce19ec..dc7b13536 100644 --- a/components/layout/layout.tsx +++ b/components/layout/layout.tsx @@ -5,9 +5,9 @@ import useConfigInject from '../_util/hooks/useConfigInject'; import { SiderHookProviderKey } from './injectionKey'; export const basicProps = { - prefixCls: PropTypes.string, - hasSider: PropTypes.looseBool, - tagName: PropTypes.string, + prefixCls: String, + hasSider: { type: Boolean, default: undefined }, + tagName: String, }; export type BasicProps = Partial> & HTMLAttributes; diff --git a/components/list/Item.tsx b/components/list/Item.tsx index 7d5363b97..5b4dbfb02 100644 --- a/components/list/Item.tsx +++ b/components/list/Item.tsx @@ -9,7 +9,7 @@ import useConfigInject from '../_util/hooks/useConfigInject'; import { ListContextKey } from './contextKey'; export const ListItemProps = { - prefixCls: PropTypes.string, + prefixCls: String, extra: PropTypes.any, actions: PropTypes.array, grid: PropTypes.any, diff --git a/components/list/ItemMeta.tsx b/components/list/ItemMeta.tsx index 9992aa197..751657a48 100644 --- a/components/list/ItemMeta.tsx +++ b/components/list/ItemMeta.tsx @@ -6,7 +6,7 @@ import PropTypes from '../_util/vue-types'; export const listItemMetaProps = { avatar: PropTypes.any, description: PropTypes.any, - prefixCls: PropTypes.string, + prefixCls: String, title: PropTypes.any, }; diff --git a/components/list/index.tsx b/components/list/index.tsx index 79191e3c2..662b44d2b 100644 --- a/components/list/index.tsx +++ b/components/list/index.tsx @@ -41,7 +41,7 @@ export type ListSize = 'small' | 'default' | 'large'; export type ListItemLayout = 'horizontal' | 'vertical'; export const listProps = () => ({ - bordered: PropTypes.looseBool, + bordered: { type: Boolean, default: undefined }, dataSource: PropTypes.array, extra: PropTypes.any, grid: { type: Object as PropType, default: undefined as ListGridType }, @@ -59,7 +59,7 @@ export const listProps = () => ({ rowKey: [String, Number, Function] as PropType Key)>, renderItem: PropTypes.any, size: String as PropType, - split: PropTypes.looseBool, + split: { type: Boolean, default: undefined }, header: PropTypes.any, footer: PropTypes.any, locale: { diff --git a/components/locale-provider/index.tsx b/components/locale-provider/index.tsx index 2a566a5b4..e149a6325 100644 --- a/components/locale-provider/index.tsx +++ b/components/locale-provider/index.tsx @@ -59,7 +59,7 @@ const LocaleProvider = defineComponent({ locale: { type: Object as PropType, }, - ANT_MARK__: PropTypes.string, + ANT_MARK__: String, }, setup(props, { slots }) { warning( diff --git a/components/mentions/index.tsx b/components/mentions/index.tsx index f62f085a2..e694c9080 100644 --- a/components/mentions/index.tsx +++ b/components/mentions/index.tsx @@ -60,7 +60,7 @@ const getMentions = (value = '', config: MentionsConfig = {}): MentionsEntity[] export const mentionsProps = { ...baseMentionsProps, - loading: PropTypes.looseBool, + loading: { type: Boolean, default: undefined }, onFocus: { type: Function as PropType<(e: FocusEvent) => void>, }, diff --git a/components/page-header/index.tsx b/components/page-header/index.tsx index f94263dd9..8936ab304 100644 --- a/components/page-header/index.tsx +++ b/components/page-header/index.tsx @@ -16,7 +16,7 @@ import useDestroyed from '../_util/hooks/useDestroyed'; export const pageHeaderProps = { backIcon: PropTypes.any, - prefixCls: PropTypes.string, + prefixCls: String, title: PropTypes.any, subTitle: PropTypes.any, breadcrumb: PropTypes.object, @@ -24,8 +24,8 @@ export const pageHeaderProps = { footer: PropTypes.any, extra: PropTypes.any, avatar: PropTypes.object, - ghost: PropTypes.looseBool, - onBack: PropTypes.func, + ghost: { type: Boolean, default: undefined }, + onBack: Function, }; export type PageHeaderProps = Partial>; diff --git a/components/popconfirm/index.tsx b/components/popconfirm/index.tsx index afa942ceb..2821e46e5 100644 --- a/components/popconfirm/index.tsx +++ b/components/popconfirm/index.tsx @@ -24,7 +24,7 @@ import ActionButton from '../_util/ActionButton'; export const popconfirmProps = () => ({ ...abstractTooltipProps(), - prefixCls: PropTypes.string, + prefixCls: String, content: PropTypes.any, title: PropTypes.any, okType: { diff --git a/components/progress/Line.tsx b/components/progress/Line.tsx index c00a19ece..a35ed2efb 100644 --- a/components/progress/Line.tsx +++ b/components/progress/Line.tsx @@ -9,7 +9,7 @@ import { getSuccessPercent, validProgress } from './utils'; export const lineProps = { ...progressProps(), - prefixCls: PropTypes.string, + prefixCls: String, direction: { type: String as PropType, }, diff --git a/components/progress/Steps.tsx b/components/progress/Steps.tsx index 06fe17bbe..d1be56310 100644 --- a/components/progress/Steps.tsx +++ b/components/progress/Steps.tsx @@ -7,12 +7,12 @@ import { progressProps } from './props'; export const stepsProps = { ...progressProps(), - steps: PropTypes.number, + steps: Number, size: { type: String as PropType, }, - strokeColor: PropTypes.string, - trailColor: PropTypes.string, + strokeColor: String, + trailColor: String, }; export type StepsProps = Partial>; diff --git a/components/progress/props.ts b/components/progress/props.ts index 27a4b096c..7d9f8a128 100644 --- a/components/progress/props.ts +++ b/components/progress/props.ts @@ -19,29 +19,29 @@ export interface SuccessProps { } export const progressProps = () => ({ - prefixCls: PropTypes.string, + prefixCls: String, type: PropTypes.oneOf(ProgressType), - percent: PropTypes.number, + percent: Number, format: { type: Function as PropType<(percent?: number, successPercent?: number) => VueNode> }, status: PropTypes.oneOf(progressStatuses), - showInfo: PropTypes.looseBool, - strokeWidth: PropTypes.number, + showInfo: { type: Boolean, default: undefined }, + strokeWidth: Number, strokeLinecap: PropTypes.oneOf(tuple('butt', 'round', 'square')), strokeColor: { type: [String, Object] as PropType, }, - trailColor: PropTypes.string, - width: PropTypes.number, + trailColor: String, + width: Number, success: { type: Object as PropType, default: (): SuccessProps => ({}), }, - gapDegree: PropTypes.number, + gapDegree: Number, gapPosition: PropTypes.oneOf(tuple('top', 'bottom', 'left', 'right')), size: PropTypes.oneOf(ProgressSize), - steps: PropTypes.number, + steps: Number, /** @deprecated Use `success` instead */ - successPercent: PropTypes.number, + successPercent: Number, title: String, }); diff --git a/components/radio/Group.tsx b/components/radio/Group.tsx index b7bbb274f..9387b431d 100644 --- a/components/radio/Group.tsx +++ b/components/radio/Group.tsx @@ -23,16 +23,16 @@ export type RadioGroupChildOption = { }; export const radioGroupProps = { - prefixCls: PropTypes.string, + prefixCls: String, value: PropTypes.any, size: PropTypes.oneOf(RadioGroupSizeTypes).def('default'), options: { type: Array as PropType>, }, - disabled: PropTypes.looseBool, - name: PropTypes.string, + disabled: { type: Boolean, default: undefined }, + name: String, buttonStyle: PropTypes.string.def('outline'), - id: PropTypes.string, + id: String, optionType: PropTypes.oneOf(RadioGroupOptionTypes).def('default'), }; diff --git a/components/radio/Radio.tsx b/components/radio/Radio.tsx index e3d1f491f..9619bf7a0 100644 --- a/components/radio/Radio.tsx +++ b/components/radio/Radio.tsx @@ -8,18 +8,18 @@ import type { RadioChangeEvent, RadioGroupContext } from './interface'; import { useInjectFormItemContext } from '../form/FormItemContext'; export const radioProps = { - prefixCls: PropTypes.string, - checked: PropTypes.looseBool, - disabled: PropTypes.looseBool, - isGroup: PropTypes.looseBool, + prefixCls: String, + checked: { type: Boolean, default: undefined }, + disabled: { type: Boolean, default: undefined }, + isGroup: { type: Boolean, default: undefined }, value: PropTypes.any, - name: PropTypes.string, - id: PropTypes.string, - autofocus: PropTypes.looseBool, - onChange: PropTypes.func, - onFocus: PropTypes.func, - onBlur: PropTypes.func, - onClick: PropTypes.func, + name: String, + id: String, + autofocus: { type: Boolean, default: undefined }, + onChange: Function, + onFocus: Function, + onBlur: Function, + onClick: Function, }; export type RadioProps = Partial>; diff --git a/components/rate/Star.tsx b/components/rate/Star.tsx index 449356254..76e0043b4 100644 --- a/components/rate/Star.tsx +++ b/components/rate/Star.tsx @@ -4,17 +4,17 @@ import { getPropsSlot } from '../_util/props-util'; import PropTypes from '../_util/vue-types'; export const starProps = { - value: PropTypes.number, - index: PropTypes.number, - prefixCls: PropTypes.string, - allowHalf: PropTypes.looseBool, - disabled: PropTypes.looseBool, + value: Number, + index: Number, + prefixCls: String, + allowHalf: { type: Boolean, default: undefined }, + disabled: { type: Boolean, default: undefined }, character: PropTypes.any, - characterRender: PropTypes.func, - focused: PropTypes.looseBool, - count: PropTypes.number, - onClick: PropTypes.func, - onHover: PropTypes.func, + characterRender: Function, + focused: { type: Boolean, default: undefined }, + count: Number, + onClick: Function, + onHover: Function, }; export type StarProps = Partial>; diff --git a/components/rate/index.tsx b/components/rate/index.tsx index 747a82e5c..da8fef4d2 100644 --- a/components/rate/index.tsx +++ b/components/rate/index.tsx @@ -15,18 +15,18 @@ import useRefs from '../_util/hooks/useRefs'; import { useInjectFormItemContext } from '../form/FormItemContext'; export const rateProps = { - prefixCls: PropTypes.string, - count: PropTypes.number, - value: PropTypes.number, - allowHalf: PropTypes.looseBool, - allowClear: PropTypes.looseBool, + prefixCls: String, + count: Number, + value: Number, + allowHalf: { type: Boolean, default: undefined }, + allowClear: { type: Boolean, default: undefined }, tooltips: PropTypes.arrayOf(PropTypes.string), - disabled: PropTypes.looseBool, + disabled: { type: Boolean, default: undefined }, character: PropTypes.any, - autofocus: PropTypes.looseBool, + autofocus: { type: Boolean, default: undefined }, tabindex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), - direction: PropTypes.string, - id: PropTypes.string, + direction: String, + id: String, }; export type RateProps = Partial>; diff --git a/components/result/index.tsx b/components/result/index.tsx index 22ef535a5..d20e86ef7 100644 --- a/components/result/index.tsx +++ b/components/result/index.tsx @@ -29,7 +29,7 @@ export const ExceptionMap = { const ExceptionStatus = Object.keys(ExceptionMap); export const resultProps = { - prefixCls: PropTypes.string, + prefixCls: String, icon: PropTypes.any, status: PropTypes.oneOf(tuple('success', 'error', 'info', 'warning', '404', '403', '500')).def( 'info', diff --git a/components/space/index.tsx b/components/space/index.tsx index 1d81119d2..1550c1c78 100644 --- a/components/space/index.tsx +++ b/components/space/index.tsx @@ -15,13 +15,13 @@ const spaceSize = { large: 24, }; export const spaceProps = { - prefixCls: PropTypes.string, + prefixCls: String, size: { type: [String, Number, Array] as PropType, }, direction: PropTypes.oneOf(tuple('horizontal', 'vertical')).def('horizontal'), align: PropTypes.oneOf(tuple('start', 'end', 'center', 'baseline')), - wrap: PropTypes.looseBool, + wrap: { type: Boolean, default: undefined }, }; export type SpaceProps = Partial>; diff --git a/components/spin/Spin.tsx b/components/spin/Spin.tsx index 33661ad87..82c4d46b1 100644 --- a/components/spin/Spin.tsx +++ b/components/spin/Spin.tsx @@ -11,12 +11,12 @@ import { defaultConfigProvider } from '../config-provider'; export const SpinSize = PropTypes.oneOf(tuple('small', 'default', 'large')); export const spinProps = () => ({ - prefixCls: PropTypes.string, - spinning: PropTypes.looseBool, + prefixCls: String, + spinning: { type: Boolean, default: undefined }, size: SpinSize, - wrapperClassName: PropTypes.string, + wrapperClassName: String, tip: PropTypes.any, - delay: PropTypes.number, + delay: Number, indicator: PropTypes.any, }); diff --git a/components/statistic/Statistic.tsx b/components/statistic/Statistic.tsx index 1d7b3cbb3..36ca58c41 100644 --- a/components/statistic/Statistic.tsx +++ b/components/statistic/Statistic.tsx @@ -8,22 +8,22 @@ import Skeleton from '../skeleton/Skeleton'; import useConfigInject from '../_util/hooks/useConfigInject'; export const statisticProps = { - prefixCls: PropTypes.string, - decimalSeparator: PropTypes.string, - groupSeparator: PropTypes.string, - format: PropTypes.string, + prefixCls: String, + decimalSeparator: String, + groupSeparator: String, + format: String, value: { type: [String, Number, Object] as PropType, }, valueStyle: PropTypes.style, valueRender: PropTypes.any, formatter: PropTypes.any, - precision: PropTypes.number, + precision: Number, prefix: PropTypes.any, suffix: PropTypes.any, title: PropTypes.any, - onFinish: PropTypes.func, - loading: PropTypes.looseBool, + onFinish: Function, + loading: { type: Boolean, default: undefined }, }; export type StatisticProps = Partial>; diff --git a/components/switch/index.tsx b/components/switch/index.tsx index 2dffd7022..8ab34df48 100644 --- a/components/switch/index.tsx +++ b/components/switch/index.tsx @@ -14,15 +14,15 @@ import omit from '../_util/omit'; export const SwitchSizes = tuple('small', 'default'); type CheckedType = boolean | string | number; export const switchProps = { - id: PropTypes.string, - prefixCls: PropTypes.string, + id: String, + prefixCls: String, size: PropTypes.oneOf(SwitchSizes), - disabled: PropTypes.looseBool, + disabled: { type: Boolean, default: undefined }, checkedChildren: PropTypes.any, unCheckedChildren: PropTypes.any, tabindex: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), - autofocus: PropTypes.looseBool, - loading: PropTypes.looseBool, + autofocus: { type: Boolean, default: undefined }, + loading: { type: Boolean, default: undefined }, checked: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.looseBool]), checkedValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.looseBool]).def( true, diff --git a/components/tag/CheckableTag.tsx b/components/tag/CheckableTag.tsx index 8b6886455..79c66370d 100644 --- a/components/tag/CheckableTag.tsx +++ b/components/tag/CheckableTag.tsx @@ -7,8 +7,8 @@ import useConfigInject from '../_util/hooks/useConfigInject'; const CheckableTag = defineComponent({ name: 'ACheckableTag', props: { - prefixCls: PropTypes.string, - checked: PropTypes.looseBool, + prefixCls: String, + checked: { type: Boolean, default: undefined }, onChange: { type: Function as PropType<(checked: boolean) => void>, }, diff --git a/components/tag/index.tsx b/components/tag/index.tsx index cb2f86382..ff5778436 100644 --- a/components/tag/index.tsx +++ b/components/tag/index.tsx @@ -14,13 +14,13 @@ const PresetColorRegex = new RegExp(`^(${PresetColorTypes.join('|')})(-inverse)? const PresetStatusColorRegex = new RegExp(`^(${PresetStatusColorTypes.join('|')})$`); export const tagProps = { - prefixCls: PropTypes.string, + prefixCls: String, color: { type: String as PropType>, }, closable: PropTypes.looseBool.def(false), closeIcon: PropTypes.any, - visible: PropTypes.looseBool, + visible: { type: Boolean, default: undefined }, onClose: { type: Function as PropType<(e: MouseEvent) => void>, }, diff --git a/components/timeline/Timeline.tsx b/components/timeline/Timeline.tsx index e46595f18..1b4821b6c 100644 --- a/components/timeline/Timeline.tsx +++ b/components/timeline/Timeline.tsx @@ -10,11 +10,11 @@ import { tuple } from '../_util/type'; import useConfigInject from '../_util/hooks/useConfigInject'; export const timelineProps = () => ({ - prefixCls: PropTypes.string, + prefixCls: String, /** 指定最后一个幽灵节点是否存在或内容 */ pending: PropTypes.any, pendingDot: PropTypes.any, - reverse: PropTypes.looseBool, + reverse: { type: Boolean, default: undefined }, mode: PropTypes.oneOf(tuple('left', 'alternate', 'right', '')), }); diff --git a/components/timeline/TimelineItem.tsx b/components/timeline/TimelineItem.tsx index fbc9441f2..e1ee03687 100644 --- a/components/timeline/TimelineItem.tsx +++ b/components/timeline/TimelineItem.tsx @@ -7,10 +7,10 @@ import { tuple } from '../_util/type'; import useConfigInject from '../_util/hooks/useConfigInject'; export const timelineItemProps = () => ({ - prefixCls: PropTypes.string, - color: PropTypes.string, + prefixCls: String, + color: String, dot: PropTypes.any, - pending: PropTypes.looseBool, + pending: { type: Boolean, default: undefined }, position: PropTypes.oneOf(tuple('left', 'right', '')).def(''), label: PropTypes.any, }); diff --git a/components/tooltip/abstractTooltipProps.ts b/components/tooltip/abstractTooltipProps.ts index 4eb2d88f3..8497f01f0 100644 --- a/components/tooltip/abstractTooltipProps.ts +++ b/components/tooltip/abstractTooltipProps.ts @@ -22,24 +22,24 @@ export default () => ({ PropTypes.oneOf(triggerTypes), PropTypes.arrayOf(PropTypes.oneOf(triggerTypes)), ]), - visible: PropTypes.looseBool, - defaultVisible: PropTypes.looseBool, + visible: { type: Boolean, default: undefined }, + defaultVisible: { type: Boolean, default: undefined }, placement: PropTypes.oneOf(placementTypes), - color: PropTypes.string, - transitionName: PropTypes.string, + color: String, + transitionName: String, overlayStyle: PropTypes.style, - overlayClassName: PropTypes.string, - openClassName: PropTypes.string, - prefixCls: PropTypes.string, - mouseEnterDelay: PropTypes.number, - mouseLeaveDelay: PropTypes.number, - getPopupContainer: PropTypes.func, - arrowPointAtCenter: PropTypes.looseBool, + overlayClassName: String, + openClassName: String, + prefixCls: String, + mouseEnterDelay: Number, + mouseLeaveDelay: Number, + getPopupContainer: Function, + arrowPointAtCenter: { type: Boolean, default: undefined }, autoAdjustOverflow: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object]), - destroyTooltipOnHide: PropTypes.looseBool, + destroyTooltipOnHide: { type: Boolean, default: undefined }, align: PropTypes.object, builtinPlacements: PropTypes.object, children: PropTypes.array, - onVisibleChange: PropTypes.func, - 'onUpdate:visible': PropTypes.func, + onVisibleChange: Function, + 'onUpdate:visible': Function, }); diff --git a/components/transfer/ListBody.tsx b/components/transfer/ListBody.tsx index 1525cd13d..cd5a54513 100644 --- a/components/transfer/ListBody.tsx +++ b/components/transfer/ListBody.tsx @@ -7,15 +7,15 @@ import PropTypes from '../_util/vue-types'; import type { TransferItem } from '.'; export const transferListBodyProps = { - prefixCls: PropTypes.string, + prefixCls: String, filteredRenderItems: PropTypes.array.def([]), selectedKeys: PropTypes.array, - disabled: PropTypes.looseBool, - showRemove: PropTypes.looseBool, + disabled: { type: Boolean, default: undefined }, + showRemove: { type: Boolean, default: undefined }, pagination: PropTypes.any, - onItemSelect: PropTypes.func, - onScroll: PropTypes.func, - onItemRemove: PropTypes.func, + onItemSelect: Function, + onScroll: Function, + onItemRemove: Function, }; export type TransferListBodyProps = Partial>; diff --git a/components/transfer/ListItem.tsx b/components/transfer/ListItem.tsx index 8ffa22735..ec7a07784 100644 --- a/components/transfer/ListItem.tsx +++ b/components/transfer/ListItem.tsx @@ -15,12 +15,12 @@ export const transferListItemProps = { renderedText: PropTypes.any, renderedEl: PropTypes.any, item: PropTypes.any, - checked: PropTypes.looseBool, - prefixCls: PropTypes.string, - disabled: PropTypes.looseBool, - showRemove: PropTypes.looseBool, - onClick: PropTypes.func, - onRemove: PropTypes.func, + checked: { type: Boolean, default: undefined }, + prefixCls: String, + disabled: { type: Boolean, default: undefined }, + showRemove: { type: Boolean, default: undefined }, + onClick: Function, + onRemove: Function, }; export type TransferListItemProps = Partial>; diff --git a/components/transfer/list.tsx b/components/transfer/list.tsx index 5447af475..dba52338e 100644 --- a/components/transfer/list.tsx +++ b/components/transfer/list.tsx @@ -27,36 +27,36 @@ function getEnabledItemKeys(items: RecordType[] } export const transferListProps = { - prefixCls: PropTypes.string, + prefixCls: String, dataSource: { type: Array as PropType, default: [] }, - filter: PropTypes.string, - filterOption: PropTypes.func, + filter: String, + filterOption: Function, checkedKeys: PropTypes.arrayOf(PropTypes.string), - handleFilter: PropTypes.func, - handleClear: PropTypes.func, - renderItem: PropTypes.func, + handleFilter: Function, + handleClear: Function, + renderItem: Function, showSearch: PropTypes.looseBool.def(false), - searchPlaceholder: PropTypes.string, + searchPlaceholder: String, notFoundContent: PropTypes.any, - itemUnit: PropTypes.string, - itemsUnit: PropTypes.string, + itemUnit: String, + itemsUnit: String, renderList: PropTypes.any, - disabled: PropTypes.looseBool, + disabled: { type: Boolean, default: undefined }, direction: String as PropType, - showSelectAll: PropTypes.looseBool, - remove: PropTypes.string, - selectAll: PropTypes.string, - selectCurrent: PropTypes.string, - selectInvert: PropTypes.string, - removeAll: PropTypes.string, - removeCurrent: PropTypes.string, + showSelectAll: { type: Boolean, default: undefined }, + remove: String, + selectAll: String, + selectCurrent: String, + selectInvert: String, + removeAll: String, + removeCurrent: String, selectAllLabel: PropTypes.any, - showRemove: PropTypes.looseBool, + showRemove: { type: Boolean, default: undefined }, pagination: PropTypes.any, - onItemSelect: PropTypes.func, - onItemSelectAll: PropTypes.func, - onItemRemove: PropTypes.func, - onScroll: PropTypes.func, + onItemSelect: Function, + onItemSelectAll: Function, + onItemRemove: Function, + onScroll: Function, }; export type TransferListProps = Partial>; diff --git a/components/transfer/search.tsx b/components/transfer/search.tsx index 37cdd1634..0ef355118 100644 --- a/components/transfer/search.tsx +++ b/components/transfer/search.tsx @@ -7,12 +7,12 @@ import { defineComponent } from 'vue'; import type { ChangeEvent } from '../_util/EventInterface'; export const transferSearchProps = { - prefixCls: PropTypes.string, - placeholder: PropTypes.string, - value: PropTypes.string, - handleClear: PropTypes.func, - disabled: PropTypes.looseBool, - onChange: PropTypes.func, + prefixCls: String, + placeholder: String, + value: String, + handleClear: Function, + disabled: { type: Boolean, default: undefined }, + onChange: Function, }; export type TransferSearchProps = Partial>; diff --git a/components/tree/Tree.tsx b/components/tree/Tree.tsx index dc4fb1bc7..0e8aa97ed 100644 --- a/components/tree/Tree.tsx +++ b/components/tree/Tree.tsx @@ -120,7 +120,7 @@ export const treeProps = () => { showIcon: { type: Boolean, default: undefined }, icon: { type: Function as PropType<(nodeProps: AntdTreeNodeAttribute) => any> }, switcherIcon: PropTypes.any, - prefixCls: PropTypes.string, + prefixCls: String, /** * @default{title,key,children} * deprecated, please use `fieldNames` instead diff --git a/components/typography/Base.tsx b/components/typography/Base.tsx index 0ddce8c7b..4626d7d5e 100644 --- a/components/typography/Base.tsx +++ b/components/typography/Base.tsx @@ -577,18 +577,18 @@ const Base = defineComponent({ export const baseProps = () => ({ editable: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object]), copyable: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object]), - prefixCls: PropTypes.string, - component: PropTypes.string, + prefixCls: String, + component: String, type: PropTypes.oneOf(['secondary', 'success', 'danger', 'warning']), - disabled: PropTypes.looseBool, + disabled: { type: Boolean, default: undefined }, ellipsis: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object]), - code: PropTypes.looseBool, - mark: PropTypes.looseBool, - underline: PropTypes.looseBool, - delete: PropTypes.looseBool, - strong: PropTypes.looseBool, - keyboard: PropTypes.looseBool, - content: PropTypes.string, + code: { type: Boolean, default: undefined }, + mark: { type: Boolean, default: undefined }, + underline: { type: Boolean, default: undefined }, + delete: { type: Boolean, default: undefined }, + strong: { type: Boolean, default: undefined }, + keyboard: { type: Boolean, default: undefined }, + content: String, }); Base.props = baseProps(); diff --git a/components/typography/Editable.tsx b/components/typography/Editable.tsx index 91bb7a666..e2fc14819 100644 --- a/components/typography/Editable.tsx +++ b/components/typography/Editable.tsx @@ -9,15 +9,15 @@ import type { Direction } from '../config-provider'; const Editable = defineComponent({ name: 'Editable', props: { - prefixCls: PropTypes.string, - value: PropTypes.string, - maxlength: PropTypes.number, + prefixCls: String, + value: String, + maxlength: Number, autoSize: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object]), - onSave: PropTypes.func, - onCancel: PropTypes.func, - onEnd: PropTypes.func, - onChange: PropTypes.func, - originContent: PropTypes.string, + onSave: Function, + onCancel: Function, + onEnd: Function, + onChange: Function, + originContent: String, direction: String as PropType, }, emits: ['save', 'cancel', 'end', 'change'], diff --git a/components/typography/Typography.tsx b/components/typography/Typography.tsx index 0223eafe2..cc374a613 100644 --- a/components/typography/Typography.tsx +++ b/components/typography/Typography.tsx @@ -44,8 +44,8 @@ const Typography = defineComponent({ }); Typography.props = { - prefixCls: PropTypes.string, - component: PropTypes.string, + prefixCls: String, + component: String, }; export default Typography; diff --git a/components/vc-dialog/DialogWrap.tsx b/components/vc-dialog/DialogWrap.tsx index ee34f0a2b..dce058f9b 100644 --- a/components/vc-dialog/DialogWrap.tsx +++ b/components/vc-dialog/DialogWrap.tsx @@ -4,14 +4,14 @@ import getDialogPropTypes from './IDialogPropTypes'; import Portal from '../_util/PortalWrapper'; import { defineComponent, ref, watch } from 'vue'; import { useProvidePortal } from '../vc-trigger/context'; +import { initDefaultProps } from '../_util/props-util'; const IDialogPropTypes = getDialogPropTypes(); const DialogWrap = defineComponent({ name: 'DialogWrap', inheritAttrs: false, - props: { - ...IDialogPropTypes, - visible: IDialogPropTypes.visible.def(false), - }, + props: initDefaultProps(IDialogPropTypes, { + visible: false, + }), setup(props, { attrs, slots }) { const animatedVisible = ref(props.visible); useProvidePortal({}, { inTriggerContext: false }); diff --git a/components/vc-dialog/IDialogPropTypes.ts b/components/vc-dialog/IDialogPropTypes.ts index dec2f1430..f1112bd19 100644 --- a/components/vc-dialog/IDialogPropTypes.ts +++ b/components/vc-dialog/IDialogPropTypes.ts @@ -3,45 +3,45 @@ import PropTypes from '../_util/vue-types'; function dialogPropTypes() { return { - keyboard: PropTypes.looseBool, - mask: PropTypes.looseBool, - afterClose: PropTypes.func, - closable: PropTypes.looseBool, - maskClosable: PropTypes.looseBool, - visible: PropTypes.looseBool, - destroyOnClose: PropTypes.looseBool, + keyboard: { type: Boolean, default: undefined }, + mask: { type: Boolean, default: undefined }, + afterClose: Function, + closable: { type: Boolean, default: undefined }, + maskClosable: { type: Boolean, default: undefined }, + visible: { type: Boolean, default: undefined }, + destroyOnClose: { type: Boolean, default: undefined }, mousePosition: PropTypes.shape({ - x: PropTypes.number, - y: PropTypes.number, + x: Number, + y: Number, }).loose, title: PropTypes.any, footer: PropTypes.any, - transitionName: PropTypes.string, - maskTransitionName: PropTypes.string, + transitionName: String, + maskTransitionName: String, animation: PropTypes.any, maskAnimation: PropTypes.any, wrapStyle: PropTypes.object, bodyStyle: PropTypes.object, maskStyle: PropTypes.object, - prefixCls: PropTypes.string, - wrapClassName: PropTypes.string, + prefixCls: String, + wrapClassName: String, width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), - zIndex: PropTypes.number, + zIndex: Number, bodyProps: PropTypes.any, maskProps: PropTypes.any, wrapProps: PropTypes.any, getContainer: PropTypes.any, dialogStyle: PropTypes.object, - dialogClass: PropTypes.string, + dialogClass: String, closeIcon: PropTypes.any, - forceRender: PropTypes.looseBool, - getOpenCount: PropTypes.func, + forceRender: { type: Boolean, default: undefined }, + getOpenCount: Function, // https://github.com/ant-design/ant-design/issues/19771 // https://github.com/react-component/dialog/issues/95 - focusTriggerAfterClose: PropTypes.looseBool, - onClose: PropTypes.func, - modalRender: PropTypes.func, + focusTriggerAfterClose: { type: Boolean, default: undefined }, + onClose: Function, + modalRender: Function, }; } export type IDialogChildProps = Partial>>; diff --git a/components/vc-drawer/src/IDrawerPropTypes.ts b/components/vc-drawer/src/IDrawerPropTypes.ts index 5a3d24ee6..0e1b25c57 100644 --- a/components/vc-drawer/src/IDrawerPropTypes.ts +++ b/components/vc-drawer/src/IDrawerPropTypes.ts @@ -4,36 +4,36 @@ import type { PropType } from 'vue'; export type IPlacement = 'left' | 'top' | 'right' | 'bottom'; type ILevelMove = number | [number, number]; const props = () => ({ - prefixCls: PropTypes.string, + prefixCls: String, width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), style: PropTypes.style, - class: PropTypes.string, + class: String, placement: { type: String as PropType, }, - wrapperClassName: PropTypes.string, + wrapperClassName: String, level: { type: [String, Array] as PropType }, levelMove: { type: [Number, Function, Array] as PropType< ILevelMove | ((e: { target: HTMLElement; open: boolean }) => ILevelMove) >, }, - duration: PropTypes.string, - ease: PropTypes.string, - showMask: PropTypes.looseBool, - maskClosable: PropTypes.looseBool, + duration: String, + ease: String, + showMask: { type: Boolean, default: undefined }, + maskClosable: { type: Boolean, default: undefined }, maskStyle: PropTypes.style, - afterVisibleChange: PropTypes.func, - keyboard: PropTypes.looseBool, + afterVisibleChange: Function, + keyboard: { type: Boolean, default: undefined }, contentWrapperStyle: PropTypes.style, - autofocus: PropTypes.looseBool, - open: PropTypes.looseBool, + autofocus: { type: Boolean, default: undefined }, + open: { type: Boolean, default: undefined }, }); const drawerProps = () => ({ ...props(), - forceRender: PropTypes.looseBool, + forceRender: { type: Boolean, default: undefined }, getContainer: PropTypes.oneOfType([ PropTypes.string, PropTypes.func, @@ -44,10 +44,10 @@ const drawerProps = () => ({ const drawerChildProps = () => ({ ...props(), - getContainer: PropTypes.func, - getOpenCount: PropTypes.func, + getContainer: Function, + getOpenCount: Function, scrollLocker: PropTypes.any, - switchScrollingEffect: PropTypes.func, + switchScrollingEffect: Function, }); export { drawerProps, drawerChildProps }; diff --git a/components/vc-dropdown/Dropdown.tsx b/components/vc-dropdown/Dropdown.tsx index b3fc8d462..105eeb6be 100644 --- a/components/vc-dropdown/Dropdown.tsx +++ b/components/vc-dropdown/Dropdown.tsx @@ -7,12 +7,12 @@ import classNames from '../_util/classNames'; export default defineComponent({ props: { - minOverlayWidthMatchTrigger: PropTypes.looseBool, + minOverlayWidthMatchTrigger: { type: Boolean, default: undefined }, arrow: PropTypes.looseBool.def(false), prefixCls: PropTypes.string.def('rc-dropdown'), - transitionName: PropTypes.string, + transitionName: String, overlayClassName: PropTypes.string.def(''), - openClassName: PropTypes.string, + openClassName: String, animation: PropTypes.any, align: PropTypes.object, overlayStyle: PropTypes.style, @@ -21,11 +21,11 @@ export default defineComponent({ trigger: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]).def( 'hover', ), - alignPoint: PropTypes.looseBool, + alignPoint: { type: Boolean, default: undefined }, showAction: PropTypes.array, hideAction: PropTypes.array, - getPopupContainer: PropTypes.func, - visible: PropTypes.looseBool, + getPopupContainer: Function, + visible: { type: Boolean, default: undefined }, defaultVisible: PropTypes.looseBool.def(false), mouseEnterDelay: PropTypes.number.def(0.15), mouseLeaveDelay: PropTypes.number.def(0.1), diff --git a/components/vc-image/src/Preview.tsx b/components/vc-image/src/Preview.tsx index 52b6dd1b4..fa8cdf8d1 100644 --- a/components/vc-image/src/Preview.tsx +++ b/components/vc-image/src/Preview.tsx @@ -33,8 +33,8 @@ const initialPosition = { y: 0, }; const PreviewType = { - src: PropTypes.string, - alt: PropTypes.string, + src: String, + alt: String, ...IDialogPropTypes, }; const Preview = defineComponent({ diff --git a/components/vc-mentions/src/KeywordTrigger.tsx b/components/vc-mentions/src/KeywordTrigger.tsx index fde89a3dc..fa87e0243 100644 --- a/components/vc-mentions/src/KeywordTrigger.tsx +++ b/components/vc-mentions/src/KeywordTrigger.tsx @@ -43,17 +43,17 @@ const BUILT_IN_PLACEMENTS = { export default defineComponent({ name: 'KeywordTrigger', props: { - loading: PropTypes.looseBool, + loading: { type: Boolean, default: undefined }, options: { type: Array as PropType, default: () => [], }, - prefixCls: PropTypes.string, - placement: PropTypes.string, - visible: PropTypes.looseBool, - transitionName: PropTypes.string, - getPopupContainer: PropTypes.func, - direction: PropTypes.string, + prefixCls: String, + placement: String, + visible: { type: Boolean, default: undefined }, + transitionName: String, + getPopupContainer: Function, + direction: String, }, slots: ['notFoundContent', 'option'], setup(props, { slots }) { diff --git a/components/vc-mentions/src/mentionsProps.ts b/components/vc-mentions/src/mentionsProps.ts index fb65093cb..cd4c83a89 100644 --- a/components/vc-mentions/src/mentionsProps.ts +++ b/components/vc-mentions/src/mentionsProps.ts @@ -12,20 +12,20 @@ export const PlaceMent = tuple('top', 'bottom'); export type Direction = 'ltr' | 'rtl'; export const mentionsProps = { - autofocus: PropTypes.looseBool, + autofocus: { type: Boolean, default: undefined }, prefix: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]), - prefixCls: PropTypes.string, - value: PropTypes.string, - disabled: PropTypes.looseBool, - split: PropTypes.string, - transitionName: PropTypes.string, + prefixCls: String, + value: String, + disabled: { type: Boolean, default: undefined }, + split: String, + transitionName: String, placement: PropTypes.oneOf(PlaceMent), character: PropTypes.any, - characterRender: PropTypes.func, + characterRender: Function, filterOption: { type: [Boolean, Function] as PropType, }, - validateSearch: PropTypes.func, + validateSearch: Function, getPopupContainer: { type: Function as PropType<() => HTMLElement>, }, @@ -33,7 +33,7 @@ export const mentionsProps = { type: Array as PropType, default: () => undefined, }, - loading: PropTypes.looseBool, + loading: { type: Boolean, default: undefined }, rows: [Number, String], direction: { type: String as PropType }, }; diff --git a/components/vc-pagination/Options.tsx b/components/vc-pagination/Options.tsx index 3b28ad072..7ea1fd146 100644 --- a/components/vc-pagination/Options.tsx +++ b/components/vc-pagination/Options.tsx @@ -6,17 +6,17 @@ import type { EventHandler } from '../_util/EventInterface'; export default defineComponent({ props: { - disabled: PropTypes.looseBool, - changeSize: PropTypes.func, - quickGo: PropTypes.func, + disabled: { type: Boolean, default: undefined }, + changeSize: Function, + quickGo: Function, selectComponentClass: PropTypes.any, - current: PropTypes.number, + current: Number, pageSizeOptions: PropTypes.array.def(['10', '20', '50', '100']), - pageSize: PropTypes.number, - buildOptionText: PropTypes.func, + pageSize: Number, + buildOptionText: Function, locale: PropTypes.object, - rootPrefixCls: PropTypes.string, - selectPrefixCls: PropTypes.string, + rootPrefixCls: String, + selectPrefixCls: String, goButton: PropTypes.any, }, setup(props) { diff --git a/components/vc-pagination/Pager.tsx b/components/vc-pagination/Pager.tsx index 809fe1284..cbdd42e07 100644 --- a/components/vc-pagination/Pager.tsx +++ b/components/vc-pagination/Pager.tsx @@ -6,12 +6,12 @@ export default defineComponent({ name: 'Pager', inheritAttrs: false, props: { - rootPrefixCls: PropTypes.string, - page: PropTypes.number, - active: PropTypes.looseBool, - last: PropTypes.looseBool, + rootPrefixCls: String, + page: Number, + active: { type: Boolean, default: undefined }, + last: { type: Boolean, default: undefined }, locale: PropTypes.object, - showTitle: PropTypes.looseBool, + showTitle: { type: Boolean, default: undefined }, itemRender: { type: Function, default: () => {}, diff --git a/components/vc-pagination/Pagination.tsx b/components/vc-pagination/Pagination.tsx index 028ce829a..1d5a0a330 100644 --- a/components/vc-pagination/Pagination.tsx +++ b/components/vc-pagination/Pagination.tsx @@ -30,16 +30,16 @@ export default defineComponent({ mixins: [BaseMixin], inheritAttrs: false, props: { - disabled: PropTypes.looseBool, + disabled: { type: Boolean, default: undefined }, prefixCls: PropTypes.string.def('rc-pagination'), selectPrefixCls: PropTypes.string.def('rc-select'), - current: PropTypes.number, + current: Number, defaultCurrent: PropTypes.number.def(1), total: PropTypes.number.def(0), - pageSize: PropTypes.number, + pageSize: Number, defaultPageSize: PropTypes.number.def(10), hideOnSinglePage: PropTypes.looseBool.def(false), - showSizeChanger: PropTypes.looseBool, + showSizeChanger: { type: Boolean, default: undefined }, showLessItems: PropTypes.looseBool.def(false), // showSizeChange: PropTypes.func.def(noop), selectComponentClass: PropTypes.any, @@ -47,9 +47,9 @@ export default defineComponent({ showQuickJumper: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object]).def(false), showTitle: PropTypes.looseBool.def(true), pageSizeOptions: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), - buildOptionText: PropTypes.func, - showTotal: PropTypes.func, - simple: PropTypes.looseBool, + buildOptionText: Function, + showTotal: Function, + simple: { type: Boolean, default: undefined }, locale: PropTypes.object.def(LOCALE), itemRender: PropTypes.func.def(defaultItemRender), prevIcon: PropTypes.any, diff --git a/components/vc-progress/src/types.ts b/components/vc-progress/src/types.ts index 474ed7970..e195ddad3 100644 --- a/components/vc-progress/src/types.ts +++ b/components/vc-progress/src/types.ts @@ -8,24 +8,24 @@ export type GapPositionType = 'top' | 'right' | 'bottom' | 'left'; export type StrokeLinecapType = 'round' | 'butt' | 'square'; export const propTypes = { - gapDegree: PropTypes.number, + gapDegree: Number, gapPosition: { type: String as PropType, }, percent: { type: [Array, Number] as PropType, }, - prefixCls: PropTypes.string, + prefixCls: String, strokeColor: { type: [Object, String, Array] as PropType, }, strokeLinecap: { type: String as PropType, }, - strokeWidth: PropTypes.number, - trailColor: PropTypes.string, - trailWidth: PropTypes.number, - transition: PropTypes.string, + strokeWidth: Number, + trailColor: String, + trailWidth: Number, + transition: String, }; export type ProgressProps = Partial>; diff --git a/components/vc-select/SelectTrigger.tsx b/components/vc-select/SelectTrigger.tsx index a220d11d9..d80489427 100644 --- a/components/vc-select/SelectTrigger.tsx +++ b/components/vc-select/SelectTrigger.tsx @@ -84,26 +84,26 @@ const SelectTrigger = defineComponent({ inheritAttrs: false, props: { dropdownAlign: PropTypes.object, - visible: PropTypes.looseBool, - disabled: PropTypes.looseBool, - dropdownClassName: PropTypes.string, + visible: { type: Boolean, default: undefined }, + disabled: { type: Boolean, default: undefined }, + dropdownClassName: String, dropdownStyle: PropTypes.object, - placement: PropTypes.string, - empty: PropTypes.looseBool, - autoAdjustOverflow: PropTypes.looseBool, - prefixCls: PropTypes.string, - popupClassName: PropTypes.string, - animation: PropTypes.string, - transitionName: PropTypes.string, - getPopupContainer: PropTypes.func, - dropdownRender: PropTypes.func, - containerWidth: PropTypes.number, + placement: String, + empty: { type: Boolean, default: undefined }, + autoAdjustOverflow: { type: Boolean, default: undefined }, + prefixCls: String, + popupClassName: String, + animation: String, + transitionName: String, + getPopupContainer: Function, + dropdownRender: Function, + containerWidth: Number, dropdownMatchSelectWidth: PropTypes.oneOfType([Number, Boolean]).def(true), popupElement: PropTypes.any, - direction: PropTypes.string, - getTriggerDOMNode: PropTypes.func, - onPopupVisibleChange: PropTypes.func, - onPopupMouseEnter: PropTypes.func, + direction: String, + getTriggerDOMNode: Function, + onPopupVisibleChange: Function, + onPopupMouseEnter: Function, } as any, setup(props, { slots, attrs, expose }) { const builtInPlacements = computed(() => { diff --git a/components/vc-select/Selector/Input.tsx b/components/vc-select/Selector/Input.tsx index 134bd69ba..47f7447e9 100644 --- a/components/vc-select/Selector/Input.tsx +++ b/components/vc-select/Selector/Input.tsx @@ -15,16 +15,16 @@ import type { export const inputProps = { inputRef: PropTypes.any, - prefixCls: PropTypes.string, - id: PropTypes.string, + prefixCls: String, + id: String, inputElement: PropTypes.VueNode, - disabled: PropTypes.looseBool, - autofocus: PropTypes.looseBool, - autocomplete: PropTypes.string, - editable: PropTypes.looseBool, - activeDescendantId: PropTypes.string, - value: PropTypes.string, - open: PropTypes.looseBool, + disabled: { type: Boolean, default: undefined }, + autofocus: { type: Boolean, default: undefined }, + autocomplete: String, + editable: { type: Boolean, default: undefined }, + activeDescendantId: String, + value: String, + open: { type: Boolean, default: undefined }, tabindex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), /** Pass accessibility props to input */ attrs: PropTypes.object, diff --git a/components/vc-select/Selector/MultipleSelector.tsx b/components/vc-select/Selector/MultipleSelector.tsx index 3919d1f39..62c16675f 100644 --- a/components/vc-select/Selector/MultipleSelector.tsx +++ b/components/vc-select/Selector/MultipleSelector.tsx @@ -32,39 +32,39 @@ type SelectorProps = InnerSelectorProps & { }; const props = { - id: PropTypes.string, - prefixCls: PropTypes.string, + id: String, + prefixCls: String, values: PropTypes.array, - open: PropTypes.looseBool, - searchValue: PropTypes.string, + open: { type: Boolean, default: undefined }, + searchValue: String, inputRef: PropTypes.any, placeholder: PropTypes.any, - disabled: PropTypes.looseBool, - mode: PropTypes.string, - showSearch: PropTypes.looseBool, - autofocus: PropTypes.looseBool, - autocomplete: PropTypes.string, - activeDescendantId: PropTypes.string, + disabled: { type: Boolean, default: undefined }, + mode: String, + showSearch: { type: Boolean, default: undefined }, + autofocus: { type: Boolean, default: undefined }, + autocomplete: String, + activeDescendantId: String, tabindex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), removeIcon: PropTypes.any, - choiceTransitionName: PropTypes.string, + choiceTransitionName: String, maxTagCount: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), - maxTagTextLength: PropTypes.number, + maxTagTextLength: Number, maxTagPlaceholder: PropTypes.any.def( () => (omittedValues: DisplayValueType[]) => `+ ${omittedValues.length} ...`, ), - tagRender: PropTypes.func, + tagRender: Function, onToggleOpen: { type: Function as PropType<(open?: boolean) => void> }, - onRemove: PropTypes.func, - onInputChange: PropTypes.func, - onInputPaste: PropTypes.func, - onInputKeyDown: PropTypes.func, - onInputMouseDown: PropTypes.func, - onInputCompositionStart: PropTypes.func, - onInputCompositionEnd: PropTypes.func, + onRemove: Function, + onInputChange: Function, + onInputPaste: Function, + onInputKeyDown: Function, + onInputMouseDown: Function, + onInputCompositionStart: Function, + onInputCompositionEnd: Function, }; const onPreventMouseDown = (event: MouseEvent) => { diff --git a/components/vc-select/Selector/SingleSelector.tsx b/components/vc-select/Selector/SingleSelector.tsx index 8ad26355c..1fbed2373 100644 --- a/components/vc-select/Selector/SingleSelector.tsx +++ b/components/vc-select/Selector/SingleSelector.tsx @@ -13,29 +13,29 @@ interface SelectorProps extends InnerSelectorProps { } const props = { inputElement: PropTypes.any, - id: PropTypes.string, - prefixCls: PropTypes.string, + id: String, + prefixCls: String, values: PropTypes.array, - open: PropTypes.looseBool, - searchValue: PropTypes.string, + open: { type: Boolean, default: undefined }, + searchValue: String, inputRef: PropTypes.any, placeholder: PropTypes.any, - disabled: PropTypes.looseBool, - mode: PropTypes.string, - showSearch: PropTypes.looseBool, - autofocus: PropTypes.looseBool, - autocomplete: PropTypes.string, - activeDescendantId: PropTypes.string, + disabled: { type: Boolean, default: undefined }, + mode: String, + showSearch: { type: Boolean, default: undefined }, + autofocus: { type: Boolean, default: undefined }, + autocomplete: String, + activeDescendantId: String, tabindex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), - activeValue: PropTypes.string, - backfill: PropTypes.looseBool, - optionLabelRender: PropTypes.func, - onInputChange: PropTypes.func, - onInputPaste: PropTypes.func, - onInputKeyDown: PropTypes.func, - onInputMouseDown: PropTypes.func, - onInputCompositionStart: PropTypes.func, - onInputCompositionEnd: PropTypes.func, + activeValue: String, + backfill: { type: Boolean, default: undefined }, + optionLabelRender: Function, + onInputChange: Function, + onInputPaste: Function, + onInputKeyDown: Function, + onInputMouseDown: Function, + onInputCompositionStart: Function, + onInputCompositionEnd: Function, }; const SingleSelector = defineComponent({ name: 'SingleSelector', diff --git a/components/vc-select/Selector/index.tsx b/components/vc-select/Selector/index.tsx index 11f2dc9c0..e06a010b4 100644 --- a/components/vc-select/Selector/index.tsx +++ b/components/vc-select/Selector/index.tsx @@ -77,50 +77,50 @@ const Selector = defineComponent({ name: 'Selector', inheritAttrs: false, props: { - id: PropTypes.string, - prefixCls: PropTypes.string, - showSearch: PropTypes.looseBool, - open: PropTypes.looseBool, + id: String, + prefixCls: String, + showSearch: { type: Boolean, default: undefined }, + open: { type: Boolean, default: undefined }, /** Display in the Selector value, it's not same as `value` prop */ values: PropTypes.array, - multiple: PropTypes.looseBool, - mode: PropTypes.string, - searchValue: PropTypes.string, - activeValue: PropTypes.string, + multiple: { type: Boolean, default: undefined }, + mode: String, + searchValue: String, + activeValue: String, inputElement: PropTypes.any, - autofocus: PropTypes.looseBool, - activeDescendantId: PropTypes.string, + autofocus: { type: Boolean, default: undefined }, + activeDescendantId: String, tabindex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), - disabled: PropTypes.looseBool, + disabled: { type: Boolean, default: undefined }, placeholder: PropTypes.any, removeIcon: PropTypes.any, // Tags maxTagCount: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), - maxTagTextLength: PropTypes.number, + maxTagTextLength: Number, maxTagPlaceholder: PropTypes.any, - tagRender: PropTypes.func, - optionLabelRender: PropTypes.func, + tagRender: Function, + optionLabelRender: Function, /** Check if `tokenSeparators` contains `\n` or `\r\n` */ - tokenWithEnter: PropTypes.looseBool, + tokenWithEnter: { type: Boolean, default: undefined }, // Motion - choiceTransitionName: PropTypes.string, + choiceTransitionName: String, onToggleOpen: { type: Function as PropType<(open?: boolean) => void> }, /** `onSearch` returns go next step boolean to check if need do toggle open */ - onSearch: PropTypes.func, - onSearchSubmit: PropTypes.func, - onRemove: PropTypes.func, + onSearch: Function, + onSearchSubmit: Function, + onRemove: Function, onInputKeyDown: { type: Function as PropType }, /** * @private get real dom for trigger align. * This may be removed after React provides replacement of `findDOMNode` */ - domRef: PropTypes.func, + domRef: Function, } as any, setup(props, { expose }) { const inputRef = createRef(); diff --git a/components/vc-select/TransBtn.tsx b/components/vc-select/TransBtn.tsx index 6c95ce1d9..df38a76ca 100644 --- a/components/vc-select/TransBtn.tsx +++ b/components/vc-select/TransBtn.tsx @@ -56,11 +56,11 @@ const TransBtn: TransBtnType = (props, { slots }) => { TransBtn.inheritAttrs = false; TransBtn.displayName = 'TransBtn'; TransBtn.props = { - class: PropTypes.string, + class: String, customizeIcon: PropTypes.any, customizeIconProps: PropTypes.any, - onMousedown: PropTypes.func, - onClick: PropTypes.func, + onMousedown: Function, + onClick: Function, }; export default TransBtn; diff --git a/components/vc-slider/src/Handle.tsx b/components/vc-slider/src/Handle.tsx index 7183c8197..52dbcf2a3 100644 --- a/components/vc-slider/src/Handle.tsx +++ b/components/vc-slider/src/Handle.tsx @@ -8,15 +8,15 @@ export default defineComponent({ name: 'Handle', inheritAttrs: false, props: { - prefixCls: PropTypes.string, - vertical: PropTypes.looseBool, - offset: PropTypes.number, - disabled: PropTypes.looseBool, - min: PropTypes.number, - max: PropTypes.number, - value: PropTypes.number, + prefixCls: String, + vertical: { type: Boolean, default: undefined }, + offset: Number, + disabled: { type: Boolean, default: undefined }, + min: Number, + max: Number, + value: Number, tabindex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), - reverse: PropTypes.looseBool, + reverse: { type: Boolean, default: undefined }, ariaLabel: String, ariaLabelledBy: String, ariaValueTextFormatter: Function, diff --git a/components/vc-slider/src/Range.tsx b/components/vc-slider/src/Range.tsx index 64657b7fe..f755ba7c3 100644 --- a/components/vc-slider/src/Range.tsx +++ b/components/vc-slider/src/Range.tsx @@ -37,20 +37,20 @@ const trimAlignValue = ({ const rangeProps = { defaultValue: PropTypes.arrayOf(PropTypes.number), value: PropTypes.arrayOf(PropTypes.number), - count: PropTypes.number, + count: Number, pushable: withUndefined(PropTypes.oneOfType([PropTypes.looseBool, PropTypes.number])), - allowCross: PropTypes.looseBool, - disabled: PropTypes.looseBool, - reverse: PropTypes.looseBool, + allowCross: { type: Boolean, default: undefined }, + disabled: { type: Boolean, default: undefined }, + reverse: { type: Boolean, default: undefined }, tabindex: PropTypes.arrayOf(PropTypes.number), - prefixCls: PropTypes.string, - min: PropTypes.number, - max: PropTypes.number, - autofocus: PropTypes.looseBool, + prefixCls: String, + min: Number, + max: Number, + autofocus: { type: Boolean, default: undefined }, ariaLabelGroupForHandles: Array, ariaLabelledByGroupForHandles: Array, ariaValueTextFormatterGroupForHandles: Array, - draggableTrack: PropTypes.looseBool, + draggableTrack: { type: Boolean, default: undefined }, }; const Range = defineComponent({ name: 'Range', diff --git a/components/vc-slider/src/Slider.tsx b/components/vc-slider/src/Slider.tsx index 612e18c53..e09ece8db 100644 --- a/components/vc-slider/src/Slider.tsx +++ b/components/vc-slider/src/Slider.tsx @@ -11,14 +11,14 @@ const Slider = defineComponent({ mixins: [BaseMixin], inheritAttrs: false, props: { - defaultValue: PropTypes.number, - value: PropTypes.number, - disabled: PropTypes.looseBool, - autofocus: PropTypes.looseBool, + defaultValue: Number, + value: Number, + disabled: { type: Boolean, default: undefined }, + autofocus: { type: Boolean, default: undefined }, tabindex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), - reverse: PropTypes.looseBool, - min: PropTypes.number, - max: PropTypes.number, + reverse: { type: Boolean, default: undefined }, + min: Number, + max: Number, ariaLabelForHandle: String, ariaLabelledByForHandle: String, ariaValueTextFormatterForHandle: String, diff --git a/components/vc-slider/src/common/createSlider.tsx b/components/vc-slider/src/common/createSlider.tsx index 8f27c3929..dd3b39c42 100644 --- a/components/vc-slider/src/common/createSlider.tsx +++ b/components/vc-slider/src/common/createSlider.tsx @@ -16,18 +16,18 @@ function noop() {} export default function createSlider(Component) { // const displayName = `ComponentEnhancer(${Component.displayName})` const propTypes = { - id: PropTypes.string, - min: PropTypes.number, - max: PropTypes.number, - step: PropTypes.number, + id: String, + min: Number, + max: Number, + step: Number, marks: PropTypes.object, - included: PropTypes.looseBool, - prefixCls: PropTypes.string, - disabled: PropTypes.looseBool, - handle: PropTypes.func, - dots: PropTypes.looseBool, - vertical: PropTypes.looseBool, - reverse: PropTypes.looseBool, + included: { type: Boolean, default: undefined }, + prefixCls: String, + disabled: { type: Boolean, default: undefined }, + handle: Function, + dots: { type: Boolean, default: undefined }, + vertical: { type: Boolean, default: undefined }, + reverse: { type: Boolean, default: undefined }, minimumTrackStyle: PropTypes.object, // just for compatibility, will be deperecate maximumTrackStyle: PropTypes.object, // just for compatibility, will be deperecate handleStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.arrayOf(PropTypes.object)]), @@ -35,8 +35,8 @@ export default function createSlider(Component) { railStyle: PropTypes.object, dotStyle: PropTypes.object, activeDotStyle: PropTypes.object, - autofocus: PropTypes.looseBool, - draggableTrack: PropTypes.looseBool, + autofocus: { type: Boolean, default: undefined }, + draggableTrack: { type: Boolean, default: undefined }, }; return defineComponent({ name: 'CreateSlider', diff --git a/components/vc-steps/Step.tsx b/components/vc-steps/Step.tsx index 1cbb0a07a..530512fa7 100644 --- a/components/vc-steps/Step.tsx +++ b/components/vc-steps/Step.tsx @@ -8,17 +8,17 @@ function isString(str: any): str is string { } function noop() {} export const VcStepProps = () => ({ - prefixCls: PropTypes.string, + prefixCls: String, wrapperStyle: PropTypes.style, - itemWidth: PropTypes.string, - active: PropTypes.looseBool, - disabled: PropTypes.looseBool, - status: PropTypes.string, - iconPrefix: PropTypes.string, + itemWidth: String, + active: { type: Boolean, default: undefined }, + disabled: { type: Boolean, default: undefined }, + status: String, + iconPrefix: String, icon: PropTypes.any, - adjustMarginRight: PropTypes.string, - stepNumber: PropTypes.number, - stepIndex: PropTypes.number, + adjustMarginRight: String, + stepNumber: Number, + stepIndex: Number, description: PropTypes.any, title: PropTypes.any, subTitle: PropTypes.any, @@ -28,9 +28,9 @@ export const VcStepProps = () => ({ finish: PropTypes.any, error: PropTypes.any, }).loose, - onClick: PropTypes.func, - onStepClick: PropTypes.func, - stepIcon: PropTypes.func, + onClick: Function, + onStepClick: Function, + stepIcon: Function, }); export default defineComponent({ name: 'Step', diff --git a/components/vc-steps/Steps.tsx b/components/vc-steps/Steps.tsx index 01a0b58c8..702812c6a 100644 --- a/components/vc-steps/Steps.tsx +++ b/components/vc-steps/Steps.tsx @@ -38,7 +38,7 @@ export default defineComponent({ finish: PropTypes.any, error: PropTypes.any, }).loose, - stepIcon: PropTypes.func, + stepIcon: Function, }, slots: ['stepIcon', 'progressDot'], emits: ['change'], @@ -79,7 +79,7 @@ export default defineComponent({ // description: PropTypes.any, // icon: PropTypes.any, // status: PropTypes.oneOf(tuple('wait', 'process', 'finish', 'error')), - // disabled: PropTypes.looseBool, + // disabled: { type: Boolean, default: undefined }, // title: PropTypes.any, // subTitle: PropTypes.any, const { prefixCls: pre = prefixCls, ...restProps } = child.props || {}; diff --git a/components/vc-tooltip/src/Content.tsx b/components/vc-tooltip/src/Content.tsx index 5c90827f2..b812f7cd3 100644 --- a/components/vc-tooltip/src/Content.tsx +++ b/components/vc-tooltip/src/Content.tsx @@ -3,8 +3,8 @@ import { defineComponent } from 'vue'; import PropTypes from '../../_util/vue-types'; const tooltipContentProps = { - prefixCls: PropTypes.string, - id: PropTypes.string, + prefixCls: String, + id: String, overlayInnerStyle: PropTypes.any, }; diff --git a/components/vc-tooltip/src/Tooltip.tsx b/components/vc-tooltip/src/Tooltip.tsx index dbc7260ff..ed9efeb74 100644 --- a/components/vc-tooltip/src/Tooltip.tsx +++ b/components/vc-tooltip/src/Tooltip.tsx @@ -10,27 +10,27 @@ export default defineComponent({ inheritAttrs: false, props: { trigger: PropTypes.any.def(['hover']), - defaultVisible: PropTypes.looseBool, - visible: PropTypes.looseBool, + defaultVisible: { type: Boolean, default: undefined }, + visible: { type: Boolean, default: undefined }, placement: PropTypes.string.def('right'), - transitionName: PropTypes.string, + transitionName: String, animation: PropTypes.any, afterVisibleChange: PropTypes.func.def(() => {}), overlayStyle: PropTypes.style, - overlayClassName: PropTypes.string, + overlayClassName: String, prefixCls: PropTypes.string.def('rc-tooltip'), mouseEnterDelay: PropTypes.number.def(0.1), mouseLeaveDelay: PropTypes.number.def(0.1), - getTooltipContainer: PropTypes.func, + getTooltipContainer: Function, destroyTooltipOnHide: PropTypes.looseBool.def(false), align: PropTypes.object.def(() => ({})), arrowContent: PropTypes.any.def(null), - tipId: PropTypes.string, + tipId: String, builtinPlacements: PropTypes.object, overlayInnerStyle: PropTypes.style, - popupVisible: PropTypes.looseBool, - onVisibleChange: PropTypes.func, - onPopupAlign: PropTypes.func, + popupVisible: { type: Boolean, default: undefined }, + onVisibleChange: Function, + onPopupAlign: Function, }, slots: ['arrowContent', 'overlay'], setup(props, { slots, attrs, expose }) { diff --git a/components/vc-trigger/Trigger.tsx b/components/vc-trigger/Trigger.tsx index 6684b7501..146a10af7 100644 --- a/components/vc-trigger/Trigger.tsx +++ b/components/vc-trigger/Trigger.tsx @@ -59,29 +59,29 @@ export default defineComponent({ popupStyle: PropTypes.style, prefixCls: PropTypes.string.def('rc-trigger-popup'), popupClassName: PropTypes.string.def(''), - popupPlacement: PropTypes.string, + popupPlacement: String, builtinPlacements: PropTypes.object, - popupTransitionName: PropTypes.string, + popupTransitionName: String, popupAnimation: PropTypes.any, mouseEnterDelay: PropTypes.number.def(0), mouseLeaveDelay: PropTypes.number.def(0.1), - zIndex: PropTypes.number, + zIndex: Number, focusDelay: PropTypes.number.def(0), blurDelay: PropTypes.number.def(0.15), - getPopupContainer: PropTypes.func, + getPopupContainer: Function, getDocument: PropTypes.func.def(returnDocument), - forceRender: PropTypes.looseBool, + forceRender: { type: Boolean, default: undefined }, destroyPopupOnHide: PropTypes.looseBool.def(false), mask: PropTypes.looseBool.def(false), maskClosable: PropTypes.looseBool.def(true), // onPopupAlign: PropTypes.func.def(noop), popupAlign: PropTypes.object.def(() => ({})), - popupVisible: PropTypes.looseBool, + popupVisible: { type: Boolean, default: undefined }, defaultPopupVisible: PropTypes.looseBool.def(false), - maskTransitionName: PropTypes.string, - maskAnimation: PropTypes.string, - stretch: PropTypes.string, - alignPoint: PropTypes.looseBool, // Maybe we can support user pass position in the future + maskTransitionName: String, + maskAnimation: String, + stretch: String, + alignPoint: { type: Boolean, default: undefined }, // Maybe we can support user pass position in the future autoDestroy: PropTypes.looseBool.def(false), mobile: Object, getTriggerDOMNode: Function, diff --git a/components/vc-virtual-list/List.tsx b/components/vc-virtual-list/List.tsx index beb83c283..b0f1a8b3d 100644 --- a/components/vc-virtual-list/List.tsx +++ b/components/vc-virtual-list/List.tsx @@ -79,12 +79,12 @@ const List = defineComponent({ name: 'List', inheritAttrs: false, props: { - prefixCls: PropTypes.string, + prefixCls: String, data: PropTypes.array, - height: PropTypes.number, - itemHeight: PropTypes.number, + height: Number, + itemHeight: Number, /** If not match virtual scroll condition, Set List still use height of container. */ - fullHeight: PropTypes.looseBool, + fullHeight: { type: Boolean, default: undefined }, itemKey: { type: [String, Number, Function] as PropType) => Key)>, required: true, @@ -93,11 +93,11 @@ const List = defineComponent({ type: [String, Object] as PropType, }, /** Set `false` will always use real scroll instead of virtual one */ - virtual: PropTypes.looseBool, - children: PropTypes.func, - onScroll: PropTypes.func, - onMousedown: PropTypes.func, - onMouseenter: PropTypes.func, + virtual: { type: Boolean, default: undefined }, + children: Function, + onScroll: Function, + onMousedown: Function, + onMouseenter: Function, onVisibleChange: Function as PropType<(visibleList: any[], fullList: any[]) => void>, }, setup(props, { expose }) { diff --git a/components/vc-virtual-list/ScrollBar.tsx b/components/vc-virtual-list/ScrollBar.tsx index 45fbe0216..7de305254 100644 --- a/components/vc-virtual-list/ScrollBar.tsx +++ b/components/vc-virtual-list/ScrollBar.tsx @@ -23,11 +23,11 @@ export default defineComponent({ name: 'ScrollBar', inheritAttrs: false, props: { - prefixCls: PropTypes.string, - scrollTop: PropTypes.number, - scrollHeight: PropTypes.number, - height: PropTypes.number, - count: PropTypes.number, + prefixCls: String, + scrollTop: Number, + scrollHeight: Number, + height: Number, + count: Number, onScroll: { type: Function as PropType<(scrollTop: number) => void>, }, diff --git a/site/debugger/demo/demo.vue b/site/debugger/demo/demo.vue index aef1ca53b..fd3b703cb 100644 --- a/site/debugger/demo/demo.vue +++ b/site/debugger/demo/demo.vue @@ -1,56 +1,47 @@ - ---- -order: 0 -title: - zh-CN: 基本用法 - en-US: Basic usage ---- - -## zh-CN - -第一个对话框。 - -## en-US - -Basic modal. - - - -