@sbb-esta/lyne-elements 2.11.1 → 2.11.3
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/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.js +12 -17
- 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 +1 -1
- 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 -1
- 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.js +82 -91
- 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/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/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,5 +1,5 @@
|
|
|
1
|
-
const
|
|
2
|
-
class
|
|
1
|
+
const h = 7, o = 4, D = 4, c = 12, g = 24, l = /(0?[1-9]|[12][0-9]|3[01])[.,\\/\-\s](0?[1-9]|1[0-2])[.,\\/\-\s]([0-9]{1,4}$)?/, u = /^([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-3][0-9])$/;
|
|
2
|
+
class O {
|
|
3
3
|
/**
|
|
4
4
|
* Attempts to deserialize a value to a valid date object. This is different from parsing in that
|
|
5
5
|
* deserialize should only accept non-ambiguous, locale-independent formats (e.g. a ISO 8601
|
|
@@ -19,23 +19,23 @@ class _ {
|
|
|
19
19
|
format(t, e) {
|
|
20
20
|
if (!this.isValid(t))
|
|
21
21
|
return "";
|
|
22
|
-
const
|
|
22
|
+
const s = /* @__PURE__ */ new Date(this.toIso8601(t) + "T00:00:00"), i = new Intl.DateTimeFormat("de-CH", {
|
|
23
23
|
day: "2-digit",
|
|
24
24
|
month: "2-digit",
|
|
25
25
|
year: "numeric"
|
|
26
26
|
});
|
|
27
|
-
if (
|
|
28
|
-
return
|
|
29
|
-
const a =
|
|
30
|
-
let
|
|
31
|
-
return
|
|
27
|
+
if (e?.weekdayStyle === "none")
|
|
28
|
+
return i.format(s);
|
|
29
|
+
const a = e?.weekdayStyle ?? "short";
|
|
30
|
+
let r = this.getDayOfWeekNames(a)[this.getDayOfWeek(t)];
|
|
31
|
+
return r = r.charAt(0).toUpperCase() + r.substring(1), a === "short" && (r = r.substring(0, 2)), `${r}, ${i.format(s)}`;
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
34
|
* Get the given date as ISO String.
|
|
35
35
|
* @param date The date to convert to ISO String.
|
|
36
36
|
*/
|
|
37
37
|
toIso8601(t) {
|
|
38
|
-
const e = (
|
|
38
|
+
const e = (s, i = 2) => `${s}`.padStart(i, "0");
|
|
39
39
|
return `${e(this.getYear(t), 4)}-${e(this.getMonth(t))}-${e(this.getDate(t))}`;
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
@@ -73,8 +73,8 @@ class _ {
|
|
|
73
73
|
*/
|
|
74
74
|
sameDate(t, e) {
|
|
75
75
|
if (t && e) {
|
|
76
|
-
const
|
|
77
|
-
return
|
|
76
|
+
const s = this.isValid(t), i = this.isValid(e);
|
|
77
|
+
return s && i ? !this.compareDate(t, e) : s == i;
|
|
78
78
|
}
|
|
79
79
|
return t == e;
|
|
80
80
|
}
|
|
@@ -86,17 +86,17 @@ class _ {
|
|
|
86
86
|
* @returns `min` if `date` is less than `min`, `max` if date is greater than `max`,
|
|
87
87
|
* otherwise `date`.
|
|
88
88
|
*/
|
|
89
|
-
clampDate(t, e,
|
|
90
|
-
return e && this.compareDate(t, e) < 0 ? e :
|
|
89
|
+
clampDate(t, e, s) {
|
|
90
|
+
return e && this.compareDate(t, e) < 0 ? e : s && this.compareDate(t, s) > 0 ? s : t;
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
export {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
94
|
+
h as DAYS_PER_ROW,
|
|
95
|
+
O as DateAdapter,
|
|
96
|
+
l as FORMAT_DATE,
|
|
97
|
+
u as ISO8601_FORMAT_DATE,
|
|
98
|
+
c as MONTHS_PER_PAGE,
|
|
99
|
+
o as MONTHS_PER_ROW,
|
|
100
|
+
g as YEARS_PER_PAGE,
|
|
101
|
+
D as YEARS_PER_ROW
|
|
102
102
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SbbLanguageController as
|
|
1
|
+
import { SbbLanguageController as s } from "../controllers.js";
|
|
2
2
|
import { DateAdapter as u, ISO8601_FORMAT_DATE as h, FORMAT_DATE as D } from "./date-adapter.js";
|
|
3
3
|
const c = /^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|(?:(?:\+|-)\d{2}:\d{2}))?)?$/;
|
|
4
4
|
class f extends u {
|
|
@@ -28,7 +28,7 @@ class f extends u {
|
|
|
28
28
|
month: "long",
|
|
29
29
|
day: "numeric"
|
|
30
30
|
};
|
|
31
|
-
return new Intl.DateTimeFormat(
|
|
31
|
+
return new Intl.DateTimeFormat(s.current, t).format(new Date(e));
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
34
|
* Creates an array of strings with length = 12, filled with the name of the months starting from January, in the document language.
|
|
@@ -36,12 +36,12 @@ class f extends u {
|
|
|
36
36
|
* E.g., with January in en-gb: `long` returns "January", `short` returns "Jan", `narrow` returns "J".
|
|
37
37
|
*/
|
|
38
38
|
getMonthNames(e) {
|
|
39
|
-
const t = new Intl.DateTimeFormat(
|
|
39
|
+
const t = new Intl.DateTimeFormat(s.current, { month: e });
|
|
40
40
|
return this._range(12, (r) => t.format(new Date(2017, r, 1)));
|
|
41
41
|
}
|
|
42
42
|
/** Creates a string array with length = 31, filled with the days in a month, starting from 1. */
|
|
43
43
|
getDateNames() {
|
|
44
|
-
const e = new Intl.DateTimeFormat(
|
|
44
|
+
const e = new Intl.DateTimeFormat(s.current, { day: "numeric" });
|
|
45
45
|
return this._range(31, (t) => e.format(new Date(2017, 0, t + 1)));
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
@@ -50,7 +50,7 @@ class f extends u {
|
|
|
50
50
|
* E.g., with Monday in en-gb: `long` returns "Monday", `short` returns "Mon", `narrow` returns "M".
|
|
51
51
|
*/
|
|
52
52
|
getDayOfWeekNames(e) {
|
|
53
|
-
const t = new Intl.DateTimeFormat(
|
|
53
|
+
const t = new Intl.DateTimeFormat(s.current, { weekday: e });
|
|
54
54
|
return this._range(7, (r) => t.format(new Date(2017, 0, r + 1)));
|
|
55
55
|
}
|
|
56
56
|
/* Defines which is the first day of the week (0: sunday; 1: monday; etc.). */
|
|
@@ -102,8 +102,8 @@ class f extends u {
|
|
|
102
102
|
* E.g., with `date` = new Date(2022, 0, 31) and `months` = 1, it returns new Date(2022, 1, 28).
|
|
103
103
|
*/
|
|
104
104
|
addCalendarMonths(e, t) {
|
|
105
|
-
const r = e.getMonth() + t, n = new Date(e.getFullYear(), r, 1, 0, 0, 0, 0),
|
|
106
|
-
return new Date(this.clone(e).setMonth(r, Math.min(
|
|
105
|
+
const r = e.getMonth() + t, n = new Date(e.getFullYear(), r, 1, 0, 0, 0, 0), l = this.getNumDaysInMonth(n);
|
|
106
|
+
return new Date(this.clone(e).setMonth(r, Math.min(l, e.getDate())));
|
|
107
107
|
}
|
|
108
108
|
/** Creates a new date by adding the number of provided `days` to the provided `date`. */
|
|
109
109
|
addCalendarDays(e, t) {
|
|
@@ -135,13 +135,13 @@ class f extends u {
|
|
|
135
135
|
}
|
|
136
136
|
if (this.isValid(r))
|
|
137
137
|
return r;
|
|
138
|
-
const
|
|
139
|
-
if (!a || a.index !== 0 || a.length <= 2 || a.some((
|
|
138
|
+
const a = e.replace(/\D/g, " ").trim()?.match(D);
|
|
139
|
+
if (!a || a.index !== 0 || a.length <= 2 || a.some((o) => o === void 0) || !this.isValid(this.createDate(+a[3], +a[2], +a[1])))
|
|
140
140
|
return null;
|
|
141
141
|
let i = +a[3];
|
|
142
142
|
if (typeof i == "number" && i < 100 && i >= 0) {
|
|
143
|
-
const
|
|
144
|
-
i = i <=
|
|
143
|
+
const o = t.getFullYear() - 2e3 + this._cutoffYearOffset;
|
|
144
|
+
i = i <= o ? 2e3 + i : 1900 + i;
|
|
145
145
|
}
|
|
146
146
|
return new Date(i, +a[2] - 1, +a[1]);
|
|
147
147
|
}
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
import { readConfig as
|
|
2
|
-
import { defaultDateAdapter as
|
|
3
|
-
const
|
|
4
|
-
fromAttribute(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return t.getValidDateOrNull(t.deserialize(r));
|
|
1
|
+
import { readConfig as r } from "../config.js";
|
|
2
|
+
import { defaultDateAdapter as a } from "../datetime.js";
|
|
3
|
+
const p = {
|
|
4
|
+
fromAttribute(e, d) {
|
|
5
|
+
const t = r().datetime?.dateAdapter ?? a;
|
|
6
|
+
return t.getValidDateOrNull(t.deserialize(e));
|
|
8
7
|
},
|
|
9
|
-
toAttribute(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return t.isValid(r) ? t.toIso8601(r) : null;
|
|
8
|
+
toAttribute(e, d) {
|
|
9
|
+
const t = r().datetime?.dateAdapter ?? a;
|
|
10
|
+
return t.isValid(e) ? t.toIso8601(e) : null;
|
|
13
11
|
}
|
|
14
12
|
};
|
|
15
13
|
export {
|
|
16
|
-
|
|
14
|
+
p as dateConverter
|
|
17
15
|
};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { readConfig as
|
|
2
|
-
import { defaultDateAdapter as
|
|
3
|
-
function
|
|
4
|
-
|
|
5
|
-
const t = ((a = r().datetime) == null ? void 0 : a.dateAdapter) ?? n;
|
|
1
|
+
import { readConfig as a } from "../config.js";
|
|
2
|
+
import { defaultDateAdapter as r } from "../datetime.js";
|
|
3
|
+
function o(e) {
|
|
4
|
+
const t = a().datetime?.dateAdapter ?? r;
|
|
6
5
|
return t.isDateInstance(e) && t.isValid(e) ? t.createDate(t.getYear(e), t.getMonth(e), t.getDate(e)) : null;
|
|
7
6
|
}
|
|
8
7
|
export {
|
|
9
|
-
|
|
8
|
+
o as DateOnlyType
|
|
10
9
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
if (e ?? (e = u), e === String ? e = (t) => t == null ? "" : String(t) : e === Number && (e = (t) => t == null ? NaN : Number(t)), r === "accessor")
|
|
1
|
+
const o = (e) => (i, l) => {
|
|
2
|
+
const { kind: r, metadata: s, name: a } = l, n = globalThis.litPropertyMetadata.get(s)?.get(a)?.type ?? String;
|
|
3
|
+
if (e ??= n, e === String ? e = (t) => t == null ? "" : String(t) : e === Number && (e = (t) => t == null ? NaN : Number(t)), r === "accessor")
|
|
5
4
|
return {
|
|
6
5
|
set(t) {
|
|
7
6
|
i.set.call(this, e(t));
|
|
@@ -14,5 +13,5 @@ const p = (e) => (i, a) => {
|
|
|
14
13
|
throw new Error(`Unsupported decorator location: ${r}`);
|
|
15
14
|
};
|
|
16
15
|
export {
|
|
17
|
-
|
|
16
|
+
o as forceType
|
|
18
17
|
};
|
package/core/dom/breakpoint.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { isServer as
|
|
2
|
-
const
|
|
3
|
-
function
|
|
4
|
-
if (
|
|
1
|
+
import { isServer as d } from "lit";
|
|
2
|
+
const s = ["zero", "micro", "small", "medium", "large", "wide", "ultra"];
|
|
3
|
+
function u(n, i, a) {
|
|
4
|
+
if (d)
|
|
5
5
|
return null;
|
|
6
|
-
const
|
|
7
|
-
return window.matchMedia(`${
|
|
6
|
+
const o = getComputedStyle(document.documentElement), t = n ? o.getPropertyValue(`--sbb-breakpoint-${n}-min`) : "", e = i ? `${parseFloat(o.getPropertyValue(`--sbb-breakpoint-${i}-${a?.includeMaxBreakpoint ? "max" : "min"}`)) - (a?.includeMaxBreakpoint ? 0 : 0.0625)}rem` : "", r = t && `(min-width: ${t})`, m = e && `(max-width: ${e})`, c = t && e && " and ";
|
|
7
|
+
return window.matchMedia(`${r}${c}${m}`).matches;
|
|
8
8
|
}
|
|
9
9
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
s as breakpoints,
|
|
11
|
+
u as isBreakpoint
|
|
12
12
|
};
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import { findReferencedElement as
|
|
2
|
-
function
|
|
3
|
-
|
|
4
|
-
if (!r) {
|
|
5
|
-
const o = (i = f.closest) == null ? void 0 : i.call(f, "sbb-form-field");
|
|
6
|
-
return o == null ? void 0 : o.querySelector(n);
|
|
7
|
-
}
|
|
8
|
-
return u(r);
|
|
1
|
+
import { findReferencedElement as r } from "./find-referenced-element.js";
|
|
2
|
+
function i(n, e, t = "input") {
|
|
3
|
+
return e ? r(e) : n.closest?.("sbb-form-field")?.querySelector(t);
|
|
9
4
|
}
|
|
10
5
|
export {
|
|
11
|
-
|
|
6
|
+
i as findInput
|
|
12
7
|
};
|
|
@@ -4,8 +4,8 @@ const n = {
|
|
|
4
4
|
composed: !0
|
|
5
5
|
};
|
|
6
6
|
class o {
|
|
7
|
-
constructor(
|
|
8
|
-
this._element =
|
|
7
|
+
constructor(t, e, s = n) {
|
|
8
|
+
this._element = t, this._eventName = e, this._options = s;
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* Dispatches an event.
|
|
@@ -13,9 +13,8 @@ class o {
|
|
|
13
13
|
* @returns true when the event was successfully emitted or false,
|
|
14
14
|
* if preventDefault() was called. Always returns true in SSR.
|
|
15
15
|
*/
|
|
16
|
-
emit(
|
|
17
|
-
|
|
18
|
-
return ((e = (t = this._element).dispatchEvent) == null ? void 0 : e.call(t, new CustomEvent(this._eventName, { ...this._options, detail: s }))) ?? !0;
|
|
16
|
+
emit(t) {
|
|
17
|
+
return this._element.dispatchEvent?.(new CustomEvent(this._eventName, { ...this._options, detail: t })) ?? !0;
|
|
19
18
|
}
|
|
20
19
|
}
|
|
21
20
|
export {
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { __esDecorate as
|
|
2
|
-
import { defaultConverter as
|
|
3
|
-
import { property as
|
|
4
|
-
import { SbbLanguageController as
|
|
5
|
-
import { hostAttributes as
|
|
6
|
-
import { preventScrollOnSpacebarPress as
|
|
7
|
-
import { i18nCheckboxRequired as
|
|
8
|
-
import { SbbDisabledMixin as
|
|
9
|
-
import { SbbFormAssociatedMixin as
|
|
10
|
-
import { SbbRequiredMixin as
|
|
11
|
-
const
|
|
12
|
-
var
|
|
13
|
-
let
|
|
1
|
+
import { __esDecorate as h, __runInitializers as d } from "tslib";
|
|
2
|
+
import { defaultConverter as u } from "lit";
|
|
3
|
+
import { property as k } from "lit/decorators.js";
|
|
4
|
+
import { SbbLanguageController as p } from "../controllers.js";
|
|
5
|
+
import { hostAttributes as f } from "../decorators.js";
|
|
6
|
+
import { preventScrollOnSpacebarPress as _ } from "../eventing.js";
|
|
7
|
+
import { i18nCheckboxRequired as v } from "../i18n.js";
|
|
8
|
+
import { SbbDisabledMixin as y } from "./disabled-mixin.js";
|
|
9
|
+
import { SbbFormAssociatedMixin as g } from "./form-associated-mixin.js";
|
|
10
|
+
import { SbbRequiredMixin as S } from "./required-mixin.js";
|
|
11
|
+
const D = (b) => (() => {
|
|
12
|
+
var r;
|
|
13
|
+
let m = [f({
|
|
14
14
|
tabindex: "0"
|
|
15
|
-
})],
|
|
16
|
-
return
|
|
15
|
+
})], s, o = [], i, l = y(S(g(b))), c = [], n;
|
|
16
|
+
return r = class extends l {
|
|
17
17
|
/** Whether the checkbox is checked. */
|
|
18
18
|
set checked(e) {
|
|
19
19
|
const t = typeof e == "object" ? e.attribute : !1;
|
|
@@ -30,16 +30,14 @@ const R = (p) => (() => {
|
|
|
30
30
|
return "checkbox";
|
|
31
31
|
}
|
|
32
32
|
constructor() {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
s.key === " " && this._handleUserInteraction();
|
|
33
|
+
super(), this._attributeMutationBlocked = (d(this, c), !1), this._languageController = new p(this), this._checked = !1, this._handleKeyboardInteraction = (e) => {
|
|
34
|
+
e.key === " " && this._handleUserInteraction();
|
|
36
35
|
}, this._handleUserInteraction = () => {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}, this.internals.role = "checkbox", (e = this.addEventListener) == null || e.call(this, "click", this._handleUserInteraction), (t = this.addEventListener) == null || t.call(this, "keydown", g), (i = this.addEventListener) == null || i.call(this, "keyup", this._handleKeyboardInteraction);
|
|
36
|
+
this.disabled || (this.withUserInteraction?.(), this.checked = !this.checked, this._attributeMutationBlocked = !0, this.dispatchEvent(new InputEvent("input", { composed: !0, bubbles: !0 })), this.dispatchEvent(new Event("change", { bubbles: !0 })));
|
|
37
|
+
}, this.internals.role = "checkbox", this.addEventListener?.("click", this._handleUserInteraction), this.addEventListener?.("keydown", _), this.addEventListener?.("keyup", this._handleKeyboardInteraction);
|
|
40
38
|
}
|
|
41
|
-
attributeChangedCallback(e, t,
|
|
42
|
-
(e !== "checked" || !this._attributeMutationBlocked) && super.attributeChangedCallback(e, t,
|
|
39
|
+
attributeChangedCallback(e, t, a) {
|
|
40
|
+
(e !== "checked" || !this._attributeMutationBlocked) && super.attributeChangedCallback(e, t, a);
|
|
43
41
|
}
|
|
44
42
|
/**
|
|
45
43
|
* Is called whenever the form is being reset.
|
|
@@ -68,25 +66,22 @@ const R = (p) => (() => {
|
|
|
68
66
|
return super.shouldValidate(e) || e === "checked" || e === "required";
|
|
69
67
|
}
|
|
70
68
|
validate() {
|
|
71
|
-
super.validate(), this.required && !this.checked ? this.setValidityFlag("valueMissing",
|
|
69
|
+
super.validate(), this.required && !this.checked ? this.setValidityFlag("valueMissing", v[this._languageController.current]) : this.removeValidityFlag("valueMissing");
|
|
72
70
|
}
|
|
73
|
-
},
|
|
74
|
-
const e = typeof Symbol == "function" && Symbol.metadata ? Object.create(
|
|
75
|
-
|
|
71
|
+
}, i = r, (() => {
|
|
72
|
+
const e = typeof Symbol == "function" && Symbol.metadata ? Object.create(l[Symbol.metadata] ?? null) : void 0;
|
|
73
|
+
n = [k({
|
|
76
74
|
type: Boolean,
|
|
77
75
|
converter: {
|
|
78
|
-
...
|
|
76
|
+
...u,
|
|
79
77
|
// We need to pass information to the setter so that we know it was called by attribute change.
|
|
80
|
-
fromAttribute: (t,
|
|
81
|
-
var d, u;
|
|
82
|
-
return { value: (u = (d = k).fromAttribute) == null ? void 0 : u.call(d, t, i), attribute: !0 };
|
|
83
|
-
}
|
|
78
|
+
fromAttribute: (t, a) => ({ value: u.fromAttribute?.(t, a), attribute: !0 })
|
|
84
79
|
}
|
|
85
|
-
})],
|
|
86
|
-
t.checked =
|
|
87
|
-
} }, metadata: e }, null,
|
|
88
|
-
})(),
|
|
80
|
+
})], h(r, null, n, { kind: "setter", name: "checked", static: !1, private: !1, access: { has: (t) => "checked" in t, set: (t, a) => {
|
|
81
|
+
t.checked = a;
|
|
82
|
+
} }, metadata: e }, null, c), h(null, s = { value: i }, m, { kind: "class", name: i.name, metadata: e }, null, o), i = s.value, e && Object.defineProperty(i, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: e }), d(i, o);
|
|
83
|
+
})(), i;
|
|
89
84
|
})();
|
|
90
85
|
export {
|
|
91
|
-
|
|
86
|
+
D as SbbFormAssociatedCheckboxMixin
|
|
92
87
|
};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { __esDecorate as
|
|
2
|
-
import { isServer as
|
|
3
|
-
import { property as
|
|
4
|
-
import { sbbInputModalityDetector as
|
|
5
|
-
import { SbbLanguageController as
|
|
6
|
-
import { isWebkit as
|
|
7
|
-
import { i18nInputRequired as
|
|
8
|
-
import { SbbFormAssociatedMixin as
|
|
9
|
-
import { SbbRequiredMixin as
|
|
10
|
-
const
|
|
11
|
-
if (
|
|
1
|
+
import { __esDecorate as r, __runInitializers as f } from "tslib";
|
|
2
|
+
import { isServer as d, html as b } from "lit";
|
|
3
|
+
import { property as l, eventOptions as g } from "lit/decorators.js";
|
|
4
|
+
import { sbbInputModalityDetector as m } from "../a11y.js";
|
|
5
|
+
import { SbbLanguageController as y } from "../controllers.js";
|
|
6
|
+
import { isWebkit as _ } from "../dom.js";
|
|
7
|
+
import { i18nInputRequired as v } from "../i18n.js";
|
|
8
|
+
import { SbbFormAssociatedMixin as C } from "./form-associated-mixin.js";
|
|
9
|
+
import { SbbRequiredMixin as E } from "./required-mixin.js";
|
|
10
|
+
const k = () => {
|
|
11
|
+
if (d)
|
|
12
12
|
return !1;
|
|
13
|
-
const
|
|
14
|
-
return
|
|
15
|
-
},
|
|
16
|
-
var
|
|
17
|
-
let
|
|
18
|
-
return
|
|
13
|
+
const n = document.createElement("div");
|
|
14
|
+
return n.setAttribute("contenteditable", "PLAINTEXT-ONLY"), n.contentEditable === "plaintext-only";
|
|
15
|
+
}, x = k(), N = (n) => (() => {
|
|
16
|
+
var s;
|
|
17
|
+
let o = E(C(n)), a = [], u, h, c, p;
|
|
18
|
+
return s = class extends o {
|
|
19
19
|
/**
|
|
20
20
|
* Form type of element.
|
|
21
21
|
* @default 'text'
|
|
@@ -61,55 +61,49 @@ const R = () => {
|
|
|
61
61
|
return this.getAttribute("placeholder") ?? "";
|
|
62
62
|
}
|
|
63
63
|
constructor() {
|
|
64
|
-
|
|
65
|
-
super(), this._interacted = (k(this, l), !1), this._shouldEmitChange = !1, this._shouldTriggerSubmit = !1, this.language = new w(this), this.internals.role = "textbox", (e = this.addEventListener) == null || e.call(this, "input", () => {
|
|
64
|
+
super(), this._interacted = (f(this, a), !1), this._shouldEmitChange = !1, this._shouldTriggerSubmit = !1, this.language = new y(this), this.internals.role = "textbox", this.addEventListener?.("input", () => {
|
|
66
65
|
super.value = this._cleanText(this.textContent ?? ""), this._interacted = !0, this._shouldEmitChange = !0;
|
|
67
|
-
}, { capture: !0 }),
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
if (i.preventDefault(), i.stopImmediatePropagation(), !this.dispatchEvent(new KeyboardEvent("keydown", i)))
|
|
66
|
+
}, { capture: !0 }), this.addEventListener?.("change", () => this._shouldEmitChange = !1, { capture: !0 }), this.addEventListener?.("keydown", (e) => {
|
|
67
|
+
if ((e.key === "Enter" || e.key === `
|
|
68
|
+
`) && e.isTrusted)
|
|
69
|
+
e.preventDefault(), e.stopImmediatePropagation(), this._shouldTriggerSubmit = this.dispatchEvent(new KeyboardEvent("keydown", e));
|
|
70
|
+
else if (_ && this.value && (e.key === "Backspace" || e.key === "Delete") && e.isTrusted) {
|
|
71
|
+
if (e.preventDefault(), e.stopImmediatePropagation(), !this.dispatchEvent(new KeyboardEvent("keydown", e)))
|
|
74
72
|
return;
|
|
75
|
-
const
|
|
76
|
-
if (!
|
|
73
|
+
const t = window.getSelection()?.getRangeAt(0);
|
|
74
|
+
if (!t)
|
|
77
75
|
return;
|
|
78
|
-
|
|
76
|
+
t.startOffset !== t.endOffset ? (t.deleteContents(), this._dispatchInputEvent()) : e.key === "Backspace" && t.startOffset > 0 ? (t.setStart(t.startContainer, t.startOffset - 1), t.deleteContents(), this._dispatchInputEvent()) : e.key === "Delete" && t.endOffset < this.value.length && (t.setEnd(t.endContainer, t.endOffset + 1), t.deleteContents(), this._dispatchInputEvent());
|
|
79
77
|
}
|
|
80
|
-
}, { capture: !0 }),
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
i.
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}),
|
|
90
|
-
|
|
91
|
-
S.mostRecentModality === "keyboard" && ((i = window.getSelection()) == null || i.selectAllChildren(this));
|
|
92
|
-
}), (v = this.addEventListener) == null || v.call(this, "blur", () => {
|
|
93
|
-
var i;
|
|
94
|
-
(i = window.getSelection()) == null || i.removeAllRanges(), this._emitChangeIfNecessary(), this.scrollLeft = 0;
|
|
78
|
+
}, { capture: !0 }), this.addEventListener?.("keyup", (e) => {
|
|
79
|
+
(e.key === "Enter" || e.key === `
|
|
80
|
+
`) && (this._emitChangeIfNecessary(), this._shouldTriggerSubmit && (this._shouldTriggerSubmit = !1, this.form?.requestSubmit()));
|
|
81
|
+
}, { capture: !0 }), this.addEventListener?.("paste", (e) => {
|
|
82
|
+
e.preventDefault();
|
|
83
|
+
const t = this._cleanText(e.clipboardData?.getData("text/plain") ?? ""), i = window.getSelection()?.getRangeAt(0);
|
|
84
|
+
!i || !t || (i.deleteContents(), i.insertNode(document.createTextNode(t)), i.setStart(i.endContainer, i.endOffset), this._dispatchInputEvent());
|
|
85
|
+
}), this.addEventListener?.("focus", () => {
|
|
86
|
+
m.mostRecentModality === "keyboard" && window.getSelection()?.selectAllChildren(this);
|
|
87
|
+
}), this.addEventListener?.("blur", () => {
|
|
88
|
+
window.getSelection()?.removeAllRanges(), this._emitChangeIfNecessary(), this.scrollLeft = 0;
|
|
95
89
|
}, { capture: !0 });
|
|
96
90
|
}
|
|
97
91
|
connectedCallback() {
|
|
98
92
|
super.connectedCallback(), this.internals.ariaMultiLine = "false", this._updateContenteditable(), this.innerHTML = this.value;
|
|
99
93
|
}
|
|
100
94
|
focus(e) {
|
|
101
|
-
if (super.focus(e), !
|
|
95
|
+
if (super.focus(e), !d && !this.disabled && !this.readOnly && this.value) {
|
|
102
96
|
const t = window.getSelection();
|
|
103
97
|
if (!t)
|
|
104
98
|
return;
|
|
105
|
-
let
|
|
106
|
-
if (
|
|
99
|
+
let i = t.rangeCount > 0 ? t.getRangeAt(0) : null;
|
|
100
|
+
if (i && i.startOffset !== 0)
|
|
107
101
|
return;
|
|
108
|
-
|
|
102
|
+
i = document.createRange(), i.setStart(this.firstChild, this.textContent.length), i.collapse(!0), t.removeAllRanges(), t.addRange(i);
|
|
109
103
|
}
|
|
110
104
|
}
|
|
111
|
-
attributeChangedCallback(e, t,
|
|
112
|
-
(e !== "value" || !this._interacted) && super.attributeChangedCallback(e, t,
|
|
105
|
+
attributeChangedCallback(e, t, i) {
|
|
106
|
+
(e !== "value" || !this._interacted) && super.attributeChangedCallback(e, t, i);
|
|
113
107
|
}
|
|
114
108
|
/**
|
|
115
109
|
* Is called whenever the form is being reset.
|
|
@@ -141,7 +135,7 @@ const R = () => {
|
|
|
141
135
|
return super.shouldValidate(e) || e === "value" || e === "required";
|
|
142
136
|
}
|
|
143
137
|
validate() {
|
|
144
|
-
super.validate(), this.required && !this.value ? this.setValidityFlag("valueMissing",
|
|
138
|
+
super.validate(), this.required && !this.value ? this.setValidityFlag("valueMissing", v[this.language.current]) : this.removeValidityFlag("valueMissing");
|
|
145
139
|
}
|
|
146
140
|
_cleanText(e) {
|
|
147
141
|
return e === null ? "" : `${e}`.replace(/[\n\r]+/g, "");
|
|
@@ -155,8 +149,8 @@ const R = () => {
|
|
|
155
149
|
e.remove();
|
|
156
150
|
}
|
|
157
151
|
_updateContenteditable() {
|
|
158
|
-
if (!
|
|
159
|
-
const e = this.disabled || this.readOnly ? "false" :
|
|
152
|
+
if (!d && this.isConnected) {
|
|
153
|
+
const e = this.disabled || this.readOnly ? "false" : x ? "plaintext-only" : "true";
|
|
160
154
|
this.setAttribute("contenteditable", e), this.readOnly ? this.setAttribute("tabindex", "0") : this.removeAttribute("tabindex");
|
|
161
155
|
}
|
|
162
156
|
}
|
|
@@ -164,19 +158,19 @@ const R = () => {
|
|
|
164
158
|
this._shouldEmitChange && (this._shouldEmitChange = !1, this.dispatchEvent(new Event("change", { bubbles: !0 })));
|
|
165
159
|
}
|
|
166
160
|
render() {
|
|
167
|
-
return
|
|
161
|
+
return b`<slot @slotchange=${this._cleanChildren}></slot>`;
|
|
168
162
|
}
|
|
169
163
|
}, (() => {
|
|
170
|
-
const e = typeof Symbol == "function" && Symbol.metadata ? Object.create(
|
|
171
|
-
|
|
172
|
-
t.readOnly =
|
|
173
|
-
} }, metadata: e }, null,
|
|
174
|
-
t.disabled =
|
|
175
|
-
} }, metadata: e }, null,
|
|
176
|
-
t.placeholder =
|
|
177
|
-
} }, metadata: e }, null,
|
|
178
|
-
})(),
|
|
164
|
+
const e = typeof Symbol == "function" && Symbol.metadata ? Object.create(o[Symbol.metadata] ?? null) : void 0;
|
|
165
|
+
u = [l({ type: Boolean })], h = [l({ type: Boolean })], c = [l({ attribute: !1 })], p = [g({ passive: !0 })], r(s, null, u, { kind: "setter", name: "readOnly", static: !1, private: !1, access: { has: (t) => "readOnly" in t, set: (t, i) => {
|
|
166
|
+
t.readOnly = i;
|
|
167
|
+
} }, metadata: e }, null, a), r(s, null, h, { kind: "setter", name: "disabled", static: !1, private: !1, access: { has: (t) => "disabled" in t, set: (t, i) => {
|
|
168
|
+
t.disabled = i;
|
|
169
|
+
} }, metadata: e }, null, a), r(s, null, c, { kind: "setter", name: "placeholder", static: !1, private: !1, access: { has: (t) => "placeholder" in t, set: (t, i) => {
|
|
170
|
+
t.placeholder = i;
|
|
171
|
+
} }, metadata: e }, null, a), r(s, null, p, { kind: "method", name: "_cleanChildren", static: !1, private: !1, access: { has: (t) => "_cleanChildren" in t, get: (t) => t._cleanChildren }, metadata: e }, null, a), e && Object.defineProperty(s, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: e });
|
|
172
|
+
})(), s;
|
|
179
173
|
})();
|
|
180
174
|
export {
|
|
181
|
-
|
|
175
|
+
N as SbbFormAssociatedInputMixin
|
|
182
176
|
};
|