@mgdis/mg-components 5.28.2 → 6.0.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 (339) hide show
  1. package/{readme.md → README.md} +1 -1
  2. package/dist/cjs/{index-ce4f7698.js → index-08ee93bf.js} +57 -77
  3. package/dist/cjs/index-08ee93bf.js.map +1 -0
  4. package/dist/cjs/{index-792fd1c1.js → index-d57c96a9.js} +16 -15
  5. package/dist/cjs/index-d57c96a9.js.map +1 -0
  6. package/dist/cjs/loader.cjs.js +2 -2
  7. package/dist/cjs/mg-action-more_36.cjs.entry.js +622 -788
  8. package/dist/cjs/mg-action-more_36.cjs.entry.js.map +1 -1
  9. package/dist/cjs/mg-alert.cjs.entry.js +161 -0
  10. package/dist/cjs/mg-alert.cjs.entry.js.map +1 -0
  11. package/dist/cjs/mg-components.cjs.js +3 -3
  12. package/dist/cjs/mg-components.cjs.js.map +1 -1
  13. package/dist/cjs/mg-loader.cjs.entry.js +6 -6
  14. package/dist/cjs/mg-loader.cjs.entry.js.map +1 -1
  15. package/dist/collection/assets/icons/index.js +1 -1
  16. package/dist/collection/assets/icons/index.js.map +1 -1
  17. package/dist/collection/collection-manifest.json +6 -5
  18. package/dist/collection/components/atoms/{mg-character-left → internals/mg-character-left}/mg-character-left.js +9 -5
  19. package/dist/collection/components/atoms/internals/mg-character-left/mg-character-left.js.map +1 -0
  20. package/dist/collection/components/atoms/{mg-input-title → internals/mg-input-title}/mg-input-title.js +4 -4
  21. package/dist/collection/components/atoms/internals/mg-input-title/mg-input-title.js.map +1 -0
  22. package/dist/collection/components/atoms/mg-badge/mg-badge.conf.js.map +1 -1
  23. package/dist/collection/components/atoms/mg-badge/mg-badge.js +6 -6
  24. package/dist/collection/components/atoms/mg-badge/mg-badge.js.map +1 -1
  25. package/dist/collection/components/atoms/mg-button/mg-button.conf.js.map +1 -1
  26. package/dist/collection/components/atoms/mg-button/mg-button.js +4 -22
  27. package/dist/collection/components/atoms/mg-button/mg-button.js.map +1 -1
  28. package/dist/collection/components/atoms/mg-card/mg-card.js +1 -113
  29. package/dist/collection/components/atoms/mg-card/mg-card.js.map +1 -1
  30. package/dist/collection/components/atoms/mg-divider/mg-divider.js +9 -9
  31. package/dist/collection/components/atoms/mg-divider/mg-divider.js.map +1 -1
  32. package/dist/collection/components/atoms/mg-icon/mg-icon.conf.js +1 -1
  33. package/dist/collection/components/atoms/mg-icon/mg-icon.conf.js.map +1 -1
  34. package/dist/collection/components/atoms/mg-icon/mg-icon.js +11 -11
  35. package/dist/collection/components/atoms/mg-icon/mg-icon.js.map +1 -1
  36. package/dist/collection/components/atoms/mg-tag/mg-tag.conf.js.map +1 -1
  37. package/dist/collection/components/atoms/mg-tag/mg-tag.js +3 -3
  38. package/dist/collection/components/atoms/mg-tag/mg-tag.js.map +1 -1
  39. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.js +1 -1
  40. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.conf.js +6 -7
  41. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.conf.js.map +1 -1
  42. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +36 -20
  43. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js.map +1 -1
  44. package/dist/collection/components/molecules/inputs/mg-input/mg-input.conf.js +0 -9
  45. package/dist/collection/components/molecules/inputs/mg-input/mg-input.conf.js.map +1 -1
  46. package/dist/collection/components/molecules/inputs/mg-input/mg-input.js +15 -60
  47. package/dist/collection/components/molecules/inputs/mg-input/mg-input.js.map +1 -1
  48. package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js +1 -3
  49. package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js.map +1 -1
  50. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js +16 -48
  51. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js.map +1 -1
  52. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.js +5 -23
  53. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.js.map +1 -1
  54. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +128 -32
  55. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js.map +1 -1
  56. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.conf.js +1 -8
  57. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.conf.js.map +1 -1
  58. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +21 -22
  59. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js.map +1 -1
  60. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf.js +1 -8
  61. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf.js.map +1 -1
  62. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +46 -31
  63. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js.map +1 -1
  64. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +9 -9
  65. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js.map +1 -1
  66. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +27 -16
  67. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js.map +1 -1
  68. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.conf.js.map +1 -1
  69. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +13 -13
  70. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js.map +1 -1
  71. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.conf.js.map +1 -1
  72. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +72 -36
  73. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js.map +1 -1
  74. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +22 -22
  75. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js.map +1 -1
  76. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +7 -7
  77. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js.map +1 -1
  78. package/dist/collection/components/molecules/internals/mg-item-more/mg-item-more.conf.js.map +1 -0
  79. package/dist/collection/components/molecules/{mg-item-more → internals/mg-item-more}/mg-item-more.js +24 -20
  80. package/dist/collection/components/molecules/internals/mg-item-more/mg-item-more.js.map +1 -0
  81. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.conf.js +6 -7
  82. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.conf.js.map +1 -1
  83. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js +21 -16
  84. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js.map +1 -1
  85. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.conf.js +7 -16
  86. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.conf.js.map +1 -1
  87. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js +17 -17
  88. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js.map +1 -1
  89. package/dist/collection/components/molecules/mg-action-more/mg-action-more.conf.js.map +1 -1
  90. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +30 -15
  91. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js.map +1 -1
  92. package/dist/collection/components/molecules/mg-alert/mg-alert.conf.js +9 -0
  93. package/dist/collection/components/molecules/mg-alert/mg-alert.conf.js.map +1 -0
  94. package/dist/collection/components/molecules/mg-alert/mg-alert.js +270 -0
  95. package/dist/collection/components/molecules/mg-alert/mg-alert.js.map +1 -0
  96. package/dist/collection/components/molecules/mg-details/mg-details.js +3 -3
  97. package/dist/collection/components/molecules/mg-details/mg-details.js.map +1 -1
  98. package/dist/collection/components/molecules/mg-form/mg-form.js +5 -5
  99. package/dist/collection/components/molecules/mg-form/mg-form.js.map +1 -1
  100. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.conf.js +6 -0
  101. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.conf.js.map +1 -0
  102. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +16 -10
  103. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js.map +1 -1
  104. package/dist/collection/components/molecules/mg-loader/mg-loader.js +3 -3
  105. package/dist/collection/components/molecules/mg-loader/mg-loader.js.map +1 -1
  106. package/dist/collection/components/molecules/mg-message/mg-message.conf.js +5 -1
  107. package/dist/collection/components/molecules/mg-message/mg-message.conf.js.map +1 -1
  108. package/dist/collection/components/molecules/mg-message/mg-message.js +46 -230
  109. package/dist/collection/components/molecules/mg-message/mg-message.js.map +1 -1
  110. package/dist/collection/components/molecules/mg-modal/mg-modal.js +35 -121
  111. package/dist/collection/components/molecules/mg-modal/mg-modal.js.map +1 -1
  112. package/dist/collection/components/molecules/mg-pagination/mg-pagination.conf.js +4 -5
  113. package/dist/collection/components/molecules/mg-pagination/mg-pagination.conf.js.map +1 -1
  114. package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +7 -7
  115. package/dist/collection/components/molecules/mg-pagination/mg-pagination.js.map +1 -1
  116. package/dist/collection/components/molecules/mg-panel/mg-panel.js +9 -9
  117. package/dist/collection/components/molecules/mg-panel/mg-panel.js.map +1 -1
  118. package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js +2 -2
  119. package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js.map +1 -1
  120. package/dist/collection/components/molecules/mg-popover/mg-popover.js +4 -3
  121. package/dist/collection/components/molecules/mg-popover/mg-popover.js.map +1 -1
  122. package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +1 -2
  123. package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js.map +1 -1
  124. package/dist/collection/components/molecules/mg-tabs/mg-tabs.conf.js +7 -8
  125. package/dist/collection/components/molecules/mg-tabs/mg-tabs.conf.js.map +1 -1
  126. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +24 -13
  127. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js.map +1 -1
  128. package/dist/collection/locales/en/messages.json +1 -1
  129. package/dist/collection/locales/fr/messages.json +1 -1
  130. package/dist/collection/types/index.js +2 -0
  131. package/dist/collection/types/index.js.map +1 -0
  132. package/dist/collection/utils/behaviors.utils.js +8 -9
  133. package/dist/collection/utils/behaviors.utils.js.map +1 -1
  134. package/dist/collection/utils/playwright.fixture.js +3 -3
  135. package/dist/collection/utils/playwright.fixture.js.map +1 -1
  136. package/dist/components/index.es.js +7 -7
  137. package/dist/components/index.es.js.map +1 -1
  138. package/dist/components/index2.js +6 -6
  139. package/dist/components/mg-action-more.js +34 -18
  140. package/dist/components/mg-action-more.js.map +1 -1
  141. package/dist/components/mg-alert.d.ts +11 -0
  142. package/dist/components/mg-alert.js +212 -0
  143. package/dist/components/mg-alert.js.map +1 -0
  144. package/dist/components/mg-badge2.js +8 -8
  145. package/dist/components/mg-badge2.js.map +1 -1
  146. package/dist/components/mg-button2.js +7 -9
  147. package/dist/components/mg-button2.js.map +1 -1
  148. package/dist/components/mg-card2.js +3 -68
  149. package/dist/components/mg-card2.js.map +1 -1
  150. package/dist/components/mg-character-left2.js +4 -3
  151. package/dist/components/mg-character-left2.js.map +1 -1
  152. package/dist/components/mg-details.js +5 -5
  153. package/dist/components/mg-details.js.map +1 -1
  154. package/dist/components/mg-divider.js +1 -40
  155. package/dist/components/mg-divider.js.map +1 -1
  156. package/dist/components/mg-divider2.js +44 -0
  157. package/dist/components/mg-divider2.js.map +1 -0
  158. package/dist/components/mg-form.js +5 -5
  159. package/dist/components/mg-form.js.map +1 -1
  160. package/dist/components/mg-icon2.js +11 -11
  161. package/dist/components/mg-icon2.js.map +1 -1
  162. package/dist/components/mg-illustrated-message.js +6 -6
  163. package/dist/components/mg-illustrated-message.js.map +1 -1
  164. package/dist/components/mg-input-checkbox-paginated.js +1 -1
  165. package/dist/components/mg-input-checkbox-paginated2.js +16 -47
  166. package/dist/components/mg-input-checkbox-paginated2.js.map +1 -1
  167. package/dist/components/mg-input-checkbox.js +82 -33
  168. package/dist/components/mg-input-checkbox.js.map +1 -1
  169. package/dist/components/mg-input-date.js +29 -38
  170. package/dist/components/mg-input-date.js.map +1 -1
  171. package/dist/components/mg-input-numeric.js +46 -38
  172. package/dist/components/mg-input-numeric.js.map +1 -1
  173. package/dist/components/mg-input-password.js +11 -11
  174. package/dist/components/mg-input-password.js.map +1 -1
  175. package/dist/components/mg-input-radio.js +28 -16
  176. package/dist/components/mg-input-radio.js.map +1 -1
  177. package/dist/components/mg-input-select2.js +14 -14
  178. package/dist/components/mg-input-select2.js.map +1 -1
  179. package/dist/components/mg-input-text2.js +58 -29
  180. package/dist/components/mg-input-text2.js.map +1 -1
  181. package/dist/components/mg-input-textarea.js +22 -22
  182. package/dist/components/mg-input-textarea.js.map +1 -1
  183. package/dist/components/mg-input-title2.js +4 -4
  184. package/dist/components/mg-input-title2.js.map +1 -1
  185. package/dist/components/mg-input-toggle.js +9 -9
  186. package/dist/components/mg-input-toggle.js.map +1 -1
  187. package/dist/components/mg-input2.js +19 -57
  188. package/dist/components/mg-input2.js.map +1 -1
  189. package/dist/components/mg-item-more2.js +35 -31
  190. package/dist/components/mg-item-more2.js.map +1 -1
  191. package/dist/components/mg-loader.js +5 -5
  192. package/dist/components/mg-loader.js.map +1 -1
  193. package/dist/components/mg-menu-item2.js +28 -38
  194. package/dist/components/mg-menu-item2.js.map +1 -1
  195. package/dist/components/mg-message.js +1 -224
  196. package/dist/components/mg-message.js.map +1 -1
  197. package/dist/components/mg-message2.js +135 -0
  198. package/dist/components/mg-message2.js.map +1 -0
  199. package/dist/components/mg-modal.js +32 -110
  200. package/dist/components/mg-modal.js.map +1 -1
  201. package/dist/components/mg-pagination2.js +12 -13
  202. package/dist/components/mg-pagination2.js.map +1 -1
  203. package/dist/components/mg-panel.js +10 -10
  204. package/dist/components/mg-panel.js.map +1 -1
  205. package/dist/components/mg-popover-content2.js +3 -3
  206. package/dist/components/mg-popover-content2.js.map +1 -1
  207. package/dist/components/mg-popover2.js +7 -6
  208. package/dist/components/mg-popover2.js.map +1 -1
  209. package/dist/components/mg-skip-links.js +4 -4
  210. package/dist/components/mg-skip-links.js.map +1 -1
  211. package/dist/components/mg-tabs.js +32 -22
  212. package/dist/components/mg-tabs.js.map +1 -1
  213. package/dist/components/mg-tag.js +5 -5
  214. package/dist/components/mg-tag.js.map +1 -1
  215. package/dist/components/mg-tooltip-content2.js +2 -2
  216. package/dist/components/mg-tooltip-content2.js.map +1 -1
  217. package/dist/components/mg-tooltip2.js +47 -32
  218. package/dist/components/mg-tooltip2.js.map +1 -1
  219. package/dist/esm/{index-9ed65b6d.js → index-089d0323.js} +57 -78
  220. package/dist/esm/index-089d0323.js.map +1 -0
  221. package/dist/esm/{index-2667a5c4.js → index-cc97a562.js} +13 -13
  222. package/dist/esm/index-cc97a562.js.map +1 -0
  223. package/dist/esm/loader.js +3 -3
  224. package/dist/esm/mg-action-more_36.entry.js +622 -788
  225. package/dist/esm/mg-action-more_36.entry.js.map +1 -1
  226. package/dist/esm/mg-alert.entry.js +157 -0
  227. package/dist/esm/mg-alert.entry.js.map +1 -0
  228. package/dist/esm/mg-components.js +4 -4
  229. package/dist/esm/mg-components.js.map +1 -1
  230. package/dist/esm/mg-loader.entry.js +6 -6
  231. package/dist/esm/mg-loader.entry.js.map +1 -1
  232. package/dist/mg-components/locales/en/messages.json +1 -1
  233. package/dist/mg-components/locales/fr/messages.json +1 -1
  234. package/dist/mg-components/mg-components.css +1 -1
  235. package/dist/mg-components/mg-components.esm.js +1 -1
  236. package/dist/mg-components/mg-components.esm.js.map +1 -1
  237. package/dist/mg-components/p-26b67dfd.entry.js +2 -0
  238. package/dist/mg-components/p-26b67dfd.entry.js.map +1 -0
  239. package/dist/mg-components/p-2b89fe8b.entry.js +2 -0
  240. package/dist/mg-components/p-2b89fe8b.entry.js.map +1 -0
  241. package/dist/mg-components/p-48e033cf.js +3 -0
  242. package/dist/mg-components/p-48e033cf.js.map +1 -0
  243. package/dist/mg-components/p-6f5c7ec5.entry.js +2 -0
  244. package/dist/mg-components/p-6f5c7ec5.entry.js.map +1 -0
  245. package/dist/mg-components/p-898d194f.js +2 -0
  246. package/dist/mg-components/p-898d194f.js.map +1 -0
  247. package/dist/types/assets/icons/index.d.ts +0 -1
  248. package/dist/types/components/atoms/{mg-character-left → internals/mg-character-left}/mg-character-left.d.ts +3 -0
  249. package/dist/types/components/atoms/{mg-input-title → internals/mg-input-title}/mg-input-title.d.ts +1 -1
  250. package/dist/types/components/atoms/mg-badge/mg-badge.conf.d.ts +2 -1
  251. package/dist/types/components/atoms/mg-button/mg-button.conf.d.ts +2 -1
  252. package/dist/types/components/atoms/mg-button/mg-button.d.ts +0 -4
  253. package/dist/types/components/atoms/mg-card/mg-card.d.ts +0 -33
  254. package/dist/types/components/atoms/mg-divider/mg-divider.d.ts +1 -1
  255. package/dist/types/components/atoms/mg-icon/mg-icon.conf.d.ts +5 -4
  256. package/dist/types/components/atoms/mg-tag/mg-tag.conf.d.ts +2 -1
  257. package/dist/types/components/atoms/mg-tooltip/mg-tooltip.conf.d.ts +2 -6
  258. package/dist/types/components/atoms/mg-tooltip/mg-tooltip.d.ts +7 -2
  259. package/dist/types/components/molecules/inputs/mg-input/mg-input.conf.d.ts +2 -6
  260. package/dist/types/components/molecules/inputs/mg-input/mg-input.d.ts +0 -9
  261. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.d.ts +6 -13
  262. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.d.ts +4 -18
  263. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +30 -3
  264. package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.conf.d.ts +2 -7
  265. package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf.d.ts +3 -7
  266. package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +6 -1
  267. package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +5 -1
  268. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.conf.d.ts +2 -3
  269. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +1 -1
  270. package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.conf.d.ts +5 -0
  271. package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +10 -4
  272. package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +3 -3
  273. package/dist/types/components/molecules/{mg-item-more → internals/mg-item-more}/mg-item-more.conf.d.ts +2 -2
  274. package/dist/types/components/molecules/{mg-item-more → internals/mg-item-more}/mg-item-more.d.ts +3 -0
  275. package/dist/types/components/molecules/menu/mg-menu/mg-menu.conf.d.ts +9 -7
  276. package/dist/types/components/molecules/menu/mg-menu/mg-menu.d.ts +2 -3
  277. package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.conf.d.ts +5 -17
  278. package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.d.ts +4 -4
  279. package/dist/types/components/molecules/mg-action-more/mg-action-more.conf.d.ts +7 -1
  280. package/dist/types/components/molecules/mg-action-more/mg-action-more.d.ts +2 -2
  281. package/dist/types/components/molecules/mg-alert/mg-alert.conf.d.ts +17 -0
  282. package/dist/types/components/molecules/mg-alert/mg-alert.d.ts +89 -0
  283. package/dist/types/components/molecules/mg-details/mg-details.d.ts +4 -0
  284. package/dist/types/components/molecules/mg-form/mg-form.d.ts +4 -0
  285. package/dist/types/components/molecules/mg-illustrated-message/mg-illustrated-message.conf.d.ts +10 -0
  286. package/dist/types/components/molecules/mg-illustrated-message/mg-illustrated-message.d.ts +7 -1
  287. package/dist/types/components/molecules/mg-message/mg-message.conf.d.ts +11 -2
  288. package/dist/types/components/molecules/mg-message/mg-message.d.ts +11 -62
  289. package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +13 -39
  290. package/dist/types/components/molecules/mg-pagination/mg-pagination.conf.d.ts +4 -4
  291. package/dist/types/components/molecules/mg-panel/mg-panel.d.ts +4 -0
  292. package/dist/types/components/molecules/mg-tabs/mg-tabs.conf.d.ts +7 -11
  293. package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +9 -0
  294. package/dist/types/components.d.ts +165 -174
  295. package/dist/types/locales/index.d.ts +1 -1
  296. package/dist/types/types/index.d.ts +27 -0
  297. package/dist/types/utils/behaviors.utils.d.ts +5 -5
  298. package/ide/intellij/web-types.json +791 -671
  299. package/ide/vscode/css-custom-data.json +389 -0
  300. package/ide/vscode/html-custom-data.json +217 -547
  301. package/package.json +26 -23
  302. package/dist/cjs/index-792fd1c1.js.map +0 -1
  303. package/dist/cjs/index-ce4f7698.js.map +0 -1
  304. package/dist/collection/components/atoms/mg-card/mg-card.conf.js +0 -9
  305. package/dist/collection/components/atoms/mg-card/mg-card.conf.js.map +0 -1
  306. package/dist/collection/components/atoms/mg-character-left/mg-character-left.js.map +0 -1
  307. package/dist/collection/components/atoms/mg-input-title/mg-input-title.js.map +0 -1
  308. package/dist/collection/components/molecules/mg-item-more/mg-item-more.conf.js.map +0 -1
  309. package/dist/collection/components/molecules/mg-item-more/mg-item-more.js.map +0 -1
  310. package/dist/collection/fonts/OpenSans-Bold.ttf +0 -0
  311. package/dist/collection/fonts/OpenSans-Regular.ttf +0 -0
  312. package/dist/collection/fonts/OpenSans-SemiBold.ttf +0 -0
  313. package/dist/collection/styles/fonts.css +0 -1
  314. package/dist/collection/styles/global.css +0 -1
  315. package/dist/collection/styles/main.css +0 -1
  316. package/dist/collection/styles/mg-components-utils.css +0 -1
  317. package/dist/collection/styles/variables.css +0 -1
  318. package/dist/collection/variables.css +0 -1
  319. package/dist/esm/index-2667a5c4.js.map +0 -1
  320. package/dist/esm/index-9ed65b6d.js.map +0 -1
  321. package/dist/mg-components/fonts/OpenSans-Bold.ttf +0 -0
  322. package/dist/mg-components/fonts/OpenSans-Regular.ttf +0 -0
  323. package/dist/mg-components/fonts/OpenSans-SemiBold.ttf +0 -0
  324. package/dist/mg-components/p-06a9d801.js +0 -3
  325. package/dist/mg-components/p-06a9d801.js.map +0 -1
  326. package/dist/mg-components/p-56cce4ec.entry.js +0 -2
  327. package/dist/mg-components/p-56cce4ec.entry.js.map +0 -1
  328. package/dist/mg-components/p-64eaef9e.entry.js +0 -2
  329. package/dist/mg-components/p-64eaef9e.entry.js.map +0 -1
  330. package/dist/mg-components/p-7cda52b6.js +0 -2
  331. package/dist/mg-components/p-7cda52b6.js.map +0 -1
  332. package/dist/mg-components/styles/fonts.css +0 -1
  333. package/dist/mg-components/styles/global.css +0 -1
  334. package/dist/mg-components/styles/main.css +0 -1
  335. package/dist/mg-components/styles/mg-components-utils.css +0 -1
  336. package/dist/mg-components/styles/variables.css +0 -1
  337. package/dist/mg-components/variables.css +0 -1
  338. package/dist/types/components/atoms/mg-card/mg-card.conf.d.ts +0 -16
  339. /package/dist/collection/components/molecules/{mg-item-more → internals/mg-item-more}/mg-item-more.conf.js +0 -0
@@ -1,6 +1,6 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
- import { I as Ie, Z as Ze } from './index.es.js';
3
- import { d as defineCustomElement$4, H as Handler, b as classReadonly, e as classDisabled, w as widths } from './mg-input2.js';
2
+ import { I as Ie, G as Ge, Z as Ze, Q as Qe } from './index.es.js';
3
+ import { d as defineCustomElement$4, b as classReadonly, e as classDisabled, w as widths } from './mg-input2.js';
4
4
  import { i as initLocales } from './index2.js';
5
5
  import { d as defineCustomElement$6 } from './mg-character-left2.js';
6
6
  import { d as defineCustomElement$5 } from './mg-icon2.js';
@@ -8,16 +8,21 @@ import { d as defineCustomElement$3 } from './mg-input-title2.js';
8
8
  import { d as defineCustomElement$2 } from './mg-tooltip2.js';
9
9
  import { d as defineCustomElement$1 } from './mg-tooltip-content2.js';
10
10
 
11
- const mgInputTextCss = ".mg-u-visually-hidden{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip:rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;clip-path:inset(50%) !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){*{animation:none !important;transition:none !important}}.mg-c-input__input-container{width:100%;flex:1 auto}.mg-c-input__box.mg-c-input__box--width{width:100%;min-width:5rem;max-width:calc(17.7rem + var(--mg-inputs-spacer)*2)}.mg-c-input.mg-c-input--width-2 .mg-c-input__box,.mg-c-input.mg-c-input--width-2 .mg-c-input__with-character-left{max-width:5rem}.mg-c-input.mg-c-input--width-4 .mg-c-input__box,.mg-c-input.mg-c-input--width-4 .mg-c-input__with-character-left{max-width:7rem}.mg-c-input.mg-c-input--width-16 .mg-c-input__box,.mg-c-input.mg-c-input--width-16 .mg-c-input__with-character-left{max-width:21rem}.mg-c-input.mg-c-input--width-full .mg-c-input__box{width:100%;max-width:100%}.mg-c-input.mg-c-input--label-on-top.mg-c-input--width-2 .mg-c-input__box,.mg-c-input.mg-c-input--label-on-top.mg-c-input--width-2 .mg-c-input__with-character-left{max-width:5rem}.mg-c-input.mg-c-input--label-on-top.mg-c-input--width-4 .mg-c-input__box,.mg-c-input.mg-c-input--label-on-top.mg-c-input--width-4 .mg-c-input__with-character-left{max-width:7rem}.mg-c-input.mg-c-input--label-on-top.mg-c-input--width-16 .mg-c-input__box,.mg-c-input.mg-c-input--label-on-top.mg-c-input--width-16 .mg-c-input__with-character-left{max-width:21rem}.mg-c-input.mg-c-input--label-on-top.mg-c-input--width-full .mg-c-input__box{width:100%;max-width:100%}.mg-c-input.mg-c-input--label-on-top .mg-c-input__box{width:auto}.mg-c-input.mg-c-input--width-full:not(.mg-c-input--label-on-top){justify-content:stretch}.mg-c-input.mg-c-input--is-input-group-append ::slotted([slot=append-input]),.mg-c-input.mg-c-input--is-append-input-slot-content ::slotted([slot=append-input]){width:auto}:host(.mg-c-input.mg-c-input--width-full) ::slotted(*:not(mg-input-title)){width:100%;max-width:100%}.mg-c-input.mg-c-input--fieldset{padding:0;border:0;margin-right:0;margin-left:0}.mg-c-input.mg-c-input--fieldset input[type=radio],.mg-c-input.mg-c-input--fieldset input[type=checkbox]{width:var(--mg-input-check-size);height:var(--mg-input-check-size);flex-shrink:0;margin:calc((var(--font-size)*var(--line-height) - var(--mg-input-check-size))/2) .6rem 0 0}.mg-c-input.mg-c-input--fieldset .mg-c-input__input-group{display:flex;align-items:start}.mg-c-input.mg-c-input--fieldset .mg-c-input__input-group-container{display:flex;flex-wrap:wrap;padding:0;margin:0;margin-top:calc((var(--default-size) - var(--font-size)*var(--line-height))/2);gap:1rem 2.3rem;list-style:none}.mg-c-input.mg-c-input--fieldset.mg-c-input--vertical-list .mg-c-input__input-group-container,.mg-c-input.mg-c-input--fieldset.mg-c-input--checkbox-multi .mg-c-input__input-group-container{flex-direction:column}.mg-c-input.mg-c-input--fieldset.mg-c-input--label-on-top .mg-c-input__input-group-container{margin-top:.7rem}:host(.mg-c-input.mg-c-input--fieldset:not(.mg-c-input--checkbox-multi)) .mg-c-input__input-container mg-tooltip{margin-left:3rem}:host(.mg-c-input.mg-c-input--checkbox) .mg-c-input__input,:host(.mg-c-input.mg-c-input--radio) .mg-c-input__input{min-height:unset;align-items:flex-start}:host{display:block}.mg-c-input__input mg-icon,.mg-c-input__error mg-icon{display:flex}.mg-c-input{display:flex;min-height:var(--default-size);align-items:flex-start;margin-bottom:var(--mg-inputs-margin-bottom, 0)}.mg-c-input__input-container{min-height:var(--default-size)}.mg-c-input__input-container>ul{display:flex;flex-flow:column wrap;padding:0;margin:0;list-style:none;row-gap:.8rem}.mg-c-input__input-container>strong{display:inline-block}.mg-c-input__input-container>strong,.mg-c-input__input-container>ul{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{display:flex;min-height:var(--default-size);align-items:center;justify-content:start}.mg-c-input__input-icon{color:hsl(var(--color-dark))}.mg-c-input__input mg-tooltip{align-self:baseline;margin-top:calc((var(--default-size) - var(--mg-icon-regular-size))/2)}.mg-c-input__input .mg-c-input__box:disabled,.mg-c-input__input ::slotted(.mg-c-input__button-toggle:disabled),.mg-c-input__input-group--disabled label,.mg-c-input.mg-c-input--checkbox-multi.mg-c-input--disabled .mg-c-input__input-container strong{opacity:var(--mg-disabled-opacity)}.mg-c-input__title{display:flex;width:var(--mg-inputs-title-width, auto);flex-shrink:0;align-items:baseline;justify-content:flex-end;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__title slot[name=label]+mg-tooltip{margin-left:.4rem}.mg-c-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-c-input__error{display:inline-block;padding:.3rem .8rem;border-radius:.3rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-c-input__error ::slotted(*),.mg-c-input__help-text ::slotted(*){font-size:1.2rem;text-align:start}.mg-c-input__help-text+.mg-c-input__error{margin-top:.2rem}:host(:not(.mg-c-input--textarea)) .mg-c-input__input+.mg-c-input__error,:host(:not(.mg-c-input--textarea)) .mg-c-input__input+.mg-c-input__help-text{margin-top:.5rem}.mg-c-input.mg-c-input--readonly>*:not([slot=label],[name=append-input]),.mg-c-input.mg-c-input--readonly ::slotted(mg-button[slot=append-input]){display:none}.mg-c-input.mg-c-input--has-error .mg-c-input__box{border-color:hsl(var(--color-danger))}:host(.mg-c-input){display:flex}:host(.mg-c-input.mg-c-input--textarea.mg-c-input--readonly) .mg-c-input__input-container{white-space:pre-line}:host(.mg-c-input.mg-c-input--checkbox,.mg-c-input.mg-c-input--radio) .mg-c-input__input{min-height:unset}:host(.mg-c-input.mg-c-input--label-on-top){flex-direction:column}:host(.mg-c-input.mg-c-input--label-on-top) .mg-c-input__title{width:100%;flex:0;justify-content:flex-start;margin-top:0;margin-right:0;margin-bottom:.3rem;text-align:left}:host(.mg-c-input.mg-c-input--label-on-top) .mg-c-input__title ::slotted(mg-input-title){flex-shrink:1}@media screen and (max-width: 767px){:host(.mg-c-input){flex-direction:column}:host(.mg-c-input) .mg-c-input__title{width:100%;flex:0;justify-content:flex-start;margin-top:0;margin-right:0;margin-bottom:.3rem;text-align:left}:host(.mg-c-input) .mg-c-input__title ::slotted(mg-input-title){flex-shrink:1}}.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--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--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]){align-self:start;padding-top:calc((var(--default-size) - var(--mg-icon-regular-size))/2)}.mg-c-input.mg-c-input--has-display-character-left mg-character-left{font-size:1.1rem;opacity:.6}.mg-c-input.mg-c-input--has-display-character-left .mg-c-input__input+.mg-c-input__help-text ::slotted(*),.mg-c-input.mg-c-input--has-display-character-left .mg-c-input__input+.mg-c-input__error ::slotted(*){margin-top:0}.mg-u-visually-hidden{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip:rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;clip-path:inset(50%) !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){*{animation:none !important;transition:none !important}}.mg-c-input__with-character-left{position:relative;width:100%}.mg-c-input.mg-u-is-focused .mg-c-input__with-character-left .mg-c-input__box{padding-right:calc(var(--mg-character-left-message-length)*1ch + .8rem)}.mg-c-input__with-character-left mg-character-left{position:absolute;top:50%;right:1rem;display:none;font-size:1.1rem;opacity:.6;transform:translateY(-50%)}.mg-c-input.mg-u-is-focused .mg-c-input__with-character-left mg-character-left{display:block}.mg-c-input.mg-c-input--has-icon .mg-c-input__with-character-left>mg-icon{position:absolute;top:50%;left:var(--mg-inputs-spacer);color:var(--mg-inputs-color);transform:translateY(-50%)}.mg-c-input.mg-c-input--has-icon .mg-c-input__with-character-left .mg-c-input__box{padding-left:calc(var(--mg-icon-regular-size) + var(--mg-inputs-spacer)*2)}";
11
+ const mgInputTextCss = ".mg-c-input__box{height:var(--mg-b-size-min-height);box-sizing:border-box;padding:calc((var(--mg-b-size-min-height) - var(--mg-b-font-size)*var(--mg-b-line-height))/2) var(--mg-b-size-8);border-width:var(--mg-c-input-border-width);border-style:solid;border-color:var(--mg-c-input-color-border);border-radius:var(--mg-c-input-border-radius);background-color:var(--mg-b-color-light);color:var(--mg-b-color-dark);font-family:inherit;font-size:var(--mg-b-font-size);text-align:var(--mg-c-input-text-align, left)}.mg-c-input__box::placeholder{color:var(--mg-c-input-placeholder-color-text);font-style:italic}.mg-c-input__box:focus{box-shadow:0 0 var(--mg-b-size-4) var(--mg-c-input-color-box-shadow-focus)}.mg-c-input__box:disabled{opacity:var(--mg-b-opacity-element-disabled)}.mg-c-input.mg-c-input--has-error .mg-c-input__box{border-color:var(--mg-b-color-danger)}.mg-c-input.mg-c-input--is-input-group-append{--mg-c-button-border-radius-top-left:0;--mg-c-button-border-radius-bottom-left:0}.mg-c-input.mg-c-input--is-input-group-append .mg-c-input__box{margin-right:calc(-1*var(--mg-b-size-border));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--has-buttons-group-append ::slotted([slot=append-input]){--mg-c-button-border-radius-top-right:0;--mg-c-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-c-button-border-right-width:0}.mg-c-input.mg-c-input--has-buttons-group-append ::slotted([slot=append-input]:last-of-type){--mg-c-button-border-radius-top-right:var(--mg-c-input-border-radius);--mg-c-button-border-radius-bottom-right:var(--mg-c-input-border-radius)}.mg-c-input.mg-c-input--is-append-input-slot-content:not(.mg-c-input--readonly) ::slotted([slot=append-input]){align-self:start;padding-top:calc((var(--mg-b-size-min-height) - var(--mg-b-size-16))/2)}.mg-c-input__input-container{width:100%;flex:1 auto}.mg-c-input.mg-c-input--width-2 .mg-c-input__box,.mg-c-input.mg-c-input--width-2 .mg-c-input__with-character-left{max-width:var(--mg-b-size-48)}.mg-c-input.mg-c-input--width-4 .mg-c-input__box,.mg-c-input.mg-c-input--width-4 .mg-c-input__with-character-left{max-width:var(--mg-b-size-72)}.mg-c-input.mg-c-input--width-16 .mg-c-input__box,.mg-c-input.mg-c-input--width-16 .mg-c-input__with-character-left{max-width:calc(26*var(--mg-b-size-8))}.mg-c-input.mg-c-input--width-full .mg-c-input__box{width:100%;max-width:100%}.mg-c-input.mg-c-input--label-on-top.mg-c-input--width-2 .mg-c-input__box,.mg-c-input.mg-c-input--label-on-top.mg-c-input--width-2 .mg-c-input__with-character-left{max-width:var(--mg-b-size-48)}.mg-c-input.mg-c-input--label-on-top.mg-c-input--width-4 .mg-c-input__box,.mg-c-input.mg-c-input--label-on-top.mg-c-input--width-4 .mg-c-input__with-character-left{max-width:var(--mg-b-size-72)}.mg-c-input.mg-c-input--label-on-top.mg-c-input--width-16 .mg-c-input__box,.mg-c-input.mg-c-input--label-on-top.mg-c-input--width-16 .mg-c-input__with-character-left{max-width:calc(26*var(--mg-b-size-8))}.mg-c-input.mg-c-input--label-on-top.mg-c-input--width-full .mg-c-input__box{width:100%;max-width:100%}.mg-c-input.mg-c-input--label-on-top .mg-c-input__box{width:auto}.mg-c-input.mg-c-input--width-full:not(.mg-c-input--label-on-top){justify-content:stretch}.mg-c-input.mg-c-input--is-input-group-append ::slotted([slot=append-input]),.mg-c-input.mg-c-input--is-append-input-slot-content ::slotted([slot=append-input]){width:auto}:host(.mg-c-input.mg-c-input--width-full) ::slotted(*:not(mg-input-title)){width:100%;max-width:100%}.mg-c-input__readonly-value{min-height:var(--mg-b-font-size);align-self:flex-start;margin-top:calc((var(--mg-b-size-min-height) - var(--mg-b-font-size)*var(--mg-b-line-height))/2);word-break:break-word}.mg-c-input.mg-c-input--display-character-left mg-character-left{font-size:var(--mg-b-font-size-small);opacity:.6}.mg-c-input.mg-c-input--display-character-left .mg-c-input__input+.mg-c-input__help-text ::slotted(*),.mg-c-input.mg-c-input--display-character-left .mg-c-input__input+.mg-c-input__error ::slotted(*){margin-top:0}.mg-u-visually-hidden{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip:rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;clip-path:inset(50%) !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){*{animation:none !important;transition:none !important}}.mg-c-input__with-character-left{position:relative;width:100%}.mg-c-input.mg-u-is-focused .mg-c-input__with-character-left .mg-c-input__box{padding-right:calc(var(--mg-c-character-left-message-length)*1ch + var(--mg-b-size-8))}.mg-c-input__with-character-left mg-character-left{position:absolute;top:50%;right:var(--mg-b-size-8);display:none;font-size:var(--mg-b-font-size-small);opacity:.6;transform:translateY(-50%)}.mg-c-input.mg-u-is-focused .mg-c-input__with-character-left mg-character-left{display:block}.mg-c-input.mg-c-input--readonly b{min-height:var(--mg-b-font-size);margin-top:calc((var(--mg-b-size-min-height) - var(--mg-b-font-size)*var(--mg-b-line-height))/2)}.mg-c-input.mg-c-input--has-icon .mg-c-input__with-character-left>mg-icon{position:absolute;top:50%;left:var(--mg-b-size-8);color:var(--mg-c-input-color-icon);transform:translateY(-50%)}.mg-c-input.mg-c-input--has-icon .mg-c-input__with-character-left .mg-c-input__box{padding-left:calc(var(--mg-b-size-16) + var(--mg-b-size-8)*2)}";
12
12
  const MgInputTextStyle0 = mgInputTextCss;
13
13
 
14
+ /**
15
+ * Check if object is an option
16
+ * @param option - object to validate
17
+ * @returns true id object is an option
18
+ */
19
+ const isOption = (option) => typeof option === 'object' && typeof option.title === 'string' && option.value !== undefined;
14
20
  /**
15
21
  * Check if datalist options are well structured.
16
- *
17
22
  * @param options - Datalist options to check.
18
23
  * @returns True if datalist is well structured.
19
24
  */
20
- const isDatalistOption = (options) => Array.isArray(options) && options.every(option => typeof option === 'string');
25
+ const isDatalistOptions = (options) => Ge(options) || (Array.isArray(options) && options.every(isOption));
21
26
  const MgInputText = /*@__PURE__*/ proxyCustomElement(class MgInputText extends HTMLElement {
22
27
  constructor() {
23
28
  super();
@@ -61,7 +66,7 @@ const MgInputText = /*@__PURE__*/ proxyCustomElement(class MgInputText extends H
61
66
  this.classCollection.delete(this.classFocus);
62
67
  this.classCollection = new Ie(this.classCollection.classes);
63
68
  // Display Error
64
- this.handlerInProgress = Handler.BLUR;
69
+ this.handlerInProgress = 'blur';
65
70
  this.displayError().finally(() => {
66
71
  // reset guard
67
72
  this.handlerInProgress = undefined;
@@ -99,7 +104,13 @@ const MgInputText = /*@__PURE__*/ proxyCustomElement(class MgInputText extends H
99
104
  this.validateAppendSlot = () => {
100
105
  const slotAppendInput = Array.from(this.element.querySelectorAll('[slot="append-input"]'));
101
106
  if (slotAppendInput.length === 1) {
102
- this.classCollection.add(slotAppendInput[0].nodeName === 'MG-BUTTON' ? this.classIsInputGroupAppend : this.classIsAppendInputSlotContent);
107
+ if (slotAppendInput[0].nodeName === 'MG-BUTTON') {
108
+ this.classCollection.add(this.classIsInputGroupAppend);
109
+ }
110
+ else {
111
+ this.classCollection.add(this.classIsAppendInputSlotContent);
112
+ this.slotContent = slotAppendInput[0].textContent;
113
+ }
103
114
  }
104
115
  else if (slotAppendInput.filter(slot => slot.nodeName === 'MG-BUTTON').length > 1) {
105
116
  this.classCollection.add(this.classIsInputGroupAppend);
@@ -110,7 +121,14 @@ const MgInputText = /*@__PURE__*/ proxyCustomElement(class MgInputText extends H
110
121
  * Method to control datalist display condition
111
122
  * @returns true if display condition success
112
123
  */
113
- this.hasDatalist = () => isDatalistOption(this.datalistoptions) && this.datalistoptions.length > 0;
124
+ this.hasDatalist = () => isDatalistOptions(this.datalistoptions) && this.datalistoptions.length > 0;
125
+ /**
126
+ * Renders the readonly content of the input component.
127
+ * @returns The readonly content element.
128
+ */
129
+ this.renderReadonly = () => {
130
+ return this.slotContent !== undefined ? (h("span", { class: "mg-c-input__readonly-value" }, h("b", null, this.value), this.slotContent)) : (h("b", { class: "mg-c-input__readonly-value" }, this.value));
131
+ };
114
132
  this.value = undefined;
115
133
  this.identifier = undefined;
116
134
  this.name = this.identifier;
@@ -130,7 +148,7 @@ const MgInputText = /*@__PURE__*/ proxyCustomElement(class MgInputText extends H
130
148
  this.patternErrorMessage = undefined;
131
149
  this.tooltip = undefined;
132
150
  this.tooltipPosition = 'input';
133
- this.displayCharacterLeft = true;
151
+ this.characterLeftHide = false;
134
152
  this.helpText = undefined;
135
153
  this.valid = undefined;
136
154
  this.invalid = undefined;
@@ -138,7 +156,13 @@ const MgInputText = /*@__PURE__*/ proxyCustomElement(class MgInputText extends H
138
156
  this.errorMessage = undefined;
139
157
  }
140
158
  handleValue(newValue) {
141
- this.valueChange.emit(newValue);
159
+ var _a, _b;
160
+ if ((_a = this.datalistoptions) === null || _a === void 0 ? void 0 : _a.every(isOption)) {
161
+ this.valueChange.emit(((_b = this.datalistoptions.find(option => option.title === newValue)) === null || _b === void 0 ? void 0 : _b.value) || newValue);
162
+ }
163
+ else {
164
+ this.valueChange.emit(newValue);
165
+ }
142
166
  }
143
167
  validateIcon(newValue) {
144
168
  if (newValue !== undefined) {
@@ -149,8 +173,8 @@ const MgInputText = /*@__PURE__*/ proxyCustomElement(class MgInputText extends H
149
173
  }
150
174
  }
151
175
  validateDatalistoptions(newValue) {
152
- if (Boolean(newValue) && !isDatalistOption(newValue)) {
153
- throw new Error('<mg-input-text> prop "datalistoptions" values must be the same type, string.');
176
+ if (Boolean(newValue) && !isDatalistOptions(newValue)) {
177
+ throw new Error(`<mg-input-text> prop "datalistoptions" values must be the same type, string or OptionType. Passed value: ${Ze(newValue)}.`);
154
178
  }
155
179
  }
156
180
  watchReadonly(newValue) {
@@ -181,12 +205,12 @@ const MgInputText = /*@__PURE__*/ proxyCustomElement(class MgInputText extends H
181
205
  this.classCollection.delete(`mg-c-input--width-${width}`);
182
206
  });
183
207
  // apply new width
184
- if (newValue)
208
+ if (newValue !== undefined)
185
209
  this.classCollection.add(`mg-c-input--width-${this.mgWidth}`);
186
210
  }
187
211
  validatePattern(newValue) {
188
- if (newValue !== undefined && !(Ze(this.pattern) && Ze(this.patternErrorMessage))) {
189
- throw new Error('<mg-input-text> props "pattern" and "patternErrorMessage" must be non-empty string and paired.');
212
+ if (newValue !== undefined && !(Qe(this.pattern) && Qe(this.patternErrorMessage))) {
213
+ throw new Error(`<mg-input-text> props "pattern" and "patternErrorMessage" must be non-empty string and paired. Passed value: "pattern='${Ze(this.pattern)}'" and "patternErrorMessage='${Ze(this.patternErrorMessage)}'".`);
190
214
  }
191
215
  }
192
216
  /**
@@ -213,10 +237,10 @@ const MgInputText = /*@__PURE__*/ proxyCustomElement(class MgInputText extends H
213
237
  */
214
238
  async setError(valid, errorMessage) {
215
239
  if (typeof valid !== 'boolean') {
216
- throw new Error('<mg-input-text> method "setError()" param "valid" must be a boolean');
240
+ throw new Error('<mg-input-text> method "setError()" param "valid" must be a boolean.');
217
241
  }
218
- else if (!Ze(errorMessage)) {
219
- throw new Error('<mg-input-text> method "setError()" param "errorMessage" must be a string');
242
+ else if (!Qe(errorMessage)) {
243
+ throw new Error('<mg-input-text> method "setError()" param "errorMessage" must be a string.');
220
244
  }
221
245
  else {
222
246
  this.setValidity(valid);
@@ -233,7 +257,7 @@ const MgInputText = /*@__PURE__*/ proxyCustomElement(class MgInputText extends H
233
257
  this.valid = newValue;
234
258
  this.invalid = !this.valid;
235
259
  // We need to send valid event even if it is the same value
236
- if (this.handlerInProgress === undefined || (this.handlerInProgress === Handler.BLUR && this.valid !== oldValidValue))
260
+ if (this.handlerInProgress === undefined || (this.handlerInProgress === 'blur' && this.valid !== oldValidValue))
237
261
  this.inputValid.emit(this.valid);
238
262
  }
239
263
  /*************
@@ -269,14 +293,19 @@ const MgInputText = /*@__PURE__*/ proxyCustomElement(class MgInputText extends H
269
293
  * @returns HTML Element
270
294
  */
271
295
  render() {
272
- return (h("mg-input", { key: 'ee9b290a3c97af6c264b37958c3a6123d516f391', label: this.label, identifier: this.identifier, class: this.classCollection.join(), ariaDescribedbyIDs: [this.characterLeftId], labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, readonlyValue: this.value, tooltip: this.tooltip, tooltipPosition: this.tooltipPosition, helpText: this.helpText, errorMessage: this.errorMessage }, h("div", { key: 'e348db67a88f9941c549cb190aaca88c93aac54c', class: "mg-c-input__with-character-left", style: {
273
- '--mg-character-left-message-length': (this.displayCharacterLeft
274
- ? (this.maxlength - (this.value || '').length).toString().length + this.maxlength.toString().length + 1
275
- : 0).toString(),
276
- } }, this.icon !== undefined && h("mg-icon", { key: 'dfe0ce7e271c40d4da20f00b35ad4fe104e08c91', icon: this.icon }), h("input", { key: '451af2cff19f47d9b9d3de824546324b6bfaf235', type: this.type, class: "mg-c-input__box mg-c-input__box--width", 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) => {
277
- if (el !== null)
278
- this.input = el;
279
- } }), this.hasDatalist() && (h("datalist", { key: '387530d84dd29575c5e8985ad40211e490bb04e4', id: this.datalistId }, this.datalistoptions.map(option => (h("option", { value: option, key: option }))))), this.displayCharacterLeft && this.maxlength > 0 && (h("mg-character-left", { key: 'e0278d4295d5c923f21f617bbf37ee09bd907b54', identifier: this.characterLeftId, characters: this.value, maxlength: this.maxlength }))), h("slot", { key: '3d896e5ad21380c04c58fe925b8186e9f0a9207b', name: "append-input" })));
296
+ return (h("mg-input", { key: '717239fc622bd6d122897031a2144bd3441947d5', label: this.label, identifier: this.identifier, class: this.classCollection.join(), ariaDescribedbyIDs: [this.characterLeftId], labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, tooltip: this.tooltip, tooltipPosition: this.readonly && this.value === undefined ? 'label' : this.tooltipPosition, helpText: this.helpText, errorMessage: this.errorMessage }, this.readonly
297
+ ? this.value && this.renderReadonly()
298
+ : [
299
+ h("div", { key: "input", class: "mg-c-input__with-character-left", style: {
300
+ '--mg-c-character-left-message-length': (!this.characterLeftHide
301
+ ? (this.maxlength - (this.value || '').length).toString().length + this.maxlength.toString().length + 1
302
+ : 0).toString(),
303
+ } }, this.icon !== undefined && h("mg-icon", { icon: this.icon }), h("input", { type: this.type, class: "mg-c-input__box mg-c-input__box--width", 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) => {
304
+ if (el !== null)
305
+ this.input = el;
306
+ } }), this.hasDatalist() && (h("datalist", { id: this.datalistId }, this.datalistoptions.map(option => (h("option", { value: isOption(option) ? option.title : option, key: option }))))), !this.characterLeftHide && this.maxlength > 0 && (h("mg-character-left", { identifier: this.characterLeftId, characters: this.value, maxlength: this.maxlength }))),
307
+ h("slot", { key: "slot", name: "append-input" }),
308
+ ]));
280
309
  }
281
310
  get element() { return this; }
282
311
  static get watchers() { return {
@@ -292,7 +321,7 @@ const MgInputText = /*@__PURE__*/ proxyCustomElement(class MgInputText extends H
292
321
  }; }
293
322
  static get style() { return MgInputTextStyle0; }
294
323
  }, [1, "mg-input-text", {
295
- "value": [1537],
324
+ "value": [1544],
296
325
  "identifier": [1],
297
326
  "name": [1],
298
327
  "label": [1],
@@ -311,7 +340,7 @@ const MgInputText = /*@__PURE__*/ proxyCustomElement(class MgInputText extends H
311
340
  "patternErrorMessage": [1, "pattern-error-message"],
312
341
  "tooltip": [1],
313
342
  "tooltipPosition": [1, "tooltip-position"],
314
- "displayCharacterLeft": [4, "display-character-left"],
343
+ "characterLeftHide": [4, "character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C,CACO,CACZ,EACA,IAAI,CAAC,oBAAoB,IAAI,IAAI,CAAC,SAAS,GAAG,CAAC,KAC9C,0EAAmB,UAAU,EAAE,IAAI,CAAC,eAAe,EAAE,UAAU,EAAE,IAAI,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,GAAsB,CAC7H,CACG,EACN,6DAAM,IAAI,EAAC,cAAc,GAAQ,CACxB,EACX;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["ClassList","isValidString"],"sources":["../styles/dist/components/mg-input-text.css?tag=mg-input-text&encapsulation=shadow","src/components/molecules/inputs/mg-input-text/mg-input-text.tsx"],"sourcesContent":[".mg-u-visually-hidden{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip:rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;clip-path:inset(50%) !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media(prefers-reduced-motion){*{animation:none !important;transition:none !important}}.mg-c-input__input-container{width:100%;flex:1 auto}.mg-c-input__box.mg-c-input__box--width{width:100%;min-width:5rem;max-width:calc(17.7rem + var(--mg-inputs-spacer)*2)}.mg-c-input.mg-c-input--width-2 .mg-c-input__box,.mg-c-input.mg-c-input--width-2 .mg-c-input__with-character-left{max-width:5rem}.mg-c-input.mg-c-input--width-4 .mg-c-input__box,.mg-c-input.mg-c-input--width-4 .mg-c-input__with-character-left{max-width:7rem}.mg-c-input.mg-c-input--width-16 .mg-c-input__box,.mg-c-input.mg-c-input--width-16 .mg-c-input__with-character-left{max-width:21rem}.mg-c-input.mg-c-input--width-full .mg-c-input__box{width:100%;max-width:100%}.mg-c-input.mg-c-input--label-on-top.mg-c-input--width-2 .mg-c-input__box,.mg-c-input.mg-c-input--label-on-top.mg-c-input--width-2 .mg-c-input__with-character-left{max-width:5rem}.mg-c-input.mg-c-input--label-on-top.mg-c-input--width-4 .mg-c-input__box,.mg-c-input.mg-c-input--label-on-top.mg-c-input--width-4 .mg-c-input__with-character-left{max-width:7rem}.mg-c-input.mg-c-input--label-on-top.mg-c-input--width-16 .mg-c-input__box,.mg-c-input.mg-c-input--label-on-top.mg-c-input--width-16 .mg-c-input__with-character-left{max-width:21rem}.mg-c-input.mg-c-input--label-on-top.mg-c-input--width-full .mg-c-input__box{width:100%;max-width:100%}.mg-c-input.mg-c-input--label-on-top .mg-c-input__box{width:auto}.mg-c-input.mg-c-input--width-full:not(.mg-c-input--label-on-top){justify-content:stretch}.mg-c-input.mg-c-input--is-input-group-append ::slotted([slot=append-input]),.mg-c-input.mg-c-input--is-append-input-slot-content ::slotted([slot=append-input]){width:auto}:host(.mg-c-input.mg-c-input--width-full) ::slotted(*:not(mg-input-title)){width:100%;max-width:100%}.mg-c-input.mg-c-input--fieldset{padding:0;border:0;margin-right:0;margin-left:0}.mg-c-input.mg-c-input--fieldset input[type=radio],.mg-c-input.mg-c-input--fieldset input[type=checkbox]{width:var(--mg-input-check-size);height:var(--mg-input-check-size);flex-shrink:0;margin:calc((var(--font-size)*var(--line-height) - var(--mg-input-check-size))/2) .6rem 0 0}.mg-c-input.mg-c-input--fieldset .mg-c-input__input-group{display:flex;align-items:start}.mg-c-input.mg-c-input--fieldset .mg-c-input__input-group-container{display:flex;flex-wrap:wrap;padding:0;margin:0;margin-top:calc((var(--default-size) - var(--font-size)*var(--line-height))/2);gap:1rem 2.3rem;list-style:none}.mg-c-input.mg-c-input--fieldset.mg-c-input--vertical-list .mg-c-input__input-group-container,.mg-c-input.mg-c-input--fieldset.mg-c-input--checkbox-multi .mg-c-input__input-group-container{flex-direction:column}.mg-c-input.mg-c-input--fieldset.mg-c-input--label-on-top .mg-c-input__input-group-container{margin-top:.7rem}:host(.mg-c-input.mg-c-input--fieldset:not(.mg-c-input--checkbox-multi)) .mg-c-input__input-container mg-tooltip{margin-left:3rem}:host(.mg-c-input.mg-c-input--checkbox) .mg-c-input__input,:host(.mg-c-input.mg-c-input--radio) .mg-c-input__input{min-height:unset;align-items:flex-start}:host{display:block}.mg-c-input__input mg-icon,.mg-c-input__error mg-icon{display:flex}.mg-c-input{display:flex;min-height:var(--default-size);align-items:flex-start;margin-bottom:var(--mg-inputs-margin-bottom, 0)}.mg-c-input__input-container{min-height:var(--default-size)}.mg-c-input__input-container>ul{display:flex;flex-flow:column wrap;padding:0;margin:0;list-style:none;row-gap:.8rem}.mg-c-input__input-container>strong{display:inline-block}.mg-c-input__input-container>strong,.mg-c-input__input-container>ul{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{display:flex;min-height:var(--default-size);align-items:center;justify-content:start}.mg-c-input__input-icon{color:hsl(var(--color-dark))}.mg-c-input__input mg-tooltip{align-self:baseline;margin-top:calc((var(--default-size) - var(--mg-icon-regular-size))/2)}.mg-c-input__input .mg-c-input__box:disabled,.mg-c-input__input ::slotted(.mg-c-input__button-toggle:disabled),.mg-c-input__input-group--disabled label,.mg-c-input.mg-c-input--checkbox-multi.mg-c-input--disabled .mg-c-input__input-container strong{opacity:var(--mg-disabled-opacity)}.mg-c-input__title{display:flex;width:var(--mg-inputs-title-width, auto);flex-shrink:0;align-items:baseline;justify-content:flex-end;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__title slot[name=label]+mg-tooltip{margin-left:.4rem}.mg-c-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-c-input__error{display:inline-block;padding:.3rem .8rem;border-radius:.3rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-c-input__error ::slotted(*),.mg-c-input__help-text ::slotted(*){font-size:1.2rem;text-align:start}.mg-c-input__help-text+.mg-c-input__error{margin-top:.2rem}:host(:not(.mg-c-input--textarea)) .mg-c-input__input+.mg-c-input__error,:host(:not(.mg-c-input--textarea)) .mg-c-input__input+.mg-c-input__help-text{margin-top:.5rem}.mg-c-input.mg-c-input--readonly>*:not([slot=label],[name=append-input]),.mg-c-input.mg-c-input--readonly ::slotted(mg-button[slot=append-input]){display:none}.mg-c-input.mg-c-input--has-error .mg-c-input__box{border-color:hsl(var(--color-danger))}:host(.mg-c-input){display:flex}:host(.mg-c-input.mg-c-input--textarea.mg-c-input--readonly) .mg-c-input__input-container{white-space:pre-line}:host(.mg-c-input.mg-c-input--checkbox,.mg-c-input.mg-c-input--radio) .mg-c-input__input{min-height:unset}:host(.mg-c-input.mg-c-input--label-on-top){flex-direction:column}:host(.mg-c-input.mg-c-input--label-on-top) .mg-c-input__title{width:100%;flex:0;justify-content:flex-start;margin-top:0;margin-right:0;margin-bottom:.3rem;text-align:left}:host(.mg-c-input.mg-c-input--label-on-top) .mg-c-input__title ::slotted(mg-input-title){flex-shrink:1}@media screen and (max-width: 767px){:host(.mg-c-input){flex-direction:column}:host(.mg-c-input) .mg-c-input__title{width:100%;flex:0;justify-content:flex-start;margin-top:0;margin-right:0;margin-bottom:.3rem;text-align:left}:host(.mg-c-input) .mg-c-input__title ::slotted(mg-input-title){flex-shrink:1}}.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--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--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]){align-self:start;padding-top:calc((var(--default-size) - var(--mg-icon-regular-size))/2)}.mg-c-input.mg-c-input--has-display-character-left mg-character-left{font-size:1.1rem;opacity:.6}.mg-c-input.mg-c-input--has-display-character-left .mg-c-input__input+.mg-c-input__help-text ::slotted(*),.mg-c-input.mg-c-input--has-display-character-left .mg-c-input__input+.mg-c-input__error ::slotted(*){margin-top:0}.mg-u-visually-hidden{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip:rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;clip-path:inset(50%) !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media(prefers-reduced-motion){*{animation:none !important;transition:none !important}}.mg-c-input__with-character-left{position:relative;width:100%}.mg-c-input.mg-u-is-focused .mg-c-input__with-character-left .mg-c-input__box{padding-right:calc(var(--mg-character-left-message-length)*1ch + .8rem)}.mg-c-input__with-character-left mg-character-left{position:absolute;top:50%;right:1rem;display:none;font-size:1.1rem;opacity:.6;transform:translateY(-50%)}.mg-c-input.mg-u-is-focused .mg-c-input__with-character-left mg-character-left{display:block}.mg-c-input.mg-c-input--has-icon .mg-c-input__with-character-left>mg-icon{position:absolute;top:50%;left:var(--mg-inputs-spacer);color:var(--mg-inputs-color);transform:translateY(-50%)}.mg-c-input.mg-c-input--has-icon .mg-c-input__with-character-left .mg-c-input__box{padding-left:calc(var(--mg-icon-regular-size) + var(--mg-inputs-spacer)*2)}/*# sourceMappingURL=mg-input-text.css.map */\n","import { Component, Event, h, Prop, EventEmitter, State, Element, Method, Watch } from '@stencil/core';\nimport { ClassList, isValidString } from '@mgdis/stencil-helpers';\nimport { TextType } from './mg-input-text.conf';\nimport { type TooltipPosition, type Width, Handler, widths, classReadonly, classDisabled } from '../mg-input/mg-input.conf';\nimport { initLocales } from '../../../../locales';\nimport { IconType } from '../../../../components';\n\n/**\n * Check if datalist options are well structured.\n *\n * @param options - Datalist options to check.\n * @returns True if datalist is well structured.\n */\nconst isDatalistOption = (options: unknown[]): options is string[] => Array.isArray(options) && options.every(option => typeof option === 'string');\n\n/**\n * @slot append-input - Content to display next to the input\n */\n@Component({\n tag: 'mg-input-text',\n styleUrl: '../../../../../node_modules/@mgdis/styles/dist/components/mg-input-text.css',\n shadow: true,\n})\nexport class MgInputText {\n /************\n * Internal *\n ************/\n\n // Classes\n private readonly classFocus = 'mg-u-is-focused';\n private readonly classIsInputGroupAppend = 'mg-c-input--is-input-group-append';\n private readonly classHasIcon = 'mg-c-input--has-icon';\n private readonly classHasButtonsGroupAppend = 'mg-c-input--has-buttons-group-append';\n private readonly classIsAppendInputSlotContent = 'mg-c-input--is-append-input-slot-content';\n\n // IDs\n private characterLeftId;\n private datalistId;\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\n private handlerInProgress: Handler;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgInputTextElement;\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 * Input type\n */\n @Prop() type: TextType = 'text';\n\n /**\n * Input icon\n */\n @Prop() icon?: IconType;\n @Watch('icon')\n validateIcon(newValue: string): void {\n if (newValue !== undefined) {\n this.classCollection.add(this.classHasIcon);\n } else {\n this.classCollection.delete(this.classHasIcon);\n }\n }\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 datalist options\n */\n @Prop() datalistoptions: string[];\n @Watch('datalistoptions')\n validateDatalistoptions(newValue: MgInputText['datalistoptions']) {\n if (Boolean(newValue) && !isDatalistOption(newValue)) {\n throw new Error('<mg-input-text> prop \"datalistoptions\" values must be the same type, string.');\n }\n }\n\n /**\n * Input max length\n */\n @Prop() maxlength = 400;\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 @Watch('readonly')\n watchReadonly(newValue: MgInputText['readonly']): void {\n if (newValue) this.classCollection.add(classReadonly);\n else this.classCollection.delete(classReadonly);\n }\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 @Watch('disabled')\n watchDisabled(newValue: MgInputText['disabled']): void {\n if (newValue) this.classCollection.add(classDisabled);\n else this.classCollection.delete(classDisabled);\n }\n\n /**\n * Define input width\n */\n @Prop() mgWidth: Width = 'full';\n @Watch('mgWidth')\n watchMgWidth(newValue: MgInputText['mgWidth']): void {\n // reset width class\n widths.forEach(width => {\n this.classCollection.delete(`mg-c-input--width-${width}`);\n });\n\n // apply new width\n if (newValue) this.classCollection.add(`mg-c-input--width-${this.mgWidth}`);\n }\n\n /**\n * Define input pattern to validate\n * Please refer to the Pattern section in the input documentation for detailed information on using regular expressions in components.\n */\n @Prop() pattern?: string;\n\n /**\n * Define input pattern error message\n */\n @Prop() patternErrorMessage?: string;\n @Watch('pattern')\n @Watch('patternErrorMessage')\n validatePattern(newValue: string): void {\n if (newValue !== undefined && !(isValidString(this.pattern) && isValidString(this.patternErrorMessage))) {\n throw new Error('<mg-input-text> props \"pattern\" and \"patternErrorMessage\" must be non-empty string and paired.');\n }\n }\n\n /**\n * Add a tooltip message next to the input\n */\n @Prop() tooltip?: string;\n\n /**\n * Define tooltip position\n */\n @Prop() tooltipPosition: TooltipPosition = 'input';\n\n /**\n * Define if component should display character left\n */\n @Prop() displayCharacterLeft = true;\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--text']);\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<HTMLMgInputTextElement['value']>;\n\n /**\n * Emited event when checking validity\n */\n @Event({ eventName: 'input-valid' }) inputValid: EventEmitter<HTMLMgInputTextElement['valid']>;\n\n /**\n * Public method to play input focus\n */\n @Method()\n async setFocus(): Promise<void> {\n this.input.focus();\n }\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: MgInputText['valid'], errorMessage: string): Promise<void> {\n if (typeof valid !== 'boolean') {\n throw new Error('<mg-input-text> method \"setError()\" param \"valid\" must be a boolean');\n } else if (!isValidString(errorMessage)) {\n throw new Error('<mg-input-text> 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: MgInputText['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 focus event\n */\n private handleFocus = (): void => {\n this.classCollection.add(this.classFocus);\n this.classCollection = new ClassList(this.classCollection.classes);\n };\n\n /**\n * Handle blur event\n */\n private handleBlur = (): void => {\n // Manage focus\n this.classCollection.delete(this.classFocus);\n this.classCollection = new ClassList(this.classCollection.classes);\n // Display Error\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());\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 // Does have a custom error message\n if (!this.valid && errorMessage !== undefined) {\n this.errorMessage = errorMessage;\n }\n // Does not match pattern\n else if (!this.valid && this.input.validity.patternMismatch) {\n this.errorMessage = this.patternErrorMessage;\n }\n // required\n else if (!this.valid && this.input.validity.valueMissing) {\n this.errorMessage = this.messages.errors.required;\n }\n };\n\n /**\n * Validate append slot\n */\n private validateAppendSlot = (): void => {\n const slotAppendInput: HTMLSlotElement[] = Array.from(this.element.querySelectorAll('[slot=\"append-input\"]'));\n\n if (slotAppendInput.length === 1) {\n this.classCollection.add(slotAppendInput[0].nodeName === 'MG-BUTTON' ? this.classIsInputGroupAppend : this.classIsAppendInputSlotContent);\n } else if (slotAppendInput.filter(slot => slot.nodeName === 'MG-BUTTON').length > 1) {\n this.classCollection.add(this.classIsInputGroupAppend);\n this.classCollection.add(this.classHasButtonsGroupAppend);\n }\n };\n\n /**\n * Method to control datalist display condition\n * @returns true if display condition success\n */\n private hasDatalist = (): boolean => isDatalistOption(this.datalistoptions) && this.datalistoptions.length > 0;\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 this.characterLeftId = `${this.identifier}-character-left`;\n this.datalistId = `${this.identifier}-datalist`;\n // Validate\n this.validateIcon(this.icon);\n this.validateDatalistoptions(this.datalistoptions);\n this.validatePattern(this.pattern);\n this.validatePattern(this.patternErrorMessage);\n this.validateAppendSlot();\n this.watchMgWidth(this.mgWidth);\n this.watchReadonly(this.readonly);\n this.watchDisabled(this.disabled);\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 <mg-input\n label={this.label}\n identifier={this.identifier}\n class={this.classCollection.join()}\n ariaDescribedbyIDs={[this.characterLeftId]}\n labelOnTop={this.labelOnTop}\n labelHide={this.labelHide}\n required={this.required}\n readonlyValue={this.value}\n tooltip={this.tooltip}\n tooltipPosition={this.tooltipPosition}\n helpText={this.helpText}\n errorMessage={this.errorMessage}\n >\n <div\n class=\"mg-c-input__with-character-left\"\n style={{\n '--mg-character-left-message-length': (this.displayCharacterLeft\n ? (this.maxlength - (this.value || '').length).toString().length + this.maxlength.toString().length + 1\n : 0\n ).toString(),\n }}\n >\n {this.icon !== undefined && <mg-icon icon={this.icon}></mg-icon>}\n <input\n type={this.type}\n class=\"mg-c-input__box mg-c-input__box--width\"\n value={this.value}\n id={this.identifier}\n list={this.hasDatalist() ? this.datalistId : undefined}\n autocomplete={this.hasDatalist() ? 'off' : undefined}\n name={this.name}\n placeholder={this.placeholder}\n title={this.placeholder}\n maxlength={this.maxlength}\n disabled={this.disabled}\n required={this.required}\n aria-invalid={(this.invalid === true).toString()}\n pattern={this.pattern}\n onInput={this.handleInput}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n ref={(el: HTMLInputElement) => {\n if (el !== null) this.input = el;\n }}\n />\n {this.hasDatalist() && (\n <datalist id={this.datalistId}>\n {this.datalistoptions.map(option => (\n <option value={option} key={option}></option>\n ))}\n </datalist>\n )}\n {this.displayCharacterLeft && this.maxlength > 0 && (\n <mg-character-left identifier={this.characterLeftId} characters={this.value} maxlength={this.maxlength}></mg-character-left>\n )}\n </div>\n <slot name=\"append-input\"></slot>\n </mg-input>\n );\n }\n}\n"],"version":3}
1
+ {"file":"mg-input-text2.js","mappings":";;;;;;;;;;AAAA,MAAM,cAAc,GAAG,8jLAA8jL,CAAC;AACtlL,0BAAe,cAAc;;ACQ7B;;;;;AAMA,MAAM,QAAQ,GAAG,CAAC,MAAe,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ACI,EACX;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["allItemsAreString","ClassList","toString","isValidString"],"sources":["../styles/dist/components/mg-input-text.css?tag=mg-input-text&encapsulation=shadow","src/components/molecules/inputs/mg-input-text/mg-input-text.tsx"],"sourcesContent":[".mg-c-input__box{height:var(--mg-b-size-min-height);box-sizing:border-box;padding:calc((var(--mg-b-size-min-height) - var(--mg-b-font-size)*var(--mg-b-line-height))/2) var(--mg-b-size-8);border-width:var(--mg-c-input-border-width);border-style:solid;border-color:var(--mg-c-input-color-border);border-radius:var(--mg-c-input-border-radius);background-color:var(--mg-b-color-light);color:var(--mg-b-color-dark);font-family:inherit;font-size:var(--mg-b-font-size);text-align:var(--mg-c-input-text-align, left)}.mg-c-input__box::placeholder{color:var(--mg-c-input-placeholder-color-text);font-style:italic}.mg-c-input__box:focus{box-shadow:0 0 var(--mg-b-size-4) var(--mg-c-input-color-box-shadow-focus)}.mg-c-input__box:disabled{opacity:var(--mg-b-opacity-element-disabled)}.mg-c-input.mg-c-input--has-error .mg-c-input__box{border-color:var(--mg-b-color-danger)}.mg-c-input.mg-c-input--is-input-group-append{--mg-c-button-border-radius-top-left: 0;--mg-c-button-border-radius-bottom-left: 0}.mg-c-input.mg-c-input--is-input-group-append .mg-c-input__box{margin-right:calc(-1*var(--mg-b-size-border));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--has-buttons-group-append ::slotted([slot=append-input]){--mg-c-button-border-radius-top-right: 0;--mg-c-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-c-button-border-right-width: 0}.mg-c-input.mg-c-input--has-buttons-group-append ::slotted([slot=append-input]:last-of-type){--mg-c-button-border-radius-top-right: var(--mg-c-input-border-radius);--mg-c-button-border-radius-bottom-right: var(--mg-c-input-border-radius)}.mg-c-input.mg-c-input--is-append-input-slot-content:not(.mg-c-input--readonly) ::slotted([slot=append-input]){align-self:start;padding-top:calc((var(--mg-b-size-min-height) - var(--mg-b-size-16))/2)}.mg-c-input__input-container{width:100%;flex:1 auto}.mg-c-input.mg-c-input--width-2 .mg-c-input__box,.mg-c-input.mg-c-input--width-2 .mg-c-input__with-character-left{max-width:var(--mg-b-size-48)}.mg-c-input.mg-c-input--width-4 .mg-c-input__box,.mg-c-input.mg-c-input--width-4 .mg-c-input__with-character-left{max-width:var(--mg-b-size-72)}.mg-c-input.mg-c-input--width-16 .mg-c-input__box,.mg-c-input.mg-c-input--width-16 .mg-c-input__with-character-left{max-width:calc(26*var(--mg-b-size-8))}.mg-c-input.mg-c-input--width-full .mg-c-input__box{width:100%;max-width:100%}.mg-c-input.mg-c-input--label-on-top.mg-c-input--width-2 .mg-c-input__box,.mg-c-input.mg-c-input--label-on-top.mg-c-input--width-2 .mg-c-input__with-character-left{max-width:var(--mg-b-size-48)}.mg-c-input.mg-c-input--label-on-top.mg-c-input--width-4 .mg-c-input__box,.mg-c-input.mg-c-input--label-on-top.mg-c-input--width-4 .mg-c-input__with-character-left{max-width:var(--mg-b-size-72)}.mg-c-input.mg-c-input--label-on-top.mg-c-input--width-16 .mg-c-input__box,.mg-c-input.mg-c-input--label-on-top.mg-c-input--width-16 .mg-c-input__with-character-left{max-width:calc(26*var(--mg-b-size-8))}.mg-c-input.mg-c-input--label-on-top.mg-c-input--width-full .mg-c-input__box{width:100%;max-width:100%}.mg-c-input.mg-c-input--label-on-top .mg-c-input__box{width:auto}.mg-c-input.mg-c-input--width-full:not(.mg-c-input--label-on-top){justify-content:stretch}.mg-c-input.mg-c-input--is-input-group-append ::slotted([slot=append-input]),.mg-c-input.mg-c-input--is-append-input-slot-content ::slotted([slot=append-input]){width:auto}:host(.mg-c-input.mg-c-input--width-full) ::slotted(*:not(mg-input-title)){width:100%;max-width:100%}.mg-c-input__readonly-value{min-height:var(--mg-b-font-size);align-self:flex-start;margin-top:calc((var(--mg-b-size-min-height) - var(--mg-b-font-size)*var(--mg-b-line-height))/2);word-break:break-word}.mg-c-input.mg-c-input--display-character-left mg-character-left{font-size:var(--mg-b-font-size-small);opacity:.6}.mg-c-input.mg-c-input--display-character-left .mg-c-input__input+.mg-c-input__help-text ::slotted(*),.mg-c-input.mg-c-input--display-character-left .mg-c-input__input+.mg-c-input__error ::slotted(*){margin-top:0}.mg-u-visually-hidden{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip:rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;clip-path:inset(50%) !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media(prefers-reduced-motion){*{animation:none !important;transition:none !important}}.mg-c-input__with-character-left{position:relative;width:100%}.mg-c-input.mg-u-is-focused .mg-c-input__with-character-left .mg-c-input__box{padding-right:calc(var(--mg-c-character-left-message-length)*1ch + var(--mg-b-size-8))}.mg-c-input__with-character-left mg-character-left{position:absolute;top:50%;right:var(--mg-b-size-8);display:none;font-size:var(--mg-b-font-size-small);opacity:.6;transform:translateY(-50%)}.mg-c-input.mg-u-is-focused .mg-c-input__with-character-left mg-character-left{display:block}.mg-c-input.mg-c-input--readonly b{min-height:var(--mg-b-font-size);margin-top:calc((var(--mg-b-size-min-height) - var(--mg-b-font-size)*var(--mg-b-line-height))/2)}.mg-c-input.mg-c-input--has-icon .mg-c-input__with-character-left>mg-icon{position:absolute;top:50%;left:var(--mg-b-size-8);color:var(--mg-c-input-color-icon);transform:translateY(-50%)}.mg-c-input.mg-c-input--has-icon .mg-c-input__with-character-left .mg-c-input__box{padding-left:calc(var(--mg-b-size-16) + var(--mg-b-size-8)*2)}/*# sourceMappingURL=mg-input-text.css.map */\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport { Component, Event, h, Prop, EventEmitter, State, Element, Method, Watch } from '@stencil/core';\nimport { allItemsAreString, ClassList, isValidString, toString } from '@mgdis/stencil-helpers';\nimport { OptionType, TextType } from './mg-input-text.conf';\nimport { type TooltipPosition, type Width, type EventType, widths, classReadonly, classDisabled } from '../mg-input/mg-input.conf';\nimport { initLocales } from '../../../../locales';\nimport { IconType } from '../../../../components';\n\n/**\n * Check if object is an option\n * @param option - object to validate\n * @returns true id object is an option\n */\n\nconst isOption = (option: unknown): option is OptionType =>\n typeof option === 'object' && typeof (option as OptionType).title === 'string' && (option as OptionType).value !== undefined;\n\n/**\n * Check if datalist options are well structured.\n * @param options - Datalist options to check.\n * @returns True if datalist is well structured.\n */\nconst isDatalistOptions = (options: unknown[]): options is string[] => allItemsAreString(options) || (Array.isArray(options) && options.every(isOption));\n\n/**\n * @slot append-input - Content to display next to the input\n */\n@Component({\n tag: 'mg-input-text',\n styleUrl: '../../../../../node_modules/@mgdis/styles/dist/components/mg-input-text.css',\n shadow: true,\n})\nexport class MgInputText {\n /************\n * Internal *\n ************/\n\n // Classes\n private readonly classFocus = 'mg-u-is-focused';\n private readonly classIsInputGroupAppend = 'mg-c-input--is-input-group-append';\n private readonly classHasIcon = 'mg-c-input--has-icon';\n private readonly classHasButtonsGroupAppend = 'mg-c-input--has-buttons-group-append';\n private readonly classIsAppendInputSlotContent = 'mg-c-input--is-append-input-slot-content';\n\n // IDs\n private characterLeftId: string;\n private datalistId: string;\n private slotContent: string;\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\n private handlerInProgress: EventType;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgInputTextElement;\n\n /**\n * Component value\n */\n @Prop({ mutable: true, reflect: true }) value: any;\n @Watch('value')\n handleValue(newValue: string): void {\n if (this.datalistoptions?.every(isOption)) {\n this.valueChange.emit(this.datalistoptions.find(option => option.title === newValue)?.value || newValue);\n } else {\n this.valueChange.emit(newValue);\n }\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 * Input type\n */\n @Prop() type: TextType = 'text';\n\n /**\n * Input icon\n */\n @Prop() icon?: IconType;\n @Watch('icon')\n validateIcon(newValue: string): void {\n if (newValue !== undefined) {\n this.classCollection.add(this.classHasIcon);\n } else {\n this.classCollection.delete(this.classHasIcon);\n }\n }\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 datalist options\n */\n @Prop() datalistoptions: string[] | OptionType[];\n @Watch('datalistoptions')\n validateDatalistoptions(newValue: MgInputText['datalistoptions']) {\n if (Boolean(newValue) && !isDatalistOptions(newValue)) {\n throw new Error(`<mg-input-text> prop \"datalistoptions\" values must be the same type, string or OptionType. Passed value: ${toString(newValue)}.`);\n }\n }\n\n /**\n * Input max length\n */\n @Prop() maxlength = 400;\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 @Watch('readonly')\n watchReadonly(newValue: MgInputText['readonly']): void {\n if (newValue) this.classCollection.add(classReadonly);\n else this.classCollection.delete(classReadonly);\n }\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 @Watch('disabled')\n watchDisabled(newValue: MgInputText['disabled']): void {\n if (newValue) this.classCollection.add(classDisabled);\n else this.classCollection.delete(classDisabled);\n }\n\n /**\n * Define input width\n */\n @Prop() mgWidth: Width = 'full';\n @Watch('mgWidth')\n watchMgWidth(newValue: MgInputText['mgWidth']): void {\n // reset width class\n widths.forEach(width => {\n this.classCollection.delete(`mg-c-input--width-${width}`);\n });\n\n // apply new width\n if (newValue !== undefined) this.classCollection.add(`mg-c-input--width-${this.mgWidth}`);\n }\n\n /**\n * Define input pattern to validate\n * Please refer to the Pattern section in the input documentation for detailed information on using regular expressions in components.\n */\n @Prop() pattern?: string;\n\n /**\n * Define input pattern error message\n */\n @Prop() patternErrorMessage?: string;\n @Watch('pattern')\n @Watch('patternErrorMessage')\n validatePattern(newValue: string): void {\n if (newValue !== undefined && !(isValidString(this.pattern) && isValidString(this.patternErrorMessage))) {\n throw new Error(\n `<mg-input-text> props \"pattern\" and \"patternErrorMessage\" must be non-empty string and paired. Passed value: \"pattern='${toString(this.pattern)}'\" and \"patternErrorMessage='${toString(this.patternErrorMessage)}'\".`,\n );\n }\n }\n\n /**\n * Add a tooltip message next to the input\n */\n @Prop() tooltip?: string;\n\n /**\n * Define tooltip position\n */\n @Prop() tooltipPosition: TooltipPosition = 'input';\n\n /**\n * Define if component should display character left\n */\n @Prop() characterLeftHide = false;\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--text']);\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<HTMLMgInputTextElement['value']>;\n\n /**\n * Emited event when checking validity\n */\n @Event({ eventName: 'input-valid' }) inputValid: EventEmitter<HTMLMgInputTextElement['valid']>;\n\n /**\n * Public method to play input focus\n */\n @Method()\n async setFocus(): Promise<void> {\n this.input.focus();\n }\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: MgInputText['valid'], errorMessage: string): Promise<void> {\n if (typeof valid !== 'boolean') {\n throw new Error('<mg-input-text> method \"setError()\" param \"valid\" must be a boolean.');\n } else if (!isValidString(errorMessage)) {\n throw new Error('<mg-input-text> 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: MgInputText['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 === '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 focus event\n */\n private handleFocus = (): void => {\n this.classCollection.add(this.classFocus);\n this.classCollection = new ClassList(this.classCollection.classes);\n };\n\n /**\n * Handle blur event\n */\n private handleBlur = (): void => {\n // Manage focus\n this.classCollection.delete(this.classFocus);\n this.classCollection = new ClassList(this.classCollection.classes);\n // Display Error\n this.handlerInProgress = '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());\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 // Does have a custom error message\n if (!this.valid && errorMessage !== undefined) {\n this.errorMessage = errorMessage;\n }\n // Does not match pattern\n else if (!this.valid && this.input.validity.patternMismatch) {\n this.errorMessage = this.patternErrorMessage;\n }\n // required\n else if (!this.valid && this.input.validity.valueMissing) {\n this.errorMessage = this.messages.errors.required;\n }\n };\n\n /**\n * Validate append slot\n */\n private validateAppendSlot = (): void => {\n const slotAppendInput: HTMLSlotElement[] = Array.from(this.element.querySelectorAll('[slot=\"append-input\"]'));\n\n if (slotAppendInput.length === 1) {\n if (slotAppendInput[0].nodeName === 'MG-BUTTON') {\n this.classCollection.add(this.classIsInputGroupAppend);\n } else {\n this.classCollection.add(this.classIsAppendInputSlotContent);\n this.slotContent = slotAppendInput[0].textContent;\n }\n } else if (slotAppendInput.filter(slot => slot.nodeName === 'MG-BUTTON').length > 1) {\n this.classCollection.add(this.classIsInputGroupAppend);\n this.classCollection.add(this.classHasButtonsGroupAppend);\n }\n };\n\n /**\n * Method to control datalist display condition\n * @returns true if display condition success\n */\n private hasDatalist = (): boolean => isDatalistOptions(this.datalistoptions) && this.datalistoptions.length > 0;\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 this.characterLeftId = `${this.identifier}-character-left`;\n this.datalistId = `${this.identifier}-datalist`;\n // Validate\n this.validateIcon(this.icon);\n this.validateDatalistoptions(this.datalistoptions);\n this.validatePattern(this.pattern);\n this.validatePattern(this.patternErrorMessage);\n this.validateAppendSlot();\n this.watchMgWidth(this.mgWidth);\n this.watchReadonly(this.readonly);\n this.watchDisabled(this.disabled);\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 * Renders the readonly content of the input component.\n * @returns The readonly content element.\n */\n private renderReadonly = (): HTMLElement => {\n return this.slotContent !== undefined ? (\n <span class=\"mg-c-input__readonly-value\">\n <b>{this.value}</b>\n {this.slotContent}\n </span>\n ) : (\n <b class=\"mg-c-input__readonly-value\">{this.value}</b>\n );\n };\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <mg-input\n label={this.label}\n identifier={this.identifier}\n class={this.classCollection.join()}\n ariaDescribedbyIDs={[this.characterLeftId]}\n labelOnTop={this.labelOnTop}\n labelHide={this.labelHide}\n required={this.required}\n tooltip={this.tooltip}\n tooltipPosition={this.readonly && this.value === undefined ? 'label' : this.tooltipPosition}\n helpText={this.helpText}\n errorMessage={this.errorMessage}\n >\n {this.readonly\n ? this.value && this.renderReadonly()\n : [\n <div\n key=\"input\"\n class=\"mg-c-input__with-character-left\"\n style={{\n '--mg-c-character-left-message-length': (!this.characterLeftHide\n ? (this.maxlength - (this.value || '').length).toString().length + this.maxlength.toString().length + 1\n : 0\n ).toString(),\n }}\n >\n {this.icon !== undefined && <mg-icon icon={this.icon}></mg-icon>}\n <input\n type={this.type}\n class=\"mg-c-input__box mg-c-input__box--width\"\n value={this.value}\n id={this.identifier}\n list={this.hasDatalist() ? this.datalistId : undefined}\n autocomplete={this.hasDatalist() ? 'off' : undefined}\n name={this.name}\n placeholder={this.placeholder}\n title={this.placeholder}\n maxlength={this.maxlength}\n disabled={this.disabled}\n required={this.required}\n aria-invalid={(this.invalid === true).toString()}\n pattern={this.pattern}\n onInput={this.handleInput}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n ref={(el: HTMLInputElement) => {\n if (el !== null) this.input = el;\n }}\n />\n {this.hasDatalist() && (\n <datalist id={this.datalistId}>\n {this.datalistoptions.map(option => (\n <option value={isOption(option) ? option.title : option} key={option}></option>\n ))}\n </datalist>\n )}\n {!this.characterLeftHide && this.maxlength > 0 && (\n <mg-character-left identifier={this.characterLeftId} characters={this.value} maxlength={this.maxlength}></mg-character-left>\n )}\n </div>,\n <slot key=\"slot\" name=\"append-input\"></slot>,\n ]}\n </mg-input>\n );\n }\n}\n"],"version":3}
@@ -1,6 +1,6 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
- import { I as Ie, Z as Ze } from './index.es.js';
3
- import { d as defineCustomElement$5, H as Handler, b as classReadonly, e as classDisabled, w as widths } from './mg-input2.js';
2
+ import { I as Ie, Q as Qe, Z as Ze } from './index.es.js';
3
+ import { d as defineCustomElement$5, b as classReadonly, e as classDisabled, w as widths } from './mg-input2.js';
4
4
  import { i as initLocales } from './index2.js';
5
5
  import { d as defineCustomElement$7 } from './mg-character-left2.js';
6
6
  import { d as defineCustomElement$6 } from './mg-icon2.js';
@@ -8,7 +8,7 @@ import { d as defineCustomElement$4 } from './mg-input-title2.js';
8
8
  import { d as defineCustomElement$3 } from './mg-tooltip2.js';
9
9
  import { d as defineCustomElement$2 } from './mg-tooltip-content2.js';
10
10
 
11
- const mgInputTextareaCss = ".mg-u-visually-hidden{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip:rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;clip-path:inset(50%) !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){*{animation:none !important;transition:none !important}}.mg-c-input__input-container{width:100%;flex:1 auto}.mg-c-input__box.mg-c-input__box--width{width:100%;min-width:5rem;max-width:calc(17.7rem + var(--mg-inputs-spacer)*2)}.mg-c-input.mg-c-input--width-2 .mg-c-input__box,.mg-c-input.mg-c-input--width-2 .mg-c-input__with-character-left{max-width:5rem}.mg-c-input.mg-c-input--width-4 .mg-c-input__box,.mg-c-input.mg-c-input--width-4 .mg-c-input__with-character-left{max-width:7rem}.mg-c-input.mg-c-input--width-16 .mg-c-input__box,.mg-c-input.mg-c-input--width-16 .mg-c-input__with-character-left{max-width:21rem}.mg-c-input.mg-c-input--width-full .mg-c-input__box{width:100%;max-width:100%}.mg-c-input.mg-c-input--label-on-top.mg-c-input--width-2 .mg-c-input__box,.mg-c-input.mg-c-input--label-on-top.mg-c-input--width-2 .mg-c-input__with-character-left{max-width:5rem}.mg-c-input.mg-c-input--label-on-top.mg-c-input--width-4 .mg-c-input__box,.mg-c-input.mg-c-input--label-on-top.mg-c-input--width-4 .mg-c-input__with-character-left{max-width:7rem}.mg-c-input.mg-c-input--label-on-top.mg-c-input--width-16 .mg-c-input__box,.mg-c-input.mg-c-input--label-on-top.mg-c-input--width-16 .mg-c-input__with-character-left{max-width:21rem}.mg-c-input.mg-c-input--label-on-top.mg-c-input--width-full .mg-c-input__box{width:100%;max-width:100%}.mg-c-input.mg-c-input--label-on-top .mg-c-input__box{width:auto}.mg-c-input.mg-c-input--width-full:not(.mg-c-input--label-on-top){justify-content:stretch}.mg-c-input.mg-c-input--is-input-group-append ::slotted([slot=append-input]),.mg-c-input.mg-c-input--is-append-input-slot-content ::slotted([slot=append-input]){width:auto}:host(.mg-c-input.mg-c-input--width-full) ::slotted(*:not(mg-input-title)){width:100%;max-width:100%}.mg-c-input.mg-c-input--fieldset{padding:0;border:0;margin-right:0;margin-left:0}.mg-c-input.mg-c-input--fieldset input[type=radio],.mg-c-input.mg-c-input--fieldset input[type=checkbox]{width:var(--mg-input-check-size);height:var(--mg-input-check-size);flex-shrink:0;margin:calc((var(--font-size)*var(--line-height) - var(--mg-input-check-size))/2) .6rem 0 0}.mg-c-input.mg-c-input--fieldset .mg-c-input__input-group{display:flex;align-items:start}.mg-c-input.mg-c-input--fieldset .mg-c-input__input-group-container{display:flex;flex-wrap:wrap;padding:0;margin:0;margin-top:calc((var(--default-size) - var(--font-size)*var(--line-height))/2);gap:1rem 2.3rem;list-style:none}.mg-c-input.mg-c-input--fieldset.mg-c-input--vertical-list .mg-c-input__input-group-container,.mg-c-input.mg-c-input--fieldset.mg-c-input--checkbox-multi .mg-c-input__input-group-container{flex-direction:column}.mg-c-input.mg-c-input--fieldset.mg-c-input--label-on-top .mg-c-input__input-group-container{margin-top:.7rem}:host(.mg-c-input.mg-c-input--fieldset:not(.mg-c-input--checkbox-multi)) .mg-c-input__input-container mg-tooltip{margin-left:3rem}:host(.mg-c-input.mg-c-input--checkbox) .mg-c-input__input,:host(.mg-c-input.mg-c-input--radio) .mg-c-input__input{min-height:unset;align-items:flex-start}:host{display:block}.mg-c-input__input mg-icon,.mg-c-input__error mg-icon{display:flex}.mg-c-input{display:flex;min-height:var(--default-size);align-items:flex-start;margin-bottom:var(--mg-inputs-margin-bottom, 0)}.mg-c-input__input-container{min-height:var(--default-size)}.mg-c-input__input-container>ul{display:flex;flex-flow:column wrap;padding:0;margin:0;list-style:none;row-gap:.8rem}.mg-c-input__input-container>strong{display:inline-block}.mg-c-input__input-container>strong,.mg-c-input__input-container>ul{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{display:flex;min-height:var(--default-size);align-items:center;justify-content:start}.mg-c-input__input-icon{color:hsl(var(--color-dark))}.mg-c-input__input mg-tooltip{align-self:baseline;margin-top:calc((var(--default-size) - var(--mg-icon-regular-size))/2)}.mg-c-input__input .mg-c-input__box:disabled,.mg-c-input__input ::slotted(.mg-c-input__button-toggle:disabled),.mg-c-input__input-group--disabled label,.mg-c-input.mg-c-input--checkbox-multi.mg-c-input--disabled .mg-c-input__input-container strong{opacity:var(--mg-disabled-opacity)}.mg-c-input__title{display:flex;width:var(--mg-inputs-title-width, auto);flex-shrink:0;align-items:baseline;justify-content:flex-end;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__title slot[name=label]+mg-tooltip{margin-left:.4rem}.mg-c-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-c-input__error{display:inline-block;padding:.3rem .8rem;border-radius:.3rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-c-input__error ::slotted(*),.mg-c-input__help-text ::slotted(*){font-size:1.2rem;text-align:start}.mg-c-input__help-text+.mg-c-input__error{margin-top:.2rem}:host(:not(.mg-c-input--textarea)) .mg-c-input__input+.mg-c-input__error,:host(:not(.mg-c-input--textarea)) .mg-c-input__input+.mg-c-input__help-text{margin-top:.5rem}.mg-c-input.mg-c-input--readonly>*:not([slot=label],[name=append-input]),.mg-c-input.mg-c-input--readonly ::slotted(mg-button[slot=append-input]){display:none}.mg-c-input.mg-c-input--has-error .mg-c-input__box{border-color:hsl(var(--color-danger))}:host(.mg-c-input){display:flex}:host(.mg-c-input.mg-c-input--textarea.mg-c-input--readonly) .mg-c-input__input-container{white-space:pre-line}:host(.mg-c-input.mg-c-input--checkbox,.mg-c-input.mg-c-input--radio) .mg-c-input__input{min-height:unset}:host(.mg-c-input.mg-c-input--label-on-top){flex-direction:column}:host(.mg-c-input.mg-c-input--label-on-top) .mg-c-input__title{width:100%;flex:0;justify-content:flex-start;margin-top:0;margin-right:0;margin-bottom:.3rem;text-align:left}:host(.mg-c-input.mg-c-input--label-on-top) .mg-c-input__title ::slotted(mg-input-title){flex-shrink:1}@media screen and (max-width: 767px){:host(.mg-c-input){flex-direction:column}:host(.mg-c-input) .mg-c-input__title{width:100%;flex:0;justify-content:flex-start;margin-top:0;margin-right:0;margin-bottom:.3rem;text-align:left}:host(.mg-c-input) .mg-c-input__title ::slotted(mg-input-title){flex-shrink:1}}.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--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--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]){align-self:start;padding-top:calc((var(--default-size) - var(--mg-icon-regular-size))/2)}.mg-c-input.mg-c-input--has-display-character-left mg-character-left{font-size:1.1rem;opacity:.6}.mg-c-input.mg-c-input--has-display-character-left .mg-c-input__input+.mg-c-input__help-text ::slotted(*),.mg-c-input.mg-c-input--has-display-character-left .mg-c-input__input+.mg-c-input__error ::slotted(*){margin-top:0}.mg-u-visually-hidden{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip:rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;clip-path:inset(50%) !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){*{animation:none !important;transition:none !important}}.mg-c-input__box{display:block;height:auto;resize:none}.mg-c-input__box.mg-c-input__box--resizable{resize:both}.mg-c-input__box.mg-c-input__box--resizable-horizontal{resize:horizontal}.mg-c-input__box.mg-c-input__box--resizable-vertical{resize:vertical}.mg-c-input__with-character-left mg-character-left{display:block;margin-top:.2rem;text-align:end;visibility:hidden}.mg-c-input.mg-u-is-focused .mg-c-input__with-character-left mg-character-left{visibility:visible}@-moz-document url-prefix(){.mg-c-input__box{overflow-x:hidden}}";
11
+ const mgInputTextareaCss = ".mg-c-input__box{height:var(--mg-b-size-min-height);box-sizing:border-box;padding:calc((var(--mg-b-size-min-height) - var(--mg-b-font-size)*var(--mg-b-line-height))/2) var(--mg-b-size-8);border-width:var(--mg-c-input-border-width);border-style:solid;border-color:var(--mg-c-input-color-border);border-radius:var(--mg-c-input-border-radius);background-color:var(--mg-b-color-light);color:var(--mg-b-color-dark);font-family:inherit;font-size:var(--mg-b-font-size);text-align:var(--mg-c-input-text-align, left)}.mg-c-input__box::placeholder{color:var(--mg-c-input-placeholder-color-text);font-style:italic}.mg-c-input__box:focus{box-shadow:0 0 var(--mg-b-size-4) var(--mg-c-input-color-box-shadow-focus)}.mg-c-input__box:disabled{opacity:var(--mg-b-opacity-element-disabled)}.mg-c-input.mg-c-input--has-error .mg-c-input__box{border-color:var(--mg-b-color-danger)}.mg-c-input.mg-c-input--is-input-group-append{--mg-c-button-border-radius-top-left:0;--mg-c-button-border-radius-bottom-left:0}.mg-c-input.mg-c-input--is-input-group-append .mg-c-input__box{margin-right:calc(-1*var(--mg-b-size-border));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--has-buttons-group-append ::slotted([slot=append-input]){--mg-c-button-border-radius-top-right:0;--mg-c-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-c-button-border-right-width:0}.mg-c-input.mg-c-input--has-buttons-group-append ::slotted([slot=append-input]:last-of-type){--mg-c-button-border-radius-top-right:var(--mg-c-input-border-radius);--mg-c-button-border-radius-bottom-right:var(--mg-c-input-border-radius)}.mg-c-input.mg-c-input--is-append-input-slot-content:not(.mg-c-input--readonly) ::slotted([slot=append-input]){align-self:start;padding-top:calc((var(--mg-b-size-min-height) - var(--mg-b-size-16))/2)}.mg-c-input__input-container{width:100%;flex:1 auto}.mg-c-input.mg-c-input--width-2 .mg-c-input__box,.mg-c-input.mg-c-input--width-2 .mg-c-input__with-character-left{max-width:var(--mg-b-size-48)}.mg-c-input.mg-c-input--width-4 .mg-c-input__box,.mg-c-input.mg-c-input--width-4 .mg-c-input__with-character-left{max-width:var(--mg-b-size-72)}.mg-c-input.mg-c-input--width-16 .mg-c-input__box,.mg-c-input.mg-c-input--width-16 .mg-c-input__with-character-left{max-width:calc(26*var(--mg-b-size-8))}.mg-c-input.mg-c-input--width-full .mg-c-input__box{width:100%;max-width:100%}.mg-c-input.mg-c-input--label-on-top.mg-c-input--width-2 .mg-c-input__box,.mg-c-input.mg-c-input--label-on-top.mg-c-input--width-2 .mg-c-input__with-character-left{max-width:var(--mg-b-size-48)}.mg-c-input.mg-c-input--label-on-top.mg-c-input--width-4 .mg-c-input__box,.mg-c-input.mg-c-input--label-on-top.mg-c-input--width-4 .mg-c-input__with-character-left{max-width:var(--mg-b-size-72)}.mg-c-input.mg-c-input--label-on-top.mg-c-input--width-16 .mg-c-input__box,.mg-c-input.mg-c-input--label-on-top.mg-c-input--width-16 .mg-c-input__with-character-left{max-width:calc(26*var(--mg-b-size-8))}.mg-c-input.mg-c-input--label-on-top.mg-c-input--width-full .mg-c-input__box{width:100%;max-width:100%}.mg-c-input.mg-c-input--label-on-top .mg-c-input__box{width:auto}.mg-c-input.mg-c-input--width-full:not(.mg-c-input--label-on-top){justify-content:stretch}.mg-c-input.mg-c-input--is-input-group-append ::slotted([slot=append-input]),.mg-c-input.mg-c-input--is-append-input-slot-content ::slotted([slot=append-input]){width:auto}:host(.mg-c-input.mg-c-input--width-full) ::slotted(*:not(mg-input-title)){width:100%;max-width:100%}.mg-c-input__readonly-value{min-height:var(--mg-b-font-size);align-self:flex-start;margin-top:calc((var(--mg-b-size-min-height) - var(--mg-b-font-size)*var(--mg-b-line-height))/2);word-break:break-word}.mg-c-input.mg-c-input--display-character-left mg-character-left{font-size:var(--mg-b-font-size-small);opacity:.6}.mg-c-input.mg-c-input--display-character-left .mg-c-input__input+.mg-c-input__help-text ::slotted(*),.mg-c-input.mg-c-input--display-character-left .mg-c-input__input+.mg-c-input__error ::slotted(*){margin-top:0}.mg-u-visually-hidden{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip:rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;clip-path:inset(50%) !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){*{animation:none !important;transition:none !important}}.mg-c-input__input{align-items:start}.mg-c-input__box{display:block;height:auto;resize:none}.mg-c-input__box.mg-c-input__box--resizable{resize:both}.mg-c-input__box.mg-c-input__box--resizable-horizontal{resize:horizontal}.mg-c-input__box.mg-c-input__box--resizable-vertical{resize:vertical}.mg-c-input__readonly-value{white-space:pre-line}.mg-c-input__with-character-left{flex-grow:1}.mg-c-input__with-character-left mg-character-left{display:block;text-align:end;visibility:hidden}.mg-c-input.mg-u-is-focused .mg-c-input__with-character-left mg-character-left{visibility:visible}@-moz-document url-prefix(){.mg-c-input__box{overflow-x:hidden}}";
12
12
  const MgInputTextareaStyle0 = mgInputTextareaCss;
13
13
 
14
14
  const MgInputTextarea$1 = /*@__PURE__*/ proxyCustomElement(class MgInputTextarea extends HTMLElement {
@@ -23,7 +23,7 @@ const MgInputTextarea$1 = /*@__PURE__*/ proxyCustomElement(class MgInputTextarea
23
23
  ************/
24
24
  // Classes
25
25
  this.classFocus = 'mg-u-is-focused';
26
- this.classHasDisplayCharacterLeft = 'mg-c-input--has-display-character-left';
26
+ this.classDisplayCharacterLeft = 'mg-c-input--display-character-left';
27
27
  // hasDisplayedError (triggered by blur event)
28
28
  this.hasDisplayedError = false;
29
29
  /**
@@ -51,7 +51,7 @@ const MgInputTextarea$1 = /*@__PURE__*/ proxyCustomElement(class MgInputTextarea
51
51
  this.classCollection.delete(this.classFocus);
52
52
  this.classCollection = new Ie(this.classCollection.classes);
53
53
  // Display Error
54
- this.handlerInProgress = Handler.BLUR;
54
+ this.handlerInProgress = 'blur';
55
55
  this.displayError().finally(() => {
56
56
  // reset guard
57
57
  this.handlerInProgress = undefined;
@@ -107,7 +107,7 @@ const MgInputTextarea$1 = /*@__PURE__*/ proxyCustomElement(class MgInputTextarea
107
107
  this.rows = 3;
108
108
  this.tooltip = undefined;
109
109
  this.tooltipPosition = 'input';
110
- this.displayCharacterLeft = true;
110
+ this.characterLeftHide = false;
111
111
  this.helpText = undefined;
112
112
  this.valid = undefined;
113
113
  this.invalid = undefined;
@@ -147,20 +147,20 @@ const MgInputTextarea$1 = /*@__PURE__*/ proxyCustomElement(class MgInputTextarea
147
147
  this.classCollection.delete(`mg-c-input--width-${width}`);
148
148
  });
149
149
  // apply new width
150
- if (newValue)
150
+ if (newValue !== undefined)
151
151
  this.classCollection.add(`mg-c-input--width-${this.mgWidth}`);
152
152
  }
153
153
  validatePattern(newValue) {
154
- if (newValue !== undefined && !(Ze(this.pattern) && Ze(this.patternErrorMessage))) {
155
- throw new Error('<mg-input-textarea> props "pattern" and "patternErrorMessage" must be non-empty string and paired.');
154
+ if (newValue !== undefined && !(Qe(this.pattern) && Qe(this.patternErrorMessage))) {
155
+ throw new Error(`<mg-input-textarea> props "pattern" and "patternErrorMessage" must be non-empty string and paired. Passed value: "pattern='${Ze(this.pattern)}'" and "patternErrorMessage='${Ze(this.patternErrorMessage)}'".`);
156
156
  }
157
157
  }
158
- validateDisplayCharacterLeft(newValue) {
158
+ validatecharacterLeftHide(newValue) {
159
159
  if (newValue) {
160
- this.classCollection.add(this.classHasDisplayCharacterLeft);
160
+ this.classCollection.delete(this.classDisplayCharacterLeft);
161
161
  }
162
162
  else {
163
- this.classCollection.delete(this.classHasDisplayCharacterLeft);
163
+ this.classCollection.add(this.classDisplayCharacterLeft);
164
164
  }
165
165
  }
166
166
  /**
@@ -181,10 +181,10 @@ const MgInputTextarea$1 = /*@__PURE__*/ proxyCustomElement(class MgInputTextarea
181
181
  */
182
182
  async setError(valid, errorMessage) {
183
183
  if (typeof valid !== 'boolean') {
184
- throw new Error('<mg-input-textarea> method "setError()" param "valid" must be a boolean');
184
+ throw new Error('<mg-input-textarea> method "setError()" param "valid" must be a boolean.');
185
185
  }
186
- else if (!Ze(errorMessage)) {
187
- throw new Error('<mg-input-textarea> method "setError()" param "errorMessage" must be a string');
186
+ else if (!Qe(errorMessage)) {
187
+ throw new Error('<mg-input-textarea> method "setError()" param "errorMessage" must be a string.');
188
188
  }
189
189
  else {
190
190
  this.setValidity(valid);
@@ -201,7 +201,7 @@ const MgInputTextarea$1 = /*@__PURE__*/ proxyCustomElement(class MgInputTextarea
201
201
  this.valid = newValue;
202
202
  this.invalid = !this.valid;
203
203
  // We need to send valid event even if it is the same value
204
- if (this.handlerInProgress === undefined || (this.handlerInProgress === Handler.BLUR && this.valid !== oldValidValue))
204
+ if (this.handlerInProgress === undefined || (this.handlerInProgress === 'blur' && this.valid !== oldValidValue))
205
205
  this.inputValid.emit(this.valid);
206
206
  }
207
207
  /*************
@@ -216,7 +216,7 @@ const MgInputTextarea$1 = /*@__PURE__*/ proxyCustomElement(class MgInputTextarea
216
216
  this.messages = initLocales(this.element).messages;
217
217
  this.characterLeftId = `${this.identifier}-character-left`;
218
218
  // Validate
219
- this.validateDisplayCharacterLeft(this.displayCharacterLeft);
219
+ this.validatecharacterLeftHide(this.characterLeftHide);
220
220
  this.validatePattern(this.pattern);
221
221
  this.validatePattern(this.patternErrorMessage);
222
222
  this.watchMgWidth(this.mgWidth);
@@ -234,7 +234,7 @@ const MgInputTextarea$1 = /*@__PURE__*/ proxyCustomElement(class MgInputTextarea
234
234
  * @returns HTML Element
235
235
  */
236
236
  render() {
237
- return (h("mg-input", { key: 'c4386e9b6efe517276d3cd55d213819ff90d7e20', label: this.label, identifier: this.identifier, class: this.classCollection.join(), ariaDescribedbyIDs: [this.characterLeftId], labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, readonlyValue: this.value, tooltip: this.tooltip, tooltipPosition: this.tooltipPosition, helpText: this.helpText, errorMessage: this.errorMessage }, h("div", { key: '2d30db0ea21becffcdce57e46734e76877dc4858', class: "mg-c-input__with-character-left" }, h("textarea", { key: 'bc95d0db89014cafbb4e45893974e1ad09a41bf9', class: {
237
+ return (h("mg-input", { key: '434d00b8d1b5f066b416f777572bfae84797e79d', label: this.label, identifier: this.identifier, class: this.classCollection.join(), ariaDescribedbyIDs: [this.characterLeftId], labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, tooltip: this.tooltip, tooltipPosition: this.readonly && this.value === undefined ? 'label' : this.tooltipPosition, helpText: this.helpText, errorMessage: this.errorMessage }, this.readonly ? (this.value && h("b", { class: "mg-c-input__readonly-value" }, this.value)) : (h("div", { class: "mg-c-input__with-character-left" }, h("textarea", { class: {
238
238
  'mg-c-input__box': true,
239
239
  'mg-c-input__box--width': true,
240
240
  'mg-c-input__box--resizable': this.resizable === 'both',
@@ -243,7 +243,7 @@ const MgInputTextarea$1 = /*@__PURE__*/ proxyCustomElement(class MgInputTextarea
243
243
  }, value: this.value, id: this.identifier, name: this.name, placeholder: this.placeholder, title: this.placeholder, rows: this.rows, maxlength: this.maxlength, disabled: this.disabled, required: this.required, "aria-invalid": (this.invalid === true).toString(), onInput: this.handleInput, onFocus: this.handleFocus, onBlur: this.handleBlur, ref: (el) => {
244
244
  if (el !== null)
245
245
  this.input = el;
246
- } }), this.displayCharacterLeft && this.maxlength > 0 && (h("mg-character-left", { key: '522f8440ff28f9767c7273f56936cc994dfa17da', identifier: this.characterLeftId, characters: this.value, maxlength: this.maxlength })))));
246
+ } }), !this.characterLeftHide && this.maxlength > 0 && (h("mg-character-left", { identifier: this.characterLeftId, characters: this.value, maxlength: this.maxlength }))))));
247
247
  }
248
248
  get element() { return this; }
249
249
  static get watchers() { return {
@@ -254,7 +254,7 @@ const MgInputTextarea$1 = /*@__PURE__*/ proxyCustomElement(class MgInputTextarea
254
254
  "mgWidth": ["watchMgWidth"],
255
255
  "pattern": ["validatePattern"],
256
256
  "patternErrorMessage": ["validatePattern"],
257
- "displayCharacterLeft": ["validateDisplayCharacterLeft"]
257
+ "characterLeftHide": ["validatecharacterLeftHide"]
258
258
  }; }
259
259
  static get style() { return MgInputTextareaStyle0; }
260
260
  }, [1, "mg-input-textarea", {
@@ -275,7 +275,7 @@ const MgInputTextarea$1 = /*@__PURE__*/ proxyCustomElement(class MgInputTextarea
275
275
  "rows": [2],
276
276
  "tooltip": [1],
277
277
  "tooltipPosition": [1, "tooltip-position"],
278
- "displayCharacterLeft": [4, "display-character-left"],
278
+ "characterLeftHide": [4, "character-left-hide"],
279
279
  "helpText": [1, "help-text"],
280
280
  "valid": [1028],
281
281
  "invalid": [1028],
@@ -292,7 +292,7 @@ const MgInputTextarea$1 = /*@__PURE__*/ proxyCustomElement(class MgInputTextarea
292
292
  "mgWidth": ["watchMgWidth"],
293
293
  "pattern": ["validatePattern"],
294
294
  "patternErrorMessage": ["validatePattern"],
295
- "displayCharacterLeft": ["validateDisplayCharacterLeft"]
295
+ "characterLeftHide": ["validatecharacterLeftHide"]
296
296
  }]);
297
297
  function defineCustomElement$1() {
298
298
  if (typeof customElements === "undefined") {