@sbb-esta/lyne-elements 0.52.0 → 0.52.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/accordion.js +54 -54
- package/action-group.js +3 -3
- package/alert/alert-group.js +22 -22
- package/alert/alert.js +22 -22
- package/autocomplete.js +126 -126
- package/breadcrumb/breadcrumb-group/breadcrumb-group.d.ts.map +1 -1
- package/breadcrumb/breadcrumb-group.js +70 -69
- package/breadcrumb/breadcrumb.js +17 -17
- package/calendar.js +423 -423
- package/card/card-badge.js +17 -17
- package/card/card.js +2 -2
- package/card/common.js +30 -30
- package/checkbox/checkbox-group.js +17 -17
- package/checkbox/checkbox.js +34 -34
- package/clock.js +83 -83
- package/container/sticky-bar.js +16 -16
- package/core/a11y.js +91 -91
- package/core/base-elements.js +87 -88
- package/core/controllers.js +40 -40
- package/core/datetime.js +34 -36
- package/core/dom.js +26 -26
- package/core/eventing.js +33 -33
- package/core/mixins.js +122 -122
- package/core/overlay/overlay.d.ts.map +1 -1
- package/core/overlay.js +55 -50
- package/core/testing/event-spy.d.ts +1 -1
- package/core/testing/wait-for-image-ready.d.ts +4 -0
- package/core/testing/wait-for-image-ready.d.ts.map +1 -0
- package/core/testing.d.ts +1 -0
- package/core/testing.d.ts.map +1 -1
- package/core/testing.js +42 -31
- package/custom-elements.json +70 -4
- package/datepicker/common.js +55 -55
- package/datepicker/datepicker-toggle.js +94 -94
- package/datepicker/datepicker.js +144 -144
- package/development/accordion.js +2 -3
- package/development/action-group.js +2 -3
- package/development/alert/alert-group.js +2 -3
- package/development/alert/alert.js +2 -3
- package/development/autocomplete.js +2 -3
- package/development/breadcrumb/breadcrumb-group/breadcrumb-group.d.ts.map +1 -1
- package/development/breadcrumb/breadcrumb-group.js +5 -5
- package/development/breadcrumb/breadcrumb.js +2 -3
- package/development/button/button-link.js +2 -3
- package/development/button/button-static.js +2 -3
- package/development/button/button.js +2 -3
- package/development/button/common.js +2 -3
- package/development/button/mini-button.js +2 -3
- package/development/button/secondary-button-link.js +2 -3
- package/development/button/secondary-button-static.js +2 -3
- package/development/button/secondary-button.js +2 -3
- package/development/button/tertiary-button-link.js +2 -3
- package/development/button/tertiary-button-static.js +2 -3
- package/development/button/tertiary-button.js +2 -3
- package/development/button/transparent-button-link.js +2 -3
- package/development/button/transparent-button-static.js +2 -3
- package/development/button/transparent-button.js +2 -3
- package/development/calendar.js +2 -3
- package/development/card/card-badge.js +2 -3
- package/development/card/card-button.js +2 -3
- package/development/card/card-link.js +2 -3
- package/development/card/card.js +2 -3
- package/development/card/common.js +2 -3
- package/development/checkbox/checkbox-group.js +2 -3
- package/development/checkbox/checkbox.js +2 -3
- package/development/chip.js +2 -3
- package/development/clock.js +2 -3
- package/development/container/container.js +2 -3
- package/development/container/sticky-bar.js +2 -3
- package/development/core/base-elements.js +4 -7
- package/development/core/mixins.js +7 -13
- package/development/core/overlay/overlay.d.ts.map +1 -1
- package/development/core/overlay.js +9 -3
- package/development/core/testing/event-spy.d.ts +1 -1
- package/development/core/testing/wait-for-image-ready.d.ts +4 -0
- package/development/core/testing/wait-for-image-ready.d.ts.map +1 -0
- package/development/core/testing.d.ts +1 -0
- package/development/core/testing.d.ts.map +1 -1
- package/development/core/testing.js +17 -1
- package/development/datepicker/common.js +2 -3
- package/development/datepicker/datepicker-next-day.js +2 -3
- package/development/datepicker/datepicker-previous-day.js +2 -3
- package/development/datepicker/datepicker-toggle.js +2 -3
- package/development/datepicker/datepicker.js +2 -3
- package/development/dialog/dialog-actions.js +2 -3
- package/development/dialog/dialog-content.js +2 -3
- package/development/dialog/dialog-title.js +2 -3
- package/development/dialog/dialog.js +2 -3
- package/development/divider.js +2 -3
- package/development/expansion-panel/expansion-panel-content.js +2 -3
- package/development/expansion-panel/expansion-panel-header.js +2 -3
- package/development/expansion-panel/expansion-panel.js +2 -3
- package/development/file-selector.js +2 -3
- package/development/footer.js +2 -3
- package/development/form-error.js +2 -3
- package/development/form-field/form-field-clear.js +2 -3
- package/development/form-field/form-field.js +2 -3
- package/development/header/common.js +2 -3
- package/development/header/header-button.js +2 -3
- package/development/header/header-link.js +2 -3
- package/development/header/header.js +2 -3
- package/development/icon.js +4 -7
- package/development/image/image.d.ts +12 -3
- package/development/image/image.d.ts.map +1 -1
- package/development/image.js +41 -24
- package/development/journey-header.js +2 -3
- package/development/lead-container.js +2 -3
- package/development/link/block-link-button.js +2 -3
- package/development/link/block-link-static.js +2 -3
- package/development/link/block-link.js +2 -3
- package/development/link/common.js +3 -5
- package/development/link/link-button.js +2 -3
- package/development/link/link-static.js +2 -3
- package/development/link/link.js +2 -3
- package/development/link-list.js +2 -3
- package/development/loading-indicator.js +2 -3
- package/development/logo.js +2 -3
- package/development/map-container.js +2 -3
- package/development/menu/common.js +2 -3
- package/development/menu/menu-button.js +2 -3
- package/development/menu/menu-link.js +2 -3
- package/development/menu/menu.js +2 -3
- package/development/message.js +2 -3
- package/development/navigation/common.js +2 -3
- package/development/navigation/navigation-button.js +2 -3
- package/development/navigation/navigation-link.js +2 -3
- package/development/navigation/navigation-list.js +2 -3
- package/development/navigation/navigation-marker.js +2 -3
- package/development/navigation/navigation-section.js +2 -3
- package/development/navigation/navigation.js +2 -3
- package/development/notification.js +2 -3
- package/development/option/optgroup.js +2 -3
- package/development/option/option.js +2 -3
- package/development/overlay.js +3 -5
- package/development/popover/popover-trigger.js +2 -3
- package/development/popover/popover.js +2 -3
- package/development/radio-button/radio-button-group.js +2 -3
- package/development/radio-button/radio-button.js +2 -3
- package/development/screen-reader-only.js +2 -3
- package/development/select.js +2 -3
- package/development/selection-panel.js +2 -3
- package/development/signet.js +2 -3
- package/development/skiplink-list.js +2 -3
- package/development/slider.js +2 -3
- package/development/status.js +2 -3
- package/development/stepper/step-label.js +2 -3
- package/development/stepper/step.js +2 -3
- package/development/stepper/stepper/stepper.d.ts +1 -1
- package/development/stepper/stepper/stepper.d.ts.map +1 -1
- package/development/stepper/stepper.js +5 -6
- package/development/tabs/tab-group.js +2 -3
- package/development/tabs/tab-title.js +2 -3
- package/development/tag/tag-group.js +2 -3
- package/development/tag/tag.js +2 -3
- package/development/teaser-hero.js +2 -3
- package/development/teaser-paid.js +2 -3
- package/development/teaser.js +2 -3
- package/development/time-input.js +2 -3
- package/development/timetable-occupancy-icon.js +2 -3
- package/development/timetable-occupancy.js +2 -3
- package/development/title.js +3 -5
- package/development/toast.js +2 -3
- package/development/toggle/toggle-option.js +3 -5
- package/development/toggle/toggle.js +2 -3
- package/development/toggle-check.js +10 -3
- package/development/train/train-blocked-passage.js +2 -3
- package/development/train/train-formation.js +2 -3
- package/development/train/train-wagon.js +2 -3
- package/development/train/train.js +2 -3
- package/development/visual-checkbox.js +2 -3
- package/dialog/dialog-title.js +20 -20
- package/dialog/dialog.js +66 -66
- package/expansion-panel/expansion-panel-header.js +20 -20
- package/expansion-panel/expansion-panel.js +60 -60
- package/file-selector.js +91 -91
- package/form-field/form-field-clear.js +12 -12
- package/form-field/form-field.js +111 -111
- package/header/header.js +53 -53
- package/icon.js +107 -107
- package/image/image.d.ts +12 -3
- package/image/image.d.ts.map +1 -1
- package/image.js +118 -105
- package/journey-header.js +29 -29
- package/map-container.js +23 -23
- package/menu/menu.js +91 -91
- package/navigation/common.js +16 -16
- package/navigation/navigation-marker.js +34 -34
- package/navigation/navigation-section.js +83 -83
- package/navigation/navigation.js +87 -87
- package/notification.js +52 -52
- package/option/optgroup.js +45 -45
- package/option/option.js +108 -108
- package/overlay.js +5 -5
- package/package.json +1 -1
- package/popover/popover.js +110 -110
- package/radio-button/radio-button-group.js +93 -93
- package/radio-button/radio-button.js +84 -84
- package/select.js +178 -178
- package/selection-panel.js +44 -44
- package/slider.js +58 -58
- package/status.js +6 -6
- package/stepper/step-label.js +19 -19
- package/stepper/step.js +31 -31
- package/stepper/stepper/stepper.d.ts +1 -1
- package/stepper/stepper/stepper.d.ts.map +1 -1
- package/stepper/stepper.js +48 -48
- package/tabs/tab-group.js +67 -67
- package/tag/tag-group.js +8 -8
- package/tag/tag.js +27 -27
- package/teaser-paid.js +12 -12
- package/time-input.js +73 -73
- package/timetable-occupancy-icon.js +26 -26
- package/timetable-occupancy.js +9 -9
- package/toast.js +38 -38
- package/toggle/toggle-option.js +33 -33
- package/toggle/toggle.js +46 -46
- package/toggle-check.js +14 -14
- package/train/train-formation.js +36 -37
- package/train/train-wagon.js +30 -30
- package/train/train.js +13 -13
package/stepper/step.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
import { css as o, LitElement as l, html as p } from "lit";
|
|
2
2
|
import { customElement as h } from "lit/decorators.js";
|
|
3
|
-
import { ref as
|
|
4
|
-
import { SbbConnectedAbortController as
|
|
3
|
+
import { ref as c } from "lit/directives/ref.js";
|
|
4
|
+
import { SbbConnectedAbortController as d } from "../core/controllers.js";
|
|
5
5
|
import { hostAttributes as v } from "../core/decorators.js";
|
|
6
6
|
import { EventEmitter as m } from "../core/eventing.js";
|
|
7
7
|
import { AgnosticResizeObserver as u } from "../core/observers.js";
|
|
8
8
|
const f = o`*,:before,:after{box-sizing:border-box}:host{--sbb-step-position: initial;--sbb-step-inset-block-start: unset;--sbb-step-opacity: 0;--sbb-step-visibility: hidden;--sbb-step-height: 0;--sbb-step-animation-duration: var( --sbb-disable-animation-zero-time, var(--sbb-animation-duration-2x) );--sbb-step-animation-delay: 0;--sbb-step-color: var(--sbb-color-iron);display:contents}:host([data-selected]){--sbb-step-opacity: 1;--sbb-step-visibility: visible;--sbb-step-height: fit-content;--sbb-step-animation-duration: var(--sbb-animation-duration-4x);--sbb-step-animation-delay: var(--sbb-step-animation-duration)}:host([data-orientation=horizontal]){--sbb-step-position: absolute;--sbb-step-inset-block-start: 0}:host([data-orientation=vertical]) .sbb-step--wrapper{margin-inline-start:var(--sbb-spacing-fixed-4x);opacity:0;height:0;transition:height var(--sbb-stepper-animation-duration) var(--sbb-animation-easing),opacity var(--sbb-step-animation-duration) var(--sbb-animation-easing)}:host([data-selected][data-orientation=vertical]) .sbb-step--wrapper{opacity:1;height:var(--sbb-stepper-content-height);transition:height var(--sbb-stepper-animation-duration) var(--sbb-animation-easing),opacity var(--sbb-step-animation-duration) var(--sbb-stepper-animation-duration) var(--sbb-animation-easing)}.sbb-step{--sbb-text-font-size: var(--sbb-font-size-text-m);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size);position:var(--sbb-step-position);width:100%;inset-block-start:var(--sbb-step-inset-block-start);opacity:var(--sbb-step-opacity);visibility:var(--sbb-step-visibility);height:var(--sbb-step-height);color:var(--sbb-step-color);transition-property:opacity,visibility;transition-duration:var(--sbb-step-animation-duration);transition-delay:var(--sbb-step-animation-delay);transition-timing-function:var(--sbb-animation-easing)}`;
|
|
9
|
-
var g = Object.defineProperty,
|
|
10
|
-
for (var e =
|
|
11
|
-
(
|
|
12
|
-
return
|
|
9
|
+
var g = Object.defineProperty, y = Object.getOwnPropertyDescriptor, x = (t, i, a, s) => {
|
|
10
|
+
for (var e = s > 1 ? void 0 : s ? y(i, a) : i, b = t.length - 1, r; b >= 0; b--)
|
|
11
|
+
(r = t[b]) && (e = (s ? r(i, a, e) : r(e)) || e);
|
|
12
|
+
return s && e && g(i, a, e), e;
|
|
13
13
|
};
|
|
14
|
-
let
|
|
14
|
+
let w = 0, n = class extends l {
|
|
15
15
|
constructor() {
|
|
16
|
-
super(...arguments), this.
|
|
16
|
+
super(...arguments), this.f = new m(
|
|
17
17
|
this,
|
|
18
18
|
n.events.validate
|
|
19
|
-
), this.
|
|
20
|
-
(t) => this.
|
|
19
|
+
), this.c = !1, this.g = new d(this), this.a = null, this.b = null, this.d = new u(
|
|
20
|
+
(t) => this.h(t)
|
|
21
21
|
);
|
|
22
22
|
}
|
|
23
23
|
/** The label of the step. */
|
|
24
24
|
get label() {
|
|
25
|
-
return this.
|
|
25
|
+
return this.b;
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
28
|
* Selects and configures the step.
|
|
29
29
|
* @internal
|
|
30
30
|
*/
|
|
31
31
|
select() {
|
|
32
|
-
!this.
|
|
32
|
+
!this.c || !this.label || (this.toggleAttribute("data-selected", !0), this.label.select());
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
35
|
* Deselects and configures the step.
|
|
@@ -43,35 +43,35 @@ let x = 0, n = class extends l {
|
|
|
43
43
|
* @internal
|
|
44
44
|
*/
|
|
45
45
|
validate(t) {
|
|
46
|
-
return !!this.
|
|
46
|
+
return !!this.f.emit(t);
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
49
|
* Configures the step.
|
|
50
50
|
* @internal
|
|
51
51
|
*/
|
|
52
52
|
configure(t) {
|
|
53
|
-
t && (this.
|
|
53
|
+
t && (this.b = this.e()), this.label && this.setAttribute("aria-labelledby", this.label.id);
|
|
54
54
|
}
|
|
55
55
|
/** Watches for clicked elements with `sbb-stepper-next` or `sbb-stepper-previous` attributes. */
|
|
56
|
-
|
|
57
|
-
var a,
|
|
58
|
-
const
|
|
59
|
-
|
|
56
|
+
i(t) {
|
|
57
|
+
var a, s;
|
|
58
|
+
const i = t.composedPath().filter((e) => e instanceof window.HTMLElement);
|
|
59
|
+
i.some((e) => this.j(e)) ? (a = this.a) == null || a.next() : i.some((e) => this.k(e)) && ((s = this.a) == null || s.previous());
|
|
60
60
|
}
|
|
61
|
-
|
|
61
|
+
j(t) {
|
|
62
62
|
return t.hasAttribute("sbb-stepper-next") && !t.hasAttribute("disabled");
|
|
63
63
|
}
|
|
64
|
-
|
|
64
|
+
k(t) {
|
|
65
65
|
return t.hasAttribute("sbb-stepper-previous") && !t.hasAttribute("disabled");
|
|
66
66
|
}
|
|
67
|
-
|
|
68
|
-
var a,
|
|
67
|
+
h(t) {
|
|
68
|
+
var a, s;
|
|
69
69
|
if (!this.hasAttribute("data-selected"))
|
|
70
70
|
return;
|
|
71
|
-
const
|
|
72
|
-
(
|
|
71
|
+
const i = Math.floor(t[0].contentRect.height);
|
|
72
|
+
(s = (a = this.a) == null ? void 0 : a.style) == null || s.setProperty("--sbb-stepper-content-height", `${i}px`);
|
|
73
73
|
}
|
|
74
|
-
|
|
74
|
+
e() {
|
|
75
75
|
let t = this.previousElementSibling;
|
|
76
76
|
for (; t && t.localName !== "sbb-step-label"; )
|
|
77
77
|
t = t.previousElementSibling;
|
|
@@ -79,21 +79,21 @@ let x = 0, n = class extends l {
|
|
|
79
79
|
}
|
|
80
80
|
connectedCallback() {
|
|
81
81
|
super.connectedCallback();
|
|
82
|
-
const t = this.
|
|
83
|
-
this.id = this.id || `sbb-step-${
|
|
82
|
+
const t = this.g.signal;
|
|
83
|
+
this.id = this.id || `sbb-step-${w++}`, this.addEventListener("click", (i) => this.i(i), { signal: t }), this.a = this.closest("sbb-stepper"), this.b = this.e();
|
|
84
84
|
}
|
|
85
85
|
firstUpdated(t) {
|
|
86
|
-
super.firstUpdated(t), this.
|
|
86
|
+
super.firstUpdated(t), this.c = !0;
|
|
87
87
|
}
|
|
88
88
|
disconnectedCallback() {
|
|
89
|
-
super.disconnectedCallback(), this.
|
|
89
|
+
super.disconnectedCallback(), this.d.disconnect();
|
|
90
90
|
}
|
|
91
91
|
render() {
|
|
92
92
|
return p`
|
|
93
93
|
<div class="sbb-step--wrapper">
|
|
94
94
|
<div
|
|
95
95
|
class="sbb-step"
|
|
96
|
-
${
|
|
96
|
+
${c((t) => t && this.d.observe(t))}
|
|
97
97
|
>
|
|
98
98
|
<slot></slot>
|
|
99
99
|
</div>
|
|
@@ -105,7 +105,7 @@ n.styles = f;
|
|
|
105
105
|
n.events = {
|
|
106
106
|
validate: "validate"
|
|
107
107
|
};
|
|
108
|
-
n =
|
|
108
|
+
n = x([
|
|
109
109
|
h("sbb-step"),
|
|
110
110
|
v({
|
|
111
111
|
slot: "step",
|
|
@@ -13,8 +13,8 @@ export declare class SbbStepperElement extends LitElement {
|
|
|
13
13
|
/** If set to true, only the current and previous labels can be clicked and selected. */
|
|
14
14
|
linear: boolean;
|
|
15
15
|
/** Overrides the behaviour of `orientation` property. */
|
|
16
|
-
get horizontalFrom(): SbbHorizontalFrom | undefined;
|
|
17
16
|
set horizontalFrom(value: SbbHorizontalFrom);
|
|
17
|
+
get horizontalFrom(): SbbHorizontalFrom | undefined;
|
|
18
18
|
private _horizontalFrom?;
|
|
19
19
|
/** Steps orientation, either horizontal or vertical. */
|
|
20
20
|
orientation: SbbOrientation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stepper.d.ts","sourceRoot":"","sources":["../../../../src/elements/stepper/stepper/stepper.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EAEnB,UAAU,EACV,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,KAAK,CAAC;AAMb,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAClF,OAAO,KAAK,EAAE,cAAc,EAA+B,MAAM,YAAY,CAAC;AAM9E;;;;;GAKG;AACH,qBACa,iBAAkB,SAAQ,UAAU;IAC/C,OAAuB,MAAM,EAAE,cAAc,CAAS;IAEtD,wFAAwF;IACpD,MAAM,UAAS;IAEnD,yDAAyD;IACzD,IACW,cAAc,
|
|
1
|
+
{"version":3,"file":"stepper.d.ts","sourceRoot":"","sources":["../../../../src/elements/stepper/stepper/stepper.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EAEnB,UAAU,EACV,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,KAAK,CAAC;AAMb,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAClF,OAAO,KAAK,EAAE,cAAc,EAA+B,MAAM,YAAY,CAAC;AAM9E;;;;;GAKG;AACH,qBACa,iBAAkB,SAAQ,UAAU;IAC/C,OAAuB,MAAM,EAAE,cAAc,CAAS;IAEtD,wFAAwF;IACpD,MAAM,UAAS;IAEnD,yDAAyD;IACzD,IACW,cAAc,CAAC,KAAK,EAAE,iBAAiB,EAKjD;IACD,IAAW,cAAc,IAAI,iBAAiB,GAAG,SAAS,CAEzD;IACD,OAAO,CAAC,eAAe,CAAC,CAAgC;IAExD,wDAAwD;IAEjD,WAAW,EAAE,cAAc,CAAgB;IAElD,mCAAmC;IACnC,IACW,QAAQ,CAAC,IAAI,EAAE,cAAc,EAIvC;IACD,IAAW,QAAQ,IAAI,cAAc,GAAG,SAAS,CAEhD;IAED,yCAAyC;IACzC,IACW,aAAa,CAAC,KAAK,EAAE,MAAM,EAIrC;IACD,IAAW,aAAa,IAAI,MAAM,GAAG,SAAS,CAE7C;IAED,gCAAgC;IAChC,IAAW,KAAK,IAAI,cAAc,EAAE,CAEnC;IAED,OAAO,KAAK,aAAa,GAExB;IAED,6BAA6B;IACtB,IAAI,IAAI,IAAI;IAMnB,iCAAiC;IAC1B,QAAQ,IAAI,IAAI;IAMvB,yFAAyF;IAClF,KAAK,IAAI,IAAI;IAcpB,OAAO,CAAC,OAAO,CAAkB;IACjC,OAAO,CAAC,MAAM,CAAyC;IACvD,OAAO,CAAC,sBAAsB,CAA8C;IAE5E,OAAO,CAAC,YAAY;IAiBpB,OAAO,CAAC,OAAO;IAwBf,OAAO,CAAC,cAAc;IAiBtB,OAAO,CAAC,wBAAwB;IAoBhC,OAAO,CAAC,UAAU;IAYlB,OAAO,CAAC,aAAa;IAQrB,OAAO,CAAC,iBAAiB;IASzB,OAAO,CAAC,gBAAgB;IAYxB,OAAO,CAAC,oBAAoB;IAUZ,iBAAiB,IAAI,IAAI;cAWhB,YAAY,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;cAU1E,UAAU,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;IAW5E,OAAO,CAAC,cAAc;cAmBH,MAAM,IAAI,cAAc;CAY5C;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,aAAa,EAAE,iBAAiB,CAAC;KAClC;CACF"}
|
package/stepper/stepper.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
import { css as h, LitElement as p, html as c } from "lit";
|
|
2
2
|
import { property as l, customElement as f } from "lit/decorators.js";
|
|
3
3
|
import { isArrowKeyPressed as u, getNextElementIndex as m } from "../core/a11y.js";
|
|
4
|
-
import { SbbConnectedAbortController as
|
|
5
|
-
import { breakpoints as
|
|
6
|
-
const
|
|
7
|
-
var
|
|
8
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
9
|
-
(
|
|
10
|
-
return i && r &&
|
|
4
|
+
import { SbbConnectedAbortController as v } from "../core/controllers.js";
|
|
5
|
+
import { breakpoints as x, isBreakpoint as g } from "../core/dom.js";
|
|
6
|
+
const _ = h`*,:before,:after{box-sizing:border-box}:host{--sbb-stepper-orientation: row;--sbb-stepper-border-width: var(--sbb-border-width-1x);--sbb-stepper-marker-size: 0;--sbb-stepper-marker-width: var(--sbb-border-width-3x);--sbb-stepper-animation-duration: var( --sbb-disable-animation-zero-time, var(--sbb-animation-duration-6x) );--sbb-stepper-marker-color: var(--sbb-color-charcoal);display:block;position:relative;counter-reset:step-label}@media (forced-colors: active){:host{--sbb-stepper-marker-color: ButtonText}}:host([data-disable-animation]){--sbb-disable-animation-time: .1ms;--sbb-disable-animation-zero-time: 0s}:host([orientation=vertical]){--sbb-stepper-orientation: column}.sbb-stepper{width:100%}.sbb-stepper__labels{display:flex;flex-direction:var(--sbb-stepper-orientation);position:relative;justify-content:space-between;margin-block-end:var(--sbb-spacing-responsive-m)}.sbb-stepper__labels:before{content:"";position:absolute;inset-inline-start:calc(var(--sbb-stepper-border-width) * -1);background-color:var(--sbb-stepper-marker-color)}:host([orientation=horizontal]) .sbb-stepper__labels{gap:var(--sbb-spacing-fixed-4x);padding-block-end:var(--sbb-spacing-fixed-4x);border-block-end:var(--sbb-stepper-border-width) solid var(--sbb-color-cloud)}:host([orientation=horizontal]) .sbb-stepper__labels:before{inset-block-end:calc(var(--sbb-stepper-border-width) * -1);height:var(--sbb-stepper-marker-width);width:var(--sbb-stepper-marker-size);transition:width var(--sbb-stepper-animation-duration) var(--sbb-animation-easing)}:host([orientation=vertical]) .sbb-stepper__labels{padding-inline-start:var(--sbb-spacing-fixed-4x);border-inline-start:var(--sbb-stepper-border-width) solid var(--sbb-color-cloud)}:host([orientation=vertical]) .sbb-stepper__labels:before{inset-block-start:0;width:var(--sbb-stepper-marker-width);height:var(--sbb-stepper-marker-size);transition:height var(--sbb-stepper-animation-duration) var(--sbb-animation-easing)}.sbb-stepper__steps{position:relative}:host([orientation=horizontal]) .sbb-stepper__steps{height:var(--sbb-stepper-content-height);transition:height var(--sbb-stepper-animation-duration) var(--sbb-animation-easing)}::slotted(sbb-step-label):before{content:counter(step-label);counter-increment:step-label}`;
|
|
7
|
+
var w = Object.defineProperty, I = Object.getOwnPropertyDescriptor, n = (e, t, s, i) => {
|
|
8
|
+
for (var r = i > 1 ? void 0 : i ? I(t, s) : t, a = e.length - 1, b; a >= 0; a--)
|
|
9
|
+
(b = e[a]) && (r = (i ? b(t, s, r) : b(r)) || r);
|
|
10
|
+
return i && r && w(t, s, r), r;
|
|
11
11
|
};
|
|
12
|
-
const
|
|
12
|
+
const d = 150;
|
|
13
13
|
let o = class extends p {
|
|
14
14
|
constructor() {
|
|
15
|
-
super(...arguments), this.linear = !1, this.orientation = "horizontal", this.
|
|
16
|
-
}
|
|
17
|
-
get horizontalFrom() {
|
|
18
|
-
return this._horizontalFrom;
|
|
15
|
+
super(...arguments), this.linear = !1, this.orientation = "horizontal", this.a = !1, this.k = new v(this), this.g = null;
|
|
19
16
|
}
|
|
20
17
|
set horizontalFrom(e) {
|
|
21
|
-
this.
|
|
18
|
+
this.c = x.includes(e) ? e : void 0, this.c && this.a && this.d();
|
|
19
|
+
}
|
|
20
|
+
get horizontalFrom() {
|
|
21
|
+
return this.c;
|
|
22
22
|
}
|
|
23
23
|
set selected(e) {
|
|
24
|
-
this.
|
|
24
|
+
this.a && this.b(e);
|
|
25
25
|
}
|
|
26
26
|
get selected() {
|
|
27
27
|
var e;
|
|
28
28
|
return ((e = this.querySelector) == null ? void 0 : e.call(this, "sbb-step[data-selected]")) ?? void 0;
|
|
29
29
|
}
|
|
30
30
|
set selectedIndex(e) {
|
|
31
|
-
this.
|
|
31
|
+
this.a && this.b(this.steps[e]);
|
|
32
32
|
}
|
|
33
33
|
get selectedIndex() {
|
|
34
34
|
return this.selected ? this.steps.indexOf(this.selected) : void 0;
|
|
@@ -38,7 +38,7 @@ let o = class extends p {
|
|
|
38
38
|
var e;
|
|
39
39
|
return Array.from(((e = this.querySelectorAll) == null ? void 0 : e.call(this, "sbb-step")) ?? []);
|
|
40
40
|
}
|
|
41
|
-
get
|
|
41
|
+
get f() {
|
|
42
42
|
return this.steps.filter((e) => {
|
|
43
43
|
var t;
|
|
44
44
|
return !((t = e.label) != null && t.hasAttribute("disabled"));
|
|
@@ -46,11 +46,11 @@ let o = class extends p {
|
|
|
46
46
|
}
|
|
47
47
|
/** Selects the next step. */
|
|
48
48
|
next() {
|
|
49
|
-
this.selectedIndex !== void 0 && this.
|
|
49
|
+
this.selectedIndex !== void 0 && this.b(this.steps[this.selectedIndex + 1]);
|
|
50
50
|
}
|
|
51
51
|
/** Selects the previous step. */
|
|
52
52
|
previous() {
|
|
53
|
-
this.selectedIndex !== void 0 && this.
|
|
53
|
+
this.selectedIndex !== void 0 && this.b(this.steps[this.selectedIndex - 1]);
|
|
54
54
|
}
|
|
55
55
|
/** Resets the form in which the stepper is nested or every form of each step, if any. */
|
|
56
56
|
reset() {
|
|
@@ -58,7 +58,7 @@ let o = class extends p {
|
|
|
58
58
|
const e = this.closest("form");
|
|
59
59
|
e ? e.reset() : this.querySelectorAll("form").forEach((r) => r.reset()), this.selectedIndex = 0, ((t = document.activeElement) == null ? void 0 : t.closest("sbb-stepper")) === this && ((i = (s = this.selected) == null ? void 0 : s.label) == null || i.focus());
|
|
60
60
|
}
|
|
61
|
-
|
|
61
|
+
l(e) {
|
|
62
62
|
var t;
|
|
63
63
|
if (!e || !this.linear && ((t = e.label) != null && t.hasAttribute("disabled")))
|
|
64
64
|
return !1;
|
|
@@ -70,9 +70,9 @@ let o = class extends p {
|
|
|
70
70
|
}
|
|
71
71
|
return !0;
|
|
72
72
|
}
|
|
73
|
-
|
|
73
|
+
b(e) {
|
|
74
74
|
var i, r, a;
|
|
75
|
-
if (!this.
|
|
75
|
+
if (!this.l(e))
|
|
76
76
|
return;
|
|
77
77
|
const t = {
|
|
78
78
|
currentIndex: this.selectedIndex,
|
|
@@ -83,15 +83,15 @@ let o = class extends p {
|
|
|
83
83
|
if (this.selected && !this.selected.validate(t))
|
|
84
84
|
return;
|
|
85
85
|
const s = this.selected;
|
|
86
|
-
s == null || s.deselect(), e.select(), this.
|
|
86
|
+
s == null || s.deselect(), e.select(), this.e(), this.h(), ((i = document.activeElement) == null ? void 0 : i.closest("sbb-stepper")) === this && ((a = (r = this.selected) == null ? void 0 : r.label) == null || a.focus());
|
|
87
87
|
}
|
|
88
|
-
|
|
89
|
-
if (!this.
|
|
88
|
+
e() {
|
|
89
|
+
if (!this.a || !this.selected || this.selectedIndex === void 0 || !this.selected.label)
|
|
90
90
|
return;
|
|
91
|
-
const e = this.orientation === "horizontal" ? this.selected.label.offsetLeft + this.selected.label.offsetWidth : this.
|
|
91
|
+
const e = this.orientation === "horizontal" ? this.selected.label.offsetLeft + this.selected.label.offsetWidth : this.m();
|
|
92
92
|
this.style.setProperty("--sbb-stepper-marker-size", `${e}px`);
|
|
93
93
|
}
|
|
94
|
-
|
|
94
|
+
m() {
|
|
95
95
|
if (this.selectedIndex === void 0)
|
|
96
96
|
return;
|
|
97
97
|
let e = 0;
|
|
@@ -102,28 +102,28 @@ let o = class extends p {
|
|
|
102
102
|
}
|
|
103
103
|
return e + this.selected.label.offsetHeight + parseFloat(getComputedStyle(this).getPropertyValue("--sbb-spacing-fixed-6x")) * 16 * this.selectedIndex;
|
|
104
104
|
}
|
|
105
|
-
|
|
105
|
+
i() {
|
|
106
106
|
const e = this.steps;
|
|
107
|
-
e.forEach((t) => t.configure(this.
|
|
108
|
-
t.configure(s + 1, i.length, this.
|
|
109
|
-
}), this.
|
|
107
|
+
e.forEach((t) => t.configure(this.a)), e.filter((t) => t.label).map((t) => t.label).forEach((t, s, i) => {
|
|
108
|
+
t.configure(s + 1, i.length, this.a);
|
|
109
|
+
}), this.b(this.selected || this.f[0]);
|
|
110
110
|
}
|
|
111
|
-
|
|
111
|
+
j() {
|
|
112
112
|
this.steps.forEach((e) => {
|
|
113
113
|
var t;
|
|
114
114
|
e.slot = this.orientation === "horizontal" ? "step" : "step-label", e.setAttribute("data-orientation", this.orientation), (t = e.label) == null || t.setAttribute("data-orientation", this.orientation);
|
|
115
115
|
});
|
|
116
116
|
}
|
|
117
|
-
|
|
118
|
-
this.horizontalFrom && (this.orientation = g(this.horizontalFrom) ? "horizontal" : "vertical", this.
|
|
117
|
+
d() {
|
|
118
|
+
this.horizontalFrom && (this.orientation = g(this.horizontalFrom) ? "horizontal" : "vertical", this.j()), setTimeout(() => this.e(), 0);
|
|
119
119
|
}
|
|
120
|
-
|
|
121
|
-
this.
|
|
120
|
+
n() {
|
|
121
|
+
this.d(), clearTimeout(this.g), this.toggleAttribute("data-disable-animation", !0), this.g = setTimeout(
|
|
122
122
|
() => this.toggleAttribute("data-disable-animation", !1),
|
|
123
|
-
|
|
123
|
+
d
|
|
124
124
|
);
|
|
125
125
|
}
|
|
126
|
-
|
|
126
|
+
h() {
|
|
127
127
|
this.steps.forEach((e, t) => {
|
|
128
128
|
var s;
|
|
129
129
|
(s = e.label) == null || s.toggleAttribute(
|
|
@@ -134,40 +134,40 @@ let o = class extends p {
|
|
|
134
134
|
}
|
|
135
135
|
connectedCallback() {
|
|
136
136
|
super.connectedCallback();
|
|
137
|
-
const e = this.
|
|
138
|
-
this.addEventListener("keydown", (t) => this.
|
|
137
|
+
const e = this.k.signal;
|
|
138
|
+
this.addEventListener("keydown", (t) => this.o(t), { signal: e }), window.addEventListener("resize", () => this.n(), {
|
|
139
139
|
signal: e,
|
|
140
140
|
passive: !0
|
|
141
|
-
}), this.toggleAttribute("data-disable-animation", !this.
|
|
141
|
+
}), this.toggleAttribute("data-disable-animation", !this.a);
|
|
142
142
|
}
|
|
143
143
|
async firstUpdated(e) {
|
|
144
|
-
super.firstUpdated(e), await this.updateComplete, this.
|
|
144
|
+
super.firstUpdated(e), await this.updateComplete, this.a = !0, this.selectedIndex = this.linear ? 0 : Number(this.getAttribute("selected-index")) || 0, this.d(), setTimeout(() => this.toggleAttribute("data-disable-animation", !1), d);
|
|
145
145
|
}
|
|
146
146
|
willUpdate(e) {
|
|
147
|
-
super.willUpdate(e), e.has("orientation") && !this.horizontalFrom && (this.
|
|
147
|
+
super.willUpdate(e), e.has("orientation") && !this.horizontalFrom && (this.j(), this.e()), e.has("linear") && this.a && this.h();
|
|
148
148
|
}
|
|
149
|
-
|
|
150
|
-
const t = this.
|
|
149
|
+
o(e) {
|
|
150
|
+
const t = this.f;
|
|
151
151
|
if (!(!t || // don't trap nested handling
|
|
152
152
|
e.target !== this && e.target.parentElement !== this) && u(e)) {
|
|
153
153
|
const s = t.indexOf(this.selected), i = m(e, s, t.length);
|
|
154
|
-
this.
|
|
154
|
+
this.b(t[i]), e.preventDefault();
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
render() {
|
|
158
158
|
return c`
|
|
159
159
|
<div class="sbb-stepper">
|
|
160
160
|
<div class="sbb-stepper__labels" role="tablist">
|
|
161
|
-
<slot name="step-label" @slotchange=${this.
|
|
161
|
+
<slot name="step-label" @slotchange=${this.i}></slot>
|
|
162
162
|
</div>
|
|
163
163
|
<div class="sbb-stepper__steps">
|
|
164
|
-
<slot name="step" @slotchange=${this.
|
|
164
|
+
<slot name="step" @slotchange=${this.i}></slot>
|
|
165
165
|
</div>
|
|
166
166
|
</div>
|
|
167
167
|
`;
|
|
168
168
|
}
|
|
169
169
|
};
|
|
170
|
-
o.styles =
|
|
170
|
+
o.styles = _;
|
|
171
171
|
n([
|
|
172
172
|
l({ type: Boolean })
|
|
173
173
|
], o.prototype, "linear", 2);
|
package/tabs/tab-group.js
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
1
|
import { css as h, LitElement as u, html as f } from "lit";
|
|
2
|
-
import { property as
|
|
2
|
+
import { property as c, customElement as v } from "lit/decorators.js";
|
|
3
3
|
import { ref as p } from "lit/directives/ref.js";
|
|
4
|
-
import { isArrowKeyPressed as g, getNextElementIndex as
|
|
5
|
-
import { SbbConnectedAbortController as
|
|
6
|
-
import { EventEmitter as
|
|
7
|
-
import { AgnosticMutationObserver as
|
|
8
|
-
const
|
|
9
|
-
var
|
|
10
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
4
|
+
import { isArrowKeyPressed as g, getNextElementIndex as m } from "../core/a11y.js";
|
|
5
|
+
import { SbbConnectedAbortController as A } from "../core/controllers.js";
|
|
6
|
+
import { EventEmitter as x, throttle as y } from "../core/eventing.js";
|
|
7
|
+
import { AgnosticMutationObserver as C, AgnosticResizeObserver as d } from "../core/observers.js";
|
|
8
|
+
const E = h`@charset "UTF-8";*,:before,:after{box-sizing:border-box}:host{--sbb-tab-group-animation-duration: var( --sbb-disable-animation-zero-time, var(--sbb-animation-duration-4x) );display:block}.tab-group{display:flex;flex-wrap:wrap}.tab-content{margin-block-start:var(--sbb-spacing-responsive-m);transition:height var(--sbb-tab-group-animation-duration) var(--sbb-animation-easing)}.tab-content:after,.tab-content:before{content:" ";display:block;visibility:hidden;height:0}.tab-content ::slotted(*){visibility:hidden;opacity:0;height:0;overflow:hidden;position:relative}.tab-content ::slotted(*[active]){visibility:visible;opacity:1;height:fit-content;overflow:unset;transition-duration:var(--sbb-tab-group-animation-duration);transition-delay:var(--sbb-tab-group-animation-duration);transition-timing-function:var(--sbb-animation-easing);transition-property:opacity,visibility}.tab-content ::slotted([role=tabpanel]:focus-visible){outline-offset:var(--sbb-focus-outline-offset);outline:var(--sbb-focus-outline-color) solid var(--sbb-focus-outline-width)}:host([data-nested]:not([active])) *,:host([data-nested]:not([active])) ::slotted(*){visibility:hidden;opacity:0;height:0}`;
|
|
9
|
+
var w = Object.defineProperty, G = Object.getOwnPropertyDescriptor, l = (t, e, i, s) => {
|
|
10
|
+
for (var a = s > 1 ? void 0 : s ? G(e, i) : e, n = t.length - 1, r; n >= 0; n--)
|
|
11
11
|
(r = t[n]) && (a = (s ? r(e, i, a) : r(a)) || a);
|
|
12
|
-
return s && a &&
|
|
12
|
+
return s && a && w(e, i, a), a;
|
|
13
13
|
};
|
|
14
|
-
const
|
|
14
|
+
const S = {
|
|
15
15
|
attributeFilter: ["active", "disabled"]
|
|
16
|
-
},
|
|
17
|
-
let
|
|
16
|
+
}, T = ["article", "div", "section", "sbb-tab-group"];
|
|
17
|
+
let I = 0, o = class extends u {
|
|
18
18
|
constructor() {
|
|
19
|
-
super(...arguments), this.
|
|
20
|
-
(t) => this.
|
|
21
|
-
), this.
|
|
22
|
-
(t) => this.
|
|
23
|
-
), this.
|
|
24
|
-
(t) => this.
|
|
25
|
-
), this.
|
|
19
|
+
super(...arguments), this.a = [], this.l = new A(this), this.h = new C(
|
|
20
|
+
(t) => this.m(t)
|
|
21
|
+
), this.i = new d(
|
|
22
|
+
(t) => this.n(t)
|
|
23
|
+
), this.d = new d(
|
|
24
|
+
(t) => this.o(t)
|
|
25
|
+
), this.j = "l", this.initialSelectedIndex = 0, this.q = new x(
|
|
26
26
|
this,
|
|
27
27
|
o.events.didChange
|
|
28
|
-
), this.
|
|
29
|
-
this.
|
|
30
|
-
const t = this.
|
|
31
|
-
t.length && (t.forEach((e) => this.
|
|
32
|
-
}, this.
|
|
33
|
-
const t = this.
|
|
34
|
-
t.length < this.
|
|
28
|
+
), this.t = () => {
|
|
29
|
+
this.g = this.shadowRoot.querySelector("div.tab-content");
|
|
30
|
+
const t = this.e().filter((e) => !this.a.includes(e));
|
|
31
|
+
t.length && (t.forEach((e) => this.k(e)), this.a = this.a.concat(t));
|
|
32
|
+
}, this.u = () => {
|
|
33
|
+
const t = this.e();
|
|
34
|
+
t.length < this.a.length && (this.a.filter((i) => !t.includes(i)).forEach((i) => {
|
|
35
35
|
var s;
|
|
36
36
|
(s = i.relatedContent) == null || s.remove();
|
|
37
|
-
}), this.
|
|
37
|
+
}), this.a = t), this.a.forEach((e) => e.setAttribute("data-size", this.size));
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
set size(t) {
|
|
41
|
-
this.
|
|
41
|
+
this.j = t, this.p();
|
|
42
42
|
}
|
|
43
43
|
get size() {
|
|
44
|
-
return this.
|
|
44
|
+
return this.j;
|
|
45
45
|
}
|
|
46
|
-
|
|
47
|
-
for (const t of this.
|
|
46
|
+
p() {
|
|
47
|
+
for (const t of this.a)
|
|
48
48
|
t.setAttribute("data-size", this.size);
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
@@ -53,7 +53,7 @@ let S = 0, o = class extends u {
|
|
|
53
53
|
*/
|
|
54
54
|
disableTab(t) {
|
|
55
55
|
var e, i;
|
|
56
|
-
(i = (e = this.
|
|
56
|
+
(i = (e = this.a[t]) == null ? void 0 : e.tabGroupActions) == null || i.disable();
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
59
59
|
* Enables a tab by index.
|
|
@@ -61,7 +61,7 @@ let S = 0, o = class extends u {
|
|
|
61
61
|
*/
|
|
62
62
|
enableTab(t) {
|
|
63
63
|
var e, i;
|
|
64
|
-
(i = (e = this.
|
|
64
|
+
(i = (e = this.a[t]) == null ? void 0 : e.tabGroupActions) == null || i.enable();
|
|
65
65
|
}
|
|
66
66
|
/**
|
|
67
67
|
* Activates a tab by index.
|
|
@@ -69,61 +69,61 @@ let S = 0, o = class extends u {
|
|
|
69
69
|
*/
|
|
70
70
|
activateTab(t) {
|
|
71
71
|
var e, i;
|
|
72
|
-
(i = (e = this.
|
|
72
|
+
(i = (e = this.a[t]) == null ? void 0 : e.tabGroupActions) == null || i.select();
|
|
73
73
|
}
|
|
74
|
-
|
|
74
|
+
e() {
|
|
75
75
|
return Array.from(this.children ?? []).filter(
|
|
76
76
|
(t) => /^sbb-tab-title$/u.test(t.localName)
|
|
77
77
|
);
|
|
78
78
|
}
|
|
79
|
-
get
|
|
80
|
-
return this.
|
|
79
|
+
get f() {
|
|
80
|
+
return this.a.filter((t) => !t.hasAttribute("disabled"));
|
|
81
81
|
}
|
|
82
82
|
connectedCallback() {
|
|
83
83
|
var e;
|
|
84
84
|
super.connectedCallback();
|
|
85
|
-
const t = this.
|
|
86
|
-
this.addEventListener("keydown", (i) => this.
|
|
85
|
+
const t = this.l.signal;
|
|
86
|
+
this.addEventListener("keydown", (i) => this.r(i), { signal: t }), this.toggleAttribute("data-nested", !!((e = this.parentElement) != null && e.closest("sbb-tab-group")));
|
|
87
87
|
}
|
|
88
88
|
firstUpdated(t) {
|
|
89
|
-
super.firstUpdated(t), this.
|
|
89
|
+
super.firstUpdated(t), this.a = this.e(), this.a.forEach((e) => this.k(e)), this.s(), this.i.observe(this.c);
|
|
90
90
|
}
|
|
91
91
|
disconnectedCallback() {
|
|
92
|
-
super.disconnectedCallback(), this.
|
|
92
|
+
super.disconnectedCallback(), this.h.disconnect(), this.d.disconnect(), this.i.disconnect();
|
|
93
93
|
}
|
|
94
|
-
|
|
95
|
-
return `sbb-tab-panel-${++
|
|
94
|
+
v() {
|
|
95
|
+
return `sbb-tab-panel-${++I}`;
|
|
96
96
|
}
|
|
97
|
-
|
|
97
|
+
s() {
|
|
98
98
|
var t, e, i;
|
|
99
|
-
this.initialSelectedIndex >= 0 && this.initialSelectedIndex < this.
|
|
99
|
+
this.initialSelectedIndex >= 0 && this.initialSelectedIndex < this.a.length && !this.a[this.initialSelectedIndex].disabled ? (t = this.a[this.initialSelectedIndex].tabGroupActions) == null || t.select() : (i = (e = this.f[0]) == null ? void 0 : e.tabGroupActions) == null || i.select();
|
|
100
100
|
}
|
|
101
|
-
|
|
101
|
+
m(t) {
|
|
102
102
|
var e, i, s;
|
|
103
103
|
for (const a of t) {
|
|
104
104
|
if (a.type !== "attributes")
|
|
105
105
|
return;
|
|
106
106
|
const n = a.target;
|
|
107
|
-
a.attributeName === "disabled" && (n.hasAttribute("disabled") && n !== this.
|
|
107
|
+
a.attributeName === "disabled" && (n.hasAttribute("disabled") && n !== this.b ? (e = n.tabGroupActions) == null || e.disable() : n.disabled && ((i = n.tabGroupActions) == null || i.enable())), a.attributeName === "active" && (n.hasAttribute("active") && !n.disabled ? (s = n.tabGroupActions) == null || s.select() : n === this.b && n.toggleAttribute("active", !0));
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
|
|
110
|
+
n(t) {
|
|
111
111
|
for (const e of t) {
|
|
112
112
|
const i = e.target.firstElementChild.assignedElements();
|
|
113
113
|
for (const s of i)
|
|
114
114
|
s.toggleAttribute(
|
|
115
115
|
"data-has-divider",
|
|
116
116
|
s === i[0] || s.offsetLeft === i[0].offsetLeft
|
|
117
|
-
), this.style.setProperty("--sbb-tab-group-width", `${this.
|
|
117
|
+
), this.style.setProperty("--sbb-tab-group-width", `${this.c.clientWidth}px`);
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
|
-
|
|
120
|
+
o(t) {
|
|
121
121
|
for (const e of t) {
|
|
122
122
|
const i = Math.floor(e.contentRect.height);
|
|
123
|
-
this.
|
|
123
|
+
this.g.style.height = `${i}px`;
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
|
-
|
|
126
|
+
k(t) {
|
|
127
127
|
var e, i;
|
|
128
128
|
t.tabGroupActions = {
|
|
129
129
|
activate: () => {
|
|
@@ -136,29 +136,29 @@ let S = 0, o = class extends u {
|
|
|
136
136
|
},
|
|
137
137
|
disable: () => {
|
|
138
138
|
var s, a, n;
|
|
139
|
-
t.disabled || (t.hasAttribute("disabled") || t.toggleAttribute("disabled", !0), t.disabled = !0, t.tabIndex = -1, t.setAttribute("aria-selected", "false"), (s = t.relatedContent) == null || s.removeAttribute("active"), t.active && (t.removeAttribute("active"), t.active = !1, (n = (a = this.
|
|
139
|
+
t.disabled || (t.hasAttribute("disabled") || t.toggleAttribute("disabled", !0), t.disabled = !0, t.tabIndex = -1, t.setAttribute("aria-selected", "false"), (s = t.relatedContent) == null || s.removeAttribute("active"), t.active && (t.removeAttribute("active"), t.active = !1, (n = (a = this.f[0]) == null ? void 0 : a.tabGroupActions) == null || n.select()));
|
|
140
140
|
},
|
|
141
141
|
enable: () => {
|
|
142
142
|
t.disabled && (t.removeAttribute("disabled"), t.disabled = !1);
|
|
143
143
|
},
|
|
144
144
|
select: () => {
|
|
145
145
|
var s, a;
|
|
146
|
-
if (t !== this.
|
|
147
|
-
const n = this.
|
|
148
|
-
n && ((s = n.tabGroupActions) == null || s.deactivate(), this.
|
|
146
|
+
if (t !== this.b && !t.disabled) {
|
|
147
|
+
const n = this.b;
|
|
148
|
+
n && ((s = n.tabGroupActions) == null || s.deactivate(), this.d.unobserve(n.relatedContent)), (a = t.tabGroupActions) == null || a.activate(), this.b = t, this.d.observe(t.relatedContent), this.q.emit();
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
|
-
}, (e = t.nextElementSibling) != null && e.localName &&
|
|
151
|
+
}, (e = t.nextElementSibling) != null && e.localName && T.includes((i = t.nextElementSibling) == null ? void 0 : i.localName) ? (t.relatedContent = t.nextElementSibling, t.relatedContent.id = this.v(), t.relatedContent.nodeName !== "SBB-TAB-GROUP" && (t.relatedContent.tabIndex = 0)) : (t.insertAdjacentHTML("afterend", "<div>No content.</div>"), t.relatedContent = t.nextElementSibling), t.tabIndex = -1, t.disabled = t.hasAttribute("disabled"), t.active = t.hasAttribute("active") && !t.disabled, t.setAttribute("role", "tab"), t.setAttribute("aria-controls", t.relatedContent.id), t.setAttribute("aria-selected", "false"), t.relatedContent.setAttribute("role", "tabpanel"), t.relatedContent.toggleAttribute("active", t.active), t.addEventListener("click", () => {
|
|
152
152
|
var s;
|
|
153
153
|
(s = t.tabGroupActions) == null || s.select();
|
|
154
|
-
}), this.
|
|
154
|
+
}), this.h.observe(t, S), t.slot = "tab-bar";
|
|
155
155
|
}
|
|
156
|
-
|
|
156
|
+
r(t) {
|
|
157
157
|
var i, s, a;
|
|
158
|
-
const e = this.
|
|
158
|
+
const e = this.f;
|
|
159
159
|
if (!(!e || // don't trap nested handling
|
|
160
160
|
t.target !== this && t.target.parentElement !== this) && g(t)) {
|
|
161
|
-
const n = e.findIndex((
|
|
161
|
+
const n = e.findIndex((b) => b.active), r = m(t, n, e.length);
|
|
162
162
|
(s = (i = e[r]) == null ? void 0 : i.tabGroupActions) == null || s.select(), (a = e[r]) == null || a.focus(), t.preventDefault();
|
|
163
163
|
}
|
|
164
164
|
}
|
|
@@ -167,26 +167,26 @@ let S = 0, o = class extends u {
|
|
|
167
167
|
<div
|
|
168
168
|
class="tab-group"
|
|
169
169
|
role="tablist"
|
|
170
|
-
${p((t) => this.
|
|
170
|
+
${p((t) => this.c = t)}
|
|
171
171
|
>
|
|
172
|
-
<slot name="tab-bar" @slotchange=${this.
|
|
172
|
+
<slot name="tab-bar" @slotchange=${this.u}></slot>
|
|
173
173
|
</div>
|
|
174
174
|
|
|
175
175
|
<div class="tab-content">
|
|
176
|
-
<slot @slotchange=${
|
|
176
|
+
<slot @slotchange=${y(this.t, 150)}></slot>
|
|
177
177
|
</div>
|
|
178
178
|
`;
|
|
179
179
|
}
|
|
180
180
|
};
|
|
181
|
-
o.styles =
|
|
181
|
+
o.styles = E;
|
|
182
182
|
o.events = {
|
|
183
183
|
didChange: "didChange"
|
|
184
184
|
};
|
|
185
185
|
l([
|
|
186
|
-
|
|
186
|
+
c()
|
|
187
187
|
], o.prototype, "size", 1);
|
|
188
188
|
l([
|
|
189
|
-
|
|
189
|
+
c({ attribute: "initial-selected-index", type: Number })
|
|
190
190
|
], o.prototype, "initialSelectedIndex", 2);
|
|
191
191
|
o = l([
|
|
192
192
|
v("sbb-tab-group")
|