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