xv-webcomponents 0.1.39 → 0.1.42
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_34.cjs.entry.js} +2323 -97
- package/dist/cjs/xv-accordion-v2_34.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 +8 -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/_vars.js +3 -0
- package/dist/collection/components/xv-data-table/_vars.js.map +1 -0
- package/dist/collection/components/xv-data-table/xv-data-table-cell/xv-data-table-cell.css +90 -0
- package/dist/collection/components/xv-data-table/xv-data-table-cell/xv-data-table-cell.js +182 -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-collapse/xv-data-table-collapse.css +7 -0
- package/dist/collection/components/xv-data-table/xv-data-table-collapse/xv-data-table-collapse.js +101 -0
- package/dist/collection/components/xv-data-table/xv-data-table-collapse/xv-data-table-collapse.js.map +1 -0
- package/dist/collection/components/xv-data-table/xv-data-table-row/xv-data-table-row.css +71 -0
- package/dist/collection/components/xv-data-table/xv-data-table-row/xv-data-table-row.js +354 -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 +104 -0
- package/dist/collection/components/xv-data-table/xv-data-table.js +114 -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.css +1 -0
- 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/_vars.js +0 -6
- package/dist/collection/components/xv-table/_vars.js.map +1 -1
- package/dist/collection/components/xv-table/xv-table-cell/xv-table-cell.js +4 -4
- package/dist/collection/components/xv-table/xv-table-cell/xv-table-cell.js.map +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/collection/types/enum.js +6 -0
- package/dist/collection/types/enum.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_34.entry.js} +2317 -98
- package/dist/esm/xv-accordion-v2_34.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/_vars.d.ts +11 -0
- package/dist/types/components/xv-data-table/xv-data-table-cell/xv-data-table-cell.d.ts +13 -0
- package/dist/types/components/xv-data-table/xv-data-table-collapse/xv-data-table-collapse.d.ts +9 -0
- package/dist/types/components/xv-data-table/xv-data-table-row/xv-data-table-row.d.ts +25 -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-table/_vars.d.ts +1 -5
- package/dist/types/components/xv-table/xv-table-cell/xv-table-cell.d.ts +2 -1
- 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 +761 -53
- package/dist/types/types/enum.d.ts +5 -0
- package/dist/xv-webcomponents/{p-054f5d59.entry.js → p-5b63a259.entry.js} +2 -2
- package/dist/xv-webcomponents/p-9c06f44c.entry.js +2 -0
- package/dist/xv-webcomponents/p-9c06f44c.entry.js.map +1 -0
- package/dist/xv-webcomponents/p-DLYJiP99.js +3 -0
- package/dist/xv-webcomponents/p-DLYJiP99.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,8 +1,8 @@
|
|
|
1
1
|
const NAMESPACE = 'xv-webcomponents';
|
|
2
|
-
const BUILD = /* xv-webcomponents */ { hydratedSelectorName: "hydrated", lazyLoad: true, updatable: true};
|
|
2
|
+
const BUILD = /* xv-webcomponents */ { hydratedSelectorName: "hydrated", lazyLoad: true, slotRelocation: true, updatable: true};
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
|
-
Stencil Client Platform v4.
|
|
5
|
+
Stencil Client Platform v4.32.0 | MIT Licensed | https://stenciljs.com
|
|
6
6
|
*/
|
|
7
7
|
var __defProp = Object.defineProperty;
|
|
8
8
|
var __export = (target, all) => {
|
|
@@ -225,6 +225,112 @@ var unwrapErr = (result) => {
|
|
|
225
225
|
throw result.value;
|
|
226
226
|
}
|
|
227
227
|
};
|
|
228
|
+
var updateFallbackSlotVisibility = (elm) => {
|
|
229
|
+
const childNodes = internalCall(elm, "childNodes");
|
|
230
|
+
if (elm.tagName && elm.tagName.includes("-") && elm["s-cr"] && elm.tagName !== "SLOT-FB") {
|
|
231
|
+
getHostSlotNodes(childNodes, elm.tagName).forEach((slotNode) => {
|
|
232
|
+
if (slotNode.nodeType === 1 /* ElementNode */ && slotNode.tagName === "SLOT-FB") {
|
|
233
|
+
if (getSlotChildSiblings(slotNode, getSlotName(slotNode), false).length) {
|
|
234
|
+
slotNode.hidden = true;
|
|
235
|
+
} else {
|
|
236
|
+
slotNode.hidden = false;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
let i2 = 0;
|
|
242
|
+
for (i2 = 0; i2 < childNodes.length; i2++) {
|
|
243
|
+
const childNode = childNodes[i2];
|
|
244
|
+
if (childNode.nodeType === 1 /* ElementNode */ && internalCall(childNode, "childNodes").length) {
|
|
245
|
+
updateFallbackSlotVisibility(childNode);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
var getSlottedChildNodes = (childNodes) => {
|
|
250
|
+
const result = [];
|
|
251
|
+
for (let i2 = 0; i2 < childNodes.length; i2++) {
|
|
252
|
+
const slottedNode = childNodes[i2]["s-nr"] || void 0;
|
|
253
|
+
if (slottedNode && slottedNode.isConnected) {
|
|
254
|
+
result.push(slottedNode);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
return result;
|
|
258
|
+
};
|
|
259
|
+
function getHostSlotNodes(childNodes, hostName, slotName) {
|
|
260
|
+
let i2 = 0;
|
|
261
|
+
let slottedNodes = [];
|
|
262
|
+
let childNode;
|
|
263
|
+
for (; i2 < childNodes.length; i2++) {
|
|
264
|
+
childNode = childNodes[i2];
|
|
265
|
+
if (childNode["s-sr"] && (!hostName || childNode["s-hn"] === hostName) && (slotName === void 0)) {
|
|
266
|
+
slottedNodes.push(childNode);
|
|
267
|
+
}
|
|
268
|
+
slottedNodes = [...slottedNodes, ...getHostSlotNodes(childNode.childNodes, hostName, slotName)];
|
|
269
|
+
}
|
|
270
|
+
return slottedNodes;
|
|
271
|
+
}
|
|
272
|
+
var getSlotChildSiblings = (slot, slotName, includeSlot = true) => {
|
|
273
|
+
const childNodes = [];
|
|
274
|
+
if (includeSlot && slot["s-sr"] || !slot["s-sr"]) childNodes.push(slot);
|
|
275
|
+
let node = slot;
|
|
276
|
+
while (node = node.nextSibling) {
|
|
277
|
+
if (getSlotName(node) === slotName && (includeSlot || !node["s-sr"])) childNodes.push(node);
|
|
278
|
+
}
|
|
279
|
+
return childNodes;
|
|
280
|
+
};
|
|
281
|
+
var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
|
|
282
|
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
283
|
+
if (nodeToRelocate.getAttribute("slot") === null && slotName === "") {
|
|
284
|
+
return true;
|
|
285
|
+
}
|
|
286
|
+
if (nodeToRelocate.getAttribute("slot") === slotName) {
|
|
287
|
+
return true;
|
|
288
|
+
}
|
|
289
|
+
return false;
|
|
290
|
+
}
|
|
291
|
+
if (nodeToRelocate["s-sn"] === slotName) {
|
|
292
|
+
return true;
|
|
293
|
+
}
|
|
294
|
+
return slotName === "";
|
|
295
|
+
};
|
|
296
|
+
var getSlotName = (node) => typeof node["s-sn"] === "string" ? node["s-sn"] : node.nodeType === 1 && node.getAttribute("slot") || void 0;
|
|
297
|
+
function patchSlotNode(node) {
|
|
298
|
+
if (node.assignedElements || node.assignedNodes || !node["s-sr"]) return;
|
|
299
|
+
const assignedFactory = (elementsOnly) => (function(opts) {
|
|
300
|
+
const toReturn = [];
|
|
301
|
+
const slotName = this["s-sn"];
|
|
302
|
+
if (opts == null ? void 0 : opts.flatten) {
|
|
303
|
+
console.error(`
|
|
304
|
+
Flattening is not supported for Stencil non-shadow slots.
|
|
305
|
+
You can use \`.childNodes\` to nested slot fallback content.
|
|
306
|
+
If you have a particular use case, please open an issue on the Stencil repo.
|
|
307
|
+
`);
|
|
308
|
+
}
|
|
309
|
+
const parent = this["s-cr"].parentElement;
|
|
310
|
+
const slottedNodes = parent.__childNodes ? parent.childNodes : getSlottedChildNodes(parent.childNodes);
|
|
311
|
+
slottedNodes.forEach((n) => {
|
|
312
|
+
if (slotName === getSlotName(n)) {
|
|
313
|
+
toReturn.push(n);
|
|
314
|
+
}
|
|
315
|
+
});
|
|
316
|
+
if (elementsOnly) {
|
|
317
|
+
return toReturn.filter((n) => n.nodeType === 1 /* ElementNode */);
|
|
318
|
+
}
|
|
319
|
+
return toReturn;
|
|
320
|
+
}).bind(node);
|
|
321
|
+
node.assignedElements = assignedFactory(true);
|
|
322
|
+
node.assignedNodes = assignedFactory(false);
|
|
323
|
+
}
|
|
324
|
+
function internalCall(node, method) {
|
|
325
|
+
if ("__" + method in node) {
|
|
326
|
+
const toReturn = node["__" + method];
|
|
327
|
+
if (typeof toReturn !== "function") return toReturn;
|
|
328
|
+
return toReturn.bind(node);
|
|
329
|
+
} else {
|
|
330
|
+
if (typeof node[method] !== "function") return node[method];
|
|
331
|
+
return node[method].bind(node);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
228
334
|
var createTime = (fnName, tagName = "") => {
|
|
229
335
|
{
|
|
230
336
|
return () => {
|
|
@@ -242,6 +348,7 @@ var uniqueTime = (key, measureText) => {
|
|
|
242
348
|
var h = (nodeName, vnodeData, ...children) => {
|
|
243
349
|
let child = null;
|
|
244
350
|
let key = null;
|
|
351
|
+
let slotName = null;
|
|
245
352
|
let simple = false;
|
|
246
353
|
let lastSimple = false;
|
|
247
354
|
const vNodeChildren = [];
|
|
@@ -268,6 +375,9 @@ var h = (nodeName, vnodeData, ...children) => {
|
|
|
268
375
|
if (vnodeData.key) {
|
|
269
376
|
key = vnodeData.key;
|
|
270
377
|
}
|
|
378
|
+
if (vnodeData.name) {
|
|
379
|
+
slotName = vnodeData.name;
|
|
380
|
+
}
|
|
271
381
|
{
|
|
272
382
|
const classData = vnodeData.className || vnodeData.class;
|
|
273
383
|
if (classData) {
|
|
@@ -290,6 +400,9 @@ var h = (nodeName, vnodeData, ...children) => {
|
|
|
290
400
|
{
|
|
291
401
|
vnode.$key$ = key;
|
|
292
402
|
}
|
|
403
|
+
{
|
|
404
|
+
vnode.$name$ = slotName;
|
|
405
|
+
}
|
|
293
406
|
return vnode;
|
|
294
407
|
};
|
|
295
408
|
var newVNode = (tag, text) => {
|
|
@@ -306,6 +419,9 @@ var newVNode = (tag, text) => {
|
|
|
306
419
|
{
|
|
307
420
|
vnode.$key$ = null;
|
|
308
421
|
}
|
|
422
|
+
{
|
|
423
|
+
vnode.$name$ = null;
|
|
424
|
+
}
|
|
309
425
|
return vnode;
|
|
310
426
|
};
|
|
311
427
|
var Host = {};
|
|
@@ -626,15 +742,41 @@ function sortedAttrNames(attrNames) {
|
|
|
626
742
|
attrNames
|
|
627
743
|
);
|
|
628
744
|
}
|
|
745
|
+
var contentRef;
|
|
629
746
|
var hostTagName;
|
|
747
|
+
var useNativeShadowDom = false;
|
|
748
|
+
var checkSlotFallbackVisibility = false;
|
|
749
|
+
var checkSlotRelocate = false;
|
|
630
750
|
var isSvgMode = false;
|
|
631
751
|
var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
752
|
+
var _a;
|
|
632
753
|
const newVNode2 = newParentVNode.$children$[childIndex];
|
|
633
754
|
let i2 = 0;
|
|
634
755
|
let elm;
|
|
635
756
|
let childNode;
|
|
757
|
+
let oldVNode;
|
|
758
|
+
if (!useNativeShadowDom) {
|
|
759
|
+
checkSlotRelocate = true;
|
|
760
|
+
if (newVNode2.$tag$ === "slot") {
|
|
761
|
+
newVNode2.$flags$ |= newVNode2.$children$ ? (
|
|
762
|
+
// slot element has fallback content
|
|
763
|
+
// still create an element that "mocks" the slot element
|
|
764
|
+
2 /* isSlotFallback */
|
|
765
|
+
) : (
|
|
766
|
+
// slot element does not have fallback content
|
|
767
|
+
// create an html comment we'll use to always reference
|
|
768
|
+
// where actual slot content should sit next to
|
|
769
|
+
1 /* isSlotReference */
|
|
770
|
+
);
|
|
771
|
+
}
|
|
772
|
+
}
|
|
636
773
|
if (newVNode2.$text$ !== null) {
|
|
637
774
|
elm = newVNode2.$elm$ = win.document.createTextNode(newVNode2.$text$);
|
|
775
|
+
} else if (newVNode2.$flags$ & 1 /* isSlotReference */) {
|
|
776
|
+
elm = newVNode2.$elm$ = win.document.createTextNode("");
|
|
777
|
+
{
|
|
778
|
+
updateElement(null, newVNode2, isSvgMode);
|
|
779
|
+
}
|
|
638
780
|
} else {
|
|
639
781
|
if (!isSvgMode) {
|
|
640
782
|
isSvgMode = newVNode2.$tag$ === "svg";
|
|
@@ -646,7 +788,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
646
788
|
}
|
|
647
789
|
elm = newVNode2.$elm$ = win.document.createElementNS(
|
|
648
790
|
isSvgMode ? SVG_NS : HTML_NS,
|
|
649
|
-
newVNode2.$tag$
|
|
791
|
+
!useNativeShadowDom && BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
|
|
650
792
|
) ;
|
|
651
793
|
if (isSvgMode && newVNode2.$tag$ === "foreignObject") {
|
|
652
794
|
isSvgMode = false;
|
|
@@ -671,10 +813,43 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
671
813
|
}
|
|
672
814
|
}
|
|
673
815
|
elm["s-hn"] = hostTagName;
|
|
816
|
+
{
|
|
817
|
+
if (newVNode2.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
|
|
818
|
+
elm["s-sr"] = true;
|
|
819
|
+
elm["s-cr"] = contentRef;
|
|
820
|
+
elm["s-sn"] = newVNode2.$name$ || "";
|
|
821
|
+
elm["s-rf"] = (_a = newVNode2.$attrs$) == null ? void 0 : _a.ref;
|
|
822
|
+
patchSlotNode(elm);
|
|
823
|
+
oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
|
|
824
|
+
if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) {
|
|
825
|
+
{
|
|
826
|
+
putBackInOriginalLocation(oldParentVNode.$elm$, false);
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
}
|
|
674
831
|
return elm;
|
|
675
832
|
};
|
|
833
|
+
var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
834
|
+
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
835
|
+
const oldSlotChildNodes = Array.from(parentElm.__childNodes || parentElm.childNodes);
|
|
836
|
+
for (let i2 = oldSlotChildNodes.length - 1; i2 >= 0; i2--) {
|
|
837
|
+
const childNode = oldSlotChildNodes[i2];
|
|
838
|
+
if (childNode["s-hn"] !== hostTagName && childNode["s-ol"]) {
|
|
839
|
+
insertBefore(referenceNode(childNode).parentNode, childNode, referenceNode(childNode));
|
|
840
|
+
childNode["s-ol"].remove();
|
|
841
|
+
childNode["s-ol"] = void 0;
|
|
842
|
+
childNode["s-sh"] = void 0;
|
|
843
|
+
checkSlotRelocate = true;
|
|
844
|
+
}
|
|
845
|
+
if (recursive) {
|
|
846
|
+
putBackInOriginalLocation(childNode, recursive);
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
plt.$flags$ &= -2 /* isTmpDisconnected */;
|
|
850
|
+
};
|
|
676
851
|
var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
677
|
-
let containerElm = parentElm;
|
|
852
|
+
let containerElm = parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
|
|
678
853
|
let childNode;
|
|
679
854
|
if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
|
|
680
855
|
containerElm = containerElm.shadowRoot;
|
|
@@ -684,7 +859,7 @@ var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
|
684
859
|
childNode = createElm(null, parentVNode, startIdx);
|
|
685
860
|
if (childNode) {
|
|
686
861
|
vnodes[startIdx].$elm$ = childNode;
|
|
687
|
-
insertBefore(containerElm, childNode, before);
|
|
862
|
+
insertBefore(containerElm, childNode, referenceNode(before) );
|
|
688
863
|
}
|
|
689
864
|
}
|
|
690
865
|
}
|
|
@@ -696,6 +871,14 @@ var removeVnodes = (vnodes, startIdx, endIdx) => {
|
|
|
696
871
|
const elm = vnode.$elm$;
|
|
697
872
|
nullifyVNodeRefs(vnode);
|
|
698
873
|
if (elm) {
|
|
874
|
+
{
|
|
875
|
+
checkSlotFallbackVisibility = true;
|
|
876
|
+
if (elm["s-ol"]) {
|
|
877
|
+
elm["s-ol"].remove();
|
|
878
|
+
} else {
|
|
879
|
+
putBackInOriginalLocation(elm, true);
|
|
880
|
+
}
|
|
881
|
+
}
|
|
699
882
|
elm.remove();
|
|
700
883
|
}
|
|
701
884
|
}
|
|
@@ -732,11 +915,17 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
732
915
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
733
916
|
newEndVnode = newCh[--newEndIdx];
|
|
734
917
|
} else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
|
|
918
|
+
if ((oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
|
|
919
|
+
putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
|
|
920
|
+
}
|
|
735
921
|
patch(oldStartVnode, newEndVnode, isInitialRender);
|
|
736
922
|
insertBefore(parentElm, oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
|
|
737
923
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
738
924
|
newEndVnode = newCh[--newEndIdx];
|
|
739
925
|
} else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
|
|
926
|
+
if ((oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
|
|
927
|
+
putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
|
|
928
|
+
}
|
|
740
929
|
patch(oldEndVnode, newStartVnode, isInitialRender);
|
|
741
930
|
insertBefore(parentElm, oldEndVnode.$elm$, oldStartVnode.$elm$);
|
|
742
931
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
@@ -767,7 +956,11 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
767
956
|
}
|
|
768
957
|
if (node) {
|
|
769
958
|
{
|
|
770
|
-
insertBefore(
|
|
959
|
+
insertBefore(
|
|
960
|
+
referenceNode(oldStartVnode.$elm$).parentNode,
|
|
961
|
+
node,
|
|
962
|
+
referenceNode(oldStartVnode.$elm$)
|
|
963
|
+
);
|
|
771
964
|
}
|
|
772
965
|
}
|
|
773
966
|
}
|
|
@@ -787,6 +980,9 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
787
980
|
};
|
|
788
981
|
var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
789
982
|
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
983
|
+
if (leftVNode.$tag$ === "slot") {
|
|
984
|
+
return leftVNode.$name$ === rightVNode.$name$;
|
|
985
|
+
}
|
|
790
986
|
if (!isInitialRender) {
|
|
791
987
|
return leftVNode.$key$ === rightVNode.$key$;
|
|
792
988
|
}
|
|
@@ -797,12 +993,14 @@ var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
|
797
993
|
}
|
|
798
994
|
return false;
|
|
799
995
|
};
|
|
996
|
+
var referenceNode = (node) => node && node["s-ol"] || node;
|
|
800
997
|
var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
801
998
|
const elm = newVNode2.$elm$ = oldVNode.$elm$;
|
|
802
999
|
const oldChildren = oldVNode.$children$;
|
|
803
1000
|
const newChildren = newVNode2.$children$;
|
|
804
1001
|
const tag = newVNode2.$tag$;
|
|
805
1002
|
const text = newVNode2.$text$;
|
|
1003
|
+
let defaultHolder;
|
|
806
1004
|
if (text === null) {
|
|
807
1005
|
{
|
|
808
1006
|
isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
|
|
@@ -826,10 +1024,62 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
826
1024
|
if (isSvgMode && tag === "svg") {
|
|
827
1025
|
isSvgMode = false;
|
|
828
1026
|
}
|
|
1027
|
+
} else if ((defaultHolder = elm["s-cr"])) {
|
|
1028
|
+
defaultHolder.parentNode.textContent = text;
|
|
829
1029
|
} else if (oldVNode.$text$ !== text) {
|
|
830
1030
|
elm.data = text;
|
|
831
1031
|
}
|
|
832
1032
|
};
|
|
1033
|
+
var relocateNodes = [];
|
|
1034
|
+
var markSlotContentForRelocation = (elm) => {
|
|
1035
|
+
let node;
|
|
1036
|
+
let hostContentNodes;
|
|
1037
|
+
let j;
|
|
1038
|
+
const children = elm.__childNodes || elm.childNodes;
|
|
1039
|
+
for (const childNode of children) {
|
|
1040
|
+
if (childNode["s-sr"] && (node = childNode["s-cr"]) && node.parentNode) {
|
|
1041
|
+
hostContentNodes = node.parentNode.__childNodes || node.parentNode.childNodes;
|
|
1042
|
+
const slotName = childNode["s-sn"];
|
|
1043
|
+
for (j = hostContentNodes.length - 1; j >= 0; j--) {
|
|
1044
|
+
node = hostContentNodes[j];
|
|
1045
|
+
if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (true)) {
|
|
1046
|
+
if (isNodeLocatedInSlot(node, slotName)) {
|
|
1047
|
+
let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
|
|
1048
|
+
checkSlotFallbackVisibility = true;
|
|
1049
|
+
node["s-sn"] = node["s-sn"] || slotName;
|
|
1050
|
+
if (relocateNodeData) {
|
|
1051
|
+
relocateNodeData.$nodeToRelocate$["s-sh"] = childNode["s-hn"];
|
|
1052
|
+
relocateNodeData.$slotRefNode$ = childNode;
|
|
1053
|
+
} else {
|
|
1054
|
+
node["s-sh"] = childNode["s-hn"];
|
|
1055
|
+
relocateNodes.push({
|
|
1056
|
+
$slotRefNode$: childNode,
|
|
1057
|
+
$nodeToRelocate$: node
|
|
1058
|
+
});
|
|
1059
|
+
}
|
|
1060
|
+
if (node["s-sr"]) {
|
|
1061
|
+
relocateNodes.map((relocateNode) => {
|
|
1062
|
+
if (isNodeLocatedInSlot(relocateNode.$nodeToRelocate$, node["s-sn"])) {
|
|
1063
|
+
relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
|
|
1064
|
+
if (relocateNodeData && !relocateNode.$slotRefNode$) {
|
|
1065
|
+
relocateNode.$slotRefNode$ = relocateNodeData.$slotRefNode$;
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
});
|
|
1069
|
+
}
|
|
1070
|
+
} else if (!relocateNodes.some((r) => r.$nodeToRelocate$ === node)) {
|
|
1071
|
+
relocateNodes.push({
|
|
1072
|
+
$nodeToRelocate$: node
|
|
1073
|
+
});
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1078
|
+
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
1079
|
+
markSlotContentForRelocation(childNode);
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1082
|
+
};
|
|
833
1083
|
var nullifyVNodeRefs = (vNode) => {
|
|
834
1084
|
{
|
|
835
1085
|
vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
|
|
@@ -842,6 +1092,7 @@ var insertBefore = (parent, newNode, reference) => {
|
|
|
842
1092
|
}
|
|
843
1093
|
};
|
|
844
1094
|
var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
1095
|
+
var _a, _b, _c, _d;
|
|
845
1096
|
const hostElm = hostRef.$hostElement$;
|
|
846
1097
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
847
1098
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
@@ -865,7 +1116,78 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
865
1116
|
rootVnode.$flags$ |= 4 /* isHost */;
|
|
866
1117
|
hostRef.$vnode$ = rootVnode;
|
|
867
1118
|
rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
|
|
1119
|
+
useNativeShadowDom = !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && !(cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */);
|
|
1120
|
+
{
|
|
1121
|
+
contentRef = hostElm["s-cr"];
|
|
1122
|
+
checkSlotFallbackVisibility = false;
|
|
1123
|
+
}
|
|
868
1124
|
patch(oldVNode, rootVnode, isInitialLoad);
|
|
1125
|
+
{
|
|
1126
|
+
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
1127
|
+
if (checkSlotRelocate) {
|
|
1128
|
+
markSlotContentForRelocation(rootVnode.$elm$);
|
|
1129
|
+
for (const relocateData of relocateNodes) {
|
|
1130
|
+
const nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
1131
|
+
if (!nodeToRelocate["s-ol"] && win.document) {
|
|
1132
|
+
const orgLocationNode = win.document.createTextNode("");
|
|
1133
|
+
orgLocationNode["s-nr"] = nodeToRelocate;
|
|
1134
|
+
insertBefore(nodeToRelocate.parentNode, nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate);
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
for (const relocateData of relocateNodes) {
|
|
1138
|
+
const nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
1139
|
+
const slotRefNode = relocateData.$slotRefNode$;
|
|
1140
|
+
if (slotRefNode) {
|
|
1141
|
+
const parentNodeRef = slotRefNode.parentNode;
|
|
1142
|
+
let insertBeforeNode = slotRefNode.nextSibling;
|
|
1143
|
+
{
|
|
1144
|
+
let orgLocationNode = (_a = nodeToRelocate["s-ol"]) == null ? void 0 : _a.previousSibling;
|
|
1145
|
+
while (orgLocationNode) {
|
|
1146
|
+
let refNode = (_b = orgLocationNode["s-nr"]) != null ? _b : null;
|
|
1147
|
+
if (refNode && refNode["s-sn"] === nodeToRelocate["s-sn"] && parentNodeRef === (refNode.__parentNode || refNode.parentNode)) {
|
|
1148
|
+
refNode = refNode.nextSibling;
|
|
1149
|
+
while (refNode === nodeToRelocate || (refNode == null ? void 0 : refNode["s-sr"])) {
|
|
1150
|
+
refNode = refNode == null ? void 0 : refNode.nextSibling;
|
|
1151
|
+
}
|
|
1152
|
+
if (!refNode || !refNode["s-nr"]) {
|
|
1153
|
+
insertBeforeNode = refNode;
|
|
1154
|
+
break;
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
orgLocationNode = orgLocationNode.previousSibling;
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1160
|
+
const parent = nodeToRelocate.__parentNode || nodeToRelocate.parentNode;
|
|
1161
|
+
const nextSibling = nodeToRelocate.__nextSibling || nodeToRelocate.nextSibling;
|
|
1162
|
+
if (!insertBeforeNode && parentNodeRef !== parent || nextSibling !== insertBeforeNode) {
|
|
1163
|
+
if (nodeToRelocate !== insertBeforeNode) {
|
|
1164
|
+
if (!nodeToRelocate["s-hn"] && nodeToRelocate["s-ol"]) {
|
|
1165
|
+
nodeToRelocate["s-hn"] = nodeToRelocate["s-ol"].parentNode.nodeName;
|
|
1166
|
+
}
|
|
1167
|
+
insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
|
|
1168
|
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */ && nodeToRelocate.tagName !== "SLOT-FB") {
|
|
1169
|
+
nodeToRelocate.hidden = (_c = nodeToRelocate["s-ih"]) != null ? _c : false;
|
|
1170
|
+
}
|
|
1171
|
+
}
|
|
1172
|
+
}
|
|
1173
|
+
nodeToRelocate && typeof slotRefNode["s-rf"] === "function" && slotRefNode["s-rf"](slotRefNode);
|
|
1174
|
+
} else {
|
|
1175
|
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1176
|
+
if (isInitialLoad) {
|
|
1177
|
+
nodeToRelocate["s-ih"] = (_d = nodeToRelocate.hidden) != null ? _d : false;
|
|
1178
|
+
}
|
|
1179
|
+
nodeToRelocate.hidden = true;
|
|
1180
|
+
}
|
|
1181
|
+
}
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
if (checkSlotFallbackVisibility) {
|
|
1185
|
+
updateFallbackSlotVisibility(rootVnode.$elm$);
|
|
1186
|
+
}
|
|
1187
|
+
plt.$flags$ &= -2 /* isTmpDisconnected */;
|
|
1188
|
+
relocateNodes.length = 0;
|
|
1189
|
+
}
|
|
1190
|
+
contentRef = void 0;
|
|
869
1191
|
};
|
|
870
1192
|
|
|
871
1193
|
// src/runtime/update-component.ts
|
|
@@ -1314,6 +1636,12 @@ var connectedCallback = (elm) => {
|
|
|
1314
1636
|
const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
|
|
1315
1637
|
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
1316
1638
|
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
1639
|
+
{
|
|
1640
|
+
if (// TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
|
|
1641
|
+
cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
|
|
1642
|
+
setContentReference(elm);
|
|
1643
|
+
}
|
|
1644
|
+
}
|
|
1317
1645
|
{
|
|
1318
1646
|
let ancestorComponent = elm;
|
|
1319
1647
|
while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
|
|
@@ -1346,6 +1674,16 @@ var connectedCallback = (elm) => {
|
|
|
1346
1674
|
endConnected();
|
|
1347
1675
|
}
|
|
1348
1676
|
};
|
|
1677
|
+
var setContentReference = (elm) => {
|
|
1678
|
+
if (!win.document) {
|
|
1679
|
+
return;
|
|
1680
|
+
}
|
|
1681
|
+
const contentRefElm = elm["s-cr"] = win.document.createComment(
|
|
1682
|
+
""
|
|
1683
|
+
);
|
|
1684
|
+
contentRefElm["s-cn"] = true;
|
|
1685
|
+
insertBefore(elm, contentRefElm, elm.firstChild);
|
|
1686
|
+
};
|
|
1349
1687
|
var disconnectInstance = (instance, elm) => {
|
|
1350
1688
|
{
|
|
1351
1689
|
safeCall(instance, "disconnectedCallback", void 0, elm || instance);
|
|
@@ -1544,6 +1882,9 @@ var hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
|
1544
1882
|
}
|
|
1545
1883
|
};
|
|
1546
1884
|
var getHostListenerTarget = (doc, elm, flags) => {
|
|
1885
|
+
if (flags & 4 /* TargetDocument */) {
|
|
1886
|
+
return doc;
|
|
1887
|
+
}
|
|
1547
1888
|
if (flags & 8 /* TargetWindow */) {
|
|
1548
1889
|
return win;
|
|
1549
1890
|
}
|
|
@@ -1561,6 +1902,6 @@ var hostListenerOpts = (flags) => supportsListenerOptions ? {
|
|
|
1561
1902
|
var setNonce = (nonce) => plt.$nonce$ = nonce;
|
|
1562
1903
|
|
|
1563
1904
|
export { Fragment as F, Host as H, bootstrapLazy as b, createEvent as c, getElement as g, h, promiseResolve as p, registerInstance as r, setNonce as s };
|
|
1564
|
-
//# sourceMappingURL=index-
|
|
1905
|
+
//# sourceMappingURL=index-DLYJiP99.js.map
|
|
1565
1906
|
|
|
1566
|
-
//# sourceMappingURL=index-
|
|
1907
|
+
//# sourceMappingURL=index-DLYJiP99.js.map
|