@sbb-esta/lyne-elements 1.14.1 → 1.15.1
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/autocomplete/autocomplete.d.ts +1 -1
- package/autocomplete/autocomplete.d.ts.map +1 -1
- package/autocomplete-grid/autocomplete-grid/autocomplete-grid.d.ts +1 -1
- package/autocomplete-grid/autocomplete-grid/autocomplete-grid.d.ts.map +1 -1
- package/autocomplete-grid/autocomplete-grid.js +6 -6
- package/autocomplete.js +20 -19
- package/calendar/calendar.d.ts +1 -1
- package/calendar/calendar.d.ts.map +1 -1
- package/calendar.js +25 -27
- package/checkbox/checkbox-panel/checkbox-panel.d.ts +1 -1
- package/checkbox/checkbox-panel/checkbox-panel.d.ts.map +1 -1
- package/checkbox/checkbox-panel.js +5 -5
- package/checkbox/common.js +1 -1
- package/clock/clock.d.ts +1 -1
- package/clock/clock.d.ts.map +1 -1
- package/clock.js +2 -2
- package/container/sticky-bar/sticky-bar.d.ts +29 -2
- package/container/sticky-bar/sticky-bar.d.ts.map +1 -1
- package/container/sticky-bar.js +69 -31
- package/core/base-elements/link-base-element.d.ts +1 -0
- package/core/base-elements/link-base-element.d.ts.map +1 -1
- package/core/base-elements.js +46 -43
- package/core/config/config.d.ts +3 -0
- package/core/config/config.d.ts.map +1 -1
- package/core/controllers/media-matchers-controller.d.ts +32 -0
- package/core/controllers/media-matchers-controller.d.ts.map +1 -0
- package/core/controllers.d.ts +1 -0
- package/core/controllers.d.ts.map +1 -1
- package/core/controllers.js +75 -33
- package/core/dom/breakpoint.d.ts +2 -1
- package/core/dom/breakpoint.d.ts.map +1 -1
- package/core/dom.js +7 -7
- package/core/mixins/form-associated-checkbox-mixin.d.ts.map +1 -1
- package/core/mixins.js +8 -1
- package/core/styles/core/mediaqueries.scss +1 -2
- package/core/styles/mixins/buttons.scss +5 -5
- package/core/testing/event-spy.d.ts +6 -4
- package/core/testing/event-spy.d.ts.map +1 -1
- package/core/testing.js +82 -55
- package/custom-elements.json +953 -97
- package/datepicker/datepicker/datepicker.d.ts.map +1 -1
- package/development/autocomplete/autocomplete.d.ts +1 -1
- package/development/autocomplete/autocomplete.d.ts.map +1 -1
- package/development/autocomplete-grid/autocomplete-grid/autocomplete-grid.d.ts +1 -1
- package/development/autocomplete-grid/autocomplete-grid/autocomplete-grid.d.ts.map +1 -1
- package/development/autocomplete-grid/autocomplete-grid.js +4 -3
- package/development/autocomplete.js +4 -3
- package/development/calendar/calendar.d.ts +1 -1
- package/development/calendar/calendar.d.ts.map +1 -1
- package/development/calendar.js +8 -11
- package/development/checkbox/checkbox-panel/checkbox-panel.d.ts +1 -1
- package/development/checkbox/checkbox-panel/checkbox-panel.d.ts.map +1 -1
- package/development/checkbox/checkbox-panel.js +2 -2
- package/development/checkbox/common.js +2 -2
- package/development/clock/clock.d.ts +1 -1
- package/development/clock/clock.d.ts.map +1 -1
- package/development/clock.js +3 -3
- package/development/container/sticky-bar/sticky-bar.d.ts +29 -2
- package/development/container/sticky-bar/sticky-bar.d.ts.map +1 -1
- package/development/container/sticky-bar.js +149 -36
- package/development/core/base-elements/link-base-element.d.ts +1 -0
- package/development/core/base-elements/link-base-element.d.ts.map +1 -1
- package/development/core/base-elements.js +5 -2
- package/development/core/config/config.d.ts +3 -0
- package/development/core/config/config.d.ts.map +1 -1
- package/development/core/config.js +1 -1
- package/development/core/controllers/media-matchers-controller.d.ts +32 -0
- package/development/core/controllers/media-matchers-controller.d.ts.map +1 -0
- package/development/core/controllers.d.ts +1 -0
- package/development/core/controllers.d.ts.map +1 -1
- package/development/core/controllers.js +65 -1
- package/development/core/dom/breakpoint.d.ts +2 -1
- package/development/core/dom/breakpoint.d.ts.map +1 -1
- package/development/core/dom.js +2 -2
- package/development/core/mixins/form-associated-checkbox-mixin.d.ts.map +1 -1
- package/development/core/mixins.js +9 -2
- package/development/core/testing/event-spy.d.ts +6 -4
- package/development/core/testing/event-spy.d.ts.map +1 -1
- package/development/core/testing.js +35 -1
- package/development/datepicker/datepicker/datepicker.d.ts.map +1 -1
- package/development/datepicker/datepicker.js +1 -1
- package/development/dialog/dialog.js +2 -2
- package/development/expansion-panel/expansion-panel-header/expansion-panel-header.d.ts +2 -0
- package/development/expansion-panel/expansion-panel-header/expansion-panel-header.d.ts.map +1 -1
- package/development/expansion-panel/expansion-panel-header.js +7 -3
- package/development/file-selector/file-selector.d.ts +5 -0
- package/development/file-selector/file-selector.d.ts.map +1 -1
- package/development/file-selector.js +8 -1
- package/development/flip-card/flip-card/flip-card.d.ts +4 -0
- package/development/flip-card/flip-card/flip-card.d.ts.map +1 -1
- package/development/flip-card/flip-card-details.js +4 -6
- package/development/flip-card/flip-card-summary/flip-card-summary.d.ts +1 -1
- package/development/flip-card/flip-card-summary/flip-card-summary.d.ts.map +1 -1
- package/development/flip-card/flip-card-summary.js +9 -10
- package/development/flip-card/flip-card.js +26 -2
- package/development/form-field/form-field.js +5 -3
- package/development/icon/icon.d.ts +1 -1
- package/development/icon.js +1 -1
- package/development/image/image.d.ts.map +1 -1
- package/development/image.js +3 -19
- package/development/map-container.js +3 -2
- package/development/menu/menu/menu.d.ts +1 -0
- package/development/menu/menu/menu.d.ts.map +1 -1
- package/development/menu/menu.js +15 -11
- package/development/navigation/navigation-section.js +4 -14
- package/development/navigation/navigation.js +3 -13
- package/development/notification.js +3 -2
- package/development/paginator/paginator/paginator.d.ts +1 -5
- package/development/paginator/paginator/paginator.d.ts.map +1 -1
- package/development/paginator/paginator.js +19 -27
- package/development/popover/popover/popover.d.ts.map +1 -1
- package/development/popover/popover.js +9 -16
- package/development/radio-button/radio-button-panel/radio-button-panel.d.ts +1 -1
- package/development/radio-button/radio-button-panel/radio-button-panel.d.ts.map +1 -1
- package/development/radio-button/radio-button-panel.js +2 -2
- package/development/sbb-tokens-BdGhUJjM.js +33 -0
- package/development/select/select.d.ts +6 -5
- package/development/select/select.d.ts.map +1 -1
- package/development/select.js +23 -14
- package/development/slider/slider.d.ts +5 -0
- package/development/slider/slider.d.ts.map +1 -1
- package/development/slider.js +8 -1
- package/development/table/table-wrapper/table-wrapper.d.ts +1 -1
- package/development/table/table-wrapper/table-wrapper.d.ts.map +1 -1
- package/development/table/table-wrapper.js +1 -1
- package/development/teaser/teaser.d.ts +2 -1
- package/development/teaser/teaser.d.ts.map +1 -1
- package/development/teaser-product/common/teaser-product-common.d.ts +1 -1
- package/development/teaser-product/common/teaser-product-common.d.ts.map +1 -1
- package/development/teaser-product/common.js +19 -19
- package/development/teaser-product/teaser-product/teaser-product.d.ts +2 -1
- package/development/teaser-product/teaser-product/teaser-product.d.ts.map +1 -1
- package/development/teaser-product/teaser-product.js +44 -12
- package/development/teaser.js +33 -7
- package/development/timetable-occupancy-icon/timetable-occupancy-icon.d.ts +2 -1
- package/development/timetable-occupancy-icon/timetable-occupancy-icon.d.ts.map +1 -1
- package/development/timetable-occupancy-icon.js +11 -9
- package/development/toggle-check/toggle-check.d.ts +1 -1
- package/development/toggle-check/toggle-check.d.ts.map +1 -1
- package/development/toggle-check.js +2 -2
- package/dialog/dialog.js +1 -1
- package/expansion-panel/expansion-panel-header/expansion-panel-header.d.ts +2 -0
- package/expansion-panel/expansion-panel-header/expansion-panel-header.d.ts.map +1 -1
- package/expansion-panel/expansion-panel-header.js +25 -23
- package/file-selector/file-selector.d.ts +5 -0
- package/file-selector/file-selector.d.ts.map +1 -1
- package/file-selector.js +7 -0
- package/flip-card/flip-card/flip-card.d.ts +4 -0
- package/flip-card/flip-card/flip-card.d.ts.map +1 -1
- package/flip-card/flip-card-details.js +6 -6
- package/flip-card/flip-card-summary/flip-card-summary.d.ts +1 -1
- package/flip-card/flip-card-summary/flip-card-summary.d.ts.map +1 -1
- package/flip-card/flip-card-summary.js +8 -8
- package/flip-card/flip-card.js +56 -42
- package/icon/icon.d.ts +1 -1
- package/image/image.d.ts.map +1 -1
- package/image.js +46 -45
- package/map-container.js +7 -7
- package/menu/menu/menu.d.ts +1 -0
- package/menu/menu/menu.d.ts.map +1 -1
- package/menu/menu.js +45 -41
- package/navigation/navigation-section.js +7 -7
- package/navigation/navigation.js +8 -8
- package/package.json +1 -1
- package/paginator/paginator/paginator.d.ts +1 -5
- package/paginator/paginator/paginator.d.ts.map +1 -1
- package/paginator/paginator.js +50 -52
- package/popover/popover/popover.d.ts.map +1 -1
- package/popover/popover.js +42 -46
- package/radio-button/radio-button-panel/radio-button-panel.d.ts +1 -1
- package/radio-button/radio-button-panel/radio-button-panel.d.ts.map +1 -1
- package/radio-button/radio-button-panel.js +7 -7
- package/sbb-tokens-Dx20OtVg.js +18 -0
- package/select/select.d.ts +6 -5
- package/select/select.d.ts.map +1 -1
- package/select.js +55 -53
- package/slider/slider.d.ts +5 -0
- package/slider/slider.d.ts.map +1 -1
- package/slider.js +12 -5
- package/table/table-wrapper/table-wrapper.d.ts +1 -1
- package/table/table-wrapper/table-wrapper.d.ts.map +1 -1
- package/teaser/teaser.d.ts +2 -1
- package/teaser/teaser.d.ts.map +1 -1
- package/teaser-product/common/teaser-product-common.d.ts +1 -1
- package/teaser-product/common/teaser-product-common.d.ts.map +1 -1
- package/teaser-product/common.js +22 -20
- package/teaser-product/teaser-product/teaser-product.d.ts +2 -1
- package/teaser-product/teaser-product/teaser-product.d.ts.map +1 -1
- package/teaser-product/teaser-product.js +26 -13
- package/teaser.js +38 -26
- package/timetable-occupancy-icon/timetable-occupancy-icon.d.ts +2 -1
- package/timetable-occupancy-icon/timetable-occupancy-icon.d.ts.map +1 -1
- package/timetable-occupancy-icon.js +45 -44
- package/toggle-check/toggle-check.d.ts +1 -1
- package/toggle-check/toggle-check.d.ts.map +1 -1
- package/toggle-check.js +1 -1
package/container/sticky-bar.js
CHANGED
|
@@ -1,51 +1,83 @@
|
|
|
1
|
-
var
|
|
1
|
+
var _ = (a) => {
|
|
2
2
|
throw TypeError(a);
|
|
3
3
|
};
|
|
4
|
-
var p = (a,
|
|
5
|
-
var
|
|
6
|
-
import { __runInitializers as
|
|
7
|
-
import { IntersectionController as
|
|
8
|
-
import { css as
|
|
9
|
-
import { customElement as
|
|
10
|
-
import { hostAttributes as
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
4
|
+
var p = (a, i, s) => i.has(a) || _("Cannot " + s);
|
|
5
|
+
var g = (a, i, s) => (p(a, i, "read from private field"), s ? s.call(a) : i.get(a)), f = (a, i, s) => i.has(a) ? _("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(a) : i.set(a, s), d = (a, i, s, e) => (p(a, i, "write to private field"), e ? e.call(a, s) : i.set(a, s), s);
|
|
6
|
+
import { __runInitializers as k, __esDecorate as w } from "tslib";
|
|
7
|
+
import { IntersectionController as S } from "@lit-labs/observers/intersection-controller.js";
|
|
8
|
+
import { css as C, LitElement as z, html as E } from "lit";
|
|
9
|
+
import { customElement as U, property as A } from "lit/decorators.js";
|
|
10
|
+
import { hostAttributes as R } from "../core/decorators.js";
|
|
11
|
+
import { EventEmitter as c } from "../core/eventing.js";
|
|
12
|
+
import { SbbUpdateSchedulerMixin as I } from "../core/mixins.js";
|
|
13
|
+
const T = C`*,: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-zero-time, var(--sbb-animation-duration-5x) );--sbb-sticky-bar-fade-out-animation-duration: var( --sbb-disable-animation-zero-time, var(--sbb-animation-duration-2x) );--sbb-sticky-bar-slide-vertically-animation-duration: var( --sbb-disable-animation-zero-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([data-sticking]:not([data-state=unsticky])){--sbb-sticky-bar-sticky-background-color: var( --sbb-container-background-color, var(--sbb-color-white) );--_sbb-sticky-bar-intersector-background-color: var(--sbb-sticky-bar-sticky-background-color);--_sbb-sticky-bar-background-animation-duration: var(--sbb-sticky-bar-fade-in-animation-duration)}@media (forced-colors: active){:host([data-sticking]:not([data-state=unsticky])){--_sbb-sticky-bar-forced-colors-border: var(--sbb-border-width-1x) solid CanvasText}}:host([data-sticking]:not([data-state=unsticky])[color=white]){--sbb-sticky-bar-sticky-background-color: var(--sbb-color-white)}:host([data-sticking]:not([data-state=unsticky])[color=milk]){--sbb-sticky-bar-sticky-background-color: var(--sbb-color-milk)}:host(: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:"";top:0;right:0;bottom:0;left:0;position:absolute;display:block;z-index:-1}.sbb-sticky-bar__wrapper:before{background-color:var(--sbb-container-background-color);padding:0!important}:host(:not([data-expanded])) .sbb-sticky-bar__wrapper:before{padding-inline:var(--sbb-layout-base-offset-responsive);margin-inline:auto;width:100%}@media (min-width: 90rem){:host(:not([data-expanded])) .sbb-sticky-bar__wrapper:before{max-width:calc(var(--sbb-layout-base-page-max-width) + 2 * var(--sbb-layout-base-offset-responsive))}}.sbb-sticky-bar__wrapper:after{background-color:var(--sbb-sticky-bar-sticky-background-color, transparent);border-start-start-radius:var(--sbb-sticky-bar-border-radius);border-start-end-radius:var(--sbb-sticky-bar-border-radius);transition:background-color var(--_sbb-sticky-bar-background-animation-duration) var(--sbb-sticky-bar-animation-easing);border:var(--_sbb-sticky-bar-forced-colors-border)}.sbb-sticky-bar{display:flex;padding-block:var(--sbb-sticky-bar-padding-block);margin-block-end:-1px}.sbb-sticky-bar:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:-1;border-start-start-radius:var(--sbb-sticky-bar-border-radius);border-start-end-radius:var(--sbb-sticky-bar-border-radius);transition:box-shadow var(--_sbb-sticky-bar-background-animation-duration) var(--sbb-sticky-bar-animation-easing);clip-path:polygon(-50% calc(-1 * var(--sbb-shadow-elevation-level-11-shadow-1-blur)),150% calc(-1 * var(--sbb-shadow-elevation-level-11-shadow-1-blur)),150% 50%,-50% 50%)}:host([data-sticking]:not([data-state=unsticky])) .sbb-sticky-bar:before{box-shadow:var(--sbb-shadow-elevation-level-11-shadow-2-offset-x) var(--sbb-shadow-elevation-level-11-shadow-2-offset-y) var(--sbb-shadow-elevation-level-11-shadow-2-blur) var(--sbb-shadow-elevation-level-11-shadow-2-spread) var(--sbb-shadow-elevation-level-11-soft-2-color),var(--sbb-shadow-elevation-level-11-shadow-1-offset-x) var(--sbb-shadow-elevation-level-11-shadow-1-offset-y) var(--sbb-shadow-elevation-level-11-shadow-1-blur) var(--sbb-shadow-elevation-level-11-shadow-1-spread) var(--sbb-shadow-elevation-level-11-soft-1-color)}:host(:not([data-expanded])) .sbb-sticky-bar{padding-inline:var(--sbb-layout-base-offset-responsive);margin-inline:auto;width:100%}@media (min-width: 90rem){:host(:not([data-expanded])) .sbb-sticky-bar{max-width:calc(var(--sbb-layout-base-page-max-width) + 2 * var(--sbb-layout-base-offset-responsive))}}:host([data-expanded]) .sbb-sticky-bar{padding-inline:var(--sbb-spacing-responsive-xxs)}.sbb-sticky-bar__intersector{height:1px}.sbb-sticky-bar__intersector:after{content:"";display:block;position:absolute;width:100%;height:calc(var(--sbb-sticky-bar-bottom-overlapping-height, 0) + 1px);background-color:var(--_sbb-sticky-bar-intersector-background-color);pointer-events:none;transition:background-color var(--_sbb-sticky-bar-background-animation-duration) var(--sbb-sticky-bar-animation-easing)}@keyframes slide-in{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes slide-out{0%{transform:translateY(0)}to{transform:translateY(100%)}}`;
|
|
14
|
+
let M = (() => {
|
|
15
|
+
var b, r;
|
|
16
|
+
let a = [U("sbb-sticky-bar"), R({
|
|
15
17
|
slot: "sticky-bar"
|
|
16
|
-
})],
|
|
17
|
-
|
|
18
|
+
})], i, s = [], e, y = I(z), u, h = [], v = [];
|
|
19
|
+
var n = (r = class extends y {
|
|
18
20
|
constructor() {
|
|
19
21
|
super(...arguments);
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
f(this, b);
|
|
23
|
+
d(this, b, k(this, h, null)), this._willStick = (k(this, v), new c(this, n.events.willStick)), this._didStick = new c(this, n.events.didStick), this._willUnstick = new c(this, n.events.willUnstick), this._didUnstick = new c(this, n.events.didUnstick), this._observer = new S(this, {
|
|
22
24
|
// Although `this` is observed, we have to postpone observing
|
|
23
25
|
// into firstUpdated() to achieve a correct initial state.
|
|
24
26
|
target: null,
|
|
25
|
-
callback: (t) => this.
|
|
27
|
+
callback: (t) => this._detectStickyState(t[0])
|
|
26
28
|
});
|
|
27
29
|
}
|
|
28
30
|
/** Color of the container, like transparent, white etc. */
|
|
29
31
|
get color() {
|
|
30
|
-
return
|
|
32
|
+
return g(this, b);
|
|
31
33
|
}
|
|
32
34
|
set color(t) {
|
|
33
|
-
|
|
35
|
+
d(this, b, t);
|
|
36
|
+
}
|
|
37
|
+
/** The state of the component. */
|
|
38
|
+
set _state(t) {
|
|
39
|
+
this.setAttribute("data-state", t);
|
|
40
|
+
}
|
|
41
|
+
get _state() {
|
|
42
|
+
return this.getAttribute("data-state");
|
|
34
43
|
}
|
|
35
44
|
connectedCallback() {
|
|
36
|
-
super.connectedCallback();
|
|
45
|
+
super.connectedCallback(), this._state = "sticky", this.startUpdate();
|
|
37
46
|
const t = this.closest("sbb-container");
|
|
38
47
|
t && this.toggleAttribute("data-expanded", t.expanded), this._intersector && this._observer.observe(this._intersector);
|
|
39
48
|
}
|
|
49
|
+
disconnectedCallback() {
|
|
50
|
+
super.disconnectedCallback(), this.toggleAttribute("data-initialized", !1);
|
|
51
|
+
}
|
|
40
52
|
firstUpdated(t) {
|
|
41
53
|
super.firstUpdated(t), this._intersector || (this._intersector = this.shadowRoot.querySelector(".sbb-sticky-bar__intersector"), this._observer.observe(this._intersector)), this._observer.observe(this);
|
|
42
54
|
}
|
|
43
|
-
|
|
44
|
-
|
|
55
|
+
_detectStickyState(t) {
|
|
56
|
+
var m;
|
|
57
|
+
this.toggleAttribute("data-initialized", !0);
|
|
58
|
+
const o = !t.isIntersecting && t.boundingClientRect.top > 0, l = (m = this._intersector) == null ? void 0 : m.getBoundingClientRect(), x = this.shadowRoot.querySelector(".sbb-sticky-bar__wrapper").getBoundingClientRect();
|
|
59
|
+
this.toggleAttribute("data-slide-vertically", o && this._intersector && Math.abs(l.bottom - x.bottom) > 30), this.toggleAttribute("data-sticking", o), this.completeUpdate();
|
|
60
|
+
}
|
|
61
|
+
/** Animates from normal content flow position to `position: sticky`. */
|
|
62
|
+
stick() {
|
|
63
|
+
this._state !== "unsticky" || !this._willStick.emit() || (this._state = "sticking", this.hasAttribute("data-sticking") || this._stickyCallback());
|
|
64
|
+
}
|
|
65
|
+
/** Animates `position: sticky` to normal content flow position. */
|
|
66
|
+
unstick() {
|
|
67
|
+
this._state !== "sticky" || !this._willUnstick.emit() || (this._state = "unsticking", this.hasAttribute("data-sticking") || this._unstickyCallback());
|
|
68
|
+
}
|
|
69
|
+
_stickyCallback() {
|
|
70
|
+
this._state = "sticky", this._didStick.emit();
|
|
71
|
+
}
|
|
72
|
+
_unstickyCallback() {
|
|
73
|
+
this._didUnstick.emit(), this._state = "unsticky";
|
|
74
|
+
}
|
|
75
|
+
_onAnimationEnd(t) {
|
|
76
|
+
(this._state === "sticking" || this._state === "sticky") && t.animationName === "slide-in" ? this._stickyCallback() : this._state === "unsticking" && t.animationName === "slide-out" && this._unstickyCallback();
|
|
45
77
|
}
|
|
46
78
|
render() {
|
|
47
|
-
return
|
|
48
|
-
<div class="sbb-sticky-bar__wrapper">
|
|
79
|
+
return E`
|
|
80
|
+
<div class="sbb-sticky-bar__wrapper" @animationend=${this._onAnimationEnd}>
|
|
49
81
|
<div class="sbb-sticky-bar">
|
|
50
82
|
<slot></slot>
|
|
51
83
|
</div>
|
|
@@ -53,13 +85,19 @@ let U = (() => {
|
|
|
53
85
|
<div class="sbb-sticky-bar__intersector"></div>
|
|
54
86
|
`;
|
|
55
87
|
}
|
|
56
|
-
},
|
|
57
|
-
const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
} }, metadata: t },
|
|
61
|
-
})(),
|
|
88
|
+
}, b = new WeakMap(), e = r, (() => {
|
|
89
|
+
const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(y[Symbol.metadata] ?? null) : void 0;
|
|
90
|
+
u = [A({ reflect: !0 })], w(r, null, u, { kind: "accessor", name: "color", static: !1, private: !1, access: { has: (o) => "color" in o, get: (o) => o.color, set: (o, l) => {
|
|
91
|
+
o.color = l;
|
|
92
|
+
} }, metadata: t }, h, v), w(null, i = { value: e }, a, { kind: "class", name: e.name, metadata: t }, null, s), n = e = i.value, t && Object.defineProperty(e, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: t });
|
|
93
|
+
})(), r.styles = T, r.events = {
|
|
94
|
+
willStick: "willStick",
|
|
95
|
+
didStick: "didStick",
|
|
96
|
+
willUnstick: "willUnstick",
|
|
97
|
+
didUnstick: "didUnstick"
|
|
98
|
+
}, k(e, s), r);
|
|
99
|
+
return n = e;
|
|
62
100
|
})();
|
|
63
101
|
export {
|
|
64
|
-
|
|
102
|
+
M as SbbStickyBarElement
|
|
65
103
|
};
|
|
@@ -26,5 +26,6 @@ export declare abstract class SbbLinkBaseElement extends SbbActionBaseElement {
|
|
|
26
26
|
private _evaluateRelAttribute;
|
|
27
27
|
/** Default render method for link-like components. Can be overridden if the LinkRenderVariables are not needed. */
|
|
28
28
|
protected render(): TemplateResult;
|
|
29
|
+
protected renderLink(renderContent: TemplateResult): TemplateResult;
|
|
29
30
|
}
|
|
30
31
|
//# sourceMappingURL=link-base-element.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link-base-element.d.ts","sourceRoot":"","sources":["../../../../src/elements/core/base-elements/link-base-element.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAGnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAI1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,OAAO,6BAA6B,CAAC;AAErC,0DAA0D;AAC1D,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAErE,uBAAuB;AACvB,8BAIe,kBAAmB,SAAQ,oBAAoB;IAC5D,0CAA0C;IAC1C,SAEgB,IAAI,EAAE,MAAM,CAAM;IAElC,uCAAuC;IACvC,SAEgB,MAAM,EAAE,cAAc,GAAG,MAAM,CAAM;IAErD,wEAAwE;IACxE,SAEgB,GAAG,EAAE,MAAM,CAAM;IAEjC,kEAAkE;IAClE,SAEgB,QAAQ,EAAE,OAAO,CAAS;IAE1C,wEAAwE;IACxE,SAEgB,kBAAkB,EAAE,MAAM,CAAM;IAEhD,SAAS,CAAC,QAAQ,wBAAmC;;IASrD,gBAAgB;IACA,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,SAAS,GAAG,IAAI;IAI/D,gBAAgB;IACA,IAAI,IAAI,IAAI;IAI5B,gBAAgB;IACA,KAAK,IAAI,IAAI;IAI7B,OAAO,CAAC,qBAAqB,CAE3B;IAEF,mHAAmH;cAChG,MAAM,IAAI,cAAc;
|
|
1
|
+
{"version":3,"file":"link-base-element.d.ts","sourceRoot":"","sources":["../../../../src/elements/core/base-elements/link-base-element.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAGnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAI1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,OAAO,6BAA6B,CAAC;AAErC,0DAA0D;AAC1D,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAErE,uBAAuB;AACvB,8BAIe,kBAAmB,SAAQ,oBAAoB;IAC5D,0CAA0C;IAC1C,SAEgB,IAAI,EAAE,MAAM,CAAM;IAElC,uCAAuC;IACvC,SAEgB,MAAM,EAAE,cAAc,GAAG,MAAM,CAAM;IAErD,wEAAwE;IACxE,SAEgB,GAAG,EAAE,MAAM,CAAM;IAEjC,kEAAkE;IAClE,SAEgB,QAAQ,EAAE,OAAO,CAAS;IAE1C,wEAAwE;IACxE,SAEgB,kBAAkB,EAAE,MAAM,CAAM;IAEhD,SAAS,CAAC,QAAQ,wBAAmC;;IASrD,gBAAgB;IACA,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,SAAS,GAAG,IAAI;IAI/D,gBAAgB;IACA,IAAI,IAAI,IAAI;IAI5B,gBAAgB;IACA,KAAK,IAAI,IAAI;IAI7B,OAAO,CAAC,qBAAqB,CAE3B;IAEF,mHAAmH;cAChG,MAAM,IAAI,cAAc;IAI3C,SAAS,CAAC,UAAU,CAAC,aAAa,EAAE,cAAc,GAAG,cAAc;CAqBpE"}
|
package/core/base-elements.js
CHANGED
|
@@ -2,7 +2,7 @@ var H = (l) => {
|
|
|
2
2
|
throw TypeError(l);
|
|
3
3
|
};
|
|
4
4
|
var M = (l, r, n) => r.has(l) || H("Cannot " + n);
|
|
5
|
-
var S = (l, r, n) => (M(l, r, "read from private field"), n ? n.call(l) : r.get(l)), E = (l, r, n) => r.has(l) ? H("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(l) : r.set(l, n), h = (l, r, n,
|
|
5
|
+
var S = (l, r, n) => (M(l, r, "read from private field"), n ? n.call(l) : r.get(l)), E = (l, r, n) => r.has(l) ? H("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(l) : r.set(l, n), h = (l, r, n, i) => (M(l, r, "write to private field"), i ? i.call(l, n) : r.set(l, n), n);
|
|
6
6
|
import { __esDecorate as b, __runInitializers as o } from "tslib";
|
|
7
7
|
import { html as P, LitElement as W, isServer as F, nothing as C } from "lit";
|
|
8
8
|
import { hostAttributes as q, forceType as x } from "./decorators.js";
|
|
@@ -15,7 +15,7 @@ let G = (() => {
|
|
|
15
15
|
var u;
|
|
16
16
|
let l = [q({
|
|
17
17
|
"data-action": ""
|
|
18
|
-
})], r, n = [],
|
|
18
|
+
})], r, n = [], i, g = W;
|
|
19
19
|
return u = class extends g {
|
|
20
20
|
get maybeDisabled() {
|
|
21
21
|
const d = this;
|
|
@@ -46,17 +46,17 @@ let G = (() => {
|
|
|
46
46
|
render() {
|
|
47
47
|
return P` <span class="sbb-action-base ${this.localName}">${this.renderTemplate()}</span> `;
|
|
48
48
|
}
|
|
49
|
-
},
|
|
49
|
+
}, i = u, (() => {
|
|
50
50
|
const d = typeof Symbol == "function" && Symbol.metadata ? Object.create(g[Symbol.metadata] ?? null) : void 0;
|
|
51
|
-
b(null, r = { value:
|
|
52
|
-
})(),
|
|
51
|
+
b(null, r = { value: i }, l, { kind: "class", name: i.name, metadata: d }, null, n), i = r.value, d && Object.defineProperty(i, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: d }), o(i, n);
|
|
52
|
+
})(), i;
|
|
53
53
|
})(), le = (() => {
|
|
54
54
|
var _, f, m;
|
|
55
55
|
let l = [q({
|
|
56
56
|
role: "button",
|
|
57
57
|
tabindex: "0",
|
|
58
58
|
"data-button": ""
|
|
59
|
-
})], r, n = [],
|
|
59
|
+
})], r, n = [], i, g = G, u = [], z, d = [], D = [], O, $, A, T = [], B = [];
|
|
60
60
|
return m = class extends g {
|
|
61
61
|
constructor() {
|
|
62
62
|
super();
|
|
@@ -138,7 +138,7 @@ let G = (() => {
|
|
|
138
138
|
attributeChangedCallback(e, t, c) {
|
|
139
139
|
(!["name", "value"].includes(e) || t !== c) && super.attributeChangedCallback(e, t, c);
|
|
140
140
|
}
|
|
141
|
-
}, _ = new WeakMap(), f = new WeakMap(),
|
|
141
|
+
}, _ = new WeakMap(), f = new WeakMap(), i = m, (() => {
|
|
142
142
|
const e = typeof Symbol == "function" && Symbol.metadata ? Object.create(g[Symbol.metadata] ?? null) : void 0;
|
|
143
143
|
z = [v()], O = [v()], $ = [v()], A = [x(), v()], b(m, null, z, { kind: "accessor", name: "type", static: !1, private: !1, access: { has: (t) => "type" in t, get: (t) => t.type, set: (t, c) => {
|
|
144
144
|
t.type = c;
|
|
@@ -148,13 +148,13 @@ let G = (() => {
|
|
|
148
148
|
t.value = c;
|
|
149
149
|
} }, metadata: e }, null, u), b(m, null, A, { kind: "accessor", name: "form", static: !1, private: !1, access: { has: (t) => "form" in t, get: (t) => t.form, set: (t, c) => {
|
|
150
150
|
t.form = c;
|
|
151
|
-
} }, metadata: e }, T, B), b(null, r = { value:
|
|
152
|
-
})(),
|
|
151
|
+
} }, metadata: e }, T, B), b(null, r = { value: i }, l, { kind: "class", name: i.name, metadata: e }, null, n), i = r.value, e && Object.defineProperty(i, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: e }), o(i, n);
|
|
152
|
+
})(), i;
|
|
153
153
|
})(), ne = (() => {
|
|
154
|
-
var t, c, k, w,
|
|
154
|
+
var t, c, k, w, I, p;
|
|
155
155
|
let l = [q({
|
|
156
156
|
"data-link": ""
|
|
157
|
-
})], r, n = [],
|
|
157
|
+
})], r, n = [], i, g = G, u, z = [], d = [], D, O = [], $ = [], A, T = [], B = [], _, f = [], m = [], j, R = [], e = [];
|
|
158
158
|
return p = class extends g {
|
|
159
159
|
constructor() {
|
|
160
160
|
super();
|
|
@@ -162,61 +162,64 @@ let G = (() => {
|
|
|
162
162
|
E(this, c);
|
|
163
163
|
E(this, k);
|
|
164
164
|
E(this, w);
|
|
165
|
-
E(this,
|
|
166
|
-
h(this, t, o(this, z, "")), h(this, c, (o(this, d), o(this, O, ""))), h(this, k, (o(this, $), o(this, T, ""))), h(this, w, (o(this, B), o(this, f, !1))), h(this,
|
|
165
|
+
E(this, I);
|
|
166
|
+
h(this, t, o(this, z, "")), h(this, c, (o(this, d), o(this, O, ""))), h(this, k, (o(this, $), o(this, T, ""))), h(this, w, (o(this, B), o(this, f, !1))), h(this, I, (o(this, m), o(this, R, ""))), this.language = (o(this, e), new Q(this)), this._evaluateRelAttribute = () => this.rel ? this.rel : this.target === "_blank" ? "external noopener nofollow" : C, F || this.setupBaseEventHandlers();
|
|
167
167
|
}
|
|
168
168
|
/** The href value you want to link to. */
|
|
169
169
|
get href() {
|
|
170
170
|
return S(this, t);
|
|
171
171
|
}
|
|
172
|
-
set href(
|
|
173
|
-
h(this, t,
|
|
172
|
+
set href(s) {
|
|
173
|
+
h(this, t, s);
|
|
174
174
|
}
|
|
175
175
|
/** Where to display the linked URL. */
|
|
176
176
|
get target() {
|
|
177
177
|
return S(this, c);
|
|
178
178
|
}
|
|
179
|
-
set target(
|
|
180
|
-
h(this, c,
|
|
179
|
+
set target(s) {
|
|
180
|
+
h(this, c, s);
|
|
181
181
|
}
|
|
182
182
|
/** The relationship of the linked URL as space-separated link types. */
|
|
183
183
|
get rel() {
|
|
184
184
|
return S(this, k);
|
|
185
185
|
}
|
|
186
|
-
set rel(
|
|
187
|
-
h(this, k,
|
|
186
|
+
set rel(s) {
|
|
187
|
+
h(this, k, s);
|
|
188
188
|
}
|
|
189
189
|
/** Whether the browser will show the download dialog on click. */
|
|
190
190
|
get download() {
|
|
191
191
|
return S(this, w);
|
|
192
192
|
}
|
|
193
|
-
set download(
|
|
194
|
-
h(this, w,
|
|
193
|
+
set download(s) {
|
|
194
|
+
h(this, w, s);
|
|
195
195
|
}
|
|
196
196
|
/** This will be forwarded as aria-label to the inner anchor element. */
|
|
197
197
|
get accessibilityLabel() {
|
|
198
|
-
return S(this,
|
|
198
|
+
return S(this, I);
|
|
199
199
|
}
|
|
200
|
-
set accessibilityLabel(
|
|
201
|
-
h(this,
|
|
200
|
+
set accessibilityLabel(s) {
|
|
201
|
+
h(this, I, s);
|
|
202
202
|
}
|
|
203
203
|
/** @internal */
|
|
204
|
-
focus(
|
|
204
|
+
focus(s) {
|
|
205
205
|
var a;
|
|
206
|
-
(a = this.shadowRoot.querySelector("a")) == null || a.focus(
|
|
206
|
+
(a = this.shadowRoot.querySelector("a")) == null || a.focus(s);
|
|
207
207
|
}
|
|
208
208
|
/** @internal */
|
|
209
209
|
blur() {
|
|
210
|
-
var
|
|
211
|
-
(
|
|
210
|
+
var s;
|
|
211
|
+
(s = this.shadowRoot.querySelector("a")) == null || s.blur();
|
|
212
212
|
}
|
|
213
213
|
/** @internal */
|
|
214
214
|
click() {
|
|
215
|
-
var
|
|
216
|
-
(
|
|
215
|
+
var s;
|
|
216
|
+
(s = this.shadowRoot.querySelector("a")) == null || s.click();
|
|
217
217
|
}
|
|
218
218
|
/** Default render method for link-like components. Can be overridden if the LinkRenderVariables are not needed. */
|
|
219
219
|
render() {
|
|
220
|
+
return this.renderLink(this.renderTemplate());
|
|
221
|
+
}
|
|
222
|
+
renderLink(s) {
|
|
220
223
|
return P`
|
|
221
224
|
<a
|
|
222
225
|
class="sbb-action-base ${this.localName}"
|
|
@@ -228,31 +231,31 @@ let G = (() => {
|
|
|
228
231
|
tabindex=${this.maybeDisabled && !this.maybeDisabledInteractive ? "-1" : C}
|
|
229
232
|
aria-disabled=${this.maybeDisabled ? "true" : C}
|
|
230
233
|
>
|
|
231
|
-
${
|
|
234
|
+
${s}
|
|
232
235
|
${this.href && this.target === "_blank" ? P`<sbb-screen-reader-only
|
|
233
236
|
>. ${U[this.language.current]}</sbb-screen-reader-only
|
|
234
237
|
>` : C}
|
|
235
238
|
</a>
|
|
236
239
|
`;
|
|
237
240
|
}
|
|
238
|
-
}, t = new WeakMap(), c = new WeakMap(), k = new WeakMap(), w = new WeakMap(),
|
|
239
|
-
const
|
|
241
|
+
}, t = new WeakMap(), c = new WeakMap(), k = new WeakMap(), w = new WeakMap(), I = new WeakMap(), i = p, (() => {
|
|
242
|
+
const s = typeof Symbol == "function" && Symbol.metadata ? Object.create(g[Symbol.metadata] ?? null) : void 0;
|
|
240
243
|
u = [x(), v()], D = [x(), v()], A = [x(), v()], _ = [x(), v({ type: Boolean })], j = [x(), v({ attribute: "accessibility-label" })], b(p, null, u, { kind: "accessor", name: "href", static: !1, private: !1, access: { has: (a) => "href" in a, get: (a) => a.href, set: (a, y) => {
|
|
241
244
|
a.href = y;
|
|
242
|
-
} }, metadata:
|
|
245
|
+
} }, metadata: s }, z, d), b(p, null, D, { kind: "accessor", name: "target", static: !1, private: !1, access: { has: (a) => "target" in a, get: (a) => a.target, set: (a, y) => {
|
|
243
246
|
a.target = y;
|
|
244
|
-
} }, metadata:
|
|
247
|
+
} }, metadata: s }, O, $), b(p, null, A, { kind: "accessor", name: "rel", static: !1, private: !1, access: { has: (a) => "rel" in a, get: (a) => a.rel, set: (a, y) => {
|
|
245
248
|
a.rel = y;
|
|
246
|
-
} }, metadata:
|
|
249
|
+
} }, metadata: s }, T, B), b(p, null, _, { kind: "accessor", name: "download", static: !1, private: !1, access: { has: (a) => "download" in a, get: (a) => a.download, set: (a, y) => {
|
|
247
250
|
a.download = y;
|
|
248
|
-
} }, metadata:
|
|
251
|
+
} }, metadata: s }, f, m), b(p, null, j, { kind: "accessor", name: "accessibilityLabel", static: !1, private: !1, access: { has: (a) => "accessibilityLabel" in a, get: (a) => a.accessibilityLabel, set: (a, y) => {
|
|
249
252
|
a.accessibilityLabel = y;
|
|
250
|
-
} }, metadata:
|
|
251
|
-
})(),
|
|
253
|
+
} }, metadata: s }, R, e), b(null, r = { value: i }, l, { kind: "class", name: i.name, metadata: s }, null, n), i = r.value, s && Object.defineProperty(i, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: s }), o(i, n);
|
|
254
|
+
})(), i;
|
|
252
255
|
})();
|
|
253
|
-
const
|
|
256
|
+
const L = class L extends W {
|
|
254
257
|
constructor() {
|
|
255
|
-
super(...arguments), this.willOpen = new K(this,
|
|
258
|
+
super(...arguments), this.willOpen = new K(this, L.events.willOpen), this.didOpen = new K(this, L.events.didOpen), this.willClose = new K(this, L.events.willClose), this.didClose = new K(this, L.events.didClose);
|
|
256
259
|
}
|
|
257
260
|
/** The state of the component. */
|
|
258
261
|
set state(r) {
|
|
@@ -269,13 +272,13 @@ const I = class I extends W {
|
|
|
269
272
|
super.connectedCallback(), this.state || (this.state = "closed");
|
|
270
273
|
}
|
|
271
274
|
};
|
|
272
|
-
|
|
275
|
+
L.events = {
|
|
273
276
|
willOpen: "willOpen",
|
|
274
277
|
didOpen: "didOpen",
|
|
275
278
|
willClose: "willClose",
|
|
276
279
|
didClose: "didClose"
|
|
277
280
|
};
|
|
278
|
-
let N =
|
|
281
|
+
let N = L;
|
|
279
282
|
export {
|
|
280
283
|
G as SbbActionBaseElement,
|
|
281
284
|
le as SbbButtonBaseElement,
|
package/core/config/config.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/elements/core/config/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,MAAM,WAAW,aAAa;IAC5B,WAAW,CAAC,EAAE,CAAC,UAAU,EAAE;QACzB,SAAS,EAAE,MAAM,CAAC;QAClB,IAAI,EAAE,MAAM,CAAC;QACb,GAAG,EAAE,MAAM,CAAC;QACZ,OAAO,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;KAChC,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACtB,UAAU,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,iBAAiB;IAChC,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAED,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CAC9B;AAED,wBAAgB,UAAU,IAAI,SAAS,CAKtC;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,IAAI,CAG5D"}
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/elements/core/config/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,MAAM,WAAW,aAAa;IAC5B,WAAW,CAAC,EAAE,CAAC,UAAU,EAAE;QACzB,SAAS,EAAE,MAAM,CAAC;QAClB,IAAI,EAAE,MAAM,CAAC;QACb,GAAG,EAAE,MAAM,CAAC;QACZ,OAAO,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;KAChC,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACtB,UAAU,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,iBAAiB;IAChC,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAED,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CAC9B;AAED,wBAAgB,UAAU,IAAI,SAAS,CAKtC;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,IAAI,CAG5D;AAED,OAAO,CAAC,MAAM,CAAC;IAGb,IAAI,SAAS,EAAE,SAAS,CAAC;CAC1B"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
|
+
export declare const SbbMediaQueryForcedColors = "(forced-colors: active)";
|
|
3
|
+
export declare const SbbMediaQueryHover = "(any-hover: hover)";
|
|
4
|
+
export declare const SbbMediaQueryPointerCoarse = "(pointer: coarse)";
|
|
5
|
+
export declare const SbbMediaQueryBreakpointMediumAndAbove: string;
|
|
6
|
+
export declare const SbbMediaQueryBreakpointSmallAndBelow: string;
|
|
7
|
+
/**
|
|
8
|
+
* A callback, which is invoked when the associated media query match
|
|
9
|
+
* status changes.
|
|
10
|
+
*/
|
|
11
|
+
export type SbbMediaMatcherHandler = (matches: boolean) => void;
|
|
12
|
+
/**
|
|
13
|
+
* This controller allows listening to media query changes.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* new SbbMediaMatcherController(this, {
|
|
17
|
+
* [SbbForcedColorsQuery]: (matches) => doSomething(matches),
|
|
18
|
+
* })
|
|
19
|
+
*/
|
|
20
|
+
export declare class SbbMediaMatcherController implements ReactiveController {
|
|
21
|
+
private _queries;
|
|
22
|
+
constructor(host: ReactiveControllerHost, _queries: Record<string, SbbMediaMatcherHandler>);
|
|
23
|
+
/**
|
|
24
|
+
* Returns whether the given query matches. Returns null with SSR.
|
|
25
|
+
* @param query The query to check against.
|
|
26
|
+
* @returns Whether the query matches or null with SSR.
|
|
27
|
+
*/
|
|
28
|
+
matches(query: string): boolean | null;
|
|
29
|
+
hostConnected(): void;
|
|
30
|
+
hostDisconnected(): void;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=media-matchers-controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media-matchers-controller.d.ts","sourceRoot":"","sources":["../../../../src/elements/core/controllers/media-matchers-controller.ts"],"names":[],"mappings":"AAKA,OAAO,EAAY,KAAK,kBAAkB,EAAE,KAAK,sBAAsB,EAAE,MAAM,KAAK,CAAC;AAKrF,eAAO,MAAM,yBAAyB,4BAA4B,CAAC;AACnE,eAAO,MAAM,kBAAkB,uBAAuB,CAAC;AACvD,eAAO,MAAM,0BAA0B,sBAAsB,CAAC;AAC9D,eAAO,MAAM,qCAAqC,QAAuD,CAAC;AAC1G,eAAO,MAAM,oCAAoC,QAAsD,CAAC;AAGxG;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;AAehE;;;;;;;GAOG;AACH,qBAAa,yBAA0B,YAAW,kBAAkB;IAGhE,OAAO,CAAC,QAAQ;gBADhB,IAAI,EAAE,sBAAsB,EACpB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC;IAK1D;;;;OAIG;IACI,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI;IAYtC,aAAa,IAAI,IAAI;IAoBrB,gBAAgB,IAAI,IAAI;CAWhC"}
|
package/core/controllers.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './controllers/connected-abort-controller.js';
|
|
2
2
|
export * from './controllers/inert-controller.js';
|
|
3
3
|
export * from './controllers/language-controller.js';
|
|
4
|
+
export * from './controllers/media-matchers-controller.js';
|
|
4
5
|
export * from './controllers/slot-state-controller.js';
|
|
5
6
|
//# sourceMappingURL=controllers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controllers.d.ts","sourceRoot":"","sources":["../../../src/elements/core/controllers.ts"],"names":[],"mappings":"AAAA,cAAc,6CAA6C,CAAC;AAC5D,cAAc,mCAAmC,CAAC;AAClD,cAAc,sCAAsC,CAAC;AACrD,cAAc,wCAAwC,CAAC"}
|
|
1
|
+
{"version":3,"file":"controllers.d.ts","sourceRoot":"","sources":["../../../src/elements/core/controllers.ts"],"names":[],"mappings":"AAAA,cAAc,6CAA6C,CAAC;AAC5D,cAAc,mCAAmC,CAAC;AAClD,cAAc,sCAAsC,CAAC;AACrD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,wCAAwC,CAAC"}
|
package/core/controllers.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { isServer as n } from "lit";
|
|
2
|
-
import { readConfig as
|
|
3
|
-
|
|
2
|
+
import { readConfig as b } from "./config.js";
|
|
3
|
+
import { S as f, g as m, f as v } from "../sbb-tokens-Dx20OtVg.js";
|
|
4
|
+
class S {
|
|
4
5
|
get signal() {
|
|
5
6
|
var t;
|
|
6
7
|
return (t = this._abortController) == null ? void 0 : t.signal;
|
|
@@ -16,11 +17,11 @@ class m {
|
|
|
16
17
|
(t = this._abortController) == null || t.abort(), this._abortController = void 0;
|
|
17
18
|
}
|
|
18
19
|
}
|
|
19
|
-
const
|
|
20
|
-
class
|
|
21
|
-
constructor(t,
|
|
20
|
+
const g = ["script", "head", "template", "style"], y = /* @__PURE__ */ new Set(), A = /* @__PURE__ */ new Set();
|
|
21
|
+
class O {
|
|
22
|
+
constructor(t, e = y, i = A) {
|
|
22
23
|
var s, o;
|
|
23
|
-
this._host = t, this._inertElements =
|
|
24
|
+
this._host = t, this._inertElements = e, this._inertOverlays = i, (o = (s = this._host).addController) == null || o.call(s, this);
|
|
24
25
|
}
|
|
25
26
|
hostConnected() {
|
|
26
27
|
this._host.isOpen && this.activate();
|
|
@@ -49,23 +50,23 @@ class A {
|
|
|
49
50
|
}), this._inertElements.clear();
|
|
50
51
|
}
|
|
51
52
|
_addInertAttributes() {
|
|
52
|
-
var
|
|
53
|
+
var e, i;
|
|
53
54
|
let t = this._currentOverlay();
|
|
54
55
|
for (; t !== document.documentElement && t !== null; )
|
|
55
|
-
Array.from(((
|
|
56
|
+
Array.from(((e = (t == null ? void 0 : t.parentElement) ?? (t == null ? void 0 : t.getRootNode())) == null ? void 0 : e.childNodes) ?? []).filter((s) => s !== t && s instanceof window.HTMLElement && !g.includes(s.localName)).forEach((s) => {
|
|
56
57
|
this._inertElements.add(s), s.inert || (s.inert = !0, s.toggleAttribute("data-sbb-inert", !0)), s.hasAttribute("aria-hidden") || (s.setAttribute("aria-hidden", "true"), s.toggleAttribute("data-sbb-aria-hidden", !0));
|
|
57
|
-
}), t = (t == null ? void 0 : t.parentElement) ?? ((
|
|
58
|
+
}), t = (t == null ? void 0 : t.parentElement) ?? ((i = t == null ? void 0 : t.getRootNode()) == null ? void 0 : i.host) ?? null;
|
|
58
59
|
}
|
|
59
60
|
}
|
|
60
|
-
const
|
|
61
|
+
const r = class r {
|
|
61
62
|
/** Get the current language. */
|
|
62
63
|
static get current() {
|
|
63
|
-
const
|
|
64
|
-
return
|
|
64
|
+
const e = ((b().language ?? (n ? r._defaultLanguage : document.documentElement.getAttribute("lang"))) || r._defaultLanguage).split("-")[0];
|
|
65
|
+
return r._supportedLocales.includes(e) ? e : r._defaultLanguage;
|
|
65
66
|
}
|
|
66
67
|
/** Get the current language. */
|
|
67
68
|
get current() {
|
|
68
|
-
return
|
|
69
|
+
return r.current;
|
|
69
70
|
}
|
|
70
71
|
constructor(t) {
|
|
71
72
|
this._host = t, this._handlers = [], this._host.addController(this);
|
|
@@ -75,26 +76,61 @@ const e = class e {
|
|
|
75
76
|
return this._handlers.unshift(t), this;
|
|
76
77
|
}
|
|
77
78
|
hostConnected() {
|
|
78
|
-
n || (
|
|
79
|
+
n || (r._listeners.size || r._observer.observe(document.documentElement, r._observerConfig), r._listeners.add(this), this._previousLanguage !== this.current && this._callHandlers(this._previousLanguage !== void 0));
|
|
79
80
|
}
|
|
80
81
|
hostDisconnected() {
|
|
81
|
-
n || (this._previousLanguage = this.current,
|
|
82
|
+
n || (this._previousLanguage = this.current, r._listeners.delete(this), r._listeners.size || r._observer.disconnect());
|
|
82
83
|
}
|
|
83
84
|
_callHandlers(t = !0) {
|
|
84
|
-
this._handlers.forEach((
|
|
85
|
+
this._handlers.forEach((e) => e()), t && this._host.requestUpdate();
|
|
85
86
|
}
|
|
86
87
|
};
|
|
87
|
-
|
|
88
|
-
t[0].oldValue !== document.documentElement.getAttribute("lang") &&
|
|
89
|
-
}),
|
|
88
|
+
r._defaultLanguage = "en", r._supportedLocales = ["en", "de", "fr", "it"], r._listeners = /* @__PURE__ */ new Set(), r._observer = n ? null : new MutationObserver((t) => {
|
|
89
|
+
t[0].oldValue !== document.documentElement.getAttribute("lang") && r._listeners.forEach((e) => e._callHandlers());
|
|
90
|
+
}), r._observerConfig = {
|
|
90
91
|
attributeFilter: ["lang"],
|
|
91
92
|
attributeOldValue: !0
|
|
92
93
|
};
|
|
93
|
-
let
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
94
|
+
let u = r;
|
|
95
|
+
const _ = (a) => a / f, w = "(forced-colors: active)", M = "(any-hover: hover)", N = "(pointer: coarse)", Q = `(min-width: ${_(m)}rem)`, H = `(max-width: ${_(v)}rem)`, l = /* @__PURE__ */ new Map();
|
|
96
|
+
class L {
|
|
97
|
+
constructor(t, e) {
|
|
98
|
+
this._queries = e, t.addController(this);
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Returns whether the given query matches. Returns null with SSR.
|
|
102
|
+
* @param query The query to check against.
|
|
103
|
+
* @returns Whether the query matches or null with SSR.
|
|
104
|
+
*/
|
|
105
|
+
matches(t) {
|
|
106
|
+
if (n)
|
|
107
|
+
return null;
|
|
108
|
+
const e = l.get(t);
|
|
109
|
+
return e ? e.mediaQueryList.matches : matchMedia(t).matches;
|
|
110
|
+
}
|
|
111
|
+
hostConnected() {
|
|
112
|
+
if (!n)
|
|
113
|
+
for (const [t, e] of Object.entries(this._queries)) {
|
|
114
|
+
const i = l.get(t);
|
|
115
|
+
if (i)
|
|
116
|
+
i.handlers.add(e);
|
|
117
|
+
else {
|
|
118
|
+
const s = matchMedia(t), o = /* @__PURE__ */ new Set([e]), h = (d) => o.forEach((c) => c(d.matches));
|
|
119
|
+
s.addEventListener("change", h), l.set(t, { mediaQueryList: s, handlers: o, eventHandler: h });
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
hostDisconnected() {
|
|
124
|
+
for (const [t, e] of Object.entries(this._queries)) {
|
|
125
|
+
const i = l.get(t);
|
|
126
|
+
i && (i.handlers.delete(e), i.handlers.size || l.delete(t));
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
class I {
|
|
131
|
+
constructor(t, e = null) {
|
|
132
|
+
this._host = t, this._onChangeCallback = e, this.slots = /* @__PURE__ */ new Set(), this._slotchangeHandler = (i) => {
|
|
133
|
+
this._syncSlots(i.target);
|
|
98
134
|
}, this._host.addController(this);
|
|
99
135
|
}
|
|
100
136
|
hostConnected() {
|
|
@@ -109,18 +145,24 @@ class C {
|
|
|
109
145
|
var s;
|
|
110
146
|
for (const o of t) {
|
|
111
147
|
const h = o.name || "unnamed";
|
|
112
|
-
o.assignedNodes().some((
|
|
113
|
-
var
|
|
114
|
-
return "tagName" in
|
|
148
|
+
o.assignedNodes().some((d) => {
|
|
149
|
+
var c;
|
|
150
|
+
return "tagName" in d || ((c = d.textContent) == null ? void 0 : c.trim());
|
|
115
151
|
}) ? this.slots.add(h) : this.slots.delete(h);
|
|
116
152
|
}
|
|
117
|
-
const
|
|
118
|
-
|
|
153
|
+
const e = this._host.getAttribute("data-slot-names"), i = [...this.slots].sort().join(" ");
|
|
154
|
+
i ? this._host.getAttribute("data-slot-names") !== i && this._host.setAttribute("data-slot-names", i) : this._host.removeAttribute("data-slot-names"), i !== e && ((s = this._onChangeCallback) == null || s.call(this));
|
|
119
155
|
}
|
|
120
156
|
}
|
|
121
157
|
export {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
158
|
+
S as SbbConnectedAbortController,
|
|
159
|
+
O as SbbInertController,
|
|
160
|
+
u as SbbLanguageController,
|
|
161
|
+
L as SbbMediaMatcherController,
|
|
162
|
+
Q as SbbMediaQueryBreakpointMediumAndAbove,
|
|
163
|
+
H as SbbMediaQueryBreakpointSmallAndBelow,
|
|
164
|
+
w as SbbMediaQueryForcedColors,
|
|
165
|
+
M as SbbMediaQueryHover,
|
|
166
|
+
N as SbbMediaQueryPointerCoarse,
|
|
167
|
+
I as SbbSlotStateController
|
|
126
168
|
};
|
package/core/dom/breakpoint.d.ts
CHANGED
|
@@ -6,9 +6,10 @@ export type Breakpoint = (typeof breakpoints)[number];
|
|
|
6
6
|
*
|
|
7
7
|
* @param from The breakpoint corresponding to the `min-width` value of the media query (optional).
|
|
8
8
|
* @param to The breakpoint corresponding to the `max-width` value of the media query (optional).
|
|
9
|
+
* @param properties Whether the max breakpoint should be included
|
|
9
10
|
* @returns A boolean indicating whether the window matches the breakpoint.
|
|
10
11
|
*/
|
|
11
12
|
export declare function isBreakpoint(from?: Breakpoint, to?: Breakpoint, properties?: {
|
|
12
13
|
includeMaxBreakpoint: boolean;
|
|
13
|
-
}): boolean;
|
|
14
|
+
}): boolean | null;
|
|
14
15
|
//# sourceMappingURL=breakpoint.d.ts.map
|