Skip to content

Commit

Permalink
refactor: transition
Browse files Browse the repository at this point in the history
  • Loading branch information
tangjinzhou committed Jun 21, 2024
1 parent 35d5185 commit 2666cb7
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 24 deletions.
6 changes: 2 additions & 4 deletions components/_util/transition.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type {
TransitionGroupProps,
TransitionProps,
} from 'vue';
import { nextTick, Transition, TransitionGroup } from 'vue';
import { nextTick } from 'vue';
import { tuple } from './type';

const SelectPlacements = tuple('bottomLeft', 'bottomRight', 'topLeft', 'topRight');
Expand Down Expand Up @@ -126,6 +126,4 @@ const getTransitionName = (rootPrefixCls: string, motion: string, transitionName
return `${rootPrefixCls}-${motion}`;
};

export { Transition, TransitionGroup, collapseMotion, getTransitionName, getTransitionDirection };

export default Transition;
export { collapseMotion, getTransitionName, getTransitionDirection };
4 changes: 2 additions & 2 deletions components/alert/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { CSSProperties, ExtractPropTypes, PropType } from 'vue';
import { computed, defineComponent, shallowRef } from 'vue';
import { computed, defineComponent, shallowRef, Transition } 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';
Expand All @@ -11,7 +11,7 @@ import InfoCircleFilled from '@ant-design/icons-vue/InfoCircleFilled';
import CloseCircleFilled from '@ant-design/icons-vue/CloseCircleFilled';
import classNames from '../_util/classNames';
import PropTypes from '../_util/vue-types';
import { getTransitionProps, Transition } from '../_util/transition';
import { getTransitionProps } from '../_util/transition';
import { isValidElement } from '../_util/props-util';
import { tuple, withInstall } from '../_util/type';
import { cloneElement } from '../_util/vnode';
Expand Down
4 changes: 2 additions & 2 deletions components/badge/Badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import ScrollNumber from './ScrollNumber';
import classNames from '../_util/classNames';
import { getPropsSlot, flattenChildren } from '../_util/props-util';
import { cloneElement } from '../_util/vnode';
import { getTransitionProps, Transition } from '../_util/transition';
import { getTransitionProps } from '../_util/transition';
import type { ExtractPropTypes, CSSProperties, PropType } from 'vue';
import { defineComponent, computed, ref, watch } from 'vue';
import { defineComponent, computed, ref, watch, Transition } from 'vue';
import Ribbon from './Ribbon';
import useConfigInject from '../config-provider/hooks/useConfigInject';
import isNumeric from '../_util/isNumeric';
Expand Down
3 changes: 1 addition & 2 deletions components/button/LoadingIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { defineComponent, nextTick } from 'vue';
import { defineComponent, nextTick, Transition } from 'vue';
import LoadingOutlined from '@ant-design/icons-vue/LoadingOutlined';
import Transition from '../_util/transition';
const getCollapsedWidth = (node: HTMLSpanElement) => {
if (node) {
node.style.width = '0px';
Expand Down
3 changes: 1 addition & 2 deletions components/collapse/CollapsePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import PanelContent from './PanelContent';
import { initDefaultProps } from '../_util/props-util';
import { collapsePanelProps } from './commonProps';
import type { ExtractPropTypes } from 'vue';
import { defineComponent } from 'vue';
import Transition from '../_util/transition';
import { defineComponent, Transition } from 'vue';
import classNames from '../_util/classNames';
import devWarning from '../vc-util/devWarning';
import useConfigInject from '../config-provider/hooks/useConfigInject';
Expand Down
3 changes: 2 additions & 1 deletion components/float-button/BackTop.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import VerticalAlignTopOutlined from '@ant-design/icons-vue/VerticalAlignTopOutlined';
import { getTransitionProps, Transition } from '../_util/transition';
import { getTransitionProps } from '../_util/transition';
import {
defineComponent,
nextTick,
Expand All @@ -10,6 +10,7 @@ import {
ref,
watch,
onDeactivated,
Transition,
} from 'vue';
import FloatButton, { floatButtonPrefixCls } from './FloatButton';
import useConfigInject from '../config-provider/hooks/useConfigInject';
Expand Down
4 changes: 2 additions & 2 deletions components/float-button/FloatButtonGroup.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { defineComponent, ref, computed, watch, onBeforeUnmount } from 'vue';
import { defineComponent, ref, computed, watch, onBeforeUnmount, Transition } from 'vue';
import CloseOutlined from '@ant-design/icons-vue/CloseOutlined';
import FileTextOutlined from '@ant-design/icons-vue/FileTextOutlined';
import classNames from '../_util/classNames';
import { getTransitionProps, Transition } from '../_util/transition';
import { getTransitionProps } from '../_util/transition';
import FloatButton, { floatButtonPrefixCls } from './FloatButton';
import useConfigInject from '../config-provider/hooks/useConfigInject';
import { useProvideFloatButtonGroupContext } from './context';
Expand Down
3 changes: 1 addition & 2 deletions components/menu/src/InlineSubMenuList.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { computed, defineComponent, ref, watch } from 'vue';
import Transition from '../../_util/transition';
import { computed, Transition, defineComponent, ref, watch } from 'vue';
import { useInjectMenu, MenuContextProvider } from './hooks/useMenuContext';
import type { MenuMode } from './interface';
import SubMenuList from './SubMenuList';
Expand Down
12 changes: 10 additions & 2 deletions components/upload/UploadList/ListItem.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
import { computed, defineComponent, onBeforeUnmount, onMounted, shallowRef, watch } from 'vue';
import {
computed,
defineComponent,
onBeforeUnmount,
onMounted,
shallowRef,
watch,
Transition,
} from 'vue';
import type { ExtractPropTypes, CSSProperties } from 'vue';
import EyeOutlined from '@ant-design/icons-vue/EyeOutlined';
import DeleteOutlined from '@ant-design/icons-vue/DeleteOutlined';
Expand All @@ -15,7 +23,7 @@ import type {
} from '../interface';
import type { VueNode } from '../../_util/type';
import useConfigInject from '../../config-provider/hooks/useConfigInject';
import Transition, { getTransitionProps } from '../../_util/transition';
import { getTransitionProps } from '../../_util/transition';
import { booleanType, stringType, functionType, arrayType, objectType } from '../../_util/type';

export const listItemProps = () => {
Expand Down
3 changes: 2 additions & 1 deletion components/upload/UploadList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ import {
onMounted,
shallowRef,
watchEffect,
TransitionGroup,
} from 'vue';
import { filterEmpty, initDefaultProps, isValidElement } from '../../_util/props-util';
import type { VueNode } from '../../_util/type';
import useConfigInject from '../../config-provider/hooks/useConfigInject';
import { getTransitionGroupProps, TransitionGroup } from '../../_util/transition';
import { getTransitionGroupProps } from '../../_util/transition';
import collapseMotion from '../../_util/collapseMotion';

const HackSlot = (_, { slots }) => {
Expand Down
4 changes: 2 additions & 2 deletions components/vc-dialog/Content.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { CSSProperties, PropType } from 'vue';
import { computed, ref, defineComponent, nextTick } from 'vue';
import { Transition, computed, ref, defineComponent, nextTick } from 'vue';
import type { MouseEventHandler } from '../_util/EventInterface';
import Transition, { getTransitionProps } from '../_util/transition';
import { getTransitionProps } from '../_util/transition';
import dialogPropTypes from './IDialogPropTypes';
import { offset } from './util';
const sentinelStyle = { width: 0, height: 0, overflow: 'hidden', outline: 'none' };
Expand Down
4 changes: 2 additions & 2 deletions components/vc-dialog/Mask.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineComponent } from 'vue';
import Transition, { getTransitionProps } from '../_util/transition';
import { defineComponent, Transition } from 'vue';
import { getTransitionProps } from '../_util/transition';

export default defineComponent({
compatConfig: { MODE: 3 },
Expand Down

0 comments on commit 2666cb7

Please sign in to comment.