@mgdis/mg-components 5.19.3 → 5.21.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 (493) hide show
  1. package/dist/cjs/{components.utils-69435877.js → components.utils-cd908d4e.js} +102 -99
  2. package/dist/cjs/components.utils-cd908d4e.js.map +1 -0
  3. package/dist/cjs/{index-60dd0c56.js → index-8532b5e9.js} +185 -87
  4. package/dist/cjs/index-8532b5e9.js.map +1 -0
  5. package/dist/cjs/loader.cjs.js +2 -2
  6. package/dist/cjs/mg-action-more_34.cjs.entry.js +5140 -5107
  7. package/dist/cjs/mg-action-more_34.cjs.entry.js.map +1 -1
  8. package/dist/cjs/mg-components.cjs.js +3 -3
  9. package/dist/cjs/mg-components.cjs.js.map +1 -1
  10. package/dist/cjs/mg-item-more.cjs.entry.js +237 -222
  11. package/dist/cjs/mg-item-more.cjs.entry.js.map +1 -1
  12. package/dist/collection/assets/icons/index.js +193 -191
  13. package/dist/collection/assets/icons/index.js.map +1 -0
  14. package/dist/collection/collection-manifest.json +6 -6
  15. package/dist/collection/components/atoms/mg-badge/mg-badge.js +161 -161
  16. package/dist/collection/components/atoms/mg-badge/mg-badge.js.map +1 -1
  17. package/dist/collection/components/atoms/mg-button/mg-button.js +362 -362
  18. package/dist/collection/components/atoms/mg-button/mg-button.js.map +1 -1
  19. package/dist/collection/components/atoms/mg-card/mg-card.js +126 -126
  20. package/dist/collection/components/atoms/mg-card/mg-card.js.map +1 -1
  21. package/dist/collection/components/atoms/mg-character-left/mg-character-left.js +101 -101
  22. package/dist/collection/components/atoms/mg-character-left/mg-character-left.js.map +1 -1
  23. package/dist/collection/components/atoms/mg-divider/mg-divider.js +47 -47
  24. package/dist/collection/components/atoms/mg-divider/mg-divider.js.map +1 -1
  25. package/dist/collection/components/atoms/mg-icon/mg-icon.js +231 -231
  26. package/dist/collection/components/atoms/mg-icon/mg-icon.js.map +1 -1
  27. package/dist/collection/components/atoms/mg-input-title/mg-input-title.js +132 -132
  28. package/dist/collection/components/atoms/mg-input-title/mg-input-title.js.map +1 -1
  29. package/dist/collection/components/atoms/mg-tag/mg-tag.js +158 -158
  30. package/dist/collection/components/atoms/mg-tag/mg-tag.js.map +1 -1
  31. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.js +46 -46
  32. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.js.map +1 -1
  33. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.conf.js +3 -3
  34. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.conf.js.map +1 -1
  35. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +398 -398
  36. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js.map +1 -1
  37. package/dist/collection/components/molecules/inputs/MgInput.conf.js +2 -2
  38. package/dist/collection/components/molecules/inputs/MgInput.conf.js.map +1 -1
  39. package/dist/collection/components/molecules/inputs/MgInput.js +84 -84
  40. package/dist/collection/components/molecules/inputs/MgInput.js.map +1 -1
  41. package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js +8 -8
  42. package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js.map +1 -1
  43. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js +266 -266
  44. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js.map +1 -1
  45. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.js +4 -4
  46. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.js.map +1 -1
  47. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +788 -791
  48. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js.map +1 -1
  49. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.conf.js +4 -4
  50. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.conf.js.map +1 -1
  51. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +588 -578
  52. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js.map +1 -1
  53. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf.js +4 -4
  54. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf.js.map +1 -1
  55. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +778 -773
  56. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js.map +1 -1
  57. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +536 -526
  58. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js.map +1 -1
  59. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +565 -555
  60. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js.map +1 -1
  61. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +700 -695
  62. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js.map +1 -1
  63. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +770 -760
  64. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js.map +1 -1
  65. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +705 -695
  66. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js.map +1 -1
  67. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +527 -522
  68. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js.map +1 -1
  69. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.conf.js +2 -2
  70. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.conf.js.map +1 -1
  71. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js +263 -263
  72. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js.map +1 -1
  73. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.conf.js +6 -6
  74. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.conf.js.map +1 -1
  75. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js +423 -423
  76. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js.map +1 -1
  77. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +214 -214
  78. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js.map +1 -1
  79. package/dist/collection/components/molecules/mg-details/mg-details.js +155 -150
  80. package/dist/collection/components/molecules/mg-details/mg-details.js.map +1 -1
  81. package/dist/collection/components/molecules/mg-form/mg-form.conf.js +9 -0
  82. package/dist/collection/components/molecules/mg-form/mg-form.conf.js.map +1 -0
  83. package/dist/collection/components/molecules/mg-form/mg-form.js +405 -327
  84. package/dist/collection/components/molecules/mg-form/mg-form.js.map +1 -1
  85. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +85 -85
  86. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js.map +1 -1
  87. package/dist/collection/components/molecules/mg-item-more/mg-item-more.js +203 -188
  88. package/dist/collection/components/molecules/mg-item-more/mg-item-more.js.map +1 -1
  89. package/dist/collection/components/molecules/mg-message/mg-message.js +325 -304
  90. package/dist/collection/components/molecules/mg-message/mg-message.js.map +1 -1
  91. package/dist/collection/components/molecules/mg-modal/mg-modal.js +317 -317
  92. package/dist/collection/components/molecules/mg-modal/mg-modal.js.map +1 -1
  93. package/dist/collection/components/molecules/mg-pagination/mg-pagination.conf.js +2 -2
  94. package/dist/collection/components/molecules/mg-pagination/mg-pagination.conf.js.map +1 -1
  95. package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +216 -216
  96. package/dist/collection/components/molecules/mg-pagination/mg-pagination.js.map +1 -1
  97. package/dist/collection/components/molecules/mg-panel/mg-panel.js +409 -399
  98. package/dist/collection/components/molecules/mg-panel/mg-panel.js.map +1 -1
  99. package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js +91 -91
  100. package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js.map +1 -1
  101. package/dist/collection/components/molecules/mg-popover/mg-popover.js +336 -329
  102. package/dist/collection/components/molecules/mg-popover/mg-popover.js.map +1 -1
  103. package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +94 -94
  104. package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js.map +1 -1
  105. package/dist/collection/components/molecules/mg-tabs/mg-tabs.conf.js +4 -4
  106. package/dist/collection/components/molecules/mg-tabs/mg-tabs.conf.js.map +1 -1
  107. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +348 -343
  108. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js.map +1 -1
  109. package/dist/collection/locales/fr/messages.json +4 -4
  110. package/dist/collection/locales/index.spec.js +20 -20
  111. package/dist/collection/locales/index.spec.js.map +1 -1
  112. package/dist/collection/utils/behaviors.utils.js +127 -127
  113. package/dist/collection/utils/behaviors.utils.js.map +1 -1
  114. package/dist/collection/utils/behaviors.utils.spec.js +46 -42
  115. package/dist/collection/utils/behaviors.utils.spec.js.map +1 -1
  116. package/dist/collection/utils/components.utils.js +77 -75
  117. package/dist/collection/utils/components.utils.js.map +1 -1
  118. package/dist/collection/utils/components.utils.spec.js +150 -140
  119. package/dist/collection/utils/components.utils.spec.js.map +1 -1
  120. package/dist/collection/utils/e2e.test.utils.js +21 -21
  121. package/dist/collection/utils/e2e.test.utils.js.map +1 -1
  122. package/dist/collection/utils/locale.utils.js +17 -17
  123. package/dist/collection/utils/locale.utils.js.map +1 -1
  124. package/dist/collection/utils/locale.utils.spec.js +45 -45
  125. package/dist/collection/utils/locale.utils.spec.js.map +1 -1
  126. package/dist/collection/utils/playwright.e2e.test.utils.js +41 -41
  127. package/dist/collection/utils/playwright.e2e.test.utils.js.map +1 -1
  128. package/dist/collection/utils/playwright.fixture.js +24 -0
  129. package/dist/collection/utils/playwright.fixture.js.map +1 -0
  130. package/dist/collection/utils/unit.test.utils.js +50 -50
  131. package/dist/collection/utils/unit.test.utils.js.map +1 -1
  132. package/dist/components/MgInput.js +98 -98
  133. package/dist/components/MgInput.js.map +1 -1
  134. package/dist/components/components.utils.js +78 -76
  135. package/dist/components/components.utils.js.map +1 -1
  136. package/dist/components/index2.js +21 -21
  137. package/dist/components/index2.js.map +1 -1
  138. package/dist/components/mg-action-more.d.ts +2 -2
  139. package/dist/components/mg-action-more.js +173 -173
  140. package/dist/components/mg-action-more.js.map +1 -1
  141. package/dist/components/mg-badge.d.ts +2 -2
  142. package/dist/components/mg-badge2.js +83 -83
  143. package/dist/components/mg-badge2.js.map +1 -1
  144. package/dist/components/mg-button.d.ts +2 -2
  145. package/dist/components/mg-button2.js +182 -182
  146. package/dist/components/mg-button2.js.map +1 -1
  147. package/dist/components/mg-card.d.ts +2 -2
  148. package/dist/components/mg-card2.js +77 -77
  149. package/dist/components/mg-card2.js.map +1 -1
  150. package/dist/components/mg-character-left.d.ts +2 -2
  151. package/dist/components/mg-character-left2.js +50 -50
  152. package/dist/components/mg-character-left2.js.map +1 -1
  153. package/dist/components/mg-details.d.ts +2 -2
  154. package/dist/components/mg-details.js +69 -69
  155. package/dist/components/mg-details.js.map +1 -1
  156. package/dist/components/mg-divider.d.ts +2 -2
  157. package/dist/components/mg-divider.js +30 -30
  158. package/dist/components/mg-divider.js.map +1 -1
  159. package/dist/components/mg-form.d.ts +2 -2
  160. package/dist/components/mg-form.js +203 -171
  161. package/dist/components/mg-form.js.map +1 -1
  162. package/dist/components/mg-icon.d.ts +2 -2
  163. package/dist/components/mg-icon2.js +319 -317
  164. package/dist/components/mg-icon2.js.map +1 -1
  165. package/dist/components/mg-illustrated-message.d.ts +2 -2
  166. package/dist/components/mg-illustrated-message.js +51 -51
  167. package/dist/components/mg-illustrated-message.js.map +1 -1
  168. package/dist/components/mg-input-checkbox-paginated.d.ts +2 -2
  169. package/dist/components/mg-input-checkbox-paginated2.js +170 -170
  170. package/dist/components/mg-input-checkbox-paginated2.js.map +1 -1
  171. package/dist/components/mg-input-checkbox.d.ts +2 -2
  172. package/dist/components/mg-input-checkbox.js +477 -480
  173. package/dist/components/mg-input-checkbox.js.map +1 -1
  174. package/dist/components/mg-input-date.d.ts +2 -2
  175. package/dist/components/mg-input-date.js +265 -265
  176. package/dist/components/mg-input-date.js.map +1 -1
  177. package/dist/components/mg-input-numeric.d.ts +2 -2
  178. package/dist/components/mg-input-numeric.js +353 -353
  179. package/dist/components/mg-input-numeric.js.map +1 -1
  180. package/dist/components/mg-input-password.d.ts +2 -2
  181. package/dist/components/mg-input-password.js +204 -204
  182. package/dist/components/mg-input-password.js.map +1 -1
  183. package/dist/components/mg-input-radio.d.ts +2 -2
  184. package/dist/components/mg-input-radio.js +234 -234
  185. package/dist/components/mg-input-radio.js.map +1 -1
  186. package/dist/components/mg-input-select.d.ts +2 -2
  187. package/dist/components/mg-input-select2.js +315 -315
  188. package/dist/components/mg-input-select2.js.map +1 -1
  189. package/dist/components/mg-input-text.d.ts +2 -2
  190. package/dist/components/mg-input-text2.js +305 -305
  191. package/dist/components/mg-input-text2.js.map +1 -1
  192. package/dist/components/mg-input-textarea.d.ts +2 -2
  193. package/dist/components/mg-input-textarea.js +276 -276
  194. package/dist/components/mg-input-textarea.js.map +1 -1
  195. package/dist/components/mg-input-title.d.ts +2 -2
  196. package/dist/components/mg-input-title2.js +60 -60
  197. package/dist/components/mg-input-title2.js.map +1 -1
  198. package/dist/components/mg-input-toggle.d.ts +2 -2
  199. package/dist/components/mg-input-toggle.js +251 -251
  200. package/dist/components/mg-input-toggle.js.map +1 -1
  201. package/dist/components/mg-item-more.d.ts +2 -2
  202. package/dist/components/mg-item-more.js +298 -283
  203. package/dist/components/mg-item-more.js.map +1 -1
  204. package/dist/components/mg-menu-item.d.ts +2 -2
  205. package/dist/components/mg-menu-item2.js +345 -345
  206. package/dist/components/mg-menu-item2.js.map +1 -1
  207. package/dist/components/mg-menu.conf.js +2 -2
  208. package/dist/components/mg-menu.conf.js.map +1 -1
  209. package/dist/components/mg-menu.d.ts +2 -2
  210. package/dist/components/mg-menu2.js +176 -176
  211. package/dist/components/mg-menu2.js.map +1 -1
  212. package/dist/components/mg-message.d.ts +2 -2
  213. package/dist/components/mg-message.js +197 -192
  214. package/dist/components/mg-message.js.map +1 -1
  215. package/dist/components/mg-modal.d.ts +2 -2
  216. package/dist/components/mg-modal.js +198 -198
  217. package/dist/components/mg-modal.js.map +1 -1
  218. package/dist/components/mg-pagination.d.ts +2 -2
  219. package/dist/components/mg-pagination2.js +133 -133
  220. package/dist/components/mg-pagination2.js.map +1 -1
  221. package/dist/components/mg-panel.d.ts +2 -2
  222. package/dist/components/mg-panel.js +238 -238
  223. package/dist/components/mg-panel.js.map +1 -1
  224. package/dist/components/mg-popover-content.d.ts +2 -2
  225. package/dist/components/mg-popover-content2.js +69 -69
  226. package/dist/components/mg-popover-content2.js.map +1 -1
  227. package/dist/components/mg-popover.d.ts +2 -2
  228. package/dist/components/mg-popover2.js +224 -222
  229. package/dist/components/mg-popover2.js.map +1 -1
  230. package/dist/components/mg-skip-links.d.ts +2 -2
  231. package/dist/components/mg-skip-links.js +57 -57
  232. package/dist/components/mg-skip-links.js.map +1 -1
  233. package/dist/components/mg-tabs.d.ts +2 -2
  234. package/dist/components/mg-tabs.js +243 -243
  235. package/dist/components/mg-tabs.js.map +1 -1
  236. package/dist/components/mg-tag.d.ts +2 -2
  237. package/dist/components/mg-tag.js +97 -97
  238. package/dist/components/mg-tag.js.map +1 -1
  239. package/dist/components/mg-tooltip-content.d.ts +2 -2
  240. package/dist/components/mg-tooltip-content2.js +30 -30
  241. package/dist/components/mg-tooltip-content2.js.map +1 -1
  242. package/dist/components/mg-tooltip.d.ts +2 -2
  243. package/dist/components/mg-tooltip2.js +316 -316
  244. package/dist/components/mg-tooltip2.js.map +1 -1
  245. package/dist/esm/{components.utils-6cf27db1.js → components.utils-0d67c31c.js} +102 -100
  246. package/dist/esm/components.utils-0d67c31c.js.map +1 -0
  247. package/dist/esm/{index-0f833068.js → index-f34a3a2c.js} +185 -87
  248. package/dist/esm/index-f34a3a2c.js.map +1 -0
  249. package/dist/esm/loader.js +3 -3
  250. package/dist/esm/mg-action-more_34.entry.js +5140 -5107
  251. package/dist/esm/mg-action-more_34.entry.js.map +1 -1
  252. package/dist/esm/mg-components.js +4 -4
  253. package/dist/esm/mg-components.js.map +1 -1
  254. package/dist/esm/mg-item-more.entry.js +237 -222
  255. package/dist/esm/mg-item-more.entry.js.map +1 -1
  256. package/dist/mg-components/locales/fr/messages.json +4 -4
  257. package/dist/mg-components/mg-components.esm.js +1 -1
  258. package/dist/mg-components/mg-components.esm.js.map +1 -1
  259. package/dist/mg-components/p-7444ff40.js +3 -0
  260. package/dist/mg-components/p-7444ff40.js.map +1 -0
  261. package/dist/mg-components/p-af42d17b.js +2 -0
  262. package/dist/mg-components/p-af42d17b.js.map +1 -0
  263. package/dist/mg-components/p-ce356bc0.entry.js +2 -0
  264. package/dist/mg-components/p-ce356bc0.entry.js.map +1 -0
  265. package/dist/mg-components/p-e591ba8f.entry.js +2 -0
  266. package/dist/mg-components/p-e591ba8f.entry.js.map +1 -0
  267. package/dist/types/assets/icons/index.d.ts +193 -0
  268. package/dist/types/components/atoms/mg-badge/mg-badge.d.ts +41 -41
  269. package/dist/types/components/atoms/mg-button/mg-button.d.ts +100 -100
  270. package/dist/types/components/atoms/mg-card/mg-card.d.ts +39 -39
  271. package/dist/types/components/atoms/mg-character-left/mg-character-left.d.ts +37 -37
  272. package/dist/types/components/atoms/mg-divider/mg-divider.d.ts +12 -12
  273. package/dist/types/components/atoms/mg-icon/mg-icon.d.ts +56 -56
  274. package/dist/types/components/atoms/mg-input-title/mg-input-title.d.ts +34 -34
  275. package/dist/types/components/atoms/mg-tag/mg-tag.d.ts +51 -51
  276. package/dist/types/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.d.ts +12 -12
  277. package/dist/types/components/atoms/mg-tooltip/mg-tooltip.conf.d.ts +3 -3
  278. package/dist/types/components/atoms/mg-tooltip/mg-tooltip.d.ts +113 -113
  279. package/dist/types/components/molecules/inputs/MgInput.conf.d.ts +5 -5
  280. package/dist/types/components/molecules/inputs/MgInput.d.ts +16 -16
  281. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.d.ts +100 -100
  282. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.d.ts +26 -26
  283. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +262 -262
  284. package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.conf.d.ts +4 -4
  285. package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.d.ts +150 -150
  286. package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf.d.ts +4 -4
  287. package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +223 -223
  288. package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.d.ts +142 -142
  289. package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.conf.d.ts +3 -3
  290. package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +152 -152
  291. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.conf.d.ts +6 -6
  292. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +193 -193
  293. package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +195 -195
  294. package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +181 -181
  295. package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.conf.d.ts +2 -2
  296. package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +141 -141
  297. package/dist/types/components/molecules/menu/mg-menu/mg-menu.conf.d.ts +2 -2
  298. package/dist/types/components/molecules/menu/mg-menu/mg-menu.d.ts +97 -97
  299. package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.conf.d.ts +6 -6
  300. package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.d.ts +179 -179
  301. package/dist/types/components/molecules/mg-action-more/mg-action-more.conf.d.ts +12 -12
  302. package/dist/types/components/molecules/mg-action-more/mg-action-more.d.ts +72 -72
  303. package/dist/types/components/molecules/mg-details/mg-details.d.ts +45 -45
  304. package/dist/types/components/molecules/mg-form/mg-form.conf.d.ts +16 -0
  305. package/dist/types/components/molecules/mg-form/mg-form.d.ts +120 -103
  306. package/dist/types/components/molecules/mg-illustrated-message/mg-illustrated-message.d.ts +27 -27
  307. package/dist/types/components/molecules/mg-item-more/mg-item-more.conf.d.ts +5 -5
  308. package/dist/types/components/molecules/mg-item-more/mg-item-more.d.ts +67 -61
  309. package/dist/types/components/molecules/mg-message/mg-message.d.ts +100 -93
  310. package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +107 -107
  311. package/dist/types/components/molecules/mg-pagination/mg-pagination.conf.d.ts +2 -2
  312. package/dist/types/components/molecules/mg-pagination/mg-pagination.d.ts +74 -74
  313. package/dist/types/components/molecules/mg-panel/mg-panel.d.ts +149 -149
  314. package/dist/types/components/molecules/mg-popover/mg-popover-content/mg-popover-content.d.ts +43 -43
  315. package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +88 -88
  316. package/dist/types/components/molecules/mg-skip-links/mg-skip-links.conf.d.ts +2 -2
  317. package/dist/types/components/molecules/mg-skip-links/mg-skip-links.d.ts +40 -40
  318. package/dist/types/components/molecules/mg-tabs/mg-tabs.conf.d.ts +10 -10
  319. package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +118 -118
  320. package/dist/types/components.d.ts +312 -30
  321. package/dist/types/locales/index.d.ts +172 -172
  322. package/dist/types/stencil-public-runtime.d.ts +29 -0
  323. package/dist/types/utils/behaviors.utils.d.ts +65 -65
  324. package/dist/types/utils/components.utils.d.ts +32 -26
  325. package/dist/types/utils/locale.utils.d.ts +2 -2
  326. package/dist/types/utils/playwright.fixture.d.ts +3 -0
  327. package/dist/types/utils/unit.test.utils.d.ts +5 -5
  328. package/package.json +19 -33
  329. package/dist/cjs/components.utils-69435877.js.map +0 -1
  330. package/dist/cjs/index-60dd0c56.js.map +0 -1
  331. package/dist/collection/components/atoms/mg-badge/test/mg-badge.e2e.playwright.js +0 -33
  332. package/dist/collection/components/atoms/mg-badge/test/mg-badge.e2e.playwright.js.map +0 -1
  333. package/dist/collection/components/atoms/mg-badge/test/mg-badge.spec.js +0 -70
  334. package/dist/collection/components/atoms/mg-badge/test/mg-badge.spec.js.map +0 -1
  335. package/dist/collection/components/atoms/mg-button/test/mg-button.e2e.js +0 -91
  336. package/dist/collection/components/atoms/mg-button/test/mg-button.e2e.js.map +0 -1
  337. package/dist/collection/components/atoms/mg-button/test/mg-button.spec.js +0 -192
  338. package/dist/collection/components/atoms/mg-button/test/mg-button.spec.js.map +0 -1
  339. package/dist/collection/components/atoms/mg-card/test/mg-card.e2e.js +0 -36
  340. package/dist/collection/components/atoms/mg-card/test/mg-card.e2e.js.map +0 -1
  341. package/dist/collection/components/atoms/mg-card/test/mg-card.spec.js +0 -43
  342. package/dist/collection/components/atoms/mg-card/test/mg-card.spec.js.map +0 -1
  343. package/dist/collection/components/atoms/mg-character-left/test/mg-character-left.e2e.js +0 -15
  344. package/dist/collection/components/atoms/mg-character-left/test/mg-character-left.e2e.js.map +0 -1
  345. package/dist/collection/components/atoms/mg-character-left/test/mg-character-left.spec.js +0 -42
  346. package/dist/collection/components/atoms/mg-character-left/test/mg-character-left.spec.js.map +0 -1
  347. package/dist/collection/components/atoms/mg-divider/test/mg-divider.e2e.js +0 -11
  348. package/dist/collection/components/atoms/mg-divider/test/mg-divider.e2e.js.map +0 -1
  349. package/dist/collection/components/atoms/mg-divider/test/mg-divider.spec.js +0 -14
  350. package/dist/collection/components/atoms/mg-divider/test/mg-divider.spec.js.map +0 -1
  351. package/dist/collection/components/atoms/mg-icon/test/mg-icon.e2e.js +0 -55
  352. package/dist/collection/components/atoms/mg-icon/test/mg-icon.e2e.js.map +0 -1
  353. package/dist/collection/components/atoms/mg-icon/test/mg-icon.spec.js +0 -84
  354. package/dist/collection/components/atoms/mg-icon/test/mg-icon.spec.js.map +0 -1
  355. package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.e2e.playwright.js +0 -12
  356. package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.e2e.playwright.js.map +0 -1
  357. package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.spec.js +0 -23
  358. package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.spec.js.map +0 -1
  359. package/dist/collection/components/atoms/mg-tag/test/mg-tag.e2e.playwright.js +0 -23
  360. package/dist/collection/components/atoms/mg-tag/test/mg-tag.e2e.playwright.js.map +0 -1
  361. package/dist/collection/components/atoms/mg-tag/test/mg-tag.spec.js +0 -71
  362. package/dist/collection/components/atoms/mg-tag/test/mg-tag.spec.js.map +0 -1
  363. package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.e2e.js +0 -138
  364. package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.e2e.js.map +0 -1
  365. package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.spec.js +0 -272
  366. package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.spec.js.map +0 -1
  367. package/dist/collection/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.e2e.playwright.js +0 -237
  368. package/dist/collection/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.e2e.playwright.js.map +0 -1
  369. package/dist/collection/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.spec.js +0 -634
  370. package/dist/collection/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.spec.js.map +0 -1
  371. package/dist/collection/components/molecules/inputs/mg-input-date/test/mg-input-date.e2e.js +0 -123
  372. package/dist/collection/components/molecules/inputs/mg-input-date/test/mg-input-date.e2e.js.map +0 -1
  373. package/dist/collection/components/molecules/inputs/mg-input-date/test/mg-input-date.spec.js +0 -383
  374. package/dist/collection/components/molecules/inputs/mg-input-date/test/mg-input-date.spec.js.map +0 -1
  375. package/dist/collection/components/molecules/inputs/mg-input-numeric/test/mg-input-numeric.e2e.js +0 -212
  376. package/dist/collection/components/molecules/inputs/mg-input-numeric/test/mg-input-numeric.e2e.js.map +0 -1
  377. package/dist/collection/components/molecules/inputs/mg-input-numeric/test/mg-input-numeric.spec.js +0 -460
  378. package/dist/collection/components/molecules/inputs/mg-input-numeric/test/mg-input-numeric.spec.js.map +0 -1
  379. package/dist/collection/components/molecules/inputs/mg-input-password/test/mg-input-password.e2e.js +0 -115
  380. package/dist/collection/components/molecules/inputs/mg-input-password/test/mg-input-password.e2e.js.map +0 -1
  381. package/dist/collection/components/molecules/inputs/mg-input-password/test/mg-input-password.spec.js +0 -293
  382. package/dist/collection/components/molecules/inputs/mg-input-password/test/mg-input-password.spec.js.map +0 -1
  383. package/dist/collection/components/molecules/inputs/mg-input-radio/test/mg-input-radio.e2e.js +0 -154
  384. package/dist/collection/components/molecules/inputs/mg-input-radio/test/mg-input-radio.e2e.js.map +0 -1
  385. package/dist/collection/components/molecules/inputs/mg-input-radio/test/mg-input-radio.spec.js +0 -359
  386. package/dist/collection/components/molecules/inputs/mg-input-radio/test/mg-input-radio.spec.js.map +0 -1
  387. package/dist/collection/components/molecules/inputs/mg-input-select/test/mg-input-select.e2e.js +0 -194
  388. package/dist/collection/components/molecules/inputs/mg-input-select/test/mg-input-select.e2e.js.map +0 -1
  389. package/dist/collection/components/molecules/inputs/mg-input-select/test/mg-input-select.spec.js +0 -403
  390. package/dist/collection/components/molecules/inputs/mg-input-select/test/mg-input-select.spec.js.map +0 -1
  391. package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.e2e.playwright.js +0 -147
  392. package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.e2e.playwright.js.map +0 -1
  393. package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.spec.js +0 -355
  394. package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.spec.js.map +0 -1
  395. package/dist/collection/components/molecules/inputs/mg-input-textarea/test/mg-input-textarea.e2e.js +0 -129
  396. package/dist/collection/components/molecules/inputs/mg-input-textarea/test/mg-input-textarea.e2e.js.map +0 -1
  397. package/dist/collection/components/molecules/inputs/mg-input-textarea/test/mg-input-textarea.spec.js +0 -320
  398. package/dist/collection/components/molecules/inputs/mg-input-textarea/test/mg-input-textarea.spec.js.map +0 -1
  399. package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.e2e.playwright.js +0 -108
  400. package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.e2e.playwright.js.map +0 -1
  401. package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.spec.js +0 -247
  402. package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.spec.js.map +0 -1
  403. package/dist/collection/components/molecules/menu/mg-menu/test/mg-menu.e2e.playwright.js +0 -239
  404. package/dist/collection/components/molecules/menu/mg-menu/test/mg-menu.e2e.playwright.js.map +0 -1
  405. package/dist/collection/components/molecules/menu/mg-menu/test/mg-menu.spec.js +0 -175
  406. package/dist/collection/components/molecules/menu/mg-menu/test/mg-menu.spec.js.map +0 -1
  407. package/dist/collection/components/molecules/menu/mg-menu-item/test/mg-menu-item.e2e.playwright.js +0 -100
  408. package/dist/collection/components/molecules/menu/mg-menu-item/test/mg-menu-item.e2e.playwright.js.map +0 -1
  409. package/dist/collection/components/molecules/menu/mg-menu-item/test/mg-menu-item.spec.js +0 -295
  410. package/dist/collection/components/molecules/menu/mg-menu-item/test/mg-menu-item.spec.js.map +0 -1
  411. package/dist/collection/components/molecules/mg-action-more/test/mg-action-more.e2e.playwright.js +0 -136
  412. package/dist/collection/components/molecules/mg-action-more/test/mg-action-more.e2e.playwright.js.map +0 -1
  413. package/dist/collection/components/molecules/mg-action-more/test/mg-action-more.spec.js +0 -195
  414. package/dist/collection/components/molecules/mg-action-more/test/mg-action-more.spec.js.map +0 -1
  415. package/dist/collection/components/molecules/mg-details/test/mg-details.e2e.playwright.js +0 -30
  416. package/dist/collection/components/molecules/mg-details/test/mg-details.e2e.playwright.js.map +0 -1
  417. package/dist/collection/components/molecules/mg-details/test/mg-details.spec.js +0 -42
  418. package/dist/collection/components/molecules/mg-details/test/mg-details.spec.js.map +0 -1
  419. package/dist/collection/components/molecules/mg-form/test/mg-form.e2e.js +0 -169
  420. package/dist/collection/components/molecules/mg-form/test/mg-form.e2e.js.map +0 -1
  421. package/dist/collection/components/molecules/mg-form/test/mg-form.spec.js +0 -292
  422. package/dist/collection/components/molecules/mg-form/test/mg-form.spec.js.map +0 -1
  423. package/dist/collection/components/molecules/mg-illustrated-message/test/mg-illustrated-message.e2e.js +0 -39
  424. package/dist/collection/components/molecules/mg-illustrated-message/test/mg-illustrated-message.e2e.js.map +0 -1
  425. package/dist/collection/components/molecules/mg-illustrated-message/test/mg-illustrated-message.spec.js +0 -36
  426. package/dist/collection/components/molecules/mg-illustrated-message/test/mg-illustrated-message.spec.js.map +0 -1
  427. package/dist/collection/components/molecules/mg-item-more/test/mg-item-more.e2e.playwright.js +0 -85
  428. package/dist/collection/components/molecules/mg-item-more/test/mg-item-more.e2e.playwright.js.map +0 -1
  429. package/dist/collection/components/molecules/mg-item-more/test/mg-item-more.spec.js +0 -106
  430. package/dist/collection/components/molecules/mg-item-more/test/mg-item-more.spec.js.map +0 -1
  431. package/dist/collection/components/molecules/mg-message/test/mg-message.e2e.js +0 -64
  432. package/dist/collection/components/molecules/mg-message/test/mg-message.e2e.js.map +0 -1
  433. package/dist/collection/components/molecules/mg-message/test/mg-message.spec.js +0 -109
  434. package/dist/collection/components/molecules/mg-message/test/mg-message.spec.js.map +0 -1
  435. package/dist/collection/components/molecules/mg-modal/test/mg-modal.e2e.playwright.js +0 -62
  436. package/dist/collection/components/molecules/mg-modal/test/mg-modal.e2e.playwright.js.map +0 -1
  437. package/dist/collection/components/molecules/mg-modal/test/mg-modal.e2e.template.js +0 -40
  438. package/dist/collection/components/molecules/mg-modal/test/mg-modal.e2e.template.js.map +0 -1
  439. package/dist/collection/components/molecules/mg-modal/test/mg-modal.firefox.e2e.playwright.js +0 -26
  440. package/dist/collection/components/molecules/mg-modal/test/mg-modal.firefox.e2e.playwright.js.map +0 -1
  441. package/dist/collection/components/molecules/mg-modal/test/mg-modal.spec.js +0 -122
  442. package/dist/collection/components/molecules/mg-modal/test/mg-modal.spec.js.map +0 -1
  443. package/dist/collection/components/molecules/mg-pagination/test/mg-pagination.e2e.playwright.js +0 -57
  444. package/dist/collection/components/molecules/mg-pagination/test/mg-pagination.e2e.playwright.js.map +0 -1
  445. package/dist/collection/components/molecules/mg-pagination/test/mg-pagination.spec.js +0 -121
  446. package/dist/collection/components/molecules/mg-pagination/test/mg-pagination.spec.js.map +0 -1
  447. package/dist/collection/components/molecules/mg-panel/test/mg-panel.e2e.playwright.js +0 -106
  448. package/dist/collection/components/molecules/mg-panel/test/mg-panel.e2e.playwright.js.map +0 -1
  449. package/dist/collection/components/molecules/mg-panel/test/mg-panel.spec.js +0 -213
  450. package/dist/collection/components/molecules/mg-panel/test/mg-panel.spec.js.map +0 -1
  451. package/dist/collection/components/molecules/mg-popover/test/mg-popover.e2e.playwright.js +0 -140
  452. package/dist/collection/components/molecules/mg-popover/test/mg-popover.e2e.playwright.js.map +0 -1
  453. package/dist/collection/components/molecules/mg-popover/test/mg-popover.spec.js +0 -142
  454. package/dist/collection/components/molecules/mg-popover/test/mg-popover.spec.js.map +0 -1
  455. package/dist/collection/components/molecules/mg-skip-links/test/mg-skip-links.e2e.js +0 -55
  456. package/dist/collection/components/molecules/mg-skip-links/test/mg-skip-links.e2e.js.map +0 -1
  457. package/dist/collection/components/molecules/mg-skip-links/test/mg-skip-links.spec.js +0 -55
  458. package/dist/collection/components/molecules/mg-skip-links/test/mg-skip-links.spec.js.map +0 -1
  459. package/dist/collection/components/molecules/mg-tabs/test/mg-tabs.e2e.playwright.js +0 -76
  460. package/dist/collection/components/molecules/mg-tabs/test/mg-tabs.e2e.playwright.js.map +0 -1
  461. package/dist/collection/components/molecules/mg-tabs/test/mg-tabs.spec.js +0 -332
  462. package/dist/collection/components/molecules/mg-tabs/test/mg-tabs.spec.js.map +0 -1
  463. package/dist/collection/utils/stencil.e2e.test.utils.js +0 -33
  464. package/dist/collection/utils/stencil.e2e.test.utils.js.map +0 -1
  465. package/dist/esm/components.utils-6cf27db1.js.map +0 -1
  466. package/dist/esm/index-0f833068.js.map +0 -1
  467. package/dist/mg-components/p-10ed4425.entry.js +0 -2
  468. package/dist/mg-components/p-10ed4425.entry.js.map +0 -1
  469. package/dist/mg-components/p-36a51c5e.js +0 -2
  470. package/dist/mg-components/p-36a51c5e.js.map +0 -1
  471. package/dist/mg-components/p-91feda5a.entry.js +0 -2
  472. package/dist/mg-components/p-91feda5a.entry.js.map +0 -1
  473. package/dist/mg-components/p-9b12021b.js +0 -3
  474. package/dist/mg-components/p-9b12021b.js.map +0 -1
  475. package/dist/types/components/atoms/mg-badge/test/mg-badge.e2e.playwright.d.ts +0 -1
  476. package/dist/types/components/atoms/mg-input-title/test/mg-input-title.e2e.playwright.d.ts +0 -1
  477. package/dist/types/components/atoms/mg-tag/test/mg-tag.e2e.playwright.d.ts +0 -1
  478. package/dist/types/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.e2e.playwright.d.ts +0 -1
  479. package/dist/types/components/molecules/inputs/mg-input-text/test/mg-input-text.e2e.playwright.d.ts +0 -1
  480. package/dist/types/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.e2e.playwright.d.ts +0 -1
  481. package/dist/types/components/molecules/menu/mg-menu/test/mg-menu.e2e.playwright.d.ts +0 -1
  482. package/dist/types/components/molecules/menu/mg-menu-item/test/mg-menu-item.e2e.playwright.d.ts +0 -1
  483. package/dist/types/components/molecules/mg-action-more/test/mg-action-more.e2e.playwright.d.ts +0 -2
  484. package/dist/types/components/molecules/mg-details/test/mg-details.e2e.playwright.d.ts +0 -1
  485. package/dist/types/components/molecules/mg-item-more/test/mg-item-more.e2e.playwright.d.ts +0 -1
  486. package/dist/types/components/molecules/mg-modal/test/mg-modal.e2e.playwright.d.ts +0 -1
  487. package/dist/types/components/molecules/mg-modal/test/mg-modal.e2e.template.d.ts +0 -12
  488. package/dist/types/components/molecules/mg-modal/test/mg-modal.firefox.e2e.playwright.d.ts +0 -1
  489. package/dist/types/components/molecules/mg-pagination/test/mg-pagination.e2e.playwright.d.ts +0 -1
  490. package/dist/types/components/molecules/mg-panel/test/mg-panel.e2e.playwright.d.ts +0 -1
  491. package/dist/types/components/molecules/mg-popover/test/mg-popover.e2e.playwright.d.ts +0 -1
  492. package/dist/types/components/molecules/mg-tabs/test/mg-tabs.e2e.playwright.d.ts +0 -1
  493. package/dist/types/utils/stencil.e2e.test.utils.d.ts +0 -14
@@ -10,8 +10,8 @@ import { d as defineCustomElement$1 } from './mg-tooltip-content2.js';
10
10
 
11
11
  var NavigationAction;
12
12
  (function (NavigationAction) {
13
- NavigationAction["NEXT"] = "next";
14
- NavigationAction["PREVIOUS"] = "previous";
13
+ NavigationAction["NEXT"] = "next";
14
+ NavigationAction["PREVIOUS"] = "previous";
15
15
  })(NavigationAction || (NavigationAction = {}));
16
16
 
17
17
  const mgPaginationCss = ".mg-u-visually-hidden{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip:rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;clip-path:inset(50%) !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){*{animation:none !important;transition:none !important}}.mg-c-pagination{display:flex;flex-direction:row;align-items:center}.mg-c-pagination mg-input-select{margin-right:.5rem}.mg-c-pagination mg-button{display:flex}.mg-c-pagination mg-button:first-of-type{margin-right:1rem}.mg-c-pagination mg-button:last-of-type{margin-left:1rem}.mg-c-pagination.mg-c-pagination--hide-page-count mg-button{margin:0}";
@@ -39,144 +39,144 @@ const mgPaginationCss = ".mg-u-visually-hidden{position:absolute !important;over
39
39
  */
40
40
  const range = (start, end, step = 1) => Array.from(Array(Math.ceil((end + 1 - start) / step)).keys()).map(x => start + x * step);
41
41
  const MgPagination = /*@__PURE__*/ proxyCustomElement(class MgPagination extends HTMLElement {
42
- constructor() {
43
- super();
44
- this.__registerHost();
45
- this.__attachShadow();
46
- this.currentPageChange = createEvent(this, "current-page-change", 7);
47
- /**
48
- * Change current page from target
49
- * @param target - target page
50
- */
51
- this.goToPage = (target) => {
52
- this.currentPage = target;
53
- };
54
- /************
55
- * Handlers *
56
- ************/
42
+ constructor() {
43
+ super();
44
+ this.__registerHost();
45
+ this.__attachShadow();
46
+ this.currentPageChange = createEvent(this, "current-page-change", 7);
47
+ /**
48
+ * Change current page from target
49
+ * @param target - target page
50
+ */
51
+ this.goToPage = (target) => {
52
+ this.currentPage = target;
53
+ };
54
+ /************
55
+ * Handlers *
56
+ ************/
57
+ /**
58
+ * select handler
59
+ * @param event - value change event
60
+ */
61
+ this.handleSelect = (event) => {
62
+ const to = Number(event.target.value);
63
+ this.goToPage(to > 0 ? to : 1);
64
+ };
65
+ /**
66
+ * Go to 'previous/next' page button handler
67
+ * @param action - navigation action
68
+ * @param disabled - button disable state
69
+ */
70
+ this.handleGoToPage = (action, disabled) => {
71
+ !disabled && this.goToPage(action === NavigationAction.NEXT ? this.currentPage + 1 : this.currentPage - 1);
72
+ };
73
+ this.identifier = createID('mg-pagination');
74
+ this.label = undefined;
75
+ this.hideNavigationLabels = undefined;
76
+ this.hidePageCount = undefined;
77
+ this.totalPages = 1;
78
+ this.currentPage = 1;
79
+ }
80
+ validateTotalPages(newValue) {
81
+ if (newValue < 1) {
82
+ throw new Error('<mg-pagination> prop "totalPages" must be greater than 0');
83
+ }
84
+ }
85
+ validateCurrentPage(newValue) {
86
+ if (newValue < 1) {
87
+ throw new Error('<mg-pagination> prop "currentPage" must be greater than 0');
88
+ }
89
+ else if (newValue > this.totalPages) {
90
+ throw new Error('<mg-pagination> prop "currentPage" can not be greater than total page');
91
+ }
92
+ this.currentPageChange.emit(newValue);
93
+ }
94
+ /*************
95
+ * Lifecycle *
96
+ *************/
57
97
  /**
58
- * select handler
59
- * @param event - value change event
98
+ * Check if props are well configured on init
60
99
  */
61
- this.handleSelect = (event) => {
62
- const to = Number(event.target.value);
63
- this.goToPage(to > 0 ? to : 1);
64
- };
100
+ componentWillLoad() {
101
+ // Get locales
102
+ this.messages = initLocales(this.element).messages;
103
+ // Validate
104
+ this.validateTotalPages(this.totalPages);
105
+ this.validateCurrentPage(this.currentPage);
106
+ // Set default label
107
+ if (this.label === undefined || this.label === '') {
108
+ this.label = this.messages.pagination.label;
109
+ }
110
+ }
65
111
  /**
66
- * Go to 'previous/next' page button handler
67
- * @param action - navigation action
68
- * @param disabled - button disable state
112
+ * Render
113
+ * @returns HTML Element
69
114
  */
70
- this.handleGoToPage = (action, disabled) => {
71
- !disabled && this.goToPage(action === NavigationAction.NEXT ? this.currentPage + 1 : this.currentPage - 1);
72
- };
73
- this.identifier = createID('mg-pagination');
74
- this.label = undefined;
75
- this.hideNavigationLabels = undefined;
76
- this.hidePageCount = undefined;
77
- this.totalPages = 1;
78
- this.currentPage = 1;
79
- }
80
- validateTotalPages(newValue) {
81
- if (newValue < 1) {
82
- throw new Error('<mg-pagination> prop "totalPages" must be greater than 0');
83
- }
84
- }
85
- validateCurrentPage(newValue) {
86
- if (newValue < 1) {
87
- throw new Error('<mg-pagination> prop "currentPage" must be greater than 0');
88
- }
89
- else if (newValue > this.totalPages) {
90
- throw new Error('<mg-pagination> prop "currentPage" can not be greater than total page');
115
+ render() {
116
+ const navigationActionButton = (disabled, action) => (h("mg-button", { identifier: `${this.identifier}-button-${action}`, label: this.messages.pagination[`${action}Page`],
117
+ // eslint-disable-next-line react/jsx-no-bind
118
+ onClick: () => this.handleGoToPage(action, disabled), disabled: disabled, variant: "flat", isIcon: this.hideNavigationLabels }, action === NavigationAction.PREVIOUS && h("mg-icon", { icon: "chevron-left" }), !this.hideNavigationLabels && this.messages.general[action], action === NavigationAction.NEXT && h("mg-icon", { icon: "chevron-right" })));
119
+ return (h(Host, { hidden: this.totalPages < 2 }, h("nav", { role: "navigation", "aria-label": this.label, id: this.identifier, class: { 'mg-c-pagination': true, 'mg-c-pagination--hide-page-count': this.hidePageCount } }, navigationActionButton(this.currentPage <= 1, NavigationAction.PREVIOUS), !this.hidePageCount && (h("mg-input-select", { identifier: `${this.identifier}-select`, items: range(1, this.totalPages).map(page => page.toString()), label: this.messages.pagination.selectPage, "label-hide": true, "on-value-change": this.handleSelect, value: this.currentPage.toString(), "placeholder-hide": true })), h("span", { class: "mg-u-visually-hidden" }, this.messages.pagination.page, " ", this.currentPage), h("span", { class: { 'mg-u-visually-hidden': this.hidePageCount } }, "/ ", this.totalPages, " ", this.totalPages > 1 ? this.messages.pagination.pages : this.messages.pagination.page), navigationActionButton(this.currentPage >= this.totalPages, NavigationAction.NEXT))));
91
120
  }
92
- this.currentPageChange.emit(newValue);
93
- }
94
- /*************
95
- * Lifecycle *
96
- *************/
97
- /**
98
- * Check if props are well configured on init
99
- */
100
- componentWillLoad() {
101
- // Get locales
102
- this.messages = initLocales(this.element).messages;
103
- // Validate
104
- this.validateTotalPages(this.totalPages);
105
- this.validateCurrentPage(this.currentPage);
106
- // Set default label
107
- if (this.label === undefined || this.label === '') {
108
- this.label = this.messages.pagination.label;
109
- }
110
- }
111
- /**
112
- * Render
113
- * @returns HTML Element
114
- */
115
- render() {
116
- const navigationActionButton = (disabled, action) => (h("mg-button", { identifier: `${this.identifier}-button-${action}`, label: this.messages.pagination[`${action}Page`],
117
- // eslint-disable-next-line react/jsx-no-bind
118
- onClick: () => this.handleGoToPage(action, disabled), disabled: disabled, variant: "flat", isIcon: this.hideNavigationLabels }, action === NavigationAction.PREVIOUS && h("mg-icon", { icon: "chevron-left" }), !this.hideNavigationLabels && this.messages.general[action], action === NavigationAction.NEXT && h("mg-icon", { icon: "chevron-right" })));
119
- return (h(Host, { hidden: this.totalPages < 2 }, h("nav", { role: "navigation", "aria-label": this.label, id: this.identifier, class: { 'mg-c-pagination': true, 'mg-c-pagination--hide-page-count': this.hidePageCount } }, navigationActionButton(this.currentPage <= 1, NavigationAction.PREVIOUS), !this.hidePageCount && (h("mg-input-select", { identifier: `${this.identifier}-select`, items: range(1, this.totalPages).map(page => page.toString()), label: this.messages.pagination.selectPage, "label-hide": true, "on-value-change": this.handleSelect, value: this.currentPage.toString(), "placeholder-hide": true })), h("span", { class: "mg-u-visually-hidden" }, this.messages.pagination.page, " ", this.currentPage), h("span", { class: { 'mg-u-visually-hidden': this.hidePageCount } }, "/ ", this.totalPages, " ", this.totalPages > 1 ? this.messages.pagination.pages : this.messages.pagination.page), navigationActionButton(this.currentPage >= this.totalPages, NavigationAction.NEXT))));
120
- }
121
- get element() { return this; }
122
- static get watchers() { return {
123
- "totalPages": ["validateTotalPages"],
124
- "currentPage": ["validateCurrentPage"]
125
- }; }
126
- static get style() { return mgPaginationCss; }
121
+ get element() { return this; }
122
+ static get watchers() { return {
123
+ "totalPages": ["validateTotalPages"],
124
+ "currentPage": ["validateCurrentPage"]
125
+ }; }
126
+ static get style() { return mgPaginationCss; }
127
127
  }, [1, "mg-pagination", {
128
- "identifier": [1],
129
- "label": [1025],
130
- "hideNavigationLabels": [4, "hide-navigation-labels"],
131
- "hidePageCount": [4, "hide-page-count"],
132
- "totalPages": [2, "total-pages"],
133
- "currentPage": [1538, "current-page"]
134
- }, undefined, {
135
- "totalPages": ["validateTotalPages"],
136
- "currentPage": ["validateCurrentPage"]
137
- }]);
128
+ "identifier": [1],
129
+ "label": [1025],
130
+ "hideNavigationLabels": [4, "hide-navigation-labels"],
131
+ "hidePageCount": [4, "hide-page-count"],
132
+ "totalPages": [2, "total-pages"],
133
+ "currentPage": [1538, "current-page"]
134
+ }, undefined, {
135
+ "totalPages": ["validateTotalPages"],
136
+ "currentPage": ["validateCurrentPage"]
137
+ }]);
138
138
  function defineCustomElement() {
139
- if (typeof customElements === "undefined") {
140
- return;
141
- }
142
- const components = ["mg-pagination", "mg-button", "mg-icon", "mg-input-select", "mg-input-title", "mg-tooltip", "mg-tooltip-content"];
143
- components.forEach(tagName => { switch (tagName) {
144
- case "mg-pagination":
145
- if (!customElements.get(tagName)) {
146
- customElements.define(tagName, MgPagination);
147
- }
148
- break;
149
- case "mg-button":
150
- if (!customElements.get(tagName)) {
151
- defineCustomElement$6();
152
- }
153
- break;
154
- case "mg-icon":
155
- if (!customElements.get(tagName)) {
156
- defineCustomElement$5();
157
- }
158
- break;
159
- case "mg-input-select":
160
- if (!customElements.get(tagName)) {
161
- defineCustomElement$4();
162
- }
163
- break;
164
- case "mg-input-title":
165
- if (!customElements.get(tagName)) {
166
- defineCustomElement$3();
167
- }
168
- break;
169
- case "mg-tooltip":
170
- if (!customElements.get(tagName)) {
171
- defineCustomElement$2();
172
- }
173
- break;
174
- case "mg-tooltip-content":
175
- if (!customElements.get(tagName)) {
176
- defineCustomElement$1();
177
- }
178
- break;
179
- } });
139
+ if (typeof customElements === "undefined") {
140
+ return;
141
+ }
142
+ const components = ["mg-pagination", "mg-button", "mg-icon", "mg-input-select", "mg-input-title", "mg-tooltip", "mg-tooltip-content"];
143
+ components.forEach(tagName => { switch (tagName) {
144
+ case "mg-pagination":
145
+ if (!customElements.get(tagName)) {
146
+ customElements.define(tagName, MgPagination);
147
+ }
148
+ break;
149
+ case "mg-button":
150
+ if (!customElements.get(tagName)) {
151
+ defineCustomElement$6();
152
+ }
153
+ break;
154
+ case "mg-icon":
155
+ if (!customElements.get(tagName)) {
156
+ defineCustomElement$5();
157
+ }
158
+ break;
159
+ case "mg-input-select":
160
+ if (!customElements.get(tagName)) {
161
+ defineCustomElement$4();
162
+ }
163
+ break;
164
+ case "mg-input-title":
165
+ if (!customElements.get(tagName)) {
166
+ defineCustomElement$3();
167
+ }
168
+ break;
169
+ case "mg-tooltip":
170
+ if (!customElements.get(tagName)) {
171
+ defineCustomElement$2();
172
+ }
173
+ break;
174
+ case "mg-tooltip-content":
175
+ if (!customElements.get(tagName)) {
176
+ defineCustomElement$1();
177
+ }
178
+ break;
179
+ } });
180
180
  }
181
181
  defineCustomElement();
182
182
 
@@ -1 +1 @@
1
- {"file":"mg-pagination2.js","mappings":";;;;;;;;;;AAAA,IAAY,gBAGX;AAHD,WAAY,gBAAgB;EAC1B,iCAAa,CAAA;EACb,yCAAqB,CAAA;AACvB,CAAC,EAHW,gBAAgB,KAAhB,gBAAgB;;ACA5B,MAAM,eAAe,GAAG,+wBAA+wB;;ACKvyB;;;;;;;;;;;;;;;;;;;;;AAqBA,MAAM,KAAK,GAAG,CAAC,KAAa,EAAE,GAAW,EAAE,IAAI,GAAG,CAAC,KAAe,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;MAO9I,YAAY;;;;;;;;;;IA0Ef,aAAQ,GAAG,CAAC,MAAc;MAChC,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC;KAC3B,CAAC;;;;;;;;IAUM,iBAAY,GAAG,CAAC,KAAgD;MACtE,MAAM,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;MACtC,IAAI,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;KAChC,CAAC;;;;;;IAOM,mBAAc,GAAG,CAAC,MAAc,EAAE,QAAiB;MACzD,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,gBAAgB,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,GAAG,CAAC,GAAG,IAAI,CAAC,WAAW,GAAG,C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AAC,aAAa,EAAE,UACtD,IAAI,CAAC,UAAU,OAAG,IAAI,CAAC,UAAU,GAAG,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CACpG,EACN,sBAAsB,CAAC,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,UAAU,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAC/E,CACD,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/molecules/mg-pagination/mg-pagination.conf.ts","../styles/dist/components/mg-pagination.css?tag=mg-pagination&encapsulation=shadow","src/components/molecules/mg-pagination/mg-pagination.tsx"],"sourcesContent":["export enum NavigationAction {\n NEXT = 'next',\n PREVIOUS = 'previous',\n}\n",".mg-u-visually-hidden{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip:rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;clip-path:inset(50%) !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media(prefers-reduced-motion){*{animation:none !important;transition:none !important}}.mg-c-pagination{display:flex;flex-direction:row;align-items:center}.mg-c-pagination mg-input-select{margin-right:.5rem}.mg-c-pagination mg-button{display:flex}.mg-c-pagination mg-button:first-of-type{margin-right:1rem}.mg-c-pagination mg-button:last-of-type{margin-left:1rem}.mg-c-pagination.mg-c-pagination--hide-page-count mg-button{margin:0}/*# sourceMappingURL=mg-pagination.css.map */\n","import { Component, Element, h, Prop, Watch, Event, EventEmitter, Host } from '@stencil/core';\nimport { createID } from '../../../utils/components.utils';\nimport { NavigationAction } 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 messages;\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\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: boolean;\n\n /**\n * Hide select input\n */\n @Prop() hidePageCount: boolean;\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');\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');\n } else if (newValue > this.totalPages) {\n throw new Error('<mg-pagination> prop \"currentPage\" can not be greater than total page');\n }\n\n this.currentPageChange.emit(newValue);\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.messages = initLocales(this.element).messages;\n // Validate\n this.validateTotalPages(this.totalPages);\n this.validateCurrentPage(this.currentPage);\n // Set default label\n if (this.label === undefined || this.label === '') {\n this.label = this.messages.pagination.label;\n }\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n const navigationActionButton = (disabled: boolean, action: string) => (\n <mg-button\n identifier={`${this.identifier}-button-${action}`}\n label={this.messages.pagination[`${action}Page`]}\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 && this.messages.general[action]}\n {action === NavigationAction.NEXT && <mg-icon icon=\"chevron-right\"></mg-icon>}\n </mg-button>\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 <mg-input-select\n identifier={`${this.identifier}-select`}\n items={range(1, this.totalPages).map(page => page.toString())}\n label={this.messages.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 )}\n <span class=\"mg-u-visually-hidden\">\n {this.messages.pagination.page} {this.currentPage}\n </span>\n <span class={{ 'mg-u-visually-hidden': this.hidePageCount }}>\n / {this.totalPages} {this.totalPages > 1 ? this.messages.pagination.pages : this.messages.pagination.page}\n </span>\n {navigationActionButton(this.currentPage >= this.totalPages, NavigationAction.NEXT)}\n </nav>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"mg-pagination2.js","mappings":";;;;;;;;;;AAAA,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,iCAAa,CAAA;IACb,yCAAqB,CAAA;AACvB,CAAC,EAHW,gBAAgB,KAAhB,gBAAgB;;ACA5B,MAAM,eAAe,GAAG,+wBAA+wB;;ACKvyB;;;;;;;;;;;;;;;;;;;;;AAqBA,MAAM,KAAK,GAAG,CAAC,KAAa,EAAE,GAAW,EAAE,IAAI,GAAG,CAAC,KAAe,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;MAO9I,YAAY;;;;;;;;;;QA0Ef,aAAQ,GAAG,CAAC,MAAc;YAChC,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC;SAC3B,CAAC;;;;;;;;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,UAAU,CAAC,CAAC,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC,EAC7D,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,UAAU,gBAC9B,IAAI,qBACC,IAAI,CAAC,YAAY,EAClC,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,6BAEjB,CACpB,EACD,YAAM,KAAK,EAAC,sBAAsB,IAC/B,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,OAAG,IAAI,CAAC,WAAW,CAC5C,EACP,YAAM,KAAK,EAAE,EAAE,sBAAsB,EAAE,IAAI,CAAC,aAAa,EAAE,UACtD,IAAI,CAAC,UAAU,OAAG,IAAI,CAAC,UAAU,GAAG,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CACpG,EACN,sBAAsB,CAAC,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,UAAU,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAC/E,CACD,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/molecules/mg-pagination/mg-pagination.conf.ts","../styles/dist/components/mg-pagination.css?tag=mg-pagination&encapsulation=shadow","src/components/molecules/mg-pagination/mg-pagination.tsx"],"sourcesContent":["export enum NavigationAction {\n NEXT = 'next',\n PREVIOUS = 'previous',\n}\n",".mg-u-visually-hidden{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip:rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;clip-path:inset(50%) !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media(prefers-reduced-motion){*{animation:none !important;transition:none !important}}.mg-c-pagination{display:flex;flex-direction:row;align-items:center}.mg-c-pagination mg-input-select{margin-right:.5rem}.mg-c-pagination mg-button{display:flex}.mg-c-pagination mg-button:first-of-type{margin-right:1rem}.mg-c-pagination mg-button:last-of-type{margin-left:1rem}.mg-c-pagination.mg-c-pagination--hide-page-count mg-button{margin:0}/*# sourceMappingURL=mg-pagination.css.map */\n","import { Component, Element, h, Prop, Watch, Event, EventEmitter, Host } from '@stencil/core';\nimport { createID } from '../../../utils/components.utils';\nimport { NavigationAction } 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 messages;\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\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: boolean;\n\n /**\n * Hide select input\n */\n @Prop() hidePageCount: boolean;\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');\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');\n } else if (newValue > this.totalPages) {\n throw new Error('<mg-pagination> prop \"currentPage\" can not be greater than total page');\n }\n\n this.currentPageChange.emit(newValue);\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.messages = initLocales(this.element).messages;\n // Validate\n this.validateTotalPages(this.totalPages);\n this.validateCurrentPage(this.currentPage);\n // Set default label\n if (this.label === undefined || this.label === '') {\n this.label = this.messages.pagination.label;\n }\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n const navigationActionButton = (disabled: boolean, action: string) => (\n <mg-button\n identifier={`${this.identifier}-button-${action}`}\n label={this.messages.pagination[`${action}Page`]}\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 && this.messages.general[action]}\n {action === NavigationAction.NEXT && <mg-icon icon=\"chevron-right\"></mg-icon>}\n </mg-button>\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 <mg-input-select\n identifier={`${this.identifier}-select`}\n items={range(1, this.totalPages).map(page => page.toString())}\n label={this.messages.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 )}\n <span class=\"mg-u-visually-hidden\">\n {this.messages.pagination.page} {this.currentPage}\n </span>\n <span class={{ 'mg-u-visually-hidden': this.hidePageCount }}>\n / {this.totalPages} {this.totalPages > 1 ? this.messages.pagination.pages : this.messages.pagination.page}\n </span>\n {navigationActionButton(this.currentPage >= this.totalPages, NavigationAction.NEXT)}\n </nav>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -2,8 +2,8 @@ import type { Components, JSX } from "../types/components";
2
2
 
3
3
  interface MgPanel extends Components.MgPanel, HTMLElement {}
4
4
  export const MgPanel: {
5
- prototype: MgPanel;
6
- new (): MgPanel;
5
+ prototype: MgPanel;
6
+ new (): MgPanel;
7
7
  };
8
8
  /**
9
9
  * Used to define this component and all nested components recursively.