scb-wc-test 0.1.256 → 0.1.257
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-viz/scb-viz.js +4 -4
- package/package.json +2 -2
- package/scb-viz/scb-viz.js +10 -10
- package/scb-wc-test.bundle.js +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as V,n as h,r as R,i as D,k as T,x as s,
|
|
1
|
+
import{a as V,n as h,r as R,i as D,k as T,x as s,l as z,t as A}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-button/scb-button.js";import"../scb-icon-button/scb-icon-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(l,r,i){try{customElements.get(l)||e(l,r,i)}catch(a){var n=String(a||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw a}}}}catch{}})();var H=Object.defineProperty,P=Object.getOwnPropertyDescriptor,k=t=>{throw TypeError(t)},o=(t,e,l,r)=>{for(var i=r>1?void 0:r?P(e,l):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(i=(r?a(e,l,i):a(i))||i);return r&&i&&H(e,l,i),i},E=(t,e,l)=>e.has(t)||k("Cannot "+l),I=(t,e,l)=>e.has(t)?k("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,l),b=(t,e,l)=>(E(t,e,"access private method"),l),v,M,y,L;const C=`<svg version="1.1" id="Lager_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
2
2
|
viewBox="0 0 727.3 87.3" style="enable-background:new 0 0 727.3 87.3;" xml:space="preserve" fill="currentColor">
|
|
3
3
|
<style type="text/css">
|
|
4
4
|
.st0{clip-path:url(#SVGID_00000118375311472882578510000008414848687067442345_);}
|
|
@@ -113,7 +113,7 @@ import{a as V,n as h,r as R,i as D,k as T,x as s,E as A,l as z,t as H}from"../..
|
|
|
113
113
|
<path d="M688.2,24.4h5.8v6h-5.8V24.4z M688.2,36.6h5.8v30.1h-5.8V36.6z"/>
|
|
114
114
|
<path d="M701.8,24.4h5.8v26.3h0.1l11.2-14.1h7l-10,11.7l11.4,18.3H720l-7.7-14l-4.6,5.4v8.7h-5.8V24.4H701.8z"/>
|
|
115
115
|
</svg>
|
|
116
|
-
`;let c=class extends D{constructor(){super(...arguments),
|
|
116
|
+
`;let c=class extends D{constructor(){super(...arguments),I(this,v),this.variant="Standard",this.selectedChip="Diagram",this.title="",this.subtitle="",this.description="",this.comment="",this.source="",this.footnote="",this.lang="sv",this.imageHref="",this.officialStatistics=!1,this.disableToggle=!1,this.contentMaxWidth="",this.containerMaxWidth="",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0}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"}get officialStatisticsLabel(){return this.lang==="en"?"Official statistics of Sweden":"Sveriges officiella statistik"}get officialStatisticsTitle(){return this.lang==="en"?"Part of Official statistics of Sweden":"Tillhör Sveriges officiella statistik"}get officialStatisticsAlt(){return this.lang==="en"?"Read more about Official statistics of Sweden":"Läs mer om Sveriges officiella statistik"}firstUpdated(t){this._readTableDataFromSlot(),b(this,v,M).call(this),b(this,v,L).call(this),this._syncChipClass()}updated(t){super.updated(t),(t.has("selectedChip")||t.has("variant"))&&this._syncChipClass(),t.has("selectedChip")&&this._dispatchSelectedChipChanged(),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&b(this,v,M).call(this),t.has("containerMaxWidth")&&b(this,v,L).call(this)}_onTableSlotChange(t){const e=t.target;e&&this._readTableDataFromSlot(e)}_normalizeRenderableCell(t){return t&&typeof t=="object"&&"html"in t&&"text"in t?{html:typeof t.html=="string"?t.html:"",text:typeof t.text=="string"?t.text:""}:{html:"",text:t==null?"":String(t)}}_readTableDataFromSlot(t){const e=t||this.shadowRoot?.querySelector('slot[name="table"]');if(!e)return;const l=e.assignedElements({flatten:!0}),r=[];l.forEach(d=>{if(d.tagName==="TABLE"){r.push(d);return}d.querySelectorAll("table").forEach(g=>r.push(g))});const i=r[0];if(!i){this._slottedTableData=void 0;return}const n=[],a=[],p=[],m=d=>d?(d.textContent??"").replace(/\s+/g," ").trim():"",f=d=>d?{html:(d.innerHTML??"").trim(),text:m(d)}:{html:"",text:""},u=i.querySelector("thead tr");u&&Array.from(u.querySelectorAll("th, td")).forEach(g=>n.push(f(g)));const w=Array.from(i.querySelectorAll("tbody tr")),$=w.length>0?w:Array.from(i.querySelectorAll("tr")).filter(d=>d.closest("thead")===null);if($.forEach(d=>{const g=Array.from(d.querySelectorAll("th, td"));if(g.length===0)return;const S=g[0].tagName==="TH"&&d.closest("thead")===null&&d.closest("tfoot")===null;p.push(S);const _=[];g.forEach(x=>_.push(f(x))),a.push(_)}),!u&&a.length>0){const d=a[0],g=$[0],S=Array.from(g?.querySelectorAll("th, td")??[]);S.length>0&&S.every(x=>x.tagName==="TH")&&g?.closest("tbody")===null&&(n.splice(0,n.length,...d),a.shift(),p.shift())}this._slottedTableData={headers:n.length>0?n:void 0,rows:a,rowHeaderRows:p.length>0?p:void 0}}_inferTableAlignments(t){const e=Math.max(t.headers?.length??0,...t.rows.map(i=>i.length)),l=i=>{if(i==null)return!1;if(typeof i=="number")return!0;const n=String(i).replace(/[\u00A0\u202F\s]+/g,"").trim();return n?/^-?\d+(?:[.,]\d+)?$/.test(n):!1},r=[];for(let i=0;i<e;i+=1){if(i===0){r.push("left");continue}const n=t.rows.map(p=>this._normalizeRenderableCell(p[i]).text).filter(p=>p!==""&&p!==null&&p!==void 0),a=n.length>0&&n.every(l);r.push(a?"right":"left")}return r}_getResolvedContentMaxWidth(){return this.contentMaxWidth?.trim()||""}_renderTable(){const t=this.tableData??this._slottedTableData;if(!t||!t.rows||t.rows.length===0)return null;const e=this._inferTableAlignments(t),l=Math.max(t.headers?.length??0,...t.rows.map(a=>a.length)),r=(t.headers??[]).map(a=>this._normalizeRenderableCell(a)),i=t.rows.map(a=>{const p=a.map(m=>this._normalizeRenderableCell(m));for(;p.length<l;)p.push({html:"",text:""});return p}),n=t.rowHeaderRows??[];return s`
|
|
117
117
|
<table class="scb-viz-table" part="table">
|
|
118
118
|
${r.length>0?s`
|
|
119
119
|
<thead>
|
|
@@ -297,7 +297,7 @@ import{a as V,n as h,r as R,i as D,k as T,x as s,E as A,l as z,t as H}from"../..
|
|
|
297
297
|
`:""}
|
|
298
298
|
<div class="content">
|
|
299
299
|
<scb-horizontal-scroller
|
|
300
|
-
width=${this._getResolvedContentMaxWidth()||
|
|
300
|
+
width=${this._getResolvedContentMaxWidth()||"auto"}
|
|
301
301
|
class="diagram-scroller"
|
|
302
302
|
variant="inline"
|
|
303
303
|
show-scrollbar
|
|
@@ -572,4 +572,4 @@ import{a as V,n as h,r as R,i as D,k as T,x as s,E as A,l as z,t as H}from"../..
|
|
|
572
572
|
text-align: right;
|
|
573
573
|
white-space: nowrap;
|
|
574
574
|
}
|
|
575
|
-
`;o([h({type:String,reflect:!0})],c.prototype,"variant",2);o([h({type:String,reflect:!0,attribute:"selected-chip"})],c.prototype,"selectedChip",2);o([h({type:String,reflect:!0})],c.prototype,"title",2);o([h({type:String,reflect:!0})],c.prototype,"subtitle",2);o([h({type:String,reflect:!0})],c.prototype,"description",2);o([h({type:String,reflect:!0})],c.prototype,"comment",2);o([h({type:String,reflect:!0})],c.prototype,"source",2);o([h({type:String,reflect:!0})],c.prototype,"footnote",2);o([h({type:String,reflect:!0,attribute:"lang"})],c.prototype,"lang",2);o([h({type:String,reflect:!0,attribute:"image-href"})],c.prototype,"imageHref",2);o([h({type:Boolean,reflect:!0,attribute:"official-statistics"})],c.prototype,"officialStatistics",2);o([h({type:Boolean,reflect:!0,attribute:"disable-toggle"})],c.prototype,"disableToggle",2);o([h({type:String,attribute:"content-max-width"})],c.prototype,"contentMaxWidth",2);o([h({type:String,attribute:"container-max-width"})],c.prototype,"containerMaxWidth",2);o([h({attribute:!1})],c.prototype,"tableData",2);o([R()],c.prototype,"_slottedTableData",2);o([h({type:String,reflect:!0})],c.prototype,"spacing",2);o([h({type:String,attribute:"spacing-top",reflect:!0})],c.prototype,"spacingTop",2);o([h({type:String,attribute:"spacing-bottom",reflect:!0})],c.prototype,"spacingBottom",2);o([h({type:String,attribute:"spacing-left",reflect:!0})],c.prototype,"spacingLeft",2);o([h({type:String,attribute:"spacing-right",reflect:!0})],c.prototype,"spacingRight",2);c=o([
|
|
575
|
+
`;o([h({type:String,reflect:!0})],c.prototype,"variant",2);o([h({type:String,reflect:!0,attribute:"selected-chip"})],c.prototype,"selectedChip",2);o([h({type:String,reflect:!0})],c.prototype,"title",2);o([h({type:String,reflect:!0})],c.prototype,"subtitle",2);o([h({type:String,reflect:!0})],c.prototype,"description",2);o([h({type:String,reflect:!0})],c.prototype,"comment",2);o([h({type:String,reflect:!0})],c.prototype,"source",2);o([h({type:String,reflect:!0})],c.prototype,"footnote",2);o([h({type:String,reflect:!0,attribute:"lang"})],c.prototype,"lang",2);o([h({type:String,reflect:!0,attribute:"image-href"})],c.prototype,"imageHref",2);o([h({type:Boolean,reflect:!0,attribute:"official-statistics"})],c.prototype,"officialStatistics",2);o([h({type:Boolean,reflect:!0,attribute:"disable-toggle"})],c.prototype,"disableToggle",2);o([h({type:String,attribute:"content-max-width"})],c.prototype,"contentMaxWidth",2);o([h({type:String,attribute:"container-max-width"})],c.prototype,"containerMaxWidth",2);o([h({attribute:!1})],c.prototype,"tableData",2);o([R()],c.prototype,"_slottedTableData",2);o([h({type:String,reflect:!0})],c.prototype,"spacing",2);o([h({type:String,attribute:"spacing-top",reflect:!0})],c.prototype,"spacingTop",2);o([h({type:String,attribute:"spacing-bottom",reflect:!0})],c.prototype,"spacingBottom",2);o([h({type:String,attribute:"spacing-left",reflect:!0})],c.prototype,"spacingLeft",2);o([h({type:String,attribute:"spacing-right",reflect:!0})],c.prototype,"spacingRight",2);c=o([A("scb-viz")],c);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scb-wc-test",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.257",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|
|
@@ -382,5 +382,5 @@
|
|
|
382
382
|
},
|
|
383
383
|
"./mvc/*": "./mvc/*"
|
|
384
384
|
},
|
|
385
|
-
"buildHash": "
|
|
385
|
+
"buildHash": "F73A74886949F8E5A04C949D8024639F4302259F9A70DFCB00D74010998BC6D0"
|
|
386
386
|
}
|
package/scb-viz/scb-viz.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { css as R, LitElement as D, html as s
|
|
1
|
+
import { css as R, LitElement as D, html as s } from "lit";
|
|
2
2
|
import { unsafeSVG as C } from "lit/directives/unsafe-svg.js";
|
|
3
3
|
import { unsafeHTML as T } from "lit/directives/unsafe-html.js";
|
|
4
|
-
import { property as r, state as
|
|
4
|
+
import { property as r, state as A, customElement as H } from "lit/decorators.js";
|
|
5
5
|
import "../scb-chip/scb-chip.js";
|
|
6
6
|
import "../scb-segmented-button/scb-segmented-button.js";
|
|
7
7
|
import "../scb-segmented-button/scb-segmented-item.js";
|
|
8
8
|
import "../scb-accordion/scb-accordion.js";
|
|
9
9
|
import "../scb-divider/scb-divider.js";
|
|
10
10
|
import "../scb-horizontal-scroller/scb-horizontal-scroller.js";
|
|
11
|
-
var
|
|
11
|
+
var P = Object.defineProperty, I = Object.getOwnPropertyDescriptor, V = (t) => {
|
|
12
12
|
throw TypeError(t);
|
|
13
13
|
}, l = (t, e, c, h) => {
|
|
14
|
-
for (var o = h > 1 ? void 0 : h ?
|
|
14
|
+
for (var o = h > 1 ? void 0 : h ? I(e, c) : e, a = t.length - 1, d; a >= 0; a--)
|
|
15
15
|
(d = t[a]) && (o = (h ? d(e, c, o) : d(o)) || o);
|
|
16
|
-
return h && o &&
|
|
17
|
-
},
|
|
16
|
+
return h && o && P(e, c, o), o;
|
|
17
|
+
}, W = (t, e, c) => e.has(t) || V("Cannot " + c), E = (t, e, c) => e.has(t) ? V("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, c), m = (t, e, c) => (W(t, e, "access private method"), c), b, L, y, k;
|
|
18
18
|
const M = `<svg version="1.1" id="Lager_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
19
19
|
viewBox="0 0 727.3 87.3" style="enable-background:new 0 0 727.3 87.3;" xml:space="preserve" fill="currentColor">
|
|
20
20
|
<style type="text/css">
|
|
@@ -133,7 +133,7 @@ const M = `<svg version="1.1" id="Lager_1" xmlns="http://www.w3.org/2000/svg" xm
|
|
|
133
133
|
`;
|
|
134
134
|
let i = class extends D {
|
|
135
135
|
constructor() {
|
|
136
|
-
super(...arguments),
|
|
136
|
+
super(...arguments), E(this, b), this.variant = "Standard", this.selectedChip = "Diagram", this.title = "", this.subtitle = "", this.description = "", this.comment = "", this.source = "", this.footnote = "", this.lang = "sv", this.imageHref = "", this.officialStatistics = !1, this.disableToggle = !1, this.contentMaxWidth = "", this.containerMaxWidth = "", this.spacing = void 0, this.spacingTop = void 0, this.spacingBottom = void 0, this.spacingLeft = void 0, this.spacingRight = void 0;
|
|
137
137
|
}
|
|
138
138
|
// Labels as getters so they react to lang changes
|
|
139
139
|
get descriptionLabel() {
|
|
@@ -460,7 +460,7 @@ let i = class extends D {
|
|
|
460
460
|
` : ""}
|
|
461
461
|
<div class="content">
|
|
462
462
|
<scb-horizontal-scroller
|
|
463
|
-
width=${this._getResolvedContentMaxWidth() ||
|
|
463
|
+
width=${this._getResolvedContentMaxWidth() || "auto"}
|
|
464
464
|
class="diagram-scroller"
|
|
465
465
|
variant="inline"
|
|
466
466
|
show-scrollbar
|
|
@@ -839,7 +839,7 @@ l([
|
|
|
839
839
|
r({ attribute: !1 })
|
|
840
840
|
], i.prototype, "tableData", 2);
|
|
841
841
|
l([
|
|
842
|
-
|
|
842
|
+
A()
|
|
843
843
|
], i.prototype, "_slottedTableData", 2);
|
|
844
844
|
l([
|
|
845
845
|
r({ type: String, reflect: !0 })
|
|
@@ -857,7 +857,7 @@ l([
|
|
|
857
857
|
r({ type: String, attribute: "spacing-right", reflect: !0 })
|
|
858
858
|
], i.prototype, "spacingRight", 2);
|
|
859
859
|
i = l([
|
|
860
|
-
|
|
860
|
+
H("scb-viz")
|
|
861
861
|
], i);
|
|
862
862
|
export {
|
|
863
863
|
i as ScbViz
|
package/scb-wc-test.bundle.js
CHANGED
|
@@ -11969,7 +11969,7 @@ ${this.value}</textarea
|
|
|
11969
11969
|
`:""}
|
|
11970
11970
|
<div class="content">
|
|
11971
11971
|
<scb-horizontal-scroller
|
|
11972
|
-
width=${this._getResolvedContentMaxWidth()||
|
|
11972
|
+
width=${this._getResolvedContentMaxWidth()||"auto"}
|
|
11973
11973
|
class="diagram-scroller"
|
|
11974
11974
|
variant="inline"
|
|
11975
11975
|
show-scrollbar
|