vue 3.3.0-alpha.7 → 3.3.0-alpha.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.
@@ -3063,36 +3063,6 @@ function setActiveBranch(suspense, branch) {
3063
3063
  }
3064
3064
  }
3065
3065
 
3066
- function provide(key, value) {
3067
- if (!currentInstance) {
3068
- {
3069
- warn(`provide() can only be used inside setup().`);
3070
- }
3071
- } else {
3072
- let provides = currentInstance.provides;
3073
- const parentProvides = currentInstance.parent && currentInstance.parent.provides;
3074
- if (parentProvides === provides) {
3075
- provides = currentInstance.provides = Object.create(parentProvides);
3076
- }
3077
- provides[key] = value;
3078
- }
3079
- }
3080
- function inject(key, defaultValue, treatDefaultAsFactory = false) {
3081
- const instance = currentInstance || currentRenderingInstance;
3082
- if (instance) {
3083
- const provides = instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides;
3084
- if (provides && key in provides) {
3085
- return provides[key];
3086
- } else if (arguments.length > 1) {
3087
- return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance.proxy) : defaultValue;
3088
- } else {
3089
- warn(`injection "${String(key)}" not found.`);
3090
- }
3091
- } else {
3092
- warn(`inject() can only be used inside setup() or functional components.`);
3093
- }
3094
- }
3095
-
3096
3066
  function watchEffect(effect, options) {
3097
3067
  return doWatch(effect, null, options);
3098
3068
  }
@@ -3318,6 +3288,65 @@ function traverse(value, seen) {
3318
3288
  return value;
3319
3289
  }
3320
3290
 
3291
+ function validateDirectiveName(name) {
3292
+ if (isBuiltInDirective(name)) {
3293
+ warn("Do not use built-in directive ids as custom directive id: " + name);
3294
+ }
3295
+ }
3296
+ function withDirectives(vnode, directives) {
3297
+ const internalInstance = currentRenderingInstance;
3298
+ if (internalInstance === null) {
3299
+ warn(`withDirectives can only be used inside render functions.`);
3300
+ return vnode;
3301
+ }
3302
+ const instance = getExposeProxy(internalInstance) || internalInstance.proxy;
3303
+ const bindings = vnode.dirs || (vnode.dirs = []);
3304
+ for (let i = 0; i < directives.length; i++) {
3305
+ let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];
3306
+ if (dir) {
3307
+ if (isFunction(dir)) {
3308
+ dir = {
3309
+ mounted: dir,
3310
+ updated: dir
3311
+ };
3312
+ }
3313
+ if (dir.deep) {
3314
+ traverse(value);
3315
+ }
3316
+ bindings.push({
3317
+ dir,
3318
+ instance,
3319
+ value,
3320
+ oldValue: void 0,
3321
+ arg,
3322
+ modifiers
3323
+ });
3324
+ }
3325
+ }
3326
+ return vnode;
3327
+ }
3328
+ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
3329
+ const bindings = vnode.dirs;
3330
+ const oldBindings = prevVNode && prevVNode.dirs;
3331
+ for (let i = 0; i < bindings.length; i++) {
3332
+ const binding = bindings[i];
3333
+ if (oldBindings) {
3334
+ binding.oldValue = oldBindings[i].value;
3335
+ }
3336
+ let hook = binding.dir[name];
3337
+ if (hook) {
3338
+ pauseTracking();
3339
+ callWithAsyncErrorHandling(hook, instance, 8, [
3340
+ vnode.el,
3341
+ binding,
3342
+ vnode,
3343
+ prevVNode
3344
+ ]);
3345
+ resetTracking();
3346
+ }
3347
+ }
3348
+ }
3349
+
3321
3350
  function useTransitionState() {
3322
3351
  const state = {
3323
3352
  isMounted: false,
@@ -4075,65 +4104,6 @@ function onErrorCaptured(hook, target = currentInstance) {
4075
4104
  injectHook("ec", hook, target);
4076
4105
  }
4077
4106
 
4078
- function validateDirectiveName(name) {
4079
- if (isBuiltInDirective(name)) {
4080
- warn("Do not use built-in directive ids as custom directive id: " + name);
4081
- }
4082
- }
4083
- function withDirectives(vnode, directives) {
4084
- const internalInstance = currentRenderingInstance;
4085
- if (internalInstance === null) {
4086
- warn(`withDirectives can only be used inside render functions.`);
4087
- return vnode;
4088
- }
4089
- const instance = getExposeProxy(internalInstance) || internalInstance.proxy;
4090
- const bindings = vnode.dirs || (vnode.dirs = []);
4091
- for (let i = 0; i < directives.length; i++) {
4092
- let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];
4093
- if (dir) {
4094
- if (isFunction(dir)) {
4095
- dir = {
4096
- mounted: dir,
4097
- updated: dir
4098
- };
4099
- }
4100
- if (dir.deep) {
4101
- traverse(value);
4102
- }
4103
- bindings.push({
4104
- dir,
4105
- instance,
4106
- value,
4107
- oldValue: void 0,
4108
- arg,
4109
- modifiers
4110
- });
4111
- }
4112
- }
4113
- return vnode;
4114
- }
4115
- function invokeDirectiveHook(vnode, prevVNode, instance, name) {
4116
- const bindings = vnode.dirs;
4117
- const oldBindings = prevVNode && prevVNode.dirs;
4118
- for (let i = 0; i < bindings.length; i++) {
4119
- const binding = bindings[i];
4120
- if (oldBindings) {
4121
- binding.oldValue = oldBindings[i].value;
4122
- }
4123
- let hook = binding.dir[name];
4124
- if (hook) {
4125
- pauseTracking();
4126
- callWithAsyncErrorHandling(hook, instance, 8, [
4127
- vnode.el,
4128
- binding,
4129
- vnode,
4130
- prevVNode
4131
- ]);
4132
- resetTracking();
4133
- }
4134
- }
4135
- }
4136
-
4137
4107
  const COMPONENTS = "components";
4138
4108
  const DIRECTIVES = "directives";
4139
4109
  function resolveComponent(name, maybeSelfReference) {
@@ -4935,35 +4905,244 @@ function mergeDataFn(to, from) {
4935
4905
  );
4936
4906
  };
4937
4907
  }
4938
- function mergeInject(to, from) {
4939
- return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
4940
- }
4941
- function normalizeInject(raw) {
4942
- if (isArray(raw)) {
4943
- const res = {};
4944
- for (let i = 0; i < raw.length; i++) {
4945
- res[raw[i]] = raw[i];
4908
+ function mergeInject(to, from) {
4909
+ return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
4910
+ }
4911
+ function normalizeInject(raw) {
4912
+ if (isArray(raw)) {
4913
+ const res = {};
4914
+ for (let i = 0; i < raw.length; i++) {
4915
+ res[raw[i]] = raw[i];
4916
+ }
4917
+ return res;
4918
+ }
4919
+ return raw;
4920
+ }
4921
+ function mergeAsArray$1(to, from) {
4922
+ return to ? [...new Set([].concat(to, from))] : from;
4923
+ }
4924
+ function mergeObjectOptions(to, from) {
4925
+ return to ? extend(extend(/* @__PURE__ */ Object.create(null), to), from) : from;
4926
+ }
4927
+ function mergeWatchOptions(to, from) {
4928
+ if (!to)
4929
+ return from;
4930
+ if (!from)
4931
+ return to;
4932
+ const merged = extend(/* @__PURE__ */ Object.create(null), to);
4933
+ for (const key in from) {
4934
+ merged[key] = mergeAsArray$1(to[key], from[key]);
4935
+ }
4936
+ return merged;
4937
+ }
4938
+
4939
+ function createAppContext() {
4940
+ return {
4941
+ app: null,
4942
+ config: {
4943
+ isNativeTag: NO,
4944
+ performance: false,
4945
+ globalProperties: {},
4946
+ optionMergeStrategies: {},
4947
+ errorHandler: void 0,
4948
+ warnHandler: void 0,
4949
+ compilerOptions: {}
4950
+ },
4951
+ mixins: [],
4952
+ components: {},
4953
+ directives: {},
4954
+ provides: /* @__PURE__ */ Object.create(null),
4955
+ optionsCache: /* @__PURE__ */ new WeakMap(),
4956
+ propsCache: /* @__PURE__ */ new WeakMap(),
4957
+ emitsCache: /* @__PURE__ */ new WeakMap()
4958
+ };
4959
+ }
4960
+ let uid$1 = 0;
4961
+ function createAppAPI(render, hydrate) {
4962
+ return function createApp(rootComponent, rootProps = null) {
4963
+ if (!isFunction(rootComponent)) {
4964
+ rootComponent = extend({}, rootComponent);
4965
+ }
4966
+ if (rootProps != null && !isObject(rootProps)) {
4967
+ warn(`root props passed to app.mount() must be an object.`);
4968
+ rootProps = null;
4969
+ }
4970
+ const context = createAppContext();
4971
+ const installedPlugins = /* @__PURE__ */ new Set();
4972
+ let isMounted = false;
4973
+ const app = context.app = {
4974
+ _uid: uid$1++,
4975
+ _component: rootComponent,
4976
+ _props: rootProps,
4977
+ _container: null,
4978
+ _context: context,
4979
+ _instance: null,
4980
+ version,
4981
+ get config() {
4982
+ return context.config;
4983
+ },
4984
+ set config(v) {
4985
+ {
4986
+ warn(
4987
+ `app.config cannot be replaced. Modify individual options instead.`
4988
+ );
4989
+ }
4990
+ },
4991
+ use(plugin, ...options) {
4992
+ if (installedPlugins.has(plugin)) {
4993
+ warn(`Plugin has already been applied to target app.`);
4994
+ } else if (plugin && isFunction(plugin.install)) {
4995
+ installedPlugins.add(plugin);
4996
+ plugin.install(app, ...options);
4997
+ } else if (isFunction(plugin)) {
4998
+ installedPlugins.add(plugin);
4999
+ plugin(app, ...options);
5000
+ } else {
5001
+ warn(
5002
+ `A plugin must either be a function or an object with an "install" function.`
5003
+ );
5004
+ }
5005
+ return app;
5006
+ },
5007
+ mixin(mixin) {
5008
+ {
5009
+ if (!context.mixins.includes(mixin)) {
5010
+ context.mixins.push(mixin);
5011
+ } else {
5012
+ warn(
5013
+ "Mixin has already been applied to target app" + (mixin.name ? `: ${mixin.name}` : "")
5014
+ );
5015
+ }
5016
+ }
5017
+ return app;
5018
+ },
5019
+ component(name, component) {
5020
+ {
5021
+ validateComponentName(name, context.config);
5022
+ }
5023
+ if (!component) {
5024
+ return context.components[name];
5025
+ }
5026
+ if (context.components[name]) {
5027
+ warn(`Component "${name}" has already been registered in target app.`);
5028
+ }
5029
+ context.components[name] = component;
5030
+ return app;
5031
+ },
5032
+ directive(name, directive) {
5033
+ {
5034
+ validateDirectiveName(name);
5035
+ }
5036
+ if (!directive) {
5037
+ return context.directives[name];
5038
+ }
5039
+ if (context.directives[name]) {
5040
+ warn(`Directive "${name}" has already been registered in target app.`);
5041
+ }
5042
+ context.directives[name] = directive;
5043
+ return app;
5044
+ },
5045
+ mount(rootContainer, isHydrate, isSVG) {
5046
+ if (!isMounted) {
5047
+ if (rootContainer.__vue_app__) {
5048
+ warn(
5049
+ `There is already an app instance mounted on the host container.
5050
+ If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.`
5051
+ );
5052
+ }
5053
+ const vnode = createVNode(
5054
+ rootComponent,
5055
+ rootProps
5056
+ );
5057
+ vnode.appContext = context;
5058
+ {
5059
+ context.reload = () => {
5060
+ render(cloneVNode(vnode), rootContainer, isSVG);
5061
+ };
5062
+ }
5063
+ if (isHydrate && hydrate) {
5064
+ hydrate(vnode, rootContainer);
5065
+ } else {
5066
+ render(vnode, rootContainer, isSVG);
5067
+ }
5068
+ isMounted = true;
5069
+ app._container = rootContainer;
5070
+ rootContainer.__vue_app__ = app;
5071
+ {
5072
+ app._instance = vnode.component;
5073
+ devtoolsInitApp(app, version);
5074
+ }
5075
+ return getExposeProxy(vnode.component) || vnode.component.proxy;
5076
+ } else {
5077
+ warn(
5078
+ `App has already been mounted.
5079
+ If you want to remount the same app, move your app creation logic into a factory function and create fresh app instances for each mount - e.g. \`const createMyApp = () => createApp(App)\``
5080
+ );
5081
+ }
5082
+ },
5083
+ unmount() {
5084
+ if (isMounted) {
5085
+ render(null, app._container);
5086
+ {
5087
+ app._instance = null;
5088
+ devtoolsUnmountApp(app);
5089
+ }
5090
+ delete app._container.__vue_app__;
5091
+ } else {
5092
+ warn(`Cannot unmount an app that is not mounted.`);
5093
+ }
5094
+ },
5095
+ provide(key, value) {
5096
+ if (key in context.provides) {
5097
+ warn(
5098
+ `App already provides property with key "${String(key)}". It will be overwritten with the new value.`
5099
+ );
5100
+ }
5101
+ context.provides[key] = value;
5102
+ return app;
5103
+ },
5104
+ runWithContext(fn) {
5105
+ currentApp = app;
5106
+ try {
5107
+ return fn();
5108
+ } finally {
5109
+ currentApp = null;
5110
+ }
5111
+ }
5112
+ };
5113
+ return app;
5114
+ };
5115
+ }
5116
+ let currentApp = null;
5117
+
5118
+ function provide(key, value) {
5119
+ if (!currentInstance) {
5120
+ {
5121
+ warn(`provide() can only be used inside setup().`);
4946
5122
  }
4947
- return res;
5123
+ } else {
5124
+ let provides = currentInstance.provides;
5125
+ const parentProvides = currentInstance.parent && currentInstance.parent.provides;
5126
+ if (parentProvides === provides) {
5127
+ provides = currentInstance.provides = Object.create(parentProvides);
5128
+ }
5129
+ provides[key] = value;
4948
5130
  }
4949
- return raw;
4950
- }
4951
- function mergeAsArray$1(to, from) {
4952
- return to ? [...new Set([].concat(to, from))] : from;
4953
5131
  }
4954
- function mergeObjectOptions(to, from) {
4955
- return to ? extend(extend(/* @__PURE__ */ Object.create(null), to), from) : from;
4956
- }
4957
- function mergeWatchOptions(to, from) {
4958
- if (!to)
4959
- return from;
4960
- if (!from)
4961
- return to;
4962
- const merged = extend(/* @__PURE__ */ Object.create(null), to);
4963
- for (const key in from) {
4964
- merged[key] = mergeAsArray$1(to[key], from[key]);
5132
+ function inject(key, defaultValue, treatDefaultAsFactory = false) {
5133
+ const instance = currentInstance || currentRenderingInstance;
5134
+ if (instance || currentApp) {
5135
+ const provides = instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : currentApp._context.provides;
5136
+ if (provides && key in provides) {
5137
+ return provides[key];
5138
+ } else if (arguments.length > 1) {
5139
+ return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
5140
+ } else {
5141
+ warn(`injection "${String(key)}" not found.`);
5142
+ }
5143
+ } else {
5144
+ warn(`inject() can only be used inside setup() or functional components.`);
4965
5145
  }
4966
- return merged;
4967
5146
  }
4968
5147
 
4969
5148
  function initProps(instance, rawProps, isStateful, isSSR = false) {
@@ -5281,7 +5460,7 @@ function validateProp(name, value, prop, isAbsent) {
5281
5460
  warn('Missing required prop: "' + name + '"');
5282
5461
  return;
5283
5462
  }
5284
- if (value == null && !prop.required) {
5463
+ if (value == null && !required) {
5285
5464
  return;
5286
5465
  }
5287
5466
  if (type != null && type !== true && !skipCheck) {
@@ -5459,176 +5638,6 @@ const updateSlots = (instance, children, optimized) => {
5459
5638
  }
5460
5639
  };
5461
5640
 
5462
- function createAppContext() {
5463
- return {
5464
- app: null,
5465
- config: {
5466
- isNativeTag: NO,
5467
- performance: false,
5468
- globalProperties: {},
5469
- optionMergeStrategies: {},
5470
- errorHandler: void 0,
5471
- warnHandler: void 0,
5472
- compilerOptions: {}
5473
- },
5474
- mixins: [],
5475
- components: {},
5476
- directives: {},
5477
- provides: /* @__PURE__ */ Object.create(null),
5478
- optionsCache: /* @__PURE__ */ new WeakMap(),
5479
- propsCache: /* @__PURE__ */ new WeakMap(),
5480
- emitsCache: /* @__PURE__ */ new WeakMap()
5481
- };
5482
- }
5483
- let uid$1 = 0;
5484
- function createAppAPI(render, hydrate) {
5485
- return function createApp(rootComponent, rootProps = null) {
5486
- if (!isFunction(rootComponent)) {
5487
- rootComponent = extend({}, rootComponent);
5488
- }
5489
- if (rootProps != null && !isObject(rootProps)) {
5490
- warn(`root props passed to app.mount() must be an object.`);
5491
- rootProps = null;
5492
- }
5493
- const context = createAppContext();
5494
- const installedPlugins = /* @__PURE__ */ new Set();
5495
- let isMounted = false;
5496
- const app = context.app = {
5497
- _uid: uid$1++,
5498
- _component: rootComponent,
5499
- _props: rootProps,
5500
- _container: null,
5501
- _context: context,
5502
- _instance: null,
5503
- version,
5504
- get config() {
5505
- return context.config;
5506
- },
5507
- set config(v) {
5508
- {
5509
- warn(
5510
- `app.config cannot be replaced. Modify individual options instead.`
5511
- );
5512
- }
5513
- },
5514
- use(plugin, ...options) {
5515
- if (installedPlugins.has(plugin)) {
5516
- warn(`Plugin has already been applied to target app.`);
5517
- } else if (plugin && isFunction(plugin.install)) {
5518
- installedPlugins.add(plugin);
5519
- plugin.install(app, ...options);
5520
- } else if (isFunction(plugin)) {
5521
- installedPlugins.add(plugin);
5522
- plugin(app, ...options);
5523
- } else {
5524
- warn(
5525
- `A plugin must either be a function or an object with an "install" function.`
5526
- );
5527
- }
5528
- return app;
5529
- },
5530
- mixin(mixin) {
5531
- {
5532
- if (!context.mixins.includes(mixin)) {
5533
- context.mixins.push(mixin);
5534
- } else {
5535
- warn(
5536
- "Mixin has already been applied to target app" + (mixin.name ? `: ${mixin.name}` : "")
5537
- );
5538
- }
5539
- }
5540
- return app;
5541
- },
5542
- component(name, component) {
5543
- {
5544
- validateComponentName(name, context.config);
5545
- }
5546
- if (!component) {
5547
- return context.components[name];
5548
- }
5549
- if (context.components[name]) {
5550
- warn(`Component "${name}" has already been registered in target app.`);
5551
- }
5552
- context.components[name] = component;
5553
- return app;
5554
- },
5555
- directive(name, directive) {
5556
- {
5557
- validateDirectiveName(name);
5558
- }
5559
- if (!directive) {
5560
- return context.directives[name];
5561
- }
5562
- if (context.directives[name]) {
5563
- warn(`Directive "${name}" has already been registered in target app.`);
5564
- }
5565
- context.directives[name] = directive;
5566
- return app;
5567
- },
5568
- mount(rootContainer, isHydrate, isSVG) {
5569
- if (!isMounted) {
5570
- if (rootContainer.__vue_app__) {
5571
- warn(
5572
- `There is already an app instance mounted on the host container.
5573
- If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.`
5574
- );
5575
- }
5576
- const vnode = createVNode(
5577
- rootComponent,
5578
- rootProps
5579
- );
5580
- vnode.appContext = context;
5581
- {
5582
- context.reload = () => {
5583
- render(cloneVNode(vnode), rootContainer, isSVG);
5584
- };
5585
- }
5586
- if (isHydrate && hydrate) {
5587
- hydrate(vnode, rootContainer);
5588
- } else {
5589
- render(vnode, rootContainer, isSVG);
5590
- }
5591
- isMounted = true;
5592
- app._container = rootContainer;
5593
- rootContainer.__vue_app__ = app;
5594
- {
5595
- app._instance = vnode.component;
5596
- devtoolsInitApp(app, version);
5597
- }
5598
- return getExposeProxy(vnode.component) || vnode.component.proxy;
5599
- } else {
5600
- warn(
5601
- `App has already been mounted.
5602
- If you want to remount the same app, move your app creation logic into a factory function and create fresh app instances for each mount - e.g. \`const createMyApp = () => createApp(App)\``
5603
- );
5604
- }
5605
- },
5606
- unmount() {
5607
- if (isMounted) {
5608
- render(null, app._container);
5609
- {
5610
- app._instance = null;
5611
- devtoolsUnmountApp(app);
5612
- }
5613
- delete app._container.__vue_app__;
5614
- } else {
5615
- warn(`Cannot unmount an app that is not mounted.`);
5616
- }
5617
- },
5618
- provide(key, value) {
5619
- if (key in context.provides) {
5620
- warn(
5621
- `App already provides property with key "${String(key)}". It will be overwritten with the new value.`
5622
- );
5623
- }
5624
- context.provides[key] = value;
5625
- return app;
5626
- }
5627
- };
5628
- return app;
5629
- };
5630
- }
5631
-
5632
5641
  function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
5633
5642
  if (isArray(rawRef)) {
5634
5643
  rawRef.forEach(
@@ -8682,6 +8691,12 @@ function defineSlots() {
8682
8691
  {
8683
8692
  warnRuntimeUsage(`defineSlots`);
8684
8693
  }
8694
+ return null;
8695
+ }
8696
+ function defineModel() {
8697
+ {
8698
+ warnRuntimeUsage("defineModel");
8699
+ }
8685
8700
  }
8686
8701
  function withDefaults(props, defaults) {
8687
8702
  {
@@ -8695,6 +8710,40 @@ function useSlots() {
8695
8710
  function useAttrs() {
8696
8711
  return getContext().attrs;
8697
8712
  }
8713
+ function useModel(props, name, options) {
8714
+ const i = getCurrentInstance();
8715
+ if (!i) {
8716
+ warn(`useModel() called without active instance.`);
8717
+ return ref();
8718
+ }
8719
+ if (!i.propsOptions[0][name]) {
8720
+ warn(`useModel() called with prop "${name}" which is not declared.`);
8721
+ return ref();
8722
+ }
8723
+ if (options && options.local) {
8724
+ const proxy = ref(props[name]);
8725
+ watch(
8726
+ () => props[name],
8727
+ (v) => proxy.value = v
8728
+ );
8729
+ watch(proxy, (value) => {
8730
+ if (value !== props[name]) {
8731
+ i.emit(`update:${name}`, value);
8732
+ }
8733
+ });
8734
+ return proxy;
8735
+ } else {
8736
+ return {
8737
+ __v_isRef: true,
8738
+ get value() {
8739
+ return props[name];
8740
+ },
8741
+ set value(value) {
8742
+ i.emit(`update:${name}`, value);
8743
+ }
8744
+ };
8745
+ }
8746
+ }
8698
8747
  function getContext() {
8699
8748
  const i = getCurrentInstance();
8700
8749
  if (!i) {
@@ -8702,11 +8751,14 @@ function getContext() {
8702
8751
  }
8703
8752
  return i.setupContext || (i.setupContext = createSetupContext(i));
8704
8753
  }
8705
- function mergeDefaults(raw, defaults) {
8706
- const props = isArray(raw) ? raw.reduce(
8754
+ function normalizePropsOrEmits(props) {
8755
+ return isArray(props) ? props.reduce(
8707
8756
  (normalized, p) => (normalized[p] = {}, normalized),
8708
8757
  {}
8709
- ) : raw;
8758
+ ) : props;
8759
+ }
8760
+ function mergeDefaults(raw, defaults) {
8761
+ const props = normalizePropsOrEmits(raw);
8710
8762
  for (const key in defaults) {
8711
8763
  if (key.startsWith("__skip"))
8712
8764
  continue;
@@ -8728,6 +8780,13 @@ function mergeDefaults(raw, defaults) {
8728
8780
  }
8729
8781
  return props;
8730
8782
  }
8783
+ function mergeModels(a, b) {
8784
+ if (!a || !b)
8785
+ return a || b;
8786
+ if (isArray(a) && isArray(b))
8787
+ return a.concat(b);
8788
+ return extend({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b));
8789
+ }
8731
8790
  function createPropsRestProxy(props, excludedKeys) {
8732
8791
  const ret = {};
8733
8792
  for (const key in props) {
@@ -8993,7 +9052,7 @@ function isMemoSame(cached, memo) {
8993
9052
  return true;
8994
9053
  }
8995
9054
 
8996
- const version = "3.3.0-alpha.7";
9055
+ const version = "3.3.0-alpha.9";
8997
9056
  const ssrUtils = null;
8998
9057
  const resolveFilter = null;
8999
9058
  const compatUtils = null;
@@ -10505,6 +10564,7 @@ var runtimeDom = /*#__PURE__*/Object.freeze({
10505
10564
  defineCustomElement: defineCustomElement,
10506
10565
  defineEmits: defineEmits,
10507
10566
  defineExpose: defineExpose,
10567
+ defineModel: defineModel,
10508
10568
  defineOptions: defineOptions,
10509
10569
  defineProps: defineProps,
10510
10570
  defineSSRCustomElement: defineSSRCustomElement,
@@ -10532,6 +10592,7 @@ var runtimeDom = /*#__PURE__*/Object.freeze({
10532
10592
  isVNode: isVNode,
10533
10593
  markRaw: markRaw,
10534
10594
  mergeDefaults: mergeDefaults,
10595
+ mergeModels: mergeModels,
10535
10596
  mergeProps: mergeProps,
10536
10597
  nextTick: nextTick,
10537
10598
  normalizeClass: normalizeClass,
@@ -10590,6 +10651,7 @@ var runtimeDom = /*#__PURE__*/Object.freeze({
10590
10651
  useAttrs: useAttrs,
10591
10652
  useCssModule: useCssModule,
10592
10653
  useCssVars: useCssVars,
10654
+ useModel: useModel,
10593
10655
  useSSRContext: useSSRContext,
10594
10656
  useSlots: useSlots,
10595
10657
  useTransitionState: useTransitionState,
@@ -14554,7 +14616,7 @@ const transformText = (node, context) => {
14554
14616
  const seen$1 = /* @__PURE__ */ new WeakSet();
14555
14617
  const transformOnce = (node, context) => {
14556
14618
  if (node.type === 1 && findDir(node, "once", true)) {
14557
- if (seen$1.has(node) || context.inVOnce) {
14619
+ if (seen$1.has(node) || context.inVOnce || context.inSSR) {
14558
14620
  return;
14559
14621
  }
14560
14622
  seen$1.add(node);
@@ -15251,4 +15313,4 @@ ${codeFrame}` : message);
15251
15313
  }
15252
15314
  registerRuntimeCompiler(compileToFunction);
15253
15315
 
15254
- export { BaseTransition, BaseTransitionPropsValidators, Comment, EffectScope, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, Transition, TransitionGroup, VueElement, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, compileToFunction as compile, computed, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getTransitionRawChildren, guardReactiveProps, h, handleError, hydrate, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toValue, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useSSRContext, useSlots, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };
15316
+ export { BaseTransition, BaseTransitionPropsValidators, Comment, EffectScope, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, Transition, TransitionGroup, VueElement, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, compileToFunction as compile, computed, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getTransitionRawChildren, guardReactiveProps, h, handleError, hydrate, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toValue, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useModel, useSSRContext, useSlots, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };