@vue/runtime-dom 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/runtime-dom.cjs.js +45 -36
- package/dist/runtime-dom.cjs.prod.js +45 -36
- package/dist/runtime-dom.d.ts +3 -1
- package/dist/runtime-dom.esm-browser.js +149 -78
- package/dist/runtime-dom.esm-browser.prod.js +1 -1
- package/dist/runtime-dom.esm-bundler.js +45 -36
- package/dist/runtime-dom.global.js +149 -77
- package/dist/runtime-dom.global.prod.js +1 -1
- package/package.json +3 -3
|
@@ -455,7 +455,7 @@ const targetMap = new WeakMap();
|
|
|
455
455
|
let effectTrackDepth = 0;
|
|
456
456
|
let trackOpBit = 1;
|
|
457
457
|
/**
|
|
458
|
-
* The bitwise track markers support at most 30 levels
|
|
458
|
+
* The bitwise track markers support at most 30 levels of recursion.
|
|
459
459
|
* This value is chosen to enable modern JS engines to use a SMI on all platforms.
|
|
460
460
|
* When recursion depth is greater, fall back to using a full cleanup.
|
|
461
461
|
*/
|
|
@@ -776,7 +776,7 @@ const shallowSet = /*#__PURE__*/ createSetter(true);
|
|
|
776
776
|
function createSetter(shallow = false) {
|
|
777
777
|
return function set(target, key, value, receiver) {
|
|
778
778
|
let oldValue = target[key];
|
|
779
|
-
if (!shallow) {
|
|
779
|
+
if (!shallow && !isReadonly(value)) {
|
|
780
780
|
value = toRaw(value);
|
|
781
781
|
oldValue = toRaw(oldValue);
|
|
782
782
|
if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
|
|
@@ -1449,19 +1449,22 @@ function registerHMR(instance) {
|
|
|
1449
1449
|
const id = instance.type.__hmrId;
|
|
1450
1450
|
let record = map.get(id);
|
|
1451
1451
|
if (!record) {
|
|
1452
|
-
createRecord(id);
|
|
1452
|
+
createRecord(id, instance.type);
|
|
1453
1453
|
record = map.get(id);
|
|
1454
1454
|
}
|
|
1455
|
-
record.add(instance);
|
|
1455
|
+
record.instances.add(instance);
|
|
1456
1456
|
}
|
|
1457
1457
|
function unregisterHMR(instance) {
|
|
1458
|
-
map.get(instance.type.__hmrId).delete(instance);
|
|
1458
|
+
map.get(instance.type.__hmrId).instances.delete(instance);
|
|
1459
1459
|
}
|
|
1460
|
-
function createRecord(id) {
|
|
1460
|
+
function createRecord(id, initialDef) {
|
|
1461
1461
|
if (map.has(id)) {
|
|
1462
1462
|
return false;
|
|
1463
1463
|
}
|
|
1464
|
-
map.set(id,
|
|
1464
|
+
map.set(id, {
|
|
1465
|
+
initialDef: normalizeClassComponent(initialDef),
|
|
1466
|
+
instances: new Set()
|
|
1467
|
+
});
|
|
1465
1468
|
return true;
|
|
1466
1469
|
}
|
|
1467
1470
|
function normalizeClassComponent(component) {
|
|
@@ -1472,7 +1475,9 @@ function rerender(id, newRender) {
|
|
|
1472
1475
|
if (!record) {
|
|
1473
1476
|
return;
|
|
1474
1477
|
}
|
|
1475
|
-
|
|
1478
|
+
// update initial record (for not-yet-rendered component)
|
|
1479
|
+
record.initialDef.render = newRender;
|
|
1480
|
+
[...record.instances].forEach(instance => {
|
|
1476
1481
|
if (newRender) {
|
|
1477
1482
|
instance.render = newRender;
|
|
1478
1483
|
normalizeClassComponent(instance.type).render = newRender;
|
|
@@ -1489,17 +1494,16 @@ function reload(id, newComp) {
|
|
|
1489
1494
|
if (!record)
|
|
1490
1495
|
return;
|
|
1491
1496
|
newComp = normalizeClassComponent(newComp);
|
|
1497
|
+
// update initial def (for not-yet-rendered components)
|
|
1498
|
+
updateComponentDef(record.initialDef, newComp);
|
|
1492
1499
|
// create a snapshot which avoids the set being mutated during updates
|
|
1493
|
-
const instances = [...record];
|
|
1500
|
+
const instances = [...record.instances];
|
|
1494
1501
|
for (const instance of instances) {
|
|
1495
1502
|
const oldComp = normalizeClassComponent(instance.type);
|
|
1496
1503
|
if (!hmrDirtyComponents.has(oldComp)) {
|
|
1497
1504
|
// 1. Update existing comp definition to match new one
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
if (key !== '__file' && !(key in newComp)) {
|
|
1501
|
-
delete oldComp[key];
|
|
1502
|
-
}
|
|
1505
|
+
if (oldComp !== record.initialDef) {
|
|
1506
|
+
updateComponentDef(oldComp, newComp);
|
|
1503
1507
|
}
|
|
1504
1508
|
// 2. mark definition dirty. This forces the renderer to replace the
|
|
1505
1509
|
// component on patch.
|
|
@@ -1545,6 +1549,14 @@ function reload(id, newComp) {
|
|
|
1545
1549
|
}
|
|
1546
1550
|
});
|
|
1547
1551
|
}
|
|
1552
|
+
function updateComponentDef(oldComp, newComp) {
|
|
1553
|
+
extend(oldComp, newComp);
|
|
1554
|
+
for (const key in oldComp) {
|
|
1555
|
+
if (key !== '__file' && !(key in newComp)) {
|
|
1556
|
+
delete oldComp[key];
|
|
1557
|
+
}
|
|
1558
|
+
}
|
|
1559
|
+
}
|
|
1548
1560
|
function tryWrap(fn) {
|
|
1549
1561
|
return (id, arg) => {
|
|
1550
1562
|
try {
|
|
@@ -1560,27 +1572,52 @@ function tryWrap(fn) {
|
|
|
1560
1572
|
|
|
1561
1573
|
let devtools;
|
|
1562
1574
|
let buffer = [];
|
|
1575
|
+
let devtoolsNotInstalled = false;
|
|
1563
1576
|
function emit(event, ...args) {
|
|
1564
1577
|
if (devtools) {
|
|
1565
1578
|
devtools.emit(event, ...args);
|
|
1566
1579
|
}
|
|
1567
|
-
else {
|
|
1580
|
+
else if (!devtoolsNotInstalled) {
|
|
1568
1581
|
buffer.push({ event, args });
|
|
1569
1582
|
}
|
|
1570
1583
|
}
|
|
1571
1584
|
function setDevtoolsHook(hook, target) {
|
|
1585
|
+
var _a, _b;
|
|
1572
1586
|
devtools = hook;
|
|
1573
1587
|
if (devtools) {
|
|
1574
1588
|
devtools.enabled = true;
|
|
1575
1589
|
buffer.forEach(({ event, args }) => devtools.emit(event, ...args));
|
|
1576
1590
|
buffer = [];
|
|
1577
1591
|
}
|
|
1578
|
-
else
|
|
1592
|
+
else if (
|
|
1593
|
+
// handle late devtools injection - only do this if we are in an actual
|
|
1594
|
+
// browser environment to avoid the timer handle stalling test runner exit
|
|
1595
|
+
// (#4815)
|
|
1596
|
+
// eslint-disable-next-line no-restricted-globals
|
|
1597
|
+
typeof window !== 'undefined' &&
|
|
1598
|
+
// some envs mock window but not fully
|
|
1599
|
+
window.HTMLElement &&
|
|
1600
|
+
// also exclude jsdom
|
|
1601
|
+
!((_b = (_a = window.navigator) === null || _a === void 0 ? void 0 : _a.userAgent) === null || _b === void 0 ? void 0 : _b.includes('jsdom'))) {
|
|
1579
1602
|
const replay = (target.__VUE_DEVTOOLS_HOOK_REPLAY__ =
|
|
1580
1603
|
target.__VUE_DEVTOOLS_HOOK_REPLAY__ || []);
|
|
1581
1604
|
replay.push((newHook) => {
|
|
1582
1605
|
setDevtoolsHook(newHook, target);
|
|
1583
1606
|
});
|
|
1607
|
+
// clear buffer after 3s - the user probably doesn't have devtools installed
|
|
1608
|
+
// at all, and keeping the buffer will cause memory leaks (#4738)
|
|
1609
|
+
setTimeout(() => {
|
|
1610
|
+
if (!devtools) {
|
|
1611
|
+
target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null;
|
|
1612
|
+
devtoolsNotInstalled = true;
|
|
1613
|
+
buffer = [];
|
|
1614
|
+
}
|
|
1615
|
+
}, 3000);
|
|
1616
|
+
}
|
|
1617
|
+
else {
|
|
1618
|
+
// non-browser env, assume not installed
|
|
1619
|
+
devtoolsNotInstalled = true;
|
|
1620
|
+
buffer = [];
|
|
1584
1621
|
}
|
|
1585
1622
|
}
|
|
1586
1623
|
function devtoolsInitApp(app, version) {
|
|
@@ -2655,7 +2692,8 @@ const BaseTransitionImpl = {
|
|
|
2655
2692
|
const rawProps = toRaw(props);
|
|
2656
2693
|
const { mode } = rawProps;
|
|
2657
2694
|
// check mode
|
|
2658
|
-
if (mode &&
|
|
2695
|
+
if (mode &&
|
|
2696
|
+
mode !== 'in-out' && mode !== 'out-in' && mode !== 'default') {
|
|
2659
2697
|
warn$1(`invalid <transition> mode: ${mode}`);
|
|
2660
2698
|
}
|
|
2661
2699
|
// at this point children has a guaranteed length of 1.
|
|
@@ -3295,7 +3333,7 @@ function registerKeepAliveHook(hook, type, target = currentInstance) {
|
|
|
3295
3333
|
}
|
|
3296
3334
|
current = current.parent;
|
|
3297
3335
|
}
|
|
3298
|
-
hook();
|
|
3336
|
+
return hook();
|
|
3299
3337
|
});
|
|
3300
3338
|
injectHook(type, wrappedHook, target);
|
|
3301
3339
|
// In addition to registering it on the target instance, we walk up the parent
|
|
@@ -4369,7 +4407,7 @@ return withDirectives(h(comp), [
|
|
|
4369
4407
|
[bar, this.y]
|
|
4370
4408
|
])
|
|
4371
4409
|
*/
|
|
4372
|
-
const isBuiltInDirective = /*#__PURE__*/ makeMap('bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text');
|
|
4410
|
+
const isBuiltInDirective = /*#__PURE__*/ makeMap('bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo');
|
|
4373
4411
|
function validateDirectiveName(name) {
|
|
4374
4412
|
if (isBuiltInDirective(name)) {
|
|
4375
4413
|
warn$1('Do not use built-in directive ids as custom directive id: ' + name);
|
|
@@ -6286,8 +6324,8 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
|
6286
6324
|
*
|
|
6287
6325
|
* #2080
|
|
6288
6326
|
* Inside keyed `template` fragment static children, if a fragment is moved,
|
|
6289
|
-
* the children will always moved
|
|
6290
|
-
*
|
|
6327
|
+
* the children will always be moved. Therefore, in order to ensure correct move
|
|
6328
|
+
* position, el should be inherited from previous nodes.
|
|
6291
6329
|
*/
|
|
6292
6330
|
function traverseStaticChildren(n1, n2, shallow = false) {
|
|
6293
6331
|
const ch1 = n1.children;
|
|
@@ -7067,7 +7105,8 @@ function mergeProps(...args) {
|
|
|
7067
7105
|
else if (isOn(key)) {
|
|
7068
7106
|
const existing = ret[key];
|
|
7069
7107
|
const incoming = toMerge[key];
|
|
7070
|
-
if (existing !== incoming
|
|
7108
|
+
if (existing !== incoming &&
|
|
7109
|
+
!(isArray(existing) && existing.includes(incoming))) {
|
|
7071
7110
|
ret[key] = existing
|
|
7072
7111
|
? [].concat(existing, incoming)
|
|
7073
7112
|
: incoming;
|
|
@@ -7270,23 +7309,23 @@ const PublicInstanceProxyHandlers = {
|
|
|
7270
7309
|
const n = accessCache[key];
|
|
7271
7310
|
if (n !== undefined) {
|
|
7272
7311
|
switch (n) {
|
|
7273
|
-
case
|
|
7312
|
+
case 1 /* SETUP */:
|
|
7274
7313
|
return setupState[key];
|
|
7275
|
-
case
|
|
7314
|
+
case 2 /* DATA */:
|
|
7276
7315
|
return data[key];
|
|
7277
|
-
case
|
|
7316
|
+
case 4 /* CONTEXT */:
|
|
7278
7317
|
return ctx[key];
|
|
7279
|
-
case
|
|
7318
|
+
case 3 /* PROPS */:
|
|
7280
7319
|
return props[key];
|
|
7281
7320
|
// default: just fallthrough
|
|
7282
7321
|
}
|
|
7283
7322
|
}
|
|
7284
7323
|
else if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {
|
|
7285
|
-
accessCache[key] =
|
|
7324
|
+
accessCache[key] = 1 /* SETUP */;
|
|
7286
7325
|
return setupState[key];
|
|
7287
7326
|
}
|
|
7288
7327
|
else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
|
|
7289
|
-
accessCache[key] =
|
|
7328
|
+
accessCache[key] = 2 /* DATA */;
|
|
7290
7329
|
return data[key];
|
|
7291
7330
|
}
|
|
7292
7331
|
else if (
|
|
@@ -7294,15 +7333,15 @@ const PublicInstanceProxyHandlers = {
|
|
|
7294
7333
|
// props
|
|
7295
7334
|
(normalizedProps = instance.propsOptions[0]) &&
|
|
7296
7335
|
hasOwn(normalizedProps, key)) {
|
|
7297
|
-
accessCache[key] =
|
|
7336
|
+
accessCache[key] = 3 /* PROPS */;
|
|
7298
7337
|
return props[key];
|
|
7299
7338
|
}
|
|
7300
7339
|
else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
|
|
7301
|
-
accessCache[key] =
|
|
7340
|
+
accessCache[key] = 4 /* CONTEXT */;
|
|
7302
7341
|
return ctx[key];
|
|
7303
7342
|
}
|
|
7304
7343
|
else if (shouldCacheAccess) {
|
|
7305
|
-
accessCache[key] =
|
|
7344
|
+
accessCache[key] = 0 /* OTHER */;
|
|
7306
7345
|
}
|
|
7307
7346
|
}
|
|
7308
7347
|
const publicGetter = publicPropertiesMap[key];
|
|
@@ -7323,7 +7362,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
7323
7362
|
}
|
|
7324
7363
|
else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
|
|
7325
7364
|
// user may set custom properties to `this` that start with `$`
|
|
7326
|
-
accessCache[key] =
|
|
7365
|
+
accessCache[key] = 4 /* CONTEXT */;
|
|
7327
7366
|
return ctx[key];
|
|
7328
7367
|
}
|
|
7329
7368
|
else if (
|
|
@@ -7384,7 +7423,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
7384
7423
|
},
|
|
7385
7424
|
has({ _: { data, setupState, accessCache, ctx, appContext, propsOptions } }, key) {
|
|
7386
7425
|
let normalizedProps;
|
|
7387
|
-
return (accessCache[key]
|
|
7426
|
+
return (!!accessCache[key] ||
|
|
7388
7427
|
(data !== EMPTY_OBJ && hasOwn(data, key)) ||
|
|
7389
7428
|
(setupState !== EMPTY_OBJ && hasOwn(setupState, key)) ||
|
|
7390
7429
|
((normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key)) ||
|
|
@@ -8599,15 +8638,21 @@ function getContext() {
|
|
|
8599
8638
|
* only.
|
|
8600
8639
|
* @internal
|
|
8601
8640
|
*/
|
|
8602
|
-
function mergeDefaults(
|
|
8603
|
-
|
|
8604
|
-
|
|
8641
|
+
function mergeDefaults(raw, defaults) {
|
|
8642
|
+
const props = isArray(raw)
|
|
8643
|
+
? raw.reduce((normalized, p) => ((normalized[p] = {}), normalized), {})
|
|
8644
|
+
: raw;
|
|
8605
8645
|
for (const key in defaults) {
|
|
8606
|
-
const
|
|
8607
|
-
if (
|
|
8608
|
-
|
|
8646
|
+
const opt = props[key];
|
|
8647
|
+
if (opt) {
|
|
8648
|
+
if (isArray(opt) || isFunction(opt)) {
|
|
8649
|
+
props[key] = { type: opt, default: defaults[key] };
|
|
8650
|
+
}
|
|
8651
|
+
else {
|
|
8652
|
+
opt.default = defaults[key];
|
|
8653
|
+
}
|
|
8609
8654
|
}
|
|
8610
|
-
else if (
|
|
8655
|
+
else if (opt === null) {
|
|
8611
8656
|
props[key] = { default: defaults[key] };
|
|
8612
8657
|
}
|
|
8613
8658
|
else {
|
|
@@ -8616,6 +8661,23 @@ props, defaults) {
|
|
|
8616
8661
|
}
|
|
8617
8662
|
return props;
|
|
8618
8663
|
}
|
|
8664
|
+
/**
|
|
8665
|
+
* Used to create a proxy for the rest element when destructuring props with
|
|
8666
|
+
* defineProps().
|
|
8667
|
+
* @internal
|
|
8668
|
+
*/
|
|
8669
|
+
function createPropsRestProxy(props, excludedKeys) {
|
|
8670
|
+
const ret = {};
|
|
8671
|
+
for (const key in props) {
|
|
8672
|
+
if (!excludedKeys.includes(key)) {
|
|
8673
|
+
Object.defineProperty(ret, key, {
|
|
8674
|
+
enumerable: true,
|
|
8675
|
+
get: () => props[key]
|
|
8676
|
+
});
|
|
8677
|
+
}
|
|
8678
|
+
}
|
|
8679
|
+
return ret;
|
|
8680
|
+
}
|
|
8619
8681
|
/**
|
|
8620
8682
|
* `<script setup>` helper for persisting the current instance context over
|
|
8621
8683
|
* async/await flows.
|
|
@@ -8908,7 +8970,7 @@ function isMemoSame(cached, memo) {
|
|
|
8908
8970
|
}
|
|
8909
8971
|
|
|
8910
8972
|
// Core API ------------------------------------------------------------------
|
|
8911
|
-
const version = "3.2.
|
|
8973
|
+
const version = "3.2.23";
|
|
8912
8974
|
/**
|
|
8913
8975
|
* SSR utils for \@vue/server-renderer. Only exposed in cjs builds.
|
|
8914
8976
|
* @internal
|
|
@@ -9030,16 +9092,8 @@ function patchClass(el, value, isSVG) {
|
|
|
9030
9092
|
|
|
9031
9093
|
function patchStyle(el, prev, next) {
|
|
9032
9094
|
const style = el.style;
|
|
9033
|
-
const
|
|
9034
|
-
if (!
|
|
9035
|
-
el.removeAttribute('style');
|
|
9036
|
-
}
|
|
9037
|
-
else if (isString(next)) {
|
|
9038
|
-
if (prev !== next) {
|
|
9039
|
-
style.cssText = next;
|
|
9040
|
-
}
|
|
9041
|
-
}
|
|
9042
|
-
else {
|
|
9095
|
+
const isCssString = isString(next);
|
|
9096
|
+
if (next && !isCssString) {
|
|
9043
9097
|
for (const key in next) {
|
|
9044
9098
|
setStyle(style, key, next[key]);
|
|
9045
9099
|
}
|
|
@@ -9051,11 +9105,22 @@ function patchStyle(el, prev, next) {
|
|
|
9051
9105
|
}
|
|
9052
9106
|
}
|
|
9053
9107
|
}
|
|
9054
|
-
|
|
9055
|
-
|
|
9056
|
-
|
|
9057
|
-
|
|
9058
|
-
|
|
9108
|
+
else {
|
|
9109
|
+
const currentDisplay = style.display;
|
|
9110
|
+
if (isCssString) {
|
|
9111
|
+
if (prev !== next) {
|
|
9112
|
+
style.cssText = next;
|
|
9113
|
+
}
|
|
9114
|
+
}
|
|
9115
|
+
else if (prev) {
|
|
9116
|
+
el.removeAttribute('style');
|
|
9117
|
+
}
|
|
9118
|
+
// indicates that the `display` of the element is controlled by `v-show`,
|
|
9119
|
+
// so we always keep the current `display` value regardless of the `style`
|
|
9120
|
+
// value, thus handing over control to `v-show`.
|
|
9121
|
+
if ('_vod' in el) {
|
|
9122
|
+
style.display = currentDisplay;
|
|
9123
|
+
}
|
|
9059
9124
|
}
|
|
9060
9125
|
}
|
|
9061
9126
|
const importantRE = /\s*!important$/;
|
|
@@ -9138,12 +9203,19 @@ prevChildren, parentComponent, parentSuspense, unmountChildren) {
|
|
|
9138
9203
|
el[key] = value == null ? '' : value;
|
|
9139
9204
|
return;
|
|
9140
9205
|
}
|
|
9141
|
-
if (key === 'value' &&
|
|
9206
|
+
if (key === 'value' &&
|
|
9207
|
+
el.tagName !== 'PROGRESS' &&
|
|
9208
|
+
// custom elements may use _value internally
|
|
9209
|
+
!el.tagName.includes('-')) {
|
|
9142
9210
|
// store value as _value as well since
|
|
9143
9211
|
// non-string values will be stringified.
|
|
9144
9212
|
el._value = value;
|
|
9145
9213
|
const newValue = value == null ? '' : value;
|
|
9146
|
-
if (el.value !== newValue
|
|
9214
|
+
if (el.value !== newValue ||
|
|
9215
|
+
// #4956: always set for OPTION elements because its value falls back to
|
|
9216
|
+
// textContent if no value attribute is present. And setting .value for
|
|
9217
|
+
// OPTION has no side effect
|
|
9218
|
+
el.tagName === 'OPTION') {
|
|
9147
9219
|
el.value = newValue;
|
|
9148
9220
|
}
|
|
9149
9221
|
if (value == null) {
|
|
@@ -9401,22 +9473,11 @@ class VueElement extends BaseClass {
|
|
|
9401
9473
|
}
|
|
9402
9474
|
this.attachShadow({ mode: 'open' });
|
|
9403
9475
|
}
|
|
9404
|
-
// set initial attrs
|
|
9405
|
-
for (let i = 0; i < this.attributes.length; i++) {
|
|
9406
|
-
this._setAttr(this.attributes[i].name);
|
|
9407
|
-
}
|
|
9408
|
-
// watch future attr changes
|
|
9409
|
-
new MutationObserver(mutations => {
|
|
9410
|
-
for (const m of mutations) {
|
|
9411
|
-
this._setAttr(m.attributeName);
|
|
9412
|
-
}
|
|
9413
|
-
}).observe(this, { attributes: true });
|
|
9414
9476
|
}
|
|
9415
9477
|
connectedCallback() {
|
|
9416
9478
|
this._connected = true;
|
|
9417
9479
|
if (!this._instance) {
|
|
9418
9480
|
this._resolveDef();
|
|
9419
|
-
this._update();
|
|
9420
9481
|
}
|
|
9421
9482
|
}
|
|
9422
9483
|
disconnectedCallback() {
|
|
@@ -9435,8 +9496,18 @@ class VueElement extends BaseClass {
|
|
|
9435
9496
|
if (this._resolved) {
|
|
9436
9497
|
return;
|
|
9437
9498
|
}
|
|
9499
|
+
this._resolved = true;
|
|
9500
|
+
// set initial attrs
|
|
9501
|
+
for (let i = 0; i < this.attributes.length; i++) {
|
|
9502
|
+
this._setAttr(this.attributes[i].name);
|
|
9503
|
+
}
|
|
9504
|
+
// watch future attr changes
|
|
9505
|
+
new MutationObserver(mutations => {
|
|
9506
|
+
for (const m of mutations) {
|
|
9507
|
+
this._setAttr(m.attributeName);
|
|
9508
|
+
}
|
|
9509
|
+
}).observe(this, { attributes: true });
|
|
9438
9510
|
const resolve = (def) => {
|
|
9439
|
-
this._resolved = true;
|
|
9440
9511
|
const { props, styles } = def;
|
|
9441
9512
|
const hasOptions = !isArray(props);
|
|
9442
9513
|
const rawKeys = props ? (hasOptions ? Object.keys(props) : props) : [];
|
|
@@ -9451,14 +9522,11 @@ class VueElement extends BaseClass {
|
|
|
9451
9522
|
}
|
|
9452
9523
|
}
|
|
9453
9524
|
}
|
|
9454
|
-
|
|
9455
|
-
this._numberProps = numberProps;
|
|
9456
|
-
this._update();
|
|
9457
|
-
}
|
|
9525
|
+
this._numberProps = numberProps;
|
|
9458
9526
|
// check if there are props set pre-upgrade or connect
|
|
9459
9527
|
for (const key of Object.keys(this)) {
|
|
9460
9528
|
if (key[0] !== '_') {
|
|
9461
|
-
this._setProp(key, this[key]);
|
|
9529
|
+
this._setProp(key, this[key], true, false);
|
|
9462
9530
|
}
|
|
9463
9531
|
}
|
|
9464
9532
|
// defining getter/setters on prototype
|
|
@@ -9472,7 +9540,10 @@ class VueElement extends BaseClass {
|
|
|
9472
9540
|
}
|
|
9473
9541
|
});
|
|
9474
9542
|
}
|
|
9543
|
+
// apply CSS
|
|
9475
9544
|
this._applyStyles(styles);
|
|
9545
|
+
// initial render
|
|
9546
|
+
this._update();
|
|
9476
9547
|
};
|
|
9477
9548
|
const asyncDef = this._def.__asyncLoader;
|
|
9478
9549
|
if (asyncDef) {
|
|
@@ -9498,10 +9569,10 @@ class VueElement extends BaseClass {
|
|
|
9498
9569
|
/**
|
|
9499
9570
|
* @internal
|
|
9500
9571
|
*/
|
|
9501
|
-
_setProp(key, val, shouldReflect = true) {
|
|
9572
|
+
_setProp(key, val, shouldReflect = true, shouldUpdate = true) {
|
|
9502
9573
|
if (val !== this._props[key]) {
|
|
9503
9574
|
this._props[key] = val;
|
|
9504
|
-
if (this._instance) {
|
|
9575
|
+
if (shouldUpdate && this._instance) {
|
|
9505
9576
|
this._update();
|
|
9506
9577
|
}
|
|
9507
9578
|
// reflect
|
|
@@ -10536,4 +10607,4 @@ function normalizeContainer(container) {
|
|
|
10536
10607
|
*/
|
|
10537
10608
|
const initDirectivesForSSR = NOOP;
|
|
10538
10609
|
|
|
10539
|
-
export { BaseTransition, Comment, EffectScope, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, Transition, TransitionGroup, VueElement, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, 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 };
|
|
10610
|
+
export { BaseTransition, Comment, EffectScope, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, Transition, TransitionGroup, VueElement, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, 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 };
|