@sbb-esta/lyne-elements 1.14.0 → 1.15.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/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 +175 -178
- 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/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 +650 -74
- 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 +40 -44
- 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/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 +3 -1
- package/development/expansion-panel/expansion-panel-header/expansion-panel-header.d.ts.map +1 -1
- package/development/expansion-panel/expansion-panel-header.js +8 -4
- 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 +2 -7
- 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/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 +3 -1
- package/expansion-panel/expansion-panel-header/expansion-panel-header.d.ts.map +1 -1
- package/expansion-panel/expansion-panel-header.js +26 -24
- 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 +2 -2
- 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/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
|
@@ -31,7 +31,7 @@ export declare class SbbCheckboxPanelElement extends SbbCheckboxPanelElement_bas
|
|
|
31
31
|
* in relation to the parent selection panel changes.
|
|
32
32
|
*/
|
|
33
33
|
protected stateChange: EventEmitter<SbbCheckboxPanelStateChange>;
|
|
34
|
-
protected willUpdate(changedProperties: PropertyValues<this>):
|
|
34
|
+
protected willUpdate(changedProperties: PropertyValues<this>): void;
|
|
35
35
|
protected render(): TemplateResult;
|
|
36
36
|
}
|
|
37
37
|
declare global {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox-panel.d.ts","sourceRoot":"","sources":["../../../../src/elements/checkbox/checkbox-panel/checkbox-panel.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EAEnB,UAAU,EAEV,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,KAAK,CAAC;AAIb,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EACV,qBAAqB,EACrB,sBAAsB,EACtB,cAAc,EACf,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAGL,KAAK,YAAY,EAElB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,6BAA6B,CAAC;AACrC,OAAO,0BAA0B,CAAC;AAElC,MAAM,MAAM,2BAA2B,GAAG,OAAO,CAC/C,cAAc,EACd,sBAAsB,GAAG,qBAAqB,CAC/C,CAAC;;AAEF;;;;;;;;;;;GAWG;AACH,qBAGM,uBAAwB,SAAQ,4BAErC;IACC,OAAuB,MAAM,EAAE,cAAc,CAA2C;IAGxF,gBAAuB,MAAM;;;;MAIlB;IAEX,oBAAoB;IACpB,SAEgB,IAAI,EAAE,YAAY,CAAO;IAEzC;;;;OAIG;IACH,SAAS,CAAC,WAAW,EAAE,YAAY,CAAC,2BAA2B,CAAC,CAI9D;
|
|
1
|
+
{"version":3,"file":"checkbox-panel.d.ts","sourceRoot":"","sources":["../../../../src/elements/checkbox/checkbox-panel/checkbox-panel.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EAEnB,UAAU,EAEV,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,KAAK,CAAC;AAIb,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EACV,qBAAqB,EACrB,sBAAsB,EACtB,cAAc,EACf,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAGL,KAAK,YAAY,EAElB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,6BAA6B,CAAC;AACrC,OAAO,0BAA0B,CAAC;AAElC,MAAM,MAAM,2BAA2B,GAAG,OAAO,CAC/C,cAAc,EACd,sBAAsB,GAAG,qBAAqB,CAC/C,CAAC;;AAEF;;;;;;;;;;;GAWG;AACH,qBAGM,uBAAwB,SAAQ,4BAErC;IACC,OAAuB,MAAM,EAAE,cAAc,CAA2C;IAGxF,gBAAuB,MAAM;;;;MAIlB;IAEX,oBAAoB;IACpB,SAEgB,IAAI,EAAE,YAAY,CAAO;IAEzC;;;;OAIG;IACH,SAAS,CAAC,WAAW,EAAE,YAAY,CAAC,2BAA2B,CAAC,CAI9D;cAEiB,UAAU,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;cAkBzD,MAAM,IAAI,cAAc;CA8B5C;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,oBAAoB,EAAE,uBAAuB,CAAC;KAC/C;CACF"}
|
|
@@ -4,8 +4,8 @@ var k = (e) => {
|
|
|
4
4
|
var x = (e, t, s) => t.has(e) || k("Cannot " + s);
|
|
5
5
|
var f = (e, t, s) => (x(e, t, "read from private field"), s ? s.call(e) : t.get(e)), g = (e, t, s) => t.has(e) ? k("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s), b = (e, t, s, i) => (x(e, t, "write to private field"), i ? i.call(e, s) : t.set(e, s), s);
|
|
6
6
|
import { __runInitializers as h, __esDecorate as z } from "tslib";
|
|
7
|
-
import { LitElement as S, html as C, nothing as
|
|
8
|
-
import { customElement as
|
|
7
|
+
import { LitElement as S, html as C, nothing as v } from "lit";
|
|
8
|
+
import { customElement as y, property as E } from "lit/decorators.js";
|
|
9
9
|
import { slotState as w, getOverride as $ } from "../core/decorators.js";
|
|
10
10
|
import { EventEmitter as D } from "../core/eventing.js";
|
|
11
11
|
import { SbbPanelMixin as I, SbbUpdateSchedulerMixin as M, panelCommonStyle as O } from "../core/mixins.js";
|
|
@@ -14,7 +14,7 @@ import "../screen-reader-only.js";
|
|
|
14
14
|
import "../visual-checkbox.js";
|
|
15
15
|
let P = (() => {
|
|
16
16
|
var c, l;
|
|
17
|
-
let e = [
|
|
17
|
+
let e = [y("sbb-checkbox-panel"), w()], t, s = [], i, d = I(U(M(S))), m, p = [], u = [];
|
|
18
18
|
var o = (l = class extends d {
|
|
19
19
|
constructor() {
|
|
20
20
|
super(...arguments);
|
|
@@ -28,7 +28,7 @@ let P = (() => {
|
|
|
28
28
|
set size(a) {
|
|
29
29
|
b(this, c, a);
|
|
30
30
|
}
|
|
31
|
-
|
|
31
|
+
willUpdate(a) {
|
|
32
32
|
super.willUpdate(a), a.has("checked") && (this.toggleAttribute("data-checked", this.checked), this.checked !== a.get("checked") && this.stateChange.emit({ type: "checked", checked: this.checked })), a.has("disabled") && this.disabled !== a.get("disabled") && this.stateChange.emit({ type: "disabled", disabled: this.disabled });
|
|
33
33
|
}
|
|
34
34
|
render() {
|
|
@@ -53,7 +53,7 @@ let P = (() => {
|
|
|
53
53
|
</span>
|
|
54
54
|
</span>
|
|
55
55
|
<slot name="subtext"></slot>
|
|
56
|
-
${this.expansionState ? C`<sbb-screen-reader-only>${this.expansionState}</sbb-screen-reader-only>` :
|
|
56
|
+
${this.expansionState ? C`<sbb-screen-reader-only>${this.expansionState}</sbb-screen-reader-only>` : v}
|
|
57
57
|
</span>
|
|
58
58
|
</span>
|
|
59
59
|
</span>
|
package/checkbox/common.js
CHANGED
|
@@ -31,7 +31,7 @@ const q = (e) => (() => {
|
|
|
31
31
|
connectedCallback() {
|
|
32
32
|
super.connectedCallback(), this._group = this.closest("sbb-checkbox-group"), ["disabled", "required", "size"].forEach((t) => this.requestUpdate(t));
|
|
33
33
|
}
|
|
34
|
-
|
|
34
|
+
willUpdate(t) {
|
|
35
35
|
super.willUpdate(t), (t.has("checked") || t.has("indeterminate")) && (this.internals.ariaChecked = this.indeterminate ? "mixed" : `${this.checked}`);
|
|
36
36
|
}
|
|
37
37
|
isDisabledExternally() {
|
package/clock/clock.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export declare class SbbClockElement extends LitElement {
|
|
|
28
28
|
private _moveHoursHandFn;
|
|
29
29
|
/** Callback function for minutes hand. */
|
|
30
30
|
private _moveMinutesHandFn;
|
|
31
|
-
protected willUpdate(changedProperties: PropertyValues<this>):
|
|
31
|
+
protected willUpdate(changedProperties: PropertyValues<this>): void;
|
|
32
32
|
protected firstUpdated(changedProperties: PropertyValues<this>): Promise<void>;
|
|
33
33
|
disconnectedCallback(): void;
|
|
34
34
|
private _handlePageVisibilityChange;
|
package/clock/clock.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clock.d.ts","sourceRoot":"","sources":["../../../src/elements/clock/clock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAC1E,OAAO,EAAkB,UAAU,EAAE,MAAM,KAAK,CAAC;AAIjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AA2CrD;;GAEG;AACH,qBAEM,eAAgB,SAAQ,UAAU;IACtC,OAAuB,MAAM,EAAE,cAAc,CAAS;IAEtD;;;OAGG;IACH,SAA4B,GAAG,EAAE,OAAO,GAAG,IAAI,CAAQ;IAEvD,kCAAkC;IAClC,OAAO,CAAC,eAAe,CAAe;IAEtC,oCAAoC;IACpC,OAAO,CAAC,iBAAiB,CAAe;IAExC,oCAAoC;IACpC,OAAO,CAAC,iBAAiB,CAAe;IAExC,wCAAwC;IACxC,OAAO,CAAC,MAAM,CAAU;IAExB,0CAA0C;IAC1C,OAAO,CAAC,QAAQ,CAAU;IAE1B,0CAA0C;IAC1C,OAAO,CAAC,QAAQ,CAAU;IAE1B,0CAA0C;IAC1C,OAAO,CAAC,aAAa,CAAC,CAAiC;IAEvD,wCAAwC;IACxC,OAAO,CAAC,gBAAgB,CAAqC;IAE7D,0CAA0C;IAC1C,OAAO,CAAC,kBAAkB,CAAuC;
|
|
1
|
+
{"version":3,"file":"clock.d.ts","sourceRoot":"","sources":["../../../src/elements/clock/clock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAC1E,OAAO,EAAkB,UAAU,EAAE,MAAM,KAAK,CAAC;AAIjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AA2CrD;;GAEG;AACH,qBAEM,eAAgB,SAAQ,UAAU;IACtC,OAAuB,MAAM,EAAE,cAAc,CAAS;IAEtD;;;OAGG;IACH,SAA4B,GAAG,EAAE,OAAO,GAAG,IAAI,CAAQ;IAEvD,kCAAkC;IAClC,OAAO,CAAC,eAAe,CAAe;IAEtC,oCAAoC;IACpC,OAAO,CAAC,iBAAiB,CAAe;IAExC,oCAAoC;IACpC,OAAO,CAAC,iBAAiB,CAAe;IAExC,wCAAwC;IACxC,OAAO,CAAC,MAAM,CAAU;IAExB,0CAA0C;IAC1C,OAAO,CAAC,QAAQ,CAAU;IAE1B,0CAA0C;IAC1C,OAAO,CAAC,QAAQ,CAAU;IAE1B,0CAA0C;IAC1C,OAAO,CAAC,aAAa,CAAC,CAAiC;IAEvD,wCAAwC;IACxC,OAAO,CAAC,gBAAgB,CAAqC;IAE7D,0CAA0C;IAC1C,OAAO,CAAC,kBAAkB,CAAuC;cAE9C,UAAU,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;cAQnD,YAAY,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAS7E,oBAAoB,IAAI,IAAI;IAK5C,OAAO,CAAC,2BAA2B,CAMjC;YAEY,sBAAsB;IAUpC,6FAA6F;YAC/E,WAAW;IAsBzB,sDAAsD;YACxC,UAAU;IAcxB,uEAAuE;IACvE,OAAO,CAAC,yBAAyB;IA4CjC,yGAAyG;IACzG,OAAO,CAAC,kBAAkB;IAW1B,sDAAsD;IACtD,OAAO,CAAC,eAAe;IAOvB,6CAA6C;IAC7C,OAAO,CAAC,cAAc;IAYtB,+CAA+C;IAC/C,OAAO,CAAC,gBAAgB;IAaxB,OAAO,CAAC,sBAAsB;IAK9B;;;;OAIG;IACH,OAAO,CAAC,0BAA0B;IAWlC,OAAO,CAAC,qBAAqB;IAO7B,OAAO,CAAC,2BAA2B;IAMnC,OAAO,CAAC,6BAA6B;cAOlB,MAAM,IAAI,cAAc;CA4B5C;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,WAAW,EAAE,eAAe,CAAC;KAC9B;CACF"}
|
package/clock.js
CHANGED
|
@@ -36,8 +36,8 @@ let it = (() => {
|
|
|
36
36
|
set now(t) {
|
|
37
37
|
h(this, r, t);
|
|
38
38
|
}
|
|
39
|
-
|
|
40
|
-
super.willUpdate(t), !E && t.has("now") &&
|
|
39
|
+
willUpdate(t) {
|
|
40
|
+
super.willUpdate(t), !E && t.has("now") && this._startOrConfigureClock();
|
|
41
41
|
}
|
|
42
42
|
async firstUpdated(t) {
|
|
43
43
|
super.firstUpdated(t), E || (document.addEventListener("visibilitychange", this._handlePageVisibilityChange, !1), await this._startOrConfigureClock());
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { CSSResultGroup, LitElement, PropertyValues, TemplateResult } from 'lit';
|
|
2
|
+
declare const SbbStickyBarElement_base: import('../../core/mixins.js').AbstractConstructor<import('../../core/mixins.js').SbbUpdateSchedulerMixinType> & typeof LitElement;
|
|
2
3
|
/**
|
|
3
4
|
* A container that sticks to the bottom of the page if slotted into `sbb-container`.
|
|
4
5
|
*
|
|
5
6
|
* @slot - Use the unnamed slot to add content to the sticky bar.
|
|
7
|
+
* @event {CustomEvent<void>} willStick - Emits when the animation from normal content flow to `position: sticky` starts. Can be canceled.
|
|
8
|
+
* @event {CustomEvent<void>} didStick - Emits when the animation from normal content flow to `position: sticky` ends.
|
|
9
|
+
* @event {CustomEvent<void>} willUnstick - Emits when the animation from `position: sticky` to normal content flow starts. Can be canceled.
|
|
10
|
+
* @event {CustomEvent<void>} didUnstick - Emits when the animation from `position: sticky` to normal content flow ends.
|
|
6
11
|
* @cssprop [--sbb-sticky-bar-padding-block=var(--sbb-spacing-responsive-xs)] - Block padding of the sticky bar.
|
|
7
12
|
* @cssprop [--sbb-sticky-bar-bottom-overlapping-height=0px] - Define an additional area where
|
|
8
13
|
* the sticky bar overlaps the following content on the bottom.
|
|
@@ -10,15 +15,36 @@ import { CSSResultGroup, LitElement, PropertyValues, TemplateResult } from 'lit'
|
|
|
10
15
|
* @cssprop [--sbb-sticky-bar-z-index] - To specify a custom stack order,
|
|
11
16
|
* the `z-index` can be overridden by defining this CSS variable.
|
|
12
17
|
*/
|
|
13
|
-
export declare class SbbStickyBarElement extends
|
|
18
|
+
export declare class SbbStickyBarElement extends SbbStickyBarElement_base {
|
|
14
19
|
static styles: CSSResultGroup;
|
|
20
|
+
static readonly events: {
|
|
21
|
+
readonly willStick: "willStick";
|
|
22
|
+
readonly didStick: "didStick";
|
|
23
|
+
readonly willUnstick: "willUnstick";
|
|
24
|
+
readonly didUnstick: "didUnstick";
|
|
25
|
+
};
|
|
15
26
|
/** Color of the container, like transparent, white etc. */
|
|
16
27
|
accessor color: 'white' | 'milk' | null;
|
|
28
|
+
/** The state of the component. */
|
|
29
|
+
private set _state(value);
|
|
30
|
+
private get _state();
|
|
31
|
+
private _willStick;
|
|
32
|
+
private _didStick;
|
|
33
|
+
private _willUnstick;
|
|
34
|
+
private _didUnstick;
|
|
17
35
|
private _intersector?;
|
|
18
36
|
private _observer;
|
|
19
37
|
connectedCallback(): void;
|
|
38
|
+
disconnectedCallback(): void;
|
|
20
39
|
protected firstUpdated(changedProperties: PropertyValues<this>): void;
|
|
21
|
-
private
|
|
40
|
+
private _detectStickyState;
|
|
41
|
+
/** Animates from normal content flow position to `position: sticky`. */
|
|
42
|
+
stick(): void;
|
|
43
|
+
/** Animates `position: sticky` to normal content flow position. */
|
|
44
|
+
unstick(): void;
|
|
45
|
+
private _stickyCallback;
|
|
46
|
+
private _unstickyCallback;
|
|
47
|
+
private _onAnimationEnd;
|
|
22
48
|
protected render(): TemplateResult;
|
|
23
49
|
}
|
|
24
50
|
declare global {
|
|
@@ -26,4 +52,5 @@ declare global {
|
|
|
26
52
|
'sbb-sticky-bar': SbbStickyBarElement;
|
|
27
53
|
}
|
|
28
54
|
}
|
|
55
|
+
export {};
|
|
29
56
|
//# sourceMappingURL=sticky-bar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sticky-bar.d.ts","sourceRoot":"","sources":["../../../../src/elements/container/sticky-bar/sticky-bar.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,cAAc,EAEnB,UAAU,EACV,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"sticky-bar.d.ts","sourceRoot":"","sources":["../../../../src/elements/container/sticky-bar/sticky-bar.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,cAAc,EAEnB,UAAU,EACV,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,KAAK,CAAC;;AAWb;;;;;;;;;;;;;;GAcG;AACH,qBAKM,mBAAoB,SAAQ,wBAAmC;IACnE,OAAuB,MAAM,EAAE,cAAc,CAAS;IAEtD,gBAAuB,MAAM;;;;;MAKlB;IAEX,2DAA2D;IAC3D,SAA6C,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAAQ;IAEnF,kCAAkC;IAClC,OAAO,KAAK,MAAM,QAEjB;IACD,OAAO,KAAK,MAAM,GAEjB;IAED,OAAO,CAAC,UAAU,CAA8E;IAChG,OAAO,CAAC,SAAS,CAA6E;IAC9F,OAAO,CAAC,YAAY,CAGlB;IACF,OAAO,CAAC,WAAW,CAA+E;IAElG,OAAO,CAAC,YAAY,CAAC,CAAkB;IACvC,OAAO,CAAC,SAAS,CAKd;IAEa,iBAAiB,IAAI,IAAI;IAgBzB,oBAAoB,IAAI,IAAI;cAMzB,YAAY,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;IAU9E,OAAO,CAAC,kBAAkB;IA+B1B,wEAAwE;IACjE,KAAK,IAAI,IAAI;IAWpB,mEAAmE;IAC5D,OAAO,IAAI,IAAI;IAYtB,OAAO,CAAC,eAAe;IAKvB,OAAO,CAAC,iBAAiB;IAKzB,OAAO,CAAC,eAAe;cAWJ,MAAM,IAAI,cAAc;CAU5C;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,gBAAgB,EAAE,mBAAmB,CAAC;KACvC;CACF"}
|
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
|
};
|
|
@@ -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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breakpoint.d.ts","sourceRoot":"","sources":["../../../../src/elements/core/dom/breakpoint.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,yEAA0E,CAAC;AACnG,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtD
|
|
1
|
+
{"version":3,"file":"breakpoint.d.ts","sourceRoot":"","sources":["../../../../src/elements/core/dom/breakpoint.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,yEAA0E,CAAC;AACnG,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtD;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAC1B,IAAI,CAAC,EAAE,UAAU,EACjB,EAAE,CAAC,EAAE,UAAU,EACf,UAAU,CAAC,EAAE;IAAE,oBAAoB,EAAE,OAAO,CAAA;CAAE,GAC7C,OAAO,GAAG,IAAI,CAsBhB"}
|
package/core/dom.js
CHANGED
|
@@ -2,8 +2,8 @@ import { isServer as e } from "lit";
|
|
|
2
2
|
const v = ["zero", "micro", "small", "medium", "wide", "large", "ultra"];
|
|
3
3
|
function E(t, n, o) {
|
|
4
4
|
if (e)
|
|
5
|
-
return
|
|
6
|
-
const i = getComputedStyle(document.documentElement),
|
|
5
|
+
return null;
|
|
6
|
+
const i = getComputedStyle(document.documentElement), r = t ? i.getPropertyValue(`--sbb-breakpoint-${t}-min`) : "", s = n ? `${parseFloat(i.getPropertyValue(`--sbb-breakpoint-${n}-${o != null && o.includeMaxBreakpoint ? "max" : "min"}`)) - (o != null && o.includeMaxBreakpoint ? 0 : 0.0625)}rem` : "", m = r && `(min-width: ${r})`, f = s && `(max-width: ${s})`, y = r && s && " and ";
|
|
7
7
|
return window.matchMedia(`${m}${y}${f}`).matches;
|
|
8
8
|
}
|
|
9
9
|
function g(t) {
|
|
@@ -33,13 +33,13 @@ function x(t, n) {
|
|
|
33
33
|
function k(t, n, o) {
|
|
34
34
|
o ? t.setAttribute(n, o) : t.removeAttribute(n);
|
|
35
35
|
}
|
|
36
|
-
let
|
|
36
|
+
let c;
|
|
37
37
|
try {
|
|
38
|
-
|
|
38
|
+
c = typeof Intl < "u" && Intl.v8BreakIterator;
|
|
39
39
|
} catch {
|
|
40
|
-
|
|
40
|
+
c = !1;
|
|
41
41
|
}
|
|
42
|
-
const u = !e && /(edge)/i.test(navigator.userAgent),
|
|
42
|
+
const u = !e && /(edge)/i.test(navigator.userAgent), a = !e && /(msie|trident)/i.test(navigator.userAgent), b = !e && !!(window.chrome || c) && typeof CSS < "u" && !u && !a, h = !e && /AppleWebKit/i.test(navigator.userAgent) && !b && !u && !a, I = !e && /iPad|iPhone|iPod/.test(navigator.userAgent) && !("MSStream" in window), $ = !e && /(firefox|minefield)/i.test(navigator.userAgent), M = !e && /android/i.test(navigator.userAgent) && !a, _ = !e && /safari/i.test(navigator.userAgent) && h, W = b, B = () => !!globalThis.next;
|
|
43
43
|
function l() {
|
|
44
44
|
return document.body.hasAttribute("data-sbb-scroll-disabled");
|
|
45
45
|
}
|
|
@@ -86,7 +86,7 @@ export {
|
|
|
86
86
|
I as isIOS,
|
|
87
87
|
B as isNextjs,
|
|
88
88
|
_ as isSafari,
|
|
89
|
-
|
|
89
|
+
a as isTrident,
|
|
90
90
|
h as isWebkit,
|
|
91
91
|
l as pageScrollDisabled,
|
|
92
92
|
k as setOrRemoveAttribute
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-associated-checkbox-mixin.d.ts","sourceRoot":"","sources":["../../../../src/elements/core/mixins/form-associated-checkbox-mixin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,KAAK,CAAC;AAMxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAoB,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAClF,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EAErB,KAAK,0BAA0B,EAChC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAoB,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAIlF,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,kCAC5B,SAAQ,0BACR,YAAW,OAAO,CAAC,oBAAoB,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC;IAEvE,IAAW,OAAO,IAAI,OAAO,CAAC;IAC9B,IAAW,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE;IAEnC,IAAW,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE;IACpC,IAAW,QAAQ,IAAI,OAAO,CAAC;IAE/B,IAAW,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE;IACpC,IAAW,QAAQ,IAAI,OAAO,CAAC;IAExB,iBAAiB,IAAI,IAAI;IACzB,wBAAwB,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI,EAAE,MAAM,EAAE,iBAAiB,GAAG,IAAI;IAEhG,SAAS,CAAC,oBAAoB,IAAI,OAAO;IACzC,SAAS,CAAC,oBAAoB,IAAI,OAAO;IACzC,SAAS,CAAC,mBAAmB,CAAC,IAAI,IAAI;IACtC,SAAS,CAAC,eAAe,IAAI,IAAI;CAClC;AAED;;;;GAIG;AAEH,eAAO,MAAM,8BAA8B,GAAI,CAAC,SAAS,WAAW,CAAC,UAAU,CAAC,cAClE,CAAC,KACZ,WAAW,CAAC,kCAAkC,CAAC,GAAG,
|
|
1
|
+
{"version":3,"file":"form-associated-checkbox-mixin.d.ts","sourceRoot":"","sources":["../../../../src/elements/core/mixins/form-associated-checkbox-mixin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,KAAK,CAAC;AAMxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAoB,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAClF,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EAErB,KAAK,0BAA0B,EAChC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAoB,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAIlF,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,kCAC5B,SAAQ,0BACR,YAAW,OAAO,CAAC,oBAAoB,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC;IAEvE,IAAW,OAAO,IAAI,OAAO,CAAC;IAC9B,IAAW,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE;IAEnC,IAAW,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE;IACpC,IAAW,QAAQ,IAAI,OAAO,CAAC;IAE/B,IAAW,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE;IACpC,IAAW,QAAQ,IAAI,OAAO,CAAC;IAExB,iBAAiB,IAAI,IAAI;IACzB,wBAAwB,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI,EAAE,MAAM,EAAE,iBAAiB,GAAG,IAAI;IAEhG,SAAS,CAAC,oBAAoB,IAAI,OAAO;IACzC,SAAS,CAAC,oBAAoB,IAAI,OAAO;IACzC,SAAS,CAAC,mBAAmB,CAAC,IAAI,IAAI;IACtC,SAAS,CAAC,eAAe,IAAI,IAAI;CAClC;AAED;;;;GAIG;AAEH,eAAO,MAAM,8BAA8B,GAAI,CAAC,SAAS,WAAW,CAAC,UAAU,CAAC,cAClE,CAAC,KACZ,WAAW,CAAC,kCAAkC,CAAC,GAAG,CAqJpD,CAAC"}
|