@mgdis/mg-components 6.2.0 → 6.3.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.
Files changed (85) hide show
  1. package/dist/cjs/{index-52d5f3d4.js → index-a5b2cd1b.js} +3 -3
  2. package/dist/cjs/index-a5b2cd1b.js.map +1 -0
  3. package/dist/cjs/index.es-ac7c22e3.js.map +1 -1
  4. package/dist/cjs/loader.cjs.js +2 -2
  5. package/dist/cjs/mg-action-more_36.cjs.entry.js +59 -18
  6. package/dist/cjs/mg-action-more_36.cjs.entry.js.map +1 -1
  7. package/dist/cjs/mg-alert.cjs.entry.js +4 -2
  8. package/dist/cjs/mg-alert.cjs.entry.js.map +1 -1
  9. package/dist/cjs/mg-components.cjs.js +3 -3
  10. package/dist/cjs/mg-components.cjs.js.map +1 -1
  11. package/dist/cjs/mg-loader.cjs.entry.js +1 -1
  12. package/dist/cjs/mg-progress.cjs.entry.js +1 -1
  13. package/dist/collection/collection-manifest.json +1 -1
  14. package/dist/collection/components/atoms/mg-button/mg-button.conf.js +4 -0
  15. package/dist/collection/components/atoms/mg-button/mg-button.conf.js.map +1 -1
  16. package/dist/collection/components/atoms/mg-button/mg-button.js +63 -2
  17. package/dist/collection/components/atoms/mg-button/mg-button.js.map +1 -1
  18. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +1 -1
  19. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js.map +1 -1
  20. package/dist/collection/components/molecules/mg-alert/mg-alert.js +17 -1
  21. package/dist/collection/components/molecules/mg-alert/mg-alert.js.map +1 -1
  22. package/dist/collection/components/molecules/mg-modal/mg-modal.js +19 -4
  23. package/dist/collection/components/molecules/mg-modal/mg-modal.js.map +1 -1
  24. package/dist/collection/components/molecules/mg-popover/mg-popover.js +18 -1
  25. package/dist/collection/components/molecules/mg-popover/mg-popover.js.map +1 -1
  26. package/dist/components/index.es.js.map +1 -1
  27. package/dist/components/mg-alert.js +3 -1
  28. package/dist/components/mg-alert.js.map +1 -1
  29. package/dist/components/mg-button2.js +42 -2
  30. package/dist/components/mg-button2.js.map +1 -1
  31. package/dist/components/mg-input-numeric.js +1 -1
  32. package/dist/components/mg-input-numeric.js.map +1 -1
  33. package/dist/components/mg-input-password.js +1 -1
  34. package/dist/components/mg-input-password.js.map +1 -1
  35. package/dist/components/mg-input-select2.js +1 -1
  36. package/dist/components/mg-input-select2.js.map +1 -1
  37. package/dist/components/mg-input-text2.js +2 -2
  38. package/dist/components/mg-input-text2.js.map +1 -1
  39. package/dist/components/mg-input-textarea.js +1 -1
  40. package/dist/components/mg-input-textarea.js.map +1 -1
  41. package/dist/components/mg-modal.js +5 -4
  42. package/dist/components/mg-modal.js.map +1 -1
  43. package/dist/components/mg-popover2.js +4 -1
  44. package/dist/components/mg-popover2.js.map +1 -1
  45. package/dist/esm/{index-81752ffe.js → index-eb0e1053.js} +3 -3
  46. package/dist/esm/index-eb0e1053.js.map +1 -0
  47. package/dist/esm/index.es-940821a9.js.map +1 -1
  48. package/dist/esm/loader.js +3 -3
  49. package/dist/esm/mg-action-more_36.entry.js +59 -18
  50. package/dist/esm/mg-action-more_36.entry.js.map +1 -1
  51. package/dist/esm/mg-alert.entry.js +4 -2
  52. package/dist/esm/mg-alert.entry.js.map +1 -1
  53. package/dist/esm/mg-components.js +4 -4
  54. package/dist/esm/mg-components.js.map +1 -1
  55. package/dist/esm/mg-loader.entry.js +1 -1
  56. package/dist/esm/mg-progress.entry.js +1 -1
  57. package/dist/mg-components/mg-components.esm.js +1 -1
  58. package/dist/mg-components/mg-components.esm.js.map +1 -1
  59. package/dist/mg-components/{p-2298352f.js → p-15b6849a.js} +2 -2
  60. package/dist/mg-components/p-15b6849a.js.map +1 -0
  61. package/dist/mg-components/{p-abddacc2.entry.js → p-3aecf564.entry.js} +2 -2
  62. package/dist/mg-components/p-6f3d70b2.entry.js +2 -0
  63. package/dist/mg-components/p-6f3d70b2.entry.js.map +1 -0
  64. package/dist/mg-components/p-a17ea0af.entry.js +2 -0
  65. package/dist/mg-components/p-a17ea0af.entry.js.map +1 -0
  66. package/dist/mg-components/{p-31e6c1a7.entry.js → p-d0086664.entry.js} +2 -2
  67. package/dist/mg-components/p-ee51ec5e.js.map +1 -1
  68. package/dist/types/components/atoms/mg-button/mg-button.conf.d.ts +9 -1
  69. package/dist/types/components/atoms/mg-button/mg-button.d.ts +11 -1
  70. package/dist/types/components/molecules/mg-alert/mg-alert.d.ts +4 -0
  71. package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +4 -0
  72. package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +4 -0
  73. package/dist/types/components.d.ts +33 -10
  74. package/ide/intellij/web-types.json +37 -5
  75. package/ide/vscode/html-custom-data.json +26 -4
  76. package/package.json +26 -36
  77. package/dist/cjs/index-52d5f3d4.js.map +0 -1
  78. package/dist/esm/index-81752ffe.js.map +0 -1
  79. package/dist/mg-components/p-2298352f.js.map +0 -1
  80. package/dist/mg-components/p-67c9be27.entry.js +0 -2
  81. package/dist/mg-components/p-67c9be27.entry.js.map +0 -1
  82. package/dist/mg-components/p-95895169.entry.js +0 -2
  83. package/dist/mg-components/p-95895169.entry.js.map +0 -1
  84. /package/dist/mg-components/{p-abddacc2.entry.js.map → p-3aecf564.entry.js.map} +0 -0
  85. /package/dist/mg-components/{p-31e6c1a7.entry.js.map → p-d0086664.entry.js.map} +0 -0
@@ -1 +1 @@
1
- {"file":"index.es.js","mappings":"AAAA,IAAI,EAAE,GAAG,MAAM,CAAC,cAAc,CAAC;AAI/B,IAAI,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAA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E,CAAC,EAAE,CAAC,KAAK,OAAO,CAAC,IAAI,QAAQ,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;;;;","names":[],"sources":["../stencil-helpers/dist/index.es.js"],"sourcesContent":["var ve = Object.defineProperty;\nvar X = (e) => {\n throw TypeError(e);\n};\nvar he = (e, t, s) => t in e ? ve(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;\nvar g = (e, t, s) => he(e, typeof t != \"symbol\" ? t + \"\" : t, s), ye = (e, t, s) => t.has(e) || X(\"Cannot \" + s);\nvar k = (e, t, s) => (ye(e, t, \"read from private field\"), s ? s.call(e) : t.get(e)), P = (e, t, s) => t.has(e) ? X(\"Cannot add the same private member more than once\") : t instanceof WeakSet ? t.add(e) : t.set(e, s);\nconst qe = (e = \"\", t = 10) => {\n const s = new Uint8Array(t);\n crypto.getRandomValues(s);\n const r = Array.from(s).map((o) => o.toString(16).padStart(2, \"0\")).join(\"\").slice(0, t);\n return e !== \"\" ? `${e}-${r}` : r;\n}, Ge = (e) => me(e) && /^([a-z][a-z0-9]*)(-[a-z0-9]+)*$/.exec(e) !== null;\nclass Xe {\n constructor(t = []) {\n /**\n * Available classes\n */\n g(this, \"classes\");\n /**\n * Add class\n * @param className - class name to add\n */\n g(this, \"add\", (t) => {\n this.has(t) || this.classes.push(t);\n });\n /**\n * Delete class\n * @param className - class name to delete\n */\n g(this, \"delete\", (t) => {\n const s = this.classes.indexOf(t);\n s > -1 && this.classes.splice(s, 1);\n });\n /**\n * Check if class exist in list\n * @param className - class name to check\n * @returns class name is in the list\n */\n g(this, \"has\", (t) => this.classes.includes(t));\n /**\n * Join classes seperated by spaces\n * @returns joined values\n */\n g(this, \"join\", () => this.classes.join(\" \"));\n this.classes = t;\n }\n}\nconst Je = (e) => Array.isArray(e) && e.every((t) => typeof t == \"string\"), Ke = (e, t) => t.includes(e == null ? void 0 : e.tagName.toLowerCase()), Qe = 'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex=\"-1\"]), [identifier], mg-button', Ze = (e) => {\n const t = te(e), s = se(e);\n return [e, ...t, ...s];\n}, te = (e, t = []) => {\n if (e.self !== e.top)\n try {\n const s = e.parent;\n return s ? (t.push(s), te(s, t)) : t;\n } catch (s) {\n return console.error(\"Different hosts between iframes:\", s), t;\n }\n return t;\n}, se = (e, t = []) => {\n if (e.frames.length > 0)\n for (const s of Array.from(e.frames))\n t.push(s), se(s, t);\n return t;\n}, me = (e) => typeof e == \"string\" && e.trim() !== \"\", Ye = (e) => typeof e == \"object\" ? JSON.stringify(e) : `${e}`, Ve = (e) => typeof e == \"number\" && !Number.isNaN(e), et = (e) => typeof e == \"string\" ? e.toLocaleLowerCase().normalize(\"NFD\").replaceAll(/[\\u0300-\\u036f]/g, \"\") : e, tt = async (e) => e();\nvar E = {\n allRenderFn: !1,\n cmpDidLoad: !0,\n cmpDidUnload: !1,\n cmpDidUpdate: !0,\n cmpDidRender: !0,\n cmpWillLoad: !0,\n cmpWillUpdate: !0,\n cmpWillRender: !0,\n connectedCallback: !0,\n disconnectedCallback: !0,\n element: !0,\n event: !0,\n hasRenderFn: !0,\n lifecycle: !0,\n hostListener: !0,\n hostListenerTargetWindow: !0,\n hostListenerTargetDocument: !0,\n hostListenerTargetBody: !0,\n hostListenerTargetParent: !1,\n hostListenerTarget: !0,\n member: !0,\n method: !0,\n mode: !0,\n observeAttribute: !0,\n prop: !0,\n propMutable: !0,\n reflect: !0,\n scoped: !0,\n shadowDom: !0,\n slot: !0,\n cssAnnotations: !0,\n state: !0,\n style: !0,\n formAssociated: !1,\n svg: !0,\n updatable: !0,\n vdomAttribute: !0,\n vdomXlink: !0,\n vdomClass: !0,\n vdomFunctional: !0,\n vdomKey: !0,\n vdomListener: !0,\n vdomRef: !0,\n vdomPropOrAttr: !0,\n vdomRender: !0,\n vdomStyle: !0,\n vdomText: !0,\n watchCallback: !0,\n taskQueue: !0,\n hotModuleReplacement: !1,\n isDebug: !1,\n isDev: !1,\n isTesting: !1,\n hydrateServerSide: !1,\n hydrateClientSide: !1,\n lifecycleDOMEvents: !1,\n lazyLoad: !1,\n profile: !1,\n slotRelocation: !0,\n // TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior\n appendChildSlotFix: !1,\n // TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior\n cloneNodeFix: !1,\n hydratedAttribute: !1,\n hydratedClass: !0,\n // TODO(STENCIL-1305): remove this option\n scriptDataOpts: !1,\n // TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior\n scopedSlotTextContentFix: !1,\n // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field\n shadowDomShim: !1,\n // TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior\n slotChildNodesFix: !1,\n invisiblePrehydration: !0,\n propBoolean: !0,\n propNumber: !0,\n propString: !0,\n constructableCSS: !0,\n cmpShouldUpdate: !0,\n devTools: !1,\n shadowDelegatesFocus: !0,\n initializeNextTick: !1,\n asyncLoading: !0,\n asyncQueue: !1,\n transformTagName: !1,\n attachStyles: !0,\n // TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior\n experimentalSlotFixes: !1\n}, be = Object.defineProperty, Se = (e, t) => {\n for (var s in t)\n be(e, s, { get: t[s], enumerable: !0 });\n}, J = (e, t) => t in e, K = \"http://www.w3.org/1999/xlink\", B = typeof window < \"u\" ? window : {}, M = B.document || { head: {} };\nB.HTMLElement;\nvar j = {\n $flags$: 0,\n $resourcesUrl$: \"\",\n jmp: (e) => e(),\n raf: (e) => requestAnimationFrame(e),\n ael: (e, t, s, r) => e.addEventListener(t, s, r),\n rel: (e, t, s, r) => e.removeEventListener(t, s, r),\n ce: (e, t) => new CustomEvent(e, t)\n}, Q = {}, Te = \"http://www.w3.org/2000/svg\", ke = \"http://www.w3.org/1999/xhtml\", xe = (e) => e != null, re = (e) => (e = typeof e, e === \"object\" || e === \"function\"), Ae = {};\nSe(Ae, {\n err: () => oe,\n map: () => Ee,\n ok: () => U,\n unwrap: () => je,\n unwrapErr: () => Re\n});\nvar U = (e) => ({\n isOk: !0,\n isErr: !1,\n value: e\n}), oe = (e) => ({\n isOk: !1,\n isErr: !0,\n value: e\n});\nfunction Ee(e, t) {\n if (e.isOk) {\n const s = t(e.value);\n return s instanceof Promise ? s.then((r) => U(r)) : U(s);\n }\n if (e.isErr) {\n const s = e.value;\n return oe(s);\n }\n throw \"should never get here\";\n}\nvar je = (e) => {\n if (e.isOk)\n return e.value;\n throw e.value;\n}, Re = (e) => {\n if (e.isErr)\n return e.value;\n throw e.value;\n}, Le = (e, t, ...s) => {\n let r = null, o = null, n = null, i = !1, a = !1;\n const c = [], d = (l) => {\n for (let $ = 0; $ < l.length; $++)\n r = l[$], Array.isArray(r) ? d(r) : r != null && typeof r != \"boolean\" && ((i = !re(r)) && (r = String(r)), i && a ? c[c.length - 1].$text$ += r : c.push(i ? W(null, r) : r), a = i);\n };\n d(s);\n const f = W(e, null);\n return f.$attrs$ = t, c.length > 0 && (f.$children$ = c), f.$key$ = o, f.$name$ = n, f;\n}, W = (e, t) => {\n const s = {\n $flags$: 0,\n $tag$: e,\n $text$: t,\n $elm$: null,\n $children$: null\n };\n return s.$attrs$ = null, s.$key$ = null, s.$name$ = null, s;\n}, Oe = {}, Ne = (e) => e && e.$tag$ === Oe, Z = (e, t, s, r, o, n) => {\n if (s !== r) {\n let i = J(e, t), a = t.toLowerCase();\n if (t === \"class\") {\n const c = e.classList, d = Y(s), f = Y(r);\n c.remove(...d.filter((l) => l && !f.includes(l))), c.add(...f.filter((l) => l && !d.includes(l)));\n } else if (t === \"style\") {\n for (const c in s)\n (!r || r[c] == null) && (c.includes(\"-\") ? e.style.removeProperty(c) : e.style[c] = \"\");\n for (const c in r)\n (!s || r[c] !== s[c]) && (c.includes(\"-\") ? e.style.setProperty(c, r[c]) : e.style[c] = r[c]);\n } else if (t !== \"key\") if (t === \"ref\")\n r && r(e);\n else if (!e.__lookupSetter__(t) && t[0] === \"o\" && t[1] === \"n\") {\n if (t[2] === \"-\" ? t = t.slice(3) : J(B, a) ? t = a.slice(2) : t = a[2] + t.slice(3), s || r) {\n const c = t.endsWith(ne);\n t = t.replace(Fe, \"\"), s && j.rel(e, t, s, c), r && j.ael(e, t, r, c);\n }\n } else {\n const c = re(r);\n if ((i || c && r !== null) && !o)\n try {\n if (e.tagName.includes(\"-\"))\n e[t] = r;\n else {\n const f = r ?? \"\";\n t === \"list\" ? i = !1 : (s == null || e[t] != f) && (typeof e.__lookupSetter__(t) == \"function\" ? e[t] = f : e.setAttribute(t, f));\n }\n } catch {\n }\n let d = !1;\n a !== (a = a.replace(/^xlink\\:?/, \"\")) && (t = a, d = !0), r == null || r === !1 ? (r !== !1 || e.getAttribute(t) === \"\") && (d ? e.removeAttributeNS(K, t) : e.removeAttribute(t)) : (!i || n & 4 || o) && !c && (r = r === !0 ? \"\" : r, d ? e.setAttributeNS(K, t, r) : e.setAttribute(t, r));\n }\n }\n}, Me = /\\s/, Y = (e) => e ? e.split(Me) : [], ne = \"Capture\", Fe = new RegExp(ne + \"$\"), ie = (e, t, s) => {\n const r = t.$elm$.nodeType === 11 && t.$elm$.host ? t.$elm$.host : t.$elm$, o = e && e.$attrs$ || Q, n = t.$attrs$ || Q;\n for (const i of V(Object.keys(o)))\n i in n || Z(r, i, o[i], void 0, s, t.$flags$);\n for (const i of V(Object.keys(n)))\n Z(r, i, o[i], n[i], s, t.$flags$);\n};\nfunction V(e) {\n return e.includes(\"ref\") ? (\n // we need to sort these to ensure that `'ref'` is the last attr\n [...e.filter((t) => t !== \"ref\"), \"ref\"]\n ) : (\n // no need to sort, return the original array\n e\n );\n}\nvar x, H, R, F = !1, _ = !1, I = !1, h = !1, D = (e, t, s, r) => {\n var o;\n const n = t.$children$[s];\n let i = 0, a, c, d;\n if (F || (I = !0, n.$tag$ === \"slot\" && (x && r.classList.add(x + \"-s\"), n.$flags$ |= n.$children$ ? (\n // slot element has fallback content\n // still create an element that \"mocks\" the slot element\n 2\n ) : (\n // slot element does not have fallback content\n // create an html comment we'll use to always reference\n // where actual slot content should sit next to\n 1\n ))), n.$text$ !== null)\n a = n.$elm$ = M.createTextNode(n.$text$);\n else if (n.$flags$ & 1)\n a = n.$elm$ = M.createTextNode(\"\");\n else {\n if (h || (h = n.$tag$ === \"svg\"), a = n.$elm$ = M.createElementNS(\n h ? Te : ke,\n !F && E.slotRelocation && n.$flags$ & 2 ? \"slot-fb\" : n.$tag$\n ), h && n.$tag$ === \"foreignObject\" && (h = !1), ie(null, n, h), !!a.getRootNode().querySelector(\"body\") && E.scoped && xe(x) && a[\"s-si\"] !== x && a.classList.add(a[\"s-si\"] = x), G(a, r), n.$children$)\n for (i = 0; i < n.$children$.length; ++i)\n c = D(e, n, i, a), c && a.appendChild(c);\n n.$tag$ === \"svg\" ? h = !1 : a.tagName === \"foreignObject\" && (h = !0);\n }\n return a[\"s-hn\"] = R, n.$flags$ & 3 && (a[\"s-sr\"] = !0, a[\"s-cr\"] = H, a[\"s-sn\"] = n.$name$ || \"\", a[\"s-rf\"] = (o = n.$attrs$) == null ? void 0 : o.ref, d = e && e.$children$ && e.$children$[s], d && d.$tag$ === n.$tag$ && e.$elm$ && L(e.$elm$, !1)), a;\n}, L = (e, t) => {\n j.$flags$ |= 1;\n const s = Array.from(e.childNodes);\n if (e[\"s-sr\"] && E.experimentalSlotFixes) {\n let r = e;\n for (; r = r.nextSibling; )\n r && r[\"s-sn\"] === e[\"s-sn\"] && r[\"s-sh\"] === R && s.push(r);\n }\n for (let r = s.length - 1; r >= 0; r--) {\n const o = s[r];\n o[\"s-hn\"] !== R && o[\"s-ol\"] && (T(ce(o), o, q(o)), o[\"s-ol\"].remove(), o[\"s-ol\"] = void 0, o[\"s-sh\"] = void 0, I = !0), t && L(o, t);\n }\n j.$flags$ &= -2;\n}, le = (e, t, s, r, o, n) => {\n let i = e[\"s-cr\"] && e[\"s-cr\"].parentNode || e, a;\n for (i.shadowRoot && i.tagName === R && (i = i.shadowRoot); o <= n; ++o)\n r[o] && (a = D(null, s, o, e), a && (r[o].$elm$ = a, T(i, a, q(t))));\n}, ae = (e, t, s) => {\n for (let r = t; r <= s; ++r) {\n const o = e[r];\n if (o) {\n const n = o.$elm$;\n $e(o), n && (_ = !0, n[\"s-ol\"] ? n[\"s-ol\"].remove() : L(n, !0), n.remove());\n }\n }\n}, _e = (e, t, s, r, o = !1) => {\n let n = 0, i = 0, a = 0, c = 0, d = t.length - 1, f = t[0], l = t[d], $ = r.length - 1, u = r[0], p = r[$], m, y;\n for (; n <= d && i <= $; )\n if (f == null)\n f = t[++n];\n else if (l == null)\n l = t[--d];\n else if (u == null)\n u = r[++i];\n else if (p == null)\n p = r[--$];\n else if (N(f, u, o))\n A(f, u, o), f = t[++n], u = r[++i];\n else if (N(l, p, o))\n A(l, p, o), l = t[--d], p = r[--$];\n else if (N(f, p, o))\n (f.$tag$ === \"slot\" || p.$tag$ === \"slot\") && L(f.$elm$.parentNode, !1), A(f, p, o), T(e, f.$elm$, l.$elm$.nextSibling), f = t[++n], p = r[--$];\n else if (N(l, u, o))\n (f.$tag$ === \"slot\" || p.$tag$ === \"slot\") && L(l.$elm$.parentNode, !1), A(l, u, o), T(e, l.$elm$, f.$elm$), l = t[--d], u = r[++i];\n else {\n for (a = -1, c = n; c <= d; ++c)\n if (t[c] && t[c].$key$ !== null && t[c].$key$ === u.$key$) {\n a = c;\n break;\n }\n a >= 0 ? (y = t[a], y.$tag$ !== u.$tag$ ? m = D(t && t[i], s, a, e) : (A(y, u, o), t[a] = void 0, m = y.$elm$), u = r[++i]) : (m = D(t && t[i], s, i, e), u = r[++i]), m && T(ce(f.$elm$), m, q(f.$elm$));\n }\n n > d ? le(\n e,\n r[$ + 1] == null ? null : r[$ + 1].$elm$,\n s,\n r,\n i,\n $\n ) : i > $ && ae(t, n, d);\n}, N = (e, t, s = !1) => e.$tag$ === t.$tag$ ? e.$tag$ === \"slot\" ? (\n // The component gets hydrated and no VDOM has been initialized.\n // Here the comparison can't happen as $name$ property is not set for `leftNode`.\n \"$nodeId$\" in e && s && // `leftNode` is not from type HTMLComment which would cause many\n // hydration comments to be removed\n e.$elm$.nodeType !== 8 ? !1 : e.$name$ === t.$name$\n) : s ? !0 : e.$key$ === t.$key$ : !1, q = (e) => e && e[\"s-ol\"] || e, ce = (e) => (e[\"s-ol\"] ? e[\"s-ol\"] : e).parentNode, A = (e, t, s = !1) => {\n const r = t.$elm$ = e.$elm$, o = e.$children$, n = t.$children$, i = t.$tag$, a = t.$text$;\n let c;\n a === null ? (h = i === \"svg\" ? !0 : i === \"foreignObject\" ? !1 : h, i === \"slot\" && !F || ie(e, t, h), o !== null && n !== null ? _e(r, o, t, n, s) : n !== null ? (e.$text$ !== null && (r.textContent = \"\"), le(r, null, t, n, 0, n.length - 1)) : (\n // don't do this on initial render as it can cause non-hydrated content to be removed\n !s && E.updatable && o !== null && ae(o, 0, o.length - 1)\n ), h && i === \"svg\" && (h = !1)) : (c = r[\"s-cr\"]) ? c.parentNode.textContent = a : e.$text$ !== a && (r.data = a);\n}, fe = (e) => {\n const t = e.childNodes;\n for (const s of t)\n if (s.nodeType === 1) {\n if (s[\"s-sr\"]) {\n const r = s[\"s-sn\"];\n s.hidden = !1;\n for (const o of t)\n if (o !== s) {\n if (o[\"s-hn\"] !== s[\"s-hn\"] || r !== \"\") {\n if (o.nodeType === 1 && (r === o.getAttribute(\"slot\") || r === o[\"s-sn\"]) || o.nodeType === 3 && r === o[\"s-sn\"]) {\n s.hidden = !0;\n break;\n }\n } else if (o.nodeType === 1 || o.nodeType === 3 && o.textContent.trim() !== \"\") {\n s.hidden = !0;\n break;\n }\n }\n }\n fe(s);\n }\n}, b = [], ue = (e) => {\n let t, s, r;\n for (const o of e.childNodes) {\n if (o[\"s-sr\"] && (t = o[\"s-cr\"]) && t.parentNode) {\n s = t.parentNode.childNodes;\n const n = o[\"s-sn\"];\n for (r = s.length - 1; r >= 0; r--)\n if (t = s[r], !t[\"s-cn\"] && !t[\"s-nr\"] && t[\"s-hn\"] !== o[\"s-hn\"] && !E.experimentalSlotFixes)\n if (ee(t, n)) {\n let i = b.find((a) => a.$nodeToRelocate$ === t);\n _ = !0, t[\"s-sn\"] = t[\"s-sn\"] || n, i ? (i.$nodeToRelocate$[\"s-sh\"] = o[\"s-hn\"], i.$slotRefNode$ = o) : (t[\"s-sh\"] = o[\"s-hn\"], b.push({\n $slotRefNode$: o,\n $nodeToRelocate$: t\n })), t[\"s-sr\"] && b.map((a) => {\n ee(a.$nodeToRelocate$, t[\"s-sn\"]) && (i = b.find((c) => c.$nodeToRelocate$ === t), i && !a.$slotRefNode$ && (a.$slotRefNode$ = i.$slotRefNode$));\n });\n } else b.some((i) => i.$nodeToRelocate$ === t) || b.push({\n $nodeToRelocate$: t\n });\n }\n o.nodeType === 1 && ue(o);\n }\n}, ee = (e, t) => e.nodeType === 1 ? e.getAttribute(\"slot\") === null && t === \"\" || e.getAttribute(\"slot\") === t : e[\"s-sn\"] === t ? !0 : t === \"\", $e = (e) => {\n e.$attrs$ && e.$attrs$.ref && e.$attrs$.ref(null), e.$children$ && e.$children$.map($e);\n}, T = (e, t, s) => {\n const r = e == null ? void 0 : e.insertBefore(t, s);\n return G(t, e), r;\n}, de = (e) => {\n const t = [];\n return e && t.push(\n ...e[\"s-scs\"] || [],\n e[\"s-si\"],\n e[\"s-sc\"],\n ...de(e.parentElement)\n ), t;\n}, G = (e, t, s = !1) => {\n var r;\n if (e && t && e.nodeType === 1) {\n const o = new Set(de(t).filter(Boolean));\n if (o.size && ((r = e.classList) == null || r.add(...e[\"s-scs\"] = [...o]), e[\"s-ol\"] || s))\n for (const n of Array.from(e.childNodes))\n G(n, e, !0);\n }\n}, De = (e, t, s = !1) => {\n var r, o, n, i, a;\n const c = e.$hostElement$, d = e.$cmpMeta$, f = e.$vnode$ || W(null, null), l = Ne(t) ? t : Le(null, null, t);\n if (R = c.tagName, d.$attrsToReflect$ && (l.$attrs$ = l.$attrs$ || {}, d.$attrsToReflect$.map(\n ([$, u]) => l.$attrs$[u] = c[$]\n )), s && l.$attrs$)\n for (const $ of Object.keys(l.$attrs$))\n c.hasAttribute($) && ![\"key\", \"ref\", \"style\", \"class\"].includes($) && (l.$attrs$[$] = c[$]);\n l.$tag$ = null, l.$flags$ |= 4, e.$vnode$ = l, l.$elm$ = f.$elm$ = c.shadowRoot || c, x = c[\"s-sc\"], F = (d.$flags$ & 1) !== 0, H = c[\"s-cr\"], _ = !1, A(f, l, s);\n {\n if (j.$flags$ |= 1, I) {\n ue(l.$elm$);\n for (const $ of b) {\n const u = $.$nodeToRelocate$;\n if (!u[\"s-ol\"]) {\n const p = M.createTextNode(\"\");\n p[\"s-nr\"] = u, T(u.parentNode, u[\"s-ol\"] = p, u);\n }\n }\n for (const $ of b) {\n const u = $.$nodeToRelocate$, p = $.$slotRefNode$;\n if (p) {\n const m = p.parentNode;\n let y = p.nextSibling;\n {\n let O = (r = u[\"s-ol\"]) == null ? void 0 : r.previousSibling;\n for (; O; ) {\n let v = (o = O[\"s-nr\"]) != null ? o : null;\n if (v && v[\"s-sn\"] === u[\"s-sn\"] && m === v.parentNode) {\n for (v = v.nextSibling; v === u || v != null && v[\"s-sr\"]; )\n v = v == null ? void 0 : v.nextSibling;\n if (!v || !v[\"s-nr\"]) {\n y = v;\n break;\n }\n }\n O = O.previousSibling;\n }\n }\n (!y && m !== u.parentNode || u.nextSibling !== y) && u !== y && (!u[\"s-hn\"] && u[\"s-ol\"] && (u[\"s-hn\"] = u[\"s-ol\"].parentNode.nodeName), T(m, u, y), u.nodeType === 1 && (u.hidden = (n = u[\"s-ih\"]) != null ? n : !1)), u && typeof p[\"s-rf\"] == \"function\" && p[\"s-rf\"](u);\n } else\n u.nodeType === 1 && (s && (u[\"s-ih\"] = (i = u.hidden) != null ? i : !1), u.hidden = !0);\n }\n }\n _ && fe(l.$elm$), j.$flags$ &= -2, b.length = 0;\n }\n if (E.experimentalScopedSlotChanges && d.$flags$ & 2)\n for (const $ of l.$elm$.childNodes)\n $[\"s-hn\"] !== R && !$[\"s-sh\"] && (s && $[\"s-ih\"] == null && ($[\"s-ih\"] = (a = $.hidden) != null ? a : !1), $.hidden = !0);\n H = void 0;\n};\nconst Ce = (e, t, s) => {\n [null, void 0, \"\", !1].includes(s) || [\"innerHTML\", \"style\"].includes(t) || e.setAttribute(t, [\"object\", \"function\"].includes(typeof s) ? \"/!\\\\ Object props are not rendered in the code example\" : s);\n}, pe = (e, t, s, r, o) => {\n if (t && typeof t == \"string\") {\n const n = document.createElement(t);\n Object.keys(s || {}).forEach((i) => {\n Ce(n, i, s[i]);\n }), r == null || r.forEach((i) => {\n pe(n, i.$tag$, i.$attrs$, i.$children$, i.$text$);\n }), s != null && s.innerHTML && (n.innerHTML = s.innerHTML), e.appendChild(n);\n }\n o && (e.innerHTML = o);\n}, st = (e, t) => {\n const s = {};\n if (typeof e != \"object\")\n throw new Error(\"filterArgs - args isn't an object.\");\n for (const r in e)\n if (!r.startsWith(\"slot\")) {\n const o = e[r], n = r.replace(/([a-z])([A-Z])/g, \"$1-$2\").toLowerCase();\n (!t || !Object.keys(t).includes(r) || t[r] !== o) && (s[n] = o);\n }\n return s;\n}, rt = (e, t) => {\n var r, o;\n const s = document.getElementById(\"storybook-root\");\n if (s !== null)\n return (o = document.querySelector(\"[lang]\")) == null || o.setAttribute(\"lang\", ((r = t.globals) == null ? void 0 : r.locale) || \"en\"), De(\n {\n $ancestorComponent$: void 0,\n $flags$: 0,\n $modeName$: void 0,\n $cmpMeta$: {\n $flags$: 0,\n $tagName$: s.tagName\n },\n $hostElement$: s\n },\n e(t)\n ), s.children[s.children.length - 1];\n}, ot = ({ $tag$: e, $attrs$: t, $children$: s, $text$: r }) => {\n const o = document.createElement(\"div\");\n return pe(o, e, t, s, r), o.innerHTML;\n}, C = (e, t) => {\n if (!t)\n return;\n const s = t.split(\"/\");\n return `${e}${s.slice(2, s.length - 1).join(\"-\")}--docs`;\n};\nvar S, w;\nclass nt {\n constructor(t) {\n /**\n * JsonDocs\n */\n g(this, \"jsonDoc\");\n /**\n * Get component data from the jsonDoc\n * @param tagName - tag name we want to get the data from\n * @returns component data\n */\n P(this, S, (t) => this.jsonDoc.components.find((s) => s.tag === t));\n /**\n * Get the control for the given prop\n * Based on https://storybook.js.org/docs/api/arg-types#controltype\n * @param prop - prop to get control for\n * @returns control type and options if applicable\n */\n P(this, w, (t) => {\n const s = t.type.replace(/\"([^\"]+)\"/g, \"$1\").replace(/\\s/g, \"\").replace(/\\(.*?\\)/g, (r) => r.replace(/\\|/g, \" OR \")).split(\"|\").map((r) => r.trim().replace(/ OR /g, \"|\"));\n return t.type === \"string\" ? { control: { type: \"text\" } } : t.type === \"number\" ? { control: { type: \"number\" } } : t.type === \"boolean\" ? { control: { type: \"boolean\" } } : t.type.startsWith(\"{\") && t.type.endsWith(\"}\") ? { control: { type: \"object\" } } : s.length > 1 ? s.includes(\"string\") ? { control: { type: \"text\" } } : s.every((r) => r == null ? void 0 : r.includes(\"[]\")) ? { control: { type: \"object\" } } : (s.unshift(void 0), { control: { type: \"select\" }, options: s }) : { control: { type: \"object\" } };\n });\n /**\n * Extract component arg types from the component data\n * @param tagName - tag name we want to extract the arg types from\n * @returns component arg types\n */\n g(this, \"extractArgTypes\", (t) => {\n const s = k(this, S).call(this, t), r = s == null ? void 0 : s.props.reduce((f, l) => {\n const { control: $, options: u } = k(this, w).call(this, l);\n return {\n ...f,\n [l.name]: {\n name: l.attr || l.name,\n description: l.docs,\n type: { required: l.required },\n table: {\n category: \"props\",\n type: { summary: l.type },\n defaultValue: { summary: l.default }\n },\n control: $,\n options: u\n }\n };\n }, {}), o = s == null ? void 0 : s.events.reduce(\n (f, l) => ({\n ...f,\n [l.event]: {\n name: l.event,\n description: l.docs,\n table: {\n category: \"events\",\n type: { summary: l.detail }\n }\n }\n }),\n {}\n ), n = s == null ? void 0 : s.methods.reduce(\n (f, l) => ({\n ...f,\n [l.name]: {\n name: l.name,\n description: l.docs,\n table: {\n category: \"methods\",\n type: { summary: l.signature }\n }\n }\n }),\n {}\n ), i = s == null ? void 0 : s.slots.reduce(\n (f, l) => ({\n ...f,\n [l.name]: {\n name: l.name !== \"\" ? l.name : \"default\",\n // default slot are unnamed\n description: l.docs,\n table: {\n category: \"slots\",\n type: { summary: void 0 }\n }\n }\n }),\n {}\n ), a = s == null ? void 0 : s.styles.reduce(\n (f, l) => ({\n ...f,\n [l.name]: {\n name: l.name,\n description: l.docs,\n table: {\n category: \"custom properties\",\n type: { summary: void 0 }\n }\n }\n }),\n {}\n ), c = s == null ? void 0 : s.dependencies.reduce((f, l) => {\n const $ = k(this, S).call(this, l);\n return {\n ...f,\n [l]: {\n name: l,\n description: `<a href=\"./?path=/docs/${C(\"\", $ == null ? void 0 : $.filePath)}\">View Component Documentation</a>`,\n table: {\n category: \"depends on\",\n type: { summary: void 0 }\n }\n }\n };\n }, {}), d = s == null ? void 0 : s.dependents.reduce((f, l) => {\n const $ = k(this, S).call(this, l);\n return {\n ...f,\n [l]: {\n name: l,\n description: `<a href=\"./?path=/docs/${C(\"\", $ == null ? void 0 : $.filePath)}\">View Component Documentation</a>`,\n table: {\n category: \"used by\",\n type: { summary: void 0 }\n }\n }\n };\n }, {});\n return {\n ...r,\n ...o,\n ...n,\n ...i,\n ...a,\n ...c,\n ...d\n };\n });\n /**\n * Extract component description from the component data\n * @param tagName - tag name we want to extract the description from\n * @returns component description\n */\n g(this, \"extractComponentDescription\", (t) => {\n const s = k(this, S).call(this, t);\n return (s == null ? void 0 : s.readme) || (s == null ? void 0 : s.docs);\n });\n this.jsonDoc = t;\n }\n}\nS = new WeakMap(), w = new WeakMap();\nconst we = (e, t) => {\n if (t)\n return `${e}${t}`;\n}, ge = (e) => {\n let t = e.overview ? `${e.overview}\n\n` : \"\";\n const s = e.props.filter(({ attr: o }) => o !== void 0);\n s.length && (t += `Attributes:\n`, t += s.map(({ attr: o, docs: n }) => `- \\`${o}\\`: ${n}\n`).join(\"\"), t += `\n`);\n const r = e.props.filter(({ attr: o }) => o === void 0);\n return r.length && (t += `Properties:\n`, t += r.map(({ name: o, docs: n }) => `- \\`${o}\\`: ${n}\n`).join(\"\"), t += `\n`), e.methods.length && (t += `Methods:\n`, t += e.methods.map(({ name: o, docs: n }) => `- \\`${o}\\`: ${n}\n`).join(\"\"), t += `\n`), e.events.length && (t += `Events:\n`, t += e.events.map(({ event: o, docs: n }) => `- \\`${o}\\`: ${n}\n`).join(\"\"), t += `\n`), e.listeners.length && (t += `Listeners:\n`, t += e.listeners.map(({ event: o }) => `- \\`${o}\\`\n`).join(\"\"), t += `\n`), e.slots.length && (t += `Slots:\n`, t += e.slots.map(({ name: o, docs: n }) => `- \\`${o}\\`: ${n}\n`).join(\"\"), t += `\n`), t;\n}, z = (e) => `${e.docs}\n\nType: \\`${e.type}\\``, it = (e, t, s, r) => ({\n $schema: \"https://json.schemastore.org/web-types\",\n name: e,\n version: t,\n \"description-markup\": \"markdown\",\n contributions: {\n html: {\n elements: s.components.map((o) => {\n const n = C(r, o.filePath);\n return {\n name: o.tag,\n description: ge(o),\n \"doc-url\": n,\n attributes: o.props.filter((i) => i.attr).map((i) => ({\n name: i.attr,\n description: z(i),\n \"doc-url\": n,\n value: {\n type: i.type,\n default: i.default,\n required: i.required\n }\n })),\n js: {\n properties: o.props.map((i) => ({\n name: i.name,\n description: z(i),\n \"doc-url\": n,\n value: {\n type: i.type,\n default: i.default,\n required: i.required\n }\n })),\n events: o.events.map((i) => ({\n name: i.event,\n description: i.docs\n }))\n },\n css: {\n properties: o.styles.map((i) => ({\n name: i.name,\n description: i.docs\n }))\n }\n };\n })\n }\n }\n}), Pe = (e, t, s) => [\n { name: \"Storybook\", url: C(e, s) },\n { name: \"Sources\", url: we(t, s) }\n], Ue = (e) => {\n if (!e.values.some(({ value: t }) => t === void 0))\n return e.values.map(({ value: t }) => ({ name: t }));\n}, lt = (e, t, s) => ({\n version: 1.1,\n tags: e.components.map((r) => {\n const o = Pe(t, s, r.filePath);\n return {\n name: r.tag,\n description: ge(r),\n attributes: r.props.map((n) => ({\n name: n.attr || n.name,\n description: z(n),\n values: Ue(n),\n references: o\n })),\n references: o\n };\n }),\n globalAttributes: [],\n valueSets: []\n}), at = (e) => ({\n version: 1.1,\n properties: e.components.flatMap(\n (t) => t.styles.map((s) => ({\n name: s.name,\n description: s.docs\n }))\n )\n}), ct = (e) => {\n const t = { value: \"2023\", pattern: \"yyyy\" }, s = { value: \"12\", pattern: \"mm\" }, r = { value: \"24\", pattern: \"dd\" };\n return ze([t.value, s.value, r.value].join(\"-\"), e, { timeZone: \"UTC\" }).replace(t.value, t.pattern).replace(s.value, s.pattern).replace(r.value, r.pattern);\n}, ft = (e) => e.toISOString().split(\"T\")[0], We = (e, t, s) => {\n const r = e.closest(\"[lang]\"), o = Intl.NumberFormat.supportedLocalesOf(r == null ? void 0 : r.lang), n = o.length > 0 && typeof o[0] == \"string\" ? o[0] : navigator.language || s, i = n.split(\"-\").shift();\n return Object.keys(t).length === 0 ? {\n locale: n,\n messages: { lang: s }\n } : {\n locale: n,\n messages: t[i] || t[s] || { lang: s }\n };\n}, ut = (e, t, s) => new Intl.NumberFormat(t, { style: \"currency\", currency: s }).format(e), $t = (e, t, s = 0) => new Intl.NumberFormat(t, { minimumFractionDigits: s }).format(s > 0 ? Number(e == null ? void 0 : e.toFixed(s)) : e), dt = (e, t, s = 0) => new Intl.NumberFormat(t, {\n style: \"percent\",\n minimumFractionDigits: s,\n maximumFractionDigits: s\n}).format(e), pt = (e, t, s, r = \"short\", o = 0) => new Intl.NumberFormat(t, {\n style: \"unit\",\n unit: s,\n unitDisplay: r,\n minimumFractionDigits: o,\n maximumFractionDigits: o\n}).format(e), He = /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$/, ze = (e, t, s) => typeof e != \"string\" || e === \"\" || !He.test(e) ? \"\" : new Intl.DateTimeFormat(t, s).format(new Date(e)), gt = (e, t) => (s) => We(s, e, t), vt = ({ disconnect: e, observe: t, takeRecords: s }) => {\n class r {\n constructor(n) {\n /**\n *\n */\n g(this, \"disconnect\", e);\n /**\n *\n */\n g(this, \"observe\", t);\n /**\n *\n */\n g(this, \"takeRecords\", s);\n /**\n *\n */\n g(this, \"cb\");\n this.cb = n;\n }\n }\n return [window, global].forEach((o) => {\n Object.defineProperty(o, \"MutationObserver\", {\n writable: !0,\n configurable: !0,\n value: r\n });\n }), r;\n}, ht = ({ disconnect: e, observe: t }) => {\n class s {\n constructor(o) {\n /**\n *\n */\n g(this, \"disconnect\", e);\n /**\n *\n */\n g(this, \"observe\", t);\n /**\n *\n */\n g(this, \"unobserve\");\n /**\n *\n */\n g(this, \"cb\");\n this.cb = o;\n }\n }\n return [window, global].forEach((r) => {\n Object.defineProperty(r, \"ResizeObserver\", {\n writable: !0,\n configurable: !0,\n value: s\n });\n }), s;\n};\nclass Be extends Event {\n constructor() {\n super(...arguments);\n /**\n *\n */\n g(this, \"detail\");\n }\n // eslint-disable-line @typescript-eslint/no-explicit-any\n}\nconst yt = () => {\n class e extends Be {\n }\n return [window, global].forEach((t) => {\n Object.defineProperty(t, \"SubmitEvent\", {\n writable: !0,\n configurable: !0,\n value: e\n });\n }), e;\n};\nexport {\n Xe as ClassList,\n nt as StorybookPreview,\n Je as allItemsAreString,\n et as cleanString,\n qe as createID,\n He as dateRegExp,\n ft as dateToString,\n gt as defineLocales,\n st as filterArgs,\n Qe as focusableElements,\n ct as getLocaleDatePattern,\n te as getParentWindows,\n ot as getStoryHTML,\n C as getStorybookUrl,\n Ze as getWindows,\n Ke as isTagName,\n Ve as isValidNumber,\n me as isValidString,\n Ge as isValideID,\n ut as localeCurrency,\n ze as localeDate,\n $t as localeNumber,\n dt as localePercent,\n pt as localeUnit,\n tt as nextTick,\n vt as setupMutationObserverMock,\n ht as setupResizeObserverMock,\n yt as setupSubmitEventMock,\n rt as stencilWrapper,\n Ye as toString,\n at as vsCodeCssGenerator,\n lt as vsCodeGenerator,\n it as webTypesGenerator\n};\n//# sourceMappingURL=index.es.js.map\n"],"version":3}
1
+ {"file":"index.es.js","mappings":"AAAA,IAAI,EAAE,GAAG,MAAM,CAAC,cAAc,CAAC;AAI/B,IAAI,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAC9G,IAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,IAAI,QAAQ,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAiD;AAE5G,MAAC,EAAE,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,KAAK;AAC/B,EAAE,MAAM,CAAC,GAAG,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC;AAC9B,EAAE,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;AAC5B,EAAE,MAAM,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EA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IAAI,CAAC,YAAY,CAAC,CAAC,EAAE;AACxR,EAAE,KAAK,EAAE,SAAS;AAClB,EAAE,qBAAqB,EAAE,CAAC;AAC1B,EAAE,qBAAqB,EAAE,CAAC;AAC1B,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,OAAO,EAAE,CAAC,GAAG,CAAC,KAAK,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC,EAAE;AAC7E,EAAE,KAAK,EAAE,MAAM;AACf,EAAE,IAAI,EAAE,CAAC;AACT,EAAE,WAAW,EAAE,CAAC;AAChB,EAAE,qBAAqB,EAAE,CAAC;AAC1B,EAAE,qBAAqB,EAAE,CAAC;AAC1B,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,+CAA+C,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,OAAO,CAAC,IAAI,QAAQ,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;;;;","names":[],"sources":["../stencil-helpers/dist/index.es.js"],"sourcesContent":["var ve = Object.defineProperty;\nvar X = (e) => {\n throw TypeError(e);\n};\nvar he = (e, t, s) => t in e ? ve(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;\nvar g = (e, t, s) => he(e, typeof t != \"symbol\" ? t + \"\" : t, s), ye = (e, t, s) => t.has(e) || X(\"Cannot \" + s);\nvar k = (e, t, s) => (ye(e, t, \"read from private field\"), s ? s.call(e) : t.get(e)), P = (e, t, s) => t.has(e) ? X(\"Cannot add the same private member more than once\") : t instanceof WeakSet ? t.add(e) : t.set(e, s);\nconst qe = (e = \"\", t = 10) => {\n const s = new Uint8Array(t);\n crypto.getRandomValues(s);\n const r = Array.from(s).map((o) => o.toString(16).padStart(2, \"0\")).join(\"\").slice(0, t);\n return e !== \"\" ? `${e}-${r}` : r;\n}, Ge = (e) => me(e) && /^([a-z][a-z0-9]*)(-[a-z0-9]+)*$/.exec(e) !== null;\nclass Xe {\n constructor(t = []) {\n /**\n * Available classes\n */\n g(this, \"classes\");\n /**\n * Add class\n * @param className - class name to add\n */\n g(this, \"add\", (t) => {\n this.has(t) || this.classes.push(t);\n });\n /**\n * Delete class\n * @param className - class name to delete\n */\n g(this, \"delete\", (t) => {\n const s = this.classes.indexOf(t);\n s > -1 && this.classes.splice(s, 1);\n });\n /**\n * Check if class exist in list\n * @param className - class name to check\n * @returns class name is in the list\n */\n g(this, \"has\", (t) => this.classes.includes(t));\n /**\n * Join classes seperated by spaces\n * @returns joined values\n */\n g(this, \"join\", () => this.classes.join(\" \"));\n this.classes = t;\n }\n}\nconst Je = (e) => Array.isArray(e) && e.every((t) => typeof t == \"string\"), Ke = (e, t) => t.includes(e == null ? void 0 : e.tagName.toLowerCase()), Qe = 'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex=\"-1\"]), [identifier], mg-button', Ze = (e) => {\n const t = te(e), s = se(e);\n return [e, ...t, ...s];\n}, te = (e, t = []) => {\n if (e.self !== e.top)\n try {\n const s = e.parent;\n return s ? (t.push(s), te(s, t)) : t;\n } catch (s) {\n return console.error(\"Different hosts between iframes:\", s), t;\n }\n return t;\n}, se = (e, t = []) => {\n if (e.frames.length > 0)\n for (const s of Array.from(e.frames))\n t.push(s), se(s, t);\n return t;\n}, me = (e) => typeof e == \"string\" && e.trim() !== \"\", Ye = (e) => typeof e == \"object\" ? JSON.stringify(e) : `${e}`, Ve = (e) => typeof e == \"number\" && !Number.isNaN(e), et = (e) => typeof e == \"string\" ? e.toLocaleLowerCase().normalize(\"NFD\").replaceAll(/[\\u0300-\\u036f]/g, \"\") : e, tt = async (e) => e();\nvar E = {\n allRenderFn: !1,\n cmpDidLoad: !0,\n cmpDidUnload: !1,\n cmpDidUpdate: !0,\n cmpDidRender: !0,\n cmpWillLoad: !0,\n cmpWillUpdate: !0,\n cmpWillRender: !0,\n connectedCallback: !0,\n disconnectedCallback: !0,\n element: !0,\n event: !0,\n hasRenderFn: !0,\n lifecycle: !0,\n hostListener: !0,\n hostListenerTargetWindow: !0,\n hostListenerTargetDocument: !0,\n hostListenerTargetBody: !0,\n hostListenerTargetParent: !1,\n hostListenerTarget: !0,\n member: !0,\n method: !0,\n mode: !0,\n observeAttribute: !0,\n prop: !0,\n propMutable: !0,\n reflect: !0,\n scoped: !0,\n shadowDom: !0,\n slot: !0,\n cssAnnotations: !0,\n state: !0,\n style: !0,\n formAssociated: !1,\n svg: !0,\n updatable: !0,\n vdomAttribute: !0,\n vdomXlink: !0,\n vdomClass: !0,\n vdomFunctional: !0,\n vdomKey: !0,\n vdomListener: !0,\n vdomRef: !0,\n vdomPropOrAttr: !0,\n vdomRender: !0,\n vdomStyle: !0,\n vdomText: !0,\n watchCallback: !0,\n taskQueue: !0,\n hotModuleReplacement: !1,\n isDebug: !1,\n isDev: !1,\n isTesting: !1,\n hydrateServerSide: !1,\n hydrateClientSide: !1,\n lifecycleDOMEvents: !1,\n lazyLoad: !1,\n profile: !1,\n slotRelocation: !0,\n // TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior\n appendChildSlotFix: !1,\n // TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior\n cloneNodeFix: !1,\n hydratedAttribute: !1,\n hydratedClass: !0,\n // TODO(STENCIL-1305): remove this option\n scriptDataOpts: !1,\n // TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior\n scopedSlotTextContentFix: !1,\n // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field\n shadowDomShim: !1,\n // TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior\n slotChildNodesFix: !1,\n invisiblePrehydration: !0,\n propBoolean: !0,\n propNumber: !0,\n propString: !0,\n constructableCSS: !0,\n cmpShouldUpdate: !0,\n devTools: !1,\n shadowDelegatesFocus: !0,\n initializeNextTick: !1,\n asyncLoading: !0,\n asyncQueue: !1,\n transformTagName: !1,\n attachStyles: !0,\n // TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior\n experimentalSlotFixes: !1\n}, be = Object.defineProperty, Se = (e, t) => {\n for (var s in t)\n be(e, s, { get: t[s], enumerable: !0 });\n}, J = (e, t) => t in e, K = \"http://www.w3.org/1999/xlink\", B = typeof window < \"u\" ? window : {}, M = B.document || { head: {} };\nB.HTMLElement;\nvar j = {\n $flags$: 0,\n $resourcesUrl$: \"\",\n jmp: (e) => e(),\n raf: (e) => requestAnimationFrame(e),\n ael: (e, t, s, r) => e.addEventListener(t, s, r),\n rel: (e, t, s, r) => e.removeEventListener(t, s, r),\n ce: (e, t) => new CustomEvent(e, t)\n}, Q = {}, Te = \"http://www.w3.org/2000/svg\", ke = \"http://www.w3.org/1999/xhtml\", xe = (e) => e != null, re = (e) => (e = typeof e, e === \"object\" || e === \"function\"), Ae = {};\nSe(Ae, {\n err: () => oe,\n map: () => Ee,\n ok: () => U,\n unwrap: () => je,\n unwrapErr: () => Re\n});\nvar U = (e) => ({\n isOk: !0,\n isErr: !1,\n value: e\n}), oe = (e) => ({\n isOk: !1,\n isErr: !0,\n value: e\n});\nfunction Ee(e, t) {\n if (e.isOk) {\n const s = t(e.value);\n return s instanceof Promise ? s.then((r) => U(r)) : U(s);\n }\n if (e.isErr) {\n const s = e.value;\n return oe(s);\n }\n throw \"should never get here\";\n}\nvar je = (e) => {\n if (e.isOk)\n return e.value;\n throw e.value;\n}, Re = (e) => {\n if (e.isErr)\n return e.value;\n throw e.value;\n}, Le = (e, t, ...s) => {\n let r = null, o = null, n = null, i = !1, a = !1;\n const c = [], d = (l) => {\n for (let $ = 0; $ < l.length; $++)\n r = l[$], Array.isArray(r) ? d(r) : r != null && typeof r != \"boolean\" && ((i = !re(r)) && (r = String(r)), i && a ? c[c.length - 1].$text$ += r : c.push(i ? W(null, r) : r), a = i);\n };\n d(s);\n const f = W(e, null);\n return f.$attrs$ = t, c.length > 0 && (f.$children$ = c), f.$key$ = o, f.$name$ = n, f;\n}, W = (e, t) => {\n const s = {\n $flags$: 0,\n $tag$: e,\n $text$: t,\n $elm$: null,\n $children$: null\n };\n return s.$attrs$ = null, s.$key$ = null, s.$name$ = null, s;\n}, Oe = {}, Ne = (e) => e && e.$tag$ === Oe, Z = (e, t, s, r, o, n) => {\n if (s !== r) {\n let i = J(e, t), a = t.toLowerCase();\n if (t === \"class\") {\n const c = e.classList, d = Y(s), f = Y(r);\n c.remove(...d.filter((l) => l && !f.includes(l))), c.add(...f.filter((l) => l && !d.includes(l)));\n } else if (t === \"style\") {\n for (const c in s)\n (!r || r[c] == null) && (c.includes(\"-\") ? e.style.removeProperty(c) : e.style[c] = \"\");\n for (const c in r)\n (!s || r[c] !== s[c]) && (c.includes(\"-\") ? e.style.setProperty(c, r[c]) : e.style[c] = r[c]);\n } else if (t !== \"key\") if (t === \"ref\")\n r && r(e);\n else if (!e.__lookupSetter__(t) && t[0] === \"o\" && t[1] === \"n\") {\n if (t[2] === \"-\" ? t = t.slice(3) : J(B, a) ? t = a.slice(2) : t = a[2] + t.slice(3), s || r) {\n const c = t.endsWith(ne);\n t = t.replace(Fe, \"\"), s && j.rel(e, t, s, c), r && j.ael(e, t, r, c);\n }\n } else {\n const c = re(r);\n if ((i || c && r !== null) && !o)\n try {\n if (e.tagName.includes(\"-\"))\n e[t] = r;\n else {\n const f = r ?? \"\";\n t === \"list\" ? i = !1 : (s == null || e[t] != f) && (typeof e.__lookupSetter__(t) == \"function\" ? e[t] = f : e.setAttribute(t, f));\n }\n } catch {\n }\n let d = !1;\n a !== (a = a.replace(/^xlink\\:?/, \"\")) && (t = a, d = !0), r == null || r === !1 ? (r !== !1 || e.getAttribute(t) === \"\") && (d ? e.removeAttributeNS(K, t) : e.removeAttribute(t)) : (!i || n & 4 || o) && !c && (r = r === !0 ? \"\" : r, d ? e.setAttributeNS(K, t, r) : e.setAttribute(t, r));\n }\n }\n}, Me = /\\s/, Y = (e) => e ? e.split(Me) : [], ne = \"Capture\", Fe = new RegExp(ne + \"$\"), ie = (e, t, s) => {\n const r = t.$elm$.nodeType === 11 && t.$elm$.host ? t.$elm$.host : t.$elm$, o = e && e.$attrs$ || Q, n = t.$attrs$ || Q;\n for (const i of V(Object.keys(o)))\n i in n || Z(r, i, o[i], void 0, s, t.$flags$);\n for (const i of V(Object.keys(n)))\n Z(r, i, o[i], n[i], s, t.$flags$);\n};\nfunction V(e) {\n return e.includes(\"ref\") ? (\n // we need to sort these to ensure that `'ref'` is the last attr\n [...e.filter((t) => t !== \"ref\"), \"ref\"]\n ) : (\n // no need to sort, return the original array\n e\n );\n}\nvar x, H, R, F = !1, _ = !1, I = !1, h = !1, D = (e, t, s, r) => {\n var o;\n const n = t.$children$[s];\n let i = 0, a, c, d;\n if (F || (I = !0, n.$tag$ === \"slot\" && (x && r.classList.add(x + \"-s\"), n.$flags$ |= n.$children$ ? (\n // slot element has fallback content\n // still create an element that \"mocks\" the slot element\n 2\n ) : (\n // slot element does not have fallback content\n // create an html comment we'll use to always reference\n // where actual slot content should sit next to\n 1\n ))), n.$text$ !== null)\n a = n.$elm$ = M.createTextNode(n.$text$);\n else if (n.$flags$ & 1)\n a = n.$elm$ = M.createTextNode(\"\");\n else {\n if (h || (h = n.$tag$ === \"svg\"), a = n.$elm$ = M.createElementNS(\n h ? Te : ke,\n !F && E.slotRelocation && n.$flags$ & 2 ? \"slot-fb\" : n.$tag$\n ), h && n.$tag$ === \"foreignObject\" && (h = !1), ie(null, n, h), !!a.getRootNode().querySelector(\"body\") && E.scoped && xe(x) && a[\"s-si\"] !== x && a.classList.add(a[\"s-si\"] = x), G(a, r), n.$children$)\n for (i = 0; i < n.$children$.length; ++i)\n c = D(e, n, i, a), c && a.appendChild(c);\n n.$tag$ === \"svg\" ? h = !1 : a.tagName === \"foreignObject\" && (h = !0);\n }\n return a[\"s-hn\"] = R, n.$flags$ & 3 && (a[\"s-sr\"] = !0, a[\"s-cr\"] = H, a[\"s-sn\"] = n.$name$ || \"\", a[\"s-rf\"] = (o = n.$attrs$) == null ? void 0 : o.ref, d = e && e.$children$ && e.$children$[s], d && d.$tag$ === n.$tag$ && e.$elm$ && L(e.$elm$, !1)), a;\n}, L = (e, t) => {\n j.$flags$ |= 1;\n const s = Array.from(e.childNodes);\n if (e[\"s-sr\"] && E.experimentalSlotFixes) {\n let r = e;\n for (; r = r.nextSibling; )\n r && r[\"s-sn\"] === e[\"s-sn\"] && r[\"s-sh\"] === R && s.push(r);\n }\n for (let r = s.length - 1; r >= 0; r--) {\n const o = s[r];\n o[\"s-hn\"] !== R && o[\"s-ol\"] && (T(ce(o), o, q(o)), o[\"s-ol\"].remove(), o[\"s-ol\"] = void 0, o[\"s-sh\"] = void 0, I = !0), t && L(o, t);\n }\n j.$flags$ &= -2;\n}, le = (e, t, s, r, o, n) => {\n let i = e[\"s-cr\"] && e[\"s-cr\"].parentNode || e, a;\n for (i.shadowRoot && i.tagName === R && (i = i.shadowRoot); o <= n; ++o)\n r[o] && (a = D(null, s, o, e), a && (r[o].$elm$ = a, T(i, a, q(t))));\n}, ae = (e, t, s) => {\n for (let r = t; r <= s; ++r) {\n const o = e[r];\n if (o) {\n const n = o.$elm$;\n $e(o), n && (_ = !0, n[\"s-ol\"] ? n[\"s-ol\"].remove() : L(n, !0), n.remove());\n }\n }\n}, _e = (e, t, s, r, o = !1) => {\n let n = 0, i = 0, a = 0, c = 0, d = t.length - 1, f = t[0], l = t[d], $ = r.length - 1, u = r[0], p = r[$], m, y;\n for (; n <= d && i <= $; )\n if (f == null)\n f = t[++n];\n else if (l == null)\n l = t[--d];\n else if (u == null)\n u = r[++i];\n else if (p == null)\n p = r[--$];\n else if (N(f, u, o))\n A(f, u, o), f = t[++n], u = r[++i];\n else if (N(l, p, o))\n A(l, p, o), l = t[--d], p = r[--$];\n else if (N(f, p, o))\n (f.$tag$ === \"slot\" || p.$tag$ === \"slot\") && L(f.$elm$.parentNode, !1), A(f, p, o), T(e, f.$elm$, l.$elm$.nextSibling), f = t[++n], p = r[--$];\n else if (N(l, u, o))\n (f.$tag$ === \"slot\" || p.$tag$ === \"slot\") && L(l.$elm$.parentNode, !1), A(l, u, o), T(e, l.$elm$, f.$elm$), l = t[--d], u = r[++i];\n else {\n for (a = -1, c = n; c <= d; ++c)\n if (t[c] && t[c].$key$ !== null && t[c].$key$ === u.$key$) {\n a = c;\n break;\n }\n a >= 0 ? (y = t[a], y.$tag$ !== u.$tag$ ? m = D(t && t[i], s, a, e) : (A(y, u, o), t[a] = void 0, m = y.$elm$), u = r[++i]) : (m = D(t && t[i], s, i, e), u = r[++i]), m && T(ce(f.$elm$), m, q(f.$elm$));\n }\n n > d ? le(\n e,\n r[$ + 1] == null ? null : r[$ + 1].$elm$,\n s,\n r,\n i,\n $\n ) : i > $ && ae(t, n, d);\n}, N = (e, t, s = !1) => e.$tag$ === t.$tag$ ? e.$tag$ === \"slot\" ? (\n // The component gets hydrated and no VDOM has been initialized.\n // Here the comparison can't happen as $name$ property is not set for `leftNode`.\n \"$nodeId$\" in e && s && // `leftNode` is not from type HTMLComment which would cause many\n // hydration comments to be removed\n e.$elm$.nodeType !== 8 ? !1 : e.$name$ === t.$name$\n) : s ? !0 : e.$key$ === t.$key$ : !1, q = (e) => e && e[\"s-ol\"] || e, ce = (e) => (e[\"s-ol\"] ? e[\"s-ol\"] : e).parentNode, A = (e, t, s = !1) => {\n const r = t.$elm$ = e.$elm$, o = e.$children$, n = t.$children$, i = t.$tag$, a = t.$text$;\n let c;\n a === null ? (h = i === \"svg\" ? !0 : i === \"foreignObject\" ? !1 : h, i === \"slot\" && !F || ie(e, t, h), o !== null && n !== null ? _e(r, o, t, n, s) : n !== null ? (e.$text$ !== null && (r.textContent = \"\"), le(r, null, t, n, 0, n.length - 1)) : (\n // don't do this on initial render as it can cause non-hydrated content to be removed\n !s && E.updatable && o !== null && ae(o, 0, o.length - 1)\n ), h && i === \"svg\" && (h = !1)) : (c = r[\"s-cr\"]) ? c.parentNode.textContent = a : e.$text$ !== a && (r.data = a);\n}, fe = (e) => {\n const t = e.childNodes;\n for (const s of t)\n if (s.nodeType === 1) {\n if (s[\"s-sr\"]) {\n const r = s[\"s-sn\"];\n s.hidden = !1;\n for (const o of t)\n if (o !== s) {\n if (o[\"s-hn\"] !== s[\"s-hn\"] || r !== \"\") {\n if (o.nodeType === 1 && (r === o.getAttribute(\"slot\") || r === o[\"s-sn\"]) || o.nodeType === 3 && r === o[\"s-sn\"]) {\n s.hidden = !0;\n break;\n }\n } else if (o.nodeType === 1 || o.nodeType === 3 && o.textContent.trim() !== \"\") {\n s.hidden = !0;\n break;\n }\n }\n }\n fe(s);\n }\n}, b = [], ue = (e) => {\n let t, s, r;\n for (const o of e.childNodes) {\n if (o[\"s-sr\"] && (t = o[\"s-cr\"]) && t.parentNode) {\n s = t.parentNode.childNodes;\n const n = o[\"s-sn\"];\n for (r = s.length - 1; r >= 0; r--)\n if (t = s[r], !t[\"s-cn\"] && !t[\"s-nr\"] && t[\"s-hn\"] !== o[\"s-hn\"] && !E.experimentalSlotFixes)\n if (ee(t, n)) {\n let i = b.find((a) => a.$nodeToRelocate$ === t);\n _ = !0, t[\"s-sn\"] = t[\"s-sn\"] || n, i ? (i.$nodeToRelocate$[\"s-sh\"] = o[\"s-hn\"], i.$slotRefNode$ = o) : (t[\"s-sh\"] = o[\"s-hn\"], b.push({\n $slotRefNode$: o,\n $nodeToRelocate$: t\n })), t[\"s-sr\"] && b.map((a) => {\n ee(a.$nodeToRelocate$, t[\"s-sn\"]) && (i = b.find((c) => c.$nodeToRelocate$ === t), i && !a.$slotRefNode$ && (a.$slotRefNode$ = i.$slotRefNode$));\n });\n } else b.some((i) => i.$nodeToRelocate$ === t) || b.push({\n $nodeToRelocate$: t\n });\n }\n o.nodeType === 1 && ue(o);\n }\n}, ee = (e, t) => e.nodeType === 1 ? e.getAttribute(\"slot\") === null && t === \"\" || e.getAttribute(\"slot\") === t : e[\"s-sn\"] === t ? !0 : t === \"\", $e = (e) => {\n e.$attrs$ && e.$attrs$.ref && e.$attrs$.ref(null), e.$children$ && e.$children$.map($e);\n}, T = (e, t, s) => {\n const r = e == null ? void 0 : e.insertBefore(t, s);\n return G(t, e), r;\n}, de = (e) => {\n const t = [];\n return e && t.push(\n ...e[\"s-scs\"] || [],\n e[\"s-si\"],\n e[\"s-sc\"],\n ...de(e.parentElement)\n ), t;\n}, G = (e, t, s = !1) => {\n var r;\n if (e && t && e.nodeType === 1) {\n const o = new Set(de(t).filter(Boolean));\n if (o.size && ((r = e.classList) == null || r.add(...e[\"s-scs\"] = Array.from(o)), e[\"s-ol\"] || s))\n for (const n of Array.from(e.childNodes))\n G(n, e, !0);\n }\n}, De = (e, t, s = !1) => {\n var r, o, n, i, a;\n const c = e.$hostElement$, d = e.$cmpMeta$, f = e.$vnode$ || W(null, null), l = Ne(t) ? t : Le(null, null, t);\n if (R = c.tagName, d.$attrsToReflect$ && (l.$attrs$ = l.$attrs$ || {}, d.$attrsToReflect$.map(\n ([$, u]) => l.$attrs$[u] = c[$]\n )), s && l.$attrs$)\n for (const $ of Object.keys(l.$attrs$))\n c.hasAttribute($) && ![\"key\", \"ref\", \"style\", \"class\"].includes($) && (l.$attrs$[$] = c[$]);\n l.$tag$ = null, l.$flags$ |= 4, e.$vnode$ = l, l.$elm$ = f.$elm$ = c.shadowRoot || c, x = c[\"s-sc\"], F = (d.$flags$ & 1) !== 0, H = c[\"s-cr\"], _ = !1, A(f, l, s);\n {\n if (j.$flags$ |= 1, I) {\n ue(l.$elm$);\n for (const $ of b) {\n const u = $.$nodeToRelocate$;\n if (!u[\"s-ol\"]) {\n const p = M.createTextNode(\"\");\n p[\"s-nr\"] = u, T(u.parentNode, u[\"s-ol\"] = p, u);\n }\n }\n for (const $ of b) {\n const u = $.$nodeToRelocate$, p = $.$slotRefNode$;\n if (p) {\n const m = p.parentNode;\n let y = p.nextSibling;\n {\n let O = (r = u[\"s-ol\"]) == null ? void 0 : r.previousSibling;\n for (; O; ) {\n let v = (o = O[\"s-nr\"]) != null ? o : null;\n if (v && v[\"s-sn\"] === u[\"s-sn\"] && m === v.parentNode) {\n for (v = v.nextSibling; v === u || v != null && v[\"s-sr\"]; )\n v = v == null ? void 0 : v.nextSibling;\n if (!v || !v[\"s-nr\"]) {\n y = v;\n break;\n }\n }\n O = O.previousSibling;\n }\n }\n (!y && m !== u.parentNode || u.nextSibling !== y) && u !== y && (!u[\"s-hn\"] && u[\"s-ol\"] && (u[\"s-hn\"] = u[\"s-ol\"].parentNode.nodeName), T(m, u, y), u.nodeType === 1 && (u.hidden = (n = u[\"s-ih\"]) != null ? n : !1)), u && typeof p[\"s-rf\"] == \"function\" && p[\"s-rf\"](u);\n } else\n u.nodeType === 1 && (s && (u[\"s-ih\"] = (i = u.hidden) != null ? i : !1), u.hidden = !0);\n }\n }\n _ && fe(l.$elm$), j.$flags$ &= -2, b.length = 0;\n }\n if (E.experimentalScopedSlotChanges && d.$flags$ & 2)\n for (const $ of l.$elm$.childNodes)\n $[\"s-hn\"] !== R && !$[\"s-sh\"] && (s && $[\"s-ih\"] == null && ($[\"s-ih\"] = (a = $.hidden) != null ? a : !1), $.hidden = !0);\n H = void 0;\n};\nconst Ce = (e, t, s) => {\n [null, void 0, \"\", !1].includes(s) || [\"innerHTML\", \"style\"].includes(t) || e.setAttribute(t, [\"object\", \"function\"].includes(typeof s) ? \"/!\\\\ Object props are not rendered in the code example\" : s);\n}, pe = (e, t, s, r, o) => {\n if (t && typeof t == \"string\") {\n const n = document.createElement(t);\n Object.keys(s || {}).forEach((i) => {\n Ce(n, i, s[i]);\n }), r == null || r.forEach((i) => {\n pe(n, i.$tag$, i.$attrs$, i.$children$, i.$text$);\n }), s != null && s.innerHTML && (n.innerHTML = s.innerHTML), e.appendChild(n);\n }\n o && (e.innerHTML = o);\n}, st = (e, t) => {\n const s = {};\n if (typeof e != \"object\")\n throw new Error(\"filterArgs - args isn't an object.\");\n for (const r in e)\n if (!r.startsWith(\"slot\")) {\n const o = e[r], n = r.replace(/([a-z])([A-Z])/g, \"$1-$2\").toLowerCase();\n (!t || !Object.keys(t).includes(r) || t[r] !== o) && (s[n] = o);\n }\n return s;\n}, rt = (e, t) => {\n var r, o;\n const s = document.getElementById(\"storybook-root\");\n if (s !== null)\n return (o = document.querySelector(\"[lang]\")) == null || o.setAttribute(\"lang\", ((r = t.globals) == null ? void 0 : r.locale) || \"en\"), De(\n {\n $ancestorComponent$: void 0,\n $flags$: 0,\n $modeName$: void 0,\n $cmpMeta$: {\n $flags$: 0,\n $tagName$: s.tagName\n },\n $hostElement$: s\n },\n e(t)\n ), s.children[s.children.length - 1];\n}, ot = ({ $tag$: e, $attrs$: t, $children$: s, $text$: r }) => {\n const o = document.createElement(\"div\");\n return pe(o, e, t, s, r), o.innerHTML;\n}, C = (e, t) => {\n if (!t)\n return;\n const s = t.split(\"/\");\n return `${e}${s.slice(2, s.length - 1).join(\"-\")}--docs`;\n};\nvar S, w;\nclass nt {\n constructor(t) {\n /**\n * JsonDocs\n */\n g(this, \"jsonDoc\");\n /**\n * Get component data from the jsonDoc\n * @param tagName - tag name we want to get the data from\n * @returns component data\n */\n P(this, S, (t) => this.jsonDoc.components.find((s) => s.tag === t));\n /**\n * Get the control for the given prop\n * Based on https://storybook.js.org/docs/api/arg-types#controltype\n * @param prop - prop to get control for\n * @returns control type and options if applicable\n */\n P(this, w, (t) => {\n const s = t.type.replace(/\"([^\"]+)\"/g, \"$1\").replace(/\\s/g, \"\").replace(/\\(.*?\\)/g, (r) => r.replace(/\\|/g, \" OR \")).split(\"|\").map((r) => r.trim().replace(/ OR /g, \"|\"));\n return t.type === \"string\" ? { control: { type: \"text\" } } : t.type === \"number\" ? { control: { type: \"number\" } } : t.type === \"boolean\" ? { control: { type: \"boolean\" } } : t.type.startsWith(\"{\") && t.type.endsWith(\"}\") ? { control: { type: \"object\" } } : s.length > 1 ? s.includes(\"string\") ? { control: { type: \"text\" } } : s.every((r) => r == null ? void 0 : r.includes(\"[]\")) ? { control: { type: \"object\" } } : (s.unshift(void 0), { control: { type: \"select\" }, options: s }) : { control: { type: \"object\" } };\n });\n /**\n * Extract component arg types from the component data\n * @param tagName - tag name we want to extract the arg types from\n * @returns component arg types\n */\n g(this, \"extractArgTypes\", (t) => {\n const s = k(this, S).call(this, t), r = s == null ? void 0 : s.props.reduce((f, l) => {\n const { control: $, options: u } = k(this, w).call(this, l);\n return {\n ...f,\n [l.name]: {\n name: l.attr || l.name,\n description: l.docs,\n type: { required: l.required },\n table: {\n category: \"props\",\n type: { summary: l.type },\n defaultValue: { summary: l.default }\n },\n control: $,\n options: u\n }\n };\n }, {}), o = s == null ? void 0 : s.events.reduce(\n (f, l) => ({\n ...f,\n [l.event]: {\n name: l.event,\n description: l.docs,\n table: {\n category: \"events\",\n type: { summary: l.detail }\n }\n }\n }),\n {}\n ), n = s == null ? void 0 : s.methods.reduce(\n (f, l) => ({\n ...f,\n [l.name]: {\n name: l.name,\n description: l.docs,\n table: {\n category: \"methods\",\n type: { summary: l.signature }\n }\n }\n }),\n {}\n ), i = s == null ? void 0 : s.slots.reduce(\n (f, l) => ({\n ...f,\n [l.name]: {\n name: l.name !== \"\" ? l.name : \"default\",\n // default slot are unnamed\n description: l.docs,\n table: {\n category: \"slots\",\n type: { summary: void 0 }\n }\n }\n }),\n {}\n ), a = s == null ? void 0 : s.styles.reduce(\n (f, l) => ({\n ...f,\n [l.name]: {\n name: l.name,\n description: l.docs,\n table: {\n category: \"custom properties\",\n type: { summary: void 0 }\n }\n }\n }),\n {}\n ), c = s == null ? void 0 : s.dependencies.reduce((f, l) => {\n const $ = k(this, S).call(this, l);\n return {\n ...f,\n [l]: {\n name: l,\n description: `<a href=\"./?path=/docs/${C(\"\", $ == null ? void 0 : $.filePath)}\">View Component Documentation</a>`,\n table: {\n category: \"depends on\",\n type: { summary: void 0 }\n }\n }\n };\n }, {}), d = s == null ? void 0 : s.dependents.reduce((f, l) => {\n const $ = k(this, S).call(this, l);\n return {\n ...f,\n [l]: {\n name: l,\n description: `<a href=\"./?path=/docs/${C(\"\", $ == null ? void 0 : $.filePath)}\">View Component Documentation</a>`,\n table: {\n category: \"used by\",\n type: { summary: void 0 }\n }\n }\n };\n }, {});\n return {\n ...r,\n ...o,\n ...n,\n ...i,\n ...a,\n ...c,\n ...d\n };\n });\n /**\n * Extract component description from the component data\n * @param tagName - tag name we want to extract the description from\n * @returns component description\n */\n g(this, \"extractComponentDescription\", (t) => {\n const s = k(this, S).call(this, t);\n return (s == null ? void 0 : s.readme) || (s == null ? void 0 : s.docs);\n });\n this.jsonDoc = t;\n }\n}\nS = new WeakMap(), w = new WeakMap();\nconst we = (e, t) => {\n if (t)\n return `${e}${t}`;\n}, ge = (e) => {\n let t = e.overview ? `${e.overview}\n\n` : \"\";\n const s = e.props.filter(({ attr: o }) => o !== void 0);\n s.length && (t += `Attributes:\n`, t += s.map(({ attr: o, docs: n }) => `- \\`${o}\\`: ${n}\n`).join(\"\"), t += `\n`);\n const r = e.props.filter(({ attr: o }) => o === void 0);\n return r.length && (t += `Properties:\n`, t += r.map(({ name: o, docs: n }) => `- \\`${o}\\`: ${n}\n`).join(\"\"), t += `\n`), e.methods.length && (t += `Methods:\n`, t += e.methods.map(({ name: o, docs: n }) => `- \\`${o}\\`: ${n}\n`).join(\"\"), t += `\n`), e.events.length && (t += `Events:\n`, t += e.events.map(({ event: o, docs: n }) => `- \\`${o}\\`: ${n}\n`).join(\"\"), t += `\n`), e.listeners.length && (t += `Listeners:\n`, t += e.listeners.map(({ event: o }) => `- \\`${o}\\`\n`).join(\"\"), t += `\n`), e.slots.length && (t += `Slots:\n`, t += e.slots.map(({ name: o, docs: n }) => `- \\`${o}\\`: ${n}\n`).join(\"\"), t += `\n`), t;\n}, z = (e) => `${e.docs}\n\nType: \\`${e.type}\\``, it = (e, t, s, r) => ({\n $schema: \"https://json.schemastore.org/web-types\",\n name: e,\n version: t,\n \"description-markup\": \"markdown\",\n contributions: {\n html: {\n elements: s.components.map((o) => {\n const n = C(r, o.filePath);\n return {\n name: o.tag,\n description: ge(o),\n \"doc-url\": n,\n attributes: o.props.filter((i) => i.attr).map((i) => ({\n name: i.attr,\n description: z(i),\n \"doc-url\": n,\n value: {\n type: i.type,\n default: i.default,\n required: i.required\n }\n })),\n js: {\n properties: o.props.map((i) => ({\n name: i.name,\n description: z(i),\n \"doc-url\": n,\n value: {\n type: i.type,\n default: i.default,\n required: i.required\n }\n })),\n events: o.events.map((i) => ({\n name: i.event,\n description: i.docs\n }))\n },\n css: {\n properties: o.styles.map((i) => ({\n name: i.name,\n description: i.docs\n }))\n }\n };\n })\n }\n }\n}), Pe = (e, t, s) => [\n { name: \"Storybook\", url: C(e, s) },\n { name: \"Sources\", url: we(t, s) }\n], Ue = (e) => {\n if (!e.values.some(({ value: t }) => t === void 0))\n return e.values.map(({ value: t }) => ({ name: t }));\n}, lt = (e, t, s) => ({\n version: 1.1,\n tags: e.components.map((r) => {\n const o = Pe(t, s, r.filePath);\n return {\n name: r.tag,\n description: ge(r),\n attributes: r.props.map((n) => ({\n name: n.attr || n.name,\n description: z(n),\n values: Ue(n),\n references: o\n })),\n references: o\n };\n }),\n globalAttributes: [],\n valueSets: []\n}), at = (e) => ({\n version: 1.1,\n properties: e.components.flatMap(\n (t) => t.styles.map((s) => ({\n name: s.name,\n description: s.docs\n }))\n )\n}), ct = (e) => {\n const t = { value: \"2023\", pattern: \"yyyy\" }, s = { value: \"12\", pattern: \"mm\" }, r = { value: \"24\", pattern: \"dd\" };\n return ze([t.value, s.value, r.value].join(\"-\"), e, { timeZone: \"UTC\" }).replace(t.value, t.pattern).replace(s.value, s.pattern).replace(r.value, r.pattern);\n}, ft = (e) => e.toISOString().split(\"T\")[0], We = (e, t, s) => {\n const r = e.closest(\"[lang]\"), o = Intl.NumberFormat.supportedLocalesOf(r == null ? void 0 : r.lang), n = o.length > 0 && typeof o[0] == \"string\" ? o[0] : navigator.language || s, i = n.split(\"-\").shift();\n return Object.keys(t).length === 0 ? {\n locale: n,\n messages: { lang: s }\n } : {\n locale: n,\n messages: t[i] || t[s] || { lang: s }\n };\n}, ut = (e, t, s) => new Intl.NumberFormat(t, { style: \"currency\", currency: s }).format(e), $t = (e, t, s = 0) => new Intl.NumberFormat(t, { minimumFractionDigits: s }).format(s > 0 ? Number(e == null ? void 0 : e.toFixed(s)) : e), dt = (e, t, s = 0) => new Intl.NumberFormat(t, {\n style: \"percent\",\n minimumFractionDigits: s,\n maximumFractionDigits: s\n}).format(e), pt = (e, t, s, r = \"short\", o = 0) => new Intl.NumberFormat(t, {\n style: \"unit\",\n unit: s,\n unitDisplay: r,\n minimumFractionDigits: o,\n maximumFractionDigits: o\n}).format(e), He = /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$/, ze = (e, t, s) => typeof e != \"string\" || e === \"\" || !He.test(e) ? \"\" : new Intl.DateTimeFormat(t, s).format(new Date(e)), gt = (e, t) => (s) => We(s, e, t), vt = ({ disconnect: e, observe: t, takeRecords: s }) => {\n class r {\n constructor(n) {\n /**\n *\n */\n g(this, \"disconnect\", e);\n /**\n *\n */\n g(this, \"observe\", t);\n /**\n *\n */\n g(this, \"takeRecords\", s);\n /**\n *\n */\n g(this, \"cb\");\n this.cb = n;\n }\n }\n return [window, global].forEach((o) => {\n Object.defineProperty(o, \"MutationObserver\", {\n writable: !0,\n configurable: !0,\n value: r\n });\n }), r;\n}, ht = ({ disconnect: e, observe: t }) => {\n class s {\n constructor(o) {\n /**\n *\n */\n g(this, \"disconnect\", e);\n /**\n *\n */\n g(this, \"observe\", t);\n /**\n *\n */\n g(this, \"unobserve\");\n /**\n *\n */\n g(this, \"cb\");\n this.cb = o;\n }\n }\n return [window, global].forEach((r) => {\n Object.defineProperty(r, \"ResizeObserver\", {\n writable: !0,\n configurable: !0,\n value: s\n });\n }), s;\n};\nclass Be extends Event {\n constructor() {\n super(...arguments);\n /**\n *\n */\n g(this, \"detail\");\n }\n // eslint-disable-line @typescript-eslint/no-explicit-any\n}\nconst yt = () => {\n class e extends Be {\n }\n return [window, global].forEach((t) => {\n Object.defineProperty(t, \"SubmitEvent\", {\n writable: !0,\n configurable: !0,\n value: e\n });\n }), e;\n};\nexport {\n Xe as ClassList,\n nt as StorybookPreview,\n Je as allItemsAreString,\n et as cleanString,\n qe as createID,\n He as dateRegExp,\n ft as dateToString,\n gt as defineLocales,\n st as filterArgs,\n Qe as focusableElements,\n ct as getLocaleDatePattern,\n te as getParentWindows,\n ot as getStoryHTML,\n C as getStorybookUrl,\n Ze as getWindows,\n Ke as isTagName,\n Ve as isValidNumber,\n me as isValidString,\n Ge as isValideID,\n ut as localeCurrency,\n ze as localeDate,\n $t as localeNumber,\n dt as localePercent,\n pt as localeUnit,\n tt as nextTick,\n vt as setupMutationObserverMock,\n ht as setupResizeObserverMock,\n yt as setupSubmitEventMock,\n rt as stencilWrapper,\n Ye as toString,\n at as vsCodeCssGenerator,\n lt as vsCodeGenerator,\n it as webTypesGenerator\n};\n//# sourceMappingURL=index.es.js.map\n"],"version":3}
@@ -25,6 +25,7 @@ const MgAlert$1 = /*@__PURE__*/ proxyCustomElement(class MgAlert extends HTMLEle
25
25
  this.__attachShadow();
26
26
  this.componentShow = createEvent(this, "component-show", 7);
27
27
  this.componentHide = createEvent(this, "component-hide", 7);
28
+ this.componentClose = createEvent(this, "component-close", 7);
28
29
  /************
29
30
  * Internal *
30
31
  ************/
@@ -69,6 +70,7 @@ const MgAlert$1 = /*@__PURE__*/ proxyCustomElement(class MgAlert extends HTMLEle
69
70
  */
70
71
  this.handleClose = () => {
71
72
  this.element.hidden = true;
73
+ this.componentClose.emit();
72
74
  };
73
75
  this.delay = undefined;
74
76
  this.variant = undefined;
@@ -147,7 +149,7 @@ const MgAlert$1 = /*@__PURE__*/ proxyCustomElement(class MgAlert extends HTMLEle
147
149
  * @returns HTML Element
148
150
  */
149
151
  render() {
150
- return (h("mg-message", { key: '4023a825a33246b23dcacc322f7c35f14823f8ef', class: this.classCollection.join(), role: this.variant === 'info' ? 'status' : 'alert', variant: this.variant, variantStyle: this.variantStyle }, h("slot", { key: 'cd1c9204c3a325d476cab4f1ce762bdd3662b074' }), this.hasActions ? (h("span", { slot: "actions" }, h("slot", { name: "actions" }))) : (h("span", { class: "mg-c-alert__close-button" }, h("mg-button", { "is-icon": true, variant: "flat", label: this.messages.alert.closeButton, onClick: this.handleClose }, h("mg-icon", { icon: "cross" }))))));
152
+ return (h("mg-message", { key: 'caf7e5313dd1fa9075bf38c2a9269592a6bd85fa', class: this.classCollection.join(), role: this.variant === 'info' ? 'status' : 'alert', variant: this.variant, variantStyle: this.variantStyle }, h("slot", { key: '21e5bd4aaad91c4b357ca032946c060ee13a47e4' }), this.hasActions ? (h("span", { slot: "actions" }, h("slot", { name: "actions" }))) : (h("span", { class: "mg-c-alert__close-button" }, h("mg-button", { "is-icon": true, variant: "flat", label: this.messages.alert.closeButton, onClick: this.handleClose }, h("mg-icon", { icon: "cross" }))))));
151
153
  }
152
154
  get element() { return this; }
153
155
  static get watchers() { return {
@@ -1 +1 @@
1
- {"file":"mg-alert.js","mappings":";;;;;;;;AAEA;;;AAGO,MAAM,QAAQ,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAU,CAAC;AAO1E;;;AAGO,MAAM,aAAa,GAAG,CAAC,UAAU,EAAE,YAAY,CAAU;;ACfhE,MAAM,UAAU,GAAG,uJAAuJ,CAAC;AAC3K,sBAAe,UAAU;;MCaZA,SAAO;;;;;;;;;;;QAMD,qBAAgB,GAAG,0BAA0B,CAAC;;QAGvD,gBAAW,GAAkC,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H;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["MgAlert","ClassList","toString"],"sources":["src/components/molecules/mg-alert/mg-alert.conf.ts","../styles/dist/components/mg-alert.css?tag=mg-alert&encapsulation=shadow","src/components/molecules/mg-alert/mg-alert.tsx"],"sourcesContent":["import type { Variant, VariantStyle } from '../../../types';\n\n/**\n * List available variants\n */\nexport const variants = ['info', 'warning', 'success', 'danger'] as const;\n\n/**\n * Variant type\n */\nexport type VariantType = Variant & (typeof variants)[number];\n\n/**\n * List available variant styles\n */\nexport const variantStyles = ['bar-left', 'background'] as const;\n\n/**\n * VariantStyle type\n */\nexport type VariantStyleType = VariantStyle & (typeof variantStyles)[number];\n",".mg-c-alert__close-button{position:absolute;top:0;right:0}.mg-c-alert.mg-c-alert--close-button{--mg-c-card-spacing: 0 var(--mg-b-size-min-height) 0 0}/*# sourceMappingURL=mg-alert.css.map */\n","import { Component, Element, Event, EventEmitter, h, Prop, State, Watch, forceUpdate } from '@stencil/core';\nimport { ClassList, toString } from '@mgdis/stencil-helpers';\nimport { variants, variantStyles, VariantStyleType, VariantType } from './mg-alert.conf';\nimport { initLocales } from '../../../locales';\n\n/**\n * @slot - Alert content\n * @slot actions - Actions content\n */\n@Component({\n tag: 'mg-alert',\n styleUrl: '../../../../node_modules/@mgdis/styles/dist/components/mg-alert.css',\n shadow: true,\n})\nexport class MgAlert {\n /************\n * Internal *\n ************/\n\n // Classes\n private readonly classCloseButton = 'mg-c-alert--close-button';\n\n // Stored timer setted when hide action is run from setTimeOut\n private storedTimer: ReturnType<typeof setTimeout> = null;\n\n // Manage hover\n private isFocused = false;\n private isHovered = false;\n\n // Locales\n private messages;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgAlertElement;\n\n /**\n * Add a delay to hide/close message when it passed\n * Value is defined in seconds and must greater than 2 seconds\n */\n @Prop() delay?: number;\n @Watch('delay')\n watchDelay(newValue: MgAlert['delay']): void {\n if (newValue !== undefined && newValue < 2) {\n throw new Error(`<mg-alert> prop \"delay\" must be greater than 2 seconds. Passed value: ${toString(newValue)}.`);\n }\n }\n\n /**\n * Define variant\n */\n @Prop() variant?: VariantType;\n @Watch('variant')\n watchVariant(newValue: MgAlert['variant']): void {\n if (newValue && !variants.includes(newValue)) {\n throw new Error(`<mg-alert> prop \"variant\" must be one of: ${variants.join(', ')}. Passed value: ${toString(newValue)}.`);\n }\n }\n\n /**\n * Define variant style\n */\n @Prop() variantStyle?: VariantStyleType;\n @Watch('variantStyle')\n watchVariantStyle(newValue: MgAlert['variantStyle']): void {\n if (newValue && !variantStyles.includes(newValue)) {\n throw new Error(`<mg-alert> prop \"variantStyle\" must be one of: ${variantStyles.join(', ')}. Passed value: ${toString(newValue)}.`);\n }\n }\n\n /**\n * Watch hidden prop\n */\n // eslint-disable-next-line @stencil-community/no-unused-watch\n @Watch('hidden')\n watchHidden(newValue: boolean): void {\n if (typeof newValue === 'string' && newValue === '') {\n newValue = true;\n }\n if (newValue) {\n this.componentHide.emit();\n // Remove event Listener\n ['focusin', 'mouseenter'].forEach(event => {\n this.element.removeEventListener(event, this.timerEvents);\n });\n // Clear Timer\n this.clearTimer();\n } else {\n this.componentShow.emit();\n // If delay is set\n if (this.delay > 1) {\n // Start timer\n this.setTimer();\n // Stop timer when get focus or mouse enter\n ['focusin', 'mouseenter'].forEach(event => {\n this.element.addEventListener(event, this.timerEvents);\n });\n }\n }\n forceUpdate(this);\n }\n\n /**\n * Component classes\n */\n @State() classCollection: ClassList = new ClassList(['mg-c-alert']);\n\n /**\n * Define if component is using actions slot\n */\n @State() hasActions = false;\n\n /**\n * Emited event when alert is diplayed\n */\n @Event({ eventName: 'component-show' }) componentShow: EventEmitter<void>;\n\n /**\n * Emited event when alert is hidden\n */\n @Event({ eventName: 'component-hide' }) componentHide: EventEmitter<void>;\n\n /**\n * Set timer\n */\n private setTimer = (): void => {\n this.storedTimer = setTimeout(() => (this.element.hidden = true), this.delay * 1000);\n };\n\n /**\n * Clear timer\n */\n private clearTimer = (): void => {\n clearTimeout(this.storedTimer);\n };\n\n /**\n * Event to add on element\n * @param event - event\n */\n private timerEvents = (event: MouseEvent | FocusEvent): void => {\n this.clearTimer();\n const isMouseEvent: boolean = event.type === 'mouseenter';\n // Needed to ensure we don't start the timer\n this[isMouseEvent ? 'isHovered' : 'isFocused'] = true;\n\n // Restart timer when loose focus AND mouse leave\n this.element.addEventListener(\n isMouseEvent ? 'mouseleave' : 'focusout',\n eventOut => {\n this[eventOut.type === 'mouseleave' ? 'isHovered' : 'isFocused'] = false;\n // Start timer if needed\n if (!this.isFocused && !this.isHovered) this.setTimer();\n },\n { once: true },\n );\n };\n\n /**\n * Handle close button\n */\n private handleClose = (): void => {\n this.element.hidden = true;\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Check if component props are well configured on init\n */\n componentWillLoad(): void {\n // Get locales\n this.messages = initLocales(this.element).messages;\n // Validate\n this.watchVariant(this.variant);\n this.watchVariantStyle(this.variantStyle);\n this.watchDelay(this.delay);\n this.watchHidden(this.element.hidden);\n // Check if component has actions slot\n this.hasActions = this.element.querySelector('[slot=\"actions\"]') !== null;\n if (!this.hasActions) {\n this.classCollection.add(this.classCloseButton);\n }\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <mg-message class={this.classCollection.join()} role={this.variant === 'info' ? 'status' : 'alert'} variant={this.variant} variantStyle={this.variantStyle}>\n <slot></slot>\n {this.hasActions ? (\n <span slot=\"actions\">\n <slot name=\"actions\"></slot>\n </span>\n ) : (\n <span class=\"mg-c-alert__close-button\">\n <mg-button is-icon variant=\"flat\" label={this.messages.alert.closeButton} onClick={this.handleClose}>\n <mg-icon icon=\"cross\"></mg-icon>\n </mg-button>\n </span>\n )}\n </mg-message>\n );\n }\n}\n"],"version":3}
1
+ {"file":"mg-alert.js","mappings":";;;;;;;;AAEA;;;AAGO,MAAM,QAAQ,GA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AAa,EACZ,IAAI,CAAC,UAAU,IACd,YAAM,IAAI,EAAC,SAAS,IAClB,YAAM,IAAI,EAAC,SAAS,GAAQ,CACvB,KAEP,YAAM,KAAK,EAAC,0BAA0B,IACpC,kCAAmB,OAAO,EAAC,MAAM,EAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,WAAW,EAAE,OAAO,EAAE,IAAI,CAAC,WAAW,IACjG,eAAS,IAAI,EAAC,OAAO,GAAW,CACtB,CACP,CACR,CACU,EACb;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["MgAlert","ClassList","toString"],"sources":["src/components/molecules/mg-alert/mg-alert.conf.ts","../styles/dist/components/mg-alert.css?tag=mg-alert&encapsulation=shadow","src/components/molecules/mg-alert/mg-alert.tsx"],"sourcesContent":["import type { Variant, VariantStyle } from '../../../types';\n\n/**\n * List available variants\n */\nexport const variants = ['info', 'warning', 'success', 'danger'] as const;\n\n/**\n * Variant type\n */\nexport type VariantType = Variant & (typeof variants)[number];\n\n/**\n * List available variant styles\n */\nexport const variantStyles = ['bar-left', 'background'] as const;\n\n/**\n * VariantStyle type\n */\nexport type VariantStyleType = VariantStyle & (typeof variantStyles)[number];\n",".mg-c-alert__close-button{position:absolute;top:0;right:0}.mg-c-alert.mg-c-alert--close-button{--mg-c-card-spacing: 0 var(--mg-b-size-min-height) 0 0}/*# sourceMappingURL=mg-alert.css.map */\n","import { Component, Element, Event, EventEmitter, h, Prop, State, Watch, forceUpdate } from '@stencil/core';\nimport { ClassList, toString } from '@mgdis/stencil-helpers';\nimport { variants, variantStyles, VariantStyleType, VariantType } from './mg-alert.conf';\nimport { initLocales } from '../../../locales';\n\n/**\n * @slot - Alert content\n * @slot actions - Actions content\n */\n@Component({\n tag: 'mg-alert',\n styleUrl: '../../../../node_modules/@mgdis/styles/dist/components/mg-alert.css',\n shadow: true,\n})\nexport class MgAlert {\n /************\n * Internal *\n ************/\n\n // Classes\n private readonly classCloseButton = 'mg-c-alert--close-button';\n\n // Stored timer setted when hide action is run from setTimeOut\n private storedTimer: ReturnType<typeof setTimeout> = null;\n\n // Manage hover\n private isFocused = false;\n private isHovered = false;\n\n // Locales\n private messages;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgAlertElement;\n\n /**\n * Add a delay to hide/close message when it passed\n * Value is defined in seconds and must greater than 2 seconds\n */\n @Prop() delay?: number;\n @Watch('delay')\n watchDelay(newValue: MgAlert['delay']): void {\n if (newValue !== undefined && newValue < 2) {\n throw new Error(`<mg-alert> prop \"delay\" must be greater than 2 seconds. Passed value: ${toString(newValue)}.`);\n }\n }\n\n /**\n * Define variant\n */\n @Prop() variant?: VariantType;\n @Watch('variant')\n watchVariant(newValue: MgAlert['variant']): void {\n if (newValue && !variants.includes(newValue)) {\n throw new Error(`<mg-alert> prop \"variant\" must be one of: ${variants.join(', ')}. Passed value: ${toString(newValue)}.`);\n }\n }\n\n /**\n * Define variant style\n */\n @Prop() variantStyle?: VariantStyleType;\n @Watch('variantStyle')\n watchVariantStyle(newValue: MgAlert['variantStyle']): void {\n if (newValue && !variantStyles.includes(newValue)) {\n throw new Error(`<mg-alert> prop \"variantStyle\" must be one of: ${variantStyles.join(', ')}. Passed value: ${toString(newValue)}.`);\n }\n }\n\n /**\n * Watch hidden prop\n */\n // eslint-disable-next-line @stencil-community/no-unused-watch\n @Watch('hidden')\n watchHidden(newValue: boolean): void {\n if (typeof newValue === 'string' && newValue === '') {\n newValue = true;\n }\n if (newValue) {\n this.componentHide.emit();\n // Remove event Listener\n ['focusin', 'mouseenter'].forEach(event => {\n this.element.removeEventListener(event, this.timerEvents);\n });\n // Clear Timer\n this.clearTimer();\n } else {\n this.componentShow.emit();\n // If delay is set\n if (this.delay > 1) {\n // Start timer\n this.setTimer();\n // Stop timer when get focus or mouse enter\n ['focusin', 'mouseenter'].forEach(event => {\n this.element.addEventListener(event, this.timerEvents);\n });\n }\n }\n forceUpdate(this);\n }\n\n /**\n * Component classes\n */\n @State() classCollection: ClassList = new ClassList(['mg-c-alert']);\n\n /**\n * Define if component is using actions slot\n */\n @State() hasActions = false;\n\n /**\n * Emited event when alert is diplayed\n */\n @Event({ eventName: 'component-show' }) componentShow: EventEmitter<void>;\n\n /**\n * Emited event when alert is hidden\n */\n @Event({ eventName: 'component-hide' }) componentHide: EventEmitter<void>;\n\n /**\n * Emmited event when alert is closed\n */\n @Event({ eventName: 'component-close' }) componentClose: EventEmitter<void>;\n\n /**\n * Set timer\n */\n private setTimer = (): void => {\n this.storedTimer = setTimeout(() => (this.element.hidden = true), this.delay * 1000);\n };\n\n /**\n * Clear timer\n */\n private clearTimer = (): void => {\n clearTimeout(this.storedTimer);\n };\n\n /**\n * Event to add on element\n * @param event - event\n */\n private timerEvents = (event: MouseEvent | FocusEvent): void => {\n this.clearTimer();\n const isMouseEvent: boolean = event.type === 'mouseenter';\n // Needed to ensure we don't start the timer\n this[isMouseEvent ? 'isHovered' : 'isFocused'] = true;\n\n // Restart timer when loose focus AND mouse leave\n this.element.addEventListener(\n isMouseEvent ? 'mouseleave' : 'focusout',\n eventOut => {\n this[eventOut.type === 'mouseleave' ? 'isHovered' : 'isFocused'] = false;\n // Start timer if needed\n if (!this.isFocused && !this.isHovered) this.setTimer();\n },\n { once: true },\n );\n };\n\n /**\n * Handle close button\n */\n private handleClose = (): void => {\n this.element.hidden = true;\n this.componentClose.emit();\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Check if component props are well configured on init\n */\n componentWillLoad(): void {\n // Get locales\n this.messages = initLocales(this.element).messages;\n // Validate\n this.watchVariant(this.variant);\n this.watchVariantStyle(this.variantStyle);\n this.watchDelay(this.delay);\n this.watchHidden(this.element.hidden);\n // Check if component has actions slot\n this.hasActions = this.element.querySelector('[slot=\"actions\"]') !== null;\n if (!this.hasActions) {\n this.classCollection.add(this.classCloseButton);\n }\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <mg-message class={this.classCollection.join()} role={this.variant === 'info' ? 'status' : 'alert'} variant={this.variant} variantStyle={this.variantStyle}>\n <slot></slot>\n {this.hasActions ? (\n <span slot=\"actions\">\n <slot name=\"actions\"></slot>\n </span>\n ) : (\n <span class=\"mg-c-alert__close-button\">\n <mg-button is-icon variant=\"flat\" label={this.messages.alert.closeButton} onClick={this.handleClose}>\n <mg-icon icon=\"cross\"></mg-icon>\n </mg-button>\n </span>\n )}\n </mg-message>\n );\n }\n}\n"],"version":3}
@@ -2,12 +2,16 @@ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/
2
2
  import { X as Xe, Y as Ye, m as me, t as tt } from './index.es.js';
3
3
  import { d as defineCustomElement$1 } from './mg-icon2.js';
4
4
 
5
+ /**
6
+ * List of all possibles sizes
7
+ */
8
+ const sizes = ['medium', 'large'];
5
9
  /**
6
10
  * List of all possibles variants
7
11
  */
8
12
  const variants = ['primary', 'secondary', 'danger', 'danger-alt', 'info', 'flat', 'success', 'link'];
9
13
 
10
- const mgButtonCss = "/*!\n * @prop --mg-c-button-border-radius: Defines the border radius of the button. The default value is `--mg-b-size-radius`.\n * @prop --mg-c-button-border-top-width: Defines the top border width of the button. Unset by default, fallback on `--mg-b-size-border`.\n * @prop --mg-c-button-border-right-width: Defines the right border width of the button. Unset by default, fallback on `--mg-b-size-border`.\n * @prop --mg-c-button-border-bottom-width: Defines the bottom border width of the button. Unset by default, fallback on `--mg-b-size-border`.\n * @prop --mg-c-button-border-left-width: Defines the left border width of the button. Unset by default, fallback on `--mg-b-size-border`.\n * @prop --mg-c-button-border-radius-top-left: Defines the top left border radius of the button. Unset by default, fallback on `--mg-c-button-border-radius`.\n * @prop --mg-c-button-border-radius-top-right: Defines the top right border radius of the button. Unset by default, fallback on `--mg-c-button-border-radius`.\n * @prop --mg-c-button-border-radius-bottom-right: Defines the bottom right border radius of the button. Unset by default, fallback on `--mg-c-button-border-radius`.\n * @prop --mg-c-button-border-radius-bottom-left: Defines the bottom left border radius of the button. Unset by default, fallback on `--mg-c-button-border-radius`.\n * @prop --mg-c-button-font-weight: Defines the font weight of the button. Unset by default, fallback on `normal`.\n * @prop --mg-c-button-icon-border-radius: Defines the border radius of the button in icon mode. The default value is `--mg-b-size-min-height`.\n */:host{display:inline-block;max-width:100%;vertical-align:middle}:host(:hover) .mg-c-button--flat:not(.mg-c-button--disabled){background:color-mix(in srgb, var(--mg-b-color-dark), transparent 90%)}:host([full-width]){display:block}:host([disabled]),:host([aria-disabled=true]){pointer-events:none}.mg-c-button.mg-c-button--primary{/*!\n * @prop --mg-c-button-color-background-primary: Defines the background color for the primary variant button.\n * @prop --mg-c-button-color-border-primary: Defines the border color for the primary variant button.\n * @prop --mg-c-button-color-gradient-primary: Defines the gradient color for the primary variant button.\n * @prop --mg-c-button-color-text-primary: Defines the font color for the primary variant button.\n */border-color:var(--mg-c-button-color-border-primary);background:linear-gradient(to bottom, var(--mg-c-button-color-background-primary), var(--mg-c-button-color-gradient-primary));color:var(--mg-c-button-color-text-primary)}:host(:hover) .mg-c-button.mg-c-button--primary:not(.mg-c-button--disabled){background:var(--mg-c-button-color-background-primary)}.mg-c-button.mg-c-button--secondary{/*!\n * @prop --mg-c-button-color-background-secondary: Defines the background color for the secondary variant button.\n * @prop --mg-c-button-color-border-secondary: Defines the border color for the secondary variant button.\n * @prop --mg-c-button-color-gradient-secondary: Defines the gradient color for the secondary variant button.\n * @prop --mg-c-button-color-text-secondary: Defines the font color for the secondary variant button.\n */border-color:var(--mg-c-button-color-border-secondary);background:linear-gradient(to bottom, var(--mg-c-button-color-background-secondary), var(--mg-c-button-color-gradient-secondary));color:var(--mg-c-button-color-text-secondary)}:host(:hover) .mg-c-button.mg-c-button--secondary:not(.mg-c-button--disabled){background:var(--mg-c-button-color-background-secondary)}.mg-c-button.mg-c-button--danger{/*!\n * @prop --mg-c-button-color-background-danger: Defines the background color for the danger variant button.\n * @prop --mg-c-button-color-border-danger: Defines the border color for the danger variant button.\n * @prop --mg-c-button-color-gradient-danger: Defines the gradient color for the danger variant button.\n * @prop --mg-c-button-color-text-danger: Defines the font color for the danger variant button.\n */border-color:var(--mg-c-button-color-border-danger);background:linear-gradient(to bottom, var(--mg-c-button-color-background-danger), var(--mg-c-button-color-gradient-danger));color:var(--mg-c-button-color-text-danger)}:host(:hover) .mg-c-button.mg-c-button--danger:not(.mg-c-button--disabled){background:var(--mg-c-button-color-background-danger)}.mg-c-button.mg-c-button--info{/*!\n * @prop --mg-c-button-color-background-info: Defines the background color for the info variant button.\n * @prop --mg-c-button-color-border-info: Defines the border color for the info variant button.\n * @prop --mg-c-button-color-gradient-info: Defines the gradient color for the info variant button.\n * @prop --mg-c-button-color-text-info: Defines the font color for the info variant button.\n */border-color:var(--mg-c-button-color-border-info);background:linear-gradient(to bottom, var(--mg-c-button-color-background-info), var(--mg-c-button-color-gradient-info));color:var(--mg-c-button-color-text-info)}:host(:hover) .mg-c-button.mg-c-button--info:not(.mg-c-button--disabled){background:var(--mg-c-button-color-background-info)}.mg-c-button.mg-c-button--success{/*!\n * @prop --mg-c-button-color-background-success: Defines the background color for the success variant button.\n * @prop --mg-c-button-color-border-success: Defines the border color for the success variant button.\n * @prop --mg-c-button-color-gradient-success: Defines the gradient color for the success variant button.\n * @prop --mg-c-button-color-text-success: Defines the font color for the success variant button.\n */border-color:var(--mg-c-button-color-border-success);background:linear-gradient(to bottom, var(--mg-c-button-color-background-success), var(--mg-c-button-color-gradient-success));color:var(--mg-c-button-color-text-success)}:host(:hover) .mg-c-button.mg-c-button--success:not(.mg-c-button--disabled){background:var(--mg-c-button-color-background-success)}.mg-c-button.mg-c-button--warning{/*!\n * @prop --mg-c-button-color-background-warning: Defines the background color for the warning variant button.\n * @prop --mg-c-button-color-border-warning: Defines the border color for the warning variant button.\n * @prop --mg-c-button-color-gradient-warning: Defines the gradient color for the warning variant button.\n * @prop --mg-c-button-color-text-warning: Defines the font color for the warning variant button.\n */border-color:var(--mg-c-button-color-border-warning);background:linear-gradient(to bottom, var(--mg-c-button-color-background-warning), var(--mg-c-button-color-gradient-warning));color:var(--mg-c-button-color-text-warning)}:host(:hover) .mg-c-button.mg-c-button--warning:not(.mg-c-button--disabled){background:var(--mg-c-button-color-background-warning)}.mg-c-button.mg-c-button--danger-alt{/*!\n * @prop --mg-c-button-color-background-danger-alt: Defines the background color for the danger-alt variant button.\n * @prop --mg-c-button-color-border-danger-alt: Defines the border color for the danger-alt variant button.\n * @prop --mg-c-button-color-gradient-danger-alt: Defines the gradient color for the danger-alt variant button.\n * @prop --mg-c-button-color-text-danger-alt: Defines the font color for the danger-alt variant button.\n */border-color:var(--mg-c-button-color-border-danger-alt);background:linear-gradient(to bottom, var(--mg-c-button-color-background-danger-alt), var(--mg-c-button-color-gradient-danger-alt));color:var(--mg-c-button-color-text-danger-alt)}:host(:hover) .mg-c-button.mg-c-button--danger-alt:not(.mg-c-button--disabled){background:var(--mg-c-button-color-background-danger-alt)}.mg-c-button{position:relative;display:inline-flex;min-height:var(--mg-b-size-min-height);box-sizing:border-box;align-items:center;padding:calc((var(--mg-b-size-min-height) - 2*var(--mg-b-size-border) - var(--mg-b-font-size)*var(--mg-b-line-height))/2) var(--mg-b-size-12);border-width:var(--mg-c-button-border-top-width, var(--mg-b-size-border)) var(--mg-c-button-border-right-width, var(--mg-b-size-border)) var(--mg-c-button-border-bottom-width, var(--mg-b-size-border)) var(--mg-c-button-border-left-width, var(--mg-b-size-border));border-style:solid;border-radius:var(--mg-c-button-border-radius-top-left, var(--mg-c-button-border-radius)) var(--mg-c-button-border-radius-top-right, var(--mg-c-button-border-radius)) var(--mg-c-button-border-radius-bottom-right, var(--mg-c-button-border-radius)) var(--mg-c-button-border-radius-bottom-left, var(--mg-c-button-border-radius));background-image:none;column-gap:var(--mg-b-size-8);cursor:pointer;touch-action:manipulation;font-family:inherit;font-size:var(--mg-b-font-size);font-weight:var(--mg-c-button-font-weight, normal);text-align:left;text-decoration:none}.mg-c-button.mg-c-button--disabled{cursor:default;opacity:var(--mg-b-opacity-element-disabled)}.mg-c-button.mg-c-button--icon{width:var(--mg-b-size-min-height);height:var(--mg-b-size-min-height);justify-content:center;padding:0;border-radius:var(--mg-c-button-border-radius-top-left, var(--mg-c-button-icon-border-radius)) var(--mg-c-button-border-radius-top-right, var(--mg-c-button-icon-border-radius)) var(--mg-c-button-border-radius-bottom-right, var(--mg-c-button-icon-border-radius)) var(--mg-c-button-border-radius-bottom-left, var(--mg-c-button-icon-border-radius));font-size:var(--mg-b-font-size);line-height:var(--mg-b-font-size)}.mg-c-button.mg-c-button--flat{border:none;background:none}.mg-c-button slot,.mg-c-button ::slotted(*:not(mg-icon)){font-family:inherit;font-size:var(--mg-b-font-size);font-weight:var(--mg-c-button-font-weight, normal);text-align:left;text-decoration:none;display:flex;align-items:center;column-gap:var(--mg-b-size-8)}.mg-c-button.mg-c-button--link{min-height:unset;padding:unset;border:unset;border-radius:unset;background:unset;text-decoration:underline}.mg-c-button.mg-c-button--link slot{font-weight:600}.mg-c-button.mg-c-button--link:hover{text-decoration:none}.mg-c-button.mg-c-button--full-width{display:flex;justify-content:center}.mg-c-button mg-icon:only-child,.mg-c-button ::slotted(mg-icon){display:inline-flex;flex-shrink:0;margin:auto 0;line-height:1}.mg-c-button.mg-c-button--loading>mg-icon:first-of-type{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}.mg-c-button.mg-c-button--loading .mg-c-button__content{opacity:0}:host(:focus-visible){outline:0}:host(:focus-visible) .mg-c-button{outline-color:-webkit-focus-ring-color;outline-style:auto;outline-width:.2rem}";
14
+ const mgButtonCss = "/*!\n * @prop --mg-c-button-border-radius: Defines the border radius of the button. The default value is `--mg-b-size-radius`.\n * @prop --mg-c-button-border-top-width: Defines the top border width of the button. Unset by default, fallback on `--mg-b-size-border`.\n * @prop --mg-c-button-border-right-width: Defines the right border width of the button. Unset by default, fallback on `--mg-b-size-border`.\n * @prop --mg-c-button-border-bottom-width: Defines the bottom border width of the button. Unset by default, fallback on `--mg-b-size-border`.\n * @prop --mg-c-button-border-left-width: Defines the left border width of the button. Unset by default, fallback on `--mg-b-size-border`.\n * @prop --mg-c-button-border-radius-top-left: Defines the top left border radius of the button. Unset by default, fallback on `--mg-c-button-border-radius`.\n * @prop --mg-c-button-border-radius-top-right: Defines the top right border radius of the button. Unset by default, fallback on `--mg-c-button-border-radius`.\n * @prop --mg-c-button-border-radius-bottom-right: Defines the bottom right border radius of the button. Unset by default, fallback on `--mg-c-button-border-radius`.\n * @prop --mg-c-button-border-radius-bottom-left: Defines the bottom left border radius of the button. Unset by default, fallback on `--mg-c-button-border-radius`.\n * @prop --mg-c-button-font-weight: Defines the font weight of the button. Unset by default, fallback on `normal`.\n * @prop --mg-c-button-icon-border-radius: Defines the border radius of the button in icon mode. The default value is `--mg-b-size-min-height`.\n */:host{display:inline-block;max-width:100%;vertical-align:middle}:host(:hover) .mg-c-button--flat:not(.mg-c-button--disabled){background:color-mix(in srgb, var(--mg-b-color-dark), transparent 90%)}:host([full-width]){display:block}:host([disabled]),:host([aria-disabled=true]){pointer-events:none}.mg-c-button.mg-c-button--primary{/*!\n * @prop --mg-c-button-color-background-primary: Defines the background color for the primary variant button.\n * @prop --mg-c-button-color-border-primary: Defines the border color for the primary variant button.\n * @prop --mg-c-button-color-gradient-primary: Defines the gradient color for the primary variant button.\n * @prop --mg-c-button-color-text-primary: Defines the font color for the primary variant button.\n */border-color:var(--mg-c-button-color-border-primary);background:linear-gradient(to bottom, var(--mg-c-button-color-background-primary), var(--mg-c-button-color-gradient-primary));color:var(--mg-c-button-color-text-primary)}:host(:hover) .mg-c-button.mg-c-button--primary:not(.mg-c-button--disabled){background:var(--mg-c-button-color-background-primary)}.mg-c-button.mg-c-button--secondary{/*!\n * @prop --mg-c-button-color-background-secondary: Defines the background color for the secondary variant button.\n * @prop --mg-c-button-color-border-secondary: Defines the border color for the secondary variant button.\n * @prop --mg-c-button-color-gradient-secondary: Defines the gradient color for the secondary variant button.\n * @prop --mg-c-button-color-text-secondary: Defines the font color for the secondary variant button.\n */border-color:var(--mg-c-button-color-border-secondary);background:linear-gradient(to bottom, var(--mg-c-button-color-background-secondary), var(--mg-c-button-color-gradient-secondary));color:var(--mg-c-button-color-text-secondary)}:host(:hover) .mg-c-button.mg-c-button--secondary:not(.mg-c-button--disabled){background:var(--mg-c-button-color-background-secondary)}.mg-c-button.mg-c-button--danger{/*!\n * @prop --mg-c-button-color-background-danger: Defines the background color for the danger variant button.\n * @prop --mg-c-button-color-border-danger: Defines the border color for the danger variant button.\n * @prop --mg-c-button-color-gradient-danger: Defines the gradient color for the danger variant button.\n * @prop --mg-c-button-color-text-danger: Defines the font color for the danger variant button.\n */border-color:var(--mg-c-button-color-border-danger);background:linear-gradient(to bottom, var(--mg-c-button-color-background-danger), var(--mg-c-button-color-gradient-danger));color:var(--mg-c-button-color-text-danger)}:host(:hover) .mg-c-button.mg-c-button--danger:not(.mg-c-button--disabled){background:var(--mg-c-button-color-background-danger)}.mg-c-button.mg-c-button--info{/*!\n * @prop --mg-c-button-color-background-info: Defines the background color for the info variant button.\n * @prop --mg-c-button-color-border-info: Defines the border color for the info variant button.\n * @prop --mg-c-button-color-gradient-info: Defines the gradient color for the info variant button.\n * @prop --mg-c-button-color-text-info: Defines the font color for the info variant button.\n */border-color:var(--mg-c-button-color-border-info);background:linear-gradient(to bottom, var(--mg-c-button-color-background-info), var(--mg-c-button-color-gradient-info));color:var(--mg-c-button-color-text-info)}:host(:hover) .mg-c-button.mg-c-button--info:not(.mg-c-button--disabled){background:var(--mg-c-button-color-background-info)}.mg-c-button.mg-c-button--success{/*!\n * @prop --mg-c-button-color-background-success: Defines the background color for the success variant button.\n * @prop --mg-c-button-color-border-success: Defines the border color for the success variant button.\n * @prop --mg-c-button-color-gradient-success: Defines the gradient color for the success variant button.\n * @prop --mg-c-button-color-text-success: Defines the font color for the success variant button.\n */border-color:var(--mg-c-button-color-border-success);background:linear-gradient(to bottom, var(--mg-c-button-color-background-success), var(--mg-c-button-color-gradient-success));color:var(--mg-c-button-color-text-success)}:host(:hover) .mg-c-button.mg-c-button--success:not(.mg-c-button--disabled){background:var(--mg-c-button-color-background-success)}.mg-c-button.mg-c-button--warning{/*!\n * @prop --mg-c-button-color-background-warning: Defines the background color for the warning variant button.\n * @prop --mg-c-button-color-border-warning: Defines the border color for the warning variant button.\n * @prop --mg-c-button-color-gradient-warning: Defines the gradient color for the warning variant button.\n * @prop --mg-c-button-color-text-warning: Defines the font color for the warning variant button.\n */border-color:var(--mg-c-button-color-border-warning);background:linear-gradient(to bottom, var(--mg-c-button-color-background-warning), var(--mg-c-button-color-gradient-warning));color:var(--mg-c-button-color-text-warning)}:host(:hover) .mg-c-button.mg-c-button--warning:not(.mg-c-button--disabled){background:var(--mg-c-button-color-background-warning)}.mg-c-button.mg-c-button--danger-alt{/*!\n * @prop --mg-c-button-color-background-danger-alt: Defines the background color for the danger-alt variant button.\n * @prop --mg-c-button-color-border-danger-alt: Defines the border color for the danger-alt variant button.\n * @prop --mg-c-button-color-gradient-danger-alt: Defines the gradient color for the danger-alt variant button.\n * @prop --mg-c-button-color-text-danger-alt: Defines the font color for the danger-alt variant button.\n */border-color:var(--mg-c-button-color-border-danger-alt);background:linear-gradient(to bottom, var(--mg-c-button-color-background-danger-alt), var(--mg-c-button-color-gradient-danger-alt));color:var(--mg-c-button-color-text-danger-alt)}:host(:hover) .mg-c-button.mg-c-button--danger-alt:not(.mg-c-button--disabled){background:var(--mg-c-button-color-background-danger-alt)}.mg-c-button{position:relative;display:inline-flex;min-height:var(--mg-b-size-min-height);box-sizing:border-box;align-items:center;padding:calc((var(--mg-b-size-min-height) - 2*var(--mg-b-size-border) - var(--mg-b-font-size)*var(--mg-b-line-height))/2) var(--mg-b-size-12);border-width:var(--mg-c-button-border-top-width, var(--mg-b-size-border)) var(--mg-c-button-border-right-width, var(--mg-b-size-border)) var(--mg-c-button-border-bottom-width, var(--mg-b-size-border)) var(--mg-c-button-border-left-width, var(--mg-b-size-border));border-style:solid;border-radius:var(--mg-c-button-border-radius-top-left, var(--mg-c-button-border-radius)) var(--mg-c-button-border-radius-top-right, var(--mg-c-button-border-radius)) var(--mg-c-button-border-radius-bottom-right, var(--mg-c-button-border-radius)) var(--mg-c-button-border-radius-bottom-left, var(--mg-c-button-border-radius));background-image:none;column-gap:var(--mg-b-size-8);cursor:pointer;touch-action:manipulation;font-family:inherit;font-size:var(--mg-b-font-size);font-weight:var(--mg-c-button-font-weight, normal);text-align:left;text-decoration:none}.mg-c-button slot,.mg-c-button ::slotted(*:not(mg-icon)){font-family:inherit;font-size:var(--mg-b-font-size);font-weight:var(--mg-c-button-font-weight, normal);text-align:left;text-decoration:none;display:flex;align-items:center;column-gap:var(--mg-b-size-8)}.mg-c-button mg-icon:only-child,.mg-c-button ::slotted(mg-icon){display:inline-flex;flex-shrink:0;margin:auto 0;line-height:1}.mg-c-button.mg-c-button--disabled{cursor:default;opacity:var(--mg-b-opacity-element-disabled)}.mg-c-button.mg-c-button--flat{border:none;background:none}.mg-c-button.mg-c-button--link{min-height:unset;padding:unset;border:unset;border-radius:unset;background:unset;text-decoration:underline}.mg-c-button.mg-c-button--link slot{font-weight:600}.mg-c-button.mg-c-button--link:hover{text-decoration:none}.mg-c-button.mg-c-button--large{padding:calc(var(--mg-b-size-12) - var(--mg-b-size-border)) calc(var(--mg-b-size-24) - var(--mg-b-size-border))}.mg-c-button.mg-c-button--large:not(.mg-c-button--icon){line-height:var(--mg-b-size-24)}.mg-c-button.mg-c-button--large:not(.mg-c-button--icon) slot,.mg-c-button.mg-c-button--large:not(.mg-c-button--icon) ::slotted(*){font-size:var(--mg-b-size-16)}.mg-c-button.mg-c-button--icon{width:var(--mg-b-size-min-height);height:var(--mg-b-size-min-height);justify-content:center;padding:0;border-radius:var(--mg-c-button-border-radius-top-left, var(--mg-c-button-icon-border-radius)) var(--mg-c-button-border-radius-top-right, var(--mg-c-button-icon-border-radius)) var(--mg-c-button-border-radius-bottom-right, var(--mg-c-button-icon-border-radius)) var(--mg-c-button-border-radius-bottom-left, var(--mg-c-button-icon-border-radius));font-size:var(--mg-b-font-size);line-height:var(--mg-b-font-size)}.mg-c-button.mg-c-button--icon.mg-c-button--large{width:unset;height:unset;padding:calc(var(--mg-b-size-12) - var(--mg-b-size-border))}.mg-c-button.mg-c-button--icon.mg-c-button--large ::slotted(*){min-width:var(--mg-b-size-24);min-height:var(--mg-b-size-24);align-items:center;justify-content:center}.mg-c-button.mg-c-button--full-width{display:flex;justify-content:center}.mg-c-button.mg-c-button--loading>mg-icon:first-of-type{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}.mg-c-button.mg-c-button--loading .mg-c-button__content{opacity:0}:host(:focus-visible){outline:0}:host(:focus-visible) .mg-c-button{outline-color:-webkit-focus-ring-color;outline-style:auto;outline-width:.2rem}";
11
15
  const MgButtonStyle0 = mgButtonCss;
12
16
 
13
17
  const MgButton = /*@__PURE__*/ proxyCustomElement(class MgButton extends HTMLElement {
@@ -59,9 +63,22 @@ const MgButton = /*@__PURE__*/ proxyCustomElement(class MgButton extends HTMLEle
59
63
  this.element.dispatchEvent(new MouseEvent('click', { bubbles: true }));
60
64
  }
61
65
  };
66
+ /**
67
+ * Set child `<mg-icon>` element `size` prop to follow the current `size` prop
68
+ */
69
+ this.setIconSize = () => {
70
+ var _a, _b;
71
+ if (this.size === 'medium') {
72
+ (_a = this.element.querySelector('mg-icon')) === null || _a === void 0 ? void 0 : _a.removeAttribute('size');
73
+ }
74
+ else if (this.isIcon) {
75
+ (_b = this.element.querySelector('mg-icon')) === null || _b === void 0 ? void 0 : _b.setAttribute('size', this.size);
76
+ }
77
+ };
62
78
  this.variant = variants[0];
63
79
  this.label = undefined;
64
80
  this.type = undefined;
81
+ this.size = sizes[0];
65
82
  this.fullWidth = false;
66
83
  this.form = undefined;
67
84
  this.disabled = undefined;
@@ -87,6 +104,19 @@ const MgButton = /*@__PURE__*/ proxyCustomElement(class MgButton extends HTMLEle
87
104
  this.classCollection.add(`mg-c-button--${newValue}`);
88
105
  }
89
106
  }
107
+ validateSize(newValue, oldValue) {
108
+ // validate new value
109
+ if (!sizes.includes(newValue)) {
110
+ throw new Error(`<mg-button> prop "size" must be one of: ${sizes.join(', ')}. Passed value: ${Ye(newValue)}.`);
111
+ }
112
+ else {
113
+ if (oldValue !== undefined) {
114
+ this.classCollection.delete(`mg-c-button--${oldValue}`);
115
+ }
116
+ this.classCollection.add(`mg-c-button--${newValue}`);
117
+ this.setIconSize();
118
+ }
119
+ }
90
120
  validateFullWidth(newValue) {
91
121
  if (newValue && this.isIcon) {
92
122
  throw new Error('<mg-button> prop "fullWidth" cannot be used with prop "isIcon".');
@@ -116,6 +146,9 @@ const MgButton = /*@__PURE__*/ proxyCustomElement(class MgButton extends HTMLEle
116
146
  // emit value update
117
147
  this.disabledChange.emit(isDisabled);
118
148
  }
149
+ watchIsIcon() {
150
+ this.setIconSize();
151
+ }
119
152
  loadingHandler(newValue) {
120
153
  // we add loading style if it newvalue is true else we remove it
121
154
  if (newValue) {
@@ -131,6 +164,8 @@ const MgButton = /*@__PURE__*/ proxyCustomElement(class MgButton extends HTMLEle
131
164
  componentWillLoad() {
132
165
  this.validateVariant(this.variant);
133
166
  this.validateFullWidth(this.fullWidth);
167
+ this.validateSize(this.size);
168
+ this.watchIsIcon();
134
169
  if (this.isIcon) {
135
170
  this.classCollection.add(`mg-c-button--icon`);
136
171
  if (!me(this.label)) {
@@ -162,13 +197,15 @@ const MgButton = /*@__PURE__*/ proxyCustomElement(class MgButton extends HTMLEle
162
197
  */
163
198
  render() {
164
199
  var _a;
165
- return (h(Host, { key: '0e3996123ef570a493d645b7a24d4271f13ae7c4', role: "button", tabIndex: 0, type: this.type, form: this.form, "full-width": this.fullWidth, "aria-label": this.label, "aria-disabled": (_a = this.disabled) === null || _a === void 0 ? void 0 : _a.toString(), onClick: this.handleClick, onKeyup: this.handleKeyup, onKeydown: this.handleKeydown }, h("div", { key: 'bef43bda72867ea981814bdeda110d2dec4306f9', class: this.classCollection.join() }, this.loading && h("mg-icon", { key: 'e5754f3ca96f24da369e0961ced9f119b22b8878', icon: "loader", spin: true }), h("div", { key: '20afb713a15e3a003dc4fd0a5470aa764246858e', class: "mg-c-button__content" }, h("slot", { key: 'd0468692516ebc044a14dedbba96d74791552bd1' })))));
200
+ return (h(Host, { key: 'a56efb7c3e49a4aadf6751b10bacb39f20c260df', role: "button", tabIndex: 0, type: this.type, form: this.form, "full-width": this.fullWidth, "aria-label": this.label, "aria-disabled": (_a = this.disabled) === null || _a === void 0 ? void 0 : _a.toString(), onClick: this.handleClick, onKeyup: this.handleKeyup, onKeydown: this.handleKeydown }, h("div", { key: '2d47d068d188161b603b26117256d0e828393348', class: this.classCollection.join() }, this.loading && h("mg-icon", { key: 'ba84820c70834f1e345af506265222340659f8ec', icon: "loader", spin: true }), h("div", { key: 'db6c3437d5de7f828cca7df9d83670de9d3a8ed6', class: "mg-c-button__content" }, h("slot", { key: 'b00f76d92e1e2f9e4dd834bf41419c68c2635d1a' })))));
166
201
  }
167
202
  get element() { return this; }
168
203
  static get watchers() { return {
169
204
  "variant": ["validateVariant"],
205
+ "size": ["validateSize"],
170
206
  "fullWidth": ["validateFullWidth"],
171
207
  "disabled": ["disabledHandler"],
208
+ "isIcon": ["watchIsIcon"],
172
209
  "loading": ["loadingHandler"]
173
210
  }; }
174
211
  static get style() { return MgButtonStyle0; }
@@ -176,6 +213,7 @@ const MgButton = /*@__PURE__*/ proxyCustomElement(class MgButton extends HTMLEle
176
213
  "variant": [1025],
177
214
  "label": [1],
178
215
  "type": [1],
216
+ "size": [1],
179
217
  "fullWidth": [4, "full-width"],
180
218
  "form": [1],
181
219
  "disabled": [1028],
@@ -185,8 +223,10 @@ const MgButton = /*@__PURE__*/ proxyCustomElement(class MgButton extends HTMLEle
185
223
  "classCollection": [32]
186
224
  }, undefined, {
187
225
  "variant": ["validateVariant"],
226
+ "size": ["validateSize"],
188
227
  "fullWidth": ["validateFullWidth"],
189
228
  "disabled": ["disabledHandler"],
229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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["ClassList","toString","isValidString","nextTick"],"sources":["src/components/atoms/mg-button/mg-button.conf.ts","../styles/dist/components/mg-button.css?tag=mg-button&encapsulation=shadow","src/components/atoms/mg-button/mg-button.tsx"],"sourcesContent":["import type { Variant } from '../../../types';\n\n/**\n * List of all possibles variants\n */\nexport const variants = ['primary', 'secondary', 'danger', 'danger-alt', 'info', 'flat', 'success', 'link'] as const;\n\n/**\n * VariantType type from button variants\n */\nexport type VariantType = Variant & (typeof variants)[number];\n\n/**\n * List of all possibles button types\n */\nexport const buttonTypes = ['button', 'submit', 'reset'] as const;\n\n/**\n * ButtonType type from buttonTypes\n */\nexport type ButtonType = (typeof buttonTypes)[number];\n","/*!\n * @prop --mg-c-button-border-radius: Defines the border radius of the button. The default value is `--mg-b-size-radius`.\n * @prop --mg-c-button-border-top-width: Defines the top border width of the button. Unset by default, fallback on `--mg-b-size-border`.\n * @prop --mg-c-button-border-right-width: Defines the right border width of the button. Unset by default, fallback on `--mg-b-size-border`.\n * @prop --mg-c-button-border-bottom-width: Defines the bottom border width of the button. Unset by default, fallback on `--mg-b-size-border`.\n * @prop --mg-c-button-border-left-width: Defines the left border width of the button. Unset by default, fallback on `--mg-b-size-border`.\n * @prop --mg-c-button-border-radius-top-left: Defines the top left border radius of the button. Unset by default, fallback on `--mg-c-button-border-radius`.\n * @prop --mg-c-button-border-radius-top-right: Defines the top right border radius of the button. Unset by default, fallback on `--mg-c-button-border-radius`.\n * @prop --mg-c-button-border-radius-bottom-right: Defines the bottom right border radius of the button. Unset by default, fallback on `--mg-c-button-border-radius`.\n * @prop --mg-c-button-border-radius-bottom-left: Defines the bottom left border radius of the button. Unset by default, fallback on `--mg-c-button-border-radius`.\n * @prop --mg-c-button-font-weight: Defines the font weight of the button. Unset by default, fallback on `normal`.\n * @prop --mg-c-button-icon-border-radius: Defines the border radius of the button in icon mode. The default value is `--mg-b-size-min-height`.\n */:host{display:inline-block;max-width:100%;vertical-align:middle}:host(:hover) .mg-c-button--flat:not(.mg-c-button--disabled){background:color-mix(in srgb, var(--mg-b-color-dark), transparent 90%)}:host([full-width]){display:block}:host([disabled]),:host([aria-disabled=true]){pointer-events:none}.mg-c-button.mg-c-button--primary{/*!\n * @prop --mg-c-button-color-background-primary: Defines the background color for the primary variant button.\n * @prop --mg-c-button-color-border-primary: Defines the border color for the primary variant button.\n * @prop --mg-c-button-color-gradient-primary: Defines the gradient color for the primary variant button.\n * @prop --mg-c-button-color-text-primary: Defines the font color for the primary variant button.\n */border-color:var(--mg-c-button-color-border-primary);background:linear-gradient(to bottom, var(--mg-c-button-color-background-primary), var(--mg-c-button-color-gradient-primary));color:var(--mg-c-button-color-text-primary)}:host(:hover) .mg-c-button.mg-c-button--primary:not(.mg-c-button--disabled){background:var(--mg-c-button-color-background-primary)}.mg-c-button.mg-c-button--secondary{/*!\n * @prop --mg-c-button-color-background-secondary: Defines the background color for the secondary variant button.\n * @prop --mg-c-button-color-border-secondary: Defines the border color for the secondary variant button.\n * @prop --mg-c-button-color-gradient-secondary: Defines the gradient color for the secondary variant button.\n * @prop --mg-c-button-color-text-secondary: Defines the font color for the secondary variant button.\n */border-color:var(--mg-c-button-color-border-secondary);background:linear-gradient(to bottom, var(--mg-c-button-color-background-secondary), var(--mg-c-button-color-gradient-secondary));color:var(--mg-c-button-color-text-secondary)}:host(:hover) .mg-c-button.mg-c-button--secondary:not(.mg-c-button--disabled){background:var(--mg-c-button-color-background-secondary)}.mg-c-button.mg-c-button--danger{/*!\n * @prop --mg-c-button-color-background-danger: Defines the background color for the danger variant button.\n * @prop --mg-c-button-color-border-danger: Defines the border color for the danger variant button.\n * @prop --mg-c-button-color-gradient-danger: Defines the gradient color for the danger variant button.\n * @prop --mg-c-button-color-text-danger: Defines the font color for the danger variant button.\n */border-color:var(--mg-c-button-color-border-danger);background:linear-gradient(to bottom, var(--mg-c-button-color-background-danger), var(--mg-c-button-color-gradient-danger));color:var(--mg-c-button-color-text-danger)}:host(:hover) .mg-c-button.mg-c-button--danger:not(.mg-c-button--disabled){background:var(--mg-c-button-color-background-danger)}.mg-c-button.mg-c-button--info{/*!\n * @prop --mg-c-button-color-background-info: Defines the background color for the info variant button.\n * @prop --mg-c-button-color-border-info: Defines the border color for the info variant button.\n * @prop --mg-c-button-color-gradient-info: Defines the gradient color for the info variant button.\n * @prop --mg-c-button-color-text-info: Defines the font color for the info variant button.\n */border-color:var(--mg-c-button-color-border-info);background:linear-gradient(to bottom, var(--mg-c-button-color-background-info), var(--mg-c-button-color-gradient-info));color:var(--mg-c-button-color-text-info)}:host(:hover) .mg-c-button.mg-c-button--info:not(.mg-c-button--disabled){background:var(--mg-c-button-color-background-info)}.mg-c-button.mg-c-button--success{/*!\n * @prop --mg-c-button-color-background-success: Defines the background color for the success variant button.\n * @prop --mg-c-button-color-border-success: Defines the border color for the success variant button.\n * @prop --mg-c-button-color-gradient-success: Defines the gradient color for the success variant button.\n * @prop --mg-c-button-color-text-success: Defines the font color for the success variant button.\n */border-color:var(--mg-c-button-color-border-success);background:linear-gradient(to bottom, var(--mg-c-button-color-background-success), var(--mg-c-button-color-gradient-success));color:var(--mg-c-button-color-text-success)}:host(:hover) .mg-c-button.mg-c-button--success:not(.mg-c-button--disabled){background:var(--mg-c-button-color-background-success)}.mg-c-button.mg-c-button--warning{/*!\n * @prop --mg-c-button-color-background-warning: Defines the background color for the warning variant button.\n * @prop --mg-c-button-color-border-warning: Defines the border color for the warning variant button.\n * @prop --mg-c-button-color-gradient-warning: Defines the gradient color for the warning variant button.\n * @prop --mg-c-button-color-text-warning: Defines the font color for the warning variant button.\n */border-color:var(--mg-c-button-color-border-warning);background:linear-gradient(to bottom, var(--mg-c-button-color-background-warning), var(--mg-c-button-color-gradient-warning));color:var(--mg-c-button-color-text-warning)}:host(:hover) .mg-c-button.mg-c-button--warning:not(.mg-c-button--disabled){background:var(--mg-c-button-color-background-warning)}.mg-c-button.mg-c-button--danger-alt{/*!\n * @prop --mg-c-button-color-background-danger-alt: Defines the background color for the danger-alt variant button.\n * @prop --mg-c-button-color-border-danger-alt: Defines the border color for the danger-alt variant button.\n * @prop --mg-c-button-color-gradient-danger-alt: Defines the gradient color for the danger-alt variant button.\n * @prop --mg-c-button-color-text-danger-alt: Defines the font color for the danger-alt variant button.\n */border-color:var(--mg-c-button-color-border-danger-alt);background:linear-gradient(to bottom, var(--mg-c-button-color-background-danger-alt), var(--mg-c-button-color-gradient-danger-alt));color:var(--mg-c-button-color-text-danger-alt)}:host(:hover) .mg-c-button.mg-c-button--danger-alt:not(.mg-c-button--disabled){background:var(--mg-c-button-color-background-danger-alt)}.mg-c-button{position:relative;display:inline-flex;min-height:var(--mg-b-size-min-height);box-sizing:border-box;align-items:center;padding:calc((var(--mg-b-size-min-height) - 2*var(--mg-b-size-border) - var(--mg-b-font-size)*var(--mg-b-line-height))/2) var(--mg-b-size-12);border-width:var(--mg-c-button-border-top-width, var(--mg-b-size-border)) var(--mg-c-button-border-right-width, var(--mg-b-size-border)) var(--mg-c-button-border-bottom-width, var(--mg-b-size-border)) var(--mg-c-button-border-left-width, var(--mg-b-size-border));border-style:solid;border-radius:var(--mg-c-button-border-radius-top-left, var(--mg-c-button-border-radius)) var(--mg-c-button-border-radius-top-right, var(--mg-c-button-border-radius)) var(--mg-c-button-border-radius-bottom-right, var(--mg-c-button-border-radius)) var(--mg-c-button-border-radius-bottom-left, var(--mg-c-button-border-radius));background-image:none;column-gap:var(--mg-b-size-8);cursor:pointer;touch-action:manipulation;font-family:inherit;font-size:var(--mg-b-font-size);font-weight:var(--mg-c-button-font-weight, normal);text-align:left;text-decoration:none}.mg-c-button.mg-c-button--disabled{cursor:default;opacity:var(--mg-b-opacity-element-disabled)}.mg-c-button.mg-c-button--icon{width:var(--mg-b-size-min-height);height:var(--mg-b-size-min-height);justify-content:center;padding:0;border-radius:var(--mg-c-button-border-radius-top-left, var(--mg-c-button-icon-border-radius)) var(--mg-c-button-border-radius-top-right, var(--mg-c-button-icon-border-radius)) var(--mg-c-button-border-radius-bottom-right, var(--mg-c-button-icon-border-radius)) var(--mg-c-button-border-radius-bottom-left, var(--mg-c-button-icon-border-radius));font-size:var(--mg-b-font-size);line-height:var(--mg-b-font-size)}.mg-c-button.mg-c-button--flat{border:none;background:none}.mg-c-button slot,.mg-c-button ::slotted(*:not(mg-icon)){font-family:inherit;font-size:var(--mg-b-font-size);font-weight:var(--mg-c-button-font-weight, normal);text-align:left;text-decoration:none;display:flex;align-items:center;column-gap:var(--mg-b-size-8)}.mg-c-button.mg-c-button--link{min-height:unset;padding:unset;border:unset;border-radius:unset;background:unset;text-decoration:underline}.mg-c-button.mg-c-button--link slot{font-weight:600}.mg-c-button.mg-c-button--link:hover{text-decoration:none}.mg-c-button.mg-c-button--full-width{display:flex;justify-content:center}.mg-c-button mg-icon:only-child,.mg-c-button ::slotted(mg-icon){display:inline-flex;flex-shrink:0;margin:auto 0;line-height:1}.mg-c-button.mg-c-button--loading>mg-icon:first-of-type{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}.mg-c-button.mg-c-button--loading .mg-c-button__content{opacity:0}:host(:focus-visible){outline:0}:host(:focus-visible) .mg-c-button{outline-color:-webkit-focus-ring-color;outline-style:auto;outline-width:.2rem}/*# sourceMappingURL=mg-button.css.map */\n","import { Component, Element, h, Prop, State, Watch, Host, EventEmitter, Event } from '@stencil/core';\nimport { variants, VariantType, ButtonType } from './mg-button.conf';\nimport { ClassList, isValidString, nextTick, toString } from '@mgdis/stencil-helpers';\n\n/**\n * @slot - Button content\n */\n@Component({\n tag: 'mg-button',\n styleUrl: '../../../../node_modules/@mgdis/styles/dist/components/mg-button.css',\n shadow: true,\n})\nexport class MgButton {\n /************\n * Internal *\n ************/\n\n private onClickElementFn = null;\n private readonly classDisabled = 'mg-c-button--disabled';\n private readonly classLoading = 'mg-c-button--loading';\n private readonly classFullWidth = 'mg-c-button--full-width';\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgButtonElement;\n\n /**\n * Define button variant\n */\n @Prop({ mutable: true }) variant: VariantType = variants[0]; // Primary\n @Watch('variant')\n validateVariant(newValue: VariantType, oldValue?: VariantType): void {\n // validate new value\n if (!variants.includes(newValue)) {\n if ((newValue as string) === '') {\n // Reactive framework like VUE render with `\"\"` when prop is update to undefined\n this.variant = variants[0];\n return;\n }\n throw new Error(`<mg-button> prop \"variant\" must be one of: ${variants.join(', ')}. Passed value: ${toString(newValue)}.`);\n } else {\n if (oldValue !== undefined) {\n this.classCollection.delete(`mg-c-button--${oldValue}`);\n }\n this.classCollection.add(`mg-c-button--${newValue}`);\n }\n }\n\n /**\n * aria-label\n * In case button text is not explicit enough\n */\n @Prop() label?: string;\n\n /**\n * Define button type\n */\n @Prop() type?: ButtonType;\n\n /**\n * Set button to full-width\n */\n @Prop() fullWidth = false;\n @Watch('fullWidth')\n validateFullWidth(newValue: MgButton['fullWidth']): void {\n if (newValue && this.isIcon) {\n throw new Error('<mg-button> prop \"fullWidth\" cannot be used with prop \"isIcon\".');\n } else if (newValue) {\n this.classCollection.add(this.classFullWidth);\n } else {\n this.classCollection.delete(this.classFullWidth);\n }\n }\n\n /**\n * Define form id to attach button with.\n * If this attribute is not set, the `<button>` is associated with its ancestor `<form>` element.\n */\n @Prop() form?: string;\n\n /**\n * Disable button\n */\n @Prop({ mutable: true }) disabled?: boolean;\n @Watch('disabled')\n disabledHandler(isDisabled: MgButton['disabled']): void {\n // Remove loading when enable\n // Will be set back onclick\n if (!isDisabled && this.disableOnClick) {\n this.loading = false;\n }\n // Manage if onclick\n this.element.onclick = isDisabled ? undefined : this.onClickElementFn;\n\n // apply style\n if (isDisabled) {\n this.classCollection.add(this.classDisabled);\n } else {\n this.classCollection.delete(this.classDisabled);\n }\n\n // emit value update\n this.disabledChange.emit(isDisabled);\n }\n /**\n * Define if button is round.\n * Used for icon button.\n */\n @Prop() isIcon = false;\n\n /**\n * Option to set input disable on click, in order to prevent multi-click.\n * Parent component have to remove the attribute 'disabled' when the process ends.\n */\n @Prop() disableOnClick = false;\n\n /**\n * Define if button is loading, default to false.\n * Trigger when button is clicked or key-up ['enter', 'space], then value change to true.\n * It's required to reset to false when action/promise in parent is done to stop the loading state\n */\n @State() loading = false;\n @Watch('loading')\n loadingHandler(newValue: MgButton['loading']): void {\n // we add loading style if it newvalue is true else we remove it\n if (newValue) {\n this.classCollection.add(this.classLoading);\n } else {\n this.classCollection.delete(this.classLoading);\n }\n }\n\n /**\n * Component classes\n */\n @State() classCollection: ClassList = new ClassList(['mg-c-button']);\n\n /**\n * Emmited event when disabled change\n */\n @Event({ eventName: 'disabled-change' }) disabledChange: EventEmitter<HTMLMgButtonElement['disabled']>;\n\n /**\n * Trigger actions onClick event\n * @param event - click event\n */\n private handleClick = (event: MouseEvent): void => {\n if (this.disabled) event.stopPropagation();\n // Used to prevent multi-click.\n else if (this.disableOnClick) {\n this.loading = true;\n this.disabled = true;\n }\n };\n\n /**\n * Handle onKeydown event\n * @param event - keyboard event\n */\n private handleKeydown = (event: KeyboardEvent): void => {\n if (!this.disabled && event.key === ' ') {\n event.preventDefault();\n } else if (!this.disabled && ['Enter', 'NumpadEnter', 'Space'].includes(event.key)) {\n event.preventDefault();\n this.element.dispatchEvent(new MouseEvent('click', { bubbles: true }));\n }\n };\n\n /**\n * Handle onKeyup event\n * @param event - keyboard event\n */\n private handleKeyup = (event: KeyboardEvent): void => {\n if (!this.disabled && event.key === ' ') {\n event.preventDefault();\n this.element.dispatchEvent(new MouseEvent('click', { bubbles: true }));\n }\n };\n\n /**\n * Check if props are well configured on init\n */\n componentWillLoad(): void {\n this.validateVariant(this.variant);\n this.validateFullWidth(this.fullWidth);\n if (this.isIcon) {\n this.classCollection.add(`mg-c-button--icon`);\n if (!isValidString(this.label)) {\n throw new Error(`<mg-button> prop \"label\" is mandatory when prop \"isIcon\" is set to true.`);\n }\n }\n // Store the onclick fn\n this.onClickElementFn = this.element.onclick;\n this.disabledHandler(this.disabled);\n }\n\n /**\n * Add listners\n */\n componentDidLoad(): void {\n nextTick(() => {\n const closestForm = this.element.closest('form') || this.element.closest('mg-form')?.shadowRoot.querySelector('form');\n // submit buttons should trigger form submition;\n if (closestForm && ['submit', undefined].includes(this.type)) {\n this.element.addEventListener('click', () => {\n closestForm.dispatchEvent(new SubmitEvent('submit', { bubbles: true, cancelable: true }));\n });\n }\n });\n }\n\n /**\n * Render component\n * @returns html element\n */\n render(): HTMLElement {\n return (\n <Host\n role=\"button\"\n tabIndex={0}\n type={this.type}\n form={this.form}\n full-width={this.fullWidth}\n aria-label={this.label}\n aria-disabled={this.disabled?.toString()}\n onClick={this.handleClick}\n onKeyup={this.handleKeyup}\n onKeydown={this.handleKeydown}\n >\n <div class={this.classCollection.join()}>\n {this.loading && <mg-icon icon=\"loader\" spin></mg-icon>}\n <div class=\"mg-c-button__content\">\n <slot></slot>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"mg-button2.js","mappings":";;;;AAEA;;;AAGO,MAAM,KAAK,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAU,CAAC;AAOlD;;;AAGO,MAAM,QAAQ,GAAG,CAAC,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,CAAU;;ACfpH,MAAM,WAAW,GAAG,26VAA26V,CAAC;AACh8V,uBAAe,WAAW;;MCWb,QAAQ;;;;;;;;;QAKX,qBAAgB,GAAG,IAAI,CAAC;QACf,kBAAa,GAAG,uBAAuB,CAAC;QACxC,iBAAY,GAAG,sBAAsB,CAAC;QACtC,mBAAc,GAAG,yBAAyB,CAAC;;;;;QAyJpD,gBAAW,GAAG,CAAC,KAAiB;YACtC,IAAI,IAAI,CAAC,QAAQ;gBAAE,KAAK,CAAC,eAAe,EAAE,CAAC;;iBAEtC,IAAI,IAAI,CAAC,cAAc,EAAE;gBAC5B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;gBACpB,IAAI,CAAC,Q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O,EAAE,IAAI,CAAC,WAAW,EACzB,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,SAAS,EAAE,IAAI,CAAC,aAAa,IAE7B,4DAAK,KAAK,EAAE,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,IACpC,IAAI,CAAC,OAAO,IAAI,gEAAS,IAAI,EAAC,QAAQ,EAAC,IAAI,SAAW,EACvD,4DAAK,KAAK,EAAC,sBAAsB,IAC/B,8DAAa,CACT,CACF,CACD,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["ClassList","toString","isValidString","nextTick"],"sources":["src/components/atoms/mg-button/mg-button.conf.ts","../styles/dist/components/mg-button.css?tag=mg-button&encapsulation=shadow","src/components/atoms/mg-button/mg-button.tsx"],"sourcesContent":["import type { Variant, Size } from '../../../types';\n\n/**\n * List of all possibles sizes\n */\nexport const sizes = ['medium', 'large'] as const;\n\n/**\n * SizeType type from button sizes\n */\nexport type SizeType = Size & (typeof sizes)[number];\n\n/**\n * List of all possibles variants\n */\nexport const variants = ['primary', 'secondary', 'danger', 'danger-alt', 'info', 'flat', 'success', 'link'] as const;\n\n/**\n * VariantType type from button variants\n */\nexport type VariantType = Variant & (typeof variants)[number];\n\n/**\n * List of all possibles button types\n */\nexport const buttonTypes = ['button', 'submit', 'reset'] as const;\n\n/**\n * ButtonType type from buttonTypes\n */\nexport type ButtonType = (typeof buttonTypes)[number];\n","/*!\n * @prop --mg-c-button-border-radius: Defines the border radius of the button. The default value is `--mg-b-size-radius`.\n * @prop --mg-c-button-border-top-width: Defines the top border width of the button. Unset by default, fallback on `--mg-b-size-border`.\n * @prop --mg-c-button-border-right-width: Defines the right border width of the button. Unset by default, fallback on `--mg-b-size-border`.\n * @prop --mg-c-button-border-bottom-width: Defines the bottom border width of the button. Unset by default, fallback on `--mg-b-size-border`.\n * @prop --mg-c-button-border-left-width: Defines the left border width of the button. Unset by default, fallback on `--mg-b-size-border`.\n * @prop --mg-c-button-border-radius-top-left: Defines the top left border radius of the button. Unset by default, fallback on `--mg-c-button-border-radius`.\n * @prop --mg-c-button-border-radius-top-right: Defines the top right border radius of the button. Unset by default, fallback on `--mg-c-button-border-radius`.\n * @prop --mg-c-button-border-radius-bottom-right: Defines the bottom right border radius of the button. Unset by default, fallback on `--mg-c-button-border-radius`.\n * @prop --mg-c-button-border-radius-bottom-left: Defines the bottom left border radius of the button. Unset by default, fallback on `--mg-c-button-border-radius`.\n * @prop --mg-c-button-font-weight: Defines the font weight of the button. Unset by default, fallback on `normal`.\n * @prop --mg-c-button-icon-border-radius: Defines the border radius of the button in icon mode. The default value is `--mg-b-size-min-height`.\n */:host{display:inline-block;max-width:100%;vertical-align:middle}:host(:hover) .mg-c-button--flat:not(.mg-c-button--disabled){background:color-mix(in srgb, var(--mg-b-color-dark), transparent 90%)}:host([full-width]){display:block}:host([disabled]),:host([aria-disabled=true]){pointer-events:none}.mg-c-button.mg-c-button--primary{/*!\n * @prop --mg-c-button-color-background-primary: Defines the background color for the primary variant button.\n * @prop --mg-c-button-color-border-primary: Defines the border color for the primary variant button.\n * @prop --mg-c-button-color-gradient-primary: Defines the gradient color for the primary variant button.\n * @prop --mg-c-button-color-text-primary: Defines the font color for the primary variant button.\n */border-color:var(--mg-c-button-color-border-primary);background:linear-gradient(to bottom, var(--mg-c-button-color-background-primary), var(--mg-c-button-color-gradient-primary));color:var(--mg-c-button-color-text-primary)}:host(:hover) .mg-c-button.mg-c-button--primary:not(.mg-c-button--disabled){background:var(--mg-c-button-color-background-primary)}.mg-c-button.mg-c-button--secondary{/*!\n * @prop --mg-c-button-color-background-secondary: Defines the background color for the secondary variant button.\n * @prop --mg-c-button-color-border-secondary: Defines the border color for the secondary variant button.\n * @prop --mg-c-button-color-gradient-secondary: Defines the gradient color for the secondary variant button.\n * @prop --mg-c-button-color-text-secondary: Defines the font color for the secondary variant button.\n */border-color:var(--mg-c-button-color-border-secondary);background:linear-gradient(to bottom, var(--mg-c-button-color-background-secondary), var(--mg-c-button-color-gradient-secondary));color:var(--mg-c-button-color-text-secondary)}:host(:hover) .mg-c-button.mg-c-button--secondary:not(.mg-c-button--disabled){background:var(--mg-c-button-color-background-secondary)}.mg-c-button.mg-c-button--danger{/*!\n * @prop --mg-c-button-color-background-danger: Defines the background color for the danger variant button.\n * @prop --mg-c-button-color-border-danger: Defines the border color for the danger variant button.\n * @prop --mg-c-button-color-gradient-danger: Defines the gradient color for the danger variant button.\n * @prop --mg-c-button-color-text-danger: Defines the font color for the danger variant button.\n */border-color:var(--mg-c-button-color-border-danger);background:linear-gradient(to bottom, var(--mg-c-button-color-background-danger), var(--mg-c-button-color-gradient-danger));color:var(--mg-c-button-color-text-danger)}:host(:hover) .mg-c-button.mg-c-button--danger:not(.mg-c-button--disabled){background:var(--mg-c-button-color-background-danger)}.mg-c-button.mg-c-button--info{/*!\n * @prop --mg-c-button-color-background-info: Defines the background color for the info variant button.\n * @prop --mg-c-button-color-border-info: Defines the border color for the info variant button.\n * @prop --mg-c-button-color-gradient-info: Defines the gradient color for the info variant button.\n * @prop --mg-c-button-color-text-info: Defines the font color for the info variant button.\n */border-color:var(--mg-c-button-color-border-info);background:linear-gradient(to bottom, var(--mg-c-button-color-background-info), var(--mg-c-button-color-gradient-info));color:var(--mg-c-button-color-text-info)}:host(:hover) .mg-c-button.mg-c-button--info:not(.mg-c-button--disabled){background:var(--mg-c-button-color-background-info)}.mg-c-button.mg-c-button--success{/*!\n * @prop --mg-c-button-color-background-success: Defines the background color for the success variant button.\n * @prop --mg-c-button-color-border-success: Defines the border color for the success variant button.\n * @prop --mg-c-button-color-gradient-success: Defines the gradient color for the success variant button.\n * @prop --mg-c-button-color-text-success: Defines the font color for the success variant button.\n */border-color:var(--mg-c-button-color-border-success);background:linear-gradient(to bottom, var(--mg-c-button-color-background-success), var(--mg-c-button-color-gradient-success));color:var(--mg-c-button-color-text-success)}:host(:hover) .mg-c-button.mg-c-button--success:not(.mg-c-button--disabled){background:var(--mg-c-button-color-background-success)}.mg-c-button.mg-c-button--warning{/*!\n * @prop --mg-c-button-color-background-warning: Defines the background color for the warning variant button.\n * @prop --mg-c-button-color-border-warning: Defines the border color for the warning variant button.\n * @prop --mg-c-button-color-gradient-warning: Defines the gradient color for the warning variant button.\n * @prop --mg-c-button-color-text-warning: Defines the font color for the warning variant button.\n */border-color:var(--mg-c-button-color-border-warning);background:linear-gradient(to bottom, var(--mg-c-button-color-background-warning), var(--mg-c-button-color-gradient-warning));color:var(--mg-c-button-color-text-warning)}:host(:hover) .mg-c-button.mg-c-button--warning:not(.mg-c-button--disabled){background:var(--mg-c-button-color-background-warning)}.mg-c-button.mg-c-button--danger-alt{/*!\n * @prop --mg-c-button-color-background-danger-alt: Defines the background color for the danger-alt variant button.\n * @prop --mg-c-button-color-border-danger-alt: Defines the border color for the danger-alt variant button.\n * @prop --mg-c-button-color-gradient-danger-alt: Defines the gradient color for the danger-alt variant button.\n * @prop --mg-c-button-color-text-danger-alt: Defines the font color for the danger-alt variant button.\n */border-color:var(--mg-c-button-color-border-danger-alt);background:linear-gradient(to bottom, var(--mg-c-button-color-background-danger-alt), var(--mg-c-button-color-gradient-danger-alt));color:var(--mg-c-button-color-text-danger-alt)}:host(:hover) .mg-c-button.mg-c-button--danger-alt:not(.mg-c-button--disabled){background:var(--mg-c-button-color-background-danger-alt)}.mg-c-button{position:relative;display:inline-flex;min-height:var(--mg-b-size-min-height);box-sizing:border-box;align-items:center;padding:calc((var(--mg-b-size-min-height) - 2*var(--mg-b-size-border) - var(--mg-b-font-size)*var(--mg-b-line-height))/2) var(--mg-b-size-12);border-width:var(--mg-c-button-border-top-width, var(--mg-b-size-border)) var(--mg-c-button-border-right-width, var(--mg-b-size-border)) var(--mg-c-button-border-bottom-width, var(--mg-b-size-border)) var(--mg-c-button-border-left-width, var(--mg-b-size-border));border-style:solid;border-radius:var(--mg-c-button-border-radius-top-left, var(--mg-c-button-border-radius)) var(--mg-c-button-border-radius-top-right, var(--mg-c-button-border-radius)) var(--mg-c-button-border-radius-bottom-right, var(--mg-c-button-border-radius)) var(--mg-c-button-border-radius-bottom-left, var(--mg-c-button-border-radius));background-image:none;column-gap:var(--mg-b-size-8);cursor:pointer;touch-action:manipulation;font-family:inherit;font-size:var(--mg-b-font-size);font-weight:var(--mg-c-button-font-weight, normal);text-align:left;text-decoration:none}.mg-c-button slot,.mg-c-button ::slotted(*:not(mg-icon)){font-family:inherit;font-size:var(--mg-b-font-size);font-weight:var(--mg-c-button-font-weight, normal);text-align:left;text-decoration:none;display:flex;align-items:center;column-gap:var(--mg-b-size-8)}.mg-c-button mg-icon:only-child,.mg-c-button ::slotted(mg-icon){display:inline-flex;flex-shrink:0;margin:auto 0;line-height:1}.mg-c-button.mg-c-button--disabled{cursor:default;opacity:var(--mg-b-opacity-element-disabled)}.mg-c-button.mg-c-button--flat{border:none;background:none}.mg-c-button.mg-c-button--link{min-height:unset;padding:unset;border:unset;border-radius:unset;background:unset;text-decoration:underline}.mg-c-button.mg-c-button--link slot{font-weight:600}.mg-c-button.mg-c-button--link:hover{text-decoration:none}.mg-c-button.mg-c-button--large{padding:calc(var(--mg-b-size-12) - var(--mg-b-size-border)) calc(var(--mg-b-size-24) - var(--mg-b-size-border))}.mg-c-button.mg-c-button--large:not(.mg-c-button--icon){line-height:var(--mg-b-size-24)}.mg-c-button.mg-c-button--large:not(.mg-c-button--icon) slot,.mg-c-button.mg-c-button--large:not(.mg-c-button--icon) ::slotted(*){font-size:var(--mg-b-size-16)}.mg-c-button.mg-c-button--icon{width:var(--mg-b-size-min-height);height:var(--mg-b-size-min-height);justify-content:center;padding:0;border-radius:var(--mg-c-button-border-radius-top-left, var(--mg-c-button-icon-border-radius)) var(--mg-c-button-border-radius-top-right, var(--mg-c-button-icon-border-radius)) var(--mg-c-button-border-radius-bottom-right, var(--mg-c-button-icon-border-radius)) var(--mg-c-button-border-radius-bottom-left, var(--mg-c-button-icon-border-radius));font-size:var(--mg-b-font-size);line-height:var(--mg-b-font-size)}.mg-c-button.mg-c-button--icon.mg-c-button--large{width:unset;height:unset;padding:calc(var(--mg-b-size-12) - var(--mg-b-size-border))}.mg-c-button.mg-c-button--icon.mg-c-button--large ::slotted(*){min-width:var(--mg-b-size-24);min-height:var(--mg-b-size-24);align-items:center;justify-content:center}.mg-c-button.mg-c-button--full-width{display:flex;justify-content:center}.mg-c-button.mg-c-button--loading>mg-icon:first-of-type{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}.mg-c-button.mg-c-button--loading .mg-c-button__content{opacity:0}:host(:focus-visible){outline:0}:host(:focus-visible) .mg-c-button{outline-color:-webkit-focus-ring-color;outline-style:auto;outline-width:.2rem}/*# sourceMappingURL=mg-button.css.map */\n","import { Component, Element, h, Prop, State, Watch, Host, EventEmitter, Event } from '@stencil/core';\nimport { variants, VariantType, ButtonType, SizeType, sizes } from './mg-button.conf';\nimport { ClassList, isValidString, nextTick, toString } from '@mgdis/stencil-helpers';\n\n/**\n * @slot - Button content\n */\n@Component({\n tag: 'mg-button',\n styleUrl: '../../../../node_modules/@mgdis/styles/dist/components/mg-button.css',\n shadow: true,\n})\nexport class MgButton {\n /************\n * Internal *\n ************/\n\n private onClickElementFn = null;\n private readonly classDisabled = 'mg-c-button--disabled';\n private readonly classLoading = 'mg-c-button--loading';\n private readonly classFullWidth = 'mg-c-button--full-width';\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgButtonElement;\n\n /**\n * Define button variant\n */\n @Prop({ mutable: true }) variant: VariantType = variants[0]; // Primary\n @Watch('variant')\n validateVariant(newValue: VariantType, oldValue?: VariantType): void {\n // validate new value\n if (!variants.includes(newValue)) {\n if ((newValue as string) === '') {\n // Reactive framework like VUE render with `\"\"` when prop is update to undefined\n this.variant = variants[0];\n return;\n }\n throw new Error(`<mg-button> prop \"variant\" must be one of: ${variants.join(', ')}. Passed value: ${toString(newValue)}.`);\n } else {\n if (oldValue !== undefined) {\n this.classCollection.delete(`mg-c-button--${oldValue}`);\n }\n this.classCollection.add(`mg-c-button--${newValue}`);\n }\n }\n\n /**\n * aria-label\n * In case button text is not explicit enough\n */\n @Prop() label?: string;\n\n /**\n * Define button type\n */\n @Prop() type?: ButtonType;\n\n /**\n * Define button size\n */\n @Prop() size: SizeType = sizes[0]; // medium\n @Watch('size')\n validateSize(newValue: MgButton['size'], oldValue?: MgButton['size']): void {\n // validate new value\n if (!sizes.includes(newValue)) {\n throw new Error(`<mg-button> prop \"size\" must be one of: ${sizes.join(', ')}. Passed value: ${toString(newValue)}.`);\n } else {\n if (oldValue !== undefined) {\n this.classCollection.delete(`mg-c-button--${oldValue}`);\n }\n this.classCollection.add(`mg-c-button--${newValue}`);\n this.setIconSize();\n }\n }\n\n /**\n * Set button to full-width\n */\n @Prop() fullWidth = false;\n @Watch('fullWidth')\n validateFullWidth(newValue: MgButton['fullWidth']): void {\n if (newValue && this.isIcon) {\n throw new Error('<mg-button> prop \"fullWidth\" cannot be used with prop \"isIcon\".');\n } else if (newValue) {\n this.classCollection.add(this.classFullWidth);\n } else {\n this.classCollection.delete(this.classFullWidth);\n }\n }\n\n /**\n * Define form id to attach button with.\n * If this attribute is not set, the `<button>` is associated with its ancestor `<form>` element.\n */\n @Prop() form?: string;\n\n /**\n * Disable button\n */\n @Prop({ mutable: true }) disabled?: boolean;\n @Watch('disabled')\n disabledHandler(isDisabled: MgButton['disabled']): void {\n // Remove loading when enable\n // Will be set back onclick\n if (!isDisabled && this.disableOnClick) {\n this.loading = false;\n }\n // Manage if onclick\n this.element.onclick = isDisabled ? undefined : this.onClickElementFn;\n\n // apply style\n if (isDisabled) {\n this.classCollection.add(this.classDisabled);\n } else {\n this.classCollection.delete(this.classDisabled);\n }\n\n // emit value update\n this.disabledChange.emit(isDisabled);\n }\n /**\n * Define if button is round.\n * Used for icon button.\n */\n @Prop() isIcon = false;\n @Watch('isIcon')\n watchIsIcon(): void {\n this.setIconSize();\n }\n\n /**\n * Option to set input disable on click, in order to prevent multi-click.\n * Parent component have to remove the attribute 'disabled' when the process ends.\n */\n @Prop() disableOnClick = false;\n\n /**\n * Define if button is loading, default to false.\n * Trigger when button is clicked or key-up ['enter', 'space], then value change to true.\n * It's required to reset to false when action/promise in parent is done to stop the loading state\n */\n @State() loading = false;\n @Watch('loading')\n loadingHandler(newValue: MgButton['loading']): void {\n // we add loading style if it newvalue is true else we remove it\n if (newValue) {\n this.classCollection.add(this.classLoading);\n } else {\n this.classCollection.delete(this.classLoading);\n }\n }\n\n /**\n * Component classes\n */\n @State() classCollection: ClassList = new ClassList(['mg-c-button']);\n\n /**\n * Emmited event when disabled change\n */\n @Event({ eventName: 'disabled-change' }) disabledChange: EventEmitter<HTMLMgButtonElement['disabled']>;\n\n /**\n * Trigger actions onClick event\n * @param event - click event\n */\n private handleClick = (event: MouseEvent): void => {\n if (this.disabled) event.stopPropagation();\n // Used to prevent multi-click.\n else if (this.disableOnClick) {\n this.loading = true;\n this.disabled = true;\n }\n };\n\n /**\n * Handle onKeydown event\n * @param event - keyboard event\n */\n private handleKeydown = (event: KeyboardEvent): void => {\n if (!this.disabled && event.key === ' ') {\n event.preventDefault();\n } else if (!this.disabled && ['Enter', 'NumpadEnter', 'Space'].includes(event.key)) {\n event.preventDefault();\n this.element.dispatchEvent(new MouseEvent('click', { bubbles: true }));\n }\n };\n\n /**\n * Handle onKeyup event\n * @param event - keyboard event\n */\n private handleKeyup = (event: KeyboardEvent): void => {\n if (!this.disabled && event.key === ' ') {\n event.preventDefault();\n this.element.dispatchEvent(new MouseEvent('click', { bubbles: true }));\n }\n };\n\n /**\n * Set child `<mg-icon>` element `size` prop to follow the current `size` prop\n */\n private setIconSize = (): void => {\n if (this.size === 'medium') {\n this.element.querySelector('mg-icon')?.removeAttribute('size');\n } else if (this.isIcon) {\n this.element.querySelector('mg-icon')?.setAttribute('size', this.size);\n }\n };\n\n /**\n * Check if props are well configured on init\n */\n componentWillLoad(): void {\n this.validateVariant(this.variant);\n this.validateFullWidth(this.fullWidth);\n this.validateSize(this.size);\n this.watchIsIcon();\n if (this.isIcon) {\n this.classCollection.add(`mg-c-button--icon`);\n if (!isValidString(this.label)) {\n throw new Error(`<mg-button> prop \"label\" is mandatory when prop \"isIcon\" is set to true.`);\n }\n }\n // Store the onclick fn\n this.onClickElementFn = this.element.onclick;\n this.disabledHandler(this.disabled);\n }\n\n /**\n * Add listners\n */\n componentDidLoad(): void {\n nextTick(() => {\n const closestForm = this.element.closest('form') || this.element.closest('mg-form')?.shadowRoot.querySelector('form');\n // submit buttons should trigger form submition;\n if (closestForm && ['submit', undefined].includes(this.type)) {\n this.element.addEventListener('click', () => {\n closestForm.dispatchEvent(new SubmitEvent('submit', { bubbles: true, cancelable: true }));\n });\n }\n });\n }\n\n /**\n * Render component\n * @returns html element\n */\n render(): HTMLElement {\n return (\n <Host\n role=\"button\"\n tabIndex={0}\n type={this.type}\n form={this.form}\n full-width={this.fullWidth}\n aria-label={this.label}\n aria-disabled={this.disabled?.toString()}\n onClick={this.handleClick}\n onKeyup={this.handleKeyup}\n onKeydown={this.handleKeydown}\n >\n <div class={this.classCollection.join()}>\n {this.loading && <mg-icon icon=\"loader\" spin></mg-icon>}\n <div class=\"mg-c-button__content\">\n <slot></slot>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}