diff --git a/.eslintrc b/.eslintrc index c094c3d6fd..58295097d8 100644 --- a/.eslintrc +++ b/.eslintrc @@ -30,6 +30,7 @@ "rules": { "@typescript-eslint/no-explicit-any": 0, "@typescript-eslint/ban-types": 0, + "@typescript-eslint/consistent-type-imports": 1, "@typescript-eslint/explicit-module-boundary-types": 0, "@typescript-eslint/no-empty-function": 0, "@typescript-eslint/no-non-null-assertion": 0, diff --git a/components/_util/colors.ts b/components/_util/colors.ts index f6f3287db5..bb3c2ca2c4 100644 --- a/components/_util/colors.ts +++ b/components/_util/colors.ts @@ -1,4 +1,5 @@ -import { ElementOf, tuple } from './type'; +import type { ElementOf } from './type'; +import { tuple } from './type'; export const PresetStatusColorTypes = tuple('success', 'processing', 'error', 'default', 'warning'); diff --git a/components/_util/hooks/useBreakpoint.ts b/components/_util/hooks/useBreakpoint.ts index 61a38867eb..5499ef091a 100644 --- a/components/_util/hooks/useBreakpoint.ts +++ b/components/_util/hooks/useBreakpoint.ts @@ -1,5 +1,7 @@ -import { onMounted, onUnmounted, Ref, ref } from 'vue'; -import ResponsiveObserve, { ScreenMap } from '../../_util/responsiveObserve'; +import type { Ref } from 'vue'; +import { onMounted, onUnmounted, ref } from 'vue'; +import type { ScreenMap } from '../../_util/responsiveObserve'; +import ResponsiveObserve from '../../_util/responsiveObserve'; function useBreakpoint(): Ref { const screens = ref({}); diff --git a/components/_util/hooks/useConfigInject.ts b/components/_util/hooks/useConfigInject.ts index 7099b5b56e..dc19f5fecf 100644 --- a/components/_util/hooks/useConfigInject.ts +++ b/components/_util/hooks/useConfigInject.ts @@ -1,11 +1,8 @@ -import { RequiredMark } from '../../form/Form'; -import { computed, ComputedRef, inject, UnwrapRef, VNodeChild } from 'vue'; -import { - ConfigProviderProps, - defaultConfigProvider, - Direction, - SizeType, -} from '../../config-provider'; +import type { RequiredMark } from '../../form/Form'; +import type { ComputedRef, UnwrapRef, VNodeChild } from 'vue'; +import { computed, inject } from 'vue'; +import type { ConfigProviderProps, Direction, SizeType } from '../../config-provider'; +import { defaultConfigProvider } from '../../config-provider'; export default ( name: string, diff --git a/components/_util/hooks/useMemo.ts b/components/_util/hooks/useMemo.ts index 5c2c547afa..f137badcac 100644 --- a/components/_util/hooks/useMemo.ts +++ b/components/_util/hooks/useMemo.ts @@ -1,4 +1,5 @@ -import { Ref, ref, watch } from 'vue'; +import type { Ref } from 'vue'; +import { ref, watch } from 'vue'; export default function useMemo( getValue: () => T, diff --git a/components/_util/hooks/usePrefixCls.ts b/components/_util/hooks/usePrefixCls.ts index 5f653be67c..96c62d4b62 100644 --- a/components/_util/hooks/usePrefixCls.ts +++ b/components/_util/hooks/usePrefixCls.ts @@ -1,4 +1,5 @@ -import { computed, ComputedRef, inject } from 'vue'; +import type { ComputedRef } from 'vue'; +import { computed, inject } from 'vue'; import { defaultConfigProvider } from '../../config-provider'; export default (name: string, props: Record): ComputedRef => { diff --git a/components/_util/hooks/useRef.ts b/components/_util/hooks/useRef.ts index 22f3a9059d..5033e9ea4e 100644 --- a/components/_util/hooks/useRef.ts +++ b/components/_util/hooks/useRef.ts @@ -1,4 +1,5 @@ -import { onBeforeUpdate, ref, Ref } from 'vue'; +import type { Ref } from 'vue'; +import { onBeforeUpdate, ref } from 'vue'; export type UseRef = [(el: any, key: string | number) => void, Ref]; diff --git a/components/_util/hooks/useSize.ts b/components/_util/hooks/useSize.ts index 9ae706b63c..62b392e603 100644 --- a/components/_util/hooks/useSize.ts +++ b/components/_util/hooks/useSize.ts @@ -1,5 +1,7 @@ -import { computed, ComputedRef, inject, provide, UnwrapRef } from 'vue'; -import { ConfigProviderProps, defaultConfigProvider, SizeType } from '../../config-provider'; +import type { ComputedRef, UnwrapRef } from 'vue'; +import { computed, inject, provide } from 'vue'; +import type { ConfigProviderProps, SizeType } from '../../config-provider'; +import { defaultConfigProvider } from '../../config-provider'; const sizeProvider = Symbol('SizeProvider'); diff --git a/components/_util/props-util/initDefaultProps.ts b/components/_util/props-util/initDefaultProps.ts index 17ff859397..8c01271ceb 100644 --- a/components/_util/props-util/initDefaultProps.ts +++ b/components/_util/props-util/initDefaultProps.ts @@ -1,5 +1,5 @@ -import { PropType } from 'vue'; -import { VueTypeValidableDef, VueTypeDef } from 'vue-types'; +import type { PropType } from 'vue'; +import type { VueTypeValidableDef, VueTypeDef } from 'vue-types'; const initDefaultProps = ( types: T, diff --git a/components/_util/setStyle.ts b/components/_util/setStyle.ts index 30a16af426..c12e8c85fe 100644 --- a/components/_util/setStyle.ts +++ b/components/_util/setStyle.ts @@ -1,4 +1,4 @@ -import { CSSProperties } from 'vue'; +import type { CSSProperties } from 'vue'; /** * Easy to set element style, return previous style diff --git a/components/_util/transButton.tsx b/components/_util/transButton.tsx index 1a3d2544f7..b0f8900e0b 100644 --- a/components/_util/transButton.tsx +++ b/components/_util/transButton.tsx @@ -1,4 +1,5 @@ -import { defineComponent, CSSProperties, ref, onMounted } from 'vue'; +import type { CSSProperties } from 'vue'; +import { defineComponent, ref, onMounted } from 'vue'; /** * Wrap of sub component which need use as Button capacity (like Icon component). * This helps accessibility reader to tread as a interactive button to operation. diff --git a/components/_util/transition.tsx b/components/_util/transition.tsx index 3fc0478629..f1d1ba3ef3 100644 --- a/components/_util/transition.tsx +++ b/components/_util/transition.tsx @@ -1,12 +1,5 @@ -import { - BaseTransitionProps, - CSSProperties, - defineComponent, - nextTick, - Ref, - Transition as T, - TransitionGroup as TG, -} from 'vue'; +import type { BaseTransitionProps, CSSProperties, Ref } from 'vue'; +import { defineComponent, nextTick, Transition as T, TransitionGroup as TG } from 'vue'; import { findDOMNode } from './props-util'; export const getTransitionProps = (transitionName: string, opt: object = {}) => { diff --git a/components/_util/type.ts b/components/_util/type.ts index 6276cc310e..499cf949c2 100644 --- a/components/_util/type.ts +++ b/components/_util/type.ts @@ -1,4 +1,4 @@ -import { App, PropType, VNodeChild, Plugin } from 'vue'; +import type { App, PropType, VNodeChild, Plugin } from 'vue'; export type Omit = Pick>; // https://stackoverflow.com/questions/46176165/ways-to-get-string-literal-type-of-array-values-without-enum-overhead diff --git a/components/_util/vue-types/index.ts b/components/_util/vue-types/index.ts index 09a0d986a9..33fcb33ed3 100644 --- a/components/_util/vue-types/index.ts +++ b/components/_util/vue-types/index.ts @@ -1,6 +1,7 @@ -import { CSSProperties } from 'vue'; -import { createTypes, VueTypeValidableDef, VueTypesInterface } from 'vue-types'; -import { VueNode } from '../type'; +import type { CSSProperties } from 'vue'; +import type { VueTypeValidableDef, VueTypesInterface } from 'vue-types'; +import { createTypes } from 'vue-types'; +import type { VueNode } from '../type'; const PropTypes = createTypes({ func: undefined, bool: undefined, diff --git a/components/affix/index.tsx b/components/affix/index.tsx index e4975fce6f..82d062476b 100644 --- a/components/affix/index.tsx +++ b/components/affix/index.tsx @@ -1,5 +1,5 @@ +import type { CSSProperties, ExtractPropTypes } from 'vue'; import { - CSSProperties, defineComponent, ref, reactive, @@ -9,7 +9,6 @@ import { computed, onUnmounted, onUpdated, - ExtractPropTypes, } from 'vue'; import PropTypes from '../_util/vue-types'; import classNames from '../_util/classNames'; diff --git a/components/affix/utils.ts b/components/affix/utils.ts index 715453ff3d..20543df10b 100644 --- a/components/affix/utils.ts +++ b/components/affix/utils.ts @@ -1,5 +1,5 @@ import addEventListener from '../vc-util/Dom/addEventListener'; -import { ComponentPublicInstance } from 'vue'; +import type { ComponentPublicInstance } from 'vue'; import supportsPassive from '../_util/supportsPassive'; export type BindElement = HTMLElement | Window | null | undefined; diff --git a/components/alert/index.tsx b/components/alert/index.tsx index b01c7a2810..314947047c 100644 --- a/components/alert/index.tsx +++ b/components/alert/index.tsx @@ -1,4 +1,5 @@ -import { inject, cloneVNode, defineComponent, ref, ExtractPropTypes } from 'vue'; +import type { ExtractPropTypes } from 'vue'; +import { inject, cloneVNode, defineComponent, ref } from 'vue'; import CloseOutlined from '@ant-design/icons-vue/CloseOutlined'; import CheckCircleOutlined from '@ant-design/icons-vue/CheckCircleOutlined'; import ExclamationCircleOutlined from '@ant-design/icons-vue/ExclamationCircleOutlined'; diff --git a/components/anchor/Anchor.tsx b/components/anchor/Anchor.tsx index 2c42f3eac6..4587ff391e 100644 --- a/components/anchor/Anchor.tsx +++ b/components/anchor/Anchor.tsx @@ -1,3 +1,4 @@ +import type { ExtractPropTypes } from 'vue'; import { defineComponent, nextTick, @@ -6,7 +7,6 @@ import { onUpdated, reactive, ref, - ExtractPropTypes, computed, } from 'vue'; import PropTypes from '../_util/vue-types'; diff --git a/components/anchor/AnchorLink.tsx b/components/anchor/AnchorLink.tsx index c43d519a78..c1c6443616 100644 --- a/components/anchor/AnchorLink.tsx +++ b/components/anchor/AnchorLink.tsx @@ -1,11 +1,5 @@ -import { - defineComponent, - ExtractPropTypes, - nextTick, - onBeforeUnmount, - onMounted, - watch, -} from 'vue'; +import type { ExtractPropTypes } from 'vue'; +import { defineComponent, nextTick, onBeforeUnmount, onMounted, watch } from 'vue'; import PropTypes from '../_util/vue-types'; import { getPropsSlot } from '../_util/props-util'; import classNames from '../_util/classNames'; diff --git a/components/anchor/context.ts b/components/anchor/context.ts index 5df5395d12..55e79b3179 100644 --- a/components/anchor/context.ts +++ b/components/anchor/context.ts @@ -1,4 +1,5 @@ -import { computed, Ref, inject, InjectionKey, provide } from 'vue'; +import type { Ref, InjectionKey } from 'vue'; +import { computed, inject, provide } from 'vue'; export interface AnchorContext { registerLink: (link: string) => void; diff --git a/components/anchor/index.tsx b/components/anchor/index.tsx index ec300117c5..2cb6813477 100644 --- a/components/anchor/index.tsx +++ b/components/anchor/index.tsx @@ -1,4 +1,4 @@ -import { App, Plugin } from 'vue'; +import type { App, Plugin } from 'vue'; import Anchor, { AnchorProps } from './Anchor'; import AnchorLink, { AnchorLinkProps } from './AnchorLink'; diff --git a/components/auto-complete/OptGroup.tsx b/components/auto-complete/OptGroup.tsx index fc01cf0a1a..2b44d826da 100644 --- a/components/auto-complete/OptGroup.tsx +++ b/components/auto-complete/OptGroup.tsx @@ -1,5 +1,5 @@ -import { FunctionalComponent } from 'vue'; -import { OptionGroupData } from '../vc-select/interface'; +import type { FunctionalComponent } from 'vue'; +import type { OptionGroupData } from '../vc-select/interface'; export type OptGroupProps = Omit; diff --git a/components/auto-complete/Option.tsx b/components/auto-complete/Option.tsx index d3d725fe5d..fba28e326d 100644 --- a/components/auto-complete/Option.tsx +++ b/components/auto-complete/Option.tsx @@ -1,5 +1,5 @@ -import { FunctionalComponent } from 'vue'; -import { OptionCoreData } from '../vc-select/interface'; +import type { FunctionalComponent } from 'vue'; +import type { OptionCoreData } from '../vc-select/interface'; export interface OptionProps extends Omit { /** Save for customize data */ diff --git a/components/auto-complete/index.tsx b/components/auto-complete/index.tsx index 4519e27537..dac4d43dbf 100644 --- a/components/auto-complete/index.tsx +++ b/components/auto-complete/index.tsx @@ -1,4 +1,5 @@ -import { App, defineComponent, inject, provide, Plugin, VNode, ExtractPropTypes } from 'vue'; +import type { App, Plugin, VNode, ExtractPropTypes } from 'vue'; +import { defineComponent, inject, provide } from 'vue'; import Select, { SelectProps } from '../select'; import Input from '../input'; import InputElement from './InputElement'; diff --git a/components/avatar/Avatar.tsx b/components/avatar/Avatar.tsx index 6b77d324a3..e63d0833f2 100644 --- a/components/avatar/Avatar.tsx +++ b/components/avatar/Avatar.tsx @@ -1,19 +1,12 @@ -import { tuple, VueNode } from '../_util/type'; -import { - computed, - CSSProperties, - defineComponent, - ExtractPropTypes, - nextTick, - onMounted, - PropType, - ref, - watch, -} from 'vue'; +import type { VueNode } from '../_util/type'; +import { tuple } from '../_util/type'; +import type { CSSProperties, ExtractPropTypes, PropType } from 'vue'; +import { computed, defineComponent, nextTick, onMounted, ref, watch } from 'vue'; import { getPropsSlot } from '../_util/props-util'; import PropTypes from '../_util/vue-types'; import useBreakpoint from '../_util/hooks/useBreakpoint'; -import { Breakpoint, responsiveArray, ScreenSizeMap } from '../_util/responsiveObserve'; +import type { Breakpoint, ScreenSizeMap } from '../_util/responsiveObserve'; +import { responsiveArray } from '../_util/responsiveObserve'; import useConfigInject from '../_util/hooks/useConfigInject'; import ResizeObserver from '../vc-resize-observer'; import { useInjectSize } from '../_util/hooks/useSize'; diff --git a/components/avatar/Group.tsx b/components/avatar/Group.tsx index 009fcd89a5..b460553b28 100644 --- a/components/avatar/Group.tsx +++ b/components/avatar/Group.tsx @@ -1,7 +1,9 @@ import { cloneElement } from '../_util/vnode'; -import Avatar, { avatarProps, AvatarSize } from './Avatar'; +import type { AvatarSize } from './Avatar'; +import Avatar, { avatarProps } from './Avatar'; import Popover from '../popover'; -import { defineComponent, PropType, ExtractPropTypes, CSSProperties } from 'vue'; +import type { PropType, ExtractPropTypes, CSSProperties } from 'vue'; +import { defineComponent } from 'vue'; import PropTypes from '../_util/vue-types'; import { flattenChildren, getPropsSlot } from '../_util/props-util'; import { tuple } from '../_util/type'; diff --git a/components/avatar/index.ts b/components/avatar/index.ts index 27126fb6e0..3fceeaf26c 100644 --- a/components/avatar/index.ts +++ b/components/avatar/index.ts @@ -1,4 +1,4 @@ -import { App, Plugin } from 'vue'; +import type { App, Plugin } from 'vue'; import Avatar from './Avatar'; import Group from './Group'; diff --git a/components/back-top/index.tsx b/components/back-top/index.tsx index e7621cfacc..856f1cdf51 100644 --- a/components/back-top/index.tsx +++ b/components/back-top/index.tsx @@ -1,13 +1,12 @@ +import type { ExtractPropTypes, PropType } from 'vue'; import { defineComponent, - ExtractPropTypes, inject, nextTick, onActivated, onBeforeUnmount, onMounted, reactive, - PropType, ref, watch, onDeactivated, diff --git a/components/badge/Badge.tsx b/components/badge/Badge.tsx index 988814af44..6745a962df 100644 --- a/components/badge/Badge.tsx +++ b/components/badge/Badge.tsx @@ -4,7 +4,8 @@ import classNames from '../_util/classNames'; import { getPropsSlot, flattenChildren } from '../_util/props-util'; import { cloneElement } from '../_util/vnode'; import { getTransitionProps, Transition } from '../_util/transition'; -import { defineComponent, ExtractPropTypes, CSSProperties, computed, ref, watch } from 'vue'; +import type { ExtractPropTypes, CSSProperties } from 'vue'; +import { defineComponent, computed, ref, watch } from 'vue'; import { tuple } from '../_util/type'; import Ribbon from './Ribbon'; import { isPresetColor } from './utils'; diff --git a/components/badge/Ribbon.tsx b/components/badge/Ribbon.tsx index 4eaaeaacd3..f337043229 100644 --- a/components/badge/Ribbon.tsx +++ b/components/badge/Ribbon.tsx @@ -1,7 +1,9 @@ -import { LiteralUnion, tuple } from '../_util/type'; -import { PresetColorType } from '../_util/colors'; +import type { LiteralUnion } from '../_util/type'; +import { tuple } from '../_util/type'; +import type { PresetColorType } from '../_util/colors'; import { isPresetColor } from './utils'; -import { CSSProperties, defineComponent, PropType, ExtractPropTypes, computed } from 'vue'; +import type { CSSProperties, PropType, ExtractPropTypes } from 'vue'; +import { defineComponent, computed } from 'vue'; import PropTypes from '../_util/vue-types'; import useConfigInject from '../_util/hooks/useConfigInject'; diff --git a/components/badge/ScrollNumber.tsx b/components/badge/ScrollNumber.tsx index bfd95e21b7..b37e5ac4c0 100644 --- a/components/badge/ScrollNumber.tsx +++ b/components/badge/ScrollNumber.tsx @@ -1,13 +1,8 @@ import classNames from '../_util/classNames'; import PropTypes from '../_util/vue-types'; import { cloneElement } from '../_util/vnode'; -import { - defineComponent, - ExtractPropTypes, - CSSProperties, - DefineComponent, - HTMLAttributes, -} from 'vue'; +import type { ExtractPropTypes, CSSProperties, DefineComponent, HTMLAttributes } from 'vue'; +import { defineComponent } from 'vue'; import useConfigInject from '../_util/hooks/useConfigInject'; import SingleNumber from './SingleNumber'; import { filterEmpty } from '../_util/props-util'; diff --git a/components/badge/SingleNumber.tsx b/components/badge/SingleNumber.tsx index 894801487b..fb7500b2e3 100644 --- a/components/badge/SingleNumber.tsx +++ b/components/badge/SingleNumber.tsx @@ -1,4 +1,5 @@ -import { computed, CSSProperties, defineComponent, onUnmounted, reactive, ref, watch } from 'vue'; +import type { CSSProperties } from 'vue'; +import { computed, defineComponent, onUnmounted, reactive, ref, watch } from 'vue'; import classNames from '../_util/classNames'; export interface UnitNumberProps { diff --git a/components/badge/index.ts b/components/badge/index.ts index 44d649fd03..fe8283c36b 100644 --- a/components/badge/index.ts +++ b/components/badge/index.ts @@ -1,4 +1,4 @@ -import { App, Plugin } from 'vue'; +import type { App, Plugin } from 'vue'; import Badge from './Badge'; import Ribbon from './Ribbon'; export type { BadgeProps } from './Badge'; diff --git a/components/breadcrumb/Breadcrumb.tsx b/components/breadcrumb/Breadcrumb.tsx index 3caf72ac5b..839e1f2a93 100644 --- a/components/breadcrumb/Breadcrumb.tsx +++ b/components/breadcrumb/Breadcrumb.tsx @@ -1,10 +1,11 @@ -import { cloneVNode, defineComponent, PropType, ExtractPropTypes } from 'vue'; +import type { PropType, ExtractPropTypes } from 'vue'; +import { cloneVNode, defineComponent } from 'vue'; import PropTypes from '../_util/vue-types'; import { flattenChildren, getPropsSlot } from '../_util/props-util'; import warning from '../_util/warning'; import BreadcrumbItem from './BreadcrumbItem'; import Menu from '../menu'; -import { Omit, VueNode } from '../_util/type'; +import type { Omit, VueNode } from '../_util/type'; import useConfigInject from '../_util/hooks/useConfigInject'; export interface Route { diff --git a/components/breadcrumb/BreadcrumbItem.tsx b/components/breadcrumb/BreadcrumbItem.tsx index a675e57db1..187ac95757 100644 --- a/components/breadcrumb/BreadcrumbItem.tsx +++ b/components/breadcrumb/BreadcrumbItem.tsx @@ -1,4 +1,5 @@ -import { defineComponent, ExtractPropTypes } from 'vue'; +import type { ExtractPropTypes } from 'vue'; +import { defineComponent } from 'vue'; import PropTypes from '../_util/vue-types'; import { getPropsSlot } from '../_util/props-util'; import DropDown from '../dropdown/dropdown'; diff --git a/components/breadcrumb/BreadcrumbSeparator.tsx b/components/breadcrumb/BreadcrumbSeparator.tsx index 88e6f3b9a4..caccfd2bd7 100644 --- a/components/breadcrumb/BreadcrumbSeparator.tsx +++ b/components/breadcrumb/BreadcrumbSeparator.tsx @@ -1,4 +1,5 @@ -import { defineComponent, ExtractPropTypes } from 'vue'; +import type { ExtractPropTypes } from 'vue'; +import { defineComponent } from 'vue'; import PropTypes from '../_util/vue-types'; import { flattenChildren } from '../_util/props-util'; import useConfigInject from '../_util/hooks/useConfigInject'; diff --git a/components/breadcrumb/index.ts b/components/breadcrumb/index.ts index ad4d461a14..6ef68e149e 100644 --- a/components/breadcrumb/index.ts +++ b/components/breadcrumb/index.ts @@ -1,4 +1,4 @@ -import { App, Plugin } from 'vue'; +import type { App, Plugin } from 'vue'; import Breadcrumb from './Breadcrumb'; import BreadcrumbItem from './BreadcrumbItem'; import BreadcrumbSeparator from './BreadcrumbSeparator'; diff --git a/components/button/button.tsx b/components/button/button.tsx index d03a2823e0..7ef5a6d7d1 100644 --- a/components/button/button.tsx +++ b/components/button/button.tsx @@ -1,4 +1,5 @@ -import { defineComponent, ExtractPropTypes, inject, Text, VNode } from 'vue'; +import type { ExtractPropTypes, VNode } from 'vue'; +import { defineComponent, inject, Text } from 'vue'; import Wave from '../_util/wave'; import LoadingOutlined from '@ant-design/icons-vue/LoadingOutlined'; import buttonTypes from './buttonTypes'; diff --git a/components/button/buttonTypes.ts b/components/button/buttonTypes.ts index 6715b5caa8..4764bccb60 100644 --- a/components/button/buttonTypes.ts +++ b/components/button/buttonTypes.ts @@ -1,4 +1,4 @@ -import { ExtractPropTypes } from 'vue'; +import type { ExtractPropTypes } from 'vue'; import { tuple } from '../_util/type'; import PropTypes, { withUndefined } from '../_util/vue-types'; diff --git a/components/button/index.ts b/components/button/index.ts index 026dd6f349..e1f55164e6 100644 --- a/components/button/index.ts +++ b/components/button/index.ts @@ -1,4 +1,4 @@ -import { App, Plugin } from 'vue'; +import type { App, Plugin } from 'vue'; import Button from './button'; import ButtonGroup from './button-group'; export type { ButtonProps } from './button'; diff --git a/components/calendar/Header.tsx b/components/calendar/Header.tsx index 03193b6f1c..5e7cfe7a04 100644 --- a/components/calendar/Header.tsx +++ b/components/calendar/Header.tsx @@ -1,11 +1,12 @@ -import { defineComponent, inject, PropType } from 'vue'; +import type { PropType } from 'vue'; +import { defineComponent, inject } from 'vue'; import Select from '../select'; import { Group, Button } from '../radio'; import PropTypes from '../_util/vue-types'; import { defaultConfigProvider } from '../config-provider'; -import { VueNode } from '../_util/type'; -import moment from 'moment'; -import { RadioChangeEvent } from '../radio/interface'; +import type { VueNode } from '../_util/type'; +import type moment from 'moment'; +import type { RadioChangeEvent } from '../radio/interface'; function getMonthsLocale(value: moment.Moment): string[] { const current = value.clone(); diff --git a/components/calendar/index.tsx b/components/calendar/index.tsx index 13750aaed4..6e7370d800 100644 --- a/components/calendar/index.tsx +++ b/components/calendar/index.tsx @@ -1,4 +1,5 @@ -import { defineComponent, inject, PropType } from 'vue'; +import type { PropType } from 'vue'; +import { defineComponent, inject } from 'vue'; import PropTypes from '../_util/vue-types'; import BaseMixin from '../_util/BaseMixin'; import { getOptionProps, hasProp } from '../_util/props-util'; diff --git a/components/card/Card.tsx b/components/card/Card.tsx index 7287c7f93c..88d1d51593 100644 --- a/components/card/Card.tsx +++ b/components/card/Card.tsx @@ -1,12 +1,5 @@ -import { - inject, - isVNode, - defineComponent, - VNodeTypes, - PropType, - VNode, - ExtractPropTypes, -} from 'vue'; +import type { VNodeTypes, PropType, VNode, ExtractPropTypes } from 'vue'; +import { inject, isVNode, defineComponent } from 'vue'; import { tuple } from '../_util/type'; import Tabs from '../tabs'; import Row from '../row'; diff --git a/components/card/index.ts b/components/card/index.ts index 69efb13ea5..2a2985ee4e 100644 --- a/components/card/index.ts +++ b/components/card/index.ts @@ -1,4 +1,4 @@ -import { App, Plugin } from 'vue'; +import type { App, Plugin } from 'vue'; import Card from './Card'; import Meta from './Meta'; import Grid from './Grid'; diff --git a/components/cascader/index.tsx b/components/cascader/index.tsx index 573d3efa87..782d9d6515 100644 --- a/components/cascader/index.tsx +++ b/components/cascader/index.tsx @@ -1,4 +1,5 @@ -import { inject, provide, PropType, defineComponent, CSSProperties, ExtractPropTypes } from 'vue'; +import type { PropType, CSSProperties, ExtractPropTypes } from 'vue'; +import { inject, provide, defineComponent } from 'vue'; import PropTypes from '../_util/vue-types'; import VcCascader from '../vc-cascader'; import arrayTreeFilter from 'array-tree-filter'; @@ -23,8 +24,9 @@ import BaseMixin from '../_util/BaseMixin'; import { cloneElement } from '../_util/vnode'; import warning from '../_util/warning'; import { defaultConfigProvider } from '../config-provider'; -import { tuple, VueNode, withInstall } from '../_util/type'; -import { RenderEmptyHandler } from '../config-provider/renderEmpty'; +import type { VueNode } from '../_util/type'; +import { tuple, withInstall } from '../_util/type'; +import type { RenderEmptyHandler } from '../config-provider/renderEmpty'; export interface CascaderOptionType { value?: string | number; diff --git a/components/checkbox/Checkbox.tsx b/components/checkbox/Checkbox.tsx index a24daae84d..6adc99b22a 100644 --- a/components/checkbox/Checkbox.tsx +++ b/components/checkbox/Checkbox.tsx @@ -5,7 +5,7 @@ import VcCheckbox from '../vc-checkbox'; import hasProp, { getOptionProps, getSlot } from '../_util/props-util'; import { defaultConfigProvider } from '../config-provider'; import warning from '../_util/warning'; -import { RadioChangeEvent } from '../radio/interface'; +import type { RadioChangeEvent } from '../radio/interface'; function noop() {} export default defineComponent({ diff --git a/components/checkbox/Group.tsx b/components/checkbox/Group.tsx index 042f28f39e..e316475b5b 100644 --- a/components/checkbox/Group.tsx +++ b/components/checkbox/Group.tsx @@ -1,9 +1,10 @@ -import { defineComponent, inject, PropType, provide } from 'vue'; +import type { PropType } from 'vue'; +import { defineComponent, inject, provide } from 'vue'; import PropTypes from '../_util/vue-types'; import Checkbox from './Checkbox'; import hasProp, { getSlot } from '../_util/props-util'; import { defaultConfigProvider } from '../config-provider'; -import { VueNode } from '../_util/type'; +import type { VueNode } from '../_util/type'; export type CheckboxValueType = string | number | boolean; export interface CheckboxOptionType { diff --git a/components/checkbox/index.ts b/components/checkbox/index.ts index ca6e066b94..d28493db35 100644 --- a/components/checkbox/index.ts +++ b/components/checkbox/index.ts @@ -1,4 +1,4 @@ -import { App, Plugin } from 'vue'; +import type { App, Plugin } from 'vue'; import Checkbox from './Checkbox'; import CheckboxGroup from './Group'; diff --git a/components/collapse/Collapse.tsx b/components/collapse/Collapse.tsx index 4fcfab7748..7fd8a8cb4e 100644 --- a/components/collapse/Collapse.tsx +++ b/components/collapse/Collapse.tsx @@ -1,4 +1,5 @@ -import { CSSProperties, defineComponent, ExtractPropTypes, inject, PropType } from 'vue'; +import type { CSSProperties, ExtractPropTypes, PropType } from 'vue'; +import { defineComponent, inject } from 'vue'; import animation from '../_util/openAnimation'; import { getOptionProps, getComponent, isValidElement, getSlot } from '../_util/props-util'; import { cloneElement } from '../_util/vnode'; @@ -6,7 +7,8 @@ import VcCollapse from '../vc-collapse'; import RightOutlined from '@ant-design/icons-vue/RightOutlined'; import { defaultConfigProvider } from '../config-provider'; import PropTypes from '../_util/vue-types'; -import { tuple, VueNode } from '../_util/type'; +import type { VueNode } from '../_util/type'; +import { tuple } from '../_util/type'; export interface PanelProps { isActive?: boolean; diff --git a/components/collapse/CollapsePanel.tsx b/components/collapse/CollapsePanel.tsx index feb4698a66..fd8c3a35ad 100644 --- a/components/collapse/CollapsePanel.tsx +++ b/components/collapse/CollapsePanel.tsx @@ -1,4 +1,5 @@ -import { defineComponent, ExtractPropTypes, inject } from 'vue'; +import type { ExtractPropTypes } from 'vue'; +import { defineComponent, inject } from 'vue'; import { getOptionProps, getComponent, getSlot } from '../_util/props-util'; import VcCollapse from '../vc-collapse'; import { defaultConfigProvider } from '../config-provider'; diff --git a/components/collapse/index.ts b/components/collapse/index.ts index 8244d223d4..489d6d2ddd 100644 --- a/components/collapse/index.ts +++ b/components/collapse/index.ts @@ -1,4 +1,4 @@ -import { App, Plugin } from 'vue'; +import type { App, Plugin } from 'vue'; import Collapse from './Collapse'; import CollapsePanel from './CollapsePanel'; export type { CollapseProps } from './Collapse'; diff --git a/components/comment/index.tsx b/components/comment/index.tsx index c0155558a5..df5a3b70fd 100644 --- a/components/comment/index.tsx +++ b/components/comment/index.tsx @@ -1,7 +1,9 @@ -import { defineComponent, ExtractPropTypes } from 'vue'; +import type { ExtractPropTypes } from 'vue'; +import { defineComponent } from 'vue'; import PropsTypes from '../_util/vue-types'; import { flattenChildren } from '../_util/props-util'; -import { VueNode, withInstall } from '../_util/type'; +import type { VueNode } from '../_util/type'; +import { withInstall } from '../_util/type'; import useConfigInject from '../_util/hooks/useConfigInject'; export const commentProps = { actions: PropsTypes.array, diff --git a/components/config-provider/index.tsx b/components/config-provider/index.tsx index 8fb128efc0..ebeccf6f3f 100644 --- a/components/config-provider/index.tsx +++ b/components/config-provider/index.tsx @@ -1,19 +1,13 @@ -import { - reactive, - provide, - PropType, - defineComponent, - watch, - ExtractPropTypes, - UnwrapRef, -} from 'vue'; +import type { PropType, ExtractPropTypes, UnwrapRef } from 'vue'; +import { reactive, provide, defineComponent, watch } from 'vue'; import PropTypes from '../_util/vue-types'; import defaultRenderEmpty, { RenderEmptyHandler } from './renderEmpty'; -import LocaleProvider, { Locale, ANT_MARK } from '../locale-provider'; -import { TransformCellTextProps } from '../table/interface'; +import type { Locale } from '../locale-provider'; +import LocaleProvider, { ANT_MARK } from '../locale-provider'; +import type { TransformCellTextProps } from '../table/interface'; import LocaleReceiver from '../locale-provider/LocaleReceiver'; import { withInstall } from '../_util/type'; -import { RequiredMark } from '../form/Form'; +import type { RequiredMark } from '../form/Form'; export type SizeType = 'small' | 'middle' | 'large' | undefined; diff --git a/components/config-provider/renderEmpty.tsx b/components/config-provider/renderEmpty.tsx index dc4fa480b1..006a842f7f 100644 --- a/components/config-provider/renderEmpty.tsx +++ b/components/config-provider/renderEmpty.tsx @@ -1,4 +1,5 @@ -import { inject, VNodeChild } from 'vue'; +import type { VNodeChild } from 'vue'; +import { inject } from 'vue'; import Empty from '../empty'; import { defaultConfigProvider } from '.'; diff --git a/components/date-picker/RangePicker.tsx b/components/date-picker/RangePicker.tsx index 49e97dfbe8..e1856d7571 100644 --- a/components/date-picker/RangePicker.tsx +++ b/components/date-picker/RangePicker.tsx @@ -1,4 +1,5 @@ -import { CSSProperties, defineComponent, inject, nextTick } from 'vue'; +import type { CSSProperties } from 'vue'; +import { defineComponent, inject, nextTick } from 'vue'; import moment from 'moment'; import RangeCalendar from '../vc-calendar/src/RangeCalendar'; import VcDatePicker from '../vc-calendar/src/Picker'; diff --git a/components/date-picker/createPicker.tsx b/components/date-picker/createPicker.tsx index 3d317416e4..e14eac559f 100644 --- a/components/date-picker/createPicker.tsx +++ b/components/date-picker/createPicker.tsx @@ -1,4 +1,5 @@ -import { CSSProperties, DefineComponent, defineComponent, inject, nextTick } from 'vue'; +import type { CSSProperties, DefineComponent } from 'vue'; +import { defineComponent, inject, nextTick } from 'vue'; import moment from 'moment'; import omit from 'lodash-es/omit'; import MonthCalendar from '../vc-calendar/src/MonthCalendar'; diff --git a/components/date-picker/index.ts b/components/date-picker/index.ts index 8729031999..22530bec5d 100755 --- a/components/date-picker/index.ts +++ b/components/date-picker/index.ts @@ -1,4 +1,4 @@ -import { App, DefineComponent, Plugin } from 'vue'; +import type { App, DefineComponent, Plugin } from 'vue'; import VcCalendar from '../vc-calendar'; import MonthCalendar from '../vc-calendar/src/MonthCalendar'; import createPicker from './createPicker'; @@ -6,7 +6,7 @@ import wrapPicker from './wrapPicker'; import RangePicker from './RangePicker'; import WeekPicker from './WeekPicker'; import { DatePickerProps, MonthPickerProps, WeekPickerProps, RangePickerProps } from './props'; -import { +import type { DatePickerPropsTypes, RangePickerPropsTypes, MonthPickerPropsTypes, diff --git a/components/date-picker/interface.tsx b/components/date-picker/interface.tsx index 015eae0f24..d0bfc1141b 100644 --- a/components/date-picker/interface.tsx +++ b/components/date-picker/interface.tsx @@ -1,6 +1,7 @@ -import moment from 'moment'; -import { CSSProperties } from 'vue'; -import { tuple, VueNode } from '../_util/type'; +import type moment from 'moment'; +import type { CSSProperties } from 'vue'; +import type { VueNode } from '../_util/type'; +import { tuple } from '../_util/type'; export type RangePickerValue = | undefined[] diff --git a/components/date-picker/props.ts b/components/date-picker/props.ts index 86536cf4f5..f9d0047b66 100644 --- a/components/date-picker/props.ts +++ b/components/date-picker/props.ts @@ -1,5 +1,5 @@ -import { PropType } from 'vue'; -import moment from 'moment'; +import type { PropType } from 'vue'; +import type moment from 'moment'; import PropTypes, { withUndefined } from '../_util/vue-types'; import { tuple } from '../_util/type'; diff --git a/components/date-picker/utils.ts b/components/date-picker/utils.ts index 149c7be425..790b37534f 100644 --- a/components/date-picker/utils.ts +++ b/components/date-picker/utils.ts @@ -1,4 +1,4 @@ -import moment from 'moment'; +import type moment from 'moment'; type Value = moment.Moment | undefined | null; type Format = string | string[] | undefined | ((val?: Value) => string | string[] | undefined); diff --git a/components/date-picker/wrapPicker.tsx b/components/date-picker/wrapPicker.tsx index e57c9d6b24..a09ec82a4d 100644 --- a/components/date-picker/wrapPicker.tsx +++ b/components/date-picker/wrapPicker.tsx @@ -1,4 +1,5 @@ -import { provide, inject, defineComponent, DefineComponent, nextTick } from 'vue'; +import type { DefineComponent } from 'vue'; +import { provide, inject, defineComponent, nextTick } from 'vue'; import TimePickerPanel from '../vc-time-picker/Panel'; import classNames from '../_util/classNames'; import LocaleReceiver from '../locale-provider/LocaleReceiver'; diff --git a/components/descriptions/Cell.tsx b/components/descriptions/Cell.tsx index 5040a8a3eb..6acbc6bc4e 100644 --- a/components/descriptions/Cell.tsx +++ b/components/descriptions/Cell.tsx @@ -1,4 +1,4 @@ -import { VNodeTypes, HTMLAttributes, FunctionalComponent, CSSProperties } from 'vue'; +import type { VNodeTypes, HTMLAttributes, FunctionalComponent, CSSProperties } from 'vue'; function notEmpty(val: any) { return val !== undefined && val !== null; diff --git a/components/descriptions/Row.tsx b/components/descriptions/Row.tsx index c20caaf6c3..556d1d19d5 100644 --- a/components/descriptions/Row.tsx +++ b/components/descriptions/Row.tsx @@ -1,7 +1,9 @@ import Cell from './Cell'; import { getSlot, getClass, getStyle } from '../_util/props-util'; -import { FunctionalComponent, VNode, inject, ref } from 'vue'; -import { descriptionsContext, DescriptionsContextProp } from './index'; +import type { FunctionalComponent, VNode } from 'vue'; +import { inject, ref } from 'vue'; +import type { DescriptionsContextProp } from './index'; +import { descriptionsContext } from './index'; interface CellConfig { component: string | [string, string]; diff --git a/components/descriptions/index.tsx b/components/descriptions/index.tsx index 08e5571550..74fe57ebb2 100644 --- a/components/descriptions/index.tsx +++ b/components/descriptions/index.tsx @@ -1,27 +1,18 @@ -import { - ref, +import type { Ref, App, - defineComponent, PropType, VNode, HTMLAttributes, ExtractPropTypes, - onMounted, - onBeforeUnmount, Plugin, CSSProperties, - provide, - toRef, InjectionKey, - computed, } from 'vue'; +import { ref, defineComponent, onMounted, onBeforeUnmount, provide, toRef, computed } from 'vue'; import warning from '../_util/warning'; -import ResponsiveObserve, { - Breakpoint, - responsiveArray, - ScreenMap, -} from '../_util/responsiveObserve'; +import type { Breakpoint, ScreenMap } from '../_util/responsiveObserve'; +import ResponsiveObserve, { responsiveArray } from '../_util/responsiveObserve'; import Row from './Row'; import PropTypes from '../_util/vue-types'; import { tuple } from '../_util/type'; diff --git a/components/divider/index.tsx b/components/divider/index.tsx index 71ebe2723d..54b4b55883 100644 --- a/components/divider/index.tsx +++ b/components/divider/index.tsx @@ -1,5 +1,6 @@ import { flattenChildren } from '../_util/props-util'; -import { computed, defineComponent, ExtractPropTypes, inject, PropType } from 'vue'; +import type { ExtractPropTypes, PropType } from 'vue'; +import { computed, defineComponent, inject } from 'vue'; import { defaultConfigProvider } from '../config-provider'; import { withInstall } from '../_util/type'; diff --git a/components/drawer/index.tsx b/components/drawer/index.tsx index 06d30a93ff..cd4ababc77 100644 --- a/components/drawer/index.tsx +++ b/components/drawer/index.tsx @@ -1,4 +1,5 @@ -import { inject, provide, nextTick, defineComponent, CSSProperties } from 'vue'; +import type { CSSProperties } from 'vue'; +import { inject, provide, nextTick, defineComponent } from 'vue'; import classnames from '../_util/classNames'; import omit from 'omit.js'; import VcDrawer from '../vc-drawer/src'; diff --git a/components/dropdown/dropdown-button.tsx b/components/dropdown/dropdown-button.tsx index d3eb21762b..6af4a1447a 100644 --- a/components/dropdown/dropdown-button.tsx +++ b/components/dropdown/dropdown-button.tsx @@ -1,4 +1,5 @@ -import { provide, inject, defineComponent, VNode, ExtractPropTypes } from 'vue'; +import type { VNode, ExtractPropTypes } from 'vue'; +import { provide, inject, defineComponent } from 'vue'; import Button from '../button'; import classNames from '../_util/classNames'; import buttonTypes from '../button/buttonTypes'; diff --git a/components/dropdown/dropdown.tsx b/components/dropdown/dropdown.tsx index 4dd9e44335..ffc160b8f3 100644 --- a/components/dropdown/dropdown.tsx +++ b/components/dropdown/dropdown.tsx @@ -1,4 +1,5 @@ -import { provide, inject, cloneVNode, defineComponent, VNode, ExtractPropTypes } from 'vue'; +import type { VNode, ExtractPropTypes } from 'vue'; +import { provide, inject, cloneVNode, defineComponent } from 'vue'; import RcDropdown from '../vc-dropdown/src/index'; import DropdownButton from './dropdown-button'; import PropTypes from '../_util/vue-types'; diff --git a/components/dropdown/getDropdownProps.ts b/components/dropdown/getDropdownProps.ts index 8b0442284b..e846b706f4 100644 --- a/components/dropdown/getDropdownProps.ts +++ b/components/dropdown/getDropdownProps.ts @@ -1,5 +1,5 @@ import { tuple } from '../_util/type'; -import { PropType } from 'vue'; +import type { PropType } from 'vue'; import PropTypes from '../_util/vue-types'; export default () => ({ trigger: { diff --git a/components/dropdown/index.ts b/components/dropdown/index.ts index e8be6c844e..843c9b8fd2 100644 --- a/components/dropdown/index.ts +++ b/components/dropdown/index.ts @@ -1,4 +1,4 @@ -import { App, Plugin } from 'vue'; +import type { App, Plugin } from 'vue'; import Dropdown from './dropdown'; import DropdownButton from './dropdown-button'; diff --git a/components/empty/index.tsx b/components/empty/index.tsx index f53905235d..3c4ff9d982 100644 --- a/components/empty/index.tsx +++ b/components/empty/index.tsx @@ -1,4 +1,5 @@ -import { CSSProperties, VNodeTypes, inject, FunctionalComponent } from 'vue'; +import type { CSSProperties, VNodeTypes, FunctionalComponent } from 'vue'; +import { inject } from 'vue'; import classNames from '../_util/classNames'; import { defaultConfigProvider } from '../config-provider'; import LocaleReceiver from '../locale-provider/LocaleReceiver'; diff --git a/components/form/ErrorList.tsx b/components/form/ErrorList.tsx index c7d26b7545..9b5fa50ac0 100644 --- a/components/form/ErrorList.tsx +++ b/components/form/ErrorList.tsx @@ -1,5 +1,5 @@ import { useInjectFormItemPrefix } from './context'; -import { VueNode } from '../_util/type'; +import type { VueNode } from '../_util/type'; import { defineComponent, onBeforeUnmount, ref, watch } from '@vue/runtime-core'; import classNames from '../_util/classNames'; import Transition, { getTransitionProps } from '../_util/transition'; diff --git a/components/form/Form.tsx b/components/form/Form.tsx index 9ec2f69e5b..0761aeebd0 100755 --- a/components/form/Form.tsx +++ b/components/form/Form.tsx @@ -1,30 +1,26 @@ -import { - defineComponent, - PropType, - computed, - ExtractPropTypes, - HTMLAttributes, - watch, - ref, -} from 'vue'; +import type { PropType, ExtractPropTypes, HTMLAttributes } from 'vue'; +import { defineComponent, computed, watch, ref } from 'vue'; import PropTypes from '../_util/vue-types'; import classNames from '../_util/classNames'; import warning from '../_util/warning'; -import FormItem, { FieldExpose } from './FormItem'; +import type { FieldExpose } from './FormItem'; +import FormItem from './FormItem'; import { getNamePath, containsNamePath } from './utils/valueUtil'; import { defaultValidateMessages } from './utils/messages'; import { allPromiseFinish } from './utils/asyncUtil'; import { toArray } from './utils/typeUtil'; import isEqual from 'lodash-es/isEqual'; -import scrollIntoView, { Options } from 'scroll-into-view-if-needed'; +import type { Options } from 'scroll-into-view-if-needed'; +import scrollIntoView from 'scroll-into-view-if-needed'; import initDefaultProps from '../_util/props-util/initDefaultProps'; -import { tuple, VueNode } from '../_util/type'; -import { ColProps } from '../grid/Col'; -import { InternalNamePath, NamePath, ValidateErrorEntity, ValidateOptions } from './interface'; +import type { VueNode } from '../_util/type'; +import { tuple } from '../_util/type'; +import type { ColProps } from '../grid/Col'; +import type { InternalNamePath, NamePath, ValidateErrorEntity, ValidateOptions } from './interface'; import { useInjectSize } from '../_util/hooks/useSize'; import useConfigInject from '../_util/hooks/useConfigInject'; import { useProvideForm } from './context'; -import { SizeType } from '../config-provider'; +import type { SizeType } from '../config-provider'; export type RequiredMark = boolean | 'optional'; export type FormLayout = 'horizontal' | 'inline' | 'vertical'; diff --git a/components/form/FormItem.tsx b/components/form/FormItem.tsx index 4b526b9e73..1a79cca318 100644 --- a/components/form/FormItem.tsx +++ b/components/form/FormItem.tsx @@ -1,18 +1,9 @@ -import { - PropType, - defineComponent, - computed, - nextTick, - ExtractPropTypes, - ref, - watchEffect, - onBeforeUnmount, - ComputedRef, -} from 'vue'; +import type { PropType, ExtractPropTypes, ComputedRef } from 'vue'; +import { defineComponent, computed, nextTick, ref, watchEffect, onBeforeUnmount } from 'vue'; import cloneDeep from 'lodash-es/cloneDeep'; import PropTypes from '../_util/vue-types'; import Row from '../grid/Row'; -import { ColProps } from '../grid/Col'; +import type { ColProps } from '../grid/Col'; import { isValidElement, flattenChildren, filterEmpty } from '../_util/props-util'; import BaseMixin from '../_util/BaseMixin'; import { cloneElement } from '../_util/vnode'; @@ -22,12 +13,12 @@ import { toArray } from './utils/typeUtil'; import { warning } from '../vc-util/warning'; import find from 'lodash-es/find'; import { tuple } from '../_util/type'; -import { InternalNamePath, RuleObject, ValidateOptions } from './interface'; +import type { InternalNamePath, RuleObject, ValidateOptions } from './interface'; import useConfigInject from '../_util/hooks/useConfigInject'; import { useInjectForm } from './context'; import FormItemLabel from './FormItemLabel'; import FormItemInput from './FormItemInput'; -import { ValidationRule } from './Form'; +import type { ValidationRule } from './Form'; const ValidateStatuses = tuple('success', 'warning', 'error', 'validating', ''); export type ValidateStatus = typeof ValidateStatuses[number]; diff --git a/components/form/FormItemInput.tsx b/components/form/FormItemInput.tsx index 0e0c54d17b..878066cd9c 100644 --- a/components/form/FormItemInput.tsx +++ b/components/form/FormItemInput.tsx @@ -3,13 +3,15 @@ import CloseCircleFilled from '@ant-design/icons-vue/CloseCircleFilled'; import CheckCircleFilled from '@ant-design/icons-vue/CheckCircleFilled'; import ExclamationCircleFilled from '@ant-design/icons-vue/ExclamationCircleFilled'; -import Col, { ColProps } from '../grid/Col'; +import type { ColProps } from '../grid/Col'; +import Col from '../grid/Col'; import { useProvideForm, useInjectForm, useProvideFormItemPrefix } from './context'; import ErrorList from './ErrorList'; import classNames from '../_util/classNames'; -import { ValidateStatus } from './FormItem'; -import { VueNode } from '../_util/type'; -import { computed, defineComponent, HTMLAttributes, onUnmounted } from 'vue'; +import type { ValidateStatus } from './FormItem'; +import type { VueNode } from '../_util/type'; +import type { HTMLAttributes } from 'vue'; +import { computed, defineComponent, onUnmounted } from 'vue'; export interface FormItemInputMiscProps { prefixCls: string; diff --git a/components/form/FormItemLabel.tsx b/components/form/FormItemLabel.tsx index 229bb3429c..8ffe924294 100644 --- a/components/form/FormItemLabel.tsx +++ b/components/form/FormItemLabel.tsx @@ -1,12 +1,13 @@ -import Col, { ColProps } from '../grid/Col'; -import { FormLabelAlign } from './interface'; +import type { ColProps } from '../grid/Col'; +import Col from '../grid/Col'; +import type { FormLabelAlign } from './interface'; import { useInjectForm } from './context'; -import { RequiredMark } from './Form'; +import type { RequiredMark } from './Form'; import { useLocaleReceiver } from '../locale-provider/LocaleReceiver'; import defaultLocale from '../locale/default'; import classNames from '../_util/classNames'; -import { VueNode } from '../_util/type'; -import { FunctionalComponent, HTMLAttributes } from 'vue'; +import type { VueNode } from '../_util/type'; +import type { FunctionalComponent, HTMLAttributes } from 'vue'; export interface FormItemLabelProps { colon?: boolean; diff --git a/components/form/context.ts b/components/form/context.ts index d89fadc24d..8031304166 100644 --- a/components/form/context.ts +++ b/components/form/context.ts @@ -1,8 +1,9 @@ -import { inject, InjectionKey, provide, ComputedRef, computed } from 'vue'; -import { ColProps } from '../grid'; -import { RequiredMark, ValidationRule } from './Form'; -import { ValidateStatus, FieldExpose } from './FormItem'; -import { FormLabelAlign } from './interface'; +import type { InjectionKey, ComputedRef } from 'vue'; +import { inject, provide, computed } from 'vue'; +import type { ColProps } from '../grid'; +import type { RequiredMark, ValidationRule } from './Form'; +import type { ValidateStatus, FieldExpose } from './FormItem'; +import type { FormLabelAlign } from './interface'; export interface FormContextProps { model?: ComputedRef; diff --git a/components/form/index.tsx b/components/form/index.tsx index 2eff7508de..ec5401688b 100644 --- a/components/form/index.tsx +++ b/components/form/index.tsx @@ -1,4 +1,4 @@ -import { App, Plugin } from 'vue'; +import type { App, Plugin } from 'vue'; import Form, { formProps } from './Form'; import FormItem, { formItemProps } from './FormItem'; diff --git a/components/form/interface.ts b/components/form/interface.ts index 27180a9c4b..8c6f41ed81 100644 --- a/components/form/interface.ts +++ b/components/form/interface.ts @@ -1,4 +1,4 @@ -import { VueNode } from '../_util/type'; +import type { VueNode } from '../_util/type'; export type FormLabelAlign = 'left' | 'right'; diff --git a/components/form/utils/asyncUtil.ts b/components/form/utils/asyncUtil.ts index 217de740ed..b766a88349 100644 --- a/components/form/utils/asyncUtil.ts +++ b/components/form/utils/asyncUtil.ts @@ -1,4 +1,4 @@ -import { FieldError } from '../interface'; +import type { FieldError } from '../interface'; export function allPromiseFinish(promiseList: Promise[]): Promise { let hasError = false; let count = promiseList.length; diff --git a/components/form/utils/validateUtil.ts b/components/form/utils/validateUtil.ts index 72cb95d474..c2a9692614 100644 --- a/components/form/utils/validateUtil.ts +++ b/components/form/utils/validateUtil.ts @@ -5,7 +5,7 @@ import { warning } from '../../vc-util/warning'; import { setValues } from './valueUtil'; import { defaultValidateMessages } from './messages'; import { isValidElement } from '../../_util/props-util'; -import { InternalNamePath, RuleObject, ValidateMessages, ValidateOptions } from '../interface'; +import type { InternalNamePath, RuleObject, ValidateMessages, ValidateOptions } from '../interface'; // Remove incorrect original ts define const AsyncValidator: any = RawAsyncValidator; diff --git a/components/form/utils/valueUtil.ts b/components/form/utils/valueUtil.ts index 0a921252d4..61cd19af27 100644 --- a/components/form/utils/valueUtil.ts +++ b/components/form/utils/valueUtil.ts @@ -1,5 +1,5 @@ import { toArray } from './typeUtil'; -import { InternalNamePath, NamePath } from '../interface'; +import type { InternalNamePath, NamePath } from '../interface'; /** * Convert name to internal supported format. diff --git a/components/grid/Col.tsx b/components/grid/Col.tsx index bebe9bb2d6..f819915d49 100644 --- a/components/grid/Col.tsx +++ b/components/grid/Col.tsx @@ -1,4 +1,5 @@ -import { defineComponent, CSSProperties, ExtractPropTypes, computed } from 'vue'; +import type { CSSProperties, ExtractPropTypes } from 'vue'; +import { defineComponent, computed } from 'vue'; import classNames from '../_util/classNames'; import PropTypes from '../_util/vue-types'; import useConfigInject from '../_util/hooks/useConfigInject'; diff --git a/components/grid/Row.tsx b/components/grid/Row.tsx index 3b38b66c10..a9402da28b 100644 --- a/components/grid/Row.tsx +++ b/components/grid/Row.tsx @@ -1,20 +1,10 @@ -import { - defineComponent, - ref, - onMounted, - onBeforeUnmount, - ExtractPropTypes, - computed, - CSSProperties, -} from 'vue'; +import type { ExtractPropTypes, CSSProperties } from 'vue'; +import { defineComponent, ref, onMounted, onBeforeUnmount, computed } from 'vue'; import classNames from '../_util/classNames'; import { tuple } from '../_util/type'; import PropTypes from '../_util/vue-types'; -import ResponsiveObserve, { - Breakpoint, - ScreenMap, - responsiveArray, -} from '../_util/responsiveObserve'; +import type { Breakpoint, ScreenMap } from '../_util/responsiveObserve'; +import ResponsiveObserve, { responsiveArray } from '../_util/responsiveObserve'; import useConfigInject from '../_util/hooks/useConfigInject'; import useFlexGapSupport from '../_util/hooks/useFlexGapSupport'; import useProvideRow from './context'; diff --git a/components/grid/context.ts b/components/grid/context.ts index a50be18570..f1192a9ce0 100644 --- a/components/grid/context.ts +++ b/components/grid/context.ts @@ -1,5 +1,6 @@ import { computed } from 'vue'; -import { Ref, inject, InjectionKey, provide, ComputedRef } from 'vue'; +import type { Ref, InjectionKey, ComputedRef } from 'vue'; +import { inject, provide } from 'vue'; export interface RowContext { gutter: ComputedRef<[number, number]>; diff --git a/components/image/index.tsx b/components/image/index.tsx index b123427c8a..1555bbf173 100644 --- a/components/image/index.tsx +++ b/components/image/index.tsx @@ -1,4 +1,5 @@ -import { App, defineComponent, ExtractPropTypes, ImgHTMLAttributes, Plugin } from 'vue'; +import type { App, ExtractPropTypes, ImgHTMLAttributes, Plugin } from 'vue'; +import { defineComponent } from 'vue'; import ImageInternal from '../vc-image'; import { imageProps } from '../vc-image/src/Image'; import useConfigInject from '../_util/hooks/useConfigInject'; diff --git a/components/index.ts b/components/index.ts index 2bd014a06d..717f667321 100644 --- a/components/index.ts +++ b/components/index.ts @@ -1,4 +1,4 @@ -import { App } from 'vue'; +import type { App } from 'vue'; import * as components from './components'; import { default as version } from './version'; diff --git a/components/input-number/index.tsx b/components/input-number/index.tsx index 99a1d60ac1..f3466b36e5 100644 --- a/components/input-number/index.tsx +++ b/components/input-number/index.tsx @@ -1,4 +1,5 @@ -import { defineComponent, inject, nextTick, onMounted, ref, PropType, ExtractPropTypes } from 'vue'; +import type { PropType, ExtractPropTypes } from 'vue'; +import { defineComponent, inject, nextTick, onMounted, ref } from 'vue'; import PropTypes from '../_util/vue-types'; import { getOptionProps } from '../_util/props-util'; import classNames from '../_util/classNames'; diff --git a/components/input/ClearableLabeledInput.tsx b/components/input/ClearableLabeledInput.tsx index 41f46e0e20..5eb640f8c8 100644 --- a/components/input/ClearableLabeledInput.tsx +++ b/components/input/ClearableLabeledInput.tsx @@ -4,7 +4,8 @@ import { getInputClassName } from './Input'; import PropTypes from '../_util/vue-types'; import { cloneElement } from '../_util/vnode'; import { getComponent } from '../_util/props-util'; -import { defineComponent, VNode } from 'vue'; +import type { VNode } from 'vue'; +import { defineComponent } from 'vue'; import { tuple } from '../_util/type'; export function hasPrefixSuffix(instance: any) { diff --git a/components/input/Input.tsx b/components/input/Input.tsx index 2bf02573e2..df07a8bf18 100644 --- a/components/input/Input.tsx +++ b/components/input/Input.tsx @@ -1,4 +1,5 @@ -import { defineComponent, inject, nextTick, VNode, withDirectives } from 'vue'; +import type { VNode } from 'vue'; +import { defineComponent, inject, nextTick, withDirectives } from 'vue'; import antInputDirective from '../_util/antInputDirective'; import classNames from '../_util/classNames'; import omit from 'omit.js'; diff --git a/components/input/ResizableTextArea.tsx b/components/input/ResizableTextArea.tsx index 6c8ceca56a..2ef07375ba 100644 --- a/components/input/ResizableTextArea.tsx +++ b/components/input/ResizableTextArea.tsx @@ -1,4 +1,5 @@ -import { nextTick, PropType, VNode } from 'vue'; +import type { PropType, VNode } from 'vue'; +import { nextTick } from 'vue'; import ResizeObserver from '../vc-resize-observer'; import omit from 'omit.js'; import classNames from '../_util/classNames'; diff --git a/components/input/index.ts b/components/input/index.ts index 843372da03..f88d13aeb5 100644 --- a/components/input/index.ts +++ b/components/input/index.ts @@ -1,4 +1,4 @@ -import { App, Plugin } from 'vue'; +import type { App, Plugin } from 'vue'; import Input from './Input'; import Group from './Group'; import Search from './Search'; diff --git a/components/input/inputProps.ts b/components/input/inputProps.ts index d678acf311..6d1430ac16 100644 --- a/components/input/inputProps.ts +++ b/components/input/inputProps.ts @@ -1,5 +1,5 @@ import { tuple } from '../_util/type'; -import { PropType } from 'vue'; +import type { PropType } from 'vue'; import PropTypes from '../_util/vue-types'; export default { prefixCls: PropTypes.string, diff --git a/components/layout/Sider.tsx b/components/layout/Sider.tsx index bf67b7a3f1..57e0af49b3 100644 --- a/components/layout/Sider.tsx +++ b/components/layout/Sider.tsx @@ -1,16 +1,6 @@ import classNames from '../_util/classNames'; -import { - inject, - PropType, - defineComponent, - ExtractPropTypes, - ref, - watch, - onMounted, - onBeforeUnmount, - CSSProperties, - provide, -} from 'vue'; +import type { PropType, ExtractPropTypes, CSSProperties } from 'vue'; +import { inject, defineComponent, ref, watch, onMounted, onBeforeUnmount, provide } from 'vue'; import PropTypes from '../_util/vue-types'; import { tuple } from '../_util/type'; import initDefaultProps from '../_util/props-util/initDefaultProps'; diff --git a/components/layout/index.ts b/components/layout/index.ts index 242d47fbed..0beaa33bc6 100644 --- a/components/layout/index.ts +++ b/components/layout/index.ts @@ -1,4 +1,4 @@ -import { App, Plugin } from 'vue'; +import type { App, Plugin } from 'vue'; import Layout from './layout'; import Sider from './Sider'; diff --git a/components/layout/injectionKey.ts b/components/layout/injectionKey.ts index d827c52f70..db4d1aef75 100644 --- a/components/layout/injectionKey.ts +++ b/components/layout/injectionKey.ts @@ -1,4 +1,4 @@ -import { Ref, InjectionKey } from 'vue'; +import type { Ref, InjectionKey } from 'vue'; export type SiderCollapsed = Ref; diff --git a/components/layout/layout.tsx b/components/layout/layout.tsx index 0b37e1c047..3e021c3f95 100644 --- a/components/layout/layout.tsx +++ b/components/layout/layout.tsx @@ -1,4 +1,5 @@ -import { createVNode, defineComponent, provide, ref, ExtractPropTypes, HTMLAttributes } from 'vue'; +import type { ExtractPropTypes, HTMLAttributes } from 'vue'; +import { createVNode, defineComponent, provide, ref } from 'vue'; import PropTypes from '../_util/vue-types'; import classNames from '../_util/classNames'; import useConfigInject from '../_util/hooks/useConfigInject'; diff --git a/components/list/ItemMeta.tsx b/components/list/ItemMeta.tsx index 5c013adb7c..9992aa197d 100644 --- a/components/list/ItemMeta.tsx +++ b/components/list/ItemMeta.tsx @@ -1,4 +1,5 @@ -import { defineComponent, ExtractPropTypes } from 'vue'; +import type { ExtractPropTypes } from 'vue'; +import { defineComponent } from 'vue'; import useConfigInject from '../_util/hooks/useConfigInject'; import PropTypes from '../_util/vue-types'; diff --git a/components/list/index.tsx b/components/list/index.tsx index 89b5b468c6..c31333b920 100644 --- a/components/list/index.tsx +++ b/components/list/index.tsx @@ -1,22 +1,11 @@ -import { - provide, - defineComponent, - App, - Plugin, - ExtractPropTypes, - PropType, - ref, - watch, - computed, - InjectionKey, - toRef, - Ref, -} from 'vue'; +import type { App, Plugin, ExtractPropTypes, PropType, InjectionKey, Ref } from 'vue'; +import { provide, defineComponent, ref, watch, computed, toRef } from 'vue'; import PropTypes, { withUndefined } from '../_util/vue-types'; -import { RenderEmptyHandler } from '../config-provider'; +import type { RenderEmptyHandler } from '../config-provider'; import Spin from '../spin'; -import Pagination, { PaginationConfig, paginationConfig } from '../pagination'; +import type { PaginationConfig } from '../pagination'; +import Pagination, { paginationConfig } from '../pagination'; import { Row } from '../grid'; import Item from './Item'; @@ -26,7 +15,8 @@ import { tuple } from '../_util/type'; import ItemMeta from './ItemMeta'; import useConfigInject from '../_util/hooks/useConfigInject'; import useBreakpoint from '../_util/hooks/useBreakpoint'; -import { Breakpoint, responsiveArray } from '../_util/responsiveObserve'; +import type { Breakpoint } from '../_util/responsiveObserve'; +import { responsiveArray } from '../_util/responsiveObserve'; export { ListItemProps } from './Item'; export { ListItemMetaProps } from './ItemMeta'; diff --git a/components/locale-provider/LocaleReceiver.tsx b/components/locale-provider/LocaleReceiver.tsx index 47b7acbeb2..9b1fa6e1d4 100644 --- a/components/locale-provider/LocaleReceiver.tsx +++ b/components/locale-provider/LocaleReceiver.tsx @@ -1,7 +1,8 @@ -import { inject, defineComponent, VNodeTypes, PropType, computed, ComputedRef } from 'vue'; +import type { VNodeTypes, PropType, ComputedRef } from 'vue'; +import { inject, defineComponent, computed } from 'vue'; import PropTypes from '../_util/vue-types'; import defaultLocaleData from './default'; -import { Locale } from '.'; +import type { Locale } from '.'; export interface LocaleReceiverProps { componentName?: string; diff --git a/components/locale-provider/index.tsx b/components/locale-provider/index.tsx index 9d8c95890b..86b046d9c0 100644 --- a/components/locale-provider/index.tsx +++ b/components/locale-provider/index.tsx @@ -1,11 +1,13 @@ -import { provide, App, defineComponent, VNode, PropType, reactive, watch, onUnmounted } from 'vue'; +import type { App, VNode, PropType } from 'vue'; +import { provide, defineComponent, reactive, watch, onUnmounted } from 'vue'; import PropTypes from '../_util/vue-types'; import moment from 'moment'; import interopDefault from '../_util/interopDefault'; -import { ModalLocale, changeConfirmLocale } from '../modal/locale'; +import type { ModalLocale } from '../modal/locale'; +import { changeConfirmLocale } from '../modal/locale'; import warning from '../_util/warning'; import { withInstall } from '../_util/type'; -import { ValidateMessages } from '../form/interface'; +import type { ValidateMessages } from '../form/interface'; export interface Locale { locale: string; Pagination?: Object; diff --git a/components/mentions/index.tsx b/components/mentions/index.tsx index 714945288c..dfc62c38ef 100644 --- a/components/mentions/index.tsx +++ b/components/mentions/index.tsx @@ -1,13 +1,5 @@ -import { - App, - defineComponent, - inject, - nextTick, - PropType, - VNodeTypes, - Plugin, - ExtractPropTypes, -} from 'vue'; +import type { App, PropType, VNodeTypes, Plugin, ExtractPropTypes } from 'vue'; +import { defineComponent, inject, nextTick } from 'vue'; import classNames from '../_util/classNames'; import omit from 'omit.js'; import PropTypes from '../_util/vue-types'; @@ -17,7 +9,7 @@ import Spin from '../spin'; import BaseMixin from '../_util/BaseMixin'; import { defaultConfigProvider } from '../config-provider'; import { getOptionProps, getComponent, getSlot } from '../_util/props-util'; -import { RenderEmptyHandler } from '../config-provider/renderEmpty'; +import type { RenderEmptyHandler } from '../config-provider/renderEmpty'; const { Option } = VcMentions; diff --git a/components/menu/index.tsx b/components/menu/index.tsx index 6d8275187f..e000c414a7 100644 --- a/components/menu/index.tsx +++ b/components/menu/index.tsx @@ -3,7 +3,7 @@ import MenuItem, { MenuItemProps } from './src/MenuItem'; import SubMenu, { SubMenuProps } from './src/SubMenu'; import ItemGroup, { MenuItemGroupProps } from './src/ItemGroup'; import Divider from './src/Divider'; -import { App, Plugin } from 'vue'; +import type { App, Plugin } from 'vue'; import { MenuTheme } from './src/interface'; /* istanbul ignore next */ Menu.install = function (app: App) { diff --git a/components/menu/src/ItemGroup.tsx b/components/menu/src/ItemGroup.tsx index 7813eaf4f7..2a8ace58b9 100644 --- a/components/menu/src/ItemGroup.tsx +++ b/components/menu/src/ItemGroup.tsx @@ -1,5 +1,6 @@ import { getPropsSlot } from '../../_util/props-util'; -import { computed, defineComponent, ExtractPropTypes } from 'vue'; +import type { ExtractPropTypes } from 'vue'; +import { computed, defineComponent } from 'vue'; import PropTypes from '../../_util/vue-types'; import { useInjectMenu } from './hooks/useMenuContext'; diff --git a/components/menu/src/Menu.tsx b/components/menu/src/Menu.tsx index 6697e48feb..351beae8c7 100644 --- a/components/menu/src/Menu.tsx +++ b/components/menu/src/Menu.tsx @@ -1,25 +1,11 @@ -import { Key } from '../../_util/type'; -import { - computed, - defineComponent, - ExtractPropTypes, - ref, - PropType, - inject, - watchEffect, - watch, - onMounted, - unref, - UnwrapRef, -} from 'vue'; +import type { Key } from '../../_util/type'; +import type { ExtractPropTypes, PropType, UnwrapRef } from 'vue'; +import { computed, defineComponent, ref, inject, watchEffect, watch, onMounted, unref } from 'vue'; import shallowEqual from '../../_util/shallowequal'; -import useProvideMenu, { - MenuContextProvider, - StoreMenuInfo, - useProvideFirstLevel, -} from './hooks/useMenuContext'; +import type { StoreMenuInfo } from './hooks/useMenuContext'; +import useProvideMenu, { MenuContextProvider, useProvideFirstLevel } from './hooks/useMenuContext'; import useConfigInject from '../../_util/hooks/useConfigInject'; -import { +import type { MenuTheme, MenuMode, BuiltinPlacements, @@ -28,7 +14,8 @@ import { SelectInfo, } from './interface'; import devWarning from '../../vc-util/devWarning'; -import { collapseMotion, CSSMotionProps } from '../../_util/transition'; +import type { CSSMotionProps } from '../../_util/transition'; +import { collapseMotion } from '../../_util/transition'; import uniq from 'lodash-es/uniq'; import { SiderCollapsedKey } from '../../layout/injectionKey'; import { flattenChildren } from '../../_util/props-util'; diff --git a/components/menu/src/MenuItem.tsx b/components/menu/src/MenuItem.tsx index a2fba21843..09f07f4aa3 100644 --- a/components/menu/src/MenuItem.tsx +++ b/components/menu/src/MenuItem.tsx @@ -1,19 +1,12 @@ import { flattenChildren, getPropsSlot, isValidElement } from '../../_util/props-util'; import PropTypes from '../../_util/vue-types'; -import { - computed, - defineComponent, - ExtractPropTypes, - getCurrentInstance, - onBeforeUnmount, - ref, - watch, -} from 'vue'; +import type { ExtractPropTypes } from 'vue'; +import { computed, defineComponent, getCurrentInstance, onBeforeUnmount, ref, watch } from 'vue'; import { useInjectKeyPath } from './hooks/useKeyPath'; import { useInjectFirstLevel, useInjectMenu } from './hooks/useMenuContext'; import { cloneElement } from '../../_util/vnode'; import Tooltip from '../../tooltip'; -import { MenuInfo } from './interface'; +import type { MenuInfo } from './interface'; import KeyCode from '../../_util/KeyCode'; import useDirectionStyle from './hooks/useDirectionStyle'; import Overflow from '../../vc-overflow'; diff --git a/components/menu/src/PopupTrigger.tsx b/components/menu/src/PopupTrigger.tsx index 281ee4ebe7..9d2af8cadc 100644 --- a/components/menu/src/PopupTrigger.tsx +++ b/components/menu/src/PopupTrigger.tsx @@ -1,6 +1,7 @@ import Trigger from '../../vc-trigger'; -import { computed, defineComponent, onBeforeUnmount, PropType, ref, watch } from 'vue'; -import { MenuMode } from './interface'; +import type { PropType } from 'vue'; +import { computed, defineComponent, onBeforeUnmount, ref, watch } from 'vue'; +import type { MenuMode } from './interface'; import { useInjectMenu } from './hooks/useMenuContext'; import { placements, placementsRtl } from './placements'; import raf from '../../_util/raf'; diff --git a/components/menu/src/SubMenu.tsx b/components/menu/src/SubMenu.tsx index 725b49d690..283cc30643 100644 --- a/components/menu/src/SubMenu.tsx +++ b/components/menu/src/SubMenu.tsx @@ -1,14 +1,6 @@ import PropTypes from '../../_util/vue-types'; -import { - computed, - defineComponent, - getCurrentInstance, - ref, - watch, - PropType, - onBeforeUnmount, - ExtractPropTypes, -} from 'vue'; +import type { PropType, ExtractPropTypes } from 'vue'; +import { computed, defineComponent, getCurrentInstance, ref, watch, onBeforeUnmount } from 'vue'; import useProvideKeyPath, { useInjectKeyPath } from './hooks/useKeyPath'; import { useInjectMenu, useProvideFirstLevel, MenuContextProvider } from './hooks/useMenuContext'; import { getPropsSlot, isValidElement } from '../../_util/props-util'; diff --git a/components/menu/src/SubMenuList.tsx b/components/menu/src/SubMenuList.tsx index d346fc00fd..c55268f2a8 100644 --- a/components/menu/src/SubMenuList.tsx +++ b/components/menu/src/SubMenuList.tsx @@ -1,5 +1,5 @@ import classNames from '../../_util/classNames'; -import { FunctionalComponent } from 'vue'; +import type { FunctionalComponent } from 'vue'; import { useInjectMenu } from './hooks/useMenuContext'; const InternalSubMenuList: FunctionalComponent = (_props, { slots, attrs }) => { const { prefixCls, mode } = useInjectMenu(); diff --git a/components/menu/src/hooks/useDirectionStyle.ts b/components/menu/src/hooks/useDirectionStyle.ts index 358cb13d99..6a5e109b0c 100644 --- a/components/menu/src/hooks/useDirectionStyle.ts +++ b/components/menu/src/hooks/useDirectionStyle.ts @@ -1,4 +1,5 @@ -import { computed, ComputedRef, CSSProperties } from 'vue'; +import type { ComputedRef, CSSProperties } from 'vue'; +import { computed } from 'vue'; import { useInjectMenu } from './useMenuContext'; export default function useDirectionStyle(level: ComputedRef): ComputedRef { diff --git a/components/menu/src/hooks/useKeyPath.ts b/components/menu/src/hooks/useKeyPath.ts index 45f6230c9c..65c965b5b2 100644 --- a/components/menu/src/hooks/useKeyPath.ts +++ b/components/menu/src/hooks/useKeyPath.ts @@ -1,6 +1,7 @@ -import { Key } from '../../../_util/type'; -import { computed, ComputedRef, inject, InjectionKey, provide } from 'vue'; -import { StoreMenuInfo } from './useMenuContext'; +import type { Key } from '../../../_util/type'; +import type { ComputedRef, InjectionKey } from 'vue'; +import { computed, inject, provide } from 'vue'; +import type { StoreMenuInfo } from './useMenuContext'; const KeyPathContext: InjectionKey<{ parentEventKeys: ComputedRef; diff --git a/components/menu/src/hooks/useMenuContext.ts b/components/menu/src/hooks/useMenuContext.ts index e6b5992d6d..c200c613ed 100644 --- a/components/menu/src/hooks/useMenuContext.ts +++ b/components/menu/src/hooks/useMenuContext.ts @@ -1,22 +1,14 @@ -import { Key } from '../../../_util/type'; -import { - ComputedRef, - CSSProperties, - defineComponent, - inject, - InjectionKey, - provide, - Ref, - UnwrapRef, -} from 'vue'; -import { +import type { Key } from '../../../_util/type'; +import type { ComputedRef, CSSProperties, InjectionKey, Ref, UnwrapRef } from 'vue'; +import { defineComponent, inject, provide } from 'vue'; +import type { BuiltinPlacements, MenuClickEventHandler, MenuMode, MenuTheme, TriggerSubMenuAction, } from '../interface'; -import { CSSMotionProps } from '../../../_util/transition'; +import type { CSSMotionProps } from '../../../_util/transition'; export interface StoreMenuInfo { eventKey: string; diff --git a/components/menu/src/interface.ts b/components/menu/src/interface.ts index a752316f7f..0df2bd0c3d 100644 --- a/components/menu/src/interface.ts +++ b/components/menu/src/interface.ts @@ -1,4 +1,4 @@ -import { Key } from '../../_util/type'; +import type { Key } from '../../_util/type'; export type MenuTheme = 'light' | 'dark'; diff --git a/components/message/index.tsx b/components/message/index.tsx index 122b2b14f1..7bc555a1d5 100644 --- a/components/message/index.tsx +++ b/components/message/index.tsx @@ -1,4 +1,4 @@ -import { CSSProperties, VNodeTypes } from 'vue'; +import type { CSSProperties, VNodeTypes } from 'vue'; import Notification from '../vc-notification'; import LoadingOutlined from '@ant-design/icons-vue/LoadingOutlined'; import ExclamationCircleFilled from '@ant-design/icons-vue/ExclamationCircleFilled'; diff --git a/components/modal/ActionButton.tsx b/components/modal/ActionButton.tsx index fd534805ee..ee3d3714ef 100644 --- a/components/modal/ActionButton.tsx +++ b/components/modal/ActionButton.tsx @@ -1,4 +1,5 @@ -import { defineComponent, ExtractPropTypes } from 'vue'; +import type { ExtractPropTypes } from 'vue'; +import { defineComponent } from 'vue'; import PropTypes from '../_util/vue-types'; import Button from '../button'; import BaseMixin from '../_util/BaseMixin'; diff --git a/components/modal/ConfirmDialog.tsx b/components/modal/ConfirmDialog.tsx index a9e3b86245..21414a15c6 100644 --- a/components/modal/ConfirmDialog.tsx +++ b/components/modal/ConfirmDialog.tsx @@ -1,8 +1,9 @@ import classNames from '../_util/classNames'; -import Dialog, { ModalFuncProps } from './Modal'; +import type { ModalFuncProps } from './Modal'; +import Dialog from './Modal'; import ActionButton from './ActionButton'; import { getConfirmLocale } from './locale'; -import { FunctionalComponent } from 'vue'; +import type { FunctionalComponent } from 'vue'; interface ConfirmDialogProps extends ModalFuncProps { afterClose?: () => void; diff --git a/components/modal/Modal.tsx b/components/modal/Modal.tsx index 13c5a8ce0c..bd5e0e7305 100644 --- a/components/modal/Modal.tsx +++ b/components/modal/Modal.tsx @@ -1,11 +1,5 @@ -import { - defineComponent, - ExtractPropTypes, - inject, - VNodeTypes, - CSSProperties, - PropType, -} from 'vue'; +import type { ExtractPropTypes, VNodeTypes, CSSProperties, PropType } from 'vue'; +import { defineComponent, inject } from 'vue'; import classNames from '../_util/classNames'; import Dialog from '../vc-dialog'; import PropTypes from '../_util/vue-types'; @@ -13,7 +7,8 @@ import addEventListener from '../vc-util/Dom/addEventListener'; import { getConfirmLocale } from './locale'; import CloseOutlined from '@ant-design/icons-vue/CloseOutlined'; import Button from '../button'; -import buttonTypes, { ButtonType, ButtonProps as ButtonPropsType } from '../button/buttonTypes'; +import type { ButtonProps as ButtonPropsType } from '../button/buttonTypes'; +import buttonTypes, { ButtonType } from '../button/buttonTypes'; import LocaleReceiver from '../locale-provider/LocaleReceiver'; import { getComponent, getSlot } from '../_util/props-util'; import initDefaultProps from '../_util/props-util/initDefaultProps'; diff --git a/components/modal/confirm.tsx b/components/modal/confirm.tsx index f7faa7fa9e..61bf991f60 100644 --- a/components/modal/confirm.tsx +++ b/components/modal/confirm.tsx @@ -1,6 +1,7 @@ import { createApp } from 'vue'; import ConfirmDialog from './ConfirmDialog'; -import { destroyFns, ModalFuncProps } from './Modal'; +import type { ModalFuncProps } from './Modal'; +import { destroyFns } from './Modal'; import Omit from 'omit.js'; diff --git a/components/modal/index.tsx b/components/modal/index.tsx index b4cb7c8ade..f2533f17c5 100644 --- a/components/modal/index.tsx +++ b/components/modal/index.tsx @@ -1,5 +1,6 @@ -import { App, Plugin } from 'vue'; -import Modal, { destroyFns, ModalFunc, ModalFuncProps } from './Modal'; +import type { App, Plugin } from 'vue'; +import type { ModalFunc, ModalFuncProps } from './Modal'; +import Modal, { destroyFns } from './Modal'; import modalConfirm from './confirm'; import InfoCircleOutlined from '@ant-design/icons-vue/InfoCircleOutlined'; import CheckCircleOutlined from '@ant-design/icons-vue/CheckCircleOutlined'; diff --git a/components/notification/index.tsx b/components/notification/index.tsx index 2b5a27197f..21b5730522 100644 --- a/components/notification/index.tsx +++ b/components/notification/index.tsx @@ -1,4 +1,4 @@ -import { VNodeTypes, CSSProperties } from 'vue'; +import type { VNodeTypes, CSSProperties } from 'vue'; import Notification from '../vc-notification'; import CheckCircleOutlined from '@ant-design/icons-vue/CheckCircleOutlined'; import InfoCircleOutlined from '@ant-design/icons-vue/InfoCircleOutlined'; diff --git a/components/page-header/index.tsx b/components/page-header/index.tsx index 98ab2f2cc1..51eea605b8 100644 --- a/components/page-header/index.tsx +++ b/components/page-header/index.tsx @@ -1,4 +1,5 @@ -import { defineComponent, ExtractPropTypes, ref, computed } from 'vue'; +import type { ExtractPropTypes } from 'vue'; +import { defineComponent, ref, computed } from 'vue'; import PropTypes from '../_util/vue-types'; import { filterEmpty, flattenChildren, isEmptyContent } from '../_util/props-util'; import ArrowLeftOutlined from '@ant-design/icons-vue/ArrowLeftOutlined'; diff --git a/components/pagination/Pagination.tsx b/components/pagination/Pagination.tsx index df1a2dd6d2..5c5ce32ac5 100644 --- a/components/pagination/Pagination.tsx +++ b/components/pagination/Pagination.tsx @@ -1,4 +1,5 @@ -import { defineComponent, ExtractPropTypes, inject } from 'vue'; +import type { ExtractPropTypes } from 'vue'; +import { defineComponent, inject } from 'vue'; import LeftOutlined from '@ant-design/icons-vue/LeftOutlined'; import RightOutlined from '@ant-design/icons-vue/RightOutlined'; import DoubleLeftOutlined from '@ant-design/icons-vue/DoubleLeftOutlined'; diff --git a/components/progress/circle.tsx b/components/progress/circle.tsx index 025508c014..bbf6867e77 100644 --- a/components/progress/circle.tsx +++ b/components/progress/circle.tsx @@ -1,4 +1,5 @@ -import { defineComponent, ExtractPropTypes } from 'vue'; +import type { ExtractPropTypes } from 'vue'; +import { defineComponent } from 'vue'; import { Circle as VCCircle } from '../vc-progress'; import PropTypes from '../_util/vue-types'; import { validProgress } from './utils'; diff --git a/components/radio/Group.tsx b/components/radio/Group.tsx index d792c3fdb1..2cdced3f0c 100644 --- a/components/radio/Group.tsx +++ b/components/radio/Group.tsx @@ -5,7 +5,7 @@ import Radio from './Radio'; import { getOptionProps, filterEmpty, hasProp, getSlot } from '../_util/props-util'; import { defaultConfigProvider } from '../config-provider'; import { tuple } from '../_util/type'; -import { RadioChangeEvent } from './interface'; +import type { RadioChangeEvent } from './interface'; export default defineComponent({ name: 'ARadioGroup', diff --git a/components/radio/Radio.tsx b/components/radio/Radio.tsx index 6f2f4dc9d4..421b5005c2 100644 --- a/components/radio/Radio.tsx +++ b/components/radio/Radio.tsx @@ -1,10 +1,11 @@ -import { defineComponent, ExtractPropTypes, inject } from 'vue'; +import type { ExtractPropTypes } from 'vue'; +import { defineComponent, inject } from 'vue'; import PropTypes from '../_util/vue-types'; import VcCheckbox from '../vc-checkbox'; import classNames from '../_util/classNames'; import { getOptionProps } from '../_util/props-util'; import { defaultConfigProvider } from '../config-provider'; -import { RadioChangeEvent } from './interface'; +import type { RadioChangeEvent } from './interface'; export const radioProps = { prefixCls: PropTypes.string, diff --git a/components/radio/RadioButton.tsx b/components/radio/RadioButton.tsx index fd5a3f4a56..90e88caa22 100644 --- a/components/radio/RadioButton.tsx +++ b/components/radio/RadioButton.tsx @@ -1,5 +1,6 @@ import { defineComponent, inject } from 'vue'; -import Radio, { radioProps, RadioProps } from './Radio'; +import type { RadioProps } from './Radio'; +import Radio, { radioProps } from './Radio'; import { getOptionProps, getSlot } from '../_util/props-util'; import { defaultConfigProvider } from '../config-provider'; diff --git a/components/radio/index.ts b/components/radio/index.ts index 91e1b84875..d833116c51 100644 --- a/components/radio/index.ts +++ b/components/radio/index.ts @@ -1,4 +1,4 @@ -import { App, Plugin } from 'vue'; +import type { App, Plugin } from 'vue'; import Radio from './Radio'; import Group from './Group'; import Button from './RadioButton'; diff --git a/components/radio/interface.ts b/components/radio/interface.ts index ab98de1efd..a3dc2f0ef3 100644 --- a/components/radio/interface.ts +++ b/components/radio/interface.ts @@ -1,4 +1,4 @@ -import { RadioProps } from './Radio'; +import type { RadioProps } from './Radio'; export interface RadioChangeEventTarget extends RadioProps { checked: boolean; diff --git a/components/rate/Star.tsx b/components/rate/Star.tsx index aa4da1d7cf..4493562540 100644 --- a/components/rate/Star.tsx +++ b/components/rate/Star.tsx @@ -1,4 +1,5 @@ -import { defineComponent, computed, ExtractPropTypes } from 'vue'; +import type { ExtractPropTypes } from 'vue'; +import { defineComponent, computed } from 'vue'; import { getPropsSlot } from '../_util/props-util'; import PropTypes from '../_util/vue-types'; diff --git a/components/rate/index.tsx b/components/rate/index.tsx index f1c52f07d7..5de67d283e 100644 --- a/components/rate/index.tsx +++ b/components/rate/index.tsx @@ -1,4 +1,5 @@ -import { defineComponent, ExtractPropTypes, ref, reactive, VNode, onMounted } from 'vue'; +import type { ExtractPropTypes, VNode } from 'vue'; +import { defineComponent, ref, reactive, onMounted } from 'vue'; import { initDefaultProps, getPropsSlot, findDOMNode } from '../_util/props-util'; import { withInstall } from '../_util/type'; import { getOffsetLeft } from './util'; diff --git a/components/result/index.tsx b/components/result/index.tsx index 56964e76ef..22ef535a5b 100644 --- a/components/result/index.tsx +++ b/components/result/index.tsx @@ -1,4 +1,5 @@ -import { App, defineComponent, VNodeTypes, Plugin, ExtractPropTypes, computed } from 'vue'; +import type { App, VNodeTypes, Plugin, ExtractPropTypes } from 'vue'; +import { defineComponent, computed } from 'vue'; import PropTypes from '../_util/vue-types'; import { tuple } from '../_util/type'; import CheckCircleFilled from '@ant-design/icons-vue/CheckCircleFilled'; diff --git a/components/select/index.tsx b/components/select/index.tsx index f8407b1359..5cce05d0d2 100644 --- a/components/select/index.tsx +++ b/components/select/index.tsx @@ -1,13 +1,15 @@ -import { computed, defineComponent, ref, VNodeChild, App, PropType, Plugin } from 'vue'; +import type { VNodeChild, App, PropType, Plugin } from 'vue'; +import { computed, defineComponent, ref } from 'vue'; import omit from 'omit.js'; import classNames from '../_util/classNames'; -import RcSelect, { Option, OptGroup, SelectProps as RcSelectProps, BaseProps } from '../vc-select'; -import { OptionProps as OptionPropsType } from '../vc-select/Option'; +import type { SelectProps as RcSelectProps } from '../vc-select'; +import RcSelect, { Option, OptGroup, BaseProps } from '../vc-select'; +import type { OptionProps as OptionPropsType } from '../vc-select/Option'; import getIcons from './utils/iconUtil'; import PropTypes from '../_util/vue-types'; import { tuple } from '../_util/type'; import useConfigInject from '../_util/hooks/useConfigInject'; -import { SizeType } from '../config-provider'; +import type { SizeType } from '../config-provider'; type RawValue = string | number; diff --git a/components/skeleton/Avatar.tsx b/components/skeleton/Avatar.tsx index dd96adec01..82c9403550 100644 --- a/components/skeleton/Avatar.tsx +++ b/components/skeleton/Avatar.tsx @@ -4,7 +4,8 @@ import PropTypes from '../_util/vue-types'; import { tuple } from '../_util/type'; import initDefaultProps from '../_util/props-util/initDefaultProps'; import useConfigInject from '../_util/hooks/useConfigInject'; -import Element, { skeletonElementProps, SkeletonElementProps } from './Element'; +import type { SkeletonElementProps } from './Element'; +import Element, { skeletonElementProps } from './Element'; export interface AvatarProps extends Omit { shape?: 'circle' | 'square'; diff --git a/components/skeleton/Button.tsx b/components/skeleton/Button.tsx index fe120eaa89..984a536db5 100644 --- a/components/skeleton/Button.tsx +++ b/components/skeleton/Button.tsx @@ -3,7 +3,8 @@ import classNames from '../_util/classNames'; import PropTypes from '../_util/vue-types'; import { tuple } from '../_util/type'; import useConfigInject from '../_util/hooks/useConfigInject'; -import Element, { skeletonElementProps, SkeletonElementProps } from './Element'; +import type { SkeletonElementProps } from './Element'; +import Element, { skeletonElementProps } from './Element'; export interface SkeletonButtonProps extends Omit { size?: 'large' | 'small' | 'default'; diff --git a/components/skeleton/Element.tsx b/components/skeleton/Element.tsx index 818274660f..efdbc7d5f9 100644 --- a/components/skeleton/Element.tsx +++ b/components/skeleton/Element.tsx @@ -1,4 +1,4 @@ -import { CSSProperties, ExtractPropTypes, FunctionalComponent } from '@vue/runtime-dom'; +import type { CSSProperties, ExtractPropTypes, FunctionalComponent } from '@vue/runtime-dom'; import classNames from '../_util/classNames'; import { tuple } from '../_util/type'; import PropTypes from '../_util/vue-types'; diff --git a/components/skeleton/Image.tsx b/components/skeleton/Image.tsx index d19c747ef6..3b8653d266 100644 --- a/components/skeleton/Image.tsx +++ b/components/skeleton/Image.tsx @@ -1,7 +1,8 @@ import { computed, defineComponent } from 'vue'; import classNames from '../_util/classNames'; import useConfigInject from '../_util/hooks/useConfigInject'; -import { skeletonElementProps, SkeletonElementProps } from './Element'; +import type { SkeletonElementProps } from './Element'; +import { skeletonElementProps } from './Element'; export type SkeletonImageProps = Omit; diff --git a/components/skeleton/Input.tsx b/components/skeleton/Input.tsx index f7a4416e83..ff5bf12843 100644 --- a/components/skeleton/Input.tsx +++ b/components/skeleton/Input.tsx @@ -3,7 +3,8 @@ import classNames from '../_util/classNames'; import PropTypes from '../_util/vue-types'; import { tuple } from '../_util/type'; import useConfigInject from '../_util/hooks/useConfigInject'; -import Element, { skeletonElementProps, SkeletonElementProps } from './Element'; +import type { SkeletonElementProps } from './Element'; +import Element, { skeletonElementProps } from './Element'; import Omit from 'omit.js'; export interface SkeletonInputProps extends Omit { diff --git a/components/skeleton/Paragraph.tsx b/components/skeleton/Paragraph.tsx index 52b614cc94..8df05fc379 100644 --- a/components/skeleton/Paragraph.tsx +++ b/components/skeleton/Paragraph.tsx @@ -1,4 +1,5 @@ -import { defineComponent, ExtractPropTypes } from 'vue'; +import type { ExtractPropTypes } from 'vue'; +import { defineComponent } from 'vue'; import PropTypes from '../_util/vue-types'; const widthUnit = PropTypes.oneOfType([PropTypes.number, PropTypes.string]); diff --git a/components/skeleton/Skeleton.tsx b/components/skeleton/Skeleton.tsx index bb21c6300b..6ffc48b73b 100644 --- a/components/skeleton/Skeleton.tsx +++ b/components/skeleton/Skeleton.tsx @@ -1,10 +1,14 @@ -import { defineComponent, ExtractPropTypes } from 'vue'; +import type { ExtractPropTypes } from 'vue'; +import { defineComponent } from 'vue'; import classNames from '../_util/classNames'; import PropTypes, { withUndefined } from '../_util/vue-types'; import { initDefaultProps } from '../_util/props-util'; -import { AvatarProps, avatarProps } from './Avatar'; -import Title, { SkeletonTitleProps, skeletonTitleProps } from './Title'; -import Paragraph, { SkeletonParagraphProps, skeletonParagraphProps } from './Paragraph'; +import type { AvatarProps } from './Avatar'; +import { avatarProps } from './Avatar'; +import type { SkeletonTitleProps } from './Title'; +import Title, { skeletonTitleProps } from './Title'; +import type { SkeletonParagraphProps } from './Paragraph'; +import Paragraph, { skeletonParagraphProps } from './Paragraph'; import Omit from 'omit.js'; import useConfigInject from '../_util/hooks/useConfigInject'; import Element from './Element'; diff --git a/components/skeleton/Title.tsx b/components/skeleton/Title.tsx index be08b2c0e6..8c5b33802a 100644 --- a/components/skeleton/Title.tsx +++ b/components/skeleton/Title.tsx @@ -1,4 +1,5 @@ -import { defineComponent, ExtractPropTypes } from 'vue'; +import type { ExtractPropTypes } from 'vue'; +import { defineComponent } from 'vue'; import PropTypes from '../_util/vue-types'; export const skeletonTitleProps = { diff --git a/components/skeleton/index.tsx b/components/skeleton/index.tsx index ff60063011..c83f0c7182 100644 --- a/components/skeleton/index.tsx +++ b/components/skeleton/index.tsx @@ -1,4 +1,4 @@ -import { App, Plugin } from 'vue'; +import type { App, Plugin } from 'vue'; import Skeleton from './Skeleton'; import SkeletonButton from './Button'; import SkeletonInput from './Input'; diff --git a/components/slider/index.tsx b/components/slider/index.tsx index 67b1367b95..5fa8aeec0a 100644 --- a/components/slider/index.tsx +++ b/components/slider/index.tsx @@ -1,4 +1,5 @@ -import { defineComponent, inject, VNodeTypes } from 'vue'; +import type { VNodeTypes } from 'vue'; +import { defineComponent, inject } from 'vue'; import PropTypes from '../_util/vue-types'; import BaseMixin from '../_util/BaseMixin'; import { getOptionProps } from '../_util/props-util'; diff --git a/components/space/index.tsx b/components/space/index.tsx index e896073bb7..09e9400f8b 100644 --- a/components/space/index.tsx +++ b/components/space/index.tsx @@ -1,15 +1,8 @@ -import { - defineComponent, - PropType, - ExtractPropTypes, - computed, - ref, - watch, - CSSProperties, -} from 'vue'; +import type { PropType, ExtractPropTypes, CSSProperties } from 'vue'; +import { defineComponent, computed, ref, watch } from 'vue'; import PropTypes from '../_util/vue-types'; import { filterEmpty } from '../_util/props-util'; -import { SizeType } from '../config-provider'; +import type { SizeType } from '../config-provider'; import { tuple, withInstall } from '../_util/type'; import useConfigInject from '../_util/hooks/useConfigInject'; import useFlexGapSupport from '../_util/hooks/useFlexGapSupport'; diff --git a/components/spin/Spin.tsx b/components/spin/Spin.tsx index aa2d3583ee..44d22ffca8 100644 --- a/components/spin/Spin.tsx +++ b/components/spin/Spin.tsx @@ -1,12 +1,5 @@ -import { - inject, - cloneVNode, - isVNode, - defineComponent, - VNode, - nextTick, - ExtractPropTypes, -} from 'vue'; +import type { VNode, ExtractPropTypes } from 'vue'; +import { inject, cloneVNode, isVNode, defineComponent, nextTick } from 'vue'; import debounce from 'lodash-es/debounce'; import { tuple } from '../_util/type'; import PropTypes from '../_util/vue-types'; diff --git a/components/spin/index.ts b/components/spin/index.ts index f6032de6b8..44651afdfd 100644 --- a/components/spin/index.ts +++ b/components/spin/index.ts @@ -1,4 +1,4 @@ -import { App, Plugin } from 'vue'; +import type { App, Plugin } from 'vue'; import Spin, { setDefaultIndicator } from './Spin'; export { SpinProps, getSpinProps } from './Spin'; diff --git a/components/statistic/Countdown.tsx b/components/statistic/Countdown.tsx index 7f43fcdfb3..393a1f83a7 100644 --- a/components/statistic/Countdown.tsx +++ b/components/statistic/Countdown.tsx @@ -3,7 +3,8 @@ import moment from 'moment'; import interopDefault from '../_util/interopDefault'; import initDefaultProps from '../_util/props-util/initDefaultProps'; import Statistic, { statisticProps } from './Statistic'; -import { formatCountdown as formatCD, countdownValueType, FormatConfig } from './utils'; +import type { countdownValueType, FormatConfig } from './utils'; +import { formatCountdown as formatCD } from './utils'; const REFRESH_INTERVAL = 1000 / 30; diff --git a/components/statistic/Number.tsx b/components/statistic/Number.tsx index 2a922f3bbe..6ce037d5dc 100644 --- a/components/statistic/Number.tsx +++ b/components/statistic/Number.tsx @@ -1,6 +1,6 @@ import padEnd from 'lodash-es/padEnd'; -import { FunctionalComponent, VNodeTypes } from 'vue'; -import { FormatConfig, valueType } from './utils'; +import type { FunctionalComponent, VNodeTypes } from 'vue'; +import type { FormatConfig, valueType } from './utils'; interface NumberProps extends FormatConfig { value: valueType; diff --git a/components/statistic/Statistic.tsx b/components/statistic/Statistic.tsx index ac6284b7f3..2dc318752e 100644 --- a/components/statistic/Statistic.tsx +++ b/components/statistic/Statistic.tsx @@ -1,8 +1,9 @@ -import { defineComponent, ExtractPropTypes, PropType } from 'vue'; +import type { ExtractPropTypes, PropType } from 'vue'; +import { defineComponent } from 'vue'; import PropTypes from '../_util/vue-types'; import initDefaultProps from '../_util/props-util/initDefaultProps'; import StatisticNumber from './Number'; -import { countdownValueType } from './utils'; +import type { countdownValueType } from './utils'; import Skeleton from '../skeleton/Skeleton'; import useConfigInject from '../_util/hooks/useConfigInject'; diff --git a/components/statistic/index.ts b/components/statistic/index.ts index 2473c1d519..6c19bfcc62 100644 --- a/components/statistic/index.ts +++ b/components/statistic/index.ts @@ -1,4 +1,4 @@ -import { App, Plugin } from 'vue'; +import type { App, Plugin } from 'vue'; import Statistic from './Statistic'; import Countdown from './Countdown'; diff --git a/components/statistic/utils.ts b/components/statistic/utils.ts index f335e1f725..efd9a4900f 100644 --- a/components/statistic/utils.ts +++ b/components/statistic/utils.ts @@ -1,4 +1,4 @@ -import { VNodeTypes } from 'vue'; +import type { VNodeTypes } from 'vue'; import padStart from 'lodash-es/padStart'; export type valueType = number | string; diff --git a/components/steps/index.tsx b/components/steps/index.tsx index c572497428..d7f8240d06 100644 --- a/components/steps/index.tsx +++ b/components/steps/index.tsx @@ -1,4 +1,5 @@ -import { App, defineComponent, ExtractPropTypes, inject, Plugin } from 'vue'; +import type { App, ExtractPropTypes, Plugin } from 'vue'; +import { defineComponent, inject } from 'vue'; import CloseOutlined from '@ant-design/icons-vue/CloseOutlined'; import CheckOutlined from '@ant-design/icons-vue/CheckOutlined'; import PropTypes, { withUndefined } from '../_util/vue-types'; diff --git a/components/switch/index.tsx b/components/switch/index.tsx index 7112c0c28f..4febcce829 100644 --- a/components/switch/index.tsx +++ b/components/switch/index.tsx @@ -1,9 +1,9 @@ +import type { ExtractPropTypes } from 'vue'; import { defineComponent, inject, onBeforeMount, ref, - ExtractPropTypes, computed, onMounted, nextTick, diff --git a/components/table/FilterDropdownMenuWrapper.tsx b/components/table/FilterDropdownMenuWrapper.tsx index b06ec2c71d..bfe9785a56 100644 --- a/components/table/FilterDropdownMenuWrapper.tsx +++ b/components/table/FilterDropdownMenuWrapper.tsx @@ -1,4 +1,4 @@ -import { FunctionalComponent } from 'vue'; +import type { FunctionalComponent } from 'vue'; export interface FilterDropdownMenuWrapperProps { class?: string; diff --git a/components/table/Table.tsx b/components/table/Table.tsx index ddb7f75eb3..d98d029291 100755 --- a/components/table/Table.tsx +++ b/components/table/Table.tsx @@ -15,14 +15,14 @@ import { getOptionProps } from '../_util/props-util'; import initDefaultProps from '../_util/props-util/initDefaultProps'; import BaseMixin from '../_util/BaseMixin'; import { defaultConfigProvider } from '../config-provider'; -import { - tableProps, +import type { TableComponents, TableState, TableProps, ColumnProps, TableStateFilters, } from './interface'; +import { tableProps } from './interface'; import Pagination from '../pagination'; import Spin from '../spin'; import LocaleReceiver from '../locale-provider/LocaleReceiver'; diff --git a/components/table/filterDropdown.tsx b/components/table/filterDropdown.tsx index 83183487df..b82ae3c89f 100755 --- a/components/table/filterDropdown.tsx +++ b/components/table/filterDropdown.tsx @@ -14,7 +14,7 @@ import initDefaultProps from '../_util/props-util/initDefaultProps'; import { cloneElement } from '../_util/vnode'; import BaseMixin2 from '../_util/BaseMixin2'; import { generateValueMaps } from './util'; -import { Key } from '../_util/type'; +import type { Key } from '../_util/type'; function stopPropagation(e) { e.stopPropagation(); diff --git a/components/table/index.tsx b/components/table/index.tsx index c8336b9474..dcce901443 100644 --- a/components/table/index.tsx +++ b/components/table/index.tsx @@ -1,7 +1,8 @@ -import { App, defineComponent, Plugin } from 'vue'; +import type { App, Plugin } from 'vue'; +import { defineComponent } from 'vue'; import T, { defaultTableProps } from './Table'; -import Column from './Column'; -import ColumnGroup from './ColumnGroup'; +import type Column from './Column'; +import type ColumnGroup from './ColumnGroup'; import { getOptionProps, getKey, diff --git a/components/table/interface.ts b/components/table/interface.ts index ab3e409bb9..1f188ca5c3 100644 --- a/components/table/interface.ts +++ b/components/table/interface.ts @@ -1,4 +1,4 @@ -import { ExtractPropTypes, PropType, UnwrapRef } from 'vue'; +import type { ExtractPropTypes, PropType, UnwrapRef } from 'vue'; import PropTypes, { withUndefined } from '../_util/vue-types'; import { paginationProps as getPaginationProps, paginationConfig } from '../pagination'; import { getSpinProps } from '../spin'; diff --git a/components/tabs/TabBar.tsx b/components/tabs/TabBar.tsx index ef7014692c..e0932bc260 100644 --- a/components/tabs/TabBar.tsx +++ b/components/tabs/TabBar.tsx @@ -1,4 +1,5 @@ -import { defineComponent, PropType } from 'vue'; +import type { PropType } from 'vue'; +import { defineComponent } from 'vue'; import { tuple } from '../_util/type'; import UpOutlined from '@ant-design/icons-vue/UpOutlined'; import DownOutlined from '@ant-design/icons-vue/DownOutlined'; diff --git a/components/tabs/index.ts b/components/tabs/index.ts index 3ee715a1aa..14b04d33ec 100644 --- a/components/tabs/index.ts +++ b/components/tabs/index.ts @@ -1,4 +1,4 @@ -import { App, Plugin } from 'vue'; +import type { App, Plugin } from 'vue'; import Tabs from './tabs'; import TabPane from '../vc-tabs/src/TabPane'; import TabContent from '../vc-tabs/src/TabContent'; diff --git a/components/tabs/tabs.tsx b/components/tabs/tabs.tsx index bd6b436621..2e9c371159 100644 --- a/components/tabs/tabs.tsx +++ b/components/tabs/tabs.tsx @@ -1,4 +1,5 @@ -import { defineComponent, inject, PropType } from 'vue'; +import type { PropType } from 'vue'; +import { defineComponent, inject } from 'vue'; import { tuple } from '../_util/type'; import CloseOutlined from '@ant-design/icons-vue/CloseOutlined'; import PlusOutlined from '@ant-design/icons-vue/PlusOutlined'; diff --git a/components/tag/CheckableTag.tsx b/components/tag/CheckableTag.tsx index 36a6602e22..8b6886455b 100644 --- a/components/tag/CheckableTag.tsx +++ b/components/tag/CheckableTag.tsx @@ -1,4 +1,5 @@ -import { defineComponent, PropType, computed } from 'vue'; +import type { PropType } from 'vue'; +import { defineComponent, computed } from 'vue'; import classNames from '../_util/classNames'; import PropTypes from '../_util/vue-types'; import useConfigInject from '../_util/hooks/useConfigInject'; diff --git a/components/tag/index.tsx b/components/tag/index.tsx index 4af732b262..65dba51621 100644 --- a/components/tag/index.tsx +++ b/components/tag/index.tsx @@ -1,25 +1,12 @@ -import { - ref, - HTMLAttributes, - defineComponent, - App, - watchEffect, - PropType, - ExtractPropTypes, - Plugin, - computed, -} from 'vue'; +import type { HTMLAttributes, App, PropType, ExtractPropTypes, Plugin } from 'vue'; +import { ref, defineComponent, watchEffect, computed } from 'vue'; import classNames from '../_util/classNames'; import PropTypes from '../_util/vue-types'; import CloseOutlined from '@ant-design/icons-vue/CloseOutlined'; import Wave from '../_util/wave'; -import { - PresetColorTypes, - PresetStatusColorTypes, - PresetColorType, - PresetStatusColorType, -} from '../_util/colors'; -import { LiteralUnion } from '../_util/type'; +import type { PresetColorType, PresetStatusColorType } from '../_util/colors'; +import { PresetColorTypes, PresetStatusColorTypes } from '../_util/colors'; +import type { LiteralUnion } from '../_util/type'; import CheckableTag from './CheckableTag'; import useConfigInject from '../_util/hooks/useConfigInject'; diff --git a/components/time-picker/index.tsx b/components/time-picker/index.tsx index eda8a9bce7..4795619204 100644 --- a/components/time-picker/index.tsx +++ b/components/time-picker/index.tsx @@ -1,5 +1,6 @@ import omit from 'omit.js'; -import { defineComponent, ExtractPropTypes, inject, provide } from 'vue'; +import type { ExtractPropTypes } from 'vue'; +import { defineComponent, inject, provide } from 'vue'; import VcTimePicker from '../vc-time-picker'; import LocaleReceiver from '../locale-provider/LocaleReceiver'; import BaseMixin from '../_util/BaseMixin'; diff --git a/components/timeline/Timeline.tsx b/components/timeline/Timeline.tsx index 5e42a496d9..a331d9bcf5 100644 --- a/components/timeline/Timeline.tsx +++ b/components/timeline/Timeline.tsx @@ -1,9 +1,11 @@ -import { inject, cloneVNode, defineComponent, ExtractPropTypes } from 'vue'; +import type { ExtractPropTypes } from 'vue'; +import { inject, cloneVNode, defineComponent } from 'vue'; import classNames from '../_util/classNames'; import PropTypes from '../_util/vue-types'; import { getOptionProps, getPropsData, filterEmpty, getComponent } from '../_util/props-util'; import initDefaultProps from '../_util/props-util/initDefaultProps'; -import TimelineItem, { TimelineItemProps } from './TimelineItem'; +import type { TimelineItemProps } from './TimelineItem'; +import TimelineItem from './TimelineItem'; import LoadingOutlined from '@ant-design/icons-vue/LoadingOutlined'; import { defaultConfigProvider } from '../config-provider'; import { tuple } from '../_util/type'; diff --git a/components/timeline/TimelineItem.tsx b/components/timeline/TimelineItem.tsx index 4f86c4f78a..99a0d162f4 100644 --- a/components/timeline/TimelineItem.tsx +++ b/components/timeline/TimelineItem.tsx @@ -1,4 +1,5 @@ -import { defineComponent, ExtractPropTypes, inject } from 'vue'; +import type { ExtractPropTypes } from 'vue'; +import { defineComponent, inject } from 'vue'; import classNames from '../_util/classNames'; import PropTypes from '../_util/vue-types'; import { getOptionProps, getComponent } from '../_util/props-util'; diff --git a/components/timeline/index.tsx b/components/timeline/index.tsx index cefa858098..b421bbffeb 100644 --- a/components/timeline/index.tsx +++ b/components/timeline/index.tsx @@ -1,4 +1,4 @@ -import { App, Plugin } from 'vue'; +import type { App, Plugin } from 'vue'; import Timeline from './Timeline'; import TimelineItem from './TimelineItem'; diff --git a/components/tooltip/Tooltip.tsx b/components/tooltip/Tooltip.tsx index b2e6bc7025..ab81c82c58 100644 --- a/components/tooltip/Tooltip.tsx +++ b/components/tooltip/Tooltip.tsx @@ -1,4 +1,5 @@ -import { defineComponent, ExtractPropTypes, inject, CSSProperties } from 'vue'; +import type { ExtractPropTypes, CSSProperties } from 'vue'; +import { defineComponent, inject } from 'vue'; import VcTooltip from '../vc-tooltip'; import classNames from '../_util/classNames'; import getPlacements from './placements'; diff --git a/components/transfer/index.tsx b/components/transfer/index.tsx index e1f9eded93..636f5de416 100644 --- a/components/transfer/index.tsx +++ b/components/transfer/index.tsx @@ -8,7 +8,8 @@ import List from './list'; import Operation from './operation'; import LocaleReceiver from '../locale-provider/LocaleReceiver'; import defaultLocale from '../locale-provider/default'; -import { defaultConfigProvider, RenderEmptyHandler } from '../config-provider'; +import type { RenderEmptyHandler } from '../config-provider'; +import { defaultConfigProvider } from '../config-provider'; import { withInstall } from '../_util/type'; export type TransferDirection = 'left' | 'right'; diff --git a/components/transfer/list.tsx b/components/transfer/list.tsx index 269f34cdaf..fac83da9a8 100644 --- a/components/transfer/list.tsx +++ b/components/transfer/list.tsx @@ -7,8 +7,9 @@ import Checkbox from '../checkbox'; import Search from './search'; import defaultRenderList from './renderListBody'; import triggerEvent from '../_util/triggerEvent'; -import { defineComponent, nextTick, VNode, VNodeTypes } from 'vue'; -import { RadioChangeEvent } from '../radio/interface'; +import type { VNode, VNodeTypes } from 'vue'; +import { defineComponent, nextTick } from 'vue'; +import type { RadioChangeEvent } from '../radio/interface'; const defaultRender = () => null; diff --git a/components/transfer/operation.tsx b/components/transfer/operation.tsx index 0c73ec75b0..c3ced7b21a 100644 --- a/components/transfer/operation.tsx +++ b/components/transfer/operation.tsx @@ -1,4 +1,4 @@ -import { CSSProperties, FunctionalComponent } from 'vue'; +import type { CSSProperties, FunctionalComponent } from 'vue'; import LeftOutlined from '@ant-design/icons-vue/LeftOutlined'; import RightOutlined from '@ant-design/icons-vue/RightOutlined'; import Button from '../button'; diff --git a/components/transfer/renderListBody.tsx b/components/transfer/renderListBody.tsx index c73968e620..ffb81c5739 100644 --- a/components/transfer/renderListBody.tsx +++ b/components/transfer/renderListBody.tsx @@ -4,7 +4,7 @@ import ListItem from './ListItem'; import PropTypes, { withUndefined } from '../_util/vue-types'; import { findDOMNode } from '../_util/props-util'; import { getTransitionGroupProps, TransitionGroup } from '../_util/transition'; -import { DataSourceItem } from './list'; +import type { DataSourceItem } from './list'; const ListBody = defineComponent({ name: 'ListBody', inheritAttrs: false, diff --git a/components/tree-select/index.tsx b/components/tree-select/index.tsx index def64a7259..966c6fd2b0 100644 --- a/components/tree-select/index.tsx +++ b/components/tree-select/index.tsx @@ -1,4 +1,5 @@ -import { App, defineComponent, inject, Plugin } from 'vue'; +import type { App, Plugin } from 'vue'; +import { defineComponent, inject } from 'vue'; import VcTreeSelect, { TreeNode, SHOW_ALL, SHOW_PARENT, SHOW_CHILD } from '../vc-tree-select'; import classNames from '../_util/classNames'; import { TreeSelectProps } from './interface'; diff --git a/components/tree/DirectoryTree.tsx b/components/tree/DirectoryTree.tsx index c5194c7f4a..3e096b36ea 100644 --- a/components/tree/DirectoryTree.tsx +++ b/components/tree/DirectoryTree.tsx @@ -1,4 +1,5 @@ -import { defineComponent, inject, VNode } from 'vue'; +import type { VNode } from 'vue'; +import { defineComponent, inject } from 'vue'; import omit from 'omit.js'; import debounce from 'lodash-es/debounce'; import FolderOpenOutlined from '@ant-design/icons-vue/FolderOpenOutlined'; @@ -7,7 +8,8 @@ import FileOutlined from '@ant-design/icons-vue/FileOutlined'; import PropTypes from '../_util/vue-types'; import classNames from '../_util/classNames'; import { conductExpandParent, convertTreeToEntities } from '../vc-tree/src/util'; -import Tree, { CheckEvent, ExpendEvent, SelectEvent, TreeProps } from './Tree'; +import type { CheckEvent, ExpendEvent, SelectEvent } from './Tree'; +import Tree, { TreeProps } from './Tree'; import { calcRangeKeys, getFullKeyList, diff --git a/components/tree/Tree.tsx b/components/tree/Tree.tsx index fff9df3efe..b01c4fcd8c 100644 --- a/components/tree/Tree.tsx +++ b/components/tree/Tree.tsx @@ -1,4 +1,5 @@ -import { defineComponent, inject, VNode, PropType, CSSProperties } from 'vue'; +import type { VNode, PropType, CSSProperties } from 'vue'; +import { defineComponent, inject } from 'vue'; import classNames from '../_util/classNames'; import LoadingOutlined from '@ant-design/icons-vue/LoadingOutlined'; import FileOutlined from '@ant-design/icons-vue/FileOutlined'; diff --git a/components/tree/index.tsx b/components/tree/index.tsx index c0d2493b69..446ceb1199 100644 --- a/components/tree/index.tsx +++ b/components/tree/index.tsx @@ -1,4 +1,4 @@ -import { App, Plugin } from 'vue'; +import type { App, Plugin } from 'vue'; import Tree from './Tree'; import DirectoryTree from './DirectoryTree'; diff --git a/components/tree/util.ts b/components/tree/util.ts index 0a7b35b755..c4089fe424 100644 --- a/components/tree/util.ts +++ b/components/tree/util.ts @@ -1,7 +1,7 @@ -import { VNode } from 'vue'; +import type { VNode } from 'vue'; import { getNodeChildren, convertTreeToEntities } from '../vc-tree/src/util'; import { getSlot } from '../_util/props-util'; -import { TreeDataItem } from './Tree'; +import type { TreeDataItem } from './Tree'; enum Record { None, diff --git a/components/typography/Base.tsx b/components/typography/Base.tsx index e9e3b11d47..cf99080a5e 100644 --- a/components/typography/Base.tsx +++ b/components/typography/Base.tsx @@ -7,16 +7,17 @@ import isStyleSupport from '../_util/styleChecker'; import Editable from './Editable'; import measure from './util'; import PropTypes from '../_util/vue-types'; -import Typography, { TypographyProps } from './Typography'; +import type { TypographyProps } from './Typography'; +import Typography from './Typography'; import ResizeObserver from '../vc-resize-observer'; import Tooltip from '../tooltip'; import copy from '../_util/copy-to-clipboard'; import CheckOutlined from '@ant-design/icons-vue/CheckOutlined'; import CopyOutlined from '@ant-design/icons-vue/CopyOutlined'; import EditOutlined from '@ant-design/icons-vue/EditOutlined'; +import type { VNodeTypes, CSSProperties } from 'vue'; import { defineComponent, - VNodeTypes, reactive, ref, onMounted, @@ -24,11 +25,10 @@ import { watch, watchEffect, nextTick, - CSSProperties, computed, toRaw, } from 'vue'; -import { AutoSizeType } from '../input/ResizableTextArea'; +import type { AutoSizeType } from '../input/ResizableTextArea'; import useConfigInject from '../_util/hooks/useConfigInject'; export type BaseType = 'secondary' | 'success' | 'warning' | 'danger'; diff --git a/components/typography/Link.tsx b/components/typography/Link.tsx index 53aeaa1c79..6cb49e9778 100644 --- a/components/typography/Link.tsx +++ b/components/typography/Link.tsx @@ -1,6 +1,7 @@ -import { AnchorHTMLAttributes, FunctionalComponent } from 'vue'; +import type { AnchorHTMLAttributes, FunctionalComponent } from 'vue'; import warning from '../_util/warning'; -import Base, { baseProps, BlockProps } from './Base'; +import type { BlockProps } from './Base'; +import Base, { baseProps } from './Base'; import Omit from 'omit.js'; import PropTypes from '../_util/vue-types'; diff --git a/components/typography/Paragraph.tsx b/components/typography/Paragraph.tsx index 3a93837c55..85cec6567c 100644 --- a/components/typography/Paragraph.tsx +++ b/components/typography/Paragraph.tsx @@ -1,6 +1,7 @@ import Omit from 'omit.js'; -import { FunctionalComponent } from 'vue'; -import Base, { BlockProps, baseProps } from './Base'; +import type { FunctionalComponent } from 'vue'; +import type { BlockProps } from './Base'; +import Base, { baseProps } from './Base'; const Paragraph: FunctionalComponent = (props, { slots, attrs }) => { const paragraphProps = { diff --git a/components/typography/Text.tsx b/components/typography/Text.tsx index 54a52b025a..bec6cbaaa3 100644 --- a/components/typography/Text.tsx +++ b/components/typography/Text.tsx @@ -1,6 +1,7 @@ -import { FunctionalComponent } from 'vue'; +import type { FunctionalComponent } from 'vue'; import warning from '../_util/warning'; -import Base, { baseProps, BlockProps, EllipsisConfig } from './Base'; +import type { BlockProps, EllipsisConfig } from './Base'; +import Base, { baseProps } from './Base'; import Omit from 'omit.js'; export interface TextProps extends BlockProps { diff --git a/components/typography/Title.tsx b/components/typography/Title.tsx index 896d629d2e..3de6746bd3 100644 --- a/components/typography/Title.tsx +++ b/components/typography/Title.tsx @@ -1,9 +1,10 @@ import Omit from 'omit.js'; -import { FunctionalComponent } from 'vue'; +import type { FunctionalComponent } from 'vue'; import { tupleNum } from '../_util/type'; import PropTypes from '../_util/vue-types'; import warning from '../_util/warning'; -import Base, { baseProps, BlockProps } from './Base'; +import type { BlockProps } from './Base'; +import Base, { baseProps } from './Base'; const TITLE_ELE_LIST = tupleNum(1, 2, 3, 4, 5); diff --git a/components/typography/Typography.tsx b/components/typography/Typography.tsx index dc7c33f270..c54254345a 100644 --- a/components/typography/Typography.tsx +++ b/components/typography/Typography.tsx @@ -1,5 +1,6 @@ import PropTypes from '../_util/vue-types'; -import { defineComponent, HTMLAttributes } from 'vue'; +import type { HTMLAttributes } from 'vue'; +import { defineComponent } from 'vue'; import useConfigInject from '../_util/hooks/useConfigInject'; import classNames from '../_util/classNames'; diff --git a/components/typography/index.tsx b/components/typography/index.tsx index 2de640485f..5cef34fad5 100644 --- a/components/typography/index.tsx +++ b/components/typography/index.tsx @@ -1,4 +1,4 @@ -import { App, Plugin } from 'vue'; +import type { App, Plugin } from 'vue'; import Base from './Base'; import Link from './Link'; import Paragraph from './Paragraph'; diff --git a/components/typography/util.tsx b/components/typography/util.tsx index f4bef70717..c163c3d2f8 100644 --- a/components/typography/util.tsx +++ b/components/typography/util.tsx @@ -1,4 +1,5 @@ -import { createApp, CSSProperties, VNodeTypes } from 'vue'; +import type { CSSProperties, VNodeTypes } from 'vue'; +import { createApp } from 'vue'; interface MeasureResult { finished: boolean; diff --git a/components/upload/UploadList.tsx b/components/upload/UploadList.tsx index 57bc46683e..4137f876a7 100644 --- a/components/upload/UploadList.tsx +++ b/components/upload/UploadList.tsx @@ -1,4 +1,5 @@ -import { defineComponent, inject, CSSProperties, nextTick } from 'vue'; +import type { CSSProperties } from 'vue'; +import { defineComponent, inject, nextTick } from 'vue'; import BaseMixin from '../_util/BaseMixin'; import { getOptionProps, initDefaultProps } from '../_util/props-util'; import { diff --git a/components/upload/index.tsx b/components/upload/index.tsx index e672fdb443..77fb3fde5f 100644 --- a/components/upload/index.tsx +++ b/components/upload/index.tsx @@ -1,4 +1,4 @@ -import { App, Plugin } from 'vue'; +import type { App, Plugin } from 'vue'; import Upload from './Upload'; import Dragger from './Dragger'; diff --git a/components/vc-align/Align.tsx b/components/vc-align/Align.tsx index 85173fa134..6dd82e8472 100644 --- a/components/vc-align/Align.tsx +++ b/components/vc-align/Align.tsx @@ -1,20 +1,12 @@ -import { - defineComponent, - PropType, - ref, - computed, - onMounted, - onUpdated, - watch, - onUnmounted, -} from 'vue'; +import type { PropType } from 'vue'; +import { defineComponent, ref, computed, onMounted, onUpdated, watch, onUnmounted } from 'vue'; import { alignElement, alignPoint } from 'dom-align'; import addEventListener from '../vc-util/Dom/addEventListener'; import { cloneElement } from '../_util/vnode'; import isVisible from '../vc-util/Dom/isVisible'; import { isSamePoint, restoreFocus, monitorResize } from './util'; -import { AlignType, AlignResult, TargetType, TargetPoint } from './interface'; +import type { AlignType, AlignResult, TargetType, TargetPoint } from './interface'; import useBuffer from './hooks/useBuffer'; type OnAlign = (source: HTMLElement, result: AlignResult) => void; diff --git a/components/vc-align/hooks/useBuffer.tsx b/components/vc-align/hooks/useBuffer.tsx index 75e4733fba..ba0a40931f 100644 --- a/components/vc-align/hooks/useBuffer.tsx +++ b/components/vc-align/hooks/useBuffer.tsx @@ -1,4 +1,4 @@ -import { ComputedRef } from 'vue'; +import type { ComputedRef } from 'vue'; export default (callback: () => boolean, buffer: ComputedRef) => { let called = false; diff --git a/components/vc-align/util.ts b/components/vc-align/util.ts index 8f19c5ae57..ecff1cdfc6 100644 --- a/components/vc-align/util.ts +++ b/components/vc-align/util.ts @@ -1,5 +1,5 @@ import contains from '../vc-util/Dom/contains'; -import { TargetPoint } from './interface'; +import type { TargetPoint } from './interface'; export function isSamePoint(prev: TargetPoint, next: TargetPoint) { if (prev === next) return true; diff --git a/components/vc-image/src/Image.tsx b/components/vc-image/src/Image.tsx index dc1420eac1..c075ea5e14 100644 --- a/components/vc-image/src/Image.tsx +++ b/components/vc-image/src/Image.tsx @@ -1,12 +1,5 @@ -import { - ImgHTMLAttributes, - CSSProperties, - ref, - watch, - defineComponent, - computed, - onMounted, -} from 'vue'; +import type { ImgHTMLAttributes, CSSProperties } from 'vue'; +import { ref, watch, defineComponent, computed, onMounted } from 'vue'; import isNumber from 'lodash-es/isNumber'; import BaseMixin from '../../_util/BaseMixin'; @@ -14,7 +7,8 @@ import cn from '../../_util/classNames'; import PropTypes from '../../_util/vue-types'; import { getOffset } from '../../vc-util/Dom/css'; -import Preview, { MouseEventHandler } from './Preview'; +import type { MouseEventHandler } from './Preview'; +import Preview from './Preview'; import PreviewGroup, { context } from './PreviewGroup'; diff --git a/components/vc-image/src/PreviewGroup.tsx b/components/vc-image/src/PreviewGroup.tsx index 229ec8988b..0b65c6cd7b 100644 --- a/components/vc-image/src/PreviewGroup.tsx +++ b/components/vc-image/src/PreviewGroup.tsx @@ -1,4 +1,5 @@ -import { ref, provide, defineComponent, inject, Ref, reactive } from 'vue'; +import type { Ref } from 'vue'; +import { ref, provide, defineComponent, inject, reactive } from 'vue'; import Preview from './Preview'; export interface GroupConsumerProps { diff --git a/components/vc-mentions/src/mentionsProps.ts b/components/vc-mentions/src/mentionsProps.ts index a3b391af6e..f73e9aa79b 100644 --- a/components/vc-mentions/src/mentionsProps.ts +++ b/components/vc-mentions/src/mentionsProps.ts @@ -1,4 +1,4 @@ -import { PropType } from 'vue'; +import type { PropType } from 'vue'; import PropTypes from '../../_util/vue-types'; import { initDefaultProps } from '../../_util/props-util'; import { diff --git a/components/vc-overflow/Item.tsx b/components/vc-overflow/Item.tsx index abd9d6a3c4..246bf4d334 100644 --- a/components/vc-overflow/Item.tsx +++ b/components/vc-overflow/Item.tsx @@ -1,15 +1,8 @@ -import { - computed, - CSSProperties, - defineComponent, - HTMLAttributes, - onUnmounted, - PropType, - ref, -} from 'vue'; +import type { CSSProperties, HTMLAttributes, PropType } from 'vue'; +import { computed, defineComponent, onUnmounted, ref } from 'vue'; import ResizeObserver from '../vc-resize-observer'; import classNames from '../_util/classNames'; -import { Key, VueNode } from '../_util/type'; +import type { Key, VueNode } from '../_util/type'; import PropTypes from '../_util/vue-types'; const UNDEFINED = undefined; diff --git a/components/vc-overflow/Overflow.tsx b/components/vc-overflow/Overflow.tsx index 6b2d9b5472..82d714984e 100644 --- a/components/vc-overflow/Overflow.tsx +++ b/components/vc-overflow/Overflow.tsx @@ -1,15 +1,8 @@ -import { - computed, - CSSProperties, - defineComponent, - HTMLAttributes, - PropType, - ref, - watch, -} from 'vue'; +import type { CSSProperties, HTMLAttributes, PropType } from 'vue'; +import { computed, defineComponent, ref, watch } from 'vue'; import ResizeObserver from '../vc-resize-observer'; import classNames from '../_util/classNames'; -import { Key, VueNode } from '../_util/type'; +import type { Key, VueNode } from '../_util/type'; import PropTypes from '../_util/vue-types'; import { OverflowContextProvider } from './context'; import Item from './Item'; diff --git a/components/vc-overflow/context.ts b/components/vc-overflow/context.ts index 9543faab24..21db22afb0 100644 --- a/components/vc-overflow/context.ts +++ b/components/vc-overflow/context.ts @@ -1,13 +1,6 @@ -import { - computed, - ComputedRef, - defineComponent, - inject, - InjectionKey, - PropType, - provide, -} from 'vue'; -import { Key } from '../_util/type'; +import type { ComputedRef, InjectionKey, PropType } from 'vue'; +import { computed, defineComponent, inject, provide } from 'vue'; +import type { Key } from '../_util/type'; export interface OverflowContextProviderValueType { prefixCls: string; diff --git a/components/vc-resize-observer/index.tsx b/components/vc-resize-observer/index.tsx index c6e0f0e36a..850f27e6ba 100644 --- a/components/vc-resize-observer/index.tsx +++ b/components/vc-resize-observer/index.tsx @@ -1,11 +1,11 @@ // based on rc-resize-observer 1.0.0 +import type { PropType } from 'vue'; import { defineComponent, getCurrentInstance, onMounted, onUnmounted, onUpdated, - PropType, reactive, watch, } from 'vue'; diff --git a/components/vc-select/OptGroup.tsx b/components/vc-select/OptGroup.tsx index 747f6a03f8..36c3ecc901 100644 --- a/components/vc-select/OptGroup.tsx +++ b/components/vc-select/OptGroup.tsx @@ -1,6 +1,6 @@ -import { FunctionalComponent } from 'vue'; +import type { FunctionalComponent } from 'vue'; -import { OptionGroupData } from './interface'; +import type { OptionGroupData } from './interface'; export type OptGroupProps = Omit; diff --git a/components/vc-select/Option.tsx b/components/vc-select/Option.tsx index cd1c179768..a8d68184b7 100644 --- a/components/vc-select/Option.tsx +++ b/components/vc-select/Option.tsx @@ -1,6 +1,6 @@ -import { FunctionalComponent } from 'vue'; +import type { FunctionalComponent } from 'vue'; -import { OptionCoreData } from './interface'; +import type { OptionCoreData } from './interface'; export interface OptionProps extends Omit { /** Save for customize data */ diff --git a/components/vc-select/OptionList.tsx b/components/vc-select/OptionList.tsx index b8c7a1eff5..fbeb9744b7 100644 --- a/components/vc-select/OptionList.tsx +++ b/components/vc-select/OptionList.tsx @@ -5,15 +5,16 @@ import classNames from '../_util/classNames'; import pickAttrs from '../_util/pickAttrs'; import { isValidElement } from '../_util/props-util'; import createRef from '../_util/createRef'; -import { computed, defineComponent, nextTick, reactive, VNodeChild, watch } from 'vue'; +import type { VNodeChild } from 'vue'; +import { computed, defineComponent, nextTick, reactive, watch } from 'vue'; import List from '../vc-virtual-list/List'; -import { +import type { OptionsType as SelectOptionsType, OptionData, RenderNode, OnActiveValue, } from './interface'; -import { RawValueType, FlattenOptionsType } from './interface/generator'; +import type { RawValueType, FlattenOptionsType } from './interface/generator'; import useMemo from '../_util/hooks/useMemo'; export interface OptionListProps { prefixCls: string; diff --git a/components/vc-select/Select.tsx b/components/vc-select/Select.tsx index 4625dc9ae5..7cde15011f 100644 --- a/components/vc-select/Select.tsx +++ b/components/vc-select/Select.tsx @@ -29,7 +29,7 @@ * - `combobox` mode not support `optionLabelProp` */ -import { OptionsType as SelectOptionsType } from './interface'; +import type { OptionsType as SelectOptionsType } from './interface'; import SelectOptionList from './OptionList'; import Option from './Option'; import OptGroup from './OptGroup'; @@ -42,8 +42,9 @@ import { flattenOptions, fillOptionsWithMissingValue, } from './utils/valueUtil'; -import generateSelector, { SelectProps } from './generate'; -import { DefaultValueType } from './interface/generator'; +import type { SelectProps } from './generate'; +import generateSelector from './generate'; +import type { DefaultValueType } from './interface/generator'; import warningProps from './utils/warningPropsUtil'; import { defineComponent, ref } from 'vue'; import omit from 'lodash-es/omit'; diff --git a/components/vc-select/SelectTrigger.tsx b/components/vc-select/SelectTrigger.tsx index 892d2c9fe8..e9f4e9cca8 100644 --- a/components/vc-select/SelectTrigger.tsx +++ b/components/vc-select/SelectTrigger.tsx @@ -3,9 +3,10 @@ import PropTypes from '../_util/vue-types'; import { getSlot } from '../_util/props-util'; import classNames from '../_util/classNames'; import createRef from '../_util/createRef'; -import { CSSProperties, defineComponent, VNodeChild } from 'vue'; -import { RenderDOMFunc } from './interface'; -import { DropdownRender } from './interface/generator'; +import type { CSSProperties, VNodeChild } from 'vue'; +import { defineComponent } from 'vue'; +import type { RenderDOMFunc } from './interface'; +import type { DropdownRender } from './interface/generator'; const getBuiltInPlacements = (dropdownMatchSelectWidth: number | boolean) => { // Enable horizontal overflow auto-adjustment when a custom dropdown width is provided diff --git a/components/vc-select/Selector/Input.tsx b/components/vc-select/Selector/Input.tsx index 4bc5cadba0..c8f72a71d6 100644 --- a/components/vc-select/Selector/Input.tsx +++ b/components/vc-select/Selector/Input.tsx @@ -1,15 +1,8 @@ import { cloneElement } from '../../_util/vnode'; -import { - defineComponent, - getCurrentInstance, - inject, - onMounted, - VNode, - VNodeChild, - withDirectives, -} from 'vue'; +import type { VNode, VNodeChild } from 'vue'; +import { defineComponent, getCurrentInstance, inject, onMounted, withDirectives } from 'vue'; import PropTypes from '../../_util/vue-types'; -import { RefObject } from '../../_util/createRef'; +import type { RefObject } from '../../_util/createRef'; import antInput from '../../_util/antInputDirective'; import classNames from '../../_util/classNames'; diff --git a/components/vc-select/Selector/MultipleSelector.tsx b/components/vc-select/Selector/MultipleSelector.tsx index fd406d7ff1..7177e1634e 100644 --- a/components/vc-select/Selector/MultipleSelector.tsx +++ b/components/vc-select/Selector/MultipleSelector.tsx @@ -1,19 +1,20 @@ import TransBtn from '../TransBtn'; -import { +import type { LabelValueType, RawValueType, CustomTagProps, DefaultValueType, DisplayLabelValueType, } from '../interface/generator'; -import { RenderNode } from '../interface'; -import { InnerSelectorProps } from '.'; +import type { RenderNode } from '../interface'; +import type { InnerSelectorProps } from '.'; import Input from './Input'; -import { computed, defineComponent, onMounted, ref, VNodeChild, watch, Ref } from 'vue'; +import type { VNodeChild, Ref } from 'vue'; +import { computed, defineComponent, onMounted, ref, watch } from 'vue'; import classNames from '../../_util/classNames'; import pickAttrs from '../../_util/pickAttrs'; import PropTypes from '../../_util/vue-types'; -import { VueNode } from 'ant-design-vue/es/_util/type'; +import type { VueNode } from 'ant-design-vue/es/_util/type'; import Overflow from '../../vc-overflow'; interface SelectorProps extends InnerSelectorProps { diff --git a/components/vc-select/Selector/SingleSelector.tsx b/components/vc-select/Selector/SingleSelector.tsx index cccd358449..be58e784fa 100644 --- a/components/vc-select/Selector/SingleSelector.tsx +++ b/components/vc-select/Selector/SingleSelector.tsx @@ -1,7 +1,8 @@ import pickAttrs from '../../_util/pickAttrs'; import Input from './Input'; -import { InnerSelectorProps } from '.'; -import { computed, defineComponent, Fragment, ref, VNodeChild, watch } from 'vue'; +import type { InnerSelectorProps } from '.'; +import type { VNodeChild } from 'vue'; +import { computed, defineComponent, Fragment, ref, watch } from 'vue'; import PropTypes from '../../_util/vue-types'; interface SelectorProps extends InnerSelectorProps { diff --git a/components/vc-select/Selector/index.tsx b/components/vc-select/Selector/index.tsx index 0560617761..d4430c35af 100644 --- a/components/vc-select/Selector/index.tsx +++ b/components/vc-select/Selector/index.tsx @@ -11,13 +11,15 @@ import KeyCode from '../../_util/KeyCode'; import MultipleSelector from './MultipleSelector'; import SingleSelector from './SingleSelector'; -import { LabelValueType, RawValueType, CustomTagProps } from '../interface/generator'; -import { RenderNode, Mode } from '../interface'; +import type { LabelValueType, RawValueType, CustomTagProps } from '../interface/generator'; +import type { RenderNode, Mode } from '../interface'; import useLock from '../hooks/useLock'; -import { defineComponent, VNodeChild } from 'vue'; -import createRef, { RefObject } from '../../_util/createRef'; +import type { VNodeChild } from 'vue'; +import { defineComponent } from 'vue'; +import type { RefObject } from '../../_util/createRef'; +import createRef from '../../_util/createRef'; import PropTypes from '../../_util/vue-types'; -import { VueNode } from '../../_util/type'; +import type { VueNode } from '../../_util/type'; export interface InnerSelectorProps { prefixCls: string; diff --git a/components/vc-select/TransBtn.tsx b/components/vc-select/TransBtn.tsx index 9acbe18e86..1083529d1a 100644 --- a/components/vc-select/TransBtn.tsx +++ b/components/vc-select/TransBtn.tsx @@ -1,4 +1,4 @@ -import { FunctionalComponent, VNodeChild } from 'vue'; +import type { FunctionalComponent, VNodeChild } from 'vue'; import PropTypes from '../_util/vue-types'; export interface TransBtnProps { diff --git a/components/vc-select/generate.tsx b/components/vc-select/generate.tsx index 2fab4f7aec..09b2591ce8 100644 --- a/components/vc-select/generate.tsx +++ b/components/vc-select/generate.tsx @@ -11,8 +11,8 @@ import KeyCode from '../_util/KeyCode'; import classNames from '../_util/classNames'; import Selector from './Selector'; import SelectTrigger from './SelectTrigger'; -import { RenderNode, Mode, RenderDOMFunc, OnActiveValue } from './interface'; -import { +import type { RenderNode, Mode, RenderDOMFunc, OnActiveValue } from './interface'; +import type { GetLabeledValue, FilterOptions, FilterFunc, @@ -24,12 +24,12 @@ import { FlattenOptionsType, SingleType, OnClear, - INTERNAL_PROPS_MARK, SelectSource, CustomTagProps, DropdownRender, } from './interface/generator'; -import { OptionListProps } from './OptionList'; +import { INTERNAL_PROPS_MARK } from './interface/generator'; +import type { OptionListProps } from './OptionList'; import { toInnerValue, toOuterValues, removeLastEnabledValue, getUUID } from './utils/commonUtil'; import TransBtn from './TransBtn'; import useLock from './hooks/useLock'; @@ -38,17 +38,14 @@ import { getSeparatedContent } from './utils/valueUtil'; import useSelectTriggerControl from './hooks/useSelectTriggerControl'; import useCacheDisplayValue from './hooks/useCacheDisplayValue'; import useCacheOptions from './hooks/useCacheOptions'; +import type { CSSProperties, DefineComponent, VNode, VNodeChild } from 'vue'; import { computed, - CSSProperties, - DefineComponent, defineComponent, onBeforeUnmount, onMounted, provide, ref, - VNode, - VNodeChild, watch, watchEffect, } from 'vue'; diff --git a/components/vc-select/hooks/useCacheDisplayValue.ts b/components/vc-select/hooks/useCacheDisplayValue.ts index 087a65fdbb..391a810a5f 100644 --- a/components/vc-select/hooks/useCacheDisplayValue.ts +++ b/components/vc-select/hooks/useCacheDisplayValue.ts @@ -1,5 +1,6 @@ -import { computed, ComputedRef, Ref } from 'vue'; -import { DisplayLabelValueType } from '../interface/generator'; +import type { ComputedRef, Ref } from 'vue'; +import { computed } from 'vue'; +import type { DisplayLabelValueType } from '../interface/generator'; export default function useCacheDisplayValue( values: Ref, diff --git a/components/vc-select/hooks/useCacheOptions.ts b/components/vc-select/hooks/useCacheOptions.ts index 784a27af07..ec29049205 100644 --- a/components/vc-select/hooks/useCacheOptions.ts +++ b/components/vc-select/hooks/useCacheOptions.ts @@ -1,5 +1,6 @@ -import { computed, Ref, VNodeChild } from 'vue'; -import { RawValueType, FlattenOptionsType, Key } from '../interface/generator'; +import type { Ref, VNodeChild } from 'vue'; +import { computed } from 'vue'; +import type { RawValueType, FlattenOptionsType, Key } from '../interface/generator'; export default function useCacheOptions< OptionsType extends { diff --git a/components/vc-select/hooks/useDelayReset.ts b/components/vc-select/hooks/useDelayReset.ts index cd0cc4777b..ff429a612e 100644 --- a/components/vc-select/hooks/useDelayReset.ts +++ b/components/vc-select/hooks/useDelayReset.ts @@ -1,4 +1,5 @@ -import { onMounted, Ref, ref } from 'vue'; +import type { Ref } from 'vue'; +import { onMounted, ref } from 'vue'; /** * Similar with `useLock`, but this hook will always execute last value. diff --git a/components/vc-select/hooks/useSelectTriggerControl.ts b/components/vc-select/hooks/useSelectTriggerControl.ts index 7f7f78135d..460d9b9a84 100644 --- a/components/vc-select/hooks/useSelectTriggerControl.ts +++ b/components/vc-select/hooks/useSelectTriggerControl.ts @@ -1,4 +1,5 @@ -import { onBeforeUnmount, onMounted, Ref } from 'vue'; +import type { Ref } from 'vue'; +import { onBeforeUnmount, onMounted } from 'vue'; export default function useSelectTriggerControl( refs: Ref[], diff --git a/components/vc-select/index.ts b/components/vc-select/index.ts index 023af73f7d..0272bdf61d 100644 --- a/components/vc-select/index.ts +++ b/components/vc-select/index.ts @@ -1,4 +1,5 @@ -import Select, { ExportedSelectProps } from './Select'; +import type { ExportedSelectProps } from './Select'; +import Select from './Select'; import Option from './Option'; import OptGroup from './OptGroup'; import { BaseProps } from './generate'; diff --git a/components/vc-select/interface/generator.ts b/components/vc-select/interface/generator.ts index 5ef5846bdc..9674fa34ad 100644 --- a/components/vc-select/interface/generator.ts +++ b/components/vc-select/interface/generator.ts @@ -1,4 +1,4 @@ -import { VueNode } from '../../_util/type'; +import type { VueNode } from '../../_util/type'; export type SelectSource = 'option' | 'selection' | 'input'; diff --git a/components/vc-select/interface/index.ts b/components/vc-select/interface/index.ts index f06b9cd41b..28cca156c7 100644 --- a/components/vc-select/interface/index.ts +++ b/components/vc-select/interface/index.ts @@ -1,6 +1,6 @@ -import * as Vue from 'vue'; -import { VNode } from 'vue'; -import { Key, RawValueType } from './generator'; +import type * as Vue from 'vue'; +import type { VNode } from 'vue'; +import type { Key, RawValueType } from './generator'; export type RenderDOMFunc = (props: any) => HTMLElement; diff --git a/components/vc-select/utils/commonUtil.ts b/components/vc-select/utils/commonUtil.ts index 75457ab8a6..4a4e41070f 100644 --- a/components/vc-select/utils/commonUtil.ts +++ b/components/vc-select/utils/commonUtil.ts @@ -1,4 +1,4 @@ -import { +import type { RawValueType, GetLabeledValue, LabelValueType, diff --git a/components/vc-select/utils/legacyUtil.ts b/components/vc-select/utils/legacyUtil.ts index 8154e7f6e1..7d07806385 100644 --- a/components/vc-select/utils/legacyUtil.ts +++ b/components/vc-select/utils/legacyUtil.ts @@ -1,6 +1,6 @@ import { flattenChildren, isValidElement } from '../../_util/props-util'; -import { VNode, VNodeChild } from 'vue'; -import { OptionData, OptionGroupData, OptionsType } from '../interface'; +import type { VNode, VNodeChild } from 'vue'; +import type { OptionData, OptionGroupData, OptionsType } from '../interface'; function convertNodeToOption(node: VNode): OptionData { const { diff --git a/components/vc-select/utils/valueUtil.ts b/components/vc-select/utils/valueUtil.ts index c20d912df2..38fe6c950c 100644 --- a/components/vc-select/utils/valueUtil.ts +++ b/components/vc-select/utils/valueUtil.ts @@ -1,12 +1,13 @@ import { warning } from '../../vc-util/warning'; -import { cloneVNode, isVNode, VNodeChild } from 'vue'; -import { +import type { VNodeChild } from 'vue'; +import { cloneVNode, isVNode } from 'vue'; +import type { OptionsType as SelectOptionsType, OptionData, OptionGroupData, FlattenOptionData, } from '../interface'; -import { +import type { LabelValueType, FilterFunc, RawValueType, diff --git a/components/vc-select/utils/warningPropsUtil.ts b/components/vc-select/utils/warningPropsUtil.ts index eb52ccdab2..5873b48e25 100644 --- a/components/vc-select/utils/warningPropsUtil.ts +++ b/components/vc-select/utils/warningPropsUtil.ts @@ -1,11 +1,11 @@ import warning, { noteOnce } from '../../vc-util/warning'; -import { SelectProps } from '..'; +import type { SelectProps } from '..'; import { convertChildrenToData } from './legacyUtil'; -import { OptionData } from '../interface'; +import type { OptionData } from '../interface'; import { toArray } from './commonUtil'; -import { RawValueType, LabelValueType } from '../interface/generator'; +import type { RawValueType, LabelValueType } from '../interface/generator'; import { isValidElement } from '../../_util/props-util'; -import { VNode } from 'vue'; +import type { VNode } from 'vue'; function warningProps(props: SelectProps) { const { diff --git a/components/vc-util/Children/toArray.ts b/components/vc-util/Children/toArray.ts index af663dc30a..9f128b6bcb 100644 --- a/components/vc-util/Children/toArray.ts +++ b/components/vc-util/Children/toArray.ts @@ -1,4 +1,4 @@ -import { VNodeTypes } from '@vue/runtime-core'; +import type { VNodeTypes } from '@vue/runtime-core'; import { isFragment } from '../../_util/props-util'; export interface Option { diff --git a/components/vc-virtual-list/Filler.tsx b/components/vc-virtual-list/Filler.tsx index 6471cb2d1b..a4607311ed 100644 --- a/components/vc-virtual-list/Filler.tsx +++ b/components/vc-virtual-list/Filler.tsx @@ -1,6 +1,6 @@ import classNames from '../_util/classNames'; import ResizeObserver from '../vc-resize-observer'; -import { CSSProperties, FunctionalComponent, PropType } from 'vue'; +import type { CSSProperties, FunctionalComponent, PropType } from 'vue'; interface FillerProps { prefixCls?: string; diff --git a/components/vc-virtual-list/Item.tsx b/components/vc-virtual-list/Item.tsx index 863ac2dfee..cee01ed448 100644 --- a/components/vc-virtual-list/Item.tsx +++ b/components/vc-virtual-list/Item.tsx @@ -1,4 +1,5 @@ -import { cloneVNode, FunctionalComponent, PropType } from 'vue'; +import type { FunctionalComponent, PropType } from 'vue'; +import { cloneVNode } from 'vue'; export interface ItemProps { setRef: (element: HTMLElement) => void; diff --git a/components/vc-virtual-list/List.tsx b/components/vc-virtual-list/List.tsx index f1f42249af..a2a5b81c3d 100644 --- a/components/vc-virtual-list/List.tsx +++ b/components/vc-virtual-list/List.tsx @@ -1,17 +1,15 @@ +import type { PropType, Component, CSSProperties } from 'vue'; import { ref, defineComponent, - PropType, watchEffect, - Component, computed, nextTick, onBeforeUnmount, reactive, - CSSProperties, watch, } from 'vue'; -import { Key } from '../_util/type'; +import type { Key } from '../_util/type'; import Filler from './Filler'; import Item from './Item'; import ScrollBar from './ScrollBar'; @@ -22,7 +20,7 @@ import useMobileTouchMove from './hooks/useMobileTouchMove'; import useOriginScroll from './hooks/useOriginScroll'; import PropTypes from '../_util/vue-types'; import classNames from '../_util/classNames'; -import { RenderFunc, SharedConfig } from './interface'; +import type { RenderFunc, SharedConfig } from './interface'; import supportsPassive from '../_util/supportsPassive'; const EMPTY_DATA = []; diff --git a/components/vc-virtual-list/ScrollBar.tsx b/components/vc-virtual-list/ScrollBar.tsx index 1eb6d3bbb3..b50bd06fae 100644 --- a/components/vc-virtual-list/ScrollBar.tsx +++ b/components/vc-virtual-list/ScrollBar.tsx @@ -1,4 +1,5 @@ -import { defineComponent, PropType, reactive } from 'vue'; +import type { PropType } from 'vue'; +import { defineComponent, reactive } from 'vue'; import classNames from '../_util/classNames'; import createRef from '../_util/createRef'; import raf from '../_util/raf'; diff --git a/components/vc-virtual-list/hooks/useFrameWheel.ts b/components/vc-virtual-list/hooks/useFrameWheel.ts index ef02e4a188..78a9b6ebd3 100644 --- a/components/vc-virtual-list/hooks/useFrameWheel.ts +++ b/components/vc-virtual-list/hooks/useFrameWheel.ts @@ -1,4 +1,4 @@ -import { Ref } from 'vue'; +import type { Ref } from 'vue'; import raf from '../../_util/raf'; import isFF from '../utils/isFirefox'; import useOriginScroll from './useOriginScroll'; diff --git a/components/vc-virtual-list/hooks/useHeights.tsx b/components/vc-virtual-list/hooks/useHeights.tsx index e71916263b..10313de09a 100644 --- a/components/vc-virtual-list/hooks/useHeights.tsx +++ b/components/vc-virtual-list/hooks/useHeights.tsx @@ -1,5 +1,6 @@ -import { reactive, VNodeProps } from 'vue'; -import { GetKey } from '../interface'; +import type { VNodeProps } from 'vue'; +import { reactive } from 'vue'; +import type { GetKey } from '../interface'; type CacheMap = Record; diff --git a/components/vc-virtual-list/hooks/useMobileTouchMove.ts b/components/vc-virtual-list/hooks/useMobileTouchMove.ts index d4eca84f7b..ba10fd6f4d 100644 --- a/components/vc-virtual-list/hooks/useMobileTouchMove.ts +++ b/components/vc-virtual-list/hooks/useMobileTouchMove.ts @@ -1,5 +1,6 @@ import supportsPassive from '../../_util/supportsPassive'; -import { watch, Ref, onMounted } from 'vue'; +import type { Ref } from 'vue'; +import { watch, onMounted } from 'vue'; const SMOOTH_PTG = 14 / 15; diff --git a/components/vc-virtual-list/hooks/useOriginScroll.ts b/components/vc-virtual-list/hooks/useOriginScroll.ts index 84f96966b6..c3cbf6bff3 100644 --- a/components/vc-virtual-list/hooks/useOriginScroll.ts +++ b/components/vc-virtual-list/hooks/useOriginScroll.ts @@ -1,4 +1,4 @@ -import { Ref } from 'vue'; +import type { Ref } from 'vue'; export default (isScrollAtTop: Ref, isScrollAtBottom: Ref) => { // Do lock for a wheel when scrolling diff --git a/components/vc-virtual-list/hooks/useScrollTo.tsx b/components/vc-virtual-list/hooks/useScrollTo.tsx index 24d68ff745..2252c8be32 100644 --- a/components/vc-virtual-list/hooks/useScrollTo.tsx +++ b/components/vc-virtual-list/hooks/useScrollTo.tsx @@ -1,7 +1,7 @@ -import { Data } from '../../_util/type'; -import { ComputedRef, Ref } from 'vue'; +import type { Data } from '../../_util/type'; +import type { ComputedRef, Ref } from 'vue'; import raf from '../../_util/raf'; -import { GetKey } from '../interface'; +import type { GetKey } from '../interface'; export default function useScrollTo( containerRef: Ref, diff --git a/components/vc-virtual-list/interface.ts b/components/vc-virtual-list/interface.ts index 863b5d153e..8761b98396 100644 --- a/components/vc-virtual-list/interface.ts +++ b/components/vc-virtual-list/interface.ts @@ -1,5 +1,5 @@ -import { CSSProperties, VNodeTypes } from 'vue'; -import { Key } from '../_util/type'; +import type { CSSProperties, VNodeTypes } from 'vue'; +import type { Key } from '../_util/type'; export type RenderFunc = ( item: T,