@vue/runtime-dom 3.3.8 → 3.3.9

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.
@@ -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() === value) {
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
- const newValue = value == null ? "" : value;
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() === value) {
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
- const newValue = value == null ? "" : value;
1071
- if (el.value !== newValue) {
1072
- el.value = newValue;
1073
- }
1072
+ el.value = newValue;
1074
1073
  }
1075
1074
  };
1076
1075
  const vModelCheckbox = {
@@ -1,4 +1,4 @@
1
- import { SetupContext, RenderFunction, ComputedOptions, MethodOptions, ComponentOptionsMixin, EmitsOptions, ComponentInjectOptions, SlotsType, ComponentOptionsWithoutProps, ComponentOptionsWithArrayProps, ComponentPropsOptions, ComponentOptionsWithObjectProps, ExtractPropTypes, ComponentPublicInstance, RootHydrateFunction, ConcreteComponent, BaseTransitionProps, FunctionalComponent, ObjectDirective, VNodeRef, RootRenderFunction, CreateAppFunction } from '@vue/runtime-core';
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: {
@@ -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[] | number;
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[] | number;
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[] | number;
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[] | number;
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[] | number;
636
+ value?: string | ReadonlyArray<string> | number;
632
637
  }
633
638
  export interface ProgressHTMLAttributes extends HTMLAttributes {
634
639
  max?: Numberish;
635
- value?: string | string[] | number;
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[] | number;
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';
@@ -936,7 +936,7 @@ function createReadonlyMethod(type) {
936
936
  toRaw(this)
937
937
  );
938
938
  }
939
- return type === "delete" ? false : this;
939
+ return type === "delete" ? false : type === "clear" ? void 0 : this;
940
940
  };
941
941
  }
942
942
  function createInstrumentations() {
@@ -2207,9 +2207,19 @@ function renderComponentRoot(instance) {
2207
2207
  try {
2208
2208
  if (vnode.shapeFlag & 4) {
2209
2209
  const proxyToUse = withProxy || proxy;
2210
+ const thisProxy = setupState.__isScriptSetup ? new Proxy(proxyToUse, {
2211
+ get(target, key, receiver) {
2212
+ warn(
2213
+ `Property '${String(
2214
+ key
2215
+ )}' was accessed via 'this'. Avoid using 'this' in templates.`
2216
+ );
2217
+ return Reflect.get(target, key, receiver);
2218
+ }
2219
+ }) : proxyToUse;
2210
2220
  result = normalizeVNode(
2211
2221
  render.call(
2212
- proxyToUse,
2222
+ thisProxy,
2213
2223
  proxyToUse,
2214
2224
  renderCache,
2215
2225
  props,
@@ -3171,6 +3181,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
3171
3181
  let onCleanup = (fn) => {
3172
3182
  cleanup = effect.onStop = () => {
3173
3183
  callWithErrorHandling(fn, instance, 4);
3184
+ cleanup = effect.onStop = void 0;
3174
3185
  };
3175
3186
  };
3176
3187
  let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
@@ -3641,7 +3652,11 @@ function emptyPlaceholder(vnode) {
3641
3652
  }
3642
3653
  }
3643
3654
  function getKeepAliveChild(vnode) {
3644
- return isKeepAlive(vnode) ? vnode.children ? vnode.children[0] : void 0 : vnode;
3655
+ return isKeepAlive(vnode) ? (
3656
+ // #7121 ensure get the child component subtree in case
3657
+ // it's been replaced during HMR
3658
+ vnode.component ? vnode.component.subTree : vnode.children ? vnode.children[0] : void 0
3659
+ ) : vnode;
3645
3660
  }
3646
3661
  function setTransitionHooks(vnode, hooks) {
3647
3662
  if (vnode.shapeFlag & 6 && vnode.component) {
@@ -5634,6 +5649,9 @@ function assertType(value, type) {
5634
5649
  };
5635
5650
  }
5636
5651
  function getInvalidTypeMessage(name, value, expectedTypes) {
5652
+ if (expectedTypes.length === 0) {
5653
+ return `Prop type [] for prop "${name}" won't match anything. Did you mean to use type Array instead?`;
5654
+ }
5637
5655
  let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(capitalize).join(" | ")}`;
5638
5656
  const expectedType = expectedTypes[0];
5639
5657
  const receivedType = toRawType(value);
@@ -5903,6 +5921,20 @@ function createHydrationFunctions(rendererInternals) {
5903
5921
  const { type, ref, shapeFlag, patchFlag } = vnode;
5904
5922
  let domType = node.nodeType;
5905
5923
  vnode.el = node;
5924
+ {
5925
+ if (!("__vnode" in node)) {
5926
+ Object.defineProperty(node, "__vnode", {
5927
+ value: vnode,
5928
+ enumerable: false
5929
+ });
5930
+ }
5931
+ if (!("__vueParentComponent" in node)) {
5932
+ Object.defineProperty(node, "__vueParentComponent", {
5933
+ value: parentComponent,
5934
+ enumerable: false
5935
+ });
5936
+ }
5937
+ }
5906
5938
  if (patchFlag === -2) {
5907
5939
  optimized = false;
5908
5940
  vnode.dynamicChildren = null;
@@ -6064,15 +6096,16 @@ function createHydrationFunctions(rendererInternals) {
6064
6096
  const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
6065
6097
  optimized = optimized || !!vnode.dynamicChildren;
6066
6098
  const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
6067
- const forcePatchValue = type === "input" && dirs || type === "option";
6099
+ const forcePatch = type === "input" || type === "option";
6068
6100
  {
6069
6101
  if (dirs) {
6070
6102
  invokeDirectiveHook(vnode, null, parentComponent, "created");
6071
6103
  }
6072
6104
  if (props) {
6073
- if (forcePatchValue || !optimized || patchFlag & (16 | 32)) {
6105
+ if (forcePatch || !optimized || patchFlag & (16 | 32)) {
6074
6106
  for (const key in props) {
6075
- if (forcePatchValue && key.endsWith("value") || isOn(key) && !isReservedProp(key)) {
6107
+ if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
6108
+ key[0] === ".") {
6076
6109
  patchProp(
6077
6110
  el,
6078
6111
  key,
@@ -7829,6 +7862,7 @@ const resolveTarget = (props, select) => {
7829
7862
  }
7830
7863
  };
7831
7864
  const TeleportImpl = {
7865
+ name: "Teleport",
7832
7866
  __isTeleport: true,
7833
7867
  process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals) {
7834
7868
  const {
@@ -8250,7 +8284,7 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
8250
8284
  if (shapeFlag & 4 && isProxy(type)) {
8251
8285
  type = toRaw(type);
8252
8286
  warn(
8253
- `Vue received a Component which 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\`.`,
8287
+ `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\`.`,
8254
8288
  `
8255
8289
  Component that was made reactive: `,
8256
8290
  type
@@ -9071,7 +9105,7 @@ function isMemoSame(cached, memo) {
9071
9105
  return true;
9072
9106
  }
9073
9107
 
9074
- const version = "3.3.8";
9108
+ const version = "3.3.9";
9075
9109
  const ssrUtils = null;
9076
9110
  const resolveFilter = null;
9077
9111
  const compatUtils = null;
@@ -10216,21 +10250,20 @@ const vModelText = {
10216
10250
  el[assignKey] = getModelAssigner(vnode);
10217
10251
  if (el.composing)
10218
10252
  return;
10253
+ const elValue = number || el.type === "number" ? looseToNumber(el.value) : el.value;
10254
+ const newValue = value == null ? "" : value;
10255
+ if (elValue === newValue) {
10256
+ return;
10257
+ }
10219
10258
  if (document.activeElement === el && el.type !== "range") {
10220
10259
  if (lazy) {
10221
10260
  return;
10222
10261
  }
10223
- if (trim && el.value.trim() === value) {
10262
+ if (trim && el.value.trim() === newValue) {
10224
10263
  return;
10225
10264
  }
10226
- if ((number || el.type === "number") && looseToNumber(el.value) === value) {
10227
- return;
10228
- }
10229
- }
10230
- const newValue = value == null ? "" : value;
10231
- if (el.value !== newValue) {
10232
- el.value = newValue;
10233
10265
  }
10266
+ el.value = newValue;
10234
10267
  }
10235
10268
  };
10236
10269
  const vModelCheckbox = {