@vue/runtime-dom 3.2.18 → 3.2.22
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 +36 -34
- package/dist/runtime-dom.cjs.prod.js +36 -34
- package/dist/runtime-dom.d.ts +3 -1
- package/dist/runtime-dom.esm-browser.js +124 -61
- package/dist/runtime-dom.esm-browser.prod.js +1 -1
- package/dist/runtime-dom.esm-bundler.js +36 -34
- package/dist/runtime-dom.global.js +124 -60
- package/dist/runtime-dom.global.prod.js +1 -1
- package/package.json +3 -3
package/dist/runtime-dom.cjs.js
CHANGED
|
@@ -112,16 +112,8 @@ function patchClass(el, value, isSVG) {
|
|
|
112
112
|
|
|
113
113
|
function patchStyle(el, prev, next) {
|
|
114
114
|
const style = el.style;
|
|
115
|
-
const
|
|
116
|
-
if (!
|
|
117
|
-
el.removeAttribute('style');
|
|
118
|
-
}
|
|
119
|
-
else if (shared.isString(next)) {
|
|
120
|
-
if (prev !== next) {
|
|
121
|
-
style.cssText = next;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
else {
|
|
115
|
+
const isCssString = shared.isString(next);
|
|
116
|
+
if (next && !isCssString) {
|
|
125
117
|
for (const key in next) {
|
|
126
118
|
setStyle(style, key, next[key]);
|
|
127
119
|
}
|
|
@@ -133,11 +125,22 @@ function patchStyle(el, prev, next) {
|
|
|
133
125
|
}
|
|
134
126
|
}
|
|
135
127
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
128
|
+
else {
|
|
129
|
+
const currentDisplay = style.display;
|
|
130
|
+
if (isCssString) {
|
|
131
|
+
if (prev !== next) {
|
|
132
|
+
style.cssText = next;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
else if (prev) {
|
|
136
|
+
el.removeAttribute('style');
|
|
137
|
+
}
|
|
138
|
+
// indicates that the `display` of the element is controlled by `v-show`,
|
|
139
|
+
// so we always keep the current `display` value regardless of the `style`
|
|
140
|
+
// value, thus handing over control to `v-show`.
|
|
141
|
+
if ('_vod' in el) {
|
|
142
|
+
style.display = currentDisplay;
|
|
143
|
+
}
|
|
141
144
|
}
|
|
142
145
|
}
|
|
143
146
|
const importantRE = /\s*!important$/;
|
|
@@ -483,22 +486,11 @@ class VueElement extends BaseClass {
|
|
|
483
486
|
}
|
|
484
487
|
this.attachShadow({ mode: 'open' });
|
|
485
488
|
}
|
|
486
|
-
// set initial attrs
|
|
487
|
-
for (let i = 0; i < this.attributes.length; i++) {
|
|
488
|
-
this._setAttr(this.attributes[i].name);
|
|
489
|
-
}
|
|
490
|
-
// watch future attr changes
|
|
491
|
-
new MutationObserver(mutations => {
|
|
492
|
-
for (const m of mutations) {
|
|
493
|
-
this._setAttr(m.attributeName);
|
|
494
|
-
}
|
|
495
|
-
}).observe(this, { attributes: true });
|
|
496
489
|
}
|
|
497
490
|
connectedCallback() {
|
|
498
491
|
this._connected = true;
|
|
499
492
|
if (!this._instance) {
|
|
500
493
|
this._resolveDef();
|
|
501
|
-
this._update();
|
|
502
494
|
}
|
|
503
495
|
}
|
|
504
496
|
disconnectedCallback() {
|
|
@@ -517,8 +509,18 @@ class VueElement extends BaseClass {
|
|
|
517
509
|
if (this._resolved) {
|
|
518
510
|
return;
|
|
519
511
|
}
|
|
512
|
+
this._resolved = true;
|
|
513
|
+
// set initial attrs
|
|
514
|
+
for (let i = 0; i < this.attributes.length; i++) {
|
|
515
|
+
this._setAttr(this.attributes[i].name);
|
|
516
|
+
}
|
|
517
|
+
// watch future attr changes
|
|
518
|
+
new MutationObserver(mutations => {
|
|
519
|
+
for (const m of mutations) {
|
|
520
|
+
this._setAttr(m.attributeName);
|
|
521
|
+
}
|
|
522
|
+
}).observe(this, { attributes: true });
|
|
520
523
|
const resolve = (def) => {
|
|
521
|
-
this._resolved = true;
|
|
522
524
|
const { props, styles } = def;
|
|
523
525
|
const hasOptions = !shared.isArray(props);
|
|
524
526
|
const rawKeys = props ? (hasOptions ? Object.keys(props) : props) : [];
|
|
@@ -533,14 +535,11 @@ class VueElement extends BaseClass {
|
|
|
533
535
|
}
|
|
534
536
|
}
|
|
535
537
|
}
|
|
536
|
-
|
|
537
|
-
this._numberProps = numberProps;
|
|
538
|
-
this._update();
|
|
539
|
-
}
|
|
538
|
+
this._numberProps = numberProps;
|
|
540
539
|
// check if there are props set pre-upgrade or connect
|
|
541
540
|
for (const key of Object.keys(this)) {
|
|
542
541
|
if (key[0] !== '_') {
|
|
543
|
-
this._setProp(key, this[key]);
|
|
542
|
+
this._setProp(key, this[key], true, false);
|
|
544
543
|
}
|
|
545
544
|
}
|
|
546
545
|
// defining getter/setters on prototype
|
|
@@ -554,7 +553,10 @@ class VueElement extends BaseClass {
|
|
|
554
553
|
}
|
|
555
554
|
});
|
|
556
555
|
}
|
|
556
|
+
// apply CSS
|
|
557
557
|
this._applyStyles(styles);
|
|
558
|
+
// initial render
|
|
559
|
+
this._update();
|
|
558
560
|
};
|
|
559
561
|
const asyncDef = this._def.__asyncLoader;
|
|
560
562
|
if (asyncDef) {
|
|
@@ -580,10 +582,10 @@ class VueElement extends BaseClass {
|
|
|
580
582
|
/**
|
|
581
583
|
* @internal
|
|
582
584
|
*/
|
|
583
|
-
_setProp(key, val, shouldReflect = true) {
|
|
585
|
+
_setProp(key, val, shouldReflect = true, shouldUpdate = true) {
|
|
584
586
|
if (val !== this._props[key]) {
|
|
585
587
|
this._props[key] = val;
|
|
586
|
-
if (this._instance) {
|
|
588
|
+
if (shouldUpdate && this._instance) {
|
|
587
589
|
this._update();
|
|
588
590
|
}
|
|
589
591
|
// reflect
|
|
@@ -112,16 +112,8 @@ function patchClass(el, value, isSVG) {
|
|
|
112
112
|
|
|
113
113
|
function patchStyle(el, prev, next) {
|
|
114
114
|
const style = el.style;
|
|
115
|
-
const
|
|
116
|
-
if (!
|
|
117
|
-
el.removeAttribute('style');
|
|
118
|
-
}
|
|
119
|
-
else if (shared.isString(next)) {
|
|
120
|
-
if (prev !== next) {
|
|
121
|
-
style.cssText = next;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
else {
|
|
115
|
+
const isCssString = shared.isString(next);
|
|
116
|
+
if (next && !isCssString) {
|
|
125
117
|
for (const key in next) {
|
|
126
118
|
setStyle(style, key, next[key]);
|
|
127
119
|
}
|
|
@@ -133,11 +125,22 @@ function patchStyle(el, prev, next) {
|
|
|
133
125
|
}
|
|
134
126
|
}
|
|
135
127
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
128
|
+
else {
|
|
129
|
+
const currentDisplay = style.display;
|
|
130
|
+
if (isCssString) {
|
|
131
|
+
if (prev !== next) {
|
|
132
|
+
style.cssText = next;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
else if (prev) {
|
|
136
|
+
el.removeAttribute('style');
|
|
137
|
+
}
|
|
138
|
+
// indicates that the `display` of the element is controlled by `v-show`,
|
|
139
|
+
// so we always keep the current `display` value regardless of the `style`
|
|
140
|
+
// value, thus handing over control to `v-show`.
|
|
141
|
+
if ('_vod' in el) {
|
|
142
|
+
style.display = currentDisplay;
|
|
143
|
+
}
|
|
141
144
|
}
|
|
142
145
|
}
|
|
143
146
|
const importantRE = /\s*!important$/;
|
|
@@ -475,22 +478,11 @@ class VueElement extends BaseClass {
|
|
|
475
478
|
else {
|
|
476
479
|
this.attachShadow({ mode: 'open' });
|
|
477
480
|
}
|
|
478
|
-
// set initial attrs
|
|
479
|
-
for (let i = 0; i < this.attributes.length; i++) {
|
|
480
|
-
this._setAttr(this.attributes[i].name);
|
|
481
|
-
}
|
|
482
|
-
// watch future attr changes
|
|
483
|
-
new MutationObserver(mutations => {
|
|
484
|
-
for (const m of mutations) {
|
|
485
|
-
this._setAttr(m.attributeName);
|
|
486
|
-
}
|
|
487
|
-
}).observe(this, { attributes: true });
|
|
488
481
|
}
|
|
489
482
|
connectedCallback() {
|
|
490
483
|
this._connected = true;
|
|
491
484
|
if (!this._instance) {
|
|
492
485
|
this._resolveDef();
|
|
493
|
-
this._update();
|
|
494
486
|
}
|
|
495
487
|
}
|
|
496
488
|
disconnectedCallback() {
|
|
@@ -509,8 +501,18 @@ class VueElement extends BaseClass {
|
|
|
509
501
|
if (this._resolved) {
|
|
510
502
|
return;
|
|
511
503
|
}
|
|
504
|
+
this._resolved = true;
|
|
505
|
+
// set initial attrs
|
|
506
|
+
for (let i = 0; i < this.attributes.length; i++) {
|
|
507
|
+
this._setAttr(this.attributes[i].name);
|
|
508
|
+
}
|
|
509
|
+
// watch future attr changes
|
|
510
|
+
new MutationObserver(mutations => {
|
|
511
|
+
for (const m of mutations) {
|
|
512
|
+
this._setAttr(m.attributeName);
|
|
513
|
+
}
|
|
514
|
+
}).observe(this, { attributes: true });
|
|
512
515
|
const resolve = (def) => {
|
|
513
|
-
this._resolved = true;
|
|
514
516
|
const { props, styles } = def;
|
|
515
517
|
const hasOptions = !shared.isArray(props);
|
|
516
518
|
const rawKeys = props ? (hasOptions ? Object.keys(props) : props) : [];
|
|
@@ -525,14 +527,11 @@ class VueElement extends BaseClass {
|
|
|
525
527
|
}
|
|
526
528
|
}
|
|
527
529
|
}
|
|
528
|
-
|
|
529
|
-
this._numberProps = numberProps;
|
|
530
|
-
this._update();
|
|
531
|
-
}
|
|
530
|
+
this._numberProps = numberProps;
|
|
532
531
|
// check if there are props set pre-upgrade or connect
|
|
533
532
|
for (const key of Object.keys(this)) {
|
|
534
533
|
if (key[0] !== '_') {
|
|
535
|
-
this._setProp(key, this[key]);
|
|
534
|
+
this._setProp(key, this[key], true, false);
|
|
536
535
|
}
|
|
537
536
|
}
|
|
538
537
|
// defining getter/setters on prototype
|
|
@@ -546,7 +545,10 @@ class VueElement extends BaseClass {
|
|
|
546
545
|
}
|
|
547
546
|
});
|
|
548
547
|
}
|
|
548
|
+
// apply CSS
|
|
549
549
|
this._applyStyles(styles);
|
|
550
|
+
// initial render
|
|
551
|
+
this._update();
|
|
550
552
|
};
|
|
551
553
|
const asyncDef = this._def.__asyncLoader;
|
|
552
554
|
if (asyncDef) {
|
|
@@ -572,10 +574,10 @@ class VueElement extends BaseClass {
|
|
|
572
574
|
/**
|
|
573
575
|
* @internal
|
|
574
576
|
*/
|
|
575
|
-
_setProp(key, val, shouldReflect = true) {
|
|
577
|
+
_setProp(key, val, shouldReflect = true, shouldUpdate = true) {
|
|
576
578
|
if (val !== this._props[key]) {
|
|
577
579
|
this._props[key] = val;
|
|
578
|
-
if (this._instance) {
|
|
580
|
+
if (shouldUpdate && this._instance) {
|
|
579
581
|
this._update();
|
|
580
582
|
}
|
|
581
583
|
// reflect
|
package/dist/runtime-dom.d.ts
CHANGED
|
@@ -197,7 +197,9 @@ export { }
|
|
|
197
197
|
import { VNode } from '@vue/runtime-core'
|
|
198
198
|
import * as CSS from 'csstype'
|
|
199
199
|
|
|
200
|
-
export interface CSSProperties
|
|
200
|
+
export interface CSSProperties
|
|
201
|
+
extends CSS.Properties<string | number>,
|
|
202
|
+
CSS.PropertiesHyphen<string | number> {
|
|
201
203
|
/**
|
|
202
204
|
* The index signature was removed to enable closed typing for style
|
|
203
205
|
* using CSSType. You're able to use type assertion or module augmentation
|
|
@@ -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) {
|
|
@@ -4369,7 +4406,7 @@ return withDirectives(h(comp), [
|
|
|
4369
4406
|
[bar, this.y]
|
|
4370
4407
|
])
|
|
4371
4408
|
*/
|
|
4372
|
-
const isBuiltInDirective = /*#__PURE__*/ makeMap('bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text');
|
|
4409
|
+
const isBuiltInDirective = /*#__PURE__*/ makeMap('bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo');
|
|
4373
4410
|
function validateDirectiveName(name) {
|
|
4374
4411
|
if (isBuiltInDirective(name)) {
|
|
4375
4412
|
warn$1('Do not use built-in directive ids as custom directive id: ' + name);
|
|
@@ -6286,8 +6323,8 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
|
6286
6323
|
*
|
|
6287
6324
|
* #2080
|
|
6288
6325
|
* Inside keyed `template` fragment static children, if a fragment is moved,
|
|
6289
|
-
* the children will always moved
|
|
6290
|
-
*
|
|
6326
|
+
* the children will always be moved. Therefore, in order to ensure correct move
|
|
6327
|
+
* position, el should be inherited from previous nodes.
|
|
6291
6328
|
*/
|
|
6292
6329
|
function traverseStaticChildren(n1, n2, shallow = false) {
|
|
6293
6330
|
const ch1 = n1.children;
|
|
@@ -7067,7 +7104,8 @@ function mergeProps(...args) {
|
|
|
7067
7104
|
else if (isOn(key)) {
|
|
7068
7105
|
const existing = ret[key];
|
|
7069
7106
|
const incoming = toMerge[key];
|
|
7070
|
-
if (existing !== incoming
|
|
7107
|
+
if (existing !== incoming &&
|
|
7108
|
+
!(isArray(existing) && existing.includes(incoming))) {
|
|
7071
7109
|
ret[key] = existing
|
|
7072
7110
|
? [].concat(existing, incoming)
|
|
7073
7111
|
: incoming;
|
|
@@ -8599,15 +8637,21 @@ function getContext() {
|
|
|
8599
8637
|
* only.
|
|
8600
8638
|
* @internal
|
|
8601
8639
|
*/
|
|
8602
|
-
function mergeDefaults(
|
|
8603
|
-
|
|
8604
|
-
|
|
8640
|
+
function mergeDefaults(raw, defaults) {
|
|
8641
|
+
const props = isArray(raw)
|
|
8642
|
+
? raw.reduce((normalized, p) => ((normalized[p] = {}), normalized), {})
|
|
8643
|
+
: raw;
|
|
8605
8644
|
for (const key in defaults) {
|
|
8606
|
-
const
|
|
8607
|
-
if (
|
|
8608
|
-
|
|
8645
|
+
const opt = props[key];
|
|
8646
|
+
if (opt) {
|
|
8647
|
+
if (isArray(opt) || isFunction(opt)) {
|
|
8648
|
+
props[key] = { type: opt, default: defaults[key] };
|
|
8649
|
+
}
|
|
8650
|
+
else {
|
|
8651
|
+
opt.default = defaults[key];
|
|
8652
|
+
}
|
|
8609
8653
|
}
|
|
8610
|
-
else if (
|
|
8654
|
+
else if (opt === null) {
|
|
8611
8655
|
props[key] = { default: defaults[key] };
|
|
8612
8656
|
}
|
|
8613
8657
|
else {
|
|
@@ -8616,6 +8660,23 @@ props, defaults) {
|
|
|
8616
8660
|
}
|
|
8617
8661
|
return props;
|
|
8618
8662
|
}
|
|
8663
|
+
/**
|
|
8664
|
+
* Used to create a proxy for the rest element when destructuring props with
|
|
8665
|
+
* defineProps().
|
|
8666
|
+
* @internal
|
|
8667
|
+
*/
|
|
8668
|
+
function createPropsRestProxy(props, excludedKeys) {
|
|
8669
|
+
const ret = {};
|
|
8670
|
+
for (const key in props) {
|
|
8671
|
+
if (!excludedKeys.includes(key)) {
|
|
8672
|
+
Object.defineProperty(ret, key, {
|
|
8673
|
+
enumerable: true,
|
|
8674
|
+
get: () => props[key]
|
|
8675
|
+
});
|
|
8676
|
+
}
|
|
8677
|
+
}
|
|
8678
|
+
return ret;
|
|
8679
|
+
}
|
|
8619
8680
|
/**
|
|
8620
8681
|
* `<script setup>` helper for persisting the current instance context over
|
|
8621
8682
|
* async/await flows.
|
|
@@ -8908,7 +8969,7 @@ function isMemoSame(cached, memo) {
|
|
|
8908
8969
|
}
|
|
8909
8970
|
|
|
8910
8971
|
// Core API ------------------------------------------------------------------
|
|
8911
|
-
const version = "3.2.
|
|
8972
|
+
const version = "3.2.22";
|
|
8912
8973
|
/**
|
|
8913
8974
|
* SSR utils for \@vue/server-renderer. Only exposed in cjs builds.
|
|
8914
8975
|
* @internal
|
|
@@ -9030,16 +9091,8 @@ function patchClass(el, value, isSVG) {
|
|
|
9030
9091
|
|
|
9031
9092
|
function patchStyle(el, prev, next) {
|
|
9032
9093
|
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 {
|
|
9094
|
+
const isCssString = isString(next);
|
|
9095
|
+
if (next && !isCssString) {
|
|
9043
9096
|
for (const key in next) {
|
|
9044
9097
|
setStyle(style, key, next[key]);
|
|
9045
9098
|
}
|
|
@@ -9051,11 +9104,22 @@ function patchStyle(el, prev, next) {
|
|
|
9051
9104
|
}
|
|
9052
9105
|
}
|
|
9053
9106
|
}
|
|
9054
|
-
|
|
9055
|
-
|
|
9056
|
-
|
|
9057
|
-
|
|
9058
|
-
|
|
9107
|
+
else {
|
|
9108
|
+
const currentDisplay = style.display;
|
|
9109
|
+
if (isCssString) {
|
|
9110
|
+
if (prev !== next) {
|
|
9111
|
+
style.cssText = next;
|
|
9112
|
+
}
|
|
9113
|
+
}
|
|
9114
|
+
else if (prev) {
|
|
9115
|
+
el.removeAttribute('style');
|
|
9116
|
+
}
|
|
9117
|
+
// indicates that the `display` of the element is controlled by `v-show`,
|
|
9118
|
+
// so we always keep the current `display` value regardless of the `style`
|
|
9119
|
+
// value, thus handing over control to `v-show`.
|
|
9120
|
+
if ('_vod' in el) {
|
|
9121
|
+
style.display = currentDisplay;
|
|
9122
|
+
}
|
|
9059
9123
|
}
|
|
9060
9124
|
}
|
|
9061
9125
|
const importantRE = /\s*!important$/;
|
|
@@ -9401,22 +9465,11 @@ class VueElement extends BaseClass {
|
|
|
9401
9465
|
}
|
|
9402
9466
|
this.attachShadow({ mode: 'open' });
|
|
9403
9467
|
}
|
|
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
9468
|
}
|
|
9415
9469
|
connectedCallback() {
|
|
9416
9470
|
this._connected = true;
|
|
9417
9471
|
if (!this._instance) {
|
|
9418
9472
|
this._resolveDef();
|
|
9419
|
-
this._update();
|
|
9420
9473
|
}
|
|
9421
9474
|
}
|
|
9422
9475
|
disconnectedCallback() {
|
|
@@ -9435,8 +9488,18 @@ class VueElement extends BaseClass {
|
|
|
9435
9488
|
if (this._resolved) {
|
|
9436
9489
|
return;
|
|
9437
9490
|
}
|
|
9491
|
+
this._resolved = true;
|
|
9492
|
+
// set initial attrs
|
|
9493
|
+
for (let i = 0; i < this.attributes.length; i++) {
|
|
9494
|
+
this._setAttr(this.attributes[i].name);
|
|
9495
|
+
}
|
|
9496
|
+
// watch future attr changes
|
|
9497
|
+
new MutationObserver(mutations => {
|
|
9498
|
+
for (const m of mutations) {
|
|
9499
|
+
this._setAttr(m.attributeName);
|
|
9500
|
+
}
|
|
9501
|
+
}).observe(this, { attributes: true });
|
|
9438
9502
|
const resolve = (def) => {
|
|
9439
|
-
this._resolved = true;
|
|
9440
9503
|
const { props, styles } = def;
|
|
9441
9504
|
const hasOptions = !isArray(props);
|
|
9442
9505
|
const rawKeys = props ? (hasOptions ? Object.keys(props) : props) : [];
|
|
@@ -9451,14 +9514,11 @@ class VueElement extends BaseClass {
|
|
|
9451
9514
|
}
|
|
9452
9515
|
}
|
|
9453
9516
|
}
|
|
9454
|
-
|
|
9455
|
-
this._numberProps = numberProps;
|
|
9456
|
-
this._update();
|
|
9457
|
-
}
|
|
9517
|
+
this._numberProps = numberProps;
|
|
9458
9518
|
// check if there are props set pre-upgrade or connect
|
|
9459
9519
|
for (const key of Object.keys(this)) {
|
|
9460
9520
|
if (key[0] !== '_') {
|
|
9461
|
-
this._setProp(key, this[key]);
|
|
9521
|
+
this._setProp(key, this[key], true, false);
|
|
9462
9522
|
}
|
|
9463
9523
|
}
|
|
9464
9524
|
// defining getter/setters on prototype
|
|
@@ -9472,7 +9532,10 @@ class VueElement extends BaseClass {
|
|
|
9472
9532
|
}
|
|
9473
9533
|
});
|
|
9474
9534
|
}
|
|
9535
|
+
// apply CSS
|
|
9475
9536
|
this._applyStyles(styles);
|
|
9537
|
+
// initial render
|
|
9538
|
+
this._update();
|
|
9476
9539
|
};
|
|
9477
9540
|
const asyncDef = this._def.__asyncLoader;
|
|
9478
9541
|
if (asyncDef) {
|
|
@@ -9498,10 +9561,10 @@ class VueElement extends BaseClass {
|
|
|
9498
9561
|
/**
|
|
9499
9562
|
* @internal
|
|
9500
9563
|
*/
|
|
9501
|
-
_setProp(key, val, shouldReflect = true) {
|
|
9564
|
+
_setProp(key, val, shouldReflect = true, shouldUpdate = true) {
|
|
9502
9565
|
if (val !== this._props[key]) {
|
|
9503
9566
|
this._props[key] = val;
|
|
9504
|
-
if (this._instance) {
|
|
9567
|
+
if (shouldUpdate && this._instance) {
|
|
9505
9568
|
this._update();
|
|
9506
9569
|
}
|
|
9507
9570
|
// reflect
|
|
@@ -10536,4 +10599,4 @@ function normalizeContainer(container) {
|
|
|
10536
10599
|
*/
|
|
10537
10600
|
const initDirectivesForSSR = NOOP;
|
|
10538
10601
|
|
|
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 };
|
|
10602
|
+
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 };
|