pxd 0.0.61 → 0.0.62
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/LICENSE +21 -0
- package/dist/components/_internal/dismiss-container.d.vue.ts +28 -0
- package/dist/components/_internal/dismiss-container.vue +162 -0
- package/dist/components/_internal/popover-arrow.d.vue.ts +9 -0
- package/dist/components/_internal/popover-arrow.vue +38 -0
- package/dist/components/active-graph/index.vue +4 -4
- package/dist/components/avatar/index.vue +5 -7
- package/dist/components/avatar-group/index.d.vue.ts +0 -1
- package/dist/components/avatar-group/index.vue +1 -1
- package/dist/components/backtop/index.vue +1 -1
- package/dist/components/badge/index.d.vue.ts +6 -2
- package/dist/components/badge/index.vue +18 -4
- package/dist/components/badge/types.d.ts +5 -0
- package/dist/components/book/index.vue +1 -1
- package/dist/components/browser/index.vue +1 -1
- package/dist/components/bubble/index.d.vue.ts +22 -0
- package/dist/components/bubble/index.vue +59 -0
- package/dist/components/bubble/types.d.ts +6 -0
- package/dist/components/button/index.d.vue.ts +0 -2
- package/dist/components/button/index.vue +30 -21
- package/dist/components/button/types.d.ts +3 -2
- package/dist/components/button-group/index.d.vue.ts +14 -0
- package/dist/components/button-group/index.vue +26 -0
- package/dist/components/button-group/types.d.ts +9 -0
- package/dist/components/carousel/index.d.vue.ts +3 -3
- package/dist/components/carousel/index.vue +146 -113
- package/dist/components/carousel/types.d.ts +1 -1
- package/dist/components/carousel-item/index.vue +22 -17
- package/dist/components/checkbox/index.vue +6 -6
- package/dist/components/checkbox-group/index.d.vue.ts +1 -1
- package/dist/components/chip/index.d.vue.ts +1 -5
- package/dist/components/chip/index.vue +4 -4
- package/dist/components/color-selector/index.d.vue.ts +12 -0
- package/dist/components/color-selector/index.vue +64 -0
- package/dist/components/color-selector/types.d.ts +12 -0
- package/dist/components/command-menu/index.d.vue.ts +6 -6
- package/dist/components/command-menu/index.vue +23 -32
- package/dist/components/command-menu/types.d.ts +1 -1
- package/dist/components/command-menu-group/index.vue +15 -6
- package/dist/components/command-menu-group/types.d.ts +1 -1
- package/dist/components/countdown/index.d.vue.ts +11 -11
- package/dist/components/drawer/index.d.vue.ts +8 -8
- package/dist/components/drawer/index.vue +13 -10
- package/dist/components/drawer/types.d.ts +4 -3
- package/dist/components/ellipsis-text/index.d.vue.ts +4 -1
- package/dist/components/ellipsis-text/index.vue +84 -107
- package/dist/components/ellipsis-text/types.d.ts +2 -1
- package/dist/components/error/index.vue +1 -1
- package/dist/components/fader/index.vue +5 -9
- package/dist/components/gauge/index.vue +34 -29
- package/dist/components/grid/index.vue +1 -1
- package/dist/components/grid-item/index.vue +1 -1
- package/dist/components/hold-button/index.d.vue.ts +8 -10
- package/dist/components/hold-button/index.vue +20 -29
- package/dist/components/hold-button/types.d.ts +5 -6
- package/dist/components/index.d.ts +7 -0
- package/dist/components/index.js +7 -0
- package/dist/components/input/index.d.vue.ts +8 -8
- package/dist/components/input/index.vue +5 -4
- package/dist/components/intersection-observer/index.vue +4 -4
- package/dist/components/kbd/index.vue +1 -1
- package/dist/components/link-button/index.d.vue.ts +4 -4
- package/dist/components/link-button/index.vue +9 -8
- package/dist/components/link-button/types.d.ts +0 -3
- package/dist/components/list/index.d.vue.ts +10 -15
- package/dist/components/list/index.vue +58 -131
- package/dist/components/list/types.d.ts +4 -4
- package/dist/components/list-item/index.d.vue.ts +2 -2
- package/dist/components/list-item/index.vue +44 -39
- package/dist/components/loading-bar/index.vue +8 -7
- package/dist/components/material/index.vue +24 -46
- package/dist/components/menu/index.d.vue.ts +6 -8
- package/dist/components/menu/index.vue +18 -24
- package/dist/components/menu/types.d.ts +1 -2
- package/dist/components/message/composables/use-group-expand.d.ts +13 -0
- package/dist/components/message/composables/use-group-expand.js +50 -0
- package/dist/components/message/composables/use-message-timer.d.ts +9 -0
- package/dist/components/message/composables/use-message-timer.js +61 -0
- package/dist/components/message/composables/use-promise-message.d.ts +4 -0
- package/dist/components/message/composables/use-promise-message.js +49 -0
- package/dist/components/message/index.d.vue.ts +6 -33
- package/dist/components/message/index.vue +33 -185
- package/dist/components/message/types.d.ts +2 -2
- package/dist/components/message-item/index.vue +26 -2
- package/dist/components/modal/index.d.vue.ts +7 -7
- package/dist/components/modal/index.vue +7 -3
- package/dist/components/modal/types.d.ts +7 -3
- package/dist/components/note/index.vue +2 -2
- package/dist/components/number-input/index.d.vue.ts +5 -4
- package/dist/components/number-input/index.vue +3 -0
- package/dist/components/number-input/types.d.ts +1 -0
- package/dist/components/overlay/index.d.vue.ts +6 -3
- package/dist/components/overlay/index.vue +63 -68
- package/dist/components/overlay/types.d.ts +5 -4
- package/dist/components/pagination/index.vue +2 -2
- package/dist/components/pin-input/index.d.vue.ts +1 -1
- package/dist/components/pin-input/index.vue +7 -6
- package/dist/components/placeholder/index.vue +1 -1
- package/dist/components/popover/index.d.vue.ts +7 -8
- package/dist/components/popover/index.vue +149 -239
- package/dist/components/popover/types.d.ts +5 -5
- package/dist/components/progress/index.vue +1 -1
- package/dist/components/radio/index.vue +2 -2
- package/dist/components/resizable/index.vue +43 -51
- package/dist/components/resizable/types.d.ts +1 -1
- package/dist/components/resizable-handle/index.d.vue.ts +4 -1
- package/dist/components/resizable-handle/index.vue +29 -3
- package/dist/components/resizable-panel/index.vue +3 -7
- package/dist/components/scalable-text/index.d.vue.ts +9 -0
- package/dist/components/scalable-text/index.vue +147 -0
- package/dist/components/scalable-text/types.d.ts +12 -0
- package/dist/components/scrollable/index.d.vue.ts +2 -2
- package/dist/components/scrollable/index.vue +4 -3
- package/dist/components/separator/index.d.vue.ts +6 -0
- package/dist/components/separator/index.vue +18 -0
- package/dist/components/separator/types.d.ts +5 -0
- package/dist/components/skeleton/index.d.vue.ts +1 -1
- package/dist/components/slider/index.d.vue.ts +1 -1
- package/dist/components/slider/index.vue +39 -7
- package/dist/components/snippet/index.vue +16 -13
- package/dist/components/spinner/index.vue +3 -1
- package/dist/components/stack/index.d.vue.ts +1 -1
- package/dist/components/stack/index.vue +1 -1
- package/dist/components/switch/index.d.vue.ts +1 -1
- package/dist/components/switch/index.vue +4 -3
- package/dist/components/switch-item/index.vue +1 -1
- package/dist/components/tabs/index.d.vue.ts +12 -0
- package/dist/components/tabs/index.vue +270 -0
- package/dist/components/tabs/types.d.ts +12 -0
- package/dist/components/tabs-item/index.d.vue.ts +4 -0
- package/dist/components/tabs-item/index.vue +16 -0
- package/dist/components/tabs-item/types.d.ts +10 -0
- package/dist/components/text/index.vue +1 -1
- package/dist/components/textarea/index.d.vue.ts +2 -2
- package/dist/components/textarea/index.vue +1 -1
- package/dist/components/time-picker/index.d.vue.ts +3 -5
- package/dist/components/time-picker/index.vue +53 -45
- package/dist/components/time-picker/types.d.ts +1 -2
- package/dist/components/toggle/index.d.vue.ts +0 -2
- package/dist/components/toggle/index.vue +6 -6
- package/dist/components/toggle-button/index.vue +8 -6
- package/dist/components/tooltip/index.d.vue.ts +1 -1
- package/dist/components/tooltip/index.vue +19 -11
- package/dist/components/tooltip/types.d.ts +2 -2
- package/dist/components/virtual-list/index.d.vue.ts +8 -8
- package/dist/components/virtual-list/index.vue +27 -5
- package/dist/components/virtual-list/types.d.ts +3 -0
- package/dist/composables/index.d.ts +4 -1
- package/dist/composables/index.js +4 -1
- package/dist/composables/use-browser-observer.js +2 -2
- package/dist/composables/use-client-online.js +2 -2
- package/dist/composables/use-color-scheme.js +2 -2
- package/dist/composables/use-countdown.js +3 -2
- package/dist/composables/use-deferred-value.js +2 -2
- package/dist/composables/use-delay-destroy.js +11 -6
- package/dist/composables/use-document-hidden.js +2 -2
- package/dist/composables/use-focus-trap.js +2 -2
- package/dist/composables/use-list-filter.d.ts +11 -0
- package/dist/composables/use-list-filter.js +56 -0
- package/dist/composables/use-list-navigation.d.ts +27 -0
- package/dist/composables/use-list-navigation.js +159 -0
- package/dist/composables/use-lock-scroll.js +12 -12
- package/dist/composables/use-media-query.js +2 -2
- package/dist/composables/use-outside-click.d.ts +1 -1
- package/dist/composables/use-outside-click.js +8 -11
- package/dist/composables/use-overlay-manager.d.ts +18 -0
- package/dist/composables/use-overlay-manager.js +80 -0
- package/dist/composables/use-popover-responsive.d.ts +6 -8
- package/dist/composables/use-popover-responsive.js +9 -12
- package/dist/composables/use-repeat-action.js +2 -2
- package/dist/composables/use-swipe-gesture.d.ts +65 -0
- package/dist/composables/use-swipe-gesture.js +99 -0
- package/dist/composables/use-virtual-list.d.ts +5 -3
- package/dist/composables/use-virtual-list.js +25 -14
- package/dist/composables/use-window-size.js +2 -2
- package/dist/constants/size.d.ts +12 -0
- package/dist/constants/size.js +12 -0
- package/dist/contexts/button.d.ts +5 -0
- package/dist/contexts/button.js +5 -0
- package/dist/contexts/carousel.d.ts +2 -1
- package/dist/contexts/list.d.ts +23 -3
- package/dist/contexts/list.js +6 -2
- package/dist/contexts/resizable.d.ts +3 -11
- package/dist/contexts/tabs.d.ts +15 -0
- package/dist/contexts/tabs.js +2 -0
- package/dist/locales/en-us.d.ts +4 -4
- package/dist/locales/en-us.js +4 -4
- package/dist/locales/zh-cn.d.ts +4 -4
- package/dist/locales/zh-cn.js +4 -4
- package/dist/plugins/dayjs-millisecond-token.js +1 -1
- package/dist/styles/source.css +133 -128
- package/dist/styles/styles.css +2 -2
- package/dist/styles/tw.css +133 -128
- package/dist/types/shared/props.d.ts +1 -0
- package/dist/types/shared/utils.d.ts +1 -4
- package/dist/utils/date.d.ts +3 -3
- package/dist/utils/dom.d.ts +1 -0
- package/dist/utils/dom.js +4 -0
- package/dist/utils/event.d.ts +2 -1
- package/dist/utils/event.js +7 -1
- package/dist/utils/format.d.ts +3 -3
- package/dist/utils/format.js +5 -4
- package/dist/utils/fuzzy-search.d.ts +7 -0
- package/dist/utils/fuzzy-search.js +61 -0
- package/dist/utils/get.d.ts +2 -0
- package/dist/utils/get.js +15 -1
- package/dist/utils/index.d.ts +10 -11
- package/dist/utils/index.js +2 -3
- package/dist/utils/ref.d.ts +2 -2
- package/dist/utils/{throttle.d.ts → timing.d.ts} +1 -0
- package/dist/utils/{throttle.js → timing.js} +4 -2
- package/package.json +67 -63
- package/volar.d.ts +7 -0
- package/dist/components/overlay/overlay-stack.d.ts +0 -3
- package/dist/components/overlay/overlay-stack.js +0 -17
- package/dist/composables/use-pointer-gesture.d.ts +0 -180
- package/dist/composables/use-pointer-gesture.js +0 -406
- package/dist/utils/debounce.d.ts +0 -1
- package/dist/utils/debounce.js +0 -1
- package/dist/utils/regexp.d.ts +0 -8
- package/dist/utils/regexp.js +0 -8
- package/dist/utils/responsive.d.ts +0 -3
- package/dist/utils/responsive.js +0 -14
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import CalendarIcon from "@gdsicon/vue/calendar";
|
|
3
|
-
import { computed, shallowRef, watch } from "vue";
|
|
3
|
+
import { computed, onBeforeUnmount, shallowRef, watch } from "vue";
|
|
4
4
|
import { usePopoverResponsive } from "../../composables/use-popover-responsive";
|
|
5
5
|
import { useConfigProvider } from "../../contexts/config-provider";
|
|
6
6
|
import { dayjs } from "../../utils/date";
|
|
7
7
|
import { clampValue } from "../../utils/format";
|
|
8
|
+
import { throttleByRaf } from "../../utils/timing";
|
|
8
9
|
import PButton from "../button/index.vue";
|
|
9
10
|
import PInput from "../input/index.vue";
|
|
10
11
|
import PPopover from "../popover/index.vue";
|
|
@@ -30,16 +31,20 @@ const props = defineProps({
|
|
|
30
31
|
format: { type: String, required: false, default: "HH:mm:ss" },
|
|
31
32
|
valueFormat: { type: String, required: false, default: "HH:mm:ss" }
|
|
32
33
|
});
|
|
33
|
-
const emits = defineEmits(["change", "
|
|
34
|
+
const emits = defineEmits(["change", "update:modelValue"]);
|
|
34
35
|
const HEIGHT = 32;
|
|
35
36
|
const VALUE_POSITION_MAP = {
|
|
36
37
|
hour: 0,
|
|
37
38
|
minute: 1,
|
|
38
39
|
second: 2
|
|
39
40
|
};
|
|
40
|
-
const
|
|
41
|
+
const paddedTimes = {
|
|
42
|
+
hours: Array.from({ length: 24 }, (_, i) => padStringZero(i)),
|
|
43
|
+
minutes: Array.from({ length: 60 }, (_, i) => padStringZero(i)),
|
|
44
|
+
seconds: Array.from({ length: 60 }, (_, i) => padStringZero(i))
|
|
45
|
+
};
|
|
41
46
|
const configProvider = useConfigProvider();
|
|
42
|
-
const {
|
|
47
|
+
const { isAdaptive, responsiveClasses } = usePopoverResponsive();
|
|
43
48
|
const timeHoursRef = shallowRef();
|
|
44
49
|
const timeMinutesRef = shallowRef();
|
|
45
50
|
const timeSecondsRef = shallowRef();
|
|
@@ -50,11 +55,12 @@ const modelValue = computed({
|
|
|
50
55
|
return dayjsDateTime.value ? dayjsDateTime.value.format(props.format) : "";
|
|
51
56
|
},
|
|
52
57
|
set(value) {
|
|
58
|
+
emits("change", value);
|
|
53
59
|
emits("update:modelValue", value);
|
|
54
60
|
}
|
|
55
61
|
});
|
|
56
62
|
const scrollTimers = [];
|
|
57
|
-
|
|
63
|
+
const onTimeListScroll = throttleByRaf((ev) => {
|
|
58
64
|
const target = ev.target;
|
|
59
65
|
const value = Math.round(target.scrollTop / HEIGHT);
|
|
60
66
|
const type = target.dataset.type;
|
|
@@ -66,18 +72,18 @@ function onTimeListScroll(ev) {
|
|
|
66
72
|
top: clampedValue * HEIGHT,
|
|
67
73
|
behavior: "smooth"
|
|
68
74
|
});
|
|
75
|
+
if (!dayjsDateTime.value) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
69
78
|
dayjsDateTime.value = dayjsDateTime.value.set(type, clampedValue);
|
|
70
79
|
}, 100);
|
|
71
|
-
}
|
|
80
|
+
});
|
|
72
81
|
function padStringZero(value) {
|
|
73
82
|
return String(value).padStart(2, "0");
|
|
74
83
|
}
|
|
75
|
-
function
|
|
84
|
+
function togglePopoverVisible(visible) {
|
|
76
85
|
popoverVisible.value = visible;
|
|
77
86
|
}
|
|
78
|
-
function hidePopover() {
|
|
79
|
-
onVisibleChange(false);
|
|
80
|
-
}
|
|
81
87
|
function updateDayjsDateTime(value) {
|
|
82
88
|
if (!value) {
|
|
83
89
|
dayjsDateTime.value = null;
|
|
@@ -101,7 +107,7 @@ function getFormattedValue(value) {
|
|
|
101
107
|
}
|
|
102
108
|
return dayjs(_value);
|
|
103
109
|
}
|
|
104
|
-
|
|
110
|
+
function setTimesScrollTop() {
|
|
105
111
|
if (!dayjsDateTime.value) {
|
|
106
112
|
dayjsDateTime.value = dayjs();
|
|
107
113
|
}
|
|
@@ -142,7 +148,7 @@ function updateModelValue() {
|
|
|
142
148
|
function onInputValueChange(value) {
|
|
143
149
|
updateDayjsDateTime(value);
|
|
144
150
|
updateModelValue();
|
|
145
|
-
|
|
151
|
+
togglePopoverVisible(false);
|
|
146
152
|
}
|
|
147
153
|
function onPresetClick(ev) {
|
|
148
154
|
const target = ev.target;
|
|
@@ -159,54 +165,56 @@ function onPresetClick(ev) {
|
|
|
159
165
|
}
|
|
160
166
|
updateDayjsDateTime(presetValue);
|
|
161
167
|
updateModelValue();
|
|
162
|
-
|
|
168
|
+
togglePopoverVisible(false);
|
|
163
169
|
}
|
|
164
|
-
function
|
|
170
|
+
function onSetNowClick() {
|
|
165
171
|
updateDayjsDateTime(/* @__PURE__ */ new Date());
|
|
166
172
|
updateModelValue();
|
|
167
|
-
|
|
173
|
+
togglePopoverVisible(false);
|
|
168
174
|
}
|
|
169
175
|
function onCancelClick() {
|
|
170
176
|
updateDayjsDateTime(props.modelValue);
|
|
171
|
-
|
|
177
|
+
togglePopoverVisible(false);
|
|
172
178
|
}
|
|
173
179
|
watch(() => props.modelValue, updateDayjsDateTime, { immediate: true });
|
|
180
|
+
onBeforeUnmount(() => {
|
|
181
|
+
scrollTimers.forEach((timer) => clearTimeout(timer));
|
|
182
|
+
onTimeListScroll.cancel();
|
|
183
|
+
});
|
|
174
184
|
</script>
|
|
175
185
|
|
|
176
186
|
<template>
|
|
177
187
|
<PPopover
|
|
178
|
-
|
|
188
|
+
v-model="popoverVisible"
|
|
189
|
+
class="pxd-time-picker w-full"
|
|
190
|
+
trigger="click"
|
|
179
191
|
:disabled="disabled"
|
|
180
192
|
:class="$attrs.class"
|
|
181
193
|
:style="$attrs.style"
|
|
182
194
|
:toggle-on-trigger="false"
|
|
183
|
-
:
|
|
184
|
-
:
|
|
185
|
-
:
|
|
186
|
-
:
|
|
187
|
-
:transition-type="attrs.transitionType"
|
|
188
|
-
:lock-scroll-on-visible="isXs"
|
|
195
|
+
:adaptive="isAdaptive"
|
|
196
|
+
:wrapper-class="responsiveClasses.wrapper"
|
|
197
|
+
:content-class="responsiveClasses.content"
|
|
198
|
+
:lock-scroll-on-visible="isAdaptive"
|
|
189
199
|
:close-on-press-escape="closeOnPressEscape"
|
|
190
|
-
class="pxd-time-picker w-full"
|
|
191
|
-
@escape="onCancelClick"
|
|
192
200
|
@show="setTimesScrollTop"
|
|
193
201
|
@outside-click="updateModelValue"
|
|
194
|
-
@visible-change="onVisibleChange"
|
|
195
202
|
>
|
|
196
203
|
<PInput
|
|
197
204
|
:size="size"
|
|
198
205
|
:error="error"
|
|
199
206
|
:disabled="disabled"
|
|
200
|
-
:readonly="
|
|
207
|
+
:readonly="isAdaptive"
|
|
201
208
|
:clearable="clearable"
|
|
202
209
|
:model-value="modelValue"
|
|
203
210
|
:placeholder="placeholder"
|
|
204
211
|
:default-prefix-style="false"
|
|
205
212
|
:data-focusing="popoverVisible"
|
|
206
|
-
:select-on-focus="!
|
|
213
|
+
:select-on-focus="!isAdaptive"
|
|
207
214
|
v-bind="$attrs"
|
|
208
215
|
@clear="onInputValueChange"
|
|
209
216
|
@change="onInputValueChange"
|
|
217
|
+
@keydown.enter="togglePopoverVisible(true)"
|
|
210
218
|
>
|
|
211
219
|
<template v-if="prefixIcon" #prefix>
|
|
212
220
|
<CalendarIcon class="ml-3" />
|
|
@@ -214,18 +222,18 @@ watch(() => props.modelValue, updateDayjsDateTime, { immediate: true });
|
|
|
214
222
|
</PInput>
|
|
215
223
|
|
|
216
224
|
<template #content>
|
|
217
|
-
<div class="
|
|
218
|
-
<PButton size="
|
|
225
|
+
<div class="p-1.5 gap-1 flex items-center justify-between border-b" @click.stop>
|
|
226
|
+
<PButton size="sm" variant="ghost" class="sm:px-0.5 text-13" @click="onCancelClick">
|
|
219
227
|
{{ configProvider.locale.confirm.cancel }}
|
|
220
228
|
</PButton>
|
|
221
229
|
|
|
222
|
-
<PButton size="
|
|
230
|
+
<PButton size="sm" variant="ghost" class="sm:px-0.5 text-13" @click="onSetNowClick">
|
|
223
231
|
{{ configProvider.locale.date.now }}
|
|
224
232
|
</PButton>
|
|
225
233
|
</div>
|
|
226
234
|
|
|
227
235
|
<div
|
|
228
|
-
class="sm:text-
|
|
236
|
+
class="sm:text-15 max-sm:text-base flex max-w-full transform-gpu items-stretch tabular-nums outline-none select-none"
|
|
229
237
|
@click.stop="onTimeListClick"
|
|
230
238
|
>
|
|
231
239
|
<div class="p-2 gap-1 relative mx-auto flex items-center">
|
|
@@ -233,11 +241,11 @@ watch(() => props.modelValue, updateDayjsDateTime, { immediate: true });
|
|
|
233
241
|
<ul
|
|
234
242
|
ref="timeHoursRef"
|
|
235
243
|
data-type="hour"
|
|
236
|
-
class="w-
|
|
244
|
+
class="w-16 sm:w-12 h-40 px-0 m-0 py-16 relative scrollbar-none list-none overflow-x-hidden overflow-y-scroll overscroll-contain text-center outline-none motion-safe:transition-colors"
|
|
237
245
|
@scroll.stop="onTimeListScroll"
|
|
238
246
|
>
|
|
239
|
-
<li v-for="
|
|
240
|
-
{{
|
|
247
|
+
<li v-for="i of paddedTimes.hours" :key="i" class="h-8 leading-8 cursor-pointer">
|
|
248
|
+
{{ i }}
|
|
241
249
|
</li>
|
|
242
250
|
</ul>
|
|
243
251
|
</div>
|
|
@@ -245,11 +253,11 @@ watch(() => props.modelValue, updateDayjsDateTime, { immediate: true });
|
|
|
245
253
|
<ul
|
|
246
254
|
ref="timeMinutesRef"
|
|
247
255
|
data-type="minute"
|
|
248
|
-
class="w-
|
|
256
|
+
class="w-16 sm:w-12 h-40 px-0 m-0 py-16 relative scrollbar-none list-none overflow-x-hidden overflow-y-scroll overscroll-contain text-center outline-none motion-safe:transition-colors"
|
|
249
257
|
@scroll.stop="onTimeListScroll"
|
|
250
258
|
>
|
|
251
|
-
<li v-for="
|
|
252
|
-
{{
|
|
259
|
+
<li v-for="i of paddedTimes.minutes" :key="i" class="h-8 leading-8 cursor-pointer">
|
|
260
|
+
{{ i }}
|
|
253
261
|
</li>
|
|
254
262
|
</ul>
|
|
255
263
|
</div>
|
|
@@ -257,11 +265,11 @@ watch(() => props.modelValue, updateDayjsDateTime, { immediate: true });
|
|
|
257
265
|
<ul
|
|
258
266
|
ref="timeSecondsRef"
|
|
259
267
|
data-type="second"
|
|
260
|
-
class="w-
|
|
268
|
+
class="w-16 sm:w-12 h-40 px-0 m-0 py-16 relative scrollbar-none list-none overflow-x-hidden overflow-y-scroll overscroll-contain text-center outline-none motion-safe:transition-colors"
|
|
261
269
|
@scroll.stop="onTimeListScroll"
|
|
262
270
|
>
|
|
263
|
-
<li v-for="
|
|
264
|
-
{{
|
|
271
|
+
<li v-for="i of paddedTimes.seconds" :key="i" class="h-8 leading-8 cursor-pointer">
|
|
272
|
+
{{ i }}
|
|
265
273
|
</li>
|
|
266
274
|
</ul>
|
|
267
275
|
</div>
|
|
@@ -276,7 +284,7 @@ watch(() => props.modelValue, updateDayjsDateTime, { immediate: true });
|
|
|
276
284
|
v-for="(preset, i) in presets"
|
|
277
285
|
:key="preset.label"
|
|
278
286
|
:data-index="i"
|
|
279
|
-
class="px-1.5 py-0.5 sm:text-
|
|
287
|
+
class="px-1.5 py-0.5 sm:text-13 sm:leading-4 max-sm:leading-5 max-sm:text-sm cursor-pointer appearance-none rounded-sm border-none bg-gray-300 font-inherit whitespace-nowrap text-foreground self-focus-ring outline-none hover:bg-gray-400 active:bg-gray-500 motion-safe:transition-appearance"
|
|
280
288
|
>
|
|
281
289
|
{{ preset.label }}
|
|
282
290
|
</button>
|
|
@@ -292,9 +300,9 @@ watch(() => props.modelValue, updateDayjsDateTime, { immediate: true });
|
|
|
292
300
|
&::after {
|
|
293
301
|
content: '';
|
|
294
302
|
position: absolute;
|
|
295
|
-
left: -
|
|
296
|
-
right: -
|
|
297
|
-
height:
|
|
303
|
+
left: -0.125rem;
|
|
304
|
+
right: -0.125rem;
|
|
305
|
+
height: 4rem;
|
|
298
306
|
pointer-events: none;
|
|
299
307
|
z-index: 1;
|
|
300
308
|
}
|
|
@@ -14,8 +14,6 @@ declare const __VLS_base: import("vue").DefineComponent<ToggleProps, {}, {}, {},
|
|
|
14
14
|
}>, {
|
|
15
15
|
activeValue: import("./types").ValueType;
|
|
16
16
|
inactiveValue: import("./types").ValueType;
|
|
17
|
-
activeColor: string;
|
|
18
|
-
inactiveColor: string;
|
|
19
17
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
20
18
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
21
19
|
declare const _default: typeof __VLS_export;
|
|
@@ -21,8 +21,8 @@ const props = defineProps({
|
|
|
21
21
|
activeValue: { type: [Boolean, Number, String], required: false, default: true },
|
|
22
22
|
inactiveValue: { type: [Boolean, Number, String], required: false, default: false },
|
|
23
23
|
beforeChange: { type: Function, required: false },
|
|
24
|
-
activeColor: { type: String, required: false
|
|
25
|
-
inactiveColor: { type: String, required: false
|
|
24
|
+
activeColor: { type: String, required: false },
|
|
25
|
+
inactiveColor: { type: String, required: false },
|
|
26
26
|
activeLabel: { type: String, required: false },
|
|
27
27
|
inactiveLabel: { type: String, required: false }
|
|
28
28
|
});
|
|
@@ -76,12 +76,12 @@ async function onCheckboxChange(e) {
|
|
|
76
76
|
|
|
77
77
|
<span
|
|
78
78
|
v-if="inactiveLabel"
|
|
79
|
-
class="pxd-toggle--label text-sm mr-1.5 pl-0.5 opacity-100 peer-checked:opacity-50 motion-safe:transition-opacity"
|
|
79
|
+
class="pxd-toggle--label text-sm mr-1.5 pl-0.5 leading-none opacity-100 peer-checked:opacity-50 motion-safe:transition-opacity"
|
|
80
80
|
>{{ inactiveLabel }}</span
|
|
81
81
|
>
|
|
82
82
|
|
|
83
83
|
<div
|
|
84
|
-
class="pxd-toggle--handle rounded-full border
|
|
84
|
+
class="pxd-toggle--handle rounded-full border bg-(--toggle-inactive-color) p-px peer-focus-ring [--tx:0] peer-checked:bg-(--toggle-active-color) peer-checked:[--tx:100%] peer-disabled:cursor-not-allowed peer-checked:peer-disabled:bg-gray-500 motion-safe:transition-appearance"
|
|
85
85
|
:class="computedSize"
|
|
86
86
|
:style="{
|
|
87
87
|
'--toggle-active-color': activeColor,
|
|
@@ -91,7 +91,7 @@ async function onCheckboxChange(e) {
|
|
|
91
91
|
<div
|
|
92
92
|
:data-checked="isChecked"
|
|
93
93
|
:data-disabled="isDisabled"
|
|
94
|
-
class="pxd-toggle--handle-icon text-xs shadow-sm bg-white relative flex aspect-square h-full translate-x-(--tx) transform-gpu items-center justify-center overflow-hidden rounded-full text-foreground-secondary motion-safe:transition-
|
|
94
|
+
class="pxd-toggle--handle-icon text-xs shadow-sm bg-white relative flex aspect-square h-full translate-x-(--tx) transform-gpu items-center justify-center overflow-hidden rounded-full text-foreground-secondary motion-safe:transition-appearance dark:data-[checked=true]:bg-background-100 dark:data-[disabled=true]:bg-gray-900 dark:data-[disabled=true]:text-gray-500"
|
|
95
95
|
>
|
|
96
96
|
<div class="inset-0 pointer-events-none absolute flex items-center justify-center">
|
|
97
97
|
<Transition name="pxd-transition--fade" mode="out-in">
|
|
@@ -105,7 +105,7 @@ async function onCheckboxChange(e) {
|
|
|
105
105
|
|
|
106
106
|
<span
|
|
107
107
|
v-if="activeLabel"
|
|
108
|
-
class="pxd-toggle--label text-sm ml-1.5 pr-0.5 opacity-50 peer-checked:opacity-100 motion-safe:transition-opacity"
|
|
108
|
+
class="pxd-toggle--label text-sm ml-1.5 pr-0.5 leading-none opacity-50 peer-checked:opacity-100 motion-safe:transition-opacity"
|
|
109
109
|
>{{ activeLabel }}</span
|
|
110
110
|
>
|
|
111
111
|
</label>
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { tv } from "tailwind-variants";
|
|
3
3
|
import { computed } from "vue";
|
|
4
4
|
import { useModelValue } from "../../composables/use-model-value";
|
|
5
|
+
import { BASIC_HEIGHTS } from "../../constants/size";
|
|
5
6
|
import { useConfigProvider } from "../../contexts/config-provider";
|
|
6
7
|
import { useToggleButtonGroupContext } from "../../contexts/toggle-button";
|
|
7
8
|
import { toArray } from "../../utils/format";
|
|
@@ -23,16 +24,17 @@ const props = defineProps({
|
|
|
23
24
|
});
|
|
24
25
|
const emits = defineEmits(["change", "update:modelValue"]);
|
|
25
26
|
const toggleButtonVariant = tv({
|
|
26
|
-
base: "pxd-toggle-button gap-2 font-medium relative inline-flex shrink-0 appearance-none items-center justify-center border bg-background-100 outline-none group-data-[gap=0]/toggle-button-group:not-first:-ml-px group-data-[gap=0]/toggle-button-group:not-first:rounded-l-none group-data-[gap=0]/toggle-button-group:not-last:rounded-r-none
|
|
27
|
+
base: "pxd-toggle-button gap-2 font-medium relative inline-flex shrink-0 appearance-none items-center justify-center border bg-background-100 outline-none group-data-[gap=0]/toggle-button-group:not-first:-ml-px group-data-[gap=0]/toggle-button-group:not-first:rounded-l-none group-data-[gap=0]/toggle-button-group:not-last:rounded-r-none data-[state=off]:enabled:hover:z-1 data-[state=on]:z-1 motion-safe:transition-colors [&_svg]:pointer-events-none",
|
|
27
28
|
variants: {
|
|
28
29
|
size: {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
xs: `${BASIC_HEIGHTS.xs} px-1.25 text-xs rounded-sm`,
|
|
31
|
+
sm: `${BASIC_HEIGHTS.sm} px-1.75 text-sm rounded-md`,
|
|
32
|
+
md: `${BASIC_HEIGHTS.md} px-2.5 text-sm rounded-md`,
|
|
33
|
+
lg: `${BASIC_HEIGHTS.lg} px-2.75 text-base rounded-lg`
|
|
32
34
|
},
|
|
33
35
|
variant: {
|
|
34
36
|
ghost: "border-transparent",
|
|
35
|
-
outline: "
|
|
37
|
+
outline: ""
|
|
36
38
|
},
|
|
37
39
|
disabled: {
|
|
38
40
|
true: "cursor-not-allowed",
|
|
@@ -46,7 +48,7 @@ const toggleButtonVariant = tv({
|
|
|
46
48
|
compoundVariants: [
|
|
47
49
|
{ checked: true, disabled: true, class: "bg-gray-200" },
|
|
48
50
|
{ checked: false, disabled: true, class: "text-gray-400" },
|
|
49
|
-
{ checked: false, disabled: false, class: "hover:text-gray-
|
|
51
|
+
{ checked: false, disabled: false, class: "hover:text-gray-900" },
|
|
50
52
|
{ variant: "outline", checked: false, disabled: true, class: "border-gray-400" },
|
|
51
53
|
{ variant: "outline", checked: true, disabled: true, class: "border-gray-500 bg-gray-100" }
|
|
52
54
|
],
|
|
@@ -6,8 +6,8 @@ type __VLS_Slots = {} & {
|
|
|
6
6
|
content?: (props: typeof __VLS_11) => any;
|
|
7
7
|
};
|
|
8
8
|
declare const __VLS_base: import("vue").DefineComponent<TooltipProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<TooltipProps> & Readonly<{}>, {
|
|
9
|
-
variant: import("../../types/shared").ComponentVariant;
|
|
10
9
|
position: import("../../types/shared").ComponentPosition;
|
|
10
|
+
variant: "default" | "error" | "warning" | "success" | "invert" | "violet";
|
|
11
11
|
showDelay: number;
|
|
12
12
|
hideDelay: number;
|
|
13
13
|
showArrow: boolean;
|
|
@@ -10,42 +10,50 @@ defineOptions({
|
|
|
10
10
|
const props = defineProps({
|
|
11
11
|
offset: { type: Number, required: false },
|
|
12
12
|
content: { type: String, required: false },
|
|
13
|
-
variant: { type: String, required: false, default: "
|
|
13
|
+
variant: { type: String, required: false, default: "default" },
|
|
14
14
|
position: { type: null, required: false, default: "top" },
|
|
15
15
|
disabled: { type: Boolean, required: false },
|
|
16
16
|
showDelay: { type: Number, required: false, default: 300 },
|
|
17
|
-
hideDelay: { type: Number, required: false, default:
|
|
17
|
+
hideDelay: { type: Number, required: false, default: 300 },
|
|
18
18
|
showArrow: { type: Boolean, required: false, default: true },
|
|
19
19
|
desktopOnly: { type: Boolean, required: false },
|
|
20
20
|
contentClass: { type: [String, Array, Object], required: false },
|
|
21
21
|
contentStyle: { type: [Object, String], required: false }
|
|
22
22
|
});
|
|
23
23
|
const VARIANTS = {
|
|
24
|
-
|
|
25
|
-
bg: "var(--color-
|
|
26
|
-
|
|
24
|
+
invert: {
|
|
25
|
+
bg: "var(--color-background-100)",
|
|
26
|
+
base: "text-foreground border"
|
|
27
|
+
},
|
|
28
|
+
default: {
|
|
29
|
+
bg: "var(--color-gray-1000)",
|
|
30
|
+
base: "text-gray-100"
|
|
27
31
|
},
|
|
28
32
|
error: {
|
|
29
33
|
bg: "var(--color-red-700)",
|
|
30
|
-
|
|
34
|
+
base: "text-gray-100 dark:text-gray-1000"
|
|
31
35
|
},
|
|
32
36
|
warning: {
|
|
33
37
|
bg: "var(--color-amber-700)",
|
|
34
|
-
|
|
38
|
+
base: "text-gray-1000 dark:text-gray-100"
|
|
35
39
|
},
|
|
36
40
|
success: {
|
|
37
41
|
bg: "var(--color-green-700)",
|
|
38
|
-
|
|
42
|
+
base: "text-gray-100 dark:text-gray-1000"
|
|
43
|
+
},
|
|
44
|
+
violet: {
|
|
45
|
+
bg: "var(--color-purple-700)",
|
|
46
|
+
base: "text-gray-100 dark:text-gray-1000"
|
|
39
47
|
}
|
|
40
48
|
};
|
|
41
|
-
const computedVariant = computed(() => getFallbackValue(props.variant, VARIANTS, "
|
|
49
|
+
const computedVariant = computed(() => getFallbackValue(props.variant, VARIANTS, "default"));
|
|
42
50
|
const isDisabled = computed(() => {
|
|
43
51
|
return props.disabled || props.desktopOnly && isTouchDevice();
|
|
44
52
|
});
|
|
45
53
|
const computedClasses = computed(() => {
|
|
46
54
|
return [
|
|
47
|
-
"px-3 py-2 rounded-md text-
|
|
48
|
-
computedVariant.value.
|
|
55
|
+
"px-3 py-2 rounded-md text-13 break-words shadow-tooltip whitespace-pre-line bg-(--popover-arrow-color)",
|
|
56
|
+
computedVariant.value.base,
|
|
49
57
|
props.contentClass
|
|
50
58
|
].join(" ");
|
|
51
59
|
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { ComponentClass, ComponentPosition
|
|
1
|
+
import type { ComponentClass, ComponentPosition } from '../../types/shared'
|
|
2
2
|
import type { CSSProperties } from 'vue'
|
|
3
3
|
|
|
4
4
|
export interface TooltipProps {
|
|
5
5
|
offset?: number
|
|
6
6
|
content?: string
|
|
7
|
-
variant?:
|
|
7
|
+
variant?: 'default' | 'error' | 'warning' | 'success' | 'invert' | 'violet'
|
|
8
8
|
position?: ComponentPosition
|
|
9
9
|
disabled?: boolean
|
|
10
10
|
showDelay?: number
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { VirtualListProps } from './types';
|
|
2
|
+
import { type VirtualListItem } from '../../composables/use-virtual-list';
|
|
2
3
|
declare var __VLS_1: {
|
|
3
4
|
item: any;
|
|
4
|
-
virtualItem:
|
|
5
|
+
virtualItem: VirtualListItem;
|
|
5
6
|
}, __VLS_3: {};
|
|
6
7
|
type __VLS_Slots = {} & {
|
|
7
8
|
item?: (props: typeof __VLS_1) => any;
|
|
@@ -10,11 +11,11 @@ type __VLS_Slots = {} & {
|
|
|
10
11
|
};
|
|
11
12
|
declare const __VLS_base: import("vue").DefineComponent<VirtualListProps, {
|
|
12
13
|
totalSize: import("vue").ComputedRef<number>;
|
|
13
|
-
virtualItems: import("vue").ComputedRef<
|
|
14
|
+
virtualItems: import("vue").ComputedRef<VirtualListItem[]>;
|
|
14
15
|
getVirtualizer: () => import("@tanstack/virtual-core").Virtualizer<HTMLElement, HTMLElement>;
|
|
15
|
-
scrollToIndex:
|
|
16
|
-
scrollToOffset:
|
|
17
|
-
scrollBy:
|
|
16
|
+
scrollToIndex: (index: number, { align: initialAlign, behavior, }?: import("@tanstack/virtual-core").ScrollToOptions) => void;
|
|
17
|
+
scrollToOffset: (toOffset: number, { align, behavior }?: import("@tanstack/virtual-core").ScrollToOptions) => void;
|
|
18
|
+
scrollBy: (delta: number, { behavior }?: import("@tanstack/virtual-core").ScrollToOptions) => void;
|
|
18
19
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
19
20
|
bottom: () => any;
|
|
20
21
|
retry: () => any;
|
|
@@ -22,14 +23,13 @@ declare const __VLS_base: import("vue").DefineComponent<VirtualListProps, {
|
|
|
22
23
|
onBottom?: (() => any) | undefined;
|
|
23
24
|
onRetry?: (() => any) | undefined;
|
|
24
25
|
}>, {
|
|
25
|
-
bottomThreshold: number;
|
|
26
26
|
listData: any[];
|
|
27
|
-
itemSize: number;
|
|
28
27
|
errorText: string;
|
|
29
28
|
loadingText: string;
|
|
30
29
|
finishedText: string;
|
|
31
30
|
dataKey: string;
|
|
32
|
-
|
|
31
|
+
columnGap: number;
|
|
32
|
+
columnCount: number;
|
|
33
33
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
34
34
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
35
35
|
declare const _default: typeof __VLS_export;
|
|
@@ -7,16 +7,20 @@ defineOptions({
|
|
|
7
7
|
inheritAttrs: false
|
|
8
8
|
});
|
|
9
9
|
const props = defineProps({
|
|
10
|
+
listClass: { type: [String, Array, Object], required: false },
|
|
11
|
+
itemClass: { type: [String, Array, Object], required: false },
|
|
10
12
|
errorText: { type: String, required: false, default: "Request failed. Click to reload" },
|
|
11
13
|
loadingText: { type: String, required: false, default: "Loading..." },
|
|
12
14
|
finishedText: { type: String, required: false, default: "Finished" },
|
|
13
15
|
status: { type: String, required: false },
|
|
14
16
|
dataKey: { type: String, required: false, default: "id" },
|
|
15
17
|
listData: { type: Array, required: false, default: () => [] },
|
|
16
|
-
itemSize: { type: Number, required: false
|
|
17
|
-
overScan: { type: Number, required: false
|
|
18
|
+
itemSize: { type: Number, required: false },
|
|
19
|
+
overScan: { type: Number, required: false },
|
|
20
|
+
columnGap: { type: Number, required: false, default: 0 },
|
|
21
|
+
columnCount: { type: Number, required: false, default: 1 },
|
|
18
22
|
onBottom: { type: Function, required: false },
|
|
19
|
-
bottomThreshold: { type: Number, required: false
|
|
23
|
+
bottomThreshold: { type: Number, required: false }
|
|
20
24
|
});
|
|
21
25
|
const emits = defineEmits(["retry", "bottom"]);
|
|
22
26
|
const containerRef = shallowRef();
|
|
@@ -29,6 +33,22 @@ const {
|
|
|
29
33
|
scrollToOffset,
|
|
30
34
|
scrollBy
|
|
31
35
|
} = useVirtualList(containerRef, props);
|
|
36
|
+
function getItemStyle(virtualItem) {
|
|
37
|
+
const lanes = Math.max(1, Math.floor(props.columnCount));
|
|
38
|
+
const gap = props.columnGap;
|
|
39
|
+
const y = `translateY(${virtualItem.start}px)`;
|
|
40
|
+
if (lanes <= 1) {
|
|
41
|
+
return { transform: y };
|
|
42
|
+
}
|
|
43
|
+
const lane = virtualItem.lane;
|
|
44
|
+
const width = `calc((100% - ${(lanes - 1) * gap}px) / ${lanes})`;
|
|
45
|
+
const left = `calc(${lane} * ((100% - ${(lanes - 1) * gap}px) / ${lanes} + ${gap}px))`;
|
|
46
|
+
return {
|
|
47
|
+
width,
|
|
48
|
+
left,
|
|
49
|
+
transform: y
|
|
50
|
+
};
|
|
51
|
+
}
|
|
32
52
|
function onRetryClick() {
|
|
33
53
|
if (props.status !== "error") {
|
|
34
54
|
return;
|
|
@@ -49,6 +69,7 @@ defineExpose({
|
|
|
49
69
|
<div ref="containerRef" class="pxd-virtual-list relative overflow-auto" v-bind="$attrs">
|
|
50
70
|
<div
|
|
51
71
|
class="pxd-virtual-list--content relative w-full content-visibility-auto"
|
|
72
|
+
:class="listClass"
|
|
52
73
|
:style="{ height: `${totalSize}px`, containIntrinsicSize: `auto ${totalSize}px` }"
|
|
53
74
|
>
|
|
54
75
|
<div
|
|
@@ -57,7 +78,8 @@ defineExpose({
|
|
|
57
78
|
:ref="(el) => measureElement(el)"
|
|
58
79
|
:data-index="virtualItem.index"
|
|
59
80
|
class="pxd-virtual-list--item left-0 top-0 absolute w-full"
|
|
60
|
-
:
|
|
81
|
+
:class="itemClass"
|
|
82
|
+
:style="getItemStyle(virtualItem)"
|
|
61
83
|
>
|
|
62
84
|
<slot name="item" :item="listData[virtualItem.index]" :virtual-item="virtualItem" />
|
|
63
85
|
</div>
|
|
@@ -66,7 +88,7 @@ defineExpose({
|
|
|
66
88
|
<div
|
|
67
89
|
v-if="status"
|
|
68
90
|
class="pxd-virtual-list--message py-4 text-sm left-0 right-0 flex items-center justify-center text-gray-600 empty:hidden motion-safe:transition-colors"
|
|
69
|
-
:class="{ 'cursor-pointer hover:text-gray-
|
|
91
|
+
:class="{ 'cursor-pointer hover:text-gray-800': status === 'error' }"
|
|
70
92
|
@click="onRetryClick"
|
|
71
93
|
>
|
|
72
94
|
<slot name="message">
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { VirtualListOptions } from '../../composables/use-virtual-list';
|
|
2
|
+
import type { ComponentClass } from '../../types/shared/props';
|
|
2
3
|
export interface VirtualListProps extends VirtualListOptions {
|
|
4
|
+
listClass?: ComponentClass;
|
|
5
|
+
itemClass?: ComponentClass;
|
|
3
6
|
errorText?: string;
|
|
4
7
|
loadingText?: string;
|
|
5
8
|
finishedText?: string;
|
|
@@ -9,15 +9,18 @@ export * from './use-delay-destroy.js';
|
|
|
9
9
|
export * from './use-document-hidden.js';
|
|
10
10
|
export * from './use-focus-trap.js';
|
|
11
11
|
export * from './use-forward-ref-expose.js';
|
|
12
|
+
export * from './use-list-filter.js';
|
|
13
|
+
export * from './use-list-navigation.js';
|
|
12
14
|
export * from './use-loading-bar.js';
|
|
13
15
|
export * from './use-lock-scroll.js';
|
|
14
16
|
export * from './use-media-query.js';
|
|
15
17
|
export * from './use-message.js';
|
|
16
18
|
export * from './use-model-value.js';
|
|
17
19
|
export * from './use-outside-click.js';
|
|
18
|
-
export * from './use-
|
|
20
|
+
export * from './use-overlay-manager.js';
|
|
19
21
|
export * from './use-popover-responsive.js';
|
|
20
22
|
export * from './use-repeat-action.js';
|
|
23
|
+
export * from './use-swipe-gesture.js';
|
|
21
24
|
export * from './use-toggle-value.js';
|
|
22
25
|
export * from './use-virtual-list.js';
|
|
23
26
|
export * from './use-window-size.js';
|
|
@@ -9,15 +9,18 @@ export * from "./use-delay-destroy.js";
|
|
|
9
9
|
export * from "./use-document-hidden.js";
|
|
10
10
|
export * from "./use-focus-trap.js";
|
|
11
11
|
export * from "./use-forward-ref-expose.js";
|
|
12
|
+
export * from "./use-list-filter.js";
|
|
13
|
+
export * from "./use-list-navigation.js";
|
|
12
14
|
export * from "./use-loading-bar.js";
|
|
13
15
|
export * from "./use-lock-scroll.js";
|
|
14
16
|
export * from "./use-media-query.js";
|
|
15
17
|
export * from "./use-message.js";
|
|
16
18
|
export * from "./use-model-value.js";
|
|
17
19
|
export * from "./use-outside-click.js";
|
|
18
|
-
export * from "./use-
|
|
20
|
+
export * from "./use-overlay-manager.js";
|
|
19
21
|
export * from "./use-popover-responsive.js";
|
|
20
22
|
export * from "./use-repeat-action.js";
|
|
23
|
+
export * from "./use-swipe-gesture.js";
|
|
21
24
|
export * from "./use-toggle-value.js";
|
|
22
25
|
export * from "./use-virtual-list.js";
|
|
23
26
|
export * from "./use-window-size.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isNotNil } from "es-toolkit";
|
|
2
|
-
import { computed,
|
|
2
|
+
import { computed, onScopeDispose, watch, shallowRef } from "vue";
|
|
3
3
|
import { toArray } from "../utils/format.js";
|
|
4
4
|
import { toValue, unrefElement } from "../utils/ref.js";
|
|
5
5
|
export const useIntersectionObserver = createObserver(
|
|
@@ -62,7 +62,7 @@ function createObserver(ObserverConstructor, type) {
|
|
|
62
62
|
cleanup();
|
|
63
63
|
unwatch();
|
|
64
64
|
}
|
|
65
|
-
|
|
65
|
+
onScopeDispose(() => {
|
|
66
66
|
stop();
|
|
67
67
|
});
|
|
68
68
|
return {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { onScopeDispose, onMounted, shallowRef } from "vue";
|
|
2
2
|
import { cachedOn } from "../utils/event.js";
|
|
3
3
|
import { isServer } from "../utils/is.js";
|
|
4
4
|
export function useClientOnline() {
|
|
@@ -12,7 +12,7 @@ export function useClientOnline() {
|
|
|
12
12
|
cleanOnline = cachedOn(window, "online", toggle);
|
|
13
13
|
cleanOffline = cachedOn(window, "offline", toggle);
|
|
14
14
|
});
|
|
15
|
-
|
|
15
|
+
onScopeDispose(() => {
|
|
16
16
|
cleanOnline?.();
|
|
17
17
|
cleanOffline?.();
|
|
18
18
|
});
|