feat: update prop type
parent
7bf1e0dda1
commit
1a7c41bb36
|
@ -15,7 +15,7 @@ export default defineComponent({
|
|||
inheritAttrs: false,
|
||||
props: {
|
||||
getContainer: PropTypes.func.isRequired,
|
||||
didUpdate: PropTypes.func,
|
||||
didUpdate: Function,
|
||||
},
|
||||
setup(props, { slots }) {
|
||||
let isSSR = true;
|
||||
|
|
|
@ -52,10 +52,10 @@ export default defineComponent({
|
|||
name: 'PortalWrapper',
|
||||
inheritAttrs: false,
|
||||
props: {
|
||||
wrapperClassName: PropTypes.string,
|
||||
forceRender: PropTypes.looseBool,
|
||||
wrapperClassName: String,
|
||||
forceRender: { type: Boolean, default: undefined },
|
||||
getContainer: PropTypes.any,
|
||||
visible: PropTypes.looseBool,
|
||||
visible: { type: Boolean, default: undefined },
|
||||
},
|
||||
|
||||
setup(props, { slots }) {
|
||||
|
|
|
@ -19,10 +19,10 @@ const TransButton = defineComponent({
|
|||
name: 'TransButton',
|
||||
inheritAttrs: false,
|
||||
props: {
|
||||
noStyle: PropTypes.looseBool,
|
||||
onClick: PropTypes.func,
|
||||
disabled: PropTypes.looseBool,
|
||||
autofocus: PropTypes.looseBool,
|
||||
noStyle: { type: Boolean, default: undefined },
|
||||
onClick: Function,
|
||||
disabled: { type: Boolean, default: undefined },
|
||||
autofocus: { type: Boolean, default: undefined },
|
||||
},
|
||||
setup(props, { slots, emit, attrs, expose }) {
|
||||
const domRef = ref();
|
||||
|
|
|
@ -44,7 +44,7 @@ export const alertProps = () => ({
|
|||
*/
|
||||
type: PropTypes.oneOf(AlertTypes),
|
||||
/** Whether Alert can be closed */
|
||||
closable: PropTypes.looseBool,
|
||||
closable: { type: Boolean, default: undefined },
|
||||
/** Close text to show */
|
||||
closeText: PropTypes.any,
|
||||
/** Content of Alert */
|
||||
|
@ -54,9 +54,9 @@ export const alertProps = () => ({
|
|||
/** Trigger when animation ending of Alert */
|
||||
afterClose: PropTypes.func.def(noop),
|
||||
/** Whether to show icon */
|
||||
showIcon: PropTypes.looseBool,
|
||||
prefixCls: PropTypes.string,
|
||||
banner: PropTypes.looseBool,
|
||||
showIcon: { type: Boolean, default: undefined },
|
||||
prefixCls: String,
|
||||
banner: { type: Boolean, default: undefined },
|
||||
icon: PropTypes.any,
|
||||
closeIcon: PropTypes.any,
|
||||
onClose: Function as PropType<NodeMouseEventHandler>,
|
||||
|
|
|
@ -7,10 +7,10 @@ import useConfigInject from '../_util/hooks/useConfigInject';
|
|||
import { useInjectAnchor } from './context';
|
||||
|
||||
export const anchorLinkProps = {
|
||||
prefixCls: PropTypes.string,
|
||||
prefixCls: String,
|
||||
href: PropTypes.string.def('#'),
|
||||
title: PropTypes.any,
|
||||
target: PropTypes.string,
|
||||
target: String,
|
||||
};
|
||||
|
||||
export type AnchorLinkProps = Partial<ExtractPropTypes<typeof anchorLinkProps>>;
|
||||
|
|
|
@ -17,7 +17,7 @@ export const autoCompleteProps = {
|
|||
...omit(selectProps(), ['loading', 'mode', 'optionLabelProp', 'labelInValue']),
|
||||
dataSource: PropTypes.array,
|
||||
dropdownMenuStyle: PropTypes.style,
|
||||
// optionLabelProp: PropTypes.string,
|
||||
// optionLabelProp: String,
|
||||
dropdownMatchSelectWidth: { type: [Number, Boolean], default: true },
|
||||
};
|
||||
|
||||
|
@ -32,12 +32,12 @@ const AutoComplete = defineComponent({
|
|||
inheritAttrs: false,
|
||||
props: {
|
||||
...autoCompleteProps,
|
||||
prefixCls: PropTypes.string,
|
||||
showSearch: PropTypes.looseBool,
|
||||
transitionName: PropTypes.string,
|
||||
prefixCls: String,
|
||||
showSearch: { type: Boolean, default: undefined },
|
||||
transitionName: String,
|
||||
choiceTransitionName: PropTypes.string.def('zoom'),
|
||||
autofocus: PropTypes.looseBool,
|
||||
backfill: PropTypes.looseBool,
|
||||
autofocus: { type: Boolean, default: undefined },
|
||||
backfill: { type: Boolean, default: undefined },
|
||||
// optionLabelProp: PropTypes.string.def('children'),
|
||||
filterOption: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.func]).def(false),
|
||||
defaultActiveFirstOption: PropTypes.looseBool.def(true),
|
||||
|
|
|
@ -15,18 +15,18 @@ import eagerComputed from '../_util/eagerComputed';
|
|||
export type AvatarSize = 'large' | 'small' | 'default' | number | ScreenSizeMap;
|
||||
|
||||
export const avatarProps = () => ({
|
||||
prefixCls: PropTypes.string,
|
||||
prefixCls: String,
|
||||
shape: PropTypes.oneOf(tuple('circle', 'square')).def('circle'),
|
||||
size: {
|
||||
type: [Number, String, Object] as PropType<AvatarSize>,
|
||||
default: (): AvatarSize => 'default',
|
||||
},
|
||||
src: PropTypes.string,
|
||||
src: String,
|
||||
/** Srcset of image avatar */
|
||||
srcset: PropTypes.string,
|
||||
srcset: String,
|
||||
icon: PropTypes.any,
|
||||
alt: PropTypes.string,
|
||||
gap: PropTypes.number,
|
||||
alt: String,
|
||||
gap: Number,
|
||||
draggable: PropTypes.bool,
|
||||
crossOrigin: String as PropType<'' | 'anonymous' | 'use-credentials'>,
|
||||
loadError: {
|
||||
|
|
|
@ -11,8 +11,8 @@ import useConfigInject from '../_util/hooks/useConfigInject';
|
|||
import useProvideSize from '../_util/hooks/useSize';
|
||||
|
||||
export const groupProps = () => ({
|
||||
prefixCls: PropTypes.string,
|
||||
maxCount: PropTypes.number,
|
||||
prefixCls: String,
|
||||
maxCount: Number,
|
||||
maxStyle: {
|
||||
type: Object as PropType<CSSProperties>,
|
||||
default: () => ({} as CSSProperties),
|
||||
|
|
|
@ -24,9 +24,9 @@ export const backTopProps = {
|
|||
visibilityHeight: PropTypes.number.def(400),
|
||||
duration: PropTypes.number.def(450),
|
||||
target: Function as PropType<() => HTMLElement | Window | Document>,
|
||||
prefixCls: PropTypes.string,
|
||||
onClick: PropTypes.func,
|
||||
// visible: PropTypes.looseBool, // Only for test. Don't use it.
|
||||
prefixCls: String,
|
||||
onClick: Function,
|
||||
// visible: { type: Boolean, default: undefined }, // Only for test. Don't use it.
|
||||
};
|
||||
|
||||
export type BackTopProps = Partial<ExtractPropTypes<typeof backTopProps>>;
|
||||
|
|
|
@ -15,21 +15,21 @@ import isNumeric from '../_util/isNumeric';
|
|||
export const badgeProps = {
|
||||
/** Number to show in badge */
|
||||
count: PropTypes.any,
|
||||
showZero: PropTypes.looseBool,
|
||||
showZero: { type: Boolean, default: undefined },
|
||||
/** Max count to show */
|
||||
overflowCount: PropTypes.number.def(99),
|
||||
/** whether to show red dot without number */
|
||||
dot: PropTypes.looseBool,
|
||||
prefixCls: PropTypes.string,
|
||||
scrollNumberPrefixCls: PropTypes.string,
|
||||
dot: { type: Boolean, default: undefined },
|
||||
prefixCls: String,
|
||||
scrollNumberPrefixCls: String,
|
||||
status: PropTypes.oneOf(tuple('success', 'processing', 'default', 'error', 'warning')),
|
||||
// sync antd@4.6.0
|
||||
size: PropTypes.oneOf(tuple('default', 'small')).def('default'),
|
||||
color: PropTypes.string,
|
||||
color: String,
|
||||
text: PropTypes.any,
|
||||
offset: PropTypes.arrayOf(PropTypes.oneOfType([String, Number])),
|
||||
numberStyle: PropTypes.style,
|
||||
title: PropTypes.string,
|
||||
title: String,
|
||||
};
|
||||
|
||||
export type BadgeProps = Partial<ExtractPropTypes<typeof badgeProps>>;
|
||||
|
|
|
@ -8,7 +8,7 @@ import PropTypes from '../_util/vue-types';
|
|||
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||
|
||||
export const ribbonProps = {
|
||||
prefix: PropTypes.string,
|
||||
prefix: String,
|
||||
color: { type: String as PropType<LiteralUnion<PresetColorType, string>> },
|
||||
text: PropTypes.any,
|
||||
placement: PropTypes.oneOf(tuple('start', 'end')).def('end'),
|
||||
|
|
|
@ -8,9 +8,9 @@ import SingleNumber from './SingleNumber';
|
|||
import { filterEmpty } from '../_util/props-util';
|
||||
|
||||
export const scrollNumberProps = {
|
||||
prefixCls: PropTypes.string,
|
||||
prefixCls: String,
|
||||
count: PropTypes.any,
|
||||
component: PropTypes.string,
|
||||
component: String,
|
||||
title: PropTypes.oneOfType([PropTypes.number, PropTypes.string, null]),
|
||||
show: Boolean,
|
||||
};
|
||||
|
|
|
@ -15,7 +15,7 @@ export interface Route {
|
|||
}
|
||||
|
||||
export const breadcrumbProps = {
|
||||
prefixCls: PropTypes.string,
|
||||
prefixCls: String,
|
||||
routes: { type: Array as PropType<Route[]> },
|
||||
params: PropTypes.any,
|
||||
separator: PropTypes.any,
|
||||
|
|
|
@ -7,8 +7,8 @@ import DownOutlined from '@ant-design/icons-vue/DownOutlined';
|
|||
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||
|
||||
export const breadcrumbItemProps = {
|
||||
prefixCls: PropTypes.string,
|
||||
href: PropTypes.string,
|
||||
prefixCls: String,
|
||||
href: String,
|
||||
separator: PropTypes.any,
|
||||
overlay: PropTypes.any,
|
||||
};
|
||||
|
|
|
@ -5,7 +5,7 @@ import { flattenChildren } from '../_util/props-util';
|
|||
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||
|
||||
export const breadcrumbSeparatorProps = {
|
||||
prefixCls: PropTypes.string,
|
||||
prefixCls: String,
|
||||
};
|
||||
export type BreadcrumbSeparatorProps = Partial<ExtractPropTypes<typeof breadcrumbSeparatorProps>>;
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ import type { SizeType } from '../config-provider';
|
|||
import UnreachableException from '../_util/unreachableException';
|
||||
|
||||
const buttonGroupProps = {
|
||||
prefixCls: PropTypes.string,
|
||||
prefixCls: String,
|
||||
size: {
|
||||
type: String as PropType<SizeType>,
|
||||
},
|
||||
|
|
|
@ -21,7 +21,7 @@ export function convertLegacyProps(type?: LegacyButtonType): ButtonProps {
|
|||
}
|
||||
|
||||
export const buttonProps = () => ({
|
||||
prefixCls: PropTypes.string,
|
||||
prefixCls: String,
|
||||
type: PropTypes.oneOf(ButtonTypes),
|
||||
htmlType: PropTypes.oneOf(ButtonHTMLTypes).def('button'),
|
||||
shape: PropTypes.oneOf(ButtonShapes),
|
||||
|
@ -32,14 +32,14 @@ export const buttonProps = () => ({
|
|||
type: [Boolean, Object] as PropType<boolean | { delay?: number }>,
|
||||
default: (): boolean | { delay?: number } => false,
|
||||
},
|
||||
disabled: PropTypes.looseBool,
|
||||
ghost: PropTypes.looseBool,
|
||||
block: PropTypes.looseBool,
|
||||
danger: PropTypes.looseBool,
|
||||
disabled: { type: Boolean, default: undefined },
|
||||
ghost: { type: Boolean, default: undefined },
|
||||
block: { type: Boolean, default: undefined },
|
||||
danger: { type: Boolean, default: undefined },
|
||||
icon: PropTypes.any,
|
||||
href: PropTypes.string,
|
||||
target: PropTypes.string,
|
||||
title: PropTypes.string,
|
||||
href: String,
|
||||
target: String,
|
||||
title: String,
|
||||
onClick: {
|
||||
type: Function as PropType<(event: MouseEvent) => void>,
|
||||
},
|
||||
|
|
|
@ -24,7 +24,7 @@ export type CardSize = 'default' | 'small';
|
|||
const { TabPane } = Tabs;
|
||||
|
||||
export const cardProps = () => ({
|
||||
prefixCls: PropTypes.string,
|
||||
prefixCls: String,
|
||||
title: PropTypes.any,
|
||||
extra: PropTypes.any,
|
||||
bordered: PropTypes.looseBool.def(true),
|
||||
|
@ -39,8 +39,8 @@ export const cardProps = () => ({
|
|||
type: Array as PropType<CardTabListType[]>,
|
||||
},
|
||||
tabBarExtraContent: PropTypes.any,
|
||||
activeTabKey: PropTypes.string,
|
||||
defaultActiveTabKey: PropTypes.string,
|
||||
activeTabKey: String,
|
||||
defaultActiveTabKey: String,
|
||||
cover: PropTypes.any,
|
||||
onTabChange: {
|
||||
type: Function as PropType<(key: string) => void>,
|
||||
|
|
|
@ -6,7 +6,7 @@ import useConfigInject from '../_util/hooks/useConfigInject';
|
|||
export default defineComponent({
|
||||
name: 'ACardMeta',
|
||||
props: {
|
||||
prefixCls: PropTypes.string,
|
||||
prefixCls: String,
|
||||
title: PropTypes.any,
|
||||
description: PropTypes.any,
|
||||
avatar: PropTypes.any,
|
||||
|
|
|
@ -51,9 +51,9 @@ export const abstractCheckboxProps = () => {
|
|||
indeterminate: { type: Boolean, default: undefined },
|
||||
type: { type: String, default: 'checkbox' },
|
||||
autofocus: { type: Boolean, default: undefined },
|
||||
onChange: PropTypes.func,
|
||||
'onUpdate:checked': PropTypes.func,
|
||||
onClick: PropTypes.func,
|
||||
onChange: Function,
|
||||
'onUpdate:checked': Function,
|
||||
onClick: Function,
|
||||
skipGroup: { type: Boolean, default: false },
|
||||
};
|
||||
};
|
||||
|
|
|
@ -6,32 +6,32 @@ export type CollapsibleType = 'header' | 'disabled';
|
|||
|
||||
export type ActiveKeyType = Array<string | number> | string | number;
|
||||
const collapseProps = () => ({
|
||||
prefixCls: PropTypes.string,
|
||||
prefixCls: String,
|
||||
activeKey: { type: [Array, Number, String] as PropType<ActiveKeyType> },
|
||||
defaultActiveKey: { type: [Array, Number, String] as PropType<ActiveKeyType> },
|
||||
accordion: PropTypes.looseBool,
|
||||
destroyInactivePanel: PropTypes.looseBool,
|
||||
bordered: PropTypes.looseBool,
|
||||
expandIcon: PropTypes.func,
|
||||
accordion: { type: Boolean, default: undefined },
|
||||
destroyInactivePanel: { type: Boolean, default: undefined },
|
||||
bordered: { type: Boolean, default: undefined },
|
||||
expandIcon: Function,
|
||||
openAnimation: PropTypes.object,
|
||||
expandIconPosition: PropTypes.oneOf(tuple('left', 'right')),
|
||||
collapsible: { type: String as PropType<CollapsibleType> },
|
||||
ghost: PropTypes.looseBool,
|
||||
ghost: { type: Boolean, default: undefined },
|
||||
});
|
||||
|
||||
const collapsePanelProps = () => ({
|
||||
openAnimation: PropTypes.object,
|
||||
prefixCls: PropTypes.string,
|
||||
prefixCls: String,
|
||||
header: PropTypes.any,
|
||||
headerClass: PropTypes.string,
|
||||
showArrow: PropTypes.looseBool,
|
||||
isActive: PropTypes.looseBool,
|
||||
destroyInactivePanel: PropTypes.looseBool,
|
||||
headerClass: String,
|
||||
showArrow: { type: Boolean, default: undefined },
|
||||
isActive: { type: Boolean, default: undefined },
|
||||
destroyInactivePanel: { type: Boolean, default: undefined },
|
||||
/** @deprecated Use `collapsible="disabled"` instead */
|
||||
disabled: PropTypes.looseBool,
|
||||
accordion: PropTypes.looseBool,
|
||||
forceRender: PropTypes.looseBool,
|
||||
expandIcon: PropTypes.func,
|
||||
disabled: { type: Boolean, default: undefined },
|
||||
accordion: { type: Boolean, default: undefined },
|
||||
forceRender: { type: Boolean, default: undefined },
|
||||
expandIcon: Function,
|
||||
extra: PropTypes.any,
|
||||
panelKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
||||
collapsible: { type: String as PropType<CollapsibleType> },
|
||||
|
|
|
@ -21,16 +21,16 @@ export default {
|
|||
event: 'change.value', //为了支持v-model直接返回颜色字符串 所以用了自定义的事件,与pickr自带change事件进行区分
|
||||
},
|
||||
props: {
|
||||
prefixCls: PropTypes.string,
|
||||
defaultValue: PropTypes.string, //默认值
|
||||
prefixCls: String,
|
||||
defaultValue: String, //默认值
|
||||
config: PropTypes.object, //pickr配置
|
||||
value: PropTypes.string, //颜色值
|
||||
value: String, //颜色值
|
||||
locale: PropTypes.object, //双语包
|
||||
colorRounded: PropTypes.number, //颜色数值保留几位小数
|
||||
colorRounded: Number, //颜色数值保留几位小数
|
||||
size: PropTypes.oneOf(['default', 'small', 'large']).def('default'), //尺寸
|
||||
getPopupContainer: PropTypes.func, //指定渲染容器
|
||||
getPopupContainer: Function, //指定渲染容器
|
||||
disabled: PropTypes.looseBool.def(false), //是否禁用
|
||||
format: PropTypes.string, //颜色格式设置
|
||||
format: String, //颜色格式设置
|
||||
alpha: PropTypes.looseBool.def(false), //是否开启透明通道
|
||||
hue: PropTypes.looseBool.def(true), //是否开启色彩预选
|
||||
},
|
||||
|
|
|
@ -14,7 +14,7 @@ export const commentProps = {
|
|||
/** The main content of the comment */
|
||||
content: PropTypes.any,
|
||||
/** Comment prefix defaults to '.ant-comment' */
|
||||
prefixCls: PropTypes.string,
|
||||
prefixCls: String,
|
||||
/** A datetime element containing the time to be displayed */
|
||||
datetime: PropTypes.any,
|
||||
};
|
||||
|
|
|
@ -93,7 +93,7 @@ export const configProviderProps = () => ({
|
|||
input: {
|
||||
type: Object as PropType<{ autocomplete: string }>,
|
||||
},
|
||||
autoInsertSpaceInButton: PropTypes.looseBool,
|
||||
autoInsertSpaceInButton: { type: Boolean, default: undefined },
|
||||
locale: {
|
||||
type: Object as PropType<Locale>,
|
||||
default: undefined as Locale,
|
||||
|
@ -110,7 +110,7 @@ export const configProviderProps = () => ({
|
|||
space: {
|
||||
type: Object as PropType<{ size: SizeType | number }>,
|
||||
},
|
||||
virtual: PropTypes.looseBool,
|
||||
virtual: { type: Boolean, default: undefined },
|
||||
dropdownMatchSelectWidth: { type: [Number, Boolean], default: true },
|
||||
form: {
|
||||
type: Object as PropType<{
|
||||
|
|
|
@ -29,13 +29,13 @@ import { flattenChildren } from '../_util/props-util';
|
|||
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||
|
||||
export const DescriptionsItemProps = {
|
||||
prefixCls: PropTypes.string,
|
||||
prefixCls: String,
|
||||
label: PropTypes.any,
|
||||
span: PropTypes.number,
|
||||
span: Number,
|
||||
};
|
||||
|
||||
const descriptionsItemProp = {
|
||||
prefixCls: PropTypes.string,
|
||||
prefixCls: String,
|
||||
label: PropTypes.any,
|
||||
labelStyle: PropTypes.style,
|
||||
contentStyle: PropTypes.style,
|
||||
|
@ -129,8 +129,8 @@ function getRows(children: VNode[], column: number) {
|
|||
}
|
||||
|
||||
export const descriptionsProps = {
|
||||
prefixCls: PropTypes.string,
|
||||
bordered: PropTypes.looseBool,
|
||||
prefixCls: String,
|
||||
bordered: { type: Boolean, default: undefined },
|
||||
size: PropTypes.oneOf(tuple('default', 'middle', 'small')).def('default'),
|
||||
title: PropTypes.any,
|
||||
extra: PropTypes.any,
|
||||
|
@ -139,7 +139,7 @@ export const descriptionsProps = {
|
|||
default: (): number | Partial<Record<Breakpoint, number>> => DEFAULT_COLUMN_MAP,
|
||||
},
|
||||
layout: PropTypes.oneOf(tuple('horizontal', 'vertical')),
|
||||
colon: PropTypes.looseBool,
|
||||
colon: { type: Boolean, default: undefined },
|
||||
labelStyle: PropTypes.style,
|
||||
contentStyle: PropTypes.style,
|
||||
};
|
||||
|
|
|
@ -35,21 +35,21 @@ export interface PushState {
|
|||
const defaultPushState: PushState = { distance: 180 };
|
||||
|
||||
export const drawerProps = () => ({
|
||||
autofocus: PropTypes.looseBool,
|
||||
closable: PropTypes.looseBool,
|
||||
autofocus: { type: Boolean, default: undefined },
|
||||
closable: { type: Boolean, default: undefined },
|
||||
closeIcon: PropTypes.any,
|
||||
destroyOnClose: PropTypes.looseBool,
|
||||
forceRender: PropTypes.looseBool,
|
||||
destroyOnClose: { type: Boolean, default: undefined },
|
||||
forceRender: { type: Boolean, default: undefined },
|
||||
getContainer: PropTypes.any,
|
||||
maskClosable: PropTypes.looseBool,
|
||||
mask: PropTypes.looseBool,
|
||||
maskClosable: { type: Boolean, default: undefined },
|
||||
mask: { type: Boolean, default: undefined },
|
||||
maskStyle: PropTypes.object,
|
||||
/** @deprecated Use `style` instead */
|
||||
wrapStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
|
||||
style: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
|
||||
class: PropTypes.any,
|
||||
/** @deprecated Use `class` instead */
|
||||
wrapClassName: PropTypes.string,
|
||||
wrapClassName: String,
|
||||
size: {
|
||||
type: String as PropType<sizeType>,
|
||||
},
|
||||
|
@ -58,14 +58,14 @@ export const drawerProps = () => ({
|
|||
bodyStyle: PropTypes.object,
|
||||
contentWrapperStyle: PropTypes.object,
|
||||
title: PropTypes.any,
|
||||
visible: PropTypes.looseBool,
|
||||
visible: { type: Boolean, default: undefined },
|
||||
width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
||||
height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
||||
zIndex: PropTypes.number,
|
||||
prefixCls: PropTypes.string,
|
||||
zIndex: Number,
|
||||
prefixCls: String,
|
||||
push: PropTypes.oneOfType([PropTypes.looseBool, { type: Object as PropType<PushState> }]),
|
||||
placement: PropTypes.oneOf(PlacementTypes),
|
||||
keyboard: PropTypes.looseBool,
|
||||
keyboard: { type: Boolean, default: undefined },
|
||||
extra: PropTypes.any,
|
||||
footer: PropTypes.any,
|
||||
footerStyle: PropTypes.object,
|
||||
|
@ -77,7 +77,7 @@ export const drawerProps = () => ({
|
|||
},
|
||||
handle: PropTypes.any,
|
||||
/** @deprecated Use `@afterVisibleChange` instead */
|
||||
afterVisibleChange: PropTypes.func,
|
||||
afterVisibleChange: Function,
|
||||
});
|
||||
|
||||
export type DrawerProps = Partial<ExtractPropTypes<ReturnType<typeof drawerProps>>>;
|
||||
|
|
|
@ -32,12 +32,12 @@ const dropdownProps = () => ({
|
|||
>,
|
||||
},
|
||||
overlay: PropTypes.any,
|
||||
visible: PropTypes.looseBool,
|
||||
disabled: PropTypes.looseBool,
|
||||
visible: { type: Boolean, default: undefined },
|
||||
disabled: { type: Boolean, default: undefined },
|
||||
align: { type: Object as PropType<Align> },
|
||||
getPopupContainer: PropTypes.func,
|
||||
prefixCls: PropTypes.string,
|
||||
transitionName: PropTypes.string,
|
||||
getPopupContainer: Function,
|
||||
prefixCls: String,
|
||||
transitionName: String,
|
||||
placement: PropTypes.oneOf(
|
||||
tuple(
|
||||
'topLeft',
|
||||
|
@ -50,14 +50,14 @@ const dropdownProps = () => ({
|
|||
'bottomRight',
|
||||
),
|
||||
),
|
||||
overlayClassName: PropTypes.string,
|
||||
overlayClassName: String,
|
||||
overlayStyle: PropTypes.style,
|
||||
forceRender: PropTypes.looseBool,
|
||||
mouseEnterDelay: PropTypes.number,
|
||||
mouseLeaveDelay: PropTypes.number,
|
||||
openClassName: PropTypes.string,
|
||||
minOverlayWidthMatchTrigger: PropTypes.looseBool,
|
||||
destroyPopupOnHide: PropTypes.looseBool,
|
||||
forceRender: { type: Boolean, default: undefined },
|
||||
mouseEnterDelay: Number,
|
||||
mouseLeaveDelay: Number,
|
||||
openClassName: String,
|
||||
minOverlayWidthMatchTrigger: { type: Boolean, default: undefined },
|
||||
destroyPopupOnHide: { type: Boolean, default: undefined },
|
||||
onVisibleChange: {
|
||||
type: Function as PropType<(val: boolean) => void>,
|
||||
},
|
||||
|
@ -72,11 +72,11 @@ const dropdownButtonProps = () => ({
|
|||
type: buttonTypesProps.type,
|
||||
size: PropTypes.oneOf(tuple('small', 'large')),
|
||||
htmlType: buttonTypesProps.htmlType,
|
||||
href: PropTypes.string,
|
||||
disabled: PropTypes.looseBool,
|
||||
prefixCls: PropTypes.string,
|
||||
href: String,
|
||||
disabled: { type: Boolean, default: undefined },
|
||||
prefixCls: String,
|
||||
icon: PropTypes.any,
|
||||
title: PropTypes.string,
|
||||
title: String,
|
||||
loading: buttonTypesProps.loading,
|
||||
onClick: {
|
||||
type: Function as PropType<MouseEventHandler>,
|
||||
|
|
|
@ -85,7 +85,7 @@ Empty.PRESENTED_IMAGE_DEFAULT = defaultEmptyImg;
|
|||
Empty.PRESENTED_IMAGE_SIMPLE = simpleEmptyImg;
|
||||
Empty.inheritAttrs = false;
|
||||
Empty.props = {
|
||||
prefixCls: PropTypes.string,
|
||||
prefixCls: String,
|
||||
image: PropTypes.any,
|
||||
description: PropTypes.any,
|
||||
imageStyle: PropTypes.object,
|
||||
|
|
|
@ -64,21 +64,21 @@ export const formProps = {
|
|||
layout: PropTypes.oneOf(tuple('horizontal', 'inline', 'vertical')),
|
||||
labelCol: { 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')),
|
||||
labelWrap: PropTypes.looseBool,
|
||||
prefixCls: PropTypes.string,
|
||||
labelWrap: { type: Boolean, default: undefined },
|
||||
prefixCls: String,
|
||||
requiredMark: { type: [String, Boolean] as PropType<RequiredMark | ''>, default: undefined },
|
||||
/** @deprecated Will warning in future branch. Pls use `requiredMark` instead. */
|
||||
hideRequiredMark: PropTypes.looseBool,
|
||||
hideRequiredMark: { type: Boolean, default: undefined },
|
||||
model: PropTypes.object,
|
||||
rules: { type: Object as PropType<{ [k: string]: ValidationRule[] | ValidationRule }> },
|
||||
validateMessages: PropTypes.object,
|
||||
validateOnRuleChange: PropTypes.looseBool,
|
||||
validateOnRuleChange: { type: Boolean, default: undefined },
|
||||
// 提交失败自动滚动到第一个错误字段
|
||||
scrollToFirstError: { type: [Boolean, Object] as PropType<boolean | Options> },
|
||||
onSubmit: PropTypes.func,
|
||||
name: PropTypes.string,
|
||||
onSubmit: Function,
|
||||
name: String,
|
||||
validateTrigger: { type: [String, Array] as PropType<string | string[]> },
|
||||
size: { type: String as PropType<SizeType> },
|
||||
onValuesChange: { type: Function as PropType<Callbacks['onValuesChange']> },
|
||||
|
|
|
@ -82,22 +82,22 @@ function getPropByPath(obj: any, namePathList: any, strict?: boolean) {
|
|||
};
|
||||
}
|
||||
export const formItemProps = {
|
||||
htmlFor: PropTypes.string,
|
||||
prefixCls: PropTypes.string,
|
||||
htmlFor: String,
|
||||
prefixCls: String,
|
||||
label: PropTypes.any,
|
||||
help: PropTypes.any,
|
||||
extra: PropTypes.any,
|
||||
labelCol: { type: Object as PropType<ColProps & HTMLAttributes> },
|
||||
wrapperCol: { type: Object as PropType<ColProps & HTMLAttributes> },
|
||||
hasFeedback: PropTypes.looseBool.def(false),
|
||||
colon: PropTypes.looseBool,
|
||||
colon: { type: Boolean, default: undefined },
|
||||
labelAlign: PropTypes.oneOf(tuple('left', 'right')),
|
||||
prop: { type: [String, Number, Array] as PropType<string | number | Array<string | number>> },
|
||||
name: { type: [String, Number, Array] as PropType<string | number | Array<string | number>> },
|
||||
rules: PropTypes.oneOfType([Array, Object]),
|
||||
autoLink: PropTypes.looseBool.def(true),
|
||||
required: PropTypes.looseBool,
|
||||
validateFirst: PropTypes.looseBool,
|
||||
required: { type: Boolean, default: undefined },
|
||||
validateFirst: { type: Boolean, default: undefined },
|
||||
validateStatus: PropTypes.oneOf(tuple('', 'success', 'warning', 'error', 'validating')),
|
||||
validateTrigger: { type: [String, Array] as PropType<string | string[]> },
|
||||
messageVariables: { type: Object as PropType<Record<string, string>> },
|
||||
|
|
|
@ -15,22 +15,22 @@ export default defineComponent({
|
|||
name: 'ClearableLabeledInput',
|
||||
inheritAttrs: false,
|
||||
props: {
|
||||
prefixCls: PropTypes.string,
|
||||
prefixCls: String,
|
||||
inputType: PropTypes.oneOf(tuple('text', 'input')),
|
||||
value: PropTypes.any,
|
||||
defaultValue: PropTypes.any,
|
||||
allowClear: PropTypes.looseBool,
|
||||
allowClear: { type: Boolean, default: undefined },
|
||||
element: PropTypes.any,
|
||||
handleReset: PropTypes.func,
|
||||
disabled: PropTypes.looseBool,
|
||||
handleReset: Function,
|
||||
disabled: { type: Boolean, default: undefined },
|
||||
direction: { type: String as PropType<Direction> },
|
||||
size: { type: String as PropType<SizeType> },
|
||||
suffix: PropTypes.any,
|
||||
prefix: PropTypes.any,
|
||||
addonBefore: PropTypes.any,
|
||||
addonAfter: PropTypes.any,
|
||||
readonly: PropTypes.looseBool,
|
||||
focused: PropTypes.looseBool,
|
||||
readonly: { type: Boolean, default: undefined },
|
||||
focused: { type: Boolean, default: undefined },
|
||||
bordered: PropTypes.looseBool.def(true),
|
||||
triggerFocus: { type: Function as PropType<() => void> },
|
||||
hidden: Boolean,
|
||||
|
|
|
@ -8,9 +8,9 @@ import useConfigInject from '../_util/hooks/useConfigInject';
|
|||
export default defineComponent({
|
||||
name: 'AInputGroup',
|
||||
props: {
|
||||
prefixCls: PropTypes.string,
|
||||
prefixCls: String,
|
||||
size: { type: String as PropType<SizeType> },
|
||||
compact: PropTypes.looseBool,
|
||||
compact: { type: Boolean, default: undefined },
|
||||
onMouseenter: { type: Function as PropType<MouseEventHandler> },
|
||||
onMouseleave: { type: Function as PropType<MouseEventHandler> },
|
||||
onFocus: { type: Function as PropType<FocusEventHandler> },
|
||||
|
|
|
@ -24,11 +24,11 @@ export default defineComponent({
|
|||
inheritAttrs: false,
|
||||
props: {
|
||||
...inputProps,
|
||||
prefixCls: PropTypes.string,
|
||||
inputPrefixCls: PropTypes.string,
|
||||
prefixCls: String,
|
||||
inputPrefixCls: String,
|
||||
action: PropTypes.string.def('click'),
|
||||
visibilityToggle: PropTypes.looseBool.def(true),
|
||||
iconRender: PropTypes.func,
|
||||
iconRender: Function,
|
||||
},
|
||||
setup(props, { slots, attrs, expose }) {
|
||||
const visible = ref(false);
|
||||
|
|
|
@ -18,7 +18,7 @@ export default defineComponent({
|
|||
inheritAttrs: false,
|
||||
props: {
|
||||
...inputProps,
|
||||
inputPrefixCls: PropTypes.string,
|
||||
inputPrefixCls: String,
|
||||
// 不能设置默认值 https://github.com/vueComponent/ant-design-vue/issues/1916
|
||||
enterButton: PropTypes.any,
|
||||
onSearch: {
|
||||
|
|
|
@ -5,9 +5,9 @@ import omit from '../_util/omit';
|
|||
import type { LiteralUnion, VueNode } from '../_util/type';
|
||||
export const inputDefaultValue = Symbol() as unknown as string;
|
||||
const inputProps = {
|
||||
id: PropTypes.string,
|
||||
prefixCls: PropTypes.string,
|
||||
inputPrefixCls: PropTypes.string,
|
||||
id: String,
|
||||
prefixCls: String,
|
||||
inputPrefixCls: String,
|
||||
defaultValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
||||
value: {
|
||||
type: [String, Number, Symbol] as PropType<string | number>,
|
||||
|
@ -47,30 +47,30 @@ const inputProps = {
|
|||
>,
|
||||
default: 'text',
|
||||
},
|
||||
name: PropTypes.string,
|
||||
name: String,
|
||||
size: { type: String as PropType<SizeType> },
|
||||
disabled: PropTypes.looseBool,
|
||||
readonly: PropTypes.looseBool,
|
||||
disabled: { type: Boolean, default: undefined },
|
||||
readonly: { type: Boolean, default: undefined },
|
||||
addonBefore: PropTypes.any,
|
||||
addonAfter: PropTypes.any,
|
||||
prefix: PropTypes.any,
|
||||
suffix: PropTypes.any,
|
||||
autofocus: PropTypes.looseBool,
|
||||
allowClear: PropTypes.looseBool,
|
||||
autofocus: { type: Boolean, default: undefined },
|
||||
allowClear: { type: Boolean, default: undefined },
|
||||
lazy: PropTypes.looseBool.def(true),
|
||||
maxlength: PropTypes.number,
|
||||
loading: PropTypes.looseBool,
|
||||
bordered: PropTypes.looseBool,
|
||||
maxlength: Number,
|
||||
loading: { type: Boolean, default: undefined },
|
||||
bordered: { type: Boolean, default: undefined },
|
||||
showCount: { type: [Boolean, Object] as PropType<boolean | ShowCountProps> },
|
||||
htmlSize: Number,
|
||||
onPressEnter: PropTypes.func,
|
||||
onKeydown: PropTypes.func,
|
||||
onKeyup: PropTypes.func,
|
||||
onFocus: PropTypes.func,
|
||||
onBlur: PropTypes.func,
|
||||
onChange: PropTypes.func,
|
||||
onInput: PropTypes.func,
|
||||
'onUpdate:value': PropTypes.func,
|
||||
onPressEnter: Function,
|
||||
onKeydown: Function,
|
||||
onKeyup: Function,
|
||||
onFocus: Function,
|
||||
onBlur: Function,
|
||||
onChange: Function,
|
||||
onInput: Function,
|
||||
'onUpdate:value': Function,
|
||||
valueModifiers: Object,
|
||||
hidden: Boolean,
|
||||
};
|
||||
|
@ -90,8 +90,8 @@ const textAreaProps = {
|
|||
autosize: { type: [Boolean, Object] as PropType<AutoSizeType>, default: undefined },
|
||||
autoSize: { type: [Boolean, Object] as PropType<AutoSizeType>, default: undefined },
|
||||
onResize: { type: Function as PropType<(size: { width: number; height: number }) => void> },
|
||||
onCompositionstart: PropTypes.func,
|
||||
onCompositionend: PropTypes.func,
|
||||
onCompositionstart: Function,
|
||||
onCompositionend: Function,
|
||||
valueModifiers: Object,
|
||||
};
|
||||
|
||||
|
|
|
@ -24,11 +24,11 @@ const dimensionMaxMap = {
|
|||
export type CollapseType = 'clickTrigger' | 'responsive';
|
||||
|
||||
export const siderProps = {
|
||||
prefixCls: PropTypes.string,
|
||||
collapsible: PropTypes.looseBool,
|
||||
collapsed: PropTypes.looseBool,
|
||||
defaultCollapsed: PropTypes.looseBool,
|
||||
reverseArrow: PropTypes.looseBool,
|
||||
prefixCls: String,
|
||||
collapsible: { type: Boolean, default: undefined },
|
||||
collapsed: { type: Boolean, default: undefined },
|
||||
defaultCollapsed: { type: Boolean, default: undefined },
|
||||
reverseArrow: { type: Boolean, default: undefined },
|
||||
zeroWidthTriggerStyle: PropTypes.style,
|
||||
trigger: PropTypes.any,
|
||||
width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
||||
|
|
|
@ -5,9 +5,9 @@ import useConfigInject from '../_util/hooks/useConfigInject';
|
|||
import { SiderHookProviderKey } from './injectionKey';
|
||||
|
||||
export const basicProps = {
|
||||
prefixCls: PropTypes.string,
|
||||
hasSider: PropTypes.looseBool,
|
||||
tagName: PropTypes.string,
|
||||
prefixCls: String,
|
||||
hasSider: { type: Boolean, default: undefined },
|
||||
tagName: String,
|
||||
};
|
||||
|
||||
export type BasicProps = Partial<ExtractPropTypes<typeof basicProps>> & HTMLAttributes;
|
||||
|
|
|
@ -9,7 +9,7 @@ import useConfigInject from '../_util/hooks/useConfigInject';
|
|||
import { ListContextKey } from './contextKey';
|
||||
|
||||
export const ListItemProps = {
|
||||
prefixCls: PropTypes.string,
|
||||
prefixCls: String,
|
||||
extra: PropTypes.any,
|
||||
actions: PropTypes.array,
|
||||
grid: PropTypes.any,
|
||||
|
|
|
@ -6,7 +6,7 @@ import PropTypes from '../_util/vue-types';
|
|||
export const listItemMetaProps = {
|
||||
avatar: PropTypes.any,
|
||||
description: PropTypes.any,
|
||||
prefixCls: PropTypes.string,
|
||||
prefixCls: String,
|
||||
title: PropTypes.any,
|
||||
};
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ export type ListSize = 'small' | 'default' | 'large';
|
|||
export type ListItemLayout = 'horizontal' | 'vertical';
|
||||
|
||||
export const listProps = () => ({
|
||||
bordered: PropTypes.looseBool,
|
||||
bordered: { type: Boolean, default: undefined },
|
||||
dataSource: PropTypes.array,
|
||||
extra: PropTypes.any,
|
||||
grid: { type: Object as PropType<ListGridType>, default: undefined as ListGridType },
|
||||
|
@ -59,7 +59,7 @@ export const listProps = () => ({
|
|||
rowKey: [String, Number, Function] as PropType<Key | ((item: any) => Key)>,
|
||||
renderItem: PropTypes.any,
|
||||
size: String as PropType<ListSize>,
|
||||
split: PropTypes.looseBool,
|
||||
split: { type: Boolean, default: undefined },
|
||||
header: PropTypes.any,
|
||||
footer: PropTypes.any,
|
||||
locale: {
|
||||
|
|
|
@ -59,7 +59,7 @@ const LocaleProvider = defineComponent({
|
|||
locale: {
|
||||
type: Object as PropType<Locale>,
|
||||
},
|
||||
ANT_MARK__: PropTypes.string,
|
||||
ANT_MARK__: String,
|
||||
},
|
||||
setup(props, { slots }) {
|
||||
warning(
|
||||
|
|
|
@ -60,7 +60,7 @@ const getMentions = (value = '', config: MentionsConfig = {}): MentionsEntity[]
|
|||
|
||||
export const mentionsProps = {
|
||||
...baseMentionsProps,
|
||||
loading: PropTypes.looseBool,
|
||||
loading: { type: Boolean, default: undefined },
|
||||
onFocus: {
|
||||
type: Function as PropType<(e: FocusEvent) => void>,
|
||||
},
|
||||
|
|
|
@ -16,7 +16,7 @@ import useDestroyed from '../_util/hooks/useDestroyed';
|
|||
|
||||
export const pageHeaderProps = {
|
||||
backIcon: PropTypes.any,
|
||||
prefixCls: PropTypes.string,
|
||||
prefixCls: String,
|
||||
title: PropTypes.any,
|
||||
subTitle: PropTypes.any,
|
||||
breadcrumb: PropTypes.object,
|
||||
|
@ -24,8 +24,8 @@ export const pageHeaderProps = {
|
|||
footer: PropTypes.any,
|
||||
extra: PropTypes.any,
|
||||
avatar: PropTypes.object,
|
||||
ghost: PropTypes.looseBool,
|
||||
onBack: PropTypes.func,
|
||||
ghost: { type: Boolean, default: undefined },
|
||||
onBack: Function,
|
||||
};
|
||||
|
||||
export type PageHeaderProps = Partial<ExtractPropTypes<typeof pageHeaderProps>>;
|
||||
|
|
|
@ -24,7 +24,7 @@ import ActionButton from '../_util/ActionButton';
|
|||
|
||||
export const popconfirmProps = () => ({
|
||||
...abstractTooltipProps(),
|
||||
prefixCls: PropTypes.string,
|
||||
prefixCls: String,
|
||||
content: PropTypes.any,
|
||||
title: PropTypes.any,
|
||||
okType: {
|
||||
|
|
|
@ -9,7 +9,7 @@ import { getSuccessPercent, validProgress } from './utils';
|
|||
|
||||
export const lineProps = {
|
||||
...progressProps(),
|
||||
prefixCls: PropTypes.string,
|
||||
prefixCls: String,
|
||||
direction: {
|
||||
type: String as PropType<Direction>,
|
||||
},
|
||||
|
|
|
@ -7,12 +7,12 @@ import { progressProps } from './props';
|
|||
|
||||
export const stepsProps = {
|
||||
...progressProps(),
|
||||
steps: PropTypes.number,
|
||||
steps: Number,
|
||||
size: {
|
||||
type: String as PropType<ProgressSize>,
|
||||
},
|
||||
strokeColor: PropTypes.string,
|
||||
trailColor: PropTypes.string,
|
||||
strokeColor: String,
|
||||
trailColor: String,
|
||||
};
|
||||
|
||||
export type StepsProps = Partial<ExtractPropTypes<typeof stepsProps>>;
|
||||
|
|
|
@ -19,29 +19,29 @@ export interface SuccessProps {
|
|||
}
|
||||
|
||||
export const progressProps = () => ({
|
||||
prefixCls: PropTypes.string,
|
||||
prefixCls: String,
|
||||
type: PropTypes.oneOf(ProgressType),
|
||||
percent: PropTypes.number,
|
||||
percent: Number,
|
||||
format: { type: Function as PropType<(percent?: number, successPercent?: number) => VueNode> },
|
||||
status: PropTypes.oneOf(progressStatuses),
|
||||
showInfo: PropTypes.looseBool,
|
||||
strokeWidth: PropTypes.number,
|
||||
showInfo: { type: Boolean, default: undefined },
|
||||
strokeWidth: Number,
|
||||
strokeLinecap: PropTypes.oneOf(tuple('butt', 'round', 'square')),
|
||||
strokeColor: {
|
||||
type: [String, Object] as PropType<string | ProgressGradient>,
|
||||
},
|
||||
trailColor: PropTypes.string,
|
||||
width: PropTypes.number,
|
||||
trailColor: String,
|
||||
width: Number,
|
||||
success: {
|
||||
type: Object as PropType<SuccessProps>,
|
||||
default: (): SuccessProps => ({}),
|
||||
},
|
||||
gapDegree: PropTypes.number,
|
||||
gapDegree: Number,
|
||||
gapPosition: PropTypes.oneOf(tuple('top', 'bottom', 'left', 'right')),
|
||||
size: PropTypes.oneOf(ProgressSize),
|
||||
steps: PropTypes.number,
|
||||
steps: Number,
|
||||
/** @deprecated Use `success` instead */
|
||||
successPercent: PropTypes.number,
|
||||
successPercent: Number,
|
||||
title: String,
|
||||
});
|
||||
|
||||
|
|
|
@ -23,16 +23,16 @@ export type RadioGroupChildOption = {
|
|||
};
|
||||
|
||||
export const radioGroupProps = {
|
||||
prefixCls: PropTypes.string,
|
||||
prefixCls: String,
|
||||
value: PropTypes.any,
|
||||
size: PropTypes.oneOf(RadioGroupSizeTypes).def('default'),
|
||||
options: {
|
||||
type: Array as PropType<Array<string | RadioGroupChildOption | number>>,
|
||||
},
|
||||
disabled: PropTypes.looseBool,
|
||||
name: PropTypes.string,
|
||||
disabled: { type: Boolean, default: undefined },
|
||||
name: String,
|
||||
buttonStyle: PropTypes.string.def('outline'),
|
||||
id: PropTypes.string,
|
||||
id: String,
|
||||
optionType: PropTypes.oneOf(RadioGroupOptionTypes).def('default'),
|
||||
};
|
||||
|
||||
|
|
|
@ -8,18 +8,18 @@ import type { RadioChangeEvent, RadioGroupContext } from './interface';
|
|||
import { useInjectFormItemContext } from '../form/FormItemContext';
|
||||
|
||||
export const radioProps = {
|
||||
prefixCls: PropTypes.string,
|
||||
checked: PropTypes.looseBool,
|
||||
disabled: PropTypes.looseBool,
|
||||
isGroup: PropTypes.looseBool,
|
||||
prefixCls: String,
|
||||
checked: { type: Boolean, default: undefined },
|
||||
disabled: { type: Boolean, default: undefined },
|
||||
isGroup: { type: Boolean, default: undefined },
|
||||
value: PropTypes.any,
|
||||
name: PropTypes.string,
|
||||
id: PropTypes.string,
|
||||
autofocus: PropTypes.looseBool,
|
||||
onChange: PropTypes.func,
|
||||
onFocus: PropTypes.func,
|
||||
onBlur: PropTypes.func,
|
||||
onClick: PropTypes.func,
|
||||
name: String,
|
||||
id: String,
|
||||
autofocus: { type: Boolean, default: undefined },
|
||||
onChange: Function,
|
||||
onFocus: Function,
|
||||
onBlur: Function,
|
||||
onClick: Function,
|
||||
};
|
||||
|
||||
export type RadioProps = Partial<ExtractPropTypes<typeof radioProps>>;
|
||||
|
|
|
@ -4,17 +4,17 @@ import { getPropsSlot } from '../_util/props-util';
|
|||
import PropTypes from '../_util/vue-types';
|
||||
|
||||
export const starProps = {
|
||||
value: PropTypes.number,
|
||||
index: PropTypes.number,
|
||||
prefixCls: PropTypes.string,
|
||||
allowHalf: PropTypes.looseBool,
|
||||
disabled: PropTypes.looseBool,
|
||||
value: Number,
|
||||
index: Number,
|
||||
prefixCls: String,
|
||||
allowHalf: { type: Boolean, default: undefined },
|
||||
disabled: { type: Boolean, default: undefined },
|
||||
character: PropTypes.any,
|
||||
characterRender: PropTypes.func,
|
||||
focused: PropTypes.looseBool,
|
||||
count: PropTypes.number,
|
||||
onClick: PropTypes.func,
|
||||
onHover: PropTypes.func,
|
||||
characterRender: Function,
|
||||
focused: { type: Boolean, default: undefined },
|
||||
count: Number,
|
||||
onClick: Function,
|
||||
onHover: Function,
|
||||
};
|
||||
|
||||
export type StarProps = Partial<ExtractPropTypes<typeof starProps>>;
|
||||
|
|
|
@ -15,18 +15,18 @@ import useRefs from '../_util/hooks/useRefs';
|
|||
import { useInjectFormItemContext } from '../form/FormItemContext';
|
||||
|
||||
export const rateProps = {
|
||||
prefixCls: PropTypes.string,
|
||||
count: PropTypes.number,
|
||||
value: PropTypes.number,
|
||||
allowHalf: PropTypes.looseBool,
|
||||
allowClear: PropTypes.looseBool,
|
||||
prefixCls: String,
|
||||
count: Number,
|
||||
value: Number,
|
||||
allowHalf: { type: Boolean, default: undefined },
|
||||
allowClear: { type: Boolean, default: undefined },
|
||||
tooltips: PropTypes.arrayOf(PropTypes.string),
|
||||
disabled: PropTypes.looseBool,
|
||||
disabled: { type: Boolean, default: undefined },
|
||||
character: PropTypes.any,
|
||||
autofocus: PropTypes.looseBool,
|
||||
autofocus: { type: Boolean, default: undefined },
|
||||
tabindex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
||||
direction: PropTypes.string,
|
||||
id: PropTypes.string,
|
||||
direction: String,
|
||||
id: String,
|
||||
};
|
||||
|
||||
export type RateProps = Partial<ExtractPropTypes<typeof rateProps>>;
|
||||
|
|
|
@ -29,7 +29,7 @@ export const ExceptionMap = {
|
|||
const ExceptionStatus = Object.keys(ExceptionMap);
|
||||
|
||||
export const resultProps = {
|
||||
prefixCls: PropTypes.string,
|
||||
prefixCls: String,
|
||||
icon: PropTypes.any,
|
||||
status: PropTypes.oneOf(tuple('success', 'error', 'info', 'warning', '404', '403', '500')).def(
|
||||
'info',
|
||||
|
|
|
@ -15,13 +15,13 @@ const spaceSize = {
|
|||
large: 24,
|
||||
};
|
||||
export const spaceProps = {
|
||||
prefixCls: PropTypes.string,
|
||||
prefixCls: String,
|
||||
size: {
|
||||
type: [String, Number, Array] as PropType<SpaceSize | [SpaceSize, SpaceSize]>,
|
||||
},
|
||||
direction: PropTypes.oneOf(tuple('horizontal', 'vertical')).def('horizontal'),
|
||||
align: PropTypes.oneOf(tuple('start', 'end', 'center', 'baseline')),
|
||||
wrap: PropTypes.looseBool,
|
||||
wrap: { type: Boolean, default: undefined },
|
||||
};
|
||||
|
||||
export type SpaceProps = Partial<ExtractPropTypes<typeof spaceProps>>;
|
||||
|
|
|
@ -11,12 +11,12 @@ import { defaultConfigProvider } from '../config-provider';
|
|||
export const SpinSize = PropTypes.oneOf(tuple('small', 'default', 'large'));
|
||||
|
||||
export const spinProps = () => ({
|
||||
prefixCls: PropTypes.string,
|
||||
spinning: PropTypes.looseBool,
|
||||
prefixCls: String,
|
||||
spinning: { type: Boolean, default: undefined },
|
||||
size: SpinSize,
|
||||
wrapperClassName: PropTypes.string,
|
||||
wrapperClassName: String,
|
||||
tip: PropTypes.any,
|
||||
delay: PropTypes.number,
|
||||
delay: Number,
|
||||
indicator: PropTypes.any,
|
||||
});
|
||||
|
||||
|
|
|
@ -8,22 +8,22 @@ import Skeleton from '../skeleton/Skeleton';
|
|||
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||
|
||||
export const statisticProps = {
|
||||
prefixCls: PropTypes.string,
|
||||
decimalSeparator: PropTypes.string,
|
||||
groupSeparator: PropTypes.string,
|
||||
format: PropTypes.string,
|
||||
prefixCls: String,
|
||||
decimalSeparator: String,
|
||||
groupSeparator: String,
|
||||
format: String,
|
||||
value: {
|
||||
type: [String, Number, Object] as PropType<countdownValueType>,
|
||||
},
|
||||
valueStyle: PropTypes.style,
|
||||
valueRender: PropTypes.any,
|
||||
formatter: PropTypes.any,
|
||||
precision: PropTypes.number,
|
||||
precision: Number,
|
||||
prefix: PropTypes.any,
|
||||
suffix: PropTypes.any,
|
||||
title: PropTypes.any,
|
||||
onFinish: PropTypes.func,
|
||||
loading: PropTypes.looseBool,
|
||||
onFinish: Function,
|
||||
loading: { type: Boolean, default: undefined },
|
||||
};
|
||||
|
||||
export type StatisticProps = Partial<ExtractPropTypes<typeof statisticProps>>;
|
||||
|
|
|
@ -14,15 +14,15 @@ import omit from '../_util/omit';
|
|||
export const SwitchSizes = tuple('small', 'default');
|
||||
type CheckedType = boolean | string | number;
|
||||
export const switchProps = {
|
||||
id: PropTypes.string,
|
||||
prefixCls: PropTypes.string,
|
||||
id: String,
|
||||
prefixCls: String,
|
||||
size: PropTypes.oneOf(SwitchSizes),
|
||||
disabled: PropTypes.looseBool,
|
||||
disabled: { type: Boolean, default: undefined },
|
||||
checkedChildren: PropTypes.any,
|
||||
unCheckedChildren: PropTypes.any,
|
||||
tabindex: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
||||
autofocus: PropTypes.looseBool,
|
||||
loading: PropTypes.looseBool,
|
||||
autofocus: { type: Boolean, default: undefined },
|
||||
loading: { type: Boolean, default: undefined },
|
||||
checked: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.looseBool]),
|
||||
checkedValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.looseBool]).def(
|
||||
true,
|
||||
|
|
|
@ -7,8 +7,8 @@ import useConfigInject from '../_util/hooks/useConfigInject';
|
|||
const CheckableTag = defineComponent({
|
||||
name: 'ACheckableTag',
|
||||
props: {
|
||||
prefixCls: PropTypes.string,
|
||||
checked: PropTypes.looseBool,
|
||||
prefixCls: String,
|
||||
checked: { type: Boolean, default: undefined },
|
||||
onChange: {
|
||||
type: Function as PropType<(checked: boolean) => void>,
|
||||
},
|
||||
|
|
|
@ -14,13 +14,13 @@ const PresetColorRegex = new RegExp(`^(${PresetColorTypes.join('|')})(-inverse)?
|
|||
const PresetStatusColorRegex = new RegExp(`^(${PresetStatusColorTypes.join('|')})$`);
|
||||
|
||||
export const tagProps = {
|
||||
prefixCls: PropTypes.string,
|
||||
prefixCls: String,
|
||||
color: {
|
||||
type: String as PropType<LiteralUnion<PresetColorType | PresetStatusColorType, string>>,
|
||||
},
|
||||
closable: PropTypes.looseBool.def(false),
|
||||
closeIcon: PropTypes.any,
|
||||
visible: PropTypes.looseBool,
|
||||
visible: { type: Boolean, default: undefined },
|
||||
onClose: {
|
||||
type: Function as PropType<(e: MouseEvent) => void>,
|
||||
},
|
||||
|
|
|
@ -10,11 +10,11 @@ import { tuple } from '../_util/type';
|
|||
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||
|
||||
export const timelineProps = () => ({
|
||||
prefixCls: PropTypes.string,
|
||||
prefixCls: String,
|
||||
/** 指定最后一个幽灵节点是否存在或内容 */
|
||||
pending: PropTypes.any,
|
||||
pendingDot: PropTypes.any,
|
||||
reverse: PropTypes.looseBool,
|
||||
reverse: { type: Boolean, default: undefined },
|
||||
mode: PropTypes.oneOf(tuple('left', 'alternate', 'right', '')),
|
||||
});
|
||||
|
||||
|
|
|
@ -7,10 +7,10 @@ import { tuple } from '../_util/type';
|
|||
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||
|
||||
export const timelineItemProps = () => ({
|
||||
prefixCls: PropTypes.string,
|
||||
color: PropTypes.string,
|
||||
prefixCls: String,
|
||||
color: String,
|
||||
dot: PropTypes.any,
|
||||
pending: PropTypes.looseBool,
|
||||
pending: { type: Boolean, default: undefined },
|
||||
position: PropTypes.oneOf(tuple('left', 'right', '')).def(''),
|
||||
label: PropTypes.any,
|
||||
});
|
||||
|
|
|
@ -22,24 +22,24 @@ export default () => ({
|
|||
PropTypes.oneOf(triggerTypes),
|
||||
PropTypes.arrayOf(PropTypes.oneOf(triggerTypes)),
|
||||
]),
|
||||
visible: PropTypes.looseBool,
|
||||
defaultVisible: PropTypes.looseBool,
|
||||
visible: { type: Boolean, default: undefined },
|
||||
defaultVisible: { type: Boolean, default: undefined },
|
||||
placement: PropTypes.oneOf(placementTypes),
|
||||
color: PropTypes.string,
|
||||
transitionName: PropTypes.string,
|
||||
color: String,
|
||||
transitionName: String,
|
||||
overlayStyle: PropTypes.style,
|
||||
overlayClassName: PropTypes.string,
|
||||
openClassName: PropTypes.string,
|
||||
prefixCls: PropTypes.string,
|
||||
mouseEnterDelay: PropTypes.number,
|
||||
mouseLeaveDelay: PropTypes.number,
|
||||
getPopupContainer: PropTypes.func,
|
||||
arrowPointAtCenter: PropTypes.looseBool,
|
||||
overlayClassName: String,
|
||||
openClassName: String,
|
||||
prefixCls: String,
|
||||
mouseEnterDelay: Number,
|
||||
mouseLeaveDelay: Number,
|
||||
getPopupContainer: Function,
|
||||
arrowPointAtCenter: { type: Boolean, default: undefined },
|
||||
autoAdjustOverflow: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object]),
|
||||
destroyTooltipOnHide: PropTypes.looseBool,
|
||||
destroyTooltipOnHide: { type: Boolean, default: undefined },
|
||||
align: PropTypes.object,
|
||||
builtinPlacements: PropTypes.object,
|
||||
children: PropTypes.array,
|
||||
onVisibleChange: PropTypes.func,
|
||||
'onUpdate:visible': PropTypes.func,
|
||||
onVisibleChange: Function,
|
||||
'onUpdate:visible': Function,
|
||||
});
|
||||
|
|
|
@ -7,15 +7,15 @@ import PropTypes from '../_util/vue-types';
|
|||
import type { TransferItem } from '.';
|
||||
|
||||
export const transferListBodyProps = {
|
||||
prefixCls: PropTypes.string,
|
||||
prefixCls: String,
|
||||
filteredRenderItems: PropTypes.array.def([]),
|
||||
selectedKeys: PropTypes.array,
|
||||
disabled: PropTypes.looseBool,
|
||||
showRemove: PropTypes.looseBool,
|
||||
disabled: { type: Boolean, default: undefined },
|
||||
showRemove: { type: Boolean, default: undefined },
|
||||
pagination: PropTypes.any,
|
||||
onItemSelect: PropTypes.func,
|
||||
onScroll: PropTypes.func,
|
||||
onItemRemove: PropTypes.func,
|
||||
onItemSelect: Function,
|
||||
onScroll: Function,
|
||||
onItemRemove: Function,
|
||||
};
|
||||
|
||||
export type TransferListBodyProps = Partial<ExtractPropTypes<typeof transferListBodyProps>>;
|
||||
|
|
|
@ -15,12 +15,12 @@ export const transferListItemProps = {
|
|||
renderedText: PropTypes.any,
|
||||
renderedEl: PropTypes.any,
|
||||
item: PropTypes.any,
|
||||
checked: PropTypes.looseBool,
|
||||
prefixCls: PropTypes.string,
|
||||
disabled: PropTypes.looseBool,
|
||||
showRemove: PropTypes.looseBool,
|
||||
onClick: PropTypes.func,
|
||||
onRemove: PropTypes.func,
|
||||
checked: { type: Boolean, default: undefined },
|
||||
prefixCls: String,
|
||||
disabled: { type: Boolean, default: undefined },
|
||||
showRemove: { type: Boolean, default: undefined },
|
||||
onClick: Function,
|
||||
onRemove: Function,
|
||||
};
|
||||
|
||||
export type TransferListItemProps = Partial<ExtractPropTypes<typeof transferListItemProps>>;
|
||||
|
|
|
@ -27,36 +27,36 @@ function getEnabledItemKeys<RecordType extends TransferItem>(items: RecordType[]
|
|||
}
|
||||
|
||||
export const transferListProps = {
|
||||
prefixCls: PropTypes.string,
|
||||
prefixCls: String,
|
||||
dataSource: { type: Array as PropType<TransferItem[]>, default: [] },
|
||||
filter: PropTypes.string,
|
||||
filterOption: PropTypes.func,
|
||||
filter: String,
|
||||
filterOption: Function,
|
||||
checkedKeys: PropTypes.arrayOf(PropTypes.string),
|
||||
handleFilter: PropTypes.func,
|
||||
handleClear: PropTypes.func,
|
||||
renderItem: PropTypes.func,
|
||||
handleFilter: Function,
|
||||
handleClear: Function,
|
||||
renderItem: Function,
|
||||
showSearch: PropTypes.looseBool.def(false),
|
||||
searchPlaceholder: PropTypes.string,
|
||||
searchPlaceholder: String,
|
||||
notFoundContent: PropTypes.any,
|
||||
itemUnit: PropTypes.string,
|
||||
itemsUnit: PropTypes.string,
|
||||
itemUnit: String,
|
||||
itemsUnit: String,
|
||||
renderList: PropTypes.any,
|
||||
disabled: PropTypes.looseBool,
|
||||
disabled: { type: Boolean, default: undefined },
|
||||
direction: String as PropType<TransferDirection>,
|
||||
showSelectAll: PropTypes.looseBool,
|
||||
remove: PropTypes.string,
|
||||
selectAll: PropTypes.string,
|
||||
selectCurrent: PropTypes.string,
|
||||
selectInvert: PropTypes.string,
|
||||
removeAll: PropTypes.string,
|
||||
removeCurrent: PropTypes.string,
|
||||
showSelectAll: { type: Boolean, default: undefined },
|
||||
remove: String,
|
||||
selectAll: String,
|
||||
selectCurrent: String,
|
||||
selectInvert: String,
|
||||
removeAll: String,
|
||||
removeCurrent: String,
|
||||
selectAllLabel: PropTypes.any,
|
||||
showRemove: PropTypes.looseBool,
|
||||
showRemove: { type: Boolean, default: undefined },
|
||||
pagination: PropTypes.any,
|
||||
onItemSelect: PropTypes.func,
|
||||
onItemSelectAll: PropTypes.func,
|
||||
onItemRemove: PropTypes.func,
|
||||
onScroll: PropTypes.func,
|
||||
onItemSelect: Function,
|
||||
onItemSelectAll: Function,
|
||||
onItemRemove: Function,
|
||||
onScroll: Function,
|
||||
};
|
||||
|
||||
export type TransferListProps = Partial<ExtractPropTypes<typeof transferListProps>>;
|
||||
|
|
|
@ -7,12 +7,12 @@ import { defineComponent } from 'vue';
|
|||
import type { ChangeEvent } from '../_util/EventInterface';
|
||||
|
||||
export const transferSearchProps = {
|
||||
prefixCls: PropTypes.string,
|
||||
placeholder: PropTypes.string,
|
||||
value: PropTypes.string,
|
||||
handleClear: PropTypes.func,
|
||||
disabled: PropTypes.looseBool,
|
||||
onChange: PropTypes.func,
|
||||
prefixCls: String,
|
||||
placeholder: String,
|
||||
value: String,
|
||||
handleClear: Function,
|
||||
disabled: { type: Boolean, default: undefined },
|
||||
onChange: Function,
|
||||
};
|
||||
|
||||
export type TransferSearchProps = Partial<ExtractPropTypes<typeof transferSearchProps>>;
|
||||
|
|
|
@ -120,7 +120,7 @@ export const treeProps = () => {
|
|||
showIcon: { type: Boolean, default: undefined },
|
||||
icon: { type: Function as PropType<(nodeProps: AntdTreeNodeAttribute) => any> },
|
||||
switcherIcon: PropTypes.any,
|
||||
prefixCls: PropTypes.string,
|
||||
prefixCls: String,
|
||||
/**
|
||||
* @default{title,key,children}
|
||||
* deprecated, please use `fieldNames` instead
|
||||
|
|
|
@ -577,18 +577,18 @@ const Base = defineComponent<InternalBlockProps>({
|
|||
export const baseProps = () => ({
|
||||
editable: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object]),
|
||||
copyable: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object]),
|
||||
prefixCls: PropTypes.string,
|
||||
component: PropTypes.string,
|
||||
prefixCls: String,
|
||||
component: String,
|
||||
type: PropTypes.oneOf(['secondary', 'success', 'danger', 'warning']),
|
||||
disabled: PropTypes.looseBool,
|
||||
disabled: { type: Boolean, default: undefined },
|
||||
ellipsis: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object]),
|
||||
code: PropTypes.looseBool,
|
||||
mark: PropTypes.looseBool,
|
||||
underline: PropTypes.looseBool,
|
||||
delete: PropTypes.looseBool,
|
||||
strong: PropTypes.looseBool,
|
||||
keyboard: PropTypes.looseBool,
|
||||
content: PropTypes.string,
|
||||
code: { type: Boolean, default: undefined },
|
||||
mark: { type: Boolean, default: undefined },
|
||||
underline: { type: Boolean, default: undefined },
|
||||
delete: { type: Boolean, default: undefined },
|
||||
strong: { type: Boolean, default: undefined },
|
||||
keyboard: { type: Boolean, default: undefined },
|
||||
content: String,
|
||||
});
|
||||
|
||||
Base.props = baseProps();
|
||||
|
|
|
@ -9,15 +9,15 @@ import type { Direction } from '../config-provider';
|
|||
const Editable = defineComponent({
|
||||
name: 'Editable',
|
||||
props: {
|
||||
prefixCls: PropTypes.string,
|
||||
value: PropTypes.string,
|
||||
maxlength: PropTypes.number,
|
||||
prefixCls: String,
|
||||
value: String,
|
||||
maxlength: Number,
|
||||
autoSize: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object]),
|
||||
onSave: PropTypes.func,
|
||||
onCancel: PropTypes.func,
|
||||
onEnd: PropTypes.func,
|
||||
onChange: PropTypes.func,
|
||||
originContent: PropTypes.string,
|
||||
onSave: Function,
|
||||
onCancel: Function,
|
||||
onEnd: Function,
|
||||
onChange: Function,
|
||||
originContent: String,
|
||||
direction: String as PropType<Direction>,
|
||||
},
|
||||
emits: ['save', 'cancel', 'end', 'change'],
|
||||
|
|
|
@ -44,8 +44,8 @@ const Typography = defineComponent<InternalTypographyProps>({
|
|||
});
|
||||
|
||||
Typography.props = {
|
||||
prefixCls: PropTypes.string,
|
||||
component: PropTypes.string,
|
||||
prefixCls: String,
|
||||
component: String,
|
||||
};
|
||||
|
||||
export default Typography;
|
||||
|
|
|
@ -4,14 +4,14 @@ import getDialogPropTypes from './IDialogPropTypes';
|
|||
import Portal from '../_util/PortalWrapper';
|
||||
import { defineComponent, ref, watch } from 'vue';
|
||||
import { useProvidePortal } from '../vc-trigger/context';
|
||||
import { initDefaultProps } from '../_util/props-util';
|
||||
const IDialogPropTypes = getDialogPropTypes();
|
||||
const DialogWrap = defineComponent({
|
||||
name: 'DialogWrap',
|
||||
inheritAttrs: false,
|
||||
props: {
|
||||
...IDialogPropTypes,
|
||||
visible: IDialogPropTypes.visible.def(false),
|
||||
},
|
||||
props: initDefaultProps(IDialogPropTypes, {
|
||||
visible: false,
|
||||
}),
|
||||
setup(props, { attrs, slots }) {
|
||||
const animatedVisible = ref(props.visible);
|
||||
useProvidePortal({}, { inTriggerContext: false });
|
||||
|
|
|
@ -3,45 +3,45 @@ import PropTypes from '../_util/vue-types';
|
|||
|
||||
function dialogPropTypes() {
|
||||
return {
|
||||
keyboard: PropTypes.looseBool,
|
||||
mask: PropTypes.looseBool,
|
||||
afterClose: PropTypes.func,
|
||||
closable: PropTypes.looseBool,
|
||||
maskClosable: PropTypes.looseBool,
|
||||
visible: PropTypes.looseBool,
|
||||
destroyOnClose: PropTypes.looseBool,
|
||||
keyboard: { type: Boolean, default: undefined },
|
||||
mask: { type: Boolean, default: undefined },
|
||||
afterClose: Function,
|
||||
closable: { type: Boolean, default: undefined },
|
||||
maskClosable: { type: Boolean, default: undefined },
|
||||
visible: { type: Boolean, default: undefined },
|
||||
destroyOnClose: { type: Boolean, default: undefined },
|
||||
mousePosition: PropTypes.shape({
|
||||
x: PropTypes.number,
|
||||
y: PropTypes.number,
|
||||
x: Number,
|
||||
y: Number,
|
||||
}).loose,
|
||||
title: PropTypes.any,
|
||||
footer: PropTypes.any,
|
||||
transitionName: PropTypes.string,
|
||||
maskTransitionName: PropTypes.string,
|
||||
transitionName: String,
|
||||
maskTransitionName: String,
|
||||
animation: PropTypes.any,
|
||||
maskAnimation: PropTypes.any,
|
||||
wrapStyle: PropTypes.object,
|
||||
bodyStyle: PropTypes.object,
|
||||
maskStyle: PropTypes.object,
|
||||
prefixCls: PropTypes.string,
|
||||
wrapClassName: PropTypes.string,
|
||||
prefixCls: String,
|
||||
wrapClassName: String,
|
||||
width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
||||
height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
||||
zIndex: PropTypes.number,
|
||||
zIndex: Number,
|
||||
bodyProps: PropTypes.any,
|
||||
maskProps: PropTypes.any,
|
||||
wrapProps: PropTypes.any,
|
||||
getContainer: PropTypes.any,
|
||||
dialogStyle: PropTypes.object,
|
||||
dialogClass: PropTypes.string,
|
||||
dialogClass: String,
|
||||
closeIcon: PropTypes.any,
|
||||
forceRender: PropTypes.looseBool,
|
||||
getOpenCount: PropTypes.func,
|
||||
forceRender: { type: Boolean, default: undefined },
|
||||
getOpenCount: Function,
|
||||
// https://github.com/ant-design/ant-design/issues/19771
|
||||
// https://github.com/react-component/dialog/issues/95
|
||||
focusTriggerAfterClose: PropTypes.looseBool,
|
||||
onClose: PropTypes.func,
|
||||
modalRender: PropTypes.func,
|
||||
focusTriggerAfterClose: { type: Boolean, default: undefined },
|
||||
onClose: Function,
|
||||
modalRender: Function,
|
||||
};
|
||||
}
|
||||
export type IDialogChildProps = Partial<ExtractPropTypes<ReturnType<typeof dialogPropTypes>>>;
|
||||
|
|
|
@ -4,36 +4,36 @@ import type { PropType } from 'vue';
|
|||
export type IPlacement = 'left' | 'top' | 'right' | 'bottom';
|
||||
type ILevelMove = number | [number, number];
|
||||
const props = () => ({
|
||||
prefixCls: PropTypes.string,
|
||||
prefixCls: String,
|
||||
width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
||||
height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
||||
style: PropTypes.style,
|
||||
class: PropTypes.string,
|
||||
class: String,
|
||||
placement: {
|
||||
type: String as PropType<IPlacement>,
|
||||
},
|
||||
wrapperClassName: PropTypes.string,
|
||||
wrapperClassName: String,
|
||||
level: { type: [String, Array] as PropType<string | string[]> },
|
||||
levelMove: {
|
||||
type: [Number, Function, Array] as PropType<
|
||||
ILevelMove | ((e: { target: HTMLElement; open: boolean }) => ILevelMove)
|
||||
>,
|
||||
},
|
||||
duration: PropTypes.string,
|
||||
ease: PropTypes.string,
|
||||
showMask: PropTypes.looseBool,
|
||||
maskClosable: PropTypes.looseBool,
|
||||
duration: String,
|
||||
ease: String,
|
||||
showMask: { type: Boolean, default: undefined },
|
||||
maskClosable: { type: Boolean, default: undefined },
|
||||
maskStyle: PropTypes.style,
|
||||
afterVisibleChange: PropTypes.func,
|
||||
keyboard: PropTypes.looseBool,
|
||||
afterVisibleChange: Function,
|
||||
keyboard: { type: Boolean, default: undefined },
|
||||
contentWrapperStyle: PropTypes.style,
|
||||
autofocus: PropTypes.looseBool,
|
||||
open: PropTypes.looseBool,
|
||||
autofocus: { type: Boolean, default: undefined },
|
||||
open: { type: Boolean, default: undefined },
|
||||
});
|
||||
|
||||
const drawerProps = () => ({
|
||||
...props(),
|
||||
forceRender: PropTypes.looseBool,
|
||||
forceRender: { type: Boolean, default: undefined },
|
||||
getContainer: PropTypes.oneOfType([
|
||||
PropTypes.string,
|
||||
PropTypes.func,
|
||||
|
@ -44,10 +44,10 @@ const drawerProps = () => ({
|
|||
|
||||
const drawerChildProps = () => ({
|
||||
...props(),
|
||||
getContainer: PropTypes.func,
|
||||
getOpenCount: PropTypes.func,
|
||||
getContainer: Function,
|
||||
getOpenCount: Function,
|
||||
scrollLocker: PropTypes.any,
|
||||
switchScrollingEffect: PropTypes.func,
|
||||
switchScrollingEffect: Function,
|
||||
});
|
||||
|
||||
export { drawerProps, drawerChildProps };
|
||||
|
|
|
@ -7,12 +7,12 @@ import classNames from '../_util/classNames';
|
|||
|
||||
export default defineComponent({
|
||||
props: {
|
||||
minOverlayWidthMatchTrigger: PropTypes.looseBool,
|
||||
minOverlayWidthMatchTrigger: { type: Boolean, default: undefined },
|
||||
arrow: PropTypes.looseBool.def(false),
|
||||
prefixCls: PropTypes.string.def('rc-dropdown'),
|
||||
transitionName: PropTypes.string,
|
||||
transitionName: String,
|
||||
overlayClassName: PropTypes.string.def(''),
|
||||
openClassName: PropTypes.string,
|
||||
openClassName: String,
|
||||
animation: PropTypes.any,
|
||||
align: PropTypes.object,
|
||||
overlayStyle: PropTypes.style,
|
||||
|
@ -21,11 +21,11 @@ export default defineComponent({
|
|||
trigger: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]).def(
|
||||
'hover',
|
||||
),
|
||||
alignPoint: PropTypes.looseBool,
|
||||
alignPoint: { type: Boolean, default: undefined },
|
||||
showAction: PropTypes.array,
|
||||
hideAction: PropTypes.array,
|
||||
getPopupContainer: PropTypes.func,
|
||||
visible: PropTypes.looseBool,
|
||||
getPopupContainer: Function,
|
||||
visible: { type: Boolean, default: undefined },
|
||||
defaultVisible: PropTypes.looseBool.def(false),
|
||||
mouseEnterDelay: PropTypes.number.def(0.15),
|
||||
mouseLeaveDelay: PropTypes.number.def(0.1),
|
||||
|
|
|
@ -33,8 +33,8 @@ const initialPosition = {
|
|||
y: 0,
|
||||
};
|
||||
const PreviewType = {
|
||||
src: PropTypes.string,
|
||||
alt: PropTypes.string,
|
||||
src: String,
|
||||
alt: String,
|
||||
...IDialogPropTypes,
|
||||
};
|
||||
const Preview = defineComponent({
|
||||
|
|
|
@ -43,17 +43,17 @@ const BUILT_IN_PLACEMENTS = {
|
|||
export default defineComponent({
|
||||
name: 'KeywordTrigger',
|
||||
props: {
|
||||
loading: PropTypes.looseBool,
|
||||
loading: { type: Boolean, default: undefined },
|
||||
options: {
|
||||
type: Array as PropType<OptionProps[]>,
|
||||
default: () => [],
|
||||
},
|
||||
prefixCls: PropTypes.string,
|
||||
placement: PropTypes.string,
|
||||
visible: PropTypes.looseBool,
|
||||
transitionName: PropTypes.string,
|
||||
getPopupContainer: PropTypes.func,
|
||||
direction: PropTypes.string,
|
||||
prefixCls: String,
|
||||
placement: String,
|
||||
visible: { type: Boolean, default: undefined },
|
||||
transitionName: String,
|
||||
getPopupContainer: Function,
|
||||
direction: String,
|
||||
},
|
||||
slots: ['notFoundContent', 'option'],
|
||||
setup(props, { slots }) {
|
||||
|
|
|
@ -12,20 +12,20 @@ export const PlaceMent = tuple('top', 'bottom');
|
|||
export type Direction = 'ltr' | 'rtl';
|
||||
|
||||
export const mentionsProps = {
|
||||
autofocus: PropTypes.looseBool,
|
||||
autofocus: { type: Boolean, default: undefined },
|
||||
prefix: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),
|
||||
prefixCls: PropTypes.string,
|
||||
value: PropTypes.string,
|
||||
disabled: PropTypes.looseBool,
|
||||
split: PropTypes.string,
|
||||
transitionName: PropTypes.string,
|
||||
prefixCls: String,
|
||||
value: String,
|
||||
disabled: { type: Boolean, default: undefined },
|
||||
split: String,
|
||||
transitionName: String,
|
||||
placement: PropTypes.oneOf(PlaceMent),
|
||||
character: PropTypes.any,
|
||||
characterRender: PropTypes.func,
|
||||
characterRender: Function,
|
||||
filterOption: {
|
||||
type: [Boolean, Function] as PropType<typeof defaultFilterOption | false>,
|
||||
},
|
||||
validateSearch: PropTypes.func,
|
||||
validateSearch: Function,
|
||||
getPopupContainer: {
|
||||
type: Function as PropType<() => HTMLElement>,
|
||||
},
|
||||
|
@ -33,7 +33,7 @@ export const mentionsProps = {
|
|||
type: Array as PropType<OptionProps>,
|
||||
default: () => undefined,
|
||||
},
|
||||
loading: PropTypes.looseBool,
|
||||
loading: { type: Boolean, default: undefined },
|
||||
rows: [Number, String],
|
||||
direction: { type: String as PropType<Direction> },
|
||||
};
|
||||
|
|
|
@ -6,17 +6,17 @@ import type { EventHandler } from '../_util/EventInterface';
|
|||
|
||||
export default defineComponent({
|
||||
props: {
|
||||
disabled: PropTypes.looseBool,
|
||||
changeSize: PropTypes.func,
|
||||
quickGo: PropTypes.func,
|
||||
disabled: { type: Boolean, default: undefined },
|
||||
changeSize: Function,
|
||||
quickGo: Function,
|
||||
selectComponentClass: PropTypes.any,
|
||||
current: PropTypes.number,
|
||||
current: Number,
|
||||
pageSizeOptions: PropTypes.array.def(['10', '20', '50', '100']),
|
||||
pageSize: PropTypes.number,
|
||||
buildOptionText: PropTypes.func,
|
||||
pageSize: Number,
|
||||
buildOptionText: Function,
|
||||
locale: PropTypes.object,
|
||||
rootPrefixCls: PropTypes.string,
|
||||
selectPrefixCls: PropTypes.string,
|
||||
rootPrefixCls: String,
|
||||
selectPrefixCls: String,
|
||||
goButton: PropTypes.any,
|
||||
},
|
||||
setup(props) {
|
||||
|
|
|
@ -6,12 +6,12 @@ export default defineComponent({
|
|||
name: 'Pager',
|
||||
inheritAttrs: false,
|
||||
props: {
|
||||
rootPrefixCls: PropTypes.string,
|
||||
page: PropTypes.number,
|
||||
active: PropTypes.looseBool,
|
||||
last: PropTypes.looseBool,
|
||||
rootPrefixCls: String,
|
||||
page: Number,
|
||||
active: { type: Boolean, default: undefined },
|
||||
last: { type: Boolean, default: undefined },
|
||||
locale: PropTypes.object,
|
||||
showTitle: PropTypes.looseBool,
|
||||
showTitle: { type: Boolean, default: undefined },
|
||||
itemRender: {
|
||||
type: Function,
|
||||
default: () => {},
|
||||
|
|
|
@ -30,16 +30,16 @@ export default defineComponent({
|
|||
mixins: [BaseMixin],
|
||||
inheritAttrs: false,
|
||||
props: {
|
||||
disabled: PropTypes.looseBool,
|
||||
disabled: { type: Boolean, default: undefined },
|
||||
prefixCls: PropTypes.string.def('rc-pagination'),
|
||||
selectPrefixCls: PropTypes.string.def('rc-select'),
|
||||
current: PropTypes.number,
|
||||
current: Number,
|
||||
defaultCurrent: PropTypes.number.def(1),
|
||||
total: PropTypes.number.def(0),
|
||||
pageSize: PropTypes.number,
|
||||
pageSize: Number,
|
||||
defaultPageSize: PropTypes.number.def(10),
|
||||
hideOnSinglePage: PropTypes.looseBool.def(false),
|
||||
showSizeChanger: PropTypes.looseBool,
|
||||
showSizeChanger: { type: Boolean, default: undefined },
|
||||
showLessItems: PropTypes.looseBool.def(false),
|
||||
// showSizeChange: PropTypes.func.def(noop),
|
||||
selectComponentClass: PropTypes.any,
|
||||
|
@ -47,9 +47,9 @@ export default defineComponent({
|
|||
showQuickJumper: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object]).def(false),
|
||||
showTitle: PropTypes.looseBool.def(true),
|
||||
pageSizeOptions: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),
|
||||
buildOptionText: PropTypes.func,
|
||||
showTotal: PropTypes.func,
|
||||
simple: PropTypes.looseBool,
|
||||
buildOptionText: Function,
|
||||
showTotal: Function,
|
||||
simple: { type: Boolean, default: undefined },
|
||||
locale: PropTypes.object.def(LOCALE),
|
||||
itemRender: PropTypes.func.def(defaultItemRender),
|
||||
prevIcon: PropTypes.any,
|
||||
|
|
|
@ -8,24 +8,24 @@ export type GapPositionType = 'top' | 'right' | 'bottom' | 'left';
|
|||
export type StrokeLinecapType = 'round' | 'butt' | 'square';
|
||||
|
||||
export const propTypes = {
|
||||
gapDegree: PropTypes.number,
|
||||
gapDegree: Number,
|
||||
gapPosition: {
|
||||
type: String as PropType<GapPositionType>,
|
||||
},
|
||||
percent: {
|
||||
type: [Array, Number] as PropType<number | number[]>,
|
||||
},
|
||||
prefixCls: PropTypes.string,
|
||||
prefixCls: String,
|
||||
strokeColor: {
|
||||
type: [Object, String, Array] as PropType<StrokeColorType>,
|
||||
},
|
||||
strokeLinecap: {
|
||||
type: String as PropType<StrokeLinecapType>,
|
||||
},
|
||||
strokeWidth: PropTypes.number,
|
||||
trailColor: PropTypes.string,
|
||||
trailWidth: PropTypes.number,
|
||||
transition: PropTypes.string,
|
||||
strokeWidth: Number,
|
||||
trailColor: String,
|
||||
trailWidth: Number,
|
||||
transition: String,
|
||||
};
|
||||
|
||||
export type ProgressProps = Partial<ExtractPropTypes<typeof propTypes>>;
|
||||
|
|
|
@ -84,26 +84,26 @@ const SelectTrigger = defineComponent<SelectTriggerProps, { popupRef: any }>({
|
|||
inheritAttrs: false,
|
||||
props: {
|
||||
dropdownAlign: PropTypes.object,
|
||||
visible: PropTypes.looseBool,
|
||||
disabled: PropTypes.looseBool,
|
||||
dropdownClassName: PropTypes.string,
|
||||
visible: { type: Boolean, default: undefined },
|
||||
disabled: { type: Boolean, default: undefined },
|
||||
dropdownClassName: String,
|
||||
dropdownStyle: PropTypes.object,
|
||||
placement: PropTypes.string,
|
||||
empty: PropTypes.looseBool,
|
||||
autoAdjustOverflow: PropTypes.looseBool,
|
||||
prefixCls: PropTypes.string,
|
||||
popupClassName: PropTypes.string,
|
||||
animation: PropTypes.string,
|
||||
transitionName: PropTypes.string,
|
||||
getPopupContainer: PropTypes.func,
|
||||
dropdownRender: PropTypes.func,
|
||||
containerWidth: PropTypes.number,
|
||||
placement: String,
|
||||
empty: { type: Boolean, default: undefined },
|
||||
autoAdjustOverflow: { type: Boolean, default: undefined },
|
||||
prefixCls: String,
|
||||
popupClassName: String,
|
||||
animation: String,
|
||||
transitionName: String,
|
||||
getPopupContainer: Function,
|
||||
dropdownRender: Function,
|
||||
containerWidth: Number,
|
||||
dropdownMatchSelectWidth: PropTypes.oneOfType([Number, Boolean]).def(true),
|
||||
popupElement: PropTypes.any,
|
||||
direction: PropTypes.string,
|
||||
getTriggerDOMNode: PropTypes.func,
|
||||
onPopupVisibleChange: PropTypes.func,
|
||||
onPopupMouseEnter: PropTypes.func,
|
||||
direction: String,
|
||||
getTriggerDOMNode: Function,
|
||||
onPopupVisibleChange: Function,
|
||||
onPopupMouseEnter: Function,
|
||||
} as any,
|
||||
setup(props, { slots, attrs, expose }) {
|
||||
const builtInPlacements = computed(() => {
|
||||
|
|
|
@ -15,16 +15,16 @@ import type {
|
|||
|
||||
export const inputProps = {
|
||||
inputRef: PropTypes.any,
|
||||
prefixCls: PropTypes.string,
|
||||
id: PropTypes.string,
|
||||
prefixCls: String,
|
||||
id: String,
|
||||
inputElement: PropTypes.VueNode,
|
||||
disabled: PropTypes.looseBool,
|
||||
autofocus: PropTypes.looseBool,
|
||||
autocomplete: PropTypes.string,
|
||||
editable: PropTypes.looseBool,
|
||||
activeDescendantId: PropTypes.string,
|
||||
value: PropTypes.string,
|
||||
open: PropTypes.looseBool,
|
||||
disabled: { type: Boolean, default: undefined },
|
||||
autofocus: { type: Boolean, default: undefined },
|
||||
autocomplete: String,
|
||||
editable: { type: Boolean, default: undefined },
|
||||
activeDescendantId: String,
|
||||
value: String,
|
||||
open: { type: Boolean, default: undefined },
|
||||
tabindex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
||||
/** Pass accessibility props to input */
|
||||
attrs: PropTypes.object,
|
||||
|
|
|
@ -32,39 +32,39 @@ type SelectorProps = InnerSelectorProps & {
|
|||
};
|
||||
|
||||
const props = {
|
||||
id: PropTypes.string,
|
||||
prefixCls: PropTypes.string,
|
||||
id: String,
|
||||
prefixCls: String,
|
||||
values: PropTypes.array,
|
||||
open: PropTypes.looseBool,
|
||||
searchValue: PropTypes.string,
|
||||
open: { type: Boolean, default: undefined },
|
||||
searchValue: String,
|
||||
inputRef: PropTypes.any,
|
||||
placeholder: PropTypes.any,
|
||||
disabled: PropTypes.looseBool,
|
||||
mode: PropTypes.string,
|
||||
showSearch: PropTypes.looseBool,
|
||||
autofocus: PropTypes.looseBool,
|
||||
autocomplete: PropTypes.string,
|
||||
activeDescendantId: PropTypes.string,
|
||||
disabled: { type: Boolean, default: undefined },
|
||||
mode: String,
|
||||
showSearch: { type: Boolean, default: undefined },
|
||||
autofocus: { type: Boolean, default: undefined },
|
||||
autocomplete: String,
|
||||
activeDescendantId: String,
|
||||
tabindex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
||||
|
||||
removeIcon: PropTypes.any,
|
||||
choiceTransitionName: PropTypes.string,
|
||||
choiceTransitionName: String,
|
||||
|
||||
maxTagCount: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
||||
maxTagTextLength: PropTypes.number,
|
||||
maxTagTextLength: Number,
|
||||
maxTagPlaceholder: PropTypes.any.def(
|
||||
() => (omittedValues: DisplayValueType[]) => `+ ${omittedValues.length} ...`,
|
||||
),
|
||||
tagRender: PropTypes.func,
|
||||
tagRender: Function,
|
||||
|
||||
onToggleOpen: { type: Function as PropType<(open?: boolean) => void> },
|
||||
onRemove: PropTypes.func,
|
||||
onInputChange: PropTypes.func,
|
||||
onInputPaste: PropTypes.func,
|
||||
onInputKeyDown: PropTypes.func,
|
||||
onInputMouseDown: PropTypes.func,
|
||||
onInputCompositionStart: PropTypes.func,
|
||||
onInputCompositionEnd: PropTypes.func,
|
||||
onRemove: Function,
|
||||
onInputChange: Function,
|
||||
onInputPaste: Function,
|
||||
onInputKeyDown: Function,
|
||||
onInputMouseDown: Function,
|
||||
onInputCompositionStart: Function,
|
||||
onInputCompositionEnd: Function,
|
||||
};
|
||||
|
||||
const onPreventMouseDown = (event: MouseEvent) => {
|
||||
|
|
|
@ -13,29 +13,29 @@ interface SelectorProps extends InnerSelectorProps {
|
|||
}
|
||||
const props = {
|
||||
inputElement: PropTypes.any,
|
||||
id: PropTypes.string,
|
||||
prefixCls: PropTypes.string,
|
||||
id: String,
|
||||
prefixCls: String,
|
||||
values: PropTypes.array,
|
||||
open: PropTypes.looseBool,
|
||||
searchValue: PropTypes.string,
|
||||
open: { type: Boolean, default: undefined },
|
||||
searchValue: String,
|
||||
inputRef: PropTypes.any,
|
||||
placeholder: PropTypes.any,
|
||||
disabled: PropTypes.looseBool,
|
||||
mode: PropTypes.string,
|
||||
showSearch: PropTypes.looseBool,
|
||||
autofocus: PropTypes.looseBool,
|
||||
autocomplete: PropTypes.string,
|
||||
activeDescendantId: PropTypes.string,
|
||||
disabled: { type: Boolean, default: undefined },
|
||||
mode: String,
|
||||
showSearch: { type: Boolean, default: undefined },
|
||||
autofocus: { type: Boolean, default: undefined },
|
||||
autocomplete: String,
|
||||
activeDescendantId: String,
|
||||
tabindex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
||||
activeValue: PropTypes.string,
|
||||
backfill: PropTypes.looseBool,
|
||||
optionLabelRender: PropTypes.func,
|
||||
onInputChange: PropTypes.func,
|
||||
onInputPaste: PropTypes.func,
|
||||
onInputKeyDown: PropTypes.func,
|
||||
onInputMouseDown: PropTypes.func,
|
||||
onInputCompositionStart: PropTypes.func,
|
||||
onInputCompositionEnd: PropTypes.func,
|
||||
activeValue: String,
|
||||
backfill: { type: Boolean, default: undefined },
|
||||
optionLabelRender: Function,
|
||||
onInputChange: Function,
|
||||
onInputPaste: Function,
|
||||
onInputKeyDown: Function,
|
||||
onInputMouseDown: Function,
|
||||
onInputCompositionStart: Function,
|
||||
onInputCompositionEnd: Function,
|
||||
};
|
||||
const SingleSelector = defineComponent<SelectorProps>({
|
||||
name: 'SingleSelector',
|
||||
|
|
|
@ -77,50 +77,50 @@ const Selector = defineComponent<SelectorProps>({
|
|||
name: 'Selector',
|
||||
inheritAttrs: false,
|
||||
props: {
|
||||
id: PropTypes.string,
|
||||
prefixCls: PropTypes.string,
|
||||
showSearch: PropTypes.looseBool,
|
||||
open: PropTypes.looseBool,
|
||||
id: String,
|
||||
prefixCls: String,
|
||||
showSearch: { type: Boolean, default: undefined },
|
||||
open: { type: Boolean, default: undefined },
|
||||
/** Display in the Selector value, it's not same as `value` prop */
|
||||
values: PropTypes.array,
|
||||
multiple: PropTypes.looseBool,
|
||||
mode: PropTypes.string,
|
||||
searchValue: PropTypes.string,
|
||||
activeValue: PropTypes.string,
|
||||
multiple: { type: Boolean, default: undefined },
|
||||
mode: String,
|
||||
searchValue: String,
|
||||
activeValue: String,
|
||||
inputElement: PropTypes.any,
|
||||
|
||||
autofocus: PropTypes.looseBool,
|
||||
activeDescendantId: PropTypes.string,
|
||||
autofocus: { type: Boolean, default: undefined },
|
||||
activeDescendantId: String,
|
||||
tabindex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
||||
disabled: PropTypes.looseBool,
|
||||
disabled: { type: Boolean, default: undefined },
|
||||
placeholder: PropTypes.any,
|
||||
removeIcon: PropTypes.any,
|
||||
|
||||
// Tags
|
||||
maxTagCount: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
||||
maxTagTextLength: PropTypes.number,
|
||||
maxTagTextLength: Number,
|
||||
maxTagPlaceholder: PropTypes.any,
|
||||
tagRender: PropTypes.func,
|
||||
optionLabelRender: PropTypes.func,
|
||||
tagRender: Function,
|
||||
optionLabelRender: Function,
|
||||
|
||||
/** Check if `tokenSeparators` contains `\n` or `\r\n` */
|
||||
tokenWithEnter: PropTypes.looseBool,
|
||||
tokenWithEnter: { type: Boolean, default: undefined },
|
||||
|
||||
// Motion
|
||||
choiceTransitionName: PropTypes.string,
|
||||
choiceTransitionName: String,
|
||||
|
||||
onToggleOpen: { type: Function as PropType<(open?: boolean) => void> },
|
||||
/** `onSearch` returns go next step boolean to check if need do toggle open */
|
||||
onSearch: PropTypes.func,
|
||||
onSearchSubmit: PropTypes.func,
|
||||
onRemove: PropTypes.func,
|
||||
onSearch: Function,
|
||||
onSearchSubmit: Function,
|
||||
onRemove: Function,
|
||||
onInputKeyDown: { type: Function as PropType<EventHandler> },
|
||||
|
||||
/**
|
||||
* @private get real dom for trigger align.
|
||||
* This may be removed after React provides replacement of `findDOMNode`
|
||||
*/
|
||||
domRef: PropTypes.func,
|
||||
domRef: Function,
|
||||
} as any,
|
||||
setup(props, { expose }) {
|
||||
const inputRef = createRef();
|
||||
|
|
|
@ -56,11 +56,11 @@ const TransBtn: TransBtnType = (props, { slots }) => {
|
|||
TransBtn.inheritAttrs = false;
|
||||
TransBtn.displayName = 'TransBtn';
|
||||
TransBtn.props = {
|
||||
class: PropTypes.string,
|
||||
class: String,
|
||||
customizeIcon: PropTypes.any,
|
||||
customizeIconProps: PropTypes.any,
|
||||
onMousedown: PropTypes.func,
|
||||
onClick: PropTypes.func,
|
||||
onMousedown: Function,
|
||||
onClick: Function,
|
||||
};
|
||||
|
||||
export default TransBtn;
|
||||
|
|
|
@ -8,15 +8,15 @@ export default defineComponent({
|
|||
name: 'Handle',
|
||||
inheritAttrs: false,
|
||||
props: {
|
||||
prefixCls: PropTypes.string,
|
||||
vertical: PropTypes.looseBool,
|
||||
offset: PropTypes.number,
|
||||
disabled: PropTypes.looseBool,
|
||||
min: PropTypes.number,
|
||||
max: PropTypes.number,
|
||||
value: PropTypes.number,
|
||||
prefixCls: String,
|
||||
vertical: { type: Boolean, default: undefined },
|
||||
offset: Number,
|
||||
disabled: { type: Boolean, default: undefined },
|
||||
min: Number,
|
||||
max: Number,
|
||||
value: Number,
|
||||
tabindex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
||||
reverse: PropTypes.looseBool,
|
||||
reverse: { type: Boolean, default: undefined },
|
||||
ariaLabel: String,
|
||||
ariaLabelledBy: String,
|
||||
ariaValueTextFormatter: Function,
|
||||
|
|
|
@ -37,20 +37,20 @@ const trimAlignValue = ({
|
|||
const rangeProps = {
|
||||
defaultValue: PropTypes.arrayOf(PropTypes.number),
|
||||
value: PropTypes.arrayOf(PropTypes.number),
|
||||
count: PropTypes.number,
|
||||
count: Number,
|
||||
pushable: withUndefined(PropTypes.oneOfType([PropTypes.looseBool, PropTypes.number])),
|
||||
allowCross: PropTypes.looseBool,
|
||||
disabled: PropTypes.looseBool,
|
||||
reverse: PropTypes.looseBool,
|
||||
allowCross: { type: Boolean, default: undefined },
|
||||
disabled: { type: Boolean, default: undefined },
|
||||
reverse: { type: Boolean, default: undefined },
|
||||
tabindex: PropTypes.arrayOf(PropTypes.number),
|
||||
prefixCls: PropTypes.string,
|
||||
min: PropTypes.number,
|
||||
max: PropTypes.number,
|
||||
autofocus: PropTypes.looseBool,
|
||||
prefixCls: String,
|
||||
min: Number,
|
||||
max: Number,
|
||||
autofocus: { type: Boolean, default: undefined },
|
||||
ariaLabelGroupForHandles: Array,
|
||||
ariaLabelledByGroupForHandles: Array,
|
||||
ariaValueTextFormatterGroupForHandles: Array,
|
||||
draggableTrack: PropTypes.looseBool,
|
||||
draggableTrack: { type: Boolean, default: undefined },
|
||||
};
|
||||
const Range = defineComponent({
|
||||
name: 'Range',
|
||||
|
|
|
@ -11,14 +11,14 @@ const Slider = defineComponent({
|
|||
mixins: [BaseMixin],
|
||||
inheritAttrs: false,
|
||||
props: {
|
||||
defaultValue: PropTypes.number,
|
||||
value: PropTypes.number,
|
||||
disabled: PropTypes.looseBool,
|
||||
autofocus: PropTypes.looseBool,
|
||||
defaultValue: Number,
|
||||
value: Number,
|
||||
disabled: { type: Boolean, default: undefined },
|
||||
autofocus: { type: Boolean, default: undefined },
|
||||
tabindex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
||||
reverse: PropTypes.looseBool,
|
||||
min: PropTypes.number,
|
||||
max: PropTypes.number,
|
||||
reverse: { type: Boolean, default: undefined },
|
||||
min: Number,
|
||||
max: Number,
|
||||
ariaLabelForHandle: String,
|
||||
ariaLabelledByForHandle: String,
|
||||
ariaValueTextFormatterForHandle: String,
|
||||
|
|
|
@ -16,18 +16,18 @@ function noop() {}
|
|||
export default function createSlider(Component) {
|
||||
// const displayName = `ComponentEnhancer(${Component.displayName})`
|
||||
const propTypes = {
|
||||
id: PropTypes.string,
|
||||
min: PropTypes.number,
|
||||
max: PropTypes.number,
|
||||
step: PropTypes.number,
|
||||
id: String,
|
||||
min: Number,
|
||||
max: Number,
|
||||
step: Number,
|
||||
marks: PropTypes.object,
|
||||
included: PropTypes.looseBool,
|
||||
prefixCls: PropTypes.string,
|
||||
disabled: PropTypes.looseBool,
|
||||
handle: PropTypes.func,
|
||||
dots: PropTypes.looseBool,
|
||||
vertical: PropTypes.looseBool,
|
||||
reverse: PropTypes.looseBool,
|
||||
included: { type: Boolean, default: undefined },
|
||||
prefixCls: String,
|
||||
disabled: { type: Boolean, default: undefined },
|
||||
handle: Function,
|
||||
dots: { type: Boolean, default: undefined },
|
||||
vertical: { type: Boolean, default: undefined },
|
||||
reverse: { type: Boolean, default: undefined },
|
||||
minimumTrackStyle: PropTypes.object, // just for compatibility, will be deperecate
|
||||
maximumTrackStyle: PropTypes.object, // just for compatibility, will be deperecate
|
||||
handleStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.arrayOf(PropTypes.object)]),
|
||||
|
@ -35,8 +35,8 @@ export default function createSlider(Component) {
|
|||
railStyle: PropTypes.object,
|
||||
dotStyle: PropTypes.object,
|
||||
activeDotStyle: PropTypes.object,
|
||||
autofocus: PropTypes.looseBool,
|
||||
draggableTrack: PropTypes.looseBool,
|
||||
autofocus: { type: Boolean, default: undefined },
|
||||
draggableTrack: { type: Boolean, default: undefined },
|
||||
};
|
||||
return defineComponent({
|
||||
name: 'CreateSlider',
|
||||
|
|
|
@ -8,17 +8,17 @@ function isString(str: any): str is string {
|
|||
}
|
||||
function noop() {}
|
||||
export const VcStepProps = () => ({
|
||||
prefixCls: PropTypes.string,
|
||||
prefixCls: String,
|
||||
wrapperStyle: PropTypes.style,
|
||||
itemWidth: PropTypes.string,
|
||||
active: PropTypes.looseBool,
|
||||
disabled: PropTypes.looseBool,
|
||||
status: PropTypes.string,
|
||||
iconPrefix: PropTypes.string,
|
||||
itemWidth: String,
|
||||
active: { type: Boolean, default: undefined },
|
||||
disabled: { type: Boolean, default: undefined },
|
||||
status: String,
|
||||
iconPrefix: String,
|
||||
icon: PropTypes.any,
|
||||
adjustMarginRight: PropTypes.string,
|
||||
stepNumber: PropTypes.number,
|
||||
stepIndex: PropTypes.number,
|
||||
adjustMarginRight: String,
|
||||
stepNumber: Number,
|
||||
stepIndex: Number,
|
||||
description: PropTypes.any,
|
||||
title: PropTypes.any,
|
||||
subTitle: PropTypes.any,
|
||||
|
@ -28,9 +28,9 @@ export const VcStepProps = () => ({
|
|||
finish: PropTypes.any,
|
||||
error: PropTypes.any,
|
||||
}).loose,
|
||||
onClick: PropTypes.func,
|
||||
onStepClick: PropTypes.func,
|
||||
stepIcon: PropTypes.func,
|
||||
onClick: Function,
|
||||
onStepClick: Function,
|
||||
stepIcon: Function,
|
||||
});
|
||||
export default defineComponent({
|
||||
name: 'Step',
|
||||
|
|
|
@ -38,7 +38,7 @@ export default defineComponent({
|
|||
finish: PropTypes.any,
|
||||
error: PropTypes.any,
|
||||
}).loose,
|
||||
stepIcon: PropTypes.func,
|
||||
stepIcon: Function,
|
||||
},
|
||||
slots: ['stepIcon', 'progressDot'],
|
||||
emits: ['change'],
|
||||
|
@ -79,7 +79,7 @@ export default defineComponent({
|
|||
// description: PropTypes.any,
|
||||
// icon: PropTypes.any,
|
||||
// status: PropTypes.oneOf(tuple('wait', 'process', 'finish', 'error')),
|
||||
// disabled: PropTypes.looseBool,
|
||||
// disabled: { type: Boolean, default: undefined },
|
||||
// title: PropTypes.any,
|
||||
// subTitle: PropTypes.any,
|
||||
const { prefixCls: pre = prefixCls, ...restProps } = child.props || {};
|
||||
|
|
|
@ -3,8 +3,8 @@ import { defineComponent } from 'vue';
|
|||
import PropTypes from '../../_util/vue-types';
|
||||
|
||||
const tooltipContentProps = {
|
||||
prefixCls: PropTypes.string,
|
||||
id: PropTypes.string,
|
||||
prefixCls: String,
|
||||
id: String,
|
||||
overlayInnerStyle: PropTypes.any,
|
||||
};
|
||||
|
||||
|
|
|
@ -10,27 +10,27 @@ export default defineComponent({
|
|||
inheritAttrs: false,
|
||||
props: {
|
||||
trigger: PropTypes.any.def(['hover']),
|
||||
defaultVisible: PropTypes.looseBool,
|
||||
visible: PropTypes.looseBool,
|
||||
defaultVisible: { type: Boolean, default: undefined },
|
||||
visible: { type: Boolean, default: undefined },
|
||||
placement: PropTypes.string.def('right'),
|
||||
transitionName: PropTypes.string,
|
||||
transitionName: String,
|
||||
animation: PropTypes.any,
|
||||
afterVisibleChange: PropTypes.func.def(() => {}),
|
||||
overlayStyle: PropTypes.style,
|
||||
overlayClassName: PropTypes.string,
|
||||
overlayClassName: String,
|
||||
prefixCls: PropTypes.string.def('rc-tooltip'),
|
||||
mouseEnterDelay: PropTypes.number.def(0.1),
|
||||
mouseLeaveDelay: PropTypes.number.def(0.1),
|
||||
getTooltipContainer: PropTypes.func,
|
||||
getTooltipContainer: Function,
|
||||
destroyTooltipOnHide: PropTypes.looseBool.def(false),
|
||||
align: PropTypes.object.def(() => ({})),
|
||||
arrowContent: PropTypes.any.def(null),
|
||||
tipId: PropTypes.string,
|
||||
tipId: String,
|
||||
builtinPlacements: PropTypes.object,
|
||||
overlayInnerStyle: PropTypes.style,
|
||||
popupVisible: PropTypes.looseBool,
|
||||
onVisibleChange: PropTypes.func,
|
||||
onPopupAlign: PropTypes.func,
|
||||
popupVisible: { type: Boolean, default: undefined },
|
||||
onVisibleChange: Function,
|
||||
onPopupAlign: Function,
|
||||
},
|
||||
slots: ['arrowContent', 'overlay'],
|
||||
setup(props, { slots, attrs, expose }) {
|
||||
|
|
|
@ -59,29 +59,29 @@ export default defineComponent({
|
|||
popupStyle: PropTypes.style,
|
||||
prefixCls: PropTypes.string.def('rc-trigger-popup'),
|
||||
popupClassName: PropTypes.string.def(''),
|
||||
popupPlacement: PropTypes.string,
|
||||
popupPlacement: String,
|
||||
builtinPlacements: PropTypes.object,
|
||||
popupTransitionName: PropTypes.string,
|
||||
popupTransitionName: String,
|
||||
popupAnimation: PropTypes.any,
|
||||
mouseEnterDelay: PropTypes.number.def(0),
|
||||
mouseLeaveDelay: PropTypes.number.def(0.1),
|
||||
zIndex: PropTypes.number,
|
||||
zIndex: Number,
|
||||
focusDelay: PropTypes.number.def(0),
|
||||
blurDelay: PropTypes.number.def(0.15),
|
||||
getPopupContainer: PropTypes.func,
|
||||
getPopupContainer: Function,
|
||||
getDocument: PropTypes.func.def(returnDocument),
|
||||
forceRender: PropTypes.looseBool,
|
||||
forceRender: { type: Boolean, default: undefined },
|
||||
destroyPopupOnHide: PropTypes.looseBool.def(false),
|
||||
mask: PropTypes.looseBool.def(false),
|
||||
maskClosable: PropTypes.looseBool.def(true),
|
||||
// onPopupAlign: PropTypes.func.def(noop),
|
||||
popupAlign: PropTypes.object.def(() => ({})),
|
||||
popupVisible: PropTypes.looseBool,
|
||||
popupVisible: { type: Boolean, default: undefined },
|
||||
defaultPopupVisible: PropTypes.looseBool.def(false),
|
||||
maskTransitionName: PropTypes.string,
|
||||
maskAnimation: PropTypes.string,
|
||||
stretch: PropTypes.string,
|
||||
alignPoint: PropTypes.looseBool, // Maybe we can support user pass position in the future
|
||||
maskTransitionName: String,
|
||||
maskAnimation: String,
|
||||
stretch: String,
|
||||
alignPoint: { type: Boolean, default: undefined }, // Maybe we can support user pass position in the future
|
||||
autoDestroy: PropTypes.looseBool.def(false),
|
||||
mobile: Object,
|
||||
getTriggerDOMNode: Function,
|
||||
|
|
|
@ -79,12 +79,12 @@ const List = defineComponent({
|
|||
name: 'List',
|
||||
inheritAttrs: false,
|
||||
props: {
|
||||
prefixCls: PropTypes.string,
|
||||
prefixCls: String,
|
||||
data: PropTypes.array,
|
||||
height: PropTypes.number,
|
||||
itemHeight: PropTypes.number,
|
||||
height: Number,
|
||||
itemHeight: Number,
|
||||
/** If not match virtual scroll condition, Set List still use height of container. */
|
||||
fullHeight: PropTypes.looseBool,
|
||||
fullHeight: { type: Boolean, default: undefined },
|
||||
itemKey: {
|
||||
type: [String, Number, Function] as PropType<Key | ((item: Record<string, any>) => Key)>,
|
||||
required: true,
|
||||
|
@ -93,11 +93,11 @@ const List = defineComponent({
|
|||
type: [String, Object] as PropType<string | Component>,
|
||||
},
|
||||
/** Set `false` will always use real scroll instead of virtual one */
|
||||
virtual: PropTypes.looseBool,
|
||||
children: PropTypes.func,
|
||||
onScroll: PropTypes.func,
|
||||
onMousedown: PropTypes.func,
|
||||
onMouseenter: PropTypes.func,
|
||||
virtual: { type: Boolean, default: undefined },
|
||||
children: Function,
|
||||
onScroll: Function,
|
||||
onMousedown: Function,
|
||||
onMouseenter: Function,
|
||||
onVisibleChange: Function as PropType<(visibleList: any[], fullList: any[]) => void>,
|
||||
},
|
||||
setup(props, { expose }) {
|
||||
|
|
|
@ -23,11 +23,11 @@ export default defineComponent({
|
|||
name: 'ScrollBar',
|
||||
inheritAttrs: false,
|
||||
props: {
|
||||
prefixCls: PropTypes.string,
|
||||
scrollTop: PropTypes.number,
|
||||
scrollHeight: PropTypes.number,
|
||||
height: PropTypes.number,
|
||||
count: PropTypes.number,
|
||||
prefixCls: String,
|
||||
scrollTop: Number,
|
||||
scrollHeight: Number,
|
||||
height: Number,
|
||||
count: Number,
|
||||
onScroll: {
|
||||
type: Function as PropType<(scrollTop: number) => void>,
|
||||
},
|
||||
|
|
|
@ -1,56 +1,47 @@
|
|||
<docs>
|
||||
---
|
||||
order: 0
|
||||
title:
|
||||
zh-CN: 基本用法
|
||||
en-US: Basic usage
|
||||
---
|
||||
|
||||
## zh-CN
|
||||
|
||||
第一个对话框。
|
||||
|
||||
## en-US
|
||||
|
||||
Basic modal.
|
||||
|
||||
</docs>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<div ref="container"></div>
|
||||
<a-button type="primary" @click="showModal">Open Modal</a-button>
|
||||
<a-modal v-model:visible="visible" title="Basic Modal" @ok="handleOk">
|
||||
<p>Some contents...</p>
|
||||
<p>Some contents...</p>
|
||||
<p>Some contents...</p>
|
||||
</a-modal>
|
||||
<a-menu
|
||||
v-model:selected-keys="selectedKeys"
|
||||
:open-keys="openKeys"
|
||||
style="width: 256px"
|
||||
mode="inline"
|
||||
>
|
||||
<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>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { defineComponent, ref } from 'vue';
|
||||
<script>
|
||||
import { defineComponent, ref, watchEffect } from 'vue';
|
||||
import { MailOutlined } from '@ant-design/icons-vue';
|
||||
export default defineComponent({
|
||||
components: {
|
||||
MailOutlined,
|
||||
},
|
||||
setup() {
|
||||
const visible = ref<boolean>(false);
|
||||
|
||||
const showModal = () => {
|
||||
visible.value = true;
|
||||
const selectedKeys = ref(['1']);
|
||||
const openKeys = ref([]);
|
||||
const open = () => {
|
||||
openKeys.value.push('sub1');
|
||||
// openKeys.value = [...openKeys.value, 'sub1'];
|
||||
};
|
||||
|
||||
const handleOk = (e: MouseEvent) => {
|
||||
console.log(e);
|
||||
visible.value = false;
|
||||
};
|
||||
const container = ref();
|
||||
const test = ref([1]);
|
||||
watchEffect(() => {
|
||||
console.log(111, test.value);
|
||||
});
|
||||
window.openKeys = openKeys;
|
||||
window.test = test;
|
||||
return {
|
||||
container,
|
||||
visible,
|
||||
showModal,
|
||||
handleOk,
|
||||
getContainer() {
|
||||
console.log('container', container.value);
|
||||
return container.value;
|
||||
},
|
||||
selectedKeys,
|
||||
openKeys,
|
||||
open,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// debugger tsx
|
||||
import Demo from '../../components/select/demo/field-names.vue';
|
||||
// import Demo from './demo/demo.vue';
|
||||
// import Demo from '../../components/select/demo/field-names.vue';
|
||||
import Demo from './demo/demo.vue';
|
||||
|
||||
export default {
|
||||
setup() {},
|
||||
|
|
Loading…
Reference in New Issue