@vue/runtime-dom 3.4.0-alpha.1 → 3.4.0-alpha.3
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 +7 -8
- package/dist/runtime-dom.cjs.prod.js +7 -8
- package/dist/runtime-dom.d.ts +27 -14
- package/dist/runtime-dom.esm-browser.js +121 -92
- package/dist/runtime-dom.esm-browser.prod.js +5 -5
- package/dist/runtime-dom.esm-bundler.js +7 -8
- package/dist/runtime-dom.global.js +121 -92
- package/dist/runtime-dom.global.prod.js +5 -5
- package/package.json +4 -4
package/dist/runtime-dom.cjs.js
CHANGED
|
@@ -1097,21 +1097,20 @@ const vModelText = {
|
|
|
1097
1097
|
el[assignKey] = getModelAssigner(vnode);
|
|
1098
1098
|
if (el.composing)
|
|
1099
1099
|
return;
|
|
1100
|
+
const elValue = number || el.type === "number" ? shared.looseToNumber(el.value) : el.value;
|
|
1101
|
+
const newValue = value == null ? "" : value;
|
|
1102
|
+
if (elValue === newValue) {
|
|
1103
|
+
return;
|
|
1104
|
+
}
|
|
1100
1105
|
if (document.activeElement === el && el.type !== "range") {
|
|
1101
1106
|
if (lazy) {
|
|
1102
1107
|
return;
|
|
1103
1108
|
}
|
|
1104
|
-
if (trim && el.value.trim() ===
|
|
1105
|
-
return;
|
|
1106
|
-
}
|
|
1107
|
-
if ((number || el.type === "number") && shared.looseToNumber(el.value) === value) {
|
|
1109
|
+
if (trim && el.value.trim() === newValue) {
|
|
1108
1110
|
return;
|
|
1109
1111
|
}
|
|
1110
1112
|
}
|
|
1111
|
-
|
|
1112
|
-
if (el.value !== newValue) {
|
|
1113
|
-
el.value = newValue;
|
|
1114
|
-
}
|
|
1113
|
+
el.value = newValue;
|
|
1115
1114
|
}
|
|
1116
1115
|
};
|
|
1117
1116
|
const vModelCheckbox = {
|
|
@@ -1056,21 +1056,20 @@ const vModelText = {
|
|
|
1056
1056
|
el[assignKey] = getModelAssigner(vnode);
|
|
1057
1057
|
if (el.composing)
|
|
1058
1058
|
return;
|
|
1059
|
+
const elValue = number || el.type === "number" ? shared.looseToNumber(el.value) : el.value;
|
|
1060
|
+
const newValue = value == null ? "" : value;
|
|
1061
|
+
if (elValue === newValue) {
|
|
1062
|
+
return;
|
|
1063
|
+
}
|
|
1059
1064
|
if (document.activeElement === el && el.type !== "range") {
|
|
1060
1065
|
if (lazy) {
|
|
1061
1066
|
return;
|
|
1062
1067
|
}
|
|
1063
|
-
if (trim && el.value.trim() ===
|
|
1064
|
-
return;
|
|
1065
|
-
}
|
|
1066
|
-
if ((number || el.type === "number") && shared.looseToNumber(el.value) === value) {
|
|
1068
|
+
if (trim && el.value.trim() === newValue) {
|
|
1067
1069
|
return;
|
|
1068
1070
|
}
|
|
1069
1071
|
}
|
|
1070
|
-
|
|
1071
|
-
if (el.value !== newValue) {
|
|
1072
|
-
el.value = newValue;
|
|
1073
|
-
}
|
|
1072
|
+
el.value = newValue;
|
|
1074
1073
|
}
|
|
1075
1074
|
};
|
|
1076
1075
|
const vModelCheckbox = {
|
package/dist/runtime-dom.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SetupContext, RenderFunction, ComputedOptions, MethodOptions, ComponentOptionsMixin, EmitsOptions, ComponentInjectOptions, SlotsType, ComponentOptionsWithoutProps, ComponentOptionsWithArrayProps, ComponentPropsOptions, ComponentOptionsWithObjectProps, ExtractPropTypes,
|
|
1
|
+
import { SetupContext, RenderFunction, ComputedOptions, MethodOptions, ComponentOptionsMixin, EmitsOptions, ComponentInjectOptions, SlotsType, ComponentOptionsWithoutProps, ComponentOptionsWithArrayProps, ComponentPropsOptions, ComponentOptionsWithObjectProps, ExtractPropTypes, DefineComponent, RootHydrateFunction, ConcreteComponent, BaseTransitionProps, FunctionalComponent, ObjectDirective, VNodeRef, RootRenderFunction, CreateAppFunction } from '@vue/runtime-core';
|
|
2
2
|
export * from '@vue/runtime-core';
|
|
3
3
|
import * as CSS from 'csstype';
|
|
4
4
|
|
|
@@ -17,9 +17,7 @@ export declare function defineCustomElement<PropNames extends string, RawBinding
|
|
|
17
17
|
export declare function defineCustomElement<PropsOptions extends Readonly<ComponentPropsOptions>, RawBindings, D, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = Record<string, any>, EE extends string = string, I extends ComponentInjectOptions = {}, II extends string = string, S extends SlotsType = {}>(options: ComponentOptionsWithObjectProps<PropsOptions, RawBindings, D, C, M, Mixin, Extends, E, EE, I, II, S> & {
|
|
18
18
|
styles?: string[];
|
|
19
19
|
}): VueElementConstructor<ExtractPropTypes<PropsOptions>>;
|
|
20
|
-
export declare function defineCustomElement(options:
|
|
21
|
-
new (...args: any[]): ComponentPublicInstance;
|
|
22
|
-
}): VueElementConstructor;
|
|
20
|
+
export declare function defineCustomElement<P>(options: DefineComponent<P, any, any, any>): VueElementConstructor<ExtractPropTypes<P>>;
|
|
23
21
|
/*! #__NO_SIDE_EFFECTS__ */
|
|
24
22
|
export declare const defineSSRCustomElement: typeof defineCustomElement;
|
|
25
23
|
declare const BaseClass: {
|
|
@@ -271,7 +269,7 @@ interface AriaAttributes {
|
|
|
271
269
|
* Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified.
|
|
272
270
|
* @see aria-atomic.
|
|
273
271
|
*/
|
|
274
|
-
'aria-relevant'?: 'additions' | 'additions text' | 'all' | 'removals' | 'text';
|
|
272
|
+
'aria-relevant'?: 'additions' | 'additions removals' | 'additions text' | 'all' | 'removals' | 'removals additions' | 'removals text' | 'text' | 'text additions' | 'text removals';
|
|
275
273
|
/** Indicates that user input is required on the element before a form may be submitted. */
|
|
276
274
|
'aria-required'?: Booleanish;
|
|
277
275
|
/** Defines a human-readable, author-localized description for the role of an element. */
|
|
@@ -315,7 +313,7 @@ interface AriaAttributes {
|
|
|
315
313
|
/** Defines the human readable text alternative of aria-valuenow for a range widget. */
|
|
316
314
|
'aria-valuetext'?: string;
|
|
317
315
|
}
|
|
318
|
-
export type StyleValue = string | CSSProperties | Array<StyleValue>;
|
|
316
|
+
export type StyleValue = false | null | undefined | string | CSSProperties | Array<StyleValue>;
|
|
319
317
|
export interface HTMLAttributes extends AriaAttributes, EventHandlers<Events> {
|
|
320
318
|
innerHTML?: string;
|
|
321
319
|
class?: any;
|
|
@@ -411,7 +409,7 @@ export interface ButtonHTMLAttributes extends HTMLAttributes {
|
|
|
411
409
|
formtarget?: string;
|
|
412
410
|
name?: string;
|
|
413
411
|
type?: 'submit' | 'reset' | 'button';
|
|
414
|
-
value?: string | string
|
|
412
|
+
value?: string | ReadonlyArray<string> | number;
|
|
415
413
|
}
|
|
416
414
|
export interface CanvasHTMLAttributes extends HTMLAttributes {
|
|
417
415
|
height?: Numberish;
|
|
@@ -425,10 +423,11 @@ export interface ColgroupHTMLAttributes extends HTMLAttributes {
|
|
|
425
423
|
span?: Numberish;
|
|
426
424
|
}
|
|
427
425
|
export interface DataHTMLAttributes extends HTMLAttributes {
|
|
428
|
-
value?: string | string
|
|
426
|
+
value?: string | ReadonlyArray<string> | number;
|
|
429
427
|
}
|
|
430
428
|
export interface DetailsHTMLAttributes extends HTMLAttributes {
|
|
431
429
|
open?: Booleanish;
|
|
430
|
+
onToggle?: Event;
|
|
432
431
|
}
|
|
433
432
|
export interface DelHTMLAttributes extends HTMLAttributes {
|
|
434
433
|
cite?: string;
|
|
@@ -465,13 +464,17 @@ export interface IframeHTMLAttributes extends HTMLAttributes {
|
|
|
465
464
|
allow?: string;
|
|
466
465
|
allowfullscreen?: Booleanish;
|
|
467
466
|
allowtransparency?: Booleanish;
|
|
467
|
+
/** @deprecated */
|
|
468
468
|
frameborder?: Numberish;
|
|
469
469
|
height?: Numberish;
|
|
470
|
+
/** @deprecated */
|
|
470
471
|
marginheight?: Numberish;
|
|
472
|
+
/** @deprecated */
|
|
471
473
|
marginwidth?: Numberish;
|
|
472
474
|
name?: string;
|
|
473
475
|
referrerpolicy?: HTMLAttributeReferrerPolicy;
|
|
474
476
|
sandbox?: string;
|
|
477
|
+
/** @deprecated */
|
|
475
478
|
scrolling?: string;
|
|
476
479
|
seamless?: Booleanish;
|
|
477
480
|
src?: string;
|
|
@@ -483,13 +486,13 @@ export interface ImgHTMLAttributes extends HTMLAttributes {
|
|
|
483
486
|
crossorigin?: 'anonymous' | 'use-credentials' | '';
|
|
484
487
|
decoding?: 'async' | 'auto' | 'sync';
|
|
485
488
|
height?: Numberish;
|
|
489
|
+
loading?: 'eager' | 'lazy';
|
|
486
490
|
referrerpolicy?: HTMLAttributeReferrerPolicy;
|
|
487
491
|
sizes?: string;
|
|
488
492
|
src?: string;
|
|
489
493
|
srcset?: string;
|
|
490
494
|
usemap?: string;
|
|
491
495
|
width?: Numberish;
|
|
492
|
-
loading?: 'lazy' | 'eager';
|
|
493
496
|
}
|
|
494
497
|
export interface InsHTMLAttributes extends HTMLAttributes {
|
|
495
498
|
cite?: string;
|
|
@@ -505,6 +508,7 @@ export interface InputHTMLAttributes extends HTMLAttributes {
|
|
|
505
508
|
checked?: Booleanish | any[] | Set<any>;
|
|
506
509
|
crossorigin?: string;
|
|
507
510
|
disabled?: Booleanish;
|
|
511
|
+
enterKeyHint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';
|
|
508
512
|
form?: string;
|
|
509
513
|
formaction?: string;
|
|
510
514
|
formenctype?: string;
|
|
@@ -545,7 +549,7 @@ export interface LabelHTMLAttributes extends HTMLAttributes {
|
|
|
545
549
|
form?: string;
|
|
546
550
|
}
|
|
547
551
|
export interface LiHTMLAttributes extends HTMLAttributes {
|
|
548
|
-
value?: string | string
|
|
552
|
+
value?: string | ReadonlyArray<string> | number;
|
|
549
553
|
}
|
|
550
554
|
export interface LinkHTMLAttributes extends HTMLAttributes {
|
|
551
555
|
as?: string;
|
|
@@ -558,6 +562,7 @@ export interface LinkHTMLAttributes extends HTMLAttributes {
|
|
|
558
562
|
rel?: string;
|
|
559
563
|
sizes?: string;
|
|
560
564
|
type?: string;
|
|
565
|
+
charset?: string;
|
|
561
566
|
}
|
|
562
567
|
export interface MapHTMLAttributes extends HTMLAttributes {
|
|
563
568
|
name?: string;
|
|
@@ -590,7 +595,7 @@ export interface MeterHTMLAttributes extends HTMLAttributes {
|
|
|
590
595
|
max?: Numberish;
|
|
591
596
|
min?: Numberish;
|
|
592
597
|
optimum?: Numberish;
|
|
593
|
-
value?: string | string
|
|
598
|
+
value?: string | ReadonlyArray<string> | number;
|
|
594
599
|
}
|
|
595
600
|
export interface QuoteHTMLAttributes extends HTMLAttributes {
|
|
596
601
|
cite?: string;
|
|
@@ -628,14 +633,15 @@ export interface OutputHTMLAttributes extends HTMLAttributes {
|
|
|
628
633
|
}
|
|
629
634
|
export interface ParamHTMLAttributes extends HTMLAttributes {
|
|
630
635
|
name?: string;
|
|
631
|
-
value?: string | string
|
|
636
|
+
value?: string | ReadonlyArray<string> | number;
|
|
632
637
|
}
|
|
633
638
|
export interface ProgressHTMLAttributes extends HTMLAttributes {
|
|
634
639
|
max?: Numberish;
|
|
635
|
-
value?: string | string
|
|
640
|
+
value?: string | ReadonlyArray<string> | number;
|
|
636
641
|
}
|
|
637
642
|
export interface ScriptHTMLAttributes extends HTMLAttributes {
|
|
638
643
|
async?: Booleanish;
|
|
644
|
+
/** @deprecated */
|
|
639
645
|
charset?: string;
|
|
640
646
|
crossorigin?: string;
|
|
641
647
|
defer?: Booleanish;
|
|
@@ -674,6 +680,7 @@ export interface TableHTMLAttributes extends HTMLAttributes {
|
|
|
674
680
|
cellpadding?: Numberish;
|
|
675
681
|
cellspacing?: Numberish;
|
|
676
682
|
summary?: string;
|
|
683
|
+
width?: Numberish;
|
|
677
684
|
}
|
|
678
685
|
export interface TextareaHTMLAttributes extends HTMLAttributes {
|
|
679
686
|
autocomplete?: string;
|
|
@@ -689,7 +696,7 @@ export interface TextareaHTMLAttributes extends HTMLAttributes {
|
|
|
689
696
|
readonly?: Booleanish;
|
|
690
697
|
required?: Booleanish;
|
|
691
698
|
rows?: Numberish;
|
|
692
|
-
value?: string | string
|
|
699
|
+
value?: string | ReadonlyArray<string> | number;
|
|
693
700
|
wrap?: string;
|
|
694
701
|
}
|
|
695
702
|
export interface TdHTMLAttributes extends HTMLAttributes {
|
|
@@ -698,6 +705,9 @@ export interface TdHTMLAttributes extends HTMLAttributes {
|
|
|
698
705
|
headers?: string;
|
|
699
706
|
rowspan?: Numberish;
|
|
700
707
|
scope?: string;
|
|
708
|
+
abbr?: string;
|
|
709
|
+
height?: Numberish;
|
|
710
|
+
width?: Numberish;
|
|
701
711
|
valign?: 'top' | 'middle' | 'bottom' | 'baseline';
|
|
702
712
|
}
|
|
703
713
|
export interface ThHTMLAttributes extends HTMLAttributes {
|
|
@@ -706,6 +716,7 @@ export interface ThHTMLAttributes extends HTMLAttributes {
|
|
|
706
716
|
headers?: string;
|
|
707
717
|
rowspan?: Numberish;
|
|
708
718
|
scope?: string;
|
|
719
|
+
abbr?: string;
|
|
709
720
|
}
|
|
710
721
|
export interface TimeHTMLAttributes extends HTMLAttributes {
|
|
711
722
|
datetime?: string;
|
|
@@ -723,6 +734,7 @@ export interface VideoHTMLAttributes extends MediaHTMLAttributes {
|
|
|
723
734
|
poster?: string;
|
|
724
735
|
width?: Numberish;
|
|
725
736
|
disablePictureInPicture?: Booleanish;
|
|
737
|
+
disableRemotePlayback?: Booleanish;
|
|
726
738
|
}
|
|
727
739
|
export interface WebViewHTMLAttributes extends HTMLAttributes {
|
|
728
740
|
allowfullscreen?: Booleanish;
|
|
@@ -765,6 +777,7 @@ export interface SVGAttributes extends AriaAttributes, EventHandlers<Events> {
|
|
|
765
777
|
width?: Numberish;
|
|
766
778
|
role?: string;
|
|
767
779
|
tabindex?: Numberish;
|
|
780
|
+
crossOrigin?: 'anonymous' | 'use-credentials' | '';
|
|
768
781
|
'accent-height'?: Numberish;
|
|
769
782
|
accumulate?: 'none' | 'sum';
|
|
770
783
|
additive?: 'replace' | 'sum';
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
function makeMap(str, expectsLowerCase) {
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
for (let i = 0; i < list.length; i++) {
|
|
5
|
-
map[list[i]] = true;
|
|
6
|
-
}
|
|
7
|
-
return expectsLowerCase ? (val) => !!map[val.toLowerCase()] : (val) => !!map[val];
|
|
2
|
+
const set = new Set(str.split(","));
|
|
3
|
+
return expectsLowerCase ? (val) => set.has(val.toLowerCase()) : (val) => set.has(val);
|
|
8
4
|
}
|
|
9
5
|
|
|
10
6
|
const EMPTY_OBJ = Object.freeze({}) ;
|
|
@@ -961,7 +957,7 @@ function createReadonlyMethod(type) {
|
|
|
961
957
|
toRaw(this)
|
|
962
958
|
);
|
|
963
959
|
}
|
|
964
|
-
return type === "delete" ? false : this;
|
|
960
|
+
return type === "delete" ? false : type === "clear" ? void 0 : this;
|
|
965
961
|
};
|
|
966
962
|
}
|
|
967
963
|
function createInstrumentations() {
|
|
@@ -1217,9 +1213,10 @@ class ComputedRefImpl {
|
|
|
1217
1213
|
this.dep = void 0;
|
|
1218
1214
|
this.__v_isRef = true;
|
|
1219
1215
|
this["__v_isReadonly"] = false;
|
|
1220
|
-
this.effect = new ReactiveEffect(
|
|
1221
|
-
|
|
1222
|
-
|
|
1216
|
+
this.effect = new ReactiveEffect(
|
|
1217
|
+
() => getter(this._value),
|
|
1218
|
+
() => triggerRefValue(this, 1)
|
|
1219
|
+
);
|
|
1223
1220
|
this.effect.computed = this;
|
|
1224
1221
|
this.effect.active = this._cacheable = !isSSR;
|
|
1225
1222
|
this["__v_isReadonly"] = isReadonly;
|
|
@@ -2246,9 +2243,19 @@ function renderComponentRoot(instance) {
|
|
|
2246
2243
|
try {
|
|
2247
2244
|
if (vnode.shapeFlag & 4) {
|
|
2248
2245
|
const proxyToUse = withProxy || proxy;
|
|
2246
|
+
const thisProxy = setupState.__isScriptSetup ? new Proxy(proxyToUse, {
|
|
2247
|
+
get(target, key, receiver) {
|
|
2248
|
+
warn(
|
|
2249
|
+
`Property '${String(
|
|
2250
|
+
key
|
|
2251
|
+
)}' was accessed via 'this'. Avoid using 'this' in templates.`
|
|
2252
|
+
);
|
|
2253
|
+
return Reflect.get(target, key, receiver);
|
|
2254
|
+
}
|
|
2255
|
+
}) : proxyToUse;
|
|
2249
2256
|
result = normalizeVNode(
|
|
2250
2257
|
render.call(
|
|
2251
|
-
|
|
2258
|
+
thisProxy,
|
|
2252
2259
|
proxyToUse,
|
|
2253
2260
|
renderCache,
|
|
2254
2261
|
props,
|
|
@@ -2483,6 +2490,61 @@ function updateHOCHostEl({ vnode, parent }, el) {
|
|
|
2483
2490
|
}
|
|
2484
2491
|
}
|
|
2485
2492
|
|
|
2493
|
+
const COMPONENTS = "components";
|
|
2494
|
+
const DIRECTIVES = "directives";
|
|
2495
|
+
function resolveComponent(name, maybeSelfReference) {
|
|
2496
|
+
return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
|
|
2497
|
+
}
|
|
2498
|
+
const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
|
|
2499
|
+
function resolveDynamicComponent(component) {
|
|
2500
|
+
if (isString(component)) {
|
|
2501
|
+
return resolveAsset(COMPONENTS, component, false) || component;
|
|
2502
|
+
} else {
|
|
2503
|
+
return component || NULL_DYNAMIC_COMPONENT;
|
|
2504
|
+
}
|
|
2505
|
+
}
|
|
2506
|
+
function resolveDirective(name) {
|
|
2507
|
+
return resolveAsset(DIRECTIVES, name);
|
|
2508
|
+
}
|
|
2509
|
+
function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
|
|
2510
|
+
const instance = currentRenderingInstance || currentInstance;
|
|
2511
|
+
if (instance) {
|
|
2512
|
+
const Component = instance.type;
|
|
2513
|
+
if (type === COMPONENTS) {
|
|
2514
|
+
const selfName = getComponentName(
|
|
2515
|
+
Component,
|
|
2516
|
+
false
|
|
2517
|
+
/* do not include inferred name to avoid breaking existing code */
|
|
2518
|
+
);
|
|
2519
|
+
if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) {
|
|
2520
|
+
return Component;
|
|
2521
|
+
}
|
|
2522
|
+
}
|
|
2523
|
+
const res = (
|
|
2524
|
+
// local registration
|
|
2525
|
+
// check instance[type] first which is resolved for options API
|
|
2526
|
+
resolve(instance[type] || Component[type], name) || // global registration
|
|
2527
|
+
resolve(instance.appContext[type], name)
|
|
2528
|
+
);
|
|
2529
|
+
if (!res && maybeSelfReference) {
|
|
2530
|
+
return Component;
|
|
2531
|
+
}
|
|
2532
|
+
if (warnMissing && !res) {
|
|
2533
|
+
const extra = type === COMPONENTS ? `
|
|
2534
|
+
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``;
|
|
2535
|
+
warn(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
|
|
2536
|
+
}
|
|
2537
|
+
return res;
|
|
2538
|
+
} else {
|
|
2539
|
+
warn(
|
|
2540
|
+
`resolve${capitalize(type.slice(0, -1))} can only be used in render() or setup().`
|
|
2541
|
+
);
|
|
2542
|
+
}
|
|
2543
|
+
}
|
|
2544
|
+
function resolve(registry, name) {
|
|
2545
|
+
return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]);
|
|
2546
|
+
}
|
|
2547
|
+
|
|
2486
2548
|
const isSuspense = (type) => type.__isSuspense;
|
|
2487
2549
|
const SuspenseImpl = {
|
|
2488
2550
|
name: "Suspense",
|
|
@@ -3017,7 +3079,7 @@ function normalizeSuspenseSlot(s) {
|
|
|
3017
3079
|
}
|
|
3018
3080
|
if (isArray(s)) {
|
|
3019
3081
|
const singleChild = filterSingleRoot(s);
|
|
3020
|
-
if (!singleChild) {
|
|
3082
|
+
if (!singleChild && s.filter((child) => child !== NULL_DYNAMIC_COMPONENT).length > 0) {
|
|
3021
3083
|
warn(`<Suspense> slots expect a single root node.`);
|
|
3022
3084
|
}
|
|
3023
3085
|
s = singleChild;
|
|
@@ -3167,6 +3229,7 @@ function doWatch(source, cb, { immediate, deep, flush, once, onTrack, onTrigger
|
|
|
3167
3229
|
let onCleanup = (fn) => {
|
|
3168
3230
|
cleanup = effect.onStop = () => {
|
|
3169
3231
|
callWithErrorHandling(fn, instance, 4);
|
|
3232
|
+
cleanup = effect.onStop = void 0;
|
|
3170
3233
|
};
|
|
3171
3234
|
};
|
|
3172
3235
|
let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
|
|
@@ -3638,7 +3701,11 @@ function emptyPlaceholder(vnode) {
|
|
|
3638
3701
|
}
|
|
3639
3702
|
}
|
|
3640
3703
|
function getKeepAliveChild(vnode) {
|
|
3641
|
-
return isKeepAlive(vnode) ?
|
|
3704
|
+
return isKeepAlive(vnode) ? (
|
|
3705
|
+
// #7121 ensure get the child component subtree in case
|
|
3706
|
+
// it's been replaced during HMR
|
|
3707
|
+
vnode.component ? vnode.component.subTree : vnode.children ? vnode.children[0] : void 0
|
|
3708
|
+
) : vnode;
|
|
3642
3709
|
}
|
|
3643
3710
|
function setTransitionHooks(vnode, hooks) {
|
|
3644
3711
|
if (vnode.shapeFlag & 6 && vnode.component) {
|
|
@@ -4116,61 +4183,6 @@ function onErrorCaptured(hook, target = currentInstance) {
|
|
|
4116
4183
|
injectHook("ec", hook, target);
|
|
4117
4184
|
}
|
|
4118
4185
|
|
|
4119
|
-
const COMPONENTS = "components";
|
|
4120
|
-
const DIRECTIVES = "directives";
|
|
4121
|
-
function resolveComponent(name, maybeSelfReference) {
|
|
4122
|
-
return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
|
|
4123
|
-
}
|
|
4124
|
-
const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
|
|
4125
|
-
function resolveDynamicComponent(component) {
|
|
4126
|
-
if (isString(component)) {
|
|
4127
|
-
return resolveAsset(COMPONENTS, component, false) || component;
|
|
4128
|
-
} else {
|
|
4129
|
-
return component || NULL_DYNAMIC_COMPONENT;
|
|
4130
|
-
}
|
|
4131
|
-
}
|
|
4132
|
-
function resolveDirective(name) {
|
|
4133
|
-
return resolveAsset(DIRECTIVES, name);
|
|
4134
|
-
}
|
|
4135
|
-
function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
|
|
4136
|
-
const instance = currentRenderingInstance || currentInstance;
|
|
4137
|
-
if (instance) {
|
|
4138
|
-
const Component = instance.type;
|
|
4139
|
-
if (type === COMPONENTS) {
|
|
4140
|
-
const selfName = getComponentName(
|
|
4141
|
-
Component,
|
|
4142
|
-
false
|
|
4143
|
-
/* do not include inferred name to avoid breaking existing code */
|
|
4144
|
-
);
|
|
4145
|
-
if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) {
|
|
4146
|
-
return Component;
|
|
4147
|
-
}
|
|
4148
|
-
}
|
|
4149
|
-
const res = (
|
|
4150
|
-
// local registration
|
|
4151
|
-
// check instance[type] first which is resolved for options API
|
|
4152
|
-
resolve(instance[type] || Component[type], name) || // global registration
|
|
4153
|
-
resolve(instance.appContext[type], name)
|
|
4154
|
-
);
|
|
4155
|
-
if (!res && maybeSelfReference) {
|
|
4156
|
-
return Component;
|
|
4157
|
-
}
|
|
4158
|
-
if (warnMissing && !res) {
|
|
4159
|
-
const extra = type === COMPONENTS ? `
|
|
4160
|
-
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``;
|
|
4161
|
-
warn(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
|
|
4162
|
-
}
|
|
4163
|
-
return res;
|
|
4164
|
-
} else {
|
|
4165
|
-
warn(
|
|
4166
|
-
`resolve${capitalize(type.slice(0, -1))} can only be used in render() or setup().`
|
|
4167
|
-
);
|
|
4168
|
-
}
|
|
4169
|
-
}
|
|
4170
|
-
function resolve(registry, name) {
|
|
4171
|
-
return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]);
|
|
4172
|
-
}
|
|
4173
|
-
|
|
4174
4186
|
function renderList(source, renderItem, cache, index) {
|
|
4175
4187
|
let ret;
|
|
4176
4188
|
const cached = cache && cache[index];
|
|
@@ -5690,6 +5702,9 @@ function assertType(value, type) {
|
|
|
5690
5702
|
};
|
|
5691
5703
|
}
|
|
5692
5704
|
function getInvalidTypeMessage(name, value, expectedTypes) {
|
|
5705
|
+
if (expectedTypes.length === 0) {
|
|
5706
|
+
return `Prop type [] for prop "${name}" won't match anything. Did you mean to use type Array instead?`;
|
|
5707
|
+
}
|
|
5693
5708
|
let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(capitalize).join(" | ")}`;
|
|
5694
5709
|
const expectedType = expectedTypes[0];
|
|
5695
5710
|
const receivedType = toRawType(value);
|
|
@@ -5959,6 +5974,20 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
5959
5974
|
const { type, ref, shapeFlag, patchFlag } = vnode;
|
|
5960
5975
|
let domType = node.nodeType;
|
|
5961
5976
|
vnode.el = node;
|
|
5977
|
+
{
|
|
5978
|
+
if (!("__vnode" in node)) {
|
|
5979
|
+
Object.defineProperty(node, "__vnode", {
|
|
5980
|
+
value: vnode,
|
|
5981
|
+
enumerable: false
|
|
5982
|
+
});
|
|
5983
|
+
}
|
|
5984
|
+
if (!("__vueParentComponent" in node)) {
|
|
5985
|
+
Object.defineProperty(node, "__vueParentComponent", {
|
|
5986
|
+
value: parentComponent,
|
|
5987
|
+
enumerable: false
|
|
5988
|
+
});
|
|
5989
|
+
}
|
|
5990
|
+
}
|
|
5962
5991
|
if (patchFlag === -2) {
|
|
5963
5992
|
optimized = false;
|
|
5964
5993
|
vnode.dynamicChildren = null;
|
|
@@ -5989,15 +6018,15 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
5989
6018
|
}
|
|
5990
6019
|
break;
|
|
5991
6020
|
case Comment:
|
|
5992
|
-
if (
|
|
5993
|
-
|
|
5994
|
-
|
|
5995
|
-
|
|
5996
|
-
|
|
5997
|
-
|
|
5998
|
-
|
|
5999
|
-
|
|
6000
|
-
|
|
6021
|
+
if (isTemplateNode(node)) {
|
|
6022
|
+
nextNode = nextSibling(node);
|
|
6023
|
+
replaceNode(
|
|
6024
|
+
vnode.el = node.content.firstChild,
|
|
6025
|
+
node,
|
|
6026
|
+
parentComponent
|
|
6027
|
+
);
|
|
6028
|
+
} else if (domType !== 8 /* COMMENT */ || isFragmentStart) {
|
|
6029
|
+
nextNode = onMismatch();
|
|
6001
6030
|
} else {
|
|
6002
6031
|
nextNode = nextSibling(node);
|
|
6003
6032
|
}
|
|
@@ -6120,15 +6149,16 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
6120
6149
|
const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
|
|
6121
6150
|
optimized = optimized || !!vnode.dynamicChildren;
|
|
6122
6151
|
const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
|
|
6123
|
-
const
|
|
6152
|
+
const forcePatch = type === "input" || type === "option";
|
|
6124
6153
|
{
|
|
6125
6154
|
if (dirs) {
|
|
6126
6155
|
invokeDirectiveHook(vnode, null, parentComponent, "created");
|
|
6127
6156
|
}
|
|
6128
6157
|
if (props) {
|
|
6129
|
-
if (
|
|
6158
|
+
if (forcePatch || !optimized || patchFlag & (16 | 32)) {
|
|
6130
6159
|
for (const key in props) {
|
|
6131
|
-
if (
|
|
6160
|
+
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
|
|
6161
|
+
key[0] === ".") {
|
|
6132
6162
|
patchProp(
|
|
6133
6163
|
el,
|
|
6134
6164
|
key,
|
|
@@ -6341,8 +6371,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
6341
6371
|
let parent = parentComponent;
|
|
6342
6372
|
while (parent) {
|
|
6343
6373
|
if (parent.vnode.el === oldNode) {
|
|
6344
|
-
parent.vnode.el = newNode;
|
|
6345
|
-
parent.subTree.el = newNode;
|
|
6374
|
+
parent.vnode.el = parent.subTree.el = newNode;
|
|
6346
6375
|
}
|
|
6347
6376
|
parent = parent.parent;
|
|
6348
6377
|
}
|
|
@@ -7892,6 +7921,7 @@ const resolveTarget = (props, select) => {
|
|
|
7892
7921
|
}
|
|
7893
7922
|
};
|
|
7894
7923
|
const TeleportImpl = {
|
|
7924
|
+
name: "Teleport",
|
|
7895
7925
|
__isTeleport: true,
|
|
7896
7926
|
process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals) {
|
|
7897
7927
|
const {
|
|
@@ -8313,7 +8343,7 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
|
|
|
8313
8343
|
if (shapeFlag & 4 && isProxy(type)) {
|
|
8314
8344
|
type = toRaw(type);
|
|
8315
8345
|
warn(
|
|
8316
|
-
`Vue received a Component
|
|
8346
|
+
`Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with \`markRaw\` or using \`shallowRef\` instead of \`ref\`.`,
|
|
8317
8347
|
`
|
|
8318
8348
|
Component that was made reactive: `,
|
|
8319
8349
|
type
|
|
@@ -9134,7 +9164,7 @@ function isMemoSame(cached, memo) {
|
|
|
9134
9164
|
return true;
|
|
9135
9165
|
}
|
|
9136
9166
|
|
|
9137
|
-
const version = "3.4.0-alpha.
|
|
9167
|
+
const version = "3.4.0-alpha.3";
|
|
9138
9168
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
9139
9169
|
const ssrUtils = null;
|
|
9140
9170
|
const resolveFilter = null;
|
|
@@ -10280,21 +10310,20 @@ const vModelText = {
|
|
|
10280
10310
|
el[assignKey] = getModelAssigner(vnode);
|
|
10281
10311
|
if (el.composing)
|
|
10282
10312
|
return;
|
|
10313
|
+
const elValue = number || el.type === "number" ? looseToNumber(el.value) : el.value;
|
|
10314
|
+
const newValue = value == null ? "" : value;
|
|
10315
|
+
if (elValue === newValue) {
|
|
10316
|
+
return;
|
|
10317
|
+
}
|
|
10283
10318
|
if (document.activeElement === el && el.type !== "range") {
|
|
10284
10319
|
if (lazy) {
|
|
10285
10320
|
return;
|
|
10286
10321
|
}
|
|
10287
|
-
if (trim && el.value.trim() ===
|
|
10288
|
-
return;
|
|
10289
|
-
}
|
|
10290
|
-
if ((number || el.type === "number") && looseToNumber(el.value) === value) {
|
|
10322
|
+
if (trim && el.value.trim() === newValue) {
|
|
10291
10323
|
return;
|
|
10292
10324
|
}
|
|
10293
10325
|
}
|
|
10294
|
-
|
|
10295
|
-
if (el.value !== newValue) {
|
|
10296
|
-
el.value = newValue;
|
|
10297
|
-
}
|
|
10326
|
+
el.value = newValue;
|
|
10298
10327
|
}
|
|
10299
10328
|
};
|
|
10300
10329
|
const vModelCheckbox = {
|