@lion/ui 0.23.0 → 0.24.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 +40 -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 +7 -6
- 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 +4 -1
- 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 +166 -151
- package/components/overlays/src/OverlayMixin.js +61 -63
- 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 +375 -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/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 +20 -43
- 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 +191 -56
- 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/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/OverlaysManager.d.ts.map +1 -1
- package/dist-types/components/overlays/src/overlayDocumentStyle.d.ts.map +1 -1
- 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 +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/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/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/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/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 +32 -10
- 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
|
@@ -160,7 +160,9 @@ class LionMenuCore extends MultiLevelListMixin(LitElement) {
|
|
|
160
160
|
/**
|
|
161
161
|
* Enable bar to use [role="menubar"] and horizontal navigation
|
|
162
162
|
*/
|
|
163
|
-
bar: {
|
|
163
|
+
bar: {
|
|
164
|
+
type: Boolean,
|
|
165
|
+
},
|
|
164
166
|
};
|
|
165
167
|
}
|
|
166
168
|
|
|
@@ -175,7 +177,7 @@ class LionMenuCore extends MultiLevelListMixin(LitElement) {
|
|
|
175
177
|
if (!item) return;
|
|
176
178
|
|
|
177
179
|
// @ts-ignore - InteractiveListItemRole type
|
|
178
|
-
const role = /** @type {InteractiveListItemRole} */
|
|
180
|
+
const role = /** @type {InteractiveListItemRole} */ item.getAttribute('role');
|
|
179
181
|
let listItemsWithinGroup = this.listItems;
|
|
180
182
|
let { multiple } = this;
|
|
181
183
|
if (role === 'menuitemradio' || role === 'menuitemcheckbox') {
|
|
@@ -195,13 +197,12 @@ class LionMenuCore extends MultiLevelListMixin(LitElement) {
|
|
|
195
197
|
*/
|
|
196
198
|
const closestGroup = item.closest('[role="group"]');
|
|
197
199
|
const group = closestGroup && this.contains(closestGroup) ? closestGroup : this;
|
|
198
|
-
listItemsWithinGroup = this.listItems.filter(listItem => group.contains(listItem));
|
|
200
|
+
listItemsWithinGroup = this.listItems.filter((listItem) => group.contains(listItem));
|
|
199
201
|
multiple = role === 'menuitemcheckbox';
|
|
200
202
|
}
|
|
201
|
-
|
|
202
203
|
if (!multiple) {
|
|
203
204
|
// Uncheck all within group
|
|
204
|
-
listItemsWithinGroup.forEach(listItem => {
|
|
205
|
+
listItemsWithinGroup.forEach((listItem) => {
|
|
205
206
|
setChecked(listItem, true);
|
|
206
207
|
});
|
|
207
208
|
setChecked(this.listItems[index]);
|
|
@@ -209,10 +210,8 @@ class LionMenuCore extends MultiLevelListMixin(LitElement) {
|
|
|
209
210
|
toggleChecked(this.listItems[index]);
|
|
210
211
|
}
|
|
211
212
|
}
|
|
212
|
-
|
|
213
213
|
constructor() {
|
|
214
214
|
super();
|
|
215
|
-
|
|
216
215
|
this.bar = false;
|
|
217
216
|
/** @configure MultiLevelListMixin */
|
|
218
217
|
this.behaveAsAccordion = true;
|
|
@@ -229,11 +228,9 @@ class LionMenuCore extends MultiLevelListMixin(LitElement) {
|
|
|
229
228
|
*/
|
|
230
229
|
firstUpdated(changedProperties) {
|
|
231
230
|
super.firstUpdated(changedProperties);
|
|
232
|
-
|
|
233
231
|
if (this._activeMode === 'tabbable-disclosure') {
|
|
234
232
|
this._listRole = 'list';
|
|
235
233
|
}
|
|
236
|
-
|
|
237
234
|
this._listNode.setAttribute('role', this._listRole);
|
|
238
235
|
|
|
239
236
|
// Allow generic attr for functional styling
|
|
@@ -245,7 +242,6 @@ class LionMenuCore extends MultiLevelListMixin(LitElement) {
|
|
|
245
242
|
*/
|
|
246
243
|
updated(changedProperties) {
|
|
247
244
|
super.updated(changedProperties);
|
|
248
|
-
|
|
249
245
|
if (changedProperties.has('bar')) {
|
|
250
246
|
if (this.bar) {
|
|
251
247
|
this.axis = 'inline';
|
|
@@ -276,52 +272,47 @@ class LionMenuCore extends MultiLevelListMixin(LitElement) {
|
|
|
276
272
|
* @param {import('@open-wc/dedupe-mixin').Constructor<import('lit').LitElement>} superclass
|
|
277
273
|
*/
|
|
278
274
|
// prettier-ignore
|
|
279
|
-
const OverlayWithListInvokerMixinImplementation = /** @type {OverlayWithListInvokerMixinType} */ (superclass
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
this.activeIndex = this.checkedIndex;
|
|
285
|
-
}
|
|
286
|
-
};
|
|
287
|
-
|
|
288
|
-
/**
|
|
289
|
-
* @enhance OverlayMixin
|
|
290
|
-
*/
|
|
291
|
-
_setupOverlayCtrl() {
|
|
292
|
-
super._setupOverlayCtrl();
|
|
293
|
-
|
|
294
|
-
if (!this._overlayCtrl) return;
|
|
295
|
-
|
|
296
|
-
this._overlayCtrl.addEventListener('show', this._onOverlayShow);
|
|
275
|
+
const OverlayWithListInvokerMixinImplementation = /** @type {OverlayWithListInvokerMixinType} */superclass => class OverlayWithListInvokerMixin extends OverlayMixin(InteractiveListMixin(superclass)) {
|
|
276
|
+
_onOverlayShow = () => {
|
|
277
|
+
if (this.checkedIndex != null) {
|
|
278
|
+
// @ts-ignore - activeIndex can be number or array
|
|
279
|
+
this.activeIndex = this.checkedIndex;
|
|
297
280
|
}
|
|
281
|
+
};
|
|
298
282
|
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
283
|
+
/**
|
|
284
|
+
* @enhance OverlayMixin
|
|
285
|
+
*/
|
|
286
|
+
_setupOverlayCtrl() {
|
|
287
|
+
super._setupOverlayCtrl();
|
|
288
|
+
if (!this._overlayCtrl) return;
|
|
289
|
+
this._overlayCtrl.addEventListener('show', this._onOverlayShow);
|
|
290
|
+
}
|
|
306
291
|
|
|
307
|
-
|
|
308
|
-
|
|
292
|
+
/**
|
|
293
|
+
* @enhance OverlayMixin
|
|
294
|
+
*/
|
|
295
|
+
_teardownOverlayCtrl() {
|
|
296
|
+
super._teardownOverlayCtrl();
|
|
297
|
+
if (!this._overlayCtrl) return;
|
|
298
|
+
this._overlayCtrl.removeEventListener('show', this._onOverlayShow);
|
|
299
|
+
}
|
|
309
300
|
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
301
|
+
/**
|
|
302
|
+
* make sure OverlayMixin gets the contentNode defined by DisclosureMixin
|
|
303
|
+
*/
|
|
304
|
+
get _overlayContentNode() {
|
|
305
|
+
// @ts-ignore - _contentNode property
|
|
306
|
+
return this._contentNode;
|
|
307
|
+
}
|
|
317
308
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
309
|
+
/**
|
|
310
|
+
* make sure OverlayMixin gets the invokerNode defined by DisclosureMixin
|
|
311
|
+
*/
|
|
312
|
+
get _overlayInvokerNode() {
|
|
313
|
+
return /** @type {HTMLElement} */this._invokerNode;
|
|
314
|
+
}
|
|
315
|
+
};
|
|
325
316
|
export const OverlayWithListInvokerMixin = dedupeMixin(OverlayWithListInvokerMixinImplementation);
|
|
326
317
|
|
|
327
318
|
/**
|
|
@@ -335,10 +326,12 @@ export class LionMenu extends OverlayWithListInvokerMixin(LionMenuCore) {
|
|
|
335
326
|
/** @returns {import('lit').PropertyDeclarations} */
|
|
336
327
|
static get properties() {
|
|
337
328
|
return {
|
|
338
|
-
openableMode: {
|
|
329
|
+
openableMode: {
|
|
330
|
+
type: String,
|
|
331
|
+
attribute: 'openable-mode',
|
|
332
|
+
},
|
|
339
333
|
};
|
|
340
334
|
}
|
|
341
|
-
|
|
342
335
|
constructor() {
|
|
343
336
|
super();
|
|
344
337
|
|
|
@@ -350,7 +343,6 @@ export class LionMenu extends OverlayWithListInvokerMixin(LionMenuCore) {
|
|
|
350
343
|
* @type {'disclosure'|'overlay'}
|
|
351
344
|
*/
|
|
352
345
|
this.openableMode = 'disclosure';
|
|
353
|
-
|
|
354
346
|
this._shouldSetupOverlay = false;
|
|
355
347
|
}
|
|
356
348
|
|
|
@@ -359,7 +351,6 @@ export class LionMenu extends OverlayWithListInvokerMixin(LionMenuCore) {
|
|
|
359
351
|
*/
|
|
360
352
|
updated(changedProperties) {
|
|
361
353
|
super.updated(changedProperties);
|
|
362
|
-
|
|
363
354
|
if (changedProperties.has('openableMode')) {
|
|
364
355
|
if (this.openableMode === 'overlay') {
|
|
365
356
|
this._shouldSetupOverlay = true;
|
|
@@ -393,9 +384,7 @@ export class LionMenu extends OverlayWithListInvokerMixin(LionMenuCore) {
|
|
|
393
384
|
if (parentList?.axis !== 'inline') {
|
|
394
385
|
placement = 'right-start';
|
|
395
386
|
}
|
|
396
|
-
|
|
397
387
|
const dropdownCfg = withDropdownConfig();
|
|
398
|
-
|
|
399
388
|
return {
|
|
400
389
|
...dropdownCfg,
|
|
401
390
|
hidesOnEsc: true,
|
|
@@ -422,9 +411,7 @@ export class LionMenu extends OverlayWithListInvokerMixin(LionMenuCore) {
|
|
|
422
411
|
*/
|
|
423
412
|
_onListKeyUp(ev) {
|
|
424
413
|
super._onListKeyUp(ev);
|
|
425
|
-
|
|
426
414
|
const { key } = ev;
|
|
427
|
-
|
|
428
415
|
switch (key) {
|
|
429
416
|
case 'Escape':
|
|
430
417
|
// We need to stop here, or else we affect parent menu (handled by OverlayController)
|
|
@@ -38,258 +38,235 @@ const styles = css`
|
|
|
38
38
|
* @param {import('@open-wc/dedupe-mixin').Constructor<import('lit').LitElement>} superclass
|
|
39
39
|
*/
|
|
40
40
|
// prettier-ignore
|
|
41
|
-
export const MoreButtonMenuMixin = /** @type {MoreButtonMenuMixinType} */ (superclass
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
if (this.__resizeTimeout) {
|
|
54
|
-
clearTimeout(this.__resizeTimeout);
|
|
55
|
-
}
|
|
56
|
-
super.disconnectedCallback?.();
|
|
41
|
+
export const MoreButtonMenuMixin = /** @type {MoreButtonMenuMixinType} */superclass => class MoreButtonMenuMixinClass extends (/** @type {import('@open-wc/dedupe-mixin').Constructor<MoreButtonMenuHostType>} */ /** @type {any} */superclass) {
|
|
42
|
+
/** @param {...any} args */
|
|
43
|
+
constructor(...args) {
|
|
44
|
+
super(...args);
|
|
45
|
+
this.__resizeTimeout = null;
|
|
46
|
+
this.isMoreButtonShown = null;
|
|
47
|
+
this.handleResize = this.handleResize.bind(this);
|
|
48
|
+
}
|
|
49
|
+
disconnectedCallback() {
|
|
50
|
+
window.removeEventListener('resize', this.handleResize);
|
|
51
|
+
if (this.__resizeTimeout) {
|
|
52
|
+
clearTimeout(this.__resizeTimeout);
|
|
57
53
|
}
|
|
54
|
+
super.disconnectedCallback?.();
|
|
55
|
+
}
|
|
56
|
+
_initMoreButtonMenu() {
|
|
57
|
+
this._createMoreButtonWrapper();
|
|
58
|
+
window.addEventListener('resize', this.handleResize);
|
|
59
|
+
this.handleResize();
|
|
60
|
+
}
|
|
58
61
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
// eslint-disable-next-line class-methods-use-this
|
|
63
|
+
_getDeepActiveElement() {
|
|
64
|
+
let host = document.activeElement || document.body;
|
|
65
|
+
while (host?.shadowRoot?.activeElement) {
|
|
66
|
+
host = host.shadowRoot.activeElement;
|
|
63
67
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
return host;
|
|
69
|
+
}
|
|
70
|
+
_createMoreButtonWrapper() {
|
|
71
|
+
const moreButtonWrapper = document.createElement('div');
|
|
72
|
+
const style = document.createElement('style');
|
|
73
|
+
style.textContent = styles.cssText;
|
|
74
|
+
moreButtonWrapper.appendChild(style);
|
|
75
|
+
moreButtonWrapper.setAttribute('data-more-button-wrapper', '');
|
|
76
|
+
[...(this.getMoreButtonSlotProjection()?.childNodes ?? [])].forEach(node => moreButtonWrapper.appendChild(node));
|
|
77
|
+
const moreButton = moreButtonWrapper.querySelector('button');
|
|
78
|
+
moreButton?.setAttribute('data-more-button', '');
|
|
79
|
+
moreButton?.setAttribute('tabindex', '-1');
|
|
80
|
+
moreButton?.setAttribute('aria-expanded', 'false');
|
|
81
|
+
const moreButtonMenu = document.createElement('div');
|
|
82
|
+
moreButtonMenu.setAttribute('data-more-button-menu', '');
|
|
83
|
+
moreButtonMenu.setAttribute('tabindex', '-1');
|
|
84
|
+
moreButtonWrapper.appendChild(moreButtonMenu);
|
|
85
|
+
this._listNode.appendChild(moreButtonWrapper);
|
|
86
|
+
const isElementDirectFocusableItemUnderMoreButtonMenu = (/** @type {HTMLElement} */element) => this.listItems.includes(element) && moreButtonMenu.contains(element) || element === moreButtonMenu;
|
|
87
|
+
moreButtonMenu.addEventListener('focusin', (/** @type {FocusEvent} */event) => {
|
|
88
|
+
const target = /** @type {HTMLElement} */event?.target;
|
|
89
|
+
if (!isElementDirectFocusableItemUnderMoreButtonMenu(target)) return;
|
|
90
|
+
|
|
91
|
+
// If applicable hide any other L2 menus
|
|
92
|
+
/** @type {any} */
|
|
93
|
+
this.querySelector('[level="2"]:has([data-open])')?._overlayCtrl?.hide();
|
|
94
|
+
|
|
95
|
+
// A user did `Shift + Tab` from L2 menu to More menu
|
|
96
|
+
if (target?.getAttribute('aria-expanded') === 'true') {
|
|
97
|
+
// close L2 menu
|
|
98
|
+
target?.click();
|
|
70
99
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
this._listNode.appendChild(moreButtonWrapper);
|
|
92
|
-
|
|
93
|
-
const isElementDirectFocusableItemUnderMoreButtonMenu = (/** @type {HTMLElement} */ element) =>
|
|
94
|
-
(this.listItems.includes(element) && moreButtonMenu.contains(element)) ||
|
|
95
|
-
element === moreButtonMenu;
|
|
96
|
-
|
|
97
|
-
moreButtonMenu.addEventListener(
|
|
98
|
-
'focusin',
|
|
99
|
-
(/** @type {FocusEvent} */ event) => {
|
|
100
|
-
const target = /** @type {HTMLElement} */ (event?.target);
|
|
101
|
-
if (!isElementDirectFocusableItemUnderMoreButtonMenu(target)) return;
|
|
102
|
-
|
|
103
|
-
// If applicable hide any other L2 menus
|
|
104
|
-
/** @type {any} */ (this.querySelector('[level="2"]:has([data-open])'))?._overlayCtrl?.hide();
|
|
105
|
-
|
|
106
|
-
// A user did `Shift + Tab` from L2 menu to More menu
|
|
107
|
-
if (target?.getAttribute('aria-expanded') === 'true') {
|
|
108
|
-
// close L2 menu
|
|
109
|
-
target?.click();
|
|
110
|
-
}
|
|
111
|
-
moreButton?.setAttribute('aria-expanded', 'true');
|
|
112
|
-
moreButtonMenu.setAttribute('data-open', '');
|
|
113
|
-
},
|
|
114
|
-
);
|
|
115
|
-
|
|
116
|
-
moreButtonMenu.addEventListener('focusout', () => {
|
|
117
|
-
// We need this timeout for Safari/WebKit.
|
|
118
|
-
// Unfortunately, an in progress click gets canceled when overflow:hidden is applied.
|
|
119
|
-
// Although mousedown would work instead, the consuming developer should have the freedom to apply all possible interaction pattterns.
|
|
120
|
-
// Especially, we should be compatible with 'withClickInteraction'
|
|
121
|
-
setTimeout(() => {
|
|
122
|
-
if (isElementDirectFocusableItemUnderMoreButtonMenu(/** @type {HTMLElement} */ (this._getDeepActiveElement()))) return;
|
|
123
|
-
moreButton?.setAttribute('aria-expanded', 'false');
|
|
124
|
-
|
|
125
|
-
moreButtonMenu.removeAttribute('data-open');
|
|
126
|
-
}, 100);
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
moreButton?.addEventListener('click', () => {
|
|
130
|
-
if (moreButtonMenu.getAttribute('data-open') === null) {
|
|
131
|
-
moreButtonMenu?.focus({ preventScroll: true });
|
|
132
|
-
moreButtonMenu.setAttribute('data-open', '');
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
getMoreButtonSlotProjection() {
|
|
138
|
-
return this.querySelector('[slot="more-button"]');
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
getMoreButtonMenu() {
|
|
142
|
-
return this.querySelector('[data-more-button-menu]');
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
getMoreButtonMenuWrapper() {
|
|
146
|
-
return this.querySelector('[data-more-button-wrapper]');
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
displayMoreButton() {
|
|
150
|
-
const wrapper = /** @type {HTMLElement} */ (this.getMoreButtonMenuWrapper());
|
|
151
|
-
if (!wrapper) return;
|
|
152
|
-
wrapper.style.display = 'block';
|
|
153
|
-
this.isMoreButtonShown = true;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
hideMoreButton() {
|
|
157
|
-
const wrapper = /** @type {HTMLElement} */ (this.getMoreButtonMenuWrapper());
|
|
158
|
-
if (!wrapper) return;
|
|
159
|
-
wrapper.style.display = 'none';
|
|
160
|
-
this.isMoreButtonShown = false;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
doItemsFit() {
|
|
164
|
-
this.style.display = 'none';
|
|
165
|
-
const parentWidth = /** @type {HTMLElement} */ (this.parentElement).clientWidth;
|
|
166
|
-
this.style.display = '';
|
|
167
|
-
return (
|
|
168
|
-
this._listNode.scrollWidth === this._listNode.clientWidth &&
|
|
169
|
-
this._listNode.scrollWidth <= parentWidth
|
|
170
|
-
);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
getListItems() {
|
|
174
|
-
const listNode = this._listNode;
|
|
175
|
-
return Array.from(listNode.querySelectorAll(':scope > [role="listitem"]'));
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* @param {Node} listItem
|
|
180
|
-
*/
|
|
181
|
-
getListItemWithAdjacentNodes = listItem => {
|
|
182
|
-
const markerNodeType = this.nodeType && Node.COMMENT_NODE;
|
|
183
|
-
/** @param {Node | null | undefined} node */
|
|
184
|
-
const isMarkerComment = node => node?.nodeType === markerNodeType && node?.nodeValue === '';
|
|
185
|
-
|
|
186
|
-
const previousNodes = [];
|
|
187
|
-
let { previousSibling } = listItem;
|
|
188
|
-
while (previousSibling) {
|
|
189
|
-
if (previousSibling.nodeType === Node.ELEMENT_NODE) {
|
|
190
|
-
break;
|
|
191
|
-
}
|
|
192
|
-
previousNodes.unshift(previousSibling);
|
|
193
|
-
if (isMarkerComment(previousSibling)) {
|
|
194
|
-
break;
|
|
195
|
-
}
|
|
196
|
-
({ previousSibling } = previousSibling);
|
|
100
|
+
moreButton?.setAttribute('aria-expanded', 'true');
|
|
101
|
+
moreButtonMenu.setAttribute('data-open', '');
|
|
102
|
+
});
|
|
103
|
+
moreButtonMenu.addEventListener('focusout', () => {
|
|
104
|
+
// We need this timeout for Safari/WebKit.
|
|
105
|
+
// Unfortunately, an in progress click gets canceled when overflow:hidden is applied.
|
|
106
|
+
// Although mousedown would work instead, the consuming developer should have the freedom to apply all possible interaction pattterns.
|
|
107
|
+
// Especially, we should be compatible with 'withClickInteraction'
|
|
108
|
+
setTimeout(() => {
|
|
109
|
+
if (isElementDirectFocusableItemUnderMoreButtonMenu(/** @type {HTMLElement} */this._getDeepActiveElement())) return;
|
|
110
|
+
moreButton?.setAttribute('aria-expanded', 'false');
|
|
111
|
+
moreButtonMenu.removeAttribute('data-open');
|
|
112
|
+
}, 100);
|
|
113
|
+
});
|
|
114
|
+
moreButton?.addEventListener('click', () => {
|
|
115
|
+
if (moreButtonMenu.getAttribute('data-open') === null) {
|
|
116
|
+
moreButtonMenu?.focus({
|
|
117
|
+
preventScroll: true
|
|
118
|
+
});
|
|
119
|
+
moreButtonMenu.setAttribute('data-open', '');
|
|
197
120
|
}
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
getMoreButtonSlotProjection() {
|
|
124
|
+
return this.querySelector('[slot="more-button"]');
|
|
125
|
+
}
|
|
126
|
+
getMoreButtonMenu() {
|
|
127
|
+
return this.querySelector('[data-more-button-menu]');
|
|
128
|
+
}
|
|
129
|
+
getMoreButtonMenuWrapper() {
|
|
130
|
+
return this.querySelector('[data-more-button-wrapper]');
|
|
131
|
+
}
|
|
132
|
+
displayMoreButton() {
|
|
133
|
+
const wrapper = /** @type {HTMLElement} */this.getMoreButtonMenuWrapper();
|
|
134
|
+
if (!wrapper) return;
|
|
135
|
+
wrapper.style.display = 'block';
|
|
136
|
+
this.isMoreButtonShown = true;
|
|
137
|
+
}
|
|
138
|
+
hideMoreButton() {
|
|
139
|
+
const wrapper = /** @type {HTMLElement} */this.getMoreButtonMenuWrapper();
|
|
140
|
+
if (!wrapper) return;
|
|
141
|
+
wrapper.style.display = 'none';
|
|
142
|
+
this.isMoreButtonShown = false;
|
|
143
|
+
}
|
|
144
|
+
doItemsFit() {
|
|
145
|
+
this.style.display = 'none';
|
|
146
|
+
const parentWidth = /** @type {HTMLElement} */this.parentElement.clientWidth;
|
|
147
|
+
this.style.display = '';
|
|
148
|
+
return this._listNode.scrollWidth === this._listNode.clientWidth && this._listNode.scrollWidth <= parentWidth;
|
|
149
|
+
}
|
|
150
|
+
getListItems() {
|
|
151
|
+
const listNode = this._listNode;
|
|
152
|
+
return Array.from(listNode.querySelectorAll(':scope > [role="listitem"]'));
|
|
153
|
+
}
|
|
198
154
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
155
|
+
/**
|
|
156
|
+
* @param {Node} listItem
|
|
157
|
+
*/
|
|
158
|
+
getListItemWithAdjacentNodes = listItem => {
|
|
159
|
+
const markerNodeType = this.nodeType && Node.COMMENT_NODE;
|
|
160
|
+
/** @param {Node | null | undefined} node */
|
|
161
|
+
const isMarkerComment = node => node?.nodeType === markerNodeType && node?.nodeValue === '';
|
|
162
|
+
const previousNodes = [];
|
|
163
|
+
let {
|
|
164
|
+
previousSibling
|
|
165
|
+
} = listItem;
|
|
166
|
+
while (previousSibling) {
|
|
167
|
+
if (previousSibling.nodeType === Node.ELEMENT_NODE) {
|
|
168
|
+
break;
|
|
212
169
|
}
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
/**
|
|
221
|
-
* @param {{ moreButtonMenuElement: HTMLButtonElement, listItem: HTMLElement }} opts
|
|
222
|
-
*/
|
|
223
|
-
moveItemToMoreButtonMenuFromMainMenu({ moreButtonMenuElement, listItem }) {
|
|
224
|
-
const fragment = this.getListItemWithAdjacentNodes(listItem);
|
|
225
|
-
moreButtonMenuElement.prepend(fragment);
|
|
226
|
-
// eslint-disable-next-line no-param-reassign
|
|
227
|
-
listItem.style.display = '';
|
|
228
|
-
this.displayMoreButton();
|
|
170
|
+
previousNodes.unshift(previousSibling);
|
|
171
|
+
if (isMarkerComment(previousSibling)) {
|
|
172
|
+
break;
|
|
173
|
+
}
|
|
174
|
+
({
|
|
175
|
+
previousSibling
|
|
176
|
+
} = previousSibling);
|
|
229
177
|
}
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
if (
|
|
236
|
-
|
|
178
|
+
const nextNodes = [];
|
|
179
|
+
let {
|
|
180
|
+
nextSibling
|
|
181
|
+
} = listItem;
|
|
182
|
+
while (nextSibling) {
|
|
183
|
+
if (nextSibling.nodeType === Node.ELEMENT_NODE) {
|
|
184
|
+
break;
|
|
237
185
|
}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
186
|
+
nextNodes.push(nextSibling);
|
|
187
|
+
if (isMarkerComment(nextSibling)) {
|
|
188
|
+
break;
|
|
189
|
+
}
|
|
190
|
+
({
|
|
191
|
+
nextSibling
|
|
192
|
+
} = nextSibling);
|
|
241
193
|
}
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
194
|
+
const fragment = document.createDocumentFragment();
|
|
195
|
+
const nodes = [...previousNodes, listItem, ...nextNodes];
|
|
196
|
+
nodes.forEach(node => fragment.appendChild(node));
|
|
197
|
+
return fragment;
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* @param {{ moreButtonMenuElement: HTMLButtonElement, listItem: HTMLElement }} opts
|
|
202
|
+
*/
|
|
203
|
+
moveItemToMoreButtonMenuFromMainMenu({
|
|
204
|
+
moreButtonMenuElement,
|
|
205
|
+
listItem
|
|
206
|
+
}) {
|
|
207
|
+
const fragment = this.getListItemWithAdjacentNodes(listItem);
|
|
208
|
+
moreButtonMenuElement.prepend(fragment);
|
|
209
|
+
// eslint-disable-next-line no-param-reassign
|
|
210
|
+
listItem.style.display = '';
|
|
211
|
+
this.displayMoreButton();
|
|
212
|
+
}
|
|
213
|
+
moveAllItemsToMainMenuFromMoreButtonMenu() {
|
|
214
|
+
const moreButtonMenu = this.getMoreButtonMenu();
|
|
215
|
+
const moreButtonMenuWrapper = this.getMoreButtonMenuWrapper();
|
|
216
|
+
if (!moreButtonMenu || !moreButtonMenuWrapper) return;
|
|
217
|
+
if (moreButtonMenu.childNodes.length === 0) {
|
|
218
|
+
return;
|
|
245
219
|
}
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
220
|
+
[...moreButtonMenu.childNodes].forEach(node => {
|
|
221
|
+
moreButtonMenuWrapper.before(node);
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
renderAllItemsInMainMenu() {
|
|
225
|
+
this.moveAllItemsToMainMenuFromMoreButtonMenu();
|
|
226
|
+
}
|
|
227
|
+
hideItemsOneByOneInMainMenuUntilTheyFit() {
|
|
228
|
+
let hiddenItemsCount = 0;
|
|
229
|
+
const mainMenuItems = this.getListItems();
|
|
230
|
+
for (let i = mainMenuItems.length - 1; i >= 0 && !this.doItemsFit(); i -= 1) {
|
|
231
|
+
/** @type {HTMLElement} */mainMenuItems[i].style.display = 'none';
|
|
232
|
+
hiddenItemsCount += 1;
|
|
255
233
|
}
|
|
234
|
+
return hiddenItemsCount;
|
|
235
|
+
}
|
|
256
236
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
237
|
+
/**
|
|
238
|
+
* @param {number} hiddenItemsCount
|
|
239
|
+
*/
|
|
240
|
+
moveHiddenItemsFromMainMenuToMoreButtonMenu(hiddenItemsCount) {
|
|
241
|
+
const moreButtonMenuElement = this.getMoreButtonMenu();
|
|
242
|
+
const listItems = this._listNode.querySelectorAll(':scope > [role="listitem"]');
|
|
243
|
+
for (let i = 0; i < hiddenItemsCount; i += 1) {
|
|
244
|
+
const listItem = listItems[listItems.length - 1 - i];
|
|
245
|
+
// @ts-ignore - the list items of a menu host are elements
|
|
246
|
+
this.moveItemToMoreButtonMenuFromMainMenu({
|
|
247
|
+
moreButtonMenuElement,
|
|
248
|
+
listItem
|
|
249
|
+
});
|
|
268
250
|
}
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
251
|
+
}
|
|
252
|
+
handleResize() {
|
|
253
|
+
if (this.__resizeTimeout) {
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
this.style.visibility = 'hidden';
|
|
257
|
+
this.__resizeTimeout = setTimeout(() => {
|
|
258
|
+
this.__resizeTimeout = null;
|
|
259
|
+
this.renderAllItemsInMainMenu();
|
|
260
|
+
this.hideMoreButton();
|
|
261
|
+
if (this.doItemsFit()) {
|
|
262
|
+
this.style.visibility = '';
|
|
272
263
|
return;
|
|
273
264
|
}
|
|
274
|
-
|
|
275
265
|
this.style.visibility = 'hidden';
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
if (this.doItemsFit()) {
|
|
284
|
-
this.style.visibility = '';
|
|
285
|
-
return;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
this.style.visibility = 'hidden';
|
|
289
|
-
this.displayMoreButton();
|
|
290
|
-
const hiddenItemsCount = this.hideItemsOneByOneInMainMenuUntilTheyFit();
|
|
291
|
-
this.moveHiddenItemsFromMainMenuToMoreButtonMenu(hiddenItemsCount);
|
|
292
|
-
this.style.visibility = '';
|
|
293
|
-
}, 50);
|
|
294
|
-
}
|
|
295
|
-
});
|
|
266
|
+
this.displayMoreButton();
|
|
267
|
+
const hiddenItemsCount = this.hideItemsOneByOneInMainMenuUntilTheyFit();
|
|
268
|
+
this.moveHiddenItemsFromMainMenuToMoreButtonMenu(hiddenItemsCount);
|
|
269
|
+
this.style.visibility = '';
|
|
270
|
+
}, 50);
|
|
271
|
+
}
|
|
272
|
+
};
|