scb-wc-test 0.1.1
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/README.md +130 -0
- package/all.js +54 -0
- package/dummy.png +0 -0
- package/index.d.ts +54 -0
- package/index.js +108 -0
- package/mvc/components/all.js +53 -0
- package/mvc/components/scb-accordion/scb-accordion-item.js +194 -0
- package/mvc/components/scb-accordion/scb-accordion.js +5 -0
- package/mvc/components/scb-app-bar/scb-app-bar.js +144 -0
- package/mvc/components/scb-avatar/scb-avatar.js +99 -0
- package/mvc/components/scb-breadcrumb/scb-breadcrumb-item.js +17 -0
- package/mvc/components/scb-breadcrumb/scb-breadcrumb.js +52 -0
- package/mvc/components/scb-button/scb-button.js +121 -0
- package/mvc/components/scb-calendar-card/scb-calendar-card.js +140 -0
- package/mvc/components/scb-card/scb-card.js +256 -0
- package/mvc/components/scb-checkbox/scb-checkbox-group.js +33 -0
- package/mvc/components/scb-checkbox/scb-checkbox.js +99 -0
- package/mvc/components/scb-chips/scb-chip.js +46 -0
- package/mvc/components/scb-dialog/scb-dialog.js +158 -0
- package/mvc/components/scb-divider/scb-divider.js +53 -0
- package/mvc/components/scb-drawer/scb-drawer-item.js +114 -0
- package/mvc/components/scb-drawer/scb-drawer-section.js +19 -0
- package/mvc/components/scb-drawer/scb-drawer.js +79 -0
- package/mvc/components/scb-drawer/scb-sub-drawer.js +10 -0
- package/mvc/components/scb-fact-card/scb-fact-card-content.js +44 -0
- package/mvc/components/scb-fact-card/scb-fact-card.js +66 -0
- package/mvc/components/scb-footer/scb-footer-section.js +3 -0
- package/mvc/components/scb-footer/scb-footer.js +205 -0
- package/mvc/components/scb-grid/scb-grid-item.js +9 -0
- package/mvc/components/scb-grid/scb-grid.js +81 -0
- package/mvc/components/scb-grid/scb-stack.js +16 -0
- package/mvc/components/scb-header/scb-header-drawer-group.js +1 -0
- package/mvc/components/scb-header/scb-header-drawer-item.js +1 -0
- package/mvc/components/scb-header/scb-header-tab.js +1 -0
- package/mvc/components/scb-header/scb-header-utility.js +1 -0
- package/mvc/components/scb-header/scb-header.js +240 -0
- package/mvc/components/scb-icon-button/scb-icon-button.js +95 -0
- package/mvc/components/scb-keyfigure-card/scb-keyfigure-card.js +69 -0
- package/mvc/components/scb-link/scb-link.js +31 -0
- package/mvc/components/scb-list/scb-list-item.js +38 -0
- package/mvc/components/scb-list/scb-list.js +10 -0
- package/mvc/components/scb-menu/scb-menu-item.js +44 -0
- package/mvc/components/scb-menu/scb-menu.js +17 -0
- package/mvc/components/scb-menu/scb-sub-menu.js +29 -0
- package/mvc/components/scb-notification/scb-notification.js +120 -0
- package/mvc/components/scb-progress-indicator/scb-progress-indicator.js +84 -0
- package/mvc/components/scb-radio-button/scb-radio-button.js +95 -0
- package/mvc/components/scb-radio-button/scb-radio-group.js +28 -0
- package/mvc/components/scb-search/scb-search.js +211 -0
- package/mvc/components/scb-snackbar/scb-snackbar.js +83 -0
- package/mvc/components/scb-status-pill/scb-status-pill.js +31 -0
- package/mvc/components/scb-switch/scb-switch.js +54 -0
- package/mvc/components/scb-tabs/scb-primary-tab.js +7 -0
- package/mvc/components/scb-tabs/scb-secondary-tab.js +7 -0
- package/mvc/components/scb-tabs/scb-tabs.js +23 -0
- package/mvc/components/scb-textfield/scb-textfield.js +135 -0
- package/mvc/components/scb-toc/scb-toc-item.js +84 -0
- package/mvc/components/scb-toc/scb-toc.js +6 -0
- package/mvc/components/scb-tooltip/scb-tooltip.js +216 -0
- package/mvc/scb-logo.svg +21 -0
- package/mvc/scb-wc-test.css +1 -0
- package/mvc/scb.svg +14 -0
- package/mvc/vendor/preload-helper.js +1 -0
- package/mvc/vendor/vendor-lit.js +1 -0
- package/mvc/vendor/vendor-material.js +764 -0
- package/mvc/vendor/vendor.js +68 -0
- package/package.json +248 -0
- package/scb-accordion/scb-accordion-item.d.ts +37 -0
- package/scb-accordion/scb-accordion-item.js +343 -0
- package/scb-accordion/scb-accordion.d.ts +6 -0
- package/scb-accordion/scb-accordion.js +33 -0
- package/scb-app-bar/scb-app-bar.d.ts +10 -0
- package/scb-app-bar/scb-app-bar.js +192 -0
- package/scb-avatar/scb-avatar.d.ts +30 -0
- package/scb-avatar/scb-avatar.js +169 -0
- package/scb-breadcrumb/scb-breadcrumb-item.d.ts +9 -0
- package/scb-breadcrumb/scb-breadcrumb-item.js +54 -0
- package/scb-breadcrumb/scb-breadcrumb.d.ts +16 -0
- package/scb-breadcrumb/scb-breadcrumb.js +105 -0
- package/scb-button/scb-button.d.ts +26 -0
- package/scb-button/scb-button.js +247 -0
- package/scb-calendar-card/scb-calendar-card.d.ts +20 -0
- package/scb-calendar-card/scb-calendar-card.js +191 -0
- package/scb-card/scb-card.d.ts +24 -0
- package/scb-card/scb-card.js +345 -0
- package/scb-checkbox/scb-checkbox-group.d.ts +17 -0
- package/scb-checkbox/scb-checkbox-group.js +80 -0
- package/scb-checkbox/scb-checkbox.d.ts +20 -0
- package/scb-checkbox/scb-checkbox.js +157 -0
- package/scb-chips/scb-chip.d.ts +24 -0
- package/scb-chips/scb-chip.js +150 -0
- package/scb-dialog/scb-dialog.d.ts +58 -0
- package/scb-dialog/scb-dialog.js +390 -0
- package/scb-divider/scb-divider.d.ts +9 -0
- package/scb-divider/scb-divider.js +85 -0
- package/scb-drawer/scb-drawer-item.d.ts +61 -0
- package/scb-drawer/scb-drawer-item.js +220 -0
- package/scb-drawer/scb-drawer-section.d.ts +7 -0
- package/scb-drawer/scb-drawer-section.js +44 -0
- package/scb-drawer/scb-drawer.d.ts +97 -0
- package/scb-drawer/scb-drawer.js +258 -0
- package/scb-drawer/scb-sub-drawer.d.ts +10 -0
- package/scb-drawer/scb-sub-drawer.js +43 -0
- package/scb-fact-card/scb-fact-card-content.d.ts +10 -0
- package/scb-fact-card/scb-fact-card-content.js +83 -0
- package/scb-fact-card/scb-fact-card.d.ts +15 -0
- package/scb-fact-card/scb-fact-card.js +110 -0
- package/scb-footer/scb-footer-section.d.ts +21 -0
- package/scb-footer/scb-footer-section.js +28 -0
- package/scb-footer/scb-footer.d.ts +27 -0
- package/scb-footer/scb-footer.js +326 -0
- package/scb-grid/scb-grid-item.d.ts +28 -0
- package/scb-grid/scb-grid-item.js +66 -0
- package/scb-grid/scb-grid.d.ts +33 -0
- package/scb-grid/scb-grid.js +152 -0
- package/scb-grid/scb-stack.d.ts +29 -0
- package/scb-grid/scb-stack.js +82 -0
- package/scb-header/scb-header-drawer-group.d.ts +13 -0
- package/scb-header/scb-header-drawer-group.js +28 -0
- package/scb-header/scb-header-drawer-item.d.ts +14 -0
- package/scb-header/scb-header-drawer-item.js +31 -0
- package/scb-header/scb-header-tab.d.ts +13 -0
- package/scb-header/scb-header-tab.js +28 -0
- package/scb-header/scb-header-utility.d.ts +14 -0
- package/scb-header/scb-header-utility.js +31 -0
- package/scb-header/scb-header.d.ts +105 -0
- package/scb-header/scb-header.js +618 -0
- package/scb-icon-button/scb-icon-button.d.ts +31 -0
- package/scb-icon-button/scb-icon-button.js +208 -0
- package/scb-keyfigure-card/scb-keyfigure-card.d.ts +13 -0
- package/scb-keyfigure-card/scb-keyfigure-card.js +119 -0
- package/scb-link/scb-link.d.ts +17 -0
- package/scb-link/scb-link.js +74 -0
- package/scb-list/scb-list-item.d.ts +32 -0
- package/scb-list/scb-list-item.js +144 -0
- package/scb-list/scb-list.d.ts +8 -0
- package/scb-list/scb-list.js +39 -0
- package/scb-logo.svg +21 -0
- package/scb-menu/scb-menu-item.d.ts +22 -0
- package/scb-menu/scb-menu-item.js +107 -0
- package/scb-menu/scb-menu.d.ts +21 -0
- package/scb-menu/scb-menu.js +98 -0
- package/scb-menu/scb-sub-menu.d.ts +12 -0
- package/scb-menu/scb-sub-menu.js +69 -0
- package/scb-notification/scb-notification.d.ts +16 -0
- package/scb-notification/scb-notification.js +187 -0
- package/scb-progress-indicator/scb-progress-indicator.d.ts +11 -0
- package/scb-progress-indicator/scb-progress-indicator.js +122 -0
- package/scb-radio-button/scb-radio-button.d.ts +19 -0
- package/scb-radio-button/scb-radio-button.js +176 -0
- package/scb-radio-button/scb-radio-group.d.ts +20 -0
- package/scb-radio-button/scb-radio-group.js +81 -0
- package/scb-search/scb-search.d.ts +45 -0
- package/scb-search/scb-search.js +410 -0
- package/scb-snackbar/scb-snackbar.d.ts +17 -0
- package/scb-snackbar/scb-snackbar.js +140 -0
- package/scb-status-pill/scb-status-pill.d.ts +9 -0
- package/scb-status-pill/scb-status-pill.js +62 -0
- package/scb-switch/scb-switch.d.ts +21 -0
- package/scb-switch/scb-switch.js +111 -0
- package/scb-tabs/scb-primary-tab.d.ts +17 -0
- package/scb-tabs/scb-primary-tab.js +93 -0
- package/scb-tabs/scb-secondary-tab.d.ts +17 -0
- package/scb-tabs/scb-secondary-tab.js +97 -0
- package/scb-tabs/scb-tabs.d.ts +10 -0
- package/scb-tabs/scb-tabs.js +66 -0
- package/scb-textfield/scb-textfield.d.ts +41 -0
- package/scb-textfield/scb-textfield.js +258 -0
- package/scb-toc/scb-toc-item.d.ts +21 -0
- package/scb-toc/scb-toc-item.js +196 -0
- package/scb-toc/scb-toc.d.ts +6 -0
- package/scb-toc/scb-toc.js +27 -0
- package/scb-tooltip/scb-tooltip.d.ts +32 -0
- package/scb-tooltip/scb-tooltip.js +329 -0
- package/scb-wc-test.bundle.js +5429 -0
- package/scb-wc-test.css +1 -0
- package/scb-wc-test.d.ts +106 -0
- package/scb.svg +14 -0
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { css as d, LitElement as h, html as p } from "lit";
|
|
2
|
+
import { property as a, customElement as b } from "lit/decorators.js";
|
|
3
|
+
import "@material/web/checkbox/checkbox.js";
|
|
4
|
+
var u = Object.defineProperty, g = Object.getOwnPropertyDescriptor, i = (e, r, s, c) => {
|
|
5
|
+
for (var o = c > 1 ? void 0 : c ? g(r, s) : r, l = e.length - 1, n; l >= 0; l--)
|
|
6
|
+
(n = e[l]) && (o = (c ? n(r, s, o) : n(o)) || o);
|
|
7
|
+
return c && o && u(r, s, o), o;
|
|
8
|
+
};
|
|
9
|
+
let t = class extends h {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments), this.disabled = !1, this.indeterminate = !1, this.checked = !1, this.label = "", this.supportingText = "", this._checkboxId = "";
|
|
12
|
+
}
|
|
13
|
+
connectedCallback() {
|
|
14
|
+
super.connectedCallback(), this._checkboxId = this.id || `scb-checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
15
|
+
}
|
|
16
|
+
firstUpdated() {
|
|
17
|
+
var r;
|
|
18
|
+
const e = (r = this.shadowRoot) == null ? void 0 : r.querySelector("md-checkbox");
|
|
19
|
+
e && e.addEventListener("change", () => {
|
|
20
|
+
const s = e.checked;
|
|
21
|
+
this.checked = s, this.dispatchEvent(
|
|
22
|
+
new CustomEvent("change", {
|
|
23
|
+
detail: { checked: s },
|
|
24
|
+
bubbles: !0,
|
|
25
|
+
composed: !0
|
|
26
|
+
})
|
|
27
|
+
);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
updated(e) {
|
|
31
|
+
super.updated(e), e.has("disabled") && this.toggleAttribute("aria-disabled", this.disabled);
|
|
32
|
+
}
|
|
33
|
+
render() {
|
|
34
|
+
const e = this.supportingText ? `${this._checkboxId}-supporting-text` : void 0;
|
|
35
|
+
return p`
|
|
36
|
+
<label class="wrap">
|
|
37
|
+
<div class="box-wrap">
|
|
38
|
+
<md-checkbox
|
|
39
|
+
id="${this._checkboxId}"
|
|
40
|
+
touch-target="wrapper"
|
|
41
|
+
?disabled=${this.disabled}
|
|
42
|
+
?indeterminate=${this.indeterminate}
|
|
43
|
+
?checked=${this.checked}
|
|
44
|
+
aria-describedby=${e}
|
|
45
|
+
></md-checkbox>
|
|
46
|
+
</div>
|
|
47
|
+
${this.label ? p`<span class="lbl">${this.label}</span>` : ""}
|
|
48
|
+
</label>
|
|
49
|
+
|
|
50
|
+
${this.supportingText ? p`<div id="${this._checkboxId}-supporting-text" class="supporting-text">
|
|
51
|
+
${this.supportingText}
|
|
52
|
+
</div>` : ""}
|
|
53
|
+
|
|
54
|
+
<slot></slot>
|
|
55
|
+
`;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
t.styles = d`
|
|
59
|
+
/* Grundläggande layout med inline-grid */
|
|
60
|
+
:host {
|
|
61
|
+
display: inline-grid;
|
|
62
|
+
grid-template-columns: auto;
|
|
63
|
+
grid-template-rows: auto auto;
|
|
64
|
+
row-gap: 4px;
|
|
65
|
+
font-family: var(--brand-font, 'Inter', sans-serif);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* Mer luft till höger i horisontella layouter (sätts av checkbox-gruppen) */
|
|
69
|
+
:host([orientation="horizontal"]) {
|
|
70
|
+
margin-inline-end: var(--scb-checkbox-gap, 24px);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* Wrapper för md-checkbox + label
|
|
74
|
+
48px kontrollblock + 12px textgap (matchar radio) */
|
|
75
|
+
.wrap {
|
|
76
|
+
display: inline-flex;
|
|
77
|
+
align-items: center;
|
|
78
|
+
gap: 12px;
|
|
79
|
+
cursor: pointer;
|
|
80
|
+
overflow: visible; /* låt ripple synas */
|
|
81
|
+
}
|
|
82
|
+
:host([disabled]) .wrap {
|
|
83
|
+
cursor: default;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/* Hit-target runt själva md-checkboxen (48px) */
|
|
87
|
+
.box-wrap {
|
|
88
|
+
height: var(--scb-checkbox-target, 48px);
|
|
89
|
+
width: var(--scb-checkbox-target, 48px);
|
|
90
|
+
display: flex;
|
|
91
|
+
align-items: center;
|
|
92
|
+
justify-content: center;
|
|
93
|
+
overflow: visible;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/* Nollställ md-checkbox marginal */
|
|
97
|
+
md-checkbox {
|
|
98
|
+
margin: 0;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/* Visa focusring ENDAST vid tangentbordsfokus.
|
|
102
|
+
Vid musklick (focus men inte focus-visible) görs den transparent. */
|
|
103
|
+
md-checkbox:focus:not(:focus-visible) {
|
|
104
|
+
--md-focus-ring-color: transparent;
|
|
105
|
+
--md-focus-ring-width: 0;
|
|
106
|
+
outline: none;
|
|
107
|
+
box-shadow: none;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/* Label-styling */
|
|
111
|
+
.lbl {
|
|
112
|
+
color: var(--md-sys-color-on-surface);
|
|
113
|
+
line-height: 1.2;
|
|
114
|
+
margin-top: 2px;
|
|
115
|
+
}
|
|
116
|
+
:host([disabled]) .lbl {
|
|
117
|
+
color: var(--n-60);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/* Supporting text styling */
|
|
121
|
+
.supporting-text {
|
|
122
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
123
|
+
line-height: 1.2;
|
|
124
|
+
/* 12px (gap) + 48px (box-wrap) -> linjerar med label */
|
|
125
|
+
margin-left: calc(12px + var(--scb-checkbox-target, 48px));
|
|
126
|
+
}
|
|
127
|
+
:host([disabled]) .supporting-text {
|
|
128
|
+
color: var(--n-60);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/* Anpassning för mörkt läge */
|
|
132
|
+
@media (prefers-color-scheme: dark) {
|
|
133
|
+
.lbl { color: var(--md-sys-color-on-surface); }
|
|
134
|
+
.supporting-text { color: var(--md-sys-color-on-surface-variant); }
|
|
135
|
+
}
|
|
136
|
+
`;
|
|
137
|
+
i([
|
|
138
|
+
a({ type: Boolean, reflect: !0 })
|
|
139
|
+
], t.prototype, "disabled", 2);
|
|
140
|
+
i([
|
|
141
|
+
a({ type: Boolean, reflect: !0 })
|
|
142
|
+
], t.prototype, "indeterminate", 2);
|
|
143
|
+
i([
|
|
144
|
+
a({ type: Boolean, reflect: !0 })
|
|
145
|
+
], t.prototype, "checked", 2);
|
|
146
|
+
i([
|
|
147
|
+
a({ type: String })
|
|
148
|
+
], t.prototype, "label", 2);
|
|
149
|
+
i([
|
|
150
|
+
a({ type: String, attribute: "supporting-text" })
|
|
151
|
+
], t.prototype, "supportingText", 2);
|
|
152
|
+
t = i([
|
|
153
|
+
b("scb-checkbox")
|
|
154
|
+
], t);
|
|
155
|
+
export {
|
|
156
|
+
t as ScbCheckbox
|
|
157
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { LitElement, TemplateResult, PropertyValues } from 'lit';
|
|
2
|
+
|
|
3
|
+
export declare class ScbChip extends LitElement {
|
|
4
|
+
variant: 'assist' | 'filter';
|
|
5
|
+
label: string;
|
|
6
|
+
icon: string;
|
|
7
|
+
disabled: boolean;
|
|
8
|
+
elevated: boolean;
|
|
9
|
+
removable: boolean;
|
|
10
|
+
selected: boolean;
|
|
11
|
+
private __loadedVariants;
|
|
12
|
+
private __chipSetLoaded;
|
|
13
|
+
private __iconLoaded;
|
|
14
|
+
protected updated(changed: PropertyValues): void;
|
|
15
|
+
protected firstUpdated(): void;
|
|
16
|
+
private __ensureDepsLoaded;
|
|
17
|
+
static styles: import('lit').CSSResult;
|
|
18
|
+
private get _insideChipSet();
|
|
19
|
+
render(): TemplateResult;
|
|
20
|
+
private _renderChip;
|
|
21
|
+
private _toggleSelected;
|
|
22
|
+
private _onRemove;
|
|
23
|
+
private _forward;
|
|
24
|
+
}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { css as n, LitElement as p, html as r } from "lit";
|
|
2
|
+
import { property as a, customElement as m } from "lit/decorators.js";
|
|
3
|
+
var u = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, s = (e, o, d, l) => {
|
|
4
|
+
for (var i = l > 1 ? void 0 : l ? _(o, d) : o, c = e.length - 1, h; c >= 0; c--)
|
|
5
|
+
(h = e[c]) && (i = (l ? h(o, d, i) : h(i)) || i);
|
|
6
|
+
return l && i && u(o, d, i), i;
|
|
7
|
+
};
|
|
8
|
+
let t = class extends p {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments), this.variant = "assist", this.label = "", this.icon = "", this.disabled = !1, this.elevated = !1, this.removable = !1, this.selected = !1, this.__loadedVariants = /* @__PURE__ */ new Set(), this.__chipSetLoaded = !1, this.__iconLoaded = !1;
|
|
11
|
+
}
|
|
12
|
+
// aria-disabled på host
|
|
13
|
+
updated(e) {
|
|
14
|
+
super.updated(e), e.has("disabled") && this.toggleAttribute("aria-disabled", this.disabled), (e.has("variant") || e.has("icon")) && this.__ensureDepsLoaded();
|
|
15
|
+
}
|
|
16
|
+
// Kör dynamisk import första gången komponenten finns i DOM
|
|
17
|
+
firstUpdated() {
|
|
18
|
+
this.__ensureDepsLoaded();
|
|
19
|
+
}
|
|
20
|
+
/* Ladda in nödvändiga Material-web-komponenter vid behov (variant + ev. chip-set + ev. ikon) */
|
|
21
|
+
async __ensureDepsLoaded() {
|
|
22
|
+
if (!this.__loadedVariants.has(this.variant)) {
|
|
23
|
+
switch (this.variant) {
|
|
24
|
+
case "assist":
|
|
25
|
+
await import("@material/web/chips/assist-chip.js");
|
|
26
|
+
break;
|
|
27
|
+
case "filter":
|
|
28
|
+
await import("@material/web/chips/filter-chip.js");
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
this.__loadedVariants.add(this.variant);
|
|
32
|
+
}
|
|
33
|
+
!this._insideChipSet && !this.__chipSetLoaded && (await import("@material/web/chips/chip-set.js"), this.__chipSetLoaded = !0), this.icon && !this.__iconLoaded && (await import("@material/web/icon/icon.js"), this.__iconLoaded = !0);
|
|
34
|
+
}
|
|
35
|
+
get _insideChipSet() {
|
|
36
|
+
return !!this.closest("md-chip-set");
|
|
37
|
+
}
|
|
38
|
+
render() {
|
|
39
|
+
const e = this._renderChip();
|
|
40
|
+
return this._insideChipSet ? e : r`<md-chip-set>${e}</md-chip-set>`;
|
|
41
|
+
}
|
|
42
|
+
_renderChip() {
|
|
43
|
+
const e = this.icon ? r`<md-icon slot="icon">${this.icon}</md-icon>` : null;
|
|
44
|
+
switch (this.variant) {
|
|
45
|
+
case "assist":
|
|
46
|
+
return r`
|
|
47
|
+
<md-assist-chip
|
|
48
|
+
label=${this.label}
|
|
49
|
+
?disabled=${this.disabled}
|
|
50
|
+
?elevated=${this.elevated}
|
|
51
|
+
@update-focus=${this._forward}
|
|
52
|
+
>
|
|
53
|
+
${e}
|
|
54
|
+
</md-assist-chip>
|
|
55
|
+
`;
|
|
56
|
+
case "filter":
|
|
57
|
+
return r`
|
|
58
|
+
<md-filter-chip
|
|
59
|
+
label=${this.label}
|
|
60
|
+
?disabled=${this.disabled}
|
|
61
|
+
?removable=${this.removable}
|
|
62
|
+
?selected=${this.selected}
|
|
63
|
+
aria-pressed="${this.selected}"
|
|
64
|
+
@remove=${this._onRemove}
|
|
65
|
+
@update-focus=${this._forward}
|
|
66
|
+
@click=${() => this._toggleSelected()}
|
|
67
|
+
>
|
|
68
|
+
${e}
|
|
69
|
+
</md-filter-chip>
|
|
70
|
+
`;
|
|
71
|
+
default:
|
|
72
|
+
return r``;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
_toggleSelected() {
|
|
76
|
+
this.selected = !this.selected, this.dispatchEvent(new CustomEvent("selected-changed", {
|
|
77
|
+
detail: { selected: this.selected },
|
|
78
|
+
bubbles: !0,
|
|
79
|
+
composed: !0
|
|
80
|
+
}));
|
|
81
|
+
}
|
|
82
|
+
_onRemove(e) {
|
|
83
|
+
e.stopPropagation(), this.dispatchEvent(
|
|
84
|
+
new CustomEvent("remove", {
|
|
85
|
+
detail: { label: this.label },
|
|
86
|
+
bubbles: !0,
|
|
87
|
+
composed: !0
|
|
88
|
+
})
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
_forward(e) {
|
|
92
|
+
this.dispatchEvent(
|
|
93
|
+
new CustomEvent(e.type, {
|
|
94
|
+
detail: e.detail,
|
|
95
|
+
bubbles: !0,
|
|
96
|
+
composed: !0
|
|
97
|
+
})
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
t.styles = n`
|
|
102
|
+
:host {
|
|
103
|
+
display: inline-block;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/* Sätt samma färg på label för assist som är på filter */
|
|
107
|
+
:host md-assist-chip {
|
|
108
|
+
--_label-text-color: var(--md-sys-color-on-surface-variant);
|
|
109
|
+
--_hover-label-text-color: var(--md-sys-color-on-surface-variant);
|
|
110
|
+
--_focus-label-text-color: var(--md-sys-color-on-surface-variant);
|
|
111
|
+
--_pressed-label-text-color: var(--md-sys-color-on-surface-variant);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
md-icon {
|
|
115
|
+
color: var(--p-20);
|
|
116
|
+
font-size: var(--scb-icon-size-large);
|
|
117
|
+
}
|
|
118
|
+
@media (prefers-color-scheme: dark) {
|
|
119
|
+
md-icon {
|
|
120
|
+
color: var(--md-sys-color-on-surface);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
`;
|
|
124
|
+
s([
|
|
125
|
+
a({ type: String, reflect: !0 })
|
|
126
|
+
], t.prototype, "variant", 2);
|
|
127
|
+
s([
|
|
128
|
+
a({ type: String })
|
|
129
|
+
], t.prototype, "label", 2);
|
|
130
|
+
s([
|
|
131
|
+
a({ type: String })
|
|
132
|
+
], t.prototype, "icon", 2);
|
|
133
|
+
s([
|
|
134
|
+
a({ type: Boolean, reflect: !0 })
|
|
135
|
+
], t.prototype, "disabled", 2);
|
|
136
|
+
s([
|
|
137
|
+
a({ type: Boolean, reflect: !0 })
|
|
138
|
+
], t.prototype, "elevated", 2);
|
|
139
|
+
s([
|
|
140
|
+
a({ type: Boolean, reflect: !0 })
|
|
141
|
+
], t.prototype, "removable", 2);
|
|
142
|
+
s([
|
|
143
|
+
a({ type: Boolean, reflect: !0 })
|
|
144
|
+
], t.prototype, "selected", 2);
|
|
145
|
+
t = s([
|
|
146
|
+
m("scb-chip")
|
|
147
|
+
], t);
|
|
148
|
+
export {
|
|
149
|
+
t as ScbChip
|
|
150
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
|
|
3
|
+
type Variant = 'basic' | 'alert' | 'confirm' | 'choose' | 'form' | 'floating';
|
|
4
|
+
type FormMethod = '' | 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
5
|
+
export declare class ScbDialog extends LitElement {
|
|
6
|
+
open: boolean;
|
|
7
|
+
inSb: boolean;
|
|
8
|
+
scrimClose: boolean;
|
|
9
|
+
variant: Variant;
|
|
10
|
+
label: string;
|
|
11
|
+
icon: string;
|
|
12
|
+
supportingText: string;
|
|
13
|
+
okButton: string;
|
|
14
|
+
cancelButton: string;
|
|
15
|
+
deleteButton: string;
|
|
16
|
+
confirmButton: string;
|
|
17
|
+
denyButton: string;
|
|
18
|
+
resetButton: string;
|
|
19
|
+
submitButton: string;
|
|
20
|
+
formId: string;
|
|
21
|
+
formAction: string;
|
|
22
|
+
formMethod: FormMethod;
|
|
23
|
+
private __lastTriggerEl;
|
|
24
|
+
private __slotDeps;
|
|
25
|
+
static styles: import('lit').CSSResult;
|
|
26
|
+
protected firstUpdated(): Promise<void>;
|
|
27
|
+
private __ensureSlottedDeps;
|
|
28
|
+
private __getActionFromEvent;
|
|
29
|
+
private __onDocumentClick;
|
|
30
|
+
private __onDocumentKeydown;
|
|
31
|
+
connectedCallback(): void;
|
|
32
|
+
disconnectedCallback(): void;
|
|
33
|
+
protected updated(ch: Map<string, unknown>): void;
|
|
34
|
+
private __updateTriggersExpanded;
|
|
35
|
+
private __toggleScrollLock;
|
|
36
|
+
private __setOpen;
|
|
37
|
+
private __fire;
|
|
38
|
+
private __onScrimClick;
|
|
39
|
+
private __onOk;
|
|
40
|
+
private __onCancel;
|
|
41
|
+
private __onConfirm;
|
|
42
|
+
private __onDeny;
|
|
43
|
+
private __onReset;
|
|
44
|
+
private __onSubmit;
|
|
45
|
+
private __onKeydownTrap;
|
|
46
|
+
private __slotIsEmpty;
|
|
47
|
+
private renderHeader;
|
|
48
|
+
private renderContentDefault;
|
|
49
|
+
private renderActions;
|
|
50
|
+
private renderBody;
|
|
51
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
52
|
+
}
|
|
53
|
+
declare global {
|
|
54
|
+
interface HTMLElementTagNameMap {
|
|
55
|
+
'scb-dialog': ScbDialog;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
export {};
|