scb-wc-test 0.1.11 → 0.1.13
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/all.js +2 -0
- package/index.d.ts +1 -0
- package/index.js +34 -32
- package/mvc/components/all.js +1 -0
- package/mvc/components/scb-accordion/scb-accordion-item.js +21 -61
- package/mvc/components/scb-app-bar/scb-app-bar.js +1 -1
- package/mvc/components/scb-avatar/scb-avatar.js +1 -1
- package/mvc/components/scb-breadcrumb/scb-breadcrumb-item.js +1 -1
- package/mvc/components/scb-breadcrumb/scb-breadcrumb.js +1 -1
- package/mvc/components/scb-button/scb-button.js +1 -1
- package/mvc/components/scb-calendar-card/scb-calendar-card.js +165 -126
- package/mvc/components/scb-card/scb-card.js +223 -217
- package/mvc/components/scb-checkbox/scb-checkbox-group.js +1 -1
- package/mvc/components/scb-checkbox/scb-checkbox.js +9 -11
- package/mvc/components/scb-chips/scb-chip.js +1 -1
- package/mvc/components/scb-dialog/scb-dialog.js +2 -2
- package/mvc/components/scb-divider/scb-divider.js +43 -53
- package/mvc/components/scb-drawer/scb-drawer-item.js +2 -2
- package/mvc/components/scb-drawer/scb-drawer-section.js +4 -4
- package/mvc/components/scb-drawer/scb-drawer.js +1 -1
- package/mvc/components/scb-drawer/scb-sub-drawer.js +1 -1
- package/mvc/components/scb-fact-card/scb-fact-card-content.js +1 -1
- package/mvc/components/scb-fact-card/scb-fact-card.js +68 -55
- package/mvc/components/scb-footer/scb-footer-section.js +2 -2
- package/mvc/components/scb-footer/scb-footer.js +1 -1
- package/mvc/components/scb-grid/scb-grid-item.js +5 -3
- package/mvc/components/scb-grid/scb-grid.js +27 -10
- package/mvc/components/scb-grid/scb-stack.js +10 -6
- package/mvc/components/scb-header/scb-header-drawer-group.js +1 -1
- package/mvc/components/scb-header/scb-header-drawer-item.js +1 -1
- package/mvc/components/scb-header/scb-header-tab.js +1 -1
- package/mvc/components/scb-header/scb-header-utility.js +1 -1
- package/mvc/components/scb-header/scb-header.js +53 -49
- package/mvc/components/scb-icon-button/scb-icon-button.js +45 -80
- package/mvc/components/scb-keyfigure-card/scb-keyfigure-card.js +84 -58
- package/mvc/components/scb-link/scb-link.js +39 -16
- package/mvc/components/scb-list/scb-list-item.js +115 -37
- package/mvc/components/scb-list/scb-list.js +16 -7
- package/mvc/components/scb-menu/scb-menu-item.js +1 -1
- package/mvc/components/scb-menu/scb-menu.js +1 -1
- package/mvc/components/scb-menu/scb-sub-menu.js +1 -1
- package/mvc/components/scb-notification/scb-notification.js +1 -1
- package/mvc/components/scb-notification-card/scb-notification-card.js +187 -0
- package/mvc/components/scb-progress-indicator/scb-progress-indicator.js +1 -1
- package/mvc/components/scb-radio-button/scb-radio-button.js +29 -36
- package/mvc/components/scb-radio-button/scb-radio-group.js +1 -1
- package/mvc/components/scb-search/scb-search.js +48 -37
- package/mvc/components/scb-snackbar/scb-snackbar.js +8 -8
- package/mvc/components/scb-status-pill/scb-status-pill.js +1 -1
- package/mvc/components/scb-switch/scb-switch.js +1 -1
- package/mvc/components/scb-tabs/scb-primary-tab.js +1 -1
- package/mvc/components/scb-tabs/scb-secondary-tab.js +1 -1
- package/mvc/components/scb-tabs/scb-tabs.js +1 -1
- package/mvc/components/scb-textfield/scb-textfield.js +1 -1
- package/mvc/components/scb-toc/scb-toc-item.js +1 -1
- package/mvc/components/scb-toc/scb-toc.js +2 -2
- package/mvc/components/scb-tooltip/scb-tooltip.js +1 -1
- package/mvc/vendor/vendor-material.js +232 -312
- package/mvc/vendor/vendor.js +19 -23
- package/package.json +6 -2
- package/scb-accordion/scb-accordion-item.js +47 -98
- package/scb-calendar-card/scb-calendar-card.d.ts +6 -4
- package/scb-calendar-card/scb-calendar-card.js +207 -154
- package/scb-card/scb-card.d.ts +8 -3
- package/scb-card/scb-card.js +265 -250
- package/scb-checkbox/scb-checkbox.d.ts +1 -0
- package/scb-checkbox/scb-checkbox.js +56 -49
- package/scb-divider/scb-divider.d.ts +16 -4
- package/scb-divider/scb-divider.js +63 -69
- package/scb-fact-card/scb-fact-card.d.ts +8 -7
- package/scb-fact-card/scb-fact-card.js +100 -78
- package/scb-grid/scb-grid-item.d.ts +7 -2
- package/scb-grid/scb-grid-item.js +47 -33
- package/scb-grid/scb-grid.d.ts +7 -3
- package/scb-grid/scb-grid.js +57 -21
- package/scb-grid/scb-stack.d.ts +5 -1
- package/scb-grid/scb-stack.js +57 -31
- package/scb-header/scb-header.d.ts +1 -2
- package/scb-header/scb-header.js +154 -162
- package/scb-icon-button/scb-icon-button.d.ts +15 -11
- package/scb-icon-button/scb-icon-button.js +149 -132
- package/scb-keyfigure-card/scb-keyfigure-card.d.ts +6 -1
- package/scb-keyfigure-card/scb-keyfigure-card.js +139 -93
- package/scb-link/scb-link.d.ts +1 -0
- package/scb-link/scb-link.js +65 -38
- package/scb-list/scb-list-item.d.ts +8 -5
- package/scb-list/scb-list-item.js +183 -73
- package/scb-list/scb-list.d.ts +5 -0
- package/scb-list/scb-list.js +71 -21
- package/scb-notification-card/scb-notification-card.d.ts +18 -0
- package/scb-notification-card/scb-notification-card.js +264 -0
- package/scb-radio-button/scb-radio-button.js +46 -53
- package/scb-search/scb-search.d.ts +8 -0
- package/scb-search/scb-search.js +176 -139
- package/scb-wc-test.bundle.js +1870 -1546
|
@@ -1,65 +1,79 @@
|
|
|
1
|
-
import { css as
|
|
2
|
-
import { property as
|
|
3
|
-
var
|
|
1
|
+
import { css as d, LitElement as f, html as b } from "lit";
|
|
2
|
+
import { property as a, customElement as S } from "lit/decorators.js";
|
|
3
|
+
var g = Object.defineProperty, w = Object.getOwnPropertyDescriptor, m = (e) => {
|
|
4
4
|
throw TypeError(e);
|
|
5
|
-
},
|
|
6
|
-
for (var
|
|
7
|
-
(
|
|
8
|
-
return c &&
|
|
9
|
-
},
|
|
5
|
+
}, i = (e, t, p, c) => {
|
|
6
|
+
for (var n = c > 1 ? void 0 : c ? w(t, p) : t, u = e.length - 1, h; u >= 0; u--)
|
|
7
|
+
(h = e[u]) && (n = (c ? h(t, p, n) : h(n)) || n);
|
|
8
|
+
return c && n && g(t, p, n), n;
|
|
9
|
+
}, v = (e, t, p) => t.has(e) || m("Cannot " + p), _ = (e, t, p) => t.has(e) ? m("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, p), o = (e, t, p) => (v(e, t, "access private method"), p), r, y, l;
|
|
10
10
|
let s = class extends f {
|
|
11
11
|
constructor() {
|
|
12
|
-
super(...arguments),
|
|
12
|
+
super(...arguments), _(this, r), this.fit = !1;
|
|
13
13
|
}
|
|
14
14
|
firstUpdated() {
|
|
15
|
-
|
|
15
|
+
o(this, r, y).call(this);
|
|
16
16
|
}
|
|
17
17
|
updated() {
|
|
18
|
-
|
|
18
|
+
o(this, r, y).call(this);
|
|
19
19
|
}
|
|
20
20
|
render() {
|
|
21
21
|
return b`<slot></slot>`;
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
r = /* @__PURE__ */ new WeakSet();
|
|
25
|
+
y = function() {
|
|
26
|
+
o(this, r, l).call(this, "--col-span", this.hasAttribute("col-span") ? String(this.colSpan) : null), o(this, r, l).call(this, "--col-span-compact", this.hasAttribute("col-span-compact") ? String(this.colSpanCompact) : null), o(this, r, l).call(this, "--col-span-medium", this.hasAttribute("col-span-medium") ? String(this.colSpanMedium) : null), o(this, r, l).call(this, "--col-span-expanded", this.hasAttribute("col-span-expanded") ? String(this.colSpanExpanded) : null), o(this, r, l).call(this, "--row-rule", this.hasAttribute("row-span") ? `span ${this.rowSpan}` : null), o(this, r, l).call(this, "--row-rule-compact", this.hasAttribute("row-span-compact") ? `span ${this.rowSpanCompact}` : null), o(this, r, l).call(this, "--row-rule-medium", this.hasAttribute("row-span-medium") ? `span ${this.rowSpanMedium}` : null), o(this, r, l).call(this, "--row-rule-expanded", this.hasAttribute("row-span-expanded") ? `span ${this.rowSpanExpanded}` : null), this.align ? (this.style.setProperty("--scb-grid-item-align", this.align), this.style.setProperty("align-self", this.align)) : (this.style.removeProperty("--scb-grid-item-align"), this.style.removeProperty("align-self")), this.justify ? (this.style.setProperty("--scb-grid-item-justify", this.justify), this.style.setProperty("justify-self", this.justify)) : (this.style.removeProperty("--scb-grid-item-justify"), this.style.removeProperty("justify-self"));
|
|
27
27
|
};
|
|
28
|
-
|
|
28
|
+
l = function(e, t) {
|
|
29
29
|
t === null || t === "" ? this.style.removeProperty(e) : this.style.setProperty(e, t);
|
|
30
30
|
};
|
|
31
|
-
s.styles =
|
|
31
|
+
s.styles = d`
|
|
32
32
|
:host {
|
|
33
33
|
box-sizing: border-box;
|
|
34
34
|
display: block;
|
|
35
35
|
align-self: var(--scb-grid-item-align, auto);
|
|
36
36
|
justify-self: var(--scb-grid-item-justify, auto);
|
|
37
|
+
block-size: auto;
|
|
37
38
|
}
|
|
38
|
-
:host([fit]) {
|
|
39
|
+
:host([fit]) { block-size: 100%; }
|
|
40
|
+
:host([fit]) ::slotted(*) { block-size: 100%; }
|
|
39
41
|
`;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
i([
|
|
43
|
+
a({ type: Number, attribute: "col-span", reflect: !0 })
|
|
42
44
|
], s.prototype, "colSpan", 2);
|
|
43
|
-
|
|
44
|
-
|
|
45
|
+
i([
|
|
46
|
+
a({ type: Number, attribute: "col-span-compact", reflect: !0 })
|
|
45
47
|
], s.prototype, "colSpanCompact", 2);
|
|
46
|
-
|
|
47
|
-
|
|
48
|
+
i([
|
|
49
|
+
a({ type: Number, attribute: "col-span-medium", reflect: !0 })
|
|
48
50
|
], s.prototype, "colSpanMedium", 2);
|
|
49
|
-
|
|
50
|
-
|
|
51
|
+
i([
|
|
52
|
+
a({ type: Number, attribute: "col-span-expanded", reflect: !0 })
|
|
51
53
|
], s.prototype, "colSpanExpanded", 2);
|
|
52
|
-
|
|
53
|
-
|
|
54
|
+
i([
|
|
55
|
+
a({ type: Number, attribute: "row-span", reflect: !0 })
|
|
56
|
+
], s.prototype, "rowSpan", 2);
|
|
57
|
+
i([
|
|
58
|
+
a({ type: Number, attribute: "row-span-compact", reflect: !0 })
|
|
59
|
+
], s.prototype, "rowSpanCompact", 2);
|
|
60
|
+
i([
|
|
61
|
+
a({ type: Number, attribute: "row-span-medium", reflect: !0 })
|
|
62
|
+
], s.prototype, "rowSpanMedium", 2);
|
|
63
|
+
i([
|
|
64
|
+
a({ type: Number, attribute: "row-span-expanded", reflect: !0 })
|
|
65
|
+
], s.prototype, "rowSpanExpanded", 2);
|
|
66
|
+
i([
|
|
67
|
+
a({ type: String, reflect: !0 })
|
|
54
68
|
], s.prototype, "align", 2);
|
|
55
|
-
|
|
56
|
-
|
|
69
|
+
i([
|
|
70
|
+
a({ type: String, reflect: !0 })
|
|
57
71
|
], s.prototype, "justify", 2);
|
|
58
|
-
|
|
59
|
-
|
|
72
|
+
i([
|
|
73
|
+
a({ type: Boolean, reflect: !0 })
|
|
60
74
|
], s.prototype, "fit", 2);
|
|
61
|
-
s =
|
|
62
|
-
|
|
75
|
+
s = i([
|
|
76
|
+
S("scb-grid-item")
|
|
63
77
|
], s);
|
|
64
78
|
export {
|
|
65
79
|
s as ScbGridItem
|
package/scb-grid/scb-grid.d.ts
CHANGED
|
@@ -3,9 +3,10 @@ import { LitElement } from 'lit';
|
|
|
3
3
|
* <scb-grid>
|
|
4
4
|
* Responsivt kolumn-grid enligt M3 window size classes.
|
|
5
5
|
* Kolumner: 4 (compact) / 8 (medium) / 12 (expanded)
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* --col-span, --col-span-compact, --col-span-medium, --col-span-expanded
|
|
6
|
+
* Default-gap: var(--spacing-7, 24px)
|
|
7
|
+
* Styrning via CSS-variabler som sätts av <scb-grid-item>:
|
|
8
|
+
* Kolumner: --col-span, --col-span-compact, --col-span-medium, --col-span-expanded
|
|
9
|
+
* Rader: --row-rule, --row-rule-compact, --row-rule-medium, --row-rule-expanded (t.ex. "span 2")
|
|
9
10
|
*/
|
|
10
11
|
export declare class ScbGrid extends LitElement {
|
|
11
12
|
#private;
|
|
@@ -20,9 +21,12 @@ export declare class ScbGrid extends LitElement {
|
|
|
20
21
|
paddingInline: string;
|
|
21
22
|
paddingBlock: string;
|
|
22
23
|
maxWidth: string;
|
|
24
|
+
autoRows: string;
|
|
23
25
|
static styles: import('lit').CSSResult;
|
|
24
26
|
protected firstUpdated(): void;
|
|
25
27
|
protected updated(): void;
|
|
28
|
+
private mapSpacingToken;
|
|
29
|
+
private parseGapShorthand;
|
|
26
30
|
render(): import('lit-html').TemplateResult<1>;
|
|
27
31
|
}
|
|
28
32
|
declare global {
|
package/scb-grid/scb-grid.js
CHANGED
|
@@ -1,33 +1,49 @@
|
|
|
1
1
|
import { css as h, LitElement as v, html as b } from "lit";
|
|
2
2
|
import { property as a, customElement as y } from "lit/decorators.js";
|
|
3
|
-
var
|
|
3
|
+
var w = Object.defineProperty, f = Object.getOwnPropertyDescriptor, u = (r) => {
|
|
4
4
|
throw TypeError(r);
|
|
5
|
-
}, s = (r, t, i,
|
|
6
|
-
for (var
|
|
7
|
-
(m = r[
|
|
8
|
-
return
|
|
9
|
-
},
|
|
5
|
+
}, s = (r, t, i, c) => {
|
|
6
|
+
for (var o = c > 1 ? void 0 : c ? f(t, i) : t, d = r.length - 1, m; d >= 0; d--)
|
|
7
|
+
(m = r[d]) && (o = (c ? m(t, i, o) : m(o)) || o);
|
|
8
|
+
return c && o && w(t, i, o), o;
|
|
9
|
+
}, x = (r, t, i) => t.has(r) || u("Cannot " + i), S = (r, t, i) => t.has(r) ? u("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(r) : t.set(r, i), p = (r, t, i) => (x(r, t, "access private method"), i), n, g, l;
|
|
10
10
|
let e = class extends v {
|
|
11
11
|
constructor() {
|
|
12
|
-
super(...arguments),
|
|
12
|
+
super(...arguments), S(this, n), this.colsCompact = 4, this.colsMedium = 8, this.colsExpanded = 12, this.gap = "", this.rowGap = "", this.columnGap = "", this.alignItems = "stretch", this.justifyItems = "stretch", this.paddingInline = "", this.paddingBlock = "", this.maxWidth = "", this.autoRows = "";
|
|
13
13
|
}
|
|
14
14
|
firstUpdated() {
|
|
15
|
-
|
|
15
|
+
p(this, n, g).call(this);
|
|
16
16
|
}
|
|
17
17
|
updated() {
|
|
18
|
-
|
|
18
|
+
p(this, n, g).call(this);
|
|
19
|
+
}
|
|
20
|
+
mapSpacingToken(r) {
|
|
21
|
+
if (!r) return;
|
|
22
|
+
const t = String(r).trim();
|
|
23
|
+
return /^\d+$/.test(t) ? `var(--spacing-${Math.max(0, Math.min(14, parseInt(t, 10)))})` : t;
|
|
24
|
+
}
|
|
25
|
+
parseGapShorthand(r) {
|
|
26
|
+
if (!r) return {};
|
|
27
|
+
const t = r.trim().split(/\s+/);
|
|
28
|
+
if (t.length === 1) {
|
|
29
|
+
const i = this.mapSpacingToken(t[0]);
|
|
30
|
+
return { row: i, col: i };
|
|
31
|
+
}
|
|
32
|
+
return { row: this.mapSpacingToken(t[0]), col: this.mapSpacingToken(t[1]) };
|
|
19
33
|
}
|
|
20
34
|
render() {
|
|
21
35
|
return b`<div class="grid"><slot></slot></div>`;
|
|
22
36
|
}
|
|
23
37
|
};
|
|
24
|
-
|
|
38
|
+
n = /* @__PURE__ */ new WeakSet();
|
|
25
39
|
g = function() {
|
|
26
40
|
this.style.setProperty("--scb-grid-cols-compact", String(this.colsCompact)), this.style.setProperty("--scb-grid-cols-medium", String(this.colsMedium)), this.style.setProperty("--scb-grid-cols-expanded", String(this.colsExpanded));
|
|
27
|
-
const r = "var(--spacing-7, 24px)", t = this.
|
|
28
|
-
this.style.setProperty("--scb-grid-row-gap",
|
|
41
|
+
const r = "var(--spacing-7, 24px)", t = this.parseGapShorthand(this.gap), i = this.mapSpacingToken(this.rowGap) ?? t.row ?? r, c = this.mapSpacingToken(this.columnGap) ?? t.col ?? r;
|
|
42
|
+
this.style.setProperty("--scb-grid-row-gap", i), this.style.setProperty("--scb-grid-column-gap", c), this.style.setProperty("--scb-grid-gap", `${i} ${c}`), this.style.setProperty("--scb-grid-align-items", this.alignItems), this.style.setProperty("--scb-grid-justify-items", this.justifyItems);
|
|
43
|
+
const o = this.mapSpacingToken(this.paddingInline), d = this.mapSpacingToken(this.paddingBlock);
|
|
44
|
+
p(this, n, l).call(this, "--scb-grid-max-width", this.maxWidth), p(this, n, l).call(this, "--scb-grid-padding-inline", o ?? ""), p(this, n, l).call(this, "--scb-grid-padding-block", d ?? ""), p(this, n, l).call(this, "--scb-grid-auto-rows", this.autoRows);
|
|
29
45
|
};
|
|
30
|
-
|
|
46
|
+
l = function(r, t) {
|
|
31
47
|
t ? this.style.setProperty(r, t) : this.style.removeProperty(r);
|
|
32
48
|
};
|
|
33
49
|
e.styles = h`
|
|
@@ -38,14 +54,18 @@ e.styles = h`
|
|
|
38
54
|
margin-inline: auto;
|
|
39
55
|
padding-inline: var(--scb-grid-padding-inline, 0);
|
|
40
56
|
padding-block: var(--scb-grid-padding-block, 0);
|
|
41
|
-
|
|
42
57
|
container-type: inline-size;
|
|
43
58
|
}
|
|
44
59
|
|
|
45
60
|
.grid {
|
|
46
61
|
display: grid;
|
|
47
62
|
width: 100%;
|
|
48
|
-
|
|
63
|
+
grid-auto-rows: var(--scb-grid-auto-rows, auto);
|
|
64
|
+
|
|
65
|
+
/* Longhands med fallback till --scb-grid-gap och sedan token-default */
|
|
66
|
+
row-gap: var(--scb-grid-row-gap, var(--scb-grid-gap, var(--spacing-7, 24px)));
|
|
67
|
+
column-gap: var(--scb-grid-column-gap, var(--scb-grid-gap, var(--spacing-7, 24px)));
|
|
68
|
+
|
|
49
69
|
grid-auto-flow: row dense;
|
|
50
70
|
grid-auto-rows: var(--scb-grid-auto-rows, auto);
|
|
51
71
|
align-items: var(--scb-grid-align-items, stretch);
|
|
@@ -57,56 +77,69 @@ e.styles = h`
|
|
|
57
77
|
|
|
58
78
|
.grid > slot { display: contents; }
|
|
59
79
|
|
|
80
|
+
/* Kolumn-span + rad-span (compact) */
|
|
60
81
|
.grid ::slotted(*) {
|
|
61
|
-
|
|
82
|
+
min-width: 0;
|
|
83
|
+
min-height: 0;
|
|
62
84
|
grid-column: span min(
|
|
63
85
|
max(1, var(--col-span-compact, var(--col-span, var(--scb-grid-cols-compact, 4)))) ,
|
|
64
86
|
var(--scb-grid-cols-compact, 4)
|
|
65
87
|
);
|
|
88
|
+
grid-row: var(--row-rule-compact, var(--row-rule, auto));
|
|
66
89
|
}
|
|
67
90
|
|
|
68
|
-
|
|
91
|
+
/* Utan container queries -> media queries */
|
|
92
|
+
@supports not (container-type: inline-size) {
|
|
69
93
|
@media (min-width: 600px) {
|
|
70
94
|
.grid { grid-template-columns: repeat(var(--scb-grid-cols-medium, 8), minmax(0, 1fr)); }
|
|
71
95
|
.grid ::slotted(*) {
|
|
72
|
-
|
|
96
|
+
min-width: 0;
|
|
97
|
+
min-height: 0;
|
|
73
98
|
grid-column: span min(
|
|
74
99
|
max(1, var(--col-span-medium, var(--col-span, var(--scb-grid-cols-medium, 8)))) ,
|
|
75
100
|
var(--scb-grid-cols-medium, 8)
|
|
76
101
|
);
|
|
102
|
+
grid-row: var(--row-rule-medium, var(--row-rule, auto));
|
|
77
103
|
}
|
|
78
104
|
}
|
|
79
105
|
@media (min-width: 840px) {
|
|
80
106
|
.grid { grid-template-columns: repeat(var(--scb-grid-cols-expanded, 12), minmax(0, 1fr)); }
|
|
81
107
|
.grid ::slotted(*) {
|
|
82
|
-
|
|
108
|
+
min-width: 0;
|
|
109
|
+
min-height: 0;
|
|
83
110
|
grid-column: span min(
|
|
84
111
|
max(1, var(--col-span-expanded, var(--col-span, var(--scb-grid-cols-expanded, 12)))) ,
|
|
85
112
|
var(--scb-grid-cols-expanded, 12)
|
|
86
113
|
);
|
|
114
|
+
grid-row: var(--row-rule-expanded, var(--row-rule, auto));
|
|
87
115
|
}
|
|
88
116
|
}
|
|
89
117
|
}
|
|
90
118
|
|
|
119
|
+
/* Med container queries */
|
|
91
120
|
@supports (container-type: inline-size) {
|
|
92
121
|
@container (min-width: 600px) {
|
|
93
122
|
.grid { grid-template-columns: repeat(var(--scb-grid-cols-medium, 8), minmax(0, 1fr)); }
|
|
94
123
|
.grid ::slotted(*) {
|
|
95
|
-
|
|
124
|
+
min-width: 0;
|
|
125
|
+
min-height: 0;
|
|
96
126
|
grid-column: span min(
|
|
97
127
|
max(1, var(--col-span-medium, var(--col-span, var(--scb-grid-cols-medium, 8)))) ,
|
|
98
128
|
var(--scb-grid-cols-medium, 8)
|
|
99
129
|
);
|
|
130
|
+
grid-row: var(--row-rule-medium, var(--row-rule, auto));
|
|
100
131
|
}
|
|
101
132
|
}
|
|
102
133
|
@container (min-width: 840px) {
|
|
103
134
|
.grid { grid-template-columns: repeat(var(--scb-grid-cols-expanded, 12), minmax(0, 1fr)); }
|
|
104
135
|
.grid ::slotted(*) {
|
|
105
|
-
|
|
136
|
+
min-width: 0;
|
|
137
|
+
min-height: 0;
|
|
106
138
|
grid-column: span min(
|
|
107
139
|
max(1, var(--col-span-expanded, var(--col-span, var(--scb-grid-cols-expanded, 12)))) ,
|
|
108
140
|
var(--scb-grid-cols-expanded, 12)
|
|
109
141
|
);
|
|
142
|
+
grid-row: var(--row-rule-expanded, var(--row-rule, auto));
|
|
110
143
|
}
|
|
111
144
|
}
|
|
112
145
|
}
|
|
@@ -144,6 +177,9 @@ s([
|
|
|
144
177
|
s([
|
|
145
178
|
a({ type: String, attribute: "max-width", reflect: !0 })
|
|
146
179
|
], e.prototype, "maxWidth", 2);
|
|
180
|
+
s([
|
|
181
|
+
a({ type: String, attribute: "auto-rows", reflect: !0 })
|
|
182
|
+
], e.prototype, "autoRows", 2);
|
|
147
183
|
e = s([
|
|
148
184
|
y("scb-grid")
|
|
149
185
|
], e);
|
package/scb-grid/scb-stack.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { LitElement } from 'lit';
|
|
|
3
3
|
* <scb-stack>
|
|
4
4
|
* Minimal 1D-layout (flex) för innehåll inuti t.ex. <scb-grid-item>.
|
|
5
5
|
* - direction: row | column
|
|
6
|
-
* - gap:
|
|
6
|
+
* - gap / row-gap / column-gap: kan vara spacing-siffra 0–14 (→ var(--spacing-N)) eller valfritt CSS-värde
|
|
7
7
|
* - align (align-items) / justify (justify-content)
|
|
8
8
|
* - wrap: bryt rad i row-läge
|
|
9
9
|
* - inline: inline-flex istället för block
|
|
@@ -12,6 +12,8 @@ export declare class ScbStack extends LitElement {
|
|
|
12
12
|
#private;
|
|
13
13
|
direction: 'row' | 'column';
|
|
14
14
|
gap: string;
|
|
15
|
+
rowGap: string;
|
|
16
|
+
columnGap: string;
|
|
15
17
|
align: 'start' | 'center' | 'end' | 'stretch' | 'baseline';
|
|
16
18
|
justify: 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly';
|
|
17
19
|
wrap: boolean;
|
|
@@ -19,6 +21,8 @@ export declare class ScbStack extends LitElement {
|
|
|
19
21
|
static styles: import('lit').CSSResult;
|
|
20
22
|
protected firstUpdated(): void;
|
|
21
23
|
protected updated(): void;
|
|
24
|
+
private mapSpacingToken;
|
|
25
|
+
private parseGapShorthand;
|
|
22
26
|
render(): import('lit-html').TemplateResult<1>;
|
|
23
27
|
}
|
|
24
28
|
declare global {
|
package/scb-grid/scb-stack.js
CHANGED
|
@@ -1,36 +1,52 @@
|
|
|
1
|
-
import { css as
|
|
2
|
-
import { property as c, customElement as
|
|
3
|
-
var b = Object.defineProperty,
|
|
1
|
+
import { css as f, LitElement as g, html as d } from "lit";
|
|
2
|
+
import { property as c, customElement as m } from "lit/decorators.js";
|
|
3
|
+
var b = Object.defineProperty, v = Object.getOwnPropertyDescriptor, u = (e) => {
|
|
4
4
|
throw TypeError(e);
|
|
5
|
-
},
|
|
6
|
-
for (var a =
|
|
7
|
-
(l = e[
|
|
8
|
-
return
|
|
9
|
-
},
|
|
10
|
-
let r = class extends
|
|
5
|
+
}, n = (e, t, s, i) => {
|
|
6
|
+
for (var a = i > 1 ? void 0 : i ? v(t, s) : t, p = e.length - 1, l; p >= 0; p--)
|
|
7
|
+
(l = e[p]) && (a = (i ? l(t, s, a) : l(a)) || a);
|
|
8
|
+
return i && a && b(t, s, a), a;
|
|
9
|
+
}, k = (e, t, s) => t.has(e) || u("Cannot " + s), w = (e, t, s) => t.has(e) ? u("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s), y = (e, t, s) => (k(e, t, "access private method"), s), o, h;
|
|
10
|
+
let r = class extends g {
|
|
11
11
|
constructor() {
|
|
12
|
-
super(...arguments),
|
|
12
|
+
super(...arguments), w(this, o), this.direction = "column", this.gap = "", this.rowGap = "", this.columnGap = "", this.align = "stretch", this.justify = "start", this.wrap = !1, this.inline = !1;
|
|
13
13
|
}
|
|
14
14
|
firstUpdated() {
|
|
15
|
-
y(this,
|
|
15
|
+
y(this, o, h).call(this);
|
|
16
16
|
}
|
|
17
17
|
updated() {
|
|
18
|
-
y(this,
|
|
18
|
+
y(this, o, h).call(this);
|
|
19
|
+
}
|
|
20
|
+
mapSpacingToken(e) {
|
|
21
|
+
if (!e) return;
|
|
22
|
+
const t = String(e).trim();
|
|
23
|
+
return /^\d+$/.test(t) ? `var(--spacing-${Math.max(0, Math.min(14, parseInt(t, 10)))})` : t;
|
|
24
|
+
}
|
|
25
|
+
parseGapShorthand(e) {
|
|
26
|
+
if (!e) return {};
|
|
27
|
+
const t = e.trim().split(/\s+/);
|
|
28
|
+
if (t.length === 1) {
|
|
29
|
+
const s = this.mapSpacingToken(t[0]);
|
|
30
|
+
return { row: s, col: s };
|
|
31
|
+
}
|
|
32
|
+
return { row: this.mapSpacingToken(t[0]), col: this.mapSpacingToken(t[1]) };
|
|
19
33
|
}
|
|
20
34
|
render() {
|
|
21
|
-
return
|
|
35
|
+
return d`<slot></slot>`;
|
|
22
36
|
}
|
|
23
37
|
};
|
|
24
|
-
|
|
38
|
+
o = /* @__PURE__ */ new WeakSet();
|
|
25
39
|
h = function() {
|
|
26
|
-
this.style.setProperty("--scb-stack-direction", this.direction)
|
|
27
|
-
const e =
|
|
40
|
+
this.style.setProperty("--scb-stack-direction", this.direction);
|
|
41
|
+
const e = "var(--spacing-5, 16px)", t = this.parseGapShorthand(this.gap), s = this.mapSpacingToken(this.rowGap) ?? t.row ?? e, i = this.mapSpacingToken(this.columnGap) ?? t.col ?? e;
|
|
42
|
+
this.style.setProperty("--scb-stack-gap", `${s}`), this.style.setProperty("--scb-stack-row-gap", s), this.style.setProperty("--scb-stack-column-gap", i);
|
|
43
|
+
const a = {
|
|
28
44
|
start: "flex-start",
|
|
29
45
|
center: "center",
|
|
30
46
|
end: "flex-end",
|
|
31
47
|
stretch: "stretch",
|
|
32
48
|
baseline: "baseline"
|
|
33
|
-
},
|
|
49
|
+
}, p = {
|
|
34
50
|
start: "flex-start",
|
|
35
51
|
center: "center",
|
|
36
52
|
end: "flex-end",
|
|
@@ -38,44 +54,54 @@ h = function() {
|
|
|
38
54
|
around: "space-around",
|
|
39
55
|
evenly: "space-evenly"
|
|
40
56
|
};
|
|
41
|
-
this.style.setProperty("--scb-stack-align",
|
|
57
|
+
this.style.setProperty("--scb-stack-align", a[this.align] ?? "stretch"), this.style.setProperty("--scb-stack-justify", p[this.justify] ?? "flex-start"), this.style.setProperty("--scb-stack-wrap", this.wrap ? "wrap" : "nowrap");
|
|
42
58
|
};
|
|
43
|
-
r.styles =
|
|
59
|
+
r.styles = f`
|
|
44
60
|
:host {
|
|
45
61
|
box-sizing: border-box;
|
|
46
62
|
display: var(--scb-stack-display, flex);
|
|
47
63
|
flex-direction: var(--scb-stack-direction, column);
|
|
48
|
-
|
|
64
|
+
|
|
65
|
+
/* Longhands med fallback till --scb-stack-gap och token-default */
|
|
66
|
+
row-gap: var(--scb-stack-row-gap, var(--scb-stack-gap, var(--spacing-5, 16px)));
|
|
67
|
+
column-gap: var(--scb-stack-column-gap, var(--scb-stack-gap, var(--spacing-5, 16px)));
|
|
68
|
+
|
|
49
69
|
align-items: var(--scb-stack-align, stretch);
|
|
50
70
|
justify-content: var(--scb-stack-justify, flex-start);
|
|
51
71
|
flex-wrap: var(--scb-stack-wrap, nowrap);
|
|
72
|
+
|
|
52
73
|
width: auto;
|
|
53
74
|
max-width: 100%;
|
|
75
|
+
min-inline-size: 0;
|
|
54
76
|
}
|
|
55
|
-
:host([inline]) {
|
|
56
|
-
--scb-stack-display: inline-flex;
|
|
57
|
-
}
|
|
77
|
+
:host([inline]) { --scb-stack-display: inline-flex; }
|
|
58
78
|
`;
|
|
59
|
-
|
|
79
|
+
n([
|
|
60
80
|
c({ type: String, reflect: !0 })
|
|
61
81
|
], r.prototype, "direction", 2);
|
|
62
|
-
|
|
82
|
+
n([
|
|
63
83
|
c({ type: String, reflect: !0 })
|
|
64
84
|
], r.prototype, "gap", 2);
|
|
65
|
-
|
|
85
|
+
n([
|
|
86
|
+
c({ type: String, attribute: "row-gap", reflect: !0 })
|
|
87
|
+
], r.prototype, "rowGap", 2);
|
|
88
|
+
n([
|
|
89
|
+
c({ type: String, attribute: "column-gap", reflect: !0 })
|
|
90
|
+
], r.prototype, "columnGap", 2);
|
|
91
|
+
n([
|
|
66
92
|
c({ type: String, reflect: !0 })
|
|
67
93
|
], r.prototype, "align", 2);
|
|
68
|
-
|
|
94
|
+
n([
|
|
69
95
|
c({ type: String, reflect: !0 })
|
|
70
96
|
], r.prototype, "justify", 2);
|
|
71
|
-
|
|
97
|
+
n([
|
|
72
98
|
c({ type: Boolean, reflect: !0 })
|
|
73
99
|
], r.prototype, "wrap", 2);
|
|
74
|
-
|
|
100
|
+
n([
|
|
75
101
|
c({ type: Boolean, reflect: !0 })
|
|
76
102
|
], r.prototype, "inline", 2);
|
|
77
|
-
r =
|
|
78
|
-
|
|
103
|
+
r = n([
|
|
104
|
+
m("scb-stack")
|
|
79
105
|
], r);
|
|
80
106
|
export {
|
|
81
107
|
r as ScbStack
|
|
@@ -35,8 +35,8 @@ export declare class ScbHeader extends LitElement {
|
|
|
35
35
|
includeUtilityInDrawer: boolean;
|
|
36
36
|
searchMax?: string;
|
|
37
37
|
searchMin?: string;
|
|
38
|
+
searchHeight?: string;
|
|
38
39
|
private _drawerId;
|
|
39
|
-
private _paddingInline;
|
|
40
40
|
private _drawerMounted;
|
|
41
41
|
private _drawerExpanded;
|
|
42
42
|
private _searchId;
|
|
@@ -79,7 +79,6 @@ export declare class ScbHeader extends LitElement {
|
|
|
79
79
|
private _visible;
|
|
80
80
|
private _overflows;
|
|
81
81
|
private _measure;
|
|
82
|
-
private _updatePadding;
|
|
83
82
|
firstUpdated(): void;
|
|
84
83
|
protected updated(changed: Map<string, unknown>): void;
|
|
85
84
|
disconnectedCallback(): void;
|