vue 3.2.43 → 3.2.45

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.
@@ -2101,12 +2101,6 @@ var Vue = (function (exports) {
2101
2101
  // components to be unmounted and re-mounted. Queue the update so that we
2102
2102
  // don't end up forcing the same parent to re-render multiple times.
2103
2103
  queueJob(instance.parent.update);
2104
- // instance is the inner component of an async custom element
2105
- // invoke to reset styles
2106
- if (instance.parent.type.__asyncLoader &&
2107
- instance.parent.ceReload) {
2108
- instance.parent.ceReload(newComp.styles);
2109
- }
2110
2104
  }
2111
2105
  else if (instance.appContext.reload) {
2112
2106
  // root instance mounted via createApp() has a reload method
@@ -3353,10 +3347,11 @@ var Vue = (function (exports) {
3353
3347
  callWithAsyncErrorHandling(cb, instance, 3 /* ErrorCodes.WATCH_CALLBACK */, [
3354
3348
  newValue,
3355
3349
  // pass undefined as the old value when it's changed for the first time
3356
- oldValue === INITIAL_WATCHER_VALUE ||
3357
- (isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE)
3358
- ? []
3359
- : oldValue,
3350
+ oldValue === INITIAL_WATCHER_VALUE
3351
+ ? undefined
3352
+ : (isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE)
3353
+ ? []
3354
+ : oldValue,
3360
3355
  onCleanup
3361
3356
  ]);
3362
3357
  oldValue = newValue;
@@ -3953,10 +3948,15 @@ var Vue = (function (exports) {
3953
3948
  }
3954
3949
  });
3955
3950
  }
3956
- function createInnerComp(comp, { vnode: { ref, props, children, shapeFlag }, parent }) {
3951
+ function createInnerComp(comp, parent) {
3952
+ const { ref, props, children, ce } = parent.vnode;
3957
3953
  const vnode = createVNode(comp, props, children);
3958
3954
  // ensure inner component inherits the async wrapper's ref owner
3959
3955
  vnode.ref = ref;
3956
+ // pass the custom element callback on to the inner comp
3957
+ // and remove it from the async wrapper
3958
+ vnode.ce = ce;
3959
+ delete parent.vnode.ce;
3960
3960
  return vnode;
3961
3961
  }
3962
3962
 
@@ -4114,8 +4114,7 @@ var Vue = (function (exports) {
4114
4114
  : comp);
4115
4115
  const { include, exclude, max } = props;
4116
4116
  if ((include && (!name || !matches(include, name))) ||
4117
- (exclude && name && matches(exclude, name)) ||
4118
- (hmrDirtyComponents.has(comp))) {
4117
+ (exclude && name && matches(exclude, name))) {
4119
4118
  current = vnode;
4120
4119
  return rawVNode;
4121
4120
  }
@@ -4225,14 +4224,9 @@ var Vue = (function (exports) {
4225
4224
  }, target);
4226
4225
  }
4227
4226
  function resetShapeFlag(vnode) {
4228
- let shapeFlag = vnode.shapeFlag;
4229
- if (shapeFlag & 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */) {
4230
- shapeFlag -= 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */;
4231
- }
4232
- if (shapeFlag & 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */) {
4233
- shapeFlag -= 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
4234
- }
4235
- vnode.shapeFlag = shapeFlag;
4227
+ // bitwise operations to remove keep alive flags
4228
+ vnode.shapeFlag &= ~256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */;
4229
+ vnode.shapeFlag &= ~512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
4236
4230
  }
4237
4231
  function getInnerChild(vnode) {
4238
4232
  return vnode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */ ? vnode.ssContent : vnode;
@@ -4531,7 +4525,9 @@ var Vue = (function (exports) {
4531
4525
  (currentRenderingInstance.parent &&
4532
4526
  isAsyncWrapper(currentRenderingInstance.parent) &&
4533
4527
  currentRenderingInstance.parent.isCE)) {
4534
- return createVNode('slot', name === 'default' ? null : { name }, fallback && fallback());
4528
+ if (name !== 'default')
4529
+ props.name = name;
4530
+ return createVNode('slot', props, fallback && fallback());
4535
4531
  }
4536
4532
  let slot = slots[name];
4537
4533
  if (slot && slot.length > 1) {
@@ -4631,6 +4627,7 @@ var Vue = (function (exports) {
4631
4627
  $watch: i => (instanceWatch.bind(i) )
4632
4628
  });
4633
4629
  const isReservedPrefix = (key) => key === '_' || key === '$';
4630
+ const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
4634
4631
  const PublicInstanceProxyHandlers = {
4635
4632
  get({ _: instance }, key) {
4636
4633
  const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
@@ -4638,15 +4635,6 @@ var Vue = (function (exports) {
4638
4635
  if (key === '__isVue') {
4639
4636
  return true;
4640
4637
  }
4641
- // prioritize <script setup> bindings during dev.
4642
- // this allows even properties that start with _ or $ to be used - so that
4643
- // it aligns with the production behavior where the render fn is inlined and
4644
- // indeed has access to all declared variables.
4645
- if (setupState !== EMPTY_OBJ &&
4646
- setupState.__isScriptSetup &&
4647
- hasOwn(setupState, key)) {
4648
- return setupState[key];
4649
- }
4650
4638
  // data / props / ctx
4651
4639
  // This getter gets called for every property access on the render context
4652
4640
  // during render and is a major hotspot. The most expensive part of this
@@ -4669,7 +4657,7 @@ var Vue = (function (exports) {
4669
4657
  // default: just fallthrough
4670
4658
  }
4671
4659
  }
4672
- else if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {
4660
+ else if (hasSetupBinding(setupState, key)) {
4673
4661
  accessCache[key] = 1 /* AccessTypes.SETUP */;
4674
4662
  return setupState[key];
4675
4663
  }
@@ -4739,21 +4727,26 @@ var Vue = (function (exports) {
4739
4727
  },
4740
4728
  set({ _: instance }, key, value) {
4741
4729
  const { data, setupState, ctx } = instance;
4742
- if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {
4730
+ if (hasSetupBinding(setupState, key)) {
4743
4731
  setupState[key] = value;
4744
4732
  return true;
4745
4733
  }
4734
+ else if (setupState.__isScriptSetup &&
4735
+ hasOwn(setupState, key)) {
4736
+ warn$1(`Cannot mutate <script setup> binding "${key}" from Options API.`);
4737
+ return false;
4738
+ }
4746
4739
  else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
4747
4740
  data[key] = value;
4748
4741
  return true;
4749
4742
  }
4750
4743
  else if (hasOwn(instance.props, key)) {
4751
- warn$1(`Attempting to mutate prop "${key}". Props are readonly.`, instance);
4744
+ warn$1(`Attempting to mutate prop "${key}". Props are readonly.`);
4752
4745
  return false;
4753
4746
  }
4754
4747
  if (key[0] === '$' && key.slice(1) in instance) {
4755
4748
  warn$1(`Attempting to mutate public property "${key}". ` +
4756
- `Properties starting with $ are reserved and readonly.`, instance);
4749
+ `Properties starting with $ are reserved and readonly.`);
4757
4750
  return false;
4758
4751
  }
4759
4752
  else {
@@ -4774,7 +4767,7 @@ var Vue = (function (exports) {
4774
4767
  let normalizedProps;
4775
4768
  return (!!accessCache[key] ||
4776
4769
  (data !== EMPTY_OBJ && hasOwn(data, key)) ||
4777
- (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) ||
4770
+ hasSetupBinding(setupState, key) ||
4778
4771
  ((normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key)) ||
4779
4772
  hasOwn(ctx, key) ||
4780
4773
  hasOwn(publicPropertiesMap, key) ||
@@ -7813,6 +7806,10 @@ var Vue = (function (exports) {
7813
7806
  if (!shallow)
7814
7807
  traverseStaticChildren(c1, c2);
7815
7808
  }
7809
+ // #6852 also inherit for text nodes
7810
+ if (c2.type === Text) {
7811
+ c2.el = c1.el;
7812
+ }
7816
7813
  // also inherit for comment nodes, but not placeholders (e.g. v-if which
7817
7814
  // would have received .el during block patch)
7818
7815
  if (c2.type === Comment && !c2.el) {
@@ -7983,6 +7980,7 @@ var Vue = (function (exports) {
7983
7980
  }
7984
7981
  }
7985
7982
  }
7983
+ updateCssVars(n2);
7986
7984
  },
7987
7985
  remove(vnode, parentComponent, parentSuspense, optimized, { um: unmount, o: { remove: hostRemove } }, doRemove) {
7988
7986
  const { shapeFlag, children, anchor, targetAnchor, target, props } = vnode;
@@ -8061,11 +8059,26 @@ var Vue = (function (exports) {
8061
8059
  hydrateChildren(targetNode, vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
8062
8060
  }
8063
8061
  }
8062
+ updateCssVars(vnode);
8064
8063
  }
8065
8064
  return vnode.anchor && nextSibling(vnode.anchor);
8066
8065
  }
8067
8066
  // Force-casted public typing for h and TSX props inference
8068
8067
  const Teleport = TeleportImpl;
8068
+ function updateCssVars(vnode) {
8069
+ // presence of .ut method indicates owner component uses css vars.
8070
+ // code path here can assume browser environment.
8071
+ const ctx = vnode.ctx;
8072
+ if (ctx && ctx.ut) {
8073
+ let node = vnode.children[0].el;
8074
+ while (node !== vnode.targetAnchor) {
8075
+ if (node.nodeType === 1)
8076
+ node.setAttribute('data-v-owner', ctx.uid);
8077
+ node = node.nextSibling;
8078
+ }
8079
+ ctx.ut();
8080
+ }
8081
+ }
8069
8082
 
8070
8083
  const Fragment = Symbol('Fragment' );
8071
8084
  const Text = Symbol('Text' );
@@ -8160,6 +8173,10 @@ var Vue = (function (exports) {
8160
8173
  function isSameVNodeType(n1, n2) {
8161
8174
  if (n2.shapeFlag & 6 /* ShapeFlags.COMPONENT */ &&
8162
8175
  hmrDirtyComponents.has(n2.type)) {
8176
+ // #7042, ensure the vnode being unmounted during HMR
8177
+ // bitwise operations to remove keep alive flags
8178
+ n1.shapeFlag &= ~256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */;
8179
+ n2.shapeFlag &= ~512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
8163
8180
  // HMR only: if the component has been hot-updated, force a reload.
8164
8181
  return false;
8165
8182
  }
@@ -8215,7 +8232,8 @@ var Vue = (function (exports) {
8215
8232
  patchFlag,
8216
8233
  dynamicProps,
8217
8234
  dynamicChildren: null,
8218
- appContext: null
8235
+ appContext: null,
8236
+ ctx: currentRenderingInstance
8219
8237
  };
8220
8238
  if (needFullChildrenNormalization) {
8221
8239
  normalizeChildren(vnode, children);
@@ -8382,7 +8400,8 @@ var Vue = (function (exports) {
8382
8400
  ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
8383
8401
  ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
8384
8402
  el: vnode.el,
8385
- anchor: vnode.anchor
8403
+ anchor: vnode.anchor,
8404
+ ctx: vnode.ctx
8386
8405
  };
8387
8406
  return cloned;
8388
8407
  }
@@ -9346,7 +9365,7 @@ var Vue = (function (exports) {
9346
9365
  }
9347
9366
 
9348
9367
  // Core API ------------------------------------------------------------------
9349
- const version = "3.2.43";
9368
+ const version = "3.2.45";
9350
9369
  /**
9351
9370
  * SSR utils for \@vue/server-renderer. Only exposed in ssr-possible builds.
9352
9371
  * @internal
@@ -9492,6 +9511,7 @@ var Vue = (function (exports) {
9492
9511
  }
9493
9512
  }
9494
9513
  }
9514
+ const semicolonRE = /[^\\];\s*$/;
9495
9515
  const importantRE = /\s*!important$/;
9496
9516
  function setStyle(style, name, val) {
9497
9517
  if (isArray(val)) {
@@ -9500,6 +9520,11 @@ var Vue = (function (exports) {
9500
9520
  else {
9501
9521
  if (val == null)
9502
9522
  val = '';
9523
+ {
9524
+ if (semicolonRE.test(val)) {
9525
+ warn$1(`Unexpected semicolon at the end of '${name}' style value: '${val}'`);
9526
+ }
9527
+ }
9503
9528
  if (name.startsWith('--')) {
9504
9529
  // custom property definition
9505
9530
  style.setProperty(name, val);
@@ -9829,12 +9854,21 @@ var Vue = (function (exports) {
9829
9854
  `defined as hydratable. Use \`defineSSRCustomElement\`.`);
9830
9855
  }
9831
9856
  this.attachShadow({ mode: 'open' });
9857
+ if (!this._def.__asyncLoader) {
9858
+ // for sync component defs we can immediately resolve props
9859
+ this._resolveProps(this._def);
9860
+ }
9832
9861
  }
9833
9862
  }
9834
9863
  connectedCallback() {
9835
9864
  this._connected = true;
9836
9865
  if (!this._instance) {
9837
- this._resolveDef();
9866
+ if (this._resolved) {
9867
+ this._update();
9868
+ }
9869
+ else {
9870
+ this._resolveDef();
9871
+ }
9838
9872
  }
9839
9873
  }
9840
9874
  disconnectedCallback() {
@@ -9850,9 +9884,6 @@ var Vue = (function (exports) {
9850
9884
  * resolve inner component definition (handle possible async component)
9851
9885
  */
9852
9886
  _resolveDef() {
9853
- if (this._resolved) {
9854
- return;
9855
- }
9856
9887
  this._resolved = true;
9857
9888
  // set initial attrs
9858
9889
  for (let i = 0; i < this.attributes.length; i++) {
@@ -9864,38 +9895,26 @@ var Vue = (function (exports) {
9864
9895
  this._setAttr(m.attributeName);
9865
9896
  }
9866
9897
  }).observe(this, { attributes: true });
9867
- const resolve = (def) => {
9868
- const { props = {}, styles } = def;
9869
- const hasOptions = !isArray(props);
9870
- const rawKeys = props ? (hasOptions ? Object.keys(props) : props) : [];
9898
+ const resolve = (def, isAsync = false) => {
9899
+ const { props, styles } = def;
9871
9900
  // cast Number-type props set before resolve
9872
9901
  let numberProps;
9873
- if (hasOptions) {
9874
- for (const key in this._props) {
9902
+ if (props && !isArray(props)) {
9903
+ for (const key in props) {
9875
9904
  const opt = props[key];
9876
9905
  if (opt === Number || (opt && opt.type === Number)) {
9877
- this._props[key] = toNumber(this._props[key]);
9878
- (numberProps || (numberProps = Object.create(null)))[key] = true;
9906
+ if (key in this._props) {
9907
+ this._props[key] = toNumber(this._props[key]);
9908
+ }
9909
+ (numberProps || (numberProps = Object.create(null)))[camelize(key)] = true;
9879
9910
  }
9880
9911
  }
9881
9912
  }
9882
9913
  this._numberProps = numberProps;
9883
- // check if there are props set pre-upgrade or connect
9884
- for (const key of Object.keys(this)) {
9885
- if (key[0] !== '_') {
9886
- this._setProp(key, this[key], true, false);
9887
- }
9888
- }
9889
- // defining getter/setters on prototype
9890
- for (const key of rawKeys.map(camelize)) {
9891
- Object.defineProperty(this, key, {
9892
- get() {
9893
- return this._getProp(key);
9894
- },
9895
- set(val) {
9896
- this._setProp(key, val);
9897
- }
9898
- });
9914
+ if (isAsync) {
9915
+ // defining getter/setters on prototype
9916
+ // for sync defs, this already happened in the constructor
9917
+ this._resolveProps(def);
9899
9918
  }
9900
9919
  // apply CSS
9901
9920
  this._applyStyles(styles);
@@ -9904,12 +9923,33 @@ var Vue = (function (exports) {
9904
9923
  };
9905
9924
  const asyncDef = this._def.__asyncLoader;
9906
9925
  if (asyncDef) {
9907
- asyncDef().then(resolve);
9926
+ asyncDef().then(def => resolve(def, true));
9908
9927
  }
9909
9928
  else {
9910
9929
  resolve(this._def);
9911
9930
  }
9912
9931
  }
9932
+ _resolveProps(def) {
9933
+ const { props } = def;
9934
+ const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
9935
+ // check if there are props set pre-upgrade or connect
9936
+ for (const key of Object.keys(this)) {
9937
+ if (key[0] !== '_' && declaredPropKeys.includes(key)) {
9938
+ this._setProp(key, this[key], true, false);
9939
+ }
9940
+ }
9941
+ // defining getter/setters on prototype
9942
+ for (const key of declaredPropKeys.map(camelize)) {
9943
+ Object.defineProperty(this, key, {
9944
+ get() {
9945
+ return this._getProp(key);
9946
+ },
9947
+ set(val) {
9948
+ this._setProp(key, val);
9949
+ }
9950
+ });
9951
+ }
9952
+ }
9913
9953
  _setAttr(key) {
9914
9954
  let value = this.getAttribute(key);
9915
9955
  const camelKey = camelize(key);
@@ -9965,27 +10005,31 @@ var Vue = (function (exports) {
9965
10005
  this._styles.length = 0;
9966
10006
  }
9967
10007
  this._applyStyles(newStyles);
9968
- // if this is an async component, ceReload is called from the inner
9969
- // component so no need to reload the async wrapper
9970
- if (!this._def.__asyncLoader) {
9971
- // reload
9972
- this._instance = null;
9973
- this._update();
9974
- }
10008
+ this._instance = null;
10009
+ this._update();
9975
10010
  };
9976
10011
  }
9977
- // intercept emit
9978
- instance.emit = (event, ...args) => {
10012
+ const dispatch = (event, args) => {
9979
10013
  this.dispatchEvent(new CustomEvent(event, {
9980
10014
  detail: args
9981
10015
  }));
9982
10016
  };
10017
+ // intercept emit
10018
+ instance.emit = (event, ...args) => {
10019
+ // dispatch both the raw and hyphenated versions of an event
10020
+ // to match Vue behavior
10021
+ dispatch(event, args);
10022
+ if (hyphenate(event) !== event) {
10023
+ dispatch(hyphenate(event), args);
10024
+ }
10025
+ };
9983
10026
  // locate nearest Vue custom element parent for provide/inject
9984
10027
  let parent = this;
9985
10028
  while ((parent =
9986
10029
  parent && (parent.parentNode || parent.host))) {
9987
10030
  if (parent instanceof VueElement) {
9988
10031
  instance.parent = parent._instance;
10032
+ instance.provides = parent._instance.provides;
9989
10033
  break;
9990
10034
  }
9991
10035
  }
@@ -10029,7 +10073,14 @@ var Vue = (function (exports) {
10029
10073
  warn$1(`useCssVars is called without current active component instance.`);
10030
10074
  return;
10031
10075
  }
10032
- const setVars = () => setVarsOnVNode(instance.subTree, getter(instance.proxy));
10076
+ const updateTeleports = (instance.ut = (vars = getter(instance.proxy)) => {
10077
+ Array.from(document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)).forEach(node => setVarsOnNode(node, vars));
10078
+ });
10079
+ const setVars = () => {
10080
+ const vars = getter(instance.proxy);
10081
+ setVarsOnVNode(instance.subTree, vars);
10082
+ updateTeleports(vars);
10083
+ };
10033
10084
  watchPostEffect(setVars);
10034
10085
  onMounted(() => {
10035
10086
  const ob = new MutationObserver(setVars);
@@ -11030,15 +11081,16 @@ var Vue = (function (exports) {
11030
11081
  [41 /* ErrorCodes.X_V_MODEL_NO_EXPRESSION */]: `v-model is missing expression.`,
11031
11082
  [42 /* ErrorCodes.X_V_MODEL_MALFORMED_EXPRESSION */]: `v-model value must be a valid JavaScript member expression.`,
11032
11083
  [43 /* ErrorCodes.X_V_MODEL_ON_SCOPE_VARIABLE */]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,
11033
- [44 /* ErrorCodes.X_INVALID_EXPRESSION */]: `Error parsing JavaScript expression: `,
11034
- [45 /* ErrorCodes.X_KEEP_ALIVE_INVALID_CHILDREN */]: `<KeepAlive> expects exactly one child component.`,
11084
+ [44 /* ErrorCodes.X_V_MODEL_ON_PROPS */]: `v-model cannot be used on a prop, because local prop bindings are not writable.\nUse a v-bind binding combined with a v-on listener that emits update:x event instead.`,
11085
+ [45 /* ErrorCodes.X_INVALID_EXPRESSION */]: `Error parsing JavaScript expression: `,
11086
+ [46 /* ErrorCodes.X_KEEP_ALIVE_INVALID_CHILDREN */]: `<KeepAlive> expects exactly one child component.`,
11035
11087
  // generic errors
11036
- [46 /* ErrorCodes.X_PREFIX_ID_NOT_SUPPORTED */]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
11037
- [47 /* ErrorCodes.X_MODULE_MODE_NOT_SUPPORTED */]: `ES module mode is not supported in this build of compiler.`,
11038
- [48 /* ErrorCodes.X_CACHE_HANDLER_NOT_SUPPORTED */]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
11039
- [49 /* ErrorCodes.X_SCOPE_ID_NOT_SUPPORTED */]: `"scopeId" option is only supported in module mode.`,
11088
+ [47 /* ErrorCodes.X_PREFIX_ID_NOT_SUPPORTED */]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
11089
+ [48 /* ErrorCodes.X_MODULE_MODE_NOT_SUPPORTED */]: `ES module mode is not supported in this build of compiler.`,
11090
+ [49 /* ErrorCodes.X_CACHE_HANDLER_NOT_SUPPORTED */]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
11091
+ [50 /* ErrorCodes.X_SCOPE_ID_NOT_SUPPORTED */]: `"scopeId" option is only supported in module mode.`,
11040
11092
  // just to fulfill types
11041
- [50 /* ErrorCodes.__EXTEND_POINT__ */]: ``
11093
+ [51 /* ErrorCodes.__EXTEND_POINT__ */]: ``
11042
11094
  };
11043
11095
 
11044
11096
  const FRAGMENT = Symbol(`Fragment` );
@@ -13591,7 +13643,7 @@ var Vue = (function (exports) {
13591
13643
  if (keywordMatch) {
13592
13644
  message = `avoid using JavaScript keyword as property name: "${keywordMatch[0]}"`;
13593
13645
  }
13594
- context.onError(createCompilerError(44 /* ErrorCodes.X_INVALID_EXPRESSION */, node.loc, undefined, message));
13646
+ context.onError(createCompilerError(45 /* ErrorCodes.X_INVALID_EXPRESSION */, node.loc, undefined, message));
13595
13647
  }
13596
13648
  }
13597
13649
 
@@ -14382,7 +14434,7 @@ var Vue = (function (exports) {
14382
14434
  // 2. Force keep-alive to always be updated, since it uses raw children.
14383
14435
  patchFlag |= 1024 /* PatchFlags.DYNAMIC_SLOTS */;
14384
14436
  if (node.children.length > 1) {
14385
- context.onError(createCompilerError(45 /* ErrorCodes.X_KEEP_ALIVE_INVALID_CHILDREN */, {
14437
+ context.onError(createCompilerError(46 /* ErrorCodes.X_KEEP_ALIVE_INVALID_CHILDREN */, {
14386
14438
  start: node.children[0].loc.start,
14387
14439
  end: node.children[node.children.length - 1].loc.end,
14388
14440
  source: ''
@@ -15208,8 +15260,14 @@ var Vue = (function (exports) {
15208
15260
  const expString = exp.type === 4 /* NodeTypes.SIMPLE_EXPRESSION */ ? exp.content : rawExp;
15209
15261
  // im SFC <script setup> inline mode, the exp may have been transformed into
15210
15262
  // _unref(exp)
15211
- context.bindingMetadata[rawExp];
15212
- const maybeRef = !true /* BindingTypes.SETUP_CONST */;
15263
+ const bindingType = context.bindingMetadata[rawExp];
15264
+ // check props
15265
+ if (bindingType === "props" /* BindingTypes.PROPS */ ||
15266
+ bindingType === "props-aliased" /* BindingTypes.PROPS_ALIASED */) {
15267
+ context.onError(createCompilerError(44 /* ErrorCodes.X_V_MODEL_ON_PROPS */, exp.loc));
15268
+ return createTransformProps();
15269
+ }
15270
+ const maybeRef = !true ;
15213
15271
  if (!expString.trim() ||
15214
15272
  (!isMemberExpression(expString) && !maybeRef)) {
15215
15273
  context.onError(createCompilerError(42 /* ErrorCodes.X_V_MODEL_MALFORMED_EXPRESSION */, exp.loc));
@@ -15311,18 +15369,18 @@ var Vue = (function (exports) {
15311
15369
  /* istanbul ignore if */
15312
15370
  {
15313
15371
  if (options.prefixIdentifiers === true) {
15314
- onError(createCompilerError(46 /* ErrorCodes.X_PREFIX_ID_NOT_SUPPORTED */));
15372
+ onError(createCompilerError(47 /* ErrorCodes.X_PREFIX_ID_NOT_SUPPORTED */));
15315
15373
  }
15316
15374
  else if (isModuleMode) {
15317
- onError(createCompilerError(47 /* ErrorCodes.X_MODULE_MODE_NOT_SUPPORTED */));
15375
+ onError(createCompilerError(48 /* ErrorCodes.X_MODULE_MODE_NOT_SUPPORTED */));
15318
15376
  }
15319
15377
  }
15320
15378
  const prefixIdentifiers = !true ;
15321
15379
  if (options.cacheHandlers) {
15322
- onError(createCompilerError(48 /* ErrorCodes.X_CACHE_HANDLER_NOT_SUPPORTED */));
15380
+ onError(createCompilerError(49 /* ErrorCodes.X_CACHE_HANDLER_NOT_SUPPORTED */));
15323
15381
  }
15324
15382
  if (options.scopeId && !isModuleMode) {
15325
- onError(createCompilerError(49 /* ErrorCodes.X_SCOPE_ID_NOT_SUPPORTED */));
15383
+ onError(createCompilerError(50 /* ErrorCodes.X_SCOPE_ID_NOT_SUPPORTED */));
15326
15384
  }
15327
15385
  const ast = isString(template) ? baseParse(template, options) : template;
15328
15386
  const [nodeTransforms, directiveTransforms] = getBaseTransformPreset();
@@ -15480,26 +15538,26 @@ var Vue = (function (exports) {
15480
15538
  return createCompilerError(code, loc, DOMErrorMessages );
15481
15539
  }
15482
15540
  const DOMErrorMessages = {
15483
- [50 /* DOMErrorCodes.X_V_HTML_NO_EXPRESSION */]: `v-html is missing expression.`,
15484
- [51 /* DOMErrorCodes.X_V_HTML_WITH_CHILDREN */]: `v-html will override element children.`,
15485
- [52 /* DOMErrorCodes.X_V_TEXT_NO_EXPRESSION */]: `v-text is missing expression.`,
15486
- [53 /* DOMErrorCodes.X_V_TEXT_WITH_CHILDREN */]: `v-text will override element children.`,
15487
- [54 /* DOMErrorCodes.X_V_MODEL_ON_INVALID_ELEMENT */]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
15488
- [55 /* DOMErrorCodes.X_V_MODEL_ARG_ON_ELEMENT */]: `v-model argument is not supported on plain elements.`,
15489
- [56 /* DOMErrorCodes.X_V_MODEL_ON_FILE_INPUT_ELEMENT */]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`,
15490
- [57 /* DOMErrorCodes.X_V_MODEL_UNNECESSARY_VALUE */]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
15491
- [58 /* DOMErrorCodes.X_V_SHOW_NO_EXPRESSION */]: `v-show is missing expression.`,
15492
- [59 /* DOMErrorCodes.X_TRANSITION_INVALID_CHILDREN */]: `<Transition> expects exactly one child element or component.`,
15493
- [60 /* DOMErrorCodes.X_IGNORED_SIDE_EFFECT_TAG */]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`
15541
+ [51 /* DOMErrorCodes.X_V_HTML_NO_EXPRESSION */]: `v-html is missing expression.`,
15542
+ [52 /* DOMErrorCodes.X_V_HTML_WITH_CHILDREN */]: `v-html will override element children.`,
15543
+ [53 /* DOMErrorCodes.X_V_TEXT_NO_EXPRESSION */]: `v-text is missing expression.`,
15544
+ [54 /* DOMErrorCodes.X_V_TEXT_WITH_CHILDREN */]: `v-text will override element children.`,
15545
+ [55 /* DOMErrorCodes.X_V_MODEL_ON_INVALID_ELEMENT */]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
15546
+ [56 /* DOMErrorCodes.X_V_MODEL_ARG_ON_ELEMENT */]: `v-model argument is not supported on plain elements.`,
15547
+ [57 /* DOMErrorCodes.X_V_MODEL_ON_FILE_INPUT_ELEMENT */]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`,
15548
+ [58 /* DOMErrorCodes.X_V_MODEL_UNNECESSARY_VALUE */]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
15549
+ [59 /* DOMErrorCodes.X_V_SHOW_NO_EXPRESSION */]: `v-show is missing expression.`,
15550
+ [60 /* DOMErrorCodes.X_TRANSITION_INVALID_CHILDREN */]: `<Transition> expects exactly one child element or component.`,
15551
+ [61 /* DOMErrorCodes.X_IGNORED_SIDE_EFFECT_TAG */]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`
15494
15552
  };
15495
15553
 
15496
15554
  const transformVHtml = (dir, node, context) => {
15497
15555
  const { exp, loc } = dir;
15498
15556
  if (!exp) {
15499
- context.onError(createDOMCompilerError(50 /* DOMErrorCodes.X_V_HTML_NO_EXPRESSION */, loc));
15557
+ context.onError(createDOMCompilerError(51 /* DOMErrorCodes.X_V_HTML_NO_EXPRESSION */, loc));
15500
15558
  }
15501
15559
  if (node.children.length) {
15502
- context.onError(createDOMCompilerError(51 /* DOMErrorCodes.X_V_HTML_WITH_CHILDREN */, loc));
15560
+ context.onError(createDOMCompilerError(52 /* DOMErrorCodes.X_V_HTML_WITH_CHILDREN */, loc));
15503
15561
  node.children.length = 0;
15504
15562
  }
15505
15563
  return {
@@ -15512,10 +15570,10 @@ var Vue = (function (exports) {
15512
15570
  const transformVText = (dir, node, context) => {
15513
15571
  const { exp, loc } = dir;
15514
15572
  if (!exp) {
15515
- context.onError(createDOMCompilerError(52 /* DOMErrorCodes.X_V_TEXT_NO_EXPRESSION */, loc));
15573
+ context.onError(createDOMCompilerError(53 /* DOMErrorCodes.X_V_TEXT_NO_EXPRESSION */, loc));
15516
15574
  }
15517
15575
  if (node.children.length) {
15518
- context.onError(createDOMCompilerError(53 /* DOMErrorCodes.X_V_TEXT_WITH_CHILDREN */, loc));
15576
+ context.onError(createDOMCompilerError(54 /* DOMErrorCodes.X_V_TEXT_WITH_CHILDREN */, loc));
15519
15577
  node.children.length = 0;
15520
15578
  }
15521
15579
  return {
@@ -15536,12 +15594,12 @@ var Vue = (function (exports) {
15536
15594
  return baseResult;
15537
15595
  }
15538
15596
  if (dir.arg) {
15539
- context.onError(createDOMCompilerError(55 /* DOMErrorCodes.X_V_MODEL_ARG_ON_ELEMENT */, dir.arg.loc));
15597
+ context.onError(createDOMCompilerError(56 /* DOMErrorCodes.X_V_MODEL_ARG_ON_ELEMENT */, dir.arg.loc));
15540
15598
  }
15541
15599
  function checkDuplicatedValue() {
15542
15600
  const value = findProp(node, 'value');
15543
15601
  if (value) {
15544
- context.onError(createDOMCompilerError(57 /* DOMErrorCodes.X_V_MODEL_UNNECESSARY_VALUE */, value.loc));
15602
+ context.onError(createDOMCompilerError(58 /* DOMErrorCodes.X_V_MODEL_UNNECESSARY_VALUE */, value.loc));
15545
15603
  }
15546
15604
  }
15547
15605
  const { tag } = node;
@@ -15569,7 +15627,7 @@ var Vue = (function (exports) {
15569
15627
  break;
15570
15628
  case 'file':
15571
15629
  isInvalidType = true;
15572
- context.onError(createDOMCompilerError(56 /* DOMErrorCodes.X_V_MODEL_ON_FILE_INPUT_ELEMENT */, dir.loc));
15630
+ context.onError(createDOMCompilerError(57 /* DOMErrorCodes.X_V_MODEL_ON_FILE_INPUT_ELEMENT */, dir.loc));
15573
15631
  break;
15574
15632
  default:
15575
15633
  // text type
@@ -15603,7 +15661,7 @@ var Vue = (function (exports) {
15603
15661
  }
15604
15662
  }
15605
15663
  else {
15606
- context.onError(createDOMCompilerError(54 /* DOMErrorCodes.X_V_MODEL_ON_INVALID_ELEMENT */, dir.loc));
15664
+ context.onError(createDOMCompilerError(55 /* DOMErrorCodes.X_V_MODEL_ON_INVALID_ELEMENT */, dir.loc));
15607
15665
  }
15608
15666
  // native vmodel doesn't need the `modelValue` props since they are also
15609
15667
  // passed to the runtime as `binding.value`. removing it reduces code size.
@@ -15723,7 +15781,7 @@ var Vue = (function (exports) {
15723
15781
  const transformShow = (dir, node, context) => {
15724
15782
  const { exp, loc } = dir;
15725
15783
  if (!exp) {
15726
- context.onError(createDOMCompilerError(58 /* DOMErrorCodes.X_V_SHOW_NO_EXPRESSION */, loc));
15784
+ context.onError(createDOMCompilerError(59 /* DOMErrorCodes.X_V_SHOW_NO_EXPRESSION */, loc));
15727
15785
  }
15728
15786
  return {
15729
15787
  props: [],
@@ -15742,7 +15800,7 @@ var Vue = (function (exports) {
15742
15800
  }
15743
15801
  // warn multiple transition children
15744
15802
  if (hasMultipleChildren(node)) {
15745
- context.onError(createDOMCompilerError(59 /* DOMErrorCodes.X_TRANSITION_INVALID_CHILDREN */, {
15803
+ context.onError(createDOMCompilerError(60 /* DOMErrorCodes.X_TRANSITION_INVALID_CHILDREN */, {
15746
15804
  start: node.children[0].loc.start,
15747
15805
  end: node.children[node.children.length - 1].loc.end,
15748
15806
  source: ''
@@ -15781,7 +15839,7 @@ var Vue = (function (exports) {
15781
15839
  if (node.type === 1 /* NodeTypes.ELEMENT */ &&
15782
15840
  node.tagType === 0 /* ElementTypes.ELEMENT */ &&
15783
15841
  (node.tag === 'script' || node.tag === 'style')) {
15784
- context.onError(createDOMCompilerError(60 /* DOMErrorCodes.X_IGNORED_SIDE_EFFECT_TAG */, node.loc));
15842
+ context.onError(createDOMCompilerError(61 /* DOMErrorCodes.X_IGNORED_SIDE_EFFECT_TAG */, node.loc));
15785
15843
  context.removeNode();
15786
15844
  }
15787
15845
  };