feat: support vue 3.3 slot type
parent
9499a7fc86
commit
b4258dc23d
|
@ -21,7 +21,7 @@ export default defineComponent({
|
||||||
name: 'AAnchorLink',
|
name: 'AAnchorLink',
|
||||||
props: initDefaultProps(anchorLinkProps(), { href: '#' }),
|
props: initDefaultProps(anchorLinkProps(), { href: '#' }),
|
||||||
slots: Object as CustomSlotsType<{
|
slots: Object as CustomSlotsType<{
|
||||||
title: AnchorLinkProps;
|
title: any;
|
||||||
default: any;
|
default: any;
|
||||||
}>,
|
}>,
|
||||||
setup(props, { slots }) {
|
setup(props, { slots }) {
|
||||||
|
|
|
@ -42,7 +42,7 @@ const Avatar = defineComponent({
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
props: avatarProps(),
|
props: avatarProps(),
|
||||||
slots: Object as CustomSlotsType<{
|
slots: Object as CustomSlotsType<{
|
||||||
icon: AvatarProps;
|
icon: any;
|
||||||
default: any;
|
default: any;
|
||||||
}>,
|
}>,
|
||||||
setup(props, { slots, attrs }) {
|
setup(props, { slots, attrs }) {
|
||||||
|
|
|
@ -41,7 +41,7 @@ export default defineComponent({
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
props: badgeProps(),
|
props: badgeProps(),
|
||||||
slots: Object as CustomSlotsType<{
|
slots: Object as CustomSlotsType<{
|
||||||
text: BadgeProps;
|
text: any;
|
||||||
count: any;
|
count: any;
|
||||||
default: any;
|
default: any;
|
||||||
}>,
|
}>,
|
||||||
|
|
|
@ -56,7 +56,7 @@ export default defineComponent({
|
||||||
name: 'ABreadcrumb',
|
name: 'ABreadcrumb',
|
||||||
props: breadcrumbProps(),
|
props: breadcrumbProps(),
|
||||||
slots: Object as CustomSlotsType<{
|
slots: Object as CustomSlotsType<{
|
||||||
separator: BreadcrumbProps;
|
separator: any;
|
||||||
itemRender: { route: Route; params: any; routes: Route[]; paths: string[] };
|
itemRender: { route: Route; params: any; routes: Route[]; paths: string[] };
|
||||||
default: any;
|
default: any;
|
||||||
}>,
|
}>,
|
||||||
|
|
|
@ -6,6 +6,7 @@ import DropDown from '../dropdown/dropdown';
|
||||||
import DownOutlined from '@ant-design/icons-vue/DownOutlined';
|
import DownOutlined from '@ant-design/icons-vue/DownOutlined';
|
||||||
import useConfigInject from '../_util/hooks/useConfigInject';
|
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||||
import type { MouseEventHandler } from '../_util/EventInterface';
|
import type { MouseEventHandler } from '../_util/EventInterface';
|
||||||
|
import type { CustomSlotsType } from '../_util/type';
|
||||||
|
|
||||||
export const breadcrumbItemProps = () => ({
|
export const breadcrumbItemProps = () => ({
|
||||||
prefixCls: String,
|
prefixCls: String,
|
||||||
|
@ -23,7 +24,11 @@ export default defineComponent({
|
||||||
__ANT_BREADCRUMB_ITEM: true,
|
__ANT_BREADCRUMB_ITEM: true,
|
||||||
props: breadcrumbItemProps(),
|
props: breadcrumbItemProps(),
|
||||||
// emits: ['click'],
|
// emits: ['click'],
|
||||||
slots: ['separator', 'overlay'],
|
slots: Object as CustomSlotsType<{
|
||||||
|
separator: any;
|
||||||
|
overlay: any;
|
||||||
|
default: any;
|
||||||
|
}>,
|
||||||
setup(props, { slots, attrs }) {
|
setup(props, { slots, attrs }) {
|
||||||
const { prefixCls } = useConfigInject('breadcrumb', props);
|
const { prefixCls } = useConfigInject('breadcrumb', props);
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -11,7 +11,7 @@ import type {
|
||||||
import { useLocaleReceiver } from '../locale-provider/LocaleReceiver';
|
import { useLocaleReceiver } from '../locale-provider/LocaleReceiver';
|
||||||
import enUS from './locale/en_US';
|
import enUS from './locale/en_US';
|
||||||
import CalendarHeader from './Header';
|
import CalendarHeader from './Header';
|
||||||
import type { VueNode } from '../_util/type';
|
import type { CustomSlotsType, VueNode } from '../_util/type';
|
||||||
import type { App } from 'vue';
|
import type { App } from 'vue';
|
||||||
import { computed, defineComponent, toRef } from 'vue';
|
import { computed, defineComponent, toRef } from 'vue';
|
||||||
import useConfigInject from '../_util/hooks/useConfigInject';
|
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||||
|
@ -108,13 +108,19 @@ function generateCalendar<
|
||||||
'onSelect',
|
'onSelect',
|
||||||
'valueFormat',
|
'valueFormat',
|
||||||
] as any,
|
] as any,
|
||||||
slots: [
|
slots: Object as CustomSlotsType<{
|
||||||
'dateFullCellRender',
|
dateFullCellRender?: { current: DateType };
|
||||||
'dateCellRender',
|
dateCellRender?: { current: DateType };
|
||||||
'monthFullCellRender',
|
monthFullCellRender?: { current: DateType };
|
||||||
'monthCellRender',
|
monthCellRender?: { current: DateType };
|
||||||
'headerRender',
|
headerRender?: {
|
||||||
],
|
value: DateType;
|
||||||
|
type: CalendarMode;
|
||||||
|
onChange: (date: DateType) => void;
|
||||||
|
onTypeChange: (type: CalendarMode) => void;
|
||||||
|
};
|
||||||
|
default: any;
|
||||||
|
}>,
|
||||||
setup(props, { emit, slots, attrs }) {
|
setup(props, { emit, slots, attrs }) {
|
||||||
const { prefixCls, direction } = useConfigInject('picker', props);
|
const { prefixCls, direction } = useConfigInject('picker', props);
|
||||||
const calendarPrefixCls = computed(() => `${prefixCls.value}-calendar`);
|
const calendarPrefixCls = computed(() => `${prefixCls.value}-calendar`);
|
||||||
|
|
|
@ -9,6 +9,7 @@ import type { SizeType } from '../config-provider';
|
||||||
import isPlainObject from 'lodash-es/isPlainObject';
|
import isPlainObject from 'lodash-es/isPlainObject';
|
||||||
import useConfigInject from '../_util/hooks/useConfigInject';
|
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||||
import devWarning from '../vc-util/devWarning';
|
import devWarning from '../vc-util/devWarning';
|
||||||
|
import type { CustomSlotsType } from '../_util/type';
|
||||||
export interface CardTabListType {
|
export interface CardTabListType {
|
||||||
key: string;
|
key: string;
|
||||||
tab: any;
|
tab: any;
|
||||||
|
@ -52,7 +53,15 @@ const Card = defineComponent({
|
||||||
compatConfig: { MODE: 3 },
|
compatConfig: { MODE: 3 },
|
||||||
name: 'ACard',
|
name: 'ACard',
|
||||||
props: cardProps(),
|
props: cardProps(),
|
||||||
slots: ['title', 'extra', 'tabBarExtraContent', 'actions', 'cover', 'customTab'],
|
slots: Object as CustomSlotsType<{
|
||||||
|
title: any;
|
||||||
|
extra: any;
|
||||||
|
tabBarExtraContent: any;
|
||||||
|
actions: any;
|
||||||
|
cover: any;
|
||||||
|
customTab: CardTabListType;
|
||||||
|
default: any;
|
||||||
|
}>,
|
||||||
setup(props, { slots }) {
|
setup(props, { slots }) {
|
||||||
const { prefixCls, direction, size } = useConfigInject('card', props);
|
const { prefixCls, direction, size } = useConfigInject('card', props);
|
||||||
const getAction = (actions: VNodeTypes[]) => {
|
const getAction = (actions: VNodeTypes[]) => {
|
||||||
|
|
|
@ -3,6 +3,7 @@ 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';
|
||||||
|
import type { CustomSlotsType } from '../_util/type';
|
||||||
|
|
||||||
export const cardMetaProps = () => ({
|
export const cardMetaProps = () => ({
|
||||||
prefixCls: String,
|
prefixCls: String,
|
||||||
|
@ -15,7 +16,12 @@ export default defineComponent({
|
||||||
compatConfig: { MODE: 3 },
|
compatConfig: { MODE: 3 },
|
||||||
name: 'ACardMeta',
|
name: 'ACardMeta',
|
||||||
props: cardMetaProps(),
|
props: cardMetaProps(),
|
||||||
slots: ['title', 'description', 'avatar'],
|
slots: Object as CustomSlotsType<{
|
||||||
|
title: any;
|
||||||
|
description: any;
|
||||||
|
avatar: any;
|
||||||
|
default: any;
|
||||||
|
}>,
|
||||||
setup(props, { slots }) {
|
setup(props, { slots }) {
|
||||||
const { prefixCls } = useConfigInject('card', props);
|
const { prefixCls } = useConfigInject('card', props);
|
||||||
return () => {
|
return () => {
|
||||||
|
|
|
@ -16,6 +16,7 @@ import classNames from '../_util/classNames';
|
||||||
import useConfigInject from '../_util/hooks/useConfigInject';
|
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||||
import type { CollapsePanelProps } from './CollapsePanel';
|
import type { CollapsePanelProps } from './CollapsePanel';
|
||||||
import collapseMotion from '../_util/collapseMotion';
|
import collapseMotion from '../_util/collapseMotion';
|
||||||
|
import type { CustomSlotsType } from '../_util/type';
|
||||||
|
|
||||||
type Key = number | string;
|
type Key = number | string;
|
||||||
|
|
||||||
|
@ -41,8 +42,10 @@ export default defineComponent({
|
||||||
openAnimation: collapseMotion('ant-motion-collapse', false),
|
openAnimation: collapseMotion('ant-motion-collapse', false),
|
||||||
expandIconPosition: 'left',
|
expandIconPosition: 'left',
|
||||||
}),
|
}),
|
||||||
slots: ['expandIcon'],
|
slots: Object as CustomSlotsType<{
|
||||||
// emits: ['change', 'update:activeKey'],
|
default?: any;
|
||||||
|
expandIcon?: CollapsePanelProps;
|
||||||
|
}>,
|
||||||
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])),
|
||||||
|
|
|
@ -7,6 +7,7 @@ import Transition from '../_util/transition';
|
||||||
import classNames from '../_util/classNames';
|
import classNames from '../_util/classNames';
|
||||||
import devWarning from '../vc-util/devWarning';
|
import devWarning from '../vc-util/devWarning';
|
||||||
import useConfigInject from '../_util/hooks/useConfigInject';
|
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||||
|
import type { CustomSlotsType } from '../_util/type';
|
||||||
|
|
||||||
export { collapsePanelProps };
|
export { collapsePanelProps };
|
||||||
export type CollapsePanelProps = Partial<ExtractPropTypes<ReturnType<typeof collapsePanelProps>>>;
|
export type CollapsePanelProps = Partial<ExtractPropTypes<ReturnType<typeof collapsePanelProps>>>;
|
||||||
|
@ -21,7 +22,13 @@ export default defineComponent({
|
||||||
headerClass: '',
|
headerClass: '',
|
||||||
forceRender: false,
|
forceRender: false,
|
||||||
}),
|
}),
|
||||||
slots: ['expandIcon', 'extra', 'header'],
|
slots: Object as CustomSlotsType<{
|
||||||
|
expandIcon?: any;
|
||||||
|
extra?: any;
|
||||||
|
header?: any;
|
||||||
|
default?: any;
|
||||||
|
}>,
|
||||||
|
|
||||||
// emits: ['itemClick'],
|
// emits: ['itemClick'],
|
||||||
setup(props, { slots, emit, attrs }) {
|
setup(props, { slots, emit, attrs }) {
|
||||||
devWarning(
|
devWarning(
|
||||||
|
|
|
@ -2,7 +2,7 @@ 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 { flattenChildren } from '../_util/props-util';
|
import { flattenChildren } from '../_util/props-util';
|
||||||
import type { VueNode } from '../_util/type';
|
import type { CustomSlotsType, 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 = () => ({
|
||||||
|
@ -25,7 +25,15 @@ const Comment = defineComponent({
|
||||||
compatConfig: { MODE: 3 },
|
compatConfig: { MODE: 3 },
|
||||||
name: 'AComment',
|
name: 'AComment',
|
||||||
props: commentProps(),
|
props: commentProps(),
|
||||||
slots: ['actions', 'author', 'avatar', 'content', 'datetime'],
|
|
||||||
|
slots: Object as CustomSlotsType<{
|
||||||
|
actions: any;
|
||||||
|
author: any;
|
||||||
|
avatar: any;
|
||||||
|
content: any;
|
||||||
|
datetime: any;
|
||||||
|
default: any;
|
||||||
|
}>,
|
||||||
setup(props, { slots }) {
|
setup(props, { slots }) {
|
||||||
const { prefixCls, direction } = useConfigInject('comment', props);
|
const { prefixCls, direction } = useConfigInject('comment', props);
|
||||||
const renderNested = (prefixCls: string, children: VueNode) => {
|
const renderNested = (prefixCls: string, children: VueNode) => {
|
||||||
|
@ -41,7 +49,7 @@ const Comment = defineComponent({
|
||||||
return () => {
|
return () => {
|
||||||
const pre = prefixCls.value;
|
const pre = prefixCls.value;
|
||||||
|
|
||||||
const actions = props.actions ?? slots.actions?.();
|
const actions: any[] = props.actions ?? slots.actions?.();
|
||||||
const author = props.author ?? slots.author?.();
|
const author = props.author ?? slots.author?.();
|
||||||
const avatar = props.avatar ?? slots.avatar?.();
|
const avatar = props.avatar ?? slots.avatar?.();
|
||||||
const content = props.content ?? slots.content?.();
|
const content = props.content ?? slots.content?.();
|
||||||
|
|
|
@ -18,6 +18,7 @@ import type { RangePickerSharedProps } from '../../vc-picker/RangePicker';
|
||||||
import devWarning from '../../vc-util/devWarning';
|
import devWarning from '../../vc-util/devWarning';
|
||||||
import { useInjectFormItemContext } from '../../form/FormItemContext';
|
import { useInjectFormItemContext } from '../../form/FormItemContext';
|
||||||
import omit from '../../_util/omit';
|
import omit from '../../_util/omit';
|
||||||
|
import type { CustomSlotsType } from '../../_util/type';
|
||||||
|
|
||||||
export default function generateRangePicker<DateType, ExtraProps = {}>(
|
export default function generateRangePicker<DateType, ExtraProps = {}>(
|
||||||
generateConfig: GenerateConfig<DateType>,
|
generateConfig: GenerateConfig<DateType>,
|
||||||
|
@ -32,18 +33,18 @@ export default function generateRangePicker<DateType, ExtraProps = {}>(
|
||||||
...rangePickerProps<DateType>(),
|
...rangePickerProps<DateType>(),
|
||||||
...extraProps,
|
...extraProps,
|
||||||
},
|
},
|
||||||
slots: [
|
slots: Object as CustomSlotsType<{
|
||||||
'suffixIcon',
|
suffixIcon?: any;
|
||||||
// 'clearIcon',
|
prevIcon?: any;
|
||||||
'prevIcon',
|
nextIcon?: any;
|
||||||
'nextIcon',
|
superPrevIcon?: any;
|
||||||
'superPrevIcon',
|
superNextIcon?: any;
|
||||||
'superNextIcon',
|
dateRender?: any;
|
||||||
// 'panelRender',
|
renderExtraFooter?: any;
|
||||||
'dateRender',
|
default?: any;
|
||||||
'renderExtraFooter',
|
separator?: any;
|
||||||
// 'separator',
|
clearIcon?: any;
|
||||||
],
|
}>,
|
||||||
setup(_props, { expose, slots, attrs, emit }) {
|
setup(_props, { expose, slots, attrs, emit }) {
|
||||||
const props = _props as unknown as CommonProps<DateType> & RangePickerProps<DateType>;
|
const props = _props as unknown as CommonProps<DateType> & RangePickerProps<DateType>;
|
||||||
const formItemContext = useInjectFormItemContext();
|
const formItemContext = useInjectFormItemContext();
|
||||||
|
|
|
@ -16,6 +16,7 @@ import { commonProps, datePickerProps } from './props';
|
||||||
|
|
||||||
import devWarning from '../../vc-util/devWarning';
|
import devWarning from '../../vc-util/devWarning';
|
||||||
import { useInjectFormItemContext } from '../../form/FormItemContext';
|
import { useInjectFormItemContext } from '../../form/FormItemContext';
|
||||||
|
import type { CustomSlotsType } from '../../_util/type';
|
||||||
|
|
||||||
export default function generateSinglePicker<DateType, ExtraProps = {}>(
|
export default function generateSinglePicker<DateType, ExtraProps = {}>(
|
||||||
generateConfig: GenerateConfig<DateType>,
|
generateConfig: GenerateConfig<DateType>,
|
||||||
|
@ -32,18 +33,19 @@ export default function generateSinglePicker<DateType, ExtraProps = {}>(
|
||||||
name: displayName,
|
name: displayName,
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
props: comProps,
|
props: comProps,
|
||||||
slots: [
|
slots: Object as CustomSlotsType<{
|
||||||
'suffixIcon',
|
suffixIcon?: any;
|
||||||
// 'clearIcon',
|
prevIcon?: any;
|
||||||
'prevIcon',
|
nextIcon?: any;
|
||||||
'nextIcon',
|
superPrevIcon?: any;
|
||||||
'superPrevIcon',
|
superNextIcon?: any;
|
||||||
'superNextIcon',
|
dateRender?: any;
|
||||||
// 'panelRender',
|
renderExtraFooter?: any;
|
||||||
'dateRender',
|
monthCellRender?: any;
|
||||||
'renderExtraFooter',
|
monthCellContentRender?: any;
|
||||||
'monthCellRender',
|
clearIcon?: any;
|
||||||
],
|
default?: any;
|
||||||
|
}>,
|
||||||
setup(_props, { slots, expose, attrs, emit }) {
|
setup(_props, { slots, expose, attrs, emit }) {
|
||||||
// 兼容 vue 3.2.7
|
// 兼容 vue 3.2.7
|
||||||
const props = _props as unknown as CommonProps<DateType> &
|
const props = _props as unknown as CommonProps<DateType> &
|
||||||
|
@ -154,7 +156,7 @@ export default function generateSinglePicker<DateType, ExtraProps = {}>(
|
||||||
id = formItemContext.id.value,
|
id = formItemContext.id.value,
|
||||||
...restProps
|
...restProps
|
||||||
} = p;
|
} = p;
|
||||||
const showTime = p.showTime === '' ? true : p.showTime;
|
const showTime = (p.showTime as string) === '' ? true : p.showTime;
|
||||||
const { format } = p as any;
|
const { format } = p as any;
|
||||||
|
|
||||||
let additionalOverrideProps: any = {};
|
let additionalOverrideProps: any = {};
|
||||||
|
|
|
@ -26,6 +26,7 @@ import PropTypes from '../_util/vue-types';
|
||||||
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';
|
||||||
|
import type { CustomSlotsType } from '../_util/type';
|
||||||
|
|
||||||
export const DescriptionsItemProps = {
|
export const DescriptionsItemProps = {
|
||||||
prefixCls: String,
|
prefixCls: String,
|
||||||
|
@ -49,7 +50,6 @@ export const DescriptionsItem = defineComponent({
|
||||||
compatConfig: { MODE: 3 },
|
compatConfig: { MODE: 3 },
|
||||||
name: 'ADescriptionsItem',
|
name: 'ADescriptionsItem',
|
||||||
props: descriptionsItemProp(),
|
props: descriptionsItemProp(),
|
||||||
slots: ['label'],
|
|
||||||
setup(_, { slots }) {
|
setup(_, { slots }) {
|
||||||
return () => slots.default?.();
|
return () => slots.default?.();
|
||||||
},
|
},
|
||||||
|
@ -161,7 +161,11 @@ const Descriptions = defineComponent({
|
||||||
compatConfig: { MODE: 3 },
|
compatConfig: { MODE: 3 },
|
||||||
name: 'ADescriptions',
|
name: 'ADescriptions',
|
||||||
props: descriptionsProps(),
|
props: descriptionsProps(),
|
||||||
slots: ['title', 'extra'],
|
slots: Object as CustomSlotsType<{
|
||||||
|
title?: any;
|
||||||
|
extra?: any;
|
||||||
|
default?: any;
|
||||||
|
}>,
|
||||||
Item: DescriptionsItem,
|
Item: DescriptionsItem,
|
||||||
setup(props, { slots }) {
|
setup(props, { slots }) {
|
||||||
const { prefixCls, direction } = useConfigInject('descriptions', props);
|
const { prefixCls, direction } = useConfigInject('descriptions', props);
|
||||||
|
|
|
@ -16,6 +16,7 @@ import VcDrawer from '../vc-drawer';
|
||||||
import PropTypes from '../_util/vue-types';
|
import PropTypes from '../_util/vue-types';
|
||||||
import CloseOutlined from '@ant-design/icons-vue/CloseOutlined';
|
import CloseOutlined from '@ant-design/icons-vue/CloseOutlined';
|
||||||
import useConfigInject from '../_util/hooks/useConfigInject';
|
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||||
|
import type { CustomSlotsType } from '../_util/type';
|
||||||
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';
|
||||||
|
@ -24,10 +25,10 @@ import type { KeyboardEventHandler, MouseEventHandler } from '../_util/EventInte
|
||||||
type ILevelMove = number | [number, number];
|
type ILevelMove = number | [number, number];
|
||||||
|
|
||||||
const PlacementTypes = tuple('top', 'right', 'bottom', 'left');
|
const PlacementTypes = tuple('top', 'right', 'bottom', 'left');
|
||||||
export type placementType = typeof PlacementTypes[number];
|
export type placementType = (typeof PlacementTypes)[number];
|
||||||
|
|
||||||
const SizeTypes = tuple('default', 'large');
|
const SizeTypes = tuple('default', 'large');
|
||||||
export type sizeType = typeof SizeTypes[number];
|
export type sizeType = (typeof SizeTypes)[number];
|
||||||
|
|
||||||
export interface PushState {
|
export interface PushState {
|
||||||
distance: string | number;
|
distance: string | number;
|
||||||
|
@ -102,7 +103,14 @@ const Drawer = defineComponent({
|
||||||
keyboard: true,
|
keyboard: true,
|
||||||
push: defaultPushState,
|
push: defaultPushState,
|
||||||
}),
|
}),
|
||||||
slots: ['closeIcon', 'title', 'extra', 'footer', 'handle'],
|
slots: Object as CustomSlotsType<{
|
||||||
|
closeIcon: any;
|
||||||
|
title: any;
|
||||||
|
extra: any;
|
||||||
|
footer: any;
|
||||||
|
handle: any;
|
||||||
|
default: any;
|
||||||
|
}>,
|
||||||
// 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);
|
||||||
|
|
|
@ -7,6 +7,7 @@ import { initDefaultProps } from '../_util/props-util';
|
||||||
import { dropdownButtonProps } from './props';
|
import { dropdownButtonProps } from './props';
|
||||||
import EllipsisOutlined from '@ant-design/icons-vue/EllipsisOutlined';
|
import EllipsisOutlined from '@ant-design/icons-vue/EllipsisOutlined';
|
||||||
import useConfigInject from '../_util/hooks/useConfigInject';
|
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||||
|
import type { CustomSlotsType } from '../_util/type';
|
||||||
const ButtonGroup = Button.Group;
|
const ButtonGroup = Button.Group;
|
||||||
|
|
||||||
export type DropdownButtonProps = Partial<ExtractPropTypes<ReturnType<typeof dropdownButtonProps>>>;
|
export type DropdownButtonProps = Partial<ExtractPropTypes<ReturnType<typeof dropdownButtonProps>>>;
|
||||||
|
@ -21,8 +22,14 @@ export default defineComponent({
|
||||||
placement: 'bottomRight',
|
placement: 'bottomRight',
|
||||||
type: 'default',
|
type: 'default',
|
||||||
}),
|
}),
|
||||||
// emits: ['click', 'visibleChange', 'update:visible'],
|
// emits: ['click', 'visibleChange', 'update:visible'],s
|
||||||
slots: ['icon', 'leftButton', 'rightButton', 'overlay'],
|
slots: Object as CustomSlotsType<{
|
||||||
|
icon: any;
|
||||||
|
leftButton: { button: any };
|
||||||
|
rightButton: { button: any };
|
||||||
|
overlay: any;
|
||||||
|
default: any;
|
||||||
|
}>,
|
||||||
setup(props, { slots, attrs, emit }) {
|
setup(props, { slots, attrs, emit }) {
|
||||||
const handleVisibleChange = (val: boolean) => {
|
const handleVisibleChange = (val: boolean) => {
|
||||||
emit('update:visible', val);
|
emit('update:visible', val);
|
||||||
|
|
|
@ -11,6 +11,7 @@ import useConfigInject from '../_util/hooks/useConfigInject';
|
||||||
import devWarning from '../vc-util/devWarning';
|
import devWarning from '../vc-util/devWarning';
|
||||||
import omit from '../_util/omit';
|
import omit from '../_util/omit';
|
||||||
import getPlacements from '../tooltip/placements';
|
import getPlacements from '../tooltip/placements';
|
||||||
|
import type { CustomSlotsType } from '../_util/type';
|
||||||
|
|
||||||
export type DropdownProps = Partial<ExtractPropTypes<ReturnType<typeof dropdownProps>>>;
|
export type DropdownProps = Partial<ExtractPropTypes<ReturnType<typeof dropdownProps>>>;
|
||||||
|
|
||||||
|
@ -25,7 +26,10 @@ const Dropdown = defineComponent({
|
||||||
trigger: 'hover',
|
trigger: 'hover',
|
||||||
}),
|
}),
|
||||||
// emits: ['visibleChange', 'update:visible'],
|
// emits: ['visibleChange', 'update:visible'],
|
||||||
slots: ['overlay'],
|
slots: Object as CustomSlotsType<{
|
||||||
|
default?: any;
|
||||||
|
overlay?: any;
|
||||||
|
}>,
|
||||||
setup(props, { slots, attrs, emit }) {
|
setup(props, { slots, attrs, emit }) {
|
||||||
const { prefixCls, rootPrefixCls, direction, getPopupContainer } = useConfigInject(
|
const { prefixCls, rootPrefixCls, direction, getPopupContainer } = useConfigInject(
|
||||||
'dropdown',
|
'dropdown',
|
||||||
|
|
|
@ -26,6 +26,7 @@ import { getNamePath } from './utils/valueUtil';
|
||||||
import { toArray } from './utils/typeUtil';
|
import { toArray } from './utils/typeUtil';
|
||||||
import { warning } from '../vc-util/warning';
|
import { warning } from '../vc-util/warning';
|
||||||
import find from 'lodash-es/find';
|
import find from 'lodash-es/find';
|
||||||
|
import type { CustomSlotsType } from '../_util/type';
|
||||||
import { tuple } from '../_util/type';
|
import { tuple } from '../_util/type';
|
||||||
import type {
|
import type {
|
||||||
FormLabelAlign,
|
FormLabelAlign,
|
||||||
|
@ -133,7 +134,12 @@ export default defineComponent({
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
__ANT_NEW_FORM_ITEM: true,
|
__ANT_NEW_FORM_ITEM: true,
|
||||||
props: formItemProps(),
|
props: formItemProps(),
|
||||||
slots: ['help', 'label', 'extra'],
|
slots: Object as CustomSlotsType<{
|
||||||
|
help: any;
|
||||||
|
label: any;
|
||||||
|
extra: any;
|
||||||
|
default: any;
|
||||||
|
}>,
|
||||||
setup(props, { slots, attrs, expose }) {
|
setup(props, { slots, attrs, expose }) {
|
||||||
warning(props.prop === undefined, `\`prop\` is deprecated. Please use \`name\` instead.`);
|
warning(props.prop === undefined, `\`prop\` is deprecated. Please use \`name\` instead.`);
|
||||||
const eventKey = `form-item-${++indexGuid}`;
|
const eventKey = `form-item-${++indexGuid}`;
|
||||||
|
|
|
@ -9,7 +9,7 @@ import { useProvideForm, useInjectForm, useProvideFormItemPrefix } from './conte
|
||||||
import ErrorList from './ErrorList';
|
import ErrorList from './ErrorList';
|
||||||
import classNames from '../_util/classNames';
|
import classNames from '../_util/classNames';
|
||||||
import type { ValidateStatus } from './FormItem';
|
import type { ValidateStatus } from './FormItem';
|
||||||
import type { VueNode } from '../_util/type';
|
import type { CustomSlotsType, VueNode } from '../_util/type';
|
||||||
import type { HTMLAttributes } from 'vue';
|
import type { HTMLAttributes } from 'vue';
|
||||||
import { computed, defineComponent } from 'vue';
|
import { computed, defineComponent } from 'vue';
|
||||||
|
|
||||||
|
@ -35,7 +35,12 @@ const iconMap: { [key: string]: any } = {
|
||||||
};
|
};
|
||||||
const FormItemInput = defineComponent({
|
const FormItemInput = defineComponent({
|
||||||
compatConfig: { MODE: 3 },
|
compatConfig: { MODE: 3 },
|
||||||
slots: ['help', 'extra', 'errors'],
|
slots: Object as CustomSlotsType<{
|
||||||
|
help: any;
|
||||||
|
errors: any;
|
||||||
|
extra: any;
|
||||||
|
default: any;
|
||||||
|
}>,
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
props: [
|
props: [
|
||||||
'prefixCls',
|
'prefixCls',
|
||||||
|
|
|
@ -11,6 +11,7 @@ import { cloneElement } from '../_util/vnode';
|
||||||
import omit from '../_util/omit';
|
import omit from '../_util/omit';
|
||||||
import PropTypes from '../_util/vue-types';
|
import PropTypes from '../_util/vue-types';
|
||||||
import isValidValue from '../_util/isValidValue';
|
import isValidValue from '../_util/isValidValue';
|
||||||
|
import type { CustomSlotsType } from '../_util/type';
|
||||||
const baseProps = baseInputNumberProps();
|
const baseProps = baseInputNumberProps();
|
||||||
export const inputNumberProps = () => ({
|
export const inputNumberProps = () => ({
|
||||||
...baseProps,
|
...baseProps,
|
||||||
|
@ -35,7 +36,13 @@ const InputNumber = defineComponent({
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
props: inputNumberProps(),
|
props: inputNumberProps(),
|
||||||
// emits: ['focus', 'blur', 'change', 'input', 'update:value'],
|
// emits: ['focus', 'blur', 'change', 'input', 'update:value'],
|
||||||
slots: ['addonBefore', 'addonAfter', 'prefix'],
|
slots: Object as CustomSlotsType<{
|
||||||
|
addonBefore?: any;
|
||||||
|
addonAfter?: any;
|
||||||
|
prefix?: any;
|
||||||
|
default?: any;
|
||||||
|
}>,
|
||||||
|
|
||||||
setup(props, { emit, expose, attrs, slots }) {
|
setup(props, { emit, expose, attrs, slots }) {
|
||||||
const formItemContext = useInjectFormItemContext();
|
const formItemContext = useInjectFormItemContext();
|
||||||
const { prefixCls, size, direction } = useConfigInject('input-number', props);
|
const { prefixCls, size, direction } = useConfigInject('input-number', props);
|
||||||
|
|
|
@ -10,6 +10,7 @@ import { watch, computed, ref, defineComponent } from 'vue';
|
||||||
import type { ChangeEvent, KeyboardEventHandler } from '../../_util/EventInterface';
|
import type { ChangeEvent, KeyboardEventHandler } from '../../_util/EventInterface';
|
||||||
import KeyCode from '../../_util/KeyCode';
|
import KeyCode from '../../_util/KeyCode';
|
||||||
import classNames from '../../_util/classNames';
|
import classNames from '../../_util/classNames';
|
||||||
|
import type { CustomSlotsType } from '../../_util/type';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* We support `stringMode` which need handle correct type when user call in onChange
|
* We support `stringMode` which need handle correct type when user call in onChange
|
||||||
|
@ -86,7 +87,11 @@ export default defineComponent({
|
||||||
...inputNumberProps(),
|
...inputNumberProps(),
|
||||||
lazy: Boolean,
|
lazy: Boolean,
|
||||||
},
|
},
|
||||||
slots: ['upHandler', 'downHandler'],
|
slots: Object as CustomSlotsType<{
|
||||||
|
upHandler: any;
|
||||||
|
downHandler: any;
|
||||||
|
default: any;
|
||||||
|
}>,
|
||||||
setup(props, { attrs, slots, emit, expose }) {
|
setup(props, { attrs, slots, emit, expose }) {
|
||||||
const inputRef = ref<HTMLInputElement>();
|
const inputRef = ref<HTMLInputElement>();
|
||||||
const focus = ref(false);
|
const focus = ref(false);
|
||||||
|
|
|
@ -2,6 +2,7 @@ import isMobile from '../../vc-util/isMobile';
|
||||||
import type { PropType } from 'vue';
|
import type { PropType } from 'vue';
|
||||||
import { onBeforeUnmount, ref, defineComponent } from 'vue';
|
import { onBeforeUnmount, ref, defineComponent } from 'vue';
|
||||||
import classNames from '../../_util/classNames';
|
import classNames from '../../_util/classNames';
|
||||||
|
import type { CustomSlotsType } from '../../_util/type';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When click and hold on a button - the speed of auto changing the value.
|
* When click and hold on a button - the speed of auto changing the value.
|
||||||
|
@ -23,7 +24,11 @@ export default defineComponent({
|
||||||
downDisabled: Boolean,
|
downDisabled: Boolean,
|
||||||
onStep: { type: Function as PropType<(up: boolean) => void> },
|
onStep: { type: Function as PropType<(up: boolean) => void> },
|
||||||
},
|
},
|
||||||
slots: ['upNode', 'downNode'],
|
slots: Object as CustomSlotsType<{
|
||||||
|
upNode?: any;
|
||||||
|
downNode?: any;
|
||||||
|
default?: any;
|
||||||
|
}>,
|
||||||
setup(props, { slots, emit }) {
|
setup(props, { slots, emit }) {
|
||||||
const stepTimeoutRef = ref();
|
const stepTimeoutRef = ref();
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@ import ItemMeta from './ItemMeta';
|
||||||
import useConfigInject from '../_util/hooks/useConfigInject';
|
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||||
import { ListContextKey } from './contextKey';
|
import { ListContextKey } from './contextKey';
|
||||||
import type { ListGridType } from '.';
|
import type { ListGridType } from '.';
|
||||||
|
import type { CustomSlotsType } from '../_util/type';
|
||||||
|
|
||||||
export const listItemProps = () => ({
|
export const listItemProps = () => ({
|
||||||
prefixCls: String,
|
prefixCls: String,
|
||||||
|
@ -25,7 +26,11 @@ export default defineComponent({
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
Meta: ItemMeta,
|
Meta: ItemMeta,
|
||||||
props: listItemProps(),
|
props: listItemProps(),
|
||||||
slots: ['actions', 'extra'],
|
slots: Object as CustomSlotsType<{
|
||||||
|
actions: any;
|
||||||
|
extra: any;
|
||||||
|
default: any;
|
||||||
|
}>,
|
||||||
setup(props, { slots, attrs }) {
|
setup(props, { slots, attrs }) {
|
||||||
const { itemLayout, grid } = inject(ListContextKey, {
|
const { itemLayout, grid } = inject(ListContextKey, {
|
||||||
grid: ref(),
|
grid: ref(),
|
||||||
|
|
|
@ -2,6 +2,7 @@ import type { ExtractPropTypes } from 'vue';
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import useConfigInject from '../_util/hooks/useConfigInject';
|
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||||
import PropTypes from '../_util/vue-types';
|
import PropTypes from '../_util/vue-types';
|
||||||
|
import type { CustomSlotsType } from '../_util/type';
|
||||||
|
|
||||||
export const listItemMetaProps = () => ({
|
export const listItemMetaProps = () => ({
|
||||||
avatar: PropTypes.any,
|
avatar: PropTypes.any,
|
||||||
|
@ -18,7 +19,12 @@ export default defineComponent({
|
||||||
props: listItemMetaProps(),
|
props: listItemMetaProps(),
|
||||||
displayName: 'AListItemMeta', // 兼容历史函数式组件
|
displayName: 'AListItemMeta', // 兼容历史函数式组件
|
||||||
__ANT_LIST_ITEM_META: true,
|
__ANT_LIST_ITEM_META: true,
|
||||||
slots: ['avatar', 'description', 'title'],
|
slots: Object as CustomSlotsType<{
|
||||||
|
avatar: any;
|
||||||
|
description: any;
|
||||||
|
title: any;
|
||||||
|
default: any;
|
||||||
|
}>,
|
||||||
setup(props, { slots }) {
|
setup(props, { slots }) {
|
||||||
const { prefixCls } = useConfigInject('list', props);
|
const { prefixCls } = useConfigInject('list', props);
|
||||||
return () => {
|
return () => {
|
||||||
|
|
|
@ -11,7 +11,7 @@ import { Row } from '../grid';
|
||||||
import Item from './Item';
|
import Item from './Item';
|
||||||
import { flattenChildren } from '../_util/props-util';
|
import { flattenChildren } from '../_util/props-util';
|
||||||
import initDefaultProps from '../_util/props-util/initDefaultProps';
|
import initDefaultProps from '../_util/props-util/initDefaultProps';
|
||||||
import type { Key } from '../_util/type';
|
import type { CustomSlotsType, Key } from '../_util/type';
|
||||||
import ItemMeta from './ItemMeta';
|
import ItemMeta from './ItemMeta';
|
||||||
import useConfigInject from '../_util/hooks/useConfigInject';
|
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||||
import useBreakpoint from '../_util/hooks/useBreakpoint';
|
import useBreakpoint from '../_util/hooks/useBreakpoint';
|
||||||
|
@ -87,7 +87,14 @@ const List = defineComponent({
|
||||||
loading: false,
|
loading: false,
|
||||||
pagination: false,
|
pagination: false,
|
||||||
}),
|
}),
|
||||||
slots: ['extra', 'loadMore', 'renderItem', 'header', 'footer'],
|
slots: Object as CustomSlotsType<{
|
||||||
|
extra: any;
|
||||||
|
loadMore: any;
|
||||||
|
renderItem: { item: any; index: number };
|
||||||
|
header: any;
|
||||||
|
footer: any;
|
||||||
|
default: any;
|
||||||
|
}>,
|
||||||
setup(props, { slots }) {
|
setup(props, { slots }) {
|
||||||
provide(ListContextKey, {
|
provide(ListContextKey, {
|
||||||
grid: toRef(props, 'grid'),
|
grid: toRef(props, 'grid'),
|
||||||
|
|
|
@ -10,6 +10,7 @@ import { useInjectFormItemContext } from '../form/FormItemContext';
|
||||||
import omit from '../_util/omit';
|
import omit from '../_util/omit';
|
||||||
import { optionProps, optionOptions } from '../vc-mentions/src/Option';
|
import { optionProps, optionOptions } from '../vc-mentions/src/Option';
|
||||||
import type { KeyboardEventHandler } from '../_util/EventInterface';
|
import type { KeyboardEventHandler } from '../_util/EventInterface';
|
||||||
|
import type { CustomSlotsType } from '../_util/type';
|
||||||
|
|
||||||
interface MentionsConfig {
|
interface MentionsConfig {
|
||||||
prefix?: string | string[];
|
prefix?: string | string[];
|
||||||
|
@ -92,7 +93,11 @@ const Mentions = defineComponent({
|
||||||
name: 'AMentions',
|
name: 'AMentions',
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
props: mentionsProps(),
|
props: mentionsProps(),
|
||||||
slots: ['notFoundContent', 'option'],
|
slots: Object as CustomSlotsType<{
|
||||||
|
notFoundContent?: any;
|
||||||
|
option?: any;
|
||||||
|
default?: any;
|
||||||
|
}>,
|
||||||
setup(props, { slots, emit, attrs, expose }) {
|
setup(props, { slots, emit, attrs, expose }) {
|
||||||
const { prefixCls, renderEmpty, direction } = useConfigInject('mentions', props);
|
const { prefixCls, renderEmpty, direction } = useConfigInject('mentions', props);
|
||||||
const focused = ref(false);
|
const focused = ref(false);
|
||||||
|
|
|
@ -4,6 +4,7 @@ import { computed, defineComponent } from 'vue';
|
||||||
import PropTypes from '../../_util/vue-types';
|
import PropTypes from '../../_util/vue-types';
|
||||||
import { useInjectMenu } from './hooks/useMenuContext';
|
import { useInjectMenu } from './hooks/useMenuContext';
|
||||||
import { useMeasure } from './hooks/useKeyPath';
|
import { useMeasure } from './hooks/useKeyPath';
|
||||||
|
import type { CustomSlotsType } from '../../_util/type';
|
||||||
|
|
||||||
export const menuItemGroupProps = () => ({
|
export const menuItemGroupProps = () => ({
|
||||||
title: PropTypes.any,
|
title: PropTypes.any,
|
||||||
|
@ -16,7 +17,10 @@ export default defineComponent({
|
||||||
name: 'AMenuItemGroup',
|
name: 'AMenuItemGroup',
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
props: menuItemGroupProps(),
|
props: menuItemGroupProps(),
|
||||||
slots: ['title'],
|
slots: Object as CustomSlotsType<{
|
||||||
|
title?: any;
|
||||||
|
default?: any;
|
||||||
|
}>,
|
||||||
setup(props, { slots, attrs }) {
|
setup(props, { slots, attrs }) {
|
||||||
const { prefixCls } = useInjectMenu();
|
const { prefixCls } = useInjectMenu();
|
||||||
const groupPrefixCls = computed(() => `${prefixCls.value}-item-group`);
|
const groupPrefixCls = computed(() => `${prefixCls.value}-item-group`);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import type { Key } from '../../_util/type';
|
import type { CustomSlotsType, Key } from '../../_util/type';
|
||||||
import type { ExtractPropTypes, PropType, VNode } from 'vue';
|
import type { ExtractPropTypes, PropType, VNode } from 'vue';
|
||||||
import {
|
import {
|
||||||
Teleport,
|
Teleport,
|
||||||
|
@ -51,9 +51,9 @@ export const menuProps = () => ({
|
||||||
activeKey: String, // 内部组件使用
|
activeKey: String, // 内部组件使用
|
||||||
selectable: { type: Boolean, default: true },
|
selectable: { type: Boolean, default: true },
|
||||||
multiple: { type: Boolean, default: false },
|
multiple: { type: Boolean, default: false },
|
||||||
|
tabindex: { type: [Number, String] },
|
||||||
motion: Object as PropType<CSSMotionProps>,
|
motion: Object as PropType<CSSMotionProps>,
|
||||||
|
role: String,
|
||||||
theme: { type: String as PropType<MenuTheme>, default: 'light' },
|
theme: { type: String as PropType<MenuTheme>, default: 'light' },
|
||||||
mode: { type: String as PropType<MenuMode>, default: 'vertical' },
|
mode: { type: String as PropType<MenuMode>, default: 'vertical' },
|
||||||
|
|
||||||
|
@ -88,7 +88,11 @@ export default defineComponent({
|
||||||
name: 'AMenu',
|
name: 'AMenu',
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
props: menuProps(),
|
props: menuProps(),
|
||||||
slots: ['expandIcon', 'overflowedIndicator'],
|
slots: Object as CustomSlotsType<{
|
||||||
|
expandIcon?: { isOpen: boolean; [key: string]: any };
|
||||||
|
overflowedIndicator?: any;
|
||||||
|
default: any;
|
||||||
|
}>,
|
||||||
setup(props, { slots, emit, attrs }) {
|
setup(props, { slots, emit, attrs }) {
|
||||||
const { prefixCls, direction, getPrefixCls } = useConfigInject('menu', props);
|
const { prefixCls, direction, getPrefixCls } = useConfigInject('menu', props);
|
||||||
const store = ref<Record<string, StoreMenuInfo>>({});
|
const store = ref<Record<string, StoreMenuInfo>>({});
|
||||||
|
|
|
@ -12,6 +12,7 @@ import useDirectionStyle from './hooks/useDirectionStyle';
|
||||||
import Overflow from '../../vc-overflow';
|
import Overflow from '../../vc-overflow';
|
||||||
import devWarning from '../../vc-util/devWarning';
|
import devWarning from '../../vc-util/devWarning';
|
||||||
import type { MouseEventHandler } from '../../_util/EventInterface';
|
import type { MouseEventHandler } from '../../_util/EventInterface';
|
||||||
|
import type { CustomSlotsType } from '../../_util/type';
|
||||||
|
|
||||||
let indexGuid = 0;
|
let indexGuid = 0;
|
||||||
export const menuItemProps = () => ({
|
export const menuItemProps = () => ({
|
||||||
|
@ -35,8 +36,12 @@ export default defineComponent({
|
||||||
name: 'AMenuItem',
|
name: 'AMenuItem',
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
props: menuItemProps(),
|
props: menuItemProps(),
|
||||||
// emits: ['mouseenter', 'mouseleave', 'click', 'keydown', 'focus'],
|
slots: Object as CustomSlotsType<{
|
||||||
slots: ['icon', 'title'],
|
icon?: any;
|
||||||
|
title?: any;
|
||||||
|
default?: any;
|
||||||
|
}>,
|
||||||
|
|
||||||
setup(props, { slots, emit, attrs }) {
|
setup(props, { slots, emit, attrs }) {
|
||||||
const instance = getCurrentInstance();
|
const instance = getCurrentInstance();
|
||||||
const isMeasure = useMeasure();
|
const isMeasure = useMeasure();
|
||||||
|
|
|
@ -7,6 +7,7 @@ import { placements, placementsRtl } from './placements';
|
||||||
import raf from '../../_util/raf';
|
import raf from '../../_util/raf';
|
||||||
import classNames from '../../_util/classNames';
|
import classNames from '../../_util/classNames';
|
||||||
import { getTransitionProps } from '../../_util/transition';
|
import { getTransitionProps } from '../../_util/transition';
|
||||||
|
import type { CustomSlotsType } from '../../_util/type';
|
||||||
|
|
||||||
const popupPlacementMap = {
|
const popupPlacementMap = {
|
||||||
horizontal: 'bottomLeft',
|
horizontal: 'bottomLeft',
|
||||||
|
@ -28,7 +29,10 @@ export default defineComponent({
|
||||||
disabled: Boolean,
|
disabled: Boolean,
|
||||||
onVisibleChange: Function as PropType<(visible: boolean) => void>,
|
onVisibleChange: Function as PropType<(visible: boolean) => void>,
|
||||||
},
|
},
|
||||||
slots: ['popup'],
|
slots: Object as CustomSlotsType<{
|
||||||
|
default?: any;
|
||||||
|
popup?: any;
|
||||||
|
}>,
|
||||||
emits: ['visibleChange'],
|
emits: ['visibleChange'],
|
||||||
setup(props, { slots, emit }) {
|
setup(props, { slots, emit }) {
|
||||||
const innerVisible = ref(false);
|
const innerVisible = ref(false);
|
||||||
|
|
|
@ -20,7 +20,7 @@ import Overflow from '../../vc-overflow';
|
||||||
import devWarning from '../../vc-util/devWarning';
|
import devWarning from '../../vc-util/devWarning';
|
||||||
import isValid from '../../_util/isValid';
|
import isValid from '../../_util/isValid';
|
||||||
import type { MouseEventHandler } from '../../_util/EventInterface';
|
import type { MouseEventHandler } from '../../_util/EventInterface';
|
||||||
import type { Key } from 'ant-design-vue/es/_util/type';
|
import type { CustomSlotsType, Key } from '../../_util/type';
|
||||||
|
|
||||||
let indexGuid = 0;
|
let indexGuid = 0;
|
||||||
|
|
||||||
|
@ -46,8 +46,12 @@ export default defineComponent({
|
||||||
name: 'ASubMenu',
|
name: 'ASubMenu',
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
props: subMenuProps(),
|
props: subMenuProps(),
|
||||||
slots: ['icon', 'title', 'expandIcon'],
|
slots: Object as CustomSlotsType<{
|
||||||
// emits: ['titleClick', 'mouseenter', 'mouseleave'],
|
icon?: any;
|
||||||
|
title?: any;
|
||||||
|
expandIcon?: { isOpen: boolean; [key: string]: any };
|
||||||
|
default?: any;
|
||||||
|
}>,
|
||||||
setup(props, { slots, attrs, emit }) {
|
setup(props, { slots, attrs, emit }) {
|
||||||
useProvideFirstLevel(false);
|
useProvideFirstLevel(false);
|
||||||
const isMeasure = useMeasure();
|
const isMeasure = useMeasure();
|
||||||
|
|
|
@ -8,6 +8,7 @@ import Breadcrumb from '../breadcrumb';
|
||||||
import Avatar from '../avatar';
|
import Avatar from '../avatar';
|
||||||
import TransButton from '../_util/transButton';
|
import TransButton from '../_util/transButton';
|
||||||
import LocaleReceiver from '../locale-provider/LocaleReceiver';
|
import LocaleReceiver from '../locale-provider/LocaleReceiver';
|
||||||
|
import type { CustomSlotsType } 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';
|
||||||
import classNames from '../_util/classNames';
|
import classNames from '../_util/classNames';
|
||||||
|
@ -36,7 +37,17 @@ const PageHeader = defineComponent({
|
||||||
name: 'APageHeader',
|
name: 'APageHeader',
|
||||||
props: pageHeaderProps(),
|
props: pageHeaderProps(),
|
||||||
// emits: ['back'],
|
// emits: ['back'],
|
||||||
slots: ['backIcon', 'avatar', 'breadcrumb', 'title', 'subTitle', 'tags', 'extra', 'footer'],
|
slots: Object as CustomSlotsType<{
|
||||||
|
backIcon: any;
|
||||||
|
avatar: any;
|
||||||
|
breadcrumb: any;
|
||||||
|
title: any;
|
||||||
|
subTitle: any;
|
||||||
|
tags: any;
|
||||||
|
extra: any;
|
||||||
|
footer: any;
|
||||||
|
default: any;
|
||||||
|
}>,
|
||||||
setup(props, { emit, slots }) {
|
setup(props, { emit, slots }) {
|
||||||
const { prefixCls, direction, pageHeader } = useConfigInject('page-header', props);
|
const { prefixCls, direction, pageHeader } = useConfigInject('page-header', props);
|
||||||
const compact = ref(false);
|
const compact = ref(false);
|
||||||
|
|
|
@ -10,6 +10,7 @@ import ExclamationCircleFilled from '@ant-design/icons-vue/ExclamationCircleFill
|
||||||
import Button from '../button';
|
import Button from '../button';
|
||||||
import { useLocaleReceiver } from '../locale-provider/LocaleReceiver';
|
import { useLocaleReceiver } from '../locale-provider/LocaleReceiver';
|
||||||
import defaultLocale from '../locale-provider/default';
|
import defaultLocale from '../locale-provider/default';
|
||||||
|
import type { CustomSlotsType } from '../_util/type';
|
||||||
import { withInstall } from '../_util/type';
|
import { withInstall } from '../_util/type';
|
||||||
import useMergedState from '../_util/hooks/useMergedState';
|
import useMergedState from '../_util/hooks/useMergedState';
|
||||||
import devWarning from '../vc-util/devWarning';
|
import devWarning from '../vc-util/devWarning';
|
||||||
|
@ -70,7 +71,16 @@ const Popconfirm = defineComponent({
|
||||||
okType: 'primary',
|
okType: 'primary',
|
||||||
disabled: false,
|
disabled: false,
|
||||||
}),
|
}),
|
||||||
slots: ['title', 'content', 'okText', 'icon', 'cancelText', 'cancelButton', 'okButton'],
|
slots: Object as CustomSlotsType<{
|
||||||
|
title?: any;
|
||||||
|
content?: any;
|
||||||
|
okText?: any;
|
||||||
|
icon?: any;
|
||||||
|
cancelText?: any;
|
||||||
|
cancelButton?: any;
|
||||||
|
okButton?: any;
|
||||||
|
default?: any;
|
||||||
|
}>,
|
||||||
emits: ['update:visible', 'visibleChange'],
|
emits: ['update:visible', 'visibleChange'],
|
||||||
setup(props: PopconfirmProps, { slots, emit, expose }) {
|
setup(props: PopconfirmProps, { slots, emit, expose }) {
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|
|
@ -11,7 +11,7 @@ import { getSuccessPercent, validProgress } from './utils';
|
||||||
import useConfigInject from '../_util/hooks/useConfigInject';
|
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||||
import devWarning from '../vc-util/devWarning';
|
import devWarning from '../vc-util/devWarning';
|
||||||
import { progressProps, progressStatuses } from './props';
|
import { progressProps, progressStatuses } from './props';
|
||||||
import type { VueNode } from '../_util/type';
|
import type { CustomSlotsType, VueNode } from '../_util/type';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
compatConfig: { MODE: 3 },
|
compatConfig: { MODE: 3 },
|
||||||
|
@ -25,7 +25,10 @@ export default defineComponent({
|
||||||
size: 'default',
|
size: 'default',
|
||||||
strokeLinecap: 'round',
|
strokeLinecap: 'round',
|
||||||
}),
|
}),
|
||||||
slots: ['format'],
|
slots: Object as CustomSlotsType<{
|
||||||
|
default?: any;
|
||||||
|
format?: any;
|
||||||
|
}>,
|
||||||
setup(props, { slots }) {
|
setup(props, { slots }) {
|
||||||
const { prefixCls, direction } = useConfigInject('progress', props);
|
const { prefixCls, direction } = useConfigInject('progress', props);
|
||||||
devWarning(
|
devWarning(
|
||||||
|
|
|
@ -10,6 +10,7 @@ import serverError from './serverError';
|
||||||
import unauthorized from './unauthorized';
|
import unauthorized from './unauthorized';
|
||||||
import useConfigInject from '../_util/hooks/useConfigInject';
|
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||||
import classNames from '../_util/classNames';
|
import classNames from '../_util/classNames';
|
||||||
|
import type { CustomSlotsType } from '../_util/type';
|
||||||
|
|
||||||
export const IconMap = {
|
export const IconMap = {
|
||||||
success: CheckCircleFilled,
|
success: CheckCircleFilled,
|
||||||
|
@ -62,7 +63,13 @@ const Result = defineComponent({
|
||||||
compatConfig: { MODE: 3 },
|
compatConfig: { MODE: 3 },
|
||||||
name: 'AResult',
|
name: 'AResult',
|
||||||
props: resultProps(),
|
props: resultProps(),
|
||||||
slots: ['title', 'subTitle', 'icon', 'extra'],
|
slots: Object as CustomSlotsType<{
|
||||||
|
title?: any;
|
||||||
|
subTitle?: any;
|
||||||
|
icon?: any;
|
||||||
|
extra?: any;
|
||||||
|
dfault?: any;
|
||||||
|
}>,
|
||||||
setup(props, { slots }) {
|
setup(props, { slots }) {
|
||||||
const { prefixCls, direction } = useConfigInject('result', props);
|
const { prefixCls, direction } = useConfigInject('result', props);
|
||||||
const className = computed(() =>
|
const className = computed(() =>
|
||||||
|
|
|
@ -13,6 +13,7 @@ import { useInjectFormItemContext } from '../form/FormItemContext';
|
||||||
import { getTransitionName } from '../_util/transition';
|
import { getTransitionName } from '../_util/transition';
|
||||||
import type { SizeType } from '../config-provider';
|
import type { SizeType } from '../config-provider';
|
||||||
import { initDefaultProps } from '../_util/props-util';
|
import { initDefaultProps } from '../_util/props-util';
|
||||||
|
import type { CustomSlotsType } from '../_util/type';
|
||||||
|
|
||||||
type RawValue = string | number;
|
type RawValue = string | number;
|
||||||
|
|
||||||
|
@ -65,20 +66,20 @@ const Select = defineComponent({
|
||||||
listItemHeight: 24,
|
listItemHeight: 24,
|
||||||
}),
|
}),
|
||||||
SECRET_COMBOBOX_MODE_DO_NOT_USE,
|
SECRET_COMBOBOX_MODE_DO_NOT_USE,
|
||||||
// emits: ['change', 'update:value', 'blur'],
|
slots: Object as CustomSlotsType<{
|
||||||
slots: [
|
notFoundContent: any;
|
||||||
'notFoundContent',
|
suffixIcon: any;
|
||||||
'suffixIcon',
|
itemIcon: any;
|
||||||
'itemIcon',
|
removeIcon: any;
|
||||||
'removeIcon',
|
clearIcon: any;
|
||||||
'clearIcon',
|
dropdownRender: any;
|
||||||
'dropdownRender',
|
option: any;
|
||||||
'option',
|
placeholder: any;
|
||||||
'placeholder',
|
tagRender: any;
|
||||||
'tagRender',
|
maxTagPlaceholder: any;
|
||||||
'maxTagPlaceholder',
|
optionLabel: any;
|
||||||
'optionLabel', // donot use, maybe remove it
|
default: any;
|
||||||
],
|
}>,
|
||||||
setup(props, { attrs, emit, slots, expose }) {
|
setup(props, { attrs, emit, slots, expose }) {
|
||||||
const selectRef = ref<BaseSelectRef>();
|
const selectRef = ref<BaseSelectRef>();
|
||||||
const formItemContext = useInjectFormItemContext();
|
const formItemContext = useInjectFormItemContext();
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { computed, ref, defineComponent } from 'vue';
|
||||||
import VcSlider from '../vc-slider/src/Slider';
|
import VcSlider from '../vc-slider/src/Slider';
|
||||||
import VcRange from '../vc-slider/src/Range';
|
import VcRange from '../vc-slider/src/Range';
|
||||||
import VcHandle from '../vc-slider/src/Handle';
|
import VcHandle from '../vc-slider/src/Handle';
|
||||||
import type { VueNode } from '../_util/type';
|
import type { CustomSlotsType, VueNode } from '../_util/type';
|
||||||
import { withInstall } from '../_util/type';
|
import { withInstall } from '../_util/type';
|
||||||
import type { TooltipPlacement } from '../tooltip/Tooltip';
|
import type { TooltipPlacement } from '../tooltip/Tooltip';
|
||||||
import useConfigInject from '../_util/hooks/useConfigInject';
|
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||||
|
@ -83,7 +83,10 @@ const Slider = defineComponent({
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
props: sliderProps(),
|
props: sliderProps(),
|
||||||
// emits: ['update:value', 'change', 'afterChange', 'blur'],
|
// emits: ['update:value', 'change', 'afterChange', 'blur'],
|
||||||
slots: ['mark'],
|
slots: Object as CustomSlotsType<{
|
||||||
|
mark?: any;
|
||||||
|
default?: any;
|
||||||
|
}>,
|
||||||
setup(props, { attrs, slots, emit, expose }) {
|
setup(props, { attrs, slots, emit, expose }) {
|
||||||
const { prefixCls, rootPrefixCls, direction, getPopupContainer, configProvider } =
|
const { prefixCls, rootPrefixCls, direction, getPopupContainer, configProvider } =
|
||||||
useConfigInject('slider', props);
|
useConfigInject('slider', props);
|
||||||
|
|
|
@ -3,6 +3,7 @@ import { defineComponent, computed, ref, watch, Fragment } from 'vue';
|
||||||
import PropTypes from '../_util/vue-types';
|
import PropTypes from '../_util/vue-types';
|
||||||
import { filterEmpty } from '../_util/props-util';
|
import { filterEmpty } from '../_util/props-util';
|
||||||
import type { SizeType } from '../config-provider';
|
import type { SizeType } from '../config-provider';
|
||||||
|
import type { CustomSlotsType } from '../_util/type';
|
||||||
import { tuple, withInstall } from '../_util/type';
|
import { tuple, withInstall } from '../_util/type';
|
||||||
import useConfigInject from '../_util/hooks/useConfigInject';
|
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||||
import useFlexGapSupport from '../_util/hooks/useFlexGapSupport';
|
import useFlexGapSupport from '../_util/hooks/useFlexGapSupport';
|
||||||
|
@ -34,7 +35,10 @@ const Space = defineComponent({
|
||||||
compatConfig: { MODE: 3 },
|
compatConfig: { MODE: 3 },
|
||||||
name: 'ASpace',
|
name: 'ASpace',
|
||||||
props: spaceProps(),
|
props: spaceProps(),
|
||||||
slots: ['split'],
|
slots: Object as CustomSlotsType<{
|
||||||
|
split?: any;
|
||||||
|
default?: any;
|
||||||
|
}>,
|
||||||
setup(props, { slots }) {
|
setup(props, { slots }) {
|
||||||
const { prefixCls, space, direction: directionConfig } = useConfigInject('space', props);
|
const { prefixCls, space, direction: directionConfig } = useConfigInject('space', props);
|
||||||
const supportFlexGap = useFlexGapSupport();
|
const supportFlexGap = useFlexGapSupport();
|
||||||
|
|
|
@ -6,6 +6,7 @@ import StatisticNumber from './Number';
|
||||||
import type { valueType } from './utils';
|
import type { valueType } from './utils';
|
||||||
import Skeleton from '../skeleton/Skeleton';
|
import Skeleton from '../skeleton/Skeleton';
|
||||||
import useConfigInject from '../_util/hooks/useConfigInject';
|
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||||
|
import type { CustomSlotsType } from '../_util/type';
|
||||||
|
|
||||||
export const statisticProps = () => ({
|
export const statisticProps = () => ({
|
||||||
prefixCls: String,
|
prefixCls: String,
|
||||||
|
@ -35,7 +36,13 @@ export default defineComponent({
|
||||||
groupSeparator: ',',
|
groupSeparator: ',',
|
||||||
loading: false,
|
loading: false,
|
||||||
}),
|
}),
|
||||||
slots: ['title', 'prefix', 'suffix', 'formatter'],
|
slots: Object as CustomSlotsType<{
|
||||||
|
title?: any;
|
||||||
|
prefix?: any;
|
||||||
|
suffix?: any;
|
||||||
|
formatter?: any;
|
||||||
|
default?: any;
|
||||||
|
}>,
|
||||||
setup(props, { slots }) {
|
setup(props, { slots }) {
|
||||||
const { prefixCls, direction } = useConfigInject('statistic', props);
|
const { prefixCls, direction } = useConfigInject('statistic', props);
|
||||||
return () => {
|
return () => {
|
||||||
|
|
|
@ -13,6 +13,7 @@ import omit from '../_util/omit';
|
||||||
import { VcStepProps } from '../vc-steps/Step';
|
import { VcStepProps } from '../vc-steps/Step';
|
||||||
import type { ProgressDotRender } from '../vc-steps/Steps';
|
import type { ProgressDotRender } from '../vc-steps/Steps';
|
||||||
import type { MouseEventHandler } from '../_util/EventInterface';
|
import type { MouseEventHandler } from '../_util/EventInterface';
|
||||||
|
import type { CustomSlotsType } from '../_util/type';
|
||||||
|
|
||||||
export const stepsProps = () => ({
|
export const stepsProps = () => ({
|
||||||
prefixCls: String,
|
prefixCls: String,
|
||||||
|
@ -57,7 +58,11 @@ const Steps = defineComponent({
|
||||||
responsive: true,
|
responsive: true,
|
||||||
labelPlacement: 'horizontal',
|
labelPlacement: 'horizontal',
|
||||||
}),
|
}),
|
||||||
slots: ['progressDot'],
|
slots: Object as CustomSlotsType<{
|
||||||
|
progressDot: any;
|
||||||
|
default: any;
|
||||||
|
}>,
|
||||||
|
|
||||||
// emits: ['update:current', 'change'],
|
// emits: ['update:current', 'change'],
|
||||||
setup(props, { attrs, slots, emit }) {
|
setup(props, { attrs, slots, emit }) {
|
||||||
const { prefixCls, direction: rtlDirection, configProvider } = useConfigInject('steps', props);
|
const { prefixCls, direction: rtlDirection, configProvider } = useConfigInject('steps', props);
|
||||||
|
|
|
@ -5,6 +5,7 @@ import PropTypes from '../_util/vue-types';
|
||||||
import KeyCode from '../_util/KeyCode';
|
import KeyCode from '../_util/KeyCode';
|
||||||
import Wave from '../_util/wave';
|
import Wave from '../_util/wave';
|
||||||
import warning from '../_util/warning';
|
import warning from '../_util/warning';
|
||||||
|
import type { CustomSlotsType } from '../_util/type';
|
||||||
import { tuple, withInstall } from '../_util/type';
|
import { tuple, withInstall } from '../_util/type';
|
||||||
import { getPropsSlot } from '../_util/props-util';
|
import { getPropsSlot } from '../_util/props-util';
|
||||||
import useConfigInject from '../_util/hooks/useConfigInject';
|
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||||
|
@ -60,7 +61,11 @@ const Switch = defineComponent({
|
||||||
__ANT_SWITCH: true,
|
__ANT_SWITCH: true,
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
props: switchProps(),
|
props: switchProps(),
|
||||||
slots: ['checkedChildren', 'unCheckedChildren'],
|
slots: Object as CustomSlotsType<{
|
||||||
|
checkedChildren: any;
|
||||||
|
unCheckedChildren: any;
|
||||||
|
default: any;
|
||||||
|
}>,
|
||||||
// emits: ['update:checked', 'mouseup', 'change', 'click', 'keydown', 'blur'],
|
// emits: ['update:checked', 'mouseup', 'change', 'click', 'keydown', 'blur'],
|
||||||
setup(props, { attrs, slots, expose, emit }) {
|
setup(props, { attrs, slots, expose, emit }) {
|
||||||
const formItemContext = useInjectFormItemContext();
|
const formItemContext = useInjectFormItemContext();
|
||||||
|
|
|
@ -1,10 +1,16 @@
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import type { ColumnType } from './interface';
|
import type { ColumnType } from './interface';
|
||||||
|
import type { CustomSlotsType } from '../_util/type';
|
||||||
|
|
||||||
export type ColumnProps<RecordType = unknown> = ColumnType<RecordType>;
|
export type ColumnProps<RecordType = unknown> = ColumnType<RecordType>;
|
||||||
export default defineComponent<ColumnProps>({
|
export default defineComponent<ColumnProps>({
|
||||||
name: 'ATableColumn',
|
name: 'ATableColumn',
|
||||||
slots: ['title', 'filterIcon'],
|
slots: Object as CustomSlotsType<{
|
||||||
|
title?: any;
|
||||||
|
filterIcon?: any;
|
||||||
|
default?: any;
|
||||||
|
}>,
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import type { ColumnGroupProps } from '../vc-table/sugar/ColumnGroup';
|
import type { ColumnGroupProps } from '../vc-table/sugar/ColumnGroup';
|
||||||
|
import type { CustomSlotsType } from '../_util/type';
|
||||||
|
|
||||||
export default defineComponent<ColumnGroupProps<any>>({
|
export default defineComponent<ColumnGroupProps<any>>({
|
||||||
name: 'ATableColumnGroup',
|
name: 'ATableColumnGroup',
|
||||||
slots: ['title'],
|
slots: Object as CustomSlotsType<{
|
||||||
|
title?: any;
|
||||||
|
default?: any;
|
||||||
|
}>,
|
||||||
__ANT_TABLE_COLUMN_GROUP: true,
|
__ANT_TABLE_COLUMN_GROUP: true,
|
||||||
render() {
|
render() {
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -36,7 +36,7 @@ import type { SizeType } from '../config-provider';
|
||||||
import devWarning from '../vc-util/devWarning';
|
import devWarning from '../vc-util/devWarning';
|
||||||
import type { CSSProperties, PropType } from 'vue';
|
import type { CSSProperties, PropType } from 'vue';
|
||||||
import { nextTick, reactive, ref, computed, defineComponent, toRef, watchEffect, watch } from 'vue';
|
import { nextTick, reactive, ref, computed, defineComponent, toRef, watchEffect, watch } from 'vue';
|
||||||
import type { DefaultRecordType } from '../vc-table/interface';
|
import type { DefaultRecordType, RenderExpandIconProps } from '../vc-table/interface';
|
||||||
import useBreakpoint from '../_util/hooks/useBreakpoint';
|
import useBreakpoint from '../_util/hooks/useBreakpoint';
|
||||||
import useConfigInject from '../_util/hooks/useConfigInject';
|
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||||
import { useLocaleReceiver } from '../locale-provider/LocaleReceiver';
|
import { useLocaleReceiver } from '../locale-provider/LocaleReceiver';
|
||||||
|
@ -47,6 +47,7 @@ import { useProvideSlots, useProvideTableContext } from './context';
|
||||||
import type { ContextSlots } from './context';
|
import type { ContextSlots } from './context';
|
||||||
import useColumns from './hooks/useColumns';
|
import useColumns from './hooks/useColumns';
|
||||||
import { convertChildrenToColumns } from './util';
|
import { convertChildrenToColumns } from './util';
|
||||||
|
import type { CustomSlotsType } from '../_util/type';
|
||||||
|
|
||||||
export type { ColumnsType, TablePaginationConfig };
|
export type { ColumnsType, TablePaginationConfig };
|
||||||
|
|
||||||
|
@ -242,19 +243,19 @@ const InteralTable = defineComponent<
|
||||||
props: initDefaultProps(tableProps(), {
|
props: initDefaultProps(tableProps(), {
|
||||||
rowKey: 'key',
|
rowKey: 'key',
|
||||||
}) as any,
|
}) as any,
|
||||||
// emits: ['expandedRowsChange', 'change', 'expand'],
|
slots: Object as CustomSlotsType<{
|
||||||
slots: [
|
emptyText?: any;
|
||||||
'emptyText',
|
expandIcon?: RenderExpandIconProps<any>;
|
||||||
'expandIcon',
|
title?: any;
|
||||||
'title',
|
footer?: any;
|
||||||
'footer',
|
summary?: any;
|
||||||
'summary',
|
expandedRowRender?: any;
|
||||||
'expandedRowRender',
|
bodyCell?: any;
|
||||||
'bodyCell',
|
headerCell?: any;
|
||||||
'headerCell',
|
customFilterIcon?: any;
|
||||||
'customFilterIcon',
|
customFilterDropdown?: any;
|
||||||
'customFilterDropdown',
|
default: any;
|
||||||
],
|
}>,
|
||||||
setup(props, { attrs, slots, expose, emit }) {
|
setup(props, { attrs, slots, expose, emit }) {
|
||||||
devWarning(
|
devWarning(
|
||||||
!(typeof props.rowKey === 'function' && props.rowKey.length > 1),
|
!(typeof props.rowKey === 'function' && props.rowKey.length > 1),
|
||||||
|
|
|
@ -2,7 +2,7 @@ import Menu, { MenuItem } from '../../../menu';
|
||||||
import Dropdown from '../../../vc-dropdown';
|
import Dropdown from '../../../vc-dropdown';
|
||||||
import type { Tab, TabsLocale, EditableConfig } from '../interface';
|
import type { Tab, TabsLocale, EditableConfig } from '../interface';
|
||||||
import AddButton from './AddButton';
|
import AddButton from './AddButton';
|
||||||
import type { Key } from '../../../_util/type';
|
import type { CustomSlotsType, Key } from '../../../_util/type';
|
||||||
import KeyCode from '../../../_util/KeyCode';
|
import KeyCode from '../../../_util/KeyCode';
|
||||||
import type { CSSProperties, ExtractPropTypes, PropType } from 'vue';
|
import type { CSSProperties, ExtractPropTypes, PropType } from 'vue';
|
||||||
import classNames from '../../../_util/classNames';
|
import classNames from '../../../_util/classNames';
|
||||||
|
@ -35,7 +35,10 @@ export default defineComponent({
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
props: operationNodeProps,
|
props: operationNodeProps,
|
||||||
emits: ['tabClick'],
|
emits: ['tabClick'],
|
||||||
slots: ['moreIcon'],
|
slots: Object as CustomSlotsType<{
|
||||||
|
moreIcon?: any;
|
||||||
|
default?: any;
|
||||||
|
}>,
|
||||||
setup(props, { attrs, slots }) {
|
setup(props, { attrs, slots }) {
|
||||||
// ======================== Dropdown ========================
|
// ======================== Dropdown ========================
|
||||||
const [open, setOpen] = useState(false);
|
const [open, setOpen] = useState(false);
|
||||||
|
|
|
@ -16,7 +16,7 @@ import OperationNode from './OperationNode';
|
||||||
import { useInjectTabs } from '../TabContext';
|
import { useInjectTabs } from '../TabContext';
|
||||||
import useTouchMove from '../hooks/useTouchMove';
|
import useTouchMove from '../hooks/useTouchMove';
|
||||||
import AddButton from './AddButton';
|
import AddButton from './AddButton';
|
||||||
import type { Key } from '../../../_util/type';
|
import type { CustomSlotsType, Key } from '../../../_util/type';
|
||||||
import type { ExtractPropTypes, PropType, CSSProperties } from 'vue';
|
import type { ExtractPropTypes, PropType, CSSProperties } from 'vue';
|
||||||
import { onBeforeUnmount, defineComponent, ref, watch, watchEffect, computed } from 'vue';
|
import { onBeforeUnmount, defineComponent, ref, watch, watchEffect, computed } from 'vue';
|
||||||
import PropTypes from '../../../_util/vue-types';
|
import PropTypes from '../../../_util/vue-types';
|
||||||
|
@ -64,7 +64,13 @@ export default defineComponent({
|
||||||
name: 'TabNavList',
|
name: 'TabNavList',
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
props: tabNavListProps(),
|
props: tabNavListProps(),
|
||||||
slots: ['moreIcon', 'leftExtra', 'rightExtra', 'tabBarExtraContent'],
|
slots: Object as CustomSlotsType<{
|
||||||
|
moreIcon?: any;
|
||||||
|
leftExtra?: any;
|
||||||
|
rightExtra?: any;
|
||||||
|
tabBarExtraContent?: any;
|
||||||
|
default?: any;
|
||||||
|
}>,
|
||||||
emits: ['tabClick', 'tabScroll'],
|
emits: ['tabClick', 'tabScroll'],
|
||||||
setup(props, { attrs, slots }) {
|
setup(props, { attrs, slots }) {
|
||||||
const { tabs, prefixCls } = useInjectTabs();
|
const { tabs, prefixCls } = useInjectTabs();
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { defineComponent, ref, watch, computed } from 'vue';
|
import { defineComponent, ref, watch, computed } from 'vue';
|
||||||
import type { CSSProperties, ExtractPropTypes } from 'vue';
|
import type { CSSProperties, ExtractPropTypes } from 'vue';
|
||||||
import PropTypes from '../../../_util/vue-types';
|
import PropTypes from '../../../_util/vue-types';
|
||||||
|
import type { CustomSlotsType } from '../../../_util/type';
|
||||||
|
|
||||||
const tabPaneProps = () => ({
|
const tabPaneProps = () => ({
|
||||||
tab: PropTypes.any,
|
tab: PropTypes.any,
|
||||||
|
@ -26,7 +27,11 @@ export default defineComponent({
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
__ANT_TAB_PANE: true,
|
__ANT_TAB_PANE: true,
|
||||||
props: tabPaneProps(),
|
props: tabPaneProps(),
|
||||||
slots: ['closeIcon', 'tab'],
|
slots: Object as CustomSlotsType<{
|
||||||
|
closeIcon: any;
|
||||||
|
tab: any;
|
||||||
|
default: any;
|
||||||
|
}>,
|
||||||
setup(props, { attrs, slots }) {
|
setup(props, { attrs, slots }) {
|
||||||
const visited = ref(props.forceRender);
|
const visited = ref(props.forceRender);
|
||||||
watch(
|
watch(
|
||||||
|
|
|
@ -23,7 +23,7 @@ import PlusOutlined from '@ant-design/icons-vue/PlusOutlined';
|
||||||
import devWarning from '../../vc-util/devWarning';
|
import devWarning from '../../vc-util/devWarning';
|
||||||
import type { SizeType } from '../../config-provider';
|
import type { SizeType } from '../../config-provider';
|
||||||
import { useProvideTabs } from './TabContext';
|
import { useProvideTabs } from './TabContext';
|
||||||
import type { Key } from '../../_util/type';
|
import type { CustomSlotsType, Key } from '../../_util/type';
|
||||||
import pick from 'lodash-es/pick';
|
import pick from 'lodash-es/pick';
|
||||||
import PropTypes from '../../_util/vue-types';
|
import PropTypes from '../../_util/vue-types';
|
||||||
import type { MouseEventHandler } from '../../_util/EventInterface';
|
import type { MouseEventHandler } from '../../_util/EventInterface';
|
||||||
|
@ -128,15 +128,16 @@ const InternalTabs = defineComponent({
|
||||||
}),
|
}),
|
||||||
tabs: { type: Array as PropType<Tab[]> },
|
tabs: { type: Array as PropType<Tab[]> },
|
||||||
},
|
},
|
||||||
slots: [
|
slots: Object as CustomSlotsType<{
|
||||||
'tabBarExtraContent',
|
tabBarExtraContent?: any;
|
||||||
'leftExtra',
|
leftExtra?: any;
|
||||||
'rightExtra',
|
rightExtra?: any;
|
||||||
'moreIcon',
|
moreIcon?: any;
|
||||||
'addIcon',
|
addIcon?: any;
|
||||||
'removeIcon',
|
removeIcon?: any;
|
||||||
'renderTabBar',
|
renderTabBar?: any;
|
||||||
],
|
default: any;
|
||||||
|
}>,
|
||||||
// emits: ['tabClick', 'tabScroll', 'change', 'update:activeKey'],
|
// emits: ['tabClick', 'tabScroll', 'change', 'update:activeKey'],
|
||||||
setup(props, { attrs, slots }) {
|
setup(props, { attrs, slots }) {
|
||||||
devWarning(
|
devWarning(
|
||||||
|
@ -339,15 +340,16 @@ export default defineComponent({
|
||||||
tabPane: false,
|
tabPane: false,
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
slots: [
|
slots: Object as CustomSlotsType<{
|
||||||
'tabBarExtraContent',
|
tabBarExtraContent?: any;
|
||||||
'leftExtra',
|
leftExtra?: any;
|
||||||
'rightExtra',
|
rightExtra?: any;
|
||||||
'moreIcon',
|
moreIcon?: any;
|
||||||
'addIcon',
|
addIcon?: any;
|
||||||
'removeIcon',
|
removeIcon?: any;
|
||||||
'renderTabBar',
|
renderTabBar?: any;
|
||||||
],
|
default?: any;
|
||||||
|
}>,
|
||||||
// emits: ['tabClick', 'tabScroll', 'change', 'update:activeKey'],
|
// emits: ['tabClick', 'tabScroll', 'change', 'update:activeKey'],
|
||||||
setup(props, { attrs, slots, emit }) {
|
setup(props, { attrs, slots, emit }) {
|
||||||
const handleChange = (key: string) => {
|
const handleChange = (key: string) => {
|
||||||
|
|
|
@ -6,7 +6,7 @@ import CloseOutlined from '@ant-design/icons-vue/CloseOutlined';
|
||||||
import Wave from '../_util/wave';
|
import Wave from '../_util/wave';
|
||||||
import type { PresetColorType, PresetStatusColorType } from '../_util/colors';
|
import type { PresetColorType, PresetStatusColorType } from '../_util/colors';
|
||||||
import { PresetColorTypes, PresetStatusColorTypes } from '../_util/colors';
|
import { PresetColorTypes, PresetStatusColorTypes } from '../_util/colors';
|
||||||
import type { LiteralUnion } from '../_util/type';
|
import type { CustomSlotsType, LiteralUnion } from '../_util/type';
|
||||||
import CheckableTag from './CheckableTag';
|
import CheckableTag from './CheckableTag';
|
||||||
import useConfigInject from '../_util/hooks/useConfigInject';
|
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||||
|
|
||||||
|
@ -35,7 +35,11 @@ const Tag = defineComponent({
|
||||||
name: 'ATag',
|
name: 'ATag',
|
||||||
props: tagProps(),
|
props: tagProps(),
|
||||||
// emits: ['update:visible', 'close'],
|
// emits: ['update:visible', 'close'],
|
||||||
slots: ['closeIcon', 'icon'],
|
slots: Object as CustomSlotsType<{
|
||||||
|
closeIcon: any;
|
||||||
|
icon: any;
|
||||||
|
default: any;
|
||||||
|
}>,
|
||||||
setup(props: TagProps, { slots, emit, attrs }) {
|
setup(props: TagProps, { slots, emit, attrs }) {
|
||||||
const { prefixCls, direction } = useConfigInject('tag', props);
|
const { prefixCls, direction } = useConfigInject('tag', props);
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,7 @@ import type { RangePickerSharedProps } from '../vc-picker/RangePicker';
|
||||||
import devWarning from '../vc-util/devWarning';
|
import devWarning from '../vc-util/devWarning';
|
||||||
import { useInjectFormItemContext } from '../form/FormItemContext';
|
import { useInjectFormItemContext } from '../form/FormItemContext';
|
||||||
import omit from '../_util/omit';
|
import omit from '../_util/omit';
|
||||||
|
import type { CustomSlotsType } from '../_util/type';
|
||||||
|
|
||||||
export interface TimePickerLocale {
|
export interface TimePickerLocale {
|
||||||
placeholder?: string;
|
placeholder?: string;
|
||||||
|
@ -93,7 +94,13 @@ function createTimePicker<
|
||||||
...timePickerProps(),
|
...timePickerProps(),
|
||||||
addon: { type: Function },
|
addon: { type: Function },
|
||||||
} as any,
|
} as any,
|
||||||
slot: ['addon', 'renderExtraFooter', 'suffixIcon', 'clearIcon'],
|
slots: Object as CustomSlotsType<{
|
||||||
|
addon?: any;
|
||||||
|
renderExtraFooter?: any;
|
||||||
|
suffixIcon?: any;
|
||||||
|
clearIcon?: any;
|
||||||
|
default: any;
|
||||||
|
}>,
|
||||||
setup(props, { slots, expose, emit, attrs }) {
|
setup(props, { slots, expose, emit, attrs }) {
|
||||||
const formItemContext = useInjectFormItemContext();
|
const formItemContext = useInjectFormItemContext();
|
||||||
devWarning(
|
devWarning(
|
||||||
|
@ -164,7 +171,12 @@ function createTimePicker<
|
||||||
...timePickerProps(),
|
...timePickerProps(),
|
||||||
order: { type: Boolean, default: true },
|
order: { type: Boolean, default: true },
|
||||||
} as any,
|
} as any,
|
||||||
slot: ['renderExtraFooter', 'suffixIcon', 'clearIcon'],
|
slots: Object as CustomSlotsType<{
|
||||||
|
renderExtraFooter?: any;
|
||||||
|
suffixIcon?: any;
|
||||||
|
clearIcon?: any;
|
||||||
|
default: any;
|
||||||
|
}>,
|
||||||
setup(props, { slots, expose, emit, attrs }) {
|
setup(props, { slots, expose, emit, attrs }) {
|
||||||
const pickerRef = ref();
|
const pickerRef = ref();
|
||||||
const formItemContext = useInjectFormItemContext();
|
const formItemContext = useInjectFormItemContext();
|
||||||
|
|
|
@ -6,6 +6,7 @@ import { filterEmpty } from '../_util/props-util';
|
||||||
import initDefaultProps from '../_util/props-util/initDefaultProps';
|
import initDefaultProps from '../_util/props-util/initDefaultProps';
|
||||||
import TimelineItem from './TimelineItem';
|
import TimelineItem from './TimelineItem';
|
||||||
import LoadingOutlined from '@ant-design/icons-vue/LoadingOutlined';
|
import LoadingOutlined from '@ant-design/icons-vue/LoadingOutlined';
|
||||||
|
import type { CustomSlotsType } from '../_util/type';
|
||||||
import { tuple } from '../_util/type';
|
import { tuple } from '../_util/type';
|
||||||
import useConfigInject from '../_util/hooks/useConfigInject';
|
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||||
|
|
||||||
|
@ -27,7 +28,11 @@ export default defineComponent({
|
||||||
reverse: false,
|
reverse: false,
|
||||||
mode: '',
|
mode: '',
|
||||||
}),
|
}),
|
||||||
slots: ['pending', 'pendingDot'],
|
slots: Object as CustomSlotsType<{
|
||||||
|
pending?: any;
|
||||||
|
pendingDot?: any;
|
||||||
|
default?: any;
|
||||||
|
}>,
|
||||||
setup(props, { slots }) {
|
setup(props, { slots }) {
|
||||||
const { prefixCls, direction } = useConfigInject('timeline', props);
|
const { prefixCls, direction } = useConfigInject('timeline', props);
|
||||||
const getPositionCls = (ele, idx: number) => {
|
const getPositionCls = (ele, idx: number) => {
|
||||||
|
|
|
@ -3,6 +3,7 @@ import { defineComponent } from 'vue';
|
||||||
import classNames from '../_util/classNames';
|
import classNames from '../_util/classNames';
|
||||||
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';
|
||||||
|
import type { CustomSlotsType } from '../_util/type';
|
||||||
import { tuple } from '../_util/type';
|
import { tuple } from '../_util/type';
|
||||||
import useConfigInject from '../_util/hooks/useConfigInject';
|
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||||
|
|
||||||
|
@ -24,7 +25,11 @@ export default defineComponent({
|
||||||
color: 'blue',
|
color: 'blue',
|
||||||
pending: false,
|
pending: false,
|
||||||
}),
|
}),
|
||||||
slots: ['dot', 'label'],
|
slots: Object as CustomSlotsType<{
|
||||||
|
dot?: any;
|
||||||
|
label?: any;
|
||||||
|
default?: any;
|
||||||
|
}>,
|
||||||
setup(props, { slots }) {
|
setup(props, { slots }) {
|
||||||
const { prefixCls } = useConfigInject('timeline', props);
|
const { prefixCls } = useConfigInject('timeline', props);
|
||||||
return () => {
|
return () => {
|
||||||
|
|
|
@ -13,6 +13,7 @@ import useConfigInject from '../_util/hooks/useConfigInject';
|
||||||
import getPlacements from './placements';
|
import getPlacements from './placements';
|
||||||
import firstNotUndefined from '../_util/firstNotUndefined';
|
import firstNotUndefined from '../_util/firstNotUndefined';
|
||||||
import raf from '../_util/raf';
|
import raf from '../_util/raf';
|
||||||
|
import type { CustomSlotsType } from '../_util/type';
|
||||||
export type { AdjustOverflow, PlacementsConfig } from './placements';
|
export type { AdjustOverflow, PlacementsConfig } from './placements';
|
||||||
|
|
||||||
// https://github.com/react-component/tooltip
|
// https://github.com/react-component/tooltip
|
||||||
|
@ -73,7 +74,10 @@ export default defineComponent({
|
||||||
arrowPointAtCenter: false,
|
arrowPointAtCenter: false,
|
||||||
autoAdjustOverflow: true,
|
autoAdjustOverflow: true,
|
||||||
}),
|
}),
|
||||||
slots: ['title'],
|
slots: Object as CustomSlotsType<{
|
||||||
|
title?: any;
|
||||||
|
default?: any;
|
||||||
|
}>,
|
||||||
// emits: ['update:visible', 'visibleChange'],
|
// emits: ['update:visible', 'visibleChange'],
|
||||||
setup(props, { slots, emit, attrs, expose }) {
|
setup(props, { slots, emit, attrs, expose }) {
|
||||||
const { prefixCls, getPopupContainer } = useConfigInject('tooltip', props);
|
const { prefixCls, getPopupContainer } = useConfigInject('tooltip', props);
|
||||||
|
|
|
@ -7,7 +7,7 @@ import List from './list';
|
||||||
import Operation from './operation';
|
import Operation from './operation';
|
||||||
import LocaleReceiver from '../locale-provider/LocaleReceiver';
|
import LocaleReceiver from '../locale-provider/LocaleReceiver';
|
||||||
import defaultLocale from '../locale-provider/default';
|
import defaultLocale from '../locale-provider/default';
|
||||||
import type { VueNode } from '../_util/type';
|
import type { CustomSlotsType, 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';
|
||||||
import type { TransferListBodyProps } from './ListBody';
|
import type { TransferListBodyProps } from './ListBody';
|
||||||
|
@ -109,16 +109,17 @@ const Transfer = defineComponent({
|
||||||
name: 'ATransfer',
|
name: 'ATransfer',
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
props: transferProps(),
|
props: transferProps(),
|
||||||
slots: [
|
slots: Object as CustomSlotsType<{
|
||||||
'leftTitle',
|
leftTitle?: any;
|
||||||
'rightTitle',
|
rightTitle?: any;
|
||||||
'children',
|
children?: any;
|
||||||
'render',
|
render?: TransferItem;
|
||||||
'notFoundContent',
|
notFoundContent?: any;
|
||||||
'leftSelectAllLabel',
|
leftSelectAllLabel?: any;
|
||||||
'rightSelectAllLabel',
|
rightSelectAllLabel?: any;
|
||||||
'footer',
|
footer?: any;
|
||||||
],
|
default?: any;
|
||||||
|
}>,
|
||||||
// emits: ['update:targetKeys', 'update:selectedKeys', 'change', 'search', 'scroll', 'selectChange'],
|
// emits: ['update:targetKeys', 'update:selectedKeys', 'change', 'search', 'scroll', 'selectChange'],
|
||||||
setup(props, { emit, attrs, slots, expose }) {
|
setup(props, { emit, attrs, slots, expose }) {
|
||||||
const { configProvider, prefixCls, direction } = useConfigInject('transfer', props);
|
const { configProvider, prefixCls, direction } = useConfigInject('transfer', props);
|
||||||
|
|
|
@ -11,6 +11,7 @@ import type { VNode, VNodeTypes, ExtractPropTypes, PropType, CSSProperties } fro
|
||||||
import { watchEffect, computed, defineComponent, ref } from 'vue';
|
import { watchEffect, computed, defineComponent, ref } from 'vue';
|
||||||
import type { RadioChangeEvent } from '../radio/interface';
|
import type { RadioChangeEvent } from '../radio/interface';
|
||||||
import type { TransferDirection, TransferItem } from './index';
|
import type { TransferDirection, TransferItem } from './index';
|
||||||
|
import type { CustomSlotsType } from '../_util/type';
|
||||||
|
|
||||||
const defaultRender = () => null;
|
const defaultRender = () => null;
|
||||||
|
|
||||||
|
@ -67,7 +68,11 @@ export default defineComponent({
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
props: transferListProps,
|
props: transferListProps,
|
||||||
// emits: ['scroll', 'itemSelectAll', 'itemRemove', 'itemSelect'],
|
// emits: ['scroll', 'itemSelectAll', 'itemRemove', 'itemSelect'],
|
||||||
slots: ['footer', 'titleText'],
|
slots: Object as CustomSlotsType<{
|
||||||
|
footer?: any;
|
||||||
|
titleText?: any;
|
||||||
|
default?: any;
|
||||||
|
}>,
|
||||||
setup(props, { attrs, slots }) {
|
setup(props, { attrs, slots }) {
|
||||||
const filterValue = ref('');
|
const filterValue = ref('');
|
||||||
const transferNode = ref();
|
const transferNode = ref();
|
||||||
|
|
|
@ -24,6 +24,7 @@ import { useInjectFormItemContext } from '../form/FormItemContext';
|
||||||
import type { BaseSelectRef } from '../vc-select';
|
import type { BaseSelectRef } from '../vc-select';
|
||||||
import type { BaseOptionType, DefaultOptionType } from '../vc-tree-select/TreeSelect';
|
import type { BaseOptionType, DefaultOptionType } from '../vc-tree-select/TreeSelect';
|
||||||
import type { TreeProps } from '../tree';
|
import type { TreeProps } from '../tree';
|
||||||
|
import type { CustomSlotsType } from '../_util/type';
|
||||||
|
|
||||||
const getTransitionName = (rootPrefixCls: string, motion: string, transitionName?: string) => {
|
const getTransitionName = (rootPrefixCls: string, motion: string, transitionName?: string) => {
|
||||||
if (transitionName !== undefined) {
|
if (transitionName !== undefined) {
|
||||||
|
@ -80,15 +81,16 @@ const TreeSelect = defineComponent({
|
||||||
listItemHeight: 26,
|
listItemHeight: 26,
|
||||||
bordered: true,
|
bordered: true,
|
||||||
}),
|
}),
|
||||||
slots: [
|
slots: Object as CustomSlotsType<{
|
||||||
'title',
|
title?: any;
|
||||||
'titleRender',
|
titleRender?: any;
|
||||||
'placeholder',
|
placeholder?: any;
|
||||||
'maxTagPlaceholder',
|
maxTagPlaceholder?: any;
|
||||||
'treeIcon',
|
treeIcon?: any;
|
||||||
'switcherIcon',
|
switcherIcon?: any;
|
||||||
'notFoundContent',
|
notFoundContent?: any;
|
||||||
],
|
default?: any;
|
||||||
|
}>,
|
||||||
setup(props, { attrs, slots, expose, emit }) {
|
setup(props, { attrs, slots, expose, emit }) {
|
||||||
warning(
|
warning(
|
||||||
!(props.treeData === undefined && slots.default),
|
!(props.treeData === undefined && slots.default),
|
||||||
|
|
|
@ -18,6 +18,7 @@ import { conductExpandParent } from '../vc-tree/util';
|
||||||
import { calcRangeKeys, convertDirectoryKeysToNodes } from './utils/dictUtil';
|
import { calcRangeKeys, convertDirectoryKeysToNodes } from './utils/dictUtil';
|
||||||
import useConfigInject from '../_util/hooks/useConfigInject';
|
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||||
import { filterEmpty } from '../_util/props-util';
|
import { filterEmpty } from '../_util/props-util';
|
||||||
|
import type { CustomSlotsType } from '../_util/type';
|
||||||
|
|
||||||
export type ExpandAction = false | 'click' | 'doubleclick' | 'dblclick';
|
export type ExpandAction = false | 'click' | 'doubleclick' | 'dblclick';
|
||||||
|
|
||||||
|
@ -44,7 +45,14 @@ export default defineComponent({
|
||||||
showIcon: true,
|
showIcon: true,
|
||||||
expandAction: 'click',
|
expandAction: 'click',
|
||||||
}),
|
}),
|
||||||
slots: ['icon', 'title', 'switcherIcon', 'titleRender'],
|
slots: Object as CustomSlotsType<{
|
||||||
|
icon?: any;
|
||||||
|
title?: any;
|
||||||
|
switcherIcon?: any;
|
||||||
|
titleRender?: any;
|
||||||
|
default?: any;
|
||||||
|
}>,
|
||||||
|
|
||||||
// emits: [
|
// emits: [
|
||||||
// 'update:selectedKeys',
|
// 'update:selectedKeys',
|
||||||
// 'update:checkedKeys',
|
// 'update:checkedKeys',
|
||||||
|
|
|
@ -15,6 +15,7 @@ import dropIndicatorRender from './utils/dropIndicator';
|
||||||
import devWarning from '../vc-util/devWarning';
|
import devWarning from '../vc-util/devWarning';
|
||||||
import { warning } from '../vc-util/warning';
|
import { warning } from '../vc-util/warning';
|
||||||
import omit from '../_util/omit';
|
import omit from '../_util/omit';
|
||||||
|
import type { CustomSlotsType } from '../_util/type';
|
||||||
|
|
||||||
export interface AntdTreeNodeAttribute {
|
export interface AntdTreeNodeAttribute {
|
||||||
eventKey: string;
|
eventKey: string;
|
||||||
|
@ -151,17 +152,14 @@ export default defineComponent({
|
||||||
showIcon: false,
|
showIcon: false,
|
||||||
blockNode: false,
|
blockNode: false,
|
||||||
}),
|
}),
|
||||||
slots: ['icon', 'title', 'switcherIcon', 'titleRender'],
|
|
||||||
// emits: [
|
slots: Object as CustomSlotsType<{
|
||||||
// 'update:selectedKeys',
|
icon?: any;
|
||||||
// 'update:checkedKeys',
|
title?: any;
|
||||||
// 'update:expandedKeys',
|
switcherIcon?: any;
|
||||||
// 'expand',
|
titleRender?: any;
|
||||||
// 'select',
|
default?: any;
|
||||||
// 'check',
|
}>,
|
||||||
// 'doubleclick',
|
|
||||||
// 'dblclick',
|
|
||||||
// ],
|
|
||||||
setup(props, { attrs, expose, emit, slots }) {
|
setup(props, { attrs, expose, emit, slots }) {
|
||||||
warning(
|
warning(
|
||||||
!(props.treeData === undefined && slots.default),
|
!(props.treeData === undefined && slots.default),
|
||||||
|
|
|
@ -17,6 +17,8 @@ export default defineComponent({
|
||||||
onClick: { type: Function },
|
onClick: { type: Function },
|
||||||
onKeydown: { type: Function },
|
onKeydown: { type: Function },
|
||||||
onFocus: { type: Function },
|
onFocus: { type: Function },
|
||||||
|
role: String,
|
||||||
|
tabindex: Number,
|
||||||
},
|
},
|
||||||
setup(props, { slots, attrs }) {
|
setup(props, { slots, attrs }) {
|
||||||
const context = useInjectOverflowContext();
|
const context = useInjectOverflowContext();
|
||||||
|
|
Loading…
Reference in New Issue