@vue/compat 3.2.19 → 3.2.23
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 +170 -101
- package/dist/vue.cjs.prod.js +137 -86
- package/dist/vue.esm-browser.js +159 -86
- package/dist/vue.esm-browser.prod.js +1 -1
- package/dist/vue.esm-bundler.js +160 -86
- package/dist/vue.global.js +158 -85
- package/dist/vue.global.prod.js +1 -1
- package/dist/vue.runtime.esm-browser.js +152 -80
- package/dist/vue.runtime.esm-browser.prod.js +1 -1
- package/dist/vue.runtime.esm-bundler.js +153 -80
- package/dist/vue.runtime.global.js +151 -79
- package/dist/vue.runtime.global.prod.js +1 -1
- package/package.json +2 -2
package/dist/vue.esm-browser.js
CHANGED
|
@@ -530,7 +530,7 @@ const targetMap = new WeakMap();
|
|
|
530
530
|
let effectTrackDepth = 0;
|
|
531
531
|
let trackOpBit = 1;
|
|
532
532
|
/**
|
|
533
|
-
* The bitwise track markers support at most 30 levels
|
|
533
|
+
* The bitwise track markers support at most 30 levels of recursion.
|
|
534
534
|
* This value is chosen to enable modern JS engines to use a SMI on all platforms.
|
|
535
535
|
* When recursion depth is greater, fall back to using a full cleanup.
|
|
536
536
|
*/
|
|
@@ -851,7 +851,7 @@ const shallowSet = /*#__PURE__*/ createSetter(true);
|
|
|
851
851
|
function createSetter(shallow = false) {
|
|
852
852
|
return function set(target, key, value, receiver) {
|
|
853
853
|
let oldValue = target[key];
|
|
854
|
-
if (!shallow) {
|
|
854
|
+
if (!shallow && !isReadonly(value)) {
|
|
855
855
|
value = toRaw(value);
|
|
856
856
|
oldValue = toRaw(oldValue);
|
|
857
857
|
if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
|
|
@@ -1524,19 +1524,22 @@ function registerHMR(instance) {
|
|
|
1524
1524
|
const id = instance.type.__hmrId;
|
|
1525
1525
|
let record = map.get(id);
|
|
1526
1526
|
if (!record) {
|
|
1527
|
-
createRecord(id);
|
|
1527
|
+
createRecord(id, instance.type);
|
|
1528
1528
|
record = map.get(id);
|
|
1529
1529
|
}
|
|
1530
|
-
record.add(instance);
|
|
1530
|
+
record.instances.add(instance);
|
|
1531
1531
|
}
|
|
1532
1532
|
function unregisterHMR(instance) {
|
|
1533
|
-
map.get(instance.type.__hmrId).delete(instance);
|
|
1533
|
+
map.get(instance.type.__hmrId).instances.delete(instance);
|
|
1534
1534
|
}
|
|
1535
|
-
function createRecord(id) {
|
|
1535
|
+
function createRecord(id, initialDef) {
|
|
1536
1536
|
if (map.has(id)) {
|
|
1537
1537
|
return false;
|
|
1538
1538
|
}
|
|
1539
|
-
map.set(id,
|
|
1539
|
+
map.set(id, {
|
|
1540
|
+
initialDef: normalizeClassComponent(initialDef),
|
|
1541
|
+
instances: new Set()
|
|
1542
|
+
});
|
|
1540
1543
|
return true;
|
|
1541
1544
|
}
|
|
1542
1545
|
function normalizeClassComponent(component) {
|
|
@@ -1547,7 +1550,9 @@ function rerender(id, newRender) {
|
|
|
1547
1550
|
if (!record) {
|
|
1548
1551
|
return;
|
|
1549
1552
|
}
|
|
1550
|
-
|
|
1553
|
+
// update initial record (for not-yet-rendered component)
|
|
1554
|
+
record.initialDef.render = newRender;
|
|
1555
|
+
[...record.instances].forEach(instance => {
|
|
1551
1556
|
if (newRender) {
|
|
1552
1557
|
instance.render = newRender;
|
|
1553
1558
|
normalizeClassComponent(instance.type).render = newRender;
|
|
@@ -1564,17 +1569,16 @@ function reload(id, newComp) {
|
|
|
1564
1569
|
if (!record)
|
|
1565
1570
|
return;
|
|
1566
1571
|
newComp = normalizeClassComponent(newComp);
|
|
1572
|
+
// update initial def (for not-yet-rendered components)
|
|
1573
|
+
updateComponentDef(record.initialDef, newComp);
|
|
1567
1574
|
// create a snapshot which avoids the set being mutated during updates
|
|
1568
|
-
const instances = [...record];
|
|
1575
|
+
const instances = [...record.instances];
|
|
1569
1576
|
for (const instance of instances) {
|
|
1570
1577
|
const oldComp = normalizeClassComponent(instance.type);
|
|
1571
1578
|
if (!hmrDirtyComponents.has(oldComp)) {
|
|
1572
1579
|
// 1. Update existing comp definition to match new one
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
if (key !== '__file' && !(key in newComp)) {
|
|
1576
|
-
delete oldComp[key];
|
|
1577
|
-
}
|
|
1580
|
+
if (oldComp !== record.initialDef) {
|
|
1581
|
+
updateComponentDef(oldComp, newComp);
|
|
1578
1582
|
}
|
|
1579
1583
|
// 2. mark definition dirty. This forces the renderer to replace the
|
|
1580
1584
|
// component on patch.
|
|
@@ -1620,6 +1624,14 @@ function reload(id, newComp) {
|
|
|
1620
1624
|
}
|
|
1621
1625
|
});
|
|
1622
1626
|
}
|
|
1627
|
+
function updateComponentDef(oldComp, newComp) {
|
|
1628
|
+
extend(oldComp, newComp);
|
|
1629
|
+
for (const key in oldComp) {
|
|
1630
|
+
if (key !== '__file' && !(key in newComp)) {
|
|
1631
|
+
delete oldComp[key];
|
|
1632
|
+
}
|
|
1633
|
+
}
|
|
1634
|
+
}
|
|
1623
1635
|
function tryWrap(fn) {
|
|
1624
1636
|
return (id, arg) => {
|
|
1625
1637
|
try {
|
|
@@ -1635,27 +1647,52 @@ function tryWrap(fn) {
|
|
|
1635
1647
|
|
|
1636
1648
|
let devtools;
|
|
1637
1649
|
let buffer = [];
|
|
1650
|
+
let devtoolsNotInstalled = false;
|
|
1638
1651
|
function emit(event, ...args) {
|
|
1639
1652
|
if (devtools) {
|
|
1640
1653
|
devtools.emit(event, ...args);
|
|
1641
1654
|
}
|
|
1642
|
-
else {
|
|
1655
|
+
else if (!devtoolsNotInstalled) {
|
|
1643
1656
|
buffer.push({ event, args });
|
|
1644
1657
|
}
|
|
1645
1658
|
}
|
|
1646
1659
|
function setDevtoolsHook(hook, target) {
|
|
1660
|
+
var _a, _b;
|
|
1647
1661
|
devtools = hook;
|
|
1648
1662
|
if (devtools) {
|
|
1649
1663
|
devtools.enabled = true;
|
|
1650
1664
|
buffer.forEach(({ event, args }) => devtools.emit(event, ...args));
|
|
1651
1665
|
buffer = [];
|
|
1652
1666
|
}
|
|
1653
|
-
else
|
|
1667
|
+
else if (
|
|
1668
|
+
// handle late devtools injection - only do this if we are in an actual
|
|
1669
|
+
// browser environment to avoid the timer handle stalling test runner exit
|
|
1670
|
+
// (#4815)
|
|
1671
|
+
// eslint-disable-next-line no-restricted-globals
|
|
1672
|
+
typeof window !== 'undefined' &&
|
|
1673
|
+
// some envs mock window but not fully
|
|
1674
|
+
window.HTMLElement &&
|
|
1675
|
+
// also exclude jsdom
|
|
1676
|
+
!((_b = (_a = window.navigator) === null || _a === void 0 ? void 0 : _a.userAgent) === null || _b === void 0 ? void 0 : _b.includes('jsdom'))) {
|
|
1654
1677
|
const replay = (target.__VUE_DEVTOOLS_HOOK_REPLAY__ =
|
|
1655
1678
|
target.__VUE_DEVTOOLS_HOOK_REPLAY__ || []);
|
|
1656
1679
|
replay.push((newHook) => {
|
|
1657
1680
|
setDevtoolsHook(newHook, target);
|
|
1658
1681
|
});
|
|
1682
|
+
// clear buffer after 3s - the user probably doesn't have devtools installed
|
|
1683
|
+
// at all, and keeping the buffer will cause memory leaks (#4738)
|
|
1684
|
+
setTimeout(() => {
|
|
1685
|
+
if (!devtools) {
|
|
1686
|
+
target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null;
|
|
1687
|
+
devtoolsNotInstalled = true;
|
|
1688
|
+
buffer = [];
|
|
1689
|
+
}
|
|
1690
|
+
}, 3000);
|
|
1691
|
+
}
|
|
1692
|
+
else {
|
|
1693
|
+
// non-browser env, assume not installed
|
|
1694
|
+
devtoolsNotInstalled = true;
|
|
1695
|
+
buffer = [];
|
|
1659
1696
|
}
|
|
1660
1697
|
}
|
|
1661
1698
|
function devtoolsInitApp(app, version) {
|
|
@@ -3270,7 +3307,8 @@ const BaseTransitionImpl = {
|
|
|
3270
3307
|
const rawProps = toRaw(props);
|
|
3271
3308
|
const { mode } = rawProps;
|
|
3272
3309
|
// check mode
|
|
3273
|
-
if (mode &&
|
|
3310
|
+
if (mode &&
|
|
3311
|
+
mode !== 'in-out' && mode !== 'out-in' && mode !== 'default') {
|
|
3274
3312
|
warn$1(`invalid <transition> mode: ${mode}`);
|
|
3275
3313
|
}
|
|
3276
3314
|
// at this point children has a guaranteed length of 1.
|
|
@@ -3916,7 +3954,7 @@ function registerKeepAliveHook(hook, type, target = currentInstance) {
|
|
|
3916
3954
|
}
|
|
3917
3955
|
current = current.parent;
|
|
3918
3956
|
}
|
|
3919
|
-
hook();
|
|
3957
|
+
return hook();
|
|
3920
3958
|
});
|
|
3921
3959
|
injectHook(type, wrappedHook, target);
|
|
3922
3960
|
// In addition to registering it on the target instance, we walk up the parent
|
|
@@ -5140,7 +5178,7 @@ return withDirectives(h(comp), [
|
|
|
5140
5178
|
[bar, this.y]
|
|
5141
5179
|
])
|
|
5142
5180
|
*/
|
|
5143
|
-
const isBuiltInDirective = /*#__PURE__*/ makeMap('bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text');
|
|
5181
|
+
const isBuiltInDirective = /*#__PURE__*/ makeMap('bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo');
|
|
5144
5182
|
function validateDirectiveName(name) {
|
|
5145
5183
|
if (isBuiltInDirective(name)) {
|
|
5146
5184
|
warn$1('Do not use built-in directive ids as custom directive id: ' + name);
|
|
@@ -5275,7 +5313,7 @@ function createCompatVue(createApp, createSingletonApp) {
|
|
|
5275
5313
|
return vm;
|
|
5276
5314
|
}
|
|
5277
5315
|
}
|
|
5278
|
-
Vue.version = "3.2.
|
|
5316
|
+
Vue.version = "3.2.23";
|
|
5279
5317
|
Vue.config = singletonApp.config;
|
|
5280
5318
|
Vue.use = (p, ...options) => {
|
|
5281
5319
|
if (p && isFunction(p.install)) {
|
|
@@ -6721,7 +6759,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6721
6759
|
}
|
|
6722
6760
|
};
|
|
6723
6761
|
const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, isSVG, optimized) => {
|
|
6724
|
-
// 2.x compat may pre-
|
|
6762
|
+
// 2.x compat may pre-create the component instance before actually
|
|
6725
6763
|
// mounting
|
|
6726
6764
|
const compatMountInstance = initialVNode.isCompatRoot && initialVNode.component;
|
|
6727
6765
|
const instance = compatMountInstance ||
|
|
@@ -7601,8 +7639,8 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
|
7601
7639
|
*
|
|
7602
7640
|
* #2080
|
|
7603
7641
|
* Inside keyed `template` fragment static children, if a fragment is moved,
|
|
7604
|
-
* the children will always moved
|
|
7605
|
-
*
|
|
7642
|
+
* the children will always be moved. Therefore, in order to ensure correct move
|
|
7643
|
+
* position, el should be inherited from previous nodes.
|
|
7606
7644
|
*/
|
|
7607
7645
|
function traverseStaticChildren(n1, n2, shallow = false) {
|
|
7608
7646
|
const ch1 = n1.children;
|
|
@@ -8729,7 +8767,8 @@ function mergeProps(...args) {
|
|
|
8729
8767
|
else if (isOn(key)) {
|
|
8730
8768
|
const existing = ret[key];
|
|
8731
8769
|
const incoming = toMerge[key];
|
|
8732
|
-
if (existing !== incoming
|
|
8770
|
+
if (existing !== incoming &&
|
|
8771
|
+
!(isArray(existing) && existing.includes(incoming))) {
|
|
8733
8772
|
ret[key] = existing
|
|
8734
8773
|
? [].concat(existing, incoming)
|
|
8735
8774
|
: incoming;
|
|
@@ -9173,23 +9212,23 @@ const PublicInstanceProxyHandlers = {
|
|
|
9173
9212
|
const n = accessCache[key];
|
|
9174
9213
|
if (n !== undefined) {
|
|
9175
9214
|
switch (n) {
|
|
9176
|
-
case
|
|
9215
|
+
case 1 /* SETUP */:
|
|
9177
9216
|
return setupState[key];
|
|
9178
|
-
case
|
|
9217
|
+
case 2 /* DATA */:
|
|
9179
9218
|
return data[key];
|
|
9180
|
-
case
|
|
9219
|
+
case 4 /* CONTEXT */:
|
|
9181
9220
|
return ctx[key];
|
|
9182
|
-
case
|
|
9221
|
+
case 3 /* PROPS */:
|
|
9183
9222
|
return props[key];
|
|
9184
9223
|
// default: just fallthrough
|
|
9185
9224
|
}
|
|
9186
9225
|
}
|
|
9187
9226
|
else if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {
|
|
9188
|
-
accessCache[key] =
|
|
9227
|
+
accessCache[key] = 1 /* SETUP */;
|
|
9189
9228
|
return setupState[key];
|
|
9190
9229
|
}
|
|
9191
9230
|
else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
|
|
9192
|
-
accessCache[key] =
|
|
9231
|
+
accessCache[key] = 2 /* DATA */;
|
|
9193
9232
|
return data[key];
|
|
9194
9233
|
}
|
|
9195
9234
|
else if (
|
|
@@ -9197,15 +9236,15 @@ const PublicInstanceProxyHandlers = {
|
|
|
9197
9236
|
// props
|
|
9198
9237
|
(normalizedProps = instance.propsOptions[0]) &&
|
|
9199
9238
|
hasOwn(normalizedProps, key)) {
|
|
9200
|
-
accessCache[key] =
|
|
9239
|
+
accessCache[key] = 3 /* PROPS */;
|
|
9201
9240
|
return props[key];
|
|
9202
9241
|
}
|
|
9203
9242
|
else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
|
|
9204
|
-
accessCache[key] =
|
|
9243
|
+
accessCache[key] = 4 /* CONTEXT */;
|
|
9205
9244
|
return ctx[key];
|
|
9206
9245
|
}
|
|
9207
9246
|
else if (shouldCacheAccess) {
|
|
9208
|
-
accessCache[key] =
|
|
9247
|
+
accessCache[key] = 0 /* OTHER */;
|
|
9209
9248
|
}
|
|
9210
9249
|
}
|
|
9211
9250
|
const publicGetter = publicPropertiesMap[key];
|
|
@@ -9226,7 +9265,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
9226
9265
|
}
|
|
9227
9266
|
else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
|
|
9228
9267
|
// user may set custom properties to `this` that start with `$`
|
|
9229
|
-
accessCache[key] =
|
|
9268
|
+
accessCache[key] = 4 /* CONTEXT */;
|
|
9230
9269
|
return ctx[key];
|
|
9231
9270
|
}
|
|
9232
9271
|
else if (
|
|
@@ -9294,7 +9333,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
9294
9333
|
},
|
|
9295
9334
|
has({ _: { data, setupState, accessCache, ctx, appContext, propsOptions } }, key) {
|
|
9296
9335
|
let normalizedProps;
|
|
9297
|
-
return (accessCache[key]
|
|
9336
|
+
return (!!accessCache[key] ||
|
|
9298
9337
|
(data !== EMPTY_OBJ && hasOwn(data, key)) ||
|
|
9299
9338
|
(setupState !== EMPTY_OBJ && hasOwn(setupState, key)) ||
|
|
9300
9339
|
((normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key)) ||
|
|
@@ -10537,15 +10576,21 @@ function getContext() {
|
|
|
10537
10576
|
* only.
|
|
10538
10577
|
* @internal
|
|
10539
10578
|
*/
|
|
10540
|
-
function mergeDefaults(
|
|
10541
|
-
|
|
10542
|
-
|
|
10579
|
+
function mergeDefaults(raw, defaults) {
|
|
10580
|
+
const props = isArray(raw)
|
|
10581
|
+
? raw.reduce((normalized, p) => ((normalized[p] = {}), normalized), {})
|
|
10582
|
+
: raw;
|
|
10543
10583
|
for (const key in defaults) {
|
|
10544
|
-
const
|
|
10545
|
-
if (
|
|
10546
|
-
|
|
10584
|
+
const opt = props[key];
|
|
10585
|
+
if (opt) {
|
|
10586
|
+
if (isArray(opt) || isFunction(opt)) {
|
|
10587
|
+
props[key] = { type: opt, default: defaults[key] };
|
|
10588
|
+
}
|
|
10589
|
+
else {
|
|
10590
|
+
opt.default = defaults[key];
|
|
10591
|
+
}
|
|
10547
10592
|
}
|
|
10548
|
-
else if (
|
|
10593
|
+
else if (opt === null) {
|
|
10549
10594
|
props[key] = { default: defaults[key] };
|
|
10550
10595
|
}
|
|
10551
10596
|
else {
|
|
@@ -10554,6 +10599,23 @@ props, defaults) {
|
|
|
10554
10599
|
}
|
|
10555
10600
|
return props;
|
|
10556
10601
|
}
|
|
10602
|
+
/**
|
|
10603
|
+
* Used to create a proxy for the rest element when destructuring props with
|
|
10604
|
+
* defineProps().
|
|
10605
|
+
* @internal
|
|
10606
|
+
*/
|
|
10607
|
+
function createPropsRestProxy(props, excludedKeys) {
|
|
10608
|
+
const ret = {};
|
|
10609
|
+
for (const key in props) {
|
|
10610
|
+
if (!excludedKeys.includes(key)) {
|
|
10611
|
+
Object.defineProperty(ret, key, {
|
|
10612
|
+
enumerable: true,
|
|
10613
|
+
get: () => props[key]
|
|
10614
|
+
});
|
|
10615
|
+
}
|
|
10616
|
+
}
|
|
10617
|
+
return ret;
|
|
10618
|
+
}
|
|
10557
10619
|
/**
|
|
10558
10620
|
* `<script setup>` helper for persisting the current instance context over
|
|
10559
10621
|
* async/await flows.
|
|
@@ -10846,7 +10908,7 @@ function isMemoSame(cached, memo) {
|
|
|
10846
10908
|
}
|
|
10847
10909
|
|
|
10848
10910
|
// Core API ------------------------------------------------------------------
|
|
10849
|
-
const version = "3.2.
|
|
10911
|
+
const version = "3.2.23";
|
|
10850
10912
|
/**
|
|
10851
10913
|
* SSR utils for \@vue/server-renderer. Only exposed in cjs builds.
|
|
10852
10914
|
* @internal
|
|
@@ -10975,16 +11037,8 @@ function patchClass(el, value, isSVG) {
|
|
|
10975
11037
|
|
|
10976
11038
|
function patchStyle(el, prev, next) {
|
|
10977
11039
|
const style = el.style;
|
|
10978
|
-
const
|
|
10979
|
-
if (!
|
|
10980
|
-
el.removeAttribute('style');
|
|
10981
|
-
}
|
|
10982
|
-
else if (isString(next)) {
|
|
10983
|
-
if (prev !== next) {
|
|
10984
|
-
style.cssText = next;
|
|
10985
|
-
}
|
|
10986
|
-
}
|
|
10987
|
-
else {
|
|
11040
|
+
const isCssString = isString(next);
|
|
11041
|
+
if (next && !isCssString) {
|
|
10988
11042
|
for (const key in next) {
|
|
10989
11043
|
setStyle(style, key, next[key]);
|
|
10990
11044
|
}
|
|
@@ -10996,11 +11050,22 @@ function patchStyle(el, prev, next) {
|
|
|
10996
11050
|
}
|
|
10997
11051
|
}
|
|
10998
11052
|
}
|
|
10999
|
-
|
|
11000
|
-
|
|
11001
|
-
|
|
11002
|
-
|
|
11003
|
-
|
|
11053
|
+
else {
|
|
11054
|
+
const currentDisplay = style.display;
|
|
11055
|
+
if (isCssString) {
|
|
11056
|
+
if (prev !== next) {
|
|
11057
|
+
style.cssText = next;
|
|
11058
|
+
}
|
|
11059
|
+
}
|
|
11060
|
+
else if (prev) {
|
|
11061
|
+
el.removeAttribute('style');
|
|
11062
|
+
}
|
|
11063
|
+
// indicates that the `display` of the element is controlled by `v-show`,
|
|
11064
|
+
// so we always keep the current `display` value regardless of the `style`
|
|
11065
|
+
// value, thus handing over control to `v-show`.
|
|
11066
|
+
if ('_vod' in el) {
|
|
11067
|
+
style.display = currentDisplay;
|
|
11068
|
+
}
|
|
11004
11069
|
}
|
|
11005
11070
|
}
|
|
11006
11071
|
const importantRE = /\s*!important$/;
|
|
@@ -11110,12 +11175,19 @@ prevChildren, parentComponent, parentSuspense, unmountChildren) {
|
|
|
11110
11175
|
el[key] = value == null ? '' : value;
|
|
11111
11176
|
return;
|
|
11112
11177
|
}
|
|
11113
|
-
if (key === 'value' &&
|
|
11178
|
+
if (key === 'value' &&
|
|
11179
|
+
el.tagName !== 'PROGRESS' &&
|
|
11180
|
+
// custom elements may use _value internally
|
|
11181
|
+
!el.tagName.includes('-')) {
|
|
11114
11182
|
// store value as _value as well since
|
|
11115
11183
|
// non-string values will be stringified.
|
|
11116
11184
|
el._value = value;
|
|
11117
11185
|
const newValue = value == null ? '' : value;
|
|
11118
|
-
if (el.value !== newValue
|
|
11186
|
+
if (el.value !== newValue ||
|
|
11187
|
+
// #4956: always set for OPTION elements because its value falls back to
|
|
11188
|
+
// textContent if no value attribute is present. And setting .value for
|
|
11189
|
+
// OPTION has no side effect
|
|
11190
|
+
el.tagName === 'OPTION') {
|
|
11119
11191
|
el.value = newValue;
|
|
11120
11192
|
}
|
|
11121
11193
|
if (value == null) {
|
|
@@ -11383,22 +11455,11 @@ class VueElement extends BaseClass {
|
|
|
11383
11455
|
}
|
|
11384
11456
|
this.attachShadow({ mode: 'open' });
|
|
11385
11457
|
}
|
|
11386
|
-
// set initial attrs
|
|
11387
|
-
for (let i = 0; i < this.attributes.length; i++) {
|
|
11388
|
-
this._setAttr(this.attributes[i].name);
|
|
11389
|
-
}
|
|
11390
|
-
// watch future attr changes
|
|
11391
|
-
new MutationObserver(mutations => {
|
|
11392
|
-
for (const m of mutations) {
|
|
11393
|
-
this._setAttr(m.attributeName);
|
|
11394
|
-
}
|
|
11395
|
-
}).observe(this, { attributes: true });
|
|
11396
11458
|
}
|
|
11397
11459
|
connectedCallback() {
|
|
11398
11460
|
this._connected = true;
|
|
11399
11461
|
if (!this._instance) {
|
|
11400
11462
|
this._resolveDef();
|
|
11401
|
-
this._update();
|
|
11402
11463
|
}
|
|
11403
11464
|
}
|
|
11404
11465
|
disconnectedCallback() {
|
|
@@ -11417,8 +11478,18 @@ class VueElement extends BaseClass {
|
|
|
11417
11478
|
if (this._resolved) {
|
|
11418
11479
|
return;
|
|
11419
11480
|
}
|
|
11481
|
+
this._resolved = true;
|
|
11482
|
+
// set initial attrs
|
|
11483
|
+
for (let i = 0; i < this.attributes.length; i++) {
|
|
11484
|
+
this._setAttr(this.attributes[i].name);
|
|
11485
|
+
}
|
|
11486
|
+
// watch future attr changes
|
|
11487
|
+
new MutationObserver(mutations => {
|
|
11488
|
+
for (const m of mutations) {
|
|
11489
|
+
this._setAttr(m.attributeName);
|
|
11490
|
+
}
|
|
11491
|
+
}).observe(this, { attributes: true });
|
|
11420
11492
|
const resolve = (def) => {
|
|
11421
|
-
this._resolved = true;
|
|
11422
11493
|
const { props, styles } = def;
|
|
11423
11494
|
const hasOptions = !isArray(props);
|
|
11424
11495
|
const rawKeys = props ? (hasOptions ? Object.keys(props) : props) : [];
|
|
@@ -11433,14 +11504,11 @@ class VueElement extends BaseClass {
|
|
|
11433
11504
|
}
|
|
11434
11505
|
}
|
|
11435
11506
|
}
|
|
11436
|
-
|
|
11437
|
-
this._numberProps = numberProps;
|
|
11438
|
-
this._update();
|
|
11439
|
-
}
|
|
11507
|
+
this._numberProps = numberProps;
|
|
11440
11508
|
// check if there are props set pre-upgrade or connect
|
|
11441
11509
|
for (const key of Object.keys(this)) {
|
|
11442
11510
|
if (key[0] !== '_') {
|
|
11443
|
-
this._setProp(key, this[key]);
|
|
11511
|
+
this._setProp(key, this[key], true, false);
|
|
11444
11512
|
}
|
|
11445
11513
|
}
|
|
11446
11514
|
// defining getter/setters on prototype
|
|
@@ -11454,7 +11522,10 @@ class VueElement extends BaseClass {
|
|
|
11454
11522
|
}
|
|
11455
11523
|
});
|
|
11456
11524
|
}
|
|
11525
|
+
// apply CSS
|
|
11457
11526
|
this._applyStyles(styles);
|
|
11527
|
+
// initial render
|
|
11528
|
+
this._update();
|
|
11458
11529
|
};
|
|
11459
11530
|
const asyncDef = this._def.__asyncLoader;
|
|
11460
11531
|
if (asyncDef) {
|
|
@@ -11480,10 +11551,10 @@ class VueElement extends BaseClass {
|
|
|
11480
11551
|
/**
|
|
11481
11552
|
* @internal
|
|
11482
11553
|
*/
|
|
11483
|
-
_setProp(key, val, shouldReflect = true) {
|
|
11554
|
+
_setProp(key, val, shouldReflect = true, shouldUpdate = true) {
|
|
11484
11555
|
if (val !== this._props[key]) {
|
|
11485
11556
|
this._props[key] = val;
|
|
11486
|
-
if (this._instance) {
|
|
11557
|
+
if (shouldUpdate && this._instance) {
|
|
11487
11558
|
this._update();
|
|
11488
11559
|
}
|
|
11489
11560
|
// reflect
|
|
@@ -12679,6 +12750,7 @@ var runtimeDom = /*#__PURE__*/Object.freeze({
|
|
|
12679
12750
|
defineExpose: defineExpose,
|
|
12680
12751
|
withDefaults: withDefaults,
|
|
12681
12752
|
mergeDefaults: mergeDefaults,
|
|
12753
|
+
createPropsRestProxy: createPropsRestProxy,
|
|
12682
12754
|
withAsyncContext: withAsyncContext,
|
|
12683
12755
|
getCurrentInstance: getCurrentInstance,
|
|
12684
12756
|
h: h,
|
|
@@ -13186,7 +13258,7 @@ const isMemberExpressionBrowser = (path) => {
|
|
|
13186
13258
|
const isMemberExpression = isMemberExpressionBrowser
|
|
13187
13259
|
;
|
|
13188
13260
|
function getInnerRange(loc, offset, length) {
|
|
13189
|
-
const source = loc.source.
|
|
13261
|
+
const source = loc.source.slice(offset, offset + length);
|
|
13190
13262
|
const newLoc = {
|
|
13191
13263
|
source,
|
|
13192
13264
|
start: advancePositionWithClone(loc.start, loc.source, offset),
|
|
@@ -13900,6 +13972,7 @@ function parseTag(context, type, parent) {
|
|
|
13900
13972
|
}
|
|
13901
13973
|
if (hasIf && hasFor) {
|
|
13902
13974
|
warnDeprecation$1("COMPILER_V_IF_V_FOR_PRECEDENCE" /* COMPILER_V_IF_V_FOR_PRECEDENCE */, context, getSelection(context, start));
|
|
13975
|
+
break;
|
|
13903
13976
|
}
|
|
13904
13977
|
}
|
|
13905
13978
|
}
|
|
@@ -14057,10 +14130,10 @@ function parseAttribute(context, nameSet) {
|
|
|
14057
14130
|
isStatic = false;
|
|
14058
14131
|
if (!content.endsWith(']')) {
|
|
14059
14132
|
emitError(context, 27 /* X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END */);
|
|
14060
|
-
content = content.
|
|
14133
|
+
content = content.slice(1);
|
|
14061
14134
|
}
|
|
14062
14135
|
else {
|
|
14063
|
-
content = content.
|
|
14136
|
+
content = content.slice(1, content.length - 1);
|
|
14064
14137
|
}
|
|
14065
14138
|
}
|
|
14066
14139
|
else if (isSlot) {
|
|
@@ -14086,7 +14159,7 @@ function parseAttribute(context, nameSet) {
|
|
|
14086
14159
|
valueLoc.end = advancePositionWithClone(valueLoc.start, value.content);
|
|
14087
14160
|
valueLoc.source = valueLoc.source.slice(1, -1);
|
|
14088
14161
|
}
|
|
14089
|
-
const modifiers = match[3] ? match[3].
|
|
14162
|
+
const modifiers = match[3] ? match[3].slice(1).split('.') : [];
|
|
14090
14163
|
if (isPropShorthand)
|
|
14091
14164
|
modifiers.push('prop');
|
|
14092
14165
|
// 2.x compat v-bind:foo.sync -> v-model:foo
|
|
@@ -14307,7 +14380,7 @@ function isEnd(context, mode, ancestors) {
|
|
|
14307
14380
|
}
|
|
14308
14381
|
function startsWithEndTagOpen(source, tag) {
|
|
14309
14382
|
return (startsWith(source, '</') &&
|
|
14310
|
-
source.
|
|
14383
|
+
source.slice(2, 2 + tag.length).toLowerCase() === tag.toLowerCase() &&
|
|
14311
14384
|
/[\t\r\n\f />]/.test(source[2 + tag.length] || '>'));
|
|
14312
14385
|
}
|
|
14313
14386
|
|
|
@@ -16767,7 +16840,7 @@ function stringifyDynamicPropNames(props) {
|
|
|
16767
16840
|
return propsNamesString + `]`;
|
|
16768
16841
|
}
|
|
16769
16842
|
function isComponentTag(tag) {
|
|
16770
|
-
return tag
|
|
16843
|
+
return tag === 'component' || tag === 'Component';
|
|
16771
16844
|
}
|
|
16772
16845
|
|
|
16773
16846
|
const transformSlotOutlet = (node, context) => {
|
|
@@ -17906,4 +17979,4 @@ Vue.compile = compileToFunction;
|
|
|
17906
17979
|
const { configureCompat: configureCompat$1 } = Vue;
|
|
17907
17980
|
|
|
17908
17981
|
export default Vue;
|
|
17909
|
-
export { BaseTransition, Comment, EffectScope, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, Transition, TransitionGroup, VueElement, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, computed, configureCompat$1 as configureCompat, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineProps, defineSSRCustomElement, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getTransitionRawChildren, guardReactiveProps, h, handleError, hydrate, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isVNode, markRaw, mergeDefaults, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter$1 as resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useSSRContext, useSlots, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn$1 as warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };
|
|
17982
|
+
export { BaseTransition, Comment, EffectScope, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, Transition, TransitionGroup, VueElement, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, computed, configureCompat$1 as configureCompat, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineProps, defineSSRCustomElement, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getTransitionRawChildren, guardReactiveProps, h, handleError, hydrate, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isVNode, markRaw, mergeDefaults, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter$1 as resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useSSRContext, useSlots, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn$1 as warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };
|