@vueuse/shared 10.3.0 → 10.4.1
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 +98 -388
- package/index.d.cts +2 -2
- package/index.d.mts +2 -2
- package/index.d.ts +2 -2
- package/index.iife.js +98 -388
- package/index.iife.min.js +1 -1
- package/index.mjs +98 -388
- package/package.json +3 -3
package/index.iife.js
CHANGED
|
@@ -117,33 +117,15 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
117
117
|
;(function (exports, vueDemi) {
|
|
118
118
|
'use strict';
|
|
119
119
|
|
|
120
|
-
var __defProp$b = Object.defineProperty;
|
|
121
|
-
var __defProps$8 = Object.defineProperties;
|
|
122
|
-
var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
|
|
123
|
-
var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
|
|
124
|
-
var __hasOwnProp$d = Object.prototype.hasOwnProperty;
|
|
125
|
-
var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
|
|
126
|
-
var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
127
|
-
var __spreadValues$b = (a, b) => {
|
|
128
|
-
for (var prop in b || (b = {}))
|
|
129
|
-
if (__hasOwnProp$d.call(b, prop))
|
|
130
|
-
__defNormalProp$b(a, prop, b[prop]);
|
|
131
|
-
if (__getOwnPropSymbols$d)
|
|
132
|
-
for (var prop of __getOwnPropSymbols$d(b)) {
|
|
133
|
-
if (__propIsEnum$d.call(b, prop))
|
|
134
|
-
__defNormalProp$b(a, prop, b[prop]);
|
|
135
|
-
}
|
|
136
|
-
return a;
|
|
137
|
-
};
|
|
138
|
-
var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
|
|
139
120
|
function computedEager(fn, options) {
|
|
140
121
|
var _a;
|
|
141
122
|
const result = vueDemi.shallowRef();
|
|
142
123
|
vueDemi.watchEffect(() => {
|
|
143
124
|
result.value = fn();
|
|
144
|
-
},
|
|
125
|
+
}, {
|
|
126
|
+
...options,
|
|
145
127
|
flush: (_a = options == null ? void 0 : options.flush) != null ? _a : "sync"
|
|
146
|
-
})
|
|
128
|
+
});
|
|
147
129
|
return vueDemi.readonly(result);
|
|
148
130
|
}
|
|
149
131
|
|
|
@@ -295,25 +277,9 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
295
277
|
return vueDemi.unref(v) != null;
|
|
296
278
|
}
|
|
297
279
|
|
|
298
|
-
var __defProp$a = Object.defineProperty;
|
|
299
|
-
var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
|
|
300
|
-
var __hasOwnProp$c = Object.prototype.hasOwnProperty;
|
|
301
|
-
var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
|
|
302
|
-
var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
303
|
-
var __spreadValues$a = (a, b) => {
|
|
304
|
-
for (var prop in b || (b = {}))
|
|
305
|
-
if (__hasOwnProp$c.call(b, prop))
|
|
306
|
-
__defNormalProp$a(a, prop, b[prop]);
|
|
307
|
-
if (__getOwnPropSymbols$c)
|
|
308
|
-
for (var prop of __getOwnPropSymbols$c(b)) {
|
|
309
|
-
if (__propIsEnum$c.call(b, prop))
|
|
310
|
-
__defNormalProp$a(a, prop, b[prop]);
|
|
311
|
-
}
|
|
312
|
-
return a;
|
|
313
|
-
};
|
|
314
280
|
function makeDestructurable(obj, arr) {
|
|
315
281
|
if (typeof Symbol !== "undefined") {
|
|
316
|
-
const clone =
|
|
282
|
+
const clone = { ...obj };
|
|
317
283
|
Object.defineProperty(clone, Symbol.iterator, {
|
|
318
284
|
enumerable: false,
|
|
319
285
|
value() {
|
|
@@ -412,7 +378,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
412
378
|
);
|
|
413
379
|
}
|
|
414
380
|
|
|
415
|
-
const isClient = typeof window !== "undefined";
|
|
381
|
+
const isClient = typeof window !== "undefined" && typeof document !== "undefined";
|
|
416
382
|
const isDef = (val) => typeof val !== "undefined";
|
|
417
383
|
const notNullish = (val) => val != null;
|
|
418
384
|
const assert = (condition, ...infos) => {
|
|
@@ -650,10 +616,10 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
650
616
|
|
|
651
617
|
function refAutoReset(defaultValue, afterMs = 1e4) {
|
|
652
618
|
return vueDemi.customRef((track, trigger) => {
|
|
653
|
-
let value = defaultValue;
|
|
619
|
+
let value = toValue(defaultValue);
|
|
654
620
|
let timer;
|
|
655
621
|
const resetAfter = () => setTimeout(() => {
|
|
656
|
-
value = defaultValue;
|
|
622
|
+
value = toValue(defaultValue);
|
|
657
623
|
trigger();
|
|
658
624
|
}, toValue(afterMs));
|
|
659
625
|
tryOnScopeDispose(() => {
|
|
@@ -787,6 +753,38 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
787
753
|
}
|
|
788
754
|
}
|
|
789
755
|
|
|
756
|
+
function watchWithFilter(source, cb, options = {}) {
|
|
757
|
+
const {
|
|
758
|
+
eventFilter = bypassFilter,
|
|
759
|
+
...watchOptions
|
|
760
|
+
} = options;
|
|
761
|
+
return vueDemi.watch(
|
|
762
|
+
source,
|
|
763
|
+
createFilterWrapper(
|
|
764
|
+
eventFilter,
|
|
765
|
+
cb
|
|
766
|
+
),
|
|
767
|
+
watchOptions
|
|
768
|
+
);
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
function watchPausable(source, cb, options = {}) {
|
|
772
|
+
const {
|
|
773
|
+
eventFilter: filter,
|
|
774
|
+
...watchOptions
|
|
775
|
+
} = options;
|
|
776
|
+
const { eventFilter, pause, resume, isActive } = pausableFilter(filter);
|
|
777
|
+
const stop = watchWithFilter(
|
|
778
|
+
source,
|
|
779
|
+
cb,
|
|
780
|
+
{
|
|
781
|
+
...watchOptions,
|
|
782
|
+
eventFilter
|
|
783
|
+
}
|
|
784
|
+
);
|
|
785
|
+
return { stop, pause, resume, isActive };
|
|
786
|
+
}
|
|
787
|
+
|
|
790
788
|
function syncRef(left, right, options = {}) {
|
|
791
789
|
var _a, _b;
|
|
792
790
|
const {
|
|
@@ -796,28 +794,35 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
796
794
|
direction = "both",
|
|
797
795
|
transform = {}
|
|
798
796
|
} = options;
|
|
799
|
-
|
|
800
|
-
let watchRight;
|
|
797
|
+
const watchers = [];
|
|
801
798
|
const transformLTR = (_a = transform.ltr) != null ? _a : (v) => v;
|
|
802
799
|
const transformRTL = (_b = transform.rtl) != null ? _b : (v) => v;
|
|
803
800
|
if (direction === "both" || direction === "ltr") {
|
|
804
|
-
|
|
801
|
+
watchers.push(watchPausable(
|
|
805
802
|
left,
|
|
806
|
-
(newValue) =>
|
|
803
|
+
(newValue) => {
|
|
804
|
+
watchers.forEach((w) => w.pause());
|
|
805
|
+
right.value = transformLTR(newValue);
|
|
806
|
+
watchers.forEach((w) => w.resume());
|
|
807
|
+
},
|
|
807
808
|
{ flush, deep, immediate }
|
|
808
|
-
);
|
|
809
|
+
));
|
|
809
810
|
}
|
|
810
811
|
if (direction === "both" || direction === "rtl") {
|
|
811
|
-
|
|
812
|
+
watchers.push(watchPausable(
|
|
812
813
|
right,
|
|
813
|
-
(newValue) =>
|
|
814
|
+
(newValue) => {
|
|
815
|
+
watchers.forEach((w) => w.pause());
|
|
816
|
+
left.value = transformRTL(newValue);
|
|
817
|
+
watchers.forEach((w) => w.resume());
|
|
818
|
+
},
|
|
814
819
|
{ flush, deep, immediate }
|
|
815
|
-
);
|
|
820
|
+
));
|
|
816
821
|
}
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
watchRight == null ? void 0 : watchRight();
|
|
822
|
+
const stop = () => {
|
|
823
|
+
watchers.forEach((w) => w.stop());
|
|
820
824
|
};
|
|
825
|
+
return stop;
|
|
821
826
|
}
|
|
822
827
|
|
|
823
828
|
function syncRefs(source, targets, options = {}) {
|
|
@@ -835,25 +840,6 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
835
840
|
);
|
|
836
841
|
}
|
|
837
842
|
|
|
838
|
-
var __defProp$9 = Object.defineProperty;
|
|
839
|
-
var __defProps$7 = Object.defineProperties;
|
|
840
|
-
var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
|
|
841
|
-
var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
|
|
842
|
-
var __hasOwnProp$b = Object.prototype.hasOwnProperty;
|
|
843
|
-
var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
|
|
844
|
-
var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
845
|
-
var __spreadValues$9 = (a, b) => {
|
|
846
|
-
for (var prop in b || (b = {}))
|
|
847
|
-
if (__hasOwnProp$b.call(b, prop))
|
|
848
|
-
__defNormalProp$9(a, prop, b[prop]);
|
|
849
|
-
if (__getOwnPropSymbols$b)
|
|
850
|
-
for (var prop of __getOwnPropSymbols$b(b)) {
|
|
851
|
-
if (__propIsEnum$b.call(b, prop))
|
|
852
|
-
__defNormalProp$9(a, prop, b[prop]);
|
|
853
|
-
}
|
|
854
|
-
return a;
|
|
855
|
-
};
|
|
856
|
-
var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
|
|
857
843
|
function toRefs(objectRef, options = {}) {
|
|
858
844
|
if (!vueDemi.isRef(objectRef))
|
|
859
845
|
return vueDemi.toRefs(objectRef);
|
|
@@ -872,7 +858,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
872
858
|
copy[key] = v;
|
|
873
859
|
objectRef.value = copy;
|
|
874
860
|
} else {
|
|
875
|
-
const newObject =
|
|
861
|
+
const newObject = { ...objectRef.value, [key]: v };
|
|
876
862
|
Object.setPrototypeOf(newObject, Object.getPrototypeOf(objectRef.value));
|
|
877
863
|
objectRef.value = newObject;
|
|
878
864
|
}
|
|
@@ -1279,22 +1265,6 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
1279
1265
|
};
|
|
1280
1266
|
}
|
|
1281
1267
|
|
|
1282
|
-
var __defProp$8 = Object.defineProperty;
|
|
1283
|
-
var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
|
|
1284
|
-
var __hasOwnProp$a = Object.prototype.hasOwnProperty;
|
|
1285
|
-
var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
|
|
1286
|
-
var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1287
|
-
var __spreadValues$8 = (a, b) => {
|
|
1288
|
-
for (var prop in b || (b = {}))
|
|
1289
|
-
if (__hasOwnProp$a.call(b, prop))
|
|
1290
|
-
__defNormalProp$8(a, prop, b[prop]);
|
|
1291
|
-
if (__getOwnPropSymbols$a)
|
|
1292
|
-
for (var prop of __getOwnPropSymbols$a(b)) {
|
|
1293
|
-
if (__propIsEnum$a.call(b, prop))
|
|
1294
|
-
__defNormalProp$8(a, prop, b[prop]);
|
|
1295
|
-
}
|
|
1296
|
-
return a;
|
|
1297
|
-
};
|
|
1298
1268
|
function useInterval(interval = 1e3, options = {}) {
|
|
1299
1269
|
const {
|
|
1300
1270
|
controls: exposeControls = false,
|
|
@@ -1315,10 +1285,11 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
1315
1285
|
{ immediate }
|
|
1316
1286
|
);
|
|
1317
1287
|
if (exposeControls) {
|
|
1318
|
-
return
|
|
1288
|
+
return {
|
|
1319
1289
|
counter,
|
|
1320
|
-
reset
|
|
1321
|
-
|
|
1290
|
+
reset,
|
|
1291
|
+
...controls
|
|
1292
|
+
};
|
|
1322
1293
|
} else {
|
|
1323
1294
|
return counter;
|
|
1324
1295
|
}
|
|
@@ -1373,22 +1344,6 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
1373
1344
|
};
|
|
1374
1345
|
}
|
|
1375
1346
|
|
|
1376
|
-
var __defProp$7 = Object.defineProperty;
|
|
1377
|
-
var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
|
|
1378
|
-
var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
|
|
1379
|
-
var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
|
|
1380
|
-
var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1381
|
-
var __spreadValues$7 = (a, b) => {
|
|
1382
|
-
for (var prop in b || (b = {}))
|
|
1383
|
-
if (__hasOwnProp$9.call(b, prop))
|
|
1384
|
-
__defNormalProp$7(a, prop, b[prop]);
|
|
1385
|
-
if (__getOwnPropSymbols$9)
|
|
1386
|
-
for (var prop of __getOwnPropSymbols$9(b)) {
|
|
1387
|
-
if (__propIsEnum$9.call(b, prop))
|
|
1388
|
-
__defNormalProp$7(a, prop, b[prop]);
|
|
1389
|
-
}
|
|
1390
|
-
return a;
|
|
1391
|
-
};
|
|
1392
1347
|
function useTimeout(interval = 1e3, options = {}) {
|
|
1393
1348
|
const {
|
|
1394
1349
|
controls: exposeControls = false,
|
|
@@ -1401,9 +1356,10 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
1401
1356
|
);
|
|
1402
1357
|
const ready = vueDemi.computed(() => !controls.isPending.value);
|
|
1403
1358
|
if (exposeControls) {
|
|
1404
|
-
return
|
|
1405
|
-
ready
|
|
1406
|
-
|
|
1359
|
+
return {
|
|
1360
|
+
ready,
|
|
1361
|
+
...controls
|
|
1362
|
+
};
|
|
1407
1363
|
} else {
|
|
1408
1364
|
return ready;
|
|
1409
1365
|
}
|
|
@@ -1477,58 +1433,11 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
1477
1433
|
}, options);
|
|
1478
1434
|
}
|
|
1479
1435
|
|
|
1480
|
-
var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
|
|
1481
|
-
var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
|
|
1482
|
-
var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
|
|
1483
|
-
var __objRest$5 = (source, exclude) => {
|
|
1484
|
-
var target = {};
|
|
1485
|
-
for (var prop in source)
|
|
1486
|
-
if (__hasOwnProp$8.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1487
|
-
target[prop] = source[prop];
|
|
1488
|
-
if (source != null && __getOwnPropSymbols$8)
|
|
1489
|
-
for (var prop of __getOwnPropSymbols$8(source)) {
|
|
1490
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$8.call(source, prop))
|
|
1491
|
-
target[prop] = source[prop];
|
|
1492
|
-
}
|
|
1493
|
-
return target;
|
|
1494
|
-
};
|
|
1495
|
-
function watchWithFilter(source, cb, options = {}) {
|
|
1496
|
-
const _a = options, {
|
|
1497
|
-
eventFilter = bypassFilter
|
|
1498
|
-
} = _a, watchOptions = __objRest$5(_a, [
|
|
1499
|
-
"eventFilter"
|
|
1500
|
-
]);
|
|
1501
|
-
return vueDemi.watch(
|
|
1502
|
-
source,
|
|
1503
|
-
createFilterWrapper(
|
|
1504
|
-
eventFilter,
|
|
1505
|
-
cb
|
|
1506
|
-
),
|
|
1507
|
-
watchOptions
|
|
1508
|
-
);
|
|
1509
|
-
}
|
|
1510
|
-
|
|
1511
|
-
var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
|
|
1512
|
-
var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
|
|
1513
|
-
var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
|
|
1514
|
-
var __objRest$4 = (source, exclude) => {
|
|
1515
|
-
var target = {};
|
|
1516
|
-
for (var prop in source)
|
|
1517
|
-
if (__hasOwnProp$7.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1518
|
-
target[prop] = source[prop];
|
|
1519
|
-
if (source != null && __getOwnPropSymbols$7)
|
|
1520
|
-
for (var prop of __getOwnPropSymbols$7(source)) {
|
|
1521
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$7.call(source, prop))
|
|
1522
|
-
target[prop] = source[prop];
|
|
1523
|
-
}
|
|
1524
|
-
return target;
|
|
1525
|
-
};
|
|
1526
1436
|
function watchAtMost(source, cb, options) {
|
|
1527
|
-
const
|
|
1528
|
-
count
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
]);
|
|
1437
|
+
const {
|
|
1438
|
+
count,
|
|
1439
|
+
...watchOptions
|
|
1440
|
+
} = options;
|
|
1532
1441
|
const current = vueDemi.ref(0);
|
|
1533
1442
|
const stop = watchWithFilter(
|
|
1534
1443
|
source,
|
|
@@ -1543,120 +1452,38 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
1543
1452
|
return { count: current, stop };
|
|
1544
1453
|
}
|
|
1545
1454
|
|
|
1546
|
-
var __defProp$6 = Object.defineProperty;
|
|
1547
|
-
var __defProps$6 = Object.defineProperties;
|
|
1548
|
-
var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
|
|
1549
|
-
var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
|
|
1550
|
-
var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
|
|
1551
|
-
var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
|
|
1552
|
-
var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1553
|
-
var __spreadValues$6 = (a, b) => {
|
|
1554
|
-
for (var prop in b || (b = {}))
|
|
1555
|
-
if (__hasOwnProp$6.call(b, prop))
|
|
1556
|
-
__defNormalProp$6(a, prop, b[prop]);
|
|
1557
|
-
if (__getOwnPropSymbols$6)
|
|
1558
|
-
for (var prop of __getOwnPropSymbols$6(b)) {
|
|
1559
|
-
if (__propIsEnum$6.call(b, prop))
|
|
1560
|
-
__defNormalProp$6(a, prop, b[prop]);
|
|
1561
|
-
}
|
|
1562
|
-
return a;
|
|
1563
|
-
};
|
|
1564
|
-
var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
|
|
1565
|
-
var __objRest$3 = (source, exclude) => {
|
|
1566
|
-
var target = {};
|
|
1567
|
-
for (var prop in source)
|
|
1568
|
-
if (__hasOwnProp$6.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1569
|
-
target[prop] = source[prop];
|
|
1570
|
-
if (source != null && __getOwnPropSymbols$6)
|
|
1571
|
-
for (var prop of __getOwnPropSymbols$6(source)) {
|
|
1572
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$6.call(source, prop))
|
|
1573
|
-
target[prop] = source[prop];
|
|
1574
|
-
}
|
|
1575
|
-
return target;
|
|
1576
|
-
};
|
|
1577
1455
|
function watchDebounced(source, cb, options = {}) {
|
|
1578
|
-
const
|
|
1456
|
+
const {
|
|
1579
1457
|
debounce = 0,
|
|
1580
|
-
maxWait = void 0
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
"maxWait"
|
|
1584
|
-
]);
|
|
1458
|
+
maxWait = void 0,
|
|
1459
|
+
...watchOptions
|
|
1460
|
+
} = options;
|
|
1585
1461
|
return watchWithFilter(
|
|
1586
1462
|
source,
|
|
1587
1463
|
cb,
|
|
1588
|
-
|
|
1464
|
+
{
|
|
1465
|
+
...watchOptions,
|
|
1589
1466
|
eventFilter: debounceFilter(debounce, { maxWait })
|
|
1590
|
-
}
|
|
1467
|
+
}
|
|
1591
1468
|
);
|
|
1592
1469
|
}
|
|
1593
1470
|
|
|
1594
|
-
var __defProp$5 = Object.defineProperty;
|
|
1595
|
-
var __defProps$5 = Object.defineProperties;
|
|
1596
|
-
var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
|
|
1597
|
-
var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
|
|
1598
|
-
var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
|
|
1599
|
-
var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
|
|
1600
|
-
var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1601
|
-
var __spreadValues$5 = (a, b) => {
|
|
1602
|
-
for (var prop in b || (b = {}))
|
|
1603
|
-
if (__hasOwnProp$5.call(b, prop))
|
|
1604
|
-
__defNormalProp$5(a, prop, b[prop]);
|
|
1605
|
-
if (__getOwnPropSymbols$5)
|
|
1606
|
-
for (var prop of __getOwnPropSymbols$5(b)) {
|
|
1607
|
-
if (__propIsEnum$5.call(b, prop))
|
|
1608
|
-
__defNormalProp$5(a, prop, b[prop]);
|
|
1609
|
-
}
|
|
1610
|
-
return a;
|
|
1611
|
-
};
|
|
1612
|
-
var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
|
|
1613
1471
|
function watchDeep(source, cb, options) {
|
|
1614
1472
|
return vueDemi.watch(
|
|
1615
1473
|
source,
|
|
1616
1474
|
cb,
|
|
1617
|
-
|
|
1475
|
+
{
|
|
1476
|
+
...options,
|
|
1618
1477
|
deep: true
|
|
1619
|
-
}
|
|
1478
|
+
}
|
|
1620
1479
|
);
|
|
1621
1480
|
}
|
|
1622
1481
|
|
|
1623
|
-
var __defProp$4 = Object.defineProperty;
|
|
1624
|
-
var __defProps$4 = Object.defineProperties;
|
|
1625
|
-
var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
|
|
1626
|
-
var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
|
|
1627
|
-
var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
|
|
1628
|
-
var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
|
|
1629
|
-
var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1630
|
-
var __spreadValues$4 = (a, b) => {
|
|
1631
|
-
for (var prop in b || (b = {}))
|
|
1632
|
-
if (__hasOwnProp$4.call(b, prop))
|
|
1633
|
-
__defNormalProp$4(a, prop, b[prop]);
|
|
1634
|
-
if (__getOwnPropSymbols$4)
|
|
1635
|
-
for (var prop of __getOwnPropSymbols$4(b)) {
|
|
1636
|
-
if (__propIsEnum$4.call(b, prop))
|
|
1637
|
-
__defNormalProp$4(a, prop, b[prop]);
|
|
1638
|
-
}
|
|
1639
|
-
return a;
|
|
1640
|
-
};
|
|
1641
|
-
var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
|
|
1642
|
-
var __objRest$2 = (source, exclude) => {
|
|
1643
|
-
var target = {};
|
|
1644
|
-
for (var prop in source)
|
|
1645
|
-
if (__hasOwnProp$4.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1646
|
-
target[prop] = source[prop];
|
|
1647
|
-
if (source != null && __getOwnPropSymbols$4)
|
|
1648
|
-
for (var prop of __getOwnPropSymbols$4(source)) {
|
|
1649
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$4.call(source, prop))
|
|
1650
|
-
target[prop] = source[prop];
|
|
1651
|
-
}
|
|
1652
|
-
return target;
|
|
1653
|
-
};
|
|
1654
1482
|
function watchIgnorable(source, cb, options = {}) {
|
|
1655
|
-
const
|
|
1656
|
-
eventFilter = bypassFilter
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
]);
|
|
1483
|
+
const {
|
|
1484
|
+
eventFilter = bypassFilter,
|
|
1485
|
+
...watchOptions
|
|
1486
|
+
} = options;
|
|
1660
1487
|
const filteredCb = createFilterWrapper(
|
|
1661
1488
|
eventFilter,
|
|
1662
1489
|
cb
|
|
@@ -1694,7 +1521,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
1694
1521
|
() => {
|
|
1695
1522
|
syncCounter.value++;
|
|
1696
1523
|
},
|
|
1697
|
-
|
|
1524
|
+
{ ...watchOptions, flush: "sync" }
|
|
1698
1525
|
)
|
|
1699
1526
|
);
|
|
1700
1527
|
ignoreUpdates = (updater) => {
|
|
@@ -1723,32 +1550,14 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
1723
1550
|
return { stop, ignoreUpdates, ignorePrevAsyncUpdates };
|
|
1724
1551
|
}
|
|
1725
1552
|
|
|
1726
|
-
var __defProp$3 = Object.defineProperty;
|
|
1727
|
-
var __defProps$3 = Object.defineProperties;
|
|
1728
|
-
var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
|
|
1729
|
-
var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
|
|
1730
|
-
var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
|
|
1731
|
-
var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
|
|
1732
|
-
var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1733
|
-
var __spreadValues$3 = (a, b) => {
|
|
1734
|
-
for (var prop in b || (b = {}))
|
|
1735
|
-
if (__hasOwnProp$3.call(b, prop))
|
|
1736
|
-
__defNormalProp$3(a, prop, b[prop]);
|
|
1737
|
-
if (__getOwnPropSymbols$3)
|
|
1738
|
-
for (var prop of __getOwnPropSymbols$3(b)) {
|
|
1739
|
-
if (__propIsEnum$3.call(b, prop))
|
|
1740
|
-
__defNormalProp$3(a, prop, b[prop]);
|
|
1741
|
-
}
|
|
1742
|
-
return a;
|
|
1743
|
-
};
|
|
1744
|
-
var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
|
|
1745
1553
|
function watchImmediate(source, cb, options) {
|
|
1746
1554
|
return vueDemi.watch(
|
|
1747
1555
|
source,
|
|
1748
1556
|
cb,
|
|
1749
|
-
|
|
1557
|
+
{
|
|
1558
|
+
...options,
|
|
1750
1559
|
immediate: true
|
|
1751
|
-
}
|
|
1560
|
+
}
|
|
1752
1561
|
);
|
|
1753
1562
|
}
|
|
1754
1563
|
|
|
@@ -1759,123 +1568,23 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
1759
1568
|
}, options);
|
|
1760
1569
|
}
|
|
1761
1570
|
|
|
1762
|
-
var __defProp$2 = Object.defineProperty;
|
|
1763
|
-
var __defProps$2 = Object.defineProperties;
|
|
1764
|
-
var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
|
|
1765
|
-
var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
|
|
1766
|
-
var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
|
|
1767
|
-
var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
|
|
1768
|
-
var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1769
|
-
var __spreadValues$2 = (a, b) => {
|
|
1770
|
-
for (var prop in b || (b = {}))
|
|
1771
|
-
if (__hasOwnProp$2.call(b, prop))
|
|
1772
|
-
__defNormalProp$2(a, prop, b[prop]);
|
|
1773
|
-
if (__getOwnPropSymbols$2)
|
|
1774
|
-
for (var prop of __getOwnPropSymbols$2(b)) {
|
|
1775
|
-
if (__propIsEnum$2.call(b, prop))
|
|
1776
|
-
__defNormalProp$2(a, prop, b[prop]);
|
|
1777
|
-
}
|
|
1778
|
-
return a;
|
|
1779
|
-
};
|
|
1780
|
-
var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
|
|
1781
|
-
var __objRest$1 = (source, exclude) => {
|
|
1782
|
-
var target = {};
|
|
1783
|
-
for (var prop in source)
|
|
1784
|
-
if (__hasOwnProp$2.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1785
|
-
target[prop] = source[prop];
|
|
1786
|
-
if (source != null && __getOwnPropSymbols$2)
|
|
1787
|
-
for (var prop of __getOwnPropSymbols$2(source)) {
|
|
1788
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$2.call(source, prop))
|
|
1789
|
-
target[prop] = source[prop];
|
|
1790
|
-
}
|
|
1791
|
-
return target;
|
|
1792
|
-
};
|
|
1793
|
-
function watchPausable(source, cb, options = {}) {
|
|
1794
|
-
const _a = options, {
|
|
1795
|
-
eventFilter: filter
|
|
1796
|
-
} = _a, watchOptions = __objRest$1(_a, [
|
|
1797
|
-
"eventFilter"
|
|
1798
|
-
]);
|
|
1799
|
-
const { eventFilter, pause, resume, isActive } = pausableFilter(filter);
|
|
1800
|
-
const stop = watchWithFilter(
|
|
1801
|
-
source,
|
|
1802
|
-
cb,
|
|
1803
|
-
__spreadProps$2(__spreadValues$2({}, watchOptions), {
|
|
1804
|
-
eventFilter
|
|
1805
|
-
})
|
|
1806
|
-
);
|
|
1807
|
-
return { stop, pause, resume, isActive };
|
|
1808
|
-
}
|
|
1809
|
-
|
|
1810
|
-
var __defProp$1 = Object.defineProperty;
|
|
1811
|
-
var __defProps$1 = Object.defineProperties;
|
|
1812
|
-
var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
|
|
1813
|
-
var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
|
|
1814
|
-
var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
|
|
1815
|
-
var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
|
|
1816
|
-
var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1817
|
-
var __spreadValues$1 = (a, b) => {
|
|
1818
|
-
for (var prop in b || (b = {}))
|
|
1819
|
-
if (__hasOwnProp$1.call(b, prop))
|
|
1820
|
-
__defNormalProp$1(a, prop, b[prop]);
|
|
1821
|
-
if (__getOwnPropSymbols$1)
|
|
1822
|
-
for (var prop of __getOwnPropSymbols$1(b)) {
|
|
1823
|
-
if (__propIsEnum$1.call(b, prop))
|
|
1824
|
-
__defNormalProp$1(a, prop, b[prop]);
|
|
1825
|
-
}
|
|
1826
|
-
return a;
|
|
1827
|
-
};
|
|
1828
|
-
var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
|
|
1829
|
-
var __objRest = (source, exclude) => {
|
|
1830
|
-
var target = {};
|
|
1831
|
-
for (var prop in source)
|
|
1832
|
-
if (__hasOwnProp$1.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1833
|
-
target[prop] = source[prop];
|
|
1834
|
-
if (source != null && __getOwnPropSymbols$1)
|
|
1835
|
-
for (var prop of __getOwnPropSymbols$1(source)) {
|
|
1836
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$1.call(source, prop))
|
|
1837
|
-
target[prop] = source[prop];
|
|
1838
|
-
}
|
|
1839
|
-
return target;
|
|
1840
|
-
};
|
|
1841
1571
|
function watchThrottled(source, cb, options = {}) {
|
|
1842
|
-
const
|
|
1572
|
+
const {
|
|
1843
1573
|
throttle = 0,
|
|
1844
1574
|
trailing = true,
|
|
1845
|
-
leading = true
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
"trailing",
|
|
1849
|
-
"leading"
|
|
1850
|
-
]);
|
|
1575
|
+
leading = true,
|
|
1576
|
+
...watchOptions
|
|
1577
|
+
} = options;
|
|
1851
1578
|
return watchWithFilter(
|
|
1852
1579
|
source,
|
|
1853
1580
|
cb,
|
|
1854
|
-
|
|
1581
|
+
{
|
|
1582
|
+
...watchOptions,
|
|
1855
1583
|
eventFilter: throttleFilter(throttle, trailing, leading)
|
|
1856
|
-
}
|
|
1584
|
+
}
|
|
1857
1585
|
);
|
|
1858
1586
|
}
|
|
1859
1587
|
|
|
1860
|
-
var __defProp = Object.defineProperty;
|
|
1861
|
-
var __defProps = Object.defineProperties;
|
|
1862
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
1863
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
1864
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
1865
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
1866
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1867
|
-
var __spreadValues = (a, b) => {
|
|
1868
|
-
for (var prop in b || (b = {}))
|
|
1869
|
-
if (__hasOwnProp.call(b, prop))
|
|
1870
|
-
__defNormalProp(a, prop, b[prop]);
|
|
1871
|
-
if (__getOwnPropSymbols)
|
|
1872
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
1873
|
-
if (__propIsEnum.call(b, prop))
|
|
1874
|
-
__defNormalProp(a, prop, b[prop]);
|
|
1875
|
-
}
|
|
1876
|
-
return a;
|
|
1877
|
-
};
|
|
1878
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
1879
1588
|
function watchTriggerable(source, cb, options = {}) {
|
|
1880
1589
|
let cleanupFn;
|
|
1881
1590
|
function onEffect() {
|
|
@@ -1901,9 +1610,10 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
1901
1610
|
});
|
|
1902
1611
|
return res2;
|
|
1903
1612
|
};
|
|
1904
|
-
return
|
|
1613
|
+
return {
|
|
1614
|
+
...res,
|
|
1905
1615
|
trigger
|
|
1906
|
-
}
|
|
1616
|
+
};
|
|
1907
1617
|
}
|
|
1908
1618
|
function getWatchSources(sources) {
|
|
1909
1619
|
if (vueDemi.isReactive(sources))
|