feat: update ts type
parent
a7f27930b5
commit
55b9ab50af
|
@ -11,10 +11,7 @@ import useProvideSize from '../_util/hooks/useSize';
|
||||||
export const groupProps = () => ({
|
export const groupProps = () => ({
|
||||||
prefixCls: String,
|
prefixCls: String,
|
||||||
maxCount: Number,
|
maxCount: Number,
|
||||||
maxStyle: {
|
maxStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
|
||||||
type: Object as PropType<CSSProperties>,
|
|
||||||
default: undefined as CSSProperties,
|
|
||||||
},
|
|
||||||
maxPopoverPlacement: { type: String as PropType<'top' | 'bottom'>, default: 'top' },
|
maxPopoverPlacement: { type: String as PropType<'top' | 'bottom'>, default: 'top' },
|
||||||
maxPopoverTrigger: String as PropType<'hover' | 'focus' | 'click'>,
|
maxPopoverTrigger: String as PropType<'hover' | 'focus' | 'click'>,
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -27,7 +27,7 @@ export const badgeProps = () => ({
|
||||||
color: String,
|
color: String,
|
||||||
text: PropTypes.any,
|
text: PropTypes.any,
|
||||||
offset: Array as unknown as PropType<[number | string, number | string]>,
|
offset: Array as unknown as PropType<[number | string, number | string]>,
|
||||||
numberStyle: Object as PropType<CSSProperties>,
|
numberStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
|
||||||
title: String,
|
title: String,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import type { VNodeTypes, PropType, VNode, ExtractPropTypes } from 'vue';
|
import type { VNodeTypes, PropType, VNode, ExtractPropTypes, CSSProperties } from 'vue';
|
||||||
import { isVNode, defineComponent, renderSlot } from 'vue';
|
import { isVNode, defineComponent, renderSlot } from 'vue';
|
||||||
import Tabs from '../tabs';
|
import Tabs from '../tabs';
|
||||||
import Row from '../row';
|
import Row from '../row';
|
||||||
|
@ -27,11 +27,11 @@ export const cardProps = () => ({
|
||||||
prefixCls: String,
|
prefixCls: String,
|
||||||
title: PropTypes.any,
|
title: PropTypes.any,
|
||||||
extra: PropTypes.any,
|
extra: PropTypes.any,
|
||||||
bordered: PropTypes.looseBool.def(true),
|
bordered: { type: Boolean, default: true },
|
||||||
bodyStyle: PropTypes.style,
|
bodyStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
|
||||||
headStyle: PropTypes.style,
|
headStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
|
||||||
loading: PropTypes.looseBool.def(false),
|
loading: { type: Boolean, default: false },
|
||||||
hoverable: PropTypes.looseBool.def(false),
|
hoverable: { type: Boolean, default: false },
|
||||||
type: { type: String as PropType<CardType> },
|
type: { type: String as PropType<CardType> },
|
||||||
size: { type: String as PropType<CardSize> },
|
size: { type: String as PropType<CardSize> },
|
||||||
actions: PropTypes.any,
|
actions: PropTypes.any,
|
||||||
|
|
|
@ -1,13 +1,16 @@
|
||||||
|
import type { ExtractPropTypes } from 'vue';
|
||||||
import { defineComponent, computed } from 'vue';
|
import { defineComponent, computed } from 'vue';
|
||||||
import useConfigInject from '../_util/hooks/useConfigInject';
|
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||||
|
|
||||||
|
export const cardGridProps = () => ({
|
||||||
|
prefixCls: String,
|
||||||
|
hoverable: { type: Boolean, default: true },
|
||||||
|
});
|
||||||
|
export type CardGridProps = Partial<ExtractPropTypes<ReturnType<typeof cardGridProps>>>;
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'ACardGrid',
|
name: 'ACardGrid',
|
||||||
__ANT_CARD_GRID: true,
|
__ANT_CARD_GRID: true,
|
||||||
props: {
|
props: cardGridProps(),
|
||||||
prefixCls: String,
|
|
||||||
hoverable: { type: Boolean, default: true },
|
|
||||||
},
|
|
||||||
setup(props, { slots }) {
|
setup(props, { slots }) {
|
||||||
const { prefixCls } = useConfigInject('card', props);
|
const { prefixCls } = useConfigInject('card', props);
|
||||||
const classNames = computed(() => {
|
const classNames = computed(() => {
|
||||||
|
|
|
@ -1,16 +1,19 @@
|
||||||
|
import type { ExtractPropTypes } from 'vue';
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import PropTypes from '../_util/vue-types';
|
import PropTypes from '../_util/vue-types';
|
||||||
import { getPropsSlot } from '../_util/props-util';
|
import { getPropsSlot } from '../_util/props-util';
|
||||||
import useConfigInject from '../_util/hooks/useConfigInject';
|
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||||
|
|
||||||
|
export const cardMetaProps = () => ({
|
||||||
|
prefixCls: String,
|
||||||
|
title: PropTypes.any,
|
||||||
|
description: PropTypes.any,
|
||||||
|
avatar: PropTypes.any,
|
||||||
|
});
|
||||||
|
export type CardGridProps = Partial<ExtractPropTypes<ReturnType<typeof cardMetaProps>>>;
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'ACardMeta',
|
name: 'ACardMeta',
|
||||||
props: {
|
props: cardMetaProps(),
|
||||||
prefixCls: String,
|
|
||||||
title: PropTypes.any,
|
|
||||||
description: PropTypes.any,
|
|
||||||
avatar: PropTypes.any,
|
|
||||||
},
|
|
||||||
slots: ['title', 'description', 'avatar'],
|
slots: ['title', 'description', 'avatar'],
|
||||||
setup(props, { slots }) {
|
setup(props, { slots }) {
|
||||||
const { prefixCls } = useConfigInject('card', props);
|
const { prefixCls } = useConfigInject('card', props);
|
||||||
|
|
|
@ -3,12 +3,11 @@ import classNames from '../_util/classNames';
|
||||||
import VcCheckbox from '../vc-checkbox/Checkbox';
|
import VcCheckbox from '../vc-checkbox/Checkbox';
|
||||||
import { flattenChildren } from '../_util/props-util';
|
import { flattenChildren } from '../_util/props-util';
|
||||||
import warning from '../_util/warning';
|
import warning from '../_util/warning';
|
||||||
import type { RadioChangeEvent } from '../radio/interface';
|
|
||||||
import type { EventHandler } from '../_util/EventInterface';
|
import type { EventHandler } from '../_util/EventInterface';
|
||||||
import { useInjectFormItemContext } from '../form/FormItemContext';
|
import { useInjectFormItemContext } from '../form/FormItemContext';
|
||||||
import useConfigInject from '../_util/hooks/useConfigInject';
|
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||||
|
|
||||||
import type { CheckboxProps } from './interface';
|
import type { CheckboxChangeEvent, CheckboxProps } from './interface';
|
||||||
import { CheckboxGroupContextKey, checkboxProps } from './interface';
|
import { CheckboxGroupContextKey, checkboxProps } from './interface';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
|
@ -16,7 +15,7 @@ export default defineComponent({
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
__ANT_CHECKBOX: true,
|
__ANT_CHECKBOX: true,
|
||||||
props: checkboxProps(),
|
props: checkboxProps(),
|
||||||
emits: ['change', 'update:checked'],
|
// emits: ['change', 'update:checked'],
|
||||||
setup(props, { emit, attrs, slots, expose }) {
|
setup(props, { emit, attrs, slots, expose }) {
|
||||||
const formItemContext = useInjectFormItemContext();
|
const formItemContext = useInjectFormItemContext();
|
||||||
const { prefixCls, direction } = useConfigInject('checkbox', props);
|
const { prefixCls, direction } = useConfigInject('checkbox', props);
|
||||||
|
@ -41,7 +40,7 @@ export default defineComponent({
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleChange = (event: RadioChangeEvent) => {
|
const handleChange = (event: CheckboxChangeEvent) => {
|
||||||
const targetChecked = event.target.checked;
|
const targetChecked = event.target.checked;
|
||||||
emit('update:checked', targetChecked);
|
emit('update:checked', targetChecked);
|
||||||
emit('change', event);
|
emit('change', event);
|
||||||
|
|
|
@ -8,7 +8,7 @@ import { CheckboxGroupContextKey, checkboxGroupProps } from './interface';
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'ACheckboxGroup',
|
name: 'ACheckboxGroup',
|
||||||
props: checkboxGroupProps(),
|
props: checkboxGroupProps(),
|
||||||
emits: ['change', 'update:value'],
|
// emits: ['change', 'update:value'],
|
||||||
setup(props, { slots, emit, expose }) {
|
setup(props, { slots, emit, expose }) {
|
||||||
const formItemContext = useInjectFormItemContext();
|
const formItemContext = useInjectFormItemContext();
|
||||||
const { prefixCls, direction } = useConfigInject('checkbox', props);
|
const { prefixCls, direction } = useConfigInject('checkbox', props);
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import type { ExtractPropTypes, InjectionKey, PropType, Ref } from 'vue';
|
import type { ExtractPropTypes, InjectionKey, PropType, Ref } from 'vue';
|
||||||
|
import type { MouseEventHandler } from '../_util/EventInterface';
|
||||||
import type { VueNode } from '../_util/type';
|
import type { VueNode } from '../_util/type';
|
||||||
import PropTypes from '../_util/vue-types';
|
import PropTypes from '../_util/vue-types';
|
||||||
|
|
||||||
|
@ -8,7 +9,18 @@ export interface CheckboxOptionType {
|
||||||
value: CheckboxValueType;
|
value: CheckboxValueType;
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
indeterminate?: boolean;
|
indeterminate?: boolean;
|
||||||
onChange?: (e: Event) => void;
|
onChange?: (e: CheckboxChangeEvent) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CheckboxChangeEvent {
|
||||||
|
target: CheckboxChangeEventTarget;
|
||||||
|
stopPropagation: () => void;
|
||||||
|
preventDefault: () => void;
|
||||||
|
nativeEvent: MouseEvent;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CheckboxChangeEventTarget extends CheckboxProps {
|
||||||
|
checked: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const abstractCheckboxGroupProps = () => {
|
export const abstractCheckboxGroupProps = () => {
|
||||||
|
@ -51,9 +63,9 @@ export const abstractCheckboxProps = () => {
|
||||||
indeterminate: { type: Boolean, default: undefined },
|
indeterminate: { type: Boolean, default: undefined },
|
||||||
type: { type: String, default: 'checkbox' },
|
type: { type: String, default: 'checkbox' },
|
||||||
autofocus: { type: Boolean, default: undefined },
|
autofocus: { type: Boolean, default: undefined },
|
||||||
onChange: Function,
|
onChange: Function as PropType<(e: CheckboxChangeEvent) => void>,
|
||||||
'onUpdate:checked': Function,
|
'onUpdate:checked': Function as PropType<(checked: boolean) => void>,
|
||||||
onClick: Function,
|
onClick: Function as PropType<MouseEventHandler>,
|
||||||
skipGroup: { type: Boolean, default: false },
|
skipGroup: { type: Boolean, default: false },
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -41,7 +41,7 @@ export default defineComponent({
|
||||||
expandIconPosition: 'left',
|
expandIconPosition: 'left',
|
||||||
}),
|
}),
|
||||||
slots: ['expandIcon'],
|
slots: ['expandIcon'],
|
||||||
emits: ['change', 'update:activeKey'],
|
// emits: ['change', 'update:activeKey'],
|
||||||
setup(props, { attrs, slots, emit }) {
|
setup(props, { attrs, slots, emit }) {
|
||||||
const stateActiveKey = ref<Key[]>(
|
const stateActiveKey = ref<Key[]>(
|
||||||
getActiveKeysArray(firstNotUndefined([props.activeKey, props.defaultActiveKey])),
|
getActiveKeysArray(firstNotUndefined([props.activeKey, props.defaultActiveKey])),
|
||||||
|
|
|
@ -12,6 +12,7 @@ export { collapsePanelProps };
|
||||||
export type CollapsePanelProps = Partial<ExtractPropTypes<ReturnType<typeof collapsePanelProps>>>;
|
export type CollapsePanelProps = Partial<ExtractPropTypes<ReturnType<typeof collapsePanelProps>>>;
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'ACollapsePanel',
|
name: 'ACollapsePanel',
|
||||||
|
inheritAttrs: false,
|
||||||
props: initDefaultProps(collapsePanelProps(), {
|
props: initDefaultProps(collapsePanelProps(), {
|
||||||
showArrow: true,
|
showArrow: true,
|
||||||
isActive: false,
|
isActive: false,
|
||||||
|
@ -20,8 +21,8 @@ export default defineComponent({
|
||||||
forceRender: false,
|
forceRender: false,
|
||||||
}),
|
}),
|
||||||
slots: ['expandIcon', 'extra', 'header'],
|
slots: ['expandIcon', 'extra', 'header'],
|
||||||
emits: ['itemClick'],
|
// emits: ['itemClick'],
|
||||||
setup(props, { slots, emit }) {
|
setup(props, { slots, emit, attrs }) {
|
||||||
devWarning(
|
devWarning(
|
||||||
props.disabled === undefined,
|
props.disabled === undefined,
|
||||||
'Collapse.Panel',
|
'Collapse.Panel',
|
||||||
|
@ -61,6 +62,7 @@ export default defineComponent({
|
||||||
[`${prefixClsValue}-item-active`]: isActive,
|
[`${prefixClsValue}-item-active`]: isActive,
|
||||||
[`${prefixClsValue}-item-disabled`]: disabled,
|
[`${prefixClsValue}-item-disabled`]: disabled,
|
||||||
[`${prefixClsValue}-no-arrow`]: !showArrow,
|
[`${prefixClsValue}-no-arrow`]: !showArrow,
|
||||||
|
[`${attrs.class}`]: !!attrs.class,
|
||||||
});
|
});
|
||||||
|
|
||||||
let icon = <i class="arrow" />;
|
let icon = <i class="arrow" />;
|
||||||
|
@ -85,7 +87,7 @@ export default defineComponent({
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div class={itemCls}>
|
<div {...attrs} class={itemCls}>
|
||||||
<div
|
<div
|
||||||
class={headerCls}
|
class={headerCls}
|
||||||
onClick={() => collapsible !== 'header' && handleItemClick()}
|
onClick={() => collapsible !== 'header' && handleItemClick()}
|
||||||
|
|
|
@ -1,10 +1,23 @@
|
||||||
import type { PropType } from 'vue';
|
import type { PropType } from 'vue';
|
||||||
|
import type { Key } from '../_util/type';
|
||||||
import { tuple } from '../_util/type';
|
import { tuple } from '../_util/type';
|
||||||
import PropTypes from '../_util/vue-types';
|
import PropTypes from '../_util/vue-types';
|
||||||
|
|
||||||
export type CollapsibleType = 'header' | 'disabled';
|
export type CollapsibleType = 'header' | 'disabled';
|
||||||
|
|
||||||
export type ActiveKeyType = Array<string | number> | string | number;
|
export type ActiveKeyType = Array<string | number> | string | number;
|
||||||
|
|
||||||
|
interface PanelProps {
|
||||||
|
isActive?: boolean;
|
||||||
|
header?: any;
|
||||||
|
showArrow?: boolean;
|
||||||
|
forceRender?: boolean;
|
||||||
|
/** @deprecated Use `collapsible="disabled"` instead */
|
||||||
|
disabled?: boolean;
|
||||||
|
extra?: any;
|
||||||
|
collapsible?: CollapsibleType;
|
||||||
|
}
|
||||||
|
|
||||||
const collapseProps = () => ({
|
const collapseProps = () => ({
|
||||||
prefixCls: String,
|
prefixCls: String,
|
||||||
activeKey: { type: [Array, Number, String] as PropType<ActiveKeyType> },
|
activeKey: { type: [Array, Number, String] as PropType<ActiveKeyType> },
|
||||||
|
@ -12,11 +25,13 @@ const collapseProps = () => ({
|
||||||
accordion: { type: Boolean, default: undefined },
|
accordion: { type: Boolean, default: undefined },
|
||||||
destroyInactivePanel: { type: Boolean, default: undefined },
|
destroyInactivePanel: { type: Boolean, default: undefined },
|
||||||
bordered: { type: Boolean, default: undefined },
|
bordered: { type: Boolean, default: undefined },
|
||||||
expandIcon: Function,
|
expandIcon: Function as PropType<(panelProps: PanelProps) => any>,
|
||||||
openAnimation: PropTypes.object,
|
openAnimation: PropTypes.object,
|
||||||
expandIconPosition: PropTypes.oneOf(tuple('left', 'right')),
|
expandIconPosition: PropTypes.oneOf(tuple('left', 'right')),
|
||||||
collapsible: { type: String as PropType<CollapsibleType> },
|
collapsible: { type: String as PropType<CollapsibleType> },
|
||||||
ghost: { type: Boolean, default: undefined },
|
ghost: { type: Boolean, default: undefined },
|
||||||
|
onChange: Function as PropType<(key: Key | Key[]) => void>,
|
||||||
|
'onUpdate:activeKey': Function as PropType<(key: Key | Key[]) => void>,
|
||||||
});
|
});
|
||||||
|
|
||||||
const collapsePanelProps = () => ({
|
const collapsePanelProps = () => ({
|
||||||
|
@ -31,12 +46,12 @@ const collapsePanelProps = () => ({
|
||||||
disabled: { type: Boolean, default: undefined },
|
disabled: { type: Boolean, default: undefined },
|
||||||
accordion: { type: Boolean, default: undefined },
|
accordion: { type: Boolean, default: undefined },
|
||||||
forceRender: { type: Boolean, default: undefined },
|
forceRender: { type: Boolean, default: undefined },
|
||||||
expandIcon: Function,
|
expandIcon: Function as PropType<(panelProps: PanelProps) => any>,
|
||||||
extra: PropTypes.any,
|
extra: PropTypes.any,
|
||||||
panelKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
panelKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
||||||
collapsible: { type: String as PropType<CollapsibleType> },
|
collapsible: { type: String as PropType<CollapsibleType> },
|
||||||
role: String,
|
role: String,
|
||||||
onItemClick: { type: Function as PropType<(panelKey: string | number) => void> },
|
onItemClick: { type: Function as PropType<(panelKey: Key) => void> },
|
||||||
});
|
});
|
||||||
|
|
||||||
export { collapseProps, collapsePanelProps };
|
export { collapseProps, collapsePanelProps };
|
||||||
|
|
|
@ -29,10 +29,10 @@ export default {
|
||||||
colorRounded: Number, //颜色数值保留几位小数
|
colorRounded: Number, //颜色数值保留几位小数
|
||||||
size: PropTypes.oneOf(['default', 'small', 'large']).def('default'), //尺寸
|
size: PropTypes.oneOf(['default', 'small', 'large']).def('default'), //尺寸
|
||||||
getPopupContainer: Function, //指定渲染容器
|
getPopupContainer: Function, //指定渲染容器
|
||||||
disabled: PropTypes.looseBool.def(false), //是否禁用
|
disabled: { type: Boolean, default: false }, //是否禁用
|
||||||
format: String, //颜色格式设置
|
format: String, //颜色格式设置
|
||||||
alpha: PropTypes.looseBool.def(false), //是否开启透明通道
|
alpha: { type: Boolean, default: false }, //是否开启透明通道
|
||||||
hue: PropTypes.looseBool.def(true), //是否开启色彩预选
|
hue: { type: Boolean, default: true }, //是否开启色彩预选
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
|
|
|
@ -5,8 +5,8 @@ import { flattenChildren } from '../_util/props-util';
|
||||||
import type { VueNode } from '../_util/type';
|
import type { VueNode } from '../_util/type';
|
||||||
import { withInstall } from '../_util/type';
|
import { withInstall } from '../_util/type';
|
||||||
import useConfigInject from '../_util/hooks/useConfigInject';
|
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||||
export const commentProps = {
|
export const commentProps = () => ({
|
||||||
actions: PropTypes.array,
|
actions: Array,
|
||||||
/** The element to display as the comment author. */
|
/** The element to display as the comment author. */
|
||||||
author: PropTypes.any,
|
author: PropTypes.any,
|
||||||
/** The element to display as the comment avatar - generally an antd Avatar */
|
/** The element to display as the comment avatar - generally an antd Avatar */
|
||||||
|
@ -17,13 +17,13 @@ export const commentProps = {
|
||||||
prefixCls: String,
|
prefixCls: String,
|
||||||
/** A datetime element containing the time to be displayed */
|
/** A datetime element containing the time to be displayed */
|
||||||
datetime: PropTypes.any,
|
datetime: PropTypes.any,
|
||||||
};
|
});
|
||||||
|
|
||||||
export type CommentProps = Partial<ExtractPropTypes<typeof commentProps>>;
|
export type CommentProps = Partial<ExtractPropTypes<ReturnType<typeof commentProps>>>;
|
||||||
|
|
||||||
const Comment = defineComponent({
|
const Comment = defineComponent({
|
||||||
name: 'AComment',
|
name: 'AComment',
|
||||||
props: commentProps,
|
props: commentProps(),
|
||||||
slots: ['actions', 'author', 'avatar', 'content', 'datetime'],
|
slots: ['actions', 'author', 'avatar', 'content', 'datetime'],
|
||||||
setup(props, { slots }) {
|
setup(props, { slots }) {
|
||||||
const { prefixCls, direction } = useConfigInject('comment', props);
|
const { prefixCls, direction } = useConfigInject('comment', props);
|
||||||
|
|
|
@ -4,7 +4,6 @@ import type { ValidateMessages } from '../form/interface';
|
||||||
import type { RequiredMark } from '../form/Form';
|
import type { RequiredMark } from '../form/Form';
|
||||||
import type { RenderEmptyHandler } from './renderEmpty';
|
import type { RenderEmptyHandler } from './renderEmpty';
|
||||||
import type { TransformCellTextProps } from '../table/interface';
|
import type { TransformCellTextProps } from '../table/interface';
|
||||||
import PropTypes from '../_util/vue-types';
|
|
||||||
import type { Locale } from '../locale-provider';
|
import type { Locale } from '../locale-provider';
|
||||||
|
|
||||||
type GlobalFormCOntextProps = {
|
type GlobalFormCOntextProps = {
|
||||||
|
|
|
@ -23,7 +23,6 @@ import type { Breakpoint, ScreenMap } from '../_util/responsiveObserve';
|
||||||
import ResponsiveObserve, { responsiveArray } from '../_util/responsiveObserve';
|
import ResponsiveObserve, { responsiveArray } from '../_util/responsiveObserve';
|
||||||
import Row from './Row';
|
import Row from './Row';
|
||||||
import PropTypes from '../_util/vue-types';
|
import PropTypes from '../_util/vue-types';
|
||||||
import { tuple } from '../_util/type';
|
|
||||||
import { cloneElement } from '../_util/vnode';
|
import { cloneElement } from '../_util/vnode';
|
||||||
import { flattenChildren } from '../_util/props-util';
|
import { flattenChildren } from '../_util/props-util';
|
||||||
import useConfigInject from '../_util/hooks/useConfigInject';
|
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||||
|
@ -34,19 +33,21 @@ export const DescriptionsItemProps = {
|
||||||
span: Number,
|
span: Number,
|
||||||
};
|
};
|
||||||
|
|
||||||
const descriptionsItemProp = {
|
const descriptionsItemProp = () => ({
|
||||||
prefixCls: String,
|
prefixCls: String,
|
||||||
label: PropTypes.any,
|
label: PropTypes.any,
|
||||||
labelStyle: PropTypes.style,
|
labelStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
|
||||||
contentStyle: PropTypes.style,
|
contentStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
|
||||||
span: PropTypes.number.def(1),
|
span: { type: Number, default: 1 },
|
||||||
};
|
});
|
||||||
|
|
||||||
export type DescriptionsItemProp = Partial<ExtractPropTypes<typeof descriptionsItemProp>>;
|
export type DescriptionsItemProp = Partial<
|
||||||
|
ExtractPropTypes<ReturnType<typeof descriptionsItemProp>>
|
||||||
|
>;
|
||||||
|
|
||||||
export const DescriptionsItem = defineComponent({
|
export const DescriptionsItem = defineComponent({
|
||||||
name: 'ADescriptionsItem',
|
name: 'ADescriptionsItem',
|
||||||
props: descriptionsItemProp,
|
props: descriptionsItemProp(),
|
||||||
slots: ['label'],
|
slots: ['label'],
|
||||||
setup(_, { slots }) {
|
setup(_, { slots }) {
|
||||||
return () => slots.default?.();
|
return () => slots.default?.();
|
||||||
|
@ -128,24 +129,24 @@ function getRows(children: VNode[], column: number) {
|
||||||
return rows;
|
return rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const descriptionsProps = {
|
export const descriptionsProps = () => ({
|
||||||
prefixCls: String,
|
prefixCls: String,
|
||||||
bordered: { type: Boolean, default: undefined },
|
bordered: { type: Boolean, default: undefined },
|
||||||
size: PropTypes.oneOf(tuple('default', 'middle', 'small')).def('default'),
|
size: { type: String as PropType<'default' | 'middle' | 'small'>, default: 'default' },
|
||||||
title: PropTypes.any,
|
title: PropTypes.any,
|
||||||
extra: PropTypes.any,
|
extra: PropTypes.any,
|
||||||
column: {
|
column: {
|
||||||
type: [Number, Object] as PropType<number | Partial<Record<Breakpoint, number>>>,
|
type: [Number, Object] as PropType<number | Partial<Record<Breakpoint, number>>>,
|
||||||
default: (): number | Partial<Record<Breakpoint, number>> => DEFAULT_COLUMN_MAP,
|
default: (): number | Partial<Record<Breakpoint, number>> => DEFAULT_COLUMN_MAP,
|
||||||
},
|
},
|
||||||
layout: PropTypes.oneOf(tuple('horizontal', 'vertical')),
|
layout: String as PropType<'horizontal' | 'vertical'>,
|
||||||
colon: { type: Boolean, default: undefined },
|
colon: { type: Boolean, default: undefined },
|
||||||
labelStyle: PropTypes.style,
|
labelStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
|
||||||
contentStyle: PropTypes.style,
|
contentStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
|
||||||
};
|
});
|
||||||
|
|
||||||
export type DescriptionsProps = HTMLAttributes &
|
export type DescriptionsProps = HTMLAttributes &
|
||||||
Partial<ExtractPropTypes<typeof descriptionsProps>>;
|
Partial<ExtractPropTypes<ReturnType<typeof descriptionsProps>>>;
|
||||||
|
|
||||||
export interface DescriptionsContextProp {
|
export interface DescriptionsContextProp {
|
||||||
labelStyle?: Ref<CSSProperties>;
|
labelStyle?: Ref<CSSProperties>;
|
||||||
|
@ -157,7 +158,7 @@ export const descriptionsContext: InjectionKey<DescriptionsContextProp> =
|
||||||
|
|
||||||
const Descriptions = defineComponent({
|
const Descriptions = defineComponent({
|
||||||
name: 'ADescriptions',
|
name: 'ADescriptions',
|
||||||
props: descriptionsProps,
|
props: descriptionsProps(),
|
||||||
slots: ['title', 'extra'],
|
slots: ['title', 'extra'],
|
||||||
Item: DescriptionsItem,
|
Item: DescriptionsItem,
|
||||||
setup(props, { slots }) {
|
setup(props, { slots }) {
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { computed, defineComponent } from 'vue';
|
||||||
import { withInstall } from '../_util/type';
|
import { withInstall } from '../_util/type';
|
||||||
import useConfigInject from '../_util/hooks/useConfigInject';
|
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||||
|
|
||||||
export const dividerProps = {
|
export const dividerProps = () => ({
|
||||||
prefixCls: String,
|
prefixCls: String,
|
||||||
type: {
|
type: {
|
||||||
type: String as PropType<'horizontal' | 'vertical' | ''>,
|
type: String as PropType<'horizontal' | 'vertical' | ''>,
|
||||||
|
@ -23,12 +23,12 @@ export const dividerProps = {
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
orientationMargin: [String, Number],
|
orientationMargin: [String, Number],
|
||||||
};
|
});
|
||||||
export type DividerProps = Partial<ExtractPropTypes<typeof dividerProps>>;
|
export type DividerProps = Partial<ExtractPropTypes<ReturnType<typeof dividerProps>>>;
|
||||||
|
|
||||||
const Divider = defineComponent({
|
const Divider = defineComponent({
|
||||||
name: 'ADivider',
|
name: 'ADivider',
|
||||||
props: dividerProps,
|
props: dividerProps(),
|
||||||
setup(props, { slots }) {
|
setup(props, { slots }) {
|
||||||
const { prefixCls: prefixClsRef, direction } = useConfigInject('divider', props);
|
const { prefixCls: prefixClsRef, direction } = useConfigInject('divider', props);
|
||||||
const hasCustomMarginLeft = computed(
|
const hasCustomMarginLeft = computed(
|
||||||
|
|
|
@ -19,6 +19,7 @@ import useConfigInject from '../_util/hooks/useConfigInject';
|
||||||
import { tuple, withInstall } from '../_util/type';
|
import { tuple, withInstall } from '../_util/type';
|
||||||
import omit from '../_util/omit';
|
import omit from '../_util/omit';
|
||||||
import devWarning from '../vc-util/devWarning';
|
import devWarning from '../vc-util/devWarning';
|
||||||
|
import type { KeyboardEventHandler, MouseEventHandler } from '../_util/EventInterface';
|
||||||
|
|
||||||
type ILevelMove = number | [number, number];
|
type ILevelMove = number | [number, number];
|
||||||
|
|
||||||
|
@ -43,7 +44,7 @@ export const drawerProps = () => ({
|
||||||
getContainer: PropTypes.any,
|
getContainer: PropTypes.any,
|
||||||
maskClosable: { type: Boolean, default: undefined },
|
maskClosable: { type: Boolean, default: undefined },
|
||||||
mask: { type: Boolean, default: undefined },
|
mask: { type: Boolean, default: undefined },
|
||||||
maskStyle: PropTypes.object,
|
maskStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
|
||||||
/** @deprecated Use `style` instead */
|
/** @deprecated Use `style` instead */
|
||||||
wrapStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
|
wrapStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
|
||||||
style: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
|
style: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
|
||||||
|
@ -53,10 +54,13 @@ export const drawerProps = () => ({
|
||||||
size: {
|
size: {
|
||||||
type: String as PropType<sizeType>,
|
type: String as PropType<sizeType>,
|
||||||
},
|
},
|
||||||
drawerStyle: PropTypes.object,
|
drawerStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
|
||||||
headerStyle: PropTypes.object,
|
headerStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
|
||||||
bodyStyle: PropTypes.object,
|
bodyStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
|
||||||
contentWrapperStyle: PropTypes.object,
|
contentWrapperStyle: {
|
||||||
|
type: Object as PropType<CSSProperties>,
|
||||||
|
default: undefined as CSSProperties,
|
||||||
|
},
|
||||||
title: PropTypes.any,
|
title: PropTypes.any,
|
||||||
visible: { type: Boolean, default: undefined },
|
visible: { type: Boolean, default: undefined },
|
||||||
width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
||||||
|
@ -68,7 +72,7 @@ export const drawerProps = () => ({
|
||||||
keyboard: { type: Boolean, default: undefined },
|
keyboard: { type: Boolean, default: undefined },
|
||||||
extra: PropTypes.any,
|
extra: PropTypes.any,
|
||||||
footer: PropTypes.any,
|
footer: PropTypes.any,
|
||||||
footerStyle: PropTypes.object,
|
footerStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
|
||||||
level: PropTypes.any,
|
level: PropTypes.any,
|
||||||
levelMove: {
|
levelMove: {
|
||||||
type: [Number, Array, Function] as PropType<
|
type: [Number, Array, Function] as PropType<
|
||||||
|
@ -77,7 +81,10 @@ export const drawerProps = () => ({
|
||||||
},
|
},
|
||||||
handle: PropTypes.any,
|
handle: PropTypes.any,
|
||||||
/** @deprecated Use `@afterVisibleChange` instead */
|
/** @deprecated Use `@afterVisibleChange` instead */
|
||||||
afterVisibleChange: Function,
|
afterVisibleChange: Function as PropType<(visible: boolean) => void>,
|
||||||
|
onAfterVisibleChange: Function as PropType<(visible: boolean) => void>,
|
||||||
|
'onUpdate:visible': Function as PropType<(visible: boolean) => void>,
|
||||||
|
onClose: Function as PropType<MouseEventHandler | KeyboardEventHandler>,
|
||||||
});
|
});
|
||||||
|
|
||||||
export type DrawerProps = Partial<ExtractPropTypes<ReturnType<typeof drawerProps>>>;
|
export type DrawerProps = Partial<ExtractPropTypes<ReturnType<typeof drawerProps>>>;
|
||||||
|
@ -95,7 +102,7 @@ const Drawer = defineComponent({
|
||||||
push: defaultPushState,
|
push: defaultPushState,
|
||||||
}),
|
}),
|
||||||
slots: ['closeIcon', 'title', 'extra', 'footer', 'handle'],
|
slots: ['closeIcon', 'title', 'extra', 'footer', 'handle'],
|
||||||
emits: ['update:visible', 'close', 'afterVisibleChange'],
|
// emits: ['update:visible', 'close', 'afterVisibleChange'],
|
||||||
setup(props, { emit, slots, attrs }) {
|
setup(props, { emit, slots, attrs }) {
|
||||||
const sPush = ref(false);
|
const sPush = ref(false);
|
||||||
const destroyClose = ref(false);
|
const destroyClose = ref(false);
|
||||||
|
@ -343,6 +350,9 @@ const Drawer = defineComponent({
|
||||||
'title',
|
'title',
|
||||||
'push',
|
'push',
|
||||||
'wrapStyle',
|
'wrapStyle',
|
||||||
|
'onAfterVisibleChange',
|
||||||
|
'onClose',
|
||||||
|
'onUpdate:visible',
|
||||||
]),
|
]),
|
||||||
...val,
|
...val,
|
||||||
onClose: close,
|
onClose: close,
|
||||||
|
|
|
@ -20,7 +20,7 @@ export default defineComponent({
|
||||||
placement: 'bottomRight',
|
placement: 'bottomRight',
|
||||||
type: 'default',
|
type: 'default',
|
||||||
}),
|
}),
|
||||||
emits: ['click', 'visibleChange', 'update:visible'],
|
// emits: ['click', 'visibleChange', 'update:visible'],
|
||||||
slots: ['icon', 'leftButton', 'rightButton', 'overlay'],
|
slots: ['icon', 'leftButton', 'rightButton', 'overlay'],
|
||||||
setup(props, { slots, attrs, emit }) {
|
setup(props, { slots, attrs, emit }) {
|
||||||
const handleVisibleChange = (val: boolean) => {
|
const handleVisibleChange = (val: boolean) => {
|
||||||
|
|
|
@ -23,7 +23,7 @@ const Dropdown = defineComponent({
|
||||||
placement: 'bottomLeft',
|
placement: 'bottomLeft',
|
||||||
trigger: 'hover',
|
trigger: 'hover',
|
||||||
}),
|
}),
|
||||||
emits: ['visibleChange', 'update:visible'],
|
// emits: ['visibleChange', 'update:visible'],
|
||||||
slots: ['overlay'],
|
slots: ['overlay'],
|
||||||
setup(props, { slots, attrs, emit }) {
|
setup(props, { slots, attrs, emit }) {
|
||||||
const { prefixCls, rootPrefixCls, direction, getPopupContainer } = useConfigInject(
|
const { prefixCls, rootPrefixCls, direction, getPopupContainer } = useConfigInject(
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import { tuple } from '../_util/type';
|
import type { CSSProperties, PropType } from 'vue';
|
||||||
import type { PropType } from 'vue';
|
|
||||||
import PropTypes from '../_util/vue-types';
|
import PropTypes from '../_util/vue-types';
|
||||||
|
|
||||||
import buttonTypes from '../button/buttonTypes';
|
import buttonTypes from '../button/buttonTypes';
|
||||||
|
@ -35,23 +34,21 @@ const dropdownProps = () => ({
|
||||||
visible: { type: Boolean, default: undefined },
|
visible: { type: Boolean, default: undefined },
|
||||||
disabled: { type: Boolean, default: undefined },
|
disabled: { type: Boolean, default: undefined },
|
||||||
align: { type: Object as PropType<Align> },
|
align: { type: Object as PropType<Align> },
|
||||||
getPopupContainer: Function,
|
getPopupContainer: Function as PropType<(triggerNode: HTMLElement) => HTMLElement>,
|
||||||
prefixCls: String,
|
prefixCls: String,
|
||||||
transitionName: String,
|
transitionName: String,
|
||||||
placement: PropTypes.oneOf(
|
placement: String as PropType<
|
||||||
tuple(
|
| 'topLeft'
|
||||||
'topLeft',
|
| 'topCenter'
|
||||||
'topCenter',
|
| 'top'
|
||||||
'top',
|
| 'topRight'
|
||||||
'topRight',
|
| 'bottomLeft'
|
||||||
'bottomLeft',
|
| 'bottomCenter'
|
||||||
'bottomCenter',
|
| 'bottom'
|
||||||
'bottom',
|
| 'bottomRight'
|
||||||
'bottomRight',
|
>,
|
||||||
),
|
|
||||||
),
|
|
||||||
overlayClassName: String,
|
overlayClassName: String,
|
||||||
overlayStyle: PropTypes.style,
|
overlayStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
|
||||||
forceRender: { type: Boolean, default: undefined },
|
forceRender: { type: Boolean, default: undefined },
|
||||||
mouseEnterDelay: Number,
|
mouseEnterDelay: Number,
|
||||||
mouseLeaveDelay: Number,
|
mouseLeaveDelay: Number,
|
||||||
|
@ -70,7 +67,7 @@ const buttonTypesProps = buttonTypes();
|
||||||
const dropdownButtonProps = () => ({
|
const dropdownButtonProps = () => ({
|
||||||
...dropdownProps(),
|
...dropdownProps(),
|
||||||
type: buttonTypesProps.type,
|
type: buttonTypesProps.type,
|
||||||
size: PropTypes.oneOf(tuple('small', 'large')),
|
size: String as PropType<'small' | 'large'>,
|
||||||
htmlType: buttonTypesProps.htmlType,
|
htmlType: buttonTypesProps.htmlType,
|
||||||
href: String,
|
href: String,
|
||||||
disabled: { type: Boolean, default: undefined },
|
disabled: { type: Boolean, default: undefined },
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import type { CSSProperties, FunctionalComponent } from 'vue';
|
import type { CSSProperties, FunctionalComponent, PropType } from 'vue';
|
||||||
import classNames from '../_util/classNames';
|
import classNames from '../_util/classNames';
|
||||||
import LocaleReceiver from '../locale-provider/LocaleReceiver';
|
import LocaleReceiver from '../locale-provider/LocaleReceiver';
|
||||||
import DefaultEmptyImg from './empty';
|
import DefaultEmptyImg from './empty';
|
||||||
|
@ -88,7 +88,7 @@ Empty.props = {
|
||||||
prefixCls: String,
|
prefixCls: String,
|
||||||
image: PropTypes.any,
|
image: PropTypes.any,
|
||||||
description: PropTypes.any,
|
description: PropTypes.any,
|
||||||
imageStyle: PropTypes.object,
|
imageStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
|
||||||
};
|
};
|
||||||
|
|
||||||
export default withInstall(Empty);
|
export default withInstall(Empty);
|
||||||
|
|
|
@ -89,13 +89,13 @@ export const formItemProps = {
|
||||||
extra: PropTypes.any,
|
extra: PropTypes.any,
|
||||||
labelCol: { type: Object as PropType<ColProps & HTMLAttributes> },
|
labelCol: { type: Object as PropType<ColProps & HTMLAttributes> },
|
||||||
wrapperCol: { type: Object as PropType<ColProps & HTMLAttributes> },
|
wrapperCol: { type: Object as PropType<ColProps & HTMLAttributes> },
|
||||||
hasFeedback: PropTypes.looseBool.def(false),
|
hasFeedback: { type: Boolean, default: false },
|
||||||
colon: { type: Boolean, default: undefined },
|
colon: { type: Boolean, default: undefined },
|
||||||
labelAlign: PropTypes.oneOf(tuple('left', 'right')),
|
labelAlign: PropTypes.oneOf(tuple('left', 'right')),
|
||||||
prop: { type: [String, Number, Array] as PropType<string | number | Array<string | number>> },
|
prop: { type: [String, Number, Array] as PropType<string | number | Array<string | number>> },
|
||||||
name: { type: [String, Number, Array] as PropType<string | number | Array<string | number>> },
|
name: { type: [String, Number, Array] as PropType<string | number | Array<string | number>> },
|
||||||
rules: PropTypes.oneOfType([Array, Object]),
|
rules: PropTypes.oneOfType([Array, Object]),
|
||||||
autoLink: PropTypes.looseBool.def(true),
|
autoLink: { type: Boolean, default: true },
|
||||||
required: { type: Boolean, default: undefined },
|
required: { type: Boolean, default: undefined },
|
||||||
validateFirst: { type: Boolean, default: undefined },
|
validateFirst: { type: Boolean, default: undefined },
|
||||||
validateStatus: PropTypes.oneOf(tuple('', 'success', 'warning', 'error', 'validating')),
|
validateStatus: PropTypes.oneOf(tuple('', 'success', 'warning', 'error', 'validating')),
|
||||||
|
|
|
@ -31,7 +31,7 @@ export default defineComponent({
|
||||||
addonAfter: PropTypes.any,
|
addonAfter: PropTypes.any,
|
||||||
readonly: { type: Boolean, default: undefined },
|
readonly: { type: Boolean, default: undefined },
|
||||||
focused: { type: Boolean, default: undefined },
|
focused: { type: Boolean, default: undefined },
|
||||||
bordered: PropTypes.looseBool.def(true),
|
bordered: { type: Boolean, default: true },
|
||||||
triggerFocus: { type: Function as PropType<() => void> },
|
triggerFocus: { type: Function as PropType<() => void> },
|
||||||
hidden: Boolean,
|
hidden: Boolean,
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import type { PropType } from 'vue';
|
import type { PropType } from 'vue';
|
||||||
import { computed, defineComponent } from 'vue';
|
import { computed, defineComponent } from 'vue';
|
||||||
import PropTypes from '../_util/vue-types';
|
|
||||||
import type { SizeType } from '../config-provider';
|
import type { SizeType } from '../config-provider';
|
||||||
import type { FocusEventHandler, MouseEventHandler } from '../_util/EventInterface';
|
import type { FocusEventHandler, MouseEventHandler } from '../_util/EventInterface';
|
||||||
import useConfigInject from '../_util/hooks/useConfigInject';
|
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||||
|
|
|
@ -268,7 +268,7 @@ export default defineComponent({
|
||||||
valueModifiers = {},
|
valueModifiers = {},
|
||||||
htmlSize,
|
htmlSize,
|
||||||
} = props;
|
} = props;
|
||||||
const otherProps = omit(props as InputProps & { inputType: any; placeholder: string }, [
|
const otherProps = omit(props as InputProps & { placeholder: string }, [
|
||||||
'prefixCls',
|
'prefixCls',
|
||||||
'onPressEnter',
|
'onPressEnter',
|
||||||
'addonBefore',
|
'addonBefore',
|
||||||
|
@ -280,7 +280,6 @@ export default defineComponent({
|
||||||
// specify either the value prop, or the defaultValue prop, but not both.
|
// specify either the value prop, or the defaultValue prop, but not both.
|
||||||
'defaultValue',
|
'defaultValue',
|
||||||
'size',
|
'size',
|
||||||
'inputType',
|
|
||||||
'bordered',
|
'bordered',
|
||||||
'htmlSize',
|
'htmlSize',
|
||||||
'lazy',
|
'lazy',
|
||||||
|
|
|
@ -27,7 +27,7 @@ export default defineComponent({
|
||||||
prefixCls: String,
|
prefixCls: String,
|
||||||
inputPrefixCls: String,
|
inputPrefixCls: String,
|
||||||
action: PropTypes.string.def('click'),
|
action: PropTypes.string.def('click'),
|
||||||
visibilityToggle: PropTypes.looseBool.def(true),
|
visibilityToggle: { type: Boolean, default: true },
|
||||||
iconRender: Function,
|
iconRender: Function,
|
||||||
},
|
},
|
||||||
setup(props, { slots, attrs, expose }) {
|
setup(props, { slots, attrs, expose }) {
|
||||||
|
|
|
@ -57,7 +57,7 @@ const inputProps = {
|
||||||
suffix: PropTypes.any,
|
suffix: PropTypes.any,
|
||||||
autofocus: { type: Boolean, default: undefined },
|
autofocus: { type: Boolean, default: undefined },
|
||||||
allowClear: { type: Boolean, default: undefined },
|
allowClear: { type: Boolean, default: undefined },
|
||||||
lazy: PropTypes.looseBool.def(true),
|
lazy: { type: Boolean, default: true },
|
||||||
maxlength: Number,
|
maxlength: Number,
|
||||||
loading: { type: Boolean, default: undefined },
|
loading: { type: Boolean, default: undefined },
|
||||||
bordered: { type: Boolean, default: undefined },
|
bordered: { type: Boolean, default: undefined },
|
||||||
|
|
|
@ -29,7 +29,10 @@ export const siderProps = {
|
||||||
collapsed: { type: Boolean, default: undefined },
|
collapsed: { type: Boolean, default: undefined },
|
||||||
defaultCollapsed: { type: Boolean, default: undefined },
|
defaultCollapsed: { type: Boolean, default: undefined },
|
||||||
reverseArrow: { type: Boolean, default: undefined },
|
reverseArrow: { type: Boolean, default: undefined },
|
||||||
zeroWidthTriggerStyle: PropTypes.style,
|
zeroWidthTriggerStyle: {
|
||||||
|
type: Object as PropType<CSSProperties>,
|
||||||
|
default: undefined as CSSProperties,
|
||||||
|
},
|
||||||
trigger: PropTypes.any,
|
trigger: PropTypes.any,
|
||||||
width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
||||||
collapsedWidth: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
collapsedWidth: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import type { ExtractPropTypes, HTMLAttributes } from 'vue';
|
import type { ExtractPropTypes, HTMLAttributes } from 'vue';
|
||||||
import { computed, createVNode, defineComponent, provide, ref } from 'vue';
|
import { computed, createVNode, defineComponent, provide, ref } from 'vue';
|
||||||
import PropTypes from '../_util/vue-types';
|
|
||||||
import useConfigInject from '../_util/hooks/useConfigInject';
|
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||||
import { SiderHookProviderKey } from './injectionKey';
|
import { SiderHookProviderKey } from './injectionKey';
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ import classNames from '../_util/classNames';
|
||||||
import { isStringElement, isEmptyElement, flattenChildren } from '../_util/props-util';
|
import { isStringElement, isEmptyElement, flattenChildren } from '../_util/props-util';
|
||||||
import { Col } from '../grid';
|
import { Col } from '../grid';
|
||||||
import { cloneElement } from '../_util/vnode';
|
import { cloneElement } from '../_util/vnode';
|
||||||
|
import type { CSSProperties, PropType } from 'vue';
|
||||||
import { defineComponent, inject, ref } from 'vue';
|
import { defineComponent, inject, ref } from 'vue';
|
||||||
import ItemMeta from './ItemMeta';
|
import ItemMeta from './ItemMeta';
|
||||||
import useConfigInject from '../_util/hooks/useConfigInject';
|
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||||
|
@ -13,7 +14,7 @@ export const ListItemProps = {
|
||||||
extra: PropTypes.any,
|
extra: PropTypes.any,
|
||||||
actions: PropTypes.array,
|
actions: PropTypes.array,
|
||||||
grid: PropTypes.any,
|
grid: PropTypes.any,
|
||||||
colStyle: PropTypes.style,
|
colStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
|
||||||
};
|
};
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import type { App, VNode, PropType } from 'vue';
|
import type { App, VNode, PropType } from 'vue';
|
||||||
import { provide, defineComponent, reactive, watch } from 'vue';
|
import { provide, defineComponent, reactive, watch } from 'vue';
|
||||||
import PropTypes from '../_util/vue-types';
|
|
||||||
import type { ModalLocale } from '../modal/locale';
|
import type { ModalLocale } from '../modal/locale';
|
||||||
import warning from '../_util/warning';
|
import warning from '../_util/warning';
|
||||||
import { withInstall } from '../_util/type';
|
import { withInstall } from '../_util/type';
|
||||||
|
|
|
@ -68,8 +68,8 @@ export const modalProps = () => ({
|
||||||
default: undefined,
|
default: undefined,
|
||||||
},
|
},
|
||||||
zIndex: Number,
|
zIndex: Number,
|
||||||
bodyStyle: Object as PropType<CSSProperties>,
|
bodyStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
|
||||||
maskStyle: Object as PropType<CSSProperties>,
|
maskStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
|
||||||
mask: { type: Boolean, default: undefined },
|
mask: { type: Boolean, default: undefined },
|
||||||
keyboard: { type: Boolean, default: undefined },
|
keyboard: { type: Boolean, default: undefined },
|
||||||
wrapProps: Object,
|
wrapProps: Object,
|
||||||
|
|
|
@ -31,7 +31,7 @@ export const popconfirmProps = () => ({
|
||||||
type: String as PropType<LegacyButtonType>,
|
type: String as PropType<LegacyButtonType>,
|
||||||
default: 'primary',
|
default: 'primary',
|
||||||
},
|
},
|
||||||
disabled: PropTypes.looseBool.def(false),
|
disabled: { type: Boolean, default: false },
|
||||||
okText: PropTypes.any,
|
okText: PropTypes.any,
|
||||||
cancelText: PropTypes.any,
|
cancelText: PropTypes.any,
|
||||||
icon: PropTypes.any,
|
icon: PropTypes.any,
|
||||||
|
|
|
@ -2,7 +2,6 @@ import type { CSSProperties, ExtractPropTypes, PropType } from 'vue';
|
||||||
import { presetPrimaryColors } from '@ant-design/colors';
|
import { presetPrimaryColors } from '@ant-design/colors';
|
||||||
import { computed, defineComponent } from 'vue';
|
import { computed, defineComponent } from 'vue';
|
||||||
import type { Direction } from '../config-provider';
|
import type { Direction } from '../config-provider';
|
||||||
import PropTypes from '../_util/vue-types';
|
|
||||||
import type { StringGradients, ProgressGradient } from './props';
|
import type { StringGradients, ProgressGradient } from './props';
|
||||||
import { progressProps } from './props';
|
import { progressProps } from './props';
|
||||||
import { getSuccessPercent, validProgress } from './utils';
|
import { getSuccessPercent, validProgress } from './utils';
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import type { ExtractPropTypes, PropType } from 'vue';
|
import type { ExtractPropTypes, PropType } from 'vue';
|
||||||
import { computed, defineComponent } from 'vue';
|
import { computed, defineComponent } from 'vue';
|
||||||
import type { VueNode } from '../_util/type';
|
import type { VueNode } from '../_util/type';
|
||||||
import PropTypes from '../_util/vue-types';
|
|
||||||
import type { ProgressSize } from './props';
|
import type { ProgressSize } from './props';
|
||||||
import { progressProps } from './props';
|
import { progressProps } from './props';
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import type { ExtractPropTypes, PropType } from 'vue';
|
import type { CSSProperties, ExtractPropTypes, PropType } from 'vue';
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import PropTypes from '../_util/vue-types';
|
import PropTypes from '../_util/vue-types';
|
||||||
import initDefaultProps from '../_util/props-util/initDefaultProps';
|
import initDefaultProps from '../_util/props-util/initDefaultProps';
|
||||||
|
@ -15,7 +15,7 @@ export const statisticProps = {
|
||||||
value: {
|
value: {
|
||||||
type: [String, Number, Object] as PropType<countdownValueType>,
|
type: [String, Number, Object] as PropType<countdownValueType>,
|
||||||
},
|
},
|
||||||
valueStyle: PropTypes.style,
|
valueStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
|
||||||
valueRender: PropTypes.any,
|
valueRender: PropTypes.any,
|
||||||
formatter: PropTypes.any,
|
formatter: PropTypes.any,
|
||||||
precision: Number,
|
precision: Number,
|
||||||
|
|
|
@ -22,9 +22,10 @@ import classNames from '../../../_util/classNames';
|
||||||
import useConfigInject from '../../../_util/hooks/useConfigInject';
|
import useConfigInject from '../../../_util/hooks/useConfigInject';
|
||||||
import { useInjectSlots } from '../../context';
|
import { useInjectSlots } from '../../context';
|
||||||
import type { DataNode, EventDataNode } from '../../../tree';
|
import type { DataNode, EventDataNode } from '../../../tree';
|
||||||
import type { CheckboxChangeEvent, EventHandler } from '../../../_util/EventInterface';
|
import type { EventHandler } from '../../../_util/EventInterface';
|
||||||
import FilterSearch from './FilterSearch';
|
import FilterSearch from './FilterSearch';
|
||||||
import Tree from '../../../tree';
|
import Tree from '../../../tree';
|
||||||
|
import type { CheckboxChangeEvent } from '../../../checkbox/interface';
|
||||||
|
|
||||||
interface FilterRestProps {
|
interface FilterRestProps {
|
||||||
confirm?: Boolean;
|
confirm?: Boolean;
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import type { PropType } from 'vue';
|
import type { PropType } from 'vue';
|
||||||
import { defineComponent, computed } from 'vue';
|
import { defineComponent, computed } from 'vue';
|
||||||
import classNames from '../_util/classNames';
|
import classNames from '../_util/classNames';
|
||||||
import PropTypes from '../_util/vue-types';
|
|
||||||
import useConfigInject from '../_util/hooks/useConfigInject';
|
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||||
|
|
||||||
const CheckableTag = defineComponent({
|
const CheckableTag = defineComponent({
|
||||||
|
|
|
@ -18,7 +18,7 @@ export const tagProps = {
|
||||||
color: {
|
color: {
|
||||||
type: String as PropType<LiteralUnion<PresetColorType | PresetStatusColorType, string>>,
|
type: String as PropType<LiteralUnion<PresetColorType | PresetStatusColorType, string>>,
|
||||||
},
|
},
|
||||||
closable: PropTypes.looseBool.def(false),
|
closable: { type: Boolean, default: false },
|
||||||
closeIcon: PropTypes.any,
|
closeIcon: PropTypes.any,
|
||||||
visible: { type: Boolean, default: undefined },
|
visible: { type: Boolean, default: undefined },
|
||||||
onClose: {
|
onClose: {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import PropTypes from '../_util/vue-types';
|
import PropTypes from '../_util/vue-types';
|
||||||
import { tuple } from '../_util/type';
|
import { tuple } from '../_util/type';
|
||||||
|
import type { CSSProperties, PropType } from 'vue';
|
||||||
export const triggerTypes = tuple('hover', 'focus', 'click', 'contextmenu');
|
export const triggerTypes = tuple('hover', 'focus', 'click', 'contextmenu');
|
||||||
|
|
||||||
export const placementTypes = tuple(
|
export const placementTypes = tuple(
|
||||||
|
@ -27,7 +28,7 @@ export default () => ({
|
||||||
placement: PropTypes.oneOf(placementTypes),
|
placement: PropTypes.oneOf(placementTypes),
|
||||||
color: String,
|
color: String,
|
||||||
transitionName: String,
|
transitionName: String,
|
||||||
overlayStyle: PropTypes.style,
|
overlayStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
|
||||||
overlayClassName: String,
|
overlayClassName: String,
|
||||||
openClassName: String,
|
openClassName: String,
|
||||||
prefixCls: String,
|
prefixCls: String,
|
||||||
|
|
|
@ -76,7 +76,7 @@ export const transferProps = {
|
||||||
type: [Function, Object] as PropType<((style: ListStyle) => CSSProperties) | CSSProperties>,
|
type: [Function, Object] as PropType<((style: ListStyle) => CSSProperties) | CSSProperties>,
|
||||||
default: () => ({}),
|
default: () => ({}),
|
||||||
},
|
},
|
||||||
operationStyle: PropTypes.style,
|
operationStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
|
||||||
titles: { type: Array as PropType<string[]> },
|
titles: { type: Array as PropType<string[]> },
|
||||||
operations: { type: Array as PropType<string[]> },
|
operations: { type: Array as PropType<string[]> },
|
||||||
showSearch: { type: Boolean, default: false },
|
showSearch: { type: Boolean, default: false },
|
||||||
|
|
|
@ -35,7 +35,7 @@ export const transferListProps = {
|
||||||
handleFilter: Function,
|
handleFilter: Function,
|
||||||
handleClear: Function,
|
handleClear: Function,
|
||||||
renderItem: Function,
|
renderItem: Function,
|
||||||
showSearch: PropTypes.looseBool.def(false),
|
showSearch: { type: Boolean, default: false },
|
||||||
searchPlaceholder: String,
|
searchPlaceholder: String,
|
||||||
notFoundContent: PropTypes.any,
|
notFoundContent: PropTypes.any,
|
||||||
itemUnit: String,
|
itemUnit: String,
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import PropTypes from '../_util/vue-types';
|
|
||||||
import initDefaultProps from '../_util/props-util/initDefaultProps';
|
import initDefaultProps from '../_util/props-util/initDefaultProps';
|
||||||
import SearchOutlined from '@ant-design/icons-vue/SearchOutlined';
|
import SearchOutlined from '@ant-design/icons-vue/SearchOutlined';
|
||||||
import Input from '../input';
|
import Input from '../input';
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import PropTypes from '../_util/vue-types';
|
|
||||||
import type { HTMLAttributes } from 'vue';
|
import type { HTMLAttributes } from 'vue';
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import useConfigInject from '../_util/hooks/useConfigInject';
|
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import type { ExtractPropTypes } from 'vue';
|
import type { CSSProperties, ExtractPropTypes, PropType } from 'vue';
|
||||||
|
import type { MouseEventHandler } from '../_util/EventInterface';
|
||||||
import PropTypes from '../_util/vue-types';
|
import PropTypes from '../_util/vue-types';
|
||||||
|
|
||||||
function dialogPropTypes() {
|
function dialogPropTypes() {
|
||||||
|
@ -20,19 +21,19 @@ function dialogPropTypes() {
|
||||||
maskTransitionName: String,
|
maskTransitionName: String,
|
||||||
animation: PropTypes.any,
|
animation: PropTypes.any,
|
||||||
maskAnimation: PropTypes.any,
|
maskAnimation: PropTypes.any,
|
||||||
wrapStyle: PropTypes.object,
|
wrapStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
|
||||||
bodyStyle: PropTypes.object,
|
bodyStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
|
||||||
maskStyle: PropTypes.object,
|
maskStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
|
||||||
prefixCls: String,
|
prefixCls: String,
|
||||||
wrapClassName: String,
|
wrapClassName: String,
|
||||||
width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
width: [String, Number],
|
||||||
height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
height: [String, Number],
|
||||||
zIndex: Number,
|
zIndex: Number,
|
||||||
bodyProps: PropTypes.any,
|
bodyProps: PropTypes.any,
|
||||||
maskProps: PropTypes.any,
|
maskProps: PropTypes.any,
|
||||||
wrapProps: PropTypes.any,
|
wrapProps: PropTypes.any,
|
||||||
getContainer: PropTypes.any,
|
getContainer: PropTypes.any,
|
||||||
dialogStyle: PropTypes.object,
|
dialogStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
|
||||||
dialogClass: String,
|
dialogClass: String,
|
||||||
closeIcon: PropTypes.any,
|
closeIcon: PropTypes.any,
|
||||||
forceRender: { type: Boolean, default: undefined },
|
forceRender: { type: Boolean, default: undefined },
|
||||||
|
@ -40,7 +41,7 @@ function dialogPropTypes() {
|
||||||
// https://github.com/ant-design/ant-design/issues/19771
|
// https://github.com/ant-design/ant-design/issues/19771
|
||||||
// https://github.com/react-component/dialog/issues/95
|
// https://github.com/react-component/dialog/issues/95
|
||||||
focusTriggerAfterClose: { type: Boolean, default: undefined },
|
focusTriggerAfterClose: { type: Boolean, default: undefined },
|
||||||
onClose: Function,
|
onClose: Function as PropType<MouseEventHandler>,
|
||||||
modalRender: Function,
|
modalRender: Function,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import PropTypes from '../../_util/vue-types';
|
import PropTypes from '../../_util/vue-types';
|
||||||
import type { PropType } from 'vue';
|
import type { CSSProperties, PropType } from 'vue';
|
||||||
|
|
||||||
export type IPlacement = 'left' | 'top' | 'right' | 'bottom';
|
export type IPlacement = 'left' | 'top' | 'right' | 'bottom';
|
||||||
type ILevelMove = number | [number, number];
|
type ILevelMove = number | [number, number];
|
||||||
|
@ -7,7 +7,7 @@ const props = () => ({
|
||||||
prefixCls: String,
|
prefixCls: String,
|
||||||
width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
||||||
height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
||||||
style: PropTypes.style,
|
style: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
|
||||||
class: String,
|
class: String,
|
||||||
placement: {
|
placement: {
|
||||||
type: String as PropType<IPlacement>,
|
type: String as PropType<IPlacement>,
|
||||||
|
@ -23,10 +23,13 @@ const props = () => ({
|
||||||
ease: String,
|
ease: String,
|
||||||
showMask: { type: Boolean, default: undefined },
|
showMask: { type: Boolean, default: undefined },
|
||||||
maskClosable: { type: Boolean, default: undefined },
|
maskClosable: { type: Boolean, default: undefined },
|
||||||
maskStyle: PropTypes.style,
|
maskStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
|
||||||
afterVisibleChange: Function,
|
afterVisibleChange: Function,
|
||||||
keyboard: { type: Boolean, default: undefined },
|
keyboard: { type: Boolean, default: undefined },
|
||||||
contentWrapperStyle: PropTypes.style,
|
contentWrapperStyle: {
|
||||||
|
type: Object as PropType<CSSProperties>,
|
||||||
|
default: undefined as CSSProperties,
|
||||||
|
},
|
||||||
autofocus: { type: Boolean, default: undefined },
|
autofocus: { type: Boolean, default: undefined },
|
||||||
open: { type: Boolean, default: undefined },
|
open: { type: Boolean, default: undefined },
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import type { CSSProperties, PropType } from 'vue';
|
||||||
import { computed, defineComponent, ref, watch } from 'vue';
|
import { computed, defineComponent, ref, watch } from 'vue';
|
||||||
import PropTypes from '../_util/vue-types';
|
import PropTypes from '../_util/vue-types';
|
||||||
import Trigger from '../vc-trigger';
|
import Trigger from '../vc-trigger';
|
||||||
|
@ -8,14 +9,14 @@ import classNames from '../_util/classNames';
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
props: {
|
props: {
|
||||||
minOverlayWidthMatchTrigger: { type: Boolean, default: undefined },
|
minOverlayWidthMatchTrigger: { type: Boolean, default: undefined },
|
||||||
arrow: PropTypes.looseBool.def(false),
|
arrow: { type: Boolean, default: false },
|
||||||
prefixCls: PropTypes.string.def('rc-dropdown'),
|
prefixCls: PropTypes.string.def('rc-dropdown'),
|
||||||
transitionName: String,
|
transitionName: String,
|
||||||
overlayClassName: PropTypes.string.def(''),
|
overlayClassName: PropTypes.string.def(''),
|
||||||
openClassName: String,
|
openClassName: String,
|
||||||
animation: PropTypes.any,
|
animation: PropTypes.any,
|
||||||
align: PropTypes.object,
|
align: PropTypes.object,
|
||||||
overlayStyle: PropTypes.style,
|
overlayStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
|
||||||
placement: PropTypes.string.def('bottomLeft'),
|
placement: PropTypes.string.def('bottomLeft'),
|
||||||
overlay: PropTypes.any,
|
overlay: PropTypes.any,
|
||||||
trigger: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]).def(
|
trigger: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]).def(
|
||||||
|
@ -26,7 +27,7 @@ export default defineComponent({
|
||||||
hideAction: PropTypes.array,
|
hideAction: PropTypes.array,
|
||||||
getPopupContainer: Function,
|
getPopupContainer: Function,
|
||||||
visible: { type: Boolean, default: undefined },
|
visible: { type: Boolean, default: undefined },
|
||||||
defaultVisible: PropTypes.looseBool.def(false),
|
defaultVisible: { type: Boolean, default: false },
|
||||||
mouseEnterDelay: PropTypes.number.def(0.15),
|
mouseEnterDelay: PropTypes.number.def(0.15),
|
||||||
mouseLeaveDelay: PropTypes.number.def(0.1),
|
mouseLeaveDelay: PropTypes.number.def(0.1),
|
||||||
},
|
},
|
||||||
|
|
|
@ -31,7 +31,7 @@ export interface ImagePropsType extends Omit<ImgHTMLAttributes, 'placeholder' |
|
||||||
export const imageProps = {
|
export const imageProps = {
|
||||||
src: String,
|
src: String,
|
||||||
wrapperClassName: String,
|
wrapperClassName: String,
|
||||||
wrapperStyle: PropTypes.style,
|
wrapperStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
|
||||||
prefixCls: String,
|
prefixCls: String,
|
||||||
previewPrefixCls: String,
|
previewPrefixCls: String,
|
||||||
placeholder: PropTypes.any,
|
placeholder: PropTypes.any,
|
||||||
|
|
|
@ -8,7 +8,6 @@ import LeftOutlined from '@ant-design/icons-vue/LeftOutlined';
|
||||||
import RightOutlined from '@ant-design/icons-vue/RightOutlined';
|
import RightOutlined from '@ant-design/icons-vue/RightOutlined';
|
||||||
|
|
||||||
import classnames from '../../_util/classNames';
|
import classnames from '../../_util/classNames';
|
||||||
import PropTypes from '../../_util/vue-types';
|
|
||||||
import Dialog from '../../vc-dialog';
|
import Dialog from '../../vc-dialog';
|
||||||
import getIDialogPropTypes from '../../vc-dialog/IDialogPropTypes';
|
import getIDialogPropTypes from '../../vc-dialog/IDialogPropTypes';
|
||||||
import { getOffset } from '../../vc-util/Dom/css';
|
import { getOffset } from '../../vc-util/Dom/css';
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import PropTypes from '../../_util/vue-types';
|
|
||||||
import Trigger from '../../vc-trigger';
|
import Trigger from '../../vc-trigger';
|
||||||
import DropdownMenu from './DropdownMenu';
|
import DropdownMenu from './DropdownMenu';
|
||||||
import type { PropType } from 'vue';
|
import type { PropType } from 'vue';
|
||||||
|
|
|
@ -38,14 +38,14 @@ export default defineComponent({
|
||||||
total: PropTypes.number.def(0),
|
total: PropTypes.number.def(0),
|
||||||
pageSize: Number,
|
pageSize: Number,
|
||||||
defaultPageSize: PropTypes.number.def(10),
|
defaultPageSize: PropTypes.number.def(10),
|
||||||
hideOnSinglePage: PropTypes.looseBool.def(false),
|
hideOnSinglePage: { type: Boolean, default: false },
|
||||||
showSizeChanger: { type: Boolean, default: undefined },
|
showSizeChanger: { type: Boolean, default: undefined },
|
||||||
showLessItems: PropTypes.looseBool.def(false),
|
showLessItems: { type: Boolean, default: false },
|
||||||
// showSizeChange: PropTypes.func.def(noop),
|
// showSizeChange: PropTypes.func.def(noop),
|
||||||
selectComponentClass: PropTypes.any,
|
selectComponentClass: PropTypes.any,
|
||||||
showPrevNextJumpers: PropTypes.looseBool.def(true),
|
showPrevNextJumpers: { type: Boolean, default: true },
|
||||||
showQuickJumper: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object]).def(false),
|
showQuickJumper: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object]).def(false),
|
||||||
showTitle: PropTypes.looseBool.def(true),
|
showTitle: { type: Boolean, default: true },
|
||||||
pageSizeOptions: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),
|
pageSizeOptions: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),
|
||||||
buildOptionText: Function,
|
buildOptionText: Function,
|
||||||
showTotal: Function,
|
showTotal: Function,
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import type { PropType, ExtractPropTypes } from 'vue';
|
import type { PropType, ExtractPropTypes } from 'vue';
|
||||||
import PropTypes from '../../_util/vue-types';
|
|
||||||
|
|
||||||
export type StrokeColorType = string | string[] | object;
|
export type StrokeColorType = string | string[] | object;
|
||||||
|
|
||||||
|
|
|
@ -1,54 +1,54 @@
|
||||||
import PropTypes from '../_util/vue-types';
|
import PropTypes from '../_util/vue-types';
|
||||||
|
|
||||||
const defaultProps = {
|
const defaultProps = {
|
||||||
accessibility: PropTypes.looseBool.def(true),
|
accessibility: { type: Boolean, default: true },
|
||||||
// 自定义高度
|
// 自定义高度
|
||||||
adaptiveHeight: PropTypes.looseBool.def(false),
|
adaptiveHeight: { type: Boolean, default: false },
|
||||||
afterChange: PropTypes.any.def(null),
|
afterChange: PropTypes.any.def(null),
|
||||||
arrows: PropTypes.looseBool.def(true),
|
arrows: { type: Boolean, default: true },
|
||||||
autoplay: PropTypes.looseBool.def(false),
|
autoplay: { type: Boolean, default: false },
|
||||||
autoplaySpeed: PropTypes.number.def(3000),
|
autoplaySpeed: PropTypes.number.def(3000),
|
||||||
beforeChange: PropTypes.any.def(null),
|
beforeChange: PropTypes.any.def(null),
|
||||||
centerMode: PropTypes.looseBool.def(false),
|
centerMode: { type: Boolean, default: false },
|
||||||
centerPadding: PropTypes.string.def('50px'),
|
centerPadding: PropTypes.string.def('50px'),
|
||||||
cssEase: PropTypes.string.def('ease'),
|
cssEase: PropTypes.string.def('ease'),
|
||||||
dots: PropTypes.looseBool.def(false),
|
dots: { type: Boolean, default: false },
|
||||||
dotsClass: PropTypes.string.def('slick-dots'),
|
dotsClass: PropTypes.string.def('slick-dots'),
|
||||||
draggable: PropTypes.looseBool.def(true),
|
draggable: { type: Boolean, default: true },
|
||||||
unslick: PropTypes.looseBool.def(false),
|
unslick: { type: Boolean, default: false },
|
||||||
easing: PropTypes.string.def('linear'),
|
easing: PropTypes.string.def('linear'),
|
||||||
edgeFriction: PropTypes.number.def(0.35),
|
edgeFriction: PropTypes.number.def(0.35),
|
||||||
fade: PropTypes.looseBool.def(false),
|
fade: { type: Boolean, default: false },
|
||||||
focusOnSelect: PropTypes.looseBool.def(false),
|
focusOnSelect: { type: Boolean, default: false },
|
||||||
infinite: PropTypes.looseBool.def(true),
|
infinite: { type: Boolean, default: true },
|
||||||
initialSlide: PropTypes.number.def(0),
|
initialSlide: PropTypes.number.def(0),
|
||||||
lazyLoad: PropTypes.any.def(null),
|
lazyLoad: PropTypes.any.def(null),
|
||||||
verticalSwiping: PropTypes.looseBool.def(false),
|
verticalSwiping: { type: Boolean, default: false },
|
||||||
asNavFor: PropTypes.any.def(null),
|
asNavFor: PropTypes.any.def(null),
|
||||||
// 圆点hover是否暂停
|
// 圆点hover是否暂停
|
||||||
pauseOnDotsHover: PropTypes.looseBool.def(false),
|
pauseOnDotsHover: { type: Boolean, default: false },
|
||||||
// focus是否暂停
|
// focus是否暂停
|
||||||
pauseOnFocus: PropTypes.looseBool.def(false),
|
pauseOnFocus: { type: Boolean, default: false },
|
||||||
// hover是否暂停
|
// hover是否暂停
|
||||||
pauseOnHover: PropTypes.looseBool.def(true),
|
pauseOnHover: { type: Boolean, default: true },
|
||||||
responsive: PropTypes.array,
|
responsive: PropTypes.array,
|
||||||
rows: PropTypes.number.def(1),
|
rows: PropTypes.number.def(1),
|
||||||
rtl: PropTypes.looseBool.def(false),
|
rtl: { type: Boolean, default: false },
|
||||||
slide: PropTypes.string.def('div'),
|
slide: PropTypes.string.def('div'),
|
||||||
slidesPerRow: PropTypes.number.def(1),
|
slidesPerRow: PropTypes.number.def(1),
|
||||||
slidesToScroll: PropTypes.number.def(1),
|
slidesToScroll: PropTypes.number.def(1),
|
||||||
slidesToShow: PropTypes.number.def(1),
|
slidesToShow: PropTypes.number.def(1),
|
||||||
speed: PropTypes.number.def(500),
|
speed: PropTypes.number.def(500),
|
||||||
swipe: PropTypes.looseBool.def(true),
|
swipe: { type: Boolean, default: true },
|
||||||
swipeEvent: PropTypes.any.def(null),
|
swipeEvent: PropTypes.any.def(null),
|
||||||
swipeToSlide: PropTypes.looseBool.def(false),
|
swipeToSlide: { type: Boolean, default: false },
|
||||||
touchMove: PropTypes.looseBool.def(true),
|
touchMove: { type: Boolean, default: true },
|
||||||
touchThreshold: PropTypes.number.def(5),
|
touchThreshold: PropTypes.number.def(5),
|
||||||
useCSS: PropTypes.looseBool.def(true),
|
useCSS: { type: Boolean, default: true },
|
||||||
useTransform: PropTypes.looseBool.def(true),
|
useTransform: { type: Boolean, default: true },
|
||||||
variableWidth: PropTypes.looseBool.def(false),
|
variableWidth: { type: Boolean, default: false },
|
||||||
vertical: PropTypes.looseBool.def(false),
|
vertical: { type: Boolean, default: false },
|
||||||
waitForAnimate: PropTypes.looseBool.def(true),
|
waitForAnimate: { type: Boolean, default: true },
|
||||||
children: PropTypes.array,
|
children: PropTypes.array,
|
||||||
__propsSymbol__: PropTypes.any,
|
__propsSymbol__: PropTypes.any,
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import PropTypes, { withUndefined } from '../_util/vue-types';
|
import PropTypes, { withUndefined } from '../_util/vue-types';
|
||||||
import type { CSSProperties } from 'vue';
|
import type { CSSProperties, PropType } from 'vue';
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import type { EventHandler } from '../_util/EventInterface';
|
import type { EventHandler } from '../_util/EventInterface';
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ function isString(str: any): str is string {
|
||||||
function noop() {}
|
function noop() {}
|
||||||
export const VcStepProps = () => ({
|
export const VcStepProps = () => ({
|
||||||
prefixCls: String,
|
prefixCls: String,
|
||||||
wrapperStyle: PropTypes.style,
|
wrapperStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
|
||||||
itemWidth: String,
|
itemWidth: String,
|
||||||
active: { type: Boolean, default: undefined },
|
active: { type: Boolean, default: undefined },
|
||||||
disabled: { type: Boolean, default: undefined },
|
disabled: { type: Boolean, default: undefined },
|
||||||
|
|
|
@ -3,6 +3,7 @@ import Trigger from '../../vc-trigger';
|
||||||
import { placements } from './placements';
|
import { placements } from './placements';
|
||||||
import Content from './Content';
|
import Content from './Content';
|
||||||
import { getPropsSlot } from '../../_util/props-util';
|
import { getPropsSlot } from '../../_util/props-util';
|
||||||
|
import type { CSSProperties, PropType } from 'vue';
|
||||||
import { defineComponent, ref, watchEffect } from 'vue';
|
import { defineComponent, ref, watchEffect } from 'vue';
|
||||||
function noop() {}
|
function noop() {}
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
|
@ -16,18 +17,21 @@ export default defineComponent({
|
||||||
transitionName: String,
|
transitionName: String,
|
||||||
animation: PropTypes.any,
|
animation: PropTypes.any,
|
||||||
afterVisibleChange: PropTypes.func.def(() => {}),
|
afterVisibleChange: PropTypes.func.def(() => {}),
|
||||||
overlayStyle: PropTypes.style,
|
overlayStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
|
||||||
overlayClassName: String,
|
overlayClassName: String,
|
||||||
prefixCls: PropTypes.string.def('rc-tooltip'),
|
prefixCls: PropTypes.string.def('rc-tooltip'),
|
||||||
mouseEnterDelay: PropTypes.number.def(0.1),
|
mouseEnterDelay: PropTypes.number.def(0.1),
|
||||||
mouseLeaveDelay: PropTypes.number.def(0.1),
|
mouseLeaveDelay: PropTypes.number.def(0.1),
|
||||||
getTooltipContainer: Function,
|
getTooltipContainer: Function,
|
||||||
destroyTooltipOnHide: PropTypes.looseBool.def(false),
|
destroyTooltipOnHide: { type: Boolean, default: false },
|
||||||
align: PropTypes.object.def(() => ({})),
|
align: PropTypes.object.def(() => ({})),
|
||||||
arrowContent: PropTypes.any.def(null),
|
arrowContent: PropTypes.any.def(null),
|
||||||
tipId: String,
|
tipId: String,
|
||||||
builtinPlacements: PropTypes.object,
|
builtinPlacements: PropTypes.object,
|
||||||
overlayInnerStyle: PropTypes.style,
|
overlayInnerStyle: {
|
||||||
|
type: Object as PropType<CSSProperties>,
|
||||||
|
default: undefined as CSSProperties,
|
||||||
|
},
|
||||||
popupVisible: { type: Boolean, default: undefined },
|
popupVisible: { type: Boolean, default: undefined },
|
||||||
onVisibleChange: Function,
|
onVisibleChange: Function,
|
||||||
onPopupAlign: Function,
|
onPopupAlign: Function,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import type { HTMLAttributes } from 'vue';
|
import type { CSSProperties, HTMLAttributes, PropType } from 'vue';
|
||||||
import { computed, defineComponent, inject, provide, ref } from 'vue';
|
import { computed, defineComponent, inject, provide, ref } from 'vue';
|
||||||
import PropTypes from '../_util/vue-types';
|
import PropTypes from '../_util/vue-types';
|
||||||
import contains from '../vc-util/Dom/contains';
|
import contains from '../vc-util/Dom/contains';
|
||||||
|
@ -56,7 +56,7 @@ export default defineComponent({
|
||||||
onPopupVisibleChange: PropTypes.func.def(noop),
|
onPopupVisibleChange: PropTypes.func.def(noop),
|
||||||
afterPopupVisibleChange: PropTypes.func.def(noop),
|
afterPopupVisibleChange: PropTypes.func.def(noop),
|
||||||
popup: PropTypes.any,
|
popup: PropTypes.any,
|
||||||
popupStyle: PropTypes.style,
|
popupStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
|
||||||
prefixCls: PropTypes.string.def('rc-trigger-popup'),
|
prefixCls: PropTypes.string.def('rc-trigger-popup'),
|
||||||
popupClassName: PropTypes.string.def(''),
|
popupClassName: PropTypes.string.def(''),
|
||||||
popupPlacement: String,
|
popupPlacement: String,
|
||||||
|
@ -71,20 +71,20 @@ export default defineComponent({
|
||||||
getPopupContainer: Function,
|
getPopupContainer: Function,
|
||||||
getDocument: PropTypes.func.def(returnDocument),
|
getDocument: PropTypes.func.def(returnDocument),
|
||||||
forceRender: { type: Boolean, default: undefined },
|
forceRender: { type: Boolean, default: undefined },
|
||||||
destroyPopupOnHide: PropTypes.looseBool.def(false),
|
destroyPopupOnHide: { type: Boolean, default: false },
|
||||||
mask: PropTypes.looseBool.def(false),
|
mask: { type: Boolean, default: false },
|
||||||
maskClosable: PropTypes.looseBool.def(true),
|
maskClosable: { type: Boolean, default: true },
|
||||||
// onPopupAlign: PropTypes.func.def(noop),
|
// onPopupAlign: PropTypes.func.def(noop),
|
||||||
popupAlign: PropTypes.object.def(() => ({})),
|
popupAlign: PropTypes.object.def(() => ({})),
|
||||||
popupVisible: { type: Boolean, default: undefined },
|
popupVisible: { type: Boolean, default: undefined },
|
||||||
defaultPopupVisible: PropTypes.looseBool.def(false),
|
defaultPopupVisible: { type: Boolean, default: false },
|
||||||
maskTransitionName: String,
|
maskTransitionName: String,
|
||||||
maskAnimation: String,
|
maskAnimation: String,
|
||||||
stretch: String,
|
stretch: String,
|
||||||
alignPoint: { type: Boolean, default: undefined }, // Maybe we can support user pass position in the future
|
alignPoint: { type: Boolean, default: undefined }, // Maybe we can support user pass position in the future
|
||||||
autoDestroy: PropTypes.looseBool.def(false),
|
autoDestroy: { type: Boolean, default: false },
|
||||||
mobile: Object,
|
mobile: Object,
|
||||||
getTriggerDOMNode: Function,
|
getTriggerDOMNode: Function as PropType<(d?: HTMLElement) => HTMLElement>,
|
||||||
},
|
},
|
||||||
setup(props) {
|
setup(props) {
|
||||||
const align = computed(() => {
|
const align = computed(() => {
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
import type { PropType } from 'vue';
|
|
||||||
import { defineComponent, reactive } from 'vue';
|
import { defineComponent, reactive } from 'vue';
|
||||||
|
import type { PropType } from 'vue';
|
||||||
import classNames from '../_util/classNames';
|
import classNames from '../_util/classNames';
|
||||||
import createRef from '../_util/createRef';
|
import createRef from '../_util/createRef';
|
||||||
import raf from '../_util/raf';
|
import raf from '../_util/raf';
|
||||||
import supportsPassive from '../_util/supportsPassive';
|
import supportsPassive from '../_util/supportsPassive';
|
||||||
import PropTypes from '../_util/vue-types';
|
|
||||||
|
|
||||||
const MIN_SIZE = 20;
|
const MIN_SIZE = 20;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue