@vue/runtime-core 3.4.0-rc.1 → 3.4.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/runtime-core.cjs.js +164 -142
- package/dist/runtime-core.cjs.prod.js +68 -51
- package/dist/runtime-core.d.ts +27 -15
- package/dist/runtime-core.esm-bundler.js +164 -145
- package/package.json +3 -3
package/dist/runtime-core.cjs.js
CHANGED
|
@@ -12,7 +12,7 @@ function pushWarningContext(vnode) {
|
|
|
12
12
|
function popWarningContext() {
|
|
13
13
|
stack.pop();
|
|
14
14
|
}
|
|
15
|
-
function warn(msg, ...args) {
|
|
15
|
+
function warn$1(msg, ...args) {
|
|
16
16
|
reactivity.pauseTracking();
|
|
17
17
|
const instance = stack.length ? stack[stack.length - 1].component : null;
|
|
18
18
|
const appWarnHandler = instance && instance.appContext.config.warnHandler;
|
|
@@ -113,9 +113,9 @@ function assertNumber(val, type) {
|
|
|
113
113
|
if (val === void 0) {
|
|
114
114
|
return;
|
|
115
115
|
} else if (typeof val !== "number") {
|
|
116
|
-
warn(`${type} is not a valid number - got ${JSON.stringify(val)}.`);
|
|
116
|
+
warn$1(`${type} is not a valid number - got ${JSON.stringify(val)}.`);
|
|
117
117
|
} else if (isNaN(val)) {
|
|
118
|
-
warn(`${type} is NaN - the duration expression might be incorrect.`);
|
|
118
|
+
warn$1(`${type} is NaN - the duration expression might be incorrect.`);
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
|
|
@@ -180,7 +180,7 @@ const ErrorTypeStrings$1 = {
|
|
|
180
180
|
[11]: "app warnHandler",
|
|
181
181
|
[12]: "ref function",
|
|
182
182
|
[13]: "async component loader",
|
|
183
|
-
[14]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://
|
|
183
|
+
[14]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://github.com/vuejs/core ."
|
|
184
184
|
};
|
|
185
185
|
function callWithErrorHandling(fn, instance, type, args) {
|
|
186
186
|
let res;
|
|
@@ -243,7 +243,7 @@ function logError(err, type, contextVNode, throwInDev = true) {
|
|
|
243
243
|
if (contextVNode) {
|
|
244
244
|
pushWarningContext(contextVNode);
|
|
245
245
|
}
|
|
246
|
-
warn(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
|
|
246
|
+
warn$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
|
|
247
247
|
if (contextVNode) {
|
|
248
248
|
popWarningContext();
|
|
249
249
|
}
|
|
@@ -541,22 +541,22 @@ function tryWrap(fn) {
|
|
|
541
541
|
};
|
|
542
542
|
}
|
|
543
543
|
|
|
544
|
-
|
|
544
|
+
let devtools$1;
|
|
545
545
|
let buffer = [];
|
|
546
546
|
let devtoolsNotInstalled = false;
|
|
547
547
|
function emit$1(event, ...args) {
|
|
548
|
-
if (
|
|
549
|
-
|
|
548
|
+
if (devtools$1) {
|
|
549
|
+
devtools$1.emit(event, ...args);
|
|
550
550
|
} else if (!devtoolsNotInstalled) {
|
|
551
551
|
buffer.push({ event, args });
|
|
552
552
|
}
|
|
553
553
|
}
|
|
554
|
-
function setDevtoolsHook(hook, target) {
|
|
554
|
+
function setDevtoolsHook$1(hook, target) {
|
|
555
555
|
var _a, _b;
|
|
556
|
-
|
|
557
|
-
if (
|
|
558
|
-
|
|
559
|
-
buffer.forEach(({ event, args }) =>
|
|
556
|
+
devtools$1 = hook;
|
|
557
|
+
if (devtools$1) {
|
|
558
|
+
devtools$1.enabled = true;
|
|
559
|
+
buffer.forEach(({ event, args }) => devtools$1.emit(event, ...args));
|
|
560
560
|
buffer = [];
|
|
561
561
|
} else if (
|
|
562
562
|
// handle late devtools injection - only do this if we are in an actual
|
|
@@ -568,10 +568,10 @@ function setDevtoolsHook(hook, target) {
|
|
|
568
568
|
) {
|
|
569
569
|
const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || [];
|
|
570
570
|
replay.push((newHook) => {
|
|
571
|
-
setDevtoolsHook(newHook, target);
|
|
571
|
+
setDevtoolsHook$1(newHook, target);
|
|
572
572
|
});
|
|
573
573
|
setTimeout(() => {
|
|
574
|
-
if (!
|
|
574
|
+
if (!devtools$1) {
|
|
575
575
|
target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null;
|
|
576
576
|
devtoolsNotInstalled = true;
|
|
577
577
|
buffer = [];
|
|
@@ -601,8 +601,8 @@ const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook(
|
|
|
601
601
|
"component:removed" /* COMPONENT_REMOVED */
|
|
602
602
|
);
|
|
603
603
|
const devtoolsComponentRemoved = (component) => {
|
|
604
|
-
if (
|
|
605
|
-
!
|
|
604
|
+
if (devtools$1 && typeof devtools$1.cleanupBuffer === "function" && // remove the component if it wasn't buffered
|
|
605
|
+
!devtools$1.cleanupBuffer(component)) {
|
|
606
606
|
_devtoolsComponentRemoved(component);
|
|
607
607
|
}
|
|
608
608
|
};
|
|
@@ -650,7 +650,7 @@ function emit(instance, event, ...rawArgs) {
|
|
|
650
650
|
if (emitsOptions) {
|
|
651
651
|
if (!(event in emitsOptions) && true) {
|
|
652
652
|
if (!propsOptions || !(shared.toHandlerKey(event) in propsOptions)) {
|
|
653
|
-
warn(
|
|
653
|
+
warn$1(
|
|
654
654
|
`Component emitted event "${event}" but it is neither declared in the emits option nor as an "${shared.toHandlerKey(event)}" prop.`
|
|
655
655
|
);
|
|
656
656
|
}
|
|
@@ -659,7 +659,7 @@ function emit(instance, event, ...rawArgs) {
|
|
|
659
659
|
if (shared.isFunction(validator)) {
|
|
660
660
|
const isValid = validator(...rawArgs);
|
|
661
661
|
if (!isValid) {
|
|
662
|
-
warn(
|
|
662
|
+
warn$1(
|
|
663
663
|
`Invalid event arguments: event validation failed for event "${event}".`
|
|
664
664
|
);
|
|
665
665
|
}
|
|
@@ -686,11 +686,13 @@ function emit(instance, event, ...rawArgs) {
|
|
|
686
686
|
{
|
|
687
687
|
const lowerCaseEvent = event.toLowerCase();
|
|
688
688
|
if (lowerCaseEvent !== event && props[shared.toHandlerKey(lowerCaseEvent)]) {
|
|
689
|
-
warn(
|
|
689
|
+
warn$1(
|
|
690
690
|
`Event "${lowerCaseEvent}" is emitted in component ${formatComponentName(
|
|
691
691
|
instance,
|
|
692
692
|
instance.type
|
|
693
|
-
)} but the handler is registered for "${event}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${shared.hyphenate(
|
|
693
|
+
)} but the handler is registered for "${event}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${shared.hyphenate(
|
|
694
|
+
event
|
|
695
|
+
)}" instead of "${event}".`
|
|
694
696
|
);
|
|
695
697
|
}
|
|
696
698
|
}
|
|
@@ -854,7 +856,7 @@ function renderComponentRoot(instance) {
|
|
|
854
856
|
const proxyToUse = withProxy || proxy;
|
|
855
857
|
const thisProxy = setupState.__isScriptSetup ? new Proxy(proxyToUse, {
|
|
856
858
|
get(target, key, receiver) {
|
|
857
|
-
warn(
|
|
859
|
+
warn$1(
|
|
858
860
|
`Property '${String(
|
|
859
861
|
key
|
|
860
862
|
)}' was accessed via 'this'. Avoid using 'this' in templates.`
|
|
@@ -935,12 +937,12 @@ function renderComponentRoot(instance) {
|
|
|
935
937
|
}
|
|
936
938
|
}
|
|
937
939
|
if (extraAttrs.length) {
|
|
938
|
-
warn(
|
|
940
|
+
warn$1(
|
|
939
941
|
`Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.`
|
|
940
942
|
);
|
|
941
943
|
}
|
|
942
944
|
if (eventAttrs.length) {
|
|
943
|
-
warn(
|
|
945
|
+
warn$1(
|
|
944
946
|
`Extraneous non-emits event listeners (${eventAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.`
|
|
945
947
|
);
|
|
946
948
|
}
|
|
@@ -949,7 +951,7 @@ function renderComponentRoot(instance) {
|
|
|
949
951
|
}
|
|
950
952
|
if (vnode.dirs) {
|
|
951
953
|
if (!isElementRoot(root)) {
|
|
952
|
-
warn(
|
|
954
|
+
warn$1(
|
|
953
955
|
`Runtime directive used on component with non-element root node. The directives will not function as intended.`
|
|
954
956
|
);
|
|
955
957
|
}
|
|
@@ -958,7 +960,7 @@ function renderComponentRoot(instance) {
|
|
|
958
960
|
}
|
|
959
961
|
if (vnode.transition) {
|
|
960
962
|
if (!isElementRoot(root)) {
|
|
961
|
-
warn(
|
|
963
|
+
warn$1(
|
|
962
964
|
`Component inside <Transition> renders non-element root node that cannot be animated.`
|
|
963
965
|
);
|
|
964
966
|
}
|
|
@@ -1133,7 +1135,6 @@ function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false
|
|
|
1133
1135
|
const selfName = getComponentName(
|
|
1134
1136
|
Component,
|
|
1135
1137
|
false
|
|
1136
|
-
/* do not include inferred name to avoid breaking existing code */
|
|
1137
1138
|
);
|
|
1138
1139
|
if (selfName && (selfName === name || selfName === shared.camelize(name) || selfName === shared.capitalize(shared.camelize(name)))) {
|
|
1139
1140
|
return Component;
|
|
@@ -1151,11 +1152,11 @@ function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false
|
|
|
1151
1152
|
if (warnMissing && !res) {
|
|
1152
1153
|
const extra = type === COMPONENTS ? `
|
|
1153
1154
|
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``;
|
|
1154
|
-
warn(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
|
|
1155
|
+
warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
|
|
1155
1156
|
}
|
|
1156
1157
|
return res;
|
|
1157
1158
|
} else {
|
|
1158
|
-
warn(
|
|
1159
|
+
warn$1(
|
|
1159
1160
|
`resolve${shared.capitalize(type.slice(0, -1))} can only be used in render() or setup().`
|
|
1160
1161
|
);
|
|
1161
1162
|
}
|
|
@@ -1663,6 +1664,7 @@ function hydrateSuspense(node, vnode, parentComponent, parentSuspense, namespace
|
|
|
1663
1664
|
parentSuspense,
|
|
1664
1665
|
parentComponent,
|
|
1665
1666
|
node.parentNode,
|
|
1667
|
+
// eslint-disable-next-line no-restricted-globals
|
|
1666
1668
|
document.createElement("div"),
|
|
1667
1669
|
null,
|
|
1668
1670
|
namespace,
|
|
@@ -1670,7 +1672,6 @@ function hydrateSuspense(node, vnode, parentComponent, parentSuspense, namespace
|
|
|
1670
1672
|
optimized,
|
|
1671
1673
|
rendererInternals,
|
|
1672
1674
|
true
|
|
1673
|
-
/* hydrating */
|
|
1674
1675
|
);
|
|
1675
1676
|
const result = hydrateNode(
|
|
1676
1677
|
node,
|
|
@@ -1711,7 +1712,7 @@ function normalizeSuspenseSlot(s) {
|
|
|
1711
1712
|
if (shared.isArray(s)) {
|
|
1712
1713
|
const singleChild = filterSingleRoot(s);
|
|
1713
1714
|
if (!singleChild && s.filter((child) => child !== NULL_DYNAMIC_COMPONENT).length > 0) {
|
|
1714
|
-
warn(`<Suspense> slots expect a single root node.`);
|
|
1715
|
+
warn$1(`<Suspense> slots expect a single root node.`);
|
|
1715
1716
|
}
|
|
1716
1717
|
s = singleChild;
|
|
1717
1718
|
}
|
|
@@ -1766,13 +1767,20 @@ function watchSyncEffect(effect, options) {
|
|
|
1766
1767
|
const INITIAL_WATCHER_VALUE = {};
|
|
1767
1768
|
function watch(source, cb, options) {
|
|
1768
1769
|
if (!shared.isFunction(cb)) {
|
|
1769
|
-
warn(
|
|
1770
|
+
warn$1(
|
|
1770
1771
|
`\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.`
|
|
1771
1772
|
);
|
|
1772
1773
|
}
|
|
1773
1774
|
return doWatch(source, cb, options);
|
|
1774
1775
|
}
|
|
1775
|
-
function doWatch(source, cb, {
|
|
1776
|
+
function doWatch(source, cb, {
|
|
1777
|
+
immediate,
|
|
1778
|
+
deep,
|
|
1779
|
+
flush,
|
|
1780
|
+
once,
|
|
1781
|
+
onTrack,
|
|
1782
|
+
onTrigger
|
|
1783
|
+
} = shared.EMPTY_OBJ) {
|
|
1776
1784
|
var _a;
|
|
1777
1785
|
if (cb && once) {
|
|
1778
1786
|
const _cb = cb;
|
|
@@ -1783,23 +1791,23 @@ function doWatch(source, cb, { immediate, deep, flush, once, onTrack, onTrigger
|
|
|
1783
1791
|
}
|
|
1784
1792
|
if (!cb) {
|
|
1785
1793
|
if (immediate !== void 0) {
|
|
1786
|
-
warn(
|
|
1794
|
+
warn$1(
|
|
1787
1795
|
`watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`
|
|
1788
1796
|
);
|
|
1789
1797
|
}
|
|
1790
1798
|
if (deep !== void 0) {
|
|
1791
|
-
warn(
|
|
1799
|
+
warn$1(
|
|
1792
1800
|
`watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
|
|
1793
1801
|
);
|
|
1794
1802
|
}
|
|
1795
1803
|
if (once !== void 0) {
|
|
1796
|
-
warn(
|
|
1804
|
+
warn$1(
|
|
1797
1805
|
`watch() "once" option is only respected when using the watch(source, callback, options?) signature.`
|
|
1798
1806
|
);
|
|
1799
1807
|
}
|
|
1800
1808
|
}
|
|
1801
1809
|
const warnInvalidSource = (s) => {
|
|
1802
|
-
warn(
|
|
1810
|
+
warn$1(
|
|
1803
1811
|
`Invalid watch source: `,
|
|
1804
1812
|
s,
|
|
1805
1813
|
`A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`
|
|
@@ -2005,13 +2013,13 @@ function traverse(value, seen) {
|
|
|
2005
2013
|
|
|
2006
2014
|
function validateDirectiveName(name) {
|
|
2007
2015
|
if (shared.isBuiltInDirective(name)) {
|
|
2008
|
-
warn("Do not use built-in directive ids as custom directive id: " + name);
|
|
2016
|
+
warn$1("Do not use built-in directive ids as custom directive id: " + name);
|
|
2009
2017
|
}
|
|
2010
2018
|
}
|
|
2011
2019
|
function withDirectives(vnode, directives) {
|
|
2012
2020
|
const internalInstance = currentRenderingInstance;
|
|
2013
2021
|
if (internalInstance === null) {
|
|
2014
|
-
warn(`withDirectives can only be used inside render functions.`);
|
|
2022
|
+
warn$1(`withDirectives can only be used inside render functions.`);
|
|
2015
2023
|
return vnode;
|
|
2016
2024
|
}
|
|
2017
2025
|
const instance = getExposeProxy(internalInstance) || internalInstance.proxy;
|
|
@@ -2118,7 +2126,7 @@ const BaseTransitionImpl = {
|
|
|
2118
2126
|
for (const c of children) {
|
|
2119
2127
|
if (c.type !== Comment) {
|
|
2120
2128
|
if (hasFound) {
|
|
2121
|
-
warn(
|
|
2129
|
+
warn$1(
|
|
2122
2130
|
"<transition> can only be used on a single element or component. Use <transition-group> for lists."
|
|
2123
2131
|
);
|
|
2124
2132
|
break;
|
|
@@ -2131,7 +2139,7 @@ const BaseTransitionImpl = {
|
|
|
2131
2139
|
const rawProps = reactivity.toRaw(props);
|
|
2132
2140
|
const { mode } = rawProps;
|
|
2133
2141
|
if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") {
|
|
2134
|
-
warn(`invalid <transition> mode: ${mode}`);
|
|
2142
|
+
warn$1(`invalid <transition> mode: ${mode}`);
|
|
2135
2143
|
}
|
|
2136
2144
|
if (state.isLeaving) {
|
|
2137
2145
|
return emptyPlaceholder(child);
|
|
@@ -2446,7 +2454,7 @@ function defineAsyncComponent(source) {
|
|
|
2446
2454
|
return pendingRequest;
|
|
2447
2455
|
}
|
|
2448
2456
|
if (!comp) {
|
|
2449
|
-
warn(
|
|
2457
|
+
warn$1(
|
|
2450
2458
|
`Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.`
|
|
2451
2459
|
);
|
|
2452
2460
|
}
|
|
@@ -2478,7 +2486,6 @@ function defineAsyncComponent(source) {
|
|
|
2478
2486
|
instance,
|
|
2479
2487
|
13,
|
|
2480
2488
|
!errorComponent
|
|
2481
|
-
/* do not throw in dev if user provided error component */
|
|
2482
2489
|
);
|
|
2483
2490
|
};
|
|
2484
2491
|
if (suspensible && instance.suspense || isInSSRComponentSetup) {
|
|
@@ -2686,7 +2693,7 @@ const KeepAliveImpl = {
|
|
|
2686
2693
|
const rawVNode = children[0];
|
|
2687
2694
|
if (children.length > 1) {
|
|
2688
2695
|
{
|
|
2689
|
-
warn(`KeepAlive should contain exactly one component child.`);
|
|
2696
|
+
warn$1(`KeepAlive should contain exactly one component child.`);
|
|
2690
2697
|
}
|
|
2691
2698
|
current = null;
|
|
2692
2699
|
return children;
|
|
@@ -2815,7 +2822,7 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
|
2815
2822
|
return wrappedHook;
|
|
2816
2823
|
} else {
|
|
2817
2824
|
const apiName = shared.toHandlerKey(ErrorTypeStrings$1[type].replace(/ hook$/, ""));
|
|
2818
|
-
warn(
|
|
2825
|
+
warn$1(
|
|
2819
2826
|
`${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup().` + (` If you are using async setup(), make sure to register lifecycle hooks before the first await statement.` )
|
|
2820
2827
|
);
|
|
2821
2828
|
}
|
|
@@ -2851,7 +2858,7 @@ function renderList(source, renderItem, cache, index) {
|
|
|
2851
2858
|
}
|
|
2852
2859
|
} else if (typeof source === "number") {
|
|
2853
2860
|
if (!Number.isInteger(source)) {
|
|
2854
|
-
warn(`The v-for range expect an integer value but got ${source}.`);
|
|
2861
|
+
warn$1(`The v-for range expect an integer value but got ${source}.`);
|
|
2855
2862
|
}
|
|
2856
2863
|
ret = new Array(source);
|
|
2857
2864
|
for (let i = 0; i < source; i++) {
|
|
@@ -2907,7 +2914,7 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
|
2907
2914
|
}
|
|
2908
2915
|
let slot = slots[name];
|
|
2909
2916
|
if (slot && slot.length > 1) {
|
|
2910
|
-
warn(
|
|
2917
|
+
warn$1(
|
|
2911
2918
|
`SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template.`
|
|
2912
2919
|
);
|
|
2913
2920
|
slot = () => [];
|
|
@@ -2950,7 +2957,7 @@ function ensureValidVNode(vnodes) {
|
|
|
2950
2957
|
function toHandlers(obj, preserveCaseIfNecessary) {
|
|
2951
2958
|
const ret = {};
|
|
2952
2959
|
if (!shared.isObject(obj)) {
|
|
2953
|
-
warn(`v-on with no argument expects an object value.`);
|
|
2960
|
+
warn$1(`v-on with no argument expects an object value.`);
|
|
2954
2961
|
return ret;
|
|
2955
2962
|
}
|
|
2956
2963
|
for (const key in obj) {
|
|
@@ -3060,13 +3067,13 @@ const PublicInstanceProxyHandlers = {
|
|
|
3060
3067
|
// to infinite warning loop
|
|
3061
3068
|
key.indexOf("__v") !== 0)) {
|
|
3062
3069
|
if (data !== shared.EMPTY_OBJ && isReservedPrefix(key[0]) && shared.hasOwn(data, key)) {
|
|
3063
|
-
warn(
|
|
3070
|
+
warn$1(
|
|
3064
3071
|
`Property ${JSON.stringify(
|
|
3065
3072
|
key
|
|
3066
3073
|
)} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`
|
|
3067
3074
|
);
|
|
3068
3075
|
} else if (instance === currentRenderingInstance) {
|
|
3069
|
-
warn(
|
|
3076
|
+
warn$1(
|
|
3070
3077
|
`Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.`
|
|
3071
3078
|
);
|
|
3072
3079
|
}
|
|
@@ -3078,17 +3085,17 @@ const PublicInstanceProxyHandlers = {
|
|
|
3078
3085
|
setupState[key] = value;
|
|
3079
3086
|
return true;
|
|
3080
3087
|
} else if (setupState.__isScriptSetup && shared.hasOwn(setupState, key)) {
|
|
3081
|
-
warn(`Cannot mutate <script setup> binding "${key}" from Options API.`);
|
|
3088
|
+
warn$1(`Cannot mutate <script setup> binding "${key}" from Options API.`);
|
|
3082
3089
|
return false;
|
|
3083
3090
|
} else if (data !== shared.EMPTY_OBJ && shared.hasOwn(data, key)) {
|
|
3084
3091
|
data[key] = value;
|
|
3085
3092
|
return true;
|
|
3086
3093
|
} else if (shared.hasOwn(instance.props, key)) {
|
|
3087
|
-
warn(`Attempting to mutate prop "${key}". Props are readonly.`);
|
|
3094
|
+
warn$1(`Attempting to mutate prop "${key}". Props are readonly.`);
|
|
3088
3095
|
return false;
|
|
3089
3096
|
}
|
|
3090
3097
|
if (key[0] === "$" && key.slice(1) in instance) {
|
|
3091
|
-
warn(
|
|
3098
|
+
warn$1(
|
|
3092
3099
|
`Attempting to mutate public property "${key}". Properties starting with $ are reserved and readonly.`
|
|
3093
3100
|
);
|
|
3094
3101
|
return false;
|
|
@@ -3122,7 +3129,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
3122
3129
|
};
|
|
3123
3130
|
{
|
|
3124
3131
|
PublicInstanceProxyHandlers.ownKeys = (target) => {
|
|
3125
|
-
warn(
|
|
3132
|
+
warn$1(
|
|
3126
3133
|
`Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.`
|
|
3127
3134
|
);
|
|
3128
3135
|
return Reflect.ownKeys(target);
|
|
@@ -3141,7 +3148,7 @@ const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ shared.extend
|
|
|
3141
3148
|
has(_, key) {
|
|
3142
3149
|
const has = key[0] !== "_" && !shared.isGloballyAllowed(key);
|
|
3143
3150
|
if (!has && PublicInstanceProxyHandlers.has(_, key)) {
|
|
3144
|
-
warn(
|
|
3151
|
+
warn$1(
|
|
3145
3152
|
`Property ${JSON.stringify(
|
|
3146
3153
|
key
|
|
3147
3154
|
)} should not start with _ which is a reserved prefix for Vue internals.`
|
|
@@ -3191,7 +3198,7 @@ function exposeSetupStateOnRenderContext(instance) {
|
|
|
3191
3198
|
Object.keys(reactivity.toRaw(setupState)).forEach((key) => {
|
|
3192
3199
|
if (!setupState.__isScriptSetup) {
|
|
3193
3200
|
if (isReservedPrefix(key[0])) {
|
|
3194
|
-
warn(
|
|
3201
|
+
warn$1(
|
|
3195
3202
|
`setup() return property ${JSON.stringify(
|
|
3196
3203
|
key
|
|
3197
3204
|
)} should not start with "$" or "_" which are reserved prefixes for Vue internals.`
|
|
@@ -3208,7 +3215,7 @@ function exposeSetupStateOnRenderContext(instance) {
|
|
|
3208
3215
|
});
|
|
3209
3216
|
}
|
|
3210
3217
|
|
|
3211
|
-
const warnRuntimeUsage = (method) => warn(
|
|
3218
|
+
const warnRuntimeUsage = (method) => warn$1(
|
|
3212
3219
|
`${method}() is a compiler-hint helper that is only usable inside <script setup> of a single file component. Its arguments should be compiled away and passing it at runtime has no effect.`
|
|
3213
3220
|
);
|
|
3214
3221
|
function defineProps() {
|
|
@@ -3256,17 +3263,17 @@ function useSlots() {
|
|
|
3256
3263
|
function useAttrs() {
|
|
3257
3264
|
return getContext().attrs;
|
|
3258
3265
|
}
|
|
3259
|
-
function useModel(props, name) {
|
|
3266
|
+
function useModel(props, name, options = shared.EMPTY_OBJ) {
|
|
3260
3267
|
const i = getCurrentInstance();
|
|
3261
3268
|
if (!i) {
|
|
3262
|
-
warn(`useModel() called without active instance.`);
|
|
3269
|
+
warn$1(`useModel() called without active instance.`);
|
|
3263
3270
|
return reactivity.ref();
|
|
3264
3271
|
}
|
|
3265
3272
|
if (!i.propsOptions[0][name]) {
|
|
3266
|
-
warn(`useModel() called with prop "${name}" which is not declared.`);
|
|
3273
|
+
warn$1(`useModel() called with prop "${name}" which is not declared.`);
|
|
3267
3274
|
return reactivity.ref();
|
|
3268
3275
|
}
|
|
3269
|
-
|
|
3276
|
+
const res = reactivity.customRef((track, trigger) => {
|
|
3270
3277
|
let localValue;
|
|
3271
3278
|
watchSyncEffect(() => {
|
|
3272
3279
|
const propValue = props[name];
|
|
@@ -3278,7 +3285,7 @@ function useModel(props, name) {
|
|
|
3278
3285
|
return {
|
|
3279
3286
|
get() {
|
|
3280
3287
|
track();
|
|
3281
|
-
return localValue;
|
|
3288
|
+
return options.get ? options.get(localValue) : localValue;
|
|
3282
3289
|
},
|
|
3283
3290
|
set(value) {
|
|
3284
3291
|
const rawProps = i.vnode.props;
|
|
@@ -3286,15 +3293,29 @@ function useModel(props, name) {
|
|
|
3286
3293
|
localValue = value;
|
|
3287
3294
|
trigger();
|
|
3288
3295
|
}
|
|
3289
|
-
i.emit(`update:${name}`, value);
|
|
3296
|
+
i.emit(`update:${name}`, options.set ? options.set(value) : value);
|
|
3290
3297
|
}
|
|
3291
3298
|
};
|
|
3292
3299
|
});
|
|
3300
|
+
const modifierKey = name === "modelValue" ? "modelModifiers" : `${name}Modifiers`;
|
|
3301
|
+
res[Symbol.iterator] = () => {
|
|
3302
|
+
let i2 = 0;
|
|
3303
|
+
return {
|
|
3304
|
+
next() {
|
|
3305
|
+
if (i2 < 2) {
|
|
3306
|
+
return { value: i2++ ? props[modifierKey] : res, done: false };
|
|
3307
|
+
} else {
|
|
3308
|
+
return { done: true };
|
|
3309
|
+
}
|
|
3310
|
+
}
|
|
3311
|
+
};
|
|
3312
|
+
};
|
|
3313
|
+
return res;
|
|
3293
3314
|
}
|
|
3294
3315
|
function getContext() {
|
|
3295
3316
|
const i = getCurrentInstance();
|
|
3296
3317
|
if (!i) {
|
|
3297
|
-
warn(`useContext() called without active instance.`);
|
|
3318
|
+
warn$1(`useContext() called without active instance.`);
|
|
3298
3319
|
}
|
|
3299
3320
|
return i.setupContext || (i.setupContext = createSetupContext(i));
|
|
3300
3321
|
}
|
|
@@ -3319,7 +3340,7 @@ function mergeDefaults(raw, defaults) {
|
|
|
3319
3340
|
} else if (opt === null) {
|
|
3320
3341
|
opt = props[key] = { default: defaults[key] };
|
|
3321
3342
|
} else {
|
|
3322
|
-
warn(`props default key "${key}" has no corresponding declaration.`);
|
|
3343
|
+
warn$1(`props default key "${key}" has no corresponding declaration.`);
|
|
3323
3344
|
}
|
|
3324
3345
|
if (opt && defaults[`__skip_${key}`]) {
|
|
3325
3346
|
opt.skipFactory = true;
|
|
@@ -3349,7 +3370,7 @@ function createPropsRestProxy(props, excludedKeys) {
|
|
|
3349
3370
|
function withAsyncContext(getAwaitable) {
|
|
3350
3371
|
const ctx = getCurrentInstance();
|
|
3351
3372
|
if (!ctx) {
|
|
3352
|
-
warn(
|
|
3373
|
+
warn$1(
|
|
3353
3374
|
`withAsyncContext called without active current instance. This is likely a bug.`
|
|
3354
3375
|
);
|
|
3355
3376
|
}
|
|
@@ -3368,7 +3389,7 @@ function createDuplicateChecker() {
|
|
|
3368
3389
|
const cache = /* @__PURE__ */ Object.create(null);
|
|
3369
3390
|
return (type, key) => {
|
|
3370
3391
|
if (cache[key]) {
|
|
3371
|
-
warn(`${type} property "${key}" is already defined in ${cache[key]}.`);
|
|
3392
|
+
warn$1(`${type} property "${key}" is already defined in ${cache[key]}.`);
|
|
3372
3393
|
} else {
|
|
3373
3394
|
cache[key] = type;
|
|
3374
3395
|
}
|
|
@@ -3444,7 +3465,7 @@ function applyOptions(instance) {
|
|
|
3444
3465
|
checkDuplicateProperties("Methods" /* METHODS */, key);
|
|
3445
3466
|
}
|
|
3446
3467
|
} else {
|
|
3447
|
-
warn(
|
|
3468
|
+
warn$1(
|
|
3448
3469
|
`Method "${key}" has type "${typeof methodHandler}" in the component definition. Did you reference the function correctly?`
|
|
3449
3470
|
);
|
|
3450
3471
|
}
|
|
@@ -3452,18 +3473,18 @@ function applyOptions(instance) {
|
|
|
3452
3473
|
}
|
|
3453
3474
|
if (dataOptions) {
|
|
3454
3475
|
if (!shared.isFunction(dataOptions)) {
|
|
3455
|
-
warn(
|
|
3476
|
+
warn$1(
|
|
3456
3477
|
`The data option must be a function. Plain object usage is no longer supported.`
|
|
3457
3478
|
);
|
|
3458
3479
|
}
|
|
3459
3480
|
const data = dataOptions.call(publicThis, publicThis);
|
|
3460
3481
|
if (shared.isPromise(data)) {
|
|
3461
|
-
warn(
|
|
3482
|
+
warn$1(
|
|
3462
3483
|
`data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>.`
|
|
3463
3484
|
);
|
|
3464
3485
|
}
|
|
3465
3486
|
if (!shared.isObject(data)) {
|
|
3466
|
-
warn(`data() should return an object.`);
|
|
3487
|
+
warn$1(`data() should return an object.`);
|
|
3467
3488
|
} else {
|
|
3468
3489
|
instance.data = reactivity.reactive(data);
|
|
3469
3490
|
{
|
|
@@ -3487,10 +3508,10 @@ function applyOptions(instance) {
|
|
|
3487
3508
|
const opt = computedOptions[key];
|
|
3488
3509
|
const get = shared.isFunction(opt) ? opt.bind(publicThis, publicThis) : shared.isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : shared.NOOP;
|
|
3489
3510
|
if (get === shared.NOOP) {
|
|
3490
|
-
warn(`Computed property "${key}" has no getter.`);
|
|
3511
|
+
warn$1(`Computed property "${key}" has no getter.`);
|
|
3491
3512
|
}
|
|
3492
3513
|
const set = !shared.isFunction(opt) && shared.isFunction(opt.set) ? opt.set.bind(publicThis) : () => {
|
|
3493
|
-
warn(
|
|
3514
|
+
warn$1(
|
|
3494
3515
|
`Write operation failed: computed property "${key}" is readonly.`
|
|
3495
3516
|
);
|
|
3496
3517
|
} ;
|
|
@@ -3579,7 +3600,6 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = shared
|
|
|
3579
3600
|
opt.from || key,
|
|
3580
3601
|
opt.default,
|
|
3581
3602
|
true
|
|
3582
|
-
/* treat default function as factory */
|
|
3583
3603
|
);
|
|
3584
3604
|
} else {
|
|
3585
3605
|
injected = inject(opt.from || key);
|
|
@@ -3616,7 +3636,7 @@ function createWatcher(raw, ctx, publicThis, key) {
|
|
|
3616
3636
|
if (shared.isFunction(handler)) {
|
|
3617
3637
|
watch(getter, handler);
|
|
3618
3638
|
} else {
|
|
3619
|
-
warn(`Invalid watch handler specified by key "${raw}"`, handler);
|
|
3639
|
+
warn$1(`Invalid watch handler specified by key "${raw}"`, handler);
|
|
3620
3640
|
}
|
|
3621
3641
|
} else if (shared.isFunction(raw)) {
|
|
3622
3642
|
watch(getter, raw.bind(publicThis));
|
|
@@ -3628,11 +3648,11 @@ function createWatcher(raw, ctx, publicThis, key) {
|
|
|
3628
3648
|
if (shared.isFunction(handler)) {
|
|
3629
3649
|
watch(getter, handler, raw);
|
|
3630
3650
|
} else {
|
|
3631
|
-
warn(`Invalid watch handler specified by key "${raw.handler}"`, handler);
|
|
3651
|
+
warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler);
|
|
3632
3652
|
}
|
|
3633
3653
|
}
|
|
3634
3654
|
} else {
|
|
3635
|
-
warn(`Invalid watch option: "${key}"`, raw);
|
|
3655
|
+
warn$1(`Invalid watch option: "${key}"`, raw);
|
|
3636
3656
|
}
|
|
3637
3657
|
}
|
|
3638
3658
|
function resolveMergedOptions(instance) {
|
|
@@ -3677,7 +3697,7 @@ function mergeOptions(to, from, strats, asMixin = false) {
|
|
|
3677
3697
|
}
|
|
3678
3698
|
for (const key in from) {
|
|
3679
3699
|
if (asMixin && key === "expose") {
|
|
3680
|
-
warn(
|
|
3700
|
+
warn$1(
|
|
3681
3701
|
`"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.`
|
|
3682
3702
|
);
|
|
3683
3703
|
} else {
|
|
@@ -3805,7 +3825,7 @@ function createAppAPI(render, hydrate) {
|
|
|
3805
3825
|
rootComponent = shared.extend({}, rootComponent);
|
|
3806
3826
|
}
|
|
3807
3827
|
if (rootProps != null && !shared.isObject(rootProps)) {
|
|
3808
|
-
warn(`root props passed to app.mount() must be an object.`);
|
|
3828
|
+
warn$1(`root props passed to app.mount() must be an object.`);
|
|
3809
3829
|
rootProps = null;
|
|
3810
3830
|
}
|
|
3811
3831
|
const context = createAppContext();
|
|
@@ -3824,14 +3844,14 @@ function createAppAPI(render, hydrate) {
|
|
|
3824
3844
|
},
|
|
3825
3845
|
set config(v) {
|
|
3826
3846
|
{
|
|
3827
|
-
warn(
|
|
3847
|
+
warn$1(
|
|
3828
3848
|
`app.config cannot be replaced. Modify individual options instead.`
|
|
3829
3849
|
);
|
|
3830
3850
|
}
|
|
3831
3851
|
},
|
|
3832
3852
|
use(plugin, ...options) {
|
|
3833
3853
|
if (installedPlugins.has(plugin)) {
|
|
3834
|
-
warn(`Plugin has already been applied to target app.`);
|
|
3854
|
+
warn$1(`Plugin has already been applied to target app.`);
|
|
3835
3855
|
} else if (plugin && shared.isFunction(plugin.install)) {
|
|
3836
3856
|
installedPlugins.add(plugin);
|
|
3837
3857
|
plugin.install(app, ...options);
|
|
@@ -3839,7 +3859,7 @@ function createAppAPI(render, hydrate) {
|
|
|
3839
3859
|
installedPlugins.add(plugin);
|
|
3840
3860
|
plugin(app, ...options);
|
|
3841
3861
|
} else {
|
|
3842
|
-
warn(
|
|
3862
|
+
warn$1(
|
|
3843
3863
|
`A plugin must either be a function or an object with an "install" function.`
|
|
3844
3864
|
);
|
|
3845
3865
|
}
|
|
@@ -3850,7 +3870,7 @@ function createAppAPI(render, hydrate) {
|
|
|
3850
3870
|
if (!context.mixins.includes(mixin)) {
|
|
3851
3871
|
context.mixins.push(mixin);
|
|
3852
3872
|
} else {
|
|
3853
|
-
warn(
|
|
3873
|
+
warn$1(
|
|
3854
3874
|
"Mixin has already been applied to target app" + (mixin.name ? `: ${mixin.name}` : "")
|
|
3855
3875
|
);
|
|
3856
3876
|
}
|
|
@@ -3865,7 +3885,7 @@ function createAppAPI(render, hydrate) {
|
|
|
3865
3885
|
return context.components[name];
|
|
3866
3886
|
}
|
|
3867
3887
|
if (context.components[name]) {
|
|
3868
|
-
warn(`Component "${name}" has already been registered in target app.`);
|
|
3888
|
+
warn$1(`Component "${name}" has already been registered in target app.`);
|
|
3869
3889
|
}
|
|
3870
3890
|
context.components[name] = component;
|
|
3871
3891
|
return app;
|
|
@@ -3878,7 +3898,7 @@ function createAppAPI(render, hydrate) {
|
|
|
3878
3898
|
return context.directives[name];
|
|
3879
3899
|
}
|
|
3880
3900
|
if (context.directives[name]) {
|
|
3881
|
-
warn(`Directive "${name}" has already been registered in target app.`);
|
|
3901
|
+
warn$1(`Directive "${name}" has already been registered in target app.`);
|
|
3882
3902
|
}
|
|
3883
3903
|
context.directives[name] = directive;
|
|
3884
3904
|
return app;
|
|
@@ -3886,7 +3906,7 @@ function createAppAPI(render, hydrate) {
|
|
|
3886
3906
|
mount(rootContainer, isHydrate, namespace) {
|
|
3887
3907
|
if (!isMounted) {
|
|
3888
3908
|
if (rootContainer.__vue_app__) {
|
|
3889
|
-
warn(
|
|
3909
|
+
warn$1(
|
|
3890
3910
|
`There is already an app instance mounted on the host container.
|
|
3891
3911
|
If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.`
|
|
3892
3912
|
);
|
|
@@ -3921,7 +3941,7 @@ function createAppAPI(render, hydrate) {
|
|
|
3921
3941
|
}
|
|
3922
3942
|
return getExposeProxy(vnode.component) || vnode.component.proxy;
|
|
3923
3943
|
} else {
|
|
3924
|
-
warn(
|
|
3944
|
+
warn$1(
|
|
3925
3945
|
`App has already been mounted.
|
|
3926
3946
|
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)\``
|
|
3927
3947
|
);
|
|
@@ -3936,12 +3956,12 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
3936
3956
|
}
|
|
3937
3957
|
delete app._container.__vue_app__;
|
|
3938
3958
|
} else {
|
|
3939
|
-
warn(`Cannot unmount an app that is not mounted.`);
|
|
3959
|
+
warn$1(`Cannot unmount an app that is not mounted.`);
|
|
3940
3960
|
}
|
|
3941
3961
|
},
|
|
3942
3962
|
provide(key, value) {
|
|
3943
3963
|
if (key in context.provides) {
|
|
3944
|
-
warn(
|
|
3964
|
+
warn$1(
|
|
3945
3965
|
`App already provides property with key "${String(key)}". It will be overwritten with the new value.`
|
|
3946
3966
|
);
|
|
3947
3967
|
}
|
|
@@ -3965,7 +3985,7 @@ let currentApp = null;
|
|
|
3965
3985
|
function provide(key, value) {
|
|
3966
3986
|
if (!currentInstance) {
|
|
3967
3987
|
{
|
|
3968
|
-
warn(`provide() can only be used inside setup().`);
|
|
3988
|
+
warn$1(`provide() can only be used inside setup().`);
|
|
3969
3989
|
}
|
|
3970
3990
|
} else {
|
|
3971
3991
|
let provides = currentInstance.provides;
|
|
@@ -3985,10 +4005,10 @@ function inject(key, defaultValue, treatDefaultAsFactory = false) {
|
|
|
3985
4005
|
} else if (arguments.length > 1) {
|
|
3986
4006
|
return treatDefaultAsFactory && shared.isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
|
|
3987
4007
|
} else {
|
|
3988
|
-
warn(`injection "${String(key)}" not found.`);
|
|
4008
|
+
warn$1(`injection "${String(key)}" not found.`);
|
|
3989
4009
|
}
|
|
3990
4010
|
} else {
|
|
3991
|
-
warn(`inject() can only be used inside setup() or functional components.`);
|
|
4011
|
+
warn$1(`inject() can only be used inside setup() or functional components.`);
|
|
3992
4012
|
}
|
|
3993
4013
|
}
|
|
3994
4014
|
function hasInjectionContext() {
|
|
@@ -4065,7 +4085,6 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
4065
4085
|
value,
|
|
4066
4086
|
instance,
|
|
4067
4087
|
false
|
|
4068
|
-
/* isAbsent */
|
|
4069
4088
|
);
|
|
4070
4089
|
}
|
|
4071
4090
|
} else {
|
|
@@ -4097,7 +4116,6 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
4097
4116
|
void 0,
|
|
4098
4117
|
instance,
|
|
4099
4118
|
true
|
|
4100
|
-
/* isAbsent */
|
|
4101
4119
|
);
|
|
4102
4120
|
}
|
|
4103
4121
|
} else {
|
|
@@ -4232,7 +4250,7 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
|
|
|
4232
4250
|
if (shared.isArray(raw)) {
|
|
4233
4251
|
for (let i = 0; i < raw.length; i++) {
|
|
4234
4252
|
if (!shared.isString(raw[i])) {
|
|
4235
|
-
warn(`props must be strings when using array syntax.`, raw[i]);
|
|
4253
|
+
warn$1(`props must be strings when using array syntax.`, raw[i]);
|
|
4236
4254
|
}
|
|
4237
4255
|
const normalizedKey = shared.camelize(raw[i]);
|
|
4238
4256
|
if (validatePropName(normalizedKey)) {
|
|
@@ -4241,7 +4259,7 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
|
|
|
4241
4259
|
}
|
|
4242
4260
|
} else if (raw) {
|
|
4243
4261
|
if (!shared.isObject(raw)) {
|
|
4244
|
-
warn(`invalid props options`, raw);
|
|
4262
|
+
warn$1(`invalid props options`, raw);
|
|
4245
4263
|
}
|
|
4246
4264
|
for (const key in raw) {
|
|
4247
4265
|
const normalizedKey = shared.camelize(key);
|
|
@@ -4270,7 +4288,7 @@ function validatePropName(key) {
|
|
|
4270
4288
|
if (key[0] !== "$") {
|
|
4271
4289
|
return true;
|
|
4272
4290
|
} else {
|
|
4273
|
-
warn(`Invalid prop name: "${key}" is a reserved property.`);
|
|
4291
|
+
warn$1(`Invalid prop name: "${key}" is a reserved property.`);
|
|
4274
4292
|
}
|
|
4275
4293
|
return false;
|
|
4276
4294
|
}
|
|
@@ -4308,7 +4326,7 @@ function validateProps(rawProps, props, instance) {
|
|
|
4308
4326
|
function validateProp(name, value, prop, props, isAbsent) {
|
|
4309
4327
|
const { type, required, validator, skipCheck } = prop;
|
|
4310
4328
|
if (required && isAbsent) {
|
|
4311
|
-
warn('Missing required prop: "' + name + '"');
|
|
4329
|
+
warn$1('Missing required prop: "' + name + '"');
|
|
4312
4330
|
return;
|
|
4313
4331
|
}
|
|
4314
4332
|
if (value == null && !required) {
|
|
@@ -4324,12 +4342,12 @@ function validateProp(name, value, prop, props, isAbsent) {
|
|
|
4324
4342
|
isValid = valid;
|
|
4325
4343
|
}
|
|
4326
4344
|
if (!isValid) {
|
|
4327
|
-
warn(getInvalidTypeMessage(name, value, expectedTypes));
|
|
4345
|
+
warn$1(getInvalidTypeMessage(name, value, expectedTypes));
|
|
4328
4346
|
return;
|
|
4329
4347
|
}
|
|
4330
4348
|
}
|
|
4331
4349
|
if (validator && !validator(value, props)) {
|
|
4332
|
-
warn('Invalid prop: custom validator check failed for prop "' + name + '".');
|
|
4350
|
+
warn$1('Invalid prop: custom validator check failed for prop "' + name + '".');
|
|
4333
4351
|
}
|
|
4334
4352
|
}
|
|
4335
4353
|
const isSimpleType = /* @__PURE__ */ shared.makeMap(
|
|
@@ -4401,7 +4419,7 @@ const normalizeSlot = (key, rawSlot, ctx) => {
|
|
|
4401
4419
|
}
|
|
4402
4420
|
const normalized = withCtx((...args) => {
|
|
4403
4421
|
if (currentInstance) {
|
|
4404
|
-
warn(
|
|
4422
|
+
warn$1(
|
|
4405
4423
|
`Slot "${key}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.`
|
|
4406
4424
|
);
|
|
4407
4425
|
}
|
|
@@ -4420,7 +4438,7 @@ const normalizeObjectSlots = (rawSlots, slots, instance) => {
|
|
|
4420
4438
|
slots[key] = normalizeSlot(key, value, ctx);
|
|
4421
4439
|
} else if (value != null) {
|
|
4422
4440
|
{
|
|
4423
|
-
warn(
|
|
4441
|
+
warn$1(
|
|
4424
4442
|
`Non-function value encountered for slot "${key}". Prefer function slots for better performance.`
|
|
4425
4443
|
);
|
|
4426
4444
|
}
|
|
@@ -4431,7 +4449,7 @@ const normalizeObjectSlots = (rawSlots, slots, instance) => {
|
|
|
4431
4449
|
};
|
|
4432
4450
|
const normalizeVNodeSlots = (instance, children) => {
|
|
4433
4451
|
if (!isKeepAlive(instance.vnode) && true) {
|
|
4434
|
-
warn(
|
|
4452
|
+
warn$1(
|
|
4435
4453
|
`Non-function value encountered for default slot. Prefer function slots for better performance.`
|
|
4436
4454
|
);
|
|
4437
4455
|
}
|
|
@@ -4513,7 +4531,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
4513
4531
|
const value = isUnmount ? null : refValue;
|
|
4514
4532
|
const { i: owner, r: ref } = rawRef;
|
|
4515
4533
|
if (!owner) {
|
|
4516
|
-
warn(
|
|
4534
|
+
warn$1(
|
|
4517
4535
|
`Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.`
|
|
4518
4536
|
);
|
|
4519
4537
|
return;
|
|
@@ -4568,7 +4586,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
4568
4586
|
if (rawRef.k)
|
|
4569
4587
|
refs[rawRef.k] = value;
|
|
4570
4588
|
} else {
|
|
4571
|
-
warn("Invalid template ref type:", ref, `(${typeof ref})`);
|
|
4589
|
+
warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
|
|
4572
4590
|
}
|
|
4573
4591
|
};
|
|
4574
4592
|
if (value) {
|
|
@@ -4578,7 +4596,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
4578
4596
|
doSet();
|
|
4579
4597
|
}
|
|
4580
4598
|
} else {
|
|
4581
|
-
warn("Invalid template ref type:", ref, `(${typeof ref})`);
|
|
4599
|
+
warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
|
|
4582
4600
|
}
|
|
4583
4601
|
}
|
|
4584
4602
|
}
|
|
@@ -4610,7 +4628,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4610
4628
|
} = rendererInternals;
|
|
4611
4629
|
const hydrate = (vnode, container) => {
|
|
4612
4630
|
if (!container.hasChildNodes()) {
|
|
4613
|
-
warn(
|
|
4631
|
+
warn$1(
|
|
4614
4632
|
`Attempting to hydrate existing markup but container is empty. Performing full mount instead.`
|
|
4615
4633
|
);
|
|
4616
4634
|
patch(null, vnode, container);
|
|
@@ -4670,7 +4688,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4670
4688
|
} else {
|
|
4671
4689
|
if (node.data !== vnode.children) {
|
|
4672
4690
|
hasMismatch = true;
|
|
4673
|
-
warn(
|
|
4691
|
+
warn$1(
|
|
4674
4692
|
`Hydration text mismatch in`,
|
|
4675
4693
|
node.parentNode,
|
|
4676
4694
|
`
|
|
@@ -4805,7 +4823,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4805
4823
|
hydrateNode
|
|
4806
4824
|
);
|
|
4807
4825
|
} else {
|
|
4808
|
-
warn("Invalid HostVNode type:", type, `(${typeof type})`);
|
|
4826
|
+
warn$1("Invalid HostVNode type:", type, `(${typeof type})`);
|
|
4809
4827
|
}
|
|
4810
4828
|
}
|
|
4811
4829
|
if (ref != null) {
|
|
@@ -4846,7 +4864,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4846
4864
|
while (next) {
|
|
4847
4865
|
hasMismatch = true;
|
|
4848
4866
|
if (!hasWarned) {
|
|
4849
|
-
warn(
|
|
4867
|
+
warn$1(
|
|
4850
4868
|
`Hydration children mismatch on`,
|
|
4851
4869
|
el,
|
|
4852
4870
|
`
|
|
@@ -4861,7 +4879,7 @@ Server rendered element contains more child nodes than client vdom.`
|
|
|
4861
4879
|
} else if (shapeFlag & 8) {
|
|
4862
4880
|
if (el.textContent !== vnode.children) {
|
|
4863
4881
|
hasMismatch = true;
|
|
4864
|
-
warn(
|
|
4882
|
+
warn$1(
|
|
4865
4883
|
`Hydration text content mismatch on`,
|
|
4866
4884
|
el,
|
|
4867
4885
|
`
|
|
@@ -4930,7 +4948,7 @@ Server rendered element contains more child nodes than client vdom.`
|
|
|
4930
4948
|
} else {
|
|
4931
4949
|
hasMismatch = true;
|
|
4932
4950
|
if (!hasWarned) {
|
|
4933
|
-
warn(
|
|
4951
|
+
warn$1(
|
|
4934
4952
|
`Hydration children mismatch on`,
|
|
4935
4953
|
container,
|
|
4936
4954
|
`
|
|
@@ -4977,7 +4995,7 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
4977
4995
|
};
|
|
4978
4996
|
const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
|
|
4979
4997
|
hasMismatch = true;
|
|
4980
|
-
warn(
|
|
4998
|
+
warn$1(
|
|
4981
4999
|
`Hydration node mismatch:
|
|
4982
5000
|
- rendered on server:`,
|
|
4983
5001
|
node,
|
|
@@ -5076,7 +5094,7 @@ function propHasMismatch(el, key, clientValue) {
|
|
|
5076
5094
|
}
|
|
5077
5095
|
if (mismatchType) {
|
|
5078
5096
|
const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
|
|
5079
|
-
warn(
|
|
5097
|
+
warn$1(
|
|
5080
5098
|
`Hydration ${mismatchType} mismatch on`,
|
|
5081
5099
|
el,
|
|
5082
5100
|
`
|
|
@@ -5155,7 +5173,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5155
5173
|
const target = shared.getGlobalThis();
|
|
5156
5174
|
target.__VUE__ = true;
|
|
5157
5175
|
{
|
|
5158
|
-
setDevtoolsHook(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target);
|
|
5176
|
+
setDevtoolsHook$1(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target);
|
|
5159
5177
|
}
|
|
5160
5178
|
const {
|
|
5161
5179
|
insert: hostInsert,
|
|
@@ -5264,7 +5282,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5264
5282
|
internals
|
|
5265
5283
|
);
|
|
5266
5284
|
} else {
|
|
5267
|
-
warn("Invalid VNode type:", type, `(${typeof type})`);
|
|
5285
|
+
warn$1("Invalid VNode type:", type, `(${typeof type})`);
|
|
5268
5286
|
}
|
|
5269
5287
|
}
|
|
5270
5288
|
if (ref != null && parentComponent) {
|
|
@@ -6233,7 +6251,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6233
6251
|
const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
|
|
6234
6252
|
if (nextChild.key != null) {
|
|
6235
6253
|
if (keyToNewIndexMap.has(nextChild.key)) {
|
|
6236
|
-
warn(
|
|
6254
|
+
warn$1(
|
|
6237
6255
|
`Duplicate keys found during update:`,
|
|
6238
6256
|
JSON.stringify(nextChild.key),
|
|
6239
6257
|
`Make sure keys are unique.`
|
|
@@ -6662,14 +6680,14 @@ const resolveTarget = (props, select) => {
|
|
|
6662
6680
|
const targetSelector = props && props.to;
|
|
6663
6681
|
if (shared.isString(targetSelector)) {
|
|
6664
6682
|
if (!select) {
|
|
6665
|
-
warn(
|
|
6683
|
+
warn$1(
|
|
6666
6684
|
`Current renderer does not support string target for Teleports. (missing querySelector renderer option)`
|
|
6667
6685
|
);
|
|
6668
6686
|
return null;
|
|
6669
6687
|
} else {
|
|
6670
6688
|
const target = select(targetSelector);
|
|
6671
6689
|
if (!target) {
|
|
6672
|
-
warn(
|
|
6690
|
+
warn$1(
|
|
6673
6691
|
`Failed to locate Teleport target with selector "${targetSelector}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.`
|
|
6674
6692
|
);
|
|
6675
6693
|
}
|
|
@@ -6677,7 +6695,7 @@ const resolveTarget = (props, select) => {
|
|
|
6677
6695
|
}
|
|
6678
6696
|
} else {
|
|
6679
6697
|
if (!targetSelector && !isTeleportDisabled(props)) {
|
|
6680
|
-
warn(`Invalid Teleport target: ${targetSelector}`);
|
|
6698
|
+
warn$1(`Invalid Teleport target: ${targetSelector}`);
|
|
6681
6699
|
}
|
|
6682
6700
|
return targetSelector;
|
|
6683
6701
|
}
|
|
@@ -6713,7 +6731,7 @@ const TeleportImpl = {
|
|
|
6713
6731
|
namespace = "mathml";
|
|
6714
6732
|
}
|
|
6715
6733
|
} else if (!disabled) {
|
|
6716
|
-
warn("Invalid Teleport target on mount:", target, `(${typeof target})`);
|
|
6734
|
+
warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`);
|
|
6717
6735
|
}
|
|
6718
6736
|
const mount = (container2, anchor2) => {
|
|
6719
6737
|
if (shapeFlag & 16) {
|
|
@@ -6800,7 +6818,7 @@ const TeleportImpl = {
|
|
|
6800
6818
|
0
|
|
6801
6819
|
);
|
|
6802
6820
|
} else {
|
|
6803
|
-
warn(
|
|
6821
|
+
warn$1(
|
|
6804
6822
|
"Invalid Teleport target on update:",
|
|
6805
6823
|
target,
|
|
6806
6824
|
`(${typeof target})`
|
|
@@ -6963,7 +6981,6 @@ function createElementBlock(type, props, children, patchFlag, dynamicProps, shap
|
|
|
6963
6981
|
dynamicProps,
|
|
6964
6982
|
shapeFlag,
|
|
6965
6983
|
true
|
|
6966
|
-
/* isBlock */
|
|
6967
6984
|
)
|
|
6968
6985
|
);
|
|
6969
6986
|
}
|
|
@@ -6976,7 +6993,6 @@ function createBlock(type, props, children, patchFlag, dynamicProps) {
|
|
|
6976
6993
|
patchFlag,
|
|
6977
6994
|
dynamicProps,
|
|
6978
6995
|
true
|
|
6979
|
-
/* isBlock: prevent a block from tracking itself */
|
|
6980
6996
|
)
|
|
6981
6997
|
);
|
|
6982
6998
|
}
|
|
@@ -7050,7 +7066,7 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
|
|
|
7050
7066
|
vnode.shapeFlag |= shared.isString(children) ? 8 : 16;
|
|
7051
7067
|
}
|
|
7052
7068
|
if (vnode.key !== vnode.key) {
|
|
7053
|
-
warn(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
|
|
7069
|
+
warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
|
|
7054
7070
|
}
|
|
7055
7071
|
if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself
|
|
7056
7072
|
!isBlockNode && // has current parent block
|
|
@@ -7069,7 +7085,7 @@ const createVNode = createVNodeWithArgsTransform ;
|
|
|
7069
7085
|
function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
|
|
7070
7086
|
if (!type || type === NULL_DYNAMIC_COMPONENT) {
|
|
7071
7087
|
if (!type) {
|
|
7072
|
-
warn(`Invalid vnode type when creating vnode: ${type}.`);
|
|
7088
|
+
warn$1(`Invalid vnode type when creating vnode: ${type}.`);
|
|
7073
7089
|
}
|
|
7074
7090
|
type = Comment;
|
|
7075
7091
|
}
|
|
@@ -7112,7 +7128,7 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
|
|
|
7112
7128
|
const shapeFlag = shared.isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : shared.isObject(type) ? 4 : shared.isFunction(type) ? 2 : 0;
|
|
7113
7129
|
if (shapeFlag & 4 && reactivity.isProxy(type)) {
|
|
7114
7130
|
type = reactivity.toRaw(type);
|
|
7115
|
-
warn(
|
|
7131
|
+
warn$1(
|
|
7116
7132
|
`Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with \`markRaw\` or using \`shallowRef\` instead of \`ref\`.`,
|
|
7117
7133
|
`
|
|
7118
7134
|
Component that was made reactive: `,
|
|
@@ -7425,7 +7441,7 @@ const isBuiltInTag = /* @__PURE__ */ shared.makeMap("slot,component");
|
|
|
7425
7441
|
function validateComponentName(name, config) {
|
|
7426
7442
|
const appIsNativeTag = config.isNativeTag || shared.NO;
|
|
7427
7443
|
if (isBuiltInTag(name) || appIsNativeTag(name)) {
|
|
7428
|
-
warn(
|
|
7444
|
+
warn$1(
|
|
7429
7445
|
"Do not use built-in or reserved HTML elements as component id: " + name
|
|
7430
7446
|
);
|
|
7431
7447
|
}
|
|
@@ -7464,7 +7480,7 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
7464
7480
|
}
|
|
7465
7481
|
}
|
|
7466
7482
|
if (Component.compilerOptions && isRuntimeOnly()) {
|
|
7467
|
-
warn(
|
|
7483
|
+
warn$1(
|
|
7468
7484
|
`"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.`
|
|
7469
7485
|
);
|
|
7470
7486
|
}
|
|
@@ -7483,7 +7499,10 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
7483
7499
|
setup,
|
|
7484
7500
|
instance,
|
|
7485
7501
|
0,
|
|
7486
|
-
[
|
|
7502
|
+
[
|
|
7503
|
+
reactivity.shallowReadonly(instance.props) ,
|
|
7504
|
+
setupContext
|
|
7505
|
+
]
|
|
7487
7506
|
);
|
|
7488
7507
|
reactivity.resetTracking();
|
|
7489
7508
|
unsetCurrentInstance();
|
|
@@ -7499,7 +7518,7 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
7499
7518
|
instance.asyncDep = setupResult;
|
|
7500
7519
|
if (!instance.suspense) {
|
|
7501
7520
|
const name = (_a = Component.name) != null ? _a : "Anonymous";
|
|
7502
|
-
warn(
|
|
7521
|
+
warn$1(
|
|
7503
7522
|
`Component <${name}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.`
|
|
7504
7523
|
);
|
|
7505
7524
|
}
|
|
@@ -7520,7 +7539,7 @@ function handleSetupResult(instance, setupResult, isSSR) {
|
|
|
7520
7539
|
}
|
|
7521
7540
|
} else if (shared.isObject(setupResult)) {
|
|
7522
7541
|
if (isVNode(setupResult)) {
|
|
7523
|
-
warn(
|
|
7542
|
+
warn$1(
|
|
7524
7543
|
`setup() should not return VNodes directly - return a render function instead.`
|
|
7525
7544
|
);
|
|
7526
7545
|
}
|
|
@@ -7532,7 +7551,7 @@ function handleSetupResult(instance, setupResult, isSSR) {
|
|
|
7532
7551
|
exposeSetupStateOnRenderContext(instance);
|
|
7533
7552
|
}
|
|
7534
7553
|
} else if (setupResult !== void 0) {
|
|
7535
|
-
warn(
|
|
7554
|
+
warn$1(
|
|
7536
7555
|
`setup() should return an object. Received: ${setupResult === null ? "null" : typeof setupResult}`
|
|
7537
7556
|
);
|
|
7538
7557
|
}
|
|
@@ -7593,12 +7612,11 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
7593
7612
|
}
|
|
7594
7613
|
if (!Component.render && instance.render === shared.NOOP && !isSSR) {
|
|
7595
7614
|
if (!compile && Component.template) {
|
|
7596
|
-
warn(
|
|
7615
|
+
warn$1(
|
|
7597
7616
|
`Component provided template option but runtime compilation is not supported in this build of Vue.` + (``)
|
|
7598
|
-
/* should not happen */
|
|
7599
7617
|
);
|
|
7600
7618
|
} else {
|
|
7601
|
-
warn(`Component is missing template or render function.`);
|
|
7619
|
+
warn$1(`Component is missing template or render function.`);
|
|
7602
7620
|
}
|
|
7603
7621
|
}
|
|
7604
7622
|
}
|
|
@@ -7612,11 +7630,11 @@ function getAttrsProxy(instance) {
|
|
|
7612
7630
|
return target[key];
|
|
7613
7631
|
},
|
|
7614
7632
|
set() {
|
|
7615
|
-
warn(`setupContext.attrs is readonly.`);
|
|
7633
|
+
warn$1(`setupContext.attrs is readonly.`);
|
|
7616
7634
|
return false;
|
|
7617
7635
|
},
|
|
7618
7636
|
deleteProperty() {
|
|
7619
|
-
warn(`setupContext.attrs is readonly.`);
|
|
7637
|
+
warn$1(`setupContext.attrs is readonly.`);
|
|
7620
7638
|
return false;
|
|
7621
7639
|
}
|
|
7622
7640
|
}
|
|
@@ -7634,7 +7652,7 @@ function createSetupContext(instance) {
|
|
|
7634
7652
|
const expose = (exposed) => {
|
|
7635
7653
|
{
|
|
7636
7654
|
if (instance.exposed) {
|
|
7637
|
-
warn(`expose() should be called only once per setup().`);
|
|
7655
|
+
warn$1(`expose() should be called only once per setup().`);
|
|
7638
7656
|
}
|
|
7639
7657
|
if (exposed != null) {
|
|
7640
7658
|
let exposedType = typeof exposed;
|
|
@@ -7646,7 +7664,7 @@ function createSetupContext(instance) {
|
|
|
7646
7664
|
}
|
|
7647
7665
|
}
|
|
7648
7666
|
if (exposedType !== "object") {
|
|
7649
|
-
warn(
|
|
7667
|
+
warn$1(
|
|
7650
7668
|
`expose() should be passed a plain object, received ${exposedType}.`
|
|
7651
7669
|
);
|
|
7652
7670
|
}
|
|
@@ -7746,7 +7764,7 @@ const useSSRContext = () => {
|
|
|
7746
7764
|
{
|
|
7747
7765
|
const ctx = inject(ssrContextKey);
|
|
7748
7766
|
if (!ctx) {
|
|
7749
|
-
warn(
|
|
7767
|
+
warn$1(
|
|
7750
7768
|
`Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.`
|
|
7751
7769
|
);
|
|
7752
7770
|
}
|
|
@@ -7959,8 +7977,11 @@ function isMemoSame(cached, memo) {
|
|
|
7959
7977
|
return true;
|
|
7960
7978
|
}
|
|
7961
7979
|
|
|
7962
|
-
const version = "3.4.0-rc.
|
|
7980
|
+
const version = "3.4.0-rc.3";
|
|
7981
|
+
const warn = warn$1 ;
|
|
7963
7982
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
7983
|
+
const devtools = devtools$1 ;
|
|
7984
|
+
const setDevtoolsHook = setDevtoolsHook$1 ;
|
|
7964
7985
|
const _ssrUtils = {
|
|
7965
7986
|
createComponentInstance,
|
|
7966
7987
|
setupComponent,
|
|
@@ -8047,6 +8068,7 @@ exports.defineModel = defineModel;
|
|
|
8047
8068
|
exports.defineOptions = defineOptions;
|
|
8048
8069
|
exports.defineProps = defineProps;
|
|
8049
8070
|
exports.defineSlots = defineSlots;
|
|
8071
|
+
exports.devtools = devtools;
|
|
8050
8072
|
exports.getCurrentInstance = getCurrentInstance;
|
|
8051
8073
|
exports.getTransitionRawChildren = getTransitionRawChildren;
|
|
8052
8074
|
exports.guardReactiveProps = guardReactiveProps;
|