@vueuse/components 12.3.0 → 12.4.0
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/index.cjs +76 -70
- package/index.iife.js +76 -70
- package/index.iife.min.js +1 -1
- package/index.mjs +76 -70
- package/package.json +3 -3
package/index.iife.js
CHANGED
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
|
|
20
|
-
const defaultWindow = shared.isClient ? window :
|
|
20
|
+
const defaultWindow = shared.isClient ? window : undefined;
|
|
21
21
|
|
|
22
22
|
function unrefElement(elRef) {
|
|
23
23
|
var _a;
|
|
24
24
|
const plain = vue.toValue(elRef);
|
|
25
|
-
return (_a = plain == null ?
|
|
25
|
+
return (_a = plain == null ? undefined : plain.$el) != null ? _a : plain;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
function useEventListener(...args) {
|
|
@@ -139,11 +139,11 @@
|
|
|
139
139
|
setTimeout(() => {
|
|
140
140
|
var _a;
|
|
141
141
|
const el = unrefElement(target);
|
|
142
|
-
if (((_a = window.document.activeElement) == null ?
|
|
142
|
+
if (((_a = window.document.activeElement) == null ? undefined : _a.tagName) === "IFRAME" && !(el == null ? undefined : el.contains(window.document.activeElement))) {
|
|
143
143
|
handler(event);
|
|
144
144
|
}
|
|
145
145
|
}, 0);
|
|
146
|
-
})
|
|
146
|
+
}, { passive: true })
|
|
147
147
|
].filter(Boolean);
|
|
148
148
|
const stop = () => cleanup.forEach((fn) => fn());
|
|
149
149
|
return stop;
|
|
@@ -213,7 +213,7 @@
|
|
|
213
213
|
const vOnKeyStroke = {
|
|
214
214
|
mounted(el, binding) {
|
|
215
215
|
var _a, _b;
|
|
216
|
-
const keys = (_b = (_a = binding.arg) == null ?
|
|
216
|
+
const keys = (_b = (_a = binding.arg) == null ? undefined : _a.split(",")) != null ? _b : true;
|
|
217
217
|
if (typeof binding.value === "function") {
|
|
218
218
|
onKeyStroke(keys, binding.value, {
|
|
219
219
|
target: el
|
|
@@ -240,23 +240,23 @@
|
|
|
240
240
|
function clear() {
|
|
241
241
|
if (timeout) {
|
|
242
242
|
clearTimeout(timeout);
|
|
243
|
-
timeout =
|
|
243
|
+
timeout = undefined;
|
|
244
244
|
}
|
|
245
|
-
posStart =
|
|
246
|
-
startTimestamp =
|
|
245
|
+
posStart = undefined;
|
|
246
|
+
startTimestamp = undefined;
|
|
247
247
|
hasLongPressed = false;
|
|
248
248
|
}
|
|
249
249
|
function onRelease(ev) {
|
|
250
250
|
var _a2, _b2, _c;
|
|
251
251
|
const [_startTimestamp, _posStart, _hasLongPressed] = [startTimestamp, posStart, hasLongPressed];
|
|
252
252
|
clear();
|
|
253
|
-
if (!(options == null ?
|
|
253
|
+
if (!(options == null ? undefined : options.onMouseUp) || !_posStart || !_startTimestamp)
|
|
254
254
|
return;
|
|
255
|
-
if (((_a2 = options == null ?
|
|
255
|
+
if (((_a2 = options == null ? undefined : options.modifiers) == null ? undefined : _a2.self) && ev.target !== elementRef.value)
|
|
256
256
|
return;
|
|
257
|
-
if ((_b2 = options == null ?
|
|
257
|
+
if ((_b2 = options == null ? undefined : options.modifiers) == null ? undefined : _b2.prevent)
|
|
258
258
|
ev.preventDefault();
|
|
259
|
-
if ((_c = options == null ?
|
|
259
|
+
if ((_c = options == null ? undefined : options.modifiers) == null ? undefined : _c.stop)
|
|
260
260
|
ev.stopPropagation();
|
|
261
261
|
const dx = ev.x - _posStart.x;
|
|
262
262
|
const dy = ev.y - _posStart.y;
|
|
@@ -265,12 +265,12 @@
|
|
|
265
265
|
}
|
|
266
266
|
function onDown(ev) {
|
|
267
267
|
var _a2, _b2, _c, _d;
|
|
268
|
-
if (((_a2 = options == null ?
|
|
268
|
+
if (((_a2 = options == null ? undefined : options.modifiers) == null ? undefined : _a2.self) && ev.target !== elementRef.value)
|
|
269
269
|
return;
|
|
270
270
|
clear();
|
|
271
|
-
if ((_b2 = options == null ?
|
|
271
|
+
if ((_b2 = options == null ? undefined : options.modifiers) == null ? undefined : _b2.prevent)
|
|
272
272
|
ev.preventDefault();
|
|
273
|
-
if ((_c = options == null ?
|
|
273
|
+
if ((_c = options == null ? undefined : options.modifiers) == null ? undefined : _c.stop)
|
|
274
274
|
ev.stopPropagation();
|
|
275
275
|
posStart = {
|
|
276
276
|
x: ev.x,
|
|
@@ -282,28 +282,28 @@
|
|
|
282
282
|
hasLongPressed = true;
|
|
283
283
|
handler(ev);
|
|
284
284
|
},
|
|
285
|
-
(_d = options == null ?
|
|
285
|
+
(_d = options == null ? undefined : options.delay) != null ? _d : DEFAULT_DELAY
|
|
286
286
|
);
|
|
287
287
|
}
|
|
288
288
|
function onMove(ev) {
|
|
289
289
|
var _a2, _b2, _c, _d;
|
|
290
|
-
if (((_a2 = options == null ?
|
|
290
|
+
if (((_a2 = options == null ? undefined : options.modifiers) == null ? undefined : _a2.self) && ev.target !== elementRef.value)
|
|
291
291
|
return;
|
|
292
|
-
if (!posStart || (options == null ?
|
|
292
|
+
if (!posStart || (options == null ? undefined : options.distanceThreshold) === false)
|
|
293
293
|
return;
|
|
294
|
-
if ((_b2 = options == null ?
|
|
294
|
+
if ((_b2 = options == null ? undefined : options.modifiers) == null ? undefined : _b2.prevent)
|
|
295
295
|
ev.preventDefault();
|
|
296
|
-
if ((_c = options == null ?
|
|
296
|
+
if ((_c = options == null ? undefined : options.modifiers) == null ? undefined : _c.stop)
|
|
297
297
|
ev.stopPropagation();
|
|
298
298
|
const dx = ev.x - posStart.x;
|
|
299
299
|
const dy = ev.y - posStart.y;
|
|
300
300
|
const distance = Math.sqrt(dx * dx + dy * dy);
|
|
301
|
-
if (distance >= ((_d = options == null ?
|
|
301
|
+
if (distance >= ((_d = options == null ? undefined : options.distanceThreshold) != null ? _d : DEFAULT_THRESHOLD))
|
|
302
302
|
clear();
|
|
303
303
|
}
|
|
304
304
|
const listenerOptions = {
|
|
305
|
-
capture: (_a = options == null ?
|
|
306
|
-
once: (_b = options == null ?
|
|
305
|
+
capture: (_a = options == null ? undefined : options.modifiers) == null ? undefined : _a.capture,
|
|
306
|
+
once: (_b = options == null ? undefined : options.modifiers) == null ? undefined : _b.once
|
|
307
307
|
};
|
|
308
308
|
const cleanup = [
|
|
309
309
|
useEventListener(elementRef, "pointerdown", onDown, listenerOptions),
|
|
@@ -391,7 +391,7 @@
|
|
|
391
391
|
const data = vue.reactive(core.useClipboard(props));
|
|
392
392
|
return () => {
|
|
393
393
|
var _a;
|
|
394
|
-
return (_a = slots.default) == null ?
|
|
394
|
+
return (_a = slots.default) == null ? undefined : _a.call(slots, data);
|
|
395
395
|
};
|
|
396
396
|
}
|
|
397
397
|
});
|
|
@@ -411,7 +411,7 @@
|
|
|
411
411
|
const ssrWidthSymbol = Symbol("vueuse-ssr-width");
|
|
412
412
|
function useSSRWidth() {
|
|
413
413
|
const ssrWidth = vue.hasInjectionContext() ? shared.injectLocal(ssrWidthSymbol, null) : null;
|
|
414
|
-
return typeof ssrWidth === "number" ? ssrWidth :
|
|
414
|
+
return typeof ssrWidth === "number" ? ssrWidth : undefined;
|
|
415
415
|
}
|
|
416
416
|
|
|
417
417
|
function useMounted() {
|
|
@@ -482,7 +482,7 @@
|
|
|
482
482
|
shared.tryOnScopeDispose(() => {
|
|
483
483
|
stopWatch();
|
|
484
484
|
cleanup();
|
|
485
|
-
mediaQuery =
|
|
485
|
+
mediaQuery = undefined;
|
|
486
486
|
});
|
|
487
487
|
return vue.computed(() => matches.value);
|
|
488
488
|
}
|
|
@@ -547,6 +547,7 @@
|
|
|
547
547
|
initOnMounted
|
|
548
548
|
} = options;
|
|
549
549
|
const data = (shallow ? vue.shallowRef : vue.ref)(typeof defaults === "function" ? defaults() : defaults);
|
|
550
|
+
const keyComputed = vue.computed(() => vue.toValue(key));
|
|
550
551
|
if (!storage) {
|
|
551
552
|
try {
|
|
552
553
|
storage = getSSRHandler("getDefaultStorage", () => {
|
|
@@ -567,10 +568,11 @@
|
|
|
567
568
|
() => write(data.value),
|
|
568
569
|
{ flush, deep, eventFilter }
|
|
569
570
|
);
|
|
571
|
+
vue.watch(keyComputed, () => update(), { flush });
|
|
570
572
|
if (window && listenToStorageChanges) {
|
|
571
573
|
shared.tryOnMounted(() => {
|
|
572
574
|
if (storage instanceof Storage)
|
|
573
|
-
useEventListener(window, "storage", update);
|
|
575
|
+
useEventListener(window, "storage", update, { passive: true });
|
|
574
576
|
else
|
|
575
577
|
useEventListener(window, customStorageEventName, updateFromCustomEvent);
|
|
576
578
|
if (initOnMounted)
|
|
@@ -582,7 +584,7 @@
|
|
|
582
584
|
function dispatchWriteEvent(oldValue, newValue) {
|
|
583
585
|
if (window) {
|
|
584
586
|
const payload = {
|
|
585
|
-
key,
|
|
587
|
+
key: keyComputed.value,
|
|
586
588
|
oldValue,
|
|
587
589
|
newValue,
|
|
588
590
|
storageArea: storage
|
|
@@ -594,14 +596,14 @@
|
|
|
594
596
|
}
|
|
595
597
|
function write(v) {
|
|
596
598
|
try {
|
|
597
|
-
const oldValue = storage.getItem(
|
|
599
|
+
const oldValue = storage.getItem(keyComputed.value);
|
|
598
600
|
if (v == null) {
|
|
599
601
|
dispatchWriteEvent(oldValue, null);
|
|
600
|
-
storage.removeItem(
|
|
602
|
+
storage.removeItem(keyComputed.value);
|
|
601
603
|
} else {
|
|
602
604
|
const serialized = serializer.write(v);
|
|
603
605
|
if (oldValue !== serialized) {
|
|
604
|
-
storage.setItem(
|
|
606
|
+
storage.setItem(keyComputed.value, serialized);
|
|
605
607
|
dispatchWriteEvent(oldValue, serialized);
|
|
606
608
|
}
|
|
607
609
|
}
|
|
@@ -610,10 +612,10 @@
|
|
|
610
612
|
}
|
|
611
613
|
}
|
|
612
614
|
function read(event) {
|
|
613
|
-
const rawValue = event ? event.newValue : storage.getItem(
|
|
615
|
+
const rawValue = event ? event.newValue : storage.getItem(keyComputed.value);
|
|
614
616
|
if (rawValue == null) {
|
|
615
617
|
if (writeDefaults && rawInit != null)
|
|
616
|
-
storage.setItem(
|
|
618
|
+
storage.setItem(keyComputed.value, serializer.write(rawInit));
|
|
617
619
|
return rawInit;
|
|
618
620
|
} else if (!event && mergeDefaults) {
|
|
619
621
|
const value = serializer.read(rawValue);
|
|
@@ -635,7 +637,7 @@
|
|
|
635
637
|
data.value = rawInit;
|
|
636
638
|
return;
|
|
637
639
|
}
|
|
638
|
-
if (event && event.key !==
|
|
640
|
+
if (event && event.key !== keyComputed.value)
|
|
639
641
|
return;
|
|
640
642
|
pauseWatch();
|
|
641
643
|
try {
|
|
@@ -683,7 +685,7 @@
|
|
|
683
685
|
const updateHTMLAttrs = getSSRHandler(
|
|
684
686
|
"updateHTMLAttrs",
|
|
685
687
|
(selector2, attribute2, value) => {
|
|
686
|
-
const el = typeof selector2 === "string" ? window == null ?
|
|
688
|
+
const el = typeof selector2 === "string" ? window == null ? undefined : window.document.querySelector(selector2) : unrefElement(selector2);
|
|
687
689
|
if (!el)
|
|
688
690
|
return;
|
|
689
691
|
const classesToAdd = /* @__PURE__ */ new Set();
|
|
@@ -867,18 +869,18 @@
|
|
|
867
869
|
});
|
|
868
870
|
const containerElement = vue.computed(() => {
|
|
869
871
|
var _a;
|
|
870
|
-
return (_a = props.containerElement) != null ? _a :
|
|
872
|
+
return (_a = props.containerElement) != null ? _a : undefined;
|
|
871
873
|
});
|
|
872
874
|
const disabled = vue.computed(() => !!props.disabled);
|
|
873
875
|
const storageValue = props.storageKey && core.useStorage(
|
|
874
876
|
props.storageKey,
|
|
875
877
|
vue.toValue(props.initialValue) || { x: 0, y: 0 },
|
|
876
|
-
core.isClient ? props.storageType === "session" ? sessionStorage : localStorage :
|
|
878
|
+
core.isClient ? props.storageType === "session" ? sessionStorage : localStorage : undefined
|
|
877
879
|
);
|
|
878
880
|
const initialValue = storageValue || props.initialValue || { x: 0, y: 0 };
|
|
879
881
|
const onEnd = (position, event) => {
|
|
880
882
|
var _a;
|
|
881
|
-
(_a = props.onEnd) == null ?
|
|
883
|
+
(_a = props.onEnd) == null ? undefined : _a.call(props, position, event);
|
|
882
884
|
if (!storageValue)
|
|
883
885
|
return;
|
|
884
886
|
storageValue.value.x = position.x;
|
|
@@ -919,7 +921,7 @@
|
|
|
919
921
|
const cleanup = () => {
|
|
920
922
|
if (observer) {
|
|
921
923
|
observer.disconnect();
|
|
922
|
-
observer =
|
|
924
|
+
observer = undefined;
|
|
923
925
|
}
|
|
924
926
|
};
|
|
925
927
|
const targets = vue.computed(() => {
|
|
@@ -939,7 +941,7 @@
|
|
|
939
941
|
{ immediate: true, flush: "post" }
|
|
940
942
|
);
|
|
941
943
|
const takeRecords = () => {
|
|
942
|
-
return observer == null ?
|
|
944
|
+
return observer == null ? undefined : observer.takeRecords();
|
|
943
945
|
};
|
|
944
946
|
const stop = () => {
|
|
945
947
|
stopWatch();
|
|
@@ -960,7 +962,7 @@
|
|
|
960
962
|
const cleanup = () => {
|
|
961
963
|
if (observer) {
|
|
962
964
|
observer.disconnect();
|
|
963
|
-
observer =
|
|
965
|
+
observer = undefined;
|
|
964
966
|
}
|
|
965
967
|
};
|
|
966
968
|
const targets = vue.computed(() => {
|
|
@@ -1085,14 +1087,14 @@
|
|
|
1085
1087
|
function onElementRemoval(target, callback, options = {}) {
|
|
1086
1088
|
const {
|
|
1087
1089
|
window = defaultWindow,
|
|
1088
|
-
document = window == null ?
|
|
1090
|
+
document = window == null ? undefined : window.document,
|
|
1089
1091
|
flush = "sync"
|
|
1090
1092
|
} = options;
|
|
1091
1093
|
if (!window || !document)
|
|
1092
1094
|
return shared.noop;
|
|
1093
1095
|
let stopFn;
|
|
1094
1096
|
const cleanupAndUpdate = (fn) => {
|
|
1095
|
-
stopFn == null ?
|
|
1097
|
+
stopFn == null ? undefined : stopFn();
|
|
1096
1098
|
stopFn = fn;
|
|
1097
1099
|
};
|
|
1098
1100
|
const stopWatch = vue.watchEffect(() => {
|
|
@@ -1136,7 +1138,7 @@
|
|
|
1136
1138
|
const delay = entering ? delayEnter : delayLeave;
|
|
1137
1139
|
if (timer) {
|
|
1138
1140
|
clearTimeout(timer);
|
|
1139
|
-
timer =
|
|
1141
|
+
timer = undefined;
|
|
1140
1142
|
}
|
|
1141
1143
|
if (delay)
|
|
1142
1144
|
timer = setTimeout(() => isHovered.value = entering, delay);
|
|
@@ -1187,7 +1189,7 @@
|
|
|
1187
1189
|
const { window = defaultWindow, box = "content-box" } = options;
|
|
1188
1190
|
const isSVG = vue.computed(() => {
|
|
1189
1191
|
var _a, _b;
|
|
1190
|
-
return (_b = (_a = unrefElement(target)) == null ?
|
|
1192
|
+
return (_b = (_a = unrefElement(target)) == null ? undefined : _a.namespaceURI) == null ? undefined : _b.includes("svg");
|
|
1191
1193
|
});
|
|
1192
1194
|
const width = vue.ref(initialSize.width);
|
|
1193
1195
|
const height = vue.ref(initialSize.height);
|
|
@@ -1243,7 +1245,7 @@
|
|
|
1243
1245
|
const vElementSize = {
|
|
1244
1246
|
mounted(el, binding) {
|
|
1245
1247
|
var _a;
|
|
1246
|
-
const handler = typeof binding.value === "function" ? binding.value : (_a = binding.value) == null ?
|
|
1248
|
+
const handler = typeof binding.value === "function" ? binding.value : (_a = binding.value) == null ? undefined : _a[0];
|
|
1247
1249
|
const options = typeof binding.value === "function" ? [] : binding.value.slice(1);
|
|
1248
1250
|
const { width, height } = useElementSize(el, ...options);
|
|
1249
1251
|
vue.watch([width, height], ([width2, height2]) => handler({ width: width2, height: height2 }));
|
|
@@ -1433,11 +1435,11 @@
|
|
|
1433
1435
|
const state = shallow ? vue.shallowRef(initialState) : vue.ref(initialState);
|
|
1434
1436
|
const isReady = vue.ref(false);
|
|
1435
1437
|
const isLoading = vue.ref(false);
|
|
1436
|
-
const error = vue.shallowRef(
|
|
1438
|
+
const error = vue.shallowRef(undefined);
|
|
1437
1439
|
async function execute(delay2 = 0, ...args) {
|
|
1438
1440
|
if (resetOnExecute)
|
|
1439
1441
|
state.value = initialState;
|
|
1440
|
-
error.value =
|
|
1442
|
+
error.value = undefined;
|
|
1441
1443
|
isReady.value = false;
|
|
1442
1444
|
isLoading.value = true;
|
|
1443
1445
|
if (delay2 > 0)
|
|
@@ -1458,8 +1460,9 @@
|
|
|
1458
1460
|
}
|
|
1459
1461
|
return state.value;
|
|
1460
1462
|
}
|
|
1461
|
-
if (immediate)
|
|
1463
|
+
if (immediate) {
|
|
1462
1464
|
execute(delay);
|
|
1465
|
+
}
|
|
1463
1466
|
const shell = {
|
|
1464
1467
|
state,
|
|
1465
1468
|
isReady,
|
|
@@ -1516,7 +1519,7 @@
|
|
|
1516
1519
|
function useImage(options, asyncStateOptions = {}) {
|
|
1517
1520
|
const state = useAsyncState(
|
|
1518
1521
|
() => loadImage(vue.toValue(options)),
|
|
1519
|
-
|
|
1522
|
+
undefined,
|
|
1520
1523
|
{
|
|
1521
1524
|
resetOnExecute: true,
|
|
1522
1525
|
...asyncStateOptions
|
|
@@ -1601,7 +1604,7 @@
|
|
|
1601
1604
|
return internalX.value;
|
|
1602
1605
|
},
|
|
1603
1606
|
set(x2) {
|
|
1604
|
-
scrollTo(x2,
|
|
1607
|
+
scrollTo(x2, undefined);
|
|
1605
1608
|
}
|
|
1606
1609
|
});
|
|
1607
1610
|
const y = vue.computed({
|
|
@@ -1609,7 +1612,7 @@
|
|
|
1609
1612
|
return internalY.value;
|
|
1610
1613
|
},
|
|
1611
1614
|
set(y2) {
|
|
1612
|
-
scrollTo(
|
|
1615
|
+
scrollTo(undefined, y2);
|
|
1613
1616
|
}
|
|
1614
1617
|
});
|
|
1615
1618
|
function scrollTo(_x, _y) {
|
|
@@ -1619,12 +1622,12 @@
|
|
|
1619
1622
|
const _element = vue.toValue(element);
|
|
1620
1623
|
if (!_element)
|
|
1621
1624
|
return;
|
|
1622
|
-
(_c = _element instanceof Document ? window.document.body : _element) == null ?
|
|
1625
|
+
(_c = _element instanceof Document ? window.document.body : _element) == null ? undefined : _c.scrollTo({
|
|
1623
1626
|
top: (_a = vue.toValue(_y)) != null ? _a : y.value,
|
|
1624
1627
|
left: (_b = vue.toValue(_x)) != null ? _b : x.value,
|
|
1625
1628
|
behavior: vue.toValue(behavior)
|
|
1626
1629
|
});
|
|
1627
|
-
const scrollContainer = ((_d = _element == null ?
|
|
1630
|
+
const scrollContainer = ((_d = _element == null ? undefined : _element.document) == null ? undefined : _d.documentElement) || (_element == null ? undefined : _element.documentElement) || _element;
|
|
1628
1631
|
if (x != null)
|
|
1629
1632
|
internalX.value = scrollContainer.scrollLeft;
|
|
1630
1633
|
if (y != null)
|
|
@@ -1658,7 +1661,7 @@
|
|
|
1658
1661
|
var _a;
|
|
1659
1662
|
if (!window)
|
|
1660
1663
|
return;
|
|
1661
|
-
const el = ((_a = target == null ?
|
|
1664
|
+
const el = ((_a = target == null ? undefined : target.document) == null ? undefined : _a.documentElement) || (target == null ? undefined : target.documentElement) || unrefElement(target);
|
|
1662
1665
|
const { display, flexDirection, direction } = getComputedStyle(el);
|
|
1663
1666
|
const directionMultipler = direction === "rtl" ? -1 : 1;
|
|
1664
1667
|
const scrollLeft = el.scrollLeft;
|
|
@@ -1904,7 +1907,7 @@
|
|
|
1904
1907
|
useEventListener(target, "touchend", reset, listenerOptions);
|
|
1905
1908
|
}
|
|
1906
1909
|
if (scroll && type === "page")
|
|
1907
|
-
useEventListener(window, "scroll", scrollHandlerWrapper,
|
|
1910
|
+
useEventListener(window, "scroll", scrollHandlerWrapper, listenerOptions);
|
|
1908
1911
|
}
|
|
1909
1912
|
return {
|
|
1910
1913
|
x,
|
|
@@ -1920,7 +1923,7 @@
|
|
|
1920
1923
|
} = options;
|
|
1921
1924
|
const type = options.type || "page";
|
|
1922
1925
|
const { x, y, sourceType } = useMouse(options);
|
|
1923
|
-
const targetRef = vue.ref(target != null ? target : window == null ?
|
|
1926
|
+
const targetRef = vue.ref(target != null ? target : window == null ? undefined : window.document.body);
|
|
1924
1927
|
const elementX = vue.ref(0);
|
|
1925
1928
|
const elementY = vue.ref(0);
|
|
1926
1929
|
const elementPositionX = vue.ref(0);
|
|
@@ -1957,9 +1960,12 @@
|
|
|
1957
1960
|
},
|
|
1958
1961
|
{ immediate: true }
|
|
1959
1962
|
);
|
|
1960
|
-
useEventListener(
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
+
useEventListener(
|
|
1964
|
+
document,
|
|
1965
|
+
"mouseleave",
|
|
1966
|
+
() => isOutside.value = true,
|
|
1967
|
+
{ passive: true }
|
|
1968
|
+
);
|
|
1963
1969
|
}
|
|
1964
1970
|
return {
|
|
1965
1971
|
x,
|
|
@@ -2055,17 +2061,17 @@
|
|
|
2055
2061
|
...props,
|
|
2056
2062
|
onPageChange(...args) {
|
|
2057
2063
|
var _a;
|
|
2058
|
-
(_a = props.onPageChange) == null ?
|
|
2064
|
+
(_a = props.onPageChange) == null ? undefined : _a.call(props, ...args);
|
|
2059
2065
|
emit("page-change", ...args);
|
|
2060
2066
|
},
|
|
2061
2067
|
onPageSizeChange(...args) {
|
|
2062
2068
|
var _a;
|
|
2063
|
-
(_a = props.onPageSizeChange) == null ?
|
|
2069
|
+
(_a = props.onPageSizeChange) == null ? undefined : _a.call(props, ...args);
|
|
2064
2070
|
emit("page-size-change", ...args);
|
|
2065
2071
|
},
|
|
2066
2072
|
onPageCountChange(...args) {
|
|
2067
2073
|
var _a;
|
|
2068
|
-
(_a = props.onPageCountChange) == null ?
|
|
2074
|
+
(_a = props.onPageCountChange) == null ? undefined : _a.call(props, ...args);
|
|
2069
2075
|
emit("page-count-change", ...args);
|
|
2070
2076
|
}
|
|
2071
2077
|
}));
|
|
@@ -2227,14 +2233,14 @@
|
|
|
2227
2233
|
const variable = vue.ref(initialValue);
|
|
2228
2234
|
const elRef = vue.computed(() => {
|
|
2229
2235
|
var _a;
|
|
2230
|
-
return unrefElement(target) || ((_a = window == null ?
|
|
2236
|
+
return unrefElement(target) || ((_a = window == null ? undefined : window.document) == null ? undefined : _a.documentElement);
|
|
2231
2237
|
});
|
|
2232
2238
|
function updateCssVar() {
|
|
2233
2239
|
var _a;
|
|
2234
2240
|
const key = vue.toValue(prop);
|
|
2235
2241
|
const el = vue.toValue(elRef);
|
|
2236
2242
|
if (el && window && key) {
|
|
2237
|
-
const value = (_a = window.getComputedStyle(el).getPropertyValue(key)) == null ?
|
|
2243
|
+
const value = (_a = window.getComputedStyle(el).getPropertyValue(key)) == null ? undefined : _a.trim();
|
|
2238
2244
|
variable.value = value || initialValue;
|
|
2239
2245
|
}
|
|
2240
2246
|
}
|
|
@@ -2258,7 +2264,7 @@
|
|
|
2258
2264
|
(val) => {
|
|
2259
2265
|
var _a;
|
|
2260
2266
|
const raw_prop = vue.toValue(prop);
|
|
2261
|
-
if (((_a = elRef.value) == null ?
|
|
2267
|
+
if (((_a = elRef.value) == null ? undefined : _a.style) && raw_prop) {
|
|
2262
2268
|
if (val == null)
|
|
2263
2269
|
elRef.value.style.removeProperty(raw_prop);
|
|
2264
2270
|
else
|
|
@@ -2288,7 +2294,7 @@
|
|
|
2288
2294
|
bottomCssVar.value = "env(safe-area-inset-bottom, 0px)";
|
|
2289
2295
|
leftCssVar.value = "env(safe-area-inset-left, 0px)";
|
|
2290
2296
|
update();
|
|
2291
|
-
useEventListener("resize", shared.useDebounceFn(update));
|
|
2297
|
+
useEventListener("resize", shared.useDebounceFn(update), { passive: true });
|
|
2292
2298
|
}
|
|
2293
2299
|
function update() {
|
|
2294
2300
|
top.value = getValue(topVarName);
|
|
@@ -2360,12 +2366,12 @@
|
|
|
2360
2366
|
...options,
|
|
2361
2367
|
onScroll(e) {
|
|
2362
2368
|
var _a;
|
|
2363
|
-
(_a = options.onScroll) == null ?
|
|
2369
|
+
(_a = options.onScroll) == null ? undefined : _a.call(options, e);
|
|
2364
2370
|
handler(state);
|
|
2365
2371
|
},
|
|
2366
2372
|
onStop(e) {
|
|
2367
2373
|
var _a;
|
|
2368
|
-
(_a = options.onStop) == null ?
|
|
2374
|
+
(_a = options.onStop) == null ? undefined : _a.call(options, e);
|
|
2369
2375
|
handler(state);
|
|
2370
2376
|
}
|
|
2371
2377
|
});
|
|
@@ -2438,7 +2444,7 @@
|
|
|
2438
2444
|
if (!el || !isLocked.value)
|
|
2439
2445
|
return;
|
|
2440
2446
|
if (shared.isIOS)
|
|
2441
|
-
stopTouchMoveListener == null ?
|
|
2447
|
+
stopTouchMoveListener == null ? undefined : stopTouchMoveListener();
|
|
2442
2448
|
el.style.overflow = initialOverflow;
|
|
2443
2449
|
elInitialOverflow.delete(el);
|
|
2444
2450
|
isLocked.value = false;
|