scb-wc-test 0.1.104 → 0.1.106
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-accordion/scb-accordion.js +8 -2
- package/mvc/components/scb-avatar/scb-avatar.js +19 -10
- package/mvc/components/scb-breadcrumb/scb-breadcrumb-item.js +2 -3
- package/mvc/components/scb-breadcrumb/scb-breadcrumb.js +13 -7
- package/mvc/components/scb-button/scb-button.js +34 -32
- package/mvc/components/scb-calendar-card/scb-calendar-card.js +13 -11
- package/mvc/components/scb-card/scb-card.js +44 -41
- package/mvc/components/scb-checkbox/scb-checkbox-group.js +15 -13
- package/mvc/components/scb-checkbox/scb-checkbox.js +6 -6
- package/mvc/components/scb-chip/scb-chip.js +27 -7
- package/mvc/components/scb-divider/scb-divider.js +41 -15
- package/mvc/components/scb-fact-card/scb-fact-card.js +37 -18
- package/mvc/components/scb-horizontal-scroller/scb-horizontal-scroller.js +71 -43
- package/mvc/components/scb-icon-button/scb-icon-button.js +15 -10
- package/mvc/components/scb-keyfigure-card/scb-keyfigure-card.js +6 -4
- package/mvc/components/scb-list/scb-list.js +3 -3
- package/mvc/components/scb-notification-card/scb-notification-card.js +5 -5
- package/mvc/components/scb-pagination/scb-pagination.js +165 -107
- package/mvc/components/scb-radio-button/scb-radio-group.js +22 -11
- package/mvc/components/scb-search/scb-search.js +84 -32
- package/mvc/components/scb-segmented-button/scb-segmented-button.js +3 -2
- package/mvc/components/scb-select/scb-select-option.js +3 -3
- package/mvc/components/scb-select/scb-select.js +3 -3
- package/mvc/components/scb-status-pill/scb-status-pill.js +17 -13
- package/mvc/components/scb-stepper/scb-stepper.js +32 -29
- package/mvc/components/scb-switch/scb-switch.js +11 -8
- package/mvc/components/scb-tabs/scb-tabs.js +22 -19
- package/mvc/components/scb-textfield/scb-textfield.js +14 -10
- package/mvc/components/scb-toc/scb-toc.js +6 -3
- package/mvc/components/scb-viz/scb-viz.js +188 -178
- package/package.json +2 -2
- package/scb-accordion/scb-accordion.d.ts +13 -0
- package/scb-accordion/scb-accordion.js +53 -21
- package/scb-avatar/scb-avatar.d.ts +6 -0
- package/scb-avatar/scb-avatar.js +96 -61
- package/scb-breadcrumb/scb-breadcrumb-item.js +8 -9
- package/scb-breadcrumb/scb-breadcrumb.d.ts +6 -0
- package/scb-breadcrumb/scb-breadcrumb.js +61 -30
- package/scb-button/scb-button.d.ts +10 -0
- package/scb-button/scb-button.js +89 -65
- package/scb-calendar-card/scb-calendar-card.d.ts +5 -0
- package/scb-calendar-card/scb-calendar-card.js +79 -55
- package/scb-card/scb-card.d.ts +5 -0
- package/scb-card/scb-card.js +165 -140
- package/scb-checkbox/scb-checkbox-group.d.ts +3 -1
- package/scb-checkbox/scb-checkbox-group.js +59 -40
- package/scb-checkbox/scb-checkbox.d.ts +11 -0
- package/scb-checkbox/scb-checkbox.js +78 -56
- package/scb-chip/scb-chip.d.ts +24 -0
- package/scb-chip/scb-chip.js +137 -65
- package/scb-divider/scb-divider.d.ts +14 -0
- package/scb-divider/scb-divider.js +91 -43
- package/scb-fact-card/scb-fact-card.d.ts +10 -0
- package/scb-fact-card/scb-fact-card.js +135 -94
- package/scb-horizontal-scroller/scb-horizontal-scroller.d.ts +10 -0
- package/scb-horizontal-scroller/scb-horizontal-scroller.js +179 -120
- package/scb-icon-button/scb-icon-button.d.ts +6 -1
- package/scb-icon-button/scb-icon-button.js +81 -59
- package/scb-keyfigure-card/scb-keyfigure-card.d.ts +10 -0
- package/scb-keyfigure-card/scb-keyfigure-card.js +76 -52
- package/scb-list/scb-list.d.ts +7 -1
- package/scb-list/scb-list.js +62 -40
- package/scb-notification-card/scb-notification-card.d.ts +5 -0
- package/scb-notification-card/scb-notification-card.js +56 -39
- package/scb-pagination/scb-pagination.d.ts +12 -1
- package/scb-pagination/scb-pagination.js +235 -147
- package/scb-radio-button/scb-radio-group.d.ts +14 -3
- package/scb-radio-button/scb-radio-group.js +120 -67
- package/scb-search/scb-search.d.ts +15 -2
- package/scb-search/scb-search.js +152 -69
- package/scb-segmented-button/scb-segmented-button.d.ts +41 -4
- package/scb-segmented-button/scb-segmented-button.js +145 -61
- package/scb-select/scb-select-option.js +3 -3
- package/scb-select/scb-select.js +26 -26
- package/scb-status-pill/scb-status-pill.d.ts +12 -1
- package/scb-status-pill/scb-status-pill.js +51 -27
- package/scb-stepper/scb-stepper.d.ts +11 -3
- package/scb-stepper/scb-stepper.js +134 -101
- package/scb-switch/scb-switch.d.ts +21 -2
- package/scb-switch/scb-switch.js +97 -45
- package/scb-tabs/scb-tabs.d.ts +8 -0
- package/scb-tabs/scb-tabs.js +74 -44
- package/scb-textfield/scb-textfield.d.ts +7 -0
- package/scb-textfield/scb-textfield.js +43 -16
- package/scb-toc/scb-toc.d.ts +10 -1
- package/scb-toc/scb-toc.js +49 -18
- package/scb-viz/scb-viz.d.ts +10 -3
- package/scb-viz/scb-viz.js +278 -236
- package/scb-wc-test.bundle.js +1177 -896
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as m,n as a,i as x,x as h,t as v}from"../../vendor/vendor.js";import"../../vendor/vendor-material.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(i,l,o){try{customElements.get(i)||e(i,l,o)}catch(c){var d=String(c||"");if(d.indexOf("already been used")===-1&&d.indexOf("NotSupportedError")===-1)throw c}}}}catch{}})();var y=Object.defineProperty,g=Object.getOwnPropertyDescriptor,f=t=>{throw TypeError(t)},r=(t,e,i,l)=>{for(var o=l>1?void 0:l?g(e,i):e,d=t.length-1,c;d>=0;d--)(c=t[d])&&(o=(l?c(e,i,o):c(o))||o);return l&&o&&y(e,i,o),o},_=(t,e,i)=>e.has(t)||f("Cannot "+i),w=(t,e,i)=>e.has(t)?f("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),p=(t,e,i)=>(_(t,e,"access private method"),i),n,b,u;let s=class extends x{constructor(){super(),w(this,n),this._internals=null,this.type="text",this.label="",this.supportingText="",this.errorText="",this.leadingIcon="",this.name="",this.pattern="",this.value="",this.underLabel="",this.error=!1,this.disabled=!1,this.required=!1,this.spacing="",this.spacingTop="",this.spacingBottom="",this._form=null,this._formSubmitHandler=null,this._formResetHandler=null,this._initialValue="",this._inputId="","attachInternals"in this&&(this._internals=this.attachInternals())}render(){const t=this.leadingIcon?h`<md-icon class="scb-textfield-icon">${this.leadingIcon}</md-icon>`:null,e=this.error?h`<md-icon class="scb-textfield-error-icon" aria-hidden="true">error</md-icon>`:null;this.underLabel=this.error?this.errorText||"Ogiltig inmatning.":this.supportingText,this.value=this.value||"";const i=this.underLabel?`${this._inputId}-supporting-text`:void 0,l=this.type==="search"&&this.value?h`
|
|
2
2
|
<button
|
|
3
3
|
type="button"
|
|
4
4
|
class="scb-textfield-clear"
|
|
@@ -32,7 +32,7 @@ import{a as h,n as l,i as u,x as c,t as p}from"../../vendor/vendor.js";import"..
|
|
|
32
32
|
></line>
|
|
33
33
|
</svg>
|
|
34
34
|
</button>
|
|
35
|
-
`:null;return this.type==="textarea"?
|
|
35
|
+
`:null;return this.type==="textarea"?h`
|
|
36
36
|
<label class="scb-textfield-label" for="${this._inputId}">${this.label}</label>
|
|
37
37
|
<span
|
|
38
38
|
class="scb-textfield-supporting-text"
|
|
@@ -47,12 +47,12 @@ import{a as h,n as l,i as u,x as c,t as p}from"../../vendor/vendor.js";import"..
|
|
|
47
47
|
id="${this._inputId}"
|
|
48
48
|
?required=${this.required}
|
|
49
49
|
aria-invalid=${this.error?"true":"false"}
|
|
50
|
-
aria-describedby=${
|
|
50
|
+
aria-describedby=${i}
|
|
51
51
|
>
|
|
52
52
|
${this.value}</textarea
|
|
53
53
|
>
|
|
54
54
|
</div>
|
|
55
|
-
`:
|
|
55
|
+
`:h`
|
|
56
56
|
<label class="scb-textfield-label" for="${this._inputId}">${this.label}</label>
|
|
57
57
|
<span
|
|
58
58
|
class="scb-textfield-supporting-text"
|
|
@@ -60,7 +60,7 @@ ${this.value}</textarea
|
|
|
60
60
|
>${this.underLabel}</span
|
|
61
61
|
>
|
|
62
62
|
<div class="scb-textfield-wrapper">
|
|
63
|
-
${
|
|
63
|
+
${t}
|
|
64
64
|
<input
|
|
65
65
|
class="scb-textfield${this.error?" has-error-icon":""}"
|
|
66
66
|
.value=${this.value}
|
|
@@ -70,12 +70,12 @@ ${this.value}</textarea
|
|
|
70
70
|
?disabled=${this.disabled}
|
|
71
71
|
?required=${this.required}
|
|
72
72
|
aria-invalid=${this.error?"true":"false"}
|
|
73
|
-
aria-describedby=${
|
|
73
|
+
aria-describedby=${i}
|
|
74
74
|
/>
|
|
75
|
-
${
|
|
76
|
-
${
|
|
75
|
+
${l}
|
|
76
|
+
${e}
|
|
77
77
|
</div>
|
|
78
|
-
`}firstUpdated(
|
|
78
|
+
`}firstUpdated(t){super.firstUpdated(t),this._initialValue=this.value;const e=this.shadowRoot?.querySelector(".scb-textfield");e&&(e.addEventListener("input",()=>{const i=e;if(this.value=i.value,this._internals){const l=this.disabled?null:this.value;this._internals.setFormValue(l)}if(this.pattern){const l=new RegExp(this.pattern);this.error=!l.test(this.value)}this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("onValueChanged",{detail:{value:this.value},bubbles:!0,composed:!0}))}),e.addEventListener("change",()=>{this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}),e.addEventListener("select",()=>{this.dispatchEvent(new Event("select",{bubbles:!0,composed:!0}))})),p(this,n,b).call(this)}updated(t){if(super.updated(t),this.toggleAttribute("aria-disabled",this.disabled),this._internals&&(t.has("value")||t.has("disabled"))){const e=this.disabled?null:this.value;this._internals.setFormValue(e)}(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom"))&&p(this,n,b).call(this)}formDisabledCallback(t){this.disabled=t}connectedCallback(){super.connectedCallback(),this._inputId=this.id||`scb-textfield-${Math.random().toString(36).substr(2,9)}`,this._formSubmitHandler=t=>{this.reportValidity()||(t.preventDefault(),t.stopPropagation())},this._form=this.closest("form"),this._form&&(this._form.addEventListener("submit",this._formSubmitHandler,!0),this._formResetHandler=()=>{this.value=this._initialValue;const t=this.shadowRoot?.querySelector(".scb-textfield");t&&(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)&&(t.value=this._initialValue),this.error=!1},this._form.addEventListener("reset",this._formResetHandler,!0))}disconnectedCallback(){super.disconnectedCallback(),this._form&&this._formSubmitHandler&&(this._form.removeEventListener("submit",this._formSubmitHandler,!0),this._formResetHandler&&this._form.removeEventListener("reset",this._formResetHandler,!0))}reportValidity(){const t=this.shadowRoot?.querySelector(".scb-textfield");if(t&&(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)){this.required&&!t.value?t.setCustomValidity(this.errorText||"Ogiltig inmatning."):t.setCustomValidity("");const e=t.reportValidity();this.error=!e;const i=e?"":this.errorText||t.validationMessage||"Ogiltig inmatning.";return e||(this.errorText=i),this._internals&&(e?this._internals.setValidity({}):this._internals.setValidity({customError:!0},i,t)),e}return!0}_onClearClick(){const t=this.shadowRoot?.querySelector(".scb-textfield");if(t&&(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)){if(t.value="",this.value="",this._internals){const e=this.disabled?null:this.value;this._internals.setFormValue(e),this._internals.setValidity({})}this.error=!1,t.setCustomValidity(""),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("onValueChanged",{detail:{value:this.value},bubbles:!0,composed:!0})),t.focus()}}};n=new WeakSet;b=function(){const t=p(this,n,u).call(this,this.spacing),e=p(this,n,u).call(this,this.spacingTop)??t,i=p(this,n,u).call(this,this.spacingBottom)??t;e?this.style.setProperty("--scb-textfield-spacing-block-start",e):this.style.removeProperty("--scb-textfield-spacing-block-start"),i?this.style.setProperty("--scb-textfield-spacing-block-end",i):this.style.removeProperty("--scb-textfield-spacing-block-end")};u=function(t){if(!t)return;const e=String(t).trim();if(e)return/^\d+$/.test(e)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(e,10)))})`:e};s.formAssociated=!0;s.styles=[m`
|
|
79
79
|
:host {
|
|
80
80
|
--scb-textfield-number-max-width: 280px;
|
|
81
81
|
--scb-textfield-text-max-width: 400px;
|
|
@@ -87,6 +87,10 @@ ${this.value}</textarea
|
|
|
87
87
|
--scb-textfield-textarea-max-width: 600px;
|
|
88
88
|
font-family: var(--brand-font);
|
|
89
89
|
color: var(--md-sys-color-on-surface);
|
|
90
|
+
|
|
91
|
+
/* Vertikalt avstånd styrs av spacing-attributen via CSS-variabler */
|
|
92
|
+
margin-block-start: var(--scb-textfield-spacing-block-start, 0);
|
|
93
|
+
margin-block-end: var(--scb-textfield-spacing-block-end, 0);
|
|
90
94
|
}
|
|
91
95
|
|
|
92
96
|
:host([type='number']) {
|
|
@@ -248,4 +252,4 @@ ${this.value}</textarea
|
|
|
248
252
|
height: 100%;
|
|
249
253
|
display: block;
|
|
250
254
|
}
|
|
251
|
-
`];r([
|
|
255
|
+
`];r([a({type:String,reflect:!0})],s.prototype,"type",2);r([a({type:String})],s.prototype,"label",2);r([a({type:String,attribute:"supporting-text"})],s.prototype,"supportingText",2);r([a({type:String,attribute:"error-text"})],s.prototype,"errorText",2);r([a({type:String,attribute:"leading-icon"})],s.prototype,"leadingIcon",2);r([a({type:String})],s.prototype,"name",2);r([a({type:String})],s.prototype,"pattern",2);r([a({type:String,attribute:"value"})],s.prototype,"value",2);r([a({type:String})],s.prototype,"underLabel",2);r([a({type:Boolean,reflect:!0})],s.prototype,"error",2);r([a({type:Boolean,reflect:!0})],s.prototype,"disabled",2);r([a({type:Boolean,reflect:!0})],s.prototype,"required",2);r([a({type:String,reflect:!0})],s.prototype,"spacing",2);r([a({type:String,attribute:"spacing-top",reflect:!0})],s.prototype,"spacingTop",2);r([a({type:String,attribute:"spacing-bottom",reflect:!0})],s.prototype,"spacingBottom",2);s=r([v("scb-textfield")],s);
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import{a,n as
|
|
1
|
+
import{a as _,n as h,i as g,x as b,t as v}from"../../vendor/vendor.js";import"./scb-toc-item.js";import"../scb-icon-button/scb-icon-button.js";import"../../vendor/preload-helper.js";import"../../vendor/vendor-material.js";import"../scb-divider/scb-divider.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var s=customElements.define.bind(customElements);customElements.define=function(e,o,i){try{customElements.get(e)||s(e,o,i)}catch(n){var c=String(n||"");if(c.indexOf("already been used")===-1&&c.indexOf("NotSupportedError")===-1)throw n}}}}catch{}})();var m=Object.defineProperty,y=Object.getOwnPropertyDescriptor,u=t=>{throw TypeError(t)},l=(t,s,e,o)=>{for(var i=o>1?void 0:o?y(s,e):s,c=t.length-1,n;c>=0;c--)(n=t[c])&&(i=(o?n(s,e,i):n(i))||i);return o&&i&&m(s,e,i),i},S=(t,s,e)=>s.has(t)||u("Cannot "+e),k=(t,s,e)=>s.has(t)?u("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(t):s.set(t,e),p=(t,s,e)=>(S(t,s,"access private method"),e),r,f,d;let a=class extends g{constructor(){super(...arguments),k(this,r),this.detached=!1,this.spacing="",this.spacingTop="",this.spacingBottom=""}firstUpdated(t){p(this,r,f).call(this)}updated(t){super.updated(t),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom"))&&p(this,r,f).call(this)}render(){return b`
|
|
2
2
|
<div class="scb-toc-list" role="list">
|
|
3
3
|
<slot></slot>
|
|
4
4
|
</div>
|
|
5
|
-
`}};
|
|
5
|
+
`}};r=new WeakSet;f=function(){const t=p(this,r,d).call(this,this.spacing),s=p(this,r,d).call(this,this.spacingTop)??t,e=p(this,r,d).call(this,this.spacingBottom)??t;s?this.style.setProperty("--scb-toc-spacing-block-start",s):this.style.removeProperty("--scb-toc-spacing-block-start"),e?this.style.setProperty("--scb-toc-spacing-block-end",e):this.style.removeProperty("--scb-toc-spacing-block-end")};d=function(t){if(!t)return;const s=String(t).trim();if(s)return/^\d+$/.test(s)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(s,10)))})`:s};a.styles=[_`
|
|
6
6
|
:host {
|
|
7
7
|
display: block;
|
|
8
|
+
/* Vertikalt avstånd styrs av spacing-attributen via CSS-variabler */
|
|
9
|
+
margin-block-start: var(--scb-toc-spacing-block-start, 0);
|
|
10
|
+
margin-block-end: var(--scb-toc-spacing-block-end, 0);
|
|
8
11
|
}
|
|
9
12
|
|
|
10
13
|
.scb-toc-list {
|
|
11
14
|
display: block;
|
|
12
15
|
}
|
|
13
|
-
`];
|
|
16
|
+
`];l([h({type:Boolean,reflect:!0})],a.prototype,"detached",2);l([h({type:String,reflect:!0})],a.prototype,"spacing",2);l([h({type:String,attribute:"spacing-top",reflect:!0})],a.prototype,"spacingTop",2);l([h({type:String,attribute:"spacing-bottom",reflect:!0})],a.prototype,"spacingBottom",2);a=l([v("scb-toc")],a);
|
|
@@ -1,184 +1,183 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as g,n as c,i as u,x as i,t as y}from"../../vendor/vendor.js";import"../scb-chip/scb-chip.js";import"../scb-segmented-button/scb-segmented-button.js";import"../scb-segmented-button/scb-segmented-item.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"../../vendor/vendor-material.js";import"../scb-accordion/scb-accordion-item.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-button/scb-button.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(s,n,a){try{customElements.get(s)||e(s,n,a)}catch(d){var o=String(d||"");if(o.indexOf("already been used")===-1&&o.indexOf("NotSupportedError")===-1)throw d}}}}catch{}})();var f=Object.defineProperty,$=Object.getOwnPropertyDescriptor,m=t=>{throw TypeError(t)},l=(t,e,s,n)=>{for(var a=n>1?void 0:n?$(e,s):e,o=t.length-1,d;o>=0;o--)(d=t[o])&&(a=(n?d(e,s,a):d(a))||a);return n&&a&&f(e,s,a),a},S=(t,e,s)=>e.has(t)||m("Cannot "+s),_=(t,e,s)=>e.has(t)?m("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s),p=(t,e,s)=>(S(t,e,"access private method"),s),h,b,v;let r=class extends u{constructor(){super(...arguments),_(this,h),this.variant="Standard",this.selectedChip="Diagram",this.title="",this.subtitle="",this.description="",this.comment="",this.source="",this.footnote="",this.lang="sv",this.imageHref="",this.spacing="",this.spacingTop="",this.spacingBottom=""}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(t){const e=this.shadowRoot?.querySelector('slot[name="table"]');e&&(e.addEventListener("slotchange",()=>this._styleSlottedTable()),this._styleSlottedTable()),p(this,h,b).call(this)}updated(t){super.updated(t),this._styleSlottedTable(),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom"))&&p(this,h,b).call(this)}_styleSlottedTable(){const t=this.shadowRoot?.querySelector('slot[name="table"]');if(!t)return;t.assignedElements({flatten:!0}).forEach(s=>{if(s.tagName==="TABLE"){const n=s;n.style.borderCollapse="collapse",n.style.width="100%",s.querySelectorAll("tbody tr:nth-child(odd)").forEach(a=>{a.style.background="var(--md-sys-color-surface-container)"}),s.querySelectorAll("th").forEach(a=>{const o=a;o.style.border="1px solid var(--md-sys-color-on-surface)",o.style.padding="8px"}),s.querySelectorAll("td").forEach(a=>{const o=a;o.style.border="1px solid var(--md-sys-color-on-surface)",o.style.padding="8px"}),s.querySelectorAll("tr").forEach(a=>{const o=Array.from(a.children).filter(d=>d.tagName==="TD"||d.tagName==="TH");o.length>0&&(o[0].style.borderLeft="none",o[o.length-1].style.borderRight="none")})}})}render(){switch(this.variant){case"Table":return i`
|
|
2
2
|
<div part="container">
|
|
3
3
|
<div class="header">
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
${this.subtitle?t`
|
|
7
|
-
<div class="subtitle">${this.subtitle}</div>`:""}
|
|
4
|
+
${this.title?i` <div class="label">${this.title}</div> `:""}
|
|
5
|
+
${this.subtitle?i` <div class="subtitle">${this.subtitle}</div> `:""}
|
|
8
6
|
</div>
|
|
9
7
|
<div class="content">
|
|
10
|
-
<scb-horizontal-scroller
|
|
8
|
+
<scb-horizontal-scroller
|
|
9
|
+
width="600px"
|
|
10
|
+
class="table-scroller"
|
|
11
|
+
variant="inline"
|
|
12
|
+
show-scrollbar
|
|
13
|
+
>
|
|
11
14
|
<slot name="table"></slot>
|
|
12
15
|
</scb-horizontal-scroller>
|
|
13
16
|
</div>
|
|
14
17
|
<div class="footer">
|
|
15
|
-
${this.description?
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
</div>
|
|
20
|
-
`:""}
|
|
21
|
-
${this.comment||this.source||this.footnote?t`
|
|
22
|
-
<scb-divider></scb-divider>
|
|
23
|
-
<scb-accordion>
|
|
24
|
-
<scb-accordion-item
|
|
25
|
-
title="${this.moreAboutStatsLabel}"
|
|
26
|
-
>
|
|
27
|
-
<div class="more-about-stats-content">
|
|
28
|
-
${this.comment?t`
|
|
29
|
-
<div class="section">
|
|
30
|
-
<div class="secondary-label">${this.commentLabel}</div>
|
|
31
|
-
<div>${this.comment}</div>
|
|
18
|
+
${this.description?i`
|
|
19
|
+
<div class="description section">
|
|
20
|
+
<div class="secondary-label">${this.descriptionLabel}</div>
|
|
21
|
+
<div>${this.description}</div>
|
|
32
22
|
</div>
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
<div
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
23
|
+
`:""}
|
|
24
|
+
${this.comment||this.source||this.footnote?i`
|
|
25
|
+
<scb-divider></scb-divider>
|
|
26
|
+
<scb-accordion>
|
|
27
|
+
<scb-accordion-item title="${this.moreAboutStatsLabel}">
|
|
28
|
+
<div class="more-about-stats-content">
|
|
29
|
+
${this.comment?i`
|
|
30
|
+
<div class="section">
|
|
31
|
+
<div class="secondary-label">${this.commentLabel}</div>
|
|
32
|
+
<div>${this.comment}</div>
|
|
33
|
+
</div>
|
|
34
|
+
`:""}
|
|
35
|
+
${this.source?i`
|
|
36
|
+
<div class="section">
|
|
37
|
+
<div class="secondary-label">${this.sourceLabel}</div>
|
|
38
|
+
<div>${this.source}</div>
|
|
39
|
+
</div>
|
|
40
|
+
`:""}
|
|
41
|
+
${this.footnote?i`
|
|
42
|
+
<div class="section">
|
|
43
|
+
<div class="secondary-label">${this.footnoteLabel}</div>
|
|
44
|
+
<div>${this.footnote}</div>
|
|
45
|
+
</div>
|
|
46
|
+
`:""}
|
|
47
|
+
</div>
|
|
48
|
+
</scb-accordion-item>
|
|
49
|
+
</scb-accordion>
|
|
50
|
+
`:""}
|
|
50
51
|
</div>
|
|
51
52
|
<slot></slot>
|
|
52
53
|
</div>
|
|
53
|
-
`;case"Image":return
|
|
54
|
+
`;case"Image":return i`
|
|
54
55
|
<div part="container">
|
|
55
56
|
<div class="header">
|
|
56
|
-
${this.title?
|
|
57
|
-
|
|
58
|
-
`:""}
|
|
59
|
-
${this.subtitle?t`
|
|
60
|
-
<div class="subtitle">${this.subtitle}</div>
|
|
61
|
-
`:""}
|
|
57
|
+
${this.title?i` <div class="label">${this.title}</div> `:""}
|
|
58
|
+
${this.subtitle?i` <div class="subtitle">${this.subtitle}</div> `:""}
|
|
62
59
|
</div>
|
|
63
60
|
<div class="content image-content">
|
|
64
|
-
<img src="${this.imageHref}" alt="Image figure"/>
|
|
61
|
+
<img src="${this.imageHref}" alt="Image figure" />
|
|
65
62
|
</div>
|
|
66
63
|
<div class="footer">
|
|
67
|
-
${this.description?
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
</div>
|
|
72
|
-
`:""}
|
|
73
|
-
${this.comment||this.source||this.footnote?t`
|
|
74
|
-
<scb-divider></scb-divider>
|
|
75
|
-
<scb-accordion>
|
|
76
|
-
<scb-accordion-item
|
|
77
|
-
title="${this.moreAboutStatsLabel}"
|
|
78
|
-
>
|
|
79
|
-
<div class="more-about-stats-content">
|
|
80
|
-
${this.comment?t`
|
|
81
|
-
<div class="section">
|
|
82
|
-
<div class="secondary-label">${this.commentLabel}</div>
|
|
83
|
-
<div>${this.comment}</div>
|
|
64
|
+
${this.description?i`
|
|
65
|
+
<div class="description section">
|
|
66
|
+
<div class="secondary-label">${this.descriptionLabel}</div>
|
|
67
|
+
<div>${this.description}</div>
|
|
84
68
|
</div>
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
<
|
|
88
|
-
|
|
89
|
-
<
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
69
|
+
`:""}
|
|
70
|
+
${this.comment||this.source||this.footnote?i`
|
|
71
|
+
<scb-divider></scb-divider>
|
|
72
|
+
<scb-accordion>
|
|
73
|
+
<scb-accordion-item title="${this.moreAboutStatsLabel}">
|
|
74
|
+
<div class="more-about-stats-content">
|
|
75
|
+
${this.comment?i`
|
|
76
|
+
<div class="section">
|
|
77
|
+
<div class="secondary-label">${this.commentLabel}</div>
|
|
78
|
+
<div>${this.comment}</div>
|
|
79
|
+
</div>
|
|
80
|
+
`:""}
|
|
81
|
+
${this.source?i`
|
|
82
|
+
<div class="section">
|
|
83
|
+
<div class="secondary-label">${this.sourceLabel}</div>
|
|
84
|
+
<div>${this.source}</div>
|
|
85
|
+
</div>
|
|
86
|
+
`:""}
|
|
87
|
+
${this.footnote?i`
|
|
88
|
+
<div class="section">
|
|
89
|
+
<div class="secondary-label">${this.footnoteLabel}</div>
|
|
90
|
+
<div>${this.footnote}</div>
|
|
91
|
+
</div>
|
|
92
|
+
`:""}
|
|
93
|
+
</div>
|
|
94
|
+
</scb-accordion-item>
|
|
95
|
+
</scb-accordion>
|
|
96
|
+
`:""}
|
|
102
97
|
</div>
|
|
103
98
|
<slot></slot>
|
|
104
99
|
</div>
|
|
105
|
-
`;default:const
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
<div class="
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
<div class="flipp-wrapper">
|
|
117
|
-
<scb-segmented-button
|
|
118
|
-
.value=${this.selectedChip||""}
|
|
119
|
-
@change=${l=>this._onSegmentedChange(l)}
|
|
120
|
-
>
|
|
121
|
-
<scb-segmented-item
|
|
122
|
-
label=${this.lang==="en"?"Figure":"Diagram"}
|
|
123
|
-
value="Diagram"
|
|
124
|
-
icon="bar_chart"
|
|
125
|
-
></scb-segmented-item>
|
|
126
|
-
<scb-segmented-item
|
|
127
|
-
label="${this.lang==="en"?"Table":"Tabell"}"
|
|
128
|
-
value="Table"
|
|
129
|
-
icon="table"
|
|
130
|
-
></scb-segmented-item>
|
|
131
|
-
</scb-segmented-button>
|
|
132
|
-
</div>
|
|
133
|
-
`:""}
|
|
134
|
-
<div class="content">
|
|
135
|
-
<scb-horizontal-scroller width="600px" class="diagram-scroller" variant="inline" show-scrollbar>
|
|
136
|
-
<slot name="diagram"></slot>
|
|
137
|
-
</scb-horizontal-scroller>
|
|
138
|
-
<scb-horizontal-scroller width="600px" class="table-scroller" variant="inline" show-scrollbar>
|
|
139
|
-
<slot name="table"></slot>
|
|
140
|
-
</scb-horizontal-scroller>
|
|
141
|
-
</div>
|
|
142
|
-
<div class="footer">
|
|
143
|
-
${this.description?t`
|
|
144
|
-
<div class="description section">
|
|
145
|
-
<div class="secondary-label">${this.descriptionLabel}</div>
|
|
146
|
-
<div>${this.description}</div>
|
|
147
|
-
</div>
|
|
148
|
-
`:""}
|
|
149
|
-
${this.comment||this.source||this.footnote?t`
|
|
150
|
-
<scb-divider></scb-divider>
|
|
151
|
-
<scb-accordion>
|
|
152
|
-
<scb-accordion-item
|
|
153
|
-
title="${this.moreAboutStatsLabel}"
|
|
100
|
+
`;default:{const t=this.selectedChip==="Diagram"?"chip-diagram":this.selectedChip==="Table"?"chip-table":"";return this.className!==t&&(this.className=t),i`
|
|
101
|
+
<div part="container">
|
|
102
|
+
<div class="header">
|
|
103
|
+
${this.title?i` <div class="label">${this.title}</div> `:""}
|
|
104
|
+
${this.subtitle?i` <div class="subtitle">${this.subtitle}</div> `:""}
|
|
105
|
+
</div>
|
|
106
|
+
${this.variant==="Standard"?i`
|
|
107
|
+
<div class="flipp-wrapper">
|
|
108
|
+
<scb-segmented-button
|
|
109
|
+
.value=${this.selectedChip||""}
|
|
110
|
+
@change=${e=>this._onSegmentedChange(e)}
|
|
154
111
|
>
|
|
155
|
-
<
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
`:""}
|
|
168
|
-
${this.footnote?t`
|
|
169
|
-
<div class="section">
|
|
170
|
-
<div class="secondary-label">${this.footnoteLabel}</div>
|
|
171
|
-
<div>${this.footnote}</div>
|
|
172
|
-
</div>
|
|
173
|
-
`:""}
|
|
174
|
-
</div>
|
|
175
|
-
</scb-accordion-item>
|
|
176
|
-
</scb-accordion>
|
|
112
|
+
<scb-segmented-item
|
|
113
|
+
label=${this.lang==="en"?"Figure":"Diagram"}
|
|
114
|
+
value="Diagram"
|
|
115
|
+
icon="bar_chart"
|
|
116
|
+
></scb-segmented-item>
|
|
117
|
+
<scb-segmented-item
|
|
118
|
+
label="${this.lang==="en"?"Table":"Tabell"}"
|
|
119
|
+
value="Table"
|
|
120
|
+
icon="table"
|
|
121
|
+
></scb-segmented-item>
|
|
122
|
+
</scb-segmented-button>
|
|
123
|
+
</div>
|
|
177
124
|
`:""}
|
|
178
|
-
|
|
179
|
-
<
|
|
125
|
+
<div class="content">
|
|
126
|
+
<scb-horizontal-scroller
|
|
127
|
+
width="600px"
|
|
128
|
+
class="diagram-scroller"
|
|
129
|
+
variant="inline"
|
|
130
|
+
show-scrollbar
|
|
131
|
+
>
|
|
132
|
+
<slot name="diagram"></slot>
|
|
133
|
+
</scb-horizontal-scroller>
|
|
134
|
+
<scb-horizontal-scroller
|
|
135
|
+
width="600px"
|
|
136
|
+
class="table-scroller"
|
|
137
|
+
variant="inline"
|
|
138
|
+
show-scrollbar
|
|
139
|
+
>
|
|
140
|
+
<slot name="table"></slot>
|
|
141
|
+
</scb-horizontal-scroller>
|
|
180
142
|
</div>
|
|
181
|
-
|
|
143
|
+
<div class="footer">
|
|
144
|
+
${this.description?i`
|
|
145
|
+
<div class="description section">
|
|
146
|
+
<div class="secondary-label">${this.descriptionLabel}</div>
|
|
147
|
+
<div>${this.description}</div>
|
|
148
|
+
</div>
|
|
149
|
+
`:""}
|
|
150
|
+
${this.comment||this.source||this.footnote?i`
|
|
151
|
+
<scb-divider></scb-divider>
|
|
152
|
+
<scb-accordion>
|
|
153
|
+
<scb-accordion-item title="${this.moreAboutStatsLabel}">
|
|
154
|
+
<div class="more-about-stats-content">
|
|
155
|
+
${this.comment?i`
|
|
156
|
+
<div class="section">
|
|
157
|
+
<div class="secondary-label">${this.commentLabel}</div>
|
|
158
|
+
<div>${this.comment}</div>
|
|
159
|
+
</div>
|
|
160
|
+
`:""}
|
|
161
|
+
${this.source?i`
|
|
162
|
+
<div class="section">
|
|
163
|
+
<div class="secondary-label">${this.sourceLabel}</div>
|
|
164
|
+
<div>${this.source}</div>
|
|
165
|
+
</div>
|
|
166
|
+
`:""}
|
|
167
|
+
${this.footnote?i`
|
|
168
|
+
<div class="section">
|
|
169
|
+
<div class="secondary-label">${this.footnoteLabel}</div>
|
|
170
|
+
<div>${this.footnote}</div>
|
|
171
|
+
</div>
|
|
172
|
+
`:""}
|
|
173
|
+
</div>
|
|
174
|
+
</scb-accordion-item>
|
|
175
|
+
</scb-accordion>
|
|
176
|
+
`:""}
|
|
177
|
+
</div>
|
|
178
|
+
<slot></slot>
|
|
179
|
+
</div>
|
|
180
|
+
`}}}_onSegmentedChange(t){const e=t.detail?.value;this.selectedChip===e?this.selectedChip=null:this.selectedChip=e}};h=new WeakSet;b=function(){const t=p(this,h,v).call(this,this.spacing),e=p(this,h,v).call(this,this.spacingTop)??t,s=p(this,h,v).call(this,this.spacingBottom)??t;e?this.style.setProperty("--scb-viz-spacing-block-start",e):this.style.removeProperty("--scb-viz-spacing-block-start"),s?this.style.setProperty("--scb-viz-spacing-block-end",s):this.style.removeProperty("--scb-viz-spacing-block-end")};v=function(t){if(!t)return;const e=String(t).trim();if(e)return/^\d+$/.test(e)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(e,10)))})`:e};r.styles=g`
|
|
182
181
|
:host {
|
|
183
182
|
display: block;
|
|
184
183
|
font-family: var(--brand-font);
|
|
@@ -188,8 +187,11 @@ import{a as h,n as c,i as v,x as t,t as m}from"../../vendor/vendor.js";import"..
|
|
|
188
187
|
max-width: 100%;
|
|
189
188
|
border-radius: var(--spacing-04, 16px);
|
|
190
189
|
border: 1px solid var(--md-sys-color-outline-variant);
|
|
191
|
-
|
|
190
|
+
/* Vertikalt avstånd styrs av spacing-attributen via CSS-variabler */
|
|
191
|
+
margin-block-start: var(--scb-viz-spacing-block-start, 0);
|
|
192
|
+
margin-block-end: var(--scb-viz-spacing-block-end, 0);
|
|
192
193
|
}
|
|
194
|
+
|
|
193
195
|
scb-segmented-button {
|
|
194
196
|
--scb-segmented-button-height: var(--icon-size-small);
|
|
195
197
|
}
|
|
@@ -200,65 +202,76 @@ import{a as h,n as c,i as v,x as t,t as m}from"../../vendor/vendor.js";import"..
|
|
|
200
202
|
line-height: var(--md-sys-typescale-title-large-line-height);
|
|
201
203
|
letter-spacing: var(--md-sys-typescale-title-large-tracking);
|
|
202
204
|
}
|
|
203
|
-
|
|
205
|
+
|
|
206
|
+
.sub-label {
|
|
204
207
|
font-size: var(--md-sys-typescale-body-large-size);
|
|
205
208
|
line-height: var(--md-sys-typescale-body-large-line-height);
|
|
206
209
|
letter-spacing: var(--md-sys-typescale-body-large-tracking);
|
|
207
210
|
}
|
|
211
|
+
|
|
208
212
|
.secondary-label {
|
|
209
213
|
font-size: var(--md-sys-typescale-title-medium-size);
|
|
210
214
|
font-weight: var(--weight-semibold);
|
|
211
215
|
line-height: var(--md-sys-typescale-title-medium-line-height);
|
|
212
216
|
letter-spacing: var(--md-sys-typescale-title-medium-tracking);
|
|
213
217
|
}
|
|
218
|
+
|
|
214
219
|
.section {
|
|
215
220
|
display: flex;
|
|
216
221
|
flex-direction: column;
|
|
217
|
-
gap: var(--spacing-2);
|
|
222
|
+
gap: var(--spacing-2);
|
|
218
223
|
}
|
|
224
|
+
|
|
219
225
|
.more-about-stats-content {
|
|
220
226
|
display: flex;
|
|
221
227
|
flex-direction: column;
|
|
222
228
|
gap: var(--spacing-7);
|
|
223
|
-
max-width: 600px
|
|
229
|
+
max-width: 600px;
|
|
224
230
|
}
|
|
231
|
+
|
|
225
232
|
.header {
|
|
226
233
|
margin-bottom: var(--spacing-7);
|
|
227
|
-
max-width: 600px
|
|
234
|
+
max-width: 600px;
|
|
228
235
|
}
|
|
236
|
+
|
|
229
237
|
.flipp-wrapper {
|
|
230
238
|
margin-bottom: var(--spacing-9);
|
|
231
|
-
max-width: 234px
|
|
239
|
+
max-width: 234px;
|
|
232
240
|
}
|
|
233
|
-
|
|
241
|
+
|
|
242
|
+
.description {
|
|
234
243
|
margin-bottom: var(--spacing-8);
|
|
235
244
|
}
|
|
245
|
+
|
|
236
246
|
.footer {
|
|
237
247
|
margin-top: var(--spacing-7);
|
|
238
|
-
|
|
239
248
|
}
|
|
240
|
-
|
|
241
|
-
|
|
249
|
+
|
|
250
|
+
.description.section {
|
|
251
|
+
max-width: 600px;
|
|
242
252
|
}
|
|
253
|
+
|
|
243
254
|
.table-scroller,
|
|
244
255
|
.diagram-scroller {
|
|
245
256
|
display: none;
|
|
246
257
|
}
|
|
247
|
-
|
|
258
|
+
|
|
259
|
+
:host([variant='Table']) slot[name='table'] {
|
|
248
260
|
display: block;
|
|
249
261
|
}
|
|
250
262
|
:host([variant='Table']) .table-scroller {
|
|
251
263
|
display: flex;
|
|
252
264
|
}
|
|
265
|
+
|
|
253
266
|
:host([variant='Image']) {
|
|
254
267
|
img {
|
|
255
268
|
height: auto;
|
|
256
269
|
max-width: 100%;
|
|
257
270
|
}
|
|
258
|
-
slot[name=
|
|
271
|
+
slot[name='table'] {
|
|
259
272
|
display: none;
|
|
260
273
|
}
|
|
261
|
-
slot[name=
|
|
274
|
+
slot[name='diagram'] {
|
|
262
275
|
display: none;
|
|
263
276
|
}
|
|
264
277
|
.image-content {
|
|
@@ -275,22 +288,19 @@ import{a as h,n as c,i as v,x as t,t as m}from"../../vendor/vendor.js";import"..
|
|
|
275
288
|
:host([variant='Standard'].chip-diagram) .diagram-scroller {
|
|
276
289
|
display: flex;
|
|
277
290
|
}
|
|
278
|
-
|
|
291
|
+
:host([variant='Standard'].chip-table) .table-scroller {
|
|
279
292
|
display: flex;
|
|
280
293
|
}
|
|
281
|
-
:host([variant='Standard'].chip-table) slot[name=
|
|
294
|
+
:host([variant='Standard'].chip-table) slot[name='table'] {
|
|
282
295
|
display: block;
|
|
283
296
|
}
|
|
284
|
-
:host([variant='Standard'].chip-table) slot[name=
|
|
297
|
+
:host([variant='Standard'].chip-table) slot[name='diagram'] {
|
|
285
298
|
display: none;
|
|
286
299
|
}
|
|
287
|
-
:host([variant='Standard'].chip-diagram) slot[name=
|
|
300
|
+
:host([variant='Standard'].chip-diagram) slot[name='table'] {
|
|
288
301
|
display: none;
|
|
289
302
|
}
|
|
290
|
-
:host([variant='Standard'].chip-diagram) slot[name=
|
|
303
|
+
:host([variant='Standard'].chip-diagram) slot[name='diagram'] {
|
|
291
304
|
display: block;
|
|
292
305
|
}
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
`;r([c({type:String,reflect:!0})],o.prototype,"variant",2);r([c({type:String})],o.prototype,"selectedChip",2);r([c({type:String,reflect:!0})],o.prototype,"title",2);r([c({type:String,reflect:!0})],o.prototype,"subtitle",2);r([c({type:String,reflect:!0})],o.prototype,"description",2);r([c({type:String,reflect:!0})],o.prototype,"comment",2);r([c({type:String,reflect:!0})],o.prototype,"source",2);r([c({type:String,reflect:!0})],o.prototype,"footnote",2);r([c({type:String,reflect:!0,attribute:"lang"})],o.prototype,"lang",2);r([c({type:String,reflect:!0,attribute:"image-href"})],o.prototype,"imageHref",2);o=r([m("scb-viz")],o);
|
|
306
|
+
`;l([c({type:String,reflect:!0})],r.prototype,"variant",2);l([c({type:String})],r.prototype,"selectedChip",2);l([c({type:String,reflect:!0})],r.prototype,"title",2);l([c({type:String,reflect:!0})],r.prototype,"subtitle",2);l([c({type:String,reflect:!0})],r.prototype,"description",2);l([c({type:String,reflect:!0})],r.prototype,"comment",2);l([c({type:String,reflect:!0})],r.prototype,"source",2);l([c({type:String,reflect:!0})],r.prototype,"footnote",2);l([c({type:String,reflect:!0,attribute:"lang"})],r.prototype,"lang",2);l([c({type:String,reflect:!0,attribute:"image-href"})],r.prototype,"imageHref",2);l([c({type:String,reflect:!0})],r.prototype,"spacing",2);l([c({type:String,attribute:"spacing-top",reflect:!0})],r.prototype,"spacingTop",2);l([c({type:String,attribute:"spacing-bottom",reflect:!0})],r.prototype,"spacingBottom",2);r=l([y("scb-viz")],r);
|