@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.
@@ -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.2 | 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;
@@ -231,7 +237,8 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
231
237
  const oldClasses = parseClassList(oldValue);
232
238
  let newClasses = parseClassList(newValue);
233
239
  {
234
- classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
240
+ let removedClasses = oldClasses.filter((c) => c && !newClasses.includes(c));
241
+ classList.remove(...removedClasses);
235
242
  classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
236
243
  }
237
244
  } else if (memberName === "style") {
@@ -336,7 +343,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
336
343
  }
337
344
  }
338
345
  if (newValue == null || newValue === false) {
339
- if (newValue !== false || elm.getAttribute(memberName) === "") {
346
+ if (newValue !== false || elm.getAttribute(memberName) === "" || flags & 4 /* isHost */ && !isEnumeratedAttribute(memberName)) {
340
347
  if (xlink) {
341
348
  elm.removeAttributeNS(XLINK_NS, memberName);
342
349
  } else {
@@ -353,6 +360,8 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
353
360
  }
354
361
  }
355
362
  };
363
+ var ENUMERATED_ATTRIBUTES = /* @__PURE__ */ new Set(["draggable", "contenteditable", "spellcheck"]);
364
+ var isEnumeratedAttribute = (attrName) => ENUMERATED_ATTRIBUTES.has(attrName) || attrName.startsWith("aria-");
356
365
  var parseClassListRegex = /\s/;
357
366
  var parseClassList = (value) => {
358
367
  if (typeof value === "object" && value && "baseVal" in value) {
@@ -644,7 +653,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
644
653
  if (idxInOld >= 0) {
645
654
  elmToMove = oldCh[idxInOld];
646
655
  if (elmToMove.$tag$ !== newStartVnode.$tag$) {
647
- node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld);
656
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx);
648
657
  } else {
649
658
  patch(elmToMove, newStartVnode, isInitialRender);
650
659
  oldCh[idxInOld] = void 0;
@@ -749,7 +758,10 @@ var markSlotContentForRelocation = (elm) => {
749
758
  const slotName = childNode["s-sn"];
750
759
  for (j = hostContentNodes.length - 1; j >= 0; j--) {
751
760
  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"])) {
761
+ 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
762
+ // `slotName === ''` itself - a matched default node's cached `s-sn` is `''` too, which
763
+ // would trivially "match" on every re-render and force pointless re-insertion.
764
+ (!node["s-sh"] || node["s-sh"] !== childNode["s-hn"] || slotName !== "" && getSlotName(node) === slotName)) {
753
765
  if (isNodeLocatedInSlot(node, slotName)) {
754
766
  let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
755
767
  checkSlotFallbackVisibility = true;
@@ -819,7 +831,7 @@ var insertBefore = (parent, newNode, reference, isInitialLoad) => {
819
831
  return newNode;
820
832
  }
821
833
  }
822
- if (parent.__insertBefore) {
834
+ if ((parent == null ? void 0 : parent.__insertBefore)) {
823
835
  return parent.__insertBefore(newNode, reference);
824
836
  } else {
825
837
  return parent == null ? void 0 : parent.insertBefore(newNode, reference);