@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,6 +1 @@
1
- import { M as MgInputSelect$1, d as defineCustomElement$1 } from './mg-input-select2.js';
2
-
3
- const MgInputSelect = MgInputSelect$1;
4
- const defineCustomElement = defineCustomElement$1;
5
-
6
- export { MgInputSelect, defineCustomElement };
1
+ import{M as s,d as t}from"./mg-input-select2.js";const o=s,e=t;export{o as MgInputSelect,e as defineCustomElement}
@@ -1,481 +1 @@
1
- import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
- import { C as ClassList, d as allItemsAreString, t as toString, i as isValidString } from './index2.js';
3
- import { d as defineCustomElement$4, c as classReadonly, a as classDisabled, w as widths } from './mg-input2.js';
4
- import { i as initLocales } from './index3.js';
5
- import { d as defineCustomElement$5 } from './mg-icon2.js';
6
- import { d as defineCustomElement$3 } from './mg-input-title2.js';
7
- import { d as defineCustomElement$2 } from './mg-tooltip2.js';
8
- import { d as defineCustomElement$1 } from './mg-tooltip-content2.js';
9
-
10
- const mgInputSelectCss = ".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__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__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-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__box{max-width:100%;padding-top:0;padding-right:var(--mg-b-size-8);padding-bottom:0}@media screen and (max-width: 767px){.mg-c-input__box{width:100%}}";
11
-
12
- /**
13
- * Check if item is a well configured option
14
- * @param option - select option
15
- * @returns select option type is valid
16
- */
17
- const isOption = (option) => typeof option === 'object' && typeof option.title === 'string';
18
- /**
19
- * Check if items[] is SelectOption
20
- * @param items - select option
21
- * @returns select option array type is valid
22
- */
23
- const allItemsAreOptions = (items) => Array.isArray(items) && items.every(item => isOption(item));
24
- /**
25
- * Check if item is a well configured optgroup
26
- * @param optgroup - select option
27
- * @returns select optgroup type is valid
28
- */
29
- const isOptGroup = (optgroup) => typeof optgroup === 'object' && typeof optgroup.group === 'string' && allItemsAreOptions(optgroup.options);
30
- /**
31
- * Group options
32
- * @param acc - reduce accumulator
33
- * @param item - item to add
34
- * @returns grouped options
35
- */
36
- const groupOptions = (acc, { group, title, value, disabled }) => {
37
- if (group !== undefined) {
38
- // Check if group is already created
39
- const optGroup = acc.find(grp => grp.group === group);
40
- // Add to group
41
- if (optGroup !== undefined) {
42
- optGroup.options.push({ title, value, disabled });
43
- }
44
- // Create group
45
- else {
46
- acc.push({ group, options: [{ title, value, disabled }] });
47
- }
48
- }
49
- else {
50
- acc.push({ title, value, disabled });
51
- }
52
- return acc;
53
- };
54
- const MgInputSelect = /*@__PURE__*/ proxyCustomElement(class MgInputSelect extends HTMLElement {
55
- constructor(registerHost) {
56
- super();
57
- if (registerHost !== false) {
58
- this.__registerHost();
59
- }
60
- this.__attachShadow();
61
- this.valueChange = createEvent(this, "value-change", 7);
62
- this.inputValid = createEvent(this, "input-valid", 7);
63
- // hasDisplayedError (triggered by blur event)
64
- this.hasDisplayedError = false;
65
- this.customErrorMessage = { lock: false };
66
- /**
67
- * Input name
68
- * If not set the value equals the identifier
69
- */
70
- this.name = this.identifier;
71
- /**
72
- * Define if label is displayed on top
73
- */
74
- this.labelOnTop = false;
75
- /**
76
- * Define if label is visible
77
- */
78
- this.labelHide = false;
79
- /**
80
- * Option to remove placeholder
81
- */
82
- this.placeholderHide = false;
83
- /**
84
- * Option to disable placeholder
85
- */
86
- this.placeholderDisabled = false;
87
- /**
88
- * Define if input is required
89
- */
90
- this.required = false;
91
- /**
92
- * Define if input is readonly
93
- */
94
- this.readonly = false;
95
- /**
96
- * Define if input is disabled
97
- */
98
- this.disabled = false;
99
- /**
100
- * Define tooltip position
101
- */
102
- this.tooltipPosition = 'input';
103
- /**
104
- * Component classes
105
- */
106
- this.classCollection = new ClassList(['mg-c-input--select']);
107
- /**
108
- * Method to get readonly value from value
109
- * @returns readonly value
110
- */
111
- this.getReadonlyValue = () => {
112
- var _a;
113
- if (allItemsAreString(this.items) && typeof this.value === 'string') {
114
- return this.items.find(item => item === this.value);
115
- }
116
- else if (allItemsAreOptions(this.items)) {
117
- return (_a = this.items.find(item => item.value === this.value)) === null || _a === void 0 ? void 0 : _a.title;
118
- }
119
- else {
120
- return null;
121
- }
122
- };
123
- /**
124
- * Handle input event
125
- */
126
- this.handleInput = () => {
127
- if (this.input.value === '') {
128
- this.value = null;
129
- }
130
- else if (allItemsAreString(this.items) && this.items.includes(this.input.value)) {
131
- this.value = this.input.value;
132
- }
133
- else if (allItemsAreOptions(this.items) && typeof this.input.value === 'string' && this.items.some(this.isInputValue)) {
134
- this.value = this.items.find(this.isInputValue).value;
135
- }
136
- else {
137
- // Add the unknown input.value to the options array as a disabled option before setting it as the new value
138
- this.options.push({ title: this.input.value, value: this.input.value, disabled: true });
139
- this.value = this.input.value;
140
- }
141
- if (this.hasDisplayedError) {
142
- this.setErrorMessage();
143
- }
144
- };
145
- /**
146
- * Method to compare item.title with input.value
147
- * @param item - item to compare with
148
- * @returns truthy if input.value is an item
149
- */
150
- this.isInputValue = (item) => { var _a; return item.title === ((_a = this.input) === null || _a === void 0 ? void 0 : _a.value); };
151
- /**
152
- * Handle blur event
153
- */
154
- this.handleBlur = () => {
155
- this.handlerInProgress = 'blur';
156
- this.displayError().finally(() => {
157
- // reset guard
158
- this.handlerInProgress = undefined;
159
- });
160
- };
161
- /**
162
- * Input value is disabled
163
- * @returns truthy if input value is disabled
164
- */
165
- this.isDisabledValue = () => { var _a; return allItemsAreOptions(this.options) && ((_a = this.options.find(this.isInputValue)) === null || _a === void 0 ? void 0 : _a.disabled) === true; };
166
- /**
167
- * Check if input is valid
168
- */
169
- this.checkValidity = () => {
170
- this.setValidity(!this.isDisabledValue() && (this.readonly || this.disabled || this.input.checkValidity()));
171
- };
172
- /**
173
- * Set input error message
174
- * @param fromSetErrorContext - context come from `setError` method
175
- */
176
- this.setErrorMessage = (fromSetErrorContext = false) => {
177
- // Set error message
178
- this.errorMessage = undefined;
179
- if (!this.valid) {
180
- // Does have a new custom error message OR does have a custom error message locked
181
- if (fromSetErrorContext || (this.customErrorMessage.lock && this.customErrorMessage.message !== undefined)) {
182
- this.errorMessage = this.customErrorMessage.message;
183
- }
184
- // required
185
- else if (this.input.validity.valueMissing) {
186
- this.errorMessage = this.messages.errors.required;
187
- }
188
- }
189
- };
190
- /**
191
- * Render option
192
- * @param option - to render
193
- * @returns render option
194
- */
195
- this.renderOption = (option) => (h("option", { key: option.title, value: option.title, selected: JSON.stringify(this.value) === JSON.stringify(option.value), disabled: option.disabled }, option.title));
196
- }
197
- validateValue(newValue) {
198
- setTimeout(() => {
199
- this.checkValidity();
200
- if (this.hasDisplayedError) {
201
- this.setErrorMessage();
202
- }
203
- }, 0);
204
- this.valueChange.emit(newValue);
205
- }
206
- validateItems(newValue) {
207
- // Empty options
208
- if (newValue.length === 0) {
209
- this.options = [];
210
- }
211
- // String array
212
- else if (allItemsAreString(newValue)) {
213
- if (typeof this.value === 'string') {
214
- this.valueExist = newValue.includes(this.value);
215
- }
216
- this.options = newValue.map(item => ({ title: item, value: item }));
217
- }
218
- // Object array
219
- else if (allItemsAreOptions(newValue)) {
220
- this.valueExist = newValue.map(item => item.value).includes(this.value);
221
- // Grouped object options
222
- if (newValue.some(item => Boolean(item.group))) {
223
- this.options = newValue.reduce(groupOptions, []);
224
- }
225
- // Standart object options
226
- else {
227
- this.options = newValue;
228
- }
229
- }
230
- else {
231
- throw new Error(`<mg-input-select> prop "items" is required, can be an empty Array or all items must be the same type: string or Option. Passed value: ${toString(newValue)}.`);
232
- }
233
- }
234
- watchReadonly(newValue) {
235
- if (newValue)
236
- this.classCollection.add(classReadonly);
237
- else
238
- this.classCollection.delete(classReadonly);
239
- }
240
- handleValidityChange(newValue, _oldValue, prop) {
241
- if (this.input !== undefined) {
242
- this.input[prop] = newValue;
243
- this.checkValidity();
244
- if (this.hasDisplayedError) {
245
- this.setErrorMessage();
246
- this.hasDisplayedError = false;
247
- }
248
- }
249
- }
250
- watchDisabled(newValue) {
251
- if (newValue)
252
- this.classCollection.add(classDisabled);
253
- else
254
- this.classCollection.delete(classDisabled);
255
- }
256
- watchMgWidth(newValue) {
257
- // reset width class
258
- widths.forEach(width => {
259
- this.classCollection.delete(`mg-c-input--width-${width}`);
260
- });
261
- // apply new width
262
- if (newValue !== undefined)
263
- this.classCollection.add(`mg-c-input--width-${this.mgWidth}`);
264
- }
265
- /**
266
- * Set focus on input.
267
- */
268
- async setFocus() {
269
- var _a;
270
- (_a = this.input) === null || _a === void 0 ? void 0 : _a.focus();
271
- }
272
- /**
273
- * Display input error if it exists.
274
- */
275
- displayError() {
276
- // Use `Promise` as requested for stencil method
277
- // Use `requestAnimationFrame` to ensure:
278
- // - DOM is fully updated before validation
279
- // - Async operations are completed
280
- // - No timing issues with Stencil's render cycle
281
- // - Keep everything in sync both inside and outside the component
282
- return new Promise(resolve => {
283
- requestAnimationFrame(() => {
284
- this.checkValidity();
285
- this.setErrorMessage();
286
- this.hasDisplayedError = this.invalid;
287
- resolve();
288
- });
289
- });
290
- }
291
- /**
292
- * Set an error and display a custom error message.
293
- * This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.
294
- * It must be paired with an error message to display for the given context.
295
- * When used to set validity to `false`, you should use this method again to reset the validity to `true`.
296
- * @param valid - value indicating the validity
297
- * @param errorMessage - the error message to display
298
- * @param errorMessageLock - lock the error message and validity state
299
- */
300
- async setError(valid, errorMessage, errorMessageLock = false) {
301
- if (typeof valid !== 'boolean') {
302
- throw new Error('<mg-input-select> method "setError()" param "valid" must be a boolean.');
303
- }
304
- else if (errorMessage !== undefined && !isValidString(errorMessage)) {
305
- throw new Error('<mg-input-select> method "setError()" param "errorMessage" must be a string.');
306
- }
307
- else {
308
- this.customErrorMessage = {
309
- lock: valid ? false : errorMessageLock,
310
- message: valid ? undefined : errorMessage,
311
- };
312
- this.setValidity(valid);
313
- this.setErrorMessage(true);
314
- this.hasDisplayedError = this.invalid;
315
- }
316
- }
317
- /**
318
- * Reset value, validity and error state
319
- */
320
- async reset() {
321
- if (!this.readonly) {
322
- this.value = null;
323
- // Use `Promise` as requested for stencil method
324
- // Use `requestAnimationFrame` to ensure:
325
- // - DOM is fully updated before validation
326
- // - Async operations are completed
327
- // - No timing issues with Stencil's render cycle
328
- // - Keep everything in sync both inside and outside the component
329
- return new Promise(resolve => {
330
- requestAnimationFrame(() => {
331
- // unlock validity check by reseting customErrorMessage
332
- this.customErrorMessage = { lock: false };
333
- this.checkValidity();
334
- this.errorMessage = undefined;
335
- this.hasDisplayedError = false;
336
- resolve();
337
- });
338
- });
339
- }
340
- }
341
- /**
342
- * Method to set validity values
343
- * @param newValue - valid new value
344
- */
345
- setValidity(newValue) {
346
- const oldValue = this.valid;
347
- if (!this.customErrorMessage.lock || (this.customErrorMessage.message !== undefined && !newValue)) {
348
- this.valid = newValue;
349
- }
350
- this.invalid = !this.valid;
351
- // We need to send valid event even if it is the same value
352
- if (this.handlerInProgress === undefined || (this.handlerInProgress === 'blur' && this.valid !== oldValue)) {
353
- this.inputValid.emit(this.valid);
354
- }
355
- }
356
- /*************
357
- * Lifecycle *
358
- *************/
359
- /**
360
- * Check if component props are well configured on init
361
- * @returns timeout
362
- */
363
- componentWillLoad() {
364
- // Get locales
365
- this.messages = initLocales(this.element).messages;
366
- // Validate
367
- this.validateItems(this.items);
368
- this.validateValue(this.value);
369
- this.watchMgWidth(this.mgWidth);
370
- this.watchReadonly(this.readonly);
371
- this.watchDisabled(this.disabled);
372
- // Set default placeholder
373
- if (this.placeholder === undefined || this.placeholder === '') {
374
- this.placeholder = this.messages.input.select.placeholder;
375
- }
376
- // Check validity when component is ready
377
- // return a promise to process action only in the FIRST render().
378
- // https://stenciljs.com/docs/component-lifecycle#componentwillload
379
- return setTimeout(() => {
380
- this.checkValidity();
381
- }, 0);
382
- }
383
- /**
384
- * Render
385
- * @returns HTML Element
386
- */
387
- render() {
388
- const readonlyValue = this.getReadonlyValue();
389
- return (h("mg-input", { key: '928c7d4ebccfe38ae86630d2cb8c06f07ca09a8a', label: this.label, identifier: this.identifier, class: this.classCollection.join(), labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, tooltip: this.tooltip, tooltipPosition: this.readonly && readonlyValue === null ? 'label' : this.tooltipPosition, helpText: this.helpText, errorMessage: this.errorMessage }, this.readonly ? (readonlyValue && h("b", { class: "mg-c-input__readonly-value" }, readonlyValue)) : (h("select", { class: "mg-c-input__box", id: this.identifier, name: this.name, title: this.placeholder, disabled: this.disabled, required: this.required, "aria-invalid": (this.invalid === true).toString(), onInput: this.handleInput, onBlur: this.handleBlur, ref: (el) => {
390
- if (el !== null)
391
- this.input = el;
392
- } }, (!this.placeholderHide || !this.valueExist) && ( // In case passed value does not match any option we display the placeholder
393
- h("option", { value: "", disabled: this.placeholderDisabled && this.valueExist }, this.placeholder)), this.options.map(option => isOptGroup(option) ? (h("optgroup", { label: option.group, key: option.group }, option.options.map(this.renderOption))) : (isOption(option) && this.renderOption(option)))))));
394
- }
395
- get element() { return this; }
396
- static get watchers() { return {
397
- "value": ["validateValue"],
398
- "items": ["validateItems"],
399
- "readonly": ["watchReadonly", "handleValidityChange"],
400
- "required": ["handleValidityChange"],
401
- "disabled": ["handleValidityChange", "watchDisabled"],
402
- "mgWidth": ["watchMgWidth"]
403
- }; }
404
- static get style() { return mgInputSelectCss; }
405
- }, [257, "mg-input-select", {
406
- "value": [1032],
407
- "items": [16],
408
- "identifier": [1],
409
- "name": [1],
410
- "label": [1],
411
- "labelOnTop": [4, "label-on-top"],
412
- "labelHide": [4, "label-hide"],
413
- "placeholder": [1025],
414
- "placeholderHide": [4, "placeholder-hide"],
415
- "placeholderDisabled": [4, "placeholder-disabled"],
416
- "required": [4],
417
- "readonly": [4],
418
- "disabled": [4],
419
- "mgWidth": [520, "mg-width"],
420
- "tooltip": [1],
421
- "tooltipPosition": [1, "tooltip-position"],
422
- "helpText": [1, "help-text"],
423
- "valid": [1028],
424
- "invalid": [1028],
425
- "classCollection": [32],
426
- "errorMessage": [32],
427
- "options": [32],
428
- "valueExist": [32],
429
- "setFocus": [64],
430
- "displayError": [64],
431
- "setError": [64],
432
- "reset": [64]
433
- }, undefined, {
434
- "value": ["validateValue"],
435
- "items": ["validateItems"],
436
- "readonly": ["watchReadonly", "handleValidityChange"],
437
- "required": ["handleValidityChange"],
438
- "disabled": ["handleValidityChange", "watchDisabled"],
439
- "mgWidth": ["watchMgWidth"]
440
- }]);
441
- function defineCustomElement() {
442
- if (typeof customElements === "undefined") {
443
- return;
444
- }
445
- const components = ["mg-input-select", "mg-icon", "mg-input", "mg-input-title", "mg-tooltip", "mg-tooltip-content"];
446
- components.forEach(tagName => { switch (tagName) {
447
- case "mg-input-select":
448
- if (!customElements.get(tagName)) {
449
- customElements.define(tagName, MgInputSelect);
450
- }
451
- break;
452
- case "mg-icon":
453
- if (!customElements.get(tagName)) {
454
- defineCustomElement$5();
455
- }
456
- break;
457
- case "mg-input":
458
- if (!customElements.get(tagName)) {
459
- defineCustomElement$4();
460
- }
461
- break;
462
- case "mg-input-title":
463
- if (!customElements.get(tagName)) {
464
- defineCustomElement$3();
465
- }
466
- break;
467
- case "mg-tooltip":
468
- if (!customElements.get(tagName)) {
469
- defineCustomElement$2();
470
- }
471
- break;
472
- case "mg-tooltip-content":
473
- if (!customElements.get(tagName)) {
474
- defineCustomElement$1();
475
- }
476
- break;
477
- } });
478
- }
479
- defineCustomElement();
480
-
481
- export { MgInputSelect as M, defineCustomElement as d };
1
+ import{transformTag as t,proxyCustomElement as i,HTMLElement as e,createEvent as s,h as n}from"@stencil/core/internal/client";import{C as o,d as a,t as r,i as h}from"./index2.js";import{c as l,b as p,w as m}from"./mg-input.conf.js";import{i as c}from"./index3.js";import{d as u}from"./mg-icon2.js";import{d}from"./mg-input2.js";import{d as g}from"./mg-input-title2.js";import{d as b}from"./mg-tooltip2.js";import{d as v}from"./mg-tooltip-content2.js";const f=t=>"object"==typeof t&&"string"==typeof t.title,w=t=>Array.isArray(t)&&t.every((t=>f(t))),y=(t,{group:i,title:e,value:s,disabled:n})=>{if(void 0!==i){const o=t.find((t=>t.group===i));void 0!==o?o.options.push({title:e,value:s,disabled:n}):t.push({group:i,options:[{title:e,value:s,disabled:n}]})}else t.push({title:e,value:s,disabled:n});return t},_=i(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.valueChange=s(this,"value-change",7),this.inputValid=s(this,"input-valid",7),this.hasDisplayedError=!1,this.customErrorMessage={lock:!1},this.name=this.identifier,this.labelOnTop=!1,this.labelHide=!1,this.placeholderHide=!1,this.placeholderDisabled=!1,this.required=!1,this.readonly=!1,this.disabled=!1,this.tooltipPosition="input",this.classCollection=new o(["mg-c-input--select"]),this.getReadonlyValue=()=>{var t;return a(this.items)&&"string"==typeof this.value?this.items.find((t=>t===this.value)):w(this.items)?null===(t=this.items.find((t=>t.value===this.value)))||void 0===t?void 0:t.title:null},this.handleInput=()=>{""===this.input.value?this.value=null:a(this.items)&&this.items.includes(this.input.value)?this.value=this.input.value:w(this.items)&&"string"==typeof this.input.value&&this.items.some(this.isInputValue)?this.value=this.items.find(this.isInputValue).value:(this.options.push({title:this.input.value,value:this.input.value,disabled:!0}),this.value=this.input.value),this.hasDisplayedError&&this.setErrorMessage()},this.isInputValue=t=>{var i;return t.title===(null===(i=this.input)||void 0===i?void 0:i.value)},this.handleBlur=()=>{this.handlerInProgress="blur",this.displayError().finally((()=>{this.handlerInProgress=void 0}))},this.isDisabledValue=()=>{var t;return w(this.options)&&!0===(null===(t=this.options.find(this.isInputValue))||void 0===t?void 0:t.disabled)},this.checkValidity=()=>{this.setValidity(!this.isDisabledValue()&&(this.readonly||this.disabled||this.input.checkValidity()))},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.input.validity.valueMissing&&(this.errorMessage=this.messages.errors.required))},this.renderOption=t=>n("option",{key:t.title,value:t.title,selected:JSON.stringify(this.value)===JSON.stringify(t.value),disabled:t.disabled},t.title)}validateValue(t){setTimeout((()=>{this.checkValidity(),this.hasDisplayedError&&this.setErrorMessage()}),0),this.valueChange.emit(t)}validateItems(t){if(0===t.length)this.options=[];else if(a(t))"string"==typeof this.value&&(this.valueExist=t.includes(this.value)),this.options=t.map((t=>({title:t,value:t})));else{if(!w(t))throw new Error(`<mg-input-select> prop "items" is required, can be an empty Array or all items must be the same type: string or Option. Passed value: ${r(t)}.`);this.valueExist=t.map((t=>t.value)).includes(this.value),this.options=t.some((t=>Boolean(t.group)))?t.reduce(y,[]):t}}watchReadonly(t){t?this.classCollection.add(l):this.classCollection.delete(l)}handleValidityChange(t,i,e){void 0!==this.input&&(this.input[e]=t,this.checkValidity(),this.hasDisplayedError&&(this.setErrorMessage(),this.hasDisplayedError=!1))}watchDisabled(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}`)}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 new Error('<mg-input-select> method "setError()" param "valid" must be a boolean.');if(void 0!==i&&!h(i))throw new Error('<mg-input-select> 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=null,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=c(this.element).messages,this.validateItems(this.items),this.validateValue(this.value),this.watchMgWidth(this.mgWidth),this.watchReadonly(this.readonly),this.watchDisabled(this.disabled),void 0!==this.placeholder&&""!==this.placeholder||(this.placeholder=this.messages.input.select.placeholder),setTimeout((()=>{this.checkValidity()}),0)}render(){const t=this.getReadonlyValue();return n("mg-input",{key:"ad948f6ed1a8e749ab7b62a198814a40ef99e884",label:this.label,identifier:this.identifier,class:this.classCollection.join(),labelOnTop:this.labelOnTop,labelHide:this.labelHide,required:this.required,tooltip:this.tooltip,tooltipPosition:this.readonly&&null===t?"label":this.tooltipPosition,helpText:this.helpText,errorMessage:this.errorMessage},this.readonly?t&&n("b",{class:"mg-c-input__readonly-value"},t):n("select",{class:"mg-c-input__box",id:this.identifier,name:this.name,title:this.placeholder,disabled:this.disabled,required:this.required,"aria-invalid":(!0===this.invalid).toString(),onInput:this.handleInput,onBlur:this.handleBlur,ref:t=>{null!==t&&(this.input=t)}},(!this.placeholderHide||!this.valueExist)&&n("option",{value:"",disabled:this.placeholderDisabled&&this.valueExist},this.placeholder),this.options.map((t=>{return"object"==typeof(i=t)&&"string"==typeof i.group&&w(i.options)?n("optgroup",{label:t.group,key:t.group},t.options.map(this.renderOption)):f(t)&&this.renderOption(t);var i}))))}get element(){return this}static get watchers(){return{value:[{validateValue:0}],items:[{validateItems:0}],readonly:[{watchReadonly:0},{handleValidityChange:0}],required:[{handleValidityChange:0}],disabled:[{handleValidityChange:0},{watchDisabled:0}],mgWidth:[{watchMgWidth: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__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__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-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__box{max-width:100%;padding-top:0;padding-right:var(--mg-b-size-8);padding-bottom:0}@media screen and (max-width: 767px){.mg-c-input__box{width:100%}}"}},[1,"mg-input-select",{value:[1032],items:[16],identifier:[1],name:[1],label:[1],labelOnTop:[4,"label-on-top"],labelHide:[4,"label-hide"],placeholder:[1025],placeholderHide:[4,"placeholder-hide"],placeholderDisabled:[4,"placeholder-disabled"],required:[4],readonly:[4],disabled:[4],mgWidth:[520,"mg-width"],tooltip:[1],tooltipPosition:[1,"tooltip-position"],helpText:[1,"help-text"],valid:[1028],invalid:[1028],classCollection:[32],errorMessage:[32],options:[32],valueExist:[32],setFocus:[64],displayError:[64],setError:[64],reset:[64]},void 0,{value:[{validateValue:0}],items:[{validateItems:0}],readonly:[{watchReadonly:0},{handleValidityChange:0}],required:[{handleValidityChange:0}],disabled:[{handleValidityChange:0},{watchDisabled:0}],mgWidth:[{watchMgWidth:0}]}]);function x(){"undefined"!=typeof customElements&&["mg-input-select","mg-icon","mg-input","mg-input-title","mg-tooltip","mg-tooltip-content"].forEach((i=>{switch(i){case"mg-input-select":customElements.get(t(i))||customElements.define(t(i),_);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))||g();break;case"mg-tooltip":customElements.get(t(i))||b();break;case"mg-tooltip-content":customElements.get(t(i))||v()}}))}x();export{_ as M,x as d}
@@ -1,6 +1 @@
1
- import { M as MgInputText$1, d as defineCustomElement$1 } from './mg-input-text2.js';
2
-
3
- const MgInputText = MgInputText$1;
4
- const defineCustomElement = defineCustomElement$1;
5
-
6
- export { MgInputText, defineCustomElement };
1
+ import{M as t,d as o}from"./mg-input-text2.js";const s=t,m=o;export{s as MgInputText,m as defineCustomElement}