@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,7 +1,7 @@
1
1
  import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
2
  import { X as Xe } 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
  /*************
@@ -22,7 +22,7 @@ const MgIllustratedMessage$1 = /*@__PURE__*/ proxyCustomElement(class MgIllustra
22
22
  const headingTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
23
23
  const slottedIllustrations = this.element.querySelectorAll('[slot="illustration"]');
24
24
  if (!Xe(this.element.querySelector('[slot="title"]'), headingTags)) {
25
- throw new Error(`<mg-illustrated-message> Slotted title must be a heading: ${headingTags.join(', ')}`);
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,39 +13,19 @@ 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
43
25
  * @param props - MgInputCheckboxList Interface Props
44
26
  * @returns input template
45
27
  */
46
- const MgInputCheckboxList = (props) => (
47
- // eslint-disable-next-line jsx-a11y/no-redundant-roles
48
- h("ul", { class: "mg-c-input__input-group-container", role: "list", "aria-describedby": props.displaySearchInput ? 'search-results' : undefined, "aria-label": props.displaySearchInput ? props.messages.searchResults : undefined, "aria-live": props.displaySearchInput ? 'polite' : undefined, id: props.id }, props.checkboxes.map(input => {
28
+ const MgInputCheckboxList = (props) => (h("ul", { class: "mg-c-input__input-group-container", role: "list", "aria-describedby": props.displaySearchInput ? 'search-results' : undefined, "aria-label": props.displaySearchInput ? props.messages.searchResults : undefined, "aria-live": props.displaySearchInput ? 'polite' : undefined, id: props.id }, props.checkboxes.map(input => {
49
29
  var _a, _b;
50
30
  return (h("li", { key: input._id, class: { 'mg-c-input__input-group': true, 'mg-c-input__input-group--disabled': props.disabled || input.disabled } },
51
31
  h("input", { type: "checkbox", id: input._id, name: props.name, value: (_a = input.value) === null || _a === void 0 ? void 0 : _a.toString(), checked: Boolean(input.value), required: input.required, "aria-invalid": ((_b = props.invalid) === null || _b === void 0 ? void 0 : _b.toString()) || 'false', disabled: props.disabled || input.disabled, indeterminate: input.value === null, onInput: input._handleInput, onBlur: input._handleBlur, onKeyDown: input._handleKeydown }),
@@ -88,7 +68,7 @@ const MgInputCheckboxPaginated = /*@__PURE__*/ proxyCustomElement(class MgInputC
88
68
  * @param items - items to count
89
69
  * @returns page count from items
90
70
  */
91
- 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);
92
72
  /**
93
73
  * Handle mg-pagination current page change event
94
74
  * @param event - pagination current page change event
@@ -102,12 +82,10 @@ const MgInputCheckboxPaginated = /*@__PURE__*/ proxyCustomElement(class MgInputC
102
82
  this.invalid = undefined;
103
83
  this.currentPage = 1;
104
84
  this.checkboxes = [];
105
- this.sectionKind = undefined;
106
85
  this.messages = undefined;
107
- this.titleKind = undefined;
108
86
  this.expanded = true;
109
87
  }
110
- validateCheckboxes(newValue, oldValue) {
88
+ watchCheckboxes(newValue, oldValue) {
111
89
  const pageCountNewValue = this.getPageCount(newValue);
112
90
  const pageCountOldValue = this.getPageCount(oldValue);
113
91
  // after each array.length update we reset pagination
@@ -119,12 +97,7 @@ const MgInputCheckboxPaginated = /*@__PURE__*/ proxyCustomElement(class MgInputC
119
97
  else if (pageCountOldValue === this.currentPage && pageCountNewValue < this.currentPage) {
120
98
  this.currentPage--;
121
99
  }
122
- }
123
- validateSectionKind(newValue) {
124
- if (newValue === SectionKind.SELECTED)
125
- this.titleKind = SectionTitleKind.BUTTON;
126
- else
127
- this.titleKind = SectionTitleKind.TEXT;
100
+ this.sectionKind = newValue[0].value ? SectionKind.SELECTED : SectionKind.NOT_SELECTED;
128
101
  }
129
102
  /**
130
103
  * Get from and to index
@@ -140,24 +113,23 @@ const MgInputCheckboxPaginated = /*@__PURE__*/ proxyCustomElement(class MgInputC
140
113
  * Lifecycle *
141
114
  *************/
142
115
  /**
143
- * Check if component props are well configured on init
116
+ * Validate props
144
117
  */
145
118
  componentWillLoad() {
146
- this.validateSectionKind(this.sectionKind);
119
+ this.watchCheckboxes(this.checkboxes);
147
120
  }
148
121
  /**
149
122
  * Render
150
123
  * @returns HTML Element
151
124
  */
152
125
  render() {
153
- 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})`));
154
127
  const [from, to] = this.getFromToIndexes();
155
128
  const itemsContainerId = `items-${this.sectionKind}-container`;
156
- 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', 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: '1bf161092691a606697a543de71e78c574b0dea0', class: "mg-c-input__section-header-tootlip", message: this.messages.tooltip }, h("mg-button", { key: '3f9090d137c2ea967e098b06a4ed2bd36da34267', 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: '6b405d35f0ffba82352dbf1a9a1e9abed274b5f2', hidden: !this.expanded, id: itemsContainerId, class: "mg-c-input__section-content" }, h(MgInputCheckboxList, { key: 'd3ef36cc9431352bedff1de8fa5f1cfc8070bfa5', 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 }))));
157
130
  }
158
131
  static get watchers() { return {
159
- "checkboxes": ["validateCheckboxes"],
160
- "sectionKind": ["validateSectionKind"]
132
+ "checkboxes": ["watchCheckboxes"]
161
133
  }; }
162
134
  }, [2, "mg-input-checkbox-paginated", {
163
135
  "readonly": [4],
@@ -166,13 +138,10 @@ const MgInputCheckboxPaginated = /*@__PURE__*/ proxyCustomElement(class MgInputC
166
138
  "invalid": [4],
167
139
  "currentPage": [1026, "current-page"],
168
140
  "checkboxes": [16],
169
- "sectionKind": [1, "section-kind"],
170
141
  "messages": [16],
171
- "titleKind": [32],
172
142
  "expanded": [32]
173
143
  }, undefined, {
174
- "checkboxes": ["validateCheckboxes"],
175
- "sectionKind": ["validateSectionKind"]
144
+ "checkboxes": ["watchCheckboxes"]
176
145
  }]);
177
146
  function defineCustomElement() {
178
147
  if (typeof customElements === "undefined") {
@@ -229,6 +198,6 @@ function defineCustomElement() {
229
198
  }
230
199
  defineCustomElement();
231
200
 
232
- 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 };
233
202
 
234
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;IAC1B,qCAAiB,CAAA;IACjB,iCAAa,CAAA;AACf,CAAC,EAHW,gBAAgB,KAAhB,gBAAgB,QAG3B;AAqBD;;;IAGY;AAAZ,WAAY,qBAAqB;IAC/B,4CAAmB,CAAA;IACnB,4CAAmB,CAAA;IACnB,gDAAuB,CAAA;AACzB,CAAC,EAJW,qBAAqB,KAArB,qBAAqB;;ACrEjC;;;;;MAKa,mBAAmB,GAAkD,CAAC,KAA+B;AAChH;AACA,UACE,KAAK,EAAC,mCAAmC,EACzC,IAAI,EAAC,MAAM,sBACO,KAAK,CAA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,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 // eslint-disable-next-line jsx-a11y/no-redundant-roles\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;;;ACzC9B;;;;;MAKa,mBAAmB,GAAkD,CAAC,KAA+B,MAChH,UACE,KAAK,EAAC,mCAAmC,EACzC,IAAI,EAAC,MAAM,sBACO,KAAK,CAAC,kBAAkB,GAAG,gBAAgB,GAAG,SAAS,gBAC7D,KAAK,CAAC,kBAAkB,GAAG,KAAK,CAAC,QAAQ,CAAC,aAAa,GAAG,SAAS,eACpE,KAAK,CAAC,kBAAkB,GAAG,QAAQ,GAAG,SAAS,EAC1D,EAAE,EAAE,KAAK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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","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'} 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}>\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}