@vueuse/shared 8.7.3 → 8.8.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 +236 -161
- package/index.d.ts +41 -12
- package/index.iife.js +236 -161
- package/index.iife.min.js +1 -1
- package/index.mjs +235 -163
- package/package.json +1 -1
package/index.iife.js
CHANGED
|
@@ -90,31 +90,31 @@
|
|
|
90
90
|
;(function (exports, vueDemi) {
|
|
91
91
|
'use strict';
|
|
92
92
|
|
|
93
|
-
var __defProp$
|
|
94
|
-
var __defProps$
|
|
95
|
-
var __getOwnPropDescs$
|
|
96
|
-
var __getOwnPropSymbols$
|
|
97
|
-
var __hasOwnProp$
|
|
98
|
-
var __propIsEnum$
|
|
99
|
-
var __defNormalProp$
|
|
100
|
-
var __spreadValues$
|
|
93
|
+
var __defProp$9 = Object.defineProperty;
|
|
94
|
+
var __defProps$6 = Object.defineProperties;
|
|
95
|
+
var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
|
|
96
|
+
var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
|
|
97
|
+
var __hasOwnProp$b = Object.prototype.hasOwnProperty;
|
|
98
|
+
var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
|
|
99
|
+
var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
100
|
+
var __spreadValues$9 = (a, b) => {
|
|
101
101
|
for (var prop in b || (b = {}))
|
|
102
|
-
if (__hasOwnProp$
|
|
103
|
-
__defNormalProp$
|
|
104
|
-
if (__getOwnPropSymbols$
|
|
105
|
-
for (var prop of __getOwnPropSymbols$
|
|
106
|
-
if (__propIsEnum$
|
|
107
|
-
__defNormalProp$
|
|
102
|
+
if (__hasOwnProp$b.call(b, prop))
|
|
103
|
+
__defNormalProp$9(a, prop, b[prop]);
|
|
104
|
+
if (__getOwnPropSymbols$b)
|
|
105
|
+
for (var prop of __getOwnPropSymbols$b(b)) {
|
|
106
|
+
if (__propIsEnum$b.call(b, prop))
|
|
107
|
+
__defNormalProp$9(a, prop, b[prop]);
|
|
108
108
|
}
|
|
109
109
|
return a;
|
|
110
110
|
};
|
|
111
|
-
var __spreadProps$
|
|
111
|
+
var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
|
|
112
112
|
function computedEager(fn, options) {
|
|
113
113
|
var _a;
|
|
114
114
|
const result = vueDemi.shallowRef();
|
|
115
115
|
vueDemi.watchEffect(() => {
|
|
116
116
|
result.value = fn();
|
|
117
|
-
}, __spreadProps$
|
|
117
|
+
}, __spreadProps$6(__spreadValues$9({}, options), {
|
|
118
118
|
flush: (_a = options == null ? void 0 : options.flush) != null ? _a : "sync"
|
|
119
119
|
}));
|
|
120
120
|
return vueDemi.readonly(result);
|
|
@@ -278,25 +278,25 @@
|
|
|
278
278
|
return vueDemi.computed(() => args.some((i) => vueDemi.unref(i)));
|
|
279
279
|
}
|
|
280
280
|
|
|
281
|
-
var __defProp$
|
|
282
|
-
var __getOwnPropSymbols$
|
|
283
|
-
var __hasOwnProp$
|
|
284
|
-
var __propIsEnum$
|
|
285
|
-
var __defNormalProp$
|
|
286
|
-
var __spreadValues$
|
|
281
|
+
var __defProp$8 = Object.defineProperty;
|
|
282
|
+
var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
|
|
283
|
+
var __hasOwnProp$a = Object.prototype.hasOwnProperty;
|
|
284
|
+
var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
|
|
285
|
+
var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
286
|
+
var __spreadValues$8 = (a, b) => {
|
|
287
287
|
for (var prop in b || (b = {}))
|
|
288
|
-
if (__hasOwnProp$
|
|
289
|
-
__defNormalProp$
|
|
290
|
-
if (__getOwnPropSymbols$
|
|
291
|
-
for (var prop of __getOwnPropSymbols$
|
|
292
|
-
if (__propIsEnum$
|
|
293
|
-
__defNormalProp$
|
|
288
|
+
if (__hasOwnProp$a.call(b, prop))
|
|
289
|
+
__defNormalProp$8(a, prop, b[prop]);
|
|
290
|
+
if (__getOwnPropSymbols$a)
|
|
291
|
+
for (var prop of __getOwnPropSymbols$a(b)) {
|
|
292
|
+
if (__propIsEnum$a.call(b, prop))
|
|
293
|
+
__defNormalProp$8(a, prop, b[prop]);
|
|
294
294
|
}
|
|
295
295
|
return a;
|
|
296
296
|
};
|
|
297
297
|
function makeDestructurable(obj, arr) {
|
|
298
298
|
if (typeof Symbol !== "undefined") {
|
|
299
|
-
const clone = __spreadValues$
|
|
299
|
+
const clone = __spreadValues$8({}, obj);
|
|
300
300
|
Object.defineProperty(clone, Symbol.iterator, {
|
|
301
301
|
enumerable: false,
|
|
302
302
|
value() {
|
|
@@ -378,11 +378,13 @@
|
|
|
378
378
|
}
|
|
379
379
|
|
|
380
380
|
function reactiveOmit(obj, ...keys) {
|
|
381
|
-
|
|
381
|
+
const flatKeys = keys.flat();
|
|
382
|
+
return reactiveComputed(() => Object.fromEntries(Object.entries(vueDemi.toRefs(obj)).filter((e) => !flatKeys.includes(e[0]))));
|
|
382
383
|
}
|
|
383
384
|
|
|
384
385
|
function reactivePick(obj, ...keys) {
|
|
385
|
-
|
|
386
|
+
const flatKeys = keys.flat();
|
|
387
|
+
return vueDemi.reactive(Object.fromEntries(flatKeys.map((k) => [k, vueDemi.toRef(obj, k)])));
|
|
386
388
|
}
|
|
387
389
|
|
|
388
390
|
function refAutoReset(defaultValue, afterMs = 1e4) {
|
|
@@ -671,6 +673,14 @@
|
|
|
671
673
|
}
|
|
672
674
|
const controlledRef = refWithControl;
|
|
673
675
|
|
|
676
|
+
function resolveRef(r) {
|
|
677
|
+
return typeof r === "function" ? vueDemi.computed(r) : vueDemi.ref(r);
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
function resolveUnref(r) {
|
|
681
|
+
return typeof r === "function" ? r() : vueDemi.unref(r);
|
|
682
|
+
}
|
|
683
|
+
|
|
674
684
|
function set(...args) {
|
|
675
685
|
if (args.length === 2) {
|
|
676
686
|
const [ref, value] = args;
|
|
@@ -717,25 +727,25 @@
|
|
|
717
727
|
return vueDemi.watch(source, (newValue) => targets.forEach((target) => target.value = newValue), { flush, deep, immediate });
|
|
718
728
|
}
|
|
719
729
|
|
|
720
|
-
var __defProp$
|
|
721
|
-
var __defProps$
|
|
722
|
-
var __getOwnPropDescs$
|
|
723
|
-
var __getOwnPropSymbols$
|
|
724
|
-
var __hasOwnProp$
|
|
725
|
-
var __propIsEnum$
|
|
726
|
-
var __defNormalProp$
|
|
727
|
-
var __spreadValues$
|
|
730
|
+
var __defProp$7 = Object.defineProperty;
|
|
731
|
+
var __defProps$5 = Object.defineProperties;
|
|
732
|
+
var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
|
|
733
|
+
var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
|
|
734
|
+
var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
|
|
735
|
+
var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
|
|
736
|
+
var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
737
|
+
var __spreadValues$7 = (a, b) => {
|
|
728
738
|
for (var prop in b || (b = {}))
|
|
729
|
-
if (__hasOwnProp$
|
|
730
|
-
__defNormalProp$
|
|
731
|
-
if (__getOwnPropSymbols$
|
|
732
|
-
for (var prop of __getOwnPropSymbols$
|
|
733
|
-
if (__propIsEnum$
|
|
734
|
-
__defNormalProp$
|
|
739
|
+
if (__hasOwnProp$9.call(b, prop))
|
|
740
|
+
__defNormalProp$7(a, prop, b[prop]);
|
|
741
|
+
if (__getOwnPropSymbols$9)
|
|
742
|
+
for (var prop of __getOwnPropSymbols$9(b)) {
|
|
743
|
+
if (__propIsEnum$9.call(b, prop))
|
|
744
|
+
__defNormalProp$7(a, prop, b[prop]);
|
|
735
745
|
}
|
|
736
746
|
return a;
|
|
737
747
|
};
|
|
738
|
-
var __spreadProps$
|
|
748
|
+
var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
|
|
739
749
|
function toRefs(objectRef) {
|
|
740
750
|
if (!vueDemi.isRef(objectRef))
|
|
741
751
|
return vueDemi.toRefs(objectRef);
|
|
@@ -751,7 +761,7 @@
|
|
|
751
761
|
copy[key] = v;
|
|
752
762
|
objectRef.value = copy;
|
|
753
763
|
} else {
|
|
754
|
-
const newObject = __spreadProps$
|
|
764
|
+
const newObject = __spreadProps$5(__spreadValues$7({}, objectRef.value), { [key]: v });
|
|
755
765
|
Object.setPrototypeOf(newObject, objectRef.value);
|
|
756
766
|
objectRef.value = newObject;
|
|
757
767
|
}
|
|
@@ -1008,19 +1018,19 @@
|
|
|
1008
1018
|
};
|
|
1009
1019
|
}
|
|
1010
1020
|
|
|
1011
|
-
var __defProp$
|
|
1012
|
-
var __getOwnPropSymbols$
|
|
1013
|
-
var __hasOwnProp$
|
|
1014
|
-
var __propIsEnum$
|
|
1015
|
-
var __defNormalProp$
|
|
1016
|
-
var __spreadValues$
|
|
1021
|
+
var __defProp$6 = Object.defineProperty;
|
|
1022
|
+
var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
|
|
1023
|
+
var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
|
|
1024
|
+
var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
|
|
1025
|
+
var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1026
|
+
var __spreadValues$6 = (a, b) => {
|
|
1017
1027
|
for (var prop in b || (b = {}))
|
|
1018
|
-
if (__hasOwnProp$
|
|
1019
|
-
__defNormalProp$
|
|
1020
|
-
if (__getOwnPropSymbols$
|
|
1021
|
-
for (var prop of __getOwnPropSymbols$
|
|
1022
|
-
if (__propIsEnum$
|
|
1023
|
-
__defNormalProp$
|
|
1028
|
+
if (__hasOwnProp$8.call(b, prop))
|
|
1029
|
+
__defNormalProp$6(a, prop, b[prop]);
|
|
1030
|
+
if (__getOwnPropSymbols$8)
|
|
1031
|
+
for (var prop of __getOwnPropSymbols$8(b)) {
|
|
1032
|
+
if (__propIsEnum$8.call(b, prop))
|
|
1033
|
+
__defNormalProp$6(a, prop, b[prop]);
|
|
1024
1034
|
}
|
|
1025
1035
|
return a;
|
|
1026
1036
|
};
|
|
@@ -1032,7 +1042,7 @@
|
|
|
1032
1042
|
const counter = vueDemi.ref(0);
|
|
1033
1043
|
const controls = useIntervalFn(() => counter.value += 1, interval, { immediate });
|
|
1034
1044
|
if (exposeControls) {
|
|
1035
|
-
return __spreadValues$
|
|
1045
|
+
return __spreadValues$6({
|
|
1036
1046
|
counter
|
|
1037
1047
|
}, controls);
|
|
1038
1048
|
} else {
|
|
@@ -1085,19 +1095,19 @@
|
|
|
1085
1095
|
};
|
|
1086
1096
|
}
|
|
1087
1097
|
|
|
1088
|
-
var __defProp$
|
|
1089
|
-
var __getOwnPropSymbols$
|
|
1090
|
-
var __hasOwnProp$
|
|
1091
|
-
var __propIsEnum$
|
|
1092
|
-
var __defNormalProp$
|
|
1093
|
-
var __spreadValues$
|
|
1098
|
+
var __defProp$5 = Object.defineProperty;
|
|
1099
|
+
var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
|
|
1100
|
+
var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
|
|
1101
|
+
var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
|
|
1102
|
+
var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1103
|
+
var __spreadValues$5 = (a, b) => {
|
|
1094
1104
|
for (var prop in b || (b = {}))
|
|
1095
|
-
if (__hasOwnProp$
|
|
1096
|
-
__defNormalProp$
|
|
1097
|
-
if (__getOwnPropSymbols$
|
|
1098
|
-
for (var prop of __getOwnPropSymbols$
|
|
1099
|
-
if (__propIsEnum$
|
|
1100
|
-
__defNormalProp$
|
|
1105
|
+
if (__hasOwnProp$7.call(b, prop))
|
|
1106
|
+
__defNormalProp$5(a, prop, b[prop]);
|
|
1107
|
+
if (__getOwnPropSymbols$7)
|
|
1108
|
+
for (var prop of __getOwnPropSymbols$7(b)) {
|
|
1109
|
+
if (__propIsEnum$7.call(b, prop))
|
|
1110
|
+
__defNormalProp$5(a, prop, b[prop]);
|
|
1101
1111
|
}
|
|
1102
1112
|
return a;
|
|
1103
1113
|
};
|
|
@@ -1108,7 +1118,7 @@
|
|
|
1108
1118
|
const controls = useTimeoutFn(noop, interval, options);
|
|
1109
1119
|
const ready = vueDemi.computed(() => !controls.isPending.value);
|
|
1110
1120
|
if (exposeControls) {
|
|
1111
|
-
return __spreadValues$
|
|
1121
|
+
return __spreadValues$5({
|
|
1112
1122
|
ready
|
|
1113
1123
|
}, controls);
|
|
1114
1124
|
} else {
|
|
@@ -1138,17 +1148,17 @@
|
|
|
1138
1148
|
return [innerValue, toggle];
|
|
1139
1149
|
}
|
|
1140
1150
|
|
|
1141
|
-
var __getOwnPropSymbols$
|
|
1142
|
-
var __hasOwnProp$
|
|
1143
|
-
var __propIsEnum$
|
|
1151
|
+
var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
|
|
1152
|
+
var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
|
|
1153
|
+
var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
|
|
1144
1154
|
var __objRest$5 = (source, exclude) => {
|
|
1145
1155
|
var target = {};
|
|
1146
1156
|
for (var prop in source)
|
|
1147
|
-
if (__hasOwnProp$
|
|
1157
|
+
if (__hasOwnProp$6.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1148
1158
|
target[prop] = source[prop];
|
|
1149
|
-
if (source != null && __getOwnPropSymbols$
|
|
1150
|
-
for (var prop of __getOwnPropSymbols$
|
|
1151
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
1159
|
+
if (source != null && __getOwnPropSymbols$6)
|
|
1160
|
+
for (var prop of __getOwnPropSymbols$6(source)) {
|
|
1161
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$6.call(source, prop))
|
|
1152
1162
|
target[prop] = source[prop];
|
|
1153
1163
|
}
|
|
1154
1164
|
return target;
|
|
@@ -1162,17 +1172,17 @@
|
|
|
1162
1172
|
return vueDemi.watch(source, createFilterWrapper(eventFilter, cb), watchOptions);
|
|
1163
1173
|
}
|
|
1164
1174
|
|
|
1165
|
-
var __getOwnPropSymbols$
|
|
1166
|
-
var __hasOwnProp$
|
|
1167
|
-
var __propIsEnum$
|
|
1175
|
+
var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
|
|
1176
|
+
var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
|
|
1177
|
+
var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
|
|
1168
1178
|
var __objRest$4 = (source, exclude) => {
|
|
1169
1179
|
var target = {};
|
|
1170
1180
|
for (var prop in source)
|
|
1171
|
-
if (__hasOwnProp$
|
|
1181
|
+
if (__hasOwnProp$5.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1172
1182
|
target[prop] = source[prop];
|
|
1173
|
-
if (source != null && __getOwnPropSymbols$
|
|
1174
|
-
for (var prop of __getOwnPropSymbols$
|
|
1175
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
1183
|
+
if (source != null && __getOwnPropSymbols$5)
|
|
1184
|
+
for (var prop of __getOwnPropSymbols$5(source)) {
|
|
1185
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$5.call(source, prop))
|
|
1176
1186
|
target[prop] = source[prop];
|
|
1177
1187
|
}
|
|
1178
1188
|
return target;
|
|
@@ -1193,33 +1203,33 @@
|
|
|
1193
1203
|
return { count: current, stop };
|
|
1194
1204
|
}
|
|
1195
1205
|
|
|
1196
|
-
var __defProp$
|
|
1197
|
-
var __defProps$
|
|
1198
|
-
var __getOwnPropDescs$
|
|
1199
|
-
var __getOwnPropSymbols$
|
|
1200
|
-
var __hasOwnProp$
|
|
1201
|
-
var __propIsEnum$
|
|
1202
|
-
var __defNormalProp$
|
|
1203
|
-
var __spreadValues$
|
|
1206
|
+
var __defProp$4 = Object.defineProperty;
|
|
1207
|
+
var __defProps$4 = Object.defineProperties;
|
|
1208
|
+
var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
|
|
1209
|
+
var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
|
|
1210
|
+
var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
|
|
1211
|
+
var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
|
|
1212
|
+
var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1213
|
+
var __spreadValues$4 = (a, b) => {
|
|
1204
1214
|
for (var prop in b || (b = {}))
|
|
1205
|
-
if (__hasOwnProp$
|
|
1206
|
-
__defNormalProp$
|
|
1207
|
-
if (__getOwnPropSymbols$
|
|
1208
|
-
for (var prop of __getOwnPropSymbols$
|
|
1209
|
-
if (__propIsEnum$
|
|
1210
|
-
__defNormalProp$
|
|
1215
|
+
if (__hasOwnProp$4.call(b, prop))
|
|
1216
|
+
__defNormalProp$4(a, prop, b[prop]);
|
|
1217
|
+
if (__getOwnPropSymbols$4)
|
|
1218
|
+
for (var prop of __getOwnPropSymbols$4(b)) {
|
|
1219
|
+
if (__propIsEnum$4.call(b, prop))
|
|
1220
|
+
__defNormalProp$4(a, prop, b[prop]);
|
|
1211
1221
|
}
|
|
1212
1222
|
return a;
|
|
1213
1223
|
};
|
|
1214
|
-
var __spreadProps$
|
|
1224
|
+
var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
|
|
1215
1225
|
var __objRest$3 = (source, exclude) => {
|
|
1216
1226
|
var target = {};
|
|
1217
1227
|
for (var prop in source)
|
|
1218
|
-
if (__hasOwnProp$
|
|
1228
|
+
if (__hasOwnProp$4.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1219
1229
|
target[prop] = source[prop];
|
|
1220
|
-
if (source != null && __getOwnPropSymbols$
|
|
1221
|
-
for (var prop of __getOwnPropSymbols$
|
|
1222
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
1230
|
+
if (source != null && __getOwnPropSymbols$4)
|
|
1231
|
+
for (var prop of __getOwnPropSymbols$4(source)) {
|
|
1232
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$4.call(source, prop))
|
|
1223
1233
|
target[prop] = source[prop];
|
|
1224
1234
|
}
|
|
1225
1235
|
return target;
|
|
@@ -1232,38 +1242,38 @@
|
|
|
1232
1242
|
"debounce",
|
|
1233
1243
|
"maxWait"
|
|
1234
1244
|
]);
|
|
1235
|
-
return watchWithFilter(source, cb, __spreadProps$
|
|
1245
|
+
return watchWithFilter(source, cb, __spreadProps$4(__spreadValues$4({}, watchOptions), {
|
|
1236
1246
|
eventFilter: debounceFilter(debounce, { maxWait })
|
|
1237
1247
|
}));
|
|
1238
1248
|
}
|
|
1239
1249
|
|
|
1240
|
-
var __defProp$
|
|
1241
|
-
var __defProps$
|
|
1242
|
-
var __getOwnPropDescs$
|
|
1243
|
-
var __getOwnPropSymbols$
|
|
1244
|
-
var __hasOwnProp$
|
|
1245
|
-
var __propIsEnum$
|
|
1246
|
-
var __defNormalProp$
|
|
1247
|
-
var __spreadValues$
|
|
1250
|
+
var __defProp$3 = Object.defineProperty;
|
|
1251
|
+
var __defProps$3 = Object.defineProperties;
|
|
1252
|
+
var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
|
|
1253
|
+
var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
|
|
1254
|
+
var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
|
|
1255
|
+
var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
|
|
1256
|
+
var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1257
|
+
var __spreadValues$3 = (a, b) => {
|
|
1248
1258
|
for (var prop in b || (b = {}))
|
|
1249
|
-
if (__hasOwnProp$
|
|
1250
|
-
__defNormalProp$
|
|
1251
|
-
if (__getOwnPropSymbols$
|
|
1252
|
-
for (var prop of __getOwnPropSymbols$
|
|
1253
|
-
if (__propIsEnum$
|
|
1254
|
-
__defNormalProp$
|
|
1259
|
+
if (__hasOwnProp$3.call(b, prop))
|
|
1260
|
+
__defNormalProp$3(a, prop, b[prop]);
|
|
1261
|
+
if (__getOwnPropSymbols$3)
|
|
1262
|
+
for (var prop of __getOwnPropSymbols$3(b)) {
|
|
1263
|
+
if (__propIsEnum$3.call(b, prop))
|
|
1264
|
+
__defNormalProp$3(a, prop, b[prop]);
|
|
1255
1265
|
}
|
|
1256
1266
|
return a;
|
|
1257
1267
|
};
|
|
1258
|
-
var __spreadProps$
|
|
1268
|
+
var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
|
|
1259
1269
|
var __objRest$2 = (source, exclude) => {
|
|
1260
1270
|
var target = {};
|
|
1261
1271
|
for (var prop in source)
|
|
1262
|
-
if (__hasOwnProp$
|
|
1272
|
+
if (__hasOwnProp$3.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1263
1273
|
target[prop] = source[prop];
|
|
1264
|
-
if (source != null && __getOwnPropSymbols$
|
|
1265
|
-
for (var prop of __getOwnPropSymbols$
|
|
1266
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
1274
|
+
if (source != null && __getOwnPropSymbols$3)
|
|
1275
|
+
for (var prop of __getOwnPropSymbols$3(source)) {
|
|
1276
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$3.call(source, prop))
|
|
1267
1277
|
target[prop] = source[prop];
|
|
1268
1278
|
}
|
|
1269
1279
|
return target;
|
|
@@ -1300,7 +1310,7 @@
|
|
|
1300
1310
|
};
|
|
1301
1311
|
disposables.push(vueDemi.watch(source, () => {
|
|
1302
1312
|
syncCounter.value++;
|
|
1303
|
-
}, __spreadProps$
|
|
1313
|
+
}, __spreadProps$3(__spreadValues$3({}, watchOptions), { flush: "sync" })));
|
|
1304
1314
|
ignoreUpdates = (updater) => {
|
|
1305
1315
|
const syncCounterPrev = syncCounter.value;
|
|
1306
1316
|
updater();
|
|
@@ -1328,6 +1338,50 @@
|
|
|
1328
1338
|
}, options);
|
|
1329
1339
|
}
|
|
1330
1340
|
|
|
1341
|
+
var __defProp$2 = Object.defineProperty;
|
|
1342
|
+
var __defProps$2 = Object.defineProperties;
|
|
1343
|
+
var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
|
|
1344
|
+
var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
|
|
1345
|
+
var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
|
|
1346
|
+
var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
|
|
1347
|
+
var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1348
|
+
var __spreadValues$2 = (a, b) => {
|
|
1349
|
+
for (var prop in b || (b = {}))
|
|
1350
|
+
if (__hasOwnProp$2.call(b, prop))
|
|
1351
|
+
__defNormalProp$2(a, prop, b[prop]);
|
|
1352
|
+
if (__getOwnPropSymbols$2)
|
|
1353
|
+
for (var prop of __getOwnPropSymbols$2(b)) {
|
|
1354
|
+
if (__propIsEnum$2.call(b, prop))
|
|
1355
|
+
__defNormalProp$2(a, prop, b[prop]);
|
|
1356
|
+
}
|
|
1357
|
+
return a;
|
|
1358
|
+
};
|
|
1359
|
+
var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
|
|
1360
|
+
var __objRest$1 = (source, exclude) => {
|
|
1361
|
+
var target = {};
|
|
1362
|
+
for (var prop in source)
|
|
1363
|
+
if (__hasOwnProp$2.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1364
|
+
target[prop] = source[prop];
|
|
1365
|
+
if (source != null && __getOwnPropSymbols$2)
|
|
1366
|
+
for (var prop of __getOwnPropSymbols$2(source)) {
|
|
1367
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$2.call(source, prop))
|
|
1368
|
+
target[prop] = source[prop];
|
|
1369
|
+
}
|
|
1370
|
+
return target;
|
|
1371
|
+
};
|
|
1372
|
+
function watchPausable(source, cb, options = {}) {
|
|
1373
|
+
const _a = options, {
|
|
1374
|
+
eventFilter: filter
|
|
1375
|
+
} = _a, watchOptions = __objRest$1(_a, [
|
|
1376
|
+
"eventFilter"
|
|
1377
|
+
]);
|
|
1378
|
+
const { eventFilter, pause, resume, isActive } = pausableFilter(filter);
|
|
1379
|
+
const stop = watchWithFilter(source, cb, __spreadProps$2(__spreadValues$2({}, watchOptions), {
|
|
1380
|
+
eventFilter
|
|
1381
|
+
}));
|
|
1382
|
+
return { stop, pause, resume, isActive };
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1331
1385
|
var __defProp$1 = Object.defineProperty;
|
|
1332
1386
|
var __defProps$1 = Object.defineProperties;
|
|
1333
1387
|
var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
|
|
@@ -1347,7 +1401,7 @@
|
|
|
1347
1401
|
return a;
|
|
1348
1402
|
};
|
|
1349
1403
|
var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
|
|
1350
|
-
var __objRest
|
|
1404
|
+
var __objRest = (source, exclude) => {
|
|
1351
1405
|
var target = {};
|
|
1352
1406
|
for (var prop in source)
|
|
1353
1407
|
if (__hasOwnProp$1.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
@@ -1359,17 +1413,19 @@
|
|
|
1359
1413
|
}
|
|
1360
1414
|
return target;
|
|
1361
1415
|
};
|
|
1362
|
-
function
|
|
1416
|
+
function watchThrottled(source, cb, options = {}) {
|
|
1363
1417
|
const _a = options, {
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1418
|
+
throttle = 0,
|
|
1419
|
+
trailing = true,
|
|
1420
|
+
leading = true
|
|
1421
|
+
} = _a, watchOptions = __objRest(_a, [
|
|
1422
|
+
"throttle",
|
|
1423
|
+
"trailing",
|
|
1424
|
+
"leading"
|
|
1367
1425
|
]);
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
eventFilter
|
|
1426
|
+
return watchWithFilter(source, cb, __spreadProps$1(__spreadValues$1({}, watchOptions), {
|
|
1427
|
+
eventFilter: throttleFilter(throttle, trailing, leading)
|
|
1371
1428
|
}));
|
|
1372
|
-
return { stop, pause, resume, isActive };
|
|
1373
1429
|
}
|
|
1374
1430
|
|
|
1375
1431
|
var __defProp = Object.defineProperty;
|
|
@@ -1391,31 +1447,47 @@
|
|
|
1391
1447
|
return a;
|
|
1392
1448
|
};
|
|
1393
1449
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
if (
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
}
|
|
1450
|
+
function watchTriggerable(source, cb, options = {}) {
|
|
1451
|
+
let cleanupFn;
|
|
1452
|
+
function onEffect() {
|
|
1453
|
+
if (!cleanupFn)
|
|
1454
|
+
return;
|
|
1455
|
+
const fn = cleanupFn;
|
|
1456
|
+
cleanupFn = void 0;
|
|
1457
|
+
fn();
|
|
1458
|
+
}
|
|
1459
|
+
function onCleanup(callback) {
|
|
1460
|
+
cleanupFn = callback;
|
|
1461
|
+
}
|
|
1462
|
+
const _cb = (value, oldValue) => {
|
|
1463
|
+
onEffect();
|
|
1464
|
+
return cb(value, oldValue, onCleanup);
|
|
1465
|
+
};
|
|
1466
|
+
const res = watchIgnorable(source, _cb, options);
|
|
1467
|
+
const { ignoreUpdates } = res;
|
|
1468
|
+
const trigger = () => {
|
|
1469
|
+
let res2;
|
|
1470
|
+
ignoreUpdates(() => {
|
|
1471
|
+
res2 = _cb(getWatchSources(source), getOldValue(source));
|
|
1472
|
+
});
|
|
1473
|
+
return res2;
|
|
1474
|
+
};
|
|
1475
|
+
return __spreadProps(__spreadValues({}, res), {
|
|
1476
|
+
trigger
|
|
1477
|
+
});
|
|
1478
|
+
}
|
|
1479
|
+
function getWatchSources(sources) {
|
|
1480
|
+
if (vueDemi.isReactive(sources))
|
|
1481
|
+
return sources;
|
|
1482
|
+
if (Array.isArray(sources))
|
|
1483
|
+
return sources.map((item) => getOneWatchSource(item));
|
|
1484
|
+
return getOneWatchSource(sources);
|
|
1485
|
+
}
|
|
1486
|
+
function getOneWatchSource(source) {
|
|
1487
|
+
return typeof source === "function" ? source() : vueDemi.unref(source);
|
|
1488
|
+
}
|
|
1489
|
+
function getOldValue(source) {
|
|
1490
|
+
return Array.isArray(source) ? source.map(() => void 0) : void 0;
|
|
1419
1491
|
}
|
|
1420
1492
|
|
|
1421
1493
|
function whenever(source, cb, options) {
|
|
@@ -1489,6 +1561,8 @@
|
|
|
1489
1561
|
exports.refDefault = refDefault;
|
|
1490
1562
|
exports.refThrottled = refThrottled;
|
|
1491
1563
|
exports.refWithControl = refWithControl;
|
|
1564
|
+
exports.resolveRef = resolveRef;
|
|
1565
|
+
exports.resolveUnref = resolveUnref;
|
|
1492
1566
|
exports.set = set;
|
|
1493
1567
|
exports.syncRef = syncRef;
|
|
1494
1568
|
exports.syncRefs = syncRefs;
|
|
@@ -1522,6 +1596,7 @@
|
|
|
1522
1596
|
exports.watchOnce = watchOnce;
|
|
1523
1597
|
exports.watchPausable = watchPausable;
|
|
1524
1598
|
exports.watchThrottled = watchThrottled;
|
|
1599
|
+
exports.watchTriggerable = watchTriggerable;
|
|
1525
1600
|
exports.watchWithFilter = watchWithFilter;
|
|
1526
1601
|
exports.whenever = whenever;
|
|
1527
1602
|
|