@sbb-esta/lyne-elements 2.0.2 → 2.1.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/accordion/accordion.d.ts.map +1 -1
- package/accordion.js +6 -6
- package/alert/alert.js +8 -8
- package/autocomplete/autocomplete-base-element.d.ts.map +1 -1
- package/autocomplete-grid/autocomplete-grid-button.js +4 -4
- package/autocomplete-grid/autocomplete-grid-optgroup.js +4 -4
- package/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.d.ts +1 -1
- package/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.d.ts.map +1 -1
- package/autocomplete-grid/autocomplete-grid-option.js +10 -10
- package/autocomplete-grid/autocomplete-grid-row.js +4 -4
- package/autocomplete.js +92 -89
- package/breadcrumb/breadcrumb-group.js +4 -4
- package/button/accent-button-link.js +9 -9
- package/button/accent-button-static.js +6 -6
- package/button/accent-button.js +6 -6
- package/button/button-link.js +7 -7
- package/button/button-static.js +7 -7
- package/button/button.js +8 -8
- package/button/common.js +1 -1
- package/button/mini-button-group.js +8 -8
- package/button/secondary-button-link.js +7 -7
- package/button/secondary-button-static.js +7 -7
- package/button/secondary-button.js +3 -3
- package/button/transparent-button-link.js +6 -6
- package/button/transparent-button-static.js +5 -5
- package/button/transparent-button.js +6 -6
- package/card/card-badge.js +9 -9
- package/card/card-button.js +5 -5
- package/card/card-link.js +7 -7
- package/checkbox/checkbox-panel.js +16 -16
- package/checkbox/checkbox.js +15 -15
- package/checkbox/common.js +3 -3
- package/clock.js +8 -8
- package/container/container/container.d.ts +1 -1
- package/container/container/container.d.ts.map +1 -1
- package/container/container.js +21 -21
- package/container/sticky-bar/sticky-bar.d.ts +1 -1
- package/container/sticky-bar/sticky-bar.d.ts.map +1 -1
- package/container/sticky-bar.js +4 -4
- package/core/base-elements.js +8 -8
- package/core/controllers.js +4 -4
- package/core/datetime/date-adapter.d.ts +1 -1
- package/core/datetime/date-adapter.d.ts.map +1 -1
- package/core/datetime/native-date-adapter.d.ts +1 -1
- package/core/datetime/native-date-adapter.d.ts.map +1 -1
- package/core/datetime.js +6 -6
- package/core/dom/scroll.d.ts +1 -1
- package/core/dom/scroll.d.ts.map +1 -1
- package/core/dom.js +39 -39
- package/core/eventing.js +4 -4
- package/core/mixins/form-associated-mixin.d.ts +2 -4
- package/core/mixins/form-associated-mixin.d.ts.map +1 -1
- package/core/mixins/form-associated-radio-button-mixin.d.ts +3 -3
- package/core/mixins/form-associated-radio-button-mixin.d.ts.map +1 -1
- package/core/mixins.js +276 -276
- package/core/styles/core.scss +21 -2
- package/core/testing.js +14 -14
- package/core.css +18 -2
- package/custom-elements.json +528 -554
- package/datepicker/common/datepicker-association-controllers.d.ts +21 -0
- package/datepicker/common/datepicker-association-controllers.d.ts.map +1 -0
- package/datepicker/common/datepicker-button.d.ts +17 -9
- package/datepicker/common/datepicker-button.d.ts.map +1 -1
- package/datepicker/common.d.ts +1 -0
- package/datepicker/common.d.ts.map +1 -1
- package/datepicker/common.js +130 -92
- package/datepicker/datepicker/datepicker.d.ts +19 -4
- package/datepicker/datepicker/datepicker.d.ts.map +1 -1
- package/datepicker/datepicker-toggle/datepicker-toggle.d.ts +14 -8
- package/datepicker/datepicker-toggle/datepicker-toggle.d.ts.map +1 -1
- package/datepicker/datepicker-toggle.js +108 -112
- package/datepicker/datepicker.js +95 -80
- package/development/accordion/accordion.d.ts.map +1 -1
- package/development/accordion.js +1 -1
- package/development/autocomplete/autocomplete-base-element.d.ts.map +1 -1
- package/development/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.d.ts +1 -1
- package/development/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.d.ts.map +1 -1
- package/development/autocomplete-grid/autocomplete-grid-option.js +3 -3
- package/development/autocomplete.js +24 -8
- package/development/button/common.js +4 -2
- package/development/calendar.js +1 -1
- package/development/container/container/container.d.ts +1 -1
- package/development/container/container/container.d.ts.map +1 -1
- package/development/container/container.js +17 -1
- package/development/container/sticky-bar/sticky-bar.d.ts +1 -1
- package/development/container/sticky-bar/sticky-bar.d.ts.map +1 -1
- package/development/container/sticky-bar.js +9 -1
- package/development/core/datetime/date-adapter.d.ts +1 -1
- package/development/core/datetime/date-adapter.d.ts.map +1 -1
- package/development/core/datetime/native-date-adapter.d.ts +1 -1
- package/development/core/datetime/native-date-adapter.d.ts.map +1 -1
- package/development/core/datetime.js +1 -1
- package/development/core/dom/scroll.d.ts +1 -1
- package/development/core/dom/scroll.d.ts.map +1 -1
- package/development/core/dom.js +4 -4
- package/development/core/mixins/form-associated-mixin.d.ts +2 -4
- package/development/core/mixins/form-associated-mixin.d.ts.map +1 -1
- package/development/core/mixins/form-associated-radio-button-mixin.d.ts +3 -3
- package/development/core/mixins/form-associated-radio-button-mixin.d.ts.map +1 -1
- package/development/core/mixins.js +45 -49
- package/development/datepicker/common/datepicker-association-controllers.d.ts +21 -0
- package/development/datepicker/common/datepicker-association-controllers.d.ts.map +1 -0
- package/development/datepicker/common/datepicker-button.d.ts +17 -9
- package/development/datepicker/common/datepicker-button.d.ts.map +1 -1
- package/development/datepicker/common.d.ts +1 -0
- package/development/datepicker/common.d.ts.map +1 -1
- package/development/datepicker/common.js +139 -90
- package/development/datepicker/datepicker/datepicker.d.ts +19 -4
- package/development/datepicker/datepicker/datepicker.d.ts.map +1 -1
- package/development/datepicker/datepicker-toggle/datepicker-toggle.d.ts +14 -8
- package/development/datepicker/datepicker-toggle/datepicker-toggle.d.ts.map +1 -1
- package/development/datepicker/datepicker-toggle.js +65 -69
- package/development/datepicker/datepicker.js +54 -36
- package/development/dialog/dialog/dialog.d.ts +2 -0
- package/development/dialog/dialog/dialog.d.ts.map +1 -1
- package/development/dialog/dialog.js +37 -11
- package/development/menu/menu/menu.d.ts.map +1 -1
- package/development/menu/menu.js +35 -12
- package/development/navigation/navigation/navigation.d.ts.map +1 -1
- package/development/navigation/navigation.js +15 -8
- package/development/option/option/option-base-element.d.ts +3 -2
- package/development/option/option/option-base-element.d.ts.map +1 -1
- package/development/option/option.js +15 -8
- package/development/overlay/overlay-base-element.d.ts.map +1 -1
- package/development/overlay/overlay.d.ts.map +1 -1
- package/development/overlay.js +29 -13
- package/development/popover/popover/popover.d.ts.map +1 -1
- package/development/popover/popover.js +16 -13
- package/development/radio-button/common/radio-button-common.d.ts +0 -2
- package/development/radio-button/common/radio-button-common.d.ts.map +1 -1
- package/development/radio-button/common.js +2 -18
- package/development/radio-button/radio-button-group.js +2 -2
- package/development/radio-button/radio-button-panel/radio-button-panel.d.ts +9 -1
- package/development/radio-button/radio-button-panel/radio-button-panel.d.ts.map +1 -1
- package/development/radio-button/radio-button-panel.js +17 -7
- package/development/select/select.d.ts +11 -0
- package/development/select/select.d.ts.map +1 -1
- package/development/select.js +60 -9
- package/development/toast/toast.d.ts.map +1 -1
- package/development/toast.js +14 -8
- package/development/toggle/toggle.js +1 -1
- package/development/train/train-wagon.js +1 -1
- package/dialog/dialog/dialog.d.ts +2 -0
- package/dialog/dialog/dialog.d.ts.map +1 -1
- package/dialog/dialog-content.js +3 -3
- package/dialog/dialog-title.js +8 -8
- package/dialog/dialog.js +59 -49
- package/divider.js +12 -12
- package/file-selector/file-selector-dropzone.js +5 -5
- package/file-selector/file-selector.js +6 -6
- package/flip-card/flip-card-details.js +4 -4
- package/flip-card/flip-card-summary.js +9 -9
- package/header/header-button.js +5 -5
- package/header/header-link.js +5 -5
- package/icon.js +36 -36
- package/link/block-link-button.js +4 -4
- package/link/block-link-static.js +9 -9
- package/link/block-link.js +4 -4
- package/link/common.js +16 -16
- package/link/link-button.js +7 -7
- package/link/link-static.js +7 -7
- package/link/link.js +4 -4
- package/link-list/common.js +12 -12
- package/loading-indicator-circle.js +11 -11
- package/map-container.js +4 -4
- package/menu/common.js +7 -7
- package/menu/menu/menu.d.ts.map +1 -1
- package/menu/menu-button.js +8 -8
- package/menu/menu-link.js +6 -6
- package/menu/menu.js +64 -42
- package/navigation/navigation/navigation.d.ts.map +1 -1
- package/navigation/navigation-button.js +4 -4
- package/navigation/navigation-link.js +7 -7
- package/navigation/navigation-list.js +4 -4
- package/navigation/navigation-marker.js +3 -3
- package/navigation/navigation.js +21 -20
- package/notification.js +17 -17
- package/option/optgroup.js +11 -11
- package/option/option/option-base-element.d.ts +3 -2
- package/option/option/option-base-element.d.ts.map +1 -1
- package/option/option.js +113 -101
- package/overlay/overlay-base-element.d.ts.map +1 -1
- package/overlay/overlay.d.ts.map +1 -1
- package/overlay.js +87 -84
- package/package.json +1 -1
- package/paginator/common.js +6 -6
- package/popover/popover/popover.d.ts.map +1 -1
- package/popover/popover.js +73 -73
- package/radio-button/common/radio-button-common.d.ts +0 -2
- package/radio-button/common/radio-button-common.d.ts.map +1 -1
- package/radio-button/common.js +13 -18
- package/radio-button/radio-button-group.js +1 -1
- package/radio-button/radio-button-panel/radio-button-panel.d.ts +9 -1
- package/radio-button/radio-button-panel/radio-button-panel.d.ts.map +1 -1
- package/radio-button/radio-button-panel.js +40 -38
- package/screen-reader-only.js +5 -5
- package/select/select.d.ts +11 -0
- package/select/select.d.ts.map +1 -1
- package/select.js +111 -83
- package/slider.js +8 -8
- package/standard-theme.css +18 -2
- package/status.js +3 -3
- package/stepper/step-label.js +4 -4
- package/table/table-wrapper.js +4 -4
- package/tabs/tab-group.js +24 -24
- package/tabs/tab.js +3 -3
- package/tag/tag-group.js +7 -7
- package/teaser-product/common.js +5 -5
- package/teaser-product/teaser-product-static.js +2 -2
- package/timetable-occupancy-icon.js +3 -3
- package/timetable-occupancy.js +6 -6
- package/toast/toast.d.ts.map +1 -1
- package/toast.js +58 -54
- package/toggle/toggle-option.js +11 -11
- package/toggle-check.js +5 -5
- package/train/train.js +28 -28
package/overlay.js
CHANGED
|
@@ -1,46 +1,48 @@
|
|
|
1
|
-
var
|
|
1
|
+
var H = (s) => {
|
|
2
2
|
throw TypeError(s);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
import { __runInitializers as
|
|
4
|
+
var I = (s, i, r) => i.has(s) || H("Cannot " + r);
|
|
5
|
+
var x = (s, i, r) => (I(s, i, "read from private field"), r ? r.call(s) : i.get(s)), L = (s, i, r) => i.has(s) ? H("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(s) : i.set(s, r), d = (s, i, r, o) => (I(s, i, "write to private field"), o ? o.call(s, r) : i.set(s, r), r);
|
|
6
|
+
import { __runInitializers as b, __esDecorate as p } from "tslib";
|
|
7
7
|
import { css as M, nothing as N } from "lit";
|
|
8
|
-
import { property as
|
|
9
|
-
import { html as
|
|
10
|
-
import { SbbFocusHandler as
|
|
11
|
-
import { forceType as
|
|
12
|
-
import { SbbScrollHandler as q, isZeroAnimationDuration as
|
|
13
|
-
import { EventEmitter as G, forwardEvent as
|
|
14
|
-
import { i18nDialog as
|
|
15
|
-
import { SbbOpenCloseBaseElement as
|
|
16
|
-
import { SbbLanguageController as
|
|
17
|
-
import { SbbNegativeMixin as
|
|
8
|
+
import { property as A, customElement as P } from "lit/decorators.js";
|
|
9
|
+
import { html as D, unsafeStatic as $ } from "lit/static-html.js";
|
|
10
|
+
import { SbbFocusHandler as V, setModalityOnNextFocus as j, getFirstFocusableElement as Y } from "./core/a11y.js";
|
|
11
|
+
import { hostAttributes as Z, forceType as z } from "./core/decorators.js";
|
|
12
|
+
import { SbbScrollHandler as q, isZeroAnimationDuration as K } from "./core/dom.js";
|
|
13
|
+
import { EventEmitter as G, forwardEvent as U } from "./core/eventing.js";
|
|
14
|
+
import { i18nDialog as J, i18nCloseDialog as Q, i18nGoBack as W } from "./core/i18n.js";
|
|
15
|
+
import { SbbOpenCloseBaseElement as X } from "./core/base-elements.js";
|
|
16
|
+
import { SbbLanguageController as ee, SbbInertController as te } from "./core/controllers.js";
|
|
17
|
+
import { SbbNegativeMixin as ae } from "./core/mixins.js";
|
|
18
18
|
import "./button/secondary-button.js";
|
|
19
19
|
import "./button/transparent-button.js";
|
|
20
20
|
import "./container.js";
|
|
21
21
|
import "./screen-reader-only.js";
|
|
22
22
|
const m = [];
|
|
23
|
-
let
|
|
24
|
-
var v,
|
|
25
|
-
let s =
|
|
26
|
-
|
|
23
|
+
let se = (() => {
|
|
24
|
+
var v, h;
|
|
25
|
+
let s = [Z({
|
|
26
|
+
popover: "manual"
|
|
27
|
+
})], i, r = [], o, O = ae(X), E, B = [], S = [];
|
|
28
|
+
var f = (h = class extends O {
|
|
27
29
|
constructor() {
|
|
28
30
|
super(...arguments);
|
|
29
|
-
|
|
30
|
-
d(this, v,
|
|
31
|
+
L(this, v);
|
|
32
|
+
d(this, v, b(this, B, "")), this.didClose = (b(this, S), new G(this, f.events.didClose)), this.focusHandler = new V(), this.scrollHandler = new q(), this.ariaLiveRefToggle = !1, this.language = new ee(this), this.inertController = new te(this);
|
|
31
33
|
}
|
|
32
34
|
/** This will be forwarded as aria-label to the relevant nested element to describe the purpose of the overlay. */
|
|
33
35
|
get accessibilityLabel() {
|
|
34
|
-
return
|
|
36
|
+
return x(this, v);
|
|
35
37
|
}
|
|
36
38
|
set accessibilityLabel(a) {
|
|
37
39
|
d(this, v, a);
|
|
38
40
|
}
|
|
39
41
|
/** Closes the component. */
|
|
40
|
-
close(a,
|
|
42
|
+
close(a, l) {
|
|
41
43
|
if (this.state !== "opened")
|
|
42
44
|
return;
|
|
43
|
-
this.returnValue = a, this.overlayCloseElement =
|
|
45
|
+
this.returnValue = a, this.overlayCloseElement = l;
|
|
44
46
|
const u = {
|
|
45
47
|
returnValue: this.returnValue,
|
|
46
48
|
closeTarget: this.overlayCloseElement
|
|
@@ -55,8 +57,8 @@ let ae = (() => {
|
|
|
55
57
|
this.ariaLiveRef = this.shadowRoot.querySelector("sbb-screen-reader-only"), super.firstUpdated(a);
|
|
56
58
|
}
|
|
57
59
|
disconnectedCallback() {
|
|
58
|
-
var a,
|
|
59
|
-
super.disconnectedCallback(), (a = this.overlayController) == null || a.abort(), (
|
|
60
|
+
var a, l;
|
|
61
|
+
super.disconnectedCallback(), (a = this.overlayController) == null || a.abort(), (l = this.openOverlayController) == null || l.abort(), this.focusHandler.disconnect(), this.removeInstanceFromGlobalCollection(), this.scrollHandler.enableScroll();
|
|
60
62
|
}
|
|
61
63
|
attachOpenOverlayEvents() {
|
|
62
64
|
this.openOverlayController = new AbortController(), window.addEventListener("keydown", (a) => {
|
|
@@ -78,83 +80,84 @@ let ae = (() => {
|
|
|
78
80
|
}
|
|
79
81
|
// Close the component on click of any element that has the `closeAttribute` attribute.
|
|
80
82
|
closeOnSbbOverlayCloseClick(a) {
|
|
81
|
-
const
|
|
82
|
-
if (!
|
|
83
|
+
const l = a.composedPath().filter((y) => y instanceof window.HTMLElement).find((y) => y.hasAttribute(this.closeAttribute) && !y.hasAttribute("disabled"));
|
|
84
|
+
if (!l)
|
|
83
85
|
return;
|
|
84
|
-
const u =
|
|
85
|
-
m[m.length - 1].close(u,
|
|
86
|
+
const u = l.getAttribute("type") === "submit" ? l.form ?? null : null;
|
|
87
|
+
m[m.length - 1].close(u, l);
|
|
86
88
|
}
|
|
87
89
|
removeAriaLiveRefContent() {
|
|
88
90
|
this.ariaLiveRef.textContent = "";
|
|
89
91
|
}
|
|
90
92
|
setAriaLiveRefContent(a) {
|
|
91
|
-
this.ariaLiveRefToggle = !this.ariaLiveRefToggle, this.ariaLiveRef.textContent = `${
|
|
92
|
-
}
|
|
93
|
-
}, v = new WeakMap(), (() => {
|
|
94
|
-
const a = typeof Symbol == "function" && Symbol.metadata ? Object.create(
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
} }, metadata: a },
|
|
98
|
-
})(),
|
|
93
|
+
this.ariaLiveRefToggle = !this.ariaLiveRefToggle, this.ariaLiveRef.textContent = `${J[this.language.current]}${a ? `, ${a}` : ""}${this.ariaLiveRefToggle ? " " : ""}`;
|
|
94
|
+
}
|
|
95
|
+
}, v = new WeakMap(), o = h, (() => {
|
|
96
|
+
const a = typeof Symbol == "function" && Symbol.metadata ? Object.create(O[Symbol.metadata] ?? null) : void 0;
|
|
97
|
+
E = [z(), A({ attribute: "accessibility-label" })], p(h, null, E, { kind: "accessor", name: "accessibilityLabel", static: !1, private: !1, access: { has: (l) => "accessibilityLabel" in l, get: (l) => l.accessibilityLabel, set: (l, u) => {
|
|
98
|
+
l.accessibilityLabel = u;
|
|
99
|
+
} }, metadata: a }, B, S), p(null, i = { value: o }, s, { kind: "class", name: o.name, metadata: a }, null, r), f = o = i.value, a && Object.defineProperty(o, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: a }), b(o, r);
|
|
100
|
+
})(), h);
|
|
101
|
+
return f = o;
|
|
99
102
|
})();
|
|
100
|
-
const
|
|
101
|
-
let
|
|
102
|
-
var
|
|
103
|
-
let s = [
|
|
104
|
-
var
|
|
103
|
+
const ie = M`*,:before,:after{box-sizing:border-box}:host{--sbb-scrollbar-thumb-width: .125rem;--sbb-scrollbar-thumb-width-hover: .25rem;--sbb-scrollbar-width-firefox: thin;--sbb-scrollbar-color: var(--sbb-color-black-alpha-30);--sbb-scrollbar-color-hover: var(--sbb-color-black-alpha-60);--sbb-scrollbar-track-color: transparent;--sbb-overlay-background-color: var(--sbb-color-milk);--sbb-overlay-height: 100%;--sbb-overlay-inset: 0 auto auto 0;--sbb-overlay-padding-block: calc(var(--sbb-spacing-fixed-14x) + var(--sbb-spacing-responsive-l));--sbb-overlay-animation-duration: var( --sbb-disable-animation-duration, var(--sbb-animation-duration-6x) );--sbb-overlay-animation-easing: ease;--sbb-overlay-pointer-events: none;display:none;position:fixed;inset:var(--sbb-overlay-inset);z-index:var(--sbb-overlay-z-index, var(--sbb-overlay-default-z-index))}:host([data-state]:not([data-state=closed])){display:block}:host(:is([data-state=opening],[data-state=opened])){--sbb-overlay-pointer-events: all}:host([negative]){--sbb-scrollbar-color: var(--sbb-color-white-alpha-30);--sbb-scrollbar-color-hover: var(--sbb-color-white-alpha-60);--sbb-focus-outline-color: var(--sbb-focus-outline-color-dark);--sbb-overlay-color: var(--sbb-color-white);--sbb-overlay-background-color: var(--sbb-color-midnight)}:host(:not([data-state=closed])){--sbb-overlay-inset: 0}.sbb-overlay__container{background-color:var(--sbb-overlay-background-color);pointer-events:var(--sbb-overlay-pointer-events);display:none;align-items:center;position:fixed;inset:var(--sbb-overlay-inset)}:host([data-state]:not([data-state=closed])) .sbb-overlay__container{display:flex;animation-name:open;animation-duration:var(--sbb-overlay-animation-duration);animation-timing-function:var(--sbb-overlay-animation-easing)}:host([data-state][data-state=closing]) .sbb-overlay__container{pointer-events:none;animation-name:close}.sbb-overlay{position:absolute;inset-inline:0;margin:auto;padding:0;border:none;height:var(--sbb-overlay-height);overflow:auto;color:var(--sbb-overlay-color)}:host([data-state]:not([data-state=closed])) .sbb-overlay{animation-name:open-move-in;animation-duration:var(--sbb-overlay-animation-duration);animation-timing-function:var(--sbb-overlay-animation-easing)}:host([data-state][data-state=closing]) .sbb-overlay{animation-name:close-move-out}.sbb-overlay__wrapper{display:flex;flex-direction:column;width:100%;height:var(--sbb-overlay-height);outline:none;position:fixed}@media (min-width: 52.5rem){.sbb-overlay__wrapper{position:sticky;inset-block-start:0;height:auto}}.sbb-overlay__header{position:absolute;inset-inline-start:0;display:flex;pointer-events:none;align-items:start;justify-content:space-between;width:100%;padding:var(--sbb-spacing-responsive-xs);padding-block-end:0;z-index:1}.sbb-overlay__header *{pointer-events:all}.sbb-overlay__close{margin-inline-start:auto}.sbb-overlay__content{--sbb-scrollbar-width: var(--sbb-spacing-fixed-3x)}.sbb-overlay__content::-webkit-scrollbar{width:var(--sbb-scrollbar-width);height:var(--sbb-scrollbar-width);background-color:var(--sbb-scrollbar-track-color, transparent)}.sbb-overlay__content::-webkit-scrollbar-corner{background-color:var(--sbb-scrollbar-track-color, transparent)}.sbb-overlay__content::-webkit-scrollbar-thumb{background-color:var(--sbb-scrollbar-color, currentcolor);border:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width))) solid transparent;border-radius:var(--sbb-border-radius-4x);background-clip:padding-box}.sbb-overlay__content::-webkit-scrollbar-thumb:hover{background-color:var(--sbb-scrollbar-color-hover, currentcolor);border-width:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width-hover)))}.sbb-overlay__content::-webkit-scrollbar-button,.sbb-overlay__content::-webkit-scrollbar-corner{display:none}@supports not selector(::-webkit-scrollbar){.sbb-overlay__content{scrollbar-width:var(--sbb-scrollbar-width-firefox);scrollbar-color:var(--sbb-scrollbar-color, currentcolor) var(--sbb-scrollbar-track-color, transparent)}}.sbb-overlay__content{height:100vh;overflow:auto;-webkit-overflow-scrolling:touch}.sbb-overlay__content-container{padding-block:var(--sbb-overlay-padding-block)}@keyframes open{0%{opacity:0}to{opacity:1}}@keyframes open-move-in{0%{transform:translateY(var(--sbb-spacing-fixed-4x))}to{transform:translateY(0)}}@keyframes close{0%{opacity:1}to{opacity:0}}@keyframes close-move-out{0%{transform:translateY(0)}to{transform:translateY(var(--sbb-spacing-fixed-4x))}}`;
|
|
104
|
+
let we = (() => {
|
|
105
|
+
var _, g, k, C, n;
|
|
106
|
+
let s = [P("sbb-overlay")], i, r = [], o, O = se, E, B = [], S = [], f, v = [], h = [], R, F = [], a = [], l, u = [], y = [];
|
|
107
|
+
var T = (n = class extends O {
|
|
105
108
|
constructor() {
|
|
106
109
|
super(...arguments);
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
d(this,
|
|
110
|
+
L(this, _);
|
|
111
|
+
L(this, g);
|
|
112
|
+
L(this, k);
|
|
113
|
+
L(this, C);
|
|
114
|
+
d(this, _, b(this, B, !1)), d(this, g, (b(this, S), b(this, v, !1))), d(this, k, (b(this, h), b(this, F, ""))), d(this, C, (b(this, a), b(this, u, ""))), this.closeAttribute = (b(this, y), "sbb-overlay-close"), this._backClick = new G(this, T.events.backClick), this._overlayContentElement = null;
|
|
112
115
|
}
|
|
113
116
|
/**
|
|
114
117
|
* Whether to allow the overlay content to stretch to full width.
|
|
115
118
|
* By default, the content has the appropriate page size.
|
|
116
119
|
*/
|
|
117
120
|
get expanded() {
|
|
118
|
-
return
|
|
121
|
+
return x(this, _);
|
|
119
122
|
}
|
|
120
123
|
set expanded(e) {
|
|
121
|
-
d(this,
|
|
124
|
+
d(this, _, e);
|
|
122
125
|
}
|
|
123
126
|
/** Whether a back button is displayed next to the title. */
|
|
124
127
|
get backButton() {
|
|
125
|
-
return
|
|
128
|
+
return x(this, g);
|
|
126
129
|
}
|
|
127
130
|
set backButton(e) {
|
|
128
|
-
d(this,
|
|
131
|
+
d(this, g, e);
|
|
129
132
|
}
|
|
130
133
|
/** This will be forwarded as aria-label to the close button element. */
|
|
131
134
|
get accessibilityCloseLabel() {
|
|
132
|
-
return
|
|
135
|
+
return x(this, k);
|
|
133
136
|
}
|
|
134
137
|
set accessibilityCloseLabel(e) {
|
|
135
|
-
d(this,
|
|
138
|
+
d(this, k, e);
|
|
136
139
|
}
|
|
137
140
|
/** This will be forwarded as aria-label to the back button element. */
|
|
138
141
|
get accessibilityBackLabel() {
|
|
139
|
-
return
|
|
142
|
+
return x(this, C);
|
|
140
143
|
}
|
|
141
144
|
set accessibilityBackLabel(e) {
|
|
142
|
-
d(this,
|
|
145
|
+
d(this, C, e);
|
|
143
146
|
}
|
|
144
147
|
/** Opens the component. */
|
|
145
148
|
open() {
|
|
146
|
-
var e;
|
|
147
|
-
this.state === "closed" && (this.lastFocusedElement = document.activeElement, this._overlayContentElement = (e = this.shadowRoot) == null ? void 0 : e.querySelector(".sbb-overlay__content"), this.willOpen.emit() && (this.state = "opening", m.push(this), this.scrollHandler.disableScroll(), this.isZeroAnimationDuration() && this._handleOpening()));
|
|
149
|
+
var e, t;
|
|
150
|
+
this.state === "closed" && (this.lastFocusedElement = document.activeElement, this._overlayContentElement = (e = this.shadowRoot) == null ? void 0 : e.querySelector(".sbb-overlay__content"), this.willOpen.emit() && ((t = this.showPopover) == null || t.call(this), this.state = "opening", m.push(this), this.scrollHandler.disableScroll(), this.isZeroAnimationDuration() && this._handleOpening()));
|
|
148
151
|
}
|
|
149
152
|
isZeroAnimationDuration() {
|
|
150
|
-
return
|
|
153
|
+
return K(this, "--sbb-overlay-animation-duration");
|
|
151
154
|
}
|
|
152
155
|
_handleOpening() {
|
|
153
156
|
this.state = "opened", this.inertController.activate(), this.attachOpenOverlayEvents(), this.setOverlayFocus(), setTimeout(() => this.setAriaLiveRefContent(this.accessibilityLabel)), this.focusHandler.trap(this), this.didOpen.emit();
|
|
154
157
|
}
|
|
155
158
|
handleClosing() {
|
|
156
|
-
var e, t, c;
|
|
157
|
-
(e = this._overlayContentElement) == null || e.scrollTo(0, 0), this.state = "closed", this.inertController.deactivate(), j(this.lastFocusedElement), (
|
|
159
|
+
var e, t, c, w;
|
|
160
|
+
(e = this._overlayContentElement) == null || e.scrollTo(0, 0), this.state = "closed", (t = this.hidePopover) == null || t.call(this), this.inertController.deactivate(), j(this.lastFocusedElement), (c = this.lastFocusedElement) == null || c.focus(), (w = this.openOverlayController) == null || w.abort(), this.focusHandler.disconnect(), this.removeInstanceFromGlobalCollection(), m.length || this.scrollHandler.enableScroll(), this.didClose.emit({
|
|
158
161
|
returnValue: this.returnValue,
|
|
159
162
|
closeTarget: this.overlayCloseElement
|
|
160
163
|
});
|
|
@@ -167,42 +170,42 @@ let Ce = (() => {
|
|
|
167
170
|
}
|
|
168
171
|
// Set focus on the first focusable element.
|
|
169
172
|
setOverlayFocus() {
|
|
170
|
-
const e =
|
|
173
|
+
const e = Y(Array.from(this.shadowRoot.children).filter((t) => t instanceof window.HTMLElement));
|
|
171
174
|
j(e), e == null || e.focus();
|
|
172
175
|
}
|
|
173
176
|
render() {
|
|
174
|
-
const e = this.negative ? "sbb-transparent-button" : "sbb-secondary-button", t =
|
|
175
|
-
<${
|
|
177
|
+
const e = this.negative ? "sbb-transparent-button" : "sbb-secondary-button", t = D`
|
|
178
|
+
<${$(e)}
|
|
176
179
|
class="sbb-overlay__close"
|
|
177
|
-
aria-label=${this.accessibilityCloseLabel ||
|
|
180
|
+
aria-label=${this.accessibilityCloseLabel || Q[this.language.current]}
|
|
178
181
|
?negative=${this.negative}
|
|
179
182
|
size="m"
|
|
180
183
|
type="button"
|
|
181
184
|
icon-name="cross-small"
|
|
182
185
|
sbb-overlay-close
|
|
183
|
-
></${
|
|
184
|
-
`, c =
|
|
185
|
-
<${
|
|
186
|
+
></${$(e)}>
|
|
187
|
+
`, c = D`
|
|
188
|
+
<${$(e)}
|
|
186
189
|
class="sbb-overlay__back"
|
|
187
|
-
aria-label=${this.accessibilityBackLabel ||
|
|
190
|
+
aria-label=${this.accessibilityBackLabel || W[this.language.current]}
|
|
188
191
|
?negative=${this.negative}
|
|
189
192
|
size="m"
|
|
190
193
|
type="button"
|
|
191
194
|
icon-name="chevron-small-left-small"
|
|
192
195
|
@click=${() => this._backClick.emit()}
|
|
193
|
-
></${
|
|
196
|
+
></${$(e)}>
|
|
194
197
|
`;
|
|
195
|
-
return
|
|
198
|
+
return D`
|
|
196
199
|
<div class="sbb-overlay__container" @animationend=${this.onOverlayAnimationEnd}>
|
|
197
200
|
<div class="sbb-overlay">
|
|
198
201
|
<div
|
|
199
|
-
@click=${(
|
|
202
|
+
@click=${(w) => this.closeOnSbbOverlayCloseClick(w)}
|
|
200
203
|
class="sbb-overlay__wrapper"
|
|
201
204
|
>
|
|
202
205
|
<div class="sbb-overlay__header">
|
|
203
206
|
${this.backButton ? c : N} ${t}
|
|
204
207
|
</div>
|
|
205
|
-
<div class="sbb-overlay__content" @scroll=${(
|
|
208
|
+
<div class="sbb-overlay__content" @scroll=${(w) => U(w, document)}>
|
|
206
209
|
<sbb-container
|
|
207
210
|
class="sbb-overlay__content-container"
|
|
208
211
|
?expanded=${this.expanded}
|
|
@@ -217,28 +220,28 @@ let Ce = (() => {
|
|
|
217
220
|
<sbb-screen-reader-only aria-live="polite"></sbb-screen-reader-only>
|
|
218
221
|
`;
|
|
219
222
|
}
|
|
220
|
-
},
|
|
221
|
-
const e = typeof Symbol == "function" && Symbol.metadata ? Object.create(
|
|
222
|
-
|
|
223
|
+
}, _ = new WeakMap(), g = new WeakMap(), k = new WeakMap(), C = new WeakMap(), o = n, (() => {
|
|
224
|
+
const e = typeof Symbol == "function" && Symbol.metadata ? Object.create(O[Symbol.metadata] ?? null) : void 0;
|
|
225
|
+
E = [z(), A({ reflect: !0, type: Boolean })], f = [z(), A({ attribute: "back-button", type: Boolean })], R = [z(), A({ attribute: "accessibility-close-label" })], l = [z(), A({ attribute: "accessibility-back-label" })], p(n, null, E, { kind: "accessor", name: "expanded", static: !1, private: !1, access: { has: (t) => "expanded" in t, get: (t) => t.expanded, set: (t, c) => {
|
|
223
226
|
t.expanded = c;
|
|
224
|
-
} }, metadata: e },
|
|
227
|
+
} }, metadata: e }, B, S), p(n, null, f, { kind: "accessor", name: "backButton", static: !1, private: !1, access: { has: (t) => "backButton" in t, get: (t) => t.backButton, set: (t, c) => {
|
|
225
228
|
t.backButton = c;
|
|
226
|
-
} }, metadata: e },
|
|
229
|
+
} }, metadata: e }, v, h), p(n, null, R, { kind: "accessor", name: "accessibilityCloseLabel", static: !1, private: !1, access: { has: (t) => "accessibilityCloseLabel" in t, get: (t) => t.accessibilityCloseLabel, set: (t, c) => {
|
|
227
230
|
t.accessibilityCloseLabel = c;
|
|
228
|
-
} }, metadata: e },
|
|
231
|
+
} }, metadata: e }, F, a), p(n, null, l, { kind: "accessor", name: "accessibilityBackLabel", static: !1, private: !1, access: { has: (t) => "accessibilityBackLabel" in t, get: (t) => t.accessibilityBackLabel, set: (t, c) => {
|
|
229
232
|
t.accessibilityBackLabel = c;
|
|
230
|
-
} }, metadata: e },
|
|
231
|
-
})(), n.styles =
|
|
233
|
+
} }, metadata: e }, u, y), p(null, i = { value: o }, s, { kind: "class", name: o.name, metadata: e }, null, r), T = o = i.value, e && Object.defineProperty(o, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: e });
|
|
234
|
+
})(), n.styles = ie, n.events = {
|
|
232
235
|
willOpen: "willOpen",
|
|
233
236
|
didOpen: "didOpen",
|
|
234
237
|
willClose: "willClose",
|
|
235
238
|
didClose: "didClose",
|
|
236
239
|
backClick: "requestBackAction"
|
|
237
|
-
},
|
|
238
|
-
return
|
|
240
|
+
}, b(o, r), n);
|
|
241
|
+
return T = o;
|
|
239
242
|
})();
|
|
240
243
|
export {
|
|
241
|
-
|
|
242
|
-
|
|
244
|
+
se as SbbOverlayBaseElement,
|
|
245
|
+
we as SbbOverlayElement,
|
|
243
246
|
m as overlayRefs
|
|
244
247
|
};
|
package/package.json
CHANGED
package/paginator/common.js
CHANGED
|
@@ -2,7 +2,7 @@ var $ = (a) => {
|
|
|
2
2
|
throw TypeError(a);
|
|
3
3
|
};
|
|
4
4
|
var k = (a, i, s) => i.has(a) || $("Cannot " + s);
|
|
5
|
-
var _ = (a, i, s) => (k(a, i, "read from private field"), s ? s.call(a) : i.get(a)), x = (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),
|
|
5
|
+
var _ = (a, i, s) => (k(a, i, "read from private field"), s ? s.call(a) : i.get(a)), x = (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), m = (a, i, s, d) => (k(a, i, "write to private field"), d ? d.call(a, s) : i.set(a, s), s);
|
|
6
6
|
import { __runInitializers as h, __esDecorate as p } from "tslib";
|
|
7
7
|
import { html as O } from "lit";
|
|
8
8
|
import { property as c } from "lit/decorators.js";
|
|
@@ -19,13 +19,13 @@ const ae = (a) => (() => {
|
|
|
19
19
|
var l, g, n;
|
|
20
20
|
let s = [D({
|
|
21
21
|
role: "group"
|
|
22
|
-
})],
|
|
22
|
+
})], d, z = [], o, I = B(T(a)), u = [], f, P, S, v, y = [], E = [], N, C = [], M = [];
|
|
23
23
|
var b = (n = class extends I {
|
|
24
24
|
constructor() {
|
|
25
25
|
super(...arguments);
|
|
26
26
|
x(this, l);
|
|
27
27
|
x(this, g);
|
|
28
|
-
this._length = (h(this, u), 0), this._pageSize = 10, this._pageIndex = 0,
|
|
28
|
+
this._length = (h(this, u), 0), this._pageSize = 10, this._pageIndex = 0, m(this, l, h(this, y, "start")), m(this, g, (h(this, E), h(this, C, L() ? "s" : "m"))), this._page = (h(this, M), new R(this, b.events.page, { composed: !0, bubbles: !0 })), this.language = new w(this);
|
|
29
29
|
}
|
|
30
30
|
/** Total number of items. */
|
|
31
31
|
set length(e) {
|
|
@@ -54,7 +54,7 @@ const ae = (a) => (() => {
|
|
|
54
54
|
return _(this, l);
|
|
55
55
|
}
|
|
56
56
|
set pagerPosition(e) {
|
|
57
|
-
|
|
57
|
+
m(this, l, e);
|
|
58
58
|
}
|
|
59
59
|
/**
|
|
60
60
|
* Size variant, either m or s.
|
|
@@ -64,7 +64,7 @@ const ae = (a) => (() => {
|
|
|
64
64
|
return _(this, g);
|
|
65
65
|
}
|
|
66
66
|
set size(e) {
|
|
67
|
-
|
|
67
|
+
m(this, g, e);
|
|
68
68
|
}
|
|
69
69
|
updated(e) {
|
|
70
70
|
super.updated(e), this.shadowRoot.querySelector("sbb-screen-reader-only").textContent = this._currentPageLabel();
|
|
@@ -138,7 +138,7 @@ const ae = (a) => (() => {
|
|
|
138
138
|
t.pagerPosition = r;
|
|
139
139
|
} }, metadata: e }, y, E), p(n, null, N, { kind: "accessor", name: "size", static: !1, private: !1, access: { has: (t) => "size" in t, get: (t) => t.size, set: (t, r) => {
|
|
140
140
|
t.size = r;
|
|
141
|
-
} }, metadata: e }, C, M), p(null,
|
|
141
|
+
} }, metadata: e }, C, M), p(null, d = { value: o }, s, { kind: "class", name: o.name, metadata: e }, null, z), b = o = d.value, e && Object.defineProperty(o, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: e });
|
|
142
142
|
})(), n.events = {
|
|
143
143
|
page: "page"
|
|
144
144
|
}, h(o, z), n);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../../../src/elements/popover/popover/popover.ts"],"names":[],"mappings":"AAAA,OA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