@momentum-ui/web-components 2.16.5 → 2.16.8
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/.eslintignore +6 -0
- package/.eslintrc.js +22 -0
- package/.github/CODEOWNERS +5 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- package/.github/pull_request_template.md +191 -0
- package/.prettierignore +6 -0
- package/.prettierrc +6 -0
- package/.storybook/main.ts +67 -0
- package/.storybook/manager.ts +16 -0
- package/.storybook/preview-body.html +43 -0
- package/.storybook/preview-head.html +3 -0
- package/.storybook/preview.ts +70 -0
- package/.storybook/themeDecorator.js +9 -0
- package/.stylelintignore +6 -0
- package/.stylelintrc.js +14 -0
- package/.vscode/extensions.json +13 -0
- package/.vscode/launch.json +13 -0
- package/.vscode/settings.json +33 -0
- package/ANGULAR_USAGE.md +102 -0
- package/APPLYING_STYLES.md +44 -0
- package/CHANGELOG.md +23 -0
- package/CONTRIBUTING.md +56 -0
- package/REACT_USAGE.md +145 -0
- package/VERSIONING.md +28 -0
- package/WEB_COMPONENTS_CRASH_COURSE.md +255 -0
- package/babel.config.js +4 -0
- package/codecov.yml +10 -0
- package/jest/cssTransform.js +9 -0
- package/jest/imgTransform.js +9 -0
- package/jest/svgTransform.js +9 -0
- package/jest.config.js +37 -0
- package/package.json +132 -10
- package/publish-conf.js +66 -0
- package/sonar-project.properties +22 -0
- package/sonar.config.js +22 -0
- package/src/[sandbox]/examples/AdvanceList/components/ErrorLoader/ErrorLoader.scss +22 -0
- package/src/[sandbox]/examples/AdvanceList/components/ErrorLoader/ErrorLoader.ts +72 -0
- package/src/[sandbox]/examples/AdvanceList/components/ParentComponentError.ts +123 -0
- package/src/[sandbox]/examples/AdvanceList/components/ParentComponentGeneric.ts +101 -0
- package/src/[sandbox]/examples/AdvanceList/components/ParentComponentPreSelect.ts +98 -0
- package/src/[sandbox]/examples/accordion.ts +67 -0
- package/src/[sandbox]/examples/advance-list.ts +14 -0
- package/src/[sandbox]/examples/alert-banner.ts +100 -0
- package/src/[sandbox]/examples/alert.ts +130 -0
- package/src/[sandbox]/examples/audio-player.ts +9 -0
- package/src/[sandbox]/examples/avatar.ts +146 -0
- package/src/[sandbox]/examples/badge.ts +175 -0
- package/src/[sandbox]/examples/breadcrumb.ts +5 -0
- package/src/[sandbox]/examples/button-group.ts +66 -0
- package/src/[sandbox]/examples/button.ts +455 -0
- package/src/[sandbox]/examples/card-ai.ts +105 -0
- package/src/[sandbox]/examples/card.ts +76 -0
- package/src/[sandbox]/examples/chat-message.ts +33 -0
- package/src/[sandbox]/examples/checkbox.ts +64 -0
- package/src/[sandbox]/examples/chip.ts +121 -0
- package/src/[sandbox]/examples/coachmark.ts +90 -0
- package/src/[sandbox]/examples/code-editor.ts +13 -0
- package/src/[sandbox]/examples/colorTable.ts +12 -0
- package/src/[sandbox]/examples/combobox.ts +441 -0
- package/src/[sandbox]/examples/date-range-picker.ts +26 -0
- package/src/[sandbox]/examples/date-time-picker.ts +25 -0
- package/src/[sandbox]/examples/datepicker.ts +41 -0
- package/src/[sandbox]/examples/draggable.ts +70 -0
- package/src/[sandbox]/examples/dropdown.ts +263 -0
- package/src/[sandbox]/examples/editable-field.ts +115 -0
- package/src/[sandbox]/examples/favorite.ts +49 -0
- package/src/[sandbox]/examples/floating-modal.ts +101 -0
- package/src/[sandbox]/examples/form.ts +101 -0
- package/src/[sandbox]/examples/grabber.ts +199 -0
- package/src/[sandbox]/examples/icon.ts +73 -0
- package/src/[sandbox]/examples/index.ts +55 -0
- package/src/[sandbox]/examples/input-file.ts +7 -0
- package/src/[sandbox]/examples/input.ts +444 -0
- package/src/[sandbox]/examples/label.ts +13 -0
- package/src/[sandbox]/examples/link.ts +46 -0
- package/src/[sandbox]/examples/list.ts +55 -0
- package/src/[sandbox]/examples/loading.ts +8 -0
- package/src/[sandbox]/examples/meeting-alert.ts +108 -0
- package/src/[sandbox]/examples/menu-item.ts +33 -0
- package/src/[sandbox]/examples/menu-overlay.ts +579 -0
- package/src/[sandbox]/examples/modal.ts +451 -0
- package/src/[sandbox]/examples/pagination.ts +13 -0
- package/src/[sandbox]/examples/phone-input.ts +112 -0
- package/src/[sandbox]/examples/popover.ts +164 -0
- package/src/[sandbox]/examples/progress-bar.ts +6 -0
- package/src/[sandbox]/examples/radio-group.ts +52 -0
- package/src/[sandbox]/examples/slider.ts +17 -0
- package/src/[sandbox]/examples/spinner.ts +4 -0
- package/src/[sandbox]/examples/table-advanced.ts +120 -0
- package/src/[sandbox]/examples/table.ts +106 -0
- package/src/[sandbox]/examples/tabs.ts +887 -0
- package/src/[sandbox]/examples/task-item.ts +142 -0
- package/src/[sandbox]/examples/timepicker.ts +26 -0
- package/src/[sandbox]/examples/toggle-switch.ts +20 -0
- package/src/[sandbox]/examples/tooltip.ts +138 -0
- package/src/[sandbox]/favicon.ico +0 -0
- package/src/[sandbox]/index.html +15 -0
- package/src/[sandbox]/sandbox.mock.ts +636 -0
- package/src/[sandbox]/sandbox.scss +66 -0
- package/src/[sandbox]/sandbox.ts +318 -0
- package/src/assets/images/profile.svg +47 -0
- package/src/assets/images/whatsapp.svg +1104 -0
- package/src/assets/images/wxm.svg +8 -0
- package/src/components/accordion/Accordion.mdx +74 -0
- package/src/components/accordion/Accordion.stories.ts +40 -0
- package/src/components/accordion/Accordion.test.ts +151 -0
- package/src/components/accordion/Accordion.ts +188 -0
- package/src/components/accordion/AccordionItem.test.ts +124 -0
- package/src/components/accordion/AccordionItem.ts +180 -0
- package/src/components/accordion/scss/accordion-item.scss +92 -0
- package/src/components/accordion/scss/accordion.scss +32 -0
- package/src/components/accordion/scss/mixins.scss +16 -0
- package/src/components/accordion/scss/module.scss +2 -0
- package/src/components/accordion/scss/settings.scss +14 -0
- package/src/components/accordion/tokens/lm-accordion-tokens.js +26 -0
- package/src/components/accordion/tokens/md-accordion-tokens.js +26 -0
- package/src/components/accordion/tokens/mdv2-accordion-tokens.js +21 -0
- package/src/components/activity-button/ActivityButton.test.ts +52 -0
- package/src/components/activity-button/ActivityButton.ts +92 -0
- package/src/components/activity-button/scss/activity-button.scss +160 -0
- package/src/components/activity-button/scss/module.scss +63 -0
- package/src/components/advance-list/AdvanceList.test.ts +357 -0
- package/src/components/advance-list/AdvanceList.ts +293 -0
- package/src/components/advance-list/scss/AdvanceList.scss +82 -0
- package/src/components/advance-list/scss/module.scss +8 -0
- package/src/components/advance-list/tokens/lm-advance-list-tokens.js +46 -0
- package/src/components/advance-list/tokens/md-advance-list-tokens.js +46 -0
- package/src/components/advance-list/tokens/mdv2-adavance-list-tokens.js +49 -0
- package/src/components/alert/Alert.mdx +72 -0
- package/src/components/alert/Alert.stories.ts +94 -0
- package/src/components/alert/Alert.test.ts +276 -0
- package/src/components/alert/Alert.ts +282 -0
- package/src/components/alert/scss/alert.scss +221 -0
- package/src/components/alert/scss/mixins.scss +27 -0
- package/src/components/alert/scss/module.scss +6 -0
- package/src/components/alert/scss/settings.scss +27 -0
- package/src/components/alert/tokens/lm-alert-tokens.js +63 -0
- package/src/components/alert/tokens/md-alert-tokens.js +63 -0
- package/src/components/alert/tokens/mdv2-alert-tokens.js +51 -0
- package/src/components/alert-banner/AlertBanner.mdx +38 -0
- package/src/components/alert-banner/AlertBanner.stories.ts +49 -0
- package/src/components/alert-banner/AlertBanner.test.ts +79 -0
- package/src/components/alert-banner/AlertBanner.ts +89 -0
- package/src/components/alert-banner/scss/alert-banner.scss +71 -0
- package/src/components/alert-banner/scss/mixins.scss +8 -0
- package/src/components/alert-banner/scss/module.scss +7 -0
- package/src/components/alert-banner/scss/settings.scss +9 -0
- package/src/components/alert-banner/tokens/lm-alertbanner-tokens.js +50 -0
- package/src/components/alert-banner/tokens/md-alertbanner-tokens.js +50 -0
- package/src/components/alert-banner/tokens/mdv2-alertbanner-tokens.js +44 -0
- package/src/components/audio-player/AudioPlayer.stories.ts +33 -0
- package/src/components/audio-player/AudioPlayer.test.ts +208 -0
- package/src/components/audio-player/AudioPlayer.ts +539 -0
- package/src/components/audio-player/scss/audio-player.scss +236 -0
- package/src/components/audio-player/scss/mixins.scss +0 -0
- package/src/components/audio-player/scss/module.scss +16 -0
- package/src/components/audio-player/scss/settings.scss +15 -0
- package/src/components/audio-player/tokens/lm-audio-player-token.js +46 -0
- package/src/components/audio-player/tokens/md-audio-player-token.js +46 -0
- package/src/components/audio-player/tokens/mdv2-audio-player-token.js +37 -0
- package/src/components/avatar/Avatar.constants.ts +31 -0
- package/src/components/avatar/Avatar.mdx +153 -0
- package/src/components/avatar/Avatar.stories.ts +98 -0
- package/src/components/avatar/Avatar.test.ts +218 -0
- package/src/components/avatar/Avatar.ts +284 -0
- package/src/components/avatar/CompositeAvatar.ts +47 -0
- package/src/components/avatar/Presence.test.ts +225 -0
- package/src/components/avatar/Presence.ts +46 -0
- package/src/components/avatar/Presence.utils.ts +114 -0
- package/src/components/avatar/scss/avatar.scss +331 -0
- package/src/components/avatar/scss/composite-avatar.scss +89 -0
- package/src/components/avatar/scss/mixins.scss +33 -0
- package/src/components/avatar/scss/module.scss +18 -0
- package/src/components/avatar/scss/presence.scss +50 -0
- package/src/components/avatar/scss/settings.scss +103 -0
- package/src/components/avatar/tokens/lm-avatar-tokens.js +193 -0
- package/src/components/avatar/tokens/md-avatar-tokens.js +183 -0
- package/src/components/avatar/tokens/mdv2-avatar-tokens.js +182 -0
- package/src/components/badge/Badge.stories.ts +55 -0
- package/src/components/badge/Badge.test.ts +100 -0
- package/src/components/badge/Badge.ts +114 -0
- package/src/components/badge/scss/badge.scss +251 -0
- package/src/components/badge/scss/mixins.scss +82 -0
- package/src/components/badge/scss/module.scss +12 -0
- package/src/components/badge/scss/settings.scss +69 -0
- package/src/components/badge/tokens/lm-badge-tokens.js +369 -0
- package/src/components/badge/tokens/md-badge-tokens.js +359 -0
- package/src/components/badge/tokens/mdv2-badge-tokens.js +392 -0
- package/src/components/breadcrumb/Breadcrumb.stories.ts +50 -0
- package/src/components/breadcrumb/Breadcrumb.test.ts +38 -0
- package/src/components/breadcrumb/Breadcrumb.ts +79 -0
- package/src/components/breadcrumb/scss/breadcrumb.scss +39 -0
- package/src/components/breadcrumb/scss/mixins.scss +5 -0
- package/src/components/breadcrumb/scss/module.scss +15 -0
- package/src/components/breadcrumb/scss/settings.scss +6 -0
- package/src/components/breadcrumb/tokens/lm-breadcrumb-token.js +23 -0
- package/src/components/breadcrumb/tokens/md-breadcrumb-token.js +23 -0
- package/src/components/breadcrumb/tokens/mdv2-breadcrumb-token.js +18 -0
- package/src/components/button/Button.mdx +77 -0
- package/src/components/button/Button.stories.ts +90 -0
- package/src/components/button/Button.test.ts +278 -0
- package/src/components/button/Button.ts +384 -0
- package/src/components/button/README.md +72 -0
- package/src/components/button/scss/button.scss +1067 -0
- package/src/components/button/scss/mixins.scss +281 -0
- package/src/components/button/scss/module.scss +16 -0
- package/src/components/button/scss/settings.scss +241 -0
- package/src/components/button/tokens/lm-button-tokens.js +467 -0
- package/src/components/button/tokens/mdv2-button-tokens.js +544 -0
- package/src/components/button-group/ButtonGroup.stories.ts +45 -0
- package/src/components/button-group/ButtonGroup.test.ts +146 -0
- package/src/components/button-group/ButtonGroup.ts +219 -0
- package/src/components/button-group/scss/button-group.scss +95 -0
- package/src/components/button-group/scss/module.scss +14 -0
- package/src/components/button-group/scss/settings.scss +5 -0
- package/src/components/button-group/tokens/lm-button-group-tokens.js +38 -0
- package/src/components/button-group/tokens/md-button-group-tokens.js +38 -0
- package/src/components/button-group/tokens/mdv2-button-group-tokens.js +40 -0
- package/src/components/card/Card.stories.ts +83 -0
- package/src/components/card/Card.test.ts +83 -0
- package/src/components/card/Card.ts +179 -0
- package/src/components/card/scss/card.scss +131 -0
- package/src/components/card/scss/module.scss +13 -0
- package/src/components/card/scss/settings.scss +11 -0
- package/src/components/card-ai/CardAi.stories.ts +58 -0
- package/src/components/card-ai/CardAi.test.ts +203 -0
- package/src/components/card-ai/CardAi.ts +232 -0
- package/src/components/card-ai/scss/card-ai.scss +107 -0
- package/src/components/card-ai/scss/module.scss +13 -0
- package/src/components/card-ai/scss/settings.scss +17 -0
- package/src/components/card-ai/tokens/lm-card-ai-tokens.js +16 -0
- package/src/components/card-ai/tokens/md-card-ai-tokens.js +16 -0
- package/src/components/card-ai/tokens/mdv2-card-ai-tokens.js +16 -0
- package/src/components/chat-message/ChatMessage.stories.ts +41 -0
- package/src/components/chat-message/ChatMessage.test.ts +53 -0
- package/src/components/chat-message/ChatMessage.ts +52 -0
- package/src/components/chat-message/scss/chat-message.scss +49 -0
- package/src/components/chat-message/scss/mixins.scss +6 -0
- package/src/components/chat-message/scss/module.scss +16 -0
- package/src/components/chat-message/scss/settings.scss +7 -0
- package/src/components/chat-message/tokens/lm-chat-message-tokens.js +18 -0
- package/src/components/chat-message/tokens/md-chat-message-tokens.js +18 -0
- package/src/components/chat-message/tokens/mdv2-chat-message-tokens.js +15 -0
- package/src/components/checkbox/Checkbox.stories.ts +58 -0
- package/src/components/checkbox/Checkbox.test.ts +124 -0
- package/src/components/checkbox/Checkbox.ts +172 -0
- package/src/components/checkbox/CheckboxGroup.test.ts +43 -0
- package/src/components/checkbox/CheckboxGroup.ts +91 -0
- package/src/components/checkbox/scss/checkbox.scss +152 -0
- package/src/components/checkbox/scss/checkboxgroup.scss +17 -0
- package/src/components/checkbox/scss/mixins.scss +0 -0
- package/src/components/checkbox/scss/module.scss +9 -0
- package/src/components/checkbox/scss/settings.scss +15 -0
- package/src/components/checkbox/tokens/lm-checkbox-tokens.js +82 -0
- package/src/components/checkbox/tokens/md-checkbox-tokens.js +83 -0
- package/src/components/checkbox/tokens/mdv2-checkbox-tokens.js +65 -0
- package/src/components/chip/Chip.stories.ts +80 -0
- package/src/components/chip/Chip.test.ts +137 -0
- package/src/components/chip/Chip.ts +282 -0
- package/src/components/chip/scss/chip.scss +469 -0
- package/src/components/chip/scss/mixins.scss +54 -0
- package/src/components/chip/scss/module.scss +17 -0
- package/src/components/chip/scss/settings.scss +5 -0
- package/src/components/coachmark/Coachmark.stories.ts +49 -0
- package/src/components/coachmark/Coachmark.test.ts +143 -0
- package/src/components/coachmark/Coachmark.ts +155 -0
- package/src/components/coachmark/scss/coachmarks.scss +281 -0
- package/src/components/coachmark/scss/module.scss +10 -0
- package/src/components/coachmark/scss/settings.scss +7 -0
- package/src/components/coachmark/tokens/lm-coachmark-tokens.js +140 -0
- package/src/components/coachmark/tokens/md-coachmark-tokens.js +130 -0
- package/src/components/coachmark/tokens/mdv2-coachmark-tokens.js +117 -0
- package/src/components/coachmark-popover/CoachmarkPopover.ts +366 -0
- package/src/components/coachmark-popover/scss/coachmark-popover.scss +84 -0
- package/src/components/coachmark-popover/scss/module.scss +1 -0
- package/src/components/coachmark-popover/scss/settings.scss +14 -0
- package/src/components/code-editor/CodeEditor.stories.ts +37 -0
- package/src/components/code-editor/CodeEditor.test.ts +46 -0
- package/src/components/code-editor/CodeEditor.ts +183 -0
- package/src/components/code-editor/scss/code-editor.scss +157 -0
- package/src/components/code-editor/scss/module.scss +12 -0
- package/src/components/code-editor/scss/settings.scss +10 -0
- package/src/components/combobox/ComboBox.stories.ts +162 -0
- package/src/components/combobox/ComboBox.test.ts +1530 -0
- package/src/components/combobox/ComboBox.ts +1869 -0
- package/src/components/combobox/scss/combobox.scss +637 -0
- package/src/components/combobox/scss/mixins.scss +9 -0
- package/src/components/combobox/scss/module.scss +17 -0
- package/src/components/combobox/scss/settings.scss +39 -0
- package/src/components/combobox/tokens/lm-combobox-tokens.js +164 -0
- package/src/components/combobox/tokens/md-combobox-tokens.js +168 -0
- package/src/components/combobox/tokens/mdv2-combobox-tokens.js +146 -0
- package/src/components/date-range-picker/DateRangePicker.stories.ts +44 -0
- package/src/components/date-range-picker/DateRangePicker.test.ts +156 -0
- package/src/components/date-range-picker/DateRangePicker.ts +86 -0
- package/src/components/date-range-picker/scss/daterangepicker.scss +0 -0
- package/src/components/date-range-picker/tokens/lm-date-range-picker-tokens.js +26 -0
- package/src/components/date-range-picker/tokens/md-date-range-picker-tokens.js +26 -0
- package/src/components/date-range-picker/tokens/mdv2-date-range-picker-tokens.js +26 -0
- package/src/components/date-time-picker/DateTimePicker.stories.ts +54 -0
- package/src/components/date-time-picker/DateTimePicker.test.ts +37 -0
- package/src/components/date-time-picker/DateTimePicker.ts +187 -0
- package/src/components/date-time-picker/scss/date-time-picker.scss +7 -0
- package/src/components/date-time-picker/scss/module.scss +9 -0
- package/src/components/date-time-picker/scss/settings.scss +1 -0
- package/src/components/datepicker/DatePicker.stories.ts +45 -0
- package/src/components/datepicker/DatePicker.test.ts +97 -0
- package/src/components/datepicker/DatePicker.ts +290 -0
- package/src/components/datepicker/datepicker-calendar/DatePickerCalendar.test.ts +70 -0
- package/src/components/datepicker/datepicker-calendar/DatePickerCalendar.ts +179 -0
- package/src/components/datepicker/datepicker-day/DatePickerDay.test.ts +48 -0
- package/src/components/datepicker/datepicker-day/DatePickerDay.ts +173 -0
- package/src/components/datepicker/datepicker-month/DatePickerMonth.test.ts +13 -0
- package/src/components/datepicker/datepicker-month/DatePickerMonth.ts +60 -0
- package/src/components/datepicker/datepicker-week/DatePickerWeek.test.ts +13 -0
- package/src/components/datepicker/datepicker-week/DatePickerWeek.ts +56 -0
- package/src/components/datepicker/scss/datepicker.scss +263 -0
- package/src/components/datepicker/scss/module.scss +9 -0
- package/src/components/datepicker/scss/settings.scss +9 -0
- package/src/components/datepicker/tokens/lm-datepicker-tokens.js +68 -0
- package/src/components/datepicker/tokens/md-datepicker-tokens.js +68 -0
- package/src/components/datepicker/tokens/mdv2-datepicker-tokens.js +91 -0
- package/src/components/draggable/Draggable.mdx +258 -0
- package/src/components/draggable/Draggable.stories.ts +166 -0
- package/src/components/draggable/Draggable.test.ts +116 -0
- package/src/components/draggable/Draggable.ts +203 -0
- package/src/components/draggable/DraggableItem.test.ts +45 -0
- package/src/components/draggable/DraggableItem.ts +58 -0
- package/src/components/draggable/scss/draggable-item.scss +70 -0
- package/src/components/draggable/scss/module.scss +12 -0
- package/src/components/draggable/scss/settings.scss +6 -0
- package/src/components/dropdown/Dropdown.stories.ts +110 -0
- package/src/components/dropdown/Dropdown.test.ts +461 -0
- package/src/components/dropdown/Dropdown.ts +903 -0
- package/src/components/dropdown/scss/dropdown.scss +497 -0
- package/src/components/dropdown/scss/mixins.scss +23 -0
- package/src/components/dropdown/scss/module.scss +25 -0
- package/src/components/dropdown/scss/settings.scss +28 -0
- package/src/components/dropdown/tokens/lm-dropdown-tokens.js +68 -0
- package/src/components/dropdown/tokens/md-dropdown-tokens.js +68 -0
- package/src/components/dropdown/tokens/mdv2-dropdown-tokens.js +74 -0
- package/src/components/editable-textfield/EditableTextfield.stories.ts +93 -0
- package/src/components/editable-textfield/EditableTextfield.test.ts +219 -0
- package/src/components/editable-textfield/EditableTextfield.ts +262 -0
- package/src/components/editable-textfield/scss/editable-textfield.scss +128 -0
- package/src/components/editable-textfield/scss/module.scss +14 -0
- package/src/components/editable-textfield/scss/settings.scss +6 -0
- package/src/components/editable-textfield/tokens/lm-editabletextfield-tokens.js +130 -0
- package/src/components/editable-textfield/tokens/md-editabletextfield-tokens.js +118 -0
- package/src/components/editable-textfield/tokens/mdv2-editabletextfield-tokens.js +129 -0
- package/src/components/favorite/Favorite.mdx +27 -0
- package/src/components/favorite/Favorite.stories.ts +43 -0
- package/src/components/favorite/Favorite.test.ts +116 -0
- package/src/components/favorite/Favorite.ts +119 -0
- package/src/components/favorite/scss/favorite.scss +118 -0
- package/src/components/favorite/scss/module.scss +7 -0
- package/src/components/favorite/scss/settings.scss +3 -0
- package/src/components/floating-modal/Floating.mdx +42 -0
- package/src/components/floating-modal/FloatingMinimizedModal.test.ts +92 -0
- package/src/components/floating-modal/FloatingMinimizedModal.ts +278 -0
- package/src/components/floating-modal/FloatingModal.stories.ts +67 -0
- package/src/components/floating-modal/FloatingModal.test.ts +114 -0
- package/src/components/floating-modal/FloatingModal.ts +372 -0
- package/src/components/floating-modal/README.md +36 -0
- package/src/components/floating-modal/scss/floating.scss +85 -0
- package/src/components/floating-modal/scss/module.scss +19 -0
- package/src/components/floating-modal/scss/settings.scss +5 -0
- package/src/components/floating-modal/tokens/lm-floating-modal-tokens.js +46 -0
- package/src/components/floating-modal/tokens/md-floating-modal-tokens.js +46 -0
- package/src/components/floating-modal/tokens/mdv2-floating-modal-tokens.js +38 -0
- package/src/components/form/Form.stories.ts +54 -0
- package/src/components/form/Form.test.ts +57 -0
- package/src/components/form/Form.ts +239 -0
- package/src/components/grabber/Grabber.stories.ts +54 -0
- package/src/components/grabber/Grabber.test.ts +194 -0
- package/src/components/grabber/Grabber.ts +224 -0
- package/src/components/grabber/scss/grabber.scss +133 -0
- package/src/components/grabber/scss/module.scss +1 -0
- package/src/components/grabber/tokens/lm-grabber-tokens.js +39 -0
- package/src/components/grabber/tokens/md-grabber-tokens.js +39 -0
- package/src/components/grabber/tokens/mdv2-grabber-tokens.js +38 -0
- package/src/components/help-text/HelpText.test.ts +38 -0
- package/src/components/help-text/HelpText.ts +69 -0
- package/src/components/help-text/scss/help-text.scss +50 -0
- package/src/components/help-text/scss/mixins.scss +14 -0
- package/src/components/help-text/scss/module.scss +13 -0
- package/src/components/help-text/scss/settings.scss +5 -0
- package/src/components/help-text/tokens/lm-help-text-tokens.js +16 -0
- package/src/components/help-text/tokens/md-help-text-tokens.js +16 -0
- package/src/components/help-text/tokens/mdv2-help-text-tokens.js +14 -0
- package/src/components/icon/Icon.stories.ts +87 -0
- package/src/components/icon/Icon.test.ts +181 -0
- package/src/components/icon/Icon.ts +482 -0
- package/src/components/icon/momentum-ui-to-design-icons.json +815 -0
- package/src/components/icon/scss/icon.scss +38 -0
- package/src/components/icon/scss/module.scss +17 -0
- package/src/components/icon/scss/settings.scss +13 -0
- package/src/components/input/Input.stories.ts +148 -0
- package/src/components/input/Input.test.ts +347 -0
- package/src/components/input/Input.ts +560 -0
- package/src/components/input/scss/input.scss +564 -0
- package/src/components/input/scss/module.scss +22 -0
- package/src/components/input/tokens/lm-input-tokens.js +156 -0
- package/src/components/input/tokens/md-input-tokens.js +146 -0
- package/src/components/input/tokens/mdv2-input-tokens.js +171 -0
- package/src/components/input-file/InputFile.stories.ts +20 -0
- package/src/components/input-file/InputFile.test.ts +39 -0
- package/src/components/input-file/InputFile.ts +115 -0
- package/src/components/input-file/scss/input-file.scss +8 -0
- package/src/components/input-file/scss/module.scss +6 -0
- package/src/components/label/Label.stories.ts +55 -0
- package/src/components/label/Label.test.ts +26 -0
- package/src/components/label/Label.ts +81 -0
- package/src/components/label/scss/label.scss +44 -0
- package/src/components/label/scss/mixins.scss +25 -0
- package/src/components/label/scss/module.scss +17 -0
- package/src/components/label/scss/settings.scss +8 -0
- package/src/components/label/tokens/lm-label-tokens.js +18 -0
- package/src/components/label/tokens/md-label-tokens.js +18 -0
- package/src/components/label/tokens/mdv2-label-tokens.js +15 -0
- package/src/components/link/Link.stories.ts +59 -0
- package/src/components/link/Link.test.ts +98 -0
- package/src/components/link/Link.ts +123 -0
- package/src/components/link/scss/link.scss +43 -0
- package/src/components/link/scss/mixins.scss +124 -0
- package/src/components/link/scss/module.scss +11 -0
- package/src/components/link/scss/settings.scss +5 -0
- package/src/components/link/tokens/lm-link-tokens.js +131 -0
- package/src/components/link/tokens/md-link-tokens.js +127 -0
- package/src/components/link/tokens/mdv2-link-tokens.js +120 -0
- package/src/components/list/List.stories.ts +55 -0
- package/src/components/list/List.test.ts +214 -0
- package/src/components/list/List.ts +199 -0
- package/src/components/list/ListItem.test.ts +59 -0
- package/src/components/list/ListItem.ts +69 -0
- package/src/components/list/scss/list.scss +26 -0
- package/src/components/list/scss/listitem.scss +88 -0
- package/src/components/list/scss/mixins.scss +8 -0
- package/src/components/list/scss/module.scss +15 -0
- package/src/components/list/scss/settings.scss +7 -0
- package/src/components/list/tokens/lm-list-tokens.js +46 -0
- package/src/components/list/tokens/md-list-tokens.js +46 -0
- package/src/components/list/tokens/mdv2-list-tokens.js +46 -0
- package/src/components/loading/Loading.stories.ts +39 -0
- package/src/components/loading/Loading.test.ts +29 -0
- package/src/components/loading/Loading.ts +48 -0
- package/src/components/loading/scss/loading.scss +78 -0
- package/src/components/loading/scss/module.scss +1 -0
- package/src/components/meeting-alert/CompositeAvatar.ts +37 -0
- package/src/components/meeting-alert/MeetingAlert.mdx +187 -0
- package/src/components/meeting-alert/MeetingAlert.stories.ts +182 -0
- package/src/components/meeting-alert/MeetingAlert.test.ts +227 -0
- package/src/components/meeting-alert/MeetingAlert.ts +203 -0
- package/src/components/meeting-alert/scss/alert.scss +244 -0
- package/src/components/meeting-alert/scss/mixins.scss +13 -0
- package/src/components/meeting-alert/scss/module.scss +20 -0
- package/src/components/meeting-alert/scss/settings.scss +27 -0
- package/src/components/meeting-alert/tokens/lm-meeting-alert-tokens.js +15 -0
- package/src/components/meeting-alert/tokens/md-meeting-alert-tokens.js +15 -0
- package/src/components/meeting-alert/tokens/mdv2-meeting-alert-tokens.js +43 -0
- package/src/components/menu/Menu.stories.ts +66 -0
- package/src/components/menu/Menu.test.ts +109 -0
- package/src/components/menu/Menu.ts +218 -0
- package/src/components/menu/MenuItem.test.ts +49 -0
- package/src/components/menu/MenuItem.ts +159 -0
- package/src/components/menu/scss/menu-item.scss +61 -0
- package/src/components/menu/scss/menu.scss +31 -0
- package/src/components/menu/scss/module.scss +15 -0
- package/src/components/menu/scss/settings.scss +18 -0
- package/src/components/menu/tokens/lm-menu-tokens.js +27 -0
- package/src/components/menu/tokens/md-menu-tokens.js +27 -0
- package/src/components/menu/tokens/mdv2-menu-tokens.js +42 -0
- package/src/components/menu-overlay/MenuOverlay.stories.ts +104 -0
- package/src/components/menu-overlay/MenuOverlay.test.ts +634 -0
- package/src/components/menu-overlay/MenuOverlay.ts +476 -0
- package/src/components/menu-overlay/scss/menu-overlay.scss +109 -0
- package/src/components/menu-overlay/scss/module.scss +12 -0
- package/src/components/menu-overlay/scss/settings.scss +6 -0
- package/src/components/modal/Modal.stories.ts +74 -0
- package/src/components/modal/Modal.test.ts +217 -0
- package/src/components/modal/Modal.ts +292 -0
- package/src/components/modal/scss/mixins.scss +109 -0
- package/src/components/modal/scss/modal.scss +357 -0
- package/src/components/modal/scss/module.scss +18 -0
- package/src/components/modal/scss/settings.scss +59 -0
- package/src/components/modal/tokens/lm-modal-tokens.js +44 -0
- package/src/components/modal/tokens/md-modal-tokens.js +44 -0
- package/src/components/modal/tokens/mdv2-modal-tokens.js +36 -0
- package/src/components/pagination/Pagination.stories.ts +32 -0
- package/src/components/pagination/Pagination.test.ts +74 -0
- package/src/components/pagination/Pagination.ts +219 -0
- package/src/components/pagination/scss/mixins.scss +11 -0
- package/src/components/pagination/scss/module.scss +18 -0
- package/src/components/pagination/scss/pagination.scss +120 -0
- package/src/components/pagination/scss/settings.scss +11 -0
- package/src/components/pagination/tokens/lm-pagination-tokens.js +49 -0
- package/src/components/pagination/tokens/md-pagination-tokens.js +49 -0
- package/src/components/pagination/tokens/mdv2-pagination-tokens.js +39 -0
- package/src/components/phone-input/PhoneInput.stories.ts +39 -0
- package/src/components/phone-input/PhoneInput.test.ts +198 -0
- package/src/components/phone-input/PhoneInput.ts +288 -0
- package/src/components/phone-input/scss/module.scss +7 -0
- package/src/components/phone-input/scss/phoneInput.scss +103 -0
- package/src/components/phone-input/scss/settings.scss +3 -0
- package/src/components/phone-input/tokens/lm-phone-input-tokens.js +26 -0
- package/src/components/phone-input/tokens/md-phone-input-tokens.js +26 -0
- package/src/components/phone-input/tokens/mdv2-phone-input-tokens.js +22 -0
- package/src/components/popover/Popover.ts +580 -0
- package/src/components/popover/Popover.types.ts +26 -0
- package/src/components/popover/scss/module.scss +2 -0
- package/src/components/popover/scss/popover.scss +131 -0
- package/src/components/popover/scss/settings.scss +11 -0
- package/src/components/popover/tokens/lm-popover-tokens.js +18 -0
- package/src/components/popover/tokens/md-popover-tokens.js +18 -0
- package/src/components/popover/tokens/mdv2-popover-tokens.js +18 -0
- package/src/components/progress-bar/ProgressBar.stories.ts +43 -0
- package/src/components/progress-bar/ProgressBar.test.ts +120 -0
- package/src/components/progress-bar/ProgressBar.ts +112 -0
- package/src/components/progress-bar/scss/mixins.scss +49 -0
- package/src/components/progress-bar/scss/module.scss +10 -0
- package/src/components/progress-bar/scss/progress.scss +77 -0
- package/src/components/progress-bar/scss/settings.scss +29 -0
- package/src/components/progress-bar/tokens/lm-progress-bar-tokens.js +28 -0
- package/src/components/progress-bar/tokens/md-progress-bar-tokens.js +28 -0
- package/src/components/progress-bar/tokens/mdv2-progress-bar-tokens.js +36 -0
- package/src/components/radio/Radio.test.ts +66 -0
- package/src/components/radio/Radio.ts +94 -0
- package/src/components/radio/RadioGroup.stories.ts +49 -0
- package/src/components/radio/RadioGroup.test.ts +209 -0
- package/src/components/radio/RadioGroup.ts +195 -0
- package/src/components/radio/scss/mixins.scss +7 -0
- package/src/components/radio/scss/module.scss +14 -0
- package/src/components/radio/scss/radio.scss +150 -0
- package/src/components/radio/scss/radiogroup.scss +29 -0
- package/src/components/radio/scss/settings.scss +18 -0
- package/src/components/radio/tokens/lm-radio-tokens.js +84 -0
- package/src/components/radio/tokens/md-radio-tokens.js +84 -0
- package/src/components/radio/tokens/mdv2-radio-tokens.js +67 -0
- package/src/components/sass-stats/README.md +25 -0
- package/src/components/sass-stats/SassStats.test.ts +13 -0
- package/src/components/sass-stats/SassStats.ts +110 -0
- package/src/components/slider/Slider.stories.ts +62 -0
- package/src/components/slider/Slider.test.ts +128 -0
- package/src/components/slider/Slider.ts +283 -0
- package/src/components/slider/scss/mixins.scss +5 -0
- package/src/components/slider/scss/module.scss +17 -0
- package/src/components/slider/scss/settings.scss +10 -0
- package/src/components/slider/scss/slider.scss +188 -0
- package/src/components/slider/tokens/lm-slider-token.js +57 -0
- package/src/components/slider/tokens/md-slider-tokens.js +61 -0
- package/src/components/slider/tokens/mdv2-slider-token.js +50 -0
- package/src/components/spinner/Spinner.stories.ts +36 -0
- package/src/components/spinner/Spinner.test.ts +18 -0
- package/src/components/spinner/Spinner.ts +40 -0
- package/src/components/spinner/scss/mixins.scss +36 -0
- package/src/components/spinner/scss/module.scss +4 -0
- package/src/components/spinner/scss/settings.scss +3 -0
- package/src/components/spinner/scss/spinner.scss +50 -0
- package/src/components/spinner/tokens/lm-spinner-tokens.js +16 -0
- package/src/components/spinner/tokens/md-spinner-tokens.js +18 -0
- package/src/components/spinner/tokens/mdv2-spinner-tokens.js +15 -0
- package/src/components/table/Table.stories.ts +76 -0
- package/src/components/table/Table.test.ts +51 -0
- package/src/components/table/Table.ts +234 -0
- package/src/components/table/scss/mixins.scss +6 -0
- package/src/components/table/scss/module.scss +27 -0
- package/src/components/table/scss/settings.scss +11 -0
- package/src/components/table/scss/table.scss +148 -0
- package/src/components/table/tokens/lm-table-tokens.js +42 -0
- package/src/components/table/tokens/md-table-tokens.js +42 -0
- package/src/components/table/tokens/mdv2-table-tokens.js +35 -0
- package/src/components/table-advanced/TableAdvanced.md +233 -0
- package/src/components/table-advanced/TableAdvanced.mdx +240 -0
- package/src/components/table-advanced/TableAdvanced.stories.ts +161 -0
- package/src/components/table-advanced/TableAdvanced.test.ts +374 -0
- package/src/components/table-advanced/TableAdvanced.ts +1081 -0
- package/src/components/table-advanced/scss/module.scss +27 -0
- package/src/components/table-advanced/scss/settings.scss +16 -0
- package/src/components/table-advanced/scss/table-advanced.scss +399 -0
- package/src/components/table-advanced/src/decorators.ts +150 -0
- package/src/components/table-advanced/src/filter.ts +86 -0
- package/src/components/table-advanced/tokens/lm-table-advanced-tokens.js +64 -0
- package/src/components/table-advanced/tokens/md-table-advanced-tokens.js +64 -0
- package/src/components/table-advanced/tokens/mdv2-table-advanced-tokens.js +64 -0
- package/src/components/tabs/Tab.test.ts +103 -0
- package/src/components/tabs/Tab.ts +219 -0
- package/src/components/tabs/TabPanel.test.ts +31 -0
- package/src/components/tabs/TabPanel.ts +44 -0
- package/src/components/tabs/Tabs.stories.ts +171 -0
- package/src/components/tabs/Tabs.test.ts +676 -0
- package/src/components/tabs/Tabs.ts +1231 -0
- package/src/components/tabs/scss/mixins.scss +6 -0
- package/src/components/tabs/scss/module.scss +14 -0
- package/src/components/tabs/scss/settings.scss +25 -0
- package/src/components/tabs/scss/tab.scss +373 -0
- package/src/components/tabs/scss/tabs.scss +250 -0
- package/src/components/tabs/tokens/lm-tabs-tokens.js +92 -0
- package/src/components/tabs/tokens/md-tabs-tokens.js +86 -0
- package/src/components/tabs/tokens/mdv2-tabs-tokens.js +70 -0
- package/src/components/taskitem/TaskItem.stories.ts +70 -0
- package/src/components/taskitem/TaskItem.test.ts +496 -0
- package/src/components/taskitem/TaskItem.ts +293 -0
- package/src/components/taskitem/scss/mixins.scss +42 -0
- package/src/components/taskitem/scss/module.scss +15 -0
- package/src/components/taskitem/scss/settings.scss +45 -0
- package/src/components/taskitem/scss/task-item.scss +229 -0
- package/src/components/taskitem/tokens/lm-taskitem-tokens.js +72 -0
- package/src/components/taskitem/tokens/md-taskitem-tokens.js +72 -0
- package/src/components/taskitem/tokens/mdv2-taskitem-tokens.js +58 -0
- package/src/components/theme/README.md +13 -0
- package/src/components/theme/Theme.test.ts +157 -0
- package/src/components/theme/Theme.ts +392 -0
- package/src/components/theme/index.ts +8 -0
- package/src/components/timepicker/TimePicker.stories.ts +39 -0
- package/src/components/timepicker/TimePicker.test.ts +145 -0
- package/src/components/timepicker/TimePicker.ts +425 -0
- package/src/components/timepicker/scss/module.scss +9 -0
- package/src/components/timepicker/scss/settings.scss +8 -0
- package/src/components/timepicker/scss/timepicker.scss +71 -0
- package/src/components/toggle-switch/ToggleSwitch.stories.ts +48 -0
- package/src/components/toggle-switch/ToggleSwitch.test.ts +92 -0
- package/src/components/toggle-switch/ToggleSwitch.ts +102 -0
- package/src/components/toggle-switch/scss/mixins.scss +114 -0
- package/src/components/toggle-switch/scss/module.scss +7 -0
- package/src/components/toggle-switch/scss/settings.scss +16 -0
- package/src/components/toggle-switch/scss/toggle-switch.scss +197 -0
- package/src/components/toggle-switch/tokens/lm-toggle-tokens.js +54 -0
- package/src/components/toggle-switch/tokens/md-toggle-tokens.js +54 -0
- package/src/components/toggle-switch/tokens/mdv2-toggle-tokens.js +54 -0
- package/src/components/tooltip/Tooltip.stories.ts +55 -0
- package/src/components/tooltip/Tooltip.test.ts +108 -0
- package/src/components/tooltip/Tooltip.ts +239 -0
- package/src/components/tooltip/scss/module.scss +9 -0
- package/src/components/tooltip/scss/settings.scss +11 -0
- package/src/components/tooltip/scss/tooltip.scss +151 -0
- package/src/components/tooltip/tokens/lm-tooltip-tokens.js +18 -0
- package/src/components/tooltip/tokens/md-tooltip-tokens.js +18 -0
- package/src/components/tooltip/tokens/mdv2-tooltip-tokens.js +42 -0
- package/src/constants.ts +42 -0
- package/src/index.ts +82 -0
- package/src/internal-components/color-table/ColorTable.stories.ts +31 -0
- package/src/internal-components/color-table/ColorTable.ts +83 -0
- package/src/internal-components/color-table/data.ts +203 -0
- package/src/internal-components/color-table/scss/color-table.scss +739 -0
- package/src/internal-components/color-table/scss/module.scss +11 -0
- package/src/internal-components/color-table/utils.ts +552 -0
- package/src/managers/ThemeManager.ts +91 -0
- package/src/mixins/CustomElementCheck.ts +25 -0
- package/src/mixins/DedupeMixin.test.ts +81 -0
- package/src/mixins/DedupeMixin.ts +54 -0
- package/src/mixins/FocusMixin.test.ts +116 -0
- package/src/mixins/FocusMixin.ts +136 -0
- package/src/mixins/FocusTrapMixin.test.ts +560 -0
- package/src/mixins/FocusTrapMixin.ts +492 -0
- package/src/mixins/ResizeMixin.test.ts +84 -0
- package/src/mixins/ResizeMixin.ts +142 -0
- package/src/mixins/RovingTabIndexMixin.test.ts +60 -0
- package/src/mixins/RovingTabIndexMixin.ts +135 -0
- package/src/mixins/SlottedMixin.test.ts +68 -0
- package/src/mixins/SlottedMixin.ts +116 -0
- package/src/mixins/index.ts +17 -0
- package/src/templates/color-table-data-string.hbs +22 -0
- package/src/templates/colors-settings.hbs +21 -0
- package/src/templates/colors.hbs +35 -0
- package/src/templates/component-colors.hbs +40 -0
- package/src/templates/css-color-variables.hbs +22 -0
- package/src/templates/dark-colors.hbs +33 -0
- package/src/templates/light-colors.hbs +33 -0
- package/src/templates/semantic-color-dark.hbs +28 -0
- package/src/templates/semantic-color-light.hbs +28 -0
- package/src/templates/semantic-color-settings.hbs +38 -0
- package/src/tokens/Tokens.test.ts +12 -0
- package/src/tokens/tokenImports.js +7 -0
- package/src/tsconfig.json +23 -0
- package/src/types/declare.d.ts +31 -0
- package/src/types/globals.d.ts +5 -0
- package/src/utils/clearVars.js +47 -0
- package/src/utils/createTokenFilesModule.js +88 -0
- package/src/utils/dateUtils.test.ts +174 -0
- package/src/utils/dateUtils.ts +102 -0
- package/src/utils/enums.ts +721 -0
- package/src/utils/generateColorTableData.js +41 -0
- package/src/utils/generateScssFromTokens.js +245 -0
- package/src/utils/helpers.ts +150 -0
- package/src/utils/keyboard.ts +5 -0
- package/src/utils/validateIconMapping.js +55 -0
- package/src/utils/validations.ts +29 -0
- package/src/wc_scss/colors/settings-base.scss +208 -0
- package/src/wc_scss/colors/settings-transparencies.scss +54 -0
- package/src/wc_scss/colors/settings.scss +1 -0
- package/src/wc_scss/generic/global.scss +117 -0
- package/src/wc_scss/generic/normalize.scss +422 -0
- package/src/wc_scss/icon/settings.scss +16 -0
- package/src/wc_scss/path.scss +4 -0
- package/src/wc_scss/reset.scss +27 -0
- package/src/wc_scss/settings/button-settings.scss +194 -0
- package/src/wc_scss/settings/core.scss +133 -0
- package/src/wc_scss/settings/focus.scss +9 -0
- package/src/wc_scss/settings/form-controls.scss +23 -0
- package/src/wc_scss/settings/forms.scss +29 -0
- package/src/wc_scss/settings/input.scss +65 -0
- package/src/wc_scss/settings/list-item.scss +86 -0
- package/src/wc_scss/settings/list.scss +10 -0
- package/src/wc_scss/settings/media.scss +116 -0
- package/src/wc_scss/settings/overlay.scss +6 -0
- package/src/wc_scss/settings/rem.scss +1 -0
- package/src/wc_scss/settings/z-index.scss +9 -0
- package/src/wc_scss/themes/global--dark.scss +116 -0
- package/src/wc_scss/themes/global--light.scss +116 -0
- package/src/wc_scss/themes/global--lm.scss +5 -0
- package/src/wc_scss/themes/global--md.scss +5 -0
- package/src/wc_scss/themes/global--mdv2.scss +187 -0
- package/src/wc_scss/tools/functions/core.scss +185 -0
- package/src/wc_scss/tools/mixins/avatar.scss +32 -0
- package/src/wc_scss/tools/mixins/baseline.scss +71 -0
- package/src/wc_scss/tools/mixins/border-radius.scss +26 -0
- package/src/wc_scss/tools/mixins/button.scss +256 -0
- package/src/wc_scss/tools/mixins/core.scss +204 -0
- package/src/wc_scss/tools/mixins/easing.scss +63 -0
- package/src/wc_scss/tools/mixins/flex.scss +14 -0
- package/src/wc_scss/tools/mixins/focus.scss +35 -0
- package/src/wc_scss/tools/mixins/input.scss +155 -0
- package/src/wc_scss/tools/mixins/nav-divider.scss +10 -0
- package/src/wc_scss/tools/mixins/scrollbar.scss +40 -0
- package/src/wc_scss/tools/mixins/spacing.scss +211 -0
- package/src/wc_scss/tools/mixins/spinner.scss +38 -0
- package/src/wc_scss/typography/mixins.scss +208 -0
- package/src/wc_scss/typography/settings.scss +300 -0
- package/src/wc_scss/typography/typography.scss +322 -0
- package/stats/cssStats.js +17 -0
- package/stats/stats-loader.js +23 -0
- package/stats/utils.js +5 -0
- package/stats/writeFileSyncRecursive.js +20 -0
- package/tsconfig.json +13 -0
- package/webpack.config.dev.server.ts +27 -0
- package/webpack.config.ts +320 -0
- package/webpack.plugin.LoadChunks.ts +76 -0
- package/dist/assets/fonts/CiscoSansTT-Medium.woff +0 -0
- package/dist/assets/fonts/CiscoSansTT-Medium.woff2 +0 -0
- package/dist/assets/fonts/CiscoSansTT-MediumOblique.woff +0 -0
- package/dist/assets/fonts/CiscoSansTT-MediumOblique.woff2 +0 -0
- package/dist/assets/fonts/CiscoSansTTBold.woff +0 -0
- package/dist/assets/fonts/CiscoSansTTBold.woff2 +0 -0
- package/dist/assets/fonts/CiscoSansTTBoldOblique.woff +0 -0
- package/dist/assets/fonts/CiscoSansTTBoldOblique.woff2 +0 -0
- package/dist/assets/fonts/CiscoSansTTCondBold.woff +0 -0
- package/dist/assets/fonts/CiscoSansTTCondBold.woff2 +0 -0
- package/dist/assets/fonts/CiscoSansTTCondRegular.woff +0 -0
- package/dist/assets/fonts/CiscoSansTTCondRegular.woff2 +0 -0
- package/dist/assets/fonts/CiscoSansTTExtraLight.woff +0 -0
- package/dist/assets/fonts/CiscoSansTTExtraLight.woff2 +0 -0
- package/dist/assets/fonts/CiscoSansTTExtraLightOblique.woff +0 -0
- package/dist/assets/fonts/CiscoSansTTExtraLightOblique.woff2 +0 -0
- package/dist/assets/fonts/CiscoSansTTHeavy.woff +0 -0
- package/dist/assets/fonts/CiscoSansTTHeavy.woff2 +0 -0
- package/dist/assets/fonts/CiscoSansTTHeavyOblique.woff +0 -0
- package/dist/assets/fonts/CiscoSansTTHeavyOblique.woff2 +0 -0
- package/dist/assets/fonts/CiscoSansTTLight.woff +0 -0
- package/dist/assets/fonts/CiscoSansTTLight.woff2 +0 -0
- package/dist/assets/fonts/CiscoSansTTLightOblique.woff +0 -0
- package/dist/assets/fonts/CiscoSansTTLightOblique.woff2 +0 -0
- package/dist/assets/fonts/CiscoSansTTRegular.woff +0 -0
- package/dist/assets/fonts/CiscoSansTTRegular.woff2 +0 -0
- package/dist/assets/fonts/CiscoSansTTRegularOblique.woff +0 -0
- package/dist/assets/fonts/CiscoSansTTRegularOblique.woff2 +0 -0
- package/dist/assets/fonts/CiscoSansTTThin.woff +0 -0
- package/dist/assets/fonts/CiscoSansTTThin.woff2 +0 -0
- package/dist/assets/fonts/CiscoSansTTThinOblique.woff +0 -0
- package/dist/assets/fonts/CiscoSansTTThinOblique.woff2 +0 -0
- package/dist/assets/fonts/Inter.var.woff2 +0 -0
- package/dist/assets/fonts/index.html +0 -18578
- package/dist/assets/fonts/momentum-ui-icons.svg +0 -9270
- package/dist/assets/fonts/momentum-ui-icons.ttf +0 -0
- package/dist/assets/fonts/momentum-ui-icons.woff +0 -0
- package/dist/assets/fonts/momentum-ui-icons.woff2 +0 -0
- package/dist/assets/icons/fonts/index.html +0 -18578
- package/dist/assets/icons/fonts/momentum-ui-icons.svg +0 -9270
- package/dist/assets/icons/fonts/momentum-ui-icons.ttf +0 -0
- package/dist/assets/icons/fonts/momentum-ui-icons.woff +0 -0
- package/dist/assets/icons/fonts/momentum-ui-icons.woff2 +0 -0
- package/dist/assets/images/avatar-images/barbara.png +0 -0
- package/dist/assets/images/avatar-images/brandon.png +0 -0
- package/dist/assets/images/avatar-images/brenda.png +0 -0
- package/dist/assets/images/avatar-images/giacomo.png +0 -0
- package/dist/assets/images/avatar-images/maria.png +0 -0
- package/dist/assets/images/avatar-images/simon.png +0 -0
- package/dist/assets/images/cisco/cisco-logo-black.png +0 -0
- package/dist/assets/images/cisco/cisco-logo-black.svg +0 -21
- package/dist/assets/images/cisco/cisco-logo-blue.png +0 -0
- package/dist/assets/images/cisco/cisco-logo-blue.svg +0 -21
- package/dist/assets/images/cisco/cisco-logo-white.png +0 -0
- package/dist/assets/images/cisco/cisco-logo-white.svg +0 -21
- package/dist/assets/images/cisco-webex/lockup/cisco-webex-lockup-black.png +0 -0
- package/dist/assets/images/cisco-webex/lockup/cisco-webex-lockup-black.svg +0 -30
- package/dist/assets/images/cisco-webex/lockup/cisco-webex-lockup-blue.png +0 -0
- package/dist/assets/images/cisco-webex/lockup/cisco-webex-lockup-blue.svg +0 -30
- package/dist/assets/images/cisco-webex/lockup/cisco-webex-lockup-white.png +0 -0
- package/dist/assets/images/cisco-webex/lockup/cisco-webex-lockup-white.svg +0 -30
- package/dist/assets/images/cisco-webex/wordmark/cisco-webex-wordmark-black.png +0 -0
- package/dist/assets/images/cisco-webex/wordmark/cisco-webex-wordmark-black.svg +0 -13
- package/dist/assets/images/cisco-webex/wordmark/cisco-webex-wordmark-blue.png +0 -0
- package/dist/assets/images/cisco-webex/wordmark/cisco-webex-wordmark-blue.svg +0 -13
- package/dist/assets/images/cisco-webex/wordmark/cisco-webex-wordmark-white.png +0 -0
- package/dist/assets/images/cisco-webex/wordmark/cisco-webex-wordmark-white.svg +0 -13
- package/dist/assets/images/flags.png +0 -0
- package/dist/assets/images/flags@2x.png +0 -0
- package/dist/assets/images/momentum/momentum-color-icon.png +0 -0
- package/dist/assets/images/momentum/momentum-color-icon.svg +0 -1
- package/dist/assets/images/momentum/momentum-horiz-color-white.png +0 -0
- package/dist/assets/images/momentum/momentum-horiz-color.png +0 -0
- package/dist/assets/images/momentum/momentum-horiz-color.svg +0 -1
- package/dist/assets/images/momentum/momentum-horiz-outline.png +0 -0
- package/dist/assets/images/momentum/momentum-horiz-outline.svg +0 -1
- package/dist/assets/images/momentum/momentum-outline-icon.png +0 -0
- package/dist/assets/images/momentum/momentum-outline-icon.svg +0 -1
- package/dist/assets/images/momentum/momentum-vert-color.png +0 -0
- package/dist/assets/images/momentum/momentum-vert-color.svg +0 -1
- package/dist/assets/images/momentum/momentum-vert-outline.png +0 -0
- package/dist/assets/images/momentum/momentum-vert-outline.svg +0 -1
- package/dist/assets/images/momentum/momentum.jpg +0 -0
- package/dist/assets/images/opacity-bkgd.jpg +0 -0
- package/dist/assets/images/webex-calling/calling-icon-color.png +0 -0
- package/dist/assets/images/webex-calling/calling-icon-color.svg +0 -14
- package/dist/assets/images/webex-calling/calling-icon-white.png +0 -0
- package/dist/assets/images/webex-calling/calling-icon-white.svg +0 -13
- package/dist/assets/images/webex-calling/calling-with-container-and-label-color.png +0 -0
- package/dist/assets/images/webex-calling/calling-with-container-and-label-color.svg +0 -46
- package/dist/assets/images/webex-calling/calling-with-container-color.png +0 -0
- package/dist/assets/images/webex-calling/calling-with-container-color.svg +0 -19
- package/dist/assets/images/webex-calling/calling-with-label-color.png +0 -0
- package/dist/assets/images/webex-calling/calling-with-label-color.svg +0 -39
- package/dist/assets/images/webex-meetings/meetings-icon-color.png +0 -0
- package/dist/assets/images/webex-meetings/meetings-icon-color.svg +0 -15
- package/dist/assets/images/webex-meetings/meetings-icon-white.png +0 -0
- package/dist/assets/images/webex-meetings/meetings-icon-white.svg +0 -12
- package/dist/assets/images/webex-meetings/meetings-with-container-and-label-color.png +0 -0
- package/dist/assets/images/webex-meetings/meetings-with-container-and-label-color.svg +0 -29
- package/dist/assets/images/webex-meetings/meetings-with-container-color.png +0 -0
- package/dist/assets/images/webex-meetings/meetings-with-container-color.svg +0 -16
- package/dist/assets/images/webex-meetings/meetings-with-label-color.png +0 -0
- package/dist/assets/images/webex-meetings/meetings-with-label-color.svg +0 -28
- package/dist/assets/images/webex-teams/teams-icon-color.png +0 -0
- package/dist/assets/images/webex-teams/teams-icon-color.svg +0 -18
- package/dist/assets/images/webex-teams/teams-icon-white.png +0 -0
- package/dist/assets/images/webex-teams/teams-icon-white.svg +0 -12
- package/dist/assets/images/webex-teams/teams-with-container-and-label-color.png +0 -0
- package/dist/assets/images/webex-teams/teams-with-container-and-label-color.svg +0 -29
- package/dist/assets/images/webex-teams/teams-with-container-color.png +0 -0
- package/dist/assets/images/webex-teams/teams-with-container-color.svg +0 -19
- package/dist/assets/images/webex-teams/teams-with-label-color.png +0 -0
- package/dist/assets/images/webex-teams/teams-with-label-color.svg +0 -30
- package/dist/assets/styles/momentum-ui-icons.min.css +0 -1
- package/dist/assets/styles/momentum-ui.min.css +0 -7
- package/dist/assets/styles/momentum-ui.min.css.map +0 -1
- package/dist/chunks/md-0.js +0 -1
- package/dist/chunks/md-1.js +0 -1
- package/dist/chunks/md-10.js +0 -1
- package/dist/chunks/md-100.js +0 -1
- package/dist/chunks/md-101.js +0 -1
- package/dist/chunks/md-102.js +0 -1
- package/dist/chunks/md-103.js +0 -1
- package/dist/chunks/md-104.js +0 -1
- package/dist/chunks/md-105.js +0 -1
- package/dist/chunks/md-106.js +0 -1
- package/dist/chunks/md-107.js +0 -1
- package/dist/chunks/md-108.js +0 -1
- package/dist/chunks/md-109.js +0 -1
- package/dist/chunks/md-11.js +0 -1
- package/dist/chunks/md-110.js +0 -1
- package/dist/chunks/md-111.js +0 -1
- package/dist/chunks/md-112.js +0 -1
- package/dist/chunks/md-113.js +0 -1
- package/dist/chunks/md-114.js +0 -1
- package/dist/chunks/md-115.js +0 -1
- package/dist/chunks/md-116.js +0 -1
- package/dist/chunks/md-117.js +0 -1
- package/dist/chunks/md-118.js +0 -1
- package/dist/chunks/md-119.js +0 -1
- package/dist/chunks/md-12.js +0 -1
- package/dist/chunks/md-120.js +0 -1
- package/dist/chunks/md-121.js +0 -1
- package/dist/chunks/md-122.js +0 -1
- package/dist/chunks/md-123.js +0 -1
- package/dist/chunks/md-124.js +0 -1
- package/dist/chunks/md-125.js +0 -1
- package/dist/chunks/md-126.js +0 -1
- package/dist/chunks/md-127.js +0 -1
- package/dist/chunks/md-128.js +0 -1
- package/dist/chunks/md-129.js +0 -1
- package/dist/chunks/md-13.js +0 -1
- package/dist/chunks/md-130.js +0 -1
- package/dist/chunks/md-131.js +0 -1
- package/dist/chunks/md-132.js +0 -1
- package/dist/chunks/md-133.js +0 -1
- package/dist/chunks/md-134.js +0 -1
- package/dist/chunks/md-135.js +0 -1
- package/dist/chunks/md-136.js +0 -1
- package/dist/chunks/md-137.js +0 -1
- package/dist/chunks/md-138.js +0 -1
- package/dist/chunks/md-139.js +0 -1
- package/dist/chunks/md-14.js +0 -11
- package/dist/chunks/md-140.js +0 -1
- package/dist/chunks/md-141.js +0 -1
- package/dist/chunks/md-142.js +0 -1
- package/dist/chunks/md-143.js +0 -1
- package/dist/chunks/md-144.js +0 -1
- package/dist/chunks/md-145.js +0 -1
- package/dist/chunks/md-146.js +0 -1
- package/dist/chunks/md-147.js +0 -1
- package/dist/chunks/md-148.js +0 -1
- package/dist/chunks/md-149.js +0 -1
- package/dist/chunks/md-15.js +0 -9
- package/dist/chunks/md-150.js +0 -1
- package/dist/chunks/md-151.js +0 -1
- package/dist/chunks/md-152.js +0 -1
- package/dist/chunks/md-153.js +0 -1
- package/dist/chunks/md-154.js +0 -1
- package/dist/chunks/md-155.js +0 -1
- package/dist/chunks/md-156.js +0 -1
- package/dist/chunks/md-157.js +0 -1
- package/dist/chunks/md-158.js +0 -1
- package/dist/chunks/md-159.js +0 -1
- package/dist/chunks/md-16.js +0 -1
- package/dist/chunks/md-160.js +0 -1
- package/dist/chunks/md-161.js +0 -1
- package/dist/chunks/md-162.js +0 -1
- package/dist/chunks/md-163.js +0 -1
- package/dist/chunks/md-164.js +0 -1
- package/dist/chunks/md-165.js +0 -1
- package/dist/chunks/md-166.js +0 -1
- package/dist/chunks/md-167.js +0 -1
- package/dist/chunks/md-168.js +0 -1
- package/dist/chunks/md-169.js +0 -1
- package/dist/chunks/md-17.js +0 -26
- package/dist/chunks/md-170.js +0 -1
- package/dist/chunks/md-171.js +0 -1
- package/dist/chunks/md-172.js +0 -1
- package/dist/chunks/md-173.js +0 -1
- package/dist/chunks/md-174.js +0 -1
- package/dist/chunks/md-175.js +0 -1
- package/dist/chunks/md-176.js +0 -1
- package/dist/chunks/md-177.js +0 -1
- package/dist/chunks/md-178.js +0 -1
- package/dist/chunks/md-179.js +0 -1
- package/dist/chunks/md-18.js +0 -124
- package/dist/chunks/md-180.js +0 -1
- package/dist/chunks/md-181.js +0 -1
- package/dist/chunks/md-182.js +0 -1
- package/dist/chunks/md-183.js +0 -1
- package/dist/chunks/md-184.js +0 -1
- package/dist/chunks/md-185.js +0 -1
- package/dist/chunks/md-186.js +0 -1
- package/dist/chunks/md-187.js +0 -1
- package/dist/chunks/md-188.js +0 -1
- package/dist/chunks/md-189.js +0 -1
- package/dist/chunks/md-19.js +0 -17
- package/dist/chunks/md-190.js +0 -1
- package/dist/chunks/md-191.js +0 -1
- package/dist/chunks/md-192.js +0 -1
- package/dist/chunks/md-193.js +0 -1
- package/dist/chunks/md-194.js +0 -1
- package/dist/chunks/md-195.js +0 -1
- package/dist/chunks/md-196.js +0 -1
- package/dist/chunks/md-197.js +0 -1
- package/dist/chunks/md-198.js +0 -1
- package/dist/chunks/md-199.js +0 -1
- package/dist/chunks/md-2.js +0 -1
- package/dist/chunks/md-20.js +0 -1
- package/dist/chunks/md-200.js +0 -1
- package/dist/chunks/md-201.js +0 -1
- package/dist/chunks/md-202.js +0 -1
- package/dist/chunks/md-203.js +0 -1
- package/dist/chunks/md-204.js +0 -1
- package/dist/chunks/md-205.js +0 -1
- package/dist/chunks/md-206.js +0 -1
- package/dist/chunks/md-207.js +0 -1
- package/dist/chunks/md-208.js +0 -1
- package/dist/chunks/md-209.js +0 -1
- package/dist/chunks/md-21.js +0 -8
- package/dist/chunks/md-210.js +0 -1
- package/dist/chunks/md-211.js +0 -1
- package/dist/chunks/md-212.js +0 -1
- package/dist/chunks/md-213.js +0 -1
- package/dist/chunks/md-214.js +0 -1
- package/dist/chunks/md-215.js +0 -1
- package/dist/chunks/md-216.js +0 -1
- package/dist/chunks/md-217.js +0 -1
- package/dist/chunks/md-218.js +0 -1
- package/dist/chunks/md-219.js +0 -1
- package/dist/chunks/md-22.js +0 -23
- package/dist/chunks/md-220.js +0 -1
- package/dist/chunks/md-221.js +0 -1
- package/dist/chunks/md-222.js +0 -1
- package/dist/chunks/md-223.js +0 -1
- package/dist/chunks/md-224.js +0 -1
- package/dist/chunks/md-225.js +0 -1
- package/dist/chunks/md-226.js +0 -1
- package/dist/chunks/md-227.js +0 -1
- package/dist/chunks/md-228.js +0 -1
- package/dist/chunks/md-229.js +0 -1
- package/dist/chunks/md-23.js +0 -1
- package/dist/chunks/md-230.js +0 -1
- package/dist/chunks/md-231.js +0 -1
- package/dist/chunks/md-232.js +0 -1
- package/dist/chunks/md-233.js +0 -1
- package/dist/chunks/md-234.js +0 -1
- package/dist/chunks/md-235.js +0 -1
- package/dist/chunks/md-236.js +0 -1
- package/dist/chunks/md-237.js +0 -1
- package/dist/chunks/md-238.js +0 -1
- package/dist/chunks/md-239.js +0 -1
- package/dist/chunks/md-24.js +0 -7
- package/dist/chunks/md-240.js +0 -1
- package/dist/chunks/md-241.js +0 -1
- package/dist/chunks/md-242.js +0 -1
- package/dist/chunks/md-243.js +0 -1
- package/dist/chunks/md-244.js +0 -1
- package/dist/chunks/md-245.js +0 -1
- package/dist/chunks/md-246.js +0 -1
- package/dist/chunks/md-247.js +0 -1
- package/dist/chunks/md-248.js +0 -1
- package/dist/chunks/md-249.js +0 -1
- package/dist/chunks/md-25.js +0 -8
- package/dist/chunks/md-250.js +0 -1
- package/dist/chunks/md-251.js +0 -1
- package/dist/chunks/md-252.js +0 -1
- package/dist/chunks/md-253.js +0 -1
- package/dist/chunks/md-254.js +0 -1
- package/dist/chunks/md-255.js +0 -1
- package/dist/chunks/md-256.js +0 -1
- package/dist/chunks/md-257.js +0 -1
- package/dist/chunks/md-258.js +0 -1
- package/dist/chunks/md-259.js +0 -1
- package/dist/chunks/md-26.js +0 -1
- package/dist/chunks/md-260.js +0 -1
- package/dist/chunks/md-261.js +0 -1
- package/dist/chunks/md-262.js +0 -1
- package/dist/chunks/md-263.js +0 -1
- package/dist/chunks/md-264.js +0 -1
- package/dist/chunks/md-265.js +0 -1
- package/dist/chunks/md-266.js +0 -1
- package/dist/chunks/md-267.js +0 -1
- package/dist/chunks/md-268.js +0 -1
- package/dist/chunks/md-269.js +0 -1
- package/dist/chunks/md-27.js +0 -1
- package/dist/chunks/md-270.js +0 -1
- package/dist/chunks/md-271.js +0 -1
- package/dist/chunks/md-272.js +0 -1
- package/dist/chunks/md-273.js +0 -1
- package/dist/chunks/md-274.js +0 -1
- package/dist/chunks/md-275.js +0 -1
- package/dist/chunks/md-276.js +0 -1
- package/dist/chunks/md-277.js +0 -1
- package/dist/chunks/md-278.js +0 -1
- package/dist/chunks/md-279.js +0 -1
- package/dist/chunks/md-28.js +0 -55
- package/dist/chunks/md-280.js +0 -1
- package/dist/chunks/md-281.js +0 -1
- package/dist/chunks/md-282.js +0 -1
- package/dist/chunks/md-283.js +0 -1
- package/dist/chunks/md-29.js +0 -1
- package/dist/chunks/md-3.js +0 -1
- package/dist/chunks/md-30.js +0 -216
- package/dist/chunks/md-31.js +0 -49
- package/dist/chunks/md-32.js +0 -1
- package/dist/chunks/md-33.js +0 -1
- package/dist/chunks/md-34.js +0 -36
- package/dist/chunks/md-35.js +0 -33
- package/dist/chunks/md-36.js +0 -23
- package/dist/chunks/md-37.js +0 -5
- package/dist/chunks/md-38.js +0 -5
- package/dist/chunks/md-39.js +0 -1
- package/dist/chunks/md-4.js +0 -1
- package/dist/chunks/md-40.js +0 -21
- package/dist/chunks/md-41.js +0 -26
- package/dist/chunks/md-42.js +0 -42
- package/dist/chunks/md-43.js +0 -1
- package/dist/chunks/md-44.js +0 -30
- package/dist/chunks/md-45.js +0 -16
- package/dist/chunks/md-46.js +0 -1
- package/dist/chunks/md-47.js +0 -27
- package/dist/chunks/md-48.js +0 -5
- package/dist/chunks/md-49.js +0 -38
- package/dist/chunks/md-5.js +0 -1
- package/dist/chunks/md-50.js +0 -13
- package/dist/chunks/md-51.js +0 -34
- package/dist/chunks/md-52.js +0 -20
- package/dist/chunks/md-53.js +0 -121
- package/dist/chunks/md-54.js +0 -98
- package/dist/chunks/md-55.js +0 -11
- package/dist/chunks/md-56.js +0 -5
- package/dist/chunks/md-57.js +0 -77
- package/dist/chunks/md-58.js +0 -68
- package/dist/chunks/md-59.js +0 -22
- package/dist/chunks/md-6.js +0 -77
- package/dist/chunks/md-60.js +0 -14
- package/dist/chunks/md-61.js +0 -5
- package/dist/chunks/md-62.js +0 -51
- package/dist/chunks/md-63.js +0 -22
- package/dist/chunks/md-64.js +0 -47
- package/dist/chunks/md-65.js +0 -5
- package/dist/chunks/md-66.js +0 -1
- package/dist/chunks/md-67.js +0 -23
- package/dist/chunks/md-68.js +0 -5
- package/dist/chunks/md-69.js +0 -11
- package/dist/chunks/md-7.js +0 -1
- package/dist/chunks/md-70.js +0 -138
- package/dist/chunks/md-71.js +0 -30
- package/dist/chunks/md-72.js +0 -70
- package/dist/chunks/md-73.js +0 -19
- package/dist/chunks/md-74.js +0 -22
- package/dist/chunks/md-75.js +0 -17
- package/dist/chunks/md-76.js +0 -76
- package/dist/chunks/md-77.js +0 -7
- package/dist/chunks/md-78.js +0 -72
- package/dist/chunks/md-79.js +0 -78
- package/dist/chunks/md-8.js +0 -26
- package/dist/chunks/md-80.js +0 -71
- package/dist/chunks/md-81.js +0 -17
- package/dist/chunks/md-82.js +0 -5
- package/dist/chunks/md-83.js +0 -19
- package/dist/chunks/md-84.js +0 -1
- package/dist/chunks/md-85.js +0 -168
- package/dist/chunks/md-86.js +0 -43
- package/dist/chunks/md-87.js +0 -101
- package/dist/chunks/md-88.js +0 -82
- package/dist/chunks/md-89.js +0 -12
- package/dist/chunks/md-9.js +0 -1
- package/dist/chunks/md-90.js +0 -43
- package/dist/chunks/md-91.js +0 -34
- package/dist/chunks/md-92.js +0 -1
- package/dist/chunks/md-93.js +0 -1
- package/dist/chunks/md-94.js +0 -1
- package/dist/chunks/md-95.js +0 -1
- package/dist/chunks/md-96.js +0 -1
- package/dist/chunks/md-97.js +0 -1
- package/dist/chunks/md-98.js +0 -1
- package/dist/chunks/md-99.js +0 -1
- package/dist/comp/md-accordion-entry.js +0 -1
- package/dist/comp/md-accordion-item-entry.js +0 -1
- package/dist/comp/md-accordion-item.js +0 -15
- package/dist/comp/md-accordion.js +0 -11
- package/dist/comp/md-activity-button-entry.js +0 -1
- package/dist/comp/md-activity-button.js +0 -9
- package/dist/comp/md-advance-list-entry.js +0 -1
- package/dist/comp/md-advance-list.js +0 -7
- package/dist/comp/md-alert-banner-entry.js +0 -1
- package/dist/comp/md-alert-banner.js +0 -9
- package/dist/comp/md-alert-entry.js +0 -1
- package/dist/comp/md-alert.js +0 -10
- package/dist/comp/md-audio-player-entry.js +0 -1
- package/dist/comp/md-audio-player.js +0 -17
- package/dist/comp/md-avatar-entry.js +0 -1
- package/dist/comp/md-avatar.js +0 -11
- package/dist/comp/md-badge-entry.js +0 -1
- package/dist/comp/md-badge.js +0 -4
- package/dist/comp/md-breadcrumb-entry.js +0 -1
- package/dist/comp/md-breadcrumb.js +0 -4
- package/dist/comp/md-button-entry.js +0 -1
- package/dist/comp/md-button-group-entry.js +0 -1
- package/dist/comp/md-button-group.js +0 -10
- package/dist/comp/md-button.js +0 -6
- package/dist/comp/md-card-ai-entry.js +0 -1
- package/dist/comp/md-card-ai.js +0 -9
- package/dist/comp/md-card-entry.js +0 -1
- package/dist/comp/md-card.js +0 -23
- package/dist/comp/md-chat-message-entry.js +0 -1
- package/dist/comp/md-chat-message.js +0 -12
- package/dist/comp/md-checkbox-entry.js +0 -1
- package/dist/comp/md-checkbox.js +0 -11
- package/dist/comp/md-checkboxgroup-entry.js +0 -1
- package/dist/comp/md-checkboxgroup.js +0 -11
- package/dist/comp/md-chip-entry.js +0 -1
- package/dist/comp/md-chip.js +0 -18
- package/dist/comp/md-coachmark-entry.js +0 -1
- package/dist/comp/md-coachmark-popover-entry.js +0 -1
- package/dist/comp/md-coachmark-popover.js +0 -15
- package/dist/comp/md-coachmark.js +0 -13
- package/dist/comp/md-combobox-entry.js +0 -1
- package/dist/comp/md-combobox.js +0 -17
- package/dist/comp/md-composite-avatar-entry.js +0 -1
- package/dist/comp/md-composite-avatar.js +0 -5
- package/dist/comp/md-date-range-picker-entry.js +0 -1
- package/dist/comp/md-date-range-picker.js +0 -25
- package/dist/comp/md-date-time-picker-entry.js +0 -1
- package/dist/comp/md-date-time-picker.js +0 -19
- package/dist/comp/md-datepicker-calendar-entry.js +0 -1
- package/dist/comp/md-datepicker-calendar.js +0 -14
- package/dist/comp/md-datepicker-day-entry.js +0 -1
- package/dist/comp/md-datepicker-day.js +0 -9
- package/dist/comp/md-datepicker-entry.js +0 -1
- package/dist/comp/md-datepicker-month-entry.js +0 -1
- package/dist/comp/md-datepicker-month.js +0 -11
- package/dist/comp/md-datepicker-week-entry.js +0 -1
- package/dist/comp/md-datepicker-week.js +0 -10
- package/dist/comp/md-datepicker.js +0 -24
- package/dist/comp/md-draggable-entry.js +0 -1
- package/dist/comp/md-draggable-item-entry.js +0 -1
- package/dist/comp/md-draggable-item.js +0 -11
- package/dist/comp/md-draggable.js +0 -12
- package/dist/comp/md-dropdown-entry.js +0 -1
- package/dist/comp/md-dropdown.js +0 -15
- package/dist/comp/md-editable-field-entry.js +0 -1
- package/dist/comp/md-editable-field.js +0 -15
- package/dist/comp/md-favorite-entry.js +0 -1
- package/dist/comp/md-favorite.js +0 -14
- package/dist/comp/md-floating-minimize-entry.js +0 -1
- package/dist/comp/md-floating-minimize.js +0 -15
- package/dist/comp/md-floating-modal-entry.js +0 -1
- package/dist/comp/md-floating-modal.js +0 -16
- package/dist/comp/md-form-entry.js +0 -1
- package/dist/comp/md-form.js +0 -9
- package/dist/comp/md-grabber-entry.js +0 -1
- package/dist/comp/md-grabber.js +0 -14
- package/dist/comp/md-help-text-entry.js +0 -1
- package/dist/comp/md-help-text.js +0 -4
- package/dist/comp/md-icon-entry.js +0 -1
- package/dist/comp/md-icon.js +0 -8
- package/dist/comp/md-inpu.js +0 -12
- package/dist/comp/md-input-entry.js +0 -1
- package/dist/comp/md-input-file.js +0 -1
- package/dist/comp/md-input.js +0 -13
- package/dist/comp/md-label-entry.js +0 -1
- package/dist/comp/md-label.js +0 -4
- package/dist/comp/md-link-entry.js +0 -1
- package/dist/comp/md-link.js +0 -4
- package/dist/comp/md-list-entry.js +0 -1
- package/dist/comp/md-list-item-entry.js +0 -1
- package/dist/comp/md-list-item.js +0 -11
- package/dist/comp/md-list.js +0 -11
- package/dist/comp/md-loading-entry.js +0 -1
- package/dist/comp/md-loading.js +0 -4
- package/dist/comp/md-meeting-alert-entry.js +0 -1
- package/dist/comp/md-meeting-alert.js +0 -12
- package/dist/comp/md-menu-entry.js +0 -1
- package/dist/comp/md-menu-item-entry.js +0 -1
- package/dist/comp/md-menu-item.js +0 -4
- package/dist/comp/md-menu-overlay-entry.js +0 -1
- package/dist/comp/md-menu-overlay.js +0 -9
- package/dist/comp/md-menu.js +0 -8
- package/dist/comp/md-modal-entry.js +0 -1
- package/dist/comp/md-modal.js +0 -14
- package/dist/comp/md-pagination-entry.js +0 -1
- package/dist/comp/md-pagination.js +0 -9
- package/dist/comp/md-phone-input-entry.js +0 -1
- package/dist/comp/md-phone-input.js +0 -20
- package/dist/comp/md-popover-entry.js +0 -1
- package/dist/comp/md-popover.js +0 -14
- package/dist/comp/md-progress-bar-entry.js +0 -1
- package/dist/comp/md-progress-bar.js +0 -4
- package/dist/comp/md-radio-entry.js +0 -1
- package/dist/comp/md-radio.js +0 -11
- package/dist/comp/md-radiogroup-entry.js +0 -1
- package/dist/comp/md-radiogroup.js +0 -11
- package/dist/comp/md-slider-entry.js +0 -1
- package/dist/comp/md-slider.js +0 -10
- package/dist/comp/md-spinner-entry.js +0 -1
- package/dist/comp/md-spinner.js +0 -4
- package/dist/comp/md-tab-entry.js +0 -1
- package/dist/comp/md-tab-panel-entry.js +0 -1
- package/dist/comp/md-tab-panel.js +0 -11
- package/dist/comp/md-tab.js +0 -11
- package/dist/comp/md-table-advanced-entry.js +0 -1
- package/dist/comp/md-table-advanced.js +0 -15
- package/dist/comp/md-table-entry.js +0 -1
- package/dist/comp/md-table.js +0 -9
- package/dist/comp/md-tabs-entry.js +0 -1
- package/dist/comp/md-tabs.js +0 -20
- package/dist/comp/md-task-item-entry.js +0 -1
- package/dist/comp/md-task-item.js +0 -10
- package/dist/comp/md-theme-entry.js +0 -1
- package/dist/comp/md-theme.js +0 -4
- package/dist/comp/md-timepicker-entry.js +0 -1
- package/dist/comp/md-timepicker.js +0 -22
- package/dist/comp/md-toggle-switch-entry.js +0 -1
- package/dist/comp/md-toggle-switch.js +0 -11
- package/dist/comp/md-tooltip-entry.js +0 -1
- package/dist/comp/md-tooltip.js +0 -12
- package/dist/index-entry.js +0 -34
- package/dist/index.js +0 -94
- package/dist/managers/thememanager-entry.js +0 -1
- package/dist/managers/thememanager.js +0 -2
- package/dist/types/components/accordion/Accordion.d.ts +0 -32
- package/dist/types/components/accordion/AccordionItem.d.ts +0 -41
- package/dist/types/components/activity-button/ActivityButton.d.ts +0 -41
- package/dist/types/components/advance-list/AdvanceList.d.ts +0 -46
- package/dist/types/components/alert/Alert.d.ts +0 -59
- package/dist/types/components/alert-banner/AlertBanner.d.ts +0 -29
- package/dist/types/components/audio-player/AudioPlayer.d.ts +0 -112
- package/dist/types/components/avatar/Avatar.constants.d.ts +0 -4
- package/dist/types/components/avatar/Avatar.d.ts +0 -69
- package/dist/types/components/avatar/CompositeAvatar.d.ts +0 -25
- package/dist/types/components/avatar/Presence.d.ts +0 -19
- package/dist/types/components/avatar/Presence.utils.d.ts +0 -7
- package/dist/types/components/badge/Badge.d.ts +0 -38
- package/dist/types/components/breadcrumb/Breadcrumb.d.ts +0 -24
- package/dist/types/components/button/Button.d.ts +0 -115
- package/dist/types/components/button-group/ButtonGroup.d.ts +0 -45
- package/dist/types/components/card/Card.d.ts +0 -37
- package/dist/types/components/card-ai/CardAi.d.ts +0 -45
- package/dist/types/components/chat-message/ChatMessage.d.ts +0 -18
- package/dist/types/components/checkbox/Checkbox.d.ts +0 -44
- package/dist/types/components/checkbox/CheckboxGroup.d.ts +0 -29
- package/dist/types/components/chip/Chip.d.ts +0 -67
- package/dist/types/components/coachmark/Coachmark.d.ts +0 -46
- package/dist/types/components/coachmark-popover/CoachmarkPopover.d.ts +0 -211
- package/dist/types/components/code-editor/CodeEditor.d.ts +0 -40
- package/dist/types/components/combobox/ComboBox.d.ts +0 -227
- package/dist/types/components/date-range-picker/DateRangePicker.d.ts +0 -28
- package/dist/types/components/date-time-picker/DateTimePicker.d.ts +0 -45
- package/dist/types/components/datepicker/DatePicker.d.ts +0 -58
- package/dist/types/components/datepicker/datepicker-calendar/DatePickerCalendar.d.ts +0 -39
- package/dist/types/components/datepicker/datepicker-day/DatePickerDay.d.ts +0 -56
- package/dist/types/components/datepicker/datepicker-month/DatePickerMonth.d.ts +0 -26
- package/dist/types/components/datepicker/datepicker-week/DatePickerWeek.d.ts +0 -27
- package/dist/types/components/draggable/Draggable.d.ts +0 -62
- package/dist/types/components/draggable/DraggableItem.d.ts +0 -29
- package/dist/types/components/dropdown/Dropdown.d.ts +0 -154
- package/dist/types/components/editable-textfield/EditableTextfield.d.ts +0 -53
- package/dist/types/components/favorite/Favorite.d.ts +0 -36
- package/dist/types/components/floating-modal/FloatingMinimizedModal.d.ts +0 -53
- package/dist/types/components/floating-modal/FloatingModal.d.ts +0 -70
- package/dist/types/components/form/Form.d.ts +0 -49
- package/dist/types/components/grabber/Grabber.d.ts +0 -87
- package/dist/types/components/help-text/HelpText.d.ts +0 -28
- package/dist/types/components/icon/Icon.d.ts +0 -197
- package/dist/types/components/input/Input.d.ts +0 -139
- package/dist/types/components/input-file/InputFile.d.ts +0 -25
- package/dist/types/components/label/Label.d.ts +0 -43
- package/dist/types/components/link/Link.d.ts +0 -36
- package/dist/types/components/list/List.d.ts +0 -47
- package/dist/types/components/list/ListItem.d.ts +0 -26
- package/dist/types/components/loading/Loading.d.ts +0 -24
- package/dist/types/components/meeting-alert/CompositeAvatar.d.ts +0 -1
- package/dist/types/components/meeting-alert/MeetingAlert.d.ts +0 -46
- package/dist/types/components/menu/Menu.d.ts +0 -46
- package/dist/types/components/menu/MenuItem.d.ts +0 -46
- package/dist/types/components/menu-overlay/MenuOverlay.d.ts +0 -81
- package/dist/types/components/modal/Modal.d.ts +0 -74
- package/dist/types/components/pagination/Pagination.d.ts +0 -33
- package/dist/types/components/phone-input/PhoneInput.d.ts +0 -72
- package/dist/types/components/popover/Popover.d.ts +0 -184
- package/dist/types/components/popover/Popover.types.d.ts +0 -8
- package/dist/types/components/progress-bar/ProgressBar.d.ts +0 -35
- package/dist/types/components/radio/Radio.d.ts +0 -33
- package/dist/types/components/radio/RadioGroup.d.ts +0 -43
- package/dist/types/components/sass-stats/SassStats.d.ts +0 -29
- package/dist/types/components/slider/Slider.d.ts +0 -47
- package/dist/types/components/spinner/Spinner.d.ts +0 -24
- package/dist/types/components/table/Table.d.ts +0 -57
- package/dist/types/components/table-advanced/TableAdvanced.d.ts +0 -169
- package/dist/types/components/table-advanced/src/decorators.d.ts +0 -32
- package/dist/types/components/table-advanced/src/filter.d.ts +0 -25
- package/dist/types/components/tabs/Tab.d.ts +0 -65
- package/dist/types/components/tabs/TabPanel.d.ts +0 -25
- package/dist/types/components/tabs/Tabs.d.ts +0 -128
- package/dist/types/components/taskitem/TaskItem.d.ts +0 -54
- package/dist/types/components/theme/Theme.d.ts +0 -89
- package/dist/types/components/theme/index.d.ts +0 -7
- package/dist/types/components/timepicker/TimePicker.d.ts +0 -50
- package/dist/types/components/toggle-switch/ToggleSwitch.d.ts +0 -39
- package/dist/types/components/tooltip/Tooltip.d.ts +0 -56
- package/dist/types/constants.d.ts +0 -39
- package/dist/types/index.d.ts +0 -79
- package/dist/types/internal-components/color-table/ColorTable.d.ts +0 -9
- package/dist/types/internal-components/color-table/data.d.ts +0 -551
- package/dist/types/internal-components/color-table/utils.d.ts +0 -1
- package/dist/types/managers/ThemeManager.d.ts +0 -41
- package/dist/types/mixins/CustomElementCheck.d.ts +0 -1
- package/dist/types/mixins/DedupeMixin.d.ts +0 -28
- package/dist/types/mixins/FocusMixin.d.ts +0 -44
- package/dist/types/mixins/FocusTrapMixin.d.ts +0 -19
- package/dist/types/mixins/ResizeMixin.d.ts +0 -52
- package/dist/types/mixins/RovingTabIndexMixin.d.ts +0 -31
- package/dist/types/mixins/SlottedMixin.d.ts +0 -43
- package/dist/types/mixins/index.d.ts +0 -14
- package/dist/types/utils/dateUtils.d.ts +0 -31
- package/dist/types/utils/enums.d.ts +0 -18
- package/dist/types/utils/helpers.d.ts +0 -17
- package/dist/types/utils/keyboard.d.ts +0 -1
- package/dist/types/utils/validations.d.ts +0 -25
- package/dist/types/wc_scss/colors/vars/color-table-data-string.d.ts +0 -1
- /package/{dist → src}/assets/styles/fonts.css +0 -0
|
@@ -0,0 +1,1869 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Cisco Systems, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import "@/components/help-text/HelpText";
|
|
10
|
+
import "@/components/icon/Icon";
|
|
11
|
+
import { ATTRIBUTES, Key } from "@/constants";
|
|
12
|
+
import { FocusMixin } from "@/mixins";
|
|
13
|
+
import { customElementWithCheck } from "@/mixins/CustomElementCheck";
|
|
14
|
+
import { debounce, findHighlight } from "@/utils/helpers";
|
|
15
|
+
import reset from "@/wc_scss/reset.scss";
|
|
16
|
+
import { html, internalProperty, LitElement, property, PropertyValues, query, queryAll } from "lit-element";
|
|
17
|
+
import { nothing, TemplateResult } from "lit-html";
|
|
18
|
+
import { classMap } from "lit-html/directives/class-map";
|
|
19
|
+
import { ifDefined } from "lit-html/directives/if-defined";
|
|
20
|
+
import { repeat } from "lit-html/directives/repeat";
|
|
21
|
+
import { styleMap } from "lit-html/directives/style-map";
|
|
22
|
+
import { scroll } from "lit-virtualizer";
|
|
23
|
+
import { setTimeout } from "timers";
|
|
24
|
+
import styles from "./scss/module.scss";
|
|
25
|
+
|
|
26
|
+
export namespace ComboBox {
|
|
27
|
+
type OptionMember = { [key: string]: string };
|
|
28
|
+
type SelectedEvent = {
|
|
29
|
+
value?: string | OptionMember;
|
|
30
|
+
selected: (string | OptionMember)[];
|
|
31
|
+
};
|
|
32
|
+
export type MessageType = "error" | "success" | "warning";
|
|
33
|
+
export type Message = {
|
|
34
|
+
type: MessageType;
|
|
35
|
+
message: string;
|
|
36
|
+
id?: string;
|
|
37
|
+
ariaLive?: "off" | "assertive" | "polite";
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export class MessageController {
|
|
41
|
+
determineMessageType(array: ComboBox.Message[]) {
|
|
42
|
+
return array.reduce<ComboBox.MessageType>(
|
|
43
|
+
(accumulator, errorMessage) =>
|
|
44
|
+
(errorMessage as unknown as string) === "error" ? accumulator : errorMessage.type,
|
|
45
|
+
"" as ComboBox.MessageType
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
filterMessagesByType(array: ComboBox.Message[], value: string) {
|
|
49
|
+
return array.reduce(
|
|
50
|
+
(accumulator, errorMessage) =>
|
|
51
|
+
errorMessage.type === value ? accumulator.concat(errorMessage.message) : accumulator,
|
|
52
|
+
[] as string[]
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@customElementWithCheck("md-combobox")
|
|
58
|
+
export class ELEMENT extends FocusMixin(LitElement) {
|
|
59
|
+
private _focusedIndex = -1;
|
|
60
|
+
private _focusedGroupIndex = -1;
|
|
61
|
+
|
|
62
|
+
@property({ type: String }) label = "Options";
|
|
63
|
+
@property({ type: Array }) options: (string | OptionMember)[] = [];
|
|
64
|
+
@property({ type: Array, attribute: "custom-options" }) customOptions = [];
|
|
65
|
+
@property({ type: String }) placeholder = "";
|
|
66
|
+
@property({ type: Boolean, attribute: "is-multi" }) isMulti = false;
|
|
67
|
+
@property({ type: Boolean, attribute: "use-virtual-scroll" }) useVirtualScroll = false;
|
|
68
|
+
@property({ type: Boolean, reflect: true }) disabled = false;
|
|
69
|
+
@property({ type: Boolean, reflect: true }) ordered = false;
|
|
70
|
+
@property({ type: Boolean, reflect: true }) expanded = false;
|
|
71
|
+
@property({ type: Array, reflect: true }) groupExpandedList: any = [];
|
|
72
|
+
@property({ type: Boolean, reflect: true }) searchItem = false;
|
|
73
|
+
@property({ type: Boolean, reflect: true }) compact = false;
|
|
74
|
+
@property({ type: Boolean, attribute: "no-clear-icon" }) noClearIcon = false;
|
|
75
|
+
@property({ type: Boolean, attribute: "select-when-in-focus" }) selectWhenInFocus = false;
|
|
76
|
+
@property({ type: Array }) selectedOptions: (string | OptionMember)[] = [];
|
|
77
|
+
@property({ type: Number, attribute: "visible-option", reflect: true }) visibleOptions = 8;
|
|
78
|
+
@property({ type: String, attribute: "option-id", reflect: true }) optionId = "";
|
|
79
|
+
@property({ type: String, attribute: "option-value", reflect: true }) optionValue = "";
|
|
80
|
+
@property({ type: Boolean, attribute: "with-custom-content" }) isCustomContent = false;
|
|
81
|
+
@property({ type: Boolean, reflect: true }) searchable = false;
|
|
82
|
+
@property({ type: String }) shape = "none";
|
|
83
|
+
@property({ type: Array }) value: (string | OptionMember)[] = [];
|
|
84
|
+
@property({ type: String, attribute: "input-value", reflect: true }) inputValue = "";
|
|
85
|
+
@property({ type: Boolean, attribute: "allow-custom-value", reflect: true }) allowCustomValue = false;
|
|
86
|
+
@property({ type: Boolean, reflect: true }) autofocus = false;
|
|
87
|
+
@property({ type: String, attribute: "no-results-i18n" }) resultsTextLocalization = "No Results";
|
|
88
|
+
@property({ type: String, attribute: "no-options-i18n" }) optionsTextLocalization = "No Options";
|
|
89
|
+
@property({ type: Boolean, reflect: true, attribute: "search-trim-space" }) trimSpace = false;
|
|
90
|
+
@property({ type: Boolean, reflect: true }) invalid = false;
|
|
91
|
+
@property({ type: String, reflect: true, attribute: "invalid-text-i18n" }) invalidText = "";
|
|
92
|
+
|
|
93
|
+
@property({ type: String, reflect: true }) ariaLabel = ""; // This aria-label is used by default when there is no search or list-items are displayed.
|
|
94
|
+
@property({ type: String, attribute: "search-result-aria-label" }) searchResultAriaLabel = ""; // This aria-label is dynamic and used when there is search and list-items are displayed.
|
|
95
|
+
@internalProperty()
|
|
96
|
+
private ariaLabelForComboBox = ""; // This internal property is used to conditionally set aria-label.
|
|
97
|
+
|
|
98
|
+
@property({ type: String, attribute: "clear-aria-label" }) clearAriaLabel = "Clear";
|
|
99
|
+
@property({ type: String, attribute: "arrow-aria-label" }) arrowAriaLabel = "Expand";
|
|
100
|
+
@property({ type: String, attribute: "clear-icon-height" }) clearIconHeight = "auto";
|
|
101
|
+
|
|
102
|
+
@property({ type: String, attribute: "all-i18n" }) allTextLocalization = "All";
|
|
103
|
+
@property({ type: String, attribute: "select-all-i18n" }) selectAllTextLocalization = "Select All";
|
|
104
|
+
@property({ type: String, attribute: "selected-all-i18n" }) selectedTextLocalization = "Selected";
|
|
105
|
+
|
|
106
|
+
@property({ type: Boolean, attribute: "allow-select-all", reflect: true }) allowSelectAll = false;
|
|
107
|
+
@property({ type: Boolean, attribute: "show-custom-error", reflect: true }) showCustomError = false;
|
|
108
|
+
@property({ type: Boolean, attribute: "show-loader", reflect: true }) showLoader = false;
|
|
109
|
+
@property({ type: Boolean, attribute: "show-selected-count", reflect: true }) showSelectedCount = false;
|
|
110
|
+
@property({ type: String, attribute: "popup-chevron-aria-hidden" }) popupChevronAriaHidden = "true";
|
|
111
|
+
@property({ type: Boolean, reflect: true }) newMomentum = false;
|
|
112
|
+
@property({ type: Boolean, attribute: "show-filter-icon" }) showFilterIcon = false;
|
|
113
|
+
@property({ type: Boolean, attribute: "prevent-filter" }) preventFilter = false;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* When using the new momentum style sets whether to use the new combobox style arrow
|
|
117
|
+
* or the arrow not in a div what a border to the right. This will be used for filter dropdowns
|
|
118
|
+
* that were implemented using a combobox
|
|
119
|
+
*/
|
|
120
|
+
@property({ type: Boolean, attribute: "is-dropdown-arrow" }) isDropdownArrow = false;
|
|
121
|
+
|
|
122
|
+
@property({ type: String })
|
|
123
|
+
comboboxId = "";
|
|
124
|
+
@property({ type: String }) helpText = "";
|
|
125
|
+
@property({ type: Array }) messageArr: ComboBox.Message[] = [];
|
|
126
|
+
@property({ type: String }) htmlId = "";
|
|
127
|
+
@property({ type: Boolean, reflect: true }) readOnly = false;
|
|
128
|
+
|
|
129
|
+
private readonly messageController = new MessageController();
|
|
130
|
+
|
|
131
|
+
@internalProperty()
|
|
132
|
+
private isOptGroup = false;
|
|
133
|
+
@internalProperty()
|
|
134
|
+
private isSelectAllChecked = false;
|
|
135
|
+
get focusedIndex() {
|
|
136
|
+
return this._focusedIndex;
|
|
137
|
+
}
|
|
138
|
+
set focusedIndex(index: number) {
|
|
139
|
+
this.updateFocusedIndex(index);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
updateFocusedIndex(index: number) {
|
|
143
|
+
const oldIndex = this._focusedIndex;
|
|
144
|
+
if (this.checkForVirtualScroll()) {
|
|
145
|
+
// Virtual Scroll is Enabled.
|
|
146
|
+
let newId: any;
|
|
147
|
+
if (this.allowSelectAll) {
|
|
148
|
+
// "Select All" checkbox option is enabled.
|
|
149
|
+
newId = index === 0 ? "selectAll" : this.getOptionId(this.filteredOptions[index - 1]);
|
|
150
|
+
} else {
|
|
151
|
+
newId = this.getOptionId(this.filteredOptions[index]);
|
|
152
|
+
}
|
|
153
|
+
const newList = this.lists ? [...this.lists]?.find((list) => list.offsetHeight !== 0 && list.id === newId) : "";
|
|
154
|
+
if (this.lists) {
|
|
155
|
+
[...this.lists].forEach((list) => {
|
|
156
|
+
list.toggleAttribute("focused", false);
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
if (newList) {
|
|
160
|
+
newList?.toggleAttribute("focused", true);
|
|
161
|
+
}
|
|
162
|
+
} else {
|
|
163
|
+
if (this.lists) {
|
|
164
|
+
const oldFocusedOption = this.lists[oldIndex];
|
|
165
|
+
if (oldFocusedOption) {
|
|
166
|
+
oldFocusedOption.toggleAttribute("focused", false);
|
|
167
|
+
}
|
|
168
|
+
const newFocusedOption = this.lists[index];
|
|
169
|
+
if (newFocusedOption) {
|
|
170
|
+
newFocusedOption.toggleAttribute("focused", true);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
this._focusedIndex = index;
|
|
175
|
+
this.requestUpdate("focusedIndex", oldIndex);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
get focusedGroupIndex() {
|
|
179
|
+
return this._focusedGroupIndex;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
set focusedGroupIndex(index: number) {
|
|
183
|
+
const oldIndex = this._focusedGroupIndex;
|
|
184
|
+
if (this.labels && this.labels.length !== 0) {
|
|
185
|
+
const oldFocusedOption = this.labels[oldIndex];
|
|
186
|
+
if (oldFocusedOption) {
|
|
187
|
+
oldFocusedOption.toggleAttribute("focused", false);
|
|
188
|
+
}
|
|
189
|
+
const newFocusedOption = this.labels[index];
|
|
190
|
+
if (newFocusedOption) {
|
|
191
|
+
newFocusedOption.toggleAttribute("focused", true);
|
|
192
|
+
newFocusedOption.focus();
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
this._focusedGroupIndex = index;
|
|
196
|
+
this.requestUpdate("focusedGroupIndex", oldIndex);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
get messageType(): ComboBox.MessageType | null {
|
|
200
|
+
if (this.messageArr.length > 0) {
|
|
201
|
+
return this.messageController.determineMessageType(this.messageArr);
|
|
202
|
+
}
|
|
203
|
+
return null;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
get messages() {
|
|
207
|
+
if (this.messageType) {
|
|
208
|
+
return this.messageController.filterMessagesByType(this.messageArr, this.messageType);
|
|
209
|
+
}
|
|
210
|
+
return null;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
private multiSelectedIndex = -1;
|
|
214
|
+
private multiSelected: number[] = [];
|
|
215
|
+
private customContent: Element[] = [];
|
|
216
|
+
|
|
217
|
+
private notifySearchResultCount() {
|
|
218
|
+
// this function is to update ariaLabelForComboBox for search result count.
|
|
219
|
+
|
|
220
|
+
// If searchResultAriaLabel is passed, the {{}} is replaced with the search result count.
|
|
221
|
+
if (this.searchResultAriaLabel) {
|
|
222
|
+
const regex = /{{.*?}}/g;
|
|
223
|
+
this.ariaLabelForComboBox = this.searchResultAriaLabel.replace(regex, this.filteredOptions.length.toString());
|
|
224
|
+
}
|
|
225
|
+
// If searchResultAriaLabel is not passed and ariaLabel is passed, the ariaLabel is appended with the search result count.
|
|
226
|
+
else if (this.ariaLabel) {
|
|
227
|
+
this.ariaLabelForComboBox = `${this.ariaLabel}, ${this.filteredOptions.length} results found.`;
|
|
228
|
+
}
|
|
229
|
+
// If both searchResultAriaLabel and ariaLabel are not passed, the default text is appended with the search result count.
|
|
230
|
+
else {
|
|
231
|
+
this.ariaLabelForComboBox = `ComboBox Element, ${this.filteredOptions.length} results found.`;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
@query(".group") group?: HTMLDivElement;
|
|
236
|
+
@query(".md-combobox-listbox") input?: HTMLInputElement;
|
|
237
|
+
@query(".md-combobox-button") button?: HTMLButtonElement;
|
|
238
|
+
@query("div#md-combobox-listbox") listBox?: HTMLDivElement;
|
|
239
|
+
@query(".virtual-scroll") virtualizer?: any;
|
|
240
|
+
|
|
241
|
+
@queryAll("div.md-combobox-option") lists?: HTMLDivElement[];
|
|
242
|
+
@queryAll(".group-label") labels?: HTMLDivElement[];
|
|
243
|
+
@queryAll(".md-combobox-selected-item") selected?: HTMLDivElement[];
|
|
244
|
+
|
|
245
|
+
protected firstUpdated(changedProperties: PropertyValues) {
|
|
246
|
+
// Initially the ariaLabelForComboBox is set for ariaLabel value if found or a static text is set.
|
|
247
|
+
this.ariaLabelForComboBox = this.ariaLabel ? this.ariaLabel : "ComboBox Element";
|
|
248
|
+
super.firstUpdated(changedProperties);
|
|
249
|
+
if (this.isCustomContent) {
|
|
250
|
+
this.optionId = "id";
|
|
251
|
+
this.optionValue = "value";
|
|
252
|
+
this.setOptionCustomContent();
|
|
253
|
+
}
|
|
254
|
+
this.setInitialValue();
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
protected updated(changedProperties: PropertyValues) {
|
|
258
|
+
super.updated(changedProperties);
|
|
259
|
+
if (changedProperties.has("expanded")) {
|
|
260
|
+
if (this.expanded) {
|
|
261
|
+
this.resizeListbox();
|
|
262
|
+
this.checkSelectedOptions();
|
|
263
|
+
} else {
|
|
264
|
+
this.unCheckAllOptions();
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
if (changedProperties.has("focusedIndex")) {
|
|
268
|
+
if (this.focusedIndex >= 0) {
|
|
269
|
+
if (!this.checkForVirtualScroll()) {
|
|
270
|
+
this.scrollToOption();
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
if (changedProperties.has("value")) {
|
|
275
|
+
if (this.selectedOptions.length === 0) {
|
|
276
|
+
this.setInitialValue();
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
if (changedProperties.has("customOptions")) {
|
|
280
|
+
if (this.isCustomContent) {
|
|
281
|
+
this.setOptionCustomContent();
|
|
282
|
+
this.resizeListbox();
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
if (changedProperties.has("showCustomError")) {
|
|
286
|
+
this.resizeListbox();
|
|
287
|
+
}
|
|
288
|
+
if (changedProperties.has("showLoader")) {
|
|
289
|
+
this.resizeListbox();
|
|
290
|
+
}
|
|
291
|
+
if (changedProperties.has("searchItem")) {
|
|
292
|
+
this.resizeListbox();
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
protected handleFocusIn(event: Event) {
|
|
297
|
+
if (!this.disabled || this.readOnly) {
|
|
298
|
+
if (this.noClearIcon) {
|
|
299
|
+
requestAnimationFrame(() => {
|
|
300
|
+
this.input!.focus();
|
|
301
|
+
this.focusedGroupIndex = -1;
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
if (this.selectWhenInFocus) {
|
|
305
|
+
this.input!.select();
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
super.handleFocusIn && super.handleFocusIn(event);
|
|
309
|
+
}
|
|
310
|
+
this.dispatchEvent(
|
|
311
|
+
new CustomEvent("combobox-focus-in", {
|
|
312
|
+
composed: true,
|
|
313
|
+
bubbles: true
|
|
314
|
+
})
|
|
315
|
+
);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
protected handleFocusOut(event: Event) {
|
|
319
|
+
super.handleFocusOut && super.handleFocusOut(event);
|
|
320
|
+
this.dispatchEvent(
|
|
321
|
+
new CustomEvent("combobox-focus-out", {
|
|
322
|
+
composed: true,
|
|
323
|
+
bubbles: true
|
|
324
|
+
})
|
|
325
|
+
);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
private findFilteredOption(option: string | OptionMember) {
|
|
329
|
+
if (this.isOptionObject(option)) {
|
|
330
|
+
return (this.filteredOptions as OptionMember[]).findIndex(
|
|
331
|
+
(filteredOption) =>
|
|
332
|
+
this.getOptionId(filteredOption) === this.getOptionId(option) &&
|
|
333
|
+
this.getOptionValue(filteredOption) === this.getOptionValue(option)
|
|
334
|
+
);
|
|
335
|
+
}
|
|
336
|
+
return this.filteredOptions.indexOf(option);
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
private setInitialValue() {
|
|
340
|
+
if (this.value.length) {
|
|
341
|
+
if (this.isMulti) {
|
|
342
|
+
this.value.forEach((v) => {
|
|
343
|
+
const selectedIndex = this.findFilteredOption(v);
|
|
344
|
+
if (selectedIndex !== -1) {
|
|
345
|
+
this.setSelectedOption(v);
|
|
346
|
+
}
|
|
347
|
+
});
|
|
348
|
+
} else {
|
|
349
|
+
const option = this.value[0];
|
|
350
|
+
const selectedIndex = this.findFilteredOption(option);
|
|
351
|
+
if (selectedIndex !== -1) {
|
|
352
|
+
this.setSelectedOption(option);
|
|
353
|
+
this.setInputValue(this.getOptionValue(option));
|
|
354
|
+
this.input?.setAttribute(ATTRIBUTES.AriaActivedescendant, this.getOptionId(option));
|
|
355
|
+
this.focusedIndex = selectedIndex;
|
|
356
|
+
this.focusedGroupIndex = -1;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
private isOptionObject(option: string | OptionMember) {
|
|
363
|
+
return typeof option === "object" && option !== null;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
private setOptionCustomContent() {
|
|
367
|
+
if (this.isOptGroup) {
|
|
368
|
+
const customOptionGroups = [...this.querySelectorAll(`optgroup`)];
|
|
369
|
+
const final = [];
|
|
370
|
+
for (const optgroup of customOptionGroups) {
|
|
371
|
+
const label = optgroup.getAttribute("label");
|
|
372
|
+
const childOptions = [...optgroup.querySelectorAll(`[slot]`)];
|
|
373
|
+
|
|
374
|
+
final.push({ isLabel: "true", [this.optionValue]: label, groupName: label });
|
|
375
|
+
for (const option of childOptions) {
|
|
376
|
+
const customValue = option.getAttribute("aria-label");
|
|
377
|
+
const displayCustomValue = option.getAttribute("display-value");
|
|
378
|
+
const slotValue = option.getAttribute("slot");
|
|
379
|
+
if (customValue && displayCustomValue) {
|
|
380
|
+
final.push({
|
|
381
|
+
[this.optionId]: customValue,
|
|
382
|
+
[this.optionValue]: displayCustomValue,
|
|
383
|
+
isLabel: "false",
|
|
384
|
+
groupName: label,
|
|
385
|
+
slot: slotValue
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
this.options = final as OptionMember[];
|
|
391
|
+
} else {
|
|
392
|
+
this.customContent = [...this.querySelectorAll(`[slot]`)];
|
|
393
|
+
if (this.customContent && this.customContent.length) {
|
|
394
|
+
this.options = this.customContent.map((content) => {
|
|
395
|
+
const customValue = content.getAttribute("aria-label");
|
|
396
|
+
const displayCustomValue = content.getAttribute("display-value");
|
|
397
|
+
if (customValue && displayCustomValue) {
|
|
398
|
+
return { [this.optionId]: customValue, [this.optionValue]: displayCustomValue };
|
|
399
|
+
}
|
|
400
|
+
}) as OptionMember[];
|
|
401
|
+
} else {
|
|
402
|
+
this.options = [];
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
private getOptionValue(option: string | OptionMember) {
|
|
408
|
+
return this.isOptionObject(option) ? (option as OptionMember)[this.optionValue] : (option as string);
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
private getOptionGroupName(option: any) {
|
|
412
|
+
return option?.groupName;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
private getOptionId(option: string | OptionMember) {
|
|
416
|
+
return this.isOptionObject(option) ? (option as OptionMember)[this.optionId] : (option as string);
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
private getFocusedItem(focusedIndex: number) {
|
|
420
|
+
if (focusedIndex >= 0) {
|
|
421
|
+
return this.filteredOptions[focusedIndex];
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
private setupEvents() {
|
|
426
|
+
document.addEventListener("click", this.handleOutsideClick);
|
|
427
|
+
this.addEventListener("remove-all-selected", this.removeAllSelected);
|
|
428
|
+
this.addEventListener("selected-changed", this.selectedChange as EventListener);
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
private teardownEvents() {
|
|
432
|
+
document.removeEventListener("click", this.handleOutsideClick);
|
|
433
|
+
this.removeEventListener("remove-all-selected", this.removeAllSelected);
|
|
434
|
+
this.removeEventListener("selected-changed", this.selectedChange as EventListener);
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
private setVisualListbox(value: boolean) {
|
|
438
|
+
this.expanded = value;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
private setGroupList(value: any) {
|
|
442
|
+
if (this.groupExpandedList.includes(value)) {
|
|
443
|
+
this.groupExpandedList.splice(this.groupExpandedList.indexOf(value), 1);
|
|
444
|
+
this.groupExpandedList = [...this.groupExpandedList];
|
|
445
|
+
} else {
|
|
446
|
+
if (this.searchItem) this.groupExpandedList.push(value);
|
|
447
|
+
else this.groupExpandedList = [value];
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
private findSelectedOption(option: string | OptionMember) {
|
|
452
|
+
if (this.optionId && option) {
|
|
453
|
+
return this.selectedOptions.findIndex(
|
|
454
|
+
(selectedOption) =>
|
|
455
|
+
selectedOption &&
|
|
456
|
+
(selectedOption as OptionMember)[this.optionId] === (option as OptionMember)[this.optionId]
|
|
457
|
+
);
|
|
458
|
+
} else {
|
|
459
|
+
return this.selectedOptions.indexOf(option);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
private findOptionIndex(event: MouseEvent) {
|
|
464
|
+
const eventPath = event.composedPath();
|
|
465
|
+
if (this.checkForVirtualScroll()) {
|
|
466
|
+
let id = "";
|
|
467
|
+
[...this.lists!].forEach((listOption) => {
|
|
468
|
+
if (eventPath.includes(listOption)) {
|
|
469
|
+
id = listOption.id;
|
|
470
|
+
}
|
|
471
|
+
});
|
|
472
|
+
return this.filteredOptions.findIndex((option: any) => this.getOptionId(option) === id);
|
|
473
|
+
} else {
|
|
474
|
+
return [...this.lists!].findIndex((listOption) => eventPath.includes(listOption));
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
private checkSelectedOptions() {
|
|
478
|
+
if (this.checkForVirtualScroll()) {
|
|
479
|
+
const selectedOptionIds = this.selectedOptions.map((option) => this.getOptionId(option));
|
|
480
|
+
const updatedLists = [...this.lists!].filter((list) => list.id !== "selectAll");
|
|
481
|
+
updatedLists?.forEach((list: HTMLDivElement) => {
|
|
482
|
+
if (selectedOptionIds.includes(list.id)) {
|
|
483
|
+
if (this.isMulti) {
|
|
484
|
+
list?.setAttribute("aria-checked", "true");
|
|
485
|
+
}
|
|
486
|
+
list?.setAttribute("aria-selected", "true");
|
|
487
|
+
} else if (this.isMulti) {
|
|
488
|
+
list?.setAttribute("aria-checked", "false");
|
|
489
|
+
}
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
private unCheckAllOptions() {
|
|
494
|
+
if (this.checkForVirtualScroll() && this.isMulti) {
|
|
495
|
+
[...this.lists!]?.forEach((list: HTMLDivElement) => {
|
|
496
|
+
if (list?.id !== "selectAll") {
|
|
497
|
+
list?.setAttribute("aria-checked", "false");
|
|
498
|
+
}
|
|
499
|
+
});
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
private setSelectedOption(option: string | OptionMember) {
|
|
504
|
+
if (!this.isMulti) {
|
|
505
|
+
this.selectedOptions = [];
|
|
506
|
+
}
|
|
507
|
+
const selectedIndex = this.findSelectedOption(option);
|
|
508
|
+
if (selectedIndex !== -1) {
|
|
509
|
+
const removedOption = this.selectedOptions[selectedIndex];
|
|
510
|
+
this.selectedOptions.splice(selectedIndex, 1);
|
|
511
|
+
this.notifySelectedChange({
|
|
512
|
+
value: removedOption,
|
|
513
|
+
selected: this.selectedOptions
|
|
514
|
+
});
|
|
515
|
+
} else {
|
|
516
|
+
this.selectedOptions.push(option);
|
|
517
|
+
this.notifySelectedChange({
|
|
518
|
+
value: option,
|
|
519
|
+
selected: this.selectedOptions
|
|
520
|
+
});
|
|
521
|
+
}
|
|
522
|
+
this.checkSelectedOptions();
|
|
523
|
+
if (this.isMulti && this.allowSelectAll) {
|
|
524
|
+
this.isSelectAllChecked = this.isSelectAllSelected();
|
|
525
|
+
}
|
|
526
|
+
this.requestUpdate();
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
private notifySelectedChange = debounce((detail: SelectedEvent) => {
|
|
530
|
+
this.dispatchEvent(
|
|
531
|
+
new CustomEvent<SelectedEvent>("change-selected", {
|
|
532
|
+
composed: true,
|
|
533
|
+
bubbles: true,
|
|
534
|
+
detail
|
|
535
|
+
})
|
|
536
|
+
);
|
|
537
|
+
}, 0);
|
|
538
|
+
|
|
539
|
+
private handleGroupFilter = (finalFilteredOption: (string | OptionMember)[]) => {
|
|
540
|
+
const tempGroupExpandedList = finalFilteredOption.filter((item) => {
|
|
541
|
+
if (typeof item !== "string" && item.isLabel === "true") {
|
|
542
|
+
return item.groupName;
|
|
543
|
+
}
|
|
544
|
+
});
|
|
545
|
+
this.searchItem = true;
|
|
546
|
+
this.groupExpandedList = tempGroupExpandedList.map((a) => {
|
|
547
|
+
if (typeof a !== "string") {
|
|
548
|
+
return a.groupName;
|
|
549
|
+
}
|
|
550
|
+
});
|
|
551
|
+
|
|
552
|
+
return finalFilteredOption.filter((option: string | OptionMember) => {
|
|
553
|
+
if (typeof option !== "string" && option.isLabel === "true") {
|
|
554
|
+
const isGroupOption = finalFilteredOption.find((option2) => {
|
|
555
|
+
if (typeof option !== "string" && typeof option2 !== "string") {
|
|
556
|
+
return option.groupName === option2.groupName && option2.isLabel === "false";
|
|
557
|
+
}
|
|
558
|
+
});
|
|
559
|
+
return isGroupOption ? true : false;
|
|
560
|
+
} else {
|
|
561
|
+
return true;
|
|
562
|
+
}
|
|
563
|
+
});
|
|
564
|
+
};
|
|
565
|
+
|
|
566
|
+
private filterOptions(value: string): (string | OptionMember)[] {
|
|
567
|
+
if(this.preventFilter)
|
|
568
|
+
{
|
|
569
|
+
this.searchItem = false;
|
|
570
|
+
return this.options;
|
|
571
|
+
}
|
|
572
|
+
if (value && value.length) {
|
|
573
|
+
const finalFilteredOption = this.options.filter((option: string | OptionMember) => {
|
|
574
|
+
if (this.isOptGroup && typeof option !== "string" && option.isLabel === "true") {
|
|
575
|
+
return option;
|
|
576
|
+
} else {
|
|
577
|
+
return (this.isCustomContent ? this.getOptionId(option) : this.getOptionValue(option))
|
|
578
|
+
.toLowerCase()
|
|
579
|
+
.includes(value.toLowerCase());
|
|
580
|
+
}
|
|
581
|
+
});
|
|
582
|
+
|
|
583
|
+
if (this.isOptGroup) {
|
|
584
|
+
return this.handleGroupFilter(finalFilteredOption);
|
|
585
|
+
} else {
|
|
586
|
+
return finalFilteredOption;
|
|
587
|
+
}
|
|
588
|
+
} else {
|
|
589
|
+
this.searchItem = false;
|
|
590
|
+
return this.options;
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
private getListBoxVerticalPadding() {
|
|
595
|
+
if (this.listBox) {
|
|
596
|
+
const computedStyle = window.getComputedStyle(this.listBox, null);
|
|
597
|
+
const paddingTop = parseInt(computedStyle.getPropertyValue("padding-top"));
|
|
598
|
+
const paddingBottom = parseInt(computedStyle.getPropertyValue("padding-bottom"));
|
|
599
|
+
const padding = paddingTop + paddingBottom;
|
|
600
|
+
|
|
601
|
+
if (!isNaN(padding)) {
|
|
602
|
+
return padding + 2;
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
return 10;
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
private resizeListbox() {
|
|
610
|
+
this.updateOnNextFrame(() => {
|
|
611
|
+
let height = 0;
|
|
612
|
+
let labelHeight = 0;
|
|
613
|
+
let virtualizerHeight = 0;
|
|
614
|
+
const verticalPadding: number = this.getListBoxVerticalPadding();
|
|
615
|
+
if (this.lists) {
|
|
616
|
+
const updatedList = this.checkForVirtualScroll()
|
|
617
|
+
? [...this.lists].filter((list) => list.offsetHeight !== 0)
|
|
618
|
+
: [...this.lists];
|
|
619
|
+
|
|
620
|
+
height = updatedList
|
|
621
|
+
.slice(0, this.visibleOptions)
|
|
622
|
+
.reduce((accumulator, option) => accumulator + option.offsetHeight, 0);
|
|
623
|
+
virtualizerHeight =
|
|
624
|
+
this.checkForVirtualScroll() && this.allowSelectAll
|
|
625
|
+
? updatedList
|
|
626
|
+
.slice(1, this.visibleOptions)
|
|
627
|
+
.reduce((accumulator, option) => accumulator + option.offsetHeight, 0)
|
|
628
|
+
: updatedList
|
|
629
|
+
.slice(0, this.visibleOptions)
|
|
630
|
+
.reduce((accumulator, option) => accumulator + option.offsetHeight, 0);
|
|
631
|
+
}
|
|
632
|
+
if (this.labels) {
|
|
633
|
+
labelHeight = [...this.labels]
|
|
634
|
+
.slice(0, this.visibleOptions)
|
|
635
|
+
.reduce((accumulator, option) => accumulator + option.offsetHeight, 0);
|
|
636
|
+
}
|
|
637
|
+
if (this.listBox) {
|
|
638
|
+
this.listBox.style.maxHeight = `${height + labelHeight + verticalPadding}px`;
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
if (this.virtualizer) {
|
|
642
|
+
this.virtualizer.style.height = `${virtualizerHeight + verticalPadding}px`;
|
|
643
|
+
}
|
|
644
|
+
if (this.showCustomError || this.showLoader) {
|
|
645
|
+
const customContent = this.listBox?.querySelector("[slot]");
|
|
646
|
+
if (this.listBox && customContent) {
|
|
647
|
+
this.listBox.style.height = `${customContent.clientHeight + verticalPadding}px`;
|
|
648
|
+
this.listBox.style.maxHeight = `${customContent.clientHeight + verticalPadding}px`;
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
});
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
private setInputValue(value = "") {
|
|
655
|
+
this.input!.value = value;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
private updateOnNextFrame(cb: FrameRequestCallback) {
|
|
659
|
+
requestAnimationFrame(cb);
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
private unCheckedAllOptions() {
|
|
663
|
+
if (this.isMulti) {
|
|
664
|
+
this.lists!.forEach((list, index) => this.unCheckedOption(index));
|
|
665
|
+
this.isSelectAllChecked = false;
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
private unCheckedOption(index: number) {
|
|
670
|
+
if (this.isMulti) {
|
|
671
|
+
this.lists![index].setAttribute("aria-checked", "false");
|
|
672
|
+
this.notifySelectedChange({
|
|
673
|
+
value: this.filteredOptions[index],
|
|
674
|
+
selected: this.selectedOptions
|
|
675
|
+
});
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
private checkAllOptions() {
|
|
680
|
+
if (this.isMulti) {
|
|
681
|
+
this.lists!.forEach((list, index) => this.checkOption(index));
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
private checkOption(index: number) {
|
|
686
|
+
if (this.isMulti) {
|
|
687
|
+
this.lists![index].setAttribute("aria-checked", "true");
|
|
688
|
+
this.notifySelectedChange({
|
|
689
|
+
value: this.filteredOptions[index],
|
|
690
|
+
selected: this.selectedOptions
|
|
691
|
+
});
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
private isSelectAllSelected() {
|
|
696
|
+
return this.selectedOptions.length === this.options.length;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
private setFocusOnHost(force: boolean) {
|
|
700
|
+
if (this.setFocus) {
|
|
701
|
+
this.setFocus(force);
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
private isOptionFocused(optionIndex: number) {
|
|
706
|
+
return this.focusedIndex === optionIndex;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
private getAriaState(optionIndex: number) {
|
|
710
|
+
return this.isOptionFocused(optionIndex);
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
private scrollToOption() {
|
|
714
|
+
let distance = 0;
|
|
715
|
+
const { top, bottom } = this.listBox!.getBoundingClientRect();
|
|
716
|
+
const option = this.lists![this.focusedIndex];
|
|
717
|
+
const nextOption = (this.lists![this.focusedIndex + 1] || option)?.getBoundingClientRect();
|
|
718
|
+
const prevOption = (this.lists![this.focusedIndex - 1] || option)?.getBoundingClientRect();
|
|
719
|
+
|
|
720
|
+
if (nextOption?.bottom > bottom) {
|
|
721
|
+
distance = nextOption.bottom - bottom + 2;
|
|
722
|
+
} else if (prevOption?.top < top) {
|
|
723
|
+
distance = prevOption.top - top - 2;
|
|
724
|
+
}
|
|
725
|
+
this.updateOnNextFrame(() => {
|
|
726
|
+
this.listBox!.scrollTop += distance;
|
|
727
|
+
});
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
private getCustomContentName(option: string | OptionMember) {
|
|
731
|
+
const index = this.options.indexOf(option);
|
|
732
|
+
if (this.isOptGroup) {
|
|
733
|
+
const selectedOption = this.options[index];
|
|
734
|
+
if (selectedOption && typeof selectedOption !== "string") {
|
|
735
|
+
return selectedOption.slot;
|
|
736
|
+
}
|
|
737
|
+
} else {
|
|
738
|
+
if (index !== -1) {
|
|
739
|
+
return this.customContent[index].slot;
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
private setInputSelectionRange(start: number, end: number) {
|
|
745
|
+
this.input!.setSelectionRange(start, end);
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
private isOptionChecked(option: string | OptionMember) {
|
|
749
|
+
if (this.findSelectedOption(option) !== -1) {
|
|
750
|
+
return "true";
|
|
751
|
+
}
|
|
752
|
+
return "false";
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
private getInputSelection() {
|
|
756
|
+
return this.input!.selectionStart;
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
private canMultiSelect() {
|
|
760
|
+
const inputSelection = this.getInputSelection();
|
|
761
|
+
return inputSelection === 0 && this.selectedOptions.length !== 0 && this.isMulti;
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
private removeMultiTag() {
|
|
765
|
+
if (this.selected) {
|
|
766
|
+
this.multiSelected.forEach((index) => {
|
|
767
|
+
const selected = this.selected![index];
|
|
768
|
+
if (selected && selected.hasAttribute("selected")) {
|
|
769
|
+
this.removeSelected(this.selectedOptions[index]);
|
|
770
|
+
}
|
|
771
|
+
});
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
private unselectedAllMultiTag() {
|
|
776
|
+
if (this.selected) {
|
|
777
|
+
this.selected.forEach((selected) => selected.removeAttribute("selected"));
|
|
778
|
+
}
|
|
779
|
+
this.multiSelectedIndex = -1;
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
private findLastMultiSelected() {
|
|
783
|
+
return this.selected![this.multiSelectedIndex];
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
private toggleMultiSelectedTag(selected: HTMLElement | undefined, force: boolean) {
|
|
787
|
+
if (selected) {
|
|
788
|
+
selected.toggleAttribute("selected", force);
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
private selectMultiTag(isShiftKey: boolean) {
|
|
793
|
+
if (this.canMultiSelect()) {
|
|
794
|
+
if (!isShiftKey) {
|
|
795
|
+
this.multiSelected = [];
|
|
796
|
+
const oldSelected = this.findLastMultiSelected();
|
|
797
|
+
this.toggleMultiSelectedTag(oldSelected, false);
|
|
798
|
+
}
|
|
799
|
+
if (this.multiSelectedIndex <= 0) {
|
|
800
|
+
this.multiSelectedIndex = this.selectedOptions.length - 1;
|
|
801
|
+
} else {
|
|
802
|
+
this.multiSelectedIndex--;
|
|
803
|
+
}
|
|
804
|
+
this.multiSelected.push(this.multiSelectedIndex);
|
|
805
|
+
const newSelected = this.findLastMultiSelected();
|
|
806
|
+
this.toggleMultiSelectedTag(newSelected, true);
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
async handleListClick(event: MouseEvent) {
|
|
811
|
+
this.dispatchEvent(
|
|
812
|
+
new CustomEvent("selected-changed", {
|
|
813
|
+
detail: {
|
|
814
|
+
event
|
|
815
|
+
}
|
|
816
|
+
})
|
|
817
|
+
);
|
|
818
|
+
await this.updateComplete;
|
|
819
|
+
|
|
820
|
+
if (this.isMulti) {
|
|
821
|
+
this.setVisualListbox(true);
|
|
822
|
+
} else {
|
|
823
|
+
this.setVisualListbox(false);
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
this.updateOnNextFrame(() => {
|
|
827
|
+
this.input!.focus();
|
|
828
|
+
this.focusedGroupIndex = -1;
|
|
829
|
+
});
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
async handleSelectAll() {
|
|
833
|
+
this.isSelectAllChecked = !this.isSelectAllChecked;
|
|
834
|
+
if (this.isSelectAllChecked) {
|
|
835
|
+
this.selectedOptions = [...this.options];
|
|
836
|
+
this.checkAllOptions();
|
|
837
|
+
} else {
|
|
838
|
+
this.selectedOptions = [];
|
|
839
|
+
this.unCheckedAllOptions();
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
await this.updateComplete;
|
|
843
|
+
this.setVisualListbox(true);
|
|
844
|
+
this.notifySelectedChange({
|
|
845
|
+
selected: this.selectedOptions
|
|
846
|
+
});
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
handleInputKeyUp(event: KeyboardEvent) {
|
|
850
|
+
switch (event.code) {
|
|
851
|
+
case Key.Escape: {
|
|
852
|
+
break;
|
|
853
|
+
}
|
|
854
|
+
case Key.Backspace:
|
|
855
|
+
{
|
|
856
|
+
this.setFocusOnHost(true);
|
|
857
|
+
this.setVisualListbox(true);
|
|
858
|
+
this.resizeListbox();
|
|
859
|
+
this.removeMultiTag();
|
|
860
|
+
}
|
|
861
|
+
break;
|
|
862
|
+
case Key.ArrowLeft:
|
|
863
|
+
{
|
|
864
|
+
if (this.isMulti) {
|
|
865
|
+
if (event.shiftKey) {
|
|
866
|
+
this.selectMultiTag(true);
|
|
867
|
+
} else {
|
|
868
|
+
this.selectMultiTag(false);
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
break;
|
|
873
|
+
default: {
|
|
874
|
+
if (this.isMulti) {
|
|
875
|
+
this.unselectedAllMultiTag();
|
|
876
|
+
}
|
|
877
|
+
break;
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
private notifyInputValueChanged = debounce((value: string) => {
|
|
883
|
+
this.dispatchEvent(
|
|
884
|
+
new CustomEvent("combobox-input", {
|
|
885
|
+
composed: true,
|
|
886
|
+
bubbles: true,
|
|
887
|
+
detail: {
|
|
888
|
+
value
|
|
889
|
+
}
|
|
890
|
+
})
|
|
891
|
+
);
|
|
892
|
+
|
|
893
|
+
this.notifySearchResultCount();
|
|
894
|
+
this.focusedGroupIndex = 0;
|
|
895
|
+
requestAnimationFrame(() => {
|
|
896
|
+
this.input!.focus();
|
|
897
|
+
this.focusedGroupIndex = -1;
|
|
898
|
+
});
|
|
899
|
+
}, 250);
|
|
900
|
+
|
|
901
|
+
handleInput(event: Event) {
|
|
902
|
+
const inputValue = (event.target as HTMLInputElement).value;
|
|
903
|
+
this.inputValue = inputValue.trim();
|
|
904
|
+
this.notifyInputValueChanged(inputValue.trim());
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
private removeAllSelected() {
|
|
908
|
+
this.focusedIndex = -1;
|
|
909
|
+
this.focusedGroupIndex = -1;
|
|
910
|
+
this.selectedOptions = [];
|
|
911
|
+
this.inputValue = "";
|
|
912
|
+
this.setInputValue();
|
|
913
|
+
this.input?.setAttribute(ATTRIBUTES.AriaActivedescendant, "");
|
|
914
|
+
this.setVisualListbox(false);
|
|
915
|
+
this.unCheckedAllOptions();
|
|
916
|
+
this.setSelectedAttribute(undefined);
|
|
917
|
+
this.updateOnNextFrame(() => {
|
|
918
|
+
this.input!.focus();
|
|
919
|
+
});
|
|
920
|
+
this.notifySelectedChange({
|
|
921
|
+
selected: this.selectedOptions
|
|
922
|
+
});
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
private removeSelected(option: string | OptionMember) {
|
|
926
|
+
const index = this.findSelectedOption(option);
|
|
927
|
+
const checkedOptionIndex = this.filteredOptions.indexOf(option);
|
|
928
|
+
|
|
929
|
+
if (checkedOptionIndex !== -1) {
|
|
930
|
+
this.unCheckedOption(checkedOptionIndex);
|
|
931
|
+
}
|
|
932
|
+
if (index !== -1) {
|
|
933
|
+
this.selectedOptions.splice(index, 1);
|
|
934
|
+
this.requestUpdate();
|
|
935
|
+
}
|
|
936
|
+
this.updateOnNextFrame(() => {
|
|
937
|
+
this.input!.focus();
|
|
938
|
+
this.focusedGroupIndex = -1;
|
|
939
|
+
});
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
private selectedChange(event: CustomEvent<{ event: MouseEvent }>) {
|
|
943
|
+
const { event: clickEvent } = event.detail;
|
|
944
|
+
let optionIndex = this.findOptionIndex(clickEvent);
|
|
945
|
+
if (optionIndex !== -1) {
|
|
946
|
+
this.focusedIndex = this.allowSelectAll && this.checkForVirtualScroll() ? optionIndex + 1 : optionIndex;
|
|
947
|
+
if (this.isMulti && this.allowSelectAll && !this.checkForVirtualScroll()) {
|
|
948
|
+
optionIndex = optionIndex - 1;
|
|
949
|
+
}
|
|
950
|
+
const option = this.getFocusedItem(optionIndex);
|
|
951
|
+
this.setSelectedAttribute(option);
|
|
952
|
+
if (option) {
|
|
953
|
+
this.setSelectedOption(option);
|
|
954
|
+
if (!this.isMulti) {
|
|
955
|
+
this.setInputValue(this.getOptionValue(option));
|
|
956
|
+
this.input?.setAttribute(ATTRIBUTES.AriaActivedescendant, this.getOptionId(option));
|
|
957
|
+
} else if (this.isMulti && this.allowSelectAll) {
|
|
958
|
+
this.isSelectAllChecked = this.isSelectAllSelected();
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
private setSelectedAttribute(option: string | OptionMember | undefined) {
|
|
965
|
+
let optionId = "";
|
|
966
|
+
if (option) {
|
|
967
|
+
optionId = this.getOptionId(option);
|
|
968
|
+
}
|
|
969
|
+
this.lists?.forEach((list, _index) => {
|
|
970
|
+
if (list?.id === optionId) {
|
|
971
|
+
list?.setAttribute("selected", "true");
|
|
972
|
+
} else {
|
|
973
|
+
list?.setAttribute("selected", "false");
|
|
974
|
+
}
|
|
975
|
+
});
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
private shouldChangeButton() {
|
|
979
|
+
const shouldChange =
|
|
980
|
+
(this.input && this.input.value.length > 0 && !this.noClearIcon) ||
|
|
981
|
+
(this.isMulti && this.selectedOptions.length && !this.noClearIcon);
|
|
982
|
+
if (shouldChange) {
|
|
983
|
+
document.dispatchEvent(new CustomEvent("on-widget-update"));
|
|
984
|
+
}
|
|
985
|
+
return shouldChange;
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
private setCustomValue() {
|
|
989
|
+
if (!this.optionId && !this.optionValue) {
|
|
990
|
+
this.options = [...this.options, this.inputValue];
|
|
991
|
+
|
|
992
|
+
this.setSelectedOption(this.inputValue);
|
|
993
|
+
|
|
994
|
+
if (!this.isMulti) {
|
|
995
|
+
this.updateOnNextFrame(() => {
|
|
996
|
+
this.focusedIndex = this.filteredOptions.length - 1;
|
|
997
|
+
const option = this.getFocusedItem(this.focusedIndex);
|
|
998
|
+
if (option) {
|
|
999
|
+
this.setInputValue(this.getOptionValue(option));
|
|
1000
|
+
this.input?.setAttribute(ATTRIBUTES.AriaActivedescendant, this.getOptionId(option));
|
|
1001
|
+
}
|
|
1002
|
+
});
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
this.dispatchEvent(
|
|
1006
|
+
new CustomEvent("custom-value-add", {
|
|
1007
|
+
composed: true,
|
|
1008
|
+
bubbles: true,
|
|
1009
|
+
detail: {
|
|
1010
|
+
value: this.inputValue
|
|
1011
|
+
}
|
|
1012
|
+
})
|
|
1013
|
+
);
|
|
1014
|
+
}
|
|
1015
|
+
this.inputValue = "";
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
handleGroupFocus() {
|
|
1019
|
+
this.setFocusOnHost(false);
|
|
1020
|
+
if (!this.expanded) {
|
|
1021
|
+
this.setVisualListbox(true);
|
|
1022
|
+
}
|
|
1023
|
+
if (this.filteredGroupOptions.length > 0 && this.focusedGroupIndex === -1) {
|
|
1024
|
+
this.focusedGroupIndex = this.filteredGroupOptions.findIndex((item) => {
|
|
1025
|
+
return typeof item !== "string" && item.groupName === this.groupExpandedList[0];
|
|
1026
|
+
});
|
|
1027
|
+
}
|
|
1028
|
+
this.updateOnNextFrame(() => {
|
|
1029
|
+
if (
|
|
1030
|
+
this.focusedGroupIndex === -1 ||
|
|
1031
|
+
(!this.allowSelectAll && this.focusedGroupIndex >= this.filteredGroupOptions.length - 1) ||
|
|
1032
|
+
(this.allowSelectAll && this.focusedGroupIndex >= this.filteredGroupOptions.length)
|
|
1033
|
+
) {
|
|
1034
|
+
this.focusedGroupIndex = 0;
|
|
1035
|
+
} else {
|
|
1036
|
+
this.focusedGroupIndex++;
|
|
1037
|
+
}
|
|
1038
|
+
});
|
|
1039
|
+
this.focusedIndex = -1;
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
handleInputKeyDown(event: KeyboardEvent) {
|
|
1043
|
+
switch (event.code) {
|
|
1044
|
+
case Key.Backspace:
|
|
1045
|
+
{
|
|
1046
|
+
this.focusedIndex = -1;
|
|
1047
|
+
}
|
|
1048
|
+
break;
|
|
1049
|
+
case Key.Tab:
|
|
1050
|
+
case Key.Enter:
|
|
1051
|
+
{
|
|
1052
|
+
this.setFocusOnHost(true);
|
|
1053
|
+
if (this.expanded) {
|
|
1054
|
+
this.updateOnNextFrame(() => {
|
|
1055
|
+
const option = this.getFocusedItem(!this.allowSelectAll ? this.focusedIndex : this.focusedIndex - 1);
|
|
1056
|
+
if (this.allowCustomValue && this.input && this.input.value.length) {
|
|
1057
|
+
const isOptionAlreadyExist = this.findFilteredOption(this.inputValue) === -1;
|
|
1058
|
+
if (isOptionAlreadyExist) {
|
|
1059
|
+
this.setCustomValue();
|
|
1060
|
+
return;
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
if (option) {
|
|
1064
|
+
this.setSelectedAttribute(option);
|
|
1065
|
+
this.setSelectedOption(option);
|
|
1066
|
+
if (!this.showSelectedCount) {
|
|
1067
|
+
this.setInputValue(this.getOptionValue(option));
|
|
1068
|
+
this.input?.setAttribute(ATTRIBUTES.AriaActivedescendant, this.getOptionId(option));
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
if (this.isMulti && this.allowSelectAll && this.focusedIndex === 0) {
|
|
1072
|
+
this.handleSelectAll();
|
|
1073
|
+
}
|
|
1074
|
+
});
|
|
1075
|
+
}
|
|
1076
|
+
this.setVisualListbox(false);
|
|
1077
|
+
if (event.code === Key.Tab && this.isMulti) {
|
|
1078
|
+
return;
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
break;
|
|
1082
|
+
case Key.ArrowDown:
|
|
1083
|
+
{
|
|
1084
|
+
if (this.isOptGroup && this.filteredOptions.length === 0) {
|
|
1085
|
+
this.handleGroupFocus();
|
|
1086
|
+
return;
|
|
1087
|
+
}
|
|
1088
|
+
this.setFocusOnHost(false);
|
|
1089
|
+
if (!this.expanded) {
|
|
1090
|
+
this.setVisualListbox(true);
|
|
1091
|
+
}
|
|
1092
|
+
this.updateOnNextFrame(() => {
|
|
1093
|
+
if (
|
|
1094
|
+
this.focusedIndex === -1 ||
|
|
1095
|
+
(!this.allowSelectAll && this.focusedIndex >= this.filteredOptions.length - 1) ||
|
|
1096
|
+
(this.allowSelectAll && this.focusedIndex >= this.filteredOptions.length)
|
|
1097
|
+
) {
|
|
1098
|
+
this.focusedIndex = 0;
|
|
1099
|
+
} else {
|
|
1100
|
+
this.focusedIndex++;
|
|
1101
|
+
}
|
|
1102
|
+
const option = this.getFocusedItem(this.focusedIndex);
|
|
1103
|
+
this.groupExpandedList = [this.getOptionGroupName(option)];
|
|
1104
|
+
if (!this.showSelectedCount && option) {
|
|
1105
|
+
this.setInputValue(this.getOptionValue(option));
|
|
1106
|
+
this.input?.setAttribute(ATTRIBUTES.AriaActivedescendant, this.getOptionId(option));
|
|
1107
|
+
}
|
|
1108
|
+
this.focusedGroupIndex = -1;
|
|
1109
|
+
});
|
|
1110
|
+
}
|
|
1111
|
+
break;
|
|
1112
|
+
case Key.ArrowUp:
|
|
1113
|
+
{
|
|
1114
|
+
if (this.isOptGroup && this.filteredOptions.length === 0) {
|
|
1115
|
+
this.handleGroupFocus();
|
|
1116
|
+
return;
|
|
1117
|
+
}
|
|
1118
|
+
this.setFocusOnHost(false);
|
|
1119
|
+
if (!this.expanded) {
|
|
1120
|
+
this.setVisualListbox(true);
|
|
1121
|
+
}
|
|
1122
|
+
this.updateOnNextFrame(() => {
|
|
1123
|
+
if (this.focusedIndex <= 0) {
|
|
1124
|
+
this.focusedIndex = !this.allowSelectAll
|
|
1125
|
+
? this.filteredOptions.length - 1
|
|
1126
|
+
: this.filteredOptions.length;
|
|
1127
|
+
} else {
|
|
1128
|
+
this.focusedIndex--;
|
|
1129
|
+
}
|
|
1130
|
+
const option = this.getFocusedItem(this.focusedIndex);
|
|
1131
|
+
this.groupExpandedList = [this.getOptionGroupName(option)];
|
|
1132
|
+
if (option && !this.showSelectedCount) {
|
|
1133
|
+
this.setInputValue(this.getOptionValue(option));
|
|
1134
|
+
this.input?.setAttribute(ATTRIBUTES.AriaActivedescendant, this.getOptionId(option));
|
|
1135
|
+
this.focusedGroupIndex = -1;
|
|
1136
|
+
}
|
|
1137
|
+
});
|
|
1138
|
+
}
|
|
1139
|
+
break;
|
|
1140
|
+
case Key.ArrowLeft:
|
|
1141
|
+
case Key.ArrowRight:
|
|
1142
|
+
{
|
|
1143
|
+
event.stopPropagation();
|
|
1144
|
+
}
|
|
1145
|
+
break;
|
|
1146
|
+
case Key.Escape:
|
|
1147
|
+
{
|
|
1148
|
+
this.setFocusOnHost(true);
|
|
1149
|
+
if (this.expanded) {
|
|
1150
|
+
event.stopPropagation();
|
|
1151
|
+
this.setVisualListbox(false);
|
|
1152
|
+
} else {
|
|
1153
|
+
this.setInputValue();
|
|
1154
|
+
this.input?.setAttribute(ATTRIBUTES.AriaActivedescendant, "");
|
|
1155
|
+
this.focusedIndex = -1;
|
|
1156
|
+
this.focusedGroupIndex = -1;
|
|
1157
|
+
this.removeAllSelected();
|
|
1158
|
+
this.setSelectedAttribute(undefined);
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
break;
|
|
1162
|
+
case Key.Home:
|
|
1163
|
+
{
|
|
1164
|
+
this.setInputSelectionRange(0, 0);
|
|
1165
|
+
}
|
|
1166
|
+
break;
|
|
1167
|
+
case Key.End:
|
|
1168
|
+
{
|
|
1169
|
+
const { length } = this.inputValue;
|
|
1170
|
+
this.setInputSelectionRange(length, length);
|
|
1171
|
+
}
|
|
1172
|
+
break;
|
|
1173
|
+
case Key.Space: {
|
|
1174
|
+
if (this.isMulti && this.expanded) {
|
|
1175
|
+
event.preventDefault();
|
|
1176
|
+
const option = this.getFocusedItem(!this.allowSelectAll ? this.focusedIndex : this.focusedIndex - 1);
|
|
1177
|
+
if (option) {
|
|
1178
|
+
this.setSelectedOption(option);
|
|
1179
|
+
this.setSelectedAttribute(option);
|
|
1180
|
+
if (!this.showSelectedCount) {
|
|
1181
|
+
this.setInputValue();
|
|
1182
|
+
this.input?.setAttribute(ATTRIBUTES.AriaActivedescendant, "");
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
if (this.focusedIndex === 0 && this.allowSelectAll) {
|
|
1186
|
+
this.handleSelectAll();
|
|
1187
|
+
}
|
|
1188
|
+
}
|
|
1189
|
+
this.expanded = true;
|
|
1190
|
+
break;
|
|
1191
|
+
}
|
|
1192
|
+
default: {
|
|
1193
|
+
break;
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
handleGroupLabelKeyDown(event: KeyboardEvent, option: OptionMember) {
|
|
1199
|
+
switch (event.code) {
|
|
1200
|
+
case Key.Tab:
|
|
1201
|
+
{
|
|
1202
|
+
this.handleGroupFocus();
|
|
1203
|
+
}
|
|
1204
|
+
break;
|
|
1205
|
+
case Key.Enter:
|
|
1206
|
+
case Key.Space:
|
|
1207
|
+
{
|
|
1208
|
+
if (this.focusedGroupIndex !== -1) {
|
|
1209
|
+
this.toggleGroupListBox(event, option.value);
|
|
1210
|
+
} else {
|
|
1211
|
+
this.setFocusOnHost(true);
|
|
1212
|
+
this.setVisualListbox(false);
|
|
1213
|
+
this.updateOnNextFrame(() => {
|
|
1214
|
+
const option = this.getFocusedItem(!this.allowSelectAll ? this.focusedIndex : this.focusedIndex - 1);
|
|
1215
|
+
if (option) {
|
|
1216
|
+
this.setSelectedOption(option);
|
|
1217
|
+
if (!this.showSelectedCount) {
|
|
1218
|
+
this.setInputValue(this.getOptionValue(option));
|
|
1219
|
+
this.input?.setAttribute(ATTRIBUTES.AriaActivedescendant, this.getOptionId(option));
|
|
1220
|
+
this.updateOnNextFrame(() => {
|
|
1221
|
+
this.input!.focus();
|
|
1222
|
+
this.focusedGroupIndex = -1;
|
|
1223
|
+
});
|
|
1224
|
+
}
|
|
1225
|
+
}
|
|
1226
|
+
if (this.isMulti && this.allowSelectAll && this.focusedIndex === 0) {
|
|
1227
|
+
this.handleSelectAll();
|
|
1228
|
+
}
|
|
1229
|
+
});
|
|
1230
|
+
}
|
|
1231
|
+
}
|
|
1232
|
+
break;
|
|
1233
|
+
case Key.ArrowDown:
|
|
1234
|
+
{
|
|
1235
|
+
if (this.filteredOptions.length === 0) {
|
|
1236
|
+
return;
|
|
1237
|
+
}
|
|
1238
|
+
this.setFocusOnHost(false);
|
|
1239
|
+
this.updateOnNextFrame(() => {
|
|
1240
|
+
if (
|
|
1241
|
+
this.focusedIndex === -1 ||
|
|
1242
|
+
(!this.allowSelectAll && this.focusedIndex >= this.filteredOptions.length - 1) ||
|
|
1243
|
+
(this.allowSelectAll && this.focusedIndex >= this.filteredOptions.length)
|
|
1244
|
+
) {
|
|
1245
|
+
this.focusedIndex = 0;
|
|
1246
|
+
} else {
|
|
1247
|
+
this.focusedIndex++;
|
|
1248
|
+
}
|
|
1249
|
+
const option = this.getFocusedItem(this.focusedIndex);
|
|
1250
|
+
this.groupExpandedList = [this.getOptionGroupName(option)];
|
|
1251
|
+
if (!this.showSelectedCount && option) {
|
|
1252
|
+
this.setInputValue(this.getOptionValue(option));
|
|
1253
|
+
this.input?.setAttribute(ATTRIBUTES.AriaActivedescendant, this.getOptionId(option));
|
|
1254
|
+
}
|
|
1255
|
+
this.focusedGroupIndex = -1;
|
|
1256
|
+
});
|
|
1257
|
+
}
|
|
1258
|
+
break;
|
|
1259
|
+
case Key.ArrowUp:
|
|
1260
|
+
{
|
|
1261
|
+
if (this.isOptGroup && this.filteredOptions.length === 0) {
|
|
1262
|
+
return;
|
|
1263
|
+
}
|
|
1264
|
+
this.setFocusOnHost(false);
|
|
1265
|
+
this.updateOnNextFrame(() => {
|
|
1266
|
+
if (this.focusedIndex <= 0) {
|
|
1267
|
+
this.focusedIndex = !this.allowSelectAll
|
|
1268
|
+
? this.filteredOptions.length - 1
|
|
1269
|
+
: this.filteredOptions.length;
|
|
1270
|
+
} else {
|
|
1271
|
+
this.focusedIndex--;
|
|
1272
|
+
}
|
|
1273
|
+
const item = this.getFocusedItem(this.focusedIndex);
|
|
1274
|
+
this.groupExpandedList = [this.getOptionGroupName(item)];
|
|
1275
|
+
if (item && !this.showSelectedCount) {
|
|
1276
|
+
this.setInputValue(this.getOptionValue(item));
|
|
1277
|
+
this.input?.setAttribute(ATTRIBUTES.AriaActivedescendant, this.getOptionId(item));
|
|
1278
|
+
}
|
|
1279
|
+
});
|
|
1280
|
+
}
|
|
1281
|
+
break;
|
|
1282
|
+
case Key.Escape:
|
|
1283
|
+
{
|
|
1284
|
+
this.focusedGroupIndex = -1;
|
|
1285
|
+
this.setVisualListbox(false);
|
|
1286
|
+
this.setFocusOnHost(true);
|
|
1287
|
+
this.input!.focus();
|
|
1288
|
+
}
|
|
1289
|
+
break;
|
|
1290
|
+
default: {
|
|
1291
|
+
this.setVisualListbox(true);
|
|
1292
|
+
break;
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
toggleVisualListBox(e: any) {
|
|
1298
|
+
if (this.readOnly) {
|
|
1299
|
+
return;
|
|
1300
|
+
}
|
|
1301
|
+
if (e.target.classList.contains("md-combobox-listbox")) {
|
|
1302
|
+
e.target.focus();
|
|
1303
|
+
} else if (e.target.localName === "md-icon") {
|
|
1304
|
+
const parentElement = e.target.parentElement?.parentElement?.parentElement;
|
|
1305
|
+
if (parentElement) {
|
|
1306
|
+
const input = parentElement.querySelector(".md-combobox-listbox");
|
|
1307
|
+
setTimeout(() => {
|
|
1308
|
+
input.focus();
|
|
1309
|
+
}, 10);
|
|
1310
|
+
}
|
|
1311
|
+
}
|
|
1312
|
+
if (this.expanded) {
|
|
1313
|
+
this.setVisualListbox(false);
|
|
1314
|
+
} else {
|
|
1315
|
+
// While open combo-box
|
|
1316
|
+
this.dispatchEvent(
|
|
1317
|
+
new CustomEvent("combobox-on-expand", {
|
|
1318
|
+
composed: true,
|
|
1319
|
+
bubbles: true
|
|
1320
|
+
})
|
|
1321
|
+
);
|
|
1322
|
+
this.notifySearchResultCount();
|
|
1323
|
+
this.setVisualListbox(true);
|
|
1324
|
+
}
|
|
1325
|
+
this.input!.focus();
|
|
1326
|
+
this.setGroupList("");
|
|
1327
|
+
this.focusedGroupIndex = -1;
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
toggleGroupListBox(e: Event, data: string) {
|
|
1331
|
+
e.stopPropagation();
|
|
1332
|
+
this.focusedGroupIndex = this.filteredGroupOptions.findIndex((item) => {
|
|
1333
|
+
return typeof item !== "string" && item.groupName === data;
|
|
1334
|
+
});
|
|
1335
|
+
this.setGroupList(data);
|
|
1336
|
+
this.resizeListbox();
|
|
1337
|
+
}
|
|
1338
|
+
|
|
1339
|
+
handleRemoveAll(event: MouseEvent) {
|
|
1340
|
+
event.stopPropagation();
|
|
1341
|
+
this.dispatchEvent(new CustomEvent("remove-all-selected"));
|
|
1342
|
+
}
|
|
1343
|
+
|
|
1344
|
+
handleOutsideClick = (event: MouseEvent) => {
|
|
1345
|
+
let insideInputClick = false;
|
|
1346
|
+
const path = event.composedPath();
|
|
1347
|
+
if (path.length) {
|
|
1348
|
+
insideInputClick = !!path.find((element) => element === this);
|
|
1349
|
+
if (!insideInputClick) {
|
|
1350
|
+
this.setVisualListbox(false);
|
|
1351
|
+
this.unselectedAllMultiTag();
|
|
1352
|
+
}
|
|
1353
|
+
}
|
|
1354
|
+
};
|
|
1355
|
+
|
|
1356
|
+
connectedCallback() {
|
|
1357
|
+
super.connectedCallback();
|
|
1358
|
+
this.setupEvents();
|
|
1359
|
+
const isOptGroup = this.querySelector("optgroup");
|
|
1360
|
+
if (isOptGroup) this.isOptGroup = true;
|
|
1361
|
+
}
|
|
1362
|
+
|
|
1363
|
+
disconnectedCallback() {
|
|
1364
|
+
super.disconnectedCallback();
|
|
1365
|
+
this.teardownEvents();
|
|
1366
|
+
}
|
|
1367
|
+
|
|
1368
|
+
static get styles() {
|
|
1369
|
+
return [reset, styles];
|
|
1370
|
+
}
|
|
1371
|
+
|
|
1372
|
+
get listItemOptionMap() {
|
|
1373
|
+
return {
|
|
1374
|
+
"md-combobox-multiselect": this.isMulti,
|
|
1375
|
+
compact: this.compact,
|
|
1376
|
+
"md-combobox-dropdown-arrow": this.isDropdownArrow
|
|
1377
|
+
};
|
|
1378
|
+
}
|
|
1379
|
+
|
|
1380
|
+
get filteredOptions() {
|
|
1381
|
+
return this.filterOptions(this.trimSpace ? this.inputValue.replace(/\s+/g, "") : this.inputValue).filter(
|
|
1382
|
+
(options: string | OptionMember) => {
|
|
1383
|
+
if (this.isOptGroup) {
|
|
1384
|
+
if (typeof options !== "string" && this.groupExpandedList.includes(this.getOptionGroupName(options))) {
|
|
1385
|
+
return options.isLabel === "false";
|
|
1386
|
+
}
|
|
1387
|
+
} else {
|
|
1388
|
+
return true;
|
|
1389
|
+
}
|
|
1390
|
+
}
|
|
1391
|
+
);
|
|
1392
|
+
}
|
|
1393
|
+
|
|
1394
|
+
get filteredGroupOptions() {
|
|
1395
|
+
return this.filterOptions(this.trimSpace ? this.inputValue.replace(/\s+/g, "") : this.inputValue).filter(
|
|
1396
|
+
(options: string | OptionMember) => {
|
|
1397
|
+
if (this.isOptGroup) {
|
|
1398
|
+
if (typeof options !== "string") {
|
|
1399
|
+
return options.isLabel === "true";
|
|
1400
|
+
}
|
|
1401
|
+
} else {
|
|
1402
|
+
return true;
|
|
1403
|
+
}
|
|
1404
|
+
}
|
|
1405
|
+
);
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1408
|
+
get comboBoxTemplateClassMap() {
|
|
1409
|
+
return {
|
|
1410
|
+
[`md-combobox--${this.shape}`]: !!this.shape,
|
|
1411
|
+
"md-combobox-searchable": this.searchable,
|
|
1412
|
+
"md-combobox-has-leading-icon": this.searchable || this.showFilterIcon,
|
|
1413
|
+
"md-new-combobox": this.newMomentum,
|
|
1414
|
+
[`md-${this.messageType}`]: !!this.messageType,
|
|
1415
|
+
"md-combobox-readonly": this.readOnly,
|
|
1416
|
+
"md-combobox-compact": this.compact,
|
|
1417
|
+
"md-combobox-dropdown-arrow": this.isDropdownArrow
|
|
1418
|
+
};
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1421
|
+
searchIconTemplate() {
|
|
1422
|
+
return this.leadingIconTemplate("search-bold", "search-icon");
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1425
|
+
filterIconTemplate() {
|
|
1426
|
+
return this.leadingIconTemplate("filter-bold", "filter-icon");
|
|
1427
|
+
}
|
|
1428
|
+
|
|
1429
|
+
leadingIconTemplate(iconName: string, iconClass: string) {
|
|
1430
|
+
return html`
|
|
1431
|
+
<md-icon
|
|
1432
|
+
name=${iconName}
|
|
1433
|
+
class=${iconClass}
|
|
1434
|
+
size="16"
|
|
1435
|
+
iconSet="momentumDesign"
|
|
1436
|
+
@click=${this.toggleVisualListBox}
|
|
1437
|
+
></md-icon>
|
|
1438
|
+
`;
|
|
1439
|
+
}
|
|
1440
|
+
|
|
1441
|
+
selectedOptionTemplate(selectedOption: string | OptionMember) {
|
|
1442
|
+
return html`
|
|
1443
|
+
<div class="md-combobox-selected-item">
|
|
1444
|
+
<span>${this.getOptionValue(selectedOption)}</span>
|
|
1445
|
+
<md-icon
|
|
1446
|
+
class="remove-item"
|
|
1447
|
+
name="cancel-bold"
|
|
1448
|
+
size=${this.newMomentum ? "16" : "8"}
|
|
1449
|
+
iconSet="momentumDesign"
|
|
1450
|
+
@click=${() => this.removeSelected(selectedOption)}
|
|
1451
|
+
></md-icon>
|
|
1452
|
+
</div>
|
|
1453
|
+
`;
|
|
1454
|
+
}
|
|
1455
|
+
|
|
1456
|
+
clearButtonTemplate() {
|
|
1457
|
+
return html`
|
|
1458
|
+
<button
|
|
1459
|
+
type="button"
|
|
1460
|
+
class="md-combobox-button clear"
|
|
1461
|
+
aria-label=${this.clearAriaLabel}
|
|
1462
|
+
aria-controls="md-combobox-listbox"
|
|
1463
|
+
tabindex="0"
|
|
1464
|
+
?disabled=${this.disabled}
|
|
1465
|
+
?readonly=${this.readOnly}
|
|
1466
|
+
@click=${this.handleRemoveAll}
|
|
1467
|
+
>
|
|
1468
|
+
<md-icon
|
|
1469
|
+
class="md-input__icon-clear"
|
|
1470
|
+
name="cancel-bold"
|
|
1471
|
+
size="14"
|
|
1472
|
+
iconSet="momentumDesign"
|
|
1473
|
+
style="height: ${this.clearIconHeight};"
|
|
1474
|
+
></md-icon>
|
|
1475
|
+
</button>
|
|
1476
|
+
`;
|
|
1477
|
+
}
|
|
1478
|
+
|
|
1479
|
+
arrowButtonTemplate() {
|
|
1480
|
+
return html`
|
|
1481
|
+
<button
|
|
1482
|
+
type="button"
|
|
1483
|
+
class="md-combobox-button arrow-down"
|
|
1484
|
+
aria-expanded=${this.expanded}
|
|
1485
|
+
aria-label=${ifDefined(this.popupChevronAriaHidden === "true" ? undefined : this.arrowAriaLabel)}
|
|
1486
|
+
aria-controls="md-combobox-listbox"
|
|
1487
|
+
tabindex="-1"
|
|
1488
|
+
aria-hidden=${ifDefined(this.popupChevronAriaHidden === "true" ? "true" : undefined)}
|
|
1489
|
+
?disabled=${this.disabled}
|
|
1490
|
+
?readonly=${this.readOnly}
|
|
1491
|
+
@click=${this.toggleVisualListBox}
|
|
1492
|
+
>
|
|
1493
|
+
<md-icon name="arrow-down-bold" size="16" iconSet="momentumDesign"></md-icon>
|
|
1494
|
+
</button>
|
|
1495
|
+
`;
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1498
|
+
groupArrowButtonTemplate(data: string) {
|
|
1499
|
+
const iconName = this.groupExpandedList.includes(data) ? "arrow-up-bold" : "arrow-down-bold";
|
|
1500
|
+
return html`
|
|
1501
|
+
<button
|
|
1502
|
+
type="button"
|
|
1503
|
+
class="md-combobox-button"
|
|
1504
|
+
aria-label=${ifDefined(this.popupChevronAriaHidden === "true" ? undefined : this.arrowAriaLabel)}
|
|
1505
|
+
aria-controls="md-combobox-listbox"
|
|
1506
|
+
tabindex="-1"
|
|
1507
|
+
aria-hidden=${this.popupChevronAriaHidden === "true" ? "true" : "false"}
|
|
1508
|
+
?disabled=${this.disabled}
|
|
1509
|
+
?readonly=${this.readOnly}
|
|
1510
|
+
@click=${(e: MouseEvent) => this.toggleGroupListBox(e, data)}
|
|
1511
|
+
>
|
|
1512
|
+
<span>
|
|
1513
|
+
<md-icon name=${iconName} size="12" iconSet="momentumDesign"></md-icon>
|
|
1514
|
+
</span>
|
|
1515
|
+
</button>
|
|
1516
|
+
`;
|
|
1517
|
+
}
|
|
1518
|
+
|
|
1519
|
+
getSelectAllOption() {
|
|
1520
|
+
const ariaLabelForCount = this.checkForVirtualScroll() ? `, 1 of ${this.options.length + 1}` : "";
|
|
1521
|
+
return html`
|
|
1522
|
+
<div
|
|
1523
|
+
id="selectAll"
|
|
1524
|
+
part="combobox-option"
|
|
1525
|
+
class="md-combobox-option ${classMap(this.listItemOptionMap)}"
|
|
1526
|
+
@click=${this.handleSelectAll}
|
|
1527
|
+
aria-label="${this.selectAllTextLocalization}${ariaLabelForCount}"
|
|
1528
|
+
aria-checked=${ifDefined(this.isSelectAllChecked ? "true" : undefined)}
|
|
1529
|
+
role="checkbox"
|
|
1530
|
+
>
|
|
1531
|
+
<span class="select-option" aria-hidden="true">
|
|
1532
|
+
<md-icon name="check-bold" size="14" iconSet="momentumDesign"></md-icon>
|
|
1533
|
+
</span>
|
|
1534
|
+
|
|
1535
|
+
<span part="label" class="select-label" aria-hidden="true">${this.selectAllTextLocalization}</span>
|
|
1536
|
+
</div>
|
|
1537
|
+
`;
|
|
1538
|
+
}
|
|
1539
|
+
|
|
1540
|
+
getSelctedCount() {
|
|
1541
|
+
if (this.selectedOptions.length === 0) {
|
|
1542
|
+
return nothing;
|
|
1543
|
+
} else if (this.isSelectAllSelected()) {
|
|
1544
|
+
return html` <span class="selected-count">${this.allTextLocalization}</span> `;
|
|
1545
|
+
}
|
|
1546
|
+
return html`
|
|
1547
|
+
<span class="selected-count">${this.selectedOptions.length} ${this.selectedTextLocalization}</span>
|
|
1548
|
+
`;
|
|
1549
|
+
}
|
|
1550
|
+
checkForVirtualScroll() {
|
|
1551
|
+
return this.useVirtualScroll && !this.isOptGroup;
|
|
1552
|
+
}
|
|
1553
|
+
|
|
1554
|
+
rangeChanged() {
|
|
1555
|
+
this.updateFocusedIndex(this.focusedIndex);
|
|
1556
|
+
this.checkSelectedOptions();
|
|
1557
|
+
this.resizeListbox();
|
|
1558
|
+
}
|
|
1559
|
+
|
|
1560
|
+
getCustomErrorContent() {
|
|
1561
|
+
const element = this.querySelector("[slot]") || this.shadowRoot!.querySelector("[slot]");
|
|
1562
|
+
return document.createRange().createContextualFragment(`${element?.outerHTML}`);
|
|
1563
|
+
}
|
|
1564
|
+
|
|
1565
|
+
getCustomContent(option: string | OptionMember) {
|
|
1566
|
+
const slotName = this.getCustomContentName(option);
|
|
1567
|
+
if (this.isOptGroup) {
|
|
1568
|
+
const slot = [...this.querySelectorAll(`[slot]`)].find((element) => element.slot === slotName);
|
|
1569
|
+
if (slot) {
|
|
1570
|
+
return document.createRange().createContextualFragment(`${slot.outerHTML}`);
|
|
1571
|
+
} else {
|
|
1572
|
+
return html``;
|
|
1573
|
+
}
|
|
1574
|
+
} else {
|
|
1575
|
+
return html` <slot name=${ifDefined(slotName)}></slot> `;
|
|
1576
|
+
}
|
|
1577
|
+
}
|
|
1578
|
+
|
|
1579
|
+
renderGroupLabelHeader(option: OptionMember, optionIndex: number) {
|
|
1580
|
+
return html`
|
|
1581
|
+
<div
|
|
1582
|
+
part="group-label"
|
|
1583
|
+
class="group-label"
|
|
1584
|
+
role="listbox"
|
|
1585
|
+
aria-controls="md-combobox-listbox"
|
|
1586
|
+
aria-label=${option.value}
|
|
1587
|
+
@click=${(e: MouseEvent) => this.toggleGroupListBox(e, option.value)}
|
|
1588
|
+
@keydown=${(e: KeyboardEvent) => {
|
|
1589
|
+
this.handleGroupLabelKeyDown(e, option);
|
|
1590
|
+
}}
|
|
1591
|
+
tabindex="1"
|
|
1592
|
+
aria-selected=${this.getAriaState(optionIndex)}
|
|
1593
|
+
>
|
|
1594
|
+
<span part="group-label">${option.value}</span>
|
|
1595
|
+
${this.groupArrowButtonTemplate(option.value)}
|
|
1596
|
+
</div>
|
|
1597
|
+
`;
|
|
1598
|
+
}
|
|
1599
|
+
|
|
1600
|
+
renderWithoutVirtualScroll() {
|
|
1601
|
+
return repeat(
|
|
1602
|
+
this.filterOptions(this.trimSpace ? this.inputValue.replace(/\s+/g, "") : this.inputValue),
|
|
1603
|
+
(option: string | OptionMember) => this.getOptionId(option),
|
|
1604
|
+
(option: string | OptionMember, optionIndex) => {
|
|
1605
|
+
if (typeof option !== "string" && this.isOptGroup && option.isLabel === "true") {
|
|
1606
|
+
return this.renderGroupLabelHeader(option, optionIndex);
|
|
1607
|
+
} else if (!(this.isOptGroup && !this.groupExpandedList.includes(this.getOptionGroupName(option)))) {
|
|
1608
|
+
return this.renderItem(option, optionIndex);
|
|
1609
|
+
}
|
|
1610
|
+
}
|
|
1611
|
+
);
|
|
1612
|
+
}
|
|
1613
|
+
|
|
1614
|
+
highlightingSearchedText(option: OptionMember | string) {
|
|
1615
|
+
return findHighlight(
|
|
1616
|
+
this.getOptionValue(option),
|
|
1617
|
+
this.trimSpace ? this.inputValue.replace(/\s+/g, "") : this.inputValue
|
|
1618
|
+
).map(({ text, matching }) =>
|
|
1619
|
+
matching
|
|
1620
|
+
? html` <span class="highlight-text" part="select-label">${text}</span> `
|
|
1621
|
+
: html` <span class="selected-label-text" part="select-label">${text}</span> `
|
|
1622
|
+
);
|
|
1623
|
+
}
|
|
1624
|
+
|
|
1625
|
+
addStyle() {
|
|
1626
|
+
const isInvisible = this.expanded
|
|
1627
|
+
? this.options.length && this.filteredOptions.length === 0 && this.inputValue && this.allowCustomValue
|
|
1628
|
+
: true;
|
|
1629
|
+
if (!this.checkForVirtualScroll()) {
|
|
1630
|
+
return styleMap({
|
|
1631
|
+
display: isInvisible ? "none" : "block",
|
|
1632
|
+
"z-index": "99",
|
|
1633
|
+
overflow: "auto"
|
|
1634
|
+
});
|
|
1635
|
+
} else {
|
|
1636
|
+
return styleMap({
|
|
1637
|
+
visibility: isInvisible ? "hidden" : "visible",
|
|
1638
|
+
"z-index": isInvisible ? "-1" : "99",
|
|
1639
|
+
overflow: "hidden"
|
|
1640
|
+
});
|
|
1641
|
+
}
|
|
1642
|
+
}
|
|
1643
|
+
|
|
1644
|
+
renderItem(option: OptionMember | string, index: number) {
|
|
1645
|
+
const count = this.allowSelectAll ? index + 2 : index + 1;
|
|
1646
|
+
const total = this.allowSelectAll ? this.options.length + 1 : this.options.length;
|
|
1647
|
+
const ariaLabelForCount = this.checkForVirtualScroll() ? `, ${count} of ${total}` : "";
|
|
1648
|
+
return html`
|
|
1649
|
+
<div
|
|
1650
|
+
id=${this.getOptionId(option)}
|
|
1651
|
+
title="${this.getOptionValue(option)}"
|
|
1652
|
+
part="combobox-option"
|
|
1653
|
+
class="md-combobox-option"
|
|
1654
|
+
aria-posinset=${count}
|
|
1655
|
+
aria-setsize=${total}
|
|
1656
|
+
role=${this.isMulti ? "checkbox" : "listitem"}
|
|
1657
|
+
aria-label="${this.isCustomContent
|
|
1658
|
+
? this.getOptionId(option)
|
|
1659
|
+
: this.getOptionValue(option)}${ariaLabelForCount}"
|
|
1660
|
+
tabindex="-1"
|
|
1661
|
+
@click=${this.handleListClick}
|
|
1662
|
+
aria-checked=${ifDefined(this.isMulti ? this.isOptionChecked.call(this, option) : undefined)}
|
|
1663
|
+
>
|
|
1664
|
+
${this.isMulti
|
|
1665
|
+
? html`
|
|
1666
|
+
<span class="select-option" aria-hidden="true">
|
|
1667
|
+
<md-icon name="check-bold" size="14" iconSet="momentumDesign"></md-icon>
|
|
1668
|
+
</span>
|
|
1669
|
+
`
|
|
1670
|
+
: nothing}
|
|
1671
|
+
<span part="label" class="select-label" aria-hidden="true">
|
|
1672
|
+
${this.isCustomContent ? this.getCustomContent(option) : this.highlightingSearchedText(option)}
|
|
1673
|
+
</span>
|
|
1674
|
+
</div>
|
|
1675
|
+
`;
|
|
1676
|
+
}
|
|
1677
|
+
|
|
1678
|
+
inputTitle() {
|
|
1679
|
+
if (this.isMulti) {
|
|
1680
|
+
// For multi select, The title should be the selected items count
|
|
1681
|
+
return this.selectedOptions.length > 0
|
|
1682
|
+
? `${this.selectedOptions.length} ${this.selectedTextLocalization}`
|
|
1683
|
+
: this.placeholder;
|
|
1684
|
+
}
|
|
1685
|
+
return this.selectedOptions.length > 0 ? this.getOptionValue(this.selectedOptions[0]) : this.placeholder;
|
|
1686
|
+
}
|
|
1687
|
+
|
|
1688
|
+
helpTextTemplate() {
|
|
1689
|
+
return this.helpText
|
|
1690
|
+
? html`
|
|
1691
|
+
<md-help-text
|
|
1692
|
+
class="help-text ${classMap({ disabled: this.disabled, newMomentum: this.newMomentum })}"
|
|
1693
|
+
.message=${this.helpText}
|
|
1694
|
+
style=${styleMap({ width: "100%" })}
|
|
1695
|
+
></md-help-text>
|
|
1696
|
+
`
|
|
1697
|
+
: nothing;
|
|
1698
|
+
}
|
|
1699
|
+
|
|
1700
|
+
messagesTemplate() {
|
|
1701
|
+
return this.messages && !!this.messages.length
|
|
1702
|
+
? html`
|
|
1703
|
+
<div id="${this.htmlId}-message" part="message" class="md-combobox__messages">
|
|
1704
|
+
${repeat(this.messages, (message, id) => {
|
|
1705
|
+
return html`
|
|
1706
|
+
<md-help-text
|
|
1707
|
+
.message=${message}
|
|
1708
|
+
.id=${this.messageArr[id].id || ""}
|
|
1709
|
+
.ariaLive=${this.messageArr[id].ariaLive || "polite"}
|
|
1710
|
+
.messageType=${this.messageType as ComboBox.MessageType}
|
|
1711
|
+
></md-help-text>
|
|
1712
|
+
`;
|
|
1713
|
+
})}
|
|
1714
|
+
</div>
|
|
1715
|
+
`
|
|
1716
|
+
: nothing;
|
|
1717
|
+
}
|
|
1718
|
+
|
|
1719
|
+
get newArrowButtonTemplate() {
|
|
1720
|
+
//TODO: implement a new button instead of a div and the old button template
|
|
1721
|
+
// This should be tabbable
|
|
1722
|
+
return html`<div class="md-combobox-right-arrow">${this.arrowButtonTemplate()}</div>`;
|
|
1723
|
+
}
|
|
1724
|
+
|
|
1725
|
+
get renderNewMomentumArrow(): TemplateResult {
|
|
1726
|
+
return html` ${this.isDropdownArrow ? this.arrowButtonTemplate() : this.newArrowButtonTemplate} `;
|
|
1727
|
+
}
|
|
1728
|
+
|
|
1729
|
+
get renderTrailingInputControls(): TemplateResult {
|
|
1730
|
+
const showClearButton = this.shouldChangeButton();
|
|
1731
|
+
|
|
1732
|
+
if (this.newMomentum) {
|
|
1733
|
+
if (showClearButton && this.isDropdownArrow) {
|
|
1734
|
+
return html`${this.clearButtonTemplate()}`;
|
|
1735
|
+
} else if (showClearButton) {
|
|
1736
|
+
return html`${this.clearButtonTemplate()} ${this.renderNewMomentumArrow}`;
|
|
1737
|
+
}
|
|
1738
|
+
|
|
1739
|
+
return this.renderNewMomentumArrow;
|
|
1740
|
+
}
|
|
1741
|
+
|
|
1742
|
+
if (this.compact) {
|
|
1743
|
+
return html`${nothing}`;
|
|
1744
|
+
}
|
|
1745
|
+
|
|
1746
|
+
return html`${showClearButton ? this.clearButtonTemplate() : this.arrowButtonTemplate()}`;
|
|
1747
|
+
}
|
|
1748
|
+
|
|
1749
|
+
render() {
|
|
1750
|
+
return html`
|
|
1751
|
+
<div part="combobox" class="md-combobox md-combobox-list ${classMap(this.comboBoxTemplateClassMap)}">
|
|
1752
|
+
<div part="group" class="group ${classMap(this.listItemOptionMap)}">
|
|
1753
|
+
${this.searchable ? this.searchIconTemplate() : this.showFilterIcon ? this.filterIconTemplate() : nothing}
|
|
1754
|
+
<div class="md-combobox__multiwrap" part="multiwrap">
|
|
1755
|
+
${this.isMulti
|
|
1756
|
+
? this.isMulti && !this.showSelectedCount
|
|
1757
|
+
? repeat(this.selectedOptions, (selectedOption) => this.selectedOptionTemplate(selectedOption))
|
|
1758
|
+
: this.getSelctedCount()
|
|
1759
|
+
: nothing}
|
|
1760
|
+
<input
|
|
1761
|
+
id=${ifDefined(this.comboboxId || undefined)}
|
|
1762
|
+
class="md-combobox-listbox"
|
|
1763
|
+
type="text"
|
|
1764
|
+
role="combobox"
|
|
1765
|
+
aria-autocomplete="both"
|
|
1766
|
+
aria-label=${this.ariaLabelForComboBox}
|
|
1767
|
+
part="multiwrap-input"
|
|
1768
|
+
aria-expanded=${this.expanded}
|
|
1769
|
+
placeholder=${this.isMulti && this.showSelectedCount && this.selectedOptions.length !== 0
|
|
1770
|
+
? ""
|
|
1771
|
+
: this.placeholder}
|
|
1772
|
+
aria-controls="md-combobox-listbox"
|
|
1773
|
+
?readonly=${this.allowSelectAll || this.readOnly}
|
|
1774
|
+
?disabled=${this.disabled}
|
|
1775
|
+
?autofocus=${this.autofocus}
|
|
1776
|
+
title=${ifDefined(this.inputTitle())}
|
|
1777
|
+
.value=${this.inputValue}
|
|
1778
|
+
@click=${this.toggleVisualListBox}
|
|
1779
|
+
@input=${this.handleInput}
|
|
1780
|
+
@keyup=${this.handleInputKeyUp}
|
|
1781
|
+
@keydown=${this.handleInputKeyDown}
|
|
1782
|
+
/>
|
|
1783
|
+
</div>
|
|
1784
|
+
${this.renderTrailingInputControls}
|
|
1785
|
+
</div>
|
|
1786
|
+
|
|
1787
|
+
${this.showLoader || this.showCustomError
|
|
1788
|
+
? html`
|
|
1789
|
+
<div
|
|
1790
|
+
id="md-combobox-listbox"
|
|
1791
|
+
part="combobox-options"
|
|
1792
|
+
aria-label=${this.ariaLabel}
|
|
1793
|
+
style=${styleMap({
|
|
1794
|
+
display: this.expanded ? "block" : "none",
|
|
1795
|
+
"z-index": "99"
|
|
1796
|
+
})}
|
|
1797
|
+
>
|
|
1798
|
+
${this.getCustomErrorContent()}
|
|
1799
|
+
</div>
|
|
1800
|
+
`
|
|
1801
|
+
: html`
|
|
1802
|
+
<div
|
|
1803
|
+
id="md-combobox-listbox"
|
|
1804
|
+
part="combobox-options"
|
|
1805
|
+
aria-label=${this.ariaLabel || this.label}
|
|
1806
|
+
style=${this.addStyle()}
|
|
1807
|
+
role=${ifDefined(this.checkForVirtualScroll() ? undefined : "list")}
|
|
1808
|
+
>
|
|
1809
|
+
${this.isMulti && this.allowSelectAll && this.expanded ? this.getSelectAllOption() : nothing}
|
|
1810
|
+
${!this.checkForVirtualScroll()
|
|
1811
|
+
? this.renderWithoutVirtualScroll()
|
|
1812
|
+
: this.options.length !== 0 &&
|
|
1813
|
+
this.filterOptions(this.trimSpace ? this.inputValue.replace(/\s+/g, "") : this.inputValue)
|
|
1814
|
+
.length > 0
|
|
1815
|
+
? html`
|
|
1816
|
+
<div class="virtual-scroll" @rangechange=${this.rangeChanged}>
|
|
1817
|
+
${scroll({
|
|
1818
|
+
items: this.filterOptions(
|
|
1819
|
+
this.trimSpace ? this.inputValue.replace(/\s+/g, "") : this.inputValue
|
|
1820
|
+
),
|
|
1821
|
+
renderItem: (item: string | OptionMember, index?: number) =>
|
|
1822
|
+
this.renderItem(item, index || 0),
|
|
1823
|
+
useShadowDOM: false,
|
|
1824
|
+
scrollToIndex: {
|
|
1825
|
+
index: this.focusedIndex,
|
|
1826
|
+
position: this.focusedIndex === -1 ? "start" : "center"
|
|
1827
|
+
}
|
|
1828
|
+
})}
|
|
1829
|
+
</div>
|
|
1830
|
+
`
|
|
1831
|
+
: nothing}
|
|
1832
|
+
${this.options.length &&
|
|
1833
|
+
this.filteredOptions.length === 0 &&
|
|
1834
|
+
this.inputValue &&
|
|
1835
|
+
!this.allowCustomValue
|
|
1836
|
+
? html`
|
|
1837
|
+
<div class="no-result md-combobox-option" role="option" aria-selected="false" tabindex="-1">
|
|
1838
|
+
${this.resultsTextLocalization.trim()}
|
|
1839
|
+
</div>
|
|
1840
|
+
`
|
|
1841
|
+
: nothing}
|
|
1842
|
+
${this.options.length === 0
|
|
1843
|
+
? html`
|
|
1844
|
+
<div class="no-result md-combobox-option" role="option" aria-selected="false" tabindex="-1">
|
|
1845
|
+
${this.optionsTextLocalization.trim()}
|
|
1846
|
+
</div>
|
|
1847
|
+
`
|
|
1848
|
+
: nothing}
|
|
1849
|
+
</div>
|
|
1850
|
+
`}
|
|
1851
|
+
</div>
|
|
1852
|
+
${this.invalid
|
|
1853
|
+
? html`
|
|
1854
|
+
<div part="message" class="md-combobox-error ${classMap({ "md-new-combobox-error": this.newMomentum })}">
|
|
1855
|
+
<md-help-text .message=${this.invalidText} messageType="error"></md-help-text>
|
|
1856
|
+
</div>
|
|
1857
|
+
`
|
|
1858
|
+
: nothing}
|
|
1859
|
+
${this.messagesTemplate()} ${this.helpTextTemplate()}
|
|
1860
|
+
`;
|
|
1861
|
+
}
|
|
1862
|
+
}
|
|
1863
|
+
}
|
|
1864
|
+
|
|
1865
|
+
declare global {
|
|
1866
|
+
interface HTMLElementTagNameMap {
|
|
1867
|
+
"md-combobox": ComboBox.ELEMENT;
|
|
1868
|
+
}
|
|
1869
|
+
}
|