@sbb-esta/lyne-elements 2.11.0 → 2.11.2
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/accordion/accordion.component.js +19 -22
- package/action-group/action-group.component.js +3 -5
- package/alert/alert/alert.component.js +1 -2
- package/alert/alert-group/alert-group.component.js +2 -3
- package/autocomplete/autocomplete-base-element.js +71 -82
- package/autocomplete/autocomplete.component.js +31 -36
- package/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.js +44 -52
- package/autocomplete-grid/autocomplete-grid-button/autocomplete-grid-button.component.js +3 -4
- package/autocomplete-grid/autocomplete-grid-optgroup/autocomplete-grid-optgroup.component.js +17 -20
- package/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.component.js +23 -26
- package/autocomplete-grid/autocomplete-grid-row/autocomplete-grid-row.component.js +9 -9
- package/breadcrumb/breadcrumb-group/breadcrumb-group.component.js +29 -33
- package/button/mini-button/mini-button.component.js +1 -1
- package/button/mini-button-group/mini-button-group.component.js +1 -2
- package/calendar/calendar.component.js +8 -13
- package/card/card/card.component.js +12 -12
- package/card/card-badge/card-badge.component.js +16 -16
- package/card/common/card-action-common.js +23 -25
- package/checkbox/checkbox/checkbox.component.js +17 -20
- package/checkbox/checkbox-group/checkbox-group.component.js +39 -52
- package/checkbox/checkbox-panel/checkbox-panel.component.js +22 -25
- package/checkbox/common/checkbox-common.js +13 -15
- package/chip/chip-group/chip-group.component.js +59 -70
- package/clock/clock.component.js +50 -60
- package/container/container/container.component.js +28 -29
- package/container/sticky-bar/sticky-bar.component.js +26 -27
- package/core/a11y/focus-trap-controller.js +11 -14
- package/core/a11y/focus.js +27 -29
- package/core/a11y/input-modality-detector.js +18 -19
- package/core/a11y/interactivity-checker.js +10 -10
- package/core/base-elements/button-base-element.js +13 -18
- package/core/base-elements/link-base-element.js +3 -6
- package/core/base-elements/open-close-base-element.js +1 -1
- package/core/controllers/connected-abort-controller.js +2 -4
- package/core/controllers/escapable-overlay-controller.js +10 -12
- package/core/controllers/id-reference-controller.js +13 -14
- package/core/controllers/inert-controller.js +8 -10
- package/core/controllers/slot-state-controller.js +16 -26
- package/core/datetime/date-adapter.d.ts.map +1 -1
- package/core/datetime/date-adapter.js +21 -21
- package/core/datetime/native-date-adapter.js +11 -11
- package/core/decorators/date-converter.js +10 -12
- package/core/decorators/date-only-type.js +5 -6
- package/core/decorators/force-type.js +4 -5
- package/core/dom/breakpoint.js +8 -8
- package/core/dom/input-element.js +4 -9
- package/core/eventing/event-emitter.js +4 -5
- package/core/mixins/form-associated-checkbox-mixin.js +32 -37
- package/core/mixins/form-associated-input-mixin.js +58 -64
- package/core/mixins/form-associated-mixin.js +42 -44
- package/core/mixins/form-associated-radio-button-mixin.js +3 -5
- package/core/mixins/hydration-mixin.js +12 -13
- package/core/mixins/named-slot-list-mixin.js +32 -37
- package/core/mixins/panel-mixin.js +26 -27
- package/core/mixins.js +1 -1
- package/core/overlay/position.js +23 -23
- package/core/styles/core/mediaqueries.scss +1 -1
- package/core/styles/core.scss +27 -28
- package/core/styles/mixins/table.scss +1 -24
- package/core/styles/mixins/typo.scss +0 -1
- package/core/testing/event-spy.js +2 -4
- package/core/testing/wait-for-image-ready.js +8 -9
- package/core/testing/wait-for-render.js +8 -9
- package/custom-elements.json +2 -2
- package/date-input/date-input.component.js +2 -4
- package/datepicker/common/datepicker-association-controllers.js +21 -24
- package/datepicker/common/datepicker-button.js +53 -57
- package/datepicker/datepicker/datepicker.component.js +82 -95
- package/datepicker/datepicker-next-day/datepicker-next-day.component.js +1 -1
- package/datepicker/datepicker-previous-day/datepicker-previous-day.component.js +1 -1
- package/datepicker/datepicker-toggle/datepicker-toggle.component.js +74 -81
- package/development/accordion/accordion.component.js +4 -7
- package/development/action-group/action-group.component.js +3 -5
- package/development/alert/alert/alert.component.js +2 -3
- package/development/alert/alert-group/alert-group.component.js +2 -3
- package/development/autocomplete/autocomplete-base-element.js +19 -30
- package/development/autocomplete/autocomplete.component.js +7 -12
- package/development/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.js +10 -18
- package/development/autocomplete-grid/autocomplete-grid-button/autocomplete-grid-button.component.js +3 -4
- package/development/autocomplete-grid/autocomplete-grid-cell/autocomplete-grid-cell.component.js +1 -1
- package/development/autocomplete-grid/autocomplete-grid-optgroup/autocomplete-grid-optgroup.component.js +4 -7
- package/development/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.component.js +4 -7
- package/development/autocomplete-grid/autocomplete-grid-row/autocomplete-grid-row.component.js +2 -2
- package/development/breadcrumb/breadcrumb/breadcrumb.component.js +1 -1
- package/development/breadcrumb/breadcrumb-group/breadcrumb-group.component.js +5 -9
- package/development/button/accent-button/accent-button.component.js +1 -1
- package/development/button/accent-button-link/accent-button-link.component.js +1 -1
- package/development/button/accent-button-static/accent-button-static.component.js +1 -1
- package/development/button/button/button.component.js +1 -1
- package/development/button/button-link/button-link.component.js +1 -1
- package/development/button/button-static/button-static.component.js +1 -1
- package/development/button/common/button-common.js +1 -1
- package/development/button/mini-button/mini-button.component.js +1 -1
- package/development/button/mini-button-group/mini-button-group.component.js +2 -3
- package/development/button/secondary-button/secondary-button.component.js +1 -1
- package/development/button/secondary-button-link/secondary-button-link.component.js +1 -1
- package/development/button/secondary-button-static/secondary-button-static.component.js +1 -1
- package/development/button/transparent-button/transparent-button.component.js +1 -1
- package/development/button/transparent-button-link/transparent-button-link.component.js +1 -1
- package/development/button/transparent-button-static/transparent-button-static.component.js +1 -1
- package/development/calendar/calendar.component.js +9 -14
- package/development/card/card/card.component.js +1 -1
- package/development/card/card-badge/card-badge.component.js +1 -1
- package/development/card/card-button/card-button.component.js +1 -1
- package/development/card/card-link/card-link.component.js +1 -1
- package/development/card/common/card-action-common.js +3 -5
- package/development/checkbox/checkbox/checkbox.component.js +2 -5
- package/development/checkbox/checkbox-group/checkbox-group.component.js +8 -21
- package/development/checkbox/checkbox-panel/checkbox-panel.component.js +2 -5
- package/development/checkbox/common/checkbox-common.js +3 -5
- package/development/chip/chip/chip.component.js +1 -1
- package/development/chip/chip-group/chip-group.component.js +15 -26
- package/development/chip-label/chip-label.component.js +1 -1
- package/development/clock/clock.component.js +23 -33
- package/development/container/container/container.component.js +2 -3
- package/development/container/sticky-bar/sticky-bar.component.js +2 -3
- package/development/core/a11y/arrow-navigation.js +1 -1
- package/development/core/a11y/fake-event-detection.js +1 -1
- package/development/core/a11y/focus-trap-controller.js +6 -9
- package/development/core/a11y/focus-visible-within-controller.js +1 -1
- package/development/core/a11y/focus.js +8 -10
- package/development/core/a11y/input-modality-detector.js +2 -3
- package/development/core/a11y/interactivity-checker.js +2 -2
- package/development/core/base-elements/action-base-element.js +2 -3
- package/development/core/base-elements/button-base-element.js +6 -11
- package/development/core/base-elements/link-base-element.js +4 -7
- package/development/core/base-elements/open-close-base-element.js +2 -2
- package/development/core/config/config.js +1 -1
- package/development/core/controllers/connected-abort-controller.js +3 -5
- package/development/core/controllers/escapable-overlay-controller.js +3 -5
- package/development/core/controllers/id-reference-controller.js +2 -3
- package/development/core/controllers/inert-controller.js +4 -6
- package/development/core/controllers/language-controller.js +1 -1
- package/development/core/controllers/media-matchers-controller.js +1 -1
- package/development/core/controllers/slot-state-controller.js +8 -18
- package/development/core/datetime/date-adapter.d.ts.map +1 -1
- package/development/core/datetime/date-adapter.js +5 -5
- package/development/core/datetime/native-date-adapter.js +2 -2
- package/development/core/decorators/date-converter.js +3 -5
- package/development/core/decorators/date-only-type.js +2 -3
- package/development/core/decorators/force-type.js +3 -4
- package/development/core/decorators/get-override.js +1 -1
- package/development/core/decorators/handle-distinct-change.js +1 -1
- package/development/core/decorators/host-attributes.js +1 -1
- package/development/core/decorators/slot-state.js +1 -1
- package/development/core/dom/animation.js +1 -1
- package/development/core/dom/breakpoint.js +2 -2
- package/development/core/dom/find-referenced-element.js +1 -1
- package/development/core/dom/host-context.js +1 -1
- package/development/core/dom/input-element.js +3 -4
- package/development/core/dom/platform.js +1 -1
- package/development/core/dom/scroll.js +1 -1
- package/development/core/dom/set-or-remove-attribute.js +1 -1
- package/development/core/eventing/composed-path-has-attribute.js +1 -1
- package/development/core/eventing/event-emitter.js +2 -3
- package/development/core/eventing/form-element-handlers.js +1 -1
- package/development/core/eventing/forward-event.js +1 -1
- package/development/core/eventing/throttle.js +1 -1
- package/development/core/i18n/i18n.js +1 -1
- package/development/core/mixins/animation-complete-mixin.js +1 -1
- package/development/core/mixins/disabled-mixin.js +1 -1
- package/development/core/mixins/form-associated-checkbox-mixin.js +6 -9
- package/development/core/mixins/form-associated-input-mixin.js +14 -20
- package/development/core/mixins/form-associated-mixin.js +5 -7
- package/development/core/mixins/form-associated-radio-button-mixin.js +7 -9
- package/development/core/mixins/hydration-mixin.js +3 -4
- package/development/core/mixins/named-slot-list-mixin.js +4 -7
- package/development/core/mixins/negative-mixin.js +1 -1
- package/development/core/mixins/panel-mixin.js +2 -3
- package/development/core/mixins/required-mixin.js +1 -1
- package/development/core/mixins/update-scheduler-mixin.js +1 -1
- package/development/core/overlay/overlay-option-panel.js +1 -1
- package/development/core/overlay/overlay-trigger-attributes.js +1 -1
- package/development/core/overlay/overlay.js +1 -1
- package/development/core/overlay/position.js +5 -5
- package/development/core/testing/event-spy.js +3 -5
- package/development/core/testing/mocha-extensions.js +1 -1
- package/development/core/testing/wait-for-condition.js +1 -1
- package/development/core/testing/wait-for-image-ready.js +2 -3
- package/development/core/testing/wait-for-render.js +2 -3
- package/development/date-input/date-input.component.js +4 -6
- package/development/datepicker/common/datepicker-association-controllers.js +6 -9
- package/development/datepicker/common/datepicker-button.js +7 -11
- package/development/datepicker/datepicker/datepicker.component.js +22 -35
- package/development/datepicker/datepicker-next-day/datepicker-next-day.component.js +1 -1
- package/development/datepicker/datepicker-previous-day/datepicker-previous-day.component.js +1 -1
- package/development/datepicker/datepicker-toggle/datepicker-toggle.component.js +13 -20
- package/development/dialog/dialog/dialog.component.js +16 -27
- package/development/dialog/dialog-actions/dialog-actions.component.js +1 -1
- package/development/dialog/dialog-content/dialog-content.component.js +1 -1
- package/development/dialog/dialog-title/dialog-title.component.js +1 -1
- package/development/divider/divider.component.js +1 -1
- package/development/expansion-panel/expansion-panel/expansion-panel.component.js +9 -13
- package/development/expansion-panel/expansion-panel-content/expansion-panel-content.component.js +1 -1
- package/development/expansion-panel/expansion-panel-header/expansion-panel-header.component.js +4 -5
- package/development/file-selector/common/file-selector-common.js +2 -3
- package/development/file-selector/file-selector/file-selector.component.js +1 -1
- package/development/file-selector/file-selector-dropzone/file-selector-dropzone.component.js +1 -1
- package/development/flip-card/flip-card/flip-card.component.js +7 -13
- package/development/flip-card/flip-card-details/flip-card-details.component.js +2 -3
- package/development/flip-card/flip-card-summary/flip-card-summary.component.js +2 -3
- package/development/footer/footer.component.js +1 -1
- package/development/form-error/form-error.component.js +3 -4
- package/development/form-field/form-field/form-field.component.js +19 -30
- package/development/form-field/form-field-clear/form-field-clear.component.js +4 -6
- package/development/header/common/header-action-common.js +1 -1
- package/development/header/header/header.component.js +5 -8
- package/development/header/header-button/header-button.component.js +1 -1
- package/development/header/header-link/header-link.component.js +1 -1
- package/development/icon/icon-base.js +1 -1
- package/development/icon/icon-name-mixin.js +1 -1
- package/development/icon/icon-request.js +2 -3
- package/development/icon/icon-validate.js +1 -1
- package/development/icon/icon.component.js +1 -1
- package/development/image/image.component.js +7 -9
- package/development/journey-header/journey-header.component.js +1 -1
- package/development/lead-container/lead-container.component.js +1 -1
- package/development/link/block-link/block-link.component.js +1 -1
- package/development/link/block-link-button/block-link-button.component.js +1 -1
- package/development/link/block-link-static/block-link-static.component.js +1 -1
- package/development/link/common/block-link-common.js +1 -1
- package/development/link/common/inline-link-common.js +1 -1
- package/development/link/link/link.component.js +1 -1
- package/development/link/link-button/link-button.component.js +1 -1
- package/development/link/link-static/link-static.component.js +1 -1
- package/development/link-common-CJEWffDZ.js +1 -1
- package/development/link-list/common/link-list-base.js +1 -1
- package/development/link-list/link-list/link-list.component.js +1 -1
- package/development/link-list/link-list-anchor/link-list-anchor.component.js +1 -1
- package/development/loading-indicator/loading-indicator.component.js +1 -1
- package/development/loading-indicator-circle/loading-indicator-circle.component.js +1 -1
- package/development/logo/logo.component.js +1 -1
- package/development/map-container/map-container.component.js +2 -3
- package/development/menu/common/menu-action-common.js +1 -1
- package/development/menu/menu/menu.component.js +17 -25
- package/development/menu/menu-button/menu-button.component.js +1 -1
- package/development/menu/menu-link/menu-link.component.js +1 -1
- package/development/message/message.component.js +1 -1
- package/development/navigation/common/navigation-action-common.js +3 -5
- package/development/navigation/navigation/navigation.component.js +19 -35
- package/development/navigation/navigation-button/navigation-button.component.js +1 -1
- package/development/navigation/navigation-link/navigation-link.component.js +1 -1
- package/development/navigation/navigation-list/navigation-list.component.js +1 -1
- package/development/navigation/navigation-marker/navigation-marker.component.js +4 -6
- package/development/navigation/navigation-section/navigation-section.component.js +22 -32
- package/development/notification/notification.component.js +22 -24
- package/development/option/optgroup/optgroup-base-element.js +4 -6
- package/development/option/optgroup/optgroup.component.js +6 -10
- package/development/option/option/option-base-element.js +3 -4
- package/development/option/option/option.component.js +7 -10
- package/development/overlay/overlay-base-element.js +4 -6
- package/development/overlay/overlay.component.js +7 -9
- package/development/paginator/common/paginator-common.js +1 -1
- package/development/paginator/compact-paginator/compact-paginator.component.js +1 -1
- package/development/paginator/paginator/paginator.component.js +2 -3
- package/development/popover/popover/popover.component.d.ts.map +1 -1
- package/development/popover/popover/popover.component.js +17 -19
- package/development/popover/popover-trigger/popover-trigger.component.js +1 -1
- package/development/radio-button/common/radio-button-common.js +6 -10
- package/development/radio-button/radio-button/radio-button.component.js +2 -5
- package/development/radio-button/radio-button-group/radio-button-group.component.js +8 -24
- package/development/radio-button/radio-button-panel/radio-button-panel.component.js +3 -7
- package/development/screen-reader-only/screen-reader-only.component.js +1 -1
- package/development/select/select.component.js +26 -48
- package/development/selection-expansion-panel/selection-expansion-panel.component.js +7 -11
- package/development/sidebar/icon-sidebar/icon-sidebar.component.js +1 -1
- package/development/sidebar/icon-sidebar-button/icon-sidebar-button.component.js +1 -1
- package/development/sidebar/icon-sidebar-container/icon-sidebar-container.component.js +4 -7
- package/development/sidebar/icon-sidebar-content/icon-sidebar-content.component.js +1 -1
- package/development/sidebar/icon-sidebar-link/icon-sidebar-link.component.js +1 -1
- package/development/sidebar/sidebar/sidebar.component.js +8 -15
- package/development/sidebar/sidebar-close-button/sidebar-close-button.component.js +1 -1
- package/development/sidebar/sidebar-container/sidebar-container.component.js +9 -13
- package/development/sidebar/sidebar-content/sidebar-content.component.js +1 -1
- package/development/sidebar/sidebar-title/sidebar-title.component.js +2 -2
- package/development/signet/signet.component.js +1 -1
- package/development/skiplink-list/skiplink-list.component.js +1 -1
- package/development/slider/slider.component.js +3 -4
- package/development/status/status.component.js +3 -2
- package/development/stepper/step/step.component.js +5 -7
- package/development/stepper/step-label/step-label.component.js +3 -4
- package/development/stepper/stepper/stepper.component.js +16 -29
- package/development/table/table-wrapper/table-wrapper.component.js +2 -7
- package/development/tabs/tab/tab.component.js +1 -1
- package/development/tabs/tab-group/tab-group.component.js +23 -38
- package/development/tabs/tab-label/tab-label.component.js +1 -1
- package/development/tag/tag/tag.component.js +6 -12
- package/development/tag/tag-group/tag-group.component.js +5 -13
- package/development/teaser/teaser.component.js +1 -1
- package/development/teaser-hero/teaser-hero.component.js +1 -1
- package/development/teaser-product/common/teaser-product-common.js +1 -1
- package/development/teaser-product/teaser-product/teaser-product.component.js +1 -1
- package/development/teaser-product/teaser-product-static/teaser-product-static.component.js +1 -1
- package/development/time-input/time-input.component.js +8 -12
- package/development/timetable-occupancy/timetable-occupancy.component.js +1 -1
- package/development/timetable-occupancy-icon/timetable-occupancy-icon.component.js +2 -3
- package/development/title/title-base.js +1 -2
- package/development/title/title.component.js +1 -1
- package/development/toast/toast.component.js +4 -7
- package/development/toggle/toggle/toggle.component.js +8 -12
- package/development/toggle/toggle-option/toggle-option.component.js +9 -16
- package/development/toggle-check/toggle-check.component.js +1 -1
- package/development/train/train/train.component.js +1 -1
- package/development/train/train-blocked-passage/train-blocked-passage.component.js +1 -1
- package/development/train/train-formation/train-formation.component.js +5 -7
- package/development/train/train-wagon/train-wagon.component.js +1 -1
- package/development/visual-checkbox/visual-checkbox.component.js +1 -1
- package/dialog/dialog/dialog.component.js +59 -70
- package/expansion-panel/expansion-panel/expansion-panel.component.js +5 -9
- package/expansion-panel/expansion-panel-header/expansion-panel-header.component.js +31 -32
- package/file-selector/common/file-selector-common.js +1 -2
- package/flip-card/flip-card/flip-card.component.js +48 -54
- package/flip-card/flip-card-details/flip-card-details.component.js +16 -17
- package/flip-card/flip-card-summary/flip-card-summary.component.js +18 -19
- package/form-error/form-error.component.js +13 -14
- package/form-field/form-field/form-field.component.js +128 -139
- package/form-field/form-field-clear/form-field-clear.component.js +20 -22
- package/header/header/header.component.js +25 -28
- package/icon/icon-request.js +10 -11
- package/icon-sidebar-button-common-CM-ueEhH.js +7 -0
- package/image/image.component.js +4 -6
- package/map-container/map-container.component.js +1 -2
- package/menu/menu/menu.component.js +48 -56
- package/navigation/common/navigation-action-common.js +19 -21
- package/navigation/navigation/navigation.component.js +74 -93
- package/navigation/navigation-marker/navigation-marker.component.js +26 -28
- package/navigation/navigation-section/navigation-section.component.js +79 -89
- package/notification/notification.component.js +18 -20
- package/option/optgroup/optgroup-base-element.js +40 -42
- package/option/optgroup/optgroup.component.js +16 -20
- package/option/option/option-base-element.js +3 -4
- package/option/option/option.component.js +28 -31
- package/overlay/overlay-base-element.js +25 -27
- package/overlay/overlay.component.js +38 -40
- package/package.json +1 -1
- package/paginator/paginator/paginator.component.js +3 -4
- package/popover/popover/popover.component.d.ts.map +1 -1
- package/popover/popover/popover.component.js +65 -72
- package/popover/popover-trigger/popover-trigger.component.js +1 -1
- package/radio-button/common/radio-button-common.js +11 -15
- package/radio-button/radio-button/radio-button.component.js +20 -23
- package/radio-button/radio-button-group/radio-button-group.component.js +27 -43
- package/radio-button/radio-button-panel/radio-button-panel.component.js +31 -35
- package/select/select.component.js +89 -111
- package/selection-expansion-panel/selection-expansion-panel.component.js +35 -39
- package/sidebar/common.js +1 -1
- package/sidebar/icon-sidebar-container/icon-sidebar-container.component.js +10 -13
- package/sidebar/sidebar/sidebar.component.js +61 -68
- package/sidebar/sidebar-container/sidebar-container.component.js +29 -33
- package/sidebar/sidebar-title/sidebar-title.component.js +1 -1
- package/sidebar.js +1 -1
- package/slider/slider.component.js +3 -4
- package/standard-theme.css +0 -25
- package/status/status.component.js +17 -17
- package/stepper/step/step.component.js +22 -24
- package/stepper/step-label/step-label.component.js +2 -3
- package/stepper/stepper/stepper.component.js +72 -86
- package/table/table-wrapper/table-wrapper.component.js +13 -14
- package/table.css +0 -25
- package/tabs/tab-group/tab-group.component.js +77 -92
- package/tabs/tab-label/tab-label.component.js +10 -10
- package/tag/tag/tag.component.js +55 -61
- package/tag/tag-group/tag-group.component.js +21 -29
- package/teaser/teaser.component.js +1 -1
- package/teaser-product/common.js +1 -1
- package/teaser-product/teaser-product/teaser-product.component.js +1 -1
- package/teaser-product-common-C8oSkIxy.js +5 -0
- package/teaser-product.js +1 -1
- package/time-input/time-input.component.js +62 -66
- package/timetable-occupancy-icon/timetable-occupancy-icon.component.js +9 -10
- package/title/title-base.js +1 -1
- package/toast/toast.component.js +4 -7
- package/toggle/toggle/toggle.component.js +38 -42
- package/toggle/toggle-option/toggle-option.component.js +47 -54
- package/train/train-formation/train-formation.component.js +41 -43
- package/core/styles/node_modules_@sbb-esta_lyne-design-tokens_dist_scss_sbb-variables.scss +0 -530
- package/core/styles/node_modules_@sbb-esta_lyne-design-tokens_dist_scss_sbb-variables_css--mixin.scss +0 -1123
- package/icon-sidebar-button-common-DG8bnrBu.js +0 -7
- package/teaser-product-common-CpMAlYEp.js +0 -5
|
@@ -1,29 +1,30 @@
|
|
|
1
|
-
var
|
|
1
|
+
var oe = (o) => {
|
|
2
2
|
throw TypeError(o);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var b = (o, a, n) => (
|
|
4
|
+
var le = (o, a, n) => a.has(o) || oe("Cannot " + n);
|
|
5
|
+
var b = (o, a, n) => (le(o, a, "read from private field"), n ? n.call(o) : a.get(o)), d = (o, a, n) => a.has(o) ? oe("Cannot add the same private member more than once") : a instanceof WeakSet ? a.add(o) : a.set(o, n), r = (o, a, n, f) => (le(o, a, "write to private field"), f ? f.call(o, n) : a.set(o, n), n);
|
|
6
6
|
import { __runInitializers as s, __esDecorate as c } from "tslib";
|
|
7
|
-
import { css as fe, LitElement as pe, isServer as he, nothing as
|
|
8
|
-
import { customElement as
|
|
9
|
-
import { sbbInputModalityDetector as
|
|
7
|
+
import { css as fe, LitElement as pe, isServer as he, nothing as ae, html as z } from "lit";
|
|
8
|
+
import { customElement as ue, property as p, state as I } from "lit/decorators.js";
|
|
9
|
+
import { sbbInputModalityDetector as me } from "../../core/a11y.js";
|
|
10
10
|
import { SbbLanguageController as _e } from "../../core/controllers.js";
|
|
11
|
-
import { slotState as ge, forceType as
|
|
11
|
+
import { slotState as ge, forceType as E } from "../../core/decorators.js";
|
|
12
12
|
import { isLean as ve, isFirefox as ye, setOrRemoveAttribute as xe } from "../../core/dom.js";
|
|
13
13
|
import { i18nOptional as ke } from "../../core/i18n.js";
|
|
14
|
-
import { SbbNegativeMixin as we, SbbHydrationMixin as
|
|
14
|
+
import { SbbNegativeMixin as we, SbbHydrationMixin as Ee } from "../../core/mixins.js";
|
|
15
15
|
import "../../icon.js";
|
|
16
|
-
const Ee = fe`@charset "UTF-8";*,:before,:after{box-sizing:border-box}:host{display:inline-block;--sbb-form-field-background-color: var(--sbb-color-white);--sbb-form-field-border-color: var(--sbb-color-smoke);--sbb-form-field-border-style: solid;--sbb-form-field-border-radius: var(--sbb-border-radius-4x);--sbb-form-field-border-width: var(--sbb-border-width-1x);--sbb-form-field-min-height: var(--sbb-size-element-m);--sbb-form-field-label-color: var(--sbb-color-metal);--sbb-form-field-prefix-color: var(--sbb-color-metal);--sbb-form-field-padding-inline: var(--sbb-spacing-fixed-3x);--sbb-form-field-text-color: var(--sbb-color-charcoal);--sbb-form-field-arrow-color: var(--sbb-color-charcoal);--sbb-form-field-error-divider-width: var(--sbb-spacing-fixed-1x);--sbb-form-field-error-padding-block-start: var(--sbb-form-field-error-divider-width);--sbb-form-field-gap: var(--sbb-spacing-fixed-2x);--sbb-form-field-label-to-input-overlapping: var(--sbb-spacing-fixed-1x);--sbb-form-field-select-inline-padding-end: calc( var(--sbb-icon-svg-width) + var(--sbb-form-field-gap) );--sbb-form-field-overflow: hidden;--sbb-form-field-input-text-size: var(--sbb-font-size-text-m);--sbb-form-field-label-text-size: var(--sbb-font-size-text-xs);--sbb-form-field-label-size: calc( var(--sbb-form-field-label-text-size) * var(--sbb-typo-line-height-body-text) );--sbb-form-field-text-line-height: calc( var(--sbb-form-field-input-text-size) * var(--sbb-typo-line-height-body-text) );--sbb-form-field-margin-block-start: calc( ( var(--sbb-form-field-min-height) - var(--sbb-form-field-label-size) - var( --sbb-form-field-text-line-height ) + var(--sbb-form-field-label-to-input-overlapping) ) / 2 );--sbb-form-field-spacer-margin-block-end: calc( -1 * var(--sbb-form-field-label-to-input-overlapping) );--sbb-form-field-floating-label-transform: .53125rem;--sbb-icon-svg-width: var(--sbb-size-icon-ui-small);--sbb-icon-svg-height: var(--sbb-size-icon-ui-small);--sbb-focus-outline-color: var(--sbb-focus-outline-color-default)}@media (min-width: 52.5rem){:host{--sbb-form-field-floating-label-transform: .65625rem}}@media (forced-colors: active){:host{--sbb-form-field-border-color: ButtonBorder}}:host(:where(:not([width=collapse]))){min-width:9.375rem;width:min(18.75rem,100%)}:host([negative]){--sbb-form-field-background-color: var(--sbb-color-midnight);--sbb-form-field-border-color: var(--sbb-color-smoke);--sbb-form-field-label-color: var(--sbb-color-smoke);--sbb-form-field-prefix-color: var(--sbb-color-smoke);--sbb-form-field-text-color: var(--sbb-color-milk);--sbb-focus-outline-color: var(--sbb-focus-outline-color-dark);--sbb-form-field-arrow-color: var(--sbb-color-milk)}@media (forced-colors: active){:host([negative]){--sbb-form-field-border-color: ButtonBorder}}:host([size=s]){--sbb-form-field-min-height: var(--sbb-size-element-xs);--sbb-form-field-padding-inline: var(--sbb-spacing-fixed-2x);--sbb-form-field-input-text-size: var(--sbb-font-size-text-s);--sbb-form-field-label-text-size: var(--sbb-font-size-text-xxs);--sbb-form-field-label-to-input-overlapping: .625rem;--sbb-form-field-floating-label-transform: .34375rem;--sbb-form-field-spacer-margin-block-end: -.53125rem}@media (min-width: 52.5rem){:host([size=s]){--sbb-form-field-label-to-input-overlapping: .6875rem;--sbb-form-field-floating-label-transform: .3125rem;--sbb-form-field-spacer-margin-block-end: -.5rem}}:host([size=l]){--sbb-form-field-min-height: var(--sbb-size-element-l);--sbb-form-field-padding-inline: var(--sbb-spacing-responsive-xxxs)}:host([error-space=reserve]){--sbb-form-field-error-min-height: calc( var(--sbb-typo-line-height-body-text) * var(--sbb-font-size-text-xs) );--sbb-form-field-error-padding-block-start-override: var(--sbb-form-field-error-divider-width)}:host(:is([data-readonly],[data-disabled])){--sbb-form-field-background-color: var(--sbb-color-milk);--sbb-form-field-border-color: var(--sbb-color-graphite);--sbb-form-field-arrow-color: var(--sbb-color-granite)}@media (forced-colors: active){:host(:is([data-readonly],[data-disabled])){--sbb-form-field-border-color: ButtonBorder}}:host(:is([data-readonly],[data-disabled])[negative]){--sbb-form-field-background-color: var(--sbb-color-charcoal);--sbb-form-field-border-color: var(--sbb-color-smoke);--sbb-form-field-arrow-color: var(--sbb-color-smoke)}:host([data-disabled]){--sbb-form-field-label-color: var(--sbb-color-granite);--sbb-form-field-prefix-color: var(--sbb-color-granite);--sbb-form-field-border-style: dashed}@media (forced-colors: active){:host([data-disabled]){--sbb-form-field-label-color: GrayText !important;--sbb-form-field-prefix-color: GrayText !important;--sbb-form-field-text-color: GrayText !important;--sbb-form-field-border-color: GrayText !important}}:host([data-disabled][negative]){--sbb-form-field-text-color: var(--sbb-color-smoke);--sbb-form-field-label-color: var(--sbb-color-smoke);--sbb-form-field-prefix-color: var(--sbb-color-smoke)}:host([data-readonly]:not([negative])){--sbb-form-field-label-color: var(--sbb-color-granite);--sbb-form-field-prefix-color: var(--sbb-color-granite)}:host(:is([data-input-focused])){--sbb-form-field-border-color: var(--sbb-color-charcoal);--sbb-form-field-prefix-color: var(--sbb-color-charcoal);--sbb-form-field-border-width: var(--sbb-border-width-2x)}@media (forced-colors: active){:host(:is([data-input-focused])){--sbb-form-field-border-color: Highlight !important;--sbb-form-field-prefix-color: Highlight !important}}:host(:is([data-input-focused])[negative]){--sbb-form-field-border-color: var(--sbb-color-milk);--sbb-form-field-prefix-color: var(--sbb-color-milk)}:host([data-invalid]){--sbb-form-field-border-color: var(--sbb-color-red125);--sbb-form-field-text-color: var(--sbb-color-red125)}@media (forced-colors: active){:host([data-invalid]){--sbb-form-field-border-color: LinkText !important;--sbb-form-field-text-color: LinkText !important}}:host([data-invalid][negative]){--sbb-form-field-border-color: var(--sbb-color-red-mode-dark);--sbb-form-field-text-color: var(--sbb-color-red-mode-dark)}:host(:not([data-has-error])){--sbb-form-field-error-padding-block-start: 0}:host([floating-label]){--sbb-select-placeholder-color: transparent}@media (forced-colors: active){:host([floating-label]){--sbb-select-placeholder-color: Canvas}}:host(:is(:not([data-slot-names~=label]),[hidden-label])){--sbb-form-field-label-size: 0rem;--sbb-form-field-label-to-input-overlapping: 0rem}:host([data-input-type=sbb-slider]){--sbb-form-field-overflow: visible}:host([data-input-type=textarea]){--sbb-form-field-max-height: fit-content}.sbb-form-field__space-wrapper{display:flex;flex-direction:column}.sbb-form-field__space-wrapper:before{content:"";-webkit-user-select:none;user-select:none;width:0;height:0}.sbb-form-field__wrapper{display:flex;gap:var(--sbb-form-field-gap);padding-inline:var(--sbb-form-field-padding-inline);border-radius:var(--sbb-form-field-border-radius);min-height:var(--sbb-form-field-min-height);max-height:var(--sbb-form-field-max-height);background-color:var(--sbb-form-field-background-color);position:relative}.sbb-form-field__wrapper:before{content:"";display:block;position:absolute;top:0;right:0;bottom:0;left:0;border:var(--sbb-form-field-border-width) var(--sbb-form-field-border-style) var(--sbb-form-field-border-color);border-radius:var(--sbb-form-field-border-radius)}:host([data-input-focused][data-focus-origin=keyboard]) .sbb-form-field__wrapper{outline-offset:var(--sbb-focus-outline-offset);outline:var(--sbb-focus-outline-color) var(--sbb-focus-outline-style, solid) var(--sbb-focus-outline-width)}@media (forced-colors: none){:host(:is([borderless],[data-input-type=sbb-slider])) .sbb-form-field__wrapper:before{border-color:transparent}:host(:is([data-input-focused],[data-disabled])[borderless]) .sbb-form-field__wrapper:after{content:"";position:absolute;border-block-end:var(--sbb-border-width-1x) var(--sbb-form-field-border-style) var(--sbb-form-field-border-color);inset-inline:var(--sbb-form-field-padding-inline);inset-block-end:0}}::slotted(*[slot=prefix]){color:var(--sbb-form-field-prefix-color)}::slotted(*[slot=prefix]),::slotted(*[slot=suffix]){display:flex;min-width:var(--sbb-icon-svg-width);margin-block-start:calc((var(--sbb-form-field-min-height) - var(--sbb-size-icon-ui-small)) / 2)}:host(:is([data-input-empty],[data-disabled],[data-readonly])) ::slotted(sbb-form-field-clear){display:none}::slotted(sbb-datepicker-toggle){height:calc((var(--sbb-form-field-min-height) + var(--sbb-size-icon-ui-small)) / 2)}@media (forced-colors: active){::slotted(*[slot=suffix]){color:var(--sbb-form-field-prefix-color)}}.sbb-form-field__select-input-icon{top:50%;transform:translateY(-50%);position:absolute;inset-inline-end:0;margin-block-start:calc(-1 * var(--sbb-form-field-margin-block-start) / 2);pointer-events:none;color:var(--sbb-form-field-arrow-color)}.sbb-form-field__input-container{flex:1 1 auto;position:relative;margin-block-start:var(--sbb-form-field-margin-block-start);min-width:0}.sbb-form-field__label-spacer{display:flex;height:calc(var(--sbb-form-field-label-text-size) * var(--sbb-typo-line-height-body-text));margin-block-end:var(--sbb-form-field-spacer-margin-block-end)}:host(:not([data-slot-names~=label])) :is(.sbb-form-field__label,.sbb-form-field__label-spacer){display:none}:host([hidden-label]) :is(.sbb-form-field__label,.sbb-form-field__label-spacer){border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.sbb-form-field__label{display:flex;max-width:100%;cursor:default;position:absolute;inset-block-start:0;color:var(--sbb-form-field-label-color);--sbb-text-font-size: var(--sbb-font-size-text-xs);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size)}:host([size=s]) .sbb-form-field__label{--sbb-text-font-size: var(--sbb-font-size-text-xxs);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size)}:host([data-input-type=select]) .sbb-form-field__label,:host([data-input-type=sbb-select]) .sbb-form-field__label{padding-inline-end:var(--sbb-form-field-select-inline-padding-end)}:host([floating-label]) .sbb-form-field__label{transform-origin:0 0;pointer-events:none;backface-visibility:hidden;will-change:transform,font-size;transition-duration:var(--sbb-disable-animation-duration, var(--sbb-animation-duration-2x));transition-timing-function:var(--sbb-animation-easing);transition-property:transform,font-size}:host([floating-label]:is(:not([data-input-focused]:not([data-input-type=sbb-select]),[data-has-popup-open]),[data-readonly])[data-input-empty]) .sbb-form-field__label{font-size:var(--sbb-form-field-input-text-size);transform:translateY(var(--sbb-form-field-floating-label-transform))}@media (forced-colors: active){:host([data-input-type=textarea]) .sbb-form-field__label{z-index:1}}.sbb-form-field__label-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.sbb-form-field__input{display:flex}:host([size=s]:is([data-input-type=input],[data-input-type=select],[data-input-type=sbb-select],[data-input-type=sbb-date-input])) .sbb-form-field__input{margin-block-end:-.125rem}.sbb-form-field__error{display:flex;min-height:var(--sbb-form-field-error-min-height);margin-block-start:var(--sbb-form-field-error-padding-block-start-override, var(--sbb-form-field-error-padding-block-start))}`;
|
|
17
|
-
let
|
|
18
|
-
const
|
|
16
|
+
const ze = fe`@charset "UTF-8";*,:before,:after{box-sizing:border-box}:host{display:inline-block;--sbb-form-field-background-color: var(--sbb-color-white);--sbb-form-field-border-color: var(--sbb-color-smoke);--sbb-form-field-border-style: solid;--sbb-form-field-border-radius: var(--sbb-border-radius-4x);--sbb-form-field-border-width: var(--sbb-border-width-1x);--sbb-form-field-min-height: var(--sbb-size-element-m);--sbb-form-field-label-color: var(--sbb-color-metal);--sbb-form-field-prefix-color: var(--sbb-color-metal);--sbb-form-field-padding-inline: var(--sbb-spacing-fixed-3x);--sbb-form-field-text-color: var(--sbb-color-charcoal);--sbb-form-field-arrow-color: var(--sbb-color-charcoal);--sbb-form-field-error-divider-width: var(--sbb-spacing-fixed-1x);--sbb-form-field-error-padding-block-start: var(--sbb-form-field-error-divider-width);--sbb-form-field-gap: var(--sbb-spacing-fixed-2x);--sbb-form-field-label-to-input-overlapping: var(--sbb-spacing-fixed-1x);--sbb-form-field-select-inline-padding-end: calc( var(--sbb-icon-svg-width) + var(--sbb-form-field-gap) );--sbb-form-field-overflow: hidden;--sbb-form-field-input-text-size: var(--sbb-font-size-text-m);--sbb-form-field-label-text-size: var(--sbb-font-size-text-xs);--sbb-form-field-label-size: calc( var(--sbb-form-field-label-text-size) * var(--sbb-typo-line-height-body-text) );--sbb-form-field-text-line-height: calc( var(--sbb-form-field-input-text-size) * var(--sbb-typo-line-height-body-text) );--sbb-form-field-margin-block-start: calc( ( var(--sbb-form-field-min-height) - var(--sbb-form-field-label-size) - var( --sbb-form-field-text-line-height ) + var(--sbb-form-field-label-to-input-overlapping) ) / 2 );--sbb-form-field-spacer-margin-block-end: calc( -1 * var(--sbb-form-field-label-to-input-overlapping) );--sbb-form-field-floating-label-transform: .53125rem;--sbb-icon-svg-width: var(--sbb-size-icon-ui-small);--sbb-icon-svg-height: var(--sbb-size-icon-ui-small);--sbb-focus-outline-color: var(--sbb-focus-outline-color-default)}@media (min-width: 52.5rem){:host{--sbb-form-field-floating-label-transform: .65625rem}}@media (forced-colors: active){:host{--sbb-form-field-border-color: ButtonBorder}}:host(:where(:not([width=collapse]))){min-width:9.375rem;width:min(18.75rem,100%)}:host([negative]){--sbb-form-field-background-color: var(--sbb-color-midnight);--sbb-form-field-border-color: var(--sbb-color-smoke);--sbb-form-field-label-color: var(--sbb-color-smoke);--sbb-form-field-prefix-color: var(--sbb-color-smoke);--sbb-form-field-text-color: var(--sbb-color-milk);--sbb-focus-outline-color: var(--sbb-focus-outline-color-dark);--sbb-form-field-arrow-color: var(--sbb-color-milk)}@media (forced-colors: active){:host([negative]){--sbb-form-field-border-color: ButtonBorder}}:host([size=s]){--sbb-form-field-min-height: var(--sbb-size-element-xs);--sbb-form-field-padding-inline: var(--sbb-spacing-fixed-2x);--sbb-form-field-input-text-size: var(--sbb-font-size-text-s);--sbb-form-field-label-text-size: var(--sbb-font-size-text-xxs);--sbb-form-field-label-to-input-overlapping: .625rem;--sbb-form-field-floating-label-transform: .34375rem;--sbb-form-field-spacer-margin-block-end: -.53125rem}@media (min-width: 52.5rem){:host([size=s]){--sbb-form-field-label-to-input-overlapping: .6875rem;--sbb-form-field-floating-label-transform: .3125rem;--sbb-form-field-spacer-margin-block-end: -.5rem}}:host([size=l]){--sbb-form-field-min-height: var(--sbb-size-element-l);--sbb-form-field-padding-inline: var(--sbb-spacing-responsive-xxxs)}:host([error-space=reserve]){--sbb-form-field-error-min-height: calc( var(--sbb-typo-line-height-body-text) * var(--sbb-font-size-text-xs) );--sbb-form-field-error-padding-block-start-override: var(--sbb-form-field-error-divider-width)}:host(:is([data-readonly],[data-disabled])){--sbb-form-field-background-color: var(--sbb-color-milk);--sbb-form-field-border-color: var(--sbb-color-graphite);--sbb-form-field-arrow-color: var(--sbb-color-granite)}@media (forced-colors: active){:host(:is([data-readonly],[data-disabled])){--sbb-form-field-border-color: ButtonBorder}}:host(:is([data-readonly],[data-disabled])[negative]){--sbb-form-field-background-color: var(--sbb-color-charcoal);--sbb-form-field-border-color: var(--sbb-color-smoke);--sbb-form-field-arrow-color: var(--sbb-color-smoke)}:host([data-disabled]){--sbb-form-field-label-color: var(--sbb-color-granite);--sbb-form-field-prefix-color: var(--sbb-color-granite);--sbb-form-field-border-style: dashed}@media (forced-colors: active){:host([data-disabled]){--sbb-form-field-label-color: GrayText !important;--sbb-form-field-prefix-color: GrayText !important;--sbb-form-field-text-color: GrayText !important;--sbb-form-field-border-color: GrayText !important}}:host([data-disabled][negative]){--sbb-form-field-text-color: var(--sbb-color-smoke);--sbb-form-field-label-color: var(--sbb-color-smoke);--sbb-form-field-prefix-color: var(--sbb-color-smoke)}:host([data-readonly]:not([negative])){--sbb-form-field-label-color: var(--sbb-color-granite);--sbb-form-field-prefix-color: var(--sbb-color-granite)}:host(:is([data-input-focused])){--sbb-form-field-border-color: var(--sbb-color-charcoal);--sbb-form-field-prefix-color: var(--sbb-color-charcoal);--sbb-form-field-border-width: var(--sbb-border-width-2x)}@media (forced-colors: active){:host(:is([data-input-focused])){--sbb-form-field-border-color: Highlight !important;--sbb-form-field-prefix-color: Highlight !important}}:host(:is([data-input-focused])[negative]){--sbb-form-field-border-color: var(--sbb-color-milk);--sbb-form-field-prefix-color: var(--sbb-color-milk)}:host([data-invalid]){--sbb-form-field-border-color: var(--sbb-color-red125);--sbb-form-field-text-color: var(--sbb-color-red125)}@media (forced-colors: active){:host([data-invalid]){--sbb-form-field-border-color: LinkText !important;--sbb-form-field-text-color: LinkText !important}}:host([data-invalid][negative]){--sbb-form-field-border-color: var(--sbb-color-red-mode-dark);--sbb-form-field-text-color: var(--sbb-color-red-mode-dark)}:host(:not([data-has-error])){--sbb-form-field-error-padding-block-start: 0}:host([floating-label]){--sbb-select-placeholder-color: transparent}@media (forced-colors: active){:host([floating-label]){--sbb-select-placeholder-color: Canvas}}:host(:is(:not([data-slot-names~=label]),[hidden-label])){--sbb-form-field-label-size: 0rem;--sbb-form-field-label-to-input-overlapping: 0rem}:host([data-input-type=sbb-slider]){--sbb-form-field-overflow: visible}:host([data-input-type=textarea]){--sbb-form-field-max-height: fit-content}.sbb-form-field__space-wrapper{display:flex;flex-direction:column}.sbb-form-field__space-wrapper:before{content:"";-webkit-user-select:none;user-select:none;width:0;height:0}.sbb-form-field__wrapper{display:flex;gap:var(--sbb-form-field-gap);padding-inline:var(--sbb-form-field-padding-inline);border-radius:var(--sbb-form-field-border-radius);min-height:var(--sbb-form-field-min-height);max-height:var(--sbb-form-field-max-height);background-color:var(--sbb-form-field-background-color);position:relative}.sbb-form-field__wrapper:before{content:"";display:block;position:absolute;inset:0;border:var(--sbb-form-field-border-width) var(--sbb-form-field-border-style) var(--sbb-form-field-border-color);border-radius:var(--sbb-form-field-border-radius)}:host([data-input-focused][data-focus-origin=keyboard]) .sbb-form-field__wrapper{outline-offset:var(--sbb-focus-outline-offset);outline:var(--sbb-focus-outline-color) var(--sbb-focus-outline-style, solid) var(--sbb-focus-outline-width)}@media (forced-colors: none){:host(:is([borderless],[data-input-type=sbb-slider])) .sbb-form-field__wrapper:before{border-color:transparent}:host(:is([data-input-focused],[data-disabled])[borderless]) .sbb-form-field__wrapper:after{content:"";position:absolute;border-block-end:var(--sbb-border-width-1x) var(--sbb-form-field-border-style) var(--sbb-form-field-border-color);inset-inline:var(--sbb-form-field-padding-inline);inset-block-end:0}}::slotted(*[slot=prefix]){color:var(--sbb-form-field-prefix-color)}::slotted(*[slot=prefix]),::slotted(*[slot=suffix]){display:flex;min-width:var(--sbb-icon-svg-width);margin-block-start:calc((var(--sbb-form-field-min-height) - var(--sbb-size-icon-ui-small)) / 2)}:host(:is([data-input-empty],[data-disabled],[data-readonly])) ::slotted(sbb-form-field-clear){display:none}::slotted(sbb-datepicker-toggle){height:calc((var(--sbb-form-field-min-height) + var(--sbb-size-icon-ui-small)) / 2)}@media (forced-colors: active){::slotted(*[slot=suffix]){color:var(--sbb-form-field-prefix-color)}}.sbb-form-field__select-input-icon{top:50%;transform:translateY(-50%);position:absolute;inset-inline-end:0;margin-block-start:calc(-1 * var(--sbb-form-field-margin-block-start) / 2);pointer-events:none;color:var(--sbb-form-field-arrow-color)}.sbb-form-field__input-container{flex:1 1 auto;position:relative;margin-block-start:var(--sbb-form-field-margin-block-start);min-width:0}.sbb-form-field__label-spacer{display:flex;height:calc(var(--sbb-form-field-label-text-size) * var(--sbb-typo-line-height-body-text));margin-block-end:var(--sbb-form-field-spacer-margin-block-end)}:host(:not([data-slot-names~=label])) :is(.sbb-form-field__label,.sbb-form-field__label-spacer){display:none}:host([hidden-label]) :is(.sbb-form-field__label,.sbb-form-field__label-spacer){border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.sbb-form-field__label{display:flex;max-width:100%;cursor:default;position:absolute;inset-block-start:0;color:var(--sbb-form-field-label-color);--sbb-text-font-size: var(--sbb-font-size-text-xs);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size)}:host([size=s]) .sbb-form-field__label{--sbb-text-font-size: var(--sbb-font-size-text-xxs);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size)}:host([data-input-type=select]) .sbb-form-field__label,:host([data-input-type=sbb-select]) .sbb-form-field__label{padding-inline-end:var(--sbb-form-field-select-inline-padding-end)}:host([floating-label]) .sbb-form-field__label{transform-origin:0 0;pointer-events:none;backface-visibility:hidden;will-change:transform,font-size;transition-duration:var(--sbb-disable-animation-duration, var(--sbb-animation-duration-2x));transition-timing-function:var(--sbb-animation-easing);transition-property:transform,font-size}:host([floating-label]:is(:not([data-input-focused]:not([data-input-type=sbb-select]),[data-has-popup-open]),[data-readonly])[data-input-empty]) .sbb-form-field__label{font-size:var(--sbb-form-field-input-text-size);transform:translateY(var(--sbb-form-field-floating-label-transform))}@media (forced-colors: active){:host([data-input-type=textarea]) .sbb-form-field__label{z-index:1}}.sbb-form-field__label-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.sbb-form-field__input{display:flex}:host([size=s]:is([data-input-type=input],[data-input-type=select],[data-input-type=sbb-select],[data-input-type=sbb-date-input])) .sbb-form-field__input{margin-block-end:-.125rem}.sbb-form-field__error{display:flex;min-height:var(--sbb-form-field-error-min-height);margin-block-start:var(--sbb-form-field-error-padding-block-start-override, var(--sbb-form-field-error-padding-block-start))}`;
|
|
17
|
+
let ne = 0, Ie = 0;
|
|
18
|
+
const A = /* @__PURE__ */ new WeakMap();
|
|
19
19
|
let Ve = (() => {
|
|
20
|
-
var
|
|
21
|
-
let o = [
|
|
22
|
-
return l = class extends
|
|
20
|
+
var h, u, m, _, g, v, y, x, k, w, l;
|
|
21
|
+
let o = [ue("sbb-form-field"), ge()], a, n = [], f, L = we(Ee(pe)), S, C = [], N = [], F, D = [], T = [], O, $ = [], U = [], M, V = [], B = [], j, H = [], q = [], G, P = [], R = [], W, Y = [], J = [], K, Q = [], X = [], Z, ee = [], te = [], ie, re = [], se = [];
|
|
22
|
+
return l = class extends L {
|
|
23
23
|
constructor() {
|
|
24
24
|
super(...arguments);
|
|
25
|
-
d(this,
|
|
25
|
+
d(this, h);
|
|
26
26
|
d(this, u);
|
|
27
|
+
d(this, m);
|
|
27
28
|
d(this, _);
|
|
28
29
|
d(this, g);
|
|
29
30
|
d(this, v);
|
|
@@ -31,7 +32,6 @@ let Ve = (() => {
|
|
|
31
32
|
d(this, x);
|
|
32
33
|
d(this, k);
|
|
33
34
|
d(this, w);
|
|
34
|
-
d(this, z);
|
|
35
35
|
this._supportedNativeInputElements = [
|
|
36
36
|
"input",
|
|
37
37
|
"select",
|
|
@@ -55,8 +55,8 @@ let Ve = (() => {
|
|
|
55
55
|
"tel",
|
|
56
56
|
"text",
|
|
57
57
|
"url"
|
|
58
|
-
], r(this,
|
|
59
|
-
|
|
58
|
+
], r(this, h, s(this, C, "none")), r(this, u, (s(this, N), s(this, D, !1))), r(this, m, (s(this, T), s(this, $, ve() ? "s" : "m"))), r(this, _, (s(this, U), s(this, V, !1))), r(this, g, (s(this, B), s(this, H, "default"))), r(this, v, (s(this, q), s(this, P, !1))), r(this, y, (s(this, R), s(this, Y, !1))), r(this, x, (s(this, J), s(this, Q, []))), this._originalInputAriaDescribedby = s(this, X), r(this, k, s(this, ee, void 0)), r(this, w, (s(this, te), s(this, re, void 0))), this._language = (s(this, se), new _e(this)), this._formFieldAttributeObserver = he ? null : new MutationObserver((t) => {
|
|
59
|
+
t.some((e) => e.type === "attributes") && this._readInputState();
|
|
60
60
|
}), this._inputAbortController = new AbortController();
|
|
61
61
|
}
|
|
62
62
|
/**
|
|
@@ -65,78 +65,78 @@ let Ve = (() => {
|
|
|
65
65
|
* `reserve` does reserve one row for an error message.
|
|
66
66
|
*/
|
|
67
67
|
get errorSpace() {
|
|
68
|
-
return b(this,
|
|
68
|
+
return b(this, h);
|
|
69
69
|
}
|
|
70
|
-
set errorSpace(
|
|
71
|
-
r(this,
|
|
70
|
+
set errorSpace(t) {
|
|
71
|
+
r(this, h, t);
|
|
72
72
|
}
|
|
73
73
|
/** Indicates whether the input is optional. */
|
|
74
74
|
get optional() {
|
|
75
75
|
return b(this, u);
|
|
76
76
|
}
|
|
77
|
-
set optional(
|
|
78
|
-
r(this, u,
|
|
77
|
+
set optional(t) {
|
|
78
|
+
r(this, u, t);
|
|
79
79
|
}
|
|
80
80
|
/**
|
|
81
81
|
* Size variant, either l, m or s.
|
|
82
82
|
* @default 'm' / 's' (lean)
|
|
83
83
|
*/
|
|
84
84
|
get size() {
|
|
85
|
-
return b(this,
|
|
85
|
+
return b(this, m);
|
|
86
86
|
}
|
|
87
|
-
set size(
|
|
88
|
-
r(this,
|
|
87
|
+
set size(t) {
|
|
88
|
+
r(this, m, t);
|
|
89
89
|
}
|
|
90
90
|
/** Whether to display the form field without a border. */
|
|
91
91
|
get borderless() {
|
|
92
|
-
return b(this,
|
|
92
|
+
return b(this, _);
|
|
93
93
|
}
|
|
94
|
-
set borderless(
|
|
95
|
-
r(this,
|
|
94
|
+
set borderless(t) {
|
|
95
|
+
r(this, _, t);
|
|
96
96
|
}
|
|
97
97
|
/** Defines the width of the component:
|
|
98
98
|
* - `default`: the component has defined width and min-width;
|
|
99
99
|
* - `collapse`: the component adapts itself to its inner input content. */
|
|
100
100
|
get width() {
|
|
101
|
-
return b(this,
|
|
101
|
+
return b(this, g);
|
|
102
102
|
}
|
|
103
|
-
set width(
|
|
104
|
-
r(this,
|
|
103
|
+
set width(t) {
|
|
104
|
+
r(this, g, t);
|
|
105
105
|
}
|
|
106
106
|
/** Whether to visually hide the label. If hidden, screen readers will still read it. */
|
|
107
107
|
get hiddenLabel() {
|
|
108
|
-
return b(this,
|
|
108
|
+
return b(this, v);
|
|
109
109
|
}
|
|
110
|
-
set hiddenLabel(
|
|
111
|
-
r(this,
|
|
110
|
+
set hiddenLabel(t) {
|
|
111
|
+
r(this, v, t);
|
|
112
112
|
}
|
|
113
113
|
/** Whether the label should float. If activated, the placeholder of the input is hidden. */
|
|
114
114
|
get floatingLabel() {
|
|
115
|
-
return b(this,
|
|
115
|
+
return b(this, y);
|
|
116
116
|
}
|
|
117
|
-
set floatingLabel(
|
|
118
|
-
r(this,
|
|
117
|
+
set floatingLabel(t) {
|
|
118
|
+
r(this, y, t);
|
|
119
119
|
}
|
|
120
120
|
/** It is used internally to get the `error` slot. */
|
|
121
121
|
get _errorElements() {
|
|
122
|
-
return b(this,
|
|
122
|
+
return b(this, x);
|
|
123
123
|
}
|
|
124
|
-
set _errorElements(
|
|
125
|
-
r(this,
|
|
124
|
+
set _errorElements(t) {
|
|
125
|
+
r(this, x, t);
|
|
126
126
|
}
|
|
127
127
|
/** Reference to the slotted input element. */
|
|
128
128
|
get _input() {
|
|
129
|
-
return b(this,
|
|
129
|
+
return b(this, k);
|
|
130
130
|
}
|
|
131
|
-
set _input(
|
|
132
|
-
r(this,
|
|
131
|
+
set _input(t) {
|
|
132
|
+
r(this, k, t);
|
|
133
133
|
}
|
|
134
134
|
/** Reference to the slotted label elements. */
|
|
135
135
|
get _label() {
|
|
136
|
-
return b(this,
|
|
136
|
+
return b(this, w);
|
|
137
137
|
}
|
|
138
|
-
set _label(
|
|
139
|
-
r(this,
|
|
138
|
+
set _label(t) {
|
|
139
|
+
r(this, w, t);
|
|
140
140
|
}
|
|
141
141
|
/** Returns the input element. */
|
|
142
142
|
get inputElement() {
|
|
@@ -145,129 +145,121 @@ let Ve = (() => {
|
|
|
145
145
|
connectedCallback() {
|
|
146
146
|
super.connectedCallback(), this._registerInputListener(), this._syncNegative();
|
|
147
147
|
}
|
|
148
|
-
willUpdate(
|
|
149
|
-
super.willUpdate(
|
|
148
|
+
willUpdate(t) {
|
|
149
|
+
super.willUpdate(t), t.has("negative") && this._syncNegative();
|
|
150
150
|
}
|
|
151
151
|
disconnectedCallback() {
|
|
152
|
-
|
|
153
|
-
super.disconnectedCallback(), (e = this._formFieldAttributeObserver) == null || e.disconnect(), this._inputAbortController.abort(), ((t = this._input) == null ? void 0 : t.localName) === "input" && this._unpatchInputValue();
|
|
152
|
+
super.disconnectedCallback(), this._formFieldAttributeObserver?.disconnect(), this._inputAbortController.abort(), this._input?.localName === "input" && this._unpatchInputValue();
|
|
154
153
|
}
|
|
155
|
-
_handleWrapperClick(
|
|
156
|
-
|
|
157
|
-
this._isElementFocusExcluded(e) || (((t = this._input) == null ? void 0 : t.localName) === "sbb-select" && e.target.localName !== "sbb-select" ? (this._input.click(), this._input.focus()) : e.target.localName !== "label" && ((i = this._input) == null || i.focus()));
|
|
154
|
+
_handleWrapperClick(t) {
|
|
155
|
+
this._isElementFocusExcluded(t) || (this._input?.localName === "sbb-select" && t.target.localName !== "sbb-select" ? (this._input.click(), this._input.focus()) : t.target.localName !== "label" && this._input?.focus());
|
|
158
156
|
}
|
|
159
|
-
_isElementFocusExcluded(
|
|
160
|
-
return
|
|
157
|
+
_isElementFocusExcluded(t) {
|
|
158
|
+
return t.composedPath().some((e) => e instanceof window.HTMLElement && (e.getAttribute("tabindex") === "0" || e.hasAttribute("contenteditable")) || this._excludedFocusElements.includes(e.localName));
|
|
161
159
|
}
|
|
162
160
|
_onSlotLabelChange() {
|
|
163
|
-
const
|
|
164
|
-
this._label =
|
|
161
|
+
const t = Array.from(this.querySelectorAll("label"));
|
|
162
|
+
this._label = t[0], this._syncLabelInputReferences();
|
|
165
163
|
}
|
|
166
164
|
/**
|
|
167
165
|
* It is used internally to assign the attributes of `<input>` to `_id` and `_input` and to observe the native readonly and disabled attributes.
|
|
168
166
|
*/
|
|
169
167
|
_onSlotInputChange() {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
if (this._assignSlots(), this._input && this._input.localName === "input" && e !== this._input && this._unpatchInputValue(), !e) {
|
|
168
|
+
const t = this.querySelector(`:where(${this._supportedInputElements.join(",")})`);
|
|
169
|
+
if (this._assignSlots(), this._input && this._input.localName === "input" && t !== this._input && this._unpatchInputValue(), !t) {
|
|
173
170
|
this._input = void 0;
|
|
174
171
|
return;
|
|
175
172
|
}
|
|
176
|
-
this._input =
|
|
173
|
+
this._input = t, this._originalInputAriaDescribedby = this._input.getAttribute("aria-describedby"), this._applyAriaDescribedby(), this._readInputState(), this._registerInputListener(), this._input.localName === "textarea" && this._input.setAttribute("rows", this._input.getAttribute("rows") || "3"), this._formFieldAttributeObserver?.disconnect(), this._formFieldAttributeObserver?.observe(this._input, {
|
|
177
174
|
attributes: !0,
|
|
178
175
|
attributeFilter: ["readonly", "disabled", "class", "data-sbb-invalid", "data-expanded"]
|
|
179
176
|
}), this.setAttribute("data-input-type", this._input.localName), this._syncLabelInputReferences();
|
|
180
177
|
}
|
|
181
178
|
_syncLabelInputReferences() {
|
|
182
|
-
var e;
|
|
183
179
|
if (!(!this._input || !this._label))
|
|
184
180
|
if (this._supportedNativeInputElements.includes(this._input.localName))
|
|
185
|
-
this._input.id || (this._input.id = `sbb-form-field-input-${
|
|
181
|
+
this._input.id || (this._input.id = `sbb-form-field-input-${ne++}`), this._label.htmlFor = this._input.id;
|
|
186
182
|
else {
|
|
187
|
-
this._label.id || (this._label.id = `sbb-form-field-label-${
|
|
188
|
-
const t =
|
|
183
|
+
this._label.id || (this._label.id = `sbb-form-field-label-${ne++}`);
|
|
184
|
+
const t = this._input.getAttribute("aria-labelledby")?.split(" ").filter((e) => !!e && e !== this._label.id) ?? [];
|
|
189
185
|
this._input.setAttribute("aria-labelledby", [...t, this._label.id].join(" "));
|
|
190
186
|
}
|
|
191
187
|
}
|
|
192
188
|
_registerInputListener() {
|
|
193
|
-
var t;
|
|
194
189
|
if (!this._input)
|
|
195
190
|
return;
|
|
196
|
-
this._inputAbortController.abort(), this._inputAbortController = new AbortController(), this._checkAndUpdateInputEmpty(),
|
|
191
|
+
this._inputAbortController.abort(), this._inputAbortController = new AbortController(), this._checkAndUpdateInputEmpty(), this._getInputForm()?.addEventListener("reset", () => setTimeout(() => this.reset()), {
|
|
197
192
|
signal: this._inputAbortController.signal
|
|
198
193
|
}), this._input.addEventListener("input", () => this._checkAndUpdateInputEmpty(), {
|
|
199
194
|
signal: this._inputAbortController.signal
|
|
200
195
|
}), this._input.addEventListener("blur", () => this._checkAndUpdateInputEmpty(), {
|
|
201
196
|
signal: this._inputAbortController.signal
|
|
202
|
-
}), this._input.addEventListener("invalid", (
|
|
197
|
+
}), this._input.addEventListener("invalid", (e) => e.preventDefault(), {
|
|
203
198
|
signal: this._inputAbortController.signal
|
|
204
199
|
});
|
|
205
|
-
let
|
|
200
|
+
let t = this._input;
|
|
206
201
|
if (this._input.localName === "input")
|
|
207
202
|
this._patchInputValue();
|
|
208
203
|
else if (this._input.localName === "sbb-select") {
|
|
209
204
|
this._input.addEventListener("displayValueChange", () => this._checkAndUpdateInputEmpty(), {
|
|
210
205
|
signal: this._inputAbortController.signal
|
|
211
206
|
});
|
|
212
|
-
const
|
|
213
|
-
if (
|
|
214
|
-
const
|
|
207
|
+
const e = this._input;
|
|
208
|
+
if (t = e.inputElement, !t) {
|
|
209
|
+
const i = {
|
|
215
210
|
hostUpdated: () => {
|
|
216
|
-
|
|
211
|
+
e.removeController(i), this._registerInputListener();
|
|
217
212
|
}
|
|
218
213
|
};
|
|
219
|
-
|
|
214
|
+
e.addController(i);
|
|
220
215
|
}
|
|
221
216
|
}
|
|
222
|
-
|
|
223
|
-
this.toggleAttribute("data-input-focused", !0), this.setAttribute("data-focus-origin",
|
|
217
|
+
t?.addEventListener("focusin", () => {
|
|
218
|
+
this.toggleAttribute("data-input-focused", !0), this.setAttribute("data-focus-origin", me.mostRecentModality ?? "");
|
|
224
219
|
}, {
|
|
225
220
|
signal: this._inputAbortController.signal
|
|
226
|
-
}),
|
|
221
|
+
}), t?.addEventListener("focusout", () => ["data-focus-origin", "data-input-focused"].forEach((e) => this.removeAttribute(e)), {
|
|
227
222
|
signal: this._inputAbortController.signal
|
|
228
223
|
});
|
|
229
224
|
}
|
|
230
225
|
_getInputForm() {
|
|
231
|
-
|
|
232
|
-
return this._input instanceof HTMLInputElement || this._input instanceof HTMLSelectElement ? this._input.form : (e = this._input) == null ? void 0 : e.closest("form");
|
|
226
|
+
return this._input instanceof HTMLInputElement || this._input instanceof HTMLSelectElement ? this._input.form : this._input?.closest("form");
|
|
233
227
|
}
|
|
234
228
|
// We need to patch the value property of the HTMLInputElement in order
|
|
235
229
|
// to be able to reset the floating label in the empty state.
|
|
236
230
|
_patchInputValue() {
|
|
237
|
-
const
|
|
238
|
-
if (!
|
|
231
|
+
const t = this._input, e = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t), "value");
|
|
232
|
+
if (!e || !e.set || !e.get)
|
|
239
233
|
return;
|
|
240
|
-
|
|
241
|
-
const { get: i, set:
|
|
242
|
-
Object.defineProperty(
|
|
243
|
-
...
|
|
234
|
+
A.set(t, e);
|
|
235
|
+
const { get: i, set: be } = e, de = () => this._checkAndUpdateInputEmpty();
|
|
236
|
+
Object.defineProperty(t, "value", {
|
|
237
|
+
...e,
|
|
244
238
|
get() {
|
|
245
239
|
return i.call(this);
|
|
246
240
|
},
|
|
247
|
-
set(
|
|
248
|
-
|
|
241
|
+
set(ce) {
|
|
242
|
+
be.call(this, ce), de();
|
|
249
243
|
}
|
|
250
244
|
});
|
|
251
245
|
}
|
|
252
246
|
_unpatchInputValue() {
|
|
253
|
-
const
|
|
254
|
-
|
|
247
|
+
const t = this._input, e = A.get(t);
|
|
248
|
+
e && (Object.defineProperty(t, "value", e), A.delete(t));
|
|
255
249
|
}
|
|
256
250
|
_checkAndUpdateInputEmpty() {
|
|
257
|
-
|
|
258
|
-
this.toggleAttribute("data-input-empty", this._floatingLabelSupportedInputElements.includes((e = this._input) == null ? void 0 : e.localName) && this._isInputEmpty());
|
|
251
|
+
this.toggleAttribute("data-input-empty", this._floatingLabelSupportedInputElements.includes(this._input?.localName) && this._isInputEmpty());
|
|
259
252
|
}
|
|
260
253
|
_isInputEmpty() {
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
return e ? this._isInputValueEmpty() && e.value.length === 0 : this._input instanceof HTMLInputElement ? this._floatingLabelSupportedInputTypes.includes(this._input.type) && this._isInputValueEmpty() : this._input instanceof HTMLSelectElement ? ((p = (i = (t = this._input.selectedOptions) == null ? void 0 : t.item(0)) == null ? void 0 : i.label) == null ? void 0 : p.trim()) === "" : ((E = this._input) == null ? void 0 : E.localName) === "sbb-select" ? ((I = this._input.getDisplayValue()) == null ? void 0 : I.trim()) === "" : this._isInputValueEmpty();
|
|
254
|
+
const t = this.querySelector("sbb-chip-group");
|
|
255
|
+
return t ? this._isInputValueEmpty() && t.value.length === 0 : this._input instanceof HTMLInputElement ? this._floatingLabelSupportedInputTypes.includes(this._input.type) && this._isInputValueEmpty() : this._input instanceof HTMLSelectElement ? this._input.selectedOptions?.item(0)?.label?.trim() === "" : this._input?.localName === "sbb-select" ? this._input.getDisplayValue()?.trim() === "" : this._isInputValueEmpty();
|
|
264
256
|
}
|
|
265
257
|
_isInputValueEmpty() {
|
|
266
|
-
const
|
|
267
|
-
return ["", void 0, null].includes(
|
|
258
|
+
const t = this._input.value;
|
|
259
|
+
return ["", void 0, null].includes(t) || Array.isArray(t) && t.length === 0;
|
|
268
260
|
}
|
|
269
261
|
_assignSlots() {
|
|
270
|
-
this.querySelectorAll("label:not([slot])").forEach((
|
|
262
|
+
this.querySelectorAll("label:not([slot])").forEach((t) => t.setAttribute("slot", "label")), this.querySelectorAll("sbb-form-error:not([slot])").forEach((t) => t.setAttribute("slot", "error"));
|
|
271
263
|
}
|
|
272
264
|
_readInputState() {
|
|
273
265
|
this._input && (this.toggleAttribute("data-readonly", this._input.hasAttribute("readonly")), this.toggleAttribute("data-disabled", this._input.hasAttribute("disabled")), this.toggleAttribute("data-invalid", this._input.hasAttribute("data-sbb-invalid") || this._input.classList.contains("sbb-invalid") || this._input.classList.contains("ng-touched") && this._input.classList.contains("ng-invalid")), this.toggleAttribute("data-has-popup-open", this._input.hasAttribute("data-expanded")));
|
|
@@ -275,17 +267,17 @@ let Ve = (() => {
|
|
|
275
267
|
/**
|
|
276
268
|
* It is used internally to set the aria-describedby attribute for the slotted input referencing available <sbb-form-error> instances.
|
|
277
269
|
*/
|
|
278
|
-
_onSlotErrorChange(
|
|
279
|
-
this._errorElements =
|
|
280
|
-
for (const
|
|
281
|
-
|
|
270
|
+
_onSlotErrorChange(t) {
|
|
271
|
+
this._errorElements = t.target.assignedElements();
|
|
272
|
+
for (const e of this._errorElements)
|
|
273
|
+
e.id || (e.id = `sbb-form-field-error-${++Ie}`), e.role || (e.role = "status", ye && e.setAttribute("role", "status"));
|
|
282
274
|
this._applyAriaDescribedby(), this.toggleAttribute("data-has-error", !!this._errorElements.length), this._syncNegative();
|
|
283
275
|
}
|
|
284
276
|
_applyAriaDescribedby() {
|
|
285
|
-
const
|
|
286
|
-
this._originalInputAriaDescribedby &&
|
|
287
|
-
const
|
|
288
|
-
this._input && xe(this._input, "aria-describedby",
|
|
277
|
+
const t = [];
|
|
278
|
+
this._originalInputAriaDescribedby && t.push(this._originalInputAriaDescribedby), this._errorElements.length && this._errorElements.forEach((i) => t.push(i.id));
|
|
279
|
+
const e = t.join(" ");
|
|
280
|
+
this._input && xe(this._input, "aria-describedby", e);
|
|
289
281
|
}
|
|
290
282
|
/** Manually reset the form field. Currently, this only resets the floating label. */
|
|
291
283
|
reset() {
|
|
@@ -293,16 +285,13 @@ let Ve = (() => {
|
|
|
293
285
|
}
|
|
294
286
|
/** Manually clears the input value. It only works for inputs, selects are not supported. */
|
|
295
287
|
clear() {
|
|
296
|
-
|
|
297
|
-
((e = this._input) == null ? void 0 : e.localName) === "input" && (this._input.value = "", this._checkAndUpdateInputEmpty());
|
|
288
|
+
this._input?.localName === "input" && (this._input.value = "", this._checkAndUpdateInputEmpty());
|
|
298
289
|
}
|
|
299
290
|
_syncNegative() {
|
|
300
|
-
|
|
301
|
-
(e = this.querySelectorAll) == null || e.call(this, "sbb-form-error,sbb-mini-button,sbb-popover-trigger,sbb-form-field-clear,sbb-datepicker-next-day,sbb-datepicker-previous-day,sbb-datepicker-toggle,sbb-select,sbb-autocomplete,sbb-autocomplete-grid,sbb-chip-group").forEach((t) => t.toggleAttribute("negative", this.negative));
|
|
291
|
+
this.querySelectorAll?.("sbb-form-error,sbb-mini-button,sbb-popover-trigger,sbb-form-field-clear,sbb-datepicker-next-day,sbb-datepicker-previous-day,sbb-datepicker-toggle,sbb-select,sbb-autocomplete,sbb-autocomplete-grid,sbb-chip-group").forEach((t) => t.toggleAttribute("negative", this.negative));
|
|
302
292
|
}
|
|
303
293
|
render() {
|
|
304
|
-
|
|
305
|
-
return L`
|
|
294
|
+
return z`
|
|
306
295
|
<div class="sbb-form-field__space-wrapper">
|
|
307
296
|
${/* Queried by id from the autocomplete/select to be used as the anchor element */
|
|
308
297
|
""}
|
|
@@ -313,16 +302,16 @@ let Ve = (() => {
|
|
|
313
302
|
<span class="sbb-form-field__label">
|
|
314
303
|
<span class="sbb-form-field__label-ellipsis">
|
|
315
304
|
<slot name="label" @slotchange=${this._onSlotLabelChange}></slot>
|
|
316
|
-
${this.optional ?
|
|
305
|
+
${this.optional ? z` <span aria-hidden="true"> ${ke[this._language.current]} </span>` : ae}
|
|
317
306
|
</span>
|
|
318
307
|
</span>
|
|
319
308
|
<div class="sbb-form-field__input">
|
|
320
309
|
<slot @slotchange=${this._onSlotInputChange}></slot>
|
|
321
310
|
</div>
|
|
322
|
-
${["select", "sbb-select"].includes(
|
|
311
|
+
${["select", "sbb-select"].includes(this._input?.localName) ? z`<sbb-icon
|
|
323
312
|
name="chevron-small-down-small"
|
|
324
313
|
class="sbb-form-field__select-input-icon"
|
|
325
|
-
></sbb-icon>` :
|
|
314
|
+
></sbb-icon>` : ae}
|
|
326
315
|
</div>
|
|
327
316
|
<slot name="suffix" @slotchange=${this._syncNegative}></slot>
|
|
328
317
|
</div>
|
|
@@ -333,30 +322,30 @@ let Ve = (() => {
|
|
|
333
322
|
</div>
|
|
334
323
|
`;
|
|
335
324
|
}
|
|
336
|
-
},
|
|
337
|
-
const
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
} }, metadata:
|
|
341
|
-
|
|
342
|
-
} }, metadata:
|
|
343
|
-
|
|
344
|
-
} }, metadata:
|
|
345
|
-
|
|
346
|
-
} }, metadata:
|
|
347
|
-
|
|
348
|
-
} }, metadata:
|
|
349
|
-
|
|
350
|
-
} }, metadata:
|
|
351
|
-
|
|
352
|
-
} }, metadata:
|
|
353
|
-
|
|
354
|
-
} }, metadata:
|
|
355
|
-
|
|
356
|
-
} }, metadata:
|
|
357
|
-
|
|
358
|
-
} }, metadata:
|
|
359
|
-
})(), l.styles =
|
|
325
|
+
}, h = new WeakMap(), u = new WeakMap(), m = new WeakMap(), _ = new WeakMap(), g = new WeakMap(), v = new WeakMap(), y = new WeakMap(), x = new WeakMap(), k = new WeakMap(), w = new WeakMap(), f = l, (() => {
|
|
326
|
+
const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(L[Symbol.metadata] ?? null) : void 0;
|
|
327
|
+
S = [p({ attribute: "error-space", reflect: !0 })], F = [E(), p({ type: Boolean })], O = [p({ reflect: !0 })], M = [E(), p({ reflect: !0, type: Boolean })], j = [p({ reflect: !0 })], G = [E(), p({ attribute: "hidden-label", reflect: !0, type: Boolean })], W = [E(), p({ attribute: "floating-label", reflect: !0, type: Boolean })], K = [I()], Z = [I()], ie = [I()], c(l, null, S, { kind: "accessor", name: "errorSpace", static: !1, private: !1, access: { has: (e) => "errorSpace" in e, get: (e) => e.errorSpace, set: (e, i) => {
|
|
328
|
+
e.errorSpace = i;
|
|
329
|
+
} }, metadata: t }, C, N), c(l, null, F, { kind: "accessor", name: "optional", static: !1, private: !1, access: { has: (e) => "optional" in e, get: (e) => e.optional, set: (e, i) => {
|
|
330
|
+
e.optional = i;
|
|
331
|
+
} }, metadata: t }, D, T), c(l, null, O, { kind: "accessor", name: "size", static: !1, private: !1, access: { has: (e) => "size" in e, get: (e) => e.size, set: (e, i) => {
|
|
332
|
+
e.size = i;
|
|
333
|
+
} }, metadata: t }, $, U), c(l, null, M, { kind: "accessor", name: "borderless", static: !1, private: !1, access: { has: (e) => "borderless" in e, get: (e) => e.borderless, set: (e, i) => {
|
|
334
|
+
e.borderless = i;
|
|
335
|
+
} }, metadata: t }, V, B), c(l, null, j, { kind: "accessor", name: "width", static: !1, private: !1, access: { has: (e) => "width" in e, get: (e) => e.width, set: (e, i) => {
|
|
336
|
+
e.width = i;
|
|
337
|
+
} }, metadata: t }, H, q), c(l, null, G, { kind: "accessor", name: "hiddenLabel", static: !1, private: !1, access: { has: (e) => "hiddenLabel" in e, get: (e) => e.hiddenLabel, set: (e, i) => {
|
|
338
|
+
e.hiddenLabel = i;
|
|
339
|
+
} }, metadata: t }, P, R), c(l, null, W, { kind: "accessor", name: "floatingLabel", static: !1, private: !1, access: { has: (e) => "floatingLabel" in e, get: (e) => e.floatingLabel, set: (e, i) => {
|
|
340
|
+
e.floatingLabel = i;
|
|
341
|
+
} }, metadata: t }, Y, J), c(l, null, K, { kind: "accessor", name: "_errorElements", static: !1, private: !1, access: { has: (e) => "_errorElements" in e, get: (e) => e._errorElements, set: (e, i) => {
|
|
342
|
+
e._errorElements = i;
|
|
343
|
+
} }, metadata: t }, Q, X), c(l, null, Z, { kind: "accessor", name: "_input", static: !1, private: !1, access: { has: (e) => "_input" in e, get: (e) => e._input, set: (e, i) => {
|
|
344
|
+
e._input = i;
|
|
345
|
+
} }, metadata: t }, ee, te), c(l, null, ie, { kind: "accessor", name: "_label", static: !1, private: !1, access: { has: (e) => "_label" in e, get: (e) => e._label, set: (e, i) => {
|
|
346
|
+
e._label = i;
|
|
347
|
+
} }, metadata: t }, re, se), c(null, a = { value: f }, o, { kind: "class", name: f.name, metadata: t }, null, n), f = a.value, t && Object.defineProperty(f, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: t });
|
|
348
|
+
})(), l.styles = ze, s(f, n), f;
|
|
360
349
|
})();
|
|
361
350
|
export {
|
|
362
351
|
Ve as SbbFormFieldElement
|
|
@@ -1,42 +1,40 @@
|
|
|
1
|
-
import { __esDecorate as
|
|
2
|
-
import { css as
|
|
3
|
-
import { customElement as
|
|
4
|
-
import { SbbButtonBaseElement as
|
|
5
|
-
import { SbbLanguageController as
|
|
6
|
-
import { hostAttributes as
|
|
7
|
-
import { i18nClearInput as
|
|
8
|
-
import { SbbNegativeMixin as
|
|
1
|
+
import { __esDecorate as s, __runInitializers as n } from "tslib";
|
|
2
|
+
import { css as l, html as d } from "lit";
|
|
3
|
+
import { customElement as c } from "lit/decorators.js";
|
|
4
|
+
import { SbbButtonBaseElement as u } from "../../core/base-elements.js";
|
|
5
|
+
import { SbbLanguageController as v } from "../../core/controllers.js";
|
|
6
|
+
import { hostAttributes as m } from "../../core/decorators.js";
|
|
7
|
+
import { i18nClearInput as f } from "../../core/i18n.js";
|
|
8
|
+
import { SbbNegativeMixin as h } from "../../core/mixins.js";
|
|
9
9
|
import "../../icon.js";
|
|
10
|
-
const
|
|
11
|
-
let
|
|
10
|
+
const p = l`*,:before,:after{box-sizing:border-box}:host{display:block;outline:none!important}:host{display:inline-block;-webkit-tap-highlight-color:transparent;height:fit-content;outline:none!important;--sbb-button-color-text: var(--sbb-color-charcoal);--sbb-button-color-default-background: var(--sbb-color-black-alpha-0);--sbb-button-color-hover-background: var(--sbb-color-milk);--sbb-button-color-active-background: var(--sbb-color-cloud);--sbb-button-color-disabled-background: var(--sbb-color-milk);--sbb-button-color-disabled-border: var(--sbb-color-smoke);--sbb-button-color-disabled-text: var(--sbb-color-granite);--sbb-button-border-disabled-width: var(--sbb-border-width-1x);--sbb-button-border-disabled-style: dashed;--sbb-button-border-radius: var(--sbb-border-radius-infinity);--sbb-button-transition-duration: var( --sbb-disable-animation-duration, var(--sbb-animation-duration-2x) );--sbb-button-transition-easing-function: var(--sbb-animation-easing)}@media (forced-colors: active){:host{--sbb-button-color-text: ButtonText !important;--sbb-button-color-hover-background: Highlight !important;--sbb-button-color-active-background: Highlight !important;--sbb-button-color-disabled-background: Canvas !important;--sbb-button-color-disabled-border: GrayText !important;--sbb-button-color-disabled-text: GrayText !important}}:host .sbb-form-field-clear{position:relative;transition-duration:var(--sbb-button-transition-duration);transition-timing-function:var(--sbb-button-transition-easing-function);transition-property:color;border-radius:var(--sbb-button-border-radius);color:var(--sbb-button-color-text);cursor:pointer;-webkit-user-select:none;user-select:none;display:flex}:host .sbb-form-field-clear:before{position:absolute;content:"";inset:0;border-radius:var(--sbb-button-border-radius);background-color:var(--sbb-button-color-default-background);transition-duration:var(--sbb-button-transition-duration);transition-timing-function:var(--sbb-button-transition-easing-function);transition-property:inset,background-color}sbb-icon{transition:transform var(--sbb-button-transition-duration) var(--sbb-button-transition-easing-function);transform:translateY(var(--sbb-button-translate-y-content-hover, 0rem));display:flex}:host([negative]){--sbb-button-color-text: var(--sbb-color-milk);--sbb-button-color-default-background: var(--sbb-color-black-alpha-0);--sbb-button-color-hover-background: var(--sbb-color-charcoal);--sbb-button-color-active-background: var(--sbb-color-iron);--sbb-button-color-disabled-background: var(--sbb-color-charcoal);--sbb-button-color-disabled-border: var(--sbb-color-smoke);--sbb-button-color-disabled-text: var(--sbb-color-smoke)}:host(:is([disabled],:disabled,[disabled-interactive],[data-disabled],[data-group-disabled])) .sbb-form-field-clear{color:var(--sbb-button-color-disabled-text);cursor:default;pointer-events:none}:host(:is([disabled],:disabled,[disabled-interactive],[data-disabled],[data-group-disabled])) .sbb-form-field-clear:before{background-color:var(--sbb-button-color-disabled-background);border:var(--sbb-button-border-disabled-width) var(--sbb-button-border-disabled-style) var(--sbb-button-color-disabled-border)}:host(:is([data-focus-visible],:focus-visible)) .sbb-form-field-clear:before{outline-offset:var(--sbb-focus-outline-offset);outline:var(--sbb-focus-outline-color) var(--sbb-focus-outline-style, solid) var(--sbb-focus-outline-width)}:host([data-focus-visible]){--sbb-focus-outline-style: initial}@media (any-hover: hover){:host(:not([disabled],:disabled,[disabled-interactive],[data-disabled],[data-group-disabled],:active,[data-active]):hover){--sbb-button-translate-y-content-hover: -.0625rem}}@media (any-hover: hover){:host(:not([disabled],:disabled,[disabled-interactive],[data-disabled],[data-group-disabled],:active,[data-active]):hover) .sbb-form-field-clear:before{background-color:var(--sbb-button-color-hover-background)}}:host(:not([disabled],:disabled,[disabled-interactive],[data-disabled],[data-group-disabled]):is(:active,[data-active])) .sbb-form-field-clear:before{background-color:var(--sbb-button-color-active-background)}`;
|
|
11
|
+
let F = (() => {
|
|
12
12
|
var r;
|
|
13
|
-
let
|
|
13
|
+
let i = [c("sbb-form-field-clear"), m({
|
|
14
14
|
slot: "suffix"
|
|
15
|
-
})], b, a = [], o, e =
|
|
15
|
+
})], b, a = [], o, e = h(u);
|
|
16
16
|
return r = class extends e {
|
|
17
17
|
constructor() {
|
|
18
|
-
|
|
19
|
-
super(), this._language = new f(this), (t = this.addEventListener) == null || t.call(this, "click", () => this._handleClick());
|
|
18
|
+
super(), this._language = new v(this), this.addEventListener?.("click", () => this._handleClick());
|
|
20
19
|
}
|
|
21
20
|
connectedCallback() {
|
|
22
21
|
super.connectedCallback(), this._formField = this.closest("sbb-form-field, [data-form-field]"), this._formField && (this.negative = this._formField.hasAttribute("negative"));
|
|
23
22
|
}
|
|
24
23
|
async _handleClick() {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
!t || t.localName !== "input" || ((s = this._formField) == null || s.clear(), t.focus(), t.dispatchEvent(new InputEvent("input", { bubbles: !0, composed: !0 })), t.dispatchEvent(new Event("change", { bubbles: !0 })));
|
|
24
|
+
const t = this._formField?.inputElement;
|
|
25
|
+
!t || t.localName !== "input" || (this._formField?.clear(), t.focus(), t.dispatchEvent(new InputEvent("input", { bubbles: !0, composed: !0 })), t.dispatchEvent(new Event("change", { bubbles: !0 })));
|
|
28
26
|
}
|
|
29
27
|
willUpdate(t) {
|
|
30
|
-
super.willUpdate(t), this.setAttribute("aria-label",
|
|
28
|
+
super.willUpdate(t), this.setAttribute("aria-label", f[this._language.current]);
|
|
31
29
|
}
|
|
32
30
|
renderTemplate() {
|
|
33
|
-
return
|
|
31
|
+
return d` <sbb-icon name="cross-small"></sbb-icon> `;
|
|
34
32
|
}
|
|
35
33
|
}, o = r, (() => {
|
|
36
34
|
const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(e[Symbol.metadata] ?? null) : void 0;
|
|
37
|
-
|
|
38
|
-
})(), r.styles =
|
|
35
|
+
s(null, b = { value: o }, i, { kind: "class", name: o.name, metadata: t }, null, a), o = b.value, t && Object.defineProperty(o, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: t });
|
|
36
|
+
})(), r.styles = p, n(o, a), o;
|
|
39
37
|
})();
|
|
40
38
|
export {
|
|
41
|
-
|
|
39
|
+
F as SbbFormFieldClearElement
|
|
42
40
|
};
|