@mgdis/core-ui-helpers 1.3.2 → 1.4.0

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.
@@ -4,7 +4,7 @@ var BUILD = {
4
4
  slotRelocation: true};
5
5
 
6
6
  /*
7
- Stencil Client Platform v4.43.5 | MIT Licensed | https://stenciljs.com
7
+ Stencil Client Platform v4.45.1 | MIT Licensed | https://stenciljs.com
8
8
  */
9
9
 
10
10
 
@@ -20,6 +20,7 @@ var getHostRef = (ref) => {
20
20
  return void 0;
21
21
  };
22
22
  var isMemberInElement = (elm, memberName) => memberName in elm;
23
+ var consoleError = (e, el) => (0, console.error)(e, el);
23
24
  var XLINK_NS = "http://www.w3.org/1999/xlink";
24
25
  var win = typeof window !== "undefined" ? window : {};
25
26
  var plt = {
@@ -72,7 +73,7 @@ function getHostSlotNodes(childNodes, hostName, slotName) {
72
73
  slottedNodes.push(childNode);
73
74
  if (typeof slotName !== "undefined") return slottedNodes;
74
75
  }
75
- slottedNodes = [...slottedNodes, ...getHostSlotNodes(childNode.childNodes, hostName, slotName)];
76
+ slottedNodes = [...slottedNodes, ...getHostSlotNodes(internalCall(childNode, "childNodes"), hostName, slotName)];
76
77
  }
77
78
  return slottedNodes;
78
79
  }
@@ -174,6 +175,11 @@ var h = (nodeName, vnodeData, ...children) => {
174
175
  } else if (child != null && typeof child !== "boolean") {
175
176
  if (simple = !isComplexType(child)) {
176
177
  child = String(child);
178
+ } else if (child.$flags$ === void 0) {
179
+ {
180
+ consoleError("Invalid vNode child");
181
+ }
182
+ continue;
177
183
  }
178
184
  if (simple && lastSimple) {
179
185
  vNodeChildren[vNodeChildren.length - 1].$text$ += child;
@@ -336,7 +342,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
336
342
  }
337
343
  }
338
344
  if (newValue == null || newValue === false) {
339
- if (newValue !== false || elm.getAttribute(memberName) === "") {
345
+ if (newValue !== false || elm.getAttribute(memberName) === "" || flags & 4 /* isHost */ && !isEnumeratedAttribute(memberName)) {
340
346
  if (xlink) {
341
347
  elm.removeAttributeNS(XLINK_NS, memberName);
342
348
  } else {
@@ -353,6 +359,8 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
353
359
  }
354
360
  }
355
361
  };
362
+ var ENUMERATED_ATTRIBUTES = /* @__PURE__ */ new Set(["draggable", "contenteditable", "spellcheck"]);
363
+ var isEnumeratedAttribute = (attrName) => ENUMERATED_ATTRIBUTES.has(attrName) || attrName.startsWith("aria-");
356
364
  var parseClassListRegex = /\s/;
357
365
  var parseClassList = (value) => {
358
366
  if (typeof value === "object" && value && "baseVal" in value) {
@@ -644,7 +652,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
644
652
  if (idxInOld >= 0) {
645
653
  elmToMove = oldCh[idxInOld];
646
654
  if (elmToMove.$tag$ !== newStartVnode.$tag$) {
647
- node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld);
655
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx);
648
656
  } else {
649
657
  patch(elmToMove, newStartVnode, isInitialRender);
650
658
  oldCh[idxInOld] = void 0;
@@ -749,7 +757,10 @@ var markSlotContentForRelocation = (elm) => {
749
757
  const slotName = childNode["s-sn"];
750
758
  for (j = hostContentNodes.length - 1; j >= 0; j--) {
751
759
  node = hostContentNodes[j];
752
- if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!node["s-sh"] || node["s-sh"] !== childNode["s-hn"])) {
760
+ if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && // let an exact named-slot match override a stale default-slot claim. Skip this for
761
+ // `slotName === ''` itself - a matched default node's cached `s-sn` is `''` too, which
762
+ // would trivially "match" on every re-render and force pointless re-insertion.
763
+ (!node["s-sh"] || node["s-sh"] !== childNode["s-hn"] || slotName !== "" && getSlotName(node) === slotName)) {
753
764
  if (isNodeLocatedInSlot(node, slotName)) {
754
765
  let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
755
766
  checkSlotFallbackVisibility = true;
@@ -819,7 +830,7 @@ var insertBefore = (parent, newNode, reference, isInitialLoad) => {
819
830
  return newNode;
820
831
  }
821
832
  }
822
- if (parent.__insertBefore) {
833
+ if ((parent == null ? void 0 : parent.__insertBefore)) {
823
834
  return parent.__insertBefore(newNode, reference);
824
835
  } else {
825
836
  return parent == null ? void 0 : parent.insertBefore(newNode, reference);