@vue/compat 3.6.0-rc.14 → 3.6.0-rc.15
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/README.md +2 -2
- package/dist/vue-compat.d.ts +16 -5
- package/dist/vue.cjs.js +536 -235
- package/dist/vue.cjs.prod.js +435 -186
- package/dist/vue.esm-browser.js +513 -229
- package/dist/vue.esm-browser.prod.js +7 -7
- package/dist/vue.esm-bundler.js +543 -235
- package/dist/vue.global.js +513 -229
- package/dist/vue.global.prod.js +7 -7
- package/dist/vue.runtime.esm-browser.js +513 -229
- package/dist/vue.runtime.esm-browser.prod.js +7 -7
- package/dist/vue.runtime.esm-bundler.js +543 -235
- package/dist/vue.runtime.global.js +513 -229
- package/dist/vue.runtime.global.prod.js +7 -7
- package/package.json +3 -3
package/dist/vue.cjs.prod.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compat v3.6.0-rc.
|
|
2
|
+
* @vue/compat v3.6.0-rc.15
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -72,10 +72,18 @@ const isPlainObject = (val) => toTypeString(val) === "[object Object]";
|
|
|
72
72
|
const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
|
|
73
73
|
const isReservedProp = /*@__PURE__*/ makeMap(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");
|
|
74
74
|
const isBuiltInDirective = /*@__PURE__*/ makeMap("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo");
|
|
75
|
+
const STRING_CACHE_MAX_SIZE = 1e4;
|
|
75
76
|
const cacheStringFunction = (fn) => {
|
|
76
|
-
|
|
77
|
+
let cache = Object.create(null);
|
|
78
|
+
let size = 0;
|
|
77
79
|
return ((str) => {
|
|
78
|
-
|
|
80
|
+
const hit = cache[str];
|
|
81
|
+
if (hit !== void 0) return hit;
|
|
82
|
+
if (++size > STRING_CACHE_MAX_SIZE) {
|
|
83
|
+
cache = Object.create(null);
|
|
84
|
+
size = 1;
|
|
85
|
+
}
|
|
86
|
+
return cache[str] = fn(str);
|
|
79
87
|
});
|
|
80
88
|
};
|
|
81
89
|
const camelizeRE = /-(\w)/g;
|
|
@@ -83,22 +91,22 @@ const camelizeReplacer = (_, c) => c ? c.toUpperCase() : "";
|
|
|
83
91
|
/**
|
|
84
92
|
* @private
|
|
85
93
|
*/
|
|
86
|
-
const camelize = cacheStringFunction((str) => str.replace(camelizeRE, camelizeReplacer));
|
|
94
|
+
const camelize = /*@__PURE__*/ cacheStringFunction((str) => str.replace(camelizeRE, camelizeReplacer));
|
|
87
95
|
const hyphenateRE = /\B([A-Z])/g;
|
|
88
96
|
/**
|
|
89
97
|
* @private
|
|
90
98
|
*/
|
|
91
|
-
const hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
|
|
99
|
+
const hyphenate = /*@__PURE__*/ cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
|
|
92
100
|
/**
|
|
93
101
|
* @private
|
|
94
102
|
*/
|
|
95
|
-
const capitalize = cacheStringFunction((str) => {
|
|
103
|
+
const capitalize = /*@__PURE__*/ cacheStringFunction((str) => {
|
|
96
104
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
97
105
|
});
|
|
98
106
|
/**
|
|
99
107
|
* @private
|
|
100
108
|
*/
|
|
101
|
-
const toHandlerKey = cacheStringFunction((str) => {
|
|
109
|
+
const toHandlerKey = /*@__PURE__*/ cacheStringFunction((str) => {
|
|
102
110
|
return str ? `on${capitalize(str)}` : ``;
|
|
103
111
|
});
|
|
104
112
|
/**
|
|
@@ -237,26 +245,11 @@ const isMathMLTag = /*@__PURE__*/ makeMap(MATH_TAGS);
|
|
|
237
245
|
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
238
246
|
*/
|
|
239
247
|
const isVoidTag = /*@__PURE__*/ makeMap(VOID_TAGS);
|
|
240
|
-
|
|
241
|
-
//#region packages/shared/src/domAttrConfig.ts
|
|
242
|
-
/**
|
|
243
|
-
* On the client we only need to offer special cases for boolean attributes that
|
|
244
|
-
* have different names from their corresponding dom properties:
|
|
245
|
-
* - itemscope -> N/A
|
|
246
|
-
* - allowfullscreen -> allowFullscreen
|
|
247
|
-
* - formnovalidate -> formNoValidate
|
|
248
|
-
* - ismap -> isMap
|
|
249
|
-
* - nomodule -> noModule
|
|
250
|
-
* - novalidate -> noValidate
|
|
251
|
-
* - playsinline -> playsInline
|
|
252
|
-
* - readonly -> readOnly
|
|
253
|
-
*/
|
|
254
|
-
const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;
|
|
255
|
-
const isSpecialBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs);
|
|
248
|
+
const isSpecialBooleanAttr = /*@__PURE__*/ makeMap("itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly");
|
|
256
249
|
/**
|
|
257
250
|
* The full list is needed during SSR to produce the correct initial markup.
|
|
258
251
|
*/
|
|
259
|
-
const isBooleanAttr = /*@__PURE__*/ makeMap(
|
|
252
|
+
const isBooleanAttr = /*@__PURE__*/ makeMap("itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly,async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");
|
|
260
253
|
/**
|
|
261
254
|
* Boolean attributes should be included if the value is truthy or ''.
|
|
262
255
|
* e.g. `<select multiple>` compiles to `{ multiple: '' }`
|
|
@@ -481,18 +474,23 @@ function isVaporBranchStart(data) {
|
|
|
481
474
|
}
|
|
482
475
|
return true;
|
|
483
476
|
}
|
|
477
|
+
/**
|
|
478
|
+
* The data of a comment opening a range only a vapor server render emits:
|
|
479
|
+
* `<!--{-->` around the render of a component, or a v-if branch's.
|
|
480
|
+
*/
|
|
481
|
+
function isVaporRangeStart(data) {
|
|
482
|
+
return data === "{" || isVaporBranchStart(data);
|
|
483
|
+
}
|
|
484
|
+
/** The data of the comment closing the range `open` opens. */
|
|
485
|
+
function rangeCloseOf(open) {
|
|
486
|
+
return open === "(" ? ")" : open === "{" ? "}" : "]";
|
|
487
|
+
}
|
|
484
488
|
//#endregion
|
|
485
489
|
//#region packages/reactivity/src/system.ts
|
|
486
490
|
const notifyBuffer = [];
|
|
487
491
|
let batchDepth = 0;
|
|
488
492
|
let activeSub = void 0;
|
|
489
|
-
|
|
490
|
-
function incRunDepth() {
|
|
491
|
-
++runDepth;
|
|
492
|
-
}
|
|
493
|
-
function decRunDepth() {
|
|
494
|
-
--runDepth;
|
|
495
|
-
}
|
|
493
|
+
const CHECKING = 512;
|
|
496
494
|
let globalVersion = 0;
|
|
497
495
|
let notifyIndex = 0;
|
|
498
496
|
let notifyBufferLength = 0;
|
|
@@ -541,6 +539,7 @@ function unlink(link, sub = link.sub) {
|
|
|
541
539
|
const nextDep = link.nextDep;
|
|
542
540
|
const nextSub = link.nextSub;
|
|
543
541
|
const prevSub = link.prevSub;
|
|
542
|
+
link.prevDep = link.nextDep = link.prevSub = link.nextSub = void 0;
|
|
544
543
|
if (nextDep !== void 0) nextDep.prevDep = prevDep;
|
|
545
544
|
else sub.depsTail = prevDep;
|
|
546
545
|
if (prevDep !== void 0) prevDep.nextDep = nextDep;
|
|
@@ -548,7 +547,7 @@ function unlink(link, sub = link.sub) {
|
|
|
548
547
|
if (nextSub !== void 0) nextSub.prevSub = prevSub;
|
|
549
548
|
else dep.subsTail = prevSub;
|
|
550
549
|
if (prevSub !== void 0) prevSub.nextSub = nextSub;
|
|
551
|
-
else if ((dep.subs = nextSub) === void 0) {
|
|
550
|
+
else if ((dep.subs = nextSub) === void 0 && dep.flags & 1) {
|
|
552
551
|
let toRemove = dep.deps;
|
|
553
552
|
if (toRemove !== void 0) {
|
|
554
553
|
do
|
|
@@ -566,14 +565,12 @@ function propagate(link) {
|
|
|
566
565
|
const sub = link.sub;
|
|
567
566
|
let flags = sub.flags;
|
|
568
567
|
if (flags & 3) {
|
|
569
|
-
if (!(flags &
|
|
570
|
-
|
|
571
|
-
if (runDepth) sub.flags |= 8;
|
|
572
|
-
} else if (!(flags & 12)) flags = 0;
|
|
568
|
+
if (!(flags & 44)) sub.flags = flags | 32;
|
|
569
|
+
else if (!(flags & 12)) flags = 0;
|
|
573
570
|
else if (!(flags & 4)) sub.flags = flags & -9 | 32;
|
|
574
571
|
else if (!(flags & 48) && isValidLink(link, sub)) {
|
|
575
572
|
sub.flags = flags | 40;
|
|
576
|
-
flags
|
|
573
|
+
flags = sub === activeSub || activeSub === void 0 ? 0 : flags & 1;
|
|
577
574
|
} else flags = 0;
|
|
578
575
|
if (flags & 2) notifyBuffer[notifyBufferLength++] = sub;
|
|
579
576
|
if (flags & 1) {
|
|
@@ -609,15 +606,18 @@ function propagate(link) {
|
|
|
609
606
|
function startTracking(sub) {
|
|
610
607
|
++globalVersion;
|
|
611
608
|
sub.depsTail = void 0;
|
|
612
|
-
sub.flags = sub.flags & -
|
|
609
|
+
sub.flags = sub.flags & -569 | 4;
|
|
613
610
|
return setActiveSub(sub);
|
|
614
611
|
}
|
|
615
612
|
function endTracking(sub, prevSub) {
|
|
616
613
|
activeSub = prevSub;
|
|
617
614
|
const depsTail = sub.depsTail;
|
|
618
615
|
let toRemove = depsTail !== void 0 ? depsTail.nextDep : sub.deps;
|
|
619
|
-
while (toRemove !== void 0)
|
|
620
|
-
|
|
616
|
+
while (toRemove !== void 0) {
|
|
617
|
+
unlink(toRemove, sub);
|
|
618
|
+
toRemove = depsTail !== void 0 ? depsTail.nextDep : sub.deps;
|
|
619
|
+
}
|
|
620
|
+
if ((sub.flags &= -5) & 8) markRecursed(sub);
|
|
621
621
|
}
|
|
622
622
|
function flush() {
|
|
623
623
|
let hasError = false;
|
|
@@ -639,45 +639,67 @@ function flush() {
|
|
|
639
639
|
if (hasError) throw error;
|
|
640
640
|
}
|
|
641
641
|
function checkDirty(link, sub) {
|
|
642
|
+
try {
|
|
643
|
+
return walkDirty(link, sub);
|
|
644
|
+
} catch (err) {
|
|
645
|
+
markStale(sub);
|
|
646
|
+
throw err;
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
function walkDirty(link, sub) {
|
|
650
|
+
const root = sub;
|
|
642
651
|
let stack;
|
|
643
652
|
let checkDepth = 0;
|
|
653
|
+
let staleDepth = 0;
|
|
654
|
+
let staleFloor = 0;
|
|
644
655
|
top: do {
|
|
645
656
|
const dep = link.dep;
|
|
646
657
|
const depFlags = dep.flags;
|
|
647
658
|
let dirty = false;
|
|
648
659
|
if (sub.flags & 16) dirty = true;
|
|
649
660
|
else if ((depFlags & 17) === 17) {
|
|
650
|
-
const subs = dep.subs;
|
|
651
661
|
if (dep.update()) {
|
|
652
|
-
|
|
662
|
+
const subs = dep.subs;
|
|
663
|
+
if (subs !== void 0 && (subs !== link || subs.nextSub !== void 0)) shallowPropagate(subs);
|
|
653
664
|
dirty = true;
|
|
654
665
|
}
|
|
655
666
|
} else if ((depFlags & 33) === 33) {
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
667
|
+
const depth = dep === root ? 0 : depFlags & CHECKING ? checkingDepth(dep, stack, checkDepth) : -1;
|
|
668
|
+
if (depth < 0) {
|
|
669
|
+
if (link.nextSub !== void 0 || link.prevSub !== void 0) dep.flags = depFlags | CHECKING;
|
|
670
|
+
stack = {
|
|
671
|
+
value: link,
|
|
672
|
+
prev: stack
|
|
673
|
+
};
|
|
674
|
+
link = dep.deps;
|
|
675
|
+
sub = dep;
|
|
676
|
+
++checkDepth;
|
|
677
|
+
continue;
|
|
678
|
+
}
|
|
679
|
+
if (depth < checkDepth) {
|
|
680
|
+
staleFloor = staleDepth && staleFloor < depth ? staleFloor : depth;
|
|
681
|
+
staleDepth = checkDepth;
|
|
682
|
+
}
|
|
664
683
|
}
|
|
665
684
|
if (!dirty && link.nextDep !== void 0) {
|
|
666
685
|
link = link.nextDep;
|
|
667
686
|
continue;
|
|
668
687
|
}
|
|
669
688
|
while (checkDepth) {
|
|
689
|
+
const stale = checkDepth === staleDepth;
|
|
690
|
+
if (stale && --staleDepth === staleFloor) staleDepth = 0;
|
|
670
691
|
--checkDepth;
|
|
671
692
|
link = stack.value;
|
|
672
693
|
stack = stack.prev;
|
|
673
694
|
if (dirty) {
|
|
674
|
-
const subs = sub.subs;
|
|
675
695
|
if (sub.update()) {
|
|
676
|
-
|
|
696
|
+
const subs = sub.subs;
|
|
697
|
+
if (subs !== void 0 && (subs !== link || subs.nextSub !== void 0)) shallowPropagate(subs);
|
|
677
698
|
sub = link.sub;
|
|
678
699
|
continue;
|
|
679
700
|
}
|
|
680
|
-
} else sub.flags
|
|
701
|
+
} else if (stale) sub.flags = sub.flags & -545 | 16;
|
|
702
|
+
else sub.flags &= -545;
|
|
681
703
|
sub = link.sub;
|
|
682
704
|
if (link.nextDep !== void 0) {
|
|
683
705
|
link = link.nextDep;
|
|
@@ -685,9 +707,21 @@ function checkDirty(link, sub) {
|
|
|
685
707
|
}
|
|
686
708
|
dirty = false;
|
|
687
709
|
}
|
|
688
|
-
return dirty && !!sub.flags;
|
|
710
|
+
return (dirty || !!(sub.flags & 16)) && !!sub.flags;
|
|
689
711
|
} while (true);
|
|
690
712
|
}
|
|
713
|
+
function checkingDepth(dep, stack, depth) {
|
|
714
|
+
for (; stack !== void 0; stack = stack.prev, --depth) if (stack.value.dep === dep) return depth;
|
|
715
|
+
return -1;
|
|
716
|
+
}
|
|
717
|
+
function markStale(sub) {
|
|
718
|
+
const nodes = [sub];
|
|
719
|
+
do {
|
|
720
|
+
sub = nodes.pop();
|
|
721
|
+
sub.flags = sub.flags & -33 | 16;
|
|
722
|
+
for (let link = sub.deps; link !== void 0; link = link.nextDep) if (link.dep.flags & 32) nodes.push(link.dep);
|
|
723
|
+
} while (nodes.length);
|
|
724
|
+
}
|
|
691
725
|
function shallowPropagate(link) {
|
|
692
726
|
do {
|
|
693
727
|
const sub = link.sub;
|
|
@@ -705,6 +739,19 @@ function isValidLink(checkLink, sub) {
|
|
|
705
739
|
}
|
|
706
740
|
return false;
|
|
707
741
|
}
|
|
742
|
+
function markRecursed(sub) {
|
|
743
|
+
const nodes = [sub];
|
|
744
|
+
do {
|
|
745
|
+
sub = nodes.pop();
|
|
746
|
+
for (let link = sub.deps; link !== void 0; link = link.nextDep) {
|
|
747
|
+
const dep = link.dep;
|
|
748
|
+
if ((dep.flags & 40) === 32) {
|
|
749
|
+
dep.flags |= 8;
|
|
750
|
+
nodes.push(dep);
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
} while (nodes.length);
|
|
754
|
+
}
|
|
708
755
|
//#endregion
|
|
709
756
|
//#region packages/reactivity/src/dep.ts
|
|
710
757
|
var Dep = class {
|
|
@@ -1007,7 +1054,7 @@ function noTracking(self, method, args = []) {
|
|
|
1007
1054
|
//#endregion
|
|
1008
1055
|
//#region packages/reactivity/src/baseHandlers.ts
|
|
1009
1056
|
const isNonTrackableKeys = /*@__PURE__*/ makeMap(`__proto__,__v_isRef,__isVue`);
|
|
1010
|
-
const builtInSymbols = new Set(/*@__PURE__*/ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol));
|
|
1057
|
+
const builtInSymbols = /*@__PURE__*/ new Set(/*@__PURE__*/ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol));
|
|
1011
1058
|
function hasOwnProperty(key) {
|
|
1012
1059
|
if (!isSymbol(key)) key = String(key);
|
|
1013
1060
|
const obj = /* @__PURE__ */ toRaw(this);
|
|
@@ -1796,6 +1843,10 @@ var ReactiveEffect = class {
|
|
|
1796
1843
|
get active() {
|
|
1797
1844
|
return !(this.flags & 1024);
|
|
1798
1845
|
}
|
|
1846
|
+
/** @internal */
|
|
1847
|
+
get running() {
|
|
1848
|
+
return !!(this.flags & 4);
|
|
1849
|
+
}
|
|
1799
1850
|
pause() {
|
|
1800
1851
|
this.flags |= 256;
|
|
1801
1852
|
}
|
|
@@ -1809,11 +1860,9 @@ var ReactiveEffect = class {
|
|
|
1809
1860
|
if (!this.active) return this.fn();
|
|
1810
1861
|
cleanup(this);
|
|
1811
1862
|
const prevSub = startTracking(this);
|
|
1812
|
-
incRunDepth();
|
|
1813
1863
|
try {
|
|
1814
1864
|
return this.fn();
|
|
1815
1865
|
} finally {
|
|
1816
|
-
decRunDepth();
|
|
1817
1866
|
endTracking(this, prevSub);
|
|
1818
1867
|
const flags = this.flags;
|
|
1819
1868
|
if ((flags & 136) === 136) {
|
|
@@ -1836,9 +1885,9 @@ var ReactiveEffect = class {
|
|
|
1836
1885
|
if (flags & 16) return true;
|
|
1837
1886
|
if (flags & 32) {
|
|
1838
1887
|
if (checkDirty(this.deps, this)) {
|
|
1839
|
-
this.
|
|
1888
|
+
if (this.active) this.flags |= 16;
|
|
1840
1889
|
return true;
|
|
1841
|
-
} else this.flags
|
|
1890
|
+
} else this.flags &= -33;
|
|
1842
1891
|
}
|
|
1843
1892
|
return false;
|
|
1844
1893
|
}
|
|
@@ -1849,20 +1898,15 @@ function effect(fn, options) {
|
|
|
1849
1898
|
if (options) {
|
|
1850
1899
|
const { onStop, scheduler } = options;
|
|
1851
1900
|
if (onStop) {
|
|
1852
|
-
options.onStop = void 0;
|
|
1853
1901
|
const stop = e.stop.bind(e);
|
|
1854
1902
|
e.stop = () => {
|
|
1855
1903
|
stop();
|
|
1856
1904
|
onStop();
|
|
1857
1905
|
};
|
|
1858
1906
|
}
|
|
1859
|
-
if (scheduler) {
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
if (!(e.flags & 256)) scheduler();
|
|
1863
|
-
};
|
|
1864
|
-
}
|
|
1865
|
-
extend(e, options);
|
|
1907
|
+
if (scheduler) e.notify = () => {
|
|
1908
|
+
if (!(e.flags & 1280)) scheduler();
|
|
1909
|
+
};
|
|
1866
1910
|
}
|
|
1867
1911
|
try {
|
|
1868
1912
|
e.run();
|
|
@@ -1922,8 +1966,10 @@ var EffectScope = class {
|
|
|
1922
1966
|
const flags = this.flags;
|
|
1923
1967
|
if (flags & 256) {
|
|
1924
1968
|
this.flags = flags & -257;
|
|
1925
|
-
|
|
1926
|
-
|
|
1969
|
+
const deps = [];
|
|
1970
|
+
for (let link = this.deps; link !== void 0; link = link.nextDep) deps.push(link.dep);
|
|
1971
|
+
for (let i = 0; i < deps.length; i++) {
|
|
1972
|
+
const dep = deps[i];
|
|
1927
1973
|
if ("resume" in dep) dep.resume();
|
|
1928
1974
|
}
|
|
1929
1975
|
}
|
|
@@ -1952,8 +1998,10 @@ var EffectScope = class {
|
|
|
1952
1998
|
while (dep !== void 0) {
|
|
1953
1999
|
const node = dep.dep;
|
|
1954
2000
|
if ("stop" in node) {
|
|
1955
|
-
|
|
2001
|
+
const prev = dep.prevDep;
|
|
1956
2002
|
node.stop();
|
|
2003
|
+
const next = prev !== void 0 ? prev.nextDep : this.deps;
|
|
2004
|
+
dep = next === dep ? dep.nextDep : next;
|
|
1957
2005
|
} else dep = unlink(dep, this);
|
|
1958
2006
|
}
|
|
1959
2007
|
cleanup(this);
|
|
@@ -1994,10 +2042,14 @@ function setCurrentScope(scope) {
|
|
|
1994
2042
|
* @see {@link https://vuejs.org/api/reactivity-advanced.html#onscopedispose}
|
|
1995
2043
|
*/
|
|
1996
2044
|
function onScopeDispose(fn, failSilently = false) {
|
|
1997
|
-
if (activeEffectScope !== void 0)
|
|
2045
|
+
if (activeEffectScope !== void 0) {
|
|
2046
|
+
if (activeEffectScope.active) activeEffectScope.cleanups[activeEffectScope.cleanupsLength++] = fn;
|
|
2047
|
+
else fn();
|
|
2048
|
+
}
|
|
1998
2049
|
}
|
|
1999
2050
|
//#endregion
|
|
2000
2051
|
//#region packages/reactivity/src/computed.ts
|
|
2052
|
+
const FAILED = 64;
|
|
2001
2053
|
/**
|
|
2002
2054
|
* @private exported by @vue/reactivity for Vue core use, but not exported from
|
|
2003
2055
|
* the main vue package
|
|
@@ -2046,14 +2098,31 @@ var ComputedRefImpl = class {
|
|
|
2046
2098
|
}
|
|
2047
2099
|
get value() {
|
|
2048
2100
|
const flags = this.flags;
|
|
2049
|
-
|
|
2050
|
-
if (this.
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2101
|
+
try {
|
|
2102
|
+
if (flags & 16 || flags & 32 && checkDirty(this.deps, this)) {
|
|
2103
|
+
if (this.update()) {
|
|
2104
|
+
const subs = this.subs;
|
|
2105
|
+
if (subs !== void 0) shallowPropagate(subs);
|
|
2106
|
+
}
|
|
2107
|
+
} else if (flags & 32) this.flags = flags & -33;
|
|
2108
|
+
} catch (err) {
|
|
2109
|
+
if (activeSub !== void 0) link(this, activeSub);
|
|
2110
|
+
else if (activeEffectScope !== void 0) link(this, activeEffectScope);
|
|
2111
|
+
throw err;
|
|
2112
|
+
}
|
|
2055
2113
|
if (activeSub !== void 0) link(this, activeSub);
|
|
2056
|
-
else if (activeEffectScope !== void 0)
|
|
2114
|
+
else if (activeEffectScope !== void 0) {
|
|
2115
|
+
if (activeEffectScope.active) link(this, activeEffectScope);
|
|
2116
|
+
else if (this.subs === void 0) {
|
|
2117
|
+
let dep = this.deps;
|
|
2118
|
+
if (dep !== void 0) {
|
|
2119
|
+
do
|
|
2120
|
+
dep = unlink(dep, this);
|
|
2121
|
+
while (dep !== void 0);
|
|
2122
|
+
this.flags |= 16;
|
|
2123
|
+
}
|
|
2124
|
+
}
|
|
2125
|
+
}
|
|
2057
2126
|
return this._value;
|
|
2058
2127
|
}
|
|
2059
2128
|
set value(newValue) {
|
|
@@ -2064,11 +2133,15 @@ var ComputedRefImpl = class {
|
|
|
2064
2133
|
try {
|
|
2065
2134
|
const oldValue = this._value;
|
|
2066
2135
|
const newValue = this.fn(oldValue);
|
|
2067
|
-
if (hasChanged(oldValue, newValue)) {
|
|
2136
|
+
if (hasChanged(oldValue, newValue) || this.flags & FAILED) {
|
|
2068
2137
|
this._value = newValue;
|
|
2138
|
+
this.flags &= -65;
|
|
2069
2139
|
return true;
|
|
2070
2140
|
}
|
|
2071
2141
|
return false;
|
|
2142
|
+
} catch (err) {
|
|
2143
|
+
this.flags |= FAILED;
|
|
2144
|
+
throw err;
|
|
2072
2145
|
} finally {
|
|
2073
2146
|
endTracking(this, prevSub);
|
|
2074
2147
|
}
|
|
@@ -2083,7 +2156,9 @@ function computed$1(getterOrOptions, debugOptions, isSSR = false) {
|
|
|
2083
2156
|
getter = getterOrOptions.get;
|
|
2084
2157
|
setter = getterOrOptions.set;
|
|
2085
2158
|
}
|
|
2086
|
-
|
|
2159
|
+
const cRef = new ComputedRefImpl(getter, setter);
|
|
2160
|
+
if (isSSR && activeEffectScope !== void 0) link(cRef, activeEffectScope);
|
|
2161
|
+
return cRef;
|
|
2087
2162
|
}
|
|
2088
2163
|
//#endregion
|
|
2089
2164
|
//#region packages/reactivity/src/constants.ts
|
|
@@ -2347,7 +2422,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
|
|
|
2347
2422
|
if (isFunction(fn)) {
|
|
2348
2423
|
const res = callWithErrorHandling(fn, instance, type, args);
|
|
2349
2424
|
if (res && isPromise(res)) res.catch((err) => {
|
|
2350
|
-
handleError(err, instance, type);
|
|
2425
|
+
handleError(err, instance, type, void 0, true);
|
|
2351
2426
|
});
|
|
2352
2427
|
return res;
|
|
2353
2428
|
}
|
|
@@ -2357,7 +2432,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
|
|
|
2357
2432
|
return values;
|
|
2358
2433
|
}
|
|
2359
2434
|
}
|
|
2360
|
-
function handleError(err, instance, type, throwInDev = true) {
|
|
2435
|
+
function handleError(err, instance, type, throwInDev = true, isAsyncError = false) {
|
|
2361
2436
|
const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ;
|
|
2362
2437
|
if (instance) {
|
|
2363
2438
|
let cur = instance.parent;
|
|
@@ -2365,7 +2440,7 @@ function handleError(err, instance, type, throwInDev = true) {
|
|
|
2365
2440
|
const errorInfo = `https://vuejs.org/error-reference/#runtime-${type}`;
|
|
2366
2441
|
while (cur) {
|
|
2367
2442
|
const errorCapturedHooks = cur.ec;
|
|
2368
|
-
if (errorCapturedHooks) {
|
|
2443
|
+
if (errorCapturedHooks && !cur.isUnmounted && (!isAsyncError || cur.scope.active)) {
|
|
2369
2444
|
for (let i = 0; i < errorCapturedHooks.length; i++) if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) return;
|
|
2370
2445
|
}
|
|
2371
2446
|
cur = cur.parent;
|
|
@@ -2820,11 +2895,28 @@ function withDirectives(vnode, directives) {
|
|
|
2820
2895
|
return vnode;
|
|
2821
2896
|
}
|
|
2822
2897
|
function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
2823
|
-
|
|
2898
|
+
let hookVNode = vnode;
|
|
2899
|
+
if (name === "beforeMount") vnode._mount = vnode;
|
|
2900
|
+
else if (name === "beforeUpdate") {
|
|
2901
|
+
const mount = prevVNode && prevVNode._mount;
|
|
2902
|
+
if (mount) {
|
|
2903
|
+
mount._latest = vnode;
|
|
2904
|
+
vnode._mount = mount;
|
|
2905
|
+
}
|
|
2906
|
+
} else if (name === "mounted") {
|
|
2907
|
+
const latest = vnode._latest;
|
|
2908
|
+
vnode._mount = vnode._latest = void 0;
|
|
2909
|
+
if (latest) {
|
|
2910
|
+
hookVNode = latest;
|
|
2911
|
+
latest._mount = void 0;
|
|
2912
|
+
}
|
|
2913
|
+
}
|
|
2914
|
+
const bindings = hookVNode.dirs;
|
|
2824
2915
|
const oldBindings = prevVNode && prevVNode.dirs;
|
|
2825
2916
|
for (let i = 0; i < bindings.length; i++) {
|
|
2826
|
-
|
|
2917
|
+
let binding = bindings[i];
|
|
2827
2918
|
if (oldBindings) binding.oldValue = oldBindings[i].value;
|
|
2919
|
+
else if (name === "mounted" && binding.oldValue !== void 0) binding = extend({}, binding, { oldValue: void 0 });
|
|
2828
2920
|
let hook = binding.dir[name];
|
|
2829
2921
|
if (!hook) hook = mapCompatDirectiveHook(name, binding.dir, instance);
|
|
2830
2922
|
if (hook) {
|
|
@@ -2832,7 +2924,7 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
|
2832
2924
|
callWithAsyncErrorHandling(hook, instance, 8, [
|
|
2833
2925
|
vnode.el,
|
|
2834
2926
|
binding,
|
|
2835
|
-
|
|
2927
|
+
hookVNode,
|
|
2836
2928
|
prevVNode
|
|
2837
2929
|
]);
|
|
2838
2930
|
setActiveSub(prevSub);
|
|
@@ -3252,7 +3344,15 @@ const BaseTransitionImpl = {
|
|
|
3252
3344
|
const rawProps = /* @__PURE__ */ toRaw(props);
|
|
3253
3345
|
const { mode } = rawProps;
|
|
3254
3346
|
return prepareTransitionSwitch(instance.subTree, child, rawProps, state, instance, mode === "out-in" ? resumeAfterLeave || (resumeAfterLeave = () => {
|
|
3255
|
-
if (!(instance.effect.flags & 1024))
|
|
3347
|
+
if (!(instance.effect.flags & 1024)) {
|
|
3348
|
+
if (instance.effect.running) {
|
|
3349
|
+
const job = () => {
|
|
3350
|
+
if (!(instance.effect.flags & 1024)) instance.update();
|
|
3351
|
+
};
|
|
3352
|
+
job.i = instance;
|
|
3353
|
+
queueJob(job);
|
|
3354
|
+
} else instance.update();
|
|
3355
|
+
}
|
|
3256
3356
|
}) : NOOP);
|
|
3257
3357
|
};
|
|
3258
3358
|
}
|
|
@@ -3278,7 +3378,7 @@ function getLeavingNodesForType(state, vnode) {
|
|
|
3278
3378
|
}
|
|
3279
3379
|
return leavingVNodesCache;
|
|
3280
3380
|
}
|
|
3281
|
-
function resolveTransitionHooks(vnode, props, state, instance
|
|
3381
|
+
function resolveTransitionHooks(vnode, props, state, instance) {
|
|
3282
3382
|
const key = String(vnode.key);
|
|
3283
3383
|
const leavingVNodesCache = getLeavingNodesForType(state, vnode);
|
|
3284
3384
|
const hooks = baseResolveTransitionHooks({
|
|
@@ -3301,9 +3401,7 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
|
3301
3401
|
}
|
|
3302
3402
|
},
|
|
3303
3403
|
cloneHooks: (vnode) => {
|
|
3304
|
-
|
|
3305
|
-
if (postClone) postClone(hooks);
|
|
3306
|
-
return hooks;
|
|
3404
|
+
return resolveTransitionHooks(vnode, props, state, instance);
|
|
3307
3405
|
}
|
|
3308
3406
|
}, props, state, instance);
|
|
3309
3407
|
if (isVaporInteropEnabled && vnode.type === VaporSlot) extend(hooks, {
|
|
@@ -3341,7 +3439,7 @@ function baseResolveTransitionHooks(context, props, state, instance) {
|
|
|
3341
3439
|
callHook(hook, [el]);
|
|
3342
3440
|
},
|
|
3343
3441
|
enter(el) {
|
|
3344
|
-
if (isLeaving()) return;
|
|
3442
|
+
if (isLeaving(el)) return;
|
|
3345
3443
|
let hook = onEnter;
|
|
3346
3444
|
let afterHook = onAfterEnter;
|
|
3347
3445
|
let cancelHook = onEnterCancelled;
|
|
@@ -3385,7 +3483,19 @@ function baseResolveTransitionHooks(context, props, state, instance) {
|
|
|
3385
3483
|
else done();
|
|
3386
3484
|
},
|
|
3387
3485
|
clone(node) {
|
|
3388
|
-
|
|
3486
|
+
if (!cloneHooks) return hooks;
|
|
3487
|
+
const cloned = cloneHooks(node);
|
|
3488
|
+
cloned.afterLeave = () => {
|
|
3489
|
+
if (hooks.afterLeave) hooks.afterLeave();
|
|
3490
|
+
};
|
|
3491
|
+
cloned.delayLeave = (el, earlyRemove, delayedLeave) => {
|
|
3492
|
+
if (hooks.delayLeave) hooks.delayLeave(el, earlyRemove, delayedLeave);
|
|
3493
|
+
else delayedLeave();
|
|
3494
|
+
};
|
|
3495
|
+
cloned.delayedLeave = () => {
|
|
3496
|
+
if (hooks.delayedLeave) hooks.delayedLeave();
|
|
3497
|
+
};
|
|
3498
|
+
return cloned;
|
|
3389
3499
|
}
|
|
3390
3500
|
};
|
|
3391
3501
|
return hooks;
|
|
@@ -3420,10 +3530,7 @@ function prepareTransitionSwitch(previous, next, props, state, instance, resumeA
|
|
|
3420
3530
|
if (state.isLeaving) return emptyPlaceholder(next);
|
|
3421
3531
|
const nextInner = getInnerChild$1(next);
|
|
3422
3532
|
if (!nextInner) return emptyPlaceholder(next);
|
|
3423
|
-
|
|
3424
|
-
if (delayedLeaveSource) forwardDelayedLeave(hooks, delayedLeaveSource);
|
|
3425
|
-
enterHooks = hooks;
|
|
3426
|
-
});
|
|
3533
|
+
const enterHooks = resolveTransitionHooks(nextInner, props, state, instance);
|
|
3427
3534
|
if (delayedLeaveSource) forwardDelayedLeave(enterHooks, delayedLeaveSource);
|
|
3428
3535
|
if (nextInner.type !== Comment) setTransitionHooks(nextInner, enterHooks);
|
|
3429
3536
|
const mode = props.mode;
|
|
@@ -3489,9 +3596,14 @@ function setTransitionHooks(vnode, hooks) {
|
|
|
3489
3596
|
return setTransitionHooks(isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree, hooks);
|
|
3490
3597
|
}
|
|
3491
3598
|
} else if (vnode.shapeFlag & 128) {
|
|
3492
|
-
const
|
|
3493
|
-
|
|
3494
|
-
|
|
3599
|
+
const suspense = vnode.suspense;
|
|
3600
|
+
if (suspense) {
|
|
3601
|
+
const branch = suspense.isHydrating ? suspense.pendingBranch : suspense.activeBranch;
|
|
3602
|
+
if (branch) return setTransitionHooks(branch, hooks.clone(branch));
|
|
3603
|
+
} else {
|
|
3604
|
+
vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
3605
|
+
vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
3606
|
+
}
|
|
3495
3607
|
} else {
|
|
3496
3608
|
vnode.transition = hooks;
|
|
3497
3609
|
if (vnode.type === Fragment && isArray(vnode.children)) {
|
|
@@ -3692,7 +3804,7 @@ const getContainerType = (container) => {
|
|
|
3692
3804
|
};
|
|
3693
3805
|
const isComment = (node) => node.nodeType === 8;
|
|
3694
3806
|
/** The data of a comment opening a range a hydration steps over as one. */
|
|
3695
|
-
const isRangeStart = (data) => data === "[" || data === "(" ||
|
|
3807
|
+
const isRangeStart = (data) => data === "[" || data === "(" || isVaporRangeStart(data);
|
|
3696
3808
|
function createHydrationFunctions(rendererInternals) {
|
|
3697
3809
|
const { mt: mountComponent, p: patch, o: { patchProp, createText, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals;
|
|
3698
3810
|
const hydrate = (vnode, container) => {
|
|
@@ -3709,7 +3821,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
3709
3821
|
};
|
|
3710
3822
|
const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
|
|
3711
3823
|
optimized = optimized || !!vnode.dynamicChildren;
|
|
3712
|
-
const isFragmentStart = isComment(node) && (node.data === "[" || node.data === "(" || isVaporInteropEnabled &&
|
|
3824
|
+
const isFragmentStart = isComment(node) && (node.data === "[" || node.data === "(" || isVaporInteropEnabled && isVaporRangeStart(node.data));
|
|
3713
3825
|
const onMismatch = () => handleMismatch(node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragmentStart);
|
|
3714
3826
|
const { type, ref, shapeFlag, patchFlag } = vnode;
|
|
3715
3827
|
let domType = node.nodeType;
|
|
@@ -3886,10 +3998,11 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
3886
3998
|
const container = parentNode(node);
|
|
3887
3999
|
const first = nextSibling(node);
|
|
3888
4000
|
const next = isVaporInteropEnabled && vnode.vo && node.data === "(" ? getVaporInterface(parentComponent, vnode).hydrateSlotOutlet(vnode, node, parentComponent, parentSuspense, slotScopeIds) : hydrateChildren(first, vnode, container, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
3889
|
-
|
|
4001
|
+
const close = isVaporInteropEnabled ? rangeCloseOf(node.data) : node.data === "(" ? ")" : "]";
|
|
4002
|
+
if (next && isComment(next) && next.data === close) return nextSibling(vnode.anchor = next);
|
|
3890
4003
|
else {
|
|
3891
4004
|
logMismatchError();
|
|
3892
|
-
insert(vnode.anchor = createComment(
|
|
4005
|
+
insert(vnode.anchor = createComment(close), container, next);
|
|
3893
4006
|
return next;
|
|
3894
4007
|
}
|
|
3895
4008
|
};
|
|
@@ -3908,13 +4021,13 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
3908
4021
|
const container = parentNode(node);
|
|
3909
4022
|
remove(node);
|
|
3910
4023
|
patch(null, vnode, container, next, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
|
|
3911
|
-
if (parentComponent && parentComponent.vnode) {
|
|
4024
|
+
if (parentComponent && parentComponent.vnode && parentComponent.vnode.el === node) {
|
|
3912
4025
|
parentComponent.vnode.el = vnode.el;
|
|
3913
4026
|
updateHOCHostEl(parentComponent, vnode.el);
|
|
3914
4027
|
}
|
|
3915
4028
|
return next;
|
|
3916
4029
|
};
|
|
3917
|
-
const locateClosingAnchor = (node, open = node && isComment(node) && node.data === "("
|
|
4030
|
+
const locateClosingAnchor = (node, open = node && isComment(node) && (node.data === "(" || isVaporInteropEnabled && node.data === "{") ? node.data : "[", close = isVaporInteropEnabled ? rangeCloseOf(open) : open === "(" ? ")" : "]") => {
|
|
3918
4031
|
let match = 0;
|
|
3919
4032
|
while (node) {
|
|
3920
4033
|
node = nextSibling(node);
|
|
@@ -4064,7 +4177,7 @@ const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => {
|
|
|
4064
4177
|
function forEachElement(node, cb) {
|
|
4065
4178
|
if (isComment(node) && isRangeStart(node.data)) {
|
|
4066
4179
|
const open = node.data;
|
|
4067
|
-
const close = open
|
|
4180
|
+
const close = rangeCloseOf(open);
|
|
4068
4181
|
let depth = 1;
|
|
4069
4182
|
let next = node.nextSibling;
|
|
4070
4183
|
while (next) {
|
|
@@ -4101,7 +4214,7 @@ function defineAsyncComponent(source) {
|
|
|
4101
4214
|
if (resolvedComp) return () => createInnerComp(resolvedComp, instance);
|
|
4102
4215
|
const onError = (err) => {
|
|
4103
4216
|
setPendingRequest(null);
|
|
4104
|
-
handleError(err, instance, 13, !errorComponent);
|
|
4217
|
+
handleError(err, instance, 13, !errorComponent, true);
|
|
4105
4218
|
};
|
|
4106
4219
|
if (suspensible && instance.suspense || isInSSRComponentSetup) return load().then((comp) => {
|
|
4107
4220
|
return () => createInnerComp(comp, instance);
|
|
@@ -4180,10 +4293,12 @@ const useAsyncComponentState = (delay = 200, timeout, onError, instance = curren
|
|
|
4180
4293
|
const delayed = /* @__PURE__ */ ref(!!delay);
|
|
4181
4294
|
let timeoutTimer;
|
|
4182
4295
|
let delayTimer;
|
|
4183
|
-
if (instance)
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4296
|
+
if (instance) instance.scope.run(() => {
|
|
4297
|
+
onScopeDispose(() => {
|
|
4298
|
+
if (timeoutTimer != null) clearTimeout(timeoutTimer);
|
|
4299
|
+
if (delayTimer != null) clearTimeout(delayTimer);
|
|
4300
|
+
});
|
|
4301
|
+
});
|
|
4187
4302
|
if (delay) delayTimer = setTimeout(() => {
|
|
4188
4303
|
if (instance && instance.isUnmounted) return;
|
|
4189
4304
|
delayed.value = false;
|
|
@@ -4212,7 +4327,12 @@ function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydra
|
|
|
4212
4327
|
if (skipIfUpdated) (instance.bu || (instance.bu = [])).push(() => patched = true);
|
|
4213
4328
|
const performHydrate = () => {
|
|
4214
4329
|
if (patched) return;
|
|
4215
|
-
if (!el.parentNode
|
|
4330
|
+
if (!el.parentNode) return;
|
|
4331
|
+
if (wasConnected && !el.isConnected) {
|
|
4332
|
+
let current = instance;
|
|
4333
|
+
while (current && !current.isDeactivated) current = current.parent;
|
|
4334
|
+
if (!current) return;
|
|
4335
|
+
}
|
|
4216
4336
|
hydrate();
|
|
4217
4337
|
};
|
|
4218
4338
|
const doHydrate = hydrateStrategy ? () => {
|
|
@@ -4269,7 +4389,11 @@ const KeepAliveImpl = {
|
|
|
4269
4389
|
activate(vnode, container, anchor, renderer, keepAliveInstance, parentSuspense, namespace, optimized);
|
|
4270
4390
|
};
|
|
4271
4391
|
sharedContext.deactivate = (vnode) => {
|
|
4272
|
-
|
|
4392
|
+
const cached = sharedContext.getCachedComponent(vnode);
|
|
4393
|
+
if (!cached || cached.component !== vnode.component) return false;
|
|
4394
|
+
if (isVaporInteropEnabled && isVaporComponent(vnode.type)) getVaporInterface(keepAliveInstance, vnode).deactivate(vnode, storageContainer, parentSuspense);
|
|
4395
|
+
else deactivate(vnode, storageContainer, renderer, keepAliveInstance, parentSuspense);
|
|
4396
|
+
return true;
|
|
4273
4397
|
};
|
|
4274
4398
|
function unmount(vnode) {
|
|
4275
4399
|
resetShapeFlag(vnode);
|
|
@@ -4301,11 +4425,15 @@ const KeepAliveImpl = {
|
|
|
4301
4425
|
let pendingCacheKey = null;
|
|
4302
4426
|
const cacheSubtree = () => {
|
|
4303
4427
|
if (pendingCacheKey != null) {
|
|
4304
|
-
if (isSuspense(keepAliveInstance.subTree.type))
|
|
4305
|
-
const
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
|
|
4428
|
+
if (isSuspense(keepAliveInstance.subTree.type)) {
|
|
4429
|
+
const cacheInnerChild = () => {
|
|
4430
|
+
const vnode = getInnerChild(keepAliveInstance.subTree);
|
|
4431
|
+
if (vnode.component) cache.set(pendingCacheKey, vnode);
|
|
4432
|
+
};
|
|
4433
|
+
const suspense = keepAliveInstance.subTree.suspense;
|
|
4434
|
+
if (suspense.pendingBranch) queuePostRenderEffect(cacheInnerChild, void 0, suspense);
|
|
4435
|
+
else cacheInnerChild();
|
|
4436
|
+
} else cache.set(pendingCacheKey, getInnerChild(keepAliveInstance.subTree));
|
|
4309
4437
|
}
|
|
4310
4438
|
};
|
|
4311
4439
|
onMounted(cacheSubtree);
|
|
@@ -4414,9 +4542,8 @@ function registerKeepAliveHook(hook, type, target = getCurrentGenericInstance())
|
|
|
4414
4542
|
}
|
|
4415
4543
|
function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
|
|
4416
4544
|
const injected = injectHook(type, hook, keepAliveRoot, true);
|
|
4417
|
-
|
|
4418
|
-
|
|
4419
|
-
}, target);
|
|
4545
|
+
const removal = injectHook("um", () => remove(keepAliveRoot[type], injected), target);
|
|
4546
|
+
removal.flags = 8;
|
|
4420
4547
|
}
|
|
4421
4548
|
function resetShapeFlag(vnode) {
|
|
4422
4549
|
vnode.shapeFlag &= -257;
|
|
@@ -4847,6 +4974,11 @@ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
|
|
|
4847
4974
|
ret.props = extend({}, ret.props, { key: branchKey });
|
|
4848
4975
|
ret.key = branchKey;
|
|
4849
4976
|
}
|
|
4977
|
+
if (isBlockTreeEnabled <= 0) {
|
|
4978
|
+
if (!ret.vs.props) ret.vs.props = ret.props;
|
|
4979
|
+
ret.props = ret.key != null ? { key: ret.key } : null;
|
|
4980
|
+
ret.vs.attrs = EMPTY_OBJ;
|
|
4981
|
+
}
|
|
4850
4982
|
if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
|
|
4851
4983
|
return ret;
|
|
4852
4984
|
}
|
|
@@ -5636,7 +5768,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
|
|
|
5636
5768
|
if (options.el) return vm.$mount(options.el);
|
|
5637
5769
|
else return vm;
|
|
5638
5770
|
}
|
|
5639
|
-
Vue.version = `2.6.14-compat:3.6.0-rc.
|
|
5771
|
+
Vue.version = `2.6.14-compat:3.6.0-rc.15`;
|
|
5640
5772
|
Vue.config = singletonApp.config;
|
|
5641
5773
|
Vue.use = (plugin, ...options) => {
|
|
5642
5774
|
if (plugin && isFunction(plugin.install)) plugin.install(Vue, ...options);
|
|
@@ -6752,8 +6884,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6752
6884
|
if (vnodeHook = props.onVnodeBeforeMount) invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
6753
6885
|
}
|
|
6754
6886
|
if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
6755
|
-
if (transition)
|
|
6756
|
-
|
|
6887
|
+
if (transition) {
|
|
6888
|
+
if (!needTransition(parentSuspense, transition) && !transition.persisted) el[deferredEnterKey] = true;
|
|
6889
|
+
performTransitionEnter(el, transition, () => hostInsert(el, container, anchor), parentSuspense);
|
|
6890
|
+
} else hostInsert(el, container, anchor);
|
|
6757
6891
|
if ((vnodeHook = props && props.onVnodeMounted) || dirs) queuePostRenderEffect(() => {
|
|
6758
6892
|
try {
|
|
6759
6893
|
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
@@ -6978,16 +7112,20 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6978
7112
|
} else {
|
|
6979
7113
|
let { next, bu, u, parent, vnode } = instance;
|
|
6980
7114
|
{
|
|
6981
|
-
const
|
|
6982
|
-
if (
|
|
7115
|
+
const unresolvedAsyncRoot = locateUnresolvedAsyncRoot(instance);
|
|
7116
|
+
if (unresolvedAsyncRoot) {
|
|
6983
7117
|
if (next) {
|
|
6984
7118
|
next.el = vnode.el;
|
|
6985
7119
|
updateComponentPreRender(instance, next, optimized);
|
|
6986
7120
|
}
|
|
6987
|
-
|
|
6988
|
-
|
|
6989
|
-
if (
|
|
6990
|
-
|
|
7121
|
+
unresolvedAsyncRoot.asyncDep.then(() => {
|
|
7122
|
+
const retry = () => {
|
|
7123
|
+
if (instance.effect.flags & 1024) return;
|
|
7124
|
+
if (parentSuspense && parentSuspense.pendingBranch) queuePostRenderEffect(retry, void 0, parentSuspense);
|
|
7125
|
+
else instance.update();
|
|
7126
|
+
};
|
|
7127
|
+
retry.flags = 24;
|
|
7128
|
+
queuePostRenderEffect(retry, void 0, parentSuspense);
|
|
6991
7129
|
});
|
|
6992
7130
|
return;
|
|
6993
7131
|
}
|
|
@@ -7007,7 +7145,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7007
7145
|
const nextTree = renderComponentRoot(instance);
|
|
7008
7146
|
const prevTree = instance.subTree;
|
|
7009
7147
|
instance.subTree = nextTree;
|
|
7010
|
-
patch(prevTree, nextTree, hostParentNode(prevTree.el), getNextHostNode(prevTree), instance, parentSuspense, namespace);
|
|
7148
|
+
patch(prevTree, nextTree, hostParentNode(prevTree.el || resolveAsyncComponentPlaceholder(prevTree)), getNextHostNode(prevTree), instance, parentSuspense, namespace);
|
|
7011
7149
|
next.el = nextTree.el;
|
|
7012
7150
|
if (originNext === null) updateHOCHostEl(instance, nextTree.el);
|
|
7013
7151
|
if (u) queuePostRenderEffect(u, void 0, parentSuspense);
|
|
@@ -7205,9 +7343,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7205
7343
|
}
|
|
7206
7344
|
if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) parentComponent.renderCache[cacheIndex] = void 0;
|
|
7207
7345
|
if (shapeFlag & 256) {
|
|
7208
|
-
if (
|
|
7209
|
-
else parentComponent.ctx.deactivate(vnode);
|
|
7210
|
-
return;
|
|
7346
|
+
if (parentComponent.ctx.deactivate(vnode)) return;
|
|
7211
7347
|
}
|
|
7212
7348
|
if (isVaporInteropEnabled && shapeFlag & 6 && isVaporComponent(type)) {
|
|
7213
7349
|
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
|
|
@@ -7287,13 +7423,15 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7287
7423
|
if (effect) {
|
|
7288
7424
|
effect.stop();
|
|
7289
7425
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
7290
|
-
} else if (
|
|
7426
|
+
} else if (subTree) {
|
|
7291
7427
|
subTree.transition = instance.vnode.transition;
|
|
7292
7428
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
7293
7429
|
}
|
|
7294
7430
|
if (um) queuePostRenderEffect(um, void 0, parentSuspense);
|
|
7295
7431
|
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS", instance)) queuePostRenderEffect(() => instance.emit("hook:destroyed"), void 0, parentSuspense);
|
|
7296
|
-
|
|
7432
|
+
const markUnmounted = () => instance.isUnmounted = true;
|
|
7433
|
+
markUnmounted.flags = 8;
|
|
7434
|
+
queuePostRenderEffect(markUnmounted, void 0, parentSuspense);
|
|
7297
7435
|
};
|
|
7298
7436
|
const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {
|
|
7299
7437
|
for (let i = start; i < children.length; i++) unmount(children[i], parentComponent, parentSuspense, doRemove, optimized);
|
|
@@ -7400,11 +7538,11 @@ function traverseStaticChildren(n1, n2, shallow = false) {
|
|
|
7400
7538
|
if (c2.type === Comment && !c2.el) c2.el = c1.el;
|
|
7401
7539
|
}
|
|
7402
7540
|
}
|
|
7403
|
-
function
|
|
7541
|
+
function locateUnresolvedAsyncRoot(instance) {
|
|
7404
7542
|
const subComponent = instance.subTree && instance.subTree.component;
|
|
7405
7543
|
if (subComponent) {
|
|
7406
7544
|
if (subComponent.asyncDep && !subComponent.asyncResolved) return subComponent;
|
|
7407
|
-
else return
|
|
7545
|
+
else return locateUnresolvedAsyncRoot(subComponent);
|
|
7408
7546
|
}
|
|
7409
7547
|
}
|
|
7410
7548
|
function invalidateMount(hooks) {
|
|
@@ -7470,7 +7608,9 @@ function getInheritedScopeIds(vnode, parentComponent, includeVaporRootIds = true
|
|
|
7470
7608
|
function resolveAsyncComponentPlaceholder(anchorVnode) {
|
|
7471
7609
|
if (anchorVnode.placeholder) return anchorVnode.placeholder;
|
|
7472
7610
|
const instance = anchorVnode.component;
|
|
7473
|
-
if (instance) return resolveAsyncComponentPlaceholder(instance.subTree);
|
|
7611
|
+
if (instance && instance.subTree) return resolveAsyncComponentPlaceholder(instance.subTree);
|
|
7612
|
+
const suspense = anchorVnode.suspense;
|
|
7613
|
+
if (suspense && suspense.activeBranch) return resolveAsyncComponentPlaceholder(suspense.activeBranch);
|
|
7474
7614
|
return null;
|
|
7475
7615
|
}
|
|
7476
7616
|
//#endregion
|
|
@@ -7482,17 +7622,22 @@ function withSuspenseEnabled(value) {
|
|
|
7482
7622
|
return value;
|
|
7483
7623
|
}
|
|
7484
7624
|
let suspenseId = 0;
|
|
7625
|
+
const deferredEnterKey = Symbol("_deferredEnter");
|
|
7485
7626
|
const Suspense = /*@__PURE__*/ withSuspenseEnabled({
|
|
7486
7627
|
name: "Suspense",
|
|
7487
7628
|
__isSuspense: true,
|
|
7488
7629
|
process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
|
|
7489
7630
|
if (n1 == null) mountSuspense(n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals);
|
|
7490
7631
|
else {
|
|
7491
|
-
|
|
7492
|
-
|
|
7493
|
-
|
|
7494
|
-
n2.
|
|
7495
|
-
|
|
7632
|
+
const suspense = n1.suspense;
|
|
7633
|
+
if (parentSuspense && parentSuspense.deps > 0 && !parentSuspense.isHydrating) {
|
|
7634
|
+
const owner = suspense.parentComponent;
|
|
7635
|
+
if (!!owner && owner.suspense === parentSuspense && owner.suspenseId !== parentSuspense.pendingId ? parentSuspense.pendingBranch && !isSameVNodeType(n2.ssContent, suspense.pendingBranch || suspense.activeBranch) : !suspense.isInFallback) {
|
|
7636
|
+
n2.suspense = suspense;
|
|
7637
|
+
suspense.vnode = n2;
|
|
7638
|
+
n2.el = n1.el;
|
|
7639
|
+
return;
|
|
7640
|
+
}
|
|
7496
7641
|
}
|
|
7497
7642
|
patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, rendererInternals);
|
|
7498
7643
|
}
|
|
@@ -7504,6 +7649,36 @@ function triggerEvent(vnode, name) {
|
|
|
7504
7649
|
const eventListener = vnode.props && vnode.props[name];
|
|
7505
7650
|
if (isFunction(eventListener)) eventListener();
|
|
7506
7651
|
}
|
|
7652
|
+
function enterDeferred(suspense, branch) {
|
|
7653
|
+
const enters = [];
|
|
7654
|
+
collectDeferredEnters(branch, enters, true);
|
|
7655
|
+
if (isVaporInteropEnabled) {
|
|
7656
|
+
const { parentComponent } = suspense;
|
|
7657
|
+
const vapor = parentComponent && parentComponent.appContext.vapor;
|
|
7658
|
+
if (vapor) vapor.enterDeferred(suspense, enters);
|
|
7659
|
+
}
|
|
7660
|
+
if (enters.length) queuePostFlushCb(enters);
|
|
7661
|
+
}
|
|
7662
|
+
function collectDeferredEnters(vnode, enters, isRoot) {
|
|
7663
|
+
const { el, transition, children, shapeFlag } = vnode;
|
|
7664
|
+
if (shapeFlag & 6) {
|
|
7665
|
+
const subTree = vnode.component.subTree;
|
|
7666
|
+
if (subTree) collectDeferredEnters(subTree, enters, isRoot);
|
|
7667
|
+
return;
|
|
7668
|
+
}
|
|
7669
|
+
if (shapeFlag & 192) return;
|
|
7670
|
+
if (shapeFlag & 1) {
|
|
7671
|
+
if (!isRoot && el && el[deferredEnterKey]) {
|
|
7672
|
+
el[deferredEnterKey] = void 0;
|
|
7673
|
+
if (transition && !transition.persisted) {
|
|
7674
|
+
transition.beforeEnter(el);
|
|
7675
|
+
enters.push(() => transition.enter(el));
|
|
7676
|
+
}
|
|
7677
|
+
}
|
|
7678
|
+
isRoot = false;
|
|
7679
|
+
}
|
|
7680
|
+
if (shapeFlag & 16) for (let i = 0; i < children.length; i++) collectDeferredEnters(children[i], enters, isRoot);
|
|
7681
|
+
}
|
|
7507
7682
|
function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
|
|
7508
7683
|
const { p: patch, o: { createElement } } = rendererInternals;
|
|
7509
7684
|
const hiddenContainer = createElement("div");
|
|
@@ -7543,11 +7718,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
7543
7718
|
suspense.activeBranch = pendingBranch;
|
|
7544
7719
|
} else unmount(pendingBranch, parentComponent, suspense);
|
|
7545
7720
|
suspense.deps = 0;
|
|
7546
|
-
|
|
7547
|
-
const effect = suspense.effects[i];
|
|
7548
|
-
if (effect.flags & 8) queuePostFlushCb(effect);
|
|
7549
|
-
}
|
|
7550
|
-
suspense.effects.length = 0;
|
|
7721
|
+
discardEffects(suspense);
|
|
7551
7722
|
suspense.hiddenContainer = createElement("div");
|
|
7552
7723
|
if (isInFallback) {
|
|
7553
7724
|
patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
|
|
@@ -7570,14 +7741,14 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
7570
7741
|
} else {
|
|
7571
7742
|
triggerEvent(n2, "onPending");
|
|
7572
7743
|
suspense.pendingBranch = newBranch;
|
|
7573
|
-
|
|
7574
|
-
else suspense.pendingId = suspenseId++;
|
|
7744
|
+
suspense.pendingId = suspenseId++;
|
|
7575
7745
|
patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
|
|
7576
7746
|
if (suspense.deps <= 0) suspense.resolve();
|
|
7577
7747
|
else {
|
|
7578
|
-
const { timeout
|
|
7579
|
-
if (timeout > 0) setTimeout(() => {
|
|
7580
|
-
|
|
7748
|
+
const { timeout } = suspense;
|
|
7749
|
+
if (timeout > 0) suspense.timeoutTimer = setTimeout(() => {
|
|
7750
|
+
suspense.timeoutTimer = void 0;
|
|
7751
|
+
suspense.fallback(suspense.vnode.ssFallback);
|
|
7581
7752
|
}, timeout);
|
|
7582
7753
|
else if (timeout === 0) suspense.fallback(newFallback);
|
|
7583
7754
|
}
|
|
@@ -7606,6 +7777,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7606
7777
|
deps: 0,
|
|
7607
7778
|
pendingId: suspenseId++,
|
|
7608
7779
|
timeout: typeof timeout === "number" ? timeout : -1,
|
|
7780
|
+
timeoutTimer: void 0,
|
|
7609
7781
|
activeBranch: null,
|
|
7610
7782
|
isFallbackMountPending: false,
|
|
7611
7783
|
pendingBranch: null,
|
|
@@ -7621,26 +7793,39 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7621
7793
|
delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
|
|
7622
7794
|
let hasUpdatedAnchor = false;
|
|
7623
7795
|
if (delayEnter) activeBranch.transition.afterLeave = () => {
|
|
7624
|
-
if (pendingId === suspense.pendingId) {
|
|
7796
|
+
if (pendingId === suspense.pendingId && !suspense.isUnmounted) {
|
|
7797
|
+
enterDeferred(suspense, pendingBranch);
|
|
7625
7798
|
move(pendingBranch, container, anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor, 0, parentComponent);
|
|
7626
7799
|
queuePostFlushCb(effects);
|
|
7627
7800
|
if (isInFallback && vnode.ssFallback) vnode.ssFallback.el = null;
|
|
7628
7801
|
}
|
|
7629
7802
|
};
|
|
7630
7803
|
if (activeBranch && !suspense.isFallbackMountPending) {
|
|
7631
|
-
if (parentNode(activeBranch.el) === container) {
|
|
7804
|
+
if (parentNode(activeBranch.el || resolveAsyncComponentPlaceholder(activeBranch)) === container) {
|
|
7632
7805
|
anchor = next(activeBranch);
|
|
7633
7806
|
hasUpdatedAnchor = true;
|
|
7634
7807
|
}
|
|
7635
7808
|
unmount(activeBranch, parentComponent, suspense, true);
|
|
7636
7809
|
if (!delayEnter && isInFallback && vnode.ssFallback) queuePostRenderEffect(() => vnode.ssFallback.el = null, void 0, suspense);
|
|
7637
7810
|
}
|
|
7638
|
-
if (!delayEnter)
|
|
7811
|
+
if (!delayEnter) {
|
|
7812
|
+
enterDeferred(suspense, pendingBranch);
|
|
7813
|
+
move(pendingBranch, container, anchor, 0, parentComponent);
|
|
7814
|
+
}
|
|
7639
7815
|
}
|
|
7816
|
+
clearTimeout(suspense.timeoutTimer);
|
|
7817
|
+
suspense.timeoutTimer = void 0;
|
|
7640
7818
|
suspense.isFallbackMountPending = false;
|
|
7641
7819
|
setActiveBranch(suspense, pendingBranch);
|
|
7642
7820
|
suspense.pendingBranch = null;
|
|
7643
7821
|
suspense.isInFallback = false;
|
|
7822
|
+
let kept = 0;
|
|
7823
|
+
for (let i = 0; i < effects.length; i++) {
|
|
7824
|
+
const effect = effects[i];
|
|
7825
|
+
if (effect.flags & 16) queuePostFlushCb(effect);
|
|
7826
|
+
else effects[kept++] = effect;
|
|
7827
|
+
}
|
|
7828
|
+
effects.length = kept;
|
|
7644
7829
|
let parent = suspense.parent;
|
|
7645
7830
|
let hasUnresolvedAncestor = false;
|
|
7646
7831
|
while (parent) {
|
|
@@ -7663,13 +7848,13 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7663
7848
|
triggerEvent(vnode, "onResolve");
|
|
7664
7849
|
},
|
|
7665
7850
|
fallback(fallbackVNode) {
|
|
7666
|
-
if (!suspense.pendingBranch) return;
|
|
7851
|
+
if (suspense.isUnmounted || !suspense.pendingBranch) return;
|
|
7667
7852
|
const { vnode, activeBranch, parentComponent, container, namespace } = suspense;
|
|
7668
7853
|
triggerEvent(vnode, "onFallback");
|
|
7669
7854
|
const anchor = next(activeBranch);
|
|
7670
7855
|
const mountFallback = () => {
|
|
7671
7856
|
suspense.isFallbackMountPending = false;
|
|
7672
|
-
if (!suspense.isInFallback) return;
|
|
7857
|
+
if (suspense.isUnmounted || !suspense.isInFallback) return;
|
|
7673
7858
|
const latestFallback = suspense.vnode.ssFallback;
|
|
7674
7859
|
patch(null, latestFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
|
|
7675
7860
|
setActiveBranch(suspense, latestFallback);
|
|
@@ -7693,24 +7878,52 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7693
7878
|
registerDep(instance, onResolve) {
|
|
7694
7879
|
const isInPendingSuspense = !!suspense.pendingBranch;
|
|
7695
7880
|
if (isInPendingSuspense) suspense.deps++;
|
|
7881
|
+
const render = (setupResult) => {
|
|
7882
|
+
instance.asyncResolved = true;
|
|
7883
|
+
onResolve(setupResult);
|
|
7884
|
+
};
|
|
7696
7885
|
instance.asyncDep.catch((err) => {
|
|
7697
|
-
handleError(err, instance, 0);
|
|
7886
|
+
handleError(err, instance, 0, false, true);
|
|
7887
|
+
return () => null;
|
|
7698
7888
|
}).then((asyncSetupResult) => {
|
|
7699
|
-
if (instance.isUnmounted || suspense.isUnmounted
|
|
7889
|
+
if (instance.isUnmounted || suspense.isUnmounted) return;
|
|
7890
|
+
const isPendingDep = isInPendingSuspense && suspense.pendingId === instance.suspenseId;
|
|
7700
7891
|
setCurrentInstance(null, void 0);
|
|
7701
7892
|
if (!instance.scope.active) {
|
|
7702
|
-
if (
|
|
7893
|
+
if (isPendingDep && --suspense.deps === 0) suspense.resolve();
|
|
7703
7894
|
return;
|
|
7704
7895
|
}
|
|
7705
|
-
|
|
7706
|
-
|
|
7707
|
-
|
|
7896
|
+
if (!isPendingDep && suspense.pendingBranch) {
|
|
7897
|
+
const job = () => {
|
|
7898
|
+
if (instance.isUnmounted || suspense.isUnmounted || !instance.scope.active) return;
|
|
7899
|
+
if (suspense.pendingBranch) queueEffectWithSuspense(job, void 0, suspense);
|
|
7900
|
+
else render(asyncSetupResult);
|
|
7901
|
+
};
|
|
7902
|
+
job.flags = 24;
|
|
7903
|
+
queueEffectWithSuspense(job, void 0, suspense);
|
|
7904
|
+
return;
|
|
7905
|
+
}
|
|
7906
|
+
render(asyncSetupResult);
|
|
7907
|
+
if (isPendingDep && --suspense.deps === 0) suspense.resolve();
|
|
7708
7908
|
});
|
|
7709
7909
|
},
|
|
7710
7910
|
unmount(parentSuspense, doRemove) {
|
|
7711
7911
|
suspense.isUnmounted = true;
|
|
7912
|
+
clearTimeout(suspense.timeoutTimer);
|
|
7913
|
+
suspense.timeoutTimer = void 0;
|
|
7914
|
+
if (parentSuspenseId !== void 0) {
|
|
7915
|
+
const parent = suspense.parent;
|
|
7916
|
+
const pendingId = parentSuspenseId;
|
|
7917
|
+
parentSuspenseId = void 0;
|
|
7918
|
+
queuePostFlushCb(() => {
|
|
7919
|
+
if (parent.pendingId === pendingId && !parent.isUnmounted && --parent.deps === 0) parent.resolve();
|
|
7920
|
+
});
|
|
7921
|
+
}
|
|
7712
7922
|
if (suspense.activeBranch) unmount(suspense.activeBranch, parentComponent, parentSuspense, doRemove);
|
|
7713
|
-
if (suspense.pendingBranch)
|
|
7923
|
+
if (suspense.pendingBranch) {
|
|
7924
|
+
unmount(suspense.pendingBranch, parentComponent, suspense, doRemove);
|
|
7925
|
+
discardEffects(suspense);
|
|
7926
|
+
}
|
|
7714
7927
|
}
|
|
7715
7928
|
};
|
|
7716
7929
|
return suspense;
|
|
@@ -7747,6 +7960,14 @@ function normalizeSuspenseSlot(s) {
|
|
|
7747
7960
|
if (block && !s.dynamicChildren) s.dynamicChildren = block.filter((c) => c !== s);
|
|
7748
7961
|
return s;
|
|
7749
7962
|
}
|
|
7963
|
+
function discardEffects(suspense) {
|
|
7964
|
+
const { effects } = suspense;
|
|
7965
|
+
for (let i = 0; i < effects.length; i++) {
|
|
7966
|
+
const effect = effects[i];
|
|
7967
|
+
if (effect.flags & 8) queuePostFlushCb(effect);
|
|
7968
|
+
}
|
|
7969
|
+
effects.length = 0;
|
|
7970
|
+
}
|
|
7750
7971
|
function queueEffectWithSuspense(fn, id, suspense) {
|
|
7751
7972
|
if (suspense && suspense.pendingBranch) {
|
|
7752
7973
|
if (isArray(fn)) suspense.effects.push(...fn);
|
|
@@ -7977,7 +8198,8 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
|
|
|
7977
8198
|
}
|
|
7978
8199
|
function guardReactiveProps(props) {
|
|
7979
8200
|
if (!props) return null;
|
|
7980
|
-
|
|
8201
|
+
if (/* @__PURE__ */ isProxy(props)) return extend({}, props);
|
|
8202
|
+
return isInternalObject(props) ? extend({}, props[rawAttrsKey] || props) : props;
|
|
7981
8203
|
}
|
|
7982
8204
|
function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
|
|
7983
8205
|
const { props, ref, patchFlag, children, transition } = vnode;
|
|
@@ -8082,6 +8304,17 @@ function normalizeVNode(child) {
|
|
|
8082
8304
|
function cloneIfMounted(child) {
|
|
8083
8305
|
return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child);
|
|
8084
8306
|
}
|
|
8307
|
+
let deferElementSlots = false;
|
|
8308
|
+
/**
|
|
8309
|
+
* While enabled, compiled default slots passed as children of plain elements
|
|
8310
|
+
* are kept on the vnode so the server renderer can render them in push mode.
|
|
8311
|
+
* @internal
|
|
8312
|
+
*/
|
|
8313
|
+
function setDeferElementSlots(value) {
|
|
8314
|
+
const prev = deferElementSlots;
|
|
8315
|
+
deferElementSlots = value;
|
|
8316
|
+
return prev;
|
|
8317
|
+
}
|
|
8085
8318
|
function normalizeChildren(vnode, children) {
|
|
8086
8319
|
let type = 0;
|
|
8087
8320
|
const { shapeFlag } = vnode;
|
|
@@ -8090,6 +8323,11 @@ function normalizeChildren(vnode, children) {
|
|
|
8090
8323
|
else if (typeof children === "object") {
|
|
8091
8324
|
if (shapeFlag & 65) {
|
|
8092
8325
|
const slot = children.default;
|
|
8326
|
+
if (deferElementSlots && slot && slot._c && shapeFlag & 1) {
|
|
8327
|
+
vnode.children = children;
|
|
8328
|
+
vnode.shapeFlag |= 32;
|
|
8329
|
+
return;
|
|
8330
|
+
}
|
|
8093
8331
|
if (slot) {
|
|
8094
8332
|
slot._c && (slot._d = false);
|
|
8095
8333
|
normalizeChildren(vnode, slot());
|
|
@@ -8341,7 +8579,8 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
8341
8579
|
setInSSRSetupState(false);
|
|
8342
8580
|
}
|
|
8343
8581
|
}).catch((e) => {
|
|
8344
|
-
handleError(e, instance, 0);
|
|
8582
|
+
handleError(e, instance, 0, void 0, true);
|
|
8583
|
+
instance.ssrRender = (_, push) => push("<!---->");
|
|
8345
8584
|
});
|
|
8346
8585
|
else instance.asyncDep = setupResult;
|
|
8347
8586
|
} else handleSetupResult(instance, setupResult, isSSR);
|
|
@@ -8399,9 +8638,14 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
8399
8638
|
}
|
|
8400
8639
|
}
|
|
8401
8640
|
}
|
|
8641
|
+
/**
|
|
8642
|
+
* Read through the setup context `attrs` proxy to get the raw attrs object.
|
|
8643
|
+
* @internal
|
|
8644
|
+
*/
|
|
8645
|
+
const rawAttrsKey = Symbol();
|
|
8402
8646
|
const attrsProxyHandlers = { get(target, key) {
|
|
8403
8647
|
track(target, "get", "");
|
|
8404
|
-
return target[key];
|
|
8648
|
+
return key === rawAttrsKey ? target : target[key];
|
|
8405
8649
|
} };
|
|
8406
8650
|
function createSetupContext(instance) {
|
|
8407
8651
|
return {
|
|
@@ -8485,7 +8729,7 @@ function isMemoSame(cached, memo) {
|
|
|
8485
8729
|
}
|
|
8486
8730
|
//#endregion
|
|
8487
8731
|
//#region packages/runtime-core/src/index.ts
|
|
8488
|
-
const version = "3.6.0-rc.
|
|
8732
|
+
const version = "3.6.0-rc.15";
|
|
8489
8733
|
const warn = NOOP;
|
|
8490
8734
|
/**
|
|
8491
8735
|
* Runtime error messages. Only exposed in dev or esm builds.
|
|
@@ -8510,7 +8754,8 @@ const ssrUtils = {
|
|
|
8510
8754
|
popWarningContext,
|
|
8511
8755
|
VaporSlot,
|
|
8512
8756
|
rawVaporSlotKey,
|
|
8513
|
-
invokeSlotFallback
|
|
8757
|
+
invokeSlotFallback,
|
|
8758
|
+
setDeferElementSlots
|
|
8514
8759
|
};
|
|
8515
8760
|
/**
|
|
8516
8761
|
* @internal only exposed in compat builds
|
|
@@ -9853,15 +10098,15 @@ const vModelSelect = {
|
|
|
9853
10098
|
vModelSelectInit(el, value, number);
|
|
9854
10099
|
el[assignKey] = getModelAssigner(vnode);
|
|
9855
10100
|
},
|
|
9856
|
-
mounted(el, { value }) {
|
|
9857
|
-
vModelSetSelected(el, value);
|
|
10101
|
+
mounted(el, { value, modifiers: { number } }) {
|
|
10102
|
+
vModelSetSelected(el, value, number);
|
|
9858
10103
|
},
|
|
9859
10104
|
beforeUpdate(el, { value }, vnode) {
|
|
9860
10105
|
el._modelValue = value;
|
|
9861
10106
|
el[assignKey] = getModelAssigner(vnode);
|
|
9862
10107
|
},
|
|
9863
|
-
updated(el, { value }) {
|
|
9864
|
-
vModelSetSelected(el, value);
|
|
10108
|
+
updated(el, { value, modifiers: { number } }) {
|
|
10109
|
+
vModelSetSelected(el, value, number);
|
|
9865
10110
|
}
|
|
9866
10111
|
};
|
|
9867
10112
|
/**
|
|
@@ -9896,14 +10141,14 @@ function isSameSelectValue(value, assignedValue, multiple) {
|
|
|
9896
10141
|
/**
|
|
9897
10142
|
* @internal
|
|
9898
10143
|
*/
|
|
9899
|
-
const vModelSetSelected = (el, value) => {
|
|
10144
|
+
const vModelSetSelected = (el, value, number = false) => {
|
|
9900
10145
|
el._modelValue = value;
|
|
9901
10146
|
const pending = el._pendingValue;
|
|
9902
10147
|
el._pendingValue = void 0;
|
|
9903
10148
|
if (pending && pending[0] === el.multiple && isSameSelectValue(value, pending[1], pending[0])) return;
|
|
9904
|
-
setSelected(el, value);
|
|
10149
|
+
setSelected(el, value, number);
|
|
9905
10150
|
};
|
|
9906
|
-
function setSelected(el, value) {
|
|
10151
|
+
function setSelected(el, value, number) {
|
|
9907
10152
|
const isMultiple = el.multiple;
|
|
9908
10153
|
const isArrayValue = isArray(value);
|
|
9909
10154
|
if (isMultiple && !isArrayValue && !isSet(value)) return;
|
|
@@ -9915,7 +10160,7 @@ function setSelected(el, value) {
|
|
|
9915
10160
|
const optionType = typeof optionValue;
|
|
9916
10161
|
if (optionType === "string" || optionType === "number") option.selected = value.some((v) => String(v) === String(optionValue));
|
|
9917
10162
|
else option.selected = looseIndexOf(value, optionValue) > -1;
|
|
9918
|
-
} else option.selected = value.has(optionValue);
|
|
10163
|
+
} else option.selected = value.has(optionValue) || number && typeof optionValue === "string" && value.has(looseToNumber(optionValue));
|
|
9919
10164
|
} else if (looseEqual(getValue(option), value)) {
|
|
9920
10165
|
if (el.selectedIndex !== i) el.selectedIndex = i;
|
|
9921
10166
|
return;
|
|
@@ -12770,7 +13015,11 @@ function getLoc(start, end) {
|
|
|
12770
13015
|
};
|
|
12771
13016
|
}
|
|
12772
13017
|
function cloneLoc(loc) {
|
|
12773
|
-
return
|
|
13018
|
+
return {
|
|
13019
|
+
start: extend({}, loc.start),
|
|
13020
|
+
end: extend({}, loc.end),
|
|
13021
|
+
source: loc.source
|
|
13022
|
+
};
|
|
12774
13023
|
}
|
|
12775
13024
|
function setLocEnd(loc, end) {
|
|
12776
13025
|
loc.end = tokenizer.getPos(end);
|
|
@@ -15542,7 +15791,7 @@ const stringifyStatic = (children, context, parent) => {
|
|
|
15542
15791
|
for (; i < children.length; i++) {
|
|
15543
15792
|
const child = children[i];
|
|
15544
15793
|
if (isParentCached || getCachedNode(child)) {
|
|
15545
|
-
const result = analyzeNode(child);
|
|
15794
|
+
const result = analyzeNode(child, context);
|
|
15546
15795
|
if (result) {
|
|
15547
15796
|
nc += result[0];
|
|
15548
15797
|
ec += result[1];
|
|
@@ -15572,7 +15821,7 @@ const isNonStringifiable = /*@__PURE__*/ makeMap(`caption,thead,tr,th,tbody,td,t
|
|
|
15572
15821
|
* - nc is the number of nodes inside
|
|
15573
15822
|
* - ec is the number of element with bindings inside
|
|
15574
15823
|
*/
|
|
15575
|
-
function analyzeNode(node) {
|
|
15824
|
+
function analyzeNode(node, context) {
|
|
15576
15825
|
if (node.type === 1 && isNonStringifiable(node.tag)) return false;
|
|
15577
15826
|
if (node.type === 1 && findDir(node, "once", true)) return false;
|
|
15578
15827
|
if (node.type === 12) return [1, 0];
|
|
@@ -15591,6 +15840,7 @@ function analyzeNode(node) {
|
|
|
15591
15840
|
if (p.type === 7 && p.name === "bind") {
|
|
15592
15841
|
if (p.arg && (p.arg.type === 8 || p.arg.isStatic && !isStringifiableAttr(p.arg.content, node.ns))) return bail();
|
|
15593
15842
|
if (p.exp && (p.exp.type === 8 || p.exp.constType < 3)) return bail();
|
|
15843
|
+
if (p.arg && p.arg.isStatic && (isBooleanAttr(p.arg.content) || p.arg.content === "hidden") && context.isCustomElement(node.tag)) return bail();
|
|
15594
15844
|
if (isOptionTag && isStaticArgOf(p.arg, "value") && p.exp && !p.exp.isStatic) return bail();
|
|
15595
15845
|
}
|
|
15596
15846
|
}
|
|
@@ -15635,11 +15885,10 @@ function stringifyElement(node, context) {
|
|
|
15635
15885
|
res += ` ${p.arg.content}="__VUE_EXP_START__${exp.content}__VUE_EXP_END__"`;
|
|
15636
15886
|
continue;
|
|
15637
15887
|
}
|
|
15638
|
-
if ((isBooleanAttr(p.arg.content) || p.arg.content === "hidden") && exp.content === "false") continue;
|
|
15639
15888
|
let evaluated = evaluateConstant(exp);
|
|
15640
15889
|
if (evaluated != null) {
|
|
15641
|
-
const arg = p.arg
|
|
15642
|
-
if (arg
|
|
15890
|
+
const arg = p.arg.content;
|
|
15891
|
+
if ((isBooleanAttr(arg) || arg === "hidden") && !includeBooleanAttr(evaluated)) continue;
|
|
15643
15892
|
if (arg === "class") evaluated = normalizeClass(evaluated);
|
|
15644
15893
|
else if (arg === "style") evaluated = stringifyStyle(normalizeStyle(evaluated));
|
|
15645
15894
|
res += ` ${p.arg.content}="${escapeHtml(evaluated)}"`;
|