@mgdis/stencil-helpers 1.0.1 → 1.0.2

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/index.es.js CHANGED
@@ -1,7 +1,7 @@
1
1
  var le = Object.defineProperty;
2
2
  var oe = (t, e, n) => e in t ? le(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
3
  var g = (t, e, n) => (oe(t, typeof e != "symbol" ? e + "" : e, n), n);
4
- const I = {
4
+ const X = {
5
5
  allRenderFn: !1,
6
6
  cmpDidLoad: !0,
7
7
  cmpDidUnload: !1,
@@ -90,8 +90,8 @@ const I = {
90
90
  // TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior
91
91
  experimentalSlotFixes: !1
92
92
  };
93
- let T, F, m, X = !1, M = !1, D = !1, h = !1;
94
- const N = "http://www.w3.org/1999/xlink", H = {}, re = "http://www.w3.org/2000/svg", ie = "http://www.w3.org/1999/xhtml", ce = (t) => t != null, q = (t) => (t = typeof t, t === "object" || t === "function"), G = (t, e, ...n) => {
93
+ let T, F, m, D = !1, M = !1, _ = !1, h = !1;
94
+ const H = "http://www.w3.org/1999/xlink", C = {}, re = "http://www.w3.org/2000/svg", ie = "http://www.w3.org/1999/xhtml", ce = (t) => t != null, q = (t) => (t = typeof t, t === "object" || t === "function"), G = (t, e, ...n) => {
95
95
  let s = null, l = null, r = null, o = !1, c = !1;
96
96
  const i = [], d = (f) => {
97
97
  for (let $ = 0; $ < f.length; $++)
@@ -118,9 +118,9 @@ const N = "http://www.w3.org/1999/xlink", H = {}, re = "http://www.w3.org/2000/s
118
118
  };
119
119
  return n.$attrs$ = null, n.$key$ = null, n.$name$ = null, n;
120
120
  }, fe = {}, ae = (t) => t && t.$tag$ === fe, $e = {
121
- forEach: (t, e) => t.map(C).forEach(e),
122
- map: (t, e) => t.map(C).map(e).map(ue)
123
- }, C = (t) => ({
121
+ forEach: (t, e) => t.map(P).forEach(e),
122
+ map: (t, e) => t.map(P).map(e).map(ue)
123
+ }, P = (t) => ({
124
124
  vattrs: t.$attrs$,
125
125
  vchildren: t.$children$,
126
126
  vkey: t.$key$,
@@ -134,11 +134,11 @@ const N = "http://www.w3.org/1999/xlink", H = {}, re = "http://www.w3.org/2000/s
134
134
  }
135
135
  const e = O(t.vtag, t.vtext);
136
136
  return e.$attrs$ = t.vattrs, e.$children$ = t.vchildren, e.$key$ = t.vkey, e.$name$ = t.vname, e;
137
- }, P = (t, e, n, s, l, r) => {
137
+ }, U = (t, e, n, s, l, r) => {
138
138
  if (n !== s) {
139
- let o = z(t, e), c = e.toLowerCase();
139
+ let o = I(t, e), c = e.toLowerCase();
140
140
  if (e === "class") {
141
- const i = t.classList, d = U(n), u = U(s);
141
+ const i = t.classList, d = W(n), u = W(s);
142
142
  i.remove(...d.filter((f) => f && !u.includes(f))), i.add(...u.filter((f) => f && !d.includes(f)));
143
143
  } else if (e === "style") {
144
144
  for (const i in n)
@@ -149,7 +149,7 @@ const N = "http://www.w3.org/1999/xlink", H = {}, re = "http://www.w3.org/2000/s
149
149
  if (e === "ref")
150
150
  s && s(t);
151
151
  else if (!t.__lookupSetter__(e) && e[0] === "o" && e[1] === "n") {
152
- if (e[2] === "-" ? e = e.slice(3) : z(B, c) ? e = c.slice(2) : e = c[2] + e.slice(3), n || s) {
152
+ if (e[2] === "-" ? e = e.slice(3) : I(N, c) ? e = c.slice(2) : e = c[2] + e.slice(3), n || s) {
153
153
  const i = e.endsWith(K);
154
154
  e = e.replace(pe, ""), n && x.rel(t, e, n, i), s && x.ael(t, e, s, i);
155
155
  }
@@ -166,19 +166,19 @@ const N = "http://www.w3.org/1999/xlink", H = {}, re = "http://www.w3.org/2000/s
166
166
  } catch {
167
167
  }
168
168
  let d = !1;
169
- c !== (c = c.replace(/^xlink\:?/, "")) && (e = c, d = !0), s == null || s === !1 ? (s !== !1 || t.getAttribute(e) === "") && (d ? t.removeAttributeNS(N, e) : t.removeAttribute(e)) : (!o || r & 4 || l) && !i && (s = s === !0 ? "" : s, d ? t.setAttributeNS(N, e, s) : t.setAttribute(e, s));
169
+ c !== (c = c.replace(/^xlink\:?/, "")) && (e = c, d = !0), s == null || s === !1 ? (s !== !1 || t.getAttribute(e) === "") && (d ? t.removeAttributeNS(H, e) : t.removeAttribute(e)) : (!o || r & 4 || l) && !i && (s = s === !0 ? "" : s, d ? t.setAttributeNS(H, e, s) : t.setAttribute(e, s));
170
170
  }
171
171
  }
172
- }, de = /\s/, U = (t) => t ? t.split(de) : [], K = "Capture", pe = new RegExp(K + "$"), Q = (t, e, n, s) => {
173
- const l = e.$elm$.nodeType === 11 && e.$elm$.host ? e.$elm$.host : e.$elm$, r = t && t.$attrs$ || H, o = e.$attrs$ || H;
172
+ }, de = /\s/, W = (t) => t ? t.split(de) : [], K = "Capture", pe = new RegExp(K + "$"), Q = (t, e, n, s) => {
173
+ const l = e.$elm$.nodeType === 11 && e.$elm$.host ? e.$elm$.host : e.$elm$, r = t && t.$attrs$ || C, o = e.$attrs$ || C;
174
174
  for (s in r)
175
- s in o || P(l, s, r[s], void 0, n, e.$flags$);
175
+ s in o || U(l, s, r[s], void 0, n, e.$flags$);
176
176
  for (s in o)
177
- P(l, s, r[s], o[s], n, e.$flags$);
177
+ U(l, s, r[s], o[s], n, e.$flags$);
178
178
  }, j = (t, e, n, s) => {
179
179
  const l = e.$children$[n];
180
180
  let r = 0, o, c, i;
181
- if (X || (D = !0, l.$tag$ === "slot" && (T && s.classList.add(T + "-s"), l.$flags$ |= l.$children$ ? (
181
+ if (D || (_ = !0, l.$tag$ === "slot" && (T && s.classList.add(T + "-s"), l.$flags$ |= l.$children$ ? (
182
182
  // slot element has fallback content
183
183
  2
184
184
  ) : (
@@ -200,13 +200,13 @@ const N = "http://www.w3.org/1999/xlink", H = {}, re = "http://www.w3.org/2000/s
200
200
  const n = t.childNodes;
201
201
  for (let s = n.length - 1; s >= 0; s--) {
202
202
  const l = n[s];
203
- l["s-hn"] !== m && l["s-ol"] && (Z(l).insertBefore(l, _(l)), l["s-ol"].remove(), l["s-ol"] = void 0, l["s-sh"] = void 0, D = !0), e && L(l, e);
203
+ l["s-hn"] !== m && l["s-ol"] && (Z(l).insertBefore(l, B(l)), l["s-ol"].remove(), l["s-ol"] = void 0, l["s-sh"] = void 0, _ = !0), e && L(l, e);
204
204
  }
205
205
  x.$flags$ &= -2;
206
206
  }, J = (t, e, n, s, l, r) => {
207
207
  let o = t["s-cr"] && t["s-cr"].parentNode || t, c;
208
208
  for (o.shadowRoot && o.tagName === m && (o = o.shadowRoot); l <= r; ++l)
209
- s[l] && (c = j(null, n, l, t), c && (s[l].$elm$ = c, o.insertBefore(c, _(e))));
209
+ s[l] && (c = j(null, n, l, t), c && (s[l].$elm$ = c, o.insertBefore(c, B(e))));
210
210
  }, Y = (t, e, n) => {
211
211
  for (let s = e; s <= n; ++s) {
212
212
  const l = t[s];
@@ -240,13 +240,13 @@ const N = "http://www.w3.org/1999/xlink", H = {}, re = "http://www.w3.org/2000/s
240
240
  c = i;
241
241
  break;
242
242
  }
243
- c >= 0 ? (y = e[c], y.$tag$ !== a.$tag$ ? v = j(e && e[o], n, c, t) : (k(y, a, l), e[c] = void 0, v = y.$elm$), a = s[++o]) : (v = j(e && e[o], n, o, t), a = s[++o]), v && Z(u.$elm$).insertBefore(v, _(u.$elm$));
243
+ c >= 0 ? (y = e[c], y.$tag$ !== a.$tag$ ? v = j(e && e[o], n, c, t) : (k(y, a, l), e[c] = void 0, v = y.$elm$), a = s[++o]) : (v = j(e && e[o], n, o, t), a = s[++o]), v && Z(u.$elm$).insertBefore(v, B(u.$elm$));
244
244
  }
245
245
  r > d ? J(t, s[$ + 1] == null ? null : s[$ + 1].$elm$, n, s, o, $) : o > $ && Y(e, r, d);
246
- }, A = (t, e, n = !1) => t.$tag$ === e.$tag$ ? t.$tag$ === "slot" ? t.$name$ === e.$name$ : n ? !0 : t.$key$ === e.$key$ : !1, _ = (t) => t && t["s-ol"] || t, Z = (t) => (t["s-ol"] ? t["s-ol"] : t).parentNode, k = (t, e, n = !1) => {
246
+ }, A = (t, e, n = !1) => t.$tag$ === e.$tag$ ? t.$tag$ === "slot" ? t.$name$ === e.$name$ : n ? !0 : t.$key$ === e.$key$ : !1, B = (t) => t && t["s-ol"] || t, Z = (t) => (t["s-ol"] ? t["s-ol"] : t).parentNode, k = (t, e, n = !1) => {
247
247
  const s = e.$elm$ = t.$elm$, l = t.$children$, r = e.$children$, o = e.$tag$, c = e.$text$;
248
248
  let i;
249
- c === null ? (h = o === "svg" ? !0 : o === "foreignObject" ? !1 : h, o === "slot" || Q(t, e, h), l !== null && r !== null ? ge(s, l, e, r, n) : r !== null ? (t.$text$ !== null && (s.textContent = ""), J(s, null, e, r, 0, r.length - 1)) : l !== null && Y(l, 0, l.length - 1), h && o === "svg" && (h = !1)) : (i = s["s-cr"]) ? i.parentNode.textContent = c : t.$text$ !== c && (s.data = c);
249
+ c === null ? (h = o === "svg" ? !0 : o === "foreignObject" ? !1 : h, o === "slot" && !D || Q(t, e, h), l !== null && r !== null ? ge(s, l, e, r, n) : r !== null ? (t.$text$ !== null && (s.textContent = ""), J(s, null, e, r, 0, r.length - 1)) : l !== null && Y(l, 0, l.length - 1), h && o === "svg" && (h = !1)) : (i = s["s-cr"]) ? i.parentNode.textContent = c : t.$text$ !== c && (s.data = c);
250
250
  }, w = (t) => {
251
251
  const e = t.childNodes;
252
252
  for (const n of e)
@@ -276,14 +276,14 @@ const N = "http://www.w3.org/1999/xlink", H = {}, re = "http://www.w3.org/2000/s
276
276
  n = e.parentNode.childNodes;
277
277
  const r = l["s-sn"];
278
278
  for (s = n.length - 1; s >= 0; s--)
279
- if (e = n[s], !e["s-cn"] && !e["s-nr"] && e["s-hn"] !== l["s-hn"] && !I.experimentalSlotFixes)
280
- if (W(e, r)) {
279
+ if (e = n[s], !e["s-cn"] && !e["s-nr"] && e["s-hn"] !== l["s-hn"] && !X.experimentalSlotFixes)
280
+ if (z(e, r)) {
281
281
  let o = S.find((c) => c.$nodeToRelocate$ === e);
282
282
  M = !0, e["s-sn"] = e["s-sn"] || r, o ? (o.$nodeToRelocate$["s-sh"] = l["s-hn"], o.$slotRefNode$ = l) : (e["s-sh"] = l["s-hn"], S.push({
283
283
  $slotRefNode$: l,
284
284
  $nodeToRelocate$: e
285
285
  })), e["s-sr"] && S.map((c) => {
286
- W(c.$nodeToRelocate$, e["s-sn"]) && (o = S.find((i) => i.$nodeToRelocate$ === e), o && !c.$slotRefNode$ && (c.$slotRefNode$ = o.$slotRefNode$));
286
+ z(c.$nodeToRelocate$, e["s-sn"]) && (o = S.find((i) => i.$nodeToRelocate$ === e), o && !c.$slotRefNode$ && (c.$slotRefNode$ = o.$slotRefNode$));
287
287
  });
288
288
  } else
289
289
  S.some((o) => o.$nodeToRelocate$ === e) || S.push({
@@ -292,7 +292,7 @@ const N = "http://www.w3.org/1999/xlink", H = {}, re = "http://www.w3.org/2000/s
292
292
  }
293
293
  l.nodeType === 1 && V(l);
294
294
  }
295
- }, W = (t, e) => t.nodeType === 1 ? t.getAttribute("slot") === null && e === "" || t.getAttribute("slot") === e : t["s-sn"] === e ? !0 : e === "", ee = (t) => {
295
+ }, z = (t, e) => t.nodeType === 1 ? t.getAttribute("slot") === null && e === "" || t.getAttribute("slot") === e : t["s-sn"] === e ? !0 : e === "", ee = (t) => {
296
296
  t.$attrs$ && t.$attrs$.ref && t.$attrs$.ref(null), t.$children$ && t.$children$.map(ee);
297
297
  }, he = (t, e, n = !1) => {
298
298
  var s, l, r, o, c;
@@ -300,9 +300,9 @@ const N = "http://www.w3.org/1999/xlink", H = {}, re = "http://www.w3.org/2000/s
300
300
  if (m = i.tagName, d.$attrsToReflect$ && (f.$attrs$ = f.$attrs$ || {}, d.$attrsToReflect$.map(([$, a]) => f.$attrs$[a] = i[$])), n && f.$attrs$)
301
301
  for (const $ of Object.keys(f.$attrs$))
302
302
  i.hasAttribute($) && !["key", "ref", "style", "class"].includes($) && (f.$attrs$[$] = i[$]);
303
- f.$tag$ = null, f.$flags$ |= 4, t.$vnode$ = f, f.$elm$ = u.$elm$ = i.shadowRoot || i, T = i["s-sc"], F = i["s-cr"], X = (d.$flags$ & 1) !== 0, M = !1, k(u, f, n);
303
+ f.$tag$ = null, f.$flags$ |= 4, t.$vnode$ = f, f.$elm$ = u.$elm$ = i.shadowRoot || i, T = i["s-sc"], D = (d.$flags$ & 1) !== 0, F = i["s-cr"], M = !1, k(u, f, n);
304
304
  {
305
- if (x.$flags$ |= 1, D) {
305
+ if (x.$flags$ |= 1, _) {
306
306
  V(f.$elm$);
307
307
  for (const $ of S) {
308
308
  const a = $.$nodeToRelocate$;
@@ -334,12 +334,12 @@ const N = "http://www.w3.org/1999/xlink", H = {}, re = "http://www.w3.org/2000/s
334
334
  }
335
335
  M && w(f.$elm$), x.$flags$ &= -2, S.length = 0;
336
336
  }
337
- if (I.experimentalScopedSlotChanges && d.$flags$ & 2)
337
+ if (X.experimentalScopedSlotChanges && d.$flags$ & 2)
338
338
  for (const $ of f.$elm$.childNodes)
339
339
  $["s-hn"] !== m && !$["s-sh"] && (n && $["s-ih"] == null && ($["s-ih"] = (c = $.hidden) !== null && c !== void 0 ? c : !1), $.hidden = !0);
340
340
  F = void 0;
341
- }, z = (t, e) => e in t, B = typeof window < "u" ? window : {}, R = B.document || { head: {} };
342
- B.HTMLElement;
341
+ }, I = (t, e) => e in t, N = typeof window < "u" ? window : {}, R = N.document || { head: {} };
342
+ N.HTMLElement;
343
343
  const x = {
344
344
  $flags$: 0,
345
345
  $resourcesUrl$: "",