@vue/runtime-dom 3.6.0-rc.13 → 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/dist/runtime-dom.cjs.js +10 -10
- package/dist/runtime-dom.cjs.prod.js +9 -9
- package/dist/runtime-dom.d.ts +1 -0
- package/dist/runtime-dom.esm-browser.js +524 -227
- package/dist/runtime-dom.esm-browser.prod.js +4 -4
- package/dist/runtime-dom.esm-bundler.js +10 -10
- package/dist/runtime-dom.global.js +524 -227
- package/dist/runtime-dom.global.prod.js +4 -4
- package/package.json +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-dom v3.6.0-rc.
|
|
2
|
+
* @vue/runtime-dom v3.6.0-rc.15
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -58,10 +58,18 @@ const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" &
|
|
|
58
58
|
const isReservedProp = /*@__PURE__*/ makeMap(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");
|
|
59
59
|
const isBuiltInTag = /*#__PURE__*/ makeMap("slot,component");
|
|
60
60
|
const isBuiltInDirective = /*@__PURE__*/ makeMap("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo");
|
|
61
|
+
const STRING_CACHE_MAX_SIZE = 1e4;
|
|
61
62
|
const cacheStringFunction = (fn) => {
|
|
62
|
-
|
|
63
|
+
let cache = Object.create(null);
|
|
64
|
+
let size = 0;
|
|
63
65
|
return ((str) => {
|
|
64
|
-
|
|
66
|
+
const hit = cache[str];
|
|
67
|
+
if (hit !== void 0) return hit;
|
|
68
|
+
if (++size > STRING_CACHE_MAX_SIZE) {
|
|
69
|
+
cache = Object.create(null);
|
|
70
|
+
size = 1;
|
|
71
|
+
}
|
|
72
|
+
return cache[str] = fn(str);
|
|
65
73
|
});
|
|
66
74
|
};
|
|
67
75
|
const camelizeRE = /-(\w)/g;
|
|
@@ -69,22 +77,22 @@ const camelizeReplacer = (_, c) => c ? c.toUpperCase() : "";
|
|
|
69
77
|
/**
|
|
70
78
|
* @private
|
|
71
79
|
*/
|
|
72
|
-
const camelize = cacheStringFunction((str) => str.replace(camelizeRE, camelizeReplacer));
|
|
80
|
+
const camelize = /*@__PURE__*/ cacheStringFunction((str) => str.replace(camelizeRE, camelizeReplacer));
|
|
73
81
|
const hyphenateRE = /\B([A-Z])/g;
|
|
74
82
|
/**
|
|
75
83
|
* @private
|
|
76
84
|
*/
|
|
77
|
-
const hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
|
|
85
|
+
const hyphenate = /*@__PURE__*/ cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
|
|
78
86
|
/**
|
|
79
87
|
* @private
|
|
80
88
|
*/
|
|
81
|
-
const capitalize = cacheStringFunction((str) => {
|
|
89
|
+
const capitalize = /*@__PURE__*/ cacheStringFunction((str) => {
|
|
82
90
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
83
91
|
});
|
|
84
92
|
/**
|
|
85
93
|
* @private
|
|
86
94
|
*/
|
|
87
|
-
const toHandlerKey = cacheStringFunction((str) => {
|
|
95
|
+
const toHandlerKey = /*@__PURE__*/ cacheStringFunction((str) => {
|
|
88
96
|
return str ? `on${capitalize(str)}` : ``;
|
|
89
97
|
});
|
|
90
98
|
/**
|
|
@@ -210,26 +218,11 @@ const isSVGTag = /*@__PURE__*/ makeMap(SVG_TAGS);
|
|
|
210
218
|
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
211
219
|
*/
|
|
212
220
|
const isMathMLTag = /*@__PURE__*/ makeMap(MATH_TAGS);
|
|
213
|
-
|
|
214
|
-
//#region packages/shared/src/domAttrConfig.ts
|
|
215
|
-
/**
|
|
216
|
-
* On the client we only need to offer special cases for boolean attributes that
|
|
217
|
-
* have different names from their corresponding dom properties:
|
|
218
|
-
* - itemscope -> N/A
|
|
219
|
-
* - allowfullscreen -> allowFullscreen
|
|
220
|
-
* - formnovalidate -> formNoValidate
|
|
221
|
-
* - ismap -> isMap
|
|
222
|
-
* - nomodule -> noModule
|
|
223
|
-
* - novalidate -> noValidate
|
|
224
|
-
* - playsinline -> playsInline
|
|
225
|
-
* - readonly -> readOnly
|
|
226
|
-
*/
|
|
227
|
-
const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;
|
|
228
|
-
const isSpecialBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs);
|
|
221
|
+
const isSpecialBooleanAttr = /*@__PURE__*/ makeMap("itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly");
|
|
229
222
|
/**
|
|
230
223
|
* The full list is needed during SSR to produce the correct initial markup.
|
|
231
224
|
*/
|
|
232
|
-
const isBooleanAttr = /*@__PURE__*/ makeMap(
|
|
225
|
+
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");
|
|
233
226
|
/**
|
|
234
227
|
* Boolean attributes should be included if the value is truthy or ''.
|
|
235
228
|
* e.g. `<select multiple>` compiles to `{ multiple: '' }`
|
|
@@ -426,39 +419,30 @@ function normalizeCssVarValue(value) {
|
|
|
426
419
|
return String(value);
|
|
427
420
|
}
|
|
428
421
|
//#endregion
|
|
429
|
-
//#region packages/
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
422
|
+
//#region packages/shared/src/vaporFlags.ts
|
|
423
|
+
/**
|
|
424
|
+
* The data of the comment a vapor server render opens the branch of a `v-if`
|
|
425
|
+
* chain with, `<!--[1-->`: the digits are the branch's position in the chain,
|
|
426
|
+
* and `<!--]-->` closes it like a fragment.
|
|
427
|
+
*/
|
|
428
|
+
function isVaporBranchStart(data) {
|
|
429
|
+
if (data.length < 2 || data.charCodeAt(0) !== 91) return false;
|
|
430
|
+
for (let i = 1; i < data.length; i++) {
|
|
431
|
+
const c = data.charCodeAt(i);
|
|
432
|
+
if (c < 48 || c > 57) return false;
|
|
438
433
|
}
|
|
434
|
+
return true;
|
|
439
435
|
}
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
if (val && !this._onTrigger) setupFlagsHandler(this);
|
|
447
|
-
this._onTrigger = val;
|
|
448
|
-
}
|
|
449
|
-
});
|
|
436
|
+
/**
|
|
437
|
+
* The data of a comment opening a range only a vapor server render emits:
|
|
438
|
+
* `<!--{-->` around the render of a component, or a v-if branch's.
|
|
439
|
+
*/
|
|
440
|
+
function isVaporRangeStart(data) {
|
|
441
|
+
return data === "{" || isVaporBranchStart(data);
|
|
450
442
|
}
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
get() {
|
|
455
|
-
return target._flags;
|
|
456
|
-
},
|
|
457
|
-
set(value) {
|
|
458
|
-
if (!(target._flags & 48) && !!(value & 48)) onTrigger(this);
|
|
459
|
-
target._flags = value;
|
|
460
|
-
}
|
|
461
|
-
});
|
|
443
|
+
/** The data of the comment closing the range `open` opens. */
|
|
444
|
+
function rangeCloseOf(open) {
|
|
445
|
+
return open === "(" ? ")" : open === "{" ? "}" : "]";
|
|
462
446
|
}
|
|
463
447
|
//#endregion
|
|
464
448
|
//#region packages/reactivity/src/warning.ts
|
|
@@ -470,13 +454,7 @@ function warn$2(msg, ...args) {
|
|
|
470
454
|
const notifyBuffer = [];
|
|
471
455
|
let batchDepth = 0;
|
|
472
456
|
let activeSub = void 0;
|
|
473
|
-
|
|
474
|
-
function incRunDepth() {
|
|
475
|
-
++runDepth;
|
|
476
|
-
}
|
|
477
|
-
function decRunDepth() {
|
|
478
|
-
--runDepth;
|
|
479
|
-
}
|
|
457
|
+
const CHECKING = 512;
|
|
480
458
|
let globalVersion = 0;
|
|
481
459
|
let notifyIndex = 0;
|
|
482
460
|
let notifyBufferLength = 0;
|
|
@@ -525,6 +503,7 @@ function unlink(link, sub = link.sub) {
|
|
|
525
503
|
const nextDep = link.nextDep;
|
|
526
504
|
const nextSub = link.nextSub;
|
|
527
505
|
const prevSub = link.prevSub;
|
|
506
|
+
link.prevDep = link.nextDep = link.prevSub = link.nextSub = void 0;
|
|
528
507
|
if (nextDep !== void 0) nextDep.prevDep = prevDep;
|
|
529
508
|
else sub.depsTail = prevDep;
|
|
530
509
|
if (prevDep !== void 0) prevDep.nextDep = nextDep;
|
|
@@ -532,7 +511,7 @@ function unlink(link, sub = link.sub) {
|
|
|
532
511
|
if (nextSub !== void 0) nextSub.prevSub = prevSub;
|
|
533
512
|
else dep.subsTail = prevSub;
|
|
534
513
|
if (prevSub !== void 0) prevSub.nextSub = nextSub;
|
|
535
|
-
else if ((dep.subs = nextSub) === void 0) {
|
|
514
|
+
else if ((dep.subs = nextSub) === void 0 && dep.flags & 1) {
|
|
536
515
|
let toRemove = dep.deps;
|
|
537
516
|
if (toRemove !== void 0) {
|
|
538
517
|
do
|
|
@@ -550,14 +529,12 @@ function propagate(link) {
|
|
|
550
529
|
const sub = link.sub;
|
|
551
530
|
let flags = sub.flags;
|
|
552
531
|
if (flags & 3) {
|
|
553
|
-
if (!(flags &
|
|
554
|
-
|
|
555
|
-
if (runDepth) sub.flags |= 8;
|
|
556
|
-
} else if (!(flags & 12)) flags = 0;
|
|
532
|
+
if (!(flags & 44)) sub.flags = flags | 32;
|
|
533
|
+
else if (!(flags & 12)) flags = 0;
|
|
557
534
|
else if (!(flags & 4)) sub.flags = flags & -9 | 32;
|
|
558
535
|
else if (!(flags & 48) && isValidLink(link, sub)) {
|
|
559
536
|
sub.flags = flags | 40;
|
|
560
|
-
flags
|
|
537
|
+
flags = sub === activeSub || activeSub === void 0 ? 0 : flags & 1;
|
|
561
538
|
} else flags = 0;
|
|
562
539
|
if (flags & 2) notifyBuffer[notifyBufferLength++] = sub;
|
|
563
540
|
if (flags & 1) {
|
|
@@ -593,7 +570,7 @@ function propagate(link) {
|
|
|
593
570
|
function startTracking(sub) {
|
|
594
571
|
++globalVersion;
|
|
595
572
|
sub.depsTail = void 0;
|
|
596
|
-
sub.flags = sub.flags & -
|
|
573
|
+
sub.flags = sub.flags & -569 | 4;
|
|
597
574
|
return setActiveSub(sub);
|
|
598
575
|
}
|
|
599
576
|
function endTracking(sub, prevSub) {
|
|
@@ -601,8 +578,11 @@ function endTracking(sub, prevSub) {
|
|
|
601
578
|
activeSub = prevSub;
|
|
602
579
|
const depsTail = sub.depsTail;
|
|
603
580
|
let toRemove = depsTail !== void 0 ? depsTail.nextDep : sub.deps;
|
|
604
|
-
while (toRemove !== void 0)
|
|
605
|
-
|
|
581
|
+
while (toRemove !== void 0) {
|
|
582
|
+
unlink(toRemove, sub);
|
|
583
|
+
toRemove = depsTail !== void 0 ? depsTail.nextDep : sub.deps;
|
|
584
|
+
}
|
|
585
|
+
if ((sub.flags &= -5) & 8) markRecursed(sub);
|
|
606
586
|
}
|
|
607
587
|
function flush() {
|
|
608
588
|
let hasError = false;
|
|
@@ -624,45 +604,67 @@ function flush() {
|
|
|
624
604
|
if (hasError) throw error;
|
|
625
605
|
}
|
|
626
606
|
function checkDirty(link, sub) {
|
|
607
|
+
try {
|
|
608
|
+
return walkDirty(link, sub);
|
|
609
|
+
} catch (err) {
|
|
610
|
+
markStale(sub);
|
|
611
|
+
throw err;
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
function walkDirty(link, sub) {
|
|
615
|
+
const root = sub;
|
|
627
616
|
let stack;
|
|
628
617
|
let checkDepth = 0;
|
|
618
|
+
let staleDepth = 0;
|
|
619
|
+
let staleFloor = 0;
|
|
629
620
|
top: do {
|
|
630
621
|
const dep = link.dep;
|
|
631
622
|
const depFlags = dep.flags;
|
|
632
623
|
let dirty = false;
|
|
633
624
|
if (sub.flags & 16) dirty = true;
|
|
634
625
|
else if ((depFlags & 17) === 17) {
|
|
635
|
-
const subs = dep.subs;
|
|
636
626
|
if (dep.update()) {
|
|
637
|
-
|
|
627
|
+
const subs = dep.subs;
|
|
628
|
+
if (subs !== void 0 && (subs !== link || subs.nextSub !== void 0)) shallowPropagate(subs);
|
|
638
629
|
dirty = true;
|
|
639
630
|
}
|
|
640
631
|
} else if ((depFlags & 33) === 33) {
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
632
|
+
const depth = dep === root ? 0 : depFlags & CHECKING ? checkingDepth(dep, stack, checkDepth) : -1;
|
|
633
|
+
if (depth < 0) {
|
|
634
|
+
if (link.nextSub !== void 0 || link.prevSub !== void 0) dep.flags = depFlags | CHECKING;
|
|
635
|
+
stack = {
|
|
636
|
+
value: link,
|
|
637
|
+
prev: stack
|
|
638
|
+
};
|
|
639
|
+
link = dep.deps;
|
|
640
|
+
sub = dep;
|
|
641
|
+
++checkDepth;
|
|
642
|
+
continue;
|
|
643
|
+
}
|
|
644
|
+
if (depth < checkDepth) {
|
|
645
|
+
staleFloor = staleDepth && staleFloor < depth ? staleFloor : depth;
|
|
646
|
+
staleDepth = checkDepth;
|
|
647
|
+
}
|
|
649
648
|
}
|
|
650
649
|
if (!dirty && link.nextDep !== void 0) {
|
|
651
650
|
link = link.nextDep;
|
|
652
651
|
continue;
|
|
653
652
|
}
|
|
654
653
|
while (checkDepth) {
|
|
654
|
+
const stale = checkDepth === staleDepth;
|
|
655
|
+
if (stale && --staleDepth === staleFloor) staleDepth = 0;
|
|
655
656
|
--checkDepth;
|
|
656
657
|
link = stack.value;
|
|
657
658
|
stack = stack.prev;
|
|
658
659
|
if (dirty) {
|
|
659
|
-
const subs = sub.subs;
|
|
660
660
|
if (sub.update()) {
|
|
661
|
-
|
|
661
|
+
const subs = sub.subs;
|
|
662
|
+
if (subs !== void 0 && (subs !== link || subs.nextSub !== void 0)) shallowPropagate(subs);
|
|
662
663
|
sub = link.sub;
|
|
663
664
|
continue;
|
|
664
665
|
}
|
|
665
|
-
} else sub.flags
|
|
666
|
+
} else if (stale) sub.flags = sub.flags & -545 | 16;
|
|
667
|
+
else sub.flags &= -545;
|
|
666
668
|
sub = link.sub;
|
|
667
669
|
if (link.nextDep !== void 0) {
|
|
668
670
|
link = link.nextDep;
|
|
@@ -670,9 +672,21 @@ function checkDirty(link, sub) {
|
|
|
670
672
|
}
|
|
671
673
|
dirty = false;
|
|
672
674
|
}
|
|
673
|
-
return dirty && !!sub.flags;
|
|
675
|
+
return (dirty || !!(sub.flags & 16)) && !!sub.flags;
|
|
674
676
|
} while (true);
|
|
675
677
|
}
|
|
678
|
+
function checkingDepth(dep, stack, depth) {
|
|
679
|
+
for (; stack !== void 0; stack = stack.prev, --depth) if (stack.value.dep === dep) return depth;
|
|
680
|
+
return -1;
|
|
681
|
+
}
|
|
682
|
+
function markStale(sub) {
|
|
683
|
+
const nodes = [sub];
|
|
684
|
+
do {
|
|
685
|
+
sub = nodes.pop();
|
|
686
|
+
sub.flags = sub.flags & -33 | 16;
|
|
687
|
+
for (let link = sub.deps; link !== void 0; link = link.nextDep) if (link.dep.flags & 32) nodes.push(link.dep);
|
|
688
|
+
} while (nodes.length);
|
|
689
|
+
}
|
|
676
690
|
function shallowPropagate(link) {
|
|
677
691
|
do {
|
|
678
692
|
const sub = link.sub;
|
|
@@ -690,6 +704,71 @@ function isValidLink(checkLink, sub) {
|
|
|
690
704
|
}
|
|
691
705
|
return false;
|
|
692
706
|
}
|
|
707
|
+
function markRecursed(sub) {
|
|
708
|
+
const nodes = [sub];
|
|
709
|
+
do {
|
|
710
|
+
sub = nodes.pop();
|
|
711
|
+
for (let link = sub.deps; link !== void 0; link = link.nextDep) {
|
|
712
|
+
const dep = link.dep;
|
|
713
|
+
if ((dep.flags & 40) === 32) {
|
|
714
|
+
dep.flags |= 8;
|
|
715
|
+
nodes.push(dep);
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
} while (nodes.length);
|
|
719
|
+
}
|
|
720
|
+
//#endregion
|
|
721
|
+
//#region packages/reactivity/src/debug.ts
|
|
722
|
+
const triggered = [];
|
|
723
|
+
function onTrack(sub, debugInfo) {
|
|
724
|
+
if (sub.onTrack) sub.onTrack(extend({ effect: sub }, debugInfo));
|
|
725
|
+
}
|
|
726
|
+
function onTrigger(sub, debugInfo) {
|
|
727
|
+
if (sub.onTrigger) sub.onTrigger(extend({ effect: sub }, debugInfo));
|
|
728
|
+
}
|
|
729
|
+
function startTrigger() {
|
|
730
|
+
triggered.push([]);
|
|
731
|
+
}
|
|
732
|
+
function endTrigger(debugInfo) {
|
|
733
|
+
const subs = triggered.pop();
|
|
734
|
+
if (subs.length) {
|
|
735
|
+
startBatch();
|
|
736
|
+
try {
|
|
737
|
+
for (let i = 0; i < subs.length; i++) {
|
|
738
|
+
const sub = subs[i];
|
|
739
|
+
if (sub.flags & 3) onTrigger(sub, debugInfo);
|
|
740
|
+
}
|
|
741
|
+
} finally {
|
|
742
|
+
endBatch();
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
function setupOnTrigger(target) {
|
|
747
|
+
Object.defineProperty(target.prototype, "onTrigger", {
|
|
748
|
+
get() {
|
|
749
|
+
return this._onTrigger;
|
|
750
|
+
},
|
|
751
|
+
set(val) {
|
|
752
|
+
if (val && !this._onTrigger) setupFlagsHandler(this);
|
|
753
|
+
this._onTrigger = val;
|
|
754
|
+
}
|
|
755
|
+
});
|
|
756
|
+
}
|
|
757
|
+
function setupFlagsHandler(target) {
|
|
758
|
+
target._flags = target.flags;
|
|
759
|
+
Object.defineProperty(target, "flags", {
|
|
760
|
+
get() {
|
|
761
|
+
return target._flags;
|
|
762
|
+
},
|
|
763
|
+
set(value) {
|
|
764
|
+
if (!(target._flags & 48) && !!(value & 48)) {
|
|
765
|
+
if (triggered.length) triggered[triggered.length - 1].push(this);
|
|
766
|
+
else onTrigger(this);
|
|
767
|
+
}
|
|
768
|
+
target._flags = value;
|
|
769
|
+
}
|
|
770
|
+
});
|
|
771
|
+
}
|
|
693
772
|
//#endregion
|
|
694
773
|
//#region packages/reactivity/src/dep.ts
|
|
695
774
|
var Dep = class {
|
|
@@ -749,20 +828,12 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
|
749
828
|
if (!depsMap) return;
|
|
750
829
|
const run = (dep) => {
|
|
751
830
|
if (dep !== void 0 && dep.subs !== void 0) {
|
|
752
|
-
triggerEventInfos.push({
|
|
753
|
-
target,
|
|
754
|
-
type,
|
|
755
|
-
key,
|
|
756
|
-
newValue,
|
|
757
|
-
oldValue,
|
|
758
|
-
oldTarget
|
|
759
|
-
});
|
|
760
831
|
propagate(dep.subs);
|
|
761
832
|
shallowPropagate(dep.subs);
|
|
762
|
-
triggerEventInfos.pop();
|
|
763
833
|
}
|
|
764
834
|
};
|
|
765
835
|
startBatch();
|
|
836
|
+
startTrigger();
|
|
766
837
|
if (type === "clear") depsMap.forEach(run);
|
|
767
838
|
else {
|
|
768
839
|
const targetIsArray = isArray(target);
|
|
@@ -792,6 +863,14 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
|
792
863
|
}
|
|
793
864
|
}
|
|
794
865
|
}
|
|
866
|
+
endTrigger({
|
|
867
|
+
target,
|
|
868
|
+
type,
|
|
869
|
+
key,
|
|
870
|
+
newValue,
|
|
871
|
+
oldValue,
|
|
872
|
+
oldTarget
|
|
873
|
+
});
|
|
795
874
|
endBatch();
|
|
796
875
|
}
|
|
797
876
|
function getDepFromReactive(object, key) {
|
|
@@ -1006,7 +1085,7 @@ function noTracking(self, method, args = []) {
|
|
|
1006
1085
|
//#endregion
|
|
1007
1086
|
//#region packages/reactivity/src/baseHandlers.ts
|
|
1008
1087
|
const isNonTrackableKeys = /*@__PURE__*/ makeMap(`__proto__,__v_isRef,__isVue`);
|
|
1009
|
-
const builtInSymbols = new Set(/*@__PURE__*/ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol));
|
|
1088
|
+
const builtInSymbols = /*@__PURE__*/ new Set(/*@__PURE__*/ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol));
|
|
1010
1089
|
function hasOwnProperty(key) {
|
|
1011
1090
|
if (!isSymbol(key)) key = String(key);
|
|
1012
1091
|
const obj = /* @__PURE__ */ toRaw(this);
|
|
@@ -1590,16 +1669,16 @@ var RefImpl = class {
|
|
|
1590
1669
|
this._value = !useDirectValue && this._wrap ? this._wrap(newValue) : newValue;
|
|
1591
1670
|
const subs = this.subs;
|
|
1592
1671
|
if (subs !== void 0) {
|
|
1593
|
-
|
|
1672
|
+
startTrigger();
|
|
1673
|
+
propagate(subs);
|
|
1674
|
+
endTrigger({
|
|
1594
1675
|
target: this,
|
|
1595
1676
|
type: "set",
|
|
1596
1677
|
key: "value",
|
|
1597
1678
|
newValue,
|
|
1598
1679
|
oldValue
|
|
1599
1680
|
});
|
|
1600
|
-
propagate(subs);
|
|
1601
1681
|
if (!batchDepth) flush();
|
|
1602
|
-
triggerEventInfos.pop();
|
|
1603
1682
|
}
|
|
1604
1683
|
}
|
|
1605
1684
|
}
|
|
@@ -1636,8 +1715,10 @@ var RefImpl = class {
|
|
|
1636
1715
|
function triggerRef(ref) {
|
|
1637
1716
|
const dep = ref.dep;
|
|
1638
1717
|
if (dep !== void 0 && dep.subs !== void 0) {
|
|
1718
|
+
startTrigger();
|
|
1639
1719
|
propagate(dep.subs);
|
|
1640
1720
|
shallowPropagate(dep.subs);
|
|
1721
|
+
endTrigger();
|
|
1641
1722
|
if (!batchDepth) flush();
|
|
1642
1723
|
}
|
|
1643
1724
|
}
|
|
@@ -1828,6 +1909,10 @@ var ReactiveEffect = class {
|
|
|
1828
1909
|
get active() {
|
|
1829
1910
|
return !(this.flags & 1024);
|
|
1830
1911
|
}
|
|
1912
|
+
/** @internal */
|
|
1913
|
+
get running() {
|
|
1914
|
+
return !!(this.flags & 4);
|
|
1915
|
+
}
|
|
1831
1916
|
pause() {
|
|
1832
1917
|
this.flags |= 256;
|
|
1833
1918
|
}
|
|
@@ -1841,11 +1926,9 @@ var ReactiveEffect = class {
|
|
|
1841
1926
|
if (!this.active) return this.fn();
|
|
1842
1927
|
cleanup(this);
|
|
1843
1928
|
const prevSub = startTracking(this);
|
|
1844
|
-
incRunDepth();
|
|
1845
1929
|
try {
|
|
1846
1930
|
return this.fn();
|
|
1847
1931
|
} finally {
|
|
1848
|
-
decRunDepth();
|
|
1849
1932
|
endTracking(this, prevSub);
|
|
1850
1933
|
const flags = this.flags;
|
|
1851
1934
|
if ((flags & 136) === 136) {
|
|
@@ -1868,9 +1951,9 @@ var ReactiveEffect = class {
|
|
|
1868
1951
|
if (flags & 16) return true;
|
|
1869
1952
|
if (flags & 32) {
|
|
1870
1953
|
if (checkDirty(this.deps, this)) {
|
|
1871
|
-
this.
|
|
1954
|
+
if (this.active) this.flags |= 16;
|
|
1872
1955
|
return true;
|
|
1873
|
-
} else this.flags
|
|
1956
|
+
} else this.flags &= -33;
|
|
1874
1957
|
}
|
|
1875
1958
|
return false;
|
|
1876
1959
|
}
|
|
@@ -1882,20 +1965,17 @@ function effect(fn, options) {
|
|
|
1882
1965
|
if (options) {
|
|
1883
1966
|
const { onStop, scheduler } = options;
|
|
1884
1967
|
if (onStop) {
|
|
1885
|
-
options.onStop = void 0;
|
|
1886
1968
|
const stop = e.stop.bind(e);
|
|
1887
1969
|
e.stop = () => {
|
|
1888
1970
|
stop();
|
|
1889
1971
|
onStop();
|
|
1890
1972
|
};
|
|
1891
1973
|
}
|
|
1892
|
-
if (scheduler) {
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
}
|
|
1898
|
-
extend(e, options);
|
|
1974
|
+
if (scheduler) e.notify = () => {
|
|
1975
|
+
if (!(e.flags & 1280)) scheduler();
|
|
1976
|
+
};
|
|
1977
|
+
e.onTrack = options.onTrack;
|
|
1978
|
+
e.onTrigger = options.onTrigger;
|
|
1899
1979
|
}
|
|
1900
1980
|
try {
|
|
1901
1981
|
e.run();
|
|
@@ -1955,8 +2035,10 @@ var EffectScope = class {
|
|
|
1955
2035
|
const flags = this.flags;
|
|
1956
2036
|
if (flags & 256) {
|
|
1957
2037
|
this.flags = flags & -257;
|
|
1958
|
-
|
|
1959
|
-
|
|
2038
|
+
const deps = [];
|
|
2039
|
+
for (let link = this.deps; link !== void 0; link = link.nextDep) deps.push(link.dep);
|
|
2040
|
+
for (let i = 0; i < deps.length; i++) {
|
|
2041
|
+
const dep = deps[i];
|
|
1960
2042
|
if ("resume" in dep) dep.resume();
|
|
1961
2043
|
}
|
|
1962
2044
|
}
|
|
@@ -1985,8 +2067,10 @@ var EffectScope = class {
|
|
|
1985
2067
|
while (dep !== void 0) {
|
|
1986
2068
|
const node = dep.dep;
|
|
1987
2069
|
if ("stop" in node) {
|
|
1988
|
-
|
|
2070
|
+
const prev = dep.prevDep;
|
|
1989
2071
|
node.stop();
|
|
2072
|
+
const next = prev !== void 0 ? prev.nextDep : this.deps;
|
|
2073
|
+
dep = next === dep ? dep.nextDep : next;
|
|
1990
2074
|
} else dep = unlink(dep, this);
|
|
1991
2075
|
}
|
|
1992
2076
|
cleanup(this);
|
|
@@ -2027,11 +2111,14 @@ function setCurrentScope(scope) {
|
|
|
2027
2111
|
* @see {@link https://vuejs.org/api/reactivity-advanced.html#onscopedispose}
|
|
2028
2112
|
*/
|
|
2029
2113
|
function onScopeDispose(fn, failSilently = false) {
|
|
2030
|
-
if (activeEffectScope !== void 0)
|
|
2031
|
-
|
|
2114
|
+
if (activeEffectScope !== void 0) {
|
|
2115
|
+
if (activeEffectScope.active) activeEffectScope.cleanups[activeEffectScope.cleanupsLength++] = fn;
|
|
2116
|
+
else fn();
|
|
2117
|
+
} else if (!failSilently) warn$2("onScopeDispose() is called when there is no active effect scope to be associated with.");
|
|
2032
2118
|
}
|
|
2033
2119
|
//#endregion
|
|
2034
2120
|
//#region packages/reactivity/src/computed.ts
|
|
2121
|
+
const FAILED = 64;
|
|
2035
2122
|
/**
|
|
2036
2123
|
* @private exported by @vue/reactivity for Vue core use, but not exported from
|
|
2037
2124
|
* the main vue package
|
|
@@ -2080,12 +2167,24 @@ var ComputedRefImpl = class {
|
|
|
2080
2167
|
}
|
|
2081
2168
|
get value() {
|
|
2082
2169
|
const flags = this.flags;
|
|
2083
|
-
|
|
2084
|
-
if (this.
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2170
|
+
try {
|
|
2171
|
+
if (flags & 16 || flags & 32 && checkDirty(this.deps, this)) {
|
|
2172
|
+
if (this.update()) {
|
|
2173
|
+
const subs = this.subs;
|
|
2174
|
+
if (subs !== void 0) shallowPropagate(subs);
|
|
2175
|
+
}
|
|
2176
|
+
} else if (flags & 32) this.flags = flags & -33;
|
|
2177
|
+
} catch (err) {
|
|
2178
|
+
if (activeSub !== void 0) {
|
|
2179
|
+
onTrack(activeSub, {
|
|
2180
|
+
target: this,
|
|
2181
|
+
type: "get",
|
|
2182
|
+
key: "value"
|
|
2183
|
+
});
|
|
2184
|
+
link(this, activeSub);
|
|
2185
|
+
} else if (activeEffectScope !== void 0) link(this, activeEffectScope);
|
|
2186
|
+
throw err;
|
|
2187
|
+
}
|
|
2089
2188
|
if (activeSub !== void 0) {
|
|
2090
2189
|
onTrack(activeSub, {
|
|
2091
2190
|
target: this,
|
|
@@ -2093,7 +2192,18 @@ var ComputedRefImpl = class {
|
|
|
2093
2192
|
key: "value"
|
|
2094
2193
|
});
|
|
2095
2194
|
link(this, activeSub);
|
|
2096
|
-
} else if (activeEffectScope !== void 0)
|
|
2195
|
+
} else if (activeEffectScope !== void 0) {
|
|
2196
|
+
if (activeEffectScope.active) link(this, activeEffectScope);
|
|
2197
|
+
else if (this.subs === void 0) {
|
|
2198
|
+
let dep = this.deps;
|
|
2199
|
+
if (dep !== void 0) {
|
|
2200
|
+
do
|
|
2201
|
+
dep = unlink(dep, this);
|
|
2202
|
+
while (dep !== void 0);
|
|
2203
|
+
this.flags |= 16;
|
|
2204
|
+
}
|
|
2205
|
+
}
|
|
2206
|
+
}
|
|
2097
2207
|
return this._value;
|
|
2098
2208
|
}
|
|
2099
2209
|
set value(newValue) {
|
|
@@ -2105,11 +2215,15 @@ var ComputedRefImpl = class {
|
|
|
2105
2215
|
try {
|
|
2106
2216
|
const oldValue = this._value;
|
|
2107
2217
|
const newValue = this.fn(oldValue);
|
|
2108
|
-
if (hasChanged(oldValue, newValue)) {
|
|
2218
|
+
if (hasChanged(oldValue, newValue) || this.flags & FAILED) {
|
|
2109
2219
|
this._value = newValue;
|
|
2220
|
+
this.flags &= -65;
|
|
2110
2221
|
return true;
|
|
2111
2222
|
}
|
|
2112
2223
|
return false;
|
|
2224
|
+
} catch (err) {
|
|
2225
|
+
this.flags |= FAILED;
|
|
2226
|
+
throw err;
|
|
2113
2227
|
} finally {
|
|
2114
2228
|
endTracking(this, prevSub);
|
|
2115
2229
|
}
|
|
@@ -2130,6 +2244,7 @@ function computed$1(getterOrOptions, debugOptions, isSSR = false) {
|
|
|
2130
2244
|
cRef.onTrack = debugOptions.onTrack;
|
|
2131
2245
|
cRef.onTrigger = debugOptions.onTrigger;
|
|
2132
2246
|
}
|
|
2247
|
+
if (isSSR && activeEffectScope !== void 0) link(cRef, activeEffectScope);
|
|
2133
2248
|
return cRef;
|
|
2134
2249
|
}
|
|
2135
2250
|
//#endregion
|
|
@@ -2500,7 +2615,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
|
|
|
2500
2615
|
if (isFunction(fn)) {
|
|
2501
2616
|
const res = callWithErrorHandling(fn, instance, type, args);
|
|
2502
2617
|
if (res && isPromise(res)) res.catch((err) => {
|
|
2503
|
-
handleError(err, instance, type);
|
|
2618
|
+
handleError(err, instance, type, void 0, true);
|
|
2504
2619
|
});
|
|
2505
2620
|
return res;
|
|
2506
2621
|
}
|
|
@@ -2510,7 +2625,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
|
|
|
2510
2625
|
return values;
|
|
2511
2626
|
} else warn$1(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}`);
|
|
2512
2627
|
}
|
|
2513
|
-
function handleError(err, instance, type, throwInDev = true) {
|
|
2628
|
+
function handleError(err, instance, type, throwInDev = true, isAsyncError = false) {
|
|
2514
2629
|
const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ;
|
|
2515
2630
|
if (instance) {
|
|
2516
2631
|
let cur = instance.parent;
|
|
@@ -2518,7 +2633,7 @@ function handleError(err, instance, type, throwInDev = true) {
|
|
|
2518
2633
|
const errorInfo = ErrorTypeStrings$1[type];
|
|
2519
2634
|
while (cur) {
|
|
2520
2635
|
const errorCapturedHooks = cur.ec;
|
|
2521
|
-
if (errorCapturedHooks) {
|
|
2636
|
+
if (errorCapturedHooks && !cur.isUnmounted && (!isAsyncError || cur.scope.active)) {
|
|
2522
2637
|
for (let i = 0; i < errorCapturedHooks.length; i++) if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) return;
|
|
2523
2638
|
}
|
|
2524
2639
|
cur = cur.parent;
|
|
@@ -2823,7 +2938,11 @@ function reload(id, newComp) {
|
|
|
2823
2938
|
updateComponentDef(record.initialDef, newComp);
|
|
2824
2939
|
const instances = [...record.instances];
|
|
2825
2940
|
if (isVapor && newComp.__vapor && !instances.some((instance) => instance.parent && !instance.parent.vapor) && !instances.some((i) => i.ceReload)) {
|
|
2826
|
-
for (const instance of instances)
|
|
2941
|
+
for (const instance of instances) {
|
|
2942
|
+
if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
|
|
2943
|
+
const oldComp = normalizeClassComponent(instance.type);
|
|
2944
|
+
if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
|
|
2945
|
+
}
|
|
2827
2946
|
const dirtyInstances = new Set(instances);
|
|
2828
2947
|
const rerenderedParents = /* @__PURE__ */ new Set();
|
|
2829
2948
|
runWithHmrUpdating(() => {
|
|
@@ -2864,7 +2983,25 @@ function reload(id, newComp) {
|
|
|
2864
2983
|
if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
|
|
2865
2984
|
}
|
|
2866
2985
|
parents.forEach((parent) => {
|
|
2867
|
-
|
|
2986
|
+
const children = instances.filter((instance) => instance.parent === parent);
|
|
2987
|
+
const update = () => {
|
|
2988
|
+
if (!parent.scope.active) return;
|
|
2989
|
+
const activeChildren = children.filter((instance) => instance.scope.active);
|
|
2990
|
+
if (!activeChildren.length) return;
|
|
2991
|
+
const pending = activeChildren.find((instance) => instance.asyncDep && !instance.asyncResolved) || locateUnresolvedAsyncRoot(parent);
|
|
2992
|
+
if (pending) {
|
|
2993
|
+
pending.asyncDep.catch(NOOP).then(() => {
|
|
2994
|
+
if (parent.scope.active && (pending.asyncResolved || !pending.scope.active)) queueJob(update);
|
|
2995
|
+
});
|
|
2996
|
+
return;
|
|
2997
|
+
}
|
|
2998
|
+
for (const instance of activeChildren) {
|
|
2999
|
+
const oldComp = normalizeClassComponent(instance.type);
|
|
3000
|
+
let dirtyInstances = hmrDirtyComponents.get(oldComp);
|
|
3001
|
+
if (!dirtyInstances) hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
|
|
3002
|
+
dirtyInstances.add(instance);
|
|
3003
|
+
hmrDirtyComponentsMode.set(oldComp, !!isVapor);
|
|
3004
|
+
}
|
|
2868
3005
|
runWithHmrUpdating(() => {
|
|
2869
3006
|
if (parent.vapor) parent.hmrRerender();
|
|
2870
3007
|
else {
|
|
@@ -2875,7 +3012,12 @@ function reload(id, newComp) {
|
|
|
2875
3012
|
}
|
|
2876
3013
|
}
|
|
2877
3014
|
});
|
|
2878
|
-
|
|
3015
|
+
queuePostFlushCb(() => {
|
|
3016
|
+
hmrDirtyComponents.clear();
|
|
3017
|
+
hmrDirtyComponentsMode.clear();
|
|
3018
|
+
});
|
|
3019
|
+
};
|
|
3020
|
+
queueJob(update);
|
|
2879
3021
|
});
|
|
2880
3022
|
}
|
|
2881
3023
|
queuePostFlushCb(() => {
|
|
@@ -3072,18 +3214,35 @@ function withDirectives(vnode, directives) {
|
|
|
3072
3214
|
return vnode;
|
|
3073
3215
|
}
|
|
3074
3216
|
function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
3075
|
-
|
|
3217
|
+
let hookVNode = vnode;
|
|
3218
|
+
if (name === "beforeMount") vnode._mount = vnode;
|
|
3219
|
+
else if (name === "beforeUpdate") {
|
|
3220
|
+
const mount = prevVNode && prevVNode._mount;
|
|
3221
|
+
if (mount) {
|
|
3222
|
+
mount._latest = vnode;
|
|
3223
|
+
vnode._mount = mount;
|
|
3224
|
+
}
|
|
3225
|
+
} else if (name === "mounted") {
|
|
3226
|
+
const latest = vnode._latest;
|
|
3227
|
+
vnode._mount = vnode._latest = void 0;
|
|
3228
|
+
if (latest) {
|
|
3229
|
+
hookVNode = latest;
|
|
3230
|
+
latest._mount = void 0;
|
|
3231
|
+
}
|
|
3232
|
+
}
|
|
3233
|
+
const bindings = hookVNode.dirs;
|
|
3076
3234
|
const oldBindings = prevVNode && prevVNode.dirs;
|
|
3077
3235
|
for (let i = 0; i < bindings.length; i++) {
|
|
3078
|
-
|
|
3236
|
+
let binding = bindings[i];
|
|
3079
3237
|
if (oldBindings) binding.oldValue = oldBindings[i].value;
|
|
3238
|
+
else if (name === "mounted" && binding.oldValue !== void 0) binding = extend({}, binding, { oldValue: void 0 });
|
|
3080
3239
|
let hook = binding.dir[name];
|
|
3081
3240
|
if (hook) {
|
|
3082
3241
|
const prevSub = setActiveSub();
|
|
3083
3242
|
callWithAsyncErrorHandling(hook, instance, 8, [
|
|
3084
3243
|
vnode.el,
|
|
3085
3244
|
binding,
|
|
3086
|
-
|
|
3245
|
+
hookVNode,
|
|
3087
3246
|
prevVNode
|
|
3088
3247
|
]);
|
|
3089
3248
|
setActiveSub(prevSub);
|
|
@@ -3508,7 +3667,15 @@ const BaseTransitionImpl = {
|
|
|
3508
3667
|
const { mode } = rawProps;
|
|
3509
3668
|
checkTransitionMode(mode);
|
|
3510
3669
|
return prepareTransitionSwitch(instance.subTree, child, rawProps, state, instance, mode === "out-in" ? resumeAfterLeave || (resumeAfterLeave = () => {
|
|
3511
|
-
if (!(instance.effect.flags & 1024))
|
|
3670
|
+
if (!(instance.effect.flags & 1024)) {
|
|
3671
|
+
if (instance.effect.running) {
|
|
3672
|
+
const job = () => {
|
|
3673
|
+
if (!(instance.effect.flags & 1024)) instance.update();
|
|
3674
|
+
};
|
|
3675
|
+
job.i = instance;
|
|
3676
|
+
queueJob(job);
|
|
3677
|
+
} else instance.update();
|
|
3678
|
+
}
|
|
3512
3679
|
}) : NOOP);
|
|
3513
3680
|
};
|
|
3514
3681
|
}
|
|
@@ -3538,7 +3705,7 @@ function getLeavingNodesForType(state, vnode) {
|
|
|
3538
3705
|
}
|
|
3539
3706
|
return leavingVNodesCache;
|
|
3540
3707
|
}
|
|
3541
|
-
function resolveTransitionHooks(vnode, props, state, instance
|
|
3708
|
+
function resolveTransitionHooks(vnode, props, state, instance) {
|
|
3542
3709
|
const key = String(vnode.key);
|
|
3543
3710
|
const leavingVNodesCache = getLeavingNodesForType(state, vnode);
|
|
3544
3711
|
const hooks = baseResolveTransitionHooks({
|
|
@@ -3561,9 +3728,7 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
|
3561
3728
|
}
|
|
3562
3729
|
},
|
|
3563
3730
|
cloneHooks: (vnode) => {
|
|
3564
|
-
|
|
3565
|
-
if (postClone) postClone(hooks);
|
|
3566
|
-
return hooks;
|
|
3731
|
+
return resolveTransitionHooks(vnode, props, state, instance);
|
|
3567
3732
|
}
|
|
3568
3733
|
}, props, state, instance);
|
|
3569
3734
|
if (isVaporInteropEnabled && vnode.type === VaporSlot) extend(hooks, {
|
|
@@ -3601,7 +3766,7 @@ function baseResolveTransitionHooks(context, props, state, instance) {
|
|
|
3601
3766
|
callHook(hook, [el]);
|
|
3602
3767
|
},
|
|
3603
3768
|
enter(el) {
|
|
3604
|
-
if (!isHmrUpdating && isLeaving()) return;
|
|
3769
|
+
if (!isHmrUpdating && isLeaving(el)) return;
|
|
3605
3770
|
let hook = onEnter;
|
|
3606
3771
|
let afterHook = onAfterEnter;
|
|
3607
3772
|
let cancelHook = onEnterCancelled;
|
|
@@ -3645,7 +3810,19 @@ function baseResolveTransitionHooks(context, props, state, instance) {
|
|
|
3645
3810
|
else done();
|
|
3646
3811
|
},
|
|
3647
3812
|
clone(node) {
|
|
3648
|
-
|
|
3813
|
+
if (!cloneHooks) return hooks;
|
|
3814
|
+
const cloned = cloneHooks(node);
|
|
3815
|
+
cloned.afterLeave = () => {
|
|
3816
|
+
if (hooks.afterLeave) hooks.afterLeave();
|
|
3817
|
+
};
|
|
3818
|
+
cloned.delayLeave = (el, earlyRemove, delayedLeave) => {
|
|
3819
|
+
if (hooks.delayLeave) hooks.delayLeave(el, earlyRemove, delayedLeave);
|
|
3820
|
+
else delayedLeave();
|
|
3821
|
+
};
|
|
3822
|
+
cloned.delayedLeave = () => {
|
|
3823
|
+
if (hooks.delayedLeave) hooks.delayedLeave();
|
|
3824
|
+
};
|
|
3825
|
+
return cloned;
|
|
3649
3826
|
}
|
|
3650
3827
|
};
|
|
3651
3828
|
return hooks;
|
|
@@ -3680,10 +3857,7 @@ function prepareTransitionSwitch(previous, next, props, state, instance, resumeA
|
|
|
3680
3857
|
if (state.isLeaving) return emptyPlaceholder(next);
|
|
3681
3858
|
const nextInner = getInnerChild$1(next);
|
|
3682
3859
|
if (!nextInner) return emptyPlaceholder(next);
|
|
3683
|
-
|
|
3684
|
-
if (delayedLeaveSource) forwardDelayedLeave(hooks, delayedLeaveSource);
|
|
3685
|
-
enterHooks = hooks;
|
|
3686
|
-
});
|
|
3860
|
+
const enterHooks = resolveTransitionHooks(nextInner, props, state, instance);
|
|
3687
3861
|
if (delayedLeaveSource) forwardDelayedLeave(enterHooks, delayedLeaveSource);
|
|
3688
3862
|
if (nextInner.type !== Comment) setTransitionHooks(nextInner, enterHooks);
|
|
3689
3863
|
const mode = props.mode;
|
|
@@ -3749,9 +3923,14 @@ function setTransitionHooks(vnode, hooks) {
|
|
|
3749
3923
|
return setTransitionHooks(isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree, hooks);
|
|
3750
3924
|
}
|
|
3751
3925
|
} else if (vnode.shapeFlag & 128) {
|
|
3752
|
-
const
|
|
3753
|
-
|
|
3754
|
-
|
|
3926
|
+
const suspense = vnode.suspense;
|
|
3927
|
+
if (suspense) {
|
|
3928
|
+
const branch = suspense.isHydrating ? suspense.pendingBranch : suspense.activeBranch;
|
|
3929
|
+
if (branch) return setTransitionHooks(branch, hooks.clone(branch));
|
|
3930
|
+
} else {
|
|
3931
|
+
vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
3932
|
+
vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
3933
|
+
}
|
|
3755
3934
|
} else {
|
|
3756
3935
|
vnode.transition = hooks;
|
|
3757
3936
|
if (vnode.type === Fragment && isArray(vnode.children)) {
|
|
@@ -3969,6 +4148,8 @@ const getContainerType = (container) => {
|
|
|
3969
4148
|
if (isMathMLContainer(container)) return "mathml";
|
|
3970
4149
|
};
|
|
3971
4150
|
const isComment = (node) => node.nodeType === 8;
|
|
4151
|
+
/** The data of a comment opening a range a hydration steps over as one. */
|
|
4152
|
+
const isRangeStart = (data) => data === "[" || data === "(" || isVaporRangeStart(data);
|
|
3972
4153
|
function createHydrationFunctions(rendererInternals) {
|
|
3973
4154
|
const { mt: mountComponent, p: patch, o: { patchProp, createText, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals;
|
|
3974
4155
|
const hydrate = (vnode, container) => {
|
|
@@ -3986,7 +4167,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
3986
4167
|
};
|
|
3987
4168
|
const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
|
|
3988
4169
|
optimized = optimized || !!vnode.dynamicChildren;
|
|
3989
|
-
const isFragmentStart = isComment(node) && (node.data === "[" || node.data === "(");
|
|
4170
|
+
const isFragmentStart = isComment(node) && (node.data === "[" || node.data === "(" || isVaporInteropEnabled && isVaporRangeStart(node.data));
|
|
3990
4171
|
const onMismatch = () => handleMismatch(node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragmentStart);
|
|
3991
4172
|
const { type, ref, shapeFlag, patchFlag } = vnode;
|
|
3992
4173
|
let domType = node.nodeType;
|
|
@@ -4175,16 +4356,17 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4175
4356
|
const container = parentNode(node);
|
|
4176
4357
|
const first = nextSibling(node);
|
|
4177
4358
|
const next = isVaporInteropEnabled && vnode.vo && node.data === "(" ? getVaporInterface(parentComponent, vnode).hydrateSlotOutlet(vnode, node, parentComponent, parentSuspense, slotScopeIds) : hydrateChildren(first, vnode, container, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
4178
|
-
|
|
4359
|
+
const close = isVaporInteropEnabled ? rangeCloseOf(node.data) : node.data === "(" ? ")" : "]";
|
|
4360
|
+
if (next && isComment(next) && next.data === close) return nextSibling(vnode.anchor = next);
|
|
4179
4361
|
else {
|
|
4180
4362
|
logMismatchError();
|
|
4181
|
-
insert(vnode.anchor = createComment(
|
|
4363
|
+
insert(vnode.anchor = createComment(close), container, next);
|
|
4182
4364
|
return next;
|
|
4183
4365
|
}
|
|
4184
4366
|
};
|
|
4185
4367
|
const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
|
|
4186
4368
|
if (!isNodeMismatchAllowed(node, vnode)) {
|
|
4187
|
-
warn$1(`Hydration node mismatch:\n- rendered on server:`, node, node.nodeType === 3 ? `(text)` : isComment(node) && (node.data
|
|
4369
|
+
warn$1(`Hydration node mismatch:\n- rendered on server:`, node, node.nodeType === 3 ? `(text)` : isComment(node) && isRangeStart(node.data) ? `(start of fragment)` : ``, `\n- expected on client:`, vnode.type);
|
|
4188
4370
|
logMismatchError();
|
|
4189
4371
|
}
|
|
4190
4372
|
vnode.el = null;
|
|
@@ -4200,18 +4382,18 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4200
4382
|
const container = parentNode(node);
|
|
4201
4383
|
remove(node);
|
|
4202
4384
|
patch(null, vnode, container, next, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
|
|
4203
|
-
if (parentComponent && parentComponent.vnode) {
|
|
4385
|
+
if (parentComponent && parentComponent.vnode && parentComponent.vnode.el === node) {
|
|
4204
4386
|
parentComponent.vnode.el = vnode.el;
|
|
4205
4387
|
updateHOCHostEl(parentComponent, vnode.el);
|
|
4206
4388
|
}
|
|
4207
4389
|
return next;
|
|
4208
4390
|
};
|
|
4209
|
-
const locateClosingAnchor = (node, open = node && isComment(node) && node.data === "("
|
|
4391
|
+
const locateClosingAnchor = (node, open = node && isComment(node) && (node.data === "(" || isVaporInteropEnabled && node.data === "{") ? node.data : "[", close = isVaporInteropEnabled ? rangeCloseOf(open) : open === "(" ? ")" : "]") => {
|
|
4210
4392
|
let match = 0;
|
|
4211
4393
|
while (node) {
|
|
4212
4394
|
node = nextSibling(node);
|
|
4213
4395
|
if (node && isComment(node)) {
|
|
4214
|
-
if (node.data === open) match++;
|
|
4396
|
+
if (node.data === open || isVaporInteropEnabled && open === "[" && isVaporBranchStart(node.data)) match++;
|
|
4215
4397
|
if (node.data === close) {
|
|
4216
4398
|
if (match === 0) return nextSibling(node);
|
|
4217
4399
|
else match--;
|
|
@@ -4467,9 +4649,9 @@ const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => {
|
|
|
4467
4649
|
return teardown;
|
|
4468
4650
|
};
|
|
4469
4651
|
function forEachElement(node, cb) {
|
|
4470
|
-
if (isComment(node) && (node.data
|
|
4652
|
+
if (isComment(node) && isRangeStart(node.data)) {
|
|
4471
4653
|
const open = node.data;
|
|
4472
|
-
const close = open
|
|
4654
|
+
const close = rangeCloseOf(open);
|
|
4473
4655
|
let depth = 1;
|
|
4474
4656
|
let next = node.nextSibling;
|
|
4475
4657
|
while (next) {
|
|
@@ -4478,7 +4660,7 @@ function forEachElement(node, cb) {
|
|
|
4478
4660
|
} else if (isComment(next)) {
|
|
4479
4661
|
if (next.data === close) {
|
|
4480
4662
|
if (--depth === 0) break;
|
|
4481
|
-
} else if (next.data === open) depth++;
|
|
4663
|
+
} else if (close === "]" ? next.data === "[" || isVaporBranchStart(next.data) : next.data === open) depth++;
|
|
4482
4664
|
}
|
|
4483
4665
|
next = next.nextSibling;
|
|
4484
4666
|
}
|
|
@@ -4506,7 +4688,7 @@ function defineAsyncComponent(source) {
|
|
|
4506
4688
|
if (resolvedComp) return () => createInnerComp(resolvedComp, instance);
|
|
4507
4689
|
const onError = (err) => {
|
|
4508
4690
|
setPendingRequest(null);
|
|
4509
|
-
handleError(err, instance, 13, !errorComponent);
|
|
4691
|
+
handleError(err, instance, 13, !errorComponent, true);
|
|
4510
4692
|
};
|
|
4511
4693
|
if (suspensible && instance.suspense || false) return load().then((comp) => {
|
|
4512
4694
|
return () => createInnerComp(comp, instance);
|
|
@@ -4587,10 +4769,12 @@ const useAsyncComponentState = (delay = 200, timeout, onError, instance = curren
|
|
|
4587
4769
|
const delayed = /* @__PURE__ */ ref(!!delay);
|
|
4588
4770
|
let timeoutTimer;
|
|
4589
4771
|
let delayTimer;
|
|
4590
|
-
if (instance)
|
|
4591
|
-
|
|
4592
|
-
|
|
4593
|
-
|
|
4772
|
+
if (instance) instance.scope.run(() => {
|
|
4773
|
+
onScopeDispose(() => {
|
|
4774
|
+
if (timeoutTimer != null) clearTimeout(timeoutTimer);
|
|
4775
|
+
if (delayTimer != null) clearTimeout(delayTimer);
|
|
4776
|
+
});
|
|
4777
|
+
});
|
|
4594
4778
|
if (delay) delayTimer = setTimeout(() => {
|
|
4595
4779
|
if (instance && instance.isUnmounted) return;
|
|
4596
4780
|
delayed.value = false;
|
|
@@ -4625,7 +4809,12 @@ function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydra
|
|
|
4625
4809
|
}
|
|
4626
4810
|
return;
|
|
4627
4811
|
}
|
|
4628
|
-
if (!el.parentNode
|
|
4812
|
+
if (!el.parentNode) return;
|
|
4813
|
+
if (wasConnected && !el.isConnected) {
|
|
4814
|
+
let current = instance;
|
|
4815
|
+
while (current && !current.isDeactivated) current = current.parent;
|
|
4816
|
+
if (!current) return;
|
|
4817
|
+
}
|
|
4629
4818
|
hydrate();
|
|
4630
4819
|
};
|
|
4631
4820
|
const doHydrate = hydrateStrategy ? () => {
|
|
@@ -4679,7 +4868,11 @@ const KeepAlive = /*@__PURE__*/ withKeepAliveEnabled({
|
|
|
4679
4868
|
activate(vnode, container, anchor, renderer, keepAliveInstance, parentSuspense, namespace, optimized);
|
|
4680
4869
|
};
|
|
4681
4870
|
sharedContext.deactivate = (vnode) => {
|
|
4682
|
-
|
|
4871
|
+
const cached = sharedContext.getCachedComponent(vnode);
|
|
4872
|
+
if (!cached || cached.component !== vnode.component) return false;
|
|
4873
|
+
if (isVaporInteropEnabled && isVaporComponent(vnode.type)) getVaporInterface(keepAliveInstance, vnode).deactivate(vnode, storageContainer, parentSuspense);
|
|
4874
|
+
else deactivate(vnode, storageContainer, renderer, keepAliveInstance, parentSuspense);
|
|
4875
|
+
return true;
|
|
4683
4876
|
};
|
|
4684
4877
|
function unmount(vnode) {
|
|
4685
4878
|
resetShapeFlag(vnode);
|
|
@@ -4711,11 +4904,15 @@ const KeepAlive = /*@__PURE__*/ withKeepAliveEnabled({
|
|
|
4711
4904
|
let pendingCacheKey = null;
|
|
4712
4905
|
const cacheSubtree = () => {
|
|
4713
4906
|
if (pendingCacheKey != null) {
|
|
4714
|
-
if (isSuspense(keepAliveInstance.subTree.type))
|
|
4715
|
-
const
|
|
4716
|
-
|
|
4717
|
-
|
|
4718
|
-
|
|
4907
|
+
if (isSuspense(keepAliveInstance.subTree.type)) {
|
|
4908
|
+
const cacheInnerChild = () => {
|
|
4909
|
+
const vnode = getInnerChild(keepAliveInstance.subTree);
|
|
4910
|
+
if (vnode.component) cache.set(pendingCacheKey, vnode);
|
|
4911
|
+
};
|
|
4912
|
+
const suspense = keepAliveInstance.subTree.suspense;
|
|
4913
|
+
if (suspense.pendingBranch) queuePostRenderEffect(cacheInnerChild, void 0, suspense);
|
|
4914
|
+
else cacheInnerChild();
|
|
4915
|
+
} else cache.set(pendingCacheKey, getInnerChild(keepAliveInstance.subTree));
|
|
4719
4916
|
}
|
|
4720
4917
|
};
|
|
4721
4918
|
onMounted(cacheSubtree);
|
|
@@ -4820,9 +5017,8 @@ function registerKeepAliveHook(hook, type, target = getCurrentGenericInstance())
|
|
|
4820
5017
|
}
|
|
4821
5018
|
function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
|
|
4822
5019
|
const injected = injectHook(type, hook, keepAliveRoot, true);
|
|
4823
|
-
|
|
4824
|
-
|
|
4825
|
-
}, target);
|
|
5020
|
+
const removal = injectHook("um", () => remove(keepAliveRoot[type], injected), target);
|
|
5021
|
+
removal.flags = 8;
|
|
4826
5022
|
}
|
|
4827
5023
|
function resetShapeFlag(vnode) {
|
|
4828
5024
|
vnode.shapeFlag &= -257;
|
|
@@ -5030,6 +5226,11 @@ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
|
|
|
5030
5226
|
ret.props = extend({}, ret.props, { key: branchKey });
|
|
5031
5227
|
ret.key = branchKey;
|
|
5032
5228
|
}
|
|
5229
|
+
if (isBlockTreeEnabled <= 0) {
|
|
5230
|
+
if (!ret.vs.props) ret.vs.props = ret.props;
|
|
5231
|
+
ret.props = ret.key != null ? { key: ret.key } : null;
|
|
5232
|
+
ret.vs.attrs = EMPTY_OBJ;
|
|
5233
|
+
}
|
|
5033
5234
|
if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
|
|
5034
5235
|
return ret;
|
|
5035
5236
|
}
|
|
@@ -6830,8 +7031,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6830
7031
|
def(el, "__vnode", vnode, true);
|
|
6831
7032
|
def(el, "__vueParentComponent", parentComponent, true);
|
|
6832
7033
|
if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
6833
|
-
if (transition)
|
|
6834
|
-
|
|
7034
|
+
if (transition) {
|
|
7035
|
+
if (!needTransition(parentSuspense, transition) && !transition.persisted) el[deferredEnterKey] = true;
|
|
7036
|
+
performTransitionEnter(el, transition, () => hostInsert(el, container, anchor), parentSuspense);
|
|
7037
|
+
} else hostInsert(el, container, anchor);
|
|
6835
7038
|
if ((vnodeHook = props && props.onVnodeMounted) || dirs) {
|
|
6836
7039
|
const isHmr = isHmrUpdating;
|
|
6837
7040
|
queuePostRenderEffect(() => {
|
|
@@ -7088,16 +7291,20 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7088
7291
|
} else {
|
|
7089
7292
|
let { next, bu, u, parent, vnode } = instance;
|
|
7090
7293
|
{
|
|
7091
|
-
const
|
|
7092
|
-
if (
|
|
7294
|
+
const unresolvedAsyncRoot = locateUnresolvedAsyncRoot(instance);
|
|
7295
|
+
if (unresolvedAsyncRoot) {
|
|
7093
7296
|
if (next) {
|
|
7094
7297
|
next.el = vnode.el;
|
|
7095
7298
|
updateComponentPreRender(instance, next, optimized);
|
|
7096
7299
|
}
|
|
7097
|
-
|
|
7098
|
-
|
|
7099
|
-
if (
|
|
7100
|
-
|
|
7300
|
+
unresolvedAsyncRoot.asyncDep.then(() => {
|
|
7301
|
+
const retry = () => {
|
|
7302
|
+
if (instance.effect.flags & 1024) return;
|
|
7303
|
+
if (parentSuspense && parentSuspense.pendingBranch) queuePostRenderEffect(retry, void 0, parentSuspense);
|
|
7304
|
+
else instance.update();
|
|
7305
|
+
};
|
|
7306
|
+
retry.flags = 24;
|
|
7307
|
+
queuePostRenderEffect(retry, void 0, parentSuspense);
|
|
7101
7308
|
});
|
|
7102
7309
|
return;
|
|
7103
7310
|
}
|
|
@@ -7120,7 +7327,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7120
7327
|
const prevTree = instance.subTree;
|
|
7121
7328
|
instance.subTree = nextTree;
|
|
7122
7329
|
startMeasure(instance, `patch`);
|
|
7123
|
-
patch(prevTree, nextTree, hostParentNode(prevTree.el), getNextHostNode(prevTree), instance, parentSuspense, namespace);
|
|
7330
|
+
patch(prevTree, nextTree, hostParentNode(prevTree.el || resolveAsyncComponentPlaceholder(prevTree)), getNextHostNode(prevTree), instance, parentSuspense, namespace);
|
|
7124
7331
|
endMeasure(instance, `patch`);
|
|
7125
7332
|
next.el = nextTree.el;
|
|
7126
7333
|
if (originNext === null) updateHOCHostEl(instance, nextTree.el);
|
|
@@ -7323,9 +7530,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7323
7530
|
}
|
|
7324
7531
|
if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) parentComponent.renderCache[cacheIndex] = void 0;
|
|
7325
7532
|
if (shapeFlag & 256) {
|
|
7326
|
-
if (
|
|
7327
|
-
else parentComponent.ctx.deactivate(vnode);
|
|
7328
|
-
return;
|
|
7533
|
+
if (parentComponent.ctx.deactivate(vnode)) return;
|
|
7329
7534
|
}
|
|
7330
7535
|
if (isVaporInteropEnabled && shapeFlag & 6 && isVaporComponent(type)) {
|
|
7331
7536
|
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
|
|
@@ -7405,12 +7610,14 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7405
7610
|
if (effect) {
|
|
7406
7611
|
effect.stop();
|
|
7407
7612
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
7408
|
-
} else if (
|
|
7613
|
+
} else if (subTree) {
|
|
7409
7614
|
subTree.transition = instance.vnode.transition;
|
|
7410
7615
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
7411
7616
|
}
|
|
7412
7617
|
if (um) queuePostRenderEffect(um, void 0, parentSuspense);
|
|
7413
|
-
|
|
7618
|
+
const markUnmounted = () => instance.isUnmounted = true;
|
|
7619
|
+
markUnmounted.flags = 8;
|
|
7620
|
+
queuePostRenderEffect(markUnmounted, void 0, parentSuspense);
|
|
7414
7621
|
devtoolsComponentRemoved(instance);
|
|
7415
7622
|
};
|
|
7416
7623
|
const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {
|
|
@@ -7524,11 +7731,11 @@ function traverseStaticChildren(n1, n2, shallow = false) {
|
|
|
7524
7731
|
c2.el && (c2.el.__vnode = c2);
|
|
7525
7732
|
}
|
|
7526
7733
|
}
|
|
7527
|
-
function
|
|
7734
|
+
function locateUnresolvedAsyncRoot(instance) {
|
|
7528
7735
|
const subComponent = instance.subTree && instance.subTree.component;
|
|
7529
7736
|
if (subComponent) {
|
|
7530
7737
|
if (subComponent.asyncDep && !subComponent.asyncResolved) return subComponent;
|
|
7531
|
-
else return
|
|
7738
|
+
else return locateUnresolvedAsyncRoot(subComponent);
|
|
7532
7739
|
}
|
|
7533
7740
|
}
|
|
7534
7741
|
function invalidateMount(hooks) {
|
|
@@ -7598,7 +7805,9 @@ function getInheritedScopeIds(vnode, parentComponent, includeVaporRootIds = true
|
|
|
7598
7805
|
function resolveAsyncComponentPlaceholder(anchorVnode) {
|
|
7599
7806
|
if (anchorVnode.placeholder) return anchorVnode.placeholder;
|
|
7600
7807
|
const instance = anchorVnode.component;
|
|
7601
|
-
if (instance) return resolveAsyncComponentPlaceholder(instance.subTree);
|
|
7808
|
+
if (instance && instance.subTree) return resolveAsyncComponentPlaceholder(instance.subTree);
|
|
7809
|
+
const suspense = anchorVnode.suspense;
|
|
7810
|
+
if (suspense && suspense.activeBranch) return resolveAsyncComponentPlaceholder(suspense.activeBranch);
|
|
7602
7811
|
return null;
|
|
7603
7812
|
}
|
|
7604
7813
|
//#endregion
|
|
@@ -7610,17 +7819,22 @@ function withSuspenseEnabled(value) {
|
|
|
7610
7819
|
return value;
|
|
7611
7820
|
}
|
|
7612
7821
|
let suspenseId = 0;
|
|
7822
|
+
const deferredEnterKey = Symbol("_deferredEnter");
|
|
7613
7823
|
const Suspense = /*@__PURE__*/ withSuspenseEnabled({
|
|
7614
7824
|
name: "Suspense",
|
|
7615
7825
|
__isSuspense: true,
|
|
7616
7826
|
process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
|
|
7617
7827
|
if (n1 == null) mountSuspense(n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals);
|
|
7618
7828
|
else {
|
|
7619
|
-
|
|
7620
|
-
|
|
7621
|
-
|
|
7622
|
-
n2.
|
|
7623
|
-
|
|
7829
|
+
const suspense = n1.suspense;
|
|
7830
|
+
if (parentSuspense && parentSuspense.deps > 0 && !parentSuspense.isHydrating) {
|
|
7831
|
+
const owner = suspense.parentComponent;
|
|
7832
|
+
if (!!owner && owner.suspense === parentSuspense && owner.suspenseId !== parentSuspense.pendingId ? parentSuspense.pendingBranch && !isSameVNodeType(n2.ssContent, suspense.pendingBranch || suspense.activeBranch) : !suspense.isInFallback) {
|
|
7833
|
+
n2.suspense = suspense;
|
|
7834
|
+
suspense.vnode = n2;
|
|
7835
|
+
n2.el = n1.el;
|
|
7836
|
+
return;
|
|
7837
|
+
}
|
|
7624
7838
|
}
|
|
7625
7839
|
patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, rendererInternals);
|
|
7626
7840
|
}
|
|
@@ -7632,6 +7846,36 @@ function triggerEvent(vnode, name) {
|
|
|
7632
7846
|
const eventListener = vnode.props && vnode.props[name];
|
|
7633
7847
|
if (isFunction(eventListener)) eventListener();
|
|
7634
7848
|
}
|
|
7849
|
+
function enterDeferred(suspense, branch) {
|
|
7850
|
+
const enters = [];
|
|
7851
|
+
collectDeferredEnters(branch, enters, true);
|
|
7852
|
+
if (isVaporInteropEnabled) {
|
|
7853
|
+
const { parentComponent } = suspense;
|
|
7854
|
+
const vapor = parentComponent && parentComponent.appContext.vapor;
|
|
7855
|
+
if (vapor) vapor.enterDeferred(suspense, enters);
|
|
7856
|
+
}
|
|
7857
|
+
if (enters.length) queuePostFlushCb(enters);
|
|
7858
|
+
}
|
|
7859
|
+
function collectDeferredEnters(vnode, enters, isRoot) {
|
|
7860
|
+
const { el, transition, children, shapeFlag } = vnode;
|
|
7861
|
+
if (shapeFlag & 6) {
|
|
7862
|
+
const subTree = vnode.component.subTree;
|
|
7863
|
+
if (subTree) collectDeferredEnters(subTree, enters, isRoot);
|
|
7864
|
+
return;
|
|
7865
|
+
}
|
|
7866
|
+
if (shapeFlag & 192) return;
|
|
7867
|
+
if (shapeFlag & 1) {
|
|
7868
|
+
if (!isRoot && el && el[deferredEnterKey]) {
|
|
7869
|
+
el[deferredEnterKey] = void 0;
|
|
7870
|
+
if (transition && !transition.persisted) {
|
|
7871
|
+
transition.beforeEnter(el);
|
|
7872
|
+
enters.push(() => transition.enter(el));
|
|
7873
|
+
}
|
|
7874
|
+
}
|
|
7875
|
+
isRoot = false;
|
|
7876
|
+
}
|
|
7877
|
+
if (shapeFlag & 16) for (let i = 0; i < children.length; i++) collectDeferredEnters(children[i], enters, isRoot);
|
|
7878
|
+
}
|
|
7635
7879
|
function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
|
|
7636
7880
|
const { p: patch, o: { createElement } } = rendererInternals;
|
|
7637
7881
|
const hiddenContainer = createElement("div");
|
|
@@ -7671,11 +7915,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
7671
7915
|
suspense.activeBranch = pendingBranch;
|
|
7672
7916
|
} else unmount(pendingBranch, parentComponent, suspense);
|
|
7673
7917
|
suspense.deps = 0;
|
|
7674
|
-
|
|
7675
|
-
const effect = suspense.effects[i];
|
|
7676
|
-
if (effect.flags & 8) queuePostFlushCb(effect);
|
|
7677
|
-
}
|
|
7678
|
-
suspense.effects.length = 0;
|
|
7918
|
+
discardEffects(suspense);
|
|
7679
7919
|
suspense.hiddenContainer = createElement("div");
|
|
7680
7920
|
if (isInFallback) {
|
|
7681
7921
|
patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
|
|
@@ -7698,14 +7938,14 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
7698
7938
|
} else {
|
|
7699
7939
|
triggerEvent(n2, "onPending");
|
|
7700
7940
|
suspense.pendingBranch = newBranch;
|
|
7701
|
-
|
|
7702
|
-
else suspense.pendingId = suspenseId++;
|
|
7941
|
+
suspense.pendingId = suspenseId++;
|
|
7703
7942
|
patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
|
|
7704
7943
|
if (suspense.deps <= 0) suspense.resolve();
|
|
7705
7944
|
else {
|
|
7706
|
-
const { timeout
|
|
7707
|
-
if (timeout > 0) setTimeout(() => {
|
|
7708
|
-
|
|
7945
|
+
const { timeout } = suspense;
|
|
7946
|
+
if (timeout > 0) suspense.timeoutTimer = setTimeout(() => {
|
|
7947
|
+
suspense.timeoutTimer = void 0;
|
|
7948
|
+
suspense.fallback(suspense.vnode.ssFallback);
|
|
7709
7949
|
}, timeout);
|
|
7710
7950
|
else if (timeout === 0) suspense.fallback(newFallback);
|
|
7711
7951
|
}
|
|
@@ -7741,6 +7981,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7741
7981
|
deps: 0,
|
|
7742
7982
|
pendingId: suspenseId++,
|
|
7743
7983
|
timeout: typeof timeout === "number" ? timeout : -1,
|
|
7984
|
+
timeoutTimer: void 0,
|
|
7744
7985
|
activeBranch: null,
|
|
7745
7986
|
isFallbackMountPending: false,
|
|
7746
7987
|
pendingBranch: null,
|
|
@@ -7758,26 +7999,39 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7758
7999
|
delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
|
|
7759
8000
|
let hasUpdatedAnchor = false;
|
|
7760
8001
|
if (delayEnter) activeBranch.transition.afterLeave = () => {
|
|
7761
|
-
if (pendingId === suspense.pendingId) {
|
|
8002
|
+
if (pendingId === suspense.pendingId && !suspense.isUnmounted) {
|
|
8003
|
+
enterDeferred(suspense, pendingBranch);
|
|
7762
8004
|
move(pendingBranch, container, anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor, 0, parentComponent);
|
|
7763
8005
|
queuePostFlushCb(effects);
|
|
7764
8006
|
if (isInFallback && vnode.ssFallback) vnode.ssFallback.el = null;
|
|
7765
8007
|
}
|
|
7766
8008
|
};
|
|
7767
8009
|
if (activeBranch && !suspense.isFallbackMountPending) {
|
|
7768
|
-
if (parentNode(activeBranch.el) === container) {
|
|
8010
|
+
if (parentNode(activeBranch.el || resolveAsyncComponentPlaceholder(activeBranch)) === container) {
|
|
7769
8011
|
anchor = next(activeBranch);
|
|
7770
8012
|
hasUpdatedAnchor = true;
|
|
7771
8013
|
}
|
|
7772
8014
|
unmount(activeBranch, parentComponent, suspense, true);
|
|
7773
8015
|
if (!delayEnter && isInFallback && vnode.ssFallback) queuePostRenderEffect(() => vnode.ssFallback.el = null, void 0, suspense);
|
|
7774
8016
|
}
|
|
7775
|
-
if (!delayEnter)
|
|
8017
|
+
if (!delayEnter) {
|
|
8018
|
+
enterDeferred(suspense, pendingBranch);
|
|
8019
|
+
move(pendingBranch, container, anchor, 0, parentComponent);
|
|
8020
|
+
}
|
|
7776
8021
|
}
|
|
8022
|
+
clearTimeout(suspense.timeoutTimer);
|
|
8023
|
+
suspense.timeoutTimer = void 0;
|
|
7777
8024
|
suspense.isFallbackMountPending = false;
|
|
7778
8025
|
setActiveBranch(suspense, pendingBranch);
|
|
7779
8026
|
suspense.pendingBranch = null;
|
|
7780
8027
|
suspense.isInFallback = false;
|
|
8028
|
+
let kept = 0;
|
|
8029
|
+
for (let i = 0; i < effects.length; i++) {
|
|
8030
|
+
const effect = effects[i];
|
|
8031
|
+
if (effect.flags & 16) queuePostFlushCb(effect);
|
|
8032
|
+
else effects[kept++] = effect;
|
|
8033
|
+
}
|
|
8034
|
+
effects.length = kept;
|
|
7781
8035
|
let parent = suspense.parent;
|
|
7782
8036
|
let hasUnresolvedAncestor = false;
|
|
7783
8037
|
while (parent) {
|
|
@@ -7800,13 +8054,13 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7800
8054
|
triggerEvent(vnode, "onResolve");
|
|
7801
8055
|
},
|
|
7802
8056
|
fallback(fallbackVNode) {
|
|
7803
|
-
if (!suspense.pendingBranch) return;
|
|
8057
|
+
if (suspense.isUnmounted || !suspense.pendingBranch) return;
|
|
7804
8058
|
const { vnode, activeBranch, parentComponent, container, namespace } = suspense;
|
|
7805
8059
|
triggerEvent(vnode, "onFallback");
|
|
7806
8060
|
const anchor = next(activeBranch);
|
|
7807
8061
|
const mountFallback = () => {
|
|
7808
8062
|
suspense.isFallbackMountPending = false;
|
|
7809
|
-
if (!suspense.isInFallback) return;
|
|
8063
|
+
if (suspense.isUnmounted || !suspense.isInFallback) return;
|
|
7810
8064
|
const latestFallback = suspense.vnode.ssFallback;
|
|
7811
8065
|
patch(null, latestFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
|
|
7812
8066
|
setActiveBranch(suspense, latestFallback);
|
|
@@ -7830,24 +8084,52 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7830
8084
|
registerDep(instance, onResolve) {
|
|
7831
8085
|
const isInPendingSuspense = !!suspense.pendingBranch;
|
|
7832
8086
|
if (isInPendingSuspense) suspense.deps++;
|
|
8087
|
+
const render = (setupResult) => {
|
|
8088
|
+
instance.asyncResolved = true;
|
|
8089
|
+
onResolve(setupResult);
|
|
8090
|
+
};
|
|
7833
8091
|
instance.asyncDep.catch((err) => {
|
|
7834
|
-
handleError(err, instance, 0);
|
|
8092
|
+
handleError(err, instance, 0, false, true);
|
|
8093
|
+
return () => null;
|
|
7835
8094
|
}).then((asyncSetupResult) => {
|
|
7836
|
-
if (instance.isUnmounted || suspense.isUnmounted
|
|
8095
|
+
if (instance.isUnmounted || suspense.isUnmounted) return;
|
|
8096
|
+
const isPendingDep = isInPendingSuspense && suspense.pendingId === instance.suspenseId;
|
|
7837
8097
|
setCurrentInstance(null, void 0);
|
|
7838
8098
|
if (!instance.scope.active) {
|
|
7839
|
-
if (
|
|
8099
|
+
if (isPendingDep && --suspense.deps === 0) suspense.resolve();
|
|
7840
8100
|
return;
|
|
7841
8101
|
}
|
|
7842
|
-
|
|
7843
|
-
|
|
7844
|
-
|
|
8102
|
+
if (!isPendingDep && suspense.pendingBranch) {
|
|
8103
|
+
const job = () => {
|
|
8104
|
+
if (instance.isUnmounted || suspense.isUnmounted || !instance.scope.active) return;
|
|
8105
|
+
if (suspense.pendingBranch) queueEffectWithSuspense(job, void 0, suspense);
|
|
8106
|
+
else render(asyncSetupResult);
|
|
8107
|
+
};
|
|
8108
|
+
job.flags = 24;
|
|
8109
|
+
queueEffectWithSuspense(job, void 0, suspense);
|
|
8110
|
+
return;
|
|
8111
|
+
}
|
|
8112
|
+
render(asyncSetupResult);
|
|
8113
|
+
if (isPendingDep && --suspense.deps === 0) suspense.resolve();
|
|
7845
8114
|
});
|
|
7846
8115
|
},
|
|
7847
8116
|
unmount(parentSuspense, doRemove) {
|
|
7848
8117
|
suspense.isUnmounted = true;
|
|
8118
|
+
clearTimeout(suspense.timeoutTimer);
|
|
8119
|
+
suspense.timeoutTimer = void 0;
|
|
8120
|
+
if (parentSuspenseId !== void 0) {
|
|
8121
|
+
const parent = suspense.parent;
|
|
8122
|
+
const pendingId = parentSuspenseId;
|
|
8123
|
+
parentSuspenseId = void 0;
|
|
8124
|
+
queuePostFlushCb(() => {
|
|
8125
|
+
if (parent.pendingId === pendingId && !parent.isUnmounted && --parent.deps === 0) parent.resolve();
|
|
8126
|
+
});
|
|
8127
|
+
}
|
|
7849
8128
|
if (suspense.activeBranch) unmount(suspense.activeBranch, parentComponent, parentSuspense, doRemove);
|
|
7850
|
-
if (suspense.pendingBranch)
|
|
8129
|
+
if (suspense.pendingBranch) {
|
|
8130
|
+
unmount(suspense.pendingBranch, parentComponent, suspense, doRemove);
|
|
8131
|
+
discardEffects(suspense);
|
|
8132
|
+
}
|
|
7851
8133
|
}
|
|
7852
8134
|
};
|
|
7853
8135
|
return suspense;
|
|
@@ -7888,6 +8170,14 @@ function normalizeSuspenseSlot(s) {
|
|
|
7888
8170
|
if (block && !s.dynamicChildren) s.dynamicChildren = block.filter((c) => c !== s);
|
|
7889
8171
|
return s;
|
|
7890
8172
|
}
|
|
8173
|
+
function discardEffects(suspense) {
|
|
8174
|
+
const { effects } = suspense;
|
|
8175
|
+
for (let i = 0; i < effects.length; i++) {
|
|
8176
|
+
const effect = effects[i];
|
|
8177
|
+
if (effect.flags & 8) queuePostFlushCb(effect);
|
|
8178
|
+
}
|
|
8179
|
+
effects.length = 0;
|
|
8180
|
+
}
|
|
7891
8181
|
function queueEffectWithSuspense(fn, id, suspense) {
|
|
7892
8182
|
if (suspense && suspense.pendingBranch) {
|
|
7893
8183
|
if (isArray(fn)) suspense.effects.push(...fn);
|
|
@@ -8112,7 +8402,8 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
|
|
|
8112
8402
|
}
|
|
8113
8403
|
function guardReactiveProps(props) {
|
|
8114
8404
|
if (!props) return null;
|
|
8115
|
-
|
|
8405
|
+
if (/* @__PURE__ */ isProxy(props)) return extend({}, props);
|
|
8406
|
+
return isInternalObject(props) ? extend({}, props[rawAttrsKey] || props) : props;
|
|
8116
8407
|
}
|
|
8117
8408
|
function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
|
|
8118
8409
|
const { props, ref, patchFlag, children, transition } = vnode;
|
|
@@ -8498,7 +8789,8 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
8498
8789
|
setInSSRSetupState(false);
|
|
8499
8790
|
}
|
|
8500
8791
|
}).catch((e) => {
|
|
8501
|
-
handleError(e, instance, 0);
|
|
8792
|
+
handleError(e, instance, 0, void 0, true);
|
|
8793
|
+
instance.ssrRender = (_, push) => push("<!---->");
|
|
8502
8794
|
});
|
|
8503
8795
|
else {
|
|
8504
8796
|
instance.asyncDep = setupResult;
|
|
@@ -8567,11 +8859,16 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
8567
8859
|
else warn$1(`Component is missing template or render function: `, Component);
|
|
8568
8860
|
}
|
|
8569
8861
|
}
|
|
8862
|
+
/**
|
|
8863
|
+
* Read through the setup context `attrs` proxy to get the raw attrs object.
|
|
8864
|
+
* @internal
|
|
8865
|
+
*/
|
|
8866
|
+
const rawAttrsKey = Symbol();
|
|
8570
8867
|
const attrsProxyHandlers = {
|
|
8571
8868
|
get(target, key) {
|
|
8572
8869
|
markAttrsAccessed();
|
|
8573
8870
|
track(target, "get", "");
|
|
8574
|
-
return target[key];
|
|
8871
|
+
return key === rawAttrsKey ? target : target[key];
|
|
8575
8872
|
},
|
|
8576
8873
|
set() {
|
|
8577
8874
|
warn$1(`setupContext.attrs is readonly.`);
|
|
@@ -8869,7 +9166,7 @@ function isMemoSame(cached, memo) {
|
|
|
8869
9166
|
}
|
|
8870
9167
|
//#endregion
|
|
8871
9168
|
//#region packages/runtime-core/src/index.ts
|
|
8872
|
-
const version = "3.6.0-rc.
|
|
9169
|
+
const version = "3.6.0-rc.15";
|
|
8873
9170
|
const warn = warn$1;
|
|
8874
9171
|
/**
|
|
8875
9172
|
* Runtime error messages. Only exposed in dev or esm builds.
|
|
@@ -9690,7 +9987,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
9690
9987
|
}
|
|
9691
9988
|
this._styleAnchors.delete(this._def);
|
|
9692
9989
|
this._applyStyles(newStyles);
|
|
9693
|
-
|
|
9990
|
+
this._instance = null;
|
|
9694
9991
|
this._update();
|
|
9695
9992
|
};
|
|
9696
9993
|
const dispatch = (event, args) => {
|
|
@@ -10303,15 +10600,15 @@ const vModelSelect = {
|
|
|
10303
10600
|
vModelSelectInit(el, value, number);
|
|
10304
10601
|
el[assignKey] = getModelAssigner(vnode);
|
|
10305
10602
|
},
|
|
10306
|
-
mounted(el, { value }) {
|
|
10307
|
-
vModelSetSelected(el, value);
|
|
10603
|
+
mounted(el, { value, modifiers: { number } }) {
|
|
10604
|
+
vModelSetSelected(el, value, number);
|
|
10308
10605
|
},
|
|
10309
10606
|
beforeUpdate(el, { value }, vnode) {
|
|
10310
10607
|
el._modelValue = value;
|
|
10311
10608
|
el[assignKey] = getModelAssigner(vnode);
|
|
10312
10609
|
},
|
|
10313
|
-
updated(el, { value }) {
|
|
10314
|
-
vModelSetSelected(el, value);
|
|
10610
|
+
updated(el, { value, modifiers: { number } }) {
|
|
10611
|
+
vModelSetSelected(el, value, number);
|
|
10315
10612
|
}
|
|
10316
10613
|
};
|
|
10317
10614
|
/**
|
|
@@ -10346,14 +10643,14 @@ function isSameSelectValue(value, assignedValue, multiple) {
|
|
|
10346
10643
|
/**
|
|
10347
10644
|
* @internal
|
|
10348
10645
|
*/
|
|
10349
|
-
const vModelSetSelected = (el, value) => {
|
|
10646
|
+
const vModelSetSelected = (el, value, number = false) => {
|
|
10350
10647
|
el._modelValue = value;
|
|
10351
10648
|
const pending = el._pendingValue;
|
|
10352
10649
|
el._pendingValue = void 0;
|
|
10353
10650
|
if (pending && pending[0] === el.multiple && isSameSelectValue(value, pending[1], pending[0])) return;
|
|
10354
|
-
setSelected(el, value);
|
|
10651
|
+
setSelected(el, value, number);
|
|
10355
10652
|
};
|
|
10356
|
-
function setSelected(el, value) {
|
|
10653
|
+
function setSelected(el, value, number) {
|
|
10357
10654
|
const isMultiple = el.multiple;
|
|
10358
10655
|
const isArrayValue = isArray(value);
|
|
10359
10656
|
if (isMultiple && !isArrayValue && !isSet(value)) {
|
|
@@ -10368,7 +10665,7 @@ function setSelected(el, value) {
|
|
|
10368
10665
|
const optionType = typeof optionValue;
|
|
10369
10666
|
if (optionType === "string" || optionType === "number") option.selected = value.some((v) => String(v) === String(optionValue));
|
|
10370
10667
|
else option.selected = looseIndexOf(value, optionValue) > -1;
|
|
10371
|
-
} else option.selected = value.has(optionValue);
|
|
10668
|
+
} else option.selected = value.has(optionValue) || number && typeof optionValue === "string" && value.has(looseToNumber(optionValue));
|
|
10372
10669
|
} else if (looseEqual(getValue(option), value)) {
|
|
10373
10670
|
if (el.selectedIndex !== i) el.selectedIndex = i;
|
|
10374
10671
|
return;
|