@stencil/core 4.23.0 → 4.23.1
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/cli/index.cjs +1 -1
- package/cli/index.js +1 -1
- package/cli/package.json +1 -1
- package/compiler/package.json +1 -1
- package/compiler/stencil.js +125 -133
- package/dev-server/client/index.js +1 -1
- package/dev-server/client/package.json +1 -1
- package/dev-server/connector.html +2 -2
- package/dev-server/index.js +1 -1
- package/dev-server/package.json +1 -1
- package/dev-server/server-process.js +2 -2
- package/internal/app-data/package.json +1 -1
- package/internal/client/index.js +611 -460
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +1 -1
- package/internal/hydrate/index.js +575 -457
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/runner.js +31 -23
- package/internal/package.json +1 -1
- package/internal/stencil-private.d.ts +60 -4
- package/internal/testing/index.js +573 -455
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +7 -2
- package/mock-doc/index.js +7 -2
- package/mock-doc/package.json +1 -1
- package/package.json +1 -1
- package/screenshot/index.js +1 -1
- package/screenshot/package.json +1 -1
- package/screenshot/pixel-match.js +1 -1
- package/sys/node/index.js +1 -1
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +2 -1
- package/testing/package.json +1 -1
|
@@ -31,7 +31,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
31
|
var platform_exports = {};
|
|
32
32
|
__export(platform_exports, {
|
|
33
33
|
Build: () => Build,
|
|
34
|
-
Env: () =>
|
|
34
|
+
Env: () => import_app_data22.Env,
|
|
35
35
|
Fragment: () => Fragment,
|
|
36
36
|
Host: () => Host,
|
|
37
37
|
addHostEventListeners: () => addHostEventListeners,
|
|
@@ -380,7 +380,7 @@ var isMemberInElement = (elm, memberName) => {
|
|
|
380
380
|
};
|
|
381
381
|
|
|
382
382
|
// src/testing/platform/index.ts
|
|
383
|
-
var
|
|
383
|
+
var import_app_data22 = require("@stencil/core/internal/app-data");
|
|
384
384
|
|
|
385
385
|
// src/runtime/asset-path.ts
|
|
386
386
|
var getAssetPath = (path) => {
|
|
@@ -390,7 +390,7 @@ var getAssetPath = (path) => {
|
|
|
390
390
|
var setAssetPath = (path) => plt.$resourcesUrl$ = path;
|
|
391
391
|
|
|
392
392
|
// src/runtime/bootstrap-custom-element.ts
|
|
393
|
-
var
|
|
393
|
+
var import_app_data19 = require("@stencil/core/internal/app-data");
|
|
394
394
|
|
|
395
395
|
// src/utils/constants.ts
|
|
396
396
|
var EMPTY_OBJ = {};
|
|
@@ -398,7 +398,7 @@ var SVG_NS = "http://www.w3.org/2000/svg";
|
|
|
398
398
|
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
399
399
|
|
|
400
400
|
// src/utils/helpers.ts
|
|
401
|
-
var isDef = (v) => v != null;
|
|
401
|
+
var isDef = (v) => v != null && v !== void 0;
|
|
402
402
|
var isComplexType = (o) => {
|
|
403
403
|
o = typeof o;
|
|
404
404
|
return o === "object" || o === "function";
|
|
@@ -460,13 +460,13 @@ var unwrapErr = (result) => {
|
|
|
460
460
|
};
|
|
461
461
|
|
|
462
462
|
// src/runtime/connected-callback.ts
|
|
463
|
-
var
|
|
463
|
+
var import_app_data17 = require("@stencil/core/internal/app-data");
|
|
464
464
|
|
|
465
465
|
// src/runtime/client-hydrate.ts
|
|
466
|
-
var
|
|
466
|
+
var import_app_data8 = require("@stencil/core/internal/app-data");
|
|
467
467
|
|
|
468
468
|
// src/runtime/dom-extras.ts
|
|
469
|
-
var
|
|
469
|
+
var import_app_data6 = require("@stencil/core/internal/app-data");
|
|
470
470
|
|
|
471
471
|
// src/runtime/runtime-constants.ts
|
|
472
472
|
var CONTENT_REF_ID = "r";
|
|
@@ -493,11 +493,114 @@ var FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
|
|
|
493
493
|
"formStateRestoreCallback"
|
|
494
494
|
];
|
|
495
495
|
|
|
496
|
+
// src/runtime/slot-polyfill-utils.ts
|
|
497
|
+
var import_app_data = require("@stencil/core/internal/app-data");
|
|
498
|
+
var updateFallbackSlotVisibility = (elm) => {
|
|
499
|
+
const childNodes = elm.__childNodes || elm.childNodes;
|
|
500
|
+
if (elm.tagName && elm.tagName.includes("-") && elm["s-cr"] && elm.tagName !== "SLOT-FB") {
|
|
501
|
+
getHostSlotNodes(childNodes, elm.tagName).forEach((slotNode) => {
|
|
502
|
+
var _a;
|
|
503
|
+
if (slotNode.nodeType === 1 /* ElementNode */ && slotNode.tagName === "SLOT-FB") {
|
|
504
|
+
if ((_a = getHostSlotChildNodes(slotNode, slotNode["s-sn"], false)) == null ? void 0 : _a.length) {
|
|
505
|
+
slotNode.hidden = true;
|
|
506
|
+
} else {
|
|
507
|
+
slotNode.hidden = false;
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
});
|
|
511
|
+
}
|
|
512
|
+
for (const childNode of childNodes) {
|
|
513
|
+
if (childNode.nodeType === 1 /* ElementNode */ && (childNode.__childNodes || childNode.childNodes).length) {
|
|
514
|
+
updateFallbackSlotVisibility(childNode);
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
};
|
|
518
|
+
var getSlottedChildNodes = (childNodes) => {
|
|
519
|
+
const result = [];
|
|
520
|
+
for (let i2 = 0; i2 < childNodes.length; i2++) {
|
|
521
|
+
const slottedNode = childNodes[i2]["s-nr"];
|
|
522
|
+
if (slottedNode && slottedNode.isConnected) {
|
|
523
|
+
result.push(slottedNode);
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
return result;
|
|
527
|
+
};
|
|
528
|
+
var getHostSlotNodes = (childNodes, hostName, slotName) => {
|
|
529
|
+
let i2 = 0;
|
|
530
|
+
let slottedNodes = [];
|
|
531
|
+
let childNode;
|
|
532
|
+
for (; i2 < childNodes.length; i2++) {
|
|
533
|
+
childNode = childNodes[i2];
|
|
534
|
+
if (childNode["s-sr"] && childNode["s-hn"] === hostName && (!slotName || childNode["s-sn"] === slotName)) {
|
|
535
|
+
slottedNodes.push(childNode);
|
|
536
|
+
if (typeof slotName !== "undefined") return slottedNodes;
|
|
537
|
+
}
|
|
538
|
+
slottedNodes = [...slottedNodes, ...getHostSlotNodes(childNode.childNodes, hostName, slotName)];
|
|
539
|
+
}
|
|
540
|
+
return slottedNodes;
|
|
541
|
+
};
|
|
542
|
+
var getHostSlotChildNodes = (node, slotName, includeSlot = true) => {
|
|
543
|
+
const childNodes = [];
|
|
544
|
+
if (includeSlot && node["s-sr"] || !node["s-sr"]) childNodes.push(node);
|
|
545
|
+
while ((node = node.nextSibling) && node["s-sn"] === slotName) {
|
|
546
|
+
childNodes.push(node);
|
|
547
|
+
}
|
|
548
|
+
return childNodes;
|
|
549
|
+
};
|
|
550
|
+
var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
|
|
551
|
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
552
|
+
if (nodeToRelocate.getAttribute("slot") === null && slotName === "") {
|
|
553
|
+
return true;
|
|
554
|
+
}
|
|
555
|
+
if (nodeToRelocate.getAttribute("slot") === slotName) {
|
|
556
|
+
return true;
|
|
557
|
+
}
|
|
558
|
+
return false;
|
|
559
|
+
}
|
|
560
|
+
if (nodeToRelocate["s-sn"] === slotName) {
|
|
561
|
+
return true;
|
|
562
|
+
}
|
|
563
|
+
return slotName === "";
|
|
564
|
+
};
|
|
565
|
+
var addSlotRelocateNode = (newChild, slotNode, prepend, position) => {
|
|
566
|
+
let slottedNodeLocation;
|
|
567
|
+
if (newChild["s-ol"] && newChild["s-ol"].isConnected) {
|
|
568
|
+
slottedNodeLocation = newChild["s-ol"];
|
|
569
|
+
} else {
|
|
570
|
+
slottedNodeLocation = document.createTextNode("");
|
|
571
|
+
slottedNodeLocation["s-nr"] = newChild;
|
|
572
|
+
}
|
|
573
|
+
if (!slotNode["s-cr"] || !slotNode["s-cr"].parentNode) return;
|
|
574
|
+
const parent = slotNode["s-cr"].parentNode;
|
|
575
|
+
const appendMethod = prepend ? parent.__prepend || parent.prepend : parent.__appendChild || parent.appendChild;
|
|
576
|
+
if (typeof position !== "undefined") {
|
|
577
|
+
if (import_app_data.BUILD.hydrateClientSide) {
|
|
578
|
+
slottedNodeLocation["s-oo"] = position;
|
|
579
|
+
const childNodes = parent.__childNodes || parent.childNodes;
|
|
580
|
+
const slotRelocateNodes = [slottedNodeLocation];
|
|
581
|
+
childNodes.forEach((n) => {
|
|
582
|
+
if (n["s-nr"]) slotRelocateNodes.push(n);
|
|
583
|
+
});
|
|
584
|
+
slotRelocateNodes.sort((a, b) => {
|
|
585
|
+
if (!a["s-oo"] || a["s-oo"] < b["s-oo"]) return -1;
|
|
586
|
+
else if (!b["s-oo"] || b["s-oo"] < a["s-oo"]) return 1;
|
|
587
|
+
return 0;
|
|
588
|
+
});
|
|
589
|
+
slotRelocateNodes.forEach((n) => appendMethod.call(parent, n));
|
|
590
|
+
}
|
|
591
|
+
} else {
|
|
592
|
+
appendMethod.call(parent, slottedNodeLocation);
|
|
593
|
+
}
|
|
594
|
+
newChild["s-ol"] = slottedNodeLocation;
|
|
595
|
+
newChild["s-sh"] = slotNode["s-hn"];
|
|
596
|
+
};
|
|
597
|
+
var getSlotName = (node) => node["s-sn"] || node.nodeType === 1 && node.getAttribute("slot") || "";
|
|
598
|
+
|
|
496
599
|
// src/runtime/vdom/vdom-render.ts
|
|
497
|
-
var
|
|
600
|
+
var import_app_data5 = require("@stencil/core/internal/app-data");
|
|
498
601
|
|
|
499
602
|
// src/runtime/vdom/h.ts
|
|
500
|
-
var
|
|
603
|
+
var import_app_data2 = require("@stencil/core/internal/app-data");
|
|
501
604
|
var h = (nodeName, vnodeData, ...children) => {
|
|
502
605
|
let child = null;
|
|
503
606
|
let key = null;
|
|
@@ -513,7 +616,7 @@ var h = (nodeName, vnodeData, ...children) => {
|
|
|
513
616
|
} else if (child != null && typeof child !== "boolean") {
|
|
514
617
|
if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
|
|
515
618
|
child = String(child);
|
|
516
|
-
} else if (
|
|
619
|
+
} else if (import_app_data2.BUILD.isDev && typeof nodeName !== "function" && child.$flags$ === void 0) {
|
|
517
620
|
consoleDevError(`vNode passed as children has unexpected type.
|
|
518
621
|
Make sure it's using the correct h() function.
|
|
519
622
|
Empty objects can also be the cause, look for JSX comments that became objects.`);
|
|
@@ -529,28 +632,28 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
|
|
|
529
632
|
};
|
|
530
633
|
walk(children);
|
|
531
634
|
if (vnodeData) {
|
|
532
|
-
if (
|
|
635
|
+
if (import_app_data2.BUILD.isDev && nodeName === "input") {
|
|
533
636
|
validateInputProperties(vnodeData);
|
|
534
637
|
}
|
|
535
|
-
if (
|
|
638
|
+
if (import_app_data2.BUILD.vdomKey && vnodeData.key) {
|
|
536
639
|
key = vnodeData.key;
|
|
537
640
|
}
|
|
538
|
-
if (
|
|
641
|
+
if (import_app_data2.BUILD.slotRelocation && vnodeData.name) {
|
|
539
642
|
slotName = vnodeData.name;
|
|
540
643
|
}
|
|
541
|
-
if (
|
|
644
|
+
if (import_app_data2.BUILD.vdomClass) {
|
|
542
645
|
const classData = vnodeData.className || vnodeData.class;
|
|
543
646
|
if (classData) {
|
|
544
647
|
vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
|
|
545
648
|
}
|
|
546
649
|
}
|
|
547
650
|
}
|
|
548
|
-
if (
|
|
651
|
+
if (import_app_data2.BUILD.isDev && vNodeChildren.some(isHost)) {
|
|
549
652
|
consoleDevError(`The <Host> must be the single root component. Make sure:
|
|
550
653
|
- You are NOT using hostData() and <Host> in the same component.
|
|
551
654
|
- <Host> is used once, and it's the single root component of the render() function.`);
|
|
552
655
|
}
|
|
553
|
-
if (
|
|
656
|
+
if (import_app_data2.BUILD.vdomFunctional && typeof nodeName === "function") {
|
|
554
657
|
return nodeName(
|
|
555
658
|
vnodeData === null ? {} : vnodeData,
|
|
556
659
|
vNodeChildren,
|
|
@@ -562,10 +665,10 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
|
|
|
562
665
|
if (vNodeChildren.length > 0) {
|
|
563
666
|
vnode.$children$ = vNodeChildren;
|
|
564
667
|
}
|
|
565
|
-
if (
|
|
668
|
+
if (import_app_data2.BUILD.vdomKey) {
|
|
566
669
|
vnode.$key$ = key;
|
|
567
670
|
}
|
|
568
|
-
if (
|
|
671
|
+
if (import_app_data2.BUILD.slotRelocation) {
|
|
569
672
|
vnode.$name$ = slotName;
|
|
570
673
|
}
|
|
571
674
|
return vnode;
|
|
@@ -578,13 +681,13 @@ var newVNode = (tag, text) => {
|
|
|
578
681
|
$elm$: null,
|
|
579
682
|
$children$: null
|
|
580
683
|
};
|
|
581
|
-
if (
|
|
684
|
+
if (import_app_data2.BUILD.vdomAttribute) {
|
|
582
685
|
vnode.$attrs$ = null;
|
|
583
686
|
}
|
|
584
|
-
if (
|
|
687
|
+
if (import_app_data2.BUILD.vdomKey) {
|
|
585
688
|
vnode.$key$ = null;
|
|
586
689
|
}
|
|
587
|
-
if (
|
|
690
|
+
if (import_app_data2.BUILD.slotRelocation) {
|
|
588
691
|
vnode.$name$ = null;
|
|
589
692
|
}
|
|
590
693
|
return vnode;
|
|
@@ -637,28 +740,35 @@ var validateInputProperties = (inputElm) => {
|
|
|
637
740
|
};
|
|
638
741
|
|
|
639
742
|
// src/runtime/vdom/update-element.ts
|
|
640
|
-
var
|
|
743
|
+
var import_app_data4 = require("@stencil/core/internal/app-data");
|
|
641
744
|
|
|
642
745
|
// src/runtime/vdom/set-accessor.ts
|
|
643
|
-
var
|
|
746
|
+
var import_app_data3 = require("@stencil/core/internal/app-data");
|
|
644
747
|
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
645
748
|
if (oldValue !== newValue) {
|
|
646
749
|
let isProp = isMemberInElement(elm, memberName);
|
|
647
750
|
let ln = memberName.toLowerCase();
|
|
648
|
-
if (
|
|
751
|
+
if (import_app_data3.BUILD.vdomClass && memberName === "class") {
|
|
649
752
|
const classList = elm.classList;
|
|
650
753
|
const oldClasses = parseClassList(oldValue);
|
|
651
|
-
|
|
652
|
-
if (elm["s-si"]
|
|
754
|
+
let newClasses = parseClassList(newValue);
|
|
755
|
+
if (elm["s-si"]) {
|
|
653
756
|
newClasses.push(elm["s-si"]);
|
|
757
|
+
oldClasses.forEach((c) => {
|
|
758
|
+
if (c.startsWith(elm["s-si"])) newClasses.push(c);
|
|
759
|
+
});
|
|
760
|
+
newClasses = [...new Set(newClasses)];
|
|
761
|
+
classList.add(...newClasses);
|
|
762
|
+
delete elm["s-si"];
|
|
763
|
+
} else {
|
|
764
|
+
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
765
|
+
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
654
766
|
}
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
} else if (import_app_data2.BUILD.vdomStyle && memberName === "style") {
|
|
658
|
-
if (import_app_data2.BUILD.updatable) {
|
|
767
|
+
} else if (import_app_data3.BUILD.vdomStyle && memberName === "style") {
|
|
768
|
+
if (import_app_data3.BUILD.updatable) {
|
|
659
769
|
for (const prop in oldValue) {
|
|
660
770
|
if (!newValue || newValue[prop] == null) {
|
|
661
|
-
if (!
|
|
771
|
+
if (!import_app_data3.BUILD.hydrateServerSide && prop.includes("-")) {
|
|
662
772
|
elm.style.removeProperty(prop);
|
|
663
773
|
} else {
|
|
664
774
|
elm.style[prop] = "";
|
|
@@ -668,19 +778,19 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
668
778
|
}
|
|
669
779
|
for (const prop in newValue) {
|
|
670
780
|
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
671
|
-
if (!
|
|
781
|
+
if (!import_app_data3.BUILD.hydrateServerSide && prop.includes("-")) {
|
|
672
782
|
elm.style.setProperty(prop, newValue[prop]);
|
|
673
783
|
} else {
|
|
674
784
|
elm.style[prop] = newValue[prop];
|
|
675
785
|
}
|
|
676
786
|
}
|
|
677
787
|
}
|
|
678
|
-
} else if (
|
|
679
|
-
} else if (
|
|
788
|
+
} else if (import_app_data3.BUILD.vdomKey && memberName === "key") {
|
|
789
|
+
} else if (import_app_data3.BUILD.vdomRef && memberName === "ref") {
|
|
680
790
|
if (newValue) {
|
|
681
791
|
newValue(elm);
|
|
682
792
|
}
|
|
683
|
-
} else if (
|
|
793
|
+
} else if (import_app_data3.BUILD.vdomListener && (import_app_data3.BUILD.lazyLoad ? !isProp : !elm.__lookupSetter__(memberName)) && memberName[0] === "o" && memberName[1] === "n") {
|
|
684
794
|
if (memberName[2] === "-") {
|
|
685
795
|
memberName = memberName.slice(3);
|
|
686
796
|
} else if (isMemberInElement(win, ln)) {
|
|
@@ -698,7 +808,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
698
808
|
plt.ael(elm, memberName, newValue, capture);
|
|
699
809
|
}
|
|
700
810
|
}
|
|
701
|
-
} else if (
|
|
811
|
+
} else if (import_app_data3.BUILD.vdomPropOrAttr) {
|
|
702
812
|
const isComplex = isComplexType(newValue);
|
|
703
813
|
if ((isProp || isComplex && newValue !== null) && !isSvg) {
|
|
704
814
|
try {
|
|
@@ -720,7 +830,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
720
830
|
}
|
|
721
831
|
}
|
|
722
832
|
let xlink = false;
|
|
723
|
-
if (
|
|
833
|
+
if (import_app_data3.BUILD.vdomXlink) {
|
|
724
834
|
if (ln !== (ln = ln.replace(/^xlink\:?/, ""))) {
|
|
725
835
|
memberName = ln;
|
|
726
836
|
xlink = true;
|
|
@@ -728,7 +838,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
728
838
|
}
|
|
729
839
|
if (newValue == null || newValue === false) {
|
|
730
840
|
if (newValue !== false || elm.getAttribute(memberName) === "") {
|
|
731
|
-
if (
|
|
841
|
+
if (import_app_data3.BUILD.vdomXlink && xlink) {
|
|
732
842
|
elm.removeAttributeNS(XLINK_NS, memberName);
|
|
733
843
|
} else {
|
|
734
844
|
elm.removeAttribute(memberName);
|
|
@@ -736,7 +846,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
736
846
|
}
|
|
737
847
|
} else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
|
|
738
848
|
newValue = newValue === true ? "" : newValue;
|
|
739
|
-
if (
|
|
849
|
+
if (import_app_data3.BUILD.vdomXlink && xlink) {
|
|
740
850
|
elm.setAttributeNS(XLINK_NS, memberName, newValue);
|
|
741
851
|
} else {
|
|
742
852
|
elm.setAttribute(memberName, newValue);
|
|
@@ -746,7 +856,15 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
746
856
|
}
|
|
747
857
|
};
|
|
748
858
|
var parseClassListRegex = /\s/;
|
|
749
|
-
var parseClassList = (value) =>
|
|
859
|
+
var parseClassList = (value) => {
|
|
860
|
+
if (typeof value === "object" && "baseVal" in value) {
|
|
861
|
+
value = value.baseVal;
|
|
862
|
+
}
|
|
863
|
+
if (!value) {
|
|
864
|
+
return [];
|
|
865
|
+
}
|
|
866
|
+
return value.split(parseClassListRegex);
|
|
867
|
+
};
|
|
750
868
|
var CAPTURE_EVENT_SUFFIX = "Capture";
|
|
751
869
|
var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
|
|
752
870
|
|
|
@@ -755,7 +873,7 @@ var updateElement = (oldVnode, newVnode, isSvgMode2) => {
|
|
|
755
873
|
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
|
|
756
874
|
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || EMPTY_OBJ;
|
|
757
875
|
const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
|
|
758
|
-
if (
|
|
876
|
+
if (import_app_data4.BUILD.updatable) {
|
|
759
877
|
for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
|
|
760
878
|
if (!(memberName in newVnodeAttrs)) {
|
|
761
879
|
setAccessor(elm, memberName, oldVnodeAttrs[memberName], void 0, isSvgMode2, newVnode.$flags$);
|
|
@@ -784,19 +902,16 @@ var useNativeShadowDom = false;
|
|
|
784
902
|
var checkSlotFallbackVisibility = false;
|
|
785
903
|
var checkSlotRelocate = false;
|
|
786
904
|
var isSvgMode = false;
|
|
787
|
-
var createElm = (oldParentVNode, newParentVNode, childIndex
|
|
905
|
+
var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
788
906
|
var _a;
|
|
789
907
|
const newVNode2 = newParentVNode.$children$[childIndex];
|
|
790
908
|
let i2 = 0;
|
|
791
909
|
let elm;
|
|
792
910
|
let childNode;
|
|
793
911
|
let oldVNode;
|
|
794
|
-
if (
|
|
912
|
+
if (import_app_data5.BUILD.slotRelocation && !useNativeShadowDom) {
|
|
795
913
|
checkSlotRelocate = true;
|
|
796
914
|
if (newVNode2.$tag$ === "slot") {
|
|
797
|
-
if (scopeId) {
|
|
798
|
-
parentElm.classList.add(scopeId + "-s");
|
|
799
|
-
}
|
|
800
915
|
newVNode2.$flags$ |= newVNode2.$children$ ? (
|
|
801
916
|
// slot element has fallback content
|
|
802
917
|
// still create an element that "mocks" the slot element
|
|
@@ -809,48 +924,43 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
809
924
|
);
|
|
810
925
|
}
|
|
811
926
|
}
|
|
812
|
-
if (
|
|
927
|
+
if (import_app_data5.BUILD.isDev && newVNode2.$elm$) {
|
|
813
928
|
consoleDevError(
|
|
814
929
|
`The JSX ${newVNode2.$text$ !== null ? `"${newVNode2.$text$}" text` : `"${newVNode2.$tag$}" element`} node should not be shared within the same renderer. The renderer caches element lookups in order to improve performance. However, a side effect from this is that the exact same JSX node should not be reused. For more information please see https://stenciljs.com/docs/templating-jsx#avoid-shared-jsx-nodes`
|
|
815
930
|
);
|
|
816
931
|
}
|
|
817
|
-
if (
|
|
932
|
+
if (import_app_data5.BUILD.vdomText && newVNode2.$text$ !== null) {
|
|
818
933
|
elm = newVNode2.$elm$ = doc.createTextNode(newVNode2.$text$);
|
|
819
|
-
} else if (
|
|
820
|
-
elm = newVNode2.$elm$ =
|
|
934
|
+
} else if (import_app_data5.BUILD.slotRelocation && newVNode2.$flags$ & 1 /* isSlotReference */) {
|
|
935
|
+
elm = newVNode2.$elm$ = import_app_data5.BUILD.isDebug || import_app_data5.BUILD.hydrateServerSide ? slotReferenceDebugNode(newVNode2) : doc.createTextNode("");
|
|
821
936
|
} else {
|
|
822
|
-
if (
|
|
937
|
+
if (import_app_data5.BUILD.svg && !isSvgMode) {
|
|
823
938
|
isSvgMode = newVNode2.$tag$ === "svg";
|
|
824
939
|
}
|
|
825
|
-
elm = newVNode2.$elm$ =
|
|
940
|
+
elm = newVNode2.$elm$ = import_app_data5.BUILD.svg ? doc.createElementNS(
|
|
826
941
|
isSvgMode ? SVG_NS : HTML_NS,
|
|
827
|
-
!useNativeShadowDom &&
|
|
942
|
+
!useNativeShadowDom && import_app_data5.BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
|
|
828
943
|
) : doc.createElement(
|
|
829
|
-
!useNativeShadowDom &&
|
|
944
|
+
!useNativeShadowDom && import_app_data5.BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
|
|
830
945
|
);
|
|
831
|
-
if (
|
|
946
|
+
if (import_app_data5.BUILD.svg && isSvgMode && newVNode2.$tag$ === "foreignObject") {
|
|
832
947
|
isSvgMode = false;
|
|
833
948
|
}
|
|
834
|
-
if (
|
|
949
|
+
if (import_app_data5.BUILD.vdomAttribute) {
|
|
835
950
|
updateElement(null, newVNode2, isSvgMode);
|
|
836
951
|
}
|
|
837
|
-
|
|
838
|
-
const isElementWithinShadowRoot = !rootNode.querySelector("body");
|
|
839
|
-
if (!isElementWithinShadowRoot && import_app_data4.BUILD.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
|
|
952
|
+
if (import_app_data5.BUILD.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
|
|
840
953
|
elm.classList.add(elm["s-si"] = scopeId);
|
|
841
954
|
}
|
|
842
|
-
if (import_app_data4.BUILD.scoped) {
|
|
843
|
-
updateElementScopeIds(elm, parentElm);
|
|
844
|
-
}
|
|
845
955
|
if (newVNode2.$children$) {
|
|
846
956
|
for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
|
|
847
|
-
childNode = createElm(oldParentVNode, newVNode2, i2
|
|
957
|
+
childNode = createElm(oldParentVNode, newVNode2, i2);
|
|
848
958
|
if (childNode) {
|
|
849
959
|
elm.appendChild(childNode);
|
|
850
960
|
}
|
|
851
961
|
}
|
|
852
962
|
}
|
|
853
|
-
if (
|
|
963
|
+
if (import_app_data5.BUILD.svg) {
|
|
854
964
|
if (newVNode2.$tag$ === "svg") {
|
|
855
965
|
isSvgMode = false;
|
|
856
966
|
} else if (elm.tagName === "foreignObject") {
|
|
@@ -859,7 +969,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
859
969
|
}
|
|
860
970
|
}
|
|
861
971
|
elm["s-hn"] = hostTagName;
|
|
862
|
-
if (
|
|
972
|
+
if (import_app_data5.BUILD.slotRelocation) {
|
|
863
973
|
if (newVNode2.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
|
|
864
974
|
elm["s-sr"] = true;
|
|
865
975
|
elm["s-cr"] = contentRef;
|
|
@@ -867,12 +977,15 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
867
977
|
elm["s-rf"] = (_a = newVNode2.$attrs$) == null ? void 0 : _a.ref;
|
|
868
978
|
oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
|
|
869
979
|
if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) {
|
|
870
|
-
if (
|
|
980
|
+
if (import_app_data5.BUILD.experimentalSlotFixes) {
|
|
871
981
|
relocateToHostRoot(oldParentVNode.$elm$);
|
|
872
982
|
} else {
|
|
873
983
|
putBackInOriginalLocation(oldParentVNode.$elm$, false);
|
|
874
984
|
}
|
|
875
985
|
}
|
|
986
|
+
if (import_app_data5.BUILD.scoped) {
|
|
987
|
+
addRemoveSlotScopedClass(contentRef, elm, newParentVNode.$elm$, oldParentVNode == null ? void 0 : oldParentVNode.$elm$);
|
|
988
|
+
}
|
|
876
989
|
}
|
|
877
990
|
}
|
|
878
991
|
return elm;
|
|
@@ -900,7 +1013,7 @@ var relocateToHostRoot = (parentElm) => {
|
|
|
900
1013
|
var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
901
1014
|
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
902
1015
|
const oldSlotChildNodes = Array.from(parentElm.__childNodes || parentElm.childNodes);
|
|
903
|
-
if (parentElm["s-sr"] &&
|
|
1016
|
+
if (parentElm["s-sr"] && import_app_data5.BUILD.experimentalSlotFixes) {
|
|
904
1017
|
let node = parentElm;
|
|
905
1018
|
while (node = node.nextSibling) {
|
|
906
1019
|
if (node && node["s-sn"] === parentElm["s-sn"] && node["s-sh"] === hostTagName) {
|
|
@@ -911,7 +1024,7 @@ var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
|
911
1024
|
for (let i2 = oldSlotChildNodes.length - 1; i2 >= 0; i2--) {
|
|
912
1025
|
const childNode = oldSlotChildNodes[i2];
|
|
913
1026
|
if (childNode["s-hn"] !== hostTagName && childNode["s-ol"]) {
|
|
914
|
-
insertBefore(
|
|
1027
|
+
insertBefore(referenceNode(childNode).parentNode, childNode, referenceNode(childNode));
|
|
915
1028
|
childNode["s-ol"].remove();
|
|
916
1029
|
childNode["s-ol"] = void 0;
|
|
917
1030
|
childNode["s-sh"] = void 0;
|
|
@@ -924,17 +1037,17 @@ var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
|
924
1037
|
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
925
1038
|
};
|
|
926
1039
|
var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
927
|
-
let containerElm =
|
|
1040
|
+
let containerElm = import_app_data5.BUILD.slotRelocation && parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
|
|
928
1041
|
let childNode;
|
|
929
|
-
if (
|
|
1042
|
+
if (import_app_data5.BUILD.shadowDom && containerElm.shadowRoot && containerElm.tagName === hostTagName) {
|
|
930
1043
|
containerElm = containerElm.shadowRoot;
|
|
931
1044
|
}
|
|
932
1045
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
933
1046
|
if (vnodes[startIdx]) {
|
|
934
|
-
childNode = createElm(null, parentVNode, startIdx
|
|
1047
|
+
childNode = createElm(null, parentVNode, startIdx);
|
|
935
1048
|
if (childNode) {
|
|
936
1049
|
vnodes[startIdx].$elm$ = childNode;
|
|
937
|
-
insertBefore(containerElm, childNode,
|
|
1050
|
+
insertBefore(containerElm, childNode, import_app_data5.BUILD.slotRelocation ? referenceNode(before) : before);
|
|
938
1051
|
}
|
|
939
1052
|
}
|
|
940
1053
|
}
|
|
@@ -946,7 +1059,7 @@ var removeVnodes = (vnodes, startIdx, endIdx) => {
|
|
|
946
1059
|
const elm = vnode.$elm$;
|
|
947
1060
|
nullifyVNodeRefs(vnode);
|
|
948
1061
|
if (elm) {
|
|
949
|
-
if (
|
|
1062
|
+
if (import_app_data5.BUILD.slotRelocation) {
|
|
950
1063
|
checkSlotFallbackVisibility = true;
|
|
951
1064
|
if (elm["s-ol"]) {
|
|
952
1065
|
elm["s-ol"].remove();
|
|
@@ -990,7 +1103,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
990
1103
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
991
1104
|
newEndVnode = newCh[--newEndIdx];
|
|
992
1105
|
} else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
|
|
993
|
-
if (
|
|
1106
|
+
if (import_app_data5.BUILD.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
|
|
994
1107
|
putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
|
|
995
1108
|
}
|
|
996
1109
|
patch(oldStartVnode, newEndVnode, isInitialRender);
|
|
@@ -998,7 +1111,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
998
1111
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
999
1112
|
newEndVnode = newCh[--newEndIdx];
|
|
1000
1113
|
} else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
|
|
1001
|
-
if (
|
|
1114
|
+
if (import_app_data5.BUILD.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
|
|
1002
1115
|
putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
|
|
1003
1116
|
}
|
|
1004
1117
|
patch(oldEndVnode, newStartVnode, isInitialRender);
|
|
@@ -1007,7 +1120,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
1007
1120
|
newStartVnode = newCh[++newStartIdx];
|
|
1008
1121
|
} else {
|
|
1009
1122
|
idxInOld = -1;
|
|
1010
|
-
if (
|
|
1123
|
+
if (import_app_data5.BUILD.vdomKey) {
|
|
1011
1124
|
for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) {
|
|
1012
1125
|
if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) {
|
|
1013
1126
|
idxInOld = i2;
|
|
@@ -1015,10 +1128,10 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
1015
1128
|
}
|
|
1016
1129
|
}
|
|
1017
1130
|
}
|
|
1018
|
-
if (
|
|
1131
|
+
if (import_app_data5.BUILD.vdomKey && idxInOld >= 0) {
|
|
1019
1132
|
elmToMove = oldCh[idxInOld];
|
|
1020
1133
|
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
|
|
1021
|
-
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld
|
|
1134
|
+
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld);
|
|
1022
1135
|
} else {
|
|
1023
1136
|
patch(elmToMove, newStartVnode, isInitialRender);
|
|
1024
1137
|
oldCh[idxInOld] = void 0;
|
|
@@ -1026,12 +1139,16 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
1026
1139
|
}
|
|
1027
1140
|
newStartVnode = newCh[++newStartIdx];
|
|
1028
1141
|
} else {
|
|
1029
|
-
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx
|
|
1142
|
+
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx);
|
|
1030
1143
|
newStartVnode = newCh[++newStartIdx];
|
|
1031
1144
|
}
|
|
1032
1145
|
if (node) {
|
|
1033
|
-
if (
|
|
1034
|
-
insertBefore(
|
|
1146
|
+
if (import_app_data5.BUILD.slotRelocation) {
|
|
1147
|
+
insertBefore(
|
|
1148
|
+
referenceNode(oldStartVnode.$elm$).parentNode,
|
|
1149
|
+
node,
|
|
1150
|
+
referenceNode(oldStartVnode.$elm$)
|
|
1151
|
+
);
|
|
1035
1152
|
} else {
|
|
1036
1153
|
insertBefore(oldStartVnode.$elm$.parentNode, node, oldStartVnode.$elm$);
|
|
1037
1154
|
}
|
|
@@ -1047,35 +1164,26 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
1047
1164
|
newStartIdx,
|
|
1048
1165
|
newEndIdx
|
|
1049
1166
|
);
|
|
1050
|
-
} else if (
|
|
1167
|
+
} else if (import_app_data5.BUILD.updatable && newStartIdx > newEndIdx) {
|
|
1051
1168
|
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
|
|
1052
1169
|
}
|
|
1053
1170
|
};
|
|
1054
1171
|
var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
1055
1172
|
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
1056
|
-
if (
|
|
1057
|
-
if (
|
|
1058
|
-
// The component gets hydrated and no VDOM has been initialized.
|
|
1059
|
-
// Here the comparison can't happen as $name$ property is not set for `leftNode`.
|
|
1060
|
-
"$nodeId$" in leftVNode && isInitialRender && // `leftNode` is not from type HTMLComment which would cause many
|
|
1061
|
-
// hydration comments to be removed
|
|
1062
|
-
leftVNode.$elm$.nodeType !== 8
|
|
1063
|
-
) {
|
|
1064
|
-
return false;
|
|
1065
|
-
}
|
|
1173
|
+
if (import_app_data5.BUILD.slotRelocation && leftVNode.$tag$ === "slot") {
|
|
1066
1174
|
return leftVNode.$name$ === rightVNode.$name$;
|
|
1067
1175
|
}
|
|
1068
|
-
if (
|
|
1176
|
+
if (import_app_data5.BUILD.vdomKey && !isInitialRender) {
|
|
1069
1177
|
return leftVNode.$key$ === rightVNode.$key$;
|
|
1070
1178
|
}
|
|
1179
|
+
if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
|
|
1180
|
+
leftVNode.$key$ = rightVNode.$key$;
|
|
1181
|
+
}
|
|
1071
1182
|
return true;
|
|
1072
1183
|
}
|
|
1073
1184
|
return false;
|
|
1074
1185
|
};
|
|
1075
|
-
var referenceNode = (node) =>
|
|
1076
|
-
return node && node["s-ol"] || node;
|
|
1077
|
-
};
|
|
1078
|
-
var parentReferenceNode = (node) => (node["s-ol"] ? node["s-ol"] : node).parentNode;
|
|
1186
|
+
var referenceNode = (node) => node && node["s-ol"] || node;
|
|
1079
1187
|
var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
1080
1188
|
const elm = newVNode2.$elm$ = oldVNode.$elm$;
|
|
1081
1189
|
const oldChildren = oldVNode.$children$;
|
|
@@ -1083,13 +1191,13 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
1083
1191
|
const tag = newVNode2.$tag$;
|
|
1084
1192
|
const text = newVNode2.$text$;
|
|
1085
1193
|
let defaultHolder;
|
|
1086
|
-
if (!
|
|
1087
|
-
if (
|
|
1194
|
+
if (!import_app_data5.BUILD.vdomText || text === null) {
|
|
1195
|
+
if (import_app_data5.BUILD.svg) {
|
|
1088
1196
|
isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
|
|
1089
1197
|
}
|
|
1090
|
-
if (
|
|
1091
|
-
if (
|
|
1092
|
-
if (
|
|
1198
|
+
if (import_app_data5.BUILD.vdomAttribute || import_app_data5.BUILD.reflect) {
|
|
1199
|
+
if (import_app_data5.BUILD.slot && tag === "slot" && !useNativeShadowDom) {
|
|
1200
|
+
if (import_app_data5.BUILD.experimentalSlotFixes && oldVNode.$name$ !== newVNode2.$name$) {
|
|
1093
1201
|
newVNode2.$elm$["s-sn"] = newVNode2.$name$ || "";
|
|
1094
1202
|
relocateToHostRoot(newVNode2.$elm$.parentElement);
|
|
1095
1203
|
}
|
|
@@ -1097,55 +1205,28 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
1097
1205
|
updateElement(oldVNode, newVNode2, isSvgMode);
|
|
1098
1206
|
}
|
|
1099
1207
|
}
|
|
1100
|
-
if (
|
|
1208
|
+
if (import_app_data5.BUILD.updatable && oldChildren !== null && newChildren !== null) {
|
|
1101
1209
|
updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
|
|
1102
1210
|
} else if (newChildren !== null) {
|
|
1103
|
-
if (
|
|
1211
|
+
if (import_app_data5.BUILD.updatable && import_app_data5.BUILD.vdomText && oldVNode.$text$ !== null) {
|
|
1104
1212
|
elm.textContent = "";
|
|
1105
1213
|
}
|
|
1106
1214
|
addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
|
|
1107
1215
|
} else if (
|
|
1108
1216
|
// don't do this on initial render as it can cause non-hydrated content to be removed
|
|
1109
|
-
!isInitialRender &&
|
|
1217
|
+
!isInitialRender && import_app_data5.BUILD.updatable && oldChildren !== null
|
|
1110
1218
|
) {
|
|
1111
1219
|
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
1112
1220
|
}
|
|
1113
|
-
if (
|
|
1221
|
+
if (import_app_data5.BUILD.svg && isSvgMode && tag === "svg") {
|
|
1114
1222
|
isSvgMode = false;
|
|
1115
1223
|
}
|
|
1116
|
-
} else if (
|
|
1224
|
+
} else if (import_app_data5.BUILD.vdomText && import_app_data5.BUILD.slotRelocation && (defaultHolder = elm["s-cr"])) {
|
|
1117
1225
|
defaultHolder.parentNode.textContent = text;
|
|
1118
|
-
} else if (
|
|
1226
|
+
} else if (import_app_data5.BUILD.vdomText && oldVNode.$text$ !== text) {
|
|
1119
1227
|
elm.data = text;
|
|
1120
1228
|
}
|
|
1121
1229
|
};
|
|
1122
|
-
var updateFallbackSlotVisibility = (elm) => {
|
|
1123
|
-
const childNodes = elm.__childNodes || elm.childNodes;
|
|
1124
|
-
for (const childNode of childNodes) {
|
|
1125
|
-
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
1126
|
-
if (childNode["s-sr"]) {
|
|
1127
|
-
const slotName = childNode["s-sn"];
|
|
1128
|
-
childNode.hidden = false;
|
|
1129
|
-
for (const siblingNode of childNodes) {
|
|
1130
|
-
if (siblingNode !== childNode) {
|
|
1131
|
-
if (siblingNode["s-hn"] !== childNode["s-hn"] || slotName !== "") {
|
|
1132
|
-
if (siblingNode.nodeType === 1 /* ElementNode */ && (slotName === siblingNode.getAttribute("slot") || slotName === siblingNode["s-sn"]) || siblingNode.nodeType === 3 /* TextNode */ && slotName === siblingNode["s-sn"]) {
|
|
1133
|
-
childNode.hidden = true;
|
|
1134
|
-
break;
|
|
1135
|
-
}
|
|
1136
|
-
} else if (slotName === siblingNode["s-sn"]) {
|
|
1137
|
-
if (siblingNode.nodeType === 1 /* ElementNode */ || siblingNode.nodeType === 3 /* TextNode */ && siblingNode.textContent.trim() !== "") {
|
|
1138
|
-
childNode.hidden = true;
|
|
1139
|
-
break;
|
|
1140
|
-
}
|
|
1141
|
-
}
|
|
1142
|
-
}
|
|
1143
|
-
}
|
|
1144
|
-
}
|
|
1145
|
-
updateFallbackSlotVisibility(childNode);
|
|
1146
|
-
}
|
|
1147
|
-
}
|
|
1148
|
-
};
|
|
1149
1230
|
var relocateNodes = [];
|
|
1150
1231
|
var markSlotContentForRelocation = (elm) => {
|
|
1151
1232
|
let node;
|
|
@@ -1158,7 +1239,7 @@ var markSlotContentForRelocation = (elm) => {
|
|
|
1158
1239
|
const slotName = childNode["s-sn"];
|
|
1159
1240
|
for (j = hostContentNodes.length - 1; j >= 0; j--) {
|
|
1160
1241
|
node = hostContentNodes[j];
|
|
1161
|
-
if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!
|
|
1242
|
+
if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!import_app_data5.BUILD.experimentalSlotFixes || !node["s-sh"] || node["s-sh"] !== childNode["s-hn"])) {
|
|
1162
1243
|
if (isNodeLocatedInSlot(node, slotName)) {
|
|
1163
1244
|
let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
|
|
1164
1245
|
checkSlotFallbackVisibility = true;
|
|
@@ -1196,60 +1277,40 @@ var markSlotContentForRelocation = (elm) => {
|
|
|
1196
1277
|
}
|
|
1197
1278
|
}
|
|
1198
1279
|
};
|
|
1199
|
-
var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
|
|
1200
|
-
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1201
|
-
if (nodeToRelocate.getAttribute("slot") === null && slotName === "") {
|
|
1202
|
-
return true;
|
|
1203
|
-
}
|
|
1204
|
-
if (nodeToRelocate.getAttribute("slot") === slotName) {
|
|
1205
|
-
return true;
|
|
1206
|
-
}
|
|
1207
|
-
return false;
|
|
1208
|
-
}
|
|
1209
|
-
if (nodeToRelocate["s-sn"] === slotName) {
|
|
1210
|
-
return true;
|
|
1211
|
-
}
|
|
1212
|
-
return slotName === "";
|
|
1213
|
-
};
|
|
1214
1280
|
var nullifyVNodeRefs = (vNode) => {
|
|
1215
|
-
if (
|
|
1281
|
+
if (import_app_data5.BUILD.vdomRef) {
|
|
1216
1282
|
vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
|
|
1217
1283
|
vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
|
|
1218
1284
|
}
|
|
1219
1285
|
};
|
|
1220
1286
|
var insertBefore = (parent, newNode, reference) => {
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
updateElementScopeIds(newNode, parent);
|
|
1287
|
+
if (import_app_data5.BUILD.scoped && typeof newNode["s-sn"] === "string" && !!newNode["s-sr"] && !!newNode["s-cr"]) {
|
|
1288
|
+
addRemoveSlotScopedClass(newNode["s-cr"], newNode, parent, newNode.parentElement);
|
|
1224
1289
|
}
|
|
1290
|
+
const inserted = parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
|
1225
1291
|
return inserted;
|
|
1226
1292
|
};
|
|
1227
|
-
|
|
1228
|
-
const scopeIds = [];
|
|
1229
|
-
if (element) {
|
|
1230
|
-
scopeIds.push(
|
|
1231
|
-
...element["s-scs"] || [],
|
|
1232
|
-
element["s-si"],
|
|
1233
|
-
element["s-sc"],
|
|
1234
|
-
...findScopeIds(element.parentElement)
|
|
1235
|
-
);
|
|
1236
|
-
}
|
|
1237
|
-
return scopeIds;
|
|
1238
|
-
};
|
|
1239
|
-
var updateElementScopeIds = (element, parent, iterateChildNodes = false) => {
|
|
1293
|
+
function addRemoveSlotScopedClass(reference, slotNode, newParent, oldParent) {
|
|
1240
1294
|
var _a;
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1295
|
+
let scopeId2;
|
|
1296
|
+
if (reference && typeof slotNode["s-sn"] === "string" && !!slotNode["s-sr"] && reference.parentNode && reference.parentNode["s-sc"] && (scopeId2 = slotNode["s-si"] || reference.parentNode["s-sc"])) {
|
|
1297
|
+
const scopeName = slotNode["s-sn"];
|
|
1298
|
+
const hostName = slotNode["s-hn"];
|
|
1299
|
+
(_a = newParent.classList) == null ? void 0 : _a.add(scopeId2 + "-s");
|
|
1300
|
+
if (oldParent && oldParent.classList.contains(scopeId2 + "-s")) {
|
|
1301
|
+
let child = (oldParent.__childNodes || oldParent.childNodes)[0];
|
|
1302
|
+
let found = false;
|
|
1303
|
+
while (child) {
|
|
1304
|
+
if (child["s-sn"] !== scopeName && child["s-hn"] === hostName && !!child["s-sr"]) {
|
|
1305
|
+
found = true;
|
|
1306
|
+
break;
|
|
1248
1307
|
}
|
|
1308
|
+
child = child.nextSibling;
|
|
1249
1309
|
}
|
|
1310
|
+
if (!found) oldParent.classList.remove(scopeId2 + "-s");
|
|
1250
1311
|
}
|
|
1251
1312
|
}
|
|
1252
|
-
}
|
|
1313
|
+
}
|
|
1253
1314
|
var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
1254
1315
|
var _a, _b, _c, _d, _e;
|
|
1255
1316
|
const hostElm = hostRef.$hostElement$;
|
|
@@ -1257,7 +1318,7 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
1257
1318
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
1258
1319
|
const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
|
1259
1320
|
hostTagName = hostElm.tagName;
|
|
1260
|
-
if (
|
|
1321
|
+
if (import_app_data5.BUILD.isDev && Array.isArray(renderFnResults) && renderFnResults.some(isHost)) {
|
|
1261
1322
|
throw new Error(`The <Host> must be the single root component.
|
|
1262
1323
|
Looks like the render() function of "${hostTagName.toLowerCase()}" is returning an array that contains the <Host>.
|
|
1263
1324
|
|
|
@@ -1271,7 +1332,7 @@ render() {
|
|
|
1271
1332
|
}
|
|
1272
1333
|
`);
|
|
1273
1334
|
}
|
|
1274
|
-
if (
|
|
1335
|
+
if (import_app_data5.BUILD.reflect && cmpMeta.$attrsToReflect$) {
|
|
1275
1336
|
rootVnode.$attrs$ = rootVnode.$attrs$ || {};
|
|
1276
1337
|
cmpMeta.$attrsToReflect$.map(
|
|
1277
1338
|
([propName, attribute]) => rootVnode.$attrs$[attribute] = hostElm[propName]
|
|
@@ -1287,24 +1348,24 @@ render() {
|
|
|
1287
1348
|
rootVnode.$tag$ = null;
|
|
1288
1349
|
rootVnode.$flags$ |= 4 /* isHost */;
|
|
1289
1350
|
hostRef.$vnode$ = rootVnode;
|
|
1290
|
-
rootVnode.$elm$ = oldVNode.$elm$ =
|
|
1291
|
-
if (
|
|
1351
|
+
rootVnode.$elm$ = oldVNode.$elm$ = import_app_data5.BUILD.shadowDom ? hostElm.shadowRoot || hostElm : hostElm;
|
|
1352
|
+
if (import_app_data5.BUILD.scoped || import_app_data5.BUILD.shadowDom) {
|
|
1292
1353
|
scopeId = hostElm["s-sc"];
|
|
1293
1354
|
}
|
|
1294
1355
|
useNativeShadowDom = supportsShadow && (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
|
1295
|
-
if (
|
|
1356
|
+
if (import_app_data5.BUILD.slotRelocation) {
|
|
1296
1357
|
contentRef = hostElm["s-cr"];
|
|
1297
1358
|
checkSlotFallbackVisibility = false;
|
|
1298
1359
|
}
|
|
1299
1360
|
patch(oldVNode, rootVnode, isInitialLoad);
|
|
1300
|
-
if (
|
|
1361
|
+
if (import_app_data5.BUILD.slotRelocation) {
|
|
1301
1362
|
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
1302
1363
|
if (checkSlotRelocate) {
|
|
1303
1364
|
markSlotContentForRelocation(rootVnode.$elm$);
|
|
1304
1365
|
for (const relocateData of relocateNodes) {
|
|
1305
1366
|
const nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
1306
1367
|
if (!nodeToRelocate["s-ol"]) {
|
|
1307
|
-
const orgLocationNode =
|
|
1368
|
+
const orgLocationNode = import_app_data5.BUILD.isDebug || import_app_data5.BUILD.hydrateServerSide ? originalLocationDebugNode(nodeToRelocate) : doc.createTextNode("");
|
|
1308
1369
|
orgLocationNode["s-nr"] = nodeToRelocate;
|
|
1309
1370
|
insertBefore(nodeToRelocate.parentNode, nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate);
|
|
1310
1371
|
}
|
|
@@ -1315,7 +1376,7 @@ render() {
|
|
|
1315
1376
|
if (slotRefNode) {
|
|
1316
1377
|
const parentNodeRef = slotRefNode.parentNode;
|
|
1317
1378
|
let insertBeforeNode = slotRefNode.nextSibling;
|
|
1318
|
-
if (!
|
|
1379
|
+
if (!import_app_data5.BUILD.hydrateServerSide && (!import_app_data5.BUILD.experimentalSlotFixes || insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */)) {
|
|
1319
1380
|
let orgLocationNode = (_a = nodeToRelocate["s-ol"]) == null ? void 0 : _a.previousSibling;
|
|
1320
1381
|
while (orgLocationNode) {
|
|
1321
1382
|
let refNode = (_b = orgLocationNode["s-nr"]) != null ? _b : null;
|
|
@@ -1334,11 +1395,11 @@ render() {
|
|
|
1334
1395
|
}
|
|
1335
1396
|
if (!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode || nodeToRelocate.nextSibling !== insertBeforeNode) {
|
|
1336
1397
|
if (nodeToRelocate !== insertBeforeNode) {
|
|
1337
|
-
if (!
|
|
1398
|
+
if (!import_app_data5.BUILD.experimentalSlotFixes && !nodeToRelocate["s-hn"] && nodeToRelocate["s-ol"]) {
|
|
1338
1399
|
nodeToRelocate["s-hn"] = nodeToRelocate["s-ol"].parentNode.nodeName;
|
|
1339
1400
|
}
|
|
1340
1401
|
insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
|
|
1341
|
-
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1402
|
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */ && nodeToRelocate.tagName !== "SLOT-FB") {
|
|
1342
1403
|
nodeToRelocate.hidden = (_c = nodeToRelocate["s-ih"]) != null ? _c : false;
|
|
1343
1404
|
}
|
|
1344
1405
|
}
|
|
@@ -1360,7 +1421,7 @@ render() {
|
|
|
1360
1421
|
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
1361
1422
|
relocateNodes.length = 0;
|
|
1362
1423
|
}
|
|
1363
|
-
if (
|
|
1424
|
+
if (import_app_data5.BUILD.experimentalScopedSlotChanges && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
1364
1425
|
const children = rootVnode.$elm$.__childNodes || rootVnode.$elm$.childNodes;
|
|
1365
1426
|
for (const childNode of children) {
|
|
1366
1427
|
if (childNode["s-hn"] !== hostTagName && !childNode["s-sh"]) {
|
|
@@ -1397,9 +1458,9 @@ var patchCloneNode = (HostElementPrototype) => {
|
|
|
1397
1458
|
const orgCloneNode = HostElementPrototype.cloneNode;
|
|
1398
1459
|
HostElementPrototype.cloneNode = function(deep) {
|
|
1399
1460
|
const srcNode = this;
|
|
1400
|
-
const isShadowDom =
|
|
1461
|
+
const isShadowDom = import_app_data6.BUILD.shadowDom ? srcNode.shadowRoot && supportsShadow : false;
|
|
1401
1462
|
const clonedNode = orgCloneNode.call(srcNode, isShadowDom ? deep : false);
|
|
1402
|
-
if (
|
|
1463
|
+
if (import_app_data6.BUILD.slot && !isShadowDom && deep) {
|
|
1403
1464
|
let i2 = 0;
|
|
1404
1465
|
let slotted, nonStencilNode;
|
|
1405
1466
|
const stencilPrivates = [
|
|
@@ -1424,7 +1485,7 @@ var patchCloneNode = (HostElementPrototype) => {
|
|
|
1424
1485
|
slotted = childNodes[i2]["s-nr"];
|
|
1425
1486
|
nonStencilNode = stencilPrivates.every((privateField) => !childNodes[i2][privateField]);
|
|
1426
1487
|
if (slotted) {
|
|
1427
|
-
if (
|
|
1488
|
+
if (import_app_data6.BUILD.appendChildSlotFix && clonedNode.__appendChild) {
|
|
1428
1489
|
clonedNode.__appendChild(slotted.cloneNode(true));
|
|
1429
1490
|
} else {
|
|
1430
1491
|
clonedNode.appendChild(slotted.cloneNode(true));
|
|
@@ -1442,7 +1503,7 @@ var patchSlotAppendChild = (HostElementPrototype) => {
|
|
|
1442
1503
|
HostElementPrototype.__appendChild = HostElementPrototype.appendChild;
|
|
1443
1504
|
HostElementPrototype.appendChild = function(newChild) {
|
|
1444
1505
|
const slotName = newChild["s-sn"] = getSlotName(newChild);
|
|
1445
|
-
const slotNode =
|
|
1506
|
+
const slotNode = getHostSlotNodes(this.__childNodes || this.childNodes, this.tagName, slotName)[0];
|
|
1446
1507
|
if (slotNode) {
|
|
1447
1508
|
addSlotRelocateNode(newChild, slotNode);
|
|
1448
1509
|
const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
|
|
@@ -1459,7 +1520,7 @@ var patchSlotRemoveChild = (ElementPrototype) => {
|
|
|
1459
1520
|
ElementPrototype.removeChild = function(toRemove) {
|
|
1460
1521
|
if (toRemove && typeof toRemove["s-sn"] !== "undefined") {
|
|
1461
1522
|
const childNodes = this.__childNodes || this.childNodes;
|
|
1462
|
-
const slotNode =
|
|
1523
|
+
const slotNode = getHostSlotNodes(childNodes, this.tagName, toRemove["s-sn"]);
|
|
1463
1524
|
if (slotNode && toRemove.isConnected) {
|
|
1464
1525
|
toRemove.remove();
|
|
1465
1526
|
updateFallbackSlotVisibility(this);
|
|
@@ -1478,7 +1539,7 @@ var patchSlotPrepend = (HostElementPrototype) => {
|
|
|
1478
1539
|
}
|
|
1479
1540
|
const slotName = newChild["s-sn"] = getSlotName(newChild);
|
|
1480
1541
|
const childNodes = this.__childNodes || this.childNodes;
|
|
1481
|
-
const slotNode =
|
|
1542
|
+
const slotNode = getHostSlotNodes(childNodes, this.tagName, slotName)[0];
|
|
1482
1543
|
if (slotNode) {
|
|
1483
1544
|
addSlotRelocateNode(newChild, slotNode, true);
|
|
1484
1545
|
const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
|
|
@@ -1545,11 +1606,7 @@ var patchSlotInsertAdjacentElement = (HostElementPrototype) => {
|
|
|
1545
1606
|
};
|
|
1546
1607
|
};
|
|
1547
1608
|
var patchTextContent = (hostElementPrototype) => {
|
|
1548
|
-
|
|
1549
|
-
if (!descriptor) {
|
|
1550
|
-
descriptor = Object.getOwnPropertyDescriptor(hostElementPrototype, "textContent");
|
|
1551
|
-
}
|
|
1552
|
-
if (descriptor) Object.defineProperty(hostElementPrototype, "__textContent", descriptor);
|
|
1609
|
+
patchHostOriginalAccessor("textContent", hostElementPrototype);
|
|
1553
1610
|
Object.defineProperty(hostElementPrototype, "textContent", {
|
|
1554
1611
|
get: function() {
|
|
1555
1612
|
let text = "";
|
|
@@ -1573,16 +1630,7 @@ var patchChildSlotNodes = (elm) => {
|
|
|
1573
1630
|
return this[n];
|
|
1574
1631
|
}
|
|
1575
1632
|
}
|
|
1576
|
-
|
|
1577
|
-
if (!childNodesFn) {
|
|
1578
|
-
childNodesFn = Object.getOwnPropertyDescriptor(elm, "childNodes");
|
|
1579
|
-
}
|
|
1580
|
-
if (childNodesFn) Object.defineProperty(elm, "__childNodes", childNodesFn);
|
|
1581
|
-
let childrenFn = Object.getOwnPropertyDescriptor(Element.prototype, "children");
|
|
1582
|
-
if (!childrenFn) {
|
|
1583
|
-
childrenFn = Object.getOwnPropertyDescriptor(elm, "children");
|
|
1584
|
-
}
|
|
1585
|
-
if (childrenFn) Object.defineProperty(elm, "__children", childrenFn);
|
|
1633
|
+
patchHostOriginalAccessor("children", elm);
|
|
1586
1634
|
Object.defineProperty(elm, "children", {
|
|
1587
1635
|
get() {
|
|
1588
1636
|
return this.childNodes.filter((n) => n.nodeType === 1);
|
|
@@ -1593,7 +1641,19 @@ var patchChildSlotNodes = (elm) => {
|
|
|
1593
1641
|
return this.children.length;
|
|
1594
1642
|
}
|
|
1595
1643
|
});
|
|
1596
|
-
|
|
1644
|
+
patchHostOriginalAccessor("firstChild", elm);
|
|
1645
|
+
Object.defineProperty(elm, "firstChild", {
|
|
1646
|
+
get() {
|
|
1647
|
+
return this.childNodes[0];
|
|
1648
|
+
}
|
|
1649
|
+
});
|
|
1650
|
+
patchHostOriginalAccessor("lastChild", elm);
|
|
1651
|
+
Object.defineProperty(elm, "lastChild", {
|
|
1652
|
+
get() {
|
|
1653
|
+
return this.childNodes[this.childNodes.length - 1];
|
|
1654
|
+
}
|
|
1655
|
+
});
|
|
1656
|
+
patchHostOriginalAccessor("childNodes", elm);
|
|
1597
1657
|
Object.defineProperty(elm, "childNodes", {
|
|
1598
1658
|
get() {
|
|
1599
1659
|
var _a, _b;
|
|
@@ -1607,77 +1667,102 @@ var patchChildSlotNodes = (elm) => {
|
|
|
1607
1667
|
}
|
|
1608
1668
|
});
|
|
1609
1669
|
};
|
|
1610
|
-
var
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1670
|
+
var patchNextPrev = (node) => {
|
|
1671
|
+
if (!node || node.__nextSibling || !globalThis.Node) return;
|
|
1672
|
+
patchNextSibling(node);
|
|
1673
|
+
patchPreviousSibling(node);
|
|
1674
|
+
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
1675
|
+
patchNextElementSibling(node);
|
|
1676
|
+
patchPreviousElementSibling(node);
|
|
1617
1677
|
}
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
const
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
else if (!b["s-oo"] || b["s-oo"] < a["s-oo"]) return 1;
|
|
1632
|
-
return 0;
|
|
1633
|
-
});
|
|
1634
|
-
slotRelocateNodes.forEach((n) => appendMethod.call(parent, n));
|
|
1678
|
+
};
|
|
1679
|
+
var patchNextSibling = (node) => {
|
|
1680
|
+
if (!node || node.__nextSibling) return;
|
|
1681
|
+
patchHostOriginalAccessor("nextSibling", node);
|
|
1682
|
+
Object.defineProperty(node, "nextSibling", {
|
|
1683
|
+
get: function() {
|
|
1684
|
+
var _a;
|
|
1685
|
+
const parentNodes = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.childNodes;
|
|
1686
|
+
const index = parentNodes == null ? void 0 : parentNodes.indexOf(this);
|
|
1687
|
+
if (parentNodes && index > -1) {
|
|
1688
|
+
return parentNodes[index + 1];
|
|
1689
|
+
}
|
|
1690
|
+
return this.__nextSibling;
|
|
1635
1691
|
}
|
|
1636
|
-
}
|
|
1637
|
-
appendMethod.call(parent, slottedNodeLocation);
|
|
1638
|
-
}
|
|
1639
|
-
newChild["s-ol"] = slottedNodeLocation;
|
|
1640
|
-
newChild["s-sh"] = slotNode["s-hn"];
|
|
1692
|
+
});
|
|
1641
1693
|
};
|
|
1642
|
-
var
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1694
|
+
var patchNextElementSibling = (element) => {
|
|
1695
|
+
if (!element || element.__nextElementSibling) return;
|
|
1696
|
+
patchHostOriginalAccessor("nextElementSibling", element);
|
|
1697
|
+
Object.defineProperty(element, "nextElementSibling", {
|
|
1698
|
+
get: function() {
|
|
1699
|
+
var _a;
|
|
1700
|
+
const parentEles = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.children;
|
|
1701
|
+
const index = parentEles == null ? void 0 : parentEles.indexOf(this);
|
|
1702
|
+
if (parentEles && index > -1) {
|
|
1703
|
+
return parentEles[index + 1];
|
|
1704
|
+
}
|
|
1705
|
+
return this.__nextElementSibling;
|
|
1648
1706
|
}
|
|
1649
|
-
}
|
|
1650
|
-
return result;
|
|
1707
|
+
});
|
|
1651
1708
|
};
|
|
1652
|
-
var
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1709
|
+
var patchPreviousSibling = (node) => {
|
|
1710
|
+
if (!node || node.__previousSibling) return;
|
|
1711
|
+
patchHostOriginalAccessor("previousSibling", node);
|
|
1712
|
+
Object.defineProperty(node, "previousSibling", {
|
|
1713
|
+
get: function() {
|
|
1714
|
+
var _a;
|
|
1715
|
+
const parentNodes = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.childNodes;
|
|
1716
|
+
const index = parentNodes == null ? void 0 : parentNodes.indexOf(this);
|
|
1717
|
+
if (parentNodes && index > -1) {
|
|
1718
|
+
return parentNodes[index - 1];
|
|
1719
|
+
}
|
|
1720
|
+
return this.__previousSibling;
|
|
1660
1721
|
}
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1722
|
+
});
|
|
1723
|
+
};
|
|
1724
|
+
var patchPreviousElementSibling = (element) => {
|
|
1725
|
+
if (!element || element.__previousElementSibling) return;
|
|
1726
|
+
patchHostOriginalAccessor("previousElementSibling", element);
|
|
1727
|
+
Object.defineProperty(element, "previousElementSibling", {
|
|
1728
|
+
get: function() {
|
|
1729
|
+
var _a;
|
|
1730
|
+
const parentNodes = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.children;
|
|
1731
|
+
const index = parentNodes == null ? void 0 : parentNodes.indexOf(this);
|
|
1732
|
+
if (parentNodes && index > -1) {
|
|
1733
|
+
return parentNodes[index - 1];
|
|
1734
|
+
}
|
|
1735
|
+
return this.__previousElementSibling;
|
|
1664
1736
|
}
|
|
1665
|
-
}
|
|
1666
|
-
return null;
|
|
1737
|
+
});
|
|
1667
1738
|
};
|
|
1668
|
-
var
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1739
|
+
var validElementPatches = ["children", "nextElementSibling", "previousElementSibling"];
|
|
1740
|
+
var validNodesPatches = [
|
|
1741
|
+
"childNodes",
|
|
1742
|
+
"firstChild",
|
|
1743
|
+
"lastChild",
|
|
1744
|
+
"nextSibling",
|
|
1745
|
+
"previousSibling",
|
|
1746
|
+
"textContent"
|
|
1747
|
+
];
|
|
1748
|
+
function patchHostOriginalAccessor(accessorName, node) {
|
|
1749
|
+
let accessor;
|
|
1750
|
+
if (validElementPatches.includes(accessorName)) {
|
|
1751
|
+
accessor = Object.getOwnPropertyDescriptor(Element.prototype, accessorName);
|
|
1752
|
+
} else if (validNodesPatches.includes(accessorName)) {
|
|
1753
|
+
accessor = Object.getOwnPropertyDescriptor(Node.prototype, accessorName);
|
|
1672
1754
|
}
|
|
1673
|
-
|
|
1674
|
-
|
|
1755
|
+
if (!accessor) {
|
|
1756
|
+
accessor = Object.getOwnPropertyDescriptor(node, accessorName);
|
|
1757
|
+
}
|
|
1758
|
+
if (accessor) Object.defineProperty(node, "__" + accessorName, accessor);
|
|
1759
|
+
}
|
|
1675
1760
|
|
|
1676
1761
|
// src/runtime/profile.ts
|
|
1677
|
-
var
|
|
1762
|
+
var import_app_data7 = require("@stencil/core/internal/app-data");
|
|
1678
1763
|
var i = 0;
|
|
1679
1764
|
var createTime = (fnName, tagName = "") => {
|
|
1680
|
-
if (
|
|
1765
|
+
if (import_app_data7.BUILD.profile && performance.mark) {
|
|
1681
1766
|
const key = `st:${fnName}:${tagName}:${i++}`;
|
|
1682
1767
|
performance.mark(key);
|
|
1683
1768
|
return () => performance.measure(`[Stencil] ${fnName}() <${tagName}>`, key);
|
|
@@ -1688,7 +1773,7 @@ var createTime = (fnName, tagName = "") => {
|
|
|
1688
1773
|
}
|
|
1689
1774
|
};
|
|
1690
1775
|
var uniqueTime = (key, measureText) => {
|
|
1691
|
-
if (
|
|
1776
|
+
if (import_app_data7.BUILD.profile && performance.mark) {
|
|
1692
1777
|
if (performance.getEntriesByName(key, "mark").length === 0) {
|
|
1693
1778
|
performance.mark(key);
|
|
1694
1779
|
}
|
|
@@ -1746,7 +1831,7 @@ var inspect = (ref) => {
|
|
|
1746
1831
|
};
|
|
1747
1832
|
};
|
|
1748
1833
|
var installDevTools = () => {
|
|
1749
|
-
if (
|
|
1834
|
+
if (import_app_data7.BUILD.devTools) {
|
|
1750
1835
|
const stencil = win.stencil = win.stencil || {};
|
|
1751
1836
|
const originalInspect = stencil.inspect;
|
|
1752
1837
|
stencil.inspect = (ref) => {
|
|
@@ -1766,9 +1851,19 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1766
1851
|
const childRenderNodes = [];
|
|
1767
1852
|
const slotNodes = [];
|
|
1768
1853
|
const slottedNodes = [];
|
|
1769
|
-
const shadowRootNodes =
|
|
1854
|
+
const shadowRootNodes = import_app_data8.BUILD.shadowDom && shadowRoot ? [] : null;
|
|
1770
1855
|
const vnode = newVNode(tagName, null);
|
|
1771
1856
|
vnode.$elm$ = hostElm;
|
|
1857
|
+
let scopeId2;
|
|
1858
|
+
if (import_app_data8.BUILD.scoped) {
|
|
1859
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
1860
|
+
if (cmpMeta && cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */ && hostElm["s-sc"]) {
|
|
1861
|
+
scopeId2 = hostElm["s-sc"];
|
|
1862
|
+
hostElm.classList.add(scopeId2 + "-h");
|
|
1863
|
+
} else if (hostElm["s-sc"]) {
|
|
1864
|
+
delete hostElm["s-sc"];
|
|
1865
|
+
}
|
|
1866
|
+
}
|
|
1772
1867
|
if (!plt.$orgLocNodes$) {
|
|
1773
1868
|
initializeDocumentHydrate(doc.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map());
|
|
1774
1869
|
}
|
|
@@ -1798,6 +1893,18 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1798
1893
|
node["s-cr"] = hostElm["s-cr"];
|
|
1799
1894
|
}
|
|
1800
1895
|
}
|
|
1896
|
+
if (childRenderNode.$tag$ === "slot") {
|
|
1897
|
+
if (childRenderNode.$children$) {
|
|
1898
|
+
childRenderNode.$flags$ |= 2 /* isSlotFallback */;
|
|
1899
|
+
if (!childRenderNode.$elm$.childNodes.length) {
|
|
1900
|
+
childRenderNode.$children$.forEach((c) => {
|
|
1901
|
+
childRenderNode.$elm$.appendChild(c.$elm$);
|
|
1902
|
+
});
|
|
1903
|
+
}
|
|
1904
|
+
} else {
|
|
1905
|
+
childRenderNode.$flags$ |= 1 /* isSlotReference */;
|
|
1906
|
+
}
|
|
1907
|
+
}
|
|
1801
1908
|
if (orgLocationNode && orgLocationNode.isConnected) {
|
|
1802
1909
|
if (shadowRoot && orgLocationNode["s-en"] === "") {
|
|
1803
1910
|
orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
|
|
@@ -1810,8 +1917,8 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1810
1917
|
plt.$orgLocNodes$.delete(orgLocationId);
|
|
1811
1918
|
}
|
|
1812
1919
|
const hosts = [];
|
|
1813
|
-
let snIndex = 0;
|
|
1814
1920
|
const snLen = slottedNodes.length;
|
|
1921
|
+
let snIndex = 0;
|
|
1815
1922
|
let slotGroup;
|
|
1816
1923
|
let snGroupIdx;
|
|
1817
1924
|
let snGroupLen;
|
|
@@ -1833,17 +1940,24 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1833
1940
|
if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
|
|
1834
1941
|
slottedItem.slot["s-cr"] = hostEle;
|
|
1835
1942
|
} else {
|
|
1836
|
-
|
|
1837
|
-
slottedItem.slot["s-cr"] = hostChildren[0];
|
|
1943
|
+
slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
|
|
1838
1944
|
}
|
|
1839
1945
|
addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"]);
|
|
1946
|
+
if (import_app_data8.BUILD.experimentalSlotFixes) {
|
|
1947
|
+
patchNextPrev(slottedItem.node);
|
|
1948
|
+
}
|
|
1840
1949
|
}
|
|
1841
1950
|
if (hostEle.shadowRoot && slottedItem.node.parentElement !== hostEle) {
|
|
1842
1951
|
hostEle.appendChild(slottedItem.node);
|
|
1843
1952
|
}
|
|
1844
1953
|
}
|
|
1845
1954
|
}
|
|
1846
|
-
if (
|
|
1955
|
+
if (import_app_data8.BUILD.scoped && scopeId2 && slotNodes.length) {
|
|
1956
|
+
slotNodes.forEach((slot) => {
|
|
1957
|
+
slot.$elm$.parentElement.classList.add(scopeId2 + "-s");
|
|
1958
|
+
});
|
|
1959
|
+
}
|
|
1960
|
+
if (import_app_data8.BUILD.shadowDom && shadowRoot) {
|
|
1847
1961
|
let rnIdex = 0;
|
|
1848
1962
|
const rnLen = shadowRootNodes.length;
|
|
1849
1963
|
for (rnIdex; rnIdex < rnLen; rnIdex++) {
|
|
@@ -1877,15 +1991,19 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
1877
1991
|
$index$: childIdSplt[3],
|
|
1878
1992
|
$tag$: node.tagName.toLowerCase(),
|
|
1879
1993
|
$elm$: node,
|
|
1880
|
-
// If we don't add the initial classes to the VNode, the first `vdom-render.ts`
|
|
1881
|
-
//
|
|
1882
|
-
$attrs$: { class: node.className }
|
|
1994
|
+
// If we don't add the initial classes to the VNode, the first `vdom-render.ts` patch
|
|
1995
|
+
// won't try to reconcile them. Classes set on the node will be blown away.
|
|
1996
|
+
$attrs$: { class: node.className || "" }
|
|
1883
1997
|
});
|
|
1884
1998
|
childRenderNodes.push(childVNode);
|
|
1885
1999
|
node.removeAttribute(HYDRATE_CHILD_ID);
|
|
1886
2000
|
if (!parentVNode.$children$) {
|
|
1887
2001
|
parentVNode.$children$ = [];
|
|
1888
2002
|
}
|
|
2003
|
+
if (import_app_data8.BUILD.scoped && scopeId2) {
|
|
2004
|
+
node["s-si"] = scopeId2;
|
|
2005
|
+
childVNode.$attrs$.class += " " + scopeId2;
|
|
2006
|
+
}
|
|
1889
2007
|
const slotName = childVNode.$elm$.getAttribute("s-sn");
|
|
1890
2008
|
if (typeof slotName === "string") {
|
|
1891
2009
|
if (childVNode.$tag$ === "slot-fb") {
|
|
@@ -1900,6 +2018,9 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
1900
2018
|
shadowRootNodes,
|
|
1901
2019
|
slottedNodes
|
|
1902
2020
|
);
|
|
2021
|
+
if (import_app_data8.BUILD.scoped && scopeId2) {
|
|
2022
|
+
node.classList.add(scopeId2);
|
|
2023
|
+
}
|
|
1903
2024
|
}
|
|
1904
2025
|
childVNode.$elm$["s-sn"] = slotName;
|
|
1905
2026
|
childVNode.$elm$.removeAttribute("s-sn");
|
|
@@ -1907,7 +2028,6 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
1907
2028
|
if (childVNode.$index$ !== void 0) {
|
|
1908
2029
|
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
1909
2030
|
}
|
|
1910
|
-
if (scopeId2) node["s-si"] = scopeId2;
|
|
1911
2031
|
parentVNode = childVNode;
|
|
1912
2032
|
if (shadowRootNodes && childVNode.$depth$ === "0") {
|
|
1913
2033
|
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
@@ -1982,8 +2102,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
1982
2102
|
}
|
|
1983
2103
|
} else if (childVNode.$hostId$ === hostId) {
|
|
1984
2104
|
if (childNodeType === SLOT_NODE_ID) {
|
|
1985
|
-
|
|
1986
|
-
const slotName = node["s-sn"] = childVNode.$name$ = childIdSplt[5] || "";
|
|
2105
|
+
const slotName = node["s-sn"] = childIdSplt[5] || "";
|
|
1987
2106
|
addSlot(
|
|
1988
2107
|
slotName,
|
|
1989
2108
|
childIdSplt[2],
|
|
@@ -1996,9 +2115,9 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
1996
2115
|
slottedNodes
|
|
1997
2116
|
);
|
|
1998
2117
|
} else if (childNodeType === CONTENT_REF_ID) {
|
|
1999
|
-
if (
|
|
2118
|
+
if (import_app_data8.BUILD.shadowDom && shadowRootNodes) {
|
|
2000
2119
|
node.remove();
|
|
2001
|
-
} else if (
|
|
2120
|
+
} else if (import_app_data8.BUILD.slotRelocation) {
|
|
2002
2121
|
hostElm["s-cr"] = node;
|
|
2003
2122
|
node["s-cn"] = true;
|
|
2004
2123
|
}
|
|
@@ -2057,8 +2176,10 @@ var createSimpleVNode = (vnode) => {
|
|
|
2057
2176
|
};
|
|
2058
2177
|
function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNodes, slotNodes, shadowRootNodes, slottedNodes) {
|
|
2059
2178
|
node["s-sr"] = true;
|
|
2179
|
+
childVNode.$name$ = slotName || null;
|
|
2180
|
+
childVNode.$tag$ = "slot";
|
|
2060
2181
|
const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
|
|
2061
|
-
if (
|
|
2182
|
+
if (import_app_data8.BUILD.shadowDom && shadowRootNodes) {
|
|
2062
2183
|
const slot = childVNode.$elm$ = doc.createElement(childVNode.$tag$);
|
|
2063
2184
|
if (childVNode.$name$) {
|
|
2064
2185
|
childVNode.$elm$.setAttribute("name", slotName);
|
|
@@ -2099,7 +2220,7 @@ var addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) =>
|
|
|
2099
2220
|
};
|
|
2100
2221
|
|
|
2101
2222
|
// src/runtime/initialize-component.ts
|
|
2102
|
-
var
|
|
2223
|
+
var import_app_data16 = require("@stencil/core/internal/app-data");
|
|
2103
2224
|
|
|
2104
2225
|
// src/runtime/mode.ts
|
|
2105
2226
|
var computeMode = (elm) => modeResolutionChain.map((h2) => h2(elm)).find((m) => !!m);
|
|
@@ -2107,22 +2228,22 @@ var setMode = (handler) => modeResolutionChain.push(handler);
|
|
|
2107
2228
|
var getMode = (ref) => getHostRef(ref).$modeName$;
|
|
2108
2229
|
|
|
2109
2230
|
// src/runtime/proxy-component.ts
|
|
2110
|
-
var
|
|
2231
|
+
var import_app_data15 = require("@stencil/core/internal/app-data");
|
|
2111
2232
|
|
|
2112
2233
|
// src/runtime/set-value.ts
|
|
2113
|
-
var
|
|
2234
|
+
var import_app_data14 = require("@stencil/core/internal/app-data");
|
|
2114
2235
|
|
|
2115
2236
|
// src/runtime/parse-property-value.ts
|
|
2116
|
-
var
|
|
2237
|
+
var import_app_data9 = require("@stencil/core/internal/app-data");
|
|
2117
2238
|
var parsePropertyValue = (propValue, propType) => {
|
|
2118
2239
|
if (propValue != null && !isComplexType(propValue)) {
|
|
2119
|
-
if (
|
|
2240
|
+
if (import_app_data9.BUILD.propBoolean && propType & 4 /* Boolean */) {
|
|
2120
2241
|
return propValue === "false" ? false : propValue === "" || !!propValue;
|
|
2121
2242
|
}
|
|
2122
|
-
if (
|
|
2243
|
+
if (import_app_data9.BUILD.propNumber && propType & 2 /* Number */) {
|
|
2123
2244
|
return parseFloat(propValue);
|
|
2124
2245
|
}
|
|
2125
|
-
if (
|
|
2246
|
+
if (import_app_data9.BUILD.propString && propType & 1 /* String */) {
|
|
2126
2247
|
return String(propValue);
|
|
2127
2248
|
}
|
|
2128
2249
|
return propValue;
|
|
@@ -2131,21 +2252,21 @@ var parsePropertyValue = (propValue, propType) => {
|
|
|
2131
2252
|
};
|
|
2132
2253
|
|
|
2133
2254
|
// src/runtime/update-component.ts
|
|
2134
|
-
var
|
|
2255
|
+
var import_app_data13 = require("@stencil/core/internal/app-data");
|
|
2135
2256
|
|
|
2136
2257
|
// src/runtime/event-emitter.ts
|
|
2137
|
-
var
|
|
2258
|
+
var import_app_data11 = require("@stencil/core/internal/app-data");
|
|
2138
2259
|
|
|
2139
2260
|
// src/runtime/element.ts
|
|
2140
|
-
var
|
|
2141
|
-
var getElement = (ref) =>
|
|
2261
|
+
var import_app_data10 = require("@stencil/core/internal/app-data");
|
|
2262
|
+
var getElement = (ref) => import_app_data10.BUILD.lazyLoad ? getHostRef(ref).$hostElement$ : ref;
|
|
2142
2263
|
|
|
2143
2264
|
// src/runtime/event-emitter.ts
|
|
2144
2265
|
var createEvent = (ref, name, flags) => {
|
|
2145
2266
|
const elm = getElement(ref);
|
|
2146
2267
|
return {
|
|
2147
2268
|
emit: (detail) => {
|
|
2148
|
-
if (
|
|
2269
|
+
if (import_app_data11.BUILD.isDev && !elm.isConnected) {
|
|
2149
2270
|
consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`);
|
|
2150
2271
|
}
|
|
2151
2272
|
return emitEvent(elm, name, {
|
|
@@ -2164,7 +2285,7 @@ var emitEvent = (elm, name, opts) => {
|
|
|
2164
2285
|
};
|
|
2165
2286
|
|
|
2166
2287
|
// src/runtime/styles.ts
|
|
2167
|
-
var
|
|
2288
|
+
var import_app_data12 = require("@stencil/core/internal/app-data");
|
|
2168
2289
|
var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
|
|
2169
2290
|
var registerStyle = (scopeId2, cssText, allowCS) => {
|
|
2170
2291
|
let style = styles.get(scopeId2);
|
|
@@ -2184,7 +2305,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
2184
2305
|
var _a;
|
|
2185
2306
|
const scopeId2 = getScopeId(cmpMeta, mode);
|
|
2186
2307
|
const style = styles.get(scopeId2);
|
|
2187
|
-
if (!
|
|
2308
|
+
if (!import_app_data12.BUILD.attachStyles) {
|
|
2188
2309
|
return scopeId2;
|
|
2189
2310
|
}
|
|
2190
2311
|
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
|
|
@@ -2197,16 +2318,16 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
2197
2318
|
rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
|
|
2198
2319
|
}
|
|
2199
2320
|
if (!appliedStyles.has(scopeId2)) {
|
|
2200
|
-
if (
|
|
2321
|
+
if (import_app_data12.BUILD.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
|
|
2201
2322
|
styleElm.innerHTML = style;
|
|
2202
2323
|
} else {
|
|
2203
|
-
styleElm = doc.createElement("style");
|
|
2324
|
+
styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || doc.createElement("style");
|
|
2204
2325
|
styleElm.innerHTML = style;
|
|
2205
2326
|
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
|
|
2206
2327
|
if (nonce != null) {
|
|
2207
2328
|
styleElm.setAttribute("nonce", nonce);
|
|
2208
2329
|
}
|
|
2209
|
-
if ((
|
|
2330
|
+
if ((import_app_data12.BUILD.hydrateServerSide || import_app_data12.BUILD.hotModuleReplacement) && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
2210
2331
|
styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
|
|
2211
2332
|
}
|
|
2212
2333
|
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
|
|
@@ -2242,7 +2363,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
2242
2363
|
appliedStyles.add(scopeId2);
|
|
2243
2364
|
}
|
|
2244
2365
|
}
|
|
2245
|
-
} else if (
|
|
2366
|
+
} else if (import_app_data12.BUILD.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
2246
2367
|
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
2247
2368
|
}
|
|
2248
2369
|
}
|
|
@@ -2254,43 +2375,40 @@ var attachStyles = (hostRef) => {
|
|
|
2254
2375
|
const flags = cmpMeta.$flags$;
|
|
2255
2376
|
const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
|
|
2256
2377
|
const scopeId2 = addStyle(
|
|
2257
|
-
|
|
2378
|
+
import_app_data12.BUILD.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
|
|
2258
2379
|
cmpMeta,
|
|
2259
2380
|
hostRef.$modeName$
|
|
2260
2381
|
);
|
|
2261
|
-
if ((
|
|
2382
|
+
if ((import_app_data12.BUILD.shadowDom || import_app_data12.BUILD.scoped) && import_app_data12.BUILD.cssAnnotations && flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) {
|
|
2262
2383
|
elm["s-sc"] = scopeId2;
|
|
2263
2384
|
elm.classList.add(scopeId2 + "-h");
|
|
2264
|
-
if (import_app_data11.BUILD.scoped && flags & 2 /* scopedCssEncapsulation */) {
|
|
2265
|
-
elm.classList.add(scopeId2 + "-s");
|
|
2266
|
-
}
|
|
2267
2385
|
}
|
|
2268
2386
|
endAttachStyles();
|
|
2269
2387
|
};
|
|
2270
|
-
var getScopeId = (cmp, mode) => "sc-" + (
|
|
2388
|
+
var getScopeId = (cmp, mode) => "sc-" + (import_app_data12.BUILD.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
|
|
2271
2389
|
|
|
2272
2390
|
// src/runtime/update-component.ts
|
|
2273
2391
|
var attachToAncestor = (hostRef, ancestorComponent) => {
|
|
2274
|
-
if (
|
|
2392
|
+
if (import_app_data13.BUILD.asyncLoading && ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
|
|
2275
2393
|
ancestorComponent["s-p"].push(new Promise((r) => hostRef.$onRenderResolve$ = r));
|
|
2276
2394
|
}
|
|
2277
2395
|
};
|
|
2278
2396
|
var scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
2279
|
-
if (
|
|
2397
|
+
if (import_app_data13.BUILD.taskQueue && import_app_data13.BUILD.updatable) {
|
|
2280
2398
|
hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
|
|
2281
2399
|
}
|
|
2282
|
-
if (
|
|
2400
|
+
if (import_app_data13.BUILD.asyncLoading && hostRef.$flags$ & 4 /* isWaitingForChildren */) {
|
|
2283
2401
|
hostRef.$flags$ |= 512 /* needsRerender */;
|
|
2284
2402
|
return;
|
|
2285
2403
|
}
|
|
2286
2404
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$);
|
|
2287
2405
|
const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
|
|
2288
|
-
return
|
|
2406
|
+
return import_app_data13.BUILD.taskQueue ? writeTask(dispatch) : dispatch();
|
|
2289
2407
|
};
|
|
2290
2408
|
var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
2291
2409
|
const elm = hostRef.$hostElement$;
|
|
2292
2410
|
const endSchedule = createTime("scheduleUpdate", hostRef.$cmpMeta$.$tagName$);
|
|
2293
|
-
const instance =
|
|
2411
|
+
const instance = import_app_data13.BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
2294
2412
|
if (!instance) {
|
|
2295
2413
|
throw new Error(
|
|
2296
2414
|
`Can't render component <${elm.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`
|
|
@@ -2298,7 +2416,7 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
2298
2416
|
}
|
|
2299
2417
|
let maybePromise;
|
|
2300
2418
|
if (isInitialLoad) {
|
|
2301
|
-
if (
|
|
2419
|
+
if (import_app_data13.BUILD.lazyLoad && import_app_data13.BUILD.hostListener) {
|
|
2302
2420
|
hostRef.$flags$ |= 256 /* isListenReady */;
|
|
2303
2421
|
if (hostRef.$queuedListeners$) {
|
|
2304
2422
|
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
|
|
@@ -2306,17 +2424,17 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
2306
2424
|
}
|
|
2307
2425
|
}
|
|
2308
2426
|
emitLifecycleEvent(elm, "componentWillLoad");
|
|
2309
|
-
if (
|
|
2427
|
+
if (import_app_data13.BUILD.cmpWillLoad) {
|
|
2310
2428
|
maybePromise = safeCall(instance, "componentWillLoad");
|
|
2311
2429
|
}
|
|
2312
2430
|
} else {
|
|
2313
2431
|
emitLifecycleEvent(elm, "componentWillUpdate");
|
|
2314
|
-
if (
|
|
2432
|
+
if (import_app_data13.BUILD.cmpWillUpdate) {
|
|
2315
2433
|
maybePromise = safeCall(instance, "componentWillUpdate");
|
|
2316
2434
|
}
|
|
2317
2435
|
}
|
|
2318
2436
|
emitLifecycleEvent(elm, "componentWillRender");
|
|
2319
|
-
if (
|
|
2437
|
+
if (import_app_data13.BUILD.cmpWillRender) {
|
|
2320
2438
|
maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender"));
|
|
2321
2439
|
}
|
|
2322
2440
|
endSchedule();
|
|
@@ -2332,23 +2450,23 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
2332
2450
|
const elm = hostRef.$hostElement$;
|
|
2333
2451
|
const endUpdate = createTime("update", hostRef.$cmpMeta$.$tagName$);
|
|
2334
2452
|
const rc = elm["s-rc"];
|
|
2335
|
-
if (
|
|
2453
|
+
if (import_app_data13.BUILD.style && isInitialLoad) {
|
|
2336
2454
|
attachStyles(hostRef);
|
|
2337
2455
|
}
|
|
2338
2456
|
const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$);
|
|
2339
|
-
if (
|
|
2457
|
+
if (import_app_data13.BUILD.isDev) {
|
|
2340
2458
|
hostRef.$flags$ |= 1024 /* devOnRender */;
|
|
2341
2459
|
}
|
|
2342
|
-
if (
|
|
2460
|
+
if (import_app_data13.BUILD.hydrateServerSide) {
|
|
2343
2461
|
await callRender(hostRef, instance, elm, isInitialLoad);
|
|
2344
2462
|
} else {
|
|
2345
2463
|
callRender(hostRef, instance, elm, isInitialLoad);
|
|
2346
2464
|
}
|
|
2347
|
-
if (
|
|
2465
|
+
if (import_app_data13.BUILD.isDev) {
|
|
2348
2466
|
hostRef.$renderCount$ = hostRef.$renderCount$ === void 0 ? 1 : hostRef.$renderCount$ + 1;
|
|
2349
2467
|
hostRef.$flags$ &= ~1024 /* devOnRender */;
|
|
2350
2468
|
}
|
|
2351
|
-
if (
|
|
2469
|
+
if (import_app_data13.BUILD.hydrateServerSide) {
|
|
2352
2470
|
try {
|
|
2353
2471
|
serverSideConnected(elm);
|
|
2354
2472
|
if (isInitialLoad) {
|
|
@@ -2362,13 +2480,13 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
2362
2480
|
consoleError(e, elm);
|
|
2363
2481
|
}
|
|
2364
2482
|
}
|
|
2365
|
-
if (
|
|
2483
|
+
if (import_app_data13.BUILD.asyncLoading && rc) {
|
|
2366
2484
|
rc.map((cb) => cb());
|
|
2367
2485
|
elm["s-rc"] = void 0;
|
|
2368
2486
|
}
|
|
2369
2487
|
endRender();
|
|
2370
2488
|
endUpdate();
|
|
2371
|
-
if (
|
|
2489
|
+
if (import_app_data13.BUILD.asyncLoading) {
|
|
2372
2490
|
const childrenPromises = (_a = elm["s-p"]) != null ? _a : [];
|
|
2373
2491
|
const postUpdate = () => postUpdateComponent(hostRef);
|
|
2374
2492
|
if (childrenPromises.length === 0) {
|
|
@@ -2384,10 +2502,10 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
2384
2502
|
};
|
|
2385
2503
|
var renderingRef = null;
|
|
2386
2504
|
var callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
2387
|
-
const allRenderFn =
|
|
2388
|
-
const lazyLoad =
|
|
2389
|
-
const taskQueue =
|
|
2390
|
-
const updatable =
|
|
2505
|
+
const allRenderFn = import_app_data13.BUILD.allRenderFn ? true : false;
|
|
2506
|
+
const lazyLoad = import_app_data13.BUILD.lazyLoad ? true : false;
|
|
2507
|
+
const taskQueue = import_app_data13.BUILD.taskQueue ? true : false;
|
|
2508
|
+
const updatable = import_app_data13.BUILD.updatable ? true : false;
|
|
2391
2509
|
try {
|
|
2392
2510
|
renderingRef = instance;
|
|
2393
2511
|
instance = allRenderFn ? instance.render() : instance.render && instance.render();
|
|
@@ -2397,9 +2515,9 @@ var callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
|
2397
2515
|
if (updatable || lazyLoad) {
|
|
2398
2516
|
hostRef.$flags$ |= 2 /* hasRendered */;
|
|
2399
2517
|
}
|
|
2400
|
-
if (
|
|
2401
|
-
if (
|
|
2402
|
-
if (
|
|
2518
|
+
if (import_app_data13.BUILD.hasRenderFn || import_app_data13.BUILD.reflect) {
|
|
2519
|
+
if (import_app_data13.BUILD.vdomRender || import_app_data13.BUILD.reflect) {
|
|
2520
|
+
if (import_app_data13.BUILD.hydrateServerSide) {
|
|
2403
2521
|
return Promise.resolve(instance).then((value) => renderVdom(hostRef, value, isInitialLoad));
|
|
2404
2522
|
} else {
|
|
2405
2523
|
renderVdom(hostRef, instance, isInitialLoad);
|
|
@@ -2424,57 +2542,57 @@ var postUpdateComponent = (hostRef) => {
|
|
|
2424
2542
|
const tagName = hostRef.$cmpMeta$.$tagName$;
|
|
2425
2543
|
const elm = hostRef.$hostElement$;
|
|
2426
2544
|
const endPostUpdate = createTime("postUpdate", tagName);
|
|
2427
|
-
const instance =
|
|
2545
|
+
const instance = import_app_data13.BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
2428
2546
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
2429
|
-
if (
|
|
2430
|
-
if (
|
|
2547
|
+
if (import_app_data13.BUILD.cmpDidRender) {
|
|
2548
|
+
if (import_app_data13.BUILD.isDev) {
|
|
2431
2549
|
hostRef.$flags$ |= 1024 /* devOnRender */;
|
|
2432
2550
|
}
|
|
2433
2551
|
safeCall(instance, "componentDidRender");
|
|
2434
|
-
if (
|
|
2552
|
+
if (import_app_data13.BUILD.isDev) {
|
|
2435
2553
|
hostRef.$flags$ &= ~1024 /* devOnRender */;
|
|
2436
2554
|
}
|
|
2437
2555
|
}
|
|
2438
2556
|
emitLifecycleEvent(elm, "componentDidRender");
|
|
2439
2557
|
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
2440
2558
|
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
2441
|
-
if (
|
|
2559
|
+
if (import_app_data13.BUILD.asyncLoading && import_app_data13.BUILD.cssAnnotations) {
|
|
2442
2560
|
addHydratedFlag(elm);
|
|
2443
2561
|
}
|
|
2444
|
-
if (
|
|
2445
|
-
if (
|
|
2562
|
+
if (import_app_data13.BUILD.cmpDidLoad) {
|
|
2563
|
+
if (import_app_data13.BUILD.isDev) {
|
|
2446
2564
|
hostRef.$flags$ |= 2048 /* devOnDidLoad */;
|
|
2447
2565
|
}
|
|
2448
2566
|
safeCall(instance, "componentDidLoad");
|
|
2449
|
-
if (
|
|
2567
|
+
if (import_app_data13.BUILD.isDev) {
|
|
2450
2568
|
hostRef.$flags$ &= ~2048 /* devOnDidLoad */;
|
|
2451
2569
|
}
|
|
2452
2570
|
}
|
|
2453
2571
|
emitLifecycleEvent(elm, "componentDidLoad");
|
|
2454
2572
|
endPostUpdate();
|
|
2455
|
-
if (
|
|
2573
|
+
if (import_app_data13.BUILD.asyncLoading) {
|
|
2456
2574
|
hostRef.$onReadyResolve$(elm);
|
|
2457
2575
|
if (!ancestorComponent) {
|
|
2458
2576
|
appDidLoad(tagName);
|
|
2459
2577
|
}
|
|
2460
2578
|
}
|
|
2461
2579
|
} else {
|
|
2462
|
-
if (
|
|
2463
|
-
if (
|
|
2580
|
+
if (import_app_data13.BUILD.cmpDidUpdate) {
|
|
2581
|
+
if (import_app_data13.BUILD.isDev) {
|
|
2464
2582
|
hostRef.$flags$ |= 1024 /* devOnRender */;
|
|
2465
2583
|
}
|
|
2466
2584
|
safeCall(instance, "componentDidUpdate");
|
|
2467
|
-
if (
|
|
2585
|
+
if (import_app_data13.BUILD.isDev) {
|
|
2468
2586
|
hostRef.$flags$ &= ~1024 /* devOnRender */;
|
|
2469
2587
|
}
|
|
2470
2588
|
}
|
|
2471
2589
|
emitLifecycleEvent(elm, "componentDidUpdate");
|
|
2472
2590
|
endPostUpdate();
|
|
2473
2591
|
}
|
|
2474
|
-
if (
|
|
2592
|
+
if (import_app_data13.BUILD.method && import_app_data13.BUILD.lazyLoad) {
|
|
2475
2593
|
hostRef.$onInstanceResolve$(elm);
|
|
2476
2594
|
}
|
|
2477
|
-
if (
|
|
2595
|
+
if (import_app_data13.BUILD.asyncLoading) {
|
|
2478
2596
|
if (hostRef.$onRenderResolve$) {
|
|
2479
2597
|
hostRef.$onRenderResolve$();
|
|
2480
2598
|
hostRef.$onRenderResolve$ = void 0;
|
|
@@ -2486,7 +2604,7 @@ var postUpdateComponent = (hostRef) => {
|
|
|
2486
2604
|
}
|
|
2487
2605
|
};
|
|
2488
2606
|
var forceUpdate = (ref) => {
|
|
2489
|
-
if (
|
|
2607
|
+
if (import_app_data13.BUILD.updatable && (Build.isBrowser || Build.isTesting)) {
|
|
2490
2608
|
const hostRef = getHostRef(ref);
|
|
2491
2609
|
const isConnected = hostRef.$hostElement$.isConnected;
|
|
2492
2610
|
if (isConnected && (hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
@@ -2497,15 +2615,15 @@ var forceUpdate = (ref) => {
|
|
|
2497
2615
|
return false;
|
|
2498
2616
|
};
|
|
2499
2617
|
var appDidLoad = (who) => {
|
|
2500
|
-
if (
|
|
2618
|
+
if (import_app_data13.BUILD.cssAnnotations) {
|
|
2501
2619
|
addHydratedFlag(doc.documentElement);
|
|
2502
2620
|
}
|
|
2503
|
-
if (
|
|
2621
|
+
if (import_app_data13.BUILD.asyncQueue) {
|
|
2504
2622
|
plt.$flags$ |= 2 /* appLoaded */;
|
|
2505
2623
|
}
|
|
2506
|
-
nextTick(() => emitEvent(win, "appload", { detail: { namespace:
|
|
2507
|
-
if (
|
|
2508
|
-
performance.measure(`[Stencil] ${
|
|
2624
|
+
nextTick(() => emitEvent(win, "appload", { detail: { namespace: import_app_data13.NAMESPACE } }));
|
|
2625
|
+
if (import_app_data13.BUILD.profile && performance.measure) {
|
|
2626
|
+
performance.measure(`[Stencil] ${import_app_data13.NAMESPACE} initial load (by ${who})`, "st:app:start");
|
|
2509
2627
|
}
|
|
2510
2628
|
};
|
|
2511
2629
|
var safeCall = (instance, method, arg) => {
|
|
@@ -2519,19 +2637,19 @@ var safeCall = (instance, method, arg) => {
|
|
|
2519
2637
|
return void 0;
|
|
2520
2638
|
};
|
|
2521
2639
|
var emitLifecycleEvent = (elm, lifecycleName) => {
|
|
2522
|
-
if (
|
|
2640
|
+
if (import_app_data13.BUILD.lifecycleDOMEvents) {
|
|
2523
2641
|
emitEvent(elm, "stencil_" + lifecycleName, {
|
|
2524
2642
|
bubbles: true,
|
|
2525
2643
|
composed: true,
|
|
2526
2644
|
detail: {
|
|
2527
|
-
namespace:
|
|
2645
|
+
namespace: import_app_data13.NAMESPACE
|
|
2528
2646
|
}
|
|
2529
2647
|
});
|
|
2530
2648
|
}
|
|
2531
2649
|
};
|
|
2532
2650
|
var addHydratedFlag = (elm) => {
|
|
2533
2651
|
var _a, _b;
|
|
2534
|
-
return
|
|
2652
|
+
return import_app_data13.BUILD.hydratedClass ? elm.classList.add((_a = import_app_data13.BUILD.hydratedSelectorName) != null ? _a : "hydrated") : import_app_data13.BUILD.hydratedAttribute ? elm.setAttribute((_b = import_app_data13.BUILD.hydratedSelectorName) != null ? _b : "hydrated", "") : void 0;
|
|
2535
2653
|
};
|
|
2536
2654
|
var serverSideConnected = (elm) => {
|
|
2537
2655
|
const children = elm.children;
|
|
@@ -2550,21 +2668,21 @@ var serverSideConnected = (elm) => {
|
|
|
2550
2668
|
var getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
|
|
2551
2669
|
var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
2552
2670
|
const hostRef = getHostRef(ref);
|
|
2553
|
-
if (
|
|
2671
|
+
if (import_app_data14.BUILD.lazyLoad && !hostRef) {
|
|
2554
2672
|
throw new Error(
|
|
2555
2673
|
`Couldn't find host element for "${cmpMeta.$tagName$}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/ionic-team/stencil/issues/5457).`
|
|
2556
2674
|
);
|
|
2557
2675
|
}
|
|
2558
|
-
const elm =
|
|
2676
|
+
const elm = import_app_data14.BUILD.lazyLoad ? hostRef.$hostElement$ : ref;
|
|
2559
2677
|
const oldVal = hostRef.$instanceValues$.get(propName);
|
|
2560
2678
|
const flags = hostRef.$flags$;
|
|
2561
|
-
const instance =
|
|
2679
|
+
const instance = import_app_data14.BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
2562
2680
|
newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
|
|
2563
2681
|
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
2564
2682
|
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
2565
|
-
if ((!
|
|
2683
|
+
if ((!import_app_data14.BUILD.lazyLoad || !(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
|
|
2566
2684
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
2567
|
-
if (
|
|
2685
|
+
if (import_app_data14.BUILD.isDev) {
|
|
2568
2686
|
if (hostRef.$flags$ & 1024 /* devOnRender */) {
|
|
2569
2687
|
consoleDevWarn(
|
|
2570
2688
|
`The state/prop "${propName}" changed during rendering. This can potentially lead to infinite-loops and other bugs.`,
|
|
@@ -2587,8 +2705,8 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
2587
2705
|
);
|
|
2588
2706
|
}
|
|
2589
2707
|
}
|
|
2590
|
-
if (!
|
|
2591
|
-
if (
|
|
2708
|
+
if (!import_app_data14.BUILD.lazyLoad || instance) {
|
|
2709
|
+
if (import_app_data14.BUILD.watchCallback && cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
|
|
2592
2710
|
const watchMethods = cmpMeta.$watchers$[propName];
|
|
2593
2711
|
if (watchMethods) {
|
|
2594
2712
|
watchMethods.map((watchMethodName) => {
|
|
@@ -2600,8 +2718,8 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
2600
2718
|
});
|
|
2601
2719
|
}
|
|
2602
2720
|
}
|
|
2603
|
-
if (
|
|
2604
|
-
if (
|
|
2721
|
+
if (import_app_data14.BUILD.updatable && (flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
2722
|
+
if (import_app_data14.BUILD.cmpShouldUpdate && instance.componentShouldUpdate) {
|
|
2605
2723
|
if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
|
|
2606
2724
|
return;
|
|
2607
2725
|
}
|
|
@@ -2616,40 +2734,40 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
2616
2734
|
var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
2617
2735
|
var _a, _b;
|
|
2618
2736
|
const prototype = Cstr.prototype;
|
|
2619
|
-
if (
|
|
2737
|
+
if (import_app_data15.BUILD.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */ && flags & 1 /* isElementConstructor */) {
|
|
2620
2738
|
FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS.forEach((cbName) => {
|
|
2621
2739
|
const originalFormAssociatedCallback = prototype[cbName];
|
|
2622
2740
|
Object.defineProperty(prototype, cbName, {
|
|
2623
2741
|
value(...args) {
|
|
2624
2742
|
const hostRef = getHostRef(this);
|
|
2625
|
-
const instance =
|
|
2743
|
+
const instance = import_app_data15.BUILD.lazyLoad ? hostRef.$lazyInstance$ : this;
|
|
2626
2744
|
if (!instance) {
|
|
2627
2745
|
hostRef.$onReadyPromise$.then((asyncInstance) => {
|
|
2628
2746
|
const cb = asyncInstance[cbName];
|
|
2629
2747
|
typeof cb === "function" && cb.call(asyncInstance, ...args);
|
|
2630
2748
|
});
|
|
2631
2749
|
} else {
|
|
2632
|
-
const cb =
|
|
2750
|
+
const cb = import_app_data15.BUILD.lazyLoad ? instance[cbName] : originalFormAssociatedCallback;
|
|
2633
2751
|
typeof cb === "function" && cb.call(instance, ...args);
|
|
2634
2752
|
}
|
|
2635
2753
|
}
|
|
2636
2754
|
});
|
|
2637
2755
|
});
|
|
2638
2756
|
}
|
|
2639
|
-
if (
|
|
2640
|
-
if (
|
|
2757
|
+
if (import_app_data15.BUILD.member && cmpMeta.$members$ || import_app_data15.BUILD.watchCallback && (cmpMeta.$watchers$ || Cstr.watchers)) {
|
|
2758
|
+
if (import_app_data15.BUILD.watchCallback && Cstr.watchers && !cmpMeta.$watchers$) {
|
|
2641
2759
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
2642
2760
|
}
|
|
2643
2761
|
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
2644
2762
|
members.map(([memberName, [memberFlags]]) => {
|
|
2645
|
-
if ((
|
|
2763
|
+
if ((import_app_data15.BUILD.prop || import_app_data15.BUILD.state) && (memberFlags & 31 /* Prop */ || (!import_app_data15.BUILD.lazyLoad || flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
|
|
2646
2764
|
if ((memberFlags & 2048 /* Getter */) === 0) {
|
|
2647
2765
|
Object.defineProperty(prototype, memberName, {
|
|
2648
2766
|
get() {
|
|
2649
2767
|
return getValue(this, memberName);
|
|
2650
2768
|
},
|
|
2651
2769
|
set(newValue) {
|
|
2652
|
-
if (
|
|
2770
|
+
if (import_app_data15.BUILD.isDev) {
|
|
2653
2771
|
const ref = getHostRef(this);
|
|
2654
2772
|
if (
|
|
2655
2773
|
// we are proxying the instance (not element)
|
|
@@ -2670,11 +2788,11 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
2670
2788
|
enumerable: true
|
|
2671
2789
|
});
|
|
2672
2790
|
} else if (flags & 1 /* isElementConstructor */ && memberFlags & 2048 /* Getter */) {
|
|
2673
|
-
if (
|
|
2791
|
+
if (import_app_data15.BUILD.lazyLoad) {
|
|
2674
2792
|
Object.defineProperty(prototype, memberName, {
|
|
2675
2793
|
get() {
|
|
2676
2794
|
const ref = getHostRef(this);
|
|
2677
|
-
const instance =
|
|
2795
|
+
const instance = import_app_data15.BUILD.lazyLoad && ref ? ref.$lazyInstance$ : prototype;
|
|
2678
2796
|
if (!instance) return;
|
|
2679
2797
|
return instance[memberName];
|
|
2680
2798
|
},
|
|
@@ -2714,7 +2832,7 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
2714
2832
|
});
|
|
2715
2833
|
}
|
|
2716
2834
|
}
|
|
2717
|
-
} else if (
|
|
2835
|
+
} else if (import_app_data15.BUILD.lazyLoad && import_app_data15.BUILD.method && flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) {
|
|
2718
2836
|
Object.defineProperty(prototype, memberName, {
|
|
2719
2837
|
value(...args) {
|
|
2720
2838
|
var _a2;
|
|
@@ -2727,13 +2845,13 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
2727
2845
|
});
|
|
2728
2846
|
}
|
|
2729
2847
|
});
|
|
2730
|
-
if (
|
|
2848
|
+
if (import_app_data15.BUILD.observeAttribute && (!import_app_data15.BUILD.lazyLoad || flags & 1 /* isElementConstructor */)) {
|
|
2731
2849
|
const attrNameToPropName = /* @__PURE__ */ new Map();
|
|
2732
2850
|
prototype.attributeChangedCallback = function(attrName, oldValue, newValue) {
|
|
2733
2851
|
plt.jmp(() => {
|
|
2734
2852
|
var _a2;
|
|
2735
2853
|
const propName = attrNameToPropName.get(attrName);
|
|
2736
|
-
if (this.hasOwnProperty(propName)) {
|
|
2854
|
+
if (this.hasOwnProperty(propName) && import_app_data15.BUILD.lazyLoad) {
|
|
2737
2855
|
newValue = this[propName];
|
|
2738
2856
|
delete this[propName];
|
|
2739
2857
|
} else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
|
|
@@ -2743,8 +2861,8 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
2743
2861
|
const hostRef = getHostRef(this);
|
|
2744
2862
|
const flags2 = hostRef == null ? void 0 : hostRef.$flags$;
|
|
2745
2863
|
if (flags2 && !(flags2 & 8 /* isConstructingInstance */) && flags2 & 128 /* isWatchReady */ && newValue !== oldValue) {
|
|
2746
|
-
const elm =
|
|
2747
|
-
const instance =
|
|
2864
|
+
const elm = import_app_data15.BUILD.lazyLoad ? hostRef.$hostElement$ : this;
|
|
2865
|
+
const instance = import_app_data15.BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
2748
2866
|
const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName];
|
|
2749
2867
|
entry == null ? void 0 : entry.forEach((callbackName) => {
|
|
2750
2868
|
if (instance[callbackName] != null) {
|
|
@@ -2767,7 +2885,7 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
2767
2885
|
var _a2;
|
|
2768
2886
|
const attrName = m[1] || propName;
|
|
2769
2887
|
attrNameToPropName.set(attrName, propName);
|
|
2770
|
-
if (
|
|
2888
|
+
if (import_app_data15.BUILD.reflect && m[0] & 512 /* ReflectAttr */) {
|
|
2771
2889
|
(_a2 = cmpMeta.$attrsToReflect$) == null ? void 0 : _a2.push([propName, attrName]);
|
|
2772
2890
|
}
|
|
2773
2891
|
return attrName;
|
|
@@ -2785,7 +2903,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2785
2903
|
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
2786
2904
|
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
2787
2905
|
const bundleId = cmpMeta.$lazyBundleId$;
|
|
2788
|
-
if ((
|
|
2906
|
+
if ((import_app_data16.BUILD.lazyLoad || import_app_data16.BUILD.hydrateClientSide) && bundleId) {
|
|
2789
2907
|
const CstrImport = loadModule(cmpMeta, hostRef, hmrVersionId);
|
|
2790
2908
|
if (CstrImport && "then" in CstrImport) {
|
|
2791
2909
|
const endLoad = uniqueTime(
|
|
@@ -2800,15 +2918,15 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2800
2918
|
if (!Cstr) {
|
|
2801
2919
|
throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
|
|
2802
2920
|
}
|
|
2803
|
-
if (
|
|
2804
|
-
if (
|
|
2921
|
+
if (import_app_data16.BUILD.member && !Cstr.isProxied) {
|
|
2922
|
+
if (import_app_data16.BUILD.watchCallback) {
|
|
2805
2923
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
2806
2924
|
}
|
|
2807
2925
|
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
|
|
2808
2926
|
Cstr.isProxied = true;
|
|
2809
2927
|
}
|
|
2810
2928
|
const endNewInstance = createTime("createInstance", cmpMeta.$tagName$);
|
|
2811
|
-
if (
|
|
2929
|
+
if (import_app_data16.BUILD.member) {
|
|
2812
2930
|
hostRef.$flags$ |= 8 /* isConstructingInstance */;
|
|
2813
2931
|
}
|
|
2814
2932
|
try {
|
|
@@ -2816,10 +2934,10 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2816
2934
|
} catch (e) {
|
|
2817
2935
|
consoleError(e);
|
|
2818
2936
|
}
|
|
2819
|
-
if (
|
|
2937
|
+
if (import_app_data16.BUILD.member) {
|
|
2820
2938
|
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
2821
2939
|
}
|
|
2822
|
-
if (
|
|
2940
|
+
if (import_app_data16.BUILD.watchCallback) {
|
|
2823
2941
|
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
2824
2942
|
}
|
|
2825
2943
|
endNewInstance();
|
|
@@ -2829,24 +2947,24 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2829
2947
|
const cmpTag = elm.localName;
|
|
2830
2948
|
customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
|
|
2831
2949
|
}
|
|
2832
|
-
if (
|
|
2950
|
+
if (import_app_data16.BUILD.style && Cstr && Cstr.style) {
|
|
2833
2951
|
let style;
|
|
2834
2952
|
if (typeof Cstr.style === "string") {
|
|
2835
2953
|
style = Cstr.style;
|
|
2836
|
-
} else if (
|
|
2954
|
+
} else if (import_app_data16.BUILD.mode && typeof Cstr.style !== "string") {
|
|
2837
2955
|
hostRef.$modeName$ = computeMode(elm);
|
|
2838
2956
|
if (hostRef.$modeName$) {
|
|
2839
2957
|
style = Cstr.style[hostRef.$modeName$];
|
|
2840
2958
|
}
|
|
2841
|
-
if (
|
|
2959
|
+
if (import_app_data16.BUILD.hydrateServerSide && hostRef.$modeName$) {
|
|
2842
2960
|
elm.setAttribute("s-mode", hostRef.$modeName$);
|
|
2843
2961
|
}
|
|
2844
2962
|
}
|
|
2845
2963
|
const scopeId2 = getScopeId(cmpMeta, hostRef.$modeName$);
|
|
2846
2964
|
if (!styles.has(scopeId2)) {
|
|
2847
2965
|
const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
|
|
2848
|
-
if (!
|
|
2849
|
-
|
|
2966
|
+
if (!import_app_data16.BUILD.hydrateServerSide && import_app_data16.BUILD.shadowDom && // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
|
|
2967
|
+
import_app_data16.BUILD.shadowDomShim && cmpMeta.$flags$ & 8 /* needsShadowDomShim */) {
|
|
2850
2968
|
style = await import("../client/shadow-css.js").then((m) => m.scopeCss(style, scopeId2));
|
|
2851
2969
|
}
|
|
2852
2970
|
registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
|
|
@@ -2856,14 +2974,14 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2856
2974
|
}
|
|
2857
2975
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
2858
2976
|
const schedule = () => scheduleUpdate(hostRef, true);
|
|
2859
|
-
if (
|
|
2977
|
+
if (import_app_data16.BUILD.asyncLoading && ancestorComponent && ancestorComponent["s-rc"]) {
|
|
2860
2978
|
ancestorComponent["s-rc"].push(schedule);
|
|
2861
2979
|
} else {
|
|
2862
2980
|
schedule();
|
|
2863
2981
|
}
|
|
2864
2982
|
};
|
|
2865
2983
|
var fireConnectedCallback = (instance) => {
|
|
2866
|
-
if (
|
|
2984
|
+
if (import_app_data16.BUILD.lazyLoad && import_app_data16.BUILD.connectedCallback) {
|
|
2867
2985
|
safeCall(instance, "connectedCallback");
|
|
2868
2986
|
}
|
|
2869
2987
|
};
|
|
@@ -2874,41 +2992,41 @@ var connectedCallback = (elm) => {
|
|
|
2874
2992
|
const hostRef = getHostRef(elm);
|
|
2875
2993
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
2876
2994
|
const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
|
|
2877
|
-
if (
|
|
2995
|
+
if (import_app_data17.BUILD.hostListenerTargetParent) {
|
|
2878
2996
|
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, true);
|
|
2879
2997
|
}
|
|
2880
2998
|
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
2881
2999
|
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
2882
3000
|
let hostId;
|
|
2883
|
-
if (
|
|
3001
|
+
if (import_app_data17.BUILD.hydrateClientSide) {
|
|
2884
3002
|
hostId = elm.getAttribute(HYDRATE_ID);
|
|
2885
3003
|
if (hostId) {
|
|
2886
|
-
if (
|
|
2887
|
-
const scopeId2 =
|
|
3004
|
+
if (import_app_data17.BUILD.shadowDom && supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
3005
|
+
const scopeId2 = import_app_data17.BUILD.mode ? addStyle(elm.shadowRoot, cmpMeta, elm.getAttribute("s-mode")) : addStyle(elm.shadowRoot, cmpMeta);
|
|
2888
3006
|
elm.classList.remove(scopeId2 + "-h", scopeId2 + "-s");
|
|
2889
|
-
} else if (
|
|
2890
|
-
const scopeId2 = getScopeId(cmpMeta,
|
|
3007
|
+
} else if (import_app_data17.BUILD.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
3008
|
+
const scopeId2 = getScopeId(cmpMeta, import_app_data17.BUILD.mode ? elm.getAttribute("s-mode") : void 0);
|
|
2891
3009
|
elm["s-sc"] = scopeId2;
|
|
2892
3010
|
}
|
|
2893
3011
|
initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
|
|
2894
3012
|
}
|
|
2895
3013
|
}
|
|
2896
|
-
if (
|
|
2897
|
-
if (
|
|
3014
|
+
if (import_app_data17.BUILD.slotRelocation && !hostId) {
|
|
3015
|
+
if (import_app_data17.BUILD.hydrateServerSide || (import_app_data17.BUILD.slot || import_app_data17.BUILD.shadowDom) && // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
|
|
2898
3016
|
cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
|
|
2899
3017
|
setContentReference(elm);
|
|
2900
3018
|
}
|
|
2901
3019
|
}
|
|
2902
|
-
if (
|
|
3020
|
+
if (import_app_data17.BUILD.asyncLoading) {
|
|
2903
3021
|
let ancestorComponent = elm;
|
|
2904
3022
|
while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
|
|
2905
|
-
if (
|
|
3023
|
+
if (import_app_data17.BUILD.hydrateClientSide && ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
|
|
2906
3024
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
|
|
2907
3025
|
break;
|
|
2908
3026
|
}
|
|
2909
3027
|
}
|
|
2910
3028
|
}
|
|
2911
|
-
if (
|
|
3029
|
+
if (import_app_data17.BUILD.prop && !import_app_data17.BUILD.hydrateServerSide && cmpMeta.$members$) {
|
|
2912
3030
|
Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
|
|
2913
3031
|
if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
|
|
2914
3032
|
const value = elm[memberName];
|
|
@@ -2917,7 +3035,7 @@ var connectedCallback = (elm) => {
|
|
|
2917
3035
|
}
|
|
2918
3036
|
});
|
|
2919
3037
|
}
|
|
2920
|
-
if (
|
|
3038
|
+
if (import_app_data17.BUILD.initializeNextTick) {
|
|
2921
3039
|
nextTick(() => initializeComponent(elm, hostRef, cmpMeta));
|
|
2922
3040
|
} else {
|
|
2923
3041
|
initializeComponent(elm, hostRef, cmpMeta);
|
|
@@ -2935,32 +3053,32 @@ var connectedCallback = (elm) => {
|
|
|
2935
3053
|
};
|
|
2936
3054
|
var setContentReference = (elm) => {
|
|
2937
3055
|
const contentRefElm = elm["s-cr"] = doc.createComment(
|
|
2938
|
-
|
|
3056
|
+
import_app_data17.BUILD.isDebug ? `content-ref (host=${elm.localName})` : ""
|
|
2939
3057
|
);
|
|
2940
3058
|
contentRefElm["s-cn"] = true;
|
|
2941
3059
|
insertBefore(elm, contentRefElm, elm.firstChild);
|
|
2942
3060
|
};
|
|
2943
3061
|
|
|
2944
3062
|
// src/runtime/disconnected-callback.ts
|
|
2945
|
-
var
|
|
3063
|
+
var import_app_data18 = require("@stencil/core/internal/app-data");
|
|
2946
3064
|
var disconnectInstance = (instance) => {
|
|
2947
|
-
if (
|
|
3065
|
+
if (import_app_data18.BUILD.lazyLoad && import_app_data18.BUILD.disconnectedCallback) {
|
|
2948
3066
|
safeCall(instance, "disconnectedCallback");
|
|
2949
3067
|
}
|
|
2950
|
-
if (
|
|
3068
|
+
if (import_app_data18.BUILD.cmpDidUnload) {
|
|
2951
3069
|
safeCall(instance, "componentDidUnload");
|
|
2952
3070
|
}
|
|
2953
3071
|
};
|
|
2954
3072
|
var disconnectedCallback = async (elm) => {
|
|
2955
3073
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
2956
3074
|
const hostRef = getHostRef(elm);
|
|
2957
|
-
if (
|
|
3075
|
+
if (import_app_data18.BUILD.hostListener) {
|
|
2958
3076
|
if (hostRef.$rmListeners$) {
|
|
2959
3077
|
hostRef.$rmListeners$.map((rmListener) => rmListener());
|
|
2960
3078
|
hostRef.$rmListeners$ = void 0;
|
|
2961
3079
|
}
|
|
2962
3080
|
}
|
|
2963
|
-
if (!
|
|
3081
|
+
if (!import_app_data18.BUILD.lazyLoad) {
|
|
2964
3082
|
disconnectInstance(elm);
|
|
2965
3083
|
} else if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
2966
3084
|
disconnectInstance(hostRef.$lazyInstance$);
|
|
@@ -2979,36 +3097,36 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
2979
3097
|
$flags$: compactMeta[0],
|
|
2980
3098
|
$tagName$: compactMeta[1]
|
|
2981
3099
|
};
|
|
2982
|
-
if (
|
|
3100
|
+
if (import_app_data19.BUILD.member) {
|
|
2983
3101
|
cmpMeta.$members$ = compactMeta[2];
|
|
2984
3102
|
}
|
|
2985
|
-
if (
|
|
3103
|
+
if (import_app_data19.BUILD.hostListener) {
|
|
2986
3104
|
cmpMeta.$listeners$ = compactMeta[3];
|
|
2987
3105
|
}
|
|
2988
|
-
if (
|
|
3106
|
+
if (import_app_data19.BUILD.watchCallback) {
|
|
2989
3107
|
cmpMeta.$watchers$ = Cstr.$watchers$;
|
|
2990
3108
|
}
|
|
2991
|
-
if (
|
|
3109
|
+
if (import_app_data19.BUILD.reflect) {
|
|
2992
3110
|
cmpMeta.$attrsToReflect$ = [];
|
|
2993
3111
|
}
|
|
2994
|
-
if (
|
|
3112
|
+
if (import_app_data19.BUILD.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
2995
3113
|
cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
|
|
2996
3114
|
}
|
|
2997
|
-
if (
|
|
2998
|
-
if (
|
|
3115
|
+
if (import_app_data19.BUILD.experimentalSlotFixes) {
|
|
3116
|
+
if (import_app_data19.BUILD.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
2999
3117
|
patchPseudoShadowDom(Cstr.prototype);
|
|
3000
3118
|
}
|
|
3001
3119
|
} else {
|
|
3002
|
-
if (
|
|
3120
|
+
if (import_app_data19.BUILD.slotChildNodesFix) {
|
|
3003
3121
|
patchChildSlotNodes(Cstr.prototype);
|
|
3004
3122
|
}
|
|
3005
|
-
if (
|
|
3123
|
+
if (import_app_data19.BUILD.cloneNodeFix) {
|
|
3006
3124
|
patchCloneNode(Cstr.prototype);
|
|
3007
3125
|
}
|
|
3008
|
-
if (
|
|
3126
|
+
if (import_app_data19.BUILD.appendChildSlotFix) {
|
|
3009
3127
|
patchSlotAppendChild(Cstr.prototype);
|
|
3010
3128
|
}
|
|
3011
|
-
if (
|
|
3129
|
+
if (import_app_data19.BUILD.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
3012
3130
|
patchTextContent(Cstr.prototype);
|
|
3013
3131
|
}
|
|
3014
3132
|
}
|
|
@@ -3026,20 +3144,20 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
3026
3144
|
this.__hasHostListenerAttached = true;
|
|
3027
3145
|
}
|
|
3028
3146
|
connectedCallback(this);
|
|
3029
|
-
if (
|
|
3147
|
+
if (import_app_data19.BUILD.connectedCallback && originalConnectedCallback) {
|
|
3030
3148
|
originalConnectedCallback.call(this);
|
|
3031
3149
|
}
|
|
3032
3150
|
},
|
|
3033
3151
|
disconnectedCallback() {
|
|
3034
3152
|
disconnectedCallback(this);
|
|
3035
|
-
if (
|
|
3153
|
+
if (import_app_data19.BUILD.disconnectedCallback && originalDisconnectedCallback) {
|
|
3036
3154
|
originalDisconnectedCallback.call(this);
|
|
3037
3155
|
}
|
|
3038
3156
|
},
|
|
3039
3157
|
__attachShadow() {
|
|
3040
3158
|
if (supportsShadow) {
|
|
3041
3159
|
if (!this.shadowRoot) {
|
|
3042
|
-
if (
|
|
3160
|
+
if (import_app_data19.BUILD.shadowDelegatesFocus) {
|
|
3043
3161
|
this.attachShadow({
|
|
3044
3162
|
mode: "open",
|
|
3045
3163
|
delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
|
|
@@ -3063,7 +3181,7 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
3063
3181
|
return proxyComponent(Cstr, cmpMeta, 1 /* isElementConstructor */ | 2 /* proxyState */);
|
|
3064
3182
|
};
|
|
3065
3183
|
var forceModeUpdate = (elm) => {
|
|
3066
|
-
if (
|
|
3184
|
+
if (import_app_data19.BUILD.style && import_app_data19.BUILD.mode && !import_app_data19.BUILD.lazyLoad) {
|
|
3067
3185
|
const mode = computeMode(elm);
|
|
3068
3186
|
const hostRef = getHostRef(elm);
|
|
3069
3187
|
if (hostRef.$modeName$ !== mode) {
|
|
@@ -3086,7 +3204,7 @@ var forceModeUpdate = (elm) => {
|
|
|
3086
3204
|
};
|
|
3087
3205
|
|
|
3088
3206
|
// src/runtime/bootstrap-lazy.ts
|
|
3089
|
-
var
|
|
3207
|
+
var import_app_data20 = require("@stencil/core/internal/app-data");
|
|
3090
3208
|
|
|
3091
3209
|
// src/runtime/hmr-component.ts
|
|
3092
3210
|
var hmrStart = (hostElement, cmpMeta, hmrVersionId) => {
|
|
@@ -3098,7 +3216,7 @@ var hmrStart = (hostElement, cmpMeta, hmrVersionId) => {
|
|
|
3098
3216
|
// src/runtime/bootstrap-lazy.ts
|
|
3099
3217
|
var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
3100
3218
|
var _a;
|
|
3101
|
-
if (
|
|
3219
|
+
if (import_app_data20.BUILD.profile && performance.mark) {
|
|
3102
3220
|
performance.mark("st:app:start");
|
|
3103
3221
|
}
|
|
3104
3222
|
installDevTools();
|
|
@@ -3114,12 +3232,12 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3114
3232
|
let isBootstrapping = true;
|
|
3115
3233
|
Object.assign(plt, options);
|
|
3116
3234
|
plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", doc.baseURI).href;
|
|
3117
|
-
if (
|
|
3235
|
+
if (import_app_data20.BUILD.asyncQueue) {
|
|
3118
3236
|
if (options.syncQueue) {
|
|
3119
3237
|
plt.$flags$ |= 4 /* queueSync */;
|
|
3120
3238
|
}
|
|
3121
3239
|
}
|
|
3122
|
-
if (
|
|
3240
|
+
if (import_app_data20.BUILD.hydrateClientSide) {
|
|
3123
3241
|
plt.$flags$ |= 2 /* appLoaded */;
|
|
3124
3242
|
}
|
|
3125
3243
|
let hasSlotRelocation = false;
|
|
@@ -3135,22 +3253,22 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3135
3253
|
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
|
|
3136
3254
|
hasSlotRelocation = true;
|
|
3137
3255
|
}
|
|
3138
|
-
if (
|
|
3256
|
+
if (import_app_data20.BUILD.member) {
|
|
3139
3257
|
cmpMeta.$members$ = compactMeta[2];
|
|
3140
3258
|
}
|
|
3141
|
-
if (
|
|
3259
|
+
if (import_app_data20.BUILD.hostListener) {
|
|
3142
3260
|
cmpMeta.$listeners$ = compactMeta[3];
|
|
3143
3261
|
}
|
|
3144
|
-
if (
|
|
3262
|
+
if (import_app_data20.BUILD.reflect) {
|
|
3145
3263
|
cmpMeta.$attrsToReflect$ = [];
|
|
3146
3264
|
}
|
|
3147
|
-
if (
|
|
3265
|
+
if (import_app_data20.BUILD.watchCallback) {
|
|
3148
3266
|
cmpMeta.$watchers$ = (_a2 = compactMeta[4]) != null ? _a2 : {};
|
|
3149
3267
|
}
|
|
3150
|
-
if (
|
|
3268
|
+
if (import_app_data20.BUILD.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
3151
3269
|
cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
|
|
3152
3270
|
}
|
|
3153
|
-
const tagName =
|
|
3271
|
+
const tagName = import_app_data20.BUILD.transformTagName && options.transformTagName ? options.transformTagName(cmpMeta.$tagName$) : cmpMeta.$tagName$;
|
|
3154
3272
|
const HostElement = class extends HTMLElement {
|
|
3155
3273
|
// StencilLazyHost
|
|
3156
3274
|
constructor(self) {
|
|
@@ -3158,10 +3276,10 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3158
3276
|
this.hasRegisteredEventListeners = false;
|
|
3159
3277
|
self = this;
|
|
3160
3278
|
registerHost(self, cmpMeta);
|
|
3161
|
-
if (
|
|
3279
|
+
if (import_app_data20.BUILD.shadowDom && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
3162
3280
|
if (supportsShadow) {
|
|
3163
3281
|
if (!self.shadowRoot) {
|
|
3164
|
-
if (
|
|
3282
|
+
if (import_app_data20.BUILD.shadowDelegatesFocus) {
|
|
3165
3283
|
self.attachShadow({
|
|
3166
3284
|
mode: "open",
|
|
3167
3285
|
delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
|
|
@@ -3176,7 +3294,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3176
3294
|
);
|
|
3177
3295
|
}
|
|
3178
3296
|
}
|
|
3179
|
-
} else if (!
|
|
3297
|
+
} else if (!import_app_data20.BUILD.hydrateServerSide && !("shadowRoot" in self)) {
|
|
3180
3298
|
self.shadowRoot = self;
|
|
3181
3299
|
}
|
|
3182
3300
|
}
|
|
@@ -3204,28 +3322,28 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3204
3322
|
return getHostRef(this).$onReadyPromise$;
|
|
3205
3323
|
}
|
|
3206
3324
|
};
|
|
3207
|
-
if (
|
|
3208
|
-
if (
|
|
3325
|
+
if (import_app_data20.BUILD.experimentalSlotFixes) {
|
|
3326
|
+
if (import_app_data20.BUILD.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
3209
3327
|
patchPseudoShadowDom(HostElement.prototype);
|
|
3210
3328
|
}
|
|
3211
3329
|
} else {
|
|
3212
|
-
if (
|
|
3330
|
+
if (import_app_data20.BUILD.slotChildNodesFix) {
|
|
3213
3331
|
patchChildSlotNodes(HostElement.prototype);
|
|
3214
3332
|
}
|
|
3215
|
-
if (
|
|
3333
|
+
if (import_app_data20.BUILD.cloneNodeFix) {
|
|
3216
3334
|
patchCloneNode(HostElement.prototype);
|
|
3217
3335
|
}
|
|
3218
|
-
if (
|
|
3336
|
+
if (import_app_data20.BUILD.appendChildSlotFix) {
|
|
3219
3337
|
patchSlotAppendChild(HostElement.prototype);
|
|
3220
3338
|
}
|
|
3221
|
-
if (
|
|
3339
|
+
if (import_app_data20.BUILD.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
3222
3340
|
patchTextContent(HostElement.prototype);
|
|
3223
3341
|
}
|
|
3224
3342
|
}
|
|
3225
|
-
if (
|
|
3343
|
+
if (import_app_data20.BUILD.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */) {
|
|
3226
3344
|
HostElement.formAssociated = true;
|
|
3227
3345
|
}
|
|
3228
|
-
if (
|
|
3346
|
+
if (import_app_data20.BUILD.hotModuleReplacement) {
|
|
3229
3347
|
HostElement.prototype["s-hmr"] = function(hmrVersionId) {
|
|
3230
3348
|
hmrStart(this, cmpMeta, hmrVersionId);
|
|
3231
3349
|
};
|
|
@@ -3244,7 +3362,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3244
3362
|
if (hasSlotRelocation) {
|
|
3245
3363
|
dataStyles.textContent += SLOT_FB_CSS;
|
|
3246
3364
|
}
|
|
3247
|
-
if (
|
|
3365
|
+
if (import_app_data20.BUILD.invisiblePrehydration && (import_app_data20.BUILD.hydratedClass || import_app_data20.BUILD.hydratedAttribute)) {
|
|
3248
3366
|
dataStyles.textContent += cmpTags.sort() + HYDRATED_CSS;
|
|
3249
3367
|
}
|
|
3250
3368
|
if (dataStyles.innerHTML.length) {
|
|
@@ -3260,7 +3378,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3260
3378
|
if (deferredConnectedCallbacks.length) {
|
|
3261
3379
|
deferredConnectedCallbacks.map((host) => host.connectedCallback());
|
|
3262
3380
|
} else {
|
|
3263
|
-
if (
|
|
3381
|
+
if (import_app_data20.BUILD.profile) {
|
|
3264
3382
|
plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30, "timeout"));
|
|
3265
3383
|
} else {
|
|
3266
3384
|
plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30));
|
|
@@ -3273,10 +3391,10 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3273
3391
|
var Fragment = (_, children) => children;
|
|
3274
3392
|
|
|
3275
3393
|
// src/runtime/host-listener.ts
|
|
3276
|
-
var
|
|
3394
|
+
var import_app_data21 = require("@stencil/core/internal/app-data");
|
|
3277
3395
|
var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
3278
|
-
if (
|
|
3279
|
-
if (
|
|
3396
|
+
if (import_app_data21.BUILD.hostListener && listeners) {
|
|
3397
|
+
if (import_app_data21.BUILD.hostListenerTargetParent) {
|
|
3280
3398
|
if (attachParentListeners) {
|
|
3281
3399
|
listeners = listeners.filter(([flags]) => flags & 32 /* TargetParent */);
|
|
3282
3400
|
} else {
|
|
@@ -3284,7 +3402,7 @@ var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) =>
|
|
|
3284
3402
|
}
|
|
3285
3403
|
}
|
|
3286
3404
|
listeners.map(([flags, name, method]) => {
|
|
3287
|
-
const target =
|
|
3405
|
+
const target = import_app_data21.BUILD.hostListenerTarget ? getHostListenerTarget(elm, flags) : elm;
|
|
3288
3406
|
const handler = hostListenerProxy(hostRef, method);
|
|
3289
3407
|
const opts = hostListenerOpts(flags);
|
|
3290
3408
|
plt.ael(target, name, handler, opts);
|
|
@@ -3295,7 +3413,7 @@ var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) =>
|
|
|
3295
3413
|
var hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
3296
3414
|
var _a;
|
|
3297
3415
|
try {
|
|
3298
|
-
if (
|
|
3416
|
+
if (import_app_data21.BUILD.lazyLoad) {
|
|
3299
3417
|
if (hostRef.$flags$ & 256 /* isListenReady */) {
|
|
3300
3418
|
(_a = hostRef.$lazyInstance$) == null ? void 0 : _a[methodName](ev);
|
|
3301
3419
|
} else {
|
|
@@ -3309,10 +3427,10 @@ var hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
|
3309
3427
|
}
|
|
3310
3428
|
};
|
|
3311
3429
|
var getHostListenerTarget = (elm, flags) => {
|
|
3312
|
-
if (
|
|
3313
|
-
if (
|
|
3314
|
-
if (
|
|
3315
|
-
if (
|
|
3430
|
+
if (import_app_data21.BUILD.hostListenerTargetDocument && flags & 4 /* TargetDocument */) return doc;
|
|
3431
|
+
if (import_app_data21.BUILD.hostListenerTargetWindow && flags & 8 /* TargetWindow */) return win;
|
|
3432
|
+
if (import_app_data21.BUILD.hostListenerTargetBody && flags & 16 /* TargetBody */) return doc.body;
|
|
3433
|
+
if (import_app_data21.BUILD.hostListenerTargetParent && flags & 32 /* TargetParent */ && elm.parentElement)
|
|
3316
3434
|
return elm.parentElement;
|
|
3317
3435
|
return elm;
|
|
3318
3436
|
};
|