@mgdis/mg-components 5.27.1 → 5.27.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/dist/cjs/{index-4b43c17b.js → index-00072168.js} +43 -43
  2. package/dist/cjs/index-00072168.js.map +1 -0
  3. package/dist/cjs/{index-83102ab3.js → index-7e27c7ae.js} +26 -3
  4. package/dist/cjs/index-7e27c7ae.js.map +1 -0
  5. package/dist/cjs/loader.cjs.js +1 -1
  6. package/dist/cjs/mg-action-more_36.cjs.entry.js +138 -138
  7. package/dist/cjs/mg-action-more_36.cjs.entry.js.map +1 -1
  8. package/dist/cjs/mg-components.cjs.js +2 -2
  9. package/dist/cjs/mg-components.cjs.js.map +1 -1
  10. package/dist/cjs/mg-loader.cjs.entry.js +4 -4
  11. package/dist/collection/collection-manifest.json +2 -2
  12. package/dist/collection/components/atoms/mg-button/mg-button.js +1 -1
  13. package/dist/collection/components/atoms/mg-button/mg-button.js.map +1 -1
  14. package/dist/collection/components/atoms/mg-card/mg-card.js +1 -1
  15. package/dist/collection/components/atoms/mg-card/mg-card.js.map +1 -1
  16. package/dist/collection/components/atoms/mg-character-left/mg-character-left.js +1 -1
  17. package/dist/collection/components/atoms/mg-divider/mg-divider.js +1 -1
  18. package/dist/collection/components/atoms/mg-input-title/mg-input-title.js +1 -1
  19. package/dist/collection/components/atoms/mg-input-title/mg-input-title.js.map +1 -1
  20. package/dist/collection/components/atoms/mg-tag/mg-tag.js +1 -1
  21. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.js +1 -1
  22. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +1 -1
  23. package/dist/collection/components/molecules/inputs/mg-input/mg-input.js +1 -1
  24. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js +2 -2
  25. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js.map +1 -1
  26. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +1 -1
  27. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +1 -1
  28. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +2 -2
  29. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +2 -2
  30. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +1 -1
  31. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +2 -2
  32. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js.map +1 -1
  33. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +3 -3
  34. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js.map +1 -1
  35. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +2 -2
  36. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js.map +1 -1
  37. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +1 -1
  38. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js +1 -1
  39. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js +1 -1
  40. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +3 -3
  41. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js.map +1 -1
  42. package/dist/collection/components/molecules/mg-details/mg-details.js +1 -1
  43. package/dist/collection/components/molecules/mg-form/mg-form.js +1 -1
  44. package/dist/collection/components/molecules/mg-form/mg-form.js.map +1 -1
  45. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +3 -3
  46. package/dist/collection/components/molecules/mg-item-more/mg-item-more.js +2 -2
  47. package/dist/collection/components/molecules/mg-item-more/mg-item-more.js.map +1 -1
  48. package/dist/collection/components/molecules/mg-loader/mg-loader.js +1 -1
  49. package/dist/collection/components/molecules/mg-message/mg-message.js +1 -1
  50. package/dist/collection/components/molecules/mg-message/mg-message.js.map +1 -1
  51. package/dist/collection/components/molecules/mg-modal/mg-modal.js +2 -2
  52. package/dist/collection/components/molecules/mg-modal/mg-modal.js.map +1 -1
  53. package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +3 -3
  54. package/dist/collection/components/molecules/mg-pagination/mg-pagination.js.map +1 -1
  55. package/dist/collection/components/molecules/mg-panel/mg-panel.js +1 -1
  56. package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js +1 -1
  57. package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js.map +1 -1
  58. package/dist/collection/components/molecules/mg-popover/mg-popover.js +1 -1
  59. package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +1 -1
  60. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +1 -1
  61. package/dist/components/index.es.js +39 -39
  62. package/dist/components/index.es.js.map +1 -1
  63. package/dist/components/index2.js +2 -2
  64. package/dist/components/mg-action-more.js +5 -5
  65. package/dist/components/mg-action-more.js.map +1 -1
  66. package/dist/components/mg-badge2.js +3 -3
  67. package/dist/components/mg-button2.js +5 -5
  68. package/dist/components/mg-button2.js.map +1 -1
  69. package/dist/components/mg-card2.js +3 -3
  70. package/dist/components/mg-card2.js.map +1 -1
  71. package/dist/components/mg-character-left2.js +1 -1
  72. package/dist/components/mg-details.js +3 -3
  73. package/dist/components/mg-divider.js +1 -1
  74. package/dist/components/mg-form.js +4 -4
  75. package/dist/components/mg-form.js.map +1 -1
  76. package/dist/components/mg-icon2.js +2 -2
  77. package/dist/components/mg-illustrated-message.js +5 -5
  78. package/dist/components/mg-input-checkbox-paginated2.js +2 -2
  79. package/dist/components/mg-input-checkbox-paginated2.js.map +1 -1
  80. package/dist/components/mg-input-checkbox.js +5 -5
  81. package/dist/components/mg-input-date.js +11 -11
  82. package/dist/components/mg-input-numeric.js +7 -7
  83. package/dist/components/mg-input-password.js +5 -5
  84. package/dist/components/mg-input-radio.js +5 -5
  85. package/dist/components/mg-input-select2.js +8 -8
  86. package/dist/components/mg-input-select2.js.map +1 -1
  87. package/dist/components/mg-input-text2.js +9 -9
  88. package/dist/components/mg-input-text2.js.map +1 -1
  89. package/dist/components/mg-input-textarea.js +8 -8
  90. package/dist/components/mg-input-textarea.js.map +1 -1
  91. package/dist/components/mg-input-title2.js +3 -3
  92. package/dist/components/mg-input-title2.js.map +1 -1
  93. package/dist/components/mg-input-toggle.js +5 -5
  94. package/dist/components/mg-input2.js +4 -4
  95. package/dist/components/mg-item-more2.js +5 -5
  96. package/dist/components/mg-item-more2.js.map +1 -1
  97. package/dist/components/mg-loader.js +3 -3
  98. package/dist/components/mg-menu-item2.js +6 -6
  99. package/dist/components/mg-message.js +4 -4
  100. package/dist/components/mg-message.js.map +1 -1
  101. package/dist/components/mg-modal.js +8 -8
  102. package/dist/components/mg-modal.js.map +1 -1
  103. package/dist/components/mg-pagination2.js +5 -5
  104. package/dist/components/mg-pagination2.js.map +1 -1
  105. package/dist/components/mg-panel.js +5 -5
  106. package/dist/components/mg-popover-content2.js +4 -4
  107. package/dist/components/mg-popover-content2.js.map +1 -1
  108. package/dist/components/mg-popover2.js +4 -4
  109. package/dist/components/mg-skip-links.js +3 -3
  110. package/dist/components/mg-tabs.js +7 -7
  111. package/dist/components/mg-tag.js +4 -4
  112. package/dist/components/mg-tooltip-content2.js +1 -1
  113. package/dist/components/mg-tooltip2.js +7 -7
  114. package/dist/esm/{index-c4ed16b2.js → index-8d5d1bfd.js} +41 -41
  115. package/dist/esm/index-8d5d1bfd.js.map +1 -0
  116. package/dist/esm/{index-d43d1c5d.js → index-e479d5ae.js} +26 -3
  117. package/dist/esm/index-e479d5ae.js.map +1 -0
  118. package/dist/esm/loader.js +2 -2
  119. package/dist/esm/mg-action-more_36.entry.js +138 -138
  120. package/dist/esm/mg-action-more_36.entry.js.map +1 -1
  121. package/dist/esm/mg-components.js +3 -3
  122. package/dist/esm/mg-components.js.map +1 -1
  123. package/dist/esm/mg-loader.entry.js +4 -4
  124. package/dist/mg-components/mg-components.esm.js +1 -1
  125. package/dist/mg-components/mg-components.esm.js.map +1 -1
  126. package/dist/mg-components/p-7315d4a6.js +3 -0
  127. package/dist/mg-components/p-7315d4a6.js.map +1 -0
  128. package/dist/mg-components/{p-350454b9.js → p-8800813b.js} +2 -2
  129. package/dist/mg-components/p-8800813b.js.map +1 -0
  130. package/dist/mg-components/{p-d4084a15.entry.js → p-99e2f42a.entry.js} +2 -2
  131. package/dist/mg-components/p-f9ac8927.entry.js +2 -0
  132. package/dist/mg-components/{p-9cdd1bc9.entry.js.map → p-f9ac8927.entry.js.map} +1 -1
  133. package/ide/intellij/web-types.json +1 -1
  134. package/ide/vscode/html-custom-data.json +1 -1
  135. package/package.json +10 -10
  136. package/dist/cjs/index-4b43c17b.js.map +0 -1
  137. package/dist/cjs/index-83102ab3.js.map +0 -1
  138. package/dist/esm/index-c4ed16b2.js.map +0 -1
  139. package/dist/esm/index-d43d1c5d.js.map +0 -1
  140. package/dist/mg-components/p-350454b9.js.map +0 -1
  141. package/dist/mg-components/p-9cdd1bc9.entry.js +0 -2
  142. package/dist/mg-components/p-cf0b0988.js +0 -3
  143. package/dist/mg-components/p-cf0b0988.js.map +0 -1
  144. /package/dist/mg-components/{p-d4084a15.entry.js.map → p-99e2f42a.entry.js.map} +0 -0
@@ -1,31 +1,31 @@
1
- var ie = Object.defineProperty;
2
- var ce = (t, e, s) => e in t ? ie(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
3
- var p = (t, e, s) => (ce(t, typeof e != "symbol" ? e + "" : e, s), s);
4
- const Re = (t = "", e = 10) => {
5
- const s = new Uint8Array(e);
1
+ var ce = Object.defineProperty;
2
+ var ae = (e, t, s) => t in e ? ce(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
3
+ var h = (e, t, s) => (ae(e, typeof t != "symbol" ? t + "" : t, s), s);
4
+ const Me = (e = "", t = 10) => {
5
+ const s = new Uint8Array(t);
6
6
  crypto.getRandomValues(s);
7
- const r = Array.from(s).map((n) => n.toString(16).padStart(2, "0")).join("").slice(0, e);
8
- return t !== "" ? `${t}-${r}` : r;
7
+ const r = Array.from(s).map((n) => n.toString(16).padStart(2, "0")).join("").slice(0, t);
8
+ return e !== "" ? `${e}-${r}` : r;
9
9
  };
10
- class Me {
11
- constructor(e = []) {
10
+ class Oe {
11
+ constructor(t = []) {
12
12
  /**
13
13
  * Available classes
14
14
  */
15
- p(this, "classes");
15
+ h(this, "classes");
16
16
  /**
17
17
  * Add class
18
18
  * @param className - class name to add
19
19
  */
20
- p(this, "add", (e) => {
21
- this.has(e) || this.classes.push(e);
20
+ h(this, "add", (t) => {
21
+ this.has(t) || this.classes.push(t);
22
22
  });
23
23
  /**
24
24
  * Delete class
25
25
  * @param className - class name to delete
26
26
  */
27
- p(this, "delete", (e) => {
28
- const s = this.classes.indexOf(e);
27
+ h(this, "delete", (t) => {
28
+ const s = this.classes.indexOf(t);
29
29
  s > -1 && this.classes.splice(s, 1);
30
30
  });
31
31
  /**
@@ -33,43 +33,43 @@ class Me {
33
33
  * @param className - class name to check
34
34
  * @returns class name is in the list
35
35
  */
36
- p(this, "has", (e) => this.classes.includes(e));
36
+ h(this, "has", (t) => this.classes.includes(t));
37
37
  /**
38
38
  * Join classes seperated by spaces
39
39
  * @returns joined values
40
40
  */
41
- p(this, "join", () => this.classes.join(" "));
42
- this.classes = e;
41
+ h(this, "join", () => this.classes.join(" "));
42
+ this.classes = t;
43
43
  }
44
44
  }
45
- const Oe = (t) => Array.isArray(t) && t.every((e) => typeof e == "string"), Fe = (t, e) => e.includes(t == null ? void 0 : t.tagName.toLowerCase()), De = 'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), [identifier], mg-button', _e = (t) => {
46
- const e = I(t), s = X(t);
47
- return [t, ...e, ...s];
48
- }, I = (t, e = []) => {
49
- if (t.self !== t.top)
45
+ const Fe = (e) => Array.isArray(e) && e.every((t) => typeof t == "string"), De = (e, t) => t.includes(e == null ? void 0 : e.tagName.toLowerCase()), _e = 'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), [identifier], mg-button', Be = (e) => {
46
+ const t = X(e), s = K(e);
47
+ return [e, ...t, ...s];
48
+ }, X = (e, t = []) => {
49
+ if (e.self !== e.top)
50
50
  try {
51
- const s = t.parent;
52
- return s ? (e.push(s), I(s, e)) : e;
51
+ const s = e.parent;
52
+ return s ? (t.push(s), X(s, t)) : t;
53
53
  } catch (s) {
54
- return console.error("Different hosts between iframes:", s), e;
54
+ return console.error("Different hosts between iframes:", s), t;
55
55
  }
56
- return e;
57
- }, X = (t, e = []) => {
58
- if (t.frames.length > 0)
59
- for (const s of Array.from(t.frames))
60
- e.push(s), X(s, e);
61
- return e;
62
- }, Be = (t) => typeof t == "string" && t.trim() !== "", Ne = (t) => typeof t == "string" ? t.toLocaleLowerCase().normalize("NFD").replaceAll(/[\u0300-\u036f]/g, "") : t, Ue = async (t) => t(), Pe = (t) => {
63
- const e = { value: "2023", pattern: "yyyy" }, s = { value: "12", pattern: "mm" }, r = { value: "24", pattern: "dd" };
64
- return ge([e.value, s.value, r.value].join("-"), t).replace(e.value, e.pattern).replace(s.value, s.pattern).replace(r.value, r.pattern);
65
- }, We = (t) => t.toISOString().split("T")[0], ue = (t, e, s) => {
66
- const r = t.closest("[lang]"), n = Intl.NumberFormat.supportedLocalesOf(r == null ? void 0 : r.lang), l = n.length > 0 && typeof n[0] == "string" ? n[0] : navigator.language || s, o = l.split("-").shift();
56
+ return t;
57
+ }, K = (e, t = []) => {
58
+ if (e.frames.length > 0)
59
+ for (const s of Array.from(e.frames))
60
+ t.push(s), K(s, t);
61
+ return t;
62
+ }, Ne = (e) => typeof e == "string" && e.trim() !== "", Ue = (e) => typeof e == "string" ? e.toLocaleLowerCase().normalize("NFD").replaceAll(/[\u0300-\u036f]/g, "") : e, Ce = async (e) => e(), We = (e) => {
63
+ const t = { value: "2023", pattern: "yyyy" }, s = { value: "12", pattern: "mm" }, r = { value: "24", pattern: "dd" };
64
+ return pe([t.value, s.value, r.value].join("-"), e).replace(t.value, t.pattern).replace(s.value, s.pattern).replace(r.value, r.pattern);
65
+ }, ze = (e) => e.toISOString().split("T")[0], de = (e, t, s) => {
66
+ const r = e.closest("[lang]"), n = Intl.NumberFormat.supportedLocalesOf(r == null ? void 0 : r.lang), l = n.length > 0 && typeof n[0] == "string" ? n[0] : navigator.language || s, o = l.split("-").shift();
67
67
  return {
68
68
  locale: l,
69
- messages: e[o] || e[s]
69
+ messages: t[o] || t[s]
70
70
  };
71
- }, ze = (t, e, s) => new Intl.NumberFormat(e, { style: "currency", currency: s }).format(t), qe = (t, e, s = 0) => new Intl.NumberFormat(e, { minimumFractionDigits: s }).format(s > 0 ? Number(t == null ? void 0 : t.toFixed(s)) : t), de = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/, ge = (t, e) => typeof t != "string" || t === "" || !de.test(t) ? "" : new Intl.DateTimeFormat(e).format(new Date(t)), we = (t, e) => (s) => ue(s, t, e);
71
+ }, qe = (e, t, s) => new Intl.NumberFormat(t, { style: "currency", currency: s }).format(e), we = (e, t, s = 0) => new Intl.NumberFormat(t, { minimumFractionDigits: s }).format(s > 0 ? Number(e == null ? void 0 : e.toFixed(s)) : e), ge = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/, pe = (e, t) => typeof e != "string" || e === "" || !ge.test(e) ? "" : new Intl.DateTimeFormat(t).format(new Date(e)), Ge = (e, t) => (s) => de(s, e, t);
72
72
 
73
- export { Be as B, De as D, Fe as F, Me as M, Ne as N, Oe as O, Pe as P, Re as R, Ue as U, We as W, _e as _, de as d, ge as g, qe as q, we as w, ze as z };
73
+ export { Be as B, Ce as C, De as D, Fe as F, Ge as G, Me as M, Ne as N, Oe as O, Ue as U, We as W, _e as _, ge as g, pe as p, qe as q, we as w, ze as z };
74
74
 
75
75
  //# sourceMappingURL=index.es.js.map
@@ -1 +1 @@
1
- {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AAC,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 ie = Object.defineProperty;\nvar ce = (t, e, s) => e in t ? ie(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;\nvar p = (t, e, s) => (ce(t, typeof e != \"symbol\" ? e + \"\" : e, s), s);\nconst Re = (t = \"\", e = 10) => {\n const s = new Uint8Array(e);\n crypto.getRandomValues(s);\n const r = Array.from(s).map((n) => n.toString(16).padStart(2, \"0\")).join(\"\").slice(0, e);\n return t !== \"\" ? `${t}-${r}` : r;\n};\nclass Me {\n constructor(e = []) {\n /**\n * Available classes\n */\n p(this, \"classes\");\n /**\n * Add class\n * @param className - class name to add\n */\n p(this, \"add\", (e) => {\n this.has(e) || this.classes.push(e);\n });\n /**\n * Delete class\n * @param className - class name to delete\n */\n p(this, \"delete\", (e) => {\n const s = this.classes.indexOf(e);\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 p(this, \"has\", (e) => this.classes.includes(e));\n /**\n * Join classes seperated by spaces\n * @returns joined values\n */\n p(this, \"join\", () => this.classes.join(\" \"));\n this.classes = e;\n }\n}\nconst Oe = (t) => Array.isArray(t) && t.every((e) => typeof e == \"string\"), Fe = (t, e) => e.includes(t == null ? void 0 : t.tagName.toLowerCase()), De = 'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex=\"-1\"]), [identifier], mg-button', _e = (t) => {\n const e = I(t), s = X(t);\n return [t, ...e, ...s];\n}, I = (t, e = []) => {\n if (t.self !== t.top)\n try {\n const s = t.parent;\n return s ? (e.push(s), I(s, e)) : e;\n } catch (s) {\n return console.error(\"Different hosts between iframes:\", s), e;\n }\n return e;\n}, X = (t, e = []) => {\n if (t.frames.length > 0)\n for (const s of Array.from(t.frames))\n e.push(s), X(s, e);\n return e;\n}, Be = (t) => typeof t == \"string\" && t.trim() !== \"\", Ne = (t) => typeof t == \"string\" ? t.toLocaleLowerCase().normalize(\"NFD\").replaceAll(/[\\u0300-\\u036f]/g, \"\") : t, Ue = async (t) => t(), K = (t, e) => {\n if (!e)\n return;\n const s = e.split(\"/\");\n return `${t}${s.slice(2, s.length - 1).join(\"-\")}--docs`;\n}, ae = (t, e) => {\n if (e)\n return `${t}${e}`;\n}, Q = (t) => {\n let e = t.overview ? `${t.overview}\n\n` : \"\";\n const s = t.props.filter(({ attr: n }) => n !== void 0);\n s.length && (e += `Attributes:\n`, e += s.map(({ attr: n, docs: l }) => `- \\`${n}\\`: ${l}\n`).join(\"\"), e += `\n`);\n const r = t.props.filter(({ attr: n }) => n === void 0);\n return r.length && (e += `Properties:\n`, e += r.map(({ name: n, docs: l }) => `- \\`${n}\\`: ${l}\n`).join(\"\"), e += `\n`), t.methods.length && (e += `Methods:\n`, e += t.methods.map(({ name: n, docs: l }) => `- \\`${n}\\`: ${l}\n`).join(\"\"), e += `\n`), t.events.length && (e += `Events:\n`, e += t.events.map(({ event: n, docs: l }) => `- \\`${n}\\`: ${l}\n`).join(\"\"), e += `\n`), t.listeners.length && (e += `Listeners:\n`, e += t.listeners.map(({ event: n }) => `- \\`${n}\\`\n`).join(\"\"), e += `\n`), t.slots.length && (e += `Slots:\n`, e += t.slots.map(({ name: n, docs: l }) => `- \\`${n}\\`: ${l}\n`).join(\"\"), e += `\n`), e;\n}, F = (t) => `${t.docs}\n\nType: \\`${t.type}\\``, Ce = (t, e, s, r) => ({\n $schema: \"https://json.schemastore.org/web-types\",\n name: t,\n version: e,\n \"description-markup\": \"markdown\",\n contributions: {\n html: {\n elements: s.components.map((n) => {\n const l = K(r, n.filePath);\n return {\n name: n.tag,\n description: Q(n),\n \"doc-url\": l,\n attributes: n.props.filter((o) => o.attr).map((o) => ({\n name: o.attr,\n description: F(o),\n \"doc-url\": l,\n value: {\n type: o.type,\n default: o.default,\n required: o.required\n }\n })),\n js: {\n properties: n.props.map((o) => ({\n name: o.name,\n description: F(o),\n \"doc-url\": l,\n value: {\n type: o.type,\n default: o.default,\n required: o.required\n }\n })),\n events: n.events.map((o) => ({\n name: o.event,\n description: o.docs\n }))\n }\n };\n })\n }\n }\n}), fe = (t, e, s) => {\n if (s)\n return [\n { name: \"Storybook\", url: K(t, s) },\n { name: \"Sources\", url: ae(e, s) }\n ];\n}, $e = (t) => {\n if (!t.values.some(({ value: e }) => e === void 0))\n return t.values.map(({ value: e }) => ({ name: e }));\n}, He = (t, e, s, r) => ({\n version: t,\n tags: e.components.map((n) => {\n const l = fe(s, r, n.filePath);\n return {\n name: n.tag,\n description: Q(n),\n attributes: n.props.map((o) => ({\n name: o.attr || o.name,\n description: F(o),\n values: $e(o),\n references: l\n })),\n references: l\n };\n }),\n globalAttributes: [],\n valueSets: []\n}), Pe = (t) => {\n const e = { value: \"2023\", pattern: \"yyyy\" }, s = { value: \"12\", pattern: \"mm\" }, r = { value: \"24\", pattern: \"dd\" };\n return ge([e.value, s.value, r.value].join(\"-\"), t).replace(e.value, e.pattern).replace(s.value, s.pattern).replace(r.value, r.pattern);\n}, We = (t) => t.toISOString().split(\"T\")[0], ue = (t, e, s) => {\n const r = t.closest(\"[lang]\"), n = Intl.NumberFormat.supportedLocalesOf(r == null ? void 0 : r.lang), l = n.length > 0 && typeof n[0] == \"string\" ? n[0] : navigator.language || s, o = l.split(\"-\").shift();\n return {\n locale: l,\n messages: e[o] || e[s]\n };\n}, ze = (t, e, s) => new Intl.NumberFormat(e, { style: \"currency\", currency: s }).format(t), qe = (t, e, s = 0) => new Intl.NumberFormat(e, { minimumFractionDigits: s }).format(s > 0 ? Number(t == null ? void 0 : t.toFixed(s)) : t), de = /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$/, ge = (t, e) => typeof t != \"string\" || t === \"\" || !de.test(t) ? \"\" : new Intl.DateTimeFormat(e).format(new Date(t)), we = (t, e) => (s) => ue(s, t, 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 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: !1,\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};\nlet k, D, m, B = !1, R = !1, N = !1, h = !1;\nconst H = \"http://www.w3.org/1999/xlink\", P = {}, pe = \"http://www.w3.org/2000/svg\", he = \"http://www.w3.org/1999/xhtml\", ye = (t) => t != null, J = (t) => (t = typeof t, t === \"object\" || t === \"function\"), Y = (t, e, ...s) => {\n let r = null, n = null, l = null, o = !1, c = !1;\n const i = [], d = (a) => {\n for (let $ = 0; $ < a.length; $++)\n r = a[$], Array.isArray(r) ? d(r) : r != null && typeof r != \"boolean\" && ((o = typeof t != \"function\" && !J(r)) && (r = String(r)), o && c ? i[i.length - 1].$text$ += r : i.push(o ? M(null, r) : r), c = o);\n };\n if (d(s), e) {\n e.key && (n = e.key), e.name && (l = e.name);\n {\n const a = e.className || e.class;\n a && (e.class = typeof a != \"object\" ? a : Object.keys(a).filter(($) => a[$]).join(\" \"));\n }\n }\n if (typeof t == \"function\")\n return t(e === null ? {} : e, i, be);\n const u = M(t, null);\n return u.$attrs$ = e, i.length > 0 && (u.$children$ = i), u.$key$ = n, u.$name$ = l, u;\n}, M = (t, e) => {\n const s = {\n $flags$: 0,\n $tag$: t,\n $text$: e,\n $elm$: null,\n $children$: null\n };\n return s.$attrs$ = null, s.$key$ = null, s.$name$ = null, s;\n}, ve = {}, Se = (t) => t && t.$tag$ === ve, be = {\n forEach: (t, e) => t.map(W).forEach(e),\n map: (t, e) => t.map(W).map(e).map(ke)\n}, W = (t) => ({\n vattrs: t.$attrs$,\n vchildren: t.$children$,\n vkey: t.$key$,\n vname: t.$name$,\n vtag: t.$tag$,\n vtext: t.$text$\n}), ke = (t) => {\n if (typeof t.vtag == \"function\") {\n const s = Object.assign({}, t.vattrs);\n return t.vkey && (s.key = t.vkey), t.vname && (s.name = t.vname), Y(t.vtag, s, ...t.vchildren || []);\n }\n const e = M(t.vtag, t.vtext);\n return e.$attrs$ = t.vattrs, e.$children$ = t.vchildren, e.$key$ = t.vkey, e.$name$ = t.vname, e;\n}, z = (t, e, s, r, n, l) => {\n if (s !== r) {\n let o = G(t, e), c = e.toLowerCase();\n if (e === \"class\") {\n const i = t.classList, d = q(s), u = q(r);\n i.remove(...d.filter((a) => a && !u.includes(a))), i.add(...u.filter((a) => a && !d.includes(a)));\n } else if (e === \"style\") {\n for (const i in s)\n (!r || r[i] == null) && (i.includes(\"-\") ? t.style.removeProperty(i) : t.style[i] = \"\");\n for (const i in r)\n (!s || r[i] !== s[i]) && (i.includes(\"-\") ? t.style.setProperty(i, r[i]) : t.style[i] = r[i]);\n } else if (e !== \"key\")\n if (e === \"ref\")\n r && r(t);\n else if (!t.__lookupSetter__(e) && e[0] === \"o\" && e[1] === \"n\") {\n if (e[2] === \"-\" ? e = e.slice(3) : G(C, c) ? e = c.slice(2) : e = c[2] + e.slice(3), s || r) {\n const i = e.endsWith(Z);\n e = e.replace(me, \"\"), s && x.rel(t, e, s, i), r && x.ael(t, e, r, i);\n }\n } else {\n const i = J(r);\n if ((o || i && r !== null) && !n)\n try {\n if (t.tagName.includes(\"-\"))\n t[e] = r;\n else {\n const u = r ?? \"\";\n e === \"list\" ? o = !1 : (s == null || t[e] != u) && (t[e] = u);\n }\n } catch {\n }\n let d = !1;\n c !== (c = c.replace(/^xlink\\:?/, \"\")) && (e = c, d = !0), r == null || r === !1 ? (r !== !1 || t.getAttribute(e) === \"\") && (d ? t.removeAttributeNS(H, e) : t.removeAttribute(e)) : (!o || l & 4 || n) && !i && (r = r === !0 ? \"\" : r, d ? t.setAttributeNS(H, e, r) : t.setAttribute(e, r));\n }\n }\n}, Te = /\\s/, q = (t) => t ? t.split(Te) : [], Z = \"Capture\", me = new RegExp(Z + \"$\"), V = (t, e, s, r) => {\n const n = e.$elm$.nodeType === 11 && e.$elm$.host ? e.$elm$.host : e.$elm$, l = t && t.$attrs$ || P, o = e.$attrs$ || P;\n for (r in l)\n r in o || z(n, r, l[r], void 0, s, e.$flags$);\n for (r in o)\n z(n, r, l[r], o[r], s, e.$flags$);\n}, O = (t, e, s, r) => {\n var n;\n const l = e.$children$[s];\n let o = 0, c, i, d;\n if (B || (N = !0, l.$tag$ === \"slot\" && (k && r.classList.add(k + \"-s\"), l.$flags$ |= l.$children$ ? (\n // slot element has fallback content\n 2\n ) : (\n // slot element does not have fallback content\n 1\n ))), l.$text$ !== null)\n c = l.$elm$ = j.createTextNode(l.$text$);\n else if (l.$flags$ & 1)\n c = l.$elm$ = j.createTextNode(\"\");\n else {\n if (h || (h = l.$tag$ === \"svg\"), c = l.$elm$ = j.createElementNS(h ? pe : he, l.$flags$ & 2 ? \"slot-fb\" : l.$tag$), h && l.$tag$ === \"foreignObject\" && (h = !1), V(null, l, h), ye(k) && c[\"s-si\"] !== k && c.classList.add(c[\"s-si\"] = k), l.$children$)\n for (o = 0; o < l.$children$.length; ++o)\n i = O(t, l, o, c), i && c.appendChild(i);\n l.$tag$ === \"svg\" ? h = !1 : c.tagName === \"foreignObject\" && (h = !0);\n }\n return c[\"s-hn\"] = m, l.$flags$ & 3 && (c[\"s-sr\"] = !0, c[\"s-cr\"] = D, c[\"s-sn\"] = l.$name$ || \"\", c[\"s-rf\"] = (n = l.$attrs$) === null || n === void 0 ? void 0 : n.ref, d = t && t.$children$ && t.$children$[s], d && d.$tag$ === l.$tag$ && t.$elm$ && A(t.$elm$, !1)), c;\n}, A = (t, e) => {\n x.$flags$ |= 1;\n const s = Array.from(t.childNodes);\n if (t[\"s-sr\"] && _.experimentalSlotFixes) {\n let r = t;\n for (; r = r.nextSibling; )\n r && r[\"s-sn\"] === t[\"s-sn\"] && r[\"s-sh\"] === m && s.push(r);\n }\n for (let r = s.length - 1; r >= 0; r--) {\n const n = s[r];\n n[\"s-hn\"] !== m && n[\"s-ol\"] && (se(n).insertBefore(n, U(n)), n[\"s-ol\"].remove(), n[\"s-ol\"] = void 0, n[\"s-sh\"] = void 0, N = !0), e && A(n, e);\n }\n x.$flags$ &= -2;\n}, ee = (t, e, s, r, n, l) => {\n let o = t[\"s-cr\"] && t[\"s-cr\"].parentNode || t, c;\n for (o.shadowRoot && o.tagName === m && (o = o.shadowRoot); n <= l; ++n)\n r[n] && (c = O(null, s, n, t), c && (r[n].$elm$ = c, o.insertBefore(c, U(e))));\n}, te = (t, e, s) => {\n for (let r = e; r <= s; ++r) {\n const n = t[r];\n if (n) {\n const l = n.$elm$;\n le(n), l && (R = !0, l[\"s-ol\"] ? l[\"s-ol\"].remove() : A(l, !0), l.remove());\n }\n }\n}, xe = (t, e, s, r, n = !1) => {\n let l = 0, o = 0, c = 0, i = 0, d = e.length - 1, u = e[0], a = e[d], $ = r.length - 1, f = r[0], g = r[$], v, y;\n for (; l <= d && o <= $; )\n if (u == null)\n u = e[++l];\n else if (a == null)\n a = e[--d];\n else if (f == null)\n f = r[++o];\n else if (g == null)\n g = r[--$];\n else if (E(u, f, n))\n T(u, f, n), u = e[++l], f = r[++o];\n else if (E(a, g, n))\n T(a, g, n), a = e[--d], g = r[--$];\n else if (E(u, g, n))\n (u.$tag$ === \"slot\" || g.$tag$ === \"slot\") && A(u.$elm$.parentNode, !1), T(u, g, n), t.insertBefore(u.$elm$, a.$elm$.nextSibling), u = e[++l], g = r[--$];\n else if (E(a, f, n))\n (u.$tag$ === \"slot\" || g.$tag$ === \"slot\") && A(a.$elm$.parentNode, !1), T(a, f, n), t.insertBefore(a.$elm$, u.$elm$), a = e[--d], f = r[++o];\n else {\n for (c = -1, i = l; i <= d; ++i)\n if (e[i] && e[i].$key$ !== null && e[i].$key$ === f.$key$) {\n c = i;\n break;\n }\n c >= 0 ? (y = e[c], y.$tag$ !== f.$tag$ ? v = O(e && e[o], s, c, t) : (T(y, f, n), e[c] = void 0, v = y.$elm$), f = r[++o]) : (v = O(e && e[o], s, o, t), f = r[++o]), v && se(u.$elm$).insertBefore(v, U(u.$elm$));\n }\n l > d ? ee(t, r[$ + 1] == null ? null : r[$ + 1].$elm$, s, r, o, $) : o > $ && te(e, l, d);\n}, E = (t, e, s = !1) => t.$tag$ === e.$tag$ ? t.$tag$ === \"slot\" ? t.$name$ === e.$name$ : s ? !0 : t.$key$ === e.$key$ : !1, U = (t) => t && t[\"s-ol\"] || t, se = (t) => (t[\"s-ol\"] ? t[\"s-ol\"] : t).parentNode, T = (t, e, s = !1) => {\n const r = e.$elm$ = t.$elm$, n = t.$children$, l = e.$children$, o = e.$tag$, c = e.$text$;\n let i;\n c === null ? (h = o === \"svg\" ? !0 : o === \"foreignObject\" ? !1 : h, o === \"slot\" && !B || V(t, e, h), n !== null && l !== null ? xe(r, n, e, l, s) : l !== null ? (t.$text$ !== null && (r.textContent = \"\"), ee(r, null, e, l, 0, l.length - 1)) : n !== null && te(n, 0, n.length - 1), h && o === \"svg\" && (h = !1)) : (i = r[\"s-cr\"]) ? i.parentNode.textContent = c : t.$text$ !== c && (r.data = c);\n}, re = (t) => {\n const e = t.childNodes;\n for (const s of e)\n if (s.nodeType === 1) {\n if (s[\"s-sr\"]) {\n const r = s[\"s-sn\"];\n s.hidden = !1;\n for (const n of e)\n if (n !== s) {\n if (n[\"s-hn\"] !== s[\"s-hn\"] || r !== \"\") {\n if (n.nodeType === 1 && (r === n.getAttribute(\"slot\") || r === n[\"s-sn\"])) {\n s.hidden = !0;\n break;\n }\n } else if (n.nodeType === 1 || n.nodeType === 3 && n.textContent.trim() !== \"\") {\n s.hidden = !0;\n break;\n }\n }\n }\n re(s);\n }\n}, S = [], ne = (t) => {\n let e, s, r;\n for (const n of t.childNodes) {\n if (n[\"s-sr\"] && (e = n[\"s-cr\"]) && e.parentNode) {\n s = e.parentNode.childNodes;\n const l = n[\"s-sn\"];\n for (r = s.length - 1; r >= 0; r--)\n if (e = s[r], !e[\"s-cn\"] && !e[\"s-nr\"] && e[\"s-hn\"] !== n[\"s-hn\"] && !_.experimentalSlotFixes)\n if (w(e, l)) {\n let o = S.find((c) => c.$nodeToRelocate$ === e);\n R = !0, e[\"s-sn\"] = e[\"s-sn\"] || l, o ? (o.$nodeToRelocate$[\"s-sh\"] = n[\"s-hn\"], o.$slotRefNode$ = n) : (e[\"s-sh\"] = n[\"s-hn\"], S.push({\n $slotRefNode$: n,\n $nodeToRelocate$: e\n })), e[\"s-sr\"] && S.map((c) => {\n w(c.$nodeToRelocate$, e[\"s-sn\"]) && (o = S.find((i) => i.$nodeToRelocate$ === e), o && !c.$slotRefNode$ && (c.$slotRefNode$ = o.$slotRefNode$));\n });\n } else\n S.some((o) => o.$nodeToRelocate$ === e) || S.push({\n $nodeToRelocate$: e\n });\n }\n n.nodeType === 1 && ne(n);\n }\n}, w = (t, e) => t.nodeType === 1 ? t.getAttribute(\"slot\") === null && e === \"\" || t.getAttribute(\"slot\") === e : t[\"s-sn\"] === e ? !0 : e === \"\", le = (t) => {\n t.$attrs$ && t.$attrs$.ref && t.$attrs$.ref(null), t.$children$ && t.$children$.map(le);\n}, Ae = (t, e, s = !1) => {\n var r, n, l, o, c;\n const i = t.$hostElement$, d = t.$cmpMeta$, u = t.$vnode$ || M(null, null), a = Se(e) ? e : Y(null, null, e);\n if (m = i.tagName, d.$attrsToReflect$ && (a.$attrs$ = a.$attrs$ || {}, d.$attrsToReflect$.map(([$, f]) => a.$attrs$[f] = i[$])), s && a.$attrs$)\n for (const $ of Object.keys(a.$attrs$))\n i.hasAttribute($) && ![\"key\", \"ref\", \"style\", \"class\"].includes($) && (a.$attrs$[$] = i[$]);\n a.$tag$ = null, a.$flags$ |= 4, t.$vnode$ = a, a.$elm$ = u.$elm$ = i.shadowRoot || i, k = i[\"s-sc\"], B = (d.$flags$ & 1) !== 0, D = i[\"s-cr\"], R = !1, T(u, a, s);\n {\n if (x.$flags$ |= 1, N) {\n ne(a.$elm$);\n for (const $ of S) {\n const f = $.$nodeToRelocate$;\n if (!f[\"s-ol\"]) {\n const g = j.createTextNode(\"\");\n g[\"s-nr\"] = f, f.parentNode.insertBefore(f[\"s-ol\"] = g, f);\n }\n }\n for (const $ of S) {\n const f = $.$nodeToRelocate$, g = $.$slotRefNode$;\n if (g) {\n const v = g.parentNode;\n let y = g.nextSibling;\n {\n let L = (r = f[\"s-ol\"]) === null || r === void 0 ? void 0 : r.previousSibling;\n for (; L; ) {\n let b = (n = L[\"s-nr\"]) !== null && n !== void 0 ? n : null;\n if (b && b[\"s-sn\"] === f[\"s-sn\"] && v === b.parentNode && (b = b.nextSibling, !b || !b[\"s-nr\"])) {\n y = b;\n break;\n }\n L = L.previousSibling;\n }\n }\n (!y && v !== f.parentNode || f.nextSibling !== y) && f !== y && (!f[\"s-hn\"] && f[\"s-ol\"] && (f[\"s-hn\"] = f[\"s-ol\"].parentNode.nodeName), v.insertBefore(f, y), f.nodeType === 1 && (f.hidden = (l = f[\"s-ih\"]) !== null && l !== void 0 ? l : !1)), f && typeof g[\"s-rf\"] == \"function\" && g[\"s-rf\"](f);\n } else\n f.nodeType === 1 && (s && (f[\"s-ih\"] = (o = f.hidden) !== null && o !== void 0 ? o : !1), f.hidden = !0);\n }\n }\n R && re(a.$elm$), x.$flags$ &= -2, S.length = 0;\n }\n if (_.experimentalScopedSlotChanges && d.$flags$ & 2)\n for (const $ of a.$elm$.childNodes)\n $[\"s-hn\"] !== m && !$[\"s-sh\"] && (s && $[\"s-ih\"] == null && ($[\"s-ih\"] = (c = $.hidden) !== null && c !== void 0 ? c : !1), $.hidden = !0);\n D = void 0;\n}, G = (t, e) => e in t, C = typeof window < \"u\" ? window : {}, j = C.document || { head: {} };\nC.HTMLElement;\nconst x = {\n $flags$: 0,\n $resourcesUrl$: \"\",\n jmp: (t) => t(),\n raf: (t) => requestAnimationFrame(t),\n ael: (t, e, s, r) => t.addEventListener(e, s, r),\n rel: (t, e, s, r) => t.removeEventListener(e, s, r),\n ce: (t, e) => new CustomEvent(t, e)\n}, Le = (t, e, s) => {\n [null, void 0, \"\", !1].includes(s) || [\"innerHTML\", \"style\"].includes(e) || t.setAttribute(e, [\"object\", \"function\"].includes(typeof s) ? \"/!\\\\ Object props are not rendered in the code example\" : s);\n}, oe = (t, e, s, r, n) => {\n if (e && typeof e == \"string\") {\n const l = document.createElement(e);\n Object.keys(s || {}).forEach((o) => {\n Le(l, o, s[o]);\n }), r == null || r.forEach((o) => {\n oe(l, o.$tag$, o.$attrs$, o.$children$, o.$text$);\n }), s != null && s.innerHTML && (l.innerHTML = s.innerHTML), t.appendChild(l);\n }\n n && (t.innerHTML = n);\n}, Ge = (t, e) => {\n const s = {};\n if (typeof t != \"object\")\n throw new Error(\"filterArgs - args isn't an object.\");\n for (const r in t)\n if (!r.startsWith(\"slot\")) {\n const n = t[r], l = r.replace(/([a-z])([A-Z])/g, \"$1-$2\").toLowerCase();\n (!e || !Object.keys(e).includes(r) || e[r] !== n) && (s[l] = n);\n }\n return s;\n}, Ie = (t, e) => {\n var r, n;\n const s = document.getElementById(\"storybook-root\");\n if (s)\n return (n = document.querySelector(\"[lang]\")) == null || n.setAttribute(\"lang\", ((r = e.globals) == null ? void 0 : r.locale) || \"en\"), Ae(\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 t(e)\n ), s.children[s.children.length - 1];\n}, Xe = ({ $tag$: t, $attrs$: e, $children$: s, $text$: r }) => {\n const n = document.createElement(\"div\");\n return oe(n, t, e, s, r), n.innerHTML;\n}, Ke = ({ disconnect: t, observe: e, takeRecords: s }) => {\n class r {\n constructor(l) {\n /**\n *\n */\n p(this, \"disconnect\", t);\n /**\n *\n */\n p(this, \"observe\", e);\n /**\n *\n */\n p(this, \"takeRecords\", s);\n /**\n *\n */\n p(this, \"cb\");\n this.cb = l;\n }\n }\n return [window, global].forEach((n) => {\n Object.defineProperty(n, \"MutationObserver\", {\n writable: !0,\n configurable: !0,\n value: r\n });\n }), r;\n}, Qe = ({ disconnect: t, observe: e }) => {\n class s {\n constructor(n) {\n /**\n *\n */\n p(this, \"disconnect\", t);\n /**\n *\n */\n p(this, \"observe\", e);\n /**\n *\n */\n p(this, \"unobserve\");\n /**\n *\n */\n p(this, \"cb\");\n this.cb = n;\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 Ee extends Event {\n constructor() {\n super(...arguments);\n /**\n *\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n p(this, \"detail\");\n }\n}\nconst Je = () => {\n class t extends Ee {\n }\n return [window, global].forEach((e) => {\n Object.defineProperty(e, \"SubmitEvent\", {\n writable: !0,\n configurable: !0,\n value: t\n });\n }), t;\n};\nexport {\n Me as ClassList,\n Oe as allItemsAreString,\n Ne as cleanString,\n Re as createID,\n de as dateRegExp,\n We as dateToString,\n we as defineLocales,\n Ge as filterArgs,\n De as focusableElements,\n Pe as getLocaleDatePattern,\n I as getParentWindows,\n Xe as getStoryHTML,\n _e as getWindows,\n Fe as isTagName,\n Be as isValidString,\n ze as localeCurrency,\n ge as localeDate,\n qe as localeNumber,\n Ue as nextTick,\n Ke as setupMutationObserverMock,\n Qe as setupResizeObserverMock,\n Je as setupSubmitEventMock,\n Ie as stencilWrapper,\n He as vsCodeGenerator,\n Ce 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;AAC/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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e ? ce(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;\nvar h = (e, t, s) => (ae(e, typeof t != \"symbol\" ? t + \"\" : t, s), s);\nconst Me = (e = \"\", t = 10) => {\n const s = new Uint8Array(t);\n crypto.getRandomValues(s);\n const r = Array.from(s).map((n) => n.toString(16).padStart(2, \"0\")).join(\"\").slice(0, t);\n return e !== \"\" ? `${e}-${r}` : r;\n};\nclass Oe {\n constructor(t = []) {\n /**\n * Available classes\n */\n h(this, \"classes\");\n /**\n * Add class\n * @param className - class name to add\n */\n h(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 h(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 h(this, \"has\", (t) => this.classes.includes(t));\n /**\n * Join classes seperated by spaces\n * @returns joined values\n */\n h(this, \"join\", () => this.classes.join(\" \"));\n this.classes = t;\n }\n}\nconst Fe = (e) => Array.isArray(e) && e.every((t) => typeof t == \"string\"), De = (e, t) => t.includes(e == null ? void 0 : e.tagName.toLowerCase()), _e = 'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex=\"-1\"]), [identifier], mg-button', Be = (e) => {\n const t = X(e), s = K(e);\n return [e, ...t, ...s];\n}, X = (e, t = []) => {\n if (e.self !== e.top)\n try {\n const s = e.parent;\n return s ? (t.push(s), X(s, t)) : t;\n } catch (s) {\n return console.error(\"Different hosts between iframes:\", s), t;\n }\n return t;\n}, K = (e, t = []) => {\n if (e.frames.length > 0)\n for (const s of Array.from(e.frames))\n t.push(s), K(s, t);\n return t;\n}, Ne = (e) => typeof e == \"string\" && e.trim() !== \"\", Ue = (e) => typeof e == \"string\" ? e.toLocaleLowerCase().normalize(\"NFD\").replaceAll(/[\\u0300-\\u036f]/g, \"\") : e, Ce = async (e) => e(), Q = (e, t) => {\n if (!t)\n return;\n const s = t.split(\"/\");\n return `${e}${s.slice(2, s.length - 1).join(\"-\")}--docs`;\n}, fe = (e, t) => {\n if (t)\n return `${e}${t}`;\n}, J = (e) => {\n let t = e.overview ? `${e.overview}\n\n` : \"\";\n const s = e.props.filter(({ attr: n }) => n !== void 0);\n s.length && (t += `Attributes:\n`, t += s.map(({ attr: n, docs: l }) => `- \\`${n}\\`: ${l}\n`).join(\"\"), t += `\n`);\n const r = e.props.filter(({ attr: n }) => n === void 0);\n return r.length && (t += `Properties:\n`, t += r.map(({ name: n, docs: l }) => `- \\`${n}\\`: ${l}\n`).join(\"\"), t += `\n`), e.methods.length && (t += `Methods:\n`, t += e.methods.map(({ name: n, docs: l }) => `- \\`${n}\\`: ${l}\n`).join(\"\"), t += `\n`), e.events.length && (t += `Events:\n`, t += e.events.map(({ event: n, docs: l }) => `- \\`${n}\\`: ${l}\n`).join(\"\"), t += `\n`), e.listeners.length && (t += `Listeners:\n`, t += e.listeners.map(({ event: n }) => `- \\`${n}\\`\n`).join(\"\"), t += `\n`), e.slots.length && (t += `Slots:\n`, t += e.slots.map(({ name: n, docs: l }) => `- \\`${n}\\`: ${l}\n`).join(\"\"), t += `\n`), t;\n}, F = (e) => `${e.docs}\n\nType: \\`${e.type}\\``, He = (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((n) => {\n const l = Q(r, n.filePath);\n return {\n name: n.tag,\n description: J(n),\n \"doc-url\": l,\n attributes: n.props.filter((o) => o.attr).map((o) => ({\n name: o.attr,\n description: F(o),\n \"doc-url\": l,\n value: {\n type: o.type,\n default: o.default,\n required: o.required\n }\n })),\n js: {\n properties: n.props.map((o) => ({\n name: o.name,\n description: F(o),\n \"doc-url\": l,\n value: {\n type: o.type,\n default: o.default,\n required: o.required\n }\n })),\n events: n.events.map((o) => ({\n name: o.event,\n description: o.docs\n }))\n }\n };\n })\n }\n }\n}), $e = (e, t, s) => {\n if (s)\n return [\n { name: \"Storybook\", url: Q(e, s) },\n { name: \"Sources\", url: fe(t, s) }\n ];\n}, ue = (e) => {\n if (!e.values.some(({ value: t }) => t === void 0))\n return e.values.map(({ value: t }) => ({ name: t }));\n}, Pe = (e, t, s, r) => ({\n version: e,\n tags: t.components.map((n) => {\n const l = $e(s, r, n.filePath);\n return {\n name: n.tag,\n description: J(n),\n attributes: n.props.map((o) => ({\n name: o.attr || o.name,\n description: F(o),\n values: ue(o),\n references: l\n })),\n references: l\n };\n }),\n globalAttributes: [],\n valueSets: []\n}), We = (e) => {\n const t = { value: \"2023\", pattern: \"yyyy\" }, s = { value: \"12\", pattern: \"mm\" }, r = { value: \"24\", pattern: \"dd\" };\n return pe([t.value, s.value, r.value].join(\"-\"), e).replace(t.value, t.pattern).replace(s.value, s.pattern).replace(r.value, r.pattern);\n}, ze = (e) => e.toISOString().split(\"T\")[0], de = (e, t, s) => {\n const r = e.closest(\"[lang]\"), n = Intl.NumberFormat.supportedLocalesOf(r == null ? void 0 : r.lang), l = n.length > 0 && typeof n[0] == \"string\" ? n[0] : navigator.language || s, o = l.split(\"-\").shift();\n return {\n locale: l,\n messages: t[o] || t[s]\n };\n}, qe = (e, t, s) => new Intl.NumberFormat(t, { style: \"currency\", currency: s }).format(e), we = (e, t, s = 0) => new Intl.NumberFormat(t, { minimumFractionDigits: s }).format(s > 0 ? Number(e == null ? void 0 : e.toFixed(s)) : e), ge = /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$/, pe = (e, t) => typeof e != \"string\" || e === \"\" || !ge.test(e) ? \"\" : new Intl.DateTimeFormat(t).format(new Date(e)), Ge = (e, t) => (s) => de(s, e, t), _ = {\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 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: !1,\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};\nlet k, D, x, B = !1, R = !1, N = !1, y = !1;\nconst H = \"http://www.w3.org/1999/xlink\", P = {}, he = \"http://www.w3.org/2000/svg\", ye = \"http://www.w3.org/1999/xhtml\", ve = (e) => e != null, Y = (e) => (e = typeof e, e === \"object\" || e === \"function\"), Z = (e, t, ...s) => {\n let r = null, n = null, l = null, o = !1, c = !1;\n const i = [], d = (f) => {\n for (let $ = 0; $ < f.length; $++)\n r = f[$], Array.isArray(r) ? d(r) : r != null && typeof r != \"boolean\" && ((o = typeof e != \"function\" && !Y(r)) && (r = String(r)), o && c ? i[i.length - 1].$text$ += r : i.push(o ? M(null, r) : r), c = o);\n };\n if (d(s), t) {\n t.key && (n = t.key), t.name && (l = t.name);\n {\n const f = t.className || t.class;\n f && (t.class = typeof f != \"object\" ? f : Object.keys(f).filter(($) => f[$]).join(\" \"));\n }\n }\n if (typeof e == \"function\")\n return e(t === null ? {} : t, i, ke);\n const u = M(e, null);\n return u.$attrs$ = t, i.length > 0 && (u.$children$ = i), u.$key$ = n, u.$name$ = l, u;\n}, M = (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}, be = {}, Se = (e) => e && e.$tag$ === be, ke = {\n forEach: (e, t) => e.map(W).forEach(t),\n map: (e, t) => e.map(W).map(t).map(Te)\n}, W = (e) => ({\n vattrs: e.$attrs$,\n vchildren: e.$children$,\n vkey: e.$key$,\n vname: e.$name$,\n vtag: e.$tag$,\n vtext: e.$text$\n}), Te = (e) => {\n if (typeof e.vtag == \"function\") {\n const s = Object.assign({}, e.vattrs);\n return e.vkey && (s.key = e.vkey), e.vname && (s.name = e.vname), Z(e.vtag, s, ...e.vchildren || []);\n }\n const t = M(e.vtag, e.vtext);\n return t.$attrs$ = e.vattrs, t.$children$ = e.vchildren, t.$key$ = e.vkey, t.$name$ = e.vname, t;\n}, z = (e, t, s, r, n, l) => {\n if (s !== r) {\n let o = I(e, t), c = t.toLowerCase();\n if (t === \"class\") {\n const i = e.classList, d = q(s), u = q(r);\n i.remove(...d.filter((f) => f && !u.includes(f))), i.add(...u.filter((f) => f && !d.includes(f)));\n } else if (t === \"style\") {\n for (const i in s)\n (!r || r[i] == null) && (i.includes(\"-\") ? e.style.removeProperty(i) : e.style[i] = \"\");\n for (const i in r)\n (!s || r[i] !== s[i]) && (i.includes(\"-\") ? e.style.setProperty(i, r[i]) : e.style[i] = r[i]);\n } else if (t !== \"key\")\n 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) : I(C, c) ? t = c.slice(2) : t = c[2] + t.slice(3), s || r) {\n const i = t.endsWith(V);\n t = t.replace(me, \"\"), s && m.rel(e, t, s, i), r && m.ael(e, t, r, i);\n }\n } else {\n const i = Y(r);\n if ((o || i && r !== null) && !n)\n try {\n if (e.tagName.includes(\"-\"))\n e[t] = r;\n else {\n const u = r ?? \"\";\n t === \"list\" ? o = !1 : (s == null || e[t] != u) && (e[t] = u);\n }\n } catch {\n }\n let d = !1;\n c !== (c = c.replace(/^xlink\\:?/, \"\")) && (t = c, d = !0), r == null || r === !1 ? (r !== !1 || e.getAttribute(t) === \"\") && (d ? e.removeAttributeNS(H, t) : e.removeAttribute(t)) : (!o || l & 4 || n) && !i && (r = r === !0 ? \"\" : r, d ? e.setAttributeNS(H, t, r) : e.setAttribute(t, r));\n }\n }\n}, xe = /\\s/, q = (e) => e ? e.split(xe) : [], V = \"Capture\", me = new RegExp(V + \"$\"), ee = (e, t, s, r) => {\n const n = t.$elm$.nodeType === 11 && t.$elm$.host ? t.$elm$.host : t.$elm$, l = e && e.$attrs$ || P, o = t.$attrs$ || P;\n for (r of w(Object.keys(l)))\n r in o || z(n, r, l[r], void 0, s, t.$flags$);\n for (r of w(Object.keys(o)))\n z(n, r, l[r], o[r], s, t.$flags$);\n};\nfunction w(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}\nconst O = (e, t, s, r) => {\n var n;\n const l = t.$children$[s];\n let o = 0, c, i, d;\n if (B || (N = !0, l.$tag$ === \"slot\" && (k && r.classList.add(k + \"-s\"), l.$flags$ |= l.$children$ ? (\n // slot element has fallback content\n 2\n ) : (\n // slot element does not have fallback content\n 1\n ))), l.$text$ !== null)\n c = l.$elm$ = j.createTextNode(l.$text$);\n else if (l.$flags$ & 1)\n c = l.$elm$ = j.createTextNode(\"\");\n else {\n if (y || (y = l.$tag$ === \"svg\"), c = l.$elm$ = j.createElementNS(y ? he : ye, l.$flags$ & 2 ? \"slot-fb\" : l.$tag$), y && l.$tag$ === \"foreignObject\" && (y = !1), ee(null, l, y), ve(k) && c[\"s-si\"] !== k && c.classList.add(c[\"s-si\"] = k), l.$children$)\n for (o = 0; o < l.$children$.length; ++o)\n i = O(e, l, o, c), i && c.appendChild(i);\n l.$tag$ === \"svg\" ? y = !1 : c.tagName === \"foreignObject\" && (y = !0);\n }\n return c[\"s-hn\"] = x, l.$flags$ & 3 && (c[\"s-sr\"] = !0, c[\"s-cr\"] = D, c[\"s-sn\"] = l.$name$ || \"\", c[\"s-rf\"] = (n = l.$attrs$) === null || n === void 0 ? void 0 : n.ref, d = e && e.$children$ && e.$children$[s], d && d.$tag$ === l.$tag$ && e.$elm$ && A(e.$elm$, !1)), c;\n}, A = (e, t) => {\n m.$flags$ |= 1;\n const s = Array.from(e.childNodes);\n if (e[\"s-sr\"] && _.experimentalSlotFixes) {\n let r = e;\n for (; r = r.nextSibling; )\n r && r[\"s-sn\"] === e[\"s-sn\"] && r[\"s-sh\"] === x && s.push(r);\n }\n for (let r = s.length - 1; r >= 0; r--) {\n const n = s[r];\n n[\"s-hn\"] !== x && n[\"s-ol\"] && (re(n).insertBefore(n, U(n)), n[\"s-ol\"].remove(), n[\"s-ol\"] = void 0, n[\"s-sh\"] = void 0, N = !0), t && A(n, t);\n }\n m.$flags$ &= -2;\n}, te = (e, t, s, r, n, l) => {\n let o = e[\"s-cr\"] && e[\"s-cr\"].parentNode || e, c;\n for (o.shadowRoot && o.tagName === x && (o = o.shadowRoot); n <= l; ++n)\n r[n] && (c = O(null, s, n, e), c && (r[n].$elm$ = c, o.insertBefore(c, U(t))));\n}, se = (e, t, s) => {\n for (let r = t; r <= s; ++r) {\n const n = e[r];\n if (n) {\n const l = n.$elm$;\n oe(n), l && (R = !0, l[\"s-ol\"] ? l[\"s-ol\"].remove() : A(l, !0), l.remove());\n }\n }\n}, Ae = (e, t, s, r, n = !1) => {\n let l = 0, o = 0, c = 0, i = 0, d = t.length - 1, u = t[0], f = t[d], $ = r.length - 1, a = r[0], g = r[$], b, v;\n for (; l <= d && o <= $; )\n if (u == null)\n u = t[++l];\n else if (f == null)\n f = t[--d];\n else if (a == null)\n a = r[++o];\n else if (g == null)\n g = r[--$];\n else if (E(u, a, n))\n T(u, a, n), u = t[++l], a = r[++o];\n else if (E(f, g, n))\n T(f, g, n), f = t[--d], g = r[--$];\n else if (E(u, g, n))\n (u.$tag$ === \"slot\" || g.$tag$ === \"slot\") && A(u.$elm$.parentNode, !1), T(u, g, n), e.insertBefore(u.$elm$, f.$elm$.nextSibling), u = t[++l], g = r[--$];\n else if (E(f, a, n))\n (u.$tag$ === \"slot\" || g.$tag$ === \"slot\") && A(f.$elm$.parentNode, !1), T(f, a, n), e.insertBefore(f.$elm$, u.$elm$), f = t[--d], a = r[++o];\n else {\n for (c = -1, i = l; i <= d; ++i)\n if (t[i] && t[i].$key$ !== null && t[i].$key$ === a.$key$) {\n c = i;\n break;\n }\n c >= 0 ? (v = t[c], v.$tag$ !== a.$tag$ ? b = O(t && t[o], s, c, e) : (T(v, a, n), t[c] = void 0, b = v.$elm$), a = r[++o]) : (b = O(t && t[o], s, o, e), a = r[++o]), b && re(u.$elm$).insertBefore(b, U(u.$elm$));\n }\n l > d ? te(e, r[$ + 1] == null ? null : r[$ + 1].$elm$, s, r, o, $) : o > $ && se(t, l, d);\n}, E = (e, t, s = !1) => e.$tag$ === t.$tag$ ? e.$tag$ === \"slot\" ? e.$name$ === t.$name$ : s ? !0 : e.$key$ === t.$key$ : !1, U = (e) => e && e[\"s-ol\"] || e, re = (e) => (e[\"s-ol\"] ? e[\"s-ol\"] : e).parentNode, T = (e, t, s = !1) => {\n const r = t.$elm$ = e.$elm$, n = e.$children$, l = t.$children$, o = t.$tag$, c = t.$text$;\n let i;\n c === null ? (y = o === \"svg\" ? !0 : o === \"foreignObject\" ? !1 : y, o === \"slot\" && !B || ee(e, t, y), n !== null && l !== null ? Ae(r, n, t, l, s) : l !== null ? (e.$text$ !== null && (r.textContent = \"\"), te(r, null, t, l, 0, l.length - 1)) : n !== null && se(n, 0, n.length - 1), y && o === \"svg\" && (y = !1)) : (i = r[\"s-cr\"]) ? i.parentNode.textContent = c : e.$text$ !== c && (r.data = c);\n}, ne = (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 n of t)\n if (n !== s) {\n if (n[\"s-hn\"] !== s[\"s-hn\"] || r !== \"\") {\n if (n.nodeType === 1 && (r === n.getAttribute(\"slot\") || r === n[\"s-sn\"])) {\n s.hidden = !0;\n break;\n }\n } else if (n.nodeType === 1 || n.nodeType === 3 && n.textContent.trim() !== \"\") {\n s.hidden = !0;\n break;\n }\n }\n }\n ne(s);\n }\n}, S = [], le = (e) => {\n let t, s, r;\n for (const n of e.childNodes) {\n if (n[\"s-sr\"] && (t = n[\"s-cr\"]) && t.parentNode) {\n s = t.parentNode.childNodes;\n const l = n[\"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\"] !== n[\"s-hn\"] && !_.experimentalSlotFixes)\n if (G(t, l)) {\n let o = S.find((c) => c.$nodeToRelocate$ === t);\n R = !0, t[\"s-sn\"] = t[\"s-sn\"] || l, o ? (o.$nodeToRelocate$[\"s-sh\"] = n[\"s-hn\"], o.$slotRefNode$ = n) : (t[\"s-sh\"] = n[\"s-hn\"], S.push({\n $slotRefNode$: n,\n $nodeToRelocate$: t\n })), t[\"s-sr\"] && S.map((c) => {\n G(c.$nodeToRelocate$, t[\"s-sn\"]) && (o = S.find((i) => i.$nodeToRelocate$ === t), o && !c.$slotRefNode$ && (c.$slotRefNode$ = o.$slotRefNode$));\n });\n } else\n S.some((o) => o.$nodeToRelocate$ === t) || S.push({\n $nodeToRelocate$: t\n });\n }\n n.nodeType === 1 && le(n);\n }\n}, G = (e, t) => e.nodeType === 1 ? e.getAttribute(\"slot\") === null && t === \"\" || e.getAttribute(\"slot\") === t : e[\"s-sn\"] === t ? !0 : t === \"\", oe = (e) => {\n e.$attrs$ && e.$attrs$.ref && e.$attrs$.ref(null), e.$children$ && e.$children$.map(oe);\n}, Le = (e, t, s = !1) => {\n var r, n, l, o, c;\n const i = e.$hostElement$, d = e.$cmpMeta$, u = e.$vnode$ || M(null, null), f = Se(t) ? t : Z(null, null, t);\n if (x = i.tagName, d.$attrsToReflect$ && (f.$attrs$ = f.$attrs$ || {}, d.$attrsToReflect$.map(([$, a]) => f.$attrs$[a] = i[$])), s && f.$attrs$)\n for (const $ of Object.keys(f.$attrs$))\n i.hasAttribute($) && ![\"key\", \"ref\", \"style\", \"class\"].includes($) && (f.$attrs$[$] = i[$]);\n f.$tag$ = null, f.$flags$ |= 4, e.$vnode$ = f, f.$elm$ = u.$elm$ = i.shadowRoot || i, k = i[\"s-sc\"], B = (d.$flags$ & 1) !== 0, D = i[\"s-cr\"], R = !1, T(u, f, s);\n {\n if (m.$flags$ |= 1, N) {\n le(f.$elm$);\n for (const $ of S) {\n const a = $.$nodeToRelocate$;\n if (!a[\"s-ol\"]) {\n const g = j.createTextNode(\"\");\n g[\"s-nr\"] = a, a.parentNode.insertBefore(a[\"s-ol\"] = g, a);\n }\n }\n for (const $ of S) {\n const a = $.$nodeToRelocate$, g = $.$slotRefNode$;\n if (g) {\n const b = g.parentNode;\n let v = g.nextSibling;\n {\n let L = (r = a[\"s-ol\"]) === null || r === void 0 ? void 0 : r.previousSibling;\n for (; L; ) {\n let p = (n = L[\"s-nr\"]) !== null && n !== void 0 ? n : null;\n if (p && p[\"s-sn\"] === a[\"s-sn\"] && b === p.parentNode) {\n for (p = p.nextSibling; p === a || p != null && p[\"s-sr\"]; )\n p = p == null ? void 0 : p.nextSibling;\n if (!p || !p[\"s-nr\"]) {\n v = p;\n break;\n }\n }\n L = L.previousSibling;\n }\n }\n (!v && b !== a.parentNode || a.nextSibling !== v) && a !== v && (!a[\"s-hn\"] && a[\"s-ol\"] && (a[\"s-hn\"] = a[\"s-ol\"].parentNode.nodeName), b.insertBefore(a, v), a.nodeType === 1 && (a.hidden = (l = a[\"s-ih\"]) !== null && l !== void 0 ? l : !1)), a && typeof g[\"s-rf\"] == \"function\" && g[\"s-rf\"](a);\n } else\n a.nodeType === 1 && (s && (a[\"s-ih\"] = (o = a.hidden) !== null && o !== void 0 ? o : !1), a.hidden = !0);\n }\n }\n R && ne(f.$elm$), m.$flags$ &= -2, S.length = 0;\n }\n if (_.experimentalScopedSlotChanges && d.$flags$ & 2)\n for (const $ of f.$elm$.childNodes)\n $[\"s-hn\"] !== x && !$[\"s-sh\"] && (s && $[\"s-ih\"] == null && ($[\"s-ih\"] = (c = $.hidden) !== null && c !== void 0 ? c : !1), $.hidden = !0);\n D = void 0;\n}, I = (e, t) => t in e, C = typeof window < \"u\" ? window : {}, j = C.document || { head: {} };\nC.HTMLElement;\nconst m = {\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}, Ee = (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}, ie = (e, t, s, r, n) => {\n if (t && typeof t == \"string\") {\n const l = document.createElement(t);\n Object.keys(s || {}).forEach((o) => {\n Ee(l, o, s[o]);\n }), r == null || r.forEach((o) => {\n ie(l, o.$tag$, o.$attrs$, o.$children$, o.$text$);\n }), s != null && s.innerHTML && (l.innerHTML = s.innerHTML), e.appendChild(l);\n }\n n && (e.innerHTML = n);\n}, Ie = (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 n = e[r], l = r.replace(/([a-z])([A-Z])/g, \"$1-$2\").toLowerCase();\n (!t || !Object.keys(t).includes(r) || t[r] !== n) && (s[l] = n);\n }\n return s;\n}, Xe = (e, t) => {\n var r, n;\n const s = document.getElementById(\"storybook-root\");\n if (s)\n return (n = document.querySelector(\"[lang]\")) == null || n.setAttribute(\"lang\", ((r = t.globals) == null ? void 0 : r.locale) || \"en\"), Le(\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}, Ke = ({ $tag$: e, $attrs$: t, $children$: s, $text$: r }) => {\n const n = document.createElement(\"div\");\n return ie(n, e, t, s, r), n.innerHTML;\n}, Qe = ({ disconnect: e, observe: t, takeRecords: s }) => {\n class r {\n constructor(l) {\n /**\n *\n */\n h(this, \"disconnect\", e);\n /**\n *\n */\n h(this, \"observe\", t);\n /**\n *\n */\n h(this, \"takeRecords\", s);\n /**\n *\n */\n h(this, \"cb\");\n this.cb = l;\n }\n }\n return [window, global].forEach((n) => {\n Object.defineProperty(n, \"MutationObserver\", {\n writable: !0,\n configurable: !0,\n value: r\n });\n }), r;\n}, Je = ({ disconnect: e, observe: t }) => {\n class s {\n constructor(n) {\n /**\n *\n */\n h(this, \"disconnect\", e);\n /**\n *\n */\n h(this, \"observe\", t);\n /**\n *\n */\n h(this, \"unobserve\");\n /**\n *\n */\n h(this, \"cb\");\n this.cb = n;\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 je extends Event {\n constructor() {\n super(...arguments);\n /**\n *\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n h(this, \"detail\");\n }\n}\nconst Ye = () => {\n class e extends je {\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 Oe as ClassList,\n Fe as allItemsAreString,\n Ue as cleanString,\n Me as createID,\n ge as dateRegExp,\n ze as dateToString,\n Ge as defineLocales,\n Ie as filterArgs,\n _e as focusableElements,\n We as getLocaleDatePattern,\n X as getParentWindows,\n Ke as getStoryHTML,\n Be as getWindows,\n De as isTagName,\n Ne as isValidString,\n qe as localeCurrency,\n pe as localeDate,\n we as localeNumber,\n Ce as nextTick,\n Qe as setupMutationObserverMock,\n Je as setupResizeObserverMock,\n Ye as setupSubmitEventMock,\n Xe as stencilWrapper,\n Pe as vsCodeGenerator,\n He as webTypesGenerator\n};\n//# sourceMappingURL=index.es.js.map\n"],"version":3}
@@ -1,4 +1,4 @@
1
- import { w as we } from './index.es.js';
1
+ import { G as Ge } from './index.es.js';
2
2
 
3
3
  const errors$1 = {
4
4
  required: "This field is required.",
@@ -249,7 +249,7 @@ const messages = { en, fr };
249
249
  * @param element - element we need to get the language
250
250
  * @returns messages object
251
251
  */
252
- const initLocales = we(messages, defaultLocale);
252
+ const initLocales = Ge(messages, defaultLocale);
253
253
 
254
254
  export { initLocales as i };
255
255
 
@@ -1,5 +1,5 @@
1
1
  import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
- import { R as Re } from './index.es.js';
2
+ import { M as Me } from './index.es.js';
3
3
  import { d as defineCustomElement$4, D as Direction, S as Status } from './mg-menu-item2.js';
4
4
  import { i as initLocales } from './index2.js';
5
5
  import { d as defineCustomElement$a } from './mg-badge2.js';
@@ -50,7 +50,7 @@ const MgActionMore$1 = /*@__PURE__*/ proxyCustomElement(class MgActionMore exten
50
50
  ************/
51
51
  this.name = 'mg-action-more';
52
52
  this.classBase = 'mg-c-action-more';
53
- this.mgPopoverIdentifier = Re(this.name);
53
+ this.mgPopoverIdentifier = Me(this.name);
54
54
  /************
55
55
  * Methods *
56
56
  ***********/
@@ -132,12 +132,12 @@ const MgActionMore$1 = /*@__PURE__*/ proxyCustomElement(class MgActionMore exten
132
132
  const buttonLabel = this.button.label || this.messages.label;
133
133
  const buttonContent = [buttonLabel];
134
134
  if (!this.button.isIcon && this.displayChevron) {
135
- buttonContent.push(h("span", { key: '9d7980e769806efa8da21b233aa8039fea6e1321', class: {
135
+ buttonContent.push(h("span", { class: {
136
136
  [`${this.classBase}__chevron`]: true,
137
137
  [`${this.classBase}__chevron--rotate`]: this.expanded === true,
138
- } }, h("mg-icon", { key: '40cd8ad011debcda6794b5a3f6ae6a42ea6c385d', icon: "chevron-down", size: "small" })));
138
+ } }, h("mg-icon", { icon: "chevron-down", size: "small" })));
139
139
  }
140
- return (h(Host, { key: '3a0959e16e76ab50c857e489ddb91a9ed9758fbd', "data-mg-popover-guard": this.mgPopoverIdentifier }, h("span", { key: '1e37a919b19563aab4333a94f1676cb6b9d60289', class: "mg-action-more" }, h("mg-popover", { key: 'd539fd10e3cf38774c05180e906b35840b37f11a', identifier: this.mgPopoverIdentifier, display: this.expanded, "onDisplay-change": this.handleDisplayChange }, h("mg-button", { key: 'e2fb983a112fe074ca9e9fd8629181274aaddd17', variant: this.button.variant, isIcon: this.button.isIcon, disabled: this.button.disabled, type: "button", label: buttonLabel, onClick: this.handleButton }, this.icon && h("mg-icon", Object.assign({}, this.icon)), !this.button.isIcon && buttonContent), h("div", { key: 'e09d81146a0d5188a90d4e1204852608ea74d433', slot: "content" }, h("mg-menu", { key: '00949f8628192c04d537ed9c4c4261b33fb06c71', direction: Direction.VERTICAL, label: this.messages.label }, this.items.map(item => {
140
+ return (h(Host, { key: '3833ffe89499015c991ac366c5bb87283948962b', "data-mg-popover-guard": this.mgPopoverIdentifier }, h("span", { key: '3393bfd576f5bbef7570090a5813a4eecc944559', class: "mg-action-more" }, h("mg-popover", { key: '6c589e9efbbfef4adba6f2c59eb3f562c621daf1', identifier: this.mgPopoverIdentifier, display: this.expanded, "onDisplay-change": this.handleDisplayChange }, h("mg-button", { key: '485538eb6f660de92c372ebd395e18ff7ef66c96', variant: this.button.variant, isIcon: this.button.isIcon, disabled: this.button.disabled, type: "button", label: buttonLabel, onClick: this.handleButton }, this.icon && h("mg-icon", Object.assign({ key: 'd385d7c69f118b8f20d59547357dad7d8a56766d' }, this.icon)), !this.button.isIcon && buttonContent), h("div", { key: '553f7704a5fc0b1a89062ce234607296d8bf53f2', slot: "content" }, h("mg-menu", { key: '4a161502b2d1dec2b17cd7c44cd492ec745cb7dd', direction: Direction.VERTICAL, label: this.messages.label }, this.items.map(item => {
141
141
  var _a;
142
142
  return (
143
143
  // eslint-disable-next-line react/jsx-no-bind
@@ -1 +1 @@
1
- {"file":"mg-action-more.js","mappings":";;;;;;;;;;;;AAAA,MAAM,eAAe,GAAG,gqBAAgqB,CAAC;AACzrB,2BAAe,eAAe;;ACO9B;;;;;AAKA,MAAM,mBAAmB,GAAG,CAAC,IAAa;IACxC,MAAM,KAAK,GAAG,IAA8B,CAAC;IAC7C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,IAAI,OAAO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AI;;YAAI;;YAEtB,oBACE,GAAG,EAAE,IAAI,CAAC,KAAK,EACf,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,OAAO,EACrC,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,OAAO,EAAE,CAAC,IAAI,IAAI,CAAC,eAAe,CAAC,CAAC,EAAE,IAAI,CAAC,iBAAiB,CAAC,IAE5D,IAAI,CAAC,IAAI,IAAI,eAAS,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAC,OAAO,GAAW,EAC/D,YAAM,IAAI,EAAC,OAAO,IAAE,IAAI,CAAC,KAAK,CAAQ,EACrC,CAAA,MAAA,IAAI,CAAC,KAAK,0CAAE,KAAK,KAAI,gBAAU,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,EAAC,aAAa,EAAC,OAAO,EAAC,YAAY,GAAY,CACxH,EAChB;SAAA,CAAC,CACM,CACN,CACK,CACR,CACF,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["MgActionMore","createID"],"sources":["../styles/dist/components/mg-action-more.css?tag=mg-action-more&encapsulation=shadow","src/components/molecules/mg-action-more/mg-action-more.tsx"],"sourcesContent":[".mg-u-visually-hidden{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip:rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;clip-path:inset(50%) !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media(prefers-reduced-motion){*{animation:none !important;transition:none !important}}:host{--mg-popover-padding-vertical: 1rem;--mg-popover-padding-horizontal: 0;--mg-popover-max-width: unset}.mg-c-action-more__chevron{transition:200ms}.mg-c-action-more__chevron--rotate.mg-c-action-more__chevron{transform:rotate(180deg)}/*# sourceMappingURL=mg-action-more.css.map */\n","import { Component, h, Element, Prop, Watch, State, Host } from '@stencil/core';\nimport { createID } from '@mgdis/stencil-helpers';\nimport { Status } from '../menu/mg-menu-item/mg-menu-item.conf';\nimport { Direction } from '../menu/mg-menu/mg-menu.conf';\nimport { initLocales } from '../../../locales';\nimport type { MessageType } from '../../../locales/index.conf';\nimport type { MgActionMoreItemType, MgActionMoreButtonType, MgActionMoreIconType } from './mg-action-more.conf';\n\n/**\n * MgActionMore['items'] type guard\n * @param prop - commponent items prop\n * @returns return true if type is valid\n */\nconst isMgActionMoreItems = (prop: unknown): prop is MgActionMoreItemType[] => {\n const items = prop as MgActionMoreItemType[];\n return typeof items === 'object' && items.every(item => typeof item === 'object' && typeof item.label === 'string' && typeof item.mouseEventHandler === 'function');\n};\n\n/**\n * MgActionMore['button'] type guard\n * @param prop - commponent button prop\n * @returns return true if type is valid\n */\nconst isMgActionMoreButton = (prop: unknown): prop is MgActionMoreButtonType => {\n const button = prop as MgActionMoreButtonType;\n return typeof button === 'object' && typeof button.variant === 'string' && typeof button.isIcon === 'boolean';\n};\n\n/**\n * MgActionMore['icon'] type guard\n * @param prop - commponent icon prop\n * @returns return true if type is valid\n */\nconst isMgActionMoreIcon = (prop: unknown): prop is MgActionMoreIconType => {\n const icon = prop as MgActionMoreIconType;\n return typeof icon === 'object' && typeof icon.icon === 'string';\n};\n\n@Component({\n tag: 'mg-action-more',\n styleUrl: '../../../../node_modules/@mgdis/styles/dist/components/mg-action-more.css',\n shadow: true,\n})\nexport class MgActionMore {\n /************\n * Internal *\n ************/\n\n private readonly name = 'mg-action-more';\n private readonly classBase = 'mg-c-action-more';\n private readonly mgPopoverIdentifier = createID(this.name);\n private messages: MessageType;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgActionMoreElement;\n\n /**\n * Define the menu-items elements\n */\n @Prop() items!: MgActionMoreItemType[];\n @Watch('items')\n validateItems(newValue: MgActionMore['items']): void {\n if (!isMgActionMoreItems(newValue)) {\n throw new Error(`<${this.name}> prop \"items\" is required and all values must be the same type, MgActionMoreItemType.`);\n }\n }\n\n /**\n * Define displayed icon\n */\n @Prop({ mutable: true }) icon?: MgActionMoreIconType;\n @Watch('icon')\n validateIcon(newValue: MgActionMore['icon']): void {\n if (newValue && !isMgActionMoreIcon(newValue)) {\n throw new Error(`<${this.name}> prop icon must match MgActionMoreIconType.`);\n } else if (!newValue?.icon && Boolean(this.button.isIcon)) {\n this.icon = { icon: 'ellipsis' };\n }\n }\n\n /**\n * Define button properties\n */\n @Prop() button?: MgActionMoreButtonType = { variant: 'flat', isIcon: true };\n @Watch('button')\n validateButton(newValue: MgActionMore['button']): void {\n if (newValue && !isMgActionMoreButton(newValue)) {\n throw new Error(`<${this.name}> prop button must match MgActionMoreButtonType.`);\n }\n }\n\n /**\n * Define if chevron is display\n */\n @Prop() displayChevron?: boolean;\n @Watch('displayChevron')\n validateDisplayChevron(newValue: MgActionMore['displayChevron']): void {\n if (newValue && this.button.isIcon === true) {\n throw new Error(`<${this.name}> prop \"displayChevron\" can't be used with a 'button\" prop \"isIcon\" attribute.`);\n }\n }\n /**\n * Menu expanded state\n */\n @State() expanded = false;\n\n /************\n * Methods *\n ***********/\n\n /**\n * Toggle expanded props\n */\n private toggleExpanded = (): void => {\n this.expanded = !this.expanded;\n };\n\n /**\n * Handle popover display change value\n * @param event - display change updated value\n */\n private handleDisplayChange = (event: CustomEvent): void => {\n this.expanded = event.detail;\n };\n\n /**\n * Button click handler\n */\n private handleButton = (): void => {\n this.toggleExpanded();\n };\n\n /**\n * Item click handler\n * @param event - click event\n * @param customHandler - item['mouseEventHandler']\n */\n private handleItemClick = (event: MouseEvent, customHandler: MgActionMoreItemType['mouseEventHandler']) => {\n this.expanded = false;\n customHandler(event);\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Validate props\n */\n componentWillLoad(): void {\n this.messages = initLocales(this.element).messages.actionMore as MessageType;\n this.validateItems(this.items);\n this.validateButton(this.button);\n this.validateIcon(this.icon);\n this.validateDisplayChevron(this.displayChevron);\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n const buttonLabel = this.button.label || this.messages.label;\n const buttonContent = [buttonLabel];\n\n if (!this.button.isIcon && this.displayChevron) {\n buttonContent.push(\n <span\n class={{\n [`${this.classBase}__chevron`]: true,\n [`${this.classBase}__chevron--rotate`]: this.expanded === true,\n }}\n >\n <mg-icon icon=\"chevron-down\" size=\"small\"></mg-icon>\n </span>,\n );\n }\n\n return (\n <Host data-mg-popover-guard={this.mgPopoverIdentifier}>\n <span class=\"mg-action-more\">\n <mg-popover identifier={this.mgPopoverIdentifier} display={this.expanded} onDisplay-change={this.handleDisplayChange}>\n <mg-button variant={this.button.variant} isIcon={this.button.isIcon} disabled={this.button.disabled} type=\"button\" label={buttonLabel} onClick={this.handleButton}>\n {this.icon && <mg-icon {...this.icon}></mg-icon>}\n {!this.button.isIcon && buttonContent}\n </mg-button>\n <div slot=\"content\">\n <mg-menu direction={Direction.VERTICAL} label={this.messages.label}>\n {this.items.map(item => (\n // eslint-disable-next-line react/jsx-no-bind\n <mg-menu-item\n key={item.label}\n status={item.status || Status.VISIBLE}\n target={item.target}\n href={item.href}\n onClick={e => this.handleItemClick(e, item.mouseEventHandler)}\n >\n {item.icon && <mg-icon icon={item.icon} slot=\"image\"></mg-icon>}\n <span slot=\"label\">{item.label}</span>\n {item.badge?.label && <mg-badge label={item.badge.label} value={item.badge.value} slot=\"information\" variant=\"text-color\"></mg-badge>}\n </mg-menu-item>\n ))}\n </mg-menu>\n </div>\n </mg-popover>\n </span>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"mg-action-more.js","mappings":";;;;;;;;;;;;AAAA,MAAM,eAAe,GAAG,gqBAAgqB,CAAC;AACzrB,2BAAe,eAAe;;ACO9B;;;;;AAKA,MAAM,mBAAmB,G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AC,MAAM,CAAC,MAAM,IAAI,aAAa,CAC3B,EACZ,4DAAK,IAAI,EAAC,SAAS,IACjB,gEAAS,SAAS,EAAE,SAAS,CAAC,QAAQ,EAAE,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,KAAK,IAC/D,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI;;YAAI;;YAEtB,oBACE,GAAG,EAAE,IAAI,CAAC,KAAK,EACf,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,OAAO,EACrC,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,OAAO,EAAE,CAAC,IAAI,IAAI,CAAC,eAAe,CAAC,CAAC,EAAE,IAAI,CAAC,iBAAiB,CAAC,IAE5D,IAAI,CAAC,IAAI,IAAI,eAAS,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAC,OAAO,GAAW,EAC/D,YAAM,IAAI,EAAC,OAAO,IAAE,IAAI,CAAC,KAAK,CAAQ,EACrC,CAAA,MAAA,IAAI,CAAC,KAAK,0CAAE,KAAK,KAAI,gBAAU,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,EAAC,aAAa,EAAC,OAAO,EAAC,YAAY,GAAY,CACxH,EAChB;SAAA,CAAC,CACM,CACN,CACK,CACR,CACF,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["MgActionMore","createID"],"sources":["../styles/dist/components/mg-action-more.css?tag=mg-action-more&encapsulation=shadow","src/components/molecules/mg-action-more/mg-action-more.tsx"],"sourcesContent":[".mg-u-visually-hidden{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip:rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;clip-path:inset(50%) !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media(prefers-reduced-motion){*{animation:none !important;transition:none !important}}:host{--mg-popover-padding-vertical: 1rem;--mg-popover-padding-horizontal: 0;--mg-popover-max-width: unset}.mg-c-action-more__chevron{transition:200ms}.mg-c-action-more__chevron--rotate.mg-c-action-more__chevron{transform:rotate(180deg)}/*# sourceMappingURL=mg-action-more.css.map */\n","import { Component, h, Element, Prop, Watch, State, Host } from '@stencil/core';\nimport { createID } from '@mgdis/stencil-helpers';\nimport { Status } from '../menu/mg-menu-item/mg-menu-item.conf';\nimport { Direction } from '../menu/mg-menu/mg-menu.conf';\nimport { initLocales } from '../../../locales';\nimport type { MessageType } from '../../../locales/index.conf';\nimport type { MgActionMoreItemType, MgActionMoreButtonType, MgActionMoreIconType } from './mg-action-more.conf';\n\n/**\n * MgActionMore['items'] type guard\n * @param prop - commponent items prop\n * @returns return true if type is valid\n */\nconst isMgActionMoreItems = (prop: unknown): prop is MgActionMoreItemType[] => {\n const items = prop as MgActionMoreItemType[];\n return typeof items === 'object' && items.every(item => typeof item === 'object' && typeof item.label === 'string' && typeof item.mouseEventHandler === 'function');\n};\n\n/**\n * MgActionMore['button'] type guard\n * @param prop - commponent button prop\n * @returns return true if type is valid\n */\nconst isMgActionMoreButton = (prop: unknown): prop is MgActionMoreButtonType => {\n const button = prop as MgActionMoreButtonType;\n return typeof button === 'object' && typeof button.variant === 'string' && typeof button.isIcon === 'boolean';\n};\n\n/**\n * MgActionMore['icon'] type guard\n * @param prop - commponent icon prop\n * @returns return true if type is valid\n */\nconst isMgActionMoreIcon = (prop: unknown): prop is MgActionMoreIconType => {\n const icon = prop as MgActionMoreIconType;\n return typeof icon === 'object' && typeof icon.icon === 'string';\n};\n\n@Component({\n tag: 'mg-action-more',\n styleUrl: '../../../../node_modules/@mgdis/styles/dist/components/mg-action-more.css',\n shadow: true,\n})\nexport class MgActionMore {\n /************\n * Internal *\n ************/\n\n private readonly name = 'mg-action-more';\n private readonly classBase = 'mg-c-action-more';\n private readonly mgPopoverIdentifier = createID(this.name);\n private messages: MessageType;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgActionMoreElement;\n\n /**\n * Define the menu-items elements\n */\n @Prop() items!: MgActionMoreItemType[];\n @Watch('items')\n validateItems(newValue: MgActionMore['items']): void {\n if (!isMgActionMoreItems(newValue)) {\n throw new Error(`<${this.name}> prop \"items\" is required and all values must be the same type, MgActionMoreItemType.`);\n }\n }\n\n /**\n * Define displayed icon\n */\n @Prop({ mutable: true }) icon?: MgActionMoreIconType;\n @Watch('icon')\n validateIcon(newValue: MgActionMore['icon']): void {\n if (newValue && !isMgActionMoreIcon(newValue)) {\n throw new Error(`<${this.name}> prop icon must match MgActionMoreIconType.`);\n } else if (!newValue?.icon && Boolean(this.button.isIcon)) {\n this.icon = { icon: 'ellipsis' };\n }\n }\n\n /**\n * Define button properties\n */\n @Prop() button?: MgActionMoreButtonType = { variant: 'flat', isIcon: true };\n @Watch('button')\n validateButton(newValue: MgActionMore['button']): void {\n if (newValue && !isMgActionMoreButton(newValue)) {\n throw new Error(`<${this.name}> prop button must match MgActionMoreButtonType.`);\n }\n }\n\n /**\n * Define if chevron is display\n */\n @Prop() displayChevron?: boolean;\n @Watch('displayChevron')\n validateDisplayChevron(newValue: MgActionMore['displayChevron']): void {\n if (newValue && this.button.isIcon === true) {\n throw new Error(`<${this.name}> prop \"displayChevron\" can't be used with a 'button\" prop \"isIcon\" attribute.`);\n }\n }\n /**\n * Menu expanded state\n */\n @State() expanded = false;\n\n /************\n * Methods *\n ***********/\n\n /**\n * Toggle expanded props\n */\n private toggleExpanded = (): void => {\n this.expanded = !this.expanded;\n };\n\n /**\n * Handle popover display change value\n * @param event - display change updated value\n */\n private handleDisplayChange = (event: CustomEvent): void => {\n this.expanded = event.detail;\n };\n\n /**\n * Button click handler\n */\n private handleButton = (): void => {\n this.toggleExpanded();\n };\n\n /**\n * Item click handler\n * @param event - click event\n * @param customHandler - item['mouseEventHandler']\n */\n private handleItemClick = (event: MouseEvent, customHandler: MgActionMoreItemType['mouseEventHandler']) => {\n this.expanded = false;\n customHandler(event);\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Validate props\n */\n componentWillLoad(): void {\n this.messages = initLocales(this.element).messages.actionMore as MessageType;\n this.validateItems(this.items);\n this.validateButton(this.button);\n this.validateIcon(this.icon);\n this.validateDisplayChevron(this.displayChevron);\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n const buttonLabel = this.button.label || this.messages.label;\n const buttonContent = [buttonLabel];\n\n if (!this.button.isIcon && this.displayChevron) {\n buttonContent.push(\n <span\n class={{\n [`${this.classBase}__chevron`]: true,\n [`${this.classBase}__chevron--rotate`]: this.expanded === true,\n }}\n >\n <mg-icon icon=\"chevron-down\" size=\"small\"></mg-icon>\n </span>,\n );\n }\n\n return (\n <Host data-mg-popover-guard={this.mgPopoverIdentifier}>\n <span class=\"mg-action-more\">\n <mg-popover identifier={this.mgPopoverIdentifier} display={this.expanded} onDisplay-change={this.handleDisplayChange}>\n <mg-button variant={this.button.variant} isIcon={this.button.isIcon} disabled={this.button.disabled} type=\"button\" label={buttonLabel} onClick={this.handleButton}>\n {this.icon && <mg-icon {...this.icon}></mg-icon>}\n {!this.button.isIcon && buttonContent}\n </mg-button>\n <div slot=\"content\">\n <mg-menu direction={Direction.VERTICAL} label={this.messages.label}>\n {this.items.map(item => (\n // eslint-disable-next-line react/jsx-no-bind\n <mg-menu-item\n key={item.label}\n status={item.status || Status.VISIBLE}\n target={item.target}\n href={item.href}\n onClick={e => this.handleItemClick(e, item.mouseEventHandler)}\n >\n {item.icon && <mg-icon icon={item.icon} slot=\"image\"></mg-icon>}\n <span slot=\"label\">{item.label}</span>\n {item.badge?.label && <mg-badge label={item.badge.label} value={item.badge.value} slot=\"information\" variant=\"text-color\"></mg-badge>}\n </mg-menu-item>\n ))}\n </mg-menu>\n </div>\n </mg-popover>\n </span>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -1,5 +1,5 @@
1
1
  import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
- import { M as Me, B as Be } from './index.es.js';
2
+ import { O as Oe, N as Ne } from './index.es.js';
3
3
 
4
4
  /**
5
5
  * List of all possibles variants
@@ -23,7 +23,7 @@ const MgBadge = /*@__PURE__*/ proxyCustomElement(class MgBadge extends HTMLEleme
23
23
  this.label = undefined;
24
24
  this.variant = variants[0];
25
25
  this.outline = undefined;
26
- this.classCollection = new Me(['mg-c-badge']);
26
+ this.classCollection = new Oe(['mg-c-badge']);
27
27
  }
28
28
  validateValue(newValue) {
29
29
  if (/^(\d+\+*|[?*!a-z])$/i.exec(`${newValue}`) === null) {
@@ -31,7 +31,7 @@ const MgBadge = /*@__PURE__*/ proxyCustomElement(class MgBadge extends HTMLEleme
31
31
  }
32
32
  }
33
33
  validateLabel(newValue) {
34
- if (!Be(newValue)) {
34
+ if (!Ne(newValue)) {
35
35
  throw new Error('<mg-badge> prop "label" is required.');
36
36
  }
37
37
  }
@@ -1,5 +1,5 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
- import { M as Me, B as Be, U as Ue } from './index.es.js';
2
+ import { O as Oe, N as Ne, C as Ce } from './index.es.js';
3
3
  import { d as defineCustomElement$1 } from './mg-icon2.js';
4
4
 
5
5
  /**
@@ -69,7 +69,7 @@ const MgButton = /*@__PURE__*/ proxyCustomElement(class MgButton extends HTMLEle
69
69
  this.isIcon = false;
70
70
  this.disableOnClick = false;
71
71
  this.loading = false;
72
- this.classCollection = new Me(['mg-c-button']);
72
+ this.classCollection = new Oe(['mg-c-button']);
73
73
  }
74
74
  validateVariant(newValue, oldValue) {
75
75
  if (!variants.includes(newValue)) {
@@ -128,7 +128,7 @@ const MgButton = /*@__PURE__*/ proxyCustomElement(class MgButton extends HTMLEle
128
128
  this.validateFullWidth(this.fullWidth);
129
129
  if (this.isIcon) {
130
130
  this.classCollection.add(`mg-c-button--icon`);
131
- if (!Be(this.label)) {
131
+ if (!Ne(this.label)) {
132
132
  throw new Error(`<mg-button> prop "label" is mandatory when prop "isIcon" is set to true.`);
133
133
  }
134
134
  }
@@ -140,7 +140,7 @@ const MgButton = /*@__PURE__*/ proxyCustomElement(class MgButton extends HTMLEle
140
140
  * Add listners
141
141
  */
142
142
  componentDidLoad() {
143
- Ue(() => {
143
+ Ce(() => {
144
144
  var _a;
145
145
  const closestForm = this.element.closest('form') || ((_a = this.element.closest('mg-form')) === null || _a === void 0 ? void 0 : _a.shadowRoot.querySelector('form'));
146
146
  // submit buttons should trigger form submition;
@@ -157,7 +157,7 @@ const MgButton = /*@__PURE__*/ proxyCustomElement(class MgButton extends HTMLEle
157
157
  */
158
158
  render() {
159
159
  var _a;
160
- return (h(Host, { key: '8aa45a51510eccbb021e452d540c77844f3f4792', 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: '9743ead1b9fd1f70ef0690087806a1767c5825b0', class: this.classCollection.join(), id: this.identifier }, this.loading && h("mg-icon", { icon: "loader", spin: true }), h("div", { key: '7070995c17ecedb4223475cce662e115e8d72510', class: "mg-c-button__content" }, h("slot", { key: 'cb0ad8aa02d634f0a3dfa9b584ec8fb26da88271' })))));
160
+ return (h(Host, { key: '8aa45a51510eccbb021e452d540c77844f3f4792', 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: '9743ead1b9fd1f70ef0690087806a1767c5825b0', class: this.classCollection.join(), id: this.identifier }, this.loading && h("mg-icon", { key: '543718fe45ad3e1901c4ef0c39b98705aa9fd64e', icon: "loader", spin: true }), h("div", { key: '21bc8c1a14f93db8b2373864a18da5c651e1ac4d', class: "mg-c-button__content" }, h("slot", { key: 'd16d710b4cb94ec1b7e3dfee2d4a70ee059528b4' })))));
161
161
  }
162
162
  get element() { return this; }
163
163
  static get watchers() { return {
@@ -1 +1 @@
1
- {"file":"mg-button2.js","mappings":";;;;AAAA;;;AAGO,MAAM,QAAQ,GAAG,CAAC,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,CAAU;;ACHpH,MAAM,WAAW,GAAG,+tNAA+tN,CAAC;AACpvN,uBAAe,WAAW;;MCWb,QAAQ;;;;;;;;;QAKX,qBAAgB,GAAG,IAAI,CAAC;QACf,kBAAa,GAAG,uBAAuB,CAAC;QACxC,iBAAY,GAAG,sBAAsB,CAAC;QACtC,mBAAc,GAAG,yBAAyB,CAAC;;;;;QAkIpD,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,QAAQ,GAAG,IAAI,CAAC;aACtB;SACF,CAAC;;;;;QAMM,kBAAa,GAAG,CAAC,KAAoB;YAC3C,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,KAAK,CAAC,GAAG,KAAK,GAAG,EAAE;gBACvC,KAAK,CAAC,cAAc,EAAE,CAAC;aACxB;iBAAM,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;gBAClF,KAAK,CAAC,cAAc,EAAE,CAAC;gBACvB,IA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CACT,CACF,CACD,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["ClassList","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":["/**\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 = (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",":host{display:inline-block;max-width:100%;vertical-align:middle}:host(:hover) .mg-c-button--flat:not(.mg-c-button--disabled){background:hsl(var(--color-dark)/10%)}:host([full-width]){display:block}:host([disabled]),:host([aria-disabled=true]){pointer-events:none}.mg-c-button.mg-c-button--primary{border-color:hsl(var(--mg-button-primary-border-color, var(--mg-button-primary-color-h), var(--mg-button-primary-color-s), calc(var(--mg-button-primary-color-l) - var(--mg-button-border-variation) * 10%)));background:linear-gradient(to bottom, hsl(var(--mg-button-primary-color-h), var(--mg-button-primary-color-s), var(--mg-button-primary-color-l)), hsl(var(--mg-button-primary-color-h), var(--mg-button-primary-color-s), calc(var(--mg-button-primary-color-l) - var(--mg-button-gradient) * 10%)));color:hsl(var(--mg-button-primary-font-color))}:host(:hover) .mg-c-button--primary:not(.mg-c-button--disabled){background:hsl(var(--mg-button-primary-color-h), var(--mg-button-primary-color-s), var(--mg-button-primary-color-l))}.mg-c-button.mg-c-button--secondary{border-color:hsl(var(--mg-button-secondary-border-color, var(--mg-button-secondary-color-h), var(--mg-button-secondary-color-s), calc(var(--mg-button-secondary-color-l) - var(--mg-button-border-variation) * 10%)));background:linear-gradient(to bottom, hsl(var(--mg-button-secondary-color-h), var(--mg-button-secondary-color-s), var(--mg-button-secondary-color-l)), hsl(var(--mg-button-secondary-color-h), var(--mg-button-secondary-color-s), calc(var(--mg-button-secondary-color-l) - var(--mg-button-gradient) * 10%)));color:hsl(var(--mg-button-secondary-font-color))}:host(:hover) .mg-c-button--secondary:not(.mg-c-button--disabled){background:hsl(var(--mg-button-secondary-color-h), var(--mg-button-secondary-color-s), var(--mg-button-secondary-color-l))}.mg-c-button.mg-c-button--danger{border-color:hsl(var(--mg-button-danger-border-color, var(--color-danger-h), var(--color-danger-s), calc(var(--color-danger-l) - var(--mg-button-border-variation) * 10%)));background:linear-gradient(to bottom, hsl(var(--color-danger-h), var(--color-danger-s), var(--color-danger-l)), hsl(var(--color-danger-h), var(--color-danger-s), calc(var(--color-danger-l) - var(--mg-button-gradient) * 10%)));color:hsl(var(--color-neutral))}:host(:hover) .mg-c-button--danger:not(.mg-c-button--disabled){background:hsl(var(--color-danger-h), var(--color-danger-s), var(--color-danger-l))}.mg-c-button.mg-c-button--danger-alt{border-color:hsl(var(--mg-button-danger-alt-border-color, var(--color-neutral-h), var(--color-neutral-s), calc(var(--color-neutral-l) - var(--mg-button-border-variation) * 10%)));background:linear-gradient(to bottom, hsl(var(--color-neutral-h), var(--color-neutral-s), var(--color-neutral-l)), hsl(var(--color-neutral-h), var(--color-neutral-s), calc(var(--color-neutral-l) - var(--mg-button-gradient) * 10%)));color:hsl(var(--color-danger))}:host(:hover) .mg-c-button--danger-alt:not(.mg-c-button--disabled){background:hsl(var(--color-neutral-h), var(--color-neutral-s), var(--color-neutral-l))}.mg-c-button.mg-c-button--info{border-color:hsl(var(--mg-button-info-border-color, var(--color-info-h), var(--color-info-s), calc(var(--color-info-l) - var(--mg-button-border-variation) * 10%)));background:linear-gradient(to bottom, hsl(var(--color-info-h), var(--color-info-s), var(--color-info-l)), hsl(var(--color-info-h), var(--color-info-s), calc(var(--color-info-l) - var(--mg-button-gradient) * 10%)));color:hsl(var(--color-neutral))}:host(:hover) .mg-c-button--info:not(.mg-c-button--disabled){background:hsl(var(--color-info-h), var(--color-info-s), var(--color-info-l))}.mg-c-button.mg-c-button--success{border-color:hsl(var(--mg-button-success-border-color, var(--color-success-h), var(--color-success-s), calc(var(--color-success-l) - var(--mg-button-border-variation) * 10%)));background:linear-gradient(to bottom, hsl(var(--color-success-h), var(--color-success-s), var(--color-success-l)), hsl(var(--color-success-h), var(--color-success-s), calc(var(--color-success-l) - var(--mg-button-gradient) * 10%)));color:hsl(var(--color-dark))}:host(:hover) .mg-c-button--success:not(.mg-c-button--disabled){background:hsl(var(--color-success-h), var(--color-success-s), var(--color-success-l))}.mg-c-button{position:relative;display:inline-flex;min-height:var(--default-size);box-sizing:border-box;align-items:center;padding:calc((var(--default-size) - .2rem - var(--font-size)*var(--line-height))/2) 1.1rem;border-width:var(--mg-button-border-top-width, 0.1rem) var(--mg-button-border-right-width, 0.1rem) var(--mg-button-border-bottom-width, 0.1rem) var(--mg-button-border-left-width, 0.1rem);border-style:solid;border-radius:var(--mg-button-border-radius-top-left, var(--mg-button-border-radius)) var(--mg-button-border-radius-top-right, var(--mg-button-border-radius)) var(--mg-button-border-radius-bottom-right, var(--mg-button-border-radius)) var(--mg-button-border-radius-bottom-left, var(--mg-button-border-radius));background-image:none;column-gap:.6rem;cursor:pointer;touch-action:manipulation;font-family:inherit;font-size:var(--font-size);font-weight:var(--mg-button-font-weight, normal);text-align:left;text-decoration:none}.mg-c-button.mg-c-button--disabled{cursor:default;opacity:var(--mg-button-disabled-opacity)}.mg-c-button.mg-c-button--icon{width:var(--default-size);height:var(--default-size);justify-content:center;padding:0;border-radius:var(--mg-button-border-radius-top-left, var(--mg-button-icon-border-radius)) var(--mg-button-border-radius-top-right, var(--mg-button-icon-border-radius)) var(--mg-button-border-radius-bottom-right, var(--mg-button-icon-border-radius)) var(--mg-button-border-radius-bottom-left, var(--mg-button-icon-border-radius));font-size:var(--font-size);line-height:var(--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(--font-size);font-weight:var(--mg-button-font-weight, normal);text-align:left;text-decoration:none;display:flex;align-items:center;column-gap:.6rem}.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 } 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() variant: VariantType = variants[0]; // Primary\n @Watch('variant')\n validateVariant(newValue: VariantType, oldValue?: VariantType): void {\n if (!variants.includes(newValue)) {\n throw new Error(`<mg-button> prop \"variant\" must be one of: ${variants.join(', ')}`);\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 * Identifier is used for the element ID (id is a reserved prop in Stencil.js)\n */\n @Prop() identifier?: string;\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()} id={this.identifier}>\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":";;;;AAAA;;;AAGO,MAAM,QAAQ,GAAG,CAAC,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,CAAU;;ACHpH,MAAM,WAAW,GAAG,+tNAA+tN,CAAC;AACpvN,uBAAe,WAAW;;MCWb,QAAQ;;;;;;;;;QAKX,qBAAgB,GAAG,IAAI,CAAC;QACf,kBAAa,GAAG,uBAAuB,CAAC;QACxC,iBAAY,GAAG,sBAAsB,CAAC;QACtC,mBAAc,GAAG,yBAAyB,CAAC;;;;;QAkIpD,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,QAAQ,GAAG,IAAI,CAAC;aACtB;SACF,CAAC;;;;;QAMM,kBAAa,GAAG,CAAC,KAAoB;YAC3C,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,KAAK,CAAC,GAAG,KAAK,GAAG,EAAE;gBACvC,KAAK,CAAC,cAAc,EAAE,CAAC;aACxB;iBAAM,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,GA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AC,IAAI,SAAW,EACvD,4DAAK,KAAK,EAAC,sBAAsB,IAC/B,8DAAa,CACT,CACF,CACD,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["ClassList","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":["/**\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 = (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",":host{display:inline-block;max-width:100%;vertical-align:middle}:host(:hover) .mg-c-button--flat:not(.mg-c-button--disabled){background:hsl(var(--color-dark)/10%)}:host([full-width]){display:block}:host([disabled]),:host([aria-disabled=true]){pointer-events:none}.mg-c-button.mg-c-button--primary{border-color:hsl(var(--mg-button-primary-border-color, var(--mg-button-primary-color-h), var(--mg-button-primary-color-s), calc(var(--mg-button-primary-color-l) - var(--mg-button-border-variation) * 10%)));background:linear-gradient(to bottom, hsl(var(--mg-button-primary-color-h), var(--mg-button-primary-color-s), var(--mg-button-primary-color-l)), hsl(var(--mg-button-primary-color-h), var(--mg-button-primary-color-s), calc(var(--mg-button-primary-color-l) - var(--mg-button-gradient) * 10%)));color:hsl(var(--mg-button-primary-font-color))}:host(:hover) .mg-c-button--primary:not(.mg-c-button--disabled){background:hsl(var(--mg-button-primary-color-h), var(--mg-button-primary-color-s), var(--mg-button-primary-color-l))}.mg-c-button.mg-c-button--secondary{border-color:hsl(var(--mg-button-secondary-border-color, var(--mg-button-secondary-color-h), var(--mg-button-secondary-color-s), calc(var(--mg-button-secondary-color-l) - var(--mg-button-border-variation) * 10%)));background:linear-gradient(to bottom, hsl(var(--mg-button-secondary-color-h), var(--mg-button-secondary-color-s), var(--mg-button-secondary-color-l)), hsl(var(--mg-button-secondary-color-h), var(--mg-button-secondary-color-s), calc(var(--mg-button-secondary-color-l) - var(--mg-button-gradient) * 10%)));color:hsl(var(--mg-button-secondary-font-color))}:host(:hover) .mg-c-button--secondary:not(.mg-c-button--disabled){background:hsl(var(--mg-button-secondary-color-h), var(--mg-button-secondary-color-s), var(--mg-button-secondary-color-l))}.mg-c-button.mg-c-button--danger{border-color:hsl(var(--mg-button-danger-border-color, var(--color-danger-h), var(--color-danger-s), calc(var(--color-danger-l) - var(--mg-button-border-variation) * 10%)));background:linear-gradient(to bottom, hsl(var(--color-danger-h), var(--color-danger-s), var(--color-danger-l)), hsl(var(--color-danger-h), var(--color-danger-s), calc(var(--color-danger-l) - var(--mg-button-gradient) * 10%)));color:hsl(var(--color-neutral))}:host(:hover) .mg-c-button--danger:not(.mg-c-button--disabled){background:hsl(var(--color-danger-h), var(--color-danger-s), var(--color-danger-l))}.mg-c-button.mg-c-button--danger-alt{border-color:hsl(var(--mg-button-danger-alt-border-color, var(--color-neutral-h), var(--color-neutral-s), calc(var(--color-neutral-l) - var(--mg-button-border-variation) * 10%)));background:linear-gradient(to bottom, hsl(var(--color-neutral-h), var(--color-neutral-s), var(--color-neutral-l)), hsl(var(--color-neutral-h), var(--color-neutral-s), calc(var(--color-neutral-l) - var(--mg-button-gradient) * 10%)));color:hsl(var(--color-danger))}:host(:hover) .mg-c-button--danger-alt:not(.mg-c-button--disabled){background:hsl(var(--color-neutral-h), var(--color-neutral-s), var(--color-neutral-l))}.mg-c-button.mg-c-button--info{border-color:hsl(var(--mg-button-info-border-color, var(--color-info-h), var(--color-info-s), calc(var(--color-info-l) - var(--mg-button-border-variation) * 10%)));background:linear-gradient(to bottom, hsl(var(--color-info-h), var(--color-info-s), var(--color-info-l)), hsl(var(--color-info-h), var(--color-info-s), calc(var(--color-info-l) - var(--mg-button-gradient) * 10%)));color:hsl(var(--color-neutral))}:host(:hover) .mg-c-button--info:not(.mg-c-button--disabled){background:hsl(var(--color-info-h), var(--color-info-s), var(--color-info-l))}.mg-c-button.mg-c-button--success{border-color:hsl(var(--mg-button-success-border-color, var(--color-success-h), var(--color-success-s), calc(var(--color-success-l) - var(--mg-button-border-variation) * 10%)));background:linear-gradient(to bottom, hsl(var(--color-success-h), var(--color-success-s), var(--color-success-l)), hsl(var(--color-success-h), var(--color-success-s), calc(var(--color-success-l) - var(--mg-button-gradient) * 10%)));color:hsl(var(--color-dark))}:host(:hover) .mg-c-button--success:not(.mg-c-button--disabled){background:hsl(var(--color-success-h), var(--color-success-s), var(--color-success-l))}.mg-c-button{position:relative;display:inline-flex;min-height:var(--default-size);box-sizing:border-box;align-items:center;padding:calc((var(--default-size) - .2rem - var(--font-size)*var(--line-height))/2) 1.1rem;border-width:var(--mg-button-border-top-width, 0.1rem) var(--mg-button-border-right-width, 0.1rem) var(--mg-button-border-bottom-width, 0.1rem) var(--mg-button-border-left-width, 0.1rem);border-style:solid;border-radius:var(--mg-button-border-radius-top-left, var(--mg-button-border-radius)) var(--mg-button-border-radius-top-right, var(--mg-button-border-radius)) var(--mg-button-border-radius-bottom-right, var(--mg-button-border-radius)) var(--mg-button-border-radius-bottom-left, var(--mg-button-border-radius));background-image:none;column-gap:.6rem;cursor:pointer;touch-action:manipulation;font-family:inherit;font-size:var(--font-size);font-weight:var(--mg-button-font-weight, normal);text-align:left;text-decoration:none}.mg-c-button.mg-c-button--disabled{cursor:default;opacity:var(--mg-button-disabled-opacity)}.mg-c-button.mg-c-button--icon{width:var(--default-size);height:var(--default-size);justify-content:center;padding:0;border-radius:var(--mg-button-border-radius-top-left, var(--mg-button-icon-border-radius)) var(--mg-button-border-radius-top-right, var(--mg-button-icon-border-radius)) var(--mg-button-border-radius-bottom-right, var(--mg-button-icon-border-radius)) var(--mg-button-border-radius-bottom-left, var(--mg-button-icon-border-radius));font-size:var(--font-size);line-height:var(--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(--font-size);font-weight:var(--mg-button-font-weight, normal);text-align:left;text-decoration:none;display:flex;align-items:center;column-gap:.6rem}.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 } 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() variant: VariantType = variants[0]; // Primary\n @Watch('variant')\n validateVariant(newValue: VariantType, oldValue?: VariantType): void {\n if (!variants.includes(newValue)) {\n throw new Error(`<mg-button> prop \"variant\" must be one of: ${variants.join(', ')}`);\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 * Identifier is used for the element ID (id is a reserved prop in Stencil.js)\n */\n @Prop() identifier?: string;\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()} id={this.identifier}>\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,5 +1,5 @@
1
1
  import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
- import { M as Me } from './index.es.js';
2
+ import { O as Oe } from './index.es.js';
3
3
 
4
4
  /**
5
5
  * List available variants
@@ -33,7 +33,7 @@ const MgCard = /*@__PURE__*/ proxyCustomElement(class MgCard extends HTMLElement
33
33
  };
34
34
  this.variant = undefined;
35
35
  this.variantStyle = undefined;
36
- this.classCollection = new Me([this.classBase]);
36
+ this.classCollection = new Oe([this.classBase]);
37
37
  }
38
38
  validateVariant(newValue, oldValue) {
39
39
  if (newValue && !variants.includes(newValue))
@@ -71,7 +71,7 @@ const MgCard = /*@__PURE__*/ proxyCustomElement(class MgCard extends HTMLElement
71
71
  */
72
72
  render() {
73
73
  var _a;
74
- return (h("div", { key: '9e604fe7b06f19797c6841b1902b56684a4bdc69', class: this.classCollection.join() }, ((_a = this.variantStyle) === null || _a === void 0 ? void 0 : _a.startsWith('bar-')) && h("span", { class: "mg-c-card__bar" }), h("slot", { key: '44d9092aaa6bbdf0b20a1fffe0edad15150cd8cb' })));
74
+ return (h("div", { key: 'b786a9ff3b706dcb24f6b3218feef97e284e2b9a', class: this.classCollection.join() }, ((_a = this.variantStyle) === null || _a === void 0 ? void 0 : _a.startsWith('bar-')) && h("span", { key: '11a3b421c49864667832919e6d2cbe9ea19f9344', class: "mg-c-card__bar" }), h("slot", { key: '7421932644500c619d34cbe003a0f0bb50b612a7' })));
75
75
  }
76
76
  static get watchers() { return {
77
77
  "variant": ["validateVariant"],