@mgdis/mg-components 5.19.2 → 5.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (496) hide show
  1. package/dist/cjs/{components.utils-dc9c8a53.js → components.utils-cd908d4e.js} +102 -99
  2. package/dist/cjs/components.utils-cd908d4e.js.map +1 -0
  3. package/dist/cjs/{index-c042e24b.js → index-8532b5e9.js} +320 -137
  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 +5130 -5057
  7. package/dist/cjs/mg-action-more_34.cjs.entry.js.map +1 -1
  8. package/dist/cjs/mg-components.cjs.js +3 -3
  9. package/dist/cjs/mg-components.cjs.js.map +1 -1
  10. package/dist/cjs/mg-item-more.cjs.entry.js +224 -224
  11. package/dist/cjs/mg-item-more.cjs.entry.js.map +1 -1
  12. package/dist/collection/assets/icons/index.js +193 -183
  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 -347
  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 +8 -0
  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 +789 -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 +589 -572
  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 +779 -767
  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 +537 -520
  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 +566 -550
  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 +701 -689
  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.conf.js +0 -4
  64. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.conf.js.map +1 -1
  65. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +771 -754
  66. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js.map +1 -1
  67. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +706 -689
  68. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js.map +1 -1
  69. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +527 -522
  70. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js.map +1 -1
  71. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.conf.js +2 -2
  72. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.conf.js.map +1 -1
  73. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js +263 -263
  74. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js.map +1 -1
  75. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.conf.js +6 -6
  76. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.conf.js.map +1 -1
  77. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js +423 -423
  78. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js.map +1 -1
  79. package/dist/collection/components/molecules/mg-action-more/mg-action-more.conf.js.map +1 -1
  80. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +214 -214
  81. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js.map +1 -1
  82. package/dist/collection/components/molecules/mg-details/mg-details.js +155 -150
  83. package/dist/collection/components/molecules/mg-details/mg-details.js.map +1 -1
  84. package/dist/collection/components/molecules/mg-form/mg-form.js +332 -335
  85. package/dist/collection/components/molecules/mg-form/mg-form.js.map +1 -1
  86. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +85 -85
  87. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js.map +1 -1
  88. package/dist/collection/components/molecules/mg-item-more/mg-item-more.js +189 -189
  89. package/dist/collection/components/molecules/mg-item-more/mg-item-more.js.map +1 -1
  90. package/dist/collection/components/molecules/mg-message/mg-message.js +325 -304
  91. package/dist/collection/components/molecules/mg-message/mg-message.js.map +1 -1
  92. package/dist/collection/components/molecules/mg-modal/mg-modal.js +317 -317
  93. package/dist/collection/components/molecules/mg-modal/mg-modal.js.map +1 -1
  94. package/dist/collection/components/molecules/mg-pagination/mg-pagination.conf.js +2 -2
  95. package/dist/collection/components/molecules/mg-pagination/mg-pagination.conf.js.map +1 -1
  96. package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +216 -216
  97. package/dist/collection/components/molecules/mg-pagination/mg-pagination.js.map +1 -1
  98. package/dist/collection/components/molecules/mg-panel/mg-panel.js +409 -399
  99. package/dist/collection/components/molecules/mg-panel/mg-panel.js.map +1 -1
  100. package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js +91 -91
  101. package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js.map +1 -1
  102. package/dist/collection/components/molecules/mg-popover/mg-popover.js +336 -329
  103. package/dist/collection/components/molecules/mg-popover/mg-popover.js.map +1 -1
  104. package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +94 -94
  105. package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js.map +1 -1
  106. package/dist/collection/components/molecules/mg-tabs/mg-tabs.conf.js +4 -4
  107. package/dist/collection/components/molecules/mg-tabs/mg-tabs.conf.js.map +1 -1
  108. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +348 -343
  109. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js.map +1 -1
  110. package/dist/collection/locales/fr/messages.json +4 -4
  111. package/dist/collection/locales/index.spec.js +20 -20
  112. package/dist/collection/locales/index.spec.js.map +1 -1
  113. package/dist/collection/utils/behaviors.utils.js +127 -127
  114. package/dist/collection/utils/behaviors.utils.js.map +1 -1
  115. package/dist/collection/utils/behaviors.utils.spec.js +42 -42
  116. package/dist/collection/utils/behaviors.utils.spec.js.map +1 -1
  117. package/dist/collection/utils/components.utils.js +77 -75
  118. package/dist/collection/utils/components.utils.js.map +1 -1
  119. package/dist/collection/utils/components.utils.spec.js +150 -135
  120. package/dist/collection/utils/components.utils.spec.js.map +1 -1
  121. package/dist/collection/utils/e2e.test.utils.js +21 -21
  122. package/dist/collection/utils/e2e.test.utils.js.map +1 -1
  123. package/dist/collection/utils/locale.utils.js +17 -17
  124. package/dist/collection/utils/locale.utils.js.map +1 -1
  125. package/dist/collection/utils/locale.utils.spec.js +45 -45
  126. package/dist/collection/utils/locale.utils.spec.js.map +1 -1
  127. package/dist/collection/utils/playwright.e2e.test.utils.js +41 -41
  128. package/dist/collection/utils/playwright.e2e.test.utils.js.map +1 -1
  129. package/dist/collection/utils/playwright.fixture.js +24 -0
  130. package/dist/collection/utils/playwright.fixture.js.map +1 -0
  131. package/dist/collection/utils/unit.test.utils.js +50 -50
  132. package/dist/collection/utils/unit.test.utils.js.map +1 -1
  133. package/dist/components/MgInput.js +105 -97
  134. package/dist/components/MgInput.js.map +1 -1
  135. package/dist/components/components.utils.js +78 -76
  136. package/dist/components/components.utils.js.map +1 -1
  137. package/dist/components/index2.js +21 -21
  138. package/dist/components/index2.js.map +1 -1
  139. package/dist/components/mg-action-more.d.ts +2 -2
  140. package/dist/components/mg-action-more.js +173 -173
  141. package/dist/components/mg-action-more.js.map +1 -1
  142. package/dist/components/mg-badge.d.ts +2 -2
  143. package/dist/components/mg-badge2.js +83 -83
  144. package/dist/components/mg-badge2.js.map +1 -1
  145. package/dist/components/mg-button.d.ts +2 -2
  146. package/dist/components/mg-button2.js +182 -167
  147. package/dist/components/mg-button2.js.map +1 -1
  148. package/dist/components/mg-card.d.ts +2 -2
  149. package/dist/components/mg-card2.js +77 -77
  150. package/dist/components/mg-card2.js.map +1 -1
  151. package/dist/components/mg-character-left.d.ts +2 -2
  152. package/dist/components/mg-character-left2.js +50 -50
  153. package/dist/components/mg-character-left2.js.map +1 -1
  154. package/dist/components/mg-details.d.ts +2 -2
  155. package/dist/components/mg-details.js +69 -69
  156. package/dist/components/mg-details.js.map +1 -1
  157. package/dist/components/mg-divider.d.ts +2 -2
  158. package/dist/components/mg-divider.js +30 -30
  159. package/dist/components/mg-divider.js.map +1 -1
  160. package/dist/components/mg-form.d.ts +2 -2
  161. package/dist/components/mg-form.js +171 -179
  162. package/dist/components/mg-form.js.map +1 -1
  163. package/dist/components/mg-icon.d.ts +2 -2
  164. package/dist/components/mg-icon2.js +327 -309
  165. package/dist/components/mg-icon2.js.map +1 -1
  166. package/dist/components/mg-illustrated-message.d.ts +2 -2
  167. package/dist/components/mg-illustrated-message.js +51 -51
  168. package/dist/components/mg-illustrated-message.js.map +1 -1
  169. package/dist/components/mg-input-checkbox-paginated.d.ts +2 -2
  170. package/dist/components/mg-input-checkbox-paginated2.js +170 -170
  171. package/dist/components/mg-input-checkbox-paginated2.js.map +1 -1
  172. package/dist/components/mg-input-checkbox.d.ts +2 -2
  173. package/dist/components/mg-input-checkbox.js +478 -480
  174. package/dist/components/mg-input-checkbox.js.map +1 -1
  175. package/dist/components/mg-input-date.d.ts +2 -2
  176. package/dist/components/mg-input-date.js +266 -260
  177. package/dist/components/mg-input-date.js.map +1 -1
  178. package/dist/components/mg-input-numeric.d.ts +2 -2
  179. package/dist/components/mg-input-numeric.js +354 -348
  180. package/dist/components/mg-input-numeric.js.map +1 -1
  181. package/dist/components/mg-input-password.d.ts +2 -2
  182. package/dist/components/mg-input-password.js +205 -199
  183. package/dist/components/mg-input-password.js.map +1 -1
  184. package/dist/components/mg-input-radio.d.ts +2 -2
  185. package/dist/components/mg-input-radio.js +236 -231
  186. package/dist/components/mg-input-radio.js.map +1 -1
  187. package/dist/components/mg-input-select.d.ts +2 -2
  188. package/dist/components/mg-input-select2.js +316 -310
  189. package/dist/components/mg-input-select2.js.map +1 -1
  190. package/dist/components/mg-input-text.d.ts +2 -2
  191. package/dist/components/mg-input-text2.js +306 -300
  192. package/dist/components/mg-input-text2.js.map +1 -1
  193. package/dist/components/mg-input-textarea.d.ts +2 -2
  194. package/dist/components/mg-input-textarea.js +277 -271
  195. package/dist/components/mg-input-textarea.js.map +1 -1
  196. package/dist/components/mg-input-title.d.ts +2 -2
  197. package/dist/components/mg-input-title2.js +60 -60
  198. package/dist/components/mg-input-title2.js.map +1 -1
  199. package/dist/components/mg-input-toggle.d.ts +2 -2
  200. package/dist/components/mg-input-toggle.js +251 -251
  201. package/dist/components/mg-input-toggle.js.map +1 -1
  202. package/dist/components/mg-item-more.d.ts +2 -2
  203. package/dist/components/mg-item-more.js +285 -285
  204. package/dist/components/mg-item-more.js.map +1 -1
  205. package/dist/components/mg-menu-item.d.ts +2 -2
  206. package/dist/components/mg-menu-item2.js +345 -345
  207. package/dist/components/mg-menu-item2.js.map +1 -1
  208. package/dist/components/mg-menu.conf.js +2 -2
  209. package/dist/components/mg-menu.conf.js.map +1 -1
  210. package/dist/components/mg-menu.d.ts +2 -2
  211. package/dist/components/mg-menu2.js +176 -176
  212. package/dist/components/mg-menu2.js.map +1 -1
  213. package/dist/components/mg-message.d.ts +2 -2
  214. package/dist/components/mg-message.js +198 -193
  215. package/dist/components/mg-message.js.map +1 -1
  216. package/dist/components/mg-modal.d.ts +2 -2
  217. package/dist/components/mg-modal.js +198 -198
  218. package/dist/components/mg-modal.js.map +1 -1
  219. package/dist/components/mg-pagination.d.ts +2 -2
  220. package/dist/components/mg-pagination2.js +133 -133
  221. package/dist/components/mg-pagination2.js.map +1 -1
  222. package/dist/components/mg-panel.d.ts +2 -2
  223. package/dist/components/mg-panel.js +238 -238
  224. package/dist/components/mg-panel.js.map +1 -1
  225. package/dist/components/mg-popover-content.d.ts +2 -2
  226. package/dist/components/mg-popover-content2.js +70 -70
  227. package/dist/components/mg-popover-content2.js.map +1 -1
  228. package/dist/components/mg-popover.d.ts +2 -2
  229. package/dist/components/mg-popover2.js +224 -222
  230. package/dist/components/mg-popover2.js.map +1 -1
  231. package/dist/components/mg-skip-links.d.ts +2 -2
  232. package/dist/components/mg-skip-links.js +57 -57
  233. package/dist/components/mg-skip-links.js.map +1 -1
  234. package/dist/components/mg-tabs.d.ts +2 -2
  235. package/dist/components/mg-tabs.js +243 -243
  236. package/dist/components/mg-tabs.js.map +1 -1
  237. package/dist/components/mg-tag.d.ts +2 -2
  238. package/dist/components/mg-tag.js +97 -97
  239. package/dist/components/mg-tag.js.map +1 -1
  240. package/dist/components/mg-tooltip-content.d.ts +2 -2
  241. package/dist/components/mg-tooltip-content2.js +30 -30
  242. package/dist/components/mg-tooltip-content2.js.map +1 -1
  243. package/dist/components/mg-tooltip.d.ts +2 -2
  244. package/dist/components/mg-tooltip2.js +316 -316
  245. package/dist/components/mg-tooltip2.js.map +1 -1
  246. package/dist/components/popper.js +6 -12
  247. package/dist/components/popper.js.map +1 -1
  248. package/dist/esm/{components.utils-0f76010d.js → components.utils-0d67c31c.js} +102 -100
  249. package/dist/esm/components.utils-0d67c31c.js.map +1 -0
  250. package/dist/esm/{index-ce01e63b.js → index-f34a3a2c.js} +320 -137
  251. package/dist/esm/index-f34a3a2c.js.map +1 -0
  252. package/dist/esm/loader.js +3 -3
  253. package/dist/esm/mg-action-more_34.entry.js +5130 -5057
  254. package/dist/esm/mg-action-more_34.entry.js.map +1 -1
  255. package/dist/esm/mg-components.js +4 -4
  256. package/dist/esm/mg-components.js.map +1 -1
  257. package/dist/esm/mg-item-more.entry.js +224 -224
  258. package/dist/esm/mg-item-more.entry.js.map +1 -1
  259. package/dist/mg-components/locales/fr/messages.json +4 -4
  260. package/dist/mg-components/mg-components.css +1 -1
  261. package/dist/mg-components/mg-components.esm.js +1 -1
  262. package/dist/mg-components/mg-components.esm.js.map +1 -1
  263. package/dist/mg-components/p-629454f7.entry.js +2 -0
  264. package/dist/mg-components/p-629454f7.entry.js.map +1 -0
  265. package/dist/mg-components/p-7444ff40.js +3 -0
  266. package/dist/mg-components/p-7444ff40.js.map +1 -0
  267. package/dist/mg-components/p-af42d17b.js +2 -0
  268. package/dist/mg-components/p-af42d17b.js.map +1 -0
  269. package/dist/mg-components/{p-01ebc95a.entry.js → p-e0fb0f3c.entry.js} +2 -2
  270. package/dist/mg-components/p-e0fb0f3c.entry.js.map +1 -0
  271. package/dist/types/assets/icons/index.d.ts +193 -0
  272. package/dist/types/components/atoms/mg-badge/mg-badge.d.ts +41 -41
  273. package/dist/types/components/atoms/mg-button/mg-button.d.ts +100 -96
  274. package/dist/types/components/atoms/mg-card/mg-card.d.ts +39 -39
  275. package/dist/types/components/atoms/mg-character-left/mg-character-left.d.ts +37 -37
  276. package/dist/types/components/atoms/mg-divider/mg-divider.d.ts +12 -12
  277. package/dist/types/components/atoms/mg-icon/mg-icon.d.ts +56 -56
  278. package/dist/types/components/atoms/mg-input-title/mg-input-title.d.ts +34 -34
  279. package/dist/types/components/atoms/mg-tag/mg-tag.d.ts +51 -51
  280. package/dist/types/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.d.ts +12 -12
  281. package/dist/types/components/atoms/mg-tooltip/mg-tooltip.conf.d.ts +3 -3
  282. package/dist/types/components/atoms/mg-tooltip/mg-tooltip.d.ts +113 -113
  283. package/dist/types/components/molecules/inputs/MgInput.conf.d.ts +10 -3
  284. package/dist/types/components/molecules/inputs/MgInput.d.ts +17 -16
  285. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.d.ts +100 -100
  286. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.d.ts +26 -26
  287. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +262 -260
  288. package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.conf.d.ts +4 -4
  289. package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.d.ts +150 -149
  290. package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf.d.ts +4 -4
  291. package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +223 -222
  292. package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.d.ts +142 -141
  293. package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.conf.d.ts +3 -3
  294. package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +152 -151
  295. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.conf.d.ts +6 -6
  296. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +193 -192
  297. package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.conf.d.ts +1 -6
  298. package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +195 -194
  299. package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +181 -180
  300. package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.conf.d.ts +2 -2
  301. package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +141 -141
  302. package/dist/types/components/molecules/menu/mg-menu/mg-menu.conf.d.ts +2 -2
  303. package/dist/types/components/molecules/menu/mg-menu/mg-menu.d.ts +97 -97
  304. package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.conf.d.ts +6 -6
  305. package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.d.ts +179 -179
  306. package/dist/types/components/molecules/mg-action-more/mg-action-more.conf.d.ts +12 -11
  307. package/dist/types/components/molecules/mg-action-more/mg-action-more.d.ts +72 -72
  308. package/dist/types/components/molecules/mg-details/mg-details.d.ts +45 -45
  309. package/dist/types/components/molecules/mg-form/mg-form.d.ts +103 -104
  310. package/dist/types/components/molecules/mg-illustrated-message/mg-illustrated-message.d.ts +27 -27
  311. package/dist/types/components/molecules/mg-item-more/mg-item-more.conf.d.ts +5 -5
  312. package/dist/types/components/molecules/mg-item-more/mg-item-more.d.ts +61 -61
  313. package/dist/types/components/molecules/mg-message/mg-message.d.ts +100 -93
  314. package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +107 -107
  315. package/dist/types/components/molecules/mg-pagination/mg-pagination.conf.d.ts +2 -2
  316. package/dist/types/components/molecules/mg-pagination/mg-pagination.d.ts +74 -74
  317. package/dist/types/components/molecules/mg-panel/mg-panel.d.ts +149 -149
  318. package/dist/types/components/molecules/mg-popover/mg-popover-content/mg-popover-content.d.ts +43 -43
  319. package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +88 -88
  320. package/dist/types/components/molecules/mg-skip-links/mg-skip-links.conf.d.ts +2 -2
  321. package/dist/types/components/molecules/mg-skip-links/mg-skip-links.d.ts +40 -40
  322. package/dist/types/components/molecules/mg-tabs/mg-tabs.conf.d.ts +10 -10
  323. package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +118 -118
  324. package/dist/types/components.d.ts +296 -32
  325. package/dist/types/locales/index.d.ts +172 -172
  326. package/dist/types/stencil-public-runtime.d.ts +29 -0
  327. package/dist/types/utils/behaviors.utils.d.ts +65 -65
  328. package/dist/types/utils/components.utils.d.ts +32 -26
  329. package/dist/types/utils/locale.utils.d.ts +2 -2
  330. package/dist/types/utils/playwright.fixture.d.ts +3 -0
  331. package/dist/types/utils/unit.test.utils.d.ts +5 -5
  332. package/package.json +33 -47
  333. package/dist/cjs/components.utils-dc9c8a53.js.map +0 -1
  334. package/dist/cjs/index-c042e24b.js.map +0 -1
  335. package/dist/collection/components/atoms/mg-badge/test/mg-badge.e2e.playwright.js +0 -33
  336. package/dist/collection/components/atoms/mg-badge/test/mg-badge.e2e.playwright.js.map +0 -1
  337. package/dist/collection/components/atoms/mg-badge/test/mg-badge.spec.js +0 -70
  338. package/dist/collection/components/atoms/mg-badge/test/mg-badge.spec.js.map +0 -1
  339. package/dist/collection/components/atoms/mg-button/test/mg-button.e2e.js +0 -91
  340. package/dist/collection/components/atoms/mg-button/test/mg-button.e2e.js.map +0 -1
  341. package/dist/collection/components/atoms/mg-button/test/mg-button.spec.js +0 -142
  342. package/dist/collection/components/atoms/mg-button/test/mg-button.spec.js.map +0 -1
  343. package/dist/collection/components/atoms/mg-card/test/mg-card.e2e.js +0 -36
  344. package/dist/collection/components/atoms/mg-card/test/mg-card.e2e.js.map +0 -1
  345. package/dist/collection/components/atoms/mg-card/test/mg-card.spec.js +0 -43
  346. package/dist/collection/components/atoms/mg-card/test/mg-card.spec.js.map +0 -1
  347. package/dist/collection/components/atoms/mg-character-left/test/mg-character-left.e2e.js +0 -15
  348. package/dist/collection/components/atoms/mg-character-left/test/mg-character-left.e2e.js.map +0 -1
  349. package/dist/collection/components/atoms/mg-character-left/test/mg-character-left.spec.js +0 -42
  350. package/dist/collection/components/atoms/mg-character-left/test/mg-character-left.spec.js.map +0 -1
  351. package/dist/collection/components/atoms/mg-divider/test/mg-divider.e2e.js +0 -11
  352. package/dist/collection/components/atoms/mg-divider/test/mg-divider.e2e.js.map +0 -1
  353. package/dist/collection/components/atoms/mg-divider/test/mg-divider.spec.js +0 -14
  354. package/dist/collection/components/atoms/mg-divider/test/mg-divider.spec.js.map +0 -1
  355. package/dist/collection/components/atoms/mg-icon/test/mg-icon.e2e.js +0 -55
  356. package/dist/collection/components/atoms/mg-icon/test/mg-icon.e2e.js.map +0 -1
  357. package/dist/collection/components/atoms/mg-icon/test/mg-icon.spec.js +0 -84
  358. package/dist/collection/components/atoms/mg-icon/test/mg-icon.spec.js.map +0 -1
  359. package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.e2e.playwright.js +0 -12
  360. package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.e2e.playwright.js.map +0 -1
  361. package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.spec.js +0 -23
  362. package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.spec.js.map +0 -1
  363. package/dist/collection/components/atoms/mg-tag/test/mg-tag.e2e.playwright.js +0 -23
  364. package/dist/collection/components/atoms/mg-tag/test/mg-tag.e2e.playwright.js.map +0 -1
  365. package/dist/collection/components/atoms/mg-tag/test/mg-tag.spec.js +0 -71
  366. package/dist/collection/components/atoms/mg-tag/test/mg-tag.spec.js.map +0 -1
  367. package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.e2e.js +0 -138
  368. package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.e2e.js.map +0 -1
  369. package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.spec.js +0 -272
  370. package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.spec.js.map +0 -1
  371. package/dist/collection/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.e2e.playwright.js +0 -237
  372. package/dist/collection/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.e2e.playwright.js.map +0 -1
  373. package/dist/collection/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.spec.js +0 -640
  374. package/dist/collection/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.spec.js.map +0 -1
  375. package/dist/collection/components/molecules/inputs/mg-input-date/test/mg-input-date.e2e.js +0 -123
  376. package/dist/collection/components/molecules/inputs/mg-input-date/test/mg-input-date.e2e.js.map +0 -1
  377. package/dist/collection/components/molecules/inputs/mg-input-date/test/mg-input-date.spec.js +0 -379
  378. package/dist/collection/components/molecules/inputs/mg-input-date/test/mg-input-date.spec.js.map +0 -1
  379. package/dist/collection/components/molecules/inputs/mg-input-numeric/test/mg-input-numeric.e2e.js +0 -212
  380. package/dist/collection/components/molecules/inputs/mg-input-numeric/test/mg-input-numeric.e2e.js.map +0 -1
  381. package/dist/collection/components/molecules/inputs/mg-input-numeric/test/mg-input-numeric.spec.js +0 -456
  382. package/dist/collection/components/molecules/inputs/mg-input-numeric/test/mg-input-numeric.spec.js.map +0 -1
  383. package/dist/collection/components/molecules/inputs/mg-input-password/test/mg-input-password.e2e.js +0 -115
  384. package/dist/collection/components/molecules/inputs/mg-input-password/test/mg-input-password.e2e.js.map +0 -1
  385. package/dist/collection/components/molecules/inputs/mg-input-password/test/mg-input-password.spec.js +0 -289
  386. package/dist/collection/components/molecules/inputs/mg-input-password/test/mg-input-password.spec.js.map +0 -1
  387. package/dist/collection/components/molecules/inputs/mg-input-radio/test/mg-input-radio.e2e.js +0 -154
  388. package/dist/collection/components/molecules/inputs/mg-input-radio/test/mg-input-radio.e2e.js.map +0 -1
  389. package/dist/collection/components/molecules/inputs/mg-input-radio/test/mg-input-radio.spec.js +0 -355
  390. package/dist/collection/components/molecules/inputs/mg-input-radio/test/mg-input-radio.spec.js.map +0 -1
  391. package/dist/collection/components/molecules/inputs/mg-input-select/test/mg-input-select.e2e.js +0 -194
  392. package/dist/collection/components/molecules/inputs/mg-input-select/test/mg-input-select.e2e.js.map +0 -1
  393. package/dist/collection/components/molecules/inputs/mg-input-select/test/mg-input-select.spec.js +0 -399
  394. package/dist/collection/components/molecules/inputs/mg-input-select/test/mg-input-select.spec.js.map +0 -1
  395. package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.e2e.playwright.js +0 -147
  396. package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.e2e.playwright.js.map +0 -1
  397. package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.spec.js +0 -353
  398. package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.spec.js.map +0 -1
  399. package/dist/collection/components/molecules/inputs/mg-input-textarea/test/mg-input-textarea.e2e.js +0 -129
  400. package/dist/collection/components/molecules/inputs/mg-input-textarea/test/mg-input-textarea.e2e.js.map +0 -1
  401. package/dist/collection/components/molecules/inputs/mg-input-textarea/test/mg-input-textarea.spec.js +0 -318
  402. package/dist/collection/components/molecules/inputs/mg-input-textarea/test/mg-input-textarea.spec.js.map +0 -1
  403. package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.e2e.playwright.js +0 -108
  404. package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.e2e.playwright.js.map +0 -1
  405. package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.spec.js +0 -247
  406. package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.spec.js.map +0 -1
  407. package/dist/collection/components/molecules/menu/mg-menu/test/mg-menu.e2e.playwright.js +0 -239
  408. package/dist/collection/components/molecules/menu/mg-menu/test/mg-menu.e2e.playwright.js.map +0 -1
  409. package/dist/collection/components/molecules/menu/mg-menu/test/mg-menu.spec.js +0 -175
  410. package/dist/collection/components/molecules/menu/mg-menu/test/mg-menu.spec.js.map +0 -1
  411. package/dist/collection/components/molecules/menu/mg-menu-item/test/mg-menu-item.e2e.playwright.js +0 -100
  412. package/dist/collection/components/molecules/menu/mg-menu-item/test/mg-menu-item.e2e.playwright.js.map +0 -1
  413. package/dist/collection/components/molecules/menu/mg-menu-item/test/mg-menu-item.spec.js +0 -295
  414. package/dist/collection/components/molecules/menu/mg-menu-item/test/mg-menu-item.spec.js.map +0 -1
  415. package/dist/collection/components/molecules/mg-action-more/test/mg-action-more.e2e.playwright.js +0 -128
  416. package/dist/collection/components/molecules/mg-action-more/test/mg-action-more.e2e.playwright.js.map +0 -1
  417. package/dist/collection/components/molecules/mg-action-more/test/mg-action-more.spec.js +0 -187
  418. package/dist/collection/components/molecules/mg-action-more/test/mg-action-more.spec.js.map +0 -1
  419. package/dist/collection/components/molecules/mg-details/test/mg-details.e2e.playwright.js +0 -30
  420. package/dist/collection/components/molecules/mg-details/test/mg-details.e2e.playwright.js.map +0 -1
  421. package/dist/collection/components/molecules/mg-details/test/mg-details.spec.js +0 -42
  422. package/dist/collection/components/molecules/mg-details/test/mg-details.spec.js.map +0 -1
  423. package/dist/collection/components/molecules/mg-form/test/mg-form.e2e.js +0 -169
  424. package/dist/collection/components/molecules/mg-form/test/mg-form.e2e.js.map +0 -1
  425. package/dist/collection/components/molecules/mg-form/test/mg-form.spec.js +0 -277
  426. package/dist/collection/components/molecules/mg-form/test/mg-form.spec.js.map +0 -1
  427. package/dist/collection/components/molecules/mg-illustrated-message/test/mg-illustrated-message.e2e.js +0 -39
  428. package/dist/collection/components/molecules/mg-illustrated-message/test/mg-illustrated-message.e2e.js.map +0 -1
  429. package/dist/collection/components/molecules/mg-illustrated-message/test/mg-illustrated-message.spec.js +0 -36
  430. package/dist/collection/components/molecules/mg-illustrated-message/test/mg-illustrated-message.spec.js.map +0 -1
  431. package/dist/collection/components/molecules/mg-item-more/test/mg-item-more.e2e.playwright.js +0 -85
  432. package/dist/collection/components/molecules/mg-item-more/test/mg-item-more.e2e.playwright.js.map +0 -1
  433. package/dist/collection/components/molecules/mg-item-more/test/mg-item-more.spec.js +0 -106
  434. package/dist/collection/components/molecules/mg-item-more/test/mg-item-more.spec.js.map +0 -1
  435. package/dist/collection/components/molecules/mg-message/test/mg-message.e2e.js +0 -64
  436. package/dist/collection/components/molecules/mg-message/test/mg-message.e2e.js.map +0 -1
  437. package/dist/collection/components/molecules/mg-message/test/mg-message.spec.js +0 -109
  438. package/dist/collection/components/molecules/mg-message/test/mg-message.spec.js.map +0 -1
  439. package/dist/collection/components/molecules/mg-modal/test/mg-modal.e2e.playwright.js +0 -62
  440. package/dist/collection/components/molecules/mg-modal/test/mg-modal.e2e.playwright.js.map +0 -1
  441. package/dist/collection/components/molecules/mg-modal/test/mg-modal.e2e.template.js +0 -40
  442. package/dist/collection/components/molecules/mg-modal/test/mg-modal.e2e.template.js.map +0 -1
  443. package/dist/collection/components/molecules/mg-modal/test/mg-modal.firefox.e2e.playwright.js +0 -26
  444. package/dist/collection/components/molecules/mg-modal/test/mg-modal.firefox.e2e.playwright.js.map +0 -1
  445. package/dist/collection/components/molecules/mg-modal/test/mg-modal.spec.js +0 -122
  446. package/dist/collection/components/molecules/mg-modal/test/mg-modal.spec.js.map +0 -1
  447. package/dist/collection/components/molecules/mg-pagination/test/mg-pagination.e2e.playwright.js +0 -57
  448. package/dist/collection/components/molecules/mg-pagination/test/mg-pagination.e2e.playwright.js.map +0 -1
  449. package/dist/collection/components/molecules/mg-pagination/test/mg-pagination.spec.js +0 -121
  450. package/dist/collection/components/molecules/mg-pagination/test/mg-pagination.spec.js.map +0 -1
  451. package/dist/collection/components/molecules/mg-panel/test/mg-panel.e2e.playwright.js +0 -106
  452. package/dist/collection/components/molecules/mg-panel/test/mg-panel.e2e.playwright.js.map +0 -1
  453. package/dist/collection/components/molecules/mg-panel/test/mg-panel.spec.js +0 -213
  454. package/dist/collection/components/molecules/mg-panel/test/mg-panel.spec.js.map +0 -1
  455. package/dist/collection/components/molecules/mg-popover/test/mg-popover.e2e.playwright.js +0 -140
  456. package/dist/collection/components/molecules/mg-popover/test/mg-popover.e2e.playwright.js.map +0 -1
  457. package/dist/collection/components/molecules/mg-popover/test/mg-popover.spec.js +0 -142
  458. package/dist/collection/components/molecules/mg-popover/test/mg-popover.spec.js.map +0 -1
  459. package/dist/collection/components/molecules/mg-skip-links/test/mg-skip-links.e2e.js +0 -55
  460. package/dist/collection/components/molecules/mg-skip-links/test/mg-skip-links.e2e.js.map +0 -1
  461. package/dist/collection/components/molecules/mg-skip-links/test/mg-skip-links.spec.js +0 -55
  462. package/dist/collection/components/molecules/mg-skip-links/test/mg-skip-links.spec.js.map +0 -1
  463. package/dist/collection/components/molecules/mg-tabs/test/mg-tabs.e2e.playwright.js +0 -76
  464. package/dist/collection/components/molecules/mg-tabs/test/mg-tabs.e2e.playwright.js.map +0 -1
  465. package/dist/collection/components/molecules/mg-tabs/test/mg-tabs.spec.js +0 -332
  466. package/dist/collection/components/molecules/mg-tabs/test/mg-tabs.spec.js.map +0 -1
  467. package/dist/collection/utils/stencil.e2e.test.utils.js +0 -33
  468. package/dist/collection/utils/stencil.e2e.test.utils.js.map +0 -1
  469. package/dist/esm/components.utils-0f76010d.js.map +0 -1
  470. package/dist/esm/index-ce01e63b.js.map +0 -1
  471. package/dist/mg-components/p-01ebc95a.entry.js.map +0 -1
  472. package/dist/mg-components/p-1aa89acf.js +0 -3
  473. package/dist/mg-components/p-1aa89acf.js.map +0 -1
  474. package/dist/mg-components/p-71a5a848.entry.js +0 -2
  475. package/dist/mg-components/p-71a5a848.entry.js.map +0 -1
  476. package/dist/mg-components/p-c9e2c669.js +0 -2
  477. package/dist/mg-components/p-c9e2c669.js.map +0 -1
  478. package/dist/types/components/atoms/mg-badge/test/mg-badge.e2e.playwright.d.ts +0 -1
  479. package/dist/types/components/atoms/mg-input-title/test/mg-input-title.e2e.playwright.d.ts +0 -1
  480. package/dist/types/components/atoms/mg-tag/test/mg-tag.e2e.playwright.d.ts +0 -1
  481. package/dist/types/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.e2e.playwright.d.ts +0 -1
  482. package/dist/types/components/molecules/inputs/mg-input-text/test/mg-input-text.e2e.playwright.d.ts +0 -1
  483. package/dist/types/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.e2e.playwright.d.ts +0 -1
  484. package/dist/types/components/molecules/menu/mg-menu/test/mg-menu.e2e.playwright.d.ts +0 -1
  485. package/dist/types/components/molecules/menu/mg-menu-item/test/mg-menu-item.e2e.playwright.d.ts +0 -1
  486. package/dist/types/components/molecules/mg-action-more/test/mg-action-more.e2e.playwright.d.ts +0 -2
  487. package/dist/types/components/molecules/mg-details/test/mg-details.e2e.playwright.d.ts +0 -1
  488. package/dist/types/components/molecules/mg-item-more/test/mg-item-more.e2e.playwright.d.ts +0 -1
  489. package/dist/types/components/molecules/mg-modal/test/mg-modal.e2e.playwright.d.ts +0 -1
  490. package/dist/types/components/molecules/mg-modal/test/mg-modal.e2e.template.d.ts +0 -12
  491. package/dist/types/components/molecules/mg-modal/test/mg-modal.firefox.e2e.playwright.d.ts +0 -1
  492. package/dist/types/components/molecules/mg-pagination/test/mg-pagination.e2e.playwright.d.ts +0 -1
  493. package/dist/types/components/molecules/mg-panel/test/mg-panel.e2e.playwright.d.ts +0 -1
  494. package/dist/types/components/molecules/mg-popover/test/mg-popover.e2e.playwright.d.ts +0 -1
  495. package/dist/types/components/molecules/mg-tabs/test/mg-tabs.e2e.playwright.d.ts +0 -1
  496. package/dist/types/utils/stencil.e2e.test.utils.d.ts +0 -14
@@ -1,5 +1,5 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
- import { M as MgInput } from './MgInput.js';
2
+ import { H as Handler, M as MgInput } from './MgInput.js';
3
3
  import { C as ClassList, i as isValidString } from './components.utils.js';
4
4
  import { a as localeCurrency, b as localeNumber, i as initLocales } from './index2.js';
5
5
  import { d as defineCustomElement$5 } from './mg-icon2.js';
@@ -13,380 +13,386 @@ import { d as defineCustomElement$2 } from './mg-tooltip-content2.js';
13
13
  const types = ['decimal', 'integer', 'currency'];
14
14
  var InputError;
15
15
  (function (InputError) {
16
- InputError["MIN"] = "min";
17
- InputError["MAX"] = "max";
18
- InputError["MINMAX"] = "minMax";
19
- InputError["REQUIRED"] = "required";
16
+ InputError["MIN"] = "min";
17
+ InputError["MAX"] = "max";
18
+ InputError["MINMAX"] = "minMax";
19
+ InputError["REQUIRED"] = "required";
20
20
  })(InputError || (InputError = {}));
21
21
 
22
22
  const mgInputNumericCss = ":host{display:block}.mg-c-input__input mg-icon,.mg-c-input__error mg-icon{display:flex}.mg-c-input{display:flex;max-width:100%;min-height:var(--default-size);align-items:flex-start;margin-bottom:var(--mg-inputs-margin-bottom, 0)}.mg-c-input mg-input-title{width:var(--mg-inputs-title-width, auto);flex-shrink:var(--mg-inputs-shrink, 1);margin-top:calc((var(--default-size) - var(--font-size)*var(--line-height))/2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-c-input__error{display:inline-block;padding:.3rem .8rem;border-radius:.3rem;margin-top:.2rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-c-input__input-container{min-height:var(--default-size)}.mg-c-input__input-container>strong{display:inline-block;min-height:var(--font-size);margin-top:calc((var(--default-size) - var(--font-size)*var(--line-height))/2)}.mg-c-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-c-input__input-container .mg-c-input__help-text,.mg-c-input__input-container .mg-c-input__error{font-size:1.2rem;text-align:start}.mg-c-input.mg-c-input--label-on-top{flex-direction:column}.mg-c-input.mg-c-input--label-on-top .mg-c-input__input-container{width:100%}.mg-c-input__title{display:flex;align-items:baseline;margin-bottom:.3rem}.mg-c-input__title mg-input-title{width:auto;flex-shrink:1;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-c-input__title mg-tooltip{margin-top:0}.mg-c-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-c-input__input{display:flex}.mg-c-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size))/2)}.mg-c-input__input.mg-c-input__input--has-error .mg-c-input__box{border-color:hsl(var(--color-danger))}.mg-c-input__input+.mg-c-input__help-text,.mg-c-input__input+.mg-c-input__error{margin-top:.5rem}.mg-c-input__input .mg-c-input__box:disabled,.mg-c-input__input-group--disabled label,.mg-c-input.mg-c-input--toggle-disabled .mg-c-input__input .mg-c-input__button-toggle,.mg-c-input.mg-c-input--checkbox-multi-disabled .mg-c-input__input strong{opacity:var(--mg-disabled-opacity)}.mg-c-input__box{height:var(--default-size);box-sizing:border-box;padding:calc((var(--default-size) - var(--font-size)*var(--line-height))/2) var(--mg-inputs-spacer);border-width:var(--mg-inputs-border-width);border-style:solid;border-color:var(--mg-inputs-color);border-radius:var(--mg-inputs-border-radius);background-color:hsl(var(--color-light));color:hsl(var(--color-dark));font-family:inherit;font-size:var(--font-size);text-align:var(--mg-inputs-text-align, left)}.mg-c-input__box::placeholder{color:var(--mg-inputs-color);font-style:italic}.mg-c-input__box:focus{box-shadow:0 0 .6rem hsl(var(--mg-inputs-color-shadow-focus-hsl)/50%)}.mg-c-input__box:disabled{opacity:.3}.mg-c-input.mg-c-input--label-on-top .mg-c-input__box{width:auto;max-width:100%}.mg-c-input.mg-c-input--is-input-group-append{--mg-button-border-radius-top-left:0;--mg-button-border-radius-bottom-left:0}.mg-c-input.mg-c-input--is-input-group-append .mg-c-input__box{margin-right:-0.1rem;border-bottom-right-radius:0;border-top-right-radius:0}.mg-c-input.mg-c-input--is-input-group-append .mg-c-input__box:focus-visible{outline-offset:-0.2rem;outline-style:solid;outline-width:.2rem}.mg-c-input.mg-c-input--is-input-group-append.mg-c-input--readonly slot[name=append-input]{display:none}.mg-c-input.mg-c-input--has-buttons-group-append ::slotted([slot=append-input]){--mg-button-border-radius-top-right:0;--mg-button-border-radius-bottom-right:0}.mg-c-input.mg-c-input--has-buttons-group-append ::slotted([slot=append-input]:not(:last-of-type)){--mg-button-border-right-width:0}.mg-c-input.mg-c-input--has-buttons-group-append ::slotted([slot=append-input]:last-of-type){--mg-button-border-radius-top-right:var(--mg-inputs-border-radius);--mg-button-border-radius-bottom-right:var(--mg-inputs-border-radius)}.mg-c-input.mg-c-input--is-append-input-slot-content:not(.mg-c-input--readonly) ::slotted([slot=append-input]){padding-top:calc((var(--default-size) - var(--mg-icon-regular-size))/2)}.mg-c-input:not(.mg-c-input--label-on-top) .mg-c-input__box{width:100%;min-width:5rem;max-width:calc(17.7rem + var(--mg-inputs-spacer)*2)}.mg-c-input.mg-c-input--width-full:not(.mg-c-input--label-on-top){justify-content:space-between}.mg-c-input.mg-c-input--width-full.mg-c-input--label-on-top .mg-c-input__box{width:100%}.mg-c-input.mg-c-input--width-full .mg-c-input__input-container{width:100%;flex:auto}.mg-c-input.mg-c-input--width-full .mg-c-input__input-container .mg-c-input__box{max-width:100%}.mg-c-input.mg-c-input--width-16 .mg-c-input__input-container{width:100%}.mg-c-input.mg-c-input--width-16 .mg-c-input__input-container .mg-c-input__input{width:100%;max-width:21rem}.mg-c-input.mg-c-input--width-16 .mg-c-input__input-container .mg-c-input__with-character-left{width:100%}.mg-c-input.mg-c-input--width-16 .mg-c-input__input-container .mg-c-input__box{min-width:100%;max-width:21rem}.mg-c-input.mg-c-input--width-4 .mg-c-input__input-container .mg-c-input__box{max-width:7rem}.mg-c-input.mg-c-input--width-2 .mg-c-input__input-container .mg-c-input__box{max-width:5rem}.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-input .mg-c-input__box{text-align:var(--mg-inputs-text-align, right)}";
23
23
 
24
24
  const MgInputNumeric$1 = /*@__PURE__*/ proxyCustomElement(class MgInputNumeric extends HTMLElement {
25
- constructor() {
26
- super();
27
- this.__registerHost();
28
- this.__attachShadow();
29
- this.valueChange = createEvent(this, "value-change", 7);
30
- this.inputValid = createEvent(this, "input-valid", 7);
31
- // hasDisplayedError (triggered by blur event)
32
- this.hasDisplayedError = false;
25
+ constructor() {
26
+ super();
27
+ this.__registerHost();
28
+ this.__attachShadow();
29
+ this.valueChange = createEvent(this, "value-change", 7);
30
+ this.inputValid = createEvent(this, "input-valid", 7);
31
+ // hasDisplayedError (triggered by blur event)
32
+ this.hasDisplayedError = false;
33
+ /**
34
+ * Handle input event
35
+ */
36
+ this.handleInput = () => {
37
+ // Check validity
38
+ this.checkValidity();
39
+ if (this.hasDisplayedError) {
40
+ this.setErrorMessage();
41
+ }
42
+ this.value = this.input.value;
43
+ };
44
+ /**
45
+ * Handle focus event
46
+ */
47
+ this.handleFocus = () => {
48
+ this.hasFocus = true;
49
+ };
50
+ /**
51
+ * Handle blur event
52
+ */
53
+ this.handleBlur = () => {
54
+ if (this.value === '-')
55
+ this.value = '';
56
+ // Display Error
57
+ this.handlerInProgress = Handler.BLUR;
58
+ this.displayError().finally(() => {
59
+ // reset guard
60
+ this.handlerInProgress = undefined;
61
+ this.hasFocus = false;
62
+ });
63
+ };
64
+ /**
65
+ * Check if input is valid
66
+ */
67
+ this.checkValidity = () => {
68
+ this.setValidity(this.readonly || this.disabled || this.getInputError() === null);
69
+ };
70
+ /**
71
+ * Set input error message
72
+ * @param errorMessage - errorMessage override
73
+ */
74
+ this.setErrorMessage = (errorMessage) => {
75
+ // Set error message
76
+ this.errorMessage = undefined;
77
+ if (!this.valid) {
78
+ const inputError = this.getInputError();
79
+ if (errorMessage !== undefined) {
80
+ this.errorMessage = errorMessage;
81
+ }
82
+ else if (inputError === InputError.REQUIRED) {
83
+ this.errorMessage = this.messages.errors[inputError];
84
+ }
85
+ else {
86
+ this.errorMessage = this.messages.errors.numeric[inputError].replace('{min}', `${this.formatValue(this.min)}`).replace('{max}', `${this.formatValue(this.max)}`);
87
+ }
88
+ }
89
+ };
90
+ /**
91
+ * Get input error code
92
+ * @returns error code
93
+ */
94
+ this.getInputError = () => {
95
+ let inputError = null;
96
+ const hasNotEmptyValues = (toControl) => !toControl.some(value => [null, undefined].includes(value));
97
+ if (!hasNotEmptyValues([this.input]))
98
+ return inputError;
99
+ // required
100
+ if (!this.input.checkValidity() && this.input.validity.valueMissing) {
101
+ inputError = InputError.REQUIRED;
102
+ }
103
+ // Min & Max
104
+ else if (hasNotEmptyValues([this.min, this.numericValue]) && this.numericValue < this.min && this.max === undefined) {
105
+ // Only a min value is set
106
+ inputError = InputError.MIN;
107
+ }
108
+ else if (hasNotEmptyValues([this.max, this.numericValue]) && this.numericValue > this.max && this.min === undefined) {
109
+ // Only a max value is set
110
+ inputError = InputError.MAX;
111
+ }
112
+ else if (hasNotEmptyValues([this.min, this.max, this.numericValue]) && (this.numericValue < this.min || this.numericValue > this.max)) {
113
+ // both min and max values are set
114
+ inputError = InputError.MINMAX;
115
+ }
116
+ return inputError;
117
+ };
118
+ /**
119
+ * Format value based on type
120
+ * @param value - value to format
121
+ * @returns formated local value
122
+ */
123
+ this.formatValue = (value) => (this.type === 'currency' ? localeCurrency(value, this.locale, this.currency) : localeNumber(value, this.locale));
124
+ /**
125
+ * Validate append slot
126
+ */
127
+ this.validateAppendSlot = () => {
128
+ const slotAppendInput = this.element.querySelector('[slot="append-input"]');
129
+ if (slotAppendInput !== null) {
130
+ this.classCollection.add(slotAppendInput.nodeName === 'MG-BUTTON' ? 'mg-c-input--is-input-group-append' : 'mg-c-input--is-append-input-slot-content');
131
+ }
132
+ };
133
+ this.value = undefined;
134
+ this.identifier = undefined;
135
+ this.name = this.identifier;
136
+ this.label = undefined;
137
+ this.labelOnTop = undefined;
138
+ this.labelHide = false;
139
+ this.placeholder = undefined;
140
+ this.required = false;
141
+ this.readonly = false;
142
+ this.disabled = false;
143
+ this.mgWidth = undefined;
144
+ this.tooltip = undefined;
145
+ this.helpText = undefined;
146
+ this.type = types[0];
147
+ this.currency = 'USD';
148
+ this.max = undefined;
149
+ this.min = undefined;
150
+ this.integerLength = 13;
151
+ this.decimalLength = 2;
152
+ this.valid = undefined;
153
+ this.invalid = undefined;
154
+ this.classCollection = new ClassList(['mg-c-input--numeric']);
155
+ this.errorMessage = undefined;
156
+ this.hasFocus = undefined;
157
+ }
158
+ validateValue(newValue) {
159
+ // has input value is always render as string we get a stringified value or a '' for nullish value, so we test string type
160
+ if (typeof newValue === 'string') {
161
+ // Split number and decimal
162
+ const [integer, decimal = ''] = newValue.replace('-', '').split(/[.,]/);
163
+ // Regex
164
+ const regex = this.type === 'integer' ? /^-?\d+$/ : /^-?\d+(?:[.,]\d*)?$/;
165
+ // Filter input
166
+ if (this.isValidValue(newValue, regex, integer, decimal)) {
167
+ this.storedValue = newValue;
168
+ }
169
+ else {
170
+ newValue = this.handleInvalidValue();
171
+ }
172
+ // Set value and input value
173
+ this.updateValues(newValue);
174
+ }
175
+ }
176
+ handleValidityChange(newValue, _oldValue, prop) {
177
+ if (this.input !== undefined) {
178
+ this.input[prop] = newValue;
179
+ this.checkValidity();
180
+ if (this.hasDisplayedError) {
181
+ this.setErrorMessage();
182
+ this.hasDisplayedError = false;
183
+ }
184
+ }
185
+ }
186
+ validateType(newValue) {
187
+ if (!types.includes(newValue)) {
188
+ throw new Error(`<mg-input-numeric> prop "type" must be one of: ${types.join(', ')}`);
189
+ }
190
+ }
191
+ validateIntegerLength(newValue) {
192
+ if (newValue < 1) {
193
+ throw new Error(`<mg-input-numeric> prop "integer-length" must be a positive number.`);
194
+ }
195
+ }
196
+ validateDecimalLength(newValue) {
197
+ if (newValue < 1) {
198
+ throw new Error(`<mg-input-numeric> prop "decimal-length" must be a positive number, consider using prop "type" to "integer" instead.`);
199
+ }
200
+ }
33
201
  /**
34
- * Handle input event
202
+ * Display input error if it exists.
35
203
  */
36
- this.handleInput = () => {
37
- // Check validity
38
- this.checkValidity();
39
- if (this.hasDisplayedError) {
204
+ async displayError() {
205
+ this.checkValidity();
40
206
  this.setErrorMessage();
41
- }
42
- this.value = this.input.value;
43
- };
44
- /**
45
- * Handle focus event
46
- */
47
- this.handleFocus = () => {
48
- this.hasFocus = true;
49
- };
50
- /**
51
- * Handle blur event
52
- */
53
- this.handleBlur = () => {
54
- if (this.value === '-')
55
- this.value = '';
56
- // Display Error
57
- this.displayError();
58
- this.hasFocus = false;
59
- };
60
- /**
61
- * Check if input is valid
62
- */
63
- this.checkValidity = () => {
64
- this.setValidity(this.readonly || this.disabled || this.getInputError() === null);
65
- };
207
+ this.hasDisplayedError = this.invalid;
208
+ }
66
209
  /**
67
- * Set input error message
68
- * @param errorMessage - errorMessage override
210
+ * Set an error and display a custom error message.
211
+ * This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.
212
+ * It must be paired with an error message to display for the given context.
213
+ * When used to set validity to `false`, you should use this method again to reset the validity to `true`.
214
+ * @param valid - value indicating the validity
215
+ * @param errorMessage - the error message to display
69
216
  */
70
- this.setErrorMessage = (errorMessage) => {
71
- // Set error message
72
- this.errorMessage = undefined;
73
- if (!this.valid) {
74
- const inputError = this.getInputError();
75
- if (errorMessage !== undefined) {
76
- this.errorMessage = errorMessage;
217
+ async setError(valid, errorMessage) {
218
+ if (typeof valid !== 'boolean') {
219
+ throw new Error('<mg-input-numeric> method "setError()" param "valid" must be a boolean');
77
220
  }
78
- else if (inputError === InputError.REQUIRED) {
79
- this.errorMessage = this.messages.errors[inputError];
221
+ else if (!isValidString(errorMessage)) {
222
+ throw new Error('<mg-input-numeric> method "setError()" param "errorMessage" must be a string');
80
223
  }
81
224
  else {
82
- this.errorMessage = this.messages.errors.numeric[inputError].replace('{min}', `${this.formatValue(this.min)}`).replace('{max}', `${this.formatValue(this.max)}`);
225
+ this.setValidity(valid);
226
+ this.setErrorMessage(valid ? undefined : errorMessage);
227
+ this.hasDisplayedError = this.invalid;
83
228
  }
84
- }
85
- };
229
+ }
86
230
  /**
87
- * Get input error code
88
- * @returns error code
231
+ * Method to set validity values
232
+ * @param newValue - valid new value
89
233
  */
90
- this.getInputError = () => {
91
- let inputError = null;
92
- const hasNotEmptyValues = (toControl) => !toControl.some(value => [null, undefined].includes(value));
93
- if (!hasNotEmptyValues([this.input]))
94
- return inputError;
95
- // required
96
- if (!this.input.checkValidity() && this.input.validity.valueMissing) {
97
- inputError = InputError.REQUIRED;
98
- }
99
- // Min & Max
100
- else if (hasNotEmptyValues([this.min, this.numericValue]) && this.numericValue < this.min && this.max === undefined) {
101
- // Only a min value is set
102
- inputError = InputError.MIN;
103
- }
104
- else if (hasNotEmptyValues([this.max, this.numericValue]) && this.numericValue > this.max && this.min === undefined) {
105
- // Only a max value is set
106
- inputError = InputError.MAX;
107
- }
108
- else if (hasNotEmptyValues([this.min, this.max, this.numericValue]) && (this.numericValue < this.min || this.numericValue > this.max)) {
109
- // both min and max values are set
110
- inputError = InputError.MINMAX;
111
- }
112
- return inputError;
113
- };
234
+ setValidity(newValue) {
235
+ const oldValidValue = this.valid;
236
+ this.valid = newValue;
237
+ this.invalid = !this.valid;
238
+ // We need to send valid event even if it is the same value
239
+ if (this.handlerInProgress === undefined || (this.handlerInProgress === Handler.BLUR && this.valid !== oldValidValue))
240
+ this.inputValid.emit(this.valid);
241
+ }
114
242
  /**
115
- * Format value based on type
116
- * @param value - value to format
117
- * @returns formated local value
243
+ * Checks if the given value is valid according to the defined rules.
244
+ * @param value - The input value to validate.
245
+ * @param regex - The regular expression for validation.
246
+ * @param integer - The integer part of the value.
247
+ * @param decimal - The decimal part of the value.
248
+ * @returns Returns true if the value is valid, otherwise false.
118
249
  */
119
- this.formatValue = (value) => (this.type === 'currency' ? localeCurrency(value, this.locale, this.currency) : localeNumber(value, this.locale));
250
+ isValidValue(value, regex, integer, decimal) {
251
+ return (['', '-'].includes(value) || (regex.exec(value) !== null && integer.length <= this.integerLength && decimal.length <= (this.type === 'integer' ? 0 : this.decimalLength)));
252
+ }
120
253
  /**
121
- * Validate append slot
254
+ * Handles invalid input values and returns a corrected value.
255
+ * @returns The corrected value.
122
256
  */
123
- this.validateAppendSlot = () => {
124
- const slotAppendInput = this.element.querySelector('[slot="append-input"]');
125
- if (slotAppendInput !== null) {
126
- this.classCollection.add(slotAppendInput.nodeName === 'MG-BUTTON' ? 'mg-c-input--is-input-group-append' : 'mg-c-input--is-append-input-slot-content');
127
- }
128
- };
129
- this.value = undefined;
130
- this.identifier = undefined;
131
- this.name = this.identifier;
132
- this.label = undefined;
133
- this.labelOnTop = undefined;
134
- this.labelHide = false;
135
- this.placeholder = undefined;
136
- this.required = false;
137
- this.readonly = false;
138
- this.disabled = false;
139
- this.mgWidth = undefined;
140
- this.tooltip = undefined;
141
- this.helpText = undefined;
142
- this.type = types[0];
143
- this.currency = 'USD';
144
- this.max = undefined;
145
- this.min = undefined;
146
- this.integerLength = 13;
147
- this.decimalLength = 2;
148
- this.valid = undefined;
149
- this.invalid = undefined;
150
- this.classCollection = new ClassList(['mg-c-input--numeric']);
151
- this.errorMessage = undefined;
152
- this.hasFocus = false;
153
- }
154
- validateValue(newValue) {
155
- // has input value is always render as string we get a stringified value or a '' for nullish value, so we test string type
156
- if (typeof newValue === 'string') {
157
- // Split number and decimal
158
- const [integer, decimal = ''] = newValue.replace('-', '').split(/[.,]/);
159
- // Regex
160
- const regex = this.type === 'integer' ? /^-?\d+$/ : /^-?\d+(?:[.,]\d*)?$/;
161
- // Filter input
162
- if (this.isValidValue(newValue, regex, integer, decimal)) {
163
- this.storedValue = newValue;
164
- }
165
- else {
166
- newValue = this.handleInvalidValue();
167
- }
168
- // Set value and input value
169
- this.updateValues(newValue);
170
- }
171
- }
172
- handleValidityChange(newValue, _oldValue, prop) {
173
- if (this.input !== undefined) {
174
- this.input[prop] = newValue;
175
- this.checkValidity();
176
- if (this.hasDisplayedError) {
177
- this.setErrorMessage();
178
- this.hasDisplayedError = false;
179
- }
180
- }
181
- }
182
- validateType(newValue) {
183
- if (!types.includes(newValue)) {
184
- throw new Error(`<mg-input-numeric> prop "type" must be one of: ${types.join(', ')}`);
185
- }
186
- }
187
- validateIntegerLength(newValue) {
188
- if (newValue < 1) {
189
- throw new Error(`<mg-input-numeric> prop "integer-length" must be a positive number.`);
257
+ handleInvalidValue() {
258
+ var _a;
259
+ return (_a = this.storedValue) !== null && _a !== void 0 ? _a : null;
190
260
  }
191
- }
192
- validateDecimalLength(newValue) {
193
- if (newValue < 1) {
194
- throw new Error(`<mg-input-numeric> prop "decimal-length" must be a positive number, consider using prop "type" to "integer" instead.`);
261
+ /**
262
+ * Updates the component values based on the validated input value.
263
+ * @param newValue - The validated input value.
264
+ */
265
+ updateValues(newValue) {
266
+ this.value = newValue;
267
+ if (this.input !== undefined)
268
+ this.input.value = this.value;
269
+ this.numericValue = !['', null].includes(this.value) ? parseFloat(this.value.replace(',', '.')) : null;
270
+ this.valueChange.emit(this.numericValue);
271
+ this.readonlyValue = this.numericValue !== null ? this.formatValue(this.numericValue) : '';
195
272
  }
196
- }
197
- /**
198
- * Display input error if it exists.
199
- */
200
- async displayError() {
201
- this.checkValidity();
202
- this.setErrorMessage();
203
- this.hasDisplayedError = this.invalid;
204
- }
205
- /**
206
- * Set an error and display a custom error message.
207
- * This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.
208
- * It must be paired with an error message to display for the given context.
209
- * When used to set validity to `false`, you should use this method again to reset the validity to `true`.
210
- * @param valid - value indicating the validity
211
- * @param errorMessage - the error message to display
212
- */
213
- async setError(valid, errorMessage) {
214
- if (typeof valid !== 'boolean') {
215
- throw new Error('<mg-input-numeric> method "setError()" param "valid" must be a boolean');
273
+ /**
274
+ * Displayed value in input
275
+ * Change on focus/blur
276
+ * @returns display value
277
+ */
278
+ displayValue() {
279
+ return this.hasFocus ? this.value : this.readonlyValue;
216
280
  }
217
- else if (!isValidString(errorMessage)) {
218
- throw new Error('<mg-input-numeric> method "setError()" param "errorMessage" must be a string');
281
+ /*************
282
+ * Lifecycle *
283
+ *************/
284
+ /**
285
+ * Check if component props are well configured on init
286
+ * @returns timeout
287
+ */
288
+ componentWillLoad() {
289
+ // Get locales
290
+ const locales = initLocales(this.element);
291
+ this.locale = locales.locale;
292
+ this.messages = locales.messages;
293
+ // Validate component config
294
+ this.validateType(this.type);
295
+ this.validateIntegerLength(this.integerLength);
296
+ this.validateDecimalLength(this.decimalLength);
297
+ // validate value
298
+ this.validateValue(this.value);
299
+ this.validateAppendSlot();
300
+ // Check validity when component is ready
301
+ // return a promise to process action only in the FIRST render().
302
+ // https://stenciljs.com/docs/component-lifecycle#componentwillload
303
+ return setTimeout(() => {
304
+ this.checkValidity();
305
+ }, 0);
219
306
  }
220
- else {
221
- this.setValidity(valid);
222
- this.setErrorMessage(valid ? undefined : errorMessage);
223
- this.hasDisplayedError = this.invalid;
307
+ /**
308
+ * Render
309
+ * @returns HTML Element
310
+ */
311
+ render() {
312
+ return (h(MgInput, { identifier: this.identifier, classCollection: this.classCollection, ariaDescribedbyIDs: [], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, readonly: this.readonly, mgWidth: this.mgWidth, disabled: this.disabled, value: this.value, readonlyValue: this.readonlyValue, tooltip: this.tooltip, helpText: this.helpText, errorMessage: this.errorMessage, isFieldset: false }, h("input", { type: "text", class: "mg-c-input__box", value: this.displayValue(), id: this.identifier, name: this.name, placeholder: this.placeholder, title: this.placeholder, disabled: this.disabled, required: this.required, "aria-invalid": (this.invalid === true).toString(), onInput: this.handleInput, onFocus: this.handleFocus, onBlur: this.handleBlur, ref: (el) => {
313
+ if (el !== null)
314
+ this.input = el;
315
+ } }), h("slot", { name: "append-input" })));
224
316
  }
225
- }
226
- /**
227
- * Method to set validity values
228
- * @param newValue - valid new value
229
- */
230
- setValidity(newValue) {
231
- this.valid = newValue;
232
- this.invalid = !this.valid;
233
- // We need to send valid event even if it is the same value
234
- this.inputValid.emit(this.valid);
235
- }
236
- /**
237
- * Checks if the given value is valid according to the defined rules.
238
- * @param value - The input value to validate.
239
- * @param regex - The regular expression for validation.
240
- * @param integer - The integer part of the value.
241
- * @param decimal - The decimal part of the value.
242
- * @returns Returns true if the value is valid, otherwise false.
243
- */
244
- isValidValue(value, regex, integer, decimal) {
245
- return (['', '-'].includes(value) || (regex.exec(value) !== null && integer.length <= this.integerLength && decimal.length <= (this.type === 'integer' ? 0 : this.decimalLength)));
246
- }
247
- /**
248
- * Handles invalid input values and returns a corrected value.
249
- * @returns The corrected value.
250
- */
251
- handleInvalidValue() {
252
- var _a;
253
- return (_a = this.storedValue) !== null && _a !== void 0 ? _a : null;
254
- }
255
- /**
256
- * Updates the component values based on the validated input value.
257
- * @param newValue - The validated input value.
258
- */
259
- updateValues(newValue) {
260
- this.value = newValue;
261
- if (this.input !== undefined)
262
- this.input.value = this.value;
263
- this.numericValue = !['', null].includes(this.value) ? parseFloat(this.value.replace(',', '.')) : null;
264
- this.valueChange.emit(this.numericValue);
265
- this.readonlyValue = this.numericValue !== null ? this.formatValue(this.numericValue) : '';
266
- }
267
- /**
268
- * Displayed value in input
269
- * Change on focus/blur
270
- * @returns display value
271
- */
272
- displayValue() {
273
- return this.hasFocus ? this.value : this.readonlyValue;
274
- }
275
- /*************
276
- * Lifecycle *
277
- *************/
278
- /**
279
- * Check if component props are well configured on init
280
- * @returns timeout
281
- */
282
- componentWillLoad() {
283
- // Get locales
284
- const locales = initLocales(this.element);
285
- this.locale = locales.locale;
286
- this.messages = locales.messages;
287
- // Validate component config
288
- this.validateType(this.type);
289
- this.validateIntegerLength(this.integerLength);
290
- this.validateDecimalLength(this.decimalLength);
291
- // validate value
292
- this.validateValue(this.value);
293
- this.validateAppendSlot();
294
- // Check validity when component is ready
295
- // return a promise to process action only in the FIRST render().
296
- // https://stenciljs.com/docs/component-lifecycle#componentwillload
297
- return setTimeout(() => {
298
- this.checkValidity();
299
- }, 0);
300
- }
301
- /**
302
- * Render
303
- * @returns HTML Element
304
- */
305
- render() {
306
- return (h(MgInput, { identifier: this.identifier, classCollection: this.classCollection, ariaDescribedbyIDs: [], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, readonly: this.readonly, mgWidth: this.mgWidth, disabled: this.disabled, value: this.value, readonlyValue: this.readonlyValue, tooltip: this.tooltip, helpText: this.helpText, errorMessage: this.errorMessage, isFieldset: false }, h("input", { type: "text", class: "mg-c-input__box", value: this.displayValue(), id: this.identifier, name: this.name, placeholder: this.placeholder, title: this.placeholder, disabled: this.disabled, required: this.required, "aria-invalid": (this.invalid === true).toString(), onInput: this.handleInput, onFocus: this.handleFocus, onBlur: this.handleBlur, ref: (el) => {
307
- if (el !== null)
308
- this.input = el;
309
- } }), h("slot", { name: "append-input" })));
310
- }
311
- get element() { return this; }
312
- static get watchers() { return {
313
- "value": ["validateValue"],
314
- "required": ["handleValidityChange"],
315
- "readonly": ["handleValidityChange"],
316
- "disabled": ["handleValidityChange"],
317
- "type": ["validateType"],
318
- "integerLength": ["validateIntegerLength"],
319
- "decimalLength": ["validateDecimalLength"]
320
- }; }
321
- static get style() { return mgInputNumericCss; }
317
+ get element() { return this; }
318
+ static get watchers() { return {
319
+ "value": ["validateValue"],
320
+ "required": ["handleValidityChange"],
321
+ "readonly": ["handleValidityChange"],
322
+ "disabled": ["handleValidityChange"],
323
+ "type": ["validateType"],
324
+ "integerLength": ["validateIntegerLength"],
325
+ "decimalLength": ["validateDecimalLength"]
326
+ }; }
327
+ static get style() { return mgInputNumericCss; }
322
328
  }, [1, "mg-input-numeric", {
323
- "value": [1537],
324
- "identifier": [1],
325
- "name": [1],
326
- "label": [1],
327
- "labelOnTop": [4, "label-on-top"],
328
- "labelHide": [4, "label-hide"],
329
- "placeholder": [1],
330
- "required": [4],
331
- "readonly": [4],
332
- "disabled": [4],
333
- "mgWidth": [8, "mg-width"],
334
- "tooltip": [1],
335
- "helpText": [1, "help-text"],
336
- "type": [1],
337
- "currency": [1],
338
- "max": [2],
339
- "min": [2],
340
- "integerLength": [2, "integer-length"],
341
- "decimalLength": [2, "decimal-length"],
342
- "valid": [1028],
343
- "invalid": [1028],
344
- "classCollection": [32],
345
- "errorMessage": [32],
346
- "hasFocus": [32],
347
- "displayError": [64],
348
- "setError": [64]
349
- }, undefined, {
350
- "value": ["validateValue"],
351
- "required": ["handleValidityChange"],
352
- "readonly": ["handleValidityChange"],
353
- "disabled": ["handleValidityChange"],
354
- "type": ["validateType"],
355
- "integerLength": ["validateIntegerLength"],
356
- "decimalLength": ["validateDecimalLength"]
357
- }]);
329
+ "value": [1537],
330
+ "identifier": [1],
331
+ "name": [1],
332
+ "label": [1],
333
+ "labelOnTop": [4, "label-on-top"],
334
+ "labelHide": [4, "label-hide"],
335
+ "placeholder": [1],
336
+ "required": [4],
337
+ "readonly": [4],
338
+ "disabled": [4],
339
+ "mgWidth": [8, "mg-width"],
340
+ "tooltip": [1],
341
+ "helpText": [1, "help-text"],
342
+ "type": [1],
343
+ "currency": [1],
344
+ "max": [2],
345
+ "min": [2],
346
+ "integerLength": [2, "integer-length"],
347
+ "decimalLength": [2, "decimal-length"],
348
+ "valid": [1028],
349
+ "invalid": [1028],
350
+ "classCollection": [32],
351
+ "errorMessage": [32],
352
+ "hasFocus": [32],
353
+ "displayError": [64],
354
+ "setError": [64]
355
+ }, undefined, {
356
+ "value": ["validateValue"],
357
+ "required": ["handleValidityChange"],
358
+ "readonly": ["handleValidityChange"],
359
+ "disabled": ["handleValidityChange"],
360
+ "type": ["validateType"],
361
+ "integerLength": ["validateIntegerLength"],
362
+ "decimalLength": ["validateDecimalLength"]
363
+ }]);
358
364
  function defineCustomElement$1() {
359
- if (typeof customElements === "undefined") {
360
- return;
361
- }
362
- const components = ["mg-input-numeric", "mg-icon", "mg-input-title", "mg-tooltip", "mg-tooltip-content"];
363
- components.forEach(tagName => { switch (tagName) {
364
- case "mg-input-numeric":
365
- if (!customElements.get(tagName)) {
366
- customElements.define(tagName, MgInputNumeric$1);
367
- }
368
- break;
369
- case "mg-icon":
370
- if (!customElements.get(tagName)) {
371
- defineCustomElement$5();
372
- }
373
- break;
374
- case "mg-input-title":
375
- if (!customElements.get(tagName)) {
376
- defineCustomElement$4();
377
- }
378
- break;
379
- case "mg-tooltip":
380
- if (!customElements.get(tagName)) {
381
- defineCustomElement$3();
382
- }
383
- break;
384
- case "mg-tooltip-content":
385
- if (!customElements.get(tagName)) {
386
- defineCustomElement$2();
387
- }
388
- break;
389
- } });
365
+ if (typeof customElements === "undefined") {
366
+ return;
367
+ }
368
+ const components = ["mg-input-numeric", "mg-icon", "mg-input-title", "mg-tooltip", "mg-tooltip-content"];
369
+ components.forEach(tagName => { switch (tagName) {
370
+ case "mg-input-numeric":
371
+ if (!customElements.get(tagName)) {
372
+ customElements.define(tagName, MgInputNumeric$1);
373
+ }
374
+ break;
375
+ case "mg-icon":
376
+ if (!customElements.get(tagName)) {
377
+ defineCustomElement$5();
378
+ }
379
+ break;
380
+ case "mg-input-title":
381
+ if (!customElements.get(tagName)) {
382
+ defineCustomElement$4();
383
+ }
384
+ break;
385
+ case "mg-tooltip":
386
+ if (!customElements.get(tagName)) {
387
+ defineCustomElement$3();
388
+ }
389
+ break;
390
+ case "mg-tooltip-content":
391
+ if (!customElements.get(tagName)) {
392
+ defineCustomElement$2();
393
+ }
394
+ break;
395
+ } });
390
396
  }
391
397
  defineCustomElement$1();
392
398