@mgdis/mg-components 6.14.0 → 6.15.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 (150) hide show
  1. package/dist/cjs/{index-DzBkSgSK.js → index-BGxkpQwi.js} +7 -1
  2. package/dist/cjs/{index-DUJwxnoi.js → index-CpENFzEo.js} +2 -2
  3. package/dist/cjs/{index-CwjAofQ1.js → index-iUZvsp-F.js} +55 -31
  4. package/dist/cjs/loader.cjs.js +2 -2
  5. package/dist/cjs/mg-action-more_37.cjs.entry.js +431 -208
  6. package/dist/cjs/mg-alert.cjs.entry.js +4 -4
  7. package/dist/cjs/mg-components.cjs.js +3 -3
  8. package/dist/cjs/mg-input-combobox.cjs.entry.js +145 -81
  9. package/dist/cjs/mg-input-rich-text-editor.cjs.entry.js +1248 -16004
  10. package/dist/cjs/{mg-input.conf-WTsvDfpC.js → mg-input.conf-CwjEAih3.js} +7 -0
  11. package/dist/cjs/mg-input.utils-D-ASK4ua.js +49 -0
  12. package/dist/cjs/mg-loader.cjs.entry.js +4 -4
  13. package/dist/cjs/mg-progress.cjs.entry.js +3 -3
  14. package/dist/collection/assets/icons/index.js +1 -1
  15. package/dist/collection/collection-manifest.json +2 -2
  16. package/dist/collection/components/atoms/mg-icon/mg-icon.js +1 -1
  17. package/dist/collection/components/molecules/inputs/mg-input/mg-input.conf.js +6 -0
  18. package/dist/collection/components/molecules/inputs/mg-input/mg-input.js +93 -22
  19. package/dist/collection/components/molecules/inputs/mg-input/mg-input.utils.js +21 -0
  20. package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js +2 -1
  21. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js +49 -106
  22. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +123 -48
  23. package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js +140 -56
  24. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +1 -1
  25. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +6 -1
  26. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +1 -1
  27. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +63 -10
  28. package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.js +1 -1
  29. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +54 -6
  30. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +2 -2
  31. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +1 -1
  32. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +142 -9
  33. package/dist/collection/components/molecules/internals/mg-item-more/mg-item-more.js +1 -1
  34. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +2 -2
  35. package/dist/collection/components/molecules/mg-alert/mg-alert.js +1 -1
  36. package/dist/collection/components/molecules/mg-details/mg-details.js +1 -1
  37. package/dist/collection/components/molecules/mg-form/mg-form.js +1 -1
  38. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +1 -1
  39. package/dist/collection/components/molecules/mg-loader/mg-loader.js +1 -1
  40. package/dist/collection/components/molecules/mg-message/mg-message.js +2 -2
  41. package/dist/collection/components/molecules/mg-modal/mg-modal.js +2 -2
  42. package/dist/collection/components/molecules/mg-panel/mg-panel.js +1 -1
  43. package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js +1 -1
  44. package/dist/collection/components/molecules/mg-popover/mg-popover.js +1 -1
  45. package/dist/collection/components/molecules/mg-progress/mg-progress.js +1 -1
  46. package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +1 -1
  47. package/dist/collection/components/molecules/mg-table/mg-table.js +2 -2
  48. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +1 -1
  49. package/dist/collection/locales/en/messages.json +23 -14
  50. package/dist/collection/locales/fr/messages.json +24 -15
  51. package/dist/components/index2.js +3 -3
  52. package/dist/components/index3.js +55 -31
  53. package/dist/components/mg-action-more.js +2 -2
  54. package/dist/components/mg-alert.js +2 -2
  55. package/dist/components/mg-badge2.js +1 -1
  56. package/dist/components/mg-button2.js +1 -1
  57. package/dist/components/mg-card2.js +1 -1
  58. package/dist/components/mg-character-left2.js +1 -1
  59. package/dist/components/mg-details.js +1 -97
  60. package/dist/components/mg-details2.js +99 -0
  61. package/dist/components/mg-divider2.js +1 -1
  62. package/dist/components/mg-form.js +2 -2
  63. package/dist/components/mg-icon2.js +1 -1
  64. package/dist/components/mg-illustrated-message.js +2 -2
  65. package/dist/components/mg-input-checkbox-paginated2.js +43 -124
  66. package/dist/components/mg-input-checkbox.js +136 -62
  67. package/dist/components/mg-input-combobox.js +135 -63
  68. package/dist/components/mg-input-date.js +9 -3
  69. package/dist/components/mg-input-numeric.js +14 -3
  70. package/dist/components/mg-input-password.js +10 -4
  71. package/dist/components/mg-input-radio.js +54 -13
  72. package/dist/components/mg-input-rich-text-editor.js +1266 -16016
  73. package/dist/components/mg-input-select2.js +45 -9
  74. package/dist/components/mg-input-text2.js +10 -4
  75. package/dist/components/mg-input-textarea.js +10 -4
  76. package/dist/components/mg-input-title2.js +1 -1
  77. package/dist/components/mg-input-toggle.js +97 -12
  78. package/dist/components/mg-input.utils.js +24 -0
  79. package/dist/components/mg-input2.js +100 -23
  80. package/dist/components/mg-item-more2.js +2 -2
  81. package/dist/components/mg-loader2.js +2 -2
  82. package/dist/components/mg-menu-item2.js +1 -1
  83. package/dist/components/mg-message2.js +3 -3
  84. package/dist/components/mg-modal.js +3 -3
  85. package/dist/components/mg-pagination.js +233 -1
  86. package/dist/components/mg-panel.js +14 -8
  87. package/dist/components/mg-popover-content2.js +2 -2
  88. package/dist/components/mg-popover2.js +2 -2
  89. package/dist/components/mg-progress.js +2 -2
  90. package/dist/components/mg-skip-links.js +2 -2
  91. package/dist/components/mg-table.js +3 -3
  92. package/dist/components/mg-tabs.js +1 -311
  93. package/dist/components/mg-tabs2.js +313 -0
  94. package/dist/components/mg-tag.js +1 -1
  95. package/dist/components/mg-tooltip-content2.js +1 -1
  96. package/dist/components/mg-tooltip2.js +2 -2
  97. package/dist/esm/{index-Bv7NHR-W.js → index-CKB-AnCZ.js} +55 -31
  98. package/dist/esm/{index-Degtjvph.js → index-DhAOnZJn.js} +7 -1
  99. package/dist/esm/{index-Dr7GYvIz.js → index-WtiuOkLj.js} +2 -2
  100. package/dist/esm/loader.js +3 -3
  101. package/dist/esm/mg-action-more_37.entry.js +426 -203
  102. package/dist/esm/mg-alert.entry.js +4 -4
  103. package/dist/esm/mg-components.js +4 -4
  104. package/dist/esm/mg-input-combobox.entry.js +125 -61
  105. package/dist/esm/mg-input-rich-text-editor.entry.js +1249 -16005
  106. package/dist/esm/{mg-input.conf-CNgv8hc5.js → mg-input.conf-BAUTlb6r.js} +7 -1
  107. package/dist/esm/mg-input.utils-BYI03zSi.js +46 -0
  108. package/dist/esm/mg-loader.entry.js +4 -4
  109. package/dist/esm/mg-progress.entry.js +3 -3
  110. package/dist/mg-components/locales/en/messages.json +23 -14
  111. package/dist/mg-components/locales/fr/messages.json +24 -15
  112. package/dist/mg-components/mg-components.esm.js +1 -1
  113. package/dist/mg-components/p-31856cff.entry.js +1 -0
  114. package/dist/mg-components/{p-056ba467.entry.js → p-420daa1e.entry.js} +1 -1
  115. package/dist/mg-components/{p-d13a6fdc.entry.js → p-47e19783.entry.js} +1 -1
  116. package/dist/mg-components/p-67af6274.entry.js +1 -0
  117. package/dist/mg-components/p-698dfc6c.entry.js +1 -0
  118. package/dist/mg-components/p-BAUTlb6r.js +1 -0
  119. package/dist/mg-components/p-CKB-AnCZ.js +1 -0
  120. package/dist/mg-components/p-DhAOnZJn.js +2 -0
  121. package/dist/mg-components/p-PuX-pdL4.js +1 -0
  122. package/dist/mg-components/p-WtiuOkLj.js +1 -0
  123. package/dist/mg-components/p-a0fa44cf.entry.js +1 -0
  124. package/dist/types/assets/icons/index.d.ts +6 -0
  125. package/dist/types/components/molecules/inputs/mg-input/mg-input.conf.d.ts +13 -0
  126. package/dist/types/components/molecules/inputs/mg-input/mg-input.d.ts +15 -4
  127. package/dist/types/components/molecules/inputs/mg-input/mg-input.utils.d.ts +8 -0
  128. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.d.ts +17 -40
  129. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.d.ts +1 -2
  130. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +36 -9
  131. package/dist/types/components/molecules/inputs/mg-input-combobox/mg-input-combobox.d.ts +17 -3
  132. package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +18 -0
  133. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +18 -0
  134. package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +40 -4
  135. package/dist/types/components.d.ts +69 -40
  136. package/ide/intellij/web-types.json +148 -22
  137. package/ide/vscode/html-custom-data.json +143 -9
  138. package/package.json +15 -15
  139. package/dist/cjs/events.utils-D5SAtkpQ.js +0 -25
  140. package/dist/components/mg-pagination2.js +0 -229
  141. package/dist/esm/events.utils-yMGqY8YG.js +0 -23
  142. package/dist/mg-components/p-625c463c.entry.js +0 -1
  143. package/dist/mg-components/p-Bv7NHR-W.js +0 -1
  144. package/dist/mg-components/p-CNgv8hc5.js +0 -1
  145. package/dist/mg-components/p-Degtjvph.js +0 -2
  146. package/dist/mg-components/p-Dr7GYvIz.js +0 -1
  147. package/dist/mg-components/p-c522f3c1.entry.js +0 -1
  148. package/dist/mg-components/p-cac23bd7.entry.js +0 -1
  149. package/dist/mg-components/p-e75f5383.entry.js +0 -10
  150. package/dist/mg-components/p-yMGqY8YG.js +0 -1
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-DzBkSgSK.js');
4
- var index$1 = require('./index-DUJwxnoi.js');
5
- var mgInput_conf = require('./mg-input.conf-WTsvDfpC.js');
6
- var index$2 = require('./index-CwjAofQ1.js');
7
- var events_utils = require('./events.utils-D5SAtkpQ.js');
3
+ var index = require('./index-BGxkpQwi.js');
4
+ var index$1 = require('./index-CpENFzEo.js');
5
+ var mgInput_conf = require('./mg-input.conf-CwjEAih3.js');
6
+ var index$2 = require('./index-iUZvsp-F.js');
7
+ var mgInput_utils = require('./mg-input.utils-D-ASK4ua.js');
8
8
 
9
- const mgInputComboboxCss = ".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__with-character-left>mg-icon:first-of-type,.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__with-character-left .mg-c-input__box,.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-2 .mg-c-input__with-character-left,.mg-c-input.mg-c-input--width-4 .mg-c-input__with-character-left,.mg-c-input.mg-c-input--width-16 .mg-c-input__with-character-left{width:max-content}.mg-c-input.mg-c-input--width-2 .mg-c-input__with-character-left:has(textarea),.mg-c-input.mg-c-input--width-4 .mg-c-input__with-character-left:has(textarea),.mg-c-input.mg-c-input--width-16 .mg-c-input__with-character-left:has(textarea){flex-grow:inherit}.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__with-character-left:not(:has(textarea)) .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__with-character-left:not(:has(textarea)) .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__with-character-left:not(:has(textarea)) .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-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.mg-c-input--combobox mg-popover{--mg-c-card-overflow:hidden;--mg-c-popover-padding-vertical:0;--mg-c-popover-padding-horizontal:0}.mg-c-input.mg-c-input--combobox .mg-c-input__input-group-container{position:relative}.mg-c-input.mg-c-input--combobox .mg-c-input__box{cursor:pointer}.mg-c-input.mg-c-input--combobox .mg-c-input__popover-container{display:flex;min-width:var(--mg-c-input-list-width);max-height:calc(50*var(--mg-b-size-8) - var(--mg-b-size-32));flex-direction:column;gap:var(--mg-b-size-4);overflow-y:scroll}.mg-c-input.mg-c-input--combobox .mg-c-input__popover-info{padding:var(--mg-b-size-8);margin:0;text-align:center}.mg-c-input.mg-c-input--combobox .mg-c-input__load-more{padding:0 var(--mg-b-size-8) var(--mg-b-size-4)}.mg-c-input.mg-c-input--combobox .mg-c-input__input-list{padding:0;margin:0;cursor:pointer;list-style:none}.mg-c-input.mg-c-input--combobox .mg-c-input__input-list-item{display:flex;padding:var(--mg-b-size-8)}.mg-c-input.mg-c-input--combobox .mg-c-input__input-list-item:hover,.mg-c-input.mg-c-input--combobox .mg-c-input__input-list-item.mg-c-input__input-list-item--focus-visible{background-color:var(--mg-b-color-neutral-20)}.mg-c-input.mg-c-input--combobox .mg-c-input__input-list-item.mg-c-input__input-list-item--selected{font-weight:700}.mg-c-input.mg-c-input--combobox .mg-c-input__input-list-item.mg-c-input__input-list-item--selected mg-icon{margin-left:auto}.mg-c-input.mg-c-input--combobox.mg-c-input--width-2 .mg-c-input__box{width:calc(var(--mg-b-size-16) + var(--mg-b-size-8)*2 + var(--mg-b-size-24) + var(--mg-b-size-min-height) + var(--mg-b-size-4))}.mg-c-input.mg-c-input--combobox.mg-c-input--width-4 .mg-c-input__box{width:calc(var(--mg-b-size-16) + var(--mg-b-size-8)*2 + var(--mg-b-size-48) + var(--mg-b-size-min-height) + var(--mg-b-size-4))}.mg-c-input.mg-c-input--combobox.mg-c-input--width-16 .mg-c-input__box{width:calc(var(--mg-b-size-16) + var(--mg-b-size-8)*2 + calc(23 * var(--mg-b-size-8)) + var(--mg-b-size-min-height) + var(--mg-b-size-4))}.mg-c-input.mg-c-input--combobox.mg-c-input--width-full mg-popover{--mg-c-popover-max-width:var(--mg-c-input-list-width, var(--mg-c-popover-max-width))}.mg-c-input.mg-c-input--combobox.mg-c-input--width-full .mg-c-input__input-group-container{display:flex;width:100%}.mg-c-input.mg-c-input--combobox.mg-c-input--width-full .mg-c-input__box{flex:1}.mg-c-input.mg-c-input--combobox.mg-c-input--input-append .mg-c-input__box{padding-right:calc(var(--mg-b-size-min-height) + var(--mg-b-size-4))}.mg-c-input.mg-c-input--combobox.mg-c-input--input-append .mg-c-input__box-append{position:absolute;top:0;right:0}";
9
+ const mgInputComboboxCss = ".mg-c-input__error-details{margin:0}.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__with-character-left>mg-icon:first-of-type,.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__with-character-left .mg-c-input__box,.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__popover-info{padding:var(--mg-b-size-8);margin:0;color:var(--mg-b-color-neutral-90);text-align:center}.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-2 .mg-c-input__with-character-left,.mg-c-input.mg-c-input--width-4 .mg-c-input__with-character-left,.mg-c-input.mg-c-input--width-16 .mg-c-input__with-character-left{width:max-content}.mg-c-input.mg-c-input--width-2 .mg-c-input__with-character-left:has(textarea),.mg-c-input.mg-c-input--width-4 .mg-c-input__with-character-left:has(textarea),.mg-c-input.mg-c-input--width-16 .mg-c-input__with-character-left:has(textarea){flex-grow:inherit}.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__with-character-left:not(:has(textarea)) .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__with-character-left:not(:has(textarea)) .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__with-character-left:not(:has(textarea)) .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-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.mg-c-input--combobox mg-popover{--mg-c-card-overflow:hidden;--mg-c-popover-padding-vertical:0;--mg-c-popover-padding-horizontal:0}.mg-c-input.mg-c-input--combobox .mg-c-input__input-group-container{position:relative}.mg-c-input.mg-c-input--combobox .mg-c-input__box:not(:disabled){cursor:pointer}.mg-c-input.mg-c-input--combobox .mg-c-input__popover-container{display:flex;min-width:var(--mg-c-input-list-width);max-height:calc(50*var(--mg-b-size-8) - var(--mg-b-size-32));flex-direction:column;gap:var(--mg-b-size-4);overflow-y:scroll}.mg-c-input.mg-c-input--combobox .mg-c-input__load-more{padding:0 var(--mg-b-size-8) var(--mg-b-size-4)}.mg-c-input.mg-c-input--combobox .mg-c-input__input-list{padding:0;margin:0;cursor:pointer;list-style:none}.mg-c-input.mg-c-input--combobox .mg-c-input__input-list-item{display:flex;padding:var(--mg-b-size-8)}.mg-c-input.mg-c-input--combobox .mg-c-input__input-list-item:hover,.mg-c-input.mg-c-input--combobox .mg-c-input__input-list-item.mg-c-input__input-list-item--focus-visible{background-color:var(--mg-b-color-neutral-20)}.mg-c-input.mg-c-input--combobox .mg-c-input__input-list-item.mg-c-input__input-list-item--selected{font-weight:700}.mg-c-input.mg-c-input--combobox .mg-c-input__input-list-item.mg-c-input__input-list-item--selected mg-icon{margin-left:auto}.mg-c-input.mg-c-input--combobox.mg-c-input--width-2 .mg-c-input__box{width:calc(var(--mg-b-size-16) + var(--mg-b-size-8)*2 + var(--mg-b-size-24) + var(--mg-b-size-min-height) + var(--mg-b-size-4))}.mg-c-input.mg-c-input--combobox.mg-c-input--width-4 .mg-c-input__box{width:calc(var(--mg-b-size-16) + var(--mg-b-size-8)*2 + var(--mg-b-size-48) + var(--mg-b-size-min-height) + var(--mg-b-size-4))}.mg-c-input.mg-c-input--combobox.mg-c-input--width-16 .mg-c-input__box{width:calc(var(--mg-b-size-16) + var(--mg-b-size-8)*2 + calc(23 * var(--mg-b-size-8)) + var(--mg-b-size-min-height) + var(--mg-b-size-4))}.mg-c-input.mg-c-input--combobox.mg-c-input--width-full mg-popover{--mg-c-popover-max-width:var(--mg-c-input-list-width, var(--mg-c-popover-max-width))}.mg-c-input.mg-c-input--combobox.mg-c-input--width-full .mg-c-input__input-group-container{display:flex;width:100%}.mg-c-input.mg-c-input--combobox.mg-c-input--width-full .mg-c-input__box{flex:1}.mg-c-input.mg-c-input--combobox.mg-c-input--input-append .mg-c-input__box{padding-right:calc(var(--mg-b-size-min-height) + var(--mg-b-size-4))}.mg-c-input.mg-c-input--combobox.mg-c-input--input-append .mg-c-input__box-append{position:absolute;top:0;right:0}";
10
10
 
11
11
  /**
12
12
  * Check if object is an item
@@ -49,7 +49,7 @@ const MgInputCombobox = class {
49
49
  index.registerInstance(this, hostRef);
50
50
  this.valueChange = index.createEvent(this, "value-change", 7);
51
51
  this.filterChange = index.createEvent(this, "filter-change", 7);
52
- this.loadMore = index.createEvent(this, "load-more", 7);
52
+ this.showMore = index.createEvent(this, "load-more", 7);
53
53
  this.inputValid = index.createEvent(this, "input-valid", 7);
54
54
  this.fetchError = index.createEvent(this, "fetch-error", 7);
55
55
  /************
@@ -137,10 +137,12 @@ const MgInputCombobox = class {
137
137
  */
138
138
  this.handleFilterInput = () => {
139
139
  this.checkValidity();
140
- if (this.hasDisplayedError)
140
+ if (this.hasDisplayedError) {
141
141
  this.setErrorMessage();
142
- if (!this.popoverDisplay)
142
+ }
143
+ if (!this.popoverDisplay) {
143
144
  this.popoverDisplay = true;
145
+ }
144
146
  // update filter with debounce to prevent filter update overload
145
147
  if (!this.debounce) {
146
148
  this.debounce = true;
@@ -191,26 +193,26 @@ const MgInputCombobox = class {
191
193
  let guard = false;
192
194
  // override keys actions
193
195
  switch (event.key) {
194
- case events_utils.Keys.TAB:
195
- case events_utils.Keys.ENTER:
196
- guard = event.key === events_utils.Keys.ENTER;
196
+ case mgInput_utils.Keys.TAB:
197
+ case mgInput_utils.Keys.ENTER:
198
+ guard = event.key === mgInput_utils.Keys.ENTER;
197
199
  const option = this.option || this.options.items.find(this.isCurrentOption);
198
200
  // Sets the value to the content of the focused option in the listbox.
199
201
  if (this.popoverDisplay)
200
- this.setValue(this.page.total > 0 ? option : null);
202
+ this.setValue(option);
201
203
  // Closes the popover.
202
204
  this.popoverDisplay = false;
203
205
  break;
204
- case events_utils.Keys.DOWN:
205
- case events_utils.Keys.ARROWDOWN:
206
- case events_utils.Keys.UP:
207
- case events_utils.Keys.ARROWUP:
206
+ case mgInput_utils.Keys.DOWN:
207
+ case mgInput_utils.Keys.ARROWDOWN:
208
+ case mgInput_utils.Keys.UP:
209
+ case mgInput_utils.Keys.ARROWUP:
208
210
  guard = true;
209
211
  if (this.isLoading || !(this.page.total > 0)) {
210
212
  this.popoverDisplay = true;
211
213
  break;
212
214
  }
213
- if (Boolean(event.altKey) && [events_utils.Keys.DOWN, events_utils.Keys.ARROWDOWN].includes(event.key)) {
215
+ if (Boolean(event.altKey) && [mgInput_utils.Keys.DOWN, mgInput_utils.Keys.ARROWDOWN].includes(event.key)) {
214
216
  // Opens the popover without moving focus or changing selection.
215
217
  this.popoverDisplay = true;
216
218
  break;
@@ -218,14 +220,14 @@ const MgInputCombobox = class {
218
220
  // define cursor
219
221
  let cursor;
220
222
  const isNavigationStart = this.popoverDisplay && isItem(this.option);
221
- if ([events_utils.Keys.DOWN, events_utils.Keys.ARROWDOWN].includes(event.key)) {
223
+ if ([mgInput_utils.Keys.DOWN, mgInput_utils.Keys.ARROWDOWN].includes(event.key)) {
222
224
  // If the filter is not empty and the popover is displayed, moves visual focus to the first suggested value.
223
225
  // If the filter is empty and the popover is not displayed, opens the popover and moves visual focus to the first option.
224
226
  // Moves visual focus to the next option.
225
227
  // If visual focus is on the last option, moves visual focus to the first option.
226
228
  cursor = isNavigationStart ? index$1.Cursor.NEXT : index$1.Cursor.FIRST;
227
229
  }
228
- else if ([events_utils.Keys.UP, events_utils.Keys.ARROWUP].includes(event.key)) {
230
+ else if ([mgInput_utils.Keys.UP, mgInput_utils.Keys.ARROWUP].includes(event.key)) {
229
231
  // If the filter is not empty and the popover is displayed, moves visual focus to the last suggested value.
230
232
  // If the filter is empty, first opens the popover if it is not already displayed and then moves visual focus to the last option.
231
233
  // Moves visual focus to the previous option.
@@ -237,12 +239,12 @@ const MgInputCombobox = class {
237
239
  // open popover
238
240
  this.popoverDisplay = true;
239
241
  break;
240
- case events_utils.Keys.LEFT:
241
- case events_utils.Keys.ARROWLEFT:
242
- case events_utils.Keys.HOME:
243
- case events_utils.Keys.RIGHT:
244
- case events_utils.Keys.ARROWRIGHT:
245
- case events_utils.Keys.END:
242
+ case mgInput_utils.Keys.LEFT:
243
+ case mgInput_utils.Keys.ARROWLEFT:
244
+ case mgInput_utils.Keys.HOME:
245
+ case mgInput_utils.Keys.RIGHT:
246
+ case mgInput_utils.Keys.ARROWRIGHT:
247
+ case mgInput_utils.Keys.END:
246
248
  // skip process if visual focus is not in popover
247
249
  if (!isItem(this.option))
248
250
  break;
@@ -250,11 +252,11 @@ const MgInputCombobox = class {
250
252
  // Remove visual focus from popover options
251
253
  this.option = null;
252
254
  let index;
253
- if (events_utils.Keys.HOME === event.key) {
255
+ if (mgInput_utils.Keys.HOME === event.key) {
254
256
  // Moves visual focus to the textbox and places the editing cursor at the beginning of the field.
255
257
  index = 0;
256
258
  }
257
- else if (events_utils.Keys.END === event.key) {
259
+ else if (mgInput_utils.Keys.END === event.key) {
258
260
  // Moves visual focus to the textbox and places the editing cursor at the end of the field.
259
261
  index = this.filter.length;
260
262
  }
@@ -262,8 +264,8 @@ const MgInputCombobox = class {
262
264
  this.input.setSelectionRange(index, index);
263
265
  }
264
266
  break;
265
- case events_utils.Keys.ESC:
266
- case events_utils.Keys.ESCAPE:
267
+ case mgInput_utils.Keys.ESC:
268
+ case mgInput_utils.Keys.ESCAPE:
267
269
  guard = true;
268
270
  if (this.popoverDisplay) {
269
271
  // If the popover is displayed, closes it.
@@ -318,28 +320,47 @@ const MgInputCombobox = class {
318
320
  else
319
321
  return '';
320
322
  };
323
+ /**
324
+ * Test if component has no value error message displayed
325
+ * @returns truthy if compent display no value error message
326
+ */
327
+ this.hasNoValueError = () => this.customError === mgInput_conf.CustomError.NoValue;
321
328
  /**
322
329
  * Check if input is valid
323
330
  */
324
331
  this.checkValidity = () => {
325
- this.setValidity(this.readonly || this.disabled || this.input.checkValidity());
332
+ // force validity with readonly|disabled states
333
+ this.setValidity(this.readonly || this.disabled);
326
334
  };
327
335
  /**
328
336
  * Set input error message
329
- * @param errorMessage - errorMessage override
330
337
  */
331
- this.setErrorMessage = (errorMessage) => {
338
+ this.setErrorMessage = () => {
332
339
  // Set error message
333
340
  this.errorMessage = undefined;
334
- // Does have a custom error message
335
- if (!this.valid && errorMessage !== undefined) {
336
- this.errorMessage = errorMessage;
337
- }
338
- // required
339
- else if (!this.valid && this.input.validity.valueMissing) {
340
- this.errorMessage = this.messages.errors.required;
341
+ if (!this.valid) {
342
+ // Does have a custom error message
343
+ if (this.customError !== undefined && !Object.values(mgInput_conf.CustomError).includes(this.customError)) {
344
+ this.errorMessage = this.customError;
345
+ }
346
+ // no items
347
+ else if (this.hasNoValueError()) {
348
+ this.errorMessage = this.messages.errors.noValue;
349
+ }
350
+ // required
351
+ else if (this.input.validity.valueMissing) {
352
+ this.errorMessage = this.messages.errors.required;
353
+ }
341
354
  }
342
355
  };
356
+ /**
357
+ * Reset error message
358
+ */
359
+ this.resetErrorMessage = () => {
360
+ this.checkValidity();
361
+ this.errorMessage = undefined;
362
+ this.hasDisplayedError = false;
363
+ };
343
364
  /**
344
365
  * Get filtered options from `filter` input value
345
366
  * @returns filtered options
@@ -364,8 +385,8 @@ const MgInputCombobox = class {
364
385
  else if (this.loadingAction === 'load-more') {
365
386
  index = this.page.items.length - this.page.baseIndex;
366
387
  }
367
- // when action require a loadMore we fetch the API else we report action to next tick
368
- // Set "load more" if action match OR if next item not available in the current page
388
+ // when action require a showMore we fetch the API else we report action to next tick
389
+ // Set "Show more" if action match OR if next item not available in the current page
369
390
  if (action.name === 'load-more') {
370
391
  // wait for new element render and update scroll position
371
392
  // set component loading
@@ -411,15 +432,15 @@ const MgInputCombobox = class {
411
432
  * @returns promise
412
433
  */
413
434
  this.goToNextPage = () => {
414
- this.loadMore.emit();
415
- if (Boolean(this.fetchurl)) {
435
+ this.showMore.emit();
436
+ if (this.fetchurl !== undefined) {
416
437
  return this.getOptions(typeof this.page.next === 'string' ? this.page.next : undefined).then(nextPage => {
417
- if (!Boolean(nextPage))
418
- return;
419
- // merge items from current page and next page
420
- const items = [...this.page.items, ...nextPage.items];
421
- // create new options pagination withe merged items
422
- this.options = new index$1.Paginate(items, { total: nextPage.total, next: nextPage.next, top: items.length });
438
+ if (index$1.isObject(nextPage)) {
439
+ // merge items from current page and next page
440
+ const items = [...this.page.items, ...nextPage.items];
441
+ // create new options pagination withe merged items
442
+ this.options = new index$1.Paginate(items, { total: nextPage.total, next: nextPage.next, top: items.length });
443
+ }
423
444
  });
424
445
  }
425
446
  else {
@@ -436,12 +457,20 @@ const MgInputCombobox = class {
436
457
  * @returns promise
437
458
  */
438
459
  this.updatePage = async () => {
439
- if (Boolean(this.fetchurl)) {
460
+ if (this.fetchurl !== undefined) {
440
461
  return this.getOptions().then(page => {
441
- if (!Boolean(page))
442
- return;
443
- // reset current options pagination from API response
444
- this.options = new index$1.Paginate(page.items, { total: page.total, next: page.next, top: page.top });
462
+ if (index$1.isObject(page)) {
463
+ // reset current options pagination from API response
464
+ this.options = new index$1.Paginate(page.items, { total: page.total, next: page.next, top: page.top });
465
+ // has items aren't updated with fetch mode we run the noValueError control here
466
+ if (this.filter.length === 0 && page.total === 0) {
467
+ this.displayError();
468
+ }
469
+ // force to reset error when noValueError is displaied
470
+ else if (this.invalid && this.hasNoValueError()) {
471
+ this.resetErrorMessage();
472
+ }
473
+ }
445
474
  });
446
475
  }
447
476
  else {
@@ -460,14 +489,16 @@ const MgInputCombobox = class {
460
489
  const response = await fetch(updateUrl, this.fetchoptions);
461
490
  if (!response.ok) {
462
491
  this.fetchError.emit(new Error(`${response.status} - ${response.statusText}`));
492
+ this.displayError();
463
493
  return;
464
494
  }
465
495
  const json = await response.json();
466
- const items = index$1.getObjectValueFromKey(json, this.fetchmappings.response.items).map((item) => ({
467
- title: index$1.getObjectValueFromKey(item, this.fetchmappings.response.itemTitle),
468
- value: this.fetchmappings.response.itemValue !== undefined ? index$1.getObjectValueFromKey(item, this.fetchmappings.response.itemValue) : item,
496
+ const defaultItems = [];
497
+ const items = index$1.getObjectValueFromKey(json, this.fetchmappings.response.items, defaultItems).map((item) => ({
498
+ title: index$1.getObjectValueFromKey(item, this.fetchmappings.response.itemTitle, typeof item === 'string' ? item : JSON.stringify(item)),
499
+ value: index$1.getObjectValueFromKey(item, this.fetchmappings.response.itemValue, item),
469
500
  }));
470
- const total = Number(index$1.getObjectValueFromKey(json, this.fetchmappings.response.total, 0));
501
+ const total = Number(index$1.getObjectValueFromKey(json, this.fetchmappings.response.total, defaultItems.length));
471
502
  let next = index$1.getObjectValueFromKey(json, this.fetchmappings.response.next);
472
503
  if (URL.canParse(updateUrl) && Boolean(next) && !URL.canParse(next)) {
473
504
  const previousUrl = new URL(updateUrl);
@@ -479,6 +510,7 @@ const MgInputCombobox = class {
479
510
  }
480
511
  catch (error) {
481
512
  this.fetchError.emit(error);
513
+ this.displayError();
482
514
  }
483
515
  };
484
516
  }
@@ -487,24 +519,35 @@ const MgInputCombobox = class {
487
519
  this.valueChange.emit(newValue);
488
520
  }
489
521
  watchItems(newValue) {
490
- if (Boolean(this.fetchurl) && !Boolean(newValue)) {
522
+ // fetch items
523
+ if (![undefined, null].includes(this.fetchurl) && [undefined, null].includes(newValue)) {
491
524
  // skip newValue check
492
525
  return;
493
526
  }
494
- else if (Boolean(this.fetchurl) && Boolean(newValue)) {
527
+ // invalid items
528
+ else if (![undefined, null].includes(this.fetchurl) && Array.isArray(newValue)) {
495
529
  throw new Error(`<mg-input-combobox> prop "items" values cannot be use with "fetchurl" prop defined. Passed value: ${index$1.toString(newValue)}.`);
496
530
  }
497
- // Empty options
498
- else if (Array.isArray(newValue) && newValue.length === 0) {
531
+ // Empty items
532
+ else if ([undefined, null].includes(newValue) || (Array.isArray(newValue) && newValue.length === 0)) {
499
533
  this.options = new index$1.Paginate([]);
534
+ this.displayError();
500
535
  }
501
536
  // String array
502
537
  else if (index$1.allItemsAreString(newValue)) {
503
538
  this.options = new index$1.Paginate(newValue.map(item => ({ title: item, value: item })), { total: newValue.length });
539
+ // force to reset error when noValueError is displayed
540
+ if (this.invalid && this.hasNoValueError()) {
541
+ this.resetErrorMessage();
542
+ }
504
543
  }
505
544
  // Object array
506
545
  else if (isItems(newValue)) {
507
546
  this.options = new index$1.Paginate(newValue, { total: newValue.length });
547
+ // force to reset error when noValueError is displayed
548
+ if (this.invalid && this.hasNoValueError()) {
549
+ this.resetErrorMessage();
550
+ }
508
551
  }
509
552
  else {
510
553
  throw new Error(`<mg-input-combobox> prop "items" values must be the same type, string or Option. Passed value: ${index$1.toString(newValue)}.`);
@@ -572,7 +615,7 @@ const MgInputCombobox = class {
572
615
  }
573
616
  }
574
617
  watchOptions(newValue) {
575
- this.page = newValue.getPage(0, Boolean(this.filter) ? this.optionsFilter : undefined);
618
+ this.page = newValue.getPage(0, this.filter.length > 0 ? this.optionsFilter : undefined);
576
619
  }
577
620
  watchFilter(newValue) {
578
621
  this.loadingWrapper({ name: 'load-data' });
@@ -638,8 +681,8 @@ const MgInputCombobox = class {
638
681
  throw new Error('<mg-input-combobox> method "setError()" param "errorMessage" must be a string.');
639
682
  }
640
683
  else {
641
- this.setValidity(valid);
642
- this.setErrorMessage(valid ? undefined : errorMessage);
684
+ this.setValidity(valid, errorMessage);
685
+ this.setErrorMessage();
643
686
  this.hasDisplayedError = this.invalid;
644
687
  }
645
688
  }
@@ -659,9 +702,7 @@ const MgInputCombobox = class {
659
702
  // - Keep everything in sync both inside and outside the component
660
703
  return new Promise(resolve => {
661
704
  requestAnimationFrame(() => {
662
- this.checkValidity();
663
- this.errorMessage = undefined;
664
- this.hasDisplayedError = false;
705
+ this.resetErrorMessage();
665
706
  resolve();
666
707
  });
667
708
  });
@@ -684,15 +725,34 @@ const MgInputCombobox = class {
684
725
  }
685
726
  /**
686
727
  * Method to set validity values
687
- * @param newValue - valid new value
728
+ * @param newValidValue - new valid value. `true` will bypass input check.
729
+ * @param customErrorMessage - custom error message
688
730
  */
689
- setValidity(newValue) {
731
+ setValidity(newValidValue, customErrorMessage) {
732
+ var _a;
690
733
  const oldValidValue = this.valid;
691
- this.valid = newValue;
734
+ let valid = newValidValue;
735
+ // Set custom validity
736
+ if (!valid && this.input !== undefined) {
737
+ // custom errror, start by reset it
738
+ this.customError = undefined;
739
+ if (index$1.isValidString(customErrorMessage)) {
740
+ this.customError = customErrorMessage;
741
+ }
742
+ // no value
743
+ else if ((this.fetchurl === undefined ? ((_a = this.items) !== null && _a !== void 0 ? _a : []).length : this.page.total) === 0) {
744
+ this.customError = mgInput_conf.CustomError.NoValue;
745
+ }
746
+ // get new input validity from validity state
747
+ valid = this.input.checkValidity() && this.customError === undefined;
748
+ }
749
+ // set valid/invalid props
750
+ this.valid = valid;
692
751
  this.invalid = !this.valid;
693
752
  // We need to send valid event even if it is the same value
694
- if (this.handlerInProgress === undefined || (this.handlerInProgress === 'blur' && this.valid !== oldValidValue))
753
+ if (this.handlerInProgress === undefined || (this.handlerInProgress === 'blur' && this.valid !== oldValidValue)) {
695
754
  this.inputValid.emit(this.valid);
755
+ }
696
756
  }
697
757
  /*************
698
758
  * Lifecycle *
@@ -733,15 +793,19 @@ const MgInputCombobox = class {
733
793
  const listId = `${this.identifier}-list`;
734
794
  const readonlyValue = this.getValueTitle();
735
795
  const withResetButton = this.value && !this.disabled;
796
+ const disabled = this.disabled || this.hasNoValueError();
736
797
  let popoverContent;
737
- if (((_a = this.page) === null || _a === void 0 ? void 0 : _a.items.length) > 0)
798
+ if (((_a = this.page) === null || _a === void 0 ? void 0 : _a.items.length) > 0) {
738
799
  popoverContent = 'list';
739
- else if (((_b = this.page) === null || _b === void 0 ? void 0 : _b.items.length) === 0 && Boolean(this.filter))
800
+ }
801
+ else if (((_b = this.page) === null || _b === void 0 ? void 0 : _b.items.length) === 0 && this.filter.length > 0) {
740
802
  popoverContent = 'notfound';
741
- else if (((_c = this.page) === null || _c === void 0 ? void 0 : _c.items.length) === 0)
803
+ }
804
+ else if (((_c = this.page) === null || _c === void 0 ? void 0 : _c.items.length) === 0) {
742
805
  popoverContent = 'notavailable';
806
+ }
743
807
  let activeDescendant;
744
- if (Boolean((_d = this.option) === null || _d === void 0 ? void 0 : _d.value)) {
808
+ if (![null, undefined].includes((_d = this.option) === null || _d === void 0 ? void 0 : _d.value)) {
745
809
  activeDescendant = this.option.value;
746
810
  }
747
811
  else if (typeof this.value === 'string') {
@@ -750,12 +814,12 @@ const MgInputCombobox = class {
750
814
  else {
751
815
  activeDescendant = (_e = this.value) === null || _e === void 0 ? void 0 : _e.value;
752
816
  }
753
- return (index.h("mg-input", { key: '08016aeb2db2bd5c700faa5951166a39d14dc045', label: this.label, identifier: this.identifier, class: this.classCollection.classes.join(' '), ariaDescribedbyIDs: popoverContent && popoverContent !== 'list' ? popoverContent : undefined, 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 ? (readonlyValue && index.h("b", { class: "mg-c-input__readonly-value" }, readonlyValue)) : (index.h("mg-popover", { identifier: this.popoverId, placement: "bottom-start", display: this.popoverDisplay, "arrow-hide": true, style: {
817
+ return (index.h("mg-input", { key: 'fa0977713a1150c39b4f989bbb139e0e345b4c5f', label: this.label, identifier: this.identifier, class: this.classCollection.classes.join(' '), ariaDescribedbyIDs: popoverContent && popoverContent !== 'list' ? popoverContent : undefined, 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: mgInput_utils.defineErrorMessage(this.errorMessage, this.noValueErrorDetail) }, this.readonly ? (readonlyValue && index.h("b", { class: "mg-c-input__readonly-value" }, readonlyValue)) : (index.h("mg-popover", { identifier: this.popoverId, placement: "bottom-start", display: this.popoverDisplay, "arrow-hide": true, style: {
754
818
  '--mg-c-input-list-width': Boolean((_f = this.input) === null || _f === void 0 ? void 0 : _f.offsetWidth) ? `${this.input.offsetWidth}px` : undefined,
755
- }, "data-fallback-placement": "bottom-end", "onDisplay-change": this.handlePopoverDisplay }, index.h("div", { class: "mg-c-input__input-group-container" }, index.h("mg-icon", { icon: "magnifying-glass" }), index.h("input", { type: "text", role: "combobox", class: "mg-c-input__box mg-c-input__box--width", value: this.filter, id: this.identifier, name: this.name, placeholder: this.placeholder, title: this.placeholder, disabled: this.disabled, required: this.required, autocomplete: "off", "aria-autocomplete": "list", "aria-expanded": this.popoverDisplay.toString(), "aria-controls": listId, "aria-invalid": (this.invalid === true).toString(), "aria-activedescendant": index$1.formatID(activeDescendant), onInput: this.handleFilterInput, onBlur: this.handleFilterBlur, onFocus: this.handleFilterFocus, onKeyDown: this.handleFilterKeydown, ref: (el) => {
819
+ }, "data-fallback-placement": "bottom-end", "onDisplay-change": this.handlePopoverDisplay }, index.h("div", { class: "mg-c-input__input-group-container" }, index.h("mg-icon", { icon: "magnifying-glass" }), index.h("input", { type: "text", role: "combobox", class: "mg-c-input__box mg-c-input__box--width", value: this.filter, id: this.identifier, name: this.name, placeholder: this.placeholder, title: this.placeholder, disabled: disabled, required: this.required, autocomplete: "off", "aria-autocomplete": "list", "aria-expanded": this.popoverDisplay.toString(), "aria-controls": listId, "aria-invalid": (this.invalid === true).toString(), "aria-activedescendant": index$1.formatID(activeDescendant), onInput: this.handleFilterInput, onBlur: this.handleFilterBlur, onFocus: this.handleFilterFocus, onKeyDown: this.handleFilterKeydown, ref: (el) => {
756
820
  if (el !== null)
757
821
  this.input = el;
758
- } }), withResetButton ? (index.h("mg-button", { class: "mg-c-input__box-append mg-c-input__reset", variant: "flat", "is-icon": true, label: this.messages.general.reset, "aria-controls": this.identifier, tabindex: "-1", onClick: this.handleResetButton }, index.h("mg-icon", { icon: "cross" }))) : (index.h("mg-button", { class: "mg-c-input__box-append", variant: "flat", "is-icon": true, label: this.itemsLabel, tabindex: "-1", disabled: this.disabled }, index.h("mg-icon", { icon: `chevron-${this.popoverDisplay ? 'up' : 'down'}` })))), index.h("div", { slot: "content", class: "mg-c-input__popover-container" }, popoverContent === 'list' && [
822
+ } }), withResetButton ? (index.h("mg-button", { class: "mg-c-input__box-append mg-c-input__reset", variant: "flat", "is-icon": true, label: this.messages.general.reset, "aria-controls": this.identifier, tabindex: "-1", onClick: this.handleResetButton, disabled: disabled }, index.h("mg-icon", { icon: "cross" }))) : (index.h("mg-button", { class: "mg-c-input__box-append", variant: "flat", "is-icon": true, label: this.itemsLabel, tabindex: "-1", disabled: disabled }, index.h("mg-icon", { icon: `chevron-${this.popoverDisplay ? 'up' : 'down'}` })))), index.h("div", { slot: "content", class: "mg-c-input__popover-container" }, popoverContent === 'list' && [
759
823
  // eslint-disable-next-line jsx-a11y/role-supports-aria-props
760
824
  index.h("ul", { key: "list", class: "mg-c-input__input-list", role: "listbox", id: listId, "aria-label": this.itemsLabel, "aria-setsize": this.page.total }, this.page.items.map(option => {
761
825
  var _a;
@@ -771,7 +835,7 @@ const MgInputCombobox = class {
771
835
  this.page.next && (index.h("mg-button", { key: "load-more", variant: "flat", class: "mg-c-input__load-more", tabIndex: -1, disabled: this.isLoading, "full-width": true, "disable-on-click": true, onClick: this.handleLoadMoreButton, "aria-controls": listId, ref: (el) => {
772
836
  if (el !== null)
773
837
  this.loadMoreElement = el;
774
- } }, index.h("mg-icon", { icon: "chevron-down" }), this.messages.input.combobox.loadMore)),
838
+ } }, index.h("mg-icon", { icon: "chevron-down" }), this.messages.input.showMore)),
775
839
  ], popoverContent === 'notfound' && (index.h("p", { id: popoverContent, class: "mg-c-input__popover-info" }, this.messages.input.combobox.notFound)), popoverContent === 'notavailable' && (index.h("p", { id: popoverContent, class: "mg-c-input__popover-info" }, this.messages.input.combobox.notAvailable)))))));
776
840
  }
777
841
  get element() { return index.getElement(this); }