@mgdis/mg-components 6.20.0 → 6.22.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 (205) hide show
  1. package/dist/cjs/{index-TUElr4Wv.js → index-BxB20_Vw.js} +54 -0
  2. package/dist/cjs/{index-Bp6wZzau.js → index-C2viYwrR.js} +1761 -80
  3. package/dist/cjs/loader.cjs.js +2 -2
  4. package/dist/cjs/mg-action-more_37.cjs.entry.js +761 -371
  5. package/dist/cjs/mg-alert.cjs.entry.js +17 -9
  6. package/dist/cjs/mg-breadcrumb.cjs.entry.js +63 -0
  7. package/dist/cjs/mg-components.cjs.js +3 -3
  8. package/dist/cjs/mg-fieldset.cjs.entry.js +24 -7
  9. package/dist/cjs/mg-input-combobox.cjs.entry.js +49 -19
  10. package/dist/cjs/mg-input-file.cjs.entry.js +384 -0
  11. package/dist/cjs/mg-input-rich-text-editor.cjs.entry.js +40096 -15821
  12. package/dist/cjs/{mg-input.conf-D7jmj_lh.js → mg-input.conf-BNpeATnq.js} +7 -0
  13. package/dist/cjs/mg-loader.cjs.entry.js +8 -6
  14. package/dist/cjs/mg-progress.cjs.entry.js +19 -9
  15. package/dist/collection/assets/icons/index.js +1 -1
  16. package/dist/collection/collection-manifest.json +5 -3
  17. package/dist/collection/components/atoms/internals/mg-character-left/mg-character-left.js +1 -1
  18. package/dist/collection/components/atoms/internals/mg-input-title/mg-input-title.js +1 -1
  19. package/dist/collection/components/atoms/mg-card/mg-card.js +1 -1
  20. package/dist/collection/components/atoms/mg-divider/mg-divider.js +1 -1
  21. package/dist/collection/components/atoms/mg-icon/mg-icon.js +2 -2
  22. package/dist/collection/components/atoms/mg-tag/mg-tag.js +1 -1
  23. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.js +1 -1
  24. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +1 -1
  25. package/dist/collection/components/molecules/inputs/mg-input/mg-input.conf.js +6 -0
  26. package/dist/collection/components/molecules/inputs/mg-input/mg-input.js +1 -1
  27. package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js +2 -2
  28. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js +2 -2
  29. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +1 -1
  30. package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js +1 -1
  31. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +1 -1
  32. package/dist/collection/components/molecules/inputs/mg-input-file/mg-input-file.js +877 -0
  33. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +1 -1
  34. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +2 -2
  35. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +1 -1
  36. package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/editor/custom-properties.scss +212 -0
  37. package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/editor/editor.conf.js +1 -0
  38. package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/editor/index.js +300 -94
  39. package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.conf.js +29 -0
  40. package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.js +163 -53
  41. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +1 -1
  42. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +2 -2
  43. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +1 -1
  44. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +1 -1
  45. package/dist/collection/components/molecules/internals/mg-item-more/mg-item-more.js +3 -36
  46. package/dist/collection/components/molecules/menus/mg-menu/mg-menu.conf.js +0 -4
  47. package/dist/collection/components/molecules/menus/mg-menu/mg-menu.js +21 -43
  48. package/dist/collection/components/molecules/menus/mg-menu-item/mg-menu-item.js +65 -38
  49. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +2 -2
  50. package/dist/collection/components/molecules/mg-alert/mg-alert.js +1 -1
  51. package/dist/collection/components/molecules/mg-breadcrumb/mg-breadcrumb.conf.js +1 -0
  52. package/dist/collection/components/molecules/mg-breadcrumb/mg-breadcrumb.js +92 -0
  53. package/dist/collection/components/molecules/mg-details/mg-details.js +1 -1
  54. package/dist/collection/components/molecules/mg-fieldset/mg-fieldset.js +12 -3
  55. package/dist/collection/components/molecules/mg-form/mg-form.js +12 -2
  56. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +1 -1
  57. package/dist/collection/components/molecules/mg-loader/mg-loader.js +1 -1
  58. package/dist/collection/components/molecules/mg-message/mg-message.js +2 -2
  59. package/dist/collection/components/molecules/mg-modal/mg-modal.js +2 -2
  60. package/dist/collection/components/molecules/mg-panel/mg-panel.js +1 -1
  61. package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js +1 -1
  62. package/dist/collection/components/molecules/mg-popover/mg-popover.js +1 -1
  63. package/dist/collection/components/molecules/mg-progress/mg-progress.js +1 -1
  64. package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +1 -1
  65. package/dist/collection/components/molecules/mg-table/mg-table.js +37 -0
  66. package/dist/collection/components/molecules/mg-tabs/mg-tabs.conf.js +0 -4
  67. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +13 -33
  68. package/dist/collection/locales/en/messages.json +14 -0
  69. package/dist/collection/locales/fr/messages.json +14 -0
  70. package/dist/components/events.utils.js +1 -23
  71. package/dist/components/index.d.ts +2 -0
  72. package/dist/components/index.js +1 -1
  73. package/dist/components/index2.js +1 -408
  74. package/dist/components/index3.js +1 -476
  75. package/dist/components/mg-action-more.js +1 -254
  76. package/dist/components/mg-alert.js +1 -224
  77. package/dist/components/mg-badge.js +1 -6
  78. package/dist/components/mg-badge2.js +1 -113
  79. package/dist/components/mg-breadcrumb.d.ts +11 -0
  80. package/dist/components/mg-breadcrumb.js +1 -0
  81. package/dist/components/mg-button.js +1 -6
  82. package/dist/components/mg-button2.js +1 -275
  83. package/dist/components/mg-card.js +1 -6
  84. package/dist/components/mg-card2.js +1 -92
  85. package/dist/components/mg-character-left.js +1 -6
  86. package/dist/components/mg-character-left2.js +1 -75
  87. package/dist/components/mg-details.js +1 -104
  88. package/dist/components/mg-divider.js +1 -6
  89. package/dist/components/mg-divider2.js +1 -49
  90. package/dist/components/mg-fieldset.js +1 -209
  91. package/dist/components/mg-form.js +1 -302
  92. package/dist/components/mg-icon.js +1 -6
  93. package/dist/components/mg-icon2.js +1 -188
  94. package/dist/components/mg-illustrated-message.js +1 -129
  95. package/dist/components/mg-input-checkbox-paginated.js +1 -6
  96. package/dist/components/mg-input-checkbox-paginated2.js +1 -135
  97. package/dist/components/mg-input-checkbox.js +1 -762
  98. package/dist/components/mg-input-combobox.js +1 -940
  99. package/dist/components/mg-input-date.js +1 -463
  100. package/dist/components/mg-input-file.d.ts +11 -0
  101. package/dist/components/mg-input-file.js +1 -0
  102. package/dist/components/mg-input-numeric.js +1 -592
  103. package/dist/components/mg-input-password.js +1 -360
  104. package/dist/components/mg-input-radio.js +1 -392
  105. package/dist/components/mg-input-rich-text-editor.js +1663 -16797
  106. package/dist/components/mg-input-select.js +1 -6
  107. package/dist/components/mg-input-select2.js +1 -481
  108. package/dist/components/mg-input-text.js +1 -6
  109. package/dist/components/mg-input-text2.js +1 -514
  110. package/dist/components/mg-input-textarea.js +1 -412
  111. package/dist/components/mg-input-title.js +1 -6
  112. package/dist/components/mg-input-title2.js +1 -81
  113. package/dist/components/mg-input-toggle.js +1 -371
  114. package/dist/components/mg-input.conf.js +1 -0
  115. package/dist/components/mg-input.js +1 -6
  116. package/dist/components/mg-input2.js +1 -459
  117. package/dist/components/mg-item-more.js +1 -6
  118. package/dist/components/mg-item-more2.js +1 -505
  119. package/dist/components/mg-loader.js +1 -6
  120. package/dist/components/mg-loader2.js +1 -74
  121. package/dist/components/mg-menu-item.js +1 -6
  122. package/dist/components/mg-menu-item2.js +1 -485
  123. package/dist/components/mg-menu.js +1 -6
  124. package/dist/components/mg-message.js +1 -6
  125. package/dist/components/mg-message2.js +1 -146
  126. package/dist/components/mg-modal.js +1 -184
  127. package/dist/components/mg-pagination.js +1 -234
  128. package/dist/components/mg-panel.js +1 -350
  129. package/dist/components/mg-popover-content.js +1 -6
  130. package/dist/components/mg-popover-content2.js +1 -96
  131. package/dist/components/mg-popover.js +1 -6
  132. package/dist/components/mg-popover2.js +1 -312
  133. package/dist/components/mg-progress.js +1 -123
  134. package/dist/components/mg-skip-links.js +1 -78
  135. package/dist/components/mg-table.js +1 -319
  136. package/dist/components/mg-tabs.js +1 -6
  137. package/dist/components/mg-tabs2.js +1 -315
  138. package/dist/components/mg-tag.js +1 -133
  139. package/dist/components/mg-tooltip-content.js +1 -6
  140. package/dist/components/mg-tooltip-content2.js +1 -42
  141. package/dist/components/mg-tooltip.js +1 -6
  142. package/dist/components/mg-tooltip2.js +1 -421
  143. package/dist/components/popper.js +1 -1790
  144. package/dist/esm/{index-BluNKQ3L.js → index-DFwaH2hS.js} +1761 -80
  145. package/dist/esm/{index-CNX6lq0x.js → index-DSEloqPn.js} +54 -1
  146. package/dist/esm/loader.js +3 -3
  147. package/dist/esm/mg-action-more_37.entry.js +761 -371
  148. package/dist/esm/mg-alert.entry.js +17 -9
  149. package/dist/esm/mg-breadcrumb.entry.js +61 -0
  150. package/dist/esm/mg-components.js +4 -4
  151. package/dist/esm/mg-fieldset.entry.js +24 -7
  152. package/dist/esm/mg-input-combobox.entry.js +49 -19
  153. package/dist/esm/mg-input-file.entry.js +382 -0
  154. package/dist/esm/mg-input-rich-text-editor.entry.js +40083 -15808
  155. package/dist/esm/{mg-input.conf-DDnrE1hD.js → mg-input.conf-C9rmNQIL.js} +7 -1
  156. package/dist/esm/mg-loader.entry.js +8 -6
  157. package/dist/esm/mg-progress.entry.js +19 -9
  158. package/dist/mg-components/locales/en/messages.json +14 -0
  159. package/dist/mg-components/locales/fr/messages.json +14 -0
  160. package/dist/mg-components/mg-components.esm.js +1 -1
  161. package/dist/mg-components/p-0482eb9f.entry.js +1 -0
  162. package/dist/mg-components/{p-7132bca1.entry.js → p-2ee92f38.entry.js} +1 -1
  163. package/dist/mg-components/{p-916dfb6d.entry.js → p-3b653226.entry.js} +1 -1
  164. package/dist/mg-components/p-5745fbea.entry.js +1 -0
  165. package/dist/mg-components/p-C9rmNQIL.js +1 -0
  166. package/dist/mg-components/p-DFwaH2hS.js +2 -0
  167. package/dist/mg-components/p-DSEloqPn.js +1 -0
  168. package/dist/mg-components/p-adec7fcc.entry.js +1 -0
  169. package/dist/mg-components/p-c63f97f0.entry.js +1658 -0
  170. package/dist/mg-components/p-c8c8cfc1.entry.js +1 -0
  171. package/dist/mg-components/p-cc793586.entry.js +1 -0
  172. package/dist/mg-components/p-d5e69c95.entry.js +1 -0
  173. package/dist/types/assets/icons/index.d.ts +2 -0
  174. package/dist/types/components/molecules/inputs/mg-input/mg-input.conf.d.ts +7 -1
  175. package/dist/types/components/molecules/inputs/mg-input-file/mg-input-file.d.ts +210 -0
  176. package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/editor/editor.conf.d.ts +17 -0
  177. package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/editor/index.d.ts +27 -19
  178. package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.conf.d.ts +3 -0
  179. package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.d.ts +50 -16
  180. package/dist/types/components/molecules/internals/mg-item-more/mg-item-more.conf.d.ts +0 -5
  181. package/dist/types/components/molecules/internals/mg-item-more/mg-item-more.d.ts +1 -6
  182. package/dist/types/components/molecules/menus/mg-menu/mg-menu.conf.d.ts +2 -10
  183. package/dist/types/components/molecules/menus/mg-menu/mg-menu.d.ts +7 -7
  184. package/dist/types/components/molecules/menus/mg-menu-item/mg-menu-item.d.ts +12 -8
  185. package/dist/types/components/molecules/mg-breadcrumb/mg-breadcrumb.conf.d.ts +18 -0
  186. package/dist/types/components/molecules/mg-breadcrumb/mg-breadcrumb.d.ts +34 -0
  187. package/dist/types/components/molecules/mg-table/mg-table.d.ts +6 -0
  188. package/dist/types/components/molecules/mg-tabs/mg-tabs.conf.d.ts +1 -9
  189. package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +4 -4
  190. package/dist/types/components.d.ts +302 -46
  191. package/dist/types/stencil-public-runtime.d.ts +76 -12
  192. package/ide/intellij/web-types.json +483 -51
  193. package/ide/vscode/css-custom-data.json +10 -2
  194. package/ide/vscode/html-custom-data.json +445 -104
  195. package/package.json +24 -23
  196. package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/editor/editor.scss +0 -1
  197. package/dist/mg-components/p-016bd291.entry.js +0 -1
  198. package/dist/mg-components/p-186a6139.entry.js +0 -1
  199. package/dist/mg-components/p-BluNKQ3L.js +0 -2
  200. package/dist/mg-components/p-CNX6lq0x.js +0 -1
  201. package/dist/mg-components/p-DDnrE1hD.js +0 -1
  202. package/dist/mg-components/p-cd061b38.entry.js +0 -1
  203. package/dist/mg-components/p-d2c72f09.entry.js +0 -1
  204. package/dist/mg-components/p-d5a276eb.entry.js +0 -1
  205. package/ide/vscode/custom.css-data.json +0 -425
@@ -1,412 +1 @@
1
- import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
- import { C as ClassList, i as isValidString, t as toString } from './index2.js';
3
- import { d as defineCustomElement$5, c as classReadonly, a as classDisabled, w as widths, e as classDisplayCharacterLeft } from './mg-input2.js';
4
- import { i as initLocales } from './index3.js';
5
- import { d as defineCustomElement$7 } from './mg-character-left2.js';
6
- import { d as defineCustomElement$6 } from './mg-icon2.js';
7
- import { d as defineCustomElement$4 } from './mg-input-title2.js';
8
- import { d as defineCustomElement$3 } from './mg-tooltip2.js';
9
- import { d as defineCustomElement$2 } from './mg-tooltip-content2.js';
10
-
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.mg-c-input--has-icon .mg-c-input__input-group-container{position:relative}.mg-c-input.mg-c-input--has-icon .mg-c-input__input-group-container>mg-icon:first-of-type{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__input-group-container .mg-c-input__box{padding-left:calc(var(--mg-b-size-16) + var(--mg-b-size-8)*2)}.mg-c-input__input-container{width:100%;flex:1 auto}.mg-c-input.mg-c-input--width-full .mg-c-input__box{width:100%}.mg-c-input.mg-c-input--width-full .mg-c-input__input-group-container{width:100%;flex-grow:1}.mg-c-input.mg-c-input--width-2.mg-c-input--display-character-left .mg-c-input__input-group-container,.mg-c-input.mg-c-input--width-4.mg-c-input--display-character-left .mg-c-input__input-group-container,.mg-c-input.mg-c-input--width-16.mg-c-input--display-character-left .mg-c-input__input-group-container{width:max-content}.mg-c-input.mg-c-input--width-2 .mg-c-input__box{width:var(--mg-b-size-48)}.mg-c-input.mg-c-input--width-2.mg-c-input--text.mg-c-input--display-character-left .mg-c-input__box{width:calc(var(--mg-b-size-48) + var(--mg-c-character-left-message-length)*(.35ch + .3rem))}.mg-c-input.mg-c-input--width-4 .mg-c-input__box{width:var(--mg-b-size-72)}.mg-c-input.mg-c-input--width-4.mg-c-input--text.mg-c-input--display-character-left .mg-c-input__box{width:calc(var(--mg-b-size-72) + var(--mg-c-character-left-message-length)*(.35ch + .3rem))}.mg-c-input.mg-c-input--width-16 .mg-c-input__box{width:calc(26*var(--mg-b-size-8))}.mg-c-input.mg-c-input--width-16.mg-c-input--text.mg-c-input--display-character-left .mg-c-input__box{width:calc(calc(26 * var(--mg-b-size-8)) + var(--mg-c-character-left-message-length)*(.35ch + .3rem))}.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);overflow-wrap:anywhere}.mg-c-input.mg-c-input--display-character-left mg-character-left{position:absolute;display:none}.mg-c-input.mg-c-input--display-character-left mg-character-left>span{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-c-input.mg-c-input--display-character-left .mg-c-input__input-group-container{position:relative}.mg-c-input.mg-c-input--display-character-left input:focus~mg-character-left,.mg-c-input.mg-c-input--display-character-left textarea:focus~mg-character-left{display:block}.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}}a{color:inherit;text-decoration:underline}a:hover,a:focus,a:active{text-decoration:none}.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.mg-c-input--readonly .mg-c-input__readonly-value{white-space:pre-line}.mg-c-input.mg-c-input--display-character-left .mg-c-input__box{padding-bottom:var(--mg-b-size-24)}.mg-c-input.mg-c-input--display-character-left mg-character-left{bottom:calc(var(--mg-c-input-border-width) + .1rem);left:calc(var(--mg-c-input-border-width) + .1rem);padding:calc(var(--mg-b-size-4)/2 - var(--mg-c-input-border-width)) calc(var(--mg-b-size-4) - var(--mg-c-input-border-width));border:var(--mg-c-input-border-width) solid var(--mg-c-input-color-border);border-bottom-width:0;border-left-width:0;background:var(--mg-b-color-neutral-0);border-bottom-left-radius:var(--mg-c-input-border-radius);border-top-right-radius:var(--mg-c-input-border-radius)}@-moz-document url-prefix(){.mg-c-input__box{overflow-x:hidden}}";
12
-
13
- const MgInputTextarea$1 = /*@__PURE__*/ proxyCustomElement(class MgInputTextarea extends HTMLElement {
14
- constructor(registerHost) {
15
- super();
16
- if (registerHost !== false) {
17
- this.__registerHost();
18
- }
19
- this.__attachShadow();
20
- this.valueChange = createEvent(this, "value-change", 7);
21
- this.inputValid = createEvent(this, "input-valid", 7);
22
- // hasDisplayedError (triggered by blur event)
23
- this.hasDisplayedError = false;
24
- this.customErrorMessage = { lock: false };
25
- /**
26
- * Input name
27
- * If not set the value equals the identifier
28
- */
29
- this.name = this.identifier;
30
- /**
31
- * Define if label is displayed on top
32
- */
33
- this.labelOnTop = false;
34
- /**
35
- * Define if label is visible
36
- */
37
- this.labelHide = false;
38
- /**
39
- * Input max length
40
- */
41
- this.maxlength = 4000;
42
- /**
43
- * Define if input is required
44
- */
45
- this.required = false;
46
- /**
47
- * Define if input is readonly
48
- */
49
- this.readonly = false;
50
- /**
51
- * Define if input is disabled
52
- */
53
- this.disabled = false;
54
- /**
55
- * Define input width
56
- */
57
- this.mgWidth = 'full';
58
- /**
59
- * Define the number of visible text lines for the control
60
- */
61
- this.rows = 3;
62
- /**
63
- * Define tooltip position
64
- */
65
- this.tooltipPosition = 'input';
66
- /**
67
- * Define if component should display character left
68
- */
69
- this.characterLeftHide = false;
70
- /**
71
- * Define if input is resizable
72
- */
73
- this.resizable = 'none';
74
- /**
75
- * Component classes
76
- */
77
- this.classCollection = new ClassList(['mg-c-input--textarea']);
78
- /**
79
- * Handle input event
80
- */
81
- this.handleInput = () => {
82
- if (this.hasDisplayedError) {
83
- this.checkValidity();
84
- this.setErrorMessage();
85
- }
86
- this.value = this.input.value;
87
- };
88
- /**
89
- * Handle blur event
90
- */
91
- this.handleBlur = () => {
92
- // Display Error
93
- this.handlerInProgress = 'blur';
94
- this.displayError().finally(() => {
95
- // reset guard
96
- this.handlerInProgress = undefined;
97
- });
98
- };
99
- /**
100
- * Get pattern validity
101
- * Pattern is not defined on textarea field: https://developer.mozilla.org/fr/docs/Web/HTML/Element/Textarea
102
- * @returns is pattern valid
103
- */
104
- this.getPatternValidity = () => this.pattern === undefined || new RegExp(`^${this.pattern}$`, 'u').test(this.value);
105
- /**
106
- * Check if input is valid
107
- */
108
- this.checkValidity = () => {
109
- this.setValidity(this.readonly || this.disabled || (this.input.checkValidity() && this.getPatternValidity()));
110
- };
111
- /**
112
- * Set input error message
113
- * @param fromSetErrorContext - context come from `setError` method
114
- */
115
- this.setErrorMessage = (fromSetErrorContext = false) => {
116
- // Set error message
117
- this.errorMessage = undefined;
118
- // Does have a new custom error message
119
- if (!this.valid) {
120
- // Does have a new custom error message OR does have a custom error message locked
121
- if (fromSetErrorContext || (this.customErrorMessage.lock && this.customErrorMessage.message !== undefined)) {
122
- this.errorMessage = this.customErrorMessage.message;
123
- }
124
- else if (!this.getPatternValidity()) {
125
- this.errorMessage = this.patternErrorMessage;
126
- }
127
- // required
128
- else if (this.input.validity.valueMissing) {
129
- this.errorMessage = this.messages.errors.required;
130
- }
131
- }
132
- };
133
- }
134
- handleValue(newValue) {
135
- this.checkValidity();
136
- this.valueChange.emit(newValue);
137
- }
138
- watchReadonly(newValue) {
139
- if (newValue)
140
- this.classCollection.add(classReadonly);
141
- else
142
- this.classCollection.delete(classReadonly);
143
- }
144
- handleValidityChange(newValue, _oldValue, prop) {
145
- if (this.input !== undefined) {
146
- this.input[prop] = newValue;
147
- this.checkValidity();
148
- if (this.hasDisplayedError) {
149
- this.setErrorMessage();
150
- this.hasDisplayedError = false;
151
- }
152
- }
153
- }
154
- validateDisabled(newValue) {
155
- if (newValue)
156
- this.classCollection.add(classDisabled);
157
- else
158
- this.classCollection.delete(classDisabled);
159
- }
160
- watchMgWidth(newValue) {
161
- // reset width class
162
- widths.forEach(width => {
163
- this.classCollection.delete(`mg-c-input--width-${width}`);
164
- });
165
- // apply new width
166
- if (newValue !== undefined)
167
- this.classCollection.add(`mg-c-input--width-${this.mgWidth}`);
168
- }
169
- validatePattern(newValue) {
170
- if (newValue !== undefined && !(isValidString(this.pattern) && isValidString(this.patternErrorMessage))) {
171
- throw new Error(`<mg-input-textarea> props "pattern" and "patternErrorMessage" must be non-empty string and paired. Passed value: "pattern='${toString(this.pattern)}'" and "patternErrorMessage='${toString(this.patternErrorMessage)}'".`);
172
- }
173
- }
174
- validatecharacterLeftHide(newValue) {
175
- if (newValue) {
176
- this.classCollection.delete(classDisplayCharacterLeft);
177
- }
178
- else {
179
- this.classCollection.add(classDisplayCharacterLeft);
180
- }
181
- }
182
- /**
183
- * Set focus on input.
184
- */
185
- async setFocus() {
186
- var _a;
187
- (_a = this.input) === null || _a === void 0 ? void 0 : _a.focus();
188
- }
189
- /**
190
- * Display input error if it exists.
191
- */
192
- displayError() {
193
- // Use `Promise` as requested for stencil method
194
- // Use `requestAnimationFrame` to ensure:
195
- // - DOM is fully updated before validation
196
- // - Async operations are completed
197
- // - No timing issues with Stencil's render cycle
198
- // - Keep everything in sync both inside and outside the component
199
- return new Promise(resolve => {
200
- requestAnimationFrame(() => {
201
- this.checkValidity();
202
- this.setErrorMessage();
203
- this.hasDisplayedError = this.invalid;
204
- resolve();
205
- });
206
- });
207
- }
208
- /**
209
- * Set an error and display a custom error message.
210
- * This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.
211
- * It must be paired with an error message to display for the given context.
212
- * When used to set validity to `false`, you should use this method again to reset the validity to `true`.
213
- * @param valid - value indicating the validity
214
- * @param errorMessage - the error message to display
215
- * @param errorMessageLock - lock the error message and validity state
216
- */
217
- async setError(valid, errorMessage, errorMessageLock = false) {
218
- if (typeof valid !== 'boolean') {
219
- throw new Error('<mg-input-textarea> method "setError()" param "valid" must be a boolean.');
220
- }
221
- else if (errorMessage !== undefined && !isValidString(errorMessage)) {
222
- throw new Error('<mg-input-textarea> method "setError()" param "errorMessage" must be a string.');
223
- }
224
- else {
225
- this.customErrorMessage = {
226
- lock: valid ? false : errorMessageLock,
227
- message: valid ? undefined : errorMessage,
228
- };
229
- this.setValidity(valid);
230
- this.setErrorMessage(true);
231
- this.hasDisplayedError = this.invalid;
232
- }
233
- }
234
- /**
235
- * Reset value, validity and error state
236
- */
237
- async reset() {
238
- if (!this.readonly) {
239
- this.value = '';
240
- // Use `Promise` as requested for stencil method
241
- // Use `requestAnimationFrame` to ensure:
242
- // - DOM is fully updated before validation
243
- // - Async operations are completed
244
- // - No timing issues with Stencil's render cycle
245
- // - Keep everything in sync both inside and outside the component
246
- return new Promise(resolve => {
247
- requestAnimationFrame(() => {
248
- // unlock validity check by reseting customErrorMessage
249
- this.customErrorMessage = { lock: false };
250
- this.checkValidity();
251
- this.errorMessage = undefined;
252
- this.hasDisplayedError = false;
253
- resolve();
254
- });
255
- });
256
- }
257
- }
258
- /**
259
- * Method to set validity values
260
- * @param newValue - valid new value
261
- */
262
- setValidity(newValue) {
263
- const oldValue = this.valid;
264
- if (!this.customErrorMessage.lock || (this.customErrorMessage.message !== undefined && !newValue)) {
265
- this.valid = newValue;
266
- }
267
- this.invalid = !this.valid;
268
- // We need to send valid event even if it is the same value
269
- if (this.handlerInProgress === undefined || (this.handlerInProgress === 'blur' && this.valid !== oldValue))
270
- this.inputValid.emit(this.valid);
271
- }
272
- /*************
273
- * Lifecycle *
274
- *************/
275
- /**
276
- * Check if component props are well configured on init
277
- * @returns timeout
278
- */
279
- componentWillLoad() {
280
- // Get locales
281
- this.messages = initLocales(this.element).messages;
282
- this.characterLeftId = `${this.identifier}-character-left`;
283
- // Validate
284
- this.validatecharacterLeftHide(this.characterLeftHide);
285
- this.validatePattern(this.pattern);
286
- this.validatePattern(this.patternErrorMessage);
287
- this.watchMgWidth(this.mgWidth);
288
- this.watchReadonly(this.readonly);
289
- this.validateDisabled(this.disabled);
290
- // Check validity when component is ready
291
- // return a promise to process action only in the FIRST render().
292
- // https://stenciljs.com/docs/component-lifecycle#componentwillload
293
- return setTimeout(() => {
294
- this.checkValidity();
295
- }, 0);
296
- }
297
- /**
298
- * Render
299
- * @returns HTML Element
300
- */
301
- render() {
302
- return (h("mg-input", { key: 'a43b8b1572249e31fb6ea5bd9244639698629218', 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__input-group-container" }, h("textarea", { class: {
303
- 'mg-c-input__box': true,
304
- 'mg-c-input__box--width': true,
305
- 'mg-c-input__box--resizable': this.resizable === 'both',
306
- 'mg-c-input__box--resizable-horizontal': this.resizable === 'horizontal',
307
- 'mg-c-input__box--resizable-vertical': this.resizable === 'vertical',
308
- }, 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, onBlur: this.handleBlur, ref: (el) => {
309
- if (el !== null)
310
- this.input = el;
311
- } }), !this.characterLeftHide && this.maxlength > 0 && (h("mg-character-left", { identifier: this.characterLeftId, characters: this.value, maxlength: this.maxlength }))))));
312
- }
313
- get element() { return this; }
314
- static get watchers() { return {
315
- "value": ["handleValue"],
316
- "readonly": ["watchReadonly", "handleValidityChange"],
317
- "required": ["handleValidityChange"],
318
- "disabled": ["handleValidityChange", "validateDisabled"],
319
- "mgWidth": ["watchMgWidth"],
320
- "pattern": ["validatePattern"],
321
- "patternErrorMessage": ["validatePattern"],
322
- "characterLeftHide": ["validatecharacterLeftHide"]
323
- }; }
324
- static get style() { return mgInputTextareaCss; }
325
- }, [257, "mg-input-textarea", {
326
- "value": [1537],
327
- "identifier": [1],
328
- "name": [1],
329
- "label": [1],
330
- "labelOnTop": [4, "label-on-top"],
331
- "labelHide": [4, "label-hide"],
332
- "placeholder": [1],
333
- "maxlength": [2],
334
- "required": [4],
335
- "readonly": [4],
336
- "disabled": [4],
337
- "mgWidth": [8, "mg-width"],
338
- "pattern": [1],
339
- "patternErrorMessage": [1, "pattern-error-message"],
340
- "rows": [2],
341
- "tooltip": [1],
342
- "tooltipPosition": [1, "tooltip-position"],
343
- "characterLeftHide": [4, "character-left-hide"],
344
- "helpText": [1, "help-text"],
345
- "resizable": [1],
346
- "valid": [1028],
347
- "invalid": [1028],
348
- "classCollection": [32],
349
- "errorMessage": [32],
350
- "setFocus": [64],
351
- "displayError": [64],
352
- "setError": [64],
353
- "reset": [64]
354
- }, undefined, {
355
- "value": ["handleValue"],
356
- "readonly": ["watchReadonly", "handleValidityChange"],
357
- "required": ["handleValidityChange"],
358
- "disabled": ["handleValidityChange", "validateDisabled"],
359
- "mgWidth": ["watchMgWidth"],
360
- "pattern": ["validatePattern"],
361
- "patternErrorMessage": ["validatePattern"],
362
- "characterLeftHide": ["validatecharacterLeftHide"]
363
- }]);
364
- function defineCustomElement$1() {
365
- if (typeof customElements === "undefined") {
366
- return;
367
- }
368
- const components = ["mg-input-textarea", "mg-character-left", "mg-icon", "mg-input", "mg-input-title", "mg-tooltip", "mg-tooltip-content"];
369
- components.forEach(tagName => { switch (tagName) {
370
- case "mg-input-textarea":
371
- if (!customElements.get(tagName)) {
372
- customElements.define(tagName, MgInputTextarea$1);
373
- }
374
- break;
375
- case "mg-character-left":
376
- if (!customElements.get(tagName)) {
377
- defineCustomElement$7();
378
- }
379
- break;
380
- case "mg-icon":
381
- if (!customElements.get(tagName)) {
382
- defineCustomElement$6();
383
- }
384
- break;
385
- case "mg-input":
386
- if (!customElements.get(tagName)) {
387
- defineCustomElement$5();
388
- }
389
- break;
390
- case "mg-input-title":
391
- if (!customElements.get(tagName)) {
392
- defineCustomElement$4();
393
- }
394
- break;
395
- case "mg-tooltip":
396
- if (!customElements.get(tagName)) {
397
- defineCustomElement$3();
398
- }
399
- break;
400
- case "mg-tooltip-content":
401
- if (!customElements.get(tagName)) {
402
- defineCustomElement$2();
403
- }
404
- break;
405
- } });
406
- }
407
- defineCustomElement$1();
408
-
409
- const MgInputTextarea = MgInputTextarea$1;
410
- const defineCustomElement = defineCustomElement$1;
411
-
412
- export { MgInputTextarea, defineCustomElement };
1
+ import{transformTag as t,proxyCustomElement as i,HTMLElement as e,createEvent as r,h as a}from"@stencil/core/internal/client";import{C as n,i as s,t as o}from"./index2.js";import{c,b as p,w as m,e as h}from"./mg-input.conf.js";import{i as l}from"./index3.js";import{d as g}from"./mg-character-left2.js";import{d as u}from"./mg-icon2.js";import{d}from"./mg-input2.js";import{d as b}from"./mg-input-title2.js";import{d as f}from"./mg-tooltip2.js";import{d as v}from"./mg-tooltip-content2.js";const _=i(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.valueChange=r(this,"value-change",7),this.inputValid=r(this,"input-valid",7),this.hasDisplayedError=!1,this.customErrorMessage={lock:!1},this.name=this.identifier,this.labelOnTop=!1,this.labelHide=!1,this.maxlength=4e3,this.required=!1,this.readonly=!1,this.disabled=!1,this.mgWidth="full",this.rows=3,this.tooltipPosition="input",this.characterLeftHide=!1,this.resizable="none",this.classCollection=new n(["mg-c-input--textarea"]),this.handleInput=()=>{this.hasDisplayedError&&(this.checkValidity(),this.setErrorMessage()),this.value=this.input.value},this.handleBlur=()=>{this.handlerInProgress="blur",this.displayError().finally((()=>{this.handlerInProgress=void 0}))},this.getPatternValidity=()=>void 0===this.pattern||RegExp(`^${this.pattern}$`,"u").test(this.value),this.checkValidity=()=>{this.setValidity(this.readonly||this.disabled||this.input.checkValidity()&&this.getPatternValidity())},this.setErrorMessage=(t=!1)=>{this.errorMessage=void 0,this.valid||(t||this.customErrorMessage.lock&&void 0!==this.customErrorMessage.message?this.errorMessage=this.customErrorMessage.message:this.getPatternValidity()?this.input.validity.valueMissing&&(this.errorMessage=this.messages.errors.required):this.errorMessage=this.patternErrorMessage)}}handleValue(t){this.checkValidity(),this.valueChange.emit(t)}watchReadonly(t){t?this.classCollection.add(c):this.classCollection.delete(c)}handleValidityChange(t,i,e){void 0!==this.input&&(this.input[e]=t,this.checkValidity(),this.hasDisplayedError&&(this.setErrorMessage(),this.hasDisplayedError=!1))}validateDisabled(t){t?this.classCollection.add(p):this.classCollection.delete(p)}watchMgWidth(t){m.forEach((t=>{this.classCollection.delete("mg-c-input--width-"+t)})),void 0!==t&&this.classCollection.add("mg-c-input--width-"+this.mgWidth)}validatePattern(t){if(!(void 0===t||s(this.pattern)&&s(this.patternErrorMessage)))throw Error(`<mg-input-textarea> props "pattern" and "patternErrorMessage" must be non-empty string and paired. Passed value: "pattern='${o(this.pattern)}'" and "patternErrorMessage='${o(this.patternErrorMessage)}'".`)}validatecharacterLeftHide(t){t?this.classCollection.delete(h):this.classCollection.add(h)}async setFocus(){var t;null===(t=this.input)||void 0===t||t.focus()}displayError(){return new Promise((t=>{requestAnimationFrame((()=>{this.checkValidity(),this.setErrorMessage(),this.hasDisplayedError=this.invalid,t()}))}))}async setError(t,i,e=!1){if("boolean"!=typeof t)throw Error('<mg-input-textarea> method "setError()" param "valid" must be a boolean.');if(void 0!==i&&!s(i))throw Error('<mg-input-textarea> method "setError()" param "errorMessage" must be a string.');this.customErrorMessage={lock:!t&&e,message:t?void 0:i},this.setValidity(t),this.setErrorMessage(!0),this.hasDisplayedError=this.invalid}async reset(){if(!this.readonly)return this.value="",new Promise((t=>{requestAnimationFrame((()=>{this.customErrorMessage={lock:!1},this.checkValidity(),this.errorMessage=void 0,this.hasDisplayedError=!1,t()}))}))}setValidity(t){const i=this.valid;this.customErrorMessage.lock&&(void 0===this.customErrorMessage.message||t)||(this.valid=t),this.invalid=!this.valid,(void 0===this.handlerInProgress||"blur"===this.handlerInProgress&&this.valid!==i)&&this.inputValid.emit(this.valid)}componentWillLoad(){return this.messages=l(this.element).messages,this.characterLeftId=this.identifier+"-character-left",this.validatecharacterLeftHide(this.characterLeftHide),this.validatePattern(this.pattern),this.validatePattern(this.patternErrorMessage),this.watchMgWidth(this.mgWidth),this.watchReadonly(this.readonly),this.validateDisabled(this.disabled),setTimeout((()=>{this.checkValidity()}),0)}render(){return a("mg-input",{key:"68f259138df7207d7ba16a8f36f3b45e8fb143d0",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&&void 0===this.value?"label":this.tooltipPosition,helpText:this.helpText,errorMessage:this.errorMessage},this.readonly?this.value&&a("b",{class:"mg-c-input__readonly-value"},this.value):a("div",{class:"mg-c-input__input-group-container"},a("textarea",{class:{"mg-c-input__box":!0,"mg-c-input__box--width":!0,"mg-c-input__box--resizable":"both"===this.resizable,"mg-c-input__box--resizable-horizontal":"horizontal"===this.resizable,"mg-c-input__box--resizable-vertical":"vertical"===this.resizable},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":""+(!0===this.invalid),onInput:this.handleInput,onBlur:this.handleBlur,ref:t=>{null!==t&&(this.input=t)}}),!this.characterLeftHide&&this.maxlength>0&&a("mg-character-left",{identifier:this.characterLeftId,characters:this.value,maxlength:this.maxlength})))}get element(){return this}static get watchers(){return{value:[{handleValue:0}],readonly:[{watchReadonly:0},{handleValidityChange:0}],required:[{handleValidityChange:0}],disabled:[{handleValidityChange:0},{validateDisabled:0}],mgWidth:[{watchMgWidth:0}],pattern:[{validatePattern:0}],patternErrorMessage:[{validatePattern:0}],characterLeftHide:[{validatecharacterLeftHide:0}]}}static get style(){return".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.mg-c-input--has-icon .mg-c-input__input-group-container{position:relative}.mg-c-input.mg-c-input--has-icon .mg-c-input__input-group-container>mg-icon:first-of-type{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__input-group-container .mg-c-input__box{padding-left:calc(var(--mg-b-size-16) + var(--mg-b-size-8)*2)}.mg-c-input__input-container{width:100%;flex:1 auto}.mg-c-input.mg-c-input--width-full .mg-c-input__box{width:100%}.mg-c-input.mg-c-input--width-full .mg-c-input__input-group-container{width:100%;flex-grow:1}.mg-c-input.mg-c-input--width-2.mg-c-input--display-character-left .mg-c-input__input-group-container,.mg-c-input.mg-c-input--width-4.mg-c-input--display-character-left .mg-c-input__input-group-container,.mg-c-input.mg-c-input--width-16.mg-c-input--display-character-left .mg-c-input__input-group-container{width:max-content}.mg-c-input.mg-c-input--width-2 .mg-c-input__box{width:var(--mg-b-size-48)}.mg-c-input.mg-c-input--width-2.mg-c-input--text.mg-c-input--display-character-left .mg-c-input__box{width:calc(var(--mg-b-size-48) + var(--mg-c-character-left-message-length)*(.35ch + .3rem))}.mg-c-input.mg-c-input--width-4 .mg-c-input__box{width:var(--mg-b-size-72)}.mg-c-input.mg-c-input--width-4.mg-c-input--text.mg-c-input--display-character-left .mg-c-input__box{width:calc(var(--mg-b-size-72) + var(--mg-c-character-left-message-length)*(.35ch + .3rem))}.mg-c-input.mg-c-input--width-16 .mg-c-input__box{width:calc(26*var(--mg-b-size-8))}.mg-c-input.mg-c-input--width-16.mg-c-input--text.mg-c-input--display-character-left .mg-c-input__box{width:calc(calc(26 * var(--mg-b-size-8)) + var(--mg-c-character-left-message-length)*(.35ch + .3rem))}.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);overflow-wrap:anywhere}.mg-c-input.mg-c-input--display-character-left mg-character-left{position:absolute;display:none}.mg-c-input.mg-c-input--display-character-left mg-character-left>span{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-c-input.mg-c-input--display-character-left .mg-c-input__input-group-container{position:relative}.mg-c-input.mg-c-input--display-character-left input:focus~mg-character-left,.mg-c-input.mg-c-input--display-character-left textarea:focus~mg-character-left{display:block}.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}}a{color:inherit;text-decoration:underline}a:hover,a:focus,a:active{text-decoration:none}.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.mg-c-input--readonly .mg-c-input__readonly-value{white-space:pre-line}.mg-c-input.mg-c-input--display-character-left .mg-c-input__box{padding-bottom:var(--mg-b-size-24)}.mg-c-input.mg-c-input--display-character-left mg-character-left{bottom:calc(var(--mg-c-input-border-width) + .1rem);left:calc(var(--mg-c-input-border-width) + .1rem);padding:calc(var(--mg-b-size-4)/2 - var(--mg-c-input-border-width)) calc(var(--mg-b-size-4) - var(--mg-c-input-border-width));border:var(--mg-c-input-border-width) solid var(--mg-c-input-color-border);border-bottom-width:0;border-left-width:0;background:var(--mg-b-color-neutral-0);border-bottom-left-radius:var(--mg-c-input-border-radius);border-top-right-radius:var(--mg-c-input-border-radius)}@-moz-document url-prefix(){.mg-c-input__box{overflow-x:hidden}}"}},[1,"mg-input-textarea",{value:[1537],identifier:[1],name:[1],label:[1],labelOnTop:[4,"label-on-top"],labelHide:[4,"label-hide"],placeholder:[1],maxlength:[2],required:[4],readonly:[4],disabled:[4],mgWidth:[8,"mg-width"],pattern:[1],patternErrorMessage:[1,"pattern-error-message"],rows:[2],tooltip:[1],tooltipPosition:[1,"tooltip-position"],characterLeftHide:[4,"character-left-hide"],helpText:[1,"help-text"],resizable:[1],valid:[1028],invalid:[1028],classCollection:[32],errorMessage:[32],setFocus:[64],displayError:[64],setError:[64],reset:[64]},void 0,{value:[{handleValue:0}],readonly:[{watchReadonly:0},{handleValidityChange:0}],required:[{handleValidityChange:0}],disabled:[{handleValidityChange:0},{validateDisabled:0}],mgWidth:[{watchMgWidth:0}],pattern:[{validatePattern:0}],patternErrorMessage:[{validatePattern:0}],characterLeftHide:[{validatecharacterLeftHide:0}]}]);function w(){"undefined"!=typeof customElements&&["mg-input-textarea","mg-character-left","mg-icon","mg-input","mg-input-title","mg-tooltip","mg-tooltip-content"].forEach((i=>{switch(i){case"mg-input-textarea":customElements.get(t(i))||customElements.define(t(i),_);break;case"mg-character-left":customElements.get(t(i))||g();break;case"mg-icon":customElements.get(t(i))||u();break;case"mg-input":customElements.get(t(i))||d();break;case"mg-input-title":customElements.get(t(i))||b();break;case"mg-tooltip":customElements.get(t(i))||f();break;case"mg-tooltip-content":customElements.get(t(i))||v()}}))}w();const x=_,y=w;export{x as MgInputTextarea,y as defineCustomElement}
@@ -1,6 +1 @@
1
- import { M as MgInputTitle$1, d as defineCustomElement$1 } from './mg-input-title2.js';
2
-
3
- const MgInputTitle = MgInputTitle$1;
4
- const defineCustomElement = defineCustomElement$1;
5
-
6
- export { MgInputTitle, defineCustomElement };
1
+ import{M as t,d as o}from"./mg-input-title2.js";const s=t,i=o;export{s as MgInputTitle,i as defineCustomElement}
@@ -1,81 +1 @@
1
- import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
- import { i as isValidString, a as isValideID, t as toString } from './index2.js';
3
-
4
- const mgInputTitleCss = ".mg-u-form-legacy.sc-mg-input-title{--mg-c-form-inputs-title-width:calc(100% / 3 - 20px)}.mg-u-is-asterisk.sc-mg-input-title{color:var(--mg-b-color-danger)}legend.mg-c-input-title.sc-mg-input-title{padding-right:0;padding-left:0}.mg-c-input-title__required.sc-mg-input-title{display:var(--mg-c-input-title-display, unset)}";
5
-
6
- const MgInputTitle = /*@__PURE__*/ proxyCustomElement(class MgInputTitle extends HTMLElement {
7
- constructor(registerHost) {
8
- super();
9
- if (registerHost !== false) {
10
- this.__registerHost();
11
- }
12
- /**
13
- * Switch from label to fieldset sementic
14
- */
15
- this.isLegend = false;
16
- /**
17
- * Component parent tagname
18
- */
19
- this.tagName = 'label';
20
- }
21
- validateIdentifier(newValue) {
22
- if (!isValidString(newValue)) {
23
- throw new Error('<mg-input-title> prop "identifier" is required.');
24
- }
25
- else if (!isValideID(newValue)) {
26
- console.error(`<mg-input-title> prop "identifier" value is invalid. Passed value: ${toString(newValue)}.`);
27
- }
28
- }
29
- validateIsLegend(newValue) {
30
- this.tagName = newValue ? 'legend' : 'label';
31
- }
32
- /*************
33
- * Lifecycle *
34
- *************/
35
- /**
36
- * Init tag name
37
- */
38
- componentWillLoad() {
39
- this.validateIdentifier(this.identifier);
40
- this.validateIsLegend(this.isLegend);
41
- }
42
- /**
43
- * Render
44
- * @returns HTML element
45
- */
46
- render() {
47
- const TagName = this.readonly ? 'span' : this.tagName;
48
- // \u00A0 represent a &nbsp;
49
- return (h(TagName, { key: '860f74509c87626d4af51641f0f48db99fa194b0', class: "mg-c-input-title", htmlFor: !this.isLegend && this.identifier, id: this.isLegend ? `${this.identifier}-title` : undefined }, h("slot", { key: '5eb0ca4d7f4061c0cff01e2de3adb9c98c42955a' }), this.required && !this.readonly && (h("span", { key: '0637de0d0dca9b7f87c9bb04fd44eadc6d0606cc', class: "mg-c-input-title__required" }, "\u00A0", h("span", { key: 'b5736467e3fd759eeabe9cf8ee6ed3cf73b8ebfc', class: "mg-u-is-asterisk" }, "*")))));
50
- }
51
- static get watchers() { return {
52
- "identifier": ["validateIdentifier"],
53
- "isLegend": ["validateIsLegend"]
54
- }; }
55
- static get style() { return mgInputTitleCss; }
56
- }, [262, "mg-input-title", {
57
- "identifier": [1],
58
- "required": [4],
59
- "readonly": [4],
60
- "isLegend": [4, "is-legend"],
61
- "tagName": [32]
62
- }, undefined, {
63
- "identifier": ["validateIdentifier"],
64
- "isLegend": ["validateIsLegend"]
65
- }]);
66
- function defineCustomElement() {
67
- if (typeof customElements === "undefined") {
68
- return;
69
- }
70
- const components = ["mg-input-title"];
71
- components.forEach(tagName => { switch (tagName) {
72
- case "mg-input-title":
73
- if (!customElements.get(tagName)) {
74
- customElements.define(tagName, MgInputTitle);
75
- }
76
- break;
77
- } });
78
- }
79
- defineCustomElement();
80
-
81
- export { MgInputTitle as M, defineCustomElement as d };
1
+ import{transformTag as e,proxyCustomElement as t,HTMLElement as i,h as s}from"@stencil/core/internal/client";import{i as a,a as n,t as l}from"./index2.js";const d=t(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.isLegend=!1,this.tagName="label"}validateIdentifier(e){if(!a(e))throw new Error('<mg-input-title> prop "identifier" is required.');n(e)||console.error(`<mg-input-title> prop "identifier" value is invalid. Passed value: ${l(e)}.`)}validateIsLegend(e){this.tagName=e?"legend":"label"}componentWillLoad(){this.validateIdentifier(this.identifier),this.validateIsLegend(this.isLegend)}render(){return s(this.readonly?"span":this.tagName,{key:"d61ed048e1b2bb124281eb4067894d9a35abf778",class:"mg-c-input-title",htmlFor:!this.isLegend&&this.identifier,id:this.isLegend?`${this.identifier}-title`:void 0},s("slot",{key:"3bad02b10f8e9bb536c5eba9bf85d4b4967a9d97"}),this.required&&!this.readonly&&s("span",{key:"f0fd90a79f4449a1a3b7ec76a3eeb96bcc2e4ee6",class:"mg-c-input-title__required"}," ",s("span",{key:"7ea29cfc494c5c5c2b65b62ea27caee5a41062ca",class:"mg-u-is-asterisk"},"*")))}static get watchers(){return{identifier:[{validateIdentifier:0}],isLegend:[{validateIsLegend:0}]}}static get style(){return".mg-u-form-legacy.sc-mg-input-title{--mg-c-form-inputs-title-width:calc(100% / 3 - 20px)}.mg-u-is-asterisk.sc-mg-input-title{color:var(--mg-b-color-danger)}legend.mg-c-input-title.sc-mg-input-title{padding-right:0;padding-left:0}.mg-c-input-title__required.sc-mg-input-title{display:var(--mg-c-input-title-display, unset)}"}},[262,"mg-input-title",{identifier:[1],required:[4],readonly:[4],isLegend:[4,"is-legend"],tagName:[32]},void 0,{identifier:[{validateIdentifier:0}],isLegend:[{validateIsLegend:0}]}]);function r(){"undefined"!=typeof customElements&&["mg-input-title"].forEach((t=>{"mg-input-title"===t&&(customElements.get(e(t))||customElements.define(e(t),d))}))}r();export{d as M,r as d}