@ukic/web-components 3.25.0 → 3.27.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/components/OpenInNew.js +5 -0
- package/components/OpenInNew.js.map +1 -0
- package/components/check-icon.js +8 -0
- package/components/check-icon.js.map +1 -0
- package/components/chevron-icon.js +8 -0
- package/components/chevron-icon.js.map +1 -0
- package/components/close-icon.js +10 -0
- package/components/close-icon.js.map +1 -0
- package/components/constants.js +184 -0
- package/components/constants.js.map +1 -0
- package/components/custom-elements.d.ts +2 -0
- package/components/helpers.js +547 -0
- package/components/helpers.js.map +1 -0
- package/components/ic-accordion-group.d.ts +11 -0
- package/components/ic-accordion-group.js +191 -0
- package/components/ic-accordion-group.js.map +1 -0
- package/components/ic-accordion.d.ts +11 -0
- package/components/ic-accordion.js +188 -0
- package/components/ic-accordion.js.map +1 -0
- package/components/ic-action-chip.d.ts +11 -0
- package/components/ic-action-chip.js +164 -0
- package/components/ic-action-chip.js.map +1 -0
- package/components/ic-alert.d.ts +11 -0
- package/components/ic-alert.js +193 -0
- package/components/ic-alert.js.map +1 -0
- package/components/ic-back-to-top.d.ts +11 -0
- package/components/ic-back-to-top.js +216 -0
- package/components/ic-back-to-top.js.map +1 -0
- package/components/ic-badge.d.ts +11 -0
- package/components/ic-badge.js +222 -0
- package/components/ic-badge.js.map +1 -0
- package/components/ic-breadcrumb-group.d.ts +11 -0
- package/components/ic-breadcrumb-group.js +278 -0
- package/components/ic-breadcrumb-group.js.map +1 -0
- package/components/ic-breadcrumb.d.ts +11 -0
- package/components/ic-breadcrumb.js +8 -0
- package/components/ic-breadcrumb.js.map +1 -0
- package/components/ic-breadcrumb2.js +145 -0
- package/components/ic-breadcrumb2.js.map +1 -0
- package/components/ic-button.d.ts +11 -0
- package/components/ic-button.js +8 -0
- package/components/ic-button.js.map +1 -0
- package/components/ic-button2.js +509 -0
- package/components/ic-button2.js.map +1 -0
- package/components/ic-card-horizontal.d.ts +11 -0
- package/components/ic-card-horizontal.js +214 -0
- package/components/ic-card-horizontal.js.map +1 -0
- package/components/ic-card-vertical.d.ts +11 -0
- package/components/ic-card-vertical.js +219 -0
- package/components/ic-card-vertical.js.map +1 -0
- package/components/ic-checkbox-group.d.ts +11 -0
- package/components/ic-checkbox-group.js +198 -0
- package/components/ic-checkbox-group.js.map +1 -0
- package/components/ic-checkbox.d.ts +11 -0
- package/components/ic-checkbox.js +202 -0
- package/components/ic-checkbox.js.map +1 -0
- package/components/ic-chip.d.ts +11 -0
- package/components/ic-chip.js +183 -0
- package/components/ic-chip.js.map +1 -0
- package/components/ic-classification-banner.d.ts +11 -0
- package/components/ic-classification-banner.js +102 -0
- package/components/ic-classification-banner.js.map +1 -0
- package/components/ic-data-list.d.ts +11 -0
- package/components/ic-data-list.js +63 -0
- package/components/ic-data-list.js.map +1 -0
- package/components/ic-data-row.d.ts +11 -0
- package/components/ic-data-row.js +115 -0
- package/components/ic-data-row.js.map +1 -0
- package/components/ic-dialog.d.ts +11 -0
- package/components/ic-dialog.js +366 -0
- package/components/ic-dialog.js.map +1 -0
- package/components/ic-divider.d.ts +11 -0
- package/components/ic-divider.js +8 -0
- package/components/ic-divider.js.map +1 -0
- package/components/ic-divider2.js +148 -0
- package/components/ic-divider2.js.map +1 -0
- package/components/ic-empty-state.d.ts +11 -0
- package/components/ic-empty-state.js +82 -0
- package/components/ic-empty-state.js.map +1 -0
- package/components/ic-footer-link-group.d.ts +11 -0
- package/components/ic-footer-link-group.js +101 -0
- package/components/ic-footer-link-group.js.map +1 -0
- package/components/ic-footer-link.d.ts +11 -0
- package/components/ic-footer-link.js +95 -0
- package/components/ic-footer-link.js.map +1 -0
- package/components/ic-footer.d.ts +11 -0
- package/components/ic-footer.js +156 -0
- package/components/ic-footer.js.map +1 -0
- package/components/ic-hero.d.ts +11 -0
- package/components/ic-hero.js +145 -0
- package/components/ic-hero.js.map +1 -0
- package/components/ic-horizontal-scroll.d.ts +11 -0
- package/components/ic-horizontal-scroll.js +8 -0
- package/components/ic-horizontal-scroll.js.map +1 -0
- package/components/ic-horizontal-scroll2.js +240 -0
- package/components/ic-horizontal-scroll2.js.map +1 -0
- package/components/ic-input-component-container.d.ts +11 -0
- package/components/ic-input-component-container.js +8 -0
- package/components/ic-input-component-container.js.map +1 -0
- package/components/ic-input-component-container2.js +95 -0
- package/components/ic-input-component-container2.js.map +1 -0
- package/components/ic-input-container.d.ts +11 -0
- package/components/ic-input-container.js +8 -0
- package/components/ic-input-container.js.map +1 -0
- package/components/ic-input-container2.js +47 -0
- package/components/ic-input-container2.js.map +1 -0
- package/components/ic-input-label.d.ts +11 -0
- package/components/ic-input-label.js +8 -0
- package/components/ic-input-label.js.map +1 -0
- package/components/ic-input-label2.js +121 -0
- package/components/ic-input-label2.js.map +1 -0
- package/components/ic-input-validation.d.ts +11 -0
- package/components/ic-input-validation.js +8 -0
- package/components/ic-input-validation.js.map +1 -0
- package/components/ic-input-validation2.js +90 -0
- package/components/ic-input-validation2.js.map +1 -0
- package/components/ic-layout-grid-item.d.ts +11 -0
- package/components/ic-layout-grid-item.js +95 -0
- package/components/ic-layout-grid-item.js.map +1 -0
- package/components/ic-layout-grid.d.ts +11 -0
- package/components/ic-layout-grid.js +188 -0
- package/components/ic-layout-grid.js.map +1 -0
- package/components/ic-link.d.ts +11 -0
- package/components/ic-link.js +8 -0
- package/components/ic-link.js.map +1 -0
- package/components/ic-link2.js +135 -0
- package/components/ic-link2.js.map +1 -0
- package/components/ic-loading-indicator.d.ts +11 -0
- package/components/ic-loading-indicator.js +8 -0
- package/components/ic-loading-indicator.js.map +1 -0
- package/components/ic-loading-indicator2.js +278 -0
- package/components/ic-loading-indicator2.js.map +1 -0
- package/components/ic-menu-group.d.ts +11 -0
- package/components/ic-menu-group.js +47 -0
- package/components/ic-menu-group.js.map +1 -0
- package/components/ic-menu-item.d.ts +11 -0
- package/components/ic-menu-item.js +8 -0
- package/components/ic-menu-item.js.map +1 -0
- package/components/ic-menu-item2.js +171 -0
- package/components/ic-menu-item2.js.map +1 -0
- package/components/ic-menu.d.ts +11 -0
- package/components/ic-menu.js +8 -0
- package/components/ic-menu.js.map +1 -0
- package/components/ic-menu2.js +2590 -0
- package/components/ic-menu2.js.map +1 -0
- package/components/ic-navigation-button.d.ts +11 -0
- package/components/ic-navigation-button.js +175 -0
- package/components/ic-navigation-button.js.map +1 -0
- package/components/ic-navigation-group.d.ts +11 -0
- package/components/ic-navigation-group.js +326 -0
- package/components/ic-navigation-group.js.map +1 -0
- package/components/ic-navigation-item.d.ts +11 -0
- package/components/ic-navigation-item.js +294 -0
- package/components/ic-navigation-item.js.map +1 -0
- package/components/ic-navigation-menu.d.ts +11 -0
- package/components/ic-navigation-menu.js +8 -0
- package/components/ic-navigation-menu.js.map +1 -0
- package/components/ic-navigation-menu2.js +188 -0
- package/components/ic-navigation-menu2.js.map +1 -0
- package/components/ic-page-header.d.ts +11 -0
- package/components/ic-page-header.js +196 -0
- package/components/ic-page-header.js.map +1 -0
- package/components/ic-pagination-bar.d.ts +11 -0
- package/components/ic-pagination-bar.js +523 -0
- package/components/ic-pagination-bar.js.map +1 -0
- package/components/ic-pagination-item.d.ts +11 -0
- package/components/ic-pagination-item.js +8 -0
- package/components/ic-pagination-item.js.map +1 -0
- package/components/ic-pagination-item2.js +107 -0
- package/components/ic-pagination-item2.js.map +1 -0
- package/components/ic-pagination.d.ts +11 -0
- package/components/ic-pagination.js +8 -0
- package/components/ic-pagination.js.map +1 -0
- package/components/ic-pagination2.js +379 -0
- package/components/ic-pagination2.js.map +1 -0
- package/components/ic-popover-menu.d.ts +11 -0
- package/components/ic-popover-menu.js +369 -0
- package/components/ic-popover-menu.js.map +1 -0
- package/components/ic-radio-group.d.ts +11 -0
- package/components/ic-radio-group.js +317 -0
- package/components/ic-radio-group.js.map +1 -0
- package/components/ic-radio-option.d.ts +11 -0
- package/components/ic-radio-option.js +211 -0
- package/components/ic-radio-option.js.map +1 -0
- package/components/ic-search-bar.d.ts +11 -0
- package/components/ic-search-bar.js +719 -0
- package/components/ic-search-bar.js.map +1 -0
- package/components/ic-section-container.d.ts +11 -0
- package/components/ic-section-container.js +8 -0
- package/components/ic-section-container.js.map +1 -0
- package/components/ic-section-container2.js +50 -0
- package/components/ic-section-container2.js.map +1 -0
- package/components/ic-select.d.ts +11 -0
- package/components/ic-select.js +8 -0
- package/components/ic-select.js.map +1 -0
- package/components/ic-select2.js +806 -0
- package/components/ic-select2.js.map +1 -0
- package/components/ic-side-navigation.d.ts +11 -0
- package/components/ic-side-navigation.js +568 -0
- package/components/ic-side-navigation.js.map +1 -0
- package/components/ic-skeleton.d.ts +11 -0
- package/components/ic-skeleton.js +81 -0
- package/components/ic-skeleton.js.map +1 -0
- package/components/ic-skip-link.d.ts +11 -0
- package/components/ic-skip-link.js +91 -0
- package/components/ic-skip-link.js.map +1 -0
- package/components/ic-status-tag.d.ts +11 -0
- package/components/ic-status-tag.js +85 -0
- package/components/ic-status-tag.js.map +1 -0
- package/components/ic-step.d.ts +11 -0
- package/components/ic-step.js +200 -0
- package/components/ic-step.js.map +1 -0
- package/components/ic-stepper.d.ts +11 -0
- package/components/ic-stepper.js +340 -0
- package/components/ic-stepper.js.map +1 -0
- package/components/ic-switch.d.ts +11 -0
- package/components/ic-switch.js +164 -0
- package/components/ic-switch.js.map +1 -0
- package/components/ic-tab-context.d.ts +11 -0
- package/components/ic-tab-context.js +275 -0
- package/components/ic-tab-context.js.map +1 -0
- package/components/ic-tab-group.d.ts +11 -0
- package/components/ic-tab-group.js +89 -0
- package/components/ic-tab-group.js.map +1 -0
- package/components/ic-tab-panel.d.ts +11 -0
- package/components/ic-tab-panel.js +63 -0
- package/components/ic-tab-panel.js.map +1 -0
- package/components/ic-tab.d.ts +11 -0
- package/components/ic-tab.js +143 -0
- package/components/ic-tab.js.map +1 -0
- package/components/ic-text-field.d.ts +11 -0
- package/components/ic-text-field.js +8 -0
- package/components/ic-text-field.js.map +1 -0
- package/components/ic-text-field2.js +532 -0
- package/components/ic-text-field2.js.map +1 -0
- package/components/ic-theme.d.ts +11 -0
- package/components/ic-theme.js +105 -0
- package/components/ic-theme.js.map +1 -0
- package/components/ic-toast-region.d.ts +11 -0
- package/components/ic-toast-region.js +76 -0
- package/components/ic-toast-region.js.map +1 -0
- package/components/ic-toast.d.ts +11 -0
- package/components/ic-toast.js +295 -0
- package/components/ic-toast.js.map +1 -0
- package/components/ic-toggle-button-group.d.ts +11 -0
- package/components/ic-toggle-button-group.js +323 -0
- package/components/ic-toggle-button-group.js.map +1 -0
- package/components/ic-toggle-button.d.ts +11 -0
- package/components/ic-toggle-button.js +235 -0
- package/components/ic-toggle-button.js.map +1 -0
- package/components/ic-tooltip.d.ts +11 -0
- package/components/ic-tooltip.js +8 -0
- package/components/ic-tooltip.js.map +1 -0
- package/components/ic-tooltip2.js +2078 -0
- package/components/ic-tooltip2.js.map +1 -0
- package/components/ic-top-navigation.d.ts +11 -0
- package/components/ic-top-navigation.js +320 -0
- package/components/ic-top-navigation.js.map +1 -0
- package/components/ic-typography.d.ts +11 -0
- package/components/ic-typography.js +8 -0
- package/components/ic-typography.js.map +1 -0
- package/components/ic-typography2.js +228 -0
- package/components/ic-typography2.js.map +1 -0
- package/components/index.d.ts +33 -0
- package/components/index.js +4 -0
- package/components/index.js.map +1 -0
- package/components/package.json +9 -0
- package/dist/cjs/core.cjs.js +1 -1
- package/dist/cjs/ic-button_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-input-component-container_3.cjs.entry.js +63 -37
- package/dist/cjs/ic-input-component-container_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-pagination_3.cjs.entry.js +17 -17
- package/dist/cjs/ic-pagination_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-section-container.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-top-navigation.cjs.entry.js +12 -8
- package/dist/cjs/ic-top-navigation.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ic-menu/ic-menu.css +19 -0
- package/dist/collection/components/ic-menu/ic-menu.js +62 -36
- package/dist/collection/components/ic-menu/ic-menu.js.map +1 -1
- package/dist/collection/components/ic-menu/ic-menu.types.js.map +1 -1
- package/dist/collection/components/ic-select/ic-select.js +17 -17
- package/dist/collection/components/ic-select/ic-select.js.map +1 -1
- package/dist/collection/components/ic-select/ic-select_(single).stories.js +54 -0
- package/dist/collection/components/ic-top-navigation/ic-top-navigation.js +33 -9
- package/dist/collection/components/ic-top-navigation/ic-top-navigation.js.map +1 -1
- package/dist/collection/components/ic-top-navigation/ic-top-navigation.stories.js +26 -0
- package/dist/components/ic-menu2.js +63 -37
- package/dist/components/ic-menu2.js.map +1 -1
- package/dist/components/ic-page-header.js.map +1 -1
- package/dist/components/ic-popover-menu.js.map +1 -1
- package/dist/components/ic-radio-group.js.map +1 -1
- package/dist/components/ic-radio-option.js.map +1 -1
- package/dist/components/ic-select2.js +17 -17
- package/dist/components/ic-select2.js.map +1 -1
- package/dist/components/ic-top-navigation.js +13 -8
- package/dist/components/ic-top-navigation.js.map +1 -1
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/{p-46e5a58b.entry.js → p-12474095.entry.js} +2 -2
- package/dist/core/p-12474095.entry.js.map +1 -0
- package/dist/core/p-98dee727.entry.js.map +1 -1
- package/dist/core/p-d1220d2a.entry.js.map +1 -1
- package/dist/core/p-e0b66371.entry.js +2 -0
- package/dist/core/p-e0b66371.entry.js.map +1 -0
- package/dist/core/{p-171a19bf.entry.js → p-fdc4376e.entry.js} +2 -2
- package/dist/core/p-fdc4376e.entry.js.map +1 -0
- package/dist/esm/core.js +1 -1
- package/dist/esm/ic-button_3.entry.js.map +1 -1
- package/dist/esm/ic-input-component-container_3.entry.js +63 -37
- package/dist/esm/ic-input-component-container_3.entry.js.map +1 -1
- package/dist/esm/ic-pagination_3.entry.js +17 -17
- package/dist/esm/ic-pagination_3.entry.js.map +1 -1
- package/dist/esm/ic-section-container.entry.js.map +1 -1
- package/dist/esm/ic-top-navigation.entry.js +12 -8
- package/dist/esm/ic-top-navigation.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/ic-menu/ic-menu.types.d.ts +1 -0
- package/dist/types/components/ic-top-navigation/ic-top-navigation.d.ts +4 -1
- package/dist/types/components.d.ts +10 -2
- package/hydrate/index.js +93 -62
- package/hydrate/index.mjs +93 -62
- package/package.json +4 -2
- package/vscode-data.json +5 -1
- package/dist/core/p-171a19bf.entry.js.map +0 -1
- package/dist/core/p-343670b4.entry.js +0 -2
- package/dist/core/p-343670b4.entry.js.map +0 -1
- package/dist/core/p-46e5a58b.entry.js.map +0 -1
|
@@ -121,30 +121,34 @@ export class Menu {
|
|
|
121
121
|
}
|
|
122
122
|
};
|
|
123
123
|
this.setNextOptionValue = (selectedOptionIndex) => {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
124
|
+
const nextIndex = selectedOptionIndex % this.ungroupedOptions.length;
|
|
125
|
+
const nextOption = this.ungroupedOptions[nextIndex];
|
|
126
|
+
this.setHighlightedOption(nextIndex);
|
|
127
|
+
if (nextOption.disabled) {
|
|
128
|
+
this.menuOptionId.emit({
|
|
129
|
+
optionId: this.getOptionId(nextOption[this.valueField]),
|
|
128
130
|
});
|
|
129
131
|
}
|
|
130
132
|
else {
|
|
131
133
|
this.menuOptionSelect.emit({
|
|
132
|
-
value:
|
|
133
|
-
optionId: this.getOptionId(
|
|
134
|
+
value: nextOption[this.valueField],
|
|
135
|
+
optionId: this.getOptionId(nextOption[this.valueField]),
|
|
134
136
|
});
|
|
135
137
|
}
|
|
136
138
|
};
|
|
137
139
|
this.setPreviousOptionValue = (selectedOptionIndex) => {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
140
|
+
const prevIndex = selectedOptionIndex % this.ungroupedOptions.length;
|
|
141
|
+
const prevOption = this.ungroupedOptions[prevIndex];
|
|
142
|
+
this.setHighlightedOption(prevIndex);
|
|
143
|
+
if (prevOption.disabled) {
|
|
144
|
+
this.menuOptionId.emit({
|
|
145
|
+
optionId: this.getOptionId(prevOption[this.valueField]),
|
|
142
146
|
});
|
|
143
147
|
}
|
|
144
148
|
else {
|
|
145
149
|
this.menuOptionSelect.emit({
|
|
146
|
-
value:
|
|
147
|
-
optionId: this.getOptionId(
|
|
150
|
+
value: prevOption[this.valueField],
|
|
151
|
+
optionId: this.getOptionId(prevOption[this.valueField]),
|
|
148
152
|
});
|
|
149
153
|
}
|
|
150
154
|
};
|
|
@@ -175,7 +179,7 @@ export class Menu {
|
|
|
175
179
|
const nextIndex = selectedOptionIndex < this.ungroupedOptions.length - 1
|
|
176
180
|
? selectedOptionIndex + 1
|
|
177
181
|
: 0;
|
|
178
|
-
this.setNextOptionValue(
|
|
182
|
+
this.setNextOptionValue(nextIndex);
|
|
179
183
|
this.emitOptionId(nextIndex);
|
|
180
184
|
break;
|
|
181
185
|
}
|
|
@@ -185,7 +189,7 @@ export class Menu {
|
|
|
185
189
|
const prevIndex = selectedOptionIndex > 0
|
|
186
190
|
? selectedOptionIndex - 1
|
|
187
191
|
: this.ungroupedOptions.length - 1;
|
|
188
|
-
this.setPreviousOptionValue(
|
|
192
|
+
this.setPreviousOptionValue(prevIndex);
|
|
189
193
|
this.emitOptionId(prevIndex);
|
|
190
194
|
break;
|
|
191
195
|
}
|
|
@@ -224,6 +228,7 @@ export class Menu {
|
|
|
224
228
|
if (this.searchBar &&
|
|
225
229
|
options[highlightedOptionIndex].disabled === true) {
|
|
226
230
|
this.disabledOptionSelected = true;
|
|
231
|
+
this.optionHighlighted = undefined;
|
|
227
232
|
}
|
|
228
233
|
else {
|
|
229
234
|
this.setInputValue(highlightedOptionIndex);
|
|
@@ -449,14 +454,15 @@ export class Menu {
|
|
|
449
454
|
};
|
|
450
455
|
this.setInputValue = (highlightedOptionIndex) => {
|
|
451
456
|
const menuOptions = this.getMenuOptions();
|
|
452
|
-
if (menuOptions[highlightedOptionIndex] !== undefined
|
|
457
|
+
if (menuOptions[highlightedOptionIndex] !== undefined &&
|
|
458
|
+
!menuOptions[highlightedOptionIndex].disabled) {
|
|
453
459
|
this.menuOptionSelect.emit({
|
|
454
460
|
value: menuOptions[highlightedOptionIndex][this.valueField],
|
|
455
461
|
});
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
}
|
|
462
|
+
}
|
|
463
|
+
if (this.closeOnSelect) {
|
|
464
|
+
this.optionHighlighted = undefined;
|
|
465
|
+
this.menuOptionId.emit({ optionId: undefined });
|
|
460
466
|
}
|
|
461
467
|
if (this.closeOnSelect) {
|
|
462
468
|
if (!this.hasTimedOut) {
|
|
@@ -613,11 +619,12 @@ export class Menu {
|
|
|
613
619
|
var _a, _b;
|
|
614
620
|
// Select all if there is either no value or not all options are selected
|
|
615
621
|
// 'true' means select all, 'false' means clear all
|
|
622
|
+
const enabledOptionsCount = this.ungroupedOptions.filter((option) => !option.disabled).length;
|
|
616
623
|
this.menuOptionSelectAll.emit({
|
|
617
|
-
select: !this.value || !(((_a = this.value) === null || _a === void 0 ? void 0 : _a.length) ===
|
|
624
|
+
select: !this.value || !(((_a = this.value) === null || _a === void 0 ? void 0 : _a.length) === enabledOptionsCount),
|
|
618
625
|
});
|
|
619
|
-
// Emit clear event if all options are selected
|
|
620
|
-
if (((_b = this.value) === null || _b === void 0 ? void 0 : _b.length) ===
|
|
626
|
+
// Emit clear event if all non-disabled options are selected
|
|
627
|
+
if (((_b = this.value) === null || _b === void 0 ? void 0 : _b.length) === enabledOptionsCount) {
|
|
621
628
|
this.icClear.emit();
|
|
622
629
|
}
|
|
623
630
|
};
|
|
@@ -630,7 +637,10 @@ export class Menu {
|
|
|
630
637
|
this.autoSetValueOnMenuKeyDown = (event) => {
|
|
631
638
|
var _a;
|
|
632
639
|
event.cancelBubble = true;
|
|
633
|
-
const
|
|
640
|
+
const highlightedOptionIndex = this.getOptionHighlightedIndex();
|
|
641
|
+
const selectedOptionIndex = highlightedOptionIndex >= 0
|
|
642
|
+
? highlightedOptionIndex
|
|
643
|
+
: this.ungroupedOptions.findIndex((option) => option[this.valueField] === this.value);
|
|
634
644
|
const isSearchableSelect = !!this.inputEl && this.inputEl.tagName === "INPUT";
|
|
635
645
|
this.keyboardNav = false;
|
|
636
646
|
switch (event.key) {
|
|
@@ -640,20 +650,22 @@ export class Menu {
|
|
|
640
650
|
case "ArrowUp":
|
|
641
651
|
if (!this.hasTimedOut) {
|
|
642
652
|
event.preventDefault();
|
|
643
|
-
|
|
644
|
-
this.emitOptionId(selectedOptionIndex > 0
|
|
653
|
+
const prevIndex = selectedOptionIndex > 0
|
|
645
654
|
? selectedOptionIndex - 1
|
|
646
|
-
: this.ungroupedOptions.length - 1
|
|
655
|
+
: this.ungroupedOptions.length - 1;
|
|
656
|
+
this.setPreviousOptionValue(prevIndex);
|
|
657
|
+
this.emitOptionId(prevIndex);
|
|
647
658
|
this.keyboardNav = true;
|
|
648
659
|
}
|
|
649
660
|
break;
|
|
650
661
|
case "ArrowDown":
|
|
651
662
|
if (!this.hasTimedOut) {
|
|
652
663
|
event.preventDefault();
|
|
653
|
-
this.
|
|
654
|
-
this.emitOptionId(selectedOptionIndex < this.ungroupedOptions.length - 1
|
|
664
|
+
const nextIndex = selectedOptionIndex < this.ungroupedOptions.length - 1
|
|
655
665
|
? selectedOptionIndex + 1
|
|
656
|
-
: 0
|
|
666
|
+
: 0;
|
|
667
|
+
this.setNextOptionValue(nextIndex);
|
|
668
|
+
this.emitOptionId(nextIndex);
|
|
657
669
|
this.keyboardNav = true;
|
|
658
670
|
}
|
|
659
671
|
break;
|
|
@@ -754,7 +766,7 @@ export class Menu {
|
|
|
754
766
|
if (option.children) {
|
|
755
767
|
option.children.map((option) => !option.disabled && this.ungroupedOptions.push(option));
|
|
756
768
|
}
|
|
757
|
-
else
|
|
769
|
+
else {
|
|
758
770
|
this.ungroupedOptions.push(option);
|
|
759
771
|
}
|
|
760
772
|
});
|
|
@@ -784,6 +796,9 @@ export class Menu {
|
|
|
784
796
|
return (h(Fragment, null, option.loading && h("ic-loading-indicator", { size: "icon" }), h("div", { class: {
|
|
785
797
|
"option-text-container": true,
|
|
786
798
|
"show-check-icon": showCheckIcon,
|
|
799
|
+
"focus-border": (this.keyboardNav || this.initialOptionsListRender) &&
|
|
800
|
+
option[this.valueField] === this.optionHighlighted &&
|
|
801
|
+
!!option.disabled,
|
|
787
802
|
} }, (option.icon || !option.hideLabel) && (h("div", { class: "option-label" }, option.icon && (h("div", { class: "option-icon", innerHTML: sanitizeHTMLIconString(option.icon), "aria-hidden": "true" })), !option.hideLabel && (h("ic-typography", { variant: "body", "aria-hidden": "true" }, option[this.labelField])))), option.description && (h("ic-typography", { id: `${this.getOptionId(option[this.valueField])}-description`, class: "option-description", variant: "caption", "aria-hidden": "true" }, h("p", null, option.description))), option.element && (h("div", { class: {
|
|
788
803
|
"option-element": option.icon || !option.hideLabel || option.description,
|
|
789
804
|
}, innerHTML: sanitizeHTMLString(option.element.component), "aria-hidden": "true" }))), showCheckIcon && (h("span", { class: "check-icon", innerHTML: Check, "aria-hidden": "true" }))));
|
|
@@ -795,8 +810,18 @@ export class Menu {
|
|
|
795
810
|
option: true,
|
|
796
811
|
"focused-option": isManualMode
|
|
797
812
|
? (keyboardNav || initialOptionsListRender) &&
|
|
798
|
-
option[this.valueField] === optionHighlighted
|
|
799
|
-
|
|
813
|
+
option[this.valueField] === optionHighlighted &&
|
|
814
|
+
!option.disabled
|
|
815
|
+
: keyboardNav &&
|
|
816
|
+
option[this.valueField] === optionHighlighted &&
|
|
817
|
+
!option.disabled,
|
|
818
|
+
"focus-disabled": isManualMode
|
|
819
|
+
? (keyboardNav || initialOptionsListRender) &&
|
|
820
|
+
option[this.valueField] === optionHighlighted &&
|
|
821
|
+
!!option.disabled
|
|
822
|
+
: keyboardNav &&
|
|
823
|
+
option[this.valueField] === optionHighlighted &&
|
|
824
|
+
!!option.disabled,
|
|
800
825
|
"last-recommended-option": !!(option.recommended &&
|
|
801
826
|
options[index + 1] &&
|
|
802
827
|
!options[index + 1].recommended),
|
|
@@ -990,9 +1015,10 @@ export class Menu {
|
|
|
990
1015
|
}
|
|
991
1016
|
render() {
|
|
992
1017
|
const { inputLabel, options, menuId, value, fullWidth, hasTimedOut, isLoading, size, open, inputEl, keyboardNav, parentEl, SEARCH_BAR_TAG, multiSelect, } = this;
|
|
993
|
-
const
|
|
1018
|
+
const enabledOptionsCount = this.ungroupedOptions.filter((option) => !option.disabled).length;
|
|
1019
|
+
const selectAllButtonText = `${(value === null || value === void 0 ? void 0 : value.length) === enabledOptionsCount ? "Clear" : "Select"} all`;
|
|
994
1020
|
const hasNoResults = this.host.classList.contains("no-results");
|
|
995
|
-
return (h(Host, { key: '
|
|
1021
|
+
return (h(Host, { key: 'f2126f99757d13606827ea1eac7c08b023b97bae', class: {
|
|
996
1022
|
"ic-menu-full-width": !!fullWidth,
|
|
997
1023
|
"ic-menu-no-focus": ((inputEl === null || inputEl === void 0 ? void 0 : inputEl.tagName) === "INPUT" &&
|
|
998
1024
|
(parentEl === null || parentEl === void 0 ? void 0 : parentEl.tagName) !== SEARCH_BAR_TAG) ||
|
|
@@ -1001,7 +1027,7 @@ export class Menu {
|
|
|
1001
1027
|
[`ic-menu-${size}`]: true,
|
|
1002
1028
|
"ic-menu-open": open && options.length !== 0,
|
|
1003
1029
|
"ic-menu-multiple": multiSelect,
|
|
1004
|
-
} }, options.length !== 0 && (h("ul", { key: '
|
|
1030
|
+
} }, options.length !== 0 && (h("ul", { key: '9b41a2c0ab9d6b08dca829db341614b248675050', id: menuId, class: "menu", role: "listbox", "aria-label": `${inputLabel} pop-up`, "aria-multiselectable": multiSelect ? "true" : "false", "aria-activedescendant": this.optionHighlighted
|
|
1005
1031
|
? this.getOptionId(this.optionHighlighted)
|
|
1006
1032
|
: undefined, tabindex: !this.allowMenuFocus
|
|
1007
1033
|
? "-1"
|
|
@@ -1033,7 +1059,7 @@ export class Menu {
|
|
|
1033
1059
|
multiSelect &&
|
|
1034
1060
|
!isLoading &&
|
|
1035
1061
|
!hasTimedOut &&
|
|
1036
|
-
!hasNoResults && (h("div", { key: '
|
|
1062
|
+
!hasNoResults && (h("div", { key: '7440008eccba1fc099d09ae3916e0d186686d59e', class: "option-bar" }, h("ic-typography", { key: '802bd46a5d028a541060eb4cc57c2c4607cb1b86' }, h("p", { key: '17a482e5bbff099b44550f9800980a649a319358' }, `${value ? value.length : 0}/${getOptionsWithoutGroupTitlesCount(this.options)} selected`)), h("ic-button", { key: '5aa400fd2be98bc038400b699c33bd2b1814cb5d', class: "select-all-button", "aria-label": `${selectAllButtonText} options for ${inputLabel}`, ref: (el) => (this.selectAllButton = el), variant: "tertiary", onClick: this.handleSelectAllClick, onMouseDown: this.handleSelectAllMouseDown, onBlur: this.handleSelectAllBlur, onFocus: this.handleSelectAllFocus, size: size === "small" ? "small" : "medium" }, selectAllButtonText)))));
|
|
1037
1063
|
}
|
|
1038
1064
|
static get is() { return "ic-menu"; }
|
|
1039
1065
|
static get encapsulation() { return "scoped"; }
|