@vue/compat 3.2.43 → 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 +167 -115
- package/dist/vue.cjs.prod.js +143 -86
- package/dist/vue.esm-browser.js +176 -118
- package/dist/vue.esm-browser.prod.js +1 -1
- package/dist/vue.esm-bundler.js +177 -120
- package/dist/vue.global.js +176 -118
- package/dist/vue.global.prod.js +1 -1
- package/dist/vue.runtime.esm-browser.js +132 -81
- package/dist/vue.runtime.esm-browser.prod.js +1 -1
- package/dist/vue.runtime.esm-bundler.js +133 -83
- package/dist/vue.runtime.global.js +132 -81
- package/dist/vue.runtime.global.prod.js +1 -1
- package/package.json +2 -2
package/dist/vue.global.js
CHANGED
|
@@ -2101,12 +2101,6 @@ var Vue = (function () {
|
|
|
2101
2101
|
// components to be unmounted and re-mounted. Queue the update so that we
|
|
2102
2102
|
// don't end up forcing the same parent to re-render multiple times.
|
|
2103
2103
|
queueJob(instance.parent.update);
|
|
2104
|
-
// instance is the inner component of an async custom element
|
|
2105
|
-
// invoke to reset styles
|
|
2106
|
-
if (instance.parent.type.__asyncLoader &&
|
|
2107
|
-
instance.parent.ceReload) {
|
|
2108
|
-
instance.parent.ceReload(newComp.styles);
|
|
2109
|
-
}
|
|
2110
2104
|
}
|
|
2111
2105
|
else if (instance.appContext.reload) {
|
|
2112
2106
|
// root instance mounted via createApp() has a reload method
|
|
@@ -2337,8 +2331,8 @@ var Vue = (function () {
|
|
|
2337
2331
|
},
|
|
2338
2332
|
["INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */]: {
|
|
2339
2333
|
message: event => `"${event}" lifecycle events are no longer supported. From templates, ` +
|
|
2340
|
-
`use the "
|
|
2341
|
-
`should be changed to @
|
|
2334
|
+
`use the "vue:" prefix instead of "hook:". For example, @${event} ` +
|
|
2335
|
+
`should be changed to @vue:${event.slice(5)}. ` +
|
|
2342
2336
|
`From JavaScript, use Composition API to dynamically register lifecycle ` +
|
|
2343
2337
|
`hooks.`,
|
|
2344
2338
|
link: `https://v3-migration.vuejs.org/breaking-changes/vnode-lifecycle-events.html`
|
|
@@ -3915,10 +3909,11 @@ var Vue = (function () {
|
|
|
3915
3909
|
callWithAsyncErrorHandling(cb, instance, 3 /* ErrorCodes.WATCH_CALLBACK */, [
|
|
3916
3910
|
newValue,
|
|
3917
3911
|
// pass undefined as the old value when it's changed for the first time
|
|
3918
|
-
oldValue === INITIAL_WATCHER_VALUE
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3912
|
+
oldValue === INITIAL_WATCHER_VALUE
|
|
3913
|
+
? undefined
|
|
3914
|
+
: (isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE)
|
|
3915
|
+
? []
|
|
3916
|
+
: oldValue,
|
|
3922
3917
|
onCleanup
|
|
3923
3918
|
]);
|
|
3924
3919
|
oldValue = newValue;
|
|
@@ -4518,10 +4513,15 @@ var Vue = (function () {
|
|
|
4518
4513
|
}
|
|
4519
4514
|
});
|
|
4520
4515
|
}
|
|
4521
|
-
function createInnerComp(comp,
|
|
4516
|
+
function createInnerComp(comp, parent) {
|
|
4517
|
+
const { ref, props, children, ce } = parent.vnode;
|
|
4522
4518
|
const vnode = createVNode(comp, props, children);
|
|
4523
4519
|
// ensure inner component inherits the async wrapper's ref owner
|
|
4524
4520
|
vnode.ref = ref;
|
|
4521
|
+
// pass the custom element callback on to the inner comp
|
|
4522
|
+
// and remove it from the async wrapper
|
|
4523
|
+
vnode.ce = ce;
|
|
4524
|
+
delete parent.vnode.ce;
|
|
4525
4525
|
return vnode;
|
|
4526
4526
|
}
|
|
4527
4527
|
|
|
@@ -4679,8 +4679,7 @@ var Vue = (function () {
|
|
|
4679
4679
|
: comp);
|
|
4680
4680
|
const { include, exclude, max } = props;
|
|
4681
4681
|
if ((include && (!name || !matches(include, name))) ||
|
|
4682
|
-
(exclude && name && matches(exclude, name))
|
|
4683
|
-
(hmrDirtyComponents.has(comp))) {
|
|
4682
|
+
(exclude && name && matches(exclude, name))) {
|
|
4684
4683
|
current = vnode;
|
|
4685
4684
|
return rawVNode;
|
|
4686
4685
|
}
|
|
@@ -4793,14 +4792,9 @@ var Vue = (function () {
|
|
|
4793
4792
|
}, target);
|
|
4794
4793
|
}
|
|
4795
4794
|
function resetShapeFlag(vnode) {
|
|
4796
|
-
|
|
4797
|
-
|
|
4798
|
-
|
|
4799
|
-
}
|
|
4800
|
-
if (shapeFlag & 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */) {
|
|
4801
|
-
shapeFlag -= 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
|
|
4802
|
-
}
|
|
4803
|
-
vnode.shapeFlag = shapeFlag;
|
|
4795
|
+
// bitwise operations to remove keep alive flags
|
|
4796
|
+
vnode.shapeFlag &= ~256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */;
|
|
4797
|
+
vnode.shapeFlag &= ~512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
|
|
4804
4798
|
}
|
|
4805
4799
|
function getInnerChild(vnode) {
|
|
4806
4800
|
return vnode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */ ? vnode.ssContent : vnode;
|
|
@@ -5428,7 +5422,9 @@ var Vue = (function () {
|
|
|
5428
5422
|
(currentRenderingInstance.parent &&
|
|
5429
5423
|
isAsyncWrapper(currentRenderingInstance.parent) &&
|
|
5430
5424
|
currentRenderingInstance.parent.isCE)) {
|
|
5431
|
-
|
|
5425
|
+
if (name !== 'default')
|
|
5426
|
+
props.name = name;
|
|
5427
|
+
return createVNode('slot', props, fallback && fallback());
|
|
5432
5428
|
}
|
|
5433
5429
|
let slot = slots[name];
|
|
5434
5430
|
if (slot && slot.length > 1) {
|
|
@@ -5748,6 +5744,7 @@ var Vue = (function () {
|
|
|
5748
5744
|
installCompatInstanceProperties(publicPropertiesMap);
|
|
5749
5745
|
}
|
|
5750
5746
|
const isReservedPrefix = (key) => key === '_' || key === '$';
|
|
5747
|
+
const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
|
|
5751
5748
|
const PublicInstanceProxyHandlers = {
|
|
5752
5749
|
get({ _: instance }, key) {
|
|
5753
5750
|
const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
|
|
@@ -5755,15 +5752,6 @@ var Vue = (function () {
|
|
|
5755
5752
|
if (key === '__isVue') {
|
|
5756
5753
|
return true;
|
|
5757
5754
|
}
|
|
5758
|
-
// prioritize <script setup> bindings during dev.
|
|
5759
|
-
// this allows even properties that start with _ or $ to be used - so that
|
|
5760
|
-
// it aligns with the production behavior where the render fn is inlined and
|
|
5761
|
-
// indeed has access to all declared variables.
|
|
5762
|
-
if (setupState !== EMPTY_OBJ &&
|
|
5763
|
-
setupState.__isScriptSetup &&
|
|
5764
|
-
hasOwn(setupState, key)) {
|
|
5765
|
-
return setupState[key];
|
|
5766
|
-
}
|
|
5767
5755
|
// data / props / ctx
|
|
5768
5756
|
// This getter gets called for every property access on the render context
|
|
5769
5757
|
// during render and is a major hotspot. The most expensive part of this
|
|
@@ -5786,7 +5774,7 @@ var Vue = (function () {
|
|
|
5786
5774
|
// default: just fallthrough
|
|
5787
5775
|
}
|
|
5788
5776
|
}
|
|
5789
|
-
else if (
|
|
5777
|
+
else if (hasSetupBinding(setupState, key)) {
|
|
5790
5778
|
accessCache[key] = 1 /* AccessTypes.SETUP */;
|
|
5791
5779
|
return setupState[key];
|
|
5792
5780
|
}
|
|
@@ -5865,21 +5853,26 @@ var Vue = (function () {
|
|
|
5865
5853
|
},
|
|
5866
5854
|
set({ _: instance }, key, value) {
|
|
5867
5855
|
const { data, setupState, ctx } = instance;
|
|
5868
|
-
if (
|
|
5856
|
+
if (hasSetupBinding(setupState, key)) {
|
|
5869
5857
|
setupState[key] = value;
|
|
5870
5858
|
return true;
|
|
5871
5859
|
}
|
|
5860
|
+
else if (setupState.__isScriptSetup &&
|
|
5861
|
+
hasOwn(setupState, key)) {
|
|
5862
|
+
warn$1(`Cannot mutate <script setup> binding "${key}" from Options API.`);
|
|
5863
|
+
return false;
|
|
5864
|
+
}
|
|
5872
5865
|
else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
|
|
5873
5866
|
data[key] = value;
|
|
5874
5867
|
return true;
|
|
5875
5868
|
}
|
|
5876
5869
|
else if (hasOwn(instance.props, key)) {
|
|
5877
|
-
warn$1(`Attempting to mutate prop "${key}". Props are readonly
|
|
5870
|
+
warn$1(`Attempting to mutate prop "${key}". Props are readonly.`);
|
|
5878
5871
|
return false;
|
|
5879
5872
|
}
|
|
5880
5873
|
if (key[0] === '$' && key.slice(1) in instance) {
|
|
5881
5874
|
warn$1(`Attempting to mutate public property "${key}". ` +
|
|
5882
|
-
`Properties starting with $ are reserved and readonly
|
|
5875
|
+
`Properties starting with $ are reserved and readonly.`);
|
|
5883
5876
|
return false;
|
|
5884
5877
|
}
|
|
5885
5878
|
else {
|
|
@@ -5900,7 +5893,7 @@ var Vue = (function () {
|
|
|
5900
5893
|
let normalizedProps;
|
|
5901
5894
|
return (!!accessCache[key] ||
|
|
5902
5895
|
(data !== EMPTY_OBJ && hasOwn(data, key)) ||
|
|
5903
|
-
(setupState
|
|
5896
|
+
hasSetupBinding(setupState, key) ||
|
|
5904
5897
|
((normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key)) ||
|
|
5905
5898
|
hasOwn(ctx, key) ||
|
|
5906
5899
|
hasOwn(publicPropertiesMap, key) ||
|
|
@@ -7175,7 +7168,7 @@ var Vue = (function () {
|
|
|
7175
7168
|
return vm;
|
|
7176
7169
|
}
|
|
7177
7170
|
}
|
|
7178
|
-
Vue.version = `2.6.14-compat:${"3.2.
|
|
7171
|
+
Vue.version = `2.6.14-compat:${"3.2.45"}`;
|
|
7179
7172
|
Vue.config = singletonApp.config;
|
|
7180
7173
|
Vue.use = (p, ...options) => {
|
|
7181
7174
|
if (p && isFunction(p.install)) {
|
|
@@ -9562,6 +9555,10 @@ var Vue = (function () {
|
|
|
9562
9555
|
if (!shallow)
|
|
9563
9556
|
traverseStaticChildren(c1, c2);
|
|
9564
9557
|
}
|
|
9558
|
+
// #6852 also inherit for text nodes
|
|
9559
|
+
if (c2.type === Text) {
|
|
9560
|
+
c2.el = c1.el;
|
|
9561
|
+
}
|
|
9565
9562
|
// also inherit for comment nodes, but not placeholders (e.g. v-if which
|
|
9566
9563
|
// would have received .el during block patch)
|
|
9567
9564
|
if (c2.type === Comment && !c2.el) {
|
|
@@ -9732,6 +9729,7 @@ var Vue = (function () {
|
|
|
9732
9729
|
}
|
|
9733
9730
|
}
|
|
9734
9731
|
}
|
|
9732
|
+
updateCssVars(n2);
|
|
9735
9733
|
},
|
|
9736
9734
|
remove(vnode, parentComponent, parentSuspense, optimized, { um: unmount, o: { remove: hostRemove } }, doRemove) {
|
|
9737
9735
|
const { shapeFlag, children, anchor, targetAnchor, target, props } = vnode;
|
|
@@ -9810,11 +9808,26 @@ var Vue = (function () {
|
|
|
9810
9808
|
hydrateChildren(targetNode, vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
9811
9809
|
}
|
|
9812
9810
|
}
|
|
9811
|
+
updateCssVars(vnode);
|
|
9813
9812
|
}
|
|
9814
9813
|
return vnode.anchor && nextSibling(vnode.anchor);
|
|
9815
9814
|
}
|
|
9816
9815
|
// Force-casted public typing for h and TSX props inference
|
|
9817
9816
|
const Teleport = TeleportImpl;
|
|
9817
|
+
function updateCssVars(vnode) {
|
|
9818
|
+
// presence of .ut method indicates owner component uses css vars.
|
|
9819
|
+
// code path here can assume browser environment.
|
|
9820
|
+
const ctx = vnode.ctx;
|
|
9821
|
+
if (ctx && ctx.ut) {
|
|
9822
|
+
let node = vnode.children[0].el;
|
|
9823
|
+
while (node !== vnode.targetAnchor) {
|
|
9824
|
+
if (node.nodeType === 1)
|
|
9825
|
+
node.setAttribute('data-v-owner', ctx.uid);
|
|
9826
|
+
node = node.nextSibling;
|
|
9827
|
+
}
|
|
9828
|
+
ctx.ut();
|
|
9829
|
+
}
|
|
9830
|
+
}
|
|
9818
9831
|
|
|
9819
9832
|
const normalizedAsyncComponentMap = new Map();
|
|
9820
9833
|
function convertLegacyAsyncComponent(comp) {
|
|
@@ -9969,6 +9982,10 @@ var Vue = (function () {
|
|
|
9969
9982
|
function isSameVNodeType(n1, n2) {
|
|
9970
9983
|
if (n2.shapeFlag & 6 /* ShapeFlags.COMPONENT */ &&
|
|
9971
9984
|
hmrDirtyComponents.has(n2.type)) {
|
|
9985
|
+
// #7042, ensure the vnode being unmounted during HMR
|
|
9986
|
+
// bitwise operations to remove keep alive flags
|
|
9987
|
+
n1.shapeFlag &= ~256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */;
|
|
9988
|
+
n2.shapeFlag &= ~512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
|
|
9972
9989
|
// HMR only: if the component has been hot-updated, force a reload.
|
|
9973
9990
|
return false;
|
|
9974
9991
|
}
|
|
@@ -10024,7 +10041,8 @@ var Vue = (function () {
|
|
|
10024
10041
|
patchFlag,
|
|
10025
10042
|
dynamicProps,
|
|
10026
10043
|
dynamicChildren: null,
|
|
10027
|
-
appContext: null
|
|
10044
|
+
appContext: null,
|
|
10045
|
+
ctx: currentRenderingInstance
|
|
10028
10046
|
};
|
|
10029
10047
|
if (needFullChildrenNormalization) {
|
|
10030
10048
|
normalizeChildren(vnode, children);
|
|
@@ -10199,7 +10217,8 @@ var Vue = (function () {
|
|
|
10199
10217
|
ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
|
|
10200
10218
|
ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
|
|
10201
10219
|
el: vnode.el,
|
|
10202
|
-
anchor: vnode.anchor
|
|
10220
|
+
anchor: vnode.anchor,
|
|
10221
|
+
ctx: vnode.ctx
|
|
10203
10222
|
};
|
|
10204
10223
|
{
|
|
10205
10224
|
defineLegacyVNodeProperties(cloned);
|
|
@@ -11182,7 +11201,7 @@ var Vue = (function () {
|
|
|
11182
11201
|
}
|
|
11183
11202
|
|
|
11184
11203
|
// Core API ------------------------------------------------------------------
|
|
11185
|
-
const version = "3.2.
|
|
11204
|
+
const version = "3.2.45";
|
|
11186
11205
|
/**
|
|
11187
11206
|
* SSR utils for \@vue/server-renderer. Only exposed in ssr-possible builds.
|
|
11188
11207
|
* @internal
|
|
@@ -11335,6 +11354,7 @@ var Vue = (function () {
|
|
|
11335
11354
|
}
|
|
11336
11355
|
}
|
|
11337
11356
|
}
|
|
11357
|
+
const semicolonRE = /[^\\];\s*$/;
|
|
11338
11358
|
const importantRE = /\s*!important$/;
|
|
11339
11359
|
function setStyle(style, name, val) {
|
|
11340
11360
|
if (isArray(val)) {
|
|
@@ -11343,6 +11363,11 @@ var Vue = (function () {
|
|
|
11343
11363
|
else {
|
|
11344
11364
|
if (val == null)
|
|
11345
11365
|
val = '';
|
|
11366
|
+
{
|
|
11367
|
+
if (semicolonRE.test(val)) {
|
|
11368
|
+
warn$1(`Unexpected semicolon at the end of '${name}' style value: '${val}'`);
|
|
11369
|
+
}
|
|
11370
|
+
}
|
|
11346
11371
|
if (name.startsWith('--')) {
|
|
11347
11372
|
// custom property definition
|
|
11348
11373
|
style.setProperty(name, val);
|
|
@@ -11710,12 +11735,21 @@ var Vue = (function () {
|
|
|
11710
11735
|
`defined as hydratable. Use \`defineSSRCustomElement\`.`);
|
|
11711
11736
|
}
|
|
11712
11737
|
this.attachShadow({ mode: 'open' });
|
|
11738
|
+
if (!this._def.__asyncLoader) {
|
|
11739
|
+
// for sync component defs we can immediately resolve props
|
|
11740
|
+
this._resolveProps(this._def);
|
|
11741
|
+
}
|
|
11713
11742
|
}
|
|
11714
11743
|
}
|
|
11715
11744
|
connectedCallback() {
|
|
11716
11745
|
this._connected = true;
|
|
11717
11746
|
if (!this._instance) {
|
|
11718
|
-
this.
|
|
11747
|
+
if (this._resolved) {
|
|
11748
|
+
this._update();
|
|
11749
|
+
}
|
|
11750
|
+
else {
|
|
11751
|
+
this._resolveDef();
|
|
11752
|
+
}
|
|
11719
11753
|
}
|
|
11720
11754
|
}
|
|
11721
11755
|
disconnectedCallback() {
|
|
@@ -11731,9 +11765,6 @@ var Vue = (function () {
|
|
|
11731
11765
|
* resolve inner component definition (handle possible async component)
|
|
11732
11766
|
*/
|
|
11733
11767
|
_resolveDef() {
|
|
11734
|
-
if (this._resolved) {
|
|
11735
|
-
return;
|
|
11736
|
-
}
|
|
11737
11768
|
this._resolved = true;
|
|
11738
11769
|
// set initial attrs
|
|
11739
11770
|
for (let i = 0; i < this.attributes.length; i++) {
|
|
@@ -11745,38 +11776,26 @@ var Vue = (function () {
|
|
|
11745
11776
|
this._setAttr(m.attributeName);
|
|
11746
11777
|
}
|
|
11747
11778
|
}).observe(this, { attributes: true });
|
|
11748
|
-
const resolve = (def) => {
|
|
11749
|
-
const { props
|
|
11750
|
-
const hasOptions = !isArray(props);
|
|
11751
|
-
const rawKeys = props ? (hasOptions ? Object.keys(props) : props) : [];
|
|
11779
|
+
const resolve = (def, isAsync = false) => {
|
|
11780
|
+
const { props, styles } = def;
|
|
11752
11781
|
// cast Number-type props set before resolve
|
|
11753
11782
|
let numberProps;
|
|
11754
|
-
if (
|
|
11755
|
-
for (const key in
|
|
11783
|
+
if (props && !isArray(props)) {
|
|
11784
|
+
for (const key in props) {
|
|
11756
11785
|
const opt = props[key];
|
|
11757
11786
|
if (opt === Number || (opt && opt.type === Number)) {
|
|
11758
|
-
|
|
11759
|
-
|
|
11787
|
+
if (key in this._props) {
|
|
11788
|
+
this._props[key] = toNumber(this._props[key]);
|
|
11789
|
+
}
|
|
11790
|
+
(numberProps || (numberProps = Object.create(null)))[camelize(key)] = true;
|
|
11760
11791
|
}
|
|
11761
11792
|
}
|
|
11762
11793
|
}
|
|
11763
11794
|
this._numberProps = numberProps;
|
|
11764
|
-
|
|
11765
|
-
|
|
11766
|
-
|
|
11767
|
-
|
|
11768
|
-
}
|
|
11769
|
-
}
|
|
11770
|
-
// defining getter/setters on prototype
|
|
11771
|
-
for (const key of rawKeys.map(camelize)) {
|
|
11772
|
-
Object.defineProperty(this, key, {
|
|
11773
|
-
get() {
|
|
11774
|
-
return this._getProp(key);
|
|
11775
|
-
},
|
|
11776
|
-
set(val) {
|
|
11777
|
-
this._setProp(key, val);
|
|
11778
|
-
}
|
|
11779
|
-
});
|
|
11795
|
+
if (isAsync) {
|
|
11796
|
+
// defining getter/setters on prototype
|
|
11797
|
+
// for sync defs, this already happened in the constructor
|
|
11798
|
+
this._resolveProps(def);
|
|
11780
11799
|
}
|
|
11781
11800
|
// apply CSS
|
|
11782
11801
|
this._applyStyles(styles);
|
|
@@ -11785,12 +11804,33 @@ var Vue = (function () {
|
|
|
11785
11804
|
};
|
|
11786
11805
|
const asyncDef = this._def.__asyncLoader;
|
|
11787
11806
|
if (asyncDef) {
|
|
11788
|
-
asyncDef().then(resolve);
|
|
11807
|
+
asyncDef().then(def => resolve(def, true));
|
|
11789
11808
|
}
|
|
11790
11809
|
else {
|
|
11791
11810
|
resolve(this._def);
|
|
11792
11811
|
}
|
|
11793
11812
|
}
|
|
11813
|
+
_resolveProps(def) {
|
|
11814
|
+
const { props } = def;
|
|
11815
|
+
const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
|
|
11816
|
+
// check if there are props set pre-upgrade or connect
|
|
11817
|
+
for (const key of Object.keys(this)) {
|
|
11818
|
+
if (key[0] !== '_' && declaredPropKeys.includes(key)) {
|
|
11819
|
+
this._setProp(key, this[key], true, false);
|
|
11820
|
+
}
|
|
11821
|
+
}
|
|
11822
|
+
// defining getter/setters on prototype
|
|
11823
|
+
for (const key of declaredPropKeys.map(camelize)) {
|
|
11824
|
+
Object.defineProperty(this, key, {
|
|
11825
|
+
get() {
|
|
11826
|
+
return this._getProp(key);
|
|
11827
|
+
},
|
|
11828
|
+
set(val) {
|
|
11829
|
+
this._setProp(key, val);
|
|
11830
|
+
}
|
|
11831
|
+
});
|
|
11832
|
+
}
|
|
11833
|
+
}
|
|
11794
11834
|
_setAttr(key) {
|
|
11795
11835
|
let value = this.getAttribute(key);
|
|
11796
11836
|
const camelKey = camelize(key);
|
|
@@ -11846,27 +11886,31 @@ var Vue = (function () {
|
|
|
11846
11886
|
this._styles.length = 0;
|
|
11847
11887
|
}
|
|
11848
11888
|
this._applyStyles(newStyles);
|
|
11849
|
-
|
|
11850
|
-
|
|
11851
|
-
if (!this._def.__asyncLoader) {
|
|
11852
|
-
// reload
|
|
11853
|
-
this._instance = null;
|
|
11854
|
-
this._update();
|
|
11855
|
-
}
|
|
11889
|
+
this._instance = null;
|
|
11890
|
+
this._update();
|
|
11856
11891
|
};
|
|
11857
11892
|
}
|
|
11858
|
-
|
|
11859
|
-
instance.emit = (event, ...args) => {
|
|
11893
|
+
const dispatch = (event, args) => {
|
|
11860
11894
|
this.dispatchEvent(new CustomEvent(event, {
|
|
11861
11895
|
detail: args
|
|
11862
11896
|
}));
|
|
11863
11897
|
};
|
|
11898
|
+
// intercept emit
|
|
11899
|
+
instance.emit = (event, ...args) => {
|
|
11900
|
+
// dispatch both the raw and hyphenated versions of an event
|
|
11901
|
+
// to match Vue behavior
|
|
11902
|
+
dispatch(event, args);
|
|
11903
|
+
if (hyphenate(event) !== event) {
|
|
11904
|
+
dispatch(hyphenate(event), args);
|
|
11905
|
+
}
|
|
11906
|
+
};
|
|
11864
11907
|
// locate nearest Vue custom element parent for provide/inject
|
|
11865
11908
|
let parent = this;
|
|
11866
11909
|
while ((parent =
|
|
11867
11910
|
parent && (parent.parentNode || parent.host))) {
|
|
11868
11911
|
if (parent instanceof VueElement) {
|
|
11869
11912
|
instance.parent = parent._instance;
|
|
11913
|
+
instance.provides = parent._instance.provides;
|
|
11870
11914
|
break;
|
|
11871
11915
|
}
|
|
11872
11916
|
}
|
|
@@ -11910,7 +11954,14 @@ var Vue = (function () {
|
|
|
11910
11954
|
warn$1(`useCssVars is called without current active component instance.`);
|
|
11911
11955
|
return;
|
|
11912
11956
|
}
|
|
11913
|
-
const
|
|
11957
|
+
const updateTeleports = (instance.ut = (vars = getter(instance.proxy)) => {
|
|
11958
|
+
Array.from(document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)).forEach(node => setVarsOnNode(node, vars));
|
|
11959
|
+
});
|
|
11960
|
+
const setVars = () => {
|
|
11961
|
+
const vars = getter(instance.proxy);
|
|
11962
|
+
setVarsOnVNode(instance.subTree, vars);
|
|
11963
|
+
updateTeleports(vars);
|
|
11964
|
+
};
|
|
11914
11965
|
watchPostEffect(setVars);
|
|
11915
11966
|
onMounted(() => {
|
|
11916
11967
|
const ob = new MutationObserver(setVars);
|
|
@@ -13171,15 +13222,16 @@ var Vue = (function () {
|
|
|
13171
13222
|
[41 /* ErrorCodes.X_V_MODEL_NO_EXPRESSION */]: `v-model is missing expression.`,
|
|
13172
13223
|
[42 /* ErrorCodes.X_V_MODEL_MALFORMED_EXPRESSION */]: `v-model value must be a valid JavaScript member expression.`,
|
|
13173
13224
|
[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.`,
|
|
13174
|
-
[44 /* ErrorCodes.
|
|
13175
|
-
[45 /* ErrorCodes.
|
|
13225
|
+
[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.`,
|
|
13226
|
+
[45 /* ErrorCodes.X_INVALID_EXPRESSION */]: `Error parsing JavaScript expression: `,
|
|
13227
|
+
[46 /* ErrorCodes.X_KEEP_ALIVE_INVALID_CHILDREN */]: `<KeepAlive> expects exactly one child component.`,
|
|
13176
13228
|
// generic errors
|
|
13177
|
-
[
|
|
13178
|
-
[
|
|
13179
|
-
[
|
|
13180
|
-
[
|
|
13229
|
+
[47 /* ErrorCodes.X_PREFIX_ID_NOT_SUPPORTED */]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
|
|
13230
|
+
[48 /* ErrorCodes.X_MODULE_MODE_NOT_SUPPORTED */]: `ES module mode is not supported in this build of compiler.`,
|
|
13231
|
+
[49 /* ErrorCodes.X_CACHE_HANDLER_NOT_SUPPORTED */]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
|
|
13232
|
+
[50 /* ErrorCodes.X_SCOPE_ID_NOT_SUPPORTED */]: `"scopeId" option is only supported in module mode.`,
|
|
13181
13233
|
// just to fulfill types
|
|
13182
|
-
[
|
|
13234
|
+
[51 /* ErrorCodes.__EXTEND_POINT__ */]: ``
|
|
13183
13235
|
};
|
|
13184
13236
|
|
|
13185
13237
|
const FRAGMENT = Symbol(`Fragment` );
|
|
@@ -15804,7 +15856,7 @@ var Vue = (function () {
|
|
|
15804
15856
|
if (keywordMatch) {
|
|
15805
15857
|
message = `avoid using JavaScript keyword as property name: "${keywordMatch[0]}"`;
|
|
15806
15858
|
}
|
|
15807
|
-
context.onError(createCompilerError(
|
|
15859
|
+
context.onError(createCompilerError(45 /* ErrorCodes.X_INVALID_EXPRESSION */, node.loc, undefined, message));
|
|
15808
15860
|
}
|
|
15809
15861
|
}
|
|
15810
15862
|
|
|
@@ -16598,7 +16650,7 @@ var Vue = (function () {
|
|
|
16598
16650
|
// 2. Force keep-alive to always be updated, since it uses raw children.
|
|
16599
16651
|
patchFlag |= 1024 /* PatchFlags.DYNAMIC_SLOTS */;
|
|
16600
16652
|
if (node.children.length > 1) {
|
|
16601
|
-
context.onError(createCompilerError(
|
|
16653
|
+
context.onError(createCompilerError(46 /* ErrorCodes.X_KEEP_ALIVE_INVALID_CHILDREN */, {
|
|
16602
16654
|
start: node.children[0].loc.start,
|
|
16603
16655
|
end: node.children[node.children.length - 1].loc.end,
|
|
16604
16656
|
source: ''
|
|
@@ -17453,8 +17505,14 @@ var Vue = (function () {
|
|
|
17453
17505
|
const expString = exp.type === 4 /* NodeTypes.SIMPLE_EXPRESSION */ ? exp.content : rawExp;
|
|
17454
17506
|
// im SFC <script setup> inline mode, the exp may have been transformed into
|
|
17455
17507
|
// _unref(exp)
|
|
17456
|
-
context.bindingMetadata[rawExp];
|
|
17457
|
-
|
|
17508
|
+
const bindingType = context.bindingMetadata[rawExp];
|
|
17509
|
+
// check props
|
|
17510
|
+
if (bindingType === "props" /* BindingTypes.PROPS */ ||
|
|
17511
|
+
bindingType === "props-aliased" /* BindingTypes.PROPS_ALIASED */) {
|
|
17512
|
+
context.onError(createCompilerError(44 /* ErrorCodes.X_V_MODEL_ON_PROPS */, exp.loc));
|
|
17513
|
+
return createTransformProps();
|
|
17514
|
+
}
|
|
17515
|
+
const maybeRef = !true ;
|
|
17458
17516
|
if (!expString.trim() ||
|
|
17459
17517
|
(!isMemberExpression(expString) && !maybeRef)) {
|
|
17460
17518
|
context.onError(createCompilerError(42 /* ErrorCodes.X_V_MODEL_MALFORMED_EXPRESSION */, exp.loc));
|
|
@@ -17721,18 +17779,18 @@ var Vue = (function () {
|
|
|
17721
17779
|
/* istanbul ignore if */
|
|
17722
17780
|
{
|
|
17723
17781
|
if (options.prefixIdentifiers === true) {
|
|
17724
|
-
onError(createCompilerError(
|
|
17782
|
+
onError(createCompilerError(47 /* ErrorCodes.X_PREFIX_ID_NOT_SUPPORTED */));
|
|
17725
17783
|
}
|
|
17726
17784
|
else if (isModuleMode) {
|
|
17727
|
-
onError(createCompilerError(
|
|
17785
|
+
onError(createCompilerError(48 /* ErrorCodes.X_MODULE_MODE_NOT_SUPPORTED */));
|
|
17728
17786
|
}
|
|
17729
17787
|
}
|
|
17730
17788
|
const prefixIdentifiers = !true ;
|
|
17731
17789
|
if (options.cacheHandlers) {
|
|
17732
|
-
onError(createCompilerError(
|
|
17790
|
+
onError(createCompilerError(49 /* ErrorCodes.X_CACHE_HANDLER_NOT_SUPPORTED */));
|
|
17733
17791
|
}
|
|
17734
17792
|
if (options.scopeId && !isModuleMode) {
|
|
17735
|
-
onError(createCompilerError(
|
|
17793
|
+
onError(createCompilerError(50 /* ErrorCodes.X_SCOPE_ID_NOT_SUPPORTED */));
|
|
17736
17794
|
}
|
|
17737
17795
|
const ast = isString(template) ? baseParse(template, options) : template;
|
|
17738
17796
|
const [nodeTransforms, directiveTransforms] = getBaseTransformPreset();
|
|
@@ -17890,26 +17948,26 @@ var Vue = (function () {
|
|
|
17890
17948
|
return createCompilerError(code, loc, DOMErrorMessages );
|
|
17891
17949
|
}
|
|
17892
17950
|
const DOMErrorMessages = {
|
|
17893
|
-
[
|
|
17894
|
-
[
|
|
17895
|
-
[
|
|
17896
|
-
[
|
|
17897
|
-
[
|
|
17898
|
-
[
|
|
17899
|
-
[
|
|
17900
|
-
[
|
|
17901
|
-
[
|
|
17902
|
-
[
|
|
17903
|
-
[
|
|
17951
|
+
[51 /* DOMErrorCodes.X_V_HTML_NO_EXPRESSION */]: `v-html is missing expression.`,
|
|
17952
|
+
[52 /* DOMErrorCodes.X_V_HTML_WITH_CHILDREN */]: `v-html will override element children.`,
|
|
17953
|
+
[53 /* DOMErrorCodes.X_V_TEXT_NO_EXPRESSION */]: `v-text is missing expression.`,
|
|
17954
|
+
[54 /* DOMErrorCodes.X_V_TEXT_WITH_CHILDREN */]: `v-text will override element children.`,
|
|
17955
|
+
[55 /* DOMErrorCodes.X_V_MODEL_ON_INVALID_ELEMENT */]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
|
|
17956
|
+
[56 /* DOMErrorCodes.X_V_MODEL_ARG_ON_ELEMENT */]: `v-model argument is not supported on plain elements.`,
|
|
17957
|
+
[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.`,
|
|
17958
|
+
[58 /* DOMErrorCodes.X_V_MODEL_UNNECESSARY_VALUE */]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
|
|
17959
|
+
[59 /* DOMErrorCodes.X_V_SHOW_NO_EXPRESSION */]: `v-show is missing expression.`,
|
|
17960
|
+
[60 /* DOMErrorCodes.X_TRANSITION_INVALID_CHILDREN */]: `<Transition> expects exactly one child element or component.`,
|
|
17961
|
+
[61 /* DOMErrorCodes.X_IGNORED_SIDE_EFFECT_TAG */]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`
|
|
17904
17962
|
};
|
|
17905
17963
|
|
|
17906
17964
|
const transformVHtml = (dir, node, context) => {
|
|
17907
17965
|
const { exp, loc } = dir;
|
|
17908
17966
|
if (!exp) {
|
|
17909
|
-
context.onError(createDOMCompilerError(
|
|
17967
|
+
context.onError(createDOMCompilerError(51 /* DOMErrorCodes.X_V_HTML_NO_EXPRESSION */, loc));
|
|
17910
17968
|
}
|
|
17911
17969
|
if (node.children.length) {
|
|
17912
|
-
context.onError(createDOMCompilerError(
|
|
17970
|
+
context.onError(createDOMCompilerError(52 /* DOMErrorCodes.X_V_HTML_WITH_CHILDREN */, loc));
|
|
17913
17971
|
node.children.length = 0;
|
|
17914
17972
|
}
|
|
17915
17973
|
return {
|
|
@@ -17922,10 +17980,10 @@ var Vue = (function () {
|
|
|
17922
17980
|
const transformVText = (dir, node, context) => {
|
|
17923
17981
|
const { exp, loc } = dir;
|
|
17924
17982
|
if (!exp) {
|
|
17925
|
-
context.onError(createDOMCompilerError(
|
|
17983
|
+
context.onError(createDOMCompilerError(53 /* DOMErrorCodes.X_V_TEXT_NO_EXPRESSION */, loc));
|
|
17926
17984
|
}
|
|
17927
17985
|
if (node.children.length) {
|
|
17928
|
-
context.onError(createDOMCompilerError(
|
|
17986
|
+
context.onError(createDOMCompilerError(54 /* DOMErrorCodes.X_V_TEXT_WITH_CHILDREN */, loc));
|
|
17929
17987
|
node.children.length = 0;
|
|
17930
17988
|
}
|
|
17931
17989
|
return {
|
|
@@ -17946,12 +18004,12 @@ var Vue = (function () {
|
|
|
17946
18004
|
return baseResult;
|
|
17947
18005
|
}
|
|
17948
18006
|
if (dir.arg) {
|
|
17949
|
-
context.onError(createDOMCompilerError(
|
|
18007
|
+
context.onError(createDOMCompilerError(56 /* DOMErrorCodes.X_V_MODEL_ARG_ON_ELEMENT */, dir.arg.loc));
|
|
17950
18008
|
}
|
|
17951
18009
|
function checkDuplicatedValue() {
|
|
17952
18010
|
const value = findProp(node, 'value');
|
|
17953
18011
|
if (value) {
|
|
17954
|
-
context.onError(createDOMCompilerError(
|
|
18012
|
+
context.onError(createDOMCompilerError(58 /* DOMErrorCodes.X_V_MODEL_UNNECESSARY_VALUE */, value.loc));
|
|
17955
18013
|
}
|
|
17956
18014
|
}
|
|
17957
18015
|
const { tag } = node;
|
|
@@ -17979,7 +18037,7 @@ var Vue = (function () {
|
|
|
17979
18037
|
break;
|
|
17980
18038
|
case 'file':
|
|
17981
18039
|
isInvalidType = true;
|
|
17982
|
-
context.onError(createDOMCompilerError(
|
|
18040
|
+
context.onError(createDOMCompilerError(57 /* DOMErrorCodes.X_V_MODEL_ON_FILE_INPUT_ELEMENT */, dir.loc));
|
|
17983
18041
|
break;
|
|
17984
18042
|
default:
|
|
17985
18043
|
// text type
|
|
@@ -18013,7 +18071,7 @@ var Vue = (function () {
|
|
|
18013
18071
|
}
|
|
18014
18072
|
}
|
|
18015
18073
|
else {
|
|
18016
|
-
context.onError(createDOMCompilerError(
|
|
18074
|
+
context.onError(createDOMCompilerError(55 /* DOMErrorCodes.X_V_MODEL_ON_INVALID_ELEMENT */, dir.loc));
|
|
18017
18075
|
}
|
|
18018
18076
|
// native vmodel doesn't need the `modelValue` props since they are also
|
|
18019
18077
|
// passed to the runtime as `binding.value`. removing it reduces code size.
|
|
@@ -18137,7 +18195,7 @@ var Vue = (function () {
|
|
|
18137
18195
|
const transformShow = (dir, node, context) => {
|
|
18138
18196
|
const { exp, loc } = dir;
|
|
18139
18197
|
if (!exp) {
|
|
18140
|
-
context.onError(createDOMCompilerError(
|
|
18198
|
+
context.onError(createDOMCompilerError(59 /* DOMErrorCodes.X_V_SHOW_NO_EXPRESSION */, loc));
|
|
18141
18199
|
}
|
|
18142
18200
|
return {
|
|
18143
18201
|
props: [],
|
|
@@ -18156,7 +18214,7 @@ var Vue = (function () {
|
|
|
18156
18214
|
}
|
|
18157
18215
|
// warn multiple transition children
|
|
18158
18216
|
if (hasMultipleChildren(node)) {
|
|
18159
|
-
context.onError(createDOMCompilerError(
|
|
18217
|
+
context.onError(createDOMCompilerError(60 /* DOMErrorCodes.X_TRANSITION_INVALID_CHILDREN */, {
|
|
18160
18218
|
start: node.children[0].loc.start,
|
|
18161
18219
|
end: node.children[node.children.length - 1].loc.end,
|
|
18162
18220
|
source: ''
|
|
@@ -18195,7 +18253,7 @@ var Vue = (function () {
|
|
|
18195
18253
|
if (node.type === 1 /* NodeTypes.ELEMENT */ &&
|
|
18196
18254
|
node.tagType === 0 /* ElementTypes.ELEMENT */ &&
|
|
18197
18255
|
(node.tag === 'script' || node.tag === 'style')) {
|
|
18198
|
-
context.onError(createDOMCompilerError(
|
|
18256
|
+
context.onError(createDOMCompilerError(61 /* DOMErrorCodes.X_IGNORED_SIDE_EFFECT_TAG */, node.loc));
|
|
18199
18257
|
context.removeNode();
|
|
18200
18258
|
}
|
|
18201
18259
|
};
|