@cabloy/vue-runtime-core 3.5.11 → 3.5.13
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/dist/runtime-core.cjs.js +136 -53
- package/dist/runtime-core.cjs.prod.js +122 -47
- package/dist/runtime-core.d.ts +26 -25
- package/dist/runtime-core.esm-bundler.js +138 -55
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @cabloy/vue-runtime-core v3.5.
|
|
2
|
+
* @cabloy/vue-runtime-core v3.5.13
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -145,10 +145,8 @@ function logError(err, type, contextVNode, throwInDev = true, throwInProd = fals
|
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
let isFlushing = false;
|
|
149
|
-
let isFlushPending = false;
|
|
150
148
|
const queue = [];
|
|
151
|
-
let flushIndex =
|
|
149
|
+
let flushIndex = -1;
|
|
152
150
|
const pendingPostFlushCbs = [];
|
|
153
151
|
let activePostFlushCbs = null;
|
|
154
152
|
let postFlushIndex = 0;
|
|
@@ -159,7 +157,7 @@ function nextTick(fn) {
|
|
|
159
157
|
return fn ? p.then(this ? fn.bind(this) : fn) : p;
|
|
160
158
|
}
|
|
161
159
|
function findInsertionIndex(id) {
|
|
162
|
-
let start =
|
|
160
|
+
let start = flushIndex + 1;
|
|
163
161
|
let end = queue.length;
|
|
164
162
|
while (start < end) {
|
|
165
163
|
const middle = start + end >>> 1;
|
|
@@ -188,8 +186,7 @@ function queueJob(job) {
|
|
|
188
186
|
}
|
|
189
187
|
}
|
|
190
188
|
function queueFlush() {
|
|
191
|
-
if (!
|
|
192
|
-
isFlushPending = true;
|
|
189
|
+
if (!currentFlushPromise) {
|
|
193
190
|
currentFlushPromise = resolvedPromise.then(flushJobs);
|
|
194
191
|
}
|
|
195
192
|
}
|
|
@@ -206,7 +203,7 @@ function queuePostFlushCb(cb) {
|
|
|
206
203
|
}
|
|
207
204
|
queueFlush();
|
|
208
205
|
}
|
|
209
|
-
function flushPreFlushCbs(instance, seen, i =
|
|
206
|
+
function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
|
|
210
207
|
for (; i < queue.length; i++) {
|
|
211
208
|
const cb = queue[i];
|
|
212
209
|
if (cb && cb.flags & 2) {
|
|
@@ -219,7 +216,9 @@ function flushPreFlushCbs(instance, seen, i = isFlushing ? flushIndex + 1 : 0) {
|
|
|
219
216
|
cb.flags &= ~1;
|
|
220
217
|
}
|
|
221
218
|
cb();
|
|
222
|
-
cb.flags
|
|
219
|
+
if (!(cb.flags & 4)) {
|
|
220
|
+
cb.flags &= ~1;
|
|
221
|
+
}
|
|
223
222
|
}
|
|
224
223
|
}
|
|
225
224
|
}
|
|
@@ -248,8 +247,6 @@ function flushPostFlushCbs(seen) {
|
|
|
248
247
|
}
|
|
249
248
|
const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;
|
|
250
249
|
function flushJobs(seen) {
|
|
251
|
-
isFlushPending = false;
|
|
252
|
-
isFlushing = true;
|
|
253
250
|
try {
|
|
254
251
|
for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
|
|
255
252
|
const job = queue[flushIndex];
|
|
@@ -263,7 +260,9 @@ function flushJobs(seen) {
|
|
|
263
260
|
job.i,
|
|
264
261
|
job.i ? 15 : 14
|
|
265
262
|
);
|
|
266
|
-
job.flags
|
|
263
|
+
if (!(job.flags & 4)) {
|
|
264
|
+
job.flags &= ~1;
|
|
265
|
+
}
|
|
267
266
|
}
|
|
268
267
|
}
|
|
269
268
|
} finally {
|
|
@@ -273,10 +272,9 @@ function flushJobs(seen) {
|
|
|
273
272
|
job.flags &= ~1;
|
|
274
273
|
}
|
|
275
274
|
}
|
|
276
|
-
flushIndex =
|
|
275
|
+
flushIndex = -1;
|
|
277
276
|
queue.length = 0;
|
|
278
277
|
flushPostFlushCbs();
|
|
279
|
-
isFlushing = false;
|
|
280
278
|
currentFlushPromise = null;
|
|
281
279
|
if (queue.length || pendingPostFlushCbs.length) {
|
|
282
280
|
flushJobs();
|
|
@@ -442,20 +440,41 @@ const TeleportImpl = {
|
|
|
442
440
|
}
|
|
443
441
|
if (!disabled) {
|
|
444
442
|
mount(target, targetAnchor);
|
|
445
|
-
updateCssVars(n2);
|
|
443
|
+
updateCssVars(n2, false);
|
|
446
444
|
}
|
|
447
445
|
}
|
|
448
446
|
};
|
|
449
447
|
if (disabled) {
|
|
450
448
|
mount(container, mainAnchor);
|
|
451
|
-
updateCssVars(n2);
|
|
449
|
+
updateCssVars(n2, true);
|
|
452
450
|
}
|
|
453
451
|
if (isTeleportDeferred(n2.props)) {
|
|
454
|
-
queuePostRenderEffect(
|
|
452
|
+
queuePostRenderEffect(() => {
|
|
453
|
+
mountToTarget();
|
|
454
|
+
n2.el.__isMounted = true;
|
|
455
|
+
}, parentSuspense);
|
|
455
456
|
} else {
|
|
456
457
|
mountToTarget();
|
|
457
458
|
}
|
|
458
459
|
} else {
|
|
460
|
+
if (isTeleportDeferred(n2.props) && !n1.el.__isMounted) {
|
|
461
|
+
queuePostRenderEffect(() => {
|
|
462
|
+
TeleportImpl.process(
|
|
463
|
+
n1,
|
|
464
|
+
n2,
|
|
465
|
+
container,
|
|
466
|
+
anchor,
|
|
467
|
+
parentComponent,
|
|
468
|
+
parentSuspense,
|
|
469
|
+
namespace,
|
|
470
|
+
slotScopeIds,
|
|
471
|
+
optimized,
|
|
472
|
+
internals
|
|
473
|
+
);
|
|
474
|
+
delete n1.el.__isMounted;
|
|
475
|
+
}, parentSuspense);
|
|
476
|
+
return;
|
|
477
|
+
}
|
|
459
478
|
n2.el = n1.el;
|
|
460
479
|
n2.targetStart = n1.targetStart;
|
|
461
480
|
const mainAnchor = n2.anchor = n1.anchor;
|
|
@@ -532,7 +551,7 @@ const TeleportImpl = {
|
|
|
532
551
|
);
|
|
533
552
|
}
|
|
534
553
|
}
|
|
535
|
-
updateCssVars(n2);
|
|
554
|
+
updateCssVars(n2, disabled);
|
|
536
555
|
}
|
|
537
556
|
},
|
|
538
557
|
remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
|
|
@@ -600,9 +619,10 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
600
619
|
querySelector
|
|
601
620
|
);
|
|
602
621
|
if (target) {
|
|
622
|
+
const disabled = isTeleportDisabled(vnode.props);
|
|
603
623
|
const targetNode = target._lpa || target.firstChild;
|
|
604
624
|
if (vnode.shapeFlag & 16) {
|
|
605
|
-
if (
|
|
625
|
+
if (disabled) {
|
|
606
626
|
vnode.anchor = hydrateChildren(
|
|
607
627
|
nextSibling(node),
|
|
608
628
|
vnode,
|
|
@@ -643,16 +663,23 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
643
663
|
);
|
|
644
664
|
}
|
|
645
665
|
}
|
|
646
|
-
updateCssVars(vnode);
|
|
666
|
+
updateCssVars(vnode, disabled);
|
|
647
667
|
}
|
|
648
668
|
return vnode.anchor && nextSibling(vnode.anchor);
|
|
649
669
|
}
|
|
650
670
|
const Teleport = TeleportImpl;
|
|
651
|
-
function updateCssVars(vnode) {
|
|
671
|
+
function updateCssVars(vnode, isDisabled) {
|
|
652
672
|
const ctx = vnode.ctx;
|
|
653
673
|
if (ctx && ctx.ut) {
|
|
654
|
-
let node
|
|
655
|
-
|
|
674
|
+
let node, anchor;
|
|
675
|
+
if (isDisabled) {
|
|
676
|
+
node = vnode.el;
|
|
677
|
+
anchor = vnode.anchor;
|
|
678
|
+
} else {
|
|
679
|
+
node = vnode.targetStart;
|
|
680
|
+
anchor = vnode.targetAnchor;
|
|
681
|
+
}
|
|
682
|
+
while (node && node !== anchor) {
|
|
656
683
|
if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx.uid);
|
|
657
684
|
node = node.nextSibling;
|
|
658
685
|
}
|
|
@@ -744,10 +771,9 @@ const BaseTransitionImpl = {
|
|
|
744
771
|
if (innerChild.type !== Comment) {
|
|
745
772
|
setTransitionHooks(innerChild, enterHooks);
|
|
746
773
|
}
|
|
747
|
-
|
|
748
|
-
const oldInnerChild = oldChild && getInnerChild$1(oldChild);
|
|
774
|
+
let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
|
|
749
775
|
if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) {
|
|
750
|
-
|
|
776
|
+
let leavingHooks = resolveTransitionHooks(
|
|
751
777
|
oldInnerChild,
|
|
752
778
|
rawProps,
|
|
753
779
|
state,
|
|
@@ -762,6 +788,7 @@ const BaseTransitionImpl = {
|
|
|
762
788
|
instance.update();
|
|
763
789
|
}
|
|
764
790
|
delete leavingHooks.afterLeave;
|
|
791
|
+
oldInnerChild = void 0;
|
|
765
792
|
};
|
|
766
793
|
return emptyPlaceholder(child);
|
|
767
794
|
} else if (mode === "in-out" && innerChild.type !== Comment) {
|
|
@@ -775,10 +802,19 @@ const BaseTransitionImpl = {
|
|
|
775
802
|
earlyRemove();
|
|
776
803
|
el[leaveCbKey] = void 0;
|
|
777
804
|
delete enterHooks.delayedLeave;
|
|
805
|
+
oldInnerChild = void 0;
|
|
806
|
+
};
|
|
807
|
+
enterHooks.delayedLeave = () => {
|
|
808
|
+
delayedLeave();
|
|
809
|
+
delete enterHooks.delayedLeave;
|
|
810
|
+
oldInnerChild = void 0;
|
|
778
811
|
};
|
|
779
|
-
enterHooks.delayedLeave = delayedLeave;
|
|
780
812
|
};
|
|
813
|
+
} else {
|
|
814
|
+
oldInnerChild = void 0;
|
|
781
815
|
}
|
|
816
|
+
} else if (oldInnerChild) {
|
|
817
|
+
oldInnerChild = void 0;
|
|
782
818
|
}
|
|
783
819
|
return child;
|
|
784
820
|
};
|
|
@@ -1021,6 +1057,7 @@ function useId() {
|
|
|
1021
1057
|
if (i) {
|
|
1022
1058
|
return (i.appContext.config.idPrefix || "v") + "-" + i.ids[0] + i.ids[1]++;
|
|
1023
1059
|
}
|
|
1060
|
+
return "";
|
|
1024
1061
|
}
|
|
1025
1062
|
function markAsyncBoundary(instance) {
|
|
1026
1063
|
instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0];
|
|
@@ -1057,6 +1094,9 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
1057
1094
|
return;
|
|
1058
1095
|
}
|
|
1059
1096
|
if (isAsyncWrapper(vnode) && !isUnmount) {
|
|
1097
|
+
if (vnode.shapeFlag & 512 && vnode.type.__asyncResolved && vnode.component.subTree.component) {
|
|
1098
|
+
setRef(rawRef, oldRawRef, parentSuspense, vnode.component.subTree);
|
|
1099
|
+
}
|
|
1060
1100
|
return;
|
|
1061
1101
|
}
|
|
1062
1102
|
const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el;
|
|
@@ -1284,7 +1324,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1284
1324
|
getContainerType(container),
|
|
1285
1325
|
optimized
|
|
1286
1326
|
);
|
|
1287
|
-
if (isAsyncWrapper(vnode)) {
|
|
1327
|
+
if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) {
|
|
1288
1328
|
let subTree;
|
|
1289
1329
|
if (isFragmentStart) {
|
|
1290
1330
|
subTree = createVNode(Fragment);
|
|
@@ -1345,7 +1385,11 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1345
1385
|
}
|
|
1346
1386
|
let needCallTransitionHooks = false;
|
|
1347
1387
|
if (isTemplateNode(el)) {
|
|
1348
|
-
needCallTransitionHooks = needTransition(
|
|
1388
|
+
needCallTransitionHooks = needTransition(
|
|
1389
|
+
null,
|
|
1390
|
+
// no need check parentSuspense in hydration
|
|
1391
|
+
transition
|
|
1392
|
+
) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
|
|
1349
1393
|
const content = el.content.firstChild;
|
|
1350
1394
|
if (needCallTransitionHooks) {
|
|
1351
1395
|
transition.beforeEnter(content);
|
|
@@ -1537,6 +1581,10 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1537
1581
|
getContainerType(container),
|
|
1538
1582
|
slotScopeIds
|
|
1539
1583
|
);
|
|
1584
|
+
if (parentComponent) {
|
|
1585
|
+
parentComponent.vnode.el = vnode.el;
|
|
1586
|
+
updateHOCHostEl(parentComponent, vnode.el);
|
|
1587
|
+
}
|
|
1540
1588
|
return next;
|
|
1541
1589
|
};
|
|
1542
1590
|
const locateClosingAnchor = (node, open = "[", close = "]") => {
|
|
@@ -1602,10 +1650,17 @@ function isMismatchAllowed(el, allowedType) {
|
|
|
1602
1650
|
}
|
|
1603
1651
|
}
|
|
1604
1652
|
|
|
1653
|
+
const requestIdleCallback = shared.getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1));
|
|
1654
|
+
const cancelIdleCallback = shared.getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id));
|
|
1605
1655
|
const hydrateOnIdle = (timeout = 1e4) => (hydrate) => {
|
|
1606
1656
|
const id = requestIdleCallback(hydrate, { timeout });
|
|
1607
1657
|
return () => cancelIdleCallback(id);
|
|
1608
1658
|
};
|
|
1659
|
+
function elementIsVisibleInViewport(el) {
|
|
1660
|
+
const { top, left, bottom, right } = el.getBoundingClientRect();
|
|
1661
|
+
const { innerHeight, innerWidth } = window;
|
|
1662
|
+
return (top > 0 && top < innerHeight || bottom > 0 && bottom < innerHeight) && (left > 0 && left < innerWidth || right > 0 && right < innerWidth);
|
|
1663
|
+
}
|
|
1609
1664
|
const hydrateOnVisible = (opts) => (hydrate, forEach) => {
|
|
1610
1665
|
const ob = new IntersectionObserver((entries) => {
|
|
1611
1666
|
for (const e of entries) {
|
|
@@ -1615,7 +1670,15 @@ const hydrateOnVisible = (opts) => (hydrate, forEach) => {
|
|
|
1615
1670
|
break;
|
|
1616
1671
|
}
|
|
1617
1672
|
}, opts);
|
|
1618
|
-
forEach((el) =>
|
|
1673
|
+
forEach((el) => {
|
|
1674
|
+
if (!(el instanceof Element)) return;
|
|
1675
|
+
if (elementIsVisibleInViewport(el)) {
|
|
1676
|
+
hydrate();
|
|
1677
|
+
ob.disconnect();
|
|
1678
|
+
return false;
|
|
1679
|
+
}
|
|
1680
|
+
ob.observe(el);
|
|
1681
|
+
});
|
|
1619
1682
|
return () => ob.disconnect();
|
|
1620
1683
|
};
|
|
1621
1684
|
const hydrateOnMediaQuery = (query) => (hydrate) => {
|
|
@@ -1660,7 +1723,10 @@ function forEachElement(node, cb) {
|
|
|
1660
1723
|
let next = node.nextSibling;
|
|
1661
1724
|
while (next) {
|
|
1662
1725
|
if (next.nodeType === 1) {
|
|
1663
|
-
cb(next);
|
|
1726
|
+
const result = cb(next);
|
|
1727
|
+
if (result === false) {
|
|
1728
|
+
break;
|
|
1729
|
+
}
|
|
1664
1730
|
} else if (isComment(next)) {
|
|
1665
1731
|
if (next.data === "]") {
|
|
1666
1732
|
if (--depth === 0) break;
|
|
@@ -2259,12 +2325,13 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
|
2259
2325
|
}
|
|
2260
2326
|
openBlock();
|
|
2261
2327
|
const validSlotContent = slot && ensureValidVNode(slot(props));
|
|
2328
|
+
const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
|
|
2329
|
+
// key attached in the `createSlots` helper, respect that
|
|
2330
|
+
validSlotContent && validSlotContent.key;
|
|
2262
2331
|
const rendered = createBlock(
|
|
2263
2332
|
Fragment,
|
|
2264
2333
|
{
|
|
2265
|
-
key: (
|
|
2266
|
-
// key attached in the `createSlots` helper, respect that
|
|
2267
|
-
validSlotContent && validSlotContent.key || `_${name}`) + // #7256 force differentiate fallback content from actual content
|
|
2334
|
+
key: (slotKey && !shared.isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
|
|
2268
2335
|
(!validSlotContent && fallback ? "_fb" : "")
|
|
2269
2336
|
},
|
|
2270
2337
|
validSlotContent || (fallback ? fallback() : []),
|
|
@@ -4790,14 +4857,13 @@ function watch(source, cb, options) {
|
|
|
4790
4857
|
function doWatch(source, cb, options = shared.EMPTY_OBJ) {
|
|
4791
4858
|
const { immediate, deep, flush, once } = options;
|
|
4792
4859
|
const baseWatchOptions = shared.extend({}, options);
|
|
4860
|
+
const runsImmediately = cb && immediate || !cb && flush !== "post";
|
|
4793
4861
|
let ssrCleanup;
|
|
4794
4862
|
if (isInSSRComponentSetup) {
|
|
4795
4863
|
if (flush === "sync") {
|
|
4796
4864
|
const ctx = useSSRContext();
|
|
4797
4865
|
ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
|
|
4798
|
-
} else if (!
|
|
4799
|
-
baseWatchOptions.once = true;
|
|
4800
|
-
} else {
|
|
4866
|
+
} else if (!runsImmediately) {
|
|
4801
4867
|
const watchStopHandle = () => {
|
|
4802
4868
|
};
|
|
4803
4869
|
watchStopHandle.stop = shared.NOOP;
|
|
@@ -4836,7 +4902,13 @@ function doWatch(source, cb, options = shared.EMPTY_OBJ) {
|
|
|
4836
4902
|
}
|
|
4837
4903
|
};
|
|
4838
4904
|
const watchHandle = reactivity.watch(source, cb, baseWatchOptions);
|
|
4839
|
-
if (
|
|
4905
|
+
if (isInSSRComponentSetup) {
|
|
4906
|
+
if (ssrCleanup) {
|
|
4907
|
+
ssrCleanup.push(watchHandle);
|
|
4908
|
+
} else if (runsImmediately) {
|
|
4909
|
+
watchHandle();
|
|
4910
|
+
}
|
|
4911
|
+
}
|
|
4840
4912
|
return watchHandle;
|
|
4841
4913
|
}
|
|
4842
4914
|
function instanceWatch(source, value, options) {
|
|
@@ -4869,13 +4941,13 @@ function useModel(props, name, options = shared.EMPTY_OBJ) {
|
|
|
4869
4941
|
const i = getCurrentInstance();
|
|
4870
4942
|
const camelizedName = shared.camelize(name);
|
|
4871
4943
|
const hyphenatedName = shared.hyphenate(name);
|
|
4872
|
-
const modifiers = getModelModifiers(props,
|
|
4944
|
+
const modifiers = getModelModifiers(props, camelizedName);
|
|
4873
4945
|
const res = reactivity.customRef((track, trigger) => {
|
|
4874
4946
|
let localValue;
|
|
4875
4947
|
let prevSetValue = shared.EMPTY_OBJ;
|
|
4876
4948
|
let prevEmittedValue;
|
|
4877
4949
|
watchSyncEffect(() => {
|
|
4878
|
-
const propValue = props[
|
|
4950
|
+
const propValue = props[camelizedName];
|
|
4879
4951
|
if (shared.hasChanged(localValue, propValue)) {
|
|
4880
4952
|
localValue = propValue;
|
|
4881
4953
|
trigger();
|
|
@@ -5806,9 +5878,9 @@ function closeBlock() {
|
|
|
5806
5878
|
currentBlock = blockStack[blockStack.length - 1] || null;
|
|
5807
5879
|
}
|
|
5808
5880
|
let isBlockTreeEnabled = 1;
|
|
5809
|
-
function setBlockTracking(value) {
|
|
5881
|
+
function setBlockTracking(value, inVOnce = false) {
|
|
5810
5882
|
isBlockTreeEnabled += value;
|
|
5811
|
-
if (value < 0 && currentBlock) {
|
|
5883
|
+
if (value < 0 && currentBlock && inVOnce) {
|
|
5812
5884
|
currentBlock.hasOnce = true;
|
|
5813
5885
|
}
|
|
5814
5886
|
}
|
|
@@ -6047,7 +6119,7 @@ function normalizeVNode(child) {
|
|
|
6047
6119
|
// #3666, avoid reference pollution when reusing vnode
|
|
6048
6120
|
child.slice()
|
|
6049
6121
|
);
|
|
6050
|
-
} else if (
|
|
6122
|
+
} else if (isVNode(child)) {
|
|
6051
6123
|
return cloneIfMounted(child);
|
|
6052
6124
|
} else {
|
|
6053
6125
|
return createVNode(Text, null, String(child));
|
|
@@ -6280,9 +6352,9 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
6280
6352
|
instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers);
|
|
6281
6353
|
const { setup } = Component;
|
|
6282
6354
|
if (setup) {
|
|
6355
|
+
reactivity.pauseTracking();
|
|
6283
6356
|
const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
|
|
6284
6357
|
const reset = setCurrentInstance(instance);
|
|
6285
|
-
reactivity.pauseTracking();
|
|
6286
6358
|
const setupResult = callWithErrorHandling(
|
|
6287
6359
|
setup,
|
|
6288
6360
|
instance,
|
|
@@ -6292,10 +6364,13 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
6292
6364
|
setupContext
|
|
6293
6365
|
]
|
|
6294
6366
|
);
|
|
6367
|
+
const isAsyncSetup = shared.isPromise(setupResult);
|
|
6295
6368
|
reactivity.resetTracking();
|
|
6296
6369
|
reset();
|
|
6297
|
-
if (
|
|
6298
|
-
|
|
6370
|
+
if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) {
|
|
6371
|
+
markAsyncBoundary(instance);
|
|
6372
|
+
}
|
|
6373
|
+
if (isAsyncSetup) {
|
|
6299
6374
|
setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
|
|
6300
6375
|
if (isSSR) {
|
|
6301
6376
|
return setupResult.then((resolvedResult) => {
|
|
@@ -6475,7 +6550,7 @@ function isMemoSame(cached, memo) {
|
|
|
6475
6550
|
return true;
|
|
6476
6551
|
}
|
|
6477
6552
|
|
|
6478
|
-
const version = "3.5.
|
|
6553
|
+
const version = "3.5.13";
|
|
6479
6554
|
const warn$1 = shared.NOOP;
|
|
6480
6555
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
6481
6556
|
const devtools = void 0;
|
package/dist/runtime-core.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { computed as computed$1, Ref, OnCleanup, WatchStopHandle, ShallowUnwrapRef, UnwrapNestedRefs, DebuggerEvent, ComputedGetter, WritableComputedOptions, WatchCallback, ReactiveEffect, DebuggerOptions, WatchEffect, WatchHandle, WatchSource, ReactiveMarker, ShallowRef, WatchErrorCodes, reactive } from '@vue/reactivity';
|
|
2
2
|
export { ComputedGetter, ComputedRef, ComputedSetter, CustomRefFactory, DebuggerEvent, DebuggerEventExtraInfo, DebuggerOptions, DeepReadonly, EffectScheduler, EffectScope, MaybeRef, MaybeRefOrGetter, Raw, Reactive, ReactiveEffect, ReactiveEffectOptions, ReactiveEffectRunner, ReactiveFlags, Ref, ShallowReactive, ShallowRef, ShallowUnwrapRef, ToRef, ToRefs, TrackOpTypes, TriggerOpTypes, UnwrapNestedRefs, UnwrapRef, WatchCallback, WatchEffect, WatchHandle, WatchSource, WatchStopHandle, WritableComputedOptions, WritableComputedRef, customRef, effect, effectScope, getCurrentScope, getCurrentWatcher, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onScopeDispose, onWatcherCleanup, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, toValue, triggerRef, unref } from '@vue/reactivity';
|
|
3
|
-
import { IfAny, Prettify, LooseRequired, UnionToIntersection, OverloadParameters } from '@vue/shared';
|
|
3
|
+
import { IfAny, Prettify, LooseRequired, UnionToIntersection, OverloadParameters, IsKeyValues } from '@vue/shared';
|
|
4
4
|
export { camelize, capitalize, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared';
|
|
5
5
|
|
|
6
6
|
export declare const computed: typeof computed$1;
|
|
@@ -118,7 +118,7 @@ type InferPropType<T, NullAsAny = true> = [T] extends [null] ? NullAsAny extends
|
|
|
118
118
|
type: DateConstructor;
|
|
119
119
|
}] ? Date : [T] extends [(infer U)[] | {
|
|
120
120
|
type: (infer U)[];
|
|
121
|
-
}] ? U extends DateConstructor ? Date | InferPropType<U, false> : InferPropType<U, false> : [T] extends [Prop<infer V, infer D>] ? unknown extends V ? IfAny<V, V, D> : V : T;
|
|
121
|
+
}] ? U extends DateConstructor ? Date | InferPropType<U, false> : InferPropType<U, false> : [T] extends [Prop<infer V, infer D>] ? unknown extends V ? keyof V extends never ? IfAny<V, V, D> : V : V : T;
|
|
122
122
|
/**
|
|
123
123
|
* Extract prop types from a runtime props options object.
|
|
124
124
|
* The extracted types are **internal** - i.e. the resolved props received by
|
|
@@ -223,7 +223,7 @@ type BooleanKey<T, K extends keyof T = keyof T> = K extends any ? [T[K]] extends
|
|
|
223
223
|
export declare function defineEmits<EE extends string = string>(emitOptions: EE[]): EmitFn<EE[]>;
|
|
224
224
|
export declare function defineEmits<E extends EmitsOptions = EmitsOptions>(emitOptions: E): EmitFn<E>;
|
|
225
225
|
export declare function defineEmits<T extends ComponentTypeEmits>(): T extends (...args: any[]) => any ? T : ShortEmits<T>;
|
|
226
|
-
export type ComponentTypeEmits = ((...args: any[]) => any) | Record<string, any
|
|
226
|
+
export type ComponentTypeEmits = ((...args: any[]) => any) | Record<string, any>;
|
|
227
227
|
type RecordToUnion<T extends Record<string, any>> = T[keyof T];
|
|
228
228
|
type ShortEmits<T extends Record<string, any>> = UnionToIntersection<RecordToUnion<{
|
|
229
229
|
[K in keyof T]: (evt: K, ...args: T[K]) => void;
|
|
@@ -331,11 +331,11 @@ type InferDefaults<T> = {
|
|
|
331
331
|
};
|
|
332
332
|
type NativeType = null | number | string | boolean | symbol | Function;
|
|
333
333
|
type InferDefault<P, T> = ((props: P) => T & {}) | (T extends NativeType ? T : never);
|
|
334
|
-
type PropsWithDefaults<T, Defaults extends InferDefaults<T>, BKeys extends keyof T> = Readonly<MappedOmit<T, keyof Defaults>> & {
|
|
334
|
+
type PropsWithDefaults<T, Defaults extends InferDefaults<T>, BKeys extends keyof T> = T extends unknown ? Readonly<MappedOmit<T, keyof Defaults>> & {
|
|
335
335
|
readonly [K in keyof Defaults as K extends keyof T ? K : never]-?: K extends keyof T ? Defaults[K] extends undefined ? IfAny<Defaults[K], NotUndefined<T[K]>, T[K]> : NotUndefined<T[K]> : never;
|
|
336
336
|
} & {
|
|
337
337
|
readonly [K in BKeys]-?: K extends keyof Defaults ? Defaults[K] extends undefined ? boolean | undefined : boolean : boolean;
|
|
338
|
-
};
|
|
338
|
+
} : never;
|
|
339
339
|
/**
|
|
340
340
|
* Vue `<script setup>` compiler macro for providing props default values when
|
|
341
341
|
* using type-based `defineProps` declaration.
|
|
@@ -371,8 +371,9 @@ type TypeEmitsToOptions<T extends ComponentTypeEmits> = {
|
|
|
371
371
|
[K in keyof T & string]: T[K] extends [...args: infer Args] ? (...args: Args) => any : () => any;
|
|
372
372
|
} & (T extends (...args: any[]) => any ? ParametersToFns<OverloadParameters<T>> : {});
|
|
373
373
|
type ParametersToFns<T extends any[]> = {
|
|
374
|
-
[K in T[0]]: K extends
|
|
374
|
+
[K in T[0]]: IsStringLiteral<K> extends true ? (...args: T extends [e: infer E, ...args: infer P] ? K extends E ? P : never : never) => any : never;
|
|
375
375
|
};
|
|
376
|
+
type IsStringLiteral<T> = T extends string ? string extends T ? false : true : false;
|
|
376
377
|
export type ShortEmitsToObject<E> = E extends Record<string, any[]> ? {
|
|
377
378
|
[K in keyof E]: (...args: E[K]) => any;
|
|
378
379
|
} : E;
|
|
@@ -871,20 +872,20 @@ interface LegacyOptions<Props, D, C extends ComputedOptions, M extends MethodOpt
|
|
|
871
872
|
filters?: Record<string, Function>;
|
|
872
873
|
mixins?: Mixin[];
|
|
873
874
|
extends?: Extends;
|
|
874
|
-
beforeCreate?():
|
|
875
|
-
created?():
|
|
876
|
-
beforeMount?():
|
|
877
|
-
mounted?():
|
|
878
|
-
beforeUpdate?():
|
|
879
|
-
updated?():
|
|
880
|
-
activated?():
|
|
881
|
-
deactivated?():
|
|
875
|
+
beforeCreate?(): any;
|
|
876
|
+
created?(): any;
|
|
877
|
+
beforeMount?(): any;
|
|
878
|
+
mounted?(): any;
|
|
879
|
+
beforeUpdate?(): any;
|
|
880
|
+
updated?(): any;
|
|
881
|
+
activated?(): any;
|
|
882
|
+
deactivated?(): any;
|
|
882
883
|
/** @deprecated use `beforeUnmount` instead */
|
|
883
|
-
beforeDestroy?():
|
|
884
|
-
beforeUnmount?():
|
|
884
|
+
beforeDestroy?(): any;
|
|
885
|
+
beforeUnmount?(): any;
|
|
885
886
|
/** @deprecated use `unmounted` instead */
|
|
886
|
-
destroyed?():
|
|
887
|
-
unmounted?():
|
|
887
|
+
destroyed?(): any;
|
|
888
|
+
unmounted?(): any;
|
|
888
889
|
renderTracked?: DebuggerHook;
|
|
889
890
|
renderTriggered?: DebuggerHook;
|
|
890
891
|
errorCaptured?: ErrorCapturedHook;
|
|
@@ -977,7 +978,7 @@ export declare function hasInjectionContext(): boolean;
|
|
|
977
978
|
|
|
978
979
|
export type PublicProps = VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
979
980
|
type ResolveProps<PropsOrPropOptions, E extends EmitsOptions> = Readonly<PropsOrPropOptions extends ComponentPropsOptions ? ExtractPropTypes<PropsOrPropOptions> : PropsOrPropOptions> & ({} extends E ? {} : EmitsToProps<E>);
|
|
980
|
-
export type DefineComponent<PropsOrPropOptions = {}, RawBindings = {}, D = {}, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, EE extends string = string, PP = PublicProps, Props = ResolveProps<PropsOrPropOptions, E>, Defaults = ExtractDefaultPropTypes<PropsOrPropOptions>, S extends SlotsType = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, MakeDefaultsOptional extends boolean = true, TypeRefs extends Record<string, unknown> = {}, TypeEl extends Element = any> = ComponentPublicInstanceConstructor<CreateComponentPublicInstanceWithMixins<Props, RawBindings, D, C, M, Mixin, Extends, E, PP
|
|
981
|
+
export type DefineComponent<PropsOrPropOptions = {}, RawBindings = {}, D = {}, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, EE extends string = string, PP = PublicProps, Props = ResolveProps<PropsOrPropOptions, E>, Defaults = ExtractDefaultPropTypes<PropsOrPropOptions>, S extends SlotsType = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, MakeDefaultsOptional extends boolean = true, TypeRefs extends Record<string, unknown> = {}, TypeEl extends Element = any> = ComponentPublicInstanceConstructor<CreateComponentPublicInstanceWithMixins<Props, RawBindings, D, C, M, Mixin, Extends, E, PP, Defaults, MakeDefaultsOptional, {}, S, LC & GlobalComponents, Directives & GlobalDirectives, Exposed, TypeRefs, TypeEl>> & ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults, {}, string, S, LC & GlobalComponents, Directives & GlobalDirectives, Exposed, Provide> & PP;
|
|
981
982
|
export type DefineSetupFnComponent<P extends Record<string, any>, E extends EmitsOptions = {}, S extends SlotsType = SlotsType, Props = P & EmitsToProps<E>, PP = PublicProps> = new (props: Props & PP) => CreateComponentPublicInstanceWithMixins<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, E, PP, {}, false, {}, S>;
|
|
982
983
|
type ToResolvedProps<Props, Emits extends EmitsOptions> = Readonly<Props> & Readonly<EmitsToProps<Emits>>;
|
|
983
984
|
export declare function defineComponent<Props extends Record<string, any>, E extends EmitsOptions = {}, EE extends string = string, S extends SlotsType = {}>(setup: (props: Props, ctx: SetupContext<E, S>) => RenderFunction | Promise<RenderFunction>, options?: Pick<ComponentOptions, 'name' | 'inheritAttrs'> & {
|
|
@@ -990,9 +991,9 @@ export declare function defineComponent<Props extends Record<string, any>, E ext
|
|
|
990
991
|
emits?: E | EE[];
|
|
991
992
|
slots?: S;
|
|
992
993
|
}): DefineSetupFnComponent<Props, E, S>;
|
|
993
|
-
export declare function defineComponent<TypeProps, RuntimePropsOptions extends ComponentObjectPropsOptions = ComponentObjectPropsOptions, RuntimePropsKeys extends string = string, TypeEmits extends ComponentTypeEmits = {}, RuntimeEmitsOptions extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Data = {}, SetupBindings = {}, Computed extends ComputedOptions = {}, Methods extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, InjectOptions extends ComponentInjectOptions = {}, InjectKeys extends string = string, Slots extends SlotsType = {}, LocalComponents extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, ResolvedEmits extends EmitsOptions = {} extends RuntimeEmitsOptions ? TypeEmitsToOptions<TypeEmits> : RuntimeEmitsOptions, InferredProps =
|
|
994
|
+
export declare function defineComponent<TypeProps, RuntimePropsOptions extends ComponentObjectPropsOptions = ComponentObjectPropsOptions, RuntimePropsKeys extends string = string, TypeEmits extends ComponentTypeEmits = {}, RuntimeEmitsOptions extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Data = {}, SetupBindings = {}, Computed extends ComputedOptions = {}, Methods extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, InjectOptions extends ComponentInjectOptions = {}, InjectKeys extends string = string, Slots extends SlotsType = {}, LocalComponents extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, ResolvedEmits extends EmitsOptions = {} extends RuntimeEmitsOptions ? TypeEmitsToOptions<TypeEmits> : RuntimeEmitsOptions, InferredProps = IsKeyValues<TypeProps> extends true ? TypeProps : string extends RuntimePropsKeys ? ComponentObjectPropsOptions extends RuntimePropsOptions ? {} : ExtractPropTypes<RuntimePropsOptions> : {
|
|
994
995
|
[key in RuntimePropsKeys]?: any;
|
|
995
|
-
}
|
|
996
|
+
}, TypeRefs extends Record<string, unknown> = {}, TypeEl extends Element = any>(options: {
|
|
996
997
|
props?: (RuntimePropsOptions & ThisType<void>) | RuntimePropsKeys[];
|
|
997
998
|
/**
|
|
998
999
|
* @private for language-tools use only
|
|
@@ -1011,7 +1012,7 @@ export declare function defineComponent<TypeProps, RuntimePropsOptions extends C
|
|
|
1011
1012
|
*/
|
|
1012
1013
|
__typeEl?: TypeEl;
|
|
1013
1014
|
} & ComponentOptionsBase<ToResolvedProps<InferredProps, ResolvedEmits>, SetupBindings, Data, Computed, Methods, Mixin, Extends, RuntimeEmitsOptions, RuntimeEmitsKeys, {}, // Defaults
|
|
1014
|
-
InjectOptions, InjectKeys, Slots, LocalComponents, Directives, Exposed, Provide> & ThisType<CreateComponentPublicInstanceWithMixins<ToResolvedProps<InferredProps, ResolvedEmits>, SetupBindings, Data, Computed, Methods, Mixin, Extends, ResolvedEmits,
|
|
1015
|
+
InjectOptions, InjectKeys, Slots, LocalComponents, Directives, Exposed, Provide> & ThisType<CreateComponentPublicInstanceWithMixins<ToResolvedProps<InferredProps, ResolvedEmits>, SetupBindings, Data, Computed, Methods, Mixin, Extends, ResolvedEmits, {}, {}, false, InjectOptions, Slots, LocalComponents, Directives, Exposed>>): DefineComponent<InferredProps, SetupBindings, Data, Computed, Methods, Mixin, Extends, ResolvedEmits, RuntimeEmitsKeys, PublicProps, ToResolvedProps<InferredProps, ResolvedEmits>, ExtractDefaultPropTypes<RuntimePropsOptions>, Slots, LocalComponents, Directives, Exposed, Provide, unknown extends TypeProps ? true : false, TypeRefs, TypeEl>;
|
|
1015
1016
|
|
|
1016
1017
|
export interface App<HostElement = any> {
|
|
1017
1018
|
version: string;
|
|
@@ -1250,7 +1251,7 @@ export declare function openBlock(disableTracking?: boolean): void;
|
|
|
1250
1251
|
*
|
|
1251
1252
|
* ``` js
|
|
1252
1253
|
* _cache[1] || (
|
|
1253
|
-
* setBlockTracking(-1),
|
|
1254
|
+
* setBlockTracking(-1, true),
|
|
1254
1255
|
* _cache[1] = createVNode(...),
|
|
1255
1256
|
* setBlockTracking(1),
|
|
1256
1257
|
* _cache[1]
|
|
@@ -1259,7 +1260,7 @@ export declare function openBlock(disableTracking?: boolean): void;
|
|
|
1259
1260
|
*
|
|
1260
1261
|
* @private
|
|
1261
1262
|
*/
|
|
1262
|
-
export declare function setBlockTracking(value: number): void;
|
|
1263
|
+
export declare function setBlockTracking(value: number, inVOnce?: boolean): void;
|
|
1263
1264
|
/**
|
|
1264
1265
|
* @private
|
|
1265
1266
|
*/
|
|
@@ -1527,7 +1528,7 @@ export declare function useModel<M extends PropertyKey, T extends Record<string,
|
|
|
1527
1528
|
|
|
1528
1529
|
export declare function useTemplateRef<T = unknown, Keys extends string = string>(key: Keys): Readonly<ShallowRef<T | null>>;
|
|
1529
1530
|
|
|
1530
|
-
export declare function useId(): string
|
|
1531
|
+
export declare function useId(): string;
|
|
1531
1532
|
|
|
1532
1533
|
type RawProps = VNodeProps & {
|
|
1533
1534
|
__v_isVNode?: never;
|