feat: update prop type

feat-update-ts
tangjinzhou 2022-03-23 22:18:47 +08:00
parent 7bf1e0dda1
commit 1a7c41bb36
99 changed files with 632 additions and 641 deletions

View File

@ -15,7 +15,7 @@ export default defineComponent({
inheritAttrs: false, inheritAttrs: false,
props: { props: {
getContainer: PropTypes.func.isRequired, getContainer: PropTypes.func.isRequired,
didUpdate: PropTypes.func, didUpdate: Function,
}, },
setup(props, { slots }) { setup(props, { slots }) {
let isSSR = true; let isSSR = true;

View File

@ -52,10 +52,10 @@ export default defineComponent({
name: 'PortalWrapper', name: 'PortalWrapper',
inheritAttrs: false, inheritAttrs: false,
props: { props: {
wrapperClassName: PropTypes.string, wrapperClassName: String,
forceRender: PropTypes.looseBool, forceRender: { type: Boolean, default: undefined },
getContainer: PropTypes.any, getContainer: PropTypes.any,
visible: PropTypes.looseBool, visible: { type: Boolean, default: undefined },
}, },
setup(props, { slots }) { setup(props, { slots }) {

View File

@ -19,10 +19,10 @@ const TransButton = defineComponent({
name: 'TransButton', name: 'TransButton',
inheritAttrs: false, inheritAttrs: false,
props: { props: {
noStyle: PropTypes.looseBool, noStyle: { type: Boolean, default: undefined },
onClick: PropTypes.func, onClick: Function,
disabled: PropTypes.looseBool, disabled: { type: Boolean, default: undefined },
autofocus: PropTypes.looseBool, autofocus: { type: Boolean, default: undefined },
}, },
setup(props, { slots, emit, attrs, expose }) { setup(props, { slots, emit, attrs, expose }) {
const domRef = ref(); const domRef = ref();

View File

@ -44,7 +44,7 @@ export const alertProps = () => ({
*/ */
type: PropTypes.oneOf(AlertTypes), type: PropTypes.oneOf(AlertTypes),
/** Whether Alert can be closed */ /** Whether Alert can be closed */
closable: PropTypes.looseBool, closable: { type: Boolean, default: undefined },
/** Close text to show */ /** Close text to show */
closeText: PropTypes.any, closeText: PropTypes.any,
/** Content of Alert */ /** Content of Alert */
@ -54,9 +54,9 @@ export const alertProps = () => ({
/** Trigger when animation ending of Alert */ /** Trigger when animation ending of Alert */
afterClose: PropTypes.func.def(noop), afterClose: PropTypes.func.def(noop),
/** Whether to show icon */ /** Whether to show icon */
showIcon: PropTypes.looseBool, showIcon: { type: Boolean, default: undefined },
prefixCls: PropTypes.string, prefixCls: String,
banner: PropTypes.looseBool, banner: { type: Boolean, default: undefined },
icon: PropTypes.any, icon: PropTypes.any,
closeIcon: PropTypes.any, closeIcon: PropTypes.any,
onClose: Function as PropType<NodeMouseEventHandler>, onClose: Function as PropType<NodeMouseEventHandler>,

View File

@ -7,10 +7,10 @@ import useConfigInject from '../_util/hooks/useConfigInject';
import { useInjectAnchor } from './context'; import { useInjectAnchor } from './context';
export const anchorLinkProps = { export const anchorLinkProps = {
prefixCls: PropTypes.string, prefixCls: String,
href: PropTypes.string.def('#'), href: PropTypes.string.def('#'),
title: PropTypes.any, title: PropTypes.any,
target: PropTypes.string, target: String,
}; };
export type AnchorLinkProps = Partial<ExtractPropTypes<typeof anchorLinkProps>>; export type AnchorLinkProps = Partial<ExtractPropTypes<typeof anchorLinkProps>>;

View File

@ -17,7 +17,7 @@ export const autoCompleteProps = {
...omit(selectProps(), ['loading', 'mode', 'optionLabelProp', 'labelInValue']), ...omit(selectProps(), ['loading', 'mode', 'optionLabelProp', 'labelInValue']),
dataSource: PropTypes.array, dataSource: PropTypes.array,
dropdownMenuStyle: PropTypes.style, dropdownMenuStyle: PropTypes.style,
// optionLabelProp: PropTypes.string, // optionLabelProp: String,
dropdownMatchSelectWidth: { type: [Number, Boolean], default: true }, dropdownMatchSelectWidth: { type: [Number, Boolean], default: true },
}; };
@ -32,12 +32,12 @@ const AutoComplete = defineComponent({
inheritAttrs: false, inheritAttrs: false,
props: { props: {
...autoCompleteProps, ...autoCompleteProps,
prefixCls: PropTypes.string, prefixCls: String,
showSearch: PropTypes.looseBool, showSearch: { type: Boolean, default: undefined },
transitionName: PropTypes.string, transitionName: String,
choiceTransitionName: PropTypes.string.def('zoom'), choiceTransitionName: PropTypes.string.def('zoom'),
autofocus: PropTypes.looseBool, autofocus: { type: Boolean, default: undefined },
backfill: PropTypes.looseBool, backfill: { type: Boolean, default: undefined },
// optionLabelProp: PropTypes.string.def('children'), // optionLabelProp: PropTypes.string.def('children'),
filterOption: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.func]).def(false), filterOption: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.func]).def(false),
defaultActiveFirstOption: PropTypes.looseBool.def(true), defaultActiveFirstOption: PropTypes.looseBool.def(true),

View File

@ -15,18 +15,18 @@ import eagerComputed from '../_util/eagerComputed';
export type AvatarSize = 'large' | 'small' | 'default' | number | ScreenSizeMap; export type AvatarSize = 'large' | 'small' | 'default' | number | ScreenSizeMap;
export const avatarProps = () => ({ export const avatarProps = () => ({
prefixCls: PropTypes.string, prefixCls: String,
shape: PropTypes.oneOf(tuple('circle', 'square')).def('circle'), shape: PropTypes.oneOf(tuple('circle', 'square')).def('circle'),
size: { size: {
type: [Number, String, Object] as PropType<AvatarSize>, type: [Number, String, Object] as PropType<AvatarSize>,
default: (): AvatarSize => 'default', default: (): AvatarSize => 'default',
}, },
src: PropTypes.string, src: String,
/** Srcset of image avatar */ /** Srcset of image avatar */
srcset: PropTypes.string, srcset: String,
icon: PropTypes.any, icon: PropTypes.any,
alt: PropTypes.string, alt: String,
gap: PropTypes.number, gap: Number,
draggable: PropTypes.bool, draggable: PropTypes.bool,
crossOrigin: String as PropType<'' | 'anonymous' | 'use-credentials'>, crossOrigin: String as PropType<'' | 'anonymous' | 'use-credentials'>,
loadError: { loadError: {

View File

@ -11,8 +11,8 @@ import useConfigInject from '../_util/hooks/useConfigInject';
import useProvideSize from '../_util/hooks/useSize'; import useProvideSize from '../_util/hooks/useSize';
export const groupProps = () => ({ export const groupProps = () => ({
prefixCls: PropTypes.string, prefixCls: String,
maxCount: PropTypes.number, maxCount: Number,
maxStyle: { maxStyle: {
type: Object as PropType<CSSProperties>, type: Object as PropType<CSSProperties>,
default: () => ({} as CSSProperties), default: () => ({} as CSSProperties),

View File

@ -24,9 +24,9 @@ export const backTopProps = {
visibilityHeight: PropTypes.number.def(400), visibilityHeight: PropTypes.number.def(400),
duration: PropTypes.number.def(450), duration: PropTypes.number.def(450),
target: Function as PropType<() => HTMLElement | Window | Document>, target: Function as PropType<() => HTMLElement | Window | Document>,
prefixCls: PropTypes.string, prefixCls: String,
onClick: PropTypes.func, onClick: Function,
// visible: PropTypes.looseBool, // Only for test. Don't use it. // visible: { type: Boolean, default: undefined }, // Only for test. Don't use it.
}; };
export type BackTopProps = Partial<ExtractPropTypes<typeof backTopProps>>; export type BackTopProps = Partial<ExtractPropTypes<typeof backTopProps>>;

View File

@ -15,21 +15,21 @@ import isNumeric from '../_util/isNumeric';
export const badgeProps = { export const badgeProps = {
/** Number to show in badge */ /** Number to show in badge */
count: PropTypes.any, count: PropTypes.any,
showZero: PropTypes.looseBool, showZero: { type: Boolean, default: undefined },
/** Max count to show */ /** Max count to show */
overflowCount: PropTypes.number.def(99), overflowCount: PropTypes.number.def(99),
/** whether to show red dot without number */ /** whether to show red dot without number */
dot: PropTypes.looseBool, dot: { type: Boolean, default: undefined },
prefixCls: PropTypes.string, prefixCls: String,
scrollNumberPrefixCls: PropTypes.string, scrollNumberPrefixCls: String,
status: PropTypes.oneOf(tuple('success', 'processing', 'default', 'error', 'warning')), status: PropTypes.oneOf(tuple('success', 'processing', 'default', 'error', 'warning')),
// sync antd@4.6.0 // sync antd@4.6.0
size: PropTypes.oneOf(tuple('default', 'small')).def('default'), size: PropTypes.oneOf(tuple('default', 'small')).def('default'),
color: PropTypes.string, color: String,
text: PropTypes.any, text: PropTypes.any,
offset: PropTypes.arrayOf(PropTypes.oneOfType([String, Number])), offset: PropTypes.arrayOf(PropTypes.oneOfType([String, Number])),
numberStyle: PropTypes.style, numberStyle: PropTypes.style,
title: PropTypes.string, title: String,
}; };
export type BadgeProps = Partial<ExtractPropTypes<typeof badgeProps>>; export type BadgeProps = Partial<ExtractPropTypes<typeof badgeProps>>;

View File

@ -8,7 +8,7 @@ import PropTypes from '../_util/vue-types';
import useConfigInject from '../_util/hooks/useConfigInject'; import useConfigInject from '../_util/hooks/useConfigInject';
export const ribbonProps = { export const ribbonProps = {
prefix: PropTypes.string, prefix: String,
color: { type: String as PropType<LiteralUnion<PresetColorType, string>> }, color: { type: String as PropType<LiteralUnion<PresetColorType, string>> },
text: PropTypes.any, text: PropTypes.any,
placement: PropTypes.oneOf(tuple('start', 'end')).def('end'), placement: PropTypes.oneOf(tuple('start', 'end')).def('end'),

View File

@ -8,9 +8,9 @@ import SingleNumber from './SingleNumber';
import { filterEmpty } from '../_util/props-util'; import { filterEmpty } from '../_util/props-util';
export const scrollNumberProps = { export const scrollNumberProps = {
prefixCls: PropTypes.string, prefixCls: String,
count: PropTypes.any, count: PropTypes.any,
component: PropTypes.string, component: String,
title: PropTypes.oneOfType([PropTypes.number, PropTypes.string, null]), title: PropTypes.oneOfType([PropTypes.number, PropTypes.string, null]),
show: Boolean, show: Boolean,
}; };

View File

@ -15,7 +15,7 @@ export interface Route {
} }
export const breadcrumbProps = { export const breadcrumbProps = {
prefixCls: PropTypes.string, prefixCls: String,
routes: { type: Array as PropType<Route[]> }, routes: { type: Array as PropType<Route[]> },
params: PropTypes.any, params: PropTypes.any,
separator: PropTypes.any, separator: PropTypes.any,

View File

@ -7,8 +7,8 @@ import DownOutlined from '@ant-design/icons-vue/DownOutlined';
import useConfigInject from '../_util/hooks/useConfigInject'; import useConfigInject from '../_util/hooks/useConfigInject';
export const breadcrumbItemProps = { export const breadcrumbItemProps = {
prefixCls: PropTypes.string, prefixCls: String,
href: PropTypes.string, href: String,
separator: PropTypes.any, separator: PropTypes.any,
overlay: PropTypes.any, overlay: PropTypes.any,
}; };

View File

@ -5,7 +5,7 @@ import { flattenChildren } from '../_util/props-util';
import useConfigInject from '../_util/hooks/useConfigInject'; import useConfigInject from '../_util/hooks/useConfigInject';
export const breadcrumbSeparatorProps = { export const breadcrumbSeparatorProps = {
prefixCls: PropTypes.string, prefixCls: String,
}; };
export type BreadcrumbSeparatorProps = Partial<ExtractPropTypes<typeof breadcrumbSeparatorProps>>; export type BreadcrumbSeparatorProps = Partial<ExtractPropTypes<typeof breadcrumbSeparatorProps>>;

View File

@ -8,7 +8,7 @@ import type { SizeType } from '../config-provider';
import UnreachableException from '../_util/unreachableException'; import UnreachableException from '../_util/unreachableException';
const buttonGroupProps = { const buttonGroupProps = {
prefixCls: PropTypes.string, prefixCls: String,
size: { size: {
type: String as PropType<SizeType>, type: String as PropType<SizeType>,
}, },

View File

@ -21,7 +21,7 @@ export function convertLegacyProps(type?: LegacyButtonType): ButtonProps {
} }
export const buttonProps = () => ({ export const buttonProps = () => ({
prefixCls: PropTypes.string, prefixCls: String,
type: PropTypes.oneOf(ButtonTypes), type: PropTypes.oneOf(ButtonTypes),
htmlType: PropTypes.oneOf(ButtonHTMLTypes).def('button'), htmlType: PropTypes.oneOf(ButtonHTMLTypes).def('button'),
shape: PropTypes.oneOf(ButtonShapes), shape: PropTypes.oneOf(ButtonShapes),
@ -32,14 +32,14 @@ export const buttonProps = () => ({
type: [Boolean, Object] as PropType<boolean | { delay?: number }>, type: [Boolean, Object] as PropType<boolean | { delay?: number }>,
default: (): boolean | { delay?: number } => false, default: (): boolean | { delay?: number } => false,
}, },
disabled: PropTypes.looseBool, disabled: { type: Boolean, default: undefined },
ghost: PropTypes.looseBool, ghost: { type: Boolean, default: undefined },
block: PropTypes.looseBool, block: { type: Boolean, default: undefined },
danger: PropTypes.looseBool, danger: { type: Boolean, default: undefined },
icon: PropTypes.any, icon: PropTypes.any,
href: PropTypes.string, href: String,
target: PropTypes.string, target: String,
title: PropTypes.string, title: String,
onClick: { onClick: {
type: Function as PropType<(event: MouseEvent) => void>, type: Function as PropType<(event: MouseEvent) => void>,
}, },

View File

@ -24,7 +24,7 @@ export type CardSize = 'default' | 'small';
const { TabPane } = Tabs; const { TabPane } = Tabs;
export const cardProps = () => ({ export const cardProps = () => ({
prefixCls: PropTypes.string, prefixCls: String,
title: PropTypes.any, title: PropTypes.any,
extra: PropTypes.any, extra: PropTypes.any,
bordered: PropTypes.looseBool.def(true), bordered: PropTypes.looseBool.def(true),
@ -39,8 +39,8 @@ export const cardProps = () => ({
type: Array as PropType<CardTabListType[]>, type: Array as PropType<CardTabListType[]>,
}, },
tabBarExtraContent: PropTypes.any, tabBarExtraContent: PropTypes.any,
activeTabKey: PropTypes.string, activeTabKey: String,
defaultActiveTabKey: PropTypes.string, defaultActiveTabKey: String,
cover: PropTypes.any, cover: PropTypes.any,
onTabChange: { onTabChange: {
type: Function as PropType<(key: string) => void>, type: Function as PropType<(key: string) => void>,

View File

@ -6,7 +6,7 @@ import useConfigInject from '../_util/hooks/useConfigInject';
export default defineComponent({ export default defineComponent({
name: 'ACardMeta', name: 'ACardMeta',
props: { props: {
prefixCls: PropTypes.string, prefixCls: String,
title: PropTypes.any, title: PropTypes.any,
description: PropTypes.any, description: PropTypes.any,
avatar: PropTypes.any, avatar: PropTypes.any,

View File

@ -51,9 +51,9 @@ export const abstractCheckboxProps = () => {
indeterminate: { type: Boolean, default: undefined }, indeterminate: { type: Boolean, default: undefined },
type: { type: String, default: 'checkbox' }, type: { type: String, default: 'checkbox' },
autofocus: { type: Boolean, default: undefined }, autofocus: { type: Boolean, default: undefined },
onChange: PropTypes.func, onChange: Function,
'onUpdate:checked': PropTypes.func, 'onUpdate:checked': Function,
onClick: PropTypes.func, onClick: Function,
skipGroup: { type: Boolean, default: false }, skipGroup: { type: Boolean, default: false },
}; };
}; };

View File

@ -6,32 +6,32 @@ export type CollapsibleType = 'header' | 'disabled';
export type ActiveKeyType = Array<string | number> | string | number; export type ActiveKeyType = Array<string | number> | string | number;
const collapseProps = () => ({ const collapseProps = () => ({
prefixCls: PropTypes.string, prefixCls: String,
activeKey: { type: [Array, Number, String] as PropType<ActiveKeyType> }, activeKey: { type: [Array, Number, String] as PropType<ActiveKeyType> },
defaultActiveKey: { type: [Array, Number, String] as PropType<ActiveKeyType> }, defaultActiveKey: { type: [Array, Number, String] as PropType<ActiveKeyType> },
accordion: PropTypes.looseBool, accordion: { type: Boolean, default: undefined },
destroyInactivePanel: PropTypes.looseBool, destroyInactivePanel: { type: Boolean, default: undefined },
bordered: PropTypes.looseBool, bordered: { type: Boolean, default: undefined },
expandIcon: PropTypes.func, expandIcon: Function,
openAnimation: PropTypes.object, openAnimation: PropTypes.object,
expandIconPosition: PropTypes.oneOf(tuple('left', 'right')), expandIconPosition: PropTypes.oneOf(tuple('left', 'right')),
collapsible: { type: String as PropType<CollapsibleType> }, collapsible: { type: String as PropType<CollapsibleType> },
ghost: PropTypes.looseBool, ghost: { type: Boolean, default: undefined },
}); });
const collapsePanelProps = () => ({ const collapsePanelProps = () => ({
openAnimation: PropTypes.object, openAnimation: PropTypes.object,
prefixCls: PropTypes.string, prefixCls: String,
header: PropTypes.any, header: PropTypes.any,
headerClass: PropTypes.string, headerClass: String,
showArrow: PropTypes.looseBool, showArrow: { type: Boolean, default: undefined },
isActive: PropTypes.looseBool, isActive: { type: Boolean, default: undefined },
destroyInactivePanel: PropTypes.looseBool, destroyInactivePanel: { type: Boolean, default: undefined },
/** @deprecated Use `collapsible="disabled"` instead */ /** @deprecated Use `collapsible="disabled"` instead */
disabled: PropTypes.looseBool, disabled: { type: Boolean, default: undefined },
accordion: PropTypes.looseBool, accordion: { type: Boolean, default: undefined },
forceRender: PropTypes.looseBool, forceRender: { type: Boolean, default: undefined },
expandIcon: PropTypes.func, expandIcon: Function,
extra: PropTypes.any, extra: PropTypes.any,
panelKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), panelKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
collapsible: { type: String as PropType<CollapsibleType> }, collapsible: { type: String as PropType<CollapsibleType> },

View File

@ -21,16 +21,16 @@ export default {
event: 'change.value', //v-model ,pickrchange event: 'change.value', //v-model ,pickrchange
}, },
props: { props: {
prefixCls: PropTypes.string, prefixCls: String,
defaultValue: PropTypes.string, // defaultValue: String, //
config: PropTypes.object, //pickr config: PropTypes.object, //pickr
value: PropTypes.string, // value: String, //
locale: PropTypes.object, // locale: PropTypes.object, //
colorRounded: PropTypes.number, // colorRounded: Number, //
size: PropTypes.oneOf(['default', 'small', 'large']).def('default'), // size: PropTypes.oneOf(['default', 'small', 'large']).def('default'), //
getPopupContainer: PropTypes.func, // getPopupContainer: Function, //
disabled: PropTypes.looseBool.def(false), // disabled: PropTypes.looseBool.def(false), //
format: PropTypes.string, // format: String, //
alpha: PropTypes.looseBool.def(false), // alpha: PropTypes.looseBool.def(false), //
hue: PropTypes.looseBool.def(true), // hue: PropTypes.looseBool.def(true), //
}, },

View File

@ -14,7 +14,7 @@ export const commentProps = {
/** The main content of the comment */ /** The main content of the comment */
content: PropTypes.any, content: PropTypes.any,
/** Comment prefix defaults to '.ant-comment' */ /** Comment prefix defaults to '.ant-comment' */
prefixCls: PropTypes.string, prefixCls: String,
/** A datetime element containing the time to be displayed */ /** A datetime element containing the time to be displayed */
datetime: PropTypes.any, datetime: PropTypes.any,
}; };

View File

@ -93,7 +93,7 @@ export const configProviderProps = () => ({
input: { input: {
type: Object as PropType<{ autocomplete: string }>, type: Object as PropType<{ autocomplete: string }>,
}, },
autoInsertSpaceInButton: PropTypes.looseBool, autoInsertSpaceInButton: { type: Boolean, default: undefined },
locale: { locale: {
type: Object as PropType<Locale>, type: Object as PropType<Locale>,
default: undefined as Locale, default: undefined as Locale,
@ -110,7 +110,7 @@ export const configProviderProps = () => ({
space: { space: {
type: Object as PropType<{ size: SizeType | number }>, type: Object as PropType<{ size: SizeType | number }>,
}, },
virtual: PropTypes.looseBool, virtual: { type: Boolean, default: undefined },
dropdownMatchSelectWidth: { type: [Number, Boolean], default: true }, dropdownMatchSelectWidth: { type: [Number, Boolean], default: true },
form: { form: {
type: Object as PropType<{ type: Object as PropType<{

View File

@ -29,13 +29,13 @@ import { flattenChildren } from '../_util/props-util';
import useConfigInject from '../_util/hooks/useConfigInject'; import useConfigInject from '../_util/hooks/useConfigInject';
export const DescriptionsItemProps = { export const DescriptionsItemProps = {
prefixCls: PropTypes.string, prefixCls: String,
label: PropTypes.any, label: PropTypes.any,
span: PropTypes.number, span: Number,
}; };
const descriptionsItemProp = { const descriptionsItemProp = {
prefixCls: PropTypes.string, prefixCls: String,
label: PropTypes.any, label: PropTypes.any,
labelStyle: PropTypes.style, labelStyle: PropTypes.style,
contentStyle: PropTypes.style, contentStyle: PropTypes.style,
@ -129,8 +129,8 @@ function getRows(children: VNode[], column: number) {
} }
export const descriptionsProps = { export const descriptionsProps = {
prefixCls: PropTypes.string, prefixCls: String,
bordered: PropTypes.looseBool, bordered: { type: Boolean, default: undefined },
size: PropTypes.oneOf(tuple('default', 'middle', 'small')).def('default'), size: PropTypes.oneOf(tuple('default', 'middle', 'small')).def('default'),
title: PropTypes.any, title: PropTypes.any,
extra: PropTypes.any, extra: PropTypes.any,
@ -139,7 +139,7 @@ export const descriptionsProps = {
default: (): number | Partial<Record<Breakpoint, number>> => DEFAULT_COLUMN_MAP, default: (): number | Partial<Record<Breakpoint, number>> => DEFAULT_COLUMN_MAP,
}, },
layout: PropTypes.oneOf(tuple('horizontal', 'vertical')), layout: PropTypes.oneOf(tuple('horizontal', 'vertical')),
colon: PropTypes.looseBool, colon: { type: Boolean, default: undefined },
labelStyle: PropTypes.style, labelStyle: PropTypes.style,
contentStyle: PropTypes.style, contentStyle: PropTypes.style,
}; };

View File

@ -35,21 +35,21 @@ export interface PushState {
const defaultPushState: PushState = { distance: 180 }; const defaultPushState: PushState = { distance: 180 };
export const drawerProps = () => ({ export const drawerProps = () => ({
autofocus: PropTypes.looseBool, autofocus: { type: Boolean, default: undefined },
closable: PropTypes.looseBool, closable: { type: Boolean, default: undefined },
closeIcon: PropTypes.any, closeIcon: PropTypes.any,
destroyOnClose: PropTypes.looseBool, destroyOnClose: { type: Boolean, default: undefined },
forceRender: PropTypes.looseBool, forceRender: { type: Boolean, default: undefined },
getContainer: PropTypes.any, getContainer: PropTypes.any,
maskClosable: PropTypes.looseBool, maskClosable: { type: Boolean, default: undefined },
mask: PropTypes.looseBool, mask: { type: Boolean, default: undefined },
maskStyle: PropTypes.object, maskStyle: PropTypes.object,
/** @deprecated Use `style` instead */ /** @deprecated Use `style` instead */
wrapStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties }, wrapStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
style: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties }, style: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
class: PropTypes.any, class: PropTypes.any,
/** @deprecated Use `class` instead */ /** @deprecated Use `class` instead */
wrapClassName: PropTypes.string, wrapClassName: String,
size: { size: {
type: String as PropType<sizeType>, type: String as PropType<sizeType>,
}, },
@ -58,14 +58,14 @@ export const drawerProps = () => ({
bodyStyle: PropTypes.object, bodyStyle: PropTypes.object,
contentWrapperStyle: PropTypes.object, contentWrapperStyle: PropTypes.object,
title: PropTypes.any, title: PropTypes.any,
visible: PropTypes.looseBool, visible: { type: Boolean, default: undefined },
width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
zIndex: PropTypes.number, zIndex: Number,
prefixCls: PropTypes.string, prefixCls: String,
push: PropTypes.oneOfType([PropTypes.looseBool, { type: Object as PropType<PushState> }]), push: PropTypes.oneOfType([PropTypes.looseBool, { type: Object as PropType<PushState> }]),
placement: PropTypes.oneOf(PlacementTypes), placement: PropTypes.oneOf(PlacementTypes),
keyboard: PropTypes.looseBool, keyboard: { type: Boolean, default: undefined },
extra: PropTypes.any, extra: PropTypes.any,
footer: PropTypes.any, footer: PropTypes.any,
footerStyle: PropTypes.object, footerStyle: PropTypes.object,
@ -77,7 +77,7 @@ export const drawerProps = () => ({
}, },
handle: PropTypes.any, handle: PropTypes.any,
/** @deprecated Use `@afterVisibleChange` instead */ /** @deprecated Use `@afterVisibleChange` instead */
afterVisibleChange: PropTypes.func, afterVisibleChange: Function,
}); });
export type DrawerProps = Partial<ExtractPropTypes<ReturnType<typeof drawerProps>>>; export type DrawerProps = Partial<ExtractPropTypes<ReturnType<typeof drawerProps>>>;

View File

@ -32,12 +32,12 @@ const dropdownProps = () => ({
>, >,
}, },
overlay: PropTypes.any, overlay: PropTypes.any,
visible: PropTypes.looseBool, visible: { type: Boolean, default: undefined },
disabled: PropTypes.looseBool, disabled: { type: Boolean, default: undefined },
align: { type: Object as PropType<Align> }, align: { type: Object as PropType<Align> },
getPopupContainer: PropTypes.func, getPopupContainer: Function,
prefixCls: PropTypes.string, prefixCls: String,
transitionName: PropTypes.string, transitionName: String,
placement: PropTypes.oneOf( placement: PropTypes.oneOf(
tuple( tuple(
'topLeft', 'topLeft',
@ -50,14 +50,14 @@ const dropdownProps = () => ({
'bottomRight', 'bottomRight',
), ),
), ),
overlayClassName: PropTypes.string, overlayClassName: String,
overlayStyle: PropTypes.style, overlayStyle: PropTypes.style,
forceRender: PropTypes.looseBool, forceRender: { type: Boolean, default: undefined },
mouseEnterDelay: PropTypes.number, mouseEnterDelay: Number,
mouseLeaveDelay: PropTypes.number, mouseLeaveDelay: Number,
openClassName: PropTypes.string, openClassName: String,
minOverlayWidthMatchTrigger: PropTypes.looseBool, minOverlayWidthMatchTrigger: { type: Boolean, default: undefined },
destroyPopupOnHide: PropTypes.looseBool, destroyPopupOnHide: { type: Boolean, default: undefined },
onVisibleChange: { onVisibleChange: {
type: Function as PropType<(val: boolean) => void>, type: Function as PropType<(val: boolean) => void>,
}, },
@ -72,11 +72,11 @@ const dropdownButtonProps = () => ({
type: buttonTypesProps.type, type: buttonTypesProps.type,
size: PropTypes.oneOf(tuple('small', 'large')), size: PropTypes.oneOf(tuple('small', 'large')),
htmlType: buttonTypesProps.htmlType, htmlType: buttonTypesProps.htmlType,
href: PropTypes.string, href: String,
disabled: PropTypes.looseBool, disabled: { type: Boolean, default: undefined },
prefixCls: PropTypes.string, prefixCls: String,
icon: PropTypes.any, icon: PropTypes.any,
title: PropTypes.string, title: String,
loading: buttonTypesProps.loading, loading: buttonTypesProps.loading,
onClick: { onClick: {
type: Function as PropType<MouseEventHandler>, type: Function as PropType<MouseEventHandler>,

View File

@ -85,7 +85,7 @@ Empty.PRESENTED_IMAGE_DEFAULT = defaultEmptyImg;
Empty.PRESENTED_IMAGE_SIMPLE = simpleEmptyImg; Empty.PRESENTED_IMAGE_SIMPLE = simpleEmptyImg;
Empty.inheritAttrs = false; Empty.inheritAttrs = false;
Empty.props = { Empty.props = {
prefixCls: PropTypes.string, prefixCls: String,
image: PropTypes.any, image: PropTypes.any,
description: PropTypes.any, description: PropTypes.any,
imageStyle: PropTypes.object, imageStyle: PropTypes.object,

View File

@ -64,21 +64,21 @@ export const formProps = {
layout: PropTypes.oneOf(tuple('horizontal', 'inline', 'vertical')), layout: PropTypes.oneOf(tuple('horizontal', 'inline', 'vertical')),
labelCol: { type: Object as PropType<ColProps & HTMLAttributes> }, labelCol: { type: Object as PropType<ColProps & HTMLAttributes> },
wrapperCol: { type: Object as PropType<ColProps & HTMLAttributes> }, wrapperCol: { type: Object as PropType<ColProps & HTMLAttributes> },
colon: PropTypes.looseBool, colon: { type: Boolean, default: undefined },
labelAlign: PropTypes.oneOf(tuple('left', 'right')), labelAlign: PropTypes.oneOf(tuple('left', 'right')),
labelWrap: PropTypes.looseBool, labelWrap: { type: Boolean, default: undefined },
prefixCls: PropTypes.string, prefixCls: String,
requiredMark: { type: [String, Boolean] as PropType<RequiredMark | ''>, default: undefined }, requiredMark: { type: [String, Boolean] as PropType<RequiredMark | ''>, default: undefined },
/** @deprecated Will warning in future branch. Pls use `requiredMark` instead. */ /** @deprecated Will warning in future branch. Pls use `requiredMark` instead. */
hideRequiredMark: PropTypes.looseBool, hideRequiredMark: { type: Boolean, default: undefined },
model: PropTypes.object, model: PropTypes.object,
rules: { type: Object as PropType<{ [k: string]: ValidationRule[] | ValidationRule }> }, rules: { type: Object as PropType<{ [k: string]: ValidationRule[] | ValidationRule }> },
validateMessages: PropTypes.object, validateMessages: PropTypes.object,
validateOnRuleChange: PropTypes.looseBool, validateOnRuleChange: { type: Boolean, default: undefined },
// //
scrollToFirstError: { type: [Boolean, Object] as PropType<boolean | Options> }, scrollToFirstError: { type: [Boolean, Object] as PropType<boolean | Options> },
onSubmit: PropTypes.func, onSubmit: Function,
name: PropTypes.string, name: String,
validateTrigger: { type: [String, Array] as PropType<string | string[]> }, validateTrigger: { type: [String, Array] as PropType<string | string[]> },
size: { type: String as PropType<SizeType> }, size: { type: String as PropType<SizeType> },
onValuesChange: { type: Function as PropType<Callbacks['onValuesChange']> }, onValuesChange: { type: Function as PropType<Callbacks['onValuesChange']> },

View File

@ -82,22 +82,22 @@ function getPropByPath(obj: any, namePathList: any, strict?: boolean) {
}; };
} }
export const formItemProps = { export const formItemProps = {
htmlFor: PropTypes.string, htmlFor: String,
prefixCls: PropTypes.string, prefixCls: String,
label: PropTypes.any, label: PropTypes.any,
help: PropTypes.any, help: PropTypes.any,
extra: PropTypes.any, extra: PropTypes.any,
labelCol: { type: Object as PropType<ColProps & HTMLAttributes> }, labelCol: { type: Object as PropType<ColProps & HTMLAttributes> },
wrapperCol: { type: Object as PropType<ColProps & HTMLAttributes> }, wrapperCol: { type: Object as PropType<ColProps & HTMLAttributes> },
hasFeedback: PropTypes.looseBool.def(false), hasFeedback: PropTypes.looseBool.def(false),
colon: PropTypes.looseBool, colon: { type: Boolean, default: undefined },
labelAlign: PropTypes.oneOf(tuple('left', 'right')), labelAlign: PropTypes.oneOf(tuple('left', 'right')),
prop: { type: [String, Number, Array] as PropType<string | number | Array<string | number>> }, prop: { type: [String, Number, Array] as PropType<string | number | Array<string | number>> },
name: { type: [String, Number, Array] as PropType<string | number | Array<string | number>> }, name: { type: [String, Number, Array] as PropType<string | number | Array<string | number>> },
rules: PropTypes.oneOfType([Array, Object]), rules: PropTypes.oneOfType([Array, Object]),
autoLink: PropTypes.looseBool.def(true), autoLink: PropTypes.looseBool.def(true),
required: PropTypes.looseBool, required: { type: Boolean, default: undefined },
validateFirst: PropTypes.looseBool, validateFirst: { type: Boolean, default: undefined },
validateStatus: PropTypes.oneOf(tuple('', 'success', 'warning', 'error', 'validating')), validateStatus: PropTypes.oneOf(tuple('', 'success', 'warning', 'error', 'validating')),
validateTrigger: { type: [String, Array] as PropType<string | string[]> }, validateTrigger: { type: [String, Array] as PropType<string | string[]> },
messageVariables: { type: Object as PropType<Record<string, string>> }, messageVariables: { type: Object as PropType<Record<string, string>> },

View File

@ -15,22 +15,22 @@ export default defineComponent({
name: 'ClearableLabeledInput', name: 'ClearableLabeledInput',
inheritAttrs: false, inheritAttrs: false,
props: { props: {
prefixCls: PropTypes.string, prefixCls: String,
inputType: PropTypes.oneOf(tuple('text', 'input')), inputType: PropTypes.oneOf(tuple('text', 'input')),
value: PropTypes.any, value: PropTypes.any,
defaultValue: PropTypes.any, defaultValue: PropTypes.any,
allowClear: PropTypes.looseBool, allowClear: { type: Boolean, default: undefined },
element: PropTypes.any, element: PropTypes.any,
handleReset: PropTypes.func, handleReset: Function,
disabled: PropTypes.looseBool, disabled: { type: Boolean, default: undefined },
direction: { type: String as PropType<Direction> }, direction: { type: String as PropType<Direction> },
size: { type: String as PropType<SizeType> }, size: { type: String as PropType<SizeType> },
suffix: PropTypes.any, suffix: PropTypes.any,
prefix: PropTypes.any, prefix: PropTypes.any,
addonBefore: PropTypes.any, addonBefore: PropTypes.any,
addonAfter: PropTypes.any, addonAfter: PropTypes.any,
readonly: PropTypes.looseBool, readonly: { type: Boolean, default: undefined },
focused: PropTypes.looseBool, focused: { type: Boolean, default: undefined },
bordered: PropTypes.looseBool.def(true), bordered: PropTypes.looseBool.def(true),
triggerFocus: { type: Function as PropType<() => void> }, triggerFocus: { type: Function as PropType<() => void> },
hidden: Boolean, hidden: Boolean,

View File

@ -8,9 +8,9 @@ import useConfigInject from '../_util/hooks/useConfigInject';
export default defineComponent({ export default defineComponent({
name: 'AInputGroup', name: 'AInputGroup',
props: { props: {
prefixCls: PropTypes.string, prefixCls: String,
size: { type: String as PropType<SizeType> }, size: { type: String as PropType<SizeType> },
compact: PropTypes.looseBool, compact: { type: Boolean, default: undefined },
onMouseenter: { type: Function as PropType<MouseEventHandler> }, onMouseenter: { type: Function as PropType<MouseEventHandler> },
onMouseleave: { type: Function as PropType<MouseEventHandler> }, onMouseleave: { type: Function as PropType<MouseEventHandler> },
onFocus: { type: Function as PropType<FocusEventHandler> }, onFocus: { type: Function as PropType<FocusEventHandler> },

View File

@ -24,11 +24,11 @@ export default defineComponent({
inheritAttrs: false, inheritAttrs: false,
props: { props: {
...inputProps, ...inputProps,
prefixCls: PropTypes.string, prefixCls: String,
inputPrefixCls: PropTypes.string, inputPrefixCls: String,
action: PropTypes.string.def('click'), action: PropTypes.string.def('click'),
visibilityToggle: PropTypes.looseBool.def(true), visibilityToggle: PropTypes.looseBool.def(true),
iconRender: PropTypes.func, iconRender: Function,
}, },
setup(props, { slots, attrs, expose }) { setup(props, { slots, attrs, expose }) {
const visible = ref(false); const visible = ref(false);

View File

@ -18,7 +18,7 @@ export default defineComponent({
inheritAttrs: false, inheritAttrs: false,
props: { props: {
...inputProps, ...inputProps,
inputPrefixCls: PropTypes.string, inputPrefixCls: String,
// https://github.com/vueComponent/ant-design-vue/issues/1916 // https://github.com/vueComponent/ant-design-vue/issues/1916
enterButton: PropTypes.any, enterButton: PropTypes.any,
onSearch: { onSearch: {

View File

@ -5,9 +5,9 @@ import omit from '../_util/omit';
import type { LiteralUnion, VueNode } from '../_util/type'; import type { LiteralUnion, VueNode } from '../_util/type';
export const inputDefaultValue = Symbol() as unknown as string; export const inputDefaultValue = Symbol() as unknown as string;
const inputProps = { const inputProps = {
id: PropTypes.string, id: String,
prefixCls: PropTypes.string, prefixCls: String,
inputPrefixCls: PropTypes.string, inputPrefixCls: String,
defaultValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), defaultValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
value: { value: {
type: [String, Number, Symbol] as PropType<string | number>, type: [String, Number, Symbol] as PropType<string | number>,
@ -47,30 +47,30 @@ const inputProps = {
>, >,
default: 'text', default: 'text',
}, },
name: PropTypes.string, name: String,
size: { type: String as PropType<SizeType> }, size: { type: String as PropType<SizeType> },
disabled: PropTypes.looseBool, disabled: { type: Boolean, default: undefined },
readonly: PropTypes.looseBool, readonly: { type: Boolean, default: undefined },
addonBefore: PropTypes.any, addonBefore: PropTypes.any,
addonAfter: PropTypes.any, addonAfter: PropTypes.any,
prefix: PropTypes.any, prefix: PropTypes.any,
suffix: PropTypes.any, suffix: PropTypes.any,
autofocus: PropTypes.looseBool, autofocus: { type: Boolean, default: undefined },
allowClear: PropTypes.looseBool, allowClear: { type: Boolean, default: undefined },
lazy: PropTypes.looseBool.def(true), lazy: PropTypes.looseBool.def(true),
maxlength: PropTypes.number, maxlength: Number,
loading: PropTypes.looseBool, loading: { type: Boolean, default: undefined },
bordered: PropTypes.looseBool, bordered: { type: Boolean, default: undefined },
showCount: { type: [Boolean, Object] as PropType<boolean | ShowCountProps> }, showCount: { type: [Boolean, Object] as PropType<boolean | ShowCountProps> },
htmlSize: Number, htmlSize: Number,
onPressEnter: PropTypes.func, onPressEnter: Function,
onKeydown: PropTypes.func, onKeydown: Function,
onKeyup: PropTypes.func, onKeyup: Function,
onFocus: PropTypes.func, onFocus: Function,
onBlur: PropTypes.func, onBlur: Function,
onChange: PropTypes.func, onChange: Function,
onInput: PropTypes.func, onInput: Function,
'onUpdate:value': PropTypes.func, 'onUpdate:value': Function,
valueModifiers: Object, valueModifiers: Object,
hidden: Boolean, hidden: Boolean,
}; };
@ -90,8 +90,8 @@ const textAreaProps = {
autosize: { type: [Boolean, Object] as PropType<AutoSizeType>, default: undefined }, autosize: { type: [Boolean, Object] as PropType<AutoSizeType>, default: undefined },
autoSize: { type: [Boolean, Object] as PropType<AutoSizeType>, default: undefined }, autoSize: { type: [Boolean, Object] as PropType<AutoSizeType>, default: undefined },
onResize: { type: Function as PropType<(size: { width: number; height: number }) => void> }, onResize: { type: Function as PropType<(size: { width: number; height: number }) => void> },
onCompositionstart: PropTypes.func, onCompositionstart: Function,
onCompositionend: PropTypes.func, onCompositionend: Function,
valueModifiers: Object, valueModifiers: Object,
}; };

View File

@ -24,11 +24,11 @@ const dimensionMaxMap = {
export type CollapseType = 'clickTrigger' | 'responsive'; export type CollapseType = 'clickTrigger' | 'responsive';
export const siderProps = { export const siderProps = {
prefixCls: PropTypes.string, prefixCls: String,
collapsible: PropTypes.looseBool, collapsible: { type: Boolean, default: undefined },
collapsed: PropTypes.looseBool, collapsed: { type: Boolean, default: undefined },
defaultCollapsed: PropTypes.looseBool, defaultCollapsed: { type: Boolean, default: undefined },
reverseArrow: PropTypes.looseBool, reverseArrow: { type: Boolean, default: undefined },
zeroWidthTriggerStyle: PropTypes.style, zeroWidthTriggerStyle: PropTypes.style,
trigger: PropTypes.any, trigger: PropTypes.any,
width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),

View File

@ -5,9 +5,9 @@ import useConfigInject from '../_util/hooks/useConfigInject';
import { SiderHookProviderKey } from './injectionKey'; import { SiderHookProviderKey } from './injectionKey';
export const basicProps = { export const basicProps = {
prefixCls: PropTypes.string, prefixCls: String,
hasSider: PropTypes.looseBool, hasSider: { type: Boolean, default: undefined },
tagName: PropTypes.string, tagName: String,
}; };
export type BasicProps = Partial<ExtractPropTypes<typeof basicProps>> & HTMLAttributes; export type BasicProps = Partial<ExtractPropTypes<typeof basicProps>> & HTMLAttributes;

View File

@ -9,7 +9,7 @@ import useConfigInject from '../_util/hooks/useConfigInject';
import { ListContextKey } from './contextKey'; import { ListContextKey } from './contextKey';
export const ListItemProps = { export const ListItemProps = {
prefixCls: PropTypes.string, prefixCls: String,
extra: PropTypes.any, extra: PropTypes.any,
actions: PropTypes.array, actions: PropTypes.array,
grid: PropTypes.any, grid: PropTypes.any,

View File

@ -6,7 +6,7 @@ import PropTypes from '../_util/vue-types';
export const listItemMetaProps = { export const listItemMetaProps = {
avatar: PropTypes.any, avatar: PropTypes.any,
description: PropTypes.any, description: PropTypes.any,
prefixCls: PropTypes.string, prefixCls: String,
title: PropTypes.any, title: PropTypes.any,
}; };

View File

@ -41,7 +41,7 @@ export type ListSize = 'small' | 'default' | 'large';
export type ListItemLayout = 'horizontal' | 'vertical'; export type ListItemLayout = 'horizontal' | 'vertical';
export const listProps = () => ({ export const listProps = () => ({
bordered: PropTypes.looseBool, bordered: { type: Boolean, default: undefined },
dataSource: PropTypes.array, dataSource: PropTypes.array,
extra: PropTypes.any, extra: PropTypes.any,
grid: { type: Object as PropType<ListGridType>, default: undefined as ListGridType }, grid: { type: Object as PropType<ListGridType>, default: undefined as ListGridType },
@ -59,7 +59,7 @@ export const listProps = () => ({
rowKey: [String, Number, Function] as PropType<Key | ((item: any) => Key)>, rowKey: [String, Number, Function] as PropType<Key | ((item: any) => Key)>,
renderItem: PropTypes.any, renderItem: PropTypes.any,
size: String as PropType<ListSize>, size: String as PropType<ListSize>,
split: PropTypes.looseBool, split: { type: Boolean, default: undefined },
header: PropTypes.any, header: PropTypes.any,
footer: PropTypes.any, footer: PropTypes.any,
locale: { locale: {

View File

@ -59,7 +59,7 @@ const LocaleProvider = defineComponent({
locale: { locale: {
type: Object as PropType<Locale>, type: Object as PropType<Locale>,
}, },
ANT_MARK__: PropTypes.string, ANT_MARK__: String,
}, },
setup(props, { slots }) { setup(props, { slots }) {
warning( warning(

View File

@ -60,7 +60,7 @@ const getMentions = (value = '', config: MentionsConfig = {}): MentionsEntity[]
export const mentionsProps = { export const mentionsProps = {
...baseMentionsProps, ...baseMentionsProps,
loading: PropTypes.looseBool, loading: { type: Boolean, default: undefined },
onFocus: { onFocus: {
type: Function as PropType<(e: FocusEvent) => void>, type: Function as PropType<(e: FocusEvent) => void>,
}, },

View File

@ -16,7 +16,7 @@ import useDestroyed from '../_util/hooks/useDestroyed';
export const pageHeaderProps = { export const pageHeaderProps = {
backIcon: PropTypes.any, backIcon: PropTypes.any,
prefixCls: PropTypes.string, prefixCls: String,
title: PropTypes.any, title: PropTypes.any,
subTitle: PropTypes.any, subTitle: PropTypes.any,
breadcrumb: PropTypes.object, breadcrumb: PropTypes.object,
@ -24,8 +24,8 @@ export const pageHeaderProps = {
footer: PropTypes.any, footer: PropTypes.any,
extra: PropTypes.any, extra: PropTypes.any,
avatar: PropTypes.object, avatar: PropTypes.object,
ghost: PropTypes.looseBool, ghost: { type: Boolean, default: undefined },
onBack: PropTypes.func, onBack: Function,
}; };
export type PageHeaderProps = Partial<ExtractPropTypes<typeof pageHeaderProps>>; export type PageHeaderProps = Partial<ExtractPropTypes<typeof pageHeaderProps>>;

View File

@ -24,7 +24,7 @@ import ActionButton from '../_util/ActionButton';
export const popconfirmProps = () => ({ export const popconfirmProps = () => ({
...abstractTooltipProps(), ...abstractTooltipProps(),
prefixCls: PropTypes.string, prefixCls: String,
content: PropTypes.any, content: PropTypes.any,
title: PropTypes.any, title: PropTypes.any,
okType: { okType: {

View File

@ -9,7 +9,7 @@ import { getSuccessPercent, validProgress } from './utils';
export const lineProps = { export const lineProps = {
...progressProps(), ...progressProps(),
prefixCls: PropTypes.string, prefixCls: String,
direction: { direction: {
type: String as PropType<Direction>, type: String as PropType<Direction>,
}, },

View File

@ -7,12 +7,12 @@ import { progressProps } from './props';
export const stepsProps = { export const stepsProps = {
...progressProps(), ...progressProps(),
steps: PropTypes.number, steps: Number,
size: { size: {
type: String as PropType<ProgressSize>, type: String as PropType<ProgressSize>,
}, },
strokeColor: PropTypes.string, strokeColor: String,
trailColor: PropTypes.string, trailColor: String,
}; };
export type StepsProps = Partial<ExtractPropTypes<typeof stepsProps>>; export type StepsProps = Partial<ExtractPropTypes<typeof stepsProps>>;

View File

@ -19,29 +19,29 @@ export interface SuccessProps {
} }
export const progressProps = () => ({ export const progressProps = () => ({
prefixCls: PropTypes.string, prefixCls: String,
type: PropTypes.oneOf(ProgressType), type: PropTypes.oneOf(ProgressType),
percent: PropTypes.number, percent: Number,
format: { type: Function as PropType<(percent?: number, successPercent?: number) => VueNode> }, format: { type: Function as PropType<(percent?: number, successPercent?: number) => VueNode> },
status: PropTypes.oneOf(progressStatuses), status: PropTypes.oneOf(progressStatuses),
showInfo: PropTypes.looseBool, showInfo: { type: Boolean, default: undefined },
strokeWidth: PropTypes.number, strokeWidth: Number,
strokeLinecap: PropTypes.oneOf(tuple('butt', 'round', 'square')), strokeLinecap: PropTypes.oneOf(tuple('butt', 'round', 'square')),
strokeColor: { strokeColor: {
type: [String, Object] as PropType<string | ProgressGradient>, type: [String, Object] as PropType<string | ProgressGradient>,
}, },
trailColor: PropTypes.string, trailColor: String,
width: PropTypes.number, width: Number,
success: { success: {
type: Object as PropType<SuccessProps>, type: Object as PropType<SuccessProps>,
default: (): SuccessProps => ({}), default: (): SuccessProps => ({}),
}, },
gapDegree: PropTypes.number, gapDegree: Number,
gapPosition: PropTypes.oneOf(tuple('top', 'bottom', 'left', 'right')), gapPosition: PropTypes.oneOf(tuple('top', 'bottom', 'left', 'right')),
size: PropTypes.oneOf(ProgressSize), size: PropTypes.oneOf(ProgressSize),
steps: PropTypes.number, steps: Number,
/** @deprecated Use `success` instead */ /** @deprecated Use `success` instead */
successPercent: PropTypes.number, successPercent: Number,
title: String, title: String,
}); });

View File

@ -23,16 +23,16 @@ export type RadioGroupChildOption = {
}; };
export const radioGroupProps = { export const radioGroupProps = {
prefixCls: PropTypes.string, prefixCls: String,
value: PropTypes.any, value: PropTypes.any,
size: PropTypes.oneOf(RadioGroupSizeTypes).def('default'), size: PropTypes.oneOf(RadioGroupSizeTypes).def('default'),
options: { options: {
type: Array as PropType<Array<string | RadioGroupChildOption | number>>, type: Array as PropType<Array<string | RadioGroupChildOption | number>>,
}, },
disabled: PropTypes.looseBool, disabled: { type: Boolean, default: undefined },
name: PropTypes.string, name: String,
buttonStyle: PropTypes.string.def('outline'), buttonStyle: PropTypes.string.def('outline'),
id: PropTypes.string, id: String,
optionType: PropTypes.oneOf(RadioGroupOptionTypes).def('default'), optionType: PropTypes.oneOf(RadioGroupOptionTypes).def('default'),
}; };

View File

@ -8,18 +8,18 @@ import type { RadioChangeEvent, RadioGroupContext } from './interface';
import { useInjectFormItemContext } from '../form/FormItemContext'; import { useInjectFormItemContext } from '../form/FormItemContext';
export const radioProps = { export const radioProps = {
prefixCls: PropTypes.string, prefixCls: String,
checked: PropTypes.looseBool, checked: { type: Boolean, default: undefined },
disabled: PropTypes.looseBool, disabled: { type: Boolean, default: undefined },
isGroup: PropTypes.looseBool, isGroup: { type: Boolean, default: undefined },
value: PropTypes.any, value: PropTypes.any,
name: PropTypes.string, name: String,
id: PropTypes.string, id: String,
autofocus: PropTypes.looseBool, autofocus: { type: Boolean, default: undefined },
onChange: PropTypes.func, onChange: Function,
onFocus: PropTypes.func, onFocus: Function,
onBlur: PropTypes.func, onBlur: Function,
onClick: PropTypes.func, onClick: Function,
}; };
export type RadioProps = Partial<ExtractPropTypes<typeof radioProps>>; export type RadioProps = Partial<ExtractPropTypes<typeof radioProps>>;

View File

@ -4,17 +4,17 @@ import { getPropsSlot } from '../_util/props-util';
import PropTypes from '../_util/vue-types'; import PropTypes from '../_util/vue-types';
export const starProps = { export const starProps = {
value: PropTypes.number, value: Number,
index: PropTypes.number, index: Number,
prefixCls: PropTypes.string, prefixCls: String,
allowHalf: PropTypes.looseBool, allowHalf: { type: Boolean, default: undefined },
disabled: PropTypes.looseBool, disabled: { type: Boolean, default: undefined },
character: PropTypes.any, character: PropTypes.any,
characterRender: PropTypes.func, characterRender: Function,
focused: PropTypes.looseBool, focused: { type: Boolean, default: undefined },
count: PropTypes.number, count: Number,
onClick: PropTypes.func, onClick: Function,
onHover: PropTypes.func, onHover: Function,
}; };
export type StarProps = Partial<ExtractPropTypes<typeof starProps>>; export type StarProps = Partial<ExtractPropTypes<typeof starProps>>;

View File

@ -15,18 +15,18 @@ import useRefs from '../_util/hooks/useRefs';
import { useInjectFormItemContext } from '../form/FormItemContext'; import { useInjectFormItemContext } from '../form/FormItemContext';
export const rateProps = { export const rateProps = {
prefixCls: PropTypes.string, prefixCls: String,
count: PropTypes.number, count: Number,
value: PropTypes.number, value: Number,
allowHalf: PropTypes.looseBool, allowHalf: { type: Boolean, default: undefined },
allowClear: PropTypes.looseBool, allowClear: { type: Boolean, default: undefined },
tooltips: PropTypes.arrayOf(PropTypes.string), tooltips: PropTypes.arrayOf(PropTypes.string),
disabled: PropTypes.looseBool, disabled: { type: Boolean, default: undefined },
character: PropTypes.any, character: PropTypes.any,
autofocus: PropTypes.looseBool, autofocus: { type: Boolean, default: undefined },
tabindex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), tabindex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
direction: PropTypes.string, direction: String,
id: PropTypes.string, id: String,
}; };
export type RateProps = Partial<ExtractPropTypes<typeof rateProps>>; export type RateProps = Partial<ExtractPropTypes<typeof rateProps>>;

View File

@ -29,7 +29,7 @@ export const ExceptionMap = {
const ExceptionStatus = Object.keys(ExceptionMap); const ExceptionStatus = Object.keys(ExceptionMap);
export const resultProps = { export const resultProps = {
prefixCls: PropTypes.string, prefixCls: String,
icon: PropTypes.any, icon: PropTypes.any,
status: PropTypes.oneOf(tuple('success', 'error', 'info', 'warning', '404', '403', '500')).def( status: PropTypes.oneOf(tuple('success', 'error', 'info', 'warning', '404', '403', '500')).def(
'info', 'info',

View File

@ -15,13 +15,13 @@ const spaceSize = {
large: 24, large: 24,
}; };
export const spaceProps = { export const spaceProps = {
prefixCls: PropTypes.string, prefixCls: String,
size: { size: {
type: [String, Number, Array] as PropType<SpaceSize | [SpaceSize, SpaceSize]>, type: [String, Number, Array] as PropType<SpaceSize | [SpaceSize, SpaceSize]>,
}, },
direction: PropTypes.oneOf(tuple('horizontal', 'vertical')).def('horizontal'), direction: PropTypes.oneOf(tuple('horizontal', 'vertical')).def('horizontal'),
align: PropTypes.oneOf(tuple('start', 'end', 'center', 'baseline')), align: PropTypes.oneOf(tuple('start', 'end', 'center', 'baseline')),
wrap: PropTypes.looseBool, wrap: { type: Boolean, default: undefined },
}; };
export type SpaceProps = Partial<ExtractPropTypes<typeof spaceProps>>; export type SpaceProps = Partial<ExtractPropTypes<typeof spaceProps>>;

View File

@ -11,12 +11,12 @@ import { defaultConfigProvider } from '../config-provider';
export const SpinSize = PropTypes.oneOf(tuple('small', 'default', 'large')); export const SpinSize = PropTypes.oneOf(tuple('small', 'default', 'large'));
export const spinProps = () => ({ export const spinProps = () => ({
prefixCls: PropTypes.string, prefixCls: String,
spinning: PropTypes.looseBool, spinning: { type: Boolean, default: undefined },
size: SpinSize, size: SpinSize,
wrapperClassName: PropTypes.string, wrapperClassName: String,
tip: PropTypes.any, tip: PropTypes.any,
delay: PropTypes.number, delay: Number,
indicator: PropTypes.any, indicator: PropTypes.any,
}); });

View File

@ -8,22 +8,22 @@ import Skeleton from '../skeleton/Skeleton';
import useConfigInject from '../_util/hooks/useConfigInject'; import useConfigInject from '../_util/hooks/useConfigInject';
export const statisticProps = { export const statisticProps = {
prefixCls: PropTypes.string, prefixCls: String,
decimalSeparator: PropTypes.string, decimalSeparator: String,
groupSeparator: PropTypes.string, groupSeparator: String,
format: PropTypes.string, format: String,
value: { value: {
type: [String, Number, Object] as PropType<countdownValueType>, type: [String, Number, Object] as PropType<countdownValueType>,
}, },
valueStyle: PropTypes.style, valueStyle: PropTypes.style,
valueRender: PropTypes.any, valueRender: PropTypes.any,
formatter: PropTypes.any, formatter: PropTypes.any,
precision: PropTypes.number, precision: Number,
prefix: PropTypes.any, prefix: PropTypes.any,
suffix: PropTypes.any, suffix: PropTypes.any,
title: PropTypes.any, title: PropTypes.any,
onFinish: PropTypes.func, onFinish: Function,
loading: PropTypes.looseBool, loading: { type: Boolean, default: undefined },
}; };
export type StatisticProps = Partial<ExtractPropTypes<typeof statisticProps>>; export type StatisticProps = Partial<ExtractPropTypes<typeof statisticProps>>;

View File

@ -14,15 +14,15 @@ import omit from '../_util/omit';
export const SwitchSizes = tuple('small', 'default'); export const SwitchSizes = tuple('small', 'default');
type CheckedType = boolean | string | number; type CheckedType = boolean | string | number;
export const switchProps = { export const switchProps = {
id: PropTypes.string, id: String,
prefixCls: PropTypes.string, prefixCls: String,
size: PropTypes.oneOf(SwitchSizes), size: PropTypes.oneOf(SwitchSizes),
disabled: PropTypes.looseBool, disabled: { type: Boolean, default: undefined },
checkedChildren: PropTypes.any, checkedChildren: PropTypes.any,
unCheckedChildren: PropTypes.any, unCheckedChildren: PropTypes.any,
tabindex: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), tabindex: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
autofocus: PropTypes.looseBool, autofocus: { type: Boolean, default: undefined },
loading: PropTypes.looseBool, loading: { type: Boolean, default: undefined },
checked: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.looseBool]), checked: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.looseBool]),
checkedValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.looseBool]).def( checkedValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.looseBool]).def(
true, true,

View File

@ -7,8 +7,8 @@ import useConfigInject from '../_util/hooks/useConfigInject';
const CheckableTag = defineComponent({ const CheckableTag = defineComponent({
name: 'ACheckableTag', name: 'ACheckableTag',
props: { props: {
prefixCls: PropTypes.string, prefixCls: String,
checked: PropTypes.looseBool, checked: { type: Boolean, default: undefined },
onChange: { onChange: {
type: Function as PropType<(checked: boolean) => void>, type: Function as PropType<(checked: boolean) => void>,
}, },

View File

@ -14,13 +14,13 @@ const PresetColorRegex = new RegExp(`^(${PresetColorTypes.join('|')})(-inverse)?
const PresetStatusColorRegex = new RegExp(`^(${PresetStatusColorTypes.join('|')})$`); const PresetStatusColorRegex = new RegExp(`^(${PresetStatusColorTypes.join('|')})$`);
export const tagProps = { export const tagProps = {
prefixCls: PropTypes.string, prefixCls: String,
color: { color: {
type: String as PropType<LiteralUnion<PresetColorType | PresetStatusColorType, string>>, type: String as PropType<LiteralUnion<PresetColorType | PresetStatusColorType, string>>,
}, },
closable: PropTypes.looseBool.def(false), closable: PropTypes.looseBool.def(false),
closeIcon: PropTypes.any, closeIcon: PropTypes.any,
visible: PropTypes.looseBool, visible: { type: Boolean, default: undefined },
onClose: { onClose: {
type: Function as PropType<(e: MouseEvent) => void>, type: Function as PropType<(e: MouseEvent) => void>,
}, },

View File

@ -10,11 +10,11 @@ import { tuple } from '../_util/type';
import useConfigInject from '../_util/hooks/useConfigInject'; import useConfigInject from '../_util/hooks/useConfigInject';
export const timelineProps = () => ({ export const timelineProps = () => ({
prefixCls: PropTypes.string, prefixCls: String,
/** 指定最后一个幽灵节点是否存在或内容 */ /** 指定最后一个幽灵节点是否存在或内容 */
pending: PropTypes.any, pending: PropTypes.any,
pendingDot: PropTypes.any, pendingDot: PropTypes.any,
reverse: PropTypes.looseBool, reverse: { type: Boolean, default: undefined },
mode: PropTypes.oneOf(tuple('left', 'alternate', 'right', '')), mode: PropTypes.oneOf(tuple('left', 'alternate', 'right', '')),
}); });

View File

@ -7,10 +7,10 @@ import { tuple } from '../_util/type';
import useConfigInject from '../_util/hooks/useConfigInject'; import useConfigInject from '../_util/hooks/useConfigInject';
export const timelineItemProps = () => ({ export const timelineItemProps = () => ({
prefixCls: PropTypes.string, prefixCls: String,
color: PropTypes.string, color: String,
dot: PropTypes.any, dot: PropTypes.any,
pending: PropTypes.looseBool, pending: { type: Boolean, default: undefined },
position: PropTypes.oneOf(tuple('left', 'right', '')).def(''), position: PropTypes.oneOf(tuple('left', 'right', '')).def(''),
label: PropTypes.any, label: PropTypes.any,
}); });

View File

@ -22,24 +22,24 @@ export default () => ({
PropTypes.oneOf(triggerTypes), PropTypes.oneOf(triggerTypes),
PropTypes.arrayOf(PropTypes.oneOf(triggerTypes)), PropTypes.arrayOf(PropTypes.oneOf(triggerTypes)),
]), ]),
visible: PropTypes.looseBool, visible: { type: Boolean, default: undefined },
defaultVisible: PropTypes.looseBool, defaultVisible: { type: Boolean, default: undefined },
placement: PropTypes.oneOf(placementTypes), placement: PropTypes.oneOf(placementTypes),
color: PropTypes.string, color: String,
transitionName: PropTypes.string, transitionName: String,
overlayStyle: PropTypes.style, overlayStyle: PropTypes.style,
overlayClassName: PropTypes.string, overlayClassName: String,
openClassName: PropTypes.string, openClassName: String,
prefixCls: PropTypes.string, prefixCls: String,
mouseEnterDelay: PropTypes.number, mouseEnterDelay: Number,
mouseLeaveDelay: PropTypes.number, mouseLeaveDelay: Number,
getPopupContainer: PropTypes.func, getPopupContainer: Function,
arrowPointAtCenter: PropTypes.looseBool, arrowPointAtCenter: { type: Boolean, default: undefined },
autoAdjustOverflow: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object]), autoAdjustOverflow: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object]),
destroyTooltipOnHide: PropTypes.looseBool, destroyTooltipOnHide: { type: Boolean, default: undefined },
align: PropTypes.object, align: PropTypes.object,
builtinPlacements: PropTypes.object, builtinPlacements: PropTypes.object,
children: PropTypes.array, children: PropTypes.array,
onVisibleChange: PropTypes.func, onVisibleChange: Function,
'onUpdate:visible': PropTypes.func, 'onUpdate:visible': Function,
}); });

View File

@ -7,15 +7,15 @@ import PropTypes from '../_util/vue-types';
import type { TransferItem } from '.'; import type { TransferItem } from '.';
export const transferListBodyProps = { export const transferListBodyProps = {
prefixCls: PropTypes.string, prefixCls: String,
filteredRenderItems: PropTypes.array.def([]), filteredRenderItems: PropTypes.array.def([]),
selectedKeys: PropTypes.array, selectedKeys: PropTypes.array,
disabled: PropTypes.looseBool, disabled: { type: Boolean, default: undefined },
showRemove: PropTypes.looseBool, showRemove: { type: Boolean, default: undefined },
pagination: PropTypes.any, pagination: PropTypes.any,
onItemSelect: PropTypes.func, onItemSelect: Function,
onScroll: PropTypes.func, onScroll: Function,
onItemRemove: PropTypes.func, onItemRemove: Function,
}; };
export type TransferListBodyProps = Partial<ExtractPropTypes<typeof transferListBodyProps>>; export type TransferListBodyProps = Partial<ExtractPropTypes<typeof transferListBodyProps>>;

View File

@ -15,12 +15,12 @@ export const transferListItemProps = {
renderedText: PropTypes.any, renderedText: PropTypes.any,
renderedEl: PropTypes.any, renderedEl: PropTypes.any,
item: PropTypes.any, item: PropTypes.any,
checked: PropTypes.looseBool, checked: { type: Boolean, default: undefined },
prefixCls: PropTypes.string, prefixCls: String,
disabled: PropTypes.looseBool, disabled: { type: Boolean, default: undefined },
showRemove: PropTypes.looseBool, showRemove: { type: Boolean, default: undefined },
onClick: PropTypes.func, onClick: Function,
onRemove: PropTypes.func, onRemove: Function,
}; };
export type TransferListItemProps = Partial<ExtractPropTypes<typeof transferListItemProps>>; export type TransferListItemProps = Partial<ExtractPropTypes<typeof transferListItemProps>>;

View File

@ -27,36 +27,36 @@ function getEnabledItemKeys<RecordType extends TransferItem>(items: RecordType[]
} }
export const transferListProps = { export const transferListProps = {
prefixCls: PropTypes.string, prefixCls: String,
dataSource: { type: Array as PropType<TransferItem[]>, default: [] }, dataSource: { type: Array as PropType<TransferItem[]>, default: [] },
filter: PropTypes.string, filter: String,
filterOption: PropTypes.func, filterOption: Function,
checkedKeys: PropTypes.arrayOf(PropTypes.string), checkedKeys: PropTypes.arrayOf(PropTypes.string),
handleFilter: PropTypes.func, handleFilter: Function,
handleClear: PropTypes.func, handleClear: Function,
renderItem: PropTypes.func, renderItem: Function,
showSearch: PropTypes.looseBool.def(false), showSearch: PropTypes.looseBool.def(false),
searchPlaceholder: PropTypes.string, searchPlaceholder: String,
notFoundContent: PropTypes.any, notFoundContent: PropTypes.any,
itemUnit: PropTypes.string, itemUnit: String,
itemsUnit: PropTypes.string, itemsUnit: String,
renderList: PropTypes.any, renderList: PropTypes.any,
disabled: PropTypes.looseBool, disabled: { type: Boolean, default: undefined },
direction: String as PropType<TransferDirection>, direction: String as PropType<TransferDirection>,
showSelectAll: PropTypes.looseBool, showSelectAll: { type: Boolean, default: undefined },
remove: PropTypes.string, remove: String,
selectAll: PropTypes.string, selectAll: String,
selectCurrent: PropTypes.string, selectCurrent: String,
selectInvert: PropTypes.string, selectInvert: String,
removeAll: PropTypes.string, removeAll: String,
removeCurrent: PropTypes.string, removeCurrent: String,
selectAllLabel: PropTypes.any, selectAllLabel: PropTypes.any,
showRemove: PropTypes.looseBool, showRemove: { type: Boolean, default: undefined },
pagination: PropTypes.any, pagination: PropTypes.any,
onItemSelect: PropTypes.func, onItemSelect: Function,
onItemSelectAll: PropTypes.func, onItemSelectAll: Function,
onItemRemove: PropTypes.func, onItemRemove: Function,
onScroll: PropTypes.func, onScroll: Function,
}; };
export type TransferListProps = Partial<ExtractPropTypes<typeof transferListProps>>; export type TransferListProps = Partial<ExtractPropTypes<typeof transferListProps>>;

View File

@ -7,12 +7,12 @@ import { defineComponent } from 'vue';
import type { ChangeEvent } from '../_util/EventInterface'; import type { ChangeEvent } from '../_util/EventInterface';
export const transferSearchProps = { export const transferSearchProps = {
prefixCls: PropTypes.string, prefixCls: String,
placeholder: PropTypes.string, placeholder: String,
value: PropTypes.string, value: String,
handleClear: PropTypes.func, handleClear: Function,
disabled: PropTypes.looseBool, disabled: { type: Boolean, default: undefined },
onChange: PropTypes.func, onChange: Function,
}; };
export type TransferSearchProps = Partial<ExtractPropTypes<typeof transferSearchProps>>; export type TransferSearchProps = Partial<ExtractPropTypes<typeof transferSearchProps>>;

View File

@ -120,7 +120,7 @@ export const treeProps = () => {
showIcon: { type: Boolean, default: undefined }, showIcon: { type: Boolean, default: undefined },
icon: { type: Function as PropType<(nodeProps: AntdTreeNodeAttribute) => any> }, icon: { type: Function as PropType<(nodeProps: AntdTreeNodeAttribute) => any> },
switcherIcon: PropTypes.any, switcherIcon: PropTypes.any,
prefixCls: PropTypes.string, prefixCls: String,
/** /**
* @default{title,key,children} * @default{title,key,children}
* deprecated, please use `fieldNames` instead * deprecated, please use `fieldNames` instead

View File

@ -577,18 +577,18 @@ const Base = defineComponent<InternalBlockProps>({
export const baseProps = () => ({ export const baseProps = () => ({
editable: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object]), editable: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object]),
copyable: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object]), copyable: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object]),
prefixCls: PropTypes.string, prefixCls: String,
component: PropTypes.string, component: String,
type: PropTypes.oneOf(['secondary', 'success', 'danger', 'warning']), type: PropTypes.oneOf(['secondary', 'success', 'danger', 'warning']),
disabled: PropTypes.looseBool, disabled: { type: Boolean, default: undefined },
ellipsis: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object]), ellipsis: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object]),
code: PropTypes.looseBool, code: { type: Boolean, default: undefined },
mark: PropTypes.looseBool, mark: { type: Boolean, default: undefined },
underline: PropTypes.looseBool, underline: { type: Boolean, default: undefined },
delete: PropTypes.looseBool, delete: { type: Boolean, default: undefined },
strong: PropTypes.looseBool, strong: { type: Boolean, default: undefined },
keyboard: PropTypes.looseBool, keyboard: { type: Boolean, default: undefined },
content: PropTypes.string, content: String,
}); });
Base.props = baseProps(); Base.props = baseProps();

View File

@ -9,15 +9,15 @@ import type { Direction } from '../config-provider';
const Editable = defineComponent({ const Editable = defineComponent({
name: 'Editable', name: 'Editable',
props: { props: {
prefixCls: PropTypes.string, prefixCls: String,
value: PropTypes.string, value: String,
maxlength: PropTypes.number, maxlength: Number,
autoSize: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object]), autoSize: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object]),
onSave: PropTypes.func, onSave: Function,
onCancel: PropTypes.func, onCancel: Function,
onEnd: PropTypes.func, onEnd: Function,
onChange: PropTypes.func, onChange: Function,
originContent: PropTypes.string, originContent: String,
direction: String as PropType<Direction>, direction: String as PropType<Direction>,
}, },
emits: ['save', 'cancel', 'end', 'change'], emits: ['save', 'cancel', 'end', 'change'],

View File

@ -44,8 +44,8 @@ const Typography = defineComponent<InternalTypographyProps>({
}); });
Typography.props = { Typography.props = {
prefixCls: PropTypes.string, prefixCls: String,
component: PropTypes.string, component: String,
}; };
export default Typography; export default Typography;

View File

@ -4,14 +4,14 @@ import getDialogPropTypes from './IDialogPropTypes';
import Portal from '../_util/PortalWrapper'; import Portal from '../_util/PortalWrapper';
import { defineComponent, ref, watch } from 'vue'; import { defineComponent, ref, watch } from 'vue';
import { useProvidePortal } from '../vc-trigger/context'; import { useProvidePortal } from '../vc-trigger/context';
import { initDefaultProps } from '../_util/props-util';
const IDialogPropTypes = getDialogPropTypes(); const IDialogPropTypes = getDialogPropTypes();
const DialogWrap = defineComponent({ const DialogWrap = defineComponent({
name: 'DialogWrap', name: 'DialogWrap',
inheritAttrs: false, inheritAttrs: false,
props: { props: initDefaultProps(IDialogPropTypes, {
...IDialogPropTypes, visible: false,
visible: IDialogPropTypes.visible.def(false), }),
},
setup(props, { attrs, slots }) { setup(props, { attrs, slots }) {
const animatedVisible = ref(props.visible); const animatedVisible = ref(props.visible);
useProvidePortal({}, { inTriggerContext: false }); useProvidePortal({}, { inTriggerContext: false });

View File

@ -3,45 +3,45 @@ import PropTypes from '../_util/vue-types';
function dialogPropTypes() { function dialogPropTypes() {
return { return {
keyboard: PropTypes.looseBool, keyboard: { type: Boolean, default: undefined },
mask: PropTypes.looseBool, mask: { type: Boolean, default: undefined },
afterClose: PropTypes.func, afterClose: Function,
closable: PropTypes.looseBool, closable: { type: Boolean, default: undefined },
maskClosable: PropTypes.looseBool, maskClosable: { type: Boolean, default: undefined },
visible: PropTypes.looseBool, visible: { type: Boolean, default: undefined },
destroyOnClose: PropTypes.looseBool, destroyOnClose: { type: Boolean, default: undefined },
mousePosition: PropTypes.shape({ mousePosition: PropTypes.shape({
x: PropTypes.number, x: Number,
y: PropTypes.number, y: Number,
}).loose, }).loose,
title: PropTypes.any, title: PropTypes.any,
footer: PropTypes.any, footer: PropTypes.any,
transitionName: PropTypes.string, transitionName: String,
maskTransitionName: PropTypes.string, maskTransitionName: String,
animation: PropTypes.any, animation: PropTypes.any,
maskAnimation: PropTypes.any, maskAnimation: PropTypes.any,
wrapStyle: PropTypes.object, wrapStyle: PropTypes.object,
bodyStyle: PropTypes.object, bodyStyle: PropTypes.object,
maskStyle: PropTypes.object, maskStyle: PropTypes.object,
prefixCls: PropTypes.string, prefixCls: String,
wrapClassName: PropTypes.string, wrapClassName: String,
width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
zIndex: PropTypes.number, zIndex: Number,
bodyProps: PropTypes.any, bodyProps: PropTypes.any,
maskProps: PropTypes.any, maskProps: PropTypes.any,
wrapProps: PropTypes.any, wrapProps: PropTypes.any,
getContainer: PropTypes.any, getContainer: PropTypes.any,
dialogStyle: PropTypes.object, dialogStyle: PropTypes.object,
dialogClass: PropTypes.string, dialogClass: String,
closeIcon: PropTypes.any, closeIcon: PropTypes.any,
forceRender: PropTypes.looseBool, forceRender: { type: Boolean, default: undefined },
getOpenCount: PropTypes.func, getOpenCount: Function,
// https://github.com/ant-design/ant-design/issues/19771 // https://github.com/ant-design/ant-design/issues/19771
// https://github.com/react-component/dialog/issues/95 // https://github.com/react-component/dialog/issues/95
focusTriggerAfterClose: PropTypes.looseBool, focusTriggerAfterClose: { type: Boolean, default: undefined },
onClose: PropTypes.func, onClose: Function,
modalRender: PropTypes.func, modalRender: Function,
}; };
} }
export type IDialogChildProps = Partial<ExtractPropTypes<ReturnType<typeof dialogPropTypes>>>; export type IDialogChildProps = Partial<ExtractPropTypes<ReturnType<typeof dialogPropTypes>>>;

View File

@ -4,36 +4,36 @@ import type { PropType } from 'vue';
export type IPlacement = 'left' | 'top' | 'right' | 'bottom'; export type IPlacement = 'left' | 'top' | 'right' | 'bottom';
type ILevelMove = number | [number, number]; type ILevelMove = number | [number, number];
const props = () => ({ const props = () => ({
prefixCls: PropTypes.string, prefixCls: String,
width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
style: PropTypes.style, style: PropTypes.style,
class: PropTypes.string, class: String,
placement: { placement: {
type: String as PropType<IPlacement>, type: String as PropType<IPlacement>,
}, },
wrapperClassName: PropTypes.string, wrapperClassName: String,
level: { type: [String, Array] as PropType<string | string[]> }, level: { type: [String, Array] as PropType<string | string[]> },
levelMove: { levelMove: {
type: [Number, Function, Array] as PropType< type: [Number, Function, Array] as PropType<
ILevelMove | ((e: { target: HTMLElement; open: boolean }) => ILevelMove) ILevelMove | ((e: { target: HTMLElement; open: boolean }) => ILevelMove)
>, >,
}, },
duration: PropTypes.string, duration: String,
ease: PropTypes.string, ease: String,
showMask: PropTypes.looseBool, showMask: { type: Boolean, default: undefined },
maskClosable: PropTypes.looseBool, maskClosable: { type: Boolean, default: undefined },
maskStyle: PropTypes.style, maskStyle: PropTypes.style,
afterVisibleChange: PropTypes.func, afterVisibleChange: Function,
keyboard: PropTypes.looseBool, keyboard: { type: Boolean, default: undefined },
contentWrapperStyle: PropTypes.style, contentWrapperStyle: PropTypes.style,
autofocus: PropTypes.looseBool, autofocus: { type: Boolean, default: undefined },
open: PropTypes.looseBool, open: { type: Boolean, default: undefined },
}); });
const drawerProps = () => ({ const drawerProps = () => ({
...props(), ...props(),
forceRender: PropTypes.looseBool, forceRender: { type: Boolean, default: undefined },
getContainer: PropTypes.oneOfType([ getContainer: PropTypes.oneOfType([
PropTypes.string, PropTypes.string,
PropTypes.func, PropTypes.func,
@ -44,10 +44,10 @@ const drawerProps = () => ({
const drawerChildProps = () => ({ const drawerChildProps = () => ({
...props(), ...props(),
getContainer: PropTypes.func, getContainer: Function,
getOpenCount: PropTypes.func, getOpenCount: Function,
scrollLocker: PropTypes.any, scrollLocker: PropTypes.any,
switchScrollingEffect: PropTypes.func, switchScrollingEffect: Function,
}); });
export { drawerProps, drawerChildProps }; export { drawerProps, drawerChildProps };

View File

@ -7,12 +7,12 @@ import classNames from '../_util/classNames';
export default defineComponent({ export default defineComponent({
props: { props: {
minOverlayWidthMatchTrigger: PropTypes.looseBool, minOverlayWidthMatchTrigger: { type: Boolean, default: undefined },
arrow: PropTypes.looseBool.def(false), arrow: PropTypes.looseBool.def(false),
prefixCls: PropTypes.string.def('rc-dropdown'), prefixCls: PropTypes.string.def('rc-dropdown'),
transitionName: PropTypes.string, transitionName: String,
overlayClassName: PropTypes.string.def(''), overlayClassName: PropTypes.string.def(''),
openClassName: PropTypes.string, openClassName: String,
animation: PropTypes.any, animation: PropTypes.any,
align: PropTypes.object, align: PropTypes.object,
overlayStyle: PropTypes.style, overlayStyle: PropTypes.style,
@ -21,11 +21,11 @@ export default defineComponent({
trigger: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]).def( trigger: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]).def(
'hover', 'hover',
), ),
alignPoint: PropTypes.looseBool, alignPoint: { type: Boolean, default: undefined },
showAction: PropTypes.array, showAction: PropTypes.array,
hideAction: PropTypes.array, hideAction: PropTypes.array,
getPopupContainer: PropTypes.func, getPopupContainer: Function,
visible: PropTypes.looseBool, visible: { type: Boolean, default: undefined },
defaultVisible: PropTypes.looseBool.def(false), defaultVisible: PropTypes.looseBool.def(false),
mouseEnterDelay: PropTypes.number.def(0.15), mouseEnterDelay: PropTypes.number.def(0.15),
mouseLeaveDelay: PropTypes.number.def(0.1), mouseLeaveDelay: PropTypes.number.def(0.1),

View File

@ -33,8 +33,8 @@ const initialPosition = {
y: 0, y: 0,
}; };
const PreviewType = { const PreviewType = {
src: PropTypes.string, src: String,
alt: PropTypes.string, alt: String,
...IDialogPropTypes, ...IDialogPropTypes,
}; };
const Preview = defineComponent({ const Preview = defineComponent({

View File

@ -43,17 +43,17 @@ const BUILT_IN_PLACEMENTS = {
export default defineComponent({ export default defineComponent({
name: 'KeywordTrigger', name: 'KeywordTrigger',
props: { props: {
loading: PropTypes.looseBool, loading: { type: Boolean, default: undefined },
options: { options: {
type: Array as PropType<OptionProps[]>, type: Array as PropType<OptionProps[]>,
default: () => [], default: () => [],
}, },
prefixCls: PropTypes.string, prefixCls: String,
placement: PropTypes.string, placement: String,
visible: PropTypes.looseBool, visible: { type: Boolean, default: undefined },
transitionName: PropTypes.string, transitionName: String,
getPopupContainer: PropTypes.func, getPopupContainer: Function,
direction: PropTypes.string, direction: String,
}, },
slots: ['notFoundContent', 'option'], slots: ['notFoundContent', 'option'],
setup(props, { slots }) { setup(props, { slots }) {

View File

@ -12,20 +12,20 @@ export const PlaceMent = tuple('top', 'bottom');
export type Direction = 'ltr' | 'rtl'; export type Direction = 'ltr' | 'rtl';
export const mentionsProps = { export const mentionsProps = {
autofocus: PropTypes.looseBool, autofocus: { type: Boolean, default: undefined },
prefix: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]), prefix: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),
prefixCls: PropTypes.string, prefixCls: String,
value: PropTypes.string, value: String,
disabled: PropTypes.looseBool, disabled: { type: Boolean, default: undefined },
split: PropTypes.string, split: String,
transitionName: PropTypes.string, transitionName: String,
placement: PropTypes.oneOf(PlaceMent), placement: PropTypes.oneOf(PlaceMent),
character: PropTypes.any, character: PropTypes.any,
characterRender: PropTypes.func, characterRender: Function,
filterOption: { filterOption: {
type: [Boolean, Function] as PropType<typeof defaultFilterOption | false>, type: [Boolean, Function] as PropType<typeof defaultFilterOption | false>,
}, },
validateSearch: PropTypes.func, validateSearch: Function,
getPopupContainer: { getPopupContainer: {
type: Function as PropType<() => HTMLElement>, type: Function as PropType<() => HTMLElement>,
}, },
@ -33,7 +33,7 @@ export const mentionsProps = {
type: Array as PropType<OptionProps>, type: Array as PropType<OptionProps>,
default: () => undefined, default: () => undefined,
}, },
loading: PropTypes.looseBool, loading: { type: Boolean, default: undefined },
rows: [Number, String], rows: [Number, String],
direction: { type: String as PropType<Direction> }, direction: { type: String as PropType<Direction> },
}; };

View File

@ -6,17 +6,17 @@ import type { EventHandler } from '../_util/EventInterface';
export default defineComponent({ export default defineComponent({
props: { props: {
disabled: PropTypes.looseBool, disabled: { type: Boolean, default: undefined },
changeSize: PropTypes.func, changeSize: Function,
quickGo: PropTypes.func, quickGo: Function,
selectComponentClass: PropTypes.any, selectComponentClass: PropTypes.any,
current: PropTypes.number, current: Number,
pageSizeOptions: PropTypes.array.def(['10', '20', '50', '100']), pageSizeOptions: PropTypes.array.def(['10', '20', '50', '100']),
pageSize: PropTypes.number, pageSize: Number,
buildOptionText: PropTypes.func, buildOptionText: Function,
locale: PropTypes.object, locale: PropTypes.object,
rootPrefixCls: PropTypes.string, rootPrefixCls: String,
selectPrefixCls: PropTypes.string, selectPrefixCls: String,
goButton: PropTypes.any, goButton: PropTypes.any,
}, },
setup(props) { setup(props) {

View File

@ -6,12 +6,12 @@ export default defineComponent({
name: 'Pager', name: 'Pager',
inheritAttrs: false, inheritAttrs: false,
props: { props: {
rootPrefixCls: PropTypes.string, rootPrefixCls: String,
page: PropTypes.number, page: Number,
active: PropTypes.looseBool, active: { type: Boolean, default: undefined },
last: PropTypes.looseBool, last: { type: Boolean, default: undefined },
locale: PropTypes.object, locale: PropTypes.object,
showTitle: PropTypes.looseBool, showTitle: { type: Boolean, default: undefined },
itemRender: { itemRender: {
type: Function, type: Function,
default: () => {}, default: () => {},

View File

@ -30,16 +30,16 @@ export default defineComponent({
mixins: [BaseMixin], mixins: [BaseMixin],
inheritAttrs: false, inheritAttrs: false,
props: { props: {
disabled: PropTypes.looseBool, disabled: { type: Boolean, default: undefined },
prefixCls: PropTypes.string.def('rc-pagination'), prefixCls: PropTypes.string.def('rc-pagination'),
selectPrefixCls: PropTypes.string.def('rc-select'), selectPrefixCls: PropTypes.string.def('rc-select'),
current: PropTypes.number, current: Number,
defaultCurrent: PropTypes.number.def(1), defaultCurrent: PropTypes.number.def(1),
total: PropTypes.number.def(0), total: PropTypes.number.def(0),
pageSize: PropTypes.number, pageSize: Number,
defaultPageSize: PropTypes.number.def(10), defaultPageSize: PropTypes.number.def(10),
hideOnSinglePage: PropTypes.looseBool.def(false), hideOnSinglePage: PropTypes.looseBool.def(false),
showSizeChanger: PropTypes.looseBool, showSizeChanger: { type: Boolean, default: undefined },
showLessItems: PropTypes.looseBool.def(false), showLessItems: PropTypes.looseBool.def(false),
// showSizeChange: PropTypes.func.def(noop), // showSizeChange: PropTypes.func.def(noop),
selectComponentClass: PropTypes.any, selectComponentClass: PropTypes.any,
@ -47,9 +47,9 @@ export default defineComponent({
showQuickJumper: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object]).def(false), showQuickJumper: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object]).def(false),
showTitle: PropTypes.looseBool.def(true), showTitle: PropTypes.looseBool.def(true),
pageSizeOptions: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), pageSizeOptions: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),
buildOptionText: PropTypes.func, buildOptionText: Function,
showTotal: PropTypes.func, showTotal: Function,
simple: PropTypes.looseBool, simple: { type: Boolean, default: undefined },
locale: PropTypes.object.def(LOCALE), locale: PropTypes.object.def(LOCALE),
itemRender: PropTypes.func.def(defaultItemRender), itemRender: PropTypes.func.def(defaultItemRender),
prevIcon: PropTypes.any, prevIcon: PropTypes.any,

View File

@ -8,24 +8,24 @@ export type GapPositionType = 'top' | 'right' | 'bottom' | 'left';
export type StrokeLinecapType = 'round' | 'butt' | 'square'; export type StrokeLinecapType = 'round' | 'butt' | 'square';
export const propTypes = { export const propTypes = {
gapDegree: PropTypes.number, gapDegree: Number,
gapPosition: { gapPosition: {
type: String as PropType<GapPositionType>, type: String as PropType<GapPositionType>,
}, },
percent: { percent: {
type: [Array, Number] as PropType<number | number[]>, type: [Array, Number] as PropType<number | number[]>,
}, },
prefixCls: PropTypes.string, prefixCls: String,
strokeColor: { strokeColor: {
type: [Object, String, Array] as PropType<StrokeColorType>, type: [Object, String, Array] as PropType<StrokeColorType>,
}, },
strokeLinecap: { strokeLinecap: {
type: String as PropType<StrokeLinecapType>, type: String as PropType<StrokeLinecapType>,
}, },
strokeWidth: PropTypes.number, strokeWidth: Number,
trailColor: PropTypes.string, trailColor: String,
trailWidth: PropTypes.number, trailWidth: Number,
transition: PropTypes.string, transition: String,
}; };
export type ProgressProps = Partial<ExtractPropTypes<typeof propTypes>>; export type ProgressProps = Partial<ExtractPropTypes<typeof propTypes>>;

View File

@ -84,26 +84,26 @@ const SelectTrigger = defineComponent<SelectTriggerProps, { popupRef: any }>({
inheritAttrs: false, inheritAttrs: false,
props: { props: {
dropdownAlign: PropTypes.object, dropdownAlign: PropTypes.object,
visible: PropTypes.looseBool, visible: { type: Boolean, default: undefined },
disabled: PropTypes.looseBool, disabled: { type: Boolean, default: undefined },
dropdownClassName: PropTypes.string, dropdownClassName: String,
dropdownStyle: PropTypes.object, dropdownStyle: PropTypes.object,
placement: PropTypes.string, placement: String,
empty: PropTypes.looseBool, empty: { type: Boolean, default: undefined },
autoAdjustOverflow: PropTypes.looseBool, autoAdjustOverflow: { type: Boolean, default: undefined },
prefixCls: PropTypes.string, prefixCls: String,
popupClassName: PropTypes.string, popupClassName: String,
animation: PropTypes.string, animation: String,
transitionName: PropTypes.string, transitionName: String,
getPopupContainer: PropTypes.func, getPopupContainer: Function,
dropdownRender: PropTypes.func, dropdownRender: Function,
containerWidth: PropTypes.number, containerWidth: Number,
dropdownMatchSelectWidth: PropTypes.oneOfType([Number, Boolean]).def(true), dropdownMatchSelectWidth: PropTypes.oneOfType([Number, Boolean]).def(true),
popupElement: PropTypes.any, popupElement: PropTypes.any,
direction: PropTypes.string, direction: String,
getTriggerDOMNode: PropTypes.func, getTriggerDOMNode: Function,
onPopupVisibleChange: PropTypes.func, onPopupVisibleChange: Function,
onPopupMouseEnter: PropTypes.func, onPopupMouseEnter: Function,
} as any, } as any,
setup(props, { slots, attrs, expose }) { setup(props, { slots, attrs, expose }) {
const builtInPlacements = computed(() => { const builtInPlacements = computed(() => {

View File

@ -15,16 +15,16 @@ import type {
export const inputProps = { export const inputProps = {
inputRef: PropTypes.any, inputRef: PropTypes.any,
prefixCls: PropTypes.string, prefixCls: String,
id: PropTypes.string, id: String,
inputElement: PropTypes.VueNode, inputElement: PropTypes.VueNode,
disabled: PropTypes.looseBool, disabled: { type: Boolean, default: undefined },
autofocus: PropTypes.looseBool, autofocus: { type: Boolean, default: undefined },
autocomplete: PropTypes.string, autocomplete: String,
editable: PropTypes.looseBool, editable: { type: Boolean, default: undefined },
activeDescendantId: PropTypes.string, activeDescendantId: String,
value: PropTypes.string, value: String,
open: PropTypes.looseBool, open: { type: Boolean, default: undefined },
tabindex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), tabindex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
/** Pass accessibility props to input */ /** Pass accessibility props to input */
attrs: PropTypes.object, attrs: PropTypes.object,

View File

@ -32,39 +32,39 @@ type SelectorProps = InnerSelectorProps & {
}; };
const props = { const props = {
id: PropTypes.string, id: String,
prefixCls: PropTypes.string, prefixCls: String,
values: PropTypes.array, values: PropTypes.array,
open: PropTypes.looseBool, open: { type: Boolean, default: undefined },
searchValue: PropTypes.string, searchValue: String,
inputRef: PropTypes.any, inputRef: PropTypes.any,
placeholder: PropTypes.any, placeholder: PropTypes.any,
disabled: PropTypes.looseBool, disabled: { type: Boolean, default: undefined },
mode: PropTypes.string, mode: String,
showSearch: PropTypes.looseBool, showSearch: { type: Boolean, default: undefined },
autofocus: PropTypes.looseBool, autofocus: { type: Boolean, default: undefined },
autocomplete: PropTypes.string, autocomplete: String,
activeDescendantId: PropTypes.string, activeDescendantId: String,
tabindex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), tabindex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
removeIcon: PropTypes.any, removeIcon: PropTypes.any,
choiceTransitionName: PropTypes.string, choiceTransitionName: String,
maxTagCount: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), maxTagCount: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
maxTagTextLength: PropTypes.number, maxTagTextLength: Number,
maxTagPlaceholder: PropTypes.any.def( maxTagPlaceholder: PropTypes.any.def(
() => (omittedValues: DisplayValueType[]) => `+ ${omittedValues.length} ...`, () => (omittedValues: DisplayValueType[]) => `+ ${omittedValues.length} ...`,
), ),
tagRender: PropTypes.func, tagRender: Function,
onToggleOpen: { type: Function as PropType<(open?: boolean) => void> }, onToggleOpen: { type: Function as PropType<(open?: boolean) => void> },
onRemove: PropTypes.func, onRemove: Function,
onInputChange: PropTypes.func, onInputChange: Function,
onInputPaste: PropTypes.func, onInputPaste: Function,
onInputKeyDown: PropTypes.func, onInputKeyDown: Function,
onInputMouseDown: PropTypes.func, onInputMouseDown: Function,
onInputCompositionStart: PropTypes.func, onInputCompositionStart: Function,
onInputCompositionEnd: PropTypes.func, onInputCompositionEnd: Function,
}; };
const onPreventMouseDown = (event: MouseEvent) => { const onPreventMouseDown = (event: MouseEvent) => {

View File

@ -13,29 +13,29 @@ interface SelectorProps extends InnerSelectorProps {
} }
const props = { const props = {
inputElement: PropTypes.any, inputElement: PropTypes.any,
id: PropTypes.string, id: String,
prefixCls: PropTypes.string, prefixCls: String,
values: PropTypes.array, values: PropTypes.array,
open: PropTypes.looseBool, open: { type: Boolean, default: undefined },
searchValue: PropTypes.string, searchValue: String,
inputRef: PropTypes.any, inputRef: PropTypes.any,
placeholder: PropTypes.any, placeholder: PropTypes.any,
disabled: PropTypes.looseBool, disabled: { type: Boolean, default: undefined },
mode: PropTypes.string, mode: String,
showSearch: PropTypes.looseBool, showSearch: { type: Boolean, default: undefined },
autofocus: PropTypes.looseBool, autofocus: { type: Boolean, default: undefined },
autocomplete: PropTypes.string, autocomplete: String,
activeDescendantId: PropTypes.string, activeDescendantId: String,
tabindex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), tabindex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
activeValue: PropTypes.string, activeValue: String,
backfill: PropTypes.looseBool, backfill: { type: Boolean, default: undefined },
optionLabelRender: PropTypes.func, optionLabelRender: Function,
onInputChange: PropTypes.func, onInputChange: Function,
onInputPaste: PropTypes.func, onInputPaste: Function,
onInputKeyDown: PropTypes.func, onInputKeyDown: Function,
onInputMouseDown: PropTypes.func, onInputMouseDown: Function,
onInputCompositionStart: PropTypes.func, onInputCompositionStart: Function,
onInputCompositionEnd: PropTypes.func, onInputCompositionEnd: Function,
}; };
const SingleSelector = defineComponent<SelectorProps>({ const SingleSelector = defineComponent<SelectorProps>({
name: 'SingleSelector', name: 'SingleSelector',

View File

@ -77,50 +77,50 @@ const Selector = defineComponent<SelectorProps>({
name: 'Selector', name: 'Selector',
inheritAttrs: false, inheritAttrs: false,
props: { props: {
id: PropTypes.string, id: String,
prefixCls: PropTypes.string, prefixCls: String,
showSearch: PropTypes.looseBool, showSearch: { type: Boolean, default: undefined },
open: PropTypes.looseBool, open: { type: Boolean, default: undefined },
/** Display in the Selector value, it's not same as `value` prop */ /** Display in the Selector value, it's not same as `value` prop */
values: PropTypes.array, values: PropTypes.array,
multiple: PropTypes.looseBool, multiple: { type: Boolean, default: undefined },
mode: PropTypes.string, mode: String,
searchValue: PropTypes.string, searchValue: String,
activeValue: PropTypes.string, activeValue: String,
inputElement: PropTypes.any, inputElement: PropTypes.any,
autofocus: PropTypes.looseBool, autofocus: { type: Boolean, default: undefined },
activeDescendantId: PropTypes.string, activeDescendantId: String,
tabindex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), tabindex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
disabled: PropTypes.looseBool, disabled: { type: Boolean, default: undefined },
placeholder: PropTypes.any, placeholder: PropTypes.any,
removeIcon: PropTypes.any, removeIcon: PropTypes.any,
// Tags // Tags
maxTagCount: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), maxTagCount: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
maxTagTextLength: PropTypes.number, maxTagTextLength: Number,
maxTagPlaceholder: PropTypes.any, maxTagPlaceholder: PropTypes.any,
tagRender: PropTypes.func, tagRender: Function,
optionLabelRender: PropTypes.func, optionLabelRender: Function,
/** Check if `tokenSeparators` contains `\n` or `\r\n` */ /** Check if `tokenSeparators` contains `\n` or `\r\n` */
tokenWithEnter: PropTypes.looseBool, tokenWithEnter: { type: Boolean, default: undefined },
// Motion // Motion
choiceTransitionName: PropTypes.string, choiceTransitionName: String,
onToggleOpen: { type: Function as PropType<(open?: boolean) => void> }, onToggleOpen: { type: Function as PropType<(open?: boolean) => void> },
/** `onSearch` returns go next step boolean to check if need do toggle open */ /** `onSearch` returns go next step boolean to check if need do toggle open */
onSearch: PropTypes.func, onSearch: Function,
onSearchSubmit: PropTypes.func, onSearchSubmit: Function,
onRemove: PropTypes.func, onRemove: Function,
onInputKeyDown: { type: Function as PropType<EventHandler> }, onInputKeyDown: { type: Function as PropType<EventHandler> },
/** /**
* @private get real dom for trigger align. * @private get real dom for trigger align.
* This may be removed after React provides replacement of `findDOMNode` * This may be removed after React provides replacement of `findDOMNode`
*/ */
domRef: PropTypes.func, domRef: Function,
} as any, } as any,
setup(props, { expose }) { setup(props, { expose }) {
const inputRef = createRef(); const inputRef = createRef();

View File

@ -56,11 +56,11 @@ const TransBtn: TransBtnType = (props, { slots }) => {
TransBtn.inheritAttrs = false; TransBtn.inheritAttrs = false;
TransBtn.displayName = 'TransBtn'; TransBtn.displayName = 'TransBtn';
TransBtn.props = { TransBtn.props = {
class: PropTypes.string, class: String,
customizeIcon: PropTypes.any, customizeIcon: PropTypes.any,
customizeIconProps: PropTypes.any, customizeIconProps: PropTypes.any,
onMousedown: PropTypes.func, onMousedown: Function,
onClick: PropTypes.func, onClick: Function,
}; };
export default TransBtn; export default TransBtn;

View File

@ -8,15 +8,15 @@ export default defineComponent({
name: 'Handle', name: 'Handle',
inheritAttrs: false, inheritAttrs: false,
props: { props: {
prefixCls: PropTypes.string, prefixCls: String,
vertical: PropTypes.looseBool, vertical: { type: Boolean, default: undefined },
offset: PropTypes.number, offset: Number,
disabled: PropTypes.looseBool, disabled: { type: Boolean, default: undefined },
min: PropTypes.number, min: Number,
max: PropTypes.number, max: Number,
value: PropTypes.number, value: Number,
tabindex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), tabindex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
reverse: PropTypes.looseBool, reverse: { type: Boolean, default: undefined },
ariaLabel: String, ariaLabel: String,
ariaLabelledBy: String, ariaLabelledBy: String,
ariaValueTextFormatter: Function, ariaValueTextFormatter: Function,

View File

@ -37,20 +37,20 @@ const trimAlignValue = ({
const rangeProps = { const rangeProps = {
defaultValue: PropTypes.arrayOf(PropTypes.number), defaultValue: PropTypes.arrayOf(PropTypes.number),
value: PropTypes.arrayOf(PropTypes.number), value: PropTypes.arrayOf(PropTypes.number),
count: PropTypes.number, count: Number,
pushable: withUndefined(PropTypes.oneOfType([PropTypes.looseBool, PropTypes.number])), pushable: withUndefined(PropTypes.oneOfType([PropTypes.looseBool, PropTypes.number])),
allowCross: PropTypes.looseBool, allowCross: { type: Boolean, default: undefined },
disabled: PropTypes.looseBool, disabled: { type: Boolean, default: undefined },
reverse: PropTypes.looseBool, reverse: { type: Boolean, default: undefined },
tabindex: PropTypes.arrayOf(PropTypes.number), tabindex: PropTypes.arrayOf(PropTypes.number),
prefixCls: PropTypes.string, prefixCls: String,
min: PropTypes.number, min: Number,
max: PropTypes.number, max: Number,
autofocus: PropTypes.looseBool, autofocus: { type: Boolean, default: undefined },
ariaLabelGroupForHandles: Array, ariaLabelGroupForHandles: Array,
ariaLabelledByGroupForHandles: Array, ariaLabelledByGroupForHandles: Array,
ariaValueTextFormatterGroupForHandles: Array, ariaValueTextFormatterGroupForHandles: Array,
draggableTrack: PropTypes.looseBool, draggableTrack: { type: Boolean, default: undefined },
}; };
const Range = defineComponent({ const Range = defineComponent({
name: 'Range', name: 'Range',

View File

@ -11,14 +11,14 @@ const Slider = defineComponent({
mixins: [BaseMixin], mixins: [BaseMixin],
inheritAttrs: false, inheritAttrs: false,
props: { props: {
defaultValue: PropTypes.number, defaultValue: Number,
value: PropTypes.number, value: Number,
disabled: PropTypes.looseBool, disabled: { type: Boolean, default: undefined },
autofocus: PropTypes.looseBool, autofocus: { type: Boolean, default: undefined },
tabindex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), tabindex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
reverse: PropTypes.looseBool, reverse: { type: Boolean, default: undefined },
min: PropTypes.number, min: Number,
max: PropTypes.number, max: Number,
ariaLabelForHandle: String, ariaLabelForHandle: String,
ariaLabelledByForHandle: String, ariaLabelledByForHandle: String,
ariaValueTextFormatterForHandle: String, ariaValueTextFormatterForHandle: String,

View File

@ -16,18 +16,18 @@ function noop() {}
export default function createSlider(Component) { export default function createSlider(Component) {
// const displayName = `ComponentEnhancer(${Component.displayName})` // const displayName = `ComponentEnhancer(${Component.displayName})`
const propTypes = { const propTypes = {
id: PropTypes.string, id: String,
min: PropTypes.number, min: Number,
max: PropTypes.number, max: Number,
step: PropTypes.number, step: Number,
marks: PropTypes.object, marks: PropTypes.object,
included: PropTypes.looseBool, included: { type: Boolean, default: undefined },
prefixCls: PropTypes.string, prefixCls: String,
disabled: PropTypes.looseBool, disabled: { type: Boolean, default: undefined },
handle: PropTypes.func, handle: Function,
dots: PropTypes.looseBool, dots: { type: Boolean, default: undefined },
vertical: PropTypes.looseBool, vertical: { type: Boolean, default: undefined },
reverse: PropTypes.looseBool, reverse: { type: Boolean, default: undefined },
minimumTrackStyle: PropTypes.object, // just for compatibility, will be deperecate minimumTrackStyle: PropTypes.object, // just for compatibility, will be deperecate
maximumTrackStyle: 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)]), handleStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.arrayOf(PropTypes.object)]),
@ -35,8 +35,8 @@ export default function createSlider(Component) {
railStyle: PropTypes.object, railStyle: PropTypes.object,
dotStyle: PropTypes.object, dotStyle: PropTypes.object,
activeDotStyle: PropTypes.object, activeDotStyle: PropTypes.object,
autofocus: PropTypes.looseBool, autofocus: { type: Boolean, default: undefined },
draggableTrack: PropTypes.looseBool, draggableTrack: { type: Boolean, default: undefined },
}; };
return defineComponent({ return defineComponent({
name: 'CreateSlider', name: 'CreateSlider',

View File

@ -8,17 +8,17 @@ function isString(str: any): str is string {
} }
function noop() {} function noop() {}
export const VcStepProps = () => ({ export const VcStepProps = () => ({
prefixCls: PropTypes.string, prefixCls: String,
wrapperStyle: PropTypes.style, wrapperStyle: PropTypes.style,
itemWidth: PropTypes.string, itemWidth: String,
active: PropTypes.looseBool, active: { type: Boolean, default: undefined },
disabled: PropTypes.looseBool, disabled: { type: Boolean, default: undefined },
status: PropTypes.string, status: String,
iconPrefix: PropTypes.string, iconPrefix: String,
icon: PropTypes.any, icon: PropTypes.any,
adjustMarginRight: PropTypes.string, adjustMarginRight: String,
stepNumber: PropTypes.number, stepNumber: Number,
stepIndex: PropTypes.number, stepIndex: Number,
description: PropTypes.any, description: PropTypes.any,
title: PropTypes.any, title: PropTypes.any,
subTitle: PropTypes.any, subTitle: PropTypes.any,
@ -28,9 +28,9 @@ export const VcStepProps = () => ({
finish: PropTypes.any, finish: PropTypes.any,
error: PropTypes.any, error: PropTypes.any,
}).loose, }).loose,
onClick: PropTypes.func, onClick: Function,
onStepClick: PropTypes.func, onStepClick: Function,
stepIcon: PropTypes.func, stepIcon: Function,
}); });
export default defineComponent({ export default defineComponent({
name: 'Step', name: 'Step',

View File

@ -38,7 +38,7 @@ export default defineComponent({
finish: PropTypes.any, finish: PropTypes.any,
error: PropTypes.any, error: PropTypes.any,
}).loose, }).loose,
stepIcon: PropTypes.func, stepIcon: Function,
}, },
slots: ['stepIcon', 'progressDot'], slots: ['stepIcon', 'progressDot'],
emits: ['change'], emits: ['change'],
@ -79,7 +79,7 @@ export default defineComponent({
// description: PropTypes.any, // description: PropTypes.any,
// icon: PropTypes.any, // icon: PropTypes.any,
// status: PropTypes.oneOf(tuple('wait', 'process', 'finish', 'error')), // status: PropTypes.oneOf(tuple('wait', 'process', 'finish', 'error')),
// disabled: PropTypes.looseBool, // disabled: { type: Boolean, default: undefined },
// title: PropTypes.any, // title: PropTypes.any,
// subTitle: PropTypes.any, // subTitle: PropTypes.any,
const { prefixCls: pre = prefixCls, ...restProps } = child.props || {}; const { prefixCls: pre = prefixCls, ...restProps } = child.props || {};

View File

@ -3,8 +3,8 @@ import { defineComponent } from 'vue';
import PropTypes from '../../_util/vue-types'; import PropTypes from '../../_util/vue-types';
const tooltipContentProps = { const tooltipContentProps = {
prefixCls: PropTypes.string, prefixCls: String,
id: PropTypes.string, id: String,
overlayInnerStyle: PropTypes.any, overlayInnerStyle: PropTypes.any,
}; };

View File

@ -10,27 +10,27 @@ export default defineComponent({
inheritAttrs: false, inheritAttrs: false,
props: { props: {
trigger: PropTypes.any.def(['hover']), trigger: PropTypes.any.def(['hover']),
defaultVisible: PropTypes.looseBool, defaultVisible: { type: Boolean, default: undefined },
visible: PropTypes.looseBool, visible: { type: Boolean, default: undefined },
placement: PropTypes.string.def('right'), placement: PropTypes.string.def('right'),
transitionName: PropTypes.string, transitionName: String,
animation: PropTypes.any, animation: PropTypes.any,
afterVisibleChange: PropTypes.func.def(() => {}), afterVisibleChange: PropTypes.func.def(() => {}),
overlayStyle: PropTypes.style, overlayStyle: PropTypes.style,
overlayClassName: PropTypes.string, overlayClassName: String,
prefixCls: PropTypes.string.def('rc-tooltip'), prefixCls: PropTypes.string.def('rc-tooltip'),
mouseEnterDelay: PropTypes.number.def(0.1), mouseEnterDelay: PropTypes.number.def(0.1),
mouseLeaveDelay: PropTypes.number.def(0.1), mouseLeaveDelay: PropTypes.number.def(0.1),
getTooltipContainer: PropTypes.func, getTooltipContainer: Function,
destroyTooltipOnHide: PropTypes.looseBool.def(false), destroyTooltipOnHide: PropTypes.looseBool.def(false),
align: PropTypes.object.def(() => ({})), align: PropTypes.object.def(() => ({})),
arrowContent: PropTypes.any.def(null), arrowContent: PropTypes.any.def(null),
tipId: PropTypes.string, tipId: String,
builtinPlacements: PropTypes.object, builtinPlacements: PropTypes.object,
overlayInnerStyle: PropTypes.style, overlayInnerStyle: PropTypes.style,
popupVisible: PropTypes.looseBool, popupVisible: { type: Boolean, default: undefined },
onVisibleChange: PropTypes.func, onVisibleChange: Function,
onPopupAlign: PropTypes.func, onPopupAlign: Function,
}, },
slots: ['arrowContent', 'overlay'], slots: ['arrowContent', 'overlay'],
setup(props, { slots, attrs, expose }) { setup(props, { slots, attrs, expose }) {

View File

@ -59,29 +59,29 @@ export default defineComponent({
popupStyle: PropTypes.style, popupStyle: PropTypes.style,
prefixCls: PropTypes.string.def('rc-trigger-popup'), prefixCls: PropTypes.string.def('rc-trigger-popup'),
popupClassName: PropTypes.string.def(''), popupClassName: PropTypes.string.def(''),
popupPlacement: PropTypes.string, popupPlacement: String,
builtinPlacements: PropTypes.object, builtinPlacements: PropTypes.object,
popupTransitionName: PropTypes.string, popupTransitionName: String,
popupAnimation: PropTypes.any, popupAnimation: PropTypes.any,
mouseEnterDelay: PropTypes.number.def(0), mouseEnterDelay: PropTypes.number.def(0),
mouseLeaveDelay: PropTypes.number.def(0.1), mouseLeaveDelay: PropTypes.number.def(0.1),
zIndex: PropTypes.number, zIndex: Number,
focusDelay: PropTypes.number.def(0), focusDelay: PropTypes.number.def(0),
blurDelay: PropTypes.number.def(0.15), blurDelay: PropTypes.number.def(0.15),
getPopupContainer: PropTypes.func, getPopupContainer: Function,
getDocument: PropTypes.func.def(returnDocument), getDocument: PropTypes.func.def(returnDocument),
forceRender: PropTypes.looseBool, forceRender: { type: Boolean, default: undefined },
destroyPopupOnHide: PropTypes.looseBool.def(false), destroyPopupOnHide: PropTypes.looseBool.def(false),
mask: PropTypes.looseBool.def(false), mask: PropTypes.looseBool.def(false),
maskClosable: PropTypes.looseBool.def(true), maskClosable: PropTypes.looseBool.def(true),
// onPopupAlign: PropTypes.func.def(noop), // onPopupAlign: PropTypes.func.def(noop),
popupAlign: PropTypes.object.def(() => ({})), popupAlign: PropTypes.object.def(() => ({})),
popupVisible: PropTypes.looseBool, popupVisible: { type: Boolean, default: undefined },
defaultPopupVisible: PropTypes.looseBool.def(false), defaultPopupVisible: PropTypes.looseBool.def(false),
maskTransitionName: PropTypes.string, maskTransitionName: String,
maskAnimation: PropTypes.string, maskAnimation: String,
stretch: PropTypes.string, stretch: String,
alignPoint: PropTypes.looseBool, // Maybe we can support user pass position in the future alignPoint: { type: Boolean, default: undefined }, // Maybe we can support user pass position in the future
autoDestroy: PropTypes.looseBool.def(false), autoDestroy: PropTypes.looseBool.def(false),
mobile: Object, mobile: Object,
getTriggerDOMNode: Function, getTriggerDOMNode: Function,

View File

@ -79,12 +79,12 @@ const List = defineComponent({
name: 'List', name: 'List',
inheritAttrs: false, inheritAttrs: false,
props: { props: {
prefixCls: PropTypes.string, prefixCls: String,
data: PropTypes.array, data: PropTypes.array,
height: PropTypes.number, height: Number,
itemHeight: PropTypes.number, itemHeight: Number,
/** If not match virtual scroll condition, Set List still use height of container. */ /** If not match virtual scroll condition, Set List still use height of container. */
fullHeight: PropTypes.looseBool, fullHeight: { type: Boolean, default: undefined },
itemKey: { itemKey: {
type: [String, Number, Function] as PropType<Key | ((item: Record<string, any>) => Key)>, type: [String, Number, Function] as PropType<Key | ((item: Record<string, any>) => Key)>,
required: true, required: true,
@ -93,11 +93,11 @@ const List = defineComponent({
type: [String, Object] as PropType<string | Component>, type: [String, Object] as PropType<string | Component>,
}, },
/** Set `false` will always use real scroll instead of virtual one */ /** Set `false` will always use real scroll instead of virtual one */
virtual: PropTypes.looseBool, virtual: { type: Boolean, default: undefined },
children: PropTypes.func, children: Function,
onScroll: PropTypes.func, onScroll: Function,
onMousedown: PropTypes.func, onMousedown: Function,
onMouseenter: PropTypes.func, onMouseenter: Function,
onVisibleChange: Function as PropType<(visibleList: any[], fullList: any[]) => void>, onVisibleChange: Function as PropType<(visibleList: any[], fullList: any[]) => void>,
}, },
setup(props, { expose }) { setup(props, { expose }) {

View File

@ -23,11 +23,11 @@ export default defineComponent({
name: 'ScrollBar', name: 'ScrollBar',
inheritAttrs: false, inheritAttrs: false,
props: { props: {
prefixCls: PropTypes.string, prefixCls: String,
scrollTop: PropTypes.number, scrollTop: Number,
scrollHeight: PropTypes.number, scrollHeight: Number,
height: PropTypes.number, height: Number,
count: PropTypes.number, count: Number,
onScroll: { onScroll: {
type: Function as PropType<(scrollTop: number) => void>, type: Function as PropType<(scrollTop: number) => void>,
}, },

View File

@ -1,56 +1,47 @@
<docs>
---
order: 0
title:
zh-CN: 基本用法
en-US: Basic usage
---
## zh-CN
第一个对话框
## en-US
Basic modal.
</docs>
<template> <template>
<div> <div>
<div ref="container"></div> <a-menu
<a-button type="primary" @click="showModal">Open Modal</a-button> v-model:selected-keys="selectedKeys"
<a-modal v-model:visible="visible" title="Basic Modal" @ok="handleOk"> :open-keys="openKeys"
<p>Some contents...</p> style="width: 256px"
<p>Some contents...</p> mode="inline"
<p>Some contents...</p> >
</a-modal> <a-sub-menu key="sub1">
<template #icon>
<MailOutlined />
</template>
<template #title>Navigation One</template>
<a-menu-item key="3">Option 3</a-menu-item>
<a-menu-item key="4">Option 4</a-menu-item>
</a-sub-menu>
</a-menu>
<a-button @click="open"></a-button>
</div> </div>
</template> </template>
<script lang="ts"> <script>
import { defineComponent, ref } from 'vue'; import { defineComponent, ref, watchEffect } from 'vue';
import { MailOutlined } from '@ant-design/icons-vue';
export default defineComponent({ export default defineComponent({
components: {
MailOutlined,
},
setup() { setup() {
const visible = ref<boolean>(false); const selectedKeys = ref(['1']);
const openKeys = ref([]);
const showModal = () => { const open = () => {
visible.value = true; openKeys.value.push('sub1');
// openKeys.value = [...openKeys.value, 'sub1'];
}; };
const test = ref([1]);
const handleOk = (e: MouseEvent) => { watchEffect(() => {
console.log(e); console.log(111, test.value);
visible.value = false; });
}; window.openKeys = openKeys;
const container = ref(); window.test = test;
return { return {
container, selectedKeys,
visible, openKeys,
showModal, open,
handleOk,
getContainer() {
console.log('container', container.value);
return container.value;
},
}; };
}, },
}); });

View File

@ -1,6 +1,6 @@
// debugger tsx // debugger tsx
import Demo from '../../components/select/demo/field-names.vue'; // import Demo from '../../components/select/demo/field-names.vue';
// import Demo from './demo/demo.vue'; import Demo from './demo/demo.vue';
export default { export default {
setup() {}, setup() {},