@vue/runtime-dom 3.2.17 → 3.2.21
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 +116 -58
- 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 +116 -57
- 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,11 +1572,12 @@ 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
|
}
|
|
@@ -1575,12 +1588,32 @@ function setDevtoolsHook(hook, target) {
|
|
|
1575
1588
|
buffer.forEach(({ event, args }) => devtools.emit(event, ...args));
|
|
1576
1589
|
buffer = [];
|
|
1577
1590
|
}
|
|
1578
|
-
else
|
|
1591
|
+
else if (
|
|
1592
|
+
// handle late devtools injection - only do this if we are in an actual
|
|
1593
|
+
// browser environment to avoid the timer handle stalling test runner exit
|
|
1594
|
+
// (#4815)
|
|
1595
|
+
// eslint-disable-next-line no-restricted-globals
|
|
1596
|
+
typeof window !== 'undefined' &&
|
|
1597
|
+
!navigator.userAgent.includes('jsdom')) {
|
|
1579
1598
|
const replay = (target.__VUE_DEVTOOLS_HOOK_REPLAY__ =
|
|
1580
1599
|
target.__VUE_DEVTOOLS_HOOK_REPLAY__ || []);
|
|
1581
1600
|
replay.push((newHook) => {
|
|
1582
1601
|
setDevtoolsHook(newHook, target);
|
|
1583
1602
|
});
|
|
1603
|
+
// clear buffer after 3s - the user probably doesn't have devtools installed
|
|
1604
|
+
// at all, and keeping the buffer will cause memory leaks (#4738)
|
|
1605
|
+
setTimeout(() => {
|
|
1606
|
+
if (!devtools) {
|
|
1607
|
+
target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null;
|
|
1608
|
+
devtoolsNotInstalled = true;
|
|
1609
|
+
buffer = [];
|
|
1610
|
+
}
|
|
1611
|
+
}, 3000);
|
|
1612
|
+
}
|
|
1613
|
+
else {
|
|
1614
|
+
// non-browser env, assume not installed
|
|
1615
|
+
devtoolsNotInstalled = true;
|
|
1616
|
+
buffer = [];
|
|
1584
1617
|
}
|
|
1585
1618
|
}
|
|
1586
1619
|
function devtoolsInitApp(app, version) {
|
|
@@ -4369,7 +4402,7 @@ return withDirectives(h(comp), [
|
|
|
4369
4402
|
[bar, this.y]
|
|
4370
4403
|
])
|
|
4371
4404
|
*/
|
|
4372
|
-
const isBuiltInDirective = /*#__PURE__*/ makeMap('bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text');
|
|
4405
|
+
const isBuiltInDirective = /*#__PURE__*/ makeMap('bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo');
|
|
4373
4406
|
function validateDirectiveName(name) {
|
|
4374
4407
|
if (isBuiltInDirective(name)) {
|
|
4375
4408
|
warn$1('Do not use built-in directive ids as custom directive id: ' + name);
|
|
@@ -8599,15 +8632,21 @@ function getContext() {
|
|
|
8599
8632
|
* only.
|
|
8600
8633
|
* @internal
|
|
8601
8634
|
*/
|
|
8602
|
-
function mergeDefaults(
|
|
8603
|
-
|
|
8604
|
-
|
|
8635
|
+
function mergeDefaults(raw, defaults) {
|
|
8636
|
+
const props = isArray(raw)
|
|
8637
|
+
? raw.reduce((normalized, p) => ((normalized[p] = {}), normalized), {})
|
|
8638
|
+
: raw;
|
|
8605
8639
|
for (const key in defaults) {
|
|
8606
|
-
const
|
|
8607
|
-
if (
|
|
8608
|
-
|
|
8640
|
+
const opt = props[key];
|
|
8641
|
+
if (opt) {
|
|
8642
|
+
if (isArray(opt) || isFunction(opt)) {
|
|
8643
|
+
props[key] = { type: opt, default: defaults[key] };
|
|
8644
|
+
}
|
|
8645
|
+
else {
|
|
8646
|
+
opt.default = defaults[key];
|
|
8647
|
+
}
|
|
8609
8648
|
}
|
|
8610
|
-
else if (
|
|
8649
|
+
else if (opt === null) {
|
|
8611
8650
|
props[key] = { default: defaults[key] };
|
|
8612
8651
|
}
|
|
8613
8652
|
else {
|
|
@@ -8616,6 +8655,23 @@ props, defaults) {
|
|
|
8616
8655
|
}
|
|
8617
8656
|
return props;
|
|
8618
8657
|
}
|
|
8658
|
+
/**
|
|
8659
|
+
* Used to create a proxy for the rest element when destructuring props with
|
|
8660
|
+
* defineProps().
|
|
8661
|
+
* @internal
|
|
8662
|
+
*/
|
|
8663
|
+
function createPropsRestProxy(props, excludedKeys) {
|
|
8664
|
+
const ret = {};
|
|
8665
|
+
for (const key in props) {
|
|
8666
|
+
if (!excludedKeys.includes(key)) {
|
|
8667
|
+
Object.defineProperty(ret, key, {
|
|
8668
|
+
enumerable: true,
|
|
8669
|
+
get: () => props[key]
|
|
8670
|
+
});
|
|
8671
|
+
}
|
|
8672
|
+
}
|
|
8673
|
+
return ret;
|
|
8674
|
+
}
|
|
8619
8675
|
/**
|
|
8620
8676
|
* `<script setup>` helper for persisting the current instance context over
|
|
8621
8677
|
* async/await flows.
|
|
@@ -8908,7 +8964,7 @@ function isMemoSame(cached, memo) {
|
|
|
8908
8964
|
}
|
|
8909
8965
|
|
|
8910
8966
|
// Core API ------------------------------------------------------------------
|
|
8911
|
-
const version = "3.2.
|
|
8967
|
+
const version = "3.2.21";
|
|
8912
8968
|
/**
|
|
8913
8969
|
* SSR utils for \@vue/server-renderer. Only exposed in cjs builds.
|
|
8914
8970
|
* @internal
|
|
@@ -9030,16 +9086,8 @@ function patchClass(el, value, isSVG) {
|
|
|
9030
9086
|
|
|
9031
9087
|
function patchStyle(el, prev, next) {
|
|
9032
9088
|
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 {
|
|
9089
|
+
const isCssString = isString(next);
|
|
9090
|
+
if (next && !isCssString) {
|
|
9043
9091
|
for (const key in next) {
|
|
9044
9092
|
setStyle(style, key, next[key]);
|
|
9045
9093
|
}
|
|
@@ -9051,11 +9099,22 @@ function patchStyle(el, prev, next) {
|
|
|
9051
9099
|
}
|
|
9052
9100
|
}
|
|
9053
9101
|
}
|
|
9054
|
-
|
|
9055
|
-
|
|
9056
|
-
|
|
9057
|
-
|
|
9058
|
-
|
|
9102
|
+
else {
|
|
9103
|
+
const currentDisplay = style.display;
|
|
9104
|
+
if (isCssString) {
|
|
9105
|
+
if (prev !== next) {
|
|
9106
|
+
style.cssText = next;
|
|
9107
|
+
}
|
|
9108
|
+
}
|
|
9109
|
+
else if (prev) {
|
|
9110
|
+
el.removeAttribute('style');
|
|
9111
|
+
}
|
|
9112
|
+
// indicates that the `display` of the element is controlled by `v-show`,
|
|
9113
|
+
// so we always keep the current `display` value regardless of the `style`
|
|
9114
|
+
// value, thus handing over control to `v-show`.
|
|
9115
|
+
if ('_vod' in el) {
|
|
9116
|
+
style.display = currentDisplay;
|
|
9117
|
+
}
|
|
9059
9118
|
}
|
|
9060
9119
|
}
|
|
9061
9120
|
const importantRE = /\s*!important$/;
|
|
@@ -9401,22 +9460,11 @@ class VueElement extends BaseClass {
|
|
|
9401
9460
|
}
|
|
9402
9461
|
this.attachShadow({ mode: 'open' });
|
|
9403
9462
|
}
|
|
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
9463
|
}
|
|
9415
9464
|
connectedCallback() {
|
|
9416
9465
|
this._connected = true;
|
|
9417
9466
|
if (!this._instance) {
|
|
9418
9467
|
this._resolveDef();
|
|
9419
|
-
this._update();
|
|
9420
9468
|
}
|
|
9421
9469
|
}
|
|
9422
9470
|
disconnectedCallback() {
|
|
@@ -9435,8 +9483,18 @@ class VueElement extends BaseClass {
|
|
|
9435
9483
|
if (this._resolved) {
|
|
9436
9484
|
return;
|
|
9437
9485
|
}
|
|
9486
|
+
this._resolved = true;
|
|
9487
|
+
// set initial attrs
|
|
9488
|
+
for (let i = 0; i < this.attributes.length; i++) {
|
|
9489
|
+
this._setAttr(this.attributes[i].name);
|
|
9490
|
+
}
|
|
9491
|
+
// watch future attr changes
|
|
9492
|
+
new MutationObserver(mutations => {
|
|
9493
|
+
for (const m of mutations) {
|
|
9494
|
+
this._setAttr(m.attributeName);
|
|
9495
|
+
}
|
|
9496
|
+
}).observe(this, { attributes: true });
|
|
9438
9497
|
const resolve = (def) => {
|
|
9439
|
-
this._resolved = true;
|
|
9440
9498
|
const { props, styles } = def;
|
|
9441
9499
|
const hasOptions = !isArray(props);
|
|
9442
9500
|
const rawKeys = props ? (hasOptions ? Object.keys(props) : props) : [];
|
|
@@ -9451,14 +9509,11 @@ class VueElement extends BaseClass {
|
|
|
9451
9509
|
}
|
|
9452
9510
|
}
|
|
9453
9511
|
}
|
|
9454
|
-
|
|
9455
|
-
this._numberProps = numberProps;
|
|
9456
|
-
this._update();
|
|
9457
|
-
}
|
|
9512
|
+
this._numberProps = numberProps;
|
|
9458
9513
|
// check if there are props set pre-upgrade or connect
|
|
9459
9514
|
for (const key of Object.keys(this)) {
|
|
9460
9515
|
if (key[0] !== '_') {
|
|
9461
|
-
this._setProp(key, this[key]);
|
|
9516
|
+
this._setProp(key, this[key], true, false);
|
|
9462
9517
|
}
|
|
9463
9518
|
}
|
|
9464
9519
|
// defining getter/setters on prototype
|
|
@@ -9472,7 +9527,10 @@ class VueElement extends BaseClass {
|
|
|
9472
9527
|
}
|
|
9473
9528
|
});
|
|
9474
9529
|
}
|
|
9530
|
+
// apply CSS
|
|
9475
9531
|
this._applyStyles(styles);
|
|
9532
|
+
// initial render
|
|
9533
|
+
this._update();
|
|
9476
9534
|
};
|
|
9477
9535
|
const asyncDef = this._def.__asyncLoader;
|
|
9478
9536
|
if (asyncDef) {
|
|
@@ -9498,10 +9556,10 @@ class VueElement extends BaseClass {
|
|
|
9498
9556
|
/**
|
|
9499
9557
|
* @internal
|
|
9500
9558
|
*/
|
|
9501
|
-
_setProp(key, val, shouldReflect = true) {
|
|
9559
|
+
_setProp(key, val, shouldReflect = true, shouldUpdate = true) {
|
|
9502
9560
|
if (val !== this._props[key]) {
|
|
9503
9561
|
this._props[key] = val;
|
|
9504
|
-
if (this._instance) {
|
|
9562
|
+
if (shouldUpdate && this._instance) {
|
|
9505
9563
|
this._update();
|
|
9506
9564
|
}
|
|
9507
9565
|
// reflect
|
|
@@ -10536,4 +10594,4 @@ function normalizeContainer(container) {
|
|
|
10536
10594
|
*/
|
|
10537
10595
|
const initDirectivesForSSR = NOOP;
|
|
10538
10596
|
|
|
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 };
|
|
10597
|
+
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 };
|