@stencil/core 4.24.0 → 4.25.0-dev.1737694903.66340b2
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 +5 -6
- 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 +361 -346
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +1 -1
- package/internal/hydrate/index.js +371 -326
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/runner.js +102 -33
- package/internal/package.json +1 -1
- package/internal/testing/index.js +30 -25
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +67 -3
- package/mock-doc/index.d.ts +9 -0
- package/mock-doc/index.js +67 -3
- 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/autoprefixer.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 -2
- package/testing/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Stencil Hydrate Platform v4.
|
|
2
|
+
Stencil Hydrate Platform v4.25.0-dev.1737694903.66340b2 | MIT Licensed | https://stenciljs.com
|
|
3
3
|
*/
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __export = (target, all) => {
|
|
@@ -8,7 +8,38 @@ var __export = (target, all) => {
|
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
// src/hydrate/platform/index.ts
|
|
11
|
-
import { BUILD as
|
|
11
|
+
import { BUILD as BUILD24 } from "@stencil/core/internal/app-data";
|
|
12
|
+
|
|
13
|
+
// src/utils/es2022-rewire-class-members.ts
|
|
14
|
+
import { BUILD } from "@stencil/core/internal/app-data";
|
|
15
|
+
|
|
16
|
+
// src/utils/constants.ts
|
|
17
|
+
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
18
|
+
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
19
|
+
|
|
20
|
+
// src/utils/es2022-rewire-class-members.ts
|
|
21
|
+
var reWireGetterSetter = (instance, hostRef) => {
|
|
22
|
+
var _a;
|
|
23
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
24
|
+
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
25
|
+
members.map(([memberName, [memberFlags]]) => {
|
|
26
|
+
if ((BUILD.state || BUILD.prop) && (memberFlags & 31 /* Prop */ || memberFlags & 32 /* State */)) {
|
|
27
|
+
const ogValue = instance[memberName];
|
|
28
|
+
const ogDescriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(instance), memberName);
|
|
29
|
+
Object.defineProperty(instance, memberName, {
|
|
30
|
+
get() {
|
|
31
|
+
return ogDescriptor.get.call(this);
|
|
32
|
+
},
|
|
33
|
+
set(newValue) {
|
|
34
|
+
ogDescriptor.set.call(this, newValue);
|
|
35
|
+
},
|
|
36
|
+
configurable: true,
|
|
37
|
+
enumerable: true
|
|
38
|
+
});
|
|
39
|
+
instance[memberName] = hostRef.$instanceValues$.has(memberName) ? hostRef.$instanceValues$.get(memberName) : ogValue;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
};
|
|
12
43
|
|
|
13
44
|
// src/runtime/asset-path.ts
|
|
14
45
|
var getAssetPath = (path) => {
|
|
@@ -18,11 +49,7 @@ var getAssetPath = (path) => {
|
|
|
18
49
|
var setAssetPath = (path) => plt.$resourcesUrl$ = path;
|
|
19
50
|
|
|
20
51
|
// src/runtime/bootstrap-custom-element.ts
|
|
21
|
-
import { BUILD as
|
|
22
|
-
|
|
23
|
-
// src/utils/constants.ts
|
|
24
|
-
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
25
|
-
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
52
|
+
import { BUILD as BUILD20 } from "@stencil/core/internal/app-data";
|
|
26
53
|
|
|
27
54
|
// src/utils/helpers.ts
|
|
28
55
|
var isDef = (v) => v != null && v !== void 0;
|
|
@@ -87,16 +114,16 @@ var unwrapErr = (result) => {
|
|
|
87
114
|
};
|
|
88
115
|
|
|
89
116
|
// src/runtime/connected-callback.ts
|
|
90
|
-
import { BUILD as
|
|
117
|
+
import { BUILD as BUILD18 } from "@stencil/core/internal/app-data";
|
|
91
118
|
|
|
92
119
|
// src/runtime/client-hydrate.ts
|
|
93
|
-
import { BUILD as
|
|
120
|
+
import { BUILD as BUILD6 } from "@stencil/core/internal/app-data";
|
|
94
121
|
|
|
95
122
|
// src/runtime/dom-extras.ts
|
|
96
|
-
import { BUILD as
|
|
123
|
+
import { BUILD as BUILD3 } from "@stencil/core/internal/app-data";
|
|
97
124
|
|
|
98
125
|
// src/runtime/slot-polyfill-utils.ts
|
|
99
|
-
import { BUILD } from "@stencil/core/internal/app-data";
|
|
126
|
+
import { BUILD as BUILD2 } from "@stencil/core/internal/app-data";
|
|
100
127
|
|
|
101
128
|
// src/runtime/runtime-constants.ts
|
|
102
129
|
var CONTENT_REF_ID = "r";
|
|
@@ -203,7 +230,7 @@ var addSlotRelocateNode = (newChild, slotNode, prepend, position) => {
|
|
|
203
230
|
const parent = slotNode["s-cr"].parentNode;
|
|
204
231
|
const appendMethod = prepend ? parent.__prepend || parent.prepend : parent.__appendChild || parent.appendChild;
|
|
205
232
|
if (typeof position !== "undefined") {
|
|
206
|
-
if (
|
|
233
|
+
if (BUILD2.hydrateClientSide) {
|
|
207
234
|
slottedNodeLocation["s-oo"] = position;
|
|
208
235
|
const childNodes = parent.__childNodes || parent.childNodes;
|
|
209
236
|
const slotRelocateNodes = [slottedNodeLocation];
|
|
@@ -243,9 +270,9 @@ var patchCloneNode = (HostElementPrototype) => {
|
|
|
243
270
|
const orgCloneNode = HostElementPrototype.cloneNode;
|
|
244
271
|
HostElementPrototype.cloneNode = function(deep) {
|
|
245
272
|
const srcNode = this;
|
|
246
|
-
const isShadowDom =
|
|
273
|
+
const isShadowDom = BUILD3.shadowDom ? srcNode.shadowRoot && supportsShadow : false;
|
|
247
274
|
const clonedNode = orgCloneNode.call(srcNode, isShadowDom ? deep : false);
|
|
248
|
-
if (
|
|
275
|
+
if (BUILD3.slot && !isShadowDom && deep) {
|
|
249
276
|
let i2 = 0;
|
|
250
277
|
let slotted, nonStencilNode;
|
|
251
278
|
const stencilPrivates = [
|
|
@@ -270,7 +297,7 @@ var patchCloneNode = (HostElementPrototype) => {
|
|
|
270
297
|
slotted = childNodes[i2]["s-nr"];
|
|
271
298
|
nonStencilNode = stencilPrivates.every((privateField) => !childNodes[i2][privateField]);
|
|
272
299
|
if (slotted) {
|
|
273
|
-
if (
|
|
300
|
+
if (BUILD3.appendChildSlotFix && clonedNode.__appendChild) {
|
|
274
301
|
clonedNode.__appendChild(slotted.cloneNode(true));
|
|
275
302
|
} else {
|
|
276
303
|
clonedNode.appendChild(slotted.cloneNode(true));
|
|
@@ -606,10 +633,10 @@ function intrnlCall(node, method) {
|
|
|
606
633
|
}
|
|
607
634
|
|
|
608
635
|
// src/runtime/profile.ts
|
|
609
|
-
import { BUILD as
|
|
636
|
+
import { BUILD as BUILD4 } from "@stencil/core/internal/app-data";
|
|
610
637
|
var i = 0;
|
|
611
638
|
var createTime = (fnName, tagName = "") => {
|
|
612
|
-
if (
|
|
639
|
+
if (BUILD4.profile && performance.mark) {
|
|
613
640
|
const key = `st:${fnName}:${tagName}:${i++}`;
|
|
614
641
|
performance.mark(key);
|
|
615
642
|
return () => performance.measure(`[Stencil] ${fnName}() <${tagName}>`, key);
|
|
@@ -620,7 +647,7 @@ var createTime = (fnName, tagName = "") => {
|
|
|
620
647
|
}
|
|
621
648
|
};
|
|
622
649
|
var uniqueTime = (key, measureText) => {
|
|
623
|
-
if (
|
|
650
|
+
if (BUILD4.profile && performance.mark) {
|
|
624
651
|
if (performance.getEntriesByName(key, "mark").length === 0) {
|
|
625
652
|
performance.mark(key);
|
|
626
653
|
}
|
|
@@ -678,7 +705,7 @@ var inspect = (ref) => {
|
|
|
678
705
|
};
|
|
679
706
|
};
|
|
680
707
|
var installDevTools = () => {
|
|
681
|
-
if (
|
|
708
|
+
if (BUILD4.devTools) {
|
|
682
709
|
const stencil = win.stencil = win.stencil || {};
|
|
683
710
|
const originalInspect = stencil.inspect;
|
|
684
711
|
stencil.inspect = (ref) => {
|
|
@@ -692,7 +719,7 @@ var installDevTools = () => {
|
|
|
692
719
|
};
|
|
693
720
|
|
|
694
721
|
// src/runtime/vdom/h.ts
|
|
695
|
-
import { BUILD as
|
|
722
|
+
import { BUILD as BUILD5 } from "@stencil/core/internal/app-data";
|
|
696
723
|
var h = (nodeName, vnodeData, ...children) => {
|
|
697
724
|
let child = null;
|
|
698
725
|
let key = null;
|
|
@@ -708,7 +735,7 @@ var h = (nodeName, vnodeData, ...children) => {
|
|
|
708
735
|
} else if (child != null && typeof child !== "boolean") {
|
|
709
736
|
if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
|
|
710
737
|
child = String(child);
|
|
711
|
-
} else if (
|
|
738
|
+
} else if (BUILD5.isDev && typeof nodeName !== "function" && child.$flags$ === void 0) {
|
|
712
739
|
consoleDevError(`vNode passed as children has unexpected type.
|
|
713
740
|
Make sure it's using the correct h() function.
|
|
714
741
|
Empty objects can also be the cause, look for JSX comments that became objects.`);
|
|
@@ -724,28 +751,28 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
|
|
|
724
751
|
};
|
|
725
752
|
walk(children);
|
|
726
753
|
if (vnodeData) {
|
|
727
|
-
if (
|
|
754
|
+
if (BUILD5.isDev && nodeName === "input") {
|
|
728
755
|
validateInputProperties(vnodeData);
|
|
729
756
|
}
|
|
730
|
-
if (
|
|
757
|
+
if (BUILD5.vdomKey && vnodeData.key) {
|
|
731
758
|
key = vnodeData.key;
|
|
732
759
|
}
|
|
733
|
-
if (
|
|
760
|
+
if (BUILD5.slotRelocation && vnodeData.name) {
|
|
734
761
|
slotName = vnodeData.name;
|
|
735
762
|
}
|
|
736
|
-
if (
|
|
763
|
+
if (BUILD5.vdomClass) {
|
|
737
764
|
const classData = vnodeData.className || vnodeData.class;
|
|
738
765
|
if (classData) {
|
|
739
766
|
vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
|
|
740
767
|
}
|
|
741
768
|
}
|
|
742
769
|
}
|
|
743
|
-
if (
|
|
770
|
+
if (BUILD5.isDev && vNodeChildren.some(isHost)) {
|
|
744
771
|
consoleDevError(`The <Host> must be the single root component. Make sure:
|
|
745
772
|
- You are NOT using hostData() and <Host> in the same component.
|
|
746
773
|
- <Host> is used once, and it's the single root component of the render() function.`);
|
|
747
774
|
}
|
|
748
|
-
if (
|
|
775
|
+
if (BUILD5.vdomFunctional && typeof nodeName === "function") {
|
|
749
776
|
return nodeName(
|
|
750
777
|
vnodeData === null ? {} : vnodeData,
|
|
751
778
|
vNodeChildren,
|
|
@@ -757,10 +784,10 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
|
|
|
757
784
|
if (vNodeChildren.length > 0) {
|
|
758
785
|
vnode.$children$ = vNodeChildren;
|
|
759
786
|
}
|
|
760
|
-
if (
|
|
787
|
+
if (BUILD5.vdomKey) {
|
|
761
788
|
vnode.$key$ = key;
|
|
762
789
|
}
|
|
763
|
-
if (
|
|
790
|
+
if (BUILD5.slotRelocation) {
|
|
764
791
|
vnode.$name$ = slotName;
|
|
765
792
|
}
|
|
766
793
|
return vnode;
|
|
@@ -773,13 +800,13 @@ var newVNode = (tag, text) => {
|
|
|
773
800
|
$elm$: null,
|
|
774
801
|
$children$: null
|
|
775
802
|
};
|
|
776
|
-
if (
|
|
803
|
+
if (BUILD5.vdomAttribute) {
|
|
777
804
|
vnode.$attrs$ = null;
|
|
778
805
|
}
|
|
779
|
-
if (
|
|
806
|
+
if (BUILD5.vdomKey) {
|
|
780
807
|
vnode.$key$ = null;
|
|
781
808
|
}
|
|
782
|
-
if (
|
|
809
|
+
if (BUILD5.slotRelocation) {
|
|
783
810
|
vnode.$name$ = null;
|
|
784
811
|
}
|
|
785
812
|
return vnode;
|
|
@@ -838,11 +865,11 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
838
865
|
const childRenderNodes = [];
|
|
839
866
|
const slotNodes = [];
|
|
840
867
|
const slottedNodes = [];
|
|
841
|
-
const shadowRootNodes =
|
|
868
|
+
const shadowRootNodes = BUILD6.shadowDom && shadowRoot ? [] : null;
|
|
842
869
|
const vnode = newVNode(tagName, null);
|
|
843
870
|
vnode.$elm$ = hostElm;
|
|
844
871
|
let scopeId2;
|
|
845
|
-
if (
|
|
872
|
+
if (BUILD6.scoped) {
|
|
846
873
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
847
874
|
if (cmpMeta && cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */ && hostElm["s-sc"]) {
|
|
848
875
|
scopeId2 = hostElm["s-sc"];
|
|
@@ -930,7 +957,7 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
930
957
|
slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
|
|
931
958
|
}
|
|
932
959
|
addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"]);
|
|
933
|
-
if (
|
|
960
|
+
if (BUILD6.experimentalSlotFixes) {
|
|
934
961
|
patchSlottedNode(slottedItem.node);
|
|
935
962
|
}
|
|
936
963
|
}
|
|
@@ -939,12 +966,12 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
939
966
|
}
|
|
940
967
|
}
|
|
941
968
|
}
|
|
942
|
-
if (
|
|
969
|
+
if (BUILD6.scoped && scopeId2 && slotNodes.length) {
|
|
943
970
|
slotNodes.forEach((slot) => {
|
|
944
971
|
slot.$elm$.parentElement.classList.add(scopeId2 + "-s");
|
|
945
972
|
});
|
|
946
973
|
}
|
|
947
|
-
if (
|
|
974
|
+
if (BUILD6.shadowDom && shadowRoot) {
|
|
948
975
|
let rnIdex = 0;
|
|
949
976
|
const rnLen = shadowRootNodes.length;
|
|
950
977
|
for (rnIdex; rnIdex < rnLen; rnIdex++) {
|
|
@@ -987,7 +1014,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
987
1014
|
if (!parentVNode.$children$) {
|
|
988
1015
|
parentVNode.$children$ = [];
|
|
989
1016
|
}
|
|
990
|
-
if (
|
|
1017
|
+
if (BUILD6.scoped && scopeId2) {
|
|
991
1018
|
node["s-si"] = scopeId2;
|
|
992
1019
|
childVNode.$attrs$.class += " " + scopeId2;
|
|
993
1020
|
}
|
|
@@ -1005,7 +1032,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
1005
1032
|
shadowRootNodes,
|
|
1006
1033
|
slottedNodes
|
|
1007
1034
|
);
|
|
1008
|
-
if (
|
|
1035
|
+
if (BUILD6.scoped && scopeId2) {
|
|
1009
1036
|
node.classList.add(scopeId2);
|
|
1010
1037
|
}
|
|
1011
1038
|
}
|
|
@@ -1102,9 +1129,9 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
1102
1129
|
slottedNodes
|
|
1103
1130
|
);
|
|
1104
1131
|
} else if (childNodeType === CONTENT_REF_ID) {
|
|
1105
|
-
if (
|
|
1132
|
+
if (BUILD6.shadowDom && shadowRootNodes) {
|
|
1106
1133
|
node.remove();
|
|
1107
|
-
} else if (
|
|
1134
|
+
} else if (BUILD6.slotRelocation) {
|
|
1108
1135
|
hostElm["s-cr"] = node;
|
|
1109
1136
|
node["s-cn"] = true;
|
|
1110
1137
|
}
|
|
@@ -1166,7 +1193,7 @@ function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNod
|
|
|
1166
1193
|
childVNode.$name$ = slotName || null;
|
|
1167
1194
|
childVNode.$tag$ = "slot";
|
|
1168
1195
|
const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
|
|
1169
|
-
if (
|
|
1196
|
+
if (BUILD6.shadowDom && shadowRootNodes) {
|
|
1170
1197
|
const slot = childVNode.$elm$ = doc.createElement(childVNode.$tag$);
|
|
1171
1198
|
if (childVNode.$name$) {
|
|
1172
1199
|
childVNode.$elm$.setAttribute("name", slotName);
|
|
@@ -1207,7 +1234,7 @@ var addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) =>
|
|
|
1207
1234
|
};
|
|
1208
1235
|
|
|
1209
1236
|
// src/runtime/initialize-component.ts
|
|
1210
|
-
import { BUILD as
|
|
1237
|
+
import { BUILD as BUILD17 } from "@stencil/core/internal/app-data";
|
|
1211
1238
|
|
|
1212
1239
|
// src/runtime/mode.ts
|
|
1213
1240
|
var computeMode = (elm) => modeResolutionChain.map((h2) => h2(elm)).find((m) => !!m);
|
|
@@ -1215,22 +1242,22 @@ var setMode = (handler) => modeResolutionChain.push(handler);
|
|
|
1215
1242
|
var getMode = (ref) => getHostRef(ref).$modeName$;
|
|
1216
1243
|
|
|
1217
1244
|
// src/runtime/proxy-component.ts
|
|
1218
|
-
import { BUILD as
|
|
1245
|
+
import { BUILD as BUILD16 } from "@stencil/core/internal/app-data";
|
|
1219
1246
|
|
|
1220
1247
|
// src/runtime/set-value.ts
|
|
1221
|
-
import { BUILD as
|
|
1248
|
+
import { BUILD as BUILD15 } from "@stencil/core/internal/app-data";
|
|
1222
1249
|
|
|
1223
1250
|
// src/runtime/parse-property-value.ts
|
|
1224
|
-
import { BUILD as
|
|
1251
|
+
import { BUILD as BUILD7 } from "@stencil/core/internal/app-data";
|
|
1225
1252
|
var parsePropertyValue = (propValue, propType) => {
|
|
1226
1253
|
if (propValue != null && !isComplexType(propValue)) {
|
|
1227
|
-
if (
|
|
1254
|
+
if (BUILD7.propBoolean && propType & 4 /* Boolean */) {
|
|
1228
1255
|
return propValue === "false" ? false : propValue === "" || !!propValue;
|
|
1229
1256
|
}
|
|
1230
|
-
if (
|
|
1257
|
+
if (BUILD7.propNumber && propType & 2 /* Number */) {
|
|
1231
1258
|
return parseFloat(propValue);
|
|
1232
1259
|
}
|
|
1233
|
-
if (
|
|
1260
|
+
if (BUILD7.propString && propType & 1 /* String */) {
|
|
1234
1261
|
return String(propValue);
|
|
1235
1262
|
}
|
|
1236
1263
|
return propValue;
|
|
@@ -1239,21 +1266,21 @@ var parsePropertyValue = (propValue, propType) => {
|
|
|
1239
1266
|
};
|
|
1240
1267
|
|
|
1241
1268
|
// src/runtime/update-component.ts
|
|
1242
|
-
import { BUILD as
|
|
1269
|
+
import { BUILD as BUILD14, NAMESPACE } from "@stencil/core/internal/app-data";
|
|
1243
1270
|
|
|
1244
1271
|
// src/runtime/event-emitter.ts
|
|
1245
|
-
import { BUILD as
|
|
1272
|
+
import { BUILD as BUILD9 } from "@stencil/core/internal/app-data";
|
|
1246
1273
|
|
|
1247
1274
|
// src/runtime/element.ts
|
|
1248
|
-
import { BUILD as
|
|
1249
|
-
var getElement = (ref) =>
|
|
1275
|
+
import { BUILD as BUILD8 } from "@stencil/core/internal/app-data";
|
|
1276
|
+
var getElement = (ref) => BUILD8.lazyLoad ? getHostRef(ref).$hostElement$ : ref;
|
|
1250
1277
|
|
|
1251
1278
|
// src/runtime/event-emitter.ts
|
|
1252
1279
|
var createEvent = (ref, name, flags) => {
|
|
1253
1280
|
const elm = getElement(ref);
|
|
1254
1281
|
return {
|
|
1255
1282
|
emit: (detail) => {
|
|
1256
|
-
if (
|
|
1283
|
+
if (BUILD9.isDev && !elm.isConnected) {
|
|
1257
1284
|
consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`);
|
|
1258
1285
|
}
|
|
1259
1286
|
return emitEvent(elm, name, {
|
|
@@ -1272,7 +1299,7 @@ var emitEvent = (elm, name, opts) => {
|
|
|
1272
1299
|
};
|
|
1273
1300
|
|
|
1274
1301
|
// src/runtime/styles.ts
|
|
1275
|
-
import { BUILD as
|
|
1302
|
+
import { BUILD as BUILD10 } from "@stencil/core/internal/app-data";
|
|
1276
1303
|
var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
|
|
1277
1304
|
var registerStyle = (scopeId2, cssText, allowCS) => {
|
|
1278
1305
|
let style = styles.get(scopeId2);
|
|
@@ -1292,7 +1319,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
1292
1319
|
var _a;
|
|
1293
1320
|
const scopeId2 = getScopeId(cmpMeta, mode);
|
|
1294
1321
|
const style = styles.get(scopeId2);
|
|
1295
|
-
if (!
|
|
1322
|
+
if (!BUILD10.attachStyles) {
|
|
1296
1323
|
return scopeId2;
|
|
1297
1324
|
}
|
|
1298
1325
|
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
|
|
@@ -1305,7 +1332,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
1305
1332
|
rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
|
|
1306
1333
|
}
|
|
1307
1334
|
if (!appliedStyles.has(scopeId2)) {
|
|
1308
|
-
if (
|
|
1335
|
+
if (BUILD10.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
|
|
1309
1336
|
styleElm.innerHTML = style;
|
|
1310
1337
|
} else {
|
|
1311
1338
|
styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || doc.createElement("style");
|
|
@@ -1314,7 +1341,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
1314
1341
|
if (nonce != null) {
|
|
1315
1342
|
styleElm.setAttribute("nonce", nonce);
|
|
1316
1343
|
}
|
|
1317
|
-
if ((
|
|
1344
|
+
if ((BUILD10.hydrateServerSide || BUILD10.hotModuleReplacement) && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
1318
1345
|
styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
|
|
1319
1346
|
}
|
|
1320
1347
|
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
|
|
@@ -1350,7 +1377,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
1350
1377
|
appliedStyles.add(scopeId2);
|
|
1351
1378
|
}
|
|
1352
1379
|
}
|
|
1353
|
-
} else if (
|
|
1380
|
+
} else if (BUILD10.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
1354
1381
|
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
1355
1382
|
}
|
|
1356
1383
|
}
|
|
@@ -1362,31 +1389,31 @@ var attachStyles = (hostRef) => {
|
|
|
1362
1389
|
const flags = cmpMeta.$flags$;
|
|
1363
1390
|
const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
|
|
1364
1391
|
const scopeId2 = addStyle(
|
|
1365
|
-
|
|
1392
|
+
BUILD10.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
|
|
1366
1393
|
cmpMeta,
|
|
1367
1394
|
hostRef.$modeName$
|
|
1368
1395
|
);
|
|
1369
|
-
if ((
|
|
1396
|
+
if ((BUILD10.shadowDom || BUILD10.scoped) && BUILD10.cssAnnotations && flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) {
|
|
1370
1397
|
elm["s-sc"] = scopeId2;
|
|
1371
1398
|
elm.classList.add(scopeId2 + "-h");
|
|
1372
1399
|
}
|
|
1373
1400
|
endAttachStyles();
|
|
1374
1401
|
};
|
|
1375
|
-
var getScopeId = (cmp, mode) => "sc-" + (
|
|
1402
|
+
var getScopeId = (cmp, mode) => "sc-" + (BUILD10.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
|
|
1376
1403
|
|
|
1377
1404
|
// src/runtime/vdom/vdom-render.ts
|
|
1378
|
-
import { BUILD as
|
|
1405
|
+
import { BUILD as BUILD13 } from "@stencil/core/internal/app-data";
|
|
1379
1406
|
|
|
1380
1407
|
// src/runtime/vdom/update-element.ts
|
|
1381
|
-
import { BUILD as
|
|
1408
|
+
import { BUILD as BUILD12 } from "@stencil/core/internal/app-data";
|
|
1382
1409
|
|
|
1383
1410
|
// src/runtime/vdom/set-accessor.ts
|
|
1384
|
-
import { BUILD as
|
|
1411
|
+
import { BUILD as BUILD11 } from "@stencil/core/internal/app-data";
|
|
1385
1412
|
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
1386
1413
|
if (oldValue !== newValue) {
|
|
1387
1414
|
let isProp = isMemberInElement(elm, memberName);
|
|
1388
1415
|
let ln = memberName.toLowerCase();
|
|
1389
|
-
if (
|
|
1416
|
+
if (BUILD11.vdomClass && memberName === "class") {
|
|
1390
1417
|
const classList = elm.classList;
|
|
1391
1418
|
const oldClasses = parseClassList(oldValue);
|
|
1392
1419
|
let newClasses = parseClassList(newValue);
|
|
@@ -1402,11 +1429,11 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
1402
1429
|
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
1403
1430
|
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
1404
1431
|
}
|
|
1405
|
-
} else if (
|
|
1406
|
-
if (
|
|
1432
|
+
} else if (BUILD11.vdomStyle && memberName === "style") {
|
|
1433
|
+
if (BUILD11.updatable) {
|
|
1407
1434
|
for (const prop in oldValue) {
|
|
1408
1435
|
if (!newValue || newValue[prop] == null) {
|
|
1409
|
-
if (!
|
|
1436
|
+
if (!BUILD11.hydrateServerSide && prop.includes("-")) {
|
|
1410
1437
|
elm.style.removeProperty(prop);
|
|
1411
1438
|
} else {
|
|
1412
1439
|
elm.style[prop] = "";
|
|
@@ -1416,19 +1443,19 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
1416
1443
|
}
|
|
1417
1444
|
for (const prop in newValue) {
|
|
1418
1445
|
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
1419
|
-
if (!
|
|
1446
|
+
if (!BUILD11.hydrateServerSide && prop.includes("-")) {
|
|
1420
1447
|
elm.style.setProperty(prop, newValue[prop]);
|
|
1421
1448
|
} else {
|
|
1422
1449
|
elm.style[prop] = newValue[prop];
|
|
1423
1450
|
}
|
|
1424
1451
|
}
|
|
1425
1452
|
}
|
|
1426
|
-
} else if (
|
|
1427
|
-
} else if (
|
|
1453
|
+
} else if (BUILD11.vdomKey && memberName === "key") {
|
|
1454
|
+
} else if (BUILD11.vdomRef && memberName === "ref") {
|
|
1428
1455
|
if (newValue) {
|
|
1429
1456
|
newValue(elm);
|
|
1430
1457
|
}
|
|
1431
|
-
} else if (
|
|
1458
|
+
} else if (BUILD11.vdomListener && (BUILD11.lazyLoad ? !isProp : !elm.__lookupSetter__(memberName)) && memberName[0] === "o" && memberName[1] === "n") {
|
|
1432
1459
|
if (memberName[2] === "-") {
|
|
1433
1460
|
memberName = memberName.slice(3);
|
|
1434
1461
|
} else if (isMemberInElement(win, ln)) {
|
|
@@ -1446,7 +1473,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
1446
1473
|
plt.ael(elm, memberName, newValue, capture);
|
|
1447
1474
|
}
|
|
1448
1475
|
}
|
|
1449
|
-
} else if (
|
|
1476
|
+
} else if (BUILD11.vdomPropOrAttr) {
|
|
1450
1477
|
const isComplex = isComplexType(newValue);
|
|
1451
1478
|
if ((isProp || isComplex && newValue !== null) && !isSvg) {
|
|
1452
1479
|
try {
|
|
@@ -1468,7 +1495,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
1468
1495
|
}
|
|
1469
1496
|
}
|
|
1470
1497
|
let xlink = false;
|
|
1471
|
-
if (
|
|
1498
|
+
if (BUILD11.vdomXlink) {
|
|
1472
1499
|
if (ln !== (ln = ln.replace(/^xlink\:?/, ""))) {
|
|
1473
1500
|
memberName = ln;
|
|
1474
1501
|
xlink = true;
|
|
@@ -1476,7 +1503,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
1476
1503
|
}
|
|
1477
1504
|
if (newValue == null || newValue === false) {
|
|
1478
1505
|
if (newValue !== false || elm.getAttribute(memberName) === "") {
|
|
1479
|
-
if (
|
|
1506
|
+
if (BUILD11.vdomXlink && xlink) {
|
|
1480
1507
|
elm.removeAttributeNS(XLINK_NS, memberName);
|
|
1481
1508
|
} else {
|
|
1482
1509
|
elm.removeAttribute(memberName);
|
|
@@ -1484,7 +1511,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
1484
1511
|
}
|
|
1485
1512
|
} else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
|
|
1486
1513
|
newValue = newValue === true ? "" : newValue;
|
|
1487
|
-
if (
|
|
1514
|
+
if (BUILD11.vdomXlink && xlink) {
|
|
1488
1515
|
elm.setAttributeNS(XLINK_NS, memberName, newValue);
|
|
1489
1516
|
} else {
|
|
1490
1517
|
elm.setAttribute(memberName, newValue);
|
|
@@ -1511,7 +1538,7 @@ var updateElement = (oldVnode, newVnode, isSvgMode2) => {
|
|
|
1511
1538
|
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
|
|
1512
1539
|
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
|
|
1513
1540
|
const newVnodeAttrs = newVnode.$attrs$ || {};
|
|
1514
|
-
if (
|
|
1541
|
+
if (BUILD12.updatable) {
|
|
1515
1542
|
for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
|
|
1516
1543
|
if (!(memberName in newVnodeAttrs)) {
|
|
1517
1544
|
setAccessor(elm, memberName, oldVnodeAttrs[memberName], void 0, isSvgMode2, newVnode.$flags$);
|
|
@@ -1547,7 +1574,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
1547
1574
|
let elm;
|
|
1548
1575
|
let childNode;
|
|
1549
1576
|
let oldVNode;
|
|
1550
|
-
if (
|
|
1577
|
+
if (BUILD13.slotRelocation && !useNativeShadowDom) {
|
|
1551
1578
|
checkSlotRelocate = true;
|
|
1552
1579
|
if (newVNode2.$tag$ === "slot") {
|
|
1553
1580
|
newVNode2.$flags$ |= newVNode2.$children$ ? (
|
|
@@ -1562,32 +1589,32 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
1562
1589
|
);
|
|
1563
1590
|
}
|
|
1564
1591
|
}
|
|
1565
|
-
if (
|
|
1592
|
+
if (BUILD13.isDev && newVNode2.$elm$) {
|
|
1566
1593
|
consoleDevError(
|
|
1567
1594
|
`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`
|
|
1568
1595
|
);
|
|
1569
1596
|
}
|
|
1570
|
-
if (
|
|
1597
|
+
if (BUILD13.vdomText && newVNode2.$text$ !== null) {
|
|
1571
1598
|
elm = newVNode2.$elm$ = doc.createTextNode(newVNode2.$text$);
|
|
1572
|
-
} else if (
|
|
1573
|
-
elm = newVNode2.$elm$ =
|
|
1599
|
+
} else if (BUILD13.slotRelocation && newVNode2.$flags$ & 1 /* isSlotReference */) {
|
|
1600
|
+
elm = newVNode2.$elm$ = BUILD13.isDebug || BUILD13.hydrateServerSide ? slotReferenceDebugNode(newVNode2) : doc.createTextNode("");
|
|
1574
1601
|
} else {
|
|
1575
|
-
if (
|
|
1602
|
+
if (BUILD13.svg && !isSvgMode) {
|
|
1576
1603
|
isSvgMode = newVNode2.$tag$ === "svg";
|
|
1577
1604
|
}
|
|
1578
|
-
elm = newVNode2.$elm$ =
|
|
1605
|
+
elm = newVNode2.$elm$ = BUILD13.svg ? doc.createElementNS(
|
|
1579
1606
|
isSvgMode ? SVG_NS : HTML_NS,
|
|
1580
|
-
!useNativeShadowDom &&
|
|
1607
|
+
!useNativeShadowDom && BUILD13.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
|
|
1581
1608
|
) : doc.createElement(
|
|
1582
|
-
!useNativeShadowDom &&
|
|
1609
|
+
!useNativeShadowDom && BUILD13.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
|
|
1583
1610
|
);
|
|
1584
|
-
if (
|
|
1611
|
+
if (BUILD13.svg && isSvgMode && newVNode2.$tag$ === "foreignObject") {
|
|
1585
1612
|
isSvgMode = false;
|
|
1586
1613
|
}
|
|
1587
|
-
if (
|
|
1614
|
+
if (BUILD13.vdomAttribute) {
|
|
1588
1615
|
updateElement(null, newVNode2, isSvgMode);
|
|
1589
1616
|
}
|
|
1590
|
-
if (
|
|
1617
|
+
if (BUILD13.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
|
|
1591
1618
|
elm.classList.add(elm["s-si"] = scopeId);
|
|
1592
1619
|
}
|
|
1593
1620
|
if (newVNode2.$children$) {
|
|
@@ -1598,7 +1625,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
1598
1625
|
}
|
|
1599
1626
|
}
|
|
1600
1627
|
}
|
|
1601
|
-
if (
|
|
1628
|
+
if (BUILD13.svg) {
|
|
1602
1629
|
if (newVNode2.$tag$ === "svg") {
|
|
1603
1630
|
isSvgMode = false;
|
|
1604
1631
|
} else if (elm.tagName === "foreignObject") {
|
|
@@ -1607,7 +1634,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
1607
1634
|
}
|
|
1608
1635
|
}
|
|
1609
1636
|
elm["s-hn"] = hostTagName;
|
|
1610
|
-
if (
|
|
1637
|
+
if (BUILD13.slotRelocation) {
|
|
1611
1638
|
if (newVNode2.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
|
|
1612
1639
|
elm["s-sr"] = true;
|
|
1613
1640
|
elm["s-cr"] = contentRef;
|
|
@@ -1615,13 +1642,13 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
1615
1642
|
elm["s-rf"] = (_a = newVNode2.$attrs$) == null ? void 0 : _a.ref;
|
|
1616
1643
|
oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
|
|
1617
1644
|
if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) {
|
|
1618
|
-
if (
|
|
1645
|
+
if (BUILD13.experimentalSlotFixes) {
|
|
1619
1646
|
relocateToHostRoot(oldParentVNode.$elm$);
|
|
1620
1647
|
} else {
|
|
1621
1648
|
putBackInOriginalLocation(oldParentVNode.$elm$, false);
|
|
1622
1649
|
}
|
|
1623
1650
|
}
|
|
1624
|
-
if (
|
|
1651
|
+
if (BUILD13.scoped) {
|
|
1625
1652
|
addRemoveSlotScopedClass(contentRef, elm, newParentVNode.$elm$, oldParentVNode == null ? void 0 : oldParentVNode.$elm$);
|
|
1626
1653
|
}
|
|
1627
1654
|
}
|
|
@@ -1651,7 +1678,7 @@ var relocateToHostRoot = (parentElm) => {
|
|
|
1651
1678
|
var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
1652
1679
|
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
1653
1680
|
const oldSlotChildNodes = Array.from(parentElm.__childNodes || parentElm.childNodes);
|
|
1654
|
-
if (parentElm["s-sr"] &&
|
|
1681
|
+
if (parentElm["s-sr"] && BUILD13.experimentalSlotFixes) {
|
|
1655
1682
|
let node = parentElm;
|
|
1656
1683
|
while (node = node.nextSibling) {
|
|
1657
1684
|
if (node && node["s-sn"] === parentElm["s-sn"] && node["s-sh"] === hostTagName) {
|
|
@@ -1675,9 +1702,9 @@ var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
|
1675
1702
|
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
1676
1703
|
};
|
|
1677
1704
|
var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
1678
|
-
let containerElm =
|
|
1705
|
+
let containerElm = BUILD13.slotRelocation && parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
|
|
1679
1706
|
let childNode;
|
|
1680
|
-
if (
|
|
1707
|
+
if (BUILD13.shadowDom && containerElm.shadowRoot && containerElm.tagName === hostTagName) {
|
|
1681
1708
|
containerElm = containerElm.shadowRoot;
|
|
1682
1709
|
}
|
|
1683
1710
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
@@ -1685,7 +1712,7 @@ var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
|
1685
1712
|
childNode = createElm(null, parentVNode, startIdx);
|
|
1686
1713
|
if (childNode) {
|
|
1687
1714
|
vnodes[startIdx].$elm$ = childNode;
|
|
1688
|
-
insertBefore(containerElm, childNode,
|
|
1715
|
+
insertBefore(containerElm, childNode, BUILD13.slotRelocation ? referenceNode(before) : before);
|
|
1689
1716
|
}
|
|
1690
1717
|
}
|
|
1691
1718
|
}
|
|
@@ -1697,7 +1724,7 @@ var removeVnodes = (vnodes, startIdx, endIdx) => {
|
|
|
1697
1724
|
const elm = vnode.$elm$;
|
|
1698
1725
|
nullifyVNodeRefs(vnode);
|
|
1699
1726
|
if (elm) {
|
|
1700
|
-
if (
|
|
1727
|
+
if (BUILD13.slotRelocation) {
|
|
1701
1728
|
checkSlotFallbackVisibility = true;
|
|
1702
1729
|
if (elm["s-ol"]) {
|
|
1703
1730
|
elm["s-ol"].remove();
|
|
@@ -1741,7 +1768,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
1741
1768
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
1742
1769
|
newEndVnode = newCh[--newEndIdx];
|
|
1743
1770
|
} else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
|
|
1744
|
-
if (
|
|
1771
|
+
if (BUILD13.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
|
|
1745
1772
|
putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
|
|
1746
1773
|
}
|
|
1747
1774
|
patch(oldStartVnode, newEndVnode, isInitialRender);
|
|
@@ -1749,7 +1776,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
1749
1776
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
1750
1777
|
newEndVnode = newCh[--newEndIdx];
|
|
1751
1778
|
} else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
|
|
1752
|
-
if (
|
|
1779
|
+
if (BUILD13.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
|
|
1753
1780
|
putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
|
|
1754
1781
|
}
|
|
1755
1782
|
patch(oldEndVnode, newStartVnode, isInitialRender);
|
|
@@ -1758,7 +1785,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
1758
1785
|
newStartVnode = newCh[++newStartIdx];
|
|
1759
1786
|
} else {
|
|
1760
1787
|
idxInOld = -1;
|
|
1761
|
-
if (
|
|
1788
|
+
if (BUILD13.vdomKey) {
|
|
1762
1789
|
for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) {
|
|
1763
1790
|
if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) {
|
|
1764
1791
|
idxInOld = i2;
|
|
@@ -1766,7 +1793,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
1766
1793
|
}
|
|
1767
1794
|
}
|
|
1768
1795
|
}
|
|
1769
|
-
if (
|
|
1796
|
+
if (BUILD13.vdomKey && idxInOld >= 0) {
|
|
1770
1797
|
elmToMove = oldCh[idxInOld];
|
|
1771
1798
|
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
|
|
1772
1799
|
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld);
|
|
@@ -1781,7 +1808,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
1781
1808
|
newStartVnode = newCh[++newStartIdx];
|
|
1782
1809
|
}
|
|
1783
1810
|
if (node) {
|
|
1784
|
-
if (
|
|
1811
|
+
if (BUILD13.slotRelocation) {
|
|
1785
1812
|
insertBefore(
|
|
1786
1813
|
referenceNode(oldStartVnode.$elm$).parentNode,
|
|
1787
1814
|
node,
|
|
@@ -1802,16 +1829,16 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
1802
1829
|
newStartIdx,
|
|
1803
1830
|
newEndIdx
|
|
1804
1831
|
);
|
|
1805
|
-
} else if (
|
|
1832
|
+
} else if (BUILD13.updatable && newStartIdx > newEndIdx) {
|
|
1806
1833
|
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
|
|
1807
1834
|
}
|
|
1808
1835
|
};
|
|
1809
1836
|
var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
1810
1837
|
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
1811
|
-
if (
|
|
1838
|
+
if (BUILD13.slotRelocation && leftVNode.$tag$ === "slot") {
|
|
1812
1839
|
return leftVNode.$name$ === rightVNode.$name$;
|
|
1813
1840
|
}
|
|
1814
|
-
if (
|
|
1841
|
+
if (BUILD13.vdomKey && !isInitialRender) {
|
|
1815
1842
|
return leftVNode.$key$ === rightVNode.$key$;
|
|
1816
1843
|
}
|
|
1817
1844
|
if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
|
|
@@ -1829,13 +1856,13 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
1829
1856
|
const tag = newVNode2.$tag$;
|
|
1830
1857
|
const text = newVNode2.$text$;
|
|
1831
1858
|
let defaultHolder;
|
|
1832
|
-
if (!
|
|
1833
|
-
if (
|
|
1859
|
+
if (!BUILD13.vdomText || text === null) {
|
|
1860
|
+
if (BUILD13.svg) {
|
|
1834
1861
|
isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
|
|
1835
1862
|
}
|
|
1836
|
-
if (
|
|
1837
|
-
if (
|
|
1838
|
-
if (
|
|
1863
|
+
if (BUILD13.vdomAttribute || BUILD13.reflect) {
|
|
1864
|
+
if (BUILD13.slot && tag === "slot" && !useNativeShadowDom) {
|
|
1865
|
+
if (BUILD13.experimentalSlotFixes && oldVNode.$name$ !== newVNode2.$name$) {
|
|
1839
1866
|
newVNode2.$elm$["s-sn"] = newVNode2.$name$ || "";
|
|
1840
1867
|
relocateToHostRoot(newVNode2.$elm$.parentElement);
|
|
1841
1868
|
}
|
|
@@ -1843,25 +1870,25 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
1843
1870
|
updateElement(oldVNode, newVNode2, isSvgMode);
|
|
1844
1871
|
}
|
|
1845
1872
|
}
|
|
1846
|
-
if (
|
|
1873
|
+
if (BUILD13.updatable && oldChildren !== null && newChildren !== null) {
|
|
1847
1874
|
updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
|
|
1848
1875
|
} else if (newChildren !== null) {
|
|
1849
|
-
if (
|
|
1876
|
+
if (BUILD13.updatable && BUILD13.vdomText && oldVNode.$text$ !== null) {
|
|
1850
1877
|
elm.textContent = "";
|
|
1851
1878
|
}
|
|
1852
1879
|
addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
|
|
1853
1880
|
} else if (
|
|
1854
1881
|
// don't do this on initial render as it can cause non-hydrated content to be removed
|
|
1855
|
-
!isInitialRender &&
|
|
1882
|
+
!isInitialRender && BUILD13.updatable && oldChildren !== null
|
|
1856
1883
|
) {
|
|
1857
1884
|
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
1858
1885
|
}
|
|
1859
|
-
if (
|
|
1886
|
+
if (BUILD13.svg && isSvgMode && tag === "svg") {
|
|
1860
1887
|
isSvgMode = false;
|
|
1861
1888
|
}
|
|
1862
|
-
} else if (
|
|
1889
|
+
} else if (BUILD13.vdomText && BUILD13.slotRelocation && (defaultHolder = elm["s-cr"])) {
|
|
1863
1890
|
defaultHolder.parentNode.textContent = text;
|
|
1864
|
-
} else if (
|
|
1891
|
+
} else if (BUILD13.vdomText && oldVNode.$text$ !== text) {
|
|
1865
1892
|
elm.data = text;
|
|
1866
1893
|
}
|
|
1867
1894
|
};
|
|
@@ -1877,7 +1904,7 @@ var markSlotContentForRelocation = (elm) => {
|
|
|
1877
1904
|
const slotName = childNode["s-sn"];
|
|
1878
1905
|
for (j = hostContentNodes.length - 1; j >= 0; j--) {
|
|
1879
1906
|
node = hostContentNodes[j];
|
|
1880
|
-
if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!
|
|
1907
|
+
if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!BUILD13.experimentalSlotFixes || !node["s-sh"] || node["s-sh"] !== childNode["s-hn"])) {
|
|
1881
1908
|
if (isNodeLocatedInSlot(node, slotName)) {
|
|
1882
1909
|
let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
|
|
1883
1910
|
checkSlotFallbackVisibility = true;
|
|
@@ -1916,21 +1943,21 @@ var markSlotContentForRelocation = (elm) => {
|
|
|
1916
1943
|
}
|
|
1917
1944
|
};
|
|
1918
1945
|
var nullifyVNodeRefs = (vNode) => {
|
|
1919
|
-
if (
|
|
1946
|
+
if (BUILD13.vdomRef) {
|
|
1920
1947
|
vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
|
|
1921
1948
|
vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
|
|
1922
1949
|
}
|
|
1923
1950
|
};
|
|
1924
1951
|
var insertBefore = (parent, newNode, reference) => {
|
|
1925
|
-
if (
|
|
1952
|
+
if (BUILD13.scoped && typeof newNode["s-sn"] === "string" && !!newNode["s-sr"] && !!newNode["s-cr"]) {
|
|
1926
1953
|
addRemoveSlotScopedClass(newNode["s-cr"], newNode, parent, newNode.parentElement);
|
|
1927
|
-
} else if (
|
|
1954
|
+
} else if (BUILD13.experimentalSlotFixes && typeof newNode["s-sn"] === "string") {
|
|
1928
1955
|
if (parent.getRootNode().nodeType !== 11 /* DOCUMENT_FRAGMENT_NODE */) {
|
|
1929
1956
|
patchParentNode(newNode);
|
|
1930
1957
|
}
|
|
1931
1958
|
return parent.insertBefore(newNode, reference);
|
|
1932
1959
|
}
|
|
1933
|
-
if (
|
|
1960
|
+
if (BUILD13.experimentalSlotFixes && parent.__insertBefore) {
|
|
1934
1961
|
return parent.__insertBefore(newNode, reference);
|
|
1935
1962
|
} else {
|
|
1936
1963
|
return parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
|
@@ -1964,7 +1991,7 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
1964
1991
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
1965
1992
|
const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
|
1966
1993
|
hostTagName = hostElm.tagName;
|
|
1967
|
-
if (
|
|
1994
|
+
if (BUILD13.isDev && Array.isArray(renderFnResults) && renderFnResults.some(isHost)) {
|
|
1968
1995
|
throw new Error(`The <Host> must be the single root component.
|
|
1969
1996
|
Looks like the render() function of "${hostTagName.toLowerCase()}" is returning an array that contains the <Host>.
|
|
1970
1997
|
|
|
@@ -1978,7 +2005,7 @@ render() {
|
|
|
1978
2005
|
}
|
|
1979
2006
|
`);
|
|
1980
2007
|
}
|
|
1981
|
-
if (
|
|
2008
|
+
if (BUILD13.reflect && cmpMeta.$attrsToReflect$) {
|
|
1982
2009
|
rootVnode.$attrs$ = rootVnode.$attrs$ || {};
|
|
1983
2010
|
cmpMeta.$attrsToReflect$.map(
|
|
1984
2011
|
([propName, attribute]) => rootVnode.$attrs$[attribute] = hostElm[propName]
|
|
@@ -1994,24 +2021,24 @@ render() {
|
|
|
1994
2021
|
rootVnode.$tag$ = null;
|
|
1995
2022
|
rootVnode.$flags$ |= 4 /* isHost */;
|
|
1996
2023
|
hostRef.$vnode$ = rootVnode;
|
|
1997
|
-
rootVnode.$elm$ = oldVNode.$elm$ =
|
|
1998
|
-
if (
|
|
2024
|
+
rootVnode.$elm$ = oldVNode.$elm$ = BUILD13.shadowDom ? hostElm.shadowRoot || hostElm : hostElm;
|
|
2025
|
+
if (BUILD13.scoped || BUILD13.shadowDom) {
|
|
1999
2026
|
scopeId = hostElm["s-sc"];
|
|
2000
2027
|
}
|
|
2001
2028
|
useNativeShadowDom = supportsShadow && (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
|
2002
|
-
if (
|
|
2029
|
+
if (BUILD13.slotRelocation) {
|
|
2003
2030
|
contentRef = hostElm["s-cr"];
|
|
2004
2031
|
checkSlotFallbackVisibility = false;
|
|
2005
2032
|
}
|
|
2006
2033
|
patch(oldVNode, rootVnode, isInitialLoad);
|
|
2007
|
-
if (
|
|
2034
|
+
if (BUILD13.slotRelocation) {
|
|
2008
2035
|
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
2009
2036
|
if (checkSlotRelocate) {
|
|
2010
2037
|
markSlotContentForRelocation(rootVnode.$elm$);
|
|
2011
2038
|
for (const relocateData of relocateNodes) {
|
|
2012
2039
|
const nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
2013
2040
|
if (!nodeToRelocate["s-ol"]) {
|
|
2014
|
-
const orgLocationNode =
|
|
2041
|
+
const orgLocationNode = BUILD13.isDebug || BUILD13.hydrateServerSide ? originalLocationDebugNode(nodeToRelocate) : doc.createTextNode("");
|
|
2015
2042
|
orgLocationNode["s-nr"] = nodeToRelocate;
|
|
2016
2043
|
insertBefore(nodeToRelocate.parentNode, nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate);
|
|
2017
2044
|
}
|
|
@@ -2022,7 +2049,7 @@ render() {
|
|
|
2022
2049
|
if (slotRefNode) {
|
|
2023
2050
|
const parentNodeRef = slotRefNode.parentNode;
|
|
2024
2051
|
let insertBeforeNode = slotRefNode.nextSibling;
|
|
2025
|
-
if (!
|
|
2052
|
+
if (!BUILD13.hydrateServerSide && (!BUILD13.experimentalSlotFixes || insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */)) {
|
|
2026
2053
|
let orgLocationNode = (_a = nodeToRelocate["s-ol"]) == null ? void 0 : _a.previousSibling;
|
|
2027
2054
|
while (orgLocationNode) {
|
|
2028
2055
|
let refNode = (_b = orgLocationNode["s-nr"]) != null ? _b : null;
|
|
@@ -2043,7 +2070,7 @@ render() {
|
|
|
2043
2070
|
const nextSibling = nodeToRelocate.__nextSibling || nodeToRelocate.nextSibling;
|
|
2044
2071
|
if (!insertBeforeNode && parentNodeRef !== parent || nextSibling !== insertBeforeNode) {
|
|
2045
2072
|
if (nodeToRelocate !== insertBeforeNode) {
|
|
2046
|
-
if (!
|
|
2073
|
+
if (!BUILD13.experimentalSlotFixes && !nodeToRelocate["s-hn"] && nodeToRelocate["s-ol"]) {
|
|
2047
2074
|
nodeToRelocate["s-hn"] = nodeToRelocate["s-ol"].parentNode.nodeName;
|
|
2048
2075
|
}
|
|
2049
2076
|
insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
|
|
@@ -2069,7 +2096,7 @@ render() {
|
|
|
2069
2096
|
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
2070
2097
|
relocateNodes.length = 0;
|
|
2071
2098
|
}
|
|
2072
|
-
if (
|
|
2099
|
+
if (BUILD13.experimentalScopedSlotChanges && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
2073
2100
|
const children = rootVnode.$elm$.__childNodes || rootVnode.$elm$.childNodes;
|
|
2074
2101
|
for (const childNode of children) {
|
|
2075
2102
|
if (childNode["s-hn"] !== hostTagName && !childNode["s-sh"]) {
|
|
@@ -2091,7 +2118,7 @@ var originalLocationDebugNode = (nodeToRelocate) => doc.createComment(
|
|
|
2091
2118
|
|
|
2092
2119
|
// src/runtime/update-component.ts
|
|
2093
2120
|
var attachToAncestor = (hostRef, ancestorComponent) => {
|
|
2094
|
-
if (
|
|
2121
|
+
if (BUILD14.asyncLoading && ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
|
|
2095
2122
|
const index = ancestorComponent["s-p"].push(
|
|
2096
2123
|
new Promise(
|
|
2097
2124
|
(r) => hostRef.$onRenderResolve$ = () => {
|
|
@@ -2103,21 +2130,21 @@ var attachToAncestor = (hostRef, ancestorComponent) => {
|
|
|
2103
2130
|
}
|
|
2104
2131
|
};
|
|
2105
2132
|
var scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
2106
|
-
if (
|
|
2133
|
+
if (BUILD14.taskQueue && BUILD14.updatable) {
|
|
2107
2134
|
hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
|
|
2108
2135
|
}
|
|
2109
|
-
if (
|
|
2136
|
+
if (BUILD14.asyncLoading && hostRef.$flags$ & 4 /* isWaitingForChildren */) {
|
|
2110
2137
|
hostRef.$flags$ |= 512 /* needsRerender */;
|
|
2111
2138
|
return;
|
|
2112
2139
|
}
|
|
2113
2140
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$);
|
|
2114
2141
|
const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
|
|
2115
|
-
return
|
|
2142
|
+
return BUILD14.taskQueue ? writeTask(dispatch) : dispatch();
|
|
2116
2143
|
};
|
|
2117
2144
|
var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
2118
2145
|
const elm = hostRef.$hostElement$;
|
|
2119
2146
|
const endSchedule = createTime("scheduleUpdate", hostRef.$cmpMeta$.$tagName$);
|
|
2120
|
-
const instance =
|
|
2147
|
+
const instance = BUILD14.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
2121
2148
|
if (!instance) {
|
|
2122
2149
|
throw new Error(
|
|
2123
2150
|
`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`
|
|
@@ -2125,26 +2152,26 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
2125
2152
|
}
|
|
2126
2153
|
let maybePromise;
|
|
2127
2154
|
if (isInitialLoad) {
|
|
2128
|
-
if (
|
|
2155
|
+
if (BUILD14.lazyLoad && BUILD14.hostListener) {
|
|
2129
2156
|
hostRef.$flags$ |= 256 /* isListenReady */;
|
|
2130
2157
|
if (hostRef.$queuedListeners$) {
|
|
2131
|
-
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
|
|
2158
|
+
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event, elm));
|
|
2132
2159
|
hostRef.$queuedListeners$ = void 0;
|
|
2133
2160
|
}
|
|
2134
2161
|
}
|
|
2135
2162
|
emitLifecycleEvent(elm, "componentWillLoad");
|
|
2136
|
-
if (
|
|
2137
|
-
maybePromise = safeCall(instance, "componentWillLoad");
|
|
2163
|
+
if (BUILD14.cmpWillLoad) {
|
|
2164
|
+
maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
|
|
2138
2165
|
}
|
|
2139
2166
|
} else {
|
|
2140
2167
|
emitLifecycleEvent(elm, "componentWillUpdate");
|
|
2141
|
-
if (
|
|
2142
|
-
maybePromise = safeCall(instance, "componentWillUpdate");
|
|
2168
|
+
if (BUILD14.cmpWillUpdate) {
|
|
2169
|
+
maybePromise = safeCall(instance, "componentWillUpdate", void 0, elm);
|
|
2143
2170
|
}
|
|
2144
2171
|
}
|
|
2145
2172
|
emitLifecycleEvent(elm, "componentWillRender");
|
|
2146
|
-
if (
|
|
2147
|
-
maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender"));
|
|
2173
|
+
if (BUILD14.cmpWillRender) {
|
|
2174
|
+
maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender", void 0, elm));
|
|
2148
2175
|
}
|
|
2149
2176
|
endSchedule();
|
|
2150
2177
|
return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
|
|
@@ -2159,23 +2186,23 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
2159
2186
|
const elm = hostRef.$hostElement$;
|
|
2160
2187
|
const endUpdate = createTime("update", hostRef.$cmpMeta$.$tagName$);
|
|
2161
2188
|
const rc = elm["s-rc"];
|
|
2162
|
-
if (
|
|
2189
|
+
if (BUILD14.style && isInitialLoad) {
|
|
2163
2190
|
attachStyles(hostRef);
|
|
2164
2191
|
}
|
|
2165
2192
|
const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$);
|
|
2166
|
-
if (
|
|
2193
|
+
if (BUILD14.isDev) {
|
|
2167
2194
|
hostRef.$flags$ |= 1024 /* devOnRender */;
|
|
2168
2195
|
}
|
|
2169
|
-
if (
|
|
2196
|
+
if (BUILD14.hydrateServerSide) {
|
|
2170
2197
|
await callRender(hostRef, instance, elm, isInitialLoad);
|
|
2171
2198
|
} else {
|
|
2172
2199
|
callRender(hostRef, instance, elm, isInitialLoad);
|
|
2173
2200
|
}
|
|
2174
|
-
if (
|
|
2201
|
+
if (BUILD14.isDev) {
|
|
2175
2202
|
hostRef.$renderCount$ = hostRef.$renderCount$ === void 0 ? 1 : hostRef.$renderCount$ + 1;
|
|
2176
2203
|
hostRef.$flags$ &= ~1024 /* devOnRender */;
|
|
2177
2204
|
}
|
|
2178
|
-
if (
|
|
2205
|
+
if (BUILD14.hydrateServerSide) {
|
|
2179
2206
|
try {
|
|
2180
2207
|
serverSideConnected(elm);
|
|
2181
2208
|
if (isInitialLoad) {
|
|
@@ -2189,13 +2216,13 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
2189
2216
|
consoleError(e, elm);
|
|
2190
2217
|
}
|
|
2191
2218
|
}
|
|
2192
|
-
if (
|
|
2219
|
+
if (BUILD14.asyncLoading && rc) {
|
|
2193
2220
|
rc.map((cb) => cb());
|
|
2194
2221
|
elm["s-rc"] = void 0;
|
|
2195
2222
|
}
|
|
2196
2223
|
endRender();
|
|
2197
2224
|
endUpdate();
|
|
2198
|
-
if (
|
|
2225
|
+
if (BUILD14.asyncLoading) {
|
|
2199
2226
|
const childrenPromises = (_a = elm["s-p"]) != null ? _a : [];
|
|
2200
2227
|
const postUpdate = () => postUpdateComponent(hostRef);
|
|
2201
2228
|
if (childrenPromises.length === 0) {
|
|
@@ -2211,10 +2238,10 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
2211
2238
|
};
|
|
2212
2239
|
var renderingRef = null;
|
|
2213
2240
|
var callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
2214
|
-
const allRenderFn =
|
|
2215
|
-
const lazyLoad =
|
|
2216
|
-
const taskQueue =
|
|
2217
|
-
const updatable =
|
|
2241
|
+
const allRenderFn = BUILD14.allRenderFn ? true : false;
|
|
2242
|
+
const lazyLoad = BUILD14.lazyLoad ? true : false;
|
|
2243
|
+
const taskQueue = BUILD14.taskQueue ? true : false;
|
|
2244
|
+
const updatable = BUILD14.updatable ? true : false;
|
|
2218
2245
|
try {
|
|
2219
2246
|
renderingRef = instance;
|
|
2220
2247
|
instance = allRenderFn ? instance.render() : instance.render && instance.render();
|
|
@@ -2224,9 +2251,9 @@ var callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
|
2224
2251
|
if (updatable || lazyLoad) {
|
|
2225
2252
|
hostRef.$flags$ |= 2 /* hasRendered */;
|
|
2226
2253
|
}
|
|
2227
|
-
if (
|
|
2228
|
-
if (
|
|
2229
|
-
if (
|
|
2254
|
+
if (BUILD14.hasRenderFn || BUILD14.reflect) {
|
|
2255
|
+
if (BUILD14.vdomRender || BUILD14.reflect) {
|
|
2256
|
+
if (BUILD14.hydrateServerSide) {
|
|
2230
2257
|
return Promise.resolve(instance).then((value) => renderVdom(hostRef, value, isInitialLoad));
|
|
2231
2258
|
} else {
|
|
2232
2259
|
renderVdom(hostRef, instance, isInitialLoad);
|
|
@@ -2251,57 +2278,57 @@ var postUpdateComponent = (hostRef) => {
|
|
|
2251
2278
|
const tagName = hostRef.$cmpMeta$.$tagName$;
|
|
2252
2279
|
const elm = hostRef.$hostElement$;
|
|
2253
2280
|
const endPostUpdate = createTime("postUpdate", tagName);
|
|
2254
|
-
const instance =
|
|
2281
|
+
const instance = BUILD14.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
2255
2282
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
2256
|
-
if (
|
|
2257
|
-
if (
|
|
2283
|
+
if (BUILD14.cmpDidRender) {
|
|
2284
|
+
if (BUILD14.isDev) {
|
|
2258
2285
|
hostRef.$flags$ |= 1024 /* devOnRender */;
|
|
2259
2286
|
}
|
|
2260
|
-
safeCall(instance, "componentDidRender");
|
|
2261
|
-
if (
|
|
2287
|
+
safeCall(instance, "componentDidRender", void 0, elm);
|
|
2288
|
+
if (BUILD14.isDev) {
|
|
2262
2289
|
hostRef.$flags$ &= ~1024 /* devOnRender */;
|
|
2263
2290
|
}
|
|
2264
2291
|
}
|
|
2265
2292
|
emitLifecycleEvent(elm, "componentDidRender");
|
|
2266
2293
|
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
2267
2294
|
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
2268
|
-
if (
|
|
2295
|
+
if (BUILD14.asyncLoading && BUILD14.cssAnnotations) {
|
|
2269
2296
|
addHydratedFlag(elm);
|
|
2270
2297
|
}
|
|
2271
|
-
if (
|
|
2272
|
-
if (
|
|
2298
|
+
if (BUILD14.cmpDidLoad) {
|
|
2299
|
+
if (BUILD14.isDev) {
|
|
2273
2300
|
hostRef.$flags$ |= 2048 /* devOnDidLoad */;
|
|
2274
2301
|
}
|
|
2275
|
-
safeCall(instance, "componentDidLoad");
|
|
2276
|
-
if (
|
|
2302
|
+
safeCall(instance, "componentDidLoad", void 0, elm);
|
|
2303
|
+
if (BUILD14.isDev) {
|
|
2277
2304
|
hostRef.$flags$ &= ~2048 /* devOnDidLoad */;
|
|
2278
2305
|
}
|
|
2279
2306
|
}
|
|
2280
2307
|
emitLifecycleEvent(elm, "componentDidLoad");
|
|
2281
2308
|
endPostUpdate();
|
|
2282
|
-
if (
|
|
2309
|
+
if (BUILD14.asyncLoading) {
|
|
2283
2310
|
hostRef.$onReadyResolve$(elm);
|
|
2284
2311
|
if (!ancestorComponent) {
|
|
2285
2312
|
appDidLoad(tagName);
|
|
2286
2313
|
}
|
|
2287
2314
|
}
|
|
2288
2315
|
} else {
|
|
2289
|
-
if (
|
|
2290
|
-
if (
|
|
2316
|
+
if (BUILD14.cmpDidUpdate) {
|
|
2317
|
+
if (BUILD14.isDev) {
|
|
2291
2318
|
hostRef.$flags$ |= 1024 /* devOnRender */;
|
|
2292
2319
|
}
|
|
2293
|
-
safeCall(instance, "componentDidUpdate");
|
|
2294
|
-
if (
|
|
2320
|
+
safeCall(instance, "componentDidUpdate", void 0, elm);
|
|
2321
|
+
if (BUILD14.isDev) {
|
|
2295
2322
|
hostRef.$flags$ &= ~1024 /* devOnRender */;
|
|
2296
2323
|
}
|
|
2297
2324
|
}
|
|
2298
2325
|
emitLifecycleEvent(elm, "componentDidUpdate");
|
|
2299
2326
|
endPostUpdate();
|
|
2300
2327
|
}
|
|
2301
|
-
if (
|
|
2328
|
+
if (BUILD14.method && BUILD14.lazyLoad) {
|
|
2302
2329
|
hostRef.$onInstanceResolve$(elm);
|
|
2303
2330
|
}
|
|
2304
|
-
if (
|
|
2331
|
+
if (BUILD14.asyncLoading) {
|
|
2305
2332
|
if (hostRef.$onRenderResolve$) {
|
|
2306
2333
|
hostRef.$onRenderResolve$();
|
|
2307
2334
|
hostRef.$onRenderResolve$ = void 0;
|
|
@@ -2313,7 +2340,7 @@ var postUpdateComponent = (hostRef) => {
|
|
|
2313
2340
|
}
|
|
2314
2341
|
};
|
|
2315
2342
|
var forceUpdate = (ref) => {
|
|
2316
|
-
if (
|
|
2343
|
+
if (BUILD14.updatable && (Build.isBrowser || Build.isTesting)) {
|
|
2317
2344
|
const hostRef = getHostRef(ref);
|
|
2318
2345
|
const isConnected = hostRef.$hostElement$.isConnected;
|
|
2319
2346
|
if (isConnected && (hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
@@ -2324,29 +2351,29 @@ var forceUpdate = (ref) => {
|
|
|
2324
2351
|
return false;
|
|
2325
2352
|
};
|
|
2326
2353
|
var appDidLoad = (who) => {
|
|
2327
|
-
if (
|
|
2354
|
+
if (BUILD14.cssAnnotations) {
|
|
2328
2355
|
addHydratedFlag(doc.documentElement);
|
|
2329
2356
|
}
|
|
2330
|
-
if (
|
|
2357
|
+
if (BUILD14.asyncQueue) {
|
|
2331
2358
|
plt.$flags$ |= 2 /* appLoaded */;
|
|
2332
2359
|
}
|
|
2333
2360
|
nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
|
|
2334
|
-
if (
|
|
2361
|
+
if (BUILD14.profile && performance.measure) {
|
|
2335
2362
|
performance.measure(`[Stencil] ${NAMESPACE} initial load (by ${who})`, "st:app:start");
|
|
2336
2363
|
}
|
|
2337
2364
|
};
|
|
2338
|
-
var safeCall = (instance, method, arg) => {
|
|
2365
|
+
var safeCall = (instance, method, arg, elm) => {
|
|
2339
2366
|
if (instance && instance[method]) {
|
|
2340
2367
|
try {
|
|
2341
2368
|
return instance[method](arg);
|
|
2342
2369
|
} catch (e) {
|
|
2343
|
-
consoleError(e);
|
|
2370
|
+
consoleError(e, elm);
|
|
2344
2371
|
}
|
|
2345
2372
|
}
|
|
2346
2373
|
return void 0;
|
|
2347
2374
|
};
|
|
2348
2375
|
var emitLifecycleEvent = (elm, lifecycleName) => {
|
|
2349
|
-
if (
|
|
2376
|
+
if (BUILD14.lifecycleDOMEvents) {
|
|
2350
2377
|
emitEvent(elm, "stencil_" + lifecycleName, {
|
|
2351
2378
|
bubbles: true,
|
|
2352
2379
|
composed: true,
|
|
@@ -2358,7 +2385,7 @@ var emitLifecycleEvent = (elm, lifecycleName) => {
|
|
|
2358
2385
|
};
|
|
2359
2386
|
var addHydratedFlag = (elm) => {
|
|
2360
2387
|
var _a, _b;
|
|
2361
|
-
return
|
|
2388
|
+
return BUILD14.hydratedClass ? elm.classList.add((_a = BUILD14.hydratedSelectorName) != null ? _a : "hydrated") : BUILD14.hydratedAttribute ? elm.setAttribute((_b = BUILD14.hydratedSelectorName) != null ? _b : "hydrated", "") : void 0;
|
|
2362
2389
|
};
|
|
2363
2390
|
var serverSideConnected = (elm) => {
|
|
2364
2391
|
const children = elm.children;
|
|
@@ -2377,21 +2404,21 @@ var serverSideConnected = (elm) => {
|
|
|
2377
2404
|
var getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
|
|
2378
2405
|
var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
2379
2406
|
const hostRef = getHostRef(ref);
|
|
2380
|
-
if (
|
|
2407
|
+
if (BUILD15.lazyLoad && !hostRef) {
|
|
2381
2408
|
throw new Error(
|
|
2382
2409
|
`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).`
|
|
2383
2410
|
);
|
|
2384
2411
|
}
|
|
2385
|
-
const elm =
|
|
2412
|
+
const elm = BUILD15.lazyLoad ? hostRef.$hostElement$ : ref;
|
|
2386
2413
|
const oldVal = hostRef.$instanceValues$.get(propName);
|
|
2387
2414
|
const flags = hostRef.$flags$;
|
|
2388
|
-
const instance =
|
|
2415
|
+
const instance = BUILD15.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
2389
2416
|
newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
|
|
2390
2417
|
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
2391
2418
|
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
2392
|
-
if ((!
|
|
2419
|
+
if ((!BUILD15.lazyLoad || !(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
|
|
2393
2420
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
2394
|
-
if (
|
|
2421
|
+
if (BUILD15.isDev) {
|
|
2395
2422
|
if (hostRef.$flags$ & 1024 /* devOnRender */) {
|
|
2396
2423
|
consoleDevWarn(
|
|
2397
2424
|
`The state/prop "${propName}" changed during rendering. This can potentially lead to infinite-loops and other bugs.`,
|
|
@@ -2414,8 +2441,8 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
2414
2441
|
);
|
|
2415
2442
|
}
|
|
2416
2443
|
}
|
|
2417
|
-
if (!
|
|
2418
|
-
if (
|
|
2444
|
+
if (!BUILD15.lazyLoad || instance) {
|
|
2445
|
+
if (BUILD15.watchCallback && cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
|
|
2419
2446
|
const watchMethods = cmpMeta.$watchers$[propName];
|
|
2420
2447
|
if (watchMethods) {
|
|
2421
2448
|
watchMethods.map((watchMethodName) => {
|
|
@@ -2427,8 +2454,8 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
2427
2454
|
});
|
|
2428
2455
|
}
|
|
2429
2456
|
}
|
|
2430
|
-
if (
|
|
2431
|
-
if (
|
|
2457
|
+
if (BUILD15.updatable && (flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
2458
|
+
if (BUILD15.cmpShouldUpdate && instance.componentShouldUpdate) {
|
|
2432
2459
|
if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
|
|
2433
2460
|
return;
|
|
2434
2461
|
}
|
|
@@ -2443,40 +2470,46 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
2443
2470
|
var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
2444
2471
|
var _a, _b;
|
|
2445
2472
|
const prototype = Cstr.prototype;
|
|
2446
|
-
if (
|
|
2473
|
+
if (BUILD16.isTesting) {
|
|
2474
|
+
if (prototype.done) {
|
|
2475
|
+
return;
|
|
2476
|
+
}
|
|
2477
|
+
prototype.done = true;
|
|
2478
|
+
}
|
|
2479
|
+
if (BUILD16.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */ && flags & 1 /* isElementConstructor */) {
|
|
2447
2480
|
FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS.forEach((cbName) => {
|
|
2448
2481
|
const originalFormAssociatedCallback = prototype[cbName];
|
|
2449
2482
|
Object.defineProperty(prototype, cbName, {
|
|
2450
2483
|
value(...args) {
|
|
2451
2484
|
const hostRef = getHostRef(this);
|
|
2452
|
-
const instance =
|
|
2485
|
+
const instance = BUILD16.lazyLoad ? hostRef.$lazyInstance$ : this;
|
|
2453
2486
|
if (!instance) {
|
|
2454
2487
|
hostRef.$onReadyPromise$.then((asyncInstance) => {
|
|
2455
2488
|
const cb = asyncInstance[cbName];
|
|
2456
2489
|
typeof cb === "function" && cb.call(asyncInstance, ...args);
|
|
2457
2490
|
});
|
|
2458
2491
|
} else {
|
|
2459
|
-
const cb =
|
|
2492
|
+
const cb = BUILD16.lazyLoad ? instance[cbName] : originalFormAssociatedCallback;
|
|
2460
2493
|
typeof cb === "function" && cb.call(instance, ...args);
|
|
2461
2494
|
}
|
|
2462
2495
|
}
|
|
2463
2496
|
});
|
|
2464
2497
|
});
|
|
2465
2498
|
}
|
|
2466
|
-
if (
|
|
2467
|
-
if (
|
|
2499
|
+
if (BUILD16.member && cmpMeta.$members$ || BUILD16.watchCallback && (cmpMeta.$watchers$ || Cstr.watchers)) {
|
|
2500
|
+
if (BUILD16.watchCallback && Cstr.watchers && !cmpMeta.$watchers$) {
|
|
2468
2501
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
2469
2502
|
}
|
|
2470
2503
|
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
2471
2504
|
members.map(([memberName, [memberFlags]]) => {
|
|
2472
|
-
if ((
|
|
2505
|
+
if ((BUILD16.prop || BUILD16.state) && (memberFlags & 31 /* Prop */ || (!BUILD16.lazyLoad || flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
|
|
2473
2506
|
const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};
|
|
2474
2507
|
if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
|
|
2475
2508
|
if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
|
|
2476
2509
|
if (flags & 1 /* isElementConstructor */ || !origGetter) {
|
|
2477
2510
|
Object.defineProperty(prototype, memberName, {
|
|
2478
2511
|
get() {
|
|
2479
|
-
if (
|
|
2512
|
+
if (BUILD16.lazyLoad) {
|
|
2480
2513
|
if ((cmpMeta.$members$[memberName][0] & 2048 /* Getter */) === 0) {
|
|
2481
2514
|
return getValue(this, memberName);
|
|
2482
2515
|
}
|
|
@@ -2485,7 +2518,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
2485
2518
|
if (!instance) return;
|
|
2486
2519
|
return instance[memberName];
|
|
2487
2520
|
}
|
|
2488
|
-
if (!
|
|
2521
|
+
if (!BUILD16.lazyLoad) {
|
|
2489
2522
|
return origGetter ? origGetter.apply(this) : getValue(this, memberName);
|
|
2490
2523
|
}
|
|
2491
2524
|
},
|
|
@@ -2496,14 +2529,14 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
2496
2529
|
Object.defineProperty(prototype, memberName, {
|
|
2497
2530
|
set(newValue) {
|
|
2498
2531
|
const ref = getHostRef(this);
|
|
2499
|
-
if (
|
|
2532
|
+
if (BUILD16.isDev) {
|
|
2500
2533
|
if (
|
|
2501
2534
|
// we are proxying the instance (not element)
|
|
2502
2535
|
(flags & 1 /* isElementConstructor */) === 0 && // if the class has a setter, then the Element can update instance values, so ignore
|
|
2503
2536
|
(cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0 && // the element is not constructing
|
|
2504
2537
|
(ref && ref.$flags$ & 8 /* isConstructingInstance */) === 0 && // the member is a prop
|
|
2505
|
-
(
|
|
2506
|
-
(
|
|
2538
|
+
(memberFlags & 31 /* Prop */) !== 0 && // the member is not mutable
|
|
2539
|
+
(memberFlags & 1024 /* Mutable */) === 0
|
|
2507
2540
|
) {
|
|
2508
2541
|
consoleDevWarn(
|
|
2509
2542
|
`@Prop() "${memberName}" on <${cmpMeta.$tagName$}> is immutable but was modified from within the component.
|
|
@@ -2523,11 +2556,11 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
2523
2556
|
setValue(this, memberName, newValue, cmpMeta);
|
|
2524
2557
|
return;
|
|
2525
2558
|
}
|
|
2526
|
-
if (!
|
|
2559
|
+
if (!BUILD16.lazyLoad) {
|
|
2527
2560
|
setValue(this, memberName, newValue, cmpMeta);
|
|
2528
2561
|
return;
|
|
2529
2562
|
}
|
|
2530
|
-
if (
|
|
2563
|
+
if (BUILD16.lazyLoad) {
|
|
2531
2564
|
if ((flags & 1 /* isElementConstructor */) === 0 || (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0) {
|
|
2532
2565
|
setValue(this, memberName, newValue, cmpMeta);
|
|
2533
2566
|
if (flags & 1 /* isElementConstructor */ && !ref.$lazyInstance$) {
|
|
@@ -2555,7 +2588,7 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
2555
2588
|
}
|
|
2556
2589
|
}
|
|
2557
2590
|
});
|
|
2558
|
-
} else if (
|
|
2591
|
+
} else if (BUILD16.lazyLoad && BUILD16.method && flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) {
|
|
2559
2592
|
Object.defineProperty(prototype, memberName, {
|
|
2560
2593
|
value(...args) {
|
|
2561
2594
|
var _a2;
|
|
@@ -2568,13 +2601,13 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
2568
2601
|
});
|
|
2569
2602
|
}
|
|
2570
2603
|
});
|
|
2571
|
-
if (
|
|
2604
|
+
if (BUILD16.observeAttribute && (!BUILD16.lazyLoad || flags & 1 /* isElementConstructor */)) {
|
|
2572
2605
|
const attrNameToPropName = /* @__PURE__ */ new Map();
|
|
2573
2606
|
prototype.attributeChangedCallback = function(attrName, oldValue, newValue) {
|
|
2574
2607
|
plt.jmp(() => {
|
|
2575
2608
|
var _a2;
|
|
2576
2609
|
const propName = attrNameToPropName.get(attrName);
|
|
2577
|
-
if (this.hasOwnProperty(propName) &&
|
|
2610
|
+
if (this.hasOwnProperty(propName) && BUILD16.lazyLoad) {
|
|
2578
2611
|
newValue = this[propName];
|
|
2579
2612
|
delete this[propName];
|
|
2580
2613
|
} else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
|
|
@@ -2584,8 +2617,8 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
2584
2617
|
const hostRef = getHostRef(this);
|
|
2585
2618
|
const flags2 = hostRef == null ? void 0 : hostRef.$flags$;
|
|
2586
2619
|
if (flags2 && !(flags2 & 8 /* isConstructingInstance */) && flags2 & 128 /* isWatchReady */ && newValue !== oldValue) {
|
|
2587
|
-
const elm =
|
|
2588
|
-
const instance =
|
|
2620
|
+
const elm = BUILD16.lazyLoad ? hostRef.$hostElement$ : this;
|
|
2621
|
+
const instance = BUILD16.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
2589
2622
|
const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName];
|
|
2590
2623
|
entry == null ? void 0 : entry.forEach((callbackName) => {
|
|
2591
2624
|
if (instance[callbackName] != null) {
|
|
@@ -2609,7 +2642,7 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
2609
2642
|
var _a2;
|
|
2610
2643
|
const attrName = m[1] || propName;
|
|
2611
2644
|
attrNameToPropName.set(attrName, propName);
|
|
2612
|
-
if (
|
|
2645
|
+
if (BUILD16.reflect && m[0] & 512 /* ReflectAttr */) {
|
|
2613
2646
|
(_a2 = cmpMeta.$attrsToReflect$) == null ? void 0 : _a2.push([propName, attrName]);
|
|
2614
2647
|
}
|
|
2615
2648
|
return attrName;
|
|
@@ -2626,8 +2659,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2626
2659
|
let Cstr;
|
|
2627
2660
|
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
2628
2661
|
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
2629
|
-
|
|
2630
|
-
if ((BUILD16.lazyLoad || BUILD16.hydrateClientSide) && bundleId) {
|
|
2662
|
+
if (BUILD17.lazyLoad || BUILD17.hydrateClientSide) {
|
|
2631
2663
|
const CstrImport = loadModule(cmpMeta, hostRef, hmrVersionId);
|
|
2632
2664
|
if (CstrImport && "then" in CstrImport) {
|
|
2633
2665
|
const endLoad = uniqueTime(
|
|
@@ -2642,53 +2674,53 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2642
2674
|
if (!Cstr) {
|
|
2643
2675
|
throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
|
|
2644
2676
|
}
|
|
2645
|
-
if (
|
|
2646
|
-
if (
|
|
2677
|
+
if (BUILD17.member && !Cstr.isProxied) {
|
|
2678
|
+
if (BUILD17.watchCallback) {
|
|
2647
2679
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
2648
2680
|
}
|
|
2649
2681
|
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
|
|
2650
2682
|
Cstr.isProxied = true;
|
|
2651
2683
|
}
|
|
2652
2684
|
const endNewInstance = createTime("createInstance", cmpMeta.$tagName$);
|
|
2653
|
-
if (
|
|
2685
|
+
if (BUILD17.member) {
|
|
2654
2686
|
hostRef.$flags$ |= 8 /* isConstructingInstance */;
|
|
2655
2687
|
}
|
|
2656
2688
|
try {
|
|
2657
2689
|
new Cstr(hostRef);
|
|
2658
2690
|
} catch (e) {
|
|
2659
|
-
consoleError(e);
|
|
2691
|
+
consoleError(e, elm);
|
|
2660
2692
|
}
|
|
2661
|
-
if (
|
|
2693
|
+
if (BUILD17.member) {
|
|
2662
2694
|
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
2663
2695
|
}
|
|
2664
|
-
if (
|
|
2696
|
+
if (BUILD17.watchCallback) {
|
|
2665
2697
|
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
2666
2698
|
}
|
|
2667
2699
|
endNewInstance();
|
|
2668
|
-
fireConnectedCallback(hostRef.$lazyInstance
|
|
2700
|
+
fireConnectedCallback(hostRef.$lazyInstance$, elm);
|
|
2669
2701
|
} else {
|
|
2670
2702
|
Cstr = elm.constructor;
|
|
2671
2703
|
const cmpTag = elm.localName;
|
|
2672
2704
|
customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
|
|
2673
2705
|
}
|
|
2674
|
-
if (
|
|
2706
|
+
if (BUILD17.style && Cstr && Cstr.style) {
|
|
2675
2707
|
let style;
|
|
2676
2708
|
if (typeof Cstr.style === "string") {
|
|
2677
2709
|
style = Cstr.style;
|
|
2678
|
-
} else if (
|
|
2710
|
+
} else if (BUILD17.mode && typeof Cstr.style !== "string") {
|
|
2679
2711
|
hostRef.$modeName$ = computeMode(elm);
|
|
2680
2712
|
if (hostRef.$modeName$) {
|
|
2681
2713
|
style = Cstr.style[hostRef.$modeName$];
|
|
2682
2714
|
}
|
|
2683
|
-
if (
|
|
2715
|
+
if (BUILD17.hydrateServerSide && hostRef.$modeName$) {
|
|
2684
2716
|
elm.setAttribute("s-mode", hostRef.$modeName$);
|
|
2685
2717
|
}
|
|
2686
2718
|
}
|
|
2687
2719
|
const scopeId2 = getScopeId(cmpMeta, hostRef.$modeName$);
|
|
2688
2720
|
if (!styles.has(scopeId2)) {
|
|
2689
2721
|
const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
|
|
2690
|
-
if (!
|
|
2691
|
-
|
|
2722
|
+
if (!BUILD17.hydrateServerSide && BUILD17.shadowDom && // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
|
|
2723
|
+
BUILD17.shadowDomShim && cmpMeta.$flags$ & 8 /* needsShadowDomShim */) {
|
|
2692
2724
|
style = await import("../client/shadow-css.js").then((m) => m.scopeCss(style, scopeId2));
|
|
2693
2725
|
}
|
|
2694
2726
|
registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
|
|
@@ -2698,15 +2730,15 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2698
2730
|
}
|
|
2699
2731
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
2700
2732
|
const schedule = () => scheduleUpdate(hostRef, true);
|
|
2701
|
-
if (
|
|
2733
|
+
if (BUILD17.asyncLoading && ancestorComponent && ancestorComponent["s-rc"]) {
|
|
2702
2734
|
ancestorComponent["s-rc"].push(schedule);
|
|
2703
2735
|
} else {
|
|
2704
2736
|
schedule();
|
|
2705
2737
|
}
|
|
2706
2738
|
};
|
|
2707
|
-
var fireConnectedCallback = (instance) => {
|
|
2708
|
-
if (
|
|
2709
|
-
safeCall(instance, "connectedCallback");
|
|
2739
|
+
var fireConnectedCallback = (instance, elm) => {
|
|
2740
|
+
if (BUILD17.lazyLoad && BUILD17.connectedCallback) {
|
|
2741
|
+
safeCall(instance, "connectedCallback", void 0, elm);
|
|
2710
2742
|
}
|
|
2711
2743
|
};
|
|
2712
2744
|
|
|
@@ -2716,41 +2748,41 @@ var connectedCallback = (elm) => {
|
|
|
2716
2748
|
const hostRef = getHostRef(elm);
|
|
2717
2749
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
2718
2750
|
const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
|
|
2719
|
-
if (
|
|
2751
|
+
if (BUILD18.hostListenerTargetParent) {
|
|
2720
2752
|
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, true);
|
|
2721
2753
|
}
|
|
2722
2754
|
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
2723
2755
|
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
2724
2756
|
let hostId;
|
|
2725
|
-
if (
|
|
2757
|
+
if (BUILD18.hydrateClientSide) {
|
|
2726
2758
|
hostId = elm.getAttribute(HYDRATE_ID);
|
|
2727
2759
|
if (hostId) {
|
|
2728
|
-
if (
|
|
2729
|
-
const scopeId2 =
|
|
2760
|
+
if (BUILD18.shadowDom && supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
2761
|
+
const scopeId2 = BUILD18.mode ? addStyle(elm.shadowRoot, cmpMeta, elm.getAttribute("s-mode")) : addStyle(elm.shadowRoot, cmpMeta);
|
|
2730
2762
|
elm.classList.remove(scopeId2 + "-h", scopeId2 + "-s");
|
|
2731
|
-
} else if (
|
|
2732
|
-
const scopeId2 = getScopeId(cmpMeta,
|
|
2763
|
+
} else if (BUILD18.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
2764
|
+
const scopeId2 = getScopeId(cmpMeta, BUILD18.mode ? elm.getAttribute("s-mode") : void 0);
|
|
2733
2765
|
elm["s-sc"] = scopeId2;
|
|
2734
2766
|
}
|
|
2735
2767
|
initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
|
|
2736
2768
|
}
|
|
2737
2769
|
}
|
|
2738
|
-
if (
|
|
2739
|
-
if (
|
|
2770
|
+
if (BUILD18.slotRelocation && !hostId) {
|
|
2771
|
+
if (BUILD18.hydrateServerSide || (BUILD18.slot || BUILD18.shadowDom) && // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
|
|
2740
2772
|
cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
|
|
2741
2773
|
setContentReference(elm);
|
|
2742
2774
|
}
|
|
2743
2775
|
}
|
|
2744
|
-
if (
|
|
2776
|
+
if (BUILD18.asyncLoading) {
|
|
2745
2777
|
let ancestorComponent = elm;
|
|
2746
2778
|
while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
|
|
2747
|
-
if (
|
|
2779
|
+
if (BUILD18.hydrateClientSide && ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
|
|
2748
2780
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
|
|
2749
2781
|
break;
|
|
2750
2782
|
}
|
|
2751
2783
|
}
|
|
2752
2784
|
}
|
|
2753
|
-
if (
|
|
2785
|
+
if (BUILD18.prop && !BUILD18.hydrateServerSide && cmpMeta.$members$) {
|
|
2754
2786
|
Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
|
|
2755
2787
|
if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
|
|
2756
2788
|
const value = elm[memberName];
|
|
@@ -2759,7 +2791,7 @@ var connectedCallback = (elm) => {
|
|
|
2759
2791
|
}
|
|
2760
2792
|
});
|
|
2761
2793
|
}
|
|
2762
|
-
if (
|
|
2794
|
+
if (BUILD18.initializeNextTick) {
|
|
2763
2795
|
nextTick(() => initializeComponent(elm, hostRef, cmpMeta));
|
|
2764
2796
|
} else {
|
|
2765
2797
|
initializeComponent(elm, hostRef, cmpMeta);
|
|
@@ -2767,9 +2799,9 @@ var connectedCallback = (elm) => {
|
|
|
2767
2799
|
} else {
|
|
2768
2800
|
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, false);
|
|
2769
2801
|
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
2770
|
-
fireConnectedCallback(hostRef.$lazyInstance
|
|
2802
|
+
fireConnectedCallback(hostRef.$lazyInstance$, elm);
|
|
2771
2803
|
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
2772
|
-
hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance
|
|
2804
|
+
hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$, elm));
|
|
2773
2805
|
}
|
|
2774
2806
|
}
|
|
2775
2807
|
endConnected();
|
|
@@ -2777,37 +2809,37 @@ var connectedCallback = (elm) => {
|
|
|
2777
2809
|
};
|
|
2778
2810
|
var setContentReference = (elm) => {
|
|
2779
2811
|
const contentRefElm = elm["s-cr"] = doc.createComment(
|
|
2780
|
-
|
|
2812
|
+
BUILD18.isDebug ? `content-ref (host=${elm.localName})` : ""
|
|
2781
2813
|
);
|
|
2782
2814
|
contentRefElm["s-cn"] = true;
|
|
2783
2815
|
insertBefore(elm, contentRefElm, elm.firstChild);
|
|
2784
2816
|
};
|
|
2785
2817
|
|
|
2786
2818
|
// src/runtime/disconnected-callback.ts
|
|
2787
|
-
import { BUILD as
|
|
2788
|
-
var disconnectInstance = (instance) => {
|
|
2789
|
-
if (
|
|
2790
|
-
safeCall(instance, "disconnectedCallback");
|
|
2819
|
+
import { BUILD as BUILD19 } from "@stencil/core/internal/app-data";
|
|
2820
|
+
var disconnectInstance = (instance, elm) => {
|
|
2821
|
+
if (BUILD19.lazyLoad && BUILD19.disconnectedCallback) {
|
|
2822
|
+
safeCall(instance, "disconnectedCallback", void 0, elm || instance);
|
|
2791
2823
|
}
|
|
2792
|
-
if (
|
|
2793
|
-
safeCall(instance, "componentDidUnload");
|
|
2824
|
+
if (BUILD19.cmpDidUnload) {
|
|
2825
|
+
safeCall(instance, "componentDidUnload", void 0, elm || instance);
|
|
2794
2826
|
}
|
|
2795
2827
|
};
|
|
2796
2828
|
var disconnectedCallback = async (elm) => {
|
|
2797
2829
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
2798
2830
|
const hostRef = getHostRef(elm);
|
|
2799
|
-
if (
|
|
2831
|
+
if (BUILD19.hostListener) {
|
|
2800
2832
|
if (hostRef.$rmListeners$) {
|
|
2801
2833
|
hostRef.$rmListeners$.map((rmListener) => rmListener());
|
|
2802
2834
|
hostRef.$rmListeners$ = void 0;
|
|
2803
2835
|
}
|
|
2804
2836
|
}
|
|
2805
|
-
if (!
|
|
2837
|
+
if (!BUILD19.lazyLoad) {
|
|
2806
2838
|
disconnectInstance(elm);
|
|
2807
2839
|
} else if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
2808
|
-
disconnectInstance(hostRef.$lazyInstance
|
|
2840
|
+
disconnectInstance(hostRef.$lazyInstance$, elm);
|
|
2809
2841
|
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
2810
|
-
hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance
|
|
2842
|
+
hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$, elm));
|
|
2811
2843
|
}
|
|
2812
2844
|
}
|
|
2813
2845
|
if (rootAppliedStyles.has(elm)) {
|
|
@@ -2827,36 +2859,36 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
2827
2859
|
$flags$: compactMeta[0],
|
|
2828
2860
|
$tagName$: compactMeta[1]
|
|
2829
2861
|
};
|
|
2830
|
-
if (
|
|
2862
|
+
if (BUILD20.member) {
|
|
2831
2863
|
cmpMeta.$members$ = compactMeta[2];
|
|
2832
2864
|
}
|
|
2833
|
-
if (
|
|
2865
|
+
if (BUILD20.hostListener) {
|
|
2834
2866
|
cmpMeta.$listeners$ = compactMeta[3];
|
|
2835
2867
|
}
|
|
2836
|
-
if (
|
|
2868
|
+
if (BUILD20.watchCallback) {
|
|
2837
2869
|
cmpMeta.$watchers$ = Cstr.$watchers$;
|
|
2838
2870
|
}
|
|
2839
|
-
if (
|
|
2871
|
+
if (BUILD20.reflect) {
|
|
2840
2872
|
cmpMeta.$attrsToReflect$ = [];
|
|
2841
2873
|
}
|
|
2842
|
-
if (
|
|
2874
|
+
if (BUILD20.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
2843
2875
|
cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
|
|
2844
2876
|
}
|
|
2845
|
-
if (
|
|
2846
|
-
if (
|
|
2877
|
+
if (BUILD20.experimentalSlotFixes) {
|
|
2878
|
+
if (BUILD20.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
2847
2879
|
patchPseudoShadowDom(Cstr.prototype);
|
|
2848
2880
|
}
|
|
2849
2881
|
} else {
|
|
2850
|
-
if (
|
|
2882
|
+
if (BUILD20.slotChildNodesFix) {
|
|
2851
2883
|
patchChildSlotNodes(Cstr.prototype);
|
|
2852
2884
|
}
|
|
2853
|
-
if (
|
|
2885
|
+
if (BUILD20.cloneNodeFix) {
|
|
2854
2886
|
patchCloneNode(Cstr.prototype);
|
|
2855
2887
|
}
|
|
2856
|
-
if (
|
|
2888
|
+
if (BUILD20.appendChildSlotFix) {
|
|
2857
2889
|
patchSlotAppendChild(Cstr.prototype);
|
|
2858
2890
|
}
|
|
2859
|
-
if (
|
|
2891
|
+
if (BUILD20.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
2860
2892
|
patchTextContent(Cstr.prototype);
|
|
2861
2893
|
}
|
|
2862
2894
|
}
|
|
@@ -2874,13 +2906,13 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
2874
2906
|
this.__hasHostListenerAttached = true;
|
|
2875
2907
|
}
|
|
2876
2908
|
connectedCallback(this);
|
|
2877
|
-
if (
|
|
2909
|
+
if (BUILD20.connectedCallback && originalConnectedCallback) {
|
|
2878
2910
|
originalConnectedCallback.call(this);
|
|
2879
2911
|
}
|
|
2880
2912
|
},
|
|
2881
2913
|
disconnectedCallback() {
|
|
2882
2914
|
disconnectedCallback(this);
|
|
2883
|
-
if (
|
|
2915
|
+
if (BUILD20.disconnectedCallback && originalDisconnectedCallback) {
|
|
2884
2916
|
originalDisconnectedCallback.call(this);
|
|
2885
2917
|
}
|
|
2886
2918
|
plt.raf(() => {
|
|
@@ -2897,7 +2929,7 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
2897
2929
|
__attachShadow() {
|
|
2898
2930
|
if (supportsShadow) {
|
|
2899
2931
|
if (!this.shadowRoot) {
|
|
2900
|
-
if (
|
|
2932
|
+
if (BUILD20.shadowDelegatesFocus) {
|
|
2901
2933
|
this.attachShadow({
|
|
2902
2934
|
mode: "open",
|
|
2903
2935
|
delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
|
|
@@ -2921,7 +2953,7 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
2921
2953
|
return proxyComponent(Cstr, cmpMeta, 1 /* isElementConstructor */ | 2 /* proxyState */);
|
|
2922
2954
|
};
|
|
2923
2955
|
var forceModeUpdate = (elm) => {
|
|
2924
|
-
if (
|
|
2956
|
+
if (BUILD20.style && BUILD20.mode && !BUILD20.lazyLoad) {
|
|
2925
2957
|
const mode = computeMode(elm);
|
|
2926
2958
|
const hostRef = getHostRef(elm);
|
|
2927
2959
|
if (hostRef.$modeName$ !== mode) {
|
|
@@ -2944,7 +2976,7 @@ var forceModeUpdate = (elm) => {
|
|
|
2944
2976
|
};
|
|
2945
2977
|
|
|
2946
2978
|
// src/runtime/bootstrap-lazy.ts
|
|
2947
|
-
import { BUILD as
|
|
2979
|
+
import { BUILD as BUILD21 } from "@stencil/core/internal/app-data";
|
|
2948
2980
|
|
|
2949
2981
|
// src/runtime/hmr-component.ts
|
|
2950
2982
|
var hmrStart = (hostElement, cmpMeta, hmrVersionId) => {
|
|
@@ -2956,7 +2988,7 @@ var hmrStart = (hostElement, cmpMeta, hmrVersionId) => {
|
|
|
2956
2988
|
// src/runtime/bootstrap-lazy.ts
|
|
2957
2989
|
var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
2958
2990
|
var _a;
|
|
2959
|
-
if (
|
|
2991
|
+
if (BUILD21.profile && performance.mark) {
|
|
2960
2992
|
performance.mark("st:app:start");
|
|
2961
2993
|
}
|
|
2962
2994
|
installDevTools();
|
|
@@ -2972,12 +3004,12 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2972
3004
|
let isBootstrapping = true;
|
|
2973
3005
|
Object.assign(plt, options);
|
|
2974
3006
|
plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", doc.baseURI).href;
|
|
2975
|
-
if (
|
|
3007
|
+
if (BUILD21.asyncQueue) {
|
|
2976
3008
|
if (options.syncQueue) {
|
|
2977
3009
|
plt.$flags$ |= 4 /* queueSync */;
|
|
2978
3010
|
}
|
|
2979
3011
|
}
|
|
2980
|
-
if (
|
|
3012
|
+
if (BUILD21.hydrateClientSide) {
|
|
2981
3013
|
plt.$flags$ |= 2 /* appLoaded */;
|
|
2982
3014
|
}
|
|
2983
3015
|
let hasSlotRelocation = false;
|
|
@@ -2993,22 +3025,22 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2993
3025
|
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
|
|
2994
3026
|
hasSlotRelocation = true;
|
|
2995
3027
|
}
|
|
2996
|
-
if (
|
|
3028
|
+
if (BUILD21.member) {
|
|
2997
3029
|
cmpMeta.$members$ = compactMeta[2];
|
|
2998
3030
|
}
|
|
2999
|
-
if (
|
|
3031
|
+
if (BUILD21.hostListener) {
|
|
3000
3032
|
cmpMeta.$listeners$ = compactMeta[3];
|
|
3001
3033
|
}
|
|
3002
|
-
if (
|
|
3034
|
+
if (BUILD21.reflect) {
|
|
3003
3035
|
cmpMeta.$attrsToReflect$ = [];
|
|
3004
3036
|
}
|
|
3005
|
-
if (
|
|
3037
|
+
if (BUILD21.watchCallback) {
|
|
3006
3038
|
cmpMeta.$watchers$ = (_a2 = compactMeta[4]) != null ? _a2 : {};
|
|
3007
3039
|
}
|
|
3008
|
-
if (
|
|
3040
|
+
if (BUILD21.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
3009
3041
|
cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
|
|
3010
3042
|
}
|
|
3011
|
-
const tagName =
|
|
3043
|
+
const tagName = BUILD21.transformTagName && options.transformTagName ? options.transformTagName(cmpMeta.$tagName$) : cmpMeta.$tagName$;
|
|
3012
3044
|
const HostElement = class extends HTMLElement {
|
|
3013
3045
|
// StencilLazyHost
|
|
3014
3046
|
constructor(self) {
|
|
@@ -3016,10 +3048,10 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3016
3048
|
this.hasRegisteredEventListeners = false;
|
|
3017
3049
|
self = this;
|
|
3018
3050
|
registerHost(self, cmpMeta);
|
|
3019
|
-
if (
|
|
3051
|
+
if (BUILD21.shadowDom && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
3020
3052
|
if (supportsShadow) {
|
|
3021
3053
|
if (!self.shadowRoot) {
|
|
3022
|
-
if (
|
|
3054
|
+
if (BUILD21.shadowDelegatesFocus) {
|
|
3023
3055
|
self.attachShadow({
|
|
3024
3056
|
mode: "open",
|
|
3025
3057
|
delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
|
|
@@ -3034,7 +3066,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3034
3066
|
);
|
|
3035
3067
|
}
|
|
3036
3068
|
}
|
|
3037
|
-
} else if (!
|
|
3069
|
+
} else if (!BUILD21.hydrateServerSide && !("shadowRoot" in self)) {
|
|
3038
3070
|
self.shadowRoot = self;
|
|
3039
3071
|
}
|
|
3040
3072
|
}
|
|
@@ -3069,28 +3101,28 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3069
3101
|
return getHostRef(this).$onReadyPromise$;
|
|
3070
3102
|
}
|
|
3071
3103
|
};
|
|
3072
|
-
if (
|
|
3073
|
-
if (
|
|
3104
|
+
if (BUILD21.experimentalSlotFixes) {
|
|
3105
|
+
if (BUILD21.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
3074
3106
|
patchPseudoShadowDom(HostElement.prototype);
|
|
3075
3107
|
}
|
|
3076
3108
|
} else {
|
|
3077
|
-
if (
|
|
3109
|
+
if (BUILD21.slotChildNodesFix) {
|
|
3078
3110
|
patchChildSlotNodes(HostElement.prototype);
|
|
3079
3111
|
}
|
|
3080
|
-
if (
|
|
3112
|
+
if (BUILD21.cloneNodeFix) {
|
|
3081
3113
|
patchCloneNode(HostElement.prototype);
|
|
3082
3114
|
}
|
|
3083
|
-
if (
|
|
3115
|
+
if (BUILD21.appendChildSlotFix) {
|
|
3084
3116
|
patchSlotAppendChild(HostElement.prototype);
|
|
3085
3117
|
}
|
|
3086
|
-
if (
|
|
3118
|
+
if (BUILD21.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
3087
3119
|
patchTextContent(HostElement.prototype);
|
|
3088
3120
|
}
|
|
3089
3121
|
}
|
|
3090
|
-
if (
|
|
3122
|
+
if (BUILD21.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */) {
|
|
3091
3123
|
HostElement.formAssociated = true;
|
|
3092
3124
|
}
|
|
3093
|
-
if (
|
|
3125
|
+
if (BUILD21.hotModuleReplacement) {
|
|
3094
3126
|
HostElement.prototype["s-hmr"] = function(hmrVersionId) {
|
|
3095
3127
|
hmrStart(this, cmpMeta, hmrVersionId);
|
|
3096
3128
|
};
|
|
@@ -3109,7 +3141,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3109
3141
|
if (hasSlotRelocation) {
|
|
3110
3142
|
dataStyles.textContent += SLOT_FB_CSS;
|
|
3111
3143
|
}
|
|
3112
|
-
if (
|
|
3144
|
+
if (BUILD21.invisiblePrehydration && (BUILD21.hydratedClass || BUILD21.hydratedAttribute)) {
|
|
3113
3145
|
dataStyles.textContent += cmpTags.sort() + HYDRATED_CSS;
|
|
3114
3146
|
}
|
|
3115
3147
|
if (dataStyles.innerHTML.length) {
|
|
@@ -3125,7 +3157,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3125
3157
|
if (deferredConnectedCallbacks.length) {
|
|
3126
3158
|
deferredConnectedCallbacks.map((host) => host.connectedCallback());
|
|
3127
3159
|
} else {
|
|
3128
|
-
if (
|
|
3160
|
+
if (BUILD21.profile) {
|
|
3129
3161
|
plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30, "timeout"));
|
|
3130
3162
|
} else {
|
|
3131
3163
|
plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30));
|
|
@@ -3138,10 +3170,10 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3138
3170
|
var Fragment = (_, children) => children;
|
|
3139
3171
|
|
|
3140
3172
|
// src/runtime/host-listener.ts
|
|
3141
|
-
import { BUILD as
|
|
3173
|
+
import { BUILD as BUILD22 } from "@stencil/core/internal/app-data";
|
|
3142
3174
|
var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
3143
|
-
if (
|
|
3144
|
-
if (
|
|
3175
|
+
if (BUILD22.hostListener && listeners) {
|
|
3176
|
+
if (BUILD22.hostListenerTargetParent) {
|
|
3145
3177
|
if (attachParentListeners) {
|
|
3146
3178
|
listeners = listeners.filter(([flags]) => flags & 32 /* TargetParent */);
|
|
3147
3179
|
} else {
|
|
@@ -3149,7 +3181,7 @@ var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) =>
|
|
|
3149
3181
|
}
|
|
3150
3182
|
}
|
|
3151
3183
|
listeners.map(([flags, name, method]) => {
|
|
3152
|
-
const target =
|
|
3184
|
+
const target = BUILD22.hostListenerTarget ? getHostListenerTarget(elm, flags) : elm;
|
|
3153
3185
|
const handler = hostListenerProxy(hostRef, method);
|
|
3154
3186
|
const opts = hostListenerOpts(flags);
|
|
3155
3187
|
plt.ael(target, name, handler, opts);
|
|
@@ -3160,7 +3192,7 @@ var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) =>
|
|
|
3160
3192
|
var hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
3161
3193
|
var _a;
|
|
3162
3194
|
try {
|
|
3163
|
-
if (
|
|
3195
|
+
if (BUILD22.lazyLoad) {
|
|
3164
3196
|
if (hostRef.$flags$ & 256 /* isListenReady */) {
|
|
3165
3197
|
(_a = hostRef.$lazyInstance$) == null ? void 0 : _a[methodName](ev);
|
|
3166
3198
|
} else {
|
|
@@ -3170,14 +3202,14 @@ var hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
|
3170
3202
|
hostRef.$hostElement$[methodName](ev);
|
|
3171
3203
|
}
|
|
3172
3204
|
} catch (e) {
|
|
3173
|
-
consoleError(e);
|
|
3205
|
+
consoleError(e, hostRef.$hostElement$);
|
|
3174
3206
|
}
|
|
3175
3207
|
};
|
|
3176
3208
|
var getHostListenerTarget = (elm, flags) => {
|
|
3177
|
-
if (
|
|
3178
|
-
if (
|
|
3179
|
-
if (
|
|
3180
|
-
if (
|
|
3209
|
+
if (BUILD22.hostListenerTargetDocument && flags & 4 /* TargetDocument */) return doc;
|
|
3210
|
+
if (BUILD22.hostListenerTargetWindow && flags & 8 /* TargetWindow */) return win;
|
|
3211
|
+
if (BUILD22.hostListenerTargetBody && flags & 16 /* TargetBody */) return doc.body;
|
|
3212
|
+
if (BUILD22.hostListenerTargetParent && flags & 32 /* TargetParent */ && elm.parentElement)
|
|
3181
3213
|
return elm.parentElement;
|
|
3182
3214
|
return elm;
|
|
3183
3215
|
};
|
|
@@ -3355,7 +3387,7 @@ var hAsync = (nodeName, vnodeData, ...children) => {
|
|
|
3355
3387
|
import { globalScripts } from "@stencil/core/internal/app-globals";
|
|
3356
3388
|
|
|
3357
3389
|
// src/hydrate/platform/proxy-host-element.ts
|
|
3358
|
-
import { BUILD as
|
|
3390
|
+
import { BUILD as BUILD23 } from "@stencil/core/internal/app-data";
|
|
3359
3391
|
function proxyHostElement(elm, cstr) {
|
|
3360
3392
|
const cmpMeta = cstr.cmpMeta;
|
|
3361
3393
|
if (typeof elm.componentOnReady !== "function") {
|
|
@@ -3365,7 +3397,7 @@ function proxyHostElement(elm, cstr) {
|
|
|
3365
3397
|
elm.forceUpdate = forceUpdate2;
|
|
3366
3398
|
}
|
|
3367
3399
|
if (!elm.shadowRoot && !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
|
|
3368
|
-
if (
|
|
3400
|
+
if (BUILD23.shadowDelegatesFocus) {
|
|
3369
3401
|
elm.attachShadow({
|
|
3370
3402
|
mode: "open",
|
|
3371
3403
|
delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
|
|
@@ -3378,12 +3410,8 @@ function proxyHostElement(elm, cstr) {
|
|
|
3378
3410
|
const hostRef = getHostRef(elm);
|
|
3379
3411
|
const members = Object.entries(cmpMeta.$members$);
|
|
3380
3412
|
members.forEach(([memberName, [memberFlags, metaAttributeName]]) => {
|
|
3381
|
-
var _a
|
|
3413
|
+
var _a;
|
|
3382
3414
|
if (memberFlags & 31 /* Prop */) {
|
|
3383
|
-
let getter2 = function() {
|
|
3384
|
-
return ![void 0, null].includes(parsedAttrValue) ? parsedAttrValue : origGetter ? origGetter.apply(this) : getValue(this, memberName);
|
|
3385
|
-
};
|
|
3386
|
-
var getter = getter2;
|
|
3387
3415
|
const attributeName = metaAttributeName || memberName;
|
|
3388
3416
|
let attrValue = elm.getAttribute(attributeName);
|
|
3389
3417
|
if ((attrValue == null ? void 0 : attrValue.startsWith("{")) && attrValue.endsWith("}") || (attrValue == null ? void 0 : attrValue.startsWith("[")) && attrValue.endsWith("]")) {
|
|
@@ -3393,22 +3421,26 @@ function proxyHostElement(elm, cstr) {
|
|
|
3393
3421
|
}
|
|
3394
3422
|
}
|
|
3395
3423
|
const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(cstr.prototype, memberName) || {};
|
|
3396
|
-
let
|
|
3424
|
+
let attrPropVal;
|
|
3397
3425
|
if (attrValue != null) {
|
|
3398
|
-
|
|
3399
|
-
if (origSetter) {
|
|
3400
|
-
origSetter.apply(elm, [parsedAttrValue]);
|
|
3401
|
-
parsedAttrValue = origGetter ? origGetter.apply(elm) : parsedAttrValue;
|
|
3402
|
-
}
|
|
3403
|
-
(_a = hostRef == null ? void 0 : hostRef.$instanceValues$) == null ? void 0 : _a.set(memberName, parsedAttrValue);
|
|
3426
|
+
attrPropVal = parsePropertyValue(attrValue, memberFlags);
|
|
3404
3427
|
}
|
|
3405
3428
|
const ownValue = elm[memberName];
|
|
3406
3429
|
if (ownValue !== void 0) {
|
|
3407
|
-
|
|
3430
|
+
attrPropVal = ownValue;
|
|
3408
3431
|
delete elm[memberName];
|
|
3409
3432
|
}
|
|
3433
|
+
if (attrPropVal !== void 0) {
|
|
3434
|
+
if (origSetter) {
|
|
3435
|
+
origSetter.apply(elm, [attrPropVal]);
|
|
3436
|
+
attrPropVal = origGetter ? origGetter.apply(elm) : attrPropVal;
|
|
3437
|
+
}
|
|
3438
|
+
(_a = hostRef == null ? void 0 : hostRef.$instanceValues$) == null ? void 0 : _a.set(memberName, attrPropVal);
|
|
3439
|
+
}
|
|
3410
3440
|
Object.defineProperty(elm, memberName, {
|
|
3411
|
-
get:
|
|
3441
|
+
get: function() {
|
|
3442
|
+
return getValue(this, memberName);
|
|
3443
|
+
},
|
|
3412
3444
|
set(newValue) {
|
|
3413
3445
|
setValue(this, memberName, newValue, cmpMeta);
|
|
3414
3446
|
},
|
|
@@ -3416,7 +3448,12 @@ function proxyHostElement(elm, cstr) {
|
|
|
3416
3448
|
enumerable: true
|
|
3417
3449
|
});
|
|
3418
3450
|
Object.defineProperty(cstr.prototype, memberName, {
|
|
3419
|
-
get:
|
|
3451
|
+
get: function() {
|
|
3452
|
+
if (origGetter && attrPropVal === void 0 && !getValue(this, memberName)) {
|
|
3453
|
+
setValue(this, memberName, origGetter.apply(this), cmpMeta);
|
|
3454
|
+
}
|
|
3455
|
+
return attrPropVal !== void 0 ? attrPropVal : origGetter ? origGetter.apply(this) : getValue(this, memberName);
|
|
3456
|
+
},
|
|
3420
3457
|
configurable: true,
|
|
3421
3458
|
enumerable: true
|
|
3422
3459
|
});
|
|
@@ -3428,7 +3465,9 @@ function proxyHostElement(elm, cstr) {
|
|
|
3428
3465
|
return (_a2 = ref == null ? void 0 : ref.$onInstancePromise$) == null ? void 0 : _a2.then(() => {
|
|
3429
3466
|
var _a3;
|
|
3430
3467
|
return (_a3 = ref == null ? void 0 : ref.$lazyInstance$) == null ? void 0 : _a3[memberName](...args);
|
|
3431
|
-
}).catch(
|
|
3468
|
+
}).catch((e) => {
|
|
3469
|
+
consoleError(e, this);
|
|
3470
|
+
});
|
|
3432
3471
|
}
|
|
3433
3472
|
});
|
|
3434
3473
|
}
|
|
@@ -3691,7 +3730,7 @@ function waitingOnElementsMsg(waitingElements) {
|
|
|
3691
3730
|
}
|
|
3692
3731
|
|
|
3693
3732
|
// src/hydrate/platform/index.ts
|
|
3694
|
-
import { BUILD as
|
|
3733
|
+
import { BUILD as BUILD25, Env, NAMESPACE as NAMESPACE2 } from "@stencil/core/internal/app-data";
|
|
3695
3734
|
var customError;
|
|
3696
3735
|
var cmpModules = /* @__PURE__ */ new Map();
|
|
3697
3736
|
var getModule = (tagName) => {
|
|
@@ -3777,13 +3816,19 @@ var plt = {
|
|
|
3777
3816
|
var setPlatformHelpers = (helpers) => {
|
|
3778
3817
|
Object.assign(plt, helpers);
|
|
3779
3818
|
};
|
|
3780
|
-
var supportsShadow =
|
|
3819
|
+
var supportsShadow = BUILD24.shadowDom;
|
|
3781
3820
|
var supportsListenerOptions = false;
|
|
3782
3821
|
var supportsConstructableStylesheets = false;
|
|
3783
3822
|
var hostRefs = /* @__PURE__ */ new WeakMap();
|
|
3784
3823
|
var getHostRef = (ref) => hostRefs.get(ref);
|
|
3785
3824
|
var deleteHostRef = (ref) => hostRefs.delete(ref);
|
|
3786
|
-
var registerInstance = (lazyInstance, hostRef) =>
|
|
3825
|
+
var registerInstance = (lazyInstance, hostRef) => {
|
|
3826
|
+
const ref = hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
|
|
3827
|
+
if (BUILD24.modernPropertyDecls && (BUILD24.state || BUILD24.prop)) {
|
|
3828
|
+
reWireGetterSetter(lazyInstance, hostRef);
|
|
3829
|
+
}
|
|
3830
|
+
return ref;
|
|
3831
|
+
};
|
|
3787
3832
|
var registerHost = (elm, cmpMeta) => {
|
|
3788
3833
|
const hostRef = {
|
|
3789
3834
|
$flags$: 0,
|
|
@@ -3807,7 +3852,7 @@ var Build = {
|
|
|
3807
3852
|
var styles = /* @__PURE__ */ new Map();
|
|
3808
3853
|
var modeResolutionChain = [];
|
|
3809
3854
|
export {
|
|
3810
|
-
|
|
3855
|
+
BUILD25 as BUILD,
|
|
3811
3856
|
Build,
|
|
3812
3857
|
Env,
|
|
3813
3858
|
Fragment,
|