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,12 +1,12 @@
|
|
|
1
|
-
import { css as x, LitElement as
|
|
2
|
-
import { property as
|
|
1
|
+
import { css as x, LitElement as y, nothing as b, html as u } from "lit";
|
|
2
|
+
import { property as d, customElement as v } from "lit/decorators.js";
|
|
3
3
|
import "@material/web/checkbox/checkbox.js";
|
|
4
|
-
var
|
|
5
|
-
for (var
|
|
6
|
-
(p =
|
|
7
|
-
return o &&
|
|
4
|
+
var f = Object.defineProperty, k = Object.getOwnPropertyDescriptor, l = (e, s, r, o) => {
|
|
5
|
+
for (var t = o > 1 ? void 0 : o ? k(s, r) : s, a = e.length - 1, p; a >= 0; a--)
|
|
6
|
+
(p = e[a]) && (t = (o ? p(s, r, t) : p(t)) || t);
|
|
7
|
+
return o && t && f(s, r, t), t;
|
|
8
8
|
};
|
|
9
|
-
let
|
|
9
|
+
let i = class extends y {
|
|
10
10
|
constructor() {
|
|
11
11
|
super(...arguments), this.disabled = !1, this.indeterminate = !1, this.checked = !1, this.label = "", this.supportingText = "", this._checkboxId = "";
|
|
12
12
|
}
|
|
@@ -14,61 +14,68 @@ let r = class extends v {
|
|
|
14
14
|
super.connectedCallback(), this._checkboxId = this.id || `scb-checkbox-${Math.random().toString(36).slice(2, 11)}`;
|
|
15
15
|
}
|
|
16
16
|
firstUpdated() {
|
|
17
|
-
var
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
this.checked =
|
|
17
|
+
var r, o;
|
|
18
|
+
const e = (r = this.shadowRoot) == null ? void 0 : r.querySelector("md-checkbox");
|
|
19
|
+
e && e.addEventListener("change", () => {
|
|
20
|
+
const t = e.checked;
|
|
21
|
+
this.checked = t, this.dispatchEvent(
|
|
22
22
|
new CustomEvent("change", {
|
|
23
|
-
detail: { checked:
|
|
23
|
+
detail: { checked: t },
|
|
24
24
|
bubbles: !0,
|
|
25
25
|
composed: !0
|
|
26
26
|
})
|
|
27
27
|
);
|
|
28
28
|
});
|
|
29
29
|
const s = (o = this.shadowRoot) == null ? void 0 : o.querySelector("label.wrap");
|
|
30
|
-
s == null || s.addEventListener("click", (
|
|
30
|
+
s == null || s.addEventListener("click", (t) => {
|
|
31
31
|
if (this.disabled) return;
|
|
32
|
-
if (!
|
|
33
|
-
var h,
|
|
34
|
-
const
|
|
35
|
-
return ((
|
|
32
|
+
if (!t.composedPath().some((c) => {
|
|
33
|
+
var h, m, g;
|
|
34
|
+
const n = c;
|
|
35
|
+
return ((m = (h = n == null ? void 0 : n.tagName) == null ? void 0 : h.toLowerCase) == null ? void 0 : m.call(h)) === "md-checkbox" || ((g = n == null ? void 0 : n.classList) == null ? void 0 : g.contains("box-wrap"));
|
|
36
36
|
})) {
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
|
|
37
|
+
t.preventDefault();
|
|
38
|
+
const c = this.shadowRoot.querySelector("md-checkbox");
|
|
39
|
+
c && (c.checked = !c.checked, c.dispatchEvent(new Event("change", { bubbles: !0, composed: !0 })));
|
|
40
40
|
}
|
|
41
|
-
});
|
|
41
|
+
}), this.__syncInnerAria();
|
|
42
|
+
}
|
|
43
|
+
updated(e) {
|
|
44
|
+
super.updated(e), e.has("disabled") && this.toggleAttribute("aria-disabled", this.disabled), (e.has("label") || e.has("supportingText")) && this.__syncInnerAria();
|
|
42
45
|
}
|
|
43
|
-
|
|
44
|
-
|
|
46
|
+
__syncInnerAria() {
|
|
47
|
+
var a;
|
|
48
|
+
const e = (a = this.shadowRoot) == null ? void 0 : a.querySelector("md-checkbox"), s = e == null ? void 0 : e.shadowRoot;
|
|
49
|
+
if (!s) return;
|
|
50
|
+
const r = s.querySelector('[role="checkbox"]') || s.querySelector('input[type="checkbox"]');
|
|
51
|
+
if (!r) return;
|
|
52
|
+
const o = this.label ? `${this._checkboxId}-label` : "", t = this.supportingText ? `${this._checkboxId}-supporting-text` : "";
|
|
53
|
+
o ? r.setAttribute("aria-labelledby", o) : r.removeAttribute("aria-labelledby"), t ? r.setAttribute("aria-describedby", t) : r.removeAttribute("aria-describedby");
|
|
45
54
|
}
|
|
46
55
|
render() {
|
|
47
|
-
const
|
|
48
|
-
return
|
|
56
|
+
const e = this.supportingText ? `${this._checkboxId}-supporting-text` : void 0;
|
|
57
|
+
return u`
|
|
49
58
|
<label class="wrap">
|
|
50
59
|
<div class="box-wrap">
|
|
51
60
|
<md-checkbox
|
|
52
61
|
id="${this._checkboxId}"
|
|
53
|
-
touch-target="wrapper"
|
|
54
62
|
?disabled=${this.disabled}
|
|
55
63
|
?indeterminate=${this.indeterminate}
|
|
56
64
|
?checked=${this.checked}
|
|
57
|
-
|
|
58
|
-
aria-label=${this.label || b}
|
|
65
|
+
${b}
|
|
59
66
|
></md-checkbox>
|
|
60
67
|
</div>
|
|
61
|
-
${this.label ?
|
|
68
|
+
${this.label ? u`<span class="lbl" id="${this._checkboxId}-label">${this.label}</span>` : b}
|
|
62
69
|
</label>
|
|
63
70
|
|
|
64
|
-
${this.supportingText ?
|
|
71
|
+
${this.supportingText ? u`<div id="${e}" class="supporting-text">
|
|
65
72
|
${this.supportingText}
|
|
66
73
|
</div>` : b}
|
|
67
74
|
<slot></slot>
|
|
68
75
|
`;
|
|
69
76
|
}
|
|
70
77
|
};
|
|
71
|
-
|
|
78
|
+
i.styles = x`
|
|
72
79
|
:host {
|
|
73
80
|
display: inline-grid;
|
|
74
81
|
grid-template-columns: auto;
|
|
@@ -105,10 +112,10 @@ r.styles = x`
|
|
|
105
112
|
.lbl {
|
|
106
113
|
color: var(--md-sys-color-on-surface);
|
|
107
114
|
font-family: var(--brand-font);
|
|
108
|
-
font-size: var(--md-sys-typescale-body-
|
|
109
|
-
line-height: var(--md-sys-typescale-body-
|
|
115
|
+
font-size: var(--md-sys-typescale-body-medium-size);
|
|
116
|
+
line-height: var(--md-sys-typescale-body-medium-line-height);
|
|
110
117
|
font-weight: var(--weight-regular, 400);
|
|
111
|
-
letter-spacing: var(--md-sys-typescale-body-
|
|
118
|
+
letter-spacing: var(--md-sys-typescale-body-medium-tracking);
|
|
112
119
|
}
|
|
113
120
|
:host([disabled]) .lbl { color: var(--n-60); }
|
|
114
121
|
|
|
@@ -125,23 +132,23 @@ r.styles = x`
|
|
|
125
132
|
}
|
|
126
133
|
`;
|
|
127
134
|
l([
|
|
128
|
-
|
|
129
|
-
],
|
|
135
|
+
d({ type: Boolean, reflect: !0 })
|
|
136
|
+
], i.prototype, "disabled", 2);
|
|
130
137
|
l([
|
|
131
|
-
|
|
132
|
-
],
|
|
138
|
+
d({ type: Boolean, reflect: !0 })
|
|
139
|
+
], i.prototype, "indeterminate", 2);
|
|
133
140
|
l([
|
|
134
|
-
|
|
135
|
-
],
|
|
141
|
+
d({ type: Boolean, reflect: !0 })
|
|
142
|
+
], i.prototype, "checked", 2);
|
|
136
143
|
l([
|
|
137
|
-
|
|
138
|
-
],
|
|
144
|
+
d({ type: String })
|
|
145
|
+
], i.prototype, "label", 2);
|
|
139
146
|
l([
|
|
140
|
-
|
|
141
|
-
],
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
],
|
|
147
|
+
d({ type: String, attribute: "supporting-text" })
|
|
148
|
+
], i.prototype, "supportingText", 2);
|
|
149
|
+
i = l([
|
|
150
|
+
v("scb-checkbox")
|
|
151
|
+
], i);
|
|
145
152
|
export {
|
|
146
|
-
|
|
153
|
+
i as ScbCheckbox
|
|
147
154
|
};
|
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
|
+
type Variant = 'thin' | 'bold';
|
|
3
|
+
type Direction = 'horizontal' | 'vertical';
|
|
4
|
+
type Inset = 'none' | 'both' | 'start' | 'end';
|
|
5
|
+
type Anchor = 'start' | 'end';
|
|
2
6
|
export declare class ScbDivider extends LitElement {
|
|
3
|
-
variant:
|
|
4
|
-
direction:
|
|
5
|
-
inset:
|
|
6
|
-
|
|
7
|
+
variant: Variant;
|
|
8
|
+
direction: Direction;
|
|
9
|
+
inset: Inset;
|
|
10
|
+
overlay: boolean;
|
|
11
|
+
anchor: Anchor;
|
|
12
|
+
static styles: import('lit').CSSResult;
|
|
7
13
|
render(): import('lit-html').TemplateResult<1>;
|
|
8
14
|
}
|
|
15
|
+
declare global {
|
|
16
|
+
interface HTMLElementTagNameMap {
|
|
17
|
+
'scb-divider': ScbDivider;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -1,84 +1,78 @@
|
|
|
1
|
-
import { css as
|
|
2
|
-
import { property as
|
|
3
|
-
var
|
|
4
|
-
for (var t =
|
|
5
|
-
(a = l[
|
|
6
|
-
return
|
|
1
|
+
import { css as v, LitElement as d, html as p } from "lit";
|
|
2
|
+
import { property as i, customElement as b } from "lit/decorators.js";
|
|
3
|
+
var h = Object.defineProperty, g = Object.getOwnPropertyDescriptor, e = (l, o, s, n) => {
|
|
4
|
+
for (var t = n > 1 ? void 0 : n ? g(o, s) : o, c = l.length - 1, a; c >= 0; c--)
|
|
5
|
+
(a = l[c]) && (t = (n ? a(o, s, t) : a(t)) || t);
|
|
6
|
+
return n && t && h(o, s, t), t;
|
|
7
7
|
};
|
|
8
|
-
let r = class extends
|
|
8
|
+
let r = class extends d {
|
|
9
9
|
constructor() {
|
|
10
|
-
super(...arguments), this.variant = "thin", this.direction = "horizontal", this.inset = "
|
|
10
|
+
super(...arguments), this.variant = "thin", this.direction = "horizontal", this.inset = "none", this.overlay = !1, this.anchor = "end";
|
|
11
11
|
}
|
|
12
12
|
render() {
|
|
13
|
-
return
|
|
14
|
-
<div class="scb-divider"
|
|
15
|
-
variant=${this.variant}
|
|
16
|
-
direction=${this.direction}
|
|
17
|
-
></div>
|
|
18
|
-
`;
|
|
13
|
+
return p``;
|
|
19
14
|
}
|
|
20
15
|
};
|
|
21
|
-
r.styles =
|
|
22
|
-
|
|
23
|
-
:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
16
|
+
r.styles = v`
|
|
17
|
+
:host {
|
|
18
|
+
--scb-divider-color: var(--md-sys-color-outline-variant);
|
|
19
|
+
--scb-divider-thickness: 1px;
|
|
20
|
+
--scb-divider-gap: var(--scb-grid-column-gap, var(--spacing-6, 24px));
|
|
21
|
+
display: block;
|
|
22
|
+
box-sizing: border-box;
|
|
23
|
+
pointer-events: none;
|
|
24
|
+
}
|
|
25
|
+
:host([variant="bold"]) {
|
|
26
|
+
--scb-divider-color: var(--md-sys-color-outline);
|
|
27
|
+
}
|
|
29
28
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
width: 2px;
|
|
39
|
-
}
|
|
29
|
+
:host(:not([direction="vertical"])) {
|
|
30
|
+
inline-size: 100%;
|
|
31
|
+
block-size: var(--scb-divider-thickness);
|
|
32
|
+
background: var(--scb-divider-color);
|
|
33
|
+
}
|
|
34
|
+
:host([inset="both"]:not([direction="vertical"])) { margin-inline: var(--spacing-8, 32px); }
|
|
35
|
+
:host([inset="start"]:not([direction="vertical"])) { margin-inline-start: var(--spacing-8, 32px); }
|
|
36
|
+
:host([inset="end"]:not([direction="vertical"])) { margin-inline-end: var(--spacing-8, 32px); }
|
|
40
37
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
38
|
+
:host([direction="vertical"]) {
|
|
39
|
+
inline-size: var(--scb-divider-thickness);
|
|
40
|
+
block-size: 100%;
|
|
41
|
+
background: var(--scb-divider-color);
|
|
42
|
+
align-self: stretch;
|
|
43
|
+
justify-self: center;
|
|
44
|
+
}
|
|
45
|
+
:host([direction="vertical"][inset="both"]:not([overlay])) { margin-block: var(--spacing-8, 32px); }
|
|
46
|
+
:host([direction="vertical"][inset="start"]:not([overlay])) { margin-block-start: var(--spacing-8, 32px); }
|
|
47
|
+
:host([direction="vertical"][inset="end"]:not([overlay])) { margin-block-end: var(--spacing-8, 32px); }
|
|
44
48
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
// // // :host([inset="both"][direction="vertical"]) {
|
|
59
|
-
// // // margin: 32px 0;
|
|
60
|
-
// // // }
|
|
61
|
-
|
|
62
|
-
// // // :host([inset="start"][direction="vertical"]) {
|
|
63
|
-
// // // margin-top: 32px;
|
|
64
|
-
// // // }
|
|
65
|
-
|
|
66
|
-
// // // :host([inset="end"][direction="vertical"]) {
|
|
67
|
-
// // // margin-bottom: 32px;
|
|
68
|
-
// // // }
|
|
69
|
-
`
|
|
70
|
-
];
|
|
71
|
-
o([
|
|
72
|
-
c({ type: String, reflect: !0 })
|
|
49
|
+
:host([overlay][direction="vertical"]) {
|
|
50
|
+
position: absolute;
|
|
51
|
+
top: 0;
|
|
52
|
+
bottom: 0;
|
|
53
|
+
inline-size: var(--scb-divider-thickness);
|
|
54
|
+
background: var(--scb-divider-color);
|
|
55
|
+
}
|
|
56
|
+
:host([overlay][direction="vertical"][anchor="end"]) { right: calc(var(--scb-divider-gap) / -2); }
|
|
57
|
+
:host([overlay][direction="vertical"][anchor="start"]){ left: calc(var(--scb-divider-gap) / -2); }
|
|
58
|
+
`;
|
|
59
|
+
e([
|
|
60
|
+
i({ type: String, reflect: !0 })
|
|
73
61
|
], r.prototype, "variant", 2);
|
|
74
|
-
|
|
75
|
-
|
|
62
|
+
e([
|
|
63
|
+
i({ type: String, reflect: !0 })
|
|
76
64
|
], r.prototype, "direction", 2);
|
|
77
|
-
|
|
78
|
-
|
|
65
|
+
e([
|
|
66
|
+
i({ type: String, reflect: !0 })
|
|
79
67
|
], r.prototype, "inset", 2);
|
|
80
|
-
|
|
81
|
-
|
|
68
|
+
e([
|
|
69
|
+
i({ type: Boolean, reflect: !0 })
|
|
70
|
+
], r.prototype, "overlay", 2);
|
|
71
|
+
e([
|
|
72
|
+
i({ type: String, reflect: !0 })
|
|
73
|
+
], r.prototype, "anchor", 2);
|
|
74
|
+
r = e([
|
|
75
|
+
b("scb-divider")
|
|
82
76
|
], r);
|
|
83
77
|
export {
|
|
84
78
|
r as ScbDivider
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
|
-
/**
|
|
3
|
-
* Enkel faktakort-komponent för SCB-designsystemet
|
|
4
|
-
*/
|
|
5
2
|
export declare class ScbFactCard extends LitElement {
|
|
6
3
|
private __onCloseClick;
|
|
7
4
|
variant: 'filled' | 'outlined';
|
|
@@ -10,12 +7,11 @@ export declare class ScbFactCard extends LitElement {
|
|
|
10
7
|
supportingText: string;
|
|
11
8
|
icon: string;
|
|
12
9
|
showCloseButton: boolean;
|
|
13
|
-
/**
|
|
14
|
-
* Gör det möjligt att öppna/stänga kortet via aria-controls eller data-fact-card-toggle
|
|
15
|
-
* (precis som scb-dialog). Hanterar även aria-expanded på triggern.
|
|
16
|
-
*/
|
|
17
10
|
open: boolean;
|
|
18
11
|
__lastTriggerEl: HTMLElement | null;
|
|
12
|
+
fullHeight: boolean;
|
|
13
|
+
fullWidth: boolean;
|
|
14
|
+
stretch: boolean;
|
|
19
15
|
private __getActionFromEvent;
|
|
20
16
|
private __onDocumentClick;
|
|
21
17
|
connectedCallback(): void;
|
|
@@ -26,3 +22,8 @@ export declare class ScbFactCard extends LitElement {
|
|
|
26
22
|
static styles: import('lit').CSSResult;
|
|
27
23
|
render(): import('lit-html').TemplateResult<1>;
|
|
28
24
|
}
|
|
25
|
+
declare global {
|
|
26
|
+
interface HTMLElementTagNameMap {
|
|
27
|
+
'scb-fact-card': ScbFactCard;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { css as
|
|
2
|
-
import { property as
|
|
1
|
+
import { css as d, LitElement as u, html as a } from "lit";
|
|
2
|
+
import { property as s, customElement as h } from "lit/decorators.js";
|
|
3
3
|
import "@material/web/icon/icon.js";
|
|
4
4
|
import "@material/web/ripple/ripple.js";
|
|
5
5
|
import "../scb-icon-button/scb-icon-button.js";
|
|
6
6
|
import "./scb-fact-card-content.js";
|
|
7
|
-
var
|
|
8
|
-
for (var
|
|
9
|
-
(
|
|
10
|
-
return
|
|
7
|
+
var f = Object.defineProperty, b = Object.getOwnPropertyDescriptor, i = (t, e, l, n) => {
|
|
8
|
+
for (var r = n > 1 ? void 0 : n ? b(e, l) : e, c = t.length - 1, p; c >= 0; c--)
|
|
9
|
+
(p = t[c]) && (r = (n ? p(e, l, r) : p(r)) || r);
|
|
10
|
+
return n && r && f(e, l, r), r;
|
|
11
11
|
};
|
|
12
12
|
let o = class extends u {
|
|
13
13
|
constructor() {
|
|
14
14
|
super(...arguments), this.__onCloseClick = (t) => {
|
|
15
15
|
t.stopPropagation(), this.__setOpen(!1);
|
|
16
|
-
}, this.variant = "filled", this.label = "", this.subLabel = "", this.supportingText = "", this.icon = "", this.showCloseButton = !1, this.open = !0, this.__lastTriggerEl = null, this.__onDocumentClick = (t) => {
|
|
16
|
+
}, this.variant = "filled", this.label = "", this.subLabel = "", this.supportingText = "", this.icon = "", this.showCloseButton = !1, this.open = !0, this.__lastTriggerEl = null, this.fullHeight = !1, this.fullWidth = !1, this.stretch = !1, this.__onDocumentClick = (t) => {
|
|
17
17
|
this.__getActionFromEvent(t) === "toggle" && (this.__setOpen(!this.open), t.stopPropagation());
|
|
18
18
|
};
|
|
19
19
|
}
|
|
@@ -47,100 +47,122 @@ let o = class extends u {
|
|
|
47
47
|
this.open = t, t && !e ? this.dispatchEvent(new CustomEvent("open", { bubbles: !0, composed: !0 })) : !t && e && this.dispatchEvent(new CustomEvent("close", { bubbles: !0, composed: !0 }));
|
|
48
48
|
}
|
|
49
49
|
render() {
|
|
50
|
-
if (!this.open) return
|
|
50
|
+
if (!this.open) return a``;
|
|
51
51
|
const t = this.variant === "outlined" ? "outlined" : "filled";
|
|
52
|
-
return
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
52
|
+
return a`
|
|
53
|
+
${this.icon ? a`<div class="icon-wrapper ${t}"><md-icon>${this.icon}</md-icon></div>` : ""}
|
|
54
|
+
<div class="scb-fact-card ${t} ${this.icon ? "no-topleft-radius" : ""} ${this.showCloseButton ? "has-close" : ""}">
|
|
55
|
+
${this.showCloseButton ? a`<scb-icon-button variant="standard" icon="close" @click=${this.__onCloseClick}></scb-icon-button>` : ""}
|
|
56
|
+
<div class="content">
|
|
57
|
+
<slot></slot>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
`;
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
|
-
o.styles =
|
|
64
|
-
:host{ --scb-fact-card-max-w: 580px; }
|
|
63
|
+
o.styles = d`
|
|
65
64
|
:host {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
65
|
+
--scb-fact-card-max-w: 580px;
|
|
66
|
+
display: block;
|
|
67
|
+
position: relative;
|
|
68
|
+
box-sizing: border-box;
|
|
69
|
+
inline-size: 100%;
|
|
70
|
+
min-inline-size: 0;
|
|
71
|
+
max-inline-size: var(--scb-fact-card-max-w);
|
|
72
|
+
height: auto;
|
|
70
73
|
}
|
|
74
|
+
|
|
75
|
+
:host([full-width]) { max-inline-size: none; }
|
|
76
|
+
|
|
77
|
+
:host([stretch]),
|
|
78
|
+
:host([full-height]) { block-size: 100%; }
|
|
79
|
+
|
|
80
|
+
:host([stretch]) .scb-fact-card,
|
|
81
|
+
:host([full-height]) .scb-fact-card { block-size: 100%; }
|
|
82
|
+
|
|
71
83
|
.scb-fact-card {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
.scb-fact-card.no-topleft-radius {
|
|
84
|
-
border-top-left-radius: 0;
|
|
85
|
-
margin-top: var(--spacing-9);
|
|
86
|
-
}
|
|
87
|
-
.scb-fact-card.outlined {
|
|
88
|
-
border: 1px solid var(--md-sys-color-outline);
|
|
89
|
-
background: var(--md-sys-color-surface);
|
|
84
|
+
color: var(--md-sys-color-on-surface);
|
|
85
|
+
position: relative;
|
|
86
|
+
border-radius: var(--md-sys-shape-corner-large);
|
|
87
|
+
background: var(--md-sys-color-surface-dim);
|
|
88
|
+
padding: var(--spacing-7);
|
|
89
|
+
box-sizing: border-box;
|
|
90
|
+
inline-size: 100%;
|
|
91
|
+
max-inline-size: 100%;
|
|
92
|
+
min-inline-size: 0;
|
|
93
|
+
overflow: hidden;
|
|
90
94
|
}
|
|
95
|
+
|
|
96
|
+
.scb-fact-card.has-close { padding-right: var(--spacing-12); }
|
|
97
|
+
.scb-fact-card.no-topleft-radius { border-top-left-radius: 0; margin-top: var(--spacing-9); }
|
|
98
|
+
.scb-fact-card.outlined { border: 1px solid var(--md-sys-color-outline); background: var(--md-sys-color-surface); }
|
|
99
|
+
|
|
91
100
|
.icon-wrapper {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
+
position: absolute;
|
|
102
|
+
z-index: 1;
|
|
103
|
+
top: -40px;
|
|
104
|
+
left: 0;
|
|
105
|
+
padding: var(--spacing-5) var(--spacing-7);
|
|
106
|
+
padding-bottom: 0;
|
|
107
|
+
width: fit-content;
|
|
108
|
+
border-radius: var(--md-sys-shape-corner-full) var(--md-sys-shape-corner-full) 0 0 /
|
|
109
|
+
var(--md-sys-shape-corner-full) var(--md-sys-shape-corner-full) 0 0;
|
|
110
|
+
background: var(--md-sys-color-surface-dim);
|
|
111
|
+
line-height: 0;
|
|
101
112
|
}
|
|
102
113
|
.icon-wrapper.outlined {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
114
|
+
border: var(--stroke-border) solid var(--md-sys-color-outline);
|
|
115
|
+
border-bottom: none;
|
|
116
|
+
background: var(--md-sys-color-surface);
|
|
106
117
|
}
|
|
118
|
+
|
|
107
119
|
scb-icon-button {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
112
|
-
.scb-fact-card.clickable {
|
|
113
|
-
cursor: pointer;
|
|
120
|
+
position: absolute;
|
|
121
|
+
right: var(--scale-01);
|
|
122
|
+
top: var(--scale-01);
|
|
114
123
|
}
|
|
124
|
+
|
|
125
|
+
.scb-fact-card.clickable { cursor: pointer; }
|
|
126
|
+
|
|
115
127
|
.content {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
128
|
+
display: flex;
|
|
129
|
+
flex-direction: column;
|
|
130
|
+
gap: var(--spacing-8);
|
|
131
|
+
inline-size: 100%;
|
|
132
|
+
min-inline-size: 0;
|
|
120
133
|
}
|
|
121
134
|
`;
|
|
122
|
-
|
|
123
|
-
|
|
135
|
+
i([
|
|
136
|
+
s({ type: String })
|
|
124
137
|
], o.prototype, "variant", 2);
|
|
125
|
-
|
|
126
|
-
|
|
138
|
+
i([
|
|
139
|
+
s({ type: String })
|
|
127
140
|
], o.prototype, "label", 2);
|
|
128
|
-
|
|
129
|
-
|
|
141
|
+
i([
|
|
142
|
+
s({ type: String, attribute: "sub-label" })
|
|
130
143
|
], o.prototype, "subLabel", 2);
|
|
131
|
-
|
|
132
|
-
|
|
144
|
+
i([
|
|
145
|
+
s({ type: String, attribute: "supporting-text" })
|
|
133
146
|
], o.prototype, "supportingText", 2);
|
|
134
|
-
|
|
135
|
-
|
|
147
|
+
i([
|
|
148
|
+
s({ type: String })
|
|
136
149
|
], o.prototype, "icon", 2);
|
|
137
|
-
|
|
138
|
-
|
|
150
|
+
i([
|
|
151
|
+
s({ type: Boolean, attribute: "show-close-button" })
|
|
139
152
|
], o.prototype, "showCloseButton", 2);
|
|
140
|
-
|
|
141
|
-
|
|
153
|
+
i([
|
|
154
|
+
s({ type: Boolean, reflect: !0 })
|
|
142
155
|
], o.prototype, "open", 2);
|
|
143
|
-
|
|
156
|
+
i([
|
|
157
|
+
s({ type: Boolean, reflect: !0, attribute: "full-height" })
|
|
158
|
+
], o.prototype, "fullHeight", 2);
|
|
159
|
+
i([
|
|
160
|
+
s({ type: Boolean, reflect: !0, attribute: "full-width" })
|
|
161
|
+
], o.prototype, "fullWidth", 2);
|
|
162
|
+
i([
|
|
163
|
+
s({ type: Boolean, reflect: !0 })
|
|
164
|
+
], o.prototype, "stretch", 2);
|
|
165
|
+
o = i([
|
|
144
166
|
h("scb-fact-card")
|
|
145
167
|
], o);
|
|
146
168
|
export {
|
|
@@ -2,9 +2,10 @@ import { LitElement } from 'lit';
|
|
|
2
2
|
/**
|
|
3
3
|
<scb-grid-item>
|
|
4
4
|
Styr enskilda celler i <scb-grid>.
|
|
5
|
-
-
|
|
5
|
+
- Kolumn-span: col-span*, reflectas som CSS-variabler
|
|
6
|
+
- Rad-span: row-span*, omvandlas till "span N" och läses av <scb-grid>
|
|
6
7
|
- Per-item justering: align/justify (align-self/justify-self)
|
|
7
|
-
- fit
|
|
8
|
+
- fit: fyll radens höjd samt låt första slottade barnet sträcka sig
|
|
8
9
|
*/
|
|
9
10
|
export declare class ScbGridItem extends LitElement {
|
|
10
11
|
#private;
|
|
@@ -12,6 +13,10 @@ export declare class ScbGridItem extends LitElement {
|
|
|
12
13
|
colSpanCompact?: number;
|
|
13
14
|
colSpanMedium?: number;
|
|
14
15
|
colSpanExpanded?: number;
|
|
16
|
+
rowSpan?: number;
|
|
17
|
+
rowSpanCompact?: number;
|
|
18
|
+
rowSpanMedium?: number;
|
|
19
|
+
rowSpanExpanded?: number;
|
|
15
20
|
align?: 'start' | 'center' | 'end' | 'stretch';
|
|
16
21
|
justify?: 'start' | 'center' | 'end' | 'stretch';
|
|
17
22
|
fit: boolean;
|