@mgdis/core-ui-helpers 1.3.2 → 1.5.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.
@@ -10,7 +10,7 @@
10
10
  slotRelocation: true};
11
11
 
12
12
  /*
13
- Stencil Client Platform v4.43.5 | MIT Licensed | https://stenciljs.com
13
+ Stencil Client Platform v4.45.2 | MIT Licensed | https://stenciljs.com
14
14
  */
15
15
 
16
16
 
@@ -26,6 +26,7 @@
26
26
  return void 0;
27
27
  };
28
28
  var isMemberInElement = (elm, memberName) => memberName in elm;
29
+ var consoleError = (e, el) => (0, console.error)(e, el);
29
30
  var XLINK_NS = "http://www.w3.org/1999/xlink";
30
31
  var win = typeof window !== "undefined" ? window : {};
31
32
  var plt = {
@@ -78,7 +79,7 @@
78
79
  slottedNodes.push(childNode);
79
80
  if (typeof slotName !== "undefined") return slottedNodes;
80
81
  }
81
- slottedNodes = [...slottedNodes, ...getHostSlotNodes(childNode.childNodes, hostName, slotName)];
82
+ slottedNodes = [...slottedNodes, ...getHostSlotNodes(internalCall(childNode, "childNodes"), hostName, slotName)];
82
83
  }
83
84
  return slottedNodes;
84
85
  }
@@ -180,6 +181,11 @@
180
181
  } else if (child != null && typeof child !== "boolean") {
181
182
  if (simple = !isComplexType(child)) {
182
183
  child = String(child);
184
+ } else if (child.$flags$ === void 0) {
185
+ {
186
+ consoleError("Invalid vNode child");
187
+ }
188
+ continue;
183
189
  }
184
190
  if (simple && lastSimple) {
185
191
  vNodeChildren[vNodeChildren.length - 1].$text$ += child;
@@ -237,7 +243,8 @@
237
243
  const oldClasses = parseClassList(oldValue);
238
244
  let newClasses = parseClassList(newValue);
239
245
  {
240
- classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
246
+ let removedClasses = oldClasses.filter((c) => c && !newClasses.includes(c));
247
+ classList.remove(...removedClasses);
241
248
  classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
242
249
  }
243
250
  } else if (memberName === "style") {
@@ -342,7 +349,7 @@
342
349
  }
343
350
  }
344
351
  if (newValue == null || newValue === false) {
345
- if (newValue !== false || elm.getAttribute(memberName) === "") {
352
+ if (newValue !== false || elm.getAttribute(memberName) === "" || flags & 4 /* isHost */ && !isEnumeratedAttribute(memberName)) {
346
353
  if (xlink) {
347
354
  elm.removeAttributeNS(XLINK_NS, memberName);
348
355
  } else {
@@ -359,6 +366,8 @@
359
366
  }
360
367
  }
361
368
  };
369
+ var ENUMERATED_ATTRIBUTES = /* @__PURE__ */ new Set(["draggable", "contenteditable", "spellcheck"]);
370
+ var isEnumeratedAttribute = (attrName) => ENUMERATED_ATTRIBUTES.has(attrName) || attrName.startsWith("aria-");
362
371
  var parseClassListRegex = /\s/;
363
372
  var parseClassList = (value) => {
364
373
  if (typeof value === "object" && value && "baseVal" in value) {
@@ -650,7 +659,7 @@
650
659
  if (idxInOld >= 0) {
651
660
  elmToMove = oldCh[idxInOld];
652
661
  if (elmToMove.$tag$ !== newStartVnode.$tag$) {
653
- node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld);
662
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx);
654
663
  } else {
655
664
  patch(elmToMove, newStartVnode, isInitialRender);
656
665
  oldCh[idxInOld] = void 0;
@@ -755,7 +764,10 @@
755
764
  const slotName = childNode["s-sn"];
756
765
  for (j = hostContentNodes.length - 1; j >= 0; j--) {
757
766
  node = hostContentNodes[j];
758
- if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!node["s-sh"] || node["s-sh"] !== childNode["s-hn"])) {
767
+ 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
768
+ // `slotName === ''` itself - a matched default node's cached `s-sn` is `''` too, which
769
+ // would trivially "match" on every re-render and force pointless re-insertion.
770
+ (!node["s-sh"] || node["s-sh"] !== childNode["s-hn"] || slotName !== "" && getSlotName(node) === slotName)) {
759
771
  if (isNodeLocatedInSlot(node, slotName)) {
760
772
  let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
761
773
  checkSlotFallbackVisibility = true;
@@ -825,7 +837,7 @@
825
837
  return newNode;
826
838
  }
827
839
  }
828
- if (parent.__insertBefore) {
840
+ if ((parent == null ? void 0 : parent.__insertBefore)) {
829
841
  return parent.__insertBefore(newNode, reference);
830
842
  } else {
831
843
  return parent == null ? void 0 : parent.insertBefore(newNode, reference);