Browse Source

refactor: transition

pull/7681/head^2
tangjinzhou 5 months ago
parent
commit
2666cb79ab
  1. 6
      components/_util/transition.tsx
  2. 4
      components/alert/index.tsx
  3. 4
      components/badge/Badge.tsx
  4. 3
      components/button/LoadingIcon.tsx
  5. 3
      components/collapse/CollapsePanel.tsx
  6. 3
      components/float-button/BackTop.tsx
  7. 4
      components/float-button/FloatButtonGroup.tsx
  8. 3
      components/menu/src/InlineSubMenuList.tsx
  9. 12
      components/upload/UploadList/ListItem.tsx
  10. 3
      components/upload/UploadList/index.tsx
  11. 4
      components/vc-dialog/Content.tsx
  12. 4
      components/vc-dialog/Mask.tsx

6
components/_util/transition.tsx

@ -5,7 +5,7 @@ import type {
TransitionGroupProps, TransitionGroupProps,
TransitionProps, TransitionProps,
} from 'vue'; } from 'vue';
import { nextTick, Transition, TransitionGroup } from 'vue'; import { nextTick } from 'vue';
import { tuple } from './type'; import { tuple } from './type';
const SelectPlacements = tuple('bottomLeft', 'bottomRight', 'topLeft', 'topRight'); const SelectPlacements = tuple('bottomLeft', 'bottomRight', 'topLeft', 'topRight');
@ -126,6 +126,4 @@ const getTransitionName = (rootPrefixCls: string, motion: string, transitionName
return `${rootPrefixCls}-${motion}`; return `${rootPrefixCls}-${motion}`;
}; };
export { Transition, TransitionGroup, collapseMotion, getTransitionName, getTransitionDirection }; export { collapseMotion, getTransitionName, getTransitionDirection };
export default Transition;

4
components/alert/index.tsx

@ -1,5 +1,5 @@
import type { CSSProperties, ExtractPropTypes, PropType } from 'vue'; 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 CloseOutlined from '@ant-design/icons-vue/CloseOutlined';
import CheckCircleOutlined from '@ant-design/icons-vue/CheckCircleOutlined'; import CheckCircleOutlined from '@ant-design/icons-vue/CheckCircleOutlined';
import ExclamationCircleOutlined from '@ant-design/icons-vue/ExclamationCircleOutlined'; import ExclamationCircleOutlined from '@ant-design/icons-vue/ExclamationCircleOutlined';
@ -11,7 +11,7 @@ import InfoCircleFilled from '@ant-design/icons-vue/InfoCircleFilled';
import CloseCircleFilled from '@ant-design/icons-vue/CloseCircleFilled'; import CloseCircleFilled from '@ant-design/icons-vue/CloseCircleFilled';
import classNames from '../_util/classNames'; import classNames from '../_util/classNames';
import PropTypes from '../_util/vue-types'; import PropTypes from '../_util/vue-types';
import { getTransitionProps, Transition } from '../_util/transition'; import { getTransitionProps } from '../_util/transition';
import { isValidElement } from '../_util/props-util'; import { isValidElement } from '../_util/props-util';
import { tuple, withInstall } from '../_util/type'; import { tuple, withInstall } from '../_util/type';
import { cloneElement } from '../_util/vnode'; import { cloneElement } from '../_util/vnode';

4
components/badge/Badge.tsx

@ -3,9 +3,9 @@ import ScrollNumber from './ScrollNumber';
import classNames from '../_util/classNames'; import classNames from '../_util/classNames';
import { getPropsSlot, flattenChildren } from '../_util/props-util'; import { getPropsSlot, flattenChildren } from '../_util/props-util';
import { cloneElement } from '../_util/vnode'; import { cloneElement } from '../_util/vnode';
import { getTransitionProps, Transition } from '../_util/transition'; import { getTransitionProps } from '../_util/transition';
import type { ExtractPropTypes, CSSProperties, PropType } from 'vue'; 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 Ribbon from './Ribbon';
import useConfigInject from '../config-provider/hooks/useConfigInject'; import useConfigInject from '../config-provider/hooks/useConfigInject';
import isNumeric from '../_util/isNumeric'; import isNumeric from '../_util/isNumeric';

3
components/button/LoadingIcon.tsx

@ -1,6 +1,5 @@
import { defineComponent, nextTick } from 'vue'; import { defineComponent, nextTick, Transition } from 'vue';
import LoadingOutlined from '@ant-design/icons-vue/LoadingOutlined'; import LoadingOutlined from '@ant-design/icons-vue/LoadingOutlined';
import Transition from '../_util/transition';
const getCollapsedWidth = (node: HTMLSpanElement) => { const getCollapsedWidth = (node: HTMLSpanElement) => {
if (node) { if (node) {
node.style.width = '0px'; node.style.width = '0px';

3
components/collapse/CollapsePanel.tsx

@ -2,8 +2,7 @@ import PanelContent from './PanelContent';
import { initDefaultProps } from '../_util/props-util'; import { initDefaultProps } from '../_util/props-util';
import { collapsePanelProps } from './commonProps'; import { collapsePanelProps } from './commonProps';
import type { ExtractPropTypes } from 'vue'; import type { ExtractPropTypes } from 'vue';
import { defineComponent } from 'vue'; import { defineComponent, Transition } from 'vue';
import Transition from '../_util/transition';
import classNames from '../_util/classNames'; import classNames from '../_util/classNames';
import devWarning from '../vc-util/devWarning'; import devWarning from '../vc-util/devWarning';
import useConfigInject from '../config-provider/hooks/useConfigInject'; import useConfigInject from '../config-provider/hooks/useConfigInject';

3
components/float-button/BackTop.tsx

@ -1,5 +1,5 @@
import VerticalAlignTopOutlined from '@ant-design/icons-vue/VerticalAlignTopOutlined'; import VerticalAlignTopOutlined from '@ant-design/icons-vue/VerticalAlignTopOutlined';
import { getTransitionProps, Transition } from '../_util/transition'; import { getTransitionProps } from '../_util/transition';
import { import {
defineComponent, defineComponent,
nextTick, nextTick,
@ -10,6 +10,7 @@ import {
ref, ref,
watch, watch,
onDeactivated, onDeactivated,
Transition,
} from 'vue'; } from 'vue';
import FloatButton, { floatButtonPrefixCls } from './FloatButton'; import FloatButton, { floatButtonPrefixCls } from './FloatButton';
import useConfigInject from '../config-provider/hooks/useConfigInject'; import useConfigInject from '../config-provider/hooks/useConfigInject';

4
components/float-button/FloatButtonGroup.tsx

@ -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 CloseOutlined from '@ant-design/icons-vue/CloseOutlined';
import FileTextOutlined from '@ant-design/icons-vue/FileTextOutlined'; import FileTextOutlined from '@ant-design/icons-vue/FileTextOutlined';
import classNames from '../_util/classNames'; import classNames from '../_util/classNames';
import { getTransitionProps, Transition } from '../_util/transition'; import { getTransitionProps } from '../_util/transition';
import FloatButton, { floatButtonPrefixCls } from './FloatButton'; import FloatButton, { floatButtonPrefixCls } from './FloatButton';
import useConfigInject from '../config-provider/hooks/useConfigInject'; import useConfigInject from '../config-provider/hooks/useConfigInject';
import { useProvideFloatButtonGroupContext } from './context'; import { useProvideFloatButtonGroupContext } from './context';

3
components/menu/src/InlineSubMenuList.tsx

@ -1,5 +1,4 @@
import { computed, defineComponent, ref, watch } from 'vue'; import { computed, Transition, defineComponent, ref, watch } from 'vue';
import Transition from '../../_util/transition';
import { useInjectMenu, MenuContextProvider } from './hooks/useMenuContext'; import { useInjectMenu, MenuContextProvider } from './hooks/useMenuContext';
import type { MenuMode } from './interface'; import type { MenuMode } from './interface';
import SubMenuList from './SubMenuList'; import SubMenuList from './SubMenuList';

12
components/upload/UploadList/ListItem.tsx

@ -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 type { ExtractPropTypes, CSSProperties } from 'vue';
import EyeOutlined from '@ant-design/icons-vue/EyeOutlined'; import EyeOutlined from '@ant-design/icons-vue/EyeOutlined';
import DeleteOutlined from '@ant-design/icons-vue/DeleteOutlined'; import DeleteOutlined from '@ant-design/icons-vue/DeleteOutlined';
@ -15,7 +23,7 @@ import type {
} from '../interface'; } from '../interface';
import type { VueNode } from '../../_util/type'; import type { VueNode } from '../../_util/type';
import useConfigInject from '../../config-provider/hooks/useConfigInject'; 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'; import { booleanType, stringType, functionType, arrayType, objectType } from '../../_util/type';
export const listItemProps = () => { export const listItemProps = () => {

3
components/upload/UploadList/index.tsx

@ -17,11 +17,12 @@ import {
onMounted, onMounted,
shallowRef, shallowRef,
watchEffect, watchEffect,
TransitionGroup,
} from 'vue'; } from 'vue';
import { filterEmpty, initDefaultProps, isValidElement } from '../../_util/props-util'; import { filterEmpty, initDefaultProps, isValidElement } from '../../_util/props-util';
import type { VueNode } from '../../_util/type'; import type { VueNode } from '../../_util/type';
import useConfigInject from '../../config-provider/hooks/useConfigInject'; import useConfigInject from '../../config-provider/hooks/useConfigInject';
import { getTransitionGroupProps, TransitionGroup } from '../../_util/transition'; import { getTransitionGroupProps } from '../../_util/transition';
import collapseMotion from '../../_util/collapseMotion'; import collapseMotion from '../../_util/collapseMotion';
const HackSlot = (_, { slots }) => { const HackSlot = (_, { slots }) => {

4
components/vc-dialog/Content.tsx

@ -1,7 +1,7 @@
import type { CSSProperties, PropType } from 'vue'; 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 type { MouseEventHandler } from '../_util/EventInterface';
import Transition, { getTransitionProps } from '../_util/transition'; import { getTransitionProps } from '../_util/transition';
import dialogPropTypes from './IDialogPropTypes'; import dialogPropTypes from './IDialogPropTypes';
import { offset } from './util'; import { offset } from './util';
const sentinelStyle = { width: 0, height: 0, overflow: 'hidden', outline: 'none' }; const sentinelStyle = { width: 0, height: 0, overflow: 'hidden', outline: 'none' };

4
components/vc-dialog/Mask.tsx

@ -1,5 +1,5 @@
import { defineComponent } from 'vue'; import { defineComponent, Transition } from 'vue';
import Transition, { getTransitionProps } from '../_util/transition'; import { getTransitionProps } from '../_util/transition';
export default defineComponent({ export default defineComponent({
compatConfig: { MODE: 3 }, compatConfig: { MODE: 3 },

Loading…
Cancel
Save