@sbb-esta/lyne-elements 3.10.0 → 3.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/action-group/action-group.component.js +1 -1
- package/alert/alert/alert.component.js +1 -1
- package/autocomplete/autocomplete-base-element.d.ts +5 -0
- package/autocomplete/autocomplete-base-element.d.ts.map +1 -1
- package/autocomplete/autocomplete-base-element.js +72 -59
- package/autocomplete-grid/autocomplete-grid-button/autocomplete-grid-button.component.js +1 -1
- package/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.component.js +1 -1
- package/autocomplete-grid/autocomplete-grid-row/autocomplete-grid-row.component.js +1 -1
- package/badge.css +1 -0
- package/breadcrumb/breadcrumb/breadcrumb.component.js +4 -4
- package/breadcrumb/breadcrumb-group/breadcrumb-group.component.js +1 -1
- package/button/common.js +1 -1
- package/button/mini-button/mini-button.component.js +1 -1
- package/button.js +1 -1
- package/calendar/calendar.component.d.ts +2 -1
- package/calendar/calendar.component.d.ts.map +1 -1
- package/calendar/calendar.component.js +1 -1
- package/card/card/card.component.js +1 -1
- package/card/card-badge/card-badge.component.js +1 -1
- package/carousel/carousel-list/carousel-list.component.d.ts +8 -3
- package/carousel/carousel-list/carousel-list.component.d.ts.map +1 -1
- package/carousel/carousel-list/carousel-list.component.js +62 -40
- package/checkbox/checkbox-group/checkbox-group.component.js +1 -1
- package/chip/chip/chip.component.js +1 -1
- package/chip/chip-group/chip-group.component.js +1 -1
- package/chip-label/chip-label.component.js +1 -1
- package/container/container/container.component.js +11 -11
- package/container/sticky-bar/sticky-bar.component.js +9 -9
- package/core/controllers/escapable-overlay-controller.d.ts +3 -0
- package/core/controllers/escapable-overlay-controller.d.ts.map +1 -1
- package/core/controllers/overlay-position-controller.d.ts +60 -0
- package/core/controllers/overlay-position-controller.d.ts.map +1 -0
- package/core/controllers/overlay-position-controller.js +224 -0
- package/core/controllers.d.ts +1 -0
- package/core/controllers.d.ts.map +1 -1
- package/core/controllers.js +12 -10
- package/core/mixins.js +1 -1
- package/core/overlay/overlay-option-panel.d.ts +2 -1
- package/core/overlay/overlay-option-panel.d.ts.map +1 -1
- package/core/overlay/overlay-option-panel.js +8 -5
- package/core/overlay/position.d.ts +2 -0
- package/core/overlay/position.d.ts.map +1 -1
- package/core/overlay/position.js +19 -17
- package/core/styles/core.scss +27 -2
- package/core/styles/layout.scss +4 -0
- package/core/styles/mixins/badge.scss +3 -0
- package/core/styles/mixins/layout.scss +5 -4
- package/core/styles/mixins/link.scss +0 -11
- package/core.css +21 -2
- package/custom-elements.json +2024 -417
- package/date-input/date-input.component.js +1 -1
- 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 +1 -1
- package/development/autocomplete/autocomplete-base-element.d.ts +5 -0
- package/development/autocomplete/autocomplete-base-element.d.ts.map +1 -1
- package/development/autocomplete/autocomplete-base-element.js +25 -5
- package/development/breadcrumb/breadcrumb/breadcrumb.component.js +1 -2
- package/development/calendar/calendar.component.d.ts +2 -1
- package/development/calendar/calendar.component.d.ts.map +1 -1
- package/development/calendar/calendar.component.js +1 -1
- package/development/carousel/carousel-list/carousel-list.component.d.ts +8 -3
- package/development/carousel/carousel-list/carousel-list.component.d.ts.map +1 -1
- package/development/carousel/carousel-list/carousel-list.component.js +51 -19
- package/development/container/container/container.component.js +3 -3
- package/development/container/sticky-bar/sticky-bar.component.js +5 -5
- package/development/core/controllers/escapable-overlay-controller.d.ts +3 -0
- package/development/core/controllers/escapable-overlay-controller.d.ts.map +1 -1
- package/development/core/controllers/escapable-overlay-controller.js +1 -1
- package/development/core/controllers/overlay-position-controller.d.ts +60 -0
- package/development/core/controllers/overlay-position-controller.d.ts.map +1 -0
- package/development/core/controllers/overlay-position-controller.js +306 -0
- package/development/core/controllers.d.ts +1 -0
- package/development/core/controllers.d.ts.map +1 -1
- package/development/core/controllers.js +3 -1
- package/development/core/overlay/overlay-option-panel.d.ts +2 -1
- package/development/core/overlay/overlay-option-panel.d.ts.map +1 -1
- package/development/core/overlay/overlay-option-panel.js +6 -3
- package/development/core/overlay/position.d.ts +2 -0
- package/development/core/overlay/position.d.ts.map +1 -1
- package/development/core/overlay/position.js +3 -2
- package/development/footer/footer.component.js +3 -3
- package/development/header/header/header.component.js +3 -3
- package/development/lead-container/lead-container.component.js +8 -7
- package/development/link/common/block-link-common.js +2 -12
- package/development/link/common/inline-link-common.js +2 -10
- package/development/link/common/link-common.js +1 -1
- package/development/link/common.js +1 -1
- package/development/{link-common-DPLJx5Uo.js → link-common-BDFF9Oiz.js} +1 -3
- package/development/link-list/link-list-anchor/link-list-anchor.component.js +1 -2
- package/development/link.js +1 -1
- package/development/mini-calendar/mini-calendar/mini-calendar.component.d.ts +35 -0
- package/development/mini-calendar/mini-calendar/mini-calendar.component.d.ts.map +1 -0
- package/development/mini-calendar/mini-calendar/mini-calendar.component.js +199 -0
- package/development/mini-calendar/mini-calendar-day/mini-calendar-day.component.d.ts +23 -0
- package/development/mini-calendar/mini-calendar-day/mini-calendar-day.component.d.ts.map +1 -0
- package/development/mini-calendar/mini-calendar-day/mini-calendar-day.component.js +181 -0
- package/development/mini-calendar/mini-calendar-day.d.ts +5 -0
- package/development/mini-calendar/mini-calendar-day.d.ts.map +1 -0
- package/development/mini-calendar/mini-calendar-day.js +5 -0
- package/development/mini-calendar/mini-calendar-month/mini-calendar-month.component.d.ts +25 -0
- package/development/mini-calendar/mini-calendar-month/mini-calendar-month.component.d.ts.map +1 -0
- package/development/mini-calendar/mini-calendar-month/mini-calendar-month.component.js +123 -0
- package/development/mini-calendar/mini-calendar-month.d.ts +5 -0
- package/development/mini-calendar/mini-calendar-month.d.ts.map +1 -0
- package/development/mini-calendar/mini-calendar-month.js +5 -0
- package/development/mini-calendar/mini-calendar.d.ts +5 -0
- package/development/mini-calendar/mini-calendar.d.ts.map +1 -0
- package/development/mini-calendar/mini-calendar.js +5 -0
- package/development/mini-calendar.d.ts +7 -0
- package/development/mini-calendar.d.ts.map +1 -0
- package/development/mini-calendar.js +9 -0
- package/development/paginator/common/paginator-common.d.ts +2 -1
- package/development/paginator/common/paginator-common.d.ts.map +1 -1
- package/development/paginator/common/paginator-common.js +87 -49
- package/development/paginator/compact-paginator/compact-paginator.component.d.ts.map +1 -1
- package/development/paginator/compact-paginator/compact-paginator.component.js +3 -2
- package/development/paginator/paginator/paginator.component.d.ts +6 -0
- package/development/paginator/paginator/paginator.component.d.ts.map +1 -1
- package/development/paginator/paginator/paginator.component.js +19 -4
- package/development/sidebar/icon-sidebar-button/icon-sidebar-button.component.d.ts +4 -1
- package/development/sidebar/icon-sidebar-button/icon-sidebar-button.component.d.ts.map +1 -1
- package/development/sidebar/icon-sidebar-button/icon-sidebar-button.component.js +5 -1
- package/development/sidebar/icon-sidebar-link/icon-sidebar-link.component.d.ts +4 -1
- package/development/sidebar/icon-sidebar-link/icon-sidebar-link.component.d.ts.map +1 -1
- package/development/sidebar/icon-sidebar-link/icon-sidebar-link.component.js +5 -1
- package/development/tabs/tab/tab.component.d.ts +9 -0
- package/development/tabs/tab/tab.component.d.ts.map +1 -1
- package/development/tabs/tab/tab.component.js +48 -7
- package/development/tabs/tab-group/tab-group.component.d.ts +7 -3
- package/development/tabs/tab-group/tab-group.component.d.ts.map +1 -1
- package/development/tabs/tab-group/tab-group.component.js +19 -39
- package/development/tabs/tab-label/tab-label.component.d.ts.map +1 -1
- package/development/tabs/tab-label/tab-label.component.js +4 -3
- package/development/tag/tag/tag.component.js +2 -1
- package/development/tooltip/tooltip.component.d.ts +11 -4
- package/development/tooltip/tooltip.component.d.ts.map +1 -1
- package/development/tooltip/tooltip.component.js +57 -78
- package/dialog/dialog/dialog.component.js +1 -1
- package/dialog/dialog-actions/dialog-actions.component.js +1 -1
- package/expansion-panel/expansion-panel/expansion-panel.component.js +1 -1
- package/expansion-panel/expansion-panel-content/expansion-panel-content.component.js +1 -1
- package/expansion-panel/expansion-panel-header/expansion-panel-header.component.js +1 -1
- package/file-selector/common.js +1 -1
- package/file-selector-common-BEWjyy75.js +5 -0
- package/file-selector.js +1 -1
- package/flip-card/flip-card/flip-card.component.js +1 -1
- package/flip-card/flip-card-summary/flip-card-summary.component.js +1 -1
- package/footer/footer.component.js +8 -8
- package/form-error/form-error.component.js +1 -1
- package/form-field/form-field/form-field.component.js +1 -1
- package/form-field/form-field-clear/form-field-clear.component.js +1 -1
- package/header/common/header-action-common.js +1 -1
- package/header/header/header.component.js +32 -32
- package/icon-sidebar-button-common-XcKoF2SP.js +7 -0
- package/index.d.ts +6 -0
- package/index.js +6 -0
- package/layout.css +9 -3
- package/lead-container/lead-container.component.js +8 -8
- package/link/common/block-link-common.js +25 -25
- package/link/common/inline-link-common.js +7 -7
- package/link/common/link-common.js +1 -1
- package/link/common.js +1 -1
- package/link-common-nA3q92jp.js +46 -0
- package/link-list/link-list/link-list.component.js +1 -1
- package/link-list/link-list-anchor/link-list-anchor.component.js +5 -5
- package/link.js +1 -1
- package/loading-indicator-circle/loading-indicator-circle.component.js +1 -1
- package/logo/logo.component.js +1 -1
- package/map-container/map-container.component.js +1 -1
- package/menu/common/menu-action-common.js +1 -1
- package/menu/menu/menu.component.js +1 -1
- package/mini-calendar/mini-calendar/mini-calendar.component.d.ts +35 -0
- package/mini-calendar/mini-calendar/mini-calendar.component.d.ts.map +1 -0
- package/mini-calendar/mini-calendar/mini-calendar.component.js +129 -0
- package/mini-calendar/mini-calendar-day/mini-calendar-day.component.d.ts +23 -0
- package/mini-calendar/mini-calendar-day/mini-calendar-day.component.d.ts.map +1 -0
- package/mini-calendar/mini-calendar-day/mini-calendar-day.component.js +66 -0
- package/mini-calendar/mini-calendar-day.d.ts +5 -0
- package/mini-calendar/mini-calendar-day.d.ts.map +1 -0
- package/mini-calendar/mini-calendar-day.js +4 -0
- package/mini-calendar/mini-calendar-month/mini-calendar-month.component.d.ts +25 -0
- package/mini-calendar/mini-calendar-month/mini-calendar-month.component.d.ts.map +1 -0
- package/mini-calendar/mini-calendar-month/mini-calendar-month.component.js +59 -0
- package/mini-calendar/mini-calendar-month.d.ts +5 -0
- package/mini-calendar/mini-calendar-month.d.ts.map +1 -0
- package/mini-calendar/mini-calendar-month.js +4 -0
- package/mini-calendar/mini-calendar.d.ts +5 -0
- package/mini-calendar/mini-calendar.d.ts.map +1 -0
- package/mini-calendar/mini-calendar.js +4 -0
- package/mini-calendar.d.ts +7 -0
- package/mini-calendar.d.ts.map +1 -0
- package/mini-calendar.js +8 -0
- package/navigation/common/navigation-action-common.js +1 -1
- package/navigation/navigation/navigation.component.js +1 -1
- package/navigation/navigation-marker/navigation-marker.component.js +1 -1
- package/navigation/navigation-section/navigation-section.component.js +1 -1
- package/notification/notification.component.js +1 -1
- package/off-brand-theme.css +31 -5
- package/option/option/option.component.js +1 -1
- package/overlay/overlay.component.js +1 -1
- package/package.json +21 -1
- package/paginator/common/paginator-common.d.ts +2 -1
- package/paginator/common/paginator-common.d.ts.map +1 -1
- package/paginator/common/paginator-common.js +102 -81
- package/paginator/compact-paginator/compact-paginator.component.d.ts.map +1 -1
- package/paginator/compact-paginator/compact-paginator.component.js +2 -1
- package/paginator/paginator/paginator.component.d.ts +6 -0
- package/paginator/paginator/paginator.component.d.ts.map +1 -1
- package/paginator/paginator/paginator.component.js +57 -45
- package/popover/popover/popover.component.js +1 -1
- package/popover/popover-trigger/popover-trigger.component.js +1 -1
- package/radio-button/common.js +1 -1
- package/radio-button/radio-button-group/radio-button-group.component.js +1 -1
- package/radio-button-common-Bw2t3Sxz.js +5 -0
- package/radio-button.js +1 -1
- package/safety-theme.css +31 -5
- package/select/select.component.js +1 -1
- package/selection-expansion-panel/selection-expansion-panel.component.js +1 -1
- package/sidebar/common.js +1 -1
- package/sidebar/icon-sidebar-button/icon-sidebar-button.component.d.ts +4 -1
- package/sidebar/icon-sidebar-button/icon-sidebar-button.component.d.ts.map +1 -1
- package/sidebar/icon-sidebar-button/icon-sidebar-button.component.js +9 -6
- package/sidebar/icon-sidebar-link/icon-sidebar-link.component.d.ts +4 -1
- package/sidebar/icon-sidebar-link/icon-sidebar-link.component.d.ts.map +1 -1
- package/sidebar/icon-sidebar-link/icon-sidebar-link.component.js +13 -10
- package/sidebar/sidebar-container/sidebar-container.component.js +1 -1
- package/sidebar.js +1 -1
- package/signet/signet.component.js +1 -1
- package/slider/slider.component.js +1 -1
- package/standard-theme.css +31 -5
- package/stepper/step-label/step-label.component.js +1 -1
- package/stepper/stepper/stepper.component.js +1 -1
- package/tabs/tab/tab.component.d.ts +9 -0
- package/tabs/tab/tab.component.d.ts.map +1 -1
- package/tabs/tab/tab.component.js +37 -18
- package/tabs/tab-group/tab-group.component.d.ts +7 -3
- package/tabs/tab-group/tab-group.component.d.ts.map +1 -1
- package/tabs/tab-group/tab-group.component.js +51 -52
- package/tabs/tab-label/tab-label.component.d.ts.map +1 -1
- package/tabs/tab-label/tab-label.component.js +12 -12
- package/tag/tag/tag.component.js +4 -4
- package/teaser/teaser.component.js +1 -1
- package/teaser-hero/teaser-hero.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-Du28QCY3.js +5 -0
- package/teaser-product.js +1 -1
- package/time-input/time-input.component.js +1 -1
- package/timetable-occupancy/timetable-occupancy.component.js +1 -1
- package/timetable-occupancy-icon/timetable-occupancy-icon.component.js +1 -1
- package/toggle/toggle/toggle.component.js +1 -1
- package/toggle-check/toggle-check.component.js +1 -1
- package/tooltip/tooltip.component.d.ts +11 -4
- package/tooltip/tooltip.component.d.ts.map +1 -1
- package/tooltip/tooltip.component.js +60 -84
- package/train/train-blocked-passage/train-blocked-passage.component.js +1 -1
- package/train/train-formation/train-formation.component.js +1 -1
- package/train/train-wagon/train-wagon.component.js +1 -1
- package/transparent-button-DJIkG5hj.js +9 -0
- package/visual-checkbox/visual-checkbox.component.js +1 -1
- package/file-selector-common-D88J9PEh.js +0 -5
- package/icon-sidebar-button-common-BeRXvifI.js +0 -7
- package/link-common-BBKGg9HN.js +0 -46
- package/radio-button-common-Nm9ULjVb.js +0 -5
- package/teaser-product-common-DIra6aVg.js +0 -5
- package/transparent-button-Bg9fU_iZ.js +0 -9
|
@@ -3,22 +3,22 @@ var w = (a) => {
|
|
|
3
3
|
};
|
|
4
4
|
var x = (a, s, e) => s.has(a) || w("Cannot " + e);
|
|
5
5
|
var k = (a, s, e) => (x(a, s, "read from private field"), e ? e.call(a) : s.get(a)), u = (a, s, e) => s.has(a) ? w("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(a) : s.set(a, e), d = (a, s, e, r) => (x(a, s, "write to private field"), r ? r.call(a, e) : s.set(a, e), e);
|
|
6
|
-
import { __runInitializers as l, __esDecorate as
|
|
6
|
+
import { __runInitializers as l, __esDecorate as h } from "tslib";
|
|
7
7
|
import { IntersectionController as S } from "@lit-labs/observers/intersection-controller.js";
|
|
8
8
|
import { css as A, LitElement as C, html as R } from "lit";
|
|
9
9
|
import { customElement as B, property as z } from "lit/decorators.js";
|
|
10
10
|
import { isLean as I, isZeroAnimationDuration as D } from "../../core/dom.js";
|
|
11
11
|
import { SbbUpdateSchedulerMixin as U } from "../../core/mixins.js";
|
|
12
|
-
const T = A`*,: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-background-color-1) );--_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
|
|
12
|
+
const T = A`*,: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-background-color-1) );--_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-background-color-1)}:host([data-sticking]:not([data-state=unsticky])[color=milk]){--sbb-sticky-bar-sticky-background-color: var(--sbb-background-color-3)}:host([data-sticking]:not([data-state=unsticky])[color=midnight]){--sbb-sticky-bar-sticky-background-color: var(--sbb-background-color-1-negative)}:host([data-sticking]:not([data-state=unsticky])[color=charcoal]){--sbb-sticky-bar-sticky-background-color: var(--sbb-background-color-2-negative)}: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-page-spacing-padding, 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:var(--sbb-spacing-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-color-soft-2),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-color-soft-1)}:host(:not([data-expanded])) .sbb-sticky-bar{padding-inline:var(--sbb-page-spacing-padding, var(--sbb-layout-base-offset-responsive));margin-inline:auto;width:100%}@media(min-width:90rem){:host(:not([data-expanded])) .sbb-sticky-bar{max-width:var(--sbb-spacing-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-page-spacing-padding, 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%)}}`;
|
|
13
13
|
let M = (() => {
|
|
14
14
|
var n, b, o;
|
|
15
|
-
let a = [B("sbb-sticky-bar")], s, e = [], r,
|
|
16
|
-
return o = class extends
|
|
15
|
+
let a = [B("sbb-sticky-bar")], s, e = [], r, y = U(C), v, g = [], m = [], p, _ = [], f = [];
|
|
16
|
+
return o = class extends y {
|
|
17
17
|
constructor() {
|
|
18
18
|
super(...arguments);
|
|
19
19
|
u(this, n);
|
|
20
20
|
u(this, b);
|
|
21
|
-
d(this, n, l(this,
|
|
21
|
+
d(this, n, l(this, g, null)), d(this, b, (l(this, m), l(this, _, I() ? "s" : "m"))), this._intersector = l(this, f), this._observer = new S(this, {
|
|
22
22
|
// Although `this` is observed, we have to postpone observing
|
|
23
23
|
// into firstUpdated() to achieve a correct initial state.
|
|
24
24
|
target: null,
|
|
@@ -102,12 +102,12 @@ let M = (() => {
|
|
|
102
102
|
`;
|
|
103
103
|
}
|
|
104
104
|
}, n = new WeakMap(), b = new WeakMap(), r = o, (() => {
|
|
105
|
-
const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(
|
|
106
|
-
v = [z({ reflect: !0 })],
|
|
105
|
+
const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(y[Symbol.metadata] ?? null) : void 0;
|
|
106
|
+
v = [z({ reflect: !0 })], p = [z({ reflect: !0 })], h(o, null, v, { kind: "accessor", name: "color", static: !1, private: !1, access: { has: (i) => "color" in i, get: (i) => i.color, set: (i, c) => {
|
|
107
107
|
i.color = c;
|
|
108
|
-
} }, metadata: t },
|
|
108
|
+
} }, metadata: t }, g, m), h(o, null, p, { kind: "accessor", name: "size", static: !1, private: !1, access: { has: (i) => "size" in i, get: (i) => i.size, set: (i, c) => {
|
|
109
109
|
i.size = c;
|
|
110
|
-
} }, metadata: t },
|
|
110
|
+
} }, metadata: t }, _, f), h(null, s = { value: r }, a, { kind: "class", name: r.name, metadata: t }, null, e), r = s.value, t && Object.defineProperty(r, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: t });
|
|
111
111
|
})(), o.styles = T, o.events = {
|
|
112
112
|
beforestick: "beforestick",
|
|
113
113
|
stick: "stick",
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
2
|
import { SbbOpenCloseBaseElement } from '../base-elements/open-close-base-element.js';
|
|
3
|
+
/**
|
|
4
|
+
* Handles the stack of overlays and closes the last opened one when pressing Escape.
|
|
5
|
+
*/
|
|
3
6
|
export declare class SbbEscapableOverlayController implements ReactiveController {
|
|
4
7
|
private _host;
|
|
5
8
|
private _overlayStack;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"escapable-overlay-controller.d.ts","sourceRoot":"","sources":["../../../../src/elements/core/controllers/escapable-overlay-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,kBAAkB,EAAE,KAAK,sBAAsB,EAAE,MAAM,KAAK,CAAC;AAErF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AAa3F,qBAAa,6BAA8B,YAAW,kBAAkB;IAEpE,OAAO,CAAC,KAAK;IACb,OAAO,CAAC,aAAa;gBADb,KAAK,EAAE,sBAAsB,GAAG,uBAAuB,EACvD,aAAa,GAAE,uBAAuB,EAAiB;IAK1D,gBAAgB,IAAI,IAAI;IAKxB,OAAO,IAAI,IAAI;IAQf,UAAU,IAAI,IAAI;CAQ1B"}
|
|
1
|
+
{"version":3,"file":"escapable-overlay-controller.d.ts","sourceRoot":"","sources":["../../../../src/elements/core/controllers/escapable-overlay-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,kBAAkB,EAAE,KAAK,sBAAsB,EAAE,MAAM,KAAK,CAAC;AAErF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AAa3F;;GAEG;AACH,qBAAa,6BAA8B,YAAW,kBAAkB;IAEpE,OAAO,CAAC,KAAK;IACb,OAAO,CAAC,aAAa;gBADb,KAAK,EAAE,sBAAsB,GAAG,uBAAuB,EACvD,aAAa,GAAE,uBAAuB,EAAiB;IAK1D,gBAAgB,IAAI,IAAI;IAKxB,OAAO,IAAI,IAAI;IAQf,UAAU,IAAI,IAAI;CAQ1B"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* Controller for managing overlays positioning. Also acts as a polyfill when native
|
|
4
|
+
* CSS Anchor Positioning is not supported (enough).
|
|
5
|
+
* Applies unique anchor names when using native CSS Anchor Positioning
|
|
6
|
+
* or calculates and applies correct positions in polyfill mode.
|
|
7
|
+
*
|
|
8
|
+
* Also, the controller sets the 'data-overlay-position' attribute on the overlay element.
|
|
9
|
+
* This can be used to apply specific styles based on the current position of the overlay.
|
|
10
|
+
*
|
|
11
|
+
* ### Implementation
|
|
12
|
+
* Define and apply the following CSS variables on the overlay element:
|
|
13
|
+
* ```scss
|
|
14
|
+
* --sbb-overlay-position-area: block-end; // Default
|
|
15
|
+
* --sbb-overlay-position-try-fallbacks: block-start, inline-end, inline-start; // Fallbacks
|
|
16
|
+
*
|
|
17
|
+
* position-area: var(--sbb-overlay-position-area);
|
|
18
|
+
* position-try-fallbacks: var(--sbb-overlay-position-try-fallbacks);
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare class SbbOverlayPositionController implements ReactiveController {
|
|
22
|
+
private _usePolyfill;
|
|
23
|
+
private readonly _resizeObserver;
|
|
24
|
+
private readonly _overlay;
|
|
25
|
+
private _abortController?;
|
|
26
|
+
private _anchor?;
|
|
27
|
+
private _overlayStyles?;
|
|
28
|
+
private _frame?;
|
|
29
|
+
private _anchorName;
|
|
30
|
+
private _positions;
|
|
31
|
+
private _lastPosition?;
|
|
32
|
+
/** Get the current position. (e.g. block-end, block-start, etc.) */
|
|
33
|
+
get currentPosition(): string;
|
|
34
|
+
constructor(host: ReactiveControllerHost & HTMLElement, overlay?: HTMLElement, _usePolyfill?: boolean);
|
|
35
|
+
hostConnected(): void;
|
|
36
|
+
hostUpdate(): void;
|
|
37
|
+
/**
|
|
38
|
+
* Connects the overlay to the given trigger element and determines the optimal position.
|
|
39
|
+
* Usually, this is called when the overlay is opened.
|
|
40
|
+
* @param anchor The anchor element.
|
|
41
|
+
*/
|
|
42
|
+
connect(anchor: HTMLElement): void;
|
|
43
|
+
disconnect(): void;
|
|
44
|
+
private _requestCalculatePosition;
|
|
45
|
+
private _calculatePosition;
|
|
46
|
+
/**
|
|
47
|
+
* Calculates the optimal position that fits the overlay.
|
|
48
|
+
* @param positions The list of positions to check.
|
|
49
|
+
* @private
|
|
50
|
+
*/
|
|
51
|
+
private _getOptimalPosition;
|
|
52
|
+
private _applyOverlayPosition;
|
|
53
|
+
/**
|
|
54
|
+
* Only used in polyfill mode.
|
|
55
|
+
* Reads the list of the configured positions from the CSS variables.
|
|
56
|
+
* @private
|
|
57
|
+
*/
|
|
58
|
+
private _readPositionsFromCss;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=overlay-position-controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overlay-position-controller.d.ts","sourceRoot":"","sources":["../../../../src/elements/core/controllers/overlay-position-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,kBAAkB,EAAE,KAAK,sBAAsB,EAAE,MAAM,KAAK,CAAC;AAqDrF;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,4BAA6B,YAAW,kBAAkB;IA0BnE,OAAO,CAAC,YAAY;IAzBtB,OAAO,CAAC,QAAQ,CAAC,eAAe,CAEtB;IACV,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAc;IACvC,OAAO,CAAC,gBAAgB,CAAC,CAAkB;IAC3C,OAAO,CAAC,OAAO,CAAC,CAAc;IAC9B,OAAO,CAAC,cAAc,CAAC,CAAsB;IAC7C,OAAO,CAAC,MAAM,CAAC,CAA2C;IAC1D,OAAO,CAAC,WAAW,CAAsC;IACzD,OAAO,CAAC,UAAU,CAAgB;IAClC,OAAO,CAAC,aAAa,CAAC,CAAS;IAE/B,oEAAoE;IACpE,IAAW,eAAe,IAAI,MAAM,CAOnC;gBAGC,IAAI,EAAE,sBAAsB,GAAG,WAAW,EAC1C,OAAO,CAAC,EAAE,WAAW,EACb,YAAY,UAA8B;IAM7C,aAAa,IAAI,IAAI;IASrB,UAAU,IAAI,IAAI;IAOzB;;;;OAIG;IACI,OAAO,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI;IAmClC,UAAU,IAAI,IAAI;IAOzB,OAAO,CAAC,yBAAyB;IAOjC,OAAO,CAAC,kBAAkB;IAY1B;;;;OAIG;IACH,OAAO,CAAC,mBAAmB;IAiL3B,OAAO,CAAC,qBAAqB;IAM7B;;;;OAIG;IACH,OAAO,CAAC,qBAAqB;CA6B9B"}
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import { isServer as k } from "lit";
|
|
2
|
+
const m = !k && CSS.supports("anchor-name", "--test"), C = [
|
|
3
|
+
"block-start",
|
|
4
|
+
"block-end",
|
|
5
|
+
"inline-start",
|
|
6
|
+
"inline-end",
|
|
7
|
+
"block-start span-inline-start",
|
|
8
|
+
"block-start span-inline-end",
|
|
9
|
+
"block-end span-inline-start",
|
|
10
|
+
"block-end span-inline-end",
|
|
11
|
+
"inline-start span-block-start",
|
|
12
|
+
"inline-start span-block-end",
|
|
13
|
+
"inline-end span-block-start",
|
|
14
|
+
"inline-end span-block-end"
|
|
15
|
+
], S = {
|
|
16
|
+
"block-start": "block-start",
|
|
17
|
+
"block-end": "block-end",
|
|
18
|
+
"inline-start": "inline-end",
|
|
19
|
+
"inline-end": "inline-start",
|
|
20
|
+
"block-start span-inline-start": "block-start span-inline-end",
|
|
21
|
+
"block-start span-inline-end": "block-start span-inline-start",
|
|
22
|
+
"block-end span-inline-start": "block-end span-inline-end",
|
|
23
|
+
"block-end span-inline-end": "block-end span-inline-start",
|
|
24
|
+
"inline-start span-block-start": "inline-end span-block-start",
|
|
25
|
+
"inline-start span-block-end": "inline-end span-block-end",
|
|
26
|
+
"inline-end span-block-start": "inline-start span-block-start",
|
|
27
|
+
"inline-end span-block-end": "inline-start span-block-end"
|
|
28
|
+
};
|
|
29
|
+
let O = 0;
|
|
30
|
+
class W {
|
|
31
|
+
/** Get the current position. (e.g. block-end, block-start, etc.) */
|
|
32
|
+
get currentPosition() {
|
|
33
|
+
return this._usePolyfill ? this._lastPosition ?? this._positions[0] ?? "" : (this._overlayStyles ??= getComputedStyle(this._overlay), this._overlayStyles.getPropertyValue("position-area"));
|
|
34
|
+
}
|
|
35
|
+
constructor(e, t, o = !m) {
|
|
36
|
+
this._usePolyfill = o, this._resizeObserver = k ? null : new ResizeObserver(() => this._requestCalculatePosition()), this._anchorName = `--sbb-overlay-anchor-${++O}`, this._positions = [], e.addController(this), this._overlay = t ?? e;
|
|
37
|
+
}
|
|
38
|
+
hostConnected() {
|
|
39
|
+
this._usePolyfill ? this._overlay.style.setProperty("position-area", "initial") : this._overlay.style.setProperty("position-anchor", this._anchorName);
|
|
40
|
+
}
|
|
41
|
+
hostUpdate() {
|
|
42
|
+
k || this._readPositionsFromCss();
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Connects the overlay to the given trigger element and determines the optimal position.
|
|
46
|
+
* Usually, this is called when the overlay is opened.
|
|
47
|
+
* @param anchor The anchor element.
|
|
48
|
+
*/
|
|
49
|
+
connect(e) {
|
|
50
|
+
k || (this._anchor && this.disconnect(), this._anchor = e, this._usePolyfill || this._anchor.style.setProperty("anchor-name", this._anchorName), this._readPositionsFromCss(), this._calculatePosition(), this._abortController?.abort(), this._abortController = new AbortController(), document.addEventListener("scroll", () => this._requestCalculatePosition(), {
|
|
51
|
+
capture: !0,
|
|
52
|
+
passive: !0,
|
|
53
|
+
signal: this._abortController.signal
|
|
54
|
+
}), window.addEventListener("resize", () => this._requestCalculatePosition(), {
|
|
55
|
+
passive: !0,
|
|
56
|
+
signal: this._abortController.signal
|
|
57
|
+
}), this._resizeObserver.observe(e, { box: "border-box" }), this._resizeObserver.observe(this._overlay, { box: "border-box" }));
|
|
58
|
+
}
|
|
59
|
+
disconnect() {
|
|
60
|
+
this._anchor?.style.removeProperty("anchor-name"), this._anchor = void 0, this._abortController?.abort(), this._resizeObserver.disconnect();
|
|
61
|
+
}
|
|
62
|
+
_requestCalculatePosition() {
|
|
63
|
+
this._frame ??= requestAnimationFrame(() => {
|
|
64
|
+
this._calculatePosition(), this._frame = void 0;
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
_calculatePosition() {
|
|
68
|
+
if (this._anchor) {
|
|
69
|
+
if (this._usePolyfill) {
|
|
70
|
+
const e = this._getOptimalPosition(this._positions);
|
|
71
|
+
this._applyOverlayPosition(e.position, e.left, e.top);
|
|
72
|
+
}
|
|
73
|
+
this._overlay.setAttribute("data-position", this.currentPosition);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Calculates the optimal position that fits the overlay.
|
|
78
|
+
* @param positions The list of positions to check.
|
|
79
|
+
* @private
|
|
80
|
+
*/
|
|
81
|
+
_getOptimalPosition(e) {
|
|
82
|
+
const { offsetHeight: t, offsetWidth: o } = this._overlay, { innerHeight: u, innerWidth: g } = window, { top: n, left: r, height: l, width: d } = this._anchor.getBoundingClientRect(), P = this._overlay.matches(":dir(rtl)"), a = n, c = u - l - n, p = r, h = g - d - r, b = o - d, y = t - l, f = b / 2, _ = y / 2;
|
|
83
|
+
this._overlay.style.setProperty("--sbb-overlay-controller-trigger-height", `${l}px`), this._overlay.style.setProperty("--sbb-overlay-controller-trigger-width", `${d}px`);
|
|
84
|
+
let s = { left: 0, top: 0, position: "" }, v;
|
|
85
|
+
for (const i of e) {
|
|
86
|
+
switch (P && C.includes(i) ? S[i] : i) {
|
|
87
|
+
default:
|
|
88
|
+
case "bottom":
|
|
89
|
+
case "block-end":
|
|
90
|
+
s = {
|
|
91
|
+
position: i,
|
|
92
|
+
left: r - f,
|
|
93
|
+
top: n + l,
|
|
94
|
+
fits: t <= c && f <= p && f <= h
|
|
95
|
+
};
|
|
96
|
+
break;
|
|
97
|
+
case "top":
|
|
98
|
+
case "block-start":
|
|
99
|
+
s = {
|
|
100
|
+
position: i,
|
|
101
|
+
left: r - f,
|
|
102
|
+
top: n - t,
|
|
103
|
+
fits: t <= a && f <= p && f <= h
|
|
104
|
+
};
|
|
105
|
+
break;
|
|
106
|
+
case "right":
|
|
107
|
+
case "inline-end":
|
|
108
|
+
s = {
|
|
109
|
+
position: i,
|
|
110
|
+
left: r + d,
|
|
111
|
+
top: n - _,
|
|
112
|
+
fits: o <= h && _ <= a && _ <= c
|
|
113
|
+
};
|
|
114
|
+
break;
|
|
115
|
+
case "left":
|
|
116
|
+
case "inline-start":
|
|
117
|
+
s = {
|
|
118
|
+
position: i,
|
|
119
|
+
left: r - o,
|
|
120
|
+
top: n - _,
|
|
121
|
+
fits: o <= p && _ <= a && _ <= c
|
|
122
|
+
};
|
|
123
|
+
break;
|
|
124
|
+
case "top span-left":
|
|
125
|
+
case "block-start span-inline-start":
|
|
126
|
+
s = {
|
|
127
|
+
position: i,
|
|
128
|
+
left: r - b,
|
|
129
|
+
top: n - t,
|
|
130
|
+
fits: t <= a && b <= p
|
|
131
|
+
};
|
|
132
|
+
break;
|
|
133
|
+
case "top span-right":
|
|
134
|
+
case "block-start span-inline-end":
|
|
135
|
+
s = {
|
|
136
|
+
position: i,
|
|
137
|
+
left: r,
|
|
138
|
+
top: n - t,
|
|
139
|
+
fits: t <= a && b <= h
|
|
140
|
+
};
|
|
141
|
+
break;
|
|
142
|
+
case "bottom span-left":
|
|
143
|
+
case "block-end span-inline-start":
|
|
144
|
+
s = {
|
|
145
|
+
position: i,
|
|
146
|
+
left: r - b,
|
|
147
|
+
top: n + l,
|
|
148
|
+
fits: t <= c && b <= p
|
|
149
|
+
};
|
|
150
|
+
break;
|
|
151
|
+
case "bottom span-right":
|
|
152
|
+
case "block-end span-inline-end":
|
|
153
|
+
s = {
|
|
154
|
+
position: i,
|
|
155
|
+
left: r,
|
|
156
|
+
top: n + l,
|
|
157
|
+
fits: t <= c && b <= h
|
|
158
|
+
};
|
|
159
|
+
break;
|
|
160
|
+
case "left span-top":
|
|
161
|
+
case "inline-start span-block-start":
|
|
162
|
+
s = {
|
|
163
|
+
position: i,
|
|
164
|
+
left: r - o,
|
|
165
|
+
top: n + l - t,
|
|
166
|
+
fits: o <= p && y <= a
|
|
167
|
+
};
|
|
168
|
+
break;
|
|
169
|
+
case "left span-bottom":
|
|
170
|
+
case "inline-start span-block-end":
|
|
171
|
+
s = {
|
|
172
|
+
position: i,
|
|
173
|
+
left: r - o,
|
|
174
|
+
top: n,
|
|
175
|
+
fits: o <= p && y <= c
|
|
176
|
+
};
|
|
177
|
+
break;
|
|
178
|
+
case "right span-top":
|
|
179
|
+
case "inline-end span-block-start":
|
|
180
|
+
s = {
|
|
181
|
+
position: i,
|
|
182
|
+
left: r + d,
|
|
183
|
+
top: n + l - t,
|
|
184
|
+
fits: o <= h && y <= a
|
|
185
|
+
};
|
|
186
|
+
break;
|
|
187
|
+
case "right span-bottom":
|
|
188
|
+
case "inline-end span-block-end":
|
|
189
|
+
s = {
|
|
190
|
+
position: i,
|
|
191
|
+
left: r + d,
|
|
192
|
+
top: n,
|
|
193
|
+
fits: o <= h && y <= c
|
|
194
|
+
};
|
|
195
|
+
break;
|
|
196
|
+
}
|
|
197
|
+
if (s.fits)
|
|
198
|
+
return s;
|
|
199
|
+
v ??= s;
|
|
200
|
+
}
|
|
201
|
+
return v;
|
|
202
|
+
}
|
|
203
|
+
_applyOverlayPosition(e, t, o) {
|
|
204
|
+
this._lastPosition = e, this._overlay.style.left = `${t}px`, this._overlay.style.top = `${o}px`;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Only used in polyfill mode.
|
|
208
|
+
* Reads the list of the configured positions from the CSS variables.
|
|
209
|
+
* @private
|
|
210
|
+
*/
|
|
211
|
+
_readPositionsFromCss() {
|
|
212
|
+
if (!this._usePolyfill)
|
|
213
|
+
return;
|
|
214
|
+
this._overlayStyles ??= getComputedStyle(this._overlay);
|
|
215
|
+
const e = [
|
|
216
|
+
this._overlayStyles.getPropertyValue("--sbb-overlay-position-area") || "block-end",
|
|
217
|
+
...this._overlayStyles.getPropertyValue("--sbb-overlay-position-try-fallbacks").split(",").map((t) => t.trim()).filter((t) => !!t)
|
|
218
|
+
];
|
|
219
|
+
this._positions = e, this._lastPosition && !this._positions.includes(this._lastPosition) && (this._lastPosition = void 0);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
export {
|
|
223
|
+
W as SbbOverlayPositionController
|
|
224
|
+
};
|
package/core/controllers.d.ts
CHANGED
|
@@ -7,4 +7,5 @@ export * from './controllers/inert-controller.js';
|
|
|
7
7
|
export * from './controllers/language-controller.js';
|
|
8
8
|
export * from './controllers/media-matchers-controller.js';
|
|
9
9
|
export * from './controllers/slot-state-controller.js';
|
|
10
|
+
export * from './controllers/overlay-position-controller.js';
|
|
10
11
|
//# sourceMappingURL=controllers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controllers.d.ts","sourceRoot":"","sources":["../../../src/elements/core/controllers.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,+CAA+C,CAAC;AAC9D,cAAc,0CAA0C,CAAC;AACzD,cAAc,mCAAmC,CAAC;AAClD,cAAc,sCAAsC,CAAC;AACrD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,wCAAwC,CAAC"}
|
|
1
|
+
{"version":3,"file":"controllers.d.ts","sourceRoot":"","sources":["../../../src/elements/core/controllers.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,+CAA+C,CAAC;AAC9D,cAAc,0CAA0C,CAAC;AACzD,cAAc,mCAAmC,CAAC;AAClD,cAAc,sCAAsC,CAAC;AACrD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,wCAAwC,CAAC;AACvD,cAAc,8CAA8C,CAAC"}
|
package/core/controllers.js
CHANGED
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
import { SbbEscapableOverlayController as o } from "./controllers/escapable-overlay-controller.js";
|
|
2
|
-
import { SbbIdReferenceController as
|
|
3
|
-
import { SbbInertController as
|
|
4
|
-
import { SbbLanguageController as
|
|
5
|
-
import { SbbDarkModeController as i, SbbMediaMatcherController as M, SbbMediaQueryBreakpointMediumAndAbove as p, SbbMediaQueryBreakpointMediumAndBelow as
|
|
2
|
+
import { SbbIdReferenceController as l } from "./controllers/id-reference-controller.js";
|
|
3
|
+
import { SbbInertController as a } from "./controllers/inert-controller.js";
|
|
4
|
+
import { SbbLanguageController as S } from "./controllers/language-controller.js";
|
|
5
|
+
import { SbbDarkModeController as i, SbbMediaMatcherController as M, SbbMediaQueryBreakpointMediumAndAbove as p, SbbMediaQueryBreakpointMediumAndBelow as m, SbbMediaQueryBreakpointSmallAndBelow as u, SbbMediaQueryDarkMode as C, SbbMediaQueryForcedColors as y, SbbMediaQueryHover as f, SbbMediaQueryPointerCoarse as x } from "./controllers/media-matchers-controller.js";
|
|
6
6
|
import { SbbSlotStateController as k } from "./controllers/slot-state-controller.js";
|
|
7
|
+
import { SbbOverlayPositionController as c } from "./controllers/overlay-position-controller.js";
|
|
7
8
|
export {
|
|
8
9
|
i as SbbDarkModeController,
|
|
9
10
|
o as SbbEscapableOverlayController,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
l as SbbIdReferenceController,
|
|
12
|
+
a as SbbInertController,
|
|
13
|
+
S as SbbLanguageController,
|
|
13
14
|
M as SbbMediaMatcherController,
|
|
14
15
|
p as SbbMediaQueryBreakpointMediumAndAbove,
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
m as SbbMediaQueryBreakpointMediumAndBelow,
|
|
17
|
+
u as SbbMediaQueryBreakpointSmallAndBelow,
|
|
17
18
|
C as SbbMediaQueryDarkMode,
|
|
18
19
|
y as SbbMediaQueryForcedColors,
|
|
19
20
|
f as SbbMediaQueryHover,
|
|
20
|
-
|
|
21
|
+
x as SbbMediaQueryPointerCoarse,
|
|
22
|
+
c as SbbOverlayPositionController,
|
|
21
23
|
k as SbbSlotStateController
|
|
22
24
|
};
|
package/core/mixins.js
CHANGED
|
@@ -14,7 +14,7 @@ import { SbbReadonlyMixin as P } from "./mixins/readonly-mixin.js";
|
|
|
14
14
|
import { SbbSelectionPanelMixin as q } from "./mixins/selection-panel-mixin.js";
|
|
15
15
|
import { SbbUpdateSchedulerMixin as H } from "./mixins/update-scheduler-mixin.js";
|
|
16
16
|
import { css as e } from "lit";
|
|
17
|
-
const n = e`:host{--sbb-selection-panel-background: var( --sbb-selection-panel-inner-background, var(--sbb-background-color-1) );--sbb-selection-panel-border-color: var(--sbb-border-color-4-inverted);--sbb-selection-panel-border-radius: var( --sbb-selection-expansion-panel-border-radius, var(--sbb-border-radius-4x) );--sbb-selection-panel-border-width: var( --sbb-selection-panel-inner-border-width, var(--sbb-border-width-1x) );--sbb-selection-panel-input-padding: var(--sbb-spacing-responsive-xs) var(--sbb-spacing-responsive-xxs);--sbb-selection-panel-animation-duration: var( --sbb-disable-animation-duration, var(--sbb-animation-duration-4x) );--sbb-selection-panel-cursor: pointer;--sbb-selection-panel-suffix-color: var(--sbb-color-3);--sbb-selection-panel-subtext-color: var(--sbb-color-granite);--sbb-selection-panel-subtext-color: light-dark(var(--sbb-color-granite), var(--sbb-color-smoke));display:block;outline:none!important}:host([size=s]){--sbb-selection-panel-input-padding: var(--sbb-spacing-responsive-xxs) var(--sbb-spacing-responsive-xxxs)}:host([color=milk]){--sbb-selection-panel-background: var( --sbb-selection-panel-inner-background, var(--sbb-background-color-3) )}:host([borderless]:not([data-checked])){--sbb-selection-panel-border-color: transparent}:host(:is([data-checked]):not(:disabled,[disabled])){--sbb-selection-panel-border-color: var(--sbb-border-color-3);--sbb-selection-panel-border-width: var( --sbb-selection-panel-inner-border-width, var(--sbb-border-width-2x) )}:host(:is(:disabled,[disabled])){--sbb-selection-panel-cursor: default}.sbb-selection-panel{display:block;cursor:var(--sbb-selection-panel-cursor);position:relative;border-radius:var(--sbb-selection-panel-border-radius);box-shadow:inset 0 0 0 var(--sbb-selection-panel-border-width) var(--sbb-selection-panel-border-color);padding:var(--sbb-selection-panel-input-padding);background-color:var(--sbb-selection-panel-background);transition-duration:var(--sbb-selection-panel-animation-duration);transition-timing-function:var(--sbb-animation-easing);transition-property:box-shadow}@media
|
|
17
|
+
const n = e`:host{--sbb-selection-panel-background: var( --sbb-selection-panel-inner-background, var(--sbb-background-color-1) );--sbb-selection-panel-border-color: var(--sbb-border-color-4-inverted);--sbb-selection-panel-border-radius: var( --sbb-selection-expansion-panel-border-radius, var(--sbb-border-radius-4x) );--sbb-selection-panel-border-width: var( --sbb-selection-panel-inner-border-width, var(--sbb-border-width-1x) );--sbb-selection-panel-input-padding: var(--sbb-spacing-responsive-xs) var(--sbb-spacing-responsive-xxs);--sbb-selection-panel-animation-duration: var( --sbb-disable-animation-duration, var(--sbb-animation-duration-4x) );--sbb-selection-panel-cursor: pointer;--sbb-selection-panel-suffix-color: var(--sbb-color-3);--sbb-selection-panel-subtext-color: var(--sbb-color-granite);--sbb-selection-panel-subtext-color: light-dark(var(--sbb-color-granite), var(--sbb-color-smoke));display:block;outline:none!important}:host([size=s]){--sbb-selection-panel-input-padding: var(--sbb-spacing-responsive-xxs) var(--sbb-spacing-responsive-xxxs)}:host([color=milk]){--sbb-selection-panel-background: var( --sbb-selection-panel-inner-background, var(--sbb-background-color-3) )}:host([borderless]:not([data-checked])){--sbb-selection-panel-border-color: transparent}:host(:is([data-checked]):not(:disabled,[disabled])){--sbb-selection-panel-border-color: var(--sbb-border-color-3);--sbb-selection-panel-border-width: var( --sbb-selection-panel-inner-border-width, var(--sbb-border-width-2x) )}:host(:is(:disabled,[disabled])){--sbb-selection-panel-cursor: default}.sbb-selection-panel{display:block;cursor:var(--sbb-selection-panel-cursor);position:relative;border-radius:var(--sbb-selection-panel-border-radius);box-shadow:inset 0 0 0 var(--sbb-selection-panel-border-width) var(--sbb-selection-panel-border-color);padding:var(--sbb-selection-panel-input-padding);background-color:var(--sbb-selection-panel-background);transition-duration:var(--sbb-selection-panel-animation-duration);transition-timing-function:var(--sbb-animation-easing);transition-property:box-shadow}@media(forced-colors:active){.sbb-selection-panel:after{content:"";display:block;position:absolute;inset:0;pointer-events:none;border:var(--sbb-selection-panel-border-width) solid var(--sbb-selection-panel-border-color);border-radius:var(--sbb-selection-panel-border-radius)}}:host(:focus-visible) .sbb-selection-panel{outline-offset:var(--sbb-focus-outline-offset);outline:var(--sbb-focus-outline-color) var(--sbb-focus-outline-style, solid) var(--sbb-focus-outline-width)}.sbb-selection-panel__badge{-webkit-user-select:none;user-select:none;pointer-events:none;position:absolute;inset:0;border-radius:var(--sbb-selection-panel-border-radius);overflow:hidden}slot[name=suffix]{color:var(--sbb-selection-panel-suffix-color)}slot[name=subtext]{display:block;color:var(--sbb-selection-panel-subtext-color);padding-inline-start:var(--sbb-spacing-fixed-8x)}:host(:not([data-slot-names~=subtext])) slot[name=subtext]{display:none}`;
|
|
18
18
|
export {
|
|
19
19
|
b as SbbAnimationCompleteMixin,
|
|
20
20
|
a as SbbDisabledInteractiveMixin,
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* @param optionContainer The reference to the option panel.
|
|
6
6
|
* @param container The element which has the position:fixed applied.
|
|
7
7
|
* @param element The reference to the component.
|
|
8
|
+
* @param position The allowed position of the overlay relative to the origin.
|
|
8
9
|
*/
|
|
9
|
-
export declare function setOverlayPosition(dialog: HTMLElement, originElement: HTMLElement, optionContainer: HTMLElement, container: HTMLElement, element: HTMLElement): void;
|
|
10
|
+
export declare function setOverlayPosition(dialog: HTMLElement, originElement: HTMLElement, optionContainer: HTMLElement, container: HTMLElement, element: HTMLElement, position?: 'auto' | 'above' | 'below'): void;
|
|
10
11
|
//# sourceMappingURL=overlay-option-panel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overlay-option-panel.d.ts","sourceRoot":"","sources":["../../../../src/elements/core/overlay/overlay-option-panel.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"overlay-option-panel.d.ts","sourceRoot":"","sources":["../../../../src/elements/core/overlay/overlay-option-panel.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,WAAW,EACnB,aAAa,EAAE,WAAW,EAC1B,eAAe,EAAE,WAAW,EAC5B,SAAS,EAAE,WAAW,EACtB,OAAO,EAAE,WAAW,EACpB,QAAQ,GAAE,MAAM,GAAG,OAAO,GAAG,OAAgB,GAC5C,IAAI,CAsBN"}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { getElementPosition as
|
|
2
|
-
function
|
|
3
|
-
if (!
|
|
1
|
+
import { getElementPosition as r } from "./position.js";
|
|
2
|
+
function b(e, o, i, a, t, p = "auto") {
|
|
3
|
+
if (!e || !o)
|
|
4
4
|
return;
|
|
5
5
|
t.style.setProperty("--sbb-options-panel-width", `${o.offsetWidth}px`), t.style.setProperty("--sbb-options-panel-origin-height", `${o.offsetHeight}px`);
|
|
6
|
-
const s =
|
|
6
|
+
const s = r(i, o, a, {
|
|
7
|
+
forceBelow: p === "below",
|
|
8
|
+
forceAbove: p === "above"
|
|
9
|
+
});
|
|
7
10
|
t.style.setProperty("--sbb-options-panel-position-x", `${s.left}px`), t.style.setProperty("--sbb-options-panel-position-y", `${s.top}px`), t.style.setProperty("--sbb-options-panel-max-height", s.maxHeight), t.setAttribute("data-options-panel-position", s.alignment.vertical), o.setAttribute("data-options-panel-position", s.alignment.vertical);
|
|
8
11
|
}
|
|
9
12
|
export {
|
|
10
|
-
|
|
13
|
+
b as setOverlayPosition
|
|
11
14
|
};
|
|
@@ -37,6 +37,8 @@ export declare function getElementPosition(element: HTMLElement, trigger: HTMLEl
|
|
|
37
37
|
horizontalOffset?: number;
|
|
38
38
|
centered?: boolean;
|
|
39
39
|
responsiveHeight?: boolean;
|
|
40
|
+
forceAbove?: boolean;
|
|
41
|
+
forceBelow?: boolean;
|
|
40
42
|
}): SbbElementPositionInfos;
|
|
41
43
|
/**
|
|
42
44
|
* Determines the position of an element relative to a trigger element by evaluating
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"position.d.ts","sourceRoot":"","sources":["../../../../src/elements/core/overlay/position.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG,IAAI,CACjC,WAAW,EACX,cAAc,GAAG,cAAc,GAAG,cAAc,GAAG,aAAa,GAAG,aAAa,GAAG,aAAa,CACjG,CAAC;AAEF,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IACvC,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,uBAAuB;IACtC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,YAAY,CAAC;CACzB;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,WAAW,GAAG,gBAAgB,CAoCrE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,WAAW,GAAG,IAAI,EAC3B,KAAK,EAAE,UAAU,GAAG,YAAY,GAC/B,OAAO,CAYT;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,WAAW,EACpB,SAAS,EAAE,WAAW,EACtB,UAAU,CAAC,EAAE;IACX,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"position.d.ts","sourceRoot":"","sources":["../../../../src/elements/core/overlay/position.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG,IAAI,CACjC,WAAW,EACX,cAAc,GAAG,cAAc,GAAG,cAAc,GAAG,aAAa,GAAG,aAAa,GAAG,aAAa,CACjG,CAAC;AAEF,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IACvC,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,uBAAuB;IACtC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,YAAY,CAAC;CACzB;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,WAAW,GAAG,gBAAgB,CAoCrE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,WAAW,GAAG,IAAI,EAC3B,KAAK,EAAE,UAAU,GAAG,YAAY,GAC/B,OAAO,CAYT;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,WAAW,EACpB,SAAS,EAAE,WAAW,EACtB,UAAU,CAAC,EAAE;IACX,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,GACA,uBAAuB,CAsGzB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,WAAW,EACpB,SAAS,EAAE,WAAW,EACtB,UAAU,CAAC,EAAE;IACX,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GACA,uBAAuB,CAgEzB"}
|
package/core/overlay/position.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function R(t) {
|
|
2
|
-
const o = window.getComputedStyle(t), c = o.display,
|
|
3
|
-
if (c !== "none" &&
|
|
2
|
+
const o = window.getComputedStyle(t), c = o.display, s = parseInt(o.maxHeight, 10).toString();
|
|
3
|
+
if (c !== "none" && s !== "0")
|
|
4
4
|
return {
|
|
5
5
|
scrollHeight: t.scrollHeight,
|
|
6
6
|
clientHeight: t.clientHeight,
|
|
@@ -10,8 +10,8 @@ function R(t) {
|
|
|
10
10
|
offsetWidth: t.offsetWidth
|
|
11
11
|
};
|
|
12
12
|
t.style.position = "absolute", t.style.visibility = "hidden", t.style.display = "block";
|
|
13
|
-
const
|
|
14
|
-
return t.style.display = "", t.style.position = "", t.style.visibility = "", { scrollHeight:
|
|
13
|
+
const p = t.scrollHeight, n = t.clientHeight, g = t.offsetHeight, r = t.scrollWidth, e = t.clientWidth, i = t.offsetWidth;
|
|
14
|
+
return t.style.display = "", t.style.position = "", t.style.visibility = "", { scrollHeight: p, clientHeight: n, offsetHeight: g, scrollWidth: r, clientWidth: e, offsetWidth: i };
|
|
15
15
|
}
|
|
16
16
|
function x(t, o) {
|
|
17
17
|
if (!t || !o)
|
|
@@ -19,33 +19,35 @@ function x(t, o) {
|
|
|
19
19
|
const c = t.getBoundingClientRect();
|
|
20
20
|
return c.top <= o.clientY && o.clientY <= c.top + c.height && c.left <= o.clientX && o.clientX <= c.left + c.width;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
const n =
|
|
24
|
-
let
|
|
22
|
+
function w(t, o, c, s) {
|
|
23
|
+
const n = s?.verticalOffset || 0, g = s?.horizontalOffset || 0, r = s?.responsiveHeight || !1, e = o.getBoundingClientRect(), i = R(t), f = e.left, H = e.top, W = document.documentElement.clientWidth - (f + e.width), d = H - n, u = document.documentElement.clientHeight - (H + e.height + n);
|
|
24
|
+
let h = f, m = H + e.height + n, l = i.offsetWidth - e.width;
|
|
25
25
|
const a = { horizontal: "start", vertical: "below" };
|
|
26
26
|
let O = `${u - n}px`;
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
|
|
27
|
+
s?.centered && f - 16 + e.width / 2 > i.offsetWidth / 2 && W - 16 > l / 2 && (h -= l /= 2, a.horizontal = "center"), W < l && f > l && (h = h - l, a.horizontal = "end"), g && a.horizontal !== "center" && e.width / 2 < g && (h += g * (a.horizontal === "start" ? -1 : 1)), (f < l && W < l || document.documentElement.clientWidth < i.offsetWidth) && (h = document.documentElement.clientWidth / 2 - i.offsetWidth / 2);
|
|
28
|
+
const b = u - n < i.scrollHeight && d - n > (r ? i.clientHeight : i.scrollHeight) || d > u && u - n < i.clientHeight && !r;
|
|
29
|
+
!s?.forceBelow && (s?.forceAbove || b) && (m = d < i.scrollHeight ? m - e.height - d - n : H - i.clientHeight - n, O = `${d - n}px`, a.vertical = "above");
|
|
30
|
+
const v = c.getBoundingClientRect();
|
|
31
|
+
return v.left < 0 && (h -= v.left), v.top < 0 && (m -= v.top), {
|
|
30
32
|
top: m,
|
|
31
|
-
left:
|
|
33
|
+
left: h,
|
|
32
34
|
maxHeight: O,
|
|
33
35
|
alignment: a
|
|
34
36
|
};
|
|
35
37
|
}
|
|
36
|
-
function
|
|
37
|
-
const n =
|
|
38
|
+
function y(t, o, c, s) {
|
|
39
|
+
const n = s?.verticalOffset || 0, g = s?.horizontalOffset || 0, r = o.getBoundingClientRect(), e = R(t), i = o.parentElement.shadowRoot.querySelector(s?.contentSelector ?? `.${t.className}`).getBoundingClientRect(), f = c.getBoundingClientRect(), H = document.documentElement.clientWidth - i.right, W = document.documentElement.clientHeight - (r.top - n), d = document.documentElement.clientHeight, u = `${d - 32}px`, h = { horizontal: "end", vertical: "above" }, m = e.offsetWidth + g;
|
|
38
40
|
let l = i.right, a = r.top + n;
|
|
39
|
-
return H < m && r.left > m && (l = l - i.width - e.offsetWidth,
|
|
41
|
+
return H < m && r.left > m && (l = l - i.width - e.offsetWidth, h.horizontal = "start"), g && h.horizontal !== "center" && (l += g * (h.horizontal === "start" ? -1 : 1)), W < e.scrollHeight && (a = d - e.clientHeight - 16), f.left < 0 && (l -= f.left), f.top < 0 && (a -= f.top), {
|
|
40
42
|
top: a,
|
|
41
43
|
left: l,
|
|
42
44
|
maxHeight: u,
|
|
43
|
-
alignment:
|
|
45
|
+
alignment: h
|
|
44
46
|
};
|
|
45
47
|
}
|
|
46
48
|
export {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
w as getElementPosition,
|
|
50
|
+
y as getElementPositionHorizontal,
|
|
49
51
|
R as getElementRectangle,
|
|
50
52
|
x as isEventOnElement
|
|
51
53
|
};
|
package/core/styles/core.scss
CHANGED
|
@@ -273,8 +273,7 @@ html {
|
|
|
273
273
|
sbb-navigation,
|
|
274
274
|
sbb-overlay,
|
|
275
275
|
sbb-popover,
|
|
276
|
-
sbb-toast
|
|
277
|
-
sbb-tooltip
|
|
276
|
+
sbb-toast
|
|
278
277
|
) {
|
|
279
278
|
@include popover.popover-reset;
|
|
280
279
|
}
|
|
@@ -654,3 +653,29 @@ sbb-status:has(sbb-title) {
|
|
|
654
653
|
--sbb-option-overflow: hidden;
|
|
655
654
|
--sbb-option-white-space: nowrap;
|
|
656
655
|
}
|
|
656
|
+
|
|
657
|
+
sbb-mini-calendar[orientation='horizontal'] {
|
|
658
|
+
sbb-mini-calendar-month {
|
|
659
|
+
--sbb-mini-calendar-grid-auto-flow: row;
|
|
660
|
+
--sbb-mini-calendar-month-height: #{functions.px-to-rem-build(48)};
|
|
661
|
+
--sbb-mini-calendar-month-grid-template-rows: none;
|
|
662
|
+
--sbb-mini-calendar-month-grid-template-columns: repeat(7, 1fr);
|
|
663
|
+
|
|
664
|
+
sbb-mini-calendar-day:first-child {
|
|
665
|
+
grid-column-start: var(--sbb-mini-calendar-month-offset);
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
sbb-mini-calendar[orientation='vertical'] {
|
|
671
|
+
sbb-mini-calendar-month {
|
|
672
|
+
--sbb-mini-calendar-grid-auto-flow: column;
|
|
673
|
+
--sbb-mini-calendar-month-height: auto;
|
|
674
|
+
--sbb-mini-calendar-month-grid-template-rows: repeat(7, 1fr);
|
|
675
|
+
--sbb-mini-calendar-month-grid-template-columns: none;
|
|
676
|
+
|
|
677
|
+
sbb-mini-calendar-day:first-child {
|
|
678
|
+
grid-row-start: var(--sbb-mini-calendar-month-offset);
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
}
|
package/core/styles/layout.scss
CHANGED
|
@@ -12,6 +12,9 @@
|
|
|
12
12
|
color: var(--sbb-color-1-negative);
|
|
13
13
|
min-width: var(--sbb-spacing-fixed-4x);
|
|
14
14
|
max-height: var(--sbb-spacing-fixed-4x);
|
|
15
|
+
|
|
16
|
+
// Transparent outline is visible in forced colors mode to ensure readability
|
|
17
|
+
outline: var(--sbb-border-width-1x) solid transparent;
|
|
15
18
|
}
|
|
16
19
|
|
|
17
20
|
@mixin badge-attribute {
|