@mgdis/mg-components 3.1.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (241) hide show
  1. package/dist/cjs/{index-85a4a0b6.js → index-88560a66.js} +123 -48
  2. package/dist/cjs/index-a39c5567.js +233 -0
  3. package/dist/cjs/loader.cjs.js +3 -17
  4. package/dist/cjs/mg-badge_21.cjs.entry.js +3538 -0
  5. package/dist/cjs/mg-components.cjs.js +3 -7
  6. package/dist/cjs/mg-modal.cjs.entry.js +117 -0
  7. package/dist/cjs/mg-popover.cjs.entry.js +170 -0
  8. package/dist/cjs/popper-71bf3058.js +1790 -0
  9. package/dist/collection/collection-manifest.json +4 -1
  10. package/dist/collection/components/atoms/mg-badge/{mg-badge.stories.js → doc/mg-badge.stories.js} +4 -1
  11. package/dist/collection/components/atoms/mg-badge/mg-badge.conf.js +1 -1
  12. package/dist/collection/components/atoms/mg-badge/mg-badge.css +0 -2
  13. package/dist/collection/components/atoms/mg-badge/mg-badge.js +26 -10
  14. package/dist/collection/components/atoms/mg-button/{mg-button.stories.js → doc/mg-button.stories.js} +7 -2
  15. package/dist/collection/components/atoms/mg-button/mg-button.conf.js +1 -1
  16. package/dist/collection/components/atoms/mg-button/mg-button.css +46 -49
  17. package/dist/collection/components/atoms/mg-button/mg-button.js +78 -4
  18. package/dist/collection/components/atoms/mg-character-left/{mg-character-left.stories.js → doc/mg-character-left.stories.js} +8 -0
  19. package/dist/collection/components/atoms/mg-character-left/mg-character-left.js +20 -46
  20. package/dist/collection/components/atoms/mg-icon/{mg-icon.stories.js → doc/mg-icon.stories.js} +1 -1
  21. package/dist/collection/components/atoms/mg-icon/mg-icon.conf.js +104 -9
  22. package/dist/collection/components/atoms/mg-icon/mg-icon.css +9 -7
  23. package/dist/collection/components/atoms/mg-icon/mg-icon.js +33 -7
  24. package/dist/collection/components/atoms/mg-input-title/{mg-input-title.stories.js → doc/mg-input-title.stories.js} +0 -0
  25. package/dist/collection/components/atoms/mg-input-title/mg-input-title.css +4 -4
  26. package/dist/collection/components/atoms/mg-input-title/mg-input-title.js +14 -3
  27. package/dist/collection/components/atoms/mg-tag/{mg-tag.stories.js → doc/mg-tag.stories.js} +4 -1
  28. package/dist/collection/components/atoms/mg-tag/mg-tag.js +28 -6
  29. package/dist/collection/components/atoms/mg-tooltip/{mg-tooltip.stories.js → doc/mg-tooltip.stories.js} +14 -1
  30. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.conf.js +20 -0
  31. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +16 -2
  32. package/dist/collection/components/molecules/inputs/MgInput.conf.js +1 -7
  33. package/dist/collection/components/molecules/inputs/MgInput.js +25 -29
  34. package/dist/collection/components/molecules/inputs/mg-input-checkbox/{mg-input-checkbox.stories.js → doc/mg-input-checkbox.stories.js} +6 -1
  35. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.css +25 -11
  36. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +102 -52
  37. package/dist/collection/components/molecules/inputs/mg-input-date/{mg-input-date.stories.js → doc/mg-input-date.stories.js} +6 -1
  38. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.css +37 -9
  39. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +136 -66
  40. package/dist/collection/components/molecules/inputs/mg-input-numeric/{mg-input-numeric.stories.js → doc/mg-input-numeric.stories.js} +15 -3
  41. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.css +38 -10
  42. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +180 -80
  43. package/dist/collection/components/molecules/inputs/mg-input-password/{mg-input-password.stories.js → doc/mg-input-password.stories.js} +16 -2
  44. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.css +37 -9
  45. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +108 -47
  46. package/dist/collection/components/molecules/inputs/mg-input-radio/{mg-input-radio.stories.js → doc/mg-input-radio.stories.js} +6 -1
  47. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.css +25 -11
  48. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +113 -42
  49. package/dist/collection/components/molecules/inputs/mg-input-select/{mg-input-select.stories.js → doc/mg-input-select.stories.js} +22 -2
  50. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.css +39 -10
  51. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +145 -71
  52. package/dist/collection/components/molecules/inputs/mg-input-text/{mg-input-text.stories.js → doc/mg-input-text.stories.js} +17 -8
  53. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.css +69 -19
  54. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +184 -83
  55. package/dist/collection/components/molecules/inputs/mg-input-textarea/{mg-input-textarea.stories.js → doc/mg-input-textarea.stories.js} +16 -5
  56. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.css +69 -13
  57. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +163 -70
  58. package/dist/collection/components/molecules/inputs/mg-input-toggle/{mg-input-toggle.stories.js → doc/mg-input-toggle.stories.js} +6 -1
  59. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.css +22 -10
  60. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +68 -33
  61. package/dist/collection/components/molecules/mg-form/doc/mg-form.stories.js +58 -0
  62. package/dist/collection/components/molecules/mg-form/mg-form.css +19 -0
  63. package/dist/collection/components/molecules/mg-form/mg-form.js +271 -0
  64. package/dist/collection/components/molecules/mg-message/{mg-message.stories.js → doc/mg-message.stories.js} +6 -2
  65. package/dist/collection/components/molecules/mg-message/mg-message.css +1 -1
  66. package/dist/collection/components/molecules/mg-message/mg-message.js +26 -11
  67. package/dist/collection/components/molecules/mg-modal/doc/mg-modal.stories.js +51 -0
  68. package/dist/collection/components/molecules/mg-modal/mg-modal.css +52 -0
  69. package/dist/collection/components/molecules/mg-modal/mg-modal.js +240 -0
  70. package/dist/collection/components/molecules/mg-pagination/{mg-pagination.stories.js → doc/mg-pagination.stories.js} +1 -0
  71. package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +47 -28
  72. package/dist/collection/components/molecules/mg-panel/doc/mg-panel.stories.js +39 -0
  73. package/dist/collection/components/molecules/mg-panel/mg-panel.css +53 -0
  74. package/dist/collection/components/molecules/mg-panel/mg-panel.js +356 -0
  75. package/dist/collection/components/molecules/mg-popover/{mg-popover.stories.js → doc/mg-popover.stories.js} +10 -0
  76. package/dist/collection/components/molecules/mg-popover/mg-popover.conf.js +20 -0
  77. package/dist/collection/components/molecules/mg-popover/mg-popover.css +2 -2
  78. package/dist/collection/components/molecules/mg-popover/mg-popover.js +37 -12
  79. package/dist/collection/components/molecules/mg-tabs/{mg-tabs.stories.js → doc/mg-tabs.stories.js} +20 -4
  80. package/dist/collection/components/molecules/mg-tabs/mg-tabs.conf.js +11 -1
  81. package/dist/collection/components/molecules/mg-tabs/mg-tabs.css +17 -3
  82. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +139 -26
  83. package/dist/collection/locales/index.js +33 -4
  84. package/dist/collection/stories/helpers.stories.js +33 -0
  85. package/dist/collection/utils/components.utils.js +16 -9
  86. package/dist/collection/utils/locale.utils.js +13 -7
  87. package/dist/collection/utils/test.utils.js +27 -15
  88. package/dist/collection/variables.css +39 -5
  89. package/dist/collection/variables.scss +39 -5
  90. package/dist/components/MgInput.js +26 -37
  91. package/dist/components/components.utils.js +16 -9
  92. package/dist/components/index.d.ts +24 -6
  93. package/dist/components/index.js +23 -0
  94. package/dist/components/index2.js +116 -17
  95. package/dist/components/locale.utils.js +13 -8
  96. package/dist/components/mg-badge2.js +25 -9
  97. package/dist/components/mg-button2.js +29 -5
  98. package/dist/components/mg-character-left2.js +14 -26
  99. package/dist/components/mg-form.d.ts +11 -0
  100. package/dist/components/mg-form.js +148 -0
  101. package/dist/components/mg-icon2.js +138 -17
  102. package/dist/components/mg-input-checkbox.js +66 -53
  103. package/dist/components/mg-input-date.js +100 -69
  104. package/dist/components/mg-input-numeric.js +125 -81
  105. package/dist/components/mg-input-password.js +69 -48
  106. package/dist/components/mg-input-radio.js +74 -46
  107. package/dist/components/mg-input-select2.js +103 -71
  108. package/dist/components/mg-input-text.js +1 -237
  109. package/dist/components/mg-input-text2.js +300 -0
  110. package/dist/components/mg-input-textarea.js +100 -46
  111. package/dist/components/mg-input-title2.js +13 -4
  112. package/dist/components/mg-input-toggle.js +39 -31
  113. package/dist/components/mg-message.js +25 -10
  114. package/dist/components/mg-modal.d.ts +11 -0
  115. package/dist/components/mg-modal.js +153 -0
  116. package/dist/components/mg-pagination.js +45 -31
  117. package/dist/components/mg-panel.d.ts +11 -0
  118. package/dist/components/mg-panel.js +244 -0
  119. package/dist/components/mg-popover.js +31 -11
  120. package/dist/components/mg-tabs.js +113 -23
  121. package/dist/components/mg-tag.js +27 -5
  122. package/dist/components/mg-tooltip2.js +10 -1
  123. package/dist/components/popper.js +6 -2
  124. package/dist/esm/{index-e3e84606.js → index-bca81100.js} +124 -46
  125. package/dist/esm/index-e51ae032.js +228 -0
  126. package/dist/esm/loader.js +3 -17
  127. package/dist/esm/mg-badge_21.entry.js +3514 -0
  128. package/dist/esm/mg-components.js +3 -7
  129. package/dist/esm/mg-modal.entry.js +113 -0
  130. package/dist/esm/mg-popover.entry.js +166 -0
  131. package/dist/esm/polyfills/css-shim.js +1 -1
  132. package/dist/esm/popper-93ecb064.js +1788 -0
  133. package/dist/index.js +1 -1
  134. package/dist/mg-components/mg-components.css +1 -1
  135. package/dist/mg-components/mg-components.esm.js +1 -1
  136. package/dist/mg-components/p-003a1344.entry.js +1 -0
  137. package/dist/mg-components/p-462d648a.entry.js +1 -0
  138. package/dist/mg-components/p-4c66f794.js +1 -0
  139. package/dist/mg-components/p-5126ab10.entry.js +1 -0
  140. package/dist/mg-components/p-780bd52d.js +1 -0
  141. package/dist/mg-components/p-b14a3443.js +2 -0
  142. package/dist/mg-components/variables.css +39 -5
  143. package/dist/mg-components/variables.scss +39 -5
  144. package/dist/types/components/atoms/mg-badge/{mg-badge.stories.d.ts → doc/mg-badge.stories.d.ts} +5 -0
  145. package/dist/types/components/atoms/mg-badge/mg-badge.d.ts +16 -5
  146. package/dist/types/components/atoms/mg-button/{mg-button.stories.d.ts → doc/mg-button.stories.d.ts} +5 -0
  147. package/dist/types/components/atoms/mg-button/mg-button.d.ts +23 -3
  148. package/dist/types/components/atoms/mg-character-left/{mg-character-left.stories.d.ts → doc/mg-character-left.stories.d.ts} +9 -0
  149. package/dist/types/components/atoms/mg-character-left/mg-character-left.d.ts +16 -13
  150. package/dist/types/components/atoms/mg-icon/{mg-icon.stories.d.ts → doc/mg-icon.stories.d.ts} +0 -0
  151. package/dist/types/components/atoms/mg-icon/mg-icon.conf.d.ts +1 -1
  152. package/dist/types/components/atoms/mg-icon/mg-icon.d.ts +14 -4
  153. package/dist/types/components/atoms/mg-input-title/{mg-input-title.stories.d.ts → doc/mg-input-title.stories.d.ts} +0 -0
  154. package/dist/types/components/atoms/mg-input-title/mg-input-title.d.ts +11 -1
  155. package/dist/types/components/atoms/mg-tag/{mg-tag.stories.d.ts → doc/mg-tag.stories.d.ts} +5 -0
  156. package/dist/types/components/atoms/mg-tag/mg-tag.d.ts +18 -4
  157. package/dist/types/components/atoms/mg-tooltip/doc/mg-tooltip.stories.d.ts +29 -0
  158. package/dist/types/components/atoms/mg-tooltip/mg-tooltip.conf.d.ts +8 -0
  159. package/dist/types/components/atoms/mg-tooltip/mg-tooltip.d.ts +13 -3
  160. package/dist/types/components/molecules/inputs/MgInput.conf.d.ts +6 -4
  161. package/dist/types/components/molecules/inputs/MgInput.d.ts +7 -8
  162. package/dist/types/components/molecules/inputs/mg-input-checkbox/{mg-input-checkbox.stories.d.ts → doc/mg-input-checkbox.stories.d.ts} +5 -0
  163. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +36 -13
  164. package/dist/types/components/molecules/inputs/mg-input-date/{mg-input-date.stories.d.ts → doc/mg-input-date.stories.d.ts} +5 -0
  165. package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.d.ts +46 -15
  166. package/dist/types/components/molecules/inputs/mg-input-numeric/{mg-input-numeric.stories.d.ts → doc/mg-input-numeric.stories.d.ts} +11 -0
  167. package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +61 -16
  168. package/dist/types/components/molecules/inputs/mg-input-password/doc/mg-input-password.stories.d.ts +22 -0
  169. package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.d.ts +35 -11
  170. package/dist/types/components/molecules/inputs/mg-input-radio/{mg-input-radio.stories.d.ts → doc/mg-input-radio.stories.d.ts} +5 -0
  171. package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.conf.d.ts +1 -1
  172. package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +42 -9
  173. package/dist/types/components/molecules/inputs/mg-input-select/doc/mg-input-select.stories.d.ts +34 -0
  174. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.conf.d.ts +1 -1
  175. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +37 -9
  176. package/dist/types/components/molecules/inputs/mg-input-text/{mg-input-text.stories.d.ts → doc/mg-input-text.stories.d.ts} +13 -0
  177. package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +52 -16
  178. package/dist/types/components/molecules/inputs/mg-input-textarea/doc/mg-input-textarea.stories.d.ts +19 -0
  179. package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +45 -17
  180. package/dist/types/components/molecules/inputs/mg-input-toggle/{mg-input-toggle.stories.d.ts → doc/mg-input-toggle.stories.d.ts} +5 -0
  181. package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.conf.d.ts +1 -1
  182. package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +29 -12
  183. package/dist/types/components/molecules/{mg-popover/mg-popover.stories.d.ts → mg-form/doc/mg-form.stories.d.ts} +3 -4
  184. package/dist/types/components/molecules/mg-form/mg-form.d.ts +83 -0
  185. package/dist/types/components/molecules/mg-message/{mg-message.stories.d.ts → doc/mg-message.stories.d.ts} +10 -0
  186. package/dist/types/components/molecules/mg-message/mg-message.d.ts +13 -4
  187. package/dist/types/components/molecules/mg-modal/doc/mg-modal.stories.d.ts +13 -0
  188. package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +85 -0
  189. package/dist/types/components/molecules/mg-pagination/{mg-pagination.stories.d.ts → doc/mg-pagination.stories.d.ts} +5 -0
  190. package/dist/types/components/molecules/mg-pagination/mg-pagination.d.ts +31 -7
  191. package/dist/types/components/molecules/mg-panel/doc/mg-panel.stories.d.ts +11 -0
  192. package/dist/types/components/molecules/mg-panel/mg-panel.d.ts +139 -0
  193. package/dist/types/components/molecules/mg-popover/doc/mg-popover.stories.d.ts +25 -0
  194. package/dist/types/components/molecules/mg-popover/mg-popover.conf.d.ts +8 -0
  195. package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +27 -4
  196. package/dist/types/components/molecules/mg-tabs/doc/mg-tabs.stories.d.ts +20 -0
  197. package/dist/types/components/molecules/mg-tabs/mg-tabs.conf.d.ts +11 -0
  198. package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +70 -6
  199. package/dist/types/components.d.ts +528 -211
  200. package/dist/types/locales/index.d.ts +108 -38
  201. package/dist/types/stories/{buttons.stories.d.ts → helpers.stories.d.ts} +1 -1
  202. package/dist/types/utils/components.utils.d.ts +16 -9
  203. package/dist/types/utils/locale.utils.d.ts +13 -6
  204. package/dist/types/utils/test.utils.d.ts +13 -1
  205. package/loader/index.js +1 -1
  206. package/package.json +45 -14
  207. package/readme.md +9 -35
  208. package/dist/cjs/css-shim-a22512c4.js +0 -6
  209. package/dist/cjs/mg-badge_20.cjs.entry.js +0 -4661
  210. package/dist/cjs/shadow-css-8940f82d.js +0 -390
  211. package/dist/collection/stories/buttons.stories.js +0 -43
  212. package/dist/collection/stories/messages.stories.js +0 -44
  213. package/dist/collection/stories/tags.stories.js +0 -13
  214. package/dist/esm/css-shim-7c240feb.js +0 -4
  215. package/dist/esm/mg-badge_20.entry.js +0 -4638
  216. package/dist/esm/shadow-css-5d2d01ce.js +0 -388
  217. package/dist/esm-es5/css-shim-7c240feb.js +0 -1
  218. package/dist/esm-es5/index-e3e84606.js +0 -1
  219. package/dist/esm-es5/index.js +0 -0
  220. package/dist/esm-es5/loader.js +0 -1
  221. package/dist/esm-es5/mg-badge_20.entry.js +0 -2
  222. package/dist/esm-es5/mg-components.js +0 -1
  223. package/dist/esm-es5/shadow-css-5d2d01ce.js +0 -12
  224. package/dist/mg-components/mg-components.js +0 -132
  225. package/dist/mg-components/p-1cd24462.system.js +0 -1
  226. package/dist/mg-components/p-2e2f6b27.system.entry.js +0 -2
  227. package/dist/mg-components/p-366a224e.js +0 -1
  228. package/dist/mg-components/p-422c429b.system.js +0 -1
  229. package/dist/mg-components/p-50ea2036.system.js +0 -1
  230. package/dist/mg-components/p-62fa3797.js +0 -1
  231. package/dist/mg-components/p-71d57b8b.system.js +0 -13
  232. package/dist/mg-components/p-9a215712.system.js +0 -1
  233. package/dist/mg-components/p-cbf0464b.entry.js +0 -1
  234. package/dist/mg-components/p-f6455ab3.js +0 -12
  235. package/dist/types/components/atoms/mg-tooltip/mg-tooltip.stories.d.ts +0 -11
  236. package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.stories.d.ts +0 -9
  237. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.stories.d.ts +0 -14
  238. package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.stories.d.ts +0 -6
  239. package/dist/types/components/molecules/mg-tabs/mg-tabs.stories.d.ts +0 -7
  240. package/dist/types/stories/messages.stories.d.ts +0 -13
  241. package/dist/types/stories/tags.stories.d.ts +0 -5
@@ -0,0 +1,3514 @@
1
+ import { r as registerInstance, h, g as getElement, c as createEvent, H as Host } from './index-bca81100.js';
2
+ import { C as ClassList, c as createID, i as initLocales, a as allItemsAreString } from './index-e51ae032.js';
3
+ import { c as createPopper } from './popper-93ecb064.js';
4
+
5
+ /**
6
+ * List of all possibles variants
7
+ */
8
+ const variants$4 = ['info', 'primary', 'secondary', 'success', 'warning', 'danger'];
9
+
10
+ const mgBadgeCss = ".sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}.mg-badge{padding:0 0.4rem;height:var(--mg-badge-size);min-width:var(--mg-badge-size);box-sizing:border-box;border:0.1rem solid;border-radius:calc(var(--mg-badge-size) / 2);font-size:var(--mg-badge-font-size);font-weight:600;text-align:center;line-height:var(--mg-badge-size)}.mg-badge.mg-badge--primary{background-color:hsl(var(--color-dark));border-color:hsl(var(--color-dark));color:hsl(var(--color-light))}.mg-badge.mg-badge--primary.mg-badge--outline{background-color:transparent;color:hsl(var(--color-dark))}.mg-badge.mg-badge--secondary{background-color:hsl(var(--color-light));border-color:hsl(var(--color-light));color:hsl(var(--color-dark))}.mg-badge.mg-badge--secondary.mg-badge--outline{background-color:transparent;color:hsl(var(--color-light))}.mg-badge.mg-badge--success{background-color:hsl(var(--color-success));border-color:hsl(var(--color-success));color:hsl(var(--color-dark))}.mg-badge.mg-badge--success.mg-badge--outline{background-color:transparent;color:hsl(var(--color-success))}.mg-badge.mg-badge--warning{background-color:hsl(var(--color-warning));border-color:hsl(var(--color-warning));color:hsl(var(--color-dark))}.mg-badge.mg-badge--warning.mg-badge--outline{background-color:transparent;color:hsl(var(--color-warning))}.mg-badge.mg-badge--danger{background-color:hsl(var(--color-danger));border-color:hsl(var(--color-danger));color:hsl(var(--color-light))}.mg-badge.mg-badge--danger.mg-badge--outline{background-color:transparent;color:hsl(var(--color-danger))}.mg-badge.mg-badge--info{background-color:hsl(var(--color-info));border-color:hsl(var(--color-info));color:hsl(var(--color-light))}.mg-badge.mg-badge--info.mg-badge--outline{background-color:transparent;color:hsl(var(--color-info))}.mg-badge,mg-badge{display:inline-flex;align-items:center;justify-content:center}";
11
+
12
+ const MgBadge = class {
13
+ constructor(hostRef) {
14
+ registerInstance(this, hostRef);
15
+ /************
16
+ * Internal *
17
+ ************/
18
+ // classes
19
+ this.classOutline = `mg-badge--outline`;
20
+ /**
21
+ * Define button variant
22
+ */
23
+ this.variant = variants$4[0]; // info
24
+ /**
25
+ * Component classes
26
+ */
27
+ this.classList = new ClassList(['mg-badge']);
28
+ }
29
+ validateValue(newValue) {
30
+ if (`${newValue}`.match(/^(\d+|[?*!a-z])$/i) === null) {
31
+ throw new Error('<mg-badge> prop "value" must be interger or ponctuation character.');
32
+ }
33
+ }
34
+ validateVariant(newValue, oldValue) {
35
+ if (!variants$4.includes(newValue)) {
36
+ throw new Error(`<mg-badge> prop "variant" must be one of : ${variants$4.join(', ')}.`);
37
+ }
38
+ else {
39
+ if (oldValue !== undefined) {
40
+ this.classList.delete(`mg-badge--${oldValue}`);
41
+ }
42
+ this.classList.add(`mg-badge--${newValue}`);
43
+ }
44
+ }
45
+ validateOutline(newValue) {
46
+ if (newValue)
47
+ this.classList.add(this.classOutline);
48
+ else
49
+ this.classList.delete(this.classOutline);
50
+ }
51
+ /**
52
+ * Check if props are well configured on init
53
+ *
54
+ * @returns {void}
55
+ */
56
+ componentWillLoad() {
57
+ this.validateValue(this.value);
58
+ this.validateVariant(this.variant);
59
+ this.validateOutline(this.outline);
60
+ }
61
+ /**
62
+ * Render
63
+ *
64
+ * @returns {HTMLElement} HTML Element
65
+ */
66
+ render() {
67
+ return (h("span", { class: this.classList.join() }, this.value, h("span", { class: "sr-only" }, this.label)));
68
+ }
69
+ static get watchers() { return {
70
+ "value": ["validateValue"],
71
+ "variant": ["validateVariant"],
72
+ "outline": ["validateOutline"]
73
+ }; }
74
+ };
75
+ MgBadge.style = mgBadgeCss;
76
+
77
+ /**
78
+ * List of all possibles variants
79
+ */
80
+ const variants$3 = ['primary', 'secondary', 'danger', 'danger-alt', 'info', 'flat', 'success'];
81
+
82
+ const mgButtonCss = ".mg-button.sc-mg-button{position:relative;display:inline-flex;align-items:center;column-gap:0.6rem;padding:calc((var(--default-size) - 0.2rem - var(--font-size) * var(--line-height)) / 2) 1.1rem;min-height:var(--default-size);box-sizing:border-box;border-top-right-radius:var(--mg-button-border-radius-top-right, var(--mg-button-border-radius));border-top-left-radius:var(--mg-button-border-radius-top-left, var(--mg-button-border-radius));border-bottom-right-radius:var(--mg-button-border-radius-bottom-right, var(--mg-button-border-radius));border-bottom-left-radius:var(--mg-button-border-radius-bottom-left, var(--mg-button-border-radius));cursor:pointer;background-image:none;border-top-width:var(--mg-button-border-top-width, 0.1rem);border-right-width:var(--mg-button-border-right-width, 0.1rem);border-bottom-width:var(--mg-button-border-bottom-width, 0.1rem);border-left-width:var(--mg-button-border-left-width, 0.1rem);border-style:solid;font-family:inherit;text-decoration:none;font-weight:normal;text-align:left;touch-action:manipulation}.mg-button[disabled].sc-mg-button,.mg-button[aria-disabled=true].sc-mg-button,.mg-button.disabled.sc-mg-button{opacity:var(--mg-button-disabled-opacity);cursor:default}.mg-button.mg-button--icon.sc-mg-button{padding:0;justify-content:center;width:var(--default-size);height:var(--default-size);border-top-right-radius:var(--mg-button-border-radius-top-right, var(--mg-button-icon-border-radius));border-top-left-radius:var(--mg-button-border-radius-top-left, var(--mg-button-icon-border-radius));border-bottom-right-radius:var(--mg-button-border-radius-bottom-right, var(--mg-button-icon-border-radius));border-bottom-left-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-button.mg-button--primary.sc-mg-button{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%)));color:hsl(var(--mg-button-primary-font-color));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%)))}.mg-button.mg-button--primary.sc-mg-button:hover:not([disabled],[aria-disabled=true].sc-mg-button,.disabled).sc-mg-button,.mg-button.mg-button--primary.sc-mg-button:focus:not([disabled],[aria-disabled=true].sc-mg-button,.disabled).sc-mg-button,.mg-button.mg-button--primary.sc-mg-button:active:not([disabled],[aria-disabled=true].sc-mg-button,.disabled).sc-mg-button{background:hsl(var(--mg-button-primary-color-h), var(--mg-button-primary-color-s), var(--mg-button-primary-color-l))}.mg-button.mg-button--secondary.sc-mg-button{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%)));color:hsl(var(--mg-button-secondary-font-color));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%)))}.mg-button.mg-button--secondary.sc-mg-button:hover:not([disabled],[aria-disabled=true].sc-mg-button,.disabled).sc-mg-button,.mg-button.mg-button--secondary.sc-mg-button:focus:not([disabled],[aria-disabled=true].sc-mg-button,.disabled).sc-mg-button,.mg-button.mg-button--secondary.sc-mg-button:active:not([disabled],[aria-disabled=true].sc-mg-button,.disabled).sc-mg-button{background:hsl(var(--mg-button-secondary-color-h), var(--mg-button-secondary-color-s), var(--mg-button-secondary-color-l))}.mg-button.mg-button--danger.sc-mg-button{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%)));color:hsl(var(--color-neutral));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%)))}.mg-button.mg-button--danger.sc-mg-button:hover:not([disabled],[aria-disabled=true].sc-mg-button,.disabled).sc-mg-button,.mg-button.mg-button--danger.sc-mg-button:focus:not([disabled],[aria-disabled=true].sc-mg-button,.disabled).sc-mg-button,.mg-button.mg-button--danger.sc-mg-button:active:not([disabled],[aria-disabled=true].sc-mg-button,.disabled).sc-mg-button{background:hsl(var(--color-danger-h), var(--color-danger-s), var(--color-danger-l))}.mg-button.mg-button--danger-alt.sc-mg-button{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%)));color:hsl(var(--color-danger));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%)))}.mg-button.mg-button--danger-alt.sc-mg-button:hover:not([disabled],[aria-disabled=true].sc-mg-button,.disabled).sc-mg-button,.mg-button.mg-button--danger-alt.sc-mg-button:focus:not([disabled],[aria-disabled=true].sc-mg-button,.disabled).sc-mg-button,.mg-button.mg-button--danger-alt.sc-mg-button:active:not([disabled],[aria-disabled=true].sc-mg-button,.disabled).sc-mg-button{background:hsl(var(--color-neutral-h), var(--color-neutral-s), var(--color-neutral-l))}.mg-button.mg-button--info.sc-mg-button{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%)));color:hsl(var(--color-neutral));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%)))}.mg-button.mg-button--info.sc-mg-button:hover:not([disabled],[aria-disabled=true].sc-mg-button,.disabled).sc-mg-button,.mg-button.mg-button--info.sc-mg-button:focus:not([disabled],[aria-disabled=true].sc-mg-button,.disabled).sc-mg-button,.mg-button.mg-button--info.sc-mg-button:active:not([disabled],[aria-disabled=true].sc-mg-button,.disabled).sc-mg-button{background:hsl(var(--color-info-h), var(--color-info-s), var(--color-info-l))}.mg-button.mg-button--success.sc-mg-button{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%)));color:hsl(var(--color-dark));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%)))}.mg-button.mg-button--success.sc-mg-button:hover:not([disabled],[aria-disabled=true].sc-mg-button,.disabled).sc-mg-button,.mg-button.mg-button--success.sc-mg-button:focus:not([disabled],[aria-disabled=true].sc-mg-button,.disabled).sc-mg-button,.mg-button.mg-button--success.sc-mg-button:active:not([disabled],[aria-disabled=true].sc-mg-button,.disabled).sc-mg-button{background:hsl(var(--color-success-h), var(--color-success-s), var(--color-success-l))}.mg-button.mg-button--flat.sc-mg-button{background:none;border:none}.mg-button.mg-button--flat.sc-mg-button:hover:not([disabled],[aria-disabled=true].sc-mg-button,.disabled).sc-mg-button,.mg-button.mg-button--flat.sc-mg-button:focus:not([disabled],[aria-disabled=true].sc-mg-button,.disabled).sc-mg-button,.mg-button.mg-button--flat.sc-mg-button:active:not([disabled],[aria-disabled=true].sc-mg-button,.disabled).sc-mg-button{background:hsla(var(--color-dark), 0.1)}.mg-button.sc-mg-button mg-icon.sc-mg-button:only-child,.mg-button .sc-mg-button-s>mg-icon{display:inline-flex;flex-shrink:0;line-height:1;margin:auto 0}.mg-button.mg-button--loading.sc-mg-button>mg-icon.sc-mg-button{position:absolute;left:50%;top:50%;transform:translate(-50%, -50%)}.mg-button.mg-button--loading.sc-mg-button .mg-button__content.sc-mg-button{opacity:0}.mg-button__content.sc-mg-button{display:flex;align-items:center;column-gap:0.6rem}mg-button.sc-mg-button{display:inline-block}.mg-button.sc-mg-button,mg-button.sc-mg-button{vertical-align:middle;max-width:100%}";
83
+
84
+ const MgButton = class {
85
+ constructor(hostRef) {
86
+ registerInstance(this, hostRef);
87
+ /************
88
+ * Internal *
89
+ ************/
90
+ this.onClickElementFn = null;
91
+ /**
92
+ * Define button variant
93
+ */
94
+ this.variant = variants$3[0]; // Primary
95
+ /**
96
+ * Identifier is used for the element ID (id is a reserved prop in Stencil.js)
97
+ * If not set, it will be created.
98
+ */
99
+ this.identifier = createID('mg-button');
100
+ /**
101
+ * Disable button
102
+ */
103
+ this.disabled = false;
104
+ /**
105
+ * Define if button is round.
106
+ * Used for icon button.
107
+ */
108
+ this.isIcon = false;
109
+ /**
110
+ * Option to set input disable on click, in order to prevent multi-click.
111
+ * Parent component have to remove the attribute 'disabled' when the process ends.
112
+ */
113
+ this.disableOnClick = false;
114
+ /**
115
+ * Prop to set aria-expanded on button element
116
+ */
117
+ this.expanded = false;
118
+ /**
119
+ * Option to set aria-haspopup
120
+ * The aria-haspopup state informs assistive technology users that there is a popup and the type of popup it is, but provides no interactivity.
121
+ */
122
+ this.haspopup = false;
123
+ /**
124
+ * Define if button is loading, default to false.
125
+ * Trigger when button is clicked or key-up ['enter', 'space], then value change to true.
126
+ * It's required to reset to false when action/promise in parent is done to stop the loading state
127
+ */
128
+ this.loading = false;
129
+ /**
130
+ * Component classes
131
+ */
132
+ this.classList = new ClassList(['mg-button']);
133
+ /**
134
+ * Trigger actions onClick event
135
+ *
136
+ * @param {MouseEvent} event click event
137
+ * @returns {void}
138
+ */
139
+ this.handleClick = (event) => {
140
+ if (this.disabled)
141
+ event.stopPropagation();
142
+ // Used to prevent multi-click.
143
+ if (this.disableOnClick && !this.disabled) {
144
+ this.loading = true;
145
+ this.disabled = true;
146
+ }
147
+ };
148
+ }
149
+ validateVariant(newValue, oldValue) {
150
+ if (!variants$3.includes(newValue)) {
151
+ throw new Error(`<mg-button> prop "variant" must be one of : ${variants$3.join(', ')}`);
152
+ }
153
+ else {
154
+ if (oldValue !== undefined) {
155
+ this.classList.delete(`mg-button--${oldValue}`);
156
+ }
157
+ this.classList.add(`mg-button--${newValue}`);
158
+ }
159
+ }
160
+ disabledHandler(isDisabled) {
161
+ // Remove loading when enable
162
+ // Will be set back onclick
163
+ if (!isDisabled && this.disableOnClick) {
164
+ this.loading = false;
165
+ }
166
+ // Manage if onclick
167
+ this.element.onclick = isDisabled ? undefined : this.onClickElementFn;
168
+ }
169
+ loadingHandler(newValue) {
170
+ // we add loading style if it newvalue is true else we remove it
171
+ if (newValue) {
172
+ this.classList.add('mg-button--loading');
173
+ }
174
+ else {
175
+ this.classList.delete('mg-button--loading');
176
+ }
177
+ }
178
+ /**
179
+ * Check if props are well configured on init
180
+ *
181
+ * @returns {void}
182
+ */
183
+ componentWillLoad() {
184
+ this.validateVariant(this.variant);
185
+ if (this.isIcon) {
186
+ this.classList.add(`mg-button--icon`);
187
+ if (typeof this.label !== 'string' || this.label === '') {
188
+ throw new Error(`<mg-button> prop "label" is mandatory when prop "isIcon" is set to true.`);
189
+ }
190
+ }
191
+ // Store the onclick fn
192
+ this.onClickElementFn = this.element.onclick;
193
+ this.disabledHandler(this.disabled);
194
+ }
195
+ /**
196
+ * Render component
197
+ *
198
+ * @returns {HTMLElement} html element
199
+ */
200
+ render() {
201
+ return (h("button", { id: this.identifier, class: this.classList.join(), "aria-label": this.label, "aria-disabled": this.disabled.toString(), "aria-expanded": this.expanded, "aria-controls": this.controls, "aria-haspopup": this.haspopup, onClick: this.handleClick }, this.loading && h("mg-icon", { icon: "loader", spin: true }), h("div", { class: "mg-button__content" }, h("slot", null))));
202
+ }
203
+ get element() { return getElement(this); }
204
+ static get watchers() { return {
205
+ "variant": ["validateVariant"],
206
+ "disabled": ["disabledHandler"],
207
+ "loading": ["loadingHandler"]
208
+ }; }
209
+ };
210
+ MgButton.style = mgButtonCss;
211
+
212
+ const mgCharacterLeftCss = "mg-character-left.sc-mg-character-left{display:block}";
213
+
214
+ const MgCharacterLeft = class {
215
+ constructor(hostRef) {
216
+ registerInstance(this, hostRef);
217
+ /**
218
+ * Sets the characters to count
219
+ */
220
+ this.characters = '';
221
+ }
222
+ validateMaxlength(newValue) {
223
+ if (typeof newValue !== 'number') {
224
+ throw new Error('<mg-character-left> prop "maxlength" is required.');
225
+ }
226
+ }
227
+ /*************
228
+ * Lifecycle *
229
+ *************/
230
+ /**
231
+ * Check if props are well configured on init
232
+ *
233
+ * @returns {void}
234
+ */
235
+ componentWillLoad() {
236
+ this.validateMaxlength(this.maxlength);
237
+ this.messages = initLocales(this.element).messages;
238
+ }
239
+ /**
240
+ * Render component
241
+ *
242
+ * @returns {HTMLElement} HTML Element
243
+ */
244
+ render() {
245
+ return (h("span", { id: this.identifier, "aria-live": "polite" }, h("span", { "aria-hidden": "true" }, this.maxlength - this.characters.length, "/", this.maxlength), h("span", { class: "sr-only" }, this.messages.nbCharLeft.replace('{counter}', this.maxlength - this.characters.length))));
246
+ }
247
+ get element() { return getElement(this); }
248
+ static get watchers() { return {
249
+ "maxlength": ["validateMaxlength"]
250
+ }; }
251
+ };
252
+ MgCharacterLeft.style = mgCharacterLeftCss;
253
+
254
+ const mgFormCss = ".is-asterisk{color:hsl(var(--color-danger))}.mg-form,.mg-form-group{--mg-inputs-margin-bottom:1.5rem;--mg-inputs-title-horizontal-space:3rem;--mg-inputs-title-width:15rem;--mg-inputs-shrink:0}.mg-form.mg-form--all-required,.mg-form-group.mg-form--all-required{--mg-input-title-display:none}.mg-form>p,.mg-form-group>p{font-size:1.2rem}";
255
+
256
+ const MgForm = class {
257
+ constructor(hostRef) {
258
+ registerInstance(this, hostRef);
259
+ this.formValid = createEvent(this, "form-valid", 7);
260
+ /**
261
+ * Identifier is used for the element ID (id is a reserved prop in Stencil.js)
262
+ * If not set, it will be created.
263
+ */
264
+ this.identifier = createID('mg-form');
265
+ /**
266
+ * Input name
267
+ * If not set the value equals the identifier
268
+ */
269
+ this.name = this.identifier;
270
+ /**
271
+ * Define if form is readonly
272
+ */
273
+ this.readonly = false;
274
+ /**
275
+ * Define if form is disabled
276
+ */
277
+ this.disabled = false;
278
+ /**
279
+ * Component classes
280
+ */
281
+ this.classList = new ClassList(['mg-form']);
282
+ /**
283
+ * Define required message based on mg-inputs required elements
284
+ * Also
285
+ *
286
+ * @returns {void}
287
+ */
288
+ this.setRequiredMessage = () => {
289
+ // Get required fields
290
+ const requiredInputs = this.mgInputs.filter(input => input.required && !input.disabled && !this.disabled);
291
+ // All fields are required
292
+ // mg-input-toggle can not be required
293
+ if (requiredInputs.length > 0 && requiredInputs.length === this.mgInputs.filter(input => input.nodeName !== 'MG-INPUT-TOGGLE').length) {
294
+ this.requiredMessage = this.messages.form.allRequired;
295
+ this.classList.add('mg-form--all-required');
296
+ }
297
+ // Some fields are required
298
+ else if (requiredInputs.length > 0) {
299
+ this.requiredMessage = this.messages.form.required;
300
+ }
301
+ };
302
+ /**
303
+ * Check if form is valid
304
+ *
305
+ * @returns {void}
306
+ */
307
+ this.checkValidity = () => {
308
+ const validity = !this.mgInputs.some(input => input.invalid);
309
+ this.valid = validity;
310
+ this.invalid = !validity;
311
+ this.formValid.emit(validity);
312
+ };
313
+ }
314
+ /**
315
+ * Public method to display errors
316
+ *
317
+ * @returns {Promise<void>}
318
+ */
319
+ async displayError() {
320
+ if (!this.readonly) {
321
+ this.mgInputs.forEach(input => {
322
+ input.displayError && input.displayError();
323
+ });
324
+ this.checkValidity();
325
+ }
326
+ }
327
+ /*************
328
+ * Lifecycle *
329
+ *************/
330
+ /**
331
+ * Check if component props are well configured on init
332
+ *
333
+ * @returns {void}
334
+ */
335
+ componentWillLoad() {
336
+ // Get locales
337
+ this.messages = initLocales(this.element).messages;
338
+ // Get slotted mgIputs
339
+ this.mgInputs = Array.from(this.element.querySelectorAll('*')).filter((node) => node.nodeName.startsWith('MG-INPUT-'));
340
+ // Define required message
341
+ this.setRequiredMessage();
342
+ // Check validity when slotted mgImputs are ready
343
+ Promise.all(this.mgInputs.map(async (input) => {
344
+ // Set inputs readonly or disabled based on form configuration
345
+ // Othewise listen to events
346
+ if (this.readonly)
347
+ input.readonly = true;
348
+ else if (this.disabled)
349
+ input.disabled = true;
350
+ else
351
+ input.addEventListener('input-valid', this.checkValidity);
352
+ await input.componentOnReady();
353
+ })).then(() => {
354
+ this.checkValidity();
355
+ });
356
+ }
357
+ /**
358
+ * Render
359
+ *
360
+ * @returns {HTMLElement} HTML Element
361
+ */
362
+ render() {
363
+ return (h("form", { class: this.classList.join(), id: this.identifier, name: this.name }, this.requiredMessage && h("p", { innerHTML: this.requiredMessage }), h("slot", null), !this.readonly && !this.disabled && h("slot", { name: "actions" })));
364
+ }
365
+ get element() { return getElement(this); }
366
+ };
367
+ MgForm.style = mgFormCss;
368
+
369
+ /**
370
+ * Icon SVG paths
371
+ */
372
+ const icons = {
373
+ 'address-card': () => (h("path", { fill: "currentColor", d: "M14.21 2.67H1.79c-.63 0-1.14.51-1.14 1.14v8.38c0 .63.51 1.14 1.14 1.14h12.42c.63 0 1.14-.51 1.14-1.14V3.81c0-.63-.51-1.14-1.14-1.14ZM5.35 5c.84 0 1.53.69 1.53 1.53 0 .84-.69 1.53-1.53 1.53-.84 0-1.53-.69-1.53-1.53v-.05c.02-.83.7-1.49 1.53-1.48ZM8 10.59a.5.5 0 0 1-.53.46H3.21a.5.5 0 0 1-.53-.46v-.46c.07-.81.78-1.42 1.6-1.37h.12c.61.26 1.29.26 1.9 0h.12c.81-.04 1.51.56 1.58 1.37v.46Zm5.34-1.26c0 .1-.09.19-.19.19H9.73c-.1 0-.18-.07-.19-.17V9c0-.1.09-.19.19-.19h3.43c.1 0 .18.09.19.19v.33Zm0-1.52c0 .1-.09.18-.19.19H9.73c-.1 0-.19-.09-.19-.19v-.38c0-.1.07-.18.17-.19h3.45c.1 0 .19.09.19.19v.38Zm0-1.52c0 .1-.09.18-.19.19H9.73c-.1 0-.19-.09-.19-.19V5.9c0-.1.09-.19.19-.19h3.43c.11 0 .19.09.19.2v.38Z" })),
374
+ 'align-center': () => (h("path", { fill: "currentColor", d: "M13.88 5.29H2.12c-.25 0-.45.2-.45.45v.9c0 .25.2.45.45.45h11.76c.25 0 .45-.2.45-.45v-.9c0-.25-.2-.45-.45-.45Zm0 7.24H2.12c-.25 0-.45.2-.45.45v.9c0 .25.2.45.45.45h11.76c.25 0 .45-.2.45-.45v-.9c0-.25-.2-.45-.45-.45ZM4.72 3.48h6.55c.19 0 .34-.15.34-.34V2.01c0-.19-.15-.34-.34-.34H4.72c-.19 0-.34.15-.34.34v1.13c0 .19.15.34.34.34Zm6.55 7.24c.19 0 .34-.15.34-.34V9.25c0-.19-.15-.34-.34-.34H4.72c-.19 0-.34.15-.34.34v1.13c0 .19.15.34.34.34h6.55Z" })),
375
+ 'align-justify': () => (h("path", { fill: "currentColor", d: "M13.88 12.52H2.12c-.25 0-.45.21-.45.46v.9c0 .25.2.45.45.45h11.76c.25 0 .45-.2.45-.45V13a.466.466 0 0 0-.44-.48h-.01Zm0-3.62H2.12c-.25 0-.45.21-.45.46v.9c0 .25.2.45.45.45h11.76c.25 0 .45-.2.45-.45v-.9c0-.25-.2-.45-.45-.46Zm0-3.61H2.12c-.25 0-.45.2-.45.45v.9c0 .25.2.45.45.46h11.76c.25 0 .45-.21.45-.46v-.9c0-.25-.2-.45-.45-.45Zm0-3.62H2.12c-.25 0-.45.2-.45.45V3c0 .25.2.45.45.46h11.76c.25 0 .45-.21.45-.46v-.9a.45.45 0 0 0-.45-.43Z" })),
376
+ 'align-left': () => (h("path", { fill: "currentColor", d: "M2 10.71h7.45c.2 0 .36-.16.36-.36V9.27c0-.2-.16-.36-.36-.37H2c-.2 0-.36.17-.36.37v1.08c0 .2.16.36.36.36Zm0-7.23h7.45c.2 0 .36-.17.36-.37V2c0-.2-.16-.36-.36-.36H2a.36.36 0 0 0-.33.36v1.11c0 .19.14.35.33.37Zm11.88 1.81H2.12c-.25 0-.45.2-.45.45v.9c0 .25.2.45.45.46h11.76c.25 0 .45-.21.45-.46v-.9c0-.25-.2-.45-.45-.45Zm0 7.23H2.12c-.25 0-.45.21-.45.46v.9c0 .25.2.45.45.45h11.76c.25 0 .45-.2.45-.45V13c0-.25-.2-.45-.45-.46v-.02Z" })),
377
+ 'align-right': () => (h("path", { fill: "currentColor", d: "M2.12 7.1h11.76c.25 0 .45-.21.45-.46v-.9c0-.25-.2-.45-.45-.45H2.12c-.25 0-.45.2-.45.45v.9c0 .25.2.45.45.46Zm11.76 5.42H2.12c-.25 0-.45.21-.45.46v.9c0 .25.2.45.45.45h11.76c.25 0 .45-.2.45-.45V13a.466.466 0 0 0-.44-.48h-.01ZM14 1.67H6.55a.36.36 0 0 0-.36.33v1.11c0 .2.16.36.36.37H14c.2 0 .36-.17.36-.37V2a.36.36 0 0 0-.36-.33Zm0 7.23H6.55c-.2 0-.36.17-.36.37v1.08c0 .2.16.36.36.36H14c.2 0 .36-.16.36-.36V9.27c0-.2-.16-.36-.36-.37Z" })),
378
+ 'api': () => (h("path", { fill: "currentColor", d: "M14.44 11.47h-.02l-.66-.1-.02-.08c-.03-.11-.08-.21-.13-.31l-.04-.07.4-.54v-.02l-.52-.52h-.02l-.54.41-.07-.04c-.1-.05-.2-.09-.31-.13l-.08-.02-.1-.67v-.01h-.73v.02l-.1.66-.08.02c-.11.03-.21.08-.31.13l-.07.04-.55-.41-.52.52v.02l.41.54-.04.07c-.05.1-.09.2-.13.31l-.02.08-.67.1h-.01v.73h.02l.66.1.02.08c.03.1.08.21.13.3l.04.07-.41.55.52.52h.02l.54-.41.07.04c.1.05.2.09.31.13l.08.02.1.67v.01h.73v-.02l.1-.66.08-.02c.11-.03.21-.08.31-.13l.07-.04.55.41.52-.52v-.02l-.4-.54.04-.07c.05-.1.09-.2.13-.31l.02-.08.67-.1h.01v-.73Zm-2.46 1.38c-.56 0-1.01-.45-1.01-1.01s.45-1.01 1.01-1.01 1.01.45 1.01 1.01-.45 1.01-1.01 1.01ZM8.51 5.81c-.11-.09-.27-.14-.5-.14h-.38v1.17h.27c.26 0 .45-.05.58-.15.13-.1.19-.25.19-.44s-.05-.34-.16-.43Zm1.57 5.13-.3-.4c-.1-.1-.09-.27 0-.37l.52-.52c.1-.1.26-.1.37 0l.4.29c.06-.03.13-.06.2-.08l.07-.49c0-.14.12-.25.26-.25h.45a5.44 5.44 0 1 0-10.5-1.99 5.44 5.44 0 0 0 5.44 5.44c.78 0 1.54-.17 2.25-.49v-.6c0-.14.11-.26.26-.26l.49-.07c.02-.07.05-.13.08-.2Zm.18-5.96h.84v3.94h-.84V4.98ZM5.4 8.92l-.29-.94H3.67l-.29.94h-.9l1.39-3.96h1.02l1.4 3.96h-.9Zm3.72-1.74c-.26.23-.64.34-1.13.34h-.36v1.4h-.84V4.98h1.26c.48 0 .84.1 1.09.31.25.21.37.51.37.92 0 .42-.13.75-.4.97ZM4.4 5.57c-.06.23-.23.8-.51 1.71h1.03c-.26-.85-.41-1.33-.45-1.44-.03-.11-.06-.2-.07-.26Z" })),
379
+ 'arrow-down': () => (h("path", { fill: "currentColor", d: "M13,10.1H10.23a.31.31,0,0,1-.32-.28h0V.94A.3.3,0,0,0,9.59.65H6.37A.32.32,0,0,0,6,.94H6V9.81a.29.29,0,0,1-.31.29H3a.3.3,0,0,0-.31.29.27.27,0,0,0,.08.22l5.06,4.58a.36.36,0,0,0,.46,0l5-4.58a.29.29,0,0,0,0-.42C13.22,10.1,13.12,10.1,13,10.1Z" })),
380
+ 'arrow-left': () => (h("path", { fill: "currentColor", d: "M5.88,12.93V10.18a.3.3,0,0,1,.28-.32H15a.31.31,0,0,0,.29-.33h0V6.32A.31.31,0,0,0,15,6H6.17a.32.32,0,0,1-.29-.31h0V2.93a.3.3,0,0,0-.28-.32.32.32,0,0,0-.23.09L.79,7.76a.36.36,0,0,0,0,.46l4.58,5a.31.31,0,0,0,.43,0A.4.4,0,0,0,5.88,12.93Z" })),
381
+ 'arrow-right': () => (h("path", { fill: "currentColor", d: "M10.16,3V5.75a.3.3,0,0,1-.28.32H1a.31.31,0,0,0-.29.33h0V9.61A.31.31,0,0,0,1,9.94H9.87a.29.29,0,0,1,.29.31h0V13a.3.3,0,0,0,.28.32.32.32,0,0,0,.23-.09l4.58-5.06a.36.36,0,0,0,0-.46l-4.58-5a.3.3,0,0,0-.42,0C10.16,2.76,10.16,2.87,10.16,3Z" })),
382
+ 'arrow-rotate': () => (h("path", { fill: "currentColor", d: "M8.02 1.67c-1.6 0-3.15.59-4.33 1.67a6.316 6.316 0 0 0-.38 8.94 6.324 6.324 0 0 0 8.94.37.29.29 0 0 0 0-.42l-1-1a.296.296 0 0 0-.41 0 4.302 4.302 0 0 1-5.76-.09 4.276 4.276 0 0 1-.21-6.06 4.276 4.276 0 0 1 6.06-.21L9.86 5.95c-.11.12-.18.27-.18.43 0 .34.28.62.62.62h3.44c.34-.01.6-.29.59-.63V2.94a.62.62 0 0 0-.18-.44.61.61 0 0 0-.85 0l-.91.91a6.37 6.37 0 0 0-4.38-1.75h.02Z" })),
383
+ 'arrow-rotate-backward': () => (h("path", { fill: "currentColor", d: "M8 1.67c-1.63 0-3.2.63-4.38 1.75l-.91-.91a.6.6 0 0 0-.85-.01h-.01a.62.62 0 0 0-.18.44v3.43c-.01.34.25.62.59.63H5.7c.34 0 .62-.28.62-.62 0-.16-.07-.31-.18-.43L5.07 4.87a4.276 4.276 0 0 1 6.06.21 4.276 4.276 0 0 1-.21 6.06 4.302 4.302 0 0 1-5.76.09.296.296 0 0 0-.41 0l-1 1a.29.29 0 0 0 0 .42 6.324 6.324 0 0 0 8.94-.37 6.316 6.316 0 0 0-.38-8.94 6.365 6.365 0 0 0-4.33-1.67Z" })),
384
+ 'arrow-up': () => (h("path", { fill: "currentColor", d: "M3.06,5.82H5.81a.31.31,0,0,1,.32.28h0V15a.31.31,0,0,0,.33.29H9.67A.3.3,0,0,0,10,15h0V6.11a.3.3,0,0,1,.31-.29h2.75a.3.3,0,0,0,.23-.51L8.23.73a.36.36,0,0,0-.46,0l-5,4.58a.3.3,0,0,0,0,.43C2.82,5.83,2.92,5.82,3.06,5.82Z" })),
385
+ 'arrow-up-right-square': () => (h("path", { fill: "currentColor", d: "M14.33 3v10A1.34 1.34 0 0 1 13 14.33H3A1.34 1.34 0 0 1 1.67 13V3A1.34 1.34 0 0 1 3 1.67h10A1.34 1.34 0 0 1 14.33 3Zm-2.48.46H8.68a.67.67 0 0 0-.68.7.63.63 0 0 0 .2.47l.91.91-5.53 5.53a.33.33 0 0 0 0 .48l.87.87a.33.33 0 0 0 .48 0l5.53-5.52.91.9a.69.69 0 0 0 1 0 .71.71 0 0 0 .19-.48V4.15a.67.67 0 0 0-.67-.67Z" })),
386
+ 'arrows-right-left': () => (h("path", { fill: "currentColor", d: "M.73,5.65V5.23a.64.64,0,0,1,.64-.64H12V3.31a.64.64,0,0,1,.64-.64.63.63,0,0,1,.45.18L15.19,5a.63.63,0,0,1,0,.9L13.05,8A.65.65,0,0,1,12,7.57V6.29H1.37a.64.64,0,0,1-.64-.64Zm14,4.06H4.09V8.43A.64.64,0,0,0,3,8L.87,10.11a.63.63,0,0,0,0,.9L3,13.15a.64.64,0,0,0,.91,0,.61.61,0,0,0,.18-.45V11.41H14.73a.63.63,0,0,0,.64-.64h0v-.42a.63.63,0,0,0-.64-.64Z" })),
387
+ 'arrows-rotate': () => (h("path", { fill: "currentColor", d: "M14.3 6.37V2.94c0-.16-.06-.32-.18-.43a.6.6 0 0 0-.85 0l-.91.91a6.354 6.354 0 0 0-3.31-1.65 6.365 6.365 0 0 0-7.33 5.22h2.14c.16-.72.5-1.38 1-1.92v-.02a4.281 4.281 0 0 1 6.05-.18L9.84 6c-.1.1-.16.24-.18.38 0 .34.28.62.62.62h3.44c.33-.02.59-.3.58-.63ZM1.71 9.63v3.43c0 .16.06.32.18.43a.6.6 0 0 0 .85 0l.91-.91c.92.88 2.09 1.46 3.35 1.66 3.47.57 6.74-1.77 7.31-5.24h-2.14c-.17.74-.54 1.42-1.06 1.97a4.254 4.254 0 0 1-6.02.16l1.07-1.08c.11-.11.17-.27.17-.42A.63.63 0 0 0 5.72 9H2.28c-.33.03-.58.3-.57.63Z" })),
388
+ 'arrows-rotate-backward': () => (h("path", { fill: "currentColor", d: "M2.3,7h3.4c0.3,0,0.6-0.3,0.6-0.6c0-0.1-0.1-0.3-0.2-0.4L5.1,4.9c1.7-1.6,4.4-1.5,6,0.2c0,0,0,0,0,0 c0.5,0.5,0.8,1.2,1,1.9h2.1C13.7,3.5,10.4,1.2,7,1.8C5.7,2,4.6,2.6,3.6,3.4L2.7,2.5c-0.2-0.2-0.6-0.2-0.8,0c0,0,0,0,0,0l0,0 C1.8,2.6,1.7,2.8,1.7,2.9v3.4C1.7,6.7,1.9,7,2.3,7z M13.7,9h-3.4C9.9,9,9.7,9.3,9.7,9.6c0,0.2,0.1,0.3,0.2,0.4l1.1,1.1 c-1.7,1.6-4.4,1.5-6-0.2C4.4,10.4,4,9.7,3.8,9H1.7c0.6,3.5,3.9,5.8,7.3,5.2c1.3-0.2,2.4-0.8,3.3-1.7l0.9,0.9c0.2,0.2,0.6,0.2,0.8,0 c0,0,0,0,0,0l0,0c0.1-0.1,0.2-0.3,0.2-0.4V9.6C14.3,9.3,14.1,9,13.7,9z" })),
389
+ 'ban': () => (h("path", { fill: "currentColor", d: "M8 .67A7.33 7.33 0 1 0 15.33 8 7.33 7.33 0 0 0 8 .67Zm3.85 3.48a5.46 5.46 0 0 1 .61 7L4.88 3.54a5.46 5.46 0 0 1 6.97.61Zm-7.7 7.7a5.45 5.45 0 0 1-.61-7l7.58 7.58a5.46 5.46 0 0 1-7-.61Z" })),
390
+ 'bell': () => (h("path", { fill: "currentColor", d: "M8 15.33a1.7 1.7 0 0 0 1.52-1.83h-3A1.7 1.7 0 0 0 8 15.33ZM13.13 11c-.46-.59-1.32-1.48-1.32-4.42a4.4 4.4 0 0 0-3.05-4.4v-.6A.85.85 0 0 0 8 .67a.85.85 0 0 0-.76.91v.6a4.4 4.4 0 0 0-3 4.44c0 2.94-.86 3.83-1.32 4.42a1 1 0 0 0-.2.63.85.85 0 0 0 .76.91h9.14a.85.85 0 0 0 .76-.91 1.05 1.05 0 0 0-.25-.67Z" })),
391
+ 'briefcase': () => (h("path", { fill: "currentColor", d: "M13.93 4.33H11V2.07c0-.22-.18-.4-.4-.4H5.4c-.22 0-.4.18-.4.4v2.26H2.07c-.22 0-.4.18-.4.4v8.2c0 .22.18.4.4.4h11.86c.22 0 .4-.18.4-.4v-8.2c0-.22-.18-.4-.4-.4Zm-7.6 0V3h3.34v1.33H6.33Z" })),
392
+ 'calculator': () => (h("path", { fill: "currentColor", d: "M12.83.67H3.17a.5.5 0 0 0-.5.5v13.66a.5.5 0 0 0 .5.5h9.66a.5.5 0 0 0 .5-.5V1.17a.5.5 0 0 0-.5-.5ZM5.58 13.39a.29.29 0 0 1-.28.3H4.1a.29.29 0 0 1-.3-.28v-1.2a.29.29 0 0 1 .28-.3h1.2a.29.29 0 0 1 .3.28v1.2Zm0-3.28a.29.29 0 0 1-.3.3H4.1a.29.29 0 0 1-.3-.3V8.93a.29.29 0 0 1 .28-.3h1.2a.29.29 0 0 1 .3.28v1.2Zm3.29 3.28a.29.29 0 0 1-.3.3H7.38a.29.29 0 0 1-.3-.3v-1.18a.29.29 0 0 1 .3-.3h1.19a.29.29 0 0 1 .3.3Zm0-3.28a.32.32 0 0 1-.3.3H7.38a.32.32 0 0 1-.3-.3V8.93a.29.29 0 0 1 .3-.3h1.19a.29.29 0 0 1 .3.3Zm3.33 3.28a.29.29 0 0 1-.28.3h-1.25a.29.29 0 0 1-.3-.28V8.93a.29.29 0 0 1 .28-.3h1.25a.29.29 0 0 1 .3.28v4.48Zm0-7.15a.29.29 0 0 1-.3.3H4.1a.29.29 0 0 1-.3-.3V2.61a.29.29 0 0 1 .28-.3h7.82a.29.29 0 0 1 .3.28v3.65Z" })),
393
+ 'calendar': () => (h("path", { fill: "currentColor", d: "M14.52 4.43h-13V2.92a1.28 1.28 0 0 1 1.25-1.28h10.36A1.39 1.39 0 0 1 14.52 3Zm0 .93v7.91a1.41 1.41 0 0 1-1.4 1.4H2.88a1.41 1.41 0 0 1-1.4-1.4V5.36Zm-3.73 3.37a.35.35 0 0 0 .35.35h1.16a.34.34 0 0 0 .35-.35V7.57a.35.35 0 0 0-.35-.35h-1.16a.35.35 0 0 0-.35.35Zm-5.58 2.56a.35.35 0 0 0-.35-.35H3.7a.35.35 0 0 0-.35.35v1.17a.35.35 0 0 0 .35.35h1.16a.35.35 0 0 0 .35-.35Zm0-3.72a.35.35 0 0 0-.35-.35H3.7a.35.35 0 0 0-.35.35v1.16a.34.34 0 0 0 .35.35h1.16a.35.35 0 0 0 .35-.35Zm3.72 3.72a.35.35 0 0 0-.35-.35H7.42a.35.35 0 0 0-.35.35v1.17a.35.35 0 0 0 .35.35h1.16a.35.35 0 0 0 .35-.35Zm0-3.72a.35.35 0 0 0-.35-.35H7.42a.35.35 0 0 0-.35.35v1.16a.35.35 0 0 0 .35.35h1.16a.35.35 0 0 0 .35-.35Z" })),
394
+ 'calendar-euro': () => (h("path", { fill: "currentColor", d: "M11.06 3.51h-1.04v.62a.2.2 0 0 1-.2.2H9.4c-.11 0-.21-.09-.21-.2v-.62H4.23v.62c0 .11-.09.2-.21.2h-.41c-.11 0-.21-.09-.21-.2v-.62H2.37c-.57 0-1.03.47-1.03 1.03v7.03c0 .57.47 1.03 1.03 1.03h5.3c-.25-.25-.46-.52-.63-.83H2.68a.53.53 0 0 1-.52-.52V6.61c0-.11.09-.21.21-.21h5.29a4.4 4.4 0 0 1 3.19-1.36c.43 0 .85.06 1.24.18v-.69c0-.57-.46-1.03-1.03-1.03Zm-6.83-.62c0-.11-.09-.21-.21-.21h-.41c-.11 0-.21.09-.21.21v.62h.83v-.62Zm5.79 0c0-.11-.09-.21-.21-.21H9.4c-.11 0-.21.09-.21.21v.62h.83v-.62Zm2.07 3c-.39-.13-.81-.21-1.24-.21-.83 0-1.6.26-2.23.73-.96.69-1.59 1.82-1.59 3.09 0 .86.28 1.65.77 2.29.23.32.52.6.85.83.62.45 1.38.71 2.2.71 2.11 0 3.82-1.72 3.82-3.82 0-1.67-1.08-3.09-2.58-3.61Zm.12 6.18c.01.07-.04.15-.11.16-.09.03-.2.04-.3.05-.14.03-.28.04-.43.04-.61.02-1.18-.18-1.63-.54-.41-.32-.73-.77-.88-1.29h-.37c-.08 0-.15-.06-.15-.15V10c0-.08.07-.14.15-.14h.26v-.5h-.26c-.08 0-.15-.06-.15-.14v-.37c0-.08.07-.14.15-.14h.4a2.576 2.576 0 0 1 2.37-1.7h.1c.22 0 .44.02.64.06.04.01.07.03.08.06.02.03.03.07.02.11l-.02.07-.13.46a.14.14 0 0 1-.17.1c-.15-.03-.3-.04-.45-.05h-.08c-.58.01-1.1.35-1.34.88h1.71c.08.02.12.09.11.17l-.08.36a.15.15 0 0 1-.15.11H9.73c-.01.16-.01.33 0 .5h1.66c.08.02.13.09.11.17l-.07.33c-.02.06-.08.11-.14.11H9.91c.21.56.72.94 1.3 1 .05 0 .1.01.15.01.19 0 .37-.03.55-.06.07-.02.14.03.16.09v.02l.11.52Z" })),
395
+ 'check': () => (h("path", { fill: "currentColor", d: "m15.27 4.23-1.11-1.18c-.11-.1-.27-.1-.38 0L6 10.36l-3.76-4a.187.187 0 0 0-.26 0L.71 7.6c-.07.07-.07.19 0 .26l5.12 5.41c.07.07.18.07.25 0l1.3-1.23 7.87-7.45c.1-.1.11-.26.01-.37h.01Z" })),
396
+ 'check-circle': () => (h("path", { fill: "currentColor", d: "M15.33 8A7.33 7.33 0 1 1 8 .67 7.33 7.33 0 0 1 15.33 8Zm-8.18 3.88 5.44-5.44a.46.46 0 0 0 0-.65l-.67-.67a.48.48 0 0 0-.67 0L6.82 9.54 4.75 7.47a.46.46 0 0 0-.65 0l-.67.67a.46.46 0 0 0 0 .65l3.07 3.07a.46.46 0 0 0 .65 0Z" })),
397
+ 'chevron-down': () => (h("path", { fill: "currentColor", d: "M7.43,12.21.9,5.69a.81.81,0,0,1,0-1.14h0l.76-.77a.81.81,0,0,1,1.14,0L8,9l5.2-5.18a.81.81,0,0,1,1.14,0l.76.77a.8.8,0,0,1,0,1.13h0L8.57,12.21a.79.79,0,0,1-1.13,0Z" })),
398
+ 'chevron-down-circle': () => (h("path", { fill: "currentColor", d: "M15.33 8A7.33 7.33 0 1 1 8 .67 7.33 7.33 0 0 1 15.33 8ZM8.5 11.37l4-4a.7.7 0 0 0 0-1l-.5-.52a.72.72 0 0 0-1 0l-3 3-3-3a.72.72 0 0 0-1 0l-.5.51a.7.7 0 0 0 0 1l4 4a.7.7 0 0 0 1 0Z" })),
399
+ 'chevron-left': () => (h("path", { fill: "currentColor", d: "M3.79,7.43,10.31.9a.81.81,0,0,1,1.14,0h0l.77.76a.81.81,0,0,1,0,1.14L7,8l5.18,5.2a.81.81,0,0,1,0,1.14l-.77.76a.8.8,0,0,1-1.13,0h0L3.79,8.57a.79.79,0,0,1,0-1.13Z" })),
400
+ 'chevron-left-circle': () => (h("path", { fill: "currentColor", d: "M8 15.33C3.95 15.33.67 12.05.67 8S3.95.67 8 .67 15.33 3.95 15.33 8c0 4.05-3.28 7.33-7.33 7.33ZM4.63 8.5l4 4c.27.28.71.28.99.01h.01l.52-.51c.27-.28.27-.72 0-1l-3-3 3-3c.27-.28.27-.72 0-1l-.51-.5a.697.697 0 0 0-.99-.01h-.01l-4 4.01c-.28.27-.28.71-.01.99Z" })),
401
+ 'chevron-right': () => (h("path", { fill: "currentColor", d: "M12.21,8.57,5.69,15.1a.81.81,0,0,1-1.14,0h0l-.77-.76a.81.81,0,0,1,0-1.14L9,8,3.78,2.8a.81.81,0,0,1,0-1.14L4.55.9A.8.8,0,0,1,5.68.9h0l6.53,6.53a.79.79,0,0,1,0,1.13Z" })),
402
+ 'chevron-right-circle': () => (h("path", { fill: "currentColor", d: "M8 .67c4.05 0 7.33 3.28 7.33 7.33S12.05 15.33 8 15.33.67 12.05.67 8C.67 3.95 3.95.67 8 .67Zm3.37 6.83-4-4a.697.697 0 0 0-.99-.01h-.01L5.85 4c-.27.28-.27.72 0 1l3 3-3 3c-.27.28-.27.72 0 1l.51.5c.27.28.71.28.99.01h.01l4-4.01c.28-.27.28-.71.01-.99Z" })),
403
+ 'chevron-up': () => (h("path", { fill: "currentColor", d: "M8.57,3.79l6.53,6.52a.81.81,0,0,1,0,1.14h0l-.76.77a.81.81,0,0,1-1.14,0L8,7,2.8,12.22a.81.81,0,0,1-1.14,0L.9,11.45a.8.8,0,0,1,0-1.13h0L7.43,3.79a.79.79,0,0,1,1.13,0Z" })),
404
+ 'chevron-up-circle': () => (h("path", { fill: "currentColor", d: "M.67 8C.67 3.95 3.95.67 8 .67S15.33 3.95 15.33 8 12.05 15.33 8 15.33C3.95 15.33.67 12.05.67 8ZM7.5 4.63l-4 4c-.28.27-.28.71-.01.99h.01l.5.53c.28.27.72.27 1 0l3-3 3 3c.28.27.72.27 1 0l.5-.51c.28-.27.28-.71.01-.99h-.01l-4-4.01a.697.697 0 0 0-.99-.01H7.5Z" })),
405
+ 'clock': () => (h("path", { fill: "currentColor", d: "M8,.67C3.95,.67,.67,3.95,.67,8s3.28,7.33,7.33,7.33,7.33-3.28,7.33-7.33h0C15.33,3.95,12.05,.67,8,.67h0Zm1.69,10.33l-2.61-1.88c-.09-.07-.14-.17-.14-.28V3.84c0-.19,.16-.35,.35-.36h1.42c.2,0,.35,.16,.36,.36V7.93l1.87,1.37c.16,.1,.2,.32,.09,.47v.02h-.01l-.83,1.15c-.12,.15-.34,.18-.5,.06Z" })),
406
+ 'conversation': () => (h("path", { fill: "currentColor", d: "M11.22,6.48c0-2.11-2.36-3.81-5.28-3.81S.67,4.37.67,6.48a3.15,3.15,0,0,0,1,2.19A5.17,5.17,0,0,1,.72,10a.2.2,0,0,0,0,.21.23.23,0,0,0,.19.12,4.79,4.79,0,0,0,2.25-.6,6.84,6.84,0,0,0,2.82.6C8.86,10.29,11.22,8.58,11.22,6.48Zm3.1,5.23a3.08,3.08,0,0,0,1-2.19C15.28,7.93,14,6.57,12,6a3.84,3.84,0,0,1,0,.48C12,9,9.3,11.05,6,11.05a7.16,7.16,0,0,1-.8-.05A5.6,5.6,0,0,0,10,13.33a6.7,6.7,0,0,0,2.82-.59,4.66,4.66,0,0,0,2.25.59.21.21,0,0,0,.19-.11.2.2,0,0,0,0-.21,5.15,5.15,0,0,1-.91-1.3Z" })),
407
+ 'cog': () => (h("path", { fill: "currentColor", d: "M14.82 9.76 13.56 9a5.54 5.54 0 0 0 0-2.07l1.26-.72a.36.36 0 0 0 .18-.38A7.5 7.5 0 0 0 13.37 3a.35.35 0 0 0-.44 0l-1.26.72a5.51 5.51 0 0 0-1.79-1V1.21a.34.34 0 0 0-.27-.34 7.29 7.29 0 0 0-3.22 0 .34.34 0 0 0-.28.34v1.45a5.83 5.83 0 0 0-1.79 1L3.06 3a.35.35 0 0 0-.43 0A7.24 7.24 0 0 0 1 5.83a.34.34 0 0 0 .16.41L2.44 7a5.49 5.49 0 0 0 0 2l-1.26.73a.35.35 0 0 0-.16.41A7.24 7.24 0 0 0 2.63 13a.35.35 0 0 0 .43.07l1.26-.73a5.56 5.56 0 0 0 1.79 1v1.45a.35.35 0 0 0 .28.34 7.29 7.29 0 0 0 3.22 0 .35.35 0 0 0 .28-.34v-1.45a6 6 0 0 0 1.79-1l1.26.73a.35.35 0 0 0 .43-.07A7.39 7.39 0 0 0 15 10.17a.37.37 0 0 0-.17-.41Zm-6.82.6A2.36 2.36 0 1 1 10.35 8 2.36 2.36 0 0 1 8 10.36Z" })),
408
+ 'comment': () => (h("path", { fill: "currentColor", d: "M8 1.67c-3.37-.12-6.21 2.51-6.33 5.88 0 1.36.5 2.68 1.41 3.69-.26 1-.72 1.94-1.36 2.76-.04.08-.04.17 0 .25.03.08.1.13.18.13 1.3-.03 2.54-.55 3.48-1.45.83.34 1.72.51 2.62.5 3.37.12 6.21-2.51 6.33-5.88-.12-3.37-2.96-6-6.33-5.88Zm2.53 8.43c0 .14-.11.25-.25.25H5.73c-.14 0-.25-.1-.26-.24V9.2c0-.17.13-.3.3-.31h4.5c.14 0 .26.12.26.26v.95Zm.92-3.29c0 .17-.13.3-.3.3h-6.3c-.17 0-.3-.13-.3-.3V6c0-.16.12-.29.28-.3H11.15c.16 0 .29.12.3.28V6.81Z" })),
409
+ 'credit-card': () => (h("path", { fill: "currentColor", d: "M14 2.67H2A1.33 1.33 0 0 0 .67 4v8A1.32 1.32 0 0 0 2 13.33h12A1.32 1.32 0 0 0 15.33 12V4A1.32 1.32 0 0 0 14 2.67M14 12H2V8h12Zm0-6.67H2V4h12Z" })),
410
+ 'cross': () => (h("path", { fill: "currentColor", d: "M14.26 12.74 9.52 8l4.7-4.7a.29.29 0 0 0 0-.41l-1.1-1.1a.29.29 0 0 0-.41 0L8 6.48 3.26 1.74a.24.24 0 0 0-.34 0L1.74 2.91a.24.24 0 0 0 0 .34L6.48 8l-4.7 4.7a.29.29 0 0 0 0 .41l1.1 1.1a.29.29 0 0 0 .41 0L8 9.52l4.74 4.74a.24.24 0 0 0 .34 0l1.17-1.17a.24.24 0 0 0 0-.34Z" })),
411
+ 'cross-circle': () => (h("path", { fill: "currentColor", d: "M8.06.67H8A7.33 7.33 0 0 0 .68 8v.1a7.42 7.42 0 0 0 7.23 7.23A7.33 7.33 0 1 0 8.06.67Zm3.6 9.57a.28.28 0 0 1 0 .4l-.19.2-.61.61-.2.19a.27.27 0 0 1-.39 0L8 9.41l-2.23 2.24a.27.27 0 0 1-.39 0l-.2-.2-.6-.6-.19-.2a.28.28 0 0 1 0-.4L6.6 8 4.36 5.76a.28.28 0 0 1 0-.4l1-1a.28.28 0 0 1 .4 0L8 6.59l2.24-2.24a.28.28 0 0 1 .4 0l.2.2.6.6.2.2a.28.28 0 0 1 0 .4L9.42 8Z" })),
412
+ 'download': () => (h("path", { fill: "currentColor", d: "M6.4 2v4.1c0 .2-.1.3-.3.3H4c-.2 0-.3.1-.3.3 0 .1 0 .2.1.2l4 4c.1.1.3.1.4 0l4-4c.1-.1.1-.3 0-.4-.1-.1-.1-.1-.2-.1H9.9c-.2 0-.3-.1-.3-.3V2c0-.2-.1-.3-.3-.3H6.7c-.1 0-.3.1-.3.3zm7.9 11v1c0 .2-.1.3-.3.3H2c-.2 0-.3-.1-.3-.3v-1c0-.2.1-.3.3-.3h12c.2 0 .3.1.3.3z" })),
413
+ 'euro': () => (h("path", { fill: "currentColor", d: "M13 13.14a.4.4 0 0 0-.47-.31A7.79 7.79 0 0 1 11 13a4.31 4.31 0 0 1-4-2.79h3.8a.41.41 0 0 0 .39-.31l.19-.9a.39.39 0 0 0-.3-.47H6.51a7.07 7.07 0 0 1 0-1.38h4.89a.4.4 0 0 0 .39-.31l.22-1a.4.4 0 0 0-.3-.47H7a4.2 4.2 0 0 1 3.92-2.45 6.57 6.57 0 0 1 1.26.14.41.41 0 0 0 .47-.29l.4-1.45a.4.4 0 0 0-.28-.48A9.43 9.43 0 0 0 11 .67a7.12 7.12 0 0 0-6.83 4.7h-1.1a.4.4 0 0 0-.4.39v1a.4.4 0 0 0 .4.39h.72a9.08 9.08 0 0 0 0 1.38h-.72a.39.39 0 0 0-.4.39v.93a.4.4 0 0 0 .4.39h1A7 7 0 0 0 11 15.3a8.7 8.7 0 0 0 2-.25.39.39 0 0 0 .3-.46l-.3-1.45Z" })),
414
+ 'exclamation-circle': () => (h("path", { fill: "currentColor", d: "M8 15.33c4.05 0 7.33-3.28 7.33-7.33S12.05.67 8 .67.67 3.95.67 8 3.95 15.33 8 15.33Zm.95-3.3c0 .15-.12.27-.28.27h-1.4c-.15 0-.28-.12-.28-.27v-1.31c0-.15.12-.28.28-.28h1.4c.15 0 .28.12.28.28v1.31ZM7 3.96c0-.14.11-.25.25-.25H8.7c.14 0 .25.11.25.25v4.8c0 .14-.11.25-.25.25H7.25c-.14 0-.25-.11-.25-.25V3.95Z" })),
415
+ 'exclamation-triangle': () => (h("path", { fill: "currentColor", d: "m14.3 13.88-6-12a.32.32 0 0 0-.41-.15.31.31 0 0 0-.15.15l-6 12a.31.31 0 0 0 .14.42.32.32 0 0 0 .14 0H14a.31.31 0 0 0 .33-.29.23.23 0 0 0-.03-.13ZM7 6a.28.28 0 0 1 .28-.28h1.46A.28.28 0 0 1 9 6v4a.29.29 0 0 1-.28.29H7.3A.29.29 0 0 1 7 10Zm2 7a.31.31 0 0 1-.31.32H7.34A.32.32 0 0 1 7 13v-1.37a.31.31 0 0 1 .32-.31h1.39a.31.31 0 0 1 .31.31Z" })),
416
+ 'eye': () => [
417
+ h("circle", { fill: "currentColor", cx: "8.01", cy: "7.96", r: "2.44" }),
418
+ h("path", { fill: "currentColor", d: "M15.24 7.59A8.12 8.12 0 0 0 8 2.67 8.12 8.12 0 0 0 .76 7.59a1 1 0 0 0 0 .82A8.12 8.12 0 0 0 8 13.33a8.12 8.12 0 0 0 7.24-4.92 1 1 0 0 0 0-.82ZM8 11.62A3.66 3.66 0 1 1 11.67 8 3.66 3.66 0 0 1 8 11.62Z" }),
419
+ ],
420
+ 'eye-slash': () => [
421
+ h("path", { fill: "currentColor", d: "M10.25 7a2.43 2.43 0 0 0-2.08-1.46ZM6.45 6.1a2.43 2.43 0 1 0 3.85 2.69Z" }),
422
+ h("path", { fill: "currentColor", d: "M15.24 7.59A8.13 8.13 0 0 0 8 2.67a8.06 8.06 0 0 0-2.89.64l1.72 1.2A3.58 3.58 0 0 1 8 4.3a3.65 3.65 0 0 1 3.64 3.6l2.77 1.93a7.91 7.91 0 0 0 .81-1.42 1 1 0 0 0 .02-.82ZM.81 3.84 2.51 5A8.16 8.16 0 0 0 .76 7.59a1 1 0 0 0 0 .82A8.13 8.13 0 0 0 8 13.33a8 8 0 0 0 4.32-1.4l2 1.38.81-1.17-13.5-9.47ZM8 11.62A3.66 3.66 0 0 1 4.35 8a3.75 3.75 0 0 1 .29-1.42l5.85 4.11a3.65 3.65 0 0 1-2.49.93Z" }),
423
+ ],
424
+ 'file': () => [
425
+ h("path", { fill: "currentColor", d: "M8.89 4.56V.67H3.35a.66.66 0 0 0-.66.68v13.3a.67.67 0 0 0 .66.68h9.3a.66.66 0 0 0 .66-.68v-9.4H9.55a.67.67 0 0 1-.66-.69Z" }),
426
+ h("path", { fill: "currentColor", d: "M13.12 3.67 10.41.87a.63.63 0 0 0-.47-.2h-.17v3.66h3.54v-.17a.69.69 0 0 0-.19-.49Z" }),
427
+ ],
428
+ 'file-cog': () => (h("path", { fill: "currentColor", d: "M9,10.1C9,10.6,8.5,11,8,11l0,0c-0.6,0-1-0.4-1-1c0-0.6,0.4-1,1-1C8.6,9,9,9.4,9,10.1C9,10,9,10,9,10.1z M13.2,3.7l-2.8-2.8c-0.1-0.1-0.3-0.2-0.5-0.2H9.8v3.7h3.5V4.2C13.3,4,13.2,3.8,13.2,3.7L13.2,3.7z M9.6,5.3h3.8v9.4 c0,0.4-0.3,0.6-0.7,0.7H3.3c-0.4,0-0.7-0.3-0.7-0.7c0,0,0,0,0,0V1.3C2.7,1,3,0.7,3.3,0.7h5.5v3.9l0,0C8.9,4.9,9.2,5.2,9.6,5.3 C9.5,5.2,9.5,5.2,9.6,5.3z M10,8L9.5,8.3C9.3,8.1,9,8,8.8,7.9V7.3c0-0.1,0-0.1-0.1-0.1c-0.4-0.1-0.9-0.1-1.3,0 c-0.1,0-0.1,0.1-0.1,0.1v0.6C7,8,6.7,8.1,6.5,8.3L6,8C5.9,8,5.9,8,5.8,8C5.5,8.3,5.3,8.7,5.2,9.1c0,0.1,0,0.1,0.1,0.2l0.5,0.3 c-0.1,0.3-0.1,0.6,0,0.8l-0.5,0.3c-0.1,0-0.1,0.1-0.1,0.2c0.1,0.4,0.4,0.8,0.7,1.1c0.1,0,0.1,0,0.2,0l0.5-0.3 C6.7,11.9,7,12,7.2,12.1v0.6c0,0.1,0,0.1,0.1,0.1c0.4,0.1,0.9,0.1,1.3,0c0.1,0,0.1-0.1,0.1-0.1v-0.5C9,12.1,9.3,12,9.5,11.8l0.5,0.3 c0.1,0,0.1,0,0.2,0c0.3-0.3,0.5-0.7,0.6-1.1c0-0.1,0-0.1-0.1-0.2l0,0l-0.5-0.3c0-0.3,0-0.6,0-0.8l0.5-0.3c0.1,0,0.1-0.1,0.1-0.2 c-0.1-0.4-0.4-0.8-0.6-1.1C10.1,8,10.1,8,10,8z" })),
429
+ 'file-download': () => [
430
+ h("path", { fill: "currentColor", d: "M13.12 3.67 10.41.87a.63.63 0 0 0-.47-.2h-.17v3.66h3.54v-.17a.69.69 0 0 0-.19-.49Z" }),
431
+ h("path", { fill: "currentColor", d: "M13.31 14.65v-9.4H9.55a.67.67 0 0 1-.66-.68V.67H3.35a.67.67 0 0 0-.66.66v13.32a.67.67 0 0 0 .66.68h9.3a.67.67 0 0 0 .66-.66Zm-2.91-4.24-2.54 2.53a.18.18 0 0 1-.26 0l-2.54-2.53a.2.2 0 0 1-.06-.15.18.18 0 0 1 .19-.18h1.34a.2.2 0 0 0 .2-.2V7.27a.19.19 0 0 1 .19-.18h1.63a.18.18 0 0 1 .18.19v2.6a.2.2 0 0 0 .2.2h1.34a.16.16 0 0 1 .14.06.19.19 0 0 1-.01.27Z" }),
432
+ ],
433
+ 'file-excel': () => (h("path", { fill: "currentColor", d: "M8.89 4.43V.67H3.35a.65.65 0 0 0-.66.66v13.34a.65.65 0 0 0 .66.66h9.3a.65.65 0 0 0 .66-.66V5.09H9.55a.65.65 0 0 1-.66-.66Zm1.66 3.2-1.66 2.58 1.66 2.59a.34.34 0 0 1-.1.46.31.31 0 0 1-.18.05h-1a.32.32 0 0 1-.27-.17c-.54-1-1-1.9-1-1.9-.18.41-.28.55-1 1.9a.33.33 0 0 1-.29.18h-1A.34.34 0 0 1 5.4 13a.41.41 0 0 1 0-.18l1.67-2.58-1.62-2.61a.34.34 0 0 1 .1-.46.37.37 0 0 1 .18 0h1a.33.33 0 0 1 .3.17c.72 1.35.55.93 1 1.9 0 0 .17-.33 1-1.9a.33.33 0 0 1 .3-.17h1a.33.33 0 0 1 .33.33.41.41 0 0 1-.11.13ZM13.31 4v.17H9.77V.67h.17a.67.67 0 0 1 .47.19l2.71 2.71a.66.66 0 0 1 .19.43Z" })),
434
+ 'file-pdf': () => (h("path", { fill: "currentColor", d: "M7.74 8a2.68 2.68 0 0 1-.06-1.3c.24 0 .21 1.02.06 1.3Zm0 1.31a12.5 12.5 0 0 1-.79 1.75 9.8 9.8 0 0 1 1.75-.61 3.63 3.63 0 0 1-1.01-1.14Zm-2.66 3.47s.36-.15 1-1.12a3.71 3.71 0 0 0-1 1.12Zm4.49-7.67h3.78v9.56a.65.65 0 0 1-.66.66H3.31a.66.66 0 0 1-.66-.66V1.33a.65.65 0 0 1 .7-.66h5.56v3.77a.67.67 0 0 0 .66.67Zm-.22 5a2.78 2.78 0 0 1-1.18-1.5 4 4 0 0 0 .17-1.78.7.7 0 0 0-.78-.6.69.69 0 0 0-.56.41 4.58 4.58 0 0 0 .23 2.14 26 26 0 0 1-1.13 2.38c-.76.39-2 1.24-1.52 1.89a.87.87 0 0 0 .6.28c.5 0 1-.5 1.7-1.72A15.24 15.24 0 0 1 9.07 11a4.34 4.34 0 0 0 1.78.54.72.72 0 0 0 .74-.7.78.78 0 0 0-.19-.51c-.4-.4-1.51-.33-2.05-.23Zm3.81-6.53L10.44.86A.71.71 0 0 0 10 .67h-.2v3.55h3.55v-.17a.7.7 0 0 0-.19-.47ZM11.1 10.9c.11-.08-.07-.33-1.19-.25 1.03.44 1.19.25 1.19.25Z" })),
435
+ 'file-text': () => (h("path", { fill: "currentColor", d: "M8.89 4.56V.67H3.35c-.36 0-.66.3-.66.66v13.32c0 .37.29.67.66.68h9.3c.36 0 .66-.3.66-.66V5.25H9.55c-.37 0-.67-.31-.66-.68Zm1.77 6.75c0 .19-.15.34-.34.35H5.68c-.19 0-.34-.16-.34-.35v-.23c0-.19.15-.34.34-.34h4.64c.19 0 .34.15.34.34v.23Zm0-1.83c0 .19-.15.34-.34.34H5.68c-.19 0-.34-.15-.34-.34v-.23c0-.19.15-.34.34-.34h4.64c.19 0 .34.15.34.34v.23Zm0-2.06v.23c0 .19-.15.34-.34.34H5.68c-.19 0-.34-.15-.34-.34v-.23c0-.19.15-.34.34-.35h4.64c.19 0 .34.16.34.35Zm2.65-3.27v.17H9.77V.67h.17c.18 0 .35.07.47.2l2.71 2.8c.13.13.19.31.19.49Z" })),
436
+ 'file-text-outline': () => (h("path", { fill: "currentColor", d: "M10.31 10.74H5.69c-.2 0-.36.16-.36.35v.22c0 .19.16.35.36.35h4.62c.2 0 .36-.16.36-.35v-.22c0-.19-.16-.35-.36-.35Zm0-1.84H5.69c-.2 0-.36.16-.36.36v.21c0 .2.16.35.36.35h4.62c.2 0 .36-.15.36-.35v-.21c0-.2-.16-.36-.36-.36Zm0-1.83H5.69c-.2 0-.36.16-.36.35v.22c0 .19.16.35.36.35h4.62c.2 0 .36-.16.36-.35v-.22c0-.19-.16-.35-.36-.35Zm0 3.67H5.69c-.2 0-.36.16-.36.35v.22c0 .19.16.35.36.35h4.62c.2 0 .36-.16.36-.35v-.22c0-.19-.16-.35-.36-.35Zm0-1.84H5.69c-.2 0-.36.16-.36.36v.21c0 .2.16.35.36.35h4.62c.2 0 .36-.15.36-.35v-.21c0-.2-.16-.36-.36-.36Zm0-1.83H5.69c-.2 0-.36.16-.36.35v.22c0 .19.16.35.36.35h4.62c.2 0 .36-.16.36-.35v-.22c0-.19-.16-.35-.36-.35Zm2.76-2.64L9.69.92A.8.8 0 0 0 9.1.67H3.35c-.36 0-.66.3-.66.66v13.32c0 .37.29.67.66.68h9.3c.36 0 .66-.3.66-.66V5.05c0-.23-.07-.45-.24-.62Zm-.76 9.9H3.69V1.67h5.2v2.75c0 .46.37.83.83.83h2.59v9.08Z" })),
437
+ 'file-upload': () => [
438
+ h("path", { fill: "currentColor", d: "M13.1 3.7 10.4.9c-.1-.1-.3-.2-.5-.2h-.1v3.7h3.5v-.2c0-.2-.1-.4-.2-.5z" }),
439
+ h("path", { fill: "currentColor", d: "M13.3 14.6V5.3H9.6c-.4 0-.7-.3-.7-.7V.7H3.3c-.3 0-.6.3-.6.6v13.3c0 .4.3.7.7.7h9.3c.3 0 .6-.3.6-.7zm-3-4.6H8.9c-.1 0-.2.1-.2.2v2.6c0 .1-.1.2-.2.2H6.9c-.1 0-.2-.1-.2-.2v-2.6c0-.1-.1-.2-.2-.2H5.1C5 9.9 5 9.8 5 9.7l2.5-2.6c.1-.1.2-.1.3 0l2.5 2.5.1.1c.1.2 0 .3-.1.3z" }),
440
+ ],
441
+ 'filter': () => (h("path", { fill: "currentColor", d: "M13.74 1.66H2.26a.6.6 0 0 0-.59.6.59.59 0 0 0 .17.42l4.58 4.58v5.1a.58.58 0 0 0 .25.48l2 1.39a.6.6 0 0 0 .83-.15.59.59 0 0 0 .1-.34V7.26l4.58-4.58a.6.6 0 0 0 0-.84.64.64 0 0 0-.44-.18Z" })),
442
+ 'floppy-disk': () => (h("path", { fill: "currentColor", d: "m13.93 4.44-2.37-2.37c-.25-.25-.6-.4-.96-.4H3.03c-.75 0-1.36.61-1.36 1.36v9.94c0 .75.61 1.36 1.36 1.36h9.94c.75 0 1.36-.61 1.36-1.36V5.4c0-.36-.14-.7-.4-.96ZM8 12.52A1.81 1.81 0 1 1 8 8.9a1.81 1.81 0 0 1 0 3.62Zm2.71-5.77c0 .09-.04.18-.1.24a.35.35 0 0 1-.24.1H3.82c-.19 0-.34-.15-.34-.34V3.82c0-.19.15-.34.34-.34h6.55c.19 0 .34.15.34.34v2.93Z" })),
443
+ 'folder': () => (h("path", { fill: "currentColor", d: "M14 4.44H8.46L6.62 2.67H2C1.27 2.67.68 3.27.67 4v8c0 .73.6 1.32 1.33 1.33h12c.73 0 1.32-.6 1.33-1.33V5.78c0-.73-.6-1.33-1.33-1.34Z" })),
444
+ 'folder-lines': () => (h("path", { fill: "currentColor", d: "M14 4.44H8.46L6.62 2.67H2A1.35 1.35 0 0 0 .67 4v8A1.35 1.35 0 0 0 2 13.33h12A1.35 1.35 0 0 0 15.33 12V5.78A1.36 1.36 0 0 0 14 4.44Zm-4.57 6.38a.2.2 0 0 1-.2.2H3.41a.2.2 0 0 1-.2-.2v-.9a.2.2 0 0 1 .2-.2h5.82a.2.2 0 0 1 .2.2Zm3.36-2.95a.2.2 0 0 1-.2.2H3.42a.2.2 0 0 1-.2-.2V7a.2.2 0 0 1 .2-.2h9.17a.2.2 0 0 1 .2.2Z" })),
445
+ 'folder-link': () => (h("path", { fill: "currentColor", d: "M14 4.44H8.46L6.62 2.67H2C1.27 2.67.68 3.27.67 4v8c0 .73.6 1.32 1.33 1.33h12c.73 0 1.32-.6 1.33-1.33V5.78c0-.73-.6-1.33-1.33-1.34Zm-6.82 6.88H5.65c-1.34 0-2.42-1.08-2.42-2.42 0-1.34 1.08-2.42 2.42-2.42h.84c.14 0 .25.11.25.25 0 .06-.02.13-.06.17-.2.21-.36.45-.49.71-.04.07-.11.13-.19.14h-.33c-.62-.15-1.24.22-1.39.84-.15.62.22 1.24.84 1.39.15.04.31.04.47.02h1.58c.62 0 1.12-.48 1.15-1.1v-.22c-.02-.08 0-.16.06-.22.12-.13.29-.2.47-.2h.45c.12 0 .23.09.25.21.02.14.02.29 0 .43 0 1.32-1.05 2.39-2.37 2.42Zm3.17 0h-.84c-.06 0-.13-.02-.17-.07-.1-.1-.1-.25 0-.35.2-.21.36-.45.49-.71.02-.09.08-.16.17-.19h.36c.63.04 1.18-.43 1.23-1.07.04-.63-.43-1.18-1.07-1.23H8.83c-.64 0-1.15.51-1.15 1.15v.25c.02.08 0 .16-.06.22-.12.13-.29.21-.47.21H6.7c-.13 0-.24-.09-.26-.22-.01-.14-.01-.27 0-.41a2.41 2.41 0 0 1 2.38-2.43h1.52c1.34 0 2.42 1.07 2.43 2.41 0 1.34-1.09 2.42-2.42 2.43Z" })),
446
+ 'folder-star': () => (h("path", { fill: "currentColor", d: "M14 4.44H8.46L6.62 2.67H2A1.35 1.35 0 0 0 .67 4v8A1.35 1.35 0 0 0 2 13.33h12A1.35 1.35 0 0 0 15.33 12V5.78A1.36 1.36 0 0 0 14 4.44Zm-.2 3.89L12 9.66l.69 2a.22.22 0 0 1-.08.27.26.26 0 0 1-.13.06.39.39 0 0 1-.15-.06l-1.77-1.26L8.75 12a.34.34 0 0 1-.15 0 .31.31 0 0 1-.13 0 .23.23 0 0 1-.08-.27l.69-2-1.81-1.35a.23.23 0 0 1-.1-.17.24.24 0 0 1 .24-.24h2.21l.67-2a.26.26 0 0 1 .15-.14.24.24 0 0 1 .31.14l.67 2h2.2a.26.26 0 0 1 .26.24.3.3 0 0 1-.08.12Z" })),
447
+ 'graduation-cap': () => (h("path", { fill: "currentColor", d: "M14.93 5.14 8.54 2.76c-.35-.13-.73-.13-1.08 0L1.07 5.14c-.31.13-.48.47-.39.8.04.22.19.39.39.47l1.12.42c-.26.38-.4.84-.41 1.3-.35.28-.47.75-.3 1.16.06.12.14.23.24.31l-.59 3.19c-.06.22.07.45.28.53h1.37c.22-.02.38-.22.36-.44v-.1L2.55 9.6c.32-.31.4-.79.2-1.18a.814.814 0 0 0-.24-.28c0-.38.18-.75.47-1l4.48 1.65c.35.13.73.13 1.08 0l6.39-2.38c.31-.13.48-.47.39-.8a.625.625 0 0 0-.39-.47Zm-6.18 4.5c-.48.18-1.02.18-1.5 0L3.93 8.4l-.33 3.15c0 1 2 1.78 4.4 1.78s4.4-.79 4.4-1.78l-.33-3.15-3.32 1.24Z" })),
448
+ 'history': () => [
449
+ h("path", { fill: "currentColor", d: "M8,1.67A6.37,6.37,0,0,0,3.6,3.42l-.91-.91a.6.6,0,0,0-.85,0h0a.58.58,0,0,0-.18.43V6.37A.61.61,0,0,0,2.24,7H5.68a.62.62,0,0,0,.62-.62A.69.69,0,0,0,6.12,6L5.05,4.87a4.29,4.29,0,1,1,.1,6.36.3.3,0,0,0-.41,0l-1,1a.3.3,0,0,0,0,.42h0A6.33,6.33,0,1,0,8,1.67Z" }),
450
+ h("path", { fill: "currentColor", d: "M9.85,9.3l-.36.36a.3.3,0,0,1-.43,0L7.45,8V5.15a.3.3,0,0,1,.3-.3h.5a.3.3,0,0,1,.3.3V7.58l1.3,1.3A.31.31,0,0,1,9.85,9.3Z" }),
451
+ ],
452
+ 'home': () => h("path", { fill: "currentColor", d: "M6.75 14.33V9.86h2.5v4.47h3.13v-6h1.88L8 1.67l-6.26 6.7h1.88v6Z" }),
453
+ 'info-circle': () => (h("path", { fill: "currentColor", d: "M8 .67A7.33 7.33 0 1 0 15.33 8 7.33 7.33 0 0 0 8 .67ZM9 12a.29.29 0 0 1-.3.3H7.35a.29.29 0 0 1-.3-.3V7.32A.29.29 0 0 1 7.33 7h1.32a.29.29 0 0 1 .35.3Zm0-6.74a.29.29 0 0 1-.3.3H7.35a.29.29 0 0 1-.3-.3V4a.29.29 0 0 1 .28-.3h1.32a.29.29 0 0 1 .3.28V4Z" })),
454
+ 'key': () => (h("path", { fill: "currentColor", d: "M8.44 6.67a3.994 3.994 0 0 0-5.1-2.44A3.986 3.986 0 0 0 .9 9.33 3.994 3.994 0 0 0 6 11.77c1.14-.4 2.04-1.3 2.44-2.44h2.89V12H14V9.33h1.33V6.67H8.44ZM4.67 9.33c-.73 0-1.33-.6-1.33-1.33s.6-1.33 1.33-1.33C5.4 6.67 6 7.27 6 8c0 .73-.58 1.32-1.31 1.33h-.02Z" })),
455
+ 'laptop': () => (h("path", { fill: "currentColor", d: "M12.89 12.08c.68-.02 1.23-.58 1.22-1.26v-6.9c0-.68-.54-1.24-1.22-1.25H3.11c-.68.01-1.23.57-1.22 1.25v6.9c-.01.68.53 1.25 1.22 1.26H.67c-.01.68.53 1.24 1.21 1.25h12.23c.68 0 1.23-.56 1.22-1.24h-2.44ZM3.11 3.92h9.78v6.9H3.11v-6.9ZM8 12.71c-.34 0-.62-.29-.61-.63 0-.34.27-.61.61-.61.34 0 .61.27.61.61 0 .34-.27.63-.61.63Z" })),
456
+ 'lines-rectangle': () => (h("path", { fill: "currentColor", d: "M12.32.67H3.68c-.56 0-1.01.45-1.01 1.01v12.64c0 .56.45 1.01 1.01 1.01h8.64c.56 0 1.01-.45 1.01-1.01V1.68c0-.56-.45-1.01-1.01-1.01ZM9 11.25H4.67v-2H9v2Zm2.33-4.49H4.67v-2h6.67v2Z" })),
457
+ 'life-ring': () => (h("path", { fill: "currentColor", d: "M8 .67A7.33 7.33 0 1 0 15.33 8 7.33 7.33 0 0 0 8 .67Zm5.14 3.53-1.88 1.88a3.91 3.91 0 0 0-1.34-1.34l1.88-1.88a6.55 6.55 0 0 1 1.34 1.34ZM8 10.84A2.84 2.84 0 1 1 10.84 8 2.84 2.84 0 0 1 8 10.84Zm-3.8-8 1.88 1.9a3.91 3.91 0 0 0-1.34 1.34L2.86 4.2A6.55 6.55 0 0 1 4.2 2.86ZM2.86 11.8l1.88-1.88a3.91 3.91 0 0 0 1.34 1.34L4.2 13.14a6.55 6.55 0 0 1-1.34-1.34Zm8.94 1.34-1.88-1.88a3.91 3.91 0 0 0 1.34-1.34l1.88 1.88a6.55 6.55 0 0 1-1.34 1.34Z" })),
458
+ 'link': () => (h("path", { fill: "currentColor", d: "M9.75 6.25a3.748 3.748 0 0 1 0 5.31l-1.66 1.67a3.76 3.76 0 0 1-5.32 0 3.76 3.76 0 0 1 0-5.32l.92-.92c.15-.15.4-.16.56 0 .07.07.11.16.12.26.02.44.1.88.24 1.3.05.14.01.3-.09.41l-.32.32c-.72.67-.76 1.8-.09 2.52s1.8.76 2.52.09c.03-.02.05-.05.07-.07l1.66-1.66c.7-.7.7-1.82 0-2.52-.08-.08-.16-.15-.26-.21a.394.394 0 0 1-.17-.31.98.98 0 0 1 .29-.74l.52-.52c.14-.14.35-.15.51-.04.18.13.35.27.51.43Zm3.49-3.48a3.76 3.76 0 0 0-5.32 0L6.26 4.43a3.772 3.772 0 0 0 .52 5.75c.16.11.37.09.51-.04l.52-.52c.2-.19.3-.46.29-.74a.38.38 0 0 0-.17-.31 1.775 1.775 0 0 1-.26-2.73l1.66-1.66c.68-.71 1.81-.74 2.52-.06.71.68.74 1.81.06 2.52-.02.03-.05.05-.07.07l-.32.32c-.11.11-.14.27-.09.41.14.42.22.86.24 1.3 0 .22.19.39.41.38.1 0 .19-.05.26-.12l.92-.92a3.76 3.76 0 0 0 0-5.32Z" })),
459
+ 'list': () => (h("path", { fill: "currentColor", d: "M1.9 2.68c-.67 0-1.22.56-1.21 1.23 0 .67.56 1.22 1.23 1.21.67 0 1.22-.56 1.21-1.23 0-.32-.13-.63-.36-.86-.23-.23-.54-.36-.87-.35Zm0 4.09a1.23 1.23 0 1 0 0 2.46 1.23 1.23 0 1 0 0-2.46Zm0 4.09a1.23 1.23 0 1 0 0 2.46 1.23 1.23 0 1 0 0-2.46Zm13 .41H5.18c-.23 0-.41.18-.41.41v.82c0 .23.18.41.41.41h9.75c.23 0 .41-.18.41-.41v-.82c0-.23-.18-.41-.41-.41h-.03Zm0-8.18H5.18c-.23 0-.41.18-.41.41v.81c0 .23.18.41.41.41h9.75c.23 0 .41-.18.41-.41V3.5c0-.23-.18-.41-.41-.41h-.03Zm0 4.09H5.18c-.23 0-.41.18-.41.41v.82c0 .23.18.41.41.41h9.75c.23 0 .41-.18.41-.41v-.82c0-.23-.18-.41-.41-.41h-.03Z" })),
460
+ 'loader': () => [
461
+ h("path", { fill: "currentColor", class: "loader__full-circle", d: "M8 2.67A5.33 5.33 0 1 1 2.67 8 5.33 5.33 0 0 1 8 2.67m0-2A7.33 7.33 0 1 0 15.33 8 7.33 7.33 0 0 0 8 .67Z" }),
462
+ h("path", { fill: "currentColor", d: "M8 2.67v-2A7.33 7.33 0 0 0 .67 8h2A5.33 5.33 0 0 1 8 2.67Z" }),
463
+ ],
464
+ 'lock': () => (h("path", { fill: "currentColor", d: "M12 5.56h-.67v-1.4C11.37 2.28 9.88.71 8 .67 6.12.71 4.63 2.28 4.67 4.16v1.4H4c-.75.02-1.35.64-1.33 1.39V14c.02.73.6 1.31 1.33 1.33h8c.75-.02 1.35-.64 1.33-1.39V7a1.37 1.37 0 0 0-1.28-1.44H12Zm-4 6.28c-.77.04-1.43-.56-1.47-1.33-.04-.77.56-1.43 1.33-1.47.77-.04 1.43.56 1.47 1.33v.07c.02.75-.57 1.38-1.32 1.4H8Zm2.07-6.28H5.93v-1.4A2.12 2.12 0 0 1 8 2c1.17.03 2.1 1 2.07 2.17v1.39Z" })),
465
+ 'location': () => (h("path", { fill: "currentColor", d: "M8 .67A5.1 5.1 0 0 0 2.67 5.5c0 3.06 3.51 7.88 4.83 9.59a.64.64 0 0 0 1 0c1.32-1.71 4.83-6.53 4.83-9.59A5.1 5.1 0 0 0 8 .67Zm0 6.94a1.74 1.74 0 1 1 1.74-1.73A1.73 1.73 0 0 1 8 7.61Z" })),
466
+ 'log-in': () => (h("path", { fill: "currentColor", d: "M10.97,7.78h0L6.97,3.78c-.12-.12-.31-.12-.42,0h0c-.07,.06-.12,.15-.13,.24v2.07c0,.17-.13,.3-.3,.32H1.97c-.16,0-.29,.12-.3,.28h0v2.58c0,.16,.12,.29,.28,.3H6.11c.17,0,.3,.14,.3,.31v2.14c0,.16,.12,.29,.28,.3h0c.11,.01,.21-.03,.28-.11l4-4c.11-.12,.11-.3,0-.42Zm3.37,5.26h0v1c0,.16-.13,.28-.28,.28h-4.77c-.16,0-.28-.13-.28-.28v-1c0-.16,.13-.28,.28-.28h3.43V3.3h-3.42c-.16,0-.29-.13-.29-.29V1.97c0-.16,.13-.29,.29-.29h4.76c.16,0,.29,.13,.29,.29v.68h0V13.04Z" })),
467
+ 'log-out': () => [
468
+ h("path", { fill: "currentColor", d: "M14.25,7.77h0l-4-4a.31.31,0,0,0-.43,0A.34.34,0,0,0,9.7,4V6.07a.32.32,0,0,1-.3.32H5.23a.3.3,0,0,0-.3.3V9.25a.3.3,0,0,0,.3.3H9.4a.31.31,0,0,1,.3.31V12a.3.3,0,0,0,.3.3.33.33,0,0,0,.23-.09l4-4A.29.29,0,0,0,14.25,7.77Z" }),
469
+ h("path", { fill: "currentColor", d: "M6.71,12.72H3.27V3.26H6.69A.31.31,0,0,0,7,3V2a.3.3,0,0,0-.31-.3H2A.29.29,0,0,0,1.67,2h0V3h0V14a.27.27,0,0,0,.1.24h0a.32.32,0,0,0,.14.08H6.71A.3.3,0,0,0,7,14V13A.3.3,0,0,0,6.71,12.72Z" }),
470
+ ],
471
+ 'magnifying-glass': () => (h("path", { fill: "currentColor", d: "M11.24 9.5c1.48-2.44.71-5.62-1.73-7.1-.05-.03-.11-.07-.17-.1A5.232 5.232 0 0 0 2.52 4C.94 6.38 1.6 9.59 3.98 11.17a5.142 5.142 0 0 0 5.54.1L12.3 14c.39.39 1.02.39 1.41 0l.33-.33a.996.996 0 0 0 0-1.41l-2.8-2.76Zm-4.4.5c-1.76.02-3.2-1.4-3.22-3.16-.02-1.76 1.4-3.2 3.16-3.22 1.76-.02 3.2 1.4 3.22 3.16v.06A3.193 3.193 0 0 1 6.84 10Z" })),
472
+ 'mail': () => (h("path", { fill: "currentColor", d: "M13.87 2.67H2.13C1.36 2.64.71 3.23.67 4v8c.03.77.68 1.36 1.45 1.33h11.75c.77.04 1.42-.55 1.46-1.32V4c-.03-.77-.68-1.36-1.45-1.33h-.01Zm0 2.66L8 8.67 2.13 5.33V4L8 7.33 13.87 4v1.33Z" })),
473
+ 'notes-outline': () => (h("path", { fill: "currentColor", d: "M13.11 4.74v5.38h-3v3H4.73V4.74h8.38m0-1.2H4.73a1.2 1.2 0 0 0-1.2 1.2v8.38a1.2 1.2 0 0 0 1.2 1.19h6l3.59-3.59v-6a1.2 1.2 0 0 0-1.21-1.18Zm-4.19 6.58h-3V8.93h3Zm3-2.39h-6v-1.2h6ZM3.8 11.19h-1V2.81h8.38v1h1.2v-1a1.2 1.2 0 0 0-1.2-1.2H2.81a1.2 1.2 0 0 0-1.2 1.2v8.38a1.2 1.2 0 0 0 1.2 1.2h1Z" })),
474
+ 'paper-plane': () => (h("path", { fill: "currentColor", d: "M14 1.69 1.84 7a.28.28 0 0 0-.15.36.29.29 0 0 0 .16.15l3.27 1.82a.57.57 0 0 0 .61-.06l6.45-5.57c.05 0 .15-.1.19-.06s0 .14-.06.18l-5.59 6.29a.52.52 0 0 0 0 .63l2.09 3.44a.28.28 0 0 0 .37.12.3.3 0 0 0 .13-.12l5-12.11a.3.3 0 0 0-.14-.37.28.28 0 0 0-.17-.01Z" })),
475
+ 'paper-plane-slash': () => (h("path", { fill: "currentColor", d: "M2.67,1.69,14.26,13.28l-1,1-2.79-2.8-1.1,2.67a.3.3,0,0,1-.13.12.28.28,0,0,1-.37-.12L6.75,10.74a.52.52,0,0,1,0-.63L7.82,8.9l-.76-.76L5.76,9.27a.57.57,0,0,1-.61.06L1.88,7.51a.29.29,0,0,1-.16-.15A.28.28,0,0,1,1.87,7L4.68,5.76l-3-3Zm11.53,0a.28.28,0,0,0-.22,0L7.53,4.51,9.26,6.24l3-2.54s.15-.1.19-.06,0,.14-.06.18L9.75,6.73l1.88,1.88,2.71-6.54A.3.3,0,0,0,14.2,1.7Z" })),
476
+ 'pen': () => (h("path", { fill: "currentColor", d: "M1.67,11.69v2.64h2.64l7.78-7.78-2.64-2.64L1.67,11.69ZM14.13,4.51c.27-.28,.27-.72,0-1h0l-1.65-1.64c-.28-.27-.72-.27-1,0h0l-1.28,1.29,2.64,2.64,1.29-1.29Z" })),
477
+ 'pen-fancy': () => (h("path", { fill: "currentColor", d: "M3.63,8.65c-.24,.07-.43,.26-.5,.5l-1.46,4.37,.11,.12,2.3-2.3c0-.06,0-.13,0-.19,0-.44,.35-.8,.79-.81,.44,0,.8,.35,.81,.79,0,.44-.35,.8-.79,.81,0,0-.01,0-.02,0h-.19l-2.3,2.3,.12,.11,4.37-1.46c.24-.07,.43-.26,.5-.5l.82-2.08-2.49-2.48-2.07,.82ZM10.8,2.35L6.27,7.28l2.42,2.42,4.94-4.52c2.1-1.86-.99-4.92-2.83-2.83Z" })),
478
+ 'picture': () => (h("path", { fill: "currentColor", d: "M14.33 12.93V3.07a1.4 1.4 0 0 0-1.4-1.4H3.07a1.4 1.4 0 0 0-1.4 1.4v9.86a1.4 1.4 0 0 0 1.4 1.4h9.86a1.4 1.4 0 0 0 1.4-1.4ZM5.54 9.06l1.76 2.11L9.76 8l3.17 4.22H3.07Z" })),
479
+ 'play-circle': () => (h("path", { fill: "currentColor", d: "M8 .67A7.33 7.33 0 1 0 15.33 8 7.33 7.33 0 0 0 8 .67Zm3.42 8-5.2 3a.72.72 0 0 1-1-.28.73.73 0 0 1-.09-.35V4.92a.71.71 0 0 1 .71-.71 1.06 1.06 0 0 1 .35.09l5.2 3.17a.71.71 0 0 1 .27 1 .64.64 0 0 1-.24.24Z" })),
480
+ 'plus': () => (h("path", { fill: "currentColor", d: "M9.41 6.59V1.92a.24.24 0 0 0-.24-.25H6.84a.24.24 0 0 0-.25.24v4.68H1.92a.24.24 0 0 0-.25.24v2.33a.24.24 0 0 0 .24.25h4.68v4.67a.24.24 0 0 0 .24.25h2.33a.24.24 0 0 0 .25-.24V9.41h4.67a.24.24 0 0 0 .25-.24V6.84a.24.24 0 0 0-.24-.25H9.41Z" })),
481
+ 'plus-circle': () => (h("path", { fill: "currentColor", d: "M8,0.7C4,0.7,0.7,4,0.7,8S4,15.3,8,15.3S15.3,12,15.3,8l0,0C15.3,4,12,0.7,8,0.7 C8,0.7,8,0.7,8,0.7z M12.3,8.8c0,0.2-0.2,0.4-0.4,0.4H9.2v2.7c0,0.2-0.2,0.4-0.4,0.4H7.2c-0.2,0-0.4-0.2-0.3-0.4V9.2H4.1 C3.9,9.2,3.7,9,3.7,8.8V7.2c0-0.2,0.2-0.4,0.4-0.3h2.7V4.1c0-0.2,0.2-0.4,0.3-0.4h1.7c0.2,0,0.4,0.2,0.4,0.4v2.7h2.7 c0.2,0,0.4,0.2,0.4,0.3L12.3,8.8z" })),
482
+ 'question-circle': () => (h("path", { fill: "currentColor", d: "M15.33 8A7.33 7.33 0 1 1 8 .67 7.33 7.33 0 0 1 15.33 8ZM8.2 3.09A3.83 3.83 0 0 0 4.75 5a.35.35 0 0 0 .08.48l1 .78a.36.36 0 0 0 .49-.07c.55-.69.92-1.08 1.68-1.08.61 0 1.35.39 1.35 1s-.36.67-1 1S6.82 8 6.82 9.18v.12a.35.35 0 0 0 .35.35h1.66a.35.35 0 0 0 .35-.35c0-.84 2.46-.88 2.46-3.15A3.37 3.37 0 0 0 8.2 3.09ZM8 10.42a1.37 1.37 0 1 0 1.36 1.37A1.36 1.36 0 0 0 8 10.42Z" })),
483
+ 'share': () => (h("path", { fill: "currentColor", d: "M13.43,10.67a2,2,0,0,0-2.42.18L5.64,8.28a2.11,2.11,0,0,0,0-.56L11,5.15a2,2,0,0,0,2.42.18,2,2,0,1,0-3.08-1.57L4.83,6.4l-.11-.09a2,2,0,1,0,.12,3.3l5.51,2.63a2,2,0,1,0,3.08-1.57Z" })),
484
+ 'shuffle': () => (h("path", { fill: "currentColor", d: "M15.13 10.45a.51.51 0 0 1 0 .81l-2.29 1.91c-.29.24-.71.24-1 0-.12-.1-.2-.24-.2-.4v-.95H10c-.09 0-.18-.03-.25-.09l-2-1.8 1.49-1.37 1.51 1.35h.92V9c.04-.35.34-.6.69-.57.18 0 .35.06.48.17l2.29 1.9v-.05ZM1 6.09h2.42l1.51 1.35 1.53-1.36-2-1.8a.41.41 0 0 0-.26-.09H1a.328.328 0 0 0-.34.29v1.33c.02.17.17.3.34.28Zm10.66 0v1c.04.35.34.6.69.57.18 0 .35-.06.48-.17l2.29-1.9a.51.51 0 0 0 0-.81l-2.28-1.95a.81.81 0 0 0-1 0c-.12.1-.2.25-.2.41v1H10c-.09 0-.18.03-.25.09L3.42 9.91H1a.313.313 0 0 0-.34.28v1.33c.02.17.17.3.34.29h3.18c.09 0 .19-.03.26-.09l6.31-5.62h.91Z" })),
485
+ 'sitemap': () => (h("path", { fill: "currentColor", d: "M3.33 10h-2c-.37 0-.66.3-.66.67v2c0 .36.3.65.66.66h2c.37 0 .66-.29.67-.66v-2c0-.37-.3-.67-.67-.67Zm-.5-1.67H7.5v1h1v-1h4.67v1h1v-1.2c0-.44-.36-.8-.8-.8H8.5V6h.83c.37 0 .67-.3.67-.67v-2c0-.37-.3-.66-.67-.66H6.67c-.37 0-.66.29-.67.66v2c0 .37.3.67.67.67h.83v1.33H2.63c-.44 0-.8.36-.8.8v1.2h1v-1ZM9 10H7c-.37 0-.67.3-.67.67v2c0 .37.3.66.67.66h2c.37 0 .66-.29.67-.66v-2c0-.37-.3-.67-.67-.67Zm5.67 0h-2c-.37 0-.67.3-.67.67v2c0 .37.3.66.67.66h2c.36 0 .65-.3.66-.66v-2c0-.37-.29-.66-.66-.67Z" })),
486
+ 'squares': () => (h("path", { fill: "currentColor", d: "M2.27 1.67h4.47c.33 0 .6.27.6.6v4.47c0 .33-.27.6-.6.6H2.27c-.33 0-.6-.27-.6-.6V2.27c0-.33.27-.6.6-.6Zm7 0h4.47c.33 0 .6.27.6.6v4.47c0 .33-.27.6-.6.6H9.27c-.33 0-.6-.27-.6-.6V2.27c0-.33.27-.6.6-.6Zm0 7h4.47c.33 0 .6.27.6.6v4.47c0 .33-.27.6-.6.6H9.27c-.33 0-.6-.27-.6-.6V9.27c0-.33.27-.6.6-.6Zm-7 0h4.47c.33 0 .6.27.6.6v4.47c0 .33-.27.6-.6.6H2.27c-.33 0-.6-.27-.6-.6V9.27c0-.33.27-.6.6-.6Z" })),
487
+ 'table': () => (h("path", { fill: "currentColor", d: "M14.19 2.68H1.81A1.14 1.14 0 0 0 .67 3.82v8.36a1.14 1.14 0 0 0 1.14 1.14h12.38a1.14 1.14 0 0 0 1.14-1.14V3.82a1.14 1.14 0 0 0-1.14-1.14ZM7.24 11.8H2.19V9.52h5.05Zm0-3.8H2.19V5.72h5.05Zm6.57 3.8H8.76V9.52h5.05Zm0-3.8H8.76V5.72h5.05Z" })),
488
+ 'tag': () => (h("path", { fill: "currentColor", d: "M1.67 7.9V2.85a1.18 1.18 0 0 1 1.18-1.18H7.9a1.18 1.18 0 0 1 .84.33L14 7.26a1.2 1.2 0 0 1 0 1.68L8.94 14a1.2 1.2 0 0 1-1.68 0L2 8.74a1.18 1.18 0 0 1-.33-.84Zm2.77-4.65a1.19 1.19 0 1 0 1.18 1.19 1.19 1.19 0 0 0-1.18-1.19Z" })),
489
+ 'tags': () => [
490
+ h("path", { fill: "currentColor", d: "M12.08 7.37 7.22 3a1.12 1.12 0 0 0-.78-.29H1.77a1 1 0 0 0-1.1 1v4.21a1 1 0 0 0 .33.71L5.85 13a1.17 1.17 0 0 0 1.55 0l4.68-4.25a.94.94 0 0 0 0-1.38ZM3.23 6.13A1.13 1.13 0 1 1 4.36 5a1.13 1.13 0 0 1-1.13 1.13Z" }),
491
+ h("path", { fill: "currentColor", d: "M15 7.37 10.15 3a1.12 1.12 0 0 0-.77-.29H8.26l4.5 4.09a1.76 1.76 0 0 1 0 2.65L8.77 13a1.17 1.17 0 0 0 1.55 0L15 8.79a.94.94 0 0 0 0-1.42Z" }),
492
+ ],
493
+ 'thumb-up': () => (h("path", { fill: "currentColor", d: "M2.11 14.36h1a.45.45 0 0 0 .45-.44V7.17a.45.45 0 0 0-.45-.44h-1a.44.44 0 0 0-.44.44v6.75a.44.44 0 0 0 .44.44Zm12.22-7a1.27 1.27 0 0 0-1.27-1.27H9.71l.61-2.91v-.2a1.07 1.07 0 0 0-.28-.68l-.68-.66-4.17 4.19a1.26 1.26 0 0 0-.37.9v6.36a1.27 1.27 0 0 0 1.27 1.27h5.06a1.24 1.24 0 0 0 1.17-.77l1.92-4.49a1.22 1.22 0 0 0 .09-.46V7.42Z" })),
494
+ 'trash': () => [
495
+ h("path", { fill: "currentColor", d: "M3.27 14.17c0 .66.54 1.19 1.2 1.2h7l-.05-.02h.08c.64-.02 1.14-.56 1.12-1.2V4.32H3.27v9.85Zm5.97-7.12c0-.33.27-.6.6-.6s.6.27.6.6v5.3c0 .33-.27.6-.6.6s-.6-.27-.6-.6v-5.3Zm-3.5 0c0-.33.27-.59.6-.6.32.02.58.28.6.6v5.3c-.02.32-.28.58-.6.6a.645.645 0 0 1-.6-.6v-5.3Zm7.28-5.39h-2.6V.95a.28.28 0 0 0-.28-.28H5.87a.28.28 0 0 0-.28.28v.72H2.91a.28.28 0 0 0-.28.28V3.1c0 .15.12.28.28.28h10.11c.15 0 .28-.12.28-.28V1.94a.28.28 0 0 0-.28-.28Z" }),
496
+ h("path", { fill: "currentColor", d: "M13,2h-2.9L9.9,1.6 C9.8,1.4,9.6,1.2,9.4,1.2H6.6c-0.2,0-0.4,0.1-0.5,0.3L5.8,2H2.9C2.7,2,2.5,2.2,2.5,2.4c0,0,0,0,0,0v0.8c0,0.2,0.2,0.4,0.4,0.4H13 c0.2,0,0.4-0.2,0.4-0.4V2.4C13.4,2.2,13.2,2,13,2z" }),
497
+ ],
498
+ 'universal-access': () => (h("path", { fill: "currentColor", d: "M8 15.33A7.33 7.33 0 1 1 15.33 8 7.34 7.34 0 0 1 8 15.33ZM8 1.71A6.29 6.29 0 1 0 14.29 8 6.29 6.29 0 0 0 8 1.71ZM13.74 8A5.74 5.74 0 1 1 8 2.25 5.75 5.75 0 0 1 13.74 8ZM8 3.77a1.07 1.07 0 1 0 1.07 1.07A1.07 1.07 0 0 0 8 3.77ZM4.67 5.63c-.6-.14-.87.86-.32 1s1.79.43 2.57.55a11.25 11.25 0 0 1-.72 4.47.54.54 0 0 0 .85.65 6.94 6.94 0 0 0 .78-2.42c0-.07.31-.11.33 0a8.73 8.73 0 0 0 .63 2.23c.3.65 1.31.26 1-.38a11.54 11.54 0 0 1-.76-4.58 21.34 21.34 0 0 0 2.41-.45.55.55 0 1 0-.2-1.08 11.47 11.47 0 0 1-6.57.01Z" })),
499
+ 'unlink': () => (h("path", { fill: "currentColor", d: "M9.74 6.25c-.16-.17-.32-.3-.5-.43-.14-.09-.31-.1-.44 0l1.81 1.81c-.17-.5-.47-.98-.87-1.38Zm-1.1 3.51c-.07.15-.17.28-.29.4l-1.66 1.66s-.04.05-.07.07c-.72.67-1.85.63-2.52-.09-.67-.72-.63-1.85.09-2.52l.32-.32c.1-.11.14-.27.09-.41-.14-.42-.22-.86-.24-1.3a.42.42 0 0 0-.12-.26.395.395 0 0 0-.56 0l-.92.92a3.76 3.76 0 0 0 0 5.32 3.76 3.76 0 0 0 5.32 0l1.66-1.67c.12-.12.23-.25.32-.38L8.64 9.76Zm4.61-7h-.02a3.778 3.778 0 0 0-5.32 0L6.83 3.84l1.41 1.41 1.08-1.08c.68-.71 1.81-.74 2.52-.06.71.68.74 1.81.06 2.52-.02.03-.05.05-.07.07l-.32.32c-.11.11-.14.27-.09.41.13.4.21.81.23 1.23l.44.44c.09 0 .18-.05.24-.11l.92-.92a3.76 3.76 0 0 0 0-5.32Zm.97 10.52-1.03 1.03-5.14-5.14c-.04.17-.12.33-.25.45l-.52.52c-.14.13-.35.15-.51.04-.18-.13-.35-.27-.5-.42-.74-.74-1.11-1.7-1.11-2.67 0-.24.02-.49.08-.73l-3.6-3.6 1.03-1.03 11.55 11.55Z" })),
500
+ 'unlock': () => (h("path", { fill: "currentColor", d: "M13.33 13.94V7a1.37 1.37 0 0 0-1.28-1.44h-.72v-1.4A3.422 3.422 0 0 0 8 .67 3.4 3.4 0 0 0 4.68 4h1.26C6 2.9 6.9 2.03 8 2c1.17.03 2.1 1 2.07 2.17v1.39H4c-.75.02-1.35.64-1.33 1.39V14c.02.73.6 1.31 1.33 1.33h8c.75-.02 1.35-.64 1.33-1.39ZM8 11.84c-.77.04-1.43-.56-1.47-1.33-.04-.77.56-1.43 1.33-1.47.77-.04 1.43.56 1.47 1.33v.07c.02.75-.57 1.38-1.32 1.4H8Z" })),
501
+ 'upload': () => (h("path", { fill: "currentColor", d: "M9.58 10.74V6.59a.31.31 0 0 1 .31-.3H12a.3.3 0 0 0 .21-.52l-4-4a.29.29 0 0 0-.42 0l-4 4a.3.3 0 0 0 .21.52h2.11a.31.31 0 0 1 .31.3v4.15a.3.3 0 0 0 .3.3h2.56a.3.3 0 0 0 .3-.3ZM14.33 14v-1a.29.29 0 0 0-.29-.3H2a.29.29 0 0 0-.29.3v1a.29.29 0 0 0 .29.29h12a.29.29 0 0 0 .33-.29Z" })),
502
+ 'user': () => (h("path", { fill: "currentColor", d: "M8 8.79a3.56 3.56 0 1 0-3.56-3.56A3.56 3.56 0 0 0 8 8.79Zm3.17.79H9.8a4.27 4.27 0 0 1-3.6 0H4.83a3.16 3.16 0 0 0-3.16 3.17v.4a1.18 1.18 0 0 0 1.18 1.18h10.3a1.18 1.18 0 0 0 1.18-1.18v-.4a3.16 3.16 0 0 0-3.16-3.17Z" })),
503
+ 'user-circle': () => (h("path", { fill: "currentColor", d: "M8 .62C3.95.61.66 3.9.65 7.95c0 4.05 3.28 7.34 7.33 7.35 4.04 0 7.33-3.26 7.35-7.3.02-4.05-3.25-7.36-7.3-7.38H8Zm0 .75c3.64 0 6.59 2.96 6.58 6.6V8c0 1.35-.41 2.66-1.19 3.76a2.713 2.713 0 0 0-2.66-2.37H9.54c-.98.46-2.1.46-3.08 0H5.28c-1.36 0-2.5 1.02-2.67 2.37A6.483 6.483 0 0 1 1.42 8a6.59 6.59 0 0 1 6.55-6.63H8ZM5 5.63c0-1.68 1.37-3.05 3.05-3.05 1.68 0 3.05 1.37 3.05 3.05 0 1.68-1.37 3.05-3.05 3.05H8c-1.66-.03-3-1.39-3-3.05Z" })),
504
+ 'user-group': () => (h("path", { fill: "currentColor", d: "M13.15 4.12c-.81-.01-1.47.65-1.48 1.46 0 .82.65 1.47 1.46 1.48s1.47-.65 1.48-1.46-.65-1.47-1.46-1.48Zm-10.04.01a1.47 1.47 0 0 0-1.58 1.59c.06.71.62 1.28 1.34 1.34.81.07 1.52-.53 1.59-1.34.06-.81-.54-1.52-1.35-1.59Zm7.36.39c-.22-.84-.87-1.51-1.71-1.75-1.36-.41-2.8.36-3.22 1.72-.18.61-.13 1.27.14 1.85.41.9 1.33 1.48 2.32 1.45 1.41.01 2.56-1.14 2.57-2.55 0-.24-.03-.49-.1-.72Zm-.71 4h-.19c-.99.49-2.14.49-3.13 0h-.19c-1.46 0-2.64 1.18-2.64 2.64v2.69c1.23.93 2.74 1.47 4.39 1.47s3.17-.55 4.4-1.48v-2.68c0-1.46-1.18-2.64-2.64-2.64Zm5.52.25a7.282 7.282 0 0 1-1.65 3.91c-.08.1-.16.19-.25.28-.08.09-.17.18-.25.27v-.55h.03v-.72s.01-.07 0-.1v-.66c.01-1.25-.66-2.4-1.76-3 .27-.26.63-.41 1-.41h1.51c.63.01 1.17.41 1.37.98ZM2.86 11.16v1.52h.01v.55l-.28-.31c-.08-.08-.15-.16-.22-.24A7.238 7.238 0 0 1 .74 8.86c.16-.62.72-1.07 1.4-1.07h1.47c.37-.01.73.12 1.01.37-1.1.6-1.77 1.75-1.76 3Z" })),
505
+ 'user-plus': () => (h("path", { fill: "currentColor", d: "M14,3.33H12.65V2a.36.36,0,0,0-.35-.33h-.65A.36.36,0,0,0,11.3,2V3.33H10a.34.34,0,0,0-.33.34v.66a.34.34,0,0,0,.33.34H11.3V6a.37.37,0,0,0,.35.33h.65A.37.37,0,0,0,12.65,6V4.67H14a.34.34,0,0,0,.32-.34V3.67A.34.34,0,0,0,14,3.33ZM9.28,9.77h-.2a5.19,5.19,0,0,1-3.91,0H5A3,3,0,0,0,1.7,12.46h0v.72A1.27,1.27,0,0,0,3,14.33h8.25a1.26,1.26,0,0,0,1.36-1.14v-.68A3,3,0,0,0,9.37,9.76H9.28ZM7.13,3.7A2.64,2.64,0,1,1,4.5,6.34h0A2.64,2.64,0,0,1,7.13,3.7Z" })),
506
+ 'users': () => (h("path", { fill: "currentColor", d: "M12,8.76h-.2a5.24,5.24,0,0,1-3.93,0H7.61a3.05,3.05,0,0,0-3.3,2.75v.69a1.28,1.28,0,0,0,1.38,1.14H14a1.27,1.27,0,0,0,1.37-1.14v-.69A3.07,3.07,0,0,0,12,8.75Zm-6.4-.32A2,2,0,0,0,4.31,8H2.48A1.69,1.69,0,0,0,.65,9.53v.76a.85.85,0,0,0,.91.76H3.45A3.58,3.58,0,0,1,5.61,8.44ZM9.81,2.66A2.65,2.65,0,1,1,7.16,5.31h0A2.65,2.65,0,0,1,9.81,2.66ZM3.31,4.18A1.51,1.51,0,1,1,1.8,5.69,1.51,1.51,0,0,1,3.31,4.18Z" })),
507
+ 'wallet': () => (h("path", { fill: "currentColor", d: "M13.88 5H3a.43.43 0 0 1-.46-.38.43.43 0 0 1 .46-.43h11a.43.43 0 0 0 .46-.38A1.28 1.28 0 0 0 13 2.67H2.5A1.7 1.7 0 0 0 .67 4.19v7.62a1.7 1.7 0 0 0 1.83 1.52h11.38a1.32 1.32 0 0 0 1.45-1.14V6.1A1.33 1.33 0 0 0 13.88 5Zm-1.21 5.29a1.1 1.1 0 1 1 1.1-1.1 1.1 1.1 0 0 1-1.1 1.05Z" })),
508
+ };
509
+ /**
510
+ * List of all possibles sizes
511
+ */
512
+ const sizes$1 = ['small', 'regular', 'large', 'extra-large'];
513
+ /**
514
+ * List of all possibles variants
515
+ */
516
+ const variants$2 = ['success', 'warning', 'danger', 'info'];
517
+
518
+ const mgIconCss = ":host{display:inline-flex;vertical-align:middle}.mg-icon[size=small],.mg-icon.mg-icon--size-small{width:var(--mg-icon-small-size);height:var(--mg-icon-small-size)}.mg-icon[size=regular],.mg-icon.mg-icon--size-regular{width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size)}.mg-icon[size=large],.mg-icon.mg-icon--size-large{width:var(--mg-icon-large-size);height:var(--mg-icon-large-size)}.mg-icon[size=extra-large],.mg-icon.mg-icon--size-extra-large{width:var(--mg-icon-extra-large-size);height:var(--mg-icon-extra-large-size)}.mg-icon[class*=mg-icon--variant-]{border-radius:var(--mg-message-border-radius);padding:0.3rem}.mg-icon.mg-icon--variant-success{background-color:hsl(var(--color-success-h), var(--color-success-s), calc(var(--color-success-l) + 20%))}.mg-icon.mg-icon--variant-warning{background-color:hsl(var(--color-warning-h), var(--color-warning-s), calc(var(--color-warning-l) + 20%))}.mg-icon.mg-icon--variant-danger{background-color:hsl(var(--color-danger-h), var(--color-danger-s), calc(var(--color-danger-l) + 20%))}.mg-icon.mg-icon--variant-info{background-color:hsl(var(--color-info-h), var(--color-info-s), calc(var(--color-info-l) + 20%))}.loader__full-circle{opacity:0.2}.mg-icon--spin{animation-name:rotate;animation-duration:0.75s;animation-iteration-count:infinite}@keyframes rotate{to{transform:rotate(360deg)}}";
519
+
520
+ const MgIcon = class {
521
+ constructor(hostRef) {
522
+ registerInstance(this, hostRef);
523
+ /**
524
+ * Define icon size
525
+ */
526
+ this.size = 'regular';
527
+ /**
528
+ * Make the icon spin
529
+ */
530
+ this.spin = false;
531
+ /**
532
+ * Component classes
533
+ */
534
+ this.classList = new ClassList(['mg-icon']);
535
+ /**
536
+ * getIcon
537
+ *
538
+ * @returns {HTMLElement} icon html
539
+ */
540
+ this.getIcon = () => icons[this.icon]();
541
+ }
542
+ validateIcon(newValue, oldValue) {
543
+ if (!Object.keys(icons).includes(newValue)) {
544
+ throw new Error(`<mg-icon> prop "icon" must be one of : ${Object.keys(icons).join(', ')}`);
545
+ }
546
+ else {
547
+ if (oldValue !== undefined) {
548
+ this.classList.delete(`mg-icon--${oldValue}`);
549
+ }
550
+ this.classList.add(`mg-icon--${newValue}`);
551
+ }
552
+ }
553
+ validateSize(newValue, oldValue) {
554
+ if (!sizes$1.includes(newValue)) {
555
+ throw new Error(`<mg-icon> prop "size" must be one of : ${sizes$1.join(', ')}`);
556
+ }
557
+ else {
558
+ if (oldValue !== undefined) {
559
+ this.classList.delete(`mg-icon--size-${oldValue}`);
560
+ }
561
+ this.classList.add(`mg-icon--size-${newValue}`);
562
+ }
563
+ }
564
+ validateVariant(newValue, oldValue) {
565
+ if (newValue !== undefined && !variants$2.includes(newValue)) {
566
+ throw new Error(`<mg-icon> prop "variant" must be one of : ${variants$2.join(', ')}`);
567
+ }
568
+ else if (newValue !== undefined) {
569
+ if (oldValue !== undefined) {
570
+ this.classList.delete(`mg-icon--variant-${oldValue}`);
571
+ }
572
+ this.classList.add(`mg-icon--variant-${newValue}`);
573
+ }
574
+ }
575
+ handleSpin(newValue) {
576
+ if (newValue) {
577
+ this.classList.add('mg-icon--spin');
578
+ }
579
+ else {
580
+ this.classList.delete('mg-icon--spin');
581
+ }
582
+ }
583
+ /**
584
+ * Check if props are well configured on init
585
+ *
586
+ * @returns {void}
587
+ */
588
+ componentWillLoad() {
589
+ this.validateIcon(this.icon);
590
+ this.validateSize(this.size);
591
+ this.validateVariant(this.variant);
592
+ this.handleSpin(this.spin);
593
+ }
594
+ /**
595
+ * Render component
596
+ *
597
+ * @returns {HTMLElement} HTML Element
598
+ */
599
+ render() {
600
+ return (h("svg", { class: this.classList.join(), "aria-hidden": "true", focusable: "false", viewBox: "0 0 16 16" }, this.getIcon()));
601
+ }
602
+ static get watchers() { return {
603
+ "icon": ["validateIcon"],
604
+ "size": ["validateSize"],
605
+ "variant": ["validateVariant"],
606
+ "spin": ["handleSpin"]
607
+ }; }
608
+ };
609
+ MgIcon.style = mgIconCss;
610
+
611
+ /**
612
+ * Apply in all input child node the aria-describedby attribute
613
+ *
614
+ * @param {VNode[]} children Represent scoped elements
615
+ * @param {Set<string>} ariaDescribedbyIDs List of IDs
616
+ * @param {FunctionalUtilities} utils Stencil.js utils
617
+ * @returns {VNode[]} Children with aria-describedby attribute
618
+ */
619
+ const applyAriadescribedBy = (children, ariaDescribedbyIDs, utils) => utils.map(children, child => {
620
+ if (['input', 'select', 'textarea'].includes(child.vtag)) {
621
+ return Object.assign(Object.assign({}, child), { vattrs: Object.assign(Object.assign({}, child.vattrs), { 'aria-describedby': [...ariaDescribedbyIDs].join(' ') }) });
622
+ }
623
+ // we recursively apply ariadescribedBy attributes to child input nodes if exists
624
+ if (child.vchildren === null)
625
+ return Object.assign({}, child);
626
+ return Object.assign(Object.assign({}, child), { vchildren: applyAriadescribedBy(child.vchildren, ariaDescribedbyIDs, utils) });
627
+ });
628
+ /**
629
+ * Add classes based on props
630
+ *
631
+ * @param {MgInputProps} props MgInput Interface Props
632
+ */
633
+ const manageClasses = (props) => {
634
+ props.classList.add('mg-input');
635
+ if (props.labelOnTop)
636
+ props.classList.add('mg-input--label-on-top');
637
+ if (props.readonly)
638
+ props.classList.add('mg-input--readonly');
639
+ if (props.mgWidth !== undefined)
640
+ props.classList.add(`mg-input--width-${props.mgWidth}`);
641
+ };
642
+ /**
643
+ * Get tagname
644
+ *
645
+ * @param {boolean} isFieldset is fieldset
646
+ * @returns {string} tag name
647
+ */
648
+ const getTagName = (isFieldset) => (isFieldset ? 'fieldset' : 'div');
649
+ /**
650
+ * Get input template
651
+ *
652
+ * @param {MgInputProps} props MgInput Interface Props
653
+ * @param {VNode[]} children Represent scoped elements
654
+ * @param {FunctionalUtilities} utils Stencil.js utils
655
+ * @returns {VNode[]} input template
656
+ */
657
+ const MgInput = (props, children, utils) => {
658
+ /**
659
+ * Check required properties
660
+ */
661
+ if (typeof props.label !== 'string' || props.label === '') {
662
+ throw new Error('<mg-input> prop "label" is required');
663
+ }
664
+ if (props.labelOnTop && props.labelHide) {
665
+ throw new Error('<mg-input> prop "labelOnTop" must not be paired with the prop "labelHide"');
666
+ }
667
+ /**
668
+ * Component classes
669
+ */
670
+ manageClasses(props);
671
+ /**
672
+ * a11y IDs
673
+ */
674
+ const ariaDescribedbyIDs = new Set(props.ariaDescribedbyIDs);
675
+ // Help text
676
+ const helpTextId = `${props.identifier}-help-text`;
677
+ if (typeof props.helpText === 'string' && props.helpText !== '') {
678
+ ariaDescribedbyIDs.add(helpTextId);
679
+ }
680
+ // Error Message
681
+ const helpTextErrorId = `${props.identifier}-error`;
682
+ if (typeof props.errorMessage === 'string' && props.errorMessage !== '') {
683
+ ariaDescribedbyIDs.add(helpTextErrorId);
684
+ }
685
+ /**
686
+ * Update input(s) in children
687
+ */
688
+ if (props.readonly) {
689
+ children = children.filter(child => child.$name$ === 'append-input');
690
+ }
691
+ else {
692
+ children = applyAriadescribedBy(children, ariaDescribedbyIDs, utils);
693
+ }
694
+ /**
695
+ * Return template
696
+ *
697
+ * +--------+--------------+---------+
698
+ * | label | input | tooltip |
699
+ * | +--------------+---------+
700
+ * | | nb Char Left |
701
+ * | +------------------------+
702
+ * | | Help Text |
703
+ * | +------------------------+
704
+ * | | Error |
705
+ * +--------+------------------------+
706
+ *
707
+ * Error message is based on this aria method: https://www.w3.org/WAI/tutorials/forms/notifications/#on-focus-change
708
+ */
709
+ const TagName = getTagName(props.isFieldset);
710
+ /**
711
+ * Get tooltip node
712
+ *
713
+ * @returns {VNode[]} mg-tooltip
714
+ */
715
+ const getTooltip = () => (h("mg-tooltip", { identifier: `${props.identifier}-tooltip`, message: props.tooltip },
716
+ h("mg-icon", { icon: "info-circle" })));
717
+ /**
718
+ * Get input title (label) node
719
+ *
720
+ * @returns {VNode[]} mg-input-title
721
+ */
722
+ const getInputTitle = () => (h("mg-input-title", { identifier: props.identifier, class: props.labelHide ? 'sr-only' : undefined, required: props.required && !props.disabled, "is-legend": props.isFieldset }, props.label));
723
+ return (h(TagName, { class: props.classList.join() },
724
+ props.labelOnTop ? (h("div", { class: "mg-input__title" },
725
+ getInputTitle(),
726
+ !props.readonly && props.tooltip && getTooltip())) : (getInputTitle()),
727
+ props.readonly ? (h("div", { class: "mg-input__input-container" },
728
+ h("strong", null, props.readonlyValue || props.value),
729
+ children)) : (h("div", { class: "mg-input__input-container" },
730
+ h("div", { class: { 'mg-input__input': true, 'mg-input__input--has-error': props.errorMessage !== undefined } },
731
+ children,
732
+ !props.labelOnTop && props.tooltip && getTooltip()),
733
+ props.helpText && h("div", { id: helpTextId, class: "mg-input__help-text", innerHTML: props.helpText }),
734
+ props.errorMessage && !props.readonly && !props.disabled && (h("div", { id: helpTextErrorId, class: "mg-input__error", innerHTML: props.errorMessage, "aria-live": "assertive" }))))));
735
+ };
736
+
737
+ const mgInputCheckboxCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container mg-icon{display:flex}.mg-input__input-container .mg-input__help-text,.mg-input__input-container .mg-input__error{text-align:start;font-size:1.2rem}.mg-input__input{display:flex;}.mg-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input__input.mg-input__input--has-error .mg-input__box{border-color:hsl(var(--color-danger))}.mg-input__input+.mg-input__help-text,.mg-input__input+.mg-input__error{margin-top:0.5rem}.mg-input__error{display:inline-block;margin-top:0.2rem;padding:0.3rem 0.8rem;border-radius:0.3rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}fieldset.mg-input{border:0;margin-left:0;margin-right:0;padding:0}fieldset.mg-input input[type=radio],fieldset.mg-input input[type=checkbox]{flex-shrink:0;width:var(--mg-input-check-size);height:var(--mg-input-check-size);margin-top:calc((var(--font-size) * var(--line-height) - var(--mg-input-check-size)) / 2);margin-right:0.6rem;margin-bottom:0;margin-left:0}fieldset.mg-input.mg-input--label-on-top .mg-input__input-group-container{margin-top:0.7rem}.mg-input__input-container mg-tooltip{margin-left:3rem}.mg-input__input-group-container{margin:0;padding:0;list-style:none;display:flex;flex-wrap:wrap;column-gap:2.3rem;row-gap:1rem;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2)}.mg-input__input-group-container--vertical{flex-direction:column}.mg-input__input-group{display:flex;align-items:top}.mg-input__input-group.mg-input__input-group--disabled label{opacity:0.3}.sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}";
738
+
739
+ /**
740
+ * type CheckboxItem validation function
741
+ *
742
+ * @param {CheckboxItem} item Checkbox item
743
+ * @returns {boolean} match item expectations
744
+ */
745
+ const isCheckboxItem = (item) => typeof item === 'object' && typeof item.title === 'string' && (item.value === null || typeof item.value === 'boolean') && item.value !== undefined;
746
+ const MgInputCheckbox = class {
747
+ constructor(hostRef) {
748
+ registerInstance(this, hostRef);
749
+ this.valueChange = createEvent(this, "value-change", 7);
750
+ this.inputValid = createEvent(this, "input-valid", 7);
751
+ /************
752
+ * Internal *
753
+ ************/
754
+ // HTML selector
755
+ this.inputs = [];
756
+ /**
757
+ * Identifier is used for the element ID (id is a reserved prop in Stencil.js)
758
+ * If not set, it will be created.
759
+ */
760
+ this.identifier = createID('mg-input-checkbox');
761
+ /**
762
+ * Input name
763
+ * If not set the value equals the identifier
764
+ */
765
+ this.name = this.identifier;
766
+ /**
767
+ * Define if label is visible
768
+ */
769
+ this.labelHide = false;
770
+ /**
771
+ * Define if inputs are display verticaly
772
+ */
773
+ this.inputVerticalList = false;
774
+ /**
775
+ * Define if input is required
776
+ */
777
+ this.required = false;
778
+ /**
779
+ * Define if input is readonly
780
+ */
781
+ this.readonly = false;
782
+ /**
783
+ * Define if input is disabled
784
+ */
785
+ this.disabled = false;
786
+ /**
787
+ * Component classes
788
+ */
789
+ this.classList = new ClassList(['mg-input--checkbox']);
790
+ /**
791
+ * Formated value for display
792
+ */
793
+ this.checkboxItems = [];
794
+ /**
795
+ * Handle input event
796
+ *
797
+ * @param {InputEvent} event input event
798
+ */
799
+ this.handleInput = (event) => {
800
+ this.checkboxItems = this.checkboxItems.map(item => {
801
+ if (item.id === event.target.id) {
802
+ item.value = Boolean(event.target.checked);
803
+ }
804
+ return item;
805
+ });
806
+ this.value = this.checkboxItems.map(o => ({ value: o.value, title: o.title, disabled: o.disabled }));
807
+ this.checkValidity();
808
+ };
809
+ /**
810
+ * Handle blur event
811
+ */
812
+ this.handleBlur = () => {
813
+ // Check validity
814
+ this.checkValidity();
815
+ this.checkError();
816
+ };
817
+ /**
818
+ * Check if input is valid
819
+ */
820
+ this.checkValidity = () => {
821
+ if (!this.readonly) {
822
+ const validity = this.getInvalidElement() === undefined;
823
+ // Set validity
824
+ this.valid = validity;
825
+ this.invalid = !validity;
826
+ //Send event
827
+ this.inputValid.emit(validity);
828
+ }
829
+ };
830
+ /**
831
+ * Check input errors
832
+ */
833
+ this.checkError = () => {
834
+ const invalidElement = this.getInvalidElement();
835
+ // Set error message
836
+ this.errorMessage = undefined;
837
+ if (!this.valid && invalidElement.validity.valueMissing) {
838
+ this.errorMessage = this.messages.errors.required;
839
+ }
840
+ };
841
+ /**
842
+ * get invalid element
843
+ *
844
+ * @returns {HTMLInputElement} element
845
+ */
846
+ this.getInvalidElement = () => this.inputs.find((element) => !element.disabled && !element.checkValidity());
847
+ }
848
+ validateValue(newValue) {
849
+ if (newValue && newValue.every(item => isCheckboxItem(item))) {
850
+ this.checkboxItems = newValue.map((item, index) => ({
851
+ id: `${this.identifier}_${index.toString()}`,
852
+ title: item.title,
853
+ value: item.value,
854
+ disabled: item.disabled,
855
+ }));
856
+ this.valueChange.emit(newValue);
857
+ }
858
+ else {
859
+ throw new Error('<mg-input-checkbox> prop "value" is required and all values must be the same type, CheckboxItem.');
860
+ }
861
+ }
862
+ /**
863
+ * Public method to display errors
864
+ *
865
+ * @returns {Promise<void>}
866
+ */
867
+ async displayError() {
868
+ this.checkValidity();
869
+ this.checkError();
870
+ }
871
+ /*************
872
+ * Lifecycle *
873
+ *************/
874
+ /**
875
+ * Check if component props are well configured on init
876
+ *
877
+ * @returns {ReturnType<typeof setTimeout>} timeout
878
+ */
879
+ componentWillLoad() {
880
+ // Get locales
881
+ this.messages = initLocales(this.element).messages;
882
+ // Validate
883
+ this.validateValue(this.value);
884
+ // Check validity when component is ready
885
+ // return a promise to process action only in the FIRST render().
886
+ // https://stenciljs.com/docs/component-lifecycle#componentwillload
887
+ return setTimeout(() => {
888
+ this.checkValidity();
889
+ }, 0);
890
+ }
891
+ /**
892
+ * Render
893
+ *
894
+ * @returns {HTMLElement} HTML Element
895
+ */
896
+ render() {
897
+ return (h(MgInput, { identifier: this.identifier, classList: this.classList, ariaDescribedbyIDs: [], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, readonly: undefined, mgWidth: undefined, disabled: this.disabled, value: this.value && this.value.toString(), readonlyValue: undefined, tooltip: !this.readonly && this.tooltip, helpText: this.helpText, errorMessage: this.errorMessage, isFieldset: true }, h("ul", { class: { 'mg-input__input-group-container': true, 'mg-input__input-group-container--vertical': this.inputVerticalList } }, this.checkboxItems
898
+ .filter(item => {
899
+ return !this.readonly || item.value;
900
+ })
901
+ .map(input => (h("li", { class: { 'mg-input__input-group': true, 'mg-input__input-group--disabled': this.disabled || input.disabled } }, h("input", { type: "checkbox", id: input.id, name: this.identifier, value: input.value && input.value.toString(), checked: Boolean(input.value), disabled: this.readonly || this.disabled || input.disabled, required: this.required, indeterminate: input.value === null, onInput: this.handleInput, onBlur: this.handleBlur, ref: el => this.inputs.push(el) }), h("label", { htmlFor: input.id }, input.title)))))));
902
+ }
903
+ get element() { return getElement(this); }
904
+ static get watchers() { return {
905
+ "value": ["validateValue"]
906
+ }; }
907
+ };
908
+ MgInputCheckbox.style = mgInputCheckboxCss;
909
+
910
+ var InputError$1;
911
+ (function (InputError) {
912
+ InputError["MIN"] = "min";
913
+ InputError["MAX"] = "max";
914
+ InputError["MINMAX"] = "minMax";
915
+ InputError["REQUIRED"] = "required";
916
+ })(InputError$1 || (InputError$1 = {}));
917
+
918
+ /**
919
+ * Format number to the locale currency
920
+ *
921
+ * @param {number} number number to format
922
+ * @param {string} locale locale to apply
923
+ * @param {string} currency currency to apply
924
+ * @returns {string} formatted currency
925
+ */
926
+ function localeCurrency(number, locale, currency) {
927
+ return new Intl.NumberFormat(locale, { style: 'currency', currency }).format(number);
928
+ }
929
+ /**
930
+ * Format number to locale
931
+ *
932
+ * @param {number} number number to format
933
+ * @param {string} locale locale to apply
934
+ * @returns {string} formatted number
935
+ */
936
+ function localeNumber(number, locale) {
937
+ return new Intl.NumberFormat(locale).format(number);
938
+ }
939
+ /**
940
+ * Date RegExp
941
+ */
942
+ const dateRegExp = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/;
943
+ /**
944
+ * Locale date format
945
+ *
946
+ * @param {string} date date to format
947
+ * @param {string} locale locale to apply
948
+ * @returns {string} formatted date
949
+ */
950
+ function localeDate(date, locale) {
951
+ if (typeof date !== 'string' || date === '' || !dateRegExp.test(date)) {
952
+ return '';
953
+ }
954
+ return new Intl.DateTimeFormat(locale).format(new Date(date));
955
+ }
956
+
957
+ const mgInputDateCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container mg-icon{display:flex}.mg-input__input-container .mg-input__help-text,.mg-input__input-container .mg-input__error{text-align:start;font-size:1.2rem}.mg-input__input{display:flex;}.mg-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input__input.mg-input__input--has-error .mg-input__box{border-color:hsl(var(--color-danger))}.mg-input__input+.mg-input__help-text,.mg-input__input+.mg-input__error{margin-top:0.5rem}.mg-input__error{display:inline-block;margin-top:0.2rem;padding:0.3rem 0.8rem;border-radius:0.3rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-input__box{padding:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2) var(--mg-inputs-spacer);height:var(--default-size);box-sizing:border-box;border-width:var(--mg-inputs-border-width);border-style:solid;border-color:var(--mg-inputs-color);border-radius:var(--mg-inputs-border-radius);background-color:hsl(var(--color-light));font-family:inherit;color:hsl(var(--color-dark));font-size:var(--font-size);text-align:var(--mg-inputs-text-align, left)}.mg-input__box::placeholder{color:var(--mg-inputs-color);font-style:italic}.mg-input__box:focus{box-shadow:0 0 0.6rem hsla(var(--mg-inputs-color-shadow-focus-hsl), 0.5)}.mg-input__box:disabled{opacity:0.3}.mg-input.mg-input--is-input-group-append{--mg-button-border-radius-top-left:0;--mg-button-border-radius-bottom-left:0;}.mg-input.mg-input--is-input-group-append .mg-input__box{margin-right:-0.1rem;border-top-right-radius:0%;border-bottom-right-radius:0%}.mg-input.mg-input--is-input-group-append .mg-input__box:focus-visible{outline-style:solid;outline-offset:-0.2rem;outline-width:0.2rem}.mg-input.mg-input--is-input-group-append.mg-input--readonly slot[name=append-input]{display:none}.mg-input.mg-input--label-on-top .mg-input__box{width:auto;max-width:100%}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]){--mg-button-border-radius-top-right:0;--mg-button-border-radius-bottom-right:0}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:not(:last-of-type)){--mg-button-border-right-width:0}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:last-of-type){--mg-button-border-radius-top-right:var(--mg-inputs-border-radius);--mg-button-border-radius-bottom-right:var(--mg-inputs-border-radius)}.mg-input.mg-input--is-append-input-slot-content:not(.mg-input--readonly) ::slotted([slot=append-input]){padding-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}";
958
+
959
+ const MgInputDate = class {
960
+ constructor(hostRef) {
961
+ registerInstance(this, hostRef);
962
+ this.valueChange = createEvent(this, "value-change", 7);
963
+ this.inputValid = createEvent(this, "input-valid", 7);
964
+ // hasError (triggered by blur event)
965
+ this.hasError = false;
966
+ /**
967
+ * Identifier is used for the element ID (id is a reserved prop in Stencil.js)
968
+ * If not set, it will be created.
969
+ */
970
+ this.identifier = createID('mg-input-date');
971
+ /**
972
+ * Input name
973
+ * If not set the value equals the identifier
974
+ */
975
+ this.name = this.identifier;
976
+ /**
977
+ * Define if label is visible
978
+ */
979
+ this.labelHide = false;
980
+ /**
981
+ * Define if input is required
982
+ */
983
+ this.required = false;
984
+ /**
985
+ * Define if input is readonly
986
+ */
987
+ this.readonly = false;
988
+ /**
989
+ * Define if input is disabled
990
+ */
991
+ this.disabled = false;
992
+ /**
993
+ * Component classes
994
+ */
995
+ this.classList = new ClassList(['mg-input--date']);
996
+ /**
997
+ * Handle input event
998
+ */
999
+ this.handleInput = () => {
1000
+ this.checkValidity();
1001
+ if (this.hasError) {
1002
+ this.checkError();
1003
+ }
1004
+ this.value = this.input.value;
1005
+ };
1006
+ /**
1007
+ * Handle blur event
1008
+ */
1009
+ this.handleBlur = () => {
1010
+ this.displayError();
1011
+ };
1012
+ /**
1013
+ * Check if input is valid
1014
+ */
1015
+ this.checkValidity = () => {
1016
+ if (!this.readonly && this.input !== undefined) {
1017
+ const validity = this.input.checkValidity();
1018
+ // Set validity
1019
+ this.valid = validity;
1020
+ this.invalid = !validity;
1021
+ //Send event
1022
+ this.inputValid.emit(validity);
1023
+ }
1024
+ };
1025
+ /**
1026
+ * get input error code
1027
+ *
1028
+ * @returns {null | InputError} error code
1029
+ */
1030
+ this.getInputError = () => {
1031
+ var _a, _b;
1032
+ let inputError = null;
1033
+ // required
1034
+ if (this.input.validity.valueMissing) {
1035
+ inputError = InputError$1.REQUIRED;
1036
+ }
1037
+ // min & max
1038
+ else if ((this.input.validity.rangeUnderflow || this.input.validity.rangeOverflow) && ((_a = this.min) === null || _a === void 0 ? void 0 : _a.length) > 0 && ((_b = this.max) === null || _b === void 0 ? void 0 : _b.length) > 0) {
1039
+ inputError = InputError$1.MINMAX;
1040
+ }
1041
+ // min
1042
+ else if (this.input.validity.rangeUnderflow) {
1043
+ inputError = InputError$1.MIN;
1044
+ }
1045
+ //max
1046
+ else if (this.input.validity.rangeOverflow) {
1047
+ inputError = InputError$1.MAX;
1048
+ }
1049
+ return inputError;
1050
+ };
1051
+ /**
1052
+ * Set error message
1053
+ *
1054
+ * @returns {void}
1055
+ */
1056
+ this.setErrorMessage = () => {
1057
+ var _a;
1058
+ const inputError = this.getInputError();
1059
+ // required
1060
+ if (inputError === InputError$1.REQUIRED) {
1061
+ this.errorMessage = this.messages.errors[inputError];
1062
+ }
1063
+ // min, max & minMax
1064
+ else if ([InputError$1.MIN, InputError$1.MAX, InputError$1.MINMAX].includes(inputError)) {
1065
+ this.errorMessage = this.messages.errors.date[inputError].replace('{min}', localeDate(this.min, this.locale)).replace('{max}', localeDate(this.max, this.locale));
1066
+ }
1067
+ // wrong date format
1068
+ // element.validity.badInput is default error message
1069
+ else {
1070
+ this.errorMessage = this.messages.errors.date.badInput.replace('{min}', ((_a = this.min) === null || _a === void 0 ? void 0 : _a.length) > 0 ? localeDate(this.min, this.locale) : localeDate('1900-01-01', this.locale));
1071
+ }
1072
+ };
1073
+ /**
1074
+ * Check input errors
1075
+ *
1076
+ * @returns {void}
1077
+ */
1078
+ this.checkError = () => {
1079
+ // Set error message
1080
+ this.errorMessage = undefined;
1081
+ if (!this.valid) {
1082
+ this.setErrorMessage();
1083
+ }
1084
+ };
1085
+ }
1086
+ validateValue(newValue) {
1087
+ if (newValue !== undefined && newValue !== '' && !(typeof newValue === 'string' && dateRegExp.test(newValue))) {
1088
+ throw new Error("<mg-input-date> props 'value' doesn't match pattern: yyyy-mm-dd");
1089
+ }
1090
+ else {
1091
+ this.valueChange.emit(this.value);
1092
+ }
1093
+ }
1094
+ validateMin(newValue) {
1095
+ this.validateDateFormat(newValue);
1096
+ }
1097
+ validateMax(newValue) {
1098
+ this.validateDateFormat(newValue);
1099
+ }
1100
+ /**
1101
+ * Public method to display errors
1102
+ *
1103
+ * @returns {Promise<void>}
1104
+ */
1105
+ async displayError() {
1106
+ this.checkValidity();
1107
+ this.checkError();
1108
+ this.hasError = this.invalid;
1109
+ }
1110
+ /**
1111
+ * Date format validation
1112
+ *
1113
+ * @param {string} date date to validate
1114
+ * @returns {void}
1115
+ */
1116
+ validateDateFormat(date) {
1117
+ if ((date === null || date === void 0 ? void 0 : date.length) > 0 && !(typeof date === 'string' && dateRegExp.test(date))) {
1118
+ throw new Error("<mg-input-date> props 'min/max' doesn't match pattern: yyyy-mm-dd");
1119
+ }
1120
+ }
1121
+ /*************
1122
+ * Lifecycle *
1123
+ *************/
1124
+ /**
1125
+ * Check if component props are well configured on init
1126
+ *
1127
+ * @returns {ReturnType<typeof setTimeout>} timeout
1128
+ */
1129
+ componentWillLoad() {
1130
+ // Get locales
1131
+ const locales = initLocales(this.element);
1132
+ this.locale = locales.locale;
1133
+ this.messages = locales.messages;
1134
+ // Validate
1135
+ this.validateValue(this.value);
1136
+ this.validateMin(this.min);
1137
+ this.validateMax(this.max);
1138
+ // Check validity when component is ready
1139
+ // return a promise to process action only in the FIRST render().
1140
+ // https://stenciljs.com/docs/component-lifecycle#componentwillload
1141
+ return setTimeout(() => {
1142
+ this.checkValidity();
1143
+ }, 0);
1144
+ }
1145
+ /**
1146
+ * Render
1147
+ *
1148
+ * @returns {HTMLElement} HTML Element
1149
+ */
1150
+ render() {
1151
+ return (h(MgInput, { identifier: this.identifier, classList: this.classList, ariaDescribedbyIDs: [], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, readonly: this.readonly, mgWidth: undefined, disabled: this.disabled, value: this.value, readonlyValue: localeDate(this.value, this.locale), tooltip: this.tooltip, helpText: this.helpText, errorMessage: this.errorMessage, isFieldset: false }, h("input", { type: "date", class: "mg-input__box", min: this.min, max: this.max, value: this.value, id: this.identifier, name: this.name, disabled: this.disabled, required: this.required, onInput: this.handleInput, onBlur: this.handleBlur, pattern: "[0-9]{4}-[0-9]{2}-[0-9]{2}", ref: el => (this.input = el) })));
1152
+ }
1153
+ get element() { return getElement(this); }
1154
+ static get watchers() { return {
1155
+ "value": ["validateValue"],
1156
+ "min": ["validateMin"],
1157
+ "max": ["validateMax"]
1158
+ }; }
1159
+ };
1160
+ MgInputDate.style = mgInputDateCss;
1161
+
1162
+ /**
1163
+ * List of all possibles types
1164
+ */
1165
+ const types = ['decimal', 'integer', 'currency'];
1166
+ var InputError;
1167
+ (function (InputError) {
1168
+ InputError["MIN"] = "min";
1169
+ InputError["MAX"] = "max";
1170
+ InputError["MINMAX"] = "minMax";
1171
+ InputError["REQUIRED"] = "required";
1172
+ })(InputError || (InputError = {}));
1173
+
1174
+ const mgInputNumericCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container mg-icon{display:flex}.mg-input__input-container .mg-input__help-text,.mg-input__input-container .mg-input__error{text-align:start;font-size:1.2rem}.mg-input__input{display:flex;}.mg-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input__input.mg-input__input--has-error .mg-input__box{border-color:hsl(var(--color-danger))}.mg-input__input+.mg-input__help-text,.mg-input__input+.mg-input__error{margin-top:0.5rem}.mg-input__error{display:inline-block;margin-top:0.2rem;padding:0.3rem 0.8rem;border-radius:0.3rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-input__box{padding:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2) var(--mg-inputs-spacer);height:var(--default-size);box-sizing:border-box;border-width:var(--mg-inputs-border-width);border-style:solid;border-color:var(--mg-inputs-color);border-radius:var(--mg-inputs-border-radius);background-color:hsl(var(--color-light));font-family:inherit;color:hsl(var(--color-dark));font-size:var(--font-size);text-align:var(--mg-inputs-text-align, left)}.mg-input__box::placeholder{color:var(--mg-inputs-color);font-style:italic}.mg-input__box:focus{box-shadow:0 0 0.6rem hsla(var(--mg-inputs-color-shadow-focus-hsl), 0.5)}.mg-input__box:disabled{opacity:0.3}.mg-input.mg-input--is-input-group-append{--mg-button-border-radius-top-left:0;--mg-button-border-radius-bottom-left:0;}.mg-input.mg-input--is-input-group-append .mg-input__box{margin-right:-0.1rem;border-top-right-radius:0%;border-bottom-right-radius:0%}.mg-input.mg-input--is-input-group-append .mg-input__box:focus-visible{outline-style:solid;outline-offset:-0.2rem;outline-width:0.2rem}.mg-input.mg-input--is-input-group-append.mg-input--readonly slot[name=append-input]{display:none}.mg-input.mg-input--label-on-top .mg-input__box{width:auto;max-width:100%}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]){--mg-button-border-radius-top-right:0;--mg-button-border-radius-bottom-right:0}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:not(:last-of-type)){--mg-button-border-right-width:0}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:last-of-type){--mg-button-border-radius-top-right:var(--mg-inputs-border-radius);--mg-button-border-radius-bottom-right:var(--mg-inputs-border-radius)}.mg-input.mg-input--is-append-input-slot-content:not(.mg-input--readonly) ::slotted([slot=append-input]){padding-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input.mg-input--width-full:not(.mg-input--label-on-top){justify-content:space-between}.mg-input.mg-input--width-full .mg-input__input-container{flex:auto;width:100%}.mg-input.mg-input--width-full .mg-input__input-container .mg-input__box{width:100%}.mg-input.mg-input--width-16 .mg-input__box{width:21rem}.mg-input.mg-input--width-4 .mg-input__box{width:7rem}.mg-input.mg-input--width-2 .mg-input__box{width:5rem}.sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}.mg-input .mg-input__box{text-align:var(--mg-inputs-text-align, right)}";
1175
+
1176
+ const MgInputNumeric = class {
1177
+ constructor(hostRef) {
1178
+ registerInstance(this, hostRef);
1179
+ this.valueChange = createEvent(this, "value-change", 7);
1180
+ this.inputValid = createEvent(this, "input-valid", 7);
1181
+ // hasError (triggered by blur event)
1182
+ this.hasError = false;
1183
+ /**
1184
+ * Identifier is used for the element ID (id is a reserved prop in Stencil.js)
1185
+ * If not set, it will be created.
1186
+ */
1187
+ this.identifier = createID('mg-input-numeric');
1188
+ /**
1189
+ * Input name
1190
+ * If not set the value equals the identifier
1191
+ */
1192
+ this.name = this.identifier;
1193
+ /**
1194
+ * Define if label is visible
1195
+ */
1196
+ this.labelHide = false;
1197
+ /**
1198
+ * Define if input is required
1199
+ */
1200
+ this.required = false;
1201
+ /**
1202
+ * Define if input is readonly
1203
+ */
1204
+ this.readonly = false;
1205
+ /**
1206
+ * Define if input is disabled
1207
+ */
1208
+ this.disabled = false;
1209
+ /**
1210
+ * Define numeric type
1211
+ */
1212
+ this.type = types[0];
1213
+ /**
1214
+ * Define currency
1215
+ */
1216
+ this.currency = 'USD';
1217
+ /**
1218
+ * Override integer length
1219
+ * integer is the number before the decimal point
1220
+ */
1221
+ this.integerLength = 13;
1222
+ /**
1223
+ * Override decimal length
1224
+ * decimal is the number after the decimal point
1225
+ */
1226
+ this.decimalLength = 2;
1227
+ /**
1228
+ * Component classes
1229
+ */
1230
+ this.classList = new ClassList(['mg-input--numeric']);
1231
+ /**
1232
+ * Define if input has focus
1233
+ */
1234
+ this.hasFocus = false;
1235
+ /**
1236
+ * Handle input event
1237
+ *
1238
+ * @returns {void}
1239
+ */
1240
+ this.handleInput = () => {
1241
+ // Check validity
1242
+ this.checkValidity();
1243
+ if (this.hasError) {
1244
+ this.checkError();
1245
+ }
1246
+ this.value = this.input.value;
1247
+ };
1248
+ /**
1249
+ * Handle focus event
1250
+ *
1251
+ * @returns {void}
1252
+ */
1253
+ this.handleFocus = () => {
1254
+ this.hasFocus = true;
1255
+ };
1256
+ /**
1257
+ * Handle blur event
1258
+ *
1259
+ * @returns {void}
1260
+ */
1261
+ this.handleBlur = () => {
1262
+ // Display Error
1263
+ this.displayError();
1264
+ this.hasFocus = false;
1265
+ };
1266
+ /**
1267
+ * Check if input is valid
1268
+ *
1269
+ * @returns {void}
1270
+ */
1271
+ this.checkValidity = () => {
1272
+ if (!this.readonly) {
1273
+ const validity = this.getInputError() === null;
1274
+ // Set validity
1275
+ this.valid = validity;
1276
+ this.invalid = !validity;
1277
+ //Send event
1278
+ this.inputValid.emit(validity);
1279
+ }
1280
+ };
1281
+ /**
1282
+ * Set error message
1283
+ *
1284
+ * @returns {void}
1285
+ */
1286
+ this.setErrorMessage = () => {
1287
+ const inputError = this.getInputError();
1288
+ if (inputError === InputError.REQUIRED) {
1289
+ this.errorMessage = this.messages.errors[inputError];
1290
+ }
1291
+ else {
1292
+ this.errorMessage = this.messages.errors.numeric[inputError].replace('{min}', `${this.formatValue(this.min)}`).replace('{max}', `${this.formatValue(this.max)}`);
1293
+ }
1294
+ };
1295
+ /**
1296
+ * Check input errors
1297
+ *
1298
+ * @returns {void}
1299
+ */
1300
+ this.checkError = () => {
1301
+ // Set error message
1302
+ this.errorMessage = undefined;
1303
+ // Update class
1304
+ if (!this.valid) {
1305
+ this.setErrorMessage();
1306
+ }
1307
+ };
1308
+ /**
1309
+ * Get input error code
1310
+ *
1311
+ * @returns {null | InputError} error code
1312
+ */
1313
+ this.getInputError = () => {
1314
+ let inputError = null;
1315
+ if (this.input === undefined)
1316
+ return inputError;
1317
+ // required
1318
+ if (!this.input.checkValidity() && this.input.validity.valueMissing) {
1319
+ inputError = InputError.REQUIRED;
1320
+ }
1321
+ // Min & Max
1322
+ else if (this.min !== undefined && this.numericValue < this.min && this.max === undefined) {
1323
+ // Only a min value is set
1324
+ inputError = InputError.MIN;
1325
+ }
1326
+ else if (this.max !== undefined && this.numericValue > this.max && this.min === undefined) {
1327
+ // Only a max value is set
1328
+ inputError = InputError.MAX;
1329
+ }
1330
+ else if ((this.min !== undefined && this.numericValue < this.min) || (this.max !== undefined && this.numericValue > this.max)) {
1331
+ // both min and max values are set
1332
+ inputError = InputError.MINMAX;
1333
+ }
1334
+ return inputError;
1335
+ };
1336
+ /**
1337
+ * Format value based on type
1338
+ *
1339
+ * @param {number} value value to format
1340
+ * @returns {string} formated local value
1341
+ */
1342
+ this.formatValue = (value) => (this.type === 'currency' ? localeCurrency(value, this.locale, this.currency) : localeNumber(value, this.locale));
1343
+ /**
1344
+ * Validate append slot
1345
+ *
1346
+ * @returns {void}
1347
+ */
1348
+ this.validateAppendSlot = () => {
1349
+ const slotAppendInput = this.element.querySelector('[slot="append-input"]');
1350
+ if (slotAppendInput !== null) {
1351
+ this.classList.add(slotAppendInput.nodeName === 'MG-BUTTON' ? 'mg-input--is-input-group-append' : 'mg-input--is-append-input-slot-content');
1352
+ }
1353
+ };
1354
+ }
1355
+ validateValue(newValue) {
1356
+ if (newValue !== undefined && newValue !== null) {
1357
+ // Split number and decimal
1358
+ const [integer, decimal = ''] = newValue.replace('-', '').split(/[\.,]/);
1359
+ // Regex
1360
+ const regex = this.type === 'integer' ? /^[\-]?\d+$/ : /^[\-]?\d+[.,]?\d*$/;
1361
+ // Filter input
1362
+ if (newValue === '' || (newValue.match(regex) && integer.length <= this.integerLength && decimal.length <= (this.type === 'integer' ? 0 : this.decimalLength))) {
1363
+ this.storedValue = newValue;
1364
+ }
1365
+ else if (this.storedValue !== undefined) {
1366
+ newValue = this.storedValue;
1367
+ }
1368
+ else {
1369
+ newValue = null;
1370
+ }
1371
+ // Set value and input value
1372
+ this.value = newValue;
1373
+ if (this.input !== undefined)
1374
+ this.input.value = this.value;
1375
+ // emit numeric value
1376
+ this.numericValue = this.value !== '' && this.value !== null ? parseFloat(this.value.replace(',', '.')) : null;
1377
+ this.valueChange.emit(this.numericValue);
1378
+ // Set readonlyValue
1379
+ this.readonlyValue = this.numericValue !== null ? this.formatValue(this.numericValue) : '';
1380
+ }
1381
+ }
1382
+ validateType(newValue) {
1383
+ if (!types.includes(newValue)) {
1384
+ throw new Error(`<mg-input-numeric> prop "type" must be one of : ${types.join(', ')}`);
1385
+ }
1386
+ }
1387
+ validateIntegerLength(newValue) {
1388
+ if (newValue < 1) {
1389
+ throw new Error(`<mg-input-numeric> prop "integer-length" must be a positive number.`);
1390
+ }
1391
+ }
1392
+ validateDecimalLength(newValue) {
1393
+ if (newValue < 1) {
1394
+ throw new Error(`<mg-input-numeric> prop "decimal-length" must be a positive number, consider using prop "type" to "integer" instead.`);
1395
+ }
1396
+ }
1397
+ /**
1398
+ * Public method to display errors
1399
+ *
1400
+ * @returns {Promise<void>}
1401
+ */
1402
+ async displayError() {
1403
+ this.checkValidity();
1404
+ this.checkError();
1405
+ this.hasError = this.invalid;
1406
+ }
1407
+ /**
1408
+ * Displayed value in input
1409
+ * Change on focus/blur
1410
+ *
1411
+ * @returns {string} display value
1412
+ */
1413
+ displayValue() {
1414
+ return this.hasFocus ? this.value : this.readonlyValue;
1415
+ }
1416
+ /*************
1417
+ * Lifecycle *
1418
+ *************/
1419
+ /**
1420
+ * Check if component props are well configured on init
1421
+ *
1422
+ * @returns {ReturnType<typeof setTimeout>} timeout
1423
+ */
1424
+ componentWillLoad() {
1425
+ // Get locales
1426
+ const locales = initLocales(this.element);
1427
+ this.locale = locales.locale;
1428
+ this.messages = locales.messages;
1429
+ // Validate
1430
+ this.validateValue(this.value);
1431
+ this.validateType(this.type);
1432
+ this.validateIntegerLength(this.integerLength);
1433
+ this.validateDecimalLength(this.decimalLength);
1434
+ this.validateAppendSlot();
1435
+ // Check validity when component is ready
1436
+ // return a promise to process action only in the FIRST render().
1437
+ // https://stenciljs.com/docs/component-lifecycle#componentwillload
1438
+ return setTimeout(() => {
1439
+ this.checkValidity();
1440
+ }, 0);
1441
+ }
1442
+ /**
1443
+ * Render
1444
+ *
1445
+ * @returns {HTMLElement} HTML Element
1446
+ */
1447
+ render() {
1448
+ return (h(MgInput, { identifier: this.identifier, classList: this.classList, ariaDescribedbyIDs: [], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, readonly: this.readonly, mgWidth: this.mgWidth, disabled: this.disabled, value: this.value, readonlyValue: this.readonlyValue, tooltip: this.tooltip, helpText: this.helpText, errorMessage: this.errorMessage, isFieldset: false }, h("input", { type: "text", class: "mg-input__box", value: this.displayValue(), id: this.identifier, name: this.name, placeholder: this.placeholder, title: this.placeholder, disabled: this.disabled, required: this.required, onInput: this.handleInput, onFocus: this.handleFocus, onBlur: this.handleBlur, ref: el => (this.input = el) }), h("slot", { name: "append-input" })));
1449
+ }
1450
+ get element() { return getElement(this); }
1451
+ static get watchers() { return {
1452
+ "value": ["validateValue"],
1453
+ "type": ["validateType"],
1454
+ "integerLength": ["validateIntegerLength"],
1455
+ "decimalLength": ["validateDecimalLength"]
1456
+ }; }
1457
+ };
1458
+ MgInputNumeric.style = mgInputNumericCss;
1459
+
1460
+ const mgInputPasswordCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container mg-icon{display:flex}.mg-input__input-container .mg-input__help-text,.mg-input__input-container .mg-input__error{text-align:start;font-size:1.2rem}.mg-input__input{display:flex;}.mg-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input__input.mg-input__input--has-error .mg-input__box{border-color:hsl(var(--color-danger))}.mg-input__input+.mg-input__help-text,.mg-input__input+.mg-input__error{margin-top:0.5rem}.mg-input__error{display:inline-block;margin-top:0.2rem;padding:0.3rem 0.8rem;border-radius:0.3rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-input__box{padding:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2) var(--mg-inputs-spacer);height:var(--default-size);box-sizing:border-box;border-width:var(--mg-inputs-border-width);border-style:solid;border-color:var(--mg-inputs-color);border-radius:var(--mg-inputs-border-radius);background-color:hsl(var(--color-light));font-family:inherit;color:hsl(var(--color-dark));font-size:var(--font-size);text-align:var(--mg-inputs-text-align, left)}.mg-input__box::placeholder{color:var(--mg-inputs-color);font-style:italic}.mg-input__box:focus{box-shadow:0 0 0.6rem hsla(var(--mg-inputs-color-shadow-focus-hsl), 0.5)}.mg-input__box:disabled{opacity:0.3}.mg-input.mg-input--is-input-group-append{--mg-button-border-radius-top-left:0;--mg-button-border-radius-bottom-left:0;}.mg-input.mg-input--is-input-group-append .mg-input__box{margin-right:-0.1rem;border-top-right-radius:0%;border-bottom-right-radius:0%}.mg-input.mg-input--is-input-group-append .mg-input__box:focus-visible{outline-style:solid;outline-offset:-0.2rem;outline-width:0.2rem}.mg-input.mg-input--is-input-group-append.mg-input--readonly slot[name=append-input]{display:none}.mg-input.mg-input--label-on-top .mg-input__box{width:auto;max-width:100%}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]){--mg-button-border-radius-top-right:0;--mg-button-border-radius-bottom-right:0}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:not(:last-of-type)){--mg-button-border-right-width:0}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:last-of-type){--mg-button-border-radius-top-right:var(--mg-inputs-border-radius);--mg-button-border-radius-bottom-right:var(--mg-inputs-border-radius)}.mg-input.mg-input--is-append-input-slot-content:not(.mg-input--readonly) ::slotted([slot=append-input]){padding-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input.mg-input--width-full:not(.mg-input--label-on-top){justify-content:space-between}.mg-input.mg-input--width-full .mg-input__input-container{flex:auto;width:100%}.mg-input.mg-input--width-full .mg-input__input-container .mg-input__box{width:100%}.mg-input.mg-input--width-16 .mg-input__box{width:21rem}.mg-input.mg-input--width-4 .mg-input__box{width:7rem}.mg-input.mg-input--width-2 .mg-input__box{width:5rem}.sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}";
1461
+
1462
+ const MgInputPassword = class {
1463
+ constructor(hostRef) {
1464
+ registerInstance(this, hostRef);
1465
+ this.valueChange = createEvent(this, "value-change", 7);
1466
+ this.inputValid = createEvent(this, "input-valid", 7);
1467
+ // hasError (triggered by blur event)
1468
+ this.hasError = false;
1469
+ /**
1470
+ * Identifier is used for the element ID (id is a reserved prop in Stencil.js)
1471
+ * If not set, it will be created.
1472
+ */
1473
+ this.identifier = createID('mg-input-password');
1474
+ /**
1475
+ * Input name
1476
+ * If not set the value equals the identifier
1477
+ */
1478
+ this.name = this.identifier;
1479
+ /**
1480
+ * Define if label is visible
1481
+ */
1482
+ this.labelHide = false;
1483
+ /**
1484
+ * Define if input is required
1485
+ */
1486
+ this.required = false;
1487
+ /**
1488
+ * Define if input is readonly
1489
+ */
1490
+ this.readonly = false;
1491
+ /**
1492
+ * Define if input is disabled
1493
+ */
1494
+ this.disabled = false;
1495
+ /**
1496
+ * Define input width
1497
+ */
1498
+ this.mgWidth = 'full';
1499
+ /**
1500
+ * Component classes
1501
+ */
1502
+ this.classList = new ClassList(['mg-input--password']);
1503
+ /**
1504
+ * Handle input event
1505
+ */
1506
+ this.handleInput = () => {
1507
+ this.checkValidity();
1508
+ if (this.hasError) {
1509
+ this.checkError();
1510
+ }
1511
+ this.value = this.input.value;
1512
+ };
1513
+ /**
1514
+ * Handle blur event
1515
+ */
1516
+ this.handleBlur = () => {
1517
+ this.displayError();
1518
+ };
1519
+ /**
1520
+ * Check if input is valid
1521
+ */
1522
+ this.checkValidity = () => {
1523
+ if (!this.readonly && this.input !== undefined) {
1524
+ const validity = this.input.checkValidity();
1525
+ // Set validity
1526
+ this.valid = validity;
1527
+ this.invalid = !validity;
1528
+ //Send event
1529
+ this.inputValid.emit(validity);
1530
+ }
1531
+ };
1532
+ /**
1533
+ * Check input errors
1534
+ */
1535
+ this.checkError = () => {
1536
+ // Set error message
1537
+ this.errorMessage = undefined;
1538
+ // required
1539
+ if (!this.valid && this.input.validity.valueMissing) {
1540
+ this.errorMessage = this.messages.errors.required;
1541
+ }
1542
+ };
1543
+ }
1544
+ handleValue(newValue) {
1545
+ this.valueChange.emit(newValue);
1546
+ }
1547
+ /**
1548
+ * Public method to display errors
1549
+ *
1550
+ * @returns {Promise<void>}
1551
+ */
1552
+ async displayError() {
1553
+ this.checkValidity();
1554
+ this.checkError();
1555
+ this.hasError = this.invalid;
1556
+ }
1557
+ /*************
1558
+ * Lifecycle *
1559
+ *************/
1560
+ /**
1561
+ * Check if component props are well configured on init
1562
+ *
1563
+ * @returns {ReturnType<typeof setTimeout>} timeout
1564
+ */
1565
+ componentWillLoad() {
1566
+ // Get locales
1567
+ this.messages = initLocales(this.element).messages;
1568
+ // Check validity when component is ready
1569
+ // return a promise to process action only in the FIRST render().
1570
+ // https://stenciljs.com/docs/component-lifecycle#componentwillload
1571
+ return setTimeout(() => {
1572
+ this.checkValidity();
1573
+ }, 0);
1574
+ }
1575
+ /**
1576
+ * Render
1577
+ *
1578
+ * @returns {HTMLElement} HTML Element
1579
+ */
1580
+ render() {
1581
+ return (h(MgInput, { identifier: this.identifier, classList: this.classList, ariaDescribedbyIDs: [], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, readonly: this.readonly, mgWidth: this.mgWidth, disabled: this.disabled, value: this.value, readonlyValue: this.value !== undefined ? '•'.repeat(this.value.length) : undefined, tooltip: this.tooltip, helpText: this.helpText, errorMessage: this.errorMessage, isFieldset: false }, h("input", { type: "password", class: "mg-input__box", value: this.value, id: this.identifier, name: this.name, placeholder: this.placeholder, title: this.placeholder, disabled: this.disabled, required: this.required, onInput: this.handleInput, onBlur: this.handleBlur, ref: el => (this.input = el) })));
1582
+ }
1583
+ get element() { return getElement(this); }
1584
+ static get watchers() { return {
1585
+ "value": ["handleValue"]
1586
+ }; }
1587
+ };
1588
+ MgInputPassword.style = mgInputPasswordCss;
1589
+
1590
+ const mgInputRadioCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container mg-icon{display:flex}.mg-input__input-container .mg-input__help-text,.mg-input__input-container .mg-input__error{text-align:start;font-size:1.2rem}.mg-input__input{display:flex;}.mg-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input__input.mg-input__input--has-error .mg-input__box{border-color:hsl(var(--color-danger))}.mg-input__input+.mg-input__help-text,.mg-input__input+.mg-input__error{margin-top:0.5rem}.mg-input__error{display:inline-block;margin-top:0.2rem;padding:0.3rem 0.8rem;border-radius:0.3rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}fieldset.mg-input{border:0;margin-left:0;margin-right:0;padding:0}fieldset.mg-input input[type=radio],fieldset.mg-input input[type=checkbox]{flex-shrink:0;width:var(--mg-input-check-size);height:var(--mg-input-check-size);margin-top:calc((var(--font-size) * var(--line-height) - var(--mg-input-check-size)) / 2);margin-right:0.6rem;margin-bottom:0;margin-left:0}fieldset.mg-input.mg-input--label-on-top .mg-input__input-group-container{margin-top:0.7rem}.mg-input__input-container mg-tooltip{margin-left:3rem}.mg-input__input-group-container{margin:0;padding:0;list-style:none;display:flex;flex-wrap:wrap;column-gap:2.3rem;row-gap:1rem;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2)}.mg-input__input-group-container--vertical{flex-direction:column}.mg-input__input-group{display:flex;align-items:top}.mg-input__input-group.mg-input__input-group--disabled label{opacity:0.3}.sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}";
1591
+
1592
+ /**
1593
+ * type Option validation function
1594
+ *
1595
+ * @param {RadioOption} option radio option
1596
+ * @returns {boolean} radio option type is valid
1597
+ */
1598
+ const isOption$2 = (option) => typeof option === 'object' && typeof option.title === 'string' && option.value !== undefined;
1599
+ const MgInputRadio = class {
1600
+ constructor(hostRef) {
1601
+ registerInstance(this, hostRef);
1602
+ this.valueChange = createEvent(this, "value-change", 7);
1603
+ this.inputValid = createEvent(this, "input-valid", 7);
1604
+ /************
1605
+ * Internal *
1606
+ ************/
1607
+ // HTML selector
1608
+ this.inputs = [];
1609
+ /**
1610
+ * Identifier is used for the element ID (id is a reserved prop in Stencil.js)
1611
+ * If not set, it will be created.
1612
+ */
1613
+ this.identifier = createID('mg-input-radio');
1614
+ /**
1615
+ * Input name
1616
+ * If not set the value equals the identifier
1617
+ */
1618
+ this.name = this.identifier;
1619
+ /**
1620
+ * Define if label is displayed on top
1621
+ */
1622
+ this.labelOnTop = false;
1623
+ /**
1624
+ * Define if label is visible
1625
+ */
1626
+ this.labelHide = false;
1627
+ /**
1628
+ * Define if inputs are display verticaly
1629
+ */
1630
+ this.inputVerticalList = false;
1631
+ /**
1632
+ * Define if input is required
1633
+ */
1634
+ this.required = false;
1635
+ /**
1636
+ * Define if input is readonly
1637
+ */
1638
+ this.readonly = false;
1639
+ /**
1640
+ * Define if input is disabled
1641
+ */
1642
+ this.disabled = false;
1643
+ /**
1644
+ * Component classes
1645
+ */
1646
+ this.classList = new ClassList(['mg-input--radio']);
1647
+ /**
1648
+ * Handle input event
1649
+ *
1650
+ * @param {event} event input event
1651
+ * @returns {void}
1652
+ */
1653
+ this.handleInput = (event) => {
1654
+ this.checkValidity();
1655
+ this.value = this.options[event.target.value].value;
1656
+ };
1657
+ /**
1658
+ * Handle blur event
1659
+ *
1660
+ * @returns {void}
1661
+ */
1662
+ this.handleBlur = () => {
1663
+ this.checkValidity();
1664
+ this.checkError();
1665
+ };
1666
+ /**
1667
+ * Check if input is valid
1668
+ *
1669
+ * @returns {void}
1670
+ */
1671
+ this.checkValidity = () => {
1672
+ if (!this.readonly) {
1673
+ const validity = this.getInvalidElement() === undefined;
1674
+ // Set validity
1675
+ this.valid = validity;
1676
+ this.invalid = !validity;
1677
+ //Send event
1678
+ this.inputValid.emit(validity);
1679
+ }
1680
+ };
1681
+ /**
1682
+ * Check input errors
1683
+ *
1684
+ * @returns {void}
1685
+ */
1686
+ this.checkError = () => {
1687
+ const invalidElement = this.getInvalidElement();
1688
+ // Set error message
1689
+ this.errorMessage = undefined;
1690
+ if (!this.valid && invalidElement.validity.valueMissing) {
1691
+ this.errorMessage = this.messages.errors.required;
1692
+ }
1693
+ };
1694
+ /**
1695
+ * get invalid element
1696
+ *
1697
+ * @returns {HTMLInputElement} element
1698
+ */
1699
+ this.getInvalidElement = () => this.inputs.find((element) => !element.disabled && !element.checkValidity());
1700
+ }
1701
+ handleValue(newValue) {
1702
+ this.valueChange.emit(newValue);
1703
+ }
1704
+ validateItems(newValue) {
1705
+ // Validate if items have required min length
1706
+ if (typeof newValue === 'object' && newValue.length < 2) {
1707
+ throw new Error('<mg-input-radio> prop "items" require at least 2 items.');
1708
+ }
1709
+ // String array
1710
+ else if (allItemsAreString(newValue)) {
1711
+ this.options = newValue.map(item => ({ title: item, value: item, disabled: this.disabled }));
1712
+ }
1713
+ // Object array
1714
+ else if (newValue && newValue.every(item => isOption$2(item))) {
1715
+ this.options = newValue;
1716
+ }
1717
+ else {
1718
+ throw new Error('<mg-input-radio> prop "items" is required and all items must be the same type, string or RadioOption.');
1719
+ }
1720
+ }
1721
+ /**
1722
+ * Public method to display errors
1723
+ *
1724
+ * @returns {Promise<void>}
1725
+ */
1726
+ async displayError() {
1727
+ this.checkValidity();
1728
+ this.checkError();
1729
+ }
1730
+ /*************
1731
+ * Lifecycle *
1732
+ *************/
1733
+ /**
1734
+ * Check if component props are well configured on init
1735
+ *
1736
+ * @returns {ReturnType<typeof setTimeout>} timeout
1737
+ */
1738
+ componentWillLoad() {
1739
+ // Get locales
1740
+ this.messages = initLocales(this.element).messages;
1741
+ // Validate
1742
+ this.validateItems(this.items);
1743
+ // Check validity when component is ready
1744
+ // return a promise to process action only in the FIRST render().
1745
+ // https://stenciljs.com/docs/component-lifecycle#componentwillload
1746
+ return setTimeout(() => {
1747
+ this.checkValidity();
1748
+ }, 0);
1749
+ }
1750
+ /**
1751
+ * Render
1752
+ *
1753
+ * @returns {HTMLElement} HTML Element
1754
+ */
1755
+ render() {
1756
+ return (h(MgInput, { identifier: this.identifier, classList: this.classList, ariaDescribedbyIDs: [], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, disabled: this.disabled, readonly: this.readonly, mgWidth: undefined, value: this.value, readonlyValue: this.value, tooltip: this.tooltip, helpText: this.helpText, errorMessage: this.errorMessage, isFieldset: true }, h("ul", { class: { 'mg-input__input-group-container': true, 'mg-input__input-group-container--vertical': this.inputVerticalList } }, this.options.map((input, index) => (h("li", { class: { 'mg-input__input-group': true, 'mg-input__input-group--disabled': this.disabled || input.disabled } }, h("input", { type: "radio", id: this.identifier + '_' + index, name: this.identifier, value: index, checked: JSON.stringify(this.value) === JSON.stringify(this.options[index].value), disabled: this.disabled || input.disabled, required: this.required, onBlur: this.handleBlur, onInput: this.handleInput, ref: el => this.inputs.push(el) }), h("label", { htmlFor: this.identifier + '_' + index }, input.title)))))));
1757
+ }
1758
+ get element() { return getElement(this); }
1759
+ static get watchers() { return {
1760
+ "value": ["handleValue"],
1761
+ "items": ["validateItems"]
1762
+ }; }
1763
+ };
1764
+ MgInputRadio.style = mgInputRadioCss;
1765
+
1766
+ const mgInputSelectCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container mg-icon{display:flex}.mg-input__input-container .mg-input__help-text,.mg-input__input-container .mg-input__error{text-align:start;font-size:1.2rem}.mg-input__input{display:flex;}.mg-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input__input.mg-input__input--has-error .mg-input__box{border-color:hsl(var(--color-danger))}.mg-input__input+.mg-input__help-text,.mg-input__input+.mg-input__error{margin-top:0.5rem}.mg-input__error{display:inline-block;margin-top:0.2rem;padding:0.3rem 0.8rem;border-radius:0.3rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-input__box{padding:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2) var(--mg-inputs-spacer);height:var(--default-size);box-sizing:border-box;border-width:var(--mg-inputs-border-width);border-style:solid;border-color:var(--mg-inputs-color);border-radius:var(--mg-inputs-border-radius);background-color:hsl(var(--color-light));font-family:inherit;color:hsl(var(--color-dark));font-size:var(--font-size);text-align:var(--mg-inputs-text-align, left)}.mg-input__box::placeholder{color:var(--mg-inputs-color);font-style:italic}.mg-input__box:focus{box-shadow:0 0 0.6rem hsla(var(--mg-inputs-color-shadow-focus-hsl), 0.5)}.mg-input__box:disabled{opacity:0.3}.mg-input.mg-input--is-input-group-append{--mg-button-border-radius-top-left:0;--mg-button-border-radius-bottom-left:0;}.mg-input.mg-input--is-input-group-append .mg-input__box{margin-right:-0.1rem;border-top-right-radius:0%;border-bottom-right-radius:0%}.mg-input.mg-input--is-input-group-append .mg-input__box:focus-visible{outline-style:solid;outline-offset:-0.2rem;outline-width:0.2rem}.mg-input.mg-input--is-input-group-append.mg-input--readonly slot[name=append-input]{display:none}.mg-input.mg-input--label-on-top .mg-input__box{width:auto;max-width:100%}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]){--mg-button-border-radius-top-right:0;--mg-button-border-radius-bottom-right:0}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:not(:last-of-type)){--mg-button-border-right-width:0}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:last-of-type){--mg-button-border-radius-top-right:var(--mg-inputs-border-radius);--mg-button-border-radius-bottom-right:var(--mg-inputs-border-radius)}.mg-input.mg-input--is-append-input-slot-content:not(.mg-input--readonly) ::slotted([slot=append-input]){padding-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input.mg-input--width-full:not(.mg-input--label-on-top){justify-content:space-between}.mg-input.mg-input--width-full .mg-input__input-container{flex:auto;width:100%}.mg-input.mg-input--width-full .mg-input__input-container .mg-input__box{width:100%}.mg-input.mg-input--width-16 .mg-input__box{width:21rem}.mg-input.mg-input--width-4 .mg-input__box{width:7rem}.mg-input.mg-input--width-2 .mg-input__box{width:5rem}.sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}.mg-input__box{width:100%;padding-top:0;padding-bottom:0;padding-right:1rem}";
1767
+
1768
+ /**
1769
+ * Check if item is a well configured option
1770
+ *
1771
+ * @param {SelectOption} option select option
1772
+ * @returns {boolean} select option type is valid
1773
+ */
1774
+ const isOption$1 = (option) => typeof option === 'object' && typeof option.title === 'string';
1775
+ /**
1776
+ * Group options
1777
+ *
1778
+ * @param {(SelectOption | OptGroup)[]} acc reduce accumulator
1779
+ * @param {SelectOption} item item to add
1780
+ * @param {string} item.group item group
1781
+ * @param {string} item.title item title
1782
+ * @param {unknown} item.value item value
1783
+ * @param {boolean} item.disabled is item disabled
1784
+ * @returns {(SelectOption | OptGroup)[]} grouped options
1785
+ */
1786
+ const groupOptions = (acc, { group, title, value, disabled }) => {
1787
+ if (group !== undefined) {
1788
+ // Check if group is already created
1789
+ const optGroup = acc.find(grp => grp.group === group);
1790
+ // Add to group
1791
+ if (optGroup !== undefined) {
1792
+ optGroup.options.push({ title, value, disabled });
1793
+ }
1794
+ // Create group
1795
+ else {
1796
+ acc.push({ group, options: [{ title, value, disabled }] });
1797
+ }
1798
+ }
1799
+ else {
1800
+ acc.push({ title, value, disabled });
1801
+ }
1802
+ return acc;
1803
+ };
1804
+ const MgInputSelect = class {
1805
+ constructor(hostRef) {
1806
+ registerInstance(this, hostRef);
1807
+ this.valueChange = createEvent(this, "value-change", 7);
1808
+ this.inputValid = createEvent(this, "input-valid", 7);
1809
+ // hasError (triggered by blur event)
1810
+ this.hasError = false;
1811
+ /**
1812
+ * Identifier is used for the element ID (id is a reserved prop in Stencil.js)
1813
+ * If not set, it will be created.
1814
+ */
1815
+ this.identifier = createID('mg-input-select');
1816
+ /**
1817
+ * Input name
1818
+ * If not set the value equals the identifier
1819
+ */
1820
+ this.name = this.identifier;
1821
+ /**
1822
+ * Define if label is visible
1823
+ */
1824
+ this.labelHide = false;
1825
+ /**
1826
+ * Option to remove placeholder
1827
+ */
1828
+ this.placeholderHide = false;
1829
+ /**
1830
+ * Option to disable placeholder
1831
+ */
1832
+ this.placeholderDisabled = false;
1833
+ /**
1834
+ * Define if input is required
1835
+ */
1836
+ this.required = false;
1837
+ /**
1838
+ * Define if input is readonly
1839
+ */
1840
+ this.readonly = false;
1841
+ /**
1842
+ * Define if input is disabled
1843
+ */
1844
+ this.disabled = false;
1845
+ /**
1846
+ * Component classes
1847
+ */
1848
+ this.classList = new ClassList(['mg-input--select']);
1849
+ /**
1850
+ * Handle input event
1851
+ */
1852
+ this.handleInput = () => {
1853
+ this.checkValidity();
1854
+ if (this.hasError) {
1855
+ this.checkError();
1856
+ }
1857
+ if (this.input.value !== '') {
1858
+ this.value = allItemsAreString(this.items) ? this.input.value : this.items.find(item => item.title === this.input.value).value;
1859
+ }
1860
+ else {
1861
+ this.value = null;
1862
+ }
1863
+ };
1864
+ /**
1865
+ * Handle blur event
1866
+ */
1867
+ this.handleBlur = () => {
1868
+ this.displayError();
1869
+ };
1870
+ /**
1871
+ * Check if input is valid
1872
+ */
1873
+ this.checkValidity = () => {
1874
+ if (!this.readonly && this.input !== undefined) {
1875
+ const validity = this.input.checkValidity && this.input.checkValidity();
1876
+ // Set validity
1877
+ this.valid = validity;
1878
+ this.invalid = !validity;
1879
+ //Send event
1880
+ this.inputValid.emit(validity);
1881
+ }
1882
+ };
1883
+ /**
1884
+ * Check input errors
1885
+ */
1886
+ this.checkError = () => {
1887
+ // Set error message
1888
+ this.errorMessage = undefined;
1889
+ if (!this.valid && this.input.validity.valueMissing) {
1890
+ this.errorMessage = this.messages.errors.required;
1891
+ }
1892
+ };
1893
+ }
1894
+ handleValue(newValue) {
1895
+ if (newValue !== null) {
1896
+ this.readonlyValue = allItemsAreString(this.items) ? this.input.value : this.items.find(item => item.value === newValue).title;
1897
+ }
1898
+ else {
1899
+ this.readonlyValue = null;
1900
+ }
1901
+ this.valueChange.emit(newValue);
1902
+ }
1903
+ validateItems(newValue) {
1904
+ // String array
1905
+ if (allItemsAreString(newValue)) {
1906
+ this.valueExist = newValue.includes(this.value);
1907
+ this.options = newValue.map((item) => ({ title: item, value: item }));
1908
+ }
1909
+ // Object array
1910
+ else if (newValue && newValue.every(item => isOption$1(item))) {
1911
+ this.valueExist = newValue.map(item => item.value).includes(this.value);
1912
+ // Grouped object options
1913
+ if (newValue.some(item => item.group !== undefined)) {
1914
+ this.options = newValue.reduce(groupOptions, []);
1915
+ }
1916
+ // Standart object options
1917
+ else {
1918
+ this.options = newValue;
1919
+ }
1920
+ }
1921
+ else {
1922
+ throw new Error('<mg-input-select> prop "items" is required and all items must be the same type, string or Option.');
1923
+ }
1924
+ }
1925
+ /**
1926
+ * Public method to display errors
1927
+ *
1928
+ * @returns {Promise<void>}
1929
+ */
1930
+ async displayError() {
1931
+ this.checkValidity();
1932
+ this.checkError();
1933
+ this.hasError = this.invalid;
1934
+ }
1935
+ /*************
1936
+ * Lifecycle *
1937
+ *************/
1938
+ /**
1939
+ * Check if component props are well configured on init
1940
+ *
1941
+ * @returns {ReturnType<typeof setTimeout>} timeout
1942
+ */
1943
+ componentWillLoad() {
1944
+ // Get locales
1945
+ this.messages = initLocales(this.element).messages;
1946
+ // Validate
1947
+ this.validateItems(this.items);
1948
+ // Set default placeholder
1949
+ if (this.placeholder === undefined || this.placeholder === '') {
1950
+ this.placeholder = this.messages.input.select.placeholder;
1951
+ }
1952
+ // Check validity when component is ready
1953
+ // return a promise to process action only in the FIRST render().
1954
+ // https://stenciljs.com/docs/component-lifecycle#componentwillload
1955
+ return setTimeout(() => {
1956
+ this.checkValidity();
1957
+ }, 0);
1958
+ }
1959
+ /**
1960
+ * Render
1961
+ *
1962
+ * @returns {HTMLElement} HTML Element
1963
+ */
1964
+ render() {
1965
+ return (h(MgInput, { identifier: this.identifier, classList: this.classList, ariaDescribedbyIDs: [], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, readonly: this.readonly, mgWidth: this.mgWidth, disabled: this.disabled, value: this.value, readonlyValue: this.readonlyValue, tooltip: this.tooltip, helpText: this.helpText, errorMessage: this.errorMessage, isFieldset: false }, h("select", { class: "mg-input__box", id: this.identifier, name: this.name, title: this.placeholder, disabled: this.disabled, required: this.required, onInput: this.handleInput, onBlur: this.handleBlur, ref: el => (this.input = el) }, (!this.placeholderHide || !this.valueExist) && ( // In case passed value does not match any option we display the placeholder
1966
+ h("option", { value: "", disabled: this.placeholderDisabled && this.valueExist }, this.placeholder)), this.options.map(option => option.group !== undefined ? (h("optgroup", { label: option.group }, option.options.map(optgroup => (h("option", { value: optgroup.title, selected: JSON.stringify(this.value) === JSON.stringify(optgroup.value), disabled: optgroup.disabled }, optgroup.title))))) : (h("option", { value: option.title, selected: JSON.stringify(this.value) === JSON.stringify(option.value), disabled: option.disabled }, option.title))))));
1967
+ }
1968
+ get element() { return getElement(this); }
1969
+ static get watchers() { return {
1970
+ "value": ["handleValue"],
1971
+ "items": ["validateItems"]
1972
+ }; }
1973
+ };
1974
+ MgInputSelect.style = mgInputSelectCss;
1975
+
1976
+ const mgInputTextCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container mg-icon{display:flex}.mg-input__input-container .mg-input__help-text,.mg-input__input-container .mg-input__error{text-align:start;font-size:1.2rem}.mg-input__input{display:flex;}.mg-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input__input.mg-input__input--has-error .mg-input__box{border-color:hsl(var(--color-danger))}.mg-input__input+.mg-input__help-text,.mg-input__input+.mg-input__error{margin-top:0.5rem}.mg-input__error{display:inline-block;margin-top:0.2rem;padding:0.3rem 0.8rem;border-radius:0.3rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-input__box{padding:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2) var(--mg-inputs-spacer);height:var(--default-size);box-sizing:border-box;border-width:var(--mg-inputs-border-width);border-style:solid;border-color:var(--mg-inputs-color);border-radius:var(--mg-inputs-border-radius);background-color:hsl(var(--color-light));font-family:inherit;color:hsl(var(--color-dark));font-size:var(--font-size);text-align:var(--mg-inputs-text-align, left)}.mg-input__box::placeholder{color:var(--mg-inputs-color);font-style:italic}.mg-input__box:focus{box-shadow:0 0 0.6rem hsla(var(--mg-inputs-color-shadow-focus-hsl), 0.5)}.mg-input__box:disabled{opacity:0.3}.mg-input.mg-input--is-input-group-append{--mg-button-border-radius-top-left:0;--mg-button-border-radius-bottom-left:0;}.mg-input.mg-input--is-input-group-append .mg-input__box{margin-right:-0.1rem;border-top-right-radius:0%;border-bottom-right-radius:0%}.mg-input.mg-input--is-input-group-append .mg-input__box:focus-visible{outline-style:solid;outline-offset:-0.2rem;outline-width:0.2rem}.mg-input.mg-input--is-input-group-append.mg-input--readonly slot[name=append-input]{display:none}.mg-input.mg-input--label-on-top .mg-input__box{width:auto;max-width:100%}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]){--mg-button-border-radius-top-right:0;--mg-button-border-radius-bottom-right:0}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:not(:last-of-type)){--mg-button-border-right-width:0}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:last-of-type){--mg-button-border-radius-top-right:var(--mg-inputs-border-radius);--mg-button-border-radius-bottom-right:var(--mg-inputs-border-radius)}.mg-input.mg-input--is-append-input-slot-content:not(.mg-input--readonly) ::slotted([slot=append-input]){padding-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input.mg-input--width-full:not(.mg-input--label-on-top){justify-content:space-between}.mg-input.mg-input--width-full .mg-input__input-container{flex:auto;width:100%}.mg-input.mg-input--width-full .mg-input__input-container .mg-input__box{width:100%}.mg-input.mg-input--width-16 .mg-input__box{width:21rem}.mg-input.mg-input--width-4 .mg-input__box{width:7rem}.mg-input.mg-input--width-2 .mg-input__box{width:5rem}.mg-input mg-character-left{opacity:0.6;font-size:1.1rem}.mg-input.mg-input--has-display-character-left .mg-input__input+.mg-input__help-text,.mg-input.mg-input--has-display-character-left .mg-input__input+.mg-input__error{margin-top:0}.sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}.mg-input.mg-input--has-icon .mg-input__with-character-left>mg-icon{position:absolute;top:50%;left:var(--mg-inputs-spacer);color:var(--mg-inputs-color);transform:translateY(-50%)}.mg-input.mg-input--has-icon .mg-input__with-character-left .mg-input__box{padding-left:calc(var(--mg-icon-regular-size) + var(--mg-inputs-spacer) * 2)}.mg-input__with-character-left{position:relative;display:inline-flex;width:100%}.mg-input.is-focused .mg-input__with-character-left .mg-input__box{padding-right:calc(var(--mg-character-left-message-length) * 1ch + 0.8rem)}.mg-input__with-character-left mg-character-left{position:absolute;display:none;top:50%;right:1rem;opacity:0.6;transform:translateY(-50%);font-size:1.1rem}.mg-input.is-focused .mg-input__with-character-left mg-character-left{display:block}";
1977
+
1978
+ const MgInputText = class {
1979
+ constructor(hostRef) {
1980
+ registerInstance(this, hostRef);
1981
+ this.valueChange = createEvent(this, "value-change", 7);
1982
+ this.inputValid = createEvent(this, "input-valid", 7);
1983
+ /************
1984
+ * Internal *
1985
+ ************/
1986
+ // classes
1987
+ this.classFocus = 'is-focused';
1988
+ this.classIsInputGroupAppend = 'mg-input--is-input-group-append';
1989
+ this.classHasIcon = 'mg-input--has-icon';
1990
+ // hasError (triggered by blur event)
1991
+ this.hasError = false;
1992
+ /**
1993
+ * Identifier is used for the element ID (id is a reserved prop in Stencil.js)
1994
+ * If not set, it will be created.
1995
+ */
1996
+ this.identifier = createID('mg-input-text');
1997
+ /**
1998
+ * Input name
1999
+ * If not set the value equals the identifier
2000
+ */
2001
+ this.name = this.identifier;
2002
+ /**
2003
+ * Input type
2004
+ */
2005
+ this.type = 'text';
2006
+ /**
2007
+ * Define if label is visible
2008
+ */
2009
+ this.labelHide = false;
2010
+ /**
2011
+ * Input max length
2012
+ */
2013
+ this.maxlength = 400;
2014
+ /**
2015
+ * Define if input is required
2016
+ */
2017
+ this.required = false;
2018
+ /**
2019
+ * Define if input is readonly
2020
+ */
2021
+ this.readonly = false;
2022
+ /**
2023
+ * Define if input is disabled
2024
+ */
2025
+ this.disabled = false;
2026
+ /**
2027
+ * Define input width
2028
+ */
2029
+ this.mgWidth = 'full';
2030
+ /**
2031
+ * Define if component should display character left
2032
+ */
2033
+ this.displayCharacterLeft = true;
2034
+ /**
2035
+ * Component classes
2036
+ */
2037
+ this.classList = new ClassList(['mg-input--text']);
2038
+ /**
2039
+ * Handle input event
2040
+ *
2041
+ * @returns {void}
2042
+ */
2043
+ this.handleInput = () => {
2044
+ this.checkValidity();
2045
+ if (this.hasError) {
2046
+ this.checkError();
2047
+ }
2048
+ this.value = this.input.value;
2049
+ };
2050
+ /**
2051
+ * Handle focus event
2052
+ *
2053
+ * @returns {void}
2054
+ */
2055
+ this.handleFocus = () => {
2056
+ this.classList.add(this.classFocus);
2057
+ this.classList = new ClassList(this.classList.classes);
2058
+ };
2059
+ /**
2060
+ * Handle blur event
2061
+ *
2062
+ * @returns {void}
2063
+ */
2064
+ this.handleBlur = () => {
2065
+ // Manage focus
2066
+ this.classList.delete(this.classFocus);
2067
+ this.classList = new ClassList(this.classList.classes);
2068
+ // Display Error
2069
+ this.displayError();
2070
+ };
2071
+ /**
2072
+ * Check if input is valid
2073
+ *
2074
+ * @returns {void}
2075
+ */
2076
+ this.checkValidity = () => {
2077
+ if (!this.readonly && this.input !== undefined) {
2078
+ const validity = this.input.checkValidity();
2079
+ // Set validity
2080
+ this.valid = validity;
2081
+ this.invalid = !validity;
2082
+ //Send event
2083
+ this.inputValid.emit(validity);
2084
+ }
2085
+ };
2086
+ /**
2087
+ * Check input errors
2088
+ *
2089
+ * @returns {void}
2090
+ */
2091
+ this.checkError = () => {
2092
+ // Set error message
2093
+ this.errorMessage = undefined;
2094
+ // Does not match pattern
2095
+ if (!this.valid && this.input.validity.patternMismatch) {
2096
+ this.errorMessage = this.patternErrorMessage;
2097
+ }
2098
+ // required
2099
+ else if (!this.valid && this.input.validity.valueMissing) {
2100
+ this.errorMessage = this.messages.errors.required;
2101
+ }
2102
+ };
2103
+ /**
2104
+ * Validate patern configuration
2105
+ *
2106
+ * @returns {void}
2107
+ */
2108
+ this.validatePattern = () => {
2109
+ if (this.pattern &&
2110
+ typeof this.pattern === 'string' &&
2111
+ this.pattern !== '' &&
2112
+ (this.patternErrorMessage === undefined || typeof this.patternErrorMessage !== 'string' || this.patternErrorMessage === '')) {
2113
+ throw new Error('<mg-input-text> prop "pattern" must be paired with the prop "patternErrorMessage"');
2114
+ }
2115
+ };
2116
+ /**
2117
+ * Validate append slot
2118
+ *
2119
+ * @returns {void}
2120
+ */
2121
+ this.validateAppendSlot = () => {
2122
+ const slotAppendInput = Array.from(this.element.querySelectorAll('[slot="append-input"]'));
2123
+ if (slotAppendInput.length === 1) {
2124
+ this.classList.add(slotAppendInput[0].nodeName === 'MG-BUTTON' ? this.classIsInputGroupAppend : 'mg-input--is-append-input-slot-content');
2125
+ }
2126
+ else if (slotAppendInput.filter(slot => slot.nodeName === 'MG-BUTTON').length > 1) {
2127
+ this.classList.add(this.classIsInputGroupAppend);
2128
+ this.classList.add('mg-input--has-buttons-group-append');
2129
+ }
2130
+ };
2131
+ }
2132
+ handleValue(newValue) {
2133
+ this.valueChange.emit(newValue);
2134
+ }
2135
+ validateIcon(newValue) {
2136
+ if (newValue !== undefined) {
2137
+ this.classList.add(this.classHasIcon);
2138
+ }
2139
+ else {
2140
+ this.classList.delete(this.classHasIcon);
2141
+ }
2142
+ }
2143
+ /**
2144
+ * Public method to play input focus
2145
+ *
2146
+ * @returns {Promise<void>}
2147
+ */
2148
+ async setFocus() {
2149
+ this.input.focus();
2150
+ }
2151
+ /**
2152
+ * Public method to display errors
2153
+ *
2154
+ * @returns {Promise<void>}
2155
+ */
2156
+ async displayError() {
2157
+ this.checkValidity();
2158
+ this.checkError();
2159
+ this.hasError = this.invalid;
2160
+ }
2161
+ /*************
2162
+ * Lifecycle *
2163
+ *************/
2164
+ /**
2165
+ * Check if component props are well configured on init
2166
+ *
2167
+ * @returns {ReturnType<typeof setTimeout>} timeout
2168
+ */
2169
+ componentWillLoad() {
2170
+ // Get locales
2171
+ this.messages = initLocales(this.element).messages;
2172
+ this.characterLeftId = `${this.identifier}-character-left`;
2173
+ // Validate
2174
+ this.validateIcon(this.icon);
2175
+ this.validatePattern();
2176
+ this.validateAppendSlot();
2177
+ // Check validity when component is ready
2178
+ // return a promise to process action only in the FIRST render().
2179
+ // https://stenciljs.com/docs/component-lifecycle#componentwillload
2180
+ return setTimeout(() => {
2181
+ this.checkValidity();
2182
+ }, 0);
2183
+ }
2184
+ /**
2185
+ * Render
2186
+ *
2187
+ * @returns {HTMLElement} HTML Element
2188
+ */
2189
+ render() {
2190
+ return (h(MgInput, { identifier: this.identifier, classList: this.classList, ariaDescribedbyIDs: [this.characterLeftId], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, readonly: this.readonly, mgWidth: this.mgWidth, disabled: this.disabled, value: this.value, readonlyValue: undefined, tooltip: this.tooltip, helpText: this.helpText, errorMessage: this.errorMessage, isFieldset: false }, h("div", { class: "mg-input__with-character-left", style: {
2191
+ '--mg-character-left-message-length': (this.displayCharacterLeft
2192
+ ? (this.maxlength - (this.value || '').length).toString().length + this.maxlength.toString().length + 1
2193
+ : 0).toString(),
2194
+ } }, this.icon !== undefined && h("mg-icon", { icon: this.icon }), h("input", { type: this.type, class: "mg-input__box", value: this.value, id: this.identifier, name: this.name, placeholder: this.placeholder, title: this.placeholder, maxlength: this.maxlength, disabled: this.disabled, required: this.required, pattern: this.pattern, onInput: this.handleInput, onFocus: this.handleFocus, onBlur: this.handleBlur, ref: el => (this.input = el) }), this.displayCharacterLeft && this.maxlength && (h("mg-character-left", { identifier: this.characterLeftId, characters: this.value, maxlength: this.maxlength }))), h("slot", { name: "append-input" })));
2195
+ }
2196
+ get element() { return getElement(this); }
2197
+ static get watchers() { return {
2198
+ "value": ["handleValue"],
2199
+ "icon": ["validateIcon"]
2200
+ }; }
2201
+ };
2202
+ MgInputText.style = mgInputTextCss;
2203
+
2204
+ const mgInputTextareaCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container mg-icon{display:flex}.mg-input__input-container .mg-input__help-text,.mg-input__input-container .mg-input__error{text-align:start;font-size:1.2rem}.mg-input__input{display:flex;}.mg-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input__input.mg-input__input--has-error .mg-input__box{border-color:hsl(var(--color-danger))}.mg-input__input+.mg-input__help-text,.mg-input__input+.mg-input__error{margin-top:0.5rem}.mg-input__error{display:inline-block;margin-top:0.2rem;padding:0.3rem 0.8rem;border-radius:0.3rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-input__box{padding:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2) var(--mg-inputs-spacer);height:var(--default-size);box-sizing:border-box;border-width:var(--mg-inputs-border-width);border-style:solid;border-color:var(--mg-inputs-color);border-radius:var(--mg-inputs-border-radius);background-color:hsl(var(--color-light));font-family:inherit;color:hsl(var(--color-dark));font-size:var(--font-size);text-align:var(--mg-inputs-text-align, left)}.mg-input__box::placeholder{color:var(--mg-inputs-color);font-style:italic}.mg-input__box:focus{box-shadow:0 0 0.6rem hsla(var(--mg-inputs-color-shadow-focus-hsl), 0.5)}.mg-input__box:disabled{opacity:0.3}.mg-input.mg-input--is-input-group-append{--mg-button-border-radius-top-left:0;--mg-button-border-radius-bottom-left:0;}.mg-input.mg-input--is-input-group-append .mg-input__box{margin-right:-0.1rem;border-top-right-radius:0%;border-bottom-right-radius:0%}.mg-input.mg-input--is-input-group-append .mg-input__box:focus-visible{outline-style:solid;outline-offset:-0.2rem;outline-width:0.2rem}.mg-input.mg-input--is-input-group-append.mg-input--readonly slot[name=append-input]{display:none}.mg-input.mg-input--label-on-top .mg-input__box{width:auto;max-width:100%}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]){--mg-button-border-radius-top-right:0;--mg-button-border-radius-bottom-right:0}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:not(:last-of-type)){--mg-button-border-right-width:0}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:last-of-type){--mg-button-border-radius-top-right:var(--mg-inputs-border-radius);--mg-button-border-radius-bottom-right:var(--mg-inputs-border-radius)}.mg-input.mg-input--is-append-input-slot-content:not(.mg-input--readonly) ::slotted([slot=append-input]){padding-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input.mg-input--width-full:not(.mg-input--label-on-top){justify-content:space-between}.mg-input.mg-input--width-full .mg-input__input-container{flex:auto;width:100%}.mg-input.mg-input--width-full .mg-input__input-container .mg-input__box{width:100%}.mg-input.mg-input--width-16 .mg-input__box{width:21rem}.mg-input.mg-input--width-4 .mg-input__box{width:7rem}.mg-input.mg-input--width-2 .mg-input__box{width:5rem}.mg-input mg-character-left{opacity:0.6;font-size:1.1rem}.mg-input.mg-input--has-display-character-left .mg-input__input+.mg-input__help-text,.mg-input.mg-input--has-display-character-left .mg-input__input+.mg-input__error{margin-top:0}.sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}.mg-input .mg-input__box{display:block;height:auto;resize:none}.mg-input .mg-input__box.mg-input__box--resizable{resize:both}.mg-input .mg-input__box.mg-input__box--resizable-horizontal{resize:horizontal}.mg-input .mg-input__box.mg-input__box--resizable-vertical{resize:vertical}.mg-input__with-character-left{width:100%}.mg-input__with-character-left mg-character-left{display:block;visibility:hidden;margin-top:0.2rem;text-align:end}.mg-input.is-focused .mg-input__with-character-left mg-character-left{visibility:visible}@-moz-document url-prefix(){.mg-input__box{overflow-x:hidden}}";
2205
+
2206
+ const MgInputTextarea = class {
2207
+ constructor(hostRef) {
2208
+ registerInstance(this, hostRef);
2209
+ this.valueChange = createEvent(this, "value-change", 7);
2210
+ this.inputValid = createEvent(this, "input-valid", 7);
2211
+ /************
2212
+ * Internal *
2213
+ ************/
2214
+ // classes
2215
+ this.classFocus = 'is-focused';
2216
+ this.classHasDisplayCharacterLeft = 'mg-input--has-display-character-left';
2217
+ // hasError (triggered by blur event)
2218
+ this.hasError = false;
2219
+ /**
2220
+ * Identifier is used for the element ID (id is a reserved prop in Stencil.js)
2221
+ * If not set, it will be created.
2222
+ */
2223
+ this.identifier = createID('mg-input-textarea');
2224
+ /**
2225
+ * Input name
2226
+ * If not set the value equals the identifier
2227
+ */
2228
+ this.name = this.identifier;
2229
+ /**
2230
+ * Define if label is visible
2231
+ */
2232
+ this.labelHide = false;
2233
+ /**
2234
+ * Input max length
2235
+ */
2236
+ this.maxlength = 4000;
2237
+ /**
2238
+ * Define if input is required
2239
+ */
2240
+ this.required = false;
2241
+ /**
2242
+ * Define if input is readonly
2243
+ */
2244
+ this.readonly = false;
2245
+ /**
2246
+ * Define if input is disabled
2247
+ */
2248
+ this.disabled = false;
2249
+ /**
2250
+ * Define input width
2251
+ */
2252
+ this.mgWidth = 'full';
2253
+ /**
2254
+ * Define the number of visible text lines for the control
2255
+ */
2256
+ this.rows = 3;
2257
+ /**
2258
+ * Define if component should display character left
2259
+ */
2260
+ this.displayCharacterLeft = true;
2261
+ /**
2262
+ * Define if input is resizable
2263
+ */
2264
+ this.resizable = 'none';
2265
+ /**
2266
+ * Component classes
2267
+ */
2268
+ this.classList = new ClassList(['mg-input--textarea']);
2269
+ /**
2270
+ * Handle input event
2271
+ */
2272
+ this.handleInput = () => {
2273
+ if (this.hasError) {
2274
+ this.checkValidity();
2275
+ this.checkError();
2276
+ }
2277
+ this.value = this.input.value;
2278
+ };
2279
+ /**
2280
+ * Handle focus event
2281
+ */
2282
+ this.handleFocus = () => {
2283
+ this.classList.add(this.classFocus);
2284
+ this.classList = new ClassList(this.classList.classes);
2285
+ };
2286
+ /**
2287
+ * Handle blur event
2288
+ */
2289
+ this.handleBlur = () => {
2290
+ // Manage focus
2291
+ this.classList.delete(this.classFocus);
2292
+ this.classList = new ClassList(this.classList.classes);
2293
+ // Display Error
2294
+ this.displayError();
2295
+ };
2296
+ /**
2297
+ * Get pattern validity
2298
+ * Pattern is not defined on textarea field : https://developer.mozilla.org/fr/docs/Web/HTML/Element/Textarea
2299
+ *
2300
+ * @returns {boolean} is pattern valid
2301
+ */
2302
+ this.getPatternValidity = () => this.pattern === undefined || new RegExp(`^${this.pattern}$`, 'u').test(this.value);
2303
+ /**
2304
+ * Check if input is valid
2305
+ */
2306
+ this.checkValidity = () => {
2307
+ if (!this.readonly && this.input !== undefined) {
2308
+ const validity = this.input.checkValidity && this.input.checkValidity() && this.getPatternValidity();
2309
+ // Set validity
2310
+ this.valid = validity;
2311
+ this.invalid = !validity;
2312
+ //Send event
2313
+ this.inputValid.emit(validity);
2314
+ }
2315
+ };
2316
+ /**
2317
+ * Check input errors
2318
+ */
2319
+ this.checkError = () => {
2320
+ // Set error message
2321
+ this.errorMessage = undefined;
2322
+ // Does not match pattern
2323
+ if (!this.valid && !this.getPatternValidity()) {
2324
+ this.errorMessage = this.patternErrorMessage;
2325
+ }
2326
+ // required
2327
+ else if (!this.valid && this.input.validity.valueMissing) {
2328
+ this.errorMessage = this.messages.errors.required;
2329
+ }
2330
+ };
2331
+ /**
2332
+ * Validate pattern configuration
2333
+ */
2334
+ this.validatePattern = () => {
2335
+ if (this.pattern &&
2336
+ typeof this.pattern === 'string' &&
2337
+ this.pattern !== '' &&
2338
+ (this.patternErrorMessage === undefined || typeof this.patternErrorMessage !== 'string' || this.patternErrorMessage === '')) {
2339
+ throw new Error('<mg-input-textarea> prop "pattern" must be paired with the prop "patternErrorMessage"');
2340
+ }
2341
+ };
2342
+ }
2343
+ handleValue(newValue) {
2344
+ this.checkValidity();
2345
+ this.valueChange.emit(newValue);
2346
+ }
2347
+ validateDisplayCharacterLeft(newValue) {
2348
+ if (newValue) {
2349
+ this.classList.add(this.classHasDisplayCharacterLeft);
2350
+ }
2351
+ else {
2352
+ this.classList.delete(this.classHasDisplayCharacterLeft);
2353
+ }
2354
+ }
2355
+ /**
2356
+ * Public method to display errors
2357
+ *
2358
+ * @returns {Promise<void>}
2359
+ */
2360
+ async displayError() {
2361
+ this.checkValidity();
2362
+ this.checkError();
2363
+ this.hasError = this.invalid;
2364
+ }
2365
+ /*************
2366
+ * Lifecycle *
2367
+ *************/
2368
+ /**
2369
+ * Check if component props are well configured on init
2370
+ *
2371
+ * @returns {ReturnType<typeof setTimeout>} timeout
2372
+ */
2373
+ componentWillLoad() {
2374
+ // Get locales
2375
+ this.messages = initLocales(this.element).messages;
2376
+ this.characterLeftId = `${this.identifier}-character-left`;
2377
+ // Validate
2378
+ this.validateDisplayCharacterLeft(this.displayCharacterLeft);
2379
+ this.validatePattern();
2380
+ // Check validity when component is ready
2381
+ // return a promise to process action only in the FIRST render().
2382
+ // https://stenciljs.com/docs/component-lifecycle#componentwillload
2383
+ return setTimeout(() => {
2384
+ this.checkValidity();
2385
+ }, 0);
2386
+ }
2387
+ /**
2388
+ * Render
2389
+ *
2390
+ * @returns {HTMLElement} HTML Element
2391
+ */
2392
+ render() {
2393
+ return (h(MgInput, { identifier: this.identifier, classList: this.classList, ariaDescribedbyIDs: [this.characterLeftId], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, readonly: this.readonly, mgWidth: this.mgWidth, disabled: this.disabled, value: this.value, readonlyValue: undefined, tooltip: this.tooltip, helpText: this.helpText, errorMessage: this.errorMessage, isFieldset: false }, h("div", { class: "mg-input__with-character-left" }, h("textarea", { class: {
2394
+ 'mg-input__box': true,
2395
+ 'mg-input__box--resizable': this.resizable === 'both',
2396
+ 'mg-input__box--resizable-horizontal': this.resizable === 'horizontal',
2397
+ 'mg-input__box--resizable-vertical': this.resizable === 'vertical',
2398
+ }, value: this.value, id: this.identifier, name: this.name, placeholder: this.placeholder, title: this.placeholder, rows: this.rows, maxlength: this.maxlength, disabled: this.disabled, required: this.required, onInput: this.handleInput, onFocus: this.handleFocus, onBlur: this.handleBlur, ref: el => (this.input = el) }), this.displayCharacterLeft && this.maxlength && (h("mg-character-left", { identifier: this.characterLeftId, characters: this.value, maxlength: this.maxlength })))));
2399
+ }
2400
+ get element() { return getElement(this); }
2401
+ static get watchers() { return {
2402
+ "value": ["handleValue"],
2403
+ "displayCharacterLeft": ["validateDisplayCharacterLeft"]
2404
+ }; }
2405
+ };
2406
+ MgInputTextarea.style = mgInputTextareaCss;
2407
+
2408
+ const mgInputTitleCss = ".is-asterisk.sc-mg-input-title{color:hsl(var(--color-danger))}legend.mg-input-title.sc-mg-input-title{padding-left:0;padding-right:0}.mg-input-title__required.sc-mg-input-title{display:var(--mg-input-title-display, unset)}";
2409
+
2410
+ const MgInputTitle = class {
2411
+ constructor(hostRef) {
2412
+ registerInstance(this, hostRef);
2413
+ /**
2414
+ * Switch from label to fieldset sementic
2415
+ */
2416
+ this.isLegend = false;
2417
+ /**
2418
+ * Component parent tagname
2419
+ */
2420
+ this.tagName = 'label';
2421
+ this.getTagName = () => {
2422
+ this.tagName = this.isLegend ? 'legend' : 'label';
2423
+ };
2424
+ }
2425
+ /*************
2426
+ * Lifecycle *
2427
+ *************/
2428
+ /**
2429
+ * Init tag name
2430
+ *
2431
+ * @returns {void}
2432
+ */
2433
+ componentWillLoad() {
2434
+ this.getTagName();
2435
+ }
2436
+ /**
2437
+ * Render
2438
+ *
2439
+ * @returns {HTMLElement} HTML Element
2440
+ */
2441
+ render() {
2442
+ const TagName = this.tagName;
2443
+ // \u00A0 represent a &nbsp;
2444
+ return (h(TagName, { class: "mg-input-title", htmlFor: this.isLegend ? undefined : this.identifier }, h("slot", null), this.required && (h("span", { class: "mg-input-title__required" }, "\u00A0", h("span", { class: "is-asterisk" }, "*")))));
2445
+ }
2446
+ };
2447
+ MgInputTitle.style = mgInputTitleCss;
2448
+
2449
+ const mgInputToggleCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container mg-icon{display:flex}.mg-input__input-container .mg-input__help-text,.mg-input__input-container .mg-input__error{text-align:start;font-size:1.2rem}.mg-input__input{display:flex;}.mg-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input__input.mg-input__input--has-error .mg-input__box{border-color:hsl(var(--color-danger))}.mg-input__input+.mg-input__help-text,.mg-input__input+.mg-input__error{margin-top:0.5rem}.mg-input__error{display:inline-block;margin-top:0.2rem;padding:0.3rem 0.8rem;border-radius:0.3rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}.mg-input.mg-input.mg-input--toggle .mg-input__input-container{flex:auto;min-width:0}.mg-input__button-toggle{display:flex;padding:0.2rem;min-width:0;background-color:hsl(var(--color-light));border-width:var(--mg-inputs-border-width);border-style:solid;border-color:var(--mg-inputs-color);border-radius:calc((var(--font-size) * var(--line-height) + 2 * (0.7rem + var(--mg-inputs-border-width))) / var(--mg-input-toggle-border-radius-ratio));font-size:inherit;line-height:inherit;cursor:pointer}.mg-input__button-toggle:disabled{cursor:default}.mg-input__toggle-item-container{padding:0.5rem 0.9rem;border:0;box-sizing:border-box;border-radius:calc((var(--font-size) * var(--line-height) + 1rem) / var(--mg-input-toggle-border-radius-ratio));background-color:unset;font-weight:unset;color:hsl(var(--color-dark));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mg-input__toggle-item-container:first-of-type{font-weight:600;color:hsl(var(--color-info));background-color:hsl(var(--color-info-h), calc(var(--color-info-s) - 64%), calc(var(--color-info-l) + 55%))}.mg-input.mg-input--toggle-is-active .mg-input__toggle-item-container:first-of-type{background-color:unset;font-weight:unset;color:hsl(var(--color-dark))}.mg-input.mg-input--toggle-is-active .mg-input__toggle-item-container:last-of-type{font-weight:600;color:hsl(var(--color-info));background-color:hsl(var(--color-info-h), calc(var(--color-info-s) - 64%), calc(var(--color-info-l) + 55%))}.mg-input.mg-input--toggle-icon .mg-input__toggle-item-container{display:flex;justify-content:center;align-items:center;width:calc(var(--font-size) * var(--line-height) + 1rem);height:calc(var(--font-size) * var(--line-height) + 1rem);padding:0;visibility:hidden}.mg-input.mg-input--toggle-icon .mg-input__toggle-item-container:first-of-type{visibility:visible}.mg-input.mg-input--toggle-icon .mg-input__toggle-item-container ::slotted(mg-icon){display:flex}.mg-input.mg-input--toggle-icon.mg-input--toggle-is-active .mg-input__toggle-item-container:first-of-type{visibility:hidden}.mg-input.mg-input--toggle-icon.mg-input--toggle-is-active .mg-input__toggle-item-container:last-of-type{visibility:visible}.mg-input.mg-input--toggle-on-off .mg-input__toggle-item-container:first-of-type{font-weight:600;color:hsl(var(--color-dark));background-color:hsl(var(--color-dark-h), calc(var(--color-dark-s) - 30%), calc(var(--color-dark-l) + 75%))}.mg-input.mg-input--toggle-on-off.mg-input--toggle-is-active .mg-input__toggle-item-container:first-of-type{background-color:unset;font-weight:unset;color:hsl(var(--color-dark))}.mg-input.mg-input--toggle-readonly .mg-input__button-toggle{border-color:transparent;background-color:transparent;cursor:initial}.mg-input.mg-input--toggle-readonly .mg-input__toggle-item-container:last-of-type{display:none}.mg-input.mg-input--toggle-readonly.mg-input--toggle-is-active .mg-input__toggle-item-container:first-of-type{display:none}.mg-input.mg-input--toggle-readonly.mg-input--toggle-is-active .mg-input__toggle-item-container:last-of-type{display:flex}.mg-input.mg-input--toggle-disabled .mg-input__button-toggle{opacity:0.3}";
2450
+
2451
+ /**
2452
+ * type Option validation function
2453
+ *
2454
+ * @param {ToggleValue} option radio option
2455
+ * @returns {boolean} toggle option type is valid
2456
+ */
2457
+ const isOption = (option) => typeof option === 'object' && typeof option.title === 'string' && option.value !== undefined;
2458
+ const MgInputToggle = class {
2459
+ constructor(hostRef) {
2460
+ registerInstance(this, hostRef);
2461
+ this.valueChange = createEvent(this, "value-change", 7);
2462
+ this.inputValid = createEvent(this, "input-valid", 7);
2463
+ /************
2464
+ * Internal *
2465
+ ************/
2466
+ // classes
2467
+ this.classReadonly = 'mg-input--toggle-readonly';
2468
+ this.classDisabled = 'mg-input--toggle-disabled';
2469
+ this.classIsActive = 'mg-input--toggle-is-active';
2470
+ this.classOnOff = 'mg-input--toggle-on-off';
2471
+ this.classIcon = 'mg-input--toggle-icon';
2472
+ /**
2473
+ * Identifier is used for the element ID (id is a reserved prop in Stencil.js)
2474
+ * If not set, it will be created.
2475
+ */
2476
+ this.identifier = createID('mg-input-toggle');
2477
+ /**
2478
+ * Input name
2479
+ * If not set the value equals the identifier
2480
+ */
2481
+ this.name = this.identifier;
2482
+ /**
2483
+ * Define if label is visible
2484
+ */
2485
+ this.labelHide = false;
2486
+ /**
2487
+ * Define if toggle have on/off style
2488
+ */
2489
+ this.isOnOff = false;
2490
+ /**
2491
+ * Define if toggle display icon
2492
+ */
2493
+ this.isIcon = false;
2494
+ /**
2495
+ * Define if input is readonly
2496
+ */
2497
+ this.readonly = false;
2498
+ /**
2499
+ * Define if input is disabled
2500
+ */
2501
+ this.disabled = false;
2502
+ /**
2503
+ * Component classes
2504
+ */
2505
+ this.classList = new ClassList(['mg-input--toggle']);
2506
+ /**
2507
+ * Checked internal value
2508
+ */
2509
+ this.checked = false;
2510
+ /**
2511
+ * Change checked value
2512
+ *
2513
+ * @returns {void}
2514
+ */
2515
+ this.toggleChecked = () => {
2516
+ this.checked = !this.checked;
2517
+ };
2518
+ /**
2519
+ * Slots validation
2520
+ *
2521
+ * @returns {void}
2522
+ */
2523
+ this.validateSlots = () => {
2524
+ const slots = Array.from(this.element.children);
2525
+ if (slots.length !== 2) {
2526
+ throw new Error('<mg-input-toggle> 2 slots are required.');
2527
+ }
2528
+ else if (!this.isIcon) {
2529
+ // Due to text-overflow set to ellipsis
2530
+ // we need to ensure that slot element have title to display value on mouse over
2531
+ slots.forEach(slot => slot.setAttribute('title', slot.textContent));
2532
+ }
2533
+ };
2534
+ }
2535
+ handleValue(newValue) {
2536
+ // Swich to the right option
2537
+ this.setChecked();
2538
+ // Emit value-change event
2539
+ this.valueChange.emit(newValue);
2540
+ }
2541
+ validateItems(newValue) {
2542
+ if (typeof newValue === 'object' && this.items.length !== 2) {
2543
+ throw new Error('<mg-input-toggle> prop "items" require 2 items.');
2544
+ }
2545
+ // String array
2546
+ else if (allItemsAreString(newValue)) {
2547
+ this.options = newValue.map(item => ({ title: item, value: item }));
2548
+ }
2549
+ // Object array
2550
+ else if (newValue && newValue.every(item => isOption(item))) {
2551
+ this.options = newValue;
2552
+ }
2553
+ else {
2554
+ throw new Error('<mg-input-toggle> prop "items" is required and all items must be the same type: ToggleValue.');
2555
+ }
2556
+ }
2557
+ handleIsOnOff(newValue) {
2558
+ if (newValue)
2559
+ this.classList.add(this.classOnOff);
2560
+ else
2561
+ this.classList.delete(this.classOnOff);
2562
+ }
2563
+ handleIsIcon(newValue) {
2564
+ if (newValue)
2565
+ this.classList.add(this.classIcon);
2566
+ else
2567
+ this.classList.delete(this.classIcon);
2568
+ }
2569
+ handleReadonly(newValue) {
2570
+ if (newValue)
2571
+ this.classList.add(this.classReadonly);
2572
+ else
2573
+ this.classList.delete(this.classReadonly);
2574
+ }
2575
+ handleDisabled(newValue) {
2576
+ if (newValue)
2577
+ this.classList.add(this.classDisabled);
2578
+ else
2579
+ this.classList.delete(this.classDisabled);
2580
+ }
2581
+ handleChecked(newValue) {
2582
+ // style
2583
+ if (newValue)
2584
+ this.classList.add(this.classIsActive);
2585
+ else
2586
+ this.classList.delete(this.classIsActive);
2587
+ // update value
2588
+ this.value = this.options[newValue ? 1 : 0].value;
2589
+ }
2590
+ /**
2591
+ * set checked state
2592
+ *
2593
+ * @returns {void}
2594
+ */
2595
+ setChecked() {
2596
+ // has "value" props type is not a boolean, it is bind/render as an attributes/props
2597
+ // true props will be represent by "true" string so we convert it has boolean
2598
+ // true attribute will be represent by "" string so we convert it has boolean
2599
+ // https://stenciljs.com/docs/properties
2600
+ if (['', 'true'].includes(this.value) && this.options.find(option => option.value) !== undefined) {
2601
+ this.value = true;
2602
+ }
2603
+ this.checked = this.value === this.options[1].value;
2604
+ }
2605
+ /*************
2606
+ * Lifecycle *
2607
+ *************/
2608
+ /**
2609
+ * Check if component props are well configured on init
2610
+ */
2611
+ componentWillLoad() {
2612
+ // Check items format
2613
+ this.validateItems(this.items);
2614
+ // Check slots
2615
+ this.validateSlots();
2616
+ // init checked value
2617
+ this.setChecked();
2618
+ // apply handler
2619
+ this.handleIsOnOff(this.isOnOff);
2620
+ this.handleIsIcon(this.isIcon);
2621
+ this.handleReadonly(this.readonly);
2622
+ this.handleDisabled(this.disabled);
2623
+ }
2624
+ /**
2625
+ * Render
2626
+ *
2627
+ * @returns {HTMLElement} HTML Element
2628
+ */
2629
+ render() {
2630
+ return (h(MgInput, { identifier: this.identifier, classList: this.classList, ariaDescribedbyIDs: [], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: undefined, readonly: undefined, mgWidth: undefined, disabled: this.disabled, value: this.value, readonlyValue: undefined, tooltip: !this.readonly && this.tooltip, helpText: this.helpText, errorMessage: undefined, isFieldset: false }, h("button", { type: "button", role: "switch", "aria-checked": this.checked.toString(), "aria-readonly": this.disabled || this.readonly, id: this.identifier, class: "mg-input__button-toggle", disabled: this.disabled || this.readonly, onClick: this.toggleChecked }, h("span", { "aria-hidden": "true", class: "mg-input__toggle-item-container" }, h("slot", { name: "item-1" })), h("span", { "aria-hidden": "true", class: "mg-input__toggle-item-container" }, h("slot", { name: "item-2" })))));
2631
+ }
2632
+ get element() { return getElement(this); }
2633
+ static get watchers() { return {
2634
+ "value": ["handleValue"],
2635
+ "items": ["validateItems"],
2636
+ "isOnOff": ["handleIsOnOff"],
2637
+ "isIcon": ["handleIsIcon"],
2638
+ "readonly": ["handleReadonly"],
2639
+ "disabled": ["handleDisabled"],
2640
+ "checked": ["handleChecked"]
2641
+ }; }
2642
+ };
2643
+ MgInputToggle.style = mgInputToggleCss;
2644
+
2645
+ /**
2646
+ * List of all possibles message variants
2647
+ */
2648
+ const variants$1 = ['info', 'warning', 'success', 'danger'];
2649
+
2650
+ const mgMessageCss = ".mg-message{display:inline-block;position:relative;box-sizing:border-box;min-height:var(--default-size);overflow:hidden;background-color:white;border-radius:var(--mg-message-border-radius);box-shadow:var(--box-shadow)}.mg-message::before{content:\"\";position:absolute;top:0;left:0;width:0.3rem;height:100%}.mg-message.mg-message--info::before{background-color:hsl(var(--color-info))}.mg-message.mg-message--info .mg-message__icon{color:hsl(var(--color-info))}.mg-message.mg-message--warning::before{background-color:hsl(var(--color-warning))}.mg-message.mg-message--warning .mg-message__icon{color:hsl(var(--color-warning))}.mg-message.mg-message--success::before{background-color:hsl(var(--color-success))}.mg-message.mg-message--success .mg-message__icon{color:hsl(var(--color-success))}.mg-message.mg-message--danger::before{background-color:hsl(var(--color-danger))}.mg-message.mg-message--danger .mg-message__icon{color:hsl(var(--color-danger))}.mg-message.mg-message--close-button{padding-right:3.4rem}.mg-message.mg-message--hide{display:none}.mg-message ::slotted(*){margin:0;padding:0}.mg-message__icon{position:absolute;top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2);left:1.3rem;line-height:1}.mg-message__content{display:flex;flex-wrap:wrap;justify-content:flex-end;align-content:stretch;padding:0 1rem 0 3.8rem}.mg-message__content-slot{flex-grow:1;margin:0.84rem 0}.mg-message__content-separator{display:inline-block;width:4.5rem;height:0}.mg-message__content-actions-slot{padding:1rem 0;text-align:right}.mg-message__close-button{position:absolute;top:0;right:0}.mg-message,mg-message{max-width:100%}";
2651
+
2652
+ const MgMessage = class {
2653
+ constructor(hostRef) {
2654
+ registerInstance(this, hostRef);
2655
+ this.componentShow = createEvent(this, "component-show", 7);
2656
+ this.componentHide = createEvent(this, "component-hide", 7);
2657
+ /************
2658
+ * Internal *
2659
+ ************/
2660
+ // classes
2661
+ this.classHide = 'mg-message--hide';
2662
+ // IDs
2663
+ this.closeButtonId = '';
2664
+ // Stored timer setted when hide action is run from setTimeOut
2665
+ this.storedTimer = null;
2666
+ /**
2667
+ * Identifier is used for the element ID (id is a reserved prop in Stencil.js)
2668
+ * If not set, it will be created.
2669
+ */
2670
+ this.identifier = createID('mg-message');
2671
+ /**
2672
+ * Message variant
2673
+ */
2674
+ this.variant = variants$1[0]; // info
2675
+ /**
2676
+ * Define if message has a cross button
2677
+ * RG 01: https://jira.mgdis.fr/browse/PDA9-140
2678
+ */
2679
+ this.closeButton = false;
2680
+ /**
2681
+ * Define if message is hidden
2682
+ */
2683
+ this.hide = false;
2684
+ /**
2685
+ * Component classes
2686
+ */
2687
+ this.classList = new ClassList(['mg-message']);
2688
+ /**
2689
+ * Define if component is using actions slot
2690
+ */
2691
+ this.hasActions = false;
2692
+ /**
2693
+ * Handle close button
2694
+ */
2695
+ this.handleClose = () => {
2696
+ this.hide = true;
2697
+ };
2698
+ /**
2699
+ * Hide component whith delay
2700
+ */
2701
+ this.hideWithDelay = () => {
2702
+ if (this.delay > 0 && this.hide !== true) {
2703
+ this.storedTimer = setTimeout(() => (this.hide = true), this.delay * 1000);
2704
+ }
2705
+ else if (this.storedTimer !== null) {
2706
+ clearTimeout(this.storedTimer);
2707
+ }
2708
+ };
2709
+ /**
2710
+ * Get icon corresponding to variant
2711
+ *
2712
+ * @returns {string} icon
2713
+ */
2714
+ this.getIcon = () => {
2715
+ switch (this.variant) {
2716
+ case 'info':
2717
+ return 'info-circle';
2718
+ case 'warning':
2719
+ return 'exclamation-triangle';
2720
+ case 'success':
2721
+ return 'check-circle';
2722
+ case 'danger':
2723
+ return 'exclamation-circle';
2724
+ }
2725
+ };
2726
+ }
2727
+ validateDelay(newValue) {
2728
+ if (newValue && newValue < 2) {
2729
+ throw new Error(`<mg-message> prop "delay" must be greater than 2 seconds.`);
2730
+ }
2731
+ }
2732
+ validateVariant(newValue, oldValue) {
2733
+ if (!variants$1.includes(newValue)) {
2734
+ throw new Error(`<mg-message> prop "variant" must be one of : ${variants$1.join(', ')}`);
2735
+ }
2736
+ else {
2737
+ if (oldValue !== undefined) {
2738
+ this.classList.delete(`mg-message--${oldValue}`);
2739
+ }
2740
+ this.classList.add(`mg-message--${newValue}`);
2741
+ }
2742
+ }
2743
+ validateCloseButton(newValue) {
2744
+ if (newValue && this.hasActions) {
2745
+ this.closeButton = false;
2746
+ throw new Error('<mg-message> prop "close-button" can\'t be used with the actions slot.');
2747
+ }
2748
+ }
2749
+ validateHide(newValue) {
2750
+ if (newValue) {
2751
+ this.componentHide.emit();
2752
+ this.classList.add(this.classHide);
2753
+ }
2754
+ else {
2755
+ this.componentShow.emit();
2756
+ this.classList.delete(this.classHide);
2757
+ }
2758
+ this.hideWithDelay();
2759
+ }
2760
+ /*************
2761
+ * Lifecycle *
2762
+ *************/
2763
+ /**
2764
+ * Check if component props are well configured on init
2765
+ */
2766
+ componentWillLoad() {
2767
+ // Get locales
2768
+ this.messages = initLocales(this.element).messages;
2769
+ // Validate
2770
+ this.validateVariant(this.variant);
2771
+ // Check if close button is an can be activated
2772
+ this.hasActions = this.element.querySelector('[slot="actions"]') !== null;
2773
+ this.validateCloseButton(this.closeButton);
2774
+ if (this.closeButton) {
2775
+ this.classList.add('mg-message--close-button');
2776
+ this.closeButtonId = `${this.identifier}-close-button`;
2777
+ }
2778
+ this.validateDelay(this.delay);
2779
+ this.validateHide(this.hide);
2780
+ }
2781
+ /**
2782
+ * Render
2783
+ *
2784
+ * @returns {HTMLElement} HTML Element
2785
+ */
2786
+ render() {
2787
+ return (h("div", { id: this.identifier, class: this.classList.join(), role: this.variant === 'info' ? 'status' : 'alert' }, h("span", { class: "mg-message__icon" }, h("mg-icon", { icon: this.getIcon() })), h("div", { class: "mg-message__content" }, h("span", { class: "mg-message__content-slot" }, h("slot", null)), this.hasActions && h("span", { class: "mg-message__content-separator" }), this.hasActions && (h("span", { class: "mg-message__content-actions-slot" }, h("slot", { name: "actions" })))), this.closeButton && (h("span", { class: "mg-message__close-button" }, h("mg-button", { identifier: this.closeButtonId, "is-icon": true, variant: "flat", label: this.messages.message.closeButton, onClick: this.handleClose }, h("mg-icon", { icon: "cross" }))))));
2788
+ }
2789
+ get element() { return getElement(this); }
2790
+ static get watchers() { return {
2791
+ "delay": ["validateDelay"],
2792
+ "variant": ["validateVariant"],
2793
+ "closeButton": ["validateCloseButton"],
2794
+ "hide": ["validateHide"]
2795
+ }; }
2796
+ };
2797
+ MgMessage.style = mgMessageCss;
2798
+
2799
+ var NavigationAction;
2800
+ (function (NavigationAction) {
2801
+ NavigationAction["NEXT"] = "next";
2802
+ NavigationAction["PREVIOUS"] = "previous";
2803
+ })(NavigationAction || (NavigationAction = {}));
2804
+
2805
+ const mgPaginationCss = ".sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}.mg-pagination__nav{display:flex;align-items:center;flex-direction:row}.mg-pagination__nav mg-input-select{margin-right:0.5rem}.mg-pagination__button{display:flex}.mg-pagination__button:first-of-type{margin-right:1rem}.mg-pagination__button:last-of-type{margin-left:1rem}";
2806
+
2807
+ /**
2808
+ * Range generator
2809
+ *
2810
+ * start by get the range length, add "+ 1" to include last value, ex: Math.ceil((3 + 1 - 1) / 1) => 3
2811
+ * then with Array(Math.ceil...) we get the final array with empty values, ex: Array(Math.ceil(2 + 1 - 1) / 1)) => [empty, empty, empty]
2812
+ * then with Array(Math.ceil...).keys() we get the Array Iterator from empty values
2813
+ * then with Array.from(Array(...)) we get the complete array with "index" values instead of "empty" values
2814
+ * ex: Array.from(Array(Math.ceil((2 + 1 - 1) / 1) || 1).keys()) => [0, 1, 2]
2815
+ * finaly we map values from "start" range and apply the "step" coefficiant,
2816
+ * ex: Array.from(Array(Math.ceil((2 + 1 - 1) / 1) || 1).keys()).map(x => 1 + x * 1) => [1, 2, 3]
2817
+ *
2818
+ * range(1, 1) = [1]
2819
+ * range(1, 5) = [1, 2, 3, 4, 5]
2820
+ * range(10, 20, 2) = [10, 12, 14, 16, 18, 20]
2821
+ *
2822
+ * @param {number} start start range
2823
+ * @param {number} end start end
2824
+ * @param {number} step step size
2825
+ * @returns {number[]} range numbers
2826
+ */
2827
+ const range = (start, end, step = 1) => Array.from(Array(Math.ceil((end + 1 - start) / step)).keys()).map(x => start + x * step);
2828
+ const MgPagination = class {
2829
+ constructor(hostRef) {
2830
+ registerInstance(this, hostRef);
2831
+ this.currentPageChange = createEvent(this, "current-page-change", 7);
2832
+ /**
2833
+ * Identifier is used for the element ID (id is a reserved prop in Stencil.js)
2834
+ * If not set, it will be created.
2835
+ */
2836
+ this.identifier = createID('mg-pagination');
2837
+ /**
2838
+ * Component total pages
2839
+ */
2840
+ this.totalPages = 1;
2841
+ /**
2842
+ * Component current page
2843
+ */
2844
+ this.currentPage = 1;
2845
+ /**
2846
+ * Change current page from target
2847
+ *
2848
+ * @param {number} target target page
2849
+ * @returns {void}
2850
+ */
2851
+ this.goToPage = (target) => {
2852
+ this.currentPage = target;
2853
+ };
2854
+ /************
2855
+ * Handlers *
2856
+ ************/
2857
+ /**
2858
+ * select handler
2859
+ *
2860
+ * @param {InputEvent} event value change event
2861
+ * @returns {void}
2862
+ */
2863
+ this.handleSelect = (event) => {
2864
+ const to = Number(event.target.value);
2865
+ this.goToPage(to > 0 ? to : 1);
2866
+ };
2867
+ /**
2868
+ * Go to 'previous/next' page button handler
2869
+ *
2870
+ * @param {string} action navigation action
2871
+ * @returns {void}
2872
+ */
2873
+ this.handleGoToPage = (action) => {
2874
+ this.goToPage(action === NavigationAction.NEXT ? this.currentPage + 1 : this.currentPage - 1);
2875
+ };
2876
+ }
2877
+ validateTotalPages(newValue) {
2878
+ if (newValue < 1) {
2879
+ throw new Error('<mg-pagination> prop "totalPages" must be greater than 0');
2880
+ }
2881
+ }
2882
+ validateCurrentPage(newValue) {
2883
+ if (newValue < 1) {
2884
+ throw new Error('<mg-pagination> prop "currentPage" must be greater than 0');
2885
+ }
2886
+ else if (newValue > this.totalPages) {
2887
+ throw new Error('<mg-pagination> prop "currentPage" can not be greater than total page');
2888
+ }
2889
+ this.currentPageChange.emit(newValue);
2890
+ }
2891
+ /*************
2892
+ * Lifecycle *
2893
+ *************/
2894
+ /**
2895
+ * Check if props are well configured on init
2896
+ *
2897
+ * @returns {void}
2898
+ */
2899
+ componentWillLoad() {
2900
+ // Get locales
2901
+ this.messages = initLocales(this.element).messages;
2902
+ // Validate
2903
+ this.validateTotalPages(this.totalPages);
2904
+ this.validateCurrentPage(this.currentPage);
2905
+ // Set default label
2906
+ if (this.label === undefined || this.label === '') {
2907
+ this.label = this.messages.pagination.label;
2908
+ }
2909
+ }
2910
+ /**
2911
+ * Render
2912
+ *
2913
+ * @returns {HTMLElement} HTML Element
2914
+ */
2915
+ render() {
2916
+ const navigationActionButton = (disabled, action) => (h("mg-button", { identifier: `${this.identifier}-button-${action}`, class: "mg-pagination__button", label: this.messages.pagination[`${action}Page`],
2917
+ // eslint-disable-next-line react/jsx-no-bind
2918
+ onClick: () => this.handleGoToPage(action), disabled: disabled, variant: "flat" }, action === NavigationAction.PREVIOUS && h("mg-icon", { icon: "chevron-left" }), this.messages.general[action], action === NavigationAction.NEXT && h("mg-icon", { icon: "chevron-right" })));
2919
+ return (h("nav", { "aria-label": this.label, id: this.identifier, class: "mg-pagination__nav" }, navigationActionButton(this.currentPage <= 1, NavigationAction.PREVIOUS), h("mg-input-select", { identifier: `${this.identifier}-select`, items: range(1, this.totalPages).map(page => page.toString()), label: this.messages.pagination.selectPage, "label-hide": true, "on-value-change": this.handleSelect, value: this.currentPage.toString(), "placeholder-hide": true }), h("span", { class: "sr-only" }, this.messages.pagination.page, " ", this.currentPage), h("span", null, "/ ", this.totalPages, " ", this.totalPages > 1 ? this.messages.pagination.pages : this.messages.pagination.page), navigationActionButton(this.currentPage >= this.totalPages, NavigationAction.NEXT)));
2920
+ }
2921
+ get element() { return getElement(this); }
2922
+ static get watchers() { return {
2923
+ "totalPages": ["validateTotalPages"],
2924
+ "currentPage": ["validateCurrentPage"]
2925
+ }; }
2926
+ };
2927
+ MgPagination.style = mgPaginationCss;
2928
+
2929
+ const mgPanelCss = ".mg-panel{background-color:hsl(var(--mg-panel-background));border-radius:var(--mg-panel-border-radius);box-shadow:var(--box-shadow)}.mg-panel__header{display:flex;flex-wrap:wrap;justify-content:space-between;padding:0 1rem 0 0.3rem;align-items:flex-start}.mg-panel__header-left,.mg-panel__header-right{display:flex;margin:0.3rem 0}.mg-panel__header-left--full{flex:1 1 auto}.mg-panel__header-right{flex:1 auto}.mg-panel__header-left mg-input-text{flex-grow:1}.mg-panel__collapse-button .mg-button{font-family:var(--font-family-heading);font-size:1.4rem;font-weight:500}.mg-panel__collapse-button,.mg-panel__edit-button{margin:0 0.3rem 0 0}.mg-panel__content{padding:1.5rem}.mg-panel ::slotted([slot=header-right]){display:flex;flex-wrap:wrap;gap:1rem;margin-left:auto}";
2930
+
2931
+ const MgPanel = class {
2932
+ constructor(hostRef) {
2933
+ registerInstance(this, hostRef);
2934
+ this.titleChange = createEvent(this, "title-change", 7);
2935
+ this.expandedChange = createEvent(this, "expanded-change", 7);
2936
+ /**
2937
+ * Identifier is used for the element ID (id is a reserved prop in Stencil.js)
2938
+ * If not set, it will be created.
2939
+ */
2940
+ this.identifier = createID('mg-panel');
2941
+ /**
2942
+ * Panel is opened
2943
+ */
2944
+ this.expanded = false;
2945
+ /**
2946
+ * Disable possibility to toggle expand
2947
+ */
2948
+ this.expandToggleDisabled = false;
2949
+ /**
2950
+ * Panel title is editabled
2951
+ */
2952
+ this.titleEditable = false;
2953
+ /**
2954
+ * Component classes
2955
+ */
2956
+ this.classList = new ClassList(['mg-panel']);
2957
+ /**
2958
+ * Title is in edition mode
2959
+ */
2960
+ this.isEditing = false;
2961
+ /************
2962
+ * Methods *
2963
+ ************/
2964
+ /**
2965
+ * Toggle is editing state
2966
+ *
2967
+ * @returns {void}
2968
+ */
2969
+ this.toggleIsEditing = () => {
2970
+ this.isEditing = !this.isEditing;
2971
+ };
2972
+ /************
2973
+ * Handlers *
2974
+ ************/
2975
+ /**
2976
+ * Collapse button click handler
2977
+ *
2978
+ * @returns {void}
2979
+ */
2980
+ this.handleCollapseButton = () => {
2981
+ if (!this.expandToggleDisabled) {
2982
+ this.expanded = !this.expanded;
2983
+ }
2984
+ };
2985
+ /**
2986
+ * Edit button click handler
2987
+ *
2988
+ * @returns {void}
2989
+ */
2990
+ this.handleEditButton = () => {
2991
+ this.toggleIsEditing();
2992
+ };
2993
+ /**
2994
+ * Update title handler
2995
+ *
2996
+ * @param {CustomEvent<string>} event input value change event
2997
+ * @returns {void}
2998
+ */
2999
+ this.handleUpdateTitle = (event) => {
3000
+ this.updatedPanelTitle = event.detail;
3001
+ };
3002
+ /**
3003
+ * Cancel edition button handler
3004
+ *
3005
+ * @returns {void}
3006
+ */
3007
+ this.handleCancelEditButton = () => {
3008
+ this.updatedPanelTitle = undefined;
3009
+ this.toggleIsEditing();
3010
+ };
3011
+ /**
3012
+ * Validate edition button handler
3013
+ *
3014
+ * @returns {void}
3015
+ */
3016
+ this.handleValidateEditButton = () => {
3017
+ if (this.editInputElement.valid) {
3018
+ if (this.updatedPanelTitle !== undefined)
3019
+ this.panelTitle = this.updatedPanelTitle;
3020
+ this.toggleIsEditing();
3021
+ }
3022
+ };
3023
+ /**
3024
+ * Header left conditional render
3025
+ *
3026
+ * @typedef {HTMLElement} HTMLMgButtonElement
3027
+ * @returns {HTMLMgButtonElement | HTMLElement | HTMLElement[]} header left element
3028
+ */
3029
+ this.headerLeft = () => {
3030
+ const collapseButton = () => (h("mg-button", { onClick: this.handleCollapseButton, variant: "flat", class: "mg-panel__collapse-button", identifier: `${this.identifier}-collapse-button`, expanded: this.expanded, controls: `${this.identifier}-content`, disabled: this.expandToggleDisabled }, h("mg-icon", { icon: this.expanded ? 'chevron-up' : 'chevron-down' }), !this.isEditing && this.panelTitle));
3031
+ if (this.titleEditable && !this.isEditing) {
3032
+ return [
3033
+ collapseButton(),
3034
+ h("mg-button", { "is-icon": true, variant: "flat", class: "mg-panel__edit-button", label: this.messages.panel.editLabel, onClick: this.handleEditButton, identifier: `${this.identifier}-edit-button` }, h("mg-icon", { icon: "pen" })),
3035
+ ];
3036
+ }
3037
+ if (this.titleEditable && this.isEditing) {
3038
+ return [
3039
+ collapseButton(),
3040
+ h("mg-input-text", { label: this.messages.panel.editLabel, "label-hide": true, value: this.panelTitle, "onValue-change": this.handleUpdateTitle, displayCharacterLeft: false, pattern: this.titlePattern, "pattern-error-message": this.titlePatternErrorMessage, identifier: `${this.identifier}-edition-input`, ref: el => (this.editInputElement = el) }, h("mg-button", { slot: "append-input", label: this.messages.general.cancel, "is-icon": true, variant: "secondary", onClick: this.handleCancelEditButton, identifier: `${this.identifier}-edition-button-cancel` }, h("mg-icon", { icon: "cross" })), h("mg-button", { slot: "append-input", label: this.messages.general.confirm, "is-icon": true, variant: "secondary", onClick: this.handleValidateEditButton, identifier: `${this.identifier}-edition-button-validate` }, h("mg-icon", { icon: "check" }))),
3041
+ ];
3042
+ }
3043
+ return collapseButton();
3044
+ };
3045
+ }
3046
+ handelTileChange(newValue) {
3047
+ this.titleChange.emit(newValue);
3048
+ }
3049
+ validatetitlePattern(newValue) {
3050
+ if (newValue && !this.titleEditable) {
3051
+ throw new Error('<mg-panel> prop "titleEditable" must be set to `true`.');
3052
+ }
3053
+ if (newValue && this.titlePatternErrorMessage === undefined) {
3054
+ throw new Error('<mg-panel> prop "titlePattern" must be paired with the prop "titlePatternErrorMessage".');
3055
+ }
3056
+ }
3057
+ handleExpanded(newValue) {
3058
+ this.expandedChange.emit(newValue);
3059
+ }
3060
+ /*************
3061
+ * Lifecycle *
3062
+ *************/
3063
+ /**
3064
+ * Check if props are well configured on init
3065
+ *
3066
+ * @returns {void}
3067
+ */
3068
+ componentWillLoad() {
3069
+ // Get locales
3070
+ this.messages = initLocales(this.element).messages;
3071
+ // Validate
3072
+ this.validatetitlePattern(this.titlePattern);
3073
+ }
3074
+ /**
3075
+ * Edit DOM after render
3076
+ *
3077
+ * @returns {void}
3078
+ */
3079
+ componentDidRender() {
3080
+ // when we are editing we get focus on edition input
3081
+ if (this.isEditing) {
3082
+ this.editInputElement.setFocus();
3083
+ }
3084
+ }
3085
+ /**
3086
+ * Render component
3087
+ *
3088
+ * @returns {HTMLElement} html element
3089
+ */
3090
+ render() {
3091
+ return (h("section", { class: this.classList.join(), id: this.identifier }, h("header", { class: "mg-panel__header", id: `${this.identifier}-header` }, h("div", { class: `mg-panel__header-left ${this.isEditing ? 'mg-panel__header-left--full' : ''}` }, this.headerLeft()), h("div", { class: "mg-panel__header-right" }, h("slot", { name: "header-right" }))), h("article", { class: "mg-panel__content", id: `${this.identifier}-content`, "aria-labelledby": `${this.identifier}-header`, hidden: !this.expanded }, h("slot", null))));
3092
+ }
3093
+ get element() { return getElement(this); }
3094
+ static get watchers() { return {
3095
+ "panelTitle": ["handelTileChange"],
3096
+ "titlePattern": ["validatetitlePattern"],
3097
+ "expanded": ["handleExpanded"]
3098
+ }; }
3099
+ };
3100
+ MgPanel.style = mgPanelCss;
3101
+
3102
+ var Status;
3103
+ (function (Status) {
3104
+ Status["VISIBLE"] = "visible";
3105
+ Status["HIDDEN"] = "hidden";
3106
+ Status["DISABLED"] = "disabled";
3107
+ Status["ACTIVE"] = "active";
3108
+ })(Status || (Status = {}));
3109
+ /**
3110
+ * List of all possibles sizes
3111
+ */
3112
+ const sizes = ['regular', 'large'];
3113
+
3114
+ const mgTabsCss = ".mg-tabs.mg-tabs--size-regular .mg-tabs__navigation-button{padding:calc(1rem + 0.3rem) calc(1rem * 1.3) 1rem}.mg-tabs.mg-tabs--size-large .mg-tabs__navigation-button{padding:calc(1.8rem + 0.3rem) calc(1.8rem * 1.3) 1.8rem}.mg-tabs__header{display:flex;flex-direction:row;flex-wrap:wrap}.mg-tabs__navigation-button{display:flex;align-items:center;column-gap:0.5rem;background:none;border:none;border-bottom:0.3rem solid transparent;color:hsl(var(--color-dark));line-height:var(--line-height);cursor:pointer}.mg-tabs__navigation-button:disabled,.mg-tabs__navigation-button--disabled{cursor:default;opacity:30%}.mg-tabs__navigation-button:hover:not(:disabled),.mg-tabs__navigation-button:focus:not(:disabled){background-color:hsla(var(--color-info-h), var(--color-info-s), var(--color-info-l), 10%)}.mg-tabs__navigation-button.mg-tabs__navigation-button--active{color:hsl(var(--color-info));border-bottom-color:hsl(var(--color-info));font-weight:700}.mg-tabs__navigation-button.mg-tabs__navigation-button--hidden{display:none}.mg-tabs__content-container:focus-visible{outline:none}";
3115
+
3116
+ /**
3117
+ * type TabItem validation function
3118
+ *
3119
+ * @param {TabItem} tab tab item
3120
+ * @returns {boolean} tab item type is valid
3121
+ */
3122
+ const isTabItem = (tab) => typeof tab === 'object' && typeof tab.label === 'string';
3123
+ const MgTabs = class {
3124
+ constructor(hostRef) {
3125
+ registerInstance(this, hostRef);
3126
+ this.activeTabChange = createEvent(this, "active-tab-change", 7);
3127
+ /************
3128
+ * Internal *
3129
+ ************/
3130
+ this.tabPanel = 'panel';
3131
+ this.startIndex = 1;
3132
+ this.buttonTabBaseClass = 'mg-tabs__navigation-button';
3133
+ /**
3134
+ * Identifier is used for the element ID (id is a reserved prop in Stencil.js)
3135
+ * If not set, it will be created.
3136
+ */
3137
+ this.identifier = createID('mg-tabs');
3138
+ /**
3139
+ * Define tabs size
3140
+ */
3141
+ this.size = 'regular';
3142
+ /**
3143
+ * Active tab number
3144
+ * default: first is 1
3145
+ */
3146
+ this.activeTab = 1;
3147
+ /**
3148
+ * Component tabs
3149
+ */
3150
+ this.tabs = [];
3151
+ /**
3152
+ * Component classes
3153
+ */
3154
+ this.classList = new ClassList(['mg-tabs']);
3155
+ /**
3156
+ * Method to set active tab
3157
+ *
3158
+ * @param {number} tabKey item tab key to set to ACTIVE status
3159
+ * @returns {void}
3160
+ */
3161
+ this.setActiveTab = (tabKey) => {
3162
+ // reset active tabs
3163
+ this.tabs.forEach(tab => {
3164
+ if (this.tabHasGivenStatus(tab, Status.ACTIVE))
3165
+ tab.status = Status.VISIBLE;
3166
+ });
3167
+ // set active tab from given tab key
3168
+ this.tabs[tabKey - this.startIndex].status = Status.ACTIVE;
3169
+ // emit change active tab key event
3170
+ this.activeTabChange.emit(tabKey);
3171
+ };
3172
+ /**
3173
+ * Method to know if given tab has the given status
3174
+ *
3175
+ * @param {TabItem} tab item tab key to set to ACTIVE status
3176
+ * @param {Status} status status to valide
3177
+ * @returns {boolean} status comparaison
3178
+ */
3179
+ this.tabHasGivenStatus = (tab, status) => tab.status === status;
3180
+ /**
3181
+ * Method to get element id from index
3182
+ *
3183
+ * @param {string} element to get id
3184
+ * @param {number} index to generate id
3185
+ * @returns {string} generated element id
3186
+ */
3187
+ this.getElementId = (element, index) => `${element}-${this.getTabIndex(index)}`;
3188
+ /**
3189
+ * Method to get tab index
3190
+ *
3191
+ * @param {number} index to get
3192
+ * @returns {number} index
3193
+ */
3194
+ this.getTabIndex = (index) => index + this.startIndex;
3195
+ /**
3196
+ * Handle click events on tabs
3197
+ *
3198
+ * @param {MouseEvent} event mouse event
3199
+ */
3200
+ this.handleClick = (event) => {
3201
+ const tabId = event.currentTarget.getAttribute('data-index');
3202
+ this.activeTab = Number(tabId);
3203
+ };
3204
+ /**
3205
+ * get navigation button class from given status
3206
+ *
3207
+ * @param {Status} status button tab status
3208
+ * @param {boolean} isSelector set if we need a CSS selector with the dot '.' at the begin. default value = false.
3209
+ * @returns {string} button class/selector variant
3210
+ */
3211
+ this.getNavigationButtonClass = (status, isSelector = false) => `${isSelector ? '.' : ''}${this.buttonTabBaseClass}--${status}`;
3212
+ /**
3213
+ * Handle keyboard event on tabs
3214
+ *
3215
+ * @param {MouseEvent} event mouse event
3216
+ * @returns {void}
3217
+ */
3218
+ this.handleKeydown = (event) => {
3219
+ let tabId = Number(event.target.getAttribute('data-index'));
3220
+ const parent = event.target.parentElement;
3221
+ // change selected id from key code
3222
+ if (event.key === 'ArrowRight') {
3223
+ tabId++;
3224
+ }
3225
+ else if (event.key === 'ArrowLeft') {
3226
+ tabId--;
3227
+ }
3228
+ // get selected tab if NOT hidden, disabled
3229
+ const selectedTab = parent.querySelector(`[data-index="${tabId}"]:not(${[this.getNavigationButtonClass(Status.HIDDEN, true), this.getNavigationButtonClass(Status.DISABLED, true)].join()})`);
3230
+ // apply selected tab if exist
3231
+ if (selectedTab !== null) {
3232
+ selectedTab.focus();
3233
+ this.activeTab = tabId;
3234
+ }
3235
+ };
3236
+ /**
3237
+ * Validate slots setting
3238
+ */
3239
+ this.validateSlots = () => {
3240
+ const slots = Array.from(this.element.children).filter(slot => { var _a; return (_a = slot.getAttribute('slot')) === null || _a === void 0 ? void 0 : _a.includes('tab_content-'); });
3241
+ if (slots.length !== this.tabs.length) {
3242
+ throw new Error('<mg-tabs> Must have slots counts equal to tabs count.');
3243
+ }
3244
+ };
3245
+ }
3246
+ validateSize(newValue) {
3247
+ if (!sizes.includes(newValue)) {
3248
+ throw new Error(`<mg-tabs> prop "size" must be one of : ${sizes.join(', ')}`);
3249
+ }
3250
+ this.classList.add(`mg-tabs--size-${this.size}`);
3251
+ }
3252
+ validateItems(newValue) {
3253
+ // String array
3254
+ if (allItemsAreString(newValue)) {
3255
+ this.tabs = newValue.map(item => ({ label: item, status: Status.VISIBLE }));
3256
+ }
3257
+ // Object array
3258
+ else if (newValue && newValue.every(item => isTabItem(item))) {
3259
+ this.tabs = newValue;
3260
+ }
3261
+ else {
3262
+ throw new Error('<mg-tabs> prop "items" is required and all items must be the same type: TabItem.');
3263
+ }
3264
+ }
3265
+ validateActiveTab(newValue) {
3266
+ if (newValue < 1 || newValue > this.tabs.length) {
3267
+ throw new Error('<mg-tabs> prop "activeTab" must be between 1 and tabs length.');
3268
+ }
3269
+ else {
3270
+ this.setActiveTab(newValue);
3271
+ }
3272
+ }
3273
+ /*************
3274
+ * Lifecycle *
3275
+ *************/
3276
+ /**
3277
+ * Check if component props are well configured on init
3278
+ *
3279
+ * @returns {void}
3280
+ */
3281
+ componentWillLoad() {
3282
+ // Check tabs format
3283
+ this.validateItems(this.items);
3284
+ this.validateActiveTab(this.activeTab);
3285
+ this.validateSize(this.size);
3286
+ this.validateSlots();
3287
+ }
3288
+ /**
3289
+ * Render
3290
+ *
3291
+ * @returns {HTMLElement} HTML Element
3292
+ */
3293
+ render() {
3294
+ return (h(Host, null, h("div", { class: this.classList.join() }, h("header", { role: "tablist", "aria-label": this.label, class: "mg-tabs__header" }, this.tabs.map((tab, index) => (h("button", { role: "tab", id: this.getElementId(this.identifier, index), class: {
3295
+ [`${this.buttonTabBaseClass}`]: true,
3296
+ [`${this.getNavigationButtonClass(Status.ACTIVE)}`]: this.tabHasGivenStatus(tab, Status.ACTIVE),
3297
+ [`${this.getNavigationButtonClass(Status.DISABLED)}`]: this.tabHasGivenStatus(tab, Status.DISABLED),
3298
+ [`${this.getNavigationButtonClass(Status.HIDDEN)}`]: this.tabHasGivenStatus(tab, Status.HIDDEN),
3299
+ }, tabindex: this.tabHasGivenStatus(tab, Status.ACTIVE) ? 0 : -1, "aria-selected": this.tabHasGivenStatus(tab, Status.ACTIVE).toString(), "aria-controls": this.getElementId(this.tabPanel, index), onClick: this.handleClick, onKeyDown: this.handleKeydown, "data-index": this.getTabIndex(index), disabled: this.tabHasGivenStatus(tab, Status.DISABLED) }, tab.icon !== undefined && h("mg-icon", { icon: tab.icon }), tab.label, tab.badge !== undefined && h("mg-badge", { variant: "info", value: tab.badge.value, label: tab.badge.label }))))), this.tabs.map((tab, index) => (h("article", { role: "tabpanel", id: this.getElementId(this.tabPanel, index), hidden: !this.tabHasGivenStatus(tab, Status.ACTIVE), "aria-labelledby": this.getElementId(this.identifier, index), tabindex: this.tabHasGivenStatus(tab, Status.ACTIVE) ? 0 : -1, class: "mg-tabs__content-container" }, h("slot", { name: this.getElementId('tab_content', index) })))))));
3300
+ }
3301
+ get element() { return getElement(this); }
3302
+ static get watchers() { return {
3303
+ "size": ["validateSize"],
3304
+ "items": ["validateItems"],
3305
+ "activeTab": ["validateActiveTab"]
3306
+ }; }
3307
+ };
3308
+ MgTabs.style = mgTabsCss;
3309
+
3310
+ /**
3311
+ * List of all possibles variants
3312
+ */
3313
+ const variants = ['primary', 'secondary', 'success', 'warning', 'danger', 'info'];
3314
+
3315
+ const mgTagCss = ".mg-tag{padding:calc((var(--mg-tag-height) - 0.2rem - var(--mg-tag-font-size) * var(--line-height)) / 2) 0.6rem;min-height:var(--mg-tag-height);box-sizing:border-box;border-radius:var(--mg-tag-border-radius);border:0.1rem solid;font-size:var(--mg-tag-font-size);font-weight:600;text-align:center}.mg-tag.mg-tag--primary{background-color:hsl(var(--color-dark));border-color:hsl(var(--color-dark));color:hsl(var(--color-light))}.mg-tag.mg-tag--primary.mg-tag--outline{background-color:transparent;color:hsl(var(--color-dark))}.mg-tag.mg-tag--secondary{background-color:hsl(var(--color-light));border-color:hsl(var(--color-light));color:hsl(var(--color-dark))}.mg-tag.mg-tag--secondary.mg-tag--outline{background-color:transparent;color:hsl(var(--color-light))}.mg-tag.mg-tag--success{background-color:hsl(var(--color-success));border-color:hsl(var(--color-success));color:hsl(var(--color-dark))}.mg-tag.mg-tag--success.mg-tag--outline{background-color:transparent;color:hsl(var(--color-success))}.mg-tag.mg-tag--warning{background-color:hsl(var(--color-warning));border-color:hsl(var(--color-warning));color:hsl(var(--color-dark))}.mg-tag.mg-tag--warning.mg-tag--outline{background-color:transparent;color:hsl(var(--color-warning))}.mg-tag.mg-tag--danger{background-color:hsl(var(--color-danger));border-color:hsl(var(--color-danger));color:hsl(var(--color-light))}.mg-tag.mg-tag--danger.mg-tag--outline{background-color:transparent;color:hsl(var(--color-danger))}.mg-tag.mg-tag--info{background-color:hsl(var(--color-info));border-color:hsl(var(--color-info));color:hsl(var(--color-light))}.mg-tag.mg-tag--info.mg-tag--outline{background-color:transparent;color:hsl(var(--color-info))}.mg-tag,mg-tag{display:inline-block;vertical-align:middle}";
3316
+
3317
+ const MgTag = class {
3318
+ constructor(hostRef) {
3319
+ registerInstance(this, hostRef);
3320
+ /************
3321
+ * Internal *
3322
+ ************/
3323
+ // classes
3324
+ this.classOutline = `mg-tag--outline`;
3325
+ /**************
3326
+ * Decorators *
3327
+ **************/
3328
+ /**
3329
+ * Define button variant
3330
+ */
3331
+ this.variant = variants[0]; // primary
3332
+ /**
3333
+ * Component classes
3334
+ */
3335
+ this.classList = new ClassList(['mg-tag']);
3336
+ }
3337
+ validateVariant(newValue, oldValue) {
3338
+ if (!variants.includes(newValue)) {
3339
+ throw new Error(`<mg-tag> prop "variant" must be one of : ${variants.join(', ')}.`);
3340
+ }
3341
+ else {
3342
+ if (oldValue !== undefined) {
3343
+ this.classList.delete(`mg-tag--${oldValue}`);
3344
+ }
3345
+ this.classList.add(`mg-tag--${newValue}`);
3346
+ }
3347
+ }
3348
+ validateOutline(newValue) {
3349
+ if (newValue)
3350
+ this.classList.add(this.classOutline);
3351
+ else
3352
+ this.classList.delete(this.classOutline);
3353
+ }
3354
+ /*************
3355
+ * Lifecycle *
3356
+ *************/
3357
+ /**
3358
+ * Check if props are well configured on init
3359
+ *
3360
+ * @returns {void}
3361
+ */
3362
+ componentWillLoad() {
3363
+ this.validateVariant(this.variant);
3364
+ this.validateOutline(this.outline);
3365
+ }
3366
+ /**
3367
+ * Render
3368
+ *
3369
+ * @returns {HTMLElement} HTML Element
3370
+ */
3371
+ render() {
3372
+ return (h("span", { class: this.classList.join() }, h("slot", null)));
3373
+ }
3374
+ static get watchers() { return {
3375
+ "variant": ["validateVariant"],
3376
+ "outline": ["validateOutline"]
3377
+ }; }
3378
+ };
3379
+ MgTag.style = mgTagCss;
3380
+
3381
+ const mgTooltipCss = ".sc-mg-tooltip-h{display:inline-block}.mg-tooltip.sc-mg-tooltip{display:none;padding:0.5rem 0.8rem;z-index:9999;border-radius:var(--mg-tooltip-border-radius);background-color:hsl(var(--mg-tooltip-background-color));color:hsl(var(--mg-tooltip-font-color));text-align:start}.mg-tooltip[data-show].sc-mg-tooltip{display:block}.mg-tooltip.sc-mg-tooltip .mg-tooltip__arrow.sc-mg-tooltip,.mg-tooltip.sc-mg-tooltip .mg-tooltip__arrow.sc-mg-tooltip::before{position:absolute;width:0.8rem;height:0.8rem;z-index:9999;background:inherit}.mg-tooltip.sc-mg-tooltip .mg-tooltip__arrow.sc-mg-tooltip{visibility:hidden}.mg-tooltip.sc-mg-tooltip .mg-tooltip__arrow.sc-mg-tooltip::before{visibility:visible;content:\"\";transform:rotate(45deg)}.mg-tooltip[data-popper-placement^=top].sc-mg-tooltip>.mg-tooltip__arrow.sc-mg-tooltip{bottom:-4px}.mg-tooltip[data-popper-placement^=bottom].sc-mg-tooltip>.mg-tooltip__arrow.sc-mg-tooltip{top:-4px}.mg-tooltip[data-popper-placement^=left].sc-mg-tooltip>.mg-tooltip__arrow.sc-mg-tooltip{right:-4px}.mg-tooltip[data-popper-placement^=right].sc-mg-tooltip>.mg-tooltip__arrow.sc-mg-tooltip{left:-4px}";
3382
+
3383
+ const MgTooltip = class {
3384
+ constructor(hostRef) {
3385
+ registerInstance(this, hostRef);
3386
+ /**
3387
+ * Sets an `id` attribute.
3388
+ * Needed by the input for accessibility `aria-decribedby`.
3389
+ */
3390
+ this.identifier = createID('mg-tooltip');
3391
+ /**
3392
+ * Tooltip placement
3393
+ */
3394
+ this.placement = 'bottom';
3395
+ /**
3396
+ * Display tooltip
3397
+ */
3398
+ this.display = false;
3399
+ /**
3400
+ * Disable tooltip
3401
+ */
3402
+ this.disabled = false;
3403
+ /**
3404
+ * Show tooltip
3405
+ *
3406
+ * @returns {void}
3407
+ */
3408
+ this.show = () => {
3409
+ // Make the tooltip visible
3410
+ this.tooltip.setAttribute('data-show', '');
3411
+ // Enable the event listeners
3412
+ this.popper.setOptions(options => (Object.assign(Object.assign({}, options), { modifiers: [...options.modifiers, { name: 'eventListeners', enabled: true }] })));
3413
+ // Update its position
3414
+ this.popper.update();
3415
+ };
3416
+ /**
3417
+ * Hide tooltip
3418
+ *
3419
+ * @returns {void}
3420
+ */
3421
+ this.hide = () => {
3422
+ // Hide the tooltip
3423
+ this.tooltip.removeAttribute('data-show');
3424
+ // Disable the event listeners
3425
+ this.popper.setOptions(options => (Object.assign(Object.assign({}, options), { modifiers: [...options.modifiers, { name: 'eventListeners', enabled: false }] })));
3426
+ };
3427
+ }
3428
+ handleDisplay(newVal) {
3429
+ if (newVal) {
3430
+ this.show();
3431
+ }
3432
+ else {
3433
+ this.hide();
3434
+ }
3435
+ }
3436
+ /*************
3437
+ * Lifecycle *
3438
+ *************/
3439
+ /**
3440
+ * Get slotted element
3441
+ * Check if it already contain an interactive element, if not we need to add a tabIndex attribute
3442
+ * We need to attach the focused element to the tooltip (aria-describedby)
3443
+ *
3444
+ * @returns {void}
3445
+ */
3446
+ componentDidLoad() {
3447
+ var _a;
3448
+ // Get tooltip element
3449
+ this.tooltip = this.element.querySelector(`#${this.identifier}`);
3450
+ // get slotted element
3451
+ const slotElement = this.element.firstElementChild;
3452
+ // Get interactive element
3453
+ const interactiveElements = ['a', 'button', 'input', 'textarea', 'select']; //! Might needs updates
3454
+ const interactiveElement = this.element.querySelector(interactiveElements.join(',')) || ((_a = slotElement.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(interactiveElements.join(',')));
3455
+ // define selected element to become tooltip selector
3456
+ const tooltipedElement = interactiveElement || slotElement;
3457
+ // Add tabindex to slotted element if we can't find any interactive element
3458
+ if (interactiveElement === null || interactiveElement === undefined)
3459
+ slotElement.tabIndex = 0;
3460
+ // Set aria-describedby
3461
+ const ariaDescribedby = slotElement.getAttribute('aria-describedby');
3462
+ if (ariaDescribedby === null) {
3463
+ tooltipedElement.setAttribute('aria-describedby', this.identifier);
3464
+ }
3465
+ else {
3466
+ slotElement.setAttribute('aria-describedby', `${ariaDescribedby} ${this.identifier}`);
3467
+ }
3468
+ // Create popperjs tooltip
3469
+ this.popper = createPopper(tooltipedElement, this.tooltip, {
3470
+ placement: this.placement,
3471
+ modifiers: [
3472
+ {
3473
+ name: 'offset',
3474
+ options: {
3475
+ offset: [0, 8],
3476
+ },
3477
+ },
3478
+ ],
3479
+ });
3480
+ // Add events
3481
+ ['mouseenter', 'focus'].forEach(event => {
3482
+ tooltipedElement.addEventListener(event, () => {
3483
+ if (!this.disabled)
3484
+ this.display = true;
3485
+ });
3486
+ });
3487
+ ['mouseleave', 'blur', 'keydown'].forEach(event => {
3488
+ tooltipedElement.addEventListener(event, (e) => {
3489
+ // we continue to process ONLY for KeyboardEvents 'Escape'
3490
+ if (e.type === 'keydown' && e.code !== 'Escape') {
3491
+ return;
3492
+ }
3493
+ if (!this.disabled)
3494
+ this.display = false;
3495
+ });
3496
+ });
3497
+ this.handleDisplay(this.display);
3498
+ }
3499
+ /**
3500
+ * Render
3501
+ *
3502
+ * @returns {HTMLElement} HTML Element
3503
+ */
3504
+ render() {
3505
+ return (h(Host, null, h("slot", null), h("div", { role: "tooltip", id: this.identifier, class: "mg-tooltip", innerHTML: this.message }, h("div", { class: "mg-tooltip__arrow", "data-popper-arrow": true }))));
3506
+ }
3507
+ get element() { return getElement(this); }
3508
+ static get watchers() { return {
3509
+ "display": ["handleDisplay"]
3510
+ }; }
3511
+ };
3512
+ MgTooltip.style = mgTooltipCss;
3513
+
3514
+ export { MgBadge as mg_badge, MgButton as mg_button, MgCharacterLeft as mg_character_left, MgForm as mg_form, MgIcon as mg_icon, MgInputCheckbox as mg_input_checkbox, MgInputDate as mg_input_date, MgInputNumeric as mg_input_numeric, MgInputPassword as mg_input_password, MgInputRadio as mg_input_radio, MgInputSelect as mg_input_select, MgInputText as mg_input_text, MgInputTextarea as mg_input_textarea, MgInputTitle as mg_input_title, MgInputToggle as mg_input_toggle, MgMessage as mg_message, MgPagination as mg_pagination, MgPanel as mg_panel, MgTabs as mg_tabs, MgTag as mg_tag, MgTooltip as mg_tooltip };