scb-wc-test 0.1.104 → 0.1.106
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/mvc/components/scb-accordion/scb-accordion.js +8 -2
- package/mvc/components/scb-avatar/scb-avatar.js +19 -10
- package/mvc/components/scb-breadcrumb/scb-breadcrumb-item.js +2 -3
- package/mvc/components/scb-breadcrumb/scb-breadcrumb.js +13 -7
- package/mvc/components/scb-button/scb-button.js +34 -32
- package/mvc/components/scb-calendar-card/scb-calendar-card.js +13 -11
- package/mvc/components/scb-card/scb-card.js +44 -41
- package/mvc/components/scb-checkbox/scb-checkbox-group.js +15 -13
- package/mvc/components/scb-checkbox/scb-checkbox.js +6 -6
- package/mvc/components/scb-chip/scb-chip.js +27 -7
- package/mvc/components/scb-divider/scb-divider.js +41 -15
- package/mvc/components/scb-fact-card/scb-fact-card.js +37 -18
- package/mvc/components/scb-horizontal-scroller/scb-horizontal-scroller.js +71 -43
- package/mvc/components/scb-icon-button/scb-icon-button.js +15 -10
- package/mvc/components/scb-keyfigure-card/scb-keyfigure-card.js +6 -4
- package/mvc/components/scb-list/scb-list.js +3 -3
- package/mvc/components/scb-notification-card/scb-notification-card.js +5 -5
- package/mvc/components/scb-pagination/scb-pagination.js +165 -107
- package/mvc/components/scb-radio-button/scb-radio-group.js +22 -11
- package/mvc/components/scb-search/scb-search.js +84 -32
- package/mvc/components/scb-segmented-button/scb-segmented-button.js +3 -2
- package/mvc/components/scb-select/scb-select-option.js +3 -3
- package/mvc/components/scb-select/scb-select.js +3 -3
- package/mvc/components/scb-status-pill/scb-status-pill.js +17 -13
- package/mvc/components/scb-stepper/scb-stepper.js +32 -29
- package/mvc/components/scb-switch/scb-switch.js +11 -8
- package/mvc/components/scb-tabs/scb-tabs.js +22 -19
- package/mvc/components/scb-textfield/scb-textfield.js +14 -10
- package/mvc/components/scb-toc/scb-toc.js +6 -3
- package/mvc/components/scb-viz/scb-viz.js +188 -178
- package/package.json +2 -2
- package/scb-accordion/scb-accordion.d.ts +13 -0
- package/scb-accordion/scb-accordion.js +53 -21
- package/scb-avatar/scb-avatar.d.ts +6 -0
- package/scb-avatar/scb-avatar.js +96 -61
- package/scb-breadcrumb/scb-breadcrumb-item.js +8 -9
- package/scb-breadcrumb/scb-breadcrumb.d.ts +6 -0
- package/scb-breadcrumb/scb-breadcrumb.js +61 -30
- package/scb-button/scb-button.d.ts +10 -0
- package/scb-button/scb-button.js +89 -65
- package/scb-calendar-card/scb-calendar-card.d.ts +5 -0
- package/scb-calendar-card/scb-calendar-card.js +79 -55
- package/scb-card/scb-card.d.ts +5 -0
- package/scb-card/scb-card.js +165 -140
- package/scb-checkbox/scb-checkbox-group.d.ts +3 -1
- package/scb-checkbox/scb-checkbox-group.js +59 -40
- package/scb-checkbox/scb-checkbox.d.ts +11 -0
- package/scb-checkbox/scb-checkbox.js +78 -56
- package/scb-chip/scb-chip.d.ts +24 -0
- package/scb-chip/scb-chip.js +137 -65
- package/scb-divider/scb-divider.d.ts +14 -0
- package/scb-divider/scb-divider.js +91 -43
- package/scb-fact-card/scb-fact-card.d.ts +10 -0
- package/scb-fact-card/scb-fact-card.js +135 -94
- package/scb-horizontal-scroller/scb-horizontal-scroller.d.ts +10 -0
- package/scb-horizontal-scroller/scb-horizontal-scroller.js +179 -120
- package/scb-icon-button/scb-icon-button.d.ts +6 -1
- package/scb-icon-button/scb-icon-button.js +81 -59
- package/scb-keyfigure-card/scb-keyfigure-card.d.ts +10 -0
- package/scb-keyfigure-card/scb-keyfigure-card.js +76 -52
- package/scb-list/scb-list.d.ts +7 -1
- package/scb-list/scb-list.js +62 -40
- package/scb-notification-card/scb-notification-card.d.ts +5 -0
- package/scb-notification-card/scb-notification-card.js +56 -39
- package/scb-pagination/scb-pagination.d.ts +12 -1
- package/scb-pagination/scb-pagination.js +235 -147
- package/scb-radio-button/scb-radio-group.d.ts +14 -3
- package/scb-radio-button/scb-radio-group.js +120 -67
- package/scb-search/scb-search.d.ts +15 -2
- package/scb-search/scb-search.js +152 -69
- package/scb-segmented-button/scb-segmented-button.d.ts +41 -4
- package/scb-segmented-button/scb-segmented-button.js +145 -61
- package/scb-select/scb-select-option.js +3 -3
- package/scb-select/scb-select.js +26 -26
- package/scb-status-pill/scb-status-pill.d.ts +12 -1
- package/scb-status-pill/scb-status-pill.js +51 -27
- package/scb-stepper/scb-stepper.d.ts +11 -3
- package/scb-stepper/scb-stepper.js +134 -101
- package/scb-switch/scb-switch.d.ts +21 -2
- package/scb-switch/scb-switch.js +97 -45
- package/scb-tabs/scb-tabs.d.ts +8 -0
- package/scb-tabs/scb-tabs.js +74 -44
- package/scb-textfield/scb-textfield.d.ts +7 -0
- package/scb-textfield/scb-textfield.js +43 -16
- package/scb-toc/scb-toc.d.ts +10 -1
- package/scb-toc/scb-toc.js +49 -18
- package/scb-viz/scb-viz.d.ts +10 -3
- package/scb-viz/scb-viz.js +278 -236
- package/scb-wc-test.bundle.js +1177 -896
|
@@ -1,47 +1,49 @@
|
|
|
1
|
-
import { css as
|
|
2
|
-
import { property as
|
|
1
|
+
import { css as y, LitElement as m, html as h } from "lit";
|
|
2
|
+
import { property as d, customElement as L } from "lit/decorators.js";
|
|
3
3
|
import "../scb-icon-button/scb-icon-button.js";
|
|
4
4
|
import "../scb-button/scb-button.js";
|
|
5
5
|
import "@material/web/focus/md-focus-ring.js";
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
var x = Object.defineProperty, z = Object.getOwnPropertyDescriptor, w = (t) => {
|
|
7
|
+
throw TypeError(t);
|
|
8
|
+
}, c = (t, o, l, r) => {
|
|
9
|
+
for (var s = r > 1 ? void 0 : r ? z(o, l) : o, a = t.length - 1, n; a >= 0; a--)
|
|
10
|
+
(n = t[a]) && (s = (r ? n(o, l, s) : n(s)) || s);
|
|
11
|
+
return r && s && x(o, l, s), s;
|
|
12
|
+
}, k = (t, o, l) => o.has(t) || w("Cannot " + l), B = (t, o, l) => o.has(t) ? w("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(t) : o.set(t, l), S = (t, o, l) => (k(t, o, "access private method"), l), f, v;
|
|
13
|
+
let e = class extends m {
|
|
12
14
|
constructor() {
|
|
13
|
-
super(...arguments), this.variant = "standard", this.width = "100%", this.showScrollbar = !0, this.rightScrollButtonLabel = "Scrolla höger", this.leftScrollButtonLabel = "Scrolla vänster", this.contentFlex = !1, this.updateScrollButtons = () => {
|
|
14
|
-
var
|
|
15
|
+
super(...arguments), B(this, f), this.variant = "standard", this.width = "100%", this.showScrollbar = !0, this.rightScrollButtonLabel = "Scrolla höger", this.leftScrollButtonLabel = "Scrolla vänster", this.spacing = "", this.spacingTop = "", this.spacingBottom = "", this.contentFlex = !1, this.updateScrollButtons = () => {
|
|
16
|
+
var l;
|
|
15
17
|
this.requestUpdate();
|
|
16
|
-
const t = (
|
|
18
|
+
const t = (l = this.shadowRoot) == null ? void 0 : l.querySelector(".scb-horizontal-scroller");
|
|
17
19
|
if (!t) return;
|
|
18
20
|
t.scrollLeft > 0 ? this.setAttribute("data-scroll-left", "") : this.removeAttribute("data-scroll-left");
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
+
const o = t;
|
|
22
|
+
o.scrollLeft + o.clientWidth < o.scrollWidth - 1 ? this.setAttribute("data-scroll-right", "") : this.removeAttribute("data-scroll-right");
|
|
21
23
|
}, this.lastScrollLeft = 0, this.isScrolling = !1, this.scrollEndTimeout = null, this.handleScroll = () => {
|
|
22
|
-
var
|
|
23
|
-
const t = (
|
|
24
|
+
var o;
|
|
25
|
+
const t = (o = this.shadowRoot) == null ? void 0 : o.querySelector(".scb-horizontal-scroller");
|
|
24
26
|
t && (this.updateScrollButtons(), this.dispatchCustomEvent("scb-scroll", { scrollLeft: t.scrollLeft }), this.isScrolling || (this.isScrolling = !0, this.dispatchCustomEvent("scb-scroll-start", { scrollLeft: t.scrollLeft })), clearTimeout(this.scrollEndTimeout), this.scrollEndTimeout = setTimeout(() => {
|
|
25
27
|
this.isScrolling = !1, this.dispatchCustomEvent("scb-scroll-end", { scrollLeft: t.scrollLeft });
|
|
26
28
|
}, 120), t.scrollLeft > this.lastScrollLeft ? this.dispatchCustomEvent("scb-scroll-right", { scrollLeft: t.scrollLeft }) : t.scrollLeft < this.lastScrollLeft && this.dispatchCustomEvent("scb-scroll-left", { scrollLeft: t.scrollLeft }), this.lastScrollLeft = t.scrollLeft);
|
|
27
29
|
};
|
|
28
30
|
}
|
|
29
31
|
doScrollBy(t) {
|
|
30
|
-
var
|
|
31
|
-
const
|
|
32
|
-
|
|
32
|
+
var l;
|
|
33
|
+
const o = (l = this.shadowRoot) == null ? void 0 : l.querySelector(".scb-horizontal-scroller");
|
|
34
|
+
o && o.scrollBy({ left: t, behavior: "smooth" });
|
|
33
35
|
}
|
|
34
36
|
get canScrollLeft() {
|
|
35
|
-
var
|
|
36
|
-
const t = (
|
|
37
|
+
var o;
|
|
38
|
+
const t = (o = this.shadowRoot) == null ? void 0 : o.querySelector(".scb-horizontal-scroller");
|
|
37
39
|
return t ? t.scrollLeft > 0 : !1;
|
|
38
40
|
}
|
|
39
41
|
get canScrollRight() {
|
|
40
|
-
var
|
|
41
|
-
const t = (
|
|
42
|
+
var l;
|
|
43
|
+
const t = (l = this.shadowRoot) == null ? void 0 : l.querySelector(".scb-horizontal-scroller");
|
|
42
44
|
if (!t) return !1;
|
|
43
|
-
const
|
|
44
|
-
return
|
|
45
|
+
const o = t;
|
|
46
|
+
return o.scrollLeft + o.clientWidth < o.scrollWidth - 1;
|
|
45
47
|
}
|
|
46
48
|
connectedCallback() {
|
|
47
49
|
super.connectedCallback(), this.addEventListener("scroll", this.updateScrollButtons, !0);
|
|
@@ -49,114 +51,163 @@ let n = class extends v {
|
|
|
49
51
|
disconnectedCallback() {
|
|
50
52
|
super.disconnectedCallback(), this.removeEventListener("scroll", this.updateScrollButtons, !0);
|
|
51
53
|
}
|
|
52
|
-
dispatchCustomEvent(t,
|
|
53
|
-
this.dispatchEvent(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
dispatchCustomEvent(t, o = {}) {
|
|
55
|
+
this.dispatchEvent(
|
|
56
|
+
new CustomEvent(t, {
|
|
57
|
+
detail: o,
|
|
58
|
+
bubbles: !0,
|
|
59
|
+
composed: !0
|
|
60
|
+
})
|
|
61
|
+
);
|
|
58
62
|
}
|
|
59
63
|
firstUpdated() {
|
|
60
|
-
var
|
|
61
|
-
const t = (
|
|
62
|
-
t && (t.addEventListener("scroll", this.handleScroll), t.addEventListener(
|
|
63
|
-
|
|
64
|
-
|
|
64
|
+
var a, n, u, b;
|
|
65
|
+
const t = (a = this.shadowRoot) == null ? void 0 : a.querySelector(".scb-horizontal-scroller"), o = (n = this.shadowRoot) == null ? void 0 : n.querySelector(".scroll-shadow-left"), l = (u = this.shadowRoot) == null ? void 0 : u.querySelector(".scroll-shadow-right"), r = (b = this.shadowRoot) == null ? void 0 : b.querySelector("slot");
|
|
66
|
+
t && (t.addEventListener("scroll", this.handleScroll), t.addEventListener(
|
|
67
|
+
"wheel",
|
|
68
|
+
function(i) {
|
|
69
|
+
i.deltaY !== 0 && (i.preventDefault(), t.scrollLeft += i.deltaY);
|
|
70
|
+
},
|
|
71
|
+
{ passive: !1 }
|
|
72
|
+
));
|
|
65
73
|
const s = () => {
|
|
66
|
-
if (r &&
|
|
67
|
-
const
|
|
68
|
-
|
|
74
|
+
if (r && o && l) {
|
|
75
|
+
const i = r.getBoundingClientRect();
|
|
76
|
+
o.style.height = `${i.height}px`, l.style.height = `${i.height}px`;
|
|
69
77
|
}
|
|
70
78
|
};
|
|
71
79
|
s(), r && new ResizeObserver(s).observe(r), this.updateComplete.then(() => {
|
|
72
80
|
this.updateScrollButtons();
|
|
73
|
-
});
|
|
81
|
+
}), S(this, f, v).call(this);
|
|
74
82
|
}
|
|
75
83
|
updated(t) {
|
|
76
|
-
var
|
|
77
|
-
const
|
|
84
|
+
var n, u, b, i;
|
|
85
|
+
const o = (n = this.shadowRoot) == null ? void 0 : n.querySelector(".scroll-shadow-left"), l = (u = this.shadowRoot) == null ? void 0 : u.querySelector(".scroll-shadow-right"), r = (b = this.shadowRoot) == null ? void 0 : b.querySelector("slot"), s = (i = this.shadowRoot) == null ? void 0 : i.querySelector(".scb-horizontal-scroller");
|
|
78
86
|
if (s) {
|
|
79
|
-
s.addEventListener("scroll", this.handleScroll), s.addEventListener(
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
87
|
+
s.addEventListener("scroll", this.handleScroll), s.addEventListener(
|
|
88
|
+
"wheel",
|
|
89
|
+
function(g) {
|
|
90
|
+
g.deltaY !== 0 && (g.preventDefault(), s.scrollLeft += g.deltaY);
|
|
91
|
+
},
|
|
92
|
+
{ passive: !1 }
|
|
93
|
+
), s.scrollLeft > 0 ? this.setAttribute("data-scroll-left", "") : this.removeAttribute("data-scroll-left");
|
|
94
|
+
const p = s;
|
|
95
|
+
p.scrollLeft + p.clientWidth < p.scrollWidth - 1 ? this.setAttribute("data-scroll-right", "") : this.removeAttribute("data-scroll-right");
|
|
84
96
|
}
|
|
85
97
|
t.has("width") && this.style.setProperty("--scb-horizontal-scroller-width", this.width);
|
|
86
|
-
const
|
|
87
|
-
if (r &&
|
|
88
|
-
const
|
|
89
|
-
|
|
98
|
+
const a = () => {
|
|
99
|
+
if (r && o && l) {
|
|
100
|
+
const p = r.getBoundingClientRect();
|
|
101
|
+
o.style.height = `${p.height}px`, l.style.height = `${p.height}px`;
|
|
90
102
|
}
|
|
91
103
|
};
|
|
92
|
-
|
|
104
|
+
a(), r && new ResizeObserver(a).observe(r), (t.has("spacing") || t.has("spacingTop") || t.has("spacingBottom")) && S(this, f, v).call(this);
|
|
105
|
+
}
|
|
106
|
+
mapSpacingToken(t) {
|
|
107
|
+
if (!t) return;
|
|
108
|
+
const o = String(t).trim();
|
|
109
|
+
if (o)
|
|
110
|
+
return /^\d+$/.test(o) ? `var(--spacing-${Math.max(0, Math.min(14, parseInt(o, 10)))})` : o;
|
|
93
111
|
}
|
|
94
112
|
render() {
|
|
95
|
-
const t = this.variant;
|
|
96
|
-
var l = !!(this.canScrollLeft || this.canScrollRight);
|
|
113
|
+
const t = this.variant, o = !!(this.canScrollLeft || this.canScrollRight);
|
|
97
114
|
switch (t) {
|
|
98
115
|
case "inline":
|
|
99
|
-
return
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
</div>
|
|
106
|
-
${l ? a`
|
|
107
|
-
<div class="scroll-buttons">
|
|
108
|
-
${this.canScrollLeft ? a`
|
|
109
|
-
<scb-button class="scroll-button-left" variant="text" label="${this.leftScrollButtonLabel}" aria-label="Scrolla vänster" icon="chevron_left" @click="${() => this.doScrollBy(-100)}"></scb-button>
|
|
110
|
-
` : ""}
|
|
111
|
-
|
|
112
|
-
${this.canScrollRight ? a`
|
|
113
|
-
<scb-button class="scroll-button-right" variant="text" label="${this.rightScrollButtonLabel}" aria-label="Scrolla höger" icon="chevron_right" trailing-icon @click="${() => this.doScrollBy(100)}"></scb-button>
|
|
114
|
-
` : ""}
|
|
116
|
+
return h`
|
|
117
|
+
<div class="scb-horizontal-scroller ${o ? "canScroll" : ""}" tabindex="0">
|
|
118
|
+
${this.variant != "inline" ? h`<div class="scroll-shadow-left"></div>` : ""}
|
|
119
|
+
<slot></slot>
|
|
120
|
+
<md-focus-ring inward></md-focus-ring>
|
|
121
|
+
${this.variant != "inline" ? h`<div class="scroll-shadow-right"></div>` : ""}
|
|
115
122
|
</div>
|
|
116
|
-
|
|
117
|
-
|
|
123
|
+
${o ? h`
|
|
124
|
+
<div class="scroll-buttons">
|
|
125
|
+
${this.canScrollLeft ? h`
|
|
126
|
+
<scb-button
|
|
127
|
+
class="scroll-button-left"
|
|
128
|
+
variant="text"
|
|
129
|
+
label="${this.leftScrollButtonLabel}"
|
|
130
|
+
aria-label="Scrolla vänster"
|
|
131
|
+
icon="chevron_left"
|
|
132
|
+
@click="${() => this.doScrollBy(-100)}"
|
|
133
|
+
></scb-button>
|
|
134
|
+
` : ""}
|
|
135
|
+
|
|
136
|
+
${this.canScrollRight ? h`
|
|
137
|
+
<scb-button
|
|
138
|
+
class="scroll-button-right"
|
|
139
|
+
variant="text"
|
|
140
|
+
label="${this.rightScrollButtonLabel}"
|
|
141
|
+
aria-label="Scrolla höger"
|
|
142
|
+
icon="chevron_right"
|
|
143
|
+
trailing-icon
|
|
144
|
+
@click="${() => this.doScrollBy(100)}"
|
|
145
|
+
></scb-button>
|
|
146
|
+
` : ""}
|
|
147
|
+
</div>
|
|
148
|
+
` : ""}
|
|
149
|
+
`;
|
|
118
150
|
default:
|
|
119
|
-
return
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
<
|
|
131
|
-
|
|
132
|
-
|
|
151
|
+
return h`
|
|
152
|
+
${this.canScrollLeft ? h`
|
|
153
|
+
<scb-icon-button
|
|
154
|
+
class="scroll-button-left"
|
|
155
|
+
icon="chevron_left"
|
|
156
|
+
aria-label="Scrolla vänster"
|
|
157
|
+
variant="filled-tonal"
|
|
158
|
+
@click="${() => this.doScrollBy(-100)}"
|
|
159
|
+
></scb-icon-button>
|
|
160
|
+
` : ""}
|
|
161
|
+
<div class="scroll-shadow-left"></div>
|
|
162
|
+
<div class="scb-horizontal-scroller">
|
|
163
|
+
<slot></slot>
|
|
164
|
+
<md-focus-ring inward></md-focus-ring>
|
|
165
|
+
</div>
|
|
166
|
+
<div class="scroll-shadow-right"></div>
|
|
167
|
+
${this.canScrollRight ? h`
|
|
168
|
+
<scb-icon-button
|
|
169
|
+
class="scroll-button-right"
|
|
170
|
+
icon="chevron_right"
|
|
171
|
+
aria-label="Scrolla höger"
|
|
172
|
+
variant="filled-tonal"
|
|
173
|
+
@click="${() => this.doScrollBy(100)}"
|
|
174
|
+
></scb-icon-button>
|
|
175
|
+
` : ""}
|
|
176
|
+
`;
|
|
133
177
|
}
|
|
134
178
|
}
|
|
135
179
|
};
|
|
136
|
-
|
|
180
|
+
f = /* @__PURE__ */ new WeakSet();
|
|
181
|
+
v = function() {
|
|
182
|
+
const t = this.mapSpacingToken(this.spacing), o = this.mapSpacingToken(this.spacingTop), l = this.mapSpacingToken(this.spacingBottom), r = o ?? t, s = l ?? t;
|
|
183
|
+
r ? this.style.setProperty("--scb-horizontal-scroller-spacing-block-start", r) : this.style.removeProperty("--scb-horizontal-scroller-spacing-block-start"), s ? this.style.setProperty("--scb-horizontal-scroller-spacing-block-end", s) : this.style.removeProperty("--scb-horizontal-scroller-spacing-block-end");
|
|
184
|
+
};
|
|
185
|
+
e.styles = y`
|
|
137
186
|
:host {
|
|
138
187
|
display: flex;
|
|
139
188
|
position: relative;
|
|
140
189
|
align-items: center;
|
|
141
190
|
gap: var(--spacing-3);
|
|
142
191
|
padding: 0px var(--spacing-8);
|
|
192
|
+
margin-block-start: var(--scb-horizontal-scroller-spacing-block-start, 0);
|
|
193
|
+
margin-block-end: var(--scb-horizontal-scroller-spacing-block-end, 0);
|
|
143
194
|
}
|
|
144
195
|
.scb-horizontal-scroller {
|
|
145
196
|
overflow-x: auto;
|
|
146
|
-
-ms-overflow-style: none;
|
|
197
|
+
-ms-overflow-style: none; /* IE and Edge */
|
|
147
198
|
scrollbar-width: none;
|
|
148
199
|
width: 100%;
|
|
149
200
|
}
|
|
150
|
-
:host([show-scrollbar]) .scb-horizontal-scroller{
|
|
151
|
-
|
|
201
|
+
:host([show-scrollbar]) .scb-horizontal-scroller {
|
|
202
|
+
scrollbar-width: auto;
|
|
152
203
|
}
|
|
153
204
|
|
|
154
|
-
:host([content-flex]) .scb-horizontal-scroller{
|
|
205
|
+
:host([content-flex]) .scb-horizontal-scroller {
|
|
155
206
|
display: flex;
|
|
156
207
|
flex-direction: row;
|
|
157
208
|
flex: 1 1 auto;
|
|
158
209
|
}
|
|
159
|
-
|
|
210
|
+
|
|
160
211
|
.scb-horizontal-scroller::-webkit-scrollbar {
|
|
161
212
|
border-radius: var(--md-sys-shape-corner-large);
|
|
162
213
|
height: 4px;
|
|
@@ -172,13 +223,13 @@ n.styles = g`
|
|
|
172
223
|
border-radius: var(--md-sys-shape-corner-large);
|
|
173
224
|
}
|
|
174
225
|
.scb-horizontal-scroller:focus {
|
|
175
|
-
|
|
226
|
+
outline: none;
|
|
176
227
|
}
|
|
177
228
|
md-focus-ring {
|
|
178
229
|
border-radius: var(--scb-card-focus-ring-radius, var(--md-sys-shape-corner-large));
|
|
179
230
|
}
|
|
180
231
|
|
|
181
|
-
:host([show-scrollbar]) .scb-horizontal-scroller.canScroll{
|
|
232
|
+
:host([show-scrollbar]) .scb-horizontal-scroller.canScroll {
|
|
182
233
|
padding-bottom: var(--spacing-5);
|
|
183
234
|
}
|
|
184
235
|
slot {
|
|
@@ -217,12 +268,12 @@ n.styles = g`
|
|
|
217
268
|
right: 0;
|
|
218
269
|
}
|
|
219
270
|
:host([data-scroll-left]) .scroll-shadow-left {
|
|
220
|
-
box-shadow: 16px 0 16px -8px rgba(0,0,0,0.12);
|
|
271
|
+
box-shadow: 16px 0 16px -8px rgba(0, 0, 0, 0.12);
|
|
221
272
|
}
|
|
222
273
|
:host([data-scroll-right]) .scroll-shadow-right {
|
|
223
|
-
box-shadow: -16px 0 16px -8px rgba(0,0,0,0.12);
|
|
274
|
+
box-shadow: -16px 0 16px -8px rgba(0, 0, 0, 0.12);
|
|
224
275
|
}
|
|
225
|
-
:host([variant=
|
|
276
|
+
:host([variant='inline']) {
|
|
226
277
|
flex-direction: column;
|
|
227
278
|
align-items: unset;
|
|
228
279
|
padding: 0;
|
|
@@ -242,32 +293,40 @@ n.styles = g`
|
|
|
242
293
|
z-index: auto;
|
|
243
294
|
}
|
|
244
295
|
}
|
|
245
|
-
:host([variant=
|
|
296
|
+
:host([variant='inline'][show-scrollbar]) {
|
|
246
297
|
gap: var(--spacing-5);
|
|
247
298
|
}
|
|
248
|
-
|
|
249
299
|
`;
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
],
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
],
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
],
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
],
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
],
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
],
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
],
|
|
300
|
+
c([
|
|
301
|
+
d({ type: String, reflect: !0 })
|
|
302
|
+
], e.prototype, "variant", 2);
|
|
303
|
+
c([
|
|
304
|
+
d({ type: String, reflect: !0 })
|
|
305
|
+
], e.prototype, "width", 2);
|
|
306
|
+
c([
|
|
307
|
+
d({ type: Boolean, reflect: !0, attribute: "show-scrollbar" })
|
|
308
|
+
], e.prototype, "showScrollbar", 2);
|
|
309
|
+
c([
|
|
310
|
+
d({ type: String, reflect: !0, attribute: "right-scroll-button-label" })
|
|
311
|
+
], e.prototype, "rightScrollButtonLabel", 2);
|
|
312
|
+
c([
|
|
313
|
+
d({ type: String, reflect: !0, attribute: "left-scroll-button-label" })
|
|
314
|
+
], e.prototype, "leftScrollButtonLabel", 2);
|
|
315
|
+
c([
|
|
316
|
+
d({ type: String, reflect: !0 })
|
|
317
|
+
], e.prototype, "spacing", 2);
|
|
318
|
+
c([
|
|
319
|
+
d({ type: String, reflect: !0, attribute: "spacing-top" })
|
|
320
|
+
], e.prototype, "spacingTop", 2);
|
|
321
|
+
c([
|
|
322
|
+
d({ type: String, reflect: !0, attribute: "spacing-bottom" })
|
|
323
|
+
], e.prototype, "spacingBottom", 2);
|
|
324
|
+
c([
|
|
325
|
+
d({ type: Boolean, reflect: !0, attribute: "content-flex" })
|
|
326
|
+
], e.prototype, "contentFlex", 2);
|
|
327
|
+
e = c([
|
|
328
|
+
L("scb-horizontal-scroller")
|
|
329
|
+
], e);
|
|
271
330
|
export {
|
|
272
|
-
|
|
331
|
+
e as ScbHorizontalScroller
|
|
273
332
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { LitElement, TemplateResult, PropertyValues } from 'lit';
|
|
2
2
|
type IconVariant = 'filled' | 'outlined' | 'filled-tonal' | 'standard';
|
|
3
3
|
export declare class ScbIconButton extends LitElement {
|
|
4
|
+
#private;
|
|
4
5
|
/** Visuell ikon. */
|
|
5
6
|
icon: string;
|
|
6
7
|
/** Tooltiptext. Används som native title. */
|
|
@@ -19,6 +20,8 @@ export declare class ScbIconButton extends LitElement {
|
|
|
19
20
|
toggleonicon: string;
|
|
20
21
|
/** Inaktiverad. */
|
|
21
22
|
disabled: boolean;
|
|
23
|
+
/** Vertikalt avstånd till omgivande innehåll. "N" mappar till var(--spacing-N). */
|
|
24
|
+
spacing: string;
|
|
22
25
|
private __loadedVariants;
|
|
23
26
|
private __iconLoaded;
|
|
24
27
|
private __lastMdHost;
|
|
@@ -33,8 +36,10 @@ export declare class ScbIconButton extends LitElement {
|
|
|
33
36
|
/** Koppla change-event från md-* samt spegla selected. */
|
|
34
37
|
private __attachChangeListener;
|
|
35
38
|
/**
|
|
36
|
-
* Synkar native title och aria-* mellan host och md-*.
|
|
39
|
+
* Synkar native title och aria-* mellan host och md-*.
|
|
40
|
+
*/
|
|
37
41
|
private __syncTitleAndAria;
|
|
42
|
+
private mapSpacingToken;
|
|
38
43
|
static styles: import('lit').CSSResult;
|
|
39
44
|
private __renderToggleIcons;
|
|
40
45
|
private __renderSingleIcon;
|