@sbb-esta/lyne-elements 2.0.1 → 2.0.2
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 +1 -2
- package/accordion/accordion.d.ts.map +1 -1
- package/accordion.js +39 -44
- package/alert/alert-group/alert-group.d.ts +1 -2
- package/alert/alert-group/alert-group.d.ts.map +1 -1
- package/alert/alert-group.js +29 -34
- package/autocomplete/autocomplete-base-element.d.ts +1 -0
- package/autocomplete/autocomplete-base-element.d.ts.map +1 -1
- 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 +18 -22
- package/autocomplete.js +17 -18
- package/breadcrumb/breadcrumb-group/breadcrumb-group.d.ts +1 -2
- package/breadcrumb/breadcrumb-group/breadcrumb-group.d.ts.map +1 -1
- package/breadcrumb/breadcrumb-group.js +26 -30
- package/button/common.js +4 -4
- package/calendar/calendar.d.ts +3 -3
- package/calendar/calendar.d.ts.map +1 -1
- package/checkbox/checkbox-group/checkbox-group.d.ts +1 -1
- package/checkbox/checkbox-group/checkbox-group.d.ts.map +1 -1
- package/checkbox/checkbox-group.js +34 -36
- package/core/base-elements/button-base-element.d.ts +1 -1
- package/core/base-elements/button-base-element.d.ts.map +1 -1
- package/core/base-elements.js +1 -1
- package/core/controllers/connected-abort-controller.d.ts +4 -0
- package/core/controllers/connected-abort-controller.d.ts.map +1 -1
- package/core/eventing/forward-event.d.ts +7 -1
- package/core/eventing/forward-event.d.ts.map +1 -1
- package/core/eventing.js +14 -12
- package/core/mixins/form-associated-checkbox-mixin.d.ts.map +1 -1
- package/core/mixins/form-associated-radio-button-mixin.d.ts +1 -0
- package/core/mixins/form-associated-radio-button-mixin.d.ts.map +1 -1
- package/core/mixins.js +28 -34
- package/core/styles/core.scss +13 -12
- package/core/styles/mixins/buttons.scss +1 -1
- package/core/styles/mixins/lists.scss +100 -35
- package/core.css +2 -1
- package/custom-elements.json +226 -366
- package/datepicker/common/datepicker-button.d.ts +1 -1
- package/datepicker/common/datepicker-button.d.ts.map +1 -1
- package/datepicker/common.js +24 -24
- package/datepicker/datepicker/datepicker.d.ts +1 -1
- package/datepicker/datepicker/datepicker.d.ts.map +1 -1
- package/datepicker/datepicker-toggle/datepicker-toggle.d.ts +1 -2
- package/datepicker/datepicker-toggle/datepicker-toggle.d.ts.map +1 -1
- package/datepicker/datepicker-toggle.js +76 -75
- package/datepicker/datepicker.js +58 -60
- package/development/accordion/accordion.d.ts +1 -2
- package/development/accordion/accordion.d.ts.map +1 -1
- package/development/accordion.js +16 -23
- package/development/alert/alert-group/alert-group.d.ts +1 -2
- package/development/alert/alert-group/alert-group.d.ts.map +1 -1
- package/development/alert/alert-group.js +12 -17
- package/development/autocomplete/autocomplete-base-element.d.ts +1 -0
- package/development/autocomplete/autocomplete-base-element.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 +9 -12
- package/development/autocomplete.js +12 -12
- package/development/breadcrumb/breadcrumb-group/breadcrumb-group.d.ts +1 -2
- package/development/breadcrumb/breadcrumb-group/breadcrumb-group.d.ts.map +1 -1
- package/development/breadcrumb/breadcrumb-group.js +13 -17
- package/development/button/common.js +20 -6
- package/development/calendar/calendar.d.ts +3 -3
- package/development/calendar/calendar.d.ts.map +1 -1
- package/development/calendar.js +1 -1
- package/development/checkbox/checkbox-group/checkbox-group.d.ts +1 -1
- package/development/checkbox/checkbox-group/checkbox-group.d.ts.map +1 -1
- package/development/checkbox/checkbox-group.js +10 -15
- package/development/core/base-elements/button-base-element.d.ts +1 -1
- package/development/core/base-elements/button-base-element.d.ts.map +1 -1
- package/development/core/base-elements.js +2 -2
- package/development/core/controllers/connected-abort-controller.d.ts +4 -0
- package/development/core/controllers/connected-abort-controller.d.ts.map +1 -1
- package/development/core/controllers.js +1 -1
- package/development/core/eventing/forward-event.d.ts +7 -1
- package/development/core/eventing/forward-event.d.ts.map +1 -1
- package/development/core/eventing.js +5 -3
- package/development/core/mixins/form-associated-checkbox-mixin.d.ts.map +1 -1
- package/development/core/mixins/form-associated-radio-button-mixin.d.ts +1 -0
- package/development/core/mixins/form-associated-radio-button-mixin.d.ts.map +1 -1
- package/development/core/mixins.js +9 -18
- package/development/datepicker/common/datepicker-button.d.ts +1 -1
- package/development/datepicker/common/datepicker-button.d.ts.map +1 -1
- package/development/datepicker/common.js +6 -7
- package/development/datepicker/datepicker/datepicker.d.ts +1 -1
- package/development/datepicker/datepicker/datepicker.d.ts.map +1 -1
- package/development/datepicker/datepicker-toggle/datepicker-toggle.d.ts +1 -2
- package/development/datepicker/datepicker-toggle/datepicker-toggle.d.ts.map +1 -1
- package/development/datepicker/datepicker-toggle.js +14 -14
- package/development/datepicker/datepicker.js +8 -11
- package/development/dialog/dialog/dialog.d.ts +1 -1
- package/development/dialog/dialog/dialog.d.ts.map +1 -1
- package/development/dialog/dialog-content/dialog-content.d.ts.map +1 -1
- package/development/dialog/dialog-content.js +3 -2
- package/development/dialog/dialog.js +7 -13
- package/development/expansion-panel/expansion-panel/expansion-panel.d.ts +1 -1
- package/development/expansion-panel/expansion-panel/expansion-panel.d.ts.map +1 -1
- package/development/expansion-panel/expansion-panel-header/expansion-panel-header.d.ts +1 -2
- package/development/expansion-panel/expansion-panel-header/expansion-panel-header.d.ts.map +1 -1
- package/development/expansion-panel/expansion-panel-header.js +7 -11
- package/development/expansion-panel/expansion-panel.js +5 -7
- package/development/file-selector/common.js +3 -3
- package/development/flip-card/flip-card/flip-card.d.ts +1 -2
- package/development/flip-card/flip-card/flip-card.d.ts.map +1 -1
- package/development/flip-card/flip-card.js +12 -15
- package/development/footer/footer.d.ts +1 -1
- package/development/footer.js +2 -2
- package/development/form-field/form-field-clear/form-field-clear.d.ts +1 -1
- package/development/form-field/form-field-clear/form-field-clear.d.ts.map +1 -1
- package/development/form-field/form-field-clear.js +5 -6
- package/development/image/image.d.ts +2 -2
- package/development/image.js +1 -1
- package/development/map-container/map-container.d.ts.map +1 -1
- package/development/map-container.js +3 -2
- package/development/menu/menu/menu.d.ts +2 -1
- package/development/menu/menu/menu.d.ts.map +1 -1
- package/development/menu/menu.js +20 -13
- package/development/message.js +2 -1
- package/development/navigation/common/navigation-action-common.d.ts +1 -1
- package/development/navigation/common/navigation-action-common.d.ts.map +1 -1
- package/development/navigation/common.js +11 -13
- package/development/navigation/navigation/navigation.d.ts +0 -1
- package/development/navigation/navigation/navigation.d.ts.map +1 -1
- package/development/navigation/navigation-section/navigation-section.d.ts +1 -0
- package/development/navigation/navigation-section/navigation-section.d.ts.map +1 -1
- package/development/navigation/navigation-section.js +5 -6
- package/development/navigation/navigation.js +9 -10
- package/development/notification.js +2 -2
- package/development/option/option/option-base-element.d.ts +1 -1
- package/development/option/option/option-base-element.d.ts.map +1 -1
- package/development/option/option.js +17 -21
- package/development/overlay/overlay-base-element.d.ts +1 -0
- package/development/overlay/overlay-base-element.d.ts.map +1 -1
- package/development/overlay.js +4 -4
- package/development/popover/popover/popover.d.ts.map +1 -1
- package/development/popover/popover.js +6 -3
- package/development/radio-button/common/radio-button-common.d.ts.map +1 -1
- package/development/radio-button/common.js +11 -11
- package/development/radio-button/radio-button-group/radio-button-group.d.ts +3 -3
- package/development/radio-button/radio-button-group/radio-button-group.d.ts.map +1 -1
- package/development/radio-button/radio-button-group.js +5 -9
- package/development/select/select.d.ts +5 -2
- package/development/select/select.d.ts.map +1 -1
- package/development/select.js +59 -34
- package/development/selection-expansion-panel/selection-expansion-panel.d.ts +1 -1
- package/development/selection-expansion-panel/selection-expansion-panel.d.ts.map +1 -1
- package/development/selection-expansion-panel.js +6 -8
- package/development/slider/slider.d.ts +1 -2
- package/development/slider/slider.d.ts.map +1 -1
- package/development/slider.js +6 -8
- package/development/stepper/step/step.d.ts +5 -5
- package/development/stepper/step/step.d.ts.map +1 -1
- package/development/stepper/step-label/step-label.d.ts +1 -1
- package/development/stepper/step-label/step-label.d.ts.map +1 -1
- package/development/stepper/step-label.js +12 -14
- package/development/stepper/step.js +8 -10
- package/development/stepper/stepper/stepper.d.ts +9 -8
- package/development/stepper/stepper/stepper.d.ts.map +1 -1
- package/development/stepper/stepper.js +28 -27
- package/development/tabs/tab-group/tab-group.d.ts +1 -2
- package/development/tabs/tab-group/tab-group.d.ts.map +1 -1
- package/development/tabs/tab-group.js +9 -14
- package/development/tag/tag/tag.d.ts +1 -1
- package/development/tag/tag/tag.d.ts.map +1 -1
- package/development/tag/tag-group/tag-group.d.ts +1 -1
- package/development/tag/tag-group/tag-group.d.ts.map +1 -1
- package/development/tag/tag-group.js +1 -1
- package/development/tag/tag.js +5 -6
- package/development/teaser-hero.js +6 -2
- package/development/time-input/time-input.d.ts +1 -1
- package/development/time-input/time-input.d.ts.map +1 -1
- package/development/time-input.js +6 -4
- package/development/toast/toast.d.ts +1 -1
- package/development/toast/toast.d.ts.map +1 -1
- package/development/toast.js +6 -7
- package/development/toggle/toggle/toggle.d.ts +1 -1
- package/development/toggle/toggle/toggle.d.ts.map +1 -1
- package/development/toggle/toggle-option/toggle-option.d.ts +1 -1
- package/development/toggle/toggle-option/toggle-option.d.ts.map +1 -1
- package/development/toggle/toggle-option.js +9 -13
- package/development/toggle/toggle.js +6 -8
- package/development/train/train-formation/train-formation.d.ts +1 -2
- package/development/train/train-formation/train-formation.d.ts.map +1 -1
- package/development/train/train-formation.js +8 -12
- package/dialog/dialog/dialog.d.ts +1 -1
- package/dialog/dialog/dialog.d.ts.map +1 -1
- package/dialog/dialog-content/dialog-content.d.ts.map +1 -1
- package/dialog/dialog-content.js +8 -7
- package/dialog/dialog.js +36 -42
- package/expansion-panel/expansion-panel/expansion-panel.d.ts +1 -1
- package/expansion-panel/expansion-panel/expansion-panel.d.ts.map +1 -1
- package/expansion-panel/expansion-panel-header/expansion-panel-header.d.ts +1 -2
- package/expansion-panel/expansion-panel-header/expansion-panel-header.d.ts.map +1 -1
- package/expansion-panel/expansion-panel-header.js +29 -33
- package/expansion-panel/expansion-panel.js +58 -60
- package/file-selector/common.js +5 -5
- package/flip-card/flip-card/flip-card.d.ts +1 -2
- package/flip-card/flip-card/flip-card.d.ts.map +1 -1
- package/flip-card/flip-card.js +34 -36
- package/footer/footer.d.ts +1 -1
- package/footer.js +1 -1
- package/form-field/form-field-clear/form-field-clear.d.ts +1 -1
- package/form-field/form-field-clear/form-field-clear.d.ts.map +1 -1
- package/form-field/form-field-clear.js +10 -11
- package/image/image.d.ts +2 -2
- package/lists.css +46 -62
- package/map-container/map-container.d.ts.map +1 -1
- package/map-container.js +22 -21
- package/menu/menu/menu.d.ts +2 -1
- package/menu/menu/menu.d.ts.map +1 -1
- package/menu/menu.js +84 -77
- package/message.js +12 -12
- package/navigation/common/navigation-action-common.d.ts +1 -1
- package/navigation/common/navigation-action-common.d.ts.map +1 -1
- package/navigation/common.js +24 -26
- package/navigation/navigation/navigation.d.ts +0 -1
- package/navigation/navigation/navigation.d.ts.map +1 -1
- package/navigation/navigation-section/navigation-section.d.ts +1 -0
- package/navigation/navigation-section/navigation-section.d.ts.map +1 -1
- package/navigation/navigation-section.js +35 -36
- package/navigation/navigation.js +64 -65
- package/notification.js +1 -1
- package/option/option/option-base-element.d.ts +1 -1
- package/option/option/option-base-element.d.ts.map +1 -1
- package/option/option.js +125 -125
- package/overlay/overlay-base-element.d.ts +1 -0
- package/overlay/overlay-base-element.d.ts.map +1 -1
- package/overlay.js +35 -35
- package/package.json +1 -1
- package/popover/popover/popover.d.ts.map +1 -1
- package/popover/popover.js +6 -3
- package/radio-button/common/radio-button-common.d.ts.map +1 -1
- package/radio-button/common.js +13 -14
- package/radio-button/radio-button-group/radio-button-group.d.ts +3 -3
- package/radio-button/radio-button-group/radio-button-group.d.ts.map +1 -1
- package/radio-button/radio-button-group.js +20 -24
- package/select/select.d.ts +5 -2
- package/select/select.d.ts.map +1 -1
- package/select.js +96 -84
- package/selection-expansion-panel/selection-expansion-panel.d.ts +1 -1
- package/selection-expansion-panel/selection-expansion-panel.d.ts.map +1 -1
- package/selection-expansion-panel.js +17 -18
- package/slider/slider.d.ts +1 -2
- package/slider/slider.d.ts.map +1 -1
- package/slider.js +23 -25
- package/standard-theme.css +48 -63
- package/stepper/step/step.d.ts +5 -5
- package/stepper/step/step.d.ts.map +1 -1
- package/stepper/step-label/step-label.d.ts +1 -1
- package/stepper/step-label/step-label.d.ts.map +1 -1
- package/stepper/step-label.js +16 -18
- package/stepper/step.js +22 -24
- package/stepper/stepper/stepper.d.ts +9 -8
- package/stepper/stepper/stepper.d.ts.map +1 -1
- package/stepper/stepper.js +57 -58
- package/tabs/tab-group/tab-group.d.ts +1 -2
- package/tabs/tab-group/tab-group.d.ts.map +1 -1
- package/tabs/tab-group.js +83 -88
- package/tag/tag/tag.d.ts +1 -1
- package/tag/tag/tag.d.ts.map +1 -1
- package/tag/tag-group/tag-group.d.ts +1 -1
- package/tag/tag-group/tag-group.d.ts.map +1 -1
- package/tag/tag.js +30 -30
- package/teaser-hero.js +19 -19
- package/time-input/time-input.d.ts +1 -1
- package/time-input/time-input.d.ts.map +1 -1
- package/time-input.js +7 -5
- package/toast/toast.d.ts +1 -1
- package/toast/toast.d.ts.map +1 -1
- package/toast.js +32 -33
- package/toggle/toggle/toggle.d.ts +1 -1
- package/toggle/toggle/toggle.d.ts.map +1 -1
- package/toggle/toggle-option/toggle-option.d.ts +1 -1
- package/toggle/toggle-option/toggle-option.d.ts.map +1 -1
- package/toggle/toggle-option.js +31 -35
- package/toggle/toggle.js +31 -33
- package/train/train-formation/train-formation.d.ts +1 -2
- package/train/train-formation/train-formation.d.ts.map +1 -1
- package/train/train-formation.js +35 -39
package/stepper/stepper.js
CHANGED
|
@@ -2,57 +2,59 @@ var C = (i) => {
|
|
|
2
2
|
throw TypeError(i);
|
|
3
3
|
};
|
|
4
4
|
var D = (i, r, a) => r.has(i) || C("Cannot " + a);
|
|
5
|
-
var
|
|
6
|
-
import {
|
|
5
|
+
var x = (i, r, a) => (D(i, r, "read from private field"), a ? a.call(i) : r.get(i)), z = (i, r, a) => r.has(i) ? C("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(i) : r.set(i, a), c = (i, r, a, n) => (D(i, r, "write to private field"), n ? n.call(i, a) : r.set(i, a), a);
|
|
6
|
+
import { __esDecorate as h, __runInitializers as d } from "tslib";
|
|
7
7
|
import { css as B, LitElement as N, html as j } from "lit";
|
|
8
8
|
import { customElement as q, property as _ } from "lit/decorators.js";
|
|
9
9
|
import { isArrowKeyPressed as H, getNextElementIndex as K } from "../core/a11y.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return o = class extends g {
|
|
10
|
+
import { forceType as R } from "../core/decorators.js";
|
|
11
|
+
import { breakpoints as V, isLean as $, isBreakpoint as P } from "../core/dom.js";
|
|
12
|
+
import { SbbHydrationMixin as W } from "../core/mixins.js";
|
|
13
|
+
const G = B`*,: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-duration, 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-duration: 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}`, U = 150;
|
|
14
|
+
let re = (() => {
|
|
15
|
+
var b, p, u, l;
|
|
16
|
+
let i = [q("sbb-stepper")], r, a = [], n, g = W(N), f = [], v, k = [], I = [], y, S, w = [], E = [], A, F = [], O = [], L, T;
|
|
17
|
+
return l = class extends g {
|
|
19
18
|
constructor() {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
var e;
|
|
20
|
+
super();
|
|
21
|
+
z(this, b);
|
|
22
|
+
z(this, p);
|
|
23
|
+
z(this, u);
|
|
24
|
+
c(this, b, (d(this, f), d(this, k, !1))), this._horizontalFrom = (d(this, I), null), c(this, p, d(this, w, "horizontal")), c(this, u, (d(this, E), d(this, F, $() ? "s" : "m"))), this._loaded = (d(this, O), !1), this._resizeObserverTimeout = null, this._onStepperResize = () => {
|
|
25
|
+
this._checkOrientation(), clearTimeout(this._resizeObserverTimeout), this.toggleAttribute("data-disable-animation", !0), this._resizeObserverTimeout = setTimeout(() => this.toggleAttribute("data-disable-animation", !1), U);
|
|
26
|
+
}, (e = this.addEventListener) == null || e.call(this, "keydown", (t) => this._handleKeyDown(t));
|
|
25
27
|
}
|
|
26
28
|
/** If set to true, only the current and previous labels can be clicked and selected. */
|
|
27
29
|
get linear() {
|
|
28
|
-
return
|
|
30
|
+
return x(this, b);
|
|
29
31
|
}
|
|
30
32
|
set linear(e) {
|
|
31
|
-
|
|
33
|
+
c(this, b, e);
|
|
32
34
|
}
|
|
33
35
|
/** Overrides the behaviour of `orientation` property. */
|
|
34
36
|
set horizontalFrom(e) {
|
|
35
|
-
this._horizontalFrom =
|
|
37
|
+
this._horizontalFrom = e && V.includes(e) ? e : null, this._horizontalFrom && this._loaded && this._checkOrientation();
|
|
36
38
|
}
|
|
37
39
|
get horizontalFrom() {
|
|
38
40
|
return this._horizontalFrom;
|
|
39
41
|
}
|
|
40
42
|
/** Steps orientation, either horizontal or vertical. */
|
|
41
43
|
get orientation() {
|
|
42
|
-
return
|
|
44
|
+
return x(this, p);
|
|
43
45
|
}
|
|
44
46
|
set orientation(e) {
|
|
45
|
-
|
|
47
|
+
c(this, p, e);
|
|
46
48
|
}
|
|
47
49
|
/**
|
|
48
50
|
* Size variant, either s or m.
|
|
49
51
|
* @default 'm' / 's' (lean)
|
|
50
52
|
*/
|
|
51
53
|
get size() {
|
|
52
|
-
return
|
|
54
|
+
return x(this, u);
|
|
53
55
|
}
|
|
54
56
|
set size(e) {
|
|
55
|
-
|
|
57
|
+
c(this, u, e);
|
|
56
58
|
}
|
|
57
59
|
/** The currently selected step. */
|
|
58
60
|
set selected(e) {
|
|
@@ -60,14 +62,14 @@ let oe = (() => {
|
|
|
60
62
|
}
|
|
61
63
|
get selected() {
|
|
62
64
|
var e;
|
|
63
|
-
return ((e = this.querySelector) == null ? void 0 : e.call(this, "sbb-step[data-selected]")) ??
|
|
65
|
+
return ((e = this.querySelector) == null ? void 0 : e.call(this, "sbb-step[data-selected]")) ?? null;
|
|
64
66
|
}
|
|
65
67
|
/** The currently selected step index. */
|
|
66
68
|
set selectedIndex(e) {
|
|
67
|
-
this._loaded && this._select(this.steps[e]);
|
|
69
|
+
this._loaded && e !== null && this._select(this.steps[e]);
|
|
68
70
|
}
|
|
69
71
|
get selectedIndex() {
|
|
70
|
-
return this.selected ? this.steps.indexOf(this.selected) :
|
|
72
|
+
return this.selected ? this.steps.indexOf(this.selected) : null;
|
|
71
73
|
}
|
|
72
74
|
/** The steps of the stepper. */
|
|
73
75
|
get steps() {
|
|
@@ -82,17 +84,17 @@ let oe = (() => {
|
|
|
82
84
|
}
|
|
83
85
|
/** Selects the next step. */
|
|
84
86
|
next() {
|
|
85
|
-
this.selectedIndex !==
|
|
87
|
+
this.selectedIndex !== null && this._select(this.steps[this.selectedIndex + 1]);
|
|
86
88
|
}
|
|
87
89
|
/** Selects the previous step. */
|
|
88
90
|
previous() {
|
|
89
|
-
this.selectedIndex !==
|
|
91
|
+
this.selectedIndex !== null && this._select(this.steps[this.selectedIndex - 1]);
|
|
90
92
|
}
|
|
91
93
|
/** Resets the form in which the stepper is nested or every form of each step, if any. */
|
|
92
94
|
reset() {
|
|
93
|
-
var t, s,
|
|
95
|
+
var t, s, o;
|
|
94
96
|
const e = this.closest("form");
|
|
95
|
-
e ? e.reset() : this.querySelectorAll("form").forEach((m) => m.reset()), this.selectedIndex = 0, ((t = document.activeElement) == null ? void 0 : t.closest("sbb-stepper")) === this && ((
|
|
97
|
+
e ? e.reset() : this.querySelectorAll("form").forEach((m) => m.reset()), this.selectedIndex = 0, ((t = document.activeElement) == null ? void 0 : t.closest("sbb-stepper")) === this && ((o = (s = this.selected) == null ? void 0 : s.label) == null || o.focus());
|
|
96
98
|
}
|
|
97
99
|
_isValidStep(e) {
|
|
98
100
|
var t;
|
|
@@ -100,26 +102,26 @@ let oe = (() => {
|
|
|
100
102
|
return !1;
|
|
101
103
|
if (this.linear && !this.selected)
|
|
102
104
|
return e === this.steps[0];
|
|
103
|
-
if (this.linear && this.selectedIndex !==
|
|
105
|
+
if (this.linear && this.selectedIndex !== null) {
|
|
104
106
|
const s = this.steps.indexOf(e);
|
|
105
107
|
return s < this.selectedIndex || s === this.selectedIndex + 1;
|
|
106
108
|
}
|
|
107
109
|
return !0;
|
|
108
110
|
}
|
|
109
111
|
_select(e) {
|
|
110
|
-
var
|
|
112
|
+
var o, m, M;
|
|
111
113
|
if (!this._isValidStep(e))
|
|
112
114
|
return;
|
|
113
115
|
const t = {
|
|
114
116
|
currentIndex: this.selectedIndex,
|
|
115
117
|
currentStep: this.selected,
|
|
116
|
-
nextIndex: this.selectedIndex !==
|
|
117
|
-
nextStep: this.selectedIndex !==
|
|
118
|
+
nextIndex: this.selectedIndex !== null ? this.selectedIndex + 1 : null,
|
|
119
|
+
nextStep: this.selectedIndex !== null ? this.steps[this.selectedIndex + 1] : null
|
|
118
120
|
};
|
|
119
121
|
if (this.selected && !this.selected.validate(t))
|
|
120
122
|
return;
|
|
121
123
|
const s = this.selected;
|
|
122
|
-
s == null || s.deselect(), e.select(), this._setMarkerSize(), this._configureLinearMode(), ((
|
|
124
|
+
s == null || s.deselect(), e.select(), this._setMarkerSize(), this._configureLinearMode(), ((o = document.activeElement) == null ? void 0 : o.closest("sbb-stepper")) === this && ((M = (m = this.selected) == null ? void 0 : m.label) == null || M.focus());
|
|
123
125
|
}
|
|
124
126
|
_setMarkerSize() {
|
|
125
127
|
if (!this._loaded || !this.selected || this.selectedIndex === void 0 || !this.selected.label)
|
|
@@ -128,7 +130,7 @@ let oe = (() => {
|
|
|
128
130
|
this.style.setProperty("--sbb-stepper-marker-size", `${e}px`);
|
|
129
131
|
}
|
|
130
132
|
_calculateLabelOffsetTop() {
|
|
131
|
-
if (this.selectedIndex ===
|
|
133
|
+
if (this.selectedIndex === null)
|
|
132
134
|
return;
|
|
133
135
|
let e = 0;
|
|
134
136
|
for (const t of this.steps) {
|
|
@@ -140,8 +142,8 @@ let oe = (() => {
|
|
|
140
142
|
}
|
|
141
143
|
_configure() {
|
|
142
144
|
const e = this.steps;
|
|
143
|
-
e.forEach((t) => t.configure(this._loaded)), e.filter((t) => t.label).map((t) => t.label).forEach((t, s,
|
|
144
|
-
t.configure(s + 1,
|
|
145
|
+
e.forEach((t) => t.configure(this._loaded)), e.filter((t) => t.label).map((t) => t.label).forEach((t, s, o) => {
|
|
146
|
+
t.configure(s + 1, o.length, this._loaded);
|
|
145
147
|
}), this._select(this.selected || this._enabledSteps[0]), this._proxySize();
|
|
146
148
|
}
|
|
147
149
|
_updateLabels() {
|
|
@@ -151,10 +153,7 @@ let oe = (() => {
|
|
|
151
153
|
});
|
|
152
154
|
}
|
|
153
155
|
_checkOrientation() {
|
|
154
|
-
this.horizontalFrom && (this.orientation =
|
|
155
|
-
}
|
|
156
|
-
_onStepperResize() {
|
|
157
|
-
this._checkOrientation(), clearTimeout(this._resizeObserverTimeout), this.toggleAttribute("data-disable-animation", !0), this._resizeObserverTimeout = setTimeout(() => this.toggleAttribute("data-disable-animation", !1), U);
|
|
156
|
+
this.horizontalFrom && (this.orientation = P(this.horizontalFrom) ? "horizontal" : "vertical", this._updateLabels()), setTimeout(() => this._setMarkerSize(), 0);
|
|
158
157
|
}
|
|
159
158
|
_configureLinearMode() {
|
|
160
159
|
this.steps.forEach((e, t) => {
|
|
@@ -163,13 +162,13 @@ let oe = (() => {
|
|
|
163
162
|
});
|
|
164
163
|
}
|
|
165
164
|
connectedCallback() {
|
|
166
|
-
super.connectedCallback()
|
|
167
|
-
const e = this._abort.signal;
|
|
168
|
-
this.addEventListener("keydown", (t) => this._handleKeyDown(t), { signal: e }), window.addEventListener("resize", () => this._onStepperResize(), {
|
|
169
|
-
signal: e,
|
|
165
|
+
super.connectedCallback(), window.addEventListener("resize", this._onStepperResize, {
|
|
170
166
|
passive: !0
|
|
171
167
|
}), this.toggleAttribute("data-disable-animation", !this._loaded);
|
|
172
168
|
}
|
|
169
|
+
disconnectedCallback() {
|
|
170
|
+
super.disconnectedCallback(), window.removeEventListener("resize", this._onStepperResize);
|
|
171
|
+
}
|
|
173
172
|
async firstUpdated(e) {
|
|
174
173
|
super.firstUpdated(e), await this.updateComplete, this._loaded = !0, this.selectedIndex = this.linear ? 0 : Number(this.getAttribute("selected-index")) || 0, this._checkOrientation(), setTimeout(() => this.toggleAttribute("data-disable-animation", !1), U);
|
|
175
174
|
}
|
|
@@ -186,8 +185,8 @@ let oe = (() => {
|
|
|
186
185
|
const t = this._enabledSteps;
|
|
187
186
|
if (!(!t || // don't trap nested handling
|
|
188
187
|
e.target !== this && e.target.parentElement !== this) && H(e)) {
|
|
189
|
-
const s = t.indexOf(this.selected),
|
|
190
|
-
this._select(t[
|
|
188
|
+
const s = t.indexOf(this.selected), o = K(e, s, t.length);
|
|
189
|
+
this._select(t[o]), e.preventDefault();
|
|
191
190
|
}
|
|
192
191
|
}
|
|
193
192
|
render() {
|
|
@@ -202,23 +201,23 @@ let oe = (() => {
|
|
|
202
201
|
</div>
|
|
203
202
|
`;
|
|
204
203
|
}
|
|
205
|
-
}, b = new WeakMap(), p = new WeakMap(), u = new WeakMap(),
|
|
204
|
+
}, b = new WeakMap(), p = new WeakMap(), u = new WeakMap(), n = l, (() => {
|
|
206
205
|
const e = typeof Symbol == "function" && Symbol.metadata ? Object.create(g[Symbol.metadata] ?? null) : void 0;
|
|
207
|
-
|
|
206
|
+
v = [R(), _({ type: Boolean })], y = [_({ attribute: "horizontal-from", reflect: !0 })], S = [_({ reflect: !0 })], A = [_({ reflect: !0 })], L = [_({ attribute: !1 })], T = [_({ attribute: "selected-index", type: Number })], h(l, null, v, { kind: "accessor", name: "linear", static: !1, private: !1, access: { has: (t) => "linear" in t, get: (t) => t.linear, set: (t, s) => {
|
|
208
207
|
t.linear = s;
|
|
209
|
-
} }, metadata: e }, k, I),
|
|
208
|
+
} }, metadata: e }, k, I), h(l, null, y, { kind: "setter", name: "horizontalFrom", static: !1, private: !1, access: { has: (t) => "horizontalFrom" in t, set: (t, s) => {
|
|
210
209
|
t.horizontalFrom = s;
|
|
211
|
-
} }, metadata: e }, null, f),
|
|
210
|
+
} }, metadata: e }, null, f), h(l, null, S, { kind: "accessor", name: "orientation", static: !1, private: !1, access: { has: (t) => "orientation" in t, get: (t) => t.orientation, set: (t, s) => {
|
|
212
211
|
t.orientation = s;
|
|
213
|
-
} }, metadata: e }, w, E),
|
|
212
|
+
} }, metadata: e }, w, E), h(l, null, A, { kind: "accessor", name: "size", static: !1, private: !1, access: { has: (t) => "size" in t, get: (t) => t.size, set: (t, s) => {
|
|
214
213
|
t.size = s;
|
|
215
|
-
} }, metadata: e }, F, O),
|
|
214
|
+
} }, metadata: e }, F, O), h(l, null, L, { kind: "setter", name: "selected", static: !1, private: !1, access: { has: (t) => "selected" in t, set: (t, s) => {
|
|
216
215
|
t.selected = s;
|
|
217
|
-
} }, metadata: e }, null, f),
|
|
216
|
+
} }, metadata: e }, null, f), h(l, null, T, { kind: "setter", name: "selectedIndex", static: !1, private: !1, access: { has: (t) => "selectedIndex" in t, set: (t, s) => {
|
|
218
217
|
t.selectedIndex = s;
|
|
219
|
-
} }, metadata: e }, null, f),
|
|
220
|
-
})(),
|
|
218
|
+
} }, metadata: e }, null, f), h(null, r = { value: n }, i, { kind: "class", name: n.name, metadata: e }, null, a), n = r.value, e && Object.defineProperty(n, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: e });
|
|
219
|
+
})(), l.styles = G, d(n, a), n;
|
|
221
220
|
})();
|
|
222
221
|
export {
|
|
223
|
-
|
|
222
|
+
re as SbbStepperElement
|
|
224
223
|
};
|
|
@@ -41,7 +41,6 @@ export declare class SbbTabGroupElement extends SbbTabGroupElement_base {
|
|
|
41
41
|
private _selectedTab?;
|
|
42
42
|
private _tabGroupElement;
|
|
43
43
|
private _tabContentElement;
|
|
44
|
-
private _abort;
|
|
45
44
|
private _tabAttributeObserver;
|
|
46
45
|
private _tabGroupResizeObserver;
|
|
47
46
|
private _tabContentResizeObserver;
|
|
@@ -59,7 +58,7 @@ export declare class SbbTabGroupElement extends SbbTabGroupElement_base {
|
|
|
59
58
|
accessor initialSelectedIndex: number;
|
|
60
59
|
/** Emits an event on selected tab change. */
|
|
61
60
|
private _selectedTabChanged;
|
|
62
|
-
|
|
61
|
+
constructor();
|
|
63
62
|
protected firstUpdated(changedProperties: PropertyValues<this>): void;
|
|
64
63
|
/**
|
|
65
64
|
* Disables a tab by index.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tab-group.d.ts","sourceRoot":"","sources":["../../../../src/elements/tabs/tab-group/tab-group.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAC1E,OAAO,EAAQ,UAAU,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"tab-group.d.ts","sourceRoot":"","sources":["../../../../src/elements/tabs/tab-group/tab-group.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAC1E,OAAO,EAAQ,UAAU,EAAE,MAAM,KAAK,CAAC;AASvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAI1C,MAAM,MAAM,yBAAyB,GAAG;IACtC,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,kBAAkB,CAAC;IACnC,SAAS,EAAE,aAAa,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,kBAAkB,GAAG,SAAS,CAAC;IACjD,WAAW,EAAE,aAAa,GAAG,SAAS,CAAC;CACxC,CAAC;AAEF,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,IAAI,IAAI,CAAC;IACjB,UAAU,IAAI,IAAI,CAAC;IACnB,MAAM,IAAI,IAAI,CAAC;IACf,OAAO,IAAI,IAAI,CAAC;IAChB,MAAM,IAAI,IAAI,CAAC;CAChB;AAED,MAAM,WAAW,uBAAwB,SAAQ,kBAAkB;IACjE,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,GAAG,CAAC,EAAE,aAAa,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,2BAA2B,CAAC;IAC9C,IAAI,EAAE,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;CACxB;;AAQD;;;;;;GAMG;AACH,qBAEM,kBAAmB,SAAQ,uBAA6B;IAC5D,OAAuB,MAAM,EAAE,cAAc,CAAS;IACtD,gBAAuB,MAAM;;MAElB;IAEX,OAAO,CAAC,KAAK,CAAiC;IAC9C,OAAO,CAAC,YAAY,CAAC,CAA0B;IAC/C,OAAO,CAAC,gBAAgB,CAAe;IACvC,OAAO,CAAC,kBAAkB,CAAe;IACzC,OAAO,CAAC,qBAAqB,CAI1B;IACH,OAAO,CAAC,uBAAuB,CAI5B;IACH,OAAO,CAAC,yBAAyB,CAI9B;IAEH;;;OAGG;IACH,IACW,IAAI,CAAC,KAAK,EAAE,uBAAuB,CAAC,MAAM,CAAC,EAGrD;IACD,IAAW,IAAI,IAAI,uBAAuB,CAAC,MAAM,CAAC,CAEjD;IACD,OAAO,CAAC,KAAK,CAAyD;IAEtE;;;OAGG;IACH,SAEgB,oBAAoB,EAAE,MAAM,CAAK;IAEjD,6CAA6C;IAC7C,OAAO,CAAC,mBAAmB,CAGzB;;cAOiB,YAAY,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;IAS9E;;;OAGG;IACI,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAIzC;;;OAGG;IACI,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAIxC;;;OAGG;IACI,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAI1C,OAAO,CAAC,QAAQ;IAMhB,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,WAAW;IAMnB,OAAO,CAAC,oBAAoB,CAY1B;IAEF,OAAO,CAAC,iBAAiB,CAavB;IAEF,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,cAAc;IAYtB,OAAO,CAAC,sBAAsB;IAwB9B,OAAO,CAAC,wBAAwB;IAgBhC,OAAO,CAAC,0BAA0B;IAWlC,OAAO,CAAC,UAAU;IAmGlB,OAAO,CAAC,cAAc;cAoBH,MAAM,IAAI,cAAc;CAe5C;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,eAAe,EAAE,kBAAkB,CAAC;KACrC;CACF"}
|
package/tabs/tab-group.js
CHANGED
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
var
|
|
2
|
-
throw TypeError(
|
|
1
|
+
var I = (n) => {
|
|
2
|
+
throw TypeError(n);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var y = (
|
|
6
|
-
import {
|
|
4
|
+
var S = (n, r, l) => r.has(n) || I("Cannot " + l);
|
|
5
|
+
var y = (n, r, l) => (S(n, r, "read from private field"), l ? l.call(n) : r.get(n)), z = (n, r, l) => r.has(n) ? I("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(n) : r.set(n, l), _ = (n, r, l, c) => (S(n, r, "write to private field"), c ? c.call(n, l) : r.set(n, l), l);
|
|
6
|
+
import { __esDecorate as m, __runInitializers as h } from "tslib";
|
|
7
7
|
import { MutationController as w } from "@lit-labs/observers/mutation-controller.js";
|
|
8
8
|
import { ResizeController as E } from "@lit-labs/observers/resize-controller.js";
|
|
9
9
|
import { css as k, LitElement as R, html as O } from "lit";
|
|
10
10
|
import { customElement as $, property as C } from "lit/decorators.js";
|
|
11
11
|
import { ref as D } from "lit/directives/ref.js";
|
|
12
12
|
import { isArrowKeyPressed as N, getNextElementIndex as K } from "../core/a11y.js";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
const W = k`*,:before,:after{box-sizing:border-box}:host{--sbb-tab-group-animation-duration: var( --sbb-disable-animation-duration, 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 ::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)}`, B = {
|
|
13
|
+
import { forceType as M } from "../core/decorators.js";
|
|
14
|
+
import { isLean as P } from "../core/dom.js";
|
|
15
|
+
import { EventEmitter as j, throttle as H } from "../core/eventing.js";
|
|
16
|
+
import { SbbHydrationMixin as U } from "../core/mixins.js";
|
|
17
|
+
import { SbbTabElement as q } from "./tab.js";
|
|
18
|
+
const F = k`*,:before,:after{box-sizing:border-box}:host{--sbb-tab-group-animation-duration: var( --sbb-disable-animation-duration, 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 ::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)}`, W = {
|
|
20
19
|
attributeFilter: ["active", "disabled"]
|
|
21
20
|
};
|
|
22
|
-
let
|
|
21
|
+
let B = 0, ot = (() => {
|
|
23
22
|
var b, d;
|
|
24
|
-
let
|
|
25
|
-
var f = (d = class extends
|
|
23
|
+
let n = [$("sbb-tab-group")], r, l = [], c, v = U(R), p = [], g, A, x = [], T = [];
|
|
24
|
+
var f = (d = class extends v {
|
|
26
25
|
constructor() {
|
|
27
|
-
|
|
26
|
+
var t;
|
|
27
|
+
super();
|
|
28
28
|
z(this, b);
|
|
29
|
-
this._tabs = (h(this,
|
|
29
|
+
this._tabs = (h(this, p), []), this._tabAttributeObserver = new w(this, {
|
|
30
30
|
target: null,
|
|
31
|
-
config:
|
|
32
|
-
callback: (
|
|
31
|
+
config: W,
|
|
32
|
+
callback: (e) => this._onTabAttributesChange(e)
|
|
33
33
|
}), this._tabGroupResizeObserver = new E(this, {
|
|
34
34
|
target: null,
|
|
35
35
|
skipInitial: !0,
|
|
36
|
-
callback: (
|
|
36
|
+
callback: (e) => this._onTabGroupElementResize(e)
|
|
37
37
|
}), this._tabContentResizeObserver = new E(this, {
|
|
38
38
|
target: null,
|
|
39
39
|
skipInitial: !0,
|
|
40
|
-
callback: (
|
|
41
|
-
}), this._size =
|
|
42
|
-
var i,
|
|
40
|
+
callback: (e) => this._onTabContentElementResize(e)
|
|
41
|
+
}), this._size = P() ? "s" : "l", _(this, b, h(this, x, 0)), this._selectedTabChanged = (h(this, T), new j(this, f.events.didChange)), this._onContentSlotChange = () => {
|
|
42
|
+
var i, a;
|
|
43
43
|
this._tabContentElement = this.shadowRoot.querySelector("div.tab-content");
|
|
44
|
-
const
|
|
45
|
-
|
|
44
|
+
const e = this._getTabs().filter((s) => !this._tabs.includes(s));
|
|
45
|
+
e.length && (e.forEach((s) => this._configure(s)), this._tabs = this._tabs.concat(e), (a = (i = e.find((s) => s.active)) == null ? void 0 : i.tabGroupActions) == null || a.select());
|
|
46
46
|
}, this._onTabsSlotChange = () => {
|
|
47
|
-
const
|
|
48
|
-
|
|
47
|
+
const e = this._getTabs();
|
|
48
|
+
e.length < this._tabs.length && (this._tabs.filter((a) => !e.includes(a)).forEach((a) => {
|
|
49
49
|
var s;
|
|
50
|
-
(s =
|
|
51
|
-
}), this._tabs =
|
|
52
|
-
};
|
|
50
|
+
(s = a.tab) == null || s.remove();
|
|
51
|
+
}), this._tabs = e), this._tabs.forEach((i) => i.setAttribute("data-size", this.size));
|
|
52
|
+
}, (t = this.addEventListener) == null || t.call(this, "keydown", (e) => this._handleKeyDown(e));
|
|
53
53
|
}
|
|
54
54
|
/**
|
|
55
55
|
* Size variant, either s, l or xl.
|
|
@@ -69,39 +69,34 @@ let J = 0, ct = (() => {
|
|
|
69
69
|
return y(this, b);
|
|
70
70
|
}
|
|
71
71
|
set initialSelectedIndex(t) {
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
connectedCallback() {
|
|
75
|
-
super.connectedCallback();
|
|
76
|
-
const t = this._abort.signal;
|
|
77
|
-
this.addEventListener("keydown", (i) => this._handleKeyDown(i), { signal: t });
|
|
72
|
+
_(this, b, t);
|
|
78
73
|
}
|
|
79
74
|
firstUpdated(t) {
|
|
80
|
-
super.firstUpdated(t), this._tabs = this._getTabs(), this._tabs.forEach((
|
|
75
|
+
super.firstUpdated(t), this._tabs = this._getTabs(), this._tabs.forEach((e) => this._configure(e)), this._initSelection(), this._tabGroupResizeObserver.observe(this._tabGroupElement);
|
|
81
76
|
}
|
|
82
77
|
/**
|
|
83
78
|
* Disables a tab by index.
|
|
84
79
|
* @param tabIndex The index of the tab you want to disable.
|
|
85
80
|
*/
|
|
86
81
|
disableTab(t) {
|
|
87
|
-
var
|
|
88
|
-
(
|
|
82
|
+
var e, i;
|
|
83
|
+
(i = (e = this._tabs[t]) == null ? void 0 : e.tabGroupActions) == null || i.disable();
|
|
89
84
|
}
|
|
90
85
|
/**
|
|
91
86
|
* Enables a tab by index.
|
|
92
87
|
* @param tabIndex The index of the tab you want to enable.
|
|
93
88
|
*/
|
|
94
89
|
enableTab(t) {
|
|
95
|
-
var
|
|
96
|
-
(
|
|
90
|
+
var e, i;
|
|
91
|
+
(i = (e = this._tabs[t]) == null ? void 0 : e.tabGroupActions) == null || i.enable();
|
|
97
92
|
}
|
|
98
93
|
/**
|
|
99
94
|
* Activates a tab by index.
|
|
100
95
|
* @param tabIndex The index of the tab you want to activate.
|
|
101
96
|
*/
|
|
102
97
|
activateTab(t) {
|
|
103
|
-
var
|
|
104
|
-
(
|
|
98
|
+
var e, i;
|
|
99
|
+
(i = (e = this._tabs[t]) == null ? void 0 : e.tabGroupActions) == null || i.select();
|
|
105
100
|
}
|
|
106
101
|
_getTabs() {
|
|
107
102
|
return Array.from(this.children ?? []).filter((t) => /^sbb-tab-label$/u.test(t.localName));
|
|
@@ -114,81 +109,81 @@ let J = 0, ct = (() => {
|
|
|
114
109
|
t.setAttribute("data-size", this.size);
|
|
115
110
|
}
|
|
116
111
|
_assignId() {
|
|
117
|
-
return `sbb-tab-panel-${++
|
|
112
|
+
return `sbb-tab-panel-${++B}`;
|
|
118
113
|
}
|
|
119
114
|
_initSelection() {
|
|
120
|
-
var t,
|
|
121
|
-
this.initialSelectedIndex >= 0 && this.initialSelectedIndex < this._tabs.length && !this._tabs[this.initialSelectedIndex].disabled ? (t = this._tabs[this.initialSelectedIndex].tabGroupActions) == null || t.select() : (
|
|
115
|
+
var t, e, i;
|
|
116
|
+
this.initialSelectedIndex >= 0 && this.initialSelectedIndex < this._tabs.length && !this._tabs[this.initialSelectedIndex].disabled ? (t = this._tabs[this.initialSelectedIndex].tabGroupActions) == null || t.select() : (i = (e = this._enabledTabs()[0]) == null ? void 0 : e.tabGroupActions) == null || i.select();
|
|
122
117
|
}
|
|
123
118
|
_onTabAttributesChange(t) {
|
|
124
|
-
var
|
|
125
|
-
for (const
|
|
126
|
-
if (
|
|
119
|
+
var e, i, a;
|
|
120
|
+
for (const s of t) {
|
|
121
|
+
if (s.type !== "attributes")
|
|
127
122
|
return;
|
|
128
|
-
const o =
|
|
129
|
-
|
|
123
|
+
const o = s.target;
|
|
124
|
+
s.attributeName === "disabled" && (o.hasAttribute("disabled") && o !== this._selectedTab ? (e = o.tabGroupActions) == null || e.disable() : o.disabled && ((i = o.tabGroupActions) == null || i.enable())), s.attributeName === "active" && (o.hasAttribute("active") && !o.disabled ? (a = o.tabGroupActions) == null || a.select() : o === this._selectedTab && o.toggleAttribute("active", !0));
|
|
130
125
|
}
|
|
131
126
|
}
|
|
132
127
|
_onTabGroupElementResize(t) {
|
|
133
|
-
for (const
|
|
134
|
-
const
|
|
135
|
-
for (const
|
|
136
|
-
|
|
128
|
+
for (const e of t) {
|
|
129
|
+
const i = e.target.firstElementChild.assignedElements();
|
|
130
|
+
for (const a of i)
|
|
131
|
+
a.toggleAttribute("data-has-divider", a === i[0] || a.offsetLeft === i[0].offsetLeft), this.style.setProperty("--sbb-tab-group-width", `${this._tabGroupElement.clientWidth}px`);
|
|
137
132
|
}
|
|
138
133
|
}
|
|
139
134
|
_onTabContentElementResize(t) {
|
|
140
135
|
if (this._tabContentElement)
|
|
141
|
-
for (const
|
|
142
|
-
const
|
|
143
|
-
this._tabContentElement.style.height = `${
|
|
136
|
+
for (const e of t) {
|
|
137
|
+
const i = Math.floor(e.contentRect.height);
|
|
138
|
+
this._tabContentElement.style.height = `${i}px`;
|
|
144
139
|
}
|
|
145
140
|
}
|
|
146
141
|
_configure(t) {
|
|
147
|
-
var
|
|
142
|
+
var e;
|
|
148
143
|
t.tabGroupActions = {
|
|
149
144
|
activate: () => {
|
|
150
|
-
var
|
|
151
|
-
t.toggleAttribute("active", !0), t.active = !0, t.tabIndex = 0, t.setAttribute("aria-selected", "true"), (
|
|
145
|
+
var i;
|
|
146
|
+
t.toggleAttribute("active", !0), t.active = !0, t.tabIndex = 0, t.setAttribute("aria-selected", "true"), (i = t.tab) == null || i.toggleAttribute("active", !0);
|
|
152
147
|
},
|
|
153
148
|
deactivate: () => {
|
|
154
|
-
var
|
|
155
|
-
t.removeAttribute("active"), t.active = !1, t.tabIndex = -1, t.setAttribute("aria-selected", "false"), (
|
|
149
|
+
var i;
|
|
150
|
+
t.removeAttribute("active"), t.active = !1, t.tabIndex = -1, t.setAttribute("aria-selected", "false"), (i = t.tab) == null || i.removeAttribute("active");
|
|
156
151
|
},
|
|
157
152
|
disable: () => {
|
|
158
|
-
var
|
|
159
|
-
t.disabled || (t.hasAttribute("disabled") || t.toggleAttribute("disabled", !0), t.disabled = !0, t.tabIndex = -1, t.setAttribute("aria-selected", "false"), (
|
|
153
|
+
var i, a, s;
|
|
154
|
+
t.disabled || (t.hasAttribute("disabled") || t.toggleAttribute("disabled", !0), t.disabled = !0, t.tabIndex = -1, t.setAttribute("aria-selected", "false"), (i = t.tab) == null || i.removeAttribute("active"), t.active && (t.removeAttribute("active"), t.active = !1, (s = (a = this._enabledTabs()[0]) == null ? void 0 : a.tabGroupActions) == null || s.select()));
|
|
160
155
|
},
|
|
161
156
|
enable: () => {
|
|
162
157
|
t.disabled && (t.removeAttribute("disabled"), t.disabled = !1);
|
|
163
158
|
},
|
|
164
159
|
select: () => {
|
|
165
|
-
var
|
|
160
|
+
var i, a;
|
|
166
161
|
if (t !== this._selectedTab && !t.disabled) {
|
|
167
|
-
const
|
|
168
|
-
|
|
162
|
+
const s = this._selectedTab;
|
|
163
|
+
s && ((i = s.tabGroupActions) == null || i.deactivate(), this._tabContentResizeObserver.unobserve(s.tab)), (a = t.tabGroupActions) == null || a.activate(), this._selectedTab = t, this._tabContentResizeObserver.observe(t.tab);
|
|
169
164
|
const o = this._tabs;
|
|
170
165
|
this._selectedTabChanged.emit({
|
|
171
166
|
activeIndex: o.findIndex((u) => u === t),
|
|
172
167
|
activeTabLabel: t,
|
|
173
168
|
activeTab: t.tab,
|
|
174
|
-
previousIndex: o.findIndex((u) => u ===
|
|
175
|
-
previousTabLabel:
|
|
176
|
-
previousTab:
|
|
169
|
+
previousIndex: o.findIndex((u) => u === s),
|
|
170
|
+
previousTabLabel: s,
|
|
171
|
+
previousTab: s == null ? void 0 : s.tab
|
|
177
172
|
});
|
|
178
173
|
}
|
|
179
174
|
}
|
|
180
|
-
}, ((
|
|
181
|
-
var
|
|
182
|
-
(
|
|
175
|
+
}, ((e = t.nextElementSibling) == null ? void 0 : e.localName) === "sbb-tab" && (t.tab = t.nextElementSibling, t.tab.id = this._assignId(), t.tab instanceof q && (t.tab.tabIndex = 0, t.tab.configure())), t.tabIndex = -1, t.disabled = t.hasAttribute("disabled"), t.active = t.hasAttribute("active") && !t.disabled, t.setAttribute("role", "tab"), t.setAttribute("aria-selected", String(t.active)), t.addEventListener("click", () => {
|
|
176
|
+
var i;
|
|
177
|
+
(i = t.tabGroupActions) == null || i.select();
|
|
183
178
|
}), t.tab && (t.setAttribute("aria-controls", t.tab.id), t.tab.setAttribute("role", "tabpanel"), t.tab.toggleAttribute("active", t.active)), this._tabAttributeObserver.observe(t), t.slot = "tab-bar";
|
|
184
179
|
}
|
|
185
180
|
_handleKeyDown(t) {
|
|
186
|
-
var
|
|
187
|
-
const
|
|
188
|
-
if (!(!
|
|
181
|
+
var i, a, s;
|
|
182
|
+
const e = this._enabledTabs();
|
|
183
|
+
if (!(!e || // don't trap nested handling
|
|
189
184
|
t.target !== this && t.target.parentElement !== this) && N(t)) {
|
|
190
|
-
const o =
|
|
191
|
-
(
|
|
185
|
+
const o = e.findIndex((G) => G.active), u = K(t, o, e.length);
|
|
186
|
+
(a = (i = e[u]) == null ? void 0 : i.tabGroupActions) == null || a.select(), (s = e[u]) == null || s.focus(), t.preventDefault();
|
|
192
187
|
}
|
|
193
188
|
}
|
|
194
189
|
render() {
|
|
@@ -202,22 +197,22 @@ let J = 0, ct = (() => {
|
|
|
202
197
|
</div>
|
|
203
198
|
|
|
204
199
|
<div class="tab-content">
|
|
205
|
-
<slot @slotchange=${
|
|
200
|
+
<slot @slotchange=${H(this._onContentSlotChange, 150)}></slot>
|
|
206
201
|
</div>
|
|
207
202
|
`;
|
|
208
203
|
}
|
|
209
204
|
}, b = new WeakMap(), c = d, (() => {
|
|
210
|
-
const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(
|
|
211
|
-
g = [C()], A = [
|
|
212
|
-
|
|
213
|
-
} }, metadata: t }, null,
|
|
214
|
-
|
|
215
|
-
} }, metadata: t }, x, T),
|
|
216
|
-
})(), d.styles =
|
|
205
|
+
const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(v[Symbol.metadata] ?? null) : void 0;
|
|
206
|
+
g = [C()], A = [M(), C({ attribute: "initial-selected-index", type: Number })], m(d, null, g, { kind: "setter", name: "size", static: !1, private: !1, access: { has: (e) => "size" in e, set: (e, i) => {
|
|
207
|
+
e.size = i;
|
|
208
|
+
} }, metadata: t }, null, p), m(d, null, A, { kind: "accessor", name: "initialSelectedIndex", static: !1, private: !1, access: { has: (e) => "initialSelectedIndex" in e, get: (e) => e.initialSelectedIndex, set: (e, i) => {
|
|
209
|
+
e.initialSelectedIndex = i;
|
|
210
|
+
} }, metadata: t }, x, T), m(null, r = { value: c }, n, { kind: "class", name: c.name, metadata: t }, null, l), f = c = r.value, t && Object.defineProperty(c, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: t });
|
|
211
|
+
})(), d.styles = F, d.events = {
|
|
217
212
|
didChange: "didChange"
|
|
218
213
|
}, h(c, l), d);
|
|
219
214
|
return f = c;
|
|
220
215
|
})();
|
|
221
216
|
export {
|
|
222
|
-
|
|
217
|
+
ot as SbbTabGroupElement
|
|
223
218
|
};
|
package/tag/tag/tag.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ export declare class SbbTagElement extends SbbTagElement_base {
|
|
|
36
36
|
private _didChange;
|
|
37
37
|
/** Change event emitter */
|
|
38
38
|
private _change;
|
|
39
|
-
|
|
39
|
+
constructor();
|
|
40
40
|
connectedCallback(): void;
|
|
41
41
|
/** Method triggered on button click. Inverts the checked value and emits events. */
|
|
42
42
|
private _handleClick;
|
package/tag/tag/tag.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../../../src/elements/tag/tag/tag.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAI1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../../../src/elements/tag/tag/tag.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAI1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAUnE,MAAM,MAAM,UAAU,GAAG,GAAG,GAAG,GAAG,CAAC;;AAEnC;;;;;;;;;GASG;AACH,qBAGM,aAAc,SAAQ,kBAAsE;IAChG,OAAuB,MAAM,EAAE,cAAc,CAAS;IACtD,gBAAuB,MAAM;;;;MAIlB;IAEX,uCAAuC;IACvC,SAEgB,MAAM,EAAE,MAAM,CAAM;IAEpC,kCAAkC;IAClC,SAEgB,OAAO,EAAE,OAAO,CAAS;IAEzC;;;OAGG;IACH,SAEgB,IAAI,EAAE,UAAU,CAAwB;IAExD,4CAA4C;IAC5C,OAAO,CAAC,MAAM,CAAmC;IAEjD,0BAA0B;IAC1B,OAAO,CAAC,MAAM,CAGX;IAEH,4FAA4F;IAC5F,OAAO,CAAC,UAAU,CAEf;IAEH,2BAA2B;IAC3B,OAAO,CAAC,OAAO,CAEZ;;IAOa,iBAAiB,IAAI,IAAI;IAKzC,oFAAoF;IACpF,OAAO,CAAC,YAAY;cAgBD,UAAU,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;cAazD,cAAc,IAAI,cAAc;CAWpD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,SAAS,EAAE,aAAa,CAAC;KAC1B;CACF"}
|
|
@@ -31,7 +31,7 @@ export declare class SbbTagGroupElement extends SbbTagGroupElement_base {
|
|
|
31
31
|
* If set multiple to false, the value is a string (or null).
|
|
32
32
|
* If set multiple to true, the value is an array.
|
|
33
33
|
*/
|
|
34
|
-
set value(value: string | string[] | null);
|
|
34
|
+
set value(value: string | (string | null)[] | null);
|
|
35
35
|
get value(): string | (string | null)[] | null;
|
|
36
36
|
private _value;
|
|
37
37
|
/** The child instances of sbb-tag as an array. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tag-group.d.ts","sourceRoot":"","sources":["../../../../src/elements/tag/tag-group/tag-group.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EAGnB,UAAU,EACV,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,KAAK,CAAC;AAKb,OAAO,EAAyB,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACpF,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;;AAI3D;;;;GAIG;AACH,qBAEM,kBAAmB,SAAQ,uBAEhC;IACC,OAAuB,MAAM,EAAE,cAAc,CAAS;IAEtD,mBAA4B,mBAAmB,WAAsB;IAErE;;OAEG;IACH,SAEgB,sBAAsB,EAAE,MAAM,CAAM;IAEpD;;;;;OAKG;IACH,SAEgB,QAAQ,EAAE,OAAO,CAAS;IAE1C;;;OAGG;IACH,SAA6C,IAAI,EAAE,UAAU,CAAwB;IAErF;;;;OAIG;IACH,IACW,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"tag-group.d.ts","sourceRoot":"","sources":["../../../../src/elements/tag/tag-group/tag-group.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EAGnB,UAAU,EACV,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,KAAK,CAAC;AAKb,OAAO,EAAyB,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACpF,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;;AAI3D;;;;GAIG;AACH,qBAEM,kBAAmB,SAAQ,uBAEhC;IACC,OAAuB,MAAM,EAAE,cAAc,CAAS;IAEtD,mBAA4B,mBAAmB,WAAsB;IAErE;;OAEG;IACH,SAEgB,sBAAsB,EAAE,MAAM,CAAM;IAEpD;;;;;OAKG;IACH,SAEgB,QAAQ,EAAE,OAAO,CAAS;IAE1C;;;OAGG;IACH,SAA6C,IAAI,EAAE,UAAU,CAAwB;IAErF;;;;OAIG;IACH,IACW,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,GAAG,IAAI,EAyBxD;IACD,IAAW,KAAK,IAAI,MAAM,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,GAAG,IAAI,CAMpD;IACD,OAAO,CAAC,MAAM,CAA2C;IAEzD,kDAAkD;IAClD,IAAW,IAAI,IAAI,aAAa,EAAE,CAEjC;cAEkB,UAAU,CAAC,iBAAiB,EAAE,cAAc,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI;cA0B3E,MAAM,IAAI,cAAc;CAU5C;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,eAAe,EAAE,kBAAkB,CAAC;KACrC;CACF"}
|