@mgdis/mg-components 5.29.0 → 6.1.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 (337) hide show
  1. package/{readme.md → README.md} +1 -1
  2. package/dist/cjs/{index-e1a25816.js → index-0fe2670c.js} +31 -29
  3. package/dist/cjs/index-0fe2670c.js.map +1 -0
  4. package/dist/cjs/{index-8a3adbd1.js → index-e4a8bf81.js} +26 -73
  5. package/dist/cjs/index-e4a8bf81.js.map +1 -0
  6. package/dist/cjs/loader.cjs.js +2 -2
  7. package/dist/cjs/mg-action-more_36.cjs.entry.js +732 -839
  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 +18 -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 +8 -5
  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 +44 -23
  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 +27 -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/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js +16 -48
  49. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js.map +1 -1
  50. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.js +5 -23
  51. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.js.map +1 -1
  52. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +127 -30
  53. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js.map +1 -1
  54. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.conf.js +1 -8
  55. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.conf.js.map +1 -1
  56. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +20 -21
  57. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js.map +1 -1
  58. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf.js +1 -8
  59. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf.js.map +1 -1
  60. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +45 -30
  61. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js.map +1 -1
  62. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +8 -8
  63. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js.map +1 -1
  64. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +11 -11
  65. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js.map +1 -1
  66. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.conf.js.map +1 -1
  67. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +12 -12
  68. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js.map +1 -1
  69. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.conf.js.map +1 -1
  70. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +71 -35
  71. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js.map +1 -1
  72. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +21 -21
  73. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js.map +1 -1
  74. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +7 -7
  75. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js.map +1 -1
  76. package/dist/collection/components/molecules/internals/mg-item-more/mg-item-more.conf.js.map +1 -0
  77. package/dist/collection/components/molecules/{mg-item-more → internals/mg-item-more}/mg-item-more.js +29 -25
  78. package/dist/collection/components/molecules/internals/mg-item-more/mg-item-more.js.map +1 -0
  79. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.conf.js +6 -7
  80. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.conf.js.map +1 -1
  81. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js +21 -16
  82. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js.map +1 -1
  83. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.conf.js +7 -16
  84. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.conf.js.map +1 -1
  85. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js +27 -18
  86. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js.map +1 -1
  87. package/dist/collection/components/molecules/mg-action-more/mg-action-more.conf.js.map +1 -1
  88. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +31 -16
  89. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js.map +1 -1
  90. package/dist/collection/components/molecules/mg-alert/mg-alert.conf.js +9 -0
  91. package/dist/collection/components/molecules/mg-alert/mg-alert.conf.js.map +1 -0
  92. package/dist/collection/components/molecules/mg-alert/mg-alert.js +270 -0
  93. package/dist/collection/components/molecules/mg-alert/mg-alert.js.map +1 -0
  94. package/dist/collection/components/molecules/mg-details/mg-details.js +3 -3
  95. package/dist/collection/components/molecules/mg-details/mg-details.js.map +1 -1
  96. package/dist/collection/components/molecules/mg-form/mg-form.js +14 -5
  97. package/dist/collection/components/molecules/mg-form/mg-form.js.map +1 -1
  98. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.conf.js +6 -0
  99. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.conf.js.map +1 -0
  100. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +16 -10
  101. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js.map +1 -1
  102. package/dist/collection/components/molecules/mg-loader/mg-loader.js +3 -3
  103. package/dist/collection/components/molecules/mg-loader/mg-loader.js.map +1 -1
  104. package/dist/collection/components/molecules/mg-message/mg-message.conf.js +5 -1
  105. package/dist/collection/components/molecules/mg-message/mg-message.conf.js.map +1 -1
  106. package/dist/collection/components/molecules/mg-message/mg-message.js +46 -230
  107. package/dist/collection/components/molecules/mg-message/mg-message.js.map +1 -1
  108. package/dist/collection/components/molecules/mg-modal/mg-modal.js +44 -121
  109. package/dist/collection/components/molecules/mg-modal/mg-modal.js.map +1 -1
  110. package/dist/collection/components/molecules/mg-pagination/mg-pagination.conf.js +4 -5
  111. package/dist/collection/components/molecules/mg-pagination/mg-pagination.conf.js.map +1 -1
  112. package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +16 -7
  113. package/dist/collection/components/molecules/mg-pagination/mg-pagination.js.map +1 -1
  114. package/dist/collection/components/molecules/mg-panel/mg-panel.js +18 -9
  115. package/dist/collection/components/molecules/mg-panel/mg-panel.js.map +1 -1
  116. package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js +2 -2
  117. package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js.map +1 -1
  118. package/dist/collection/components/molecules/mg-popover/mg-popover.js +13 -7
  119. package/dist/collection/components/molecules/mg-popover/mg-popover.js.map +1 -1
  120. package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +1 -1
  121. package/dist/collection/components/molecules/mg-tabs/mg-tabs.conf.js +7 -8
  122. package/dist/collection/components/molecules/mg-tabs/mg-tabs.conf.js.map +1 -1
  123. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +33 -13
  124. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js.map +1 -1
  125. package/dist/collection/locales/en/messages.json +1 -1
  126. package/dist/collection/locales/fr/messages.json +1 -1
  127. package/dist/collection/types/index.js +2 -0
  128. package/dist/collection/types/index.js.map +1 -0
  129. package/dist/collection/utils/behaviors.utils.js +8 -9
  130. package/dist/collection/utils/behaviors.utils.js.map +1 -1
  131. package/dist/collection/utils/playwright.fixture.js +3 -3
  132. package/dist/collection/utils/playwright.fixture.js.map +1 -1
  133. package/dist/components/index.es.js +20 -20
  134. package/dist/components/index.es.js.map +1 -1
  135. package/dist/components/index2.js +6 -6
  136. package/dist/components/mg-action-more.js +36 -20
  137. package/dist/components/mg-action-more.js.map +1 -1
  138. package/dist/components/mg-alert.d.ts +11 -0
  139. package/dist/components/mg-alert.js +212 -0
  140. package/dist/components/mg-alert.js.map +1 -0
  141. package/dist/components/mg-badge2.js +9 -9
  142. package/dist/components/mg-badge2.js.map +1 -1
  143. package/dist/components/mg-button2.js +8 -10
  144. package/dist/components/mg-button2.js.map +1 -1
  145. package/dist/components/mg-card2.js +3 -68
  146. package/dist/components/mg-card2.js.map +1 -1
  147. package/dist/components/mg-character-left2.js +12 -3
  148. package/dist/components/mg-character-left2.js.map +1 -1
  149. package/dist/components/mg-details.js +5 -5
  150. package/dist/components/mg-details.js.map +1 -1
  151. package/dist/components/mg-divider.js +1 -40
  152. package/dist/components/mg-divider.js.map +1 -1
  153. package/dist/components/mg-divider2.js +44 -0
  154. package/dist/components/mg-divider2.js.map +1 -0
  155. package/dist/components/mg-form.js +15 -7
  156. package/dist/components/mg-form.js.map +1 -1
  157. package/dist/components/mg-icon2.js +12 -12
  158. package/dist/components/mg-icon2.js.map +1 -1
  159. package/dist/components/mg-illustrated-message.js +8 -8
  160. package/dist/components/mg-illustrated-message.js.map +1 -1
  161. package/dist/components/mg-input-checkbox-paginated.js +1 -1
  162. package/dist/components/mg-input-checkbox-paginated2.js +15 -44
  163. package/dist/components/mg-input-checkbox-paginated2.js.map +1 -1
  164. package/dist/components/mg-input-checkbox.js +83 -34
  165. package/dist/components/mg-input-checkbox.js.map +1 -1
  166. package/dist/components/mg-input-date.js +30 -39
  167. package/dist/components/mg-input-date.js.map +1 -1
  168. package/dist/components/mg-input-numeric.js +47 -39
  169. package/dist/components/mg-input-numeric.js.map +1 -1
  170. package/dist/components/mg-input-password.js +12 -12
  171. package/dist/components/mg-input-password.js.map +1 -1
  172. package/dist/components/mg-input-radio.js +16 -16
  173. package/dist/components/mg-input-radio.js.map +1 -1
  174. package/dist/components/mg-input-select2.js +18 -18
  175. package/dist/components/mg-input-select2.js.map +1 -1
  176. package/dist/components/mg-input-text2.js +61 -32
  177. package/dist/components/mg-input-text2.js.map +1 -1
  178. package/dist/components/mg-input-textarea.js +25 -25
  179. package/dist/components/mg-input-textarea.js.map +1 -1
  180. package/dist/components/mg-input-title2.js +7 -4
  181. package/dist/components/mg-input-title2.js.map +1 -1
  182. package/dist/components/mg-input-toggle.js +11 -11
  183. package/dist/components/mg-input-toggle.js.map +1 -1
  184. package/dist/components/mg-input2.js +30 -59
  185. package/dist/components/mg-input2.js.map +1 -1
  186. package/dist/components/mg-item-more2.js +40 -36
  187. package/dist/components/mg-item-more2.js.map +1 -1
  188. package/dist/components/mg-loader.js +5 -5
  189. package/dist/components/mg-loader.js.map +1 -1
  190. package/dist/components/mg-menu-item2.js +39 -41
  191. package/dist/components/mg-menu-item2.js.map +1 -1
  192. package/dist/components/mg-message.js +1 -224
  193. package/dist/components/mg-message.js.map +1 -1
  194. package/dist/components/mg-message2.js +135 -0
  195. package/dist/components/mg-message2.js.map +1 -0
  196. package/dist/components/mg-modal.js +42 -112
  197. package/dist/components/mg-modal.js.map +1 -1
  198. package/dist/components/mg-pagination2.js +21 -14
  199. package/dist/components/mg-pagination2.js.map +1 -1
  200. package/dist/components/mg-panel.js +20 -12
  201. package/dist/components/mg-panel.js.map +1 -1
  202. package/dist/components/mg-popover-content2.js +6 -6
  203. package/dist/components/mg-popover-content2.js.map +1 -1
  204. package/dist/components/mg-popover2.js +16 -10
  205. package/dist/components/mg-popover2.js.map +1 -1
  206. package/dist/components/mg-skip-links.js +4 -4
  207. package/dist/components/mg-skip-links.js.map +1 -1
  208. package/dist/components/mg-tabs.js +43 -25
  209. package/dist/components/mg-tabs.js.map +1 -1
  210. package/dist/components/mg-tag.js +6 -6
  211. package/dist/components/mg-tag.js.map +1 -1
  212. package/dist/components/mg-tooltip-content2.js +2 -2
  213. package/dist/components/mg-tooltip-content2.js.map +1 -1
  214. package/dist/components/mg-tooltip2.js +56 -36
  215. package/dist/components/mg-tooltip2.js.map +1 -1
  216. package/dist/esm/{index-eed80cc2.js → index-d8f69946.js} +26 -26
  217. package/dist/esm/index-d8f69946.js.map +1 -0
  218. package/dist/esm/{index-0df3b137.js → index-e26aede5.js} +26 -74
  219. package/dist/esm/index-e26aede5.js.map +1 -0
  220. package/dist/esm/loader.js +3 -3
  221. package/dist/esm/mg-action-more_36.entry.js +732 -839
  222. package/dist/esm/mg-action-more_36.entry.js.map +1 -1
  223. package/dist/esm/mg-alert.entry.js +157 -0
  224. package/dist/esm/mg-alert.entry.js.map +1 -0
  225. package/dist/esm/mg-components.js +4 -4
  226. package/dist/esm/mg-components.js.map +1 -1
  227. package/dist/esm/mg-loader.entry.js +6 -6
  228. package/dist/esm/mg-loader.entry.js.map +1 -1
  229. package/dist/mg-components/locales/en/messages.json +1 -1
  230. package/dist/mg-components/locales/fr/messages.json +1 -1
  231. package/dist/mg-components/mg-components.css +1 -1
  232. package/dist/mg-components/mg-components.esm.js +1 -1
  233. package/dist/mg-components/mg-components.esm.js.map +1 -1
  234. package/dist/mg-components/p-1fbb6ee7.js +3 -0
  235. package/dist/mg-components/p-1fbb6ee7.js.map +1 -0
  236. package/dist/mg-components/p-5c77f5dd.entry.js +2 -0
  237. package/dist/mg-components/p-5c77f5dd.entry.js.map +1 -0
  238. package/dist/mg-components/p-9beb09e5.entry.js +2 -0
  239. package/dist/mg-components/p-9beb09e5.entry.js.map +1 -0
  240. package/dist/mg-components/p-c9934e81.js +2 -0
  241. package/dist/mg-components/p-c9934e81.js.map +1 -0
  242. package/dist/mg-components/p-d7dde2ac.entry.js +2 -0
  243. package/dist/mg-components/p-d7dde2ac.entry.js.map +1 -0
  244. package/dist/types/assets/icons/index.d.ts +12 -1
  245. package/dist/types/components/atoms/{mg-character-left → internals/mg-character-left}/mg-character-left.d.ts +4 -0
  246. package/dist/types/components/atoms/{mg-input-title → internals/mg-input-title}/mg-input-title.d.ts +1 -1
  247. package/dist/types/components/atoms/mg-badge/mg-badge.conf.d.ts +2 -1
  248. package/dist/types/components/atoms/mg-button/mg-button.conf.d.ts +2 -1
  249. package/dist/types/components/atoms/mg-button/mg-button.d.ts +0 -4
  250. package/dist/types/components/atoms/mg-card/mg-card.d.ts +0 -33
  251. package/dist/types/components/atoms/mg-divider/mg-divider.d.ts +1 -1
  252. package/dist/types/components/atoms/mg-icon/mg-icon.conf.d.ts +5 -4
  253. package/dist/types/components/atoms/mg-tag/mg-tag.conf.d.ts +2 -1
  254. package/dist/types/components/atoms/mg-tooltip/mg-tooltip.conf.d.ts +2 -6
  255. package/dist/types/components/atoms/mg-tooltip/mg-tooltip.d.ts +8 -3
  256. package/dist/types/components/molecules/inputs/mg-input/mg-input.conf.d.ts +2 -6
  257. package/dist/types/components/molecules/inputs/mg-input/mg-input.d.ts +4 -13
  258. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.d.ts +6 -13
  259. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.d.ts +4 -18
  260. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +30 -3
  261. package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.conf.d.ts +2 -7
  262. package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf.d.ts +3 -7
  263. package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +6 -1
  264. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.conf.d.ts +2 -3
  265. package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.conf.d.ts +5 -0
  266. package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +10 -4
  267. package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +3 -3
  268. package/dist/types/components/molecules/{mg-item-more → internals/mg-item-more}/mg-item-more.conf.d.ts +2 -2
  269. package/dist/types/components/molecules/{mg-item-more → internals/mg-item-more}/mg-item-more.d.ts +3 -0
  270. package/dist/types/components/molecules/menu/mg-menu/mg-menu.conf.d.ts +9 -7
  271. package/dist/types/components/molecules/menu/mg-menu/mg-menu.d.ts +2 -3
  272. package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.conf.d.ts +5 -17
  273. package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.d.ts +5 -4
  274. package/dist/types/components/molecules/mg-action-more/mg-action-more.conf.d.ts +7 -1
  275. package/dist/types/components/molecules/mg-action-more/mg-action-more.d.ts +2 -2
  276. package/dist/types/components/molecules/mg-alert/mg-alert.conf.d.ts +17 -0
  277. package/dist/types/components/molecules/mg-alert/mg-alert.d.ts +89 -0
  278. package/dist/types/components/molecules/mg-details/mg-details.d.ts +4 -0
  279. package/dist/types/components/molecules/mg-form/mg-form.d.ts +5 -0
  280. package/dist/types/components/molecules/mg-illustrated-message/mg-illustrated-message.conf.d.ts +10 -0
  281. package/dist/types/components/molecules/mg-illustrated-message/mg-illustrated-message.d.ts +7 -1
  282. package/dist/types/components/molecules/mg-message/mg-message.conf.d.ts +11 -2
  283. package/dist/types/components/molecules/mg-message/mg-message.d.ts +11 -62
  284. package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +14 -39
  285. package/dist/types/components/molecules/mg-pagination/mg-pagination.conf.d.ts +4 -4
  286. package/dist/types/components/molecules/mg-pagination/mg-pagination.d.ts +1 -0
  287. package/dist/types/components/molecules/mg-panel/mg-panel.d.ts +5 -0
  288. package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +1 -1
  289. package/dist/types/components/molecules/mg-tabs/mg-tabs.conf.d.ts +7 -11
  290. package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +10 -0
  291. package/dist/types/components.d.ts +157 -166
  292. package/dist/types/locales/index.d.ts +1 -1
  293. package/dist/types/stencil-public-runtime.d.ts +4 -0
  294. package/dist/types/types/index.d.ts +27 -0
  295. package/dist/types/utils/behaviors.utils.d.ts +5 -5
  296. package/ide/intellij/web-types.json +791 -671
  297. package/ide/vscode/css-custom-data.json +389 -0
  298. package/ide/vscode/html-custom-data.json +293 -551
  299. package/package.json +32 -29
  300. package/dist/cjs/index-8a3adbd1.js.map +0 -1
  301. package/dist/cjs/index-e1a25816.js.map +0 -1
  302. package/dist/collection/components/atoms/mg-card/mg-card.conf.js +0 -9
  303. package/dist/collection/components/atoms/mg-card/mg-card.conf.js.map +0 -1
  304. package/dist/collection/components/atoms/mg-character-left/mg-character-left.js.map +0 -1
  305. package/dist/collection/components/atoms/mg-input-title/mg-input-title.js.map +0 -1
  306. package/dist/collection/components/molecules/mg-item-more/mg-item-more.conf.js.map +0 -1
  307. package/dist/collection/components/molecules/mg-item-more/mg-item-more.js.map +0 -1
  308. package/dist/collection/fonts/OpenSans-Bold.ttf +0 -0
  309. package/dist/collection/fonts/OpenSans-Regular.ttf +0 -0
  310. package/dist/collection/fonts/OpenSans-SemiBold.ttf +0 -0
  311. package/dist/collection/styles/fonts.css +0 -1
  312. package/dist/collection/styles/global.css +0 -1
  313. package/dist/collection/styles/main.css +0 -1
  314. package/dist/collection/styles/mg-components-utils.css +0 -1
  315. package/dist/collection/styles/variables.css +0 -1
  316. package/dist/collection/variables.css +0 -1
  317. package/dist/esm/index-0df3b137.js.map +0 -1
  318. package/dist/esm/index-eed80cc2.js.map +0 -1
  319. package/dist/mg-components/fonts/OpenSans-Bold.ttf +0 -0
  320. package/dist/mg-components/fonts/OpenSans-Regular.ttf +0 -0
  321. package/dist/mg-components/fonts/OpenSans-SemiBold.ttf +0 -0
  322. package/dist/mg-components/p-88f6c2f9.entry.js +0 -2
  323. package/dist/mg-components/p-88f6c2f9.entry.js.map +0 -1
  324. package/dist/mg-components/p-e5db08c5.entry.js +0 -2
  325. package/dist/mg-components/p-e5db08c5.entry.js.map +0 -1
  326. package/dist/mg-components/p-efce3d8c.js +0 -2
  327. package/dist/mg-components/p-efce3d8c.js.map +0 -1
  328. package/dist/mg-components/p-f95b4418.js +0 -3
  329. package/dist/mg-components/p-f95b4418.js.map +0 -1
  330. package/dist/mg-components/styles/fonts.css +0 -1
  331. package/dist/mg-components/styles/global.css +0 -1
  332. package/dist/mg-components/styles/main.css +0 -1
  333. package/dist/mg-components/styles/mg-components-utils.css +0 -1
  334. package/dist/mg-components/styles/variables.css +0 -1
  335. package/dist/mg-components/variables.css +0 -1
  336. package/dist/types/components/atoms/mg-card/mg-card.conf.d.ts +0 -16
  337. /package/dist/collection/components/molecules/{mg-item-more → internals/mg-item-more}/mg-item-more.conf.js +0 -0
@@ -1,7 +1,7 @@
1
1
  import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
- import { X as Xe } from './index.es.js';
2
+ import { K as Ke } from './index.es.js';
3
3
 
4
- const mgIllustratedMessageCss = ".mg-c-illustrated-message{display:flex;max-width:47.5rem;box-sizing:border-box;flex-direction:column;justify-content:center;padding:var(--mg-illustrated-message-padding-vertical) 1.5rem;margin:auto;gap:3em 7rem;text-align:center}.mg-c-illustrated-message__illustration{max-height:18.4rem}.mg-c-illustrated-message__illustration ::slotted([slot=illustration]){width:auto;max-width:100%;height:auto;max-height:18.4rem}.mg-c-illustrated-message__illustration.mg-c-illustrated-message__illustration--small{max-height:6rem}.mg-c-illustrated-message__illustration.mg-c-illustrated-message__illustration--small ::slotted([slot=illustration]){max-height:6rem}.mg-c-illustrated-message.mg-c-illustrated-message--horizontal{max-width:unset;flex-flow:row wrap;align-items:center}.mg-c-illustrated-message.mg-c-illustrated-message--horizontal .mg-c-illustrated-message__slots,.mg-c-illustrated-message.mg-c-illustrated-message--horizontal .mg-c-illustrated-message__illustration{max-width:47.5rem}.mg-c-illustrated-message__title ::slotted([slot=title]){margin:0;font-family:var(--font-family) !important;font-size:2rem !important;font-weight:400 !important}.mg-c-illustrated-message__details ::slotted([slot=details]){margin:2rem 0 0}";
4
+ const mgIllustratedMessageCss = "/*!\n * @prop --mg-c-illustrated-message-spacing-vertical: Defines the vertical padding of the illustrated message. Default value: `--mg-b-size-40`.\n */.mg-c-illustrated-message{display:flex;max-width:calc(60*var(--mg-b-size-8));box-sizing:border-box;flex-direction:column;justify-content:center;padding:var(--mg-c-illustrated-message-spacing-vertical) var(--mg-b-size-16);margin:auto;gap:var(--mg-b-size-32) var(--mg-b-size-64);text-align:center}.mg-c-illustrated-message__illustration{max-height:calc(23*var(--mg-b-size-8))}.mg-c-illustrated-message__illustration ::slotted([slot=illustration]){width:auto;max-width:100%;height:auto;max-height:calc(23*var(--mg-b-size-8))}.mg-c-illustrated-message__illustration.mg-c-illustrated-message__illustration--small{max-height:var(--mg-b-size-64)}.mg-c-illustrated-message__illustration.mg-c-illustrated-message__illustration--small ::slotted([slot=illustration]){max-height:var(--mg-b-size-64)}.mg-c-illustrated-message.mg-c-illustrated-message--horizontal{max-width:unset;flex-flow:row wrap;align-items:center}.mg-c-illustrated-message.mg-c-illustrated-message--horizontal .mg-c-illustrated-message__slots,.mg-c-illustrated-message.mg-c-illustrated-message--horizontal .mg-c-illustrated-message__illustration{max-width:calc(60*var(--mg-b-size-8))}.mg-c-illustrated-message__title ::slotted([slot=title]){margin:0;font-family:var(--mg-b-font-family) !important;font-size:var(--mg-b-font-size-h2) !important;font-weight:400 !important}.mg-c-illustrated-message__details ::slotted([slot=details]){margin:var(--mg-b-size-16) 0 0}";
5
5
  const MgIllustratedMessageStyle0 = mgIllustratedMessageCss;
6
6
 
7
7
  const MgIllustratedMessage$1 = /*@__PURE__*/ proxyCustomElement(class MgIllustratedMessage extends HTMLElement {
@@ -9,7 +9,7 @@ const MgIllustratedMessage$1 = /*@__PURE__*/ proxyCustomElement(class MgIllustra
9
9
  super();
10
10
  this.__registerHost();
11
11
  this.__attachShadow();
12
- this.size = 'regular';
12
+ this.size = 'medium';
13
13
  this.direction = 'vertical';
14
14
  }
15
15
  /*************
@@ -21,8 +21,8 @@ const MgIllustratedMessage$1 = /*@__PURE__*/ proxyCustomElement(class MgIllustra
21
21
  componentDidLoad() {
22
22
  const headingTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
23
23
  const slottedIllustrations = this.element.querySelectorAll('[slot="illustration"]');
24
- if (!Xe(this.element.querySelector('[slot="title"]'), headingTags)) {
25
- throw new Error(`<mg-illustrated-message> Slotted title must be a heading: ${headingTags.join(', ')}`);
24
+ if (!Ke(this.element.querySelector('[slot="title"]'), headingTags)) {
25
+ throw new Error(`<mg-illustrated-message> Slotted title must be a heading: ${headingTags.join(', ')}.`);
26
26
  }
27
27
  else if (slottedIllustrations.length !== 1) {
28
28
  throw new Error('<mg-illustrated-message> Slotted illustration must be present and unique.');
@@ -34,13 +34,13 @@ const MgIllustratedMessage$1 = /*@__PURE__*/ proxyCustomElement(class MgIllustra
34
34
  * @returns HTML Element
35
35
  */
36
36
  render() {
37
- return (h("div", { key: '042f4e43323c30176c3d2b4d596d55a25a4382b7', class: {
37
+ return (h("div", { key: '475cdb177405fc41e5dde86d9a3884de5fb88bef', class: {
38
38
  'mg-c-illustrated-message': true,
39
39
  'mg-c-illustrated-message--horizontal': this.direction === 'horizontal',
40
- } }, h("div", { key: 'ebda1c1ca89ac40ff69820f96c10c0515ab9590a', class: {
40
+ } }, h("div", { key: '0e007f09bcdcd85d50bd16ed37f9f4d399c14e28', class: {
41
41
  'mg-c-illustrated-message__illustration': true,
42
42
  'mg-c-illustrated-message__illustration--small': this.size === 'small',
43
- } }, h("slot", { key: 'aa65a2f9ea28bba75b7b7ad8c0816ea9efe4c180', name: "illustration" })), h("div", { key: '8173740ede93f2800ef9de9645fd4cc05ee66e3b', class: "mg-c-illustrated-message__slots" }, h("div", { key: '970bba9668cd3ab806399cee83e6a8c9648adff0', class: "mg-c-illustrated-message__title" }, h("slot", { key: '590d7970e1845e48658ae6287fdf91e782fcfe57', name: "title" })), h("div", { key: '0c49e0842c7d12e6810fbf95404d8a66f7139320', class: "mg-c-illustrated-message__details" }, h("slot", { key: 'efec02b5d379d2a042591e4a02896691be8d67cb', name: "details" })))));
43
+ } }, h("slot", { key: '41190bb4bc5d13cecbf7b847c58af7975ffc0255', name: "illustration" })), h("div", { key: 'c338cba5ecac003b1642800441139e497f3c3769', class: "mg-c-illustrated-message__slots" }, h("div", { key: '804f5fc5a96d87d4e533d64eb80d275377dec0cf', class: "mg-c-illustrated-message__title" }, h("slot", { key: 'c5db8d1c61b0b85bc94905dc4b4bfe3ce44d48d1', name: "title" })), h("div", { key: 'e5be01c4e24a60a039a072946d12275bf46b681d', class: "mg-c-illustrated-message__details" }, h("slot", { key: '76eaf55622ed37c42f40ec832ec48ca6ab66e42c', name: "details" })))));
44
44
  }
45
45
  get element() { return this; }
46
46
  static get style() { return MgIllustratedMessageStyle0; }
@@ -1 +1 @@
1
- {"file":"mg-illustrated-message.js","mappings":";;;AAAA,MAAM,uBAAuB,GAAG,ysCAAysC,CAAC;AAC1uC,mCAAe,uBAAuB;;MCYzBA,sBAAoB;;;;;oBAaK,SAAS;yBAKE,UAAU;;;;;;;;IASzD,gBAAgB;QACd,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QACzD,MAAM,oBAAoB,GAAG,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,uBAAuB,CAAC,CAAC;QAEpF,IAAI,CAACC,EAAS,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,gBAAgB,CAAC,EAAE,WAAW,CAAC,EAAE;YACzE,MAAM,IAAI,KAAK,CAAC,6DAA6D,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;SACxG;aAAM,IAAI,oBAAoB,CAAC,MAAM,KAAK,CAAC,EAAE;YAC5C,MAAM,IAAI,KAAK,CAAC,2EAA2E,CAAC,CAAC;SAC9F;QAED,oBAAoB,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;KAC7D;;;;;IAMD,MAAM;QACJ,QACE,4DACE,KAAK,EAAE;gBACL,0BAA0B,EAAE,IAAI;gBAChC,sCAAsC,EAAE,IAAI,CAAC,SAAS,KAAK,YAAY;aACxE,IAED,4DACE,KAAK,EAAE;gBACL,wCAAwC,EAAE,IAAI;gBAC9C,+CAA+C,EAAE,IAAI,CAAC,IAAI,KAAK,OAAO;aACvE,IAED,6DAAM,IAAI,EAAC,cAAc,GAAQ,CAC7B,EACN,4DAAK,KAAK,EAAC,iCAAiC,IAC1C,4DAAK,KAAK,EAAC,iCAAiC,IAC1C,6DAAM,IAAI,EAAC,OAAO,GAAQ,CACtB,EACN,4DAAK,KAAK,EAAC,mCAAmC,IAC5C,6DAAM,IAAI,EAAC,SAAS,GAAQ,CACxB,CACF,CACF,EACN;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["MgIllustratedMessage","isTagName"],"sources":["../styles/dist/components/mg-illustrated-message.css?tag=mg-illustrated-message&encapsulation=shadow","src/components/molecules/mg-illustrated-message/mg-illustrated-message.tsx"],"sourcesContent":[".mg-c-illustrated-message{display:flex;max-width:47.5rem;box-sizing:border-box;flex-direction:column;justify-content:center;padding:var(--mg-illustrated-message-padding-vertical) 1.5rem;margin:auto;gap:3em 7rem;text-align:center}.mg-c-illustrated-message__illustration{max-height:18.4rem}.mg-c-illustrated-message__illustration ::slotted([slot=illustration]){width:auto;max-width:100%;height:auto;max-height:18.4rem}.mg-c-illustrated-message__illustration.mg-c-illustrated-message__illustration--small{max-height:6rem}.mg-c-illustrated-message__illustration.mg-c-illustrated-message__illustration--small ::slotted([slot=illustration]){max-height:6rem}.mg-c-illustrated-message.mg-c-illustrated-message--horizontal{max-width:unset;flex-flow:row wrap;align-items:center}.mg-c-illustrated-message.mg-c-illustrated-message--horizontal .mg-c-illustrated-message__slots,.mg-c-illustrated-message.mg-c-illustrated-message--horizontal .mg-c-illustrated-message__illustration{max-width:47.5rem}.mg-c-illustrated-message__title ::slotted([slot=title]){margin:0;font-family:var(--font-family) !important;font-size:2rem !important;font-weight:400 !important}.mg-c-illustrated-message__details ::slotted([slot=details]){margin:2rem 0 0}/*# sourceMappingURL=mg-illustrated-message.css.map */\n","import { Component, Element, h, Prop } from '@stencil/core';\nimport { isTagName } from '@mgdis/stencil-helpers';\n\n/*\n * @slot illustration - Illustration content\n * @slot title - Title content\n * @slot details - Details content\n */\n@Component({\n tag: 'mg-illustrated-message',\n styleUrl: '../../../../node_modules/@mgdis/styles/dist/components/mg-illustrated-message.css',\n shadow: true,\n})\nexport class MgIllustratedMessage {\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgIllustratedMessageElement;\n\n /**\n * Define illustration size\n */\n @Prop() size: 'regular' | 'small' = 'regular';\n\n /**\n * Define component orientation\n */\n @Prop() direction: 'vertical' | 'horizontal' = 'vertical';\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Check if component props are well configured on init\n */\n componentDidLoad(): void {\n const headingTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];\n const slottedIllustrations = this.element.querySelectorAll('[slot=\"illustration\"]');\n\n if (!isTagName(this.element.querySelector('[slot=\"title\"]'), headingTags)) {\n throw new Error(`<mg-illustrated-message> Slotted title must be a heading: ${headingTags.join(', ')}`);\n } else if (slottedIllustrations.length !== 1) {\n throw new Error('<mg-illustrated-message> Slotted illustration must be present and unique.');\n }\n\n slottedIllustrations[0].setAttribute('aria-hidden', 'true');\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <div\n class={{\n 'mg-c-illustrated-message': true,\n 'mg-c-illustrated-message--horizontal': this.direction === 'horizontal',\n }}\n >\n <div\n class={{\n 'mg-c-illustrated-message__illustration': true,\n 'mg-c-illustrated-message__illustration--small': this.size === 'small',\n }}\n >\n <slot name=\"illustration\"></slot>\n </div>\n <div class=\"mg-c-illustrated-message__slots\">\n <div class=\"mg-c-illustrated-message__title\">\n <slot name=\"title\"></slot>\n </div>\n <div class=\"mg-c-illustrated-message__details\">\n <slot name=\"details\"></slot>\n </div>\n </div>\n </div>\n );\n }\n}\n"],"version":3}
1
+ {"file":"mg-illustrated-message.js","mappings":";;;AAAA,MAAM,uBAAuB,GAAG,siDAAsiD,CAAC;AACvkD,mCAAe,uBAAuB;;MCazBA,sBAAoB;;;;;oBAaY,QAAQ;yBAKJ,UAAU;;;;;;;;IASzD,gBAAgB;QACd,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QACzD,MAAM,oBAAoB,GAAG,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,uBAAuB,CAAC,CAAC;QAEpF,IAAI,CAACC,EAAS,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,gBAAgB,CAAC,EAAE,WAAW,CAAC,EAAE;YACzE,MAAM,IAAI,KAAK,CAAC,6DAA6D,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACzG;aAAM,IAAI,oBAAoB,CAAC,MAAM,KAAK,CAAC,EAAE;YAC5C,MAAM,IAAI,KAAK,CAAC,2EAA2E,CAAC,CAAC;SAC9F;QAED,oBAAoB,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;KAC7D;;;;;IAMD,MAAM;QACJ,QACE,4DACE,KAAK,EAAE;gBACL,0BAA0B,EAAE,IAAI;gBAChC,sCAAsC,EAAE,IAAI,CAAC,SAAS,KAAK,YAAY;aACxE,IAED,4DACE,KAAK,EAAE;gBACL,wCAAwC,EAAE,IAAI;gBAC9C,+CAA+C,EAAE,IAAI,CAAC,IAAI,KAAK,OAAO;aACvE,IAED,6DAAM,IAAI,EAAC,cAAc,GAAQ,CAC7B,EACN,4DAAK,KAAK,EAAC,iCAAiC,IAC1C,4DAAK,KAAK,EAAC,iCAAiC,IAC1C,6DAAM,IAAI,EAAC,OAAO,GAAQ,CACtB,EACN,4DAAK,KAAK,EAAC,mCAAmC,IAC5C,6DAAM,IAAI,EAAC,SAAS,GAAQ,CACxB,CACF,CACF,EACN;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["MgIllustratedMessage","isTagName"],"sources":["../styles/dist/components/mg-illustrated-message.css?tag=mg-illustrated-message&encapsulation=shadow","src/components/molecules/mg-illustrated-message/mg-illustrated-message.tsx"],"sourcesContent":["/*!\n * @prop --mg-c-illustrated-message-spacing-vertical: Defines the vertical padding of the illustrated message. Default value: `--mg-b-size-40`.\n */.mg-c-illustrated-message{display:flex;max-width:calc(60*var(--mg-b-size-8));box-sizing:border-box;flex-direction:column;justify-content:center;padding:var(--mg-c-illustrated-message-spacing-vertical) var(--mg-b-size-16);margin:auto;gap:var(--mg-b-size-32) var(--mg-b-size-64);text-align:center}.mg-c-illustrated-message__illustration{max-height:calc(23*var(--mg-b-size-8))}.mg-c-illustrated-message__illustration ::slotted([slot=illustration]){width:auto;max-width:100%;height:auto;max-height:calc(23*var(--mg-b-size-8))}.mg-c-illustrated-message__illustration.mg-c-illustrated-message__illustration--small{max-height:var(--mg-b-size-64)}.mg-c-illustrated-message__illustration.mg-c-illustrated-message__illustration--small ::slotted([slot=illustration]){max-height:var(--mg-b-size-64)}.mg-c-illustrated-message.mg-c-illustrated-message--horizontal{max-width:unset;flex-flow:row wrap;align-items:center}.mg-c-illustrated-message.mg-c-illustrated-message--horizontal .mg-c-illustrated-message__slots,.mg-c-illustrated-message.mg-c-illustrated-message--horizontal .mg-c-illustrated-message__illustration{max-width:calc(60*var(--mg-b-size-8))}.mg-c-illustrated-message__title ::slotted([slot=title]){margin:0;font-family:var(--mg-b-font-family) !important;font-size:var(--mg-b-font-size-h2) !important;font-weight:400 !important}.mg-c-illustrated-message__details ::slotted([slot=details]){margin:var(--mg-b-size-16) 0 0}/*# sourceMappingURL=mg-illustrated-message.css.map */\n","import { Component, Element, h, Prop } from '@stencil/core';\nimport { isTagName } from '@mgdis/stencil-helpers';\nimport type { IllustratedMessageSizeType } from './mg-illustrated-message.conf';\n\n/**\n * @slot illustration - Illustration content\n * @slot title - Title content\n * @slot details - Details content\n */\n@Component({\n tag: 'mg-illustrated-message',\n styleUrl: '../../../../node_modules/@mgdis/styles/dist/components/mg-illustrated-message.css',\n shadow: true,\n})\nexport class MgIllustratedMessage {\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgIllustratedMessageElement;\n\n /**\n * Define illustration size\n */\n @Prop() size: IllustratedMessageSizeType = 'medium';\n\n /**\n * Define component orientation\n */\n @Prop() direction: 'vertical' | 'horizontal' = 'vertical';\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Check if component props are well configured on init\n */\n componentDidLoad(): void {\n const headingTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];\n const slottedIllustrations = this.element.querySelectorAll('[slot=\"illustration\"]');\n\n if (!isTagName(this.element.querySelector('[slot=\"title\"]'), headingTags)) {\n throw new Error(`<mg-illustrated-message> Slotted title must be a heading: ${headingTags.join(', ')}.`);\n } else if (slottedIllustrations.length !== 1) {\n throw new Error('<mg-illustrated-message> Slotted illustration must be present and unique.');\n }\n\n slottedIllustrations[0].setAttribute('aria-hidden', 'true');\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <div\n class={{\n 'mg-c-illustrated-message': true,\n 'mg-c-illustrated-message--horizontal': this.direction === 'horizontal',\n }}\n >\n <div\n class={{\n 'mg-c-illustrated-message__illustration': true,\n 'mg-c-illustrated-message__illustration--small': this.size === 'small',\n }}\n >\n <slot name=\"illustration\"></slot>\n </div>\n <div class=\"mg-c-illustrated-message__slots\">\n <div class=\"mg-c-illustrated-message__title\">\n <slot name=\"title\"></slot>\n </div>\n <div class=\"mg-c-illustrated-message__details\">\n <slot name=\"details\"></slot>\n </div>\n </div>\n </div>\n );\n }\n}\n"],"version":3}
@@ -1,4 +1,4 @@
1
- import { b as MgInputCheckboxPaginated$1, d as defineCustomElement$1 } from './mg-input-checkbox-paginated2.js';
1
+ import { a as MgInputCheckboxPaginated$1, d as defineCustomElement$1 } from './mg-input-checkbox-paginated2.js';
2
2
 
3
3
  const MgInputCheckboxPaginated = MgInputCheckboxPaginated$1;
4
4
  const defineCustomElement = defineCustomElement$1;
@@ -13,30 +13,12 @@ import { d as defineCustomElement$1 } from './mg-tooltip-content2.js';
13
13
  */
14
14
  const checkboxTypes = ['checkbox', 'multi'];
15
15
  /**
16
- * mg-input-checkbox-paginated section kind
16
+ * mg-input-checkbox-paginated section kind value
17
17
  */
18
- var SectionKind;
19
- (function (SectionKind) {
20
- SectionKind["SELECTED"] = "selected";
21
- SectionKind["NOT_SELECTED"] = "not-selected";
22
- })(SectionKind || (SectionKind = {}));
23
- /**
24
- * mg-input-checkbox-paginated section title kind
25
- */
26
- var SectionTitleKind;
27
- (function (SectionTitleKind) {
28
- SectionTitleKind["BUTTON"] = "button";
29
- SectionTitleKind["TEXT"] = "text";
30
- })(SectionTitleKind || (SectionTitleKind = {}));
31
- /**
32
- * Define select values button key
33
- */
34
- var SelectValuesButtonKey;
35
- (function (SelectValuesButtonKey) {
36
- SelectValuesButtonKey["EDIT"] = "editButton";
37
- SelectValuesButtonKey["SHOW"] = "showButton";
38
- SelectValuesButtonKey["SELECT"] = "selectButton";
39
- })(SelectValuesButtonKey || (SelectValuesButtonKey = {}));
18
+ const SectionKind = {
19
+ SELECTED: 'selected',
20
+ NOT_SELECTED: 'not-selected',
21
+ };
40
22
 
41
23
  /**
42
24
  * Get checkboxes list template
@@ -86,7 +68,7 @@ const MgInputCheckboxPaginated = /*@__PURE__*/ proxyCustomElement(class MgInputC
86
68
  * @param items - items to count
87
69
  * @returns page count from items
88
70
  */
89
- this.getPageCount = (item) => Math.ceil(item.length / this.offset);
71
+ this.getPageCount = (items) => ((items === null || items === void 0 ? void 0 : items.length) > 0 ? Math.ceil(items.length / this.offset) : 0);
90
72
  /**
91
73
  * Handle mg-pagination current page change event
92
74
  * @param event - pagination current page change event
@@ -100,12 +82,10 @@ const MgInputCheckboxPaginated = /*@__PURE__*/ proxyCustomElement(class MgInputC
100
82
  this.invalid = undefined;
101
83
  this.currentPage = 1;
102
84
  this.checkboxes = [];
103
- this.sectionKind = undefined;
104
85
  this.messages = undefined;
105
- this.titleKind = undefined;
106
86
  this.expanded = true;
107
87
  }
108
- validateCheckboxes(newValue, oldValue) {
88
+ watchCheckboxes(newValue, oldValue) {
109
89
  const pageCountNewValue = this.getPageCount(newValue);
110
90
  const pageCountOldValue = this.getPageCount(oldValue);
111
91
  // after each array.length update we reset pagination
@@ -117,12 +97,7 @@ const MgInputCheckboxPaginated = /*@__PURE__*/ proxyCustomElement(class MgInputC
117
97
  else if (pageCountOldValue === this.currentPage && pageCountNewValue < this.currentPage) {
118
98
  this.currentPage--;
119
99
  }
120
- }
121
- validateSectionKind(newValue) {
122
- if (newValue === SectionKind.SELECTED)
123
- this.titleKind = SectionTitleKind.BUTTON;
124
- else
125
- this.titleKind = SectionTitleKind.TEXT;
100
+ this.sectionKind = newValue[0].value ? SectionKind.SELECTED : SectionKind.NOT_SELECTED;
126
101
  }
127
102
  /**
128
103
  * Get from and to index
@@ -138,24 +113,23 @@ const MgInputCheckboxPaginated = /*@__PURE__*/ proxyCustomElement(class MgInputC
138
113
  * Lifecycle *
139
114
  *************/
140
115
  /**
141
- * Check if component props are well configured on init
116
+ * Validate props
142
117
  */
143
118
  componentWillLoad() {
144
- this.validateSectionKind(this.sectionKind);
119
+ this.watchCheckboxes(this.checkboxes);
145
120
  }
146
121
  /**
147
122
  * Render
148
123
  * @returns HTML Element
149
124
  */
150
125
  render() {
151
- const getText = (checkboxes) => (h("em", { key: '0a1e9d02d508a27fda294b25d835f44b73d4c443', class: "mg-c-input__section-header-title-label" }, `${this.messages[checkboxes.length > 1 ? 'titlePlurial' : 'title']} (${checkboxes.length})`));
126
+ const getText = (checkboxes) => (h("em", { key: '05d577bded8e2602d1dedf9a36f695904d491242', class: "mg-c-input__section-header-title-label" }, `${this.messages[checkboxes.length > 1 ? 'titlePlurial' : 'title']} (${checkboxes.length})`));
152
127
  const [from, to] = this.getFromToIndexes();
153
128
  const itemsContainerId = `items-${this.sectionKind}-container`;
154
- return (h(Host, { key: '71c72a433b984a609046fdce7cf4c6130c8e1ada', hidden: this.checkboxes.length < 1 }, h("div", { key: 'b2bd73e01db4db0edca92c5e7fc64edfda9d3b6d', class: "mg-c-input__section-header" }, this.titleKind === SectionTitleKind.BUTTON ? (h("mg-button", { variant: "flat", onClick: this.handleToggleClick, "aria-controls": itemsContainerId, "aria-expanded": this.expanded.toString() }, h("mg-icon", { icon: this.expanded ? 'chevron-up' : 'chevron-down', size: "small" }), h("span", { class: "mg-c-input__section-header-title" }, getText(this.checkboxes)))) : (h("p", { class: "mg-c-input__section-header-title mg-c-input__section-header-title--static" }, getText(this.checkboxes))), ((this.sectionKind === SectionKind.SELECTED && this.expanded) || this.sectionKind === SectionKind.NOT_SELECTED) && (h("mg-tooltip", { key: 'dcc6b405032e5b59cc748f1cbc87ab087c37cc31', class: "mg-c-input__section-header-tootlip", message: this.messages.tooltip, "data-popper-strategy": "absolute" }, h("mg-button", { key: 'a1d38aedc328d81ac8139f70e8564538f7e4b4c4', variant: "link", onClick: this.massActionHandler }, this.messages.action))), this.expanded && this.getPageCount(this.checkboxes) > 1 && (h("mg-pagination", { key: "search-pagination", totalPages: this.getPageCount(this.checkboxes), currentPage: this.currentPage, "onCurrent-page-change": this.handleCurrentPageChange, hideNavigationLabels: true, hidePageCount: true, identifier: `input-checkbox-pagination-${this.sectionKind}` }))), h("div", { key: 'd9913a7ceeac5d91f0c58e5021a88f1bf37b1387', hidden: !this.expanded, id: itemsContainerId, class: "mg-c-input__section-content" }, h(MgInputCheckboxList, { key: 'f262b871762d3c3f3e9828ed04cd735a89f9f27d', checkboxes: this.getArrayRange(this.checkboxes, from, to), displaySearchInput: true, messages: this.messages, id: `items-${this.sectionKind}`, disabled: this.disabled, name: this.name, invalid: this.invalid }))));
129
+ return (h(Host, { key: '49b95a0882cc475aab4a810ccd8f292d83b59a9a', hidden: this.checkboxes.length < 1 }, h("div", { key: '2db5103f9784add1effb7a5dcafa8f8196601d14', class: "mg-c-input__section-header" }, this.sectionKind === SectionKind.SELECTED ? (h("mg-button", { variant: "flat", onClick: this.handleToggleClick, "aria-controls": itemsContainerId, "aria-expanded": this.expanded.toString() }, h("mg-icon", { icon: this.expanded ? 'chevron-up' : 'chevron-down' }), h("span", { class: "mg-c-input__section-header-title" }, getText(this.checkboxes)))) : (h("p", { class: "mg-c-input__section-header-title mg-c-input__section-header-title--static" }, getText(this.checkboxes))), ((this.sectionKind === SectionKind.SELECTED && this.expanded) || this.sectionKind === SectionKind.NOT_SELECTED) && (h("mg-tooltip", { key: '946506778c280928acd6e3e7256c828b7a7598b5', class: "mg-c-input__section-header-tootlip", message: this.messages.tooltip }, h("mg-button", { key: 'b71a4e10a764bfaf438430dd44b6f82785d0f5d4', variant: "link", onClick: this.massActionHandler }, this.messages.action))), this.expanded && this.getPageCount(this.checkboxes) > 1 && (h("mg-pagination", { key: "search-pagination", totalPages: this.getPageCount(this.checkboxes), currentPage: this.currentPage, "onCurrent-page-change": this.handleCurrentPageChange, hideNavigationLabels: true, hidePageCount: true, identifier: `input-checkbox-pagination-${this.sectionKind}` }))), h("div", { key: '06af47b1e9f0a6d0a11741dae03f75ce71e32666', hidden: !this.expanded, id: itemsContainerId, class: "mg-c-input__section-content" }, h(MgInputCheckboxList, { key: 'aba29baa719288ad0b172326c669d146c803a4e4', checkboxes: this.getArrayRange(this.checkboxes, from, to), displaySearchInput: true, messages: this.messages, id: `items-${this.sectionKind}`, disabled: this.disabled, name: this.name, invalid: this.invalid }))));
155
130
  }
156
131
  static get watchers() { return {
157
- "checkboxes": ["validateCheckboxes"],
158
- "sectionKind": ["validateSectionKind"]
132
+ "checkboxes": ["watchCheckboxes"]
159
133
  }; }
160
134
  }, [2, "mg-input-checkbox-paginated", {
161
135
  "readonly": [4],
@@ -164,13 +138,10 @@ const MgInputCheckboxPaginated = /*@__PURE__*/ proxyCustomElement(class MgInputC
164
138
  "invalid": [4],
165
139
  "currentPage": [1026, "current-page"],
166
140
  "checkboxes": [16],
167
- "sectionKind": [1, "section-kind"],
168
141
  "messages": [16],
169
- "titleKind": [32],
170
142
  "expanded": [32]
171
143
  }, undefined, {
172
- "checkboxes": ["validateCheckboxes"],
173
- "sectionKind": ["validateSectionKind"]
144
+ "checkboxes": ["watchCheckboxes"]
174
145
  }]);
175
146
  function defineCustomElement() {
176
147
  if (typeof customElements === "undefined") {
@@ -227,6 +198,6 @@ function defineCustomElement() {
227
198
  }
228
199
  defineCustomElement();
229
200
 
230
- export { MgInputCheckboxList as M, SelectValuesButtonKey as S, SectionKind as a, MgInputCheckboxPaginated as b, checkboxTypes as c, defineCustomElement as d };
201
+ export { MgInputCheckboxList as M, SectionKind as S, MgInputCheckboxPaginated as a, checkboxTypes as c, defineCustomElement as d };
231
202
 
232
203
  //# sourceMappingURL=mg-input-checkbox-paginated2.js.map
@@ -1 +1 @@
1
- {"file":"mg-input-checkbox-paginated2.js","mappings":";;;;;;;;;;AAwBA;;;MAGa,aAAa,GAAG,CAAC,UAAU,EAAE,OAAO,EAAW;AAO5D;;;IAGY;AAAZ,WAAY,WAAW;IACrB,oCAAqB,CAAA;IACrB,4CAA6B,CAAA;AAC/B,CAAC,EAHW,WAAW,KAAX,WAAW,QAGtB;AAED;;;AAGA,IAAY,gBAGX;AAHD,WAAY,gBAAgB;I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I,EACnB,UAAU,EAAE,6BAA6B,IAAI,CAAC,WAAW,EAAE,GAC5C,CAClB,CACG,EACN,4DAAK,MAAM,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,EAAE,gBAAgB,EAAE,KAAK,EAAC,6BAA6B,IACpF,EAAC,mBAAmB,qDAClB,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,EAAE,EAAE,CAAC,EACzD,kBAAkB,EAAE,IAAI,EACxB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,EAAE,EAAE,SAAS,IAAI,CAAC,WAAW,EAAE,EAC/B,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,OAAO,EAAE,IAAI,CAAC,OAAO,GACA,CACnB,CACD,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.ts","src/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.tsx","src/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.tsx"],"sourcesContent":["/**\n * interface CheckboxValue\n * use to match returned value\n */\nexport interface CheckboxValue {\n title: string;\n value: boolean | null;\n disabled?: boolean;\n required?: boolean;\n}\n\n/**\n * interface CheckboxItem\n * use to match checkbox attributes\n */\nexport interface CheckboxItem extends CheckboxValue {\n _id: string;\n _handleInput: (event: InputEvent & { target: HTMLInputElement }) => void;\n _handleBlur: () => void;\n _handleKeydown: (event: KeyboardEvent & { target: HTMLElement }) => void;\n _handleMouseEnter: () => void;\n _handleMouseLeave: () => void;\n}\n\n/**\n * List of all availables checkbox type\n */\nexport const checkboxTypes = ['checkbox', 'multi'] as const;\n\n/**\n * ChecboxType from checkbox types\n */\nexport type CheckboxType = (typeof checkboxTypes)[number];\n\n/**\n * mg-input-checkbox-paginated section kind\n */\nexport enum SectionKind {\n SELECTED = 'selected',\n NOT_SELECTED = 'not-selected',\n}\n\n/**\n * mg-input-checkbox-paginated section title kind\n */\nexport enum SectionTitleKind {\n BUTTON = 'button',\n TEXT = 'text',\n}\n\n/**\n * Base mg-input-checkbox interface\n */\nexport interface IMgInputCheckboxBase {\n disabled?: boolean;\n name?: string;\n invalid?: boolean;\n}\n\n/**\n * mg-input-checkbox-list interface\n */\nexport interface MgInputCheckboxListProps extends IMgInputCheckboxBase {\n displaySearchInput: boolean;\n messages: Record<string, unknown>;\n checkboxes: CheckboxItem[];\n id: string;\n}\n\n/**\n * Define select values button key\n */\nexport enum SelectValuesButtonKey {\n EDIT = 'editButton',\n SHOW = 'showButton',\n SELECT = 'selectButton',\n}\n","import { FunctionalComponent, h, VNode } from '@stencil/core';\nimport { MgInputCheckboxListProps } from './mg-input-checkbox.conf';\n\n/**\n * Get checkboxes list template\n * @param props - MgInputCheckboxList Interface Props\n * @returns input template\n */\nexport const MgInputCheckboxList: FunctionalComponent<MgInputCheckboxListProps> = (props: MgInputCheckboxListProps): VNode[] => (\n <ul\n class=\"mg-c-input__input-group-container\"\n role=\"list\"\n aria-describedby={props.displaySearchInput ? 'search-results' : undefined}\n aria-label={props.displaySearchInput ? props.messages.searchResults : undefined}\n aria-live={props.displaySearchInput ? 'polite' : undefined}\n id={props.id}\n >\n {props.checkboxes.map(input => (\n <li key={input._id} class={{ 'mg-c-input__input-group': true, 'mg-c-input__input-group--disabled': props.disabled || input.disabled }}>\n <input\n type=\"checkbox\"\n id={input._id}\n name={props.name}\n value={input.value?.toString()}\n checked={Boolean(input.value)}\n required={input.required}\n aria-invalid={props.invalid?.toString() || 'false'}\n disabled={props.disabled || input.disabled}\n indeterminate={input.value === null}\n onInput={input._handleInput}\n onBlur={input._handleBlur}\n onKeyDown={input._handleKeydown}\n />\n <label htmlFor={input._id} onMouseEnter={input._handleMouseEnter} onMouseLeave={input._handleMouseLeave}>\n {input.title}\n </label>\n </li>\n ))}\n </ul>\n);\n","import { Component, h, Prop, State, Event, EventEmitter, Watch, Host } from '@stencil/core';\nimport { CheckboxItem, IMgInputCheckboxBase, SectionKind, SectionTitleKind } from '../mg-input-checkbox.conf';\nimport { MgInputCheckboxList } from '../MgInputCheckboxList';\n\n/**\n * Internal component use to manage sections instances\n */\n@Component({\n tag: 'mg-input-checkbox-paginated',\n shadow: false,\n scoped: true,\n})\nexport class MgInputCheckboxPaginated implements IMgInputCheckboxBase {\n /*************\n * Constantes *\n *************/\n private readonly offset = 10;\n\n /*************\n * Decorators *\n *************/\n\n /**\n * Define if mg-input-checkbox-list is readonly\n */\n @Prop() readonly?: boolean;\n\n /**\n * Define if mg-input-checkbox-list is disabled\n */\n @Prop() disabled?: boolean;\n\n /**\n * Define mg-input-checkbox input name\n */\n @Prop() name?: string;\n\n /**\n * Define mg-input-checkbox input invalid\n */\n @Prop() invalid?: boolean;\n\n /**\n * Current page\n */\n @Prop({ mutable: true }) currentPage = 1;\n\n /**\n * Define checkboxes to paginate\n */\n @Prop() checkboxes: CheckboxItem[] = [];\n @Watch('checkboxes')\n validateCheckboxes(newValue: MgInputCheckboxPaginated['checkboxes'], oldValue: MgInputCheckboxPaginated['checkboxes']): void {\n const pageCountNewValue = this.getPageCount(newValue);\n const pageCountOldValue = this.getPageCount(oldValue);\n // after each array.length update we reset pagination\n // when items fill on page, we set current page to 1\n if (pageCountNewValue === 1 || (pageCountNewValue !== 0 && this.currentPage === 0)) {\n this.currentPage = 1;\n }\n // when old items page numbers match the current page AND new items page number is lower than current page, we set the new last page\n else if (pageCountOldValue === this.currentPage && pageCountNewValue < this.currentPage) {\n this.currentPage--;\n }\n }\n\n /**\n * Define section kind\n */\n @Prop() sectionKind?: SectionKind;\n @Watch('sectionKind')\n validateSectionKind(newValue: MgInputCheckboxPaginated['sectionKind']): void {\n if (newValue === SectionKind.SELECTED) this.titleKind = SectionTitleKind.BUTTON;\n else this.titleKind = SectionTitleKind.TEXT;\n }\n\n /**\n * Define component message\n */\n @Prop() messages: Record<string, string>;\n\n /**\n * Emit 'mass-action' event\n * used to informe that select-all/unselect-all button listner is triggered\n */\n @Event({ eventName: 'mass-action' }) massAction: EventEmitter<HTMLMgInputCheckboxPaginatedElement['sectionKind']>;\n\n /**\n * Define section title\n */\n @State() titleKind: SectionTitleKind;\n\n /**\n * Is checked items values expanded\n */\n @State() expanded = true;\n\n /***********\n * Methods *\n ***********/\n\n /**\n * Mass action handler\n */\n private massActionHandler = (): void => {\n this.massAction.emit(this.sectionKind);\n };\n\n /**\n * Toggle items button handler\n */\n private handleToggleClick = (): void => {\n this.expanded = !this.expanded;\n };\n\n /**\n * Method to get a array range\n * @param from - array start index\n * @param to - array end index\n * @returns array's range\n */\n private getArrayRange = <ItemType,>(array: ItemType[], from: number, to: number): ItemType[] => array.slice(from, to);\n\n /**\n * Get from and to index\n * @returns [from,to] index\n */\n private getFromToIndexes(): number[] {\n const isFirstPage = this.currentPage === 1;\n const from = isFirstPage ? 0 : (this.currentPage - 1) * this.offset;\n const to = isFirstPage ? this.offset : this.currentPage * this.offset;\n return [from, to];\n }\n\n /**\n * Method to get page count from items\n * @param items - items to count\n * @returns page count from items\n */\n private getPageCount = (item: unknown[]): number => Math.ceil(item.length / this.offset);\n\n /**\n * Handle mg-pagination current page change event\n * @param event - pagination current page change event\n */\n private handleCurrentPageChange = (event: CustomEvent): void => {\n this.currentPage = Number(event.detail);\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Check if component props are well configured on init\n */\n componentWillLoad(): void {\n this.validateSectionKind(this.sectionKind);\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n const getText = (checkboxes: CheckboxItem[]): HTMLElement => (\n <em class=\"mg-c-input__section-header-title-label\">{`${this.messages[checkboxes.length > 1 ? 'titlePlurial' : 'title']} (${checkboxes.length})`}</em>\n );\n const [from, to] = this.getFromToIndexes();\n const itemsContainerId = `items-${this.sectionKind}-container`;\n\n return (\n <Host hidden={this.checkboxes.length < 1}>\n <div class=\"mg-c-input__section-header\">\n {this.titleKind === SectionTitleKind.BUTTON ? (\n <mg-button variant=\"flat\" onClick={this.handleToggleClick} aria-controls={itemsContainerId} aria-expanded={this.expanded.toString()}>\n <mg-icon icon={this.expanded ? 'chevron-up' : 'chevron-down'} size=\"small\"></mg-icon>\n <span class=\"mg-c-input__section-header-title\">{getText(this.checkboxes)}</span>\n </mg-button>\n ) : (\n <p class=\"mg-c-input__section-header-title mg-c-input__section-header-title--static\">{getText(this.checkboxes)}</p>\n )}\n {((this.sectionKind === SectionKind.SELECTED && this.expanded) || this.sectionKind === SectionKind.NOT_SELECTED) && (\n <mg-tooltip class=\"mg-c-input__section-header-tootlip\" message={this.messages.tooltip} data-popper-strategy=\"absolute\">\n <mg-button variant=\"link\" onClick={this.massActionHandler}>\n {this.messages.action}\n </mg-button>\n </mg-tooltip>\n )}\n {this.expanded && this.getPageCount(this.checkboxes) > 1 && (\n <mg-pagination\n key=\"search-pagination\"\n totalPages={this.getPageCount(this.checkboxes)}\n currentPage={this.currentPage}\n onCurrent-page-change={this.handleCurrentPageChange}\n hideNavigationLabels={true}\n hidePageCount={true}\n identifier={`input-checkbox-pagination-${this.sectionKind}`}\n ></mg-pagination>\n )}\n </div>\n <div hidden={!this.expanded} id={itemsContainerId} class=\"mg-c-input__section-content\">\n <MgInputCheckboxList\n checkboxes={this.getArrayRange(this.checkboxes, from, to)}\n displaySearchInput={true}\n messages={this.messages}\n id={`items-${this.sectionKind}`}\n disabled={this.disabled}\n name={this.name}\n invalid={this.invalid}\n ></MgInputCheckboxList>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"mg-input-checkbox-paginated2.js","mappings":";;;;;;;;;;AAwBA;;;MAGa,aAAa,GAAG,CAAC,UAAU,EAAE,OAAO,EAAW;AAY5D;;;MAGa,WAAW,GAAoC;IAC1D,QAAQ,EAAE,UAAU;IACpB,YAAY,EAAE,cAAc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,IAAI,EAAE,EAAE,CAAC,EACzD,kBAAkB,EAAE,IAAI,EACxB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,EAAE,EAAE,SAAS,IAAI,CAAC,WAAW,EAAE,EAC/B,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,OAAO,EAAE,IAAI,CAAC,OAAO,GACA,CACnB,CACD,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.ts","src/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.tsx","src/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.tsx"],"sourcesContent":["/**\n * interface CheckboxValue\n * use to match returned value\n */\nexport interface CheckboxValue {\n title: string;\n value: boolean | null;\n disabled?: boolean;\n required?: boolean;\n}\n\n/**\n * interface CheckboxItem\n * use to match checkbox attributes\n */\nexport interface CheckboxItem extends CheckboxValue {\n _id: string;\n _handleInput: (event: InputEvent & { target: HTMLInputElement }) => void;\n _handleBlur: () => void;\n _handleKeydown: (event: KeyboardEvent & { target: HTMLElement }) => void;\n _handleMouseEnter: () => void;\n _handleMouseLeave: () => void;\n}\n\n/**\n * List of all availables checkbox type\n */\nexport const checkboxTypes = ['checkbox', 'multi'] as const;\n\n/**\n * ChecboxType from checkbox types\n */\nexport type CheckboxType = (typeof checkboxTypes)[number];\n\n/**\n * mg-input-checkbox-paginated section kind type\n */\nexport type SectionKindType = 'selected' | 'not-selected';\n\n/**\n * mg-input-checkbox-paginated section kind value\n */\nexport const SectionKind: Record<string, SectionKindType> = {\n SELECTED: 'selected',\n NOT_SELECTED: 'not-selected',\n};\n\n/**\n * Base mg-input-checkbox interface\n */\nexport interface IMgInputCheckboxBase {\n disabled?: boolean;\n name?: string;\n invalid?: boolean;\n}\n\n/**\n * mg-input-checkbox-list interface\n */\nexport interface MgInputCheckboxListProps extends IMgInputCheckboxBase {\n displaySearchInput: boolean;\n messages: Record<string, unknown>;\n checkboxes: CheckboxItem[];\n id: string;\n}\n","import { FunctionalComponent, h, VNode } from '@stencil/core';\nimport { MgInputCheckboxListProps } from './mg-input-checkbox.conf';\n\n/**\n * Get checkboxes list template\n * @param props - MgInputCheckboxList Interface Props\n * @returns input template\n */\nexport const MgInputCheckboxList: FunctionalComponent<MgInputCheckboxListProps> = (props: MgInputCheckboxListProps): VNode[] => (\n <ul\n class=\"mg-c-input__input-group-container\"\n role=\"list\"\n aria-describedby={props.displaySearchInput ? 'search-results' : undefined}\n aria-label={props.displaySearchInput ? props.messages.searchResults : undefined}\n aria-live={props.displaySearchInput ? 'polite' : undefined}\n id={props.id}\n >\n {props.checkboxes.map(input => (\n <li key={input._id} class={{ 'mg-c-input__input-group': true, 'mg-c-input__input-group--disabled': props.disabled || input.disabled }}>\n <input\n type=\"checkbox\"\n id={input._id}\n name={props.name}\n value={input.value?.toString()}\n checked={Boolean(input.value)}\n required={input.required}\n aria-invalid={props.invalid?.toString() || 'false'}\n disabled={props.disabled || input.disabled}\n indeterminate={input.value === null}\n onInput={input._handleInput}\n onBlur={input._handleBlur}\n onKeyDown={input._handleKeydown}\n />\n <label htmlFor={input._id} onMouseEnter={input._handleMouseEnter} onMouseLeave={input._handleMouseLeave}>\n {input.title}\n </label>\n </li>\n ))}\n </ul>\n);\n","import { Component, h, Prop, State, Event, EventEmitter, Watch, Host } from '@stencil/core';\nimport { CheckboxItem, IMgInputCheckboxBase, type SectionKindType, SectionKind } from '../mg-input-checkbox.conf';\nimport { MgInputCheckboxList } from '../MgInputCheckboxList';\n\n/**\n * Internal component use to manage sections instances\n * @internal\n */\n@Component({\n tag: 'mg-input-checkbox-paginated',\n shadow: false,\n scoped: true,\n})\nexport class MgInputCheckboxPaginated implements IMgInputCheckboxBase {\n /*************\n * Constantes *\n *************/\n private readonly offset = 10;\n private sectionKind: SectionKindType;\n\n /*************\n * Decorators *\n *************/\n\n /**\n * Define if mg-input-checkbox-list is readonly\n */\n @Prop() readonly?: boolean;\n\n /**\n * Define if mg-input-checkbox-list is disabled\n */\n @Prop() disabled?: boolean;\n\n /**\n * Define mg-input-checkbox input name\n */\n @Prop() name?: string;\n\n /**\n * Define mg-input-checkbox input invalid\n */\n @Prop() invalid?: boolean;\n\n /**\n * Current page\n */\n @Prop({ mutable: true }) currentPage = 1;\n\n /**\n * Define checkboxes to paginate\n */\n @Prop() checkboxes: CheckboxItem[] = [];\n @Watch('checkboxes')\n watchCheckboxes(newValue: MgInputCheckboxPaginated['checkboxes'], oldValue?: MgInputCheckboxPaginated['checkboxes']): void {\n const pageCountNewValue = this.getPageCount(newValue);\n const pageCountOldValue = this.getPageCount(oldValue);\n // after each array.length update we reset pagination\n // when items fill on page, we set current page to 1\n if (pageCountNewValue === 1 || (pageCountNewValue !== 0 && this.currentPage === 0)) {\n this.currentPage = 1;\n }\n // when old items page numbers match the current page AND new items page number is lower than current page, we set the new last page\n else if (pageCountOldValue === this.currentPage && pageCountNewValue < this.currentPage) {\n this.currentPage--;\n }\n this.sectionKind = newValue[0].value ? SectionKind.SELECTED : SectionKind.NOT_SELECTED;\n }\n\n /**\n * Define component message\n */\n @Prop() messages: Record<string, string>;\n\n /**\n * Emit 'mass-action' event\n * used to informe that select-all/unselect-all button listner is triggered\n */\n @Event({ eventName: 'mass-action' }) massAction: EventEmitter<SectionKindType>;\n\n /**\n * Is checked items values expanded\n */\n @State() expanded = true;\n\n /***********\n * Methods *\n ***********/\n\n /**\n * Mass action handler\n */\n private massActionHandler = (): void => {\n this.massAction.emit(this.sectionKind);\n };\n\n /**\n * Toggle items button handler\n */\n private handleToggleClick = (): void => {\n this.expanded = !this.expanded;\n };\n\n /**\n * Method to get a array range\n * @param from - array start index\n * @param to - array end index\n * @returns array's range\n */\n private getArrayRange = <ItemType,>(array: ItemType[], from: number, to: number): ItemType[] => array.slice(from, to);\n\n /**\n * Get from and to index\n * @returns [from,to] index\n */\n private getFromToIndexes(): number[] {\n const isFirstPage = this.currentPage === 1;\n const from = isFirstPage ? 0 : (this.currentPage - 1) * this.offset;\n const to = isFirstPage ? this.offset : this.currentPage * this.offset;\n return [from, to];\n }\n\n /**\n * Method to get page count from items\n * @param items - items to count\n * @returns page count from items\n */\n private getPageCount = (items: unknown[]): number => (items?.length > 0 ? Math.ceil(items.length / this.offset) : 0);\n\n /**\n * Handle mg-pagination current page change event\n * @param event - pagination current page change event\n */\n private handleCurrentPageChange = (event: CustomEvent): void => {\n this.currentPage = Number(event.detail);\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Validate props\n */\n componentWillLoad(): void {\n this.watchCheckboxes(this.checkboxes);\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n const getText = (checkboxes: CheckboxItem[]): HTMLElement => (\n <em class=\"mg-c-input__section-header-title-label\">{`${this.messages[checkboxes.length > 1 ? 'titlePlurial' : 'title']} (${checkboxes.length})`}</em>\n );\n const [from, to] = this.getFromToIndexes();\n const itemsContainerId = `items-${this.sectionKind}-container`;\n\n return (\n <Host hidden={this.checkboxes.length < 1}>\n <div class=\"mg-c-input__section-header\">\n {this.sectionKind === SectionKind.SELECTED ? (\n <mg-button variant=\"flat\" onClick={this.handleToggleClick} aria-controls={itemsContainerId} aria-expanded={this.expanded.toString()}>\n <mg-icon icon={this.expanded ? 'chevron-up' : 'chevron-down'}></mg-icon>\n <span class=\"mg-c-input__section-header-title\">{getText(this.checkboxes)}</span>\n </mg-button>\n ) : (\n <p class=\"mg-c-input__section-header-title mg-c-input__section-header-title--static\">{getText(this.checkboxes)}</p>\n )}\n {((this.sectionKind === SectionKind.SELECTED && this.expanded) || this.sectionKind === SectionKind.NOT_SELECTED) && (\n <mg-tooltip class=\"mg-c-input__section-header-tootlip\" message={this.messages.tooltip}>\n <mg-button variant=\"link\" onClick={this.massActionHandler}>\n {this.messages.action}\n </mg-button>\n </mg-tooltip>\n )}\n {this.expanded && this.getPageCount(this.checkboxes) > 1 && (\n <mg-pagination\n key=\"search-pagination\"\n totalPages={this.getPageCount(this.checkboxes)}\n currentPage={this.currentPage}\n onCurrent-page-change={this.handleCurrentPageChange}\n hideNavigationLabels={true}\n hidePageCount={true}\n identifier={`input-checkbox-pagination-${this.sectionKind}`}\n ></mg-pagination>\n )}\n </div>\n <div hidden={!this.expanded} id={itemsContainerId} class=\"mg-c-input__section-content\">\n <MgInputCheckboxList\n checkboxes={this.getArrayRange(this.checkboxes, from, to)}\n displaySearchInput={true}\n messages={this.messages}\n id={`items-${this.sectionKind}`}\n disabled={this.disabled}\n name={this.name}\n invalid={this.invalid}\n ></MgInputCheckboxList>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}