@vue/runtime-dom 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/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 +507 -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 +507 -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
|
**/
|
|
@@ -60,10 +60,18 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
60
60
|
const isReservedProp = /*@__PURE__*/ makeMap(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");
|
|
61
61
|
const isBuiltInTag = /*#__PURE__*/ makeMap("slot,component");
|
|
62
62
|
const isBuiltInDirective = /*@__PURE__*/ makeMap("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo");
|
|
63
|
+
const STRING_CACHE_MAX_SIZE = 1e4;
|
|
63
64
|
const cacheStringFunction = (fn) => {
|
|
64
|
-
|
|
65
|
+
let cache = Object.create(null);
|
|
66
|
+
let size = 0;
|
|
65
67
|
return ((str) => {
|
|
66
|
-
|
|
68
|
+
const hit = cache[str];
|
|
69
|
+
if (hit !== void 0) return hit;
|
|
70
|
+
if (++size > STRING_CACHE_MAX_SIZE) {
|
|
71
|
+
cache = Object.create(null);
|
|
72
|
+
size = 1;
|
|
73
|
+
}
|
|
74
|
+
return cache[str] = fn(str);
|
|
67
75
|
});
|
|
68
76
|
};
|
|
69
77
|
const camelizeRE = /-(\w)/g;
|
|
@@ -71,22 +79,22 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
71
79
|
/**
|
|
72
80
|
* @private
|
|
73
81
|
*/
|
|
74
|
-
const camelize = cacheStringFunction((str) => str.replace(camelizeRE, camelizeReplacer));
|
|
82
|
+
const camelize = /*@__PURE__*/ cacheStringFunction((str) => str.replace(camelizeRE, camelizeReplacer));
|
|
75
83
|
const hyphenateRE = /\B([A-Z])/g;
|
|
76
84
|
/**
|
|
77
85
|
* @private
|
|
78
86
|
*/
|
|
79
|
-
const hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
|
|
87
|
+
const hyphenate = /*@__PURE__*/ cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
|
|
80
88
|
/**
|
|
81
89
|
* @private
|
|
82
90
|
*/
|
|
83
|
-
const capitalize = cacheStringFunction((str) => {
|
|
91
|
+
const capitalize = /*@__PURE__*/ cacheStringFunction((str) => {
|
|
84
92
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
85
93
|
});
|
|
86
94
|
/**
|
|
87
95
|
* @private
|
|
88
96
|
*/
|
|
89
|
-
const toHandlerKey = cacheStringFunction((str) => {
|
|
97
|
+
const toHandlerKey = /*@__PURE__*/ cacheStringFunction((str) => {
|
|
90
98
|
return str ? `on${capitalize(str)}` : ``;
|
|
91
99
|
});
|
|
92
100
|
/**
|
|
@@ -212,26 +220,11 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
212
220
|
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
213
221
|
*/
|
|
214
222
|
const isMathMLTag = /*@__PURE__*/ makeMap(MATH_TAGS);
|
|
215
|
-
|
|
216
|
-
//#region packages/shared/src/domAttrConfig.ts
|
|
217
|
-
/**
|
|
218
|
-
* On the client we only need to offer special cases for boolean attributes that
|
|
219
|
-
* have different names from their corresponding dom properties:
|
|
220
|
-
* - itemscope -> N/A
|
|
221
|
-
* - allowfullscreen -> allowFullscreen
|
|
222
|
-
* - formnovalidate -> formNoValidate
|
|
223
|
-
* - ismap -> isMap
|
|
224
|
-
* - nomodule -> noModule
|
|
225
|
-
* - novalidate -> noValidate
|
|
226
|
-
* - playsinline -> playsInline
|
|
227
|
-
* - readonly -> readOnly
|
|
228
|
-
*/
|
|
229
|
-
const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;
|
|
230
|
-
const isSpecialBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs);
|
|
223
|
+
const isSpecialBooleanAttr = /*@__PURE__*/ makeMap("itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly");
|
|
231
224
|
/**
|
|
232
225
|
* The full list is needed during SSR to produce the correct initial markup.
|
|
233
226
|
*/
|
|
234
|
-
const isBooleanAttr = /*@__PURE__*/ makeMap(
|
|
227
|
+
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");
|
|
235
228
|
/**
|
|
236
229
|
* Boolean attributes should be included if the value is truthy or ''.
|
|
237
230
|
* e.g. `<select multiple>` compiles to `{ multiple: '' }`
|
|
@@ -442,40 +435,16 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
442
435
|
}
|
|
443
436
|
return true;
|
|
444
437
|
}
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
function onTrigger(sub) {
|
|
452
|
-
if (sub.onTrigger) {
|
|
453
|
-
const debugInfo = triggerEventInfos[triggerEventInfos.length - 1];
|
|
454
|
-
sub.onTrigger(extend({ effect: sub }, debugInfo));
|
|
455
|
-
}
|
|
438
|
+
/**
|
|
439
|
+
* The data of a comment opening a range only a vapor server render emits:
|
|
440
|
+
* `<!--{-->` around the render of a component, or a v-if branch's.
|
|
441
|
+
*/
|
|
442
|
+
function isVaporRangeStart(data) {
|
|
443
|
+
return data === "{" || isVaporBranchStart(data);
|
|
456
444
|
}
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
return this._onTrigger;
|
|
461
|
-
},
|
|
462
|
-
set(val) {
|
|
463
|
-
if (val && !this._onTrigger) setupFlagsHandler(this);
|
|
464
|
-
this._onTrigger = val;
|
|
465
|
-
}
|
|
466
|
-
});
|
|
467
|
-
}
|
|
468
|
-
function setupFlagsHandler(target) {
|
|
469
|
-
target._flags = target.flags;
|
|
470
|
-
Object.defineProperty(target, "flags", {
|
|
471
|
-
get() {
|
|
472
|
-
return target._flags;
|
|
473
|
-
},
|
|
474
|
-
set(value) {
|
|
475
|
-
if (!(target._flags & 48) && !!(value & 48)) onTrigger(this);
|
|
476
|
-
target._flags = value;
|
|
477
|
-
}
|
|
478
|
-
});
|
|
445
|
+
/** The data of the comment closing the range `open` opens. */
|
|
446
|
+
function rangeCloseOf(open) {
|
|
447
|
+
return open === "(" ? ")" : open === "{" ? "}" : "]";
|
|
479
448
|
}
|
|
480
449
|
//#endregion
|
|
481
450
|
//#region packages/reactivity/src/warning.ts
|
|
@@ -487,13 +456,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
487
456
|
const notifyBuffer = [];
|
|
488
457
|
let batchDepth = 0;
|
|
489
458
|
let activeSub = void 0;
|
|
490
|
-
|
|
491
|
-
function incRunDepth() {
|
|
492
|
-
++runDepth;
|
|
493
|
-
}
|
|
494
|
-
function decRunDepth() {
|
|
495
|
-
--runDepth;
|
|
496
|
-
}
|
|
459
|
+
const CHECKING = 512;
|
|
497
460
|
let globalVersion = 0;
|
|
498
461
|
let notifyIndex = 0;
|
|
499
462
|
let notifyBufferLength = 0;
|
|
@@ -542,6 +505,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
542
505
|
const nextDep = link.nextDep;
|
|
543
506
|
const nextSub = link.nextSub;
|
|
544
507
|
const prevSub = link.prevSub;
|
|
508
|
+
link.prevDep = link.nextDep = link.prevSub = link.nextSub = void 0;
|
|
545
509
|
if (nextDep !== void 0) nextDep.prevDep = prevDep;
|
|
546
510
|
else sub.depsTail = prevDep;
|
|
547
511
|
if (prevDep !== void 0) prevDep.nextDep = nextDep;
|
|
@@ -549,7 +513,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
549
513
|
if (nextSub !== void 0) nextSub.prevSub = prevSub;
|
|
550
514
|
else dep.subsTail = prevSub;
|
|
551
515
|
if (prevSub !== void 0) prevSub.nextSub = nextSub;
|
|
552
|
-
else if ((dep.subs = nextSub) === void 0) {
|
|
516
|
+
else if ((dep.subs = nextSub) === void 0 && dep.flags & 1) {
|
|
553
517
|
let toRemove = dep.deps;
|
|
554
518
|
if (toRemove !== void 0) {
|
|
555
519
|
do
|
|
@@ -567,14 +531,12 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
567
531
|
const sub = link.sub;
|
|
568
532
|
let flags = sub.flags;
|
|
569
533
|
if (flags & 3) {
|
|
570
|
-
if (!(flags &
|
|
571
|
-
|
|
572
|
-
if (runDepth) sub.flags |= 8;
|
|
573
|
-
} else if (!(flags & 12)) flags = 0;
|
|
534
|
+
if (!(flags & 44)) sub.flags = flags | 32;
|
|
535
|
+
else if (!(flags & 12)) flags = 0;
|
|
574
536
|
else if (!(flags & 4)) sub.flags = flags & -9 | 32;
|
|
575
537
|
else if (!(flags & 48) && isValidLink(link, sub)) {
|
|
576
538
|
sub.flags = flags | 40;
|
|
577
|
-
flags
|
|
539
|
+
flags = sub === activeSub || activeSub === void 0 ? 0 : flags & 1;
|
|
578
540
|
} else flags = 0;
|
|
579
541
|
if (flags & 2) notifyBuffer[notifyBufferLength++] = sub;
|
|
580
542
|
if (flags & 1) {
|
|
@@ -610,7 +572,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
610
572
|
function startTracking(sub) {
|
|
611
573
|
++globalVersion;
|
|
612
574
|
sub.depsTail = void 0;
|
|
613
|
-
sub.flags = sub.flags & -
|
|
575
|
+
sub.flags = sub.flags & -569 | 4;
|
|
614
576
|
return setActiveSub(sub);
|
|
615
577
|
}
|
|
616
578
|
function endTracking(sub, prevSub) {
|
|
@@ -618,8 +580,11 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
618
580
|
activeSub = prevSub;
|
|
619
581
|
const depsTail = sub.depsTail;
|
|
620
582
|
let toRemove = depsTail !== void 0 ? depsTail.nextDep : sub.deps;
|
|
621
|
-
while (toRemove !== void 0)
|
|
622
|
-
|
|
583
|
+
while (toRemove !== void 0) {
|
|
584
|
+
unlink(toRemove, sub);
|
|
585
|
+
toRemove = depsTail !== void 0 ? depsTail.nextDep : sub.deps;
|
|
586
|
+
}
|
|
587
|
+
if ((sub.flags &= -5) & 8) markRecursed(sub);
|
|
623
588
|
}
|
|
624
589
|
function flush() {
|
|
625
590
|
let hasError = false;
|
|
@@ -641,45 +606,67 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
641
606
|
if (hasError) throw error;
|
|
642
607
|
}
|
|
643
608
|
function checkDirty(link, sub) {
|
|
609
|
+
try {
|
|
610
|
+
return walkDirty(link, sub);
|
|
611
|
+
} catch (err) {
|
|
612
|
+
markStale(sub);
|
|
613
|
+
throw err;
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
function walkDirty(link, sub) {
|
|
617
|
+
const root = sub;
|
|
644
618
|
let stack;
|
|
645
619
|
let checkDepth = 0;
|
|
620
|
+
let staleDepth = 0;
|
|
621
|
+
let staleFloor = 0;
|
|
646
622
|
top: do {
|
|
647
623
|
const dep = link.dep;
|
|
648
624
|
const depFlags = dep.flags;
|
|
649
625
|
let dirty = false;
|
|
650
626
|
if (sub.flags & 16) dirty = true;
|
|
651
627
|
else if ((depFlags & 17) === 17) {
|
|
652
|
-
const subs = dep.subs;
|
|
653
628
|
if (dep.update()) {
|
|
654
|
-
|
|
629
|
+
const subs = dep.subs;
|
|
630
|
+
if (subs !== void 0 && (subs !== link || subs.nextSub !== void 0)) shallowPropagate(subs);
|
|
655
631
|
dirty = true;
|
|
656
632
|
}
|
|
657
633
|
} else if ((depFlags & 33) === 33) {
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
634
|
+
const depth = dep === root ? 0 : depFlags & CHECKING ? checkingDepth(dep, stack, checkDepth) : -1;
|
|
635
|
+
if (depth < 0) {
|
|
636
|
+
if (link.nextSub !== void 0 || link.prevSub !== void 0) dep.flags = depFlags | CHECKING;
|
|
637
|
+
stack = {
|
|
638
|
+
value: link,
|
|
639
|
+
prev: stack
|
|
640
|
+
};
|
|
641
|
+
link = dep.deps;
|
|
642
|
+
sub = dep;
|
|
643
|
+
++checkDepth;
|
|
644
|
+
continue;
|
|
645
|
+
}
|
|
646
|
+
if (depth < checkDepth) {
|
|
647
|
+
staleFloor = staleDepth && staleFloor < depth ? staleFloor : depth;
|
|
648
|
+
staleDepth = checkDepth;
|
|
649
|
+
}
|
|
666
650
|
}
|
|
667
651
|
if (!dirty && link.nextDep !== void 0) {
|
|
668
652
|
link = link.nextDep;
|
|
669
653
|
continue;
|
|
670
654
|
}
|
|
671
655
|
while (checkDepth) {
|
|
656
|
+
const stale = checkDepth === staleDepth;
|
|
657
|
+
if (stale && --staleDepth === staleFloor) staleDepth = 0;
|
|
672
658
|
--checkDepth;
|
|
673
659
|
link = stack.value;
|
|
674
660
|
stack = stack.prev;
|
|
675
661
|
if (dirty) {
|
|
676
|
-
const subs = sub.subs;
|
|
677
662
|
if (sub.update()) {
|
|
678
|
-
|
|
663
|
+
const subs = sub.subs;
|
|
664
|
+
if (subs !== void 0 && (subs !== link || subs.nextSub !== void 0)) shallowPropagate(subs);
|
|
679
665
|
sub = link.sub;
|
|
680
666
|
continue;
|
|
681
667
|
}
|
|
682
|
-
} else sub.flags
|
|
668
|
+
} else if (stale) sub.flags = sub.flags & -545 | 16;
|
|
669
|
+
else sub.flags &= -545;
|
|
683
670
|
sub = link.sub;
|
|
684
671
|
if (link.nextDep !== void 0) {
|
|
685
672
|
link = link.nextDep;
|
|
@@ -687,9 +674,21 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
687
674
|
}
|
|
688
675
|
dirty = false;
|
|
689
676
|
}
|
|
690
|
-
return dirty && !!sub.flags;
|
|
677
|
+
return (dirty || !!(sub.flags & 16)) && !!sub.flags;
|
|
691
678
|
} while (true);
|
|
692
679
|
}
|
|
680
|
+
function checkingDepth(dep, stack, depth) {
|
|
681
|
+
for (; stack !== void 0; stack = stack.prev, --depth) if (stack.value.dep === dep) return depth;
|
|
682
|
+
return -1;
|
|
683
|
+
}
|
|
684
|
+
function markStale(sub) {
|
|
685
|
+
const nodes = [sub];
|
|
686
|
+
do {
|
|
687
|
+
sub = nodes.pop();
|
|
688
|
+
sub.flags = sub.flags & -33 | 16;
|
|
689
|
+
for (let link = sub.deps; link !== void 0; link = link.nextDep) if (link.dep.flags & 32) nodes.push(link.dep);
|
|
690
|
+
} while (nodes.length);
|
|
691
|
+
}
|
|
693
692
|
function shallowPropagate(link) {
|
|
694
693
|
do {
|
|
695
694
|
const sub = link.sub;
|
|
@@ -707,6 +706,71 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
707
706
|
}
|
|
708
707
|
return false;
|
|
709
708
|
}
|
|
709
|
+
function markRecursed(sub) {
|
|
710
|
+
const nodes = [sub];
|
|
711
|
+
do {
|
|
712
|
+
sub = nodes.pop();
|
|
713
|
+
for (let link = sub.deps; link !== void 0; link = link.nextDep) {
|
|
714
|
+
const dep = link.dep;
|
|
715
|
+
if ((dep.flags & 40) === 32) {
|
|
716
|
+
dep.flags |= 8;
|
|
717
|
+
nodes.push(dep);
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
} while (nodes.length);
|
|
721
|
+
}
|
|
722
|
+
//#endregion
|
|
723
|
+
//#region packages/reactivity/src/debug.ts
|
|
724
|
+
const triggered = [];
|
|
725
|
+
function onTrack(sub, debugInfo) {
|
|
726
|
+
if (sub.onTrack) sub.onTrack(extend({ effect: sub }, debugInfo));
|
|
727
|
+
}
|
|
728
|
+
function onTrigger(sub, debugInfo) {
|
|
729
|
+
if (sub.onTrigger) sub.onTrigger(extend({ effect: sub }, debugInfo));
|
|
730
|
+
}
|
|
731
|
+
function startTrigger() {
|
|
732
|
+
triggered.push([]);
|
|
733
|
+
}
|
|
734
|
+
function endTrigger(debugInfo) {
|
|
735
|
+
const subs = triggered.pop();
|
|
736
|
+
if (subs.length) {
|
|
737
|
+
startBatch();
|
|
738
|
+
try {
|
|
739
|
+
for (let i = 0; i < subs.length; i++) {
|
|
740
|
+
const sub = subs[i];
|
|
741
|
+
if (sub.flags & 3) onTrigger(sub, debugInfo);
|
|
742
|
+
}
|
|
743
|
+
} finally {
|
|
744
|
+
endBatch();
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
function setupOnTrigger(target) {
|
|
749
|
+
Object.defineProperty(target.prototype, "onTrigger", {
|
|
750
|
+
get() {
|
|
751
|
+
return this._onTrigger;
|
|
752
|
+
},
|
|
753
|
+
set(val) {
|
|
754
|
+
if (val && !this._onTrigger) setupFlagsHandler(this);
|
|
755
|
+
this._onTrigger = val;
|
|
756
|
+
}
|
|
757
|
+
});
|
|
758
|
+
}
|
|
759
|
+
function setupFlagsHandler(target) {
|
|
760
|
+
target._flags = target.flags;
|
|
761
|
+
Object.defineProperty(target, "flags", {
|
|
762
|
+
get() {
|
|
763
|
+
return target._flags;
|
|
764
|
+
},
|
|
765
|
+
set(value) {
|
|
766
|
+
if (!(target._flags & 48) && !!(value & 48)) {
|
|
767
|
+
if (triggered.length) triggered[triggered.length - 1].push(this);
|
|
768
|
+
else onTrigger(this);
|
|
769
|
+
}
|
|
770
|
+
target._flags = value;
|
|
771
|
+
}
|
|
772
|
+
});
|
|
773
|
+
}
|
|
710
774
|
//#endregion
|
|
711
775
|
//#region packages/reactivity/src/dep.ts
|
|
712
776
|
var Dep = class {
|
|
@@ -766,20 +830,12 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
766
830
|
if (!depsMap) return;
|
|
767
831
|
const run = (dep) => {
|
|
768
832
|
if (dep !== void 0 && dep.subs !== void 0) {
|
|
769
|
-
triggerEventInfos.push({
|
|
770
|
-
target,
|
|
771
|
-
type,
|
|
772
|
-
key,
|
|
773
|
-
newValue,
|
|
774
|
-
oldValue,
|
|
775
|
-
oldTarget
|
|
776
|
-
});
|
|
777
833
|
propagate(dep.subs);
|
|
778
834
|
shallowPropagate(dep.subs);
|
|
779
|
-
triggerEventInfos.pop();
|
|
780
835
|
}
|
|
781
836
|
};
|
|
782
837
|
startBatch();
|
|
838
|
+
startTrigger();
|
|
783
839
|
if (type === "clear") depsMap.forEach(run);
|
|
784
840
|
else {
|
|
785
841
|
const targetIsArray = isArray(target);
|
|
@@ -809,6 +865,14 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
809
865
|
}
|
|
810
866
|
}
|
|
811
867
|
}
|
|
868
|
+
endTrigger({
|
|
869
|
+
target,
|
|
870
|
+
type,
|
|
871
|
+
key,
|
|
872
|
+
newValue,
|
|
873
|
+
oldValue,
|
|
874
|
+
oldTarget
|
|
875
|
+
});
|
|
812
876
|
endBatch();
|
|
813
877
|
}
|
|
814
878
|
function getDepFromReactive(object, key) {
|
|
@@ -1023,7 +1087,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
1023
1087
|
//#endregion
|
|
1024
1088
|
//#region packages/reactivity/src/baseHandlers.ts
|
|
1025
1089
|
const isNonTrackableKeys = /*@__PURE__*/ makeMap(`__proto__,__v_isRef,__isVue`);
|
|
1026
|
-
const builtInSymbols = new Set(/*@__PURE__*/ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol));
|
|
1090
|
+
const builtInSymbols = /*@__PURE__*/ new Set(/*@__PURE__*/ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol));
|
|
1027
1091
|
function hasOwnProperty(key) {
|
|
1028
1092
|
if (!isSymbol(key)) key = String(key);
|
|
1029
1093
|
const obj = /* @__PURE__ */ toRaw(this);
|
|
@@ -1607,16 +1671,16 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
1607
1671
|
this._value = !useDirectValue && this._wrap ? this._wrap(newValue) : newValue;
|
|
1608
1672
|
const subs = this.subs;
|
|
1609
1673
|
if (subs !== void 0) {
|
|
1610
|
-
|
|
1674
|
+
startTrigger();
|
|
1675
|
+
propagate(subs);
|
|
1676
|
+
endTrigger({
|
|
1611
1677
|
target: this,
|
|
1612
1678
|
type: "set",
|
|
1613
1679
|
key: "value",
|
|
1614
1680
|
newValue,
|
|
1615
1681
|
oldValue
|
|
1616
1682
|
});
|
|
1617
|
-
propagate(subs);
|
|
1618
1683
|
if (!batchDepth) flush();
|
|
1619
|
-
triggerEventInfos.pop();
|
|
1620
1684
|
}
|
|
1621
1685
|
}
|
|
1622
1686
|
}
|
|
@@ -1653,8 +1717,10 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
1653
1717
|
function triggerRef(ref) {
|
|
1654
1718
|
const dep = ref.dep;
|
|
1655
1719
|
if (dep !== void 0 && dep.subs !== void 0) {
|
|
1720
|
+
startTrigger();
|
|
1656
1721
|
propagate(dep.subs);
|
|
1657
1722
|
shallowPropagate(dep.subs);
|
|
1723
|
+
endTrigger();
|
|
1658
1724
|
if (!batchDepth) flush();
|
|
1659
1725
|
}
|
|
1660
1726
|
}
|
|
@@ -1845,6 +1911,10 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
1845
1911
|
get active() {
|
|
1846
1912
|
return !(this.flags & 1024);
|
|
1847
1913
|
}
|
|
1914
|
+
/** @internal */
|
|
1915
|
+
get running() {
|
|
1916
|
+
return !!(this.flags & 4);
|
|
1917
|
+
}
|
|
1848
1918
|
pause() {
|
|
1849
1919
|
this.flags |= 256;
|
|
1850
1920
|
}
|
|
@@ -1858,11 +1928,9 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
1858
1928
|
if (!this.active) return this.fn();
|
|
1859
1929
|
cleanup(this);
|
|
1860
1930
|
const prevSub = startTracking(this);
|
|
1861
|
-
incRunDepth();
|
|
1862
1931
|
try {
|
|
1863
1932
|
return this.fn();
|
|
1864
1933
|
} finally {
|
|
1865
|
-
decRunDepth();
|
|
1866
1934
|
endTracking(this, prevSub);
|
|
1867
1935
|
const flags = this.flags;
|
|
1868
1936
|
if ((flags & 136) === 136) {
|
|
@@ -1885,9 +1953,9 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
1885
1953
|
if (flags & 16) return true;
|
|
1886
1954
|
if (flags & 32) {
|
|
1887
1955
|
if (checkDirty(this.deps, this)) {
|
|
1888
|
-
this.
|
|
1956
|
+
if (this.active) this.flags |= 16;
|
|
1889
1957
|
return true;
|
|
1890
|
-
} else this.flags
|
|
1958
|
+
} else this.flags &= -33;
|
|
1891
1959
|
}
|
|
1892
1960
|
return false;
|
|
1893
1961
|
}
|
|
@@ -1899,20 +1967,17 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
1899
1967
|
if (options) {
|
|
1900
1968
|
const { onStop, scheduler } = options;
|
|
1901
1969
|
if (onStop) {
|
|
1902
|
-
options.onStop = void 0;
|
|
1903
1970
|
const stop = e.stop.bind(e);
|
|
1904
1971
|
e.stop = () => {
|
|
1905
1972
|
stop();
|
|
1906
1973
|
onStop();
|
|
1907
1974
|
};
|
|
1908
1975
|
}
|
|
1909
|
-
if (scheduler) {
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
}
|
|
1915
|
-
extend(e, options);
|
|
1976
|
+
if (scheduler) e.notify = () => {
|
|
1977
|
+
if (!(e.flags & 1280)) scheduler();
|
|
1978
|
+
};
|
|
1979
|
+
e.onTrack = options.onTrack;
|
|
1980
|
+
e.onTrigger = options.onTrigger;
|
|
1916
1981
|
}
|
|
1917
1982
|
try {
|
|
1918
1983
|
e.run();
|
|
@@ -1972,8 +2037,10 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
1972
2037
|
const flags = this.flags;
|
|
1973
2038
|
if (flags & 256) {
|
|
1974
2039
|
this.flags = flags & -257;
|
|
1975
|
-
|
|
1976
|
-
|
|
2040
|
+
const deps = [];
|
|
2041
|
+
for (let link = this.deps; link !== void 0; link = link.nextDep) deps.push(link.dep);
|
|
2042
|
+
for (let i = 0; i < deps.length; i++) {
|
|
2043
|
+
const dep = deps[i];
|
|
1977
2044
|
if ("resume" in dep) dep.resume();
|
|
1978
2045
|
}
|
|
1979
2046
|
}
|
|
@@ -2002,8 +2069,10 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
2002
2069
|
while (dep !== void 0) {
|
|
2003
2070
|
const node = dep.dep;
|
|
2004
2071
|
if ("stop" in node) {
|
|
2005
|
-
|
|
2072
|
+
const prev = dep.prevDep;
|
|
2006
2073
|
node.stop();
|
|
2074
|
+
const next = prev !== void 0 ? prev.nextDep : this.deps;
|
|
2075
|
+
dep = next === dep ? dep.nextDep : next;
|
|
2007
2076
|
} else dep = unlink(dep, this);
|
|
2008
2077
|
}
|
|
2009
2078
|
cleanup(this);
|
|
@@ -2044,11 +2113,14 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
2044
2113
|
* @see {@link https://vuejs.org/api/reactivity-advanced.html#onscopedispose}
|
|
2045
2114
|
*/
|
|
2046
2115
|
function onScopeDispose(fn, failSilently = false) {
|
|
2047
|
-
if (activeEffectScope !== void 0)
|
|
2048
|
-
|
|
2116
|
+
if (activeEffectScope !== void 0) {
|
|
2117
|
+
if (activeEffectScope.active) activeEffectScope.cleanups[activeEffectScope.cleanupsLength++] = fn;
|
|
2118
|
+
else fn();
|
|
2119
|
+
} else if (!failSilently) warn$2("onScopeDispose() is called when there is no active effect scope to be associated with.");
|
|
2049
2120
|
}
|
|
2050
2121
|
//#endregion
|
|
2051
2122
|
//#region packages/reactivity/src/computed.ts
|
|
2123
|
+
const FAILED = 64;
|
|
2052
2124
|
/**
|
|
2053
2125
|
* @private exported by @vue/reactivity for Vue core use, but not exported from
|
|
2054
2126
|
* the main vue package
|
|
@@ -2097,12 +2169,24 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
2097
2169
|
}
|
|
2098
2170
|
get value() {
|
|
2099
2171
|
const flags = this.flags;
|
|
2100
|
-
|
|
2101
|
-
if (this.
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2172
|
+
try {
|
|
2173
|
+
if (flags & 16 || flags & 32 && checkDirty(this.deps, this)) {
|
|
2174
|
+
if (this.update()) {
|
|
2175
|
+
const subs = this.subs;
|
|
2176
|
+
if (subs !== void 0) shallowPropagate(subs);
|
|
2177
|
+
}
|
|
2178
|
+
} else if (flags & 32) this.flags = flags & -33;
|
|
2179
|
+
} catch (err) {
|
|
2180
|
+
if (activeSub !== void 0) {
|
|
2181
|
+
onTrack(activeSub, {
|
|
2182
|
+
target: this,
|
|
2183
|
+
type: "get",
|
|
2184
|
+
key: "value"
|
|
2185
|
+
});
|
|
2186
|
+
link(this, activeSub);
|
|
2187
|
+
} else if (activeEffectScope !== void 0) link(this, activeEffectScope);
|
|
2188
|
+
throw err;
|
|
2189
|
+
}
|
|
2106
2190
|
if (activeSub !== void 0) {
|
|
2107
2191
|
onTrack(activeSub, {
|
|
2108
2192
|
target: this,
|
|
@@ -2110,7 +2194,18 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
2110
2194
|
key: "value"
|
|
2111
2195
|
});
|
|
2112
2196
|
link(this, activeSub);
|
|
2113
|
-
} else if (activeEffectScope !== void 0)
|
|
2197
|
+
} else if (activeEffectScope !== void 0) {
|
|
2198
|
+
if (activeEffectScope.active) link(this, activeEffectScope);
|
|
2199
|
+
else if (this.subs === void 0) {
|
|
2200
|
+
let dep = this.deps;
|
|
2201
|
+
if (dep !== void 0) {
|
|
2202
|
+
do
|
|
2203
|
+
dep = unlink(dep, this);
|
|
2204
|
+
while (dep !== void 0);
|
|
2205
|
+
this.flags |= 16;
|
|
2206
|
+
}
|
|
2207
|
+
}
|
|
2208
|
+
}
|
|
2114
2209
|
return this._value;
|
|
2115
2210
|
}
|
|
2116
2211
|
set value(newValue) {
|
|
@@ -2122,11 +2217,15 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
2122
2217
|
try {
|
|
2123
2218
|
const oldValue = this._value;
|
|
2124
2219
|
const newValue = this.fn(oldValue);
|
|
2125
|
-
if (hasChanged(oldValue, newValue)) {
|
|
2220
|
+
if (hasChanged(oldValue, newValue) || this.flags & FAILED) {
|
|
2126
2221
|
this._value = newValue;
|
|
2222
|
+
this.flags &= -65;
|
|
2127
2223
|
return true;
|
|
2128
2224
|
}
|
|
2129
2225
|
return false;
|
|
2226
|
+
} catch (err) {
|
|
2227
|
+
this.flags |= FAILED;
|
|
2228
|
+
throw err;
|
|
2130
2229
|
} finally {
|
|
2131
2230
|
endTracking(this, prevSub);
|
|
2132
2231
|
}
|
|
@@ -2147,6 +2246,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
2147
2246
|
cRef.onTrack = debugOptions.onTrack;
|
|
2148
2247
|
cRef.onTrigger = debugOptions.onTrigger;
|
|
2149
2248
|
}
|
|
2249
|
+
if (isSSR && activeEffectScope !== void 0) link(cRef, activeEffectScope);
|
|
2150
2250
|
return cRef;
|
|
2151
2251
|
}
|
|
2152
2252
|
//#endregion
|
|
@@ -2517,7 +2617,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
2517
2617
|
if (isFunction(fn)) {
|
|
2518
2618
|
const res = callWithErrorHandling(fn, instance, type, args);
|
|
2519
2619
|
if (res && isPromise(res)) res.catch((err) => {
|
|
2520
|
-
handleError(err, instance, type);
|
|
2620
|
+
handleError(err, instance, type, void 0, true);
|
|
2521
2621
|
});
|
|
2522
2622
|
return res;
|
|
2523
2623
|
}
|
|
@@ -2527,7 +2627,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
2527
2627
|
return values;
|
|
2528
2628
|
} else warn$1(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}`);
|
|
2529
2629
|
}
|
|
2530
|
-
function handleError(err, instance, type, throwInDev = true) {
|
|
2630
|
+
function handleError(err, instance, type, throwInDev = true, isAsyncError = false) {
|
|
2531
2631
|
const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ;
|
|
2532
2632
|
if (instance) {
|
|
2533
2633
|
let cur = instance.parent;
|
|
@@ -2535,7 +2635,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
2535
2635
|
const errorInfo = ErrorTypeStrings$1[type];
|
|
2536
2636
|
while (cur) {
|
|
2537
2637
|
const errorCapturedHooks = cur.ec;
|
|
2538
|
-
if (errorCapturedHooks) {
|
|
2638
|
+
if (errorCapturedHooks && !cur.isUnmounted && (!isAsyncError || cur.scope.active)) {
|
|
2539
2639
|
for (let i = 0; i < errorCapturedHooks.length; i++) if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) return;
|
|
2540
2640
|
}
|
|
2541
2641
|
cur = cur.parent;
|
|
@@ -2840,7 +2940,11 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
2840
2940
|
updateComponentDef(record.initialDef, newComp);
|
|
2841
2941
|
const instances = [...record.instances];
|
|
2842
2942
|
if (isVapor && newComp.__vapor && !instances.some((instance) => instance.parent && !instance.parent.vapor) && !instances.some((i) => i.ceReload)) {
|
|
2843
|
-
for (const instance of instances)
|
|
2943
|
+
for (const instance of instances) {
|
|
2944
|
+
if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
|
|
2945
|
+
const oldComp = normalizeClassComponent(instance.type);
|
|
2946
|
+
if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
|
|
2947
|
+
}
|
|
2844
2948
|
const dirtyInstances = new Set(instances);
|
|
2845
2949
|
const rerenderedParents = /* @__PURE__ */ new Set();
|
|
2846
2950
|
runWithHmrUpdating(() => {
|
|
@@ -2881,7 +2985,25 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
2881
2985
|
if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
|
|
2882
2986
|
}
|
|
2883
2987
|
parents.forEach((parent) => {
|
|
2884
|
-
|
|
2988
|
+
const children = instances.filter((instance) => instance.parent === parent);
|
|
2989
|
+
const update = () => {
|
|
2990
|
+
if (!parent.scope.active) return;
|
|
2991
|
+
const activeChildren = children.filter((instance) => instance.scope.active);
|
|
2992
|
+
if (!activeChildren.length) return;
|
|
2993
|
+
const pending = activeChildren.find((instance) => instance.asyncDep && !instance.asyncResolved) || locateUnresolvedAsyncRoot(parent);
|
|
2994
|
+
if (pending) {
|
|
2995
|
+
pending.asyncDep.catch(NOOP).then(() => {
|
|
2996
|
+
if (parent.scope.active && (pending.asyncResolved || !pending.scope.active)) queueJob(update);
|
|
2997
|
+
});
|
|
2998
|
+
return;
|
|
2999
|
+
}
|
|
3000
|
+
for (const instance of activeChildren) {
|
|
3001
|
+
const oldComp = normalizeClassComponent(instance.type);
|
|
3002
|
+
let dirtyInstances = hmrDirtyComponents.get(oldComp);
|
|
3003
|
+
if (!dirtyInstances) hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
|
|
3004
|
+
dirtyInstances.add(instance);
|
|
3005
|
+
hmrDirtyComponentsMode.set(oldComp, !!isVapor);
|
|
3006
|
+
}
|
|
2885
3007
|
runWithHmrUpdating(() => {
|
|
2886
3008
|
if (parent.vapor) parent.hmrRerender();
|
|
2887
3009
|
else {
|
|
@@ -2892,7 +3014,12 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
2892
3014
|
}
|
|
2893
3015
|
}
|
|
2894
3016
|
});
|
|
2895
|
-
|
|
3017
|
+
queuePostFlushCb(() => {
|
|
3018
|
+
hmrDirtyComponents.clear();
|
|
3019
|
+
hmrDirtyComponentsMode.clear();
|
|
3020
|
+
});
|
|
3021
|
+
};
|
|
3022
|
+
queueJob(update);
|
|
2896
3023
|
});
|
|
2897
3024
|
}
|
|
2898
3025
|
queuePostFlushCb(() => {
|
|
@@ -3089,18 +3216,35 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
3089
3216
|
return vnode;
|
|
3090
3217
|
}
|
|
3091
3218
|
function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
3092
|
-
|
|
3219
|
+
let hookVNode = vnode;
|
|
3220
|
+
if (name === "beforeMount") vnode._mount = vnode;
|
|
3221
|
+
else if (name === "beforeUpdate") {
|
|
3222
|
+
const mount = prevVNode && prevVNode._mount;
|
|
3223
|
+
if (mount) {
|
|
3224
|
+
mount._latest = vnode;
|
|
3225
|
+
vnode._mount = mount;
|
|
3226
|
+
}
|
|
3227
|
+
} else if (name === "mounted") {
|
|
3228
|
+
const latest = vnode._latest;
|
|
3229
|
+
vnode._mount = vnode._latest = void 0;
|
|
3230
|
+
if (latest) {
|
|
3231
|
+
hookVNode = latest;
|
|
3232
|
+
latest._mount = void 0;
|
|
3233
|
+
}
|
|
3234
|
+
}
|
|
3235
|
+
const bindings = hookVNode.dirs;
|
|
3093
3236
|
const oldBindings = prevVNode && prevVNode.dirs;
|
|
3094
3237
|
for (let i = 0; i < bindings.length; i++) {
|
|
3095
|
-
|
|
3238
|
+
let binding = bindings[i];
|
|
3096
3239
|
if (oldBindings) binding.oldValue = oldBindings[i].value;
|
|
3240
|
+
else if (name === "mounted" && binding.oldValue !== void 0) binding = extend({}, binding, { oldValue: void 0 });
|
|
3097
3241
|
let hook = binding.dir[name];
|
|
3098
3242
|
if (hook) {
|
|
3099
3243
|
const prevSub = setActiveSub();
|
|
3100
3244
|
callWithAsyncErrorHandling(hook, instance, 8, [
|
|
3101
3245
|
vnode.el,
|
|
3102
3246
|
binding,
|
|
3103
|
-
|
|
3247
|
+
hookVNode,
|
|
3104
3248
|
prevVNode
|
|
3105
3249
|
]);
|
|
3106
3250
|
setActiveSub(prevSub);
|
|
@@ -3521,7 +3665,15 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
3521
3665
|
const { mode } = rawProps;
|
|
3522
3666
|
checkTransitionMode(mode);
|
|
3523
3667
|
return prepareTransitionSwitch(instance.subTree, child, rawProps, state, instance, mode === "out-in" ? resumeAfterLeave || (resumeAfterLeave = () => {
|
|
3524
|
-
if (!(instance.effect.flags & 1024))
|
|
3668
|
+
if (!(instance.effect.flags & 1024)) {
|
|
3669
|
+
if (instance.effect.running) {
|
|
3670
|
+
const job = () => {
|
|
3671
|
+
if (!(instance.effect.flags & 1024)) instance.update();
|
|
3672
|
+
};
|
|
3673
|
+
job.i = instance;
|
|
3674
|
+
queueJob(job);
|
|
3675
|
+
} else instance.update();
|
|
3676
|
+
}
|
|
3525
3677
|
}) : NOOP);
|
|
3526
3678
|
};
|
|
3527
3679
|
}
|
|
@@ -3551,7 +3703,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
3551
3703
|
}
|
|
3552
3704
|
return leavingVNodesCache;
|
|
3553
3705
|
}
|
|
3554
|
-
function resolveTransitionHooks(vnode, props, state, instance
|
|
3706
|
+
function resolveTransitionHooks(vnode, props, state, instance) {
|
|
3555
3707
|
const key = String(vnode.key);
|
|
3556
3708
|
const leavingVNodesCache = getLeavingNodesForType(state, vnode);
|
|
3557
3709
|
const hooks = baseResolveTransitionHooks({
|
|
@@ -3574,9 +3726,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
3574
3726
|
}
|
|
3575
3727
|
},
|
|
3576
3728
|
cloneHooks: (vnode) => {
|
|
3577
|
-
|
|
3578
|
-
if (postClone) postClone(hooks);
|
|
3579
|
-
return hooks;
|
|
3729
|
+
return resolveTransitionHooks(vnode, props, state, instance);
|
|
3580
3730
|
}
|
|
3581
3731
|
}, props, state, instance);
|
|
3582
3732
|
if (isVaporInteropEnabled && vnode.type === VaporSlot) extend(hooks, {
|
|
@@ -3614,7 +3764,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
3614
3764
|
callHook(hook, [el]);
|
|
3615
3765
|
},
|
|
3616
3766
|
enter(el) {
|
|
3617
|
-
if (!isHmrUpdating && isLeaving()) return;
|
|
3767
|
+
if (!isHmrUpdating && isLeaving(el)) return;
|
|
3618
3768
|
let hook = onEnter;
|
|
3619
3769
|
let afterHook = onAfterEnter;
|
|
3620
3770
|
let cancelHook = onEnterCancelled;
|
|
@@ -3658,7 +3808,19 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
3658
3808
|
else done();
|
|
3659
3809
|
},
|
|
3660
3810
|
clone(node) {
|
|
3661
|
-
|
|
3811
|
+
if (!cloneHooks) return hooks;
|
|
3812
|
+
const cloned = cloneHooks(node);
|
|
3813
|
+
cloned.afterLeave = () => {
|
|
3814
|
+
if (hooks.afterLeave) hooks.afterLeave();
|
|
3815
|
+
};
|
|
3816
|
+
cloned.delayLeave = (el, earlyRemove, delayedLeave) => {
|
|
3817
|
+
if (hooks.delayLeave) hooks.delayLeave(el, earlyRemove, delayedLeave);
|
|
3818
|
+
else delayedLeave();
|
|
3819
|
+
};
|
|
3820
|
+
cloned.delayedLeave = () => {
|
|
3821
|
+
if (hooks.delayedLeave) hooks.delayedLeave();
|
|
3822
|
+
};
|
|
3823
|
+
return cloned;
|
|
3662
3824
|
}
|
|
3663
3825
|
};
|
|
3664
3826
|
return hooks;
|
|
@@ -3693,10 +3855,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
3693
3855
|
if (state.isLeaving) return emptyPlaceholder(next);
|
|
3694
3856
|
const nextInner = getInnerChild$1(next);
|
|
3695
3857
|
if (!nextInner) return emptyPlaceholder(next);
|
|
3696
|
-
|
|
3697
|
-
if (delayedLeaveSource) forwardDelayedLeave(hooks, delayedLeaveSource);
|
|
3698
|
-
enterHooks = hooks;
|
|
3699
|
-
});
|
|
3858
|
+
const enterHooks = resolveTransitionHooks(nextInner, props, state, instance);
|
|
3700
3859
|
if (delayedLeaveSource) forwardDelayedLeave(enterHooks, delayedLeaveSource);
|
|
3701
3860
|
if (nextInner.type !== Comment) setTransitionHooks(nextInner, enterHooks);
|
|
3702
3861
|
const mode = props.mode;
|
|
@@ -3762,9 +3921,14 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
3762
3921
|
return setTransitionHooks(isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree, hooks);
|
|
3763
3922
|
}
|
|
3764
3923
|
} else if (vnode.shapeFlag & 128) {
|
|
3765
|
-
const
|
|
3766
|
-
|
|
3767
|
-
|
|
3924
|
+
const suspense = vnode.suspense;
|
|
3925
|
+
if (suspense) {
|
|
3926
|
+
const branch = suspense.isHydrating ? suspense.pendingBranch : suspense.activeBranch;
|
|
3927
|
+
if (branch) return setTransitionHooks(branch, hooks.clone(branch));
|
|
3928
|
+
} else {
|
|
3929
|
+
vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
3930
|
+
vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
3931
|
+
}
|
|
3768
3932
|
} else {
|
|
3769
3933
|
vnode.transition = hooks;
|
|
3770
3934
|
if (vnode.type === Fragment && isArray(vnode.children)) {
|
|
@@ -3983,7 +4147,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
3983
4147
|
};
|
|
3984
4148
|
const isComment = (node) => node.nodeType === 8;
|
|
3985
4149
|
/** The data of a comment opening a range a hydration steps over as one. */
|
|
3986
|
-
const isRangeStart = (data) => data === "[" || data === "(" ||
|
|
4150
|
+
const isRangeStart = (data) => data === "[" || data === "(" || isVaporRangeStart(data);
|
|
3987
4151
|
function createHydrationFunctions(rendererInternals) {
|
|
3988
4152
|
const { mt: mountComponent, p: patch, o: { patchProp, createText, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals;
|
|
3989
4153
|
const hydrate = (vnode, container) => {
|
|
@@ -4001,7 +4165,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
4001
4165
|
};
|
|
4002
4166
|
const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
|
|
4003
4167
|
optimized = optimized || !!vnode.dynamicChildren;
|
|
4004
|
-
const isFragmentStart = isComment(node) && (node.data === "[" || node.data === "(" || isVaporInteropEnabled &&
|
|
4168
|
+
const isFragmentStart = isComment(node) && (node.data === "[" || node.data === "(" || isVaporInteropEnabled && isVaporRangeStart(node.data));
|
|
4005
4169
|
const onMismatch = () => handleMismatch(node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragmentStart);
|
|
4006
4170
|
const { type, ref, shapeFlag, patchFlag } = vnode;
|
|
4007
4171
|
let domType = node.nodeType;
|
|
@@ -4190,10 +4354,11 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
4190
4354
|
const container = parentNode(node);
|
|
4191
4355
|
const first = nextSibling(node);
|
|
4192
4356
|
const next = isVaporInteropEnabled && vnode.vo && node.data === "(" ? getVaporInterface(parentComponent, vnode).hydrateSlotOutlet(vnode, node, parentComponent, parentSuspense, slotScopeIds) : hydrateChildren(first, vnode, container, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
4193
|
-
|
|
4357
|
+
const close = isVaporInteropEnabled ? rangeCloseOf(node.data) : node.data === "(" ? ")" : "]";
|
|
4358
|
+
if (next && isComment(next) && next.data === close) return nextSibling(vnode.anchor = next);
|
|
4194
4359
|
else {
|
|
4195
4360
|
logMismatchError();
|
|
4196
|
-
insert(vnode.anchor = createComment(
|
|
4361
|
+
insert(vnode.anchor = createComment(close), container, next);
|
|
4197
4362
|
return next;
|
|
4198
4363
|
}
|
|
4199
4364
|
};
|
|
@@ -4215,13 +4380,13 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
4215
4380
|
const container = parentNode(node);
|
|
4216
4381
|
remove(node);
|
|
4217
4382
|
patch(null, vnode, container, next, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
|
|
4218
|
-
if (parentComponent && parentComponent.vnode) {
|
|
4383
|
+
if (parentComponent && parentComponent.vnode && parentComponent.vnode.el === node) {
|
|
4219
4384
|
parentComponent.vnode.el = vnode.el;
|
|
4220
4385
|
updateHOCHostEl(parentComponent, vnode.el);
|
|
4221
4386
|
}
|
|
4222
4387
|
return next;
|
|
4223
4388
|
};
|
|
4224
|
-
const locateClosingAnchor = (node, open = node && isComment(node) && node.data === "("
|
|
4389
|
+
const locateClosingAnchor = (node, open = node && isComment(node) && (node.data === "(" || isVaporInteropEnabled && node.data === "{") ? node.data : "[", close = isVaporInteropEnabled ? rangeCloseOf(open) : open === "(" ? ")" : "]") => {
|
|
4225
4390
|
let match = 0;
|
|
4226
4391
|
while (node) {
|
|
4227
4392
|
node = nextSibling(node);
|
|
@@ -4484,7 +4649,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
4484
4649
|
function forEachElement(node, cb) {
|
|
4485
4650
|
if (isComment(node) && isRangeStart(node.data)) {
|
|
4486
4651
|
const open = node.data;
|
|
4487
|
-
const close = open
|
|
4652
|
+
const close = rangeCloseOf(open);
|
|
4488
4653
|
let depth = 1;
|
|
4489
4654
|
let next = node.nextSibling;
|
|
4490
4655
|
while (next) {
|
|
@@ -4521,7 +4686,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
4521
4686
|
if (resolvedComp) return () => createInnerComp(resolvedComp, instance);
|
|
4522
4687
|
const onError = (err) => {
|
|
4523
4688
|
setPendingRequest(null);
|
|
4524
|
-
handleError(err, instance, 13, !errorComponent);
|
|
4689
|
+
handleError(err, instance, 13, !errorComponent, true);
|
|
4525
4690
|
};
|
|
4526
4691
|
if (suspensible && instance.suspense || false) return load().then((comp) => {
|
|
4527
4692
|
return () => createInnerComp(comp, instance);
|
|
@@ -4602,10 +4767,12 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
4602
4767
|
const delayed = /* @__PURE__ */ ref(!!delay);
|
|
4603
4768
|
let timeoutTimer;
|
|
4604
4769
|
let delayTimer;
|
|
4605
|
-
if (instance)
|
|
4606
|
-
|
|
4607
|
-
|
|
4608
|
-
|
|
4770
|
+
if (instance) instance.scope.run(() => {
|
|
4771
|
+
onScopeDispose(() => {
|
|
4772
|
+
if (timeoutTimer != null) clearTimeout(timeoutTimer);
|
|
4773
|
+
if (delayTimer != null) clearTimeout(delayTimer);
|
|
4774
|
+
});
|
|
4775
|
+
});
|
|
4609
4776
|
if (delay) delayTimer = setTimeout(() => {
|
|
4610
4777
|
if (instance && instance.isUnmounted) return;
|
|
4611
4778
|
delayed.value = false;
|
|
@@ -4640,7 +4807,12 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
4640
4807
|
}
|
|
4641
4808
|
return;
|
|
4642
4809
|
}
|
|
4643
|
-
if (!el.parentNode
|
|
4810
|
+
if (!el.parentNode) return;
|
|
4811
|
+
if (wasConnected && !el.isConnected) {
|
|
4812
|
+
let current = instance;
|
|
4813
|
+
while (current && !current.isDeactivated) current = current.parent;
|
|
4814
|
+
if (!current) return;
|
|
4815
|
+
}
|
|
4644
4816
|
hydrate();
|
|
4645
4817
|
};
|
|
4646
4818
|
const doHydrate = hydrateStrategy ? () => {
|
|
@@ -4694,7 +4866,11 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
4694
4866
|
activate(vnode, container, anchor, renderer, keepAliveInstance, parentSuspense, namespace, optimized);
|
|
4695
4867
|
};
|
|
4696
4868
|
sharedContext.deactivate = (vnode) => {
|
|
4697
|
-
|
|
4869
|
+
const cached = sharedContext.getCachedComponent(vnode);
|
|
4870
|
+
if (!cached || cached.component !== vnode.component) return false;
|
|
4871
|
+
if (isVaporInteropEnabled && isVaporComponent(vnode.type)) getVaporInterface(keepAliveInstance, vnode).deactivate(vnode, storageContainer, parentSuspense);
|
|
4872
|
+
else deactivate(vnode, storageContainer, renderer, keepAliveInstance, parentSuspense);
|
|
4873
|
+
return true;
|
|
4698
4874
|
};
|
|
4699
4875
|
function unmount(vnode) {
|
|
4700
4876
|
resetShapeFlag(vnode);
|
|
@@ -4726,11 +4902,15 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
4726
4902
|
let pendingCacheKey = null;
|
|
4727
4903
|
const cacheSubtree = () => {
|
|
4728
4904
|
if (pendingCacheKey != null) {
|
|
4729
|
-
if (isSuspense(keepAliveInstance.subTree.type))
|
|
4730
|
-
const
|
|
4731
|
-
|
|
4732
|
-
|
|
4733
|
-
|
|
4905
|
+
if (isSuspense(keepAliveInstance.subTree.type)) {
|
|
4906
|
+
const cacheInnerChild = () => {
|
|
4907
|
+
const vnode = getInnerChild(keepAliveInstance.subTree);
|
|
4908
|
+
if (vnode.component) cache.set(pendingCacheKey, vnode);
|
|
4909
|
+
};
|
|
4910
|
+
const suspense = keepAliveInstance.subTree.suspense;
|
|
4911
|
+
if (suspense.pendingBranch) queuePostRenderEffect(cacheInnerChild, void 0, suspense);
|
|
4912
|
+
else cacheInnerChild();
|
|
4913
|
+
} else cache.set(pendingCacheKey, getInnerChild(keepAliveInstance.subTree));
|
|
4734
4914
|
}
|
|
4735
4915
|
};
|
|
4736
4916
|
onMounted(cacheSubtree);
|
|
@@ -4835,9 +5015,8 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
4835
5015
|
}
|
|
4836
5016
|
function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
|
|
4837
5017
|
const injected = injectHook(type, hook, keepAliveRoot, true);
|
|
4838
|
-
|
|
4839
|
-
|
|
4840
|
-
}, target);
|
|
5018
|
+
const removal = injectHook("um", () => remove(keepAliveRoot[type], injected), target);
|
|
5019
|
+
removal.flags = 8;
|
|
4841
5020
|
}
|
|
4842
5021
|
function resetShapeFlag(vnode) {
|
|
4843
5022
|
vnode.shapeFlag &= -257;
|
|
@@ -5045,6 +5224,11 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
5045
5224
|
ret.props = extend({}, ret.props, { key: branchKey });
|
|
5046
5225
|
ret.key = branchKey;
|
|
5047
5226
|
}
|
|
5227
|
+
if (isBlockTreeEnabled <= 0) {
|
|
5228
|
+
if (!ret.vs.props) ret.vs.props = ret.props;
|
|
5229
|
+
ret.props = ret.key != null ? { key: ret.key } : null;
|
|
5230
|
+
ret.vs.attrs = EMPTY_OBJ;
|
|
5231
|
+
}
|
|
5048
5232
|
if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
|
|
5049
5233
|
return ret;
|
|
5050
5234
|
}
|
|
@@ -6845,8 +7029,10 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
6845
7029
|
def(el, "__vnode", vnode, true);
|
|
6846
7030
|
def(el, "__vueParentComponent", parentComponent, true);
|
|
6847
7031
|
if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
6848
|
-
if (transition)
|
|
6849
|
-
|
|
7032
|
+
if (transition) {
|
|
7033
|
+
if (!needTransition(parentSuspense, transition) && !transition.persisted) el[deferredEnterKey] = true;
|
|
7034
|
+
performTransitionEnter(el, transition, () => hostInsert(el, container, anchor), parentSuspense);
|
|
7035
|
+
} else hostInsert(el, container, anchor);
|
|
6850
7036
|
if ((vnodeHook = props && props.onVnodeMounted) || dirs) {
|
|
6851
7037
|
const isHmr = isHmrUpdating;
|
|
6852
7038
|
queuePostRenderEffect(() => {
|
|
@@ -7103,16 +7289,20 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
7103
7289
|
} else {
|
|
7104
7290
|
let { next, bu, u, parent, vnode } = instance;
|
|
7105
7291
|
{
|
|
7106
|
-
const
|
|
7107
|
-
if (
|
|
7292
|
+
const unresolvedAsyncRoot = locateUnresolvedAsyncRoot(instance);
|
|
7293
|
+
if (unresolvedAsyncRoot) {
|
|
7108
7294
|
if (next) {
|
|
7109
7295
|
next.el = vnode.el;
|
|
7110
7296
|
updateComponentPreRender(instance, next, optimized);
|
|
7111
7297
|
}
|
|
7112
|
-
|
|
7113
|
-
|
|
7114
|
-
if (
|
|
7115
|
-
|
|
7298
|
+
unresolvedAsyncRoot.asyncDep.then(() => {
|
|
7299
|
+
const retry = () => {
|
|
7300
|
+
if (instance.effect.flags & 1024) return;
|
|
7301
|
+
if (parentSuspense && parentSuspense.pendingBranch) queuePostRenderEffect(retry, void 0, parentSuspense);
|
|
7302
|
+
else instance.update();
|
|
7303
|
+
};
|
|
7304
|
+
retry.flags = 24;
|
|
7305
|
+
queuePostRenderEffect(retry, void 0, parentSuspense);
|
|
7116
7306
|
});
|
|
7117
7307
|
return;
|
|
7118
7308
|
}
|
|
@@ -7135,7 +7325,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
7135
7325
|
const prevTree = instance.subTree;
|
|
7136
7326
|
instance.subTree = nextTree;
|
|
7137
7327
|
startMeasure(instance, `patch`);
|
|
7138
|
-
patch(prevTree, nextTree, hostParentNode(prevTree.el), getNextHostNode(prevTree), instance, parentSuspense, namespace);
|
|
7328
|
+
patch(prevTree, nextTree, hostParentNode(prevTree.el || resolveAsyncComponentPlaceholder(prevTree)), getNextHostNode(prevTree), instance, parentSuspense, namespace);
|
|
7139
7329
|
endMeasure(instance, `patch`);
|
|
7140
7330
|
next.el = nextTree.el;
|
|
7141
7331
|
if (originNext === null) updateHOCHostEl(instance, nextTree.el);
|
|
@@ -7338,9 +7528,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
7338
7528
|
}
|
|
7339
7529
|
if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) parentComponent.renderCache[cacheIndex] = void 0;
|
|
7340
7530
|
if (shapeFlag & 256) {
|
|
7341
|
-
if (
|
|
7342
|
-
else parentComponent.ctx.deactivate(vnode);
|
|
7343
|
-
return;
|
|
7531
|
+
if (parentComponent.ctx.deactivate(vnode)) return;
|
|
7344
7532
|
}
|
|
7345
7533
|
if (isVaporInteropEnabled && shapeFlag & 6 && isVaporComponent(type)) {
|
|
7346
7534
|
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
|
|
@@ -7420,12 +7608,14 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
7420
7608
|
if (effect) {
|
|
7421
7609
|
effect.stop();
|
|
7422
7610
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
7423
|
-
} else if (
|
|
7611
|
+
} else if (subTree) {
|
|
7424
7612
|
subTree.transition = instance.vnode.transition;
|
|
7425
7613
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
7426
7614
|
}
|
|
7427
7615
|
if (um) queuePostRenderEffect(um, void 0, parentSuspense);
|
|
7428
|
-
|
|
7616
|
+
const markUnmounted = () => instance.isUnmounted = true;
|
|
7617
|
+
markUnmounted.flags = 8;
|
|
7618
|
+
queuePostRenderEffect(markUnmounted, void 0, parentSuspense);
|
|
7429
7619
|
devtoolsComponentRemoved(instance);
|
|
7430
7620
|
};
|
|
7431
7621
|
const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {
|
|
@@ -7539,11 +7729,11 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
7539
7729
|
c2.el && (c2.el.__vnode = c2);
|
|
7540
7730
|
}
|
|
7541
7731
|
}
|
|
7542
|
-
function
|
|
7732
|
+
function locateUnresolvedAsyncRoot(instance) {
|
|
7543
7733
|
const subComponent = instance.subTree && instance.subTree.component;
|
|
7544
7734
|
if (subComponent) {
|
|
7545
7735
|
if (subComponent.asyncDep && !subComponent.asyncResolved) return subComponent;
|
|
7546
|
-
else return
|
|
7736
|
+
else return locateUnresolvedAsyncRoot(subComponent);
|
|
7547
7737
|
}
|
|
7548
7738
|
}
|
|
7549
7739
|
function invalidateMount(hooks) {
|
|
@@ -7613,7 +7803,9 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
7613
7803
|
function resolveAsyncComponentPlaceholder(anchorVnode) {
|
|
7614
7804
|
if (anchorVnode.placeholder) return anchorVnode.placeholder;
|
|
7615
7805
|
const instance = anchorVnode.component;
|
|
7616
|
-
if (instance) return resolveAsyncComponentPlaceholder(instance.subTree);
|
|
7806
|
+
if (instance && instance.subTree) return resolveAsyncComponentPlaceholder(instance.subTree);
|
|
7807
|
+
const suspense = anchorVnode.suspense;
|
|
7808
|
+
if (suspense && suspense.activeBranch) return resolveAsyncComponentPlaceholder(suspense.activeBranch);
|
|
7617
7809
|
return null;
|
|
7618
7810
|
}
|
|
7619
7811
|
//#endregion
|
|
@@ -7625,17 +7817,22 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
7625
7817
|
return value;
|
|
7626
7818
|
}
|
|
7627
7819
|
let suspenseId = 0;
|
|
7820
|
+
const deferredEnterKey = Symbol("_deferredEnter");
|
|
7628
7821
|
const Suspense = /*@__PURE__*/ withSuspenseEnabled({
|
|
7629
7822
|
name: "Suspense",
|
|
7630
7823
|
__isSuspense: true,
|
|
7631
7824
|
process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
|
|
7632
7825
|
if (n1 == null) mountSuspense(n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals);
|
|
7633
7826
|
else {
|
|
7634
|
-
|
|
7635
|
-
|
|
7636
|
-
|
|
7637
|
-
n2.
|
|
7638
|
-
|
|
7827
|
+
const suspense = n1.suspense;
|
|
7828
|
+
if (parentSuspense && parentSuspense.deps > 0 && !parentSuspense.isHydrating) {
|
|
7829
|
+
const owner = suspense.parentComponent;
|
|
7830
|
+
if (!!owner && owner.suspense === parentSuspense && owner.suspenseId !== parentSuspense.pendingId ? parentSuspense.pendingBranch && !isSameVNodeType(n2.ssContent, suspense.pendingBranch || suspense.activeBranch) : !suspense.isInFallback) {
|
|
7831
|
+
n2.suspense = suspense;
|
|
7832
|
+
suspense.vnode = n2;
|
|
7833
|
+
n2.el = n1.el;
|
|
7834
|
+
return;
|
|
7835
|
+
}
|
|
7639
7836
|
}
|
|
7640
7837
|
patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, rendererInternals);
|
|
7641
7838
|
}
|
|
@@ -7647,6 +7844,36 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
7647
7844
|
const eventListener = vnode.props && vnode.props[name];
|
|
7648
7845
|
if (isFunction(eventListener)) eventListener();
|
|
7649
7846
|
}
|
|
7847
|
+
function enterDeferred(suspense, branch) {
|
|
7848
|
+
const enters = [];
|
|
7849
|
+
collectDeferredEnters(branch, enters, true);
|
|
7850
|
+
if (isVaporInteropEnabled) {
|
|
7851
|
+
const { parentComponent } = suspense;
|
|
7852
|
+
const vapor = parentComponent && parentComponent.appContext.vapor;
|
|
7853
|
+
if (vapor) vapor.enterDeferred(suspense, enters);
|
|
7854
|
+
}
|
|
7855
|
+
if (enters.length) queuePostFlushCb(enters);
|
|
7856
|
+
}
|
|
7857
|
+
function collectDeferredEnters(vnode, enters, isRoot) {
|
|
7858
|
+
const { el, transition, children, shapeFlag } = vnode;
|
|
7859
|
+
if (shapeFlag & 6) {
|
|
7860
|
+
const subTree = vnode.component.subTree;
|
|
7861
|
+
if (subTree) collectDeferredEnters(subTree, enters, isRoot);
|
|
7862
|
+
return;
|
|
7863
|
+
}
|
|
7864
|
+
if (shapeFlag & 192) return;
|
|
7865
|
+
if (shapeFlag & 1) {
|
|
7866
|
+
if (!isRoot && el && el[deferredEnterKey]) {
|
|
7867
|
+
el[deferredEnterKey] = void 0;
|
|
7868
|
+
if (transition && !transition.persisted) {
|
|
7869
|
+
transition.beforeEnter(el);
|
|
7870
|
+
enters.push(() => transition.enter(el));
|
|
7871
|
+
}
|
|
7872
|
+
}
|
|
7873
|
+
isRoot = false;
|
|
7874
|
+
}
|
|
7875
|
+
if (shapeFlag & 16) for (let i = 0; i < children.length; i++) collectDeferredEnters(children[i], enters, isRoot);
|
|
7876
|
+
}
|
|
7650
7877
|
function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
|
|
7651
7878
|
const { p: patch, o: { createElement } } = rendererInternals;
|
|
7652
7879
|
const hiddenContainer = createElement("div");
|
|
@@ -7686,11 +7913,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
7686
7913
|
suspense.activeBranch = pendingBranch;
|
|
7687
7914
|
} else unmount(pendingBranch, parentComponent, suspense);
|
|
7688
7915
|
suspense.deps = 0;
|
|
7689
|
-
|
|
7690
|
-
const effect = suspense.effects[i];
|
|
7691
|
-
if (effect.flags & 8) queuePostFlushCb(effect);
|
|
7692
|
-
}
|
|
7693
|
-
suspense.effects.length = 0;
|
|
7916
|
+
discardEffects(suspense);
|
|
7694
7917
|
suspense.hiddenContainer = createElement("div");
|
|
7695
7918
|
if (isInFallback) {
|
|
7696
7919
|
patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
|
|
@@ -7713,14 +7936,14 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
7713
7936
|
} else {
|
|
7714
7937
|
triggerEvent(n2, "onPending");
|
|
7715
7938
|
suspense.pendingBranch = newBranch;
|
|
7716
|
-
|
|
7717
|
-
else suspense.pendingId = suspenseId++;
|
|
7939
|
+
suspense.pendingId = suspenseId++;
|
|
7718
7940
|
patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
|
|
7719
7941
|
if (suspense.deps <= 0) suspense.resolve();
|
|
7720
7942
|
else {
|
|
7721
|
-
const { timeout
|
|
7722
|
-
if (timeout > 0) setTimeout(() => {
|
|
7723
|
-
|
|
7943
|
+
const { timeout } = suspense;
|
|
7944
|
+
if (timeout > 0) suspense.timeoutTimer = setTimeout(() => {
|
|
7945
|
+
suspense.timeoutTimer = void 0;
|
|
7946
|
+
suspense.fallback(suspense.vnode.ssFallback);
|
|
7724
7947
|
}, timeout);
|
|
7725
7948
|
else if (timeout === 0) suspense.fallback(newFallback);
|
|
7726
7949
|
}
|
|
@@ -7756,6 +7979,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
7756
7979
|
deps: 0,
|
|
7757
7980
|
pendingId: suspenseId++,
|
|
7758
7981
|
timeout: typeof timeout === "number" ? timeout : -1,
|
|
7982
|
+
timeoutTimer: void 0,
|
|
7759
7983
|
activeBranch: null,
|
|
7760
7984
|
isFallbackMountPending: false,
|
|
7761
7985
|
pendingBranch: null,
|
|
@@ -7773,26 +7997,39 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
7773
7997
|
delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
|
|
7774
7998
|
let hasUpdatedAnchor = false;
|
|
7775
7999
|
if (delayEnter) activeBranch.transition.afterLeave = () => {
|
|
7776
|
-
if (pendingId === suspense.pendingId) {
|
|
8000
|
+
if (pendingId === suspense.pendingId && !suspense.isUnmounted) {
|
|
8001
|
+
enterDeferred(suspense, pendingBranch);
|
|
7777
8002
|
move(pendingBranch, container, anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor, 0, parentComponent);
|
|
7778
8003
|
queuePostFlushCb(effects);
|
|
7779
8004
|
if (isInFallback && vnode.ssFallback) vnode.ssFallback.el = null;
|
|
7780
8005
|
}
|
|
7781
8006
|
};
|
|
7782
8007
|
if (activeBranch && !suspense.isFallbackMountPending) {
|
|
7783
|
-
if (parentNode(activeBranch.el) === container) {
|
|
8008
|
+
if (parentNode(activeBranch.el || resolveAsyncComponentPlaceholder(activeBranch)) === container) {
|
|
7784
8009
|
anchor = next(activeBranch);
|
|
7785
8010
|
hasUpdatedAnchor = true;
|
|
7786
8011
|
}
|
|
7787
8012
|
unmount(activeBranch, parentComponent, suspense, true);
|
|
7788
8013
|
if (!delayEnter && isInFallback && vnode.ssFallback) queuePostRenderEffect(() => vnode.ssFallback.el = null, void 0, suspense);
|
|
7789
8014
|
}
|
|
7790
|
-
if (!delayEnter)
|
|
8015
|
+
if (!delayEnter) {
|
|
8016
|
+
enterDeferred(suspense, pendingBranch);
|
|
8017
|
+
move(pendingBranch, container, anchor, 0, parentComponent);
|
|
8018
|
+
}
|
|
7791
8019
|
}
|
|
8020
|
+
clearTimeout(suspense.timeoutTimer);
|
|
8021
|
+
suspense.timeoutTimer = void 0;
|
|
7792
8022
|
suspense.isFallbackMountPending = false;
|
|
7793
8023
|
setActiveBranch(suspense, pendingBranch);
|
|
7794
8024
|
suspense.pendingBranch = null;
|
|
7795
8025
|
suspense.isInFallback = false;
|
|
8026
|
+
let kept = 0;
|
|
8027
|
+
for (let i = 0; i < effects.length; i++) {
|
|
8028
|
+
const effect = effects[i];
|
|
8029
|
+
if (effect.flags & 16) queuePostFlushCb(effect);
|
|
8030
|
+
else effects[kept++] = effect;
|
|
8031
|
+
}
|
|
8032
|
+
effects.length = kept;
|
|
7796
8033
|
let parent = suspense.parent;
|
|
7797
8034
|
let hasUnresolvedAncestor = false;
|
|
7798
8035
|
while (parent) {
|
|
@@ -7815,13 +8052,13 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
7815
8052
|
triggerEvent(vnode, "onResolve");
|
|
7816
8053
|
},
|
|
7817
8054
|
fallback(fallbackVNode) {
|
|
7818
|
-
if (!suspense.pendingBranch) return;
|
|
8055
|
+
if (suspense.isUnmounted || !suspense.pendingBranch) return;
|
|
7819
8056
|
const { vnode, activeBranch, parentComponent, container, namespace } = suspense;
|
|
7820
8057
|
triggerEvent(vnode, "onFallback");
|
|
7821
8058
|
const anchor = next(activeBranch);
|
|
7822
8059
|
const mountFallback = () => {
|
|
7823
8060
|
suspense.isFallbackMountPending = false;
|
|
7824
|
-
if (!suspense.isInFallback) return;
|
|
8061
|
+
if (suspense.isUnmounted || !suspense.isInFallback) return;
|
|
7825
8062
|
const latestFallback = suspense.vnode.ssFallback;
|
|
7826
8063
|
patch(null, latestFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
|
|
7827
8064
|
setActiveBranch(suspense, latestFallback);
|
|
@@ -7845,24 +8082,52 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
7845
8082
|
registerDep(instance, onResolve) {
|
|
7846
8083
|
const isInPendingSuspense = !!suspense.pendingBranch;
|
|
7847
8084
|
if (isInPendingSuspense) suspense.deps++;
|
|
8085
|
+
const render = (setupResult) => {
|
|
8086
|
+
instance.asyncResolved = true;
|
|
8087
|
+
onResolve(setupResult);
|
|
8088
|
+
};
|
|
7848
8089
|
instance.asyncDep.catch((err) => {
|
|
7849
|
-
handleError(err, instance, 0);
|
|
8090
|
+
handleError(err, instance, 0, false, true);
|
|
8091
|
+
return () => null;
|
|
7850
8092
|
}).then((asyncSetupResult) => {
|
|
7851
|
-
if (instance.isUnmounted || suspense.isUnmounted
|
|
8093
|
+
if (instance.isUnmounted || suspense.isUnmounted) return;
|
|
8094
|
+
const isPendingDep = isInPendingSuspense && suspense.pendingId === instance.suspenseId;
|
|
7852
8095
|
setCurrentInstance(null, void 0);
|
|
7853
8096
|
if (!instance.scope.active) {
|
|
7854
|
-
if (
|
|
8097
|
+
if (isPendingDep && --suspense.deps === 0) suspense.resolve();
|
|
7855
8098
|
return;
|
|
7856
8099
|
}
|
|
7857
|
-
|
|
7858
|
-
|
|
7859
|
-
|
|
8100
|
+
if (!isPendingDep && suspense.pendingBranch) {
|
|
8101
|
+
const job = () => {
|
|
8102
|
+
if (instance.isUnmounted || suspense.isUnmounted || !instance.scope.active) return;
|
|
8103
|
+
if (suspense.pendingBranch) queueEffectWithSuspense(job, void 0, suspense);
|
|
8104
|
+
else render(asyncSetupResult);
|
|
8105
|
+
};
|
|
8106
|
+
job.flags = 24;
|
|
8107
|
+
queueEffectWithSuspense(job, void 0, suspense);
|
|
8108
|
+
return;
|
|
8109
|
+
}
|
|
8110
|
+
render(asyncSetupResult);
|
|
8111
|
+
if (isPendingDep && --suspense.deps === 0) suspense.resolve();
|
|
7860
8112
|
});
|
|
7861
8113
|
},
|
|
7862
8114
|
unmount(parentSuspense, doRemove) {
|
|
7863
8115
|
suspense.isUnmounted = true;
|
|
8116
|
+
clearTimeout(suspense.timeoutTimer);
|
|
8117
|
+
suspense.timeoutTimer = void 0;
|
|
8118
|
+
if (parentSuspenseId !== void 0) {
|
|
8119
|
+
const parent = suspense.parent;
|
|
8120
|
+
const pendingId = parentSuspenseId;
|
|
8121
|
+
parentSuspenseId = void 0;
|
|
8122
|
+
queuePostFlushCb(() => {
|
|
8123
|
+
if (parent.pendingId === pendingId && !parent.isUnmounted && --parent.deps === 0) parent.resolve();
|
|
8124
|
+
});
|
|
8125
|
+
}
|
|
7864
8126
|
if (suspense.activeBranch) unmount(suspense.activeBranch, parentComponent, parentSuspense, doRemove);
|
|
7865
|
-
if (suspense.pendingBranch)
|
|
8127
|
+
if (suspense.pendingBranch) {
|
|
8128
|
+
unmount(suspense.pendingBranch, parentComponent, suspense, doRemove);
|
|
8129
|
+
discardEffects(suspense);
|
|
8130
|
+
}
|
|
7866
8131
|
}
|
|
7867
8132
|
};
|
|
7868
8133
|
return suspense;
|
|
@@ -7903,6 +8168,14 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
7903
8168
|
if (block && !s.dynamicChildren) s.dynamicChildren = block.filter((c) => c !== s);
|
|
7904
8169
|
return s;
|
|
7905
8170
|
}
|
|
8171
|
+
function discardEffects(suspense) {
|
|
8172
|
+
const { effects } = suspense;
|
|
8173
|
+
for (let i = 0; i < effects.length; i++) {
|
|
8174
|
+
const effect = effects[i];
|
|
8175
|
+
if (effect.flags & 8) queuePostFlushCb(effect);
|
|
8176
|
+
}
|
|
8177
|
+
effects.length = 0;
|
|
8178
|
+
}
|
|
7906
8179
|
function queueEffectWithSuspense(fn, id, suspense) {
|
|
7907
8180
|
if (suspense && suspense.pendingBranch) {
|
|
7908
8181
|
if (isArray(fn)) suspense.effects.push(...fn);
|
|
@@ -8127,7 +8400,8 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
8127
8400
|
}
|
|
8128
8401
|
function guardReactiveProps(props) {
|
|
8129
8402
|
if (!props) return null;
|
|
8130
|
-
|
|
8403
|
+
if (/* @__PURE__ */ isProxy(props)) return extend({}, props);
|
|
8404
|
+
return isInternalObject(props) ? extend({}, props[rawAttrsKey] || props) : props;
|
|
8131
8405
|
}
|
|
8132
8406
|
function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
|
|
8133
8407
|
const { props, ref, patchFlag, children, transition } = vnode;
|
|
@@ -8513,7 +8787,8 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
8513
8787
|
setInSSRSetupState(false);
|
|
8514
8788
|
}
|
|
8515
8789
|
}).catch((e) => {
|
|
8516
|
-
handleError(e, instance, 0);
|
|
8790
|
+
handleError(e, instance, 0, void 0, true);
|
|
8791
|
+
instance.ssrRender = (_, push) => push("<!---->");
|
|
8517
8792
|
});
|
|
8518
8793
|
else {
|
|
8519
8794
|
instance.asyncDep = setupResult;
|
|
@@ -8582,11 +8857,16 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
8582
8857
|
else warn$1(`Component is missing template or render function: `, Component);
|
|
8583
8858
|
}
|
|
8584
8859
|
}
|
|
8860
|
+
/**
|
|
8861
|
+
* Read through the setup context `attrs` proxy to get the raw attrs object.
|
|
8862
|
+
* @internal
|
|
8863
|
+
*/
|
|
8864
|
+
const rawAttrsKey = Symbol();
|
|
8585
8865
|
const attrsProxyHandlers = {
|
|
8586
8866
|
get(target, key) {
|
|
8587
8867
|
markAttrsAccessed();
|
|
8588
8868
|
track(target, "get", "");
|
|
8589
|
-
return target[key];
|
|
8869
|
+
return key === rawAttrsKey ? target : target[key];
|
|
8590
8870
|
},
|
|
8591
8871
|
set() {
|
|
8592
8872
|
warn$1(`setupContext.attrs is readonly.`);
|
|
@@ -8884,7 +9164,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
8884
9164
|
}
|
|
8885
9165
|
//#endregion
|
|
8886
9166
|
//#region packages/runtime-core/src/index.ts
|
|
8887
|
-
const version = "3.6.0-rc.
|
|
9167
|
+
const version = "3.6.0-rc.15";
|
|
8888
9168
|
const warn = warn$1;
|
|
8889
9169
|
/**
|
|
8890
9170
|
* Runtime error messages. Only exposed in dev or esm builds.
|
|
@@ -9705,7 +9985,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
9705
9985
|
}
|
|
9706
9986
|
this._styleAnchors.delete(this._def);
|
|
9707
9987
|
this._applyStyles(newStyles);
|
|
9708
|
-
|
|
9988
|
+
this._instance = null;
|
|
9709
9989
|
this._update();
|
|
9710
9990
|
};
|
|
9711
9991
|
const dispatch = (event, args) => {
|
|
@@ -10302,15 +10582,15 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
10302
10582
|
vModelSelectInit(el, value, number);
|
|
10303
10583
|
el[assignKey] = getModelAssigner(vnode);
|
|
10304
10584
|
},
|
|
10305
|
-
mounted(el, { value }) {
|
|
10306
|
-
vModelSetSelected(el, value);
|
|
10585
|
+
mounted(el, { value, modifiers: { number } }) {
|
|
10586
|
+
vModelSetSelected(el, value, number);
|
|
10307
10587
|
},
|
|
10308
10588
|
beforeUpdate(el, { value }, vnode) {
|
|
10309
10589
|
el._modelValue = value;
|
|
10310
10590
|
el[assignKey] = getModelAssigner(vnode);
|
|
10311
10591
|
},
|
|
10312
|
-
updated(el, { value }) {
|
|
10313
|
-
vModelSetSelected(el, value);
|
|
10592
|
+
updated(el, { value, modifiers: { number } }) {
|
|
10593
|
+
vModelSetSelected(el, value, number);
|
|
10314
10594
|
}
|
|
10315
10595
|
};
|
|
10316
10596
|
/**
|
|
@@ -10345,14 +10625,14 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
10345
10625
|
/**
|
|
10346
10626
|
* @internal
|
|
10347
10627
|
*/
|
|
10348
|
-
const vModelSetSelected = (el, value) => {
|
|
10628
|
+
const vModelSetSelected = (el, value, number = false) => {
|
|
10349
10629
|
el._modelValue = value;
|
|
10350
10630
|
const pending = el._pendingValue;
|
|
10351
10631
|
el._pendingValue = void 0;
|
|
10352
10632
|
if (pending && pending[0] === el.multiple && isSameSelectValue(value, pending[1], pending[0])) return;
|
|
10353
|
-
setSelected(el, value);
|
|
10633
|
+
setSelected(el, value, number);
|
|
10354
10634
|
};
|
|
10355
|
-
function setSelected(el, value) {
|
|
10635
|
+
function setSelected(el, value, number) {
|
|
10356
10636
|
const isMultiple = el.multiple;
|
|
10357
10637
|
const isArrayValue = isArray(value);
|
|
10358
10638
|
if (isMultiple && !isArrayValue && !isSet(value)) {
|
|
@@ -10367,7 +10647,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
10367
10647
|
const optionType = typeof optionValue;
|
|
10368
10648
|
if (optionType === "string" || optionType === "number") option.selected = value.some((v) => String(v) === String(optionValue));
|
|
10369
10649
|
else option.selected = looseIndexOf(value, optionValue) > -1;
|
|
10370
|
-
} else option.selected = value.has(optionValue);
|
|
10650
|
+
} else option.selected = value.has(optionValue) || number && typeof optionValue === "string" && value.has(looseToNumber(optionValue));
|
|
10371
10651
|
} else if (looseEqual(getValue(option), value)) {
|
|
10372
10652
|
if (el.selectedIndex !== i) el.selectedIndex = i;
|
|
10373
10653
|
return;
|