@mmlogic/components 0.5.1 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/cell-renderer-7KX9Qbml.js +983 -0
- package/dist/cjs/{client-layout-RZ3Ix-4a.js → client-layout-CqVuJumR.js} +9 -0
- package/dist/cjs/{index-DzRfoAPz.js → index-DVbdkYO3.js} +468 -6
- package/dist/cjs/index.cjs.js +4 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/mosterdcomponents.cjs.js +2 -2
- package/dist/cjs/{mrd-boolean-field_23.cjs.entry.js → mrd-boolean-field_25.cjs.entry.js} +3017 -951
- package/dist/cjs/mrd-merge-view.cjs.entry.js +273 -0
- package/dist/collection/collection-manifest.json +3 -0
- package/dist/collection/components/documents/mrd-document-view/mrd-document-view.js +7 -8
- package/dist/collection/components/email/mrd-email-view/mrd-email-view.css +126 -0
- package/dist/collection/components/email/mrd-email-view/mrd-email-view.js +247 -0
- package/dist/collection/components/fields/file-upload-common.js +23 -7
- package/dist/collection/components/fields/mrd-boolean-field/mrd-boolean-field.js +1 -1
- package/dist/collection/components/fields/mrd-currency-field/mrd-currency-field.js +1 -1
- package/dist/collection/components/fields/mrd-date-field/mrd-date-field.js +1 -1
- package/dist/collection/components/fields/mrd-datetime-field/mrd-datetime-field.js +1 -1
- package/dist/collection/components/fields/mrd-email-field/mrd-email-field.js +1 -1
- package/dist/collection/components/fields/mrd-file-field/mrd-file-field.css +20 -1
- package/dist/collection/components/fields/mrd-file-field/mrd-file-field.js +108 -47
- package/dist/collection/components/fields/mrd-image-field/mrd-image-field.css +44 -0
- package/dist/collection/components/fields/mrd-image-field/mrd-image-field.js +126 -58
- package/dist/collection/components/fields/mrd-longtext-field/mrd-longtext-field.js +1 -1
- package/dist/collection/components/fields/mrd-number-field/mrd-number-field.js +1 -1
- package/dist/collection/components/fields/mrd-secret-field/mrd-secret-field.js +2 -2
- package/dist/collection/components/fields/mrd-text-field/mrd-text-field.js +1 -1
- package/dist/collection/components/fields/mrd-textarea-field/mrd-textarea-field.js +9 -5
- package/dist/collection/components/fields/mrd-time-field/mrd-time-field.js +1 -1
- package/dist/collection/components/form/mrd-field/mrd-field.js +5 -5
- package/dist/collection/components/form/mrd-form/mrd-form.js +55 -6
- package/dist/collection/components/invoice/mrd-invoice-view/mrd-invoice-view.css +145 -0
- package/dist/collection/components/invoice/mrd-invoice-view/mrd-invoice-view.js +281 -0
- package/dist/collection/components/layout/mrd-layout-section/field-value.js +5 -1
- package/dist/collection/components/layout/mrd-layout-section/mrd-layout-section.css +10 -0
- package/dist/collection/components/layout/mrd-layout-section/mrd-layout-section.js +38 -8
- package/dist/collection/components/merge/mrd-merge-view/merge-diff.js +99 -0
- package/dist/collection/components/merge/mrd-merge-view/merge-parts.js +44 -0
- package/dist/collection/components/merge/mrd-merge-view/mrd-merge-view.css +244 -0
- package/dist/collection/components/merge/mrd-merge-view/mrd-merge-view.js +397 -0
- package/dist/collection/dev/api.js +41 -2
- package/dist/collection/dev/app.js +135 -17
- package/dist/collection/dev/example-data.js +126 -2
- package/dist/collection/types/client-layout.js +6 -0
- package/dist/collection/utils/cell-renderer.js +6 -1
- package/dist/collection/utils/document-attachments.js +27 -14
- package/dist/collection/utils/i18n.js +224 -0
- package/dist/components/cell-renderer.js +1 -0
- package/dist/components/client-layout.js +1 -1
- package/dist/components/document-attachments.js +1 -1
- package/dist/components/file-upload-common.js +1 -1
- package/dist/components/format.js +1 -1
- package/dist/components/i18n.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/mrd-boolean-field2.js +1 -1
- package/dist/components/mrd-currency-field2.js +1 -1
- package/dist/components/mrd-date-field2.js +1 -1
- package/dist/components/mrd-datetime-field2.js +1 -1
- package/dist/components/mrd-document-view2.js +1 -1
- package/dist/components/mrd-email-field2.js +1 -1
- package/dist/components/mrd-email-view.d.ts +11 -0
- package/dist/components/mrd-email-view.js +1 -0
- package/dist/components/mrd-email-view2.js +1 -0
- package/dist/components/mrd-field2.js +1 -1
- package/dist/components/mrd-file-field2.js +1 -1
- package/dist/components/mrd-form.js +1 -1
- package/dist/components/mrd-image-field2.js +1 -1
- package/dist/components/mrd-invoice-view.d.ts +11 -0
- package/dist/components/mrd-invoice-view.js +1 -0
- package/dist/components/mrd-invoice-view2.js +1 -0
- package/dist/components/mrd-layout-section.js +1 -1
- package/dist/components/mrd-longtext-field2.js +1 -1
- package/dist/components/mrd-merge-view.d.ts +11 -0
- package/dist/components/mrd-merge-view.js +1 -0
- package/dist/components/mrd-number-field2.js +1 -1
- package/dist/components/mrd-secret-field2.js +1 -1
- package/dist/components/mrd-table2.js +1 -1
- package/dist/components/mrd-text-field2.js +1 -1
- package/dist/components/mrd-textarea-field2.js +1 -1
- package/dist/components/mrd-time-field2.js +1 -1
- package/dist/components/purify.es.js +2 -0
- package/dist/esm/cell-renderer-DIsNX9D7.js +974 -0
- package/dist/esm/{client-layout-DCOAAH92.js → client-layout-Bc42CfJB.js} +7 -1
- package/dist/esm/{index-DiSe6vjv.js → index-CDiBvvJU.js} +468 -6
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/mosterdcomponents.js +3 -3
- package/dist/esm/{mrd-boolean-field_23.entry.js → mrd-boolean-field_25.entry.js} +2949 -885
- package/dist/esm/mrd-merge-view.entry.js +271 -0
- package/dist/mosterdcomponents/index.esm.js +1 -1
- package/dist/mosterdcomponents/mosterdcomponents.esm.js +1 -1
- package/dist/mosterdcomponents/p-4e061416.entry.js +1 -0
- package/dist/mosterdcomponents/p-910ebfee.entry.js +3 -0
- package/dist/mosterdcomponents/{p-DCOAAH92.js → p-Bc42CfJB.js} +1 -1
- package/dist/mosterdcomponents/p-CDiBvvJU.js +2 -0
- package/dist/mosterdcomponents/p-Ce2QDq0t.js +1 -0
- package/dist/types/components/documents/mrd-document-view/mrd-document-view.d.ts +2 -2
- package/dist/types/components/email/mrd-email-view/mrd-email-view.d.ts +52 -0
- package/dist/types/components/fields/file-upload-common.d.ts +19 -1
- package/dist/types/components/fields/mrd-file-field/mrd-file-field.d.ts +24 -10
- package/dist/types/components/fields/mrd-image-field/mrd-image-field.d.ts +27 -11
- package/dist/types/components/fields/mrd-textarea-field/mrd-textarea-field.d.ts +1 -0
- package/dist/types/components/form/mrd-form/mrd-form.d.ts +16 -1
- package/dist/types/components/invoice/mrd-invoice-view/mrd-invoice-view.d.ts +60 -0
- package/dist/types/components/layout/mrd-layout-section/mrd-layout-section.d.ts +13 -0
- package/dist/types/components/merge/mrd-merge-view/merge-diff.d.ts +43 -0
- package/dist/types/components/merge/mrd-merge-view/merge-parts.d.ts +37 -0
- package/dist/types/components/merge/mrd-merge-view/mrd-merge-view.d.ts +68 -0
- package/dist/types/components.d.ts +445 -19
- package/dist/types/types/client-layout.d.ts +6 -0
- package/dist/types/utils/document-attachments.d.ts +12 -5
- package/package.json +2 -1
- package/dist/mosterdcomponents/p-DiSe6vjv.js +0 -2
- package/dist/mosterdcomponents/p-cdecc698.entry.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const NAMESPACE = 'mosterdcomponents';
|
|
4
|
-
const BUILD = /* mosterdcomponents */ { hotModuleReplacement: false, hydratedSelectorName: "hydrated", lazyLoad: true, propChangeCallback: true, state: true, updatable: true};
|
|
4
|
+
const BUILD = /* mosterdcomponents */ { hotModuleReplacement: false, hydratedSelectorName: "hydrated", lazyLoad: true, propChangeCallback: true, shadowDom: false, slotRelocation: true, state: true, updatable: true};
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
Stencil Client Platform v4.43.5 | MIT Licensed | https://stenciljs.com
|
|
@@ -141,6 +141,7 @@ var plt = {
|
|
|
141
141
|
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
142
142
|
ce: (eventName, opts) => new CustomEvent(eventName, opts)
|
|
143
143
|
};
|
|
144
|
+
var supportsShadow = BUILD.shadowDom;
|
|
144
145
|
var promiseResolve = (v) => Promise.resolve(v);
|
|
145
146
|
var supportsConstructableStylesheets = /* @__PURE__ */ (() => {
|
|
146
147
|
try {
|
|
@@ -189,6 +190,125 @@ var flush = () => {
|
|
|
189
190
|
};
|
|
190
191
|
var nextTick = (cb) => promiseResolve().then(cb);
|
|
191
192
|
var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
|
|
193
|
+
var updateFallbackSlotVisibility = (elm) => {
|
|
194
|
+
const childNodes = internalCall(elm, "childNodes");
|
|
195
|
+
if (elm.tagName && elm.tagName.includes("-") && elm["s-cr"] && elm.tagName !== "SLOT-FB") {
|
|
196
|
+
getHostSlotNodes(childNodes, elm.tagName).forEach((slotNode) => {
|
|
197
|
+
if (slotNode.nodeType === 1 /* ElementNode */ && slotNode.tagName === "SLOT-FB") {
|
|
198
|
+
if (getSlotChildSiblings(slotNode, getSlotName(slotNode), false).length) {
|
|
199
|
+
slotNode.hidden = true;
|
|
200
|
+
} else {
|
|
201
|
+
slotNode.hidden = false;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
let i2 = 0;
|
|
207
|
+
for (i2 = 0; i2 < childNodes.length; i2++) {
|
|
208
|
+
const childNode = childNodes[i2];
|
|
209
|
+
if (childNode.nodeType === 1 /* ElementNode */ && internalCall(childNode, "childNodes").length) {
|
|
210
|
+
updateFallbackSlotVisibility(childNode);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
var getSlottedChildNodes = (childNodes) => {
|
|
215
|
+
const result = [];
|
|
216
|
+
for (let i2 = 0; i2 < childNodes.length; i2++) {
|
|
217
|
+
const slottedNode = childNodes[i2]["s-nr"] || void 0;
|
|
218
|
+
if (slottedNode && slottedNode.isConnected) {
|
|
219
|
+
result.push(slottedNode);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
return result;
|
|
223
|
+
};
|
|
224
|
+
function getHostSlotNodes(childNodes, hostName, slotName) {
|
|
225
|
+
let i2 = 0;
|
|
226
|
+
let slottedNodes = [];
|
|
227
|
+
let childNode;
|
|
228
|
+
for (; i2 < childNodes.length; i2++) {
|
|
229
|
+
childNode = childNodes[i2];
|
|
230
|
+
if (childNode["s-sr"] && (!hostName || childNode["s-hn"] === hostName) && (slotName === void 0 || getSlotName(childNode) === slotName)) {
|
|
231
|
+
slottedNodes.push(childNode);
|
|
232
|
+
if (typeof slotName !== "undefined") return slottedNodes;
|
|
233
|
+
}
|
|
234
|
+
slottedNodes = [...slottedNodes, ...getHostSlotNodes(childNode.childNodes, hostName, slotName)];
|
|
235
|
+
}
|
|
236
|
+
return slottedNodes;
|
|
237
|
+
}
|
|
238
|
+
var getSlotChildSiblings = (slot, slotName, includeSlot = true) => {
|
|
239
|
+
const childNodes = [];
|
|
240
|
+
if (includeSlot && slot["s-sr"] || !slot["s-sr"]) childNodes.push(slot);
|
|
241
|
+
let node = slot;
|
|
242
|
+
while (node = node.nextSibling) {
|
|
243
|
+
if (getSlotName(node) === slotName && (includeSlot || !node["s-sr"])) childNodes.push(node);
|
|
244
|
+
}
|
|
245
|
+
return childNodes;
|
|
246
|
+
};
|
|
247
|
+
var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
|
|
248
|
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
249
|
+
if (nodeToRelocate.getAttribute("slot") === null && slotName === "") {
|
|
250
|
+
return true;
|
|
251
|
+
}
|
|
252
|
+
if (nodeToRelocate.getAttribute("slot") === slotName) {
|
|
253
|
+
return true;
|
|
254
|
+
}
|
|
255
|
+
return false;
|
|
256
|
+
}
|
|
257
|
+
if (nodeToRelocate["s-sn"] === slotName) {
|
|
258
|
+
return true;
|
|
259
|
+
}
|
|
260
|
+
return slotName === "";
|
|
261
|
+
};
|
|
262
|
+
var getSlotName = (node) => typeof node["s-sn"] === "string" ? node["s-sn"] : node.nodeType === 1 && node.getAttribute("slot") || void 0;
|
|
263
|
+
function patchSlotNode(node) {
|
|
264
|
+
if (node.assignedElements || node.assignedNodes || !node["s-sr"]) return;
|
|
265
|
+
const assignedFactory = (elementsOnly) => (function(opts) {
|
|
266
|
+
const toReturn = [];
|
|
267
|
+
const slotName = this["s-sn"];
|
|
268
|
+
if (opts == null ? void 0 : opts.flatten) {
|
|
269
|
+
console.error(`
|
|
270
|
+
Flattening is not supported for Stencil non-shadow slots.
|
|
271
|
+
You can use \`.childNodes\` to nested slot fallback content.
|
|
272
|
+
If you have a particular use case, please open an issue on the Stencil repo.
|
|
273
|
+
`);
|
|
274
|
+
}
|
|
275
|
+
const parent = this["s-cr"].parentElement;
|
|
276
|
+
const slottedNodes = parent.__childNodes ? parent.childNodes : getSlottedChildNodes(parent.childNodes);
|
|
277
|
+
slottedNodes.forEach((n) => {
|
|
278
|
+
if (slotName === getSlotName(n)) {
|
|
279
|
+
toReturn.push(n);
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
if (elementsOnly) {
|
|
283
|
+
return toReturn.filter((n) => n.nodeType === 1 /* ElementNode */);
|
|
284
|
+
}
|
|
285
|
+
return toReturn;
|
|
286
|
+
}).bind(node);
|
|
287
|
+
node.assignedElements = assignedFactory(true);
|
|
288
|
+
node.assignedNodes = assignedFactory(false);
|
|
289
|
+
}
|
|
290
|
+
function dispatchSlotChangeEvent(elm) {
|
|
291
|
+
elm.dispatchEvent(new CustomEvent("slotchange", { bubbles: false, cancelable: false, composed: false }));
|
|
292
|
+
}
|
|
293
|
+
function findSlotFromSlottedNode(slottedNode, parentHost) {
|
|
294
|
+
var _a;
|
|
295
|
+
parentHost = parentHost || ((_a = slottedNode["s-ol"]) == null ? void 0 : _a.parentElement);
|
|
296
|
+
if (!parentHost) return { slotNode: null, slotName: "" };
|
|
297
|
+
const slotName = slottedNode["s-sn"] = getSlotName(slottedNode) || "";
|
|
298
|
+
const childNodes = internalCall(parentHost, "childNodes");
|
|
299
|
+
const slotNode = getHostSlotNodes(childNodes, parentHost.tagName, slotName)[0];
|
|
300
|
+
return { slotNode, slotName };
|
|
301
|
+
}
|
|
302
|
+
function internalCall(node, method) {
|
|
303
|
+
if ("__" + method in node) {
|
|
304
|
+
const toReturn = node["__" + method];
|
|
305
|
+
if (typeof toReturn !== "function") return toReturn;
|
|
306
|
+
return toReturn.bind(node);
|
|
307
|
+
} else {
|
|
308
|
+
if (typeof node[method] !== "function") return node[method];
|
|
309
|
+
return node[method].bind(node);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
192
312
|
var createTime = (fnName, tagName = "") => {
|
|
193
313
|
{
|
|
194
314
|
return () => {
|
|
@@ -346,6 +466,7 @@ var h = (nodeName, vnodeData, ...children) => {
|
|
|
346
466
|
}
|
|
347
467
|
let child = null;
|
|
348
468
|
let key = null;
|
|
469
|
+
let slotName = null;
|
|
349
470
|
let simple = false;
|
|
350
471
|
let lastSimple = false;
|
|
351
472
|
const vNodeChildren = [];
|
|
@@ -372,6 +493,9 @@ var h = (nodeName, vnodeData, ...children) => {
|
|
|
372
493
|
if (vnodeData.key) {
|
|
373
494
|
key = vnodeData.key;
|
|
374
495
|
}
|
|
496
|
+
if (vnodeData.name) {
|
|
497
|
+
slotName = vnodeData.name;
|
|
498
|
+
}
|
|
375
499
|
{
|
|
376
500
|
const classData = vnodeData.className || vnodeData.class;
|
|
377
501
|
if (classData) {
|
|
@@ -394,6 +518,9 @@ var h = (nodeName, vnodeData, ...children) => {
|
|
|
394
518
|
{
|
|
395
519
|
vnode.$key$ = key;
|
|
396
520
|
}
|
|
521
|
+
{
|
|
522
|
+
vnode.$name$ = slotName;
|
|
523
|
+
}
|
|
397
524
|
return vnode;
|
|
398
525
|
};
|
|
399
526
|
var newVNode = (tag, text) => {
|
|
@@ -411,6 +538,9 @@ var newVNode = (tag, text) => {
|
|
|
411
538
|
{
|
|
412
539
|
vnode.$key$ = null;
|
|
413
540
|
}
|
|
541
|
+
{
|
|
542
|
+
vnode.$name$ = null;
|
|
543
|
+
}
|
|
414
544
|
return vnode;
|
|
415
545
|
};
|
|
416
546
|
var Host = {};
|
|
@@ -699,17 +829,43 @@ function sortedAttrNames(attrNames) {
|
|
|
699
829
|
|
|
700
830
|
// src/runtime/vdom/vdom-render.ts
|
|
701
831
|
var scopeId;
|
|
832
|
+
var contentRef;
|
|
702
833
|
var hostTagName;
|
|
834
|
+
var useNativeShadowDom = false;
|
|
835
|
+
var checkSlotFallbackVisibility = false;
|
|
836
|
+
var checkSlotRelocate = false;
|
|
703
837
|
var isSvgMode = false;
|
|
704
838
|
var refCallbacksToRemove = [];
|
|
705
839
|
var refCallbacksToAttach = [];
|
|
706
840
|
var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
841
|
+
var _a;
|
|
707
842
|
const newVNode2 = newParentVNode.$children$[childIndex];
|
|
708
843
|
let i2 = 0;
|
|
709
844
|
let elm;
|
|
710
845
|
let childNode;
|
|
846
|
+
let oldVNode;
|
|
847
|
+
if (!useNativeShadowDom) {
|
|
848
|
+
checkSlotRelocate = true;
|
|
849
|
+
if (newVNode2.$tag$ === "slot") {
|
|
850
|
+
newVNode2.$flags$ |= newVNode2.$children$ ? (
|
|
851
|
+
// slot element has fallback content
|
|
852
|
+
// still create an element that "mocks" the slot element
|
|
853
|
+
2 /* isSlotFallback */
|
|
854
|
+
) : (
|
|
855
|
+
// slot element does not have fallback content
|
|
856
|
+
// create an html comment we'll use to always reference
|
|
857
|
+
// where actual slot content should sit next to
|
|
858
|
+
1 /* isSlotReference */
|
|
859
|
+
);
|
|
860
|
+
}
|
|
861
|
+
}
|
|
711
862
|
if (newVNode2.$text$ != null) {
|
|
712
863
|
elm = newVNode2.$elm$ = win.document.createTextNode(newVNode2.$text$);
|
|
864
|
+
} else if (newVNode2.$flags$ & 1 /* isSlotReference */) {
|
|
865
|
+
elm = newVNode2.$elm$ = win.document.createTextNode("");
|
|
866
|
+
{
|
|
867
|
+
updateElement(null, newVNode2, isSvgMode);
|
|
868
|
+
}
|
|
713
869
|
} else {
|
|
714
870
|
if (!isSvgMode) {
|
|
715
871
|
isSvgMode = newVNode2.$tag$ === "svg";
|
|
@@ -719,7 +875,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
719
875
|
}
|
|
720
876
|
elm = newVNode2.$elm$ = win.document.createElementNS(
|
|
721
877
|
isSvgMode ? SVG_NS : HTML_NS,
|
|
722
|
-
newVNode2.$tag$
|
|
878
|
+
!useNativeShadowDom && BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
|
|
723
879
|
) ;
|
|
724
880
|
if (isSvgMode && newVNode2.$tag$ === "foreignObject") {
|
|
725
881
|
isSvgMode = false;
|
|
@@ -748,10 +904,72 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
748
904
|
}
|
|
749
905
|
}
|
|
750
906
|
elm["s-hn"] = hostTagName;
|
|
907
|
+
{
|
|
908
|
+
if (newVNode2.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
|
|
909
|
+
elm["s-sr"] = true;
|
|
910
|
+
elm["s-cr"] = contentRef;
|
|
911
|
+
elm["s-sn"] = newVNode2.$name$ || "";
|
|
912
|
+
elm["s-rf"] = (_a = newVNode2.$attrs$) == null ? void 0 : _a.ref;
|
|
913
|
+
patchSlotNode(elm);
|
|
914
|
+
oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
|
|
915
|
+
if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) {
|
|
916
|
+
relocateToHostRoot(oldParentVNode.$elm$);
|
|
917
|
+
}
|
|
918
|
+
{
|
|
919
|
+
addRemoveSlotScopedClass(contentRef, elm, newParentVNode.$elm$, oldParentVNode == null ? void 0 : oldParentVNode.$elm$);
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
}
|
|
751
923
|
return elm;
|
|
752
924
|
};
|
|
925
|
+
var relocateToHostRoot = (parentElm) => {
|
|
926
|
+
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
927
|
+
const host = parentElm.closest(hostTagName.toLowerCase());
|
|
928
|
+
if (host != null) {
|
|
929
|
+
const contentRefNode = Array.from(host.__childNodes || host.childNodes).find(
|
|
930
|
+
(ref) => ref["s-cr"]
|
|
931
|
+
);
|
|
932
|
+
const childNodeArray = Array.from(
|
|
933
|
+
parentElm.__childNodes || parentElm.childNodes
|
|
934
|
+
);
|
|
935
|
+
for (const childNode of contentRefNode ? childNodeArray.reverse() : childNodeArray) {
|
|
936
|
+
if (childNode["s-sh"] != null) {
|
|
937
|
+
insertBefore(host, childNode, contentRefNode != null ? contentRefNode : null);
|
|
938
|
+
childNode["s-sh"] = void 0;
|
|
939
|
+
checkSlotRelocate = true;
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
plt.$flags$ &= -2 /* isTmpDisconnected */;
|
|
944
|
+
};
|
|
945
|
+
var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
946
|
+
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
947
|
+
const oldSlotChildNodes = Array.from(parentElm.__childNodes || parentElm.childNodes);
|
|
948
|
+
if (parentElm["s-sr"]) {
|
|
949
|
+
let node = parentElm;
|
|
950
|
+
while (node = node.nextSibling) {
|
|
951
|
+
if (node && node["s-sn"] === parentElm["s-sn"] && node["s-sh"] === hostTagName) {
|
|
952
|
+
oldSlotChildNodes.push(node);
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
for (let i2 = oldSlotChildNodes.length - 1; i2 >= 0; i2--) {
|
|
957
|
+
const childNode = oldSlotChildNodes[i2];
|
|
958
|
+
if (childNode["s-hn"] !== hostTagName && childNode["s-ol"]) {
|
|
959
|
+
insertBefore(referenceNode(childNode).parentNode, childNode, referenceNode(childNode));
|
|
960
|
+
childNode["s-ol"].remove();
|
|
961
|
+
childNode["s-ol"] = void 0;
|
|
962
|
+
childNode["s-sh"] = void 0;
|
|
963
|
+
checkSlotRelocate = true;
|
|
964
|
+
}
|
|
965
|
+
if (recursive) {
|
|
966
|
+
putBackInOriginalLocation(childNode, recursive);
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
plt.$flags$ &= -2 /* isTmpDisconnected */;
|
|
970
|
+
};
|
|
753
971
|
var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
754
|
-
let containerElm = parentElm;
|
|
972
|
+
let containerElm = parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
|
|
755
973
|
let childNode;
|
|
756
974
|
if (parentVNode.$tag$ === "template") {
|
|
757
975
|
containerElm = containerElm.content;
|
|
@@ -761,7 +979,7 @@ var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
|
761
979
|
childNode = createElm(null, parentVNode, startIdx);
|
|
762
980
|
if (childNode) {
|
|
763
981
|
vnodes[startIdx].$elm$ = childNode;
|
|
764
|
-
insertBefore(containerElm, childNode, before);
|
|
982
|
+
insertBefore(containerElm, childNode, referenceNode(before) );
|
|
765
983
|
}
|
|
766
984
|
}
|
|
767
985
|
}
|
|
@@ -773,6 +991,14 @@ var removeVnodes = (vnodes, startIdx, endIdx) => {
|
|
|
773
991
|
const elm = vnode.$elm$;
|
|
774
992
|
nullifyVNodeRefs(vnode);
|
|
775
993
|
if (elm) {
|
|
994
|
+
{
|
|
995
|
+
checkSlotFallbackVisibility = true;
|
|
996
|
+
if (elm["s-ol"]) {
|
|
997
|
+
elm["s-ol"].remove();
|
|
998
|
+
} else {
|
|
999
|
+
putBackInOriginalLocation(elm, true);
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
776
1002
|
elm.remove();
|
|
777
1003
|
}
|
|
778
1004
|
}
|
|
@@ -810,11 +1036,17 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
810
1036
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
811
1037
|
newEndVnode = newCh[--newEndIdx];
|
|
812
1038
|
} else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
|
|
1039
|
+
if ((oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
|
|
1040
|
+
putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
|
|
1041
|
+
}
|
|
813
1042
|
patch(oldStartVnode, newEndVnode, isInitialRender);
|
|
814
1043
|
insertBefore(containerElm, oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
|
|
815
1044
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
816
1045
|
newEndVnode = newCh[--newEndIdx];
|
|
817
1046
|
} else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
|
|
1047
|
+
if ((oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
|
|
1048
|
+
putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
|
|
1049
|
+
}
|
|
818
1050
|
patch(oldEndVnode, newStartVnode, isInitialRender);
|
|
819
1051
|
insertBefore(containerElm, oldEndVnode.$elm$, oldStartVnode.$elm$);
|
|
820
1052
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
@@ -845,7 +1077,11 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
845
1077
|
}
|
|
846
1078
|
if (node) {
|
|
847
1079
|
{
|
|
848
|
-
insertBefore(
|
|
1080
|
+
insertBefore(
|
|
1081
|
+
referenceNode(oldStartVnode.$elm$).parentNode,
|
|
1082
|
+
node,
|
|
1083
|
+
referenceNode(oldStartVnode.$elm$)
|
|
1084
|
+
);
|
|
849
1085
|
}
|
|
850
1086
|
}
|
|
851
1087
|
}
|
|
@@ -865,6 +1101,9 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
865
1101
|
};
|
|
866
1102
|
var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
867
1103
|
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
1104
|
+
if (leftVNode.$tag$ === "slot") {
|
|
1105
|
+
return leftVNode.$name$ === rightVNode.$name$;
|
|
1106
|
+
}
|
|
868
1107
|
if (!isInitialRender) {
|
|
869
1108
|
return leftVNode.$key$ === rightVNode.$key$;
|
|
870
1109
|
}
|
|
@@ -875,17 +1114,25 @@ var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
|
875
1114
|
}
|
|
876
1115
|
return false;
|
|
877
1116
|
};
|
|
1117
|
+
var referenceNode = (node) => node && node["s-ol"] || node;
|
|
878
1118
|
var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
879
1119
|
const elm = newVNode2.$elm$ = oldVNode.$elm$;
|
|
880
1120
|
const oldChildren = oldVNode.$children$;
|
|
881
1121
|
const newChildren = newVNode2.$children$;
|
|
882
1122
|
const tag = newVNode2.$tag$;
|
|
883
1123
|
const text = newVNode2.$text$;
|
|
1124
|
+
let defaultHolder;
|
|
884
1125
|
if (text == null) {
|
|
885
1126
|
{
|
|
886
1127
|
isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
|
|
887
1128
|
}
|
|
888
1129
|
{
|
|
1130
|
+
if (tag === "slot" && !useNativeShadowDom) {
|
|
1131
|
+
if (oldVNode.$name$ !== newVNode2.$name$) {
|
|
1132
|
+
newVNode2.$elm$["s-sn"] = newVNode2.$name$ || "";
|
|
1133
|
+
relocateToHostRoot(newVNode2.$elm$.parentElement);
|
|
1134
|
+
}
|
|
1135
|
+
}
|
|
889
1136
|
updateElement(oldVNode, newVNode2, isSvgMode);
|
|
890
1137
|
}
|
|
891
1138
|
if (oldChildren !== null && newChildren !== null) {
|
|
@@ -904,10 +1151,62 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
904
1151
|
if (isSvgMode && tag === "svg") {
|
|
905
1152
|
isSvgMode = false;
|
|
906
1153
|
}
|
|
1154
|
+
} else if ((defaultHolder = elm["s-cr"])) {
|
|
1155
|
+
defaultHolder.parentNode.textContent = text;
|
|
907
1156
|
} else if (oldVNode.$text$ !== text) {
|
|
908
1157
|
elm.data = text;
|
|
909
1158
|
}
|
|
910
1159
|
};
|
|
1160
|
+
var relocateNodes = [];
|
|
1161
|
+
var markSlotContentForRelocation = (elm) => {
|
|
1162
|
+
let node;
|
|
1163
|
+
let hostContentNodes;
|
|
1164
|
+
let j;
|
|
1165
|
+
const children = elm.__childNodes || elm.childNodes;
|
|
1166
|
+
for (const childNode of children) {
|
|
1167
|
+
if (childNode["s-sr"] && (node = childNode["s-cr"]) && node.parentNode) {
|
|
1168
|
+
hostContentNodes = node.parentNode.__childNodes || node.parentNode.childNodes;
|
|
1169
|
+
const slotName = childNode["s-sn"];
|
|
1170
|
+
for (j = hostContentNodes.length - 1; j >= 0; j--) {
|
|
1171
|
+
node = hostContentNodes[j];
|
|
1172
|
+
if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!node["s-sh"] || node["s-sh"] !== childNode["s-hn"])) {
|
|
1173
|
+
if (isNodeLocatedInSlot(node, slotName)) {
|
|
1174
|
+
let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
|
|
1175
|
+
checkSlotFallbackVisibility = true;
|
|
1176
|
+
node["s-sn"] = node["s-sn"] || slotName;
|
|
1177
|
+
if (relocateNodeData) {
|
|
1178
|
+
relocateNodeData.$nodeToRelocate$["s-sh"] = childNode["s-hn"];
|
|
1179
|
+
relocateNodeData.$slotRefNode$ = childNode;
|
|
1180
|
+
} else {
|
|
1181
|
+
node["s-sh"] = childNode["s-hn"];
|
|
1182
|
+
relocateNodes.push({
|
|
1183
|
+
$slotRefNode$: childNode,
|
|
1184
|
+
$nodeToRelocate$: node
|
|
1185
|
+
});
|
|
1186
|
+
}
|
|
1187
|
+
if (node["s-sr"]) {
|
|
1188
|
+
relocateNodes.map((relocateNode) => {
|
|
1189
|
+
if (isNodeLocatedInSlot(relocateNode.$nodeToRelocate$, node["s-sn"])) {
|
|
1190
|
+
relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
|
|
1191
|
+
if (relocateNodeData && !relocateNode.$slotRefNode$) {
|
|
1192
|
+
relocateNode.$slotRefNode$ = relocateNodeData.$slotRefNode$;
|
|
1193
|
+
}
|
|
1194
|
+
}
|
|
1195
|
+
});
|
|
1196
|
+
}
|
|
1197
|
+
} else if (!relocateNodes.some((r) => r.$nodeToRelocate$ === node)) {
|
|
1198
|
+
relocateNodes.push({
|
|
1199
|
+
$nodeToRelocate$: node
|
|
1200
|
+
});
|
|
1201
|
+
}
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1204
|
+
}
|
|
1205
|
+
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
1206
|
+
markSlotContentForRelocation(childNode);
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
};
|
|
911
1210
|
var nullifyVNodeRefs = (vNode) => {
|
|
912
1211
|
{
|
|
913
1212
|
if (vNode.$attrs$ && vNode.$attrs$.ref) {
|
|
@@ -930,14 +1229,47 @@ var flushQueuedRefCallbacks = () => {
|
|
|
930
1229
|
}
|
|
931
1230
|
};
|
|
932
1231
|
var insertBefore = (parent, newNode, reference, isInitialLoad) => {
|
|
1232
|
+
{
|
|
1233
|
+
if (typeof newNode["s-sn"] === "string" && !!newNode["s-sr"] && !!newNode["s-cr"]) {
|
|
1234
|
+
addRemoveSlotScopedClass(newNode["s-cr"], newNode, parent, newNode.parentElement);
|
|
1235
|
+
} else if (typeof newNode["s-sn"] === "string") {
|
|
1236
|
+
parent.insertBefore(newNode, reference);
|
|
1237
|
+
const { slotNode } = findSlotFromSlottedNode(newNode);
|
|
1238
|
+
if (slotNode && !isInitialLoad) dispatchSlotChangeEvent(slotNode);
|
|
1239
|
+
return newNode;
|
|
1240
|
+
}
|
|
1241
|
+
}
|
|
933
1242
|
if (parent.__insertBefore) {
|
|
934
1243
|
return parent.__insertBefore(newNode, reference);
|
|
935
1244
|
} else {
|
|
936
1245
|
return parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
|
937
1246
|
}
|
|
938
1247
|
};
|
|
1248
|
+
function addRemoveSlotScopedClass(reference, slotNode, newParent, oldParent) {
|
|
1249
|
+
var _a, _b;
|
|
1250
|
+
let scopeId2;
|
|
1251
|
+
if (reference && typeof slotNode["s-sn"] === "string" && !!slotNode["s-sr"] && reference.parentNode && reference.parentNode["s-sc"] && (scopeId2 = slotNode["s-si"] || reference.parentNode["s-sc"])) {
|
|
1252
|
+
const scopeName = slotNode["s-sn"];
|
|
1253
|
+
const hostName = slotNode["s-hn"];
|
|
1254
|
+
(_a = newParent.classList) == null ? void 0 : _a.add(scopeId2 + "-s");
|
|
1255
|
+
if (oldParent && ((_b = oldParent.classList) == null ? void 0 : _b.contains(scopeId2 + "-s"))) {
|
|
1256
|
+
let child = (oldParent.__childNodes || oldParent.childNodes)[0];
|
|
1257
|
+
let found = false;
|
|
1258
|
+
while (child) {
|
|
1259
|
+
if (child["s-sn"] !== scopeName && child["s-hn"] === hostName && !!child["s-sr"]) {
|
|
1260
|
+
found = true;
|
|
1261
|
+
break;
|
|
1262
|
+
}
|
|
1263
|
+
child = child.nextSibling;
|
|
1264
|
+
}
|
|
1265
|
+
if (!found) oldParent.classList.remove(scopeId2 + "-s");
|
|
1266
|
+
}
|
|
1267
|
+
}
|
|
1268
|
+
}
|
|
939
1269
|
var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
1270
|
+
var _a, _b, _c, _d, _e;
|
|
940
1271
|
const hostElm = hostRef.$hostElement$;
|
|
1272
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
941
1273
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
942
1274
|
const isHostElement = isHost(renderFnResults);
|
|
943
1275
|
const rootVnode = isHostElement ? renderFnResults : h(null, null, renderFnResults);
|
|
@@ -956,7 +1288,107 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
956
1288
|
{
|
|
957
1289
|
scopeId = hostElm["s-sc"];
|
|
958
1290
|
}
|
|
1291
|
+
useNativeShadowDom = supportsShadow;
|
|
1292
|
+
{
|
|
1293
|
+
contentRef = hostElm["s-cr"];
|
|
1294
|
+
checkSlotFallbackVisibility = false;
|
|
1295
|
+
}
|
|
959
1296
|
patch(oldVNode, rootVnode, isInitialLoad);
|
|
1297
|
+
{
|
|
1298
|
+
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
1299
|
+
if (checkSlotRelocate) {
|
|
1300
|
+
markSlotContentForRelocation(rootVnode.$elm$);
|
|
1301
|
+
for (const relocateData of relocateNodes) {
|
|
1302
|
+
const nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
1303
|
+
if (!nodeToRelocate["s-ol"] && win.document) {
|
|
1304
|
+
const orgLocationNode = win.document.createTextNode("");
|
|
1305
|
+
orgLocationNode["s-nr"] = nodeToRelocate;
|
|
1306
|
+
insertBefore(
|
|
1307
|
+
nodeToRelocate.parentNode,
|
|
1308
|
+
nodeToRelocate["s-ol"] = orgLocationNode,
|
|
1309
|
+
nodeToRelocate,
|
|
1310
|
+
isInitialLoad
|
|
1311
|
+
);
|
|
1312
|
+
}
|
|
1313
|
+
}
|
|
1314
|
+
for (const relocateData of relocateNodes) {
|
|
1315
|
+
const nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
1316
|
+
const slotRefNode = relocateData.$slotRefNode$;
|
|
1317
|
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */ && isInitialLoad) {
|
|
1318
|
+
nodeToRelocate["s-ih"] = (_a = nodeToRelocate.hidden) != null ? _a : false;
|
|
1319
|
+
}
|
|
1320
|
+
if (slotRefNode) {
|
|
1321
|
+
const parentNodeRef = slotRefNode.parentNode;
|
|
1322
|
+
let insertBeforeNode = slotRefNode.nextSibling;
|
|
1323
|
+
if (insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */) {
|
|
1324
|
+
let orgLocationNode = (_b = nodeToRelocate["s-ol"]) == null ? void 0 : _b.previousSibling;
|
|
1325
|
+
while (orgLocationNode) {
|
|
1326
|
+
let refNode = (_c = orgLocationNode["s-nr"]) != null ? _c : null;
|
|
1327
|
+
if (refNode && refNode["s-sn"] === nodeToRelocate["s-sn"] && parentNodeRef === (refNode.__parentNode || refNode.parentNode)) {
|
|
1328
|
+
refNode = refNode.nextSibling;
|
|
1329
|
+
while (refNode === nodeToRelocate || (refNode == null ? void 0 : refNode["s-sr"])) {
|
|
1330
|
+
refNode = refNode == null ? void 0 : refNode.nextSibling;
|
|
1331
|
+
}
|
|
1332
|
+
if (!refNode || !refNode["s-nr"]) {
|
|
1333
|
+
insertBeforeNode = refNode;
|
|
1334
|
+
break;
|
|
1335
|
+
}
|
|
1336
|
+
}
|
|
1337
|
+
orgLocationNode = orgLocationNode.previousSibling;
|
|
1338
|
+
}
|
|
1339
|
+
}
|
|
1340
|
+
const parent = nodeToRelocate.__parentNode || nodeToRelocate.parentNode;
|
|
1341
|
+
const nextSibling = nodeToRelocate.__nextSibling || nodeToRelocate.nextSibling;
|
|
1342
|
+
if (!insertBeforeNode && parentNodeRef !== parent || nextSibling !== insertBeforeNode) {
|
|
1343
|
+
if (nodeToRelocate !== insertBeforeNode) {
|
|
1344
|
+
insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode, isInitialLoad);
|
|
1345
|
+
if (nodeToRelocate.nodeType === 8 /* CommentNode */ && nodeToRelocate.nodeValue.startsWith("s-nt-")) {
|
|
1346
|
+
const textNode = win.document.createTextNode(nodeToRelocate.nodeValue.replace(/^s-nt-/, ""));
|
|
1347
|
+
textNode["s-hn"] = nodeToRelocate["s-hn"];
|
|
1348
|
+
textNode["s-sn"] = nodeToRelocate["s-sn"];
|
|
1349
|
+
textNode["s-sh"] = nodeToRelocate["s-sh"];
|
|
1350
|
+
textNode["s-sr"] = nodeToRelocate["s-sr"];
|
|
1351
|
+
textNode["s-ol"] = nodeToRelocate["s-ol"];
|
|
1352
|
+
textNode["s-ol"]["s-nr"] = textNode;
|
|
1353
|
+
insertBefore(nodeToRelocate.parentNode, textNode, nodeToRelocate, isInitialLoad);
|
|
1354
|
+
nodeToRelocate.parentNode.removeChild(nodeToRelocate);
|
|
1355
|
+
}
|
|
1356
|
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */ && nodeToRelocate.tagName !== "SLOT-FB") {
|
|
1357
|
+
nodeToRelocate.hidden = (_d = nodeToRelocate["s-ih"]) != null ? _d : false;
|
|
1358
|
+
}
|
|
1359
|
+
}
|
|
1360
|
+
}
|
|
1361
|
+
nodeToRelocate && typeof slotRefNode["s-rf"] === "function" && slotRefNode["s-rf"](slotRefNode);
|
|
1362
|
+
} else if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1363
|
+
nodeToRelocate.hidden = true;
|
|
1364
|
+
}
|
|
1365
|
+
}
|
|
1366
|
+
}
|
|
1367
|
+
if (checkSlotFallbackVisibility) {
|
|
1368
|
+
updateFallbackSlotVisibility(rootVnode.$elm$);
|
|
1369
|
+
}
|
|
1370
|
+
plt.$flags$ &= -2 /* isTmpDisconnected */;
|
|
1371
|
+
relocateNodes.length = 0;
|
|
1372
|
+
}
|
|
1373
|
+
if (!useNativeShadowDom && !(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && hostElm["s-cr"]) {
|
|
1374
|
+
const children = rootVnode.$elm$.__childNodes || rootVnode.$elm$.childNodes;
|
|
1375
|
+
for (const childNode of children) {
|
|
1376
|
+
if (childNode["s-hn"] !== hostTagName && !childNode["s-sh"]) {
|
|
1377
|
+
if (isInitialLoad && childNode["s-ih"] == null) {
|
|
1378
|
+
childNode["s-ih"] = (_e = childNode.hidden) != null ? _e : false;
|
|
1379
|
+
}
|
|
1380
|
+
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
1381
|
+
childNode.hidden = true;
|
|
1382
|
+
} else if (childNode.nodeType === 3 /* TextNode */ && !!childNode.nodeValue.trim()) {
|
|
1383
|
+
const textCommentNode = win.document.createComment("s-nt-" + childNode.nodeValue);
|
|
1384
|
+
textCommentNode["s-sn"] = childNode["s-sn"];
|
|
1385
|
+
insertBefore(childNode.parentNode, textCommentNode, childNode, isInitialLoad);
|
|
1386
|
+
childNode.parentNode.removeChild(childNode);
|
|
1387
|
+
}
|
|
1388
|
+
}
|
|
1389
|
+
}
|
|
1390
|
+
}
|
|
1391
|
+
contentRef = void 0;
|
|
960
1392
|
flushQueuedRefCallbacks();
|
|
961
1393
|
};
|
|
962
1394
|
|
|
@@ -1003,6 +1435,10 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
1003
1435
|
let maybePromise;
|
|
1004
1436
|
if (isInitialLoad) {
|
|
1005
1437
|
{
|
|
1438
|
+
if (hostRef.$deferredConnectedCallback$) {
|
|
1439
|
+
hostRef.$deferredConnectedCallback$ = false;
|
|
1440
|
+
safeCall(instance, "connectedCallback", void 0, elm);
|
|
1441
|
+
}
|
|
1006
1442
|
if (hostRef.$fetchedCbList$.length) {
|
|
1007
1443
|
hostRef.$fetchedCbList$.forEach((cb) => cb(elm));
|
|
1008
1444
|
}
|
|
@@ -1388,8 +1824,11 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1388
1824
|
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
1389
1825
|
}
|
|
1390
1826
|
endNewInstance();
|
|
1391
|
-
|
|
1827
|
+
const needsDeferredCallback = cmpMeta.$flags$ & 4 /* hasSlotRelocation */;
|
|
1828
|
+
if (!needsDeferredCallback) {
|
|
1392
1829
|
fireConnectedCallback(hostRef.$lazyInstance$, elm);
|
|
1830
|
+
} else {
|
|
1831
|
+
hostRef.$deferredConnectedCallback$ = true;
|
|
1393
1832
|
}
|
|
1394
1833
|
} else {
|
|
1395
1834
|
Cstr = elm.constructor;
|
|
@@ -1444,6 +1883,12 @@ var connectedCallback = (elm) => {
|
|
|
1444
1883
|
const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
|
|
1445
1884
|
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
1446
1885
|
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
1886
|
+
{
|
|
1887
|
+
if (// TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
|
|
1888
|
+
cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
|
|
1889
|
+
setContentReference(elm);
|
|
1890
|
+
}
|
|
1891
|
+
}
|
|
1447
1892
|
{
|
|
1448
1893
|
let ancestorComponent = elm;
|
|
1449
1894
|
while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
|
|
@@ -1475,6 +1920,16 @@ var connectedCallback = (elm) => {
|
|
|
1475
1920
|
endConnected();
|
|
1476
1921
|
}
|
|
1477
1922
|
};
|
|
1923
|
+
var setContentReference = (elm) => {
|
|
1924
|
+
if (!win.document) {
|
|
1925
|
+
return;
|
|
1926
|
+
}
|
|
1927
|
+
const contentRefElm = elm["s-cr"] = win.document.createComment(
|
|
1928
|
+
""
|
|
1929
|
+
);
|
|
1930
|
+
contentRefElm["s-cn"] = true;
|
|
1931
|
+
insertBefore(elm, contentRefElm, elm.firstChild);
|
|
1932
|
+
};
|
|
1478
1933
|
var disconnectInstance = (instance, elm) => {
|
|
1479
1934
|
{
|
|
1480
1935
|
safeCall(instance, "disconnectedCallback", void 0, elm || instance);
|
|
@@ -1516,6 +1971,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1516
1971
|
let isBootstrapping = true;
|
|
1517
1972
|
Object.assign(plt, options);
|
|
1518
1973
|
plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", win.document.baseURI).href;
|
|
1974
|
+
let hasSlotRelocation = false;
|
|
1519
1975
|
lazyBundles.map((lazyBundle) => {
|
|
1520
1976
|
lazyBundle[1].map((compactMeta) => {
|
|
1521
1977
|
var _a2, _b;
|
|
@@ -1525,6 +1981,9 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1525
1981
|
$members$: compactMeta[2],
|
|
1526
1982
|
$listeners$: compactMeta[3]
|
|
1527
1983
|
};
|
|
1984
|
+
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
|
|
1985
|
+
hasSlotRelocation = true;
|
|
1986
|
+
}
|
|
1528
1987
|
{
|
|
1529
1988
|
cmpMeta.$members$ = compactMeta[2];
|
|
1530
1989
|
}
|
|
@@ -1595,6 +2054,9 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1595
2054
|
});
|
|
1596
2055
|
});
|
|
1597
2056
|
if (cmpTags.length > 0) {
|
|
2057
|
+
if (hasSlotRelocation) {
|
|
2058
|
+
dataStyles.textContent += SLOT_FB_CSS;
|
|
2059
|
+
}
|
|
1598
2060
|
{
|
|
1599
2061
|
dataStyles.textContent += cmpTags.sort() + HYDRATED_CSS;
|
|
1600
2062
|
}
|