pxd 0.0.39 → 0.0.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -3
- package/dist/components/active-graph/index.vue +10 -5
- package/dist/components/backtop/index.vue +75 -0
- package/dist/components/badge/index.vue +9 -7
- package/dist/components/book/index.vue +3 -3
- package/dist/components/browser/index.vue +2 -2
- package/dist/components/checkbox/index.vue +4 -3
- package/dist/components/checkbox-group/index.vue +1 -1
- package/dist/components/choicebox-group/index.vue +1 -1
- package/dist/components/command-menu/index.vue +124 -0
- package/dist/components/command-menu-group/index.vue +18 -0
- package/dist/components/command-menu-item/index.vue +13 -0
- package/dist/components/countdown/index.vue +2 -1
- package/dist/components/drawer/index.vue +26 -26
- package/dist/components/error/index.vue +2 -2
- package/dist/components/fader/index.vue +31 -17
- package/dist/components/grid/index.vue +2 -2
- package/dist/components/grid-item/index.vue +2 -2
- package/dist/components/hold-button/index.vue +1 -1
- package/dist/components/index.d.ts +7 -0
- package/dist/components/index.js +7 -0
- package/dist/components/input/index.vue +18 -10
- package/dist/components/intersection-observer/index.vue +5 -5
- package/dist/components/kbd/index.vue +21 -8
- package/dist/components/{intersection-observer/content.vue → keep-alive-container/index.vue} +3 -1
- package/dist/components/list/index.vue +100 -92
- package/dist/components/list-item/index.vue +35 -33
- package/dist/components/loading-bar/index.vue +149 -0
- package/dist/components/material/index.vue +8 -8
- package/dist/components/menu/index.vue +26 -16
- package/dist/components/message/index.vue +28 -18
- package/dist/components/modal/index.vue +32 -36
- package/dist/components/note/index.vue +1 -1
- package/dist/components/overlay/index.vue +77 -24
- package/dist/components/pagination/index.vue +2 -2
- package/dist/components/placeholder/index.vue +13 -6
- package/dist/components/popover/index.vue +97 -87
- package/dist/components/progress/index.vue +1 -1
- package/dist/components/radio/index.vue +4 -3
- package/dist/components/radio-group/index.vue +1 -1
- package/dist/components/scrollable/index.vue +161 -94
- package/dist/components/slider/index.vue +7 -7
- package/dist/components/stack/index.vue +4 -4
- package/dist/components/switch/index.vue +1 -1
- package/dist/components/text/index.vue +1 -1
- package/dist/components/theme-switcher/index.vue +6 -2
- package/dist/components/time-picker/index.vue +281 -0
- package/dist/components/tooltip/index.vue +7 -7
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/index.js +1 -0
- package/dist/composables/use-browser-observer.d.ts +5 -5
- package/dist/composables/use-color-scheme.d.ts +5 -1
- package/dist/composables/use-color-scheme.js +20 -1
- package/dist/composables/use-config-provider-context.d.ts +1 -1
- package/dist/composables/use-countdown.d.ts +6 -0
- package/dist/composables/use-countdown.js +21 -7
- package/dist/composables/use-delay-destroy.d.ts +4 -4
- package/dist/composables/use-delay-destroy.js +15 -11
- package/dist/composables/use-focus-trap.d.ts +2 -2
- package/dist/composables/use-focus-trap.js +6 -6
- package/dist/composables/use-loading-bar.d.ts +25 -0
- package/dist/composables/use-loading-bar.js +27 -0
- package/dist/composables/use-media-query.js +1 -1
- package/dist/composables/use-message.d.ts +4 -1
- package/dist/composables/use-message.js +18 -0
- package/dist/composables/use-pointer-gesture.d.ts +2 -2
- package/dist/composables/use-pointer-gesture.js +3 -3
- package/dist/composables/use-repeat-action.d.ts +2 -2
- package/dist/composables/use-repeat-action.js +5 -5
- package/dist/composables/use-virtual-list.d.ts +1 -1
- package/dist/contexts/avatar.d.ts +1 -1
- package/dist/contexts/carousel.d.ts +1 -1
- package/dist/contexts/checkbox.d.ts +1 -1
- package/dist/contexts/choicebox.d.ts +2 -2
- package/dist/contexts/collapse.d.ts +1 -1
- package/dist/contexts/list.d.ts +5 -6
- package/dist/contexts/list.js +3 -3
- package/dist/contexts/radio.d.ts +1 -1
- package/dist/contexts/resizable.d.ts +1 -1
- package/dist/contexts/switch.d.ts +2 -2
- package/dist/{components/carousel → dist/components/keep-alive-container}/index.vue.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/locales/en-us.d.ts +15 -7
- package/dist/locales/en-us.js +17 -9
- package/dist/locales/zh-cn.d.ts +15 -7
- package/dist/locales/zh-cn.js +17 -9
- package/dist/{components → src/components}/active-graph/index.vue.d.ts +7 -5
- package/dist/{components → src/components}/avatar-group/index.vue.d.ts +1 -1
- package/dist/src/components/backtop/index.vue.d.ts +20 -0
- package/dist/{components → src/components}/badge/index.vue.d.ts +2 -1
- package/dist/{components → src/components}/book/index.vue.d.ts +1 -1
- package/dist/{components → src/components}/browser/index.vue.d.ts +1 -1
- package/dist/{components → src/components}/button/index.vue.d.ts +1 -1
- package/dist/{components/intersection-observer/content.vue.d.ts → src/components/carousel/index.vue.d.ts} +1 -1
- package/dist/{components → src/components}/carousel-group/index.vue.d.ts +1 -1
- package/dist/{components → src/components}/chip/index.vue.d.ts +1 -1
- package/dist/{components → src/components}/choicebox/index.vue.d.ts +1 -1
- package/dist/{components → src/components}/choicebox-group/index.vue.d.ts +1 -1
- package/dist/{components → src/components}/collapse/index.vue.d.ts +1 -1
- package/dist/{components → src/components}/collapse-group/index.vue.d.ts +1 -1
- package/dist/src/components/command-menu/index.vue.d.ts +39 -0
- package/dist/src/components/command-menu-group/index.vue.d.ts +16 -0
- package/dist/src/components/command-menu-item/index.vue.d.ts +12 -0
- package/dist/{components → src/components}/config-provider/index.vue.d.ts +1 -1
- package/dist/{components → src/components}/description/index.vue.d.ts +1 -1
- package/dist/{components → src/components}/drawer/index.vue.d.ts +19 -14
- package/dist/{components → src/components}/empty-state/index.vue.d.ts +1 -1
- package/dist/{components → src/components}/error/index.vue.d.ts +1 -1
- package/dist/src/components/fader/index.vue.d.ts +11 -0
- package/dist/{components → src/components}/gauge/index.vue.d.ts +1 -1
- package/dist/{components → src/components}/grid/index.vue.d.ts +1 -1
- package/dist/{components → src/components}/grid-item/index.vue.d.ts +1 -1
- package/dist/{components → src/components}/hold-button/index.vue.d.ts +1 -1
- package/dist/{components → src/components}/input/index.vue.d.ts +9 -4
- package/dist/{components → src/components}/intersection-observer/index.vue.d.ts +3 -3
- package/dist/{components → src/components}/kbd/index.vue.d.ts +8 -5
- package/dist/src/components/keep-alive-container/index.vue.d.ts +12 -0
- package/dist/{components → src/components}/link-button/index.vue.d.ts +1 -1
- package/dist/src/components/list/index.vue.d.ts +40 -0
- package/dist/{components → src/components}/list-item/index.vue.d.ts +4 -4
- package/dist/src/components/loading-bar/index.vue.d.ts +14 -0
- package/dist/{components → src/components}/loading-dots/index.vue.d.ts +1 -1
- package/dist/{components → src/components}/material/index.vue.d.ts +1 -1
- package/dist/{components → src/components}/menu/index.vue.d.ts +11 -7
- package/dist/{components → src/components}/message/index.vue.d.ts +13 -13
- package/dist/{components → src/components}/modal/index.vue.d.ts +19 -14
- package/dist/{components → src/components}/more-button/index.vue.d.ts +1 -1
- package/dist/{components → src/components}/note/index.vue.d.ts +1 -1
- package/dist/{components → src/components}/number-input/index.vue.d.ts +1 -1
- package/dist/{components → src/components}/overlay/index.vue.d.ts +3 -4
- package/dist/{components → src/components}/pagination/index.vue.d.ts +1 -1
- package/dist/{components → src/components}/pin-input/index.vue.d.ts +1 -1
- package/dist/src/components/placeholder/index.vue.d.ts +9 -0
- package/dist/{components → src/components}/popover/index.vue.d.ts +10 -8
- package/dist/{components → src/components}/progress/index.vue.d.ts +1 -1
- package/dist/{components → src/components}/radio/index.vue.d.ts +1 -1
- package/dist/{components → src/components}/radio-group/index.vue.d.ts +1 -1
- package/dist/{components → src/components}/resizable/index.vue.d.ts +1 -1
- package/dist/src/components/resizable-handle/index.vue.d.ts +2 -0
- package/dist/{components → src/components}/resizable-panel/index.vue.d.ts +1 -1
- package/dist/{components → src/components}/skeleton/index.vue.d.ts +1 -1
- package/dist/{components → src/components}/slider/index.vue.d.ts +1 -1
- package/dist/{components → src/components}/snippet/index.vue.d.ts +1 -1
- package/dist/src/components/spinner/index.vue.d.ts +2 -0
- package/dist/{components → src/components}/stack/index.vue.d.ts +1 -1
- package/dist/{components → src/components}/status-dot/index.vue.d.ts +1 -1
- package/dist/{components → src/components}/switch/index.vue.d.ts +1 -1
- package/dist/{components → src/components}/switch-group/index.vue.d.ts +1 -1
- package/dist/{components → src/components}/teleport/index.vue.d.ts +1 -1
- package/dist/{components → src/components}/text/index.vue.d.ts +1 -1
- package/dist/{components → src/components}/textarea/index.vue.d.ts +1 -1
- package/dist/{components → src/components}/theme-switcher/index.vue.d.ts +1 -1
- package/dist/src/components/time-picker/index.vue.d.ts +25 -0
- package/dist/{components → src/components}/toggle/index.vue.d.ts +1 -1
- package/dist/{components → src/components}/tooltip/index.vue.d.ts +3 -5
- package/dist/{components → src/components}/virtual-list/index.vue.d.ts +1 -1
- package/dist/src/composables/use-browser-observer.d.ts +12 -0
- package/dist/src/composables/use-color-scheme.d.ts +11 -0
- package/dist/src/composables/use-config-provider-context.d.ts +7 -0
- package/dist/src/composables/use-copy-click.d.ts +4 -0
- package/dist/src/composables/use-countdown.d.ts +60 -0
- package/dist/src/composables/use-delay-change.d.ts +7 -0
- package/dist/src/composables/use-delay-destroy.d.ts +13 -0
- package/dist/src/composables/use-focus-trap.d.ts +4 -0
- package/dist/src/composables/use-loading-bar.d.ts +25 -0
- package/dist/src/composables/use-media-query.d.ts +15 -0
- package/dist/src/composables/use-message.d.ts +33 -0
- package/dist/src/composables/use-model-value.d.ts +11 -0
- package/dist/src/composables/use-pointer-gesture.d.ts +180 -0
- package/dist/src/composables/use-repeat-action.d.ts +16 -0
- package/dist/src/composables/use-unique-id-context.d.ts +2 -0
- package/dist/src/composables/use-virtual-list.d.ts +16 -0
- package/dist/src/contexts/avatar.d.ts +2 -0
- package/dist/src/contexts/carousel.d.ts +13 -0
- package/dist/src/contexts/checkbox.d.ts +2 -0
- package/dist/src/contexts/choicebox.d.ts +4 -0
- package/dist/src/contexts/collapse.d.ts +8 -0
- package/dist/src/contexts/list.d.ts +8 -0
- package/dist/src/contexts/radio.d.ts +2 -0
- package/dist/src/contexts/resizable.d.ts +35 -0
- package/dist/src/contexts/switch.d.ts +4 -0
- package/dist/src/locales/en-us.d.ts +42 -0
- package/dist/src/plugins/dayjs-millisecond-token.d.ts +3 -0
- package/dist/src/types/components/time-picker.d.ts +4 -0
- package/dist/src/utils/context.d.ts +17 -0
- package/dist/src/utils/date.d.ts +26 -0
- package/dist/src/utils/debounce/index.d.ts +73 -0
- package/dist/src/utils/debounce.d.ts +1 -0
- package/dist/src/utils/dom.d.ts +40 -0
- package/dist/{utils/events.d.ts → src/utils/event.d.ts} +1 -0
- package/dist/src/utils/format.d.ts +25 -0
- package/dist/src/utils/get.d.ts +11 -0
- package/dist/src/utils/is.d.ts +4 -0
- package/dist/src/utils/ref.d.ts +5 -0
- package/dist/src/utils/regexp.d.ts +8 -0
- package/dist/src/utils/responsive.d.ts +3 -0
- package/dist/src/utils/throttle/index.d.ts +53 -0
- package/dist/src/utils/throttle.d.ts +1 -0
- package/dist/src/utils/uid.d.ts +1 -0
- package/dist/styles/styles.css +2 -2
- package/dist/styles/tw.css +18 -1
- package/dist/types/components/list.d.ts +4 -3
- package/dist/types/components/time-picker.d.ts +4 -0
- package/dist/types/components/time-picker.js +0 -0
- package/dist/types/shared/utils.d.ts +5 -2
- package/dist/utils/date.d.ts +3 -3
- package/dist/utils/debounce/compat.d.ts +143 -0
- package/dist/utils/debounce/compat.js +47 -0
- package/dist/utils/debounce/index.d.ts +73 -0
- package/dist/utils/debounce/index.js +60 -0
- package/dist/utils/debounce.d.ts +1 -73
- package/dist/utils/debounce.js +1 -60
- package/dist/utils/event.d.ts +9 -0
- package/dist/utils/{events.js → event.js} +3 -0
- package/dist/utils/format.d.ts +4 -1
- package/dist/utils/format.js +6 -0
- package/dist/utils/ref.d.ts +2 -5
- package/dist/utils/regexp.d.ts +4 -0
- package/dist/utils/regexp.js +4 -0
- package/dist/utils/responsive.d.ts +2 -1
- package/dist/utils/responsive.js +4 -1
- package/dist/utils/throttle/compat.d.ts +79 -0
- package/dist/utils/throttle/compat.js +9 -0
- package/dist/utils/throttle/index.d.ts +53 -0
- package/dist/utils/throttle/index.js +34 -0
- package/dist/utils/throttle.d.ts +1 -53
- package/dist/utils/throttle.js +1 -34
- package/dist/utils/uid.js +1 -1
- package/package.json +11 -11
- package/volar.d.ts +7 -0
- package/dist/components/fader/index.vue.d.ts +0 -11
- package/dist/components/list/index.vue.d.ts +0 -29
- package/dist/components/placeholder/index.vue.d.ts +0 -8
- package/dist/components/resizable-handle/index.vue.d.ts +0 -2
- package/dist/components/spinner/index.vue.d.ts +0 -2
- /package/dist/{components → src/components}/avatar/index.vue.d.ts +0 -0
- /package/dist/{components → src/components}/checkbox/index.vue.d.ts +0 -0
- /package/dist/{components → src/components}/checkbox-group/index.vue.d.ts +0 -0
- /package/dist/{components → src/components}/countdown/index.vue.d.ts +0 -0
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import type { MaybeElementRef } from '../types/shared/utils';
|
|
2
|
+
type Axis = 'x' | 'y' | 'both';
|
|
3
|
+
type Dir = 'left' | 'right' | 'up' | 'down' | null;
|
|
4
|
+
/**
|
|
5
|
+
* 速度向量。
|
|
6
|
+
* @property x - X 方向速度(px/s)
|
|
7
|
+
* @property y - Y 方向速度(px/s)
|
|
8
|
+
* @property v - 合速度(px/s)
|
|
9
|
+
*/
|
|
10
|
+
interface Velocity {
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
v: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* 对外公开的手势状态。
|
|
17
|
+
* @property isActive - 指针是否按下激活
|
|
18
|
+
* @property isDragging - 是否处于拖拽中(超过启动阈值)
|
|
19
|
+
* @property isLongPressing - 是否处于长按态
|
|
20
|
+
* @property direction - 当前判定的方向(可能为 null)
|
|
21
|
+
* @property delta - 自按下以来位移(px)
|
|
22
|
+
* @property velocity - 当前速度(px/s)
|
|
23
|
+
* @property progress - 触发进度(0~1,基于 triggerThreshold)
|
|
24
|
+
*/
|
|
25
|
+
export interface PublicState {
|
|
26
|
+
isActive: boolean;
|
|
27
|
+
isDragging: boolean;
|
|
28
|
+
isLongPressing: boolean;
|
|
29
|
+
direction: Dir;
|
|
30
|
+
delta: {
|
|
31
|
+
x: number;
|
|
32
|
+
y: number;
|
|
33
|
+
};
|
|
34
|
+
velocity: Velocity;
|
|
35
|
+
progress: number;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* usePointerGesture 的可配置项。
|
|
39
|
+
* 如未指定,均有默认值(见 OPTIONS_DEFAULTS)。
|
|
40
|
+
*/
|
|
41
|
+
export interface UsePointerGestureOptions {
|
|
42
|
+
/**
|
|
43
|
+
* 限制生效轴向。
|
|
44
|
+
* 返回 'x' | 'y' | 'both',默认为 'both'。
|
|
45
|
+
*/
|
|
46
|
+
axis?: () => Axis;
|
|
47
|
+
/**
|
|
48
|
+
* 拖拽启动阈值(px)。手指移动距离超过该值后进入拖拽。
|
|
49
|
+
* 默认 6。
|
|
50
|
+
*/
|
|
51
|
+
startThreshold?: number;
|
|
52
|
+
/**
|
|
53
|
+
* 触发阈值(px)。释放时若位移达到该值视为命中触发(kind='threshold')。
|
|
54
|
+
* 默认 80。
|
|
55
|
+
*/
|
|
56
|
+
triggerThreshold?: number;
|
|
57
|
+
/**
|
|
58
|
+
* 甩动触发速度阈值(px/s)。移动中若合速度超过该值将记录可能触发为 'fling'。
|
|
59
|
+
* 默认 1000。
|
|
60
|
+
*/
|
|
61
|
+
velocityThreshold?: number;
|
|
62
|
+
/**
|
|
63
|
+
* 长按判定时长(ms)。到达该时长后进入长按态并触发 onLongPress。
|
|
64
|
+
* 默认 300。
|
|
65
|
+
*/
|
|
66
|
+
longPressMs?: number;
|
|
67
|
+
/**
|
|
68
|
+
* 长按容忍移动距离(px)。在进入拖拽前,若移动超过该距离则取消长按。
|
|
69
|
+
* 默认 4。
|
|
70
|
+
*/
|
|
71
|
+
longPressMoveTolerance?: number;
|
|
72
|
+
/**
|
|
73
|
+
* 是否在拖拽开始时锁定轴向。开启后根据初始位移较大方向锁定为 'x' 或 'y'。
|
|
74
|
+
* 默认 true。
|
|
75
|
+
*/
|
|
76
|
+
lockDirectionOnStart?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* 是否允许在可滚动容器尚可继续滚动时将移动交由滚动,直到触达边缘才接管拖拽。
|
|
79
|
+
* 默认 true。
|
|
80
|
+
*/
|
|
81
|
+
allowScrollUntilEdge?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* 拖拽期间是否调用 preventDefault 阻止滚动。
|
|
84
|
+
* 默认 true。
|
|
85
|
+
*/
|
|
86
|
+
preventScrollOnDrag?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* 是否使用 Pointer Capture(setPointerCapture/releasePointerCapture)。
|
|
89
|
+
* 默认 true。
|
|
90
|
+
*/
|
|
91
|
+
usePointerCapture?: boolean;
|
|
92
|
+
/**
|
|
93
|
+
* RTL 支持:
|
|
94
|
+
* - 若为 boolean,true 表示水平方向取反(dx>0 视为向左);false 为自然方向
|
|
95
|
+
* - 若为函数,可根据 dx 自定义返回 'left' 或 'right'
|
|
96
|
+
* 默认 false。
|
|
97
|
+
*/
|
|
98
|
+
rtl?: boolean | ((dx: number) => 'left' | 'right');
|
|
99
|
+
/**
|
|
100
|
+
* 提供一个返回可参与滚动判断的元素(通常为最近滚动容器内的滚动元素)。
|
|
101
|
+
* 若不提供,将自动查找。
|
|
102
|
+
*/
|
|
103
|
+
getScrollable?: () => HTMLElement | null;
|
|
104
|
+
/**
|
|
105
|
+
* 指针按下时回调。
|
|
106
|
+
* @param e - PointerEvent
|
|
107
|
+
* @param ctx - 当前公开状态
|
|
108
|
+
*/
|
|
109
|
+
onStart?: (e: PointerEvent, ctx: PublicState) => void;
|
|
110
|
+
/**
|
|
111
|
+
* 指针移动时回调(拖拽中会持续触发,可用于执行动画)。
|
|
112
|
+
* @param e - PointerEvent
|
|
113
|
+
* @param ctx - 当前公开状态
|
|
114
|
+
*/
|
|
115
|
+
onMove?: (e: PointerEvent, ctx: PublicState) => void;
|
|
116
|
+
/**
|
|
117
|
+
* 指针释放时统一回调。
|
|
118
|
+
* - 命中触发条件时:hit=true,并给出方向 dir 与触发类型 kind('threshold' | 'longpress' | 'fling')
|
|
119
|
+
* - 未命中时:hit=false,dir=null,kind=null;此时会自动调用 onReset 便于复位动画
|
|
120
|
+
* @param hit - 是否命中触发
|
|
121
|
+
* @param dir - 方向(未命中为 null)
|
|
122
|
+
* @param kind - 触发类型(未命中为 null)
|
|
123
|
+
* @param ctx - 当前公开状态
|
|
124
|
+
*/
|
|
125
|
+
onRelease?: (hit: boolean, dir: Dir, kind: null | 'threshold' | 'longpress' | 'fling', ctx: PublicState) => void;
|
|
126
|
+
/**
|
|
127
|
+
* 指针生命周期结束时回调(在 onRelease 之前调用)。
|
|
128
|
+
* @param e - PointerEvent
|
|
129
|
+
* @param ctx - 当前公开状态
|
|
130
|
+
*/
|
|
131
|
+
onEnd?: (e: PointerEvent, ctx: PublicState) => void;
|
|
132
|
+
/**
|
|
133
|
+
* 手势被取消时回调(如 pointercancel 或主动 cancel)。
|
|
134
|
+
* @param e - 事件对象;由 cancel() 触发时为 null
|
|
135
|
+
* @param ctx - 当前公开状态
|
|
136
|
+
*/
|
|
137
|
+
onCancel?: (e: Event | null, ctx: PublicState) => void;
|
|
138
|
+
/**
|
|
139
|
+
* 复位回调:取消或未命中触发条件时会自动调用,便于执行复位动画。
|
|
140
|
+
* @param ctx - 当前公开状态
|
|
141
|
+
*/
|
|
142
|
+
onReset?: (ctx: PublicState) => void;
|
|
143
|
+
/**
|
|
144
|
+
* 长按回调:达到长按时长后触发。
|
|
145
|
+
* @param ctx - 当前公开状态
|
|
146
|
+
*/
|
|
147
|
+
onLongPress?: (ctx: PublicState) => void;
|
|
148
|
+
/**
|
|
149
|
+
* 指针守卫:记录后续是否需要响应事件, 只在 pointer-down 中执行一次
|
|
150
|
+
* 返回 true 表示允许,false 表示阻止触发。
|
|
151
|
+
* @param e - PointerEvent
|
|
152
|
+
*/
|
|
153
|
+
pointerGuard?: (e: PointerEvent) => boolean;
|
|
154
|
+
/**
|
|
155
|
+
* 方向守卫:在记录触发与最终释放判定处均会调用,用于限制允许的触发方向。
|
|
156
|
+
* 返回 true 表示允许,false 表示阻止触发。
|
|
157
|
+
* @param dir - 非空方向
|
|
158
|
+
* @param ctx - 当前公开状态
|
|
159
|
+
*/
|
|
160
|
+
directionGuard?: (dir: Exclude<Dir, null>, ctx: PublicState) => boolean;
|
|
161
|
+
}
|
|
162
|
+
export declare function usePointerGesture(container: MaybeElementRef<HTMLElement>, options?: UsePointerGestureOptions): {
|
|
163
|
+
isActive: import("vue").ShallowRef<boolean, boolean>;
|
|
164
|
+
isDragging: import("vue").ShallowRef<boolean, boolean>;
|
|
165
|
+
isLongPressing: import("vue").ShallowRef<boolean, boolean>;
|
|
166
|
+
direction: import("vue").ShallowRef<Dir, Dir>;
|
|
167
|
+
delta: import("vue").ShallowRef<{
|
|
168
|
+
x: number;
|
|
169
|
+
y: number;
|
|
170
|
+
}, {
|
|
171
|
+
x: number;
|
|
172
|
+
y: number;
|
|
173
|
+
}>;
|
|
174
|
+
velocity: import("vue").ShallowRef<Velocity, Velocity>;
|
|
175
|
+
progress: import("vue").ShallowRef<number, number>;
|
|
176
|
+
reset: () => void;
|
|
177
|
+
cancel: () => void;
|
|
178
|
+
stop: () => void;
|
|
179
|
+
};
|
|
180
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { MaybeRefOrGetter } from 'vue';
|
|
2
|
+
import type { Callback } from '../types/shared/utils';
|
|
3
|
+
interface RepeatActionReturnType {
|
|
4
|
+
start: Callback;
|
|
5
|
+
stop: Callback;
|
|
6
|
+
}
|
|
7
|
+
interface UseRepeatActionOptions {
|
|
8
|
+
action: Callback;
|
|
9
|
+
disabled?: MaybeRefOrGetter<boolean>;
|
|
10
|
+
finalInterval?: number;
|
|
11
|
+
initialInterval?: number;
|
|
12
|
+
accelerationDuration?: number;
|
|
13
|
+
}
|
|
14
|
+
export declare function useRepeatAction(action: Callback): RepeatActionReturnType;
|
|
15
|
+
export declare function useRepeatAction(options: UseRepeatActionOptions): RepeatActionReturnType;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ComponentPublicInstance } from 'vue';
|
|
2
|
+
export interface VirtualListProps {
|
|
3
|
+
dataKey?: string;
|
|
4
|
+
listData: any[];
|
|
5
|
+
itemSize: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function useVirtualList<Props extends VirtualListProps>(props: Props): {
|
|
8
|
+
containerRef: import("vue").ShallowRef<HTMLElement, HTMLElement>;
|
|
9
|
+
renderList: import("vue").ComputedRef<any[]>;
|
|
10
|
+
listHeight: import("vue").ComputedRef<number>;
|
|
11
|
+
listStyle: import("vue").ComputedRef<string>;
|
|
12
|
+
stop: () => void;
|
|
13
|
+
setItemRef: (el: Element | ComponentPublicInstance | null, key: number | string) => void;
|
|
14
|
+
updateContainerHeight: () => void;
|
|
15
|
+
getStartIndex: (scrollTop: number) => number;
|
|
16
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
import type { CarouselGroupProps } from '../types/components/carousel';
|
|
3
|
+
export interface CarouselState {
|
|
4
|
+
uid: string;
|
|
5
|
+
translateItem: (index: number, activeIndex: number) => void;
|
|
6
|
+
}
|
|
7
|
+
export interface CarouselGroupContext {
|
|
8
|
+
props: CarouselGroupProps;
|
|
9
|
+
carousels: Ref<CarouselState[]>;
|
|
10
|
+
registerCarousel: (state: CarouselState) => void;
|
|
11
|
+
unregisterCarousel: (id: string) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const provideCarouselGroupContext: (contextValue: CarouselGroupContext) => CarouselGroupContext, useCarouselGroupContext: ((fallback?: CarouselGroupContext) => CarouselGroupContext) & ((fallback: null) => CarouselGroupContext);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
import type { ChoiceboxGroupProps } from '../types/components/choicebox';
|
|
3
|
+
export declare const provideChoiceboxGroupContext: (contextValue: ChoiceboxGroupProps) => ChoiceboxGroupProps, useChoiceboxGroupContext: ((fallback?: ChoiceboxGroupProps) => ChoiceboxGroupProps) & ((fallback: null) => ChoiceboxGroupProps);
|
|
4
|
+
export declare const provideChoiceboxGroupModelValue: (contextValue: Ref<import("../types/shared").ComponentValue | import("../types/shared").ComponentValue[], import("../types/shared").ComponentValue | import("../types/shared").ComponentValue[]>) => Ref<import("../types/shared").ComponentValue | import("../types/shared").ComponentValue[], import("../types/shared").ComponentValue | import("../types/shared").ComponentValue[]>, useChoiceboxGroupModelValue: ((fallback?: Ref<import("../types/shared").ComponentValue | import("../types/shared").ComponentValue[], import("../types/shared").ComponentValue | import("../types/shared").ComponentValue[]>) => Ref<import("../types/shared").ComponentValue | import("../types/shared").ComponentValue[], import("../types/shared").ComponentValue | import("../types/shared").ComponentValue[]>) & ((fallback: null) => Ref<import("../types/shared").ComponentValue | import("../types/shared").ComponentValue[], import("../types/shared").ComponentValue | import("../types/shared").ComponentValue[]>);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
interface CollapseGroupContext {
|
|
3
|
+
multiple: Ref<boolean>;
|
|
4
|
+
isExpanded: (id: string) => boolean;
|
|
5
|
+
toggleItem: (id: string, expanded: boolean) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const provideCollapseGroupContext: (contextValue: CollapseGroupContext) => CollapseGroupContext, useCollapseGroupContext: ((fallback?: CollapseGroupContext) => CollapseGroupContext) & ((fallback: null) => CollapseGroupContext);
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
import type { ListOption } from '../types/components/list';
|
|
3
|
+
export interface ListContext {
|
|
4
|
+
activeValue: Ref<string>;
|
|
5
|
+
onOptionClick: ListOption['onClick'];
|
|
6
|
+
}
|
|
7
|
+
export declare const provideListContext: (contextValue: ListContext) => ListContext, useListContext: ((fallback?: ListContext) => ListContext) & ((fallback: null) => ListContext);
|
|
8
|
+
export declare const provideListFilterValue: (contextValue: Ref<string, string>) => Ref<string, string>, useListFilterValue: (fallback?: Ref<string, string>) => Ref<string, string>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
import type { ComponentDirection } from '../types/shared/props';
|
|
3
|
+
interface PanelConfig {
|
|
4
|
+
id: string;
|
|
5
|
+
order: number;
|
|
6
|
+
size?: number | null;
|
|
7
|
+
minSize?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface ResizableContext {
|
|
10
|
+
direction: Ref<ComponentDirection>;
|
|
11
|
+
panelSizes: Ref<number[]>;
|
|
12
|
+
panelConfigs: Ref<PanelConfig[]>;
|
|
13
|
+
getPanelSize: (id: string) => number;
|
|
14
|
+
onHandleDrag: (id: string, delta: {
|
|
15
|
+
deltaX: number;
|
|
16
|
+
deltaY: number;
|
|
17
|
+
}) => void;
|
|
18
|
+
resetPanels: () => void;
|
|
19
|
+
registerPanel: (config: {
|
|
20
|
+
id: string;
|
|
21
|
+
size?: number | null;
|
|
22
|
+
minSize?: number;
|
|
23
|
+
}) => void;
|
|
24
|
+
registerHandle: (config: {
|
|
25
|
+
id: string;
|
|
26
|
+
onDrag: (delta: {
|
|
27
|
+
deltaX: number;
|
|
28
|
+
deltaY: number;
|
|
29
|
+
}) => void;
|
|
30
|
+
}) => void;
|
|
31
|
+
unregisterPanel: (id: string) => void;
|
|
32
|
+
unregisterHandle: (id: string) => void;
|
|
33
|
+
}
|
|
34
|
+
export declare const provideResizableContext: (contextValue: ResizableContext) => ResizableContext, useResizableContext: ((fallback?: ResizableContext) => ResizableContext) & ((fallback: null) => ResizableContext);
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
import type { SwitchGroupProps } from './../types/components/switch';
|
|
3
|
+
export declare const provideSwitchGroupContext: (contextValue: SwitchGroupProps) => SwitchGroupProps, useSwitchGroupContext: ((fallback?: SwitchGroupProps) => SwitchGroupProps) & ((fallback: null) => SwitchGroupProps);
|
|
4
|
+
export declare const provideSwitchGroupModelValue: (contextValue: Ref<string | number, string | number>) => Ref<string | number, string | number>, useSwitchGroupModelValue: ((fallback?: Ref<string | number, string | number>) => Ref<string | number, string | number>) & ((fallback: null) => Ref<string | number, string | number>);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
date: {
|
|
3
|
+
now: string;
|
|
4
|
+
day: {
|
|
5
|
+
0: string;
|
|
6
|
+
1: string;
|
|
7
|
+
2: string;
|
|
8
|
+
3: string;
|
|
9
|
+
4: string;
|
|
10
|
+
5: string;
|
|
11
|
+
6: string;
|
|
12
|
+
};
|
|
13
|
+
month: {
|
|
14
|
+
0: string;
|
|
15
|
+
1: string;
|
|
16
|
+
2: string;
|
|
17
|
+
3: string;
|
|
18
|
+
4: string;
|
|
19
|
+
5: string;
|
|
20
|
+
6: string;
|
|
21
|
+
7: string;
|
|
22
|
+
8: string;
|
|
23
|
+
9: string;
|
|
24
|
+
10: string;
|
|
25
|
+
11: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
compare: {
|
|
29
|
+
less: string;
|
|
30
|
+
more: string;
|
|
31
|
+
next: string;
|
|
32
|
+
prev: string;
|
|
33
|
+
};
|
|
34
|
+
empty: {
|
|
35
|
+
search: string;
|
|
36
|
+
};
|
|
37
|
+
confirm: {
|
|
38
|
+
ok: string;
|
|
39
|
+
cancel: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type InjectContextStrict<T> = ((fallback?: T) => T) & ((fallback: null) => T | null);
|
|
2
|
+
/**
|
|
3
|
+
* @param providerComponentName - The name of the component providing the context.
|
|
4
|
+
*/
|
|
5
|
+
export declare function createContext<ContextValue>(providerComponentName: string): readonly [
|
|
6
|
+
(contextValue: ContextValue) => ContextValue,
|
|
7
|
+
InjectContextStrict<ContextValue>
|
|
8
|
+
];
|
|
9
|
+
export declare function createContext<ContextValue>(providerComponentName: string, fallbackValue: ContextValue): readonly [
|
|
10
|
+
(contextValue: ContextValue) => ContextValue,
|
|
11
|
+
InjectContextStrict<ContextValue>
|
|
12
|
+
];
|
|
13
|
+
export declare function createContext<ContextValue>(providerComponentName: string, fallbackValue: null): readonly [
|
|
14
|
+
(contextValue: ContextValue) => ContextValue,
|
|
15
|
+
(fallback?: ContextValue | null) => ContextValue | null
|
|
16
|
+
];
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import dayjs from 'dayjs/esm/index.js';
|
|
2
|
+
import dayjsDurationPlugin from 'dayjs/esm/plugin/duration/index.js';
|
|
3
|
+
import dayjsMillisecondTokenPlugin from '../plugins/dayjs-millisecond-token.js';
|
|
4
|
+
export { dayjs, dayjsDurationPlugin, dayjsMillisecondTokenPlugin, };
|
|
5
|
+
interface Result<T> {
|
|
6
|
+
years: number[];
|
|
7
|
+
months: number[];
|
|
8
|
+
weeks: number[];
|
|
9
|
+
dates: T[];
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 获取两个日期之间的所有日期
|
|
13
|
+
*/
|
|
14
|
+
export declare function getAllDatesBetween(startDate: Date | string, endDate: Date | string, format?: 'string'): Result<string>;
|
|
15
|
+
export declare function getAllDatesBetween(startDate: Date | string, endDate: Date | string, format?: 'object'): Result<Date>;
|
|
16
|
+
/**
|
|
17
|
+
* 获取指定年月的天数、第一天是周几、最后一天是周几
|
|
18
|
+
* @param year 年份
|
|
19
|
+
* @param month 月份
|
|
20
|
+
* @returns 天数、第一天是周几、最后一天是周几
|
|
21
|
+
*/
|
|
22
|
+
export declare function getMonthDays(year: number, month: number): {
|
|
23
|
+
days: number;
|
|
24
|
+
firstDay: 0 | 2 | 1 | 3 | 4 | 5 | 6;
|
|
25
|
+
lastDay: 0 | 2 | 1 | 3 | 4 | 5 | 6;
|
|
26
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
interface DebounceOptions {
|
|
2
|
+
/**
|
|
3
|
+
* An optional AbortSignal to cancel the debounced function.
|
|
4
|
+
*/
|
|
5
|
+
signal?: AbortSignal;
|
|
6
|
+
/**
|
|
7
|
+
* An optional array specifying whether the function should be invoked on the leading edge, trailing edge, or both.
|
|
8
|
+
* If `edges` includes "leading", the function will be invoked at the start of the delay period.
|
|
9
|
+
* If `edges` includes "trailing", the function will be invoked at the end of the delay period.
|
|
10
|
+
* If both "leading" and "trailing" are included, the function will be invoked at both the start and end of the delay period.
|
|
11
|
+
* @default ["trailing"]
|
|
12
|
+
*/
|
|
13
|
+
edges?: Array<'leading' | 'trailing'>;
|
|
14
|
+
}
|
|
15
|
+
export interface DebouncedFunction<F extends (...args: any[]) => void> {
|
|
16
|
+
(...args: Parameters<F>): void;
|
|
17
|
+
/**
|
|
18
|
+
* Schedules the execution of the debounced function after the specified debounce delay.
|
|
19
|
+
* This method resets any existing timer, ensuring that the function is only invoked
|
|
20
|
+
* after the delay has elapsed since the last call to the debounced function.
|
|
21
|
+
* It is typically called internally whenever the debounced function is invoked.
|
|
22
|
+
*
|
|
23
|
+
* @returns {void}
|
|
24
|
+
*/
|
|
25
|
+
schedule: () => void;
|
|
26
|
+
/**
|
|
27
|
+
* Cancels any pending execution of the debounced function.
|
|
28
|
+
* This method clears the active timer and resets any stored context or arguments.
|
|
29
|
+
*/
|
|
30
|
+
cancel: () => void;
|
|
31
|
+
/**
|
|
32
|
+
* Immediately invokes the debounced function if there is a pending execution.
|
|
33
|
+
* This method executes the function right away if there is a pending execution.
|
|
34
|
+
*/
|
|
35
|
+
flush: () => void;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Creates a debounced function that delays invoking the provided function until after `debounceMs` milliseconds
|
|
39
|
+
* have elapsed since the last time the debounced function was invoked. The debounced function also has a `cancel`
|
|
40
|
+
* method to cancel any pending execution.
|
|
41
|
+
*
|
|
42
|
+
* @template F - The type of function.
|
|
43
|
+
* @param {F} func - The function to debounce.
|
|
44
|
+
* @param {number} debounceMs - The number of milliseconds to delay.
|
|
45
|
+
* @param {DebounceOptions} options - The options object
|
|
46
|
+
* @param {AbortSignal} options.signal - An optional AbortSignal to cancel the debounced function.
|
|
47
|
+
* @returns A new debounced function with a `cancel` method.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* const debouncedFunction = debounce(() => {
|
|
51
|
+
* console.log('Function executed');
|
|
52
|
+
* }, 1000);
|
|
53
|
+
*
|
|
54
|
+
* // Will log 'Function executed' after 1 second if not called again in that time
|
|
55
|
+
* debouncedFunction();
|
|
56
|
+
*
|
|
57
|
+
* // Will not log anything as the previous call is canceled
|
|
58
|
+
* debouncedFunction.cancel();
|
|
59
|
+
*
|
|
60
|
+
* // With AbortSignal
|
|
61
|
+
* const controller = new AbortController();
|
|
62
|
+
* const signal = controller.signal;
|
|
63
|
+
* const debouncedWithSignal = debounce(() => {
|
|
64
|
+
* console.log('Function executed');
|
|
65
|
+
* }, 1000, { signal });
|
|
66
|
+
*
|
|
67
|
+
* debouncedWithSignal();
|
|
68
|
+
*
|
|
69
|
+
* // Will cancel the debounced function call
|
|
70
|
+
* controller.abort();
|
|
71
|
+
*/
|
|
72
|
+
export declare function debounce<F extends (...args: any[]) => void>(func: F, debounceMs: number, { signal, edges }?: DebounceOptions): DebouncedFunction<F>;
|
|
73
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './debounce/index';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { CSSProperties } from 'vue';
|
|
2
|
+
export declare function getElementRectFromContainer(elementOrRect: HTMLElement | DOMRect, containerOrRect: HTMLElement | DOMRect): {
|
|
3
|
+
top: number;
|
|
4
|
+
bottom: number;
|
|
5
|
+
left: number;
|
|
6
|
+
right: number;
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
scrollTop: number;
|
|
10
|
+
scrollBottom: number;
|
|
11
|
+
scrollLeft: number;
|
|
12
|
+
scrollRight: number;
|
|
13
|
+
};
|
|
14
|
+
export declare function getStyle(element: HTMLElement, styleNames: keyof CSSProperties | (keyof CSSProperties)[]): string[];
|
|
15
|
+
export declare function isScrollable(el: HTMLElement): {
|
|
16
|
+
x: boolean;
|
|
17
|
+
y: boolean;
|
|
18
|
+
};
|
|
19
|
+
export declare function hasScrollbar(el: HTMLElement): {
|
|
20
|
+
x: boolean;
|
|
21
|
+
y: boolean;
|
|
22
|
+
};
|
|
23
|
+
export declare function getScrollContainer(el: HTMLElement, isVertical?: boolean): Window | HTMLElement;
|
|
24
|
+
export declare function getScrollPositions(el: HTMLElement | Window | Document): {
|
|
25
|
+
scrollTop: number;
|
|
26
|
+
scrollLeft: number;
|
|
27
|
+
scrollWidth: number;
|
|
28
|
+
scrollHeight: number;
|
|
29
|
+
};
|
|
30
|
+
export declare function getScrollElByContainer(target: any): HTMLElement;
|
|
31
|
+
export interface ScrollbarSize {
|
|
32
|
+
width: number;
|
|
33
|
+
height: number;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* 获取滚动条尺寸(宽度和高度)
|
|
37
|
+
* @param element - 要测量的元素,默认为document.body
|
|
38
|
+
* @returns 包含滚动条宽度和高度的对象
|
|
39
|
+
*/
|
|
40
|
+
export declare function getScrollbarSize(element?: HTMLElement): ScrollbarSize;
|
|
@@ -5,4 +5,5 @@ export declare function off<E extends Event = Event>(el: Nullable<EventTarget>,
|
|
|
5
5
|
export declare function once<E extends Event = Event>(el: Nullable<EventTarget>, event: string, handler: EventHandler<E>, options?: AddEventListenerOptions): void;
|
|
6
6
|
export declare function optimizedOn<E extends Event = Event>(el: Nullable<EventTarget>, event: string, handler: EventHandler<E>, options?: AddEventListenerOptions): void;
|
|
7
7
|
export declare function optimizedOff<E extends Event = Event>(el: Nullable<EventTarget>, event: string, handler: EventHandler<E>, options?: AddEventListenerOptions): void;
|
|
8
|
+
export declare function sleep(ms: number): Promise<unknown>;
|
|
8
9
|
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { CSSValue, Nullable } from '../types/shared/utils';
|
|
2
|
+
/** string -> String */
|
|
3
|
+
export declare function capitalize(text: string): string;
|
|
4
|
+
/** kabab-case -> kababCase */
|
|
5
|
+
export declare function camelize(str: string): string;
|
|
6
|
+
/** kabab-case -> KababCase */
|
|
7
|
+
export declare function pascalize(text: string): string;
|
|
8
|
+
/** KababCase -> kabab-case */
|
|
9
|
+
export declare function uncapitalize(text: string): string;
|
|
10
|
+
/** 'kabab-case' -> 'Kabab Case' */
|
|
11
|
+
export declare function humanize(text: string): string;
|
|
12
|
+
export declare function isTruthyProp(value: unknown): unknown;
|
|
13
|
+
export declare function clampValue(n: number, min: number, max: number): number;
|
|
14
|
+
export declare function isExternalLink(href: string): boolean;
|
|
15
|
+
export declare function toArray(value: unknown | unknown[]): any[];
|
|
16
|
+
export declare function getCssUnitValue(value: Nullable<CSSValue | string>, fallbackValue?: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* Increase string a value with unit
|
|
19
|
+
*
|
|
20
|
+
* @example '2px' + 1 = '3px'
|
|
21
|
+
* @example '15em' + (-2) = '13em'
|
|
22
|
+
*/
|
|
23
|
+
export declare function increaseWithUnit(target: number, delta: number): number;
|
|
24
|
+
export declare function increaseWithUnit(target: string, delta: number): string;
|
|
25
|
+
export declare function increaseWithUnit(target: string | number, delta: number): string | number;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Nullable } from '../types/shared/utils';
|
|
2
|
+
type PathArray = ReadonlyArray<PropertyKey>;
|
|
3
|
+
type PathValue<T, P extends PathArray> = P extends [] ? T : P extends [infer K, ...infer R] ? K extends PropertyKey ? R extends PathArray ? PathValue<GetAtStep<NonNullable<T>, K>, R> : unknown : unknown : unknown;
|
|
4
|
+
type GetAtStep<T, K> = K extends keyof T ? T[K] : K extends number ? T extends readonly (infer U)[] ? U : T extends {
|
|
5
|
+
[key: number]: infer V;
|
|
6
|
+
} ? V : unknown : K extends string ? K extends keyof T ? T[K] : unknown : K extends symbol ? K extends keyof T ? T[K] : unknown : unknown;
|
|
7
|
+
export declare function get<T, P extends PathArray, D = undefined>(obj: T, path: P, defaultValue?: D): PathValue<T, P> | D;
|
|
8
|
+
export declare function get<T, D = undefined>(obj: T, path: string | PropertyKey, defaultValue?: D): unknown | D;
|
|
9
|
+
export declare function getFallbackValue<Variants extends Record<string, any>>(variant: Nullable<string>, variants: Variants, defaultVariant?: keyof Variants): any;
|
|
10
|
+
export declare function getColorByThreshold(value: number, colors: Record<string, string>): string;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ComponentPublicInstance, MaybeRefOrGetter } from 'vue';
|
|
2
|
+
import type { MaybeElement } from '../types/shared/utils';
|
|
3
|
+
export type UnRefElementReturn<T extends MaybeElement = MaybeElement> = T extends ComponentPublicInstance ? Exclude<MaybeElement, ComponentPublicInstance> : T | undefined;
|
|
4
|
+
export declare function toValue<T>(source: MaybeRefOrGetter<T>): T;
|
|
5
|
+
export declare function unrefElement<T extends MaybeElement>(elRef: MaybeRefOrGetter<T>): UnRefElementReturn<T>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const INTEGER_REGEX: RegExp;
|
|
2
|
+
export declare const FLOATING_REGEX: RegExp;
|
|
3
|
+
export declare const POSITIVE_INTEGER_REGEX: RegExp;
|
|
4
|
+
export declare const SCIENCE_NUMERIC_REGEX: RegExp;
|
|
5
|
+
export declare const DATE_REGEX: RegExp;
|
|
6
|
+
export declare const TIME_REGEX: RegExp;
|
|
7
|
+
export declare const DATE_TIME_REGEX: RegExp;
|
|
8
|
+
export declare const TIME_REGEX_WITH_MILLISECONDS: RegExp;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ResponsiveValue } from '../types/shared/props';
|
|
2
|
+
import type { Nullable } from '../types/shared/utils';
|
|
3
|
+
export declare function getResponsiveValue<V extends string | number>(prop: ResponsiveValue<V> | undefined, xsValue: Nullable<V>, valueSetter: (acc: Record<string, V>, bp: any, v: V) => void): Record<string, V>;
|