Skip to content

Commit dd6d296

Browse files
committed
chore: use common utils
1 parent 6c649e5 commit dd6d296

File tree

6 files changed

+19
-79
lines changed

6 files changed

+19
-79
lines changed

packages/components/slider/hooks/useSliderMark.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
import { computed, VNode, Ref } from 'vue';
2-
import { isArray, cloneDeep } from 'lodash-es';
3-
import { SliderMarks } from '../type';
4-
import { TNode } from '../../common';
1+
import { computed, Ref, VNode } from 'vue';
2+
import { cloneDeep, isArray } from 'lodash-es';
3+
54
import log from '@tdesign/common-js/log/log';
6-
import { getStopStyle } from '../utils';
5+
import { getStopStyle } from '@tdesign/common-js/slider/utils';
76
import TSliderMark from '../slider-mark';
87

8+
import type { TNode } from '../../common';
9+
import type { SliderMarks } from '../type';
10+
911
interface MarkItem {
1012
point: number;
1113
position: number;

packages/components/slider/hooks/useSliderTooltip.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
import { TooltipProps } from '../../tooltip';
2-
import { ref, computed, ComputedRef, Ref } from 'vue';
3-
import { TdSliderProps } from '../type';
4-
import { formatLabel } from '../utils';
1+
import { computed, ComputedRef, ref, Ref } from 'vue';
2+
3+
import { formatLabel } from '@tdesign/common-js/slider/utils';
54
import { useTNodeJSX } from '@tdesign/shared-hooks';
65

6+
import type { TooltipProps } from '../../tooltip';
7+
import type { TdSliderProps } from '../type';
8+
79
const initialProps: TooltipProps & { overlayClassName: string } = {
810
visible: false,
911
trigger: 'hover',

packages/components/slider/slider-button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ import {
1111
} from 'vue';
1212
import { isFunction } from 'lodash-es';
1313

14+
import { formatPrecision } from '@tdesign/common-js/slider/utils';
1415
import { usePrefixClass } from '@tdesign/shared-hooks';
1516
import TTooltip from '../tooltip/index';
1617
import { sliderPropsInjectKey } from './consts';
1718
import { useSliderTooltip } from './hooks/useSliderTooltip';
18-
import { formatPrecision } from './utils';
1919

2020
import type { TdSliderProps } from './type';
2121

packages/components/slider/slider.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,14 @@ import {
1212
} from 'vue';
1313
import { isArray, isNumber } from 'lodash-es';
1414

15-
import props from './props';
16-
import TSliderButton from './slider-button';
17-
18-
// hooks
15+
import { formatPrecision, formatSliderValue, getStopStyle } from '@tdesign/common-js/slider/utils';
1916
import { useCommonClassName, useDisabled, usePrefixClass, useVModel } from '@tdesign/shared-hooks';
17+
2018
import { sliderPropsInjectKey } from './consts';
2119
import { useSliderInput } from './hooks/useSliderInput';
2220
import { useSliderMark } from './hooks/useSliderMark';
23-
import { formatPrecision, formatSliderValue, getStopStyle } from './utils';
21+
import props from './props';
22+
import TSliderButton from './slider-button';
2423

2524
import type { SliderValue } from './type';
2625

packages/components/slider/utils/index.ts

Lines changed: 0 additions & 63 deletions
This file was deleted.

0 commit comments

Comments
 (0)