@mgdis/mg-components 5.19.3 → 5.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (488) hide show
  1. package/dist/cjs/{components.utils-69435877.js → components.utils-cd908d4e.js} +102 -99
  2. package/dist/cjs/components.utils-cd908d4e.js.map +1 -0
  3. package/dist/cjs/{index-60dd0c56.js → index-8532b5e9.js} +185 -87
  4. package/dist/cjs/index-8532b5e9.js.map +1 -0
  5. package/dist/cjs/loader.cjs.js +2 -2
  6. package/dist/cjs/mg-action-more_34.cjs.entry.js +5115 -5110
  7. package/dist/cjs/mg-action-more_34.cjs.entry.js.map +1 -1
  8. package/dist/cjs/mg-components.cjs.js +3 -3
  9. package/dist/cjs/mg-components.cjs.js.map +1 -1
  10. package/dist/cjs/mg-item-more.cjs.entry.js +224 -224
  11. package/dist/cjs/mg-item-more.cjs.entry.js.map +1 -1
  12. package/dist/collection/assets/icons/index.js +192 -190
  13. package/dist/collection/assets/icons/index.js.map +1 -0
  14. package/dist/collection/collection-manifest.json +6 -6
  15. package/dist/collection/components/atoms/mg-badge/mg-badge.js +161 -161
  16. package/dist/collection/components/atoms/mg-badge/mg-badge.js.map +1 -1
  17. package/dist/collection/components/atoms/mg-button/mg-button.js +362 -362
  18. package/dist/collection/components/atoms/mg-button/mg-button.js.map +1 -1
  19. package/dist/collection/components/atoms/mg-card/mg-card.js +126 -126
  20. package/dist/collection/components/atoms/mg-card/mg-card.js.map +1 -1
  21. package/dist/collection/components/atoms/mg-character-left/mg-character-left.js +101 -101
  22. package/dist/collection/components/atoms/mg-character-left/mg-character-left.js.map +1 -1
  23. package/dist/collection/components/atoms/mg-divider/mg-divider.js +47 -47
  24. package/dist/collection/components/atoms/mg-divider/mg-divider.js.map +1 -1
  25. package/dist/collection/components/atoms/mg-icon/mg-icon.js +231 -231
  26. package/dist/collection/components/atoms/mg-icon/mg-icon.js.map +1 -1
  27. package/dist/collection/components/atoms/mg-input-title/mg-input-title.js +132 -132
  28. package/dist/collection/components/atoms/mg-input-title/mg-input-title.js.map +1 -1
  29. package/dist/collection/components/atoms/mg-tag/mg-tag.js +158 -158
  30. package/dist/collection/components/atoms/mg-tag/mg-tag.js.map +1 -1
  31. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.js +46 -46
  32. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.js.map +1 -1
  33. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.conf.js +3 -3
  34. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.conf.js.map +1 -1
  35. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +398 -398
  36. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js.map +1 -1
  37. package/dist/collection/components/molecules/inputs/MgInput.conf.js +2 -2
  38. package/dist/collection/components/molecules/inputs/MgInput.conf.js.map +1 -1
  39. package/dist/collection/components/molecules/inputs/MgInput.js +84 -84
  40. package/dist/collection/components/molecules/inputs/MgInput.js.map +1 -1
  41. package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js +8 -8
  42. package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js.map +1 -1
  43. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js +266 -266
  44. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js.map +1 -1
  45. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.js +4 -4
  46. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.js.map +1 -1
  47. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +788 -791
  48. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js.map +1 -1
  49. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.conf.js +4 -4
  50. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.conf.js.map +1 -1
  51. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +588 -578
  52. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js.map +1 -1
  53. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf.js +4 -4
  54. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf.js.map +1 -1
  55. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +778 -773
  56. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js.map +1 -1
  57. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +536 -526
  58. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js.map +1 -1
  59. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +565 -555
  60. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js.map +1 -1
  61. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +700 -695
  62. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js.map +1 -1
  63. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +770 -760
  64. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js.map +1 -1
  65. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +705 -695
  66. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js.map +1 -1
  67. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +527 -522
  68. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js.map +1 -1
  69. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.conf.js +2 -2
  70. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.conf.js.map +1 -1
  71. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js +263 -263
  72. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js.map +1 -1
  73. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.conf.js +6 -6
  74. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.conf.js.map +1 -1
  75. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js +423 -423
  76. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js.map +1 -1
  77. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +214 -214
  78. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js.map +1 -1
  79. package/dist/collection/components/molecules/mg-details/mg-details.js +155 -150
  80. package/dist/collection/components/molecules/mg-details/mg-details.js.map +1 -1
  81. package/dist/collection/components/molecules/mg-form/mg-form.js +332 -327
  82. package/dist/collection/components/molecules/mg-form/mg-form.js.map +1 -1
  83. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +85 -85
  84. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js.map +1 -1
  85. package/dist/collection/components/molecules/mg-item-more/mg-item-more.js +189 -189
  86. package/dist/collection/components/molecules/mg-item-more/mg-item-more.js.map +1 -1
  87. package/dist/collection/components/molecules/mg-message/mg-message.js +325 -304
  88. package/dist/collection/components/molecules/mg-message/mg-message.js.map +1 -1
  89. package/dist/collection/components/molecules/mg-modal/mg-modal.js +317 -317
  90. package/dist/collection/components/molecules/mg-modal/mg-modal.js.map +1 -1
  91. package/dist/collection/components/molecules/mg-pagination/mg-pagination.conf.js +2 -2
  92. package/dist/collection/components/molecules/mg-pagination/mg-pagination.conf.js.map +1 -1
  93. package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +216 -216
  94. package/dist/collection/components/molecules/mg-pagination/mg-pagination.js.map +1 -1
  95. package/dist/collection/components/molecules/mg-panel/mg-panel.js +409 -399
  96. package/dist/collection/components/molecules/mg-panel/mg-panel.js.map +1 -1
  97. package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js +91 -91
  98. package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js.map +1 -1
  99. package/dist/collection/components/molecules/mg-popover/mg-popover.js +336 -329
  100. package/dist/collection/components/molecules/mg-popover/mg-popover.js.map +1 -1
  101. package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +94 -94
  102. package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js.map +1 -1
  103. package/dist/collection/components/molecules/mg-tabs/mg-tabs.conf.js +4 -4
  104. package/dist/collection/components/molecules/mg-tabs/mg-tabs.conf.js.map +1 -1
  105. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +348 -343
  106. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js.map +1 -1
  107. package/dist/collection/locales/fr/messages.json +4 -4
  108. package/dist/collection/locales/index.spec.js +20 -20
  109. package/dist/collection/locales/index.spec.js.map +1 -1
  110. package/dist/collection/utils/behaviors.utils.js +127 -127
  111. package/dist/collection/utils/behaviors.utils.js.map +1 -1
  112. package/dist/collection/utils/behaviors.utils.spec.js +42 -42
  113. package/dist/collection/utils/behaviors.utils.spec.js.map +1 -1
  114. package/dist/collection/utils/components.utils.js +77 -75
  115. package/dist/collection/utils/components.utils.js.map +1 -1
  116. package/dist/collection/utils/components.utils.spec.js +150 -140
  117. package/dist/collection/utils/components.utils.spec.js.map +1 -1
  118. package/dist/collection/utils/e2e.test.utils.js +21 -21
  119. package/dist/collection/utils/e2e.test.utils.js.map +1 -1
  120. package/dist/collection/utils/locale.utils.js +17 -17
  121. package/dist/collection/utils/locale.utils.js.map +1 -1
  122. package/dist/collection/utils/locale.utils.spec.js +45 -45
  123. package/dist/collection/utils/locale.utils.spec.js.map +1 -1
  124. package/dist/collection/utils/playwright.e2e.test.utils.js +41 -41
  125. package/dist/collection/utils/playwright.e2e.test.utils.js.map +1 -1
  126. package/dist/collection/utils/playwright.fixture.js +24 -0
  127. package/dist/collection/utils/playwright.fixture.js.map +1 -0
  128. package/dist/collection/utils/unit.test.utils.js +50 -50
  129. package/dist/collection/utils/unit.test.utils.js.map +1 -1
  130. package/dist/components/MgInput.js +98 -98
  131. package/dist/components/MgInput.js.map +1 -1
  132. package/dist/components/components.utils.js +78 -76
  133. package/dist/components/components.utils.js.map +1 -1
  134. package/dist/components/index2.js +21 -21
  135. package/dist/components/index2.js.map +1 -1
  136. package/dist/components/mg-action-more.d.ts +2 -2
  137. package/dist/components/mg-action-more.js +173 -173
  138. package/dist/components/mg-action-more.js.map +1 -1
  139. package/dist/components/mg-badge.d.ts +2 -2
  140. package/dist/components/mg-badge2.js +83 -83
  141. package/dist/components/mg-badge2.js.map +1 -1
  142. package/dist/components/mg-button.d.ts +2 -2
  143. package/dist/components/mg-button2.js +182 -182
  144. package/dist/components/mg-button2.js.map +1 -1
  145. package/dist/components/mg-card.d.ts +2 -2
  146. package/dist/components/mg-card2.js +77 -77
  147. package/dist/components/mg-card2.js.map +1 -1
  148. package/dist/components/mg-character-left.d.ts +2 -2
  149. package/dist/components/mg-character-left2.js +50 -50
  150. package/dist/components/mg-character-left2.js.map +1 -1
  151. package/dist/components/mg-details.d.ts +2 -2
  152. package/dist/components/mg-details.js +69 -69
  153. package/dist/components/mg-details.js.map +1 -1
  154. package/dist/components/mg-divider.d.ts +2 -2
  155. package/dist/components/mg-divider.js +30 -30
  156. package/dist/components/mg-divider.js.map +1 -1
  157. package/dist/components/mg-form.d.ts +2 -2
  158. package/dist/components/mg-form.js +171 -171
  159. package/dist/components/mg-form.js.map +1 -1
  160. package/dist/components/mg-icon.d.ts +2 -2
  161. package/dist/components/mg-icon2.js +318 -316
  162. package/dist/components/mg-icon2.js.map +1 -1
  163. package/dist/components/mg-illustrated-message.d.ts +2 -2
  164. package/dist/components/mg-illustrated-message.js +51 -51
  165. package/dist/components/mg-illustrated-message.js.map +1 -1
  166. package/dist/components/mg-input-checkbox-paginated.d.ts +2 -2
  167. package/dist/components/mg-input-checkbox-paginated2.js +170 -170
  168. package/dist/components/mg-input-checkbox-paginated2.js.map +1 -1
  169. package/dist/components/mg-input-checkbox.d.ts +2 -2
  170. package/dist/components/mg-input-checkbox.js +477 -480
  171. package/dist/components/mg-input-checkbox.js.map +1 -1
  172. package/dist/components/mg-input-date.d.ts +2 -2
  173. package/dist/components/mg-input-date.js +265 -265
  174. package/dist/components/mg-input-date.js.map +1 -1
  175. package/dist/components/mg-input-numeric.d.ts +2 -2
  176. package/dist/components/mg-input-numeric.js +353 -353
  177. package/dist/components/mg-input-numeric.js.map +1 -1
  178. package/dist/components/mg-input-password.d.ts +2 -2
  179. package/dist/components/mg-input-password.js +204 -204
  180. package/dist/components/mg-input-password.js.map +1 -1
  181. package/dist/components/mg-input-radio.d.ts +2 -2
  182. package/dist/components/mg-input-radio.js +234 -234
  183. package/dist/components/mg-input-radio.js.map +1 -1
  184. package/dist/components/mg-input-select.d.ts +2 -2
  185. package/dist/components/mg-input-select2.js +315 -315
  186. package/dist/components/mg-input-select2.js.map +1 -1
  187. package/dist/components/mg-input-text.d.ts +2 -2
  188. package/dist/components/mg-input-text2.js +305 -305
  189. package/dist/components/mg-input-text2.js.map +1 -1
  190. package/dist/components/mg-input-textarea.d.ts +2 -2
  191. package/dist/components/mg-input-textarea.js +276 -276
  192. package/dist/components/mg-input-textarea.js.map +1 -1
  193. package/dist/components/mg-input-title.d.ts +2 -2
  194. package/dist/components/mg-input-title2.js +60 -60
  195. package/dist/components/mg-input-title2.js.map +1 -1
  196. package/dist/components/mg-input-toggle.d.ts +2 -2
  197. package/dist/components/mg-input-toggle.js +251 -251
  198. package/dist/components/mg-input-toggle.js.map +1 -1
  199. package/dist/components/mg-item-more.d.ts +2 -2
  200. package/dist/components/mg-item-more.js +285 -285
  201. package/dist/components/mg-item-more.js.map +1 -1
  202. package/dist/components/mg-menu-item.d.ts +2 -2
  203. package/dist/components/mg-menu-item2.js +344 -344
  204. package/dist/components/mg-menu-item2.js.map +1 -1
  205. package/dist/components/mg-menu.conf.js +2 -2
  206. package/dist/components/mg-menu.conf.js.map +1 -1
  207. package/dist/components/mg-menu.d.ts +2 -2
  208. package/dist/components/mg-menu2.js +176 -176
  209. package/dist/components/mg-menu2.js.map +1 -1
  210. package/dist/components/mg-message.d.ts +2 -2
  211. package/dist/components/mg-message.js +197 -192
  212. package/dist/components/mg-message.js.map +1 -1
  213. package/dist/components/mg-modal.d.ts +2 -2
  214. package/dist/components/mg-modal.js +198 -198
  215. package/dist/components/mg-modal.js.map +1 -1
  216. package/dist/components/mg-pagination.d.ts +2 -2
  217. package/dist/components/mg-pagination2.js +133 -133
  218. package/dist/components/mg-pagination2.js.map +1 -1
  219. package/dist/components/mg-panel.d.ts +2 -2
  220. package/dist/components/mg-panel.js +238 -238
  221. package/dist/components/mg-panel.js.map +1 -1
  222. package/dist/components/mg-popover-content.d.ts +2 -2
  223. package/dist/components/mg-popover-content2.js +69 -69
  224. package/dist/components/mg-popover-content2.js.map +1 -1
  225. package/dist/components/mg-popover.d.ts +2 -2
  226. package/dist/components/mg-popover2.js +224 -222
  227. package/dist/components/mg-popover2.js.map +1 -1
  228. package/dist/components/mg-skip-links.d.ts +2 -2
  229. package/dist/components/mg-skip-links.js +57 -57
  230. package/dist/components/mg-skip-links.js.map +1 -1
  231. package/dist/components/mg-tabs.d.ts +2 -2
  232. package/dist/components/mg-tabs.js +243 -243
  233. package/dist/components/mg-tabs.js.map +1 -1
  234. package/dist/components/mg-tag.d.ts +2 -2
  235. package/dist/components/mg-tag.js +97 -97
  236. package/dist/components/mg-tag.js.map +1 -1
  237. package/dist/components/mg-tooltip-content.d.ts +2 -2
  238. package/dist/components/mg-tooltip-content2.js +30 -30
  239. package/dist/components/mg-tooltip-content2.js.map +1 -1
  240. package/dist/components/mg-tooltip.d.ts +2 -2
  241. package/dist/components/mg-tooltip2.js +316 -316
  242. package/dist/components/mg-tooltip2.js.map +1 -1
  243. package/dist/esm/{components.utils-6cf27db1.js → components.utils-0d67c31c.js} +102 -100
  244. package/dist/esm/components.utils-0d67c31c.js.map +1 -0
  245. package/dist/esm/{index-0f833068.js → index-f34a3a2c.js} +185 -87
  246. package/dist/esm/index-f34a3a2c.js.map +1 -0
  247. package/dist/esm/loader.js +3 -3
  248. package/dist/esm/mg-action-more_34.entry.js +5115 -5110
  249. package/dist/esm/mg-action-more_34.entry.js.map +1 -1
  250. package/dist/esm/mg-components.js +4 -4
  251. package/dist/esm/mg-components.js.map +1 -1
  252. package/dist/esm/mg-item-more.entry.js +224 -224
  253. package/dist/esm/mg-item-more.entry.js.map +1 -1
  254. package/dist/mg-components/locales/fr/messages.json +4 -4
  255. package/dist/mg-components/mg-components.esm.js +1 -1
  256. package/dist/mg-components/mg-components.esm.js.map +1 -1
  257. package/dist/mg-components/p-629454f7.entry.js +2 -0
  258. package/dist/mg-components/p-629454f7.entry.js.map +1 -0
  259. package/dist/mg-components/p-7444ff40.js +3 -0
  260. package/dist/mg-components/p-7444ff40.js.map +1 -0
  261. package/dist/mg-components/p-af42d17b.js +2 -0
  262. package/dist/mg-components/p-af42d17b.js.map +1 -0
  263. package/dist/mg-components/{p-91feda5a.entry.js → p-e0fb0f3c.entry.js} +2 -2
  264. package/dist/types/assets/icons/index.d.ts +193 -0
  265. package/dist/types/components/atoms/mg-badge/mg-badge.d.ts +41 -41
  266. package/dist/types/components/atoms/mg-button/mg-button.d.ts +100 -100
  267. package/dist/types/components/atoms/mg-card/mg-card.d.ts +39 -39
  268. package/dist/types/components/atoms/mg-character-left/mg-character-left.d.ts +37 -37
  269. package/dist/types/components/atoms/mg-divider/mg-divider.d.ts +12 -12
  270. package/dist/types/components/atoms/mg-icon/mg-icon.d.ts +56 -56
  271. package/dist/types/components/atoms/mg-input-title/mg-input-title.d.ts +34 -34
  272. package/dist/types/components/atoms/mg-tag/mg-tag.d.ts +51 -51
  273. package/dist/types/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.d.ts +12 -12
  274. package/dist/types/components/atoms/mg-tooltip/mg-tooltip.conf.d.ts +3 -3
  275. package/dist/types/components/atoms/mg-tooltip/mg-tooltip.d.ts +113 -113
  276. package/dist/types/components/molecules/inputs/MgInput.conf.d.ts +5 -5
  277. package/dist/types/components/molecules/inputs/MgInput.d.ts +16 -16
  278. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.d.ts +100 -100
  279. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.d.ts +26 -26
  280. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +262 -262
  281. package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.conf.d.ts +4 -4
  282. package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.d.ts +150 -150
  283. package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf.d.ts +4 -4
  284. package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +223 -223
  285. package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.d.ts +142 -142
  286. package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.conf.d.ts +3 -3
  287. package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +152 -152
  288. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.conf.d.ts +6 -6
  289. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +193 -193
  290. package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +195 -195
  291. package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +181 -181
  292. package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.conf.d.ts +2 -2
  293. package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +141 -141
  294. package/dist/types/components/molecules/menu/mg-menu/mg-menu.conf.d.ts +2 -2
  295. package/dist/types/components/molecules/menu/mg-menu/mg-menu.d.ts +97 -97
  296. package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.conf.d.ts +6 -6
  297. package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.d.ts +179 -179
  298. package/dist/types/components/molecules/mg-action-more/mg-action-more.conf.d.ts +12 -12
  299. package/dist/types/components/molecules/mg-action-more/mg-action-more.d.ts +72 -72
  300. package/dist/types/components/molecules/mg-details/mg-details.d.ts +45 -45
  301. package/dist/types/components/molecules/mg-form/mg-form.d.ts +103 -103
  302. package/dist/types/components/molecules/mg-illustrated-message/mg-illustrated-message.d.ts +27 -27
  303. package/dist/types/components/molecules/mg-item-more/mg-item-more.conf.d.ts +5 -5
  304. package/dist/types/components/molecules/mg-item-more/mg-item-more.d.ts +61 -61
  305. package/dist/types/components/molecules/mg-message/mg-message.d.ts +100 -93
  306. package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +107 -107
  307. package/dist/types/components/molecules/mg-pagination/mg-pagination.conf.d.ts +2 -2
  308. package/dist/types/components/molecules/mg-pagination/mg-pagination.d.ts +74 -74
  309. package/dist/types/components/molecules/mg-panel/mg-panel.d.ts +149 -149
  310. package/dist/types/components/molecules/mg-popover/mg-popover-content/mg-popover-content.d.ts +43 -43
  311. package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +88 -88
  312. package/dist/types/components/molecules/mg-skip-links/mg-skip-links.conf.d.ts +2 -2
  313. package/dist/types/components/molecules/mg-skip-links/mg-skip-links.d.ts +40 -40
  314. package/dist/types/components/molecules/mg-tabs/mg-tabs.conf.d.ts +10 -10
  315. package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +118 -118
  316. package/dist/types/components.d.ts +294 -30
  317. package/dist/types/locales/index.d.ts +172 -172
  318. package/dist/types/stencil-public-runtime.d.ts +29 -0
  319. package/dist/types/utils/behaviors.utils.d.ts +65 -65
  320. package/dist/types/utils/components.utils.d.ts +32 -26
  321. package/dist/types/utils/locale.utils.d.ts +2 -2
  322. package/dist/types/utils/playwright.fixture.d.ts +3 -0
  323. package/dist/types/utils/unit.test.utils.d.ts +5 -5
  324. package/package.json +18 -32
  325. package/dist/cjs/components.utils-69435877.js.map +0 -1
  326. package/dist/cjs/index-60dd0c56.js.map +0 -1
  327. package/dist/collection/components/atoms/mg-badge/test/mg-badge.e2e.playwright.js +0 -33
  328. package/dist/collection/components/atoms/mg-badge/test/mg-badge.e2e.playwright.js.map +0 -1
  329. package/dist/collection/components/atoms/mg-badge/test/mg-badge.spec.js +0 -70
  330. package/dist/collection/components/atoms/mg-badge/test/mg-badge.spec.js.map +0 -1
  331. package/dist/collection/components/atoms/mg-button/test/mg-button.e2e.js +0 -91
  332. package/dist/collection/components/atoms/mg-button/test/mg-button.e2e.js.map +0 -1
  333. package/dist/collection/components/atoms/mg-button/test/mg-button.spec.js +0 -192
  334. package/dist/collection/components/atoms/mg-button/test/mg-button.spec.js.map +0 -1
  335. package/dist/collection/components/atoms/mg-card/test/mg-card.e2e.js +0 -36
  336. package/dist/collection/components/atoms/mg-card/test/mg-card.e2e.js.map +0 -1
  337. package/dist/collection/components/atoms/mg-card/test/mg-card.spec.js +0 -43
  338. package/dist/collection/components/atoms/mg-card/test/mg-card.spec.js.map +0 -1
  339. package/dist/collection/components/atoms/mg-character-left/test/mg-character-left.e2e.js +0 -15
  340. package/dist/collection/components/atoms/mg-character-left/test/mg-character-left.e2e.js.map +0 -1
  341. package/dist/collection/components/atoms/mg-character-left/test/mg-character-left.spec.js +0 -42
  342. package/dist/collection/components/atoms/mg-character-left/test/mg-character-left.spec.js.map +0 -1
  343. package/dist/collection/components/atoms/mg-divider/test/mg-divider.e2e.js +0 -11
  344. package/dist/collection/components/atoms/mg-divider/test/mg-divider.e2e.js.map +0 -1
  345. package/dist/collection/components/atoms/mg-divider/test/mg-divider.spec.js +0 -14
  346. package/dist/collection/components/atoms/mg-divider/test/mg-divider.spec.js.map +0 -1
  347. package/dist/collection/components/atoms/mg-icon/test/mg-icon.e2e.js +0 -55
  348. package/dist/collection/components/atoms/mg-icon/test/mg-icon.e2e.js.map +0 -1
  349. package/dist/collection/components/atoms/mg-icon/test/mg-icon.spec.js +0 -84
  350. package/dist/collection/components/atoms/mg-icon/test/mg-icon.spec.js.map +0 -1
  351. package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.e2e.playwright.js +0 -12
  352. package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.e2e.playwright.js.map +0 -1
  353. package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.spec.js +0 -23
  354. package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.spec.js.map +0 -1
  355. package/dist/collection/components/atoms/mg-tag/test/mg-tag.e2e.playwright.js +0 -23
  356. package/dist/collection/components/atoms/mg-tag/test/mg-tag.e2e.playwright.js.map +0 -1
  357. package/dist/collection/components/atoms/mg-tag/test/mg-tag.spec.js +0 -71
  358. package/dist/collection/components/atoms/mg-tag/test/mg-tag.spec.js.map +0 -1
  359. package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.e2e.js +0 -138
  360. package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.e2e.js.map +0 -1
  361. package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.spec.js +0 -272
  362. package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.spec.js.map +0 -1
  363. package/dist/collection/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.e2e.playwright.js +0 -237
  364. package/dist/collection/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.e2e.playwright.js.map +0 -1
  365. package/dist/collection/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.spec.js +0 -634
  366. package/dist/collection/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.spec.js.map +0 -1
  367. package/dist/collection/components/molecules/inputs/mg-input-date/test/mg-input-date.e2e.js +0 -123
  368. package/dist/collection/components/molecules/inputs/mg-input-date/test/mg-input-date.e2e.js.map +0 -1
  369. package/dist/collection/components/molecules/inputs/mg-input-date/test/mg-input-date.spec.js +0 -383
  370. package/dist/collection/components/molecules/inputs/mg-input-date/test/mg-input-date.spec.js.map +0 -1
  371. package/dist/collection/components/molecules/inputs/mg-input-numeric/test/mg-input-numeric.e2e.js +0 -212
  372. package/dist/collection/components/molecules/inputs/mg-input-numeric/test/mg-input-numeric.e2e.js.map +0 -1
  373. package/dist/collection/components/molecules/inputs/mg-input-numeric/test/mg-input-numeric.spec.js +0 -460
  374. package/dist/collection/components/molecules/inputs/mg-input-numeric/test/mg-input-numeric.spec.js.map +0 -1
  375. package/dist/collection/components/molecules/inputs/mg-input-password/test/mg-input-password.e2e.js +0 -115
  376. package/dist/collection/components/molecules/inputs/mg-input-password/test/mg-input-password.e2e.js.map +0 -1
  377. package/dist/collection/components/molecules/inputs/mg-input-password/test/mg-input-password.spec.js +0 -293
  378. package/dist/collection/components/molecules/inputs/mg-input-password/test/mg-input-password.spec.js.map +0 -1
  379. package/dist/collection/components/molecules/inputs/mg-input-radio/test/mg-input-radio.e2e.js +0 -154
  380. package/dist/collection/components/molecules/inputs/mg-input-radio/test/mg-input-radio.e2e.js.map +0 -1
  381. package/dist/collection/components/molecules/inputs/mg-input-radio/test/mg-input-radio.spec.js +0 -359
  382. package/dist/collection/components/molecules/inputs/mg-input-radio/test/mg-input-radio.spec.js.map +0 -1
  383. package/dist/collection/components/molecules/inputs/mg-input-select/test/mg-input-select.e2e.js +0 -194
  384. package/dist/collection/components/molecules/inputs/mg-input-select/test/mg-input-select.e2e.js.map +0 -1
  385. package/dist/collection/components/molecules/inputs/mg-input-select/test/mg-input-select.spec.js +0 -403
  386. package/dist/collection/components/molecules/inputs/mg-input-select/test/mg-input-select.spec.js.map +0 -1
  387. package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.e2e.playwright.js +0 -147
  388. package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.e2e.playwright.js.map +0 -1
  389. package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.spec.js +0 -355
  390. package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.spec.js.map +0 -1
  391. package/dist/collection/components/molecules/inputs/mg-input-textarea/test/mg-input-textarea.e2e.js +0 -129
  392. package/dist/collection/components/molecules/inputs/mg-input-textarea/test/mg-input-textarea.e2e.js.map +0 -1
  393. package/dist/collection/components/molecules/inputs/mg-input-textarea/test/mg-input-textarea.spec.js +0 -320
  394. package/dist/collection/components/molecules/inputs/mg-input-textarea/test/mg-input-textarea.spec.js.map +0 -1
  395. package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.e2e.playwright.js +0 -108
  396. package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.e2e.playwright.js.map +0 -1
  397. package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.spec.js +0 -247
  398. package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.spec.js.map +0 -1
  399. package/dist/collection/components/molecules/menu/mg-menu/test/mg-menu.e2e.playwright.js +0 -239
  400. package/dist/collection/components/molecules/menu/mg-menu/test/mg-menu.e2e.playwright.js.map +0 -1
  401. package/dist/collection/components/molecules/menu/mg-menu/test/mg-menu.spec.js +0 -175
  402. package/dist/collection/components/molecules/menu/mg-menu/test/mg-menu.spec.js.map +0 -1
  403. package/dist/collection/components/molecules/menu/mg-menu-item/test/mg-menu-item.e2e.playwright.js +0 -100
  404. package/dist/collection/components/molecules/menu/mg-menu-item/test/mg-menu-item.e2e.playwright.js.map +0 -1
  405. package/dist/collection/components/molecules/menu/mg-menu-item/test/mg-menu-item.spec.js +0 -295
  406. package/dist/collection/components/molecules/menu/mg-menu-item/test/mg-menu-item.spec.js.map +0 -1
  407. package/dist/collection/components/molecules/mg-action-more/test/mg-action-more.e2e.playwright.js +0 -136
  408. package/dist/collection/components/molecules/mg-action-more/test/mg-action-more.e2e.playwright.js.map +0 -1
  409. package/dist/collection/components/molecules/mg-action-more/test/mg-action-more.spec.js +0 -195
  410. package/dist/collection/components/molecules/mg-action-more/test/mg-action-more.spec.js.map +0 -1
  411. package/dist/collection/components/molecules/mg-details/test/mg-details.e2e.playwright.js +0 -30
  412. package/dist/collection/components/molecules/mg-details/test/mg-details.e2e.playwright.js.map +0 -1
  413. package/dist/collection/components/molecules/mg-details/test/mg-details.spec.js +0 -42
  414. package/dist/collection/components/molecules/mg-details/test/mg-details.spec.js.map +0 -1
  415. package/dist/collection/components/molecules/mg-form/test/mg-form.e2e.js +0 -169
  416. package/dist/collection/components/molecules/mg-form/test/mg-form.e2e.js.map +0 -1
  417. package/dist/collection/components/molecules/mg-form/test/mg-form.spec.js +0 -292
  418. package/dist/collection/components/molecules/mg-form/test/mg-form.spec.js.map +0 -1
  419. package/dist/collection/components/molecules/mg-illustrated-message/test/mg-illustrated-message.e2e.js +0 -39
  420. package/dist/collection/components/molecules/mg-illustrated-message/test/mg-illustrated-message.e2e.js.map +0 -1
  421. package/dist/collection/components/molecules/mg-illustrated-message/test/mg-illustrated-message.spec.js +0 -36
  422. package/dist/collection/components/molecules/mg-illustrated-message/test/mg-illustrated-message.spec.js.map +0 -1
  423. package/dist/collection/components/molecules/mg-item-more/test/mg-item-more.e2e.playwright.js +0 -85
  424. package/dist/collection/components/molecules/mg-item-more/test/mg-item-more.e2e.playwright.js.map +0 -1
  425. package/dist/collection/components/molecules/mg-item-more/test/mg-item-more.spec.js +0 -106
  426. package/dist/collection/components/molecules/mg-item-more/test/mg-item-more.spec.js.map +0 -1
  427. package/dist/collection/components/molecules/mg-message/test/mg-message.e2e.js +0 -64
  428. package/dist/collection/components/molecules/mg-message/test/mg-message.e2e.js.map +0 -1
  429. package/dist/collection/components/molecules/mg-message/test/mg-message.spec.js +0 -109
  430. package/dist/collection/components/molecules/mg-message/test/mg-message.spec.js.map +0 -1
  431. package/dist/collection/components/molecules/mg-modal/test/mg-modal.e2e.playwright.js +0 -62
  432. package/dist/collection/components/molecules/mg-modal/test/mg-modal.e2e.playwright.js.map +0 -1
  433. package/dist/collection/components/molecules/mg-modal/test/mg-modal.e2e.template.js +0 -40
  434. package/dist/collection/components/molecules/mg-modal/test/mg-modal.e2e.template.js.map +0 -1
  435. package/dist/collection/components/molecules/mg-modal/test/mg-modal.firefox.e2e.playwright.js +0 -26
  436. package/dist/collection/components/molecules/mg-modal/test/mg-modal.firefox.e2e.playwright.js.map +0 -1
  437. package/dist/collection/components/molecules/mg-modal/test/mg-modal.spec.js +0 -122
  438. package/dist/collection/components/molecules/mg-modal/test/mg-modal.spec.js.map +0 -1
  439. package/dist/collection/components/molecules/mg-pagination/test/mg-pagination.e2e.playwright.js +0 -57
  440. package/dist/collection/components/molecules/mg-pagination/test/mg-pagination.e2e.playwright.js.map +0 -1
  441. package/dist/collection/components/molecules/mg-pagination/test/mg-pagination.spec.js +0 -121
  442. package/dist/collection/components/molecules/mg-pagination/test/mg-pagination.spec.js.map +0 -1
  443. package/dist/collection/components/molecules/mg-panel/test/mg-panel.e2e.playwright.js +0 -106
  444. package/dist/collection/components/molecules/mg-panel/test/mg-panel.e2e.playwright.js.map +0 -1
  445. package/dist/collection/components/molecules/mg-panel/test/mg-panel.spec.js +0 -213
  446. package/dist/collection/components/molecules/mg-panel/test/mg-panel.spec.js.map +0 -1
  447. package/dist/collection/components/molecules/mg-popover/test/mg-popover.e2e.playwright.js +0 -140
  448. package/dist/collection/components/molecules/mg-popover/test/mg-popover.e2e.playwright.js.map +0 -1
  449. package/dist/collection/components/molecules/mg-popover/test/mg-popover.spec.js +0 -142
  450. package/dist/collection/components/molecules/mg-popover/test/mg-popover.spec.js.map +0 -1
  451. package/dist/collection/components/molecules/mg-skip-links/test/mg-skip-links.e2e.js +0 -55
  452. package/dist/collection/components/molecules/mg-skip-links/test/mg-skip-links.e2e.js.map +0 -1
  453. package/dist/collection/components/molecules/mg-skip-links/test/mg-skip-links.spec.js +0 -55
  454. package/dist/collection/components/molecules/mg-skip-links/test/mg-skip-links.spec.js.map +0 -1
  455. package/dist/collection/components/molecules/mg-tabs/test/mg-tabs.e2e.playwright.js +0 -76
  456. package/dist/collection/components/molecules/mg-tabs/test/mg-tabs.e2e.playwright.js.map +0 -1
  457. package/dist/collection/components/molecules/mg-tabs/test/mg-tabs.spec.js +0 -332
  458. package/dist/collection/components/molecules/mg-tabs/test/mg-tabs.spec.js.map +0 -1
  459. package/dist/collection/utils/stencil.e2e.test.utils.js +0 -33
  460. package/dist/collection/utils/stencil.e2e.test.utils.js.map +0 -1
  461. package/dist/esm/components.utils-6cf27db1.js.map +0 -1
  462. package/dist/esm/index-0f833068.js.map +0 -1
  463. package/dist/mg-components/p-10ed4425.entry.js +0 -2
  464. package/dist/mg-components/p-10ed4425.entry.js.map +0 -1
  465. package/dist/mg-components/p-36a51c5e.js +0 -2
  466. package/dist/mg-components/p-36a51c5e.js.map +0 -1
  467. package/dist/mg-components/p-9b12021b.js +0 -3
  468. package/dist/mg-components/p-9b12021b.js.map +0 -1
  469. package/dist/types/components/atoms/mg-badge/test/mg-badge.e2e.playwright.d.ts +0 -1
  470. package/dist/types/components/atoms/mg-input-title/test/mg-input-title.e2e.playwright.d.ts +0 -1
  471. package/dist/types/components/atoms/mg-tag/test/mg-tag.e2e.playwright.d.ts +0 -1
  472. package/dist/types/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.e2e.playwright.d.ts +0 -1
  473. package/dist/types/components/molecules/inputs/mg-input-text/test/mg-input-text.e2e.playwright.d.ts +0 -1
  474. package/dist/types/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.e2e.playwright.d.ts +0 -1
  475. package/dist/types/components/molecules/menu/mg-menu/test/mg-menu.e2e.playwright.d.ts +0 -1
  476. package/dist/types/components/molecules/menu/mg-menu-item/test/mg-menu-item.e2e.playwright.d.ts +0 -1
  477. package/dist/types/components/molecules/mg-action-more/test/mg-action-more.e2e.playwright.d.ts +0 -2
  478. package/dist/types/components/molecules/mg-details/test/mg-details.e2e.playwright.d.ts +0 -1
  479. package/dist/types/components/molecules/mg-item-more/test/mg-item-more.e2e.playwright.d.ts +0 -1
  480. package/dist/types/components/molecules/mg-modal/test/mg-modal.e2e.playwright.d.ts +0 -1
  481. package/dist/types/components/molecules/mg-modal/test/mg-modal.e2e.template.d.ts +0 -12
  482. package/dist/types/components/molecules/mg-modal/test/mg-modal.firefox.e2e.playwright.d.ts +0 -1
  483. package/dist/types/components/molecules/mg-pagination/test/mg-pagination.e2e.playwright.d.ts +0 -1
  484. package/dist/types/components/molecules/mg-panel/test/mg-panel.e2e.playwright.d.ts +0 -1
  485. package/dist/types/components/molecules/mg-popover/test/mg-popover.e2e.playwright.d.ts +0 -1
  486. package/dist/types/components/molecules/mg-tabs/test/mg-tabs.e2e.playwright.d.ts +0 -1
  487. package/dist/types/utils/stencil.e2e.test.utils.d.ts +0 -14
  488. /package/dist/mg-components/{p-91feda5a.entry.js.map → p-e0fb0f3c.entry.js.map} +0 -0
@@ -5,786 +5,796 @@ import { ClassList, isValidString } from "../../../../utils/components.utils";
5
5
  import { initLocales } from "../../../../locales";
6
6
  const isDatalistOption = (options) => Array.isArray(options) && options.every(option => typeof option === 'string');
7
7
  export class MgInputText {
8
- constructor() {
9
- /************
10
- * Internal *
11
- ************/
12
- // Classes
13
- this.classFocus = 'mg-u-is-focused';
14
- this.classIsInputGroupAppend = 'mg-c-input--is-input-group-append';
15
- this.classHasIcon = 'mg-c-input--has-icon';
16
- // hasDisplayedError (triggered by blur event)
17
- this.hasDisplayedError = false;
18
- /**
19
- * Handle input event
20
- */
21
- this.handleInput = () => {
22
- this.checkValidity();
23
- if (this.hasDisplayedError) {
24
- this.setErrorMessage();
25
- }
26
- this.value = this.input.value;
27
- };
8
+ constructor() {
9
+ /************
10
+ * Internal *
11
+ ************/
12
+ // Classes
13
+ this.classFocus = 'mg-u-is-focused';
14
+ this.classIsInputGroupAppend = 'mg-c-input--is-input-group-append';
15
+ this.classHasIcon = 'mg-c-input--has-icon';
16
+ // hasDisplayedError (triggered by blur event)
17
+ this.hasDisplayedError = false;
18
+ /**
19
+ * Handle input event
20
+ */
21
+ this.handleInput = () => {
22
+ this.checkValidity();
23
+ if (this.hasDisplayedError) {
24
+ this.setErrorMessage();
25
+ }
26
+ this.value = this.input.value;
27
+ };
28
+ /**
29
+ * Handle focus event
30
+ */
31
+ this.handleFocus = () => {
32
+ this.classCollection.add(this.classFocus);
33
+ this.classCollection = new ClassList(this.classCollection.classes);
34
+ };
35
+ /**
36
+ * Handle blur event
37
+ */
38
+ this.handleBlur = () => {
39
+ // Manage focus
40
+ this.classCollection.delete(this.classFocus);
41
+ this.classCollection = new ClassList(this.classCollection.classes);
42
+ // Display Error
43
+ this.handlerInProgress = Handler.BLUR;
44
+ this.displayError().finally(() => {
45
+ // reset guard
46
+ this.handlerInProgress = undefined;
47
+ });
48
+ };
49
+ /**
50
+ * Check if input is valid
51
+ */
52
+ this.checkValidity = () => {
53
+ var _a;
54
+ this.setValidity(this.readonly || this.disabled || (((_a = this.input) === null || _a === void 0 ? void 0 : _a.checkValidity) !== undefined ? this.input.checkValidity() : true));
55
+ };
56
+ /**
57
+ * Set input error message
58
+ * @param errorMessage - errorMessage override
59
+ */
60
+ this.setErrorMessage = (errorMessage) => {
61
+ // Set error message
62
+ this.errorMessage = undefined;
63
+ // Does have a custom error message
64
+ if (!this.valid && errorMessage !== undefined) {
65
+ this.errorMessage = errorMessage;
66
+ }
67
+ // Does not match pattern
68
+ else if (!this.valid && this.input.validity.patternMismatch) {
69
+ this.errorMessage = this.patternErrorMessage;
70
+ }
71
+ // required
72
+ else if (!this.valid && this.input.validity.valueMissing) {
73
+ this.errorMessage = this.messages.errors.required;
74
+ }
75
+ };
76
+ /**
77
+ * Validate append slot
78
+ */
79
+ this.validateAppendSlot = () => {
80
+ const slotAppendInput = Array.from(this.element.querySelectorAll('[slot="append-input"]'));
81
+ if (slotAppendInput.length === 1) {
82
+ this.classCollection.add(slotAppendInput[0].nodeName === 'MG-BUTTON' ? this.classIsInputGroupAppend : 'mg-c-input--is-append-input-slot-content');
83
+ }
84
+ else if (slotAppendInput.filter(slot => slot.nodeName === 'MG-BUTTON').length > 1) {
85
+ this.classCollection.add(this.classIsInputGroupAppend);
86
+ this.classCollection.add('mg-c-input--has-buttons-group-append');
87
+ }
88
+ };
89
+ /**
90
+ * Methode to control datalist display condition
91
+ * @returns true if display condition success
92
+ */
93
+ this.hasDatalist = () => isDatalistOption(this.datalistoptions) && this.datalistoptions.length > 0;
94
+ this.value = undefined;
95
+ this.identifier = undefined;
96
+ this.name = this.identifier;
97
+ this.label = undefined;
98
+ this.type = 'text';
99
+ this.icon = undefined;
100
+ this.labelOnTop = undefined;
101
+ this.labelHide = false;
102
+ this.placeholder = undefined;
103
+ this.datalistoptions = undefined;
104
+ this.maxlength = 400;
105
+ this.required = false;
106
+ this.readonly = false;
107
+ this.disabled = false;
108
+ this.mgWidth = 'full';
109
+ this.pattern = undefined;
110
+ this.patternErrorMessage = undefined;
111
+ this.tooltip = undefined;
112
+ this.displayCharacterLeft = true;
113
+ this.helpText = undefined;
114
+ this.valid = undefined;
115
+ this.invalid = undefined;
116
+ this.classCollection = new ClassList(['mg-c-input--text']);
117
+ this.errorMessage = undefined;
118
+ }
119
+ handleValue(newValue) {
120
+ this.valueChange.emit(newValue);
121
+ }
122
+ validateIcon(newValue) {
123
+ if (newValue !== undefined) {
124
+ this.classCollection.add(this.classHasIcon);
125
+ }
126
+ else {
127
+ this.classCollection.delete(this.classHasIcon);
128
+ }
129
+ }
130
+ validateDatalistoptions(newValue) {
131
+ if (Boolean(newValue) && !isDatalistOption(newValue)) {
132
+ throw new Error('<mg-input-text> prop "datalistoptions" values must be the same type, string.');
133
+ }
134
+ }
135
+ handleValidityChange(newValue, _oldValue, prop) {
136
+ if (this.input !== undefined) {
137
+ this.input[prop] = newValue;
138
+ this.checkValidity();
139
+ if (this.hasDisplayedError) {
140
+ this.setErrorMessage();
141
+ this.hasDisplayedError = false;
142
+ }
143
+ }
144
+ }
145
+ validatePattern(newValue) {
146
+ if (newValue !== undefined && !(isValidString(this.pattern) && isValidString(this.patternErrorMessage))) {
147
+ throw new Error('<mg-input-text> props "pattern" and "patternErrorMessage" must be non-empty string and paired.');
148
+ }
149
+ }
28
150
  /**
29
- * Handle focus event
151
+ * Public method to play input focus
30
152
  */
31
- this.handleFocus = () => {
32
- this.classCollection.add(this.classFocus);
33
- this.classCollection = new ClassList(this.classCollection.classes);
34
- };
153
+ async setFocus() {
154
+ this.input.focus();
155
+ }
35
156
  /**
36
- * Handle blur event
157
+ * Display input error if it exists.
37
158
  */
38
- this.handleBlur = () => {
39
- // Manage focus
40
- this.classCollection.delete(this.classFocus);
41
- this.classCollection = new ClassList(this.classCollection.classes);
42
- // Display Error
43
- this.handlerInProgress = Handler.BLUR;
44
- this.displayError().finally(() => {
45
- // reset guard
46
- this.handlerInProgress = undefined;
47
- });
48
- };
159
+ async displayError() {
160
+ this.checkValidity();
161
+ this.setErrorMessage();
162
+ this.hasDisplayedError = this.invalid;
163
+ }
49
164
  /**
50
- * Check if input is valid
165
+ * Set an error and display a custom error message.
166
+ * This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.
167
+ * It must be paired with an error message to display for the given context.
168
+ * When used to set validity to `false`, you should use this method again to reset the validity to `true`.
169
+ * @param valid - value indicating the validity
170
+ * @param errorMessage - the error message to display
51
171
  */
52
- this.checkValidity = () => {
53
- var _a;
54
- this.setValidity(this.readonly || this.disabled || (((_a = this.input) === null || _a === void 0 ? void 0 : _a.checkValidity) !== undefined ? this.input.checkValidity() : true));
55
- };
172
+ async setError(valid, errorMessage) {
173
+ if (typeof valid !== 'boolean') {
174
+ throw new Error('<mg-input-text> method "setError()" param "valid" must be a boolean');
175
+ }
176
+ else if (!isValidString(errorMessage)) {
177
+ throw new Error('<mg-input-text> method "setError()" param "errorMessage" must be a string');
178
+ }
179
+ else {
180
+ this.setValidity(valid);
181
+ this.setErrorMessage(valid ? undefined : errorMessage);
182
+ this.hasDisplayedError = this.invalid;
183
+ }
184
+ }
56
185
  /**
57
- * Set input error message
58
- * @param errorMessage - errorMessage override
186
+ * Method to set validity values
187
+ * @param newValue - valid new value
59
188
  */
60
- this.setErrorMessage = (errorMessage) => {
61
- // Set error message
62
- this.errorMessage = undefined;
63
- // Does have a custom error message
64
- if (!this.valid && errorMessage !== undefined) {
65
- this.errorMessage = errorMessage;
66
- }
67
- // Does not match pattern
68
- else if (!this.valid && this.input.validity.patternMismatch) {
69
- this.errorMessage = this.patternErrorMessage;
70
- }
71
- // required
72
- else if (!this.valid && this.input.validity.valueMissing) {
73
- this.errorMessage = this.messages.errors.required;
74
- }
75
- };
189
+ setValidity(newValue) {
190
+ const oldValidValue = this.valid;
191
+ this.valid = newValue;
192
+ this.invalid = !this.valid;
193
+ // We need to send valid event even if it is the same value
194
+ if (this.handlerInProgress === undefined || (this.handlerInProgress === Handler.BLUR && this.valid !== oldValidValue))
195
+ this.inputValid.emit(this.valid);
196
+ }
197
+ /*************
198
+ * Lifecycle *
199
+ *************/
76
200
  /**
77
- * Validate append slot
201
+ * Check if component props are well configured on init
202
+ * @returns timeout
78
203
  */
79
- this.validateAppendSlot = () => {
80
- const slotAppendInput = Array.from(this.element.querySelectorAll('[slot="append-input"]'));
81
- if (slotAppendInput.length === 1) {
82
- this.classCollection.add(slotAppendInput[0].nodeName === 'MG-BUTTON' ? this.classIsInputGroupAppend : 'mg-c-input--is-append-input-slot-content');
83
- }
84
- else if (slotAppendInput.filter(slot => slot.nodeName === 'MG-BUTTON').length > 1) {
85
- this.classCollection.add(this.classIsInputGroupAppend);
86
- this.classCollection.add('mg-c-input--has-buttons-group-append');
87
- }
88
- };
204
+ componentWillLoad() {
205
+ // Get locales
206
+ this.messages = initLocales(this.element).messages;
207
+ this.characterLeftId = `${this.identifier}-character-left`;
208
+ this.datalistId = `${this.identifier}-datalist`;
209
+ // Validate
210
+ this.validateIcon(this.icon);
211
+ this.validateDatalistoptions(this.datalistoptions);
212
+ this.validatePattern(this.pattern);
213
+ this.validatePattern(this.patternErrorMessage);
214
+ this.validateAppendSlot();
215
+ // Check validity when component is ready
216
+ // return a promise to process action only in the FIRST render().
217
+ // https://stenciljs.com/docs/component-lifecycle#componentwillload
218
+ return setTimeout(() => {
219
+ this.checkValidity();
220
+ }, 0);
221
+ }
89
222
  /**
90
- * Methode to control datalist display condition
91
- * @returns true if display condition success
223
+ * Render
224
+ * @returns HTML Element
92
225
  */
93
- this.hasDatalist = () => isDatalistOption(this.datalistoptions) && this.datalistoptions.length > 0;
94
- this.value = undefined;
95
- this.identifier = undefined;
96
- this.name = this.identifier;
97
- this.label = undefined;
98
- this.type = 'text';
99
- this.icon = undefined;
100
- this.labelOnTop = undefined;
101
- this.labelHide = false;
102
- this.placeholder = undefined;
103
- this.datalistoptions = undefined;
104
- this.maxlength = 400;
105
- this.required = false;
106
- this.readonly = false;
107
- this.disabled = false;
108
- this.mgWidth = 'full';
109
- this.pattern = undefined;
110
- this.patternErrorMessage = undefined;
111
- this.tooltip = undefined;
112
- this.displayCharacterLeft = true;
113
- this.helpText = undefined;
114
- this.valid = undefined;
115
- this.invalid = undefined;
116
- this.classCollection = new ClassList(['mg-c-input--text']);
117
- this.errorMessage = undefined;
118
- }
119
- handleValue(newValue) {
120
- this.valueChange.emit(newValue);
121
- }
122
- validateIcon(newValue) {
123
- if (newValue !== undefined) {
124
- this.classCollection.add(this.classHasIcon);
125
- }
126
- else {
127
- this.classCollection.delete(this.classHasIcon);
128
- }
129
- }
130
- validateDatalistoptions(newValue) {
131
- if (Boolean(newValue) && !isDatalistOption(newValue)) {
132
- throw new Error('<mg-input-text> prop "datalistoptions" values must be the same type, string.');
226
+ render() {
227
+ return (h(MgInput, { identifier: this.identifier, classCollection: this.classCollection, ariaDescribedbyIDs: [this.characterLeftId], 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: undefined, tooltip: this.tooltip, helpText: this.helpText, errorMessage: this.errorMessage, isFieldset: false }, h("div", { class: "mg-c-input__with-character-left", style: {
228
+ '--mg-character-left-message-length': (this.displayCharacterLeft
229
+ ? (this.maxlength - (this.value || '').length).toString().length + this.maxlength.toString().length + 1
230
+ : 0).toString(),
231
+ } }, this.icon !== undefined && h("mg-icon", { icon: this.icon }), h("input", { type: this.type, class: "mg-c-input__box", value: this.value, id: this.identifier, list: this.hasDatalist() ? this.datalistId : undefined, autocomplete: this.hasDatalist() ? 'off' : undefined, name: this.name, placeholder: this.placeholder, title: this.placeholder, maxlength: this.maxlength, disabled: this.disabled, required: this.required, "aria-invalid": (this.invalid === true).toString(), pattern: this.pattern, onInput: this.handleInput, onFocus: this.handleFocus, onBlur: this.handleBlur, ref: (el) => {
232
+ if (el !== null)
233
+ this.input = el;
234
+ } }), this.hasDatalist() && (h("datalist", { id: this.datalistId }, this.datalistoptions.map(option => (h("option", { value: option, key: option }))))), this.displayCharacterLeft && this.maxlength > 0 && (h("mg-character-left", { identifier: this.characterLeftId, characters: this.value, maxlength: this.maxlength }))), h("slot", { name: "append-input" })));
133
235
  }
134
- }
135
- handleValidityChange(newValue, _oldValue, prop) {
136
- if (this.input !== undefined) {
137
- this.input[prop] = newValue;
138
- this.checkValidity();
139
- if (this.hasDisplayedError) {
140
- this.setErrorMessage();
141
- this.hasDisplayedError = false;
142
- }
236
+ static get is() { return "mg-input-text"; }
237
+ static get encapsulation() { return "shadow"; }
238
+ static get originalStyleUrls() {
239
+ return {
240
+ "$": ["../../../../../node_modules/@mgdis/styles/dist/components/mg-input-text.css"]
241
+ };
143
242
  }
144
- }
145
- validatePattern(newValue) {
146
- if (newValue !== undefined && !(isValidString(this.pattern) && isValidString(this.patternErrorMessage))) {
147
- throw new Error('<mg-input-text> props "pattern" and "patternErrorMessage" must be non-empty string and paired.');
243
+ static get styleUrls() {
244
+ return {
245
+ "$": ["../../../../../node_modules/@mgdis/styles/dist/components/mg-input-text.css"]
246
+ };
148
247
  }
149
- }
150
- /**
151
- * Public method to play input focus
152
- */
153
- async setFocus() {
154
- this.input.focus();
155
- }
156
- /**
157
- * Display input error if it exists.
158
- */
159
- async displayError() {
160
- this.checkValidity();
161
- this.setErrorMessage();
162
- this.hasDisplayedError = this.invalid;
163
- }
164
- /**
165
- * Set an error and display a custom error message.
166
- * This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.
167
- * It must be paired with an error message to display for the given context.
168
- * When used to set validity to `false`, you should use this method again to reset the validity to `true`.
169
- * @param valid - value indicating the validity
170
- * @param errorMessage - the error message to display
171
- */
172
- async setError(valid, errorMessage) {
173
- if (typeof valid !== 'boolean') {
174
- throw new Error('<mg-input-text> method "setError()" param "valid" must be a boolean');
175
- }
176
- else if (!isValidString(errorMessage)) {
177
- throw new Error('<mg-input-text> method "setError()" param "errorMessage" must be a string');
248
+ static get properties() {
249
+ return {
250
+ "value": {
251
+ "type": "string",
252
+ "mutable": true,
253
+ "complexType": {
254
+ "original": "string",
255
+ "resolved": "string",
256
+ "references": {}
257
+ },
258
+ "required": false,
259
+ "optional": false,
260
+ "docs": {
261
+ "tags": [],
262
+ "text": "Component value"
263
+ },
264
+ "attribute": "value",
265
+ "reflect": true
266
+ },
267
+ "identifier": {
268
+ "type": "string",
269
+ "mutable": false,
270
+ "complexType": {
271
+ "original": "string",
272
+ "resolved": "string",
273
+ "references": {}
274
+ },
275
+ "required": true,
276
+ "optional": false,
277
+ "docs": {
278
+ "tags": [],
279
+ "text": "Identifier is used for the element ID (id is a reserved prop in Stencil.js)"
280
+ },
281
+ "attribute": "identifier",
282
+ "reflect": false
283
+ },
284
+ "name": {
285
+ "type": "string",
286
+ "mutable": false,
287
+ "complexType": {
288
+ "original": "string",
289
+ "resolved": "string",
290
+ "references": {}
291
+ },
292
+ "required": false,
293
+ "optional": false,
294
+ "docs": {
295
+ "tags": [],
296
+ "text": "Input name\nIf not set the value equals the identifier"
297
+ },
298
+ "attribute": "name",
299
+ "reflect": false,
300
+ "defaultValue": "this.identifier"
301
+ },
302
+ "label": {
303
+ "type": "string",
304
+ "mutable": false,
305
+ "complexType": {
306
+ "original": "string",
307
+ "resolved": "string",
308
+ "references": {}
309
+ },
310
+ "required": true,
311
+ "optional": false,
312
+ "docs": {
313
+ "tags": [],
314
+ "text": "Input label"
315
+ },
316
+ "attribute": "label",
317
+ "reflect": false
318
+ },
319
+ "type": {
320
+ "type": "string",
321
+ "mutable": false,
322
+ "complexType": {
323
+ "original": "TextType",
324
+ "resolved": "\"search\" | \"text\"",
325
+ "references": {
326
+ "TextType": {
327
+ "location": "import",
328
+ "path": "./mg-input-text.conf",
329
+ "id": "src/components/molecules/inputs/mg-input-text/mg-input-text.conf.ts::TextType"
330
+ }
331
+ }
332
+ },
333
+ "required": false,
334
+ "optional": false,
335
+ "docs": {
336
+ "tags": [],
337
+ "text": "Input type"
338
+ },
339
+ "attribute": "type",
340
+ "reflect": false,
341
+ "defaultValue": "'text'"
342
+ },
343
+ "icon": {
344
+ "type": "string",
345
+ "mutable": false,
346
+ "complexType": {
347
+ "original": "string",
348
+ "resolved": "string",
349
+ "references": {}
350
+ },
351
+ "required": false,
352
+ "optional": false,
353
+ "docs": {
354
+ "tags": [],
355
+ "text": "Input icon"
356
+ },
357
+ "attribute": "icon",
358
+ "reflect": false
359
+ },
360
+ "labelOnTop": {
361
+ "type": "boolean",
362
+ "mutable": false,
363
+ "complexType": {
364
+ "original": "boolean",
365
+ "resolved": "boolean",
366
+ "references": {}
367
+ },
368
+ "required": false,
369
+ "optional": false,
370
+ "docs": {
371
+ "tags": [],
372
+ "text": "Define if label is displayed on top"
373
+ },
374
+ "attribute": "label-on-top",
375
+ "reflect": false
376
+ },
377
+ "labelHide": {
378
+ "type": "boolean",
379
+ "mutable": false,
380
+ "complexType": {
381
+ "original": "boolean",
382
+ "resolved": "boolean",
383
+ "references": {}
384
+ },
385
+ "required": false,
386
+ "optional": false,
387
+ "docs": {
388
+ "tags": [],
389
+ "text": "Define if label is visible"
390
+ },
391
+ "attribute": "label-hide",
392
+ "reflect": false,
393
+ "defaultValue": "false"
394
+ },
395
+ "placeholder": {
396
+ "type": "string",
397
+ "mutable": false,
398
+ "complexType": {
399
+ "original": "string",
400
+ "resolved": "string",
401
+ "references": {}
402
+ },
403
+ "required": false,
404
+ "optional": false,
405
+ "docs": {
406
+ "tags": [],
407
+ "text": "Input placeholder.\nIt should be a word or short phrase that demonstrates the expected type of data, not a replacement for labels or help text."
408
+ },
409
+ "attribute": "placeholder",
410
+ "reflect": false
411
+ },
412
+ "datalistoptions": {
413
+ "type": "unknown",
414
+ "mutable": false,
415
+ "complexType": {
416
+ "original": "string[]",
417
+ "resolved": "string[]",
418
+ "references": {}
419
+ },
420
+ "required": false,
421
+ "optional": false,
422
+ "docs": {
423
+ "tags": [],
424
+ "text": "Define datalist options"
425
+ }
426
+ },
427
+ "maxlength": {
428
+ "type": "number",
429
+ "mutable": false,
430
+ "complexType": {
431
+ "original": "number",
432
+ "resolved": "number",
433
+ "references": {}
434
+ },
435
+ "required": false,
436
+ "optional": false,
437
+ "docs": {
438
+ "tags": [],
439
+ "text": "Input max length"
440
+ },
441
+ "attribute": "maxlength",
442
+ "reflect": false,
443
+ "defaultValue": "400"
444
+ },
445
+ "required": {
446
+ "type": "boolean",
447
+ "mutable": false,
448
+ "complexType": {
449
+ "original": "boolean",
450
+ "resolved": "boolean",
451
+ "references": {}
452
+ },
453
+ "required": false,
454
+ "optional": false,
455
+ "docs": {
456
+ "tags": [],
457
+ "text": "Define if input is required"
458
+ },
459
+ "attribute": "required",
460
+ "reflect": false,
461
+ "defaultValue": "false"
462
+ },
463
+ "readonly": {
464
+ "type": "boolean",
465
+ "mutable": false,
466
+ "complexType": {
467
+ "original": "boolean",
468
+ "resolved": "boolean",
469
+ "references": {}
470
+ },
471
+ "required": false,
472
+ "optional": false,
473
+ "docs": {
474
+ "tags": [],
475
+ "text": "Define if input is readonly"
476
+ },
477
+ "attribute": "readonly",
478
+ "reflect": false,
479
+ "defaultValue": "false"
480
+ },
481
+ "disabled": {
482
+ "type": "boolean",
483
+ "mutable": false,
484
+ "complexType": {
485
+ "original": "boolean",
486
+ "resolved": "boolean",
487
+ "references": {}
488
+ },
489
+ "required": false,
490
+ "optional": false,
491
+ "docs": {
492
+ "tags": [],
493
+ "text": "Define if input is disabled"
494
+ },
495
+ "attribute": "disabled",
496
+ "reflect": false,
497
+ "defaultValue": "false"
498
+ },
499
+ "mgWidth": {
500
+ "type": "any",
501
+ "mutable": false,
502
+ "complexType": {
503
+ "original": "Width",
504
+ "resolved": "\"full\" | 16 | 2 | 4",
505
+ "references": {
506
+ "Width": {
507
+ "location": "import",
508
+ "path": "../MgInput.conf",
509
+ "id": "src/components/molecules/inputs/MgInput.conf.ts::Width"
510
+ }
511
+ }
512
+ },
513
+ "required": false,
514
+ "optional": false,
515
+ "docs": {
516
+ "tags": [],
517
+ "text": "Define input width"
518
+ },
519
+ "attribute": "mg-width",
520
+ "reflect": false,
521
+ "defaultValue": "'full'"
522
+ },
523
+ "pattern": {
524
+ "type": "string",
525
+ "mutable": false,
526
+ "complexType": {
527
+ "original": "string",
528
+ "resolved": "string",
529
+ "references": {}
530
+ },
531
+ "required": false,
532
+ "optional": false,
533
+ "docs": {
534
+ "tags": [],
535
+ "text": "Define input pattern to validate"
536
+ },
537
+ "attribute": "pattern",
538
+ "reflect": false
539
+ },
540
+ "patternErrorMessage": {
541
+ "type": "string",
542
+ "mutable": false,
543
+ "complexType": {
544
+ "original": "string",
545
+ "resolved": "string",
546
+ "references": {}
547
+ },
548
+ "required": false,
549
+ "optional": false,
550
+ "docs": {
551
+ "tags": [],
552
+ "text": "Define input pattern error message"
553
+ },
554
+ "attribute": "pattern-error-message",
555
+ "reflect": false
556
+ },
557
+ "tooltip": {
558
+ "type": "string",
559
+ "mutable": false,
560
+ "complexType": {
561
+ "original": "string",
562
+ "resolved": "string",
563
+ "references": {}
564
+ },
565
+ "required": false,
566
+ "optional": false,
567
+ "docs": {
568
+ "tags": [],
569
+ "text": "Add a tooltip message next to the input"
570
+ },
571
+ "attribute": "tooltip",
572
+ "reflect": false
573
+ },
574
+ "displayCharacterLeft": {
575
+ "type": "boolean",
576
+ "mutable": false,
577
+ "complexType": {
578
+ "original": "boolean",
579
+ "resolved": "boolean",
580
+ "references": {}
581
+ },
582
+ "required": false,
583
+ "optional": false,
584
+ "docs": {
585
+ "tags": [],
586
+ "text": "Define if component should display character left"
587
+ },
588
+ "attribute": "display-character-left",
589
+ "reflect": false,
590
+ "defaultValue": "true"
591
+ },
592
+ "helpText": {
593
+ "type": "string",
594
+ "mutable": false,
595
+ "complexType": {
596
+ "original": "string",
597
+ "resolved": "string",
598
+ "references": {}
599
+ },
600
+ "required": false,
601
+ "optional": false,
602
+ "docs": {
603
+ "tags": [],
604
+ "text": "Add a help text under the input, usually expected data format and example"
605
+ },
606
+ "attribute": "help-text",
607
+ "reflect": false
608
+ },
609
+ "valid": {
610
+ "type": "boolean",
611
+ "mutable": true,
612
+ "complexType": {
613
+ "original": "boolean",
614
+ "resolved": "boolean",
615
+ "references": {}
616
+ },
617
+ "required": false,
618
+ "optional": false,
619
+ "docs": {
620
+ "tags": [],
621
+ "text": "Define input valid state"
622
+ },
623
+ "attribute": "valid",
624
+ "reflect": false
625
+ },
626
+ "invalid": {
627
+ "type": "boolean",
628
+ "mutable": true,
629
+ "complexType": {
630
+ "original": "boolean",
631
+ "resolved": "boolean",
632
+ "references": {}
633
+ },
634
+ "required": false,
635
+ "optional": false,
636
+ "docs": {
637
+ "tags": [],
638
+ "text": "Define input invalid state"
639
+ },
640
+ "attribute": "invalid",
641
+ "reflect": false
642
+ }
643
+ };
178
644
  }
179
- else {
180
- this.setValidity(valid);
181
- this.setErrorMessage(valid ? undefined : errorMessage);
182
- this.hasDisplayedError = this.invalid;
645
+ static get states() {
646
+ return {
647
+ "classCollection": {},
648
+ "errorMessage": {}
649
+ };
183
650
  }
184
- }
185
- /**
186
- * Method to set validity values
187
- * @param newValue - valid new value
188
- */
189
- setValidity(newValue) {
190
- const oldValidValue = this.valid;
191
- this.valid = newValue;
192
- this.invalid = !this.valid;
193
- // We need to send valid event even if it is the same value
194
- if (this.handlerInProgress === undefined || (this.handlerInProgress === Handler.BLUR && this.valid !== oldValidValue))
195
- this.inputValid.emit(this.valid);
196
- }
197
- /*************
198
- * Lifecycle *
199
- *************/
200
- /**
201
- * Check if component props are well configured on init
202
- * @returns timeout
203
- */
204
- componentWillLoad() {
205
- // Get locales
206
- this.messages = initLocales(this.element).messages;
207
- this.characterLeftId = `${this.identifier}-character-left`;
208
- this.datalistId = `${this.identifier}-datalist`;
209
- // Validate
210
- this.validateIcon(this.icon);
211
- this.validateDatalistoptions(this.datalistoptions);
212
- this.validatePattern(this.pattern);
213
- this.validatePattern(this.patternErrorMessage);
214
- this.validateAppendSlot();
215
- // Check validity when component is ready
216
- // return a promise to process action only in the FIRST render().
217
- // https://stenciljs.com/docs/component-lifecycle#componentwillload
218
- return setTimeout(() => {
219
- this.checkValidity();
220
- }, 0);
221
- }
222
- /**
223
- * Render
224
- * @returns HTML Element
225
- */
226
- render() {
227
- return (h(MgInput, { identifier: this.identifier, classCollection: this.classCollection, ariaDescribedbyIDs: [this.characterLeftId], 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: undefined, tooltip: this.tooltip, helpText: this.helpText, errorMessage: this.errorMessage, isFieldset: false }, h("div", { class: "mg-c-input__with-character-left", style: {
228
- '--mg-character-left-message-length': (this.displayCharacterLeft
229
- ? (this.maxlength - (this.value || '').length).toString().length + this.maxlength.toString().length + 1
230
- : 0).toString(),
231
- } }, this.icon !== undefined && h("mg-icon", { icon: this.icon }), h("input", { type: this.type, class: "mg-c-input__box", value: this.value, id: this.identifier, list: this.hasDatalist() ? this.datalistId : undefined, autocomplete: this.hasDatalist() ? 'off' : undefined, name: this.name, placeholder: this.placeholder, title: this.placeholder, maxlength: this.maxlength, disabled: this.disabled, required: this.required, "aria-invalid": (this.invalid === true).toString(), pattern: this.pattern, onInput: this.handleInput, onFocus: this.handleFocus, onBlur: this.handleBlur, ref: (el) => {
232
- if (el !== null)
233
- this.input = el;
234
- } }), this.hasDatalist() && (h("datalist", { id: this.datalistId }, this.datalistoptions.map(option => (h("option", { value: option, key: option }))))), this.displayCharacterLeft && this.maxlength > 0 && (h("mg-character-left", { identifier: this.characterLeftId, characters: this.value, maxlength: this.maxlength }))), h("slot", { name: "append-input" })));
235
- }
236
- static get is() { return "mg-input-text"; }
237
- static get encapsulation() { return "shadow"; }
238
- static get originalStyleUrls() {
239
- return {
240
- "$": ["../../../../../node_modules/@mgdis/styles/dist/components/mg-input-text.css"]
241
- };
242
- }
243
- static get styleUrls() {
244
- return {
245
- "$": ["../../../../../node_modules/@mgdis/styles/dist/components/mg-input-text.css"]
246
- };
247
- }
248
- static get properties() {
249
- return {
250
- "value": {
251
- "type": "string",
252
- "mutable": true,
253
- "complexType": {
254
- "original": "string",
255
- "resolved": "string",
256
- "references": {}
257
- },
258
- "required": false,
259
- "optional": false,
260
- "docs": {
261
- "tags": [],
262
- "text": "Component value"
263
- },
264
- "attribute": "value",
265
- "reflect": true
266
- },
267
- "identifier": {
268
- "type": "string",
269
- "mutable": false,
270
- "complexType": {
271
- "original": "string",
272
- "resolved": "string",
273
- "references": {}
274
- },
275
- "required": true,
276
- "optional": false,
277
- "docs": {
278
- "tags": [],
279
- "text": "Identifier is used for the element ID (id is a reserved prop in Stencil.js)"
280
- },
281
- "attribute": "identifier",
282
- "reflect": false
283
- },
284
- "name": {
285
- "type": "string",
286
- "mutable": false,
287
- "complexType": {
288
- "original": "string",
289
- "resolved": "string",
290
- "references": {}
291
- },
292
- "required": false,
293
- "optional": false,
294
- "docs": {
295
- "tags": [],
296
- "text": "Input name\nIf not set the value equals the identifier"
297
- },
298
- "attribute": "name",
299
- "reflect": false,
300
- "defaultValue": "this.identifier"
301
- },
302
- "label": {
303
- "type": "string",
304
- "mutable": false,
305
- "complexType": {
306
- "original": "string",
307
- "resolved": "string",
308
- "references": {}
309
- },
310
- "required": true,
311
- "optional": false,
312
- "docs": {
313
- "tags": [],
314
- "text": "Input label"
315
- },
316
- "attribute": "label",
317
- "reflect": false
318
- },
319
- "type": {
320
- "type": "string",
321
- "mutable": false,
322
- "complexType": {
323
- "original": "TextType",
324
- "resolved": "\"search\" | \"text\"",
325
- "references": {
326
- "TextType": {
327
- "location": "import",
328
- "path": "./mg-input-text.conf",
329
- "id": "src/components/molecules/inputs/mg-input-text/mg-input-text.conf.ts::TextType"
330
- }
331
- }
332
- },
333
- "required": false,
334
- "optional": false,
335
- "docs": {
336
- "tags": [],
337
- "text": "Input type"
338
- },
339
- "attribute": "type",
340
- "reflect": false,
341
- "defaultValue": "'text'"
342
- },
343
- "icon": {
344
- "type": "string",
345
- "mutable": false,
346
- "complexType": {
347
- "original": "string",
348
- "resolved": "string",
349
- "references": {}
350
- },
351
- "required": false,
352
- "optional": false,
353
- "docs": {
354
- "tags": [],
355
- "text": "Input icon"
356
- },
357
- "attribute": "icon",
358
- "reflect": false
359
- },
360
- "labelOnTop": {
361
- "type": "boolean",
362
- "mutable": false,
363
- "complexType": {
364
- "original": "boolean",
365
- "resolved": "boolean",
366
- "references": {}
367
- },
368
- "required": false,
369
- "optional": false,
370
- "docs": {
371
- "tags": [],
372
- "text": "Define if label is displayed on top"
373
- },
374
- "attribute": "label-on-top",
375
- "reflect": false
376
- },
377
- "labelHide": {
378
- "type": "boolean",
379
- "mutable": false,
380
- "complexType": {
381
- "original": "boolean",
382
- "resolved": "boolean",
383
- "references": {}
384
- },
385
- "required": false,
386
- "optional": false,
387
- "docs": {
388
- "tags": [],
389
- "text": "Define if label is visible"
390
- },
391
- "attribute": "label-hide",
392
- "reflect": false,
393
- "defaultValue": "false"
394
- },
395
- "placeholder": {
396
- "type": "string",
397
- "mutable": false,
398
- "complexType": {
399
- "original": "string",
400
- "resolved": "string",
401
- "references": {}
402
- },
403
- "required": false,
404
- "optional": false,
405
- "docs": {
406
- "tags": [],
407
- "text": "Input placeholder.\nIt should be a word or short phrase that demonstrates the expected type of data, not a replacement for labels or help text."
408
- },
409
- "attribute": "placeholder",
410
- "reflect": false
411
- },
412
- "datalistoptions": {
413
- "type": "unknown",
414
- "mutable": false,
415
- "complexType": {
416
- "original": "string[]",
417
- "resolved": "string[]",
418
- "references": {}
419
- },
420
- "required": false,
421
- "optional": false,
422
- "docs": {
423
- "tags": [],
424
- "text": "Define datalist options"
425
- }
426
- },
427
- "maxlength": {
428
- "type": "number",
429
- "mutable": false,
430
- "complexType": {
431
- "original": "number",
432
- "resolved": "number",
433
- "references": {}
434
- },
435
- "required": false,
436
- "optional": false,
437
- "docs": {
438
- "tags": [],
439
- "text": "Input max length"
440
- },
441
- "attribute": "maxlength",
442
- "reflect": false,
443
- "defaultValue": "400"
444
- },
445
- "required": {
446
- "type": "boolean",
447
- "mutable": false,
448
- "complexType": {
449
- "original": "boolean",
450
- "resolved": "boolean",
451
- "references": {}
452
- },
453
- "required": false,
454
- "optional": false,
455
- "docs": {
456
- "tags": [],
457
- "text": "Define if input is required"
458
- },
459
- "attribute": "required",
460
- "reflect": false,
461
- "defaultValue": "false"
462
- },
463
- "readonly": {
464
- "type": "boolean",
465
- "mutable": false,
466
- "complexType": {
467
- "original": "boolean",
468
- "resolved": "boolean",
469
- "references": {}
470
- },
471
- "required": false,
472
- "optional": false,
473
- "docs": {
474
- "tags": [],
475
- "text": "Define if input is readonly"
476
- },
477
- "attribute": "readonly",
478
- "reflect": false,
479
- "defaultValue": "false"
480
- },
481
- "disabled": {
482
- "type": "boolean",
483
- "mutable": false,
484
- "complexType": {
485
- "original": "boolean",
486
- "resolved": "boolean",
487
- "references": {}
488
- },
489
- "required": false,
490
- "optional": false,
491
- "docs": {
492
- "tags": [],
493
- "text": "Define if input is disabled"
494
- },
495
- "attribute": "disabled",
496
- "reflect": false,
497
- "defaultValue": "false"
498
- },
499
- "mgWidth": {
500
- "type": "any",
501
- "mutable": false,
502
- "complexType": {
503
- "original": "Width",
504
- "resolved": "\"full\" | 16 | 2 | 4",
505
- "references": {
506
- "Width": {
507
- "location": "import",
508
- "path": "../MgInput.conf",
509
- "id": "src/components/molecules/inputs/MgInput.conf.ts::Width"
510
- }
511
- }
512
- },
513
- "required": false,
514
- "optional": false,
515
- "docs": {
516
- "tags": [],
517
- "text": "Define input width"
518
- },
519
- "attribute": "mg-width",
520
- "reflect": false,
521
- "defaultValue": "'full'"
522
- },
523
- "pattern": {
524
- "type": "string",
525
- "mutable": false,
526
- "complexType": {
527
- "original": "string",
528
- "resolved": "string",
529
- "references": {}
530
- },
531
- "required": false,
532
- "optional": false,
533
- "docs": {
534
- "tags": [],
535
- "text": "Define input pattern to validate"
536
- },
537
- "attribute": "pattern",
538
- "reflect": false
539
- },
540
- "patternErrorMessage": {
541
- "type": "string",
542
- "mutable": false,
543
- "complexType": {
544
- "original": "string",
545
- "resolved": "string",
546
- "references": {}
547
- },
548
- "required": false,
549
- "optional": false,
550
- "docs": {
551
- "tags": [],
552
- "text": "Define input pattern error message"
553
- },
554
- "attribute": "pattern-error-message",
555
- "reflect": false
556
- },
557
- "tooltip": {
558
- "type": "string",
559
- "mutable": false,
560
- "complexType": {
561
- "original": "string",
562
- "resolved": "string",
563
- "references": {}
564
- },
565
- "required": false,
566
- "optional": false,
567
- "docs": {
568
- "tags": [],
569
- "text": "Add a tooltip message next to the input"
570
- },
571
- "attribute": "tooltip",
572
- "reflect": false
573
- },
574
- "displayCharacterLeft": {
575
- "type": "boolean",
576
- "mutable": false,
577
- "complexType": {
578
- "original": "boolean",
579
- "resolved": "boolean",
580
- "references": {}
581
- },
582
- "required": false,
583
- "optional": false,
584
- "docs": {
585
- "tags": [],
586
- "text": "Define if component should display character left"
587
- },
588
- "attribute": "display-character-left",
589
- "reflect": false,
590
- "defaultValue": "true"
591
- },
592
- "helpText": {
593
- "type": "string",
594
- "mutable": false,
595
- "complexType": {
596
- "original": "string",
597
- "resolved": "string",
598
- "references": {}
599
- },
600
- "required": false,
601
- "optional": false,
602
- "docs": {
603
- "tags": [],
604
- "text": "Add a help text under the input, usually expected data format and example"
605
- },
606
- "attribute": "help-text",
607
- "reflect": false
608
- },
609
- "valid": {
610
- "type": "boolean",
611
- "mutable": true,
612
- "complexType": {
613
- "original": "boolean",
614
- "resolved": "boolean",
615
- "references": {}
616
- },
617
- "required": false,
618
- "optional": false,
619
- "docs": {
620
- "tags": [],
621
- "text": "Define input valid state"
622
- },
623
- "attribute": "valid",
624
- "reflect": false
625
- },
626
- "invalid": {
627
- "type": "boolean",
628
- "mutable": true,
629
- "complexType": {
630
- "original": "boolean",
631
- "resolved": "boolean",
632
- "references": {}
633
- },
634
- "required": false,
635
- "optional": false,
636
- "docs": {
637
- "tags": [],
638
- "text": "Define input invalid state"
639
- },
640
- "attribute": "invalid",
641
- "reflect": false
642
- }
643
- };
644
- }
645
- static get states() {
646
- return {
647
- "classCollection": {},
648
- "errorMessage": {}
649
- };
650
- }
651
- static get events() {
652
- return [{
653
- "method": "valueChange",
654
- "name": "value-change",
655
- "bubbles": true,
656
- "cancelable": true,
657
- "composed": true,
658
- "docs": {
659
- "tags": [],
660
- "text": "Emited event when value change"
661
- },
662
- "complexType": {
663
- "original": "string",
664
- "resolved": "string",
665
- "references": {}
666
- }
667
- }, {
668
- "method": "inputValid",
669
- "name": "input-valid",
670
- "bubbles": true,
671
- "cancelable": true,
672
- "composed": true,
673
- "docs": {
674
- "tags": [],
675
- "text": "Emited event when checking validity"
676
- },
677
- "complexType": {
678
- "original": "boolean",
679
- "resolved": "boolean",
680
- "references": {}
681
- }
682
- }];
683
- }
684
- static get methods() {
685
- return {
686
- "setFocus": {
687
- "complexType": {
688
- "signature": "() => Promise<void>",
689
- "parameters": [],
690
- "references": {
691
- "Promise": {
692
- "location": "global",
693
- "id": "global::Promise"
694
- }
695
- },
696
- "return": "Promise<void>"
697
- },
698
- "docs": {
699
- "text": "Public method to play input focus",
700
- "tags": []
701
- }
702
- },
703
- "displayError": {
704
- "complexType": {
705
- "signature": "() => Promise<void>",
706
- "parameters": [],
707
- "references": {
708
- "Promise": {
709
- "location": "global",
710
- "id": "global::Promise"
711
- }
712
- },
713
- "return": "Promise<void>"
714
- },
715
- "docs": {
716
- "text": "Display input error if it exists.",
717
- "tags": []
718
- }
719
- },
720
- "setError": {
721
- "complexType": {
722
- "signature": "(valid: MgInputText['valid'], errorMessage: string) => Promise<void>",
723
- "parameters": [{
724
- "tags": [{
725
- "name": "param",
726
- "text": "valid - value indicating the validity"
727
- }],
728
- "text": "- value indicating the validity"
651
+ static get events() {
652
+ return [{
653
+ "method": "valueChange",
654
+ "name": "value-change",
655
+ "bubbles": true,
656
+ "cancelable": true,
657
+ "composed": true,
658
+ "docs": {
659
+ "tags": [],
660
+ "text": "Emited event when value change"
661
+ },
662
+ "complexType": {
663
+ "original": "HTMLMgInputTextElement['value']",
664
+ "resolved": "string",
665
+ "references": {
666
+ "HTMLMgInputTextElement": {
667
+ "location": "global",
668
+ "id": "global::HTMLMgInputTextElement"
669
+ }
670
+ }
671
+ }
729
672
  }, {
730
- "tags": [{
731
- "name": "param",
732
- "text": "errorMessage - the error message to display"
733
- }],
734
- "text": "- the error message to display"
735
- }],
736
- "references": {
737
- "Promise": {
738
- "location": "global",
739
- "id": "global::Promise"
673
+ "method": "inputValid",
674
+ "name": "input-valid",
675
+ "bubbles": true,
676
+ "cancelable": true,
677
+ "composed": true,
678
+ "docs": {
679
+ "tags": [],
680
+ "text": "Emited event when checking validity"
681
+ },
682
+ "complexType": {
683
+ "original": "HTMLMgInputTextElement['valid']",
684
+ "resolved": "boolean",
685
+ "references": {
686
+ "HTMLMgInputTextElement": {
687
+ "location": "global",
688
+ "id": "global::HTMLMgInputTextElement"
689
+ }
690
+ }
691
+ }
692
+ }];
693
+ }
694
+ static get methods() {
695
+ return {
696
+ "setFocus": {
697
+ "complexType": {
698
+ "signature": "() => Promise<void>",
699
+ "parameters": [],
700
+ "references": {
701
+ "Promise": {
702
+ "location": "global",
703
+ "id": "global::Promise"
704
+ }
705
+ },
706
+ "return": "Promise<void>"
707
+ },
708
+ "docs": {
709
+ "text": "Public method to play input focus",
710
+ "tags": []
711
+ }
712
+ },
713
+ "displayError": {
714
+ "complexType": {
715
+ "signature": "() => Promise<void>",
716
+ "parameters": [],
717
+ "references": {
718
+ "Promise": {
719
+ "location": "global",
720
+ "id": "global::Promise"
721
+ }
722
+ },
723
+ "return": "Promise<void>"
724
+ },
725
+ "docs": {
726
+ "text": "Display input error if it exists.",
727
+ "tags": []
728
+ }
740
729
  },
741
- "MgInputText": {
742
- "location": "global",
743
- "id": "global::MgInputText"
730
+ "setError": {
731
+ "complexType": {
732
+ "signature": "(valid: MgInputText['valid'], errorMessage: string) => Promise<void>",
733
+ "parameters": [{
734
+ "tags": [{
735
+ "name": "param",
736
+ "text": "valid - value indicating the validity"
737
+ }],
738
+ "text": "- value indicating the validity"
739
+ }, {
740
+ "tags": [{
741
+ "name": "param",
742
+ "text": "errorMessage - the error message to display"
743
+ }],
744
+ "text": "- the error message to display"
745
+ }],
746
+ "references": {
747
+ "Promise": {
748
+ "location": "global",
749
+ "id": "global::Promise"
750
+ },
751
+ "MgInputText": {
752
+ "location": "global",
753
+ "id": "global::MgInputText"
754
+ }
755
+ },
756
+ "return": "Promise<void>"
757
+ },
758
+ "docs": {
759
+ "text": "Set an error and display a custom error message.\nThis method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.\nIt must be paired with an error message to display for the given context.\nWhen used to set validity to `false`, you should use this method again to reset the validity to `true`.",
760
+ "tags": [{
761
+ "name": "param",
762
+ "text": "valid - value indicating the validity"
763
+ }, {
764
+ "name": "param",
765
+ "text": "errorMessage - the error message to display"
766
+ }]
767
+ }
744
768
  }
745
- },
746
- "return": "Promise<void>"
747
- },
748
- "docs": {
749
- "text": "Set an error and display a custom error message.\nThis method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.\nIt must be paired with an error message to display for the given context.\nWhen used to set validity to `false`, you should use this method again to reset the validity to `true`.",
750
- "tags": [{
751
- "name": "param",
752
- "text": "valid - value indicating the validity"
769
+ };
770
+ }
771
+ static get elementRef() { return "element"; }
772
+ static get watchers() {
773
+ return [{
774
+ "propName": "value",
775
+ "methodName": "handleValue"
753
776
  }, {
754
- "name": "param",
755
- "text": "errorMessage - the error message to display"
756
- }]
757
- }
758
- }
759
- };
760
- }
761
- static get elementRef() { return "element"; }
762
- static get watchers() {
763
- return [{
764
- "propName": "value",
765
- "methodName": "handleValue"
766
- }, {
767
- "propName": "icon",
768
- "methodName": "validateIcon"
769
- }, {
770
- "propName": "datalistoptions",
771
- "methodName": "validateDatalistoptions"
772
- }, {
773
- "propName": "required",
774
- "methodName": "handleValidityChange"
775
- }, {
776
- "propName": "readonly",
777
- "methodName": "handleValidityChange"
778
- }, {
779
- "propName": "disabled",
780
- "methodName": "handleValidityChange"
781
- }, {
782
- "propName": "pattern",
783
- "methodName": "validatePattern"
784
- }, {
785
- "propName": "patternErrorMessage",
786
- "methodName": "validatePattern"
787
- }];
788
- }
777
+ "propName": "icon",
778
+ "methodName": "validateIcon"
779
+ }, {
780
+ "propName": "datalistoptions",
781
+ "methodName": "validateDatalistoptions"
782
+ }, {
783
+ "propName": "required",
784
+ "methodName": "handleValidityChange"
785
+ }, {
786
+ "propName": "readonly",
787
+ "methodName": "handleValidityChange"
788
+ }, {
789
+ "propName": "disabled",
790
+ "methodName": "handleValidityChange"
791
+ }, {
792
+ "propName": "pattern",
793
+ "methodName": "validatePattern"
794
+ }, {
795
+ "propName": "patternErrorMessage",
796
+ "methodName": "validatePattern"
797
+ }];
798
+ }
789
799
  }
790
800
  //# sourceMappingURL=mg-input-text.js.map