@vue/compat 3.4.25 → 3.5.0-alpha.1
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/vue.cjs.js +974 -417
- package/dist/vue.cjs.prod.js +765 -403
- package/dist/vue.esm-browser.js +974 -417
- package/dist/vue.esm-browser.prod.js +6 -6
- package/dist/vue.esm-bundler.js +986 -419
- package/dist/vue.global.js +974 -417
- package/dist/vue.global.prod.js +6 -6
- package/dist/vue.runtime.esm-browser.js +799 -416
- package/dist/vue.runtime.esm-browser.prod.js +6 -6
- package/dist/vue.runtime.esm-bundler.js +811 -418
- package/dist/vue.runtime.global.js +799 -416
- package/dist/vue.runtime.global.prod.js +6 -6
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compat v3.
|
|
2
|
+
* @vue/compat v3.5.0-alpha.1
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -384,157 +384,280 @@ class EffectScope {
|
|
|
384
384
|
function effectScope(detached) {
|
|
385
385
|
return new EffectScope(detached);
|
|
386
386
|
}
|
|
387
|
-
function recordEffectScope(effect, scope = activeEffectScope) {
|
|
388
|
-
if (scope && scope.active) {
|
|
389
|
-
scope.effects.push(effect);
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
387
|
function getCurrentScope() {
|
|
393
388
|
return activeEffectScope;
|
|
394
389
|
}
|
|
395
|
-
function onScopeDispose(fn) {
|
|
390
|
+
function onScopeDispose(fn, failSilently = false) {
|
|
396
391
|
if (activeEffectScope) {
|
|
397
392
|
activeEffectScope.cleanups.push(fn);
|
|
398
|
-
} else {
|
|
393
|
+
} else if (!failSilently) {
|
|
399
394
|
warn$2(
|
|
400
395
|
`onScopeDispose() is called when there is no active effect scope to be associated with.`
|
|
401
396
|
);
|
|
402
397
|
}
|
|
403
398
|
}
|
|
404
399
|
|
|
405
|
-
let
|
|
400
|
+
let activeSub;
|
|
406
401
|
class ReactiveEffect {
|
|
407
|
-
constructor(fn
|
|
402
|
+
constructor(fn) {
|
|
408
403
|
this.fn = fn;
|
|
409
|
-
this.trigger = trigger;
|
|
410
|
-
this.scheduler = scheduler;
|
|
411
|
-
this.active = true;
|
|
412
|
-
this.deps = [];
|
|
413
404
|
/**
|
|
414
405
|
* @internal
|
|
415
406
|
*/
|
|
416
|
-
this.
|
|
407
|
+
this.deps = void 0;
|
|
417
408
|
/**
|
|
418
409
|
* @internal
|
|
419
410
|
*/
|
|
420
|
-
this.
|
|
411
|
+
this.depsTail = void 0;
|
|
421
412
|
/**
|
|
422
413
|
* @internal
|
|
423
414
|
*/
|
|
424
|
-
this.
|
|
415
|
+
this.flags = 1 | 4;
|
|
425
416
|
/**
|
|
426
417
|
* @internal
|
|
427
418
|
*/
|
|
428
|
-
this.
|
|
419
|
+
this.nextEffect = void 0;
|
|
429
420
|
/**
|
|
430
421
|
* @internal
|
|
431
422
|
*/
|
|
432
|
-
this.
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
if (this._dirtyLevel === 2 || this._dirtyLevel === 3) {
|
|
437
|
-
this._dirtyLevel = 1;
|
|
438
|
-
pauseTracking();
|
|
439
|
-
for (let i = 0; i < this._depsLength; i++) {
|
|
440
|
-
const dep = this.deps[i];
|
|
441
|
-
if (dep.computed) {
|
|
442
|
-
triggerComputed(dep.computed);
|
|
443
|
-
if (this._dirtyLevel >= 4) {
|
|
444
|
-
break;
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
if (this._dirtyLevel === 1) {
|
|
449
|
-
this._dirtyLevel = 0;
|
|
450
|
-
}
|
|
451
|
-
resetTracking();
|
|
423
|
+
this.cleanup = void 0;
|
|
424
|
+
this.scheduler = void 0;
|
|
425
|
+
if (activeEffectScope && activeEffectScope.active) {
|
|
426
|
+
activeEffectScope.effects.push(this);
|
|
452
427
|
}
|
|
453
|
-
return this._dirtyLevel >= 4;
|
|
454
428
|
}
|
|
455
|
-
|
|
456
|
-
|
|
429
|
+
/**
|
|
430
|
+
* @internal
|
|
431
|
+
*/
|
|
432
|
+
notify() {
|
|
433
|
+
if (this.flags & 2 && !(this.flags & 32)) {
|
|
434
|
+
return;
|
|
435
|
+
}
|
|
436
|
+
if (this.flags & 64) {
|
|
437
|
+
return this.trigger();
|
|
438
|
+
}
|
|
439
|
+
if (!(this.flags & 8)) {
|
|
440
|
+
this.flags |= 8;
|
|
441
|
+
this.nextEffect = batchedEffect;
|
|
442
|
+
batchedEffect = this;
|
|
443
|
+
}
|
|
457
444
|
}
|
|
458
445
|
run() {
|
|
459
|
-
this.
|
|
460
|
-
if (!this.active) {
|
|
446
|
+
if (!(this.flags & 1)) {
|
|
461
447
|
return this.fn();
|
|
462
448
|
}
|
|
463
|
-
|
|
464
|
-
|
|
449
|
+
this.flags |= 2;
|
|
450
|
+
cleanupEffect(this);
|
|
451
|
+
prepareDeps(this);
|
|
452
|
+
const prevEffect = activeSub;
|
|
453
|
+
const prevShouldTrack = shouldTrack;
|
|
454
|
+
activeSub = this;
|
|
455
|
+
shouldTrack = true;
|
|
465
456
|
try {
|
|
466
|
-
shouldTrack = true;
|
|
467
|
-
activeEffect = this;
|
|
468
|
-
this._runnings++;
|
|
469
|
-
preCleanupEffect(this);
|
|
470
457
|
return this.fn();
|
|
471
458
|
} finally {
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
459
|
+
if (activeSub !== this) {
|
|
460
|
+
warn$2(
|
|
461
|
+
"Active effect was not restored correctly - this is likely a Vue internal bug."
|
|
462
|
+
);
|
|
463
|
+
}
|
|
464
|
+
cleanupDeps(this);
|
|
465
|
+
activeSub = prevEffect;
|
|
466
|
+
shouldTrack = prevShouldTrack;
|
|
467
|
+
this.flags &= ~2;
|
|
476
468
|
}
|
|
477
469
|
}
|
|
478
470
|
stop() {
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
this
|
|
471
|
+
if (this.flags & 1) {
|
|
472
|
+
for (let link = this.deps; link; link = link.nextDep) {
|
|
473
|
+
removeSub(link);
|
|
474
|
+
}
|
|
475
|
+
this.deps = this.depsTail = void 0;
|
|
476
|
+
cleanupEffect(this);
|
|
477
|
+
this.onStop && this.onStop();
|
|
478
|
+
this.flags &= ~1;
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
trigger() {
|
|
482
|
+
if (this.scheduler) {
|
|
483
|
+
this.scheduler();
|
|
484
|
+
} else {
|
|
485
|
+
this.runIfDirty();
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
/**
|
|
489
|
+
* @internal
|
|
490
|
+
*/
|
|
491
|
+
runIfDirty() {
|
|
492
|
+
if (isDirty(this)) {
|
|
493
|
+
this.run();
|
|
485
494
|
}
|
|
486
495
|
}
|
|
496
|
+
get dirty() {
|
|
497
|
+
return isDirty(this);
|
|
498
|
+
}
|
|
487
499
|
}
|
|
488
|
-
|
|
489
|
-
|
|
500
|
+
let batchDepth = 0;
|
|
501
|
+
let batchedEffect;
|
|
502
|
+
function startBatch() {
|
|
503
|
+
batchDepth++;
|
|
504
|
+
}
|
|
505
|
+
function endBatch() {
|
|
506
|
+
if (batchDepth > 1) {
|
|
507
|
+
batchDepth--;
|
|
508
|
+
return;
|
|
509
|
+
}
|
|
510
|
+
let error;
|
|
511
|
+
while (batchedEffect) {
|
|
512
|
+
let e = batchedEffect;
|
|
513
|
+
batchedEffect = void 0;
|
|
514
|
+
while (e) {
|
|
515
|
+
const next = e.nextEffect;
|
|
516
|
+
e.nextEffect = void 0;
|
|
517
|
+
e.flags &= ~8;
|
|
518
|
+
if (e.flags & 1) {
|
|
519
|
+
try {
|
|
520
|
+
e.trigger();
|
|
521
|
+
} catch (err) {
|
|
522
|
+
if (!error)
|
|
523
|
+
error = err;
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
e = next;
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
batchDepth--;
|
|
530
|
+
if (error)
|
|
531
|
+
throw error;
|
|
532
|
+
}
|
|
533
|
+
function prepareDeps(sub) {
|
|
534
|
+
for (let link = sub.deps; link; link = link.nextDep) {
|
|
535
|
+
link.version = -1;
|
|
536
|
+
link.prevActiveLink = link.dep.activeLink;
|
|
537
|
+
link.dep.activeLink = link;
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
function cleanupDeps(sub) {
|
|
541
|
+
let head;
|
|
542
|
+
let tail = sub.depsTail;
|
|
543
|
+
for (let link = tail; link; link = link.prevDep) {
|
|
544
|
+
if (link.version === -1) {
|
|
545
|
+
if (link === tail)
|
|
546
|
+
tail = link.prevDep;
|
|
547
|
+
removeSub(link);
|
|
548
|
+
removeDep(link);
|
|
549
|
+
} else {
|
|
550
|
+
head = link;
|
|
551
|
+
}
|
|
552
|
+
link.dep.activeLink = link.prevActiveLink;
|
|
553
|
+
link.prevActiveLink = void 0;
|
|
554
|
+
}
|
|
555
|
+
sub.deps = head;
|
|
556
|
+
sub.depsTail = tail;
|
|
490
557
|
}
|
|
491
|
-
function
|
|
492
|
-
|
|
493
|
-
|
|
558
|
+
function isDirty(sub) {
|
|
559
|
+
for (let link = sub.deps; link; link = link.nextDep) {
|
|
560
|
+
if (link.dep.version !== link.version || link.dep.computed && refreshComputed(link.dep.computed) === false || link.dep.version !== link.version) {
|
|
561
|
+
return true;
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
if (sub._dirty) {
|
|
565
|
+
return true;
|
|
566
|
+
}
|
|
567
|
+
return false;
|
|
494
568
|
}
|
|
495
|
-
function
|
|
496
|
-
if (
|
|
497
|
-
|
|
498
|
-
|
|
569
|
+
function refreshComputed(computed) {
|
|
570
|
+
if (computed.flags & 2) {
|
|
571
|
+
return false;
|
|
572
|
+
}
|
|
573
|
+
if (computed.flags & 4 && !(computed.flags & 16)) {
|
|
574
|
+
return;
|
|
575
|
+
}
|
|
576
|
+
computed.flags &= ~16;
|
|
577
|
+
if (computed.globalVersion === globalVersion) {
|
|
578
|
+
return;
|
|
579
|
+
}
|
|
580
|
+
computed.globalVersion = globalVersion;
|
|
581
|
+
const dep = computed.dep;
|
|
582
|
+
computed.flags |= 2;
|
|
583
|
+
if (dep.version > 0 && !computed.isSSR && !isDirty(computed)) {
|
|
584
|
+
computed.flags &= ~2;
|
|
585
|
+
return;
|
|
586
|
+
}
|
|
587
|
+
const prevSub = activeSub;
|
|
588
|
+
const prevShouldTrack = shouldTrack;
|
|
589
|
+
activeSub = computed;
|
|
590
|
+
shouldTrack = true;
|
|
591
|
+
try {
|
|
592
|
+
prepareDeps(computed);
|
|
593
|
+
const value = computed.fn();
|
|
594
|
+
if (dep.version === 0 || hasChanged(value, computed._value)) {
|
|
595
|
+
computed._value = value;
|
|
596
|
+
dep.version++;
|
|
499
597
|
}
|
|
500
|
-
|
|
598
|
+
} catch (err) {
|
|
599
|
+
dep.version++;
|
|
600
|
+
throw err;
|
|
601
|
+
} finally {
|
|
602
|
+
activeSub = prevSub;
|
|
603
|
+
shouldTrack = prevShouldTrack;
|
|
604
|
+
cleanupDeps(computed);
|
|
605
|
+
computed.flags &= ~2;
|
|
501
606
|
}
|
|
502
607
|
}
|
|
503
|
-
function
|
|
504
|
-
const
|
|
505
|
-
if (
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
608
|
+
function removeSub(link) {
|
|
609
|
+
const { dep, prevSub, nextSub } = link;
|
|
610
|
+
if (prevSub) {
|
|
611
|
+
prevSub.nextSub = nextSub;
|
|
612
|
+
link.prevSub = void 0;
|
|
613
|
+
}
|
|
614
|
+
if (nextSub) {
|
|
615
|
+
nextSub.prevSub = prevSub;
|
|
616
|
+
link.nextSub = void 0;
|
|
617
|
+
}
|
|
618
|
+
if (dep.subs === link) {
|
|
619
|
+
dep.subs = prevSub;
|
|
620
|
+
}
|
|
621
|
+
if (!dep.subs && dep.computed) {
|
|
622
|
+
dep.computed.flags &= ~4;
|
|
623
|
+
for (let l = dep.computed.deps; l; l = l.nextDep) {
|
|
624
|
+
removeSub(l);
|
|
509
625
|
}
|
|
510
626
|
}
|
|
511
627
|
}
|
|
628
|
+
function removeDep(link) {
|
|
629
|
+
const { prevDep, nextDep } = link;
|
|
630
|
+
if (prevDep) {
|
|
631
|
+
prevDep.nextDep = nextDep;
|
|
632
|
+
link.prevDep = void 0;
|
|
633
|
+
}
|
|
634
|
+
if (nextDep) {
|
|
635
|
+
nextDep.prevDep = prevDep;
|
|
636
|
+
link.nextDep = void 0;
|
|
637
|
+
}
|
|
638
|
+
}
|
|
512
639
|
function effect(fn, options) {
|
|
513
640
|
if (fn.effect instanceof ReactiveEffect) {
|
|
514
641
|
fn = fn.effect.fn;
|
|
515
642
|
}
|
|
516
|
-
const
|
|
517
|
-
if (_effect.dirty) {
|
|
518
|
-
_effect.run();
|
|
519
|
-
}
|
|
520
|
-
});
|
|
643
|
+
const e = new ReactiveEffect(fn);
|
|
521
644
|
if (options) {
|
|
522
|
-
extend(
|
|
523
|
-
if (options.scope)
|
|
524
|
-
recordEffectScope(_effect, options.scope);
|
|
645
|
+
extend(e, options);
|
|
525
646
|
}
|
|
526
|
-
|
|
527
|
-
|
|
647
|
+
try {
|
|
648
|
+
e.run();
|
|
649
|
+
} catch (err) {
|
|
650
|
+
e.stop();
|
|
651
|
+
throw err;
|
|
528
652
|
}
|
|
529
|
-
const runner =
|
|
530
|
-
runner.effect =
|
|
653
|
+
const runner = e.run.bind(e);
|
|
654
|
+
runner.effect = e;
|
|
531
655
|
return runner;
|
|
532
656
|
}
|
|
533
657
|
function stop(runner) {
|
|
534
658
|
runner.effect.stop();
|
|
535
659
|
}
|
|
536
660
|
let shouldTrack = true;
|
|
537
|
-
let pauseScheduleStack = 0;
|
|
538
661
|
const trackStack = [];
|
|
539
662
|
function pauseTracking() {
|
|
540
663
|
trackStack.push(shouldTrack);
|
|
@@ -544,192 +667,414 @@ function resetTracking() {
|
|
|
544
667
|
const last = trackStack.pop();
|
|
545
668
|
shouldTrack = last === void 0 ? true : last;
|
|
546
669
|
}
|
|
547
|
-
function
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
670
|
+
function cleanupEffect(e) {
|
|
671
|
+
const { cleanup } = e;
|
|
672
|
+
e.cleanup = void 0;
|
|
673
|
+
if (cleanup) {
|
|
674
|
+
const prevSub = activeSub;
|
|
675
|
+
activeSub = void 0;
|
|
676
|
+
try {
|
|
677
|
+
cleanup();
|
|
678
|
+
} finally {
|
|
679
|
+
activeSub = prevSub;
|
|
680
|
+
}
|
|
554
681
|
}
|
|
555
682
|
}
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
683
|
+
|
|
684
|
+
let globalVersion = 0;
|
|
685
|
+
class Dep {
|
|
686
|
+
constructor(computed) {
|
|
687
|
+
this.computed = computed;
|
|
688
|
+
this.version = 0;
|
|
689
|
+
/**
|
|
690
|
+
* Link between this dep and the current active effect
|
|
691
|
+
*/
|
|
692
|
+
this.activeLink = void 0;
|
|
693
|
+
/**
|
|
694
|
+
* Doubly linked list representing the subscribing effects (tail)
|
|
695
|
+
*/
|
|
696
|
+
this.subs = void 0;
|
|
569
697
|
{
|
|
570
|
-
|
|
698
|
+
this.subsHead = void 0;
|
|
571
699
|
}
|
|
572
700
|
}
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
701
|
+
track(debugInfo) {
|
|
702
|
+
if (!activeSub || !shouldTrack) {
|
|
703
|
+
return;
|
|
704
|
+
}
|
|
705
|
+
let link = this.activeLink;
|
|
706
|
+
if (link === void 0 || link.sub !== activeSub) {
|
|
707
|
+
link = this.activeLink = {
|
|
708
|
+
dep: this,
|
|
709
|
+
sub: activeSub,
|
|
710
|
+
version: this.version,
|
|
711
|
+
nextDep: void 0,
|
|
712
|
+
prevDep: void 0,
|
|
713
|
+
nextSub: void 0,
|
|
714
|
+
prevSub: void 0,
|
|
715
|
+
prevActiveLink: void 0
|
|
716
|
+
};
|
|
717
|
+
if (!activeSub.deps) {
|
|
718
|
+
activeSub.deps = activeSub.depsTail = link;
|
|
719
|
+
} else {
|
|
720
|
+
link.prevDep = activeSub.depsTail;
|
|
721
|
+
activeSub.depsTail.nextDep = link;
|
|
722
|
+
activeSub.depsTail = link;
|
|
587
723
|
}
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
724
|
+
if (activeSub.flags & 4) {
|
|
725
|
+
addSub(link);
|
|
726
|
+
}
|
|
727
|
+
} else if (link.version === -1) {
|
|
728
|
+
link.version = this.version;
|
|
729
|
+
if (link.nextDep) {
|
|
730
|
+
const next = link.nextDep;
|
|
731
|
+
next.prevDep = link.prevDep;
|
|
732
|
+
if (link.prevDep) {
|
|
733
|
+
link.prevDep.nextDep = next;
|
|
734
|
+
}
|
|
735
|
+
link.prevDep = activeSub.depsTail;
|
|
736
|
+
link.nextDep = void 0;
|
|
737
|
+
activeSub.depsTail.nextDep = link;
|
|
738
|
+
activeSub.depsTail = link;
|
|
739
|
+
if (activeSub.deps === link) {
|
|
740
|
+
activeSub.deps = next;
|
|
593
741
|
}
|
|
594
742
|
}
|
|
595
743
|
}
|
|
744
|
+
if (activeSub.onTrack) {
|
|
745
|
+
activeSub.onTrack(
|
|
746
|
+
extend(
|
|
747
|
+
{
|
|
748
|
+
effect: activeSub
|
|
749
|
+
},
|
|
750
|
+
debugInfo
|
|
751
|
+
)
|
|
752
|
+
);
|
|
753
|
+
}
|
|
754
|
+
return link;
|
|
755
|
+
}
|
|
756
|
+
trigger(debugInfo) {
|
|
757
|
+
this.version++;
|
|
758
|
+
globalVersion++;
|
|
759
|
+
this.notify(debugInfo);
|
|
760
|
+
}
|
|
761
|
+
notify(debugInfo) {
|
|
762
|
+
startBatch();
|
|
763
|
+
try {
|
|
764
|
+
if (true) {
|
|
765
|
+
for (let head = this.subsHead; head; head = head.nextSub) {
|
|
766
|
+
if (head.sub.onTrigger && !(head.sub.flags & 8)) {
|
|
767
|
+
head.sub.onTrigger(
|
|
768
|
+
extend(
|
|
769
|
+
{
|
|
770
|
+
effect: head.sub
|
|
771
|
+
},
|
|
772
|
+
debugInfo
|
|
773
|
+
)
|
|
774
|
+
);
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
for (let link = this.subs; link; link = link.prevSub) {
|
|
779
|
+
link.sub.notify();
|
|
780
|
+
}
|
|
781
|
+
} finally {
|
|
782
|
+
endBatch();
|
|
783
|
+
}
|
|
596
784
|
}
|
|
597
|
-
resetScheduling();
|
|
598
785
|
}
|
|
599
|
-
|
|
600
|
-
const
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
}
|
|
606
|
-
|
|
786
|
+
function addSub(link) {
|
|
787
|
+
const computed = link.dep.computed;
|
|
788
|
+
if (computed && !link.dep.subs) {
|
|
789
|
+
computed.flags |= 4 | 16;
|
|
790
|
+
for (let l = computed.deps; l; l = l.nextDep) {
|
|
791
|
+
addSub(l);
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
const currentTail = link.dep.subs;
|
|
795
|
+
if (currentTail !== link) {
|
|
796
|
+
link.prevSub = currentTail;
|
|
797
|
+
if (currentTail)
|
|
798
|
+
currentTail.nextSub = link;
|
|
799
|
+
}
|
|
800
|
+
if (link.dep.subsHead === void 0) {
|
|
801
|
+
link.dep.subsHead = link;
|
|
802
|
+
}
|
|
803
|
+
link.dep.subs = link;
|
|
804
|
+
}
|
|
607
805
|
const targetMap = /* @__PURE__ */ new WeakMap();
|
|
608
|
-
const ITERATE_KEY = Symbol("iterate" );
|
|
609
|
-
const MAP_KEY_ITERATE_KEY = Symbol("Map
|
|
806
|
+
const ITERATE_KEY = Symbol("Object iterate" );
|
|
807
|
+
const MAP_KEY_ITERATE_KEY = Symbol("Map keys iterate" );
|
|
808
|
+
const ARRAY_ITERATE_KEY = Symbol("Array iterate" );
|
|
610
809
|
function track(target, type, key) {
|
|
611
|
-
if (shouldTrack &&
|
|
810
|
+
if (shouldTrack && activeSub) {
|
|
612
811
|
let depsMap = targetMap.get(target);
|
|
613
812
|
if (!depsMap) {
|
|
614
813
|
targetMap.set(target, depsMap = /* @__PURE__ */ new Map());
|
|
615
814
|
}
|
|
616
815
|
let dep = depsMap.get(key);
|
|
617
816
|
if (!dep) {
|
|
618
|
-
depsMap.set(key, dep =
|
|
817
|
+
depsMap.set(key, dep = new Dep());
|
|
619
818
|
}
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
dep,
|
|
623
|
-
{
|
|
819
|
+
{
|
|
820
|
+
dep.track({
|
|
624
821
|
target,
|
|
625
822
|
type,
|
|
626
823
|
key
|
|
627
|
-
}
|
|
628
|
-
|
|
824
|
+
});
|
|
825
|
+
}
|
|
629
826
|
}
|
|
630
827
|
}
|
|
631
828
|
function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
632
829
|
const depsMap = targetMap.get(target);
|
|
633
830
|
if (!depsMap) {
|
|
831
|
+
globalVersion++;
|
|
634
832
|
return;
|
|
635
833
|
}
|
|
636
834
|
let deps = [];
|
|
637
835
|
if (type === "clear") {
|
|
638
836
|
deps = [...depsMap.values()];
|
|
639
|
-
} else if (key === "length" && isArray(target)) {
|
|
640
|
-
const newLength = Number(newValue);
|
|
641
|
-
depsMap.forEach((dep, key2) => {
|
|
642
|
-
if (key2 === "length" || !isSymbol(key2) && key2 >= newLength) {
|
|
643
|
-
deps.push(dep);
|
|
644
|
-
}
|
|
645
|
-
});
|
|
646
837
|
} else {
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
if (!
|
|
653
|
-
deps.push(
|
|
654
|
-
if (isMap(target)) {
|
|
655
|
-
deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
|
|
656
|
-
}
|
|
657
|
-
} else if (isIntegerKey(key)) {
|
|
658
|
-
deps.push(depsMap.get("length"));
|
|
838
|
+
const targetIsArray = isArray(target);
|
|
839
|
+
const isArrayIndex = targetIsArray && isIntegerKey(key);
|
|
840
|
+
if (targetIsArray && key === "length") {
|
|
841
|
+
const newLength = Number(newValue);
|
|
842
|
+
depsMap.forEach((dep, key2) => {
|
|
843
|
+
if (key2 === "length" || key2 === ARRAY_ITERATE_KEY || !isSymbol(key2) && key2 >= newLength) {
|
|
844
|
+
deps.push(dep);
|
|
659
845
|
}
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
846
|
+
});
|
|
847
|
+
} else {
|
|
848
|
+
const push = (dep) => dep && deps.push(dep);
|
|
849
|
+
if (key !== void 0) {
|
|
850
|
+
push(depsMap.get(key));
|
|
851
|
+
}
|
|
852
|
+
if (isArrayIndex) {
|
|
853
|
+
push(depsMap.get(ARRAY_ITERATE_KEY));
|
|
854
|
+
}
|
|
855
|
+
switch (type) {
|
|
856
|
+
case "add":
|
|
857
|
+
if (!targetIsArray) {
|
|
858
|
+
push(depsMap.get(ITERATE_KEY));
|
|
859
|
+
if (isMap(target)) {
|
|
860
|
+
push(depsMap.get(MAP_KEY_ITERATE_KEY));
|
|
861
|
+
}
|
|
862
|
+
} else if (isArrayIndex) {
|
|
863
|
+
push(depsMap.get("length"));
|
|
864
|
+
}
|
|
865
|
+
break;
|
|
866
|
+
case "delete":
|
|
867
|
+
if (!targetIsArray) {
|
|
868
|
+
push(depsMap.get(ITERATE_KEY));
|
|
869
|
+
if (isMap(target)) {
|
|
870
|
+
push(depsMap.get(MAP_KEY_ITERATE_KEY));
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
break;
|
|
874
|
+
case "set":
|
|
664
875
|
if (isMap(target)) {
|
|
665
|
-
|
|
876
|
+
push(depsMap.get(ITERATE_KEY));
|
|
666
877
|
}
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
case "set":
|
|
670
|
-
if (isMap(target)) {
|
|
671
|
-
deps.push(depsMap.get(ITERATE_KEY));
|
|
672
|
-
}
|
|
673
|
-
break;
|
|
878
|
+
break;
|
|
879
|
+
}
|
|
674
880
|
}
|
|
675
881
|
}
|
|
676
|
-
|
|
882
|
+
startBatch();
|
|
677
883
|
for (const dep of deps) {
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
oldValue,
|
|
688
|
-
oldTarget
|
|
689
|
-
}
|
|
690
|
-
);
|
|
884
|
+
{
|
|
885
|
+
dep.trigger({
|
|
886
|
+
target,
|
|
887
|
+
type,
|
|
888
|
+
key,
|
|
889
|
+
newValue,
|
|
890
|
+
oldValue,
|
|
891
|
+
oldTarget
|
|
892
|
+
});
|
|
691
893
|
}
|
|
692
894
|
}
|
|
693
|
-
|
|
895
|
+
endBatch();
|
|
694
896
|
}
|
|
695
897
|
function getDepFromReactive(object, key) {
|
|
696
898
|
var _a;
|
|
697
899
|
return (_a = targetMap.get(object)) == null ? void 0 : _a.get(key);
|
|
698
900
|
}
|
|
699
901
|
|
|
902
|
+
function reactiveReadArray(array) {
|
|
903
|
+
const raw = toRaw(array);
|
|
904
|
+
if (raw === array)
|
|
905
|
+
return raw;
|
|
906
|
+
track(raw, "iterate", ARRAY_ITERATE_KEY);
|
|
907
|
+
return isShallow(array) ? raw : raw.map(toReactive);
|
|
908
|
+
}
|
|
909
|
+
function shallowReadArray(arr) {
|
|
910
|
+
track(arr = toRaw(arr), "iterate", ARRAY_ITERATE_KEY);
|
|
911
|
+
return arr;
|
|
912
|
+
}
|
|
913
|
+
const arrayInstrumentations = {
|
|
914
|
+
__proto__: null,
|
|
915
|
+
[Symbol.iterator]() {
|
|
916
|
+
return iterator(this, Symbol.iterator, toReactive);
|
|
917
|
+
},
|
|
918
|
+
concat(...args) {
|
|
919
|
+
return reactiveReadArray(this).concat(
|
|
920
|
+
...args.map((x) => reactiveReadArray(x))
|
|
921
|
+
);
|
|
922
|
+
},
|
|
923
|
+
entries() {
|
|
924
|
+
return iterator(this, "entries", (value) => {
|
|
925
|
+
value[1] = toReactive(value[1]);
|
|
926
|
+
return value;
|
|
927
|
+
});
|
|
928
|
+
},
|
|
929
|
+
every(fn, thisArg) {
|
|
930
|
+
return apply(this, "every", fn, thisArg);
|
|
931
|
+
},
|
|
932
|
+
filter(fn, thisArg) {
|
|
933
|
+
const result = apply(this, "filter", fn, thisArg);
|
|
934
|
+
return isProxy(this) && !isShallow(this) ? result.map(toReactive) : result;
|
|
935
|
+
},
|
|
936
|
+
find(fn, thisArg) {
|
|
937
|
+
const result = apply(this, "find", fn, thisArg);
|
|
938
|
+
return isProxy(this) && !isShallow(this) ? toReactive(result) : result;
|
|
939
|
+
},
|
|
940
|
+
findIndex(fn, thisArg) {
|
|
941
|
+
return apply(this, "findIndex", fn, thisArg);
|
|
942
|
+
},
|
|
943
|
+
findLast(fn, thisArg) {
|
|
944
|
+
const result = apply(this, "findLast", fn, thisArg);
|
|
945
|
+
return isProxy(this) && !isShallow(this) ? toReactive(result) : result;
|
|
946
|
+
},
|
|
947
|
+
findLastIndex(fn, thisArg) {
|
|
948
|
+
return apply(this, "findLastIndex", fn, thisArg);
|
|
949
|
+
},
|
|
950
|
+
// flat, flatMap could benefit from ARRAY_ITERATE but are not straight-forward to implement
|
|
951
|
+
forEach(fn, thisArg) {
|
|
952
|
+
return apply(this, "forEach", fn, thisArg);
|
|
953
|
+
},
|
|
954
|
+
includes(...args) {
|
|
955
|
+
return searchProxy(this, "includes", args);
|
|
956
|
+
},
|
|
957
|
+
indexOf(...args) {
|
|
958
|
+
return searchProxy(this, "indexOf", args);
|
|
959
|
+
},
|
|
960
|
+
join(separator) {
|
|
961
|
+
return reactiveReadArray(this).join(separator);
|
|
962
|
+
},
|
|
963
|
+
// keys() iterator only reads `length`, no optimisation required
|
|
964
|
+
lastIndexOf(...args) {
|
|
965
|
+
return searchProxy(this, "lastIndexOf", args);
|
|
966
|
+
},
|
|
967
|
+
map(fn, thisArg) {
|
|
968
|
+
return apply(this, "map", fn, thisArg);
|
|
969
|
+
},
|
|
970
|
+
pop() {
|
|
971
|
+
return noTracking(this, "pop");
|
|
972
|
+
},
|
|
973
|
+
push(...args) {
|
|
974
|
+
return noTracking(this, "push", args);
|
|
975
|
+
},
|
|
976
|
+
reduce(fn, ...args) {
|
|
977
|
+
return reduce(this, "reduce", fn, args);
|
|
978
|
+
},
|
|
979
|
+
reduceRight(fn, ...args) {
|
|
980
|
+
return reduce(this, "reduceRight", fn, args);
|
|
981
|
+
},
|
|
982
|
+
shift() {
|
|
983
|
+
return noTracking(this, "shift");
|
|
984
|
+
},
|
|
985
|
+
// slice could use ARRAY_ITERATE but also seems to beg for range tracking
|
|
986
|
+
some(fn, thisArg) {
|
|
987
|
+
return apply(this, "some", fn, thisArg);
|
|
988
|
+
},
|
|
989
|
+
splice(...args) {
|
|
990
|
+
return noTracking(this, "splice", args);
|
|
991
|
+
},
|
|
992
|
+
toReversed() {
|
|
993
|
+
return reactiveReadArray(this).toReversed();
|
|
994
|
+
},
|
|
995
|
+
toSorted(comparer) {
|
|
996
|
+
return reactiveReadArray(this).toSorted(comparer);
|
|
997
|
+
},
|
|
998
|
+
toSpliced(...args) {
|
|
999
|
+
return reactiveReadArray(this).toSpliced(...args);
|
|
1000
|
+
},
|
|
1001
|
+
unshift(...args) {
|
|
1002
|
+
return noTracking(this, "unshift", args);
|
|
1003
|
+
},
|
|
1004
|
+
values() {
|
|
1005
|
+
return iterator(this, "values", toReactive);
|
|
1006
|
+
}
|
|
1007
|
+
};
|
|
1008
|
+
function iterator(self, method, wrapValue) {
|
|
1009
|
+
const arr = shallowReadArray(self);
|
|
1010
|
+
const iter = arr[method]();
|
|
1011
|
+
if (arr !== self && !isShallow(self)) {
|
|
1012
|
+
iter._next = iter.next;
|
|
1013
|
+
iter.next = () => {
|
|
1014
|
+
const result = iter._next();
|
|
1015
|
+
if (result.value) {
|
|
1016
|
+
result.value = wrapValue(result.value);
|
|
1017
|
+
}
|
|
1018
|
+
return result;
|
|
1019
|
+
};
|
|
1020
|
+
}
|
|
1021
|
+
return iter;
|
|
1022
|
+
}
|
|
1023
|
+
function apply(self, method, fn, thisArg) {
|
|
1024
|
+
const arr = shallowReadArray(self);
|
|
1025
|
+
let wrappedFn = fn;
|
|
1026
|
+
if (arr !== self) {
|
|
1027
|
+
if (!isShallow(self)) {
|
|
1028
|
+
wrappedFn = function(item, index) {
|
|
1029
|
+
return fn.call(this, toReactive(item), index, self);
|
|
1030
|
+
};
|
|
1031
|
+
} else if (fn.length > 2) {
|
|
1032
|
+
wrappedFn = function(item, index) {
|
|
1033
|
+
return fn.call(this, item, index, self);
|
|
1034
|
+
};
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
return arr[method](wrappedFn, thisArg);
|
|
1038
|
+
}
|
|
1039
|
+
function reduce(self, method, fn, args) {
|
|
1040
|
+
const arr = shallowReadArray(self);
|
|
1041
|
+
let wrappedFn = fn;
|
|
1042
|
+
if (arr !== self) {
|
|
1043
|
+
if (!isShallow(self)) {
|
|
1044
|
+
wrappedFn = function(acc, item, index) {
|
|
1045
|
+
return fn.call(this, acc, toReactive(item), index, self);
|
|
1046
|
+
};
|
|
1047
|
+
} else if (fn.length > 3) {
|
|
1048
|
+
wrappedFn = function(acc, item, index) {
|
|
1049
|
+
return fn.call(this, acc, item, index, self);
|
|
1050
|
+
};
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
return arr[method](wrappedFn, ...args);
|
|
1054
|
+
}
|
|
1055
|
+
function searchProxy(self, method, args) {
|
|
1056
|
+
const arr = toRaw(self);
|
|
1057
|
+
track(arr, "iterate", ARRAY_ITERATE_KEY);
|
|
1058
|
+
const res = arr[method](...args);
|
|
1059
|
+
if ((res === -1 || res === false) && isProxy(args[0])) {
|
|
1060
|
+
args[0] = toRaw(args[0]);
|
|
1061
|
+
return arr[method](...args);
|
|
1062
|
+
}
|
|
1063
|
+
return res;
|
|
1064
|
+
}
|
|
1065
|
+
function noTracking(self, method, args = []) {
|
|
1066
|
+
pauseTracking();
|
|
1067
|
+
startBatch();
|
|
1068
|
+
const res = toRaw(self)[method].apply(self, args);
|
|
1069
|
+
endBatch();
|
|
1070
|
+
resetTracking();
|
|
1071
|
+
return res;
|
|
1072
|
+
}
|
|
1073
|
+
|
|
700
1074
|
const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
|
|
701
1075
|
const builtInSymbols = new Set(
|
|
702
1076
|
/* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
|
|
703
1077
|
);
|
|
704
|
-
const arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations();
|
|
705
|
-
function createArrayInstrumentations() {
|
|
706
|
-
const instrumentations = {};
|
|
707
|
-
["includes", "indexOf", "lastIndexOf"].forEach((key) => {
|
|
708
|
-
instrumentations[key] = function(...args) {
|
|
709
|
-
const arr = toRaw(this);
|
|
710
|
-
for (let i = 0, l = this.length; i < l; i++) {
|
|
711
|
-
track(arr, "get", i + "");
|
|
712
|
-
}
|
|
713
|
-
const res = arr[key](...args);
|
|
714
|
-
if (res === -1 || res === false) {
|
|
715
|
-
return arr[key](...args.map(toRaw));
|
|
716
|
-
} else {
|
|
717
|
-
return res;
|
|
718
|
-
}
|
|
719
|
-
};
|
|
720
|
-
});
|
|
721
|
-
["push", "pop", "shift", "unshift", "splice"].forEach((key) => {
|
|
722
|
-
instrumentations[key] = function(...args) {
|
|
723
|
-
pauseTracking();
|
|
724
|
-
pauseScheduling();
|
|
725
|
-
const res = toRaw(this)[key].apply(this, args);
|
|
726
|
-
resetScheduling();
|
|
727
|
-
resetTracking();
|
|
728
|
-
return res;
|
|
729
|
-
};
|
|
730
|
-
});
|
|
731
|
-
return instrumentations;
|
|
732
|
-
}
|
|
733
1078
|
function hasOwnProperty(key) {
|
|
734
1079
|
if (!isSymbol(key))
|
|
735
1080
|
key = String(key);
|
|
@@ -760,14 +1105,22 @@ class BaseReactiveHandler {
|
|
|
760
1105
|
}
|
|
761
1106
|
const targetIsArray = isArray(target);
|
|
762
1107
|
if (!isReadonly2) {
|
|
763
|
-
|
|
764
|
-
|
|
1108
|
+
let fn;
|
|
1109
|
+
if (targetIsArray && (fn = arrayInstrumentations[key])) {
|
|
1110
|
+
return fn;
|
|
765
1111
|
}
|
|
766
1112
|
if (key === "hasOwnProperty") {
|
|
767
1113
|
return hasOwnProperty;
|
|
768
1114
|
}
|
|
769
1115
|
}
|
|
770
|
-
const res = Reflect.get(
|
|
1116
|
+
const res = Reflect.get(
|
|
1117
|
+
target,
|
|
1118
|
+
key,
|
|
1119
|
+
// if this is a proxy wrapping a ref, return methods using the raw ref
|
|
1120
|
+
// as receiver so that we don't have to call `toRaw` on the ref in all
|
|
1121
|
+
// its class methods
|
|
1122
|
+
isRef(target) ? target : receiver
|
|
1123
|
+
);
|
|
771
1124
|
if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
|
|
772
1125
|
return res;
|
|
773
1126
|
}
|
|
@@ -1266,110 +1619,8 @@ function markRaw(value) {
|
|
|
1266
1619
|
const toReactive = (value) => isObject(value) ? reactive(value) : value;
|
|
1267
1620
|
const toReadonly = (value) => isObject(value) ? readonly(value) : value;
|
|
1268
1621
|
|
|
1269
|
-
const COMPUTED_SIDE_EFFECT_WARN = `Computed is still dirty after getter evaluation, likely because a computed is mutating its own dependency in its getter. State mutations in computed getters should be avoided. Check the docs for more details: https://vuejs.org/guide/essentials/computed.html#getters-should-be-side-effect-free`;
|
|
1270
|
-
class ComputedRefImpl {
|
|
1271
|
-
constructor(getter, _setter, isReadonly, isSSR) {
|
|
1272
|
-
this.getter = getter;
|
|
1273
|
-
this._setter = _setter;
|
|
1274
|
-
this.dep = void 0;
|
|
1275
|
-
this.__v_isRef = true;
|
|
1276
|
-
this["__v_isReadonly"] = false;
|
|
1277
|
-
this.effect = new ReactiveEffect(
|
|
1278
|
-
() => getter(this._value),
|
|
1279
|
-
() => triggerRefValue(
|
|
1280
|
-
this,
|
|
1281
|
-
this.effect._dirtyLevel === 2 ? 2 : 3
|
|
1282
|
-
)
|
|
1283
|
-
);
|
|
1284
|
-
this.effect.computed = this;
|
|
1285
|
-
this.effect.active = this._cacheable = !isSSR;
|
|
1286
|
-
this["__v_isReadonly"] = isReadonly;
|
|
1287
|
-
}
|
|
1288
|
-
get value() {
|
|
1289
|
-
const self = toRaw(this);
|
|
1290
|
-
if ((!self._cacheable || self.effect.dirty) && hasChanged(self._value, self._value = self.effect.run())) {
|
|
1291
|
-
triggerRefValue(self, 4);
|
|
1292
|
-
}
|
|
1293
|
-
trackRefValue(self);
|
|
1294
|
-
if (self.effect._dirtyLevel >= 2) {
|
|
1295
|
-
if (this._warnRecursive) {
|
|
1296
|
-
warn$2(COMPUTED_SIDE_EFFECT_WARN, `
|
|
1297
|
-
|
|
1298
|
-
getter: `, this.getter);
|
|
1299
|
-
}
|
|
1300
|
-
triggerRefValue(self, 2);
|
|
1301
|
-
}
|
|
1302
|
-
return self._value;
|
|
1303
|
-
}
|
|
1304
|
-
set value(newValue) {
|
|
1305
|
-
this._setter(newValue);
|
|
1306
|
-
}
|
|
1307
|
-
// #region polyfill _dirty for backward compatibility third party code for Vue <= 3.3.x
|
|
1308
|
-
get _dirty() {
|
|
1309
|
-
return this.effect.dirty;
|
|
1310
|
-
}
|
|
1311
|
-
set _dirty(v) {
|
|
1312
|
-
this.effect.dirty = v;
|
|
1313
|
-
}
|
|
1314
|
-
// #endregion
|
|
1315
|
-
}
|
|
1316
|
-
function computed$1(getterOrOptions, debugOptions, isSSR = false) {
|
|
1317
|
-
let getter;
|
|
1318
|
-
let setter;
|
|
1319
|
-
const onlyGetter = isFunction(getterOrOptions);
|
|
1320
|
-
if (onlyGetter) {
|
|
1321
|
-
getter = getterOrOptions;
|
|
1322
|
-
setter = () => {
|
|
1323
|
-
warn$2("Write operation failed: computed value is readonly");
|
|
1324
|
-
} ;
|
|
1325
|
-
} else {
|
|
1326
|
-
getter = getterOrOptions.get;
|
|
1327
|
-
setter = getterOrOptions.set;
|
|
1328
|
-
}
|
|
1329
|
-
const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR);
|
|
1330
|
-
if (debugOptions && !isSSR) {
|
|
1331
|
-
cRef.effect.onTrack = debugOptions.onTrack;
|
|
1332
|
-
cRef.effect.onTrigger = debugOptions.onTrigger;
|
|
1333
|
-
}
|
|
1334
|
-
return cRef;
|
|
1335
|
-
}
|
|
1336
|
-
|
|
1337
|
-
function trackRefValue(ref2) {
|
|
1338
|
-
var _a;
|
|
1339
|
-
if (shouldTrack && activeEffect) {
|
|
1340
|
-
ref2 = toRaw(ref2);
|
|
1341
|
-
trackEffect(
|
|
1342
|
-
activeEffect,
|
|
1343
|
-
(_a = ref2.dep) != null ? _a : ref2.dep = createDep(
|
|
1344
|
-
() => ref2.dep = void 0,
|
|
1345
|
-
ref2 instanceof ComputedRefImpl ? ref2 : void 0
|
|
1346
|
-
),
|
|
1347
|
-
{
|
|
1348
|
-
target: ref2,
|
|
1349
|
-
type: "get",
|
|
1350
|
-
key: "value"
|
|
1351
|
-
}
|
|
1352
|
-
);
|
|
1353
|
-
}
|
|
1354
|
-
}
|
|
1355
|
-
function triggerRefValue(ref2, dirtyLevel = 4, newVal) {
|
|
1356
|
-
ref2 = toRaw(ref2);
|
|
1357
|
-
const dep = ref2.dep;
|
|
1358
|
-
if (dep) {
|
|
1359
|
-
triggerEffects(
|
|
1360
|
-
dep,
|
|
1361
|
-
dirtyLevel,
|
|
1362
|
-
{
|
|
1363
|
-
target: ref2,
|
|
1364
|
-
type: "set",
|
|
1365
|
-
key: "value",
|
|
1366
|
-
newValue: newVal
|
|
1367
|
-
}
|
|
1368
|
-
);
|
|
1369
|
-
}
|
|
1370
|
-
}
|
|
1371
1622
|
function isRef(r) {
|
|
1372
|
-
return
|
|
1623
|
+
return r ? r.__v_isRef === true : false;
|
|
1373
1624
|
}
|
|
1374
1625
|
function ref(value) {
|
|
1375
1626
|
return createRef(value, false);
|
|
@@ -1386,27 +1637,49 @@ function createRef(rawValue, shallow) {
|
|
|
1386
1637
|
class RefImpl {
|
|
1387
1638
|
constructor(value, __v_isShallow) {
|
|
1388
1639
|
this.__v_isShallow = __v_isShallow;
|
|
1389
|
-
this.dep =
|
|
1640
|
+
this.dep = new Dep();
|
|
1390
1641
|
this.__v_isRef = true;
|
|
1391
1642
|
this._rawValue = __v_isShallow ? value : toRaw(value);
|
|
1392
1643
|
this._value = __v_isShallow ? value : toReactive(value);
|
|
1393
1644
|
}
|
|
1394
1645
|
get value() {
|
|
1395
|
-
|
|
1646
|
+
{
|
|
1647
|
+
this.dep.track({
|
|
1648
|
+
target: this,
|
|
1649
|
+
type: "get",
|
|
1650
|
+
key: "value"
|
|
1651
|
+
});
|
|
1652
|
+
}
|
|
1396
1653
|
return this._value;
|
|
1397
1654
|
}
|
|
1398
|
-
set value(
|
|
1399
|
-
const
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
this.
|
|
1404
|
-
|
|
1655
|
+
set value(newValue) {
|
|
1656
|
+
const oldValue = this._rawValue;
|
|
1657
|
+
const useDirectValue = this.__v_isShallow || isShallow(newValue) || isReadonly(newValue);
|
|
1658
|
+
newValue = useDirectValue ? newValue : toRaw(newValue);
|
|
1659
|
+
if (hasChanged(newValue, oldValue)) {
|
|
1660
|
+
this._rawValue = newValue;
|
|
1661
|
+
this._value = useDirectValue ? newValue : toReactive(newValue);
|
|
1662
|
+
{
|
|
1663
|
+
this.dep.trigger({
|
|
1664
|
+
target: this,
|
|
1665
|
+
type: "set",
|
|
1666
|
+
key: "value",
|
|
1667
|
+
newValue,
|
|
1668
|
+
oldValue
|
|
1669
|
+
});
|
|
1670
|
+
}
|
|
1405
1671
|
}
|
|
1406
1672
|
}
|
|
1407
1673
|
}
|
|
1408
1674
|
function triggerRef(ref2) {
|
|
1409
|
-
|
|
1675
|
+
{
|
|
1676
|
+
ref2.dep.trigger({
|
|
1677
|
+
target: ref2,
|
|
1678
|
+
type: "set",
|
|
1679
|
+
key: "value",
|
|
1680
|
+
newValue: ref2._value
|
|
1681
|
+
});
|
|
1682
|
+
}
|
|
1410
1683
|
}
|
|
1411
1684
|
function unref(ref2) {
|
|
1412
1685
|
return isRef(ref2) ? ref2.value : ref2;
|
|
@@ -1431,12 +1704,9 @@ function proxyRefs(objectWithRefs) {
|
|
|
1431
1704
|
}
|
|
1432
1705
|
class CustomRefImpl {
|
|
1433
1706
|
constructor(factory) {
|
|
1434
|
-
this.dep = void 0;
|
|
1435
1707
|
this.__v_isRef = true;
|
|
1436
|
-
const
|
|
1437
|
-
|
|
1438
|
-
() => triggerRefValue(this)
|
|
1439
|
-
);
|
|
1708
|
+
const dep = this.dep = new Dep();
|
|
1709
|
+
const { get, set } = factory(dep.track.bind(dep), dep.trigger.bind(dep));
|
|
1440
1710
|
this._get = get;
|
|
1441
1711
|
this._set = set;
|
|
1442
1712
|
}
|
|
@@ -1504,6 +1774,90 @@ function propertyToRef(source, key, defaultValue) {
|
|
|
1504
1774
|
return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);
|
|
1505
1775
|
}
|
|
1506
1776
|
|
|
1777
|
+
class ComputedRefImpl {
|
|
1778
|
+
constructor(fn, setter, isSSR) {
|
|
1779
|
+
this.fn = fn;
|
|
1780
|
+
this.setter = setter;
|
|
1781
|
+
/**
|
|
1782
|
+
* @internal
|
|
1783
|
+
*/
|
|
1784
|
+
this._value = void 0;
|
|
1785
|
+
/**
|
|
1786
|
+
* @internal
|
|
1787
|
+
*/
|
|
1788
|
+
this.dep = new Dep(this);
|
|
1789
|
+
/**
|
|
1790
|
+
* @internal
|
|
1791
|
+
*/
|
|
1792
|
+
this.__v_isRef = true;
|
|
1793
|
+
// A computed is also a subscriber that tracks other deps
|
|
1794
|
+
/**
|
|
1795
|
+
* @internal
|
|
1796
|
+
*/
|
|
1797
|
+
this.deps = void 0;
|
|
1798
|
+
/**
|
|
1799
|
+
* @internal
|
|
1800
|
+
*/
|
|
1801
|
+
this.depsTail = void 0;
|
|
1802
|
+
/**
|
|
1803
|
+
* @internal
|
|
1804
|
+
*/
|
|
1805
|
+
this.flags = 16;
|
|
1806
|
+
/**
|
|
1807
|
+
* @internal
|
|
1808
|
+
*/
|
|
1809
|
+
this.globalVersion = globalVersion - 1;
|
|
1810
|
+
// for backwards compat
|
|
1811
|
+
this.effect = this;
|
|
1812
|
+
this.__v_isReadonly = !setter;
|
|
1813
|
+
this.isSSR = isSSR;
|
|
1814
|
+
}
|
|
1815
|
+
/**
|
|
1816
|
+
* @internal
|
|
1817
|
+
*/
|
|
1818
|
+
notify() {
|
|
1819
|
+
if (activeSub !== this) {
|
|
1820
|
+
this.flags |= 16;
|
|
1821
|
+
this.dep.notify();
|
|
1822
|
+
}
|
|
1823
|
+
}
|
|
1824
|
+
get value() {
|
|
1825
|
+
const link = this.dep.track({
|
|
1826
|
+
target: this,
|
|
1827
|
+
type: "get",
|
|
1828
|
+
key: "value"
|
|
1829
|
+
}) ;
|
|
1830
|
+
refreshComputed(this);
|
|
1831
|
+
if (link) {
|
|
1832
|
+
link.version = this.dep.version;
|
|
1833
|
+
}
|
|
1834
|
+
return this._value;
|
|
1835
|
+
}
|
|
1836
|
+
set value(newValue) {
|
|
1837
|
+
if (this.setter) {
|
|
1838
|
+
this.setter(newValue);
|
|
1839
|
+
} else {
|
|
1840
|
+
warn$2("Write operation failed: computed value is readonly");
|
|
1841
|
+
}
|
|
1842
|
+
}
|
|
1843
|
+
}
|
|
1844
|
+
function computed$1(getterOrOptions, debugOptions, isSSR = false) {
|
|
1845
|
+
let getter;
|
|
1846
|
+
let setter;
|
|
1847
|
+
if (isFunction(getterOrOptions)) {
|
|
1848
|
+
getter = getterOrOptions;
|
|
1849
|
+
} else {
|
|
1850
|
+
getter = getterOrOptions.get;
|
|
1851
|
+
setter = getterOrOptions.set;
|
|
1852
|
+
}
|
|
1853
|
+
const cRef = new ComputedRefImpl(getter, setter, isSSR);
|
|
1854
|
+
if (debugOptions && !isSSR) {
|
|
1855
|
+
cRef.onTrack = debugOptions.onTrack;
|
|
1856
|
+
cRef.onTrigger = debugOptions.onTrigger;
|
|
1857
|
+
}
|
|
1858
|
+
return cRef;
|
|
1859
|
+
}
|
|
1860
|
+
|
|
1507
1861
|
const TrackOpTypes = {
|
|
1508
1862
|
"GET": "get",
|
|
1509
1863
|
"HAS": "has",
|
|
@@ -1796,7 +2150,7 @@ function findInsertionIndex(id) {
|
|
|
1796
2150
|
const middle = start + end >>> 1;
|
|
1797
2151
|
const middleJob = queue[middle];
|
|
1798
2152
|
const middleJobId = getId(middleJob);
|
|
1799
|
-
if (middleJobId < id || middleJobId === id && middleJob.
|
|
2153
|
+
if (middleJobId < id || middleJobId === id && middleJob.flags & 2) {
|
|
1800
2154
|
start = middle + 1;
|
|
1801
2155
|
} else {
|
|
1802
2156
|
end = middle;
|
|
@@ -1805,15 +2159,21 @@ function findInsertionIndex(id) {
|
|
|
1805
2159
|
return start;
|
|
1806
2160
|
}
|
|
1807
2161
|
function queueJob(job) {
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex
|
|
1811
|
-
)) {
|
|
2162
|
+
var _a;
|
|
2163
|
+
if (!(job.flags & 1)) {
|
|
1812
2164
|
if (job.id == null) {
|
|
1813
2165
|
queue.push(job);
|
|
2166
|
+
} else if (
|
|
2167
|
+
// fast path when the job id is larger than the tail
|
|
2168
|
+
!(job.flags & 2) && job.id >= (((_a = queue[queue.length - 1]) == null ? void 0 : _a.id) || 0)
|
|
2169
|
+
) {
|
|
2170
|
+
queue.push(job);
|
|
1814
2171
|
} else {
|
|
1815
2172
|
queue.splice(findInsertionIndex(job.id), 0, job);
|
|
1816
2173
|
}
|
|
2174
|
+
if (!(job.flags & 4)) {
|
|
2175
|
+
job.flags |= 1;
|
|
2176
|
+
}
|
|
1817
2177
|
queueFlush();
|
|
1818
2178
|
}
|
|
1819
2179
|
}
|
|
@@ -1831,11 +2191,11 @@ function invalidateJob(job) {
|
|
|
1831
2191
|
}
|
|
1832
2192
|
function queuePostFlushCb(cb) {
|
|
1833
2193
|
if (!isArray(cb)) {
|
|
1834
|
-
if (!
|
|
1835
|
-
cb,
|
|
1836
|
-
cb.allowRecurse ? postFlushIndex + 1 : postFlushIndex
|
|
1837
|
-
)) {
|
|
2194
|
+
if (!(cb.flags & 1)) {
|
|
1838
2195
|
pendingPostFlushCbs.push(cb);
|
|
2196
|
+
if (!(cb.flags & 4)) {
|
|
2197
|
+
cb.flags |= 1;
|
|
2198
|
+
}
|
|
1839
2199
|
}
|
|
1840
2200
|
} else {
|
|
1841
2201
|
pendingPostFlushCbs.push(...cb);
|
|
@@ -1848,7 +2208,7 @@ function flushPreFlushCbs(instance, seen, i = isFlushing ? flushIndex + 1 : 0) {
|
|
|
1848
2208
|
}
|
|
1849
2209
|
for (; i < queue.length; i++) {
|
|
1850
2210
|
const cb = queue[i];
|
|
1851
|
-
if (cb && cb.
|
|
2211
|
+
if (cb && cb.flags & 2) {
|
|
1852
2212
|
if (instance && cb.id !== instance.uid) {
|
|
1853
2213
|
continue;
|
|
1854
2214
|
}
|
|
@@ -1858,6 +2218,7 @@ function flushPreFlushCbs(instance, seen, i = isFlushing ? flushIndex + 1 : 0) {
|
|
|
1858
2218
|
queue.splice(i, 1);
|
|
1859
2219
|
i--;
|
|
1860
2220
|
cb();
|
|
2221
|
+
cb.flags &= ~1;
|
|
1861
2222
|
}
|
|
1862
2223
|
}
|
|
1863
2224
|
}
|
|
@@ -1880,6 +2241,7 @@ function flushPostFlushCbs(seen) {
|
|
|
1880
2241
|
continue;
|
|
1881
2242
|
}
|
|
1882
2243
|
activePostFlushCbs[postFlushIndex]();
|
|
2244
|
+
activePostFlushCbs[postFlushIndex].flags &= ~1;
|
|
1883
2245
|
}
|
|
1884
2246
|
activePostFlushCbs = null;
|
|
1885
2247
|
postFlushIndex = 0;
|
|
@@ -1889,9 +2251,11 @@ const getId = (job) => job.id == null ? Infinity : job.id;
|
|
|
1889
2251
|
const comparator = (a, b) => {
|
|
1890
2252
|
const diff = getId(a) - getId(b);
|
|
1891
2253
|
if (diff === 0) {
|
|
1892
|
-
|
|
2254
|
+
const isAPre = a.flags & 2;
|
|
2255
|
+
const isBPre = b.flags & 2;
|
|
2256
|
+
if (isAPre && !isBPre)
|
|
1893
2257
|
return -1;
|
|
1894
|
-
if (
|
|
2258
|
+
if (isBPre && !isAPre)
|
|
1895
2259
|
return 1;
|
|
1896
2260
|
}
|
|
1897
2261
|
return diff;
|
|
@@ -1907,11 +2271,12 @@ function flushJobs(seen) {
|
|
|
1907
2271
|
try {
|
|
1908
2272
|
for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
|
|
1909
2273
|
const job = queue[flushIndex];
|
|
1910
|
-
if (job && job.
|
|
2274
|
+
if (job && !(job.flags & 8)) {
|
|
1911
2275
|
if (check(job)) {
|
|
1912
2276
|
continue;
|
|
1913
2277
|
}
|
|
1914
2278
|
callWithErrorHandling(job, null, 14);
|
|
2279
|
+
job.flags &= ~1;
|
|
1915
2280
|
}
|
|
1916
2281
|
}
|
|
1917
2282
|
} finally {
|
|
@@ -1993,7 +2358,6 @@ function rerender(id, newRender) {
|
|
|
1993
2358
|
}
|
|
1994
2359
|
instance.renderCache = [];
|
|
1995
2360
|
isHmrUpdating = true;
|
|
1996
|
-
instance.effect.dirty = true;
|
|
1997
2361
|
instance.update();
|
|
1998
2362
|
isHmrUpdating = false;
|
|
1999
2363
|
});
|
|
@@ -2021,7 +2385,6 @@ function reload(id, newComp) {
|
|
|
2021
2385
|
instance.ceReload(newComp.styles);
|
|
2022
2386
|
hmrDirtyComponents.delete(oldComp);
|
|
2023
2387
|
} else if (instance.parent) {
|
|
2024
|
-
instance.parent.effect.dirty = true;
|
|
2025
2388
|
queueJob(instance.parent.update);
|
|
2026
2389
|
} else if (instance.appContext.reload) {
|
|
2027
2390
|
instance.appContext.reload();
|
|
@@ -3991,8 +4354,8 @@ function doWatch(source, cb, {
|
|
|
3991
4354
|
};
|
|
3992
4355
|
};
|
|
3993
4356
|
let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
|
|
3994
|
-
const job = () => {
|
|
3995
|
-
if (!effect.
|
|
4357
|
+
const job = (immediateFirstRun) => {
|
|
4358
|
+
if (!(effect.flags & 1) || !effect.dirty && !immediateFirstRun) {
|
|
3996
4359
|
return;
|
|
3997
4360
|
}
|
|
3998
4361
|
if (cb) {
|
|
@@ -4013,19 +4376,22 @@ function doWatch(source, cb, {
|
|
|
4013
4376
|
effect.run();
|
|
4014
4377
|
}
|
|
4015
4378
|
};
|
|
4016
|
-
|
|
4379
|
+
if (cb)
|
|
4380
|
+
job.flags |= 4;
|
|
4381
|
+
const effect = new ReactiveEffect(getter);
|
|
4017
4382
|
let scheduler;
|
|
4018
4383
|
if (flush === "sync") {
|
|
4384
|
+
effect.flags |= 64;
|
|
4019
4385
|
scheduler = job;
|
|
4020
4386
|
} else if (flush === "post") {
|
|
4021
4387
|
scheduler = () => queuePostRenderEffect(job, instance && instance.suspense);
|
|
4022
4388
|
} else {
|
|
4023
|
-
job.
|
|
4389
|
+
job.flags |= 2;
|
|
4024
4390
|
if (instance)
|
|
4025
4391
|
job.id = instance.uid;
|
|
4026
4392
|
scheduler = () => queueJob(job);
|
|
4027
4393
|
}
|
|
4028
|
-
|
|
4394
|
+
effect.scheduler = scheduler;
|
|
4029
4395
|
const scope = getCurrentScope();
|
|
4030
4396
|
const unwatch = () => {
|
|
4031
4397
|
effect.stop();
|
|
@@ -4039,7 +4405,7 @@ function doWatch(source, cb, {
|
|
|
4039
4405
|
}
|
|
4040
4406
|
if (cb) {
|
|
4041
4407
|
if (immediate) {
|
|
4042
|
-
job();
|
|
4408
|
+
job(true);
|
|
4043
4409
|
} else {
|
|
4044
4410
|
oldValue = effect.run();
|
|
4045
4411
|
}
|
|
@@ -4221,22 +4587,7 @@ const BaseTransitionImpl = {
|
|
|
4221
4587
|
if (!children || !children.length) {
|
|
4222
4588
|
return;
|
|
4223
4589
|
}
|
|
4224
|
-
|
|
4225
|
-
if (children.length > 1) {
|
|
4226
|
-
let hasFound = false;
|
|
4227
|
-
for (const c of children) {
|
|
4228
|
-
if (c.type !== Comment) {
|
|
4229
|
-
if (hasFound) {
|
|
4230
|
-
warn$1(
|
|
4231
|
-
"<transition> can only be used on a single element or component. Use <transition-group> for lists."
|
|
4232
|
-
);
|
|
4233
|
-
break;
|
|
4234
|
-
}
|
|
4235
|
-
child = c;
|
|
4236
|
-
hasFound = true;
|
|
4237
|
-
}
|
|
4238
|
-
}
|
|
4239
|
-
}
|
|
4590
|
+
const child = findNonCommentChild(children);
|
|
4240
4591
|
const rawProps = toRaw(props);
|
|
4241
4592
|
const { mode } = rawProps;
|
|
4242
4593
|
if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") {
|
|
@@ -4245,7 +4596,7 @@ const BaseTransitionImpl = {
|
|
|
4245
4596
|
if (state.isLeaving) {
|
|
4246
4597
|
return emptyPlaceholder(child);
|
|
4247
4598
|
}
|
|
4248
|
-
const innerChild =
|
|
4599
|
+
const innerChild = getInnerChild$1(child);
|
|
4249
4600
|
if (!innerChild) {
|
|
4250
4601
|
return emptyPlaceholder(child);
|
|
4251
4602
|
}
|
|
@@ -4257,7 +4608,7 @@ const BaseTransitionImpl = {
|
|
|
4257
4608
|
);
|
|
4258
4609
|
setTransitionHooks(innerChild, enterHooks);
|
|
4259
4610
|
const oldChild = instance.subTree;
|
|
4260
|
-
const oldInnerChild = oldChild &&
|
|
4611
|
+
const oldInnerChild = oldChild && getInnerChild$1(oldChild);
|
|
4261
4612
|
if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild)) {
|
|
4262
4613
|
const leavingHooks = resolveTransitionHooks(
|
|
4263
4614
|
oldInnerChild,
|
|
@@ -4270,8 +4621,7 @@ const BaseTransitionImpl = {
|
|
|
4270
4621
|
state.isLeaving = true;
|
|
4271
4622
|
leavingHooks.afterLeave = () => {
|
|
4272
4623
|
state.isLeaving = false;
|
|
4273
|
-
if (instance.
|
|
4274
|
-
instance.effect.dirty = true;
|
|
4624
|
+
if (!(instance.job.flags & 8)) {
|
|
4275
4625
|
instance.update();
|
|
4276
4626
|
}
|
|
4277
4627
|
};
|
|
@@ -4299,6 +4649,25 @@ const BaseTransitionImpl = {
|
|
|
4299
4649
|
{
|
|
4300
4650
|
BaseTransitionImpl.__isBuiltIn = true;
|
|
4301
4651
|
}
|
|
4652
|
+
function findNonCommentChild(children) {
|
|
4653
|
+
let child = children[0];
|
|
4654
|
+
if (children.length > 1) {
|
|
4655
|
+
let hasFound = false;
|
|
4656
|
+
for (const c of children) {
|
|
4657
|
+
if (c.type !== Comment) {
|
|
4658
|
+
if (hasFound) {
|
|
4659
|
+
warn$1(
|
|
4660
|
+
"<transition> can only be used on a single element or component. Use <transition-group> for lists."
|
|
4661
|
+
);
|
|
4662
|
+
break;
|
|
4663
|
+
}
|
|
4664
|
+
child = c;
|
|
4665
|
+
hasFound = true;
|
|
4666
|
+
}
|
|
4667
|
+
}
|
|
4668
|
+
}
|
|
4669
|
+
return child;
|
|
4670
|
+
}
|
|
4302
4671
|
const BaseTransition = BaseTransitionImpl;
|
|
4303
4672
|
function getLeavingNodesForType(state, vnode) {
|
|
4304
4673
|
const { leavingVNodes } = state;
|
|
@@ -4453,8 +4822,11 @@ function emptyPlaceholder(vnode) {
|
|
|
4453
4822
|
return vnode;
|
|
4454
4823
|
}
|
|
4455
4824
|
}
|
|
4456
|
-
function
|
|
4825
|
+
function getInnerChild$1(vnode) {
|
|
4457
4826
|
if (!isKeepAlive(vnode)) {
|
|
4827
|
+
if (isTeleport(vnode.type) && vnode.children) {
|
|
4828
|
+
return findNonCommentChild(vnode.children);
|
|
4829
|
+
}
|
|
4458
4830
|
return vnode;
|
|
4459
4831
|
}
|
|
4460
4832
|
if (vnode.component) {
|
|
@@ -4623,7 +4995,6 @@ function defineAsyncComponent(source) {
|
|
|
4623
4995
|
load().then(() => {
|
|
4624
4996
|
loaded.value = true;
|
|
4625
4997
|
if (instance.parent && isKeepAlive(instance.parent.vnode)) {
|
|
4626
|
-
instance.parent.effect.dirty = true;
|
|
4627
4998
|
queueJob(instance.parent.update);
|
|
4628
4999
|
}
|
|
4629
5000
|
}).catch((err) => {
|
|
@@ -5235,10 +5606,20 @@ function convertLegacyFunctionalComponent(comp) {
|
|
|
5235
5606
|
function renderList(source, renderItem, cache, index) {
|
|
5236
5607
|
let ret;
|
|
5237
5608
|
const cached = cache && cache[index];
|
|
5238
|
-
|
|
5609
|
+
const sourceIsArray = isArray(source);
|
|
5610
|
+
const sourceIsReactiveArray = sourceIsArray && isReactive(source);
|
|
5611
|
+
if (sourceIsArray || isString(source)) {
|
|
5612
|
+
if (sourceIsReactiveArray) {
|
|
5613
|
+
source = shallowReadArray(source);
|
|
5614
|
+
}
|
|
5239
5615
|
ret = new Array(source.length);
|
|
5240
5616
|
for (let i = 0, l = source.length; i < l; i++) {
|
|
5241
|
-
ret[i] = renderItem(
|
|
5617
|
+
ret[i] = renderItem(
|
|
5618
|
+
sourceIsReactiveArray ? toReactive(source[i]) : source[i],
|
|
5619
|
+
i,
|
|
5620
|
+
void 0,
|
|
5621
|
+
cached && cached[i]
|
|
5622
|
+
);
|
|
5242
5623
|
}
|
|
5243
5624
|
} else if (typeof source === "number") {
|
|
5244
5625
|
if (!Number.isInteger(source)) {
|
|
@@ -5609,7 +5990,6 @@ const publicPropertiesMap = (
|
|
|
5609
5990
|
$emit: (i) => i.emit,
|
|
5610
5991
|
$options: (i) => resolveMergedOptions(i) ,
|
|
5611
5992
|
$forceUpdate: (i) => i.f || (i.f = () => {
|
|
5612
|
-
i.effect.dirty = true;
|
|
5613
5993
|
queueJob(i.update);
|
|
5614
5994
|
}),
|
|
5615
5995
|
$nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)),
|
|
@@ -6480,7 +6860,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
|
|
|
6480
6860
|
return vm;
|
|
6481
6861
|
}
|
|
6482
6862
|
}
|
|
6483
|
-
Vue.version = `2.6.14-compat:${"3.
|
|
6863
|
+
Vue.version = `2.6.14-compat:${"3.5.0-alpha.1"}`;
|
|
6484
6864
|
Vue.config = singletonApp.config;
|
|
6485
6865
|
Vue.use = (p, ...options) => {
|
|
6486
6866
|
if (p && isFunction(p.install)) {
|
|
@@ -7498,7 +7878,9 @@ const isSimpleType = /* @__PURE__ */ makeMap(
|
|
|
7498
7878
|
function assertType(value, type) {
|
|
7499
7879
|
let valid;
|
|
7500
7880
|
const expectedType = getType(type);
|
|
7501
|
-
if (
|
|
7881
|
+
if (expectedType === "null") {
|
|
7882
|
+
valid = value === null;
|
|
7883
|
+
} else if (isSimpleType(expectedType)) {
|
|
7502
7884
|
const t = typeof value;
|
|
7503
7885
|
valid = t === expectedType.toLowerCase();
|
|
7504
7886
|
if (!valid && t === "object") {
|
|
@@ -7508,8 +7890,6 @@ function assertType(value, type) {
|
|
|
7508
7890
|
valid = isObject(value);
|
|
7509
7891
|
} else if (expectedType === "Array") {
|
|
7510
7892
|
valid = isArray(value);
|
|
7511
|
-
} else if (expectedType === "null") {
|
|
7512
|
-
valid = value === null;
|
|
7513
7893
|
} else {
|
|
7514
7894
|
valid = value instanceof type;
|
|
7515
7895
|
}
|
|
@@ -9034,7 +9414,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9034
9414
|
} else {
|
|
9035
9415
|
instance.next = n2;
|
|
9036
9416
|
invalidateJob(instance.update);
|
|
9037
|
-
instance.effect.dirty = true;
|
|
9038
9417
|
instance.update();
|
|
9039
9418
|
}
|
|
9040
9419
|
} else {
|
|
@@ -9241,24 +9620,18 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9241
9620
|
}
|
|
9242
9621
|
}
|
|
9243
9622
|
};
|
|
9244
|
-
|
|
9245
|
-
|
|
9246
|
-
|
|
9247
|
-
|
|
9248
|
-
|
|
9249
|
-
|
|
9250
|
-
);
|
|
9251
|
-
const update = instance.update = () => {
|
|
9252
|
-
if (effect.dirty) {
|
|
9253
|
-
effect.run();
|
|
9254
|
-
}
|
|
9255
|
-
};
|
|
9256
|
-
update.id = instance.uid;
|
|
9623
|
+
instance.scope.on();
|
|
9624
|
+
const effect = instance.effect = new ReactiveEffect(componentUpdateFn);
|
|
9625
|
+
instance.scope.off();
|
|
9626
|
+
const update = instance.update = effect.run.bind(effect);
|
|
9627
|
+
const job = instance.job = effect.runIfDirty.bind(effect);
|
|
9628
|
+
job.id = instance.uid;
|
|
9629
|
+
effect.scheduler = () => queueJob(job);
|
|
9257
9630
|
toggleRecurse(instance, true);
|
|
9258
9631
|
{
|
|
9259
9632
|
effect.onTrack = instance.rtc ? (e) => invokeArrayFns(instance.rtc, e) : void 0;
|
|
9260
9633
|
effect.onTrigger = instance.rtg ? (e) => invokeArrayFns(instance.rtg, e) : void 0;
|
|
9261
|
-
|
|
9634
|
+
job.ownerInstance = instance;
|
|
9262
9635
|
}
|
|
9263
9636
|
update();
|
|
9264
9637
|
};
|
|
@@ -9725,7 +10098,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9725
10098
|
if (instance.type.__hmrId) {
|
|
9726
10099
|
unregisterHMR(instance);
|
|
9727
10100
|
}
|
|
9728
|
-
const { bum, scope,
|
|
10101
|
+
const { bum, scope, job, subTree, um } = instance;
|
|
9729
10102
|
if (bum) {
|
|
9730
10103
|
invokeArrayFns(bum);
|
|
9731
10104
|
}
|
|
@@ -9733,8 +10106,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9733
10106
|
instance.emit("hook:beforeDestroy");
|
|
9734
10107
|
}
|
|
9735
10108
|
scope.stop();
|
|
9736
|
-
if (
|
|
9737
|
-
|
|
10109
|
+
if (job) {
|
|
10110
|
+
job.flags |= 8;
|
|
9738
10111
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
9739
10112
|
}
|
|
9740
10113
|
if (um) {
|
|
@@ -9826,8 +10199,14 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9826
10199
|
function resolveChildrenNamespace({ type, props }, currentNamespace) {
|
|
9827
10200
|
return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
|
|
9828
10201
|
}
|
|
9829
|
-
function toggleRecurse({ effect,
|
|
9830
|
-
|
|
10202
|
+
function toggleRecurse({ effect, job }, allowed) {
|
|
10203
|
+
if (allowed) {
|
|
10204
|
+
effect.flags |= 32;
|
|
10205
|
+
job.flags |= 4;
|
|
10206
|
+
} else {
|
|
10207
|
+
effect.flags &= ~32;
|
|
10208
|
+
job.flags &= ~4;
|
|
10209
|
+
}
|
|
9831
10210
|
}
|
|
9832
10211
|
function needTransition(parentSuspense, transition) {
|
|
9833
10212
|
return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
|
|
@@ -10625,6 +11004,7 @@ function createComponentInstance(vnode, parent, suspense) {
|
|
|
10625
11004
|
effect: null,
|
|
10626
11005
|
update: null,
|
|
10627
11006
|
// will be set synchronously right after creation
|
|
11007
|
+
job: null,
|
|
10628
11008
|
scope: new EffectScope(
|
|
10629
11009
|
true
|
|
10630
11010
|
/* detached */
|
|
@@ -11130,7 +11510,8 @@ function initCustomFormatter() {
|
|
|
11130
11510
|
{},
|
|
11131
11511
|
["span", vueStyle, genRefFlag(obj)],
|
|
11132
11512
|
"<",
|
|
11133
|
-
|
|
11513
|
+
// avoid debugger accessing value affecting behavior
|
|
11514
|
+
formatValue("_value" in obj ? obj._value : obj),
|
|
11134
11515
|
`>`
|
|
11135
11516
|
];
|
|
11136
11517
|
} else if (isReactive(obj)) {
|
|
@@ -11310,7 +11691,7 @@ function isMemoSame(cached, memo) {
|
|
|
11310
11691
|
return true;
|
|
11311
11692
|
}
|
|
11312
11693
|
|
|
11313
|
-
const version = "3.
|
|
11694
|
+
const version = "3.5.0-alpha.1";
|
|
11314
11695
|
const warn = warn$1 ;
|
|
11315
11696
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
11316
11697
|
const devtools = devtools$1 ;
|
|
@@ -12877,7 +13258,9 @@ const withKeys = (fn, modifiers) => {
|
|
|
12877
13258
|
return;
|
|
12878
13259
|
}
|
|
12879
13260
|
const eventKey = hyphenate(event.key);
|
|
12880
|
-
if (modifiers.some(
|
|
13261
|
+
if (modifiers.some(
|
|
13262
|
+
(k) => k === eventKey || keyNames[k] === eventKey
|
|
13263
|
+
)) {
|
|
12881
13264
|
return fn(event);
|
|
12882
13265
|
}
|
|
12883
13266
|
{
|