@vue/compat 3.2.44 → 3.2.45
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/vue.cjs.js +154 -109
- package/dist/vue.cjs.prod.js +138 -82
- package/dist/vue.esm-browser.js +163 -112
- package/dist/vue.esm-browser.prod.js +1 -1
- package/dist/vue.esm-bundler.js +164 -114
- package/dist/vue.global.js +163 -112
- package/dist/vue.global.prod.js +1 -1
- package/dist/vue.runtime.esm-browser.js +119 -75
- package/dist/vue.runtime.esm-browser.prod.js +1 -1
- package/dist/vue.runtime.esm-bundler.js +120 -77
- package/dist/vue.runtime.global.js +119 -75
- package/dist/vue.runtime.global.prod.js +1 -1
- package/package.json +2 -2
package/dist/vue.esm-bundler.js
CHANGED
|
@@ -2123,12 +2123,6 @@ function reload(id, newComp) {
|
|
|
2123
2123
|
// components to be unmounted and re-mounted. Queue the update so that we
|
|
2124
2124
|
// don't end up forcing the same parent to re-render multiple times.
|
|
2125
2125
|
queueJob(instance.parent.update);
|
|
2126
|
-
// instance is the inner component of an async custom element
|
|
2127
|
-
// invoke to reset styles
|
|
2128
|
-
if (instance.parent.type.__asyncLoader &&
|
|
2129
|
-
instance.parent.ceReload) {
|
|
2130
|
-
instance.parent.ceReload(newComp.styles);
|
|
2131
|
-
}
|
|
2132
2126
|
}
|
|
2133
2127
|
else if (instance.appContext.reload) {
|
|
2134
2128
|
// root instance mounted via createApp() has a reload method
|
|
@@ -4576,10 +4570,15 @@ function defineAsyncComponent(source) {
|
|
|
4576
4570
|
}
|
|
4577
4571
|
});
|
|
4578
4572
|
}
|
|
4579
|
-
function createInnerComp(comp,
|
|
4573
|
+
function createInnerComp(comp, parent) {
|
|
4574
|
+
const { ref, props, children, ce } = parent.vnode;
|
|
4580
4575
|
const vnode = createVNode(comp, props, children);
|
|
4581
4576
|
// ensure inner component inherits the async wrapper's ref owner
|
|
4582
4577
|
vnode.ref = ref;
|
|
4578
|
+
// pass the custom element callback on to the inner comp
|
|
4579
|
+
// and remove it from the async wrapper
|
|
4580
|
+
vnode.ce = ce;
|
|
4581
|
+
delete parent.vnode.ce;
|
|
4583
4582
|
return vnode;
|
|
4584
4583
|
}
|
|
4585
4584
|
|
|
@@ -4745,8 +4744,7 @@ const KeepAliveImpl = {
|
|
|
4745
4744
|
: comp);
|
|
4746
4745
|
const { include, exclude, max } = props;
|
|
4747
4746
|
if ((include && (!name || !matches(include, name))) ||
|
|
4748
|
-
(exclude && name && matches(exclude, name))
|
|
4749
|
-
((process.env.NODE_ENV !== 'production') && hmrDirtyComponents.has(comp))) {
|
|
4747
|
+
(exclude && name && matches(exclude, name))) {
|
|
4750
4748
|
current = vnode;
|
|
4751
4749
|
return rawVNode;
|
|
4752
4750
|
}
|
|
@@ -4859,14 +4857,9 @@ function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
|
|
|
4859
4857
|
}, target);
|
|
4860
4858
|
}
|
|
4861
4859
|
function resetShapeFlag(vnode) {
|
|
4862
|
-
|
|
4863
|
-
|
|
4864
|
-
|
|
4865
|
-
}
|
|
4866
|
-
if (shapeFlag & 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */) {
|
|
4867
|
-
shapeFlag -= 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
|
|
4868
|
-
}
|
|
4869
|
-
vnode.shapeFlag = shapeFlag;
|
|
4860
|
+
// bitwise operations to remove keep alive flags
|
|
4861
|
+
vnode.shapeFlag &= ~256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */;
|
|
4862
|
+
vnode.shapeFlag &= ~512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
|
|
4870
4863
|
}
|
|
4871
4864
|
function getInnerChild(vnode) {
|
|
4872
4865
|
return vnode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */ ? vnode.ssContent : vnode;
|
|
@@ -5494,7 +5487,9 @@ fallback, noSlotted) {
|
|
|
5494
5487
|
(currentRenderingInstance.parent &&
|
|
5495
5488
|
isAsyncWrapper(currentRenderingInstance.parent) &&
|
|
5496
5489
|
currentRenderingInstance.parent.isCE)) {
|
|
5497
|
-
|
|
5490
|
+
if (name !== 'default')
|
|
5491
|
+
props.name = name;
|
|
5492
|
+
return createVNode('slot', props, fallback && fallback());
|
|
5498
5493
|
}
|
|
5499
5494
|
let slot = slots[name];
|
|
5500
5495
|
if ((process.env.NODE_ENV !== 'production') && slot && slot.length > 1) {
|
|
@@ -5814,6 +5809,7 @@ const publicPropertiesMap =
|
|
|
5814
5809
|
installCompatInstanceProperties(publicPropertiesMap);
|
|
5815
5810
|
}
|
|
5816
5811
|
const isReservedPrefix = (key) => key === '_' || key === '$';
|
|
5812
|
+
const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
|
|
5817
5813
|
const PublicInstanceProxyHandlers = {
|
|
5818
5814
|
get({ _: instance }, key) {
|
|
5819
5815
|
const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
|
|
@@ -5821,16 +5817,6 @@ const PublicInstanceProxyHandlers = {
|
|
|
5821
5817
|
if ((process.env.NODE_ENV !== 'production') && key === '__isVue') {
|
|
5822
5818
|
return true;
|
|
5823
5819
|
}
|
|
5824
|
-
// prioritize <script setup> bindings during dev.
|
|
5825
|
-
// this allows even properties that start with _ or $ to be used - so that
|
|
5826
|
-
// it aligns with the production behavior where the render fn is inlined and
|
|
5827
|
-
// indeed has access to all declared variables.
|
|
5828
|
-
if ((process.env.NODE_ENV !== 'production') &&
|
|
5829
|
-
setupState !== EMPTY_OBJ &&
|
|
5830
|
-
setupState.__isScriptSetup &&
|
|
5831
|
-
hasOwn(setupState, key)) {
|
|
5832
|
-
return setupState[key];
|
|
5833
|
-
}
|
|
5834
5820
|
// data / props / ctx
|
|
5835
5821
|
// This getter gets called for every property access on the render context
|
|
5836
5822
|
// during render and is a major hotspot. The most expensive part of this
|
|
@@ -5853,7 +5839,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
5853
5839
|
// default: just fallthrough
|
|
5854
5840
|
}
|
|
5855
5841
|
}
|
|
5856
|
-
else if (
|
|
5842
|
+
else if (hasSetupBinding(setupState, key)) {
|
|
5857
5843
|
accessCache[key] = 1 /* AccessTypes.SETUP */;
|
|
5858
5844
|
return setupState[key];
|
|
5859
5845
|
}
|
|
@@ -5933,23 +5919,28 @@ const PublicInstanceProxyHandlers = {
|
|
|
5933
5919
|
},
|
|
5934
5920
|
set({ _: instance }, key, value) {
|
|
5935
5921
|
const { data, setupState, ctx } = instance;
|
|
5936
|
-
if (
|
|
5922
|
+
if (hasSetupBinding(setupState, key)) {
|
|
5937
5923
|
setupState[key] = value;
|
|
5938
5924
|
return true;
|
|
5939
5925
|
}
|
|
5926
|
+
else if ((process.env.NODE_ENV !== 'production') &&
|
|
5927
|
+
setupState.__isScriptSetup &&
|
|
5928
|
+
hasOwn(setupState, key)) {
|
|
5929
|
+
warn$1(`Cannot mutate <script setup> binding "${key}" from Options API.`);
|
|
5930
|
+
return false;
|
|
5931
|
+
}
|
|
5940
5932
|
else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
|
|
5941
5933
|
data[key] = value;
|
|
5942
5934
|
return true;
|
|
5943
5935
|
}
|
|
5944
5936
|
else if (hasOwn(instance.props, key)) {
|
|
5945
|
-
(process.env.NODE_ENV !== 'production') &&
|
|
5946
|
-
warn$1(`Attempting to mutate prop "${key}". Props are readonly.`, instance);
|
|
5937
|
+
(process.env.NODE_ENV !== 'production') && warn$1(`Attempting to mutate prop "${key}". Props are readonly.`);
|
|
5947
5938
|
return false;
|
|
5948
5939
|
}
|
|
5949
5940
|
if (key[0] === '$' && key.slice(1) in instance) {
|
|
5950
5941
|
(process.env.NODE_ENV !== 'production') &&
|
|
5951
5942
|
warn$1(`Attempting to mutate public property "${key}". ` +
|
|
5952
|
-
`Properties starting with $ are reserved and readonly
|
|
5943
|
+
`Properties starting with $ are reserved and readonly.`);
|
|
5953
5944
|
return false;
|
|
5954
5945
|
}
|
|
5955
5946
|
else {
|
|
@@ -5970,7 +5961,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
5970
5961
|
let normalizedProps;
|
|
5971
5962
|
return (!!accessCache[key] ||
|
|
5972
5963
|
(data !== EMPTY_OBJ && hasOwn(data, key)) ||
|
|
5973
|
-
(setupState
|
|
5964
|
+
hasSetupBinding(setupState, key) ||
|
|
5974
5965
|
((normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key)) ||
|
|
5975
5966
|
hasOwn(ctx, key) ||
|
|
5976
5967
|
hasOwn(publicPropertiesMap, key) ||
|
|
@@ -7253,7 +7244,7 @@ function createCompatVue(createApp, createSingletonApp) {
|
|
|
7253
7244
|
return vm;
|
|
7254
7245
|
}
|
|
7255
7246
|
}
|
|
7256
|
-
Vue.version = `2.6.14-compat:${"3.2.
|
|
7247
|
+
Vue.version = `2.6.14-compat:${"3.2.45"}`;
|
|
7257
7248
|
Vue.config = singletonApp.config;
|
|
7258
7249
|
Vue.use = (p, ...options) => {
|
|
7259
7250
|
if (p && isFunction(p.install)) {
|
|
@@ -9683,6 +9674,10 @@ function traverseStaticChildren(n1, n2, shallow = false) {
|
|
|
9683
9674
|
if (!shallow)
|
|
9684
9675
|
traverseStaticChildren(c1, c2);
|
|
9685
9676
|
}
|
|
9677
|
+
// #6852 also inherit for text nodes
|
|
9678
|
+
if (c2.type === Text) {
|
|
9679
|
+
c2.el = c1.el;
|
|
9680
|
+
}
|
|
9686
9681
|
// also inherit for comment nodes, but not placeholders (e.g. v-if which
|
|
9687
9682
|
// would have received .el during block patch)
|
|
9688
9683
|
if ((process.env.NODE_ENV !== 'production') && c2.type === Comment && !c2.el) {
|
|
@@ -9857,6 +9852,7 @@ const TeleportImpl = {
|
|
|
9857
9852
|
}
|
|
9858
9853
|
}
|
|
9859
9854
|
}
|
|
9855
|
+
updateCssVars(n2);
|
|
9860
9856
|
},
|
|
9861
9857
|
remove(vnode, parentComponent, parentSuspense, optimized, { um: unmount, o: { remove: hostRemove } }, doRemove) {
|
|
9862
9858
|
const { shapeFlag, children, anchor, targetAnchor, target, props } = vnode;
|
|
@@ -9935,11 +9931,26 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
9935
9931
|
hydrateChildren(targetNode, vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
9936
9932
|
}
|
|
9937
9933
|
}
|
|
9934
|
+
updateCssVars(vnode);
|
|
9938
9935
|
}
|
|
9939
9936
|
return vnode.anchor && nextSibling(vnode.anchor);
|
|
9940
9937
|
}
|
|
9941
9938
|
// Force-casted public typing for h and TSX props inference
|
|
9942
9939
|
const Teleport = TeleportImpl;
|
|
9940
|
+
function updateCssVars(vnode) {
|
|
9941
|
+
// presence of .ut method indicates owner component uses css vars.
|
|
9942
|
+
// code path here can assume browser environment.
|
|
9943
|
+
const ctx = vnode.ctx;
|
|
9944
|
+
if (ctx && ctx.ut) {
|
|
9945
|
+
let node = vnode.children[0].el;
|
|
9946
|
+
while (node !== vnode.targetAnchor) {
|
|
9947
|
+
if (node.nodeType === 1)
|
|
9948
|
+
node.setAttribute('data-v-owner', ctx.uid);
|
|
9949
|
+
node = node.nextSibling;
|
|
9950
|
+
}
|
|
9951
|
+
ctx.ut();
|
|
9952
|
+
}
|
|
9953
|
+
}
|
|
9943
9954
|
|
|
9944
9955
|
const normalizedAsyncComponentMap = new Map();
|
|
9945
9956
|
function convertLegacyAsyncComponent(comp) {
|
|
@@ -10095,6 +10106,10 @@ function isSameVNodeType(n1, n2) {
|
|
|
10095
10106
|
if ((process.env.NODE_ENV !== 'production') &&
|
|
10096
10107
|
n2.shapeFlag & 6 /* ShapeFlags.COMPONENT */ &&
|
|
10097
10108
|
hmrDirtyComponents.has(n2.type)) {
|
|
10109
|
+
// #7042, ensure the vnode being unmounted during HMR
|
|
10110
|
+
// bitwise operations to remove keep alive flags
|
|
10111
|
+
n1.shapeFlag &= ~256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */;
|
|
10112
|
+
n2.shapeFlag &= ~512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
|
|
10098
10113
|
// HMR only: if the component has been hot-updated, force a reload.
|
|
10099
10114
|
return false;
|
|
10100
10115
|
}
|
|
@@ -10150,7 +10165,8 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
|
|
|
10150
10165
|
patchFlag,
|
|
10151
10166
|
dynamicProps,
|
|
10152
10167
|
dynamicChildren: null,
|
|
10153
|
-
appContext: null
|
|
10168
|
+
appContext: null,
|
|
10169
|
+
ctx: currentRenderingInstance
|
|
10154
10170
|
};
|
|
10155
10171
|
if (needFullChildrenNormalization) {
|
|
10156
10172
|
normalizeChildren(vnode, children);
|
|
@@ -10325,7 +10341,8 @@ function cloneVNode(vnode, extraProps, mergeRef = false) {
|
|
|
10325
10341
|
ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
|
|
10326
10342
|
ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
|
|
10327
10343
|
el: vnode.el,
|
|
10328
|
-
anchor: vnode.anchor
|
|
10344
|
+
anchor: vnode.anchor,
|
|
10345
|
+
ctx: vnode.ctx
|
|
10329
10346
|
};
|
|
10330
10347
|
{
|
|
10331
10348
|
defineLegacyVNodeProperties(cloned);
|
|
@@ -11338,7 +11355,7 @@ function isMemoSame(cached, memo) {
|
|
|
11338
11355
|
}
|
|
11339
11356
|
|
|
11340
11357
|
// Core API ------------------------------------------------------------------
|
|
11341
|
-
const version = "3.2.
|
|
11358
|
+
const version = "3.2.45";
|
|
11342
11359
|
const _ssrUtils = {
|
|
11343
11360
|
createComponentInstance,
|
|
11344
11361
|
setupComponent,
|
|
@@ -11881,12 +11898,21 @@ class VueElement extends BaseClass {
|
|
|
11881
11898
|
`defined as hydratable. Use \`defineSSRCustomElement\`.`);
|
|
11882
11899
|
}
|
|
11883
11900
|
this.attachShadow({ mode: 'open' });
|
|
11901
|
+
if (!this._def.__asyncLoader) {
|
|
11902
|
+
// for sync component defs we can immediately resolve props
|
|
11903
|
+
this._resolveProps(this._def);
|
|
11904
|
+
}
|
|
11884
11905
|
}
|
|
11885
11906
|
}
|
|
11886
11907
|
connectedCallback() {
|
|
11887
11908
|
this._connected = true;
|
|
11888
11909
|
if (!this._instance) {
|
|
11889
|
-
this.
|
|
11910
|
+
if (this._resolved) {
|
|
11911
|
+
this._update();
|
|
11912
|
+
}
|
|
11913
|
+
else {
|
|
11914
|
+
this._resolveDef();
|
|
11915
|
+
}
|
|
11890
11916
|
}
|
|
11891
11917
|
}
|
|
11892
11918
|
disconnectedCallback() {
|
|
@@ -11902,9 +11928,6 @@ class VueElement extends BaseClass {
|
|
|
11902
11928
|
* resolve inner component definition (handle possible async component)
|
|
11903
11929
|
*/
|
|
11904
11930
|
_resolveDef() {
|
|
11905
|
-
if (this._resolved) {
|
|
11906
|
-
return;
|
|
11907
|
-
}
|
|
11908
11931
|
this._resolved = true;
|
|
11909
11932
|
// set initial attrs
|
|
11910
11933
|
for (let i = 0; i < this.attributes.length; i++) {
|
|
@@ -11916,38 +11939,26 @@ class VueElement extends BaseClass {
|
|
|
11916
11939
|
this._setAttr(m.attributeName);
|
|
11917
11940
|
}
|
|
11918
11941
|
}).observe(this, { attributes: true });
|
|
11919
|
-
const resolve = (def) => {
|
|
11920
|
-
const { props
|
|
11921
|
-
const hasOptions = !isArray(props);
|
|
11922
|
-
const rawKeys = props ? (hasOptions ? Object.keys(props) : props) : [];
|
|
11942
|
+
const resolve = (def, isAsync = false) => {
|
|
11943
|
+
const { props, styles } = def;
|
|
11923
11944
|
// cast Number-type props set before resolve
|
|
11924
11945
|
let numberProps;
|
|
11925
|
-
if (
|
|
11926
|
-
for (const key in
|
|
11946
|
+
if (props && !isArray(props)) {
|
|
11947
|
+
for (const key in props) {
|
|
11927
11948
|
const opt = props[key];
|
|
11928
11949
|
if (opt === Number || (opt && opt.type === Number)) {
|
|
11929
|
-
|
|
11930
|
-
|
|
11950
|
+
if (key in this._props) {
|
|
11951
|
+
this._props[key] = toNumber(this._props[key]);
|
|
11952
|
+
}
|
|
11953
|
+
(numberProps || (numberProps = Object.create(null)))[camelize(key)] = true;
|
|
11931
11954
|
}
|
|
11932
11955
|
}
|
|
11933
11956
|
}
|
|
11934
11957
|
this._numberProps = numberProps;
|
|
11935
|
-
|
|
11936
|
-
|
|
11937
|
-
|
|
11938
|
-
|
|
11939
|
-
}
|
|
11940
|
-
}
|
|
11941
|
-
// defining getter/setters on prototype
|
|
11942
|
-
for (const key of rawKeys.map(camelize)) {
|
|
11943
|
-
Object.defineProperty(this, key, {
|
|
11944
|
-
get() {
|
|
11945
|
-
return this._getProp(key);
|
|
11946
|
-
},
|
|
11947
|
-
set(val) {
|
|
11948
|
-
this._setProp(key, val);
|
|
11949
|
-
}
|
|
11950
|
-
});
|
|
11958
|
+
if (isAsync) {
|
|
11959
|
+
// defining getter/setters on prototype
|
|
11960
|
+
// for sync defs, this already happened in the constructor
|
|
11961
|
+
this._resolveProps(def);
|
|
11951
11962
|
}
|
|
11952
11963
|
// apply CSS
|
|
11953
11964
|
this._applyStyles(styles);
|
|
@@ -11956,12 +11967,33 @@ class VueElement extends BaseClass {
|
|
|
11956
11967
|
};
|
|
11957
11968
|
const asyncDef = this._def.__asyncLoader;
|
|
11958
11969
|
if (asyncDef) {
|
|
11959
|
-
asyncDef().then(resolve);
|
|
11970
|
+
asyncDef().then(def => resolve(def, true));
|
|
11960
11971
|
}
|
|
11961
11972
|
else {
|
|
11962
11973
|
resolve(this._def);
|
|
11963
11974
|
}
|
|
11964
11975
|
}
|
|
11976
|
+
_resolveProps(def) {
|
|
11977
|
+
const { props } = def;
|
|
11978
|
+
const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
|
|
11979
|
+
// check if there are props set pre-upgrade or connect
|
|
11980
|
+
for (const key of Object.keys(this)) {
|
|
11981
|
+
if (key[0] !== '_' && declaredPropKeys.includes(key)) {
|
|
11982
|
+
this._setProp(key, this[key], true, false);
|
|
11983
|
+
}
|
|
11984
|
+
}
|
|
11985
|
+
// defining getter/setters on prototype
|
|
11986
|
+
for (const key of declaredPropKeys.map(camelize)) {
|
|
11987
|
+
Object.defineProperty(this, key, {
|
|
11988
|
+
get() {
|
|
11989
|
+
return this._getProp(key);
|
|
11990
|
+
},
|
|
11991
|
+
set(val) {
|
|
11992
|
+
this._setProp(key, val);
|
|
11993
|
+
}
|
|
11994
|
+
});
|
|
11995
|
+
}
|
|
11996
|
+
}
|
|
11965
11997
|
_setAttr(key) {
|
|
11966
11998
|
let value = this.getAttribute(key);
|
|
11967
11999
|
const camelKey = camelize(key);
|
|
@@ -12017,27 +12049,31 @@ class VueElement extends BaseClass {
|
|
|
12017
12049
|
this._styles.length = 0;
|
|
12018
12050
|
}
|
|
12019
12051
|
this._applyStyles(newStyles);
|
|
12020
|
-
|
|
12021
|
-
|
|
12022
|
-
if (!this._def.__asyncLoader) {
|
|
12023
|
-
// reload
|
|
12024
|
-
this._instance = null;
|
|
12025
|
-
this._update();
|
|
12026
|
-
}
|
|
12052
|
+
this._instance = null;
|
|
12053
|
+
this._update();
|
|
12027
12054
|
};
|
|
12028
12055
|
}
|
|
12029
|
-
|
|
12030
|
-
instance.emit = (event, ...args) => {
|
|
12056
|
+
const dispatch = (event, args) => {
|
|
12031
12057
|
this.dispatchEvent(new CustomEvent(event, {
|
|
12032
12058
|
detail: args
|
|
12033
12059
|
}));
|
|
12034
12060
|
};
|
|
12061
|
+
// intercept emit
|
|
12062
|
+
instance.emit = (event, ...args) => {
|
|
12063
|
+
// dispatch both the raw and hyphenated versions of an event
|
|
12064
|
+
// to match Vue behavior
|
|
12065
|
+
dispatch(event, args);
|
|
12066
|
+
if (hyphenate(event) !== event) {
|
|
12067
|
+
dispatch(hyphenate(event), args);
|
|
12068
|
+
}
|
|
12069
|
+
};
|
|
12035
12070
|
// locate nearest Vue custom element parent for provide/inject
|
|
12036
12071
|
let parent = this;
|
|
12037
12072
|
while ((parent =
|
|
12038
12073
|
parent && (parent.parentNode || parent.host))) {
|
|
12039
12074
|
if (parent instanceof VueElement) {
|
|
12040
12075
|
instance.parent = parent._instance;
|
|
12076
|
+
instance.provides = parent._instance.provides;
|
|
12041
12077
|
break;
|
|
12042
12078
|
}
|
|
12043
12079
|
}
|
|
@@ -12095,7 +12131,14 @@ function useCssVars(getter) {
|
|
|
12095
12131
|
warn$1(`useCssVars is called without current active component instance.`);
|
|
12096
12132
|
return;
|
|
12097
12133
|
}
|
|
12098
|
-
const
|
|
12134
|
+
const updateTeleports = (instance.ut = (vars = getter(instance.proxy)) => {
|
|
12135
|
+
Array.from(document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)).forEach(node => setVarsOnNode(node, vars));
|
|
12136
|
+
});
|
|
12137
|
+
const setVars = () => {
|
|
12138
|
+
const vars = getter(instance.proxy);
|
|
12139
|
+
setVarsOnVNode(instance.subTree, vars);
|
|
12140
|
+
updateTeleports(vars);
|
|
12141
|
+
};
|
|
12099
12142
|
watchPostEffect(setVars);
|
|
12100
12143
|
onMounted(() => {
|
|
12101
12144
|
const ob = new MutationObserver(setVars);
|
|
@@ -13409,15 +13452,16 @@ const errorMessages = {
|
|
|
13409
13452
|
[41 /* ErrorCodes.X_V_MODEL_NO_EXPRESSION */]: `v-model is missing expression.`,
|
|
13410
13453
|
[42 /* ErrorCodes.X_V_MODEL_MALFORMED_EXPRESSION */]: `v-model value must be a valid JavaScript member expression.`,
|
|
13411
13454
|
[43 /* ErrorCodes.X_V_MODEL_ON_SCOPE_VARIABLE */]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,
|
|
13412
|
-
[44 /* ErrorCodes.
|
|
13413
|
-
[45 /* ErrorCodes.
|
|
13455
|
+
[44 /* ErrorCodes.X_V_MODEL_ON_PROPS */]: `v-model cannot be used on a prop, because local prop bindings are not writable.\nUse a v-bind binding combined with a v-on listener that emits update:x event instead.`,
|
|
13456
|
+
[45 /* ErrorCodes.X_INVALID_EXPRESSION */]: `Error parsing JavaScript expression: `,
|
|
13457
|
+
[46 /* ErrorCodes.X_KEEP_ALIVE_INVALID_CHILDREN */]: `<KeepAlive> expects exactly one child component.`,
|
|
13414
13458
|
// generic errors
|
|
13415
|
-
[
|
|
13416
|
-
[
|
|
13417
|
-
[
|
|
13418
|
-
[
|
|
13459
|
+
[47 /* ErrorCodes.X_PREFIX_ID_NOT_SUPPORTED */]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
|
|
13460
|
+
[48 /* ErrorCodes.X_MODULE_MODE_NOT_SUPPORTED */]: `ES module mode is not supported in this build of compiler.`,
|
|
13461
|
+
[49 /* ErrorCodes.X_CACHE_HANDLER_NOT_SUPPORTED */]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
|
|
13462
|
+
[50 /* ErrorCodes.X_SCOPE_ID_NOT_SUPPORTED */]: `"scopeId" option is only supported in module mode.`,
|
|
13419
13463
|
// just to fulfill types
|
|
13420
|
-
[
|
|
13464
|
+
[51 /* ErrorCodes.__EXTEND_POINT__ */]: ``
|
|
13421
13465
|
};
|
|
13422
13466
|
|
|
13423
13467
|
const FRAGMENT = Symbol((process.env.NODE_ENV !== 'production') ? `Fragment` : ``);
|
|
@@ -16048,7 +16092,7 @@ function validateBrowserExpression(node, context, asParams = false, asRawStateme
|
|
|
16048
16092
|
if (keywordMatch) {
|
|
16049
16093
|
message = `avoid using JavaScript keyword as property name: "${keywordMatch[0]}"`;
|
|
16050
16094
|
}
|
|
16051
|
-
context.onError(createCompilerError(
|
|
16095
|
+
context.onError(createCompilerError(45 /* ErrorCodes.X_INVALID_EXPRESSION */, node.loc, undefined, message));
|
|
16052
16096
|
}
|
|
16053
16097
|
}
|
|
16054
16098
|
|
|
@@ -16845,7 +16889,7 @@ const transformElement = (node, context) => {
|
|
|
16845
16889
|
// 2. Force keep-alive to always be updated, since it uses raw children.
|
|
16846
16890
|
patchFlag |= 1024 /* PatchFlags.DYNAMIC_SLOTS */;
|
|
16847
16891
|
if ((process.env.NODE_ENV !== 'production') && node.children.length > 1) {
|
|
16848
|
-
context.onError(createCompilerError(
|
|
16892
|
+
context.onError(createCompilerError(46 /* ErrorCodes.X_KEEP_ALIVE_INVALID_CHILDREN */, {
|
|
16849
16893
|
start: node.children[0].loc.start,
|
|
16850
16894
|
end: node.children[node.children.length - 1].loc.end,
|
|
16851
16895
|
source: ''
|
|
@@ -17703,8 +17747,14 @@ const transformModel = (dir, node, context) => {
|
|
|
17703
17747
|
const expString = exp.type === 4 /* NodeTypes.SIMPLE_EXPRESSION */ ? exp.content : rawExp;
|
|
17704
17748
|
// im SFC <script setup> inline mode, the exp may have been transformed into
|
|
17705
17749
|
// _unref(exp)
|
|
17706
|
-
context.bindingMetadata[rawExp];
|
|
17707
|
-
|
|
17750
|
+
const bindingType = context.bindingMetadata[rawExp];
|
|
17751
|
+
// check props
|
|
17752
|
+
if (bindingType === "props" /* BindingTypes.PROPS */ ||
|
|
17753
|
+
bindingType === "props-aliased" /* BindingTypes.PROPS_ALIASED */) {
|
|
17754
|
+
context.onError(createCompilerError(44 /* ErrorCodes.X_V_MODEL_ON_PROPS */, exp.loc));
|
|
17755
|
+
return createTransformProps();
|
|
17756
|
+
}
|
|
17757
|
+
const maybeRef = !true ;
|
|
17708
17758
|
if (!expString.trim() ||
|
|
17709
17759
|
(!isMemberExpression(expString) && !maybeRef)) {
|
|
17710
17760
|
context.onError(createCompilerError(42 /* ErrorCodes.X_V_MODEL_MALFORMED_EXPRESSION */, exp.loc));
|
|
@@ -17973,18 +18023,18 @@ function baseCompile(template, options = {}) {
|
|
|
17973
18023
|
/* istanbul ignore if */
|
|
17974
18024
|
{
|
|
17975
18025
|
if (options.prefixIdentifiers === true) {
|
|
17976
|
-
onError(createCompilerError(
|
|
18026
|
+
onError(createCompilerError(47 /* ErrorCodes.X_PREFIX_ID_NOT_SUPPORTED */));
|
|
17977
18027
|
}
|
|
17978
18028
|
else if (isModuleMode) {
|
|
17979
|
-
onError(createCompilerError(
|
|
18029
|
+
onError(createCompilerError(48 /* ErrorCodes.X_MODULE_MODE_NOT_SUPPORTED */));
|
|
17980
18030
|
}
|
|
17981
18031
|
}
|
|
17982
18032
|
const prefixIdentifiers = !true ;
|
|
17983
18033
|
if (options.cacheHandlers) {
|
|
17984
|
-
onError(createCompilerError(
|
|
18034
|
+
onError(createCompilerError(49 /* ErrorCodes.X_CACHE_HANDLER_NOT_SUPPORTED */));
|
|
17985
18035
|
}
|
|
17986
18036
|
if (options.scopeId && !isModuleMode) {
|
|
17987
|
-
onError(createCompilerError(
|
|
18037
|
+
onError(createCompilerError(50 /* ErrorCodes.X_SCOPE_ID_NOT_SUPPORTED */));
|
|
17988
18038
|
}
|
|
17989
18039
|
const ast = isString(template) ? baseParse(template, options) : template;
|
|
17990
18040
|
const [nodeTransforms, directiveTransforms] = getBaseTransformPreset();
|
|
@@ -18142,26 +18192,26 @@ function createDOMCompilerError(code, loc) {
|
|
|
18142
18192
|
return createCompilerError(code, loc, (process.env.NODE_ENV !== 'production') || !true ? DOMErrorMessages : undefined);
|
|
18143
18193
|
}
|
|
18144
18194
|
const DOMErrorMessages = {
|
|
18145
|
-
[
|
|
18146
|
-
[
|
|
18147
|
-
[
|
|
18148
|
-
[
|
|
18149
|
-
[
|
|
18150
|
-
[
|
|
18151
|
-
[
|
|
18152
|
-
[
|
|
18153
|
-
[
|
|
18154
|
-
[
|
|
18155
|
-
[
|
|
18195
|
+
[51 /* DOMErrorCodes.X_V_HTML_NO_EXPRESSION */]: `v-html is missing expression.`,
|
|
18196
|
+
[52 /* DOMErrorCodes.X_V_HTML_WITH_CHILDREN */]: `v-html will override element children.`,
|
|
18197
|
+
[53 /* DOMErrorCodes.X_V_TEXT_NO_EXPRESSION */]: `v-text is missing expression.`,
|
|
18198
|
+
[54 /* DOMErrorCodes.X_V_TEXT_WITH_CHILDREN */]: `v-text will override element children.`,
|
|
18199
|
+
[55 /* DOMErrorCodes.X_V_MODEL_ON_INVALID_ELEMENT */]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
|
|
18200
|
+
[56 /* DOMErrorCodes.X_V_MODEL_ARG_ON_ELEMENT */]: `v-model argument is not supported on plain elements.`,
|
|
18201
|
+
[57 /* DOMErrorCodes.X_V_MODEL_ON_FILE_INPUT_ELEMENT */]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`,
|
|
18202
|
+
[58 /* DOMErrorCodes.X_V_MODEL_UNNECESSARY_VALUE */]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
|
|
18203
|
+
[59 /* DOMErrorCodes.X_V_SHOW_NO_EXPRESSION */]: `v-show is missing expression.`,
|
|
18204
|
+
[60 /* DOMErrorCodes.X_TRANSITION_INVALID_CHILDREN */]: `<Transition> expects exactly one child element or component.`,
|
|
18205
|
+
[61 /* DOMErrorCodes.X_IGNORED_SIDE_EFFECT_TAG */]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`
|
|
18156
18206
|
};
|
|
18157
18207
|
|
|
18158
18208
|
const transformVHtml = (dir, node, context) => {
|
|
18159
18209
|
const { exp, loc } = dir;
|
|
18160
18210
|
if (!exp) {
|
|
18161
|
-
context.onError(createDOMCompilerError(
|
|
18211
|
+
context.onError(createDOMCompilerError(51 /* DOMErrorCodes.X_V_HTML_NO_EXPRESSION */, loc));
|
|
18162
18212
|
}
|
|
18163
18213
|
if (node.children.length) {
|
|
18164
|
-
context.onError(createDOMCompilerError(
|
|
18214
|
+
context.onError(createDOMCompilerError(52 /* DOMErrorCodes.X_V_HTML_WITH_CHILDREN */, loc));
|
|
18165
18215
|
node.children.length = 0;
|
|
18166
18216
|
}
|
|
18167
18217
|
return {
|
|
@@ -18174,10 +18224,10 @@ const transformVHtml = (dir, node, context) => {
|
|
|
18174
18224
|
const transformVText = (dir, node, context) => {
|
|
18175
18225
|
const { exp, loc } = dir;
|
|
18176
18226
|
if (!exp) {
|
|
18177
|
-
context.onError(createDOMCompilerError(
|
|
18227
|
+
context.onError(createDOMCompilerError(53 /* DOMErrorCodes.X_V_TEXT_NO_EXPRESSION */, loc));
|
|
18178
18228
|
}
|
|
18179
18229
|
if (node.children.length) {
|
|
18180
|
-
context.onError(createDOMCompilerError(
|
|
18230
|
+
context.onError(createDOMCompilerError(54 /* DOMErrorCodes.X_V_TEXT_WITH_CHILDREN */, loc));
|
|
18181
18231
|
node.children.length = 0;
|
|
18182
18232
|
}
|
|
18183
18233
|
return {
|
|
@@ -18198,12 +18248,12 @@ const transformModel$1 = (dir, node, context) => {
|
|
|
18198
18248
|
return baseResult;
|
|
18199
18249
|
}
|
|
18200
18250
|
if (dir.arg) {
|
|
18201
|
-
context.onError(createDOMCompilerError(
|
|
18251
|
+
context.onError(createDOMCompilerError(56 /* DOMErrorCodes.X_V_MODEL_ARG_ON_ELEMENT */, dir.arg.loc));
|
|
18202
18252
|
}
|
|
18203
18253
|
function checkDuplicatedValue() {
|
|
18204
18254
|
const value = findProp(node, 'value');
|
|
18205
18255
|
if (value) {
|
|
18206
|
-
context.onError(createDOMCompilerError(
|
|
18256
|
+
context.onError(createDOMCompilerError(58 /* DOMErrorCodes.X_V_MODEL_UNNECESSARY_VALUE */, value.loc));
|
|
18207
18257
|
}
|
|
18208
18258
|
}
|
|
18209
18259
|
const { tag } = node;
|
|
@@ -18231,7 +18281,7 @@ const transformModel$1 = (dir, node, context) => {
|
|
|
18231
18281
|
break;
|
|
18232
18282
|
case 'file':
|
|
18233
18283
|
isInvalidType = true;
|
|
18234
|
-
context.onError(createDOMCompilerError(
|
|
18284
|
+
context.onError(createDOMCompilerError(57 /* DOMErrorCodes.X_V_MODEL_ON_FILE_INPUT_ELEMENT */, dir.loc));
|
|
18235
18285
|
break;
|
|
18236
18286
|
default:
|
|
18237
18287
|
// text type
|
|
@@ -18265,7 +18315,7 @@ const transformModel$1 = (dir, node, context) => {
|
|
|
18265
18315
|
}
|
|
18266
18316
|
}
|
|
18267
18317
|
else {
|
|
18268
|
-
context.onError(createDOMCompilerError(
|
|
18318
|
+
context.onError(createDOMCompilerError(55 /* DOMErrorCodes.X_V_MODEL_ON_INVALID_ELEMENT */, dir.loc));
|
|
18269
18319
|
}
|
|
18270
18320
|
// native vmodel doesn't need the `modelValue` props since they are also
|
|
18271
18321
|
// passed to the runtime as `binding.value`. removing it reduces code size.
|
|
@@ -18389,7 +18439,7 @@ const transformOn$1 = (dir, node, context) => {
|
|
|
18389
18439
|
const transformShow = (dir, node, context) => {
|
|
18390
18440
|
const { exp, loc } = dir;
|
|
18391
18441
|
if (!exp) {
|
|
18392
|
-
context.onError(createDOMCompilerError(
|
|
18442
|
+
context.onError(createDOMCompilerError(59 /* DOMErrorCodes.X_V_SHOW_NO_EXPRESSION */, loc));
|
|
18393
18443
|
}
|
|
18394
18444
|
return {
|
|
18395
18445
|
props: [],
|
|
@@ -18408,7 +18458,7 @@ const transformTransition = (node, context) => {
|
|
|
18408
18458
|
}
|
|
18409
18459
|
// warn multiple transition children
|
|
18410
18460
|
if (hasMultipleChildren(node)) {
|
|
18411
|
-
context.onError(createDOMCompilerError(
|
|
18461
|
+
context.onError(createDOMCompilerError(60 /* DOMErrorCodes.X_TRANSITION_INVALID_CHILDREN */, {
|
|
18412
18462
|
start: node.children[0].loc.start,
|
|
18413
18463
|
end: node.children[node.children.length - 1].loc.end,
|
|
18414
18464
|
source: ''
|
|
@@ -18447,7 +18497,7 @@ const ignoreSideEffectTags = (node, context) => {
|
|
|
18447
18497
|
if (node.type === 1 /* NodeTypes.ELEMENT */ &&
|
|
18448
18498
|
node.tagType === 0 /* ElementTypes.ELEMENT */ &&
|
|
18449
18499
|
(node.tag === 'script' || node.tag === 'style')) {
|
|
18450
|
-
context.onError(createDOMCompilerError(
|
|
18500
|
+
context.onError(createDOMCompilerError(61 /* DOMErrorCodes.X_IGNORED_SIDE_EFFECT_TAG */, node.loc));
|
|
18451
18501
|
context.removeNode();
|
|
18452
18502
|
}
|
|
18453
18503
|
};
|