scb-wc-test 0.1.81 → 0.1.82
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 +23 -21
- package/mvc/components/all.js +1 -0
- package/mvc/components/scb-chip/scb-chip.js +2 -7
- package/mvc/components/scb-horizontal-scroller/scb-horizontal-scroller.js +38 -27
- package/mvc/components/scb-viz/scb-viz.js +297 -0
- package/package.json +6 -2
- package/scb-chip/scb-chip.js +4 -9
- package/scb-horizontal-scroller/scb-horizontal-scroller.d.ts +1 -0
- package/scb-horizontal-scroller/scb-horizontal-scroller.js +81 -58
- package/scb-viz/scb-viz.d.ts +24 -0
- package/scb-viz/scb-viz.js +408 -0
- package/scb-wc-test.bundle.js +688 -386
package/all.js
CHANGED
|
@@ -62,6 +62,7 @@ import './mvc/components/scb-textfield/scb-textfield.js';
|
|
|
62
62
|
import './mvc/components/scb-toc/scb-toc-item.js';
|
|
63
63
|
import './mvc/components/scb-toc/scb-toc.js';
|
|
64
64
|
import './mvc/components/scb-tooltip/scb-tooltip.js';
|
|
65
|
+
import './mvc/components/scb-viz/scb-viz.js';
|
|
65
66
|
import './mvc/vendor/preload-helper.js';
|
|
66
67
|
import './mvc/vendor/vendor-lit.js';
|
|
67
68
|
import './mvc/vendor/vendor-material.js';
|
|
@@ -127,3 +128,4 @@ import './scb-textfield/scb-textfield.js';
|
|
|
127
128
|
import './scb-toc/scb-toc-item.js';
|
|
128
129
|
import './scb-toc/scb-toc.js';
|
|
129
130
|
import './scb-tooltip/scb-tooltip.js';
|
|
131
|
+
import './scb-viz/scb-viz.js';
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -15,12 +15,12 @@ import { ScbDialog as k } from "./scb-dialog/scb-dialog.js";
|
|
|
15
15
|
import { ScbDivider as y } from "./scb-divider/scb-divider.js";
|
|
16
16
|
import { ScbDrawerItem as P } from "./scb-drawer/scb-drawer-item.js";
|
|
17
17
|
import { ScbDrawerSection as M } from "./scb-drawer/scb-drawer-section.js";
|
|
18
|
-
import { ScbDrawer as
|
|
19
|
-
import { ScbSubDrawer as
|
|
18
|
+
import { ScbDrawer as z } from "./scb-drawer/scb-drawer.js";
|
|
19
|
+
import { ScbSubDrawer as R } from "./scb-drawer/scb-sub-drawer.js";
|
|
20
20
|
import { ScbFactCardContent as U } from "./scb-fact-card/scb-fact-card-content.js";
|
|
21
|
-
import { ScbFactCard as
|
|
22
|
-
import { ScbFooterSection as
|
|
23
|
-
import { ScbFooter as
|
|
21
|
+
import { ScbFactCard as j } from "./scb-fact-card/scb-fact-card.js";
|
|
22
|
+
import { ScbFooterSection as E } from "./scb-footer/scb-footer-section.js";
|
|
23
|
+
import { ScbFooter as O } from "./scb-footer/scb-footer.js";
|
|
24
24
|
import { ScbGridItem as W } from "./scb-grid/scb-grid-item.js";
|
|
25
25
|
import { ScbGrid as Y } from "./scb-grid/scb-grid.js";
|
|
26
26
|
import { ScbStack as _ } from "./scb-grid/scb-stack.js";
|
|
@@ -42,12 +42,12 @@ import { ScbNotification as kr } from "./scb-notification/scb-notification.js";
|
|
|
42
42
|
import { ScbNotificationCard as yr } from "./scb-notification-card/scb-notification-card.js";
|
|
43
43
|
import { ScbPagination as Pr } from "./scb-pagination/scb-pagination.js";
|
|
44
44
|
import { ScbProgressIndicator as Mr } from "./scb-progress-indicator/scb-progress-indicator.js";
|
|
45
|
-
import { ScbRadioButton as
|
|
46
|
-
import { ScbRadioGroup as
|
|
45
|
+
import { ScbRadioButton as zr } from "./scb-radio-button/scb-radio-button.js";
|
|
46
|
+
import { ScbRadioGroup as Rr } from "./scb-radio-button/scb-radio-group.js";
|
|
47
47
|
import { ScbSearch as Ur } from "./scb-search/scb-search.js";
|
|
48
|
-
import { ScbSegmentedButton as
|
|
49
|
-
import { ScbSegmentedItem as
|
|
50
|
-
import { ScbSnackbar as
|
|
48
|
+
import { ScbSegmentedButton as jr } from "./scb-segmented-button/scb-segmented-button.js";
|
|
49
|
+
import { ScbSegmentedItem as Er } from "./scb-segmented-button/scb-segmented-item.js";
|
|
50
|
+
import { ScbSnackbar as Or } from "./scb-snackbar/scb-snackbar.js";
|
|
51
51
|
import { ScbStatusPill as Wr } from "./scb-status-pill/scb-status-pill.js";
|
|
52
52
|
import { ScbStep as Yr } from "./scb-stepper/scb-step.js";
|
|
53
53
|
import { ScbStepper as _r } from "./scb-stepper/scb-stepper.js";
|
|
@@ -59,6 +59,7 @@ import { ScbTextField2 as bo } from "./scb-textfield/scb-textfield.js";
|
|
|
59
59
|
import { ScbTocItem as fo } from "./scb-toc/scb-toc-item.js";
|
|
60
60
|
import { ScbToc as io } from "./scb-toc/scb-toc.js";
|
|
61
61
|
import { ScbTooltip as uo } from "./scb-tooltip/scb-tooltip.js";
|
|
62
|
+
import { ScbViz as Io } from "./scb-viz/scb-viz.js";
|
|
62
63
|
export {
|
|
63
64
|
n as SCBBreadcrumb,
|
|
64
65
|
i as SCBBreadcrumbItem,
|
|
@@ -75,13 +76,13 @@ export {
|
|
|
75
76
|
H as ScbChip,
|
|
76
77
|
k as ScbDialog,
|
|
77
78
|
y as ScbDivider,
|
|
78
|
-
|
|
79
|
+
z as ScbDrawer,
|
|
79
80
|
P as ScbDrawerItem,
|
|
80
81
|
M as ScbDrawerSection,
|
|
81
|
-
|
|
82
|
+
j as ScbFactCard,
|
|
82
83
|
U as ScbFactCardContent,
|
|
83
|
-
|
|
84
|
-
|
|
84
|
+
O as ScbFooter,
|
|
85
|
+
E as ScbFooterSection,
|
|
85
86
|
Y as ScbGrid,
|
|
86
87
|
W as ScbGridItem,
|
|
87
88
|
br as ScbHeader,
|
|
@@ -102,23 +103,24 @@ export {
|
|
|
102
103
|
Pr as ScbPagination,
|
|
103
104
|
eo as ScbPrimaryTab,
|
|
104
105
|
Mr as ScbProgressIndicator,
|
|
105
|
-
|
|
106
|
-
|
|
106
|
+
zr as ScbRadioButton,
|
|
107
|
+
Rr as ScbRadioGroup,
|
|
107
108
|
Ur as ScbSearch,
|
|
108
109
|
co as ScbSecondaryTab,
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
jr as ScbSegmentedButton,
|
|
111
|
+
Er as ScbSegmentedItem,
|
|
112
|
+
Or as ScbSnackbar,
|
|
112
113
|
_ as ScbStack,
|
|
113
114
|
Wr as ScbStatusPill,
|
|
114
115
|
Yr as ScbStep,
|
|
115
116
|
_r as ScbStepper,
|
|
116
|
-
|
|
117
|
+
R as ScbSubDrawer,
|
|
117
118
|
Hr as ScbSubMenu,
|
|
118
119
|
ro as ScbSwitch,
|
|
119
120
|
mo as ScbTabs,
|
|
120
121
|
bo as ScbTextField2,
|
|
121
122
|
io as ScbToc,
|
|
122
123
|
fo as ScbTocItem,
|
|
123
|
-
uo as ScbTooltip
|
|
124
|
+
uo as ScbTooltip,
|
|
125
|
+
Io as ScbViz
|
|
124
126
|
};
|
package/mvc/components/all.js
CHANGED
|
@@ -37,12 +37,7 @@ import{_ as h}from"../../vendor/preload-helper.js";import{a as p,n as r,i as _,x
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
md-icon {
|
|
40
|
-
color: var(--
|
|
41
|
-
font-size: var(--
|
|
42
|
-
}
|
|
43
|
-
@media (prefers-color-scheme: dark) {
|
|
44
|
-
md-icon {
|
|
45
|
-
color: var(--md-sys-color-on-surface);
|
|
46
|
-
}
|
|
40
|
+
color: var(--md-sys-color-on-surface);
|
|
41
|
+
font-size: var(--md-sys-typescale-body-large-size);
|
|
47
42
|
}
|
|
48
43
|
`;s([r({type:String,reflect:!0})],t.prototype,"variant",2);s([r({type:String})],t.prototype,"label",2);s([r({type:String})],t.prototype,"icon",2);s([r({type:Boolean,reflect:!0})],t.prototype,"disabled",2);s([r({type:Boolean,reflect:!0})],t.prototype,"elevated",2);s([r({type:Boolean,reflect:!0})],t.prototype,"removable",2);s([r({type:Boolean,reflect:!0})],t.prototype,"selected",2);s([r({type:String})],t.prototype,"href",2);s([r({type:String})],t.prototype,"target",2);t=s([u("scb-chip")],t);export{t as ScbChip};
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
import{a as
|
|
2
|
-
<div class="scb-horizontal-scroller" tabindex="0">
|
|
3
|
-
|
|
1
|
+
import{a as u,n as h,i as b,x as c,t as f}from"../../vendor/vendor.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-button/scb-button.js";import"../../vendor/vendor-material.js";import"../../vendor/preload-helper.js";import"../scb-tooltip/scb-tooltip.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var l=customElements.define.bind(customElements);customElements.define=function(i,s,o){try{customElements.get(i)||l(i,s,o)}catch(r){var e=String(r||"");if(e.indexOf("already been used")===-1&&e.indexOf("NotSupportedError")===-1)throw r}}}}catch{}})();var p=Object.defineProperty,g=Object.getOwnPropertyDescriptor,n=(t,l,i,s)=>{for(var o=s>1?void 0:s?g(l,i):l,e=t.length-1,r;e>=0;e--)(r=t[e])&&(o=(s?r(l,i,o):r(o))||o);return s&&o&&p(l,i,o),o};let a=class extends b{constructor(){super(...arguments),this.variant="standard",this.width="100%",this.showScrollbar=!0,this.rightScrollButtonLabel="Scrolla höger",this.leftScrollButtonLabel="Scrolla vänster",this.contentFlex=!1,this.updateScrollButtons=()=>{this.requestUpdate();const t=this.shadowRoot?.querySelector(".scb-horizontal-scroller");if(!t)return;t.scrollLeft>0?this.setAttribute("data-scroll-left",""):this.removeAttribute("data-scroll-left");const l=t;l.scrollLeft+l.clientWidth<l.scrollWidth-1?this.setAttribute("data-scroll-right",""):this.removeAttribute("data-scroll-right")},this.lastScrollLeft=0,this.isScrolling=!1,this.scrollEndTimeout=null,this.handleScroll=()=>{const t=this.shadowRoot?.querySelector(".scb-horizontal-scroller");t&&(this.updateScrollButtons(),this.dispatchCustomEvent("scb-scroll",{scrollLeft:t.scrollLeft}),this.isScrolling||(this.isScrolling=!0,this.dispatchCustomEvent("scb-scroll-start",{scrollLeft:t.scrollLeft})),clearTimeout(this.scrollEndTimeout),this.scrollEndTimeout=setTimeout(()=>{this.isScrolling=!1,this.dispatchCustomEvent("scb-scroll-end",{scrollLeft:t.scrollLeft})},120),t.scrollLeft>this.lastScrollLeft?this.dispatchCustomEvent("scb-scroll-right",{scrollLeft:t.scrollLeft}):t.scrollLeft<this.lastScrollLeft&&this.dispatchCustomEvent("scb-scroll-left",{scrollLeft:t.scrollLeft}),this.lastScrollLeft=t.scrollLeft)}}doScrollBy(t){const l=this.shadowRoot?.querySelector(".scb-horizontal-scroller");l&&l.scrollBy({left:t,behavior:"smooth"})}get canScrollLeft(){const t=this.shadowRoot?.querySelector(".scb-horizontal-scroller");return t?t.scrollLeft>0:!1}get canScrollRight(){const t=this.shadowRoot?.querySelector(".scb-horizontal-scroller");if(!t)return!1;const l=t;return l.scrollLeft+l.clientWidth<l.scrollWidth-1}connectedCallback(){super.connectedCallback(),this.addEventListener("scroll",this.updateScrollButtons,!0)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("scroll",this.updateScrollButtons,!0)}dispatchCustomEvent(t,l={}){this.dispatchEvent(new CustomEvent(t,{detail:l,bubbles:!0,composed:!0}))}firstUpdated(){const t=this.shadowRoot?.querySelector(".scb-horizontal-scroller"),l=this.shadowRoot?.querySelector(".scroll-shadow-left"),i=this.shadowRoot?.querySelector(".scroll-shadow-right"),s=this.shadowRoot?.querySelector("slot");t&&(t.addEventListener("scroll",this.handleScroll),t.addEventListener("wheel",function(e){e.deltaY!==0&&(e.preventDefault(),t.scrollLeft+=e.deltaY)},{passive:!1}));const o=()=>{if(s&&l&&i){const e=s.getBoundingClientRect();l.style.height=`${e.height}px`,i.style.height=`${e.height}px`}};o(),s&&new ResizeObserver(o).observe(s),this.updateComplete.then(()=>{this.updateScrollButtons()})}updated(t){const l=this.shadowRoot?.querySelector(".scroll-shadow-left"),i=this.shadowRoot?.querySelector(".scroll-shadow-right"),s=this.shadowRoot?.querySelector("slot"),o=this.shadowRoot?.querySelector(".scb-horizontal-scroller");if(o){o.addEventListener("scroll",this.handleScroll),o.addEventListener("wheel",function(d){d.deltaY!==0&&(d.preventDefault(),o.scrollLeft+=d.deltaY)},{passive:!1}),o.scrollLeft>0?this.setAttribute("data-scroll-left",""):this.removeAttribute("data-scroll-left");const r=o;r.scrollLeft+r.clientWidth<r.scrollWidth-1?this.setAttribute("data-scroll-right",""):this.removeAttribute("data-scroll-right")}t.has("width")&&this.style.setProperty("--scb-horizontal-scroller-width",this.width);const e=()=>{if(s&&l&&i){const r=s.getBoundingClientRect();l.style.height=`${r.height}px`,i.style.height=`${r.height}px`}};e(),s&&new ResizeObserver(e).observe(s)}render(){const t=this.variant;var l=!!(this.canScrollLeft||this.canScrollRight);switch(t){case"inline":return c`
|
|
2
|
+
<div class="scb-horizontal-scroller ${l?"canScroll":""}" tabindex="0">
|
|
3
|
+
${this.variant!="inline"?c`<div class="scroll-shadow-left"></div>`:""}
|
|
4
4
|
<slot></slot>
|
|
5
5
|
<md-focus-ring inward></md-focus-ring>
|
|
6
|
-
|
|
6
|
+
${this.variant!="inline"?c`<div class="scroll-shadow-right"></div>`:""}
|
|
7
7
|
</div>
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
${l?c`
|
|
9
|
+
<div class="scroll-buttons">
|
|
10
|
+
${this.canScrollLeft?c`
|
|
11
|
+
<scb-button class="scroll-button-left" variant="text" label="${this.leftScrollButtonLabel}" aria-label="Scrolla vänster" icon="chevron_left" @click="${()=>this.doScrollBy(-100)}"></scb-button>
|
|
12
|
+
`:""}
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
${this.canScrollRight?c`
|
|
15
|
+
<scb-button class="scroll-button-right" variant="text" label="${this.rightScrollButtonLabel}" aria-label="Scrolla höger" icon="chevron_right" trailing-icon @click="${()=>this.doScrollBy(100)}"></scb-button>
|
|
16
|
+
`:""}
|
|
17
|
+
</div>
|
|
18
|
+
`:""}
|
|
19
|
+
`;default:return c`
|
|
20
|
+
${this.canScrollLeft?c`
|
|
19
21
|
<scb-icon-button class="scroll-button-left" icon="chevron_left" aria-label="Scrolla vänster" variant="filled-tonal" @click="${()=>this.doScrollBy(-100)}"></scb-icon-button>
|
|
20
22
|
`:""}
|
|
21
23
|
<div class="scroll-shadow-left"></div>
|
|
@@ -24,27 +26,33 @@ import{a as d,n as h,i as u,x as a,t as b}from"../../vendor/vendor.js";import"..
|
|
|
24
26
|
<md-focus-ring inward></md-focus-ring>
|
|
25
27
|
</div>
|
|
26
28
|
<div class="scroll-shadow-right"></div>
|
|
27
|
-
${this.canScrollRight?
|
|
29
|
+
${this.canScrollRight?c`
|
|
28
30
|
<scb-icon-button class="scroll-button-right" icon="chevron_right" aria-label="Scrolla höger" variant="filled-tonal" @click="${()=>this.doScrollBy(100)}"></scb-icon-button>
|
|
29
31
|
`:""}
|
|
30
|
-
`}}};
|
|
32
|
+
`}}};a.styles=u`
|
|
31
33
|
:host {
|
|
32
|
-
position: relative;
|
|
33
|
-
max-width: var(--scb-horizontal-scroller-width, 100%);
|
|
34
34
|
display: flex;
|
|
35
|
+
position: relative;
|
|
35
36
|
align-items: center;
|
|
36
37
|
gap: var(--spacing-3);
|
|
37
38
|
padding: 0px var(--spacing-8);
|
|
38
39
|
}
|
|
39
40
|
.scb-horizontal-scroller {
|
|
41
|
+
overflow-x: auto;
|
|
42
|
+
-ms-overflow-style: none; /* IE and Edge */
|
|
43
|
+
scrollbar-width: none;
|
|
44
|
+
width: 100%;
|
|
45
|
+
}
|
|
46
|
+
:host([show-scrollbar]) .scb-horizontal-scroller{
|
|
47
|
+
scrollbar-width: auto;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
:host([content-flex]) .scb-horizontal-scroller{
|
|
40
51
|
display: flex;
|
|
41
52
|
flex-direction: row;
|
|
42
|
-
overflow-x: scroll;
|
|
43
53
|
flex: 1 1 auto;
|
|
44
|
-
-ms-overflow-style: none; /* IE and Edge */
|
|
45
|
-
scrollbar-width: none;
|
|
46
|
-
max-width: var(--scb-horizontal-scroller-width, 100%);
|
|
47
54
|
}
|
|
55
|
+
|
|
48
56
|
.scb-horizontal-scroller::-webkit-scrollbar {
|
|
49
57
|
border-radius: var(--md-sys-shape-corner-large);
|
|
50
58
|
height: 4px;
|
|
@@ -66,14 +74,16 @@ import{a as d,n as h,i as u,x as a,t as b}from"../../vendor/vendor.js";import"..
|
|
|
66
74
|
border-radius: var(--scb-card-focus-ring-radius, var(--md-sys-shape-corner-large));
|
|
67
75
|
}
|
|
68
76
|
|
|
69
|
-
:host([show-scrollbar]) .scb-horizontal-scroller{
|
|
70
|
-
-ms-overflow-style: auto; /* IE and Edge */
|
|
71
|
-
scrollbar-width: auto;
|
|
77
|
+
:host([show-scrollbar]) .scb-horizontal-scroller.canScroll{
|
|
72
78
|
padding-bottom: var(--spacing-5);
|
|
73
79
|
}
|
|
74
80
|
slot {
|
|
75
|
-
display:
|
|
81
|
+
display: block;
|
|
76
82
|
padding: var(--spacing-3);
|
|
83
|
+
min-width: var(--scb-horizontal-scroller-width, auto);
|
|
84
|
+
}
|
|
85
|
+
:host([content-flex]) .scb-horizontal-scroller slot {
|
|
86
|
+
display: flex;
|
|
77
87
|
}
|
|
78
88
|
.scroll-button-left {
|
|
79
89
|
left: var(--spacing-5);
|
|
@@ -111,6 +121,7 @@ import{a as d,n as h,i as u,x as a,t as b}from"../../vendor/vendor.js";import"..
|
|
|
111
121
|
:host([variant="inline"]) {
|
|
112
122
|
flex-direction: column;
|
|
113
123
|
align-items: unset;
|
|
124
|
+
padding: 0;
|
|
114
125
|
.scroll-buttons {
|
|
115
126
|
display: flex;
|
|
116
127
|
gap: var(--spacing-3);
|
|
@@ -131,4 +142,4 @@ import{a as d,n as h,i as u,x as a,t as b}from"../../vendor/vendor.js";import"..
|
|
|
131
142
|
gap: var(--spacing-5);
|
|
132
143
|
}
|
|
133
144
|
|
|
134
|
-
`;n([h({type:String,reflect:!0})],
|
|
145
|
+
`;n([h({type:String,reflect:!0})],a.prototype,"variant",2);n([h({type:String,reflect:!0})],a.prototype,"width",2);n([h({type:Boolean,reflect:!0,attribute:"show-scrollbar"})],a.prototype,"showScrollbar",2);n([h({type:String,reflect:!0,attribute:"right-scroll-button-label"})],a.prototype,"rightScrollButtonLabel",2);n([h({type:String,reflect:!0,attribute:"left-scroll-button-label"})],a.prototype,"leftScrollButtonLabel",2);n([h({type:Boolean,reflect:!0,attribute:"content-flex"})],a.prototype,"contentFlex",2);a=n([f("scb-horizontal-scroller")],a);
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
import{a as v,n as r,i as h,x as t,t as b}from"../../vendor/vendor.js";import"../scb-chip/scb-chip.js";import"../scb-accordion/scb-accordion.js";import"../scb-divider/scb-divider.js";import"../scb-horizontal-scroller/scb-horizontal-scroller.js";import"../../vendor/preload-helper.js";import"../scb-accordion/scb-accordion-item.js";import"../../vendor/vendor-material.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-tooltip/scb-tooltip.js";import"../scb-button/scb-button.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var d=customElements.define.bind(customElements);customElements.define=function(s,i,a){try{customElements.get(s)||d(s,i,a)}catch(n){var c=String(n||"");if(c.indexOf("already been used")===-1&&c.indexOf("NotSupportedError")===-1)throw n}}}}catch{}})();var p=Object.defineProperty,m=Object.getOwnPropertyDescriptor,o=(e,d,s,i)=>{for(var a=i>1?void 0:i?m(d,s):d,c=e.length-1,n;c>=0;c--)(n=e[c])&&(a=(i?n(d,s,a):n(a))||a);return i&&a&&p(d,s,a),a};let l=class extends h{constructor(){super(...arguments),this.variant="Standard",this.selectedChip="Diagram",this.title="",this.subtitle="",this.description="",this.comment="",this.source="",this.footnote="",this.lang="sv",this.imageHref=""}get descriptionLabel(){return this.lang==="en"?"Description of the chart":"Beskrivning av diagrammet"}get moreAboutStatsLabel(){return this.lang==="en"?"More about the statistics":"Mer om statistiken"}get commentLabel(){return this.lang==="en"?"Comments":"Kommentar"}get sourceLabel(){return this.lang==="en"?"Source":"Källa"}get footnoteLabel(){return this.lang==="en"?"Footnotes":"Fotnot"}firstUpdated(){const e=this.shadowRoot?.querySelector('slot[name="table"]');e&&(e.addEventListener("slotchange",()=>this._styleSlottedTable()),this._styleSlottedTable())}updated(){this._styleSlottedTable()}_styleSlottedTable(){const e=this.shadowRoot?.querySelector('slot[name="table"]');if(!e)return;e.assignedElements({flatten:!0}).forEach(s=>{s.tagName==="TABLE"&&(s.style.borderCollapse="collapse",s.style.width="100%",s.querySelectorAll("tbody tr:nth-child(odd)").forEach(i=>{i.style.background="var(--md-sys-color-surface-container)"}),s.querySelectorAll("th").forEach(i=>{i.style.border="1px solid var(--md-sys-color-on-surface)",i.style.padding="8px"}),s.querySelectorAll("td").forEach(i=>{i.style.border="1px solid var(--md-sys-color-on-surface)",i.style.padding="8px"}),s.querySelectorAll("tr").forEach(i=>{const a=Array.from(i.children).filter(c=>c.tagName==="TD"||c.tagName==="TH");a.length>0&&(a[0].style.borderLeft="none",a[a.length-1].style.borderRight="none")}))})}render(){switch(this.variant){case"Diagram":return t`
|
|
2
|
+
<div part="container">
|
|
3
|
+
<div class="header">
|
|
4
|
+
<div class="label">${this.title}</div>
|
|
5
|
+
<div class="subtitle">${this.subtitle}</div>
|
|
6
|
+
</div>
|
|
7
|
+
<div class="content">
|
|
8
|
+
<scb-horizontal-scroller width="600px" class="diagram-scroller" variant="inline" show-scrollbar>
|
|
9
|
+
<slot name="diagram"></slot>
|
|
10
|
+
</scb-horizontal-scroller>
|
|
11
|
+
</div>
|
|
12
|
+
<div class="footer">
|
|
13
|
+
<div class="description section">
|
|
14
|
+
<div class="secondary-label">${this.descriptionLabel}</div>
|
|
15
|
+
${this.description?t`<div>${this.description}</div>`:""}
|
|
16
|
+
</div>
|
|
17
|
+
<scb-divider></scb-divider>
|
|
18
|
+
<scb-accordion>
|
|
19
|
+
<scb-accordion-item
|
|
20
|
+
title="${this.moreAboutStatsLabel}"
|
|
21
|
+
>
|
|
22
|
+
<div class="more-about-stats-content">
|
|
23
|
+
<div class="section">
|
|
24
|
+
<div class="secondary-label">${this.commentLabel}</div>
|
|
25
|
+
${this.comment?t`<div>${this.comment}</div>`:""}
|
|
26
|
+
</div>
|
|
27
|
+
<div class="section">
|
|
28
|
+
<div class="secondary-label">${this.sourceLabel}</div>
|
|
29
|
+
${this.source?t`<div>${this.source}</div>`:""}
|
|
30
|
+
</div>
|
|
31
|
+
<div class="section">
|
|
32
|
+
<div class="secondary-label">${this.footnoteLabel}</div>
|
|
33
|
+
${this.footnote?t`<div>${this.footnote}</div>`:""}
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</scb-accordion-item>
|
|
37
|
+
</scb-accordion>
|
|
38
|
+
</div>
|
|
39
|
+
<slot></slot>
|
|
40
|
+
</div>
|
|
41
|
+
`;case"Table":return t`
|
|
42
|
+
<div part="container">
|
|
43
|
+
<div class="header">
|
|
44
|
+
<div class="label">${this.title}</div>
|
|
45
|
+
<div class="subtitle">${this.subtitle}</div>
|
|
46
|
+
</div>
|
|
47
|
+
<div class="content">
|
|
48
|
+
<scb-horizontal-scroller width="600px" class="table-scroller" variant="inline" show-scrollbar>
|
|
49
|
+
<slot name="table"></slot>
|
|
50
|
+
</scb-horizontal-scroller>
|
|
51
|
+
</div>
|
|
52
|
+
<div class="footer">
|
|
53
|
+
<div class="description section">
|
|
54
|
+
<div class="secondary-label">${this.descriptionLabel}</div>
|
|
55
|
+
${this.description?t`<div>${this.description}</div>`:""}
|
|
56
|
+
</div>
|
|
57
|
+
<scb-divider></scb-divider>
|
|
58
|
+
<scb-accordion>
|
|
59
|
+
<scb-accordion-item
|
|
60
|
+
title="${this.moreAboutStatsLabel}"
|
|
61
|
+
>
|
|
62
|
+
<div class="more-about-stats-content">
|
|
63
|
+
<div class="section">
|
|
64
|
+
<div class="secondary-label">${this.commentLabel}</div>
|
|
65
|
+
${this.comment?t`<div>${this.comment}</div>`:""}
|
|
66
|
+
</div>
|
|
67
|
+
<div class="section">
|
|
68
|
+
<div class="secondary-label">${this.sourceLabel}</div>
|
|
69
|
+
${this.source?t`<div>${this.source}</div>`:""}
|
|
70
|
+
</div>
|
|
71
|
+
<div class="section">
|
|
72
|
+
<div class="secondary-label">${this.footnoteLabel}</div>
|
|
73
|
+
${this.footnote?t`<div>${this.footnote}</div>`:""}
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
</scb-accordion-item>
|
|
77
|
+
</scb-accordion>
|
|
78
|
+
</div>
|
|
79
|
+
<slot></slot>
|
|
80
|
+
</div>
|
|
81
|
+
`;case"Image":return t`
|
|
82
|
+
<div part="container">
|
|
83
|
+
<div class="header">
|
|
84
|
+
<div class="label">${this.title}</div>
|
|
85
|
+
<div class="subtitle">${this.subtitle}</div>
|
|
86
|
+
</div>
|
|
87
|
+
<div class="content image-content">
|
|
88
|
+
<img src="${this.imageHref}" alt="Image figure"/>
|
|
89
|
+
</div>
|
|
90
|
+
<div class="footer">
|
|
91
|
+
<div class="description section">
|
|
92
|
+
<div class="secondary-label">${this.descriptionLabel}</div>
|
|
93
|
+
${this.description?t`<div>${this.description}</div>`:""}
|
|
94
|
+
</div>
|
|
95
|
+
<scb-divider></scb-divider>
|
|
96
|
+
<scb-accordion>
|
|
97
|
+
<scb-accordion-item
|
|
98
|
+
title="${this.moreAboutStatsLabel}"
|
|
99
|
+
>
|
|
100
|
+
<div class="more-about-stats-content">
|
|
101
|
+
<div class="section">
|
|
102
|
+
<div class="secondary-label">${this.commentLabel}</div>
|
|
103
|
+
${this.comment?t`<div>${this.comment}</div>`:""}
|
|
104
|
+
</div>
|
|
105
|
+
<div class="section">
|
|
106
|
+
<div class="secondary-label">${this.sourceLabel}</div>
|
|
107
|
+
${this.source?t`<div>${this.source}</div>`:""}
|
|
108
|
+
</div>
|
|
109
|
+
<div class="section">
|
|
110
|
+
<div class="secondary-label">${this.footnoteLabel}</div>
|
|
111
|
+
${this.footnote?t`<div>${this.footnote}</div>`:""}
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
</scb-accordion-item>
|
|
115
|
+
</scb-accordion>
|
|
116
|
+
</div>
|
|
117
|
+
<slot></slot>
|
|
118
|
+
</div>
|
|
119
|
+
`;default:const e=this.selectedChip==="Diagram"?"chip-diagram":this.selectedChip==="Table"?"chip-table":"";return this.className!==e&&(this.className=e),t`
|
|
120
|
+
<div part="container">
|
|
121
|
+
<div class="header">
|
|
122
|
+
<div class="label">${this.title}</div>
|
|
123
|
+
<div class="subtitle">${this.subtitle}</div>
|
|
124
|
+
</div>
|
|
125
|
+
${this.variant==="Standard"?t`
|
|
126
|
+
<div class="flipp-wrapper">
|
|
127
|
+
<scb-chip
|
|
128
|
+
variant="filter"
|
|
129
|
+
label=${this.lang==="en"?"Figure":"Diagram"}
|
|
130
|
+
icon="bar_chart"
|
|
131
|
+
?selected=${this.selectedChip==="Diagram"}
|
|
132
|
+
@selected-changed=${()=>this._onChipSelect("Diagram")}
|
|
133
|
+
></scb-chip>
|
|
134
|
+
<scb-chip
|
|
135
|
+
variant="filter"
|
|
136
|
+
label="${this.lang==="en"?"Table":"Tabell"}"
|
|
137
|
+
icon="table"
|
|
138
|
+
?selected=${this.selectedChip==="Table"}
|
|
139
|
+
@selected-changed=${()=>this._onChipSelect("Table")}
|
|
140
|
+
></scb-chip>
|
|
141
|
+
</div>
|
|
142
|
+
`:""}
|
|
143
|
+
<div class="content">
|
|
144
|
+
<scb-horizontal-scroller width="600px" class="diagram-scroller" variant="inline" show-scrollbar>
|
|
145
|
+
<slot name="diagram"></slot>
|
|
146
|
+
</scb-horizontal-scroller>
|
|
147
|
+
<scb-horizontal-scroller width="600px" class="table-scroller" variant="inline" show-scrollbar>
|
|
148
|
+
<slot name="table"></slot>
|
|
149
|
+
</scb-horizontal-scroller>
|
|
150
|
+
</div>
|
|
151
|
+
<div class="footer">
|
|
152
|
+
<div class="description section">
|
|
153
|
+
<div class="secondary-label">${this.descriptionLabel}</div>
|
|
154
|
+
${this.description?t`<div>${this.description}</div>`:""}
|
|
155
|
+
</div>
|
|
156
|
+
<scb-divider></scb-divider>
|
|
157
|
+
<scb-accordion>
|
|
158
|
+
<scb-accordion-item
|
|
159
|
+
title="${this.moreAboutStatsLabel}"
|
|
160
|
+
>
|
|
161
|
+
<div class="more-about-stats-content">
|
|
162
|
+
<div class="section">
|
|
163
|
+
<div class="secondary-label">${this.commentLabel}</div>
|
|
164
|
+
${this.comment?t`<div>${this.comment}</div>`:""}
|
|
165
|
+
</div>
|
|
166
|
+
<div class="section">
|
|
167
|
+
<div class="secondary-label">${this.sourceLabel}</div>
|
|
168
|
+
${this.source?t`<div>${this.source}</div>`:""}
|
|
169
|
+
</div>
|
|
170
|
+
<div class="section">
|
|
171
|
+
<div class="secondary-label">${this.footnoteLabel}</div>
|
|
172
|
+
${this.footnote?t`<div>${this.footnote}</div>`:""}
|
|
173
|
+
</div>
|
|
174
|
+
</div>
|
|
175
|
+
</scb-accordion-item>
|
|
176
|
+
</scb-accordion>
|
|
177
|
+
</div>
|
|
178
|
+
<slot></slot>
|
|
179
|
+
</div>
|
|
180
|
+
`}}_onChipSelect(e){this.selectedChip=e}};l.styles=v`
|
|
181
|
+
:host {
|
|
182
|
+
display: block;
|
|
183
|
+
font-family: var(--brand-font);
|
|
184
|
+
color: var(--md-sys-color-on-surface);
|
|
185
|
+
background: var(--md-sys-color-surface);
|
|
186
|
+
padding: 24px;
|
|
187
|
+
max-width: 100%;
|
|
188
|
+
border-radius: var(--spacing-04, 16px);
|
|
189
|
+
border: 1px solid var(--md-sys-color-outline-variant);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.label {
|
|
193
|
+
font-size: var(--md-sys-typescale-title-large-size);
|
|
194
|
+
font-weight: var(--weight-semibold);
|
|
195
|
+
line-height: var(--md-sys-typescale-title-large-line-height);
|
|
196
|
+
letter-spacing: var(--md-sys-typescale-title-large-tracking);
|
|
197
|
+
}
|
|
198
|
+
.sub-label{
|
|
199
|
+
font-size: var(--md-sys-typescale-body-large-size);
|
|
200
|
+
line-height: var(--md-sys-typescale-body-large-line-height);
|
|
201
|
+
letter-spacing: var(--md-sys-typescale-body-large-tracking);
|
|
202
|
+
}
|
|
203
|
+
.secondary-label {
|
|
204
|
+
font-size: var(--md-sys-typescale-title-medium-size);
|
|
205
|
+
font-weight: var(--weight-semibold);
|
|
206
|
+
line-height: var(--md-sys-typescale-title-medium-line-height);
|
|
207
|
+
letter-spacing: var(--md-sys-typescale-title-medium-tracking);
|
|
208
|
+
}
|
|
209
|
+
.section {
|
|
210
|
+
display: flex;
|
|
211
|
+
flex-direction: column;
|
|
212
|
+
gap: 4px;
|
|
213
|
+
}
|
|
214
|
+
.more-about-stats-content {
|
|
215
|
+
display: flex;
|
|
216
|
+
flex-direction: column;
|
|
217
|
+
gap: 24px;
|
|
218
|
+
max-width: 600px
|
|
219
|
+
}
|
|
220
|
+
.header {
|
|
221
|
+
margin-bottom: 24px;
|
|
222
|
+
max-width: 600px
|
|
223
|
+
}
|
|
224
|
+
.flipp-wrapper {
|
|
225
|
+
margin-bottom: 40px;
|
|
226
|
+
max-width: 600px
|
|
227
|
+
}
|
|
228
|
+
.description{
|
|
229
|
+
margin-bottom: 32px;
|
|
230
|
+
}
|
|
231
|
+
.footer {
|
|
232
|
+
margin-top: 24px;
|
|
233
|
+
|
|
234
|
+
}
|
|
235
|
+
.description.section{
|
|
236
|
+
max-width: 600px
|
|
237
|
+
}
|
|
238
|
+
.table-scroller,
|
|
239
|
+
.diagram-scroller {
|
|
240
|
+
display: none;
|
|
241
|
+
}
|
|
242
|
+
:host([variant='Table']) slot[name="table"] {
|
|
243
|
+
display: block;
|
|
244
|
+
}
|
|
245
|
+
:host([variant='Table']) .table-scroller {
|
|
246
|
+
display: flex;
|
|
247
|
+
}
|
|
248
|
+
:host([variant='Diagram']) slot[name="diagram"] {
|
|
249
|
+
display: block;
|
|
250
|
+
}
|
|
251
|
+
:host([variant='Diagram']) .diagram-scroller {
|
|
252
|
+
display: flex;
|
|
253
|
+
}
|
|
254
|
+
:host([variant='Image']) {
|
|
255
|
+
img {
|
|
256
|
+
height: auto;
|
|
257
|
+
max-width: 100%;
|
|
258
|
+
}
|
|
259
|
+
slot[name="table"] {
|
|
260
|
+
display: none;
|
|
261
|
+
}
|
|
262
|
+
slot[name="diagram"] {
|
|
263
|
+
display: none;
|
|
264
|
+
}
|
|
265
|
+
.image-content {
|
|
266
|
+
display: block;
|
|
267
|
+
}
|
|
268
|
+
.diagram-scroller {
|
|
269
|
+
display: none;
|
|
270
|
+
}
|
|
271
|
+
.table-scroller {
|
|
272
|
+
display: none;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
:host([variant='Standard'].chip-diagram) .diagram-scroller {
|
|
277
|
+
display: flex;
|
|
278
|
+
}
|
|
279
|
+
:host([variant='Standard'].chip-table) .table-scroller {
|
|
280
|
+
display: flex;
|
|
281
|
+
}
|
|
282
|
+
:host([variant='Standard'].chip-table) slot[name="table"] {
|
|
283
|
+
display: block;
|
|
284
|
+
}
|
|
285
|
+
:host([variant='Standard'].chip-table) slot[name="diagram"] {
|
|
286
|
+
display: none;
|
|
287
|
+
}
|
|
288
|
+
:host([variant='Standard'].chip-diagram) slot[name="table"] {
|
|
289
|
+
display: none;
|
|
290
|
+
}
|
|
291
|
+
:host([variant='Standard'].chip-diagram) slot[name="diagram"] {
|
|
292
|
+
display: block;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
`;o([r({type:String,reflect:!0})],l.prototype,"variant",2);o([r({type:String})],l.prototype,"selectedChip",2);o([r({type:String,reflect:!0})],l.prototype,"title",2);o([r({type:String,reflect:!0})],l.prototype,"subtitle",2);o([r({type:String,reflect:!0})],l.prototype,"description",2);o([r({type:String,reflect:!0})],l.prototype,"comment",2);o([r({type:String,reflect:!0})],l.prototype,"source",2);o([r({type:String,reflect:!0})],l.prototype,"footnote",2);o([r({type:String,reflect:!0,attribute:"lang"})],l.prototype,"lang",2);o([r({type:String,reflect:!0,attribute:"image-href"})],l.prototype,"imageHref",2);l=o([b("scb-viz")],l);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scb-wc-test",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.82",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|
|
@@ -302,7 +302,11 @@
|
|
|
302
302
|
"import": "./scb-tooltip/scb-tooltip.js",
|
|
303
303
|
"require": "./scb-tooltip/scb-tooltip.js"
|
|
304
304
|
},
|
|
305
|
+
"./scb-viz": {
|
|
306
|
+
"import": "./scb-viz/scb-viz.js",
|
|
307
|
+
"require": "./scb-viz/scb-viz.js"
|
|
308
|
+
},
|
|
305
309
|
"./mvc/*": "./mvc/*"
|
|
306
310
|
},
|
|
307
|
-
"buildHash": "
|
|
311
|
+
"buildHash": "37CAAE84B349D9CD4B9BB7EE3F53B2CF2D153AFF2617FAAA179B2801305FCFBA"
|
|
308
312
|
}
|
package/scb-chip/scb-chip.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { css as n, LitElement as p, html as o } from "lit";
|
|
2
2
|
import { property as i, customElement as f } from "lit/decorators.js";
|
|
3
|
-
var m = Object.defineProperty,
|
|
4
|
-
for (var r = l > 1 ? void 0 : l ?
|
|
3
|
+
var m = Object.defineProperty, u = Object.getOwnPropertyDescriptor, s = (e, a, d, l) => {
|
|
4
|
+
for (var r = l > 1 ? void 0 : l ? u(a, d) : a, c = e.length - 1, h; c >= 0; c--)
|
|
5
5
|
(h = e[c]) && (r = (l ? h(a, d, r) : h(r)) || r);
|
|
6
6
|
return l && r && m(a, d, r), r;
|
|
7
7
|
};
|
|
@@ -116,13 +116,8 @@ t.styles = n`
|
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
md-icon {
|
|
119
|
-
color: var(--
|
|
120
|
-
font-size: var(--
|
|
121
|
-
}
|
|
122
|
-
@media (prefers-color-scheme: dark) {
|
|
123
|
-
md-icon {
|
|
124
|
-
color: var(--md-sys-color-on-surface);
|
|
125
|
-
}
|
|
119
|
+
color: var(--md-sys-color-on-surface);
|
|
120
|
+
font-size: var(--md-sys-typescale-body-large-size);
|
|
126
121
|
}
|
|
127
122
|
`;
|
|
128
123
|
s([
|
|
@@ -7,6 +7,7 @@ export declare class ScbHorizontalScroller extends LitElement {
|
|
|
7
7
|
showScrollbar: boolean;
|
|
8
8
|
rightScrollButtonLabel: string;
|
|
9
9
|
leftScrollButtonLabel: string;
|
|
10
|
+
contentFlex: boolean;
|
|
10
11
|
static styles: import('lit').CSSResult;
|
|
11
12
|
private doScrollBy;
|
|
12
13
|
private get canScrollLeft();
|