@lion/ui 0.23.0 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +50 -20
- package/components/accordion/src/LionAccordion.js +31 -42
- package/components/accordion/test/lion-accordion.test.js +108 -134
- package/components/button/src/LionButton.js +9 -12
- package/components/button/src/LionButtonReset.js +0 -5
- package/components/button/src/LionButtonSubmit.js +7 -12
- package/components/button/test/demos.screenshots-test.js +50 -11
- package/components/button/test/lion-button.test.js +0 -1
- package/components/button/test-suites/LionButton.suite.js +135 -145
- package/components/button/test-suites/LionButtonReset.suite.js +54 -72
- package/components/button/test-suites/LionButtonSubmit.suite.js +49 -68
- package/components/calendar/src/LionCalendar.js +151 -104
- package/components/calendar/src/calendarStyle.js +0 -1
- package/components/calendar/src/utils/createMonth.js +3 -4
- package/components/calendar/src/utils/createMultipleMonth.js +15 -7
- package/components/calendar/src/utils/createWeek.js +0 -2
- package/components/calendar/src/utils/dataTemplate.js +8 -4
- package/components/calendar/src/utils/dayTemplate.js +0 -6
- package/components/calendar/src/utils/getDayMonthYear.js +6 -2
- package/components/calendar/test/demos.screenshots-test.js +40 -9
- package/components/calendar/test/lion-calendar.test.js +171 -282
- package/components/calendar/test/utils/createMonth.test.js +61 -22
- package/components/calendar/test/utils/createMultipleMonth.test.js +14 -7
- package/components/calendar/test/utils/createWeek.test.js +51 -17
- package/components/calendar/test/utils/dataTemplate.test.js +3 -4
- package/components/calendar/test/utils/dayTemplate.test.js +106 -34
- package/components/calendar/test/utils/getFirstDayNextMonth.test.js +0 -1
- package/components/calendar/test/utils/getLastDayPreviousMonth.test.js +0 -1
- package/components/calendar/test/utils/isSameDate.test.js +0 -1
- package/components/calendar/test/utils/snapshots/monthTemplate_en-GB_Sunday_2018-12.js +1 -2
- package/components/calendar/test-helpers/CalendarObject.js +31 -62
- package/components/calendar/test-helpers/DayObject.js +7 -15
- package/components/calendar/test-suites/LionCalendar.suite.js +7 -9
- package/components/checkbox-group/src/LionCheckboxIndeterminate.js +17 -30
- package/components/checkbox-group/test/lion-checkbox-group-integrations.test.js +0 -1
- package/components/checkbox-group/test/lion-checkbox-group.test.js +21 -16
- package/components/checkbox-group/test/lion-checkbox-indeterminate-integrations.test.js +3 -3
- package/components/checkbox-group/test/lion-checkbox-integrations.test.js +3 -2
- package/components/checkbox-group/test/lion-checkbox.test.js +30 -16
- package/components/checkbox-group/test-suites/CheckboxIndeterminate.suite.js +147 -191
- package/components/collapsible/src/LionCollapsible.js +10 -15
- package/components/collapsible/test/lion-collapsible.test.js +4 -18
- package/components/combobox/src/LionCombobox.js +35 -53
- package/components/combobox/src/utils/makeMatchingTextBold.js +2 -5
- package/components/combobox/src/validators.js +0 -1
- package/components/combobox/test/lion-combobox-integrations.test.js +6 -6
- package/components/combobox/test/lion-combobox.test.js +576 -869
- package/components/combobox/test/validators.test.js +6 -13
- package/components/combobox/test-helpers/combobox-helpers.js +24 -11
- package/components/core/src/DisabledMixin.js +61 -66
- package/components/core/src/DisabledWithTabIndexMixin.js +76 -83
- package/components/core/src/EventTargetShim.js +1 -4
- package/components/core/src/ScopedElementsMixin.js +4 -15
- package/components/core/src/ScopedStylesController.js +1 -5
- package/components/core/src/SlotMixin.js +236 -239
- package/components/core/src/browserDetection.js +5 -12
- package/components/core/test/DisabledMixin.test.js +24 -39
- package/components/core/test/DisabledWithTabIndexMixin.test.js +21 -34
- package/components/core/test/EventTargetShim.test.js +0 -8
- package/components/core/test/ScopedElementsMixin.test.js +22 -38
- package/components/core/test/ScopedStylesController.test.js +11 -20
- package/components/core/test/SlotMixin.test.js +102 -154
- package/components/core/test-helpers/getCachedFixture.js +5 -11
- package/components/core/types/SlotMixinTypes.ts +8 -3
- package/components/dialog/src/LionDialog.js +4 -3
- package/components/dialog/test/lion-dialog.integration.test.js +10 -20
- package/components/dialog/test/lion-dialog.test.js +48 -62
- package/components/dialog/test-helpers/test-router.js +4 -6
- package/components/drawer/src/LionDrawer.js +18 -34
- package/components/drawer/src/drawerStyle.js +0 -1
- package/components/drawer/test/lion-drawer.test.js +1 -17
- package/components/fieldset/test/lion-fieldset.test.js +6 -4
- package/components/form/src/LionForm.js +18 -13
- package/components/form/test/lion-form.test.js +22 -52
- package/components/form-core/src/FocusMixin.js +172 -174
- package/components/form-core/src/FormControlMixin.js +811 -813
- package/components/form-core/src/FormatMixin.js +537 -537
- package/components/form-core/src/InteractionStateMixin.js +196 -183
- package/components/form-core/src/LionField.js +9 -5
- package/components/form-core/src/NativeTextFieldMixin.js +114 -116
- package/components/form-core/src/choice-group/ChoiceGroupMixin.js +322 -364
- package/components/form-core/src/choice-group/ChoiceInputMixin.js +306 -296
- package/components/form-core/src/choice-group/CustomChoiceGroupMixin.js +114 -139
- package/components/form-core/src/form-group/FormElementsHaveNoError.js +0 -2
- package/components/form-core/src/form-group/FormGroupMixin.js +551 -557
- package/components/form-core/src/registration/FormRegisteringMixin.js +72 -71
- package/components/form-core/src/registration/FormRegistrarMixin.js +201 -217
- package/components/form-core/src/registration/FormRegistrarPortalMixin.js +31 -37
- package/components/form-core/src/utils/SyncUpdatableMixin.js +106 -117
- package/components/form-core/src/utils/getAriaElementsInRightDomOrder.js +1 -2
- package/components/form-core/src/validate/LionValidationFeedback.js +12 -8
- package/components/form-core/src/validate/Unparseable.js +4 -2
- package/components/form-core/src/validate/ValidateMixin.js +829 -883
- package/components/form-core/src/validate/Validator.js +3 -6
- package/components/form-core/src/validate/resultValidators/DefaultSuccess.js +1 -2
- package/components/form-core/src/validate/validators/DateValidators.js +0 -5
- package/components/form-core/src/validate/validators/NumberValidators.js +1 -5
- package/components/form-core/src/validate/validators/Required.js +1 -1
- package/components/form-core/src/validate/validators/StringValidators.js +1 -8
- package/components/form-core/test/FocusMixin.test.js +96 -82
- package/components/form-core/test/FormControlMixin.test.js +120 -176
- package/components/form-core/test/FormRegistrationMixins.test.js +0 -2
- package/components/form-core/test/FormatMixin.test.js +0 -1
- package/components/form-core/test/InteractionStateMixin.test.js +0 -1
- package/components/form-core/test/NativeTextFieldMixin.test.js +0 -1
- package/components/form-core/test/choice-group/ChoiceGroupMixin.test.js +0 -1
- package/components/form-core/test/choice-group/ChoiceInputMixin.test.js +0 -1
- package/components/form-core/test/choice-group/CustomChoiceGroupMixin.integrations.test.js +6 -8
- package/components/form-core/test/choice-group/CustomChoiceGroupMixin.test.js +0 -3
- package/components/form-core/test/form-group/FormGroupMixin.test.js +0 -1
- package/components/form-core/test/lion-field.test.js +88 -98
- package/components/form-core/test/utils/SyncUpdatableMixin.test.js +51 -65
- package/components/form-core/test/utils/getAriaElementsInRightDomOrder.test.js +3 -3
- package/components/form-core/test/validate/DateValidators.test.js +5 -27
- package/components/form-core/test/validate/NumberValidators.test.js +4 -16
- package/components/form-core/test/validate/Required.test.js +8 -21
- package/components/form-core/test/validate/ResultValidator.test.js +1 -2
- package/components/form-core/test/validate/StringValidators.test.js +4 -35
- package/components/form-core/test/validate/ValidateMixin.test.js +0 -1
- package/components/form-core/test/validate/ValidateMixinFeedbackPart.test.js +0 -1
- package/components/form-core/test/validate/Validator.test.js +39 -34
- package/components/form-core/test/validate/lion-validation-feedback.test.js +81 -43
- package/components/form-core/test-helpers/ExampleValidators.js +0 -5
- package/components/form-core/test-helpers/getFormControlMembers.js +2 -2
- package/components/form-core/test-helpers/mimicUserInput.js +5 -1
- package/components/form-core/test-suites/FormRegistrationMixins.suite.js +65 -122
- package/components/form-core/test-suites/FormatMixin.suite.js +202 -227
- package/components/form-core/test-suites/InteractionStateMixin.suite.js +47 -60
- package/components/form-core/test-suites/NativeTextFieldMixin.suite.js +8 -11
- package/components/form-core/test-suites/ValidateMixin.suite.js +280 -359
- package/components/form-core/test-suites/ValidateMixinFeedbackPart.suite.js +112 -163
- package/components/form-core/test-suites/choice-group/ChoiceGroupMixin.suite.js +185 -218
- package/components/form-core/test-suites/choice-group/ChoiceInputMixin.suite.js +116 -109
- package/components/form-core/test-suites/choice-group/CustomChoiceGroupMixin.suite.js +36 -70
- package/components/form-core/test-suites/form-group/FormGroupMixin-input.suite.js +57 -65
- package/components/form-core/test-suites/form-group/FormGroupMixin.suite.js +664 -523
- package/components/form-core/translations/bg-BG.js +0 -1
- package/components/form-core/translations/cs-CZ.js +0 -1
- package/components/form-core/translations/de-DE.js +0 -1
- package/components/form-core/translations/en-AU.js +0 -1
- package/components/form-core/translations/en-GB.js +0 -1
- package/components/form-core/translations/en-US.js +0 -1
- package/components/form-core/translations/es-ES.js +0 -1
- package/components/form-core/translations/fr-BE.js +0 -1
- package/components/form-core/translations/fr-FR.js +0 -1
- package/components/form-core/translations/hu-HU.js +0 -1
- package/components/form-core/translations/it-IT.js +0 -1
- package/components/form-core/translations/nl-BE.js +0 -1
- package/components/form-core/translations/nl-NL.js +0 -1
- package/components/form-core/translations/pl-PL.js +0 -1
- package/components/form-core/translations/ro-RO.js +0 -1
- package/components/form-core/translations/ru-RU.js +0 -1
- package/components/form-core/translations/sk-SK.js +0 -1
- package/components/form-core/translations/tr-TR.js +0 -1
- package/components/form-core/translations/uk-UA.js +0 -1
- package/components/form-integrations/test/dialog-integrations.test.js +1 -4
- package/components/form-integrations/test/form-group-methods.test.js +28 -31
- package/components/form-integrations/test/form-integrations.test.js +27 -28
- package/components/form-integrations/test/form-validation-integrations.test.js +21 -29
- package/components/form-integrations/test/helpers/umbrella-form.js +3 -5
- package/components/form-integrations/test/model-value-consistency.test.js +75 -77
- package/components/form-integrations/test/model-value-event.test.js +10 -20
- package/components/helpers/src/SbActionLogger.js +13 -17
- package/components/helpers/src/SbLocaleSwitcher.js +5 -5
- package/components/helpers/src/sortEachDepth.js +0 -2
- package/components/helpers/test/renderLitAsNode.test.js +0 -4
- package/components/helpers/test/sb-action-logger.test.js +24 -55
- package/components/icon/src/IconManager.js +0 -2
- package/components/icon/src/LionIcon.js +2 -7
- package/components/icon/src/icons.js +0 -2
- package/components/icon/test/IconManager.test.js +0 -15
- package/components/icon/test/hammer.svg.js +3 -4
- package/components/icon/test/heart.svg.js +3 -4
- package/components/icon/test/lion-icon.test.js +14 -43
- package/components/input/src/LionInput.js +2 -8
- package/components/input/test/input-integrations.test.js +0 -5
- package/components/input/test/lion-input-integrations.test.js +0 -4
- package/components/input/test/lion-input.test.js +28 -58
- package/components/input/test-helpers/getInputMembers.js +2 -2
- package/components/input-amount/src/LionInputAmount.js +20 -20
- package/components/input-amount/src/formatters.js +0 -3
- package/components/input-amount/src/parsers.js +0 -3
- package/components/input-amount/test/formatters.test.js +24 -16
- package/components/input-amount/test/lion-input-amount-integrations.test.js +0 -4
- package/components/input-amount/test/lion-input-amount.test.js +123 -147
- package/components/input-amount/test/parsers.test.js +33 -17
- package/components/input-amount/test/preprocessors.test.js +0 -3
- package/components/input-amount-dropdown/src/LionInputAmountDropdown.js +49 -59
- package/components/input-amount-dropdown/src/currencyUtil.js +8 -7
- package/components/input-amount-dropdown/src/parsers.js +0 -1
- package/components/input-amount-dropdown/src/validators.js +0 -1
- package/components/input-amount-dropdown/test/LionInputAmountDropdown.test.js +34 -36
- package/components/input-amount-dropdown/test/lion-input-amount-dropdown-integrations.test.js +18 -13
- package/components/input-amount-dropdown/test-helpers/mimicUserChangingDropdown.js +5 -1
- package/components/input-amount-dropdown/test-suites/LionInputAmountDropdown.suite.js +132 -107
- package/components/input-date/src/LionInputDate.js +4 -3
- package/components/input-date/test/lion-input-date-integrations.test.js +0 -3
- package/components/input-date/test/lion-input-date.test.js +19 -32
- package/components/input-datepicker/src/LionInputDatepicker.js +17 -29
- package/components/input-datepicker/src/localizeNamespaceLoader.js +1 -2
- package/components/input-datepicker/test/lion-input-datepicker-integrations.test.js +0 -3
- package/components/input-datepicker/test/lion-input-datepicker.test.js +88 -153
- package/components/input-datepicker/test-helpers/DatepickerInputObject.js +9 -12
- package/components/input-datepicker/test-suites/LionInputDatepicker.suite.js +6 -4
- package/components/input-datepicker/translations/bg-BG.js +0 -1
- package/components/input-datepicker/translations/cs-CZ.js +0 -1
- package/components/input-datepicker/translations/de-DE.js +0 -1
- package/components/input-datepicker/translations/en-AU.js +0 -1
- package/components/input-datepicker/translations/en-GB.js +0 -1
- package/components/input-datepicker/translations/en-US.js +0 -1
- package/components/input-datepicker/translations/es-ES.js +0 -1
- package/components/input-datepicker/translations/fr-BE.js +0 -1
- package/components/input-datepicker/translations/fr-FR.js +0 -1
- package/components/input-datepicker/translations/hu-HU.js +0 -1
- package/components/input-datepicker/translations/it-IT.js +0 -1
- package/components/input-datepicker/translations/nl-BE.js +0 -1
- package/components/input-datepicker/translations/nl-NL.js +0 -1
- package/components/input-datepicker/translations/pl-PL.js +0 -1
- package/components/input-datepicker/translations/ro-RO.js +0 -1
- package/components/input-datepicker/translations/ru-RU.js +0 -1
- package/components/input-datepicker/translations/sk-SK.js +0 -1
- package/components/input-datepicker/translations/tr-TR.js +0 -1
- package/components/input-datepicker/translations/uk-UA.js +0 -1
- package/components/input-email/test/lion-input-email-integrations.test.js +0 -2
- package/components/input-email/test/lion-input-email.test.js +1 -7
- package/components/input-file/src/FileHandle.js +0 -3
- package/components/input-file/src/LionInputFile.js +85 -83
- package/components/input-file/src/LionSelectedFileList.js +12 -12
- package/components/input-file/src/validators.js +10 -9
- package/components/input-file/test/FileValidators.test.js +170 -80
- package/components/input-file/test/lion-input-file.test.js +160 -244
- package/components/input-file/test/lion-selected-file-list.test.js +13 -22
- package/components/input-file/translations/bg-BG.js +0 -1
- package/components/input-file/translations/cs-CZ.js +0 -1
- package/components/input-file/translations/de-DE.js +0 -1
- package/components/input-file/translations/en-AU.js +0 -1
- package/components/input-file/translations/en-GB.js +0 -1
- package/components/input-file/translations/en-PH.js +0 -1
- package/components/input-file/translations/en-US.js +0 -1
- package/components/input-file/translations/en.js +2 -1
- package/components/input-file/translations/es-ES.js +0 -1
- package/components/input-file/translations/fr-BE.js +0 -1
- package/components/input-file/translations/fr-FR.js +0 -1
- package/components/input-file/translations/hu-HU.js +0 -1
- package/components/input-file/translations/id-ID.js +0 -1
- package/components/input-file/translations/id.js +2 -1
- package/components/input-file/translations/it-IT.js +0 -1
- package/components/input-file/translations/nl-BE.js +0 -1
- package/components/input-file/translations/nl-NL.js +0 -1
- package/components/input-file/translations/pl-PL.js +0 -1
- package/components/input-file/translations/ro-RO.js +0 -1
- package/components/input-file/translations/ru-RU.js +0 -1
- package/components/input-file/translations/sk-SK.js +0 -1
- package/components/input-file/translations/uk-UA.js +0 -1
- package/components/input-file/translations/zh-CN.js +0 -1
- package/components/input-iban/src/validators.js +6 -11
- package/components/input-iban/test/formatters.test.js +0 -3
- package/components/input-iban/test/lion-input-iban-integrations.test.js +0 -2
- package/components/input-iban/test/lion-input-iban.test.js +1 -9
- package/components/input-iban/test/parsers.test.js +0 -2
- package/components/input-iban/test/validators.test.js +0 -12
- package/components/input-iban/translations/bg-BG.js +0 -1
- package/components/input-iban/translations/cs-CZ.js +0 -1
- package/components/input-iban/translations/de-DE.js +0 -1
- package/components/input-iban/translations/en-AU.js +0 -1
- package/components/input-iban/translations/en-GB.js +0 -1
- package/components/input-iban/translations/en-US.js +0 -1
- package/components/input-iban/translations/es-ES.js +0 -1
- package/components/input-iban/translations/fr-BE.js +0 -1
- package/components/input-iban/translations/fr-FR.js +0 -1
- package/components/input-iban/translations/hu-HU.js +0 -1
- package/components/input-iban/translations/it-IT.js +0 -1
- package/components/input-iban/translations/nl-BE.js +0 -1
- package/components/input-iban/translations/nl-NL.js +0 -1
- package/components/input-iban/translations/pl-PL.js +0 -1
- package/components/input-iban/translations/ro-RO.js +0 -1
- package/components/input-iban/translations/ru-RU.js +0 -1
- package/components/input-iban/translations/sk-SK.js +0 -1
- package/components/input-iban/translations/uk-UA.js +0 -1
- package/components/input-range/src/LionInputRange.js +18 -19
- package/components/input-range/test/lion-input-range.test.js +23 -48
- package/components/input-range/translations/bg-BG.js +0 -1
- package/components/input-range/translations/cs-CZ.js +0 -1
- package/components/input-range/translations/de-DE.js +0 -1
- package/components/input-range/translations/en-AU.js +0 -1
- package/components/input-range/translations/en-GB.js +0 -1
- package/components/input-range/translations/en-PH.js +0 -1
- package/components/input-range/translations/en-US.js +0 -1
- package/components/input-range/translations/es-ES.js +0 -1
- package/components/input-range/translations/fr-BE.js +0 -1
- package/components/input-range/translations/fr-FR.js +0 -1
- package/components/input-range/translations/hu-HU.js +0 -1
- package/components/input-range/translations/it-IT.js +0 -1
- package/components/input-range/translations/nl-BE.js +0 -1
- package/components/input-range/translations/nl-NL.js +0 -1
- package/components/input-range/translations/pl-PL.js +0 -1
- package/components/input-range/translations/ro-RO.js +0 -1
- package/components/input-range/translations/ru-RU.js +0 -1
- package/components/input-range/translations/sk-SK.js +0 -1
- package/components/input-range/translations/uk-UA.js +0 -1
- package/components/input-range/translations/zh-CN.js +0 -1
- package/components/input-stepper/src/LionInputStepper.js +19 -38
- package/components/input-stepper/test/lion-input-stepper-integrations.test.js +0 -1
- package/components/input-stepper/test/lion-input-stepper.test.js +0 -1
- package/components/input-stepper/test-suites/lion-input-stepper.integration.suite.js +0 -2
- package/components/input-stepper/test-suites/lion-input-stepper.suite.js +56 -105
- package/components/input-stepper/translations/bg-BG.js +0 -1
- package/components/input-stepper/translations/cs-CZ.js +0 -1
- package/components/input-stepper/translations/de-DE.js +0 -1
- package/components/input-stepper/translations/en-AU.js +0 -1
- package/components/input-stepper/translations/en-GB.js +0 -1
- package/components/input-stepper/translations/en-US.js +0 -1
- package/components/input-stepper/translations/es-ES.js +0 -1
- package/components/input-stepper/translations/fr-BE.js +0 -1
- package/components/input-stepper/translations/fr-FR.js +0 -1
- package/components/input-stepper/translations/hu-HU.js +0 -1
- package/components/input-stepper/translations/it-IT.js +0 -1
- package/components/input-stepper/translations/nl-BE.js +0 -1
- package/components/input-stepper/translations/nl-NL.js +0 -1
- package/components/input-stepper/translations/pl-PL.js +0 -1
- package/components/input-stepper/translations/ro-RO.js +0 -1
- package/components/input-stepper/translations/ru-RU.js +0 -1
- package/components/input-stepper/translations/sk-SK.js +0 -1
- package/components/input-stepper/translations/uk-UA.js +0 -1
- package/components/input-tel/src/LionInputTel.js +53 -37
- package/components/input-tel/src/PhoneUtilManager.js +6 -4
- package/components/input-tel/src/formatters.js +12 -10
- package/components/input-tel/src/parsers.js +3 -3
- package/components/input-tel/src/preprocessors.js +15 -7
- package/components/input-tel/src/validators.js +4 -6
- package/components/input-tel/test/LionInputTel.test.js +4 -2
- package/components/input-tel/test/formatters.test.js +22 -10
- package/components/input-tel/test/parsers.test.js +127 -11
- package/components/input-tel/test/preprocessors.test.js +24 -13
- package/components/input-tel/test/validators.test.js +7 -14
- package/components/input-tel/test-helpers/mockPhoneUtilManager.js +20 -8
- package/components/input-tel/test-suites/LionInputTel.suite.js +33 -73
- package/components/input-tel/translations/bg-BG.js +0 -1
- package/components/input-tel/translations/cs-CZ.js +0 -1
- package/components/input-tel/translations/de-DE.js +0 -1
- package/components/input-tel/translations/en-AU.js +0 -1
- package/components/input-tel/translations/en-GB.js +0 -1
- package/components/input-tel/translations/en-US.js +0 -1
- package/components/input-tel/translations/es-ES.js +0 -1
- package/components/input-tel/translations/fr-BE.js +0 -1
- package/components/input-tel/translations/fr-FR.js +0 -1
- package/components/input-tel/translations/hu-HU.js +0 -1
- package/components/input-tel/translations/it-IT.js +0 -1
- package/components/input-tel/translations/nl-BE.js +0 -1
- package/components/input-tel/translations/nl-NL.js +0 -1
- package/components/input-tel/translations/pl-PL.js +0 -1
- package/components/input-tel/translations/ro-RO.js +0 -1
- package/components/input-tel/translations/ru-RU.js +0 -1
- package/components/input-tel/translations/sk-SK.js +0 -1
- package/components/input-tel/translations/uk-UA.js +0 -1
- package/components/input-tel-dropdown/src/LionInputTelDropdown.js +10 -28
- package/components/input-tel-dropdown/src/regionCodeToLocale.js +3 -1
- package/components/input-tel-dropdown/test/LionInputTelDropdown.test.js +31 -38
- package/components/input-tel-dropdown/test/regionCodeToLocale.test.js +0 -1
- package/components/input-tel-dropdown/test-helpers/mimicUserChangingDropdown.js +5 -1
- package/components/input-tel-dropdown/test-suites/LionInputTelDropdown--parentheses.suite.js +16 -11
- package/components/input-tel-dropdown/test-suites/LionInputTelDropdown.suite.js +54 -79
- package/components/listbox/src/LionListbox.js +5 -2
- package/components/listbox/src/LionOption.js +8 -7
- package/components/listbox/src/LionOptions.js +0 -3
- package/components/listbox/src/ListboxMixin.js +786 -820
- package/components/listbox/test/lion-listbox.test.js +0 -1
- package/components/listbox/test/lion-option.test.js +53 -64
- package/components/listbox/test/lion-options.test.js +3 -4
- package/components/listbox/test-helpers/getListboxMembers.js +6 -3
- package/components/listbox/test-suites/ListboxMixin.suite.js +101 -261
- package/components/localize/src/LocalizeManager.js +40 -40
- package/components/localize/src/LocalizeMixin.js +130 -157
- package/components/localize/src/date/formatDate.js +1 -5
- package/components/localize/src/date/getDateFormatBasedOnLocale.js +5 -3
- package/components/localize/src/date/getMonthNames.js +3 -5
- package/components/localize/src/date/getWeekdayNames.js +1 -5
- package/components/localize/src/date/parseDate.js +5 -20
- package/components/localize/src/date/utils/normalizeIntlDate.js +0 -7
- package/components/localize/src/getLocalizeManager.js +0 -3
- package/components/localize/src/number/formatNumber.js +3 -7
- package/components/localize/src/number/formatNumberToParts.js +52 -18
- package/components/localize/src/number/getCurrencyName.js +5 -5
- package/components/localize/src/number/getFractionDigits.js +4 -4
- package/components/localize/src/number/getSeparatorsFromNumber.js +1 -3
- package/components/localize/src/number/parseNumber.js +0 -3
- package/components/localize/src/number/utils/normalize-format-number-to-parts/forceAddGroupSeparators.js +0 -1
- package/components/localize/src/number/utils/normalize-format-number-to-parts/forceSpaceBetweenCurrencyCodeAndNumber.js +4 -1
- package/components/localize/test/LocalizeManager.test.js +385 -278
- package/components/localize/test/LocalizeMixin.test.js +28 -112
- package/components/localize/test/date/formatDate.test.js +18 -48
- package/components/localize/test/date/getDateFormatBasedOnLocale.test.js +0 -3
- package/components/localize/test/date/getMonthNames.test.js +27 -12
- package/components/localize/test/date/getWeekdayNames.test.js +93 -49
- package/components/localize/test/date/normalizeDateTime.test.js +0 -2
- package/components/localize/test/date/parseDate.test.js +12 -16
- package/components/localize/test/getLocalizeManager.test.js +0 -3
- package/components/localize/test/isLocalizeESModule.test.js +32 -13
- package/components/localize/test/localize.test.js +0 -4
- package/components/localize/test/number/formatNumber.test.js +215 -106
- package/components/localize/test/number/formatNumberToParts.test.js +31 -38
- package/components/localize/test/number/getCurrencyName.test.js +20 -6
- package/components/localize/test/number/getDecimalSeparator.test.js +5 -4
- package/components/localize/test/number/getFractionDigits.test.js +0 -2
- package/components/localize/test/number/getGroupSeparator.test.js +0 -2
- package/components/localize/test/number/getSeparatorsFromNumber.test.js +5 -3
- package/components/localize/test/number/parseNumber.test.js +123 -56
- package/components/localize/test/side-effect-free-entrypoint.test.js +0 -6
- package/components/localize/test-helpers/fake-imports.js +11 -6
- package/components/localize/test-helpers/localizeTearDown.js +0 -1
- package/components/menu/src/InteractiveListMixin.js +637 -638
- package/components/menu/src/LionMenu.js +46 -59
- package/components/menu/src/MoreButtonMenuMixin.js +215 -238
- package/components/menu/src/MultiLevelListMixin.js +240 -246
- package/components/menu/src/utils/isInView.js +0 -1
- package/components/menu/src/utils/listItemInteractions.js +4 -4
- package/components/menu/test/InteractiveListMixin.test.js +0 -1
- package/components/menu/test/MoreButtonMenuMixin.test.js +3 -2
- package/components/menu/test/MultiLevelListMixin.test.js +0 -1
- package/components/menu/test/lion-menu-interactions.test.js +0 -1
- package/components/menu/test/lion-menu.test.js +6 -2
- package/components/menu/test-helpers/mimicKeyPress.js +12 -2
- package/components/menu/test-suites/InteractiveListMixin.suite.js +4 -43
- package/components/menu/test-suites/LionMenu.suite.js +1 -8
- package/components/menu/test-suites/LionMenuInteractions.suite.js +22 -44
- package/components/menu/test-suites/MoreButtonMenuMixin.suite.js +34 -41
- package/components/menu/test-suites/MultiLevelListMixin.suite.js +5 -23
- package/components/overlays/src/ArrowMixin.js +111 -127
- package/components/overlays/src/OverlayController.js +172 -152
- package/components/overlays/src/OverlayMixin.js +64 -69
- package/components/overlays/src/OverlaysManager.js +30 -32
- package/components/overlays/src/configurations/visibility-trigger-partials/withClickInteraction.js +0 -1
- package/components/overlays/src/configurations/visibility-trigger-partials/withHoverInteraction.js +11 -11
- package/components/overlays/src/configurations/withBottomSheetConfig.js +12 -13
- package/components/overlays/src/configurations/withDropdownConfig.js +4 -2
- package/components/overlays/src/configurations/withModalDialogConfig.js +12 -13
- package/components/overlays/src/configurations/withPopoverConfig.js +27 -25
- package/components/overlays/src/configurations/withTooltipConfig.js +15 -13
- package/components/overlays/src/overlayDocumentStyle.js +1 -1
- package/components/overlays/src/overlayShadowDomStyle.js +0 -1
- package/components/overlays/src/singleton.js +0 -2
- package/components/overlays/src/utils/adopt-styles.js +18 -18
- package/components/overlays/src/utils/deep-contains.js +7 -6
- package/components/overlays/src/utils/get-focusable-elements.js +7 -10
- package/components/overlays/src/utils/inert-siblings.js +2 -4
- package/components/overlays/src/utils/is-equal-config.js +2 -3
- package/components/overlays/src/utils/is-visible.js +0 -1
- package/components/overlays/src/utils/simulate-tab.js +1 -4
- package/components/overlays/src/utils/sort-by-tabindex.js +2 -4
- package/components/overlays/test/ArrowMixin.test.js +18 -30
- package/components/overlays/test/OverlayController.test.js +406 -555
- package/components/overlays/test/OverlayMixin.test.js +0 -2
- package/components/overlays/test/OverlaysManager.test.js +30 -35
- package/components/overlays/test/global-positioning.test.js +6 -10
- package/components/overlays/test/invoker-compatibility.test.js +37 -0
- package/components/overlays/test/local-positioning.test.js +101 -103
- package/components/overlays/test/utils-tests/active-element.test.js +12 -27
- package/components/overlays/test/utils-tests/adopt-styles.test.js +25 -56
- package/components/overlays/test/utils-tests/deep-contains.test.js +73 -74
- package/components/overlays/test/utils-tests/get-focusable-elements.test.js +6 -23
- package/components/overlays/test/utils-tests/is-equal-config.test.js +32 -13
- package/components/overlays/test/utils-tests/visibility.test.js +44 -79
- package/components/overlays/test-helpers/createShadowHost.js +5 -3
- package/components/overlays/test-helpers/normalizeTransformStyle.js +2 -4
- package/components/overlays/test-suites/OverlayMixin.suite.js +152 -181
- package/components/overlays/test-suites/WithHoverInteraction.suite.js +96 -79
- package/components/overlays/translations/bg-BG.js +0 -1
- package/components/overlays/translations/cs-CZ.js +0 -1
- package/components/overlays/translations/de-DE.js +0 -1
- package/components/overlays/translations/en-AU.js +0 -1
- package/components/overlays/translations/en-GB.js +0 -1
- package/components/overlays/translations/en-US.js +0 -1
- package/components/overlays/translations/es-ES.js +0 -1
- package/components/overlays/translations/fr-BE.js +0 -1
- package/components/overlays/translations/fr-FR.js +0 -1
- package/components/overlays/translations/hu-HU.js +0 -1
- package/components/overlays/translations/it-IT.js +0 -1
- package/components/overlays/translations/nl-BE.js +0 -1
- package/components/overlays/translations/nl-NL.js +0 -1
- package/components/overlays/translations/pl-PL.js +0 -1
- package/components/overlays/translations/ro-RO.js +0 -1
- package/components/overlays/translations/ru-RU.js +0 -1
- package/components/overlays/translations/sk-SK.js +0 -1
- package/components/overlays/translations/tr-TR.js +0 -1
- package/components/overlays/translations/uk-UA.js +0 -1
- package/components/pagination/src/LionPagination.js +9 -12
- package/components/pagination/test/lion-pagination.test.js +18 -50
- package/components/progress-indicator/src/LionProgressIndicator.js +10 -12
- package/components/progress-indicator/test/lion-progress-indicator.test.js +1 -22
- package/components/radio-group/src/LionRadioGroup.js +1 -2
- package/components/radio-group/test/lion-radio-group-integrations.test.js +0 -1
- package/components/radio-group/test/lion-radio-group.test.js +27 -27
- package/components/radio-group/test/lion-radio-integrations.test.js +3 -2
- package/components/radio-group/test/lion-radio.test.js +30 -16
- package/components/select/src/LionSelect.js +12 -13
- package/components/select/test/lion-select.test.js +7 -12
- package/components/select-rich/src/LionSelectInvoker.js +18 -11
- package/components/select-rich/src/LionSelectRich.js +22 -44
- package/components/select-rich/test/demos.screenshots-test.js +40 -9
- package/components/select-rich/test/lion-select-invoker.test.js +26 -43
- package/components/select-rich/test/lion-select-listbox-suite-integration.test.js +3 -3
- package/components/select-rich/test/lion-select-rich-dialog-integration.test.js +4 -9
- package/components/select-rich/test/lion-select-rich-interaction.test.js +116 -116
- package/components/select-rich/test/lion-select-rich-upgrade.test.js +3 -7
- package/components/select-rich/test/lion-select-rich.test.js +153 -195
- package/components/select-rich/test-helpers/getSelectRichMembers.js +4 -1
- package/components/steps/src/LionStep.js +21 -12
- package/components/steps/src/LionSteps.js +25 -25
- package/components/steps/test/lion-step.test.js +18 -25
- package/components/steps/test/lion-steps.test.js +45 -78
- package/components/switch/src/LionSwitch.js +2 -7
- package/components/switch/src/LionSwitchButton.js +5 -6
- package/components/switch/test/lion-switch-button.test.js +16 -28
- package/components/switch/test/lion-switch.test.js +17 -31
- package/components/tabs/src/LionTabs.js +25 -28
- package/components/tabs/test/lion-tabs.test.js +156 -154
- package/components/textarea/src/LionTextarea.js +4 -23
- package/components/textarea/test/lion-textarea-integrations.test.js +0 -5
- package/components/textarea/test/lion-textarea.test.js +2 -28
- package/components/tooltip/src/LionTooltip.js +6 -6
- package/components/tooltip/test/lion-tooltip.test.js +75 -102
- package/components/validate-messages/src/getLocalizedMessage.js +8 -7
- package/components/validate-messages/src/loadDefaultFeedbackMessages.js +3 -1
- package/components/validate-messages/src/loadDefaultFeedbackMessagesNoSideEffects.js +9 -5
- package/components/validate-messages/src/per-entrypoint/loadComboboxMessagesNoSideEffects.js +5 -2
- package/components/validate-messages/src/per-entrypoint/loadFormCoreMessagesNoSideEffects.js +99 -35
- package/components/validate-messages/src/per-entrypoint/loadInputTelMessagesNoSideEffects.js +4 -3
- package/components/validate-messages/test/loadDefaultFeedbackMessages.test.js +5 -3
- package/components/validate-messages/test/loadDefaultFeedbackMessagesNoSideEffects.test.js +80 -45
- package/components/validate-messages/translations/bg-BG.js +0 -1
- package/components/validate-messages/translations/cs-CZ.js +0 -1
- package/components/validate-messages/translations/de-DE.js +0 -1
- package/components/validate-messages/translations/en-AU.js +0 -1
- package/components/validate-messages/translations/en-GB.js +0 -1
- package/components/validate-messages/translations/en-PH.js +0 -1
- package/components/validate-messages/translations/en-US.js +0 -1
- package/components/validate-messages/translations/es-ES.js +0 -1
- package/components/validate-messages/translations/fr-BE.js +0 -1
- package/components/validate-messages/translations/fr-FR.js +0 -1
- package/components/validate-messages/translations/hu-HU.js +0 -1
- package/components/validate-messages/translations/it-IT.js +0 -1
- package/components/validate-messages/translations/nl-BE.js +0 -1
- package/components/validate-messages/translations/nl-NL.js +0 -1
- package/components/validate-messages/translations/pl-PL.js +0 -1
- package/components/validate-messages/translations/ro-RO.js +0 -1
- package/components/validate-messages/translations/ru-RU.js +0 -1
- package/components/validate-messages/translations/sk-SK.js +0 -1
- package/components/validate-messages/translations/tr-TR.js +0 -1
- package/components/validate-messages/translations/uk-UA.js +0 -1
- package/custom-elements.json +229 -85
- package/dist-types/components/core/src/SlotMixin.d.ts +6 -1
- package/dist-types/components/core/src/SlotMixin.d.ts.map +1 -1
- package/dist-types/components/core/types/SlotMixinTypes.d.ts +5 -1
- package/dist-types/components/core/types/SlotMixinTypes.d.ts.map +1 -1
- package/dist-types/components/form-core/src/LionField.d.ts +3 -1
- package/dist-types/components/form-core/src/LionField.d.ts.map +1 -1
- package/dist-types/components/input-tel/src/LionInputTel.d.ts +6 -6
- package/dist-types/components/input-tel/src/LionInputTel.d.ts.map +1 -1
- package/dist-types/components/input-tel/src/PhoneUtilManager.d.ts +2 -2
- package/dist-types/components/input-tel/src/PhoneUtilManager.d.ts.map +1 -1
- package/dist-types/components/input-tel/src/formatters.d.ts +2 -2
- package/dist-types/components/input-tel/src/formatters.d.ts.map +1 -1
- package/dist-types/components/input-tel/src/preprocessors.d.ts +2 -2
- package/dist-types/components/input-tel/src/preprocessors.d.ts.map +1 -1
- package/dist-types/components/input-tel/test/validators.test.d.ts +1 -1
- package/dist-types/components/input-tel/test/validators.test.d.ts.map +1 -1
- package/dist-types/components/input-tel/test-helpers/mockPhoneUtilManager.d.ts +5 -0
- package/dist-types/components/input-tel/test-helpers/mockPhoneUtilManager.d.ts.map +1 -1
- package/dist-types/components/listbox/src/LionListbox.d.ts +2 -2
- package/dist-types/components/listbox/src/LionListbox.d.ts.map +1 -1
- package/dist-types/components/listbox/src/LionOption.d.ts +5 -2
- package/dist-types/components/listbox/src/LionOption.d.ts.map +1 -1
- package/dist-types/components/overlays/src/OverlayController.d.ts +3 -1
- package/dist-types/components/overlays/src/OverlayController.d.ts.map +1 -1
- package/dist-types/components/overlays/src/OverlayMixin.d.ts.map +1 -1
- package/dist-types/components/overlays/src/OverlaysManager.d.ts.map +1 -1
- package/dist-types/components/overlays/src/overlayDocumentStyle.d.ts.map +1 -1
- package/dist-types/components/overlays/test/invoker-compatibility.test.d.ts +3 -0
- package/dist-types/components/overlays/test/invoker-compatibility.test.d.ts.map +1 -0
- package/dist-types/components/select-rich/src/LionSelectInvoker.d.ts +3 -1
- package/dist-types/components/select-rich/src/LionSelectInvoker.d.ts.map +1 -1
- package/dist-types/components/select-rich/src/LionSelectRich.d.ts +6 -5
- package/dist-types/components/select-rich/src/LionSelectRich.d.ts.map +1 -1
- package/dist-types/tsconfig.tsbuildinfo +1 -1
- package/docs/components/accordion/overview.md +2 -2
- package/docs/components/accordion/reference.md +2 -2
- package/docs/components/accordion/use-cases.md +2 -2
- package/docs/components/button/examples.md +2 -2
- package/docs/components/button/extensions.md +2 -2
- package/docs/components/button/overview.md +2 -2
- package/docs/components/button/use-cases.md +2 -2
- package/docs/components/calendar/overview.md +2 -2
- package/docs/components/calendar/use-cases.md +2 -2
- package/docs/components/checkbox-group/overview.md +4 -4
- package/docs/components/checkbox-group/use-cases.md +2 -2
- package/docs/components/collapsible/examples.md +2 -2
- package/docs/components/collapsible/overview.md +3 -3
- package/docs/components/collapsible/use-cases.md +2 -2
- package/docs/components/combobox/api-table.md +1 -1
- package/docs/components/combobox/extensions.md +2 -2
- package/docs/components/combobox/overview.md +3 -3
- package/docs/components/combobox/use-cases.md +3 -3
- package/docs/components/dialog/overview.md +3 -3
- package/docs/components/dialog/use-cases.md +2 -2
- package/docs/components/drawer/overview.md +2 -2
- package/docs/components/drawer/use-cases.md +2 -2
- package/docs/components/fieldset/overview.md +7 -7
- package/docs/components/fieldset/use-cases.md +2 -2
- package/docs/components/form/overview.md +5 -5
- package/docs/components/form/use-cases.md +4 -4
- package/docs/components/icon/overview.md +2 -2
- package/docs/components/icon/use-cases.md +3 -3
- package/docs/components/input/overview.md +3 -3
- package/docs/components/input/use-cases.md +2 -2
- package/docs/components/input-amount/overview.md +5 -5
- package/docs/components/input-amount/use-cases.md +2 -2
- package/docs/components/input-amount-dropdown/use-cases.md +2 -2
- package/docs/components/input-date/overview.md +5 -5
- package/docs/components/input-date/use-cases.md +2 -2
- package/docs/components/input-datepicker/overview.md +7 -7
- package/docs/components/input-datepicker/use-cases.md +2 -2
- package/docs/components/input-email/overview.md +4 -4
- package/docs/components/input-email/use-cases.md +2 -2
- package/docs/components/input-file/overview.md +3 -3
- package/docs/components/input-file/use-cases.md +2 -2
- package/docs/components/input-iban/overview.md +4 -4
- package/docs/components/input-iban/use-cases.md +2 -2
- package/docs/components/input-range/overview.md +4 -4
- package/docs/components/input-range/use-cases.md +2 -2
- package/docs/components/input-stepper/overview.md +3 -3
- package/docs/components/input-stepper/use-cases.md +2 -2
- package/docs/components/input-tel/overview.md +3 -3
- package/docs/components/input-tel/use-cases.md +8 -8
- package/docs/components/input-tel-dropdown/extensions.md +2 -2
- package/docs/components/input-tel-dropdown/overview.md +3 -3
- package/docs/components/input-tel-dropdown/use-cases.md +2 -2
- package/docs/components/listbox/api-table.md +4 -4
- package/docs/components/listbox/overview.md +2 -2
- package/docs/components/listbox/use-cases.md +3 -3
- package/docs/components/menu/extensions.md +2 -2
- package/docs/components/menu/migration.md +2 -2
- package/docs/components/menu/overview.md +2 -2
- package/docs/components/menu/use-cases.md +1 -1
- package/docs/components/pagination/overview.md +2 -2
- package/docs/components/pagination/use-cases.md +2 -2
- package/docs/components/progress-indicator/examples.md +2 -2
- package/docs/components/progress-indicator/overview.md +2 -2
- package/docs/components/radio-group/overview.md +5 -5
- package/docs/components/radio-group/use-cases.md +2 -2
- package/docs/components/select/overview.md +2 -2
- package/docs/components/select/use-cases.md +3 -3
- package/docs/components/select-rich/api-table.md +1 -1
- package/docs/components/select-rich/examples.md +2 -2
- package/docs/components/select-rich/overview.md +2 -2
- package/docs/components/select-rich/use-cases.md +4 -4
- package/docs/components/steps/overview.md +2 -2
- package/docs/components/steps/use-cases.md +2 -2
- package/docs/components/switch/overview.md +2 -2
- package/docs/components/switch/reference.md +2 -2
- package/docs/components/switch/use-cases.md +2 -2
- package/docs/components/tabs/examples.md +3 -3
- package/docs/components/tabs/overview.md +2 -2
- package/docs/components/tabs/use-cases.md +2 -2
- package/docs/components/textarea/overview.md +2 -2
- package/docs/components/textarea/use-cases.md +2 -2
- package/docs/components/tooltip/examples.md +2 -2
- package/docs/components/tooltip/overview.md +2 -2
- package/docs/components/tooltip/use-cases.md +2 -2
- package/docs/fundamentals/index.md +4 -4
- package/docs/fundamentals/node-tools/babel-plugin-extend-docs/index.md +2 -2
- package/docs/fundamentals/node-tools/babel-plugin-extend-docs/overview.md +2 -2
- package/docs/fundamentals/node-tools/providence-analytics/index.md +2 -2
- package/docs/fundamentals/node-tools/providence-analytics/overview.md +2 -2
- package/docs/fundamentals/node-tools/publish-docs/index.md +2 -2
- package/docs/fundamentals/node-tools/publish-docs/overview.md +5 -5
- package/docs/fundamentals/node-tools/remark-extend/index.md +2 -2
- package/docs/fundamentals/node-tools/remark-extend/overview.md +2 -2
- package/docs/fundamentals/node-tools/rocket-preset-extend-lion-docs/index.md +2 -2
- package/docs/fundamentals/node-tools/rocket-preset-extend-lion-docs/overview.md +4 -4
- package/docs/fundamentals/rationales/TypeScript.md +62 -2
- package/docs/fundamentals/rationales/accessibility.md +5 -5
- package/docs/fundamentals/rationales/side-effects.md +2 -2
- package/docs/fundamentals/rationales/versioning.md +2 -2
- package/docs/fundamentals/systems/core/SlotMixin.md +3 -3
- package/docs/fundamentals/systems/core/index.md +2 -2
- package/docs/fundamentals/systems/core/overview.md +3 -3
- package/docs/fundamentals/systems/form/formatting-and-parsing.md +6 -6
- package/docs/fundamentals/systems/form/index.md +2 -2
- package/docs/fundamentals/systems/form/interaction-states.md +2 -2
- package/docs/fundamentals/systems/form/model-value.md +3 -3
- package/docs/fundamentals/systems/form/overview.md +30 -30
- package/docs/fundamentals/systems/form/styling.md +2 -2
- package/docs/fundamentals/systems/form/use-cases.md +2 -2
- package/docs/fundamentals/systems/form/validate.md +4 -4
- package/docs/fundamentals/systems/icon/index.md +2 -2
- package/docs/fundamentals/systems/icon/overview.md +2 -2
- package/docs/fundamentals/systems/localize/dates.md +2 -2
- package/docs/fundamentals/systems/localize/index.md +2 -2
- package/docs/fundamentals/systems/localize/numbers.md +2 -2
- package/docs/fundamentals/systems/localize/overview.md +6 -6
- package/docs/fundamentals/systems/localize/rationale.md +2 -2
- package/docs/fundamentals/systems/localize/text.md +2 -2
- package/docs/fundamentals/systems/localize/use-cases.md +2 -2
- package/docs/fundamentals/systems/overlays/_edge-cases.md +2 -2
- package/docs/fundamentals/systems/overlays/api-table.md +1 -1
- package/docs/fundamentals/systems/overlays/configuration.md +4 -4
- package/docs/fundamentals/systems/overlays/index.md +2 -2
- package/docs/fundamentals/systems/overlays/overview.md +7 -7
- package/docs/fundamentals/systems/overlays/rationale.md +2 -2
- package/docs/fundamentals/systems/overlays/use-cases.md +4 -4
- package/docs/fundamentals/tools/ajax/index.md +2 -2
- package/docs/fundamentals/tools/ajax/overview.md +2 -2
- package/docs/fundamentals/tools/ajax/use-cases.md +2 -2
- package/docs/fundamentals/tools/helpers/action-logger.md +2 -2
- package/docs/fundamentals/tools/helpers/index.md +2 -2
- package/docs/fundamentals/tools/helpers/overview.md +3 -3
- package/docs/fundamentals/tools/singleton-manager/example-complex/index.md +2 -2
- package/docs/fundamentals/tools/singleton-manager/example-fail/index.md +2 -2
- package/docs/fundamentals/tools/singleton-manager/example-success/index.md +2 -2
- package/docs/fundamentals/tools/singleton-manager/index.md +2 -2
- package/docs/fundamentals/tools/singleton-manager/overview.md +6 -6
- package/docs/guides/how-to/create-a-custom-field.md +7 -7
- package/docs/guides/how-to/create-a-form.md +6 -6
- package/docs/guides/how-to/extend-a-native-input.md +4 -4
- package/docs/guides/how-to/get-started.md +2 -2
- package/docs/guides/how-to/index.md +1 -1
- package/docs/guides/index.md +8 -8
- package/docs/guides/principles/definitions-and-terms.md +2 -2
- package/docs/guides/principles/index.md +5 -5
- package/docs/guides/principles/scoped-elements.md +2 -2
- package/docs/guides/principles/styling.md +3 -3
- package/docs/guides/principles/subclasser-apis.md +2 -2
- package/exports/define/lion-accordion.js +0 -1
- package/exports/define/lion-button-reset.js +0 -1
- package/exports/define/lion-button-submit.js +0 -1
- package/exports/define/lion-button.js +0 -1
- package/exports/define/lion-calendar.js +0 -1
- package/exports/define/lion-checkbox-group.js +0 -1
- package/exports/define/lion-checkbox-indeterminate.js +0 -1
- package/exports/define/lion-checkbox.js +0 -1
- package/exports/define/lion-collapsible.js +0 -1
- package/exports/define/lion-combobox.js +0 -1
- package/exports/define/lion-dialog.js +0 -1
- package/exports/define/lion-drawer.js +0 -1
- package/exports/define/lion-field.js +0 -1
- package/exports/define/lion-fieldset.js +0 -1
- package/exports/define/lion-form.js +0 -1
- package/exports/define/lion-icon.js +0 -1
- package/exports/define/lion-input-amount-dropdown.js +0 -1
- package/exports/define/lion-input-amount.js +0 -1
- package/exports/define/lion-input-date.js +0 -1
- package/exports/define/lion-input-datepicker.js +0 -1
- package/exports/define/lion-input-email.js +0 -1
- package/exports/define/lion-input-file.js +0 -1
- package/exports/define/lion-input-iban.js +0 -1
- package/exports/define/lion-input-range.js +0 -1
- package/exports/define/lion-input-stepper.js +0 -1
- package/exports/define/lion-input-tel-dropdown.js +0 -1
- package/exports/define/lion-input-tel.js +0 -1
- package/exports/define/lion-input.js +0 -1
- package/exports/define/lion-item.js +0 -1
- package/exports/define/lion-listbox.js +0 -1
- package/exports/define/lion-menu.js +0 -1
- package/exports/define/lion-menuitem.js +0 -1
- package/exports/define/lion-option.js +0 -1
- package/exports/define/lion-options.js +0 -1
- package/exports/define/lion-pagination.js +0 -1
- package/exports/define/lion-progress-indicator.js +0 -1
- package/exports/define/lion-radio-group.js +0 -1
- package/exports/define/lion-radio.js +0 -1
- package/exports/define/lion-select-invoker.js +0 -1
- package/exports/define/lion-select-rich.js +0 -1
- package/exports/define/lion-select.js +0 -1
- package/exports/define/lion-selected-file-list.js +0 -1
- package/exports/define/lion-step.js +0 -1
- package/exports/define/lion-steps.js +0 -1
- package/exports/define/lion-switch-button.js +0 -1
- package/exports/define/lion-switch.js +0 -1
- package/exports/define/lion-tabs.js +0 -1
- package/exports/define/lion-textarea.js +0 -1
- package/exports/define/lion-tooltip.js +0 -1
- package/exports/define/lion-validation-feedback.js +0 -1
- package/exports/define-helpers/sb-action-logger.js +0 -1
- package/exports/define-helpers/sb-locale-switcher.js +0 -1
- package/exports/form-core.js +0 -8
- package/exports/localize-no-side-effects.js +0 -1
- package/exports/localize.js +0 -2
- package/exports/overlays.js +0 -4
- package/generated/awesome-phonenumber/LICENSE +22 -0
- package/generated/awesome-phonenumber/LICENSE.closure-library +176 -0
- package/generated/awesome-phonenumber/LICENSE.libphonenumber +176 -0
- package/generated/awesome-phonenumber/checksums.json +6 -0
- package/generated/awesome-phonenumber/index-esm.mjs +817 -0
- package/generated/awesome-phonenumber/index.d.ts +227 -0
- package/generated/awesome-phonenumber/index.js +45 -0
- package/generated/awesome-phonenumber/lib/index.js +710 -0
- package/generated/awesome-phonenumber/package.json +9 -0
- package/generated/awesome-phonenumber/provenance.json +13 -0
- package/package.json +38 -15
- package/vscode.html-custom-data.json +5 -5
- package/web-types.json +1 -1
- package/vendor/README.md +0 -61
- package/vendor/awesome-phonenumber-7.9.0-tlouisse.libphonenumber-9.0.41.tgz +0 -0
|
@@ -2,7 +2,6 @@ import { LitElement } from 'lit';
|
|
|
2
2
|
import { expect, html, fixture as _fixture, unsafeStatic, defineCE } from '@open-wc/testing';
|
|
3
3
|
import { InteractiveListMixin } from '../src/InteractiveListMixin.js';
|
|
4
4
|
import { mimicKeyPress } from '../test-helpers/mimicKeyPress.js';
|
|
5
|
-
|
|
6
5
|
class InteractiveListClass extends InteractiveListMixin(LitElement) {}
|
|
7
6
|
|
|
8
7
|
/**
|
|
@@ -28,7 +27,7 @@ const supportedRoles = [
|
|
|
28
27
|
* @property {string} tagString
|
|
29
28
|
*/
|
|
30
29
|
|
|
31
|
-
const fixture = /** @type {(arg: TemplateResult) => Promise<LionMenu>} */
|
|
30
|
+
const fixture = /** @type {(arg: TemplateResult) => Promise<LionMenu>} */ _fixture;
|
|
32
31
|
|
|
33
32
|
/**
|
|
34
33
|
* @param {TestConfig} [customConfig]
|
|
@@ -37,15 +36,13 @@ export function runInteractiveListMixinSuite(customConfig) {
|
|
|
37
36
|
const cfg = {
|
|
38
37
|
tagString: customConfig?.tagString || defineCE(InteractiveListClass),
|
|
39
38
|
};
|
|
40
|
-
|
|
41
39
|
const { tagString } = cfg;
|
|
42
40
|
const tag = unsafeStatic(tagString);
|
|
43
|
-
|
|
44
41
|
describe('InteractiveListMixin', () => {
|
|
45
42
|
it(`supports items with role="${supportedRoles.join('|')}"`, async () => {
|
|
46
43
|
const el = await fixture(html`
|
|
47
44
|
<${tag} name="foo">
|
|
48
|
-
${supportedRoles.map(role => html` <div role="${role}"></div> `)}
|
|
45
|
+
${supportedRoles.map((role) => html` <div role="${role}"></div> `)}
|
|
49
46
|
</${tag}>
|
|
50
47
|
`);
|
|
51
48
|
// @ts-ignore - test element with InteractiveListMixin properties
|
|
@@ -55,7 +52,6 @@ export function runInteractiveListMixinSuite(customConfig) {
|
|
|
55
52
|
expect(el.listItems[i].getAttribute('role')).to.equal(role);
|
|
56
53
|
});
|
|
57
54
|
});
|
|
58
|
-
|
|
59
55
|
it('moves elements to a private [slot=list] for optimal DX and a11y', async () => {
|
|
60
56
|
const el = await fixture(html`
|
|
61
57
|
<${tag} name="foo">
|
|
@@ -64,7 +60,7 @@ export function runInteractiveListMixinSuite(customConfig) {
|
|
|
64
60
|
</${tag}>
|
|
65
61
|
`);
|
|
66
62
|
// @ts-ignore - test element with InteractiveListMixin properties
|
|
67
|
-
const listSlotNode = Array.from(el.children).find(c => c.slot === 'list');
|
|
63
|
+
const listSlotNode = Array.from(el.children).find((c) => c.slot === 'list');
|
|
68
64
|
// @ts-ignore - accessing children property
|
|
69
65
|
const listItemEls = Array.from(listSlotNode.children);
|
|
70
66
|
// @ts-ignore - test element with InteractiveListMixin properties
|
|
@@ -72,9 +68,7 @@ export function runInteractiveListMixinSuite(customConfig) {
|
|
|
72
68
|
// @ts-ignore - test element with InteractiveListMixin properties
|
|
73
69
|
expect(listItemEls.includes(el.listItems[1])).to.be.true;
|
|
74
70
|
});
|
|
75
|
-
|
|
76
71
|
it('inherits from DisclosureMixin', async () => {});
|
|
77
|
-
|
|
78
72
|
describe('Active mode', async () => {
|
|
79
73
|
it('supports "activedescendant" pattern', async () => {
|
|
80
74
|
const el = await fixture(html`
|
|
@@ -86,7 +80,7 @@ export function runInteractiveListMixinSuite(customConfig) {
|
|
|
86
80
|
// @ts-ignore - test element with InteractiveListMixin properties
|
|
87
81
|
el.checkedIndex = 0;
|
|
88
82
|
// @ts-ignore - test element with InteractiveListMixin properties
|
|
89
|
-
const listSlotNode = Array.from(el.children).find(c => c.slot === 'list');
|
|
83
|
+
const listSlotNode = Array.from(el.children).find((c) => c.slot === 'list');
|
|
90
84
|
|
|
91
85
|
// @ts-ignore - test element with InteractiveListMixin properties
|
|
92
86
|
// @ts-ignore - test element with InteractiveListMixin properties
|
|
@@ -98,7 +92,6 @@ export function runInteractiveListMixinSuite(customConfig) {
|
|
|
98
92
|
el.activeIndex = 1;
|
|
99
93
|
expect(listSlotNode?.hasAttribute('aria-activedescendant')).to.be.true;
|
|
100
94
|
});
|
|
101
|
-
|
|
102
95
|
it('supports "roving-tabindex" pattern', async () => {
|
|
103
96
|
const el = await fixture(html`
|
|
104
97
|
<${tag} name="foo" ._activeMode="${'roving-tabindex'}">
|
|
@@ -127,7 +120,6 @@ export function runInteractiveListMixinSuite(customConfig) {
|
|
|
127
120
|
expect(document.activeElement).to.equal(el.listItems[1]);
|
|
128
121
|
});
|
|
129
122
|
});
|
|
130
|
-
|
|
131
123
|
describe('default selected', () => {
|
|
132
124
|
it('sets the checkedIndex to 0 by default when hasNoDefaultSelected is false', async () => {
|
|
133
125
|
const el = await fixture(html`
|
|
@@ -139,7 +131,6 @@ export function runInteractiveListMixinSuite(customConfig) {
|
|
|
139
131
|
expect(el.checkedIndex).to.equal(0);
|
|
140
132
|
}
|
|
141
133
|
});
|
|
142
|
-
|
|
143
134
|
it('sets the checkedIndex to -1 when hasNoDefaultSelected is true', async () => {
|
|
144
135
|
const el = await fixture(html`
|
|
145
136
|
<${tag} has-no-default-selected>
|
|
@@ -149,14 +140,12 @@ export function runInteractiveListMixinSuite(customConfig) {
|
|
|
149
140
|
expect(el.checkedIndex).to.equal(-1);
|
|
150
141
|
});
|
|
151
142
|
});
|
|
152
|
-
|
|
153
143
|
describe('Programmatic interaction', () => {
|
|
154
144
|
// If we have the item line directly in the fixture the linting rule lit-a11y/role-has-required-aria-attrs
|
|
155
145
|
// will fail. Inside our code we set the required aria attributes, but the linter doesn't know that.
|
|
156
146
|
const item = /** @param {number} i, @param {string} role */ (i, role) => html`
|
|
157
147
|
<div role="${role}" id="item${i}">Item ${i}</div>
|
|
158
148
|
`;
|
|
159
|
-
|
|
160
149
|
it('set checked state sets aria-current attribute with role="listitem"', async () => {
|
|
161
150
|
const el = await fixture(html`
|
|
162
151
|
<${tag}>
|
|
@@ -170,7 +159,6 @@ export function runInteractiveListMixinSuite(customConfig) {
|
|
|
170
159
|
el.setCheckedIndex(0);
|
|
171
160
|
expect(item1.getAttribute('aria-current')).to.equal('false');
|
|
172
161
|
});
|
|
173
|
-
|
|
174
162
|
it('set checked state sets aria-selected attribute with role="option"', async () => {
|
|
175
163
|
const el = await fixture(html`
|
|
176
164
|
<${tag}>
|
|
@@ -180,14 +168,11 @@ export function runInteractiveListMixinSuite(customConfig) {
|
|
|
180
168
|
`);
|
|
181
169
|
const item1 = el.listItems[1];
|
|
182
170
|
expect(item1.getAttribute('aria-selected')).to.equal('false');
|
|
183
|
-
|
|
184
171
|
el.setCheckedIndex(1);
|
|
185
172
|
expect(item1.getAttribute('aria-selected')).to.equal('true');
|
|
186
|
-
|
|
187
173
|
el.setCheckedIndex(0);
|
|
188
174
|
expect(item1.getAttribute('aria-selected')).to.equal('false');
|
|
189
175
|
});
|
|
190
|
-
|
|
191
176
|
it('set checked state sets aria-selected attribute with role="treeitem"', async () => {
|
|
192
177
|
const el = await fixture(html`
|
|
193
178
|
<${tag}>
|
|
@@ -202,7 +187,6 @@ export function runInteractiveListMixinSuite(customConfig) {
|
|
|
202
187
|
el.setCheckedIndex(0);
|
|
203
188
|
expect(item1.getAttribute('aria-selected')).to.equal('false');
|
|
204
189
|
});
|
|
205
|
-
|
|
206
190
|
it('set checked state sets aria-current attribute with role="menuitem"', async () => {
|
|
207
191
|
const el = await fixture(html`
|
|
208
192
|
<${tag}>
|
|
@@ -216,7 +200,6 @@ export function runInteractiveListMixinSuite(customConfig) {
|
|
|
216
200
|
el.setCheckedIndex(0);
|
|
217
201
|
expect(item1.getAttribute('aria-current')).to.equal('false');
|
|
218
202
|
});
|
|
219
|
-
|
|
220
203
|
it('set checked state sets aria-checked attribute with role="menuitemradio"', async () => {
|
|
221
204
|
const el = await fixture(html`
|
|
222
205
|
<${tag}>
|
|
@@ -230,7 +213,6 @@ export function runInteractiveListMixinSuite(customConfig) {
|
|
|
230
213
|
el.setCheckedIndex(0);
|
|
231
214
|
expect(item1.getAttribute('aria-checked')).to.equal('false');
|
|
232
215
|
});
|
|
233
|
-
|
|
234
216
|
it('set checked state sets aria-checked attribute with role="menuitemcheckbox"', async () => {
|
|
235
217
|
const el = await fixture(html`
|
|
236
218
|
<${tag} multiple>
|
|
@@ -245,7 +227,6 @@ export function runInteractiveListMixinSuite(customConfig) {
|
|
|
245
227
|
// As this is multiple choice it doesn't unset the checked state
|
|
246
228
|
expect(item1.getAttribute('aria-checked')).to.equal('true');
|
|
247
229
|
});
|
|
248
|
-
|
|
249
230
|
it('can set checked state to "page" for role="listitem"', async () => {
|
|
250
231
|
const el = await fixture(html`
|
|
251
232
|
<${tag}>
|
|
@@ -259,7 +240,6 @@ export function runInteractiveListMixinSuite(customConfig) {
|
|
|
259
240
|
el.setCheckedIndex(0);
|
|
260
241
|
expect(item1.getAttribute('aria-current')).to.equal('false');
|
|
261
242
|
});
|
|
262
|
-
|
|
263
243
|
it('can set checked state to "mixed" for role="menuitemcheckbox"', async () => {
|
|
264
244
|
const el = await fixture(html`
|
|
265
245
|
<${tag} multiple>
|
|
@@ -275,7 +255,6 @@ export function runInteractiveListMixinSuite(customConfig) {
|
|
|
275
255
|
el.setCheckedIndex(0);
|
|
276
256
|
expect(item1.getAttribute('aria-checked')).to.equal('mixed');
|
|
277
257
|
});
|
|
278
|
-
|
|
279
258
|
it('does not allow to set checkedIndex or activeIndex to be out of bound', async () => {
|
|
280
259
|
const el = await fixture(html`
|
|
281
260
|
<${tag} has-no-default-selected>
|
|
@@ -288,7 +267,6 @@ export function runInteractiveListMixinSuite(customConfig) {
|
|
|
288
267
|
}).to.not.throw();
|
|
289
268
|
expect(el.checkedIndex).to.equal(-1);
|
|
290
269
|
});
|
|
291
|
-
|
|
292
270
|
it('unsets checked on other options when option becomes checked', async () => {
|
|
293
271
|
const el = await fixture(html`
|
|
294
272
|
<${tag}>
|
|
@@ -305,7 +283,6 @@ export function runInteractiveListMixinSuite(customConfig) {
|
|
|
305
283
|
expect(listItems[1].hasAttribute('checked')).to.be.true;
|
|
306
284
|
});
|
|
307
285
|
});
|
|
308
|
-
|
|
309
286
|
it('sets aria-current="page" when the location href matches the item href', async () => {
|
|
310
287
|
const el = await fixture(html`
|
|
311
288
|
<${tag}>
|
|
@@ -341,7 +318,6 @@ export function runInteractiveListMixinSuite(customConfig) {
|
|
|
341
318
|
<a href="#foobar">Item 2</a>
|
|
342
319
|
</div>
|
|
343
320
|
`;
|
|
344
|
-
|
|
345
321
|
it('uses "block" as the default axis and navigates vertically', async () => {
|
|
346
322
|
const el = await fixture(html`<${tag}>${itemTemplate}</${tag}>`);
|
|
347
323
|
expect(el.axis).to.equal('block');
|
|
@@ -354,7 +330,6 @@ export function runInteractiveListMixinSuite(customConfig) {
|
|
|
354
330
|
mimicKeyPress(_listNode, 'ArrowRight');
|
|
355
331
|
expect(el.activeIndex).to.equal(1);
|
|
356
332
|
});
|
|
357
|
-
|
|
358
333
|
it('navigates horizontally on axis="inline"', async () => {
|
|
359
334
|
const el = await fixture(html`<${tag} axis="inline">${itemTemplate}</${tag}>`);
|
|
360
335
|
expect(el.axis).to.equal('inline');
|
|
@@ -368,14 +343,12 @@ export function runInteractiveListMixinSuite(customConfig) {
|
|
|
368
343
|
mimicKeyPress(_listNode, 'ArrowDown');
|
|
369
344
|
expect(el.activeIndex).to.equal(1);
|
|
370
345
|
});
|
|
371
|
-
|
|
372
346
|
it('reflects the axis property to the attribute', async () => {
|
|
373
347
|
const el = await fixture(html`<${tag}>${itemTemplate}</${tag}>`);
|
|
374
348
|
el.axis = 'inline';
|
|
375
349
|
await el.updateComplete;
|
|
376
350
|
expect(el.getAttribute('axis')).to.equal('inline');
|
|
377
351
|
});
|
|
378
|
-
|
|
379
352
|
it('wraps around at the first/last item when "wrap" is set', async () => {
|
|
380
353
|
const el = await fixture(html`<${tag} wrap>${itemTemplate}</${tag}>`);
|
|
381
354
|
expect(el.wrap).to.be.true;
|
|
@@ -386,7 +359,6 @@ export function runInteractiveListMixinSuite(customConfig) {
|
|
|
386
359
|
mimicKeyPress(_listNode, 'ArrowDown');
|
|
387
360
|
expect(el.activeIndex).to.equal(0);
|
|
388
361
|
});
|
|
389
|
-
|
|
390
362
|
it('does not wrap around when "wrap" is not set', async () => {
|
|
391
363
|
const el = await fixture(html`<${tag}>${itemTemplate}</${tag}>`);
|
|
392
364
|
expect(el.wrap).to.be.false;
|
|
@@ -397,7 +369,6 @@ export function runInteractiveListMixinSuite(customConfig) {
|
|
|
397
369
|
mimicKeyPress(_listNode, 'ArrowDown');
|
|
398
370
|
expect(el.activeIndex).to.equal(2);
|
|
399
371
|
});
|
|
400
|
-
|
|
401
372
|
it('applies "wrap" when it changes after the first render', async () => {
|
|
402
373
|
const el = await fixture(html`<${tag}>${itemTemplate}</${tag}>`);
|
|
403
374
|
expect(el.wrap).to.be.false;
|
|
@@ -406,7 +377,6 @@ export function runInteractiveListMixinSuite(customConfig) {
|
|
|
406
377
|
expect(el.wrap).to.be.true;
|
|
407
378
|
});
|
|
408
379
|
});
|
|
409
|
-
|
|
410
380
|
describe('Interactions', () => {
|
|
411
381
|
describe('Keyboard navigation', () => {
|
|
412
382
|
it('navigates between items on [ArrowDown] [ArrowUp] keys', async () => {
|
|
@@ -429,7 +399,6 @@ export function runInteractiveListMixinSuite(customConfig) {
|
|
|
429
399
|
|
|
430
400
|
// Normalize
|
|
431
401
|
el.activeIndex = 0;
|
|
432
|
-
|
|
433
402
|
mimicKeyPress(_listNode, 'ArrowDown');
|
|
434
403
|
expect(el.activeIndex).to.be.equal(1);
|
|
435
404
|
mimicKeyPress(_listNode, 'ArrowDown');
|
|
@@ -437,7 +406,6 @@ export function runInteractiveListMixinSuite(customConfig) {
|
|
|
437
406
|
mimicKeyPress(_listNode, 'ArrowUp');
|
|
438
407
|
expect(el.activeIndex).to.be.equal(1);
|
|
439
408
|
});
|
|
440
|
-
|
|
441
409
|
it('navigates between items on [ArrowRight] [ArrowLeft] keys when axis is "inline" and _activeMode="tabbable-disclosure"', async () => {
|
|
442
410
|
const el = await fixture(html`
|
|
443
411
|
<${tag} axis="inline">
|
|
@@ -459,7 +427,6 @@ export function runInteractiveListMixinSuite(customConfig) {
|
|
|
459
427
|
|
|
460
428
|
// Normalize
|
|
461
429
|
el.activeIndex = 0;
|
|
462
|
-
|
|
463
430
|
mimicKeyPress(_listNode, 'ArrowRight');
|
|
464
431
|
expect(el.activeIndex).to.be.equal(1);
|
|
465
432
|
mimicKeyPress(_listNode, 'ArrowRight');
|
|
@@ -467,7 +434,6 @@ export function runInteractiveListMixinSuite(customConfig) {
|
|
|
467
434
|
mimicKeyPress(_listNode, 'ArrowLeft');
|
|
468
435
|
expect(el.activeIndex).to.be.equal(1);
|
|
469
436
|
});
|
|
470
|
-
|
|
471
437
|
it('stops navigation by default at end of option list', async () => {
|
|
472
438
|
const el = await fixture(html`
|
|
473
439
|
<${tag}>
|
|
@@ -488,15 +454,12 @@ export function runInteractiveListMixinSuite(customConfig) {
|
|
|
488
454
|
|
|
489
455
|
// Normalize
|
|
490
456
|
el.activeIndex = 0;
|
|
491
|
-
|
|
492
457
|
mimicKeyPress(_listNode, 'ArrowUp');
|
|
493
458
|
expect(el.activeIndex).to.be.equal(0);
|
|
494
|
-
|
|
495
459
|
el.activeIndex = 2;
|
|
496
460
|
mimicKeyPress(_listNode, 'ArrowDown');
|
|
497
461
|
expect(el.activeIndex).to.be.equal(2);
|
|
498
462
|
});
|
|
499
|
-
|
|
500
463
|
it('navigates to first and last option with [Home] and [End] keys', async () => {
|
|
501
464
|
const el = await fixture(html`
|
|
502
465
|
<${tag} axis="inline">
|
|
@@ -517,7 +480,6 @@ export function runInteractiveListMixinSuite(customConfig) {
|
|
|
517
480
|
|
|
518
481
|
// Normalize
|
|
519
482
|
el.activeIndex = 2;
|
|
520
|
-
|
|
521
483
|
mimicKeyPress(_listNode, 'Home');
|
|
522
484
|
expect(el.activeIndex).to.equal(0);
|
|
523
485
|
mimicKeyPress(_listNode, 'End');
|
|
@@ -525,7 +487,6 @@ export function runInteractiveListMixinSuite(customConfig) {
|
|
|
525
487
|
});
|
|
526
488
|
});
|
|
527
489
|
});
|
|
528
|
-
|
|
529
490
|
describe('Widget extensions', () => {
|
|
530
491
|
it('can be extended to [role=listbox]', async () => {});
|
|
531
492
|
it('can be extended to [role=menu]', async () => {});
|
|
@@ -9,7 +9,7 @@ import { LionMenu } from '../src/LionMenu.js';
|
|
|
9
9
|
* @property {string} tagString
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
const fixture = /** @type {(arg: TemplateResult) => Promise<LionMenu>} */
|
|
12
|
+
const fixture = /** @type {(arg: TemplateResult) => Promise<LionMenu>} */ _fixture;
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* @param {TestConfig} [customConfig]
|
|
@@ -18,10 +18,8 @@ export function runLionMenuSuite(customConfig) {
|
|
|
18
18
|
const cfg = {
|
|
19
19
|
tagString: customConfig?.tagString || defineCE(LionMenu),
|
|
20
20
|
};
|
|
21
|
-
|
|
22
21
|
const { tagString } = cfg;
|
|
23
22
|
const tag = unsafeStatic(tagString);
|
|
24
|
-
|
|
25
23
|
describe('LionMenu', () => {
|
|
26
24
|
it('sets the correct role to the listNode', async () => {
|
|
27
25
|
const el = await fixture(html`
|
|
@@ -34,11 +32,9 @@ export function runLionMenuSuite(customConfig) {
|
|
|
34
32
|
</div>
|
|
35
33
|
</${tag}>
|
|
36
34
|
`);
|
|
37
|
-
|
|
38
35
|
const listNode = el.querySelector('[slot="list"]');
|
|
39
36
|
expect(listNode?.getAttribute('role')).to.equal('menu');
|
|
40
37
|
});
|
|
41
|
-
|
|
42
38
|
it('sets the correct role to the listNode when activeMode is tabbable-disclosure', async () => {
|
|
43
39
|
const el = await fixture(html`
|
|
44
40
|
<${tag} ._activeMode=${'tabbable-disclosure'}>
|
|
@@ -53,7 +49,6 @@ export function runLionMenuSuite(customConfig) {
|
|
|
53
49
|
const listNode = el.querySelector('[slot="list"]');
|
|
54
50
|
expect(listNode?.getAttribute('role')).to.equal('list');
|
|
55
51
|
});
|
|
56
|
-
|
|
57
52
|
it('sets the correct roles when it is a bar', async () => {
|
|
58
53
|
const el = await fixture(html`
|
|
59
54
|
<${tag}>
|
|
@@ -65,7 +60,6 @@ export function runLionMenuSuite(customConfig) {
|
|
|
65
60
|
</div>
|
|
66
61
|
</${tag}>
|
|
67
62
|
`);
|
|
68
|
-
|
|
69
63
|
el._listRole = 'menu';
|
|
70
64
|
expect(el._listRole).to.equal('menu');
|
|
71
65
|
expect(el.axis).to.equal('block');
|
|
@@ -75,7 +69,6 @@ export function runLionMenuSuite(customConfig) {
|
|
|
75
69
|
expect(el._listRole).to.equal('menubar');
|
|
76
70
|
expect(el.axis).to.equal('inline');
|
|
77
71
|
});
|
|
78
|
-
|
|
79
72
|
describe('Programmatic interaction', () => {
|
|
80
73
|
it('allows groups within one menu level', async () => {
|
|
81
74
|
const el = await fixture(html`
|
|
@@ -5,7 +5,6 @@ import { useFakeTimers } from 'sinon';
|
|
|
5
5
|
import { css } from 'lit';
|
|
6
6
|
import { getDeepActiveElement } from '@lion/ui/overlays.js';
|
|
7
7
|
import { LionMenu } from '../src/LionMenu.js';
|
|
8
|
-
|
|
9
8
|
const l2Style = css`
|
|
10
9
|
[level='2'] > [slot='list'] {
|
|
11
10
|
position: absolute;
|
|
@@ -18,7 +17,6 @@ const l2Style = css`
|
|
|
18
17
|
box-sizing: border-box;
|
|
19
18
|
}
|
|
20
19
|
`;
|
|
21
|
-
|
|
22
20
|
const config = {
|
|
23
21
|
l1: {
|
|
24
22
|
isBar: true,
|
|
@@ -44,31 +42,29 @@ const config = {
|
|
|
44
42
|
},
|
|
45
43
|
},
|
|
46
44
|
};
|
|
47
|
-
|
|
48
45
|
export function runLionMenuInteractionsSuite({ klass = LionMenu } = {}) {
|
|
49
46
|
const tagString = defineCE(class extends klass {});
|
|
50
47
|
const tag = unsafeStatic(tagString);
|
|
51
|
-
|
|
52
48
|
describe('LionMenu interactions', () => {
|
|
53
49
|
/** @type {import('sinon').SinonFakeTimers | null} */
|
|
54
50
|
let clock = null;
|
|
55
51
|
|
|
56
52
|
/** @param {LionMenu} el */
|
|
57
|
-
const isMoreButtonMenuShown = el => {
|
|
53
|
+
const isMoreButtonMenuShown = (el) => {
|
|
58
54
|
const menu = el.querySelector('[data-more-button-menu]');
|
|
59
55
|
return menu ? getComputedStyle(menu).width !== '0px' : false;
|
|
60
56
|
};
|
|
61
57
|
|
|
62
58
|
/** @param {LionMenu} el */
|
|
63
|
-
const getMoreButton = el =>
|
|
64
|
-
/** @type {HTMLElement | null} */
|
|
59
|
+
const getMoreButton = (el) =>
|
|
60
|
+
/** @type {HTMLElement | null} */ el.querySelector('[data-more-button]');
|
|
65
61
|
|
|
66
62
|
/** @param {LionMenu} el */
|
|
67
|
-
const isAnyL2MenuShown = el =>
|
|
68
|
-
Array.from(el.querySelectorAll('[level="2"]')).some(menu => menu.hasAttribute('opened'));
|
|
63
|
+
const isAnyL2MenuShown = (el) =>
|
|
64
|
+
Array.from(el.querySelectorAll('[level="2"]')).some((menu) => menu.hasAttribute('opened'));
|
|
69
65
|
|
|
70
66
|
/** @param {LionMenu} el */
|
|
71
|
-
const focusLastVisibleItemInMainMenu = async el => {
|
|
67
|
+
const focusLastVisibleItemInMainMenu = async (el) => {
|
|
72
68
|
const moreButton = el.querySelector('[data-more-button]');
|
|
73
69
|
const previousElement = moreButton?.parentElement?.previousElementSibling;
|
|
74
70
|
const anchor = previousElement?.querySelector('a');
|
|
@@ -77,7 +73,6 @@ export function runLionMenuInteractionsSuite({ klass = LionMenu } = {}) {
|
|
|
77
73
|
}
|
|
78
74
|
await aTimeout(0);
|
|
79
75
|
};
|
|
80
|
-
|
|
81
76
|
const hitShiftTab = async () => {
|
|
82
77
|
await sendKeys({
|
|
83
78
|
down: 'Shift',
|
|
@@ -95,7 +90,6 @@ export function runLionMenuInteractionsSuite({ klass = LionMenu } = {}) {
|
|
|
95
90
|
*/
|
|
96
91
|
function getCoordinates(element) {
|
|
97
92
|
const { x, y, height } = element.getBoundingClientRect();
|
|
98
|
-
|
|
99
93
|
return {
|
|
100
94
|
x: Math.floor(x + window.pageXOffset),
|
|
101
95
|
y: Math.floor(y + window.pageYOffset + height / 2),
|
|
@@ -109,19 +103,22 @@ export function runLionMenuInteractionsSuite({ klass = LionMenu } = {}) {
|
|
|
109
103
|
* events and otherwise we need to emit those events programmatically
|
|
110
104
|
* @param {LionMenu} el
|
|
111
105
|
*/
|
|
112
|
-
const clickOnMoreButton = async el => {
|
|
106
|
+
const clickOnMoreButton = async (el) => {
|
|
113
107
|
const moreButton = getMoreButton(el);
|
|
114
108
|
if (!moreButton) {
|
|
115
109
|
return;
|
|
116
110
|
}
|
|
117
111
|
const { x, y } = getCoordinates(moreButton);
|
|
118
|
-
await sendMouse({
|
|
112
|
+
await sendMouse({
|
|
113
|
+
type: 'click',
|
|
114
|
+
position: [x, y],
|
|
115
|
+
});
|
|
119
116
|
clock?.tick(100);
|
|
120
117
|
await aTimeout(0);
|
|
121
118
|
};
|
|
122
119
|
|
|
123
120
|
/** @param {LionMenu} el */
|
|
124
|
-
const waitResizeEventDebounce = async el => {
|
|
121
|
+
const waitResizeEventDebounce = async (el) => {
|
|
125
122
|
await el.updateComplete;
|
|
126
123
|
// wait for resize event debouncer
|
|
127
124
|
clock?.tick(55);
|
|
@@ -137,7 +134,7 @@ export function runLionMenuInteractionsSuite({ klass = LionMenu } = {}) {
|
|
|
137
134
|
};
|
|
138
135
|
|
|
139
136
|
/** @param {LionMenu} el */
|
|
140
|
-
const getDirectListItemsUnderMoreButtonMenu = el => [
|
|
137
|
+
const getDirectListItemsUnderMoreButtonMenu = (el) => [
|
|
141
138
|
...Array.from(el.querySelectorAll('[data-more-button-menu] > [role="listitem"]')),
|
|
142
139
|
];
|
|
143
140
|
|
|
@@ -194,12 +191,10 @@ export function runLionMenuInteractionsSuite({ klass = LionMenu } = {}) {
|
|
|
194
191
|
${l2Style}
|
|
195
192
|
</style>
|
|
196
193
|
`);
|
|
197
|
-
|
|
198
|
-
const hybridEl = /** @type {LionMenu} */ (el);
|
|
194
|
+
const hybridEl = /** @type {LionMenu} */ el;
|
|
199
195
|
await waitResizeEventDebounce(hybridEl);
|
|
200
196
|
return hybridEl;
|
|
201
197
|
};
|
|
202
|
-
|
|
203
198
|
beforeEach(() => {
|
|
204
199
|
clock = useFakeTimers({
|
|
205
200
|
shouldAdvanceTime: true,
|
|
@@ -209,7 +204,6 @@ export function runLionMenuInteractionsSuite({ klass = LionMenu } = {}) {
|
|
|
209
204
|
clock?.restore();
|
|
210
205
|
await resetMouse();
|
|
211
206
|
});
|
|
212
|
-
|
|
213
207
|
it(`[
|
|
214
208
|
{
|
|
215
209
|
action: 'Click on More button',
|
|
@@ -227,7 +221,8 @@ export function runLionMenuInteractionsSuite({ klass = LionMenu } = {}) {
|
|
|
227
221
|
const el = await getFixture();
|
|
228
222
|
expect(isAnyL2MenuShown(el)).to.be.false;
|
|
229
223
|
await clickOnMoreButton(el);
|
|
230
|
-
/** @type {HTMLButtonElement | null} */
|
|
224
|
+
/** @type {HTMLButtonElement | null} */
|
|
225
|
+
el.querySelector('#item4 > button')?.click();
|
|
231
226
|
await waitAfterMoreButtonMenuHides();
|
|
232
227
|
expect(isMoreButtonMenuShown(el)).to.be.false;
|
|
233
228
|
expect(isAnyL2MenuShown(el)).to.be.true;
|
|
@@ -235,7 +230,6 @@ export function runLionMenuInteractionsSuite({ klass = LionMenu } = {}) {
|
|
|
235
230
|
expect(isAnyL2MenuShown(el)).to.be.false;
|
|
236
231
|
expect(isMoreButtonMenuShown(el)).to.be.true;
|
|
237
232
|
});
|
|
238
|
-
|
|
239
233
|
it(`[
|
|
240
234
|
{
|
|
241
235
|
action: 'Focus last visible L1 item in the main menu',
|
|
@@ -255,14 +249,12 @@ export function runLionMenuInteractionsSuite({ klass = LionMenu } = {}) {
|
|
|
255
249
|
await sendKeys({
|
|
256
250
|
press: 'Tab',
|
|
257
251
|
});
|
|
258
|
-
|
|
259
252
|
expect(isMoreButtonMenuShown(el)).to.be.true;
|
|
260
253
|
|
|
261
254
|
// make sure the first L1 inside More button menu is focused
|
|
262
255
|
const firstItemInMoreMenu = getDirectListItemsUnderMoreButtonMenu(el)[0];
|
|
263
256
|
expect(firstItemInMoreMenu.contains(getDeepActiveElement())).to.be.true;
|
|
264
257
|
});
|
|
265
|
-
|
|
266
258
|
it(`[
|
|
267
259
|
{
|
|
268
260
|
action: 'Click on the L1 item that has children in the *main* menu',
|
|
@@ -282,17 +274,15 @@ export function runLionMenuInteractionsSuite({ klass = LionMenu } = {}) {
|
|
|
282
274
|
expect(isAnyL2MenuShown(el)).to.be.false;
|
|
283
275
|
|
|
284
276
|
// click on the first L1 item that has L2 children
|
|
285
|
-
/** @type {HTMLButtonElement | null} */
|
|
277
|
+
/** @type {HTMLButtonElement | null} */
|
|
278
|
+
el.querySelector('#item1 > button')?.click();
|
|
286
279
|
await aTimeout(0);
|
|
287
|
-
|
|
288
280
|
expect(isMoreButtonMenuShown(el)).to.be.false;
|
|
289
281
|
expect(isAnyL2MenuShown(el)).to.be.true;
|
|
290
|
-
|
|
291
282
|
await clickOnMoreButton(el);
|
|
292
283
|
expect(isMoreButtonMenuShown(el)).to.be.true;
|
|
293
284
|
expect(isAnyL2MenuShown(el)).to.be.false;
|
|
294
285
|
});
|
|
295
|
-
|
|
296
286
|
it(`[
|
|
297
287
|
{
|
|
298
288
|
action: 'Click on the L1 item that has children in the *main* menu',
|
|
@@ -320,7 +310,8 @@ export function runLionMenuInteractionsSuite({ klass = LionMenu } = {}) {
|
|
|
320
310
|
const el = await getFixture();
|
|
321
311
|
expect(isAnyL2MenuShown(el)).to.be.false;
|
|
322
312
|
// click on the first L1 item that has L2 children
|
|
323
|
-
/** @type {HTMLButtonElement | null} */
|
|
313
|
+
/** @type {HTMLButtonElement | null} */
|
|
314
|
+
el.querySelector('#item1 > button')?.click();
|
|
324
315
|
|
|
325
316
|
// focus #item1.1
|
|
326
317
|
await sendKeys({
|
|
@@ -337,11 +328,9 @@ export function runLionMenuInteractionsSuite({ klass = LionMenu } = {}) {
|
|
|
337
328
|
await sendKeys({
|
|
338
329
|
press: 'Tab',
|
|
339
330
|
});
|
|
340
|
-
|
|
341
331
|
expect(isMoreButtonMenuShown(el)).to.be.true;
|
|
342
332
|
expect(isAnyL2MenuShown(el)).to.be.false;
|
|
343
333
|
});
|
|
344
|
-
|
|
345
334
|
it(`[
|
|
346
335
|
{
|
|
347
336
|
action: 'Focus last visible L1 item in the main menu',
|
|
@@ -367,14 +356,12 @@ export function runLionMenuInteractionsSuite({ klass = LionMenu } = {}) {
|
|
|
367
356
|
await sendKeys({
|
|
368
357
|
press: 'Tab',
|
|
369
358
|
});
|
|
370
|
-
|
|
371
359
|
expect(isMoreButtonMenuShown(el)).to.be.true;
|
|
372
360
|
expect(isAnyL2MenuShown(el)).to.be.false;
|
|
373
361
|
await clickOnMoreButton(el);
|
|
374
362
|
expect(isMoreButtonMenuShown(el)).to.be.false;
|
|
375
363
|
expect(isAnyL2MenuShown(el)).to.be.false;
|
|
376
364
|
});
|
|
377
|
-
|
|
378
365
|
it(`[
|
|
379
366
|
{
|
|
380
367
|
action: 'Focus last visible L1 item in the main menu',
|
|
@@ -401,18 +388,15 @@ export function runLionMenuInteractionsSuite({ klass = LionMenu } = {}) {
|
|
|
401
388
|
await sendKeys({
|
|
402
389
|
press: 'Tab',
|
|
403
390
|
});
|
|
404
|
-
|
|
405
391
|
expect(isMoreButtonMenuShown(el)).to.be.true;
|
|
406
392
|
expect(isAnyL2MenuShown(el)).to.be.false;
|
|
407
393
|
|
|
408
394
|
// hit Shift + Tab
|
|
409
395
|
await hitShiftTab();
|
|
410
396
|
await waitAfterMoreButtonMenuHides();
|
|
411
|
-
|
|
412
397
|
expect(isMoreButtonMenuShown(el)).to.be.false;
|
|
413
398
|
expect(isAnyL2MenuShown(el)).to.be.false;
|
|
414
399
|
});
|
|
415
|
-
|
|
416
400
|
it(`[
|
|
417
401
|
{
|
|
418
402
|
action: 'Focus last visible L1 item in the main menu',
|
|
@@ -444,7 +428,6 @@ export function runLionMenuInteractionsSuite({ klass = LionMenu } = {}) {
|
|
|
444
428
|
await sendKeys({
|
|
445
429
|
press: 'Tab',
|
|
446
430
|
});
|
|
447
|
-
|
|
448
431
|
expect(isMoreButtonMenuShown(el)).to.be.true;
|
|
449
432
|
expect(isAnyL2MenuShown(el)).to.be.false;
|
|
450
433
|
|
|
@@ -453,11 +436,9 @@ export function runLionMenuInteractionsSuite({ klass = LionMenu } = {}) {
|
|
|
453
436
|
press: 'Enter',
|
|
454
437
|
});
|
|
455
438
|
await waitAfterMoreButtonMenuHides();
|
|
456
|
-
|
|
457
439
|
expect(isMoreButtonMenuShown(el)).to.be.false;
|
|
458
440
|
expect(isAnyL2MenuShown(el)).to.be.true;
|
|
459
441
|
});
|
|
460
|
-
|
|
461
442
|
it(`[
|
|
462
443
|
{
|
|
463
444
|
action: 'Focus last visible L1 item in the main menu',
|
|
@@ -507,7 +488,6 @@ export function runLionMenuInteractionsSuite({ klass = LionMenu } = {}) {
|
|
|
507
488
|
await sendKeys({
|
|
508
489
|
press: 'Tab',
|
|
509
490
|
});
|
|
510
|
-
|
|
511
491
|
expect(isMoreButtonMenuShown(el)).to.be.true;
|
|
512
492
|
expect(isAnyL2MenuShown(el)).to.be.false;
|
|
513
493
|
|
|
@@ -516,7 +496,6 @@ export function runLionMenuInteractionsSuite({ klass = LionMenu } = {}) {
|
|
|
516
496
|
press: 'Enter',
|
|
517
497
|
});
|
|
518
498
|
await waitAfterMoreButtonMenuHides();
|
|
519
|
-
|
|
520
499
|
expect(isMoreButtonMenuShown(el)).to.be.false;
|
|
521
500
|
expect(isAnyL2MenuShown(el)).to.be.true;
|
|
522
501
|
|
|
@@ -537,11 +516,9 @@ export function runLionMenuInteractionsSuite({ klass = LionMenu } = {}) {
|
|
|
537
516
|
// Focus #item2. It is the last visible item in the main menu
|
|
538
517
|
await hitShiftTab();
|
|
539
518
|
await waitAfterMoreButtonMenuHides();
|
|
540
|
-
|
|
541
519
|
expect(isMoreButtonMenuShown(el)).to.be.false;
|
|
542
520
|
expect(isAnyL2MenuShown(el)).to.be.false;
|
|
543
521
|
});
|
|
544
|
-
|
|
545
522
|
it(`[
|
|
546
523
|
{
|
|
547
524
|
action: 'Click on More button',
|
|
@@ -563,7 +540,8 @@ export function runLionMenuInteractionsSuite({ klass = LionMenu } = {}) {
|
|
|
563
540
|
const el = await getFixture();
|
|
564
541
|
await clickOnMoreButton(el);
|
|
565
542
|
// Inside more button menu, click on L1 item that has L2
|
|
566
|
-
/** @type {HTMLButtonElement | null} */
|
|
543
|
+
/** @type {HTMLButtonElement | null} */
|
|
544
|
+
el.querySelector('#item4 > button')?.click();
|
|
567
545
|
await waitAfterMoreButtonMenuHides();
|
|
568
546
|
expect(isMoreButtonMenuShown(el)).to.be.false;
|
|
569
547
|
expect(isAnyL2MenuShown(el)).to.be.true;
|