@mgdis/mg-components 6.10.1 → 6.11.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.
- package/dist/cjs/{index-CL_COdxv.js → index-B_WwxtkQ.js} +4 -4
- package/dist/cjs/{index-CL_COdxv.js.map → index-B_WwxtkQ.js.map} +1 -1
- package/dist/cjs/{index.es-DaPqByCe.js → index.es-C-3Gv8Eu.js} +47 -43
- package/dist/cjs/index.es-C-3Gv8Eu.js.map +1 -0
- package/dist/cjs/mg-action-more_37.cjs.entry.js +186 -187
- package/dist/cjs/mg-action-more_37.cjs.entry.js.map +1 -1
- package/dist/cjs/mg-alert.cjs.entry.js +6 -6
- package/dist/cjs/mg-input-combobox.cjs.entry.js +74 -71
- package/dist/cjs/mg-input-combobox.cjs.entry.js.map +1 -1
- package/dist/cjs/mg-input-combobox.entry.cjs.js.map +1 -1
- package/dist/cjs/mg-input-rich-text-editor.cjs.entry.js +6 -6
- package/dist/cjs/mg-loader.cjs.entry.js +3 -3
- package/dist/cjs/mg-progress.cjs.entry.js +9 -9
- package/dist/collection/components/atoms/mg-button/mg-button.js +1 -1
- package/dist/collection/components/atoms/mg-button/mg-button.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.conf.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js +67 -45
- package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +25 -30
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js.map +1 -1
- package/dist/collection/components/molecules/mg-details/mg-details.js +5 -1
- package/dist/collection/components/molecules/mg-details/mg-details.js.map +1 -1
- package/dist/components/index.es.js +40 -37
- package/dist/components/index.es.js.map +1 -1
- package/dist/components/index2.js +2 -2
- package/dist/components/mg-action-more.js +6 -6
- package/dist/components/mg-alert.js +5 -5
- package/dist/components/mg-badge2.js +5 -5
- package/dist/components/mg-button2.js +6 -6
- package/dist/components/mg-button2.js.map +1 -1
- package/dist/components/mg-character-left2.js +4 -4
- package/dist/components/mg-details.js +6 -2
- package/dist/components/mg-details.js.map +1 -1
- package/dist/components/mg-form.js +7 -7
- package/dist/components/mg-icon2.js +6 -6
- package/dist/components/mg-illustrated-message.js +5 -5
- package/dist/components/mg-input-checkbox.js +5 -5
- package/dist/components/mg-input-combobox.js +73 -70
- package/dist/components/mg-input-combobox.js.map +1 -1
- package/dist/components/mg-input-date.js +14 -14
- package/dist/components/mg-input-numeric.js +11 -11
- package/dist/components/mg-input-password.js +2 -2
- package/dist/components/mg-input-radio.js +6 -6
- package/dist/components/mg-input-rich-text-editor.js +5 -5
- package/dist/components/mg-input-select2.js +31 -36
- package/dist/components/mg-input-select2.js.map +1 -1
- package/dist/components/mg-input-text2.js +6 -6
- package/dist/components/mg-input-textarea.js +5 -5
- package/dist/components/mg-input-title2.js +3 -3
- package/dist/components/mg-input-toggle.js +5 -5
- package/dist/components/mg-input2.js +6 -6
- package/dist/components/mg-item-more2.js +7 -7
- package/dist/components/mg-loader2.js +2 -2
- package/dist/components/mg-menu-item2.js +8 -8
- package/dist/components/mg-message2.js +4 -4
- package/dist/components/mg-modal.js +7 -7
- package/dist/components/mg-pagination2.js +6 -6
- package/dist/components/mg-panel.js +8 -8
- package/dist/components/mg-popover-content2.js +3 -3
- package/dist/components/mg-popover2.js +5 -5
- package/dist/components/mg-progress.js +9 -9
- package/dist/components/mg-table.js +5 -5
- package/dist/components/mg-tabs.js +11 -11
- package/dist/components/mg-tag.js +3 -3
- package/dist/components/mg-tooltip2.js +8 -8
- package/dist/esm/{index-DALWFL9i.js → index-DHpyFawS.js} +4 -4
- package/dist/esm/{index-DALWFL9i.js.map → index-DHpyFawS.js.map} +1 -1
- package/dist/esm/{index.es-hNwGkhG6.js → index.es-lyrZ9KRh.js} +42 -39
- package/dist/esm/index.es-lyrZ9KRh.js.map +1 -0
- package/dist/esm/mg-action-more_37.entry.js +186 -187
- package/dist/esm/mg-action-more_37.entry.js.map +1 -1
- package/dist/esm/mg-alert.entry.js +6 -6
- package/dist/esm/mg-input-combobox.entry.js +74 -71
- package/dist/esm/mg-input-combobox.entry.js.map +1 -1
- package/dist/esm/mg-input-rich-text-editor.entry.js +6 -6
- package/dist/esm/mg-loader.entry.js +3 -3
- package/dist/esm/mg-progress.entry.js +9 -9
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/mg-input-combobox.entry.esm.js.map +1 -1
- package/dist/mg-components/{p-bf5de898.entry.js → p-596c0e08.entry.js} +2 -2
- package/dist/mg-components/p-8a3bd8ad.entry.js +2 -0
- package/dist/mg-components/p-8a3bd8ad.entry.js.map +1 -0
- package/dist/mg-components/p-98a74b62.entry.js +2 -0
- package/dist/mg-components/{p-a52a168c.entry.js.map → p-98a74b62.entry.js.map} +1 -1
- package/dist/mg-components/{p-Cg3R_y_o.js → p-C-vIqOyI.js} +2 -2
- package/dist/mg-components/{p-Cg3R_y_o.js.map → p-C-vIqOyI.js.map} +1 -1
- package/dist/mg-components/{p-e33557f9.entry.js → p-d4ed3aad.entry.js} +2 -2
- package/dist/mg-components/p-e822bd96.entry.js +2 -0
- package/dist/mg-components/{p-352cfc01.entry.js.map → p-e822bd96.entry.js.map} +1 -1
- package/dist/mg-components/p-fc7b96e6.entry.js +2 -0
- package/dist/mg-components/p-fc7b96e6.entry.js.map +1 -0
- package/dist/mg-components/p-lyrZ9KRh.js +2 -0
- package/dist/mg-components/p-lyrZ9KRh.js.map +1 -0
- package/dist/types/components/molecules/inputs/mg-input-combobox/mg-input-combobox.conf.d.ts +1 -1
- package/dist/types/components/molecules/inputs/mg-input-combobox/mg-input-combobox.d.ts +5 -0
- package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +0 -9
- package/dist/types/components/molecules/mg-details/mg-details.d.ts +1 -0
- package/dist/types/components.d.ts +5 -0
- package/ide/intellij/web-types.json +6 -2
- package/ide/vscode/html-custom-data.json +1 -1
- package/package.json +8 -8
- package/dist/cjs/index.es-DaPqByCe.js.map +0 -1
- package/dist/esm/index.es-hNwGkhG6.js.map +0 -1
- package/dist/mg-components/p-352cfc01.entry.js +0 -2
- package/dist/mg-components/p-68f7de47.entry.js +0 -2
- package/dist/mg-components/p-68f7de47.entry.js.map +0 -1
- package/dist/mg-components/p-a52a168c.entry.js +0 -2
- package/dist/mg-components/p-dcefa0b0.entry.js +0 -2
- package/dist/mg-components/p-dcefa0b0.entry.js.map +0 -1
- package/dist/mg-components/p-hNwGkhG6.js +0 -2
- package/dist/mg-components/p-hNwGkhG6.js.map +0 -1
- /package/dist/mg-components/{p-bf5de898.entry.js.map → p-596c0e08.entry.js.map} +0 -0
- /package/dist/mg-components/{p-e33557f9.entry.js.map → p-d4ed3aad.entry.js.map} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-CATFkm3O.js');
|
|
4
|
-
var index_es = require('./index.es-
|
|
5
|
-
var index$1 = require('./index-
|
|
4
|
+
var index_es = require('./index.es-C-3Gv8Eu.js');
|
|
5
|
+
var index$1 = require('./index-B_WwxtkQ.js');
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* List available variants
|
|
@@ -42,7 +42,7 @@ const MgAlert = class {
|
|
|
42
42
|
/**
|
|
43
43
|
* Component classes
|
|
44
44
|
*/
|
|
45
|
-
this.classCollection = new index_es.
|
|
45
|
+
this.classCollection = new index_es.qt(['mg-c-alert']);
|
|
46
46
|
/**
|
|
47
47
|
* Define if component is using actions slot
|
|
48
48
|
*/
|
|
@@ -86,17 +86,17 @@ const MgAlert = class {
|
|
|
86
86
|
}
|
|
87
87
|
watchDelay(newValue) {
|
|
88
88
|
if (newValue !== undefined && newValue < 2) {
|
|
89
|
-
throw new Error(`<mg-alert> prop "delay" must be greater than 2 seconds. Passed value: ${index_es.
|
|
89
|
+
throw new Error(`<mg-alert> prop "delay" must be greater than 2 seconds. Passed value: ${index_es.Yt(newValue)}.`);
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
watchVariant(newValue) {
|
|
93
93
|
if (newValue && !variants.includes(newValue)) {
|
|
94
|
-
throw new Error(`<mg-alert> prop "variant" must be one of: ${variants.join(', ')}. Passed value: ${index_es.
|
|
94
|
+
throw new Error(`<mg-alert> prop "variant" must be one of: ${variants.join(', ')}. Passed value: ${index_es.Yt(newValue)}.`);
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
watchVariantStyle(newValue) {
|
|
98
98
|
if (newValue && !variantStyles.includes(newValue)) {
|
|
99
|
-
throw new Error(`<mg-alert> prop "variantStyle" must be one of: ${variantStyles.join(', ')}. Passed value: ${index_es.
|
|
99
|
+
throw new Error(`<mg-alert> prop "variantStyle" must be one of: ${variantStyles.join(', ')}. Passed value: ${index_es.Yt(newValue)}.`);
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
/**
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-CATFkm3O.js');
|
|
4
|
-
var index_es = require('./index.es-
|
|
4
|
+
var index_es = require('./index.es-C-3Gv8Eu.js');
|
|
5
5
|
var mgInput_conf = require('./mg-input.conf-WTsvDfpC.js');
|
|
6
|
-
var index$1 = require('./index-
|
|
6
|
+
var index$1 = require('./index-B_WwxtkQ.js');
|
|
7
7
|
var events_utils = require('./events.utils-D5SAtkpQ.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);word-break:break-word}.mg-u-visually-hidden{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip:rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;clip-path:inset(50%) !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){*{animation:none !important;transition:none !important}}.mg-c-input.mg-c-input--combobox mg-popover{--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-
|
|
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);word-break:break-word}.mg-u-visually-hidden{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip:rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;clip-path:inset(50%) !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){*{animation:none !important;transition:none !important}}.mg-c-input.mg-c-input--combobox mg-popover{--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}";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Check if object is an item
|
|
@@ -26,10 +26,10 @@ const isItems = (items) => Array.isArray(items) && items.every(isItem);
|
|
|
26
26
|
* @returns truthy if mapping is valid
|
|
27
27
|
*/
|
|
28
28
|
const isFetchmappings = (value) => {
|
|
29
|
-
const isValidRoot = index_es.
|
|
29
|
+
const isValidRoot = index_es.K(value) && Object.hasOwn(value, 'request') && Object.hasOwn(value, 'response');
|
|
30
30
|
if (isValidRoot) {
|
|
31
31
|
const { request, response } = value;
|
|
32
|
-
if ([request, response].some(property => !index_es.
|
|
32
|
+
if ([request, response].some(property => !index_es.K(property)))
|
|
33
33
|
return false;
|
|
34
34
|
const isValidRequest = typeof request.filter === 'string';
|
|
35
35
|
const isValidResponse = typeof response === 'object' &&
|
|
@@ -37,35 +37,13 @@ const isFetchmappings = (value) => {
|
|
|
37
37
|
typeof response.items === 'string' &&
|
|
38
38
|
typeof response.next === 'string' &&
|
|
39
39
|
typeof response.itemTitle === 'string' &&
|
|
40
|
-
typeof response.itemValue === 'string';
|
|
40
|
+
(typeof response.itemValue === 'string' || response.itemValue === undefined);
|
|
41
41
|
return isValidRequest && isValidResponse;
|
|
42
42
|
}
|
|
43
43
|
else {
|
|
44
44
|
return isValidRoot;
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
|
-
/**
|
|
48
|
-
* Map new URL from old url
|
|
49
|
-
* @param newValue - new URL value
|
|
50
|
-
* @param oldValue - previous URL value
|
|
51
|
-
* @returns updated url
|
|
52
|
-
*/
|
|
53
|
-
const mapUrl = (newValue, oldValue) => {
|
|
54
|
-
if (!Boolean(newValue))
|
|
55
|
-
return;
|
|
56
|
-
else if (URL.canParse(newValue)) {
|
|
57
|
-
return newValue;
|
|
58
|
-
}
|
|
59
|
-
// build new URL
|
|
60
|
-
const params = newValue.includes('?') && newValue.split('?').pop();
|
|
61
|
-
if (Boolean(params)) {
|
|
62
|
-
const { origin, pathname } = new URL(oldValue);
|
|
63
|
-
return `${origin}${pathname}?${params}`;
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
return newValue;
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
47
|
const MgInputCombobox = class {
|
|
70
48
|
constructor(hostRef) {
|
|
71
49
|
index.registerInstance(this, hostRef);
|
|
@@ -73,6 +51,7 @@ const MgInputCombobox = class {
|
|
|
73
51
|
this.filterChange = index.createEvent(this, "filter-change");
|
|
74
52
|
this.loadMore = index.createEvent(this, "load-more");
|
|
75
53
|
this.inputValid = index.createEvent(this, "input-valid");
|
|
54
|
+
this.fetchError = index.createEvent(this, "fetch-error");
|
|
76
55
|
/************
|
|
77
56
|
* Internal *
|
|
78
57
|
************/
|
|
@@ -116,7 +95,7 @@ const MgInputCombobox = class {
|
|
|
116
95
|
/**
|
|
117
96
|
* Formated items for display
|
|
118
97
|
*/
|
|
119
|
-
this.options = new index_es.
|
|
98
|
+
this.options = new index_es.rr([]);
|
|
120
99
|
/**
|
|
121
100
|
* Option filter
|
|
122
101
|
*/
|
|
@@ -124,7 +103,7 @@ const MgInputCombobox = class {
|
|
|
124
103
|
/**
|
|
125
104
|
* Component classes
|
|
126
105
|
*/
|
|
127
|
-
this.classCollection = new index_es.
|
|
106
|
+
this.classCollection = new index_es.qt(['mg-c-input--combobox', 'mg-c-input--has-icon', 'mg-c-input--input-append']);
|
|
128
107
|
/**
|
|
129
108
|
* Popover display state
|
|
130
109
|
*/
|
|
@@ -134,7 +113,7 @@ const MgInputCombobox = class {
|
|
|
134
113
|
* @param event - option element click event
|
|
135
114
|
*/
|
|
136
115
|
this.handleOptionClick = (event) => {
|
|
137
|
-
this.setValue(this.options.items.find(option => option.value === event.target.id));
|
|
116
|
+
this.setValue(this.options.items.find(option => index_es.Ht(option.value) === event.target.id));
|
|
138
117
|
this.popoverDisplay = false;
|
|
139
118
|
};
|
|
140
119
|
/**
|
|
@@ -162,7 +141,14 @@ const MgInputCombobox = class {
|
|
|
162
141
|
this.setErrorMessage();
|
|
163
142
|
if (!this.popoverDisplay)
|
|
164
143
|
this.popoverDisplay = true;
|
|
165
|
-
|
|
144
|
+
// update filter with debounce to prevent filter update overload
|
|
145
|
+
if (!this.debounce) {
|
|
146
|
+
this.debounce = true;
|
|
147
|
+
setTimeout(() => {
|
|
148
|
+
this.filter = this.input.value;
|
|
149
|
+
this.debounce = false;
|
|
150
|
+
}, 250);
|
|
151
|
+
}
|
|
166
152
|
};
|
|
167
153
|
/**
|
|
168
154
|
* Handle `blur` event
|
|
@@ -191,7 +177,7 @@ const MgInputCombobox = class {
|
|
|
191
177
|
* Handle load-more <mg-button> `click`
|
|
192
178
|
*/
|
|
193
179
|
this.handleLoadMoreButton = () => {
|
|
194
|
-
this.loadingWrapper({ name: 'load-more', cursor: index_es.
|
|
180
|
+
this.loadingWrapper({ name: 'load-more', cursor: index_es.tr.NEXT }).then(() => {
|
|
195
181
|
this.input.focus();
|
|
196
182
|
});
|
|
197
183
|
};
|
|
@@ -237,14 +223,14 @@ const MgInputCombobox = class {
|
|
|
237
223
|
// If the filter is empty and the popover is not displayed, opens the popover and moves visual focus to the first option.
|
|
238
224
|
// Moves visual focus to the next option.
|
|
239
225
|
// If visual focus is on the last option, moves visual focus to the first option.
|
|
240
|
-
cursor = isNavigationStart ? index_es.
|
|
226
|
+
cursor = isNavigationStart ? index_es.tr.NEXT : index_es.tr.FIRST;
|
|
241
227
|
}
|
|
242
228
|
else if ([events_utils.Keys.UP, events_utils.Keys.ARROWUP].includes(event.key)) {
|
|
243
229
|
// If the filter is not empty and the popover is displayed, moves visual focus to the last suggested value.
|
|
244
230
|
// If the filter is empty, first opens the popover if it is not already displayed and then moves visual focus to the last option.
|
|
245
231
|
// Moves visual focus to the previous option.
|
|
246
232
|
// If visual focus is on the first option, moves visual focus to the last option.
|
|
247
|
-
cursor = isNavigationStart ? index_es.
|
|
233
|
+
cursor = isNavigationStart ? index_es.tr.PREVIOUS : index_es.tr.LAST;
|
|
248
234
|
}
|
|
249
235
|
// update scroll and visual focused option in wrapper
|
|
250
236
|
this.loadingWrapper({ name: 'scroll', cursor });
|
|
@@ -381,7 +367,7 @@ const MgInputCombobox = class {
|
|
|
381
367
|
this.isLoading = true;
|
|
382
368
|
promise = this.goToNextPage;
|
|
383
369
|
}
|
|
384
|
-
else if (action.cursor === index_es.
|
|
370
|
+
else if (action.cursor === index_es.tr.NEXT &&
|
|
385
371
|
this.page.items.length <= this.page.total &&
|
|
386
372
|
index + this.page.baseIndex === this.page.items.length &&
|
|
387
373
|
index + this.page.baseIndex < this.page.total) {
|
|
@@ -390,7 +376,7 @@ const MgInputCombobox = class {
|
|
|
390
376
|
return;
|
|
391
377
|
}
|
|
392
378
|
else if (action.name === 'scroll') {
|
|
393
|
-
promise = index_es.
|
|
379
|
+
promise = index_es.er;
|
|
394
380
|
}
|
|
395
381
|
else {
|
|
396
382
|
promise = this.updatePage;
|
|
@@ -428,14 +414,14 @@ const MgInputCombobox = class {
|
|
|
428
414
|
// merge items from current page and next page
|
|
429
415
|
const items = [...this.page.items, ...nextPage.items];
|
|
430
416
|
// create new options pagination withe merged items
|
|
431
|
-
this.options = new index_es.
|
|
417
|
+
this.options = new index_es.rr(items, { total: nextPage.total, next: nextPage.next, top: items.length });
|
|
432
418
|
});
|
|
433
419
|
}
|
|
434
420
|
else {
|
|
435
|
-
return index_es.
|
|
421
|
+
return index_es.er(() => {
|
|
436
422
|
if (typeof this.page.next === 'function') {
|
|
437
423
|
const nextPage = this.page.next();
|
|
438
|
-
this.page = new index_es.
|
|
424
|
+
this.page = new index_es.Je(Object.assign(Object.assign({}, nextPage), { items: [...this.page.items, ...nextPage.items] }));
|
|
439
425
|
}
|
|
440
426
|
});
|
|
441
427
|
}
|
|
@@ -450,7 +436,7 @@ const MgInputCombobox = class {
|
|
|
450
436
|
if (!Boolean(page))
|
|
451
437
|
return;
|
|
452
438
|
// reset current options pagination from API response
|
|
453
|
-
this.options = new index_es.
|
|
439
|
+
this.options = new index_es.rr(page.items, { total: page.total, next: page.next, top: page.top });
|
|
454
440
|
});
|
|
455
441
|
}
|
|
456
442
|
else {
|
|
@@ -466,18 +452,23 @@ const MgInputCombobox = class {
|
|
|
466
452
|
// add text filter
|
|
467
453
|
const updateUrl = (typeof url === 'string' ? url : url.toString()).replaceAll(this.fetchmappings.request.filter, encodeURIComponent(this.filter));
|
|
468
454
|
try {
|
|
469
|
-
const response = await fetch(updateUrl, this.fetchoptions)
|
|
470
|
-
if (!response)
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
455
|
+
const response = await fetch(updateUrl, this.fetchoptions);
|
|
456
|
+
if (!response.ok) {
|
|
457
|
+
this.fetchError.emit(new Error(`${response.status} - ${response.statusText}`));
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
const json = await response.json();
|
|
461
|
+
const items = index_es.Ge(json, this.fetchmappings.response.items).map((item) => ({
|
|
462
|
+
title: index_es.Ge(item, this.fetchmappings.response.itemTitle),
|
|
463
|
+
value: this.fetchmappings.response.itemValue ? index_es.Ge(item, this.fetchmappings.response.itemValue) : item,
|
|
475
464
|
}));
|
|
476
|
-
const total = Number(index_es.
|
|
477
|
-
const next =
|
|
465
|
+
const total = Number(index_es.Ge(json, this.fetchmappings.response.total, 0));
|
|
466
|
+
const next = index_es.Ge(json, this.fetchmappings.response.next);
|
|
478
467
|
return { items, total, next, top: items.length };
|
|
479
468
|
}
|
|
480
|
-
catch (
|
|
469
|
+
catch (error) {
|
|
470
|
+
this.fetchError.emit(error);
|
|
471
|
+
}
|
|
481
472
|
};
|
|
482
473
|
}
|
|
483
474
|
watchValue(newValue) {
|
|
@@ -490,22 +481,22 @@ const MgInputCombobox = class {
|
|
|
490
481
|
return;
|
|
491
482
|
}
|
|
492
483
|
else if (Boolean(this.fetchurl) && Boolean(newValue)) {
|
|
493
|
-
throw new Error(`<mg-input-combobox> prop "items" values cannot be use with "fetchurl" prop defined. Passed value: ${index_es.
|
|
484
|
+
throw new Error(`<mg-input-combobox> prop "items" values cannot be use with "fetchurl" prop defined. Passed value: ${index_es.Yt(newValue)}.`);
|
|
494
485
|
}
|
|
495
486
|
// Empty options
|
|
496
487
|
else if (Array.isArray(newValue) && newValue.length === 0) {
|
|
497
|
-
this.options = new index_es.
|
|
488
|
+
this.options = new index_es.rr([]);
|
|
498
489
|
}
|
|
499
490
|
// String array
|
|
500
|
-
else if (index_es.
|
|
501
|
-
this.options = new index_es.
|
|
491
|
+
else if (index_es.Gt(newValue)) {
|
|
492
|
+
this.options = new index_es.rr(newValue.map(item => ({ title: item, value: item })), { total: newValue.length });
|
|
502
493
|
}
|
|
503
494
|
// Object array
|
|
504
495
|
else if (isItems(newValue)) {
|
|
505
|
-
this.options = new index_es.
|
|
496
|
+
this.options = new index_es.rr(newValue, { total: newValue.length });
|
|
506
497
|
}
|
|
507
498
|
else {
|
|
508
|
-
throw new Error(`<mg-input-combobox> prop "items" values must be the same type, string or Option. Passed value: ${index_es.
|
|
499
|
+
throw new Error(`<mg-input-combobox> prop "items" values must be the same type, string or Option. Passed value: ${index_es.Yt(newValue)}.`);
|
|
509
500
|
}
|
|
510
501
|
}
|
|
511
502
|
watchIdentifier(newValue) {
|
|
@@ -546,16 +537,16 @@ const MgInputCombobox = class {
|
|
|
546
537
|
// apply new width
|
|
547
538
|
if (newValue !== undefined)
|
|
548
539
|
this.classCollection.add(`mg-c-input--width-${this.mgWidth}`);
|
|
549
|
-
this.classCollection = new index_es.
|
|
540
|
+
this.classCollection = new index_es.qt(this.classCollection.classes);
|
|
550
541
|
}
|
|
551
542
|
watchFetchUrl(newValue) {
|
|
552
|
-
if (
|
|
553
|
-
|
|
543
|
+
if (Boolean(newValue)) {
|
|
544
|
+
this.loadingWrapper({ name: 'load-data' });
|
|
554
545
|
}
|
|
555
546
|
}
|
|
556
547
|
watchFetchOptions(newValue) {
|
|
557
|
-
if (this.fetchurl && newValue && !index_es.
|
|
558
|
-
throw new Error(`<mg-input-combobox> prop "fetchoptions" value must be a valid RequestInit. Passed value: ${index_es.
|
|
548
|
+
if (this.fetchurl && newValue && !index_es.K(newValue)) {
|
|
549
|
+
throw new Error(`<mg-input-combobox> prop "fetchoptions" value must be a valid RequestInit. Passed value: ${index_es.Yt(newValue)}.`);
|
|
559
550
|
}
|
|
560
551
|
else {
|
|
561
552
|
new Request(this.fetchurl, newValue);
|
|
@@ -566,7 +557,7 @@ const MgInputCombobox = class {
|
|
|
566
557
|
throw new Error(`<mg-input-combobox> prop "fetchmappings" is required with "fetchurl" prop.`);
|
|
567
558
|
}
|
|
568
559
|
else if (Boolean(newValue) && !isFetchmappings(newValue)) {
|
|
569
|
-
throw new Error(`<mg-input-combobox> prop "fetchmappings" value must be { request: RequestMappingType, response: ResponseMappingType }. Passed value: ${index_es.
|
|
560
|
+
throw new Error(`<mg-input-combobox> prop "fetchmappings" value must be { request: RequestMappingType, response: ResponseMappingType }. Passed value: ${index_es.Yt(newValue)}.`);
|
|
570
561
|
}
|
|
571
562
|
}
|
|
572
563
|
watchOptions(newValue) {
|
|
@@ -662,8 +653,11 @@ const MgInputCombobox = class {
|
|
|
662
653
|
if (!isItem(newValue)) {
|
|
663
654
|
this.value = '';
|
|
664
655
|
}
|
|
656
|
+
else if (index_es.Gt(this.items || this.options.items)) {
|
|
657
|
+
this.value = newValue.title;
|
|
658
|
+
}
|
|
665
659
|
else {
|
|
666
|
-
this.value =
|
|
660
|
+
this.value = Object.assign({}, newValue);
|
|
667
661
|
}
|
|
668
662
|
}
|
|
669
663
|
/**
|
|
@@ -692,7 +686,6 @@ const MgInputCombobox = class {
|
|
|
692
686
|
this.watchIdentifier(this.identifier);
|
|
693
687
|
this.watchItems(this.items);
|
|
694
688
|
if (Boolean(this.fetchurl)) {
|
|
695
|
-
this.watchFetchUrl(this.fetchurl);
|
|
696
689
|
this.watchFetchOptions(this.fetchoptions);
|
|
697
690
|
this.watchFetchMappings(this.fetchmappings);
|
|
698
691
|
this.loadingWrapper({ name: 'load-data' });
|
|
@@ -725,22 +718,32 @@ const MgInputCombobox = class {
|
|
|
725
718
|
popoverContent = 'notfound';
|
|
726
719
|
else if (((_c = this.page) === null || _c === void 0 ? void 0 : _c.items.length) === 0)
|
|
727
720
|
popoverContent = 'notavailable';
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
721
|
+
let activeDescendant;
|
|
722
|
+
if (Boolean((_d = this.option) === null || _d === void 0 ? void 0 : _d.value)) {
|
|
723
|
+
activeDescendant = this.option.value;
|
|
724
|
+
}
|
|
725
|
+
else if (typeof this.value === 'string') {
|
|
726
|
+
activeDescendant = this.value;
|
|
727
|
+
}
|
|
728
|
+
else {
|
|
729
|
+
activeDescendant = (_e = this.value) === null || _e === void 0 ? void 0 : _e.value;
|
|
730
|
+
}
|
|
731
|
+
return (index.h("mg-input", { key: '9247630e9b86d6ca8e9e57089454551cf31f5531', label: this.label, identifier: this.identifier, class: this.classCollection.classes.join(' '), ariaDescribedbyIDs: popoverContent && popoverContent !== 'list' ? [popoverContent] : [], 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: {
|
|
732
|
+
'--mg-c-input-list-width': Boolean((_f = this.input) === null || _f === void 0 ? void 0 : _f.offsetWidth) ? `${this.input.offsetWidth}px` : undefined,
|
|
733
|
+
}, "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_es.Ht(activeDescendant), onInput: this.handleFilterInput, onBlur: this.handleFilterBlur, onFocus: this.handleFilterFocus, onKeyDown: this.handleFilterKeydown, ref: (el) => {
|
|
732
734
|
if (el !== null)
|
|
733
735
|
this.input = el;
|
|
734
|
-
} }), withResetButton
|
|
736
|
+
} }), 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' && [
|
|
735
737
|
// eslint-disable-next-line jsx-a11y/role-supports-aria-props
|
|
736
738
|
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 => {
|
|
739
|
+
var _a;
|
|
737
740
|
return (
|
|
738
741
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events
|
|
739
742
|
index.h("li", { role: "option", class: {
|
|
740
743
|
'mg-c-input__input-list-item': true,
|
|
741
|
-
'mg-c-input__input-list-item--focus-visible': this.option === option,
|
|
744
|
+
'mg-c-input__input-list-item--focus-visible': JSON.stringify((_a = this.option) === null || _a === void 0 ? void 0 : _a.value) === JSON.stringify(option.value),
|
|
742
745
|
'mg-c-input__input-list-item--selected': this.isCurrentOption(option),
|
|
743
|
-
}, key: option.title, id: option.value
|
|
746
|
+
}, key: option.title, id: index_es.Ht(option.value), "aria-selected": this.isCurrentOption(option).toString(), onClick: this.handleOptionClick }, option.title, this.isCurrentOption(option) && index.h("mg-icon", { icon: "check" })));
|
|
744
747
|
})),
|
|
745
748
|
this.isLoading && index.h("mg-loader", { key: "loader", message: this.messages.input.combobox.search, class: { 'mg-u-visually-hidden': Boolean(this.page.next) } }),
|
|
746
749
|
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) => {
|