@vue/runtime-dom 3.4.0-rc.2 → 3.4.0-rc.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.
@@ -1664,7 +1664,7 @@ var VueRuntimeDOM = (function (exports) {
1664
1664
  [11]: "app warnHandler",
1665
1665
  [12]: "ref function",
1666
1666
  [13]: "async component loader",
1667
- [14]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core"
1667
+ [14]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://github.com/vuejs/core ."
1668
1668
  };
1669
1669
  function callWithErrorHandling(fn, instance, type, args) {
1670
1670
  let res;
@@ -2174,7 +2174,9 @@ var VueRuntimeDOM = (function (exports) {
2174
2174
  `Event "${lowerCaseEvent}" is emitted in component ${formatComponentName(
2175
2175
  instance,
2176
2176
  instance.type
2177
- )} but the handler is registered for "${event}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${hyphenate(event)}" instead of "${event}".`
2177
+ )} but the handler is registered for "${event}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${hyphenate(
2178
+ event
2179
+ )}" instead of "${event}".`
2178
2180
  );
2179
2181
  }
2180
2182
  }
@@ -2617,7 +2619,6 @@ var VueRuntimeDOM = (function (exports) {
2617
2619
  const selfName = getComponentName(
2618
2620
  Component,
2619
2621
  false
2620
- /* do not include inferred name to avoid breaking existing code */
2621
2622
  );
2622
2623
  if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) {
2623
2624
  return Component;
@@ -3147,6 +3148,7 @@ If this is a native custom element, make sure to exclude it from component resol
3147
3148
  parentSuspense,
3148
3149
  parentComponent,
3149
3150
  node.parentNode,
3151
+ // eslint-disable-next-line no-restricted-globals
3150
3152
  document.createElement("div"),
3151
3153
  null,
3152
3154
  namespace,
@@ -3154,7 +3156,6 @@ If this is a native custom element, make sure to exclude it from component resol
3154
3156
  optimized,
3155
3157
  rendererInternals,
3156
3158
  true
3157
- /* hydrating */
3158
3159
  );
3159
3160
  const result = hydrateNode(
3160
3161
  node,
@@ -3256,7 +3257,14 @@ If this is a native custom element, make sure to exclude it from component resol
3256
3257
  }
3257
3258
  return doWatch(source, cb, options);
3258
3259
  }
3259
- function doWatch(source, cb, { immediate, deep, flush, once, onTrack, onTrigger } = EMPTY_OBJ) {
3260
+ function doWatch(source, cb, {
3261
+ immediate,
3262
+ deep,
3263
+ flush,
3264
+ once,
3265
+ onTrack,
3266
+ onTrigger
3267
+ } = EMPTY_OBJ) {
3260
3268
  var _a;
3261
3269
  if (cb && once) {
3262
3270
  const _cb = cb;
@@ -3941,7 +3949,6 @@ If this is a native custom element, make sure to exclude it from component resol
3941
3949
  instance,
3942
3950
  13,
3943
3951
  !errorComponent
3944
- /* do not throw in dev if user provided error component */
3945
3952
  );
3946
3953
  };
3947
3954
  if (suspensible && instance.suspense || false) {
@@ -4713,7 +4720,7 @@ If this is a native custom element, make sure to exclude it from component resol
4713
4720
  function useAttrs() {
4714
4721
  return getContext().attrs;
4715
4722
  }
4716
- function useModel(props, name) {
4723
+ function useModel(props, name, options = EMPTY_OBJ) {
4717
4724
  const i = getCurrentInstance();
4718
4725
  if (!i) {
4719
4726
  warn$1(`useModel() called without active instance.`);
@@ -4723,7 +4730,7 @@ If this is a native custom element, make sure to exclude it from component resol
4723
4730
  warn$1(`useModel() called with prop "${name}" which is not declared.`);
4724
4731
  return ref();
4725
4732
  }
4726
- return customRef((track, trigger) => {
4733
+ const res = customRef((track, trigger) => {
4727
4734
  let localValue;
4728
4735
  watchSyncEffect(() => {
4729
4736
  const propValue = props[name];
@@ -4735,7 +4742,7 @@ If this is a native custom element, make sure to exclude it from component resol
4735
4742
  return {
4736
4743
  get() {
4737
4744
  track();
4738
- return localValue;
4745
+ return options.get ? options.get(localValue) : localValue;
4739
4746
  },
4740
4747
  set(value) {
4741
4748
  const rawProps = i.vnode.props;
@@ -4743,10 +4750,24 @@ If this is a native custom element, make sure to exclude it from component resol
4743
4750
  localValue = value;
4744
4751
  trigger();
4745
4752
  }
4746
- i.emit(`update:${name}`, value);
4753
+ i.emit(`update:${name}`, options.set ? options.set(value) : value);
4747
4754
  }
4748
4755
  };
4749
4756
  });
4757
+ const modifierKey = name === "modelValue" ? "modelModifiers" : `${name}Modifiers`;
4758
+ res[Symbol.iterator] = () => {
4759
+ let i2 = 0;
4760
+ return {
4761
+ next() {
4762
+ if (i2 < 2) {
4763
+ return { value: i2++ ? props[modifierKey] : res, done: false };
4764
+ } else {
4765
+ return { done: true };
4766
+ }
4767
+ }
4768
+ };
4769
+ };
4770
+ return res;
4750
4771
  }
4751
4772
  function getContext() {
4752
4773
  const i = getCurrentInstance();
@@ -5036,7 +5057,6 @@ If this is a native custom element, make sure to exclude it from component resol
5036
5057
  opt.from || key,
5037
5058
  opt.default,
5038
5059
  true
5039
- /* treat default function as factory */
5040
5060
  );
5041
5061
  } else {
5042
5062
  injected = inject(opt.from || key);
@@ -5522,7 +5542,6 @@ If you want to remount the same app, move your app creation logic into a factory
5522
5542
  value,
5523
5543
  instance,
5524
5544
  false
5525
- /* isAbsent */
5526
5545
  );
5527
5546
  }
5528
5547
  } else {
@@ -5554,7 +5573,6 @@ If you want to remount the same app, move your app creation logic into a factory
5554
5573
  void 0,
5555
5574
  instance,
5556
5575
  true
5557
- /* isAbsent */
5558
5576
  );
5559
5577
  }
5560
5578
  } else {
@@ -8420,7 +8438,6 @@ Server rendered element contains fewer child nodes than client vdom.`
8420
8438
  dynamicProps,
8421
8439
  shapeFlag,
8422
8440
  true
8423
- /* isBlock */
8424
8441
  )
8425
8442
  );
8426
8443
  }
@@ -8433,7 +8450,6 @@ Server rendered element contains fewer child nodes than client vdom.`
8433
8450
  patchFlag,
8434
8451
  dynamicProps,
8435
8452
  true
8436
- /* isBlock: prevent a block from tracking itself */
8437
8453
  )
8438
8454
  );
8439
8455
  }
@@ -8925,7 +8941,10 @@ Component that was made reactive: `,
8925
8941
  setup,
8926
8942
  instance,
8927
8943
  0,
8928
- [shallowReadonly(instance.props) , setupContext]
8944
+ [
8945
+ shallowReadonly(instance.props) ,
8946
+ setupContext
8947
+ ]
8929
8948
  );
8930
8949
  resetTracking();
8931
8950
  unsetCurrentInstance();
@@ -9035,7 +9054,6 @@ Component that was made reactive: `,
9035
9054
  if (!compile && Component.template) {
9036
9055
  warn$1(
9037
9056
  `Component provided template option but runtime compilation is not supported in this build of Vue.` + (` Use "vue.global.js" instead.` )
9038
- /* should not happen */
9039
9057
  );
9040
9058
  } else {
9041
9059
  warn$1(`Component is missing template or render function.`);
@@ -9389,7 +9407,7 @@ Component that was made reactive: `,
9389
9407
  return true;
9390
9408
  }
9391
9409
 
9392
- const version = "3.4.0-rc.2";
9410
+ const version = "3.4.0-rc.3";
9393
9411
  const warn = warn$1 ;
9394
9412
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
9395
9413
  const devtools = devtools$1 ;