@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
|
@@ -11,7 +11,6 @@ import { LionInput } from '@lion/ui/input.js';
|
|
|
11
11
|
import { expect, fixture, fixtureSync, html, unsafeStatic } from '@open-wc/testing';
|
|
12
12
|
import { LitElement } from 'lit';
|
|
13
13
|
import sinon from 'sinon';
|
|
14
|
-
|
|
15
14
|
class ChoiceInputFoo extends ChoiceInputMixin(LionInput) {}
|
|
16
15
|
customElements.define('choice-input-foo', ChoiceInputFoo);
|
|
17
16
|
class ChoiceInputBar extends ChoiceInputMixin(LionInput) {
|
|
@@ -37,64 +36,58 @@ export function runChoiceGroupMixinSuite({ parentTagString, childTagString, choi
|
|
|
37
36
|
childTagStringBar: 'choice-input-bar',
|
|
38
37
|
choiceType: choiceType || 'single',
|
|
39
38
|
};
|
|
40
|
-
|
|
41
39
|
const parentTag = unsafeStatic(cfg.parentTagString);
|
|
42
40
|
const childTag = unsafeStatic(cfg.childTagString);
|
|
43
41
|
const childTagFoo = unsafeStatic(cfg.childTagStringFoo);
|
|
44
42
|
const childTagBar = unsafeStatic(cfg.childTagStringBar);
|
|
45
|
-
|
|
46
43
|
describe(`ChoiceGroupMixin: ${cfg.parentTagString}`, () => {
|
|
47
44
|
if (cfg.choiceType === 'single') {
|
|
48
45
|
it('has a single modelValue representing initial checked values', async () => {
|
|
49
|
-
const el =
|
|
46
|
+
const el =
|
|
47
|
+
/** @type {ChoiceInputGroup} */
|
|
50
48
|
await fixture(html`
|
|
51
49
|
<${parentTag} name="gender[]">
|
|
52
50
|
<${childTag} .choiceValue=${'male'}></${childTag}>
|
|
53
51
|
<${childTag} .choiceValue=${'female'} checked></${childTag}>
|
|
54
52
|
<${childTag} .choiceValue=${'other'}></${childTag}>
|
|
55
53
|
</${parentTag}>
|
|
56
|
-
`)
|
|
57
|
-
);
|
|
54
|
+
`);
|
|
58
55
|
|
|
59
56
|
// @ts-ignore protected members allowed in test
|
|
60
57
|
expect(el._initialModelValue).to.eql('female');
|
|
61
58
|
expect(el.modelValue).to.eql('female');
|
|
62
|
-
|
|
63
59
|
el.formElements[0].checked = true;
|
|
64
60
|
|
|
65
61
|
// @ts-ignore protected members allowed in test
|
|
66
62
|
expect(el._initialModelValue).to.eql('female');
|
|
67
63
|
expect(el.modelValue).to.eql('male');
|
|
68
64
|
});
|
|
69
|
-
|
|
70
65
|
it('has a single modelValue representing the currently checked radio value', async () => {
|
|
71
|
-
const el =
|
|
66
|
+
const el =
|
|
67
|
+
/** @type {ChoiceInputGroup} */
|
|
72
68
|
await fixture(html`
|
|
73
69
|
<${parentTag} name="gender[]">
|
|
74
70
|
<${childTag} .choiceValue=${'male'}></${childTag}>
|
|
75
71
|
<${childTag} .choiceValue=${'female'} checked></${childTag}>
|
|
76
72
|
<${childTag} .choiceValue=${'other'}></${childTag}>
|
|
77
73
|
</${parentTag}>
|
|
78
|
-
`)
|
|
79
|
-
);
|
|
80
|
-
|
|
74
|
+
`);
|
|
81
75
|
expect(el.modelValue).to.equal('female');
|
|
82
76
|
el.formElements[0].checked = true;
|
|
83
77
|
expect(el.modelValue).to.equal('male');
|
|
84
78
|
el.formElements[2].checked = true;
|
|
85
79
|
expect(el.modelValue).to.equal('other');
|
|
86
80
|
});
|
|
87
|
-
|
|
88
81
|
it('has a single formattedValue representing the currently checked radio value', async () => {
|
|
89
|
-
const el =
|
|
82
|
+
const el =
|
|
83
|
+
/** @type {ChoiceInputGroup} */
|
|
90
84
|
await fixture(html`
|
|
91
85
|
<${parentTag} name="gender">
|
|
92
86
|
<${childTag} .choiceValue=${'male'}></${childTag}>
|
|
93
87
|
<${childTag} .choiceValue=${'female'} checked></${childTag}>
|
|
94
88
|
<${childTag} .choiceValue=${'other'}></${childTag}>
|
|
95
89
|
</${parentTag}>
|
|
96
|
-
`)
|
|
97
|
-
);
|
|
90
|
+
`);
|
|
98
91
|
expect(el.formattedValue).to.equal('female');
|
|
99
92
|
el.formElements[0].checked = true;
|
|
100
93
|
expect(el.formattedValue).to.equal('male');
|
|
@@ -102,162 +95,135 @@ export function runChoiceGroupMixinSuite({ parentTagString, childTagString, choi
|
|
|
102
95
|
expect(el.formattedValue).to.equal('other');
|
|
103
96
|
});
|
|
104
97
|
}
|
|
105
|
-
|
|
106
98
|
it('throws if a child element without a modelValue like { value: "foo", checked: false } tries to register', async () => {
|
|
107
|
-
const el =
|
|
99
|
+
const el =
|
|
100
|
+
/** @type {ChoiceInputGroup} */
|
|
108
101
|
await fixture(html`
|
|
109
102
|
<${parentTag} name="gender[]">
|
|
110
103
|
<${childTag} .choiceValue=${'male'}></${childTag}>
|
|
111
104
|
<${childTag} .choiceValue=${'female'} checked></${childTag}>
|
|
112
105
|
<${childTag} .choiceValue=${'other'}></${childTag}>
|
|
113
106
|
</${parentTag}>
|
|
114
|
-
`)
|
|
115
|
-
|
|
116
|
-
|
|
107
|
+
`);
|
|
108
|
+
const invalidChild =
|
|
109
|
+
/** @type {ChoiceInputGroup} */
|
|
117
110
|
await fixture(html`
|
|
118
111
|
<${childTag} .modelValue=${'Lara'}></${childTag}>
|
|
119
|
-
`)
|
|
120
|
-
);
|
|
121
|
-
|
|
112
|
+
`);
|
|
122
113
|
expect(() => {
|
|
123
114
|
el.addFormElement(invalidChild);
|
|
124
115
|
}).to.throw(
|
|
125
116
|
`The ${cfg.parentTagString} name="gender[]" does not allow to register ${cfg.childTagString} with .modelValue="Lara" - The modelValue should represent an Object { value: "foo", checked: false }`,
|
|
126
117
|
);
|
|
127
118
|
});
|
|
128
|
-
|
|
129
119
|
it('automatically sets the name property of child fields to its own name', async () => {
|
|
130
|
-
const el =
|
|
120
|
+
const el =
|
|
121
|
+
/** @type {ChoiceInputGroup} */
|
|
131
122
|
await fixture(html`
|
|
132
123
|
<${parentTag} name="gender[]">
|
|
133
124
|
<${childTag} .choiceValue=${'female'} checked></${childTag}>
|
|
134
125
|
<${childTag} .choiceValue=${'other'}></${childTag}>
|
|
135
126
|
</${parentTag}>
|
|
136
|
-
`)
|
|
137
|
-
);
|
|
138
|
-
|
|
127
|
+
`);
|
|
139
128
|
expect(el.formElements[0].name).to.equal('gender[]');
|
|
140
129
|
expect(el.formElements[1].name).to.equal('gender[]');
|
|
141
|
-
|
|
142
|
-
|
|
130
|
+
const validChild =
|
|
131
|
+
/** @type {ChoiceInputGroup} */
|
|
143
132
|
await fixture(html`
|
|
144
133
|
<${childTag} .choiceValue=${'male'}></${childTag}>
|
|
145
|
-
`)
|
|
146
|
-
);
|
|
134
|
+
`);
|
|
147
135
|
el.appendChild(validChild);
|
|
148
|
-
|
|
149
136
|
expect(el.formElements[2].name).to.equal('gender[]');
|
|
150
137
|
});
|
|
151
|
-
|
|
152
138
|
it('automatically updates the name property of child fields to its own name', async () => {
|
|
153
|
-
const el =
|
|
139
|
+
const el =
|
|
140
|
+
/** @type {ChoiceInputGroup} */
|
|
154
141
|
await fixture(html`
|
|
155
142
|
<${parentTag} name="gender[]">
|
|
156
143
|
<${childTag}></${childTag}>
|
|
157
144
|
<${childTag}></${childTag}>
|
|
158
145
|
</${parentTag}>
|
|
159
|
-
`)
|
|
160
|
-
);
|
|
161
|
-
|
|
146
|
+
`);
|
|
162
147
|
expect(el.formElements[0].name).to.equal('gender[]');
|
|
163
148
|
expect(el.formElements[1].name).to.equal('gender[]');
|
|
164
|
-
|
|
165
149
|
el.name = 'gender2[]';
|
|
166
|
-
|
|
167
150
|
await el.updateComplete;
|
|
168
|
-
|
|
169
151
|
expect(el.formElements[0].name).to.equal('gender2[]');
|
|
170
152
|
expect(el.formElements[1].name).to.equal('gender2[]');
|
|
171
153
|
});
|
|
172
|
-
|
|
173
154
|
it('prevents updating the name property of a child if it is different from its parent', async () => {
|
|
174
|
-
const el =
|
|
155
|
+
const el =
|
|
156
|
+
/** @type {ChoiceInputGroup} */
|
|
175
157
|
await fixture(html`
|
|
176
158
|
<${parentTag} name="gender[]">
|
|
177
159
|
<${childTag}></${childTag}>
|
|
178
160
|
<${childTag}></${childTag}>
|
|
179
161
|
</${parentTag}>
|
|
180
|
-
`)
|
|
181
|
-
);
|
|
182
|
-
|
|
162
|
+
`);
|
|
183
163
|
expect(el.formElements[0].name).to.equal('gender[]');
|
|
184
164
|
expect(el.formElements[1].name).to.equal('gender[]');
|
|
185
|
-
|
|
186
165
|
el.formElements[0].name = 'gender2[]';
|
|
187
|
-
|
|
188
166
|
await el.formElements[0].updateComplete;
|
|
189
167
|
expect(el.formElements[0].name).to.equal('gender[]');
|
|
190
168
|
});
|
|
191
|
-
|
|
192
169
|
it('allows updating the name property of a child if parent tagName does not include childTagname', async () => {
|
|
193
|
-
const el =
|
|
170
|
+
const el =
|
|
171
|
+
/** @type {ChoiceInputGroup} */
|
|
194
172
|
await fixture(html`
|
|
195
173
|
<${parentTag} name="gender[]">
|
|
196
174
|
<${childTagFoo}></${childTagFoo}>
|
|
197
175
|
<${childTagFoo}></${childTagFoo}>
|
|
198
176
|
</${parentTag}>
|
|
199
|
-
`)
|
|
200
|
-
);
|
|
201
|
-
|
|
177
|
+
`);
|
|
202
178
|
expect(el.formElements[0].name).to.equal('gender[]');
|
|
203
179
|
expect(el.formElements[1].name).to.equal('gender[]');
|
|
204
|
-
|
|
205
180
|
el.formElements[0].name = 'gender2[]';
|
|
206
|
-
|
|
207
181
|
await el.formElements[0].updateComplete;
|
|
208
182
|
expect(el.formElements[0].name).to.equal('gender2[]');
|
|
209
183
|
});
|
|
210
|
-
|
|
211
184
|
it('allows setting the condition for syncing the name property of a child to parent', async () => {
|
|
212
|
-
const el =
|
|
185
|
+
const el =
|
|
186
|
+
/** @type {ChoiceInputGroup} */
|
|
213
187
|
await fixture(html`
|
|
214
188
|
<${parentTag} name="gender[]">
|
|
215
189
|
<${childTagBar}></${childTagBar}>
|
|
216
190
|
<${childTagBar}></${childTagBar}>
|
|
217
191
|
</${parentTag}>
|
|
218
|
-
`)
|
|
219
|
-
);
|
|
220
|
-
|
|
192
|
+
`);
|
|
221
193
|
expect(el.formElements[0].name).to.equal('gender[]');
|
|
222
194
|
expect(el.formElements[1].name).to.equal('gender[]');
|
|
223
|
-
|
|
224
195
|
el.formElements[0].name = 'gender2[]';
|
|
225
|
-
|
|
226
196
|
await el.formElements[0].updateComplete;
|
|
227
197
|
expect(el.formElements[0].name).to.equal('gender[]');
|
|
228
198
|
});
|
|
229
|
-
|
|
230
199
|
it('adjusts the name of a child element if it has a different name than the group', async () => {
|
|
231
|
-
const el =
|
|
200
|
+
const el =
|
|
201
|
+
/** @type {ChoiceInputGroup} */
|
|
232
202
|
await fixture(html`
|
|
233
203
|
<${parentTag} name="gender[]">
|
|
234
204
|
<${childTag} .choiceValue=${'female'} checked></${childTag}>
|
|
235
205
|
<${childTag} .choiceValue=${'other'}></${childTag}>
|
|
236
206
|
</${parentTag}>
|
|
237
|
-
`)
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
const invalidChild = /** @type {ChoiceInputGroup} */ (
|
|
207
|
+
`);
|
|
208
|
+
const invalidChild =
|
|
209
|
+
/** @type {ChoiceInputGroup} */
|
|
241
210
|
await fixture(html`
|
|
242
211
|
<${childTag} name="foo" .choiceValue=${'male'}></${childTag}>
|
|
243
|
-
`)
|
|
244
|
-
);
|
|
212
|
+
`);
|
|
245
213
|
el.addFormElement(invalidChild);
|
|
246
214
|
await invalidChild.updateComplete;
|
|
247
215
|
expect(invalidChild.name).to.equal('gender[]');
|
|
248
216
|
});
|
|
249
|
-
|
|
250
217
|
it('can set initial modelValue on creation', async () => {
|
|
251
|
-
const el =
|
|
218
|
+
const el =
|
|
219
|
+
/** @type {ChoiceInputGroup} */
|
|
252
220
|
await fixture(html`
|
|
253
221
|
<${parentTag} name="gender[]" .modelValue=${'other'}>
|
|
254
222
|
<${childTag} .choiceValue=${'male'}></${childTag}>
|
|
255
223
|
<${childTag} .choiceValue=${'female'}></${childTag}>
|
|
256
224
|
<${childTag} .choiceValue=${'other'}></${childTag}>
|
|
257
225
|
</${parentTag}>
|
|
258
|
-
`)
|
|
259
|
-
);
|
|
260
|
-
|
|
226
|
+
`);
|
|
261
227
|
if (cfg.choiceType === 'single') {
|
|
262
228
|
expect(el.modelValue).to.equal('other');
|
|
263
229
|
} else {
|
|
@@ -265,18 +231,16 @@ export function runChoiceGroupMixinSuite({ parentTagString, childTagString, choi
|
|
|
265
231
|
}
|
|
266
232
|
expect(el.formElements[2].checked).to.be.true;
|
|
267
233
|
});
|
|
268
|
-
|
|
269
234
|
it('can set initial serializedValue on creation', async () => {
|
|
270
|
-
const el =
|
|
235
|
+
const el =
|
|
236
|
+
/** @type {ChoiceInputGroup} */
|
|
271
237
|
await fixture(html`
|
|
272
238
|
<${parentTag} name="gender[]" .serializedValue=${'other'}>
|
|
273
239
|
<${childTag} .choiceValue=${'male'}></${childTag}>
|
|
274
240
|
<${childTag} .choiceValue=${'female'}></${childTag}>
|
|
275
241
|
<${childTag} .choiceValue=${'other'}></${childTag}>
|
|
276
242
|
</${parentTag}>
|
|
277
|
-
`)
|
|
278
|
-
);
|
|
279
|
-
|
|
243
|
+
`);
|
|
280
244
|
if (cfg.choiceType === 'single') {
|
|
281
245
|
expect(el.serializedValue).to.equal('other');
|
|
282
246
|
} else {
|
|
@@ -284,18 +248,16 @@ export function runChoiceGroupMixinSuite({ parentTagString, childTagString, choi
|
|
|
284
248
|
}
|
|
285
249
|
expect(el.formElements[2].checked).to.be.true;
|
|
286
250
|
});
|
|
287
|
-
|
|
288
251
|
it('can set initial formattedValue on creation', async () => {
|
|
289
|
-
const el =
|
|
252
|
+
const el =
|
|
253
|
+
/** @type {ChoiceInputGroup} */
|
|
290
254
|
await fixture(html`
|
|
291
255
|
<${parentTag} name="gender[]" .formattedValue=${'other'}>
|
|
292
256
|
<${childTag} .choiceValue=${'male'}></${childTag}>
|
|
293
257
|
<${childTag} .choiceValue=${'female'}></${childTag}>
|
|
294
258
|
<${childTag} .choiceValue=${'other'}></${childTag}>
|
|
295
259
|
</${parentTag}>
|
|
296
|
-
`)
|
|
297
|
-
);
|
|
298
|
-
|
|
260
|
+
`);
|
|
299
261
|
if (cfg.choiceType === 'single') {
|
|
300
262
|
expect(el.formattedValue).to.equal('other');
|
|
301
263
|
} else {
|
|
@@ -303,18 +265,16 @@ export function runChoiceGroupMixinSuite({ parentTagString, childTagString, choi
|
|
|
303
265
|
}
|
|
304
266
|
expect(el.formElements[2].checked).to.be.true;
|
|
305
267
|
});
|
|
306
|
-
|
|
307
268
|
it('correctly handles modelValue being set before registrationComplete', async () => {
|
|
308
|
-
const el =
|
|
269
|
+
const el =
|
|
270
|
+
/** @type {ChoiceInputGroup} */
|
|
309
271
|
fixtureSync(html`
|
|
310
272
|
<${parentTag} name="gender[]" .modelValue=${null}>
|
|
311
273
|
<${childTag} .choiceValue=${'male'}></${childTag}>
|
|
312
274
|
<${childTag} .choiceValue=${'female'}></${childTag}>
|
|
313
275
|
<${childTag} .choiceValue=${'other'}></${childTag}>
|
|
314
276
|
</${parentTag}>
|
|
315
|
-
`)
|
|
316
|
-
);
|
|
317
|
-
|
|
277
|
+
`);
|
|
318
278
|
if (cfg.choiceType === 'single') {
|
|
319
279
|
el.modelValue = 'other';
|
|
320
280
|
await el.registrationComplete;
|
|
@@ -325,18 +285,16 @@ export function runChoiceGroupMixinSuite({ parentTagString, childTagString, choi
|
|
|
325
285
|
expect(el.modelValue).to.deep.equal(['other']);
|
|
326
286
|
}
|
|
327
287
|
});
|
|
328
|
-
|
|
329
288
|
it('correctly handles serializedValue being set before registrationComplete', async () => {
|
|
330
|
-
const el =
|
|
289
|
+
const el =
|
|
290
|
+
/** @type {ChoiceInputGroup} */
|
|
331
291
|
fixtureSync(html`
|
|
332
292
|
<${parentTag} name="gender[]" .serializedValue=${null}>
|
|
333
293
|
<${childTag} .choiceValue=${'male'}></${childTag}>
|
|
334
294
|
<${childTag} .choiceValue=${'female'}></${childTag}>
|
|
335
295
|
<${childTag} .choiceValue=${'other'}></${childTag}>
|
|
336
296
|
</${parentTag}>
|
|
337
|
-
`)
|
|
338
|
-
);
|
|
339
|
-
|
|
297
|
+
`);
|
|
340
298
|
if (cfg.choiceType === 'single') {
|
|
341
299
|
// @ts-expect-error
|
|
342
300
|
el.serializedValue = 'other';
|
|
@@ -349,24 +307,21 @@ export function runChoiceGroupMixinSuite({ parentTagString, childTagString, choi
|
|
|
349
307
|
expect(el.serializedValue).to.deep.equal(['other']);
|
|
350
308
|
}
|
|
351
309
|
});
|
|
352
|
-
|
|
353
310
|
it('can handle null and undefined modelValues', async () => {
|
|
354
|
-
const el =
|
|
311
|
+
const el =
|
|
312
|
+
/** @type {ChoiceInputGroup} */
|
|
355
313
|
await fixture(html`
|
|
356
314
|
<${parentTag} name="gender[]" .modelValue=${null}>
|
|
357
315
|
<${childTag} .choiceValue=${'male'}></${childTag}>
|
|
358
316
|
<${childTag} .choiceValue=${'female'}></${childTag}>
|
|
359
317
|
<${childTag} .choiceValue=${'other'}></${childTag}>
|
|
360
318
|
</${parentTag}>
|
|
361
|
-
`)
|
|
362
|
-
);
|
|
363
|
-
|
|
319
|
+
`);
|
|
364
320
|
if (cfg.choiceType === 'single') {
|
|
365
321
|
expect(el.modelValue).to.equal('');
|
|
366
322
|
} else {
|
|
367
323
|
expect(el.modelValue).to.deep.equal([]);
|
|
368
324
|
}
|
|
369
|
-
|
|
370
325
|
el.modelValue = undefined;
|
|
371
326
|
await el.updateComplete;
|
|
372
327
|
if (cfg.choiceType === 'single') {
|
|
@@ -375,40 +330,44 @@ export function runChoiceGroupMixinSuite({ parentTagString, childTagString, choi
|
|
|
375
330
|
expect(el.modelValue).to.deep.equal([]);
|
|
376
331
|
}
|
|
377
332
|
});
|
|
378
|
-
|
|
379
333
|
it('can handle complex data via choiceValue', async () => {
|
|
380
334
|
const date = new Date(2018, 11, 24, 10, 33, 30, 0);
|
|
381
|
-
|
|
382
|
-
|
|
335
|
+
const el =
|
|
336
|
+
/** @type {ChoiceInputGroup} */
|
|
383
337
|
await fixture(html`
|
|
384
338
|
<${parentTag} name="data[]">
|
|
385
|
-
<${childTag} .choiceValue=${{
|
|
339
|
+
<${childTag} .choiceValue=${{
|
|
340
|
+
some: 'data',
|
|
341
|
+
}}></${childTag}>
|
|
386
342
|
<${childTag} .choiceValue=${date} checked></${childTag}>
|
|
387
343
|
</${parentTag}>
|
|
388
|
-
`)
|
|
389
|
-
);
|
|
390
|
-
|
|
344
|
+
`);
|
|
391
345
|
if (cfg.choiceType === 'single') {
|
|
392
346
|
expect(el.modelValue).to.equal(date);
|
|
393
347
|
el.formElements[0].checked = true;
|
|
394
|
-
expect(el.modelValue).to.deep.equal({
|
|
348
|
+
expect(el.modelValue).to.deep.equal({
|
|
349
|
+
some: 'data',
|
|
350
|
+
});
|
|
395
351
|
} else {
|
|
396
352
|
expect(el.modelValue).to.deep.equal([date]);
|
|
397
353
|
el.formElements[0].checked = true;
|
|
398
|
-
expect(el.modelValue).to.deep.equal([
|
|
354
|
+
expect(el.modelValue).to.deep.equal([
|
|
355
|
+
{
|
|
356
|
+
some: 'data',
|
|
357
|
+
},
|
|
358
|
+
date,
|
|
359
|
+
]);
|
|
399
360
|
}
|
|
400
361
|
});
|
|
401
|
-
|
|
402
362
|
it('can handle 0 and empty string as valid values', async () => {
|
|
403
|
-
const el =
|
|
363
|
+
const el =
|
|
364
|
+
/** @type {ChoiceInputGroup} */
|
|
404
365
|
await fixture(html`
|
|
405
366
|
<${parentTag} name="data[]">
|
|
406
367
|
<${childTag} .choiceValue=${0} checked></${childTag}>
|
|
407
368
|
<${childTag} .choiceValue=${''}></${childTag}>
|
|
408
369
|
</${parentTag}>
|
|
409
|
-
`)
|
|
410
|
-
);
|
|
411
|
-
|
|
370
|
+
`);
|
|
412
371
|
if (cfg.choiceType === 'single') {
|
|
413
372
|
expect(el.modelValue).to.equal(0);
|
|
414
373
|
el.formElements[1].checked = true;
|
|
@@ -419,24 +378,31 @@ export function runChoiceGroupMixinSuite({ parentTagString, childTagString, choi
|
|
|
419
378
|
expect(el.modelValue).to.deep.equal([0, '']);
|
|
420
379
|
}
|
|
421
380
|
});
|
|
422
|
-
|
|
423
381
|
it('can check a choice by supplying an available modelValue', async () => {
|
|
424
|
-
const el =
|
|
382
|
+
const el =
|
|
383
|
+
/** @type {ChoiceInputGroup} */
|
|
425
384
|
await fixture(html`
|
|
426
385
|
<${parentTag} name="gender[]">
|
|
427
386
|
<${childTag}
|
|
428
|
-
.modelValue="${{
|
|
387
|
+
.modelValue="${{
|
|
388
|
+
value: 'male',
|
|
389
|
+
checked: false,
|
|
390
|
+
}}"
|
|
429
391
|
></${childTag}>
|
|
430
392
|
<${childTag}
|
|
431
|
-
.modelValue="${{
|
|
393
|
+
.modelValue="${{
|
|
394
|
+
value: 'female',
|
|
395
|
+
checked: true,
|
|
396
|
+
}}"
|
|
432
397
|
></${childTag}>
|
|
433
398
|
<${childTag}
|
|
434
|
-
.modelValue="${{
|
|
399
|
+
.modelValue="${{
|
|
400
|
+
value: 'other',
|
|
401
|
+
checked: false,
|
|
402
|
+
}}"
|
|
435
403
|
></${childTag}>
|
|
436
404
|
</${parentTag}>
|
|
437
|
-
`)
|
|
438
|
-
);
|
|
439
|
-
|
|
405
|
+
`);
|
|
440
406
|
if (cfg.choiceType === 'single') {
|
|
441
407
|
expect(el.modelValue).to.equal('female');
|
|
442
408
|
} else {
|
|
@@ -445,41 +411,65 @@ export function runChoiceGroupMixinSuite({ parentTagString, childTagString, choi
|
|
|
445
411
|
el.modelValue = 'other';
|
|
446
412
|
expect(el.formElements[2].checked).to.be.true;
|
|
447
413
|
});
|
|
448
|
-
|
|
449
414
|
it('can check a choice by supplying an available modelValue even if this modelValue is an array or object', async () => {
|
|
450
|
-
const el =
|
|
415
|
+
const el =
|
|
416
|
+
/** @type {ChoiceInputGroup} */
|
|
451
417
|
await fixture(html`
|
|
452
418
|
<${parentTag} name="gender[]">
|
|
453
419
|
<${childTag}
|
|
454
|
-
.modelValue="${{
|
|
420
|
+
.modelValue="${{
|
|
421
|
+
value: {
|
|
422
|
+
v: 'male',
|
|
423
|
+
},
|
|
424
|
+
checked: false,
|
|
425
|
+
}}"
|
|
455
426
|
></${childTag}>
|
|
456
427
|
<${childTag}
|
|
457
|
-
.modelValue="${{
|
|
428
|
+
.modelValue="${{
|
|
429
|
+
value: {
|
|
430
|
+
v: 'female',
|
|
431
|
+
},
|
|
432
|
+
checked: true,
|
|
433
|
+
}}"
|
|
458
434
|
></${childTag}>
|
|
459
435
|
<${childTag}
|
|
460
|
-
.modelValue="${{
|
|
436
|
+
.modelValue="${{
|
|
437
|
+
value: {
|
|
438
|
+
v: 'other',
|
|
439
|
+
},
|
|
440
|
+
checked: false,
|
|
441
|
+
}}"
|
|
461
442
|
></${childTag}>
|
|
462
443
|
</${parentTag}>
|
|
463
|
-
`)
|
|
464
|
-
);
|
|
465
|
-
|
|
444
|
+
`);
|
|
466
445
|
if (cfg.choiceType === 'single') {
|
|
467
|
-
expect(el.modelValue).to.eql({
|
|
446
|
+
expect(el.modelValue).to.eql({
|
|
447
|
+
v: 'female',
|
|
448
|
+
});
|
|
468
449
|
} else {
|
|
469
|
-
expect(el.modelValue).to.deep.equal([
|
|
450
|
+
expect(el.modelValue).to.deep.equal([
|
|
451
|
+
{
|
|
452
|
+
v: 'female',
|
|
453
|
+
},
|
|
454
|
+
]);
|
|
470
455
|
}
|
|
471
|
-
|
|
472
456
|
if (cfg.choiceType === 'single') {
|
|
473
|
-
el.modelValue = {
|
|
457
|
+
el.modelValue = {
|
|
458
|
+
v: 'other',
|
|
459
|
+
};
|
|
474
460
|
} else {
|
|
475
|
-
el.modelValue = [
|
|
461
|
+
el.modelValue = [
|
|
462
|
+
{
|
|
463
|
+
v: 'other',
|
|
464
|
+
},
|
|
465
|
+
];
|
|
476
466
|
}
|
|
477
467
|
expect(el.formElements[2].checked).to.be.true;
|
|
478
468
|
});
|
|
479
|
-
|
|
480
469
|
it('expect child nodes to only fire one model-value-changed event per instance', async () => {
|
|
481
470
|
let counter = 0;
|
|
482
|
-
const el =
|
|
471
|
+
const el =
|
|
472
|
+
/** @type {ChoiceInputGroup} */
|
|
483
473
|
await fixture(html`
|
|
484
474
|
<${parentTag}
|
|
485
475
|
name="gender[]"
|
|
@@ -489,13 +479,14 @@ export function runChoiceGroupMixinSuite({ parentTagString, childTagString, choi
|
|
|
489
479
|
>
|
|
490
480
|
<${childTag} .choiceValue=${'male'}></${childTag}>
|
|
491
481
|
<${childTag}
|
|
492
|
-
.modelValue=${{
|
|
482
|
+
.modelValue=${{
|
|
483
|
+
value: 'female',
|
|
484
|
+
checked: true,
|
|
485
|
+
}}
|
|
493
486
|
></${childTag}>
|
|
494
487
|
<${childTag} .choiceValue=${'other'}></${childTag}>
|
|
495
488
|
</${parentTag}>
|
|
496
|
-
`)
|
|
497
|
-
);
|
|
498
|
-
|
|
489
|
+
`);
|
|
499
490
|
counter = 0; // reset after setup which may result in different results
|
|
500
491
|
|
|
501
492
|
el.formElements[0].checked = true;
|
|
@@ -504,7 +495,6 @@ export function runChoiceGroupMixinSuite({ parentTagString, childTagString, choi
|
|
|
504
495
|
// not changed values trigger no event
|
|
505
496
|
el.formElements[0].checked = true;
|
|
506
497
|
expect(counter).to.equal(1);
|
|
507
|
-
|
|
508
498
|
el.formElements[2].checked = true;
|
|
509
499
|
expect(counter).to.equal(2); // other becomes checked
|
|
510
500
|
|
|
@@ -512,56 +502,51 @@ export function runChoiceGroupMixinSuite({ parentTagString, childTagString, choi
|
|
|
512
502
|
// not found values trigger no event
|
|
513
503
|
el.modelValue = 'foo';
|
|
514
504
|
expect(counter).to.equal(2);
|
|
515
|
-
|
|
516
505
|
el.modelValue = 'male';
|
|
517
506
|
expect(counter).to.equal(3); // male becomes checked, other becomes unchecked
|
|
518
507
|
}
|
|
519
|
-
|
|
520
508
|
if (choiceType === 'multiple') {
|
|
521
509
|
// not found values trigger no event
|
|
522
510
|
el.modelValue = ['foo', 'male', 'female', 'other'];
|
|
523
511
|
expect(counter).to.equal(2);
|
|
524
|
-
|
|
525
512
|
el.modelValue = ['female', 'other'];
|
|
526
513
|
expect(counter).to.equal(3); // male becomes unchecked
|
|
527
514
|
}
|
|
528
515
|
});
|
|
529
|
-
|
|
530
516
|
it('can be required', async () => {
|
|
531
|
-
const el =
|
|
517
|
+
const el =
|
|
518
|
+
/** @type {ChoiceInputGroup} */
|
|
532
519
|
await fixture(html`
|
|
533
520
|
<${parentTag} name="gender[]" .validators=${[new Required()]}>
|
|
534
521
|
<${childTag} .choiceValue=${'male'}></${childTag}>
|
|
535
522
|
<${childTag}
|
|
536
|
-
.choiceValue=${{
|
|
523
|
+
.choiceValue=${{
|
|
524
|
+
subObject: 'satisfies required',
|
|
525
|
+
}}
|
|
537
526
|
></${childTag}>
|
|
538
527
|
</${parentTag}>
|
|
539
|
-
`)
|
|
540
|
-
);
|
|
528
|
+
`);
|
|
541
529
|
expect(el.hasFeedbackFor).to.include('error');
|
|
542
530
|
expect(el.validationStates.error).to.exist;
|
|
543
531
|
expect(el.validationStates.error.Required).to.exist;
|
|
544
|
-
|
|
545
532
|
el.formElements[0].checked = true;
|
|
546
533
|
expect(el.hasFeedbackFor).not.to.include('error');
|
|
547
534
|
expect(el.validationStates.error).to.exist;
|
|
548
535
|
expect(el.validationStates.error.Required).to.not.exist;
|
|
549
|
-
|
|
550
536
|
el.formElements[1].checked = true;
|
|
551
537
|
expect(el.hasFeedbackFor).not.to.include('error');
|
|
552
538
|
expect(el.validationStates.error).to.exist;
|
|
553
539
|
expect(el.validationStates.error.Required).to.not.exist;
|
|
554
540
|
});
|
|
555
|
-
|
|
556
541
|
it('returns serialized value', async () => {
|
|
557
|
-
const el =
|
|
542
|
+
const el =
|
|
543
|
+
/** @type {ChoiceInputGroup} */
|
|
558
544
|
await fixture(html`
|
|
559
545
|
<${parentTag} name="gender[]">
|
|
560
546
|
<${childTag} .choiceValue=${'male'}></${childTag}>
|
|
561
547
|
<${childTag} .choiceValue=${'female'}></${childTag}>
|
|
562
548
|
</${parentTag}>
|
|
563
|
-
`)
|
|
564
|
-
);
|
|
549
|
+
`);
|
|
565
550
|
el.formElements[0].checked = true;
|
|
566
551
|
if (cfg.choiceType === 'single') {
|
|
567
552
|
expect(el.serializedValue).to.deep.equal('male');
|
|
@@ -569,162 +554,145 @@ export function runChoiceGroupMixinSuite({ parentTagString, childTagString, choi
|
|
|
569
554
|
expect(el.serializedValue).to.deep.equal(['male']);
|
|
570
555
|
}
|
|
571
556
|
});
|
|
572
|
-
|
|
573
557
|
it('returns serialized value on unchecked state', async () => {
|
|
574
|
-
const el =
|
|
558
|
+
const el =
|
|
559
|
+
/** @type {ChoiceInputGroup} */
|
|
575
560
|
await fixture(html`
|
|
576
561
|
<${parentTag} name="gender[]">
|
|
577
562
|
<${childTag} .choiceValue=${'male'}></${childTag}>
|
|
578
563
|
<${childTag} .choiceValue=${'female'}></${childTag}>
|
|
579
564
|
</${parentTag}>
|
|
580
|
-
`)
|
|
581
|
-
);
|
|
582
|
-
|
|
565
|
+
`);
|
|
583
566
|
if (cfg.choiceType === 'single') {
|
|
584
567
|
expect(el.serializedValue).to.deep.equal('');
|
|
585
568
|
} else {
|
|
586
569
|
expect(el.serializedValue).to.deep.equal([]);
|
|
587
570
|
}
|
|
588
571
|
});
|
|
589
|
-
|
|
590
572
|
it('can be cleared', async () => {
|
|
591
|
-
const el =
|
|
573
|
+
const el =
|
|
574
|
+
/** @type {ChoiceInputGroup} */
|
|
592
575
|
await fixture(html`
|
|
593
576
|
<${parentTag} name="gender[]">
|
|
594
577
|
<${childTag} .choiceValue=${'male'}></${childTag}>
|
|
595
578
|
<${childTag} .choiceValue=${'female'}></${childTag}>
|
|
596
579
|
</${parentTag}>
|
|
597
|
-
`)
|
|
598
|
-
);
|
|
580
|
+
`);
|
|
599
581
|
el.formElements[0].checked = true;
|
|
600
582
|
el.clear();
|
|
601
|
-
|
|
602
583
|
if (cfg.choiceType === 'single') {
|
|
603
584
|
expect(el.serializedValue).to.deep.equal('');
|
|
604
585
|
} else {
|
|
605
586
|
expect(el.serializedValue).to.deep.equal([]);
|
|
606
587
|
}
|
|
607
588
|
});
|
|
608
|
-
|
|
609
589
|
describe('multipleChoice', () => {
|
|
610
590
|
it('has multiple _initialModelValue representing initial checked values', async () => {
|
|
611
|
-
const el =
|
|
591
|
+
const el =
|
|
592
|
+
/** @type {ChoiceInputGroup} */
|
|
612
593
|
await fixture(html`
|
|
613
594
|
<${parentTag} multiple-choice name="animals[]">
|
|
614
595
|
<${childTag} .choiceValue=${'dog'} checked></${childTag}>
|
|
615
596
|
<${childTag} .choiceValue=${'cat'} checked></${childTag}>
|
|
616
597
|
<${childTag} .choiceValue=${'lion'}></${childTag}>
|
|
617
598
|
</${parentTag}>
|
|
618
|
-
`)
|
|
619
|
-
);
|
|
599
|
+
`);
|
|
620
600
|
|
|
621
601
|
// @ts-ignore protected members allowed in test
|
|
622
602
|
expect(el._initialModelValue).to.eql(['dog', 'cat']);
|
|
623
603
|
expect(el.modelValue).to.eql(['dog', 'cat']);
|
|
624
|
-
|
|
625
604
|
el.formElements[2].checked = true;
|
|
626
605
|
|
|
627
606
|
// @ts-ignore protected members allowed in test
|
|
628
607
|
expect(el._initialModelValue).to.eql(['dog', 'cat']);
|
|
629
608
|
expect(el.modelValue).to.eql(['dog', 'cat', 'lion']);
|
|
630
609
|
});
|
|
631
|
-
|
|
632
610
|
it('has a single modelValue representing all currently checked values', async () => {
|
|
633
|
-
const el =
|
|
611
|
+
const el =
|
|
612
|
+
/** @type {ChoiceInputGroup} */
|
|
634
613
|
await fixture(html`
|
|
635
614
|
<${parentTag} multiple-choice name="gender[]">
|
|
636
615
|
<${childTag} .choiceValue=${'male'}></${childTag}>
|
|
637
616
|
<${childTag} .choiceValue=${'female'} checked></${childTag}>
|
|
638
617
|
<${childTag} .choiceValue=${'other'}></${childTag}>
|
|
639
618
|
</${parentTag}>
|
|
640
|
-
`)
|
|
641
|
-
);
|
|
642
|
-
|
|
619
|
+
`);
|
|
643
620
|
expect(el.modelValue).to.eql(['female']);
|
|
644
621
|
el.formElements[0].checked = true;
|
|
645
622
|
expect(el.modelValue).to.eql(['male', 'female']);
|
|
646
623
|
el.formElements[2].checked = true;
|
|
647
624
|
expect(el.modelValue).to.eql(['male', 'female', 'other']);
|
|
648
625
|
});
|
|
649
|
-
|
|
650
626
|
it('has a single serializedValue representing all currently checked values', async () => {
|
|
651
|
-
const el =
|
|
627
|
+
const el =
|
|
628
|
+
/** @type {ChoiceInputGroup} */
|
|
652
629
|
await fixture(html`
|
|
653
630
|
<${parentTag} multiple-choice name="gender[]">
|
|
654
631
|
<${childTag} .choiceValue=${'male'}></${childTag}>
|
|
655
632
|
<${childTag} .choiceValue=${'female'} checked></${childTag}>
|
|
656
633
|
<${childTag} .choiceValue=${'other'}></${childTag}>
|
|
657
634
|
</${parentTag}>
|
|
658
|
-
`)
|
|
659
|
-
);
|
|
660
|
-
|
|
635
|
+
`);
|
|
661
636
|
expect(el.serializedValue).to.eql(['female']);
|
|
662
637
|
el.formElements[0].checked = true;
|
|
663
638
|
expect(el.serializedValue).to.eql(['male', 'female']);
|
|
664
639
|
el.formElements[2].checked = true;
|
|
665
640
|
expect(el.serializedValue).to.eql(['male', 'female', 'other']);
|
|
666
641
|
});
|
|
667
|
-
|
|
668
642
|
it('has a single formattedValue representing all currently checked values', async () => {
|
|
669
|
-
const el =
|
|
643
|
+
const el =
|
|
644
|
+
/** @type {ChoiceInputGroup} */
|
|
670
645
|
await fixture(html`
|
|
671
646
|
<${parentTag} multiple-choice name="gender[]">
|
|
672
647
|
<${childTag} .choiceValue=${'male'}></${childTag}>
|
|
673
648
|
<${childTag} .choiceValue=${'female'} checked></${childTag}>
|
|
674
649
|
<${childTag} .choiceValue=${'other'}></${childTag}>
|
|
675
650
|
</${parentTag}>
|
|
676
|
-
`)
|
|
677
|
-
);
|
|
678
|
-
|
|
651
|
+
`);
|
|
679
652
|
expect(el.formattedValue).to.eql(['female']);
|
|
680
653
|
el.formElements[0].checked = true;
|
|
681
654
|
expect(el.formattedValue).to.eql(['male', 'female']);
|
|
682
655
|
el.formElements[2].checked = true;
|
|
683
656
|
expect(el.formattedValue).to.eql(['male', 'female', 'other']);
|
|
684
657
|
});
|
|
685
|
-
|
|
686
658
|
it('can check multiple checkboxes by setting the modelValue', async () => {
|
|
687
|
-
const el =
|
|
659
|
+
const el =
|
|
660
|
+
/** @type {ChoiceInputGroup} */
|
|
688
661
|
await fixture(html`
|
|
689
662
|
<${parentTag} multiple-choice name="gender[]">
|
|
690
663
|
<${childTag} .choiceValue=${'male'}></${childTag}>
|
|
691
664
|
<${childTag} .choiceValue=${'female'}></${childTag}>
|
|
692
665
|
<${childTag} .choiceValue=${'other'}></${childTag}>
|
|
693
666
|
</${parentTag}>
|
|
694
|
-
`)
|
|
695
|
-
);
|
|
696
|
-
|
|
667
|
+
`);
|
|
697
668
|
el.modelValue = ['male', 'other'];
|
|
698
669
|
expect(el.modelValue).to.eql(['male', 'other']);
|
|
699
670
|
expect(el.formElements[0].checked).to.be.true;
|
|
700
671
|
expect(el.formElements[2].checked).to.be.true;
|
|
701
672
|
});
|
|
702
|
-
|
|
703
673
|
it('unchecks non-matching checkboxes when setting the modelValue', async () => {
|
|
704
|
-
const el =
|
|
674
|
+
const el =
|
|
675
|
+
/** @type {ChoiceInputGroup} */
|
|
705
676
|
await fixture(html`
|
|
706
677
|
<${parentTag} multiple-choice name="gender[]">
|
|
707
678
|
<${childTag} .choiceValue=${'male'} checked></${childTag}>
|
|
708
679
|
<${childTag} .choiceValue=${'female'}></${childTag}>
|
|
709
680
|
<${childTag} .choiceValue=${'other'} checked></${childTag}>
|
|
710
681
|
</${parentTag}>
|
|
711
|
-
`)
|
|
712
|
-
);
|
|
713
|
-
|
|
682
|
+
`);
|
|
714
683
|
expect(el.modelValue).to.eql(['male', 'other']);
|
|
715
684
|
expect(el.formElements[0].checked).to.be.true;
|
|
716
685
|
expect(el.formElements[2].checked).to.be.true;
|
|
717
|
-
|
|
718
686
|
el.modelValue = ['female'];
|
|
719
687
|
expect(el.formElements[0].checked).to.be.false;
|
|
720
688
|
expect(el.formElements[1].checked).to.be.true;
|
|
721
689
|
expect(el.formElements[2].checked).to.be.false;
|
|
722
690
|
});
|
|
723
691
|
});
|
|
724
|
-
|
|
725
692
|
describe('Integration with a parent form/fieldset', () => {
|
|
726
693
|
it('will serialize all children with their serializedValue', async () => {
|
|
727
|
-
const el =
|
|
694
|
+
const el =
|
|
695
|
+
/** @type {ChoiceInputGroup} */
|
|
728
696
|
await fixture(html`
|
|
729
697
|
<lion-fieldset>
|
|
730
698
|
<${parentTag} name="gender[]">
|
|
@@ -733,17 +701,18 @@ export function runChoiceGroupMixinSuite({ parentTagString, childTagString, choi
|
|
|
733
701
|
<${childTag} .choiceValue=${'other'}></${childTag}>
|
|
734
702
|
</${parentTag}>
|
|
735
703
|
</lion-fieldset>
|
|
736
|
-
`)
|
|
737
|
-
);
|
|
738
|
-
|
|
704
|
+
`);
|
|
739
705
|
if (cfg.choiceType === 'single') {
|
|
740
|
-
expect(el.serializedValue).to.deep.equal({
|
|
706
|
+
expect(el.serializedValue).to.deep.equal({
|
|
707
|
+
'gender[]': ['female'],
|
|
708
|
+
});
|
|
741
709
|
} else {
|
|
742
|
-
expect(el.serializedValue).to.deep.equal({
|
|
710
|
+
expect(el.serializedValue).to.deep.equal({
|
|
711
|
+
'gender[]': [['female']],
|
|
712
|
+
});
|
|
743
713
|
}
|
|
744
714
|
});
|
|
745
715
|
});
|
|
746
|
-
|
|
747
716
|
describe('Modelvalue event propagation', () => {
|
|
748
717
|
it('sends one event for single select choice-groups', async () => {
|
|
749
718
|
const formSpy = sinon.spy();
|
|
@@ -756,20 +725,19 @@ export function runChoiceGroupMixinSuite({ parentTagString, childTagString, choi
|
|
|
756
725
|
</${parentTag}>
|
|
757
726
|
</lion-fieldset>
|
|
758
727
|
`);
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
formEl.querySelector('[name=choice-group]')
|
|
762
|
-
);
|
|
728
|
+
const choiceGroupEl =
|
|
729
|
+
/** @type {ChoiceInputGroup} */
|
|
730
|
+
formEl.querySelector('[name=choice-group]');
|
|
763
731
|
if (choiceGroupEl.multipleChoice) {
|
|
764
732
|
return;
|
|
765
733
|
}
|
|
766
734
|
/** @typedef {{ checked: boolean }} checkedInterface */
|
|
767
|
-
const option1El =
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
const option2El =
|
|
771
|
-
|
|
772
|
-
|
|
735
|
+
const option1El =
|
|
736
|
+
/** @type {HTMLElement & checkedInterface} */
|
|
737
|
+
formEl.querySelector('#option1');
|
|
738
|
+
const option2El =
|
|
739
|
+
/** @type {HTMLElement & checkedInterface} */
|
|
740
|
+
formEl.querySelector('#option2');
|
|
773
741
|
formEl.addEventListener('model-value-changed', formSpy);
|
|
774
742
|
choiceGroupEl?.addEventListener('model-value-changed', choiceGroupSpy);
|
|
775
743
|
|
|
@@ -784,7 +752,6 @@ export function runChoiceGroupMixinSuite({ parentTagString, childTagString, choi
|
|
|
784
752
|
expect(choiceGroupEv.target).to.equal(choiceGroupEl);
|
|
785
753
|
expect(choiceGroupEv.detail.formPath).to.eql([choiceGroupEl]);
|
|
786
754
|
expect(choiceGroupEv.detail.isTriggeredByUser).to.be.false;
|
|
787
|
-
|
|
788
755
|
expect(formSpy.callCount).to.equal(1);
|
|
789
756
|
const formEv = formSpy.firstCall.args[0];
|
|
790
757
|
expect(formEv.target).to.equal(formEl);
|