xv-webcomponents 0.1.39 → 0.1.41
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/{index-D41mMXvd.js → index-MLh9SbX2.js} +349 -8
- package/dist/cjs/index-MLh9SbX2.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{xv-accordion-v2_27.cjs.entry.js → xv-accordion-v2_33.cjs.entry.js} +2214 -87
- package/dist/cjs/xv-accordion-v2_33.cjs.entry.js.map +1 -0
- package/dist/cjs/xv-breadcrumbs-v2.cjs.entry.js +1 -1
- package/dist/cjs/xv-webcomponents.cjs.js +3 -3
- package/dist/cjs/xv-webcomponents.cjs.js.map +1 -1
- package/dist/collection/collection-manifest.json +7 -1
- package/dist/collection/components/xv-button/xv-button-v2.css +136 -118
- package/dist/collection/components/xv-button/xv-button.js +132 -67
- package/dist/collection/components/xv-button/xv-button.js.map +1 -1
- package/dist/collection/components/xv-card/xv-card.js +1 -1
- package/dist/collection/components/xv-checkbox/xv-checkbox.css +3 -0
- package/dist/collection/components/xv-checkbox/xv-checkbox.js +1 -1
- package/dist/collection/components/xv-data-table/xv-data-table-cell/xv-data-table-cell.css +30 -0
- package/dist/collection/components/xv-data-table/xv-data-table-cell/xv-data-table-cell.js +80 -0
- package/dist/collection/components/xv-data-table/xv-data-table-cell/xv-data-table-cell.js.map +1 -0
- package/dist/collection/components/xv-data-table/xv-data-table-row/xv-data-table-row.css +4 -0
- package/dist/collection/components/xv-data-table/xv-data-table-row/xv-data-table-row.js +42 -0
- package/dist/collection/components/xv-data-table/xv-data-table-row/xv-data-table-row.js.map +1 -0
- package/dist/collection/components/xv-data-table/xv-data-table.css +51 -0
- package/dist/collection/components/xv-data-table/xv-data-table.js +130 -0
- package/dist/collection/components/xv-data-table/xv-data-table.js.map +1 -0
- package/dist/collection/components/xv-dropdown/xv-dropdown-item/xv-dropdown-item.js +1 -1
- package/dist/collection/components/xv-dropdown/xv-dropdown.css +6 -1
- package/dist/collection/components/xv-dropdown/xv-dropdown.js +20 -1
- package/dist/collection/components/xv-dropdown/xv-dropdown.js.map +1 -1
- package/dist/collection/components/xv-file-uploader/_vars.js +6 -0
- package/dist/collection/components/xv-file-uploader/_vars.js.map +1 -0
- package/dist/collection/components/xv-file-uploader/xv-file-uploader.css +136 -0
- package/dist/collection/components/xv-file-uploader/xv-file-uploader.js +448 -0
- package/dist/collection/components/xv-file-uploader/xv-file-uploader.js.map +1 -0
- package/dist/collection/components/xv-footer/xv-footer.js +1 -1
- package/dist/collection/components/xv-header/xv-header.js +1 -1
- package/dist/collection/components/xv-link/xv-link.js +1 -1
- package/dist/collection/components/xv-modal/xv-modal.js +1 -1
- package/dist/collection/components/xv-notification/xv-notification.css +1 -0
- package/dist/collection/components/xv-notification/xv-notification.js +1 -1
- package/dist/collection/components/xv-number-input/xv-number-input.css +128 -0
- package/dist/collection/components/xv-number-input/xv-number-input.js +373 -0
- package/dist/collection/components/xv-number-input/xv-number-input.js.map +1 -0
- package/dist/collection/components/xv-overflow-menu/xv-overflow-menu-item/xv-overflow-menu-item.js +1 -1
- package/dist/collection/components/xv-overflow-menu/xv-overflow-menu.js +1 -1
- package/dist/collection/components/xv-progress-indicator/xv-progress-indicator-item/xv-progress-indicator-item.js +1 -1
- package/dist/collection/components/xv-progress-indicator/xv-progress-indicator.js +1 -1
- package/dist/collection/components/xv-table/xv-table-cell/xv-table-cell.js +1 -1
- package/dist/collection/components/xv-table/xv-table-expand/xv-table-expand.js +1 -1
- package/dist/collection/components/xv-table/xv-table-row/xv-table-row.js +1 -1
- package/dist/collection/components/xv-table/xv-table.js +1 -1
- package/dist/collection/components/xv-tabs/xv-tab/xv-tab.js +1 -1
- package/dist/collection/components/xv-tabs/xv-tabs.js +1 -2
- package/dist/collection/components/xv-tabs/xv-tabs.js.map +1 -1
- package/dist/collection/components/xv-tag/xv-tag.js +1 -1
- package/dist/collection/components/xv-text-input/xv-text-input.css +110 -89
- package/dist/collection/components/xv-text-input/xv-text-input.js +113 -80
- package/dist/collection/components/xv-text-input/xv-text-input.js.map +1 -1
- package/dist/collection/components/xv-toggle-tip/xv-toggle-tip.css +95 -0
- package/dist/collection/components/xv-toggle-tip/xv-toggle-tip.js +201 -0
- package/dist/collection/components/xv-toggle-tip/xv-toggle-tip.js.map +1 -0
- package/dist/collection/components/xv-tooltip/xv-tooltip.css +31 -147
- package/dist/collection/components/xv-tooltip/xv-tooltip.js +59 -34
- package/dist/collection/components/xv-tooltip/xv-tooltip.js.map +1 -1
- package/dist/esm/{index-Datpns0U.js → index-DLYJiP99.js} +349 -8
- package/dist/esm/index-DLYJiP99.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{xv-accordion-v2_27.entry.js → xv-accordion-v2_33.entry.js} +2209 -88
- package/dist/esm/xv-accordion-v2_33.entry.js.map +1 -0
- package/dist/esm/xv-breadcrumbs-v2.entry.js +1 -1
- package/dist/esm/xv-webcomponents.js +4 -4
- package/dist/esm/xv-webcomponents.js.map +1 -1
- package/dist/types/components/xv-button/xv-button.d.ts +21 -12
- package/dist/types/components/xv-data-table/xv-data-table-cell/xv-data-table-cell.d.ts +6 -0
- package/dist/types/components/xv-data-table/xv-data-table-row/xv-data-table-row.d.ts +4 -0
- package/dist/types/components/xv-data-table/xv-data-table.d.ts +9 -0
- package/dist/types/components/xv-dropdown/xv-dropdown.d.ts +1 -0
- package/dist/types/components/xv-file-uploader/_vars.d.ts +4 -0
- package/dist/types/components/xv-file-uploader/xv-file-uploader.d.ts +36 -0
- package/dist/types/components/xv-number-input/xv-number-input.d.ts +26 -0
- package/dist/types/components/xv-text-input/xv-text-input.d.ts +10 -11
- package/dist/types/components/xv-toggle-tip/xv-toggle-tip.d.ts +19 -0
- package/dist/types/components/xv-tooltip/xv-tooltip.d.ts +10 -8
- package/dist/types/components.d.ts +605 -49
- package/dist/xv-webcomponents/{p-054f5d59.entry.js → p-5b63a259.entry.js} +2 -2
- package/dist/xv-webcomponents/p-DLYJiP99.js +3 -0
- package/dist/xv-webcomponents/p-DLYJiP99.js.map +1 -0
- package/dist/xv-webcomponents/p-ec72208c.entry.js +2 -0
- package/dist/xv-webcomponents/p-ec72208c.entry.js.map +1 -0
- package/dist/xv-webcomponents/xv-webcomponents.esm.js +1 -1
- package/dist/xv-webcomponents/xv-webcomponents.esm.js.map +1 -1
- package/package.json +6 -4
- package/dist/cjs/index-D41mMXvd.js.map +0 -1
- package/dist/cjs/xv-accordion-v2_27.cjs.entry.js.map +0 -1
- package/dist/collection/components/xv-text-input/_vars.js +0 -7
- package/dist/collection/components/xv-text-input/_vars.js.map +0 -1
- package/dist/esm/index-Datpns0U.js.map +0 -1
- package/dist/esm/xv-accordion-v2_27.entry.js.map +0 -1
- package/dist/types/components/xv-text-input/_vars.d.ts +0 -5
- package/dist/xv-webcomponents/p-6a4cc790.entry.js +0 -2
- package/dist/xv-webcomponents/p-6a4cc790.entry.js.map +0 -1
- package/dist/xv-webcomponents/p-Datpns0U.js +0 -3
- package/dist/xv-webcomponents/p-Datpns0U.js.map +0 -1
- /package/dist/xv-webcomponents/{p-054f5d59.entry.js.map → p-5b63a259.entry.js.map} +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const NAMESPACE = 'xv-webcomponents';
|
|
4
|
-
const BUILD = /* xv-webcomponents */ { hydratedSelectorName: "hydrated", lazyLoad: true, updatable: true};
|
|
4
|
+
const BUILD = /* xv-webcomponents */ { hydratedSelectorName: "hydrated", lazyLoad: true, slotRelocation: true, updatable: true};
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
|
-
Stencil Client Platform v4.
|
|
7
|
+
Stencil Client Platform v4.32.0 | MIT Licensed | https://stenciljs.com
|
|
8
8
|
*/
|
|
9
9
|
var __defProp = Object.defineProperty;
|
|
10
10
|
var __export = (target, all) => {
|
|
@@ -227,6 +227,112 @@ var unwrapErr = (result) => {
|
|
|
227
227
|
throw result.value;
|
|
228
228
|
}
|
|
229
229
|
};
|
|
230
|
+
var updateFallbackSlotVisibility = (elm) => {
|
|
231
|
+
const childNodes = internalCall(elm, "childNodes");
|
|
232
|
+
if (elm.tagName && elm.tagName.includes("-") && elm["s-cr"] && elm.tagName !== "SLOT-FB") {
|
|
233
|
+
getHostSlotNodes(childNodes, elm.tagName).forEach((slotNode) => {
|
|
234
|
+
if (slotNode.nodeType === 1 /* ElementNode */ && slotNode.tagName === "SLOT-FB") {
|
|
235
|
+
if (getSlotChildSiblings(slotNode, getSlotName(slotNode), false).length) {
|
|
236
|
+
slotNode.hidden = true;
|
|
237
|
+
} else {
|
|
238
|
+
slotNode.hidden = false;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
let i2 = 0;
|
|
244
|
+
for (i2 = 0; i2 < childNodes.length; i2++) {
|
|
245
|
+
const childNode = childNodes[i2];
|
|
246
|
+
if (childNode.nodeType === 1 /* ElementNode */ && internalCall(childNode, "childNodes").length) {
|
|
247
|
+
updateFallbackSlotVisibility(childNode);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
var getSlottedChildNodes = (childNodes) => {
|
|
252
|
+
const result = [];
|
|
253
|
+
for (let i2 = 0; i2 < childNodes.length; i2++) {
|
|
254
|
+
const slottedNode = childNodes[i2]["s-nr"] || void 0;
|
|
255
|
+
if (slottedNode && slottedNode.isConnected) {
|
|
256
|
+
result.push(slottedNode);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
return result;
|
|
260
|
+
};
|
|
261
|
+
function getHostSlotNodes(childNodes, hostName, slotName) {
|
|
262
|
+
let i2 = 0;
|
|
263
|
+
let slottedNodes = [];
|
|
264
|
+
let childNode;
|
|
265
|
+
for (; i2 < childNodes.length; i2++) {
|
|
266
|
+
childNode = childNodes[i2];
|
|
267
|
+
if (childNode["s-sr"] && (!hostName || childNode["s-hn"] === hostName) && (slotName === void 0)) {
|
|
268
|
+
slottedNodes.push(childNode);
|
|
269
|
+
}
|
|
270
|
+
slottedNodes = [...slottedNodes, ...getHostSlotNodes(childNode.childNodes, hostName, slotName)];
|
|
271
|
+
}
|
|
272
|
+
return slottedNodes;
|
|
273
|
+
}
|
|
274
|
+
var getSlotChildSiblings = (slot, slotName, includeSlot = true) => {
|
|
275
|
+
const childNodes = [];
|
|
276
|
+
if (includeSlot && slot["s-sr"] || !slot["s-sr"]) childNodes.push(slot);
|
|
277
|
+
let node = slot;
|
|
278
|
+
while (node = node.nextSibling) {
|
|
279
|
+
if (getSlotName(node) === slotName && (includeSlot || !node["s-sr"])) childNodes.push(node);
|
|
280
|
+
}
|
|
281
|
+
return childNodes;
|
|
282
|
+
};
|
|
283
|
+
var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
|
|
284
|
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
285
|
+
if (nodeToRelocate.getAttribute("slot") === null && slotName === "") {
|
|
286
|
+
return true;
|
|
287
|
+
}
|
|
288
|
+
if (nodeToRelocate.getAttribute("slot") === slotName) {
|
|
289
|
+
return true;
|
|
290
|
+
}
|
|
291
|
+
return false;
|
|
292
|
+
}
|
|
293
|
+
if (nodeToRelocate["s-sn"] === slotName) {
|
|
294
|
+
return true;
|
|
295
|
+
}
|
|
296
|
+
return slotName === "";
|
|
297
|
+
};
|
|
298
|
+
var getSlotName = (node) => typeof node["s-sn"] === "string" ? node["s-sn"] : node.nodeType === 1 && node.getAttribute("slot") || void 0;
|
|
299
|
+
function patchSlotNode(node) {
|
|
300
|
+
if (node.assignedElements || node.assignedNodes || !node["s-sr"]) return;
|
|
301
|
+
const assignedFactory = (elementsOnly) => (function(opts) {
|
|
302
|
+
const toReturn = [];
|
|
303
|
+
const slotName = this["s-sn"];
|
|
304
|
+
if (opts == null ? void 0 : opts.flatten) {
|
|
305
|
+
console.error(`
|
|
306
|
+
Flattening is not supported for Stencil non-shadow slots.
|
|
307
|
+
You can use \`.childNodes\` to nested slot fallback content.
|
|
308
|
+
If you have a particular use case, please open an issue on the Stencil repo.
|
|
309
|
+
`);
|
|
310
|
+
}
|
|
311
|
+
const parent = this["s-cr"].parentElement;
|
|
312
|
+
const slottedNodes = parent.__childNodes ? parent.childNodes : getSlottedChildNodes(parent.childNodes);
|
|
313
|
+
slottedNodes.forEach((n) => {
|
|
314
|
+
if (slotName === getSlotName(n)) {
|
|
315
|
+
toReturn.push(n);
|
|
316
|
+
}
|
|
317
|
+
});
|
|
318
|
+
if (elementsOnly) {
|
|
319
|
+
return toReturn.filter((n) => n.nodeType === 1 /* ElementNode */);
|
|
320
|
+
}
|
|
321
|
+
return toReturn;
|
|
322
|
+
}).bind(node);
|
|
323
|
+
node.assignedElements = assignedFactory(true);
|
|
324
|
+
node.assignedNodes = assignedFactory(false);
|
|
325
|
+
}
|
|
326
|
+
function internalCall(node, method) {
|
|
327
|
+
if ("__" + method in node) {
|
|
328
|
+
const toReturn = node["__" + method];
|
|
329
|
+
if (typeof toReturn !== "function") return toReturn;
|
|
330
|
+
return toReturn.bind(node);
|
|
331
|
+
} else {
|
|
332
|
+
if (typeof node[method] !== "function") return node[method];
|
|
333
|
+
return node[method].bind(node);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
230
336
|
var createTime = (fnName, tagName = "") => {
|
|
231
337
|
{
|
|
232
338
|
return () => {
|
|
@@ -244,6 +350,7 @@ var uniqueTime = (key, measureText) => {
|
|
|
244
350
|
var h = (nodeName, vnodeData, ...children) => {
|
|
245
351
|
let child = null;
|
|
246
352
|
let key = null;
|
|
353
|
+
let slotName = null;
|
|
247
354
|
let simple = false;
|
|
248
355
|
let lastSimple = false;
|
|
249
356
|
const vNodeChildren = [];
|
|
@@ -270,6 +377,9 @@ var h = (nodeName, vnodeData, ...children) => {
|
|
|
270
377
|
if (vnodeData.key) {
|
|
271
378
|
key = vnodeData.key;
|
|
272
379
|
}
|
|
380
|
+
if (vnodeData.name) {
|
|
381
|
+
slotName = vnodeData.name;
|
|
382
|
+
}
|
|
273
383
|
{
|
|
274
384
|
const classData = vnodeData.className || vnodeData.class;
|
|
275
385
|
if (classData) {
|
|
@@ -292,6 +402,9 @@ var h = (nodeName, vnodeData, ...children) => {
|
|
|
292
402
|
{
|
|
293
403
|
vnode.$key$ = key;
|
|
294
404
|
}
|
|
405
|
+
{
|
|
406
|
+
vnode.$name$ = slotName;
|
|
407
|
+
}
|
|
295
408
|
return vnode;
|
|
296
409
|
};
|
|
297
410
|
var newVNode = (tag, text) => {
|
|
@@ -308,6 +421,9 @@ var newVNode = (tag, text) => {
|
|
|
308
421
|
{
|
|
309
422
|
vnode.$key$ = null;
|
|
310
423
|
}
|
|
424
|
+
{
|
|
425
|
+
vnode.$name$ = null;
|
|
426
|
+
}
|
|
311
427
|
return vnode;
|
|
312
428
|
};
|
|
313
429
|
var Host = {};
|
|
@@ -628,15 +744,41 @@ function sortedAttrNames(attrNames) {
|
|
|
628
744
|
attrNames
|
|
629
745
|
);
|
|
630
746
|
}
|
|
747
|
+
var contentRef;
|
|
631
748
|
var hostTagName;
|
|
749
|
+
var useNativeShadowDom = false;
|
|
750
|
+
var checkSlotFallbackVisibility = false;
|
|
751
|
+
var checkSlotRelocate = false;
|
|
632
752
|
var isSvgMode = false;
|
|
633
753
|
var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
754
|
+
var _a;
|
|
634
755
|
const newVNode2 = newParentVNode.$children$[childIndex];
|
|
635
756
|
let i2 = 0;
|
|
636
757
|
let elm;
|
|
637
758
|
let childNode;
|
|
759
|
+
let oldVNode;
|
|
760
|
+
if (!useNativeShadowDom) {
|
|
761
|
+
checkSlotRelocate = true;
|
|
762
|
+
if (newVNode2.$tag$ === "slot") {
|
|
763
|
+
newVNode2.$flags$ |= newVNode2.$children$ ? (
|
|
764
|
+
// slot element has fallback content
|
|
765
|
+
// still create an element that "mocks" the slot element
|
|
766
|
+
2 /* isSlotFallback */
|
|
767
|
+
) : (
|
|
768
|
+
// slot element does not have fallback content
|
|
769
|
+
// create an html comment we'll use to always reference
|
|
770
|
+
// where actual slot content should sit next to
|
|
771
|
+
1 /* isSlotReference */
|
|
772
|
+
);
|
|
773
|
+
}
|
|
774
|
+
}
|
|
638
775
|
if (newVNode2.$text$ !== null) {
|
|
639
776
|
elm = newVNode2.$elm$ = win.document.createTextNode(newVNode2.$text$);
|
|
777
|
+
} else if (newVNode2.$flags$ & 1 /* isSlotReference */) {
|
|
778
|
+
elm = newVNode2.$elm$ = win.document.createTextNode("");
|
|
779
|
+
{
|
|
780
|
+
updateElement(null, newVNode2, isSvgMode);
|
|
781
|
+
}
|
|
640
782
|
} else {
|
|
641
783
|
if (!isSvgMode) {
|
|
642
784
|
isSvgMode = newVNode2.$tag$ === "svg";
|
|
@@ -648,7 +790,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
648
790
|
}
|
|
649
791
|
elm = newVNode2.$elm$ = win.document.createElementNS(
|
|
650
792
|
isSvgMode ? SVG_NS : HTML_NS,
|
|
651
|
-
newVNode2.$tag$
|
|
793
|
+
!useNativeShadowDom && BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
|
|
652
794
|
) ;
|
|
653
795
|
if (isSvgMode && newVNode2.$tag$ === "foreignObject") {
|
|
654
796
|
isSvgMode = false;
|
|
@@ -673,10 +815,43 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
673
815
|
}
|
|
674
816
|
}
|
|
675
817
|
elm["s-hn"] = hostTagName;
|
|
818
|
+
{
|
|
819
|
+
if (newVNode2.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
|
|
820
|
+
elm["s-sr"] = true;
|
|
821
|
+
elm["s-cr"] = contentRef;
|
|
822
|
+
elm["s-sn"] = newVNode2.$name$ || "";
|
|
823
|
+
elm["s-rf"] = (_a = newVNode2.$attrs$) == null ? void 0 : _a.ref;
|
|
824
|
+
patchSlotNode(elm);
|
|
825
|
+
oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
|
|
826
|
+
if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) {
|
|
827
|
+
{
|
|
828
|
+
putBackInOriginalLocation(oldParentVNode.$elm$, false);
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
}
|
|
676
833
|
return elm;
|
|
677
834
|
};
|
|
835
|
+
var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
836
|
+
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
837
|
+
const oldSlotChildNodes = Array.from(parentElm.__childNodes || parentElm.childNodes);
|
|
838
|
+
for (let i2 = oldSlotChildNodes.length - 1; i2 >= 0; i2--) {
|
|
839
|
+
const childNode = oldSlotChildNodes[i2];
|
|
840
|
+
if (childNode["s-hn"] !== hostTagName && childNode["s-ol"]) {
|
|
841
|
+
insertBefore(referenceNode(childNode).parentNode, childNode, referenceNode(childNode));
|
|
842
|
+
childNode["s-ol"].remove();
|
|
843
|
+
childNode["s-ol"] = void 0;
|
|
844
|
+
childNode["s-sh"] = void 0;
|
|
845
|
+
checkSlotRelocate = true;
|
|
846
|
+
}
|
|
847
|
+
if (recursive) {
|
|
848
|
+
putBackInOriginalLocation(childNode, recursive);
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
plt.$flags$ &= -2 /* isTmpDisconnected */;
|
|
852
|
+
};
|
|
678
853
|
var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
679
|
-
let containerElm = parentElm;
|
|
854
|
+
let containerElm = parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
|
|
680
855
|
let childNode;
|
|
681
856
|
if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
|
|
682
857
|
containerElm = containerElm.shadowRoot;
|
|
@@ -686,7 +861,7 @@ var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
|
686
861
|
childNode = createElm(null, parentVNode, startIdx);
|
|
687
862
|
if (childNode) {
|
|
688
863
|
vnodes[startIdx].$elm$ = childNode;
|
|
689
|
-
insertBefore(containerElm, childNode, before);
|
|
864
|
+
insertBefore(containerElm, childNode, referenceNode(before) );
|
|
690
865
|
}
|
|
691
866
|
}
|
|
692
867
|
}
|
|
@@ -698,6 +873,14 @@ var removeVnodes = (vnodes, startIdx, endIdx) => {
|
|
|
698
873
|
const elm = vnode.$elm$;
|
|
699
874
|
nullifyVNodeRefs(vnode);
|
|
700
875
|
if (elm) {
|
|
876
|
+
{
|
|
877
|
+
checkSlotFallbackVisibility = true;
|
|
878
|
+
if (elm["s-ol"]) {
|
|
879
|
+
elm["s-ol"].remove();
|
|
880
|
+
} else {
|
|
881
|
+
putBackInOriginalLocation(elm, true);
|
|
882
|
+
}
|
|
883
|
+
}
|
|
701
884
|
elm.remove();
|
|
702
885
|
}
|
|
703
886
|
}
|
|
@@ -734,11 +917,17 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
734
917
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
735
918
|
newEndVnode = newCh[--newEndIdx];
|
|
736
919
|
} else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
|
|
920
|
+
if ((oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
|
|
921
|
+
putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
|
|
922
|
+
}
|
|
737
923
|
patch(oldStartVnode, newEndVnode, isInitialRender);
|
|
738
924
|
insertBefore(parentElm, oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
|
|
739
925
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
740
926
|
newEndVnode = newCh[--newEndIdx];
|
|
741
927
|
} else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
|
|
928
|
+
if ((oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
|
|
929
|
+
putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
|
|
930
|
+
}
|
|
742
931
|
patch(oldEndVnode, newStartVnode, isInitialRender);
|
|
743
932
|
insertBefore(parentElm, oldEndVnode.$elm$, oldStartVnode.$elm$);
|
|
744
933
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
@@ -769,7 +958,11 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
769
958
|
}
|
|
770
959
|
if (node) {
|
|
771
960
|
{
|
|
772
|
-
insertBefore(
|
|
961
|
+
insertBefore(
|
|
962
|
+
referenceNode(oldStartVnode.$elm$).parentNode,
|
|
963
|
+
node,
|
|
964
|
+
referenceNode(oldStartVnode.$elm$)
|
|
965
|
+
);
|
|
773
966
|
}
|
|
774
967
|
}
|
|
775
968
|
}
|
|
@@ -789,6 +982,9 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
789
982
|
};
|
|
790
983
|
var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
791
984
|
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
985
|
+
if (leftVNode.$tag$ === "slot") {
|
|
986
|
+
return leftVNode.$name$ === rightVNode.$name$;
|
|
987
|
+
}
|
|
792
988
|
if (!isInitialRender) {
|
|
793
989
|
return leftVNode.$key$ === rightVNode.$key$;
|
|
794
990
|
}
|
|
@@ -799,12 +995,14 @@ var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
|
799
995
|
}
|
|
800
996
|
return false;
|
|
801
997
|
};
|
|
998
|
+
var referenceNode = (node) => node && node["s-ol"] || node;
|
|
802
999
|
var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
803
1000
|
const elm = newVNode2.$elm$ = oldVNode.$elm$;
|
|
804
1001
|
const oldChildren = oldVNode.$children$;
|
|
805
1002
|
const newChildren = newVNode2.$children$;
|
|
806
1003
|
const tag = newVNode2.$tag$;
|
|
807
1004
|
const text = newVNode2.$text$;
|
|
1005
|
+
let defaultHolder;
|
|
808
1006
|
if (text === null) {
|
|
809
1007
|
{
|
|
810
1008
|
isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
|
|
@@ -828,10 +1026,62 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
828
1026
|
if (isSvgMode && tag === "svg") {
|
|
829
1027
|
isSvgMode = false;
|
|
830
1028
|
}
|
|
1029
|
+
} else if ((defaultHolder = elm["s-cr"])) {
|
|
1030
|
+
defaultHolder.parentNode.textContent = text;
|
|
831
1031
|
} else if (oldVNode.$text$ !== text) {
|
|
832
1032
|
elm.data = text;
|
|
833
1033
|
}
|
|
834
1034
|
};
|
|
1035
|
+
var relocateNodes = [];
|
|
1036
|
+
var markSlotContentForRelocation = (elm) => {
|
|
1037
|
+
let node;
|
|
1038
|
+
let hostContentNodes;
|
|
1039
|
+
let j;
|
|
1040
|
+
const children = elm.__childNodes || elm.childNodes;
|
|
1041
|
+
for (const childNode of children) {
|
|
1042
|
+
if (childNode["s-sr"] && (node = childNode["s-cr"]) && node.parentNode) {
|
|
1043
|
+
hostContentNodes = node.parentNode.__childNodes || node.parentNode.childNodes;
|
|
1044
|
+
const slotName = childNode["s-sn"];
|
|
1045
|
+
for (j = hostContentNodes.length - 1; j >= 0; j--) {
|
|
1046
|
+
node = hostContentNodes[j];
|
|
1047
|
+
if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (true)) {
|
|
1048
|
+
if (isNodeLocatedInSlot(node, slotName)) {
|
|
1049
|
+
let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
|
|
1050
|
+
checkSlotFallbackVisibility = true;
|
|
1051
|
+
node["s-sn"] = node["s-sn"] || slotName;
|
|
1052
|
+
if (relocateNodeData) {
|
|
1053
|
+
relocateNodeData.$nodeToRelocate$["s-sh"] = childNode["s-hn"];
|
|
1054
|
+
relocateNodeData.$slotRefNode$ = childNode;
|
|
1055
|
+
} else {
|
|
1056
|
+
node["s-sh"] = childNode["s-hn"];
|
|
1057
|
+
relocateNodes.push({
|
|
1058
|
+
$slotRefNode$: childNode,
|
|
1059
|
+
$nodeToRelocate$: node
|
|
1060
|
+
});
|
|
1061
|
+
}
|
|
1062
|
+
if (node["s-sr"]) {
|
|
1063
|
+
relocateNodes.map((relocateNode) => {
|
|
1064
|
+
if (isNodeLocatedInSlot(relocateNode.$nodeToRelocate$, node["s-sn"])) {
|
|
1065
|
+
relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
|
|
1066
|
+
if (relocateNodeData && !relocateNode.$slotRefNode$) {
|
|
1067
|
+
relocateNode.$slotRefNode$ = relocateNodeData.$slotRefNode$;
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1070
|
+
});
|
|
1071
|
+
}
|
|
1072
|
+
} else if (!relocateNodes.some((r) => r.$nodeToRelocate$ === node)) {
|
|
1073
|
+
relocateNodes.push({
|
|
1074
|
+
$nodeToRelocate$: node
|
|
1075
|
+
});
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
1081
|
+
markSlotContentForRelocation(childNode);
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
};
|
|
835
1085
|
var nullifyVNodeRefs = (vNode) => {
|
|
836
1086
|
{
|
|
837
1087
|
vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
|
|
@@ -844,6 +1094,7 @@ var insertBefore = (parent, newNode, reference) => {
|
|
|
844
1094
|
}
|
|
845
1095
|
};
|
|
846
1096
|
var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
1097
|
+
var _a, _b, _c, _d;
|
|
847
1098
|
const hostElm = hostRef.$hostElement$;
|
|
848
1099
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
849
1100
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
@@ -867,7 +1118,78 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
867
1118
|
rootVnode.$flags$ |= 4 /* isHost */;
|
|
868
1119
|
hostRef.$vnode$ = rootVnode;
|
|
869
1120
|
rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
|
|
1121
|
+
useNativeShadowDom = !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && !(cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */);
|
|
1122
|
+
{
|
|
1123
|
+
contentRef = hostElm["s-cr"];
|
|
1124
|
+
checkSlotFallbackVisibility = false;
|
|
1125
|
+
}
|
|
870
1126
|
patch(oldVNode, rootVnode, isInitialLoad);
|
|
1127
|
+
{
|
|
1128
|
+
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
1129
|
+
if (checkSlotRelocate) {
|
|
1130
|
+
markSlotContentForRelocation(rootVnode.$elm$);
|
|
1131
|
+
for (const relocateData of relocateNodes) {
|
|
1132
|
+
const nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
1133
|
+
if (!nodeToRelocate["s-ol"] && win.document) {
|
|
1134
|
+
const orgLocationNode = win.document.createTextNode("");
|
|
1135
|
+
orgLocationNode["s-nr"] = nodeToRelocate;
|
|
1136
|
+
insertBefore(nodeToRelocate.parentNode, nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate);
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
for (const relocateData of relocateNodes) {
|
|
1140
|
+
const nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
1141
|
+
const slotRefNode = relocateData.$slotRefNode$;
|
|
1142
|
+
if (slotRefNode) {
|
|
1143
|
+
const parentNodeRef = slotRefNode.parentNode;
|
|
1144
|
+
let insertBeforeNode = slotRefNode.nextSibling;
|
|
1145
|
+
{
|
|
1146
|
+
let orgLocationNode = (_a = nodeToRelocate["s-ol"]) == null ? void 0 : _a.previousSibling;
|
|
1147
|
+
while (orgLocationNode) {
|
|
1148
|
+
let refNode = (_b = orgLocationNode["s-nr"]) != null ? _b : null;
|
|
1149
|
+
if (refNode && refNode["s-sn"] === nodeToRelocate["s-sn"] && parentNodeRef === (refNode.__parentNode || refNode.parentNode)) {
|
|
1150
|
+
refNode = refNode.nextSibling;
|
|
1151
|
+
while (refNode === nodeToRelocate || (refNode == null ? void 0 : refNode["s-sr"])) {
|
|
1152
|
+
refNode = refNode == null ? void 0 : refNode.nextSibling;
|
|
1153
|
+
}
|
|
1154
|
+
if (!refNode || !refNode["s-nr"]) {
|
|
1155
|
+
insertBeforeNode = refNode;
|
|
1156
|
+
break;
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
orgLocationNode = orgLocationNode.previousSibling;
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
const parent = nodeToRelocate.__parentNode || nodeToRelocate.parentNode;
|
|
1163
|
+
const nextSibling = nodeToRelocate.__nextSibling || nodeToRelocate.nextSibling;
|
|
1164
|
+
if (!insertBeforeNode && parentNodeRef !== parent || nextSibling !== insertBeforeNode) {
|
|
1165
|
+
if (nodeToRelocate !== insertBeforeNode) {
|
|
1166
|
+
if (!nodeToRelocate["s-hn"] && nodeToRelocate["s-ol"]) {
|
|
1167
|
+
nodeToRelocate["s-hn"] = nodeToRelocate["s-ol"].parentNode.nodeName;
|
|
1168
|
+
}
|
|
1169
|
+
insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
|
|
1170
|
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */ && nodeToRelocate.tagName !== "SLOT-FB") {
|
|
1171
|
+
nodeToRelocate.hidden = (_c = nodeToRelocate["s-ih"]) != null ? _c : false;
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
nodeToRelocate && typeof slotRefNode["s-rf"] === "function" && slotRefNode["s-rf"](slotRefNode);
|
|
1176
|
+
} else {
|
|
1177
|
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1178
|
+
if (isInitialLoad) {
|
|
1179
|
+
nodeToRelocate["s-ih"] = (_d = nodeToRelocate.hidden) != null ? _d : false;
|
|
1180
|
+
}
|
|
1181
|
+
nodeToRelocate.hidden = true;
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1186
|
+
if (checkSlotFallbackVisibility) {
|
|
1187
|
+
updateFallbackSlotVisibility(rootVnode.$elm$);
|
|
1188
|
+
}
|
|
1189
|
+
plt.$flags$ &= -2 /* isTmpDisconnected */;
|
|
1190
|
+
relocateNodes.length = 0;
|
|
1191
|
+
}
|
|
1192
|
+
contentRef = void 0;
|
|
871
1193
|
};
|
|
872
1194
|
|
|
873
1195
|
// src/runtime/update-component.ts
|
|
@@ -1316,6 +1638,12 @@ var connectedCallback = (elm) => {
|
|
|
1316
1638
|
const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
|
|
1317
1639
|
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
1318
1640
|
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
1641
|
+
{
|
|
1642
|
+
if (// TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
|
|
1643
|
+
cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
|
|
1644
|
+
setContentReference(elm);
|
|
1645
|
+
}
|
|
1646
|
+
}
|
|
1319
1647
|
{
|
|
1320
1648
|
let ancestorComponent = elm;
|
|
1321
1649
|
while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
|
|
@@ -1348,6 +1676,16 @@ var connectedCallback = (elm) => {
|
|
|
1348
1676
|
endConnected();
|
|
1349
1677
|
}
|
|
1350
1678
|
};
|
|
1679
|
+
var setContentReference = (elm) => {
|
|
1680
|
+
if (!win.document) {
|
|
1681
|
+
return;
|
|
1682
|
+
}
|
|
1683
|
+
const contentRefElm = elm["s-cr"] = win.document.createComment(
|
|
1684
|
+
""
|
|
1685
|
+
);
|
|
1686
|
+
contentRefElm["s-cn"] = true;
|
|
1687
|
+
insertBefore(elm, contentRefElm, elm.firstChild);
|
|
1688
|
+
};
|
|
1351
1689
|
var disconnectInstance = (instance, elm) => {
|
|
1352
1690
|
{
|
|
1353
1691
|
safeCall(instance, "disconnectedCallback", void 0, elm || instance);
|
|
@@ -1546,6 +1884,9 @@ var hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
|
1546
1884
|
}
|
|
1547
1885
|
};
|
|
1548
1886
|
var getHostListenerTarget = (doc, elm, flags) => {
|
|
1887
|
+
if (flags & 4 /* TargetDocument */) {
|
|
1888
|
+
return doc;
|
|
1889
|
+
}
|
|
1549
1890
|
if (flags & 8 /* TargetWindow */) {
|
|
1550
1891
|
return win;
|
|
1551
1892
|
}
|
|
@@ -1571,6 +1912,6 @@ exports.h = h;
|
|
|
1571
1912
|
exports.promiseResolve = promiseResolve;
|
|
1572
1913
|
exports.registerInstance = registerInstance;
|
|
1573
1914
|
exports.setNonce = setNonce;
|
|
1574
|
-
//# sourceMappingURL=index-
|
|
1915
|
+
//# sourceMappingURL=index-MLh9SbX2.js.map
|
|
1575
1916
|
|
|
1576
|
-
//# sourceMappingURL=index-
|
|
1917
|
+
//# sourceMappingURL=index-MLh9SbX2.js.map
|