@mgdis/mg-components 3.2.0 → 4.0.1

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 (228) hide show
  1. package/dist/cjs/{index-bead7dbd.js → index-88560a66.js} +47 -48
  2. package/dist/cjs/{index-369388eb.js → index-a39c5567.js} +97 -10
  3. package/dist/cjs/loader.cjs.js +3 -17
  4. package/dist/cjs/mg-badge_21.cjs.entry.js +519 -294
  5. package/dist/cjs/mg-components.cjs.js +3 -7
  6. package/dist/cjs/mg-modal.cjs.entry.js +12 -6
  7. package/dist/cjs/mg-popover.cjs.entry.js +15 -10
  8. package/dist/cjs/{popper-0c3964e7.js → popper-71bf3058.js} +6 -2
  9. package/dist/collection/collection-manifest.json +1 -1
  10. package/dist/collection/components/atoms/mg-badge/{mg-badge.stories.js → doc/mg-badge.stories.js} +1 -1
  11. package/dist/collection/components/atoms/mg-badge/mg-badge.css +0 -2
  12. package/dist/collection/components/atoms/mg-badge/mg-badge.js +15 -3
  13. package/dist/collection/components/atoms/mg-button/{mg-button.stories.js → doc/mg-button.stories.js} +2 -2
  14. package/dist/collection/components/atoms/mg-button/mg-button.conf.js +1 -1
  15. package/dist/collection/components/atoms/mg-button/mg-button.css +20 -32
  16. package/dist/collection/components/atoms/mg-button/mg-button.js +8 -3
  17. package/dist/collection/components/atoms/mg-character-left/{mg-character-left.stories.js → doc/mg-character-left.stories.js} +1 -1
  18. package/dist/collection/components/atoms/mg-character-left/mg-character-left.js +10 -47
  19. package/dist/collection/components/atoms/mg-icon/{mg-icon.stories.js → doc/mg-icon.stories.js} +1 -1
  20. package/dist/collection/components/atoms/mg-icon/mg-icon.conf.js +97 -10
  21. package/dist/collection/components/atoms/mg-icon/mg-icon.css +4 -0
  22. package/dist/collection/components/atoms/mg-icon/mg-icon.js +22 -6
  23. package/dist/collection/components/atoms/mg-input-title/{mg-input-title.stories.js → doc/mg-input-title.stories.js} +0 -0
  24. package/dist/collection/components/atoms/mg-tag/{mg-tag.stories.js → doc/mg-tag.stories.js} +1 -1
  25. package/dist/collection/components/atoms/mg-tag/mg-tag.js +19 -4
  26. package/dist/collection/components/atoms/mg-tooltip/{mg-tooltip.stories.js → doc/mg-tooltip.stories.js} +14 -1
  27. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.conf.js +20 -0
  28. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +7 -2
  29. package/dist/collection/components/molecules/inputs/MgInput.conf.js +1 -7
  30. package/dist/collection/components/molecules/inputs/MgInput.js +5 -15
  31. package/dist/collection/components/molecules/inputs/mg-input-checkbox/{mg-input-checkbox.stories.js → doc/mg-input-checkbox.stories.js} +0 -0
  32. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.css +19 -13
  33. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +8 -21
  34. package/dist/collection/components/molecules/inputs/mg-input-date/{mg-input-date.stories.js → doc/mg-input-date.stories.js} +0 -0
  35. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.css +19 -18
  36. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +19 -18
  37. package/dist/collection/components/molecules/inputs/mg-input-numeric/{mg-input-numeric.stories.js → doc/mg-input-numeric.stories.js} +9 -2
  38. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.css +20 -19
  39. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +43 -19
  40. package/dist/collection/components/molecules/inputs/mg-input-password/{mg-input-password.stories.js → doc/mg-input-password.stories.js} +10 -1
  41. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.css +19 -18
  42. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +17 -22
  43. package/dist/collection/components/molecules/inputs/mg-input-radio/{mg-input-radio.stories.js → doc/mg-input-radio.stories.js} +0 -0
  44. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.css +19 -13
  45. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +8 -15
  46. package/dist/collection/components/molecules/inputs/mg-input-select/{mg-input-select.stories.js → doc/mg-input-select.stories.js} +10 -3
  47. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.css +20 -18
  48. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +24 -31
  49. package/dist/collection/components/molecules/inputs/mg-input-text/{mg-input-text.stories.js → doc/mg-input-text.stories.js} +11 -7
  50. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.css +51 -28
  51. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +42 -43
  52. package/dist/collection/components/molecules/inputs/mg-input-textarea/{mg-input-textarea.stories.js → doc/mg-input-textarea.stories.js} +10 -4
  53. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.css +51 -22
  54. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +66 -39
  55. package/dist/collection/components/molecules/inputs/mg-input-toggle/{mg-input-toggle.stories.js → doc/mg-input-toggle.stories.js} +0 -0
  56. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.css +18 -9
  57. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +10 -4
  58. package/dist/collection/components/molecules/mg-form/{mg-form.stories.js → doc/mg-form.stories.js} +0 -0
  59. package/dist/collection/components/molecules/mg-form/mg-form.css +4 -0
  60. package/dist/collection/components/molecules/mg-form/mg-form.js +5 -3
  61. package/dist/collection/components/molecules/mg-message/{mg-message.stories.js → doc/mg-message.stories.js} +1 -1
  62. package/dist/collection/components/molecules/mg-message/mg-message.js +15 -7
  63. package/dist/collection/components/molecules/mg-modal/{mg-modal.stories.js → doc/mg-modal.stories.js} +0 -0
  64. package/dist/collection/components/molecules/mg-modal/mg-modal.css +5 -7
  65. package/dist/collection/components/molecules/mg-modal/mg-modal.js +12 -5
  66. package/dist/collection/components/molecules/mg-pagination/{mg-pagination.stories.js → doc/mg-pagination.stories.js} +0 -0
  67. package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +17 -18
  68. package/dist/collection/components/molecules/mg-panel/{mg-panel.stories.js → doc/mg-panel.stories.js} +9 -1
  69. package/dist/collection/components/molecules/mg-panel/mg-panel.css +13 -4
  70. package/dist/collection/components/molecules/mg-panel/mg-panel.js +119 -18
  71. package/dist/collection/components/molecules/mg-popover/{mg-popover.stories.js → doc/mg-popover.stories.js} +10 -0
  72. package/dist/collection/components/molecules/mg-popover/mg-popover.conf.js +20 -0
  73. package/dist/collection/components/molecules/mg-popover/mg-popover.js +19 -9
  74. package/dist/collection/components/molecules/mg-tabs/{mg-tabs.stories.js → doc/mg-tabs.stories.js} +12 -5
  75. package/dist/collection/components/molecules/mg-tabs/mg-tabs.conf.js +7 -0
  76. package/dist/collection/components/molecules/mg-tabs/mg-tabs.css +3 -0
  77. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +92 -27
  78. package/dist/collection/locales/index.js +33 -4
  79. package/dist/collection/stories/helpers.stories.js +33 -0
  80. package/dist/collection/utils/locale.utils.js +7 -4
  81. package/dist/collection/variables.css +9 -4
  82. package/dist/collection/variables.scss +9 -4
  83. package/dist/components/MgInput.js +6 -23
  84. package/dist/components/index.d.ts +23 -5
  85. package/dist/components/index.js +23 -0
  86. package/dist/components/index2.js +97 -8
  87. package/dist/components/locale.utils.js +7 -5
  88. package/dist/components/mg-badge2.js +16 -4
  89. package/dist/components/mg-button2.js +10 -5
  90. package/dist/components/mg-character-left2.js +4 -27
  91. package/dist/components/mg-form.js +6 -4
  92. package/dist/components/mg-icon2.js +120 -17
  93. package/dist/components/mg-input-checkbox.js +11 -27
  94. package/dist/components/mg-input-date.js +21 -25
  95. package/dist/components/mg-input-numeric.js +28 -26
  96. package/dist/components/mg-input-password.js +18 -28
  97. package/dist/components/mg-input-radio.js +10 -22
  98. package/dist/components/mg-input-select2.js +24 -35
  99. package/dist/components/mg-input-text2.js +38 -26
  100. package/dist/components/mg-input-textarea.js +44 -21
  101. package/dist/components/mg-input-toggle.js +11 -11
  102. package/dist/components/mg-message.js +16 -8
  103. package/dist/components/mg-modal.js +11 -5
  104. package/dist/components/mg-pagination.js +16 -22
  105. package/dist/components/mg-panel.js +51 -17
  106. package/dist/components/mg-popover.js +13 -8
  107. package/dist/components/mg-tabs.js +80 -22
  108. package/dist/components/mg-tag.js +20 -5
  109. package/dist/components/mg-tooltip2.js +1 -1
  110. package/dist/components/popper.js +6 -2
  111. package/dist/esm/{index-9e877561.js → index-bca81100.js} +48 -46
  112. package/dist/esm/{index-c346f52d.js → index-e51ae032.js} +97 -8
  113. package/dist/esm/loader.js +3 -17
  114. package/dist/esm/mg-badge_21.entry.js +516 -291
  115. package/dist/esm/mg-components.js +3 -7
  116. package/dist/esm/mg-modal.entry.js +12 -6
  117. package/dist/esm/mg-popover.entry.js +15 -10
  118. package/dist/esm/{popper-8874fd6c.js → popper-93ecb064.js} +6 -2
  119. package/dist/index.js +1 -1
  120. package/dist/mg-components/mg-components.css +1 -1
  121. package/dist/mg-components/mg-components.esm.js +1 -1
  122. package/dist/mg-components/p-462d648a.entry.js +1 -0
  123. package/dist/mg-components/p-4c66f794.js +1 -0
  124. package/dist/mg-components/p-5126ab10.entry.js +1 -0
  125. package/dist/mg-components/p-766c918b.entry.js +1 -0
  126. package/dist/mg-components/p-780bd52d.js +1 -0
  127. package/dist/mg-components/p-b14a3443.js +2 -0
  128. package/dist/mg-components/variables.css +9 -4
  129. package/dist/mg-components/variables.scss +9 -4
  130. package/dist/types/components/atoms/mg-badge/{mg-badge.stories.d.ts → doc/mg-badge.stories.d.ts} +0 -0
  131. package/dist/types/components/atoms/mg-badge/mg-badge.d.ts +8 -1
  132. package/dist/types/components/atoms/mg-button/{mg-button.stories.d.ts → doc/mg-button.stories.d.ts} +0 -0
  133. package/dist/types/components/atoms/mg-button/mg-button.d.ts +1 -1
  134. package/dist/types/components/atoms/mg-character-left/{mg-character-left.stories.d.ts → doc/mg-character-left.stories.d.ts} +0 -0
  135. package/dist/types/components/atoms/mg-character-left/mg-character-left.d.ts +5 -13
  136. package/dist/types/components/atoms/mg-icon/{mg-icon.stories.d.ts → doc/mg-icon.stories.d.ts} +0 -0
  137. package/dist/types/components/atoms/mg-icon/mg-icon.d.ts +3 -3
  138. package/dist/types/components/atoms/mg-input-title/{mg-input-title.stories.d.ts → doc/mg-input-title.stories.d.ts} +0 -0
  139. package/dist/types/components/atoms/mg-tag/{mg-tag.stories.d.ts → doc/mg-tag.stories.d.ts} +0 -0
  140. package/dist/types/components/atoms/mg-tag/mg-tag.d.ts +8 -1
  141. package/dist/types/components/atoms/mg-tooltip/doc/mg-tooltip.stories.d.ts +29 -0
  142. package/dist/types/components/atoms/mg-tooltip/mg-tooltip.conf.d.ts +8 -0
  143. package/dist/types/components/atoms/mg-tooltip/mg-tooltip.d.ts +2 -1
  144. package/dist/types/components/molecules/inputs/MgInput.conf.d.ts +0 -6
  145. package/dist/types/components/molecules/inputs/MgInput.d.ts +2 -4
  146. package/dist/types/components/molecules/inputs/mg-input-checkbox/{mg-input-checkbox.stories.d.ts → doc/mg-input-checkbox.stories.d.ts} +0 -0
  147. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +5 -2
  148. package/dist/types/components/molecules/inputs/mg-input-date/{mg-input-date.stories.d.ts → doc/mg-input-date.stories.d.ts} +0 -0
  149. package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.d.ts +7 -1
  150. package/dist/types/components/molecules/inputs/mg-input-numeric/{mg-input-numeric.stories.d.ts → doc/mg-input-numeric.stories.d.ts} +6 -0
  151. package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +8 -2
  152. package/dist/types/components/molecules/inputs/mg-input-password/{mg-input-password.stories.d.ts → doc/mg-input-password.stories.d.ts} +8 -0
  153. package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.d.ts +7 -2
  154. package/dist/types/components/molecules/inputs/mg-input-radio/{mg-input-radio.stories.d.ts → doc/mg-input-radio.stories.d.ts} +0 -0
  155. package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +5 -1
  156. package/dist/types/components/molecules/inputs/mg-input-select/{mg-input-select.stories.d.ts → doc/mg-input-select.stories.d.ts} +11 -5
  157. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +7 -2
  158. package/dist/types/components/molecules/inputs/mg-input-text/{mg-input-text.stories.d.ts → doc/mg-input-text.stories.d.ts} +8 -0
  159. package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +7 -7
  160. package/dist/types/components/molecules/inputs/mg-input-textarea/doc/mg-input-textarea.stories.d.ts +19 -0
  161. package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +15 -7
  162. package/dist/types/components/molecules/inputs/mg-input-toggle/{mg-input-toggle.stories.d.ts → doc/mg-input-toggle.stories.d.ts} +0 -0
  163. package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +2 -0
  164. package/dist/types/components/molecules/mg-form/{mg-form.stories.d.ts → doc/mg-form.stories.d.ts} +0 -0
  165. package/dist/types/components/molecules/mg-form/mg-form.d.ts +1 -0
  166. package/dist/types/components/molecules/mg-message/{mg-message.stories.d.ts → doc/mg-message.stories.d.ts} +0 -0
  167. package/dist/types/components/molecules/mg-message/mg-message.d.ts +2 -0
  168. package/dist/types/components/molecules/mg-modal/{mg-modal.stories.d.ts → doc/mg-modal.stories.d.ts} +0 -0
  169. package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +2 -0
  170. package/dist/types/components/molecules/mg-pagination/{mg-pagination.stories.d.ts → doc/mg-pagination.stories.d.ts} +0 -0
  171. package/dist/types/components/molecules/mg-pagination/mg-pagination.d.ts +8 -0
  172. package/dist/types/components/molecules/{inputs/mg-input-textarea/mg-input-textarea.stories.d.ts → mg-panel/doc/mg-panel.stories.d.ts} +1 -1
  173. package/dist/types/components/molecules/mg-panel/mg-panel.d.ts +29 -0
  174. package/dist/types/components/molecules/mg-popover/doc/mg-popover.stories.d.ts +25 -0
  175. package/dist/types/components/molecules/mg-popover/mg-popover.conf.d.ts +8 -0
  176. package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +9 -1
  177. package/dist/types/components/molecules/mg-tabs/{mg-tabs.stories.d.ts → doc/mg-tabs.stories.d.ts} +5 -0
  178. package/dist/types/components/molecules/mg-tabs/mg-tabs.conf.d.ts +7 -1
  179. package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +49 -0
  180. package/dist/types/components.d.ts +181 -151
  181. package/dist/types/locales/index.d.ts +109 -46
  182. package/dist/types/stories/{buttons.stories.d.ts → helpers.stories.d.ts} +1 -1
  183. package/dist/types/utils/locale.utils.d.ts +7 -3
  184. package/loader/index.js +1 -1
  185. package/package.json +14 -14
  186. package/readme.md +6 -35
  187. package/dist/cjs/css-shim-629916b0.js +0 -6
  188. package/dist/cjs/shadow-css-546083ef.js +0 -390
  189. package/dist/collection/stories/buttons.stories.js +0 -43
  190. package/dist/collection/stories/messages.stories.js +0 -44
  191. package/dist/collection/stories/tags.stories.js +0 -13
  192. package/dist/esm/css-shim-0993aa3b.js +0 -4
  193. package/dist/esm/shadow-css-dfa0587f.js +0 -388
  194. package/dist/esm-es5/css-shim-0993aa3b.js +0 -1
  195. package/dist/esm-es5/index-9e877561.js +0 -1
  196. package/dist/esm-es5/index-c346f52d.js +0 -1
  197. package/dist/esm-es5/index.js +0 -0
  198. package/dist/esm-es5/loader.js +0 -1
  199. package/dist/esm-es5/mg-badge_21.entry.js +0 -2
  200. package/dist/esm-es5/mg-components.js +0 -1
  201. package/dist/esm-es5/mg-modal.entry.js +0 -1
  202. package/dist/esm-es5/mg-popover.entry.js +0 -1
  203. package/dist/esm-es5/popper-8874fd6c.js +0 -1
  204. package/dist/esm-es5/shadow-css-dfa0587f.js +0 -12
  205. package/dist/mg-components/mg-components.js +0 -132
  206. package/dist/mg-components/p-3633e9e1.system.entry.js +0 -2
  207. package/dist/mg-components/p-3c14153d.js +0 -1
  208. package/dist/mg-components/p-50ea2036.system.js +0 -1
  209. package/dist/mg-components/p-55a22b35.system.js +0 -1
  210. package/dist/mg-components/p-5e796581.js +0 -12
  211. package/dist/mg-components/p-656b5efb.system.js +0 -1
  212. package/dist/mg-components/p-68d6f104.js +0 -1
  213. package/dist/mg-components/p-6d49ed95.js +0 -1
  214. package/dist/mg-components/p-70177194.entry.js +0 -1
  215. package/dist/mg-components/p-8b2d8a2a.system.js +0 -13
  216. package/dist/mg-components/p-8cb61c3f.system.js +0 -1
  217. package/dist/mg-components/p-ace173b1.js +0 -1
  218. package/dist/mg-components/p-c46fbd54.entry.js +0 -1
  219. package/dist/mg-components/p-c90cc4bf.system.js +0 -1
  220. package/dist/mg-components/p-cd2a4acc.system.entry.js +0 -1
  221. package/dist/mg-components/p-de1164fa.system.entry.js +0 -1
  222. package/dist/mg-components/p-dfe25da3.entry.js +0 -1
  223. package/dist/mg-components/p-e4a502b5.system.js +0 -1
  224. package/dist/types/components/atoms/mg-tooltip/mg-tooltip.stories.d.ts +0 -11
  225. package/dist/types/components/molecules/mg-panel/mg-panel.stories.d.ts +0 -6
  226. package/dist/types/components/molecules/mg-popover/mg-popover.stories.d.ts +0 -12
  227. package/dist/types/stories/messages.stories.d.ts +0 -13
  228. package/dist/types/stories/tags.stories.d.ts +0 -5
@@ -1,12 +1,11 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
2
  import { M as MgInput } from './MgInput.js';
3
3
  import { c as createID, C as ClassList, a as allItemsAreString } from './components.utils.js';
4
- import { d as defineCustomElement$5 } from './mg-character-left2.js';
5
4
  import { d as defineCustomElement$4 } from './mg-icon2.js';
6
5
  import { d as defineCustomElement$3 } from './mg-input-title2.js';
7
6
  import { d as defineCustomElement$2 } from './mg-tooltip2.js';
8
7
 
9
- const mgInputToggleCss = ":host{display:block}.mg-input{display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input.is-not-valid{color:hsl(var(--color-danger))}.mg-input.is-not-valid .mg-input__box{border-color:hsl(var(--color-danger))}.mg-input mg-input-title{-ms-flex-negative:var(--mg-inputs-shrink, 1);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{-ms-flex-direction:column;flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:-ms-flexbox;display:flex;-ms-flex-align:baseline;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{-ms-flex-negative:1;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:-ms-inline-flexbox;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:-ms-inline-flexbox;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:-ms-flexbox;display:flex}.mg-input__input{display:-ms-flexbox;display:flex;}.mg-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input__input+*{text-align:start;margin-top:0.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.mg-input--toggle .mg-input__input-container{-ms-flex:auto;flex:auto;min-width:0}.mg-input__button-toggle{display:-ms-flexbox;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;-webkit-box-sizing:border-box;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:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align: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:-ms-flexbox;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:-ms-flexbox;display:flex}.mg-input.mg-input--toggle-disabled .mg-input__button-toggle{opacity:0.3}";
8
+ 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}";
10
9
 
11
10
  /**
12
11
  * type Option validation function
@@ -29,6 +28,8 @@ const MgInputToggle$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
29
28
  this.classReadonly = 'mg-input--toggle-readonly';
30
29
  this.classDisabled = 'mg-input--toggle-disabled';
31
30
  this.classIsActive = 'mg-input--toggle-is-active';
31
+ this.classOnOff = 'mg-input--toggle-on-off';
32
+ this.classIcon = 'mg-input--toggle-icon';
32
33
  /**
33
34
  * Identifier is used for the element ID (id is a reserved prop in Stencil.js)
34
35
  * If not set, it will be created.
@@ -116,11 +117,15 @@ const MgInputToggle$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
116
117
  }
117
118
  handleIsOnOff(newValue) {
118
119
  if (newValue)
119
- this.classList.add(`mg-input--toggle-on-off`);
120
+ this.classList.add(this.classOnOff);
121
+ else
122
+ this.classList.delete(this.classOnOff);
120
123
  }
121
124
  handleIsIcon(newValue) {
122
125
  if (newValue)
123
- this.classList.add(`mg-input--toggle-icon`);
126
+ this.classList.add(this.classIcon);
127
+ else
128
+ this.classList.delete(this.classIcon);
124
129
  }
125
130
  handleReadonly(newValue) {
126
131
  if (newValue)
@@ -183,7 +188,7 @@ const MgInputToggle$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
183
188
  * @returns {HTMLElement} HTML Element
184
189
  */
185
190
  render() {
186
- return (h(MgInput, { identifier: this.identifier, classList: this.classList, label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: undefined, readonly: undefined, width: undefined, disabled: this.disabled, value: this.value, readonlyValue: undefined, tooltip: !this.readonly && this.tooltip, displayCharacterLeft: undefined, characterLeftTemplate: undefined, maxlength: undefined, helpText: this.helpText, errorMessage: undefined, isFieldset: false }, h("button", { type: "button", role: "switch", "aria-checked": this.checked, "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" })))));
191
+ 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" })))));
187
192
  }
188
193
  get element() { return this; }
189
194
  static get watchers() { return {
@@ -218,18 +223,13 @@ function defineCustomElement$1() {
218
223
  if (typeof customElements === "undefined") {
219
224
  return;
220
225
  }
221
- const components = ["mg-input-toggle", "mg-character-left", "mg-icon", "mg-input-title", "mg-tooltip"];
226
+ const components = ["mg-input-toggle", "mg-icon", "mg-input-title", "mg-tooltip"];
222
227
  components.forEach(tagName => { switch (tagName) {
223
228
  case "mg-input-toggle":
224
229
  if (!customElements.get(tagName)) {
225
230
  customElements.define(tagName, MgInputToggle$1);
226
231
  }
227
232
  break;
228
- case "mg-character-left":
229
- if (!customElements.get(tagName)) {
230
- defineCustomElement$5();
231
- }
232
- break;
233
233
  case "mg-icon":
234
234
  if (!customElements.get(tagName)) {
235
235
  defineCustomElement$4();
@@ -1,6 +1,6 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
2
  import { c as createID, C as ClassList } from './components.utils.js';
3
- import { m as messages } from './index2.js';
3
+ import { i as initLocales } from './index2.js';
4
4
  import { d as defineCustomElement$3 } from './mg-button2.js';
5
5
  import { d as defineCustomElement$2 } from './mg-icon2.js';
6
6
 
@@ -9,7 +9,7 @@ import { d as defineCustomElement$2 } from './mg-icon2.js';
9
9
  */
10
10
  const variants = ['info', 'warning', 'success', 'danger'];
11
11
 
12
- const mgMessageCss = ".mg-message{display:inline-block;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;min-height:var(--default-size);overflow:hidden;background-color:white;border-radius:var(--mg-message-border-radius);-webkit-box-shadow:var(--box-shadow);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:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:end;justify-content:flex-end;-ms-flex-line-pack:stretch;align-content:stretch;padding:0 1rem 0 3.8rem}.mg-message__content-slot{-ms-flex-positive:1;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%}";
12
+ 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%}";
13
13
 
14
14
  const MgMessage$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
15
15
  constructor() {
@@ -21,6 +21,9 @@ const MgMessage$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
21
21
  /************
22
22
  * Internal *
23
23
  ************/
24
+ // classes
25
+ this.classHide = 'mg-message--hide';
26
+ // IDs
24
27
  this.closeButtonId = '';
25
28
  // Stored timer setted when hide action is run from setTimeOut
26
29
  this.storedTimer = null;
@@ -94,10 +97,12 @@ const MgMessage$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
94
97
  if (!variants.includes(newValue)) {
95
98
  throw new Error(`<mg-message> prop "variant" must be one of : ${variants.join(', ')}`);
96
99
  }
97
- if (oldValue !== undefined) {
98
- this.classList.delete(`mg-message--${oldValue}`);
100
+ else {
101
+ if (oldValue !== undefined) {
102
+ this.classList.delete(`mg-message--${oldValue}`);
103
+ }
104
+ this.classList.add(`mg-message--${newValue}`);
99
105
  }
100
- this.classList.add(`mg-message--${this.variant}`);
101
106
  }
102
107
  validateCloseButton(newValue) {
103
108
  if (newValue && this.hasActions) {
@@ -108,11 +113,11 @@ const MgMessage$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
108
113
  validateHide(newValue) {
109
114
  if (newValue) {
110
115
  this.componentHide.emit();
111
- this.classList.add('mg-message--hide');
116
+ this.classList.add(this.classHide);
112
117
  }
113
118
  else {
114
119
  this.componentShow.emit();
115
- this.classList.delete('mg-message--hide');
120
+ this.classList.delete(this.classHide);
116
121
  }
117
122
  this.hideWithDelay();
118
123
  }
@@ -123,6 +128,9 @@ const MgMessage$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
123
128
  * Check if component props are well configured on init
124
129
  */
125
130
  componentWillLoad() {
131
+ // Get locales
132
+ this.messages = initLocales(this.element).messages;
133
+ // Validate
126
134
  this.validateVariant(this.variant);
127
135
  // Check if close button is an can be activated
128
136
  this.hasActions = this.element.querySelector('[slot="actions"]') !== null;
@@ -140,7 +148,7 @@ const MgMessage$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
140
148
  * @returns {HTMLElement} HTML Element
141
149
  */
142
150
  render() {
143
- 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: messages.message.closeButton, onClick: this.handleClose }, h("mg-icon", { icon: "cross" }))))));
151
+ 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" }))))));
144
152
  }
145
153
  get element() { return this; }
146
154
  static get watchers() { return {
@@ -1,10 +1,10 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
2
  import { c as createID, C as ClassList } from './components.utils.js';
3
- import { m as messages } from './index2.js';
3
+ import { i as initLocales } from './index2.js';
4
4
  import { d as defineCustomElement$3 } from './mg-button2.js';
5
5
  import { d as defineCustomElement$2 } from './mg-icon2.js';
6
6
 
7
- const mgModalCss = ".mg-modal{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;position:fixed;top:0;right:0;bottom:0;left:0;z-index:1000;padding:2rem 0;background-color:hsla(var(--color-dark), 50%)}.mg-modal__dialog{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex:none;flex:none;-ms-flex-item-align:center;align-self:center;row-gap:3rem;padding:1.5rem 2.5rem;width:60rem;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;max-width:100%;max-height:100%;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:hsl(var(--color-light));-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);border-radius:var(--mg-modal-border-radius)}.mg-modal__header{margin-bottom:0.5rem}.mg-modal__title{margin:0;font-family:var(--font-family-heading);font-size:var(--mg-modal-title-font-size);font-weight:600}.mg-modal__content{overflow-y:auto}.mg-modal__close-button{float:right;height:var(--mg-modal-title-font-size);margin-top:calc((var(--default-size) - var(--mg-modal-title-font-size) * var(--line-height)) / 2 * -1);margin-right:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2 * -1)}.mg-modal .mg-modal__content ::slotted(*){font-size:var(--mg-modal-content-font-size)}.mg-modal.mg-modal--hide{display:none}";
7
+ const mgModalCss = ".mg-modal{display:flex;justify-content:center;align-items:center;position:fixed;top:0;right:0;bottom:0;left:0;z-index:1000;padding:2rem 0;background-color:hsla(var(--color-light), 85%)}.mg-modal__dialog{display:flex;flex-direction:column;align-self:center;row-gap:3rem;padding:1.5rem 2.5rem;width:60rem;height:fit-content;max-width:100%;max-height:100%;box-sizing:border-box;background-color:hsl(var(--color-light));box-shadow:var(--box-shadow);border-radius:var(--mg-modal-border-radius)}.mg-modal__header{margin-bottom:0.5rem}.mg-modal__title{margin:0;font-family:var(--font-family-heading);font-size:var(--mg-modal-title-font-size);font-weight:600}.mg-modal__close-button{float:right;height:var(--mg-modal-title-font-size);margin-top:calc((var(--default-size) - var(--mg-modal-title-font-size) * var(--line-height)) / 2 * -1);margin-right:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2 * -1)}.mg-modal .mg-modal__content{overflow-y:auto}.mg-modal .mg-modal__content::slotted(*){font-size:var(--mg-modal-content-font-size)}.mg-modal.mg-modal--hide{display:none}";
8
8
 
9
9
  const MgModal$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
10
10
  constructor() {
@@ -16,6 +16,9 @@ const MgModal$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
16
16
  /************
17
17
  * Internal *
18
18
  ************/
19
+ // Classes
20
+ this.classHide = 'mg-modal--hide';
21
+ // IDs
19
22
  this.closeButtonId = '';
20
23
  this.titleId = '';
21
24
  /**
@@ -58,11 +61,11 @@ const MgModal$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
58
61
  validateHide(newValue) {
59
62
  if (newValue) {
60
63
  this.componentHide.emit();
61
- this.classList.add('mg-modal--hide');
64
+ this.classList.add(this.classHide);
62
65
  }
63
66
  else {
64
67
  this.componentShow.emit();
65
- this.classList.delete('mg-modal--hide');
68
+ this.classList.delete(this.classHide);
66
69
  }
67
70
  }
68
71
  /**
@@ -86,6 +89,9 @@ const MgModal$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
86
89
  * @returns {void}
87
90
  */
88
91
  componentWillLoad() {
92
+ // Get locales
93
+ this.messages = initLocales(this.element).messages;
94
+ // Validate
89
95
  this.hasActions = this.element.querySelector('[slot="actions"]') !== null;
90
96
  this.hasContent = this.element.querySelector('[slot="content"]') !== null;
91
97
  if (this.closeButton) {
@@ -100,7 +106,7 @@ const MgModal$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
100
106
  * @returns {HTMLElement} HTML Element
101
107
  */
102
108
  render() {
103
- return (h("section", { role: "dialog", id: this.identifier, class: this.classList.join(), tabindex: "-1", "aria-labelledby": this.titleId, "aria-modal": "true", "aria-hidden": this.hide }, h("article", { class: "mg-modal__dialog" }, h("header", { class: "mg-modal__header" }, this.closeButton && (h("mg-button", { identifier: this.closeButtonId, "is-icon": true, variant: "flat", label: messages.modal.closeButton, onClick: this.handleClose, class: "mg-modal__close-button" }, h("mg-icon", { icon: "cross" }))), h("h1", { class: "mg-modal__title", id: this.titleId }, this.modalTitle)), this.hasContent && (h("article", { class: "mg-modal__content" }, h("slot", { name: "content" }))), this.hasActions && (h("footer", { class: "mg-modal__footer" }, h("slot", { name: "actions" }))))));
109
+ return (h("section", { role: "dialog", id: this.identifier, class: this.classList.join(), tabindex: "-1", "aria-labelledby": this.titleId, "aria-modal": "true", "aria-hidden": this.hide }, h("article", { class: "mg-modal__dialog" }, h("header", { class: "mg-modal__header" }, this.closeButton && (h("span", { class: "mg-modal__close-button" }, h("mg-button", { identifier: this.closeButtonId, "is-icon": true, variant: "flat", label: this.messages.modal.closeButton, onClick: this.handleClose }, h("mg-icon", { icon: "cross" })))), h("h1", { class: "mg-modal__title", id: this.titleId }, this.modalTitle)), this.hasContent && (h("article", { class: "mg-modal__content" }, h("slot", { name: "content" }))), this.hasActions && (h("footer", { class: "mg-modal__footer" }, h("slot", { name: "actions" }))))));
104
110
  }
105
111
  get element() { return this; }
106
112
  static get watchers() { return {
@@ -1,8 +1,7 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
2
  import { c as createID } from './components.utils.js';
3
- import { m as messages } from './index2.js';
4
- import { d as defineCustomElement$7 } from './mg-button2.js';
5
- import { d as defineCustomElement$6 } from './mg-character-left2.js';
3
+ import { i as initLocales } from './index2.js';
4
+ import { d as defineCustomElement$6 } from './mg-button2.js';
6
5
  import { d as defineCustomElement$5 } from './mg-icon2.js';
7
6
  import { d as defineCustomElement$4 } from './mg-input-select2.js';
8
7
  import { d as defineCustomElement$3 } from './mg-input-title2.js';
@@ -14,7 +13,7 @@ var NavigationAction;
14
13
  NavigationAction["PREVIOUS"] = "previous";
15
14
  })(NavigationAction || (NavigationAction = {}));
16
15
 
17
- 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:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}.mg-pagination__nav mg-input-select{margin-right:0.5rem}.mg-pagination__button{display:-ms-flexbox;display:flex}.mg-pagination__button:first-of-type{margin-right:1rem}.mg-pagination__button:last-of-type{margin-left:1rem}";
16
+ 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}";
18
17
 
19
18
  /**
20
19
  * Range generator
@@ -43,19 +42,11 @@ const MgPagination$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
43
42
  this.__registerHost();
44
43
  this.__attachShadow();
45
44
  this.currentPageChange = createEvent(this, "current-page-change", 7);
46
- /**************
47
- * Decorators *
48
- **************/
49
45
  /**
50
46
  * Identifier is used for the element ID (id is a reserved prop in Stencil.js)
51
47
  * If not set, it will be created.
52
48
  */
53
49
  this.identifier = createID('mg-pagination');
54
- /**
55
- * Panignation label. Is a short description.
56
- * Customize default value can be usefull to improve accessibility
57
- */
58
- this.label = 'pagination';
59
50
  /**
60
51
  * Component total pages
61
52
  */
@@ -119,8 +110,15 @@ const MgPagination$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
119
110
  * @returns {void}
120
111
  */
121
112
  componentWillLoad() {
113
+ // Get locales
114
+ this.messages = initLocales(this.element).messages;
115
+ // Validate
122
116
  this.validateTotalPages(this.totalPages);
123
117
  this.validateCurrentPage(this.currentPage);
118
+ // Set default label
119
+ if (this.label === undefined || this.label === '') {
120
+ this.label = this.messages.pagination.label;
121
+ }
124
122
  }
125
123
  /**
126
124
  * Render
@@ -128,11 +126,12 @@ const MgPagination$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
128
126
  * @returns {HTMLElement} HTML Element
129
127
  */
130
128
  render() {
131
- const navigationActionButton = (disabled, action) => (h("mg-button", { identifier: `${this.identifier}-button-${action}`, class: "mg-pagination__button", label: messages.pagination[`${action}Page`],
129
+ const navigationActionButton = (disabled, action) => (h("mg-button", { identifier: `${this.identifier}-button-${action}`, class: "mg-pagination__button", label: this.messages.pagination[`${action}Page`],
132
130
  // eslint-disable-next-line react/jsx-no-bind
133
- onClick: () => this.handleGoToPage(action), disabled: disabled, variant: "flat" }, action === NavigationAction.PREVIOUS && h("mg-icon", { icon: "chevron-left" }), messages.general[action], action === NavigationAction.NEXT && h("mg-icon", { icon: "chevron-right" })));
134
- 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: messages.pagination.selectPage, "label-hide": true, "on-value-change": this.handleSelect, value: this.currentPage.toString(), "placeholder-hide": true }), h("span", { class: "sr-only" }, messages.pagination.page, " ", this.currentPage), h("span", null, "/ ", this.totalPages, " ", this.totalPages > 1 ? messages.pagination.pages : messages.pagination.page), navigationActionButton(this.currentPage >= this.totalPages, NavigationAction.NEXT)));
131
+ 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" })));
132
+ 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)));
135
133
  }
134
+ get element() { return this; }
136
135
  static get watchers() { return {
137
136
  "totalPages": ["validateTotalPages"],
138
137
  "currentPage": ["validateCurrentPage"]
@@ -140,7 +139,7 @@ const MgPagination$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
140
139
  static get style() { return mgPaginationCss; }
141
140
  }, [1, "mg-pagination", {
142
141
  "identifier": [1],
143
- "label": [1],
142
+ "label": [1025],
144
143
  "totalPages": [2, "total-pages"],
145
144
  "currentPage": [1538, "current-page"]
146
145
  }]);
@@ -148,7 +147,7 @@ function defineCustomElement$1() {
148
147
  if (typeof customElements === "undefined") {
149
148
  return;
150
149
  }
151
- const components = ["mg-pagination", "mg-button", "mg-character-left", "mg-icon", "mg-input-select", "mg-input-title", "mg-tooltip"];
150
+ const components = ["mg-pagination", "mg-button", "mg-icon", "mg-input-select", "mg-input-title", "mg-tooltip"];
152
151
  components.forEach(tagName => { switch (tagName) {
153
152
  case "mg-pagination":
154
153
  if (!customElements.get(tagName)) {
@@ -156,11 +155,6 @@ function defineCustomElement$1() {
156
155
  }
157
156
  break;
158
157
  case "mg-button":
159
- if (!customElements.get(tagName)) {
160
- defineCustomElement$7();
161
- }
162
- break;
163
- case "mg-character-left":
164
158
  if (!customElements.get(tagName)) {
165
159
  defineCustomElement$6();
166
160
  }
@@ -1,6 +1,6 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
2
  import { c as createID, C as ClassList } from './components.utils.js';
3
- import { m as messages } from './index2.js';
3
+ import { i as initLocales } from './index2.js';
4
4
  import { d as defineCustomElement$7 } from './mg-button2.js';
5
5
  import { d as defineCustomElement$6 } from './mg-character-left2.js';
6
6
  import { d as defineCustomElement$5 } from './mg-icon2.js';
@@ -8,7 +8,7 @@ import { d as defineCustomElement$4 } from './mg-input-text2.js';
8
8
  import { d as defineCustomElement$3 } from './mg-input-title2.js';
9
9
  import { d as defineCustomElement$2 } from './mg-tooltip2.js';
10
10
 
11
- const mgPanelCss = ".mg-panel{background-color:hsl(var(--mg-panel-background));border-radius:var(--mg-panel-border-radius);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow)}.mg-panel__header{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:justify;justify-content:space-between;padding:0 1rem 0 0.3rem;-ms-flex-align:center;align-items:center}.mg-panel__header-left,.mg-panel__header-right{display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;margin:0.3rem 0}.mg-panel__header-left mg-input-text{-ms-flex-positive:1;flex-grow:1}.mg-panel__collapse-button{font-family:var(--font-family-heading);font-size:1.4rem;font-weight:500;margin:0 0.3rem 0 0}.mg-panel__content{padding:1.5rem}.mg-panel ::slotted([slot=header-right]){display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:1rem;margin-left:auto}";
11
+ 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__header-left mg-button:not([slot=append-input]){margin:0 0.3rem 0 0}.mg-panel__header-left mg-button:not([slot=append-input])>*:first-of-type{font-family:var(--font-family-heading);font-size:1.4rem;font-weight:500}.mg-panel__content{padding:1.5rem}.mg-panel ::slotted([slot=header-right]){display:flex;flex-wrap:wrap;gap:1rem;margin-left:auto}";
12
12
 
13
13
  const MgPanel$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
14
14
  constructor() {
@@ -16,9 +16,7 @@ const MgPanel$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
16
16
  this.__registerHost();
17
17
  this.__attachShadow();
18
18
  this.titleChange = createEvent(this, "title-change", 7);
19
- /**************
20
- * Decorators *
21
- **************/
19
+ this.expandedChange = createEvent(this, "expanded-change", 7);
22
20
  /**
23
21
  * Identifier is used for the element ID (id is a reserved prop in Stencil.js)
24
22
  * If not set, it will be created.
@@ -28,6 +26,10 @@ const MgPanel$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
28
26
  * Panel is opened
29
27
  */
30
28
  this.expanded = false;
29
+ /**
30
+ * Disable possibility to toggle expand
31
+ */
32
+ this.expandToggleDisabled = false;
31
33
  /**
32
34
  * Panel title is editabled
33
35
  */
@@ -60,7 +62,9 @@ const MgPanel$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
60
62
  * @returns {void}
61
63
  */
62
64
  this.handleCollapseButton = () => {
63
- this.expanded = !this.expanded;
65
+ if (!this.expandToggleDisabled) {
66
+ this.expanded = !this.expanded;
67
+ }
64
68
  };
65
69
  /**
66
70
  * Edit button click handler
@@ -94,13 +98,12 @@ const MgPanel$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
94
98
  * @returns {void}
95
99
  */
96
100
  this.handleValidateEditButton = () => {
97
- if (this.updatedPanelTitle !== undefined)
98
- this.panelTitle = this.updatedPanelTitle;
99
- this.toggleIsEditing();
101
+ if (this.editInputElement.valid) {
102
+ if (this.updatedPanelTitle !== undefined)
103
+ this.panelTitle = this.updatedPanelTitle;
104
+ this.toggleIsEditing();
105
+ }
100
106
  };
101
- /*************
102
- * Lifecycle *
103
- *************/
104
107
  /**
105
108
  * Header left conditional render
106
109
  *
@@ -108,17 +111,17 @@ const MgPanel$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
108
111
  * @returns {HTMLMgButtonElement | HTMLElement | HTMLElement[]} header left element
109
112
  */
110
113
  this.headerLeft = () => {
111
- 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` }, h("mg-icon", { icon: this.expanded ? 'chevron-up' : 'chevron-down' }), !this.isEditing && this.panelTitle));
114
+ const collapseButton = () => (h("mg-button", { onClick: this.handleCollapseButton, variant: "flat", 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));
112
115
  if (this.titleEditable && !this.isEditing) {
113
116
  return [
114
117
  collapseButton(),
115
- h("mg-button", { "is-icon": true, variant: "secondary", label: messages.panel.editLabel, onClick: this.handleEditButton, identifier: `${this.identifier}-edit-button` }, h("mg-icon", { icon: "pen" })),
118
+ h("mg-button", { "is-icon": true, variant: "flat", label: this.messages.panel.editLabel, onClick: this.handleEditButton, identifier: `${this.identifier}-edit-button` }, h("mg-icon", { icon: "pen" })),
116
119
  ];
117
120
  }
118
121
  if (this.titleEditable && this.isEditing) {
119
122
  return [
120
123
  collapseButton(),
121
- h("mg-input-text", { label: messages.panel.editLabel, "label-hide": true, value: this.panelTitle, "onValue-change": this.handleUpdateTitle, displayCharacterLeft: false, identifier: `${this.identifier}-edition-input`, ref: el => (this.editInputElement = el) }, h("mg-button", { slot: "append-input", label: 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: messages.general.validate, "is-icon": true, variant: "secondary", onClick: this.handleValidateEditButton, identifier: `${this.identifier}-edition-button-validate` }, h("mg-icon", { icon: "check" }))),
124
+ 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" }))),
122
125
  ];
123
126
  }
124
127
  return collapseButton();
@@ -127,6 +130,31 @@ const MgPanel$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
127
130
  handelTileChange(newValue) {
128
131
  this.titleChange.emit(newValue);
129
132
  }
133
+ validatetitlePattern(newValue) {
134
+ if (newValue && !this.titleEditable) {
135
+ throw new Error('<mg-panel> prop "titleEditable" must be set to `true`.');
136
+ }
137
+ if (newValue && this.titlePatternErrorMessage === undefined) {
138
+ throw new Error('<mg-panel> prop "titlePattern" must be paired with the prop "titlePatternErrorMessage".');
139
+ }
140
+ }
141
+ handleExpanded(newValue) {
142
+ this.expandedChange.emit(newValue);
143
+ }
144
+ /*************
145
+ * Lifecycle *
146
+ *************/
147
+ /**
148
+ * Check if props are well configured on init
149
+ *
150
+ * @returns {void}
151
+ */
152
+ componentWillLoad() {
153
+ // Get locales
154
+ this.messages = initLocales(this.element).messages;
155
+ // Validate
156
+ this.validatetitlePattern(this.titlePattern);
157
+ }
130
158
  /**
131
159
  * Edit DOM after render
132
160
  *
@@ -144,16 +172,22 @@ const MgPanel$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
144
172
  * @returns {HTMLElement} html element
145
173
  */
146
174
  render() {
147
- 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.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))));
175
+ 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))));
148
176
  }
177
+ get element() { return this; }
149
178
  static get watchers() { return {
150
- "panelTitle": ["handelTileChange"]
179
+ "panelTitle": ["handelTileChange"],
180
+ "titlePattern": ["validatetitlePattern"],
181
+ "expanded": ["handleExpanded"]
151
182
  }; }
152
183
  static get style() { return mgPanelCss; }
153
184
  }, [1, "mg-panel", {
154
185
  "identifier": [1],
155
186
  "panelTitle": [1025, "panel-title"],
187
+ "titlePattern": [1025, "title-pattern"],
188
+ "titlePatternErrorMessage": [1025, "title-pattern-error-message"],
156
189
  "expanded": [1028],
190
+ "expandToggleDisabled": [1028, "expand-toggle-disabled"],
157
191
  "titleEditable": [4, "title-editable"],
158
192
  "classList": [32],
159
193
  "isEditing": [32],
@@ -1,11 +1,11 @@
1
1
  import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
2
  import { c as createID } from './components.utils.js';
3
- import { m as messages } from './index2.js';
3
+ import { i as initLocales } from './index2.js';
4
4
  import { d as defineCustomElement$3 } from './mg-button2.js';
5
5
  import { d as defineCustomElement$2 } from './mg-icon2.js';
6
6
  import { c as createPopper } from './popper.js';
7
7
 
8
- const mgPopoverCss = "mg-popover.sc-mg-popover{display:contents}mg-popover.sc-mg-popover-s>*{display:inline-block}.mg-popover.sc-mg-popover{display:none;padding:1.5rem;z-index:9999;border-radius:0.5rem;background-color:hsl(var(--mg-popover-background-color));-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);color:hsl(var(--mg-popover-font-color))}.mg-popover[data-show].sc-mg-popover{display:block}.mg-popover.sc-mg-popover mg-button.sc-mg-popover{float:right;margin-right:calc(0rem - (var(--default-size) - var(--mg-icon-regular-size)) / 2);margin-top:calc(0rem - (var(--default-size) - var(--mg-popover-title-font-size) * var(--line-height)) / 2);margin-left:3rem}.mg-popover.sc-mg-popover .mg-popover__arrow.sc-mg-popover,.mg-popover.sc-mg-popover .mg-popover__arrow.sc-mg-popover::before{position:absolute;width:2rem;height:2rem;z-index:-1;background:inherit}.mg-popover.sc-mg-popover .mg-popover__arrow.sc-mg-popover{visibility:hidden}.mg-popover.sc-mg-popover .mg-popover__arrow.sc-mg-popover::before{visibility:visible;content:\"\";-webkit-transform:rotate(45deg);transform:rotate(45deg)}.mg-popover[data-popper-placement^=top].sc-mg-popover>.mg-popover__arrow.sc-mg-popover{bottom:-6px}.mg-popover[data-popper-placement^=bottom].sc-mg-popover>.mg-popover__arrow.sc-mg-popover{top:-6px}.mg-popover[data-popper-placement^=left].sc-mg-popover>.mg-popover__arrow.sc-mg-popover{right:-6px}.mg-popover[data-popper-placement^=right].sc-mg-popover>.mg-popover__arrow.sc-mg-popover{left:-6px}.mg-popover__title.sc-mg-popover-s>*,.mg-popover__title .sc-mg-popover-s>*{margin:0 0 1rem;font-size:var(--mg-popover-title-font-size);font-weight:600}";
8
+ const mgPopoverCss = "mg-popover.sc-mg-popover{display:contents}mg-popover.sc-mg-popover-s>*{display:inline-block}.mg-popover.sc-mg-popover{display:none;padding:1.5rem;z-index:9999;border-radius:0.5rem;background-color:hsl(var(--mg-popover-background-color));box-shadow:var(--box-shadow);color:hsl(var(--mg-popover-font-color))}.mg-popover[data-show].sc-mg-popover{display:block}.mg-popover.sc-mg-popover mg-button.sc-mg-popover{float:right;margin-right:calc(0rem - (var(--default-size) - var(--mg-icon-regular-size)) / 2);margin-top:calc(0rem - (var(--default-size) - var(--mg-popover-title-font-size) * var(--line-height)) / 2);margin-left:3rem}.mg-popover.sc-mg-popover .mg-popover__arrow.sc-mg-popover,.mg-popover.sc-mg-popover .mg-popover__arrow.sc-mg-popover::before{position:absolute;width:2rem;height:2rem;z-index:-1;background:inherit}.mg-popover.sc-mg-popover .mg-popover__arrow.sc-mg-popover{visibility:hidden}.mg-popover.sc-mg-popover .mg-popover__arrow.sc-mg-popover::before{visibility:visible;content:\"\";transform:rotate(45deg)}.mg-popover[data-popper-placement^=top].sc-mg-popover>.mg-popover__arrow.sc-mg-popover{bottom:-6px}.mg-popover[data-popper-placement^=bottom].sc-mg-popover>.mg-popover__arrow.sc-mg-popover{top:-6px}.mg-popover[data-popper-placement^=left].sc-mg-popover>.mg-popover__arrow.sc-mg-popover{right:-6px}.mg-popover[data-popper-placement^=right].sc-mg-popover>.mg-popover__arrow.sc-mg-popover{left:-6px}.mg-popover__title.sc-mg-popover-s>*,.mg-popover__title .sc-mg-popover-s>*{margin:0 0 1rem;font-size:var(--mg-popover-title-font-size);font-weight:600}";
9
9
 
10
10
  const MgPopover$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
11
11
  constructor() {
@@ -39,8 +39,6 @@ const MgPopover$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
39
39
  * @param {MouseEvent} event mouse event
40
40
  * @returns {void}
41
41
  */
42
- // Unable to trigger document events in unit tests: https://gitlab.mgdis.fr/core/core-ui/mg-components/-/issues/57
43
- /* istanbul ignore next */
44
42
  this.clickOutside = (event) => {
45
43
  var _a;
46
44
  if (!this.disabled && ((_a = event.target.closest(`#${this.identifier}`)) === null || _a === void 0 ? void 0 : _a.parentElement.nodeName) !== 'MG-POPOVER') {
@@ -62,8 +60,6 @@ const MgPopover$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
62
60
  // hide when click outside
63
61
  // setTimeout is used to prevent event to trigger after creation
64
62
  setTimeout(() => {
65
- // Unable to trigger document events in unit tests: https://gitlab.mgdis.fr/core/core-ui/mg-components/-/issues/57
66
- /* istanbul ignore next */
67
63
  document.addEventListener('click', this.clickOutside, false);
68
64
  }, 0);
69
65
  };
@@ -77,7 +73,7 @@ const MgPopover$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
77
73
  this.popover.removeAttribute('data-show');
78
74
  // Disable the event listeners
79
75
  this.popper.setOptions(options => (Object.assign(Object.assign({}, options), { modifiers: [...options.modifiers, { name: 'eventListeners', enabled: false }] })));
80
- // Remove even listener
76
+ // Remove event listener
81
77
  document.removeEventListener('click', this.clickOutside, false);
82
78
  };
83
79
  /**
@@ -100,6 +96,15 @@ const MgPopover$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
100
96
  /*************
101
97
  * Lifecycle *
102
98
  *************/
99
+ /**
100
+ * Check if component props are well configured on init
101
+ *
102
+ * @returns {void} timeout
103
+ */
104
+ componentWillLoad() {
105
+ // Get locales
106
+ this.messages = initLocales(this.element).messages;
107
+ }
103
108
  /**
104
109
  * Check if component props are well configured on init
105
110
  *
@@ -153,7 +158,7 @@ const MgPopover$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
153
158
  * @returns {HTMLElement} HTML Element
154
159
  */
155
160
  render() {
156
- return (h(Host, null, h("slot", null), h("div", { id: this.identifier, class: "mg-popover" }, !this.disabled && this.closeButton && (h("mg-button", { identifier: this.closeButtonId, "is-icon": true, variant: "flat", label: messages.general.close, onClick: this.handleCloseButton }, h("mg-icon", { icon: "cross" }))), h("div", { class: "mg-popover__title" }, h("slot", { name: "title" })), h("slot", { name: "content" }), h("div", { class: "mg-popover__arrow", "data-popper-arrow": true }))));
161
+ return (h(Host, null, h("slot", null), h("div", { id: this.identifier, class: "mg-popover" }, !this.disabled && this.closeButton && (h("mg-button", { identifier: this.closeButtonId, "is-icon": true, variant: "flat", label: this.messages.general.close, onClick: this.handleCloseButton }, h("mg-icon", { icon: "cross" }))), h("div", { class: "mg-popover__title" }, h("slot", { name: "title" })), h("slot", { name: "content" }), h("div", { class: "mg-popover__arrow", "data-popper-arrow": true }))));
157
162
  }
158
163
  get element() { return this; }
159
164
  static get watchers() { return {