@mgdis/mg-components 5.19.3 → 5.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (493) hide show
  1. package/dist/cjs/{components.utils-69435877.js → components.utils-cd908d4e.js} +102 -99
  2. package/dist/cjs/components.utils-cd908d4e.js.map +1 -0
  3. package/dist/cjs/{index-60dd0c56.js → index-8532b5e9.js} +185 -87
  4. package/dist/cjs/index-8532b5e9.js.map +1 -0
  5. package/dist/cjs/loader.cjs.js +2 -2
  6. package/dist/cjs/mg-action-more_34.cjs.entry.js +5140 -5107
  7. package/dist/cjs/mg-action-more_34.cjs.entry.js.map +1 -1
  8. package/dist/cjs/mg-components.cjs.js +3 -3
  9. package/dist/cjs/mg-components.cjs.js.map +1 -1
  10. package/dist/cjs/mg-item-more.cjs.entry.js +237 -222
  11. package/dist/cjs/mg-item-more.cjs.entry.js.map +1 -1
  12. package/dist/collection/assets/icons/index.js +193 -191
  13. package/dist/collection/assets/icons/index.js.map +1 -0
  14. package/dist/collection/collection-manifest.json +6 -6
  15. package/dist/collection/components/atoms/mg-badge/mg-badge.js +161 -161
  16. package/dist/collection/components/atoms/mg-badge/mg-badge.js.map +1 -1
  17. package/dist/collection/components/atoms/mg-button/mg-button.js +362 -362
  18. package/dist/collection/components/atoms/mg-button/mg-button.js.map +1 -1
  19. package/dist/collection/components/atoms/mg-card/mg-card.js +126 -126
  20. package/dist/collection/components/atoms/mg-card/mg-card.js.map +1 -1
  21. package/dist/collection/components/atoms/mg-character-left/mg-character-left.js +101 -101
  22. package/dist/collection/components/atoms/mg-character-left/mg-character-left.js.map +1 -1
  23. package/dist/collection/components/atoms/mg-divider/mg-divider.js +47 -47
  24. package/dist/collection/components/atoms/mg-divider/mg-divider.js.map +1 -1
  25. package/dist/collection/components/atoms/mg-icon/mg-icon.js +231 -231
  26. package/dist/collection/components/atoms/mg-icon/mg-icon.js.map +1 -1
  27. package/dist/collection/components/atoms/mg-input-title/mg-input-title.js +132 -132
  28. package/dist/collection/components/atoms/mg-input-title/mg-input-title.js.map +1 -1
  29. package/dist/collection/components/atoms/mg-tag/mg-tag.js +158 -158
  30. package/dist/collection/components/atoms/mg-tag/mg-tag.js.map +1 -1
  31. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.js +46 -46
  32. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.js.map +1 -1
  33. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.conf.js +3 -3
  34. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.conf.js.map +1 -1
  35. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +398 -398
  36. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js.map +1 -1
  37. package/dist/collection/components/molecules/inputs/MgInput.conf.js +2 -2
  38. package/dist/collection/components/molecules/inputs/MgInput.conf.js.map +1 -1
  39. package/dist/collection/components/molecules/inputs/MgInput.js +84 -84
  40. package/dist/collection/components/molecules/inputs/MgInput.js.map +1 -1
  41. package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js +8 -8
  42. package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js.map +1 -1
  43. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js +266 -266
  44. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js.map +1 -1
  45. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.js +4 -4
  46. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.js.map +1 -1
  47. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +788 -791
  48. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js.map +1 -1
  49. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.conf.js +4 -4
  50. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.conf.js.map +1 -1
  51. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +588 -578
  52. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js.map +1 -1
  53. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf.js +4 -4
  54. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf.js.map +1 -1
  55. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +778 -773
  56. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js.map +1 -1
  57. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +536 -526
  58. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js.map +1 -1
  59. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +565 -555
  60. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js.map +1 -1
  61. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +700 -695
  62. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js.map +1 -1
  63. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +770 -760
  64. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js.map +1 -1
  65. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +705 -695
  66. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js.map +1 -1
  67. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +527 -522
  68. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js.map +1 -1
  69. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.conf.js +2 -2
  70. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.conf.js.map +1 -1
  71. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js +263 -263
  72. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js.map +1 -1
  73. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.conf.js +6 -6
  74. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.conf.js.map +1 -1
  75. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js +423 -423
  76. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js.map +1 -1
  77. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +214 -214
  78. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js.map +1 -1
  79. package/dist/collection/components/molecules/mg-details/mg-details.js +155 -150
  80. package/dist/collection/components/molecules/mg-details/mg-details.js.map +1 -1
  81. package/dist/collection/components/molecules/mg-form/mg-form.conf.js +9 -0
  82. package/dist/collection/components/molecules/mg-form/mg-form.conf.js.map +1 -0
  83. package/dist/collection/components/molecules/mg-form/mg-form.js +405 -327
  84. package/dist/collection/components/molecules/mg-form/mg-form.js.map +1 -1
  85. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +85 -85
  86. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js.map +1 -1
  87. package/dist/collection/components/molecules/mg-item-more/mg-item-more.js +203 -188
  88. package/dist/collection/components/molecules/mg-item-more/mg-item-more.js.map +1 -1
  89. package/dist/collection/components/molecules/mg-message/mg-message.js +325 -304
  90. package/dist/collection/components/molecules/mg-message/mg-message.js.map +1 -1
  91. package/dist/collection/components/molecules/mg-modal/mg-modal.js +317 -317
  92. package/dist/collection/components/molecules/mg-modal/mg-modal.js.map +1 -1
  93. package/dist/collection/components/molecules/mg-pagination/mg-pagination.conf.js +2 -2
  94. package/dist/collection/components/molecules/mg-pagination/mg-pagination.conf.js.map +1 -1
  95. package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +216 -216
  96. package/dist/collection/components/molecules/mg-pagination/mg-pagination.js.map +1 -1
  97. package/dist/collection/components/molecules/mg-panel/mg-panel.js +409 -399
  98. package/dist/collection/components/molecules/mg-panel/mg-panel.js.map +1 -1
  99. package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js +91 -91
  100. package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js.map +1 -1
  101. package/dist/collection/components/molecules/mg-popover/mg-popover.js +336 -329
  102. package/dist/collection/components/molecules/mg-popover/mg-popover.js.map +1 -1
  103. package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +94 -94
  104. package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js.map +1 -1
  105. package/dist/collection/components/molecules/mg-tabs/mg-tabs.conf.js +4 -4
  106. package/dist/collection/components/molecules/mg-tabs/mg-tabs.conf.js.map +1 -1
  107. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +348 -343
  108. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js.map +1 -1
  109. package/dist/collection/locales/fr/messages.json +4 -4
  110. package/dist/collection/locales/index.spec.js +20 -20
  111. package/dist/collection/locales/index.spec.js.map +1 -1
  112. package/dist/collection/utils/behaviors.utils.js +127 -127
  113. package/dist/collection/utils/behaviors.utils.js.map +1 -1
  114. package/dist/collection/utils/behaviors.utils.spec.js +46 -42
  115. package/dist/collection/utils/behaviors.utils.spec.js.map +1 -1
  116. package/dist/collection/utils/components.utils.js +77 -75
  117. package/dist/collection/utils/components.utils.js.map +1 -1
  118. package/dist/collection/utils/components.utils.spec.js +150 -140
  119. package/dist/collection/utils/components.utils.spec.js.map +1 -1
  120. package/dist/collection/utils/e2e.test.utils.js +21 -21
  121. package/dist/collection/utils/e2e.test.utils.js.map +1 -1
  122. package/dist/collection/utils/locale.utils.js +17 -17
  123. package/dist/collection/utils/locale.utils.js.map +1 -1
  124. package/dist/collection/utils/locale.utils.spec.js +45 -45
  125. package/dist/collection/utils/locale.utils.spec.js.map +1 -1
  126. package/dist/collection/utils/playwright.e2e.test.utils.js +41 -41
  127. package/dist/collection/utils/playwright.e2e.test.utils.js.map +1 -1
  128. package/dist/collection/utils/playwright.fixture.js +24 -0
  129. package/dist/collection/utils/playwright.fixture.js.map +1 -0
  130. package/dist/collection/utils/unit.test.utils.js +50 -50
  131. package/dist/collection/utils/unit.test.utils.js.map +1 -1
  132. package/dist/components/MgInput.js +98 -98
  133. package/dist/components/MgInput.js.map +1 -1
  134. package/dist/components/components.utils.js +78 -76
  135. package/dist/components/components.utils.js.map +1 -1
  136. package/dist/components/index2.js +21 -21
  137. package/dist/components/index2.js.map +1 -1
  138. package/dist/components/mg-action-more.d.ts +2 -2
  139. package/dist/components/mg-action-more.js +173 -173
  140. package/dist/components/mg-action-more.js.map +1 -1
  141. package/dist/components/mg-badge.d.ts +2 -2
  142. package/dist/components/mg-badge2.js +83 -83
  143. package/dist/components/mg-badge2.js.map +1 -1
  144. package/dist/components/mg-button.d.ts +2 -2
  145. package/dist/components/mg-button2.js +182 -182
  146. package/dist/components/mg-button2.js.map +1 -1
  147. package/dist/components/mg-card.d.ts +2 -2
  148. package/dist/components/mg-card2.js +77 -77
  149. package/dist/components/mg-card2.js.map +1 -1
  150. package/dist/components/mg-character-left.d.ts +2 -2
  151. package/dist/components/mg-character-left2.js +50 -50
  152. package/dist/components/mg-character-left2.js.map +1 -1
  153. package/dist/components/mg-details.d.ts +2 -2
  154. package/dist/components/mg-details.js +69 -69
  155. package/dist/components/mg-details.js.map +1 -1
  156. package/dist/components/mg-divider.d.ts +2 -2
  157. package/dist/components/mg-divider.js +30 -30
  158. package/dist/components/mg-divider.js.map +1 -1
  159. package/dist/components/mg-form.d.ts +2 -2
  160. package/dist/components/mg-form.js +203 -171
  161. package/dist/components/mg-form.js.map +1 -1
  162. package/dist/components/mg-icon.d.ts +2 -2
  163. package/dist/components/mg-icon2.js +319 -317
  164. package/dist/components/mg-icon2.js.map +1 -1
  165. package/dist/components/mg-illustrated-message.d.ts +2 -2
  166. package/dist/components/mg-illustrated-message.js +51 -51
  167. package/dist/components/mg-illustrated-message.js.map +1 -1
  168. package/dist/components/mg-input-checkbox-paginated.d.ts +2 -2
  169. package/dist/components/mg-input-checkbox-paginated2.js +170 -170
  170. package/dist/components/mg-input-checkbox-paginated2.js.map +1 -1
  171. package/dist/components/mg-input-checkbox.d.ts +2 -2
  172. package/dist/components/mg-input-checkbox.js +477 -480
  173. package/dist/components/mg-input-checkbox.js.map +1 -1
  174. package/dist/components/mg-input-date.d.ts +2 -2
  175. package/dist/components/mg-input-date.js +265 -265
  176. package/dist/components/mg-input-date.js.map +1 -1
  177. package/dist/components/mg-input-numeric.d.ts +2 -2
  178. package/dist/components/mg-input-numeric.js +353 -353
  179. package/dist/components/mg-input-numeric.js.map +1 -1
  180. package/dist/components/mg-input-password.d.ts +2 -2
  181. package/dist/components/mg-input-password.js +204 -204
  182. package/dist/components/mg-input-password.js.map +1 -1
  183. package/dist/components/mg-input-radio.d.ts +2 -2
  184. package/dist/components/mg-input-radio.js +234 -234
  185. package/dist/components/mg-input-radio.js.map +1 -1
  186. package/dist/components/mg-input-select.d.ts +2 -2
  187. package/dist/components/mg-input-select2.js +315 -315
  188. package/dist/components/mg-input-select2.js.map +1 -1
  189. package/dist/components/mg-input-text.d.ts +2 -2
  190. package/dist/components/mg-input-text2.js +305 -305
  191. package/dist/components/mg-input-text2.js.map +1 -1
  192. package/dist/components/mg-input-textarea.d.ts +2 -2
  193. package/dist/components/mg-input-textarea.js +276 -276
  194. package/dist/components/mg-input-textarea.js.map +1 -1
  195. package/dist/components/mg-input-title.d.ts +2 -2
  196. package/dist/components/mg-input-title2.js +60 -60
  197. package/dist/components/mg-input-title2.js.map +1 -1
  198. package/dist/components/mg-input-toggle.d.ts +2 -2
  199. package/dist/components/mg-input-toggle.js +251 -251
  200. package/dist/components/mg-input-toggle.js.map +1 -1
  201. package/dist/components/mg-item-more.d.ts +2 -2
  202. package/dist/components/mg-item-more.js +298 -283
  203. package/dist/components/mg-item-more.js.map +1 -1
  204. package/dist/components/mg-menu-item.d.ts +2 -2
  205. package/dist/components/mg-menu-item2.js +345 -345
  206. package/dist/components/mg-menu-item2.js.map +1 -1
  207. package/dist/components/mg-menu.conf.js +2 -2
  208. package/dist/components/mg-menu.conf.js.map +1 -1
  209. package/dist/components/mg-menu.d.ts +2 -2
  210. package/dist/components/mg-menu2.js +176 -176
  211. package/dist/components/mg-menu2.js.map +1 -1
  212. package/dist/components/mg-message.d.ts +2 -2
  213. package/dist/components/mg-message.js +197 -192
  214. package/dist/components/mg-message.js.map +1 -1
  215. package/dist/components/mg-modal.d.ts +2 -2
  216. package/dist/components/mg-modal.js +198 -198
  217. package/dist/components/mg-modal.js.map +1 -1
  218. package/dist/components/mg-pagination.d.ts +2 -2
  219. package/dist/components/mg-pagination2.js +133 -133
  220. package/dist/components/mg-pagination2.js.map +1 -1
  221. package/dist/components/mg-panel.d.ts +2 -2
  222. package/dist/components/mg-panel.js +238 -238
  223. package/dist/components/mg-panel.js.map +1 -1
  224. package/dist/components/mg-popover-content.d.ts +2 -2
  225. package/dist/components/mg-popover-content2.js +69 -69
  226. package/dist/components/mg-popover-content2.js.map +1 -1
  227. package/dist/components/mg-popover.d.ts +2 -2
  228. package/dist/components/mg-popover2.js +224 -222
  229. package/dist/components/mg-popover2.js.map +1 -1
  230. package/dist/components/mg-skip-links.d.ts +2 -2
  231. package/dist/components/mg-skip-links.js +57 -57
  232. package/dist/components/mg-skip-links.js.map +1 -1
  233. package/dist/components/mg-tabs.d.ts +2 -2
  234. package/dist/components/mg-tabs.js +243 -243
  235. package/dist/components/mg-tabs.js.map +1 -1
  236. package/dist/components/mg-tag.d.ts +2 -2
  237. package/dist/components/mg-tag.js +97 -97
  238. package/dist/components/mg-tag.js.map +1 -1
  239. package/dist/components/mg-tooltip-content.d.ts +2 -2
  240. package/dist/components/mg-tooltip-content2.js +30 -30
  241. package/dist/components/mg-tooltip-content2.js.map +1 -1
  242. package/dist/components/mg-tooltip.d.ts +2 -2
  243. package/dist/components/mg-tooltip2.js +316 -316
  244. package/dist/components/mg-tooltip2.js.map +1 -1
  245. package/dist/esm/{components.utils-6cf27db1.js → components.utils-0d67c31c.js} +102 -100
  246. package/dist/esm/components.utils-0d67c31c.js.map +1 -0
  247. package/dist/esm/{index-0f833068.js → index-f34a3a2c.js} +185 -87
  248. package/dist/esm/index-f34a3a2c.js.map +1 -0
  249. package/dist/esm/loader.js +3 -3
  250. package/dist/esm/mg-action-more_34.entry.js +5140 -5107
  251. package/dist/esm/mg-action-more_34.entry.js.map +1 -1
  252. package/dist/esm/mg-components.js +4 -4
  253. package/dist/esm/mg-components.js.map +1 -1
  254. package/dist/esm/mg-item-more.entry.js +237 -222
  255. package/dist/esm/mg-item-more.entry.js.map +1 -1
  256. package/dist/mg-components/locales/fr/messages.json +4 -4
  257. package/dist/mg-components/mg-components.esm.js +1 -1
  258. package/dist/mg-components/mg-components.esm.js.map +1 -1
  259. package/dist/mg-components/p-7444ff40.js +3 -0
  260. package/dist/mg-components/p-7444ff40.js.map +1 -0
  261. package/dist/mg-components/p-af42d17b.js +2 -0
  262. package/dist/mg-components/p-af42d17b.js.map +1 -0
  263. package/dist/mg-components/p-ce356bc0.entry.js +2 -0
  264. package/dist/mg-components/p-ce356bc0.entry.js.map +1 -0
  265. package/dist/mg-components/p-e591ba8f.entry.js +2 -0
  266. package/dist/mg-components/p-e591ba8f.entry.js.map +1 -0
  267. package/dist/types/assets/icons/index.d.ts +193 -0
  268. package/dist/types/components/atoms/mg-badge/mg-badge.d.ts +41 -41
  269. package/dist/types/components/atoms/mg-button/mg-button.d.ts +100 -100
  270. package/dist/types/components/atoms/mg-card/mg-card.d.ts +39 -39
  271. package/dist/types/components/atoms/mg-character-left/mg-character-left.d.ts +37 -37
  272. package/dist/types/components/atoms/mg-divider/mg-divider.d.ts +12 -12
  273. package/dist/types/components/atoms/mg-icon/mg-icon.d.ts +56 -56
  274. package/dist/types/components/atoms/mg-input-title/mg-input-title.d.ts +34 -34
  275. package/dist/types/components/atoms/mg-tag/mg-tag.d.ts +51 -51
  276. package/dist/types/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.d.ts +12 -12
  277. package/dist/types/components/atoms/mg-tooltip/mg-tooltip.conf.d.ts +3 -3
  278. package/dist/types/components/atoms/mg-tooltip/mg-tooltip.d.ts +113 -113
  279. package/dist/types/components/molecules/inputs/MgInput.conf.d.ts +5 -5
  280. package/dist/types/components/molecules/inputs/MgInput.d.ts +16 -16
  281. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.d.ts +100 -100
  282. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.d.ts +26 -26
  283. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +262 -262
  284. package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.conf.d.ts +4 -4
  285. package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.d.ts +150 -150
  286. package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf.d.ts +4 -4
  287. package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +223 -223
  288. package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.d.ts +142 -142
  289. package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.conf.d.ts +3 -3
  290. package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +152 -152
  291. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.conf.d.ts +6 -6
  292. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +193 -193
  293. package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +195 -195
  294. package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +181 -181
  295. package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.conf.d.ts +2 -2
  296. package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +141 -141
  297. package/dist/types/components/molecules/menu/mg-menu/mg-menu.conf.d.ts +2 -2
  298. package/dist/types/components/molecules/menu/mg-menu/mg-menu.d.ts +97 -97
  299. package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.conf.d.ts +6 -6
  300. package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.d.ts +179 -179
  301. package/dist/types/components/molecules/mg-action-more/mg-action-more.conf.d.ts +12 -12
  302. package/dist/types/components/molecules/mg-action-more/mg-action-more.d.ts +72 -72
  303. package/dist/types/components/molecules/mg-details/mg-details.d.ts +45 -45
  304. package/dist/types/components/molecules/mg-form/mg-form.conf.d.ts +16 -0
  305. package/dist/types/components/molecules/mg-form/mg-form.d.ts +120 -103
  306. package/dist/types/components/molecules/mg-illustrated-message/mg-illustrated-message.d.ts +27 -27
  307. package/dist/types/components/molecules/mg-item-more/mg-item-more.conf.d.ts +5 -5
  308. package/dist/types/components/molecules/mg-item-more/mg-item-more.d.ts +67 -61
  309. package/dist/types/components/molecules/mg-message/mg-message.d.ts +100 -93
  310. package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +107 -107
  311. package/dist/types/components/molecules/mg-pagination/mg-pagination.conf.d.ts +2 -2
  312. package/dist/types/components/molecules/mg-pagination/mg-pagination.d.ts +74 -74
  313. package/dist/types/components/molecules/mg-panel/mg-panel.d.ts +149 -149
  314. package/dist/types/components/molecules/mg-popover/mg-popover-content/mg-popover-content.d.ts +43 -43
  315. package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +88 -88
  316. package/dist/types/components/molecules/mg-skip-links/mg-skip-links.conf.d.ts +2 -2
  317. package/dist/types/components/molecules/mg-skip-links/mg-skip-links.d.ts +40 -40
  318. package/dist/types/components/molecules/mg-tabs/mg-tabs.conf.d.ts +10 -10
  319. package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +118 -118
  320. package/dist/types/components.d.ts +312 -30
  321. package/dist/types/locales/index.d.ts +172 -172
  322. package/dist/types/stencil-public-runtime.d.ts +29 -0
  323. package/dist/types/utils/behaviors.utils.d.ts +65 -65
  324. package/dist/types/utils/components.utils.d.ts +32 -26
  325. package/dist/types/utils/locale.utils.d.ts +2 -2
  326. package/dist/types/utils/playwright.fixture.d.ts +3 -0
  327. package/dist/types/utils/unit.test.utils.d.ts +5 -5
  328. package/package.json +19 -33
  329. package/dist/cjs/components.utils-69435877.js.map +0 -1
  330. package/dist/cjs/index-60dd0c56.js.map +0 -1
  331. package/dist/collection/components/atoms/mg-badge/test/mg-badge.e2e.playwright.js +0 -33
  332. package/dist/collection/components/atoms/mg-badge/test/mg-badge.e2e.playwright.js.map +0 -1
  333. package/dist/collection/components/atoms/mg-badge/test/mg-badge.spec.js +0 -70
  334. package/dist/collection/components/atoms/mg-badge/test/mg-badge.spec.js.map +0 -1
  335. package/dist/collection/components/atoms/mg-button/test/mg-button.e2e.js +0 -91
  336. package/dist/collection/components/atoms/mg-button/test/mg-button.e2e.js.map +0 -1
  337. package/dist/collection/components/atoms/mg-button/test/mg-button.spec.js +0 -192
  338. package/dist/collection/components/atoms/mg-button/test/mg-button.spec.js.map +0 -1
  339. package/dist/collection/components/atoms/mg-card/test/mg-card.e2e.js +0 -36
  340. package/dist/collection/components/atoms/mg-card/test/mg-card.e2e.js.map +0 -1
  341. package/dist/collection/components/atoms/mg-card/test/mg-card.spec.js +0 -43
  342. package/dist/collection/components/atoms/mg-card/test/mg-card.spec.js.map +0 -1
  343. package/dist/collection/components/atoms/mg-character-left/test/mg-character-left.e2e.js +0 -15
  344. package/dist/collection/components/atoms/mg-character-left/test/mg-character-left.e2e.js.map +0 -1
  345. package/dist/collection/components/atoms/mg-character-left/test/mg-character-left.spec.js +0 -42
  346. package/dist/collection/components/atoms/mg-character-left/test/mg-character-left.spec.js.map +0 -1
  347. package/dist/collection/components/atoms/mg-divider/test/mg-divider.e2e.js +0 -11
  348. package/dist/collection/components/atoms/mg-divider/test/mg-divider.e2e.js.map +0 -1
  349. package/dist/collection/components/atoms/mg-divider/test/mg-divider.spec.js +0 -14
  350. package/dist/collection/components/atoms/mg-divider/test/mg-divider.spec.js.map +0 -1
  351. package/dist/collection/components/atoms/mg-icon/test/mg-icon.e2e.js +0 -55
  352. package/dist/collection/components/atoms/mg-icon/test/mg-icon.e2e.js.map +0 -1
  353. package/dist/collection/components/atoms/mg-icon/test/mg-icon.spec.js +0 -84
  354. package/dist/collection/components/atoms/mg-icon/test/mg-icon.spec.js.map +0 -1
  355. package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.e2e.playwright.js +0 -12
  356. package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.e2e.playwright.js.map +0 -1
  357. package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.spec.js +0 -23
  358. package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.spec.js.map +0 -1
  359. package/dist/collection/components/atoms/mg-tag/test/mg-tag.e2e.playwright.js +0 -23
  360. package/dist/collection/components/atoms/mg-tag/test/mg-tag.e2e.playwright.js.map +0 -1
  361. package/dist/collection/components/atoms/mg-tag/test/mg-tag.spec.js +0 -71
  362. package/dist/collection/components/atoms/mg-tag/test/mg-tag.spec.js.map +0 -1
  363. package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.e2e.js +0 -138
  364. package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.e2e.js.map +0 -1
  365. package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.spec.js +0 -272
  366. package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.spec.js.map +0 -1
  367. package/dist/collection/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.e2e.playwright.js +0 -237
  368. package/dist/collection/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.e2e.playwright.js.map +0 -1
  369. package/dist/collection/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.spec.js +0 -634
  370. package/dist/collection/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.spec.js.map +0 -1
  371. package/dist/collection/components/molecules/inputs/mg-input-date/test/mg-input-date.e2e.js +0 -123
  372. package/dist/collection/components/molecules/inputs/mg-input-date/test/mg-input-date.e2e.js.map +0 -1
  373. package/dist/collection/components/molecules/inputs/mg-input-date/test/mg-input-date.spec.js +0 -383
  374. package/dist/collection/components/molecules/inputs/mg-input-date/test/mg-input-date.spec.js.map +0 -1
  375. package/dist/collection/components/molecules/inputs/mg-input-numeric/test/mg-input-numeric.e2e.js +0 -212
  376. package/dist/collection/components/molecules/inputs/mg-input-numeric/test/mg-input-numeric.e2e.js.map +0 -1
  377. package/dist/collection/components/molecules/inputs/mg-input-numeric/test/mg-input-numeric.spec.js +0 -460
  378. package/dist/collection/components/molecules/inputs/mg-input-numeric/test/mg-input-numeric.spec.js.map +0 -1
  379. package/dist/collection/components/molecules/inputs/mg-input-password/test/mg-input-password.e2e.js +0 -115
  380. package/dist/collection/components/molecules/inputs/mg-input-password/test/mg-input-password.e2e.js.map +0 -1
  381. package/dist/collection/components/molecules/inputs/mg-input-password/test/mg-input-password.spec.js +0 -293
  382. package/dist/collection/components/molecules/inputs/mg-input-password/test/mg-input-password.spec.js.map +0 -1
  383. package/dist/collection/components/molecules/inputs/mg-input-radio/test/mg-input-radio.e2e.js +0 -154
  384. package/dist/collection/components/molecules/inputs/mg-input-radio/test/mg-input-radio.e2e.js.map +0 -1
  385. package/dist/collection/components/molecules/inputs/mg-input-radio/test/mg-input-radio.spec.js +0 -359
  386. package/dist/collection/components/molecules/inputs/mg-input-radio/test/mg-input-radio.spec.js.map +0 -1
  387. package/dist/collection/components/molecules/inputs/mg-input-select/test/mg-input-select.e2e.js +0 -194
  388. package/dist/collection/components/molecules/inputs/mg-input-select/test/mg-input-select.e2e.js.map +0 -1
  389. package/dist/collection/components/molecules/inputs/mg-input-select/test/mg-input-select.spec.js +0 -403
  390. package/dist/collection/components/molecules/inputs/mg-input-select/test/mg-input-select.spec.js.map +0 -1
  391. package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.e2e.playwright.js +0 -147
  392. package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.e2e.playwright.js.map +0 -1
  393. package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.spec.js +0 -355
  394. package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.spec.js.map +0 -1
  395. package/dist/collection/components/molecules/inputs/mg-input-textarea/test/mg-input-textarea.e2e.js +0 -129
  396. package/dist/collection/components/molecules/inputs/mg-input-textarea/test/mg-input-textarea.e2e.js.map +0 -1
  397. package/dist/collection/components/molecules/inputs/mg-input-textarea/test/mg-input-textarea.spec.js +0 -320
  398. package/dist/collection/components/molecules/inputs/mg-input-textarea/test/mg-input-textarea.spec.js.map +0 -1
  399. package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.e2e.playwright.js +0 -108
  400. package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.e2e.playwright.js.map +0 -1
  401. package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.spec.js +0 -247
  402. package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.spec.js.map +0 -1
  403. package/dist/collection/components/molecules/menu/mg-menu/test/mg-menu.e2e.playwright.js +0 -239
  404. package/dist/collection/components/molecules/menu/mg-menu/test/mg-menu.e2e.playwright.js.map +0 -1
  405. package/dist/collection/components/molecules/menu/mg-menu/test/mg-menu.spec.js +0 -175
  406. package/dist/collection/components/molecules/menu/mg-menu/test/mg-menu.spec.js.map +0 -1
  407. package/dist/collection/components/molecules/menu/mg-menu-item/test/mg-menu-item.e2e.playwright.js +0 -100
  408. package/dist/collection/components/molecules/menu/mg-menu-item/test/mg-menu-item.e2e.playwright.js.map +0 -1
  409. package/dist/collection/components/molecules/menu/mg-menu-item/test/mg-menu-item.spec.js +0 -295
  410. package/dist/collection/components/molecules/menu/mg-menu-item/test/mg-menu-item.spec.js.map +0 -1
  411. package/dist/collection/components/molecules/mg-action-more/test/mg-action-more.e2e.playwright.js +0 -136
  412. package/dist/collection/components/molecules/mg-action-more/test/mg-action-more.e2e.playwright.js.map +0 -1
  413. package/dist/collection/components/molecules/mg-action-more/test/mg-action-more.spec.js +0 -195
  414. package/dist/collection/components/molecules/mg-action-more/test/mg-action-more.spec.js.map +0 -1
  415. package/dist/collection/components/molecules/mg-details/test/mg-details.e2e.playwright.js +0 -30
  416. package/dist/collection/components/molecules/mg-details/test/mg-details.e2e.playwright.js.map +0 -1
  417. package/dist/collection/components/molecules/mg-details/test/mg-details.spec.js +0 -42
  418. package/dist/collection/components/molecules/mg-details/test/mg-details.spec.js.map +0 -1
  419. package/dist/collection/components/molecules/mg-form/test/mg-form.e2e.js +0 -169
  420. package/dist/collection/components/molecules/mg-form/test/mg-form.e2e.js.map +0 -1
  421. package/dist/collection/components/molecules/mg-form/test/mg-form.spec.js +0 -292
  422. package/dist/collection/components/molecules/mg-form/test/mg-form.spec.js.map +0 -1
  423. package/dist/collection/components/molecules/mg-illustrated-message/test/mg-illustrated-message.e2e.js +0 -39
  424. package/dist/collection/components/molecules/mg-illustrated-message/test/mg-illustrated-message.e2e.js.map +0 -1
  425. package/dist/collection/components/molecules/mg-illustrated-message/test/mg-illustrated-message.spec.js +0 -36
  426. package/dist/collection/components/molecules/mg-illustrated-message/test/mg-illustrated-message.spec.js.map +0 -1
  427. package/dist/collection/components/molecules/mg-item-more/test/mg-item-more.e2e.playwright.js +0 -85
  428. package/dist/collection/components/molecules/mg-item-more/test/mg-item-more.e2e.playwright.js.map +0 -1
  429. package/dist/collection/components/molecules/mg-item-more/test/mg-item-more.spec.js +0 -106
  430. package/dist/collection/components/molecules/mg-item-more/test/mg-item-more.spec.js.map +0 -1
  431. package/dist/collection/components/molecules/mg-message/test/mg-message.e2e.js +0 -64
  432. package/dist/collection/components/molecules/mg-message/test/mg-message.e2e.js.map +0 -1
  433. package/dist/collection/components/molecules/mg-message/test/mg-message.spec.js +0 -109
  434. package/dist/collection/components/molecules/mg-message/test/mg-message.spec.js.map +0 -1
  435. package/dist/collection/components/molecules/mg-modal/test/mg-modal.e2e.playwright.js +0 -62
  436. package/dist/collection/components/molecules/mg-modal/test/mg-modal.e2e.playwright.js.map +0 -1
  437. package/dist/collection/components/molecules/mg-modal/test/mg-modal.e2e.template.js +0 -40
  438. package/dist/collection/components/molecules/mg-modal/test/mg-modal.e2e.template.js.map +0 -1
  439. package/dist/collection/components/molecules/mg-modal/test/mg-modal.firefox.e2e.playwright.js +0 -26
  440. package/dist/collection/components/molecules/mg-modal/test/mg-modal.firefox.e2e.playwright.js.map +0 -1
  441. package/dist/collection/components/molecules/mg-modal/test/mg-modal.spec.js +0 -122
  442. package/dist/collection/components/molecules/mg-modal/test/mg-modal.spec.js.map +0 -1
  443. package/dist/collection/components/molecules/mg-pagination/test/mg-pagination.e2e.playwright.js +0 -57
  444. package/dist/collection/components/molecules/mg-pagination/test/mg-pagination.e2e.playwright.js.map +0 -1
  445. package/dist/collection/components/molecules/mg-pagination/test/mg-pagination.spec.js +0 -121
  446. package/dist/collection/components/molecules/mg-pagination/test/mg-pagination.spec.js.map +0 -1
  447. package/dist/collection/components/molecules/mg-panel/test/mg-panel.e2e.playwright.js +0 -106
  448. package/dist/collection/components/molecules/mg-panel/test/mg-panel.e2e.playwright.js.map +0 -1
  449. package/dist/collection/components/molecules/mg-panel/test/mg-panel.spec.js +0 -213
  450. package/dist/collection/components/molecules/mg-panel/test/mg-panel.spec.js.map +0 -1
  451. package/dist/collection/components/molecules/mg-popover/test/mg-popover.e2e.playwright.js +0 -140
  452. package/dist/collection/components/molecules/mg-popover/test/mg-popover.e2e.playwright.js.map +0 -1
  453. package/dist/collection/components/molecules/mg-popover/test/mg-popover.spec.js +0 -142
  454. package/dist/collection/components/molecules/mg-popover/test/mg-popover.spec.js.map +0 -1
  455. package/dist/collection/components/molecules/mg-skip-links/test/mg-skip-links.e2e.js +0 -55
  456. package/dist/collection/components/molecules/mg-skip-links/test/mg-skip-links.e2e.js.map +0 -1
  457. package/dist/collection/components/molecules/mg-skip-links/test/mg-skip-links.spec.js +0 -55
  458. package/dist/collection/components/molecules/mg-skip-links/test/mg-skip-links.spec.js.map +0 -1
  459. package/dist/collection/components/molecules/mg-tabs/test/mg-tabs.e2e.playwright.js +0 -76
  460. package/dist/collection/components/molecules/mg-tabs/test/mg-tabs.e2e.playwright.js.map +0 -1
  461. package/dist/collection/components/molecules/mg-tabs/test/mg-tabs.spec.js +0 -332
  462. package/dist/collection/components/molecules/mg-tabs/test/mg-tabs.spec.js.map +0 -1
  463. package/dist/collection/utils/stencil.e2e.test.utils.js +0 -33
  464. package/dist/collection/utils/stencil.e2e.test.utils.js.map +0 -1
  465. package/dist/esm/components.utils-6cf27db1.js.map +0 -1
  466. package/dist/esm/index-0f833068.js.map +0 -1
  467. package/dist/mg-components/p-10ed4425.entry.js +0 -2
  468. package/dist/mg-components/p-10ed4425.entry.js.map +0 -1
  469. package/dist/mg-components/p-36a51c5e.js +0 -2
  470. package/dist/mg-components/p-36a51c5e.js.map +0 -1
  471. package/dist/mg-components/p-91feda5a.entry.js +0 -2
  472. package/dist/mg-components/p-91feda5a.entry.js.map +0 -1
  473. package/dist/mg-components/p-9b12021b.js +0 -3
  474. package/dist/mg-components/p-9b12021b.js.map +0 -1
  475. package/dist/types/components/atoms/mg-badge/test/mg-badge.e2e.playwright.d.ts +0 -1
  476. package/dist/types/components/atoms/mg-input-title/test/mg-input-title.e2e.playwright.d.ts +0 -1
  477. package/dist/types/components/atoms/mg-tag/test/mg-tag.e2e.playwright.d.ts +0 -1
  478. package/dist/types/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.e2e.playwright.d.ts +0 -1
  479. package/dist/types/components/molecules/inputs/mg-input-text/test/mg-input-text.e2e.playwright.d.ts +0 -1
  480. package/dist/types/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.e2e.playwright.d.ts +0 -1
  481. package/dist/types/components/molecules/menu/mg-menu/test/mg-menu.e2e.playwright.d.ts +0 -1
  482. package/dist/types/components/molecules/menu/mg-menu-item/test/mg-menu-item.e2e.playwright.d.ts +0 -1
  483. package/dist/types/components/molecules/mg-action-more/test/mg-action-more.e2e.playwright.d.ts +0 -2
  484. package/dist/types/components/molecules/mg-details/test/mg-details.e2e.playwright.d.ts +0 -1
  485. package/dist/types/components/molecules/mg-item-more/test/mg-item-more.e2e.playwright.d.ts +0 -1
  486. package/dist/types/components/molecules/mg-modal/test/mg-modal.e2e.playwright.d.ts +0 -1
  487. package/dist/types/components/molecules/mg-modal/test/mg-modal.e2e.template.d.ts +0 -12
  488. package/dist/types/components/molecules/mg-modal/test/mg-modal.firefox.e2e.playwright.d.ts +0 -1
  489. package/dist/types/components/molecules/mg-pagination/test/mg-pagination.e2e.playwright.d.ts +0 -1
  490. package/dist/types/components/molecules/mg-panel/test/mg-panel.e2e.playwright.d.ts +0 -1
  491. package/dist/types/components/molecules/mg-popover/test/mg-popover.e2e.playwright.d.ts +0 -1
  492. package/dist/types/components/molecules/mg-tabs/test/mg-tabs.e2e.playwright.d.ts +0 -1
  493. package/dist/types/utils/stencil.e2e.test.utils.d.ts +0 -14
@@ -1 +1 @@
1
- {"file":"mg-input-password.js","mappings":";;;;;;;;;AAAA,MAAM,kBAAkB,GAAG,soLAAsoL;;MCWppLA,iBAAe;;;;;;;;IAYlB,sBAAiB,GAAG,KAAK,CAAC;;;;IA4K1B,gBAAW,GAAG;MACpB,IAAI,CAAC,aAAa,EAAE,CAAC;MACrB,IAAI,IAAI,CAAC,iBAAiB,EAAE;QAC1B,IAAI,CAAC,eAAe,EAAE,CAAC;OACxB;MACD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;KAC/B,CAAC;;;;IAKM,eAAU,GAAG;MACnB,IAAI,CAAC,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;MACtC,IAAI,CAAC,YAAY,EAAE,CAAC,OAAO,CAAC;;QAE1B,IAAI,CAAC,iBAAiB,GAAG,SAAS,CAAC;OACpC,CAAC,CAAC;KACJ,CAAC;;;;IAKM,kBAAa,GAAG;;MACtB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,KAAK,CAA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gInputPassword"],"sources":["../styles/dist/components/mg-input-password.css?tag=mg-input-password&encapsulation=shadow","src/components/molecules/inputs/mg-input-password/mg-input-password.tsx"],"sourcesContent":[":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}}/*# sourceMappingURL=mg-input-password.css.map */\n","import { Component, Element, Event, h, Prop, EventEmitter, State, Method, Watch } from '@stencil/core';\nimport { MgInput } from '../MgInput';\nimport { Handler, Width } from '../MgInput.conf';\nimport { ClassList, isValidString } from '../../../../utils/components.utils';\nimport { initLocales } from '../../../../locales';\n\n@Component({\n tag: 'mg-input-password',\n styleUrl: '../../../../../node_modules/@mgdis/styles/dist/components/mg-input-password.css',\n shadow: true,\n})\nexport class MgInputPassword {\n /************\n * Internal *\n ************/\n\n // HTML selector\n private input: HTMLInputElement;\n\n // Locales\n private messages;\n\n // hasDisplayedError (triggered by blur event)\n private hasDisplayedError = false;\n private handlerInProgress: Handler;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgInputPasswordElement;\n\n /**\n * Component value\n */\n @Prop({ mutable: true, reflect: true }) value: string;\n @Watch('value')\n handleValue(newValue: string): void {\n this.valueChange.emit(newValue);\n }\n\n /**\n * Identifier is used for the element ID (id is a reserved prop in Stencil.js)\n */\n @Prop() identifier!: string;\n\n /**\n * Input name\n * If not set the value equals the identifier\n */\n @Prop() name: string = this.identifier;\n\n /**\n * Input label\n */\n @Prop() label!: string;\n\n /**\n * Define if label is displayed on top\n */\n @Prop() labelOnTop: boolean;\n\n /**\n * Define if label is visible\n */\n @Prop() labelHide = false;\n\n /**\n * Input placeholder.\n * It should be a word or short phrase that demonstrates the expected type of data, not a replacement for labels or help text.\n */\n @Prop() placeholder: string;\n\n /**\n * Define if input is required\n */\n @Prop() required = false;\n\n /**\n * Define if input is readonly\n */\n @Prop() readonly = false;\n\n /**\n * Define if input is disabled\n */\n @Prop() disabled = false;\n @Watch('required')\n @Watch('readonly')\n @Watch('disabled')\n handleValidityChange(newValue: boolean, _oldValue: boolean, prop: string): void {\n if (this.input !== undefined) {\n this.input[prop] = newValue;\n this.checkValidity();\n if (this.hasDisplayedError) {\n this.setErrorMessage();\n this.hasDisplayedError = false;\n }\n }\n }\n\n /**\n * Define input width\n */\n @Prop() mgWidth: Width = 'full';\n\n /**\n * Add a tooltip message next to the input\n */\n @Prop() tooltip: string;\n\n /**\n * Add a help text under the input, usually expected data format and example\n */\n @Prop() helpText: string;\n\n /**\n * Define input valid state\n */\n @Prop({ mutable: true }) valid: boolean;\n\n /**\n * Define input invalid state\n */\n @Prop({ mutable: true }) invalid: boolean;\n\n /**\n * Component classes\n */\n @State() classCollection: ClassList = new ClassList(['mg-c-input--password']);\n\n /**\n * Error message to display\n */\n @State() errorMessage: string;\n\n /**\n * Emited event when value change\n */\n @Event({ eventName: 'value-change' }) valueChange: EventEmitter<string>;\n\n /**\n * Emited event when checking validity\n */\n @Event({ eventName: 'input-valid' }) inputValid: EventEmitter<boolean>;\n\n /**\n * Display input error if it exists.\n */\n @Method()\n async displayError(): Promise<void> {\n this.checkValidity();\n this.setErrorMessage();\n this.hasDisplayedError = this.invalid;\n }\n\n /**\n * Set an error and display a custom error message.\n * This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.\n * It must be paired with an error message to display for the given context.\n * When used to set validity to `false`, you should use this method again to reset the validity to `true`.\n * @param valid - value indicating the validity\n * @param errorMessage - the error message to display\n */\n @Method()\n async setError(valid: MgInputPassword['valid'], errorMessage: string): Promise<void> {\n if (typeof valid !== 'boolean') {\n throw new Error('<mg-input-password> method \"setError()\" param \"valid\" must be a boolean');\n } else if (!isValidString(errorMessage)) {\n throw new Error('<mg-input-password> method \"setError()\" param \"errorMessage\" must be a string');\n } else {\n this.setValidity(valid);\n this.setErrorMessage(valid ? undefined : errorMessage);\n this.hasDisplayedError = this.invalid;\n }\n }\n\n /**\n * Method to set validity values\n * @param newValue - valid new value\n */\n private setValidity(newValue: MgInputPassword['valid']) {\n const oldValidValue = this.valid;\n this.valid = newValue;\n this.invalid = !this.valid;\n // We need to send valid event even if it is the same value\n if (this.handlerInProgress === undefined || (this.handlerInProgress === Handler.BLUR && this.valid !== oldValidValue)) this.inputValid.emit(this.valid);\n }\n\n /**\n * Handle input event\n */\n private handleInput = (): void => {\n this.checkValidity();\n if (this.hasDisplayedError) {\n this.setErrorMessage();\n }\n this.value = this.input.value;\n };\n\n /**\n * Handle blur event\n */\n private handleBlur = (): void => {\n this.handlerInProgress = Handler.BLUR;\n this.displayError().finally(() => {\n // reset guard\n this.handlerInProgress = undefined;\n });\n };\n\n /**\n * Check if input is valid\n */\n private checkValidity = (): void => {\n this.setValidity(this.readonly || this.disabled || (this.input?.checkValidity !== undefined ? this.input.checkValidity() : true));\n };\n\n /**\n * Set input error message\n * @param errorMessage - errorMessage override\n */\n private setErrorMessage = (errorMessage?: string): void => {\n // Set error message\n this.errorMessage = undefined;\n if (!this.valid) {\n if (errorMessage !== undefined) {\n this.errorMessage = errorMessage;\n }\n // required\n else if (this.input.validity.valueMissing) {\n this.errorMessage = this.messages.errors.required;\n }\n }\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Check if component props are well configured on init\n * @returns timeout\n */\n componentWillLoad(): ReturnType<typeof setTimeout> {\n // Get locales\n this.messages = initLocales(this.element).messages;\n // Check validity when component is ready\n // return a promise to process action only in the FIRST render().\n // https://stenciljs.com/docs/component-lifecycle#componentwillload\n return setTimeout(() => {\n this.checkValidity();\n }, 0);\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <MgInput\n identifier={this.identifier}\n classCollection={this.classCollection}\n ariaDescribedbyIDs={[]}\n label={this.label}\n labelOnTop={this.labelOnTop}\n labelHide={this.labelHide}\n required={this.required}\n readonly={this.readonly}\n mgWidth={this.mgWidth}\n disabled={this.disabled}\n value={this.value}\n readonlyValue={this.value !== undefined ? '•'.repeat(this.value.length) : undefined}\n tooltip={this.tooltip}\n helpText={this.helpText}\n errorMessage={this.errorMessage}\n isFieldset={false}\n >\n <input\n type=\"password\"\n class=\"mg-c-input__box\"\n value={this.value}\n id={this.identifier}\n name={this.name}\n placeholder={this.placeholder}\n title={this.placeholder}\n disabled={this.disabled}\n required={this.required}\n aria-invalid={(this.invalid === true).toString()}\n onInput={this.handleInput}\n onBlur={this.handleBlur}\n ref={(el: HTMLInputElement) => {\n if (el !== null) this.input = el;\n }}\n />\n </MgInput>\n );\n }\n}\n"],"version":3}
1
+ {"file":"mg-input-password.js","mappings":";;;;;;;;;AAAA,MAAM,kBAAkB,GAAG,soLAAsoL;;MCWppLA,iBAAe;;;;;;;;QAYlB,sBAAiB,GAAG,K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,CAAC,UAAU,EACnB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,KAAK,EAAE,IAAI,CAAC,WAAW,EACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,kBACT,CAAC,IAAI,CAAC,OAAO,KAAK,IAAI,EAAE,QAAQ,EAAE,EAChD,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,MAAM,EAAE,IAAI,CAAC,UAAU,EACvB,GAAG,EAAE,CAAC,EAAoB;gBACxB,IAAI,EAAE,KAAK,IAAI;oBAAE,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;aAClC,GACD,CACM,EACV;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["MgInputPassword"],"sources":["../styles/dist/components/mg-input-password.css?tag=mg-input-password&encapsulation=shadow","src/components/molecules/inputs/mg-input-password/mg-input-password.tsx"],"sourcesContent":[":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}}/*# sourceMappingURL=mg-input-password.css.map */\n","import { Component, Element, Event, h, Prop, EventEmitter, State, Method, Watch } from '@stencil/core';\nimport { MgInput } from '../MgInput';\nimport { Handler, Width } from '../MgInput.conf';\nimport { ClassList, isValidString } from '../../../../utils/components.utils';\nimport { initLocales } from '../../../../locales';\n\n@Component({\n tag: 'mg-input-password',\n styleUrl: '../../../../../node_modules/@mgdis/styles/dist/components/mg-input-password.css',\n shadow: true,\n})\nexport class MgInputPassword {\n /************\n * Internal *\n ************/\n\n // HTML selector\n private input: HTMLInputElement;\n\n // Locales\n private messages;\n\n // hasDisplayedError (triggered by blur event)\n private hasDisplayedError = false;\n private handlerInProgress: Handler;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgInputPasswordElement;\n\n /**\n * Component value\n */\n @Prop({ mutable: true, reflect: true }) value: string;\n @Watch('value')\n handleValue(newValue: string): void {\n this.valueChange.emit(newValue);\n }\n\n /**\n * Identifier is used for the element ID (id is a reserved prop in Stencil.js)\n */\n @Prop() identifier!: string;\n\n /**\n * Input name\n * If not set the value equals the identifier\n */\n @Prop() name: string = this.identifier;\n\n /**\n * Input label\n */\n @Prop() label!: string;\n\n /**\n * Define if label is displayed on top\n */\n @Prop() labelOnTop: boolean;\n\n /**\n * Define if label is visible\n */\n @Prop() labelHide = false;\n\n /**\n * Input placeholder.\n * It should be a word or short phrase that demonstrates the expected type of data, not a replacement for labels or help text.\n */\n @Prop() placeholder: string;\n\n /**\n * Define if input is required\n */\n @Prop() required = false;\n\n /**\n * Define if input is readonly\n */\n @Prop() readonly = false;\n\n /**\n * Define if input is disabled\n */\n @Prop() disabled = false;\n @Watch('required')\n @Watch('readonly')\n @Watch('disabled')\n handleValidityChange(newValue: boolean, _oldValue: boolean, prop: string): void {\n if (this.input !== undefined) {\n this.input[prop] = newValue;\n this.checkValidity();\n if (this.hasDisplayedError) {\n this.setErrorMessage();\n this.hasDisplayedError = false;\n }\n }\n }\n\n /**\n * Define input width\n */\n @Prop() mgWidth: Width = 'full';\n\n /**\n * Add a tooltip message next to the input\n */\n @Prop() tooltip: string;\n\n /**\n * Add a help text under the input, usually expected data format and example\n */\n @Prop() helpText: string;\n\n /**\n * Define input valid state\n */\n @Prop({ mutable: true }) valid: boolean;\n\n /**\n * Define input invalid state\n */\n @Prop({ mutable: true }) invalid: boolean;\n\n /**\n * Component classes\n */\n @State() classCollection: ClassList = new ClassList(['mg-c-input--password']);\n\n /**\n * Error message to display\n */\n @State() errorMessage: string;\n\n /**\n * Emited event when value change\n */\n @Event({ eventName: 'value-change' }) valueChange: EventEmitter<HTMLMgInputPasswordElement['value']>;\n\n /**\n * Emited event when checking validity\n */\n @Event({ eventName: 'input-valid' }) inputValid: EventEmitter<HTMLMgInputPasswordElement['valid']>;\n\n /**\n * Display input error if it exists.\n */\n @Method()\n async displayError(): Promise<void> {\n this.checkValidity();\n this.setErrorMessage();\n this.hasDisplayedError = this.invalid;\n }\n\n /**\n * Set an error and display a custom error message.\n * This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.\n * It must be paired with an error message to display for the given context.\n * When used to set validity to `false`, you should use this method again to reset the validity to `true`.\n * @param valid - value indicating the validity\n * @param errorMessage - the error message to display\n */\n @Method()\n async setError(valid: MgInputPassword['valid'], errorMessage: string): Promise<void> {\n if (typeof valid !== 'boolean') {\n throw new Error('<mg-input-password> method \"setError()\" param \"valid\" must be a boolean');\n } else if (!isValidString(errorMessage)) {\n throw new Error('<mg-input-password> method \"setError()\" param \"errorMessage\" must be a string');\n } else {\n this.setValidity(valid);\n this.setErrorMessage(valid ? undefined : errorMessage);\n this.hasDisplayedError = this.invalid;\n }\n }\n\n /**\n * Method to set validity values\n * @param newValue - valid new value\n */\n private setValidity(newValue: MgInputPassword['valid']) {\n const oldValidValue = this.valid;\n this.valid = newValue;\n this.invalid = !this.valid;\n // We need to send valid event even if it is the same value\n if (this.handlerInProgress === undefined || (this.handlerInProgress === Handler.BLUR && this.valid !== oldValidValue)) this.inputValid.emit(this.valid);\n }\n\n /**\n * Handle input event\n */\n private handleInput = (): void => {\n this.checkValidity();\n if (this.hasDisplayedError) {\n this.setErrorMessage();\n }\n this.value = this.input.value;\n };\n\n /**\n * Handle blur event\n */\n private handleBlur = (): void => {\n this.handlerInProgress = Handler.BLUR;\n this.displayError().finally(() => {\n // reset guard\n this.handlerInProgress = undefined;\n });\n };\n\n /**\n * Check if input is valid\n */\n private checkValidity = (): void => {\n this.setValidity(this.readonly || this.disabled || (this.input?.checkValidity !== undefined ? this.input.checkValidity() : true));\n };\n\n /**\n * Set input error message\n * @param errorMessage - errorMessage override\n */\n private setErrorMessage = (errorMessage?: string): void => {\n // Set error message\n this.errorMessage = undefined;\n if (!this.valid) {\n if (errorMessage !== undefined) {\n this.errorMessage = errorMessage;\n }\n // required\n else if (this.input.validity.valueMissing) {\n this.errorMessage = this.messages.errors.required;\n }\n }\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Check if component props are well configured on init\n * @returns timeout\n */\n componentWillLoad(): ReturnType<typeof setTimeout> {\n // Get locales\n this.messages = initLocales(this.element).messages;\n // Check validity when component is ready\n // return a promise to process action only in the FIRST render().\n // https://stenciljs.com/docs/component-lifecycle#componentwillload\n return setTimeout(() => {\n this.checkValidity();\n }, 0);\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <MgInput\n identifier={this.identifier}\n classCollection={this.classCollection}\n ariaDescribedbyIDs={[]}\n label={this.label}\n labelOnTop={this.labelOnTop}\n labelHide={this.labelHide}\n required={this.required}\n readonly={this.readonly}\n mgWidth={this.mgWidth}\n disabled={this.disabled}\n value={this.value}\n readonlyValue={this.value !== undefined ? '•'.repeat(this.value.length) : undefined}\n tooltip={this.tooltip}\n helpText={this.helpText}\n errorMessage={this.errorMessage}\n isFieldset={false}\n >\n <input\n type=\"password\"\n class=\"mg-c-input__box\"\n value={this.value}\n id={this.identifier}\n name={this.name}\n placeholder={this.placeholder}\n title={this.placeholder}\n disabled={this.disabled}\n required={this.required}\n aria-invalid={(this.invalid === true).toString()}\n onInput={this.handleInput}\n onBlur={this.handleBlur}\n ref={(el: HTMLInputElement) => {\n if (el !== null) this.input = el;\n }}\n />\n </MgInput>\n );\n }\n}\n"],"version":3}
@@ -2,8 +2,8 @@ import type { Components, JSX } from "../types/components";
2
2
 
3
3
  interface MgInputRadio extends Components.MgInputRadio, HTMLElement {}
4
4
  export const MgInputRadio: {
5
- prototype: MgInputRadio;
6
- new (): MgInputRadio;
5
+ prototype: MgInputRadio;
6
+ new (): MgInputRadio;
7
7
  };
8
8
  /**
9
9
  * Used to define this component and all nested components recursively.
@@ -16,253 +16,253 @@ const mgInputRadioCss = ":host{display:block}.mg-c-input__input mg-icon,.mg-c-in
16
16
  */
17
17
  const isOption = (option) => typeof option === 'object' && typeof option.title === 'string' && option.value !== undefined;
18
18
  const MgInputRadio$1 = /*@__PURE__*/ proxyCustomElement(class MgInputRadio extends HTMLElement {
19
- constructor() {
20
- super();
21
- this.__registerHost();
22
- this.__attachShadow();
23
- this.valueChange = createEvent(this, "value-change", 7);
24
- this.inputValid = createEvent(this, "input-valid", 7);
25
- /************
26
- * Internal *
27
- ************/
28
- // HTML selector
29
- this.inputs = [];
30
- // hasDisplayedError (triggered by blur event)
31
- this.hasDisplayedError = false;
32
- /**
33
- * Handle input event
34
- * @param event - input event
35
- */
36
- this.handleInput = (event) => {
37
- this.checkValidity();
38
- this.value = this.options[event.target.value].value;
39
- };
40
- /**
41
- * Handle blur event
42
- */
43
- this.handleBlur = () => {
44
- this.handlerInProgress = Handler.BLUR;
45
- this.checkValidity();
46
- this.setErrorMessage();
47
- // reset guard
48
- this.handlerInProgress = undefined;
49
- };
19
+ constructor() {
20
+ super();
21
+ this.__registerHost();
22
+ this.__attachShadow();
23
+ this.valueChange = createEvent(this, "value-change", 7);
24
+ this.inputValid = createEvent(this, "input-valid", 7);
25
+ /************
26
+ * Internal *
27
+ ************/
28
+ // HTML selector
29
+ this.inputs = [];
30
+ // hasDisplayedError (triggered by blur event)
31
+ this.hasDisplayedError = false;
32
+ /**
33
+ * Handle input event
34
+ * @param event - input event
35
+ */
36
+ this.handleInput = (event) => {
37
+ this.checkValidity();
38
+ this.value = this.options[event.target.value].value;
39
+ };
40
+ /**
41
+ * Handle blur event
42
+ */
43
+ this.handleBlur = () => {
44
+ this.handlerInProgress = Handler.BLUR;
45
+ this.checkValidity();
46
+ this.setErrorMessage();
47
+ // reset guard
48
+ this.handlerInProgress = undefined;
49
+ };
50
+ /**
51
+ * Check if input is valid
52
+ */
53
+ this.checkValidity = () => {
54
+ this.setValidity(this.readonly || this.disabled || this.getInvalidElement() === undefined);
55
+ };
56
+ /**
57
+ * Set input error message
58
+ * @param errorMessage - errorMessage override
59
+ */
60
+ this.setErrorMessage = (errorMessage) => {
61
+ const invalidElement = this.getInvalidElement();
62
+ // Set error message
63
+ this.errorMessage = undefined;
64
+ if (!this.valid) {
65
+ if (errorMessage !== undefined) {
66
+ this.errorMessage = errorMessage;
67
+ }
68
+ else if (invalidElement.validity.valueMissing) {
69
+ this.errorMessage = this.messages.errors.required;
70
+ }
71
+ }
72
+ };
73
+ /**
74
+ * get invalid element
75
+ * @returns element
76
+ */
77
+ this.getInvalidElement = () => this.inputs.find((input) => !input.disabled && !input.readOnly && !input.checkValidity());
78
+ this.value = undefined;
79
+ this.items = undefined;
80
+ this.identifier = undefined;
81
+ this.name = this.identifier;
82
+ this.label = undefined;
83
+ this.labelOnTop = false;
84
+ this.labelHide = false;
85
+ this.inputVerticalList = false;
86
+ this.required = false;
87
+ this.readonly = false;
88
+ this.disabled = false;
89
+ this.tooltip = undefined;
90
+ this.helpText = undefined;
91
+ this.valid = undefined;
92
+ this.invalid = undefined;
93
+ this.classCollection = new ClassList(['mg-c-input--radio']);
94
+ this.errorMessage = undefined;
95
+ this.options = undefined;
96
+ }
97
+ handleValue(newValue) {
98
+ this.valueChange.emit(newValue);
99
+ }
100
+ validateItems(newValue) {
101
+ // Validate if items have required min length
102
+ if (typeof newValue === 'object' && newValue.length < 2) {
103
+ throw new Error('<mg-input-radio> prop "items" require at least 2 items.');
104
+ }
105
+ // String array
106
+ else if (allItemsAreString(newValue)) {
107
+ this.options = newValue.map(item => ({ title: item, value: item, disabled: this.disabled }));
108
+ }
109
+ // Object array
110
+ else if (newValue && newValue.every(item => isOption(item))) {
111
+ this.options = newValue;
112
+ }
113
+ else {
114
+ throw new Error('<mg-input-radio> prop "items" is required and all items must be the same type, string or RadioOption.');
115
+ }
116
+ }
117
+ handleValidityChange(newValue, _oldValue, prop) {
118
+ this.inputs.forEach(input => {
119
+ input[prop] = newValue;
120
+ });
121
+ this.checkValidity();
122
+ if (this.hasDisplayedError) {
123
+ this.setErrorMessage();
124
+ this.hasDisplayedError = false;
125
+ }
126
+ }
50
127
  /**
51
- * Check if input is valid
128
+ * Display input error if it exists.
52
129
  */
53
- this.checkValidity = () => {
54
- this.setValidity(this.readonly || this.disabled || this.getInvalidElement() === undefined);
55
- };
130
+ async displayError() {
131
+ this.checkValidity();
132
+ this.setErrorMessage();
133
+ this.hasDisplayedError = this.invalid;
134
+ }
56
135
  /**
57
- * Set input error message
58
- * @param errorMessage - errorMessage override
136
+ * Set an error and display a custom error message.
137
+ * This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.
138
+ * It must be paired with an error message to display for the given context.
139
+ * When used to set validity to `false`, you should use this method again to reset the validity to `true`.
140
+ * @param valid - value indicating the validity
141
+ * @param errorMessage - the error message to display
59
142
  */
60
- this.setErrorMessage = (errorMessage) => {
61
- const invalidElement = this.getInvalidElement();
62
- // Set error message
63
- this.errorMessage = undefined;
64
- if (!this.valid) {
65
- if (errorMessage !== undefined) {
66
- this.errorMessage = errorMessage;
143
+ async setError(valid, errorMessage) {
144
+ if (typeof valid !== 'boolean') {
145
+ throw new Error('<mg-input-radio> method "setError()" param "valid" must be a boolean');
146
+ }
147
+ else if (!isValidString(errorMessage)) {
148
+ throw new Error('<mg-input-radio> method "setError()" param "errorMessage" must be a string');
67
149
  }
68
- else if (invalidElement.validity.valueMissing) {
69
- this.errorMessage = this.messages.errors.required;
150
+ else {
151
+ this.setValidity(valid);
152
+ this.setErrorMessage(valid ? undefined : errorMessage);
153
+ this.hasDisplayedError = this.invalid;
70
154
  }
71
- }
72
- };
155
+ }
73
156
  /**
74
- * get invalid element
75
- * @returns element
157
+ * Method to set validity values
158
+ * @param newValue - valid new value
76
159
  */
77
- this.getInvalidElement = () => this.inputs.find((input) => !input.disabled && !input.readOnly && !input.checkValidity());
78
- this.value = undefined;
79
- this.items = undefined;
80
- this.identifier = undefined;
81
- this.name = this.identifier;
82
- this.label = undefined;
83
- this.labelOnTop = false;
84
- this.labelHide = false;
85
- this.inputVerticalList = false;
86
- this.required = false;
87
- this.readonly = false;
88
- this.disabled = false;
89
- this.tooltip = undefined;
90
- this.helpText = undefined;
91
- this.valid = undefined;
92
- this.invalid = undefined;
93
- this.classCollection = new ClassList(['mg-c-input--radio']);
94
- this.errorMessage = undefined;
95
- this.options = undefined;
96
- }
97
- handleValue(newValue) {
98
- this.valueChange.emit(newValue);
99
- }
100
- validateItems(newValue) {
101
- // Validate if items have required min length
102
- if (typeof newValue === 'object' && newValue.length < 2) {
103
- throw new Error('<mg-input-radio> prop "items" require at least 2 items.');
104
- }
105
- // String array
106
- else if (allItemsAreString(newValue)) {
107
- this.options = newValue.map(item => ({ title: item, value: item, disabled: this.disabled }));
108
- }
109
- // Object array
110
- else if (newValue && newValue.every(item => isOption(item))) {
111
- this.options = newValue;
112
- }
113
- else {
114
- throw new Error('<mg-input-radio> prop "items" is required and all items must be the same type, string or RadioOption.');
115
- }
116
- }
117
- handleValidityChange(newValue, _oldValue, prop) {
118
- this.inputs.forEach(input => {
119
- input[prop] = newValue;
120
- });
121
- this.checkValidity();
122
- if (this.hasDisplayedError) {
123
- this.setErrorMessage();
124
- this.hasDisplayedError = false;
160
+ setValidity(newValue) {
161
+ const oldValidValue = this.valid;
162
+ this.valid = newValue;
163
+ this.invalid = !this.valid;
164
+ // We need to send valid event even if it is the same value
165
+ if (this.handlerInProgress === undefined || (this.handlerInProgress === Handler.BLUR && this.valid !== oldValidValue))
166
+ this.inputValid.emit(this.valid);
125
167
  }
126
- }
127
- /**
128
- * Display input error if it exists.
129
- */
130
- async displayError() {
131
- this.checkValidity();
132
- this.setErrorMessage();
133
- this.hasDisplayedError = this.invalid;
134
- }
135
- /**
136
- * Set an error and display a custom error message.
137
- * This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.
138
- * It must be paired with an error message to display for the given context.
139
- * When used to set validity to `false`, you should use this method again to reset the validity to `true`.
140
- * @param valid - value indicating the validity
141
- * @param errorMessage - the error message to display
142
- */
143
- async setError(valid, errorMessage) {
144
- if (typeof valid !== 'boolean') {
145
- throw new Error('<mg-input-radio> method "setError()" param "valid" must be a boolean');
146
- }
147
- else if (!isValidString(errorMessage)) {
148
- throw new Error('<mg-input-radio> method "setError()" param "errorMessage" must be a string');
168
+ /*************
169
+ * Lifecycle *
170
+ *************/
171
+ /**
172
+ * Check if component props are well configured on init
173
+ * @returns timeout
174
+ */
175
+ componentWillLoad() {
176
+ // Get locales
177
+ this.messages = initLocales(this.element).messages;
178
+ // Validate
179
+ this.validateItems(this.items);
180
+ // Check validity when component is ready
181
+ // return a promise to process action only in the FIRST render().
182
+ // https://stenciljs.com/docs/component-lifecycle#componentwillload
183
+ return setTimeout(() => {
184
+ this.checkValidity();
185
+ }, 0);
149
186
  }
150
- else {
151
- this.setValidity(valid);
152
- this.setErrorMessage(valid ? undefined : errorMessage);
153
- this.hasDisplayedError = this.invalid;
187
+ /**
188
+ * Render
189
+ * @returns HTML Element
190
+ */
191
+ render() {
192
+ return (h(MgInput, { identifier: this.identifier, classCollection: this.classCollection, ariaDescribedbyIDs: [], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, disabled: this.disabled, readonly: this.readonly, mgWidth: undefined, value: this.value, readonlyValue: this.value, tooltip: this.tooltip, helpText: this.helpText, errorMessage: this.errorMessage, isFieldset: true }, h("ul", { class: { 'mg-c-input__input-group-container': true, 'mg-c-input__input-group-container--vertical': this.inputVerticalList }, role: "list" }, this.options.map((input, index) => (h("li", { key: input.title, class: { 'mg-c-input__input-group': true, 'mg-c-input__input-group--disabled': this.disabled || input.disabled } }, h("input", { type: "radio", id: this.identifier + '_' + index, name: this.identifier, value: index, checked: JSON.stringify(this.value) === JSON.stringify(this.options[index].value), disabled: this.disabled || input.disabled, required: this.required, onBlur: this.handleBlur, onInput: this.handleInput, ref: (el) => {
193
+ if (el !== null)
194
+ this.inputs[index] = el;
195
+ } }), h("label", { htmlFor: this.identifier + '_' + index }, input.title)))))));
154
196
  }
155
- }
156
- /**
157
- * Method to set validity values
158
- * @param newValue - valid new value
159
- */
160
- setValidity(newValue) {
161
- const oldValidValue = this.valid;
162
- this.valid = newValue;
163
- this.invalid = !this.valid;
164
- // We need to send valid event even if it is the same value
165
- if (this.handlerInProgress === undefined || (this.handlerInProgress === Handler.BLUR && this.valid !== oldValidValue))
166
- this.inputValid.emit(this.valid);
167
- }
168
- /*************
169
- * Lifecycle *
170
- *************/
171
- /**
172
- * Check if component props are well configured on init
173
- * @returns timeout
174
- */
175
- componentWillLoad() {
176
- // Get locales
177
- this.messages = initLocales(this.element).messages;
178
- // Validate
179
- this.validateItems(this.items);
180
- // Check validity when component is ready
181
- // return a promise to process action only in the FIRST render().
182
- // https://stenciljs.com/docs/component-lifecycle#componentwillload
183
- return setTimeout(() => {
184
- this.checkValidity();
185
- }, 0);
186
- }
187
- /**
188
- * Render
189
- * @returns HTML Element
190
- */
191
- render() {
192
- return (h(MgInput, { identifier: this.identifier, classCollection: this.classCollection, ariaDescribedbyIDs: [], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, disabled: this.disabled, readonly: this.readonly, mgWidth: undefined, value: this.value, readonlyValue: this.value, tooltip: this.tooltip, helpText: this.helpText, errorMessage: this.errorMessage, isFieldset: true }, h("ul", { class: { 'mg-c-input__input-group-container': true, 'mg-c-input__input-group-container--vertical': this.inputVerticalList }, role: "list" }, this.options.map((input, index) => (h("li", { key: input.title, class: { 'mg-c-input__input-group': true, 'mg-c-input__input-group--disabled': this.disabled || input.disabled } }, h("input", { type: "radio", id: this.identifier + '_' + index, name: this.identifier, value: index, checked: JSON.stringify(this.value) === JSON.stringify(this.options[index].value), disabled: this.disabled || input.disabled, required: this.required, onBlur: this.handleBlur, onInput: this.handleInput, ref: (el) => {
193
- if (el !== null)
194
- this.inputs[index] = el;
195
- } }), h("label", { htmlFor: this.identifier + '_' + index }, input.title)))))));
196
- }
197
- get element() { return this; }
198
- static get watchers() { return {
199
- "value": ["handleValue"],
200
- "items": ["validateItems"],
201
- "required": ["handleValidityChange"],
202
- "readonly": ["handleValidityChange"],
203
- "disabled": ["handleValidityChange"]
204
- }; }
205
- static get style() { return mgInputRadioCss; }
197
+ get element() { return this; }
198
+ static get watchers() { return {
199
+ "value": ["handleValue"],
200
+ "items": ["validateItems"],
201
+ "required": ["handleValidityChange"],
202
+ "readonly": ["handleValidityChange"],
203
+ "disabled": ["handleValidityChange"]
204
+ }; }
205
+ static get style() { return mgInputRadioCss; }
206
206
  }, [1, "mg-input-radio", {
207
- "value": [1032],
208
- "items": [16],
209
- "identifier": [1],
210
- "name": [1],
211
- "label": [1],
212
- "labelOnTop": [4, "label-on-top"],
213
- "labelHide": [4, "label-hide"],
214
- "inputVerticalList": [4, "input-vertical-list"],
215
- "required": [4],
216
- "readonly": [4],
217
- "disabled": [4],
218
- "tooltip": [1],
219
- "helpText": [1, "help-text"],
220
- "valid": [1028],
221
- "invalid": [1028],
222
- "classCollection": [32],
223
- "errorMessage": [32],
224
- "options": [32],
225
- "displayError": [64],
226
- "setError": [64]
227
- }, undefined, {
228
- "value": ["handleValue"],
229
- "items": ["validateItems"],
230
- "required": ["handleValidityChange"],
231
- "readonly": ["handleValidityChange"],
232
- "disabled": ["handleValidityChange"]
233
- }]);
207
+ "value": [1032],
208
+ "items": [16],
209
+ "identifier": [1],
210
+ "name": [1],
211
+ "label": [1],
212
+ "labelOnTop": [4, "label-on-top"],
213
+ "labelHide": [4, "label-hide"],
214
+ "inputVerticalList": [4, "input-vertical-list"],
215
+ "required": [4],
216
+ "readonly": [4],
217
+ "disabled": [4],
218
+ "tooltip": [1],
219
+ "helpText": [1, "help-text"],
220
+ "valid": [1028],
221
+ "invalid": [1028],
222
+ "classCollection": [32],
223
+ "errorMessage": [32],
224
+ "options": [32],
225
+ "displayError": [64],
226
+ "setError": [64]
227
+ }, undefined, {
228
+ "value": ["handleValue"],
229
+ "items": ["validateItems"],
230
+ "required": ["handleValidityChange"],
231
+ "readonly": ["handleValidityChange"],
232
+ "disabled": ["handleValidityChange"]
233
+ }]);
234
234
  function defineCustomElement$1() {
235
- if (typeof customElements === "undefined") {
236
- return;
237
- }
238
- const components = ["mg-input-radio", "mg-icon", "mg-input-title", "mg-tooltip", "mg-tooltip-content"];
239
- components.forEach(tagName => { switch (tagName) {
240
- case "mg-input-radio":
241
- if (!customElements.get(tagName)) {
242
- customElements.define(tagName, MgInputRadio$1);
243
- }
244
- break;
245
- case "mg-icon":
246
- if (!customElements.get(tagName)) {
247
- defineCustomElement$5();
248
- }
249
- break;
250
- case "mg-input-title":
251
- if (!customElements.get(tagName)) {
252
- defineCustomElement$4();
253
- }
254
- break;
255
- case "mg-tooltip":
256
- if (!customElements.get(tagName)) {
257
- defineCustomElement$3();
258
- }
259
- break;
260
- case "mg-tooltip-content":
261
- if (!customElements.get(tagName)) {
262
- defineCustomElement$2();
263
- }
264
- break;
265
- } });
235
+ if (typeof customElements === "undefined") {
236
+ return;
237
+ }
238
+ const components = ["mg-input-radio", "mg-icon", "mg-input-title", "mg-tooltip", "mg-tooltip-content"];
239
+ components.forEach(tagName => { switch (tagName) {
240
+ case "mg-input-radio":
241
+ if (!customElements.get(tagName)) {
242
+ customElements.define(tagName, MgInputRadio$1);
243
+ }
244
+ break;
245
+ case "mg-icon":
246
+ if (!customElements.get(tagName)) {
247
+ defineCustomElement$5();
248
+ }
249
+ break;
250
+ case "mg-input-title":
251
+ if (!customElements.get(tagName)) {
252
+ defineCustomElement$4();
253
+ }
254
+ break;
255
+ case "mg-tooltip":
256
+ if (!customElements.get(tagName)) {
257
+ defineCustomElement$3();
258
+ }
259
+ break;
260
+ case "mg-tooltip-content":
261
+ if (!customElements.get(tagName)) {
262
+ defineCustomElement$2();
263
+ }
264
+ break;
265
+ } });
266
266
  }
267
267
  defineCustomElement$1();
268
268