vue 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.esm-browser.js +156 -84
- package/dist/vue.esm-browser.prod.js +1 -1
- package/dist/vue.global.js +155 -83
- package/dist/vue.global.prod.js +1 -1
- package/dist/vue.runtime.esm-browser.js +149 -78
- package/dist/vue.runtime.esm-browser.prod.js +1 -1
- package/dist/vue.runtime.global.js +149 -77
- package/dist/vue.runtime.global.prod.js +1 -1
- package/package.json +10 -8
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) {
|
|
@@ -2730,7 +2767,8 @@ const BaseTransitionImpl = {
|
|
|
2730
2767
|
const rawProps = toRaw(props);
|
|
2731
2768
|
const { mode } = rawProps;
|
|
2732
2769
|
// check mode
|
|
2733
|
-
if (mode &&
|
|
2770
|
+
if (mode &&
|
|
2771
|
+
mode !== 'in-out' && mode !== 'out-in' && mode !== 'default') {
|
|
2734
2772
|
warn$1(`invalid <transition> mode: ${mode}`);
|
|
2735
2773
|
}
|
|
2736
2774
|
// at this point children has a guaranteed length of 1.
|
|
@@ -3370,7 +3408,7 @@ function registerKeepAliveHook(hook, type, target = currentInstance) {
|
|
|
3370
3408
|
}
|
|
3371
3409
|
current = current.parent;
|
|
3372
3410
|
}
|
|
3373
|
-
hook();
|
|
3411
|
+
return hook();
|
|
3374
3412
|
});
|
|
3375
3413
|
injectHook(type, wrappedHook, target);
|
|
3376
3414
|
// In addition to registering it on the target instance, we walk up the parent
|
|
@@ -4444,7 +4482,7 @@ return withDirectives(h(comp), [
|
|
|
4444
4482
|
[bar, this.y]
|
|
4445
4483
|
])
|
|
4446
4484
|
*/
|
|
4447
|
-
const isBuiltInDirective = /*#__PURE__*/ makeMap('bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text');
|
|
4485
|
+
const isBuiltInDirective = /*#__PURE__*/ makeMap('bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo');
|
|
4448
4486
|
function validateDirectiveName(name) {
|
|
4449
4487
|
if (isBuiltInDirective(name)) {
|
|
4450
4488
|
warn$1('Do not use built-in directive ids as custom directive id: ' + name);
|
|
@@ -6361,8 +6399,8 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
|
6361
6399
|
*
|
|
6362
6400
|
* #2080
|
|
6363
6401
|
* Inside keyed `template` fragment static children, if a fragment is moved,
|
|
6364
|
-
* the children will always moved
|
|
6365
|
-
*
|
|
6402
|
+
* the children will always be moved. Therefore, in order to ensure correct move
|
|
6403
|
+
* position, el should be inherited from previous nodes.
|
|
6366
6404
|
*/
|
|
6367
6405
|
function traverseStaticChildren(n1, n2, shallow = false) {
|
|
6368
6406
|
const ch1 = n1.children;
|
|
@@ -7142,7 +7180,8 @@ function mergeProps(...args) {
|
|
|
7142
7180
|
else if (isOn(key)) {
|
|
7143
7181
|
const existing = ret[key];
|
|
7144
7182
|
const incoming = toMerge[key];
|
|
7145
|
-
if (existing !== incoming
|
|
7183
|
+
if (existing !== incoming &&
|
|
7184
|
+
!(isArray(existing) && existing.includes(incoming))) {
|
|
7146
7185
|
ret[key] = existing
|
|
7147
7186
|
? [].concat(existing, incoming)
|
|
7148
7187
|
: incoming;
|
|
@@ -7345,23 +7384,23 @@ const PublicInstanceProxyHandlers = {
|
|
|
7345
7384
|
const n = accessCache[key];
|
|
7346
7385
|
if (n !== undefined) {
|
|
7347
7386
|
switch (n) {
|
|
7348
|
-
case
|
|
7387
|
+
case 1 /* SETUP */:
|
|
7349
7388
|
return setupState[key];
|
|
7350
|
-
case
|
|
7389
|
+
case 2 /* DATA */:
|
|
7351
7390
|
return data[key];
|
|
7352
|
-
case
|
|
7391
|
+
case 4 /* CONTEXT */:
|
|
7353
7392
|
return ctx[key];
|
|
7354
|
-
case
|
|
7393
|
+
case 3 /* PROPS */:
|
|
7355
7394
|
return props[key];
|
|
7356
7395
|
// default: just fallthrough
|
|
7357
7396
|
}
|
|
7358
7397
|
}
|
|
7359
7398
|
else if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {
|
|
7360
|
-
accessCache[key] =
|
|
7399
|
+
accessCache[key] = 1 /* SETUP */;
|
|
7361
7400
|
return setupState[key];
|
|
7362
7401
|
}
|
|
7363
7402
|
else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
|
|
7364
|
-
accessCache[key] =
|
|
7403
|
+
accessCache[key] = 2 /* DATA */;
|
|
7365
7404
|
return data[key];
|
|
7366
7405
|
}
|
|
7367
7406
|
else if (
|
|
@@ -7369,15 +7408,15 @@ const PublicInstanceProxyHandlers = {
|
|
|
7369
7408
|
// props
|
|
7370
7409
|
(normalizedProps = instance.propsOptions[0]) &&
|
|
7371
7410
|
hasOwn(normalizedProps, key)) {
|
|
7372
|
-
accessCache[key] =
|
|
7411
|
+
accessCache[key] = 3 /* PROPS */;
|
|
7373
7412
|
return props[key];
|
|
7374
7413
|
}
|
|
7375
7414
|
else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
|
|
7376
|
-
accessCache[key] =
|
|
7415
|
+
accessCache[key] = 4 /* CONTEXT */;
|
|
7377
7416
|
return ctx[key];
|
|
7378
7417
|
}
|
|
7379
7418
|
else if (shouldCacheAccess) {
|
|
7380
|
-
accessCache[key] =
|
|
7419
|
+
accessCache[key] = 0 /* OTHER */;
|
|
7381
7420
|
}
|
|
7382
7421
|
}
|
|
7383
7422
|
const publicGetter = publicPropertiesMap[key];
|
|
@@ -7398,7 +7437,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
7398
7437
|
}
|
|
7399
7438
|
else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
|
|
7400
7439
|
// user may set custom properties to `this` that start with `$`
|
|
7401
|
-
accessCache[key] =
|
|
7440
|
+
accessCache[key] = 4 /* CONTEXT */;
|
|
7402
7441
|
return ctx[key];
|
|
7403
7442
|
}
|
|
7404
7443
|
else if (
|
|
@@ -7459,7 +7498,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
7459
7498
|
},
|
|
7460
7499
|
has({ _: { data, setupState, accessCache, ctx, appContext, propsOptions } }, key) {
|
|
7461
7500
|
let normalizedProps;
|
|
7462
|
-
return (accessCache[key]
|
|
7501
|
+
return (!!accessCache[key] ||
|
|
7463
7502
|
(data !== EMPTY_OBJ && hasOwn(data, key)) ||
|
|
7464
7503
|
(setupState !== EMPTY_OBJ && hasOwn(setupState, key)) ||
|
|
7465
7504
|
((normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key)) ||
|
|
@@ -8674,15 +8713,21 @@ function getContext() {
|
|
|
8674
8713
|
* only.
|
|
8675
8714
|
* @internal
|
|
8676
8715
|
*/
|
|
8677
|
-
function mergeDefaults(
|
|
8678
|
-
|
|
8679
|
-
|
|
8716
|
+
function mergeDefaults(raw, defaults) {
|
|
8717
|
+
const props = isArray(raw)
|
|
8718
|
+
? raw.reduce((normalized, p) => ((normalized[p] = {}), normalized), {})
|
|
8719
|
+
: raw;
|
|
8680
8720
|
for (const key in defaults) {
|
|
8681
|
-
const
|
|
8682
|
-
if (
|
|
8683
|
-
|
|
8721
|
+
const opt = props[key];
|
|
8722
|
+
if (opt) {
|
|
8723
|
+
if (isArray(opt) || isFunction(opt)) {
|
|
8724
|
+
props[key] = { type: opt, default: defaults[key] };
|
|
8725
|
+
}
|
|
8726
|
+
else {
|
|
8727
|
+
opt.default = defaults[key];
|
|
8728
|
+
}
|
|
8684
8729
|
}
|
|
8685
|
-
else if (
|
|
8730
|
+
else if (opt === null) {
|
|
8686
8731
|
props[key] = { default: defaults[key] };
|
|
8687
8732
|
}
|
|
8688
8733
|
else {
|
|
@@ -8691,6 +8736,23 @@ props, defaults) {
|
|
|
8691
8736
|
}
|
|
8692
8737
|
return props;
|
|
8693
8738
|
}
|
|
8739
|
+
/**
|
|
8740
|
+
* Used to create a proxy for the rest element when destructuring props with
|
|
8741
|
+
* defineProps().
|
|
8742
|
+
* @internal
|
|
8743
|
+
*/
|
|
8744
|
+
function createPropsRestProxy(props, excludedKeys) {
|
|
8745
|
+
const ret = {};
|
|
8746
|
+
for (const key in props) {
|
|
8747
|
+
if (!excludedKeys.includes(key)) {
|
|
8748
|
+
Object.defineProperty(ret, key, {
|
|
8749
|
+
enumerable: true,
|
|
8750
|
+
get: () => props[key]
|
|
8751
|
+
});
|
|
8752
|
+
}
|
|
8753
|
+
}
|
|
8754
|
+
return ret;
|
|
8755
|
+
}
|
|
8694
8756
|
/**
|
|
8695
8757
|
* `<script setup>` helper for persisting the current instance context over
|
|
8696
8758
|
* async/await flows.
|
|
@@ -8983,7 +9045,7 @@ function isMemoSame(cached, memo) {
|
|
|
8983
9045
|
}
|
|
8984
9046
|
|
|
8985
9047
|
// Core API ------------------------------------------------------------------
|
|
8986
|
-
const version = "3.2.
|
|
9048
|
+
const version = "3.2.23";
|
|
8987
9049
|
/**
|
|
8988
9050
|
* SSR utils for \@vue/server-renderer. Only exposed in cjs builds.
|
|
8989
9051
|
* @internal
|
|
@@ -9105,16 +9167,8 @@ function patchClass(el, value, isSVG) {
|
|
|
9105
9167
|
|
|
9106
9168
|
function patchStyle(el, prev, next) {
|
|
9107
9169
|
const style = el.style;
|
|
9108
|
-
const
|
|
9109
|
-
if (!
|
|
9110
|
-
el.removeAttribute('style');
|
|
9111
|
-
}
|
|
9112
|
-
else if (isString(next)) {
|
|
9113
|
-
if (prev !== next) {
|
|
9114
|
-
style.cssText = next;
|
|
9115
|
-
}
|
|
9116
|
-
}
|
|
9117
|
-
else {
|
|
9170
|
+
const isCssString = isString(next);
|
|
9171
|
+
if (next && !isCssString) {
|
|
9118
9172
|
for (const key in next) {
|
|
9119
9173
|
setStyle(style, key, next[key]);
|
|
9120
9174
|
}
|
|
@@ -9126,11 +9180,22 @@ function patchStyle(el, prev, next) {
|
|
|
9126
9180
|
}
|
|
9127
9181
|
}
|
|
9128
9182
|
}
|
|
9129
|
-
|
|
9130
|
-
|
|
9131
|
-
|
|
9132
|
-
|
|
9133
|
-
|
|
9183
|
+
else {
|
|
9184
|
+
const currentDisplay = style.display;
|
|
9185
|
+
if (isCssString) {
|
|
9186
|
+
if (prev !== next) {
|
|
9187
|
+
style.cssText = next;
|
|
9188
|
+
}
|
|
9189
|
+
}
|
|
9190
|
+
else if (prev) {
|
|
9191
|
+
el.removeAttribute('style');
|
|
9192
|
+
}
|
|
9193
|
+
// indicates that the `display` of the element is controlled by `v-show`,
|
|
9194
|
+
// so we always keep the current `display` value regardless of the `style`
|
|
9195
|
+
// value, thus handing over control to `v-show`.
|
|
9196
|
+
if ('_vod' in el) {
|
|
9197
|
+
style.display = currentDisplay;
|
|
9198
|
+
}
|
|
9134
9199
|
}
|
|
9135
9200
|
}
|
|
9136
9201
|
const importantRE = /\s*!important$/;
|
|
@@ -9213,12 +9278,19 @@ prevChildren, parentComponent, parentSuspense, unmountChildren) {
|
|
|
9213
9278
|
el[key] = value == null ? '' : value;
|
|
9214
9279
|
return;
|
|
9215
9280
|
}
|
|
9216
|
-
if (key === 'value' &&
|
|
9281
|
+
if (key === 'value' &&
|
|
9282
|
+
el.tagName !== 'PROGRESS' &&
|
|
9283
|
+
// custom elements may use _value internally
|
|
9284
|
+
!el.tagName.includes('-')) {
|
|
9217
9285
|
// store value as _value as well since
|
|
9218
9286
|
// non-string values will be stringified.
|
|
9219
9287
|
el._value = value;
|
|
9220
9288
|
const newValue = value == null ? '' : value;
|
|
9221
|
-
if (el.value !== newValue
|
|
9289
|
+
if (el.value !== newValue ||
|
|
9290
|
+
// #4956: always set for OPTION elements because its value falls back to
|
|
9291
|
+
// textContent if no value attribute is present. And setting .value for
|
|
9292
|
+
// OPTION has no side effect
|
|
9293
|
+
el.tagName === 'OPTION') {
|
|
9222
9294
|
el.value = newValue;
|
|
9223
9295
|
}
|
|
9224
9296
|
if (value == null) {
|
|
@@ -9476,22 +9548,11 @@ class VueElement extends BaseClass {
|
|
|
9476
9548
|
}
|
|
9477
9549
|
this.attachShadow({ mode: 'open' });
|
|
9478
9550
|
}
|
|
9479
|
-
// set initial attrs
|
|
9480
|
-
for (let i = 0; i < this.attributes.length; i++) {
|
|
9481
|
-
this._setAttr(this.attributes[i].name);
|
|
9482
|
-
}
|
|
9483
|
-
// watch future attr changes
|
|
9484
|
-
new MutationObserver(mutations => {
|
|
9485
|
-
for (const m of mutations) {
|
|
9486
|
-
this._setAttr(m.attributeName);
|
|
9487
|
-
}
|
|
9488
|
-
}).observe(this, { attributes: true });
|
|
9489
9551
|
}
|
|
9490
9552
|
connectedCallback() {
|
|
9491
9553
|
this._connected = true;
|
|
9492
9554
|
if (!this._instance) {
|
|
9493
9555
|
this._resolveDef();
|
|
9494
|
-
this._update();
|
|
9495
9556
|
}
|
|
9496
9557
|
}
|
|
9497
9558
|
disconnectedCallback() {
|
|
@@ -9510,8 +9571,18 @@ class VueElement extends BaseClass {
|
|
|
9510
9571
|
if (this._resolved) {
|
|
9511
9572
|
return;
|
|
9512
9573
|
}
|
|
9574
|
+
this._resolved = true;
|
|
9575
|
+
// set initial attrs
|
|
9576
|
+
for (let i = 0; i < this.attributes.length; i++) {
|
|
9577
|
+
this._setAttr(this.attributes[i].name);
|
|
9578
|
+
}
|
|
9579
|
+
// watch future attr changes
|
|
9580
|
+
new MutationObserver(mutations => {
|
|
9581
|
+
for (const m of mutations) {
|
|
9582
|
+
this._setAttr(m.attributeName);
|
|
9583
|
+
}
|
|
9584
|
+
}).observe(this, { attributes: true });
|
|
9513
9585
|
const resolve = (def) => {
|
|
9514
|
-
this._resolved = true;
|
|
9515
9586
|
const { props, styles } = def;
|
|
9516
9587
|
const hasOptions = !isArray(props);
|
|
9517
9588
|
const rawKeys = props ? (hasOptions ? Object.keys(props) : props) : [];
|
|
@@ -9526,14 +9597,11 @@ class VueElement extends BaseClass {
|
|
|
9526
9597
|
}
|
|
9527
9598
|
}
|
|
9528
9599
|
}
|
|
9529
|
-
|
|
9530
|
-
this._numberProps = numberProps;
|
|
9531
|
-
this._update();
|
|
9532
|
-
}
|
|
9600
|
+
this._numberProps = numberProps;
|
|
9533
9601
|
// check if there are props set pre-upgrade or connect
|
|
9534
9602
|
for (const key of Object.keys(this)) {
|
|
9535
9603
|
if (key[0] !== '_') {
|
|
9536
|
-
this._setProp(key, this[key]);
|
|
9604
|
+
this._setProp(key, this[key], true, false);
|
|
9537
9605
|
}
|
|
9538
9606
|
}
|
|
9539
9607
|
// defining getter/setters on prototype
|
|
@@ -9547,7 +9615,10 @@ class VueElement extends BaseClass {
|
|
|
9547
9615
|
}
|
|
9548
9616
|
});
|
|
9549
9617
|
}
|
|
9618
|
+
// apply CSS
|
|
9550
9619
|
this._applyStyles(styles);
|
|
9620
|
+
// initial render
|
|
9621
|
+
this._update();
|
|
9551
9622
|
};
|
|
9552
9623
|
const asyncDef = this._def.__asyncLoader;
|
|
9553
9624
|
if (asyncDef) {
|
|
@@ -9573,10 +9644,10 @@ class VueElement extends BaseClass {
|
|
|
9573
9644
|
/**
|
|
9574
9645
|
* @internal
|
|
9575
9646
|
*/
|
|
9576
|
-
_setProp(key, val, shouldReflect = true) {
|
|
9647
|
+
_setProp(key, val, shouldReflect = true, shouldUpdate = true) {
|
|
9577
9648
|
if (val !== this._props[key]) {
|
|
9578
9649
|
this._props[key] = val;
|
|
9579
|
-
if (this._instance) {
|
|
9650
|
+
if (shouldUpdate && this._instance) {
|
|
9580
9651
|
this._update();
|
|
9581
9652
|
}
|
|
9582
9653
|
// reflect
|
|
@@ -10687,6 +10758,7 @@ var runtimeDom = /*#__PURE__*/Object.freeze({
|
|
|
10687
10758
|
defineExpose: defineExpose,
|
|
10688
10759
|
withDefaults: withDefaults,
|
|
10689
10760
|
mergeDefaults: mergeDefaults,
|
|
10761
|
+
createPropsRestProxy: createPropsRestProxy,
|
|
10690
10762
|
withAsyncContext: withAsyncContext,
|
|
10691
10763
|
getCurrentInstance: getCurrentInstance,
|
|
10692
10764
|
h: h,
|
|
@@ -11167,7 +11239,7 @@ const isMemberExpressionBrowser = (path) => {
|
|
|
11167
11239
|
const isMemberExpression = isMemberExpressionBrowser
|
|
11168
11240
|
;
|
|
11169
11241
|
function getInnerRange(loc, offset, length) {
|
|
11170
|
-
const source = loc.source.
|
|
11242
|
+
const source = loc.source.slice(offset, offset + length);
|
|
11171
11243
|
const newLoc = {
|
|
11172
11244
|
source,
|
|
11173
11245
|
start: advancePositionWithClone(loc.start, loc.source, offset),
|
|
@@ -11994,10 +12066,10 @@ function parseAttribute(context, nameSet) {
|
|
|
11994
12066
|
isStatic = false;
|
|
11995
12067
|
if (!content.endsWith(']')) {
|
|
11996
12068
|
emitError(context, 27 /* X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END */);
|
|
11997
|
-
content = content.
|
|
12069
|
+
content = content.slice(1);
|
|
11998
12070
|
}
|
|
11999
12071
|
else {
|
|
12000
|
-
content = content.
|
|
12072
|
+
content = content.slice(1, content.length - 1);
|
|
12001
12073
|
}
|
|
12002
12074
|
}
|
|
12003
12075
|
else if (isSlot) {
|
|
@@ -12023,7 +12095,7 @@ function parseAttribute(context, nameSet) {
|
|
|
12023
12095
|
valueLoc.end = advancePositionWithClone(valueLoc.start, value.content);
|
|
12024
12096
|
valueLoc.source = valueLoc.source.slice(1, -1);
|
|
12025
12097
|
}
|
|
12026
|
-
const modifiers = match[3] ? match[3].
|
|
12098
|
+
const modifiers = match[3] ? match[3].slice(1).split('.') : [];
|
|
12027
12099
|
if (isPropShorthand)
|
|
12028
12100
|
modifiers.push('prop');
|
|
12029
12101
|
return {
|
|
@@ -12233,7 +12305,7 @@ function isEnd(context, mode, ancestors) {
|
|
|
12233
12305
|
}
|
|
12234
12306
|
function startsWithEndTagOpen(source, tag) {
|
|
12235
12307
|
return (startsWith(source, '</') &&
|
|
12236
|
-
source.
|
|
12308
|
+
source.slice(2, 2 + tag.length).toLowerCase() === tag.toLowerCase() &&
|
|
12237
12309
|
/[\t\r\n\f />]/.test(source[2 + tag.length] || '>'));
|
|
12238
12310
|
}
|
|
12239
12311
|
|
|
@@ -14639,7 +14711,7 @@ function stringifyDynamicPropNames(props) {
|
|
|
14639
14711
|
return propsNamesString + `]`;
|
|
14640
14712
|
}
|
|
14641
14713
|
function isComponentTag(tag) {
|
|
14642
|
-
return tag
|
|
14714
|
+
return tag === 'component' || tag === 'Component';
|
|
14643
14715
|
}
|
|
14644
14716
|
|
|
14645
14717
|
const transformSlotOutlet = (node, context) => {
|
|
@@ -15603,4 +15675,4 @@ function compileToFunction(template, options) {
|
|
|
15603
15675
|
}
|
|
15604
15676
|
registerRuntimeCompiler(compileToFunction);
|
|
15605
15677
|
|
|
15606
|
-
export { BaseTransition, Comment, EffectScope, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, Transition, TransitionGroup, VueElement, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, compileToFunction as compile, computed, 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, 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 };
|
|
15678
|
+
export { BaseTransition, Comment, EffectScope, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, Transition, TransitionGroup, VueElement, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, compileToFunction as compile, computed, 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, 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 };
|