@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
package/clock/clock.component.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
var
|
|
2
|
-
throw TypeError(
|
|
1
|
+
var M = (s) => {
|
|
2
|
+
throw TypeError(s);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
import { __runInitializers as m, __esDecorate as
|
|
7
|
-
import { css as
|
|
8
|
-
import { customElement as
|
|
4
|
+
var p = (s, n, e) => n.has(s) || M("Cannot " + e);
|
|
5
|
+
var g = (s, n, e) => (p(s, n, "read from private field"), e ? e.call(s) : n.get(s)), H = (s, n, e) => n.has(s) ? M("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(s) : n.set(s, e), h = (s, n, e, i) => (p(s, n, "write to private field"), i ? i.call(s, e) : n.set(s, e), e);
|
|
6
|
+
import { __runInitializers as m, __esDecorate as y } from "tslib";
|
|
7
|
+
import { css as E, LitElement as A, isServer as z, html as O } from "lit";
|
|
8
|
+
import { customElement as T, property as I } from "lit/decorators.js";
|
|
9
9
|
import { ref as _ } from "lit/directives/ref.js";
|
|
10
|
-
const
|
|
11
|
-
`,
|
|
12
|
-
`,
|
|
13
|
-
`,
|
|
14
|
-
`,
|
|
10
|
+
const N = `<svg focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 105 105"><g class="face"><circle fill="#FFF" cx="52.5" cy="52.5" r="52.5"/><path d="M50.75 4h3.5v12h-3.5zM50.75 89h3.5v12h-3.5zM75.233 9.623l3.03 1.75-6 10.392-3.03-1.75zM32.734 83.233l3.03 1.75-6 10.392-3.03-1.75zM93.628 26.732l1.75 3.031-10.392 6-1.75-3.03zM20.017 69.234l1.75 3.031-10.392 6-1.75-3.03zM101 50.75v3.5H89v-3.5zM16 50.75v3.5H4v-3.5zM95.379 75.232l-1.75 3.031-10.392-6 1.75-3.03zM21.766 32.734l-1.75 3.031-10.392-6 1.75-3.03zM78.267 93.63l-3.03 1.75-6-10.393 3.03-1.75zM35.766 20.015l-3.03 1.75-6-10.392 3.03-1.75z"/><g><path d="M56.873 4.19l1.392.147-.366 3.48-1.392-.145zM47.101 97.177l1.393.146-.366 3.481-1.392-.146zM61.896 4.914l1.37.29-.728 3.424-1.37-.29zM42.458 96.366l1.37.29-.728 3.424-1.37-.291zM66.825 6.157l1.332.432-1.082 3.33-1.331-.434zM37.931 95.085l1.332.432-1.082 3.33-1.331-.433zM71.584 7.906l1.28.569-1.424 3.197-1.28-.57zM33.56 93.32l1.278.569-1.423 3.197-1.28-.57zM80.44 12.852l1.133.823-2.058 2.831-1.132-.823zM25.481 88.494l1.133.822-2.057 2.832-1.133-.823zM84.43 15.986l1.04.937-2.342 2.6-1.04-.936zM21.87 85.469l1.04.936-2.341 2.601-1.04-.937zM88.072 19.522l.937 1.04-2.6 2.343-.937-1.04zM18.593 82.088l.937 1.04-2.601 2.342-.937-1.04zM91.328 23.425l.823 1.133-2.832 2.057-.823-1.132zM15.684 78.385l.823 1.132-2.832 2.058-.822-1.133zM96.52 32.128l.57 1.279-3.198 1.423-.57-1.278zM11.109 70.161l.569 1.279-3.197 1.423-.57-1.279zM98.407 36.85l.433 1.332-3.33 1.081-.432-1.331zM9.483 65.74l.432 1.33-3.329 1.082-.432-1.331zM99.795 41.726l.291 1.37-3.423.727-.29-1.37zM8.34 61.17l.292 1.37-3.424.728-.29-1.37zM100.66 46.73l.146 1.393-3.48.366-.147-1.392zM7.674 56.506l.146 1.392-3.48.366-.147-1.392zM100.811 56.873l-.146 1.392-3.48-.365.145-1.393zM7.821 47.101l-.146 1.392-3.48-.365.145-1.393zM100.09 61.895l-.291 1.369-3.424-.728.291-1.369zM8.631 42.46l-.291 1.37-3.423-.728.29-1.37zM98.84 66.827l-.432 1.331-3.329-1.081.433-1.332zM9.918 37.93l-.433 1.331-3.329-1.082.433-1.331zM97.098 71.585l-.569 1.28-3.197-1.424.57-1.28zM11.677 33.558l-.57 1.28-3.197-1.424.57-1.279zM92.149 80.439l-.823 1.133-2.832-2.058.823-1.132zM16.506 25.482l-.823 1.133-2.831-2.057.823-1.133zM89.017 84.431l-.937 1.04-2.6-2.341.936-1.04zM19.528 21.869l-.936 1.04-2.601-2.342.936-1.04zM85.48 88.076l-1.041.936-2.342-2.6 1.04-.937zM22.91 18.59l-1.04.937-2.341-2.601 1.04-.937zM81.574 91.328l-1.133.823-2.057-2.831 1.132-.823zM26.617 15.684l-1.133.823-2.057-2.832 1.132-.823zM72.873 96.524l-1.279.57-1.423-3.198 1.278-.57zM34.838 11.105l-1.279.57-1.423-3.198 1.279-.57zM68.151 98.405l-1.331.432-1.082-3.329 1.332-.432zM39.259 9.485l-1.332.433-1.081-3.33 1.331-.432zM63.272 99.799l-1.369.29-.728-3.422 1.37-.291zM43.83 8.337l-1.369.291-.727-3.423 1.37-.291zM58.27 100.662l-1.393.146-.366-3.48 1.393-.147zM48.494 7.672l-1.392.147-.366-3.481 1.392-.147z"/></g></g></svg>
|
|
11
|
+
`, P = `<svg focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 105 105"><path id="mod_clock_svg_hours" d="M55.7 64.5h-6.4l.6-44h5.2z"/></svg>
|
|
12
|
+
`, F = `<svg focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 105 105"><path d="M55.1,64.5h-5.2l0.8-58h3.6L55.1,64.5z"/></svg>
|
|
13
|
+
`, x = `<svg focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 105 105"><path d="M57.8,21.3c0-2.9-2.4-5.2-5.2-5.2s-5.3,2.3-5.3,5.2c0,2.7,2,4.8,4.5,5.2V69h1.5V26.5C55.8,26.2,57.8,24,57.8,21.3z"/></svg>
|
|
14
|
+
`, U = E`*,:before,:after{box-sizing:border-box}:host{--sbb-clock-hours-animation-start-angle: 0deg;--sbb-clock-seconds-animation-start-angle: 0deg;--sbb-clock-hours-animation-duration: 0s;--sbb-clock-seconds-animation-duration: 0s;--sbb-clock-animation-play-state: paused;--sbb-clock-seconds-hand-color: var(--sbb-color-red);display:block}.sbb-clock{position:relative;width:100%;height:100%;aspect-ratio:1/1;overflow:hidden;contain:content}.sbb-clock__face,.sbb-clock__hand-hours,.sbb-clock__hand-minutes,.sbb-clock__hand-seconds{position:absolute;inset:0;transform-origin:center center;transform:rotate(0);transform-style:preserve-3d;backface-visibility:hidden}.sbb-clock__hand-minutes{transition:transform var(--sbb-disable-animation-duration, .2s) cubic-bezier(.4,2.08,.55,.44)}@supports not (aspect-ratio: 1/1){.sbb-clock__hand-minutes{transform-origin:50% 49.625%}}.sbb-clock__hand-hours{animation-name:rotate;animation-duration:43200s;animation-iteration-count:infinite;animation-timing-function:linear;animation-play-state:var(--sbb-clock-animation-play-state)}.sbb-clock__hand-hours--initial-hour{animation-name:hand-hours-animation-initial-hour;animation-duration:var(--sbb-clock-hours-animation-duration);animation-play-state:var(--sbb-clock-animation-play-state);animation-iteration-count:1}.sbb-clock__hand-minutes--no-transition{transition:none}.sbb-clock__hand-seconds{animation-name:hand-seconds-animation;animation-duration:60s;animation-timing-function:linear;animation-play-state:var(--sbb-clock-animation-play-state);animation-iteration-count:infinite;fill:var(--sbb-clock-seconds-hand-color)}.sbb-clock__hand-seconds--initial-minute{animation-name:hand-seconds-animation-initial-minute;animation-duration:var(--sbb-clock-seconds-animation-duration);animation-play-state:var(--sbb-clock-animation-play-state);animation-iteration-count:1}:host(:not([data-initialized])) :is(.sbb-clock__hand-hours,.sbb-clock__hand-minutes,.sbb-clock__hand-seconds){display:none}@keyframes rotate{to{transform:rotate(360deg)}}@keyframes hand-hours-animation-initial-hour{0%{transform:rotate(var(--sbb-clock-hours-animation-start-angle))}to{transform:rotate(360deg)}}@keyframes hand-seconds-animation{0%{transform:rotate(0)}97.5%,to{transform:rotate(360deg)}}@keyframes hand-seconds-animation-initial-minute{0%{transform:rotate(var(--sbb-clock-seconds-animation-start-angle))}97.5%,to{transform:rotate(360deg)}}`, $ = 12, D = 60, f = 60, V = 50, S = 360, w = 30, G = 6, R = 360 / 58.5, B = 60, L = 3600, K = L / 2, C = {
|
|
15
15
|
once: !0,
|
|
16
16
|
passive: !0
|
|
17
17
|
};
|
|
18
|
-
let
|
|
19
|
-
var
|
|
20
|
-
let
|
|
21
|
-
return
|
|
18
|
+
let X = (() => {
|
|
19
|
+
var c, o;
|
|
20
|
+
let s = [T("sbb-clock")], n, e = [], i, u = A, b, k = [], v = [];
|
|
21
|
+
return o = class extends u {
|
|
22
22
|
constructor() {
|
|
23
23
|
super(...arguments);
|
|
24
|
-
|
|
25
|
-
h(this,
|
|
24
|
+
H(this, c);
|
|
25
|
+
h(this, c, m(this, k, null)), this._state = (m(this, v), "paused"), this._moveHoursHandFn = () => this._moveHoursHand(), this._moveMinutesHandFn = () => this._moveMinutesHand(), this._handlePageVisibilityChange = async () => {
|
|
26
26
|
this.now || (document.visibilityState === "hidden" ? await this._stopClock() : await this._startClock());
|
|
27
27
|
};
|
|
28
28
|
}
|
|
@@ -31,19 +31,19 @@ let it = (() => {
|
|
|
31
31
|
* @param value HH:MM:ss
|
|
32
32
|
*/
|
|
33
33
|
get now() {
|
|
34
|
-
return
|
|
34
|
+
return g(this, c);
|
|
35
35
|
}
|
|
36
36
|
set now(t) {
|
|
37
|
-
h(this,
|
|
37
|
+
h(this, c, t);
|
|
38
38
|
}
|
|
39
39
|
connectedCallback() {
|
|
40
|
-
super.connectedCallback(), this._resetIntervalId = setInterval(() => this._resetClock(),
|
|
40
|
+
super.connectedCallback(), this._resetIntervalId = setInterval(() => this._resetClock(), K * 1e3);
|
|
41
41
|
}
|
|
42
42
|
willUpdate(t) {
|
|
43
|
-
super.willUpdate(t), !
|
|
43
|
+
super.willUpdate(t), !z && t.has("now") && this._startOrConfigureClock();
|
|
44
44
|
}
|
|
45
45
|
async firstUpdated(t) {
|
|
46
|
-
super.firstUpdated(t),
|
|
46
|
+
super.firstUpdated(t), z || (document.addEventListener("visibilitychange", this._handlePageVisibilityChange, !1), await this._startOrConfigureClock());
|
|
47
47
|
}
|
|
48
48
|
disconnectedCallback() {
|
|
49
49
|
super.disconnectedCallback(), this._removeEventListeners(), clearInterval(this._resetIntervalId);
|
|
@@ -53,16 +53,13 @@ let it = (() => {
|
|
|
53
53
|
}
|
|
54
54
|
/** Starts the clock by defining the hands starting position then starting the animations. */
|
|
55
55
|
async _startClock() {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
this._setHandsStartingPosition(), (a = this.style) == null || a.setProperty("--sbb-clock-animation-play-state", "running"), this._state = "running", o();
|
|
60
|
-
}, Z));
|
|
56
|
+
this._clockHandHours?.addEventListener("animationend", this._moveHoursHandFn, C), this._clockHandSeconds?.addEventListener("animationend", this._moveMinutesHandFn, C), await new Promise((t) => setTimeout(() => {
|
|
57
|
+
this._setHandsStartingPosition(), this.style?.setProperty("--sbb-clock-animation-play-state", "running"), this._state = "running", t();
|
|
58
|
+
}, V));
|
|
61
59
|
}
|
|
62
60
|
/** Stops the clock by removing all the animations. */
|
|
63
61
|
async _stopClock() {
|
|
64
|
-
|
|
65
|
-
clearInterval(this._handMovement), this._removeSecondsAnimationStyles(), this._removeHoursAnimationStyles(), (t = this._clockHandHours) == null || t.removeEventListener("animationend", this._moveHoursHandFn), (s = this._clockHandSeconds) == null || s.removeEventListener("animationend", this._moveMinutesHandFn), (o = this._clockHandMinutes) == null || o.classList.add("sbb-clock__hand-minutes--no-transition"), (a = this.style) == null || a.setProperty("--sbb-clock-animation-play-state", "paused"), this._state = "paused";
|
|
62
|
+
clearInterval(this._handMovement), this._removeSecondsAnimationStyles(), this._removeHoursAnimationStyles(), this._clockHandHours?.removeEventListener("animationend", this._moveHoursHandFn), this._clockHandSeconds?.removeEventListener("animationend", this._moveMinutesHandFn), this._clockHandMinutes?.classList.add("sbb-clock__hand-minutes--no-transition"), this.style?.setProperty("--sbb-clock-animation-play-state", "paused"), this._state = "paused";
|
|
66
63
|
}
|
|
67
64
|
/**
|
|
68
65
|
* As a fallback measure to prevent de-sync, reset the clock to the system time.
|
|
@@ -72,33 +69,29 @@ let it = (() => {
|
|
|
72
69
|
}
|
|
73
70
|
/** Set the starting position for the three hands on the clock face. */
|
|
74
71
|
_setHandsStartingPosition() {
|
|
75
|
-
var M, p, g, H, y, f;
|
|
76
72
|
this._assignCurrentTime();
|
|
77
|
-
const t =
|
|
78
|
-
let
|
|
79
|
-
t > 0 && (
|
|
73
|
+
const t = f - this._seconds, a = D - this._minutes, l = $ - this._hours;
|
|
74
|
+
let r = 0, d = 0;
|
|
75
|
+
t > 0 && (r += t, d = 1), a > 0 && (r += (a - d) * B, d = 1), l > 0 && (r += (l - d) * L), this.style?.setProperty("--sbb-clock-hours-animation-start-angle", `${Math.ceil(this._hours * w + this._minutes / 2)}deg`), this.style?.setProperty("--sbb-clock-hours-animation-duration", `${r}s`), this.style?.setProperty("--sbb-clock-seconds-animation-start-angle", `${Math.ceil(this._seconds * R)}deg`), this.style?.setProperty("--sbb-clock-seconds-animation-duration", `${t}s`), this._setMinutesHand(), this._clockHandSeconds?.classList.add("sbb-clock__hand-seconds--initial-minute"), this._clockHandHours?.classList.add("sbb-clock__hand-hours--initial-hour"), this.toggleAttribute("data-initialized", !0);
|
|
80
76
|
}
|
|
81
77
|
/** Given the current date, calculates the hh/mm/ss values and the hh/mm/ss left to the next midnight. */
|
|
82
78
|
_assignCurrentTime() {
|
|
83
|
-
const t = this.now ? null : /* @__PURE__ */ new Date(), [
|
|
84
|
-
this._hours =
|
|
79
|
+
const t = this.now ? null : /* @__PURE__ */ new Date(), [a, l, r] = t ? [t.getHours(), t.getMinutes(), t.getSeconds()] : this.now.split(":").map((d) => +d);
|
|
80
|
+
this._hours = a % 12, this._minutes = l, this._seconds = r;
|
|
85
81
|
}
|
|
86
82
|
/** Set the starting position for the minutes hand. */
|
|
87
83
|
_setMinutesHand() {
|
|
88
|
-
|
|
89
|
-
(t = this._clockHandMinutes) == null || t.style.setProperty("transform", `rotateZ(${Math.ceil(this._minutes * q)}deg)`);
|
|
84
|
+
this._clockHandMinutes?.style.setProperty("transform", `rotateZ(${Math.ceil(this._minutes * G)}deg)`);
|
|
90
85
|
}
|
|
91
86
|
/** Move the hours hand to the next value. */
|
|
92
87
|
_moveHoursHand() {
|
|
93
|
-
var s;
|
|
94
88
|
this._removeHoursAnimationStyles();
|
|
95
|
-
let t = Math.ceil(this._hours *
|
|
96
|
-
t >=
|
|
89
|
+
let t = Math.ceil(this._hours * w + this._minutes / 2);
|
|
90
|
+
t >= S && (t -= S), this._clockHandHours?.style.setProperty("transform", `rotateZ(${t}deg)`);
|
|
97
91
|
}
|
|
98
92
|
/** Move the minutes hand to the next value. */
|
|
99
93
|
_moveMinutesHand() {
|
|
100
|
-
|
|
101
|
-
(t = this._clockHandSeconds) == null || t.removeEventListener("animationend", this._moveMinutesHandFn), this._removeSecondsAnimationStyles(), this._addMinutesAndSetHands(), this._handMovement = setInterval(() => this._addMinutesAndSetHands(), A * 1e3);
|
|
94
|
+
this._clockHandSeconds?.removeEventListener("animationend", this._moveMinutesHandFn), this._removeSecondsAnimationStyles(), this._addMinutesAndSetHands(), this._handMovement = setInterval(() => this._addMinutesAndSetHands(), f * 1e3);
|
|
102
95
|
}
|
|
103
96
|
_addMinutesAndSetHands() {
|
|
104
97
|
this._minutes++, this._setMinutesHand();
|
|
@@ -112,38 +105,35 @@ let it = (() => {
|
|
|
112
105
|
this._clockHandSeconds && (this._clockHandSeconds.style.animation = "", this._clockHandSeconds.offsetHeight, this._clockHandSeconds.style.removeProperty("animation"));
|
|
113
106
|
}
|
|
114
107
|
_removeEventListeners() {
|
|
115
|
-
|
|
116
|
-
document == null || document.removeEventListener("visibilitychange", this._handlePageVisibilityChange), (t = this._clockHandHours) == null || t.removeEventListener("animationend", this._moveHoursHandFn), (s = this._clockHandSeconds) == null || s.removeEventListener("animationend", this._moveMinutesHandFn), clearInterval(this._handMovement);
|
|
108
|
+
document?.removeEventListener("visibilitychange", this._handlePageVisibilityChange), this._clockHandHours?.removeEventListener("animationend", this._moveHoursHandFn), this._clockHandSeconds?.removeEventListener("animationend", this._moveMinutesHandFn), clearInterval(this._handMovement);
|
|
117
109
|
}
|
|
118
110
|
_removeHoursAnimationStyles() {
|
|
119
|
-
|
|
120
|
-
(t = this._clockHandHours) == null || t.classList.remove("sbb-clock__hand-hours--initial-hour"), this.style.removeProperty("--sbb-clock-hours-animation-start-angle"), this.style.removeProperty("--sbb-clock-hours-animation-duration");
|
|
111
|
+
this._clockHandHours?.classList.remove("sbb-clock__hand-hours--initial-hour"), this.style.removeProperty("--sbb-clock-hours-animation-start-angle"), this.style.removeProperty("--sbb-clock-hours-animation-duration");
|
|
121
112
|
}
|
|
122
113
|
_removeSecondsAnimationStyles() {
|
|
123
|
-
|
|
124
|
-
(t = this._clockHandSeconds) == null || t.classList.remove("sbb-clock__hand-seconds--initial-minute"), (s = this._clockHandMinutes) == null || s.classList.remove("sbb-clock__hand-minutes--no-transition"), this.style.removeProperty("--sbb-clock-seconds-animation-start-angle"), this.style.removeProperty("--sbb-clock-seconds-animation-duration");
|
|
114
|
+
this._clockHandSeconds?.classList.remove("sbb-clock__hand-seconds--initial-minute"), this._clockHandMinutes?.classList.remove("sbb-clock__hand-minutes--no-transition"), this.style.removeProperty("--sbb-clock-seconds-animation-start-angle"), this.style.removeProperty("--sbb-clock-seconds-animation-duration");
|
|
125
115
|
}
|
|
126
116
|
render() {
|
|
127
|
-
return
|
|
117
|
+
return O`
|
|
128
118
|
<div class="sbb-clock">
|
|
129
|
-
<span class="sbb-clock__face" .innerHTML=${
|
|
119
|
+
<span class="sbb-clock__face" .innerHTML=${N}></span>
|
|
130
120
|
<span
|
|
131
121
|
class="sbb-clock__hand-hours"
|
|
132
|
-
.innerHTML=${
|
|
122
|
+
.innerHTML=${P}
|
|
133
123
|
${_((t) => {
|
|
134
124
|
this._clockHandHours = t;
|
|
135
125
|
})}
|
|
136
126
|
></span>
|
|
137
127
|
<span
|
|
138
128
|
class="sbb-clock__hand-minutes sbb-clock__hand-minutes--no-transition"
|
|
139
|
-
.innerHTML=${
|
|
129
|
+
.innerHTML=${F}
|
|
140
130
|
${_((t) => {
|
|
141
131
|
this._clockHandMinutes = t;
|
|
142
132
|
})}
|
|
143
133
|
></span>
|
|
144
134
|
<span
|
|
145
135
|
class="sbb-clock__hand-seconds"
|
|
146
|
-
.innerHTML=${
|
|
136
|
+
.innerHTML=${x}
|
|
147
137
|
${_((t) => {
|
|
148
138
|
this._clockHandSeconds = t;
|
|
149
139
|
})}
|
|
@@ -151,13 +141,13 @@ let it = (() => {
|
|
|
151
141
|
</div>
|
|
152
142
|
`;
|
|
153
143
|
}
|
|
154
|
-
},
|
|
144
|
+
}, c = new WeakMap(), i = o, (() => {
|
|
155
145
|
const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(u[Symbol.metadata] ?? null) : void 0;
|
|
156
|
-
b = [
|
|
157
|
-
|
|
158
|
-
} }, metadata: t }, k, v),
|
|
159
|
-
})(),
|
|
146
|
+
b = [I()], y(o, null, b, { kind: "accessor", name: "now", static: !1, private: !1, access: { has: (a) => "now" in a, get: (a) => a.now, set: (a, l) => {
|
|
147
|
+
a.now = l;
|
|
148
|
+
} }, metadata: t }, k, v), y(null, n = { value: i }, s, { kind: "class", name: i.name, metadata: t }, null, e), i = n.value, t && Object.defineProperty(i, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: t });
|
|
149
|
+
})(), o.styles = U, m(i, e), i;
|
|
160
150
|
})();
|
|
161
151
|
export {
|
|
162
|
-
|
|
152
|
+
X as SbbClockElement
|
|
163
153
|
};
|
|
@@ -1,48 +1,47 @@
|
|
|
1
|
-
var I = (
|
|
2
|
-
throw TypeError(
|
|
1
|
+
var I = (e) => {
|
|
2
|
+
throw TypeError(e);
|
|
3
3
|
};
|
|
4
|
-
var D = (
|
|
5
|
-
var p = (
|
|
6
|
-
import { __esDecorate as g, __runInitializers as
|
|
4
|
+
var D = (e, t, r) => t.has(e) || I("Cannot " + r);
|
|
5
|
+
var p = (e, t, r) => (D(e, t, "read from private field"), r ? r.call(e) : t.get(e)), u = (e, t, r) => t.has(e) ? I("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r), h = (e, t, r, s) => (D(e, t, "write to private field"), s ? s.call(e, r) : t.set(e, r), r);
|
|
6
|
+
import { __esDecorate as g, __runInitializers as i } from "tslib";
|
|
7
7
|
import { css as U, LitElement as j, html as B } from "lit";
|
|
8
8
|
import { customElement as O, property as m } from "lit/decorators.js";
|
|
9
9
|
import { slotState as q, forceType as T } from "../../core/decorators.js";
|
|
10
|
-
const A = U`@charset "UTF-8";*,:before,:after{box-sizing:border-box}:host{--sbb-container-background-border-radius: 0;--sbb-container-color: inherit;display:block}:host([color=white]){--sbb-container-background-color: var(--sbb-color-white)}:host([color=milk]){--sbb-container-background-color: var(--sbb-color-milk)}:host([color=midnight]),:host([color=charcoal]){--sbb-focus-outline-color: var(--sbb-focus-outline-color-dark);--sbb-container-color: var(--sbb-color-white)}:host([color=midnight]){--sbb-container-background-color: var(--sbb-color-midnight)}:host([color=charcoal]){--sbb-container-background-color: var(--sbb-color-charcoal)}:host([data-slot-names~=image]){--sbb-container-background-color: transparent;--sbb-container-padding: var(--sbb-spacing-responsive-xxl)}:host([background-expanded]:not([expanded])){background-color:var(--sbb-container-background-color)}:host([data-slot-names~=image][background-expanded]){position:relative}@media (min-width: 90rem){:host(:not([expanded],[background-expanded])){--sbb-container-background-border-radius: var(--sbb-border-radius-4x)}}.sbb-container{color:var(--sbb-container-color);background-color:var(--sbb-container-background-color);padding:var(--sbb-container-padding)}.sbb-container:after,.sbb-container:before{content:" ";display:block;visibility:hidden;height:0;overflow:hidden}:host([color=transparent]) .sbb-container{background-color:transparent}:host(:not([expanded])) .sbb-container{padding-inline:var(--sbb-layout-base-offset-responsive);margin-inline:auto;width:100%}@media (min-width: 90rem){:host(:not([expanded])) .sbb-container{max-width:calc(var(--sbb-layout-base-page-max-width) + 2 * var(--sbb-layout-base-offset-responsive))}}:host([expanded]) .sbb-container{padding-inline:var(--sbb-spacing-responsive-xxs)}:host([data-slot-names~=image]:not([background-expanded])) .sbb-container{position:relative}:host([data-slot-names~=image]) .sbb-container__content{position:relative}::slotted([slot=image]){position:absolute;
|
|
10
|
+
const A = U`@charset "UTF-8";*,:before,:after{box-sizing:border-box}:host{--sbb-container-background-border-radius: 0;--sbb-container-color: inherit;display:block}:host([color=white]){--sbb-container-background-color: var(--sbb-color-white)}:host([color=milk]){--sbb-container-background-color: var(--sbb-color-milk)}:host([color=midnight]),:host([color=charcoal]){--sbb-focus-outline-color: var(--sbb-focus-outline-color-dark);--sbb-container-color: var(--sbb-color-white)}:host([color=midnight]){--sbb-container-background-color: var(--sbb-color-midnight)}:host([color=charcoal]){--sbb-container-background-color: var(--sbb-color-charcoal)}:host([data-slot-names~=image]){--sbb-container-background-color: transparent;--sbb-container-padding: var(--sbb-spacing-responsive-xxl)}:host([background-expanded]:not([expanded])){background-color:var(--sbb-container-background-color)}:host([data-slot-names~=image][background-expanded]){position:relative}@media (min-width: 90rem){:host(:not([expanded],[background-expanded])){--sbb-container-background-border-radius: var(--sbb-border-radius-4x)}}.sbb-container{color:var(--sbb-container-color);background-color:var(--sbb-container-background-color);padding:var(--sbb-container-padding)}.sbb-container:after,.sbb-container:before{content:" ";display:block;visibility:hidden;height:0;overflow:hidden}:host([color=transparent]) .sbb-container{background-color:transparent}:host(:not([expanded])) .sbb-container{padding-inline:var(--sbb-layout-base-offset-responsive);margin-inline:auto;width:100%}@media (min-width: 90rem){:host(:not([expanded])) .sbb-container{max-width:calc(var(--sbb-layout-base-page-max-width) + 2 * var(--sbb-layout-base-offset-responsive))}}:host([expanded]) .sbb-container{padding-inline:var(--sbb-spacing-responsive-xxs)}:host([data-slot-names~=image]:not([background-expanded])) .sbb-container{position:relative}:host([data-slot-names~=image]) .sbb-container__content{position:relative}::slotted([slot=image]){position:absolute;inset:0;height:100%;width:100%}`;
|
|
11
11
|
let K = (() => {
|
|
12
|
-
var d, l,
|
|
13
|
-
let
|
|
12
|
+
var c, d, l, n;
|
|
13
|
+
let e = [O("sbb-container"), q()], t, r = [], s, x = j, k, _ = [], v = [], f, y = [], w = [], E, z = [], S = [];
|
|
14
14
|
return n = class extends x {
|
|
15
15
|
constructor() {
|
|
16
16
|
super(...arguments);
|
|
17
|
-
u(this,
|
|
18
|
-
u(this,
|
|
19
|
-
u(this,
|
|
20
|
-
|
|
17
|
+
u(this, c, i(this, _, !1));
|
|
18
|
+
u(this, d, (i(this, v), i(this, y, !1)));
|
|
19
|
+
u(this, l, (i(this, w), i(this, z, "white")));
|
|
20
|
+
i(this, S);
|
|
21
21
|
}
|
|
22
22
|
/** Whether the container is expanded. */
|
|
23
23
|
get expanded() {
|
|
24
|
-
return p(this,
|
|
24
|
+
return p(this, c);
|
|
25
25
|
}
|
|
26
26
|
set expanded(o) {
|
|
27
|
-
h(this,
|
|
27
|
+
h(this, c, o);
|
|
28
28
|
}
|
|
29
29
|
/** Whether the background color is shown on full container width on large screens. */
|
|
30
30
|
get backgroundExpanded() {
|
|
31
|
-
return p(this,
|
|
31
|
+
return p(this, d);
|
|
32
32
|
}
|
|
33
33
|
set backgroundExpanded(o) {
|
|
34
|
-
h(this,
|
|
34
|
+
h(this, d, o);
|
|
35
35
|
}
|
|
36
36
|
/** Color of the container, like transparent, white etc. */
|
|
37
37
|
get color() {
|
|
38
|
-
return p(this,
|
|
38
|
+
return p(this, l);
|
|
39
39
|
}
|
|
40
40
|
set color(o) {
|
|
41
|
-
h(this,
|
|
41
|
+
h(this, l, o);
|
|
42
42
|
}
|
|
43
43
|
willUpdate(o) {
|
|
44
|
-
|
|
45
|
-
super.willUpdate(o), o.has("expanded") && ((i = (e = this.querySelector) == null ? void 0 : e.call(this, "sbb-sticky-bar")) == null || i.toggleAttribute("data-expanded", this.expanded));
|
|
44
|
+
super.willUpdate(o), o.has("expanded") && this.querySelector?.("sbb-sticky-bar")?.toggleAttribute("data-expanded", this.expanded);
|
|
46
45
|
}
|
|
47
46
|
render() {
|
|
48
47
|
return B`
|
|
@@ -55,16 +54,16 @@ let K = (() => {
|
|
|
55
54
|
<slot name="sticky-bar"></slot>
|
|
56
55
|
`;
|
|
57
56
|
}
|
|
58
|
-
},
|
|
57
|
+
}, c = new WeakMap(), d = new WeakMap(), l = new WeakMap(), s = n, (() => {
|
|
59
58
|
const o = typeof Symbol == "function" && Symbol.metadata ? Object.create(x[Symbol.metadata] ?? null) : void 0;
|
|
60
|
-
k = [T(), m({ type: Boolean, reflect: !0 })], f = [T(), m({ type: Boolean, reflect: !0, attribute: "background-expanded" })], E = [m({ reflect: !0 })], g(n, null, k, { kind: "accessor", name: "expanded", static: !1, private: !1, access: { has: (
|
|
61
|
-
|
|
62
|
-
} }, metadata: o }, _, v), g(n, null, f, { kind: "accessor", name: "backgroundExpanded", static: !1, private: !1, access: { has: (
|
|
63
|
-
|
|
64
|
-
} }, metadata: o }, y, w), g(n, null, E, { kind: "accessor", name: "color", static: !1, private: !1, access: { has: (
|
|
65
|
-
|
|
66
|
-
} }, metadata: o }, z, S), g(null,
|
|
67
|
-
})(), n.styles = A,
|
|
59
|
+
k = [T(), m({ type: Boolean, reflect: !0 })], f = [T(), m({ type: Boolean, reflect: !0, attribute: "background-expanded" })], E = [m({ reflect: !0 })], g(n, null, k, { kind: "accessor", name: "expanded", static: !1, private: !1, access: { has: (a) => "expanded" in a, get: (a) => a.expanded, set: (a, b) => {
|
|
60
|
+
a.expanded = b;
|
|
61
|
+
} }, metadata: o }, _, v), g(n, null, f, { kind: "accessor", name: "backgroundExpanded", static: !1, private: !1, access: { has: (a) => "backgroundExpanded" in a, get: (a) => a.backgroundExpanded, set: (a, b) => {
|
|
62
|
+
a.backgroundExpanded = b;
|
|
63
|
+
} }, metadata: o }, y, w), g(n, null, E, { kind: "accessor", name: "color", static: !1, private: !1, access: { has: (a) => "color" in a, get: (a) => a.color, set: (a, b) => {
|
|
64
|
+
a.color = b;
|
|
65
|
+
} }, metadata: o }, z, S), g(null, t = { value: s }, e, { kind: "class", name: s.name, metadata: o }, null, r), s = t.value, o && Object.defineProperty(s, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: o });
|
|
66
|
+
})(), n.styles = A, i(s, r), s;
|
|
68
67
|
})();
|
|
69
68
|
export {
|
|
70
69
|
K as SbbContainerElement
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
var
|
|
1
|
+
var S = (a) => {
|
|
2
2
|
throw TypeError(a);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var
|
|
4
|
+
var z = (a, i, e) => i.has(a) || S("Cannot " + e);
|
|
5
|
+
var y = (a, i, e) => (z(a, i, "read from private field"), e ? e.call(a) : i.get(a)), h = (a, i, e) => i.has(a) ? S("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(a) : i.set(a, e), d = (a, i, e, r) => (z(a, i, "write to private field"), r ? r.call(a, e) : i.set(a, e), e);
|
|
6
6
|
import { __runInitializers as k, __esDecorate as v } from "tslib";
|
|
7
|
-
import { IntersectionController as
|
|
8
|
-
import { css as
|
|
9
|
-
import { customElement as
|
|
10
|
-
import { hostAttributes as
|
|
11
|
-
import { isLean as
|
|
7
|
+
import { IntersectionController as E } from "@lit-labs/observers/intersection-controller.js";
|
|
8
|
+
import { css as U, LitElement as R, html as I } from "lit";
|
|
9
|
+
import { customElement as D, property as A } from "lit/decorators.js";
|
|
10
|
+
import { hostAttributes as T } from "../../core/decorators.js";
|
|
11
|
+
import { isLean as B, isZeroAnimationDuration as H } from "../../core/dom.js";
|
|
12
12
|
import { EventEmitter as u } from "../../core/eventing.js";
|
|
13
|
-
import { SbbUpdateSchedulerMixin as
|
|
14
|
-
const
|
|
15
|
-
let
|
|
13
|
+
import { SbbUpdateSchedulerMixin as L } from "../../core/mixins.js";
|
|
14
|
+
const N = U`*,:before,:after{box-sizing:border-box}:host{--sbb-sticky-bar-position: sticky;--sbb-sticky-bar-padding-block: var(--sbb-spacing-responsive-xs);--sbb-sticky-bar-border-radius: var(--sbb-border-radius-8x);--sbb-sticky-bar-animation-easing: var(--sbb-animation-easing);--sbb-sticky-bar-fade-in-animation-duration: var( --sbb-disable-animation-duration, var(--sbb-animation-duration-5x) );--sbb-sticky-bar-fade-out-animation-duration: var( --sbb-disable-animation-duration, var(--sbb-animation-duration-2x) );--sbb-sticky-bar-slide-vertically-animation-duration: var( --sbb-disable-animation-duration, var(--sbb-animation-duration-4x) );--sbb-sticky-bar-slide-vertically-animation-easing: ease-out;--sbb-sticky-bar-slide-vertically-animation-delay: 0s;--sbb-sticky-bar-slide-vertically-animation-name: unset;--_sbb-sticky-bar-background-animation-duration: var( --sbb-sticky-bar-fade-out-animation-duration );--_sbb-sticky-bar-intersector-background-color: transparent;--_sbb-sticky-bar-forced-colors-border: none;display:contents}:host([size=s]){--sbb-sticky-bar-padding-block: var(--sbb-spacing-responsive-xxxs)}:host([data-sticking]:not([data-state=unsticky])){--sbb-sticky-bar-sticky-background-color: var( --sbb-container-background-color, var(--sbb-color-white) );--_sbb-sticky-bar-intersector-background-color: var(--sbb-sticky-bar-sticky-background-color);--_sbb-sticky-bar-background-animation-duration: var(--sbb-sticky-bar-fade-in-animation-duration)}@media (forced-colors: active){:host([data-sticking]:not([data-state=unsticky])){--_sbb-sticky-bar-forced-colors-border: var(--sbb-border-width-1x) solid CanvasText}}:host([data-sticking]:not([data-state=unsticky])[color=white]){--sbb-sticky-bar-sticky-background-color: var(--sbb-color-white)}:host([data-sticking]:not([data-state=unsticky])[color=milk]){--sbb-sticky-bar-sticky-background-color: var(--sbb-color-milk)}:host([data-sticking]:not([data-state=unsticky])[color=midnight]){--sbb-sticky-bar-sticky-background-color: var(--sbb-color-midnight)}:host([data-sticking]:not([data-state=unsticky])[color=charcoal]){--sbb-sticky-bar-sticky-background-color: var(--sbb-color-charcoal)}:host(:is([data-sticking]:is([data-slide-vertically],[data-state=sticking],[data-state=unsticking]),[data-state=unsticky])){--_sbb-sticky-bar-background-animation-duration: 0s}:host([data-sticking]:is([data-slide-vertically]:not([data-state=unsticky],[data-state=unsticking]),[data-state=sticking])){--sbb-sticky-bar-slide-vertically-animation-name: slide-in}:host([data-sticking][data-state=unsticking]){--sbb-sticky-bar-slide-vertically-animation-name: slide-out}:host(:is(:not([data-initialized]),[data-state=unsticky])){--sbb-sticky-bar-position: relative}.sbb-sticky-bar__wrapper{position:var(--sbb-sticky-bar-position);inset-block-end:0;display:block;z-index:var(--sbb-sticky-bar-z-index);animation-name:var(--sbb-sticky-bar-slide-vertically-animation-name);animation-duration:var(--sbb-sticky-bar-slide-vertically-animation-duration);animation-timing-function:var(--sbb-sticky-bar-slide-vertically-animation-easing);animation-delay:var(--sbb-sticky-bar-slide-vertically-animation-delay);animation-fill-mode:backwards}.sbb-sticky-bar__wrapper:after,.sbb-sticky-bar__wrapper:before{content:"";inset:0;position:absolute;display:block;z-index:-1}.sbb-sticky-bar__wrapper:before{background-color:var(--sbb-container-background-color);padding:0!important}:host(:not([data-expanded])) .sbb-sticky-bar__wrapper:before{padding-inline:var(--sbb-layout-base-offset-responsive);margin-inline:auto;width:100%}@media (min-width: 90rem){:host(:not([data-expanded])) .sbb-sticky-bar__wrapper:before{max-width:calc(var(--sbb-layout-base-page-max-width) + 2 * var(--sbb-layout-base-offset-responsive))}}.sbb-sticky-bar__wrapper:after{background-color:var(--sbb-sticky-bar-sticky-background-color, transparent);border-start-start-radius:var(--sbb-sticky-bar-border-radius);border-start-end-radius:var(--sbb-sticky-bar-border-radius);transition:background-color var(--_sbb-sticky-bar-background-animation-duration) var(--sbb-sticky-bar-animation-easing);border:var(--_sbb-sticky-bar-forced-colors-border)}.sbb-sticky-bar{display:flex;padding-block:var(--sbb-sticky-bar-padding-block);margin-block-end:-1px}.sbb-sticky-bar:before{content:"";position:absolute;inset:0;z-index:-1;border-start-start-radius:var(--sbb-sticky-bar-border-radius);border-start-end-radius:var(--sbb-sticky-bar-border-radius);transition:box-shadow var(--_sbb-sticky-bar-background-animation-duration) var(--sbb-sticky-bar-animation-easing);clip-path:polygon(-50% calc(-1 * var(--sbb-shadow-elevation-level-11-shadow-1-blur)),150% calc(-1 * var(--sbb-shadow-elevation-level-11-shadow-1-blur)),150% 50%,-50% 50%)}:host([data-sticking]:not([data-state=unsticky])) .sbb-sticky-bar:before{box-shadow:var(--sbb-shadow-elevation-level-11-shadow-2-offset-x) var(--sbb-shadow-elevation-level-11-shadow-2-offset-y) var(--sbb-shadow-elevation-level-11-shadow-2-blur) var(--sbb-shadow-elevation-level-11-shadow-2-spread) var(--sbb-shadow-elevation-level-11-soft-2-color),var(--sbb-shadow-elevation-level-11-shadow-1-offset-x) var(--sbb-shadow-elevation-level-11-shadow-1-offset-y) var(--sbb-shadow-elevation-level-11-shadow-1-blur) var(--sbb-shadow-elevation-level-11-shadow-1-spread) var(--sbb-shadow-elevation-level-11-soft-1-color)}:host(:not([data-expanded])) .sbb-sticky-bar{padding-inline:var(--sbb-layout-base-offset-responsive);margin-inline:auto;width:100%}@media (min-width: 90rem){:host(:not([data-expanded])) .sbb-sticky-bar{max-width:calc(var(--sbb-layout-base-page-max-width) + 2 * var(--sbb-layout-base-offset-responsive))}}:host([data-expanded]) .sbb-sticky-bar{padding-inline:var(--sbb-spacing-responsive-xxs)}.sbb-sticky-bar__intersector{height:1px}.sbb-sticky-bar__intersector:after{content:"";display:block;position:absolute;width:100%;height:calc(var(--sbb-sticky-bar-bottom-overlapping-height, 0) + 1px);background-color:var(--_sbb-sticky-bar-intersector-background-color);pointer-events:none;transition:background-color var(--_sbb-sticky-bar-background-animation-duration) var(--sbb-sticky-bar-animation-easing)}@keyframes slide-in{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes slide-out{0%{transform:translateY(0)}to{transform:translateY(100%)}}`;
|
|
15
|
+
let K = (() => {
|
|
16
16
|
var b, c, o;
|
|
17
|
-
let a = [
|
|
17
|
+
let a = [D("sbb-sticky-bar"), T({
|
|
18
18
|
slot: "sticky-bar"
|
|
19
|
-
})], i, e = [], r, m =
|
|
19
|
+
})], i, e = [], r, m = L(R), _, g = [], p = [], f, w = [], x = [];
|
|
20
20
|
var n = (o = class extends m {
|
|
21
21
|
constructor() {
|
|
22
22
|
super(...arguments);
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
d(this, b, k(this, g, null)), d(this, c, (k(this, p), k(this, w,
|
|
23
|
+
h(this, b);
|
|
24
|
+
h(this, c);
|
|
25
|
+
d(this, b, k(this, g, null)), d(this, c, (k(this, p), k(this, w, B() ? "s" : "m"))), this._willStick = (k(this, x), new u(this, n.events.willStick, {
|
|
26
26
|
cancelable: !0
|
|
27
27
|
})), this._didStick = new u(this, n.events.didStick, {
|
|
28
28
|
cancelable: !0
|
|
29
|
-
}), this._willUnstick = new u(this, n.events.willUnstick, { cancelable: !0 }), this._didUnstick = new u(this, n.events.didUnstick, { cancelable: !0 }), this._observer = new
|
|
29
|
+
}), this._willUnstick = new u(this, n.events.willUnstick, { cancelable: !0 }), this._didUnstick = new u(this, n.events.didUnstick, { cancelable: !0 }), this._observer = new E(this, {
|
|
30
30
|
// Although `this` is observed, we have to postpone observing
|
|
31
31
|
// into firstUpdated() to achieve a correct initial state.
|
|
32
32
|
target: null,
|
|
@@ -35,7 +35,7 @@ let Q = (() => {
|
|
|
35
35
|
}
|
|
36
36
|
/** Color of the container, like transparent, white etc. */
|
|
37
37
|
get color() {
|
|
38
|
-
return
|
|
38
|
+
return y(this, b);
|
|
39
39
|
}
|
|
40
40
|
set color(t) {
|
|
41
41
|
d(this, b, t);
|
|
@@ -45,7 +45,7 @@ let Q = (() => {
|
|
|
45
45
|
* @default 'm' / 's' (lean)
|
|
46
46
|
*/
|
|
47
47
|
get size() {
|
|
48
|
-
return
|
|
48
|
+
return y(this, c);
|
|
49
49
|
}
|
|
50
50
|
set size(t) {
|
|
51
51
|
d(this, c, t);
|
|
@@ -69,13 +69,12 @@ let Q = (() => {
|
|
|
69
69
|
super.firstUpdated(t), this._intersector || (this._intersector = this.shadowRoot.querySelector(".sbb-sticky-bar__intersector"), this._observer.observe(this._intersector)), this._observer.observe(this);
|
|
70
70
|
}
|
|
71
71
|
_isZeroAnimationDuration() {
|
|
72
|
-
return
|
|
72
|
+
return H(this, "--sbb-sticky-bar-slide-vertically-animation-duration");
|
|
73
73
|
}
|
|
74
74
|
_detectStickyState(t) {
|
|
75
|
-
var S;
|
|
76
75
|
this.toggleAttribute("data-initialized", !0);
|
|
77
|
-
const s = !t.isIntersecting && t.boundingClientRect.top > 0, l =
|
|
78
|
-
this.toggleAttribute("data-slide-vertically", s && this._intersector && Math.abs(l.bottom -
|
|
76
|
+
const s = !t.isIntersecting && t.boundingClientRect.top > 0, l = this._intersector?.getBoundingClientRect(), C = this.shadowRoot.querySelector(".sbb-sticky-bar__wrapper").getBoundingClientRect();
|
|
77
|
+
this.toggleAttribute("data-slide-vertically", s && this._intersector && Math.abs(l.bottom - C.bottom) > 30), this.toggleAttribute("data-sticking", s), this.completeUpdate();
|
|
79
78
|
}
|
|
80
79
|
/** Animates from normal content flow position to `position: sticky`. */
|
|
81
80
|
stick() {
|
|
@@ -95,7 +94,7 @@ let Q = (() => {
|
|
|
95
94
|
(this._state === "sticking" || this._state === "sticky") && t.animationName === "slide-in" ? this._stickyCallback() : this._state === "unsticking" && t.animationName === "slide-out" && this._unstickyCallback();
|
|
96
95
|
}
|
|
97
96
|
render() {
|
|
98
|
-
return
|
|
97
|
+
return I`
|
|
99
98
|
<div class="sbb-sticky-bar__wrapper" @animationend=${this._onAnimationEnd}>
|
|
100
99
|
<div class="sbb-sticky-bar">
|
|
101
100
|
<slot></slot>
|
|
@@ -106,12 +105,12 @@ let Q = (() => {
|
|
|
106
105
|
}
|
|
107
106
|
}, b = new WeakMap(), c = new WeakMap(), r = o, (() => {
|
|
108
107
|
const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(m[Symbol.metadata] ?? null) : void 0;
|
|
109
|
-
_ = [
|
|
108
|
+
_ = [A({ reflect: !0 })], f = [A({ reflect: !0 })], v(o, null, _, { kind: "accessor", name: "color", static: !1, private: !1, access: { has: (s) => "color" in s, get: (s) => s.color, set: (s, l) => {
|
|
110
109
|
s.color = l;
|
|
111
110
|
} }, metadata: t }, g, p), v(o, null, f, { kind: "accessor", name: "size", static: !1, private: !1, access: { has: (s) => "size" in s, get: (s) => s.size, set: (s, l) => {
|
|
112
111
|
s.size = l;
|
|
113
112
|
} }, metadata: t }, w, x), v(null, i = { value: r }, a, { kind: "class", name: r.name, metadata: t }, null, e), n = r = i.value, t && Object.defineProperty(r, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: t });
|
|
114
|
-
})(), o.styles =
|
|
113
|
+
})(), o.styles = N, o.events = {
|
|
115
114
|
willStick: "willStick",
|
|
116
115
|
didStick: "didStick",
|
|
117
116
|
willUnstick: "willUnstick",
|
|
@@ -120,5 +119,5 @@ let Q = (() => {
|
|
|
120
119
|
return n = r;
|
|
121
120
|
})();
|
|
122
121
|
export {
|
|
123
|
-
|
|
122
|
+
K as SbbStickyBarElement
|
|
124
123
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { interactivityChecker as
|
|
1
|
+
import { interactivityChecker as i } from "./interactivity-checker.js";
|
|
2
2
|
class r {
|
|
3
3
|
/**
|
|
4
4
|
* Whether the focus is trap is enabled.
|
|
@@ -11,8 +11,7 @@ class r {
|
|
|
11
11
|
return !!this._abortController;
|
|
12
12
|
}
|
|
13
13
|
constructor(t) {
|
|
14
|
-
|
|
15
|
-
this._host = t, this._abortController = null, (s = (e = this._host).addController) == null || s.call(e, this);
|
|
14
|
+
this._host = t, this._abortController = null, this._host.addController?.(this);
|
|
16
15
|
}
|
|
17
16
|
hostDisconnected() {
|
|
18
17
|
this._untrap();
|
|
@@ -24,9 +23,9 @@ class r {
|
|
|
24
23
|
focusInitialElement(t) {
|
|
25
24
|
const e = this._host.querySelector("[sbb-focus-initial]");
|
|
26
25
|
if (e) {
|
|
27
|
-
if (!
|
|
26
|
+
if (!i.isFocusable(e)) {
|
|
28
27
|
const s = this._getFirstTabbableElement(e);
|
|
29
|
-
return s
|
|
28
|
+
return s?.focus(t), !!s;
|
|
30
29
|
}
|
|
31
30
|
return e.focus(t), !0;
|
|
32
31
|
}
|
|
@@ -50,20 +49,19 @@ class r {
|
|
|
50
49
|
}
|
|
51
50
|
_trap() {
|
|
52
51
|
this._abortController = new AbortController(), this._host.addEventListener("keydown", (t) => {
|
|
53
|
-
var e, s;
|
|
54
52
|
if (t.key === "Tab")
|
|
55
53
|
if (t.shiftKey) {
|
|
56
|
-
const
|
|
57
|
-
|
|
54
|
+
const e = this._getFirstTabbableElement(this._host);
|
|
55
|
+
e && t.composedPath().includes(e) && (this._getLastTabbableElement(this._host)?.focus(), t.preventDefault());
|
|
58
56
|
} else {
|
|
59
|
-
const
|
|
60
|
-
|
|
57
|
+
const e = this._getLastTabbableElement(this._host);
|
|
58
|
+
e && t.composedPath().includes(e) && (this._getFirstTabbableElement(this._host)?.focus(), t.preventDefault());
|
|
61
59
|
}
|
|
62
60
|
}, { signal: this._abortController.signal });
|
|
63
61
|
}
|
|
64
62
|
/** Get the first tabbable element from a DOM subtree (inclusive). */
|
|
65
63
|
_getFirstTabbableElement(t) {
|
|
66
|
-
if (t !== this._host &&
|
|
64
|
+
if (t !== this._host && i.isFocusable(t) && i.isTabbable(t))
|
|
67
65
|
return t;
|
|
68
66
|
const e = t.shadowRoot ? t.shadowRoot.children : t.localName === "slot" ? t.assignedElements() : t.children;
|
|
69
67
|
for (let s = 0; s < e.length; s++) {
|
|
@@ -75,7 +73,7 @@ class r {
|
|
|
75
73
|
}
|
|
76
74
|
/** Get the last tabbable element from a DOM subtree (inclusive). */
|
|
77
75
|
_getLastTabbableElement(t) {
|
|
78
|
-
if (t !== this._host &&
|
|
76
|
+
if (t !== this._host && i.isFocusable(t) && i.isTabbable(t))
|
|
79
77
|
return t;
|
|
80
78
|
const e = t.shadowRoot ? t.shadowRoot.children : t.localName === "slot" ? t.assignedElements() : t.children;
|
|
81
79
|
for (let s = e.length - 1; s >= 0; s--) {
|
|
@@ -86,8 +84,7 @@ class r {
|
|
|
86
84
|
return null;
|
|
87
85
|
}
|
|
88
86
|
_untrap() {
|
|
89
|
-
|
|
90
|
-
(t = this._abortController) == null || t.abort(), this._abortController = null;
|
|
87
|
+
this._abortController?.abort(), this._abortController = null;
|
|
91
88
|
}
|
|
92
89
|
}
|
|
93
90
|
export {
|