@mgdis/mg-components 6.13.1 → 6.14.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 (418) hide show
  1. package/dist/cjs/events.utils-D5SAtkpQ.js +0 -3
  2. package/dist/cjs/index-CwjAofQ1.js +0 -3
  3. package/dist/cjs/index-DUJwxnoi.js +0 -3
  4. package/dist/cjs/{index-CATFkm3O.js → index-DzBkSgSK.js} +224 -122
  5. package/dist/cjs/index.cjs.js +0 -3
  6. package/dist/cjs/loader.cjs.js +3 -7
  7. package/dist/cjs/mg-action-more_37.cjs.entry.js +141 -75
  8. package/dist/cjs/mg-alert.cjs.entry.js +5 -8
  9. package/dist/cjs/mg-components.cjs.js +4 -8
  10. package/dist/cjs/mg-input-combobox.cjs.entry.js +7 -10
  11. package/dist/cjs/mg-input-rich-text-editor.cjs.entry.js +3 -6
  12. package/dist/cjs/mg-input.conf-WTsvDfpC.js +0 -3
  13. package/dist/cjs/mg-loader.cjs.entry.js +1 -4
  14. package/dist/cjs/mg-progress.cjs.entry.js +1 -4
  15. package/dist/collection/assets/icons/index.js +0 -1
  16. package/dist/collection/collection-manifest.json +1 -1
  17. package/dist/collection/components/atoms/internals/mg-character-left/mg-character-left.js +3 -4
  18. package/dist/collection/components/atoms/internals/mg-input-title/mg-input-title.js +4 -5
  19. package/dist/collection/components/atoms/mg-badge/mg-badge.conf.js +0 -1
  20. package/dist/collection/components/atoms/mg-badge/mg-badge.js +4 -5
  21. package/dist/collection/components/atoms/mg-button/mg-button.conf.js +0 -1
  22. package/dist/collection/components/atoms/mg-button/mg-button.js +9 -10
  23. package/dist/collection/components/atoms/mg-card/mg-card.conf.js +4 -0
  24. package/dist/collection/components/atoms/mg-card/mg-card.js +104 -2
  25. package/dist/collection/components/atoms/mg-divider/mg-divider.js +1 -2
  26. package/dist/collection/components/atoms/mg-icon/mg-icon.conf.js +0 -1
  27. package/dist/collection/components/atoms/mg-icon/mg-icon.js +6 -7
  28. package/dist/collection/components/atoms/mg-tag/mg-tag.conf.js +0 -1
  29. package/dist/collection/components/atoms/mg-tag/mg-tag.js +3 -4
  30. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.js +1 -2
  31. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.conf.js +0 -1
  32. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +5 -6
  33. package/dist/collection/components/molecules/inputs/mg-input/mg-input.conf.js +0 -1
  34. package/dist/collection/components/molecules/inputs/mg-input/mg-input.js +33 -18
  35. package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js +0 -1
  36. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js +7 -6
  37. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.js +0 -1
  38. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +21 -21
  39. package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.conf.js +0 -1
  40. package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js +22 -20
  41. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.conf.js +0 -1
  42. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +17 -18
  43. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf.js +0 -1
  44. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +26 -27
  45. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +18 -19
  46. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.conf.js +0 -1
  47. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +17 -17
  48. package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/editor/index.js +0 -1
  49. package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.js +18 -18
  50. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.conf.js +0 -1
  51. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +38 -32
  52. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.conf.js +0 -1
  53. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +25 -25
  54. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +23 -24
  55. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.conf.js +0 -1
  56. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +15 -15
  57. package/dist/collection/components/molecules/internals/mg-item-more/mg-item-more.conf.js +0 -1
  58. package/dist/collection/components/molecules/internals/mg-item-more/mg-item-more.js +4 -3
  59. package/dist/collection/components/molecules/menus/mg-menu/mg-menu.conf.js +0 -1
  60. package/dist/collection/components/molecules/menus/mg-menu/mg-menu.js +4 -4
  61. package/dist/collection/components/molecules/menus/mg-menu-item/mg-menu-item.conf.js +0 -1
  62. package/dist/collection/components/molecules/menus/mg-menu-item/mg-menu-item.js +5 -6
  63. package/dist/collection/components/molecules/mg-action-more/mg-action-more.conf.js +0 -1
  64. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +5 -3
  65. package/dist/collection/components/molecules/mg-alert/mg-alert.conf.js +0 -1
  66. package/dist/collection/components/molecules/mg-alert/mg-alert.js +7 -8
  67. package/dist/collection/components/molecules/mg-details/mg-details.js +4 -5
  68. package/dist/collection/components/molecules/mg-form/mg-form.conf.js +0 -1
  69. package/dist/collection/components/molecules/mg-form/mg-form.js +9 -10
  70. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.conf.js +0 -1
  71. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +2 -3
  72. package/dist/collection/components/molecules/mg-loader/mg-loader.js +2 -3
  73. package/dist/collection/components/molecules/mg-message/mg-message.conf.js +0 -1
  74. package/dist/collection/components/molecules/mg-message/mg-message.js +4 -5
  75. package/dist/collection/components/molecules/mg-modal/mg-modal.conf.js +0 -1
  76. package/dist/collection/components/molecules/mg-modal/mg-modal.js +6 -7
  77. package/dist/collection/components/molecules/mg-pagination/mg-pagination.conf.js +0 -1
  78. package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +7 -7
  79. package/dist/collection/components/molecules/mg-panel/mg-panel.conf.js +0 -1
  80. package/dist/collection/components/molecules/mg-panel/mg-panel.js +34 -11
  81. package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js +2 -3
  82. package/dist/collection/components/molecules/mg-popover/mg-popover.js +6 -7
  83. package/dist/collection/components/molecules/mg-progress/mg-progress.conf.js +0 -1
  84. package/dist/collection/components/molecules/mg-progress/mg-progress.js +5 -6
  85. package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.conf.js +0 -1
  86. package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +5 -4
  87. package/dist/collection/components/molecules/mg-table/mg-table.conf.js +0 -1
  88. package/dist/collection/components/molecules/mg-table/mg-table.js +4 -4
  89. package/dist/collection/components/molecules/mg-tabs/mg-tabs.conf.js +0 -1
  90. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +6 -6
  91. package/dist/collection/index.js +0 -1
  92. package/dist/collection/locales/index.conf.js +0 -1
  93. package/dist/collection/locales/index.js +0 -1
  94. package/dist/collection/types/index.js +0 -1
  95. package/dist/collection/utils/behaviors.utils.js +0 -1
  96. package/dist/collection/utils/events.utils.js +0 -1
  97. package/dist/collection/utils/playwright.fixture.js +0 -1
  98. package/dist/collection/utils/unit.test.utils.js +0 -1
  99. package/dist/components/events.utils.js +0 -3
  100. package/dist/components/index.js +1 -4
  101. package/dist/components/index2.js +0 -3
  102. package/dist/components/index3.js +0 -3
  103. package/dist/components/mg-action-more.js +0 -3
  104. package/dist/components/mg-alert.js +4 -7
  105. package/dist/components/mg-badge.js +0 -3
  106. package/dist/components/mg-badge2.js +0 -3
  107. package/dist/components/mg-button.js +0 -3
  108. package/dist/components/mg-button2.js +0 -3
  109. package/dist/components/mg-card.js +0 -3
  110. package/dist/components/mg-card2.js +55 -6
  111. package/dist/components/mg-character-left.js +0 -3
  112. package/dist/components/mg-character-left2.js +0 -3
  113. package/dist/components/mg-details.js +0 -3
  114. package/dist/components/mg-divider.js +0 -3
  115. package/dist/components/mg-divider2.js +0 -3
  116. package/dist/components/mg-form.js +0 -3
  117. package/dist/components/mg-icon.js +0 -3
  118. package/dist/components/mg-icon2.js +0 -3
  119. package/dist/components/mg-illustrated-message.js +0 -3
  120. package/dist/components/mg-input-checkbox-paginated.js +0 -3
  121. package/dist/components/mg-input-checkbox-paginated2.js +0 -3
  122. package/dist/components/mg-input-checkbox.js +1 -4
  123. package/dist/components/mg-input-combobox.js +1 -4
  124. package/dist/components/mg-input-date.js +1 -4
  125. package/dist/components/mg-input-numeric.js +1 -4
  126. package/dist/components/mg-input-password.js +1 -4
  127. package/dist/components/mg-input-radio.js +1 -4
  128. package/dist/components/mg-input-rich-text-editor.js +0 -3
  129. package/dist/components/mg-input-select.js +0 -3
  130. package/dist/components/mg-input-select2.js +18 -15
  131. package/dist/components/mg-input-text.js +0 -3
  132. package/dist/components/mg-input-text2.js +1 -4
  133. package/dist/components/mg-input-textarea.js +1 -4
  134. package/dist/components/mg-input-title.js +0 -3
  135. package/dist/components/mg-input-title2.js +0 -3
  136. package/dist/components/mg-input-toggle.js +1 -4
  137. package/dist/components/mg-input.js +0 -3
  138. package/dist/components/mg-input2.js +16 -6
  139. package/dist/components/mg-item-more.js +0 -3
  140. package/dist/components/mg-item-more2.js +0 -3
  141. package/dist/components/mg-loader.js +0 -3
  142. package/dist/components/mg-loader2.js +0 -3
  143. package/dist/components/mg-menu-item.js +0 -3
  144. package/dist/components/mg-menu-item2.js +0 -3
  145. package/dist/components/mg-menu.js +0 -3
  146. package/dist/components/mg-message.js +0 -3
  147. package/dist/components/mg-message2.js +2 -5
  148. package/dist/components/mg-modal.js +1 -4
  149. package/dist/components/mg-pagination.js +0 -3
  150. package/dist/components/mg-pagination2.js +0 -3
  151. package/dist/components/mg-panel.js +7 -5
  152. package/dist/components/mg-popover-content.js +0 -3
  153. package/dist/components/mg-popover-content2.js +1 -4
  154. package/dist/components/mg-popover.js +0 -3
  155. package/dist/components/mg-popover2.js +0 -3
  156. package/dist/components/mg-progress.js +0 -3
  157. package/dist/components/mg-skip-links.js +4 -6
  158. package/dist/components/mg-table.js +1 -4
  159. package/dist/components/mg-tabs.js +1 -4
  160. package/dist/components/mg-tag.js +0 -3
  161. package/dist/components/mg-tooltip-content.js +0 -3
  162. package/dist/components/mg-tooltip-content2.js +0 -3
  163. package/dist/components/mg-tooltip.js +0 -3
  164. package/dist/components/mg-tooltip2.js +0 -3
  165. package/dist/components/popper.js +0 -3
  166. package/dist/esm/events.utils-yMGqY8YG.js +0 -3
  167. package/dist/esm/index-Bv7NHR-W.js +0 -3
  168. package/dist/esm/{index-CAuxALt5.js → index-Degtjvph.js} +205 -122
  169. package/dist/esm/index-Dr7GYvIz.js +0 -3
  170. package/dist/esm/index.js +0 -3
  171. package/dist/esm/loader.js +3 -7
  172. package/dist/esm/mg-action-more_37.entry.js +141 -75
  173. package/dist/esm/mg-alert.entry.js +5 -8
  174. package/dist/esm/mg-components.js +4 -8
  175. package/dist/esm/mg-input-combobox.entry.js +7 -10
  176. package/dist/esm/mg-input-rich-text-editor.entry.js +3 -6
  177. package/dist/esm/mg-input.conf-CNgv8hc5.js +0 -3
  178. package/dist/esm/mg-loader.entry.js +1 -4
  179. package/dist/esm/mg-progress.entry.js +1 -4
  180. package/dist/mg-components/index.esm.js +0 -2
  181. package/dist/mg-components/mg-components.css +1 -1
  182. package/dist/mg-components/mg-components.esm.js +1 -2
  183. package/dist/mg-components/p-056ba467.entry.js +1 -0
  184. package/dist/mg-components/p-625c463c.entry.js +1 -0
  185. package/dist/mg-components/p-Bv7NHR-W.js +1 -2
  186. package/dist/mg-components/p-CNgv8hc5.js +1 -2
  187. package/dist/mg-components/p-Degtjvph.js +2 -0
  188. package/dist/mg-components/p-Dr7GYvIz.js +1 -2
  189. package/dist/mg-components/p-c522f3c1.entry.js +1 -0
  190. package/dist/mg-components/p-cac23bd7.entry.js +1 -0
  191. package/dist/mg-components/p-d13a6fdc.entry.js +1 -0
  192. package/dist/mg-components/p-e75f5383.entry.js +10 -0
  193. package/dist/mg-components/p-yMGqY8YG.js +1 -2
  194. package/dist/types/components/atoms/mg-card/mg-card.conf.d.ts +9 -0
  195. package/dist/types/components/atoms/mg-card/mg-card.d.ts +20 -0
  196. package/dist/types/components/molecules/inputs/mg-input/mg-input.d.ts +1 -1
  197. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +5 -4
  198. package/dist/types/components/molecules/mg-panel/mg-panel.d.ts +4 -0
  199. package/dist/types/components.d.ts +406 -3
  200. package/dist/types/stencil-public-runtime.d.ts +34 -6
  201. package/ide/intellij/web-types.json +263 -35
  202. package/ide/vscode/css-custom-data.json +3 -3
  203. package/ide/vscode/html-custom-data.json +88 -34
  204. package/package.json +16 -16
  205. package/dist/cjs/app-globals-V2Kpy_OQ.js +0 -8
  206. package/dist/cjs/app-globals-V2Kpy_OQ.js.map +0 -1
  207. package/dist/cjs/events.utils-D5SAtkpQ.js.map +0 -1
  208. package/dist/cjs/index-CATFkm3O.js.map +0 -1
  209. package/dist/cjs/index-CwjAofQ1.js.map +0 -1
  210. package/dist/cjs/index-DUJwxnoi.js.map +0 -1
  211. package/dist/cjs/index.cjs.js.map +0 -1
  212. package/dist/cjs/loader.cjs.js.map +0 -1
  213. package/dist/cjs/mg-action-more_37.cjs.entry.js.map +0 -1
  214. package/dist/cjs/mg-alert.cjs.entry.js.map +0 -1
  215. package/dist/cjs/mg-alert.entry.cjs.js.map +0 -1
  216. package/dist/cjs/mg-components.cjs.js.map +0 -1
  217. package/dist/cjs/mg-input-combobox.cjs.entry.js.map +0 -1
  218. package/dist/cjs/mg-input-combobox.entry.cjs.js.map +0 -1
  219. package/dist/cjs/mg-input-rich-text-editor.cjs.entry.js.map +0 -1
  220. package/dist/cjs/mg-input-rich-text-editor.entry.cjs.js.map +0 -1
  221. package/dist/cjs/mg-input.conf-WTsvDfpC.js.map +0 -1
  222. package/dist/cjs/mg-loader.cjs.entry.js.map +0 -1
  223. package/dist/cjs/mg-loader.entry.cjs.js.map +0 -1
  224. package/dist/cjs/mg-progress.cjs.entry.js.map +0 -1
  225. package/dist/cjs/mg-progress.entry.cjs.js.map +0 -1
  226. package/dist/collection/assets/icons/index.js.map +0 -1
  227. package/dist/collection/components/atoms/internals/mg-character-left/mg-character-left.js.map +0 -1
  228. package/dist/collection/components/atoms/internals/mg-input-title/mg-input-title.js.map +0 -1
  229. package/dist/collection/components/atoms/mg-badge/mg-badge.conf.js.map +0 -1
  230. package/dist/collection/components/atoms/mg-badge/mg-badge.js.map +0 -1
  231. package/dist/collection/components/atoms/mg-button/mg-button.conf.js.map +0 -1
  232. package/dist/collection/components/atoms/mg-button/mg-button.js.map +0 -1
  233. package/dist/collection/components/atoms/mg-card/mg-card.js.map +0 -1
  234. package/dist/collection/components/atoms/mg-divider/mg-divider.js.map +0 -1
  235. package/dist/collection/components/atoms/mg-icon/mg-icon.conf.js.map +0 -1
  236. package/dist/collection/components/atoms/mg-icon/mg-icon.js.map +0 -1
  237. package/dist/collection/components/atoms/mg-tag/mg-tag.conf.js.map +0 -1
  238. package/dist/collection/components/atoms/mg-tag/mg-tag.js.map +0 -1
  239. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.js.map +0 -1
  240. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.conf.js.map +0 -1
  241. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js.map +0 -1
  242. package/dist/collection/components/molecules/inputs/mg-input/mg-input.conf.js.map +0 -1
  243. package/dist/collection/components/molecules/inputs/mg-input/mg-input.js.map +0 -1
  244. package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js.map +0 -1
  245. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js.map +0 -1
  246. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.js.map +0 -1
  247. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js.map +0 -1
  248. package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.conf.js.map +0 -1
  249. package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js.map +0 -1
  250. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.conf.js.map +0 -1
  251. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js.map +0 -1
  252. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf.js.map +0 -1
  253. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js.map +0 -1
  254. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js.map +0 -1
  255. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.conf.js.map +0 -1
  256. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js.map +0 -1
  257. package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/editor/index.js.map +0 -1
  258. package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.js.map +0 -1
  259. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.conf.js.map +0 -1
  260. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js.map +0 -1
  261. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.conf.js.map +0 -1
  262. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js.map +0 -1
  263. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js.map +0 -1
  264. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.conf.js.map +0 -1
  265. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js.map +0 -1
  266. package/dist/collection/components/molecules/internals/mg-item-more/mg-item-more.conf.js.map +0 -1
  267. package/dist/collection/components/molecules/internals/mg-item-more/mg-item-more.js.map +0 -1
  268. package/dist/collection/components/molecules/menus/mg-menu/mg-menu.conf.js.map +0 -1
  269. package/dist/collection/components/molecules/menus/mg-menu/mg-menu.js.map +0 -1
  270. package/dist/collection/components/molecules/menus/mg-menu-item/mg-menu-item.conf.js.map +0 -1
  271. package/dist/collection/components/molecules/menus/mg-menu-item/mg-menu-item.js.map +0 -1
  272. package/dist/collection/components/molecules/mg-action-more/mg-action-more.conf.js.map +0 -1
  273. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js.map +0 -1
  274. package/dist/collection/components/molecules/mg-alert/mg-alert.conf.js.map +0 -1
  275. package/dist/collection/components/molecules/mg-alert/mg-alert.js.map +0 -1
  276. package/dist/collection/components/molecules/mg-details/mg-details.js.map +0 -1
  277. package/dist/collection/components/molecules/mg-form/mg-form.conf.js.map +0 -1
  278. package/dist/collection/components/molecules/mg-form/mg-form.js.map +0 -1
  279. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.conf.js.map +0 -1
  280. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js.map +0 -1
  281. package/dist/collection/components/molecules/mg-loader/mg-loader.js.map +0 -1
  282. package/dist/collection/components/molecules/mg-message/mg-message.conf.js.map +0 -1
  283. package/dist/collection/components/molecules/mg-message/mg-message.js.map +0 -1
  284. package/dist/collection/components/molecules/mg-modal/mg-modal.conf.js.map +0 -1
  285. package/dist/collection/components/molecules/mg-modal/mg-modal.js.map +0 -1
  286. package/dist/collection/components/molecules/mg-pagination/mg-pagination.conf.js.map +0 -1
  287. package/dist/collection/components/molecules/mg-pagination/mg-pagination.js.map +0 -1
  288. package/dist/collection/components/molecules/mg-panel/mg-panel.conf.js.map +0 -1
  289. package/dist/collection/components/molecules/mg-panel/mg-panel.js.map +0 -1
  290. package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js.map +0 -1
  291. package/dist/collection/components/molecules/mg-popover/mg-popover.js.map +0 -1
  292. package/dist/collection/components/molecules/mg-progress/mg-progress.conf.js.map +0 -1
  293. package/dist/collection/components/molecules/mg-progress/mg-progress.js.map +0 -1
  294. package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.conf.js.map +0 -1
  295. package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js.map +0 -1
  296. package/dist/collection/components/molecules/mg-table/mg-table.conf.js.map +0 -1
  297. package/dist/collection/components/molecules/mg-table/mg-table.js.map +0 -1
  298. package/dist/collection/components/molecules/mg-tabs/mg-tabs.conf.js.map +0 -1
  299. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js.map +0 -1
  300. package/dist/collection/index.js.map +0 -1
  301. package/dist/collection/locales/index.conf.js.map +0 -1
  302. package/dist/collection/locales/index.js.map +0 -1
  303. package/dist/collection/types/index.js.map +0 -1
  304. package/dist/collection/utils/behaviors.utils.js.map +0 -1
  305. package/dist/collection/utils/events.utils.js.map +0 -1
  306. package/dist/collection/utils/playwright.fixture.js.map +0 -1
  307. package/dist/collection/utils/unit.test.utils.js.map +0 -1
  308. package/dist/components/events.utils.js.map +0 -1
  309. package/dist/components/index.js.map +0 -1
  310. package/dist/components/index2.js.map +0 -1
  311. package/dist/components/index3.js.map +0 -1
  312. package/dist/components/mg-action-more.js.map +0 -1
  313. package/dist/components/mg-alert.js.map +0 -1
  314. package/dist/components/mg-badge.js.map +0 -1
  315. package/dist/components/mg-badge2.js.map +0 -1
  316. package/dist/components/mg-button.js.map +0 -1
  317. package/dist/components/mg-button2.js.map +0 -1
  318. package/dist/components/mg-card.js.map +0 -1
  319. package/dist/components/mg-card2.js.map +0 -1
  320. package/dist/components/mg-character-left.js.map +0 -1
  321. package/dist/components/mg-character-left2.js.map +0 -1
  322. package/dist/components/mg-details.js.map +0 -1
  323. package/dist/components/mg-divider.js.map +0 -1
  324. package/dist/components/mg-divider2.js.map +0 -1
  325. package/dist/components/mg-form.js.map +0 -1
  326. package/dist/components/mg-icon.js.map +0 -1
  327. package/dist/components/mg-icon2.js.map +0 -1
  328. package/dist/components/mg-illustrated-message.js.map +0 -1
  329. package/dist/components/mg-input-checkbox-paginated.js.map +0 -1
  330. package/dist/components/mg-input-checkbox-paginated2.js.map +0 -1
  331. package/dist/components/mg-input-checkbox.js.map +0 -1
  332. package/dist/components/mg-input-combobox.js.map +0 -1
  333. package/dist/components/mg-input-date.js.map +0 -1
  334. package/dist/components/mg-input-numeric.js.map +0 -1
  335. package/dist/components/mg-input-password.js.map +0 -1
  336. package/dist/components/mg-input-radio.js.map +0 -1
  337. package/dist/components/mg-input-rich-text-editor.js.map +0 -1
  338. package/dist/components/mg-input-select.js.map +0 -1
  339. package/dist/components/mg-input-select2.js.map +0 -1
  340. package/dist/components/mg-input-text.js.map +0 -1
  341. package/dist/components/mg-input-text2.js.map +0 -1
  342. package/dist/components/mg-input-textarea.js.map +0 -1
  343. package/dist/components/mg-input-title.js.map +0 -1
  344. package/dist/components/mg-input-title2.js.map +0 -1
  345. package/dist/components/mg-input-toggle.js.map +0 -1
  346. package/dist/components/mg-input.js.map +0 -1
  347. package/dist/components/mg-input2.js.map +0 -1
  348. package/dist/components/mg-item-more.js.map +0 -1
  349. package/dist/components/mg-item-more2.js.map +0 -1
  350. package/dist/components/mg-loader.js.map +0 -1
  351. package/dist/components/mg-loader2.js.map +0 -1
  352. package/dist/components/mg-menu-item.js.map +0 -1
  353. package/dist/components/mg-menu-item2.js.map +0 -1
  354. package/dist/components/mg-menu.js.map +0 -1
  355. package/dist/components/mg-message.js.map +0 -1
  356. package/dist/components/mg-message2.js.map +0 -1
  357. package/dist/components/mg-modal.js.map +0 -1
  358. package/dist/components/mg-pagination.js.map +0 -1
  359. package/dist/components/mg-pagination2.js.map +0 -1
  360. package/dist/components/mg-panel.js.map +0 -1
  361. package/dist/components/mg-popover-content.js.map +0 -1
  362. package/dist/components/mg-popover-content2.js.map +0 -1
  363. package/dist/components/mg-popover.js.map +0 -1
  364. package/dist/components/mg-popover2.js.map +0 -1
  365. package/dist/components/mg-progress.js.map +0 -1
  366. package/dist/components/mg-skip-links.js.map +0 -1
  367. package/dist/components/mg-table.js.map +0 -1
  368. package/dist/components/mg-tabs.js.map +0 -1
  369. package/dist/components/mg-tag.js.map +0 -1
  370. package/dist/components/mg-tooltip-content.js.map +0 -1
  371. package/dist/components/mg-tooltip-content2.js.map +0 -1
  372. package/dist/components/mg-tooltip.js.map +0 -1
  373. package/dist/components/mg-tooltip2.js.map +0 -1
  374. package/dist/components/popper.js.map +0 -1
  375. package/dist/esm/app-globals-DQuL1Twl.js +0 -6
  376. package/dist/esm/app-globals-DQuL1Twl.js.map +0 -1
  377. package/dist/esm/events.utils-yMGqY8YG.js.map +0 -1
  378. package/dist/esm/index-Bv7NHR-W.js.map +0 -1
  379. package/dist/esm/index-CAuxALt5.js.map +0 -1
  380. package/dist/esm/index-Dr7GYvIz.js.map +0 -1
  381. package/dist/esm/index.js.map +0 -1
  382. package/dist/esm/loader.js.map +0 -1
  383. package/dist/esm/mg-action-more_37.entry.js.map +0 -1
  384. package/dist/esm/mg-alert.entry.js.map +0 -1
  385. package/dist/esm/mg-components.js.map +0 -1
  386. package/dist/esm/mg-input-combobox.entry.js.map +0 -1
  387. package/dist/esm/mg-input-rich-text-editor.entry.js.map +0 -1
  388. package/dist/esm/mg-input.conf-CNgv8hc5.js.map +0 -1
  389. package/dist/esm/mg-loader.entry.js.map +0 -1
  390. package/dist/esm/mg-progress.entry.js.map +0 -1
  391. package/dist/mg-components/index.esm.js.map +0 -1
  392. package/dist/mg-components/loader.esm.js.map +0 -1
  393. package/dist/mg-components/mg-alert.entry.esm.js.map +0 -1
  394. package/dist/mg-components/mg-components.esm.js.map +0 -1
  395. package/dist/mg-components/mg-input-combobox.entry.esm.js.map +0 -1
  396. package/dist/mg-components/mg-input-rich-text-editor.entry.esm.js.map +0 -1
  397. package/dist/mg-components/mg-loader.entry.esm.js.map +0 -1
  398. package/dist/mg-components/mg-progress.entry.esm.js.map +0 -1
  399. package/dist/mg-components/p-19cbc6e6.entry.js +0 -11
  400. package/dist/mg-components/p-19cbc6e6.entry.js.map +0 -1
  401. package/dist/mg-components/p-269e2a80.entry.js +0 -2
  402. package/dist/mg-components/p-269e2a80.entry.js.map +0 -1
  403. package/dist/mg-components/p-2dea7d37.entry.js +0 -2
  404. package/dist/mg-components/p-2dea7d37.entry.js.map +0 -1
  405. package/dist/mg-components/p-415f14fb.entry.js +0 -2
  406. package/dist/mg-components/p-415f14fb.entry.js.map +0 -1
  407. package/dist/mg-components/p-Bv7NHR-W.js.map +0 -1
  408. package/dist/mg-components/p-CAuxALt5.js +0 -3
  409. package/dist/mg-components/p-CAuxALt5.js.map +0 -1
  410. package/dist/mg-components/p-CNgv8hc5.js.map +0 -1
  411. package/dist/mg-components/p-DQuL1Twl.js +0 -2
  412. package/dist/mg-components/p-DQuL1Twl.js.map +0 -1
  413. package/dist/mg-components/p-Dr7GYvIz.js.map +0 -1
  414. package/dist/mg-components/p-fe974d2b.entry.js +0 -2
  415. package/dist/mg-components/p-fe974d2b.entry.js.map +0 -1
  416. package/dist/mg-components/p-fea46548.entry.js +0 -2
  417. package/dist/mg-components/p-fea46548.entry.js.map +0 -1
  418. package/dist/mg-components/p-yMGqY8YG.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"mg-item-more.js","sourceRoot":"","sources":["../../../../../src/components/molecules/internals/mg-item-more/mg-item-more.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAChF,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAG7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE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;YACvE,6DAAM,KAAK,EAAE,EAAE,sBAAsB,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,IAAI,EAAC,OAAO,IAC3E,IAAI,CAAC,SAAS,CAAC,KAAK,CAChB;YACP,gEACE,SAAS,EAAE,UAAU,CAAC,QAAQ,EAC9B,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,SAAS,EAC9B,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,GAAG,EAAE,GAAG,CAAC,EAAE;oBACT,IAAI,GAAG,KAAK,IAAI;wBAAE,IAAI,CAAC,iBAAiB,GAAG,GAAG,CAAC;gBACjD,CAAC,GACQ,CACE,CAChB,CACI,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Prop, Element, Host, Watch, State } from '@stencil/core';\nimport { toString } from '@mgdis/core-ui-helpers/dist/utils';\nimport type { IconType, SizeType, SlotLabelType } from './mg-item-more.conf';\nimport type { MessageType } from '../../../../locales/index.conf';\nimport { OverflowBehavior } from '../../../../utils/behaviors.utils';\nimport { directions, sizes } from '../../menus/mg-menu/mg-menu.conf';\nimport { initLocales } from '../../../../locales';\n\n/**\n * @internal\n */\n@Component({\n tag: 'mg-item-more',\n styleUrl: '../../../../../node_modules/@mgdis/styles/dist/components/mg-item-more.css',\n shadow: true,\n})\nexport class MgItemMore {\n /************\n * Internal *\n ************/\n private readonly name = 'mg-item-more';\n private messages: MessageType;\n private overflowBehavior: OverflowBehavior;\n private itemMoreContainer: HTMLMgMenuElement;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgItemMoreElement;\n\n /**\n * Define icon\n */\n @Prop() icon?: IconType = { icon: 'ellipsis-vertical' };\n @Watch('icon')\n validateIcon(newValue: MgItemMore['icon']): void {\n if (typeof newValue !== 'object' || (typeof newValue === 'object' && typeof newValue.icon !== 'string'))\n throw new Error(`<${this.name}> prop \"icon\" must match MgItemMore['icon'] type. Passed value: ${toString(newValue)}.`);\n }\n\n /**\n * Define slot label element\n */\n @Prop() slotlabel?: SlotLabelType = { display: false };\n @Watch('slotlabel')\n validateSlotLabel(newValue: MgItemMore['slotlabel']): void {\n if (typeof newValue !== 'object' || (typeof newValue === 'object' && typeof newValue.display !== 'boolean'))\n throw new Error(`<${this.name}> prop \"slotlabel\" must match MgItemMore['slotlabel'] type. Passed value: ${toString(newValue)}.`);\n else if (typeof newValue.label !== 'string') this.slotlabel.label = this.messages.menuLabel;\n }\n\n /**\n * Define component child menu size.\n */\n @Prop() size?: SizeType;\n @Watch('size')\n validateSize(newValue: MgItemMore['size']): void {\n if (newValue && !sizes.includes(newValue)) throw new Error(`<${this.name}> prop \"size\" must match MgItemMore['size'] type. Passed value: ${toString(newValue)}.`);\n }\n\n /**\n * Define component parent menu.\n */\n @State() parentMenu: HTMLMgMenuElement;\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Set variables and validate props\n */\n componentWillLoad(): void {\n // init variables\n this.messages = initLocales(this.element).messages.itemMore as MessageType;\n\n // validate props\n this.validateIcon(this.icon);\n this.validateSlotLabel(this.slotlabel);\n this.validateSize(this.size);\n }\n\n /**\n * Ensure parent DOM is fully rendered with timeout method before parse elements\n * @returns timeout\n */\n componentDidLoad(): ReturnType<typeof setTimeout> {\n // ensure parent menu is fully rendered\n return setTimeout(() => {\n this.parentMenu = this.element.closest('mg-menu');\n });\n }\n\n /**\n * Set OverflowBehavior when parentMenu state is upate AND defined\n */\n componentDidUpdate(): void {\n if (this.parentMenu && this.overflowBehavior === undefined) {\n this.overflowBehavior = new OverflowBehavior(this.parentMenu, this.element, this.itemMoreContainer);\n }\n }\n\n /**\n * Disconnect overflow ResizeObserver\n */\n disconnectedCallback(): void {\n this.overflowBehavior?.disconnect();\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n const menuItemIdentifier = 'mg-item-more';\n return (\n <Host role=\"listitem\" data-mg-popover-guard={`${menuItemIdentifier}-popover`}>\n {this.parentMenu && (\n <mg-menu-item data-overflow-more data-size={this.parentMenu.size} data-style-direction={directions.HORIZONTAL} identifier={menuItemIdentifier}>\n <mg-icon icon={this.icon.icon} size={this.size} slot=\"image\"></mg-icon>\n <span class={{ 'mg-u-visually-hidden': !this.slotlabel.display }} slot=\"label\">\n {this.slotlabel.label}\n </span>\n <mg-menu\n direction={directions.VERTICAL}\n label={this.messages.menuLabel}\n size={this.size}\n ref={ref => {\n if (ref !== null) this.itemMoreContainer = ref;\n }}\n ></mg-menu>\n </mg-menu-item>\n )}\n </Host>\n );\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mg-menu.conf.js","sourceRoot":"","sources":["../../../../../src/components/molecules/menus/mg-menu/mg-menu.conf.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAA8B;IACnD,QAAQ,EAAE,UAAU;IACpB,UAAU,EAAE,YAAY;CACzB,CAAC;AAOF;;GAEG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAU,CAAC","sourcesContent":["import type { Size, Direction } from '../../../../types';\nimport type { MgItemMore } from '../../internals/mg-item-more/mg-item-more';\n\n/**\n * Menu direction values\n */\nexport const directions: Record<string, Direction> = {\n VERTICAL: 'vertical',\n HORIZONTAL: 'horizontal',\n};\n\n/**\n * ItemMore prop type\n */\nexport type ItemMoreType = Pick<MgItemMore, 'icon' | 'slotlabel' | 'size'>;\n\n/**\n * List of all possibles sizes\n */\nexport const sizes = ['medium', 'large', 'xlarge'] as const;\n\n/**\n * item Size from sizes\n */\nexport type MenuSizeType = Size & (typeof sizes)[number];\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mg-menu.js","sourceRoot":"","sources":["../../../../../src/components/mol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W,EAAE;oBACvD,IAAI,OAAO,KAAK,IAAI,CAAC,OAAO;wBAAE,OAAO,IAAI,CAAC;yBACrC,IAAI,OAAO,CAAC,aAAa,KAAK,IAAI;wBAAE,OAAO,KAAK,CAAC;;wBACjD,OAAO,cAAc,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;gBACpD,CAAC,CAAC;gBAEF,IAAI,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,IAAI,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;oBAC9E,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC;oBACnE,8CAA8C;oBAC9C,IAAI,WAAW,KAAK,IAAI;wBAAE,WAAW,CAAC,eAAe,CAAC,gBAAgB,CAAC,CAAC;gBAC1E,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;QACD,qDAAqD;QACrD,IAAI,gBAAgB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACxF,CAAC;IAED;;;OAGG;IACH,MAAM;QACJ,OAAO,CACL,EAAC,IAAI,qDAAC,IAAI,EAAC,MAAM,gBAAa,IAAI,CAAC,KAAK;YACtC,8DAAa,CACR,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Prop, Element, Watch, Host, Listen } from '@stencil/core';\nimport { directions, sizes } from './mg-menu.conf';\nimport type { MenuSizeType, ItemMoreType } from './mg-menu.conf';\nimport { toString } from '@mgdis/core-ui-helpers/dist/utils';\nimport { Direction } from '../../../../types';\n\n/**\n * @slot - Menu content\n */\n@Component({\n tag: 'mg-menu',\n styleUrl: '../../../../../node_modules/@mgdis/styles/dist/components/mg-menu.css',\n shadow: true,\n})\nexport class MgMenu {\n /************\n * Internal *\n ************/\n\n private readonly name = 'mg-menu';\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgMenuElement;\n\n /**\n * Menu label. Include short menu description.\n * Required to define accessibility required attribute `aria-label`\n */\n @Prop() label!: string;\n @Watch('label')\n validateLabel(newValue: MgMenu['label']): void {\n if (newValue === undefined && !this.element.hasAttribute('aria-label')) {\n throw new Error(`<${this.name}> prop \"label\" is required. Passed value: ${toString(newValue)}.`);\n }\n }\n\n /**\n * Component display direction.\n */\n @Prop({ reflect: true }) direction: Direction = 'horizontal';\n @Watch('direction')\n validateDirection(newValue: MgMenu['direction']): void {\n if (![directions.VERTICAL, directions.HORIZONTAL].includes(newValue)) {\n throw new Error(`<${this.name}> prop \"direction\" must be one of: ${directions.HORIZONTAL}, ${directions.VERTICAL}. Passed value: ${toString(newValue)}.`);\n } else {\n this.updateMenuItems();\n }\n }\n\n /**\n * Customize \"mg-item-more\" element\n * Used with direction: 'vertical' to manage overflow\n */\n @Prop() itemmore?: ItemMoreType;\n @Watch('itemmore')\n validateItemMore(newValue: MgMenu['itemmore']): void {\n if (newValue !== undefined && this.direction !== directions.HORIZONTAL) {\n throw new Error(`<${this.name}> prop \"itemmore\" must be paired with direction ${directions.HORIZONTAL}.`);\n } else if (newValue !== undefined) {\n this.renderMgItemMore();\n }\n }\n\n /**\n * Define mg-menu size\n */\n @Prop() size: MenuSizeType = 'medium';\n @Watch('size')\n validateSize(newValue: MgMenu['size']): void {\n if (!sizes.includes(newValue)) {\n throw new Error(`<${this.name}> prop \"size\" must be one of: ${sizes.join(', ')}. Passed value: ${toString(newValue)}.`);\n }\n }\n\n /**\n * Define mg-menu-item listener when they are loaded\n * @param event - mg-item-loaded \"item-loaded\" custom event\n */\n @Listen('item-loaded')\n updateItemListener(event: CustomEvent & { target: HTMLMgMenuItemElement }): void {\n const itemToWatch = event.target.nodeName === 'MG-ITEM-MORE' ? event.target.shadowRoot.querySelector('mg-menu-item') : event.target;\n\n ['click', 'focus'].forEach(trigger => {\n itemToWatch.addEventListener(trigger, (): void => {\n const focusedItem: HTMLMgMenuItemElement = event.target.closest('mg-menu').querySelector('[data-has-focus]');\n // exit process if new focused item in the current menu children\n if (focusedItem === itemToWatch) return;\n\n // reset expanded on previous active menu item\n if (focusedItem !== null) focusedItem.removeAttribute('data-has-focus');\n\n // update focusedMenuItem with new value\n itemToWatch.setAttribute('data-has-focus', 'true');\n });\n });\n }\n\n /*************\n * Methods *\n *************/\n\n /**\n * Test if menu is a child menu\n * @returns truthy if menu is a child menu\n */\n private isChildMenu = (): boolean => this.element.closest('mg-menu-item') !== null;\n\n /**\n * Get menu children items\n * @returns menu children mg-menu-item\n */\n private getMenuItems = (menu = this.element): HTMLMgMenuItemElement[] => {\n const menuItems = Array.from(menu.children).filter(child => child.nodeName === 'MG-MENU-ITEM') as HTMLMgMenuItemElement[];\n const itemMoreMenuItem = menu.querySelector('mg-item-more')?.shadowRoot?.querySelector('mg-menu-item');\n if (itemMoreMenuItem !== null && itemMoreMenuItem !== undefined) {\n menuItems.push(itemMoreMenuItem);\n }\n return menuItems;\n };\n\n /**\n * Update menu items\n */\n private updateMenuItems = (): void => {\n this.getMenuItems().forEach(item => {\n item.dataset.styleDirection = this.direction;\n });\n\n // render mg-item-more to manage OverflowBehavior\n this.renderMgItemMore();\n };\n\n /**\n * render mg-item-more\n */\n private renderMgItemMore = (): void => {\n if (this.direction === directions.VERTICAL || (this.direction === directions.HORIZONTAL && this.isChildMenu()) || this.element.children.length <= 1) {\n return;\n }\n\n // Insert mg-item-more outside the mg-menu shadowdom\n let itemMoreElement = this.element.querySelector('mg-item-more');\n if (itemMoreElement === null) {\n itemMoreElement = document.createElement('mg-item-more');\n this.element.appendChild(itemMoreElement);\n }\n\n // update mg-item-more props\n for (const propertie in this.itemmore) {\n itemMoreElement[propertie] = this.itemmore[propertie];\n }\n if (this.itemmore?.size === undefined) itemMoreElement.size = this.size;\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Validate props\n */\n componentWillLoad(): void {\n this.validateDirection(this.direction);\n this.validateLabel(this.label);\n this.validateItemMore(this.itemmore);\n this.validateSize(this.size);\n }\n\n /**\n * Check if component slots configuration\n */\n componentDidLoad(): void {\n // set menu-items\n this.updateMenuItems();\n\n // add listener to close main menu when focus leave it\n if (!this.isChildMenu() && this.direction === directions.HORIZONTAL) {\n document.addEventListener('focusin', (event: FocusEvent & { target: HTMLElement }): void => {\n const isElementChild = (element: HTMLElement): boolean => {\n if (element === this.element) return true;\n else if (element.parentElement === null) return false;\n else return isElementChild(element.parentElement);\n };\n\n if (event.target.closest('mg-menu') === null || !isElementChild(event.target)) {\n const focusedItem = this.element.querySelector('[data-has-focus]');\n // reset expanded on previous active menu item\n if (focusedItem !== null) focusedItem.removeAttribute('data-has-focus');\n }\n });\n }\n // add mutation observer to improve global reactivity\n new MutationObserver(this.updateMenuItems).observe(this.element, { childList: true });\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <Host role=\"list\" aria-label={this.label}>\n <slot></slot>\n </Host>\n );\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mg-menu-item.conf.js","sourceRoot":"","sources":["../../../../../src/components/molecules/menus/mg-menu-item/mg-menu-item.conf.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAA+B;IAChD,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,QAAQ;CACjB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,CAAU,CAAC","sourcesContent":["import { Status as StatusType } from '../../../../types';\n\n/**\n * Available menu item status type\n */\nexport type MgMenuStatusType = StatusType & ('visible' | 'hidden' | 'disabled' | 'active');\n\n/**\n * Available menu item status values\n */\nexport const Status: Record<string, StatusType> = {\n VISIBLE: 'visible',\n HIDDEN: 'hidden',\n DISABLED: 'disabled',\n ACTIVE: 'active',\n};\n\n/**\n * List of all possibles target\n */\nexport const targets = ['_blank', '_self', '_parent', '_top'] as const;\n\n/**\n * VariantType type from link target\n */\nexport type TargetType = (typeof targets)[number];\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mg-menu-item.js","sourceRoot":"","sources":["../../../../../src/components/molecules/menus/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,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AACvH,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAqB,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAyB,MAAM,EAAE,OAAO,EAAmB,MAAM,qBAAqB,CAAC;AAI9F;;;;;;GAMG;AAMH,MAAM,OAAO,UAAU;IALvB;QAME;;sBAEc;QAEG,SAAI,GAAG,cAAc,CAAC;QACtB,qBAAgB,GAAG,mCAAmC,CAAC;QAaxE;;sBAEc;QAEd;;WAEG;QACsB,eAAU,GAAW,QAAQ,CAAC,cAAc,CAAC,CAAC;QA2BvE;;WAEG;QACqC,WAAM,GAAsB,SAAS,CAAC;QAO9E;;WAEG;QACsB,aAAQ,GAAI,KAAK,CAAC;QA4B3C;;mBAEW;QAEX;;WAEG;QACM,SAAI,GAAiB,QAAQ,CAAC;QAOvC;;WAEG;QACM,8BAAyB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AI,CAAC,QAAQ,EACtB,SAAS,EAAC,cAAc,EACxB,SAAS,EAAE,IAAI,sBACG,IAAI,CAAC,oBAAoB,EAC3C,UAAU,EAAE,IAAI,CAAC,iBAAiB,6BACV,YAAY,CAAC,yEAAyE;;YAE7G,IAAI,CAAC,wBAAwB,EAAE;YAChC,WAAK,KAAK,EAAE,mBAAmB,EAAE,EAAE,IAAI,EAAC,SAAS,IAC9C,IAAI,CAAC,UAAU,EAAE,CACd,CACK,CACd,CAAC,CAAC,CAAC,CACF;YACE,IAAI,CAAC,wBAAwB,EAAE;YAC/B,WAAK,GAAG,EAAC,oBAAoB,EAAC,KAAK,EAAE,mBAAmB,EAAE,EAAE,MAAM,EAAE,CAAC,IAAI,CAAC,QAAQ,IAC/E,IAAI,CAAC,UAAU,EAAE,CACd;SACP,CACF,CACI,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Prop, State, Host, Watch, Element, Event, EventEmitter } from '@stencil/core';\nimport { ClassList, createID, isValideID, isValidString, nextTick, toString } from '@mgdis/core-ui-helpers/dist/utils';\nimport { initLocales } from '../../../../locales';\nimport { directions, type MenuSizeType } from '../mg-menu/mg-menu.conf';\nimport { type MgMenuStatusType, Status, targets, type TargetType } from './mg-menu-item.conf';\nimport type { MessageType } from '../../../../locales/index.conf';\nimport { Direction } from '../../../../types';\n\n/**\n * @slot - Menu item content\n * @slot image - Menu item image content\n * @slot label - Menu item label content\n * @slot information - Menu item information content\n * @slot metadata - Menu item metadata content\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 messages: MessageType;\n private popoverIdentifier: 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({ reflect: true }) identifier: string = createID('mg-menu-item');\n @Watch('identifier')\n watchIdentifier(newValue: MgMenuItem['identifier']): void {\n if (!isValideID(newValue)) {\n console.error(`<mg-menu-item> prop \"identifier\" value is invalid. Passed value: ${toString(newValue)}.`);\n } else {\n this.popoverIdentifier = `${this.identifier}-popover`;\n }\n }\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 target type\n */\n @Prop() target?: TargetType;\n @Watch('target')\n watchTarget(newValue: MgMenuItem['target']): void {\n if (newValue && !targets.includes(newValue)) {\n throw new Error(`<mg-link> prop \"target\" must be one of: ${targets.join(', ')}. Passed value: ${toString(newValue)}.`);\n }\n }\n\n /**\n * Define menu-item status.\n */\n @Prop({ reflect: true, mutable: true }) status?: MgMenuStatusType = 'visible';\n @Watch('status')\n watchStatus(newValue: MgMenuItem['status'], oldValue?: MgMenuItem['status']): void {\n if (oldValue !== undefined) this.navigationButtonClassList.delete(`${this.navigationButton}--${oldValue}`);\n this.navigationButtonClassList.add(`${this.navigationButton}--${newValue}`);\n }\n\n /**\n * Define menu-item content expanded.\n */\n @Prop({ mutable: true }) expanded? = false;\n @Watch('expanded')\n watchExpanded(newValue: MgMenuItem['expanded']): void {\n if (typeof newValue !== 'boolean') {\n throw new Error(`<${this.name}> prop \"expanded\" must be a boolean. Passed value: ${toString(newValue)}.`);\n } else {\n this.updateExpanded(newValue);\n // when expanded all actives sub-items need to be expanded and non active closed\n Array.from(this.element.querySelectorAll('mg-menu-item')).forEach(item => {\n if (item !== this.element) item.expanded = newValue ? this.hasStatus(item, Status.ACTIVE) : false;\n });\n }\n }\n\n /**********\n * Events *\n *********/\n\n /**\n * Emited event when item is loaded\n */\n @Event({ eventName: 'item-loaded' }) itemLoaded: EventEmitter<void>;\n\n /**\n * Emited event when item is updated\n */\n @Event({ eventName: 'item-updated' }) itemUpdated: EventEmitter<void>;\n\n /**********\n * States *\n *********/\n\n /**\n * Define menu-item size.\n */\n @State() size: MenuSizeType = 'medium';\n @Watch('size')\n watchSize(newValue: MgMenuItem['size'], oldValue?: MgMenuItem['size']): void {\n if (oldValue !== undefined) 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: Direction;\n @Watch('direction')\n validateDirection(newValue: MgMenuItem['direction'], oldValue: MgMenuItem['direction']): void {\n if (oldValue !== undefined) this.navigationButtonClassList.delete(`${this.navigationButton}--${oldValue}`);\n this.navigationButtonClassList.add(`${this.navigationButton}--${newValue}`);\n // manage all sub levels child menu-items level with data-level attribut\n Array.from(this.element.querySelectorAll('mg-menu-item')).forEach(item => {\n if (this.isDirection(directions.VERTICAL, newValue)) {\n item.dataset.level = `${(Number(item.dataset.level) || 1) + 1}`;\n } else {\n delete item.dataset.level;\n }\n });\n }\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 * direction value in dataset\n * @param newValue - new direction value\n */\n // eslint-disable-next-line @stencil-community/no-unused-watch\n @Watch('data-style-direction')\n watchDataStyleDirection(newValue: Direction): void {\n this.direction = newValue;\n }\n\n /**\n * has focus value in dataset\n * @param newValue - new direction value\n */\n // eslint-disable-next-line @stencil-community/no-unused-watch\n @Watch('data-has-focus')\n watchDataHasFocus(newValue: string): void {\n if (!isValidString(newValue)) this.updateExpanded(Boolean(newValue));\n }\n\n /***********\n * Methods *\n **********/\n\n /**\n * Get parent menu\n * @returns parent menu\n */\n private getParentMenu = (): HTMLMgMenuElement => this.element.closest('mg-menu');\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 * Condition to know if component should display a mg-popover\n * @returns truthy if component display popover\n */\n private hasPopover = (): boolean =>\n this.isDirection(directions.HORIZONTAL) &&\n ((this.isInMainMenu() && Array.from(this.element.children).some(element => element.querySelector('[slot]') === null)) || this.isItemMore) &&\n this.href === undefined;\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.hasAttribute('hidden'),\n );\n\n /**\n * Is component an interactive item\n * @returns truthy if element is clickable\n */\n private isInteractiveItem = (): boolean => this.hasChildren || !isValidString(this.href);\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 * Does component is in main menu\n * @returns true if component is in main menu\n */\n private isInMainMenu = (): boolean => this.getParentMenu() !== null && this.element.parentElement.closest('mg-menu-item') === null;\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 && Array.from(childMenu.children).some((subItem: HTMLMgMenuItemElement) => subItem.querySelector('mg-badge') !== null && !subItem.hasAttribute('hidden'));\n };\n\n /**\n * Update expanded prop\n * @param newValue - expanded new value\n */\n private updateExpanded = (newValue: MgMenuItem['expanded']): void => {\n if (this.isInteractiveItem()) {\n // item is always expanded in vertical menu when has active child\n this.expanded = (this.isDirection(directions.VERTICAL) && this.hasActiveChild()) || newValue;\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: MgMenuItem['status'][] = []): 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 * Render popover clickoutside guard for content slot\n */\n private updatePopoverGuard(): void {\n const subItem: HTMLElement = this.element.querySelector('*:not([slot])');\n if (subItem === null) return;\n if (this.hasPopover()) subItem.dataset.mgPopoverGuard = this.popoverIdentifier;\n else delete subItem.dataset.mgPopoverGuard;\n }\n\n /**\n * Update slots\n * @param guard - prevent action with guard. Default: false.\n */\n private updateSlot = (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) {\n throw new Error(`<${this.name}> slot \"label\" is required.`);\n }\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.hasAttribute('title')) || !guard) element.setAttribute('title', element.textContent);\n });\n });\n };\n\n /**\n * Update menu item\n * @param guard - prevent action with guard\n */\n private updateItem = (guard?: MgMenuItem['status'][]): void => {\n const menu = this.getParentMenu();\n\n // define element size\n if (menu?.size !== undefined && !this.isItemMore) this.size = menu.size;\n else if (this.isItemMore) this.size = this.element.dataset.size as MgMenuItem['size'];\n\n // when vertical main menu item contain an active item we force expanded\n this.updateExpanded(this.expanded);\n this.updateStatus(guard);\n this.updatePopoverGuard();\n this.updateDisplayNotificationBadge();\n };\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.status === Status.DISABLED) {\n event.preventDefault();\n event.stopPropagation();\n }\n\n // for non \"poperized\" menu-item we toggle expanded manualy\n this.updateExpanded(!this.expanded);\n\n // when item is the last clickable item we close the parent popover\n if (!this.isInteractiveItem()) {\n const closePopover = (element: HTMLMgMenuItemElement): void => {\n if (element === null) return;\n else if (element !== this.element && element.expanded && element.shadowRoot.querySelector('mg-popover') !== null) {\n element.expanded = false;\n } else {\n closePopover(element.parentElement.closest('mg-menu-item'));\n }\n };\n closePopover(this.element);\n }\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.updateExpanded(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.messages = initLocales(this.element).messages.menuItem as MessageType;\n this.isItemMore = this.element.dataset.overflowMore !== undefined;\n\n // watchers\n this.watchStatus(this.status);\n this.watchExpanded(this.expanded);\n this.watchTarget(this.target);\n this.watchIdentifier(this.identifier);\n this.watchSize(this.size);\n }\n\n /**\n * Check if component slots configuration\n * @returns timeout\n */\n componentDidLoad(): ReturnType<typeof setTimeout> {\n // validation\n this.updateSlot(true);\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 this.watchDataStyleDirection(this.element.dataset.styleDirection as Direction);\n this.watchDataHasFocus(this.element.dataset.hasFocus);\n this.updateItem([Status.ACTIVE]);\n\n // emit loaded event when component is fully loaded\n this.itemLoaded.emit();\n\n new MutationObserver(mutationsList => {\n if (mutationsList.some(mutation => ['hidden', 'status'].includes(mutation.attributeName))) this.updateStatus(this.hasChildren ? undefined : [Status.ACTIVE]);\n if (mutationsList.some(mutation => mutation.type === 'characterData')) this.updateSlot();\n if (mutationsList.some(mutation => mutation.type === 'childList')) this.updateItem();\n this.itemUpdated.emit();\n }).observe(this.element, { attributes: true, childList: true, characterData: true, subtree: true });\n }, 0);\n }\n\n /**\n * Emit event when component is updated\n * @returns promise process wich emit the 'item-updated' event\n */\n componentShouldUpdate(): Promise<void> {\n return nextTick(() => {\n this.itemUpdated.emit();\n });\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 target={this.href !== undefined && this.target !== undefined ? this.target : undefined}\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.messages.badgeLabel} value=\"!\" variant=\"text-color\" slot=\"information\"></mg-badge>\n </span>\n )}\n {this.target === '_blank' && [\n <mg-icon key=\"icon-new-tab\" class={`${this.navigationButton}-new-tab`} icon=\"arrow-up-right-square\"></mg-icon>,\n <span key=\"a11y-new-tab\" class=\"mg-u-visually-hidden\">\n {this.messages.openNewTab}\n </span>,\n ]}\n </div>\n {this.size !== 'medium' && <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\"></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(directions.HORIZONTAL),\n });\n\n return (\n <Host role={this.isItemMore ? 'presentation' : 'listitem'}>\n {this.hasPopover() ? (\n <mg-popover\n display={this.expanded}\n placement=\"bottom-start\"\n arrowHide={true}\n onDisplay-change={this.handlePopoverDisplay}\n identifier={this.popoverIdentifier}\n data-fallback-placement=\"bottom-end\" // use for the last element of the menu if it is placed on the right side\n >\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 +0,0 @@
1
- {"version":3,"file":"mg-action-more.conf.js","sourceRoot":"","sources":["../../../../src/components/molecules/mg-action-more/mg-action-more.conf.ts"],"names":[],"mappings":"","sourcesContent":["import type { MgBadge } from '../../atoms/mg-badge/mg-badge';\nimport type { MgButton } from '../../atoms/mg-button/mg-button';\nimport type { MgIcon } from '../../atoms/mg-icon/mg-icon';\nimport type { MgMenuItem } from '../menus/mg-menu-item/mg-menu-item';\n\n/**\n * prop icon type\n */\nexport type MgActionMoreIconType = Pick<MgIcon, 'icon'>;\n\n/**\n * prop button type\n */\nexport type MgActionMoreButtonType = Pick<MgButton, 'isIcon' | 'variant' | 'label' | 'disabled'>;\n\n/**\n * locals message type\n */\nexport type MgActionMoreMessageType = { label: string };\n\n/**\n * prop item type\n */\nexport type MgActionMoreItemType = Pick<MgMenuItem, 'status' | 'href' | 'target'> & {\n label: string;\n mouseEventHandler: IMouseEventHandler;\n icon?: Pick<MgIcon, 'icon'> & Partial<Pick<MgIcon, 'variant' | 'variantStyle'>>;\n badge?: Pick<MgBadge, 'value' | 'label'>;\n};\n\n/**\n * prop item divider type\n */\nexport type MgActionMoreDividerType = { isDivider: boolean };\n\n/**\n * MouseEvent callback interface\n */\ntype IMouseEventHandler = (event: MouseEvent) => void;\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mg-action-more.js","sourceRoot":"","sources":["../../../../src/components/molecules/mg-action-more/mg-action-more.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAChF,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,yCAAyC,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAI/C;;;;GAIG;AACH,MAAM,mBAAmB,GAAG,CAAC,IAAa,EAAkC,EAAE;IAC5E,MAAM,KAAK,GAAG,IAA8B,CAAC;IAC7C,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,OAAO,IAAI,KAAK,QAAQ,IAAI,OAAO,IAAI,CAAC,K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,CACF,oBACE,GAAG,EAAE,IAAI,CAAC,KAAK,EACf,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,OAAO,EACrC,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,IAAI,EAAE,IAAI,CAAC,IAAI;gCACf,6CAA6C;gCAC7C,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,EAAE,IAAI,CAAC,iBAAiB,CAAC;gCAE5D,CAAA,MAAA,IAAI,CAAC,IAAI,0CAAE,IAAI,KAAI,eAAS,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,YAAY,EAAE,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,EAAC,OAAO,GAAW;gCAC5I,YAAM,IAAI,EAAC,OAAO,IAAE,IAAI,CAAC,KAAK,CAAQ;gCACrC,CAAA,MAAA,IAAI,CAAC,KAAK,0CAAE,KAAK,KAAI,gBAAU,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,EAAC,aAAa,EAAC,OAAO,EAAC,YAAY,GAAY,CACxH,CAChB,CAAA;yBAAA,CACF,CACO,CACN,CACK,CACR,CACF,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Element, Prop, Watch, State, Host } from '@stencil/core';\nimport { createID, toString } from '@mgdis/core-ui-helpers/dist/utils';\nimport { Status } from '../menus/mg-menu-item/mg-menu-item.conf';\nimport { directions } from '../menus/mg-menu/mg-menu.conf';\nimport { initLocales } from '../../../locales';\nimport type { MessageType } from '../../../locales/index.conf';\nimport type { MgActionMoreItemType, MgActionMoreButtonType, MgActionMoreIconType, MgActionMoreDividerType } from './mg-action-more.conf';\n\n/**\n * MgActionMore['items'] type guard\n * @param prop - commponent items prop\n * @returns return true if type is valid\n */\nconst isMgActionMoreItems = (prop: unknown): prop is MgActionMoreItemType[] => {\n const items = prop as MgActionMoreItemType[];\n return (\n typeof items === 'object' &&\n items.every(item => (typeof item === 'object' && typeof item.label === 'string' && typeof item.mouseEventHandler === 'function') || isMgActionMoreDivider(item))\n );\n};\n\n/**\n * MgActionMoreDividerType type guard\n * @param item - component item\n * @returns return true if type is valid\n */\nconst isMgActionMoreDivider = (item: unknown): item is MgActionMoreDividerType => typeof item === 'object' && (item as MgActionMoreDividerType).isDivider;\n\n/**\n * MgActionMore['button'] type guard\n * @param prop - commponent button prop\n * @returns return true if type is valid\n */\nconst isMgActionMoreButton = (prop: unknown): prop is MgActionMoreButtonType => {\n const button = prop as MgActionMoreButtonType;\n return typeof button === 'object' && typeof button.variant === 'string' && typeof button.isIcon === 'boolean';\n};\n\n/**\n * MgActionMore['icon'] type guard\n * @param prop - commponent icon prop\n * @returns return true if type is valid\n */\nconst isMgActionMoreIcon = (prop: unknown): prop is MgActionMoreIconType => {\n const icon = prop as MgActionMoreIconType;\n return typeof icon === 'object' && typeof icon.icon === 'string';\n};\n\n@Component({\n tag: 'mg-action-more',\n styleUrl: '../../../../node_modules/@mgdis/styles/dist/components/mg-action-more.css',\n shadow: true,\n})\nexport class MgActionMore {\n /************\n * Internal *\n ************/\n\n private readonly name = 'mg-action-more';\n private readonly classBase = 'mg-c-action-more';\n private readonly mgPopoverIdentifier = createID(this.name);\n private messages: MessageType;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgActionMoreElement;\n\n /**\n * Define the menu-items elements\n */\n @Prop() items!: (MgActionMoreItemType | MgActionMoreDividerType)[];\n @Watch('items')\n validateItems(newValue: MgActionMore['items']): void {\n if (!isMgActionMoreItems(newValue)) {\n throw new Error(\n `<${this.name}> prop \"items\" is required and all values must be the same type, MgActionMoreItemType or MgActionMoreDividerType. Passed value: ${toString(newValue)}.`,\n );\n } else if (isMgActionMoreItems(newValue) && newValue.length > 0 && (isMgActionMoreDivider(newValue[0]) || isMgActionMoreDivider(newValue[newValue.length - 1]))) {\n throw new Error(`<${this.name}> prop \"items\" can’t have a divider at the beginning or the end of the array. Passed value: ${toString(newValue)}.`);\n }\n }\n\n /**\n * Define displayed icon\n */\n @Prop({ mutable: true }) icon?: MgActionMoreIconType;\n @Watch('icon')\n validateIcon(newValue: MgActionMore['icon']): void {\n if (newValue && !isMgActionMoreIcon(newValue)) {\n throw new Error(`<${this.name}> prop \"icon\" must match MgActionMoreIconType. Passed value: ${toString(newValue)}.`);\n } else if (newValue?.icon === undefined && Boolean(this.button.isIcon)) {\n this.icon = { icon: 'ellipsis' };\n }\n }\n\n /**\n * Define button properties\n */\n @Prop() button?: MgActionMoreButtonType = { variant: 'flat', isIcon: true };\n @Watch('button')\n validateButton(newValue: MgActionMore['button']): void {\n if (newValue && !isMgActionMoreButton(newValue)) {\n throw new Error(`<${this.name}> prop \"button\" must match MgActionMoreButtonType. Passed value: ${toString(newValue)}.`);\n }\n }\n\n /**\n * Define if chevron is display\n */\n @Prop() displayChevron = false;\n @Watch('displayChevron')\n validateDisplayChevron(newValue: MgActionMore['displayChevron']): void {\n if (newValue && this.button.isIcon === true) {\n throw new Error(`<${this.name}> prop \"displayChevron\" can't be used with a 'button\" prop \"isIcon\" attribute.`);\n }\n }\n /**\n * Menu expanded state\n */\n @State() expanded = false;\n\n /************\n * Methods *\n ***********/\n\n /**\n * Toggle expanded props\n */\n private toggleExpanded = (): void => {\n this.expanded = !this.expanded;\n };\n\n /**\n * Handle popover display change value\n * @param event - display change updated value\n */\n private handleDisplayChange = (event: CustomEvent): void => {\n this.expanded = event.detail;\n };\n\n /**\n * Button click handler\n */\n private handleButton = (): void => {\n this.toggleExpanded();\n };\n\n /**\n * Item click handler\n * @param event - click event\n * @param customHandler - item['mouseEventHandler']\n */\n private handleItemClick = (event: MouseEvent, customHandler: MgActionMoreItemType['mouseEventHandler']) => {\n this.expanded = false;\n customHandler(event);\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Validate props\n */\n componentWillLoad(): void {\n this.messages = initLocales(this.element).messages.actionMore as MessageType;\n this.validateItems(this.items);\n this.validateButton(this.button);\n this.validateIcon(this.icon);\n this.validateDisplayChevron(this.displayChevron);\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n const buttonLabel = this.button.label || this.messages.label;\n const buttonContent = [buttonLabel];\n\n if (!this.button.isIcon && this.displayChevron) {\n buttonContent.push(\n <span\n class={{\n [`${this.classBase}__chevron`]: true,\n [`${this.classBase}__chevron--rotate`]: this.expanded === true,\n }}\n >\n <mg-icon icon=\"chevron-down\"></mg-icon>\n </span>,\n );\n }\n\n return (\n <Host data-mg-popover-guard={this.mgPopoverIdentifier}>\n <span class={this.classBase}>\n <mg-popover identifier={this.mgPopoverIdentifier} display={this.expanded} onDisplay-change={this.handleDisplayChange}>\n <mg-button variant={this.button.variant} isIcon={this.button.isIcon} disabled={this.button.disabled} type=\"button\" label={buttonLabel} onClick={this.handleButton}>\n {this.icon && <mg-icon {...this.icon}></mg-icon>}\n {!this.button.isIcon && buttonContent}\n </mg-button>\n <div slot=\"content\">\n <mg-menu direction={directions.VERTICAL} label={this.messages.label}>\n {this.items.map(item =>\n isMgActionMoreDivider(item) ? (\n <mg-divider class=\"mg-c-action-more__divider\" key=\"divider\" full-width></mg-divider>\n ) : (\n <mg-menu-item\n key={item.label}\n status={item.status || Status.VISIBLE}\n target={item.target}\n href={item.href}\n // eslint-disable-next-line react/jsx-no-bind\n onClick={e => this.handleItemClick(e, item.mouseEventHandler)}\n >\n {item.icon?.icon && <mg-icon icon={item.icon.icon} variant={item.icon.variant} variantStyle={item.icon.variantStyle} slot=\"image\"></mg-icon>}\n <span slot=\"label\">{item.label}</span>\n {item.badge?.label && <mg-badge label={item.badge.label} value={item.badge.value} slot=\"information\" variant=\"text-color\"></mg-badge>}\n </mg-menu-item>\n ),\n )}\n </mg-menu>\n </div>\n </mg-popover>\n </span>\n </Host>\n );\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mg-alert.conf.js","sourceRoot":"","sources":["../../../../src/components/molecules/mg-alert/mg-alert.conf.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAU,CAAC;AAO1E;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,UAAU,EAAE,YAAY,CAAU,CAAC","sourcesContent":["import type { Variant, VariantStyle } from '../../../types';\n\n/**\n * List available variants\n */\nexport const variants = ['info', 'warning', 'success', 'danger'] as const;\n\n/**\n * Variant type\n */\nexport type VariantType = Variant & (typeof variants)[number];\n\n/**\n * List available variant styles\n */\nexport const variantStyles = ['bar-left', 'background'] as const;\n\n/**\n * VariantStyle type\n */\nexport type VariantStyleType = VariantStyle & (typeof variantStyles)[number];\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mg-alert.js","sourceRoot":"","sources":["../../../../src/components/molecules/mg-alert/mg-alert.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5G,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAiC,MAAM,iBAAiB,CAAC;AACzF,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C;;;GAGG;AAMH,MAAM,OAAO,OAAO;IALpB;QAME;;sBAEc;QAEd,UAAU;QACO,qBAAg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sCAAsC;QACtC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,kBAAkB,CAAC,KAAK,IAAI,CAAC;QAC1E,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;YACrB,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAClD,CAAC;IACH,CAAC;IAED;;;OAGG;IACH,MAAM;QACJ,OAAO,CACL,mEACE,KAAK,EAAE,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,EAClC,IAAI,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,EACrE,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,YAAY,EAAE,IAAI,CAAC,YAAY;YAE/B,8DAAa;YACZ,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CACjB,YAAM,IAAI,EAAC,SAAS;gBAClB,YAAM,IAAI,EAAC,SAAS,GAAQ,CACvB,CACR,CAAC,CAAC,CAAC,CACF,YAAM,KAAK,EAAC,0BAA0B;gBACpC,kCAAmB,OAAO,EAAC,MAAM,EAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,WAAW,EAAE,OAAO,EAAE,IAAI,CAAC,WAAW;oBACjG,eAAS,IAAI,EAAC,OAAO,GAAW,CACtB,CACP,CACR,CACU,CACd,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Prop, State, Watch, forceUpdate } from '@stencil/core';\nimport { ClassList, toString } from '@mgdis/core-ui-helpers/dist/utils';\nimport { variants, variantStyles, VariantStyleType, VariantType } from './mg-alert.conf';\nimport { initLocales } from '../../../locales';\n\n/**\n * @slot - Alert content\n * @slot actions - Actions content\n */\n@Component({\n tag: 'mg-alert',\n styleUrl: '../../../../node_modules/@mgdis/styles/dist/components/mg-alert.css',\n shadow: true,\n})\nexport class MgAlert {\n /************\n * Internal *\n ************/\n\n // Classes\n private readonly classCloseButton = 'mg-c-alert--close-button';\n\n // Stored timer setted when hide action is run from setTimeOut\n private storedTimer: ReturnType<typeof setTimeout> = null;\n\n // Manage hover\n private isFocused = false;\n private isHovered = false;\n\n // Locales\n private messages;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgAlertElement;\n\n /**\n * Add a delay to hide/close message when it passed\n * Value is defined in seconds and must greater than 2 seconds\n */\n @Prop() delay?: number;\n @Watch('delay')\n watchDelay(newValue: MgAlert['delay']): void {\n if (newValue !== undefined && newValue < 2) {\n throw new Error(`<mg-alert> prop \"delay\" must be greater than 2 seconds. Passed value: ${toString(newValue)}.`);\n }\n }\n\n /**\n * Define variant\n */\n @Prop() variant?: VariantType = 'info';\n @Watch('variant')\n watchVariant(newValue: MgAlert['variant']): void {\n if (newValue && !variants.includes(newValue)) {\n throw new Error(`<mg-alert> prop \"variant\" must be one of: ${variants.join(', ')}. Passed value: ${toString(newValue)}.`);\n }\n }\n\n /**\n * Define variant style\n */\n @Prop() variantStyle?: VariantStyleType = 'bar-left';\n @Watch('variantStyle')\n watchVariantStyle(newValue: MgAlert['variantStyle']): void {\n if (newValue && !variantStyles.includes(newValue)) {\n throw new Error(`<mg-alert> prop \"variantStyle\" must be one of: ${variantStyles.join(', ')}. Passed value: ${toString(newValue)}.`);\n }\n }\n\n /**\n * Watch hidden prop\n */\n // eslint-disable-next-line @stencil-community/no-unused-watch\n @Watch('hidden')\n watchHidden(newValue: boolean): void {\n if (typeof newValue === 'string' && newValue === '') {\n newValue = true;\n }\n if (newValue) {\n this.componentHide.emit();\n // Remove event Listener\n ['focusin', 'mouseenter'].forEach(event => {\n this.element.removeEventListener(event, this.timerEvents);\n });\n // Clear Timer\n this.clearTimer();\n } else {\n this.componentShow.emit();\n // If delay is set\n if (this.delay > 1) {\n // Start timer\n this.setTimer();\n // Stop timer when get focus or mouse enter\n ['focusin', 'mouseenter'].forEach(event => {\n this.element.addEventListener(event, this.timerEvents);\n });\n }\n }\n forceUpdate(this);\n }\n\n /**\n * Component classes\n */\n @State() classCollection: ClassList = new ClassList(['mg-c-alert']);\n\n /**\n * Define if component is using actions slot\n */\n @State() hasActions = false;\n\n /**\n * Emited event when alert is diplayed\n */\n @Event({ eventName: 'component-show' }) componentShow: EventEmitter<void>;\n\n /**\n * Emited event when alert is hidden\n */\n @Event({ eventName: 'component-hide' }) componentHide: EventEmitter<void>;\n\n /**\n * Emmited event when alert is closed\n */\n @Event({ eventName: 'component-close' }) componentClose: EventEmitter<void>;\n\n /**\n * Set timer\n */\n private setTimer = (): void => {\n this.storedTimer = setTimeout(() => (this.element.hidden = true), this.delay * 1000);\n };\n\n /**\n * Clear timer\n */\n private clearTimer = (): void => {\n clearTimeout(this.storedTimer);\n };\n\n /**\n * Event to add on element\n * @param event - event\n */\n private timerEvents = (event: MouseEvent | FocusEvent): void => {\n this.clearTimer();\n const isMouseEvent: boolean = event.type === 'mouseenter';\n // Needed to ensure we don't start the timer\n this[isMouseEvent ? 'isHovered' : 'isFocused'] = true;\n\n // Restart timer when loose focus AND mouse leave\n this.element.addEventListener(\n isMouseEvent ? 'mouseleave' : 'focusout',\n eventOut => {\n this[eventOut.type === 'mouseleave' ? 'isHovered' : 'isFocused'] = false;\n // Start timer if needed\n if (!this.isFocused && !this.isHovered) this.setTimer();\n },\n { once: true },\n );\n };\n\n /**\n * Handle close button\n */\n private handleClose = (): void => {\n this.element.hidden = true;\n this.componentClose.emit();\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Check if component props are well configured on init\n */\n componentWillLoad(): void {\n // Get locales\n this.messages = initLocales(this.element).messages;\n // Validate\n this.watchVariant(this.variant);\n this.watchVariantStyle(this.variantStyle);\n this.watchDelay(this.delay);\n this.watchHidden(this.element.hidden);\n // Check if component has actions slot\n this.hasActions = this.element.querySelector('[slot=\"actions\"]') !== null;\n if (!this.hasActions) {\n this.classCollection.add(this.classCloseButton);\n }\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <mg-message\n class={this.classCollection.join()}\n role={['info', 'success'].includes(this.variant) ? 'status' : 'alert'}\n variant={this.variant}\n variantStyle={this.variantStyle}\n >\n <slot></slot>\n {this.hasActions ? (\n <span slot=\"actions\">\n <slot name=\"actions\"></slot>\n </span>\n ) : (\n <span class=\"mg-c-alert__close-button\">\n <mg-button is-icon variant=\"flat\" label={this.messages.alert.closeButton} onClick={this.handleClose}>\n <mg-icon icon=\"cross\"></mg-icon>\n </mg-button>\n </span>\n )}\n </mg-message>\n );\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mg-details.js","sourceRoot":"","sources":["../../../../src/components/molecules/mg-details/mg-details.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxF,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAElE;;;GAGG;AAMH,MAAM,OAAO,SAAS;IALtB;QA0CE;;WAEG;QACK,gBAAW,GAAG,KAAK,CAAC;QAE5B;;WAEG;QACsB,aAAQ,GAAG,KAAK,CAAC;QAW1C;;WAEG;QACK,iBAAY,GAAG,GAAS,EAAE;YAChC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;QACpC,CAAC,CAAC;KAkDH;IAlFC,cAAc,CAAC,QAAgB;QAC7B,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC7B,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AS,IAAI,EAAC,YAAY,EAAC,KAAK,EAAE,EAAE,2BAA2B,EAAE,IAAI,EAAE,oCAAoC,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAY;oBACzI,6DAAM,KAAK,EAAE,EAAE,sBAAsB,EAAE,IAAI,CAAC,WAAW,EAAE,IAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAQ,CACpH,CACC;YACV,4DAAK,KAAK,EAAC,uBAAuB;gBAChC,6DAAM,IAAI,EAAC,SAAS,GAAQ,CACxB,CACE,CACX,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, EventEmitter, h, Prop, Watch, Element } from '@stencil/core';\nimport { isValidString } from '@mgdis/core-ui-helpers/dist/utils';\n\n/**\n * @slot summary - Summary content\n * @slot details - Details content\n */\n@Component({\n tag: 'mg-details',\n styleUrl: '../../../../node_modules/@mgdis/styles/dist/components/mg-details.css',\n shadow: true,\n})\nexport class MgDetails {\n /************\n * Internal *\n ************/\n\n // HTML selector\n private details: HTMLDetailsElement;\n private isEmptySummary: boolean;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgDetailsElement;\n\n /**\n * Displayed title when details are closed\n */\n @Prop() toggleClosed!: string;\n\n /**\n * Displayed title when details are opened\n */\n @Prop() toggleOpened!: string;\n @Watch('toggleClosed')\n @Watch('toggleOpened')\n validateTitles(newValue: string): void {\n if (!isValidString(newValue)) {\n throw new Error(\n `<mg-details> prop \"toggleClosed\" and \"toggleOpened\" is required and must be a valid string. Passed value: \"toggleClosed='${this.toggleClosed}'\" and \"toggleOpened='${this.toggleOpened}'\".`,\n );\n }\n }\n\n /**\n * Hide summary element\n */\n @Prop() hideSummary = false;\n\n /**\n * Define if details are diplayed\n */\n @Prop({ mutable: true }) expanded = false;\n @Watch('expanded')\n handleExpanded(newValue: boolean): void {\n this.expandedChange.emit(newValue);\n }\n\n /**\n * Emmited event when expanded change\n */\n @Event({ eventName: 'expanded-change' }) expandedChange: EventEmitter<HTMLMgDetailsElement['expanded']>;\n\n /**\n * Handle details toggle\n */\n private handleToggle = (): void => {\n this.expanded = this.details.open;\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Check if component props are well configured on init\n */\n componentWillLoad(): void {\n this.validateTitles(this.toggleClosed);\n this.validateTitles(this.toggleOpened);\n\n // Check if summary slot is empty\n const summarySlot = this.element.querySelector('[slot=\"summary\"]');\n this.isEmptySummary = summarySlot === null || !isValidString(summarySlot.textContent);\n\n // Add event listener to prevent default action on summary click\n this.element.addEventListener('click', (event: MouseEvent & { target: HTMLElement }) => {\n if (event.target.closest('[slot=\"summary\"] mg-button, mg-button[slot=\"summary\"]') !== null) {\n event.preventDefault();\n }\n });\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <details\n class={{ 'mg-c-details': true, 'mg-c-details--empty-summary': this.isEmptySummary }}\n onToggle={this.handleToggle}\n open={this.expanded}\n ref={(el: HTMLDetailsElement) => (this.details = el)}\n >\n <summary>\n <slot name=\"summary\"></slot>\n <span class=\"mg-c-details__toggle\">\n <mg-icon icon=\"chevron-up\" class={{ 'mg-c-details__toggle-icon': true, 'mg-c-details__toggle-icon--reverse': !this.expanded }}></mg-icon>\n <span class={{ 'mg-u-visually-hidden': this.hideSummary }}>{this.expanded ? this.toggleOpened : this.toggleClosed}</span>\n </span>\n </summary>\n <div class=\"mg-c-details__details\">\n <slot name=\"details\"></slot>\n </div>\n </details>\n );\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mg-form.conf.js","sourceRoot":"","sources":["../../../../src/components/molecules/mg-form/mg-form.conf.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,cAAc,CAAU,CAAC;AAOzE;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,SAAS,EAAE,MAAM,CAAU,CAAC","sourcesContent":["import { AriaRole } from '../../../types';\n\n/**\n * List of all possibles roles\n */\nexport const roles = ['form', 'search', 'none', 'presentation'] as const;\n\n/**\n * Aria Role type from roles\n */\nexport type AriaRoleType = AriaRole & (typeof roles)[number];\n\n/**\n * List of all possibles required message status\n */\nexport const requiredMessageStatus = ['default', 'hide'] as const;\n\n/**\n * RequiredMessageStatus type from requiredMessageStatus\n */\nexport type RequiredMessageStatusType = (typeof requiredMessageStatus)[number];\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mg-form.js","sourceRoot":"","sources":["../../../../src/components/molecules/mg-form/mg-form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACvG,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC9F,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAgB,qBAAqB,EAA6B,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvG;;;GAGG;AAMH,MAAM,OAAO,MAAM;IALnB;QAaE,UAAU;QACO,qBAAgB,GAAG,yBAAyB,CAAC;QAC7C,oBAAe,GAAG,yBAAyB,CAAC;QAc7D;;;WAGG;QACK,eAAU,GAAW,QAAQ,CAAC,SAAS,CAAC,CAAC;QAQjD;;;WAGG;QACK,SAAI,GAAW,IAAI,CAAC,UAAU,CAAC;QAEvC;;WAEG;QACK,aAAQ,GAAG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,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ;YACjI,IAAI,CAAC,mBAAmB,IAAI,0DAAG,SAAS,EAAE,IAAI,CAAC,mBAAmB,GAAM;YACzE,8DAAa;YACZ,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,6DAAM,IAAI,EAAC,SAAS,GAAQ,CAC5D,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\nimport { createID, ClassList, toString, isValideID } from '@mgdis/core-ui-helpers/dist/utils';\nimport { initLocales } from '../../../locales';\nimport { HTMLMgInputsElement } from '../inputs/mg-input/mg-input.conf';\nimport { AriaRoleType, requiredMessageStatus, RequiredMessageStatusType, roles } from './mg-form.conf';\n\n/**\n * @slot - Form content\n * @slot actions - Actions content\n */\n@Component({\n tag: 'mg-form',\n styleUrl: '../../../../node_modules/@mgdis/styles/dist/components/mg-form.css',\n shadow: true,\n})\nexport class MgForm {\n /************\n * Internal *\n ************/\n\n private mgInputs: (HTMLMgInputsElement & { disabled: boolean })[];\n private mgButtons: HTMLMgButtonElement[];\n\n // Classes\n private readonly classAllRequired = 'mg-c-form--all-required';\n private readonly classLabelOnTop = 'mg-c-form--label-on-top';\n\n // Locales\n private messages;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgFormElement;\n\n /**\n * Identifier is used for the element ID (id is a reserved prop in Stencil.js)\n * If not set, it will be created.\n */\n @Prop() identifier: string = createID('mg-form');\n @Watch('identifier')\n watchIdentifier(newValue: MgForm['identifier']): void {\n if (!isValideID(newValue)) {\n console.error(`<mg-form> prop \"identifier\" value is invalid. Passed value: ${toString(newValue)}.`);\n }\n }\n\n /**\n * Input name\n * If not set the value equals the identifier\n */\n @Prop() name: string = this.identifier;\n\n /**\n * Define if form is readonly\n */\n @Prop() readonly = false;\n\n /**\n * Define when required message is display.\n * When it is unset, component use it internal logic to manage \"required message\" help text display.\n * When you set the prop to `default`, you override the component internal logique to torce it display \"required message\" help text.\n * When you set the prop to `hide`, it will prevent the rendering of the message in the component's DOM.\n * As **this element is an accessibility requirement in the view**,\n * you **MUST*** re-implement this message on your own and display it when your form contains required inputs.\n */\n @Prop() requiredMessage?: RequiredMessageStatusType;\n @Watch('requiredMessage')\n validateRequiredMessage(newValue): void {\n if (newValue && !requiredMessageStatus.includes(newValue)) {\n throw new Error(`<mg-form> prop \"requiredMessage\" must be one of: ${requiredMessageStatus.join(', ')}. Passed value: ${toString(newValue)}.`);\n }\n }\n\n /**\n * Define `<form/>` element aria role\n * see more about aria roles use case: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles\n */\n @Prop() ariaRole?: AriaRoleType;\n @Watch('ariaRole')\n validateAriaRole(newValue: MgForm['ariaRole']) {\n if (newValue && !roles.includes(newValue)) {\n throw new Error(`<mg-form> prop \"ariaRole\" must be one of: ${roles.join(', ')}. Passed value: ${toString(newValue)}.`);\n }\n }\n\n /**\n * Define if slotted mg-component's label are displayed on top\n */\n @Prop() labelOnTop = false;\n @Watch('labelOnTop')\n handlelabelOnTop(newValue: MgForm['labelOnTop']) {\n if (newValue) {\n this.classCollection.add(this.classLabelOnTop);\n } else {\n this.classCollection.delete(this.classLabelOnTop);\n }\n }\n /**\n * Define if form is disabled\n */\n @Prop() disabled = false;\n @Watch('readonly')\n @Watch('disabled')\n @Watch('requiredMessage')\n handleAttributeChange(): void {\n this.setMgInputs();\n this.setRequiredMessage();\n }\n\n /**\n * Define form valid state\n */\n @Prop({ mutable: true }) valid: boolean;\n\n /**\n * Define form invalid state\n */\n @Prop({ mutable: true }) invalid: boolean;\n\n /**\n * Component classes\n */\n @State() classCollection: ClassList = new ClassList(['mg-c-form']);\n\n /**\n * Required message\n */\n @State() requiredMessageText: string;\n\n /**\n * Emitted event on form validity check\n * Tells if form is valid or not\n */\n @Event({ eventName: 'form-valid' }) formValid: EventEmitter<HTMLMgFormElement['valid']>;\n\n /**\n * Emitted event on form submit\n */\n @Event({ eventName: 'form-submit' }) formSubmit: EventEmitter<boolean>;\n\n /**\n * Emitted event on form reset\n */\n @Event({ eventName: 'form-reset' }) formReset: EventEmitter<boolean>;\n\n /**\n * Display input error if it exists.\n */\n @Method()\n async displayError(): Promise<void> {\n if (!this.readonly) {\n this.mgInputs.forEach(input => {\n input.displayError?.();\n });\n this.checkValidity();\n }\n }\n\n /**\n * Reset form inputs values, validity and error state\n */\n @Method()\n async reset(): Promise<void> {\n if (!this.readonly) {\n await Promise.all(\n this.mgInputs.map(async input => {\n if (input.reset !== undefined) {\n await input.reset();\n }\n }),\n );\n this.checkValidity();\n this.formReset.emit(true);\n }\n }\n\n /**\n * Define required message based on mg-inputs required elements\n */\n private setRequiredMessage = (): void => {\n // init required message\n this.requiredMessageText = null;\n this.classCollection.delete(this.classAllRequired);\n\n if (this.requiredMessage === 'hide') return;\n else if (this.requiredMessage === 'default') {\n this.requiredMessageText = this.messages.form.required;\n return;\n }\n\n // If the form is disabled or readonly none of them are required\n // Check if all fields are not editable (readonly or disabled)\n const isEditable = input => !(input.disabled || input.readonly);\n const isMgInputToggle = input => input.nodeName === 'MG-INPUT-TOGGLE';\n if (!this.disabled && !this.readonly && this.mgInputs.some(input => isEditable(input) && !isMgInputToggle(input))) {\n // Get editable inputs\n const editableInputs: HTMLMgInputsElement[] = this.mgInputs.filter(isEditable);\n // Get required inputs\n // mg-input-toggle can not be required\n const requiredInputs: HTMLMgInputsElement[] = editableInputs.filter(input => !isMgInputToggle(input) && input.required);\n // All inputs are required\n if (\n [requiredInputs.length, editableInputs.length].every(length => length === 1) ||\n (requiredInputs.length > 1 && requiredInputs.length === editableInputs.filter(input => !isMgInputToggle(input)).length)\n ) {\n this.requiredMessageText = this.getRequiredMessageBasedOnCount(requiredInputs, 'allRequiredSingle', 'allRequired');\n this.classCollection.add(this.classAllRequired);\n }\n // Some fields are required\n else if (requiredInputs.length > 0) {\n this.requiredMessageText = this.getRequiredMessageBasedOnCount(requiredInputs, 'requiredSingle', 'required');\n }\n }\n };\n\n /**\n * Returns a required message based on the count of required inputs.\n * @param requiredInputs - An array of required input elements.\n * @param keySingle - The key for the singular message format.\n * @param keyPlural - The key for the plural message format.\n * @returns The appropriate required message based on the count of required inputs.\n */\n private getRequiredMessageBasedOnCount = (requiredInputs: HTMLMgInputsElement[], keySingle: string, keyPlural: string) =>\n this.messages.form[requiredInputs.length === 1 ? keySingle : keyPlural];\n\n /**\n * Check if form is valid\n */\n private checkValidity = (): void => {\n // Update required on input event\n this.setRequiredMessage();\n\n this.valid = !this.mgInputs.some(input => input.invalid);\n this.invalid = !this.valid;\n // We need to send valid event if it is the same value\n this.formValid.emit(this.valid);\n };\n\n /**\n * Handle Form Submit\n * @param event - submit event\n */\n private handleFormSubmit = (event: SubmitEvent): void => {\n event.preventDefault();\n this.formSubmit.emit();\n };\n\n /**\n * Set mgInputs\n */\n private setMgInputs = (): void => {\n // Get slotted mgInputs\n this.mgInputs = Array.from(this.element.querySelectorAll('*')).filter((node: Node) => node.nodeName.startsWith('MG-INPUT')) as (HTMLMgInputsElement & { disabled: boolean })[];\n // Set inputs readonly or disabled based on form configuration\n // Othewise listen to events\n this.mgInputs.forEach(input => {\n if (this.labelOnTop) {\n input.labelOnTop = true;\n }\n if (this.readonly) {\n input.readonly = true;\n } else if (this.disabled) {\n input.disabled = true;\n } else {\n input.addEventListener('input-valid', this.checkValidity);\n }\n });\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Check if component props are well configured on init\n */\n componentWillLoad(): void {\n // Get locales\n this.messages = initLocales(this.element).messages;\n\n this.watchIdentifier(this.identifier);\n this.validateAriaRole(this.ariaRole);\n this.validateRequiredMessage(this.requiredMessage);\n this.handlelabelOnTop(this.labelOnTop);\n\n // Get slotted mgButtons\n this.mgButtons = Array.from(this.element.querySelectorAll('mg-button'));\n\n // Set button form identifier\n this.mgButtons.forEach(mgButton => {\n mgButton.setAttribute('form', this.identifier);\n if (mgButton.type === 'reset') {\n mgButton.addEventListener('click', () => {\n this.reset();\n });\n }\n });\n\n // Set mgInputs\n this.setMgInputs();\n\n // Check validity when slotted mgInputs are ready\n Promise.all(\n this.mgInputs.map(async input => {\n try {\n await input.componentOnReady();\n } catch {} // prevent error with VueJS first render\n }),\n ).then(() => {\n // Define required message and check validity\n this.checkValidity();\n });\n }\n\n /**\n * Add slot listeners\n */\n componentDidLoad(): void {\n // Update mgInputs when mgForm content change\n const observerOptions = { childList: true, subtree: true };\n new MutationObserver(mutations => {\n if (mutations.some(mutation => Object.keys(observerOptions).includes(mutation.type))) {\n this.setMgInputs();\n this.checkValidity();\n }\n }).observe(this.element, observerOptions);\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <form class={this.classCollection.join()} id={this.identifier} name={this.name} onSubmit={this.handleFormSubmit} role={this.ariaRole}>\n {this.requiredMessageText && <p innerHTML={this.requiredMessageText}></p>}\n <slot></slot>\n {!this.readonly && !this.disabled && <slot name=\"actions\"></slot>}\n </form>\n );\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mg-illustrated-message.conf.js","sourceRoot":"","sources":["../../../../src/components/molecules/mg-illustrated-message/mg-illustrated-message.conf.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAU,CAAC;AAM3D;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,UAAU,EAAE,YAAY,CAAU,CAAC","sourcesContent":["import type { Size, Direction } from '../../../types';\n\n/**\n * List of all possibles sizes\n */\nexport const sizes = ['small', 'medium', 'large'] as const;\n/**\n * IllustratedMessage size type\n */\nexport type IllustratedMessageSizeType = Size & (typeof sizes)[number];\n\n/**\n * List of all possibles directions\n */\nexport const directions = ['vertical', 'horizontal'] as const;\n/**\n * IllustratedMessage direction type\n */\nexport type IllustratedMessageDirectionType = Direction & (typeof directions)[number];\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mg-illustrated-message.js","sourceRoot":"","sources":["../../../../src/components/molecules/mg-illustrated-message/mg-illustrated-message.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AACnF,OAAO,EAAE,UAAU,EAAyE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAEzI;;;;GAIG;AAMH,MAAM,OAAO,oBAAoB;IALjC;QAeE;;WAEG;QACK,SAAI,GAA+B,QAAQ,CAAC;QAapD;;WAEG;QACK,cAAS,GAAoC,UAAU,CAAC;QAYhE;;WAEG;QACM,oBAAe,GAAc,IAAI,SAAS,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC;KAwDnF;IArFC,SAAS,CAAC,QAAoC,EAAE,QAAqC;QACnF,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC9B,MAAM,IAAI,KAAK,CAAC,wDAAwD,KAAK,CAAC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from '@stencil/core';\nimport { ClassList, isTagName, toString } from '@mgdis/core-ui-helpers/dist/utils';\nimport { directions, type IllustratedMessageDirectionType, type IllustratedMessageSizeType, sizes } 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 @Watch('size')\n watchSize(newValue: IllustratedMessageSizeType, oldValue?: IllustratedMessageSizeType): void {\n if (!sizes.includes(newValue)) {\n throw new Error(`<mg-illustrated-message> prop \"size\" must be one of: ${sizes.join(', ')}. Passed value: ${toString(newValue)}.`);\n } else {\n if (oldValue !== undefined) {\n this.classCollection.delete(`mg-c-illustrated-message--size-${oldValue}`);\n }\n this.classCollection.add(`mg-c-illustrated-message--size-${newValue}`);\n }\n }\n\n /**\n * Define component orientation\n */\n @Prop() direction: IllustratedMessageDirectionType = 'vertical';\n @Watch('direction')\n watchDirection(newValue: IllustratedMessageDirectionType, oldValue?: IllustratedMessageDirectionType): void {\n if (newValue !== undefined && !directions.includes(newValue)) {\n throw new Error(`<mg-illustrated-message> prop \"direction\" must be one of: ${directions.join(', ')}. Passed value: ${toString(newValue)}.`);\n } else if (newValue === 'horizontal') {\n this.classCollection.add('mg-c-illustrated-message--direction-horizontal');\n } else if (oldValue === 'horizontal') {\n this.classCollection.delete('mg-c-illustrated-message--direction-horizontal');\n }\n }\n\n /**\n * Component classes\n */\n @State() classCollection: ClassList = new ClassList(['mg-c-illustrated-message']);\n\n /***********\n * Methods *\n ***********/\n\n /**\n * Validate slots\n */\n private validateSlots(): void {\n const headingTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];\n const slottedTitle = this.element.querySelector('[slot=\"title\"]');\n const slottedIllustrations = this.element.querySelectorAll('[slot=\"illustration\"]');\n const slottedDetails = this.element.querySelectorAll('[slot=\"details\"]');\n\n if (slottedDetails.length === 0 && slottedTitle === null) {\n throw new Error('<mg-illustrated-message> Slot \"title\" or \"details\" must be present.');\n } else if (slottedTitle !== null && !isTagName(slottedTitle, 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 * Lifecycle *\n *************/\n\n /**\n * Check if component props are well configured on init\n */\n componentWillLoad(): void {\n this.watchDirection(this.direction);\n this.watchSize(this.size);\n this.validateSlots();\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <div class={this.classCollection.join()}>\n <div class=\"mg-c-illustrated-message__illustration\">\n <slot name=\"illustration\"></slot>\n </div>\n <div class=\"mg-c-illustrated-message__slots\">\n <slot name=\"title\"></slot>\n <slot name=\"details\"></slot>\n </div>\n </div>\n );\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mg-loader.js","sourceRoot":"","sources":["../../../../src/components/molecules/mg-loader/mg-loader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAO5E,MAAM,OAAO,QAAQ;IALrB;QA+BE;;WAEG;QACK,gBAAW,GAAG,KAAK,CAAC;KA6B7B;IApCC,YAAY,CAAC,QAA6B;QACxC,IAAI,QAAQ,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,oEAAoE,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IACvJ,CAAC;IAOD;;mBAEe;IAEf;;OAEG;IACH,iBAAiB;QACf,cAAc;QACd,IAAI,CAAC,QAAQ,GAAG,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC;QAEnD,iBAAiB;QACjB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAClC,CAAC;IAED;;;OAGG;IACH,MAAM;QACJ,OAAO,CACL,4DAAK,KAAK,EAAC,aAAa,eAAW,QAAQ;YACzC,gEAAS,IAAI,EAAC,QAAQ,EAAC,IAAI,SAAW;YACtC,6DAAM,KAAK,EAAE,EAAE,sBAAsB,EAAE,IAAI,CAAC,WAAW,EAAE,IAAG,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAQ,CAC/G,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, h, Prop, Watch } from '@stencil/core';\nimport { initLocales } from '../../../locales';\nimport { isValidString, toString } from '@mgdis/core-ui-helpers/dist/utils';\n\n@Component({\n tag: 'mg-loader',\n styleUrl: '../../../../node_modules/@mgdis/styles/dist/components/mg-loader.css',\n shadow: true,\n})\nexport class MgLoader {\n /************\n * Internal *\n ************/\n\n // Locales\n private messages;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgLoaderElement;\n\n /**\n * Override loader message\n */\n @Prop() message?: string;\n @Watch('message')\n watchMessage(newValue: MgLoader['message']): void {\n if (newValue && !isValidString(newValue)) throw new Error(`<mg-loader> prop \"message\" must be a valid string. Passed value: ${toString(newValue)}.`);\n }\n\n /**\n * Hide message\n */\n @Prop() messageHide = false;\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Check if component props are well configured on init\n */\n componentWillLoad(): void {\n // Get locales\n this.messages = initLocales(this.element).messages;\n\n // validate props\n this.watchMessage(this.message);\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <div class=\"mg-c-loader\" aria-live=\"polite\">\n <mg-icon icon=\"loader\" spin></mg-icon>\n <span class={{ 'mg-u-visually-hidden': this.messageHide }}>{this.message || this.messages.loader.inProgress}</span>\n </div>\n );\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mg-message.conf.js","sourceRoot":"","sources":["../../../../src/components/molecules/mg-message/mg-message.conf.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAU,CAAC;AAO1E;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,UAAU,EAAE,YAAY,CAAU,CAAC","sourcesContent":["import type { Variant, VariantStyle } from '../../../types';\n\n/**\n * List available variants\n */\nexport const variants = ['info', 'warning', 'success', 'danger'] as const;\n\n/**\n * Variant type\n */\nexport type VariantType = Variant & (typeof variants)[number];\n\n/**\n * List available variant styles\n */\nexport const variantStyles = ['bar-left', 'background'] as const;\n\n/**\n * VariantStyle type\n */\nexport type VariantStyleType = VariantStyle & (typeof variantStyles)[number];\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mg-message.js","sourceRoot":"","sources":["../../../../src/components/molecules/mg-message/mg-message.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAiC,MAAM,mBAAmB,CAAC;AAG3F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,mBAAmB,GAAQ;wBAC7E,YAAM,KAAK,EAAC,oCAAoC,EAAC,GAAG,EAAC,sBAAsB;4BACzE,6DAAM,IAAI,EAAC,SAAS,GAAQ,CACvB;qBACR,CACG,CACE,CACN,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, h, Prop, State, Watch } from '@stencil/core';\nimport { ClassList, toString } from '@mgdis/core-ui-helpers/dist/utils';\nimport { variants, variantStyles, VariantStyleType, VariantType } from './mg-message.conf';\nimport { type MgIcon } from '../../atoms/mg-icon/mg-icon';\n\n/**\n * @slot - Message content\n * @slot actions - Actions content\n */\n@Component({\n tag: 'mg-message',\n styleUrl: '../../../../node_modules/@mgdis/styles/dist/components/mg-message.css',\n shadow: true,\n})\nexport class MgMessage {\n /************\n * Internal *\n ************/\n\n private readonly classBase = 'mg-c-message';\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgMessageElement;\n\n /**\n * Define variant\n */\n @Prop() variant: VariantType = 'info';\n @Watch('variant')\n watchVariant(newValue: MgMessage['variant'], oldValue?: MgMessage['variant']): void {\n if (!variants.includes(newValue)) {\n throw new Error(`<mg-message> prop \"variant\" must be one of: ${variants.join(', ')}. Passed value: ${toString(newValue)}.`);\n } else {\n if (newValue !== undefined) this.classCollection.add(`${this.classBase}--${newValue}`);\n if (oldValue !== undefined) this.classCollection.delete(`${this.classBase}--${oldValue}`);\n }\n }\n\n /**\n * Define variant style\n */\n @Prop() variantStyle: VariantStyleType = 'bar-left';\n @Watch('variantStyle')\n watchVariantStyle(newValue: MgMessage['variantStyle'], oldValue?: MgMessage['variantStyle']): void {\n if (!variantStyles.includes(newValue)) {\n throw new Error(`<mg-message> prop \"variantStyle\" must be one of: ${variantStyles.join(', ')}. Passed value: ${toString(newValue)}.`);\n } else {\n if (newValue !== undefined) this.classCollection.add(`${this.classBase}--${newValue}`);\n if (oldValue !== undefined) this.classCollection.delete(`${this.classBase}--${oldValue}`);\n }\n }\n\n /**\n * Component classes\n */\n @State() classCollection: ClassList = new ClassList(['mg-c-message']);\n\n /**\n * Define if component is using actions slot\n */\n @State() hasActions = false;\n\n /**\n * Get icon corresponding to variant\n * @returns icon\n */\n private getIcon = (): MgIcon['icon'] => {\n switch (this.variant) {\n case 'info':\n return 'info-circle';\n case 'warning':\n return 'exclamation-triangle';\n case 'success':\n return 'check-circle';\n case 'danger':\n return 'exclamation-circle';\n default:\n break;\n }\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Check if component props are well configured on init\n */\n componentWillLoad(): void {\n // Validate\n this.watchVariant(this.variant);\n this.watchVariantStyle(this.variantStyle);\n // Check if component has actions slot\n this.hasActions = this.element.querySelector('[slot=\"actions\"]') !== null;\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <div class={this.classCollection.join()}>\n <mg-card>\n {this.variantStyle === 'bar-left' && <span class=\"mg-c-message__bar\"></span>}\n <span class=\"mg-c-message__icon\">\n <mg-icon icon={this.getIcon()}></mg-icon>\n </span>\n <div class=\"mg-c-message__content\">\n <span class=\"mg-c-message__content-slot\">\n <slot></slot>\n </span>\n {this.hasActions && [\n <span class=\"mg-c-message__content-separator\" key=\"content-separator\"></span>,\n <span class=\"mg-c-message__content-actions-slot\" key=\"content-actions-slot\">\n <slot name=\"actions\"></slot>\n </span>,\n ]}\n </div>\n </mg-card>\n </div>\n );\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mg-modal.conf.js","sourceRoot":"","sources":["../../../../src/components/molecules/mg-modal/mg-modal.conf.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,QAAQ,EAAE,aAAa,CAAU,CAAC","sourcesContent":["/**\n * List of all possibles dialog roles\n */\nexport const dialogRoles = ['dialog', 'alertdialog'] as const;\n\n/**\n * DialogRole type from dialog roles\n */\nexport type DialogRoleType = (typeof dialogRoles)[number];\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mg-modal.js","sourceRoot":"","sources":["../../../../src/components/molecules/mg-modal/mg-modal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAgB,MAAM,eAAe,CAAC;AAC/F,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC7G,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAkB,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9D;;;GAGG;AAMH,MAAM,OAAO,OAAO;IALpB;QAaE,MAAM;QACE,YAAO,GAAG,EAAE,CAAC;QAiBrB;;;WAGG;QACK,eAAU,GAAW,QAAQ,CAAC,UAAU,CAAC,CAAC;QAQlD;;WAEG;QACK,eAAU,GAAmB,QAAQ,CAAC;QAiB9C;;WAEG;QACK,gBAAW,GAAG,KAAK,CAAC;QAE5B;;WAEG;QACsB,SAAI,GAAG,KAAK,CAAC;QActC;;WAEG;QACM,eAAU,GAAG,KAAK,CAAC;QAE5B;;WAEG;QACM,oBAAe,GAAc,IAAI,SAAS,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;QAiBpE;;qBAEa;QAEb;;WAEG;QACK,gBAAW,GAAG,GAAS,EAAE;YAC/B,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;YAClB,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC;QAC7B,CAAC,CAAC;KA8EH;IAjKC,eAAe,CAAC,QAA+B;QAC7C,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC1B,MAAM,IAAI,KAAK,CAAC,gEAAgE,QAAQ,CAA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I,EAAC,OAAO,GAAW,CACtB,CACP,CACR;wBACD,2DAAI,KAAK,EAAC,mBAAmB,EAAC,EAAE,EAAE,IAAI,CAAC,OAAO,IAC3C,IAAI,CAAC,UAAU,CACb,CACE;oBACT,gEAAS,KAAK,EAAC,qBAAqB;wBAClC,8DAAa,CACL;oBACT,IAAI,CAAC,UAAU,IAAI,CAClB,+DAAQ,KAAK,EAAC,oBAAoB;wBAChC,6DAAM,IAAI,EAAC,SAAS,GAAQ,CACrB,CACV,CACG,CACE,CACH,CACV,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Prop, State, Watch, Element, Event, EventEmitter } from '@stencil/core';\nimport { createID, ClassList, isValidString, toString, isValideID } from '@mgdis/core-ui-helpers/dist/utils';\nimport { initLocales } from '../../../locales';\nimport { DialogRoleType, dialogRoles } from './mg-modal.conf';\n\n/**\n * @slot - Modal content\n * @slot actions - Actions content\n */\n@Component({\n tag: 'mg-modal',\n styleUrl: '../../../../node_modules/@mgdis/styles/dist/components/mg-modal.css',\n shadow: true,\n})\nexport class MgModal {\n /************\n * Internal *\n ************/\n\n // Modal focusable elements\n private dialog: HTMLDialogElement;\n\n // IDs\n private titleId = '';\n\n // Locales\n private messages;\n\n // body overflow default\n private bodyOverflow: string;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgModalElement;\n\n /**\n * Identifier is used for the element ID (id is a reserved prop in Stencil.js)\n * If not set, it will be created.\n */\n @Prop() identifier: string = createID('mg-modal');\n @Watch('identifier')\n watchIdentifier(newValue: MgModal['identifier']): void {\n if (!isValideID(newValue)) {\n throw new Error(`<mg-modal> prop \"identifier\" value is invalid. Passed value: ${toString(newValue)}.`);\n }\n }\n\n /**\n * Modal dialog role.\n */\n @Prop() dialogRole: DialogRoleType = 'dialog';\n @Watch('dialogRole')\n validateDialogRole(newValue: MgModal['dialogRole']): void {\n if (!dialogRoles.includes(newValue)) throw new Error(`<mg-modal> prop \"dialogRole\" must be one of: ${dialogRoles.join(', ')}. Passed value: ${toString(newValue)}.`);\n }\n\n /**\n * Displayed modal title\n */\n @Prop() modalTitle!: string;\n @Watch('modalTitle')\n validateModalTitle(newValue: MgModal['modalTitle']): void {\n if (!isValidString(newValue)) {\n throw new Error(`<mg-modal> prop \"modalTitle\" is required. Passed value: ${toString(newValue)}.`);\n }\n }\n\n /**\n * Define if modal has a cross button\n */\n @Prop() closeButton = false;\n\n /**\n * Define if modal is open\n */\n @Prop({ mutable: true }) open = false;\n @Watch('open')\n watchOpen(newValue: boolean): void {\n if (newValue) {\n this.dialog.showModal();\n this.componentShow.emit();\n document.body.style.overflow = 'hidden';\n } else {\n this.dialog.close();\n this.componentHide.emit();\n document.body.style.overflow = this.bodyOverflow;\n }\n }\n\n /**\n * Define if component is using actions slot\n */\n @State() hasActions = false;\n\n /**\n * Component classes\n */\n @State() classCollection: ClassList = new ClassList(['mg-c-modal']);\n\n /**\n * Emmited event when modal is diplayed\n */\n @Event({ eventName: 'component-show' }) componentShow: EventEmitter<void>;\n\n /**\n * Emmited event when modal is hidden\n */\n @Event({ eventName: 'component-hide' }) componentHide: EventEmitter<void>;\n\n /**\n * Emmited event when modal is closed\n */\n @Event({ eventName: 'component-close' }) componentClose: EventEmitter<void>;\n\n /***********\n * Handles *\n ***********/\n\n /**\n * Closes the modal.\n */\n private handleClose = (): void => {\n this.open = false;\n this.componentClose.emit();\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Check if component props are well configured on init\n */\n componentWillLoad(): void {\n // Store body overflow\n this.bodyOverflow = document.body.style.overflow;\n // Get locales\n this.messages = initLocales(this.element).messages;\n // Validate\n this.hasActions = this.element.querySelector('[slot=\"actions\"]') !== null;\n this.titleId = `${this.identifier}-title`;\n this.watchIdentifier(this.identifier);\n this.validateModalTitle(this.modalTitle);\n this.validateDialogRole(this.dialogRole);\n }\n\n /**\n * Define open state on component load\n */\n componentDidLoad(): void {\n this.watchOpen(this.open);\n // update open prop when use escape key\n this.dialog.addEventListener('close', () => {\n this.open = false;\n this.componentClose.emit();\n });\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <dialog\n role={this.dialogRole}\n id={this.identifier}\n class={this.classCollection.join()}\n aria-labelledby={this.titleId}\n ref={(el: HTMLDialogElement) => {\n if (el !== null) {\n this.dialog = el;\n }\n }}\n >\n <mg-card>\n <div class=\"mg-c-modal__dialog\">\n <header class=\"mg-c-modal__header\">\n {this.closeButton && (\n <span class=\"mg-c-modal__close-button\">\n <mg-button is-icon variant=\"flat\" label={this.messages.modal.closeButton} onClick={this.handleClose}>\n <mg-icon icon=\"cross\"></mg-icon>\n </mg-button>\n </span>\n )}\n <h1 class=\"mg-c-modal__title\" id={this.titleId}>\n {this.modalTitle}\n </h1>\n </header>\n <article class=\"mg-c-modal__content\">\n <slot></slot>\n </article>\n {this.hasActions && (\n <footer class=\"mg-c-modal__footer\">\n <slot name=\"actions\"></slot>\n </footer>\n )}\n </div>\n </mg-card>\n </dialog>\n );\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mg-pagination.conf.js","sourceRoot":"","sources":["../../../../src/components/molecules/mg-pagination/mg-pagination.conf.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,UAAU;CACrB,CAAC","sourcesContent":["export const NavigationAction = {\n NEXT: 'next',\n PREVIOUS: 'previous',\n};\n\n/**\n * Define paginationMessage type\n */\nexport type PaginationMessagesType = { next: string; previous: string; nextLabel: string; previousLabel: string };\n"]}
@@ -1 +0,0 @@
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EAAC,6BAA6B;oBACtC,uBACE,UAAU,EAAE,GAAG,IAAI,CAAC,UAAU,SAAS,EACvC,KAAK,EAAE,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,EAC7D,KAAK,EAAE,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,UAAU,gBACrC,IAAI,qBACC,IAAI,CAAC,YAAY,EAClC,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,6BAEjB;oBACnB,YAAM,KAAK,EAAC,sBAAsB;wBAC/B,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,IAAI;;wBAAG,IAAI,CAAC,WAAW,CACnD;;oBACJ,IAAI,CAAC,UAAU;;oBAAG,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,IAAI,CACnH,CACP;gBACA,sBAAsB,CAAC,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,UAAU,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAC/E,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, h, Prop, Watch, Event, EventEmitter, Host } from '@stencil/core';\nimport { createID, isValideID, isValidString, toString } from '@mgdis/core-ui-helpers/dist/utils';\nimport { NavigationAction, type PaginationMessagesType } from './mg-pagination.conf';\nimport { initLocales } from './../../../locales';\n\n/**\n * Range generator\n *\n * ```\n * start by get the range length, add \"+ 1\" to include last value, ex: Math.ceil((3 + 1 - 1) / 1) => 3\n * then with Array(Math.ceil...) we get the final array with empty values, ex: Array(Math.ceil(2 + 1 - 1) / 1)) => [empty, empty, empty]\n * then with Array(Math.ceil...).keys() we get the Array Iterator from empty values\n * then with Array.from(Array(...)) we get the complete array with \"index\" values instead of \"empty\" values\n * ex: Array.from(Array(Math.ceil((2 + 1 - 1) / 1) || 1).keys()) => [0, 1, 2]\n * finaly we map values from \"start\" range and apply the \"step\" coefficiant,\n * ex: Array.from(Array(Math.ceil((2 + 1 - 1) / 1) || 1).keys()).map(x => 1 + x * 1) => [1, 2, 3]\n * ```\n *\n * range(1, 1) = [1]\n * range(1, 5) = [1, 2, 3, 4, 5]\n * range(10, 20, 2) = [10, 12, 14, 16, 18, 20]\n * @param start - start range\n * @param end - start end\n * @param step - step size\n * @returns range numbers\n */\nconst range = (start: number, end: number, step = 1): number[] => Array.from(Array(Math.ceil((end + 1 - start) / step)).keys()).map(x => start + x * step);\n\n@Component({\n tag: 'mg-pagination',\n styleUrl: '../../../../node_modules/@mgdis/styles/dist/components/mg-pagination.css',\n shadow: true,\n})\nexport class MgPagination {\n /************\n * Internal *\n ************/\n\n // Locales\n private localesMessages;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgPaginationElement;\n\n /**\n * Identifier is used for the element ID (id is a reserved prop in Stencil.js)\n * If not set, it will be created.\n */\n @Prop() identifier: string = createID('mg-pagination');\n @Watch('identifier')\n watchIdentifier(newValue: MgPagination['identifier']): void {\n if (!isValideID(newValue)) {\n console.error(`<mg-pagination> prop \"identifier\" value is invalid. Passed value: ${toString(newValue)}.`);\n }\n }\n\n /**\n * Panignation label. Is a short description.\n * Customize default value can be usefull to improve accessibility\n */\n @Prop({ mutable: true }) label: string;\n\n /**\n * Hide navigation label\n */\n @Prop() hideNavigationLabels = false;\n\n /**\n * Hide select input\n */\n @Prop() hidePageCount = false;\n\n /**\n * Component total pages\n */\n @Prop() totalPages = 1;\n @Watch('totalPages')\n validateTotalPages(newValue: number): void {\n if (newValue < 1) {\n throw new Error(`<mg-pagination> prop \"totalPages\" must be greater than 0. Passed value: ${toString(newValue)}.`);\n }\n }\n\n /**\n * Component current page\n */\n @Prop({ reflect: true, mutable: true }) currentPage = 1;\n @Watch('currentPage')\n validateCurrentPage(newValue: number): void {\n if (newValue < 1) {\n throw new Error(`<mg-pagination> prop \"currentPage\" must be greater than 0. Passed value: ${toString(newValue)}.`);\n } else if (newValue > this.totalPages) {\n throw new Error('<mg-pagination> prop \"currentPage\" can not be greater than total page.');\n }\n this.currentPageChange.emit(newValue);\n }\n\n /**\n * Define locales messages overrides\n */\n @Prop() messages: PaginationMessagesType;\n @Watch('messages')\n watchPaginationMessages(newValue: MgPagination['messages']): void {\n if (Boolean(newValue) && (typeof newValue !== 'object' || !['next', 'previous', 'nextLabel', 'previousLabel'].every(key => isValidString(newValue[key])))) {\n throw new Error('<mg-pagination> prop \"messages\" must be a valid \"PaginationMessagesType\".');\n }\n }\n\n /**\n * Emmited event when current page change\n */\n @Event({ eventName: 'current-page-change' }) currentPageChange: EventEmitter<number>;\n\n /**\n * Change current page from target\n * @param target - target page\n */\n private goToPage = (target: number): void => {\n this.currentPage = target;\n };\n\n /************\n * Handlers *\n ************/\n\n /**\n * select handler\n * @param event - value change event\n */\n private handleSelect = (event: InputEvent & { target: HTMLInputElement }): void => {\n const to = Number(event.target.value);\n this.goToPage(to > 0 ? to : 1);\n };\n\n /**\n * Go to 'previous/next' page button handler\n * @param action - navigation action\n * @param disabled - button disable state\n */\n private handleGoToPage = (action: string, disabled: boolean): void => {\n !disabled && this.goToPage(action === NavigationAction.NEXT ? this.currentPage + 1 : this.currentPage - 1);\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Check if props are well configured on init\n */\n componentWillLoad(): void {\n // Get locales\n this.localesMessages = initLocales(this.element).messages;\n // Validate\n this.watchIdentifier(this.identifier);\n this.validateTotalPages(this.totalPages);\n this.validateCurrentPage(this.currentPage);\n this.watchPaginationMessages(this.messages);\n // Set default label\n if (this.label === undefined || this.label === '') {\n this.label = this.localesMessages.pagination.label;\n }\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n const navigationMessages = {\n next: this.messages?.next ?? this.localesMessages.general.next,\n previous: this.messages?.previous ?? this.localesMessages.general.previous,\n nextLabel: this.messages?.nextLabel ?? this.localesMessages.pagination.nextLabel,\n previousLabel: this.messages?.previousLabel ?? this.localesMessages.pagination.previousLabel,\n };\n const navigationActionButton = (disabled: boolean, action: string) => {\n return (\n <mg-button\n label={navigationMessages[`${action}Label`]}\n // eslint-disable-next-line react/jsx-no-bind\n onClick={() => this.handleGoToPage(action, disabled)}\n disabled={disabled}\n variant=\"flat\"\n isIcon={this.hideNavigationLabels}\n >\n {action === NavigationAction.PREVIOUS && <mg-icon icon=\"chevron-left\"></mg-icon>}\n {!this.hideNavigationLabels && navigationMessages[action]}\n {action === NavigationAction.NEXT && <mg-icon icon=\"chevron-right\"></mg-icon>}\n </mg-button>\n );\n };\n\n return (\n <Host hidden={this.totalPages < 2}>\n <nav role=\"navigation\" aria-label={this.label} id={this.identifier} class={{ 'mg-c-pagination': true, 'mg-c-pagination--hide-page-count': this.hidePageCount }}>\n {navigationActionButton(this.currentPage <= 1, NavigationAction.PREVIOUS)}\n {!this.hidePageCount && (\n <div class=\"mg-c-pagination__page-count\">\n <mg-input-select\n identifier={`${this.identifier}-select`}\n items={range(1, this.totalPages).map(page => page.toString())}\n label={this.localesMessages.pagination.selectPage}\n label-hide={true}\n on-value-change={this.handleSelect}\n value={this.currentPage.toString()}\n placeholder-hide\n ></mg-input-select>\n <span class=\"mg-u-visually-hidden\">\n {this.localesMessages.pagination.page} {this.currentPage}\n </span>\n / {this.totalPages} {this.totalPages > 1 ? this.localesMessages.pagination.pages : this.localesMessages.pagination.page}\n </div>\n )}\n {navigationActionButton(this.currentPage >= this.totalPages, NavigationAction.NEXT)}\n </nav>\n </Host>\n );\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mg-panel.conf.js","sourceRoot":"","sources":["../../../../src/components/molecules/mg-panel/mg-panel.conf.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAU,CAAC;AAO9D;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,OAAO,CAAU,CAAC","sourcesContent":["/**\n * Available expand toggle display options\n */\nexport const expandToggleDisplays = ['text', 'icon'] as const;\n\n/**\n * Generated expand toggle display type from available expand toggle display options\n */\nexport type ExpandToggleDisplayType = (typeof expandToggleDisplays)[number];\n\n/**\n * Available title positions\n */\nexport const titlePositions = ['left', 'right'] as const;\n\n/**\n * Generated title positions type from available title positions\n */\nexport type TitlePositionType = (typeof titlePositions)[number];\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mg-panel.js","sourceRoot":"","sources":["../../../../src/components/molecules/mg-panel/mg-panel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAgB,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC/F,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC7G,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAwD,oBAAoB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAE7H;;;GAGG;AAMH,MAAM,OAAO,OAAO;IALpB;QAyBE;;;WAGG;QACK,eAAU,GAAW,QAAQ,CAAC,UAAU,CAAC,CAAC;QAiClD;;WAEG;QACsB,kBAAa,GAAG,KAAK,CAAC;QAE/C;;WAEG;QACK,kBAAa,GAAsB,MAAM,CA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EAAE,IAAI,EAAE,6BAA6B,EAAE,IAAI,CAAC,aAAa,KAAK,OAAO,EAAE,EAAE,EAAE,EAAE,QAAQ,IACvH,IAAI,CAAC,oBAAoB,EAAE,CACrB;gBACT,gEAAS,KAAK,EAAC,qBAAqB,EAAC,EAAE,EAAE,GAAG,IAAI,CAAC,UAAU,UAAU,qBAAmB,QAAQ,EAAE,MAAM,EAAE,CAAC,IAAI,CAAC,QAAQ;oBACtH,8DAAa,CACL,CACF,CACF,CACX,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, h, Prop, State, EventEmitter, Watch, Event } from '@stencil/core';\nimport { createID, ClassList, isValidString, toString, isValideID } from '@mgdis/core-ui-helpers/dist/utils';\nimport { initLocales } from '../../../locales';\nimport { type ExpandToggleDisplayType, type TitlePositionType, expandToggleDisplays, titlePositions } from './mg-panel.conf';\n\n/**\n * @slot - Panel content\n * @slot header-right - Header right panel content\n */\n@Component({\n tag: 'mg-panel',\n styleUrl: '../../../../node_modules/@mgdis/styles/dist/components/mg-panel.css',\n shadow: true,\n})\nexport class MgPanel {\n /************\n * Internal *\n ************/\n\n // HTML selector\n private editInputElement: HTMLMgInputTextElement;\n\n // Locales\n private messages;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgPanelElement;\n\n /**\n * Identifier is used for the element ID (id is a reserved prop in Stencil.js)\n * If not set, it will be created.\n */\n @Prop() identifier: string = createID('mg-panel');\n @Watch('identifier')\n watchIdentifier(newValue: MgPanel['identifier']): void {\n if (!isValideID(newValue)) {\n console.error(`<mg-panel> prop \"identifier\" value is invalid. Passed value: ${toString(newValue)}.`);\n }\n }\n\n /**\n * Panel title\n */\n @Prop({ mutable: true }) panelTitle!: string;\n @Watch('panelTitle')\n validatePanelTitle(newValue: MgPanel['panelTitle']): void {\n if (!isValidString(newValue)) throw new Error(`<mg-panel> prop \"panelTitle\" is required and must be a string. Passed value: ${toString(newValue)}.`);\n this.titleChange.emit(newValue);\n }\n\n /**\n * Panel title pattern\n */\n @Prop() titlePattern?: string;\n\n /**\n * Panel title pattern error message\n */\n @Prop() titlePatternErrorMessage?: string;\n @Watch('titlePattern')\n @Watch('titlePatternErrorMessage')\n validateTitlePattern(newValue: string): void {\n if (newValue !== undefined && !this.titleEditable) throw new Error(`<mg-panel> prop \"titleEditable\" must be set to \"true\".`);\n }\n\n /**\n * Define if panel title is editable\n */\n @Prop({ mutable: true }) titleEditable = false;\n\n /**\n * Define title position\n */\n @Prop() titlePosition: TitlePositionType = 'left';\n @Watch('titlePosition')\n validateTitlePosition(newValue: MgPanel['titlePosition']) {\n if (!titlePositions.includes(newValue)) throw new Error(`<mg-panel> prop \"titlePosition\" must be one of: ${titlePositions.join(', ')}. Passed value: ${toString(newValue)}.`);\n }\n\n /**\n * Panel is opened\n */\n @Prop({ mutable: true }) expanded = false;\n @Watch('expanded')\n handleExpanded(newValue: MgPanel['expanded']): void {\n this.expandedChange.emit(newValue);\n }\n\n /**\n * Define expand toggle button display\n */\n @Prop() expandToggleDisplay: ExpandToggleDisplayType = 'text';\n @Watch('expandToggleDisplay')\n validateExpandToggleDisplay(newValue: MgPanel['expandToggleDisplay']) {\n if (!expandToggleDisplays.includes(newValue))\n throw new Error(`<mg-panel> prop \"expandToggleDisplay\" must be one of: ${expandToggleDisplays.join(', ')}. Passed value: ${toString(newValue)}.`);\n if (newValue === 'icon' && this.titleEditable) this.titleEditable = false;\n }\n\n /**\n * Disable possibility to toggle expand\n */\n @Prop() expandToggleDisabled = false;\n\n /**\n * Component classes\n */\n @State() classCollection: ClassList = new ClassList(['mg-c-panel']);\n\n /**\n * Title is in edition mode\n */\n @State() isEditing = false;\n\n /**\n * Cache for updated panel title before validation\n */\n @State() updatedPanelTitle: string;\n\n /**\n * Emmited event when title change\n */\n @Event({ eventName: 'title-change' }) titleChange: EventEmitter<HTMLMgPanelElement['panelTitle']>;\n\n /**\n * Emmited event when expanded change\n */\n @Event({ eventName: 'expanded-change' }) expandedChange: EventEmitter<HTMLMgPanelElement['expanded']>;\n\n /************\n * Methods *\n ************/\n\n /**\n * Toggle is editing state\n */\n private toggleIsEditing = (): void => {\n this.isEditing = !this.isEditing;\n };\n\n /************\n * Handlers *\n ************/\n\n /**\n * Collapse button click handler\n */\n private handleCollapseButton = (): void => {\n if (!this.expandToggleDisabled) this.expanded = !this.expanded;\n };\n\n /**\n * Edit button click handler\n */\n private handleEditButton = (): void => {\n this.toggleIsEditing();\n };\n\n /**\n * Update title handler\n * @param event - input value change event\n */\n private handleUpdateTitle = (event: CustomEvent<HTMLMgInputTextElement['value']>): void => {\n this.updatedPanelTitle = event.detail;\n };\n\n /**\n * Cancel edition button handler\n */\n private handleCancelEditButton = (): void => {\n this.updatedPanelTitle = undefined;\n this.toggleIsEditing();\n };\n\n /**\n * Validate edition button handler\n */\n private handleValidateEditButton = (): void => {\n if (!this.editInputElement.valid) return;\n if (this.updatedPanelTitle !== undefined) this.panelTitle = this.updatedPanelTitle;\n this.toggleIsEditing();\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Check if props are well configured on init\n */\n componentWillLoad(): void {\n // Get locales\n this.messages = initLocales(this.element).messages;\n // Validate\n this.watchIdentifier(this.identifier);\n this.validateTitlePattern(this.titlePattern);\n this.validateTitlePattern(this.titlePatternErrorMessage);\n this.validatePanelTitle(this.panelTitle);\n this.validateExpandToggleDisplay(this.expandToggleDisplay);\n this.validateTitlePosition(this.titlePosition);\n }\n\n /**\n * Edit DOM after render\n */\n componentDidRender(): void {\n // when we are editing we get focus on edition input\n if (this.isEditing) this.editInputElement.setFocus();\n }\n\n /*************\n * Render *\n *************/\n\n /**\n * Render collapse button\n * @returns collpase button\n */\n private renderCollapseButton = (): HTMLMgButtonElement => (\n <mg-button\n onClick={this.handleCollapseButton}\n variant=\"flat\"\n aria-expanded={this.expanded.toString()}\n aria-controls={`${this.identifier}-content`}\n disabled={this.expandToggleDisabled}\n isIcon={this.expandToggleDisplay === 'icon'}\n label={this.panelTitle}\n >\n <span class=\"mg-c-panel__collapse-button-content\">\n <mg-icon icon=\"chevron-up\" class={{ 'mg-c-panel__collapse-button-icon': true, 'mg-c-panel__collapse-button-icon--reverse': !this.expanded }}></mg-icon>\n {!this.isEditing && this.expandToggleDisplay !== 'icon' && this.panelTitle}\n </span>\n </mg-button>\n );\n\n /**\n * Render edit button\n * @returns edit Button\n */\n private renderEditButton = (): HTMLMgButtonElement => (\n <mg-button key=\"edit-button\" is-icon variant=\"flat\" label={this.messages.panel.editLabel} onClick={this.handleEditButton}>\n <mg-icon icon=\"pen\"></mg-icon>\n </mg-button>\n );\n\n /**\n * Render input button\n * @returns edit title input\n */\n private renderEditInput = (): HTMLMgInputTextElement => (\n <mg-input-text\n key=\"edition-input\"\n label={this.messages.panel.editLabel}\n label-hide\n value={this.panelTitle}\n onValue-change={this.handleUpdateTitle}\n characterLeftHide={true}\n pattern={this.titlePattern}\n pattern-error-message={this.titlePatternErrorMessage}\n identifier={`${this.identifier}-edition-input`}\n ref={(el: HTMLMgInputTextElement) => (this.editInputElement = el)}\n >\n <mg-button slot=\"append-input\" label={this.messages.general.cancel} is-icon variant=\"secondary\" onClick={this.handleCancelEditButton}>\n <mg-icon icon=\"cross\"></mg-icon>\n </mg-button>\n <mg-button slot=\"append-input\" label={this.messages.general.confirm} is-icon variant=\"secondary\" onClick={this.handleValidateEditButton}>\n <mg-icon icon=\"check\"></mg-icon>\n </mg-button>\n </mg-input-text>\n );\n\n /**\n * Render title\n * @returns title element\n */\n private renderTitle = (): HTMLElement[] => {\n const elementsToRender: HTMLElement[] = [this.renderCollapseButton()];\n if (this.titleEditable) {\n if (!this.isEditing) elementsToRender.push(this.renderEditButton());\n else elementsToRender.push(this.renderEditInput());\n }\n\n return this.titlePosition === 'right' ? elementsToRender.reverse() : elementsToRender;\n };\n\n /**\n * Render header children\n * @returns header child\n */\n private renderHeaderChildren = (): HTMLElement[] => {\n const children = [\n <div\n class={{ 'mg-c-panel__header-title': true, 'mg-c-panel__header-title--full': this.isEditing, 'mg-c-panel__header-title--reverse': this.titlePosition === 'right' }}\n key={this.panelTitle}\n >\n {this.renderTitle()}\n </div>,\n <div class=\"mg-c-panel__header-content\" key=\"slot-header\">\n <slot name=\"header-right\"></slot>\n </div>,\n ];\n return this.titlePosition === 'right' ? children.reverse() : children;\n };\n\n /**\n * Render component\n * @returns rendered component\n */\n render(): HTMLElement {\n const headerId = `${this.identifier}-header`;\n return (\n <section class={this.classCollection.join()} id={this.identifier}>\n <mg-card>\n <header class={{ 'mg-c-panel__header': true, 'mg-c-panel__header--reverse': this.titlePosition === 'right' }} id={headerId}>\n {this.renderHeaderChildren()}\n </header>\n <article class=\"mg-c-panel__content\" id={`${this.identifier}-content`} aria-labelledby={headerId} hidden={!this.expanded}>\n <slot></slot>\n </article>\n </mg-card>\n </section>\n );\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mg-popover-content.js","sourceRoot":"","sources":["../../../../../src/components/molecules/mg-popover/mg-popover-content/mg-popover-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAgB,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC9F,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD;;GAEG;AAMH,MAAM,OA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,CACtB;gBACN,6DAAM,IAAI,EAAC,SAAS,GAAQ,CACpB;YACV,6DAAM,IAAI,EAAC,OAAO,GAAQ,CACrB,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Host, h, Prop, EventEmitter, Event, State } from '@stencil/core';\nimport { isTagName, ClassList } from '@mgdis/core-ui-helpers/dist/utils';\nimport { initLocales } from '../../../../locales';\n\n/**\n * @internal\n */\n@Component({\n tag: 'mg-popover-content',\n styleUrl: '../../../../../node_modules/@mgdis/styles/dist/components/mg-popover-content.css',\n shadow: true,\n})\nexport class MgPopoverContent {\n /************\n * Internal *\n ************/\n\n // Locales\n private messages;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgPopoverContentElement;\n\n /**\n * Define if popover has a cross button\n */\n @Prop() closeButton = false;\n\n /**\n * Component classes\n */\n @State() classCollection: ClassList = new ClassList(['mg-c-popover-content']);\n\n /**\n * Emited event when close button is clicked\n */\n @Event({ eventName: 'hide-content' }) hideContent: EventEmitter<void>;\n\n /**\n * Handle action for close button\n */\n private handleCloseButton = (): void => {\n this.hideContent.emit();\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Check if component props are valide\n */\n componentWillLoad(): void {\n // Get locales\n this.messages = initLocales(this.element).messages;\n }\n\n /**\n * Check if component slots are valide\n */\n componentDidLoad(): void {\n const headingTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];\n\n const slottedTitleElement = this.element.querySelector('[slot=\"title\"]');\n if (slottedTitleElement && !isTagName(slottedTitleElement, headingTags)) {\n throw new Error(`<mg-popover> Slotted title must be a heading: ${headingTags.join(', ')}.`);\n }\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <Host>\n <mg-card class={this.classCollection.join()}>\n {this.closeButton && (\n <mg-button is-icon variant=\"flat\" label={this.messages.general.close} onClick={this.handleCloseButton}>\n <mg-icon icon=\"cross\"></mg-icon>\n </mg-button>\n )}\n <div class=\"mg-c-popover-content__title\">\n <slot name=\"title\"></slot>\n </div>\n <slot name=\"content\"></slot>\n </mg-card>\n <slot name=\"arrow\"></slot>\n </Host>\n );\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mg-popover.js","sourceRoot":"","sources":["../../../../src/components/molecules/mg-popover/mg-popover.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAgB,KAAK,EAAE,MAAM,eAAe,CAAC;AAC9F,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAC/F,OAAO,EAA8B,YAAY,EAAa,MAAM,gBAAgB,CAAC;AAErF;;;;GAIG;AAMH,MAAM,OAAO,SAAS;IALtB;QAyBE;;;WAGG;QACK,eAAU,GAAW,QAAQ,CAAC,YAAY,CAAC,CAAC;QAUpD;;WAEG;QACK,cAAS,GAAc,QAAQ,CAAC;QAExC;;WAEG;QACK,cAAS,GAAG,KAAK,CAAC;QAO1B;;WAEG;QACK,gBAAW,GAAG,KAAK,CAAC;QAM5B;;WAEG;QACsB,YAAO,GAAG,KAAK,CAAC;QAWzC;;WAEG;QACK,aAAQ,GAAG,KAAK,CAAC;QAYzB;;;WAGG;QACK,iBAAY,GAAG,CAAC,KAA2C,EAAQ,EAAE;YAC3E,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,2BAA2B,IAAI,CAAC,UAAU,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;gBAC3J,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;YACvB,CAAC;Q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G,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC;YAC7D,IAAI,IAAI,CAAC,OAAO,KAAK,IAAI,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,CAAC,YAAY,CAAC,qBAAqB,CAAC,KAAK,MAAM,EAAE,CAAC;gBACtG,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;YACvB,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,6BAA6B;QAC7B,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,CAAC,EAAE;YAC3C,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;gBAC1C,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;gBACrB,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC;gBAC3B,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,CAAC;YAClC,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC;IAED;;;OAGG;IACH,MAAM;QACJ,OAAO,CACL,EAAC,IAAI;YACH,8DAAa;YACb,6DAAM,IAAI,EAAC,SAAS,GAAQ,CACvB,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Host, h, Prop, Watch, EventEmitter, Event } from '@stencil/core';\nimport { createID, getWindows, isValideID, toString } from '@mgdis/core-ui-helpers/dist/utils';\nimport { Instance as PopperInstance, createPopper, Placement } from '@popperjs/core';\n\n/**\n * @slot - Element that will display the popover\n * @slot content - popover content\n * @slot title - popover title\n */\n@Component({\n tag: 'mg-popover',\n styleUrl: '../../../../node_modules/@mgdis/styles/dist/components/mg-popover.css',\n shadow: true,\n})\nexport class MgPopover {\n /************\n * Internal *\n ************/\n\n private popper: PopperInstance;\n private mgPopover: HTMLElement;\n private mgPopoverContent: HTMLMgPopoverContentElement;\n private windows: Window[];\n private interactiveElement: HTMLElement;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgPopoverElement;\n\n /**\n * Sets an `id` attribute.\n * Needed by the input for accessibility `aria-decribedby`.\n */\n @Prop() identifier: string = createID('mg-popover');\n @Watch('identifier')\n validateIdentifier(newValue: MgPopover['identifier']): void {\n if (!isValideID(newValue)) {\n throw new Error(`<mg-popover> prop \"identifier\" value is invalid. Passed value: ${toString(newValue)}.`);\n }\n // use renderPopoverContent to update popover-content id\n this.renderPopoverContent();\n }\n\n /**\n * Popover placement\n */\n @Prop() placement: Placement = 'bottom';\n\n /**\n * Hide popover arrow\n */\n @Prop() arrowHide = false;\n @Watch('arrowHide')\n validateArrowHide(newValue: MgPopover['arrowHide']): void {\n if (newValue) this.mgPopoverContent.dataset.arrowHide = '';\n else delete this.mgPopoverContent.dataset.arrowHide;\n }\n\n /**\n * Define if popover has a cross button\n */\n @Prop() closeButton = false;\n @Watch('closeButton')\n validateCloseButton(newValue: MgPopover['closeButton']): void {\n this.mgPopoverContent.closeButton = newValue;\n }\n\n /**\n * Display popover\n */\n @Prop({ mutable: true }) display = false;\n @Watch('display')\n handleDisplay(newValue: boolean): void {\n if (newValue) {\n this.show();\n } else {\n this.hide();\n }\n this.displayChange.emit(newValue);\n }\n\n /**\n * Disable popover\n */\n @Prop() disabled = false;\n\n /**\n * Emited event when display value change\n */\n @Event({ eventName: 'display-change' }) displayChange: EventEmitter<HTMLMgPopoverElement['display']>;\n\n /**\n * Emmited event when popover is closed\n */\n @Event({ eventName: 'component-close' }) componentClose: EventEmitter<void>;\n\n /**\n * Check if clicked outside of component\n * @param event - mouse event\n */\n private clickOutside = (event: MouseEvent & { target: HTMLElement }): void => {\n if (!this.disabled && event.target.closest('mg-popover') !== this.element && event.target.closest(`[data-mg-popover-guard=\"${this.identifier}\"]`) === null) {\n this.display = false;\n }\n };\n\n /**\n * Show popover\n */\n private show = (): void => {\n // Make the popover visible\n this.mgPopover.dataset.show = '';\n // Update aria-expanded\n this.interactiveElement.setAttribute('aria-expanded', 'true');\n // Enable the event listeners\n this.setPopperListeners(true);\n // hide when click outside\n // setTimeout is used to prevent event to trigger after creation\n setTimeout(() => {\n this.manageClickOutsideListeners('addEventListener');\n });\n };\n\n /**\n * Hide popover\n */\n private hide = (): void => {\n // Hide the popover\n this.mgPopover.removeAttribute('data-show');\n // Update aria-expanded\n this.interactiveElement.setAttribute('aria-expanded', 'false');\n // Disable the event listeners\n this.setPopperListeners(false);\n // Remove event listener\n this.manageClickOutsideListeners('removeEventListener');\n };\n\n /**\n * Set popper listeners\n * @param newValue - if true enable popper listners\n */\n private setPopperListeners = (newValue: boolean): void => {\n this.popper.setOptions(options => ({\n ...options,\n modifiers: [...options.modifiers, { name: 'eventListeners', enabled: newValue }],\n }));\n };\n\n /**\n * Manage all clickOustside listeners\n * @param action - top process on elements listeners\n */\n private manageClickOutsideListeners = (action: 'removeEventListener' | 'addEventListener'): void => {\n // clickOutside listeners need to bind windows\n // AND as shawdowDom content is not include on windows listeners `event.target` we need to include popover guard content DOM if it's a web-component\n // by doing this we can get and parse all needeed document DOM elements in clickOutside callback event.details.\n // This result in the givern junction :\n // Windows > document > [data-mg-popover-guard] + [data-mg-popover-guard] > shadowRoot = Windows > document > [data-mg-popover-guard] > shadowRoot\n const guardChildren = Array.from(document.querySelector(`[data-mg-popover-guard=\"${this.identifier}\"]`)?.shadowRoot?.children || new Set());\n [...guardChildren, ...this.windows].forEach((element: Window | HTMLElement) => {\n if (element !== null) {\n element[action]('click', this.clickOutside, false);\n }\n });\n };\n\n /**\n * Handle content hide event\n */\n private handleHideContent = (): void => {\n this.display = false;\n this.componentClose.emit();\n };\n\n /**\n * Render popover content element\n */\n private renderPopoverContent = (): void => {\n const mgPopoverContent = this.element.querySelector('mg-popover-content');\n if (mgPopoverContent === null) {\n this.mgPopoverContent = document.createElement('mg-popover-content');\n this.mgPopoverContent.setAttribute('slot', 'content');\n this.mgPopoverContent.setAttribute('id', this.identifier);\n this.mgPopoverContent.addEventListener('hide-content', this.handleHideContent);\n\n const arrow = document.createElement('div');\n arrow.setAttribute('slot', 'arrow');\n arrow.dataset.popperArrow = '';\n this.mgPopoverContent.appendChild(arrow);\n\n // insert elements in DOM\n ['[slot=\"title\"]', '[slot=\"content\"]:not(mg-popover-content)'].forEach(slotType => {\n Array.from(this.element.querySelectorAll(slotType)).forEach(slot => {\n this.mgPopoverContent.appendChild(slot);\n });\n });\n this.element.appendChild(this.mgPopoverContent);\n } else {\n mgPopoverContent.setAttribute('id', this.identifier);\n }\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * update popper position after props change on component did update hook to benefit from render ended\n */\n componentDidUpdate(): void {\n this.popper.update();\n }\n\n /**\n * Check if component props are well configured on init\n */\n componentWillLoad(): void {\n // Get windows to attach events\n this.windows = getWindows(window);\n // render mg-popover-content slot\n this.renderPopoverContent();\n this.validateCloseButton(this.closeButton);\n this.validateIdentifier(this.identifier);\n this.validateArrowHide(this.arrowHide);\n }\n\n /**\n * Check if component props are well configured on init\n */\n componentDidLoad(): void {\n // Get popover content\n this.mgPopover = this.element.querySelector(`#${this.identifier}`);\n\n //Get interactive element (first element without slot attribute)\n this.interactiveElement = this.element.querySelector(':not([slot])');\n // Add aria attributes\n this.interactiveElement.setAttribute('aria-controls', this.identifier);\n this.interactiveElement.setAttribute('aria-expanded', `${this.display}`);\n const fallbackPlacements = [];\n if (this.element.dataset.fallbackPlacement !== undefined) {\n fallbackPlacements.push(this.element.dataset.fallbackPlacement);\n }\n\n // Create popperjs popover\n this.popper = createPopper(this.interactiveElement, this.mgPopover, {\n placement: this.placement,\n strategy: 'fixed',\n modifiers: [\n {\n name: 'offset',\n options: {\n offset: [0, 0],\n },\n },\n {\n name: 'flip',\n options: {\n fallbackPlacements: [...fallbackPlacements, 'auto'],\n },\n },\n ],\n });\n\n // add resize observer\n [this.interactiveElement, this.element.querySelector('mg-popover-content')].forEach(element => {\n new ResizeObserver(() => {\n this.popper.update();\n }).observe(element);\n });\n\n // Add events to toggle display\n this.interactiveElement.addEventListener('click', () => {\n if (!this.disabled) this.display = !this.display;\n });\n\n this.element.addEventListener('click', (event: MouseEvent & { target: HTMLElement }): void => {\n const target = event.target.closest('[popovertargetaction]');\n if (this.display === true && target !== null && target.getAttribute('popovertargetaction') === 'hide') {\n this.display = false;\n }\n });\n\n // Add events to hide popover\n this.element.addEventListener('keydown', e => {\n if (!this.disabled && e.code === 'Escape') {\n this.display = false;\n this.componentClose.emit();\n this.interactiveElement.focus();\n }\n });\n\n this.handleDisplay(this.display);\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <Host>\n <slot></slot>\n <slot name=\"content\"></slot>\n </Host>\n );\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mg-progress.conf.js","sourceRoot":"","sources":["../../../../src/components/molecules/mg-progress/mg-progress.conf.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,aAAa,EAAE,OAAO,CAAU,CAAC","sourcesContent":["import { AriaRole } from '../../../types';\n\n/**\n * List of all possibles roles\n */\nexport const roles = ['progressbar', 'meter'] as const;\n\n/**\n * Aria Role type from roles\n */\nexport type AriaRoleType = AriaRole & (typeof roles)[number];\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mg-progress.js","sourceRoot":"","sources":["../../../../src/components/molecules/mg-progress/mg-progress.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KA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GAAG,EAAE;oBAC7F,4DACE,KAAK,EAAC,qBAAqB,EAC3B,KAAK,EAAE;4BACL,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG;yBACjF,GACI,CACH,CACF,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Host, Prop, Watch } from '@stencil/core';\nimport { isValidNumber, isValidString, toString } from '@mgdis/core-ui-helpers/dist/utils';\nimport { AriaRoleType, roles } from './mg-progress.conf';\n\n@Component({\n tag: 'mg-progress',\n styleUrl: '../../../../node_modules/@mgdis/styles/dist/components/mg-progress.css',\n shadow: true,\n})\nexport class MgProgress {\n /**************\n * Decorators *\n **************/\n\n /**\n * Define label\n */\n @Prop() label!: string;\n @Watch('label')\n watchLabel(newValue: MgProgress['label']): void {\n if (!isValidString(newValue)) {\n throw new Error(`<mg-progress> prop \"label\" must be a valid string. Passed value: ${toString(newValue)}.`);\n }\n }\n\n /**\n * Define progress role\n * - `progressbar` to indicate a progress, such as loading or percent completion of a task\n * - `meter` to indicate a graphical display of a numeric value that varies within a defined range\n */\n @Prop() ariaRole?: AriaRoleType = 'progressbar';\n @Watch('ariaRole')\n watchAriaRole(newValue: MgProgress['ariaRole']): void {\n if (newValue && !roles.includes(newValue)) {\n throw new Error(`<mg-progress> prop \"ariaRole\" must be one of: ${roles.join(', ')}. Passed value: ${toString(newValue)}.`);\n }\n }\n\n /**\n * Define current value\n * By default, it will be displayed as a percentage value.\n * If you don’t specify the min and max props, the value should be a number within the range of 0 to 100.\n */\n @Prop() value?: number = 0;\n @Watch('value')\n watchValue(newValue: MgProgress['value']): void {\n if (newValue !== undefined && (!isValidNumber(newValue) || !(newValue >= this.min && newValue <= this.max)))\n throw new Error(`<mg-progress> prop “value” must be a number within the range ${this.min} to ${this.max}. Passed value: ${toString(newValue)}.`);\n }\n\n /**\n * Define the minimum value in the range\n */\n @Prop() min?: number = 0;\n @Watch('min')\n watchMin(newValue: MgProgress['min']): void {\n if (newValue !== 0 && newValue !== undefined && (!isValidNumber(newValue) || newValue >= this.max))\n throw new Error(`<mg-progress> prop “min” must be a number lower than: ${this.max}. Passed value: ${toString(newValue)}.`);\n }\n\n /**\n * Define the maximum value in the range\n */\n @Prop() max?: number = 100;\n @Watch('max')\n watchMax(newValue: MgProgress['max']): void {\n if (newValue !== 100 && newValue !== undefined && (!isValidNumber(newValue) || newValue <= this.min))\n throw new Error(`<mg-progress> prop “max” must be a number greater than: ${this.min}. Passed value: ${toString(newValue)}.`);\n }\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Check if component props are well configured on init\n */\n componentWillLoad(): void {\n // validate props\n this.watchLabel(this.label);\n this.watchAriaRole(this.ariaRole);\n this.watchMin(this.min);\n this.watchMax(this.max);\n this.watchValue(this.value);\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <Host role={this.ariaRole} aria-label={this.label} aria-valuenow={this.value} aria-valuemin={this.min} aria-valuemax={this.max}>\n <div class=\"mg-c-progress\">\n <div class={{ 'mg-c-progress__bar': true, 'mg-c-progress__bar--active': this.value > this.min }}>\n <div\n class=\"mg-c-progress__fill\"\n style={{\n width: `${Math.round(((this.value - this.min) / (this.max - this.min)) * 100)}%`,\n }}\n ></div>\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mg-skip-links.conf.js","sourceRoot":"","sources":["../../../../src/components/molecules/mg-skip-links/mg-skip-links.conf.tsx"],"names":[],"mappings":"","sourcesContent":["/**\n * type SkipLink\n */\nexport type SkipLink = {\n href: string;\n label: string;\n};\n"]}