@mgdis/mg-components 5.19.3 → 5.20.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 (488) hide show
  1. package/dist/cjs/{components.utils-69435877.js → components.utils-cd908d4e.js} +102 -99
  2. package/dist/cjs/components.utils-cd908d4e.js.map +1 -0
  3. package/dist/cjs/{index-60dd0c56.js → index-8532b5e9.js} +185 -87
  4. package/dist/cjs/index-8532b5e9.js.map +1 -0
  5. package/dist/cjs/loader.cjs.js +2 -2
  6. package/dist/cjs/mg-action-more_34.cjs.entry.js +5115 -5110
  7. package/dist/cjs/mg-action-more_34.cjs.entry.js.map +1 -1
  8. package/dist/cjs/mg-components.cjs.js +3 -3
  9. package/dist/cjs/mg-components.cjs.js.map +1 -1
  10. package/dist/cjs/mg-item-more.cjs.entry.js +224 -224
  11. package/dist/cjs/mg-item-more.cjs.entry.js.map +1 -1
  12. package/dist/collection/assets/icons/index.js +192 -190
  13. package/dist/collection/assets/icons/index.js.map +1 -0
  14. package/dist/collection/collection-manifest.json +6 -6
  15. package/dist/collection/components/atoms/mg-badge/mg-badge.js +161 -161
  16. package/dist/collection/components/atoms/mg-badge/mg-badge.js.map +1 -1
  17. package/dist/collection/components/atoms/mg-button/mg-button.js +362 -362
  18. package/dist/collection/components/atoms/mg-button/mg-button.js.map +1 -1
  19. package/dist/collection/components/atoms/mg-card/mg-card.js +126 -126
  20. package/dist/collection/components/atoms/mg-card/mg-card.js.map +1 -1
  21. package/dist/collection/components/atoms/mg-character-left/mg-character-left.js +101 -101
  22. package/dist/collection/components/atoms/mg-character-left/mg-character-left.js.map +1 -1
  23. package/dist/collection/components/atoms/mg-divider/mg-divider.js +47 -47
  24. package/dist/collection/components/atoms/mg-divider/mg-divider.js.map +1 -1
  25. package/dist/collection/components/atoms/mg-icon/mg-icon.js +231 -231
  26. package/dist/collection/components/atoms/mg-icon/mg-icon.js.map +1 -1
  27. package/dist/collection/components/atoms/mg-input-title/mg-input-title.js +132 -132
  28. package/dist/collection/components/atoms/mg-input-title/mg-input-title.js.map +1 -1
  29. package/dist/collection/components/atoms/mg-tag/mg-tag.js +158 -158
  30. package/dist/collection/components/atoms/mg-tag/mg-tag.js.map +1 -1
  31. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.js +46 -46
  32. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.js.map +1 -1
  33. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.conf.js +3 -3
  34. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.conf.js.map +1 -1
  35. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +398 -398
  36. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js.map +1 -1
  37. package/dist/collection/components/molecules/inputs/MgInput.conf.js +2 -2
  38. package/dist/collection/components/molecules/inputs/MgInput.conf.js.map +1 -1
  39. package/dist/collection/components/molecules/inputs/MgInput.js +84 -84
  40. package/dist/collection/components/molecules/inputs/MgInput.js.map +1 -1
  41. package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js +8 -8
  42. package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js.map +1 -1
  43. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js +266 -266
  44. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js.map +1 -1
  45. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.js +4 -4
  46. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.js.map +1 -1
  47. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +788 -791
  48. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js.map +1 -1
  49. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.conf.js +4 -4
  50. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.conf.js.map +1 -1
  51. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +588 -578
  52. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js.map +1 -1
  53. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf.js +4 -4
  54. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf.js.map +1 -1
  55. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +778 -773
  56. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js.map +1 -1
  57. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +536 -526
  58. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js.map +1 -1
  59. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +565 -555
  60. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js.map +1 -1
  61. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +700 -695
  62. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js.map +1 -1
  63. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +770 -760
  64. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js.map +1 -1
  65. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +705 -695
  66. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js.map +1 -1
  67. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +527 -522
  68. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js.map +1 -1
  69. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.conf.js +2 -2
  70. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.conf.js.map +1 -1
  71. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js +263 -263
  72. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js.map +1 -1
  73. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.conf.js +6 -6
  74. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.conf.js.map +1 -1
  75. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js +423 -423
  76. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js.map +1 -1
  77. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +214 -214
  78. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js.map +1 -1
  79. package/dist/collection/components/molecules/mg-details/mg-details.js +155 -150
  80. package/dist/collection/components/molecules/mg-details/mg-details.js.map +1 -1
  81. package/dist/collection/components/molecules/mg-form/mg-form.js +332 -327
  82. package/dist/collection/components/molecules/mg-form/mg-form.js.map +1 -1
  83. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +85 -85
  84. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js.map +1 -1
  85. package/dist/collection/components/molecules/mg-item-more/mg-item-more.js +189 -189
  86. package/dist/collection/components/molecules/mg-item-more/mg-item-more.js.map +1 -1
  87. package/dist/collection/components/molecules/mg-message/mg-message.js +325 -304
  88. package/dist/collection/components/molecules/mg-message/mg-message.js.map +1 -1
  89. package/dist/collection/components/molecules/mg-modal/mg-modal.js +317 -317
  90. package/dist/collection/components/molecules/mg-modal/mg-modal.js.map +1 -1
  91. package/dist/collection/components/molecules/mg-pagination/mg-pagination.conf.js +2 -2
  92. package/dist/collection/components/molecules/mg-pagination/mg-pagination.conf.js.map +1 -1
  93. package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +216 -216
  94. package/dist/collection/components/molecules/mg-pagination/mg-pagination.js.map +1 -1
  95. package/dist/collection/components/molecules/mg-panel/mg-panel.js +409 -399
  96. package/dist/collection/components/molecules/mg-panel/mg-panel.js.map +1 -1
  97. package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js +91 -91
  98. package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js.map +1 -1
  99. package/dist/collection/components/molecules/mg-popover/mg-popover.js +336 -329
  100. package/dist/collection/components/molecules/mg-popover/mg-popover.js.map +1 -1
  101. package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +94 -94
  102. package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js.map +1 -1
  103. package/dist/collection/components/molecules/mg-tabs/mg-tabs.conf.js +4 -4
  104. package/dist/collection/components/molecules/mg-tabs/mg-tabs.conf.js.map +1 -1
  105. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +348 -343
  106. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js.map +1 -1
  107. package/dist/collection/locales/fr/messages.json +4 -4
  108. package/dist/collection/locales/index.spec.js +20 -20
  109. package/dist/collection/locales/index.spec.js.map +1 -1
  110. package/dist/collection/utils/behaviors.utils.js +127 -127
  111. package/dist/collection/utils/behaviors.utils.js.map +1 -1
  112. package/dist/collection/utils/behaviors.utils.spec.js +42 -42
  113. package/dist/collection/utils/behaviors.utils.spec.js.map +1 -1
  114. package/dist/collection/utils/components.utils.js +77 -75
  115. package/dist/collection/utils/components.utils.js.map +1 -1
  116. package/dist/collection/utils/components.utils.spec.js +150 -140
  117. package/dist/collection/utils/components.utils.spec.js.map +1 -1
  118. package/dist/collection/utils/e2e.test.utils.js +21 -21
  119. package/dist/collection/utils/e2e.test.utils.js.map +1 -1
  120. package/dist/collection/utils/locale.utils.js +17 -17
  121. package/dist/collection/utils/locale.utils.js.map +1 -1
  122. package/dist/collection/utils/locale.utils.spec.js +45 -45
  123. package/dist/collection/utils/locale.utils.spec.js.map +1 -1
  124. package/dist/collection/utils/playwright.e2e.test.utils.js +41 -41
  125. package/dist/collection/utils/playwright.e2e.test.utils.js.map +1 -1
  126. package/dist/collection/utils/playwright.fixture.js +24 -0
  127. package/dist/collection/utils/playwright.fixture.js.map +1 -0
  128. package/dist/collection/utils/unit.test.utils.js +50 -50
  129. package/dist/collection/utils/unit.test.utils.js.map +1 -1
  130. package/dist/components/MgInput.js +98 -98
  131. package/dist/components/MgInput.js.map +1 -1
  132. package/dist/components/components.utils.js +78 -76
  133. package/dist/components/components.utils.js.map +1 -1
  134. package/dist/components/index2.js +21 -21
  135. package/dist/components/index2.js.map +1 -1
  136. package/dist/components/mg-action-more.d.ts +2 -2
  137. package/dist/components/mg-action-more.js +173 -173
  138. package/dist/components/mg-action-more.js.map +1 -1
  139. package/dist/components/mg-badge.d.ts +2 -2
  140. package/dist/components/mg-badge2.js +83 -83
  141. package/dist/components/mg-badge2.js.map +1 -1
  142. package/dist/components/mg-button.d.ts +2 -2
  143. package/dist/components/mg-button2.js +182 -182
  144. package/dist/components/mg-button2.js.map +1 -1
  145. package/dist/components/mg-card.d.ts +2 -2
  146. package/dist/components/mg-card2.js +77 -77
  147. package/dist/components/mg-card2.js.map +1 -1
  148. package/dist/components/mg-character-left.d.ts +2 -2
  149. package/dist/components/mg-character-left2.js +50 -50
  150. package/dist/components/mg-character-left2.js.map +1 -1
  151. package/dist/components/mg-details.d.ts +2 -2
  152. package/dist/components/mg-details.js +69 -69
  153. package/dist/components/mg-details.js.map +1 -1
  154. package/dist/components/mg-divider.d.ts +2 -2
  155. package/dist/components/mg-divider.js +30 -30
  156. package/dist/components/mg-divider.js.map +1 -1
  157. package/dist/components/mg-form.d.ts +2 -2
  158. package/dist/components/mg-form.js +171 -171
  159. package/dist/components/mg-form.js.map +1 -1
  160. package/dist/components/mg-icon.d.ts +2 -2
  161. package/dist/components/mg-icon2.js +318 -316
  162. package/dist/components/mg-icon2.js.map +1 -1
  163. package/dist/components/mg-illustrated-message.d.ts +2 -2
  164. package/dist/components/mg-illustrated-message.js +51 -51
  165. package/dist/components/mg-illustrated-message.js.map +1 -1
  166. package/dist/components/mg-input-checkbox-paginated.d.ts +2 -2
  167. package/dist/components/mg-input-checkbox-paginated2.js +170 -170
  168. package/dist/components/mg-input-checkbox-paginated2.js.map +1 -1
  169. package/dist/components/mg-input-checkbox.d.ts +2 -2
  170. package/dist/components/mg-input-checkbox.js +477 -480
  171. package/dist/components/mg-input-checkbox.js.map +1 -1
  172. package/dist/components/mg-input-date.d.ts +2 -2
  173. package/dist/components/mg-input-date.js +265 -265
  174. package/dist/components/mg-input-date.js.map +1 -1
  175. package/dist/components/mg-input-numeric.d.ts +2 -2
  176. package/dist/components/mg-input-numeric.js +353 -353
  177. package/dist/components/mg-input-numeric.js.map +1 -1
  178. package/dist/components/mg-input-password.d.ts +2 -2
  179. package/dist/components/mg-input-password.js +204 -204
  180. package/dist/components/mg-input-password.js.map +1 -1
  181. package/dist/components/mg-input-radio.d.ts +2 -2
  182. package/dist/components/mg-input-radio.js +234 -234
  183. package/dist/components/mg-input-radio.js.map +1 -1
  184. package/dist/components/mg-input-select.d.ts +2 -2
  185. package/dist/components/mg-input-select2.js +315 -315
  186. package/dist/components/mg-input-select2.js.map +1 -1
  187. package/dist/components/mg-input-text.d.ts +2 -2
  188. package/dist/components/mg-input-text2.js +305 -305
  189. package/dist/components/mg-input-text2.js.map +1 -1
  190. package/dist/components/mg-input-textarea.d.ts +2 -2
  191. package/dist/components/mg-input-textarea.js +276 -276
  192. package/dist/components/mg-input-textarea.js.map +1 -1
  193. package/dist/components/mg-input-title.d.ts +2 -2
  194. package/dist/components/mg-input-title2.js +60 -60
  195. package/dist/components/mg-input-title2.js.map +1 -1
  196. package/dist/components/mg-input-toggle.d.ts +2 -2
  197. package/dist/components/mg-input-toggle.js +251 -251
  198. package/dist/components/mg-input-toggle.js.map +1 -1
  199. package/dist/components/mg-item-more.d.ts +2 -2
  200. package/dist/components/mg-item-more.js +285 -285
  201. package/dist/components/mg-item-more.js.map +1 -1
  202. package/dist/components/mg-menu-item.d.ts +2 -2
  203. package/dist/components/mg-menu-item2.js +344 -344
  204. package/dist/components/mg-menu-item2.js.map +1 -1
  205. package/dist/components/mg-menu.conf.js +2 -2
  206. package/dist/components/mg-menu.conf.js.map +1 -1
  207. package/dist/components/mg-menu.d.ts +2 -2
  208. package/dist/components/mg-menu2.js +176 -176
  209. package/dist/components/mg-menu2.js.map +1 -1
  210. package/dist/components/mg-message.d.ts +2 -2
  211. package/dist/components/mg-message.js +197 -192
  212. package/dist/components/mg-message.js.map +1 -1
  213. package/dist/components/mg-modal.d.ts +2 -2
  214. package/dist/components/mg-modal.js +198 -198
  215. package/dist/components/mg-modal.js.map +1 -1
  216. package/dist/components/mg-pagination.d.ts +2 -2
  217. package/dist/components/mg-pagination2.js +133 -133
  218. package/dist/components/mg-pagination2.js.map +1 -1
  219. package/dist/components/mg-panel.d.ts +2 -2
  220. package/dist/components/mg-panel.js +238 -238
  221. package/dist/components/mg-panel.js.map +1 -1
  222. package/dist/components/mg-popover-content.d.ts +2 -2
  223. package/dist/components/mg-popover-content2.js +69 -69
  224. package/dist/components/mg-popover-content2.js.map +1 -1
  225. package/dist/components/mg-popover.d.ts +2 -2
  226. package/dist/components/mg-popover2.js +224 -222
  227. package/dist/components/mg-popover2.js.map +1 -1
  228. package/dist/components/mg-skip-links.d.ts +2 -2
  229. package/dist/components/mg-skip-links.js +57 -57
  230. package/dist/components/mg-skip-links.js.map +1 -1
  231. package/dist/components/mg-tabs.d.ts +2 -2
  232. package/dist/components/mg-tabs.js +243 -243
  233. package/dist/components/mg-tabs.js.map +1 -1
  234. package/dist/components/mg-tag.d.ts +2 -2
  235. package/dist/components/mg-tag.js +97 -97
  236. package/dist/components/mg-tag.js.map +1 -1
  237. package/dist/components/mg-tooltip-content.d.ts +2 -2
  238. package/dist/components/mg-tooltip-content2.js +30 -30
  239. package/dist/components/mg-tooltip-content2.js.map +1 -1
  240. package/dist/components/mg-tooltip.d.ts +2 -2
  241. package/dist/components/mg-tooltip2.js +316 -316
  242. package/dist/components/mg-tooltip2.js.map +1 -1
  243. package/dist/esm/{components.utils-6cf27db1.js → components.utils-0d67c31c.js} +102 -100
  244. package/dist/esm/components.utils-0d67c31c.js.map +1 -0
  245. package/dist/esm/{index-0f833068.js → index-f34a3a2c.js} +185 -87
  246. package/dist/esm/index-f34a3a2c.js.map +1 -0
  247. package/dist/esm/loader.js +3 -3
  248. package/dist/esm/mg-action-more_34.entry.js +5115 -5110
  249. package/dist/esm/mg-action-more_34.entry.js.map +1 -1
  250. package/dist/esm/mg-components.js +4 -4
  251. package/dist/esm/mg-components.js.map +1 -1
  252. package/dist/esm/mg-item-more.entry.js +224 -224
  253. package/dist/esm/mg-item-more.entry.js.map +1 -1
  254. package/dist/mg-components/locales/fr/messages.json +4 -4
  255. package/dist/mg-components/mg-components.esm.js +1 -1
  256. package/dist/mg-components/mg-components.esm.js.map +1 -1
  257. package/dist/mg-components/p-629454f7.entry.js +2 -0
  258. package/dist/mg-components/p-629454f7.entry.js.map +1 -0
  259. package/dist/mg-components/p-7444ff40.js +3 -0
  260. package/dist/mg-components/p-7444ff40.js.map +1 -0
  261. package/dist/mg-components/p-af42d17b.js +2 -0
  262. package/dist/mg-components/p-af42d17b.js.map +1 -0
  263. package/dist/mg-components/{p-91feda5a.entry.js → p-e0fb0f3c.entry.js} +2 -2
  264. package/dist/types/assets/icons/index.d.ts +193 -0
  265. package/dist/types/components/atoms/mg-badge/mg-badge.d.ts +41 -41
  266. package/dist/types/components/atoms/mg-button/mg-button.d.ts +100 -100
  267. package/dist/types/components/atoms/mg-card/mg-card.d.ts +39 -39
  268. package/dist/types/components/atoms/mg-character-left/mg-character-left.d.ts +37 -37
  269. package/dist/types/components/atoms/mg-divider/mg-divider.d.ts +12 -12
  270. package/dist/types/components/atoms/mg-icon/mg-icon.d.ts +56 -56
  271. package/dist/types/components/atoms/mg-input-title/mg-input-title.d.ts +34 -34
  272. package/dist/types/components/atoms/mg-tag/mg-tag.d.ts +51 -51
  273. package/dist/types/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.d.ts +12 -12
  274. package/dist/types/components/atoms/mg-tooltip/mg-tooltip.conf.d.ts +3 -3
  275. package/dist/types/components/atoms/mg-tooltip/mg-tooltip.d.ts +113 -113
  276. package/dist/types/components/molecules/inputs/MgInput.conf.d.ts +5 -5
  277. package/dist/types/components/molecules/inputs/MgInput.d.ts +16 -16
  278. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.d.ts +100 -100
  279. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.d.ts +26 -26
  280. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +262 -262
  281. package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.conf.d.ts +4 -4
  282. package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.d.ts +150 -150
  283. package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf.d.ts +4 -4
  284. package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +223 -223
  285. package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.d.ts +142 -142
  286. package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.conf.d.ts +3 -3
  287. package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +152 -152
  288. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.conf.d.ts +6 -6
  289. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +193 -193
  290. package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +195 -195
  291. package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +181 -181
  292. package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.conf.d.ts +2 -2
  293. package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +141 -141
  294. package/dist/types/components/molecules/menu/mg-menu/mg-menu.conf.d.ts +2 -2
  295. package/dist/types/components/molecules/menu/mg-menu/mg-menu.d.ts +97 -97
  296. package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.conf.d.ts +6 -6
  297. package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.d.ts +179 -179
  298. package/dist/types/components/molecules/mg-action-more/mg-action-more.conf.d.ts +12 -12
  299. package/dist/types/components/molecules/mg-action-more/mg-action-more.d.ts +72 -72
  300. package/dist/types/components/molecules/mg-details/mg-details.d.ts +45 -45
  301. package/dist/types/components/molecules/mg-form/mg-form.d.ts +103 -103
  302. package/dist/types/components/molecules/mg-illustrated-message/mg-illustrated-message.d.ts +27 -27
  303. package/dist/types/components/molecules/mg-item-more/mg-item-more.conf.d.ts +5 -5
  304. package/dist/types/components/molecules/mg-item-more/mg-item-more.d.ts +61 -61
  305. package/dist/types/components/molecules/mg-message/mg-message.d.ts +100 -93
  306. package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +107 -107
  307. package/dist/types/components/molecules/mg-pagination/mg-pagination.conf.d.ts +2 -2
  308. package/dist/types/components/molecules/mg-pagination/mg-pagination.d.ts +74 -74
  309. package/dist/types/components/molecules/mg-panel/mg-panel.d.ts +149 -149
  310. package/dist/types/components/molecules/mg-popover/mg-popover-content/mg-popover-content.d.ts +43 -43
  311. package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +88 -88
  312. package/dist/types/components/molecules/mg-skip-links/mg-skip-links.conf.d.ts +2 -2
  313. package/dist/types/components/molecules/mg-skip-links/mg-skip-links.d.ts +40 -40
  314. package/dist/types/components/molecules/mg-tabs/mg-tabs.conf.d.ts +10 -10
  315. package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +118 -118
  316. package/dist/types/components.d.ts +294 -30
  317. package/dist/types/locales/index.d.ts +172 -172
  318. package/dist/types/stencil-public-runtime.d.ts +29 -0
  319. package/dist/types/utils/behaviors.utils.d.ts +65 -65
  320. package/dist/types/utils/components.utils.d.ts +32 -26
  321. package/dist/types/utils/locale.utils.d.ts +2 -2
  322. package/dist/types/utils/playwright.fixture.d.ts +3 -0
  323. package/dist/types/utils/unit.test.utils.d.ts +5 -5
  324. package/package.json +18 -32
  325. package/dist/cjs/components.utils-69435877.js.map +0 -1
  326. package/dist/cjs/index-60dd0c56.js.map +0 -1
  327. package/dist/collection/components/atoms/mg-badge/test/mg-badge.e2e.playwright.js +0 -33
  328. package/dist/collection/components/atoms/mg-badge/test/mg-badge.e2e.playwright.js.map +0 -1
  329. package/dist/collection/components/atoms/mg-badge/test/mg-badge.spec.js +0 -70
  330. package/dist/collection/components/atoms/mg-badge/test/mg-badge.spec.js.map +0 -1
  331. package/dist/collection/components/atoms/mg-button/test/mg-button.e2e.js +0 -91
  332. package/dist/collection/components/atoms/mg-button/test/mg-button.e2e.js.map +0 -1
  333. package/dist/collection/components/atoms/mg-button/test/mg-button.spec.js +0 -192
  334. package/dist/collection/components/atoms/mg-button/test/mg-button.spec.js.map +0 -1
  335. package/dist/collection/components/atoms/mg-card/test/mg-card.e2e.js +0 -36
  336. package/dist/collection/components/atoms/mg-card/test/mg-card.e2e.js.map +0 -1
  337. package/dist/collection/components/atoms/mg-card/test/mg-card.spec.js +0 -43
  338. package/dist/collection/components/atoms/mg-card/test/mg-card.spec.js.map +0 -1
  339. package/dist/collection/components/atoms/mg-character-left/test/mg-character-left.e2e.js +0 -15
  340. package/dist/collection/components/atoms/mg-character-left/test/mg-character-left.e2e.js.map +0 -1
  341. package/dist/collection/components/atoms/mg-character-left/test/mg-character-left.spec.js +0 -42
  342. package/dist/collection/components/atoms/mg-character-left/test/mg-character-left.spec.js.map +0 -1
  343. package/dist/collection/components/atoms/mg-divider/test/mg-divider.e2e.js +0 -11
  344. package/dist/collection/components/atoms/mg-divider/test/mg-divider.e2e.js.map +0 -1
  345. package/dist/collection/components/atoms/mg-divider/test/mg-divider.spec.js +0 -14
  346. package/dist/collection/components/atoms/mg-divider/test/mg-divider.spec.js.map +0 -1
  347. package/dist/collection/components/atoms/mg-icon/test/mg-icon.e2e.js +0 -55
  348. package/dist/collection/components/atoms/mg-icon/test/mg-icon.e2e.js.map +0 -1
  349. package/dist/collection/components/atoms/mg-icon/test/mg-icon.spec.js +0 -84
  350. package/dist/collection/components/atoms/mg-icon/test/mg-icon.spec.js.map +0 -1
  351. package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.e2e.playwright.js +0 -12
  352. package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.e2e.playwright.js.map +0 -1
  353. package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.spec.js +0 -23
  354. package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.spec.js.map +0 -1
  355. package/dist/collection/components/atoms/mg-tag/test/mg-tag.e2e.playwright.js +0 -23
  356. package/dist/collection/components/atoms/mg-tag/test/mg-tag.e2e.playwright.js.map +0 -1
  357. package/dist/collection/components/atoms/mg-tag/test/mg-tag.spec.js +0 -71
  358. package/dist/collection/components/atoms/mg-tag/test/mg-tag.spec.js.map +0 -1
  359. package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.e2e.js +0 -138
  360. package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.e2e.js.map +0 -1
  361. package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.spec.js +0 -272
  362. package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.spec.js.map +0 -1
  363. package/dist/collection/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.e2e.playwright.js +0 -237
  364. package/dist/collection/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.e2e.playwright.js.map +0 -1
  365. package/dist/collection/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.spec.js +0 -634
  366. package/dist/collection/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.spec.js.map +0 -1
  367. package/dist/collection/components/molecules/inputs/mg-input-date/test/mg-input-date.e2e.js +0 -123
  368. package/dist/collection/components/molecules/inputs/mg-input-date/test/mg-input-date.e2e.js.map +0 -1
  369. package/dist/collection/components/molecules/inputs/mg-input-date/test/mg-input-date.spec.js +0 -383
  370. package/dist/collection/components/molecules/inputs/mg-input-date/test/mg-input-date.spec.js.map +0 -1
  371. package/dist/collection/components/molecules/inputs/mg-input-numeric/test/mg-input-numeric.e2e.js +0 -212
  372. package/dist/collection/components/molecules/inputs/mg-input-numeric/test/mg-input-numeric.e2e.js.map +0 -1
  373. package/dist/collection/components/molecules/inputs/mg-input-numeric/test/mg-input-numeric.spec.js +0 -460
  374. package/dist/collection/components/molecules/inputs/mg-input-numeric/test/mg-input-numeric.spec.js.map +0 -1
  375. package/dist/collection/components/molecules/inputs/mg-input-password/test/mg-input-password.e2e.js +0 -115
  376. package/dist/collection/components/molecules/inputs/mg-input-password/test/mg-input-password.e2e.js.map +0 -1
  377. package/dist/collection/components/molecules/inputs/mg-input-password/test/mg-input-password.spec.js +0 -293
  378. package/dist/collection/components/molecules/inputs/mg-input-password/test/mg-input-password.spec.js.map +0 -1
  379. package/dist/collection/components/molecules/inputs/mg-input-radio/test/mg-input-radio.e2e.js +0 -154
  380. package/dist/collection/components/molecules/inputs/mg-input-radio/test/mg-input-radio.e2e.js.map +0 -1
  381. package/dist/collection/components/molecules/inputs/mg-input-radio/test/mg-input-radio.spec.js +0 -359
  382. package/dist/collection/components/molecules/inputs/mg-input-radio/test/mg-input-radio.spec.js.map +0 -1
  383. package/dist/collection/components/molecules/inputs/mg-input-select/test/mg-input-select.e2e.js +0 -194
  384. package/dist/collection/components/molecules/inputs/mg-input-select/test/mg-input-select.e2e.js.map +0 -1
  385. package/dist/collection/components/molecules/inputs/mg-input-select/test/mg-input-select.spec.js +0 -403
  386. package/dist/collection/components/molecules/inputs/mg-input-select/test/mg-input-select.spec.js.map +0 -1
  387. package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.e2e.playwright.js +0 -147
  388. package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.e2e.playwright.js.map +0 -1
  389. package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.spec.js +0 -355
  390. package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.spec.js.map +0 -1
  391. package/dist/collection/components/molecules/inputs/mg-input-textarea/test/mg-input-textarea.e2e.js +0 -129
  392. package/dist/collection/components/molecules/inputs/mg-input-textarea/test/mg-input-textarea.e2e.js.map +0 -1
  393. package/dist/collection/components/molecules/inputs/mg-input-textarea/test/mg-input-textarea.spec.js +0 -320
  394. package/dist/collection/components/molecules/inputs/mg-input-textarea/test/mg-input-textarea.spec.js.map +0 -1
  395. package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.e2e.playwright.js +0 -108
  396. package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.e2e.playwright.js.map +0 -1
  397. package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.spec.js +0 -247
  398. package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.spec.js.map +0 -1
  399. package/dist/collection/components/molecules/menu/mg-menu/test/mg-menu.e2e.playwright.js +0 -239
  400. package/dist/collection/components/molecules/menu/mg-menu/test/mg-menu.e2e.playwright.js.map +0 -1
  401. package/dist/collection/components/molecules/menu/mg-menu/test/mg-menu.spec.js +0 -175
  402. package/dist/collection/components/molecules/menu/mg-menu/test/mg-menu.spec.js.map +0 -1
  403. package/dist/collection/components/molecules/menu/mg-menu-item/test/mg-menu-item.e2e.playwright.js +0 -100
  404. package/dist/collection/components/molecules/menu/mg-menu-item/test/mg-menu-item.e2e.playwright.js.map +0 -1
  405. package/dist/collection/components/molecules/menu/mg-menu-item/test/mg-menu-item.spec.js +0 -295
  406. package/dist/collection/components/molecules/menu/mg-menu-item/test/mg-menu-item.spec.js.map +0 -1
  407. package/dist/collection/components/molecules/mg-action-more/test/mg-action-more.e2e.playwright.js +0 -136
  408. package/dist/collection/components/molecules/mg-action-more/test/mg-action-more.e2e.playwright.js.map +0 -1
  409. package/dist/collection/components/molecules/mg-action-more/test/mg-action-more.spec.js +0 -195
  410. package/dist/collection/components/molecules/mg-action-more/test/mg-action-more.spec.js.map +0 -1
  411. package/dist/collection/components/molecules/mg-details/test/mg-details.e2e.playwright.js +0 -30
  412. package/dist/collection/components/molecules/mg-details/test/mg-details.e2e.playwright.js.map +0 -1
  413. package/dist/collection/components/molecules/mg-details/test/mg-details.spec.js +0 -42
  414. package/dist/collection/components/molecules/mg-details/test/mg-details.spec.js.map +0 -1
  415. package/dist/collection/components/molecules/mg-form/test/mg-form.e2e.js +0 -169
  416. package/dist/collection/components/molecules/mg-form/test/mg-form.e2e.js.map +0 -1
  417. package/dist/collection/components/molecules/mg-form/test/mg-form.spec.js +0 -292
  418. package/dist/collection/components/molecules/mg-form/test/mg-form.spec.js.map +0 -1
  419. package/dist/collection/components/molecules/mg-illustrated-message/test/mg-illustrated-message.e2e.js +0 -39
  420. package/dist/collection/components/molecules/mg-illustrated-message/test/mg-illustrated-message.e2e.js.map +0 -1
  421. package/dist/collection/components/molecules/mg-illustrated-message/test/mg-illustrated-message.spec.js +0 -36
  422. package/dist/collection/components/molecules/mg-illustrated-message/test/mg-illustrated-message.spec.js.map +0 -1
  423. package/dist/collection/components/molecules/mg-item-more/test/mg-item-more.e2e.playwright.js +0 -85
  424. package/dist/collection/components/molecules/mg-item-more/test/mg-item-more.e2e.playwright.js.map +0 -1
  425. package/dist/collection/components/molecules/mg-item-more/test/mg-item-more.spec.js +0 -106
  426. package/dist/collection/components/molecules/mg-item-more/test/mg-item-more.spec.js.map +0 -1
  427. package/dist/collection/components/molecules/mg-message/test/mg-message.e2e.js +0 -64
  428. package/dist/collection/components/molecules/mg-message/test/mg-message.e2e.js.map +0 -1
  429. package/dist/collection/components/molecules/mg-message/test/mg-message.spec.js +0 -109
  430. package/dist/collection/components/molecules/mg-message/test/mg-message.spec.js.map +0 -1
  431. package/dist/collection/components/molecules/mg-modal/test/mg-modal.e2e.playwright.js +0 -62
  432. package/dist/collection/components/molecules/mg-modal/test/mg-modal.e2e.playwright.js.map +0 -1
  433. package/dist/collection/components/molecules/mg-modal/test/mg-modal.e2e.template.js +0 -40
  434. package/dist/collection/components/molecules/mg-modal/test/mg-modal.e2e.template.js.map +0 -1
  435. package/dist/collection/components/molecules/mg-modal/test/mg-modal.firefox.e2e.playwright.js +0 -26
  436. package/dist/collection/components/molecules/mg-modal/test/mg-modal.firefox.e2e.playwright.js.map +0 -1
  437. package/dist/collection/components/molecules/mg-modal/test/mg-modal.spec.js +0 -122
  438. package/dist/collection/components/molecules/mg-modal/test/mg-modal.spec.js.map +0 -1
  439. package/dist/collection/components/molecules/mg-pagination/test/mg-pagination.e2e.playwright.js +0 -57
  440. package/dist/collection/components/molecules/mg-pagination/test/mg-pagination.e2e.playwright.js.map +0 -1
  441. package/dist/collection/components/molecules/mg-pagination/test/mg-pagination.spec.js +0 -121
  442. package/dist/collection/components/molecules/mg-pagination/test/mg-pagination.spec.js.map +0 -1
  443. package/dist/collection/components/molecules/mg-panel/test/mg-panel.e2e.playwright.js +0 -106
  444. package/dist/collection/components/molecules/mg-panel/test/mg-panel.e2e.playwright.js.map +0 -1
  445. package/dist/collection/components/molecules/mg-panel/test/mg-panel.spec.js +0 -213
  446. package/dist/collection/components/molecules/mg-panel/test/mg-panel.spec.js.map +0 -1
  447. package/dist/collection/components/molecules/mg-popover/test/mg-popover.e2e.playwright.js +0 -140
  448. package/dist/collection/components/molecules/mg-popover/test/mg-popover.e2e.playwright.js.map +0 -1
  449. package/dist/collection/components/molecules/mg-popover/test/mg-popover.spec.js +0 -142
  450. package/dist/collection/components/molecules/mg-popover/test/mg-popover.spec.js.map +0 -1
  451. package/dist/collection/components/molecules/mg-skip-links/test/mg-skip-links.e2e.js +0 -55
  452. package/dist/collection/components/molecules/mg-skip-links/test/mg-skip-links.e2e.js.map +0 -1
  453. package/dist/collection/components/molecules/mg-skip-links/test/mg-skip-links.spec.js +0 -55
  454. package/dist/collection/components/molecules/mg-skip-links/test/mg-skip-links.spec.js.map +0 -1
  455. package/dist/collection/components/molecules/mg-tabs/test/mg-tabs.e2e.playwright.js +0 -76
  456. package/dist/collection/components/molecules/mg-tabs/test/mg-tabs.e2e.playwright.js.map +0 -1
  457. package/dist/collection/components/molecules/mg-tabs/test/mg-tabs.spec.js +0 -332
  458. package/dist/collection/components/molecules/mg-tabs/test/mg-tabs.spec.js.map +0 -1
  459. package/dist/collection/utils/stencil.e2e.test.utils.js +0 -33
  460. package/dist/collection/utils/stencil.e2e.test.utils.js.map +0 -1
  461. package/dist/esm/components.utils-6cf27db1.js.map +0 -1
  462. package/dist/esm/index-0f833068.js.map +0 -1
  463. package/dist/mg-components/p-10ed4425.entry.js +0 -2
  464. package/dist/mg-components/p-10ed4425.entry.js.map +0 -1
  465. package/dist/mg-components/p-36a51c5e.js +0 -2
  466. package/dist/mg-components/p-36a51c5e.js.map +0 -1
  467. package/dist/mg-components/p-9b12021b.js +0 -3
  468. package/dist/mg-components/p-9b12021b.js.map +0 -1
  469. package/dist/types/components/atoms/mg-badge/test/mg-badge.e2e.playwright.d.ts +0 -1
  470. package/dist/types/components/atoms/mg-input-title/test/mg-input-title.e2e.playwright.d.ts +0 -1
  471. package/dist/types/components/atoms/mg-tag/test/mg-tag.e2e.playwright.d.ts +0 -1
  472. package/dist/types/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.e2e.playwright.d.ts +0 -1
  473. package/dist/types/components/molecules/inputs/mg-input-text/test/mg-input-text.e2e.playwright.d.ts +0 -1
  474. package/dist/types/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.e2e.playwright.d.ts +0 -1
  475. package/dist/types/components/molecules/menu/mg-menu/test/mg-menu.e2e.playwright.d.ts +0 -1
  476. package/dist/types/components/molecules/menu/mg-menu-item/test/mg-menu-item.e2e.playwright.d.ts +0 -1
  477. package/dist/types/components/molecules/mg-action-more/test/mg-action-more.e2e.playwright.d.ts +0 -2
  478. package/dist/types/components/molecules/mg-details/test/mg-details.e2e.playwright.d.ts +0 -1
  479. package/dist/types/components/molecules/mg-item-more/test/mg-item-more.e2e.playwright.d.ts +0 -1
  480. package/dist/types/components/molecules/mg-modal/test/mg-modal.e2e.playwright.d.ts +0 -1
  481. package/dist/types/components/molecules/mg-modal/test/mg-modal.e2e.template.d.ts +0 -12
  482. package/dist/types/components/molecules/mg-modal/test/mg-modal.firefox.e2e.playwright.d.ts +0 -1
  483. package/dist/types/components/molecules/mg-pagination/test/mg-pagination.e2e.playwright.d.ts +0 -1
  484. package/dist/types/components/molecules/mg-panel/test/mg-panel.e2e.playwright.d.ts +0 -1
  485. package/dist/types/components/molecules/mg-popover/test/mg-popover.e2e.playwright.d.ts +0 -1
  486. package/dist/types/components/molecules/mg-tabs/test/mg-tabs.e2e.playwright.d.ts +0 -1
  487. package/dist/types/utils/stencil.e2e.test.utils.d.ts +0 -14
  488. /package/dist/mg-components/{p-91feda5a.entry.js.map → p-e0fb0f3c.entry.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"mg-menu-item.js","sourceRoot":"","sources":["../../../../../src/components/molecules/menu/mg-menu-item/mg-menu-item.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAgB,MAAM,eAAe,CAAC;AACrG,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACxF,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAW7C,MAAM,OAAO,UAAU;;IACrB;;kBAEc;IAEG,SAAI,GAAG,cAAc,CAAC;IACtB,qBAAgB,GAAG,mCAAmC,CAAC;IA+IxE;;gBAEY;IAEZ;;OAEG;IACK,mBAAc,GAAG,GAAS,EAAE;MAClC,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC;IACjC,CAAC,CAAC;IAEF;;;;;OAKG;IACK,cAAS,GAAG,CAAC,iBAAwC,EAAE,MAA4B,EAAW,EAAE,CAAC,iBAAiB,CAAC,MAAM,KAAK,MAAM,CAAC;IAE7I;;;;;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AAE,CAAC,CAAC,CAAC,CACvB,kBAAY,OAAO,EAAE,IAAI,CAAC,QAAQ,EAAE,SAAS,EAAC,cAAc,EAAC,SAAS,EAAE,IAAI,sBAAoB,IAAI,CAAC,oBAAoB,EAAE,UAAU,EAAE,IAAI,CAAC,oBAAoB,EAAE;MAC/J,IAAI,CAAC,wBAAwB,EAAE;MAChC,WAAK,KAAK,EAAE,mBAAmB,EAAE,EAAE,IAAI,EAAC,SAAS,IAC9C,IAAI,CAAC,UAAU,EAAE,CACd,CACK,CACd,CAAC,CAAC,CAAC,CACF;MACE,IAAI,CAAC,wBAAwB,EAAE;MAC/B,WAAK,GAAG,EAAC,oBAAoB,EAAC,KAAK,EAAE,mBAAmB,EAAE,EAAE,MAAM,EAAE,CAAC,IAAI,CAAC,QAAQ,IAC/E,IAAI,CAAC,UAAU,EAAE,CACd;KACP,CACF,CACI,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Prop, State, Host, Watch, Element, Event, EventEmitter } from '@stencil/core';\nimport { ClassList, createID, isValidString } from '../../../../utils/components.utils';\nimport { initLocales } from '../../../../locales';\nimport { Direction } from '../mg-menu/mg-menu.conf';\nimport { Status } from './mg-menu-item.conf';\nimport type { MessageType } from '../../mg-item-more/mg-item-more.conf';\nimport type { MenuSizeType } from '../mg-menu/mg-menu.conf';\nimport type { DirectionType } from './mg-menu-item.conf';\nimport type { MgPopover } from '../../mg-popover/mg-popover';\n\n@Component({\n tag: 'mg-menu-item',\n styleUrl: '../../../../../node_modules/@mgdis/styles/dist/components/mg-menu-item.css',\n shadow: true,\n})\nexport class MgMenuItem {\n /************\n * Internal *\n ************/\n\n private readonly name = 'mg-menu-item';\n private readonly navigationButton = 'mg-c-menu-item__navigation-button';\n private badgeLabel: string;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgMenuItemElement;\n\n /************\n * Props *\n ************/\n\n /**\n * Identifier is used to control mg-popover\n */\n @Prop() identifier = createID('mg-menu-item');\n\n /**\n * Define menu-item href\n * when defined menu-item contain an anchor instead of button\n */\n @Prop() href: string;\n\n /**\n * Define menu-item status.\n */\n @Prop({ reflect: true, mutable: true }) status: Status = Status.VISIBLE;\n @Watch('status')\n validateStatus(newValue: MgMenuItem['status'], oldValue?: MgMenuItem['status']): void {\n if (oldValue !== undefined) {\n this.navigationButtonClassList.delete(`${this.navigationButton}--${oldValue}`);\n }\n this.navigationButtonClassList.add(`${this.navigationButton}--${newValue}`);\n this.statusChange.emit(newValue);\n }\n\n /**\n * Define menu-item content expanded.\n */\n @Prop({ mutable: true }) expanded = false;\n @Watch('expanded')\n validateExpanded(newValue: MgMenuItem['expanded']): void {\n if (typeof newValue !== 'boolean') throw new Error(`<${this.name}> prop \"expanded\" must be a boolean.`);\n\n // if menu-item has sub-menu we have to apply some updates:\n if (this.hasChildren) {\n const subItems = Array.from(this.element.querySelectorAll(this.name));\n if (!newValue) {\n // - when main menu item is NOT expanded we need NOT expanded sub-items and NOT expanded sub-content\n subItems.forEach(item => {\n item.expanded = false;\n });\n } else if (this.element.querySelector(`${this.name}[status=\"${Status.ACTIVE}\"]`) !== null) {\n // - when expanded and contain an active item parents are expended too\n subItems.forEach(item => {\n if (this.hasStatus(item, Status.ACTIVE)) {\n item.expanded = true;\n }\n });\n }\n }\n }\n\n /**********\n * Events *\n *********/\n\n /**\n * Emited event when status change\n */\n @Event({ eventName: 'status-change' }) statusChange: EventEmitter<MgMenuItem['status']>;\n\n /**\n * Emited event when item is loaded\n */\n @Event({ eventName: 'item-loaded' }) itemLoaded: EventEmitter<void>;\n\n /**********\n * States *\n *********/\n\n /**\n * Define menu-item size.\n */\n @State() size: MenuSizeType = 'regular';\n @Watch('size')\n validateSize(newValue: MgMenuItem['size'], oldValue?: MgMenuItem['size']): void {\n this.navigationButtonClassList.delete(`${this.navigationButton}--size-${oldValue}`);\n this.navigationButtonClassList.add(`${this.navigationButton}--size-${newValue}`);\n }\n\n /**\n * Component button classes\n */\n @State() navigationButtonClassList: ClassList = new ClassList([this.navigationButton]);\n\n /**\n * Parent menu direction\n */\n @State() direction: DirectionType;\n @Watch('direction')\n validateDirection(newValue: MgMenuItem['direction']): void {\n // manage menu items style depending to parent menu horientation\n this.element.setAttribute(`data-style-direction-${newValue}`, '');\n this.navigationButtonClassList.add(`${this.navigationButton}--${newValue}`);\n // manage all sub levels child menu-items level with data-level attribut\n if (this.isDirection(Direction.VERTICAL, newValue)) {\n Array.from(this.element.querySelectorAll('mg-menu-item')).forEach(item => {\n item.dataset.level = `${(Number(item.dataset.level) || 1) + 1}`;\n });\n }\n }\n\n /**\n * Does component is in main menu\n */\n @State() isInMainMenu: boolean;\n\n /**\n * Does element is item-more\n */\n @State() isItemMore: boolean;\n\n /**\n * Does component have children.\n */\n @State() hasChildren = false;\n @Watch('hasChildren')\n validateHasChildren(newValue: boolean): void {\n if (newValue && this.element.href !== undefined) {\n throw new Error(`<${this.name}> prop \"href\" is unauthorizied when element is a parent.`);\n }\n }\n\n /**\n * Does component should display notification badge.\n */\n @State() displayNotificationBadge: boolean;\n\n /***********\n * Methods *\n **********/\n\n /**\n * Toggle expanded prop value\n */\n private toggleExpanded = (): void => {\n this.expanded = !this.expanded;\n };\n\n /**\n * Does an Element have given Status\n * @param mgMenuItemElement - to parse\n * @param status - to check\n * @returns true if element with status is found\n */\n private hasStatus = (mgMenuItemElement: HTMLMgMenuItemElement, status: MgMenuItem['status']): boolean => mgMenuItemElement.status === status;\n\n /**\n * Is component contextual direction match the given direction\n * @param direction - in parent menu\n * @param compareWith - direction to compare with. Default: `this.direction`\n * @returns true is direction match the direction propertie\n */\n private isDirection = (direction: MgMenuItem['direction'], compareWith = this.direction): boolean => direction === compareWith;\n\n /**\n * Update displayNotificationBadge\n * current component notification badge have priority over the slot badge when submenu contain badge\n */\n private updateDisplayNotificationBadge = (): void => {\n const childMenu = this.element.querySelector('mg-menu');\n this.displayNotificationBadge =\n childMenu !== null &&\n Array.from(childMenu.children).some((subItem: HTMLMgMenuItemElement) => subItem.querySelector('mg-badge') !== null && subItem.getAttribute('hidden') === null);\n };\n\n /**\n * Method to control if one of component children have active status\n * @returns truthy if component has active child\n */\n private hasActiveChild = (): boolean =>\n Array.from(this.element.querySelector('mg-menu')?.children || []).some(\n (element: HTMLMgMenuItemElement) => element.nodeName === 'MG-MENU-ITEM' && this.hasStatus(element, Status.ACTIVE) && element.getAttribute('hidden') === null,\n );\n\n /**\n * Validate slots\n * @param guard - prevent action with guard. Default: false.\n */\n private validateSlot = (guard = false): void => {\n // slot title AND metadata validation\n // add title on label AND metada slots due to text-overflow on these element\n if (Array.from(this.element.children).find(child => child.getAttribute('slot') === 'label') === undefined) throw new Error(`<${this.name}> slot \"label\" is required.`);\n ['label', 'metadata'].forEach(slot => {\n Array.from(this.element.querySelectorAll(`[slot=\"${slot}\"]`)).forEach(element => {\n if (!isValidString(element.textContent)) throw new Error(`<${this.name}> slot \"${slot}\" must have text content.`);\n if ((guard && element.getAttribute('title') === null) || !guard) element.setAttribute('title', element.textContent);\n });\n });\n };\n\n /**\n * Update status\n * @param guard - status to exclude from process in addition to [Status.HIDDEN, Status.DISABLED] . Default: [].\n */\n private updateStatus = (guard = []): void => {\n if (![Status.HIDDEN, Status.DISABLED, ...guard].includes(this.status)) {\n this.status = this.hasActiveChild() ? Status.ACTIVE : Status.VISIBLE;\n }\n };\n\n /**\n * Init event-listeners\n */\n private initListeners = (): void => {\n // manage first sub-level menu-items\n Array.from(this.element.querySelector('mg-menu')?.children || []).forEach(item => {\n if (item.nodeName === 'MG-MENU-ITEM') {\n // manage child menu listener\n item.addEventListener('status-change', () => {\n this.updateStatus();\n });\n }\n });\n };\n\n /**\n * Get mg-popover identifier\n * @returns generated mg-popover identifier\n */\n private getPopoverIdentifier = (): MgPopover['identifier'] => `${this.identifier}-popover`;\n\n /**\n * Render popover clickoutside guard for content slot\n */\n private updatePopoverGuard(): void {\n if (this.displayPopover())\n Array.from(this.element.children)\n .filter((child: HTMLElement) => child.getAttribute('slot') === null && child.nodeName !== 'MG-MENU' && Boolean(child.dataset))\n .forEach((slot: HTMLElement) => (slot.dataset.mgPopoverGuard = this.getPopoverIdentifier()));\n }\n\n /**\n * Condition to know if component should display a mg-popover\n * @returns truthy if component display popover\n */\n private displayPopover = (): boolean => this.isDirection(Direction.HORIZONTAL) && this.hasChildren && this.href === undefined;\n\n /************\n * Handlers *\n ************/\n\n /**\n * Handle interacrtive element click\n * @param event - click on element\n */\n private handleElementCLick = (event: MouseEvent): void => {\n if ((this.hasChildren && !this.isInMainMenu) || this.status === Status.DISABLED) {\n event.preventDefault();\n event.stopPropagation();\n }\n\n // toggle expanded when mg-menu-item has child items\n if (this.hasChildren) this.toggleExpanded();\n };\n\n /**\n * Handle popover element display-change event\n * @param event - popover display event\n */\n private handlePopoverDisplay = (event: CustomEvent): void => {\n this.expanded = event.detail;\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Validate props\n */\n componentWillLoad(): void {\n // has children items that is NOT [slot='image' | 'information' | 'label' | 'metadata'] element\n // we store only matching elements\n this.hasChildren = Array.from(this.element.children).some(child => !['image', 'information', 'label', 'metadata'].includes(child.getAttribute('slot')));\n this.badgeLabel = (initLocales(this.element).messages as { plusMenu: MessageType }).plusMenu.badgeLabel;\n this.isItemMore = this.element.dataset.overflowMore !== undefined;\n\n // Validate props\n this.validateStatus(this.status);\n this.validateExpanded(this.expanded);\n\n // Validate states\n this.validateSize(this.size);\n }\n\n /**\n * Check if component slots configuration\n * @returns timeout\n */\n componentDidLoad(): ReturnType<typeof setTimeout> {\n // validation\n this.validateSlot(true);\n\n // update props and states after componentDidLoad hook\n // return a promise to process action only in the FIRST render().\n // https://stenciljs.com/docs/component-lifecycle#componentwillload\n return setTimeout(() => {\n // define menu-item context states\n const menu = this.element.closest('mg-menu');\n this.direction = this.isItemMore || menu === null ? Direction.HORIZONTAL : menu.direction;\n this.isInMainMenu = menu !== null && this.element.parentElement.closest('mg-menu-item') === null;\n if (menu?.size !== undefined) this.size = menu.size;\n\n if (this.isItemMore) this.size = this.element.dataset.size as MgMenuItem['size'];\n\n // when main menu item contain an active item it will get the active style\n // AND if item is in vertical menu it will be expanded\n if (this.hasActiveChild() && this.isInMainMenu) this.expanded = this.isDirection(Direction.VERTICAL);\n\n this.updateStatus([Status.ACTIVE]);\n this.updateDisplayNotificationBadge();\n this.updatePopoverGuard();\n\n // manage child dom changes with mutationObserver and listzners\n this.initListeners();\n\n // emit loaded event when component is fully loaded\n this.itemLoaded.emit();\n\n new MutationObserver(mutationsList => {\n if (mutationsList.some(mutation => mutation.attributeName === 'hidden')) this.updateStatus();\n if (mutationsList.some(mutation => mutation.type === 'characterData')) this.validateSlot();\n this.updateDisplayNotificationBadge();\n }).observe(this.element, { attributes: true, childList: true, characterData: true, subtree: true });\n }, 0);\n }\n\n /**\n * Render ineractive element\n * @returns HTML Element\n */\n private renderInteractiveElement(): HTMLElement {\n const TagName: string = this.href !== undefined ? 'a' : 'button';\n return (\n <TagName\n href={this.href}\n class={this.navigationButtonClassList.join()}\n tabindex={[Status.DISABLED, Status.HIDDEN].includes(this.status) ? -1 : undefined}\n disabled={this.status === Status.DISABLED}\n hidden={this.status === Status.HIDDEN}\n aria-expanded={this.hasChildren && this.expanded.toString()}\n aria-current={this.status === Status.ACTIVE && 'page'}\n onClick={this.handleElementCLick}\n >\n <slot name=\"image\"></slot>\n <div class={`${this.navigationButton}-center`}>\n <div class={`${this.navigationButton}-text-content`}>\n <slot name=\"label\"></slot>\n {!this.displayNotificationBadge && <slot name=\"information\"></slot>}\n {this.displayNotificationBadge && (\n <span class={`${this.navigationButton}-text-content-notification`}>\n <mg-badge label={this.badgeLabel} value=\"!\" variant=\"text-color\" slot=\"information\"></mg-badge>\n </span>\n )}\n </div>\n {this.size !== 'regular' && <slot name=\"metadata\"></slot>}\n </div>\n {this.hasChildren && this.href === undefined && (\n <span\n class={{\n [`${this.navigationButton}-chevron`]: true,\n [`${this.navigationButton}-chevron--rotate`]: this.expanded === true,\n }}\n >\n <mg-icon icon=\"chevron-down\" size=\"small\"></mg-icon>\n </span>\n )}\n </TagName>\n );\n }\n\n /**\n * Render slot\n * @returns HTML Element\n */\n private renderSlot = (): HTMLElement => <slot></slot>;\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n const getContainerClasses = () => ({\n ['mg-c-menu-item__collapse-container']: true,\n ['mg-c-menu-item__collapse-container--first-level']: (this.isInMainMenu || this.isItemMore) && this.isDirection(Direction.HORIZONTAL),\n });\n\n return (\n <Host role={this.isItemMore ? 'presentation' : 'listitem'}>\n {this.displayPopover() ? (\n <mg-popover display={this.expanded} placement=\"bottom-start\" arrowHide={true} onDisplay-change={this.handlePopoverDisplay} identifier={this.getPopoverIdentifier()}>\n {this.renderInteractiveElement()}\n <div class={getContainerClasses()} slot=\"content\">\n {this.renderSlot()}\n </div>\n </mg-popover>\n ) : (\n [\n this.renderInteractiveElement(),\n <div key=\"vertical-container\" class={getContainerClasses()} hidden={!this.expanded}>\n {this.renderSlot()}\n </div>,\n ]\n )}\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"mg-menu-item.js","sourceRoot":"","sources":["../../../../../src/components/molecules/menu/mg-menu-item/mg-menu-item.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAgB,MAAM,eAAe,CAAC;AACrG,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACxF,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,SAAS,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;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Prop, State, Host, Watch, Element, Event, EventEmitter } from '@stencil/core';\nimport { ClassList, createID, isValidString } from '../../../../utils/components.utils';\nimport { initLocales } from '../../../../locales';\nimport { Direction } from '../mg-menu/mg-menu.conf';\nimport { Status } from './mg-menu-item.conf';\nimport type { MessageType } from '../../mg-item-more/mg-item-more.conf';\nimport type { MenuSizeType } from '../mg-menu/mg-menu.conf';\nimport type { DirectionType } from './mg-menu-item.conf';\nimport type { MgPopover } from '../../mg-popover/mg-popover';\n\n@Component({\n tag: 'mg-menu-item',\n styleUrl: '../../../../../node_modules/@mgdis/styles/dist/components/mg-menu-item.css',\n shadow: true,\n})\nexport class MgMenuItem {\n /************\n * Internal *\n ************/\n\n private readonly name = 'mg-menu-item';\n private readonly navigationButton = 'mg-c-menu-item__navigation-button';\n private badgeLabel: string;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgMenuItemElement;\n\n /************\n * Props *\n ************/\n\n /**\n * Identifier is used to control mg-popover\n */\n @Prop() identifier = createID('mg-menu-item');\n\n /**\n * Define menu-item href\n * when defined menu-item contain an anchor instead of button\n */\n @Prop() href: string;\n\n /**\n * Define menu-item status.\n */\n @Prop({ reflect: true, mutable: true }) status: Status = Status.VISIBLE;\n @Watch('status')\n validateStatus(newValue: MgMenuItem['status'], oldValue?: MgMenuItem['status']): void {\n if (oldValue !== undefined) {\n this.navigationButtonClassList.delete(`${this.navigationButton}--${oldValue}`);\n }\n this.navigationButtonClassList.add(`${this.navigationButton}--${newValue}`);\n this.statusChange.emit(newValue);\n }\n\n /**\n * Define menu-item content expanded.\n */\n @Prop({ mutable: true }) expanded = false;\n @Watch('expanded')\n validateExpanded(newValue: MgMenuItem['expanded']): void {\n if (typeof newValue !== 'boolean') throw new Error(`<${this.name}> prop \"expanded\" must be a boolean.`);\n\n // if menu-item has sub-menu we have to apply some updates:\n if (this.hasChildren) {\n const subItems = Array.from(this.element.querySelectorAll(this.name));\n if (!newValue) {\n // - when main menu item is NOT expanded we need NOT expanded sub-items and NOT expanded sub-content\n subItems.forEach(item => {\n item.expanded = false;\n });\n } else if (this.element.querySelector(`${this.name}[status=\"${Status.ACTIVE}\"]`) !== null) {\n // - when expanded and contain an active item parents are expended too\n subItems.forEach(item => {\n if (this.hasStatus(item, Status.ACTIVE)) {\n item.expanded = true;\n }\n });\n }\n }\n }\n\n /**********\n * Events *\n *********/\n\n /**\n * Emited event when status change\n */\n @Event({ eventName: 'status-change' }) statusChange: EventEmitter<HTMLMgMenuItemElement['status']>;\n\n /**\n * Emited event when item is loaded\n */\n @Event({ eventName: 'item-loaded' }) itemLoaded: EventEmitter<void>;\n\n /**********\n * States *\n *********/\n\n /**\n * Define menu-item size.\n */\n @State() size: MenuSizeType = 'regular';\n @Watch('size')\n validateSize(newValue: MgMenuItem['size'], oldValue?: MgMenuItem['size']): void {\n this.navigationButtonClassList.delete(`${this.navigationButton}--size-${oldValue}`);\n this.navigationButtonClassList.add(`${this.navigationButton}--size-${newValue}`);\n }\n\n /**\n * Component button classes\n */\n @State() navigationButtonClassList: ClassList = new ClassList([this.navigationButton]);\n\n /**\n * Parent menu direction\n */\n @State() direction: DirectionType;\n @Watch('direction')\n validateDirection(newValue: MgMenuItem['direction']): void {\n // manage menu items style depending to parent menu horientation\n this.element.setAttribute(`data-style-direction-${newValue}`, '');\n this.navigationButtonClassList.add(`${this.navigationButton}--${newValue}`);\n // manage all sub levels child menu-items level with data-level attribut\n if (this.isDirection(Direction.VERTICAL, newValue)) {\n Array.from(this.element.querySelectorAll('mg-menu-item')).forEach(item => {\n item.dataset.level = `${(Number(item.dataset.level) || 1) + 1}`;\n });\n }\n }\n\n /**\n * Does component is in main menu\n */\n @State() isInMainMenu: boolean;\n\n /**\n * Does element is item-more\n */\n @State() isItemMore: boolean;\n\n /**\n * Does component have children.\n */\n @State() hasChildren = false;\n @Watch('hasChildren')\n validateHasChildren(newValue: boolean): void {\n if (newValue && this.element.href !== undefined) {\n throw new Error(`<${this.name}> prop \"href\" is unauthorizied when element is a parent.`);\n }\n }\n\n /**\n * Does component should display notification badge.\n */\n @State() displayNotificationBadge: boolean;\n\n /***********\n * Methods *\n **********/\n\n /**\n * Toggle expanded prop value\n */\n private toggleExpanded = (): void => {\n this.expanded = !this.expanded;\n };\n\n /**\n * Does an Element have given Status\n * @param mgMenuItemElement - to parse\n * @param status - to check\n * @returns true if element with status is found\n */\n private hasStatus = (mgMenuItemElement: HTMLMgMenuItemElement, status: MgMenuItem['status']): boolean => mgMenuItemElement.status === status;\n\n /**\n * Is component contextual direction match the given direction\n * @param direction - in parent menu\n * @param compareWith - direction to compare with. Default: `this.direction`\n * @returns true is direction match the direction propertie\n */\n private isDirection = (direction: MgMenuItem['direction'], compareWith = this.direction): boolean => direction === compareWith;\n\n /**\n * Update displayNotificationBadge\n * current component notification badge have priority over the slot badge when submenu contain badge\n */\n private updateDisplayNotificationBadge = (): void => {\n const childMenu = this.element.querySelector('mg-menu');\n this.displayNotificationBadge =\n childMenu !== null &&\n Array.from(childMenu.children).some((subItem: HTMLMgMenuItemElement) => subItem.querySelector('mg-badge') !== null && subItem.getAttribute('hidden') === null);\n };\n\n /**\n * Method to control if one of component children have active status\n * @returns truthy if component has active child\n */\n private hasActiveChild = (): boolean =>\n Array.from(this.element.querySelector('mg-menu')?.children || []).some(\n (element: HTMLMgMenuItemElement) => element.nodeName === 'MG-MENU-ITEM' && this.hasStatus(element, Status.ACTIVE) && element.getAttribute('hidden') === null,\n );\n\n /**\n * Validate slots\n * @param guard - prevent action with guard. Default: false.\n */\n private validateSlot = (guard = false): void => {\n // slot title AND metadata validation\n // add title on label AND metada slots due to text-overflow on these element\n if (Array.from(this.element.children).find(child => child.getAttribute('slot') === 'label') === undefined) throw new Error(`<${this.name}> slot \"label\" is required.`);\n ['label', 'metadata'].forEach(slot => {\n Array.from(this.element.querySelectorAll(`[slot=\"${slot}\"]`)).forEach(element => {\n if (!isValidString(element.textContent)) throw new Error(`<${this.name}> slot \"${slot}\" must have text content.`);\n if ((guard && element.getAttribute('title') === null) || !guard) element.setAttribute('title', element.textContent);\n });\n });\n };\n\n /**\n * Update status\n * @param guard - status to exclude from process in addition to [Status.HIDDEN, Status.DISABLED] . Default: [].\n */\n private updateStatus = (guard = []): void => {\n if (![Status.HIDDEN, Status.DISABLED, ...guard].includes(this.status)) {\n this.status = this.hasActiveChild() ? Status.ACTIVE : Status.VISIBLE;\n }\n };\n\n /**\n * Init event-listeners\n */\n private initListeners = (): void => {\n // manage first sub-level menu-items\n Array.from(this.element.querySelector('mg-menu')?.children || []).forEach(item => {\n if (item.nodeName === 'MG-MENU-ITEM') {\n // manage child menu listener\n item.addEventListener('status-change', () => {\n this.updateStatus();\n });\n }\n });\n };\n\n /**\n * Get mg-popover identifier\n * @returns generated mg-popover identifier\n */\n private getPopoverIdentifier = (): MgPopover['identifier'] => `${this.identifier}-popover`;\n\n /**\n * Render popover clickoutside guard for content slot\n */\n private updatePopoverGuard(): void {\n if (this.displayPopover())\n Array.from(this.element.children)\n .filter((child: HTMLElement) => child.getAttribute('slot') === null && child.nodeName !== 'MG-MENU' && Boolean(child.dataset))\n .forEach((slot: HTMLElement) => (slot.dataset.mgPopoverGuard = this.getPopoverIdentifier()));\n }\n\n /**\n * Condition to know if component should display a mg-popover\n * @returns truthy if component display popover\n */\n private displayPopover = (): boolean => this.isDirection(Direction.HORIZONTAL) && this.hasChildren && this.href === undefined;\n\n /************\n * Handlers *\n ************/\n\n /**\n * Handle interacrtive element click\n * @param event - click on element\n */\n private handleElementCLick = (event: MouseEvent): void => {\n if ((this.hasChildren && !this.isInMainMenu) || this.status === Status.DISABLED) {\n event.preventDefault();\n event.stopPropagation();\n }\n\n // toggle expanded when mg-menu-item has child items\n if (this.hasChildren) this.toggleExpanded();\n };\n\n /**\n * Handle popover element display-change event\n * @param event - popover display event\n */\n private handlePopoverDisplay = (event: CustomEvent): void => {\n this.expanded = event.detail;\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Validate props\n */\n componentWillLoad(): void {\n // has children items that is NOT [slot='image' | 'information' | 'label' | 'metadata'] element\n // we store only matching elements\n this.hasChildren = Array.from(this.element.children).some(child => !['image', 'information', 'label', 'metadata'].includes(child.getAttribute('slot')));\n this.badgeLabel = (initLocales(this.element).messages as { plusMenu: MessageType }).plusMenu.badgeLabel;\n this.isItemMore = this.element.dataset.overflowMore !== undefined;\n\n // Validate props\n this.validateStatus(this.status);\n this.validateExpanded(this.expanded);\n\n // Validate states\n this.validateSize(this.size);\n }\n\n /**\n * Check if component slots configuration\n * @returns timeout\n */\n componentDidLoad(): ReturnType<typeof setTimeout> {\n // validation\n this.validateSlot(true);\n\n // update props and states after componentDidLoad hook\n // return a promise to process action only in the FIRST render().\n // https://stenciljs.com/docs/component-lifecycle#componentwillload\n return setTimeout(() => {\n // define menu-item context states\n const menu = this.element.closest('mg-menu');\n this.direction = this.isItemMore || menu === null ? Direction.HORIZONTAL : menu.direction;\n this.isInMainMenu = menu !== null && this.element.parentElement.closest('mg-menu-item') === null;\n if (menu?.size !== undefined) this.size = menu.size;\n\n if (this.isItemMore) this.size = this.element.dataset.size as MgMenuItem['size'];\n\n // when main menu item contain an active item it will get the active style\n // AND if item is in vertical menu it will be expanded\n if (this.hasActiveChild() && this.isInMainMenu) this.expanded = this.isDirection(Direction.VERTICAL);\n\n this.updateStatus([Status.ACTIVE]);\n this.updateDisplayNotificationBadge();\n this.updatePopoverGuard();\n\n // manage child dom changes with mutationObserver and listzners\n this.initListeners();\n\n // emit loaded event when component is fully loaded\n this.itemLoaded.emit();\n\n new MutationObserver(mutationsList => {\n if (mutationsList.some(mutation => mutation.attributeName === 'hidden')) this.updateStatus();\n if (mutationsList.some(mutation => mutation.type === 'characterData')) this.validateSlot();\n this.updateDisplayNotificationBadge();\n }).observe(this.element, { attributes: true, childList: true, characterData: true, subtree: true });\n }, 0);\n }\n\n /**\n * Render ineractive element\n * @returns HTML Element\n */\n private renderInteractiveElement(): HTMLElement {\n const TagName: string = this.href !== undefined ? 'a' : 'button';\n return (\n <TagName\n href={this.href}\n class={this.navigationButtonClassList.join()}\n tabindex={[Status.DISABLED, Status.HIDDEN].includes(this.status) ? -1 : undefined}\n disabled={this.status === Status.DISABLED}\n hidden={this.status === Status.HIDDEN}\n aria-expanded={this.hasChildren && this.expanded.toString()}\n aria-current={this.status === Status.ACTIVE && 'page'}\n onClick={this.handleElementCLick}\n >\n <slot name=\"image\"></slot>\n <div class={`${this.navigationButton}-center`}>\n <div class={`${this.navigationButton}-text-content`}>\n <slot name=\"label\"></slot>\n {!this.displayNotificationBadge && <slot name=\"information\"></slot>}\n {this.displayNotificationBadge && (\n <span class={`${this.navigationButton}-text-content-notification`}>\n <mg-badge label={this.badgeLabel} value=\"!\" variant=\"text-color\" slot=\"information\"></mg-badge>\n </span>\n )}\n </div>\n {this.size !== 'regular' && <slot name=\"metadata\"></slot>}\n </div>\n {this.hasChildren && this.href === undefined && (\n <span\n class={{\n [`${this.navigationButton}-chevron`]: true,\n [`${this.navigationButton}-chevron--rotate`]: this.expanded === true,\n }}\n >\n <mg-icon icon=\"chevron-down\" size=\"small\"></mg-icon>\n </span>\n )}\n </TagName>\n );\n }\n\n /**\n * Render slot\n * @returns HTML Element\n */\n private renderSlot = (): HTMLElement => <slot></slot>;\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n const getContainerClasses = () => ({\n ['mg-c-menu-item__collapse-container']: true,\n ['mg-c-menu-item__collapse-container--first-level']: (this.isInMainMenu || this.isItemMore) && this.isDirection(Direction.HORIZONTAL),\n });\n\n return (\n <Host role={this.isItemMore ? 'presentation' : 'listitem'}>\n {this.displayPopover() ? (\n <mg-popover display={this.expanded} placement=\"bottom-start\" arrowHide={true} onDisplay-change={this.handlePopoverDisplay} identifier={this.getPopoverIdentifier()}>\n {this.renderInteractiveElement()}\n <div class={getContainerClasses()} slot=\"content\">\n {this.renderSlot()}\n </div>\n </mg-popover>\n ) : (\n [\n this.renderInteractiveElement(),\n <div key=\"vertical-container\" class={getContainerClasses()} hidden={!this.expanded}>\n {this.renderSlot()}\n </div>,\n ]\n )}\n </Host>\n );\n }\n}\n"]}
@@ -9,8 +9,8 @@ import { createID } from "../../../utils/components.utils";
9
9
  * @returns return true if type is valid
10
10
  */
11
11
  const isMgActionMoreItems = (prop) => {
12
- const items = prop;
13
- return typeof items === 'object' && items.every(item => typeof item === 'object' && typeof item.label === 'string' && typeof item.mouseEventHandler === 'function');
12
+ const items = prop;
13
+ return typeof items === 'object' && items.every(item => typeof item === 'object' && typeof item.label === 'string' && typeof item.mouseEventHandler === 'function');
14
14
  };
15
15
  /**
16
16
  * MgActionMore['button'] type guard
@@ -18,8 +18,8 @@ const isMgActionMoreItems = (prop) => {
18
18
  * @returns return true if type is valid
19
19
  */
20
20
  const isMgActionMoreButton = (prop) => {
21
- const button = prop;
22
- return typeof button === 'object' && typeof button.variant === 'string' && typeof button.isIcon === 'boolean';
21
+ const button = prop;
22
+ return typeof button === 'object' && typeof button.variant === 'string' && typeof button.isIcon === 'boolean';
23
23
  };
24
24
  /**
25
25
  * MgActionMore['icon'] type guard
@@ -27,227 +27,227 @@ const isMgActionMoreButton = (prop) => {
27
27
  * @returns return true if type is valid
28
28
  */
29
29
  const isMgActionMoreIcon = (prop) => {
30
- const icon = prop;
31
- return typeof icon === 'object' && typeof icon.icon === 'string';
30
+ const icon = prop;
31
+ return typeof icon === 'object' && typeof icon.icon === 'string';
32
32
  };
33
33
  export class MgActionMore {
34
- constructor() {
35
- /************
36
- * Internal *
37
- ************/
38
- this.name = 'mg-action-more';
39
- this.classBase = 'mg-c-action-more';
40
- this.mgPopoverIdentifier = createID(this.name);
41
- /************
42
- * Methods *
43
- ***********/
44
- /**
45
- * Toggle expanded props
46
- */
47
- this.toggleExpanded = () => {
48
- this.expanded = !this.expanded;
49
- };
50
- /**
51
- * Handle popover display change value
52
- * @param event - display change updated value
53
- */
54
- this.handleDisplayChange = (event) => {
55
- this.expanded = event.detail;
56
- };
34
+ constructor() {
35
+ /************
36
+ * Internal *
37
+ ************/
38
+ this.name = 'mg-action-more';
39
+ this.classBase = 'mg-c-action-more';
40
+ this.mgPopoverIdentifier = createID(this.name);
41
+ /************
42
+ * Methods *
43
+ ***********/
44
+ /**
45
+ * Toggle expanded props
46
+ */
47
+ this.toggleExpanded = () => {
48
+ this.expanded = !this.expanded;
49
+ };
50
+ /**
51
+ * Handle popover display change value
52
+ * @param event - display change updated value
53
+ */
54
+ this.handleDisplayChange = (event) => {
55
+ this.expanded = event.detail;
56
+ };
57
+ /**
58
+ * Button click handler
59
+ */
60
+ this.handleButton = () => {
61
+ this.toggleExpanded();
62
+ };
63
+ /**
64
+ * Item click handler
65
+ * @param event - click event
66
+ * @param customHandler - item['mouseEventHandler']
67
+ */
68
+ this.handleItemClick = (event, customHandler) => {
69
+ this.expanded = false;
70
+ customHandler(event);
71
+ };
72
+ this.icon = undefined;
73
+ this.button = { variant: 'flat', isIcon: true };
74
+ this.items = undefined;
75
+ this.displayChevron = undefined;
76
+ this.expanded = false;
77
+ }
78
+ validateIcon(newValue) {
79
+ if (newValue && !isMgActionMoreIcon(newValue)) {
80
+ throw new Error(`<${this.name}> prop icon must match MgActionMoreIconType.`);
81
+ }
82
+ else if (!(newValue === null || newValue === void 0 ? void 0 : newValue.icon) && Boolean(this.button.isIcon)) {
83
+ this.icon = { icon: 'ellipsis' };
84
+ }
85
+ }
86
+ validateButton(newValue) {
87
+ if (newValue && !isMgActionMoreButton(newValue)) {
88
+ throw new Error(`<${this.name}> prop button must match MgActionMoreButtonType.`);
89
+ }
90
+ }
91
+ validateItems(newValue) {
92
+ if (!isMgActionMoreItems(newValue)) {
93
+ throw new Error(`<${this.name}> prop "items" is required and all values must be the same type, MgActionMoreItemType.`);
94
+ }
95
+ }
96
+ validateDisplayChevron(newValue) {
97
+ if (newValue && this.button.isIcon === true) {
98
+ throw new Error(`<${this.name}> prop "displayChevron" can't be used with a 'button" prop "isIcon" attribute.`);
99
+ }
100
+ }
101
+ /*************
102
+ * Lifecycle *
103
+ *************/
57
104
  /**
58
- * Button click handler
105
+ * Validate props
59
106
  */
60
- this.handleButton = () => {
61
- this.toggleExpanded();
62
- };
107
+ componentWillLoad() {
108
+ this.messages = initLocales(this.element).messages.actionMore;
109
+ this.validateItems(this.items);
110
+ this.validateButton(this.button);
111
+ this.validateIcon(this.icon);
112
+ this.validateDisplayChevron(this.displayChevron);
113
+ }
63
114
  /**
64
- * Item click handler
65
- * @param event - click event
66
- * @param customHandler - item['mouseEventHandler']
115
+ * Render
116
+ * @returns HTML Element
67
117
  */
68
- this.handleItemClick = (event, customHandler) => {
69
- this.expanded = false;
70
- customHandler(event);
71
- };
72
- this.icon = undefined;
73
- this.button = { variant: 'flat', isIcon: true };
74
- this.items = undefined;
75
- this.displayChevron = undefined;
76
- this.expanded = false;
77
- }
78
- validateIcon(newValue) {
79
- if (newValue && !isMgActionMoreIcon(newValue)) {
80
- throw new Error(`<${this.name}> prop icon must match MgActionMoreIconType.`);
118
+ render() {
119
+ const buttonLabel = this.button.label || this.messages.label;
120
+ const buttonContent = [buttonLabel];
121
+ if (!this.button.isIcon && this.displayChevron) {
122
+ buttonContent.push(h("span", { class: {
123
+ [`${this.classBase}__chevron`]: true,
124
+ [`${this.classBase}__chevron--rotate`]: this.expanded === true,
125
+ } }, h("mg-icon", { icon: "chevron-down", size: "small" })));
126
+ }
127
+ return (h(Host, { "data-mg-popover-guard": this.mgPopoverIdentifier }, h("span", { class: "mg-action-more" }, h("mg-popover", { identifier: this.mgPopoverIdentifier, display: this.expanded, "onDisplay-change": this.handleDisplayChange }, h("mg-button", { variant: this.button.variant, isIcon: this.button.isIcon, disabled: this.button.disabled, type: "button", label: buttonLabel, onClick: this.handleButton }, this.icon && h("mg-icon", Object.assign({}, this.icon)), !this.button.isIcon && buttonContent), h("div", { slot: "content" }, h("mg-menu", { direction: Direction.VERTICAL, label: this.messages.label }, this.items.map(item => {
128
+ var _a;
129
+ return (
130
+ // eslint-disable-next-line react/jsx-no-bind
131
+ h("mg-menu-item", { key: item.label, status: item.status || Status.VISIBLE, onClick: e => this.handleItemClick(e, item.mouseEventHandler), href: item.href }, item.icon && h("mg-icon", { icon: item.icon, slot: "image" }), h("span", { slot: "label" }, item.label), ((_a = item.badge) === null || _a === void 0 ? void 0 : _a.label) && h("mg-badge", { label: item.badge.label, value: item.badge.value, slot: "information", variant: "text-color" })));
132
+ })))))));
81
133
  }
82
- else if (!(newValue === null || newValue === void 0 ? void 0 : newValue.icon) && Boolean(this.button.isIcon)) {
83
- this.icon = { icon: 'ellipsis' };
134
+ static get is() { return "mg-action-more"; }
135
+ static get encapsulation() { return "shadow"; }
136
+ static get originalStyleUrls() {
137
+ return {
138
+ "$": ["../../../../node_modules/@mgdis/styles/dist/components/mg-action-more.css"]
139
+ };
84
140
  }
85
- }
86
- validateButton(newValue) {
87
- if (newValue && !isMgActionMoreButton(newValue)) {
88
- throw new Error(`<${this.name}> prop button must match MgActionMoreButtonType.`);
141
+ static get styleUrls() {
142
+ return {
143
+ "$": ["../../../../node_modules/@mgdis/styles/dist/components/mg-action-more.css"]
144
+ };
89
145
  }
90
- }
91
- validateItems(newValue) {
92
- if (!isMgActionMoreItems(newValue)) {
93
- throw new Error(`<${this.name}> prop "items" is required and all values must be the same type, MgActionMoreItemType.`);
146
+ static get properties() {
147
+ return {
148
+ "icon": {
149
+ "type": "unknown",
150
+ "mutable": true,
151
+ "complexType": {
152
+ "original": "MgActionMoreIconType",
153
+ "resolved": "{ icon: string; }",
154
+ "references": {
155
+ "MgActionMoreIconType": {
156
+ "location": "import",
157
+ "path": "./mg-action-more.conf",
158
+ "id": "src/components/molecules/mg-action-more/mg-action-more.conf.ts::MgActionMoreIconType"
159
+ }
160
+ }
161
+ },
162
+ "required": false,
163
+ "optional": false,
164
+ "docs": {
165
+ "tags": [],
166
+ "text": "Define displaied icon"
167
+ }
168
+ },
169
+ "button": {
170
+ "type": "unknown",
171
+ "mutable": false,
172
+ "complexType": {
173
+ "original": "MgActionMoreButtonType",
174
+ "resolved": "{ isIcon: boolean; variant: \"flat\" | \"info\" | \"success\" | \"link\" | \"primary\" | \"secondary\" | \"danger\" | \"danger-alt\"; label?: string; disabled?: boolean; }",
175
+ "references": {
176
+ "MgActionMoreButtonType": {
177
+ "location": "import",
178
+ "path": "./mg-action-more.conf",
179
+ "id": "src/components/molecules/mg-action-more/mg-action-more.conf.ts::MgActionMoreButtonType"
180
+ }
181
+ }
182
+ },
183
+ "required": false,
184
+ "optional": false,
185
+ "docs": {
186
+ "tags": [],
187
+ "text": "Define button properties"
188
+ },
189
+ "defaultValue": "{ variant: 'flat', isIcon: true }"
190
+ },
191
+ "items": {
192
+ "type": "unknown",
193
+ "mutable": false,
194
+ "complexType": {
195
+ "original": "MgActionMoreItemType[]",
196
+ "resolved": "MgActionMoreItemType[]",
197
+ "references": {
198
+ "MgActionMoreItemType": {
199
+ "location": "import",
200
+ "path": "./mg-action-more.conf",
201
+ "id": "src/components/molecules/mg-action-more/mg-action-more.conf.ts::MgActionMoreItemType"
202
+ }
203
+ }
204
+ },
205
+ "required": true,
206
+ "optional": false,
207
+ "docs": {
208
+ "tags": [],
209
+ "text": "Define the menu-items elements"
210
+ }
211
+ },
212
+ "displayChevron": {
213
+ "type": "boolean",
214
+ "mutable": false,
215
+ "complexType": {
216
+ "original": "boolean",
217
+ "resolved": "boolean",
218
+ "references": {}
219
+ },
220
+ "required": false,
221
+ "optional": false,
222
+ "docs": {
223
+ "tags": [],
224
+ "text": "Define if chevron is display"
225
+ },
226
+ "attribute": "display-chevron",
227
+ "reflect": false
228
+ }
229
+ };
94
230
  }
95
- }
96
- validateDisplayChevron(newValue) {
97
- if (newValue && this.button.isIcon === true) {
98
- throw new Error(`<${this.name}> prop "displayChevron" can't be used with a 'button" prop "isIcon" attribute.`);
231
+ static get states() {
232
+ return {
233
+ "expanded": {}
234
+ };
99
235
  }
100
- }
101
- /*************
102
- * Lifecycle *
103
- *************/
104
- /**
105
- * Validate props
106
- */
107
- componentWillLoad() {
108
- this.messages = initLocales(this.element).messages.actionMore;
109
- this.validateItems(this.items);
110
- this.validateButton(this.button);
111
- this.validateIcon(this.icon);
112
- this.validateDisplayChevron(this.displayChevron);
113
- }
114
- /**
115
- * Render
116
- * @returns HTML Element
117
- */
118
- render() {
119
- const buttonLabel = this.button.label || this.messages.label;
120
- const buttonContent = [buttonLabel];
121
- if (!this.button.isIcon && this.displayChevron) {
122
- buttonContent.push(h("span", { class: {
123
- [`${this.classBase}__chevron`]: true,
124
- [`${this.classBase}__chevron--rotate`]: this.expanded === true,
125
- } }, h("mg-icon", { icon: "chevron-down", size: "small" })));
236
+ static get elementRef() { return "element"; }
237
+ static get watchers() {
238
+ return [{
239
+ "propName": "icon",
240
+ "methodName": "validateIcon"
241
+ }, {
242
+ "propName": "button",
243
+ "methodName": "validateButton"
244
+ }, {
245
+ "propName": "items",
246
+ "methodName": "validateItems"
247
+ }, {
248
+ "propName": "displayChevron",
249
+ "methodName": "validateDisplayChevron"
250
+ }];
126
251
  }
127
- return (h(Host, { "data-mg-popover-guard": this.mgPopoverIdentifier }, h("span", { class: "mg-action-more" }, h("mg-popover", { identifier: this.mgPopoverIdentifier, display: this.expanded, "onDisplay-change": this.handleDisplayChange }, h("mg-button", { variant: this.button.variant, isIcon: this.button.isIcon, disabled: this.button.disabled, type: "button", label: buttonLabel, onClick: this.handleButton }, this.icon && h("mg-icon", Object.assign({}, this.icon)), !this.button.isIcon && buttonContent), h("div", { slot: "content" }, h("mg-menu", { direction: Direction.VERTICAL, label: this.messages.label }, this.items.map(item => {
128
- var _a;
129
- return (
130
- // eslint-disable-next-line react/jsx-no-bind
131
- h("mg-menu-item", { key: item.label, status: item.status || Status.VISIBLE, onClick: e => this.handleItemClick(e, item.mouseEventHandler), href: item.href }, item.icon && h("mg-icon", { icon: item.icon, slot: "image" }), h("span", { slot: "label" }, item.label), ((_a = item.badge) === null || _a === void 0 ? void 0 : _a.label) && h("mg-badge", { label: item.badge.label, value: item.badge.value, slot: "information", variant: "text-color" })));
132
- })))))));
133
- }
134
- static get is() { return "mg-action-more"; }
135
- static get encapsulation() { return "shadow"; }
136
- static get originalStyleUrls() {
137
- return {
138
- "$": ["../../../../node_modules/@mgdis/styles/dist/components/mg-action-more.css"]
139
- };
140
- }
141
- static get styleUrls() {
142
- return {
143
- "$": ["../../../../node_modules/@mgdis/styles/dist/components/mg-action-more.css"]
144
- };
145
- }
146
- static get properties() {
147
- return {
148
- "icon": {
149
- "type": "unknown",
150
- "mutable": true,
151
- "complexType": {
152
- "original": "MgActionMoreIconType",
153
- "resolved": "{ icon: string; }",
154
- "references": {
155
- "MgActionMoreIconType": {
156
- "location": "import",
157
- "path": "./mg-action-more.conf",
158
- "id": "src/components/molecules/mg-action-more/mg-action-more.conf.ts::MgActionMoreIconType"
159
- }
160
- }
161
- },
162
- "required": false,
163
- "optional": false,
164
- "docs": {
165
- "tags": [],
166
- "text": "Define displaied icon"
167
- }
168
- },
169
- "button": {
170
- "type": "unknown",
171
- "mutable": false,
172
- "complexType": {
173
- "original": "MgActionMoreButtonType",
174
- "resolved": "{ isIcon: boolean; variant: \"flat\" | \"info\" | \"success\" | \"link\" | \"primary\" | \"secondary\" | \"danger\" | \"danger-alt\"; label?: string; disabled?: boolean; }",
175
- "references": {
176
- "MgActionMoreButtonType": {
177
- "location": "import",
178
- "path": "./mg-action-more.conf",
179
- "id": "src/components/molecules/mg-action-more/mg-action-more.conf.ts::MgActionMoreButtonType"
180
- }
181
- }
182
- },
183
- "required": false,
184
- "optional": false,
185
- "docs": {
186
- "tags": [],
187
- "text": "Define button properties"
188
- },
189
- "defaultValue": "{ variant: 'flat', isIcon: true }"
190
- },
191
- "items": {
192
- "type": "unknown",
193
- "mutable": false,
194
- "complexType": {
195
- "original": "MgActionMoreItemType[]",
196
- "resolved": "MgActionMoreItemType[]",
197
- "references": {
198
- "MgActionMoreItemType": {
199
- "location": "import",
200
- "path": "./mg-action-more.conf",
201
- "id": "src/components/molecules/mg-action-more/mg-action-more.conf.ts::MgActionMoreItemType"
202
- }
203
- }
204
- },
205
- "required": true,
206
- "optional": false,
207
- "docs": {
208
- "tags": [],
209
- "text": "Define the menu-items elements"
210
- }
211
- },
212
- "displayChevron": {
213
- "type": "boolean",
214
- "mutable": false,
215
- "complexType": {
216
- "original": "boolean",
217
- "resolved": "boolean",
218
- "references": {}
219
- },
220
- "required": false,
221
- "optional": false,
222
- "docs": {
223
- "tags": [],
224
- "text": "Define if chevron is display"
225
- },
226
- "attribute": "display-chevron",
227
- "reflect": false
228
- }
229
- };
230
- }
231
- static get states() {
232
- return {
233
- "expanded": {}
234
- };
235
- }
236
- static get elementRef() { return "element"; }
237
- static get watchers() {
238
- return [{
239
- "propName": "icon",
240
- "methodName": "validateIcon"
241
- }, {
242
- "propName": "button",
243
- "methodName": "validateButton"
244
- }, {
245
- "propName": "items",
246
- "methodName": "validateItems"
247
- }, {
248
- "propName": "displayChevron",
249
- "methodName": "validateDisplayChevron"
250
- }];
251
- }
252
252
  }
253
253
  //# sourceMappingURL=mg-action-more.js.map