scb-wc-test 0.1.85 → 0.1.87
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-breadcrumb/scb-breadcrumb-item.js +3 -2
- package/mvc/components/scb-button/scb-button.js +1 -1
- package/mvc/components/scb-calendar-card/scb-calendar-card.js +29 -19
- package/mvc/components/scb-card/scb-card.js +115 -53
- package/mvc/components/scb-fact-card/scb-fact-card-content.js +46 -44
- package/mvc/components/scb-icon-button/scb-icon-button.js +1 -1
- package/mvc/components/scb-keyfigure-card/scb-keyfigure-card.js +21 -8
- package/mvc/components/scb-notification-card/scb-notification-card.js +291 -170
- package/mvc/components/scb-viz/scb-viz.js +106 -107
- package/mvc/vendor/vendor-material.js +102 -102
- package/mvc/vendor/vendor.js +1 -1
- package/package.json +2 -2
- package/scb-badge/scb-badge.d.ts +1 -1
- package/scb-breadcrumb/scb-breadcrumb-item.js +3 -2
- package/scb-calendar-card/scb-calendar-card.js +71 -61
- package/scb-card/scb-card.d.ts +1 -1
- package/scb-card/scb-card.js +116 -54
- package/scb-fact-card/scb-fact-card-content.d.ts +5 -1
- package/scb-fact-card/scb-fact-card-content.js +67 -74
- package/scb-keyfigure-card/scb-keyfigure-card.d.ts +3 -1
- package/scb-keyfigure-card/scb-keyfigure-card.js +23 -11
- package/scb-notification-card/scb-notification-card.d.ts +19 -5
- package/scb-notification-card/scb-notification-card.js +336 -196
- package/scb-viz/scb-viz.d.ts +2 -2
- package/scb-viz/scb-viz.js +163 -162
- package/scb-wc-test.bundle.js +842 -635
package/scb-card/scb-card.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { css as m, LitElement as
|
|
2
|
-
import { property as s, customElement as
|
|
1
|
+
import { css as m, LitElement as u, html as i } from "lit";
|
|
2
|
+
import { property as s, customElement as b } from "lit/decorators.js";
|
|
3
3
|
import "@material/web/focus/md-focus-ring.js";
|
|
4
4
|
import "../scb-list/scb-list.js";
|
|
5
5
|
import "../scb-button/scb-button.js";
|
|
6
6
|
import "../scb-link/scb-link.js";
|
|
7
7
|
import "../scb-avatar/scb-avatar.js";
|
|
8
|
-
var
|
|
8
|
+
var v = Object.defineProperty, g = Object.getOwnPropertyDescriptor, e = (o, r, n, a) => {
|
|
9
9
|
for (var l = a > 1 ? void 0 : a ? g(r, n) : r, d = o.length - 1, c; d >= 0; d--)
|
|
10
10
|
(c = o[d]) && (l = (a ? c(r, n, l) : c(l)) || l);
|
|
11
|
-
return a && l &&
|
|
11
|
+
return a && l && v(r, n, l), l;
|
|
12
12
|
};
|
|
13
|
-
let t = class extends
|
|
13
|
+
let t = class extends u {
|
|
14
14
|
constructor() {
|
|
15
15
|
super(...arguments), this.type = "", this.variant = "", this.direction = "", this.mediaType = "", this.mediaHref = "", this.mediaAlt = "", this.mediaSrcset = "", this.mediaSizes = "", this.mediaLoading = "auto", this.mediaDecoding = "async", this.mediaFetchPriority = "auto", this.mediaFit = "cover", this.mediaPosition = "center", this.mediaWidth = "", this.mediaHeight = "", this.mediaAspect = "", this.mediaPlaceholder = !1, this.cardHref = "", this.title = "", this.subtitle = "", this.supportingText = "", this.commentsText = "", this.comments = 0, this.likesText = "", this.likes = 0, this.sizing = "stretch", this.width = "", this.maxWidth = "", this.height = "", this.maxHeight = "", this.__onImgLoad = (o) => {
|
|
16
16
|
const r = o.currentTarget.closest(".media");
|
|
@@ -52,7 +52,6 @@ let t = class extends v {
|
|
|
52
52
|
const l = `aspect-ratio:${a || `${r}/${n}`};`, d = this.mediaPlaceholder ? "has-ph" : "", c = this.mediaFit || "cover", p = this.mediaPosition || "center";
|
|
53
53
|
return i`
|
|
54
54
|
<div class="media ${d}" style="${l}">
|
|
55
|
-
<!-- Tillåt egna <source>-element via slot om man vill använda <picture> -->
|
|
56
55
|
<slot name="media-sources"></slot>
|
|
57
56
|
<img
|
|
58
57
|
src="${this.mediaHref || ""}"
|
|
@@ -73,7 +72,9 @@ let t = class extends v {
|
|
|
73
72
|
return null;
|
|
74
73
|
}
|
|
75
74
|
render() {
|
|
76
|
-
const o = this.variant ? `${this.variant.toLowerCase()}` : "", r = this.type === "list" ? "vertical" : this.direction ? this.direction.toLowerCase() : "", n = this.cardHref ? "clickable" : "", a = this.date instanceof Date ? this.date.toISOString().slice(0, 10) : this.date || "", l = (p = !1) => p ? i`<a class="title" href="${this.cardHref}" tabindex="0"
|
|
75
|
+
const o = this.variant ? `${this.variant.toLowerCase()}` : "", r = this.type === "list" ? "vertical" : this.direction ? this.direction.toLowerCase() : "", n = this.cardHref ? "clickable" : "", a = this.date instanceof Date ? this.date.toISOString().slice(0, 10) : this.date || "", l = (p = !1) => p ? i`<a class="title" href="${this.cardHref}" tabindex="0"
|
|
76
|
+
>${this.title}</a
|
|
77
|
+
><md-icon>arrow_forward</md-icon>` : i`<span class="title">${this.title}</span>`, d = () => this.__mediaTemplate(), c = (p) => i`
|
|
77
78
|
<div
|
|
78
79
|
class="scb-card ${o} ${r} ${n}"
|
|
79
80
|
@click=${this.cardHref ? this.__handleHrefNavigation : null}
|
|
@@ -126,8 +127,14 @@ let t = class extends v {
|
|
|
126
127
|
</div>
|
|
127
128
|
<div class="content">
|
|
128
129
|
<div class="social-metrics">
|
|
129
|
-
<span class="comments"
|
|
130
|
-
|
|
130
|
+
<span class="comments"
|
|
131
|
+
><md-icon>mode_comment</md-icon>
|
|
132
|
+
<span>${this.commentsText}: ${this.comments}</span></span
|
|
133
|
+
>
|
|
134
|
+
<span class="likes"
|
|
135
|
+
><md-icon>thumb_up</md-icon>
|
|
136
|
+
<span>${this.likesText}: ${this.likes}</span></span
|
|
137
|
+
>
|
|
131
138
|
</div>
|
|
132
139
|
</div>
|
|
133
140
|
</div>
|
|
@@ -176,7 +183,7 @@ let t = class extends v {
|
|
|
176
183
|
updated(o) {
|
|
177
184
|
super.updated(o), o.has("width") && (this.width ? this.style.inlineSize = this.width : this.style.removeProperty("inline-size")), o.has("maxWidth") && (this.maxWidth ? this.style.maxInlineSize = this.maxWidth : this.style.removeProperty("max-inline-size")), o.has("height") && (this.height ? this.style.blockSize = this.height : this.style.removeProperty("block-size")), o.has("maxHeight") && (this.maxHeight ? this.style.maxBlockSize = this.maxHeight : this.style.removeProperty("max-block-size")), o.has("type") && (this.type === "list" ? this.setAttribute("data-density", "-2") : this.removeAttribute("data-density")), this.style.setProperty("--scb-card-media-fit", this.mediaFit || "cover"), this.style.setProperty("--scb-card-media-position", this.mediaPosition || "center");
|
|
178
185
|
}
|
|
179
|
-
async firstUpdated() {
|
|
186
|
+
async firstUpdated(o) {
|
|
180
187
|
t.__iconLoaded || (await import("@material/web/icon/icon.js"), t.__iconLoaded = !0), t.__rippleLoaded || (await import("@material/web/ripple/ripple.js"), t.__rippleLoaded = !0);
|
|
181
188
|
}
|
|
182
189
|
};
|
|
@@ -196,34 +203,44 @@ t.styles = m`
|
|
|
196
203
|
--scb-card-horizontal-media-min: 96px;
|
|
197
204
|
--scb-card-horizontal-media-aspect: 16 / 9;
|
|
198
205
|
}
|
|
199
|
-
:host([type=
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
:host([type=
|
|
203
|
-
|
|
206
|
+
:host([type='standard']) {
|
|
207
|
+
--scb-card-max-w: var(--scb-card-standard-max-w);
|
|
208
|
+
}
|
|
209
|
+
:host([type='list']) {
|
|
210
|
+
--scb-card-max-w: var(--scb-card-list-max-w);
|
|
211
|
+
}
|
|
212
|
+
:host([type='social']) {
|
|
213
|
+
--scb-card-max-w: var(--scb-card-social-max-w);
|
|
214
|
+
}
|
|
215
|
+
:host([type='link']) {
|
|
216
|
+
--scb-card-max-w: var(--scb-card-link-max-w);
|
|
217
|
+
}
|
|
218
|
+
:host([type='action']) {
|
|
219
|
+
--scb-card-max-w: var(--scb-card-action-max-w);
|
|
220
|
+
}
|
|
204
221
|
|
|
205
222
|
:host([height]) .scb-card,
|
|
206
223
|
:host([max-height]) .scb-card,
|
|
207
|
-
:host([sizing=
|
|
224
|
+
:host([sizing='stretch']) .scb-card {
|
|
208
225
|
block-size: 100%;
|
|
209
226
|
}
|
|
210
227
|
|
|
211
|
-
:host([sizing=
|
|
228
|
+
:host([sizing='stretch']) {
|
|
212
229
|
inline-size: 100%;
|
|
213
230
|
block-size: 100%;
|
|
214
231
|
max-inline-size: none;
|
|
215
232
|
}
|
|
216
233
|
|
|
217
|
-
:host([sizing=
|
|
234
|
+
:host([sizing='content-width']) {
|
|
218
235
|
display: inline-block;
|
|
219
236
|
inline-size: auto;
|
|
220
237
|
block-size: auto;
|
|
221
238
|
}
|
|
222
|
-
:host([sizing=
|
|
239
|
+
:host([sizing='content-width']) .scb-card {
|
|
223
240
|
inline-size: max-content;
|
|
224
241
|
}
|
|
225
242
|
|
|
226
|
-
:host([sizing=
|
|
243
|
+
:host([sizing='content-height']) {
|
|
227
244
|
inline-size: 100%;
|
|
228
245
|
block-size: auto;
|
|
229
246
|
max-inline-size: none;
|
|
@@ -236,7 +253,9 @@ t.styles = m`
|
|
|
236
253
|
display: none;
|
|
237
254
|
border-radius: var(--scb-card-focus-ring-radius, var(--md-sys-shape-corner-large));
|
|
238
255
|
}
|
|
239
|
-
:host(:focus-within) md-focus-ring {
|
|
256
|
+
:host(:focus-within) md-focus-ring {
|
|
257
|
+
display: block;
|
|
258
|
+
}
|
|
240
259
|
|
|
241
260
|
.scb-card {
|
|
242
261
|
color: var(--md-sys-color-on-surface);
|
|
@@ -253,14 +272,26 @@ t.styles = m`
|
|
|
253
272
|
}
|
|
254
273
|
|
|
255
274
|
.scb-card:focus,
|
|
256
|
-
.scb-card:focus-visible {
|
|
275
|
+
.scb-card:focus-visible {
|
|
276
|
+
outline: none;
|
|
277
|
+
}
|
|
257
278
|
.scb-card a:focus,
|
|
258
|
-
.scb-card a:focus-visible {
|
|
279
|
+
.scb-card a:focus-visible {
|
|
280
|
+
outline: none;
|
|
281
|
+
}
|
|
259
282
|
|
|
260
|
-
.scb-card.outlined {
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
.scb-card.
|
|
283
|
+
.scb-card.outlined {
|
|
284
|
+
border: 1px solid var(--md-sys-color-outline-variant);
|
|
285
|
+
}
|
|
286
|
+
.scb-card.filled {
|
|
287
|
+
background: var(--md-sys-color-surface-dim);
|
|
288
|
+
}
|
|
289
|
+
.scb-card.vertical {
|
|
290
|
+
flex-direction: column;
|
|
291
|
+
}
|
|
292
|
+
.scb-card.clickable {
|
|
293
|
+
cursor: pointer;
|
|
294
|
+
}
|
|
264
295
|
|
|
265
296
|
md-ripple {
|
|
266
297
|
position: absolute;
|
|
@@ -291,16 +322,29 @@ t.styles = m`
|
|
|
291
322
|
position: absolute;
|
|
292
323
|
inset: 0;
|
|
293
324
|
background:
|
|
294
|
-
linear-gradient(
|
|
295
|
-
|
|
296
|
-
rgba(0,0,0
|
|
297
|
-
rgba(0,0,0
|
|
325
|
+
linear-gradient(
|
|
326
|
+
90deg,
|
|
327
|
+
rgba(0, 0, 0, 0.06) 25%,
|
|
328
|
+
rgba(0, 0, 0, 0.12) 37%,
|
|
329
|
+
rgba(0, 0, 0, 0.06) 63%
|
|
330
|
+
);
|
|
298
331
|
animation: scb-card-shimmer 1.2s infinite linear;
|
|
299
332
|
}
|
|
300
|
-
.media.is-loaded::before {
|
|
301
|
-
|
|
333
|
+
.media.is-loaded::before {
|
|
334
|
+
content: none;
|
|
335
|
+
}
|
|
336
|
+
@keyframes scb-card-shimmer {
|
|
337
|
+
0% {
|
|
338
|
+
transform: translateX(-100%);
|
|
339
|
+
}
|
|
340
|
+
100% {
|
|
341
|
+
transform: translateX(100%);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
302
344
|
|
|
303
|
-
.full-content {
|
|
345
|
+
.full-content {
|
|
346
|
+
padding: var(--spacing-7) var(--spacing-6);
|
|
347
|
+
}
|
|
304
348
|
.top-content {
|
|
305
349
|
display: flex;
|
|
306
350
|
flex-direction: column;
|
|
@@ -331,8 +375,13 @@ t.styles = m`
|
|
|
331
375
|
overflow-wrap: normal;
|
|
332
376
|
hyphens: auto;
|
|
333
377
|
}
|
|
334
|
-
.header a.title {
|
|
335
|
-
|
|
378
|
+
.header a.title {
|
|
379
|
+
color: inherit;
|
|
380
|
+
text-decoration: none;
|
|
381
|
+
}
|
|
382
|
+
.header md-icon {
|
|
383
|
+
flex: 0 0 auto;
|
|
384
|
+
}
|
|
336
385
|
|
|
337
386
|
.sub-label {
|
|
338
387
|
font-size: var(--md-sys-typescale-title-medium-size);
|
|
@@ -361,8 +410,12 @@ t.styles = m`
|
|
|
361
410
|
column-gap: var(--spacing-6);
|
|
362
411
|
padding: var(--spacing-6);
|
|
363
412
|
}
|
|
364
|
-
.scb-card.horizontal .media {
|
|
365
|
-
|
|
413
|
+
.scb-card.horizontal .media {
|
|
414
|
+
align-self: flex-start;
|
|
415
|
+
}
|
|
416
|
+
.scb-card.horizontal .media ::slotted(scb-avatar) {
|
|
417
|
+
margin: 0;
|
|
418
|
+
}
|
|
366
419
|
.scb-card.horizontal .full-content {
|
|
367
420
|
align-self: flex-start;
|
|
368
421
|
padding: 0;
|
|
@@ -370,8 +423,12 @@ t.styles = m`
|
|
|
370
423
|
min-inline-size: 0;
|
|
371
424
|
flex: 1 1 auto;
|
|
372
425
|
}
|
|
373
|
-
.scb-card.horizontal .header {
|
|
374
|
-
|
|
426
|
+
.scb-card.horizontal .header {
|
|
427
|
+
align-items: flex-start;
|
|
428
|
+
}
|
|
429
|
+
.scb-card.horizontal .header md-icon {
|
|
430
|
+
align-self: flex-start;
|
|
431
|
+
}
|
|
375
432
|
|
|
376
433
|
.scb-card.horizontal .media img {
|
|
377
434
|
margin: 0;
|
|
@@ -384,7 +441,7 @@ t.styles = m`
|
|
|
384
441
|
block-size: auto;
|
|
385
442
|
}
|
|
386
443
|
|
|
387
|
-
:host([sizing=
|
|
444
|
+
:host([sizing='content-width']) .scb-card.horizontal:has(.media img) .full-content {
|
|
388
445
|
inline-size: max-content;
|
|
389
446
|
flex: 0 1 auto;
|
|
390
447
|
}
|
|
@@ -401,13 +458,16 @@ t.styles = m`
|
|
|
401
458
|
font-size: var(--md-sys-typescale-title-large-size);
|
|
402
459
|
vertical-align: middle;
|
|
403
460
|
}
|
|
404
|
-
.comments,
|
|
461
|
+
.comments,
|
|
462
|
+
.likes {
|
|
405
463
|
display: flex;
|
|
406
464
|
align-items: center;
|
|
407
465
|
gap: var(--spacing-2);
|
|
408
466
|
}
|
|
409
467
|
|
|
410
|
-
.scb-card .content.list {
|
|
468
|
+
.scb-card .content.list {
|
|
469
|
+
margin-top: var(--spacing-7);
|
|
470
|
+
}
|
|
411
471
|
|
|
412
472
|
.scb-card .content.actions ::slotted(*) {
|
|
413
473
|
margin-top: var(--spacing-7);
|
|
@@ -416,7 +476,9 @@ t.styles = m`
|
|
|
416
476
|
gap: var(--spacing-3);
|
|
417
477
|
}
|
|
418
478
|
|
|
419
|
-
.scb-card .content.links {
|
|
479
|
+
.scb-card .content.links {
|
|
480
|
+
margin-top: var(--spacing-3);
|
|
481
|
+
}
|
|
420
482
|
.scb-card .content.links ::slotted(a),
|
|
421
483
|
.scb-card .content.links ::slotted(scb-link) {
|
|
422
484
|
display: block;
|
|
@@ -431,13 +493,13 @@ t.styles = m`
|
|
|
431
493
|
}
|
|
432
494
|
`;
|
|
433
495
|
e([
|
|
434
|
-
s({ type: String })
|
|
496
|
+
s({ type: String, reflect: !0 })
|
|
435
497
|
], t.prototype, "type", 2);
|
|
436
498
|
e([
|
|
437
|
-
s({ type: String })
|
|
499
|
+
s({ type: String, reflect: !0 })
|
|
438
500
|
], t.prototype, "variant", 2);
|
|
439
501
|
e([
|
|
440
|
-
s({ type: String })
|
|
502
|
+
s({ type: String, reflect: !0 })
|
|
441
503
|
], t.prototype, "direction", 2);
|
|
442
504
|
e([
|
|
443
505
|
s({ type: String, attribute: "media-type" })
|
|
@@ -482,28 +544,28 @@ e([
|
|
|
482
544
|
s({ type: Boolean, attribute: "media-placeholder" })
|
|
483
545
|
], t.prototype, "mediaPlaceholder", 2);
|
|
484
546
|
e([
|
|
485
|
-
s({ type: String, attribute: "card-href" })
|
|
547
|
+
s({ type: String, attribute: "card-href", reflect: !0 })
|
|
486
548
|
], t.prototype, "cardHref", 2);
|
|
487
549
|
e([
|
|
488
|
-
s({ type: String })
|
|
550
|
+
s({ type: String, reflect: !0 })
|
|
489
551
|
], t.prototype, "title", 2);
|
|
490
552
|
e([
|
|
491
|
-
s({ type: String })
|
|
553
|
+
s({ type: String, reflect: !0 })
|
|
492
554
|
], t.prototype, "subtitle", 2);
|
|
493
555
|
e([
|
|
494
|
-
s({ type: String, attribute: "supporting-text" })
|
|
556
|
+
s({ type: String, attribute: "supporting-text", reflect: !0 })
|
|
495
557
|
], t.prototype, "supportingText", 2);
|
|
496
558
|
e([
|
|
497
559
|
s({ type: Date, reflect: !0 })
|
|
498
560
|
], t.prototype, "date", 2);
|
|
499
561
|
e([
|
|
500
|
-
s({ type: String, attribute: "social-comments-text" })
|
|
562
|
+
s({ type: String, attribute: "social-comments-text", reflect: !0 })
|
|
501
563
|
], t.prototype, "commentsText", 2);
|
|
502
564
|
e([
|
|
503
565
|
s({ type: Number, attribute: "social-comments", reflect: !0 })
|
|
504
566
|
], t.prototype, "comments", 2);
|
|
505
567
|
e([
|
|
506
|
-
s({ type: String, attribute: "social-likes-text" })
|
|
568
|
+
s({ type: String, attribute: "social-likes-text", reflect: !0 })
|
|
507
569
|
], t.prototype, "likesText", 2);
|
|
508
570
|
e([
|
|
509
571
|
s({ type: Number, attribute: "social-likes", reflect: !0 })
|
|
@@ -524,7 +586,7 @@ e([
|
|
|
524
586
|
s({ type: String, reflect: !0, attribute: "max-height" })
|
|
525
587
|
], t.prototype, "maxHeight", 2);
|
|
526
588
|
t = e([
|
|
527
|
-
|
|
589
|
+
b("scb-card")
|
|
528
590
|
], t);
|
|
529
591
|
export {
|
|
530
592
|
t as ScbCard
|
|
@@ -5,5 +5,9 @@ export declare class ScbFactCardContent extends LitElement {
|
|
|
5
5
|
supportingText: string;
|
|
6
6
|
static styles: import('lit').CSSResult;
|
|
7
7
|
render(): import('lit-html').TemplateResult<1>;
|
|
8
|
-
|
|
8
|
+
}
|
|
9
|
+
declare global {
|
|
10
|
+
interface HTMLElementTagNameMap {
|
|
11
|
+
'scb-fact-card-content': ScbFactCardContent;
|
|
12
|
+
}
|
|
9
13
|
}
|
|
@@ -1,83 +1,76 @@
|
|
|
1
|
-
import { css as d, LitElement as
|
|
2
|
-
import { property as
|
|
3
|
-
var
|
|
4
|
-
for (var
|
|
5
|
-
(p =
|
|
6
|
-
return
|
|
1
|
+
import { css as d, LitElement as g, html as l } from "lit";
|
|
2
|
+
import { property as o, customElement as u } from "lit/decorators.js";
|
|
3
|
+
var y = Object.defineProperty, h = Object.getOwnPropertyDescriptor, r = (c, s, a, i) => {
|
|
4
|
+
for (var t = i > 1 ? void 0 : i ? h(s, a) : s, n = c.length - 1, p; n >= 0; n--)
|
|
5
|
+
(p = c[n]) && (t = (i ? p(s, a, t) : p(t)) || t);
|
|
6
|
+
return i && t && y(s, a, t), t;
|
|
7
7
|
};
|
|
8
|
-
let
|
|
8
|
+
let e = class extends g {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments), this.title = "", this.subtitle = "", this.supportingText = "";
|
|
11
11
|
}
|
|
12
12
|
render() {
|
|
13
|
-
return
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
`;
|
|
23
|
-
}
|
|
24
|
-
_hasSlotContent() {
|
|
25
|
-
const r = this.shadowRoot && this.shadowRoot.querySelector("slot");
|
|
26
|
-
if (!r) return !1;
|
|
27
|
-
const t = r.assignedNodes({ flatten: !0 });
|
|
28
|
-
return t.length > 0 && t.some((i) => {
|
|
29
|
-
var e;
|
|
30
|
-
return i.nodeType === Node.TEXT_NODE ? (e = i.textContent) == null ? void 0 : e.trim() : !0;
|
|
31
|
-
});
|
|
13
|
+
return l`
|
|
14
|
+
${this.title ? l`<div class="label">${this.title}</div>` : ""}
|
|
15
|
+
${this.subtitle ? l`<div class="sub-label">${this.subtitle}</div>` : ""}
|
|
16
|
+
${this.supportingText ? l`<div class="supporting-text">${this.supportingText}</div>` : ""}
|
|
17
|
+
|
|
18
|
+
<div class="content links">
|
|
19
|
+
<slot></slot>
|
|
20
|
+
</div>
|
|
21
|
+
`;
|
|
32
22
|
}
|
|
33
23
|
};
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
],
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
],
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
],
|
|
24
|
+
e.styles = d`
|
|
25
|
+
:host {
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-direction: column;
|
|
28
|
+
gap: var(--spacing-3);
|
|
29
|
+
width: 100%;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.label {
|
|
33
|
+
display: flex;
|
|
34
|
+
justify-content: space-between;
|
|
35
|
+
align-items: center;
|
|
36
|
+
font-size: var(--md-sys-typescale-headline-small-size);
|
|
37
|
+
font-weight: var(--weight-bold);
|
|
38
|
+
line-height: var(--md-sys-typescale-headline-small-line-height);
|
|
39
|
+
letter-spacing: var(--md-sys-typescale-headline-small-tracking);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.sub-label {
|
|
43
|
+
font-size: var(--md-sys-typescale-title-medium-size);
|
|
44
|
+
font-weight: var(--weight-semibold);
|
|
45
|
+
line-height: var(--md-sys-typescale-title-medium-line-height);
|
|
46
|
+
letter-spacing: var(--md-sys-typescale-title-medium-tracking);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.supporting-text {
|
|
50
|
+
font-size: var(--md-sys-typescale-body-large-size);
|
|
51
|
+
line-height: var(--md-sys-typescale-body-large-line-height);
|
|
52
|
+
letter-spacing: var(--md-sys-typescale-body-large-tracking);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.content.links ::slotted(*) {
|
|
56
|
+
margin-top: var(--spacing-3);
|
|
57
|
+
display: flex;
|
|
58
|
+
flex-direction: column;
|
|
59
|
+
gap: var(--spacing-3);
|
|
60
|
+
}
|
|
61
|
+
`;
|
|
62
|
+
r([
|
|
63
|
+
o({ type: String, reflect: !0, attribute: "title" })
|
|
64
|
+
], e.prototype, "title", 2);
|
|
65
|
+
r([
|
|
66
|
+
o({ type: String, reflect: !0, attribute: "subtitle" })
|
|
67
|
+
], e.prototype, "subtitle", 2);
|
|
68
|
+
r([
|
|
69
|
+
o({ type: String, reflect: !0, attribute: "supporting-text" })
|
|
70
|
+
], e.prototype, "supportingText", 2);
|
|
71
|
+
e = r([
|
|
72
|
+
u("scb-fact-card-content")
|
|
73
|
+
], e);
|
|
81
74
|
export {
|
|
82
|
-
|
|
75
|
+
e as ScbFactCardContent
|
|
83
76
|
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { LitElement, PropertyValues } from 'lit';
|
|
2
2
|
export declare class ScbKeyFigureCard extends LitElement {
|
|
3
|
+
private static __iconLoaded;
|
|
4
|
+
private static __rippleLoaded;
|
|
3
5
|
keyfigure: number | string;
|
|
4
6
|
subtitle: string;
|
|
5
7
|
supportingText: string;
|
|
@@ -14,10 +16,10 @@ export declare class ScbKeyFigureCard extends LitElement {
|
|
|
14
16
|
sizing: 'stretch' | 'content-width' | 'content-height';
|
|
15
17
|
static styles: import('lit').CSSResult;
|
|
16
18
|
private formatNumber;
|
|
19
|
+
protected firstUpdated(): Promise<void>;
|
|
17
20
|
render(): import('lit-html').TemplateResult<1>;
|
|
18
21
|
private __applyInnerSizing;
|
|
19
22
|
protected updated(changed: PropertyValues): void;
|
|
20
|
-
firstUpdated(): void;
|
|
21
23
|
private __onKeyDown;
|
|
22
24
|
private __handleHrefNavigation;
|
|
23
25
|
}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import { css as p, LitElement as
|
|
2
|
-
import { property as s, customElement as
|
|
3
|
-
import "@material/web/icon/icon.js";
|
|
4
|
-
import "@material/web/ripple/ripple.js";
|
|
1
|
+
import { css as p, LitElement as d, html as a } from "lit";
|
|
2
|
+
import { property as s, customElement as u } from "lit/decorators.js";
|
|
5
3
|
import "@material/web/focus/md-focus-ring.js";
|
|
6
4
|
var y = Object.defineProperty, g = Object.getOwnPropertyDescriptor, t = (e, r, n, o) => {
|
|
7
5
|
for (var l = o > 1 ? void 0 : o ? g(r, n) : r, h = e.length - 1, c; h >= 0; h--)
|
|
8
6
|
(c = e[h]) && (l = (o ? c(r, n, l) : c(l)) || l);
|
|
9
7
|
return o && l && y(r, n, l), l;
|
|
10
8
|
};
|
|
11
|
-
let i = class extends
|
|
9
|
+
let i = class extends d {
|
|
12
10
|
constructor() {
|
|
13
11
|
super(...arguments), this.keyfigure = 0, this.subtitle = "", this.supportingText = "", this.cardHref = "", this.icon = "", this.size = "standard", this.unit = "", this.width = "", this.maxWidth = "", this.height = "", this.maxHeight = "", this.sizing = "stretch", this.__onKeyDown = (e) => {
|
|
14
12
|
(e.key === "Enter" || e.key === " ") && this.cardHref && (e.preventDefault(), window.location.href = this.cardHref);
|
|
@@ -22,6 +20,9 @@ let i = class extends u {
|
|
|
22
20
|
const r = Number(e);
|
|
23
21
|
return Number.isNaN(r) ? String(e) : r.toLocaleString("sv-SE").replace(/\u00A0/g, " ");
|
|
24
22
|
}
|
|
23
|
+
async firstUpdated() {
|
|
24
|
+
i.__iconLoaded || (await import("@material/web/icon/icon.js"), i.__iconLoaded = !0), i.__rippleLoaded || (await import("@material/web/ripple/ripple.js"), i.__rippleLoaded = !0), this.__applyInnerSizing();
|
|
25
|
+
}
|
|
25
26
|
render() {
|
|
26
27
|
const e = !!this.cardHref, r = this.formatNumber(this.keyfigure), n = (this.unit || "").trim(), o = n ? `${r} ${n}` : r;
|
|
27
28
|
return a`
|
|
@@ -66,12 +67,10 @@ let i = class extends u {
|
|
|
66
67
|
updated(e) {
|
|
67
68
|
super.updated(e), e.has("width") && (this.width ? this.style.inlineSize = this.width : this.style.removeProperty("inline-size")), e.has("maxWidth") && (this.maxWidth ? this.style.maxInlineSize = this.maxWidth : this.style.removeProperty("max-inline-size")), e.has("height") && (this.height ? this.style.blockSize = this.height : this.style.removeProperty("block-size")), e.has("maxHeight") && (this.maxHeight ? this.style.maxBlockSize = this.maxHeight : this.style.removeProperty("max-block-size")), (e.has("width") || e.has("height") || e.has("maxHeight") || e.has("sizing")) && this.__applyInnerSizing();
|
|
68
69
|
}
|
|
69
|
-
firstUpdated() {
|
|
70
|
-
this.__applyInnerSizing();
|
|
71
|
-
}
|
|
72
70
|
};
|
|
71
|
+
i.__iconLoaded = !1;
|
|
72
|
+
i.__rippleLoaded = !1;
|
|
73
73
|
i.styles = p`
|
|
74
|
-
|
|
75
74
|
:host {
|
|
76
75
|
display: block;
|
|
77
76
|
box-sizing: border-box;
|
|
@@ -89,7 +88,6 @@ i.styles = p`
|
|
|
89
88
|
font-feature-settings: "tnum" 0, "pnum" 1;
|
|
90
89
|
}
|
|
91
90
|
|
|
92
|
-
|
|
93
91
|
:host([sizing="stretch"]) {
|
|
94
92
|
inline-size: 100%;
|
|
95
93
|
block-size: 100%;
|
|
@@ -158,6 +156,13 @@ i.styles = p`
|
|
|
158
156
|
font-weight: var(--weight-semibold);
|
|
159
157
|
line-height: var(--md-sys-typescale-title-medium-line-height);
|
|
160
158
|
letter-spacing: var(--md-sys-typescale-title-medium-tracking);
|
|
159
|
+
|
|
160
|
+
white-space: normal;
|
|
161
|
+
word-break: normal;
|
|
162
|
+
overflow-wrap: normal;
|
|
163
|
+
hyphens: auto;
|
|
164
|
+
overflow: visible;
|
|
165
|
+
text-overflow: clip;
|
|
161
166
|
}
|
|
162
167
|
.sub-label a { color: inherit; text-decoration: none; }
|
|
163
168
|
|
|
@@ -165,6 +170,13 @@ i.styles = p`
|
|
|
165
170
|
font-size: var(--md-sys-typescale-body-large-size);
|
|
166
171
|
line-height: var(--md-sys-typescale-body-large-line-height);
|
|
167
172
|
letter-spacing: var(--md-sys-typescale-body-large-tracking);
|
|
173
|
+
|
|
174
|
+
white-space: normal;
|
|
175
|
+
word-break: normal;
|
|
176
|
+
overflow-wrap: normal;
|
|
177
|
+
hyphens: auto;
|
|
178
|
+
overflow: visible;
|
|
179
|
+
text-overflow: clip;
|
|
168
180
|
}
|
|
169
181
|
|
|
170
182
|
.scb-keyfigure-card.clickable { cursor: pointer; }
|
|
@@ -212,7 +224,7 @@ t([
|
|
|
212
224
|
s({ type: String, reflect: !0 })
|
|
213
225
|
], i.prototype, "sizing", 2);
|
|
214
226
|
i = t([
|
|
215
|
-
|
|
227
|
+
u("scb-keyfigure-card")
|
|
216
228
|
], i);
|
|
217
229
|
export {
|
|
218
230
|
i as ScbKeyFigureCard
|
|
@@ -1,20 +1,34 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
1
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
2
|
+
type NotificationVariant = 'success' | 'error' | 'warning' | 'info';
|
|
3
|
+
type NotificationDirection = 'horizontal' | 'vertical';
|
|
4
|
+
type NotificationSizing = 'stretch' | 'content-width' | 'content-height';
|
|
2
5
|
export declare class ScbNotificationCard extends LitElement {
|
|
3
|
-
variant:
|
|
4
|
-
direction:
|
|
6
|
+
variant: NotificationVariant;
|
|
7
|
+
direction: NotificationDirection;
|
|
5
8
|
title: string;
|
|
6
9
|
subtitle: string;
|
|
7
10
|
supportingText: string;
|
|
8
11
|
open: boolean;
|
|
9
12
|
linkText: string;
|
|
10
|
-
|
|
13
|
+
linkHref: string;
|
|
11
14
|
showIcon: boolean;
|
|
12
15
|
showCloseButton: boolean;
|
|
16
|
+
sizing: NotificationSizing;
|
|
17
|
+
width: string;
|
|
18
|
+
maxWidth: string;
|
|
19
|
+
height: string;
|
|
20
|
+
maxHeight: string;
|
|
13
21
|
fullHeight: boolean;
|
|
14
22
|
fullWidth: boolean;
|
|
15
23
|
static styles: import('lit').CSSResult[];
|
|
16
|
-
/** Return icon name for notification variant */
|
|
17
24
|
private _iconForVariant;
|
|
18
25
|
private _closeNotification;
|
|
26
|
+
protected updated(changed: PropertyValues): void;
|
|
19
27
|
render(): import('lit-html').TemplateResult<1>;
|
|
20
28
|
}
|
|
29
|
+
declare global {
|
|
30
|
+
interface HTMLElementTagNameMap {
|
|
31
|
+
'scb-notification-card': ScbNotificationCard;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
export {};
|