@vue/runtime-core 3.3.0-alpha.1 → 3.3.0-alpha.10
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.
- package/dist/runtime-core.cjs.js +773 -663
- package/dist/runtime-core.cjs.prod.js +383 -292
- package/dist/runtime-core.d.ts +356 -248
- package/dist/runtime-core.esm-bundler.js +786 -677
- package/package.json +3 -3
|
@@ -1080,28 +1080,6 @@ function setActiveBranch(suspense, branch) {
|
|
|
1080
1080
|
}
|
|
1081
1081
|
}
|
|
1082
1082
|
|
|
1083
|
-
function provide(key, value) {
|
|
1084
|
-
if (!currentInstance) ; else {
|
|
1085
|
-
let provides = currentInstance.provides;
|
|
1086
|
-
const parentProvides = currentInstance.parent && currentInstance.parent.provides;
|
|
1087
|
-
if (parentProvides === provides) {
|
|
1088
|
-
provides = currentInstance.provides = Object.create(parentProvides);
|
|
1089
|
-
}
|
|
1090
|
-
provides[key] = value;
|
|
1091
|
-
}
|
|
1092
|
-
}
|
|
1093
|
-
function inject(key, defaultValue, treatDefaultAsFactory = false) {
|
|
1094
|
-
const instance = currentInstance || currentRenderingInstance;
|
|
1095
|
-
if (instance) {
|
|
1096
|
-
const provides = instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides;
|
|
1097
|
-
if (provides && key in provides) {
|
|
1098
|
-
return provides[key];
|
|
1099
|
-
} else if (arguments.length > 1) {
|
|
1100
|
-
return treatDefaultAsFactory && shared.isFunction(defaultValue) ? defaultValue.call(instance.proxy) : defaultValue;
|
|
1101
|
-
} else ;
|
|
1102
|
-
}
|
|
1103
|
-
}
|
|
1104
|
-
|
|
1105
1083
|
function watchEffect(effect, options) {
|
|
1106
1084
|
return doWatch(effect, null, options);
|
|
1107
1085
|
}
|
|
@@ -1317,6 +1295,59 @@ function traverse(value, seen) {
|
|
|
1317
1295
|
return value;
|
|
1318
1296
|
}
|
|
1319
1297
|
|
|
1298
|
+
function withDirectives(vnode, directives) {
|
|
1299
|
+
const internalInstance = currentRenderingInstance;
|
|
1300
|
+
if (internalInstance === null) {
|
|
1301
|
+
return vnode;
|
|
1302
|
+
}
|
|
1303
|
+
const instance = getExposeProxy(internalInstance) || internalInstance.proxy;
|
|
1304
|
+
const bindings = vnode.dirs || (vnode.dirs = []);
|
|
1305
|
+
for (let i = 0; i < directives.length; i++) {
|
|
1306
|
+
let [dir, value, arg, modifiers = shared.EMPTY_OBJ] = directives[i];
|
|
1307
|
+
if (dir) {
|
|
1308
|
+
if (shared.isFunction(dir)) {
|
|
1309
|
+
dir = {
|
|
1310
|
+
mounted: dir,
|
|
1311
|
+
updated: dir
|
|
1312
|
+
};
|
|
1313
|
+
}
|
|
1314
|
+
if (dir.deep) {
|
|
1315
|
+
traverse(value);
|
|
1316
|
+
}
|
|
1317
|
+
bindings.push({
|
|
1318
|
+
dir,
|
|
1319
|
+
instance,
|
|
1320
|
+
value,
|
|
1321
|
+
oldValue: void 0,
|
|
1322
|
+
arg,
|
|
1323
|
+
modifiers
|
|
1324
|
+
});
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
return vnode;
|
|
1328
|
+
}
|
|
1329
|
+
function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
1330
|
+
const bindings = vnode.dirs;
|
|
1331
|
+
const oldBindings = prevVNode && prevVNode.dirs;
|
|
1332
|
+
for (let i = 0; i < bindings.length; i++) {
|
|
1333
|
+
const binding = bindings[i];
|
|
1334
|
+
if (oldBindings) {
|
|
1335
|
+
binding.oldValue = oldBindings[i].value;
|
|
1336
|
+
}
|
|
1337
|
+
let hook = binding.dir[name];
|
|
1338
|
+
if (hook) {
|
|
1339
|
+
reactivity.pauseTracking();
|
|
1340
|
+
callWithAsyncErrorHandling(hook, instance, 8, [
|
|
1341
|
+
vnode.el,
|
|
1342
|
+
binding,
|
|
1343
|
+
vnode,
|
|
1344
|
+
prevVNode
|
|
1345
|
+
]);
|
|
1346
|
+
reactivity.resetTracking();
|
|
1347
|
+
}
|
|
1348
|
+
}
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1320
1351
|
function useTransitionState() {
|
|
1321
1352
|
const state = {
|
|
1322
1353
|
isMounted: false,
|
|
@@ -1631,8 +1662,8 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
|
1631
1662
|
return ret;
|
|
1632
1663
|
}
|
|
1633
1664
|
|
|
1634
|
-
function defineComponent(options) {
|
|
1635
|
-
return shared.isFunction(options) ? { setup: options, name: options.name } : options;
|
|
1665
|
+
function defineComponent(options, extraOptions) {
|
|
1666
|
+
return shared.isFunction(options) ? shared.extend({}, extraOptions, { setup: options, name: options.name }) : options;
|
|
1636
1667
|
}
|
|
1637
1668
|
|
|
1638
1669
|
const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
|
|
@@ -2045,65 +2076,12 @@ function onErrorCaptured(hook, target = currentInstance) {
|
|
|
2045
2076
|
injectHook("ec", hook, target);
|
|
2046
2077
|
}
|
|
2047
2078
|
|
|
2048
|
-
function withDirectives(vnode, directives) {
|
|
2049
|
-
const internalInstance = currentRenderingInstance;
|
|
2050
|
-
if (internalInstance === null) {
|
|
2051
|
-
return vnode;
|
|
2052
|
-
}
|
|
2053
|
-
const instance = getExposeProxy(internalInstance) || internalInstance.proxy;
|
|
2054
|
-
const bindings = vnode.dirs || (vnode.dirs = []);
|
|
2055
|
-
for (let i = 0; i < directives.length; i++) {
|
|
2056
|
-
let [dir, value, arg, modifiers = shared.EMPTY_OBJ] = directives[i];
|
|
2057
|
-
if (dir) {
|
|
2058
|
-
if (shared.isFunction(dir)) {
|
|
2059
|
-
dir = {
|
|
2060
|
-
mounted: dir,
|
|
2061
|
-
updated: dir
|
|
2062
|
-
};
|
|
2063
|
-
}
|
|
2064
|
-
if (dir.deep) {
|
|
2065
|
-
traverse(value);
|
|
2066
|
-
}
|
|
2067
|
-
bindings.push({
|
|
2068
|
-
dir,
|
|
2069
|
-
instance,
|
|
2070
|
-
value,
|
|
2071
|
-
oldValue: void 0,
|
|
2072
|
-
arg,
|
|
2073
|
-
modifiers
|
|
2074
|
-
});
|
|
2075
|
-
}
|
|
2076
|
-
}
|
|
2077
|
-
return vnode;
|
|
2078
|
-
}
|
|
2079
|
-
function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
2080
|
-
const bindings = vnode.dirs;
|
|
2081
|
-
const oldBindings = prevVNode && prevVNode.dirs;
|
|
2082
|
-
for (let i = 0; i < bindings.length; i++) {
|
|
2083
|
-
const binding = bindings[i];
|
|
2084
|
-
if (oldBindings) {
|
|
2085
|
-
binding.oldValue = oldBindings[i].value;
|
|
2086
|
-
}
|
|
2087
|
-
let hook = binding.dir[name];
|
|
2088
|
-
if (hook) {
|
|
2089
|
-
reactivity.pauseTracking();
|
|
2090
|
-
callWithAsyncErrorHandling(hook, instance, 8, [
|
|
2091
|
-
vnode.el,
|
|
2092
|
-
binding,
|
|
2093
|
-
vnode,
|
|
2094
|
-
prevVNode
|
|
2095
|
-
]);
|
|
2096
|
-
reactivity.resetTracking();
|
|
2097
|
-
}
|
|
2098
|
-
}
|
|
2099
|
-
}
|
|
2100
|
-
|
|
2101
2079
|
const COMPONENTS = "components";
|
|
2102
2080
|
const DIRECTIVES = "directives";
|
|
2103
2081
|
function resolveComponent(name, maybeSelfReference) {
|
|
2104
2082
|
return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
|
|
2105
2083
|
}
|
|
2106
|
-
const NULL_DYNAMIC_COMPONENT = Symbol();
|
|
2084
|
+
const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
|
|
2107
2085
|
function resolveDynamicComponent(component) {
|
|
2108
2086
|
if (shared.isString(component)) {
|
|
2109
2087
|
return resolveAsset(COMPONENTS, component, false) || component;
|
|
@@ -2390,6 +2368,119 @@ const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ shared.extend
|
|
|
2390
2368
|
}
|
|
2391
2369
|
);
|
|
2392
2370
|
|
|
2371
|
+
function defineProps() {
|
|
2372
|
+
return null;
|
|
2373
|
+
}
|
|
2374
|
+
function defineEmits() {
|
|
2375
|
+
return null;
|
|
2376
|
+
}
|
|
2377
|
+
function defineExpose(exposed) {
|
|
2378
|
+
}
|
|
2379
|
+
function defineOptions(options) {
|
|
2380
|
+
}
|
|
2381
|
+
function defineSlots() {
|
|
2382
|
+
return null;
|
|
2383
|
+
}
|
|
2384
|
+
function defineModel() {
|
|
2385
|
+
}
|
|
2386
|
+
function withDefaults(props, defaults) {
|
|
2387
|
+
return null;
|
|
2388
|
+
}
|
|
2389
|
+
function useSlots() {
|
|
2390
|
+
return getContext().slots;
|
|
2391
|
+
}
|
|
2392
|
+
function useAttrs() {
|
|
2393
|
+
return getContext().attrs;
|
|
2394
|
+
}
|
|
2395
|
+
function useModel(props, name, options) {
|
|
2396
|
+
const i = getCurrentInstance();
|
|
2397
|
+
if (options && options.local) {
|
|
2398
|
+
const proxy = reactivity.ref(props[name]);
|
|
2399
|
+
watch(
|
|
2400
|
+
() => props[name],
|
|
2401
|
+
(v) => proxy.value = v
|
|
2402
|
+
);
|
|
2403
|
+
watch(proxy, (value) => {
|
|
2404
|
+
if (value !== props[name]) {
|
|
2405
|
+
i.emit(`update:${name}`, value);
|
|
2406
|
+
}
|
|
2407
|
+
});
|
|
2408
|
+
return proxy;
|
|
2409
|
+
} else {
|
|
2410
|
+
return {
|
|
2411
|
+
__v_isRef: true,
|
|
2412
|
+
get value() {
|
|
2413
|
+
return props[name];
|
|
2414
|
+
},
|
|
2415
|
+
set value(value) {
|
|
2416
|
+
i.emit(`update:${name}`, value);
|
|
2417
|
+
}
|
|
2418
|
+
};
|
|
2419
|
+
}
|
|
2420
|
+
}
|
|
2421
|
+
function getContext() {
|
|
2422
|
+
const i = getCurrentInstance();
|
|
2423
|
+
return i.setupContext || (i.setupContext = createSetupContext(i));
|
|
2424
|
+
}
|
|
2425
|
+
function normalizePropsOrEmits(props) {
|
|
2426
|
+
return shared.isArray(props) ? props.reduce(
|
|
2427
|
+
(normalized, p) => (normalized[p] = null, normalized),
|
|
2428
|
+
{}
|
|
2429
|
+
) : props;
|
|
2430
|
+
}
|
|
2431
|
+
function mergeDefaults(raw, defaults) {
|
|
2432
|
+
const props = normalizePropsOrEmits(raw);
|
|
2433
|
+
for (const key in defaults) {
|
|
2434
|
+
if (key.startsWith("__skip"))
|
|
2435
|
+
continue;
|
|
2436
|
+
let opt = props[key];
|
|
2437
|
+
if (opt) {
|
|
2438
|
+
if (shared.isArray(opt) || shared.isFunction(opt)) {
|
|
2439
|
+
opt = props[key] = { type: opt, default: defaults[key] };
|
|
2440
|
+
} else {
|
|
2441
|
+
opt.default = defaults[key];
|
|
2442
|
+
}
|
|
2443
|
+
} else if (opt === null) {
|
|
2444
|
+
opt = props[key] = { default: defaults[key] };
|
|
2445
|
+
} else ;
|
|
2446
|
+
if (opt && defaults[`__skip_${key}`]) {
|
|
2447
|
+
opt.skipFactory = true;
|
|
2448
|
+
}
|
|
2449
|
+
}
|
|
2450
|
+
return props;
|
|
2451
|
+
}
|
|
2452
|
+
function mergeModels(a, b) {
|
|
2453
|
+
if (!a || !b)
|
|
2454
|
+
return a || b;
|
|
2455
|
+
if (shared.isArray(a) && shared.isArray(b))
|
|
2456
|
+
return a.concat(b);
|
|
2457
|
+
return shared.extend({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b));
|
|
2458
|
+
}
|
|
2459
|
+
function createPropsRestProxy(props, excludedKeys) {
|
|
2460
|
+
const ret = {};
|
|
2461
|
+
for (const key in props) {
|
|
2462
|
+
if (!excludedKeys.includes(key)) {
|
|
2463
|
+
Object.defineProperty(ret, key, {
|
|
2464
|
+
enumerable: true,
|
|
2465
|
+
get: () => props[key]
|
|
2466
|
+
});
|
|
2467
|
+
}
|
|
2468
|
+
}
|
|
2469
|
+
return ret;
|
|
2470
|
+
}
|
|
2471
|
+
function withAsyncContext(getAwaitable) {
|
|
2472
|
+
const ctx = getCurrentInstance();
|
|
2473
|
+
let awaitable = getAwaitable();
|
|
2474
|
+
unsetCurrentInstance();
|
|
2475
|
+
if (shared.isPromise(awaitable)) {
|
|
2476
|
+
awaitable = awaitable.catch((e) => {
|
|
2477
|
+
setCurrentInstance(ctx);
|
|
2478
|
+
throw e;
|
|
2479
|
+
});
|
|
2480
|
+
}
|
|
2481
|
+
return [awaitable, () => setCurrentInstance(ctx)];
|
|
2482
|
+
}
|
|
2483
|
+
|
|
2393
2484
|
let shouldCacheAccess = true;
|
|
2394
2485
|
function applyOptions(instance) {
|
|
2395
2486
|
const options = resolveMergedOptions(instance);
|
|
@@ -2646,10 +2737,8 @@ function mergeOptions(to, from, strats, asMixin = false) {
|
|
|
2646
2737
|
}
|
|
2647
2738
|
const internalOptionMergeStrats = {
|
|
2648
2739
|
data: mergeDataFn,
|
|
2649
|
-
props:
|
|
2650
|
-
|
|
2651
|
-
emits: mergeObjectOptions,
|
|
2652
|
-
// TODO
|
|
2740
|
+
props: mergeEmitsOrPropsOptions,
|
|
2741
|
+
emits: mergeEmitsOrPropsOptions,
|
|
2653
2742
|
// objects
|
|
2654
2743
|
methods: mergeObjectOptions,
|
|
2655
2744
|
computed: mergeObjectOptions,
|
|
@@ -2691,35 +2780,191 @@ function mergeDataFn(to, from) {
|
|
|
2691
2780
|
);
|
|
2692
2781
|
};
|
|
2693
2782
|
}
|
|
2694
|
-
function mergeInject(to, from) {
|
|
2695
|
-
return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
|
|
2696
|
-
}
|
|
2697
|
-
function normalizeInject(raw) {
|
|
2698
|
-
if (shared.isArray(raw)) {
|
|
2699
|
-
const res = {};
|
|
2700
|
-
for (let i = 0; i < raw.length; i++) {
|
|
2701
|
-
res[raw[i]] = raw[i];
|
|
2783
|
+
function mergeInject(to, from) {
|
|
2784
|
+
return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
|
|
2785
|
+
}
|
|
2786
|
+
function normalizeInject(raw) {
|
|
2787
|
+
if (shared.isArray(raw)) {
|
|
2788
|
+
const res = {};
|
|
2789
|
+
for (let i = 0; i < raw.length; i++) {
|
|
2790
|
+
res[raw[i]] = raw[i];
|
|
2791
|
+
}
|
|
2792
|
+
return res;
|
|
2793
|
+
}
|
|
2794
|
+
return raw;
|
|
2795
|
+
}
|
|
2796
|
+
function mergeAsArray(to, from) {
|
|
2797
|
+
return to ? [...new Set([].concat(to, from))] : from;
|
|
2798
|
+
}
|
|
2799
|
+
function mergeObjectOptions(to, from) {
|
|
2800
|
+
return to ? shared.extend(/* @__PURE__ */ Object.create(null), to, from) : from;
|
|
2801
|
+
}
|
|
2802
|
+
function mergeEmitsOrPropsOptions(to, from) {
|
|
2803
|
+
if (to) {
|
|
2804
|
+
if (shared.isArray(to) && shared.isArray(from)) {
|
|
2805
|
+
return [.../* @__PURE__ */ new Set([...to, ...from])];
|
|
2806
|
+
}
|
|
2807
|
+
return shared.extend(
|
|
2808
|
+
/* @__PURE__ */ Object.create(null),
|
|
2809
|
+
normalizePropsOrEmits(to),
|
|
2810
|
+
normalizePropsOrEmits(from != null ? from : {})
|
|
2811
|
+
);
|
|
2812
|
+
} else {
|
|
2813
|
+
return from;
|
|
2814
|
+
}
|
|
2815
|
+
}
|
|
2816
|
+
function mergeWatchOptions(to, from) {
|
|
2817
|
+
if (!to)
|
|
2818
|
+
return from;
|
|
2819
|
+
if (!from)
|
|
2820
|
+
return to;
|
|
2821
|
+
const merged = shared.extend(/* @__PURE__ */ Object.create(null), to);
|
|
2822
|
+
for (const key in from) {
|
|
2823
|
+
merged[key] = mergeAsArray(to[key], from[key]);
|
|
2824
|
+
}
|
|
2825
|
+
return merged;
|
|
2826
|
+
}
|
|
2827
|
+
|
|
2828
|
+
function createAppContext() {
|
|
2829
|
+
return {
|
|
2830
|
+
app: null,
|
|
2831
|
+
config: {
|
|
2832
|
+
isNativeTag: shared.NO,
|
|
2833
|
+
performance: false,
|
|
2834
|
+
globalProperties: {},
|
|
2835
|
+
optionMergeStrategies: {},
|
|
2836
|
+
errorHandler: void 0,
|
|
2837
|
+
warnHandler: void 0,
|
|
2838
|
+
compilerOptions: {}
|
|
2839
|
+
},
|
|
2840
|
+
mixins: [],
|
|
2841
|
+
components: {},
|
|
2842
|
+
directives: {},
|
|
2843
|
+
provides: /* @__PURE__ */ Object.create(null),
|
|
2844
|
+
optionsCache: /* @__PURE__ */ new WeakMap(),
|
|
2845
|
+
propsCache: /* @__PURE__ */ new WeakMap(),
|
|
2846
|
+
emitsCache: /* @__PURE__ */ new WeakMap()
|
|
2847
|
+
};
|
|
2848
|
+
}
|
|
2849
|
+
let uid$1 = 0;
|
|
2850
|
+
function createAppAPI(render, hydrate) {
|
|
2851
|
+
return function createApp(rootComponent, rootProps = null) {
|
|
2852
|
+
if (!shared.isFunction(rootComponent)) {
|
|
2853
|
+
rootComponent = shared.extend({}, rootComponent);
|
|
2854
|
+
}
|
|
2855
|
+
if (rootProps != null && !shared.isObject(rootProps)) {
|
|
2856
|
+
rootProps = null;
|
|
2857
|
+
}
|
|
2858
|
+
const context = createAppContext();
|
|
2859
|
+
const installedPlugins = /* @__PURE__ */ new Set();
|
|
2860
|
+
let isMounted = false;
|
|
2861
|
+
const app = context.app = {
|
|
2862
|
+
_uid: uid$1++,
|
|
2863
|
+
_component: rootComponent,
|
|
2864
|
+
_props: rootProps,
|
|
2865
|
+
_container: null,
|
|
2866
|
+
_context: context,
|
|
2867
|
+
_instance: null,
|
|
2868
|
+
version,
|
|
2869
|
+
get config() {
|
|
2870
|
+
return context.config;
|
|
2871
|
+
},
|
|
2872
|
+
set config(v) {
|
|
2873
|
+
},
|
|
2874
|
+
use(plugin, ...options) {
|
|
2875
|
+
if (installedPlugins.has(plugin)) ; else if (plugin && shared.isFunction(plugin.install)) {
|
|
2876
|
+
installedPlugins.add(plugin);
|
|
2877
|
+
plugin.install(app, ...options);
|
|
2878
|
+
} else if (shared.isFunction(plugin)) {
|
|
2879
|
+
installedPlugins.add(plugin);
|
|
2880
|
+
plugin(app, ...options);
|
|
2881
|
+
} else ;
|
|
2882
|
+
return app;
|
|
2883
|
+
},
|
|
2884
|
+
mixin(mixin) {
|
|
2885
|
+
{
|
|
2886
|
+
if (!context.mixins.includes(mixin)) {
|
|
2887
|
+
context.mixins.push(mixin);
|
|
2888
|
+
}
|
|
2889
|
+
}
|
|
2890
|
+
return app;
|
|
2891
|
+
},
|
|
2892
|
+
component(name, component) {
|
|
2893
|
+
if (!component) {
|
|
2894
|
+
return context.components[name];
|
|
2895
|
+
}
|
|
2896
|
+
context.components[name] = component;
|
|
2897
|
+
return app;
|
|
2898
|
+
},
|
|
2899
|
+
directive(name, directive) {
|
|
2900
|
+
if (!directive) {
|
|
2901
|
+
return context.directives[name];
|
|
2902
|
+
}
|
|
2903
|
+
context.directives[name] = directive;
|
|
2904
|
+
return app;
|
|
2905
|
+
},
|
|
2906
|
+
mount(rootContainer, isHydrate, isSVG) {
|
|
2907
|
+
if (!isMounted) {
|
|
2908
|
+
const vnode = createVNode(
|
|
2909
|
+
rootComponent,
|
|
2910
|
+
rootProps
|
|
2911
|
+
);
|
|
2912
|
+
vnode.appContext = context;
|
|
2913
|
+
if (isHydrate && hydrate) {
|
|
2914
|
+
hydrate(vnode, rootContainer);
|
|
2915
|
+
} else {
|
|
2916
|
+
render(vnode, rootContainer, isSVG);
|
|
2917
|
+
}
|
|
2918
|
+
isMounted = true;
|
|
2919
|
+
app._container = rootContainer;
|
|
2920
|
+
rootContainer.__vue_app__ = app;
|
|
2921
|
+
return getExposeProxy(vnode.component) || vnode.component.proxy;
|
|
2922
|
+
}
|
|
2923
|
+
},
|
|
2924
|
+
unmount() {
|
|
2925
|
+
if (isMounted) {
|
|
2926
|
+
render(null, app._container);
|
|
2927
|
+
delete app._container.__vue_app__;
|
|
2928
|
+
}
|
|
2929
|
+
},
|
|
2930
|
+
provide(key, value) {
|
|
2931
|
+
context.provides[key] = value;
|
|
2932
|
+
return app;
|
|
2933
|
+
},
|
|
2934
|
+
runWithContext(fn) {
|
|
2935
|
+
currentApp = app;
|
|
2936
|
+
try {
|
|
2937
|
+
return fn();
|
|
2938
|
+
} finally {
|
|
2939
|
+
currentApp = null;
|
|
2940
|
+
}
|
|
2941
|
+
}
|
|
2942
|
+
};
|
|
2943
|
+
return app;
|
|
2944
|
+
};
|
|
2945
|
+
}
|
|
2946
|
+
let currentApp = null;
|
|
2947
|
+
|
|
2948
|
+
function provide(key, value) {
|
|
2949
|
+
if (!currentInstance) ; else {
|
|
2950
|
+
let provides = currentInstance.provides;
|
|
2951
|
+
const parentProvides = currentInstance.parent && currentInstance.parent.provides;
|
|
2952
|
+
if (parentProvides === provides) {
|
|
2953
|
+
provides = currentInstance.provides = Object.create(parentProvides);
|
|
2702
2954
|
}
|
|
2703
|
-
|
|
2955
|
+
provides[key] = value;
|
|
2704
2956
|
}
|
|
2705
|
-
return raw;
|
|
2706
|
-
}
|
|
2707
|
-
function mergeAsArray(to, from) {
|
|
2708
|
-
return to ? [...new Set([].concat(to, from))] : from;
|
|
2709
|
-
}
|
|
2710
|
-
function mergeObjectOptions(to, from) {
|
|
2711
|
-
return to ? shared.extend(shared.extend(/* @__PURE__ */ Object.create(null), to), from) : from;
|
|
2712
2957
|
}
|
|
2713
|
-
function
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2958
|
+
function inject(key, defaultValue, treatDefaultAsFactory = false) {
|
|
2959
|
+
const instance = currentInstance || currentRenderingInstance;
|
|
2960
|
+
if (instance || currentApp) {
|
|
2961
|
+
const provides = instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : currentApp._context.provides;
|
|
2962
|
+
if (provides && key in provides) {
|
|
2963
|
+
return provides[key];
|
|
2964
|
+
} else if (arguments.length > 1) {
|
|
2965
|
+
return treatDefaultAsFactory && shared.isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
|
|
2966
|
+
} else ;
|
|
2721
2967
|
}
|
|
2722
|
-
return merged;
|
|
2723
2968
|
}
|
|
2724
2969
|
|
|
2725
2970
|
function initProps(instance, rawProps, isStateful, isSSR = false) {
|
|
@@ -2883,7 +3128,7 @@ function resolvePropValue(options, props, key, value, instance, isAbsent) {
|
|
|
2883
3128
|
const hasDefault = shared.hasOwn(opt, "default");
|
|
2884
3129
|
if (hasDefault && value === void 0) {
|
|
2885
3130
|
const defaultValue = opt.default;
|
|
2886
|
-
if (opt.type !== Function && shared.isFunction(defaultValue)) {
|
|
3131
|
+
if (opt.type !== Function && !opt.skipFactory && shared.isFunction(defaultValue)) {
|
|
2887
3132
|
const { propsDefaults } = instance;
|
|
2888
3133
|
if (key in propsDefaults) {
|
|
2889
3134
|
value = propsDefaults[key];
|
|
@@ -3079,117 +3324,6 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
3079
3324
|
}
|
|
3080
3325
|
};
|
|
3081
3326
|
|
|
3082
|
-
function createAppContext() {
|
|
3083
|
-
return {
|
|
3084
|
-
app: null,
|
|
3085
|
-
config: {
|
|
3086
|
-
isNativeTag: shared.NO,
|
|
3087
|
-
performance: false,
|
|
3088
|
-
globalProperties: {},
|
|
3089
|
-
optionMergeStrategies: {},
|
|
3090
|
-
errorHandler: void 0,
|
|
3091
|
-
warnHandler: void 0,
|
|
3092
|
-
compilerOptions: {}
|
|
3093
|
-
},
|
|
3094
|
-
mixins: [],
|
|
3095
|
-
components: {},
|
|
3096
|
-
directives: {},
|
|
3097
|
-
provides: /* @__PURE__ */ Object.create(null),
|
|
3098
|
-
optionsCache: /* @__PURE__ */ new WeakMap(),
|
|
3099
|
-
propsCache: /* @__PURE__ */ new WeakMap(),
|
|
3100
|
-
emitsCache: /* @__PURE__ */ new WeakMap()
|
|
3101
|
-
};
|
|
3102
|
-
}
|
|
3103
|
-
let uid$1 = 0;
|
|
3104
|
-
function createAppAPI(render, hydrate) {
|
|
3105
|
-
return function createApp(rootComponent, rootProps = null) {
|
|
3106
|
-
if (!shared.isFunction(rootComponent)) {
|
|
3107
|
-
rootComponent = shared.extend({}, rootComponent);
|
|
3108
|
-
}
|
|
3109
|
-
if (rootProps != null && !shared.isObject(rootProps)) {
|
|
3110
|
-
rootProps = null;
|
|
3111
|
-
}
|
|
3112
|
-
const context = createAppContext();
|
|
3113
|
-
const installedPlugins = /* @__PURE__ */ new Set();
|
|
3114
|
-
let isMounted = false;
|
|
3115
|
-
const app = context.app = {
|
|
3116
|
-
_uid: uid$1++,
|
|
3117
|
-
_component: rootComponent,
|
|
3118
|
-
_props: rootProps,
|
|
3119
|
-
_container: null,
|
|
3120
|
-
_context: context,
|
|
3121
|
-
_instance: null,
|
|
3122
|
-
version,
|
|
3123
|
-
get config() {
|
|
3124
|
-
return context.config;
|
|
3125
|
-
},
|
|
3126
|
-
set config(v) {
|
|
3127
|
-
},
|
|
3128
|
-
use(plugin, ...options) {
|
|
3129
|
-
if (installedPlugins.has(plugin)) ; else if (plugin && shared.isFunction(plugin.install)) {
|
|
3130
|
-
installedPlugins.add(plugin);
|
|
3131
|
-
plugin.install(app, ...options);
|
|
3132
|
-
} else if (shared.isFunction(plugin)) {
|
|
3133
|
-
installedPlugins.add(plugin);
|
|
3134
|
-
plugin(app, ...options);
|
|
3135
|
-
} else ;
|
|
3136
|
-
return app;
|
|
3137
|
-
},
|
|
3138
|
-
mixin(mixin) {
|
|
3139
|
-
{
|
|
3140
|
-
if (!context.mixins.includes(mixin)) {
|
|
3141
|
-
context.mixins.push(mixin);
|
|
3142
|
-
}
|
|
3143
|
-
}
|
|
3144
|
-
return app;
|
|
3145
|
-
},
|
|
3146
|
-
component(name, component) {
|
|
3147
|
-
if (!component) {
|
|
3148
|
-
return context.components[name];
|
|
3149
|
-
}
|
|
3150
|
-
context.components[name] = component;
|
|
3151
|
-
return app;
|
|
3152
|
-
},
|
|
3153
|
-
directive(name, directive) {
|
|
3154
|
-
if (!directive) {
|
|
3155
|
-
return context.directives[name];
|
|
3156
|
-
}
|
|
3157
|
-
context.directives[name] = directive;
|
|
3158
|
-
return app;
|
|
3159
|
-
},
|
|
3160
|
-
mount(rootContainer, isHydrate, isSVG) {
|
|
3161
|
-
if (!isMounted) {
|
|
3162
|
-
const vnode = createVNode(
|
|
3163
|
-
rootComponent,
|
|
3164
|
-
rootProps
|
|
3165
|
-
);
|
|
3166
|
-
vnode.appContext = context;
|
|
3167
|
-
if (isHydrate && hydrate) {
|
|
3168
|
-
hydrate(vnode, rootContainer);
|
|
3169
|
-
} else {
|
|
3170
|
-
render(vnode, rootContainer, isSVG);
|
|
3171
|
-
}
|
|
3172
|
-
isMounted = true;
|
|
3173
|
-
app._container = rootContainer;
|
|
3174
|
-
rootContainer.__vue_app__ = app;
|
|
3175
|
-
return getExposeProxy(vnode.component) || vnode.component.proxy;
|
|
3176
|
-
}
|
|
3177
|
-
},
|
|
3178
|
-
unmount() {
|
|
3179
|
-
if (isMounted) {
|
|
3180
|
-
render(null, app._container);
|
|
3181
|
-
delete app._container.__vue_app__;
|
|
3182
|
-
}
|
|
3183
|
-
},
|
|
3184
|
-
provide(key, value) {
|
|
3185
|
-
context.provides[key] = value;
|
|
3186
|
-
return app;
|
|
3187
|
-
}
|
|
3188
|
-
};
|
|
3189
|
-
return app;
|
|
3190
|
-
};
|
|
3191
|
-
}
|
|
3192
|
-
|
|
3193
3327
|
function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
3194
3328
|
if (shared.isArray(rawRef)) {
|
|
3195
3329
|
rawRef.forEach(
|
|
@@ -5194,10 +5328,10 @@ function updateCssVars(vnode) {
|
|
|
5194
5328
|
}
|
|
5195
5329
|
}
|
|
5196
5330
|
|
|
5197
|
-
const Fragment = Symbol(
|
|
5198
|
-
const Text = Symbol(
|
|
5199
|
-
const Comment = Symbol(
|
|
5200
|
-
const Static = Symbol(
|
|
5331
|
+
const Fragment = Symbol.for("v-fgt");
|
|
5332
|
+
const Text = Symbol.for("v-txt");
|
|
5333
|
+
const Comment = Symbol.for("v-cmt");
|
|
5334
|
+
const Static = Symbol.for("v-stc");
|
|
5201
5335
|
const blockStack = [];
|
|
5202
5336
|
let currentBlock = null;
|
|
5203
5337
|
function openBlock(disableTracking = false) {
|
|
@@ -5615,13 +5749,29 @@ function createComponentInstance(vnode, parent, suspense) {
|
|
|
5615
5749
|
}
|
|
5616
5750
|
let currentInstance = null;
|
|
5617
5751
|
const getCurrentInstance = () => currentInstance || currentRenderingInstance;
|
|
5752
|
+
let internalSetCurrentInstance;
|
|
5753
|
+
let globalCurrentInstanceSetters;
|
|
5754
|
+
let settersKey = "__VUE_INSTANCE_SETTERS__";
|
|
5755
|
+
{
|
|
5756
|
+
if (!(globalCurrentInstanceSetters = shared.getGlobalThis()[settersKey])) {
|
|
5757
|
+
globalCurrentInstanceSetters = shared.getGlobalThis()[settersKey] = [];
|
|
5758
|
+
}
|
|
5759
|
+
globalCurrentInstanceSetters.push((i) => currentInstance = i);
|
|
5760
|
+
internalSetCurrentInstance = (instance) => {
|
|
5761
|
+
if (globalCurrentInstanceSetters.length > 1) {
|
|
5762
|
+
globalCurrentInstanceSetters.forEach((s) => s(instance));
|
|
5763
|
+
} else {
|
|
5764
|
+
globalCurrentInstanceSetters[0](instance);
|
|
5765
|
+
}
|
|
5766
|
+
};
|
|
5767
|
+
}
|
|
5618
5768
|
const setCurrentInstance = (instance) => {
|
|
5619
|
-
|
|
5769
|
+
internalSetCurrentInstance(instance);
|
|
5620
5770
|
instance.scope.on();
|
|
5621
5771
|
};
|
|
5622
5772
|
const unsetCurrentInstance = () => {
|
|
5623
5773
|
currentInstance && currentInstance.scope.off();
|
|
5624
|
-
|
|
5774
|
+
internalSetCurrentInstance(null);
|
|
5625
5775
|
};
|
|
5626
5776
|
function isStatefulComponent(instance) {
|
|
5627
5777
|
return instance.vnode.shapeFlag & 4;
|
|
@@ -5783,71 +5933,6 @@ const computed = (getterOrOptions, debugOptions) => {
|
|
|
5783
5933
|
return reactivity.computed(getterOrOptions, debugOptions, isInSSRComponentSetup);
|
|
5784
5934
|
};
|
|
5785
5935
|
|
|
5786
|
-
function defineProps() {
|
|
5787
|
-
return null;
|
|
5788
|
-
}
|
|
5789
|
-
function defineEmits() {
|
|
5790
|
-
return null;
|
|
5791
|
-
}
|
|
5792
|
-
function defineExpose(exposed) {
|
|
5793
|
-
}
|
|
5794
|
-
function withDefaults(props, defaults) {
|
|
5795
|
-
return null;
|
|
5796
|
-
}
|
|
5797
|
-
function useSlots() {
|
|
5798
|
-
return getContext().slots;
|
|
5799
|
-
}
|
|
5800
|
-
function useAttrs() {
|
|
5801
|
-
return getContext().attrs;
|
|
5802
|
-
}
|
|
5803
|
-
function getContext() {
|
|
5804
|
-
const i = getCurrentInstance();
|
|
5805
|
-
return i.setupContext || (i.setupContext = createSetupContext(i));
|
|
5806
|
-
}
|
|
5807
|
-
function mergeDefaults(raw, defaults) {
|
|
5808
|
-
const props = shared.isArray(raw) ? raw.reduce(
|
|
5809
|
-
(normalized, p) => (normalized[p] = {}, normalized),
|
|
5810
|
-
{}
|
|
5811
|
-
) : raw;
|
|
5812
|
-
for (const key in defaults) {
|
|
5813
|
-
const opt = props[key];
|
|
5814
|
-
if (opt) {
|
|
5815
|
-
if (shared.isArray(opt) || shared.isFunction(opt)) {
|
|
5816
|
-
props[key] = { type: opt, default: defaults[key] };
|
|
5817
|
-
} else {
|
|
5818
|
-
opt.default = defaults[key];
|
|
5819
|
-
}
|
|
5820
|
-
} else if (opt === null) {
|
|
5821
|
-
props[key] = { default: defaults[key] };
|
|
5822
|
-
} else ;
|
|
5823
|
-
}
|
|
5824
|
-
return props;
|
|
5825
|
-
}
|
|
5826
|
-
function createPropsRestProxy(props, excludedKeys) {
|
|
5827
|
-
const ret = {};
|
|
5828
|
-
for (const key in props) {
|
|
5829
|
-
if (!excludedKeys.includes(key)) {
|
|
5830
|
-
Object.defineProperty(ret, key, {
|
|
5831
|
-
enumerable: true,
|
|
5832
|
-
get: () => props[key]
|
|
5833
|
-
});
|
|
5834
|
-
}
|
|
5835
|
-
}
|
|
5836
|
-
return ret;
|
|
5837
|
-
}
|
|
5838
|
-
function withAsyncContext(getAwaitable) {
|
|
5839
|
-
const ctx = getCurrentInstance();
|
|
5840
|
-
let awaitable = getAwaitable();
|
|
5841
|
-
unsetCurrentInstance();
|
|
5842
|
-
if (shared.isPromise(awaitable)) {
|
|
5843
|
-
awaitable = awaitable.catch((e) => {
|
|
5844
|
-
setCurrentInstance(ctx);
|
|
5845
|
-
throw e;
|
|
5846
|
-
});
|
|
5847
|
-
}
|
|
5848
|
-
return [awaitable, () => setCurrentInstance(ctx)];
|
|
5849
|
-
}
|
|
5850
|
-
|
|
5851
5936
|
function h(type, propsOrChildren, children) {
|
|
5852
5937
|
const l = arguments.length;
|
|
5853
5938
|
if (l === 2) {
|
|
@@ -5869,7 +5954,7 @@ function h(type, propsOrChildren, children) {
|
|
|
5869
5954
|
}
|
|
5870
5955
|
}
|
|
5871
5956
|
|
|
5872
|
-
const ssrContextKey = Symbol(
|
|
5957
|
+
const ssrContextKey = Symbol.for("v-scx");
|
|
5873
5958
|
const useSSRContext = () => {
|
|
5874
5959
|
{
|
|
5875
5960
|
const ctx = inject(ssrContextKey);
|
|
@@ -5908,7 +5993,7 @@ function isMemoSame(cached, memo) {
|
|
|
5908
5993
|
return true;
|
|
5909
5994
|
}
|
|
5910
5995
|
|
|
5911
|
-
const version = "3.3.0-alpha.
|
|
5996
|
+
const version = "3.3.0-alpha.10";
|
|
5912
5997
|
const _ssrUtils = {
|
|
5913
5998
|
createComponentInstance,
|
|
5914
5999
|
setupComponent,
|
|
@@ -5945,6 +6030,7 @@ exports.stop = reactivity.stop;
|
|
|
5945
6030
|
exports.toRaw = reactivity.toRaw;
|
|
5946
6031
|
exports.toRef = reactivity.toRef;
|
|
5947
6032
|
exports.toRefs = reactivity.toRefs;
|
|
6033
|
+
exports.toValue = reactivity.toValue;
|
|
5948
6034
|
exports.triggerRef = reactivity.triggerRef;
|
|
5949
6035
|
exports.unref = reactivity.unref;
|
|
5950
6036
|
exports.camelize = shared.camelize;
|
|
@@ -5984,7 +6070,10 @@ exports.defineAsyncComponent = defineAsyncComponent;
|
|
|
5984
6070
|
exports.defineComponent = defineComponent;
|
|
5985
6071
|
exports.defineEmits = defineEmits;
|
|
5986
6072
|
exports.defineExpose = defineExpose;
|
|
6073
|
+
exports.defineModel = defineModel;
|
|
6074
|
+
exports.defineOptions = defineOptions;
|
|
5987
6075
|
exports.defineProps = defineProps;
|
|
6076
|
+
exports.defineSlots = defineSlots;
|
|
5988
6077
|
exports.getCurrentInstance = getCurrentInstance;
|
|
5989
6078
|
exports.getTransitionRawChildren = getTransitionRawChildren;
|
|
5990
6079
|
exports.guardReactiveProps = guardReactiveProps;
|
|
@@ -5996,6 +6085,7 @@ exports.isMemoSame = isMemoSame;
|
|
|
5996
6085
|
exports.isRuntimeOnly = isRuntimeOnly;
|
|
5997
6086
|
exports.isVNode = isVNode;
|
|
5998
6087
|
exports.mergeDefaults = mergeDefaults;
|
|
6088
|
+
exports.mergeModels = mergeModels;
|
|
5999
6089
|
exports.mergeProps = mergeProps;
|
|
6000
6090
|
exports.nextTick = nextTick;
|
|
6001
6091
|
exports.onActivated = onActivated;
|
|
@@ -6031,6 +6121,7 @@ exports.ssrUtils = ssrUtils;
|
|
|
6031
6121
|
exports.toHandlers = toHandlers;
|
|
6032
6122
|
exports.transformVNodeArgs = transformVNodeArgs;
|
|
6033
6123
|
exports.useAttrs = useAttrs;
|
|
6124
|
+
exports.useModel = useModel;
|
|
6034
6125
|
exports.useSSRContext = useSSRContext;
|
|
6035
6126
|
exports.useSlots = useSlots;
|
|
6036
6127
|
exports.useTransitionState = useTransitionState;
|