@vue/runtime-dom 3.6.0-beta.6 → 3.6.0-beta.8
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 +50 -32
- package/dist/runtime-dom.cjs.prod.js +48 -32
- package/dist/runtime-dom.d.ts +125 -117
- package/dist/runtime-dom.esm-browser.js +119 -168
- package/dist/runtime-dom.esm-browser.prod.js +3 -3
- package/dist/runtime-dom.esm-bundler.js +41 -29
- package/dist/runtime-dom.global.js +480 -531
- 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.8
|
|
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) => {
|
|
@@ -1358,7 +1377,6 @@ function initVModelForSSR() {
|
|
|
1358
1377
|
if (modelToUse.getSSRProps) return modelToUse.getSSRProps(binding, vnode);
|
|
1359
1378
|
};
|
|
1360
1379
|
}
|
|
1361
|
-
|
|
1362
1380
|
//#endregion
|
|
1363
1381
|
//#region packages/runtime-dom/src/directives/vOn.ts
|
|
1364
1382
|
const systemModifiers = [
|
|
@@ -1416,7 +1434,6 @@ const withKeys = (fn, modifiers) => {
|
|
|
1416
1434
|
if (modifiers.some((k) => k === eventKey || keyNames[k] === eventKey)) return fn(event);
|
|
1417
1435
|
}));
|
|
1418
1436
|
};
|
|
1419
|
-
|
|
1420
1437
|
//#endregion
|
|
1421
1438
|
//#region packages/runtime-dom/src/index.ts
|
|
1422
1439
|
const rendererOptions = /* @__PURE__ */ (0, _vue_shared.extend)({ patchProp }, nodeOps);
|
|
@@ -1525,7 +1542,6 @@ const initDirectivesForSSR = () => {
|
|
|
1525
1542
|
initVShowForSSR();
|
|
1526
1543
|
}
|
|
1527
1544
|
};
|
|
1528
|
-
|
|
1529
1545
|
//#endregion
|
|
1530
1546
|
exports.Transition = Transition;
|
|
1531
1547
|
exports.TransitionGroup = TransitionGroup;
|
|
@@ -1552,9 +1568,11 @@ exports.vModelText = vModelText;
|
|
|
1552
1568
|
exports.vShow = vShow;
|
|
1553
1569
|
exports.withKeys = withKeys;
|
|
1554
1570
|
exports.withModifiers = withModifiers;
|
|
1555
|
-
Object.keys(_vue_runtime_core).forEach(function
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1571
|
+
Object.keys(_vue_runtime_core).forEach(function(k) {
|
|
1572
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
1573
|
+
enumerable: true,
|
|
1574
|
+
get: function() {
|
|
1575
|
+
return _vue_runtime_core[k];
|
|
1576
|
+
}
|
|
1577
|
+
});
|
|
1560
1578
|
});
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-dom v3.6.0-beta.
|
|
2
|
+
* @vue/runtime-dom v3.6.0-beta.8
|
|
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) => {
|
|
@@ -1300,7 +1317,6 @@ function initVModelForSSR() {
|
|
|
1300
1317
|
if (modelToUse.getSSRProps) return modelToUse.getSSRProps(binding, vnode);
|
|
1301
1318
|
};
|
|
1302
1319
|
}
|
|
1303
|
-
|
|
1304
1320
|
//#endregion
|
|
1305
1321
|
//#region packages/runtime-dom/src/directives/vOn.ts
|
|
1306
1322
|
const systemModifiers = [
|
|
@@ -1358,7 +1374,6 @@ const withKeys = (fn, modifiers) => {
|
|
|
1358
1374
|
if (modifiers.some((k) => k === eventKey || keyNames[k] === eventKey)) return fn(event);
|
|
1359
1375
|
}));
|
|
1360
1376
|
};
|
|
1361
|
-
|
|
1362
1377
|
//#endregion
|
|
1363
1378
|
//#region packages/runtime-dom/src/index.ts
|
|
1364
1379
|
const rendererOptions = /* @__PURE__ */ (0, _vue_shared.extend)({ patchProp }, nodeOps);
|
|
@@ -1428,7 +1443,6 @@ const initDirectivesForSSR = () => {
|
|
|
1428
1443
|
initVShowForSSR();
|
|
1429
1444
|
}
|
|
1430
1445
|
};
|
|
1431
|
-
|
|
1432
1446
|
//#endregion
|
|
1433
1447
|
exports.Transition = Transition;
|
|
1434
1448
|
exports.TransitionGroup = TransitionGroup;
|
|
@@ -1455,9 +1469,11 @@ exports.vModelText = vModelText;
|
|
|
1455
1469
|
exports.vShow = vShow;
|
|
1456
1470
|
exports.withKeys = withKeys;
|
|
1457
1471
|
exports.withModifiers = withModifiers;
|
|
1458
|
-
Object.keys(_vue_runtime_core).forEach(function
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1472
|
+
Object.keys(_vue_runtime_core).forEach(function(k) {
|
|
1473
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
1474
|
+
enumerable: true,
|
|
1475
|
+
get: function() {
|
|
1476
|
+
return _vue_runtime_core[k];
|
|
1477
|
+
}
|
|
1478
|
+
});
|
|
1463
1479
|
});
|