@momentum-ui/web-components 2.14.11 → 2.14.13
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 +66 -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 +38 -0
- package/.stylelintignore +6 -0
- package/.stylelintrc.js +18 -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 +129 -7
- package/publish-conf.js +64 -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 +77 -0
- package/src/[sandbox]/examples/AdvanceList/components/ParentComponentError.ts +116 -0
- package/src/[sandbox]/examples/AdvanceList/components/ParentComponentGeneric.ts +95 -0
- package/src/[sandbox]/examples/AdvanceList/components/ParentComponentPreSelect.ts +90 -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 +119 -0
- package/src/[sandbox]/examples/badge.ts +170 -0
- package/src/[sandbox]/examples/breadcrumb.ts +5 -0
- package/src/[sandbox]/examples/button-group.ts +66 -0
- package/src/[sandbox]/examples/button.ts +407 -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 +402 -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 +165 -0
- package/src/[sandbox]/examples/icon.ts +66 -0
- package/src/[sandbox]/examples/index.ts +54 -0
- package/src/[sandbox]/examples/input-file.ts +7 -0
- package/src/[sandbox]/examples/input.ts +440 -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 +580 -0
- package/src/[sandbox]/examples/modal.ts +451 -0
- package/src/[sandbox]/examples/pagination.ts +13 -0
- package/src/[sandbox]/examples/phone-input.ts +90 -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 +843 -0
- package/src/[sandbox]/examples/task-item.ts +99 -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 +737 -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 +50 -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 +87 -0
- package/src/components/accordion/scss/accordion.scss +30 -0
- package/src/components/accordion/scss/mixins.scss +16 -0
- package/src/components/accordion/scss/module.scss +17 -0
- package/src/components/accordion/scss/settings.scss +10 -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 +367 -0
- package/src/components/advance-list/AdvanceList.ts +267 -0
- package/src/components/advance-list/scss/AdvanceList.scss +69 -0
- package/src/components/advance-list/scss/module.scss +11 -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 +123 -0
- package/src/components/alert/Alert.test.ts +276 -0
- package/src/components/alert/Alert.ts +265 -0
- package/src/components/alert/scss/alert.scss +215 -0
- package/src/components/alert/scss/mixins.scss +27 -0
- package/src/components/alert/scss/module.scss +21 -0
- package/src/components/alert/scss/settings.scss +41 -0
- package/src/components/alert/tokens/lm-alert-tokens.js +52 -0
- package/src/components/alert/tokens/md-alert-tokens.js +52 -0
- package/src/components/alert/tokens/mdv2-alert-tokens.js +48 -0
- package/src/components/alert-banner/AlertBanner.mdx +38 -0
- package/src/components/alert-banner/AlertBanner.stories.ts +63 -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 +68 -0
- package/src/components/alert-banner/scss/mixins.scss +8 -0
- package/src/components/alert-banner/scss/module.scss +10 -0
- package/src/components/alert-banner/scss/settings.scss +15 -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 +42 -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 +97 -0
- package/src/components/avatar/Avatar.test.ts +202 -0
- package/src/components/avatar/Avatar.ts +294 -0
- package/src/components/avatar/CompositeAvatar.ts +47 -0
- package/src/components/avatar/Presence.test.ts +239 -0
- package/src/components/avatar/Presence.ts +52 -0
- package/src/components/avatar/Presence.utils.ts +132 -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 +20 -0
- package/src/components/avatar/scss/presence.scss +47 -0
- package/src/components/avatar/scss/settings.scss +249 -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 +179 -0
- package/src/components/badge/Badge.stories.ts +62 -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 +244 -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 +61 -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 +97 -0
- package/src/components/button/Button.test.ts +278 -0
- package/src/components/button/Button.ts +377 -0
- package/src/components/button/README.md +72 -0
- package/src/components/button/scss/button.scss +1002 -0
- package/src/components/button/scss/mixins.scss +281 -0
- package/src/components/button/scss/module.scss +18 -0
- package/src/components/button/scss/settings.scss +242 -0
- package/src/components/button/tokens/lm-button-tokens.js +352 -0
- package/src/components/button/tokens/mdv2-button-tokens.js +465 -0
- package/src/components/button-group/ButtonGroup.stories.ts +53 -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 +16 -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 +89 -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 +62 -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 +39 -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 +68 -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 +13 -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 +89 -0
- package/src/components/chip/Chip.test.ts +137 -0
- package/src/components/chip/Chip.ts +299 -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 +46 -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 +569 -0
- package/src/components/coachmark/scss/module.scss +14 -0
- package/src/components/coachmark/scss/settings.scss +4 -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/code-editor/CodeEditor.stories.ts +31 -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 +185 -0
- package/src/components/combobox/ComboBox.test.ts +1517 -0
- package/src/components/combobox/ComboBox.ts +1824 -0
- package/src/components/combobox/scss/combobox.scss +572 -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 +35 -0
- package/src/components/combobox/tokens/lm-combobox-tokens.js +152 -0
- package/src/components/combobox/tokens/md-combobox-tokens.js +156 -0
- package/src/components/combobox/tokens/mdv2-combobox-tokens.js +132 -0
- package/src/components/date-range-picker/DateRangePicker.stories.ts +49 -0
- package/src/components/date-range-picker/DateRangePicker.test.ts +173 -0
- package/src/components/date-range-picker/DateRangePicker.ts +92 -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 +50 -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 +42 -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 +240 -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 +72 -0
- package/src/components/datepicker/tokens/md-datepicker-tokens.js +72 -0
- package/src/components/datepicker/tokens/mdv2-datepicker-tokens.js +80 -0
- package/src/components/draggable/Draggable.mdx +258 -0
- package/src/components/draggable/Draggable.stories.ts +171 -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 +121 -0
- package/src/components/dropdown/Dropdown.test.ts +461 -0
- package/src/components/dropdown/Dropdown.ts +901 -0
- package/src/components/dropdown/scss/dropdown.scss +488 -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 +24 -0
- package/src/components/dropdown/tokens/lm-dropdown-tokens.js +58 -0
- package/src/components/dropdown/tokens/md-dropdown-tokens.js +58 -0
- package/src/components/dropdown/tokens/mdv2-dropdown-tokens.js +67 -0
- package/src/components/editable-textfield/EditableTextfield.stories.ts +106 -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 +48 -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 +116 -0
- package/src/components/favorite/scss/module.scss +18 -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 +72 -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 +59 -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 +61 -0
- package/src/components/grabber/Grabber.test.ts +171 -0
- package/src/components/grabber/Grabber.ts +183 -0
- package/src/components/grabber/scss/grabber.scss +123 -0
- package/src/components/grabber/scss/module.scss +5 -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 +79 -0
- package/src/components/icon/Icon.test.ts +181 -0
- package/src/components/icon/Icon.ts +474 -0
- package/src/components/icon/momentum-ui-to-design-icons.json +3087 -0
- package/src/components/icon/scss/icon.scss +36 -0
- package/src/components/icon/scss/module.scss +17 -0
- package/src/components/icon/scss/settings.scss +10 -0
- package/src/components/input/Input.stories.ts +133 -0
- package/src/components/input/Input.test.ts +347 -0
- package/src/components/input/Input.ts +556 -0
- package/src/components/input/scss/input.scss +529 -0
- package/src/components/input/scss/module.scss +26 -0
- package/src/components/input/tokens/lm-input-tokens.js +142 -0
- package/src/components/input/tokens/md-input-tokens.js +132 -0
- package/src/components/input/tokens/mdv2-input-tokens.js +168 -0
- package/src/components/input-file/InputFile.stories.ts +27 -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 +59 -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 +66 -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 +14 -0
- package/src/components/link/scss/settings.scss +5 -0
- package/src/components/link/tokens/lm-link-tokens.js +61 -0
- package/src/components/link/tokens/md-link-tokens.js +127 -0
- package/src/components/link/tokens/mdv2-link-tokens.js +47 -0
- package/src/components/list/List.stories.ts +60 -0
- package/src/components/list/List.test.ts +214 -0
- package/src/components/list/List.ts +198 -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 +49 -0
- package/src/components/loading/Loading.stories.ts +46 -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 +74 -0
- package/src/components/loading/scss/module.scss +8 -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 +197 -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 +61 -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 +92 -0
- package/src/components/menu-overlay/MenuOverlay.test.ts +634 -0
- package/src/components/menu-overlay/MenuOverlay.ts +487 -0
- package/src/components/menu-overlay/scss/menu-overlay.scss +75 -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 +78 -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 +37 -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 +45 -0
- package/src/components/phone-input/PhoneInput.test.ts +198 -0
- package/src/components/phone-input/PhoneInput.ts +275 -0
- package/src/components/phone-input/scss/module.scss +7 -0
- package/src/components/phone-input/scss/phoneInput.scss +95 -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/progress-bar/ProgressBar.stories.ts +48 -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 +28 -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 +47 -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 +17 -0
- package/src/components/radio/scss/radio.scss +149 -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 +54 -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 +34 -0
- package/src/components/spinner/scss/module.scss +10 -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 +166 -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 +215 -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 +172 -0
- package/src/components/tabs/Tabs.test.ts +676 -0
- package/src/components/tabs/Tabs.ts +1222 -0
- package/src/components/tabs/scss/mixins.scss +6 -0
- package/src/components/tabs/scss/module.scss +16 -0
- package/src/components/tabs/scss/settings.scss +22 -0
- package/src/components/tabs/scss/tab.scss +304 -0
- package/src/components/tabs/scss/tabs.scss +241 -0
- package/src/components/tabs/tokens/lm-tabs-tokens.js +74 -0
- package/src/components/tabs/tokens/md-tabs-tokens.js +68 -0
- package/src/components/tabs/tokens/mdv2-tabs-tokens.js +52 -0
- package/src/components/taskitem/TaskItem.stories.ts +63 -0
- package/src/components/taskitem/TaskItem.test.ts +417 -0
- package/src/components/taskitem/TaskItem.ts +258 -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 +43 -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 +88 -0
- package/src/components/theme/Theme.ts +377 -0
- package/src/components/theme/index.ts +8 -0
- package/src/components/timepicker/TimePicker.stories.ts +44 -0
- package/src/components/timepicker/TimePicker.test.ts +145 -0
- package/src/components/timepicker/TimePicker.ts +424 -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 +46 -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 +98 -0
- package/src/components/toggle-switch/scss/module.scss +12 -0
- package/src/components/toggle-switch/scss/settings.scss +14 -0
- package/src/components/toggle-switch/scss/toggle-switch.scss +197 -0
- package/src/components/toggle-switch/tokens/lm-toggle-tokens.js +52 -0
- package/src/components/toggle-switch/tokens/md-toggle-tokens.js +52 -0
- package/src/components/toggle-switch/tokens/mdv2-toggle-tokens.js +48 -0
- package/src/components/tooltip/Tooltip.stories.ts +59 -0
- package/src/components/tooltip/Tooltip.test.ts +108 -0
- package/src/components/tooltip/Tooltip.ts +242 -0
- package/src/components/tooltip/scss/module.scss +12 -0
- package/src/components/tooltip/scss/settings.scss +11 -0
- package/src/components/tooltip/scss/tooltip.scss +141 -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 +79 -0
- package/src/internal-components/color-table/ColorTable.stories.ts +39 -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/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 +480 -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 +110 -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 +25 -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/validations.ts +29 -0
- package/src/wc_scss/colors/settings-base.scss +208 -0
- package/src/wc_scss/colors/settings-transparencies.scss +52 -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 +12 -0
- package/src/wc_scss/path.scss +4 -0
- package/src/wc_scss/reset.scss +27 -0
- package/src/wc_scss/settings/avatar.scss +205 -0
- package/src/wc_scss/settings/button-settings.scss +193 -0
- package/src/wc_scss/settings/core.scss +130 -0
- package/src/wc_scss/settings/focus.scss +7 -0
- package/src/wc_scss/settings/form-controls.scss +23 -0
- package/src/wc_scss/settings/forms.scss +26 -0
- package/src/wc_scss/settings/input.scss +59 -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 +114 -0
- package/src/wc_scss/themes/global--light.scss +114 -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 +176 -0
- package/src/wc_scss/tools/functions/core.scss +183 -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 +208 -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 +297 -0
- package/src/wc_scss/typography/typography.scss +321 -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 +309 -0
- package/webpack.plugin.LoadChunks.ts +67 -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 -26
- 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 -11
- 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 -9
- 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 -1
- 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 -26
- 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 -122
- 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 -17
- 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 -1
- 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 -8
- 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 -23
- 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 -1
- 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 -7
- 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 -8
- 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 -1
- 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 -61
- 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-28.js +0 -1
- package/dist/chunks/md-29.js +0 -221
- package/dist/chunks/md-3.js +0 -1
- package/dist/chunks/md-30.js +0 -49
- package/dist/chunks/md-31.js +0 -1
- package/dist/chunks/md-32.js +0 -1
- package/dist/chunks/md-33.js +0 -36
- package/dist/chunks/md-34.js +0 -33
- package/dist/chunks/md-35.js +0 -23
- package/dist/chunks/md-36.js +0 -5
- package/dist/chunks/md-37.js +0 -5
- package/dist/chunks/md-38.js +0 -1
- package/dist/chunks/md-39.js +0 -21
- package/dist/chunks/md-4.js +0 -1
- package/dist/chunks/md-40.js +0 -42
- package/dist/chunks/md-41.js +0 -1
- package/dist/chunks/md-42.js +0 -30
- package/dist/chunks/md-43.js +0 -16
- package/dist/chunks/md-44.js +0 -1
- package/dist/chunks/md-45.js +0 -27
- package/dist/chunks/md-46.js +0 -5
- package/dist/chunks/md-47.js +0 -38
- package/dist/chunks/md-48.js +0 -13
- package/dist/chunks/md-49.js +0 -20
- package/dist/chunks/md-5.js +0 -1
- package/dist/chunks/md-50.js +0 -121
- package/dist/chunks/md-51.js +0 -98
- package/dist/chunks/md-52.js +0 -11
- package/dist/chunks/md-53.js +0 -5
- package/dist/chunks/md-54.js +0 -77
- package/dist/chunks/md-55.js +0 -68
- package/dist/chunks/md-56.js +0 -22
- package/dist/chunks/md-57.js +0 -14
- package/dist/chunks/md-58.js +0 -5
- package/dist/chunks/md-59.js +0 -51
- package/dist/chunks/md-6.js +0 -77
- package/dist/chunks/md-60.js +0 -22
- package/dist/chunks/md-61.js +0 -5
- package/dist/chunks/md-62.js +0 -1
- package/dist/chunks/md-63.js +0 -23
- package/dist/chunks/md-64.js +0 -5
- package/dist/chunks/md-65.js +0 -11
- package/dist/chunks/md-66.js +0 -142
- package/dist/chunks/md-67.js +0 -30
- package/dist/chunks/md-68.js +0 -70
- package/dist/chunks/md-69.js +0 -19
- package/dist/chunks/md-7.js +0 -1
- package/dist/chunks/md-70.js +0 -21
- package/dist/chunks/md-71.js +0 -17
- package/dist/chunks/md-72.js +0 -76
- package/dist/chunks/md-73.js +0 -7
- package/dist/chunks/md-74.js +0 -72
- package/dist/chunks/md-75.js +0 -78
- package/dist/chunks/md-76.js +0 -66
- package/dist/chunks/md-77.js +0 -17
- package/dist/chunks/md-78.js +0 -5
- package/dist/chunks/md-79.js +0 -19
- package/dist/chunks/md-8.js +0 -1
- package/dist/chunks/md-80.js +0 -1
- package/dist/chunks/md-81.js +0 -168
- package/dist/chunks/md-82.js +0 -43
- package/dist/chunks/md-83.js +0 -100
- package/dist/chunks/md-84.js +0 -82
- package/dist/chunks/md-85.js +0 -12
- package/dist/chunks/md-86.js +0 -42
- package/dist/chunks/md-87.js +0 -34
- package/dist/chunks/md-88.js +0 -1
- package/dist/chunks/md-89.js +0 -1
- package/dist/chunks/md-9.js +0 -1
- package/dist/chunks/md-90.js +0 -1
- package/dist/chunks/md-91.js +0 -1
- 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-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 -16
- 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 -22
- 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 -17
- package/dist/comp/md-coachmark-entry.js +0 -1
- 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 -24
- package/dist/comp/md-date-time-picker-entry.js +0 -1
- package/dist/comp/md-date-time-picker.js +0 -18
- 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 -23
- 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 -8
- 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-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 -14
- 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 -19
- 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 -11
- package/dist/index-entry.js +0 -34
- package/dist/index.js +0 -89
- 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/alert/Alert.d.ts +0 -57
- 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 -20
- package/dist/types/components/avatar/Presence.utils.d.ts +0 -8
- 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 -111
- 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/code-editor/CodeEditor.d.ts +0 -40
- package/dist/types/components/combobox/ComboBox.d.ts +0 -208
- package/dist/types/components/date-range-picker/DateRangePicker.d.ts +0 -27
- 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 -152
- 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 -74
- package/dist/types/components/help-text/HelpText.d.ts +0 -28
- package/dist/types/components/icon/Icon.d.ts +0 -196
- package/dist/types/components/input/Input.d.ts +0 -138
- 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 -68
- 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 -64
- package/dist/types/components/tabs/TabPanel.d.ts +0 -25
- package/dist/types/components/tabs/Tabs.d.ts +0 -125
- package/dist/types/components/taskitem/TaskItem.d.ts +0 -40
- 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 -54
- package/dist/types/constants.d.ts +0 -39
- package/dist/types/index.d.ts +0 -75
- 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/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,1517 @@
|
|
|
1
|
+
import { comboBoxComplexObjectOption, comboBoxObjectOptions, comboBoxOptions } from "@/[sandbox]/sandbox.mock";
|
|
2
|
+
import "@/components/icon/Icon";
|
|
3
|
+
import { Key } from "@/constants";
|
|
4
|
+
import { elementUpdated, fixture, fixtureCleanup, html, nextFrame, oneEvent } from "@open-wc/testing-helpers";
|
|
5
|
+
import { repeat } from "lit-html/directives/repeat";
|
|
6
|
+
import "./ComboBox";
|
|
7
|
+
import { ComboBox } from "./ComboBox";
|
|
8
|
+
|
|
9
|
+
describe("Combobox Component", () => {
|
|
10
|
+
afterEach(fixtureCleanup);
|
|
11
|
+
|
|
12
|
+
describe("Interaction", () => {
|
|
13
|
+
let el: ComboBox.ELEMENT;
|
|
14
|
+
|
|
15
|
+
beforeEach(async () => {
|
|
16
|
+
el = await fixture<ComboBox.ELEMENT>(html` <md-combobox .options=${comboBoxOptions} is-multi></md-combobox> `);
|
|
17
|
+
});
|
|
18
|
+
test("should set class if combobox with multi attribute", async () => {
|
|
19
|
+
expect(el.group!.classList.contains("md-combobox-multiselect")).toBeTruthy();
|
|
20
|
+
});
|
|
21
|
+
test("should open/close dropdown if arrow icon clicked", async () => {
|
|
22
|
+
const button = el.shadowRoot!.querySelector("button[class='md-combobox-button arrow-down']");
|
|
23
|
+
const event = new MouseEvent("click");
|
|
24
|
+
button!.dispatchEvent(event);
|
|
25
|
+
await el.updateComplete;
|
|
26
|
+
expect(el.expanded).toBeTruthy();
|
|
27
|
+
button!.dispatchEvent(event);
|
|
28
|
+
await el.updateComplete;
|
|
29
|
+
expect(el.expanded).toBeFalsy();
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
test("should dispatch events", async () => {
|
|
33
|
+
const eventIn = new Event("focusin");
|
|
34
|
+
const eventOut = new Event("focusOut");
|
|
35
|
+
|
|
36
|
+
setTimeout(() => el["handleFocusIn"](eventIn));
|
|
37
|
+
const focusIn = await oneEvent(el, "combobox-focus-in");
|
|
38
|
+
expect(focusIn).toBeDefined();
|
|
39
|
+
|
|
40
|
+
setTimeout(() => el["handleFocusOut"](eventOut));
|
|
41
|
+
const focusOut = await oneEvent(el, "combobox-focus-out");
|
|
42
|
+
expect(focusOut).toBeDefined();
|
|
43
|
+
|
|
44
|
+
const createEvent = (code: string) =>
|
|
45
|
+
new KeyboardEvent("keydown", {
|
|
46
|
+
code
|
|
47
|
+
});
|
|
48
|
+
el.input!.dispatchEvent(createEvent(Key.ArrowDown));
|
|
49
|
+
await nextFrame();
|
|
50
|
+
el.input!.dispatchEvent(createEvent(Key.Enter));
|
|
51
|
+
const { detail: detailOne } = await oneEvent(el, "change-selected");
|
|
52
|
+
expect(detailOne).toBeDefined();
|
|
53
|
+
expect(detailOne).toEqual(
|
|
54
|
+
expect.objectContaining({
|
|
55
|
+
value: "Afghanistan",
|
|
56
|
+
selected: ["Afghanistan"]
|
|
57
|
+
})
|
|
58
|
+
);
|
|
59
|
+
await elementUpdated(el);
|
|
60
|
+
el.input!.dispatchEvent(createEvent(Key.ArrowDown));
|
|
61
|
+
await nextFrame();
|
|
62
|
+
el.input!.dispatchEvent(createEvent(Key.Enter));
|
|
63
|
+
const { detail: detailTwo } = await oneEvent(el, "change-selected");
|
|
64
|
+
expect(detailTwo).toBeDefined();
|
|
65
|
+
expect(detailTwo).toEqual(
|
|
66
|
+
expect.objectContaining({
|
|
67
|
+
value: "Aland Islands",
|
|
68
|
+
selected: ["Afghanistan", "Aland Islands"]
|
|
69
|
+
})
|
|
70
|
+
);
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
test("should dispatch input event", async () => {
|
|
74
|
+
jest.useRealTimers();
|
|
75
|
+
|
|
76
|
+
el.input!.value = "a";
|
|
77
|
+
el["inputValue"] = "a";
|
|
78
|
+
el.input!.dispatchEvent(new Event("input"));
|
|
79
|
+
|
|
80
|
+
const { detail } = await oneEvent(el, "combobox-input");
|
|
81
|
+
|
|
82
|
+
expect(detail).toBeDefined();
|
|
83
|
+
expect(detail).toEqual(expect.objectContaining({ value: "a" }));
|
|
84
|
+
jest.clearAllTimers();
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
test("should render selected options with multi attribute", async () => {
|
|
88
|
+
expect(el.selectedOptions.length).toEqual(0);
|
|
89
|
+
expect(el.selected!.length).toEqual(0);
|
|
90
|
+
|
|
91
|
+
el.selectedOptions = [comboBoxOptions[0], comboBoxOptions[1]];
|
|
92
|
+
|
|
93
|
+
await elementUpdated(el);
|
|
94
|
+
|
|
95
|
+
expect(el.selectedOptions.length).toEqual(2);
|
|
96
|
+
expect(el.selected!.length).toEqual(2);
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
test("shouldn't render selected options without multi attribute", async () => {
|
|
100
|
+
const el = await fixture<ComboBox.ELEMENT>(html` <md-combobox .options=${comboBoxOptions}></md-combobox> `);
|
|
101
|
+
expect(el.selectedOptions.length).toEqual(0);
|
|
102
|
+
expect(el.selected!.length).toEqual(0);
|
|
103
|
+
|
|
104
|
+
el.selectedOptions = [comboBoxOptions[0], comboBoxOptions[1]];
|
|
105
|
+
|
|
106
|
+
await elementUpdated(el);
|
|
107
|
+
|
|
108
|
+
expect(el.selectedOptions.length).toEqual(2);
|
|
109
|
+
expect(el.selected!.length).toEqual(0);
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
test("should render slotted content", async () => {
|
|
113
|
+
const el = await fixture<ComboBox.ELEMENT>(html`
|
|
114
|
+
<md-combobox with-custom-content is-multi>
|
|
115
|
+
<div slot="one" aria-label="Facebook" display-value="Facebook">
|
|
116
|
+
<span>Facebook</span>
|
|
117
|
+
<md-icon name="icon-facebook_16"></md-icon>
|
|
118
|
+
</div>
|
|
119
|
+
<div slot="two" aria-label="Twitter" display-value="Twitter">
|
|
120
|
+
<span class="company-value">Twitter</span>
|
|
121
|
+
<md-icon name="icon-twitter_16"></md-icon>
|
|
122
|
+
</div>
|
|
123
|
+
<div slot="three" aria-label="Wikipedia" display-value="Wikipedia">
|
|
124
|
+
<span class="company-value">Wikipedia</span>
|
|
125
|
+
<md-icon name="icon-wikipedia_16"></md-icon>
|
|
126
|
+
</div>
|
|
127
|
+
<div slot="four" aria-label="Google" display-value="Google">
|
|
128
|
+
<span class="company-value">Google</span>
|
|
129
|
+
<md-icon name="icon-google_16"></md-icon>
|
|
130
|
+
</div>
|
|
131
|
+
</md-combobox>
|
|
132
|
+
`);
|
|
133
|
+
expect(el.isCustomContent).toBeTruthy();
|
|
134
|
+
expect(el["customContent"].length).toEqual(4);
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
test("should render complex slotted content", async () => {
|
|
138
|
+
const el = await fixture<ComboBox.ELEMENT>(html`
|
|
139
|
+
<md-combobox with-custom-content is-multi>
|
|
140
|
+
${repeat(
|
|
141
|
+
comboBoxComplexObjectOption,
|
|
142
|
+
(country) => country.countryNameEn,
|
|
143
|
+
(country: { countryNameEn: string; countryCallingCode: string }, index) => html`
|
|
144
|
+
<div
|
|
145
|
+
slot=${index}
|
|
146
|
+
display-value=${country.countryNameEn}
|
|
147
|
+
aria-label="+${country.countryCallingCode}${country.countryNameEn}"
|
|
148
|
+
>
|
|
149
|
+
<span>${country.countryNameEn}</span>
|
|
150
|
+
<span>+${country.countryCallingCode}</span>
|
|
151
|
+
</div>
|
|
152
|
+
`
|
|
153
|
+
)}
|
|
154
|
+
</md-combobox>
|
|
155
|
+
`);
|
|
156
|
+
expect(el.isCustomContent).toBeTruthy();
|
|
157
|
+
expect(el["customContent"].length).toEqual(10);
|
|
158
|
+
|
|
159
|
+
const createEvent = (code: string) =>
|
|
160
|
+
new KeyboardEvent("keydown", {
|
|
161
|
+
code
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
el.input!.dispatchEvent(createEvent(Key.ArrowDown));
|
|
165
|
+
await nextFrame();
|
|
166
|
+
el.input!.dispatchEvent(createEvent(Key.Enter));
|
|
167
|
+
|
|
168
|
+
expect(el.input!.value).toEqual("Andorra");
|
|
169
|
+
|
|
170
|
+
const event = new Event("input");
|
|
171
|
+
el.input!.value = "4";
|
|
172
|
+
el.input!.dispatchEvent(event);
|
|
173
|
+
|
|
174
|
+
await elementUpdated(el);
|
|
175
|
+
expect(el.filteredOptions.length).toEqual(5);
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
test("should render async slotted content", async () => {
|
|
179
|
+
const el = await fixture<ComboBox.ELEMENT>(html`
|
|
180
|
+
<md-combobox with-custom-content is-multi .customOptions=${[]}></md-combobox>
|
|
181
|
+
`);
|
|
182
|
+
|
|
183
|
+
el.expanded = true;
|
|
184
|
+
await elementUpdated(el);
|
|
185
|
+
|
|
186
|
+
jest.setTimeout(1000);
|
|
187
|
+
|
|
188
|
+
const slottedContent = comboBoxComplexObjectOption
|
|
189
|
+
.map((country: { countryNameEn: string; countryCallingCode: string }, index) => {
|
|
190
|
+
return ` <div
|
|
191
|
+
slot=${index}
|
|
192
|
+
display-value=${country.countryNameEn}
|
|
193
|
+
aria-label="+${country.countryCallingCode}${country.countryNameEn}"
|
|
194
|
+
>
|
|
195
|
+
<span>${country.countryNameEn}</span>
|
|
196
|
+
<span>+${country.countryCallingCode}</span>
|
|
197
|
+
</div>`;
|
|
198
|
+
})
|
|
199
|
+
.join("");
|
|
200
|
+
|
|
201
|
+
const resizeSpy = jest.spyOn(el, "resizeListbox" as never);
|
|
202
|
+
|
|
203
|
+
el.innerHTML = `${slottedContent}`;
|
|
204
|
+
el.customOptions = comboBoxComplexObjectOption as never[];
|
|
205
|
+
|
|
206
|
+
await elementUpdated(el);
|
|
207
|
+
|
|
208
|
+
expect(el.options.length).toEqual(10);
|
|
209
|
+
expect(resizeSpy).toHaveBeenCalled();
|
|
210
|
+
|
|
211
|
+
resizeSpy.mockRestore();
|
|
212
|
+
});
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
describe("Combobox", () => {
|
|
216
|
+
test("should set correct aria attributes", async () => {
|
|
217
|
+
const el = await fixture<ComboBox.ELEMENT>(html`
|
|
218
|
+
<md-combobox .options=${comboBoxOptions} label="Country"></md-combobox>
|
|
219
|
+
`);
|
|
220
|
+
|
|
221
|
+
el.expanded = true;
|
|
222
|
+
await elementUpdated(el);
|
|
223
|
+
expect(el.input!.getAttribute("aria-expanded")).toEqual("true");
|
|
224
|
+
expect(el.button!.getAttribute("aria-expanded")).toEqual("true");
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
test("should open/close dropdown if clicked", async () => {
|
|
228
|
+
const el = await fixture<ComboBox.ELEMENT>(html`
|
|
229
|
+
<md-combobox .options=${comboBoxOptions} no-clear-icon></md-combobox>
|
|
230
|
+
`);
|
|
231
|
+
const event = new MouseEvent("click");
|
|
232
|
+
el.input!.dispatchEvent(event);
|
|
233
|
+
el.input!.focus();
|
|
234
|
+
|
|
235
|
+
expect(el.expanded).toBeTruthy();
|
|
236
|
+
|
|
237
|
+
document.dispatchEvent(event);
|
|
238
|
+
el.input!.blur();
|
|
239
|
+
|
|
240
|
+
expect(el.expanded).toBeFalsy();
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
test("should set placeholder if property exist", async () => {
|
|
244
|
+
const el = await fixture<ComboBox.ELEMENT>(html`
|
|
245
|
+
<md-combobox .options=${comboBoxOptions} placeholder="Placeholder Input"></md-combobox>
|
|
246
|
+
`);
|
|
247
|
+
|
|
248
|
+
expect(el.placeholder).toEqual("Placeholder Input");
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
test("should apply disabled attribute", async () => {
|
|
252
|
+
const el = await fixture<ComboBox.ELEMENT>(html`
|
|
253
|
+
<md-combobox .options=${comboBoxOptions} disabled></md-combobox>
|
|
254
|
+
`);
|
|
255
|
+
expect(el.disabled).toBeTruthy();
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
test("should set input value in handler", async () => {
|
|
259
|
+
const el = await fixture<ComboBox.ELEMENT>(html`
|
|
260
|
+
<md-combobox .options=${comboBoxOptions} disabled></md-combobox>
|
|
261
|
+
`);
|
|
262
|
+
const event = new Event("input");
|
|
263
|
+
el.input!.value = "combobox";
|
|
264
|
+
el.input!.dispatchEvent(event);
|
|
265
|
+
|
|
266
|
+
expect(el["inputValue"]).toEqual("combobox");
|
|
267
|
+
});
|
|
268
|
+
|
|
269
|
+
test("should handle keyUp event", async () => {
|
|
270
|
+
const el = await fixture<ComboBox.ELEMENT>(html` <md-combobox .options=${comboBoxOptions}></md-combobox> `);
|
|
271
|
+
const createEvent = (code: string) =>
|
|
272
|
+
new KeyboardEvent("keyup", {
|
|
273
|
+
code
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
const backspace = createEvent(Key.Backspace);
|
|
277
|
+
el.input!.dispatchEvent(backspace);
|
|
278
|
+
|
|
279
|
+
const mock = jest.fn();
|
|
280
|
+
|
|
281
|
+
el.listBox!.style.maxHeight = mock();
|
|
282
|
+
|
|
283
|
+
expect(el.expanded).toBeTruthy();
|
|
284
|
+
expect(mock).toBeCalled();
|
|
285
|
+
|
|
286
|
+
el.expanded = false;
|
|
287
|
+
|
|
288
|
+
await elementUpdated(el);
|
|
289
|
+
|
|
290
|
+
mock.mockReset();
|
|
291
|
+
const escape = createEvent(Key.Escape);
|
|
292
|
+
el.input!.dispatchEvent(escape);
|
|
293
|
+
|
|
294
|
+
expect(el.expanded).toBeFalsy();
|
|
295
|
+
expect(mock).not.toBeCalled();
|
|
296
|
+
});
|
|
297
|
+
|
|
298
|
+
test("should handle keyDown event", async () => {
|
|
299
|
+
const el = await fixture<ComboBox.ELEMENT>(html`
|
|
300
|
+
<md-combobox .options=${comboBoxOptions} is-multi></md-combobox>
|
|
301
|
+
`);
|
|
302
|
+
const createEvent = (code: string) =>
|
|
303
|
+
new KeyboardEvent("keydown", {
|
|
304
|
+
code
|
|
305
|
+
});
|
|
306
|
+
|
|
307
|
+
const listLen = el.lists!.length;
|
|
308
|
+
|
|
309
|
+
const backspace = createEvent(Key.Backspace);
|
|
310
|
+
el.input!.dispatchEvent(backspace);
|
|
311
|
+
|
|
312
|
+
await elementUpdated(el);
|
|
313
|
+
|
|
314
|
+
expect(el.focusedIndex).toEqual(-1);
|
|
315
|
+
|
|
316
|
+
el.expanded = true;
|
|
317
|
+
el.focusedIndex = 0;
|
|
318
|
+
await elementUpdated(el);
|
|
319
|
+
|
|
320
|
+
const arrowLeft = createEvent(Key.ArrowLeft);
|
|
321
|
+
const propogationSpyLeft = jest.spyOn(arrowLeft, "stopPropagation");
|
|
322
|
+
el.input!.dispatchEvent(arrowLeft);
|
|
323
|
+
|
|
324
|
+
expect(propogationSpyLeft).toHaveBeenCalled();
|
|
325
|
+
await elementUpdated(el);
|
|
326
|
+
|
|
327
|
+
const arrowRight = createEvent(Key.ArrowRight);
|
|
328
|
+
const propogationSpyRight = jest.spyOn(arrowRight, "stopPropagation");
|
|
329
|
+
el.input!.dispatchEvent(arrowRight);
|
|
330
|
+
|
|
331
|
+
expect(propogationSpyRight).toHaveBeenCalled();
|
|
332
|
+
await elementUpdated(el);
|
|
333
|
+
|
|
334
|
+
const enter = createEvent(Key.Enter);
|
|
335
|
+
el.input!.dispatchEvent(enter);
|
|
336
|
+
|
|
337
|
+
await nextFrame();
|
|
338
|
+
|
|
339
|
+
expect(el.expanded).toBeFalsy();
|
|
340
|
+
expect(el.selectedOptions.length).toEqual(1);
|
|
341
|
+
expect(el.selectedOptions).toEqual(expect.arrayContaining(["Afghanistan"]));
|
|
342
|
+
expect(el.input!.value).toEqual("Afghanistan");
|
|
343
|
+
|
|
344
|
+
el.expanded = false;
|
|
345
|
+
el.focusedIndex = 0;
|
|
346
|
+
await elementUpdated(el);
|
|
347
|
+
|
|
348
|
+
const arrowDown = createEvent(Key.ArrowDown);
|
|
349
|
+
el.input!.dispatchEvent(arrowDown);
|
|
350
|
+
|
|
351
|
+
await nextFrame();
|
|
352
|
+
|
|
353
|
+
expect(el.expanded).toBeTruthy();
|
|
354
|
+
expect(el.focusedIndex).toEqual(1);
|
|
355
|
+
expect(el.lists![1].hasAttribute("focused")).toBeTruthy();
|
|
356
|
+
|
|
357
|
+
el.expanded = false;
|
|
358
|
+
el.focusedIndex = listLen - 1;
|
|
359
|
+
await elementUpdated(el);
|
|
360
|
+
|
|
361
|
+
el.input!.dispatchEvent(arrowDown);
|
|
362
|
+
|
|
363
|
+
await nextFrame();
|
|
364
|
+
|
|
365
|
+
expect(el.expanded).toBeTruthy();
|
|
366
|
+
expect(el.focusedIndex).toEqual(0);
|
|
367
|
+
expect(el.lists![0].hasAttribute("focused")).toBeTruthy();
|
|
368
|
+
|
|
369
|
+
el.expanded = false;
|
|
370
|
+
el.focusedIndex = -1;
|
|
371
|
+
await elementUpdated(el);
|
|
372
|
+
|
|
373
|
+
el.input!.dispatchEvent(arrowDown);
|
|
374
|
+
|
|
375
|
+
await nextFrame();
|
|
376
|
+
|
|
377
|
+
expect(el.expanded).toBeTruthy();
|
|
378
|
+
expect(el.focusedIndex).toEqual(0);
|
|
379
|
+
expect(el.lists![0].hasAttribute("focused")).toBeTruthy();
|
|
380
|
+
|
|
381
|
+
el.expanded = false;
|
|
382
|
+
el.focusedIndex = 0;
|
|
383
|
+
await elementUpdated(el);
|
|
384
|
+
|
|
385
|
+
const arrowUp = createEvent(Key.ArrowUp);
|
|
386
|
+
el.input!.dispatchEvent(arrowUp);
|
|
387
|
+
|
|
388
|
+
await nextFrame();
|
|
389
|
+
|
|
390
|
+
expect(el.expanded).toBeTruthy();
|
|
391
|
+
expect(el.focusedIndex).toEqual(listLen - 1);
|
|
392
|
+
expect(el.lists![listLen - 1].hasAttribute("focused")).toBeTruthy();
|
|
393
|
+
|
|
394
|
+
el.expanded = false;
|
|
395
|
+
el.focusedIndex = listLen - 1;
|
|
396
|
+
await elementUpdated(el);
|
|
397
|
+
|
|
398
|
+
el.input!.dispatchEvent(arrowUp);
|
|
399
|
+
|
|
400
|
+
await nextFrame();
|
|
401
|
+
|
|
402
|
+
expect(el.expanded).toBeTruthy();
|
|
403
|
+
expect(el.focusedIndex).toEqual(listLen - 2);
|
|
404
|
+
expect(el.lists![listLen - 2].hasAttribute("focused")).toBeTruthy();
|
|
405
|
+
|
|
406
|
+
el.expanded = false;
|
|
407
|
+
el.focusedIndex = 0;
|
|
408
|
+
el.input!.value = "combobox";
|
|
409
|
+
el.selectedOptions.push("Afghanistan");
|
|
410
|
+
const escape = createEvent(Key.Escape);
|
|
411
|
+
|
|
412
|
+
el.input!.dispatchEvent(escape);
|
|
413
|
+
|
|
414
|
+
expect(el.input!.value).toEqual("");
|
|
415
|
+
expect(el.focusedIndex).toEqual(-1);
|
|
416
|
+
expect(el.selectedOptions.length).toEqual(0);
|
|
417
|
+
|
|
418
|
+
el.expanded = true;
|
|
419
|
+
el.focusedIndex = 0;
|
|
420
|
+
el.input!.value = "combobox";
|
|
421
|
+
el.selectedOptions.push("Afghanistan");
|
|
422
|
+
await elementUpdated(el);
|
|
423
|
+
|
|
424
|
+
el.input!.dispatchEvent(escape);
|
|
425
|
+
expect(el.expanded).toBeFalsy();
|
|
426
|
+
expect(el.input!.value).toEqual("combobox");
|
|
427
|
+
expect(el.focusedIndex).toEqual(0);
|
|
428
|
+
expect(el.selectedOptions.length).toEqual(1);
|
|
429
|
+
const tab = createEvent(Key.Tab);
|
|
430
|
+
el.expanded = true;
|
|
431
|
+
el.focusedIndex = 0;
|
|
432
|
+
el.input!.value = "combobox";
|
|
433
|
+
el.selectedOptions.push("Afghanistan");
|
|
434
|
+
await elementUpdated(el);
|
|
435
|
+
|
|
436
|
+
el.input!.dispatchEvent(tab);
|
|
437
|
+
expect(el.expanded).toBeFalsy();
|
|
438
|
+
expect(el.input!.value).toEqual("combobox");
|
|
439
|
+
expect(el.focusedIndex).toEqual(0);
|
|
440
|
+
|
|
441
|
+
const home = createEvent(Key.Home);
|
|
442
|
+
|
|
443
|
+
const selectionMock = jest.fn();
|
|
444
|
+
el.input!.setSelectionRange = selectionMock;
|
|
445
|
+
el.input!.dispatchEvent(home);
|
|
446
|
+
|
|
447
|
+
expect(selectionMock).toHaveBeenCalled();
|
|
448
|
+
|
|
449
|
+
const end = createEvent(Key.End);
|
|
450
|
+
el.input!.dispatchEvent(end);
|
|
451
|
+
|
|
452
|
+
expect(selectionMock).toHaveBeenCalledTimes(2);
|
|
453
|
+
|
|
454
|
+
el.expanded = true;
|
|
455
|
+
el.selectedOptions = [];
|
|
456
|
+
el.focusedIndex = 0;
|
|
457
|
+
await elementUpdated(el);
|
|
458
|
+
|
|
459
|
+
const space = createEvent(Key.Space);
|
|
460
|
+
el.input!.dispatchEvent(space);
|
|
461
|
+
|
|
462
|
+
await elementUpdated(el);
|
|
463
|
+
|
|
464
|
+
expect(el.selectedOptions).toEqual(expect.arrayContaining(["Afghanistan"]));
|
|
465
|
+
|
|
466
|
+
const key = createEvent("KeyZ");
|
|
467
|
+
el.input!.dispatchEvent(key);
|
|
468
|
+
expect(el.focusedIndex).toEqual(0);
|
|
469
|
+
});
|
|
470
|
+
test("should remove all selected option if clear icon clicked", async () => {
|
|
471
|
+
const el = await fixture<ComboBox.ELEMENT>(html`
|
|
472
|
+
<md-combobox .options=${comboBoxOptions} is-multi></md-combobox>
|
|
473
|
+
`);
|
|
474
|
+
|
|
475
|
+
el.selectedOptions = [comboBoxOptions[0], comboBoxOptions[1]];
|
|
476
|
+
const event = new MouseEvent("click");
|
|
477
|
+
|
|
478
|
+
setTimeout(() => el.handleRemoveAll(event));
|
|
479
|
+
const customEvent = await oneEvent(el, "remove-all-selected");
|
|
480
|
+
expect(customEvent).toBeDefined();
|
|
481
|
+
expect(el.selectedOptions.length).toEqual(0);
|
|
482
|
+
});
|
|
483
|
+
|
|
484
|
+
test("should remove option if option icon clicked", async () => {
|
|
485
|
+
const el = await fixture<ComboBox.ELEMENT>(html`
|
|
486
|
+
<md-combobox .options=${comboBoxOptions} is-multi></md-combobox>
|
|
487
|
+
`);
|
|
488
|
+
el.selectedOptions = [comboBoxOptions[0], comboBoxOptions[1]];
|
|
489
|
+
await elementUpdated(el);
|
|
490
|
+
|
|
491
|
+
const clearOptionIcon = el.shadowRoot!.querySelector("md-icon[name='cancel-bold']");
|
|
492
|
+
|
|
493
|
+
clearOptionIcon!.dispatchEvent(new MouseEvent("click"));
|
|
494
|
+
|
|
495
|
+
expect(el.selectedOptions.length).toEqual(1);
|
|
496
|
+
expect(el.selectedOptions).toEqual(expect.arrayContaining(["Aland Islands"]));
|
|
497
|
+
});
|
|
498
|
+
|
|
499
|
+
test("should render correct multi icon name", async () => {
|
|
500
|
+
const el = await fixture<ComboBox.ELEMENT>(html`
|
|
501
|
+
<md-combobox .options=${comboBoxOptions} is-multi></md-combobox>
|
|
502
|
+
`);
|
|
503
|
+
|
|
504
|
+
expect(el.shadowRoot!.querySelector(".md-combobox-button md-icon")!.getAttribute("name")).toEqual(
|
|
505
|
+
"arrow-down-bold"
|
|
506
|
+
);
|
|
507
|
+
|
|
508
|
+
el.selectedOptions = [comboBoxOptions[0], comboBoxOptions[1]];
|
|
509
|
+
await elementUpdated(el);
|
|
510
|
+
expect(el.shadowRoot!.querySelector(".md-combobox-button md-icon")!.getAttribute("name")).toEqual("cancel-bold");
|
|
511
|
+
});
|
|
512
|
+
test("should render correct icon name", async () => {
|
|
513
|
+
const el = await fixture<ComboBox.ELEMENT>(html` <md-combobox .options=${comboBoxOptions}></md-combobox> `);
|
|
514
|
+
|
|
515
|
+
expect(el.shadowRoot!.querySelector(".md-combobox-button md-icon")!.getAttribute("name")).toEqual(
|
|
516
|
+
"arrow-down-bold"
|
|
517
|
+
);
|
|
518
|
+
|
|
519
|
+
el.selectedOptions = [comboBoxOptions[0], comboBoxOptions[1]];
|
|
520
|
+
await elementUpdated(el);
|
|
521
|
+
expect(el.shadowRoot!.querySelector(".md-combobox-button md-icon")!.getAttribute("name")).toEqual(
|
|
522
|
+
"arrow-down-bold"
|
|
523
|
+
);
|
|
524
|
+
});
|
|
525
|
+
|
|
526
|
+
test("should set correct icon for different combobox state", async () => {
|
|
527
|
+
const el = await fixture<ComboBox.ELEMENT>(html` <md-combobox .options=${comboBoxOptions}></md-combobox> `);
|
|
528
|
+
const event = new InputEvent("input", {
|
|
529
|
+
data: "a"
|
|
530
|
+
});
|
|
531
|
+
el.input!.value = "a";
|
|
532
|
+
expect(el.shadowRoot!.querySelector("md-icon[name='arrow-down-bold']")).not.toBeNull();
|
|
533
|
+
expect(el.shadowRoot!.querySelector("md-icon[name='cancel-bold']")).toBeNull();
|
|
534
|
+
el.input!.dispatchEvent(event);
|
|
535
|
+
|
|
536
|
+
await elementUpdated(el);
|
|
537
|
+
|
|
538
|
+
expect(el.shadowRoot!.querySelector("md-icon[name='arrow-down-bold']")).toBeNull();
|
|
539
|
+
expect(el.shadowRoot!.querySelector("md-icon[name='cancel-bold']")).not.toBeNull();
|
|
540
|
+
|
|
541
|
+
const backspace = new KeyboardEvent("keydown", {
|
|
542
|
+
code: Key.Backspace
|
|
543
|
+
});
|
|
544
|
+
el.input!.dispatchEvent(backspace);
|
|
545
|
+
await elementUpdated(el);
|
|
546
|
+
expect(el.shadowRoot!.querySelector("md-icon[name='arrow-down-bold']")).toBeNull();
|
|
547
|
+
expect(el.shadowRoot!.querySelector("md-icon[name='cancel-bold']")).not.toBeNull();
|
|
548
|
+
});
|
|
549
|
+
test("should set correct icon for different combobox state in multi mode", async () => {
|
|
550
|
+
const el = await fixture<ComboBox.ELEMENT>(html`
|
|
551
|
+
<md-combobox .options=${comboBoxOptions} is-multi></md-combobox>
|
|
552
|
+
`);
|
|
553
|
+
const arrowDown = new KeyboardEvent("keydown", {
|
|
554
|
+
code: Key.ArrowDown
|
|
555
|
+
});
|
|
556
|
+
el.input!.value = "Afghanistan";
|
|
557
|
+
|
|
558
|
+
expect(el.shadowRoot!.querySelector("md-icon[name='arrow-down-bold']")).not.toBeNull();
|
|
559
|
+
expect(el.shadowRoot!.querySelector("md-icon[name='cancel-bold']")).toBeNull();
|
|
560
|
+
el.input!.dispatchEvent(arrowDown);
|
|
561
|
+
|
|
562
|
+
await elementUpdated(el);
|
|
563
|
+
|
|
564
|
+
expect(el.shadowRoot!.querySelector("md-icon[name='arrow-down-bold']")).toBeNull();
|
|
565
|
+
expect(el.shadowRoot!.querySelector("md-icon[name='cancel-bold']")).not.toBeNull();
|
|
566
|
+
});
|
|
567
|
+
});
|
|
568
|
+
|
|
569
|
+
describe("Combobox Multi Selected", () => {
|
|
570
|
+
let el: ComboBox.ELEMENT;
|
|
571
|
+
afterEach(fixtureCleanup);
|
|
572
|
+
|
|
573
|
+
beforeEach(async () => {
|
|
574
|
+
el = await fixture<ComboBox.ELEMENT>(html` <md-combobox .options=${comboBoxOptions} is-multi></md-combobox> `);
|
|
575
|
+
});
|
|
576
|
+
test("should add selected options", async () => {
|
|
577
|
+
const event = new MouseEvent("click");
|
|
578
|
+
el.lists![0].dispatchEvent(event);
|
|
579
|
+
el.lists![1].dispatchEvent(event);
|
|
580
|
+
|
|
581
|
+
await elementUpdated(el);
|
|
582
|
+
|
|
583
|
+
expect(el.selected!.length).toEqual(2);
|
|
584
|
+
});
|
|
585
|
+
test("should clear selected option by click", async () => {
|
|
586
|
+
const event = new MouseEvent("click");
|
|
587
|
+
el.lists![0].dispatchEvent(event);
|
|
588
|
+
el.lists![1].dispatchEvent(event);
|
|
589
|
+
|
|
590
|
+
el.expanded = true;
|
|
591
|
+
await elementUpdated(el);
|
|
592
|
+
|
|
593
|
+
expect(el.selected!.length).toEqual(2);
|
|
594
|
+
expect(el.selectedOptions.length).toEqual(2);
|
|
595
|
+
|
|
596
|
+
const firstListIcon = el.selected![0].querySelector("md-icon[name='cancel-bold']");
|
|
597
|
+
const secondListIcon = el.selected![1].querySelector("md-icon[name='cancel-bold']");
|
|
598
|
+
|
|
599
|
+
firstListIcon!.dispatchEvent(event);
|
|
600
|
+
secondListIcon!.dispatchEvent(event);
|
|
601
|
+
|
|
602
|
+
await elementUpdated(el);
|
|
603
|
+
|
|
604
|
+
expect(el.selected!.length).toEqual(0);
|
|
605
|
+
expect(el.selectedOptions.length).toEqual(0);
|
|
606
|
+
});
|
|
607
|
+
test("should clear selected option by unchecked", async () => {
|
|
608
|
+
const createEvent = (code: string) =>
|
|
609
|
+
new KeyboardEvent("keydown", {
|
|
610
|
+
code
|
|
611
|
+
});
|
|
612
|
+
|
|
613
|
+
el.input!.dispatchEvent(createEvent(Key.ArrowDown));
|
|
614
|
+
await nextFrame();
|
|
615
|
+
el.input!.dispatchEvent(createEvent(Key.Space));
|
|
616
|
+
await elementUpdated(el);
|
|
617
|
+
el.input!.dispatchEvent(createEvent(Key.ArrowDown));
|
|
618
|
+
await nextFrame();
|
|
619
|
+
el.input!.dispatchEvent(createEvent(Key.Space));
|
|
620
|
+
await elementUpdated(el);
|
|
621
|
+
|
|
622
|
+
expect(el.selected!.length).toEqual(2);
|
|
623
|
+
expect(el.selectedOptions.length).toEqual(2);
|
|
624
|
+
|
|
625
|
+
el.input!.dispatchEvent(createEvent(Key.Space));
|
|
626
|
+
await elementUpdated(el);
|
|
627
|
+
el.input!.dispatchEvent(createEvent(Key.ArrowUp));
|
|
628
|
+
await nextFrame();
|
|
629
|
+
el.input!.dispatchEvent(createEvent(Key.Space));
|
|
630
|
+
await elementUpdated(el);
|
|
631
|
+
|
|
632
|
+
expect(el.selected!.length).toEqual(0);
|
|
633
|
+
expect(el.selectedOptions.length).toEqual(0);
|
|
634
|
+
});
|
|
635
|
+
test("should add/remove selected attribute option when arrow and shift clicked", async () => {
|
|
636
|
+
el.selectedOptions = [
|
|
637
|
+
comboBoxOptions[0],
|
|
638
|
+
comboBoxOptions[1],
|
|
639
|
+
comboBoxOptions[2],
|
|
640
|
+
comboBoxOptions[3],
|
|
641
|
+
comboBoxOptions[4],
|
|
642
|
+
comboBoxOptions[5]
|
|
643
|
+
];
|
|
644
|
+
|
|
645
|
+
await elementUpdated(el);
|
|
646
|
+
const createEvent = (code: string, shiftKey: boolean) =>
|
|
647
|
+
new KeyboardEvent("keyup", {
|
|
648
|
+
code,
|
|
649
|
+
shiftKey
|
|
650
|
+
});
|
|
651
|
+
|
|
652
|
+
el.input!.dispatchEvent(createEvent(Key.ArrowLeft, true));
|
|
653
|
+
await elementUpdated(el);
|
|
654
|
+
el.input!.dispatchEvent(createEvent(Key.ArrowLeft, true));
|
|
655
|
+
await elementUpdated(el);
|
|
656
|
+
el.input!.dispatchEvent(createEvent(Key.ArrowLeft, true));
|
|
657
|
+
await elementUpdated(el);
|
|
658
|
+
|
|
659
|
+
el.input!.dispatchEvent(createEvent(Key.Backspace, true));
|
|
660
|
+
await elementUpdated(el);
|
|
661
|
+
|
|
662
|
+
expect(el.selected!.length).toEqual(3);
|
|
663
|
+
expect(el.selectedOptions.length).toEqual(3);
|
|
664
|
+
});
|
|
665
|
+
test("should add/remove selected attribute option when arrow clicked", async () => {
|
|
666
|
+
el.selectedOptions = [comboBoxOptions[0], comboBoxOptions[1]];
|
|
667
|
+
|
|
668
|
+
await elementUpdated(el);
|
|
669
|
+
const createEvent = (code: string) =>
|
|
670
|
+
new KeyboardEvent("keyup", {
|
|
671
|
+
code
|
|
672
|
+
});
|
|
673
|
+
|
|
674
|
+
el.input!.dispatchEvent(createEvent(Key.ArrowLeft));
|
|
675
|
+
await elementUpdated(el);
|
|
676
|
+
expect(el.selected![1].hasAttribute("selected")).toBeTruthy();
|
|
677
|
+
el.input!.dispatchEvent(createEvent(Key.ArrowLeft));
|
|
678
|
+
await elementUpdated(el);
|
|
679
|
+
expect(el.selected![1].hasAttribute("selected")).toBeFalsy();
|
|
680
|
+
expect(el.selected![0].hasAttribute("selected")).toBeTruthy();
|
|
681
|
+
|
|
682
|
+
el.input!.dispatchEvent(createEvent(Key.Backspace));
|
|
683
|
+
await elementUpdated(el);
|
|
684
|
+
el.input!.dispatchEvent(createEvent(Key.Backspace));
|
|
685
|
+
await elementUpdated(el);
|
|
686
|
+
|
|
687
|
+
expect(el.selectedOptions.length).toEqual(0);
|
|
688
|
+
expect(el.selected!.length).toEqual(0);
|
|
689
|
+
});
|
|
690
|
+
|
|
691
|
+
test("should unselect all if default button was pressed", async () => {
|
|
692
|
+
el.selectedOptions = [comboBoxOptions[0], comboBoxOptions[1], comboBoxOptions[2], comboBoxOptions[4]];
|
|
693
|
+
await elementUpdated(el);
|
|
694
|
+
const createEvent = (code: string) =>
|
|
695
|
+
new KeyboardEvent("keyup", {
|
|
696
|
+
code
|
|
697
|
+
});
|
|
698
|
+
|
|
699
|
+
const selectedAttribute = {
|
|
700
|
+
get count() {
|
|
701
|
+
return [...el.selected!].filter((selected) => selected.hasAttribute("selected"));
|
|
702
|
+
}
|
|
703
|
+
};
|
|
704
|
+
|
|
705
|
+
expect(el.selectedOptions.length).toEqual(4);
|
|
706
|
+
expect(el.selected!.length).toEqual(4);
|
|
707
|
+
expect(selectedAttribute.count.length).toEqual(0);
|
|
708
|
+
|
|
709
|
+
el.input!.dispatchEvent(createEvent(Key.ArrowLeft));
|
|
710
|
+
await elementUpdated(el);
|
|
711
|
+
el.input!.dispatchEvent(createEvent(Key.ArrowLeft));
|
|
712
|
+
await elementUpdated(el);
|
|
713
|
+
el.input!.dispatchEvent(createEvent(Key.ArrowLeft));
|
|
714
|
+
await elementUpdated(el);
|
|
715
|
+
|
|
716
|
+
expect(selectedAttribute.count.length).toEqual(1);
|
|
717
|
+
|
|
718
|
+
el.input!.dispatchEvent(createEvent("KeyA"));
|
|
719
|
+
await elementUpdated(el);
|
|
720
|
+
expect(selectedAttribute.count.length).toEqual(0);
|
|
721
|
+
});
|
|
722
|
+
});
|
|
723
|
+
|
|
724
|
+
describe("Listbox", () => {
|
|
725
|
+
test("should set correct aria label attribute", async () => {
|
|
726
|
+
const el = await fixture<ComboBox.ELEMENT>(html`
|
|
727
|
+
<md-combobox .options=${comboBoxOptions} label="Country"></md-combobox>
|
|
728
|
+
`);
|
|
729
|
+
expect(el.listBox!.getAttribute("aria-label")).toEqual("Country");
|
|
730
|
+
});
|
|
731
|
+
|
|
732
|
+
test("should set correct styles", async () => {
|
|
733
|
+
const el = await fixture<ComboBox.ELEMENT>(html` <md-combobox .options=${comboBoxOptions}></md-combobox> `);
|
|
734
|
+
expect(el.expanded).toBeFalsy();
|
|
735
|
+
expect(el.listBox!.style.display).toEqual("none");
|
|
736
|
+
|
|
737
|
+
el.expanded = true;
|
|
738
|
+
|
|
739
|
+
expect(el.expanded).toBeTruthy();
|
|
740
|
+
expect(el.listBox!.style.zIndex).toEqual("99");
|
|
741
|
+
});
|
|
742
|
+
|
|
743
|
+
test("should correct render options depends on input value", async () => {
|
|
744
|
+
const el = await fixture<ComboBox.ELEMENT>(html` <md-combobox .options=${comboBoxOptions}></md-combobox> `);
|
|
745
|
+
el["inputValue"] = "f";
|
|
746
|
+
await elementUpdated(el);
|
|
747
|
+
expect(el.lists!.length).toEqual(1);
|
|
748
|
+
|
|
749
|
+
el["inputValue"] = "fa";
|
|
750
|
+
await elementUpdated(el);
|
|
751
|
+
expect(el.filteredOptions.length).toEqual(0);
|
|
752
|
+
expect(el.shadowRoot!.querySelector(".no-result")).not.toBeNull();
|
|
753
|
+
});
|
|
754
|
+
|
|
755
|
+
test("should set correct id to each option in dom", async () => {
|
|
756
|
+
const el = await fixture<ComboBox.ELEMENT>(html`
|
|
757
|
+
<md-combobox .options=${comboBoxObjectOptions} option-id="id" option-value="country" is-multi></md-combobox>
|
|
758
|
+
`);
|
|
759
|
+
|
|
760
|
+
const optionsCheckbox = el.shadowRoot!.querySelectorAll(".select-option");
|
|
761
|
+
|
|
762
|
+
const matcherId = [...el.lists!].map((option) => option.getAttribute("id"));
|
|
763
|
+
const matcherChecked = [...el.lists!].every((option) => option.hasAttribute("aria-checked"));
|
|
764
|
+
|
|
765
|
+
expect(matcherId).toEqual(expect.arrayContaining(comboBoxObjectOptions.map((option) => option.id)));
|
|
766
|
+
expect(optionsCheckbox.length).toEqual(29);
|
|
767
|
+
expect(matcherChecked).toBeTruthy();
|
|
768
|
+
});
|
|
769
|
+
});
|
|
770
|
+
|
|
771
|
+
describe("Option", () => {
|
|
772
|
+
test("should dispatch event when option clicked", async () => {
|
|
773
|
+
const el = await fixture<ComboBox.ELEMENT>(html` <md-combobox .options=${comboBoxOptions}></md-combobox> `);
|
|
774
|
+
|
|
775
|
+
const event = new MouseEvent("click");
|
|
776
|
+
|
|
777
|
+
setTimeout(() => el.handleListClick(event));
|
|
778
|
+
const customEvent = await oneEvent(el, "selected-changed");
|
|
779
|
+
|
|
780
|
+
expect(customEvent).toBeDefined();
|
|
781
|
+
expect(el.expanded).toBeFalsy();
|
|
782
|
+
});
|
|
783
|
+
test("should dispatch event when option clicked (multi)", async () => {
|
|
784
|
+
const el = await fixture<ComboBox.ELEMENT>(html`
|
|
785
|
+
<md-combobox .options=${comboBoxOptions} is-multi></md-combobox>
|
|
786
|
+
`);
|
|
787
|
+
|
|
788
|
+
const event = new MouseEvent("click");
|
|
789
|
+
|
|
790
|
+
setTimeout(() => el.handleListClick(event));
|
|
791
|
+
const customEvent = await oneEvent(el, "selected-changed");
|
|
792
|
+
|
|
793
|
+
await elementUpdated(el);
|
|
794
|
+
|
|
795
|
+
expect(customEvent).toBeDefined();
|
|
796
|
+
expect(el.expanded).toBeTruthy();
|
|
797
|
+
});
|
|
798
|
+
|
|
799
|
+
test("should toggle aria tags", async () => {
|
|
800
|
+
const el = await fixture<ComboBox.ELEMENT>(html`
|
|
801
|
+
<md-combobox .options=${comboBoxObjectOptions} option-id="id" option-value="country" is-multi></md-combobox>
|
|
802
|
+
`);
|
|
803
|
+
|
|
804
|
+
el.input!.dispatchEvent(new KeyboardEvent("keydown", { code: Key.ArrowDown }));
|
|
805
|
+
expect(el.expanded).toBeTruthy();
|
|
806
|
+
|
|
807
|
+
await nextFrame();
|
|
808
|
+
|
|
809
|
+
expect(el.focusedIndex).toEqual(0);
|
|
810
|
+
//expect(el.lists![0].getAttribute("aria-selected")).toEqual("true");
|
|
811
|
+
|
|
812
|
+
el.input!.dispatchEvent(new KeyboardEvent("keydown", { code: Key.Space }));
|
|
813
|
+
|
|
814
|
+
expect(el.selectedOptions.length).toEqual(1);
|
|
815
|
+
expect(el.selectedOptions).toEqual(expect.arrayContaining([{ country: "Afghanistan", id: "0" }]));
|
|
816
|
+
expect(el.input!.value.length).toEqual(0);
|
|
817
|
+
|
|
818
|
+
await elementUpdated(el);
|
|
819
|
+
|
|
820
|
+
expect(el.lists![0].getAttribute("aria-checked")).toEqual("true");
|
|
821
|
+
expect(el.lists![0].getAttribute("selected")).toEqual("true");
|
|
822
|
+
|
|
823
|
+
el.input!.dispatchEvent(new KeyboardEvent("keydown", { code: Key.ArrowDown }));
|
|
824
|
+
await nextFrame();
|
|
825
|
+
el.input!.dispatchEvent(new KeyboardEvent("keydown", { code: Key.Space }));
|
|
826
|
+
await elementUpdated(el);
|
|
827
|
+
|
|
828
|
+
expect(el.selectedOptions.length).toEqual(2);
|
|
829
|
+
expect(el.selectedOptions).toEqual(
|
|
830
|
+
expect.arrayContaining([
|
|
831
|
+
{ country: "Afghanistan", id: "0" },
|
|
832
|
+
{ country: "Aland Islands", id: "1" }
|
|
833
|
+
])
|
|
834
|
+
);
|
|
835
|
+
});
|
|
836
|
+
test("should handle selected option without multi attribute", async () => {
|
|
837
|
+
const el = await fixture<ComboBox.ELEMENT>(html` <md-combobox .options=${comboBoxOptions}></md-combobox> `);
|
|
838
|
+
|
|
839
|
+
el.input!.dispatchEvent(new KeyboardEvent("keydown", { code: Key.ArrowDown }));
|
|
840
|
+
el.input!.dispatchEvent(new KeyboardEvent("keydown", { code: Key.Enter }));
|
|
841
|
+
await nextFrame();
|
|
842
|
+
|
|
843
|
+
expect(el.selectedOptions.length).toEqual(1);
|
|
844
|
+
|
|
845
|
+
el.input!.dispatchEvent(new KeyboardEvent("keydown", { code: Key.ArrowDown }));
|
|
846
|
+
el.input!.dispatchEvent(new KeyboardEvent("keydown", { code: Key.Enter }));
|
|
847
|
+
await nextFrame();
|
|
848
|
+
|
|
849
|
+
expect(el.selectedOptions.length).toEqual(1);
|
|
850
|
+
});
|
|
851
|
+
|
|
852
|
+
test("should change selected option", async () => {
|
|
853
|
+
const el = await fixture<ComboBox.ELEMENT>(html` <md-combobox .options=${comboBoxOptions}></md-combobox> `);
|
|
854
|
+
el.expanded = true;
|
|
855
|
+
el.lists![0].dispatchEvent(new MouseEvent("click"));
|
|
856
|
+
|
|
857
|
+
await elementUpdated(el);
|
|
858
|
+
|
|
859
|
+
expect(el.focusedIndex).toEqual(0);
|
|
860
|
+
expect(el.selectedOptions.length).toEqual(1);
|
|
861
|
+
expect(el.selectedOptions).toEqual(expect.arrayContaining(["Afghanistan"]));
|
|
862
|
+
});
|
|
863
|
+
});
|
|
864
|
+
|
|
865
|
+
test("should set initial value", async () => {
|
|
866
|
+
const el = await fixture<ComboBox.ELEMENT>(html`
|
|
867
|
+
<md-combobox .options=${comboBoxOptions} .value=${[comboBoxOptions[0]]}></md-combobox>
|
|
868
|
+
`);
|
|
869
|
+
|
|
870
|
+
expect(el.value).toEqual(expect.arrayContaining([comboBoxOptions[0]]));
|
|
871
|
+
expect(el.selectedOptions).toEqual(expect.arrayContaining(["Afghanistan"]));
|
|
872
|
+
});
|
|
873
|
+
test("should set initial value for multi", async () => {
|
|
874
|
+
const el = await fixture<ComboBox.ELEMENT>(html`
|
|
875
|
+
<md-combobox
|
|
876
|
+
.options=${comboBoxOptions}
|
|
877
|
+
.value=${[comboBoxOptions[1], comboBoxOptions[2]]}
|
|
878
|
+
is-multi
|
|
879
|
+
></md-combobox>
|
|
880
|
+
`);
|
|
881
|
+
|
|
882
|
+
expect(el.value).toEqual(expect.arrayContaining([comboBoxOptions[1], comboBoxOptions[2]]));
|
|
883
|
+
expect(el.selected!.length).toEqual(2);
|
|
884
|
+
expect(el.selectedOptions).toEqual(expect.arrayContaining(["Aland Islands", "Albania"]));
|
|
885
|
+
});
|
|
886
|
+
|
|
887
|
+
test("should set initial value for option object", async () => {
|
|
888
|
+
const el = await fixture<ComboBox.ELEMENT>(html`
|
|
889
|
+
<md-combobox
|
|
890
|
+
.options=${comboBoxObjectOptions}
|
|
891
|
+
.value=${[comboBoxObjectOptions[4], comboBoxObjectOptions[5], { country: "Andorra", id: "17" }]}
|
|
892
|
+
is-multi
|
|
893
|
+
option-id="id"
|
|
894
|
+
option-value="country"
|
|
895
|
+
></md-combobox>
|
|
896
|
+
`);
|
|
897
|
+
|
|
898
|
+
expect(el.value).toEqual(expect.arrayContaining([comboBoxObjectOptions[4], comboBoxObjectOptions[5]]));
|
|
899
|
+
expect(el.selected!.length).toEqual(2);
|
|
900
|
+
expect(el.optionId).toEqual("id");
|
|
901
|
+
expect(el.optionValue).toEqual("country");
|
|
902
|
+
expect(el.selectedOptions).toEqual(
|
|
903
|
+
expect.arrayContaining([
|
|
904
|
+
{ country: "American Samoa", id: "4" },
|
|
905
|
+
{ country: "Andorra", id: "5" }
|
|
906
|
+
])
|
|
907
|
+
);
|
|
908
|
+
});
|
|
909
|
+
|
|
910
|
+
test("should render no options list if empty options provided", async () => {
|
|
911
|
+
const el = await fixture<ComboBox.ELEMENT>(html` <md-combobox .options=${[]}></md-combobox> `);
|
|
912
|
+
el.expanded = true;
|
|
913
|
+
await elementUpdated(el);
|
|
914
|
+
expect(el.shadowRoot!.querySelector(".no-result")!.textContent!.trim()).toEqual("No Options");
|
|
915
|
+
|
|
916
|
+
el.inputValue = "One";
|
|
917
|
+
await elementUpdated(el);
|
|
918
|
+
expect(el.shadowRoot!.querySelector(".no-result")!.textContent!.trim()).toEqual("No Options");
|
|
919
|
+
expect(el.shadowRoot!.querySelectorAll(".no-result")!.length).toEqual(1);
|
|
920
|
+
|
|
921
|
+
el.inputValue = "On";
|
|
922
|
+
await elementUpdated(el);
|
|
923
|
+
|
|
924
|
+
expect(el.shadowRoot!.querySelector(".no-result")!.textContent!.trim()).toEqual("No Options");
|
|
925
|
+
expect(el.shadowRoot!.querySelectorAll(".no-result")!.length).toEqual(1);
|
|
926
|
+
});
|
|
927
|
+
|
|
928
|
+
test("should set custom value for default options", async () => {
|
|
929
|
+
const el = await fixture<ComboBox.ELEMENT>(html`
|
|
930
|
+
<md-combobox .options=${comboBoxOptions} .value=${[comboBoxOptions[1]]} allow-custom-value></md-combobox>
|
|
931
|
+
`);
|
|
932
|
+
el.expanded = true;
|
|
933
|
+
const enter = new KeyboardEvent("keydown", { code: Key.Enter });
|
|
934
|
+
|
|
935
|
+
el.inputValue = "One";
|
|
936
|
+
|
|
937
|
+
await elementUpdated(el);
|
|
938
|
+
el.input!.dispatchEvent(enter);
|
|
939
|
+
await nextFrame();
|
|
940
|
+
|
|
941
|
+
expect(el.filteredOptions.includes("One")).toBeTruthy();
|
|
942
|
+
expect(el.filteredOptions.length).toEqual(12);
|
|
943
|
+
|
|
944
|
+
el.inputValue = comboBoxOptions[2];
|
|
945
|
+
await elementUpdated(el);
|
|
946
|
+
el.input!.dispatchEvent(enter);
|
|
947
|
+
await nextFrame();
|
|
948
|
+
|
|
949
|
+
expect(el.filteredOptions.includes("Albania")).toBeTruthy();
|
|
950
|
+
expect(el.filteredOptions.length).toEqual(1);
|
|
951
|
+
});
|
|
952
|
+
|
|
953
|
+
test("should not set custom value for object options", async () => {
|
|
954
|
+
const el = await fixture<ComboBox.ELEMENT>(html`
|
|
955
|
+
<md-combobox
|
|
956
|
+
.options=${comboBoxObjectOptions}
|
|
957
|
+
.value=${[comboBoxObjectOptions[4]]}
|
|
958
|
+
option-id="id"
|
|
959
|
+
option-value="country"
|
|
960
|
+
is-multi
|
|
961
|
+
allow-custom-value
|
|
962
|
+
></md-combobox>
|
|
963
|
+
`);
|
|
964
|
+
el.expanded = true;
|
|
965
|
+
const enter = new KeyboardEvent("keydown", { code: Key.Enter });
|
|
966
|
+
|
|
967
|
+
el.inputValue = "One";
|
|
968
|
+
|
|
969
|
+
await elementUpdated(el);
|
|
970
|
+
el.input!.dispatchEvent(enter);
|
|
971
|
+
await nextFrame();
|
|
972
|
+
|
|
973
|
+
expect(el.filteredOptions.includes("One")).not.toBeTruthy();
|
|
974
|
+
expect(el.filteredOptions.length).toEqual(29);
|
|
975
|
+
});
|
|
976
|
+
|
|
977
|
+
test("should correct render invalid state", async () => {
|
|
978
|
+
const el = await fixture<ComboBox.ELEMENT>(html`
|
|
979
|
+
<md-combobox
|
|
980
|
+
.options=${comboBoxOptions}
|
|
981
|
+
.value=${[comboBoxOptions[4]]}
|
|
982
|
+
invalid
|
|
983
|
+
invalid-text-i18n="Error Message from Combobox"
|
|
984
|
+
></md-combobox>
|
|
985
|
+
`);
|
|
986
|
+
|
|
987
|
+
expect(el.invalid).toBeTruthy();
|
|
988
|
+
expect(el.shadowRoot!.querySelector(".md-combobox-error")).not.toBeNull();
|
|
989
|
+
expect(el.shadowRoot!.querySelector("md-help-text")!.message).toEqual("Error Message from Combobox");
|
|
990
|
+
});
|
|
991
|
+
|
|
992
|
+
test("should render with Slect All option", async () => {
|
|
993
|
+
const el = await fixture<ComboBox.ELEMENT>(html`
|
|
994
|
+
<md-combobox .options=${comboBoxOptions} is-multi allow-select-all> </md-combobox>
|
|
995
|
+
`);
|
|
996
|
+
el.expanded = true;
|
|
997
|
+
await elementUpdated(el);
|
|
998
|
+
expect(el.shadowRoot!.querySelector("#md-combobox-listbox")?.querySelector("#selectAll")).not.toBeNull();
|
|
999
|
+
});
|
|
1000
|
+
|
|
1001
|
+
test("should select/unselect all options on clicking Select All", async () => {
|
|
1002
|
+
const el = await fixture<ComboBox.ELEMENT>(html`
|
|
1003
|
+
<md-combobox .options=${comboBoxOptions} is-multi allow-select-all show-selected-count> </md-combobox>
|
|
1004
|
+
`);
|
|
1005
|
+
el.expanded = true;
|
|
1006
|
+
await elementUpdated(el);
|
|
1007
|
+
const selectAllEl = el.shadowRoot!.querySelector("#md-combobox-listbox")?.querySelector("#selectAll");
|
|
1008
|
+
expect(selectAllEl).not.toBeNull();
|
|
1009
|
+
expect(el.selectedOptions.length).toEqual(0);
|
|
1010
|
+
selectAllEl?.dispatchEvent(new MouseEvent("click"));
|
|
1011
|
+
|
|
1012
|
+
await nextFrame();
|
|
1013
|
+
expect(el.selectedOptions.length).toEqual(comboBoxOptions.length);
|
|
1014
|
+
expect(el.shadowRoot!.querySelector(".md-combobox__multiwrap .selected-count")).not.toBeNull();
|
|
1015
|
+
expect(el.shadowRoot!.querySelector(".md-combobox__multiwrap .selected-count")?.textContent).toEqual("All");
|
|
1016
|
+
|
|
1017
|
+
el.expanded = true;
|
|
1018
|
+
await elementUpdated(el);
|
|
1019
|
+
selectAllEl?.dispatchEvent(new MouseEvent("click"));
|
|
1020
|
+
await nextFrame();
|
|
1021
|
+
expect(el.selectedOptions.length).toEqual(0);
|
|
1022
|
+
expect(el.shadowRoot!.querySelector(".md-combobox__multiwrap .selected-count")).toBeNull();
|
|
1023
|
+
});
|
|
1024
|
+
|
|
1025
|
+
test("should show selected option's count", async () => {
|
|
1026
|
+
const el = await fixture<ComboBox.ELEMENT>(html`
|
|
1027
|
+
<md-combobox .options=${comboBoxOptions} is-multi allow-select-all show-selected-count> </md-combobox>
|
|
1028
|
+
`);
|
|
1029
|
+
el.expanded = true;
|
|
1030
|
+
await elementUpdated(el);
|
|
1031
|
+
|
|
1032
|
+
const firstOption = el.shadowRoot!.querySelectorAll("#md-combobox-listbox .md-combobox-option")[1];
|
|
1033
|
+
firstOption.dispatchEvent(new MouseEvent("click"));
|
|
1034
|
+
await nextFrame();
|
|
1035
|
+
expect(el.selectedOptions.length).toEqual(1);
|
|
1036
|
+
expect(el.shadowRoot!.querySelector(".md-combobox__multiwrap .selected-count")?.textContent).toEqual("1 Selected");
|
|
1037
|
+
});
|
|
1038
|
+
|
|
1039
|
+
test("should render with custom error", async () => {
|
|
1040
|
+
const el = await fixture<ComboBox.ELEMENT>(html`
|
|
1041
|
+
<md-combobox .options=${comboBoxOptions} show-custom-error>
|
|
1042
|
+
<div slot="custom-error">Custom Error!!!</div>
|
|
1043
|
+
</md-combobox>
|
|
1044
|
+
`);
|
|
1045
|
+
el.expanded = true;
|
|
1046
|
+
await elementUpdated(el);
|
|
1047
|
+
expect(el.shadowRoot!.querySelector('[slot="custom-error"]')).not.toBeNull();
|
|
1048
|
+
expect(el.shadowRoot!.querySelector('[slot="custom-error"]')!.innerHTML).toEqual("Custom Error!!!");
|
|
1049
|
+
});
|
|
1050
|
+
|
|
1051
|
+
describe("Combobox with group options", () => {
|
|
1052
|
+
test("should render group label", async () => {
|
|
1053
|
+
const el = await fixture<ComboBox.ELEMENT>(html`
|
|
1054
|
+
<md-combobox with-custom-content>
|
|
1055
|
+
<optgroup label="Countries">
|
|
1056
|
+
<div slot="Australia" aria-label="Australia" display-value="Australia">
|
|
1057
|
+
<span>Australia</span>
|
|
1058
|
+
</div>
|
|
1059
|
+
<div slot="Austria" aria-label="Austria" display-value="Austria">
|
|
1060
|
+
<span>Austria</span>
|
|
1061
|
+
</div>
|
|
1062
|
+
</optgroup>
|
|
1063
|
+
<optgroup label="Cites">
|
|
1064
|
+
<div slot="Ambala" aria-label="Ambala" display-value="Ambala">
|
|
1065
|
+
<span>Ambala</span>
|
|
1066
|
+
</div>
|
|
1067
|
+
<div slot="Banaras" aria-label="Banaras" display-value="Banaras">
|
|
1068
|
+
<span>Banaras</span>
|
|
1069
|
+
</div>
|
|
1070
|
+
</optgroup>
|
|
1071
|
+
</md-combobox>
|
|
1072
|
+
`);
|
|
1073
|
+
|
|
1074
|
+
el.expanded = true;
|
|
1075
|
+
await elementUpdated(el);
|
|
1076
|
+
expect(el.shadowRoot!.querySelector(".group-label")).not.toBeNull();
|
|
1077
|
+
|
|
1078
|
+
const createEvent = (code: string) =>
|
|
1079
|
+
new KeyboardEvent("keydown", {
|
|
1080
|
+
code
|
|
1081
|
+
});
|
|
1082
|
+
|
|
1083
|
+
const backspace = createEvent(Key.Backspace);
|
|
1084
|
+
el.input!.dispatchEvent(backspace);
|
|
1085
|
+
|
|
1086
|
+
await elementUpdated(el);
|
|
1087
|
+
|
|
1088
|
+
expect(el.focusedIndex).toEqual(-1);
|
|
1089
|
+
const arrowDown = createEvent(Key.ArrowDown);
|
|
1090
|
+
el.input!.dispatchEvent(arrowDown);
|
|
1091
|
+
|
|
1092
|
+
await elementUpdated(el);
|
|
1093
|
+
await nextFrame();
|
|
1094
|
+
|
|
1095
|
+
expect(el.expanded).toBeTruthy();
|
|
1096
|
+
expect(el.focusedIndex).toEqual(-1);
|
|
1097
|
+
|
|
1098
|
+
const groupList = el.shadowRoot!.querySelectorAll(".group-label");
|
|
1099
|
+
expect(groupList![0].hasAttribute("focused")).toBeTruthy();
|
|
1100
|
+
|
|
1101
|
+
const enter = createEvent(Key.Enter);
|
|
1102
|
+
groupList![0].dispatchEvent(enter);
|
|
1103
|
+
await elementUpdated(el);
|
|
1104
|
+
|
|
1105
|
+
expect(el.expanded).toBeTruthy();
|
|
1106
|
+
expect(el.focusedGroupIndex).toEqual(0);
|
|
1107
|
+
expect(el.lists?.length).toEqual(2);
|
|
1108
|
+
|
|
1109
|
+
groupList![0].dispatchEvent(arrowDown);
|
|
1110
|
+
|
|
1111
|
+
await elementUpdated(el);
|
|
1112
|
+
await nextFrame();
|
|
1113
|
+
|
|
1114
|
+
expect(el.expanded).toBeTruthy();
|
|
1115
|
+
expect(el.focusedIndex).toEqual(0);
|
|
1116
|
+
|
|
1117
|
+
groupList![0].dispatchEvent(arrowDown);
|
|
1118
|
+
await elementUpdated(el);
|
|
1119
|
+
await nextFrame();
|
|
1120
|
+
|
|
1121
|
+
expect(el.focusedGroupIndex).toEqual(-1);
|
|
1122
|
+
expect(el.focusedIndex).toEqual(1);
|
|
1123
|
+
|
|
1124
|
+
groupList![0].dispatchEvent(enter);
|
|
1125
|
+
await elementUpdated(el);
|
|
1126
|
+
await nextFrame();
|
|
1127
|
+
|
|
1128
|
+
expect(el.input?.value).toEqual("Austria");
|
|
1129
|
+
expect(el.expanded).toBeFalsy();
|
|
1130
|
+
|
|
1131
|
+
const arrowUp = createEvent(Key.ArrowUp);
|
|
1132
|
+
el.input!.dispatchEvent(arrowUp);
|
|
1133
|
+
|
|
1134
|
+
await elementUpdated(el);
|
|
1135
|
+
await nextFrame();
|
|
1136
|
+
|
|
1137
|
+
expect(el.expanded).toBeTruthy();
|
|
1138
|
+
groupList![0].dispatchEvent(enter);
|
|
1139
|
+
|
|
1140
|
+
expect(el.input?.value).toEqual("Australia");
|
|
1141
|
+
expect(el.expanded).toBeFalsy();
|
|
1142
|
+
});
|
|
1143
|
+
});
|
|
1144
|
+
|
|
1145
|
+
test("should navigate through tab between groups", async () => {
|
|
1146
|
+
const el = await fixture<ComboBox.ELEMENT>(html`
|
|
1147
|
+
<md-combobox with-custom-content>
|
|
1148
|
+
<optgroup label="Countries">
|
|
1149
|
+
<div slot="Australia" aria-label="Australia" display-value="Australia">
|
|
1150
|
+
<span>Australia</span>
|
|
1151
|
+
</div>
|
|
1152
|
+
<div slot="Austria" aria-label="Austria" display-value="Austria">
|
|
1153
|
+
<span>Austria</span>
|
|
1154
|
+
</div>
|
|
1155
|
+
</optgroup>
|
|
1156
|
+
<optgroup label="Cites">
|
|
1157
|
+
<div slot="Ambala" aria-label="Ambala" display-value="Ambala">
|
|
1158
|
+
<span>Ambala</span>
|
|
1159
|
+
</div>
|
|
1160
|
+
<div slot="Banaras" aria-label="Banaras" display-value="Banaras">
|
|
1161
|
+
<span>Banaras</span>
|
|
1162
|
+
</div>
|
|
1163
|
+
</optgroup>
|
|
1164
|
+
</md-combobox>
|
|
1165
|
+
`);
|
|
1166
|
+
|
|
1167
|
+
el.expanded = true;
|
|
1168
|
+
await elementUpdated(el);
|
|
1169
|
+
expect(el.shadowRoot!.querySelector(".group-label")).not.toBeNull();
|
|
1170
|
+
|
|
1171
|
+
const createEvent = (code: string) =>
|
|
1172
|
+
new KeyboardEvent("keydown", {
|
|
1173
|
+
code
|
|
1174
|
+
});
|
|
1175
|
+
|
|
1176
|
+
const backspace = createEvent(Key.Backspace);
|
|
1177
|
+
const arrowDown = createEvent(Key.ArrowDown);
|
|
1178
|
+
const arrowUp = createEvent(Key.ArrowUp);
|
|
1179
|
+
const tab = createEvent(Key.Tab);
|
|
1180
|
+
const enter = createEvent(Key.Enter);
|
|
1181
|
+
const escape = createEvent(Key.Escape);
|
|
1182
|
+
|
|
1183
|
+
el.input!.dispatchEvent(backspace);
|
|
1184
|
+
|
|
1185
|
+
await elementUpdated(el);
|
|
1186
|
+
expect(el.focusedIndex).toEqual(-1);
|
|
1187
|
+
el.input!.dispatchEvent(arrowUp);
|
|
1188
|
+
|
|
1189
|
+
await elementUpdated(el);
|
|
1190
|
+
await nextFrame();
|
|
1191
|
+
|
|
1192
|
+
expect(el.expanded).toBeTruthy();
|
|
1193
|
+
expect(el.focusedIndex).toEqual(-1);
|
|
1194
|
+
|
|
1195
|
+
const groupList = el.shadowRoot!.querySelectorAll(".group-label");
|
|
1196
|
+
expect(groupList![0].hasAttribute("focused")).toBeTruthy();
|
|
1197
|
+
|
|
1198
|
+
groupList![0].dispatchEvent(arrowDown);
|
|
1199
|
+
await elementUpdated(el);
|
|
1200
|
+
groupList![0].dispatchEvent(arrowUp);
|
|
1201
|
+
|
|
1202
|
+
groupList![0].dispatchEvent(enter);
|
|
1203
|
+
await elementUpdated(el);
|
|
1204
|
+
|
|
1205
|
+
expect(el.expanded).toBeTruthy();
|
|
1206
|
+
expect(el.focusedGroupIndex).toEqual(0);
|
|
1207
|
+
expect(el.lists?.length).toEqual(2);
|
|
1208
|
+
|
|
1209
|
+
groupList![0]!.dispatchEvent(tab);
|
|
1210
|
+
|
|
1211
|
+
await elementUpdated(el);
|
|
1212
|
+
await nextFrame();
|
|
1213
|
+
|
|
1214
|
+
expect(el.expanded).toBeTruthy();
|
|
1215
|
+
expect(el.focusedIndex).toEqual(-1);
|
|
1216
|
+
expect(el.focusedGroupIndex).toEqual(1);
|
|
1217
|
+
|
|
1218
|
+
groupList![1].dispatchEvent(enter);
|
|
1219
|
+
|
|
1220
|
+
await elementUpdated(el);
|
|
1221
|
+
await nextFrame();
|
|
1222
|
+
|
|
1223
|
+
expect(el.lists?.length).toEqual(2);
|
|
1224
|
+
groupList![1].dispatchEvent(arrowDown);
|
|
1225
|
+
|
|
1226
|
+
await elementUpdated(el);
|
|
1227
|
+
await nextFrame();
|
|
1228
|
+
|
|
1229
|
+
groupList![1].dispatchEvent(arrowUp);
|
|
1230
|
+
groupList![1].dispatchEvent(enter);
|
|
1231
|
+
|
|
1232
|
+
expect(el.input?.value).toEqual("Ambala");
|
|
1233
|
+
expect(el.expanded).toBeFalsy();
|
|
1234
|
+
|
|
1235
|
+
await elementUpdated(el);
|
|
1236
|
+
await nextFrame();
|
|
1237
|
+
|
|
1238
|
+
el.input!.dispatchEvent(arrowDown);
|
|
1239
|
+
|
|
1240
|
+
await elementUpdated(el);
|
|
1241
|
+
await nextFrame();
|
|
1242
|
+
|
|
1243
|
+
groupList![0]!.dispatchEvent(escape);
|
|
1244
|
+
});
|
|
1245
|
+
|
|
1246
|
+
test("should list all group related options on match", async () => {
|
|
1247
|
+
const el = await fixture<ComboBox.ELEMENT>(html`
|
|
1248
|
+
<md-combobox with-custom-content>
|
|
1249
|
+
<optgroup label="Countries">
|
|
1250
|
+
<div slot="Australia" aria-label="Australia" display-value="Australia">
|
|
1251
|
+
<span>Australia</span>
|
|
1252
|
+
</div>
|
|
1253
|
+
<div slot="Austria" aria-label="Austria" display-value="Austria">
|
|
1254
|
+
<span>Austria</span>
|
|
1255
|
+
</div>
|
|
1256
|
+
<div slot="India" aria-label="India" display-value="India">
|
|
1257
|
+
<span>India</span>
|
|
1258
|
+
</div>
|
|
1259
|
+
</optgroup>
|
|
1260
|
+
<optgroup label="Cites">
|
|
1261
|
+
<div slot="Ambala" aria-label="Ambala" display-value="Ambala">
|
|
1262
|
+
<span>Ambala</span>
|
|
1263
|
+
</div>
|
|
1264
|
+
<div slot="Banaras" aria-label="Banaras" display-value="Banaras">
|
|
1265
|
+
<span>Banaras</span>
|
|
1266
|
+
</div>
|
|
1267
|
+
<div slot="Ujjaini" aria-label="Ujjaini" display-value="Ujjaini">
|
|
1268
|
+
<span>Indonasia</span>
|
|
1269
|
+
</div>
|
|
1270
|
+
<div slot="Indore" aria-label="Indore" display-value="Indore">
|
|
1271
|
+
<span>Indore</span>
|
|
1272
|
+
</div>
|
|
1273
|
+
</optgroup>
|
|
1274
|
+
</md-combobox>
|
|
1275
|
+
`);
|
|
1276
|
+
|
|
1277
|
+
el.expanded = true;
|
|
1278
|
+
await elementUpdated(el);
|
|
1279
|
+
expect(el.shadowRoot!.querySelector(".group-label")).not.toBeNull();
|
|
1280
|
+
|
|
1281
|
+
const createEvent = (code: string) =>
|
|
1282
|
+
new KeyboardEvent("keydown", {
|
|
1283
|
+
code
|
|
1284
|
+
});
|
|
1285
|
+
|
|
1286
|
+
const backspace = createEvent(Key.Backspace);
|
|
1287
|
+
el.input!.dispatchEvent(backspace);
|
|
1288
|
+
|
|
1289
|
+
await elementUpdated(el);
|
|
1290
|
+
|
|
1291
|
+
const event = new Event("input");
|
|
1292
|
+
el.input!.value = "In";
|
|
1293
|
+
el.input!.dispatchEvent(event);
|
|
1294
|
+
await elementUpdated(el);
|
|
1295
|
+
await nextFrame();
|
|
1296
|
+
|
|
1297
|
+
expect(el.lists?.length).toEqual(3);
|
|
1298
|
+
const arrowDown = createEvent(Key.ArrowDown);
|
|
1299
|
+
el.input!.dispatchEvent(arrowDown);
|
|
1300
|
+
|
|
1301
|
+
await elementUpdated(el);
|
|
1302
|
+
await nextFrame();
|
|
1303
|
+
|
|
1304
|
+
const enter = createEvent(Key.Enter);
|
|
1305
|
+
el.input!.dispatchEvent(enter);
|
|
1306
|
+
await elementUpdated(el);
|
|
1307
|
+
await nextFrame();
|
|
1308
|
+
|
|
1309
|
+
expect(el.input?.value).toEqual("India");
|
|
1310
|
+
});
|
|
1311
|
+
|
|
1312
|
+
test("should navigate through tab between groups for multi select", async () => {
|
|
1313
|
+
const el2 = await fixture<ComboBox.ELEMENT>(html`
|
|
1314
|
+
<md-combobox with-custom-content is-multi use-virtual-scroll allow-select-all placeholder="Placeholder">
|
|
1315
|
+
<div label="Countries">
|
|
1316
|
+
<div slot="Austria" aria-label="Austria" display-value="Austria">
|
|
1317
|
+
<span>Austria</span>
|
|
1318
|
+
</div>
|
|
1319
|
+
</div>
|
|
1320
|
+
</md-combobox>
|
|
1321
|
+
`);
|
|
1322
|
+
await elementUpdated(el2);
|
|
1323
|
+
await nextFrame();
|
|
1324
|
+
|
|
1325
|
+
const el = await fixture<ComboBox.ELEMENT>(html`
|
|
1326
|
+
<md-combobox with-custom-content is-multi placeholder="Placeholder">
|
|
1327
|
+
<optgroup label="Countries">
|
|
1328
|
+
<div slot="Australia" aria-label="Australia" display-value="Australia">
|
|
1329
|
+
<span>Australia</span>
|
|
1330
|
+
</div>
|
|
1331
|
+
<div slot="Austria" aria-label="Austria" display-value="Austria">
|
|
1332
|
+
<span>Austria</span>
|
|
1333
|
+
</div>
|
|
1334
|
+
</optgroup>
|
|
1335
|
+
<optgroup label="Cites">
|
|
1336
|
+
<div slot="Ambala" aria-label="Ambala" display-value="Ambala">
|
|
1337
|
+
<span>Ambala</span>
|
|
1338
|
+
</div>
|
|
1339
|
+
<div slot="Banaras" aria-label="Banaras" display-value="Banaras">
|
|
1340
|
+
<span>Banaras</span>
|
|
1341
|
+
</div>
|
|
1342
|
+
</optgroup>
|
|
1343
|
+
</md-combobox>
|
|
1344
|
+
`);
|
|
1345
|
+
|
|
1346
|
+
el.expanded = true;
|
|
1347
|
+
await elementUpdated(el);
|
|
1348
|
+
expect(el.shadowRoot!.querySelector(".group-label")).not.toBeNull();
|
|
1349
|
+
|
|
1350
|
+
const createEvent = (code: string) =>
|
|
1351
|
+
new KeyboardEvent("keydown", {
|
|
1352
|
+
code
|
|
1353
|
+
});
|
|
1354
|
+
|
|
1355
|
+
const backspace = createEvent(Key.Backspace);
|
|
1356
|
+
const arrowDown = createEvent(Key.ArrowDown);
|
|
1357
|
+
const arrowUp = createEvent(Key.ArrowUp);
|
|
1358
|
+
const tab = createEvent(Key.Tab);
|
|
1359
|
+
const enter = createEvent(Key.Enter);
|
|
1360
|
+
const escape = createEvent(Key.Escape);
|
|
1361
|
+
const end = createEvent(Key.End);
|
|
1362
|
+
|
|
1363
|
+
el.input!.dispatchEvent(backspace);
|
|
1364
|
+
|
|
1365
|
+
await elementUpdated(el);
|
|
1366
|
+
expect(el.focusedIndex).toEqual(-1);
|
|
1367
|
+
el.input!.dispatchEvent(arrowUp);
|
|
1368
|
+
|
|
1369
|
+
await elementUpdated(el);
|
|
1370
|
+
await nextFrame();
|
|
1371
|
+
|
|
1372
|
+
expect(el.expanded).toBeTruthy();
|
|
1373
|
+
expect(el.focusedIndex).toEqual(-1);
|
|
1374
|
+
|
|
1375
|
+
const groupList = el.shadowRoot!.querySelectorAll(".group-label");
|
|
1376
|
+
expect(groupList![0].hasAttribute("focused")).toBeTruthy();
|
|
1377
|
+
|
|
1378
|
+
groupList![0].dispatchEvent(arrowDown);
|
|
1379
|
+
await elementUpdated(el);
|
|
1380
|
+
groupList![0].dispatchEvent(arrowUp);
|
|
1381
|
+
|
|
1382
|
+
groupList![0].dispatchEvent(enter);
|
|
1383
|
+
await elementUpdated(el);
|
|
1384
|
+
|
|
1385
|
+
expect(el.expanded).toBeTruthy();
|
|
1386
|
+
expect(el.focusedGroupIndex).toEqual(0);
|
|
1387
|
+
expect(el.lists?.length).toEqual(2);
|
|
1388
|
+
|
|
1389
|
+
groupList![0]!.dispatchEvent(tab);
|
|
1390
|
+
|
|
1391
|
+
await elementUpdated(el);
|
|
1392
|
+
await nextFrame();
|
|
1393
|
+
|
|
1394
|
+
expect(el.expanded).toBeTruthy();
|
|
1395
|
+
expect(el.focusedIndex).toEqual(-1);
|
|
1396
|
+
expect(el.focusedGroupIndex).toEqual(1);
|
|
1397
|
+
|
|
1398
|
+
groupList![1].dispatchEvent(enter);
|
|
1399
|
+
|
|
1400
|
+
await elementUpdated(el);
|
|
1401
|
+
await nextFrame();
|
|
1402
|
+
|
|
1403
|
+
expect(el.lists?.length).toEqual(2);
|
|
1404
|
+
groupList![1].dispatchEvent(arrowDown);
|
|
1405
|
+
|
|
1406
|
+
await elementUpdated(el);
|
|
1407
|
+
await nextFrame();
|
|
1408
|
+
|
|
1409
|
+
groupList![1].dispatchEvent(enter);
|
|
1410
|
+
|
|
1411
|
+
await elementUpdated(el);
|
|
1412
|
+
await nextFrame();
|
|
1413
|
+
|
|
1414
|
+
expect(el.input?.value).toEqual("Ambala");
|
|
1415
|
+
expect(el.expanded).toBeFalsy();
|
|
1416
|
+
|
|
1417
|
+
await elementUpdated(el);
|
|
1418
|
+
await nextFrame();
|
|
1419
|
+
groupList![0]!.dispatchEvent(end);
|
|
1420
|
+
groupList![0]!.dispatchEvent(escape);
|
|
1421
|
+
}, 2000);
|
|
1422
|
+
|
|
1423
|
+
describe("Combobox with virtual scroll", () => {
|
|
1424
|
+
test("should handle keyUp event", async () => {
|
|
1425
|
+
const el = await fixture<ComboBox.ELEMENT>(html`
|
|
1426
|
+
<md-combobox .options=${comboBoxOptions} use-virtual-scroll></md-combobox>
|
|
1427
|
+
`);
|
|
1428
|
+
const createEvent = (code: string) =>
|
|
1429
|
+
new KeyboardEvent("keyup", {
|
|
1430
|
+
code
|
|
1431
|
+
});
|
|
1432
|
+
|
|
1433
|
+
const backspace = createEvent(Key.Backspace);
|
|
1434
|
+
el.input!.dispatchEvent(backspace);
|
|
1435
|
+
|
|
1436
|
+
const mock = jest.fn();
|
|
1437
|
+
|
|
1438
|
+
el.listBox!.style.maxHeight = mock();
|
|
1439
|
+
|
|
1440
|
+
expect(el.expanded).toBeTruthy();
|
|
1441
|
+
expect(mock).toBeCalled();
|
|
1442
|
+
|
|
1443
|
+
el.expanded = false;
|
|
1444
|
+
|
|
1445
|
+
await elementUpdated(el);
|
|
1446
|
+
|
|
1447
|
+
mock.mockReset();
|
|
1448
|
+
const escape = createEvent(Key.Escape);
|
|
1449
|
+
el.input!.dispatchEvent(escape);
|
|
1450
|
+
|
|
1451
|
+
expect(el.expanded).toBeFalsy();
|
|
1452
|
+
expect(mock).not.toBeCalled();
|
|
1453
|
+
});
|
|
1454
|
+
test("should set initial value for multi", async () => {
|
|
1455
|
+
const el = await fixture<ComboBox.ELEMENT>(html`
|
|
1456
|
+
<md-combobox
|
|
1457
|
+
.options=${comboBoxOptions}
|
|
1458
|
+
.value=${[comboBoxOptions[1], comboBoxOptions[2]]}
|
|
1459
|
+
is-multi
|
|
1460
|
+
use-virtual-scroll
|
|
1461
|
+
></md-combobox>
|
|
1462
|
+
`);
|
|
1463
|
+
|
|
1464
|
+
expect(el.value).toEqual(expect.arrayContaining([comboBoxOptions[1], comboBoxOptions[2]]));
|
|
1465
|
+
expect(el.selected!.length).toEqual(2);
|
|
1466
|
+
expect(el.selectedOptions).toEqual(expect.arrayContaining(["Aland Islands", "Albania"]));
|
|
1467
|
+
});
|
|
1468
|
+
|
|
1469
|
+
test("should update ariaLabelForComboBox based on search result count", async () => {
|
|
1470
|
+
const el = await fixture<ComboBox.ELEMENT>(html`
|
|
1471
|
+
<md-combobox .options=${["One", "Two", "Three"]}></md-combobox>
|
|
1472
|
+
`);
|
|
1473
|
+
|
|
1474
|
+
el.searchResultAriaLabel = "Search results: {{count}} results found.";
|
|
1475
|
+
el.inputValue = "One";
|
|
1476
|
+
el["notifySearchResultCount"]();
|
|
1477
|
+
await elementUpdated(el);
|
|
1478
|
+
expect(el.ariaLabelForComboBox).toEqual("Search results: 1 results found.");
|
|
1479
|
+
|
|
1480
|
+
el.searchResultAriaLabel = "";
|
|
1481
|
+
el.ariaLabel = "Search results";
|
|
1482
|
+
el["notifySearchResultCount"]();
|
|
1483
|
+
await elementUpdated(el);
|
|
1484
|
+
expect(el.ariaLabelForComboBox).toEqual("Search results, 1 results found.");
|
|
1485
|
+
|
|
1486
|
+
el.ariaLabel = "";
|
|
1487
|
+
el["notifySearchResultCount"]();
|
|
1488
|
+
await elementUpdated(el);
|
|
1489
|
+
expect(el.ariaLabelForComboBox).toEqual("ComboBox Element, 1 results found.");
|
|
1490
|
+
});
|
|
1491
|
+
|
|
1492
|
+
test("should change selected option for virtual scroll", async () => {
|
|
1493
|
+
const el = await fixture<ComboBox.ELEMENT>(html`
|
|
1494
|
+
<md-combobox .options=${comboBoxOptions} use-virtual-scroll></md-combobox>
|
|
1495
|
+
`);
|
|
1496
|
+
el.expanded = true;
|
|
1497
|
+
const lists = comboBoxOptions.map((item) => {
|
|
1498
|
+
return `<div id=${item} class="md-combobox-option" role="option" style="height:12px;">${item}</div>`;
|
|
1499
|
+
});
|
|
1500
|
+
|
|
1501
|
+
if (lists && el.listBox) {
|
|
1502
|
+
el.listBox.innerHTML = `${lists.join("")}`;
|
|
1503
|
+
}
|
|
1504
|
+
const upd = el.lists![0];
|
|
1505
|
+
if (el.lists![0]) {
|
|
1506
|
+
upd.onclick = (event) => el.handleListClick(event);
|
|
1507
|
+
}
|
|
1508
|
+
el.lists![0].dispatchEvent(new MouseEvent("click"));
|
|
1509
|
+
|
|
1510
|
+
await elementUpdated(el);
|
|
1511
|
+
|
|
1512
|
+
expect(el.focusedIndex).toEqual(0);
|
|
1513
|
+
expect(el.selectedOptions.length).toEqual(1);
|
|
1514
|
+
expect(el.selectedOptions).toEqual(expect.arrayContaining(["Afghanistan"]));
|
|
1515
|
+
});
|
|
1516
|
+
});
|
|
1517
|
+
});
|