Merge remote-tracking branch 'origin/main' into feat-v4

pull/6588/head
tangjinzhou 2023-05-18 23:23:43 +08:00
commit 03760e3e3d
88 changed files with 598 additions and 272 deletions

View File

@ -1,4 +1,4 @@
const { resolve } = require('./utils/projectHelper'); const { resolve, isThereHaveBrowserslistConfig } = require('./utils/projectHelper');
module.exports = function (modules) { module.exports = function (modules) {
const plugins = [ const plugins = [
@ -39,7 +39,9 @@ module.exports = function (modules) {
resolve('@babel/preset-env'), resolve('@babel/preset-env'),
{ {
modules, modules,
targets: { targets: isThereHaveBrowserslistConfig()
? undefined
: {
browsers: ['last 2 versions', 'Firefox ESR', '> 1%', 'ie >= 11'], browsers: ['last 2 versions', 'Firefox ESR', '> 1%', 'ie >= 11'],
}, },
}, },

View File

@ -1,4 +1,5 @@
import type { App, PropType, Plugin, Ref, VNode } from 'vue'; // @ts-ignore
import type { App, PropType, Plugin, Ref, VNode, SlotsType } from 'vue';
// https://stackoverflow.com/questions/46176165/ways-to-get-string-literal-type-of-array-values-without-enum-overhead // https://stackoverflow.com/questions/46176165/ways-to-get-string-literal-type-of-array-values-without-enum-overhead
export const tuple = <T extends string[]>(...args: T) => args; export const tuple = <T extends string[]>(...args: T) => args;
@ -87,3 +88,5 @@ export function stringType<T extends string = string>(defaultVal?: T) {
export function someType<T>(types?: any[], defaultVal?: T) { export function someType<T>(types?: any[], defaultVal?: T) {
return types ? { type: types as PropType<T>, default: defaultVal as T } : anyType<T>(defaultVal); return types ? { type: types as PropType<T>, default: defaultVal as T } : anyType<T>(defaultVal);
} }
export type CustomSlotsType<T> = SlotsType<T>;

View File

@ -4,7 +4,7 @@ import { initDefaultProps } from '../_util/props-util';
import classNames from '../_util/classNames'; import classNames from '../_util/classNames';
import useConfigInject from '../config-provider/hooks/useConfigInject'; import useConfigInject from '../config-provider/hooks/useConfigInject';
import { useInjectAnchor } from './context'; import { useInjectAnchor } from './context';
import type { Key, VueNode } from '../_util/type'; import type { Key, VueNode, CustomSlotsType } from '../_util/type';
import { objectType, anyType } from '../_util/type'; import { objectType, anyType } from '../_util/type';
import type { CSSProperties } from '../_util/cssinjs/hooks/useStyleRegister'; import type { CSSProperties } from '../_util/cssinjs/hooks/useStyleRegister';
@ -33,7 +33,11 @@ export default defineComponent({
name: 'AAnchorLink', name: 'AAnchorLink',
inheritAttrs: false, inheritAttrs: false,
props: initDefaultProps(anchorLinkProps(), { href: '#' }), props: initDefaultProps(anchorLinkProps(), { href: '#' }),
slots: ['title', 'customTitle'], slots: Object as CustomSlotsType<{
title: any;
default: any;
customTitle: any;
}>,
setup(props, { slots, attrs }) { setup(props, { slots, attrs }) {
let mergedTitle = null; let mergedTitle = null;
const { const {

View File

@ -6,9 +6,12 @@ import warning from '../_util/warning';
import Option from './Option'; import Option from './Option';
import OptGroup from './OptGroup'; import OptGroup from './OptGroup';
import omit from '../_util/omit'; import omit from '../_util/omit';
import useConfigInject from '../config-provider/hooks/useConfigInject'; import useConfigInject from '../config-provider/hooks/useConfigInject';
import type { InputStatus } from '../_util/statusUtils'; import type { InputStatus } from '../_util/statusUtils';
import type { CustomSlotsType } from '../_util/type';
function isSelectOptionOrSelectOptGroup(child: any): boolean { function isSelectOptionOrSelectOptGroup(child: any): boolean {
return child?.type?.isSelectOption || child?.type?.isSelectOptGroup; return child?.type?.isSelectOption || child?.type?.isSelectOptGroup;
} }
@ -46,7 +49,12 @@ const AutoComplete = defineComponent({
inheritAttrs: false, inheritAttrs: false,
props: autoCompleteProps(), props: autoCompleteProps(),
// emits: ['change', 'select', 'focus', 'blur'], // emits: ['change', 'select', 'focus', 'blur'],
slots: ['option'], slots: Object as CustomSlotsType<{
options: any;
default: any;
notFoundContent: any;
dataSource: any;
}>,
setup(props, { slots, attrs, expose }) { setup(props, { slots, attrs, expose }) {
warning( warning(
!('dataSource' in slots), !('dataSource' in slots),

View File

@ -1,4 +1,4 @@
import type { VueNode } from '../_util/type'; import type { CustomSlotsType, VueNode } from '../_util/type';
import type { CSSProperties, ExtractPropTypes, PropType } from 'vue'; import type { CSSProperties, ExtractPropTypes, PropType } from 'vue';
import { computed, defineComponent, nextTick, onMounted, shallowRef, watch } from 'vue'; import { computed, defineComponent, nextTick, onMounted, shallowRef, watch } from 'vue';
@ -42,7 +42,10 @@ const Avatar = defineComponent({
name: 'AAvatar', name: 'AAvatar',
inheritAttrs: false, inheritAttrs: false,
props: avatarProps(), props: avatarProps(),
slots: ['icon'], slots: Object as CustomSlotsType<{
icon: any;
default: any;
}>,
setup(props, { slots, attrs }) { setup(props, { slots, attrs }) {
const isImgExist = shallowRef(true); const isImgExist = shallowRef(true);
const isMounted = shallowRef(false); const isMounted = shallowRef(false);

View File

@ -11,7 +11,7 @@ import useConfigInject from '../config-provider/hooks/useConfigInject';
import isNumeric from '../_util/isNumeric'; import isNumeric from '../_util/isNumeric';
import useStyle from './style'; import useStyle from './style';
import type { PresetColorKey } from '../theme/interface'; import type { PresetColorKey } from '../theme/interface';
import type { LiteralUnion } from '../_util/type'; import type { LiteralUnion, CustomSlotsType } from '../_util/type';
import type { PresetStatusColorType } from '../_util/colors'; import type { PresetStatusColorType } from '../_util/colors';
import { isPresetColor } from '../_util/colors'; import { isPresetColor } from '../_util/colors';
@ -42,7 +42,11 @@ export default defineComponent({
Ribbon, Ribbon,
inheritAttrs: false, inheritAttrs: false,
props: badgeProps(), props: badgeProps(),
slots: ['text', 'count'], slots: Object as CustomSlotsType<{
text: any;
count: any;
default: any;
}>,
setup(props, { slots, attrs }) { setup(props, { slots, attrs }) {
const { prefixCls, direction } = useConfigInject('badge', props); const { prefixCls, direction } = useConfigInject('badge', props);
const [wrapSSR, hashId] = useStyle(prefixCls); const [wrapSSR, hashId] = useStyle(prefixCls);

View File

@ -1,4 +1,4 @@
import type { LiteralUnion } from '../_util/type'; import type { CustomSlotsType, LiteralUnion } from '../_util/type';
import type { PresetColorType } from '../_util/colors'; import type { PresetColorType } from '../_util/colors';
import useStyle from './style'; import useStyle from './style';
import { isPresetColor } from '../_util/colors'; import { isPresetColor } from '../_util/colors';
@ -21,7 +21,10 @@ export default defineComponent({
name: 'ABadgeRibbon', name: 'ABadgeRibbon',
inheritAttrs: false, inheritAttrs: false,
props: ribbonProps(), props: ribbonProps(),
slots: ['text'], slots: Object as CustomSlotsType<{
text: any;
default: any;
}>,
setup(props, { attrs, slots }) { setup(props, { attrs, slots }) {
const { prefixCls, direction } = useConfigInject('ribbon', props); const { prefixCls, direction } = useConfigInject('ribbon', props);
const [wrapSSR, hashId] = useStyle(prefixCls); const [wrapSSR, hashId] = useStyle(prefixCls);

View File

@ -6,9 +6,10 @@ import warning from '../_util/warning';
import type { BreadcrumbItemProps } from './BreadcrumbItem'; import type { BreadcrumbItemProps } from './BreadcrumbItem';
import BreadcrumbItem from './BreadcrumbItem'; import BreadcrumbItem from './BreadcrumbItem';
import Menu from '../menu'; import Menu from '../menu';
import type { VueNode } from '../_util/type';
import useConfigInject from '../config-provider/hooks/useConfigInject'; import useConfigInject from '../config-provider/hooks/useConfigInject';
import useStyle from './style'; import useStyle from './style';
import type { CustomSlotsType, VueNode } from '../_util/type';
export interface Route { export interface Route {
path: string; path: string;
breadcrumbName: string; breadcrumbName: string;
@ -57,7 +58,11 @@ export default defineComponent({
name: 'ABreadcrumb', name: 'ABreadcrumb',
inheritAttrs: false, inheritAttrs: false,
props: breadcrumbProps(), props: breadcrumbProps(),
slots: ['separator', 'itemRender'], slots: Object as CustomSlotsType<{
separator: any;
itemRender: { route: Route; params: any; routes: Route[]; paths: string[] };
default: any;
}>,
setup(props, { slots, attrs }) { setup(props, { slots, attrs }) {
const { prefixCls, direction } = useConfigInject('breadcrumb', props); const { prefixCls, direction } = useConfigInject('breadcrumb', props);
const [wrapSSR, hashId] = useStyle(prefixCls); const [wrapSSR, hashId] = useStyle(prefixCls);

View File

@ -8,6 +8,7 @@ import DownOutlined from '@ant-design/icons-vue/DownOutlined';
import useConfigInject from '../config-provider/hooks/useConfigInject'; import useConfigInject from '../config-provider/hooks/useConfigInject';
import type { MouseEventHandler } from '../_util/EventInterface'; import type { MouseEventHandler } from '../_util/EventInterface';
import { eventType, objectType } from '../_util/type'; import { eventType, objectType } from '../_util/type';
import type { CustomSlotsType } from '../_util/type';
export const breadcrumbItemProps = () => ({ export const breadcrumbItemProps = () => ({
prefixCls: String, prefixCls: String,
@ -26,7 +27,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, emit }) { setup(props, { slots, attrs, emit }) {
const { prefixCls } = useConfigInject('breadcrumb', props); const { prefixCls } = useConfigInject('breadcrumb', props);
/** /**

View File

@ -20,6 +20,7 @@ import type { ButtonType } from './buttonTypes';
import type { VNode } from 'vue'; import type { VNode } from 'vue';
import { GroupSizeContext } from './button-group'; import { GroupSizeContext } from './button-group';
import { useCompactItemContext } from '../space/Compact'; import { useCompactItemContext } from '../space/Compact';
import type { CustomSlotsType } from '../_util/type';
type Loading = boolean | number; type Loading = boolean | number;
@ -36,7 +37,10 @@ export default defineComponent({
inheritAttrs: false, inheritAttrs: false,
__ANT_BUTTON: true, __ANT_BUTTON: true,
props: initDefaultProps(buttonProps(), { type: 'default' }), props: initDefaultProps(buttonProps(), { type: 'default' }),
slots: ['icon'], slots: Object as CustomSlotsType<{
icon: any;
default: any;
}>,
// emits: ['click', 'mousedown'], // emits: ['click', 'mousedown'],
setup(props, { slots, attrs, emit, expose }) { setup(props, { slots, attrs, emit, expose }) {
const { prefixCls, autoInsertSpaceInButton, direction, size } = useConfigInject('btn', props); const { prefixCls, autoInsertSpaceInButton, direction, size } = useConfigInject('btn', props);

View File

@ -37,7 +37,7 @@ Customize Calendar header content.
:value="String(current.year())" :value="String(current.year())"
@change=" @change="
newYear => { newYear => {
onChange(current.year(newYear)); onChange(current.year(+newYear));
} }
" "
> >

View File

@ -10,8 +10,8 @@ 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, PropType } from 'vue';
import { computed, defineComponent, toRef } from 'vue'; import { computed, defineComponent, toRef } from 'vue';
import useConfigInject from '../config-provider/hooks/useConfigInject'; import useConfigInject from '../config-provider/hooks/useConfigInject';
import classNames from '../_util/classNames'; import classNames from '../_util/classNames';
@ -88,36 +88,56 @@ function generateCalendar<
); );
} }
const Calendar = defineComponent<Props>({ const Calendar = defineComponent({
name: 'ACalendar', name: 'ACalendar',
inheritAttrs: false, inheritAttrs: false,
props: [ props: {
'prefixCls', prefixCls: String,
'locale', locale: { type: Object as PropType<Props['locale']>, default: undefined as Props['locale'] },
'validRange', validRange: { type: Array as PropType<DateType[]>, default: undefined },
'disabledDate', disabledDate: { type: Function as PropType<Props['disabledDate']>, default: undefined },
'dateFullCellRender', dateFullCellRender: {
'dateCellRender', type: Function as PropType<Props['dateFullCellRender']>,
'monthFullCellRender', default: undefined,
'monthCellRender', },
'headerRender', dateCellRender: { type: Function as PropType<Props['dateCellRender']>, default: undefined },
'value', monthFullCellRender: {
'defaultValue', type: Function as PropType<Props['monthFullCellRender']>,
'mode', default: undefined,
'fullscreen', },
'onChange', monthCellRender: { type: Function as PropType<Props['monthCellRender']>, default: undefined },
'onPanelChange', headerRender: { type: Function as PropType<Props['headerRender']>, default: undefined },
'onSelect', value: {
'valueFormat', type: [Object, String] as PropType<Props['value']>,
] as any, default: undefined as Props['value'],
slots: [ },
'dateFullCellRender', defaultValue: {
'dateCellRender', type: [Object, String] as PropType<Props['defaultValue']>,
'monthFullCellRender', default: undefined as Props['defaultValue'],
'monthCellRender', },
'headerRender', mode: { type: String as PropType<Props['mode']>, default: undefined },
], fullscreen: { type: Boolean as PropType<Props['fullscreen']>, default: undefined },
setup(props, { emit, slots, attrs }) { onChange: { type: Function as PropType<Props['onChange']>, default: undefined },
'onUpdate:value': { type: Function as PropType<Props['onUpdate:value']>, default: undefined },
onPanelChange: { type: Function as PropType<Props['onPanelChange']>, default: undefined },
onSelect: { type: Function as PropType<Props['onSelect']>, default: undefined },
valueFormat: { type: String, default: undefined },
},
slots: Object as CustomSlotsType<{
dateFullCellRender?: { current: DateType };
dateCellRender?: { current: DateType };
monthFullCellRender?: { current: DateType };
monthCellRender?: { current: DateType };
headerRender?: {
value: DateType;
type: CalendarMode;
onChange: (date: DateType) => void;
onTypeChange: (type: CalendarMode) => void;
};
default: any;
}>,
setup(p, { emit, slots, attrs }) {
const props = p as unknown as Props;
const { prefixCls, direction } = useConfigInject('picker', props); const { prefixCls, direction } = useConfigInject('picker', props);
// style // style

View File

@ -9,6 +9,7 @@ import useConfigInject from '../config-provider/hooks/useConfigInject';
import devWarning from '../vc-util/devWarning'; import devWarning from '../vc-util/devWarning';
import useStyle from './style'; import useStyle from './style';
import Skeleton from '../skeleton'; import Skeleton from '../skeleton';
import type { CustomSlotsType } from '../_util/type';
export interface CardTabListType { export interface CardTabListType {
key: string; key: string;
tab: any; tab: any;
@ -53,7 +54,15 @@ const Card = defineComponent({
name: 'ACard', name: 'ACard',
inheritAttrs: false, inheritAttrs: false,
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, attrs }) { setup(props, { slots, attrs }) {
const { prefixCls, direction, size } = useConfigInject('card', props); const { prefixCls, direction, size } = useConfigInject('card', props);
const [wrapSSR, hashId] = useStyle(prefixCls); const [wrapSSR, hashId] = useStyle(prefixCls);

View File

@ -3,6 +3,7 @@ import { defineComponent } from 'vue';
import { getPropsSlot } from '../_util/props-util'; import { getPropsSlot } from '../_util/props-util';
import useConfigInject from '../config-provider/hooks/useConfigInject'; import useConfigInject from '../config-provider/hooks/useConfigInject';
import { vNodeType } from '../_util/type'; import { vNodeType } from '../_util/type';
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 () => {

View File

@ -16,6 +16,7 @@ import classNames from '../_util/classNames';
import useConfigInject from '../config-provider/hooks/useConfigInject'; import useConfigInject from '../config-provider/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';
// CSSINJS // CSSINJS
import useStyle from './style'; import useStyle from './style';
@ -44,8 +45,10 @@ export default defineComponent({
openAnimation: collapseMotion('ant-motion-collapse', false), openAnimation: collapseMotion('ant-motion-collapse', false),
expandIconPosition: 'start', expandIconPosition: 'start',
}), }),
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])),

View File

@ -7,7 +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 '../config-provider/hooks/useConfigInject'; import useConfigInject from '../config-provider/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>>>;
export default defineComponent({ export default defineComponent({
@ -21,7 +21,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(

View File

@ -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 '../config-provider/hooks/useConfigInject'; import useConfigInject from '../config-provider/hooks/useConfigInject';
@ -30,7 +30,14 @@ const Comment = defineComponent({
name: 'AComment', name: 'AComment',
inheritAttrs: false, inheritAttrs: false,
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, attrs }) { setup(props, { slots, attrs }) {
const { prefixCls, direction } = useConfigInject('comment', props); const { prefixCls, direction } = useConfigInject('comment', props);
@ -50,7 +57,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?.();

View File

@ -23,6 +23,7 @@ import { getMergedStatus, getStatusClassNames } from '../../_util/statusUtils';
import useStyle from '../style'; import useStyle from '../style';
import { useCompactItemContext } from '../../space/Compact'; import { useCompactItemContext } from '../../space/Compact';
import devWarning from '../../vc-util/devWarning'; import devWarning from '../../vc-util/devWarning';
import type { CustomSlotsType } from '../../_util/type';
export default function generateRangePicker<DateType, ExtraProps = {}>( export default function generateRangePicker<DateType, ExtraProps = {}>(
generateConfig: GenerateConfig<DateType>, generateConfig: GenerateConfig<DateType>,
@ -37,18 +38,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();

View File

@ -18,7 +18,7 @@ import devWarning from '../../vc-util/devWarning';
import { FormItemInputContext, useInjectFormItemContext } from '../../form/FormItemContext'; import { FormItemInputContext, useInjectFormItemContext } from '../../form/FormItemContext';
import { getMergedStatus, getStatusClassNames } from '../../_util/statusUtils'; import { getMergedStatus, getStatusClassNames } from '../../_util/statusUtils';
import { useCompactItemContext } from '../../space/Compact'; import { useCompactItemContext } from '../../space/Compact';
import type { CustomSlotsType } from '../../_util/type';
//CSSINJS //CSSINJS
import useStyle from '../style'; import useStyle from '../style';
@ -37,18 +37,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> &
@ -178,7 +179,7 @@ export default function generateSinglePicker<DateType, ExtraProps = {}>(
id = formItemContext.id.value, id = formItemContext.id.value,
...restProps ...restProps
} = p; } = p;
const showTime = (p as any).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 = {};

View File

@ -26,7 +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 '../config-provider/hooks/useConfigInject'; import useConfigInject from '../config-provider/hooks/useConfigInject';
import type { CustomSlotsType } from '../_util/type';
import useStyle from './style'; import useStyle from './style';
export const DescriptionsItemProps = { export const DescriptionsItemProps = {
@ -51,7 +51,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?.();
}, },
@ -164,7 +163,11 @@ const Descriptions = defineComponent({
name: 'ADescriptions', name: 'ADescriptions',
inheritAttrs: false, inheritAttrs: false,
props: descriptionsProps(), props: descriptionsProps(),
slots: ['title', 'extra'], slots: Object as CustomSlotsType<{
title?: any;
extra?: any;
default?: any;
}>,
Item: DescriptionsItem, Item: DescriptionsItem,
setup(props, { slots, attrs }) { setup(props, { slots, attrs }) {
const { prefixCls, direction } = useConfigInject('descriptions', props); const { prefixCls, direction } = useConfigInject('descriptions', props);

View File

@ -17,6 +17,7 @@ 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 '../config-provider/hooks/useConfigInject'; import useConfigInject from '../config-provider/hooks/useConfigInject';
import { objectType, withInstall } from '../_util/type'; import { objectType, withInstall } from '../_util/type';
import type { CustomSlotsType } 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'; import type { KeyboardEventHandler, MouseEventHandler } from '../_util/EventInterface';
@ -114,7 +115,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 = shallowRef(false); const sPush = shallowRef(false);

View File

@ -6,8 +6,11 @@ import classNames from '../_util/classNames';
import { initDefaultProps } from '../_util/props-util'; 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 '../config-provider/hooks/useConfigInject'; import useConfigInject from '../config-provider/hooks/useConfigInject';
import useStyle from './style'; import useStyle from './style';
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>>>;
@ -22,8 +25,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);

View File

@ -14,6 +14,7 @@ import getPlacements from '../_util/placements';
import warning from '../_util/warning'; import warning from '../_util/warning';
import useStyle from './style'; import useStyle from './style';
import { useProvideOverride } from '../menu/src/OverrideContext'; import { useProvideOverride } from '../menu/src/OverrideContext';
import type { CustomSlotsType } from '../_util/type';
export type DropdownProps = Partial<ExtractPropTypes<ReturnType<typeof dropdownProps>>>; export type DropdownProps = Partial<ExtractPropTypes<ReturnType<typeof dropdownProps>>>;
@ -28,7 +29,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',

View File

@ -32,6 +32,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,
@ -149,7 +150,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}`;

View File

@ -4,7 +4,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';
import { filterEmpty } from '../_util/props-util'; import { filterEmpty } from '../_util/props-util';
@ -25,7 +25,12 @@ export interface FormItemInputProps {
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',

View File

@ -24,6 +24,7 @@ import useStyle from './style';
import { NoCompactStyle, useCompactItemContext } from '../space/Compact'; import { NoCompactStyle, useCompactItemContext } from '../space/Compact';
import { useInjectDisabled } from '../config-provider/DisabledContext'; import { useInjectDisabled } from '../config-provider/DisabledContext';
import type { CustomSlotsType } from '../_util/type';
const baseProps = baseInputNumberProps(); const baseProps = baseInputNumberProps();
export const inputNumberProps = () => ({ export const inputNumberProps = () => ({
...baseProps, ...baseProps,
@ -49,7 +50,15 @@ 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;
upIcon?: any;
downIcon?: any;
}>,
setup(props, { emit, expose, attrs, slots }) { setup(props, { emit, expose, attrs, slots }) {
const formItemContext = useInjectFormItemContext(); const formItemContext = useInjectFormItemContext();
const formItemInputContext = FormItemInputContext.useInject(); const formItemInputContext = FormItemInputContext.useInject();

View File

@ -11,6 +11,7 @@ import type { ChangeEvent, KeyboardEventHandler } from '../../_util/EventInterfa
import KeyCode from '../../_util/KeyCode'; import KeyCode from '../../_util/KeyCode';
import classNames from '../../_util/classNames'; import classNames from '../../_util/classNames';
import { booleanType, stringType, someType, functionType } from '../../_util/type'; import { booleanType, stringType, someType, functionType } from '../../_util/type';
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
@ -83,7 +84,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 = shallowRef<HTMLInputElement>(); const inputRef = shallowRef<HTMLInputElement>();
const focus = shallowRef(false); const focus = shallowRef(false);

View File

@ -2,6 +2,7 @@ import isMobile from '../../vc-util/isMobile';
import { onBeforeUnmount, ref, defineComponent } from 'vue'; import { onBeforeUnmount, ref, defineComponent } from 'vue';
import classNames from '../../_util/classNames'; import classNames from '../../_util/classNames';
import { functionType } from '../../_util/type'; import { functionType } from '../../_util/type';
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: functionType<(up: boolean) => void>(), onStep: functionType<(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();

View File

@ -9,6 +9,7 @@ import ItemMeta from './ItemMeta';
import useConfigInject from '../config-provider/hooks/useConfigInject'; import useConfigInject from '../config-provider/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(),

View File

@ -2,6 +2,7 @@ import type { ExtractPropTypes } from 'vue';
import { defineComponent } from 'vue'; import { defineComponent } from 'vue';
import useConfigInject from '../config-provider/hooks/useConfigInject'; import useConfigInject from '../config-provider/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 () => {

View File

@ -11,7 +11,6 @@ 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 { import {
arrayType, arrayType,
someType, someType,
@ -20,6 +19,7 @@ import {
vNodeType, vNodeType,
functionType, functionType,
} from '../_util/type'; } from '../_util/type';
import type { CustomSlotsType, Key } from '../_util/type';
import ItemMeta from './ItemMeta'; import ItemMeta from './ItemMeta';
import useConfigInject from '../config-provider/hooks/useConfigInject'; import useConfigInject from '../config-provider/hooks/useConfigInject';
import useBreakpoint from '../_util/hooks/useBreakpoint'; import useBreakpoint from '../_util/hooks/useBreakpoint';
@ -90,7 +90,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, attrs }) { setup(props, { slots, attrs }) {
provide(ListContextKey, { provide(ListContextKey, {
grid: toRef(props, 'grid'), grid: toRef(props, 'grid'),

View File

@ -17,6 +17,7 @@ import { useProvideOverride } from '../menu/src/OverrideContext';
import warning from '../_util/warning'; import warning from '../_util/warning';
import Spin from '../spin'; import Spin from '../spin';
import devWarning from '../vc-util/devWarning'; import devWarning from '../vc-util/devWarning';
import type { CustomSlotsType } from '../_util/type';
interface MentionsConfig { interface MentionsConfig {
prefix?: string | string[]; prefix?: string | string[];
@ -103,7 +104,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 }) {
// =================== Warning ===================== // =================== Warning =====================
if (process.env.NODE_ENV !== 'production') { if (process.env.NODE_ENV !== 'production') {

View File

@ -6,6 +6,7 @@ import { useInjectMenu } from './hooks/useMenuContext';
import { useMeasure } from './hooks/useKeyPath'; import { useMeasure } from './hooks/useKeyPath';
import type { ItemType } from './interface'; import type { ItemType } from './interface';
import { objectType } from '../../_util/type'; import { objectType } from '../../_util/type';
import type { CustomSlotsType } from '../../_util/type';
export const menuItemGroupProps = () => ({ export const menuItemGroupProps = () => ({
title: PropTypes.any, title: PropTypes.any,
@ -20,7 +21,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`);

View File

@ -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 {
shallowRef, shallowRef,
@ -58,9 +58,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' },
@ -95,7 +95,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 { direction, getPrefixCls } = useConfigInject('menu', props); const { direction, getPrefixCls } = useConfigInject('menu', props);
const override = useInjectOverride(); const override = useInjectOverride();

View File

@ -20,6 +20,7 @@ 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 { objectType } from '../../_util/type'; import { objectType } from '../../_util/type';
import type { CustomSlotsType } from '../../_util/type';
let indexGuid = 0; let indexGuid = 0;
export const menuItemProps = () => ({ export const menuItemProps = () => ({
@ -45,8 +46,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();

View File

@ -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 = shallowRef(false); const innerVisible = shallowRef(false);

View File

@ -27,7 +27,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 '../../_util/type'; import type { Key, CustomSlotsType } from '../../_util/type';
import { objectType } from '../../_util/type'; import { objectType } from '../../_util/type';
import type { ItemType, MenuTheme } from './interface'; import type { ItemType, MenuTheme } from './interface';
@ -59,8 +59,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();

View File

@ -9,8 +9,11 @@ import type { AvatarProps } from '../avatar';
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 { objectType, vNodeType, withInstall } from '../_util/type'; import { objectType, vNodeType, withInstall } from '../_util/type';
import useConfigInject from '../config-provider/hooks/useConfigInject'; import useConfigInject from '../config-provider/hooks/useConfigInject';
import type { CustomSlotsType } from '../_util/type';
import classNames from '../_util/classNames'; import classNames from '../_util/classNames';
import ResizeObserver from '../vc-resize-observer'; import ResizeObserver from '../vc-resize-observer';
import useDestroyed from '../_util/hooks/useDestroyed'; import useDestroyed from '../_util/hooks/useDestroyed';
@ -42,7 +45,17 @@ const PageHeader = defineComponent({
inheritAttrs: false, inheritAttrs: false,
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, attrs }) { setup(props, { emit, slots, attrs }) {
const { prefixCls, direction, pageHeader } = useConfigInject('page-header', props); const { prefixCls, direction, pageHeader } = useConfigInject('page-header', props);

View File

@ -8,8 +8,11 @@ import { convertLegacyProps } from '../button/buttonTypes';
import ExclamationCircleFilled from '@ant-design/icons-vue/ExclamationCircleFilled'; import ExclamationCircleFilled from '@ant-design/icons-vue/ExclamationCircleFilled';
import Button from '../button'; import Button from '../button';
import { useLocaleReceiver } from '../locale-provider/LocaleReceiver'; import { useLocaleReceiver } from '../locale-provider/LocaleReceiver';
import defaultLocale from '../locale/en_US'; import defaultLocale from '../locale/en_US';
import { anyType, objectType, stringType, withInstall } from '../_util/type'; import { anyType, objectType, stringType, withInstall } from '../_util/type';
import type { CustomSlotsType } from '../_util/type';
import useMergedState from '../_util/hooks/useMergedState'; import useMergedState from '../_util/hooks/useMergedState';
import KeyCode from '../_util/KeyCode'; import KeyCode from '../_util/KeyCode';
@ -63,7 +66,18 @@ 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;
description?: any;
okText?: any;
icon?: any;
cancel?: any;
cancelText?: any;
cancelButton?: any;
okButton?: any;
default?: any;
}>,
// emits: ['update:open', 'visibleChange'], // emits: ['update:open', 'visibleChange'],
setup(props: PopconfirmProps, { slots, emit, expose, attrs }) { setup(props: PopconfirmProps, { slots, emit, expose, attrs }) {
const rootRef = ref(); const rootRef = ref();

View File

@ -11,7 +11,7 @@ import { getSize, getSuccessPercent, validProgress } from './utils';
import useConfigInject from '../config-provider/hooks/useConfigInject'; import useConfigInject from '../config-provider/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 { VueNode, CustomSlotsType, VueNode } from '../_util/type';
import useStyle from './style'; import useStyle from './style';
export default defineComponent({ export default defineComponent({
@ -27,7 +27,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, attrs }) { setup(props, { slots, attrs }) {
const { prefixCls, direction } = useConfigInject('progress', props); const { prefixCls, direction } = useConfigInject('progress', props);
const [wrapSSR, hashId] = useStyle(prefixCls); const [wrapSSR, hashId] = useStyle(prefixCls);

View File

@ -10,6 +10,7 @@ import serverError from './serverError';
import unauthorized from './unauthorized'; import unauthorized from './unauthorized';
import useConfigInject from '../config-provider/hooks/useConfigInject'; import useConfigInject from '../config-provider/hooks/useConfigInject';
import classNames from '../_util/classNames'; import classNames from '../_util/classNames';
import type { CustomSlotsType } from '../_util/type';
import useStyle from './style'; import useStyle from './style';
@ -65,7 +66,13 @@ const Result = defineComponent({
name: 'AResult', name: 'AResult',
inheritAttrs: false, inheritAttrs: false,
props: resultProps(), props: resultProps(),
slots: ['title', 'subTitle', 'icon', 'extra'], slots: Object as CustomSlotsType<{
title?: any;
subTitle?: any;
icon?: any;
extra?: any;
default?: any;
}>,
setup(props, { slots, attrs }) { setup(props, { slots, attrs }) {
const { prefixCls, direction } = useConfigInject('result', props); const { prefixCls, direction } = useConfigInject('result', props);

View File

@ -15,6 +15,7 @@ import type { SelectCommonPlacement } from '../_util/transition';
import { getTransitionDirection, getTransitionName } from '../_util/transition'; import { getTransitionDirection, 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 { InputStatus } from '../_util/statusUtils'; import type { InputStatus } from '../_util/statusUtils';
import { getStatusClassNames, getMergedStatus } from '../_util/statusUtils'; import { getStatusClassNames, getMergedStatus } from '../_util/statusUtils';
import { stringType, someType, functionType, booleanType } from '../_util/type'; import { stringType, someType, functionType, booleanType } from '../_util/type';
@ -24,6 +25,8 @@ import useStyle from './style';
import { useInjectDisabled } from '../config-provider/DisabledContext'; import { useInjectDisabled } from '../config-provider/DisabledContext';
import devWarning from '../vc-util/devWarning'; import devWarning from '../vc-util/devWarning';
import type { CustomSlotsType } from '../_util/type';
type RawValue = string | number; type RawValue = string | number;
export type OptionType = typeof Option; export type OptionType = typeof Option;
@ -76,20 +79,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();

View File

@ -3,7 +3,8 @@ 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 { VueNode, CustomSlotsType } from '../_util/type';
import { import {
stringType, stringType,
booleanType, booleanType,
@ -94,7 +95,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 }) {
// Warning for deprecated usage // Warning for deprecated usage
if (process.env.NODE_ENV !== 'production') { if (process.env.NODE_ENV !== 'production') {

View File

@ -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 { booleanType, tuple } from '../_util/type'; import { booleanType, tuple } from '../_util/type';
import useConfigInject from '../config-provider/hooks/useConfigInject'; import useConfigInject from '../config-provider/hooks/useConfigInject';
import useFlexGapSupport from '../_util/hooks/useFlexGapSupport'; import useFlexGapSupport from '../_util/hooks/useFlexGapSupport';
@ -38,7 +39,10 @@ const Space = defineComponent({
name: 'ASpace', name: 'ASpace',
inheritAttrs: false, inheritAttrs: false,
props: spaceProps(), props: spaceProps(),
slots: ['split'], slots: Object as CustomSlotsType<{
split?: any;
default?: any;
}>,
setup(props, { slots, attrs }) { setup(props, { slots, attrs }) {
const { prefixCls, space, direction: directionConfig } = useConfigInject('space', props); const { prefixCls, space, direction: directionConfig } = useConfigInject('space', props);
const [wrapSSR, hashId] = useStyle(prefixCls); const [wrapSSR, hashId] = useStyle(prefixCls);

View File

@ -9,6 +9,7 @@ import useConfigInject from '../config-provider/hooks/useConfigInject';
// CSSINJS // CSSINJS
import useStyle from './style'; import useStyle from './style';
import { anyType, booleanType, functionType, someType, vNodeType } from '../_util/type'; import { anyType, booleanType, functionType, someType, vNodeType } from '../_util/type';
import type { CustomSlotsType } from '../_util/type';
export const statisticProps = () => ({ export const statisticProps = () => ({
prefixCls: String, prefixCls: String,
@ -37,7 +38,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, attrs }) { setup(props, { slots, attrs }) {
const { prefixCls, direction } = useConfigInject('statistic', props); const { prefixCls, direction } = useConfigInject('statistic', props);

View File

@ -2,7 +2,7 @@ import type { App, ExtractPropTypes } from 'vue';
import { computed, defineComponent } from 'vue'; import { computed, defineComponent } from 'vue';
import CloseOutlined from '@ant-design/icons-vue/CloseOutlined'; import CloseOutlined from '@ant-design/icons-vue/CloseOutlined';
import CheckOutlined from '@ant-design/icons-vue/CheckOutlined'; import CheckOutlined from '@ant-design/icons-vue/CheckOutlined';
import type { VueNode } from '../_util/type'; import type { VueNode, CustomSlotsType } from '../_util/type';
import { anyType, booleanType, stringType, functionType, someType, arrayType } from '../_util/type'; import { anyType, booleanType, stringType, functionType, someType, arrayType } from '../_util/type';
import initDefaultProps from '../_util/props-util/initDefaultProps'; import initDefaultProps from '../_util/props-util/initDefaultProps';
import VcSteps, { Step as VcStep } from '../vc-steps'; import VcSteps, { Step as VcStep } from '../vc-steps';
@ -61,7 +61,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);

View File

@ -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 '../config-provider/hooks/useConfigInject'; import useConfigInject from '../config-provider/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();

View File

@ -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;
}, },

View File

@ -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;

View File

@ -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 } from 'vue'; import type { CSSProperties } 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 '../config-provider/hooks/useConfigInject'; import useConfigInject from '../config-provider/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 { import {
stringType, stringType,
booleanType, booleanType,
@ -58,6 +59,7 @@ import {
// CSSINJS // CSSINJS
import useStyle from './style'; import useStyle from './style';
import type { CustomSlotsType } from '../_util/type';
export type { ColumnsType, TablePaginationConfig }; export type { ColumnsType, TablePaginationConfig };
@ -179,35 +181,22 @@ export const tableProps = () => {
>(), >(),
sortDirections: arrayType<SortOrder[]>(), sortDirections: arrayType<SortOrder[]>(),
showSorterTooltip: someType<boolean | TooltipProps>([Boolean, Object], true), showSorterTooltip: someType<boolean | TooltipProps>([Boolean, Object], true),
contextSlots: objectType<ContextSlots>(),
transformCellText: functionType<TableProps['transformCellText']>(), transformCellText: functionType<TableProps['transformCellText']>(),
}; };
}; };
const InteralTable = defineComponent< const InteralTable = defineComponent({
TableProps & {
contextSlots: ContextSlots;
}
>({
name: 'InteralTable', name: 'InteralTable',
inheritAttrs: false, inheritAttrs: false,
props: initDefaultProps(tableProps(), { props: initDefaultProps(
{
...tableProps(),
contextSlots: objectType<ContextSlots>(),
},
{
rowKey: 'key', rowKey: 'key',
}) as any, },
// emits: ['expandedRowsChange', 'change', 'expand'], ),
slots: [
'emptyText',
'expandIcon',
'title',
'footer',
'summary',
'expandedRowRender',
'bodyCell',
'headerCell',
'customFilterIcon',
'customFilterDropdown',
'expandColumnTitle',
],
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),
@ -651,9 +640,34 @@ const InteralTable = defineComponent<
}, },
}); });
const Table = defineComponent<TableProps>({ const Table = defineComponent({
name: 'ATable', name: 'ATable',
inheritAttrs: false, inheritAttrs: false,
props: initDefaultProps(tableProps(), {
rowKey: 'key',
}),
slots: Object as CustomSlotsType<{
emptyText?: any;
expandIcon?: RenderExpandIconProps<any>;
title?: any;
footer?: any;
summary?: any;
expandedRowRender?: any;
bodyCell?: {
text: any;
value: any;
record: Record<string, any>;
index: number;
column: ColumnType;
};
headerCell?: {
title: any;
column: ColumnType;
};
customFilterIcon?: any;
customFilterDropdown?: any;
default: any;
}>,
setup(_props, { attrs, slots, expose }) { setup(_props, { attrs, slots, expose }) {
const table = ref(); const table = ref();
expose({ expose({

View File

@ -67,7 +67,10 @@ const data = [
</script> </script>
<style scoped> <style scoped>
.ant-table-striped :deep(.table-striped) td { [data-doc-theme='light'] .ant-table-striped :deep(.table-striped) td {
background-color: #fafafa; background-color: #fafafa;
} }
[data-doc-theme='dark'] .ant-table-striped :deep(.table-striped) td {
background-color: rgb(29, 29, 29);
}
</style> </style>

View File

@ -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 { functionType } from '../../../_util/type'; import { functionType } 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';
@ -41,7 +41,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);

View File

@ -16,8 +16,8 @@ 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 { objectType, functionType } from '../../../_util/type'; import { objectType, functionType } 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 { shallowRef, onBeforeUnmount, defineComponent, watch, watchEffect, computed } from 'vue'; import { shallowRef, onBeforeUnmount, defineComponent, watch, watchEffect, computed } from 'vue';
import PropTypes from '../../../_util/vue-types'; import PropTypes from '../../../_util/vue-types';
@ -69,7 +69,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();

View File

@ -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(

View File

@ -23,7 +23,6 @@ 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 { import {
arrayType, arrayType,
stringType, stringType,
@ -32,6 +31,7 @@ import {
objectType, objectType,
booleanType, booleanType,
} from '../../_util/type'; } 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';
@ -133,15 +133,16 @@ const InternalTabs = defineComponent({
}), }),
tabs: arrayType<Tab[]>(), tabs: arrayType<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(
@ -351,15 +352,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) => {

View File

@ -6,8 +6,9 @@ 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 { isPresetColor, isPresetStatusColor } from '../_util/colors'; import { isPresetColor, isPresetStatusColor } from '../_util/colors';
import type { LiteralUnion } from '../_util/type';
import { eventType } from '../_util/type'; import { eventType } from '../_util/type';
import type { CustomSlotsType, LiteralUnion } from '../_util/type';
import CheckableTag from './CheckableTag'; import CheckableTag from './CheckableTag';
import useConfigInject from '../config-provider/hooks/useConfigInject'; import useConfigInject from '../config-provider/hooks/useConfigInject';
import warning from '../_util/warning'; import warning from '../_util/warning';
@ -39,7 +40,11 @@ const Tag = defineComponent({
inheritAttrs: false, inheritAttrs: false,
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, { slots, emit, attrs }) { setup(props, { slots, emit, attrs }) {
const { prefixCls, direction } = useConfigInject('tag', props); const { prefixCls, direction } = useConfigInject('tag', props);

View File

@ -14,8 +14,10 @@ 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 { InputStatus } from '../_util/statusUtils'; import type { InputStatus } from '../_util/statusUtils';
import { booleanType, stringType } from '../_util/type'; import { booleanType, stringType } from '../_util/type';
import type { CustomSlotsType } from '../_util/type';
export interface TimePickerLocale { export interface TimePickerLocale {
placeholder?: string; placeholder?: string;
@ -75,7 +77,7 @@ function createTimePicker<
}); });
const { TimePicker: InternalTimePicker, RangePicker: InternalRangePicker } = DatePicker as any; const { TimePicker: InternalTimePicker, RangePicker: InternalRangePicker } = DatePicker as any;
const TimePicker = defineComponent<DTimePickerProps>({ const TimePicker = defineComponent({
name: 'ATimePicker', name: 'ATimePicker',
inheritAttrs: false, inheritAttrs: false,
props: { props: {
@ -83,9 +85,16 @@ function createTimePicker<
...datePickerProps<DateType>(), ...datePickerProps<DateType>(),
...timePickerProps(), ...timePickerProps(),
addon: { type: Function }, addon: { type: Function },
} as any, },
slot: ['addon', 'renderExtraFooter', 'suffixIcon', 'clearIcon'], slots: Object as CustomSlotsType<{
setup(props, { slots, expose, emit, attrs }) { addon?: any;
renderExtraFooter?: any;
suffixIcon?: any;
clearIcon?: any;
default: any;
}>,
setup(p, { slots, expose, emit, attrs }) {
const props = p as unknown as DTimePickerProps;
const formItemContext = useInjectFormItemContext(); const formItemContext = useInjectFormItemContext();
devWarning( devWarning(
!(slots.addon || props.addon), !(slots.addon || props.addon),
@ -146,7 +155,7 @@ function createTimePicker<
}, },
}); });
const TimeRangePicker = defineComponent<DTimeRangePickerProps>({ const TimeRangePicker = defineComponent({
name: 'ATimeRangePicker', name: 'ATimeRangePicker',
inheritAttrs: false, inheritAttrs: false,
props: { props: {
@ -154,9 +163,15 @@ function createTimePicker<
...rangePickerProps<DateType>(), ...rangePickerProps<DateType>(),
...timePickerProps(), ...timePickerProps(),
order: { type: Boolean, default: true }, order: { type: Boolean, default: true },
} as any, },
slot: ['renderExtraFooter', 'suffixIcon', 'clearIcon'], slots: Object as CustomSlotsType<{
setup(props, { slots, expose, emit, attrs }) { renderExtraFooter?: any;
suffixIcon?: any;
clearIcon?: any;
default: any;
}>,
setup(p, { slots, expose, emit, attrs }) {
const props = p as unknown as DTimeRangePickerProps;
const pickerRef = ref(); const pickerRef = ref();
const formItemContext = useInjectFormItemContext(); const formItemContext = useInjectFormItemContext();
expose({ expose({

View File

@ -6,11 +6,13 @@ 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 { tuple, booleanType } from '../_util/type'; import { tuple, booleanType } from '../_util/type';
import useConfigInject from '../config-provider/hooks/useConfigInject'; import useConfigInject from '../config-provider/hooks/useConfigInject';
// CSSINJS // CSSINJS
import useStyle from './style'; import useStyle from './style';
import type { CustomSlotsType } from '../_util/type';
export const timelineProps = () => ({ export const timelineProps = () => ({
prefixCls: String, prefixCls: String,
@ -31,7 +33,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, attrs }) { setup(props, { slots, attrs }) {
const { prefixCls, direction } = useConfigInject('timeline', props); const { prefixCls, direction } = useConfigInject('timeline', props);

View File

@ -2,8 +2,10 @@ import type { ExtractPropTypes } from 'vue';
import { computed, defineComponent } from 'vue'; import { computed, 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';
import { tuple, booleanType } from '../_util/type'; import { tuple, booleanType } from '../_util/type';
import useConfigInject from '../config-provider/hooks/useConfigInject'; import useConfigInject from '../config-provider/hooks/useConfigInject';
import type { CustomSlotsType } from '../_util/type';
export const timelineItemProps = () => ({ export const timelineItemProps = () => ({
prefixCls: String, prefixCls: String,
@ -23,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);
const itemClassName = computed(() => ({ const itemClassName = computed(() => ({

View File

@ -18,10 +18,12 @@ import useConfigInject from '../config-provider/hooks/useConfigInject';
import getPlacements from '../_util/placements'; import getPlacements from '../_util/placements';
import firstNotUndefined from '../_util/firstNotUndefined'; import firstNotUndefined from '../_util/firstNotUndefined';
import raf from '../_util/raf'; import raf from '../_util/raf';
import { parseColor } from './util'; import { parseColor } from './util';
export type { AdjustOverflow, PlacementsConfig } from '../_util/placements'; export type { AdjustOverflow, PlacementsConfig } from '../_util/placements';
import useStyle from './style'; import useStyle from './style';
import { getTransitionName } from '../_util/transition'; import { getTransitionName } from '../_util/transition';
import type { CustomSlotsType } from '../_util/type';
// https://github.com/react-component/tooltip // https://github.com/react-component/tooltip
// https://github.com/yiminghe/dom-align // https://github.com/yiminghe/dom-align
@ -79,7 +81,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 }) {
if (process.env.NODE_ENV !== 'production') { if (process.env.NODE_ENV !== 'production') {

View File

@ -6,8 +6,9 @@ import classNames from '../_util/classNames';
import List from './list'; 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/en_US'; import defaultLocale from '../locale/en_US';
import type { VueNode } from '../_util/type'; import type { VueNode, CustomSlotsType } from '../_util/type';
import { import {
withInstall, withInstall,
stringType, stringType,
@ -18,6 +19,7 @@ import {
functionType, functionType,
} from '../_util/type'; } from '../_util/type';
import useConfigInject from '../config-provider/hooks/useConfigInject'; import useConfigInject from '../config-provider/hooks/useConfigInject';
import type { TransferListBodyProps } from './ListBody'; import type { TransferListBodyProps } from './ListBody';
import type { PaginationType } from './interface'; import type { PaginationType } from './interface';
import { FormItemInputContext, useInjectFormItemContext } from '../form/FormItemContext'; import { FormItemInputContext, useInjectFormItemContext } from '../form/FormItemContext';
@ -123,16 +125,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);

View File

@ -13,6 +13,7 @@ import type { RadioChangeEvent } from '../radio/interface';
import type { TransferDirection, TransferItem } from './index'; import type { TransferDirection, TransferItem } from './index';
import { stringType, arrayType, booleanType } from '../_util/type'; import { stringType, arrayType, booleanType } from '../_util/type';
import { groupKeysMap } from '../_util/transKeys'; import { groupKeysMap } from '../_util/transKeys';
import type { CustomSlotsType } from '../_util/type';
const defaultRender = () => null; const defaultRender = () => null;
@ -69,7 +70,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();

View File

@ -24,6 +24,7 @@ import { FormItemInputContext, useInjectFormItemContext } from '../form/FormItem
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 { SelectCommonPlacement } from '../_util/transition'; import type { SelectCommonPlacement } from '../_util/transition';
import { getTransitionDirection } from '../_util/transition'; import { getTransitionDirection } from '../_util/transition';
import type { InputStatus } from '../_util/statusUtils'; import type { InputStatus } from '../_util/statusUtils';
@ -36,6 +37,8 @@ import useStyle from './style';
import { useCompactItemContext } from '../space/Compact'; import { useCompactItemContext } from '../space/Compact';
import { useInjectDisabled } from '../config-provider/DisabledContext'; import { useInjectDisabled } from '../config-provider/DisabledContext';
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) {
return transitionName; return transitionName;
@ -96,15 +99,17 @@ 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;
leafIcon?: 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),

View File

@ -19,6 +19,7 @@ import { calcRangeKeys, convertDirectoryKeysToNodes } from './utils/dictUtil';
import useConfigInject from '../config-provider/hooks/useConfigInject'; import useConfigInject from '../config-provider/hooks/useConfigInject';
import { filterEmpty } from '../_util/props-util'; import { filterEmpty } from '../_util/props-util';
import { someType } from '../_util/type'; import { someType } from '../_util/type';
import type { CustomSlotsType } from '../_util/type';
export type ExpandAction = false | 'click' | 'doubleclick' | 'dblclick'; export type ExpandAction = false | 'click' | 'doubleclick' | 'dblclick';
@ -45,7 +46,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',

View File

@ -19,6 +19,7 @@ import { booleanType, someType, arrayType, functionType, objectType } from '../_
// CSSINJS // CSSINJS
import useStyle from './style'; import useStyle from './style';
import type { CustomSlotsType } from '../_util/type';
export interface AntdTreeNodeAttribute { export interface AntdTreeNodeAttribute {
eventKey: string; eventKey: string;
@ -150,17 +151,15 @@ 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', leafIcon?: any;
// '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),

View File

@ -21,10 +21,10 @@ export const typographyProps = () => ({
// Form Internal use // Form Internal use
component: String, component: String,
}); });
const Typography = defineComponent<InternalTypographyProps>({ const Typography = defineComponent({
name: 'ATypography', name: 'ATypography',
inheritAttrs: false, inheritAttrs: false,
props: typographyProps() as any, props: typographyProps(),
setup(props, { slots, attrs }) { setup(props, { slots, attrs }) {
const { prefixCls, direction } = useConfigInject('typography', props); const { prefixCls, direction } = useConfigInject('typography', props);
@ -34,20 +34,19 @@ const Typography = defineComponent<InternalTypographyProps>({
return () => { return () => {
const { const {
prefixCls: _prefixCls, prefixCls: _prefixCls,
class: _className,
direction: _direction, direction: _direction,
component: Component = 'article' as any, component: Component = 'article' as any,
...restProps ...restProps
} = { ...props, ...attrs }; } = { ...props, ...attrs };
return wrapSSR( return wrapSSR(
<Component <Component
{...restProps}
class={classNames( class={classNames(
prefixCls.value, prefixCls.value,
{ [`${prefixCls.value}-rtl`]: direction.value === 'rtl' }, { [`${prefixCls.value}-rtl`]: direction.value === 'rtl' },
attrs.class, attrs.class,
hashId.value, hashId.value,
)} )}
{...restProps}
> >
{slots.default?.()} {slots.default?.()}
</Component>, </Component>,

View File

@ -112,7 +112,7 @@ When uploading state change, it returns:
### How to select albums or folders on mobile devices? ### How to select albums or folders on mobile devices?
You can set `:accept="null"` You can set `:capture="null"`
### I want to display download links. ### I want to display download links.

View File

@ -113,7 +113,7 @@ coverDark: https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*l1nlSryXib8AAA
### 手机设备如何选择相册或文件夹? ### 手机设备如何选择相册或文件夹?
你可以设置 `:accept="null"` 你可以设置 `:capture="null"`
### 如何显示下载链接? ### 如何显示下载链接?

View File

@ -24,7 +24,6 @@ const DrawerWrapper = defineComponent({
autofocus: true, autofocus: true,
}), }),
emits: ['handleClick', 'close'], emits: ['handleClick', 'close'],
slots: ['handler'],
setup(props, { emit, slots }) { setup(props, { emit, slots }) {
const dom = ref<HTMLElement>(null); const dom = ref<HTMLElement>(null);

View File

@ -34,7 +34,6 @@ export default defineComponent({
mouseLeaveDelay: PropTypes.number.def(0.1), mouseLeaveDelay: PropTypes.number.def(0.1),
}, },
emits: ['visibleChange', 'overlayClick'], emits: ['visibleChange', 'overlayClick'],
slots: ['overlay'],
setup(props, { slots, emit, expose }) { setup(props, { slots, emit, expose }) {
const triggerVisible = ref(!!props.visible); const triggerVisible = ref(!!props.visible);
watch( watch(

View File

@ -16,7 +16,6 @@ export default defineComponent({
default: () => [], default: () => [],
}, },
}, },
slots: ['notFoundContent', 'option'],
setup(props, { slots }) { setup(props, { slots }) {
const { const {
activeIndex, activeIndex,

View File

@ -56,7 +56,6 @@ export default defineComponent({
direction: String, direction: String,
dropdownClassName: String, dropdownClassName: String,
}, },
slots: ['notFoundContent', 'option'],
setup(props, { slots }) { setup(props, { slots }) {
const getDropdownPrefix = () => { const getDropdownPrefix = () => {
return `${props.prefixCls}-dropdown`; return `${props.prefixCls}-dropdown`;

View File

@ -37,7 +37,6 @@ export default defineComponent({
name: 'Mentions', name: 'Mentions',
inheritAttrs: false, inheritAttrs: false,
props: initDefaultProps(vcMentionsProps, defaultProps), props: initDefaultProps(vcMentionsProps, defaultProps),
slots: ['notFoundContent', 'option'],
emits: ['change', 'select', 'search', 'focus', 'blur', 'pressenter'], emits: ['change', 'select', 'search', 'focus', 'blur', 'pressenter'],
setup(props, { emit, attrs, expose, slots }) { setup(props, { emit, attrs, expose, slots }) {
const measure = ref(null); const measure = ref(null);

View File

@ -196,15 +196,6 @@ function Picker<DateType>() {
'secondStep', 'secondStep',
'hideDisabledOptions', 'hideDisabledOptions',
] as any, ] as any,
// slots: [
// 'suffixIcon',
// 'clearIcon',
// 'prevIcon',
// 'nextIcon',
// 'superPrevIcon',
// 'superNextIcon',
// 'panelRender',
// ],
setup(props, { attrs, expose }) { setup(props, { attrs, expose }) {
const inputRef = ref(null); const inputRef = ref(null);
const presets = computed(() => props.presets); const presets = computed(() => props.presets);

View File

@ -37,7 +37,6 @@ const OptionList = defineComponent({
compatConfig: { MODE: 3 }, compatConfig: { MODE: 3 },
name: 'OptionList', name: 'OptionList',
inheritAttrs: false, inheritAttrs: false,
slots: ['option'],
setup(_, { expose, slots }) { setup(_, { expose, slots }) {
const baseProps = useBaseProps(); const baseProps = useBaseProps();
const props = useSelectProps(); const props = useSelectProps();

View File

@ -43,7 +43,6 @@ export default function createSlider(Component) {
name: 'CreateSlider', name: 'CreateSlider',
mixins: [BaseMixin, Component], mixins: [BaseMixin, Component],
inheritAttrs: false, inheritAttrs: false,
slots: ['mark'],
props: initDefaultProps(propTypes, { props: initDefaultProps(propTypes, {
prefixCls: 'rc-slider', prefixCls: 'rc-slider',
min: 0, min: 0,

View File

@ -45,7 +45,6 @@ export default defineComponent({
name: 'Step', name: 'Step',
inheritAttrs: false, inheritAttrs: false,
props: VcStepProps(), props: VcStepProps(),
slots: ['title', 'subTitle', 'description', 'tailContent', 'stepIcon', 'progressDot'],
setup(props, { slots, emit, attrs }) { setup(props, { slots, emit, attrs }) {
const onItemClick: EventHandler = e => { const onItemClick: EventHandler = e => {
emit('click', e); emit('click', e);

View File

@ -32,7 +32,6 @@ export default defineComponent({
isInline: PropTypes.looseBool, isInline: PropTypes.looseBool,
itemRender: functionType<(item: Record<string, any>, stepItem: VueNode) => VueNode>(), itemRender: functionType<(item: Record<string, any>, stepItem: VueNode) => VueNode>(),
}, },
slots: ['stepIcon', 'progressDot'],
emits: ['change'], emits: ['change'],
setup(props, { slots, emit }) { setup(props, { slots, emit }) {
const onStepClick = (next: number) => { const onStepClick = (next: number) => {

View File

@ -32,7 +32,6 @@ export default defineComponent<BodyProps<any>>({
'rowExpandable', 'rowExpandable',
'childrenColumnName', 'childrenColumnName',
] as any, ] as any,
slots: ['emptyNode'],
setup(props, { slots }) { setup(props, { slots }) {
const resizeContext = useInjectResize(); const resizeContext = useInjectResize();
const tableContext = useInjectTable(); const tableContext = useInjectTable();

View File

@ -103,7 +103,6 @@ export default defineComponent<CellProps>({
'cellType', 'cellType',
'transformCellText', 'transformCellText',
] as any, ] as any,
slots: ['appendNode'],
setup(props, { slots }) { setup(props, { slots }) {
const contextSlots = useInjectSlots(); const contextSlots = useInjectSlots();
const { onHover, startRow, endRow } = useInjectHover(); const { onHover, startRow, endRow } = useInjectHover();

View File

@ -192,7 +192,6 @@ export default defineComponent<TableProps<DefaultRecordType>>({
'onUpdateInternalRefs', 'onUpdateInternalRefs',
'transformCellText', 'transformCellText',
] as any, ] as any,
slots: ['title', 'footer', 'summary', 'emptyText'],
emits: ['expand', 'expandedRowsChange', 'updateInternalRefs', 'update:expandedRowKeys'], emits: ['expand', 'expandedRowsChange', 'updateInternalRefs', 'update:expandedRowKeys'],
setup(props, { attrs, slots, emit }) { setup(props, { attrs, slots, emit }) {
const mergedData = computed(() => props.data || EMPTY_DATA); const mergedData = computed(() => props.data || EMPTY_DATA);

View File

@ -14,7 +14,6 @@ export default defineComponent({
compatConfig: { MODE: 3 }, compatConfig: { MODE: 3 },
name: 'Content', name: 'Content',
props: tooltipContentProps, props: tooltipContentProps,
slots: ['overlay'],
setup(props: TooltipContentProps, { slots }) { setup(props: TooltipContentProps, { slots }) {
return () => ( return () => (
<div <div

View File

@ -37,7 +37,6 @@ export default defineComponent({
onVisibleChange: Function, onVisibleChange: Function,
onPopupAlign: Function, onPopupAlign: Function,
}, },
slots: ['arrowContent', 'overlay'],
setup(props, { slots, attrs, expose }) { setup(props, { slots, attrs, expose }) {
const triggerDOM = shallowRef(); const triggerDOM = shallowRef();

View File

@ -35,7 +35,6 @@ export default defineComponent({
compatConfig: { MODE: 3 }, compatConfig: { MODE: 3 },
name: 'OptionList', name: 'OptionList',
inheritAttrs: false, inheritAttrs: false,
slots: ['notFoundContent', 'menuItemSelectedIcon'],
setup(_, { slots, expose }) { setup(_, { slots, expose }) {
const baseProps = useBaseProps(); const baseProps = useBaseProps();
const legacyContext = useInjectLegacySelectContext(); const legacyContext = useInjectLegacySelectContext();

View File

@ -29,7 +29,6 @@ export default defineComponent({
motionType: String, motionType: String,
// treeNodeRequiredProps: { type: Object as PropType<TreeNodeRequiredProps> }, // treeNodeRequiredProps: { type: Object as PropType<TreeNodeRequiredProps> },
}, },
slots: ['title', 'icon', 'switcherIcon', 'checkable'],
setup(props, { attrs, slots }) { setup(props, { attrs, slots }) {
const visible = shallowRef(true); const visible = shallowRef(true);
const context = useInjectTreeContext(); const context = useInjectTreeContext();

View File

@ -54,7 +54,6 @@ export default defineComponent({
compatConfig: { MODE: 3 }, compatConfig: { MODE: 3 },
name: 'Tree', name: 'Tree',
inheritAttrs: false, inheritAttrs: false,
slots: ['checkable', 'title', 'icon', 'titleRender'],
props: initDefaultProps(treeProps(), { props: initDefaultProps(treeProps(), {
prefixCls: 'vc-tree', prefixCls: 'vc-tree',
showLine: false, showLine: false,

View File

@ -29,7 +29,6 @@ export default defineComponent({
inheritAttrs: false, inheritAttrs: false,
props: treeNodeProps, props: treeNodeProps,
isTreeNode: 1, isTreeNode: 1,
slots: ['title', 'icon', 'switcherIcon'],
setup(props, { attrs, slots, expose }) { setup(props, { attrs, slots, expose }) {
warning( warning(
!('slots' in props.data), !('slots' in props.data),

View File

@ -259,7 +259,6 @@
"vanilla-jsoneditor": "^0.15.1", "vanilla-jsoneditor": "^0.15.1",
"vite": "^3.0.0", "vite": "^3.0.0",
"vue": "^3.2.0", "vue": "^3.2.0",
"vue-antd-md-loader": "^1.2.1-beta.1",
"vue-clipboard2": "0.3.3", "vue-clipboard2": "0.3.3",
"vue-drag-resize": "^2.0.3", "vue-drag-resize": "^2.0.3",
"vue-eslint-parser": "^8.0.0", "vue-eslint-parser": "^8.0.0",
@ -268,7 +267,6 @@
"vue-loader": "^17.0.0", "vue-loader": "^17.0.0",
"vue-request": "^1.0.2", "vue-request": "^1.0.2",
"vue-router": "^4.0.0", "vue-router": "^4.0.0",
"vue-server-renderer": "^2.6.11",
"vue-style-loader": "^4.1.2", "vue-style-loader": "^4.1.2",
"vue-tsc": "^1.0.6", "vue-tsc": "^1.0.6",
"vuex": "^4.0.0", "vuex": "^4.0.0",