@vue/compat 3.3.0-alpha.4 → 3.3.0-alpha.6

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.
@@ -7,6 +7,96 @@ function makeMap(str, expectsLowerCase) {
7
7
  return expectsLowerCase ? (val) => !!map[val.toLowerCase()] : (val) => !!map[val];
8
8
  }
9
9
 
10
+ const EMPTY_OBJ = Object.freeze({}) ;
11
+ const EMPTY_ARR = Object.freeze([]) ;
12
+ const NOOP = () => {
13
+ };
14
+ const NO = () => false;
15
+ const onRE = /^on[^a-z]/;
16
+ const isOn = (key) => onRE.test(key);
17
+ const isModelListener = (key) => key.startsWith("onUpdate:");
18
+ const extend = Object.assign;
19
+ const remove = (arr, el) => {
20
+ const i = arr.indexOf(el);
21
+ if (i > -1) {
22
+ arr.splice(i, 1);
23
+ }
24
+ };
25
+ const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
26
+ const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
27
+ const isArray = Array.isArray;
28
+ const isMap = (val) => toTypeString(val) === "[object Map]";
29
+ const isSet = (val) => toTypeString(val) === "[object Set]";
30
+ const isDate = (val) => toTypeString(val) === "[object Date]";
31
+ const isRegExp = (val) => toTypeString(val) === "[object RegExp]";
32
+ const isFunction = (val) => typeof val === "function";
33
+ const isString = (val) => typeof val === "string";
34
+ const isSymbol = (val) => typeof val === "symbol";
35
+ const isObject = (val) => val !== null && typeof val === "object";
36
+ const isPromise = (val) => {
37
+ return isObject(val) && isFunction(val.then) && isFunction(val.catch);
38
+ };
39
+ const objectToString = Object.prototype.toString;
40
+ const toTypeString = (value) => objectToString.call(value);
41
+ const toRawType = (value) => {
42
+ return toTypeString(value).slice(8, -1);
43
+ };
44
+ const isPlainObject = (val) => toTypeString(val) === "[object Object]";
45
+ const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
46
+ const isReservedProp = /* @__PURE__ */ makeMap(
47
+ // the leading comma is intentional so empty string "" is also included
48
+ ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
49
+ );
50
+ const isBuiltInDirective = /* @__PURE__ */ makeMap(
51
+ "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"
52
+ );
53
+ const cacheStringFunction = (fn) => {
54
+ const cache = /* @__PURE__ */ Object.create(null);
55
+ return (str) => {
56
+ const hit = cache[str];
57
+ return hit || (cache[str] = fn(str));
58
+ };
59
+ };
60
+ const camelizeRE = /-(\w)/g;
61
+ const camelize = cacheStringFunction((str) => {
62
+ return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
63
+ });
64
+ const hyphenateRE = /\B([A-Z])/g;
65
+ const hyphenate = cacheStringFunction(
66
+ (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
67
+ );
68
+ const capitalize = cacheStringFunction(
69
+ (str) => str.charAt(0).toUpperCase() + str.slice(1)
70
+ );
71
+ const toHandlerKey = cacheStringFunction(
72
+ (str) => str ? `on${capitalize(str)}` : ``
73
+ );
74
+ const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
75
+ const invokeArrayFns = (fns, arg) => {
76
+ for (let i = 0; i < fns.length; i++) {
77
+ fns[i](arg);
78
+ }
79
+ };
80
+ const def = (obj, key, value) => {
81
+ Object.defineProperty(obj, key, {
82
+ configurable: true,
83
+ enumerable: false,
84
+ value
85
+ });
86
+ };
87
+ const looseToNumber = (val) => {
88
+ const n = parseFloat(val);
89
+ return isNaN(n) ? val : n;
90
+ };
91
+ const toNumber = (val) => {
92
+ const n = isString(val) ? Number(val) : NaN;
93
+ return isNaN(n) ? val : n;
94
+ };
95
+ let _globalThis;
96
+ const getGlobalThis = () => {
97
+ return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
98
+ };
99
+
10
100
  const GLOBALS_WHITE_LISTED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt";
11
101
  const isGloballyWhitelisted = /* @__PURE__ */ makeMap(GLOBALS_WHITE_LISTED);
12
102
 
@@ -161,96 +251,6 @@ const replacer = (_key, val) => {
161
251
  return val;
162
252
  };
163
253
 
164
- const EMPTY_OBJ = Object.freeze({}) ;
165
- const EMPTY_ARR = Object.freeze([]) ;
166
- const NOOP = () => {
167
- };
168
- const NO = () => false;
169
- const onRE = /^on[^a-z]/;
170
- const isOn = (key) => onRE.test(key);
171
- const isModelListener = (key) => key.startsWith("onUpdate:");
172
- const extend = Object.assign;
173
- const remove = (arr, el) => {
174
- const i = arr.indexOf(el);
175
- if (i > -1) {
176
- arr.splice(i, 1);
177
- }
178
- };
179
- const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
180
- const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
181
- const isArray = Array.isArray;
182
- const isMap = (val) => toTypeString(val) === "[object Map]";
183
- const isSet = (val) => toTypeString(val) === "[object Set]";
184
- const isDate = (val) => toTypeString(val) === "[object Date]";
185
- const isRegExp = (val) => toTypeString(val) === "[object RegExp]";
186
- const isFunction = (val) => typeof val === "function";
187
- const isString = (val) => typeof val === "string";
188
- const isSymbol = (val) => typeof val === "symbol";
189
- const isObject = (val) => val !== null && typeof val === "object";
190
- const isPromise = (val) => {
191
- return isObject(val) && isFunction(val.then) && isFunction(val.catch);
192
- };
193
- const objectToString = Object.prototype.toString;
194
- const toTypeString = (value) => objectToString.call(value);
195
- const toRawType = (value) => {
196
- return toTypeString(value).slice(8, -1);
197
- };
198
- const isPlainObject = (val) => toTypeString(val) === "[object Object]";
199
- const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
200
- const isReservedProp = /* @__PURE__ */ makeMap(
201
- // the leading comma is intentional so empty string "" is also included
202
- ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
203
- );
204
- const isBuiltInDirective = /* @__PURE__ */ makeMap(
205
- "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"
206
- );
207
- const cacheStringFunction = (fn) => {
208
- const cache = /* @__PURE__ */ Object.create(null);
209
- return (str) => {
210
- const hit = cache[str];
211
- return hit || (cache[str] = fn(str));
212
- };
213
- };
214
- const camelizeRE = /-(\w)/g;
215
- const camelize = cacheStringFunction((str) => {
216
- return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
217
- });
218
- const hyphenateRE = /\B([A-Z])/g;
219
- const hyphenate = cacheStringFunction(
220
- (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
221
- );
222
- const capitalize = cacheStringFunction(
223
- (str) => str.charAt(0).toUpperCase() + str.slice(1)
224
- );
225
- const toHandlerKey = cacheStringFunction(
226
- (str) => str ? `on${capitalize(str)}` : ``
227
- );
228
- const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
229
- const invokeArrayFns = (fns, arg) => {
230
- for (let i = 0; i < fns.length; i++) {
231
- fns[i](arg);
232
- }
233
- };
234
- const def = (obj, key, value) => {
235
- Object.defineProperty(obj, key, {
236
- configurable: true,
237
- enumerable: false,
238
- value
239
- });
240
- };
241
- const looseToNumber = (val) => {
242
- const n = parseFloat(val);
243
- return isNaN(n) ? val : n;
244
- };
245
- const toNumber = (val) => {
246
- const n = isString(val) ? Number(val) : NaN;
247
- return isNaN(n) ? val : n;
248
- };
249
- let _globalThis;
250
- const getGlobalThis = () => {
251
- return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
252
- };
253
-
254
254
  function warn$1(msg, ...args) {
255
255
  console.warn(`[Vue warn] ${msg}`, ...args);
256
256
  }
@@ -4035,8 +4035,8 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
4035
4035
  return ret;
4036
4036
  }
4037
4037
 
4038
- function defineComponent(options) {
4039
- return isFunction(options) ? { setup: options, name: options.name } : options;
4038
+ function defineComponent(options, extraOptions) {
4039
+ return isFunction(options) ? extend({}, extraOptions, { setup: options, name: options.name }) : options;
4040
4040
  }
4041
4041
 
4042
4042
  const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
@@ -4612,7 +4612,7 @@ const FILTERS = "filters";
4612
4612
  function resolveComponent(name, maybeSelfReference) {
4613
4613
  return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
4614
4614
  }
4615
- const NULL_DYNAMIC_COMPONENT = Symbol();
4615
+ const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
4616
4616
  function resolveDynamicComponent(component) {
4617
4617
  if (isString(component)) {
4618
4618
  return resolveAsset(COMPONENTS, component, false) || component;
@@ -6189,7 +6189,7 @@ function resolvePropValue(options, props, key, value, instance, isAbsent) {
6189
6189
  const hasDefault = hasOwn(opt, "default");
6190
6190
  if (hasDefault && value === void 0) {
6191
6191
  const defaultValue = opt.default;
6192
- if (opt.type !== Function && isFunction(defaultValue)) {
6192
+ if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) {
6193
6193
  const { propsDefaults } = instance;
6194
6194
  if (key in propsDefaults) {
6195
6195
  value = propsDefaults[key];
@@ -6328,7 +6328,7 @@ function validateProps(rawProps, props, instance) {
6328
6328
  }
6329
6329
  }
6330
6330
  function validateProp(name, value, prop, isAbsent) {
6331
- const { type, required, validator } = prop;
6331
+ const { type, required, validator, skipCheck } = prop;
6332
6332
  if (required && isAbsent) {
6333
6333
  warn('Missing required prop: "' + name + '"');
6334
6334
  return;
@@ -6336,7 +6336,7 @@ function validateProp(name, value, prop, isAbsent) {
6336
6336
  if (value == null && !prop.required) {
6337
6337
  return;
6338
6338
  }
6339
- if (type != null && type !== true) {
6339
+ if (type != null && type !== true && !skipCheck) {
6340
6340
  let isValid = false;
6341
6341
  const types = isArray(type) ? type : [type];
6342
6342
  const expectedTypes = [];
@@ -6578,7 +6578,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6578
6578
  return vm;
6579
6579
  }
6580
6580
  }
6581
- Vue.version = `2.6.14-compat:${"3.3.0-alpha.4"}`;
6581
+ Vue.version = `2.6.14-compat:${"3.3.0-alpha.6"}`;
6582
6582
  Vue.config = singletonApp.config;
6583
6583
  Vue.use = (p, ...options) => {
6584
6584
  if (p && isFunction(p.install)) {
@@ -9473,10 +9473,10 @@ function convertLegacyComponent(comp, instance) {
9473
9473
  return comp;
9474
9474
  }
9475
9475
 
9476
- const Fragment = Symbol("Fragment" );
9477
- const Text = Symbol("Text" );
9478
- const Comment = Symbol("Comment" );
9479
- const Static = Symbol("Static" );
9476
+ const Fragment = Symbol.for("v-fgt");
9477
+ const Text = Symbol.for("v-txt");
9478
+ const Comment = Symbol.for("v-cmt");
9479
+ const Static = Symbol.for("v-stc");
9480
9480
  const blockStack = [];
9481
9481
  let currentBlock = null;
9482
9482
  function openBlock(disableTracking = false) {
@@ -9938,13 +9938,19 @@ function createComponentInstance(vnode, parent, suspense) {
9938
9938
  }
9939
9939
  let currentInstance = null;
9940
9940
  const getCurrentInstance = () => currentInstance || currentRenderingInstance;
9941
+ let internalSetCurrentInstance;
9942
+ {
9943
+ internalSetCurrentInstance = (i) => {
9944
+ currentInstance = i;
9945
+ };
9946
+ }
9941
9947
  const setCurrentInstance = (instance) => {
9942
- currentInstance = instance;
9948
+ internalSetCurrentInstance(instance);
9943
9949
  instance.scope.on();
9944
9950
  };
9945
9951
  const unsetCurrentInstance = () => {
9946
9952
  currentInstance && currentInstance.scope.off();
9947
- currentInstance = null;
9953
+ internalSetCurrentInstance(null);
9948
9954
  };
9949
9955
  const isBuiltInTag = /* @__PURE__ */ makeMap("slot,component");
9950
9956
  function validateComponentName(name, config) {
@@ -10265,6 +10271,11 @@ function defineExpose(exposed) {
10265
10271
  warnRuntimeUsage(`defineExpose`);
10266
10272
  }
10267
10273
  }
10274
+ function defineOptions(options) {
10275
+ {
10276
+ warnRuntimeUsage(`defineOptions`);
10277
+ }
10278
+ }
10268
10279
  function withDefaults(props, defaults) {
10269
10280
  {
10270
10281
  warnRuntimeUsage(`withDefaults`);
@@ -10290,18 +10301,23 @@ function mergeDefaults(raw, defaults) {
10290
10301
  {}
10291
10302
  ) : raw;
10292
10303
  for (const key in defaults) {
10293
- const opt = props[key];
10304
+ if (key.startsWith("__skip"))
10305
+ continue;
10306
+ let opt = props[key];
10294
10307
  if (opt) {
10295
10308
  if (isArray(opt) || isFunction(opt)) {
10296
- props[key] = { type: opt, default: defaults[key] };
10309
+ opt = props[key] = { type: opt, default: defaults[key] };
10297
10310
  } else {
10298
10311
  opt.default = defaults[key];
10299
10312
  }
10300
10313
  } else if (opt === null) {
10301
- props[key] = { default: defaults[key] };
10314
+ opt = props[key] = { default: defaults[key] };
10302
10315
  } else {
10303
10316
  warn(`props default key "${key}" has no corresponding declaration.`);
10304
10317
  }
10318
+ if (opt && defaults[`__skip_${key}`]) {
10319
+ opt.skipFactory = true;
10320
+ }
10305
10321
  }
10306
10322
  return props;
10307
10323
  }
@@ -10356,7 +10372,7 @@ function h(type, propsOrChildren, children) {
10356
10372
  }
10357
10373
  }
10358
10374
 
10359
- const ssrContextKey = Symbol(`ssrContext` );
10375
+ const ssrContextKey = Symbol.for("v-scx");
10360
10376
  const useSSRContext = () => {
10361
10377
  {
10362
10378
  const ctx = inject(ssrContextKey);
@@ -10570,7 +10586,7 @@ function isMemoSame(cached, memo) {
10570
10586
  return true;
10571
10587
  }
10572
10588
 
10573
- const version = "3.3.0-alpha.4";
10589
+ const version = "3.3.0-alpha.6";
10574
10590
  const ssrUtils = null;
10575
10591
  const resolveFilter = resolveFilter$1 ;
10576
10592
  const _compatUtils = {
@@ -12226,6 +12242,7 @@ var runtimeDom = /*#__PURE__*/Object.freeze({
12226
12242
  defineCustomElement: defineCustomElement,
12227
12243
  defineEmits: defineEmits,
12228
12244
  defineExpose: defineExpose,
12245
+ defineOptions: defineOptions,
12229
12246
  defineProps: defineProps,
12230
12247
  defineSSRCustomElement: defineSSRCustomElement,
12231
12248
  get devtools () { return devtools; },
@@ -12378,4 +12395,4 @@ var Vue$1 = Vue;
12378
12395
 
12379
12396
  const { configureCompat } = Vue$1;
12380
12397
 
12381
- export { BaseTransition, BaseTransitionPropsValidators, Comment, EffectScope, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, Transition, TransitionGroup, VueElement, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, computed, configureCompat, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, Vue$1 as default, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineProps, defineSSRCustomElement, 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, 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 };
12398
+ export { BaseTransition, BaseTransitionPropsValidators, Comment, EffectScope, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, Transition, TransitionGroup, VueElement, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, computed, configureCompat, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, Vue$1 as default, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineOptions, defineProps, defineSSRCustomElement, 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, 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 };