Skip to content

Commit

Permalink
refactor: move common utils (#4969)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangpaopao0609 authored Jan 26, 2025
1 parent 0c8b4b1 commit 7604cdd
Show file tree
Hide file tree
Showing 17 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/components/anchor/anchor-target.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineComponent } from 'vue';
import { FileCopyIcon as TdFileCopyIcon } from 'tdesign-icons-vue-next';
import { copyText } from '../utils/clipboard';
import { copyText } from '../../utils/clipboard';
import Message from '../message/plugin';
import props from './anchor-target-props';
import Popup from '../popup';
Expand Down
2 changes: 1 addition & 1 deletion packages/components/dropdown/dropdown-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import dropdownItemProps from './dropdown-item-props';
import useRipple from '../hooks/useRipple';
import { useContent, useTNodeJSX } from '../hooks/tnode';
import { usePrefixClass } from '../hooks/useConfig';
import { pxCompat } from '../utils/helper';
import { pxCompat } from '../../utils/helper';

export default defineComponent({
name: 'TDropdownItem',
Expand Down
2 changes: 1 addition & 1 deletion packages/components/form/form-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ import {

import { useConfig, usePrefixClass, useTNodeJSX } from '../hooks';
import { useGlobalIcon } from '../hooks/useGlobalIcon';
import template from '../utils/string-template';
import template from '../../utils/string-template';

export type FormItemValidateResult<T extends Data = Data> = { [key in keyof T]: boolean | AllValidateResult[] };

Expand Down
2 changes: 1 addition & 1 deletion packages/components/grid/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { isObject } from 'lodash-es';
import { isArray } from 'lodash-es';

import { TdColProps, TdRowProps } from './type';
import { calcSize } from '../utils/responsive';
import { calcSize } from '../../utils/responsive';
import { useListener } from '../hooks/useListener';
import { isServer } from '../utils/dom';

Expand Down
2 changes: 1 addition & 1 deletion packages/components/hooks/useRipple.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ref, onMounted, onUnmounted, Ref } from 'vue';
import useKeepAnimation from './useKeepAnimation';
import { usePrefixClass } from './useConfig';
import setStyle from '../utils/set-style';
import setStyle from '../../utils/set-style';

const period = 200;
const noneRippleBg = 'rgba(0, 0, 0, 0)';
Expand Down
2 changes: 1 addition & 1 deletion packages/components/progress/progress.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
ErrorIcon as TdErrorIcon,
} from 'tdesign-icons-vue-next';

import { getBackgroundColor } from '../utils/helper';
import { getBackgroundColor } from '../../utils/helper';
import { PRO_THEME, CIRCLE_SIZE, CIRCLE_SIZE_PX, STATUS_ICON, CIRCLE_FONT_SIZE_RATIO } from './constants';
import props from './props';
import { usePrefixClass } from '../hooks/useConfig';
Expand Down
2 changes: 1 addition & 1 deletion packages/components/radio/radio-button.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { computed, defineComponent, provide, reactive } from 'vue';
import props from './props';
import Radio from './radio';
import { omit } from '../utils/helper';
import { omit } from '../../utils/helper';
import { RadioButtonInjectionKey } from './constants';

import { useContent } from '../hooks/tnode';
Expand Down
2 changes: 1 addition & 1 deletion packages/components/radio/radio.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineComponent, inject, toRefs, computed, ref } from 'vue';
import { usePrefixClass, useCommonClassName } from '../hooks/useConfig';
import { omit } from '../utils/helper';
import { omit } from '../../utils/helper';
import props from './props';
import { RadioGroupInjectionKey, RadioButtonInjectionKey } from './constants';

Expand Down
2 changes: 1 addition & 1 deletion packages/components/textarea/textarea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
import { merge } from 'lodash-es';
import { isUndefined } from 'lodash-es';

import { omit } from '../utils/helper';
import { omit } from '../../utils/helper';
import calcTextareaHeight from './calcTextareaHeight';
import { FormItemInjectionKey } from '../form/const';
import setStyle from '../../common/js/utils/set-style';
Expand Down
2 changes: 1 addition & 1 deletion packages/components/utils/dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import raf from 'raf';
import { isString } from 'lodash-es';
import { isFunction } from 'lodash-es';
import { isArray } from 'lodash-es';
import { easeInOutCubic, EasingFunction } from './easing';
import { easeInOutCubic, EasingFunction } from '../../utils/easing';
import { ScrollContainer, ScrollContainerElement } from '../common';

export const isServer = typeof window === 'undefined';
Expand Down
2 changes: 1 addition & 1 deletion packages/components/utils/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ComponentPublicInstance } from 'vue';
import { isFunction } from 'lodash-es';
import { isString } from 'lodash-es';

import { getPropsApiByEvent } from './helper';
import { getPropsApiByEvent } from '../../utils/helper';
export type EmitEventName = { event: string; method: string } | string;

/**
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 7604cdd

Please sign in to comment.