@vue/runtime-dom 3.6.0-beta.7 → 3.6.0-beta.9
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 +52 -33
- package/dist/runtime-dom.cjs.prod.js +50 -33
- package/dist/runtime-dom.d.ts +122 -115
- package/dist/runtime-dom.esm-browser.js +167 -193
- package/dist/runtime-dom.esm-browser.prod.js +3 -3
- package/dist/runtime-dom.esm-bundler.js +43 -30
- package/dist/runtime-dom.global.js +528 -556
- package/dist/runtime-dom.global.prod.js +3 -3
- package/package.json +4 -4
package/dist/runtime-dom.cjs.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-dom v3.6.0-beta.
|
|
2
|
+
* @vue/runtime-dom v3.6.0-beta.9
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
6
|
-
Object.defineProperties(exports, {
|
|
6
|
+
Object.defineProperties(exports, {
|
|
7
|
+
__esModule: { value: true },
|
|
8
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
9
|
+
});
|
|
7
10
|
let _vue_runtime_core = require("@vue/runtime-core");
|
|
8
11
|
let _vue_shared = require("@vue/shared");
|
|
9
|
-
|
|
10
12
|
//#region packages/runtime-dom/src/nodeOps.ts
|
|
11
13
|
let policy = void 0;
|
|
12
14
|
const tt = typeof window !== "undefined" && window.trustedTypes;
|
|
@@ -66,7 +68,6 @@ const nodeOps = {
|
|
|
66
68
|
return [before ? before.nextSibling : parent.firstChild, anchor ? anchor.previousSibling : parent.lastChild];
|
|
67
69
|
}
|
|
68
70
|
};
|
|
69
|
-
|
|
70
71
|
//#endregion
|
|
71
72
|
//#region packages/runtime-dom/src/components/Transition.ts
|
|
72
73
|
const TRANSITION = "transition";
|
|
@@ -305,7 +306,6 @@ function toMs(s) {
|
|
|
305
306
|
function forceReflow(el) {
|
|
306
307
|
return (el ? el.ownerDocument : document).body.offsetHeight;
|
|
307
308
|
}
|
|
308
|
-
|
|
309
309
|
//#endregion
|
|
310
310
|
//#region packages/runtime-dom/src/modules/class.ts
|
|
311
311
|
function patchClass(el, value, isSVG) {
|
|
@@ -315,7 +315,6 @@ function patchClass(el, value, isSVG) {
|
|
|
315
315
|
else if (isSVG) el.setAttribute("class", value);
|
|
316
316
|
else el.className = value;
|
|
317
317
|
}
|
|
318
|
-
|
|
319
318
|
//#endregion
|
|
320
319
|
//#region packages/runtime-dom/src/directives/vShow.ts
|
|
321
320
|
const vShowOriginalDisplay = Symbol("_vod");
|
|
@@ -354,7 +353,6 @@ function initVShowForSSR() {
|
|
|
354
353
|
if (!value) return { style: { display: "none" } };
|
|
355
354
|
};
|
|
356
355
|
}
|
|
357
|
-
|
|
358
356
|
//#endregion
|
|
359
357
|
//#region packages/runtime-dom/src/helpers/useCssVars.ts
|
|
360
358
|
const CSS_VAR_TEXT = Symbol("CSS_VAR_TEXT");
|
|
@@ -363,7 +361,6 @@ const CSS_VAR_TEXT = Symbol("CSS_VAR_TEXT");
|
|
|
363
361
|
* @private
|
|
364
362
|
*/
|
|
365
363
|
function useCssVars(getter) {}
|
|
366
|
-
|
|
367
364
|
//#endregion
|
|
368
365
|
//#region packages/runtime-dom/src/modules/style.ts
|
|
369
366
|
const displayRE = /(?:^|;)\s*display\s*:/;
|
|
@@ -428,7 +425,6 @@ function autoPrefix(style, rawName) {
|
|
|
428
425
|
}
|
|
429
426
|
return rawName;
|
|
430
427
|
}
|
|
431
|
-
|
|
432
428
|
//#endregion
|
|
433
429
|
//#region packages/runtime-dom/src/modules/attrs.ts
|
|
434
430
|
const xlinkNS = "http://www.w3.org/1999/xlink";
|
|
@@ -438,7 +434,6 @@ function patchAttr(el, key, value, isSVG, instance, isBoolean = (0, _vue_shared.
|
|
|
438
434
|
else if (value == null || isBoolean && !(0, _vue_shared.includeBooleanAttr)(value)) el.removeAttribute(key);
|
|
439
435
|
else el.setAttribute(key, isBoolean ? "" : (0, _vue_shared.isSymbol)(value) ? String(value) : value);
|
|
440
436
|
}
|
|
441
|
-
|
|
442
437
|
//#endregion
|
|
443
438
|
//#region packages/runtime-dom/src/modules/props.ts
|
|
444
439
|
function patchDOMProp(el, key, value, parentComponent, attrName) {
|
|
@@ -474,7 +469,6 @@ function patchDOMProp(el, key, value, parentComponent, attrName) {
|
|
|
474
469
|
}
|
|
475
470
|
needRemove && el.removeAttribute(attrName || key);
|
|
476
471
|
}
|
|
477
|
-
|
|
478
472
|
//#endregion
|
|
479
473
|
//#region packages/runtime-dom/src/modules/events.ts
|
|
480
474
|
function addEventListener(el, event, handler, options) {
|
|
@@ -538,7 +532,6 @@ function patchStopImmediatePropagation(e, value) {
|
|
|
538
532
|
return value.map((fn) => (e) => !e._stopped && fn && fn(e));
|
|
539
533
|
} else return value;
|
|
540
534
|
}
|
|
541
|
-
|
|
542
535
|
//#endregion
|
|
543
536
|
//#region packages/runtime-dom/src/patchProp.ts
|
|
544
537
|
const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => {
|
|
@@ -550,7 +543,7 @@ const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) =>
|
|
|
550
543
|
} else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) {
|
|
551
544
|
patchDOMProp(el, key, nextValue, parentComponent);
|
|
552
545
|
if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value");
|
|
553
|
-
} else if (el._isVueCE && (/[A-Z]/.test(key) || !(0, _vue_shared.isString)(nextValue))) patchDOMProp(el, (0, _vue_shared.camelize)(key), nextValue, parentComponent, key);
|
|
546
|
+
} else if (el._isVueCE && (shouldSetAsPropForVueCE(el, key) || el._def.__asyncLoader && (/[A-Z]/.test(key) || !(0, _vue_shared.isString)(nextValue)))) patchDOMProp(el, (0, _vue_shared.camelize)(key), nextValue, parentComponent, key);
|
|
554
547
|
else {
|
|
555
548
|
if (key === "true-value") el._trueValue = nextValue;
|
|
556
549
|
else if (key === "false-value") el._falseValue = nextValue;
|
|
@@ -567,7 +560,12 @@ function shouldSetAsProp(el, key, value, isSVG) {
|
|
|
567
560
|
if ((0, _vue_shared.isNativeOn)(key) && (0, _vue_shared.isString)(value)) return false;
|
|
568
561
|
return key in el;
|
|
569
562
|
}
|
|
570
|
-
|
|
563
|
+
function shouldSetAsPropForVueCE(el, key) {
|
|
564
|
+
const props = el._def.props;
|
|
565
|
+
if (!props) return false;
|
|
566
|
+
const camelKey = (0, _vue_shared.camelize)(key);
|
|
567
|
+
return Array.isArray(props) ? props.some((prop) => (0, _vue_shared.camelize)(prop) === camelKey) : Object.keys(props).some((prop) => (0, _vue_shared.camelize)(prop) === camelKey);
|
|
568
|
+
}
|
|
571
569
|
//#endregion
|
|
572
570
|
//#region packages/runtime-dom/src/apiCustomElement.ts
|
|
573
571
|
const REMOVAL = {};
|
|
@@ -597,6 +595,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
597
595
|
this._resolved = false;
|
|
598
596
|
this._numberProps = null;
|
|
599
597
|
this._styleChildren = /* @__PURE__ */ new WeakSet();
|
|
598
|
+
this._styleAnchors = /* @__PURE__ */ new WeakMap();
|
|
600
599
|
this._patching = false;
|
|
601
600
|
this._dirty = false;
|
|
602
601
|
this._ob = null;
|
|
@@ -615,7 +614,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
615
614
|
if (!this.shadowRoot && !this._resolved) this._parseSlots();
|
|
616
615
|
this._connected = true;
|
|
617
616
|
let parent = this;
|
|
618
|
-
while (parent = parent && (parent.parentNode || parent.host)) if (parent instanceof VueElementBase) {
|
|
617
|
+
while (parent = parent && (parent.assignedSlot || parent.parentNode || parent.host)) if (parent instanceof VueElementBase) {
|
|
619
618
|
this._parent = parent;
|
|
620
619
|
break;
|
|
621
620
|
}
|
|
@@ -708,6 +707,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
708
707
|
this._styles.forEach((s) => this._root.removeChild(s));
|
|
709
708
|
this._styles.length = 0;
|
|
710
709
|
}
|
|
710
|
+
this._styleAnchors.delete(this._def);
|
|
711
711
|
this._applyStyles(newStyles);
|
|
712
712
|
if (!this._instance.vapor) this._instance = null;
|
|
713
713
|
this._update();
|
|
@@ -773,18 +773,26 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
773
773
|
}
|
|
774
774
|
}
|
|
775
775
|
}
|
|
776
|
-
_applyStyles(styles, owner) {
|
|
776
|
+
_applyStyles(styles, owner, parentComp) {
|
|
777
777
|
if (!styles) return;
|
|
778
778
|
if (owner) {
|
|
779
779
|
if (owner === this._def || this._styleChildren.has(owner)) return;
|
|
780
780
|
this._styleChildren.add(owner);
|
|
781
781
|
}
|
|
782
782
|
const nonce = this._nonce;
|
|
783
|
+
const root = this.shadowRoot;
|
|
784
|
+
const insertionAnchor = parentComp ? this._getStyleAnchor(parentComp) || this._getStyleAnchor(this._def) : this._getRootStyleInsertionAnchor(root);
|
|
785
|
+
let last = null;
|
|
783
786
|
for (let i = styles.length - 1; i >= 0; i--) {
|
|
784
787
|
const s = document.createElement("style");
|
|
785
788
|
if (nonce) s.setAttribute("nonce", nonce);
|
|
786
789
|
s.textContent = styles[i];
|
|
787
|
-
|
|
790
|
+
root.insertBefore(s, last || insertionAnchor);
|
|
791
|
+
last = s;
|
|
792
|
+
if (i === 0) {
|
|
793
|
+
if (!parentComp) this._styleAnchors.set(this._def, s);
|
|
794
|
+
if (owner) this._styleAnchors.set(owner, s);
|
|
795
|
+
}
|
|
788
796
|
if (owner) {
|
|
789
797
|
if (owner.__hmrId) {
|
|
790
798
|
if (!this._childStyles) this._childStyles = /* @__PURE__ */ new Map();
|
|
@@ -795,6 +803,20 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
795
803
|
} else (this._styles || (this._styles = [])).push(s);
|
|
796
804
|
}
|
|
797
805
|
}
|
|
806
|
+
_getStyleAnchor(comp) {
|
|
807
|
+
if (!comp) return null;
|
|
808
|
+
const anchor = this._styleAnchors.get(comp);
|
|
809
|
+
if (anchor && anchor.parentNode === this.shadowRoot) return anchor;
|
|
810
|
+
if (anchor) this._styleAnchors.delete(comp);
|
|
811
|
+
return null;
|
|
812
|
+
}
|
|
813
|
+
_getRootStyleInsertionAnchor(root) {
|
|
814
|
+
for (let i = 0; i < root.childNodes.length; i++) {
|
|
815
|
+
const node = root.childNodes[i];
|
|
816
|
+
if (!(node instanceof HTMLStyleElement)) return node;
|
|
817
|
+
}
|
|
818
|
+
return null;
|
|
819
|
+
}
|
|
798
820
|
/**
|
|
799
821
|
* Only called when shadowRoot is false
|
|
800
822
|
*/
|
|
@@ -857,8 +879,8 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
857
879
|
/**
|
|
858
880
|
* @internal
|
|
859
881
|
*/
|
|
860
|
-
_injectChildStyle(comp) {
|
|
861
|
-
this._applyStyles(comp.styles, comp);
|
|
882
|
+
_injectChildStyle(comp, parentComp) {
|
|
883
|
+
this._applyStyles(comp.styles, comp, parentComp);
|
|
862
884
|
}
|
|
863
885
|
/**
|
|
864
886
|
* @internal
|
|
@@ -885,6 +907,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
885
907
|
*/
|
|
886
908
|
_removeChildStyle(comp) {
|
|
887
909
|
this._styleChildren.delete(comp);
|
|
910
|
+
this._styleAnchors.delete(comp);
|
|
888
911
|
if (this._childStyles && comp.__hmrId) {
|
|
889
912
|
const oldStyles = this._childStyles.get(comp.__hmrId);
|
|
890
913
|
if (oldStyles) {
|
|
@@ -953,7 +976,6 @@ function useShadowRoot() {
|
|
|
953
976
|
const el = useHost("useShadowRoot");
|
|
954
977
|
return el && el.shadowRoot;
|
|
955
978
|
}
|
|
956
|
-
|
|
957
979
|
//#endregion
|
|
958
980
|
//#region packages/runtime-dom/src/helpers/useCssModule.ts
|
|
959
981
|
function useCssModule(name = "$style") {
|
|
@@ -976,7 +998,6 @@ function useCssModule(name = "$style") {
|
|
|
976
998
|
return mod;
|
|
977
999
|
}
|
|
978
1000
|
}
|
|
979
|
-
|
|
980
1001
|
//#endregion
|
|
981
1002
|
//#region packages/runtime-dom/src/components/TransitionGroup.ts
|
|
982
1003
|
const positionMap = /* @__PURE__ */ new WeakMap();
|
|
@@ -991,7 +1012,7 @@ const decorate = (t) => {
|
|
|
991
1012
|
delete t.props.mode;
|
|
992
1013
|
return t;
|
|
993
1014
|
};
|
|
994
|
-
const
|
|
1015
|
+
const TransitionGroup = /* @__PURE__ */ decorate({
|
|
995
1016
|
name: "TransitionGroup",
|
|
996
1017
|
props: /* @__PURE__ */ (0, _vue_shared.extend)({}, TransitionPropsValidators, {
|
|
997
1018
|
tag: String,
|
|
@@ -1042,7 +1063,6 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
|
|
|
1042
1063
|
};
|
|
1043
1064
|
}
|
|
1044
1065
|
});
|
|
1045
|
-
const TransitionGroup = TransitionGroupImpl;
|
|
1046
1066
|
function callPendingCbs(el) {
|
|
1047
1067
|
if (el[moveCbKey]) el[moveCbKey]();
|
|
1048
1068
|
if (el[enterCbKey]) el[enterCbKey]();
|
|
@@ -1108,7 +1128,6 @@ const handleMovedChildren = (el, moveClass) => {
|
|
|
1108
1128
|
};
|
|
1109
1129
|
el.addEventListener("transitionend", cb);
|
|
1110
1130
|
};
|
|
1111
|
-
|
|
1112
1131
|
//#endregion
|
|
1113
1132
|
//#region packages/runtime-dom/src/directives/vModel.ts
|
|
1114
1133
|
const getModelAssigner = (vnode) => {
|
|
@@ -1169,7 +1188,8 @@ const vModelTextUpdate = (el, oldValue, value, trim, number, lazy) => {
|
|
|
1169
1188
|
const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? (0, _vue_shared.looseToNumber)(el.value) : el.value;
|
|
1170
1189
|
const newValue = value == null ? "" : value;
|
|
1171
1190
|
if (elValue === newValue) return;
|
|
1172
|
-
|
|
1191
|
+
const rootNode = el.getRootNode();
|
|
1192
|
+
if ((rootNode instanceof Document || rootNode instanceof ShadowRoot) && rootNode.activeElement === el && el.type !== "range") {
|
|
1173
1193
|
if (lazy && value === oldValue) return;
|
|
1174
1194
|
if (trim && el.value.trim() === newValue) return;
|
|
1175
1195
|
}
|
|
@@ -1358,7 +1378,6 @@ function initVModelForSSR() {
|
|
|
1358
1378
|
if (modelToUse.getSSRProps) return modelToUse.getSSRProps(binding, vnode);
|
|
1359
1379
|
};
|
|
1360
1380
|
}
|
|
1361
|
-
|
|
1362
1381
|
//#endregion
|
|
1363
1382
|
//#region packages/runtime-dom/src/directives/vOn.ts
|
|
1364
1383
|
const systemModifiers = [
|
|
@@ -1416,7 +1435,6 @@ const withKeys = (fn, modifiers) => {
|
|
|
1416
1435
|
if (modifiers.some((k) => k === eventKey || keyNames[k] === eventKey)) return fn(event);
|
|
1417
1436
|
}));
|
|
1418
1437
|
};
|
|
1419
|
-
|
|
1420
1438
|
//#endregion
|
|
1421
1439
|
//#region packages/runtime-dom/src/index.ts
|
|
1422
1440
|
const rendererOptions = /* @__PURE__ */ (0, _vue_shared.extend)({ patchProp }, nodeOps);
|
|
@@ -1525,7 +1543,6 @@ const initDirectivesForSSR = () => {
|
|
|
1525
1543
|
initVShowForSSR();
|
|
1526
1544
|
}
|
|
1527
1545
|
};
|
|
1528
|
-
|
|
1529
1546
|
//#endregion
|
|
1530
1547
|
exports.Transition = Transition;
|
|
1531
1548
|
exports.TransitionGroup = TransitionGroup;
|
|
@@ -1552,9 +1569,11 @@ exports.vModelText = vModelText;
|
|
|
1552
1569
|
exports.vShow = vShow;
|
|
1553
1570
|
exports.withKeys = withKeys;
|
|
1554
1571
|
exports.withModifiers = withModifiers;
|
|
1555
|
-
Object.keys(_vue_runtime_core).forEach(function
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1572
|
+
Object.keys(_vue_runtime_core).forEach(function(k) {
|
|
1573
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
1574
|
+
enumerable: true,
|
|
1575
|
+
get: function() {
|
|
1576
|
+
return _vue_runtime_core[k];
|
|
1577
|
+
}
|
|
1578
|
+
});
|
|
1560
1579
|
});
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-dom v3.6.0-beta.
|
|
2
|
+
* @vue/runtime-dom v3.6.0-beta.9
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
6
|
-
Object.defineProperties(exports, {
|
|
6
|
+
Object.defineProperties(exports, {
|
|
7
|
+
__esModule: { value: true },
|
|
8
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
9
|
+
});
|
|
7
10
|
let _vue_runtime_core = require("@vue/runtime-core");
|
|
8
11
|
let _vue_shared = require("@vue/shared");
|
|
9
|
-
|
|
10
12
|
//#region packages/runtime-dom/src/nodeOps.ts
|
|
11
13
|
let policy = void 0;
|
|
12
14
|
const tt = typeof window !== "undefined" && window.trustedTypes;
|
|
@@ -64,7 +66,6 @@ const nodeOps = {
|
|
|
64
66
|
return [before ? before.nextSibling : parent.firstChild, anchor ? anchor.previousSibling : parent.lastChild];
|
|
65
67
|
}
|
|
66
68
|
};
|
|
67
|
-
|
|
68
69
|
//#endregion
|
|
69
70
|
//#region packages/runtime-dom/src/components/Transition.ts
|
|
70
71
|
const TRANSITION = "transition";
|
|
@@ -301,7 +302,6 @@ function toMs(s) {
|
|
|
301
302
|
function forceReflow(el) {
|
|
302
303
|
return (el ? el.ownerDocument : document).body.offsetHeight;
|
|
303
304
|
}
|
|
304
|
-
|
|
305
305
|
//#endregion
|
|
306
306
|
//#region packages/runtime-dom/src/modules/class.ts
|
|
307
307
|
function patchClass(el, value, isSVG) {
|
|
@@ -311,7 +311,6 @@ function patchClass(el, value, isSVG) {
|
|
|
311
311
|
else if (isSVG) el.setAttribute("class", value);
|
|
312
312
|
else el.className = value;
|
|
313
313
|
}
|
|
314
|
-
|
|
315
314
|
//#endregion
|
|
316
315
|
//#region packages/runtime-dom/src/directives/vShow.ts
|
|
317
316
|
const vShowOriginalDisplay = Symbol("_vod");
|
|
@@ -350,7 +349,6 @@ function initVShowForSSR() {
|
|
|
350
349
|
if (!value) return { style: { display: "none" } };
|
|
351
350
|
};
|
|
352
351
|
}
|
|
353
|
-
|
|
354
352
|
//#endregion
|
|
355
353
|
//#region packages/runtime-dom/src/helpers/useCssVars.ts
|
|
356
354
|
const CSS_VAR_TEXT = Symbol("");
|
|
@@ -359,7 +357,6 @@ const CSS_VAR_TEXT = Symbol("");
|
|
|
359
357
|
* @private
|
|
360
358
|
*/
|
|
361
359
|
function useCssVars(getter) {}
|
|
362
|
-
|
|
363
360
|
//#endregion
|
|
364
361
|
//#region packages/runtime-dom/src/modules/style.ts
|
|
365
362
|
const displayRE = /(?:^|;)\s*display\s*:/;
|
|
@@ -422,7 +419,6 @@ function autoPrefix(style, rawName) {
|
|
|
422
419
|
}
|
|
423
420
|
return rawName;
|
|
424
421
|
}
|
|
425
|
-
|
|
426
422
|
//#endregion
|
|
427
423
|
//#region packages/runtime-dom/src/modules/attrs.ts
|
|
428
424
|
const xlinkNS = "http://www.w3.org/1999/xlink";
|
|
@@ -432,7 +428,6 @@ function patchAttr(el, key, value, isSVG, instance, isBoolean = (0, _vue_shared.
|
|
|
432
428
|
else if (value == null || isBoolean && !(0, _vue_shared.includeBooleanAttr)(value)) el.removeAttribute(key);
|
|
433
429
|
else el.setAttribute(key, isBoolean ? "" : (0, _vue_shared.isSymbol)(value) ? String(value) : value);
|
|
434
430
|
}
|
|
435
|
-
|
|
436
431
|
//#endregion
|
|
437
432
|
//#region packages/runtime-dom/src/modules/props.ts
|
|
438
433
|
function patchDOMProp(el, key, value, parentComponent, attrName) {
|
|
@@ -466,7 +461,6 @@ function patchDOMProp(el, key, value, parentComponent, attrName) {
|
|
|
466
461
|
} catch (e) {}
|
|
467
462
|
needRemove && el.removeAttribute(attrName || key);
|
|
468
463
|
}
|
|
469
|
-
|
|
470
464
|
//#endregion
|
|
471
465
|
//#region packages/runtime-dom/src/modules/events.ts
|
|
472
466
|
function addEventListener(el, event, handler, options) {
|
|
@@ -525,7 +519,6 @@ function patchStopImmediatePropagation(e, value) {
|
|
|
525
519
|
return value.map((fn) => (e) => !e._stopped && fn && fn(e));
|
|
526
520
|
} else return value;
|
|
527
521
|
}
|
|
528
|
-
|
|
529
522
|
//#endregion
|
|
530
523
|
//#region packages/runtime-dom/src/patchProp.ts
|
|
531
524
|
const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => {
|
|
@@ -537,7 +530,7 @@ const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) =>
|
|
|
537
530
|
} else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) {
|
|
538
531
|
patchDOMProp(el, key, nextValue, parentComponent);
|
|
539
532
|
if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value");
|
|
540
|
-
} else if (el._isVueCE && (/[A-Z]/.test(key) || !(0, _vue_shared.isString)(nextValue))) patchDOMProp(el, (0, _vue_shared.camelize)(key), nextValue, parentComponent, key);
|
|
533
|
+
} else if (el._isVueCE && (shouldSetAsPropForVueCE(el, key) || el._def.__asyncLoader && (/[A-Z]/.test(key) || !(0, _vue_shared.isString)(nextValue)))) patchDOMProp(el, (0, _vue_shared.camelize)(key), nextValue, parentComponent, key);
|
|
541
534
|
else {
|
|
542
535
|
if (key === "true-value") el._trueValue = nextValue;
|
|
543
536
|
else if (key === "false-value") el._falseValue = nextValue;
|
|
@@ -554,7 +547,12 @@ function shouldSetAsProp(el, key, value, isSVG) {
|
|
|
554
547
|
if ((0, _vue_shared.isNativeOn)(key) && (0, _vue_shared.isString)(value)) return false;
|
|
555
548
|
return key in el;
|
|
556
549
|
}
|
|
557
|
-
|
|
550
|
+
function shouldSetAsPropForVueCE(el, key) {
|
|
551
|
+
const props = el._def.props;
|
|
552
|
+
if (!props) return false;
|
|
553
|
+
const camelKey = (0, _vue_shared.camelize)(key);
|
|
554
|
+
return Array.isArray(props) ? props.some((prop) => (0, _vue_shared.camelize)(prop) === camelKey) : Object.keys(props).some((prop) => (0, _vue_shared.camelize)(prop) === camelKey);
|
|
555
|
+
}
|
|
558
556
|
//#endregion
|
|
559
557
|
//#region packages/runtime-dom/src/apiCustomElement.ts
|
|
560
558
|
const REMOVAL = {};
|
|
@@ -584,6 +582,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
584
582
|
this._resolved = false;
|
|
585
583
|
this._numberProps = null;
|
|
586
584
|
this._styleChildren = /* @__PURE__ */ new WeakSet();
|
|
585
|
+
this._styleAnchors = /* @__PURE__ */ new WeakMap();
|
|
587
586
|
this._patching = false;
|
|
588
587
|
this._dirty = false;
|
|
589
588
|
this._ob = null;
|
|
@@ -602,7 +601,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
602
601
|
if (!this.shadowRoot && !this._resolved) this._parseSlots();
|
|
603
602
|
this._connected = true;
|
|
604
603
|
let parent = this;
|
|
605
|
-
while (parent = parent && (parent.parentNode || parent.host)) if (parent instanceof VueElementBase) {
|
|
604
|
+
while (parent = parent && (parent.assignedSlot || parent.parentNode || parent.host)) if (parent instanceof VueElementBase) {
|
|
606
605
|
this._parent = parent;
|
|
607
606
|
break;
|
|
608
607
|
}
|
|
@@ -749,19 +748,41 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
749
748
|
}
|
|
750
749
|
}
|
|
751
750
|
}
|
|
752
|
-
_applyStyles(styles, owner) {
|
|
751
|
+
_applyStyles(styles, owner, parentComp) {
|
|
753
752
|
if (!styles) return;
|
|
754
753
|
if (owner) {
|
|
755
754
|
if (owner === this._def || this._styleChildren.has(owner)) return;
|
|
756
755
|
this._styleChildren.add(owner);
|
|
757
756
|
}
|
|
758
757
|
const nonce = this._nonce;
|
|
758
|
+
const root = this.shadowRoot;
|
|
759
|
+
const insertionAnchor = parentComp ? this._getStyleAnchor(parentComp) || this._getStyleAnchor(this._def) : this._getRootStyleInsertionAnchor(root);
|
|
760
|
+
let last = null;
|
|
759
761
|
for (let i = styles.length - 1; i >= 0; i--) {
|
|
760
762
|
const s = document.createElement("style");
|
|
761
763
|
if (nonce) s.setAttribute("nonce", nonce);
|
|
762
764
|
s.textContent = styles[i];
|
|
763
|
-
|
|
765
|
+
root.insertBefore(s, last || insertionAnchor);
|
|
766
|
+
last = s;
|
|
767
|
+
if (i === 0) {
|
|
768
|
+
if (!parentComp) this._styleAnchors.set(this._def, s);
|
|
769
|
+
if (owner) this._styleAnchors.set(owner, s);
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
_getStyleAnchor(comp) {
|
|
774
|
+
if (!comp) return null;
|
|
775
|
+
const anchor = this._styleAnchors.get(comp);
|
|
776
|
+
if (anchor && anchor.parentNode === this.shadowRoot) return anchor;
|
|
777
|
+
if (anchor) this._styleAnchors.delete(comp);
|
|
778
|
+
return null;
|
|
779
|
+
}
|
|
780
|
+
_getRootStyleInsertionAnchor(root) {
|
|
781
|
+
for (let i = 0; i < root.childNodes.length; i++) {
|
|
782
|
+
const node = root.childNodes[i];
|
|
783
|
+
if (!(node instanceof HTMLStyleElement)) return node;
|
|
764
784
|
}
|
|
785
|
+
return null;
|
|
765
786
|
}
|
|
766
787
|
/**
|
|
767
788
|
* Only called when shadowRoot is false
|
|
@@ -825,8 +846,8 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
825
846
|
/**
|
|
826
847
|
* @internal
|
|
827
848
|
*/
|
|
828
|
-
_injectChildStyle(comp) {
|
|
829
|
-
this._applyStyles(comp.styles, comp);
|
|
849
|
+
_injectChildStyle(comp, parentComp) {
|
|
850
|
+
this._applyStyles(comp.styles, comp, parentComp);
|
|
830
851
|
}
|
|
831
852
|
/**
|
|
832
853
|
* @internal
|
|
@@ -908,7 +929,6 @@ function useShadowRoot() {
|
|
|
908
929
|
const el = useHost();
|
|
909
930
|
return el && el.shadowRoot;
|
|
910
931
|
}
|
|
911
|
-
|
|
912
932
|
//#endregion
|
|
913
933
|
//#region packages/runtime-dom/src/helpers/useCssModule.ts
|
|
914
934
|
function useCssModule(name = "$style") {
|
|
@@ -922,7 +942,6 @@ function useCssModule(name = "$style") {
|
|
|
922
942
|
return mod;
|
|
923
943
|
}
|
|
924
944
|
}
|
|
925
|
-
|
|
926
945
|
//#endregion
|
|
927
946
|
//#region packages/runtime-dom/src/components/TransitionGroup.ts
|
|
928
947
|
const positionMap = /* @__PURE__ */ new WeakMap();
|
|
@@ -937,7 +956,7 @@ const decorate = (t) => {
|
|
|
937
956
|
delete t.props.mode;
|
|
938
957
|
return t;
|
|
939
958
|
};
|
|
940
|
-
const
|
|
959
|
+
const TransitionGroup = /* @__PURE__ */ decorate({
|
|
941
960
|
name: "TransitionGroup",
|
|
942
961
|
props: /* @__PURE__ */ (0, _vue_shared.extend)({}, TransitionPropsValidators, {
|
|
943
962
|
tag: String,
|
|
@@ -987,7 +1006,6 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
|
|
|
987
1006
|
};
|
|
988
1007
|
}
|
|
989
1008
|
});
|
|
990
|
-
const TransitionGroup = TransitionGroupImpl;
|
|
991
1009
|
function callPendingCbs(el) {
|
|
992
1010
|
if (el[moveCbKey]) el[moveCbKey]();
|
|
993
1011
|
if (el[enterCbKey]) el[enterCbKey]();
|
|
@@ -1053,7 +1071,6 @@ const handleMovedChildren = (el, moveClass) => {
|
|
|
1053
1071
|
};
|
|
1054
1072
|
el.addEventListener("transitionend", cb);
|
|
1055
1073
|
};
|
|
1056
|
-
|
|
1057
1074
|
//#endregion
|
|
1058
1075
|
//#region packages/runtime-dom/src/directives/vModel.ts
|
|
1059
1076
|
const getModelAssigner = (vnode) => {
|
|
@@ -1114,7 +1131,8 @@ const vModelTextUpdate = (el, oldValue, value, trim, number, lazy) => {
|
|
|
1114
1131
|
const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? (0, _vue_shared.looseToNumber)(el.value) : el.value;
|
|
1115
1132
|
const newValue = value == null ? "" : value;
|
|
1116
1133
|
if (elValue === newValue) return;
|
|
1117
|
-
|
|
1134
|
+
const rootNode = el.getRootNode();
|
|
1135
|
+
if ((rootNode instanceof Document || rootNode instanceof ShadowRoot) && rootNode.activeElement === el && el.type !== "range") {
|
|
1118
1136
|
if (lazy && value === oldValue) return;
|
|
1119
1137
|
if (trim && el.value.trim() === newValue) return;
|
|
1120
1138
|
}
|
|
@@ -1300,7 +1318,6 @@ function initVModelForSSR() {
|
|
|
1300
1318
|
if (modelToUse.getSSRProps) return modelToUse.getSSRProps(binding, vnode);
|
|
1301
1319
|
};
|
|
1302
1320
|
}
|
|
1303
|
-
|
|
1304
1321
|
//#endregion
|
|
1305
1322
|
//#region packages/runtime-dom/src/directives/vOn.ts
|
|
1306
1323
|
const systemModifiers = [
|
|
@@ -1358,7 +1375,6 @@ const withKeys = (fn, modifiers) => {
|
|
|
1358
1375
|
if (modifiers.some((k) => k === eventKey || keyNames[k] === eventKey)) return fn(event);
|
|
1359
1376
|
}));
|
|
1360
1377
|
};
|
|
1361
|
-
|
|
1362
1378
|
//#endregion
|
|
1363
1379
|
//#region packages/runtime-dom/src/index.ts
|
|
1364
1380
|
const rendererOptions = /* @__PURE__ */ (0, _vue_shared.extend)({ patchProp }, nodeOps);
|
|
@@ -1428,7 +1444,6 @@ const initDirectivesForSSR = () => {
|
|
|
1428
1444
|
initVShowForSSR();
|
|
1429
1445
|
}
|
|
1430
1446
|
};
|
|
1431
|
-
|
|
1432
1447
|
//#endregion
|
|
1433
1448
|
exports.Transition = Transition;
|
|
1434
1449
|
exports.TransitionGroup = TransitionGroup;
|
|
@@ -1455,9 +1470,11 @@ exports.vModelText = vModelText;
|
|
|
1455
1470
|
exports.vShow = vShow;
|
|
1456
1471
|
exports.withKeys = withKeys;
|
|
1457
1472
|
exports.withModifiers = withModifiers;
|
|
1458
|
-
Object.keys(_vue_runtime_core).forEach(function
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1473
|
+
Object.keys(_vue_runtime_core).forEach(function(k) {
|
|
1474
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
1475
|
+
enumerable: true,
|
|
1476
|
+
get: function() {
|
|
1477
|
+
return _vue_runtime_core[k];
|
|
1478
|
+
}
|
|
1479
|
+
});
|
|
1463
1480
|
});
|