@mgdis/mg-components 5.28.2 → 6.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 (339) hide show
  1. package/{readme.md → README.md} +1 -1
  2. package/dist/cjs/{index-ce4f7698.js → index-08ee93bf.js} +57 -77
  3. package/dist/cjs/index-08ee93bf.js.map +1 -0
  4. package/dist/cjs/{index-792fd1c1.js → index-d57c96a9.js} +16 -15
  5. package/dist/cjs/index-d57c96a9.js.map +1 -0
  6. package/dist/cjs/loader.cjs.js +2 -2
  7. package/dist/cjs/mg-action-more_36.cjs.entry.js +622 -788
  8. package/dist/cjs/mg-action-more_36.cjs.entry.js.map +1 -1
  9. package/dist/cjs/mg-alert.cjs.entry.js +161 -0
  10. package/dist/cjs/mg-alert.cjs.entry.js.map +1 -0
  11. package/dist/cjs/mg-components.cjs.js +3 -3
  12. package/dist/cjs/mg-components.cjs.js.map +1 -1
  13. package/dist/cjs/mg-loader.cjs.entry.js +6 -6
  14. package/dist/cjs/mg-loader.cjs.entry.js.map +1 -1
  15. package/dist/collection/assets/icons/index.js +1 -1
  16. package/dist/collection/assets/icons/index.js.map +1 -1
  17. package/dist/collection/collection-manifest.json +6 -5
  18. package/dist/collection/components/atoms/{mg-character-left → internals/mg-character-left}/mg-character-left.js +9 -5
  19. package/dist/collection/components/atoms/internals/mg-character-left/mg-character-left.js.map +1 -0
  20. package/dist/collection/components/atoms/{mg-input-title → internals/mg-input-title}/mg-input-title.js +4 -4
  21. package/dist/collection/components/atoms/internals/mg-input-title/mg-input-title.js.map +1 -0
  22. package/dist/collection/components/atoms/mg-badge/mg-badge.conf.js.map +1 -1
  23. package/dist/collection/components/atoms/mg-badge/mg-badge.js +6 -6
  24. package/dist/collection/components/atoms/mg-badge/mg-badge.js.map +1 -1
  25. package/dist/collection/components/atoms/mg-button/mg-button.conf.js.map +1 -1
  26. package/dist/collection/components/atoms/mg-button/mg-button.js +4 -22
  27. package/dist/collection/components/atoms/mg-button/mg-button.js.map +1 -1
  28. package/dist/collection/components/atoms/mg-card/mg-card.js +1 -113
  29. package/dist/collection/components/atoms/mg-card/mg-card.js.map +1 -1
  30. package/dist/collection/components/atoms/mg-divider/mg-divider.js +9 -9
  31. package/dist/collection/components/atoms/mg-divider/mg-divider.js.map +1 -1
  32. package/dist/collection/components/atoms/mg-icon/mg-icon.conf.js +1 -1
  33. package/dist/collection/components/atoms/mg-icon/mg-icon.conf.js.map +1 -1
  34. package/dist/collection/components/atoms/mg-icon/mg-icon.js +11 -11
  35. package/dist/collection/components/atoms/mg-icon/mg-icon.js.map +1 -1
  36. package/dist/collection/components/atoms/mg-tag/mg-tag.conf.js.map +1 -1
  37. package/dist/collection/components/atoms/mg-tag/mg-tag.js +3 -3
  38. package/dist/collection/components/atoms/mg-tag/mg-tag.js.map +1 -1
  39. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.js +1 -1
  40. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.conf.js +6 -7
  41. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.conf.js.map +1 -1
  42. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +36 -20
  43. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js.map +1 -1
  44. package/dist/collection/components/molecules/inputs/mg-input/mg-input.conf.js +0 -9
  45. package/dist/collection/components/molecules/inputs/mg-input/mg-input.conf.js.map +1 -1
  46. package/dist/collection/components/molecules/inputs/mg-input/mg-input.js +15 -60
  47. package/dist/collection/components/molecules/inputs/mg-input/mg-input.js.map +1 -1
  48. package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js +1 -3
  49. package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js.map +1 -1
  50. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js +16 -48
  51. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js.map +1 -1
  52. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.js +5 -23
  53. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.js.map +1 -1
  54. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +128 -32
  55. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js.map +1 -1
  56. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.conf.js +1 -8
  57. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.conf.js.map +1 -1
  58. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +21 -22
  59. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js.map +1 -1
  60. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf.js +1 -8
  61. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf.js.map +1 -1
  62. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +46 -31
  63. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js.map +1 -1
  64. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +9 -9
  65. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js.map +1 -1
  66. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +27 -16
  67. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js.map +1 -1
  68. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.conf.js.map +1 -1
  69. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +13 -13
  70. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js.map +1 -1
  71. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.conf.js.map +1 -1
  72. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +72 -36
  73. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js.map +1 -1
  74. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +22 -22
  75. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js.map +1 -1
  76. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +7 -7
  77. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js.map +1 -1
  78. package/dist/collection/components/molecules/internals/mg-item-more/mg-item-more.conf.js.map +1 -0
  79. package/dist/collection/components/molecules/{mg-item-more → internals/mg-item-more}/mg-item-more.js +24 -20
  80. package/dist/collection/components/molecules/internals/mg-item-more/mg-item-more.js.map +1 -0
  81. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.conf.js +6 -7
  82. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.conf.js.map +1 -1
  83. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js +21 -16
  84. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js.map +1 -1
  85. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.conf.js +7 -16
  86. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.conf.js.map +1 -1
  87. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js +17 -17
  88. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js.map +1 -1
  89. package/dist/collection/components/molecules/mg-action-more/mg-action-more.conf.js.map +1 -1
  90. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +30 -15
  91. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js.map +1 -1
  92. package/dist/collection/components/molecules/mg-alert/mg-alert.conf.js +9 -0
  93. package/dist/collection/components/molecules/mg-alert/mg-alert.conf.js.map +1 -0
  94. package/dist/collection/components/molecules/mg-alert/mg-alert.js +270 -0
  95. package/dist/collection/components/molecules/mg-alert/mg-alert.js.map +1 -0
  96. package/dist/collection/components/molecules/mg-details/mg-details.js +3 -3
  97. package/dist/collection/components/molecules/mg-details/mg-details.js.map +1 -1
  98. package/dist/collection/components/molecules/mg-form/mg-form.js +5 -5
  99. package/dist/collection/components/molecules/mg-form/mg-form.js.map +1 -1
  100. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.conf.js +6 -0
  101. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.conf.js.map +1 -0
  102. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +16 -10
  103. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js.map +1 -1
  104. package/dist/collection/components/molecules/mg-loader/mg-loader.js +3 -3
  105. package/dist/collection/components/molecules/mg-loader/mg-loader.js.map +1 -1
  106. package/dist/collection/components/molecules/mg-message/mg-message.conf.js +5 -1
  107. package/dist/collection/components/molecules/mg-message/mg-message.conf.js.map +1 -1
  108. package/dist/collection/components/molecules/mg-message/mg-message.js +46 -230
  109. package/dist/collection/components/molecules/mg-message/mg-message.js.map +1 -1
  110. package/dist/collection/components/molecules/mg-modal/mg-modal.js +35 -121
  111. package/dist/collection/components/molecules/mg-modal/mg-modal.js.map +1 -1
  112. package/dist/collection/components/molecules/mg-pagination/mg-pagination.conf.js +4 -5
  113. package/dist/collection/components/molecules/mg-pagination/mg-pagination.conf.js.map +1 -1
  114. package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +7 -7
  115. package/dist/collection/components/molecules/mg-pagination/mg-pagination.js.map +1 -1
  116. package/dist/collection/components/molecules/mg-panel/mg-panel.js +9 -9
  117. package/dist/collection/components/molecules/mg-panel/mg-panel.js.map +1 -1
  118. package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js +2 -2
  119. package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js.map +1 -1
  120. package/dist/collection/components/molecules/mg-popover/mg-popover.js +4 -3
  121. package/dist/collection/components/molecules/mg-popover/mg-popover.js.map +1 -1
  122. package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +1 -2
  123. package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js.map +1 -1
  124. package/dist/collection/components/molecules/mg-tabs/mg-tabs.conf.js +7 -8
  125. package/dist/collection/components/molecules/mg-tabs/mg-tabs.conf.js.map +1 -1
  126. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +24 -13
  127. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js.map +1 -1
  128. package/dist/collection/locales/en/messages.json +1 -1
  129. package/dist/collection/locales/fr/messages.json +1 -1
  130. package/dist/collection/types/index.js +2 -0
  131. package/dist/collection/types/index.js.map +1 -0
  132. package/dist/collection/utils/behaviors.utils.js +8 -9
  133. package/dist/collection/utils/behaviors.utils.js.map +1 -1
  134. package/dist/collection/utils/playwright.fixture.js +3 -3
  135. package/dist/collection/utils/playwright.fixture.js.map +1 -1
  136. package/dist/components/index.es.js +7 -7
  137. package/dist/components/index.es.js.map +1 -1
  138. package/dist/components/index2.js +6 -6
  139. package/dist/components/mg-action-more.js +34 -18
  140. package/dist/components/mg-action-more.js.map +1 -1
  141. package/dist/components/mg-alert.d.ts +11 -0
  142. package/dist/components/mg-alert.js +212 -0
  143. package/dist/components/mg-alert.js.map +1 -0
  144. package/dist/components/mg-badge2.js +8 -8
  145. package/dist/components/mg-badge2.js.map +1 -1
  146. package/dist/components/mg-button2.js +7 -9
  147. package/dist/components/mg-button2.js.map +1 -1
  148. package/dist/components/mg-card2.js +3 -68
  149. package/dist/components/mg-card2.js.map +1 -1
  150. package/dist/components/mg-character-left2.js +4 -3
  151. package/dist/components/mg-character-left2.js.map +1 -1
  152. package/dist/components/mg-details.js +5 -5
  153. package/dist/components/mg-details.js.map +1 -1
  154. package/dist/components/mg-divider.js +1 -40
  155. package/dist/components/mg-divider.js.map +1 -1
  156. package/dist/components/mg-divider2.js +44 -0
  157. package/dist/components/mg-divider2.js.map +1 -0
  158. package/dist/components/mg-form.js +5 -5
  159. package/dist/components/mg-form.js.map +1 -1
  160. package/dist/components/mg-icon2.js +11 -11
  161. package/dist/components/mg-icon2.js.map +1 -1
  162. package/dist/components/mg-illustrated-message.js +6 -6
  163. package/dist/components/mg-illustrated-message.js.map +1 -1
  164. package/dist/components/mg-input-checkbox-paginated.js +1 -1
  165. package/dist/components/mg-input-checkbox-paginated2.js +16 -47
  166. package/dist/components/mg-input-checkbox-paginated2.js.map +1 -1
  167. package/dist/components/mg-input-checkbox.js +82 -33
  168. package/dist/components/mg-input-checkbox.js.map +1 -1
  169. package/dist/components/mg-input-date.js +29 -38
  170. package/dist/components/mg-input-date.js.map +1 -1
  171. package/dist/components/mg-input-numeric.js +46 -38
  172. package/dist/components/mg-input-numeric.js.map +1 -1
  173. package/dist/components/mg-input-password.js +11 -11
  174. package/dist/components/mg-input-password.js.map +1 -1
  175. package/dist/components/mg-input-radio.js +28 -16
  176. package/dist/components/mg-input-radio.js.map +1 -1
  177. package/dist/components/mg-input-select2.js +14 -14
  178. package/dist/components/mg-input-select2.js.map +1 -1
  179. package/dist/components/mg-input-text2.js +58 -29
  180. package/dist/components/mg-input-text2.js.map +1 -1
  181. package/dist/components/mg-input-textarea.js +22 -22
  182. package/dist/components/mg-input-textarea.js.map +1 -1
  183. package/dist/components/mg-input-title2.js +4 -4
  184. package/dist/components/mg-input-title2.js.map +1 -1
  185. package/dist/components/mg-input-toggle.js +9 -9
  186. package/dist/components/mg-input-toggle.js.map +1 -1
  187. package/dist/components/mg-input2.js +19 -57
  188. package/dist/components/mg-input2.js.map +1 -1
  189. package/dist/components/mg-item-more2.js +35 -31
  190. package/dist/components/mg-item-more2.js.map +1 -1
  191. package/dist/components/mg-loader.js +5 -5
  192. package/dist/components/mg-loader.js.map +1 -1
  193. package/dist/components/mg-menu-item2.js +28 -38
  194. package/dist/components/mg-menu-item2.js.map +1 -1
  195. package/dist/components/mg-message.js +1 -224
  196. package/dist/components/mg-message.js.map +1 -1
  197. package/dist/components/mg-message2.js +135 -0
  198. package/dist/components/mg-message2.js.map +1 -0
  199. package/dist/components/mg-modal.js +32 -110
  200. package/dist/components/mg-modal.js.map +1 -1
  201. package/dist/components/mg-pagination2.js +12 -13
  202. package/dist/components/mg-pagination2.js.map +1 -1
  203. package/dist/components/mg-panel.js +10 -10
  204. package/dist/components/mg-panel.js.map +1 -1
  205. package/dist/components/mg-popover-content2.js +3 -3
  206. package/dist/components/mg-popover-content2.js.map +1 -1
  207. package/dist/components/mg-popover2.js +7 -6
  208. package/dist/components/mg-popover2.js.map +1 -1
  209. package/dist/components/mg-skip-links.js +4 -4
  210. package/dist/components/mg-skip-links.js.map +1 -1
  211. package/dist/components/mg-tabs.js +32 -22
  212. package/dist/components/mg-tabs.js.map +1 -1
  213. package/dist/components/mg-tag.js +5 -5
  214. package/dist/components/mg-tag.js.map +1 -1
  215. package/dist/components/mg-tooltip-content2.js +2 -2
  216. package/dist/components/mg-tooltip-content2.js.map +1 -1
  217. package/dist/components/mg-tooltip2.js +47 -32
  218. package/dist/components/mg-tooltip2.js.map +1 -1
  219. package/dist/esm/{index-9ed65b6d.js → index-089d0323.js} +57 -78
  220. package/dist/esm/index-089d0323.js.map +1 -0
  221. package/dist/esm/{index-2667a5c4.js → index-cc97a562.js} +13 -13
  222. package/dist/esm/index-cc97a562.js.map +1 -0
  223. package/dist/esm/loader.js +3 -3
  224. package/dist/esm/mg-action-more_36.entry.js +622 -788
  225. package/dist/esm/mg-action-more_36.entry.js.map +1 -1
  226. package/dist/esm/mg-alert.entry.js +157 -0
  227. package/dist/esm/mg-alert.entry.js.map +1 -0
  228. package/dist/esm/mg-components.js +4 -4
  229. package/dist/esm/mg-components.js.map +1 -1
  230. package/dist/esm/mg-loader.entry.js +6 -6
  231. package/dist/esm/mg-loader.entry.js.map +1 -1
  232. package/dist/mg-components/locales/en/messages.json +1 -1
  233. package/dist/mg-components/locales/fr/messages.json +1 -1
  234. package/dist/mg-components/mg-components.css +1 -1
  235. package/dist/mg-components/mg-components.esm.js +1 -1
  236. package/dist/mg-components/mg-components.esm.js.map +1 -1
  237. package/dist/mg-components/p-26b67dfd.entry.js +2 -0
  238. package/dist/mg-components/p-26b67dfd.entry.js.map +1 -0
  239. package/dist/mg-components/p-2b89fe8b.entry.js +2 -0
  240. package/dist/mg-components/p-2b89fe8b.entry.js.map +1 -0
  241. package/dist/mg-components/p-48e033cf.js +3 -0
  242. package/dist/mg-components/p-48e033cf.js.map +1 -0
  243. package/dist/mg-components/p-6f5c7ec5.entry.js +2 -0
  244. package/dist/mg-components/p-6f5c7ec5.entry.js.map +1 -0
  245. package/dist/mg-components/p-898d194f.js +2 -0
  246. package/dist/mg-components/p-898d194f.js.map +1 -0
  247. package/dist/types/assets/icons/index.d.ts +0 -1
  248. package/dist/types/components/atoms/{mg-character-left → internals/mg-character-left}/mg-character-left.d.ts +3 -0
  249. package/dist/types/components/atoms/{mg-input-title → internals/mg-input-title}/mg-input-title.d.ts +1 -1
  250. package/dist/types/components/atoms/mg-badge/mg-badge.conf.d.ts +2 -1
  251. package/dist/types/components/atoms/mg-button/mg-button.conf.d.ts +2 -1
  252. package/dist/types/components/atoms/mg-button/mg-button.d.ts +0 -4
  253. package/dist/types/components/atoms/mg-card/mg-card.d.ts +0 -33
  254. package/dist/types/components/atoms/mg-divider/mg-divider.d.ts +1 -1
  255. package/dist/types/components/atoms/mg-icon/mg-icon.conf.d.ts +5 -4
  256. package/dist/types/components/atoms/mg-tag/mg-tag.conf.d.ts +2 -1
  257. package/dist/types/components/atoms/mg-tooltip/mg-tooltip.conf.d.ts +2 -6
  258. package/dist/types/components/atoms/mg-tooltip/mg-tooltip.d.ts +7 -2
  259. package/dist/types/components/molecules/inputs/mg-input/mg-input.conf.d.ts +2 -6
  260. package/dist/types/components/molecules/inputs/mg-input/mg-input.d.ts +0 -9
  261. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.d.ts +6 -13
  262. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.d.ts +4 -18
  263. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +30 -3
  264. package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.conf.d.ts +2 -7
  265. package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf.d.ts +3 -7
  266. package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +6 -1
  267. package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +5 -1
  268. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.conf.d.ts +2 -3
  269. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +1 -1
  270. package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.conf.d.ts +5 -0
  271. package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +10 -4
  272. package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +3 -3
  273. package/dist/types/components/molecules/{mg-item-more → internals/mg-item-more}/mg-item-more.conf.d.ts +2 -2
  274. package/dist/types/components/molecules/{mg-item-more → internals/mg-item-more}/mg-item-more.d.ts +3 -0
  275. package/dist/types/components/molecules/menu/mg-menu/mg-menu.conf.d.ts +9 -7
  276. package/dist/types/components/molecules/menu/mg-menu/mg-menu.d.ts +2 -3
  277. package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.conf.d.ts +5 -17
  278. package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.d.ts +4 -4
  279. package/dist/types/components/molecules/mg-action-more/mg-action-more.conf.d.ts +7 -1
  280. package/dist/types/components/molecules/mg-action-more/mg-action-more.d.ts +2 -2
  281. package/dist/types/components/molecules/mg-alert/mg-alert.conf.d.ts +17 -0
  282. package/dist/types/components/molecules/mg-alert/mg-alert.d.ts +89 -0
  283. package/dist/types/components/molecules/mg-details/mg-details.d.ts +4 -0
  284. package/dist/types/components/molecules/mg-form/mg-form.d.ts +4 -0
  285. package/dist/types/components/molecules/mg-illustrated-message/mg-illustrated-message.conf.d.ts +10 -0
  286. package/dist/types/components/molecules/mg-illustrated-message/mg-illustrated-message.d.ts +7 -1
  287. package/dist/types/components/molecules/mg-message/mg-message.conf.d.ts +11 -2
  288. package/dist/types/components/molecules/mg-message/mg-message.d.ts +11 -62
  289. package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +13 -39
  290. package/dist/types/components/molecules/mg-pagination/mg-pagination.conf.d.ts +4 -4
  291. package/dist/types/components/molecules/mg-panel/mg-panel.d.ts +4 -0
  292. package/dist/types/components/molecules/mg-tabs/mg-tabs.conf.d.ts +7 -11
  293. package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +9 -0
  294. package/dist/types/components.d.ts +165 -174
  295. package/dist/types/locales/index.d.ts +1 -1
  296. package/dist/types/types/index.d.ts +27 -0
  297. package/dist/types/utils/behaviors.utils.d.ts +5 -5
  298. package/ide/intellij/web-types.json +791 -671
  299. package/ide/vscode/css-custom-data.json +389 -0
  300. package/ide/vscode/html-custom-data.json +217 -547
  301. package/package.json +26 -23
  302. package/dist/cjs/index-792fd1c1.js.map +0 -1
  303. package/dist/cjs/index-ce4f7698.js.map +0 -1
  304. package/dist/collection/components/atoms/mg-card/mg-card.conf.js +0 -9
  305. package/dist/collection/components/atoms/mg-card/mg-card.conf.js.map +0 -1
  306. package/dist/collection/components/atoms/mg-character-left/mg-character-left.js.map +0 -1
  307. package/dist/collection/components/atoms/mg-input-title/mg-input-title.js.map +0 -1
  308. package/dist/collection/components/molecules/mg-item-more/mg-item-more.conf.js.map +0 -1
  309. package/dist/collection/components/molecules/mg-item-more/mg-item-more.js.map +0 -1
  310. package/dist/collection/fonts/OpenSans-Bold.ttf +0 -0
  311. package/dist/collection/fonts/OpenSans-Regular.ttf +0 -0
  312. package/dist/collection/fonts/OpenSans-SemiBold.ttf +0 -0
  313. package/dist/collection/styles/fonts.css +0 -1
  314. package/dist/collection/styles/global.css +0 -1
  315. package/dist/collection/styles/main.css +0 -1
  316. package/dist/collection/styles/mg-components-utils.css +0 -1
  317. package/dist/collection/styles/variables.css +0 -1
  318. package/dist/collection/variables.css +0 -1
  319. package/dist/esm/index-2667a5c4.js.map +0 -1
  320. package/dist/esm/index-9ed65b6d.js.map +0 -1
  321. package/dist/mg-components/fonts/OpenSans-Bold.ttf +0 -0
  322. package/dist/mg-components/fonts/OpenSans-Regular.ttf +0 -0
  323. package/dist/mg-components/fonts/OpenSans-SemiBold.ttf +0 -0
  324. package/dist/mg-components/p-06a9d801.js +0 -3
  325. package/dist/mg-components/p-06a9d801.js.map +0 -1
  326. package/dist/mg-components/p-56cce4ec.entry.js +0 -2
  327. package/dist/mg-components/p-56cce4ec.entry.js.map +0 -1
  328. package/dist/mg-components/p-64eaef9e.entry.js +0 -2
  329. package/dist/mg-components/p-64eaef9e.entry.js.map +0 -1
  330. package/dist/mg-components/p-7cda52b6.js +0 -2
  331. package/dist/mg-components/p-7cda52b6.js.map +0 -1
  332. package/dist/mg-components/styles/fonts.css +0 -1
  333. package/dist/mg-components/styles/global.css +0 -1
  334. package/dist/mg-components/styles/main.css +0 -1
  335. package/dist/mg-components/styles/mg-components-utils.css +0 -1
  336. package/dist/mg-components/styles/variables.css +0 -1
  337. package/dist/mg-components/variables.css +0 -1
  338. package/dist/types/components/atoms/mg-card/mg-card.conf.d.ts +0 -16
  339. /package/dist/collection/components/molecules/{mg-item-more → internals/mg-item-more}/mg-item-more.conf.js +0 -0
@@ -1,5 +1,9 @@
1
1
  /**
2
- * List of all possibles message variants
2
+ * List available variants
3
3
  */
4
4
  export const variants = ['info', 'warning', 'success', 'danger'];
5
+ /**
6
+ * List available variant styles
7
+ */
8
+ export const variantStyles = ['bar-left', 'background'];
5
9
  //# sourceMappingURL=mg-message.conf.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mg-message.conf.js","sourceRoot":"","sources":["../../../../src/components/molecules/mg-message/mg-message.conf.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAU,CAAC","sourcesContent":["/**\n * List of all possibles message variants\n */\nexport const variants = ['info', 'warning', 'success', 'danger'] as const;\n\n/**\n * Variant type\n */\nexport type VariantType = (typeof variants)[number];\n"]}
1
+ {"version":3,"file":"mg-message.conf.js","sourceRoot":"","sources":["../../../../src/components/molecules/mg-message/mg-message.conf.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAU,CAAC;AAO1E;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,UAAU,EAAE,YAAY,CAAU,CAAC","sourcesContent":["import type { Variant, VariantStyle } from '../../../types';\n\n/**\n * List available variants\n */\nexport const variants = ['info', 'warning', 'success', 'danger'] as const;\n\n/**\n * Variant type\n */\nexport type VariantType = Variant & (typeof variants)[number];\n\n/**\n * List available variant styles\n */\nexport const variantStyles = ['bar-left', 'background'] as const;\n\n/**\n * VariantStyle type\n */\nexport type VariantStyleType = VariantStyle & (typeof variantStyles)[number];\n"]}
@@ -1,8 +1,7 @@
1
1
  import { h } from "@stencil/core";
2
- import { createID, ClassList } from "@mgdis/stencil-helpers";
3
- import { variants } from "./mg-message.conf";
4
- import { initLocales } from "../../../locales";
5
- /*
2
+ import { ClassList, toString } from "@mgdis/stencil-helpers";
3
+ import { variants, variantStyles } from "./mg-message.conf";
4
+ /**
6
5
  * @slot - Message content
7
6
  * @slot actions - Actions content
8
7
  */
@@ -11,50 +10,7 @@ export class MgMessage {
11
10
  /************
12
11
  * Internal *
13
12
  ************/
14
- // Classes
15
- this.classHide = 'mg-c-message--hide';
16
- // IDs
17
- this.closeButtonId = '';
18
- // Stored timer setted when hide action is run from setTimeOut
19
- this.storedTimer = null;
20
- // Manage hover
21
- this.isFocused = false;
22
- this.isHovered = false;
23
- /**
24
- * Set timer
25
- */
26
- this.setTimer = () => {
27
- this.storedTimer = setTimeout(() => (this.hide = true), this.delay * 1000);
28
- };
29
- /**
30
- * Clear timer
31
- */
32
- this.clearTimer = () => {
33
- clearTimeout(this.storedTimer);
34
- };
35
- /**
36
- * Event to add on element
37
- * @param event - event
38
- */
39
- this.timerEvents = (event) => {
40
- this.clearTimer();
41
- const isMouseEvent = event.type === 'mouseenter';
42
- // Needed to ensure we don't start the timer
43
- this[isMouseEvent ? 'isHovered' : 'isFocused'] = true;
44
- // Restart timer when loose focus AND mouse leave
45
- this.element.addEventListener(isMouseEvent ? 'mouseleave' : 'focusout', eventOut => {
46
- this[eventOut.type === 'mouseleave' ? 'isHovered' : 'isFocused'] = false;
47
- // Start timer if needed
48
- if (!this.isFocused && !this.isHovered)
49
- this.setTimer();
50
- }, { once: true });
51
- };
52
- /**
53
- * Handle close button
54
- */
55
- this.handleClose = () => {
56
- this.hide = true;
57
- };
13
+ this.classBase = 'mg-c-message';
58
14
  /**
59
15
  * Get icon corresponding to variant
60
16
  * @returns icon
@@ -73,60 +29,31 @@ export class MgMessage {
73
29
  break;
74
30
  }
75
31
  };
76
- this.identifier = createID('mg-message');
77
- this.delay = undefined;
78
- this.variant = variants[0];
79
- this.closeButton = false;
80
- this.hide = false;
81
- this.noAriaRole = undefined;
32
+ this.variant = 'info';
33
+ this.variantStyle = 'bar-left';
82
34
  this.classCollection = new ClassList(['mg-c-message']);
83
35
  this.hasActions = false;
84
36
  }
85
- validateDelay(newValue) {
86
- if (newValue !== undefined && newValue < 2) {
87
- throw new Error(`<mg-message> prop "delay" must be greater than 2 seconds.`);
88
- }
89
- }
90
- validateVariant(newValue, oldValue) {
37
+ watchVariant(newValue, oldValue) {
91
38
  if (!variants.includes(newValue)) {
92
- throw new Error(`<mg-message> prop "variant" must be one of: ${variants.join(', ')}`);
39
+ throw new Error(`<mg-message> prop "variant" must be one of: ${variants.join(', ')}. Passed value: ${toString(newValue)}.`);
93
40
  }
94
41
  else {
95
- if (oldValue !== undefined) {
96
- this.classCollection.delete(`mg-c-message--${oldValue}`);
97
- }
98
- this.classCollection.add(`mg-c-message--${newValue}`);
42
+ if (newValue !== undefined)
43
+ this.classCollection.add(`${this.classBase}--${newValue}`);
44
+ if (oldValue !== undefined)
45
+ this.classCollection.delete(`${this.classBase}--${oldValue}`);
99
46
  }
100
47
  }
101
- validateCloseButton(newValue) {
102
- if (newValue && this.hasActions) {
103
- this.closeButton = false;
104
- throw new Error('<mg-message> prop "close-button" can\'t be used with the actions slot.');
105
- }
106
- }
107
- validateHide(newValue) {
108
- if (newValue) {
109
- this.componentHide.emit();
110
- this.classCollection.add(this.classHide);
111
- // Remove event Listener
112
- ['focusin', 'mouseenter'].forEach(event => {
113
- this.element.removeEventListener(event, this.timerEvents);
114
- });
115
- // Clear Timer
116
- this.clearTimer();
48
+ watchVariantStyle(newValue, oldValue) {
49
+ if (!variantStyles.includes(newValue)) {
50
+ throw new Error(`<mg-message> prop "variantStyle" must be one of: ${variantStyles.join(', ')}. Passed value: ${toString(newValue)}.`);
117
51
  }
118
52
  else {
119
- this.componentShow.emit();
120
- this.classCollection.delete(this.classHide);
121
- // If delay is set
122
- if (this.delay > 1) {
123
- // Start timer
124
- this.setTimer();
125
- // Stop timer when get focus or mouse enter
126
- ['focusin', 'mouseenter'].forEach(event => {
127
- this.element.addEventListener(event, this.timerEvents);
128
- });
129
- }
53
+ if (newValue !== undefined)
54
+ this.classCollection.add(`${this.classBase}--${newValue}`);
55
+ if (oldValue !== undefined)
56
+ this.classCollection.delete(`${this.classBase}--${oldValue}`);
130
57
  }
131
58
  }
132
59
  /*************
@@ -136,29 +63,21 @@ export class MgMessage {
136
63
  * Check if component props are well configured on init
137
64
  */
138
65
  componentWillLoad() {
139
- // Get locales
140
- this.messages = initLocales(this.element).messages;
141
66
  // Validate
142
- this.validateVariant(this.variant);
143
- // Check if close button is an can be activated
67
+ this.watchVariant(this.variant);
68
+ this.watchVariantStyle(this.variantStyle);
69
+ // Check if component has actions slot
144
70
  this.hasActions = this.element.querySelector('[slot="actions"]') !== null;
145
- this.validateCloseButton(this.closeButton);
146
- if (this.closeButton) {
147
- this.classCollection.add('mg-c-message--close-button');
148
- this.closeButtonId = `${this.identifier}-close-button`;
149
- }
150
- this.validateDelay(this.delay);
151
- this.validateHide(this.hide);
152
71
  }
153
72
  /**
154
73
  * Render
155
74
  * @returns HTML Element
156
75
  */
157
76
  render() {
158
- let role;
159
- if (!this.noAriaRole)
160
- role = this.variant === 'info' ? 'status' : 'alert';
161
- return (h("div", { key: 'a30da97a75717852677dc66ba0e9bc0a000c8c35', id: this.identifier, class: this.classCollection.join(), role: role }, h("mg-card", { key: '9cea0e509146e245a91290e76bc3908fcf3e3806', variant: this.variant, "variant-style": "bar-left" }, h("span", { key: '0beb527b84230d6cafed7ac1d2c9caa59ad1f80f', class: "mg-c-message__icon" }, h("mg-icon", { key: 'e0346db73f7c2c4595bb09e1be93039763106a5d', icon: this.getIcon() })), h("div", { key: '128567f70f2d664688cf012ab995a57eea2bca17', class: "mg-c-message__content" }, h("span", { key: '2b1cc03309002908b6c54b95c6ad58bdc966e787', class: "mg-c-message__content-slot" }, h("slot", { key: 'fd7b3e74c3bd2a70d2cbbef0a9519cdee38da5ce' })), this.hasActions && h("span", { key: 'adb6d3b819226a5e6173f077650be05c64e69f13', class: "mg-c-message__content-separator" }), this.hasActions && (h("span", { key: '136b8a00d7b0dbb14750d7637bce7d83d8cfd112', class: "mg-c-message__content-actions-slot" }, h("slot", { key: '926939a26ee3fa4e3b4625cdc4003dccc9d2e2e3', name: "actions" })))), this.closeButton && (h("span", { key: '770a2313622d50f5dc027d65b878e2955a134ca3', class: "mg-c-message__close-button" }, h("mg-button", { key: '094652edc8aa518cb3c0322025b5bf5c66b3fa33', identifier: this.closeButtonId, "is-icon": true, variant: "flat", label: this.messages.message.closeButton, onClick: this.handleClose }, h("mg-icon", { key: '2b0ee538aec157e9507bf3c14026e71c422fc365', icon: "cross" })))))));
77
+ return (h("div", { key: '9ce1d7b25bf12d974a7b0b296d9d71b9b2c984e1', class: this.classCollection.join() }, h("mg-card", { key: '7c7c1d5891d988adc7c5090b02d809aab32565f8' }, this.variantStyle === 'bar-left' && h("span", { key: 'd6c291fcf93ab6e84ba0288a1a0c4ec405b57e78', class: "mg-c-message__bar" }), h("span", { key: 'afc3dcf95dbf4ee96ca1041c54c0d4c37d435601', class: "mg-c-message__icon" }, h("mg-icon", { key: 'd9b79cb3be22fedee6a04cf43c72641202cc80f7', icon: this.getIcon() })), h("div", { key: 'f70d488459d28a464a3714b122b7a708c3562741', class: "mg-c-message__content" }, h("span", { key: 'd24b0ed1c326cb04bc7944f0c4f1fe19efa3fc9c', class: "mg-c-message__content-slot" }, h("slot", { key: 'bb491533bc09600c04699d561c7af608ee1567e5' })), this.hasActions && [
78
+ h("span", { class: "mg-c-message__content-separator", key: "content-separator" }),
79
+ h("span", { class: "mg-c-message__content-actions-slot", key: "content-actions-slot" }, h("slot", { key: '43547919e1ec8b34f23ea1ad5e75d5b0da23c831', name: "actions" })),
80
+ ]))));
162
81
  }
163
82
  static get is() { return "mg-message"; }
164
83
  static get encapsulation() { return "shadow"; }
@@ -174,41 +93,6 @@ export class MgMessage {
174
93
  }
175
94
  static get properties() {
176
95
  return {
177
- "identifier": {
178
- "type": "string",
179
- "mutable": false,
180
- "complexType": {
181
- "original": "string",
182
- "resolved": "string",
183
- "references": {}
184
- },
185
- "required": false,
186
- "optional": false,
187
- "docs": {
188
- "tags": [],
189
- "text": "Identifier is used for the element ID (id is a reserved prop in Stencil.js)\nIf not set, it will be created."
190
- },
191
- "attribute": "identifier",
192
- "reflect": false,
193
- "defaultValue": "createID('mg-message')"
194
- },
195
- "delay": {
196
- "type": "number",
197
- "mutable": false,
198
- "complexType": {
199
- "original": "number",
200
- "resolved": "number",
201
- "references": {}
202
- },
203
- "required": false,
204
- "optional": true,
205
- "docs": {
206
- "tags": [],
207
- "text": "Add a delay to hide/close message when it passed\nValue is defined in seconds and must greater than 2 seconds (PDA9-314 RG-06)"
208
- },
209
- "attribute": "delay",
210
- "reflect": false
211
- },
212
96
  "variant": {
213
97
  "type": "string",
214
98
  "mutable": false,
@@ -227,64 +111,35 @@ export class MgMessage {
227
111
  "optional": false,
228
112
  "docs": {
229
113
  "tags": [],
230
- "text": "Message variant"
114
+ "text": "Define variant"
231
115
  },
232
116
  "attribute": "variant",
233
117
  "reflect": false,
234
- "defaultValue": "variants[0]"
118
+ "defaultValue": "'info'"
235
119
  },
236
- "closeButton": {
237
- "type": "boolean",
238
- "mutable": true,
239
- "complexType": {
240
- "original": "boolean",
241
- "resolved": "boolean",
242
- "references": {}
243
- },
244
- "required": false,
245
- "optional": false,
246
- "docs": {
247
- "tags": [],
248
- "text": "Define if message has a cross button\nRG 01: https://jira.mgdis.fr/browse/PDA9-140"
249
- },
250
- "attribute": "close-button",
251
- "reflect": false,
252
- "defaultValue": "false"
253
- },
254
- "hide": {
255
- "type": "boolean",
256
- "mutable": true,
120
+ "variantStyle": {
121
+ "type": "string",
122
+ "mutable": false,
257
123
  "complexType": {
258
- "original": "boolean",
259
- "resolved": "boolean",
260
- "references": {}
124
+ "original": "VariantStyleType",
125
+ "resolved": "\"background\" | \"bar-left\"",
126
+ "references": {
127
+ "VariantStyleType": {
128
+ "location": "import",
129
+ "path": "./mg-message.conf",
130
+ "id": "src/components/molecules/mg-message/mg-message.conf.ts::VariantStyleType"
131
+ }
132
+ }
261
133
  },
262
134
  "required": false,
263
135
  "optional": false,
264
136
  "docs": {
265
137
  "tags": [],
266
- "text": "Define if message is hidden"
138
+ "text": "Define variant style"
267
139
  },
268
- "attribute": "hide",
140
+ "attribute": "variant-style",
269
141
  "reflect": false,
270
- "defaultValue": "false"
271
- },
272
- "noAriaRole": {
273
- "type": "boolean",
274
- "mutable": false,
275
- "complexType": {
276
- "original": "boolean",
277
- "resolved": "boolean",
278
- "references": {}
279
- },
280
- "required": false,
281
- "optional": true,
282
- "docs": {
283
- "tags": [],
284
- "text": "Define if aria role is unset\nFor a11y reasons, `<mg-message />` was design for `alert` needs with attached semantic role: `status`, `alert`.\nBy toggle this props to `true`, you can unset the role to benefit from the template without any semantic role.\nBe careful to set the mode according to the context needs."
285
- },
286
- "attribute": "no-aria-role",
287
- "reflect": false
142
+ "defaultValue": "'bar-left'"
288
143
  }
289
144
  };
290
145
  }
@@ -294,53 +149,14 @@ export class MgMessage {
294
149
  "hasActions": {}
295
150
  };
296
151
  }
297
- static get events() {
298
- return [{
299
- "method": "componentShow",
300
- "name": "component-show",
301
- "bubbles": true,
302
- "cancelable": true,
303
- "composed": true,
304
- "docs": {
305
- "tags": [],
306
- "text": "Emited event when message is diplayed"
307
- },
308
- "complexType": {
309
- "original": "void",
310
- "resolved": "void",
311
- "references": {}
312
- }
313
- }, {
314
- "method": "componentHide",
315
- "name": "component-hide",
316
- "bubbles": true,
317
- "cancelable": true,
318
- "composed": true,
319
- "docs": {
320
- "tags": [],
321
- "text": "Emited event when message is hidden"
322
- },
323
- "complexType": {
324
- "original": "void",
325
- "resolved": "void",
326
- "references": {}
327
- }
328
- }];
329
- }
330
152
  static get elementRef() { return "element"; }
331
153
  static get watchers() {
332
154
  return [{
333
- "propName": "delay",
334
- "methodName": "validateDelay"
335
- }, {
336
155
  "propName": "variant",
337
- "methodName": "validateVariant"
338
- }, {
339
- "propName": "closeButton",
340
- "methodName": "validateCloseButton"
156
+ "methodName": "watchVariant"
341
157
  }, {
342
- "propName": "hide",
343
- "methodName": "validateHide"
158
+ "propName": "variantStyle",
159
+ "methodName": "watchVariantStyle"
344
160
  }];
345
161
  }
346
162
  }
@@ -1 +1 @@
1
- {"version":3,"file":"mg-message.js","sourceRoot":"","sources":["../../../../src/components/molecules/mg-message/mg-message.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC/F,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAe,MAAM,mBAAmB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AAuB;oBAChC,6DAAM,KAAK,EAAC,4BAA4B;wBACtC,8DAAa,CACR;oBACN,IAAI,CAAC,UAAU,IAAI,6DAAM,KAAK,EAAC,iCAAiC,GAAQ;oBACxE,IAAI,CAAC,UAAU,IAAI,CAClB,6DAAM,KAAK,EAAC,oCAAoC;wBAC9C,6DAAM,IAAI,EAAC,SAAS,GAAQ,CACvB,CACR,CACG;gBACL,IAAI,CAAC,WAAW,IAAI,CACnB,6DAAM,KAAK,EAAC,4BAA4B;oBACtC,kEAAW,UAAU,EAAE,IAAI,CAAC,aAAa,mBAAU,OAAO,EAAC,MAAM,EAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,EAAE,OAAO,EAAE,IAAI,CAAC,WAAW;wBACnI,gEAAS,IAAI,EAAC,OAAO,GAAW,CACtB,CACP,CACR,CACO,CACN,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Prop, State, Watch } from '@stencil/core';\nimport { createID, ClassList } from '@mgdis/stencil-helpers';\nimport { variants, VariantType } from './mg-message.conf';\nimport { initLocales } from '../../../locales';\nimport { type MgIcon } from '../../atoms/mg-icon/mg-icon';\n\n/*\n * @slot - Message content\n * @slot actions - Actions content\n */\n@Component({\n tag: 'mg-message',\n styleUrl: '../../../../node_modules/@mgdis/styles/dist/components/mg-message.css',\n shadow: true,\n})\nexport class MgMessage {\n /************\n * Internal *\n ************/\n\n // Classes\n private readonly classHide = 'mg-c-message--hide';\n\n // IDs\n private closeButtonId = '';\n\n // Stored timer setted when hide action is run from setTimeOut\n private storedTimer: ReturnType<typeof setTimeout> = null;\n\n // Manage hover\n private isFocused = false;\n private isHovered = false;\n\n // Locales\n private messages;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgMessageElement;\n\n /**\n * Identifier is used for the element ID (id is a reserved prop in Stencil.js)\n * If not set, it will be created.\n */\n @Prop() identifier: string = createID('mg-message');\n\n /**\n * Add a delay to hide/close message when it passed\n * Value is defined in seconds and must greater than 2 seconds (PDA9-314 RG-06)\n */\n @Prop() delay?: number;\n @Watch('delay')\n validateDelay(newValue: MgMessage['delay']): void {\n if (newValue !== undefined && newValue < 2) {\n throw new Error(`<mg-message> prop \"delay\" must be greater than 2 seconds.`);\n }\n }\n\n /**\n * Message variant\n */\n @Prop() variant: VariantType = variants[0]; // info\n @Watch('variant')\n validateVariant(newValue: MgMessage['variant'], oldValue?: MgMessage['variant']): void {\n if (!variants.includes(newValue)) {\n throw new Error(`<mg-message> prop \"variant\" must be one of: ${variants.join(', ')}`);\n } else {\n if (oldValue !== undefined) {\n this.classCollection.delete(`mg-c-message--${oldValue}`);\n }\n this.classCollection.add(`mg-c-message--${newValue}`);\n }\n }\n\n /**\n * Define if message has a cross button\n * RG 01: https://jira.mgdis.fr/browse/PDA9-140\n */\n @Prop({ mutable: true }) closeButton = false;\n @Watch('closeButton')\n validateCloseButton(newValue: MgMessage['closeButton']): void {\n if (newValue && this.hasActions) {\n this.closeButton = false;\n throw new Error('<mg-message> prop \"close-button\" can\\'t be used with the actions slot.');\n }\n }\n\n /**\n * Define if message is hidden\n */\n @Prop({ mutable: true }) hide = false;\n @Watch('hide')\n validateHide(newValue: MgMessage['hide']): void {\n if (newValue) {\n this.componentHide.emit();\n this.classCollection.add(this.classHide);\n // Remove event Listener\n ['focusin', 'mouseenter'].forEach(event => {\n this.element.removeEventListener(event, this.timerEvents);\n });\n // Clear Timer\n this.clearTimer();\n } else {\n this.componentShow.emit();\n this.classCollection.delete(this.classHide);\n // If delay is set\n if (this.delay > 1) {\n // Start timer\n this.setTimer();\n // Stop timer when get focus or mouse enter\n ['focusin', 'mouseenter'].forEach(event => {\n this.element.addEventListener(event, this.timerEvents);\n });\n }\n }\n }\n\n /**\n * Define if aria role is unset\n * For a11y reasons, `<mg-message />` was design for `alert` needs with attached semantic role: `status`, `alert`.\n * By toggle this props to `true`, you can unset the role to benefit from the template without any semantic role.\n * Be careful to set the mode according to the context needs.\n */\n @Prop() noAriaRole?: boolean;\n\n /**\n * Component classes\n */\n @State() classCollection: ClassList = new ClassList(['mg-c-message']);\n\n /**\n * Define if component is using actions slot\n */\n @State() hasActions = false;\n\n /**\n * Emited event when message is diplayed\n */\n @Event({ eventName: 'component-show' }) componentShow: EventEmitter<void>;\n\n /**\n * Emited event when message is hidden\n */\n @Event({ eventName: 'component-hide' }) componentHide: EventEmitter<void>;\n\n /**\n * Set timer\n */\n private setTimer = (): void => {\n this.storedTimer = setTimeout(() => (this.hide = true), this.delay * 1000);\n };\n\n /**\n * Clear timer\n */\n private clearTimer = (): void => {\n clearTimeout(this.storedTimer);\n };\n\n /**\n * Event to add on element\n * @param event - event\n */\n private timerEvents = (event: MouseEvent | FocusEvent): void => {\n this.clearTimer();\n const isMouseEvent: boolean = event.type === 'mouseenter';\n // Needed to ensure we don't start the timer\n this[isMouseEvent ? 'isHovered' : 'isFocused'] = true;\n\n // Restart timer when loose focus AND mouse leave\n this.element.addEventListener(\n isMouseEvent ? 'mouseleave' : 'focusout',\n eventOut => {\n this[eventOut.type === 'mouseleave' ? 'isHovered' : 'isFocused'] = false;\n // Start timer if needed\n if (!this.isFocused && !this.isHovered) this.setTimer();\n },\n { once: true },\n );\n };\n\n /**\n * Handle close button\n */\n private handleClose = (): void => {\n this.hide = true;\n };\n\n /**\n * Get icon corresponding to variant\n * @returns icon\n */\n private getIcon = (): MgIcon['icon'] => {\n switch (this.variant) {\n case 'info':\n return 'info-circle';\n case 'warning':\n return 'exclamation-triangle';\n case 'success':\n return 'check-circle';\n case 'danger':\n return 'exclamation-circle';\n default:\n break;\n }\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Check if component props are well configured on init\n */\n componentWillLoad(): void {\n // Get locales\n this.messages = initLocales(this.element).messages;\n // Validate\n this.validateVariant(this.variant);\n // Check if close button is an can be activated\n this.hasActions = this.element.querySelector('[slot=\"actions\"]') !== null;\n this.validateCloseButton(this.closeButton);\n if (this.closeButton) {\n this.classCollection.add('mg-c-message--close-button');\n this.closeButtonId = `${this.identifier}-close-button`;\n }\n this.validateDelay(this.delay);\n this.validateHide(this.hide);\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n let role;\n\n if (!this.noAriaRole) role = this.variant === 'info' ? 'status' : 'alert';\n\n return (\n <div id={this.identifier} class={this.classCollection.join()} role={role}>\n <mg-card variant={this.variant} variant-style=\"bar-left\">\n <span class=\"mg-c-message__icon\">\n <mg-icon icon={this.getIcon()}></mg-icon>\n </span>\n <div class=\"mg-c-message__content\">\n <span class=\"mg-c-message__content-slot\">\n <slot></slot>\n </span>\n {this.hasActions && <span class=\"mg-c-message__content-separator\"></span>}\n {this.hasActions && (\n <span class=\"mg-c-message__content-actions-slot\">\n <slot name=\"actions\"></slot>\n </span>\n )}\n </div>\n {this.closeButton && (\n <span class=\"mg-c-message__close-button\">\n <mg-button identifier={this.closeButtonId} is-icon variant=\"flat\" label={this.messages.message.closeButton} onClick={this.handleClose}>\n <mg-icon icon=\"cross\"></mg-icon>\n </mg-button>\n </span>\n )}\n </mg-card>\n </div>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"mg-message.js","sourceRoot":"","sources":["../../../../src/components/molecules/mg-message/mg-message.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAi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AC,SAAS,GAAQ,CACvB;qBACR,CACG,CACE,CACN,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, h, Prop, State, Watch } from '@stencil/core';\nimport { ClassList, toString } from '@mgdis/stencil-helpers';\nimport { variants, variantStyles, VariantStyleType, VariantType } from './mg-message.conf';\nimport { type MgIcon } from '../../atoms/mg-icon/mg-icon';\n\n/**\n * @slot - Message content\n * @slot actions - Actions content\n */\n@Component({\n tag: 'mg-message',\n styleUrl: '../../../../node_modules/@mgdis/styles/dist/components/mg-message.css',\n shadow: true,\n})\nexport class MgMessage {\n /************\n * Internal *\n ************/\n\n private readonly classBase = 'mg-c-message';\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgMessageElement;\n\n /**\n * Define variant\n */\n @Prop() variant: VariantType = 'info';\n @Watch('variant')\n watchVariant(newValue: MgMessage['variant'], oldValue?: MgMessage['variant']): void {\n if (!variants.includes(newValue)) {\n throw new Error(`<mg-message> prop \"variant\" must be one of: ${variants.join(', ')}. Passed value: ${toString(newValue)}.`);\n } else {\n if (newValue !== undefined) this.classCollection.add(`${this.classBase}--${newValue}`);\n if (oldValue !== undefined) this.classCollection.delete(`${this.classBase}--${oldValue}`);\n }\n }\n\n /**\n * Define variant style\n */\n @Prop() variantStyle: VariantStyleType = 'bar-left';\n @Watch('variantStyle')\n watchVariantStyle(newValue: MgMessage['variantStyle'], oldValue?: MgMessage['variantStyle']): void {\n if (!variantStyles.includes(newValue)) {\n throw new Error(`<mg-message> prop \"variantStyle\" must be one of: ${variantStyles.join(', ')}. Passed value: ${toString(newValue)}.`);\n } else {\n if (newValue !== undefined) this.classCollection.add(`${this.classBase}--${newValue}`);\n if (oldValue !== undefined) this.classCollection.delete(`${this.classBase}--${oldValue}`);\n }\n }\n\n /**\n * Component classes\n */\n @State() classCollection: ClassList = new ClassList(['mg-c-message']);\n\n /**\n * Define if component is using actions slot\n */\n @State() hasActions = false;\n\n /**\n * Get icon corresponding to variant\n * @returns icon\n */\n private getIcon = (): MgIcon['icon'] => {\n switch (this.variant) {\n case 'info':\n return 'info-circle';\n case 'warning':\n return 'exclamation-triangle';\n case 'success':\n return 'check-circle';\n case 'danger':\n return 'exclamation-circle';\n default:\n break;\n }\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Check if component props are well configured on init\n */\n componentWillLoad(): void {\n // Validate\n this.watchVariant(this.variant);\n this.watchVariantStyle(this.variantStyle);\n // Check if component has actions slot\n this.hasActions = this.element.querySelector('[slot=\"actions\"]') !== null;\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <div class={this.classCollection.join()}>\n <mg-card>\n {this.variantStyle === 'bar-left' && <span class=\"mg-c-message__bar\"></span>}\n <span class=\"mg-c-message__icon\">\n <mg-icon icon={this.getIcon()}></mg-icon>\n </span>\n <div class=\"mg-c-message__content\">\n <span class=\"mg-c-message__content-slot\">\n <slot></slot>\n </span>\n {this.hasActions && [\n <span class=\"mg-c-message__content-separator\" key=\"content-separator\"></span>,\n <span class=\"mg-c-message__content-actions-slot\" key=\"content-actions-slot\">\n <slot name=\"actions\"></slot>\n </span>,\n ]}\n </div>\n </mg-card>\n </div>\n );\n }\n}\n"]}