@vue/runtime-core 3.3.0-alpha.8 → 3.3.0-beta.1
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/README.md +1 -1
- package/dist/runtime-core.cjs.js +771 -669
- package/dist/runtime-core.cjs.prod.js +398 -322
- package/dist/runtime-core.d.ts +102 -22
- package/dist/runtime-core.esm-bundler.js +774 -663
- package/package.json +3 -3
|
@@ -810,7 +810,8 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
|
|
|
810
810
|
}
|
|
811
811
|
}
|
|
812
812
|
}
|
|
813
|
-
function createSuspenseBoundary(vnode,
|
|
813
|
+
function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, isSVG, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
|
|
814
|
+
var _a;
|
|
814
815
|
const {
|
|
815
816
|
p: patch,
|
|
816
817
|
m: move,
|
|
@@ -818,10 +819,18 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
|
|
|
818
819
|
n: next,
|
|
819
820
|
o: { parentNode, remove }
|
|
820
821
|
} = rendererInternals;
|
|
822
|
+
let parentSuspenseId;
|
|
823
|
+
const isSuspensible = ((_a = vnode.props) == null ? void 0 : _a.suspensible) != null && vnode.props.suspensible !== false;
|
|
824
|
+
if (isSuspensible) {
|
|
825
|
+
if (parentSuspense == null ? void 0 : parentSuspense.pendingBranch) {
|
|
826
|
+
parentSuspenseId = parentSuspense == null ? void 0 : parentSuspense.pendingId;
|
|
827
|
+
parentSuspense.deps++;
|
|
828
|
+
}
|
|
829
|
+
}
|
|
821
830
|
const timeout = vnode.props ? shared.toNumber(vnode.props.timeout) : void 0;
|
|
822
831
|
const suspense = {
|
|
823
832
|
vnode,
|
|
824
|
-
parent,
|
|
833
|
+
parent: parentSuspense,
|
|
825
834
|
parentComponent,
|
|
826
835
|
isSVG,
|
|
827
836
|
container,
|
|
@@ -869,20 +878,28 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
|
|
|
869
878
|
setActiveBranch(suspense, pendingBranch);
|
|
870
879
|
suspense.pendingBranch = null;
|
|
871
880
|
suspense.isInFallback = false;
|
|
872
|
-
let
|
|
881
|
+
let parent = suspense.parent;
|
|
873
882
|
let hasUnresolvedAncestor = false;
|
|
874
|
-
while (
|
|
875
|
-
if (
|
|
876
|
-
|
|
883
|
+
while (parent) {
|
|
884
|
+
if (parent.pendingBranch) {
|
|
885
|
+
parent.effects.push(...effects);
|
|
877
886
|
hasUnresolvedAncestor = true;
|
|
878
887
|
break;
|
|
879
888
|
}
|
|
880
|
-
|
|
889
|
+
parent = parent.parent;
|
|
881
890
|
}
|
|
882
891
|
if (!hasUnresolvedAncestor) {
|
|
883
892
|
queuePostFlushCb(effects);
|
|
884
893
|
}
|
|
885
894
|
suspense.effects = [];
|
|
895
|
+
if (isSuspensible) {
|
|
896
|
+
if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
|
|
897
|
+
parentSuspense.deps--;
|
|
898
|
+
if (parentSuspense.deps === 0) {
|
|
899
|
+
parentSuspense.resolve();
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
}
|
|
886
903
|
triggerEvent(vnode2, "onResolve");
|
|
887
904
|
},
|
|
888
905
|
fallback(fallbackVNode) {
|
|
@@ -976,13 +993,13 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
|
|
|
976
993
|
}
|
|
977
994
|
});
|
|
978
995
|
},
|
|
979
|
-
unmount(
|
|
996
|
+
unmount(parentSuspense2, doRemove) {
|
|
980
997
|
suspense.isUnmounted = true;
|
|
981
998
|
if (suspense.activeBranch) {
|
|
982
999
|
unmount(
|
|
983
1000
|
suspense.activeBranch,
|
|
984
1001
|
parentComponent,
|
|
985
|
-
|
|
1002
|
+
parentSuspense2,
|
|
986
1003
|
doRemove
|
|
987
1004
|
);
|
|
988
1005
|
}
|
|
@@ -990,7 +1007,7 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
|
|
|
990
1007
|
unmount(
|
|
991
1008
|
suspense.pendingBranch,
|
|
992
1009
|
parentComponent,
|
|
993
|
-
|
|
1010
|
+
parentSuspense2,
|
|
994
1011
|
doRemove
|
|
995
1012
|
);
|
|
996
1013
|
}
|
|
@@ -1080,28 +1097,6 @@ function setActiveBranch(suspense, branch) {
|
|
|
1080
1097
|
}
|
|
1081
1098
|
}
|
|
1082
1099
|
|
|
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
1100
|
function watchEffect(effect, options) {
|
|
1106
1101
|
return doWatch(effect, null, options);
|
|
1107
1102
|
}
|
|
@@ -1317,6 +1312,59 @@ function traverse(value, seen) {
|
|
|
1317
1312
|
return value;
|
|
1318
1313
|
}
|
|
1319
1314
|
|
|
1315
|
+
function withDirectives(vnode, directives) {
|
|
1316
|
+
const internalInstance = currentRenderingInstance;
|
|
1317
|
+
if (internalInstance === null) {
|
|
1318
|
+
return vnode;
|
|
1319
|
+
}
|
|
1320
|
+
const instance = getExposeProxy(internalInstance) || internalInstance.proxy;
|
|
1321
|
+
const bindings = vnode.dirs || (vnode.dirs = []);
|
|
1322
|
+
for (let i = 0; i < directives.length; i++) {
|
|
1323
|
+
let [dir, value, arg, modifiers = shared.EMPTY_OBJ] = directives[i];
|
|
1324
|
+
if (dir) {
|
|
1325
|
+
if (shared.isFunction(dir)) {
|
|
1326
|
+
dir = {
|
|
1327
|
+
mounted: dir,
|
|
1328
|
+
updated: dir
|
|
1329
|
+
};
|
|
1330
|
+
}
|
|
1331
|
+
if (dir.deep) {
|
|
1332
|
+
traverse(value);
|
|
1333
|
+
}
|
|
1334
|
+
bindings.push({
|
|
1335
|
+
dir,
|
|
1336
|
+
instance,
|
|
1337
|
+
value,
|
|
1338
|
+
oldValue: void 0,
|
|
1339
|
+
arg,
|
|
1340
|
+
modifiers
|
|
1341
|
+
});
|
|
1342
|
+
}
|
|
1343
|
+
}
|
|
1344
|
+
return vnode;
|
|
1345
|
+
}
|
|
1346
|
+
function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
1347
|
+
const bindings = vnode.dirs;
|
|
1348
|
+
const oldBindings = prevVNode && prevVNode.dirs;
|
|
1349
|
+
for (let i = 0; i < bindings.length; i++) {
|
|
1350
|
+
const binding = bindings[i];
|
|
1351
|
+
if (oldBindings) {
|
|
1352
|
+
binding.oldValue = oldBindings[i].value;
|
|
1353
|
+
}
|
|
1354
|
+
let hook = binding.dir[name];
|
|
1355
|
+
if (hook) {
|
|
1356
|
+
reactivity.pauseTracking();
|
|
1357
|
+
callWithAsyncErrorHandling(hook, instance, 8, [
|
|
1358
|
+
vnode.el,
|
|
1359
|
+
binding,
|
|
1360
|
+
vnode,
|
|
1361
|
+
prevVNode
|
|
1362
|
+
]);
|
|
1363
|
+
reactivity.resetTracking();
|
|
1364
|
+
}
|
|
1365
|
+
}
|
|
1366
|
+
}
|
|
1367
|
+
|
|
1320
1368
|
function useTransitionState() {
|
|
1321
1369
|
const state = {
|
|
1322
1370
|
isMounted: false,
|
|
@@ -2045,59 +2093,6 @@ function onErrorCaptured(hook, target = currentInstance) {
|
|
|
2045
2093
|
injectHook("ec", hook, target);
|
|
2046
2094
|
}
|
|
2047
2095
|
|
|
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
2096
|
const COMPONENTS = "components";
|
|
2102
2097
|
const DIRECTIVES = "directives";
|
|
2103
2098
|
function resolveComponent(name, maybeSelfReference) {
|
|
@@ -2390,6 +2385,119 @@ const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ shared.extend
|
|
|
2390
2385
|
}
|
|
2391
2386
|
);
|
|
2392
2387
|
|
|
2388
|
+
function defineProps() {
|
|
2389
|
+
return null;
|
|
2390
|
+
}
|
|
2391
|
+
function defineEmits() {
|
|
2392
|
+
return null;
|
|
2393
|
+
}
|
|
2394
|
+
function defineExpose(exposed) {
|
|
2395
|
+
}
|
|
2396
|
+
function defineOptions(options) {
|
|
2397
|
+
}
|
|
2398
|
+
function defineSlots() {
|
|
2399
|
+
return null;
|
|
2400
|
+
}
|
|
2401
|
+
function defineModel() {
|
|
2402
|
+
}
|
|
2403
|
+
function withDefaults(props, defaults) {
|
|
2404
|
+
return null;
|
|
2405
|
+
}
|
|
2406
|
+
function useSlots() {
|
|
2407
|
+
return getContext().slots;
|
|
2408
|
+
}
|
|
2409
|
+
function useAttrs() {
|
|
2410
|
+
return getContext().attrs;
|
|
2411
|
+
}
|
|
2412
|
+
function useModel(props, name, options) {
|
|
2413
|
+
const i = getCurrentInstance();
|
|
2414
|
+
if (options && options.local) {
|
|
2415
|
+
const proxy = reactivity.ref(props[name]);
|
|
2416
|
+
watch(
|
|
2417
|
+
() => props[name],
|
|
2418
|
+
(v) => proxy.value = v
|
|
2419
|
+
);
|
|
2420
|
+
watch(proxy, (value) => {
|
|
2421
|
+
if (value !== props[name]) {
|
|
2422
|
+
i.emit(`update:${name}`, value);
|
|
2423
|
+
}
|
|
2424
|
+
});
|
|
2425
|
+
return proxy;
|
|
2426
|
+
} else {
|
|
2427
|
+
return {
|
|
2428
|
+
__v_isRef: true,
|
|
2429
|
+
get value() {
|
|
2430
|
+
return props[name];
|
|
2431
|
+
},
|
|
2432
|
+
set value(value) {
|
|
2433
|
+
i.emit(`update:${name}`, value);
|
|
2434
|
+
}
|
|
2435
|
+
};
|
|
2436
|
+
}
|
|
2437
|
+
}
|
|
2438
|
+
function getContext() {
|
|
2439
|
+
const i = getCurrentInstance();
|
|
2440
|
+
return i.setupContext || (i.setupContext = createSetupContext(i));
|
|
2441
|
+
}
|
|
2442
|
+
function normalizePropsOrEmits(props) {
|
|
2443
|
+
return shared.isArray(props) ? props.reduce(
|
|
2444
|
+
(normalized, p) => (normalized[p] = null, normalized),
|
|
2445
|
+
{}
|
|
2446
|
+
) : props;
|
|
2447
|
+
}
|
|
2448
|
+
function mergeDefaults(raw, defaults) {
|
|
2449
|
+
const props = normalizePropsOrEmits(raw);
|
|
2450
|
+
for (const key in defaults) {
|
|
2451
|
+
if (key.startsWith("__skip"))
|
|
2452
|
+
continue;
|
|
2453
|
+
let opt = props[key];
|
|
2454
|
+
if (opt) {
|
|
2455
|
+
if (shared.isArray(opt) || shared.isFunction(opt)) {
|
|
2456
|
+
opt = props[key] = { type: opt, default: defaults[key] };
|
|
2457
|
+
} else {
|
|
2458
|
+
opt.default = defaults[key];
|
|
2459
|
+
}
|
|
2460
|
+
} else if (opt === null) {
|
|
2461
|
+
opt = props[key] = { default: defaults[key] };
|
|
2462
|
+
} else ;
|
|
2463
|
+
if (opt && defaults[`__skip_${key}`]) {
|
|
2464
|
+
opt.skipFactory = true;
|
|
2465
|
+
}
|
|
2466
|
+
}
|
|
2467
|
+
return props;
|
|
2468
|
+
}
|
|
2469
|
+
function mergeModels(a, b) {
|
|
2470
|
+
if (!a || !b)
|
|
2471
|
+
return a || b;
|
|
2472
|
+
if (shared.isArray(a) && shared.isArray(b))
|
|
2473
|
+
return a.concat(b);
|
|
2474
|
+
return shared.extend({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b));
|
|
2475
|
+
}
|
|
2476
|
+
function createPropsRestProxy(props, excludedKeys) {
|
|
2477
|
+
const ret = {};
|
|
2478
|
+
for (const key in props) {
|
|
2479
|
+
if (!excludedKeys.includes(key)) {
|
|
2480
|
+
Object.defineProperty(ret, key, {
|
|
2481
|
+
enumerable: true,
|
|
2482
|
+
get: () => props[key]
|
|
2483
|
+
});
|
|
2484
|
+
}
|
|
2485
|
+
}
|
|
2486
|
+
return ret;
|
|
2487
|
+
}
|
|
2488
|
+
function withAsyncContext(getAwaitable) {
|
|
2489
|
+
const ctx = getCurrentInstance();
|
|
2490
|
+
let awaitable = getAwaitable();
|
|
2491
|
+
unsetCurrentInstance();
|
|
2492
|
+
if (shared.isPromise(awaitable)) {
|
|
2493
|
+
awaitable = awaitable.catch((e) => {
|
|
2494
|
+
setCurrentInstance(ctx);
|
|
2495
|
+
throw e;
|
|
2496
|
+
});
|
|
2497
|
+
}
|
|
2498
|
+
return [awaitable, () => setCurrentInstance(ctx)];
|
|
2499
|
+
}
|
|
2500
|
+
|
|
2393
2501
|
let shouldCacheAccess = true;
|
|
2394
2502
|
function applyOptions(instance) {
|
|
2395
2503
|
const options = resolveMergedOptions(instance);
|
|
@@ -2434,12 +2542,7 @@ function applyOptions(instance) {
|
|
|
2434
2542
|
} = options;
|
|
2435
2543
|
const checkDuplicateProperties = null;
|
|
2436
2544
|
if (injectOptions) {
|
|
2437
|
-
resolveInjections(
|
|
2438
|
-
injectOptions,
|
|
2439
|
-
ctx,
|
|
2440
|
-
checkDuplicateProperties,
|
|
2441
|
-
instance.appContext.config.unwrapInjectedRef
|
|
2442
|
-
);
|
|
2545
|
+
resolveInjections(injectOptions, ctx, checkDuplicateProperties);
|
|
2443
2546
|
}
|
|
2444
2547
|
if (methods) {
|
|
2445
2548
|
for (const key in methods) {
|
|
@@ -2532,7 +2635,7 @@ function applyOptions(instance) {
|
|
|
2532
2635
|
if (directives)
|
|
2533
2636
|
instance.directives = directives;
|
|
2534
2637
|
}
|
|
2535
|
-
function resolveInjections(injectOptions, ctx, checkDuplicateProperties = shared.NOOP
|
|
2638
|
+
function resolveInjections(injectOptions, ctx, checkDuplicateProperties = shared.NOOP) {
|
|
2536
2639
|
if (shared.isArray(injectOptions)) {
|
|
2537
2640
|
injectOptions = normalizeInject(injectOptions);
|
|
2538
2641
|
}
|
|
@@ -2554,16 +2657,12 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = shared
|
|
|
2554
2657
|
injected = inject(opt);
|
|
2555
2658
|
}
|
|
2556
2659
|
if (reactivity.isRef(injected)) {
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
});
|
|
2564
|
-
} else {
|
|
2565
|
-
ctx[key] = injected;
|
|
2566
|
-
}
|
|
2660
|
+
Object.defineProperty(ctx, key, {
|
|
2661
|
+
enumerable: true,
|
|
2662
|
+
configurable: true,
|
|
2663
|
+
get: () => injected.value,
|
|
2664
|
+
set: (v) => injected.value = v
|
|
2665
|
+
});
|
|
2567
2666
|
} else {
|
|
2568
2667
|
ctx[key] = injected;
|
|
2569
2668
|
}
|
|
@@ -2646,10 +2745,8 @@ function mergeOptions(to, from, strats, asMixin = false) {
|
|
|
2646
2745
|
}
|
|
2647
2746
|
const internalOptionMergeStrats = {
|
|
2648
2747
|
data: mergeDataFn,
|
|
2649
|
-
props:
|
|
2650
|
-
|
|
2651
|
-
emits: mergeObjectOptions,
|
|
2652
|
-
// TODO
|
|
2748
|
+
props: mergeEmitsOrPropsOptions,
|
|
2749
|
+
emits: mergeEmitsOrPropsOptions,
|
|
2653
2750
|
// objects
|
|
2654
2751
|
methods: mergeObjectOptions,
|
|
2655
2752
|
computed: mergeObjectOptions,
|
|
@@ -2691,35 +2788,194 @@ function mergeDataFn(to, from) {
|
|
|
2691
2788
|
);
|
|
2692
2789
|
};
|
|
2693
2790
|
}
|
|
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];
|
|
2791
|
+
function mergeInject(to, from) {
|
|
2792
|
+
return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
|
|
2793
|
+
}
|
|
2794
|
+
function normalizeInject(raw) {
|
|
2795
|
+
if (shared.isArray(raw)) {
|
|
2796
|
+
const res = {};
|
|
2797
|
+
for (let i = 0; i < raw.length; i++) {
|
|
2798
|
+
res[raw[i]] = raw[i];
|
|
2799
|
+
}
|
|
2800
|
+
return res;
|
|
2801
|
+
}
|
|
2802
|
+
return raw;
|
|
2803
|
+
}
|
|
2804
|
+
function mergeAsArray(to, from) {
|
|
2805
|
+
return to ? [...new Set([].concat(to, from))] : from;
|
|
2806
|
+
}
|
|
2807
|
+
function mergeObjectOptions(to, from) {
|
|
2808
|
+
return to ? shared.extend(/* @__PURE__ */ Object.create(null), to, from) : from;
|
|
2809
|
+
}
|
|
2810
|
+
function mergeEmitsOrPropsOptions(to, from) {
|
|
2811
|
+
if (to) {
|
|
2812
|
+
if (shared.isArray(to) && shared.isArray(from)) {
|
|
2813
|
+
return [.../* @__PURE__ */ new Set([...to, ...from])];
|
|
2814
|
+
}
|
|
2815
|
+
return shared.extend(
|
|
2816
|
+
/* @__PURE__ */ Object.create(null),
|
|
2817
|
+
normalizePropsOrEmits(to),
|
|
2818
|
+
normalizePropsOrEmits(from != null ? from : {})
|
|
2819
|
+
);
|
|
2820
|
+
} else {
|
|
2821
|
+
return from;
|
|
2822
|
+
}
|
|
2823
|
+
}
|
|
2824
|
+
function mergeWatchOptions(to, from) {
|
|
2825
|
+
if (!to)
|
|
2826
|
+
return from;
|
|
2827
|
+
if (!from)
|
|
2828
|
+
return to;
|
|
2829
|
+
const merged = shared.extend(/* @__PURE__ */ Object.create(null), to);
|
|
2830
|
+
for (const key in from) {
|
|
2831
|
+
merged[key] = mergeAsArray(to[key], from[key]);
|
|
2832
|
+
}
|
|
2833
|
+
return merged;
|
|
2834
|
+
}
|
|
2835
|
+
|
|
2836
|
+
function createAppContext() {
|
|
2837
|
+
return {
|
|
2838
|
+
app: null,
|
|
2839
|
+
config: {
|
|
2840
|
+
isNativeTag: shared.NO,
|
|
2841
|
+
performance: false,
|
|
2842
|
+
globalProperties: {},
|
|
2843
|
+
optionMergeStrategies: {},
|
|
2844
|
+
errorHandler: void 0,
|
|
2845
|
+
warnHandler: void 0,
|
|
2846
|
+
compilerOptions: {}
|
|
2847
|
+
},
|
|
2848
|
+
mixins: [],
|
|
2849
|
+
components: {},
|
|
2850
|
+
directives: {},
|
|
2851
|
+
provides: /* @__PURE__ */ Object.create(null),
|
|
2852
|
+
optionsCache: /* @__PURE__ */ new WeakMap(),
|
|
2853
|
+
propsCache: /* @__PURE__ */ new WeakMap(),
|
|
2854
|
+
emitsCache: /* @__PURE__ */ new WeakMap()
|
|
2855
|
+
};
|
|
2856
|
+
}
|
|
2857
|
+
let uid$1 = 0;
|
|
2858
|
+
function createAppAPI(render, hydrate) {
|
|
2859
|
+
return function createApp(rootComponent, rootProps = null) {
|
|
2860
|
+
if (!shared.isFunction(rootComponent)) {
|
|
2861
|
+
rootComponent = shared.extend({}, rootComponent);
|
|
2862
|
+
}
|
|
2863
|
+
if (rootProps != null && !shared.isObject(rootProps)) {
|
|
2864
|
+
rootProps = null;
|
|
2865
|
+
}
|
|
2866
|
+
const context = createAppContext();
|
|
2867
|
+
const installedPlugins = /* @__PURE__ */ new Set();
|
|
2868
|
+
let isMounted = false;
|
|
2869
|
+
const app = context.app = {
|
|
2870
|
+
_uid: uid$1++,
|
|
2871
|
+
_component: rootComponent,
|
|
2872
|
+
_props: rootProps,
|
|
2873
|
+
_container: null,
|
|
2874
|
+
_context: context,
|
|
2875
|
+
_instance: null,
|
|
2876
|
+
version,
|
|
2877
|
+
get config() {
|
|
2878
|
+
return context.config;
|
|
2879
|
+
},
|
|
2880
|
+
set config(v) {
|
|
2881
|
+
},
|
|
2882
|
+
use(plugin, ...options) {
|
|
2883
|
+
if (installedPlugins.has(plugin)) ; else if (plugin && shared.isFunction(plugin.install)) {
|
|
2884
|
+
installedPlugins.add(plugin);
|
|
2885
|
+
plugin.install(app, ...options);
|
|
2886
|
+
} else if (shared.isFunction(plugin)) {
|
|
2887
|
+
installedPlugins.add(plugin);
|
|
2888
|
+
plugin(app, ...options);
|
|
2889
|
+
} else ;
|
|
2890
|
+
return app;
|
|
2891
|
+
},
|
|
2892
|
+
mixin(mixin) {
|
|
2893
|
+
{
|
|
2894
|
+
if (!context.mixins.includes(mixin)) {
|
|
2895
|
+
context.mixins.push(mixin);
|
|
2896
|
+
}
|
|
2897
|
+
}
|
|
2898
|
+
return app;
|
|
2899
|
+
},
|
|
2900
|
+
component(name, component) {
|
|
2901
|
+
if (!component) {
|
|
2902
|
+
return context.components[name];
|
|
2903
|
+
}
|
|
2904
|
+
context.components[name] = component;
|
|
2905
|
+
return app;
|
|
2906
|
+
},
|
|
2907
|
+
directive(name, directive) {
|
|
2908
|
+
if (!directive) {
|
|
2909
|
+
return context.directives[name];
|
|
2910
|
+
}
|
|
2911
|
+
context.directives[name] = directive;
|
|
2912
|
+
return app;
|
|
2913
|
+
},
|
|
2914
|
+
mount(rootContainer, isHydrate, isSVG) {
|
|
2915
|
+
if (!isMounted) {
|
|
2916
|
+
const vnode = createVNode(
|
|
2917
|
+
rootComponent,
|
|
2918
|
+
rootProps
|
|
2919
|
+
);
|
|
2920
|
+
vnode.appContext = context;
|
|
2921
|
+
if (isHydrate && hydrate) {
|
|
2922
|
+
hydrate(vnode, rootContainer);
|
|
2923
|
+
} else {
|
|
2924
|
+
render(vnode, rootContainer, isSVG);
|
|
2925
|
+
}
|
|
2926
|
+
isMounted = true;
|
|
2927
|
+
app._container = rootContainer;
|
|
2928
|
+
rootContainer.__vue_app__ = app;
|
|
2929
|
+
return getExposeProxy(vnode.component) || vnode.component.proxy;
|
|
2930
|
+
}
|
|
2931
|
+
},
|
|
2932
|
+
unmount() {
|
|
2933
|
+
if (isMounted) {
|
|
2934
|
+
render(null, app._container);
|
|
2935
|
+
delete app._container.__vue_app__;
|
|
2936
|
+
}
|
|
2937
|
+
},
|
|
2938
|
+
provide(key, value) {
|
|
2939
|
+
context.provides[key] = value;
|
|
2940
|
+
return app;
|
|
2941
|
+
},
|
|
2942
|
+
runWithContext(fn) {
|
|
2943
|
+
currentApp = app;
|
|
2944
|
+
try {
|
|
2945
|
+
return fn();
|
|
2946
|
+
} finally {
|
|
2947
|
+
currentApp = null;
|
|
2948
|
+
}
|
|
2949
|
+
}
|
|
2950
|
+
};
|
|
2951
|
+
return app;
|
|
2952
|
+
};
|
|
2953
|
+
}
|
|
2954
|
+
let currentApp = null;
|
|
2955
|
+
|
|
2956
|
+
function provide(key, value) {
|
|
2957
|
+
if (!currentInstance) ; else {
|
|
2958
|
+
let provides = currentInstance.provides;
|
|
2959
|
+
const parentProvides = currentInstance.parent && currentInstance.parent.provides;
|
|
2960
|
+
if (parentProvides === provides) {
|
|
2961
|
+
provides = currentInstance.provides = Object.create(parentProvides);
|
|
2702
2962
|
}
|
|
2703
|
-
|
|
2963
|
+
provides[key] = value;
|
|
2704
2964
|
}
|
|
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
2965
|
}
|
|
2713
|
-
function
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2966
|
+
function inject(key, defaultValue, treatDefaultAsFactory = false) {
|
|
2967
|
+
const instance = currentInstance || currentRenderingInstance;
|
|
2968
|
+
if (instance || currentApp) {
|
|
2969
|
+
const provides = instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : currentApp._context.provides;
|
|
2970
|
+
if (provides && key in provides) {
|
|
2971
|
+
return provides[key];
|
|
2972
|
+
} else if (arguments.length > 1) {
|
|
2973
|
+
return treatDefaultAsFactory && shared.isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
|
|
2974
|
+
} else ;
|
|
2721
2975
|
}
|
|
2722
|
-
|
|
2976
|
+
}
|
|
2977
|
+
function hasInjectionContext() {
|
|
2978
|
+
return !!(currentInstance || currentRenderingInstance || currentApp);
|
|
2723
2979
|
}
|
|
2724
2980
|
|
|
2725
2981
|
function initProps(instance, rawProps, isStateful, isSSR = false) {
|
|
@@ -3079,117 +3335,6 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
3079
3335
|
}
|
|
3080
3336
|
};
|
|
3081
3337
|
|
|
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
3338
|
function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
3194
3339
|
if (shared.isArray(rawRef)) {
|
|
3195
3340
|
rawRef.forEach(
|
|
@@ -5578,6 +5723,8 @@ function createComponentInstance(vnode, parent, suspense) {
|
|
|
5578
5723
|
refs: shared.EMPTY_OBJ,
|
|
5579
5724
|
setupState: shared.EMPTY_OBJ,
|
|
5580
5725
|
setupContext: null,
|
|
5726
|
+
attrsProxy: null,
|
|
5727
|
+
slotsProxy: null,
|
|
5581
5728
|
// suspense related
|
|
5582
5729
|
suspense,
|
|
5583
5730
|
suspenseId: suspense ? suspense.pendingId : 0,
|
|
@@ -5745,8 +5892,8 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
5745
5892
|
unsetCurrentInstance();
|
|
5746
5893
|
}
|
|
5747
5894
|
}
|
|
5748
|
-
function
|
|
5749
|
-
return new Proxy(
|
|
5895
|
+
function getAttrsProxy(instance) {
|
|
5896
|
+
return instance.attrsProxy || (instance.attrsProxy = new Proxy(
|
|
5750
5897
|
instance.attrs,
|
|
5751
5898
|
{
|
|
5752
5899
|
get(target, key) {
|
|
@@ -5754,17 +5901,16 @@ function createAttrsProxy(instance) {
|
|
|
5754
5901
|
return target[key];
|
|
5755
5902
|
}
|
|
5756
5903
|
}
|
|
5757
|
-
);
|
|
5904
|
+
));
|
|
5758
5905
|
}
|
|
5759
5906
|
function createSetupContext(instance) {
|
|
5760
5907
|
const expose = (exposed) => {
|
|
5761
5908
|
instance.exposed = exposed || {};
|
|
5762
5909
|
};
|
|
5763
|
-
let attrs;
|
|
5764
5910
|
{
|
|
5765
5911
|
return {
|
|
5766
5912
|
get attrs() {
|
|
5767
|
-
return
|
|
5913
|
+
return getAttrsProxy(instance);
|
|
5768
5914
|
},
|
|
5769
5915
|
slots: instance.slots,
|
|
5770
5916
|
emit: instance.emit,
|
|
@@ -5799,80 +5945,6 @@ const computed = (getterOrOptions, debugOptions) => {
|
|
|
5799
5945
|
return reactivity.computed(getterOrOptions, debugOptions, isInSSRComponentSetup);
|
|
5800
5946
|
};
|
|
5801
5947
|
|
|
5802
|
-
function defineProps() {
|
|
5803
|
-
return null;
|
|
5804
|
-
}
|
|
5805
|
-
function defineEmits() {
|
|
5806
|
-
return null;
|
|
5807
|
-
}
|
|
5808
|
-
function defineExpose(exposed) {
|
|
5809
|
-
}
|
|
5810
|
-
function defineOptions(options) {
|
|
5811
|
-
}
|
|
5812
|
-
function defineSlots() {
|
|
5813
|
-
}
|
|
5814
|
-
function withDefaults(props, defaults) {
|
|
5815
|
-
return null;
|
|
5816
|
-
}
|
|
5817
|
-
function useSlots() {
|
|
5818
|
-
return getContext().slots;
|
|
5819
|
-
}
|
|
5820
|
-
function useAttrs() {
|
|
5821
|
-
return getContext().attrs;
|
|
5822
|
-
}
|
|
5823
|
-
function getContext() {
|
|
5824
|
-
const i = getCurrentInstance();
|
|
5825
|
-
return i.setupContext || (i.setupContext = createSetupContext(i));
|
|
5826
|
-
}
|
|
5827
|
-
function mergeDefaults(raw, defaults) {
|
|
5828
|
-
const props = shared.isArray(raw) ? raw.reduce(
|
|
5829
|
-
(normalized, p) => (normalized[p] = {}, normalized),
|
|
5830
|
-
{}
|
|
5831
|
-
) : raw;
|
|
5832
|
-
for (const key in defaults) {
|
|
5833
|
-
if (key.startsWith("__skip"))
|
|
5834
|
-
continue;
|
|
5835
|
-
let opt = props[key];
|
|
5836
|
-
if (opt) {
|
|
5837
|
-
if (shared.isArray(opt) || shared.isFunction(opt)) {
|
|
5838
|
-
opt = props[key] = { type: opt, default: defaults[key] };
|
|
5839
|
-
} else {
|
|
5840
|
-
opt.default = defaults[key];
|
|
5841
|
-
}
|
|
5842
|
-
} else if (opt === null) {
|
|
5843
|
-
opt = props[key] = { default: defaults[key] };
|
|
5844
|
-
} else ;
|
|
5845
|
-
if (opt && defaults[`__skip_${key}`]) {
|
|
5846
|
-
opt.skipFactory = true;
|
|
5847
|
-
}
|
|
5848
|
-
}
|
|
5849
|
-
return props;
|
|
5850
|
-
}
|
|
5851
|
-
function createPropsRestProxy(props, excludedKeys) {
|
|
5852
|
-
const ret = {};
|
|
5853
|
-
for (const key in props) {
|
|
5854
|
-
if (!excludedKeys.includes(key)) {
|
|
5855
|
-
Object.defineProperty(ret, key, {
|
|
5856
|
-
enumerable: true,
|
|
5857
|
-
get: () => props[key]
|
|
5858
|
-
});
|
|
5859
|
-
}
|
|
5860
|
-
}
|
|
5861
|
-
return ret;
|
|
5862
|
-
}
|
|
5863
|
-
function withAsyncContext(getAwaitable) {
|
|
5864
|
-
const ctx = getCurrentInstance();
|
|
5865
|
-
let awaitable = getAwaitable();
|
|
5866
|
-
unsetCurrentInstance();
|
|
5867
|
-
if (shared.isPromise(awaitable)) {
|
|
5868
|
-
awaitable = awaitable.catch((e) => {
|
|
5869
|
-
setCurrentInstance(ctx);
|
|
5870
|
-
throw e;
|
|
5871
|
-
});
|
|
5872
|
-
}
|
|
5873
|
-
return [awaitable, () => setCurrentInstance(ctx)];
|
|
5874
|
-
}
|
|
5875
|
-
|
|
5876
5948
|
function h(type, propsOrChildren, children) {
|
|
5877
5949
|
const l = arguments.length;
|
|
5878
5950
|
if (l === 2) {
|
|
@@ -5933,7 +6005,7 @@ function isMemoSame(cached, memo) {
|
|
|
5933
6005
|
return true;
|
|
5934
6006
|
}
|
|
5935
6007
|
|
|
5936
|
-
const version = "3.3.0-
|
|
6008
|
+
const version = "3.3.0-beta.1";
|
|
5937
6009
|
const _ssrUtils = {
|
|
5938
6010
|
createComponentInstance,
|
|
5939
6011
|
setupComponent,
|
|
@@ -6010,6 +6082,7 @@ exports.defineAsyncComponent = defineAsyncComponent;
|
|
|
6010
6082
|
exports.defineComponent = defineComponent;
|
|
6011
6083
|
exports.defineEmits = defineEmits;
|
|
6012
6084
|
exports.defineExpose = defineExpose;
|
|
6085
|
+
exports.defineModel = defineModel;
|
|
6013
6086
|
exports.defineOptions = defineOptions;
|
|
6014
6087
|
exports.defineProps = defineProps;
|
|
6015
6088
|
exports.defineSlots = defineSlots;
|
|
@@ -6018,12 +6091,14 @@ exports.getTransitionRawChildren = getTransitionRawChildren;
|
|
|
6018
6091
|
exports.guardReactiveProps = guardReactiveProps;
|
|
6019
6092
|
exports.h = h;
|
|
6020
6093
|
exports.handleError = handleError;
|
|
6094
|
+
exports.hasInjectionContext = hasInjectionContext;
|
|
6021
6095
|
exports.initCustomFormatter = initCustomFormatter;
|
|
6022
6096
|
exports.inject = inject;
|
|
6023
6097
|
exports.isMemoSame = isMemoSame;
|
|
6024
6098
|
exports.isRuntimeOnly = isRuntimeOnly;
|
|
6025
6099
|
exports.isVNode = isVNode;
|
|
6026
6100
|
exports.mergeDefaults = mergeDefaults;
|
|
6101
|
+
exports.mergeModels = mergeModels;
|
|
6027
6102
|
exports.mergeProps = mergeProps;
|
|
6028
6103
|
exports.nextTick = nextTick;
|
|
6029
6104
|
exports.onActivated = onActivated;
|
|
@@ -6059,6 +6134,7 @@ exports.ssrUtils = ssrUtils;
|
|
|
6059
6134
|
exports.toHandlers = toHandlers;
|
|
6060
6135
|
exports.transformVNodeArgs = transformVNodeArgs;
|
|
6061
6136
|
exports.useAttrs = useAttrs;
|
|
6137
|
+
exports.useModel = useModel;
|
|
6062
6138
|
exports.useSSRContext = useSSRContext;
|
|
6063
6139
|
exports.useSlots = useSlots;
|
|
6064
6140
|
exports.useTransitionState = useTransitionState;
|