@sbb-esta/lyne-elements 3.9.0 → 3.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.component.js +1 -1
- package/autocomplete-grid/autocomplete-grid-row/autocomplete-grid-row.component.js +1 -1
- package/calendar/calendar.component.d.ts +2 -1
- package/calendar/calendar.component.d.ts.map +1 -1
- package/calendar/calendar.component.js +211 -225
- package/carousel/carousel/carousel.component.d.ts.map +1 -1
- package/carousel/carousel/carousel.component.js +5 -5
- package/core/controllers/escapable-overlay-controller.d.ts +3 -0
- package/core/controllers/escapable-overlay-controller.d.ts.map +1 -1
- package/core/controllers/overlay-position-controller.d.ts +60 -0
- package/core/controllers/overlay-position-controller.d.ts.map +1 -0
- package/core/controllers/overlay-position-controller.js +224 -0
- package/core/controllers.d.ts +1 -0
- package/core/controllers.d.ts.map +1 -1
- package/core/controllers.js +12 -10
- package/core/styles/core.scss +27 -2
- package/core.css +21 -2
- package/custom-elements.json +2238 -769
- package/development/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.component.js +7 -1
- package/development/autocomplete-grid/autocomplete-grid-row/autocomplete-grid-row.component.js +2 -1
- package/development/calendar/calendar.component.d.ts +2 -1
- package/development/calendar/calendar.component.d.ts.map +1 -1
- package/development/calendar/calendar.component.js +20 -36
- package/development/carousel/carousel/carousel.component.d.ts.map +1 -1
- package/development/carousel/carousel/carousel.component.js +2 -2
- package/development/core/controllers/escapable-overlay-controller.d.ts +3 -0
- package/development/core/controllers/escapable-overlay-controller.d.ts.map +1 -1
- package/development/core/controllers/escapable-overlay-controller.js +1 -1
- package/development/core/controllers/overlay-position-controller.d.ts +60 -0
- package/development/core/controllers/overlay-position-controller.d.ts.map +1 -0
- package/development/core/controllers/overlay-position-controller.js +306 -0
- package/development/core/controllers.d.ts +1 -0
- package/development/core/controllers.d.ts.map +1 -1
- package/development/core/controllers.js +3 -1
- package/development/mini-calendar/mini-calendar/mini-calendar.component.d.ts +35 -0
- package/development/mini-calendar/mini-calendar/mini-calendar.component.d.ts.map +1 -0
- package/development/mini-calendar/mini-calendar/mini-calendar.component.js +201 -0
- package/development/mini-calendar/mini-calendar-day/mini-calendar-day.component.d.ts +23 -0
- package/development/mini-calendar/mini-calendar-day/mini-calendar-day.component.d.ts.map +1 -0
- package/development/mini-calendar/mini-calendar-day/mini-calendar-day.component.js +181 -0
- package/development/mini-calendar/mini-calendar-day.d.ts +5 -0
- package/development/mini-calendar/mini-calendar-day.d.ts.map +1 -0
- package/development/mini-calendar/mini-calendar-day.js +5 -0
- package/development/mini-calendar/mini-calendar-month/mini-calendar-month.component.d.ts +25 -0
- package/development/mini-calendar/mini-calendar-month/mini-calendar-month.component.d.ts.map +1 -0
- package/development/mini-calendar/mini-calendar-month/mini-calendar-month.component.js +123 -0
- package/development/mini-calendar/mini-calendar-month.d.ts +5 -0
- package/development/mini-calendar/mini-calendar-month.d.ts.map +1 -0
- package/development/mini-calendar/mini-calendar-month.js +5 -0
- package/development/mini-calendar/mini-calendar.d.ts +5 -0
- package/development/mini-calendar/mini-calendar.d.ts.map +1 -0
- package/development/mini-calendar/mini-calendar.js +5 -0
- package/development/mini-calendar.d.ts +7 -0
- package/development/mini-calendar.d.ts.map +1 -0
- package/development/mini-calendar.js +9 -0
- package/development/paginator/common/paginator-common.d.ts.map +1 -1
- package/development/paginator/common/paginator-common.js +14 -3
- package/development/sidebar/icon-sidebar-button/icon-sidebar-button.component.d.ts +4 -1
- package/development/sidebar/icon-sidebar-button/icon-sidebar-button.component.d.ts.map +1 -1
- package/development/sidebar/icon-sidebar-button/icon-sidebar-button.component.js +5 -1
- package/development/sidebar/icon-sidebar-link/icon-sidebar-link.component.d.ts +4 -1
- package/development/sidebar/icon-sidebar-link/icon-sidebar-link.component.d.ts.map +1 -1
- package/development/sidebar/icon-sidebar-link/icon-sidebar-link.component.js +5 -1
- package/development/tabs/tab/tab.component.d.ts +9 -0
- package/development/tabs/tab/tab.component.d.ts.map +1 -1
- package/development/tabs/tab/tab.component.js +48 -7
- package/development/tabs/tab-group/tab-group.component.d.ts +7 -3
- package/development/tabs/tab-group/tab-group.component.d.ts.map +1 -1
- package/development/tabs/tab-group/tab-group.component.js +19 -39
- package/development/tabs/tab-label/tab-label.component.d.ts.map +1 -1
- package/development/tabs/tab-label/tab-label.component.js +4 -3
- package/development/tooltip/tooltip.component.d.ts +11 -4
- package/development/tooltip/tooltip.component.d.ts.map +1 -1
- package/development/tooltip/tooltip.component.js +57 -78
- package/index.d.ts +6 -0
- package/index.js +6 -0
- package/mini-calendar/mini-calendar/mini-calendar.component.d.ts +35 -0
- package/mini-calendar/mini-calendar/mini-calendar.component.d.ts.map +1 -0
- package/mini-calendar/mini-calendar/mini-calendar.component.js +133 -0
- package/mini-calendar/mini-calendar-day/mini-calendar-day.component.d.ts +23 -0
- package/mini-calendar/mini-calendar-day/mini-calendar-day.component.d.ts.map +1 -0
- package/mini-calendar/mini-calendar-day/mini-calendar-day.component.js +66 -0
- package/mini-calendar/mini-calendar-day.d.ts +5 -0
- package/mini-calendar/mini-calendar-day.d.ts.map +1 -0
- package/mini-calendar/mini-calendar-day.js +4 -0
- package/mini-calendar/mini-calendar-month/mini-calendar-month.component.d.ts +25 -0
- package/mini-calendar/mini-calendar-month/mini-calendar-month.component.d.ts.map +1 -0
- package/mini-calendar/mini-calendar-month/mini-calendar-month.component.js +59 -0
- package/mini-calendar/mini-calendar-month.d.ts +5 -0
- package/mini-calendar/mini-calendar-month.d.ts.map +1 -0
- package/mini-calendar/mini-calendar-month.js +4 -0
- package/mini-calendar/mini-calendar.d.ts +5 -0
- package/mini-calendar/mini-calendar.d.ts.map +1 -0
- package/mini-calendar/mini-calendar.js +4 -0
- package/mini-calendar.d.ts +7 -0
- package/mini-calendar.d.ts.map +1 -0
- package/mini-calendar.js +8 -0
- package/off-brand-theme.css +21 -2
- package/package.json +21 -1
- package/paginator/common/paginator-common.d.ts.map +1 -1
- package/paginator/common/paginator-common.js +30 -25
- package/safety-theme.css +21 -2
- package/sidebar/icon-sidebar-button/icon-sidebar-button.component.d.ts +4 -1
- package/sidebar/icon-sidebar-button/icon-sidebar-button.component.d.ts.map +1 -1
- package/sidebar/icon-sidebar-button/icon-sidebar-button.component.js +9 -6
- package/sidebar/icon-sidebar-link/icon-sidebar-link.component.d.ts +4 -1
- package/sidebar/icon-sidebar-link/icon-sidebar-link.component.d.ts.map +1 -1
- package/sidebar/icon-sidebar-link/icon-sidebar-link.component.js +13 -10
- package/standard-theme.css +21 -2
- package/tabs/tab/tab.component.d.ts +9 -0
- package/tabs/tab/tab.component.d.ts.map +1 -1
- package/tabs/tab/tab.component.js +37 -18
- package/tabs/tab-group/tab-group.component.d.ts +7 -3
- package/tabs/tab-group/tab-group.component.d.ts.map +1 -1
- package/tabs/tab-group/tab-group.component.js +51 -52
- package/tabs/tab-label/tab-label.component.d.ts.map +1 -1
- package/tabs/tab-label/tab-label.component.js +12 -12
- package/tooltip/tooltip.component.d.ts +11 -4
- package/tooltip/tooltip.component.d.ts.map +1 -1
- package/tooltip/tooltip.component.js +60 -84
package/standard-theme.css
CHANGED
|
@@ -1731,8 +1731,7 @@ sbb-menu,
|
|
|
1731
1731
|
sbb-navigation,
|
|
1732
1732
|
sbb-overlay,
|
|
1733
1733
|
sbb-popover,
|
|
1734
|
-
sbb-toast
|
|
1735
|
-
sbb-tooltip) {
|
|
1734
|
+
sbb-toast) {
|
|
1736
1735
|
margin: 0;
|
|
1737
1736
|
padding: 0;
|
|
1738
1737
|
border: none;
|
|
@@ -2021,6 +2020,26 @@ sbb-status:has(sbb-title) {
|
|
|
2021
2020
|
--sbb-option-white-space: nowrap;
|
|
2022
2021
|
}
|
|
2023
2022
|
|
|
2023
|
+
sbb-mini-calendar[orientation=horizontal] sbb-mini-calendar-month {
|
|
2024
|
+
--sbb-mini-calendar-grid-auto-flow: row;
|
|
2025
|
+
--sbb-mini-calendar-month-height: 3rem;
|
|
2026
|
+
--sbb-mini-calendar-month-grid-template-rows: none;
|
|
2027
|
+
--sbb-mini-calendar-month-grid-template-columns: repeat(7, 1fr);
|
|
2028
|
+
}
|
|
2029
|
+
sbb-mini-calendar[orientation=horizontal] sbb-mini-calendar-month sbb-mini-calendar-day:first-child {
|
|
2030
|
+
grid-column-start: var(--sbb-mini-calendar-month-offset);
|
|
2031
|
+
}
|
|
2032
|
+
|
|
2033
|
+
sbb-mini-calendar[orientation=vertical] sbb-mini-calendar-month {
|
|
2034
|
+
--sbb-mini-calendar-grid-auto-flow: column;
|
|
2035
|
+
--sbb-mini-calendar-month-height: auto;
|
|
2036
|
+
--sbb-mini-calendar-month-grid-template-rows: repeat(7, 1fr);
|
|
2037
|
+
--sbb-mini-calendar-month-grid-template-columns: none;
|
|
2038
|
+
}
|
|
2039
|
+
sbb-mini-calendar[orientation=vertical] sbb-mini-calendar-month sbb-mini-calendar-day:first-child {
|
|
2040
|
+
grid-row-start: var(--sbb-mini-calendar-month-offset);
|
|
2041
|
+
}
|
|
2042
|
+
|
|
2024
2043
|
sub {
|
|
2025
2044
|
bottom: -0.36em;
|
|
2026
2045
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CSSResultGroup, TemplateResult, LitElement } from 'lit';
|
|
2
|
+
import { SbbTabGroupElement } from '../tab-group/tab-group.component.js';
|
|
2
3
|
import { SbbTabLabelElement } from '../tab-label.js';
|
|
3
4
|
declare const SbbTabElement_base: import('../../core/mixins.js').AbstractConstructor<import('../../core/mixins.js').SbbElementInternalsMixinType> & typeof LitElement & import('../../core/mixins.js').SbbElementInternalsConstructor;
|
|
4
5
|
/**
|
|
@@ -13,14 +14,22 @@ export declare class SbbTabElement extends SbbTabElement_base {
|
|
|
13
14
|
static readonly events: {
|
|
14
15
|
readonly active: "active";
|
|
15
16
|
};
|
|
17
|
+
private _tabContentResizeObserver;
|
|
16
18
|
/** The `sbb-tab-label` associated with the tab. */
|
|
17
19
|
get label(): SbbTabLabelElement | null;
|
|
20
|
+
/** Get the parent `sbb-tab-group`. */
|
|
21
|
+
get group(): SbbTabGroupElement | null;
|
|
18
22
|
/**
|
|
19
23
|
* @internal
|
|
20
24
|
* @deprecated
|
|
21
25
|
*/
|
|
22
26
|
configure(): void;
|
|
23
27
|
connectedCallback(): void;
|
|
28
|
+
/** @internal */
|
|
29
|
+
protected activate(): void;
|
|
30
|
+
/** @internal */
|
|
31
|
+
protected deactivate(): void;
|
|
32
|
+
private _onTabContentElementResize;
|
|
24
33
|
protected render(): TemplateResult;
|
|
25
34
|
}
|
|
26
35
|
declare global {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tab.component.d.ts","sourceRoot":"","sources":["../../../../src/elements/tabs/tab/tab.component.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tab.component.d.ts","sourceRoot":"","sources":["../../../../src/elements/tabs/tab/tab.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAC1D,OAAO,EAAQ,UAAU,EAAE,MAAM,KAAK,CAAC;AAIvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;;AAM1D;;;;;GAKG;AACH,qBAEM,aAAc,SAAQ,kBAAoC;IAC9D,OAAuB,IAAI,SAAc;IACzC,OAAuB,MAAM,EAAE,cAAc,CAAS;IACtD,gBAAuB,MAAM;;MAElB;IAEX,OAAO,CAAC,yBAAyB,CAI9B;IAEH,mDAAmD;IACnD,IAAW,KAAK,IAAI,kBAAkB,GAAG,IAAI,CAI5C;IAED,sCAAsC;IACtC,IAAW,KAAK,IAAI,kBAAkB,GAAG,IAAI,CAE5C;IAED;;;OAGG;IACI,SAAS,IAAI,IAAI;IAER,iBAAiB,IAAI,IAAI;IAOzC,gBAAgB;IAChB,SAAS,CAAC,QAAQ,IAAI,IAAI;IAK1B,gBAAgB;IAChB,SAAS,CAAC,UAAU,IAAI,IAAI;IAK5B,OAAO,CAAC,0BAA0B;cAIf,MAAM,IAAI,cAAc;CAG5C;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,SAAS,EAAE,aAAa,CAAC;KAC1B;CACF"}
|
|
@@ -1,16 +1,28 @@
|
|
|
1
|
-
import { __esDecorate as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { __esDecorate as l, __runInitializers as r } from "tslib";
|
|
2
|
+
import { ResizeController as b } from "@lit-labs/observers/resize-controller.js";
|
|
3
|
+
import { css as c, LitElement as u, html as h } from "lit";
|
|
4
|
+
import { customElement as m } from "lit/decorators.js";
|
|
5
|
+
import { SbbElementInternalsMixin as v } from "../../core/mixins.js";
|
|
6
|
+
const d = c`@charset "UTF-8";*,:before,:after{box-sizing:border-box}:host{display:none}:host:after,:host:before{content:" ";display:block;visibility:hidden;height:0;overflow:hidden}:host(:focus-visible){outline-offset:var(--sbb-focus-outline-offset);outline:var(--sbb-focus-outline-color) var(--sbb-focus-outline-style, solid) var(--sbb-focus-outline-width)}:host(:is(:state(active),[state--active])){display:block;opacity:1;transition-duration:var(--sbb-tab-group-animation-duration);transition-delay:var(--sbb-tab-group-animation-duration);transition-timing-function:var(--sbb-animation-easing);transition-behavior:allow-discrete}@starting-style{:host(:is(:state(active),[state--active])){opacity:0}}`;
|
|
7
|
+
let f = 0, C = (() => {
|
|
7
8
|
var t;
|
|
8
|
-
let
|
|
9
|
-
return t = class extends
|
|
9
|
+
let n = [m("sbb-tab")], s, a = [], e, o = v(u);
|
|
10
|
+
return t = class extends o {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments), this._tabContentResizeObserver = new b(this, {
|
|
13
|
+
target: null,
|
|
14
|
+
skipInitial: !0,
|
|
15
|
+
callback: () => this._onTabContentElementResize()
|
|
16
|
+
});
|
|
17
|
+
}
|
|
10
18
|
/** The `sbb-tab-label` associated with the tab. */
|
|
11
19
|
get label() {
|
|
12
20
|
return this.previousElementSibling?.localName === "sbb-tab-label" ? this.previousElementSibling : null;
|
|
13
21
|
}
|
|
22
|
+
/** Get the parent `sbb-tab-group`. */
|
|
23
|
+
get group() {
|
|
24
|
+
return this.closest("sbb-tab-group");
|
|
25
|
+
}
|
|
14
26
|
/**
|
|
15
27
|
* @internal
|
|
16
28
|
* @deprecated
|
|
@@ -20,20 +32,27 @@ let f = 0, S = (() => {
|
|
|
20
32
|
connectedCallback() {
|
|
21
33
|
super.connectedCallback(), this.id ||= `sbb-tab-${f++}`, this.tabIndex = 0;
|
|
22
34
|
}
|
|
35
|
+
/** @internal */
|
|
36
|
+
activate() {
|
|
37
|
+
this.toggleState("active", !0), this._tabContentResizeObserver.observe(this);
|
|
38
|
+
}
|
|
39
|
+
/** @internal */
|
|
40
|
+
deactivate() {
|
|
41
|
+
this._tabContentResizeObserver.unobserve(this), this.toggleState("active", !1);
|
|
42
|
+
}
|
|
43
|
+
_onTabContentElementResize() {
|
|
44
|
+
this.group?.setTabContentHeight(Math.floor(this.getBoundingClientRect().height));
|
|
45
|
+
}
|
|
23
46
|
render() {
|
|
24
|
-
return
|
|
25
|
-
<div class="sbb-tab">
|
|
26
|
-
<slot></slot>
|
|
27
|
-
</div>
|
|
28
|
-
`;
|
|
47
|
+
return h`<slot></slot>`;
|
|
29
48
|
}
|
|
30
49
|
}, e = t, (() => {
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
})(), t.role = "tabpanel", t.styles =
|
|
50
|
+
const i = typeof Symbol == "function" && Symbol.metadata ? Object.create(o[Symbol.metadata] ?? null) : void 0;
|
|
51
|
+
l(null, s = { value: e }, n, { kind: "class", name: e.name, metadata: i }, null, a), e = s.value, i && Object.defineProperty(e, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: i });
|
|
52
|
+
})(), t.role = "tabpanel", t.styles = d, t.events = {
|
|
34
53
|
active: "active"
|
|
35
|
-
},
|
|
54
|
+
}, r(e, a), e;
|
|
36
55
|
})();
|
|
37
56
|
export {
|
|
38
|
-
|
|
57
|
+
C as SbbTabElement
|
|
39
58
|
};
|
|
@@ -30,7 +30,7 @@ export interface InterfaceSbbTabGroupTab extends SbbTabLabelElement {
|
|
|
30
30
|
tabGroupActions?: InterfaceSbbTabGroupActions;
|
|
31
31
|
size: 's' | 'l' | 'xl';
|
|
32
32
|
}
|
|
33
|
-
declare const SbbTabGroupElement_base: import('../../core/mixins.js').AbstractConstructor<import('../../core/mixins.js').SbbHydrationMixinType> & typeof LitElement;
|
|
33
|
+
declare const SbbTabGroupElement_base: import('../../core/mixins.js').AbstractConstructor<import('../../core/mixins.js').SbbElementInternalsMixinType> & import('../../core/mixins.js').AbstractConstructor<import('../../core/mixins.js').SbbHydrationMixinType> & typeof LitElement & import('../../core/mixins.js').SbbElementInternalsConstructor;
|
|
34
34
|
/**
|
|
35
35
|
* It displays one or more tabs, each one with a label and some content.
|
|
36
36
|
*
|
|
@@ -45,7 +45,6 @@ export declare class SbbTabGroupElement extends SbbTabGroupElement_base {
|
|
|
45
45
|
private _tabGroupElement;
|
|
46
46
|
private _tabContentElement;
|
|
47
47
|
private _tabGroupResizeObserver;
|
|
48
|
-
private _tabContentResizeObserver;
|
|
49
48
|
/**
|
|
50
49
|
* Size variant, either s, l or xl.
|
|
51
50
|
* @default 'l' / 's' (lean)
|
|
@@ -60,6 +59,8 @@ export declare class SbbTabGroupElement extends SbbTabGroupElement_base {
|
|
|
60
59
|
accessor initialSelectedIndex: number;
|
|
61
60
|
/** Gets the slotted `sbb-tab-label`s. */
|
|
62
61
|
get labels(): SbbTabLabelElement[];
|
|
62
|
+
/** Gets the slotted `sbb-tab`s. */
|
|
63
|
+
get tabs(): SbbTabElement[];
|
|
63
64
|
constructor();
|
|
64
65
|
protected firstUpdated(changedProperties: PropertyValues<this>): void;
|
|
65
66
|
/**
|
|
@@ -83,8 +84,11 @@ export declare class SbbTabGroupElement extends SbbTabGroupElement_base {
|
|
|
83
84
|
private _onLabelSlotChange;
|
|
84
85
|
private _initSelection;
|
|
85
86
|
private _onTabGroupElementResize;
|
|
86
|
-
private _onTabContentElementResize;
|
|
87
87
|
private _handleKeyDown;
|
|
88
|
+
/**
|
|
89
|
+
* @internal
|
|
90
|
+
*/
|
|
91
|
+
protected setTabContentHeight(contentHeight: number): void;
|
|
88
92
|
protected render(): TemplateResult;
|
|
89
93
|
}
|
|
90
94
|
declare global {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tab-group.component.d.ts","sourceRoot":"","sources":["../../../../src/elements/tabs/tab-group/tab-group.component.ts"],"names":[],"mappings":"AACA,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,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAI/C,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;;GAEG;AACH,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;;GAEG;AACH,MAAM,WAAW,uBAAwB,SAAQ,kBAAkB;IACjE,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,GAAG,EAAE,aAAa,GAAG,IAAI,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,2BAA2B,CAAC;IAC9C,IAAI,EAAE,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;CACxB;;AAED;;;;;GAKG;AACH,qBAEM,kBAAmB,SAAQ,
|
|
1
|
+
{"version":3,"file":"tab-group.component.d.ts","sourceRoot":"","sources":["../../../../src/elements/tabs/tab-group/tab-group.component.ts"],"names":[],"mappings":"AACA,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,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAI/C,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;;GAEG;AACH,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;;GAEG;AACH,MAAM,WAAW,uBAAwB,SAAQ,kBAAkB;IACjE,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,GAAG,EAAE,aAAa,GAAG,IAAI,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,2BAA2B,CAAC;IAC9C,IAAI,EAAE,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;CACxB;;AAED;;;;;GAKG;AACH,qBAEM,kBAAmB,SAAQ,uBAAuD;IACtF,OAAuB,MAAM,EAAE,cAAc,CAAS;IACtD,gBAAuB,MAAM;;MAElB;IAEX,OAAO,CAAC,gBAAgB,CAAe;IACvC,OAAO,CAAC,kBAAkB,CAAe;IACzC,OAAO,CAAC,uBAAuB,CAI5B;IAEH;;;OAGG;IACH,IACW,IAAI,CAAC,KAAK,EAAE,GAAG,GAAG,GAAG,GAAG,IAAI,EAGtC;IACD,IAAW,IAAI,IAAI,GAAG,GAAG,GAAG,GAAG,IAAI,CAElC;IACD,OAAO,CAAC,KAAK,CAA0C;IAEvD;;;OAGG;IACH,SAEgB,oBAAoB,EAAE,MAAM,CAAK;IAEjD,yCAAyC;IACzC,IAAW,MAAM,IAAI,kBAAkB,EAAE,CAQxC;IAED,mCAAmC;IACnC,IAAW,IAAI,IAAI,aAAa,EAAE,CAQjC;;cAOkB,YAAY,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;IAW9E;;;OAGG;IACI,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAMzC;;;OAGG;IACI,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAMxC;;;OAGG;IACI,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAI1C,OAAO,CAAC,YAAY;IAOpB,OAAO,CAAC,WAAW;IAMnB,OAAO,CAAC,oBAAoB,CAG1B;IAEF,OAAO,CAAC,kBAAkB,CAGxB;IAEF,OAAO,CAAC,cAAc;IAgBtB,OAAO,CAAC,wBAAwB;IAgBhC,OAAO,CAAC,cAAc;IAoBtB;;OAEG;IACH,SAAS,CAAC,mBAAmB,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI;cAIvC,MAAM,IAAI,cAAc;CAiB5C;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,eAAe,EAAE,kBAAkB,CAAC;KACrC;CACF"}
|
|
@@ -1,35 +1,31 @@
|
|
|
1
|
-
var
|
|
1
|
+
var x = (i) => {
|
|
2
2
|
throw TypeError(i);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
import { __esDecorate as h, __runInitializers as
|
|
7
|
-
import { ResizeController as
|
|
8
|
-
import { css as
|
|
9
|
-
import { customElement as
|
|
10
|
-
import { ref as
|
|
11
|
-
import { isArrowKeyPressed as
|
|
12
|
-
import { forceType as
|
|
13
|
-
import { isLean as
|
|
14
|
-
import { throttle as
|
|
15
|
-
import { SbbHydrationMixin as
|
|
16
|
-
const
|
|
17
|
-
let
|
|
18
|
-
var
|
|
19
|
-
let i = [
|
|
20
|
-
return
|
|
4
|
+
var S = (i, a, s) => a.has(i) || x("Cannot " + s);
|
|
5
|
+
var v = (i, a, s) => (S(i, a, "read from private field"), s ? s.call(i) : a.get(i)), z = (i, a, s) => a.has(i) ? x("Cannot add the same private member more than once") : a instanceof WeakSet ? a.add(i) : a.set(i, s), c = (i, a, s, l) => (S(i, a, "write to private field"), l ? l.call(i, s) : a.set(i, s), s);
|
|
6
|
+
import { __esDecorate as h, __runInitializers as d } from "tslib";
|
|
7
|
+
import { ResizeController as T } from "@lit-labs/observers/resize-controller.js";
|
|
8
|
+
import { css as k, LitElement as C, html as w } from "lit";
|
|
9
|
+
import { customElement as G, property as E } from "lit/decorators.js";
|
|
10
|
+
import { ref as y } from "lit/directives/ref.js";
|
|
11
|
+
import { isArrowKeyPressed as L, getNextElementIndex as $ } from "../../core/a11y.js";
|
|
12
|
+
import { forceType as D } from "../../core/decorators.js";
|
|
13
|
+
import { isLean as A } from "../../core/dom.js";
|
|
14
|
+
import { throttle as R } from "../../core/eventing.js";
|
|
15
|
+
import { SbbElementInternalsMixin as N, SbbHydrationMixin as O } from "../../core/mixins.js";
|
|
16
|
+
const P = k`*,:before,:after{box-sizing:border-box}:host{display:block;--sbb-tab-group-animation-duration: 0s}:host(:is(:state(initialized),[state--initialized])){--sbb-tab-group-animation-duration: var( --sbb-disable-animation-duration, var(--sbb-animation-duration-4x) )}.sbb-tab-group{display:flex;flex-wrap:wrap}.sbb-tab-group-content{margin-block-start:var(--sbb-spacing-responsive-m);transition:height var(--sbb-tab-group-animation-duration) var(--sbb-animation-easing)}`;
|
|
17
|
+
let X = (() => {
|
|
18
|
+
var o, n;
|
|
19
|
+
let i = [G("sbb-tab-group")], a, s = [], l, m = N(O(C)), u = [], p, f, _ = [], g = [];
|
|
20
|
+
return n = class extends m {
|
|
21
21
|
constructor() {
|
|
22
22
|
super();
|
|
23
|
-
z(this,
|
|
24
|
-
this._tabGroupElement =
|
|
23
|
+
z(this, o);
|
|
24
|
+
this._tabGroupElement = d(this, u), this._tabGroupResizeObserver = new T(this, {
|
|
25
25
|
target: null,
|
|
26
26
|
skipInitial: !0,
|
|
27
27
|
callback: (t) => this._onTabGroupElementResize(t)
|
|
28
|
-
}), this.
|
|
29
|
-
target: null,
|
|
30
|
-
skipInitial: !0,
|
|
31
|
-
callback: (t) => this._onTabContentElementResize(t)
|
|
32
|
-
}), this._size = D() ? "s" : "l", d(this, r, c(this, _, 0)), this._onContentSlotChange = (c(this, g), () => {
|
|
28
|
+
}), this._size = A() ? "s" : "l", c(this, o, d(this, _, 0)), this._onContentSlotChange = (d(this, g), () => {
|
|
33
29
|
this.labels.forEach((t) => t.linkToTab()), this.labels.find((t) => t.active)?.activate();
|
|
34
30
|
}), this._onLabelSlotChange = () => {
|
|
35
31
|
this._updateSize(), this.labels.forEach((t) => t.linkToTab());
|
|
@@ -50,17 +46,21 @@ let V = (() => {
|
|
|
50
46
|
* the tab group, the first enabled tab will be selected.
|
|
51
47
|
*/
|
|
52
48
|
get initialSelectedIndex() {
|
|
53
|
-
return
|
|
49
|
+
return v(this, o);
|
|
54
50
|
}
|
|
55
51
|
set initialSelectedIndex(t) {
|
|
56
|
-
|
|
52
|
+
c(this, o, t);
|
|
57
53
|
}
|
|
58
54
|
/** Gets the slotted `sbb-tab-label`s. */
|
|
59
55
|
get labels() {
|
|
60
56
|
return Array.from(this.children ?? []).filter((t) => /^sbb-tab-label$/u.test(t.localName));
|
|
61
57
|
}
|
|
58
|
+
/** Gets the slotted `sbb-tab`s. */
|
|
59
|
+
get tabs() {
|
|
60
|
+
return Array.from(this.children ?? []).filter((t) => /^sbb-tab$/u.test(t.localName));
|
|
61
|
+
}
|
|
62
62
|
firstUpdated(t) {
|
|
63
|
-
super.firstUpdated(t), this.labels.forEach((e) => e.linkToTab()), this._initSelection(),
|
|
63
|
+
super.firstUpdated(t), this.labels.forEach((e) => e.linkToTab()), this._initSelection(), Promise.resolve().then(() => this.toggleState("initialized", !0)), this._tabGroupResizeObserver.observe(this._tabGroupElement);
|
|
64
64
|
}
|
|
65
65
|
/**
|
|
66
66
|
* Disables a tab by index.
|
|
@@ -99,54 +99,53 @@ let V = (() => {
|
|
|
99
99
|
}
|
|
100
100
|
_onTabGroupElementResize(t) {
|
|
101
101
|
for (const e of t) {
|
|
102
|
-
const
|
|
103
|
-
for (const b of
|
|
104
|
-
b.toggleAttribute("data-has-divider", b ===
|
|
102
|
+
const r = e.target.firstElementChild.assignedElements();
|
|
103
|
+
for (const b of r)
|
|
104
|
+
b.toggleAttribute("data-has-divider", b === r[0] || b.offsetLeft === r[0].offsetLeft), this.style.setProperty("--sbb-tab-group-width", `${this._tabGroupElement.clientWidth}px`);
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
-
_onTabContentElementResize(t) {
|
|
108
|
-
if (this._tabContentElement)
|
|
109
|
-
for (const e of t) {
|
|
110
|
-
const n = Math.floor(e.contentRect.height);
|
|
111
|
-
this._tabContentElement.style.height = `${n}px`;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
107
|
_handleKeyDown(t) {
|
|
115
108
|
const e = this._enabledTabs();
|
|
116
109
|
if (!(!e || // don't trap nested handling
|
|
117
|
-
t.target !== this && t.target.parentElement !== this) &&
|
|
118
|
-
const
|
|
110
|
+
t.target !== this && t.target.parentElement !== this) && L(t)) {
|
|
111
|
+
const r = e.findIndex((I) => I.active), b = $(t, r, e.length);
|
|
119
112
|
e[b]?.activate(), e[b]?.focus(), t.preventDefault();
|
|
120
113
|
}
|
|
121
114
|
}
|
|
115
|
+
/**
|
|
116
|
+
* @internal
|
|
117
|
+
*/
|
|
118
|
+
setTabContentHeight(t) {
|
|
119
|
+
this._tabContentElement.style.height = `${t}px`;
|
|
120
|
+
}
|
|
122
121
|
render() {
|
|
123
122
|
return w`
|
|
124
123
|
<div
|
|
125
124
|
class="sbb-tab-group"
|
|
126
125
|
role="tablist"
|
|
127
|
-
${
|
|
126
|
+
${y((t) => this._tabGroupElement = t)}
|
|
128
127
|
>
|
|
129
128
|
<slot name="tab-bar" @slotchange=${this._onLabelSlotChange}></slot>
|
|
130
129
|
</div>
|
|
131
130
|
<div
|
|
132
131
|
class="sbb-tab-group-content"
|
|
133
|
-
${
|
|
132
|
+
${y((t) => this._tabContentElement = t)}
|
|
134
133
|
>
|
|
135
|
-
<slot @slotchange=${
|
|
134
|
+
<slot @slotchange=${R(this._onContentSlotChange, 150)}></slot>
|
|
136
135
|
</div>
|
|
137
136
|
`;
|
|
138
137
|
}
|
|
139
|
-
},
|
|
140
|
-
const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(
|
|
141
|
-
|
|
142
|
-
e.size =
|
|
143
|
-
} }, metadata: t }, null,
|
|
144
|
-
e.initialSelectedIndex =
|
|
138
|
+
}, o = new WeakMap(), l = n, (() => {
|
|
139
|
+
const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(m[Symbol.metadata] ?? null) : void 0;
|
|
140
|
+
p = [E()], f = [D(), E({ attribute: "initial-selected-index", type: Number })], h(n, null, p, { kind: "setter", name: "size", static: !1, private: !1, access: { has: (e) => "size" in e, set: (e, r) => {
|
|
141
|
+
e.size = r;
|
|
142
|
+
} }, metadata: t }, null, u), h(n, null, f, { kind: "accessor", name: "initialSelectedIndex", static: !1, private: !1, access: { has: (e) => "initialSelectedIndex" in e, get: (e) => e.initialSelectedIndex, set: (e, r) => {
|
|
143
|
+
e.initialSelectedIndex = r;
|
|
145
144
|
} }, metadata: t }, _, g), h(null, a = { value: l }, i, { kind: "class", name: l.name, metadata: t }, null, s), l = a.value, t && Object.defineProperty(l, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: t });
|
|
146
|
-
})(),
|
|
145
|
+
})(), n.styles = P, n.events = {
|
|
147
146
|
tabchange: "tabchange"
|
|
148
|
-
},
|
|
147
|
+
}, d(l, s), l;
|
|
149
148
|
})();
|
|
150
149
|
export {
|
|
151
|
-
|
|
150
|
+
X as SbbTabGroupElement
|
|
152
151
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tab-label.component.d.ts","sourceRoot":"","sources":["../../../../src/elements/tabs/tab-label/tab-label.component.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAOjC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAA6B,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;;AAIrF;;;;;;GAMG;AACH,qBAGM,kBAAmB,SAAQ,uBAEhC;IACC,OAAuB,IAAI,SAAS;IACpC,OAAuB,MAAM,EAAE,cAAc,CAAS;IAEtD,mCAAmC;IACnC,OAAO,CAAC,SAAS,CAAkB;IAEnC;;;OAGG;IACH,SAA4B,KAAK,EAAE,aAAa,CAAO;IAEvD,wBAAwB;IACxB,SAEgB,MAAM,EAAE,OAAO,CAAS;IAExC,uCAAuC;IACvC,SAEgB,MAAM,EAAE,MAAM,CAAM;IAEpC,wDAAwD;IACxD,IAAW,GAAG,IAAI,aAAa,GAAG,IAAI,CAIrC;IAED,sCAAsC;IACtC,IAAW,KAAK,IAAI,kBAAkB,GAAG,IAAI,CAE5C;;IAQe,iBAAiB,IAAI,IAAI;cAMtB,UAAU,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"tab-label.component.d.ts","sourceRoot":"","sources":["../../../../src/elements/tabs/tab-label/tab-label.component.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAOjC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAA6B,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;;AAIrF;;;;;;GAMG;AACH,qBAGM,kBAAmB,SAAQ,uBAEhC;IACC,OAAuB,IAAI,SAAS;IACpC,OAAuB,MAAM,EAAE,cAAc,CAAS;IAEtD,mCAAmC;IACnC,OAAO,CAAC,SAAS,CAAkB;IAEnC;;;OAGG;IACH,SAA4B,KAAK,EAAE,aAAa,CAAO;IAEvD,wBAAwB;IACxB,SAEgB,MAAM,EAAE,OAAO,CAAS;IAExC,uCAAuC;IACvC,SAEgB,MAAM,EAAE,MAAM,CAAM;IAEpC,wDAAwD;IACxD,IAAW,GAAG,IAAI,aAAa,GAAG,IAAI,CAIrC;IAED,sCAAsC;IACtC,IAAW,KAAK,IAAI,kBAAkB,GAAG,IAAI,CAE5C;;IAQe,iBAAiB,IAAI,IAAI;cAMtB,UAAU,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;IAsB5E,0BAA0B;IACnB,UAAU,IAAI,IAAI;IAOzB,+FAA+F;IACxF,QAAQ,IAAI,IAAI;IAkCvB;;OAEG;IACH,SAAS,CAAC,SAAS,IAAI,IAAI;cAYR,MAAM,IAAI,cAAc;CAoB5C;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,eAAe,EAAE,kBAAkB,CAAC;KACrC;CACF"}
|
|
@@ -5,22 +5,22 @@ var S = (a, b, s) => b.has(a) || E("Cannot " + s);
|
|
|
5
5
|
var h = (a, b, s) => (S(a, b, "read from private field"), s ? s.call(a) : b.get(a)), m = (a, b, s) => b.has(a) ? E("Cannot add the same private member more than once") : b instanceof WeakSet ? b.add(a) : b.set(a, s), n = (a, b, s, o) => (S(a, b, "write to private field"), o ? o.call(a, s) : b.set(a, s), s);
|
|
6
6
|
import { __esDecorate as u, __runInitializers as r } from "tslib";
|
|
7
7
|
import { css as B, LitElement as C } from "lit";
|
|
8
|
-
import { customElement as
|
|
9
|
-
import { unsafeStatic as L, html as
|
|
10
|
-
import { slotState as
|
|
8
|
+
import { customElement as D, property as f } from "lit/decorators.js";
|
|
9
|
+
import { unsafeStatic as L, html as M } from "lit/static-html.js";
|
|
10
|
+
import { slotState as N, forceType as $, omitEmptyConverter as A } from "../../core/decorators.js";
|
|
11
11
|
import { SbbDisabledMixin as G, SbbElementInternalsMixin as j } from "../../core/mixins.js";
|
|
12
12
|
import { SbbIconNameMixin as O } from "../../icon.js";
|
|
13
|
-
const U = B`*,:before,:after{box-sizing:border-box}:host{--sbb-tab-label-height: var(--sbb-size-element-m);--sbb-tab-label-color: var(--sbb-color-granite);--sbb-tab-label-color: light-dark(var(--sbb-color-granite), var(--sbb-color-graphite));--sbb-tab-label-line-color: var(--sbb-border-color-4-inverted);--sbb-tab-label-cursor: pointer;--sbb-tab-label-pointer-events: unset;--sbb-tab-label-inset: 0;--sbb-tab-label-inline-padding: var(--sbb-spacing-responsive-xs);--sbb-tab-label-marker-transform: scale(0);--sbb-tab-label-text-decoration: none;--sbb-tab-label-animation-duration: var( --sbb-disable-animation-duration, var(--sbb-animation-duration-2x) );--sbb-tab-label-animation-easing: var(--sbb-animation-easing);--sbb-tab-label-amount-color: var(--sbb-color-metal);--sbb-tab-label-amount-color: light-dark(var(--sbb-color-metal), var(--sbb-color-smoke));display:inline-block;max-width:100%;pointer-events:var(--sbb-tab-label-pointer-events);-webkit-tap-highlight-color:transparent;outline:none!important}@media (forced-colors: active){:host{--sbb-tab-label-color: ButtonText;--sbb-tab-label-amount-color: ButtonText}}:host([data-size=s]){--sbb-tab-label-height: var(--sbb-size-element-xs);--sbb-tab-label-inline-padding: var(--sbb-spacing-responsive-xxxs)}:host([disabled]){--sbb-tab-label-cursor: unset;--sbb-tab-label-pointer-events: none;--sbb-tab-label-text-decoration: line-through}@media (forced-colors: active){:host([disabled]){--sbb-tab-label-color: GrayText;--sbb-tab-label-amount-color: GrayText}}:host([active]:not([disabled])){--sbb-tab-label-color: var(--sbb-color-3);--sbb-tab-label-cursor: unset;--sbb-tab-label-pointer-events: none;--sbb-tab-label-marker-transform: scale(1)}@media (forced-colors: active){:host([active]:not([disabled])){--sbb-tab-label-color: ButtonText;--sbb-tab-label-amount-color: ButtonText}}@media (any-hover: hover){:host(:hover:not([disabled])){--sbb-tab-label-marker-transform: scale(1)}}:host(:
|
|
13
|
+
const U = B`*,:before,:after{box-sizing:border-box}:host{--sbb-tab-label-height: var(--sbb-size-element-m);--sbb-tab-label-color: var(--sbb-color-granite);--sbb-tab-label-color: light-dark(var(--sbb-color-granite), var(--sbb-color-graphite));--sbb-tab-label-line-color: var(--sbb-border-color-4-inverted);--sbb-tab-label-cursor: pointer;--sbb-tab-label-pointer-events: unset;--sbb-tab-label-inset: 0;--sbb-tab-label-inline-padding: var(--sbb-spacing-responsive-xs);--sbb-tab-label-marker-transform: scale(0);--sbb-tab-label-text-decoration: none;--sbb-tab-label-animation-duration: var( --sbb-disable-animation-duration, var(--sbb-animation-duration-2x) );--sbb-tab-label-animation-easing: var(--sbb-animation-easing);--sbb-tab-label-amount-color: var(--sbb-color-metal);--sbb-tab-label-amount-color: light-dark(var(--sbb-color-metal), var(--sbb-color-smoke));display:inline-block;max-width:100%;pointer-events:var(--sbb-tab-label-pointer-events);-webkit-tap-highlight-color:transparent;outline:none!important}@media (forced-colors: active){:host{--sbb-tab-label-color: ButtonText;--sbb-tab-label-amount-color: ButtonText}}:host([data-size=s]){--sbb-tab-label-height: var(--sbb-size-element-xs);--sbb-tab-label-inline-padding: var(--sbb-spacing-responsive-xxxs)}:host([disabled]){--sbb-tab-label-cursor: unset;--sbb-tab-label-pointer-events: none;--sbb-tab-label-text-decoration: line-through}@media (forced-colors: active){:host([disabled]){--sbb-tab-label-color: GrayText;--sbb-tab-label-amount-color: GrayText}}:host([active]:not([disabled])){--sbb-tab-label-color: var(--sbb-color-3);--sbb-tab-label-cursor: unset;--sbb-tab-label-pointer-events: none;--sbb-tab-label-marker-transform: scale(1)}@media (forced-colors: active){:host([active]:not([disabled])){--sbb-tab-label-color: ButtonText;--sbb-tab-label-amount-color: ButtonText}}@media (any-hover: hover){:host(:hover:not([disabled])){--sbb-tab-label-marker-transform: scale(1)}}:host(:active){--sbb-tab-label-color: var(--sbb-color-3)}.sbb-tab-label__wrapper{position:relative}:host(:focus-visible) .sbb-tab-label__wrapper:before{outline-offset:var(--sbb-focus-outline-offset);outline:var(--sbb-focus-outline-color) var(--sbb-focus-outline-style, solid) var(--sbb-focus-outline-width);content:"";position:absolute;display:block;inset:0;z-index:1;border-radius:calc(var(--sbb-border-radius-2x) - var(--sbb-focus-outline-offset))}.sbb-tab-label{position:relative;margin:0;min-height:var(--sbb-tab-label-height);display:flex;align-items:center;padding-inline:var(--sbb-tab-label-inline-padding);gap:var(--sbb-spacing-fixed-2x);-webkit-user-select:none;user-select:none;cursor:var(--sbb-tab-label-cursor);transition:color var(--sbb-tab-label-animation-duration) var(--sbb-tab-label-animation-easing)}:host([data-has-divider]) .sbb-tab-label:after{content:"";position:absolute;inset-inline-start:0;inset-block-end:0;width:var(--sbb-tab-group-width);height:var(--sbb-border-width-1x);background-color:var(--sbb-tab-label-line-color)}.sbb-tab-label:before{position:absolute;content:"";inset-inline:0;inset-block-end:0;height:var(--sbb-border-width-3x);background-color:var(--sbb-tab-label-color);transform:var(--sbb-tab-label-marker-transform);transition-duration:var(--sbb-tab-label-animation-duration);transition-timing-function:var(--sbb-tab-label-animation-easing);transition-property:transform,background-color;z-index:1}.sbb-tab-label__icon,.sbb-tab-label__text,.sbb-tab-label__amount{text-decoration:var(--sbb-tab-label-text-decoration)}.sbb-tab-label__icon{display:flex;flex-shrink:0;color:var(--sbb-tab-label-color);transition:color var(--sbb-tab-label-animation-duration) var(--sbb-tab-label-animation-easing)}:host(:not([data-slot-names~=icon],[icon-name])) .sbb-tab-label__icon{display:none}.sbb-tab-label__text{color:var(--sbb-tab-label-color);transition:color var(--sbb-tab-label-animation-duration) var(--sbb-tab-label-animation-easing);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;--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);font-weight:700}:host([data-size=s]) .sbb-tab-label__text{--sbb-text-font-size: var(--sbb-font-size-text-s);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);font-weight:700}:host([data-size=xl]) .sbb-tab-label__text{--sbb-text-font-size: var(--sbb-font-size-text-xl);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);font-weight:700}:host(:not([data-slot-names~=unnamed])) .sbb-tab-label__text{display:none}.sbb-tab-label__amount{display:flex;color:var(--sbb-tab-label-amount-color);transition:color var(--sbb-tab-label-animation-duration) var(--sbb-tab-label-animation-easing);--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)}:host(:not([data-slot-names~=amount],[amount])) .sbb-tab-label__amount{display:none}:host([data-size=s]) .sbb-tab-label__amount{--sbb-text-font-size: var(--sbb-font-size-text-s);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)}:host([data-size=xl]) .sbb-tab-label__amount{--sbb-text-font-size: var(--sbb-font-size-text-xl);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)}`;
|
|
14
14
|
let X = (() => {
|
|
15
15
|
var c, v, d, i;
|
|
16
|
-
let a = [
|
|
16
|
+
let a = [D("sbb-tab-label"), N()], b, s = [], o, p = G(O(j(C))), x, g = [], _ = [], y, z = [], w = [], k, T = [], I = [];
|
|
17
17
|
return i = class extends p {
|
|
18
18
|
constructor() {
|
|
19
19
|
super();
|
|
20
20
|
m(this, c);
|
|
21
21
|
m(this, v);
|
|
22
22
|
m(this, d);
|
|
23
|
-
this._selected = !1, n(this, c, r(this,
|
|
23
|
+
this._selected = !1, n(this, c, r(this, g, "1")), n(this, v, (r(this, _), r(this, z, !1))), n(this, d, (r(this, w), r(this, T, ""))), r(this, I), this.addEventListener("click", () => this.activate());
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
26
|
* The level will correspond to the heading tag generated in the title.
|
|
@@ -58,18 +58,18 @@ let X = (() => {
|
|
|
58
58
|
super.connectedCallback(), this.slot = "tab-bar", this.tabIndex = this.active ? 0 : -1;
|
|
59
59
|
}
|
|
60
60
|
willUpdate(t) {
|
|
61
|
-
super.willUpdate(t), t.has("active") && (this.internals.ariaSelected = `${this.active}`, this.
|
|
61
|
+
super.willUpdate(t), t.has("active") && (this.internals.ariaSelected = `${this.active}`, this.active && !this.disabled ? this.activate() : this.deactivate()), t.has("disabled") && this.disabled && (this.tabIndex = -1, this.active && (this.deactivate(), this.group?.activateTab(0)));
|
|
62
62
|
}
|
|
63
63
|
/** Deactivate the tab. */
|
|
64
64
|
deactivate() {
|
|
65
|
-
this.active = !1, this._selected = !1, this.tabIndex = -1;
|
|
65
|
+
this.active = !1, this.tab?.deactivate(), this._selected = !1, this.tabIndex = -1;
|
|
66
66
|
}
|
|
67
67
|
/** Select the tab, deactivating the current selected one, and dispatch the tabchange event. */
|
|
68
68
|
activate() {
|
|
69
69
|
if (this.disabled)
|
|
70
70
|
return;
|
|
71
71
|
const t = this.group?.labels || [], e = t.find((l) => l._selected);
|
|
72
|
-
e !== this && (e?.deactivate(), this.active = !0, this._selected = !0, this.tabIndex = 0, this.tab?.dispatchEvent(new Event("active", { bubbles: !0, composed: !0 })), this.group?.dispatchEvent(new CustomEvent("tabchange", {
|
|
72
|
+
e !== this && (e?.deactivate(), this.active = !0, this.tab?.activate(), this._selected = !0, this.tabIndex = 0, this.tab?.dispatchEvent(new Event("active", { bubbles: !0, composed: !0 })), this.group?.dispatchEvent(new CustomEvent("tabchange", {
|
|
73
73
|
bubbles: !0,
|
|
74
74
|
composed: !0,
|
|
75
75
|
detail: {
|
|
@@ -90,7 +90,7 @@ let X = (() => {
|
|
|
90
90
|
}
|
|
91
91
|
render() {
|
|
92
92
|
const t = `h${Number(this.level) < 7 ? this.level : "1"}`;
|
|
93
|
-
return
|
|
93
|
+
return M`
|
|
94
94
|
<div class="sbb-tab-label__wrapper">
|
|
95
95
|
<${L(t)} class="sbb-tab-label">
|
|
96
96
|
<span class="sbb-tab-label__icon">
|
|
@@ -108,9 +108,9 @@ let X = (() => {
|
|
|
108
108
|
}
|
|
109
109
|
}, c = new WeakMap(), v = new WeakMap(), d = new WeakMap(), o = i, (() => {
|
|
110
110
|
const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(p[Symbol.metadata] ?? null) : void 0;
|
|
111
|
-
|
|
111
|
+
x = [f()], y = [$(), f({ reflect: !0, type: Boolean })], k = [$(), f({ reflect: !0, converter: A })], u(i, null, x, { kind: "accessor", name: "level", static: !1, private: !1, access: { has: (e) => "level" in e, get: (e) => e.level, set: (e, l) => {
|
|
112
112
|
e.level = l;
|
|
113
|
-
} }, metadata: t },
|
|
113
|
+
} }, metadata: t }, g, _), u(i, null, y, { kind: "accessor", name: "active", static: !1, private: !1, access: { has: (e) => "active" in e, get: (e) => e.active, set: (e, l) => {
|
|
114
114
|
e.active = l;
|
|
115
115
|
} }, metadata: t }, z, w), u(i, null, k, { kind: "accessor", name: "amount", static: !1, private: !1, access: { has: (e) => "amount" in e, get: (e) => e.amount, set: (e, l) => {
|
|
116
116
|
e.amount = l;
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import { CSSResultGroup, TemplateResult, PropertyDeclaration, PropertyValues } from 'lit';
|
|
2
2
|
import { SbbOpenCloseBaseElement } from '../core/base-elements.js';
|
|
3
|
+
/**
|
|
4
|
+
* Defines the default position for the tooltip if this element is used as a trigger.
|
|
5
|
+
*/
|
|
6
|
+
export interface SbbTooltipDefaultPositions {
|
|
7
|
+
readonly tooltipPositions: string[];
|
|
8
|
+
}
|
|
3
9
|
declare const SbbTooltipElement_base: import('../core/mixins.js').AbstractConstructor<import('../core/mixins.js').SbbDisabledMixinType> & typeof SbbOpenCloseBaseElement;
|
|
4
10
|
/**
|
|
5
11
|
* It displays text content within a tooltip.
|
|
6
12
|
*
|
|
7
13
|
* @slot - Use the unnamed slot to add the text into the tooltip.
|
|
14
|
+
* @cssprop [--sbb-overlay-position-area=block-end] - The primary position for the tooltip.
|
|
15
|
+
* @cssprop [--sbb-overlay-position-try-fallbacks=block-end span-inline-end, block-end span-inline-start, block-start, block-start span-inline-end, block-start span-inline-start] -
|
|
16
|
+
* The list of fallback positions, separated by ',', for the tooltip
|
|
8
17
|
* @cssprop [--sbb-tooltip-z-index=var(--sbb-overlay-default-z-index)] - To specify a custom stack order,
|
|
9
18
|
* the `z-index` can be overridden by defining this CSS variable. The default `z-index` of the
|
|
10
19
|
* component is set to `var(--sbb-overlay-default-z-index)` with a value of `1000`.
|
|
@@ -14,7 +23,7 @@ export declare class SbbTooltipElement extends SbbTooltipElement_base {
|
|
|
14
23
|
static styles: CSSResultGroup;
|
|
15
24
|
private static _tooltipOutlet;
|
|
16
25
|
/**
|
|
17
|
-
* The element that will trigger the
|
|
26
|
+
* The element that will trigger the tooltip overlay.
|
|
18
27
|
*
|
|
19
28
|
* For attribute usage, provide an id reference.
|
|
20
29
|
*/
|
|
@@ -46,11 +55,11 @@ export declare class SbbTooltipElement extends SbbTooltipElement_base {
|
|
|
46
55
|
set longPressCloseDelay(value: number);
|
|
47
56
|
get longPressCloseDelay(): number;
|
|
48
57
|
private _longPressCloseDelay?;
|
|
49
|
-
protected overlay?: HTMLDivElement;
|
|
50
58
|
private _triggerElement;
|
|
51
59
|
private _triggerAbortController?;
|
|
52
60
|
private _openStateController;
|
|
53
61
|
private _escapableOverlayController;
|
|
62
|
+
private _overlayController;
|
|
54
63
|
private _openTimeout?;
|
|
55
64
|
private _closeTimeout?;
|
|
56
65
|
private _longPressOpenTimeout?;
|
|
@@ -73,9 +82,7 @@ export declare class SbbTooltipElement extends SbbTooltipElement_base {
|
|
|
73
82
|
private _attach;
|
|
74
83
|
private _detach;
|
|
75
84
|
private _destroy;
|
|
76
|
-
private _setTooltipPosition;
|
|
77
85
|
private _addTriggerEventHandlers;
|
|
78
|
-
private _attachWindowEvents;
|
|
79
86
|
private _isZeroAnimationDuration;
|
|
80
87
|
private _resetOpenCloseTimeout;
|
|
81
88
|
protected render(): TemplateResult;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.component.d.ts","sourceRoot":"","sources":["../../../src/elements/tooltip/tooltip.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACpB,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"tooltip.component.d.ts","sourceRoot":"","sources":["../../../src/elements/tooltip/tooltip.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACpB,MAAM,KAAK,CAAC;AAGb,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAoBnE;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,EAAE,CAAC;CACrC;;AAYD;;;;;;;;;;GAUG;AACH,qBAEM,iBAAkB,SAAQ,sBAAyC;IACvE,gBAAgC,IAAI,aAAa;IACjD,OAAuB,MAAM,EAAE,cAAc,CAAS;IAEtD,OAAO,CAAC,MAAM,CAAC,cAAc,CAAU;IAUvC;;;;OAIG;IACH,SAEgB,OAAO,EAAE,WAAW,GAAG,IAAI,CAAQ;IAEnD;;;;;OAKG;IACH,IACW,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,EAExC;IACD,IAAW,SAAS,IAAI,MAAM,CAE7B;IACD,OAAO,CAAC,UAAU,CAAuB;IAEzC;;;;;OAKG;IACH,IACW,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,EAEzC;IACD,IAAW,UAAU,IAAI,MAAM,CAE9B;IACD,OAAO,CAAC,WAAW,CAAuB;IAE1C;;;;;OAKG;IACH,IACW,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAE3C;IACD,IAAW,mBAAmB,IAAI,MAAM,CAEvC;IACD,OAAO,CAAC,oBAAoB,CAAC,CAAS;IAEtC,OAAO,CAAC,eAAe,CAA4B;IACnD,OAAO,CAAC,uBAAuB,CAAC,CAAkB;IAClD,OAAO,CAAC,oBAAoB,CAAmB;IAC/C,OAAO,CAAC,2BAA2B,CAA2C;IAC9E,OAAO,CAAC,kBAAkB,CAA0C;IACpE,OAAO,CAAC,YAAY,CAAC,CAAgC;IACrD,OAAO,CAAC,aAAa,CAAC,CAAgC;IACtD,OAAO,CAAC,qBAAqB,CAAC,CAAgC;IAC9D,OAAO,CAAC,sBAAsB,CAAC,CAAgC;;IA0B/D,OAAO,CAAC,MAAM,CAAC,wBAAwB;IAkCvC,OAAO,CAAC,MAAM,CAAC,6BAA6B;IAM5C,OAAO,CAAC,MAAM,CAAC,qBAAqB;IA8CpB,iBAAiB,IAAI,IAAI;IAYzB,oBAAoB,IAAI,IAAI;IAM5B,aAAa,CAC3B,IAAI,CAAC,EAAE,WAAW,EAClB,QAAQ,CAAC,EAAE,OAAO,EAClB,OAAO,CAAC,EAAE,mBAAmB,GAC5B,IAAI;cAWY,YAAY,CAAC,iBAAiB,EAAE,cAAc,GAAG,IAAI;IAKjE,IAAI,IAAI,IAAI;IAsBZ,KAAK,IAAI,IAAI;IAgBpB,OAAO,CAAC,YAAY;IAKpB,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,aAAa;IAKrB,OAAO,CAAC,cAAc;IAUtB,OAAO,CAAC,sBAAsB;IAQ9B,OAAO,CAAC,OAAO;IAcf,OAAO,CAAC,OAAO;IAgBf,OAAO,CAAC,QAAQ;IAKhB,OAAO,CAAC,wBAAwB;IA0DhC,OAAO,CAAC,wBAAwB;IAIhC,OAAO,CAAC,sBAAsB;cAKX,MAAM,IAAI,cAAc;CAO5C;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,aAAa,EAAE,iBAAiB,CAAC;KAClC;CACF"}
|