scb-wc 0.1.24 → 0.1.26

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.
@@ -8,4 +8,4 @@ import{_ as y,b as f,g as b,h as r,y as S}from"../../vendor/vendor.js";import"..
8
8
  }
9
9
  :host([fit]) { block-size: 100%; }
10
10
  :host([fit]) ::slotted(*) { block-size: 100%; }
11
- `,p);function d(){o(e,this,l).call(this,"--col-span",this.hasAttribute("col-span")?String(this.colSpan):null),o(e,this,l).call(this,"--col-span-compact",this.hasAttribute("col-span-compact")?String(this.colSpanCompact):null),o(e,this,l).call(this,"--col-span-medium",this.hasAttribute("col-span-medium")?String(this.colSpanMedium):null),o(e,this,l).call(this,"--col-span-expanded",this.hasAttribute("col-span-expanded")?String(this.colSpanExpanded):null),o(e,this,l).call(this,"--row-rule",this.hasAttribute("row-span")?`span ${this.rowSpan}`:null),o(e,this,l).call(this,"--row-rule-compact",this.hasAttribute("row-span-compact")?`span ${this.rowSpanCompact}`:null),o(e,this,l).call(this,"--row-rule-medium",this.hasAttribute("row-span-medium")?`span ${this.rowSpanMedium}`:null),o(e,this,l).call(this,"--row-rule-expanded",this.hasAttribute("row-span-expanded")?`span ${this.rowSpanExpanded}`:null),this.align?(this.style.setProperty("--scb-grid-item-align",this.align),this.style.setProperty("align-self",this.align)):(this.style.removeProperty("--scb-grid-item-align"),this.style.removeProperty("align-self")),this.justify?(this.style.setProperty("--scb-grid-item-justify",this.justify),this.style.setProperty("justify-self",this.justify)):(this.style.removeProperty("--scb-grid-item-justify"),this.style.removeProperty("justify-self"))}function l(a,s){s===null||s===""?this.style.removeProperty(a):this.style.setProperty(a,s)}i([r({type:Number,attribute:"col-span",reflect:!0})],t.prototype,"colSpan",void 0);i([r({type:Number,attribute:"col-span-compact",reflect:!0})],t.prototype,"colSpanCompact",void 0);i([r({type:Number,attribute:"col-span-medium",reflect:!0})],t.prototype,"colSpanMedium",void 0);i([r({type:Number,attribute:"col-span-expanded",reflect:!0})],t.prototype,"colSpanExpanded",void 0);i([r({type:Number,attribute:"row-span",reflect:!0})],t.prototype,"rowSpan",void 0);i([r({type:Number,attribute:"row-span-compact",reflect:!0})],t.prototype,"rowSpanCompact",void 0);i([r({type:Number,attribute:"row-span-medium",reflect:!0})],t.prototype,"rowSpanMedium",void 0);i([r({type:Number,attribute:"row-span-expanded",reflect:!0})],t.prototype,"rowSpanExpanded",void 0);i([r({type:String,reflect:!0})],t.prototype,"align",void 0);i([r({type:String,reflect:!0})],t.prototype,"justify",void 0);i([r({type:Boolean,reflect:!0,converter:w})],t.prototype,"fit",void 0);t=i([b("scb-grid-item")],t);
11
+ `,p);function d(){o(e,this,l).call(this,"--col-span",this.hasAttribute("col-span")?String(this.colSpan):null),o(e,this,l).call(this,"--col-span-compact",this.hasAttribute("col-span-compact")?String(this.colSpanCompact):null),o(e,this,l).call(this,"--col-span-medium",this.hasAttribute("col-span-medium")?String(this.colSpanMedium):null),o(e,this,l).call(this,"--col-span-expanded",this.hasAttribute("col-span-expanded")?String(this.colSpanExpanded):null),o(e,this,l).call(this,"--row-rule",this.hasAttribute("row-span")?`span ${this.rowSpan}`:null),o(e,this,l).call(this,"--row-rule-compact",this.hasAttribute("row-span-compact")?`span ${this.rowSpanCompact}`:null),o(e,this,l).call(this,"--row-rule-medium",this.hasAttribute("row-span-medium")?`span ${this.rowSpanMedium}`:null),o(e,this,l).call(this,"--row-rule-expanded",this.hasAttribute("row-span-expanded")?`span ${this.rowSpanExpanded}`:null),this.align?(this.style.setProperty("--scb-grid-item-align",this.align),this.style.setProperty("align-self",this.align)):(this.style.setProperty("--scb-grid-item-align","initial"),this.style.removeProperty("align-self")),this.justify?(this.style.setProperty("--scb-grid-item-justify",this.justify),this.style.setProperty("justify-self",this.justify)):(this.style.setProperty("--scb-grid-item-justify","initial"),this.style.removeProperty("justify-self"))}function l(a,s){this.style.setProperty(a,s===null||s===""?"initial":s)}i([r({type:Number,attribute:"col-span",reflect:!0})],t.prototype,"colSpan",void 0);i([r({type:Number,attribute:"col-span-compact",reflect:!0})],t.prototype,"colSpanCompact",void 0);i([r({type:Number,attribute:"col-span-medium",reflect:!0})],t.prototype,"colSpanMedium",void 0);i([r({type:Number,attribute:"col-span-expanded",reflect:!0})],t.prototype,"colSpanExpanded",void 0);i([r({type:Number,attribute:"row-span",reflect:!0})],t.prototype,"rowSpan",void 0);i([r({type:Number,attribute:"row-span-compact",reflect:!0})],t.prototype,"rowSpanCompact",void 0);i([r({type:Number,attribute:"row-span-medium",reflect:!0})],t.prototype,"rowSpanMedium",void 0);i([r({type:Number,attribute:"row-span-expanded",reflect:!0})],t.prototype,"rowSpanExpanded",void 0);i([r({type:String,reflect:!0})],t.prototype,"align",void 0);i([r({type:String,reflect:!0})],t.prototype,"justify",void 0);i([r({type:Boolean,reflect:!0,converter:w})],t.prototype,"fit",void 0);t=i([b("scb-grid-item")],t);
@@ -1,4 +1,4 @@
1
- import{_ as h,b,g as v,h as s,y}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as e}from"../../vendor/decorate.js";import{n as w,t as d}from"../../vendor/assertClassBrand.js";import"./scb-grid-item.js";import"./scb-stack.js";(function(){try{var a=typeof globalThis<"u"?globalThis:window;if(!a.__scb_ce_guard_installed__){a.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(i,n,l){try{customElements.get(i)||t(i,n,l)}catch(g){var c=String(g||"");if(c.indexOf("already been used")===-1&&c.indexOf("NotSupportedError")===-1)throw g}}}}catch{}})();var o,m,r=(o=new WeakSet,m=class extends h{constructor(...t){super(...t),w(this,o),this.colsCompact=4,this.colsMedium=8,this.colsExpanded=12,this.gap="",this.rowGap="",this.columnGap="",this.alignItems="stretch",this.justifyItems="stretch",this.paddingInline="",this.paddingBlock="",this.maxWidth="",this.autoRows=""}firstUpdated(){d(o,this,u).call(this)}updated(){d(o,this,u).call(this)}mapSpacingToken(t){if(!t)return;const i=String(t).trim();return/^\d+$/.test(i)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(i,10)))})`:i}parseGapShorthand(t){if(!t)return{};const i=t.trim().split(/\s+/);if(i.length===1){const n=this.mapSpacingToken(i[0]);return{row:n,col:n}}return{row:this.mapSpacingToken(i[0]),col:this.mapSpacingToken(i[1])}}render(){return y`<div class="grid"><slot></slot></div>`}},m.styles=b`
1
+ import{_ as u,b as h,g as b,h as s,y as v}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as r}from"../../vendor/decorate.js";import{n as y,t as m}from"../../vendor/assertClassBrand.js";import"./scb-grid-item.js";import"./scb-stack.js";(function(){try{var o=typeof globalThis<"u"?globalThis:window;if(!o.__scb_ce_guard_installed__){o.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(t,a,c){try{customElements.get(t)||e(t,a,c)}catch(l){var n=String(l||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw l}}}}catch{}})();var d,p,i=(d=new WeakSet,p=class extends u{constructor(...e){super(...e),y(this,d),this.colsCompact=4,this.colsMedium=8,this.colsExpanded=12,this.gap="",this.rowGap="",this.columnGap="",this.alignItems="stretch",this.justifyItems="stretch",this.paddingInline="",this.paddingBlock="",this.maxWidth="",this.autoRows=""}firstUpdated(){m(d,this,g).call(this)}updated(){m(d,this,g).call(this)}mapSpacingToken(e){if(!e)return;const t=String(e).trim();return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}parseGapShorthand(e){if(!e)return{};const t=e.trim().split(/\s+/);if(t.length===1){const a=this.mapSpacingToken(t[0]);return{row:a,col:a}}return{row:this.mapSpacingToken(t[0]),col:this.mapSpacingToken(t[1])}}render(){return v`<div class="grid"><slot></slot></div>`}},p.styles=h`
2
2
  :host {
3
3
  box-sizing: border-box;
4
4
  display: block;
@@ -95,4 +95,4 @@ import{_ as h,b,g as v,h as s,y}from"../../vendor/vendor.js";import"../../vendor
95
95
  }
96
96
  }
97
97
  }
98
- `,m);function u(){this.style.setProperty("--scb-grid-cols-compact",String(this.colsCompact)),this.style.setProperty("--scb-grid-cols-medium",String(this.colsMedium)),this.style.setProperty("--scb-grid-cols-expanded",String(this.colsExpanded));const a="var(--spacing-7, 24px)",t=this.parseGapShorthand(this.gap),i=this.mapSpacingToken(this.rowGap)??t.row??a,n=this.mapSpacingToken(this.columnGap)??t.col??a;this.style.setProperty("--scb-grid-row-gap",i),this.style.setProperty("--scb-grid-column-gap",n),this.style.setProperty("--scb-grid-gap",`${i} ${n}`),this.style.setProperty("--scb-grid-align-items",this.alignItems),this.style.setProperty("--scb-grid-justify-items",this.justifyItems);const l=this.mapSpacingToken(this.paddingInline),c=this.mapSpacingToken(this.paddingBlock);d(o,this,p).call(this,"--scb-grid-max-width",this.maxWidth),d(o,this,p).call(this,"--scb-grid-padding-inline",l??""),d(o,this,p).call(this,"--scb-grid-padding-block",c??""),d(o,this,p).call(this,"--scb-grid-auto-rows",this.autoRows)}function p(a,t){t?this.style.setProperty(a,t):this.style.removeProperty(a)}e([s({type:Number,attribute:"cols-compact",reflect:!0})],r.prototype,"colsCompact",void 0);e([s({type:Number,attribute:"cols-medium",reflect:!0})],r.prototype,"colsMedium",void 0);e([s({type:Number,attribute:"cols-expanded",reflect:!0})],r.prototype,"colsExpanded",void 0);e([s({type:String,reflect:!0})],r.prototype,"gap",void 0);e([s({type:String,attribute:"row-gap",reflect:!0})],r.prototype,"rowGap",void 0);e([s({type:String,attribute:"column-gap",reflect:!0})],r.prototype,"columnGap",void 0);e([s({type:String,attribute:"align-items",reflect:!0})],r.prototype,"alignItems",void 0);e([s({type:String,attribute:"justify-items",reflect:!0})],r.prototype,"justifyItems",void 0);e([s({type:String,attribute:"padding-inline",reflect:!0})],r.prototype,"paddingInline",void 0);e([s({type:String,attribute:"padding-block",reflect:!0})],r.prototype,"paddingBlock",void 0);e([s({type:String,attribute:"max-width",reflect:!0})],r.prototype,"maxWidth",void 0);e([s({type:String,attribute:"auto-rows",reflect:!0})],r.prototype,"autoRows",void 0);r=e([v("scb-grid")],r);
98
+ `,p);function g(){this.style.setProperty("--scb-grid-cols-compact",String(this.colsCompact)),this.style.setProperty("--scb-grid-cols-medium",String(this.colsMedium)),this.style.setProperty("--scb-grid-cols-expanded",String(this.colsExpanded));const o="var(--spacing-7, 24px)",e=this.parseGapShorthand(this.gap),t=this.mapSpacingToken(this.rowGap)??e.row??o,a=this.mapSpacingToken(this.columnGap)??e.col??o;this.style.setProperty("--scb-grid-row-gap",t),this.style.setProperty("--scb-grid-column-gap",a),this.style.setProperty("--scb-grid-gap",`${t} ${a}`),this.style.setProperty("--scb-grid-align-items",this.alignItems),this.style.setProperty("--scb-grid-justify-items",this.justifyItems);const c=this.mapSpacingToken(this.paddingInline),n=this.mapSpacingToken(this.paddingBlock);this.style.setProperty("--scb-grid-max-width",this.maxWidth||"1440px"),this.style.setProperty("--scb-grid-padding-inline",c??"0"),this.style.setProperty("--scb-grid-padding-block",n??"0"),this.style.setProperty("--scb-grid-auto-rows",this.autoRows||"auto")}r([s({type:Number,attribute:"cols-compact",reflect:!0})],i.prototype,"colsCompact",void 0);r([s({type:Number,attribute:"cols-medium",reflect:!0})],i.prototype,"colsMedium",void 0);r([s({type:Number,attribute:"cols-expanded",reflect:!0})],i.prototype,"colsExpanded",void 0);r([s({type:String,reflect:!0})],i.prototype,"gap",void 0);r([s({type:String,attribute:"row-gap",reflect:!0})],i.prototype,"rowGap",void 0);r([s({type:String,attribute:"column-gap",reflect:!0})],i.prototype,"columnGap",void 0);r([s({type:String,attribute:"align-items",reflect:!0})],i.prototype,"alignItems",void 0);r([s({type:String,attribute:"justify-items",reflect:!0})],i.prototype,"justifyItems",void 0);r([s({type:String,attribute:"padding-inline",reflect:!0})],i.prototype,"paddingInline",void 0);r([s({type:String,attribute:"padding-block",reflect:!0})],i.prototype,"paddingBlock",void 0);r([s({type:String,attribute:"max-width",reflect:!0})],i.prototype,"maxWidth",void 0);r([s({type:String,attribute:"auto-rows",reflect:!0})],i.prototype,"autoRows",void 0);i=r([b("scb-grid")],i);
@@ -1,6 +1,6 @@
1
- import"../../vendor/vendor-material.js";import{_ as y,b as x,g as w,h as c,y as n}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as r}from"../../vendor/decorate.js";import"../scb-button/scb-button.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-link/scb-link.js";(function(){try{var d=typeof globalThis<"u"?globalThis:window;if(!d.__scb_ce_guard_installed__){d.__scb_ce_guard_installed__=!0;var i=customElements.define.bind(customElements);customElements.define=function(t,s,a){try{customElements.get(t)||i(t,s,a)}catch(g){var l=String(g||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw g}}}}catch{}})();var h,o=(h=class extends y{constructor(...i){super(...i),this.variant="icon-text",this.page=1,this.totalPages=0,this.pagingHref="",this.baseUri="",this.paginationAriaLabel="Paginering",this.currentAriaLabel="Nuvarande sida, ",this.pagingNumberAriaLabel="Gå till sida ",this.isNarrow=window.innerWidth<=768,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._onResize=()=>{this.isNarrow=window.innerWidth<=768}}_emitPageChange(i){const t={page:i};this.dispatchEvent(new CustomEvent("page-change",{detail:t,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("pagechange",{detail:t,bubbles:!0,composed:!0}))}_getPagingHref(i){if(!this.pagingHref)return;const t=(this.baseUri||"").trim(),s=t||window.location.href,a=new URL(s,window.location.href),l=this.pagingHref.trim().replace(/^[?&]/,"").split("=")[0];if(l)return a.searchParams.delete(l),a.searchParams.set(l,String(i)),/^https?:\/\//i.test(t)?a.toString():`${a.pathname}${a.search}${a.hash}`}_handlePageSelection(i,t){!this.pagingHref&&t&&t.preventDefault(),this.page=i,this._emitPageChange(i)}_prevPage(i){if(this.page<=1){!this.pagingHref&&i&&i.preventDefault();return}this._handlePageSelection(this.page-1,i)}_nextPage(i){if(this.page>=this.totalPages){!this.pagingHref&&i&&i.preventDefault();return}this._handlePageSelection(this.page+1,i)}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this._onResize),this._onResize()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("resize",this._onResize)}mapSpacingToken(i){if(i==null)return;const t=String(i).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}__applySpacing(){const i=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop)??i,s=this.mapSpacingToken(this.spacingBottom)??i,a=this.mapSpacingToken(this.spacingLeft),l=this.mapSpacingToken(this.spacingRight);t?this.style.setProperty("--scb-pagination-spacing-block-start",t):this.style.removeProperty("--scb-pagination-spacing-block-start"),s?this.style.setProperty("--scb-pagination-spacing-block-end",s):this.style.removeProperty("--scb-pagination-spacing-block-end"),a?this.style.setProperty("--scb-pagination-spacing-inline-start",a):this.style.removeProperty("--scb-pagination-spacing-inline-start"),l?this.style.setProperty("--scb-pagination-spacing-inline-end",l):this.style.removeProperty("--scb-pagination-spacing-inline-end")}firstUpdated(){this.__applySpacing()}updated(i){super.updated(i),(i.has("spacing")||i.has("spacingTop")||i.has("spacingBottom")||i.has("spacingLeft")||i.has("spacingRight"))&&this.__applySpacing()}render(){if(this.totalPages===0)return null;const i=this.variant?`${this.variant.toLowerCase()}`:"",t=[],{page:s,totalPages:a}=this,l=window.innerWidth<=768,g=l?1:2,b=this._getPagingHref(Math.max(1,this.page-1)),u=this._getPagingHref(Math.min(this.totalPages,this.page+1)),f=this.pagingHref?this.variant==="icon"?n`<a
1
+ import"../../vendor/vendor-material.js";import{_ as x,b as w,g as _,h as p,y as o}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as l}from"../../vendor/decorate.js";import"../scb-button/scb-button.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-link/scb-link.js";(function(){try{var h=typeof globalThis<"u"?globalThis:window;if(!h.__scb_ce_guard_installed__){h.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(n,a,s){try{customElements.get(n)||t(n,a,s)}catch(g){var e=String(g||"");if(e.indexOf("already been used")===-1&&e.indexOf("NotSupportedError")===-1)throw g}}}}catch{}})();var b,r=(b=class extends x{constructor(...t){super(...t),this.variant="icon-text",this.alignment="start",this.page=1,this.totalPages=0,this.pagingHref="",this.baseUri="",this.paginationAriaLabel="Paginering",this.currentAriaLabel="Nuvarande sida, ",this.pagingNumberAriaLabel="Gå till sida ",this.isNarrow=window.innerWidth<=768,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._onResize=()=>{this.isNarrow=window.innerWidth<=768}}_emitPageChange(t){const n={page:t};this.dispatchEvent(new CustomEvent("page-change",{detail:n,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("pagechange",{detail:n,bubbles:!0,composed:!0}))}_getPagingHref(t){if(!this.pagingHref)return;const n=(this.baseUri||"").trim(),a=n||window.location.href,s=new URL(a,window.location.href),e=this.pagingHref.trim().replace(/^[?&]/,"").split("=")[0];if(e)return s.searchParams.delete(e),s.searchParams.set(e,String(t)),/^https?:\/\//i.test(n)?s.toString():`${s.pathname}${s.search}${s.hash}`}_handlePageSelection(t,n){!this.pagingHref&&n&&n.preventDefault(),this.page=t,this._emitPageChange(t)}_prevPage(t){if(this.page<=1){!this.pagingHref&&t&&t.preventDefault();return}this._handlePageSelection(this.page-1,t)}_nextPage(t){if(this.page>=this.totalPages){!this.pagingHref&&t&&t.preventDefault();return}this._handlePageSelection(this.page+1,t)}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this._onResize),this._onResize()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("resize",this._onResize)}mapSpacingToken(t){if(t==null)return;const n=String(t).trim();if(n)return/^\d+$/.test(n)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(n,10)))})`:n}__applySpacing(){const t=this.mapSpacingToken(this.spacing),n=this.mapSpacingToken(this.spacingTop)??t,a=this.mapSpacingToken(this.spacingBottom)??t,s=this.mapSpacingToken(this.spacingLeft),e=this.mapSpacingToken(this.spacingRight);n?this.style.setProperty("--scb-pagination-spacing-block-start",n):this.style.removeProperty("--scb-pagination-spacing-block-start"),a?this.style.setProperty("--scb-pagination-spacing-block-end",a):this.style.removeProperty("--scb-pagination-spacing-block-end"),s?this.style.setProperty("--scb-pagination-spacing-inline-start",s):this.style.removeProperty("--scb-pagination-spacing-inline-start"),e?this.style.setProperty("--scb-pagination-spacing-inline-end",e):this.style.removeProperty("--scb-pagination-spacing-inline-end")}firstUpdated(){this.__applySpacing()}updated(t){super.updated(t),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&this.__applySpacing()}render(){if(this.totalPages===0)return null;const t=this.variant?`${this.variant.toLowerCase()}`:"",n=this.alignment==="center"||this.alignment==="end"?`align-${this.alignment}`:"align-start",a=[],{page:s,totalPages:e}=this,g=window.innerWidth<=768,d=g?1:2,u=this._getPagingHref(Math.max(1,this.page-1)),f=this._getPagingHref(Math.min(this.totalPages,this.page+1)),m=this.pagingHref?this.variant==="icon"?o`<a
2
2
  class="paging-action-link"
3
- href=${b}
3
+ href=${u}
4
4
  @click=${this._prevPage}
5
5
  aria-label="Föregående sida"
6
6
  aria-disabled=${this.page===1?"true":"false"}
@@ -10,9 +10,9 @@ import"../../vendor/vendor-material.js";import{_ as y,b as x,g as w,h as c,y as
10
10
  ?disabled=${this.page===1}
11
11
  aria-label="Föregående sida"
12
12
  ></scb-icon-button>
13
- </a>`:n`<a
13
+ </a>`:o`<a
14
14
  class="paging-action-link"
15
- href=${b}
15
+ href=${u}
16
16
  @click=${this._prevPage}
17
17
  aria-label="Föregående sida"
18
18
  aria-disabled=${this.page===1?"true":"false"}
@@ -24,21 +24,21 @@ import"../../vendor/vendor-material.js";import{_ as y,b as x,g as w,h as c,y as
24
24
  ?disabled=${this.page===1}
25
25
  aria-label="Föregående sida"
26
26
  ></scb-button>
27
- </a>`:this.variant==="icon"?n`<scb-icon-button
27
+ </a>`:this.variant==="icon"?o`<scb-icon-button
28
28
  icon="chevron_left"
29
29
  @click=${this._prevPage}
30
30
  ?disabled=${this.page===1}
31
31
  aria-label="Föregående sida"
32
- ></scb-icon-button>`:n`<scb-button
32
+ ></scb-icon-button>`:o`<scb-button
33
33
  variant="text"
34
34
  label="Föregående"
35
35
  icon="chevron_left"
36
36
  @click=${this._prevPage}
37
37
  ?disabled=${this.page===1}
38
38
  aria-label="Föregående sida"
39
- ></scb-button>`,m=this.pagingHref?this.variant==="icon"?n`<a
39
+ ></scb-button>`,v=this.pagingHref?this.variant==="icon"?o`<a
40
40
  class="paging-action-link"
41
- href=${u}
41
+ href=${f}
42
42
  @click=${this._nextPage}
43
43
  aria-label="Nästa sida"
44
44
  aria-disabled=${this.page===this.totalPages?"true":"false"}
@@ -48,9 +48,9 @@ import"../../vendor/vendor-material.js";import{_ as y,b as x,g as w,h as c,y as
48
48
  ?disabled=${this.page===this.totalPages}
49
49
  aria-label="Nästa sida"
50
50
  ></scb-icon-button>
51
- </a>`:n`<a
51
+ </a>`:o`<a
52
52
  class="paging-action-link"
53
- href=${u}
53
+ href=${f}
54
54
  @click=${this._nextPage}
55
55
  aria-label="Nästa sida"
56
56
  aria-disabled=${this.page===this.totalPages?"true":"false"}
@@ -64,12 +64,12 @@ import"../../vendor/vendor-material.js";import{_ as y,b as x,g as w,h as c,y as
64
64
  aria-label="Nästa sida"
65
65
  trailing-icon
66
66
  ></scb-button>
67
- </a>`:this.variant==="icon"?n`<scb-icon-button
67
+ </a>`:this.variant==="icon"?o`<scb-icon-button
68
68
  icon="chevron_right"
69
69
  @click=${this._nextPage}
70
70
  ?disabled=${this.page===this.totalPages}
71
71
  aria-label="Nästa sida"
72
- ></scb-icon-button>`:n`<scb-button
72
+ ></scb-icon-button>`:o`<scb-button
73
73
  variant="text"
74
74
  label="Nästa"
75
75
  icon="chevron_right"
@@ -78,56 +78,56 @@ import"../../vendor/vendor-material.js";import{_ as y,b as x,g as w,h as c,y as
78
78
  ?disabled=${this.page===this.totalPages}
79
79
  aria-label="Nästa sida"
80
80
  trailing-icon
81
- ></scb-button>`,p=e=>e===s?n`
81
+ ></scb-button>`,c=i=>i===s?o`
82
82
  <li>
83
83
  <span
84
84
  class="page-number active"
85
85
  aria-current="page"
86
- aria-label="${this.currentAriaLabel} ${e}"
87
- >${e}</span
86
+ aria-label="${this.currentAriaLabel} ${i}"
87
+ >${i}</span
88
88
  >
89
89
  </li>
90
- `:n`
90
+ `:o`
91
91
  <li>
92
92
  <scb-link
93
- class="page-number${e===s?" active":""}"
94
- @click=${v=>this._handlePageSelection(e,v)}
95
- aria-current=${e===s?"page":void 0}
96
- aria-label="${this.pagingNumberAriaLabel} ${e}"
97
- href=${this._getPagingHref(e)}
98
- ?disabled=${e===s}
99
- >${e}</scb-link
93
+ class="page-number${i===s?" active":""}"
94
+ @click=${y=>this._handlePageSelection(i,y)}
95
+ aria-current=${i===s?"page":void 0}
96
+ aria-label="${this.pagingNumberAriaLabel} ${i}"
97
+ href=${this._getPagingHref(i)}
98
+ ?disabled=${i===s}
99
+ >${i}</scb-link
100
100
  >
101
101
  </li>
102
- `;if(a<=8)for(let e=1;e<=a;e++)t.push(p(e));else if(t.push(p(1)),s<=4&&!l){for(let e=2;e<=5;e++)t.push(p(e));a>6?(t.push(n`<li><span class="ellipsis" aria-hidden="true">…</span></li>`),t.push(p(a))):a===6&&t.push(p(a))}else if(s<=3&&l){for(let e=2;e<=3;e++)t.push(p(e));a>4?(t.push(n`<li><span class="ellipsis" aria-hidden="true">…</span></li>`),t.push(p(a))):a===4&&t.push(p(a))}else if(s>=a-(g+1)){t.push(n`<li><span class="ellipsis" aria-hidden="true">…</span></li>`);for(let e=a-g*2;e<=a;e++)e>1&&t.push(p(e))}else{t.push(n`<li><span class="ellipsis" aria-hidden="true">…</span></li>`);for(let e=s-g;e<=s+g;e++)e>1&&e<a&&t.push(p(e));t.push(n`<li><span class="ellipsis" aria-hidden="true">…</span></li>`),t.push(p(a))}return l?n`
103
- <nav aria-label="${this.paginationAriaLabel}" class="pagination ${i}">
102
+ `;if(e<=8)for(let i=1;i<=e;i++)a.push(c(i));else if(a.push(c(1)),s<=4&&!g){for(let i=2;i<=5;i++)a.push(c(i));e>6?(a.push(o`<li><span class="ellipsis" aria-hidden="true">…</span></li>`),a.push(c(e))):e===6&&a.push(c(e))}else if(s<=3&&g){for(let i=2;i<=3;i++)a.push(c(i));e>4?(a.push(o`<li><span class="ellipsis" aria-hidden="true">…</span></li>`),a.push(c(e))):e===4&&a.push(c(e))}else if(s>=e-(d+1)){a.push(o`<li><span class="ellipsis" aria-hidden="true">…</span></li>`);for(let i=e-d*2;i<=e;i++)i>1&&a.push(c(i))}else{a.push(o`<li><span class="ellipsis" aria-hidden="true">…</span></li>`);for(let i=s-d;i<=s+d;i++)i>1&&i<e&&a.push(c(i));a.push(o`<li><span class="ellipsis" aria-hidden="true">…</span></li>`),a.push(c(e))}return g?o`
103
+ <nav aria-label="${this.paginationAriaLabel}" class="pagination ${t} ${n}">
104
104
  <div class="pagination-row">
105
105
  <div class="prev">
106
- ${f}
106
+ ${m}
107
107
  </div>
108
108
  <ol>
109
- ${t}
109
+ ${a}
110
110
  </ol>
111
111
  </div>
112
112
  <div class="next">
113
- ${m}
113
+ ${v}
114
114
  </div>
115
115
  </nav>
116
- `:n`
117
- <nav aria-label="${this.paginationAriaLabel}" class="pagination ${i}">
116
+ `:o`
117
+ <nav aria-label="${this.paginationAriaLabel}" class="pagination ${t} ${n}">
118
118
  <div class="pagination-row">
119
119
  <div class="prev">
120
- ${f}
120
+ ${m}
121
121
  </div>
122
122
  <ol>
123
- ${t}
123
+ ${a}
124
124
  </ol>
125
125
  <div class="next">
126
- ${m}
126
+ ${v}
127
127
  </div>
128
128
  </div>
129
129
  </nav>
130
- `}},h.styles=[x`
130
+ `}},b.styles=[w`
131
131
  :host {
132
132
  display: block;
133
133
  width: 100%;
@@ -204,6 +204,26 @@ import"../../vendor/vendor-material.js";import{_ as y,b as x,g as w,h as c,y as
204
204
  width: auto;
205
205
  margin-top: 0;
206
206
  }
207
+ .pagination.align-center .pagination-row,
208
+ .pagination.align-center .pagination-row ol,
209
+ .pagination.align-center .pagination-row .prev,
210
+ .pagination.align-center .pagination-row .next,
211
+ .pagination.align-center > .next {
212
+ justify-content: center;
213
+ }
214
+ .pagination.align-center > .next {
215
+ display: flex;
216
+ }
217
+ .pagination.align-end .pagination-row,
218
+ .pagination.align-end .pagination-row ol,
219
+ .pagination.align-end .pagination-row .prev,
220
+ .pagination.align-end .pagination-row .next,
221
+ .pagination.align-end > .next {
222
+ justify-content: flex-end;
223
+ }
224
+ .pagination.align-end > .next {
225
+ display: flex;
226
+ }
207
227
  scb-link.page-number a {
208
228
  cursor: pointer;
209
229
  text-decoration: none;
@@ -309,4 +329,4 @@ import"../../vendor/vendor-material.js";import{_ as y,b as x,g as w,h as c,y as
309
329
  margin-top: 8px;
310
330
  }
311
331
  }
312
- `],h);r([c({type:String})],o.prototype,"variant",void 0);r([c({type:Number})],o.prototype,"page",void 0);r([c({type:Number,attribute:"total-pages"})],o.prototype,"totalPages",void 0);r([c({type:String,attribute:"paging-href"})],o.prototype,"pagingHref",void 0);r([c({type:String,attribute:"base-uri"})],o.prototype,"baseUri",void 0);r([c({type:String,attribute:"pagination-aria-label"})],o.prototype,"paginationAriaLabel",void 0);r([c({type:String,attribute:"current-aria-label"})],o.prototype,"currentAriaLabel",void 0);r([c({type:String,attribute:"paging-number-aria-label"})],o.prototype,"pagingNumberAriaLabel",void 0);r([c({type:Boolean})],o.prototype,"isNarrow",void 0);r([c({type:String})],o.prototype,"spacing",void 0);r([c({type:String,attribute:"spacing-top"})],o.prototype,"spacingTop",void 0);r([c({type:String,attribute:"spacing-bottom"})],o.prototype,"spacingBottom",void 0);r([c({type:String,attribute:"spacing-left"})],o.prototype,"spacingLeft",void 0);r([c({type:String,attribute:"spacing-right"})],o.prototype,"spacingRight",void 0);o=r([w("scb-pagination")],o);
332
+ `],b);l([p({type:String})],r.prototype,"variant",void 0);l([p({type:String})],r.prototype,"alignment",void 0);l([p({type:Number})],r.prototype,"page",void 0);l([p({type:Number,attribute:"total-pages"})],r.prototype,"totalPages",void 0);l([p({type:String,attribute:"paging-href"})],r.prototype,"pagingHref",void 0);l([p({type:String,attribute:"base-uri"})],r.prototype,"baseUri",void 0);l([p({type:String,attribute:"pagination-aria-label"})],r.prototype,"paginationAriaLabel",void 0);l([p({type:String,attribute:"current-aria-label"})],r.prototype,"currentAriaLabel",void 0);l([p({type:String,attribute:"paging-number-aria-label"})],r.prototype,"pagingNumberAriaLabel",void 0);l([p({type:Boolean})],r.prototype,"isNarrow",void 0);l([p({type:String})],r.prototype,"spacing",void 0);l([p({type:String,attribute:"spacing-top"})],r.prototype,"spacingTop",void 0);l([p({type:String,attribute:"spacing-bottom"})],r.prototype,"spacingBottom",void 0);l([p({type:String,attribute:"spacing-left"})],r.prototype,"spacingLeft",void 0);l([p({type:String,attribute:"spacing-right"})],r.prototype,"spacingRight",void 0);r=l([_("scb-pagination")],r);
@@ -1,8 +1,8 @@
1
- import{_ as g,b as _,g as v,h as b,y as C}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as f}from"../../vendor/decorate.js";import"../scb-icon-button/scb-icon-button.js";(function(){try{var y=typeof globalThis<"u"?globalThis:window;if(!y.__scb_ce_guard_installed__){y.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(r,s,o){try{customElements.get(r)||e(r,s,o)}catch(n){var l=String(n||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw n}}}}catch{}})();var p,m=(p=class extends g{constructor(...e){super(...e),this.dataSorting=!1,this.columnWidthMode="auto",this._sortedColumn=null,this._sortDirection="asc",this._columnWidthFrame=null,this._onSlotChange=()=>{this._attachThListeners()}}render(){return C`
1
+ import{_ as g,b as _,g as v,h as f,y as C}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as b}from"../../vendor/decorate.js";import"../scb-icon-button/scb-icon-button.js";(function(){try{var y=typeof globalThis<"u"?globalThis:window;if(!y.__scb_ce_guard_installed__){y.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(r,s,o){try{customElements.get(r)||t(r,s,o)}catch(a){var l=String(a||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw a}}}}catch{}})();var p,m=(p=class extends g{constructor(...t){super(...t),this.dataSorting=!1,this.columnWidthMode="auto",this._sortedColumn=null,this._sortDirection="asc",this._columnWidthFrame=null,this._onSlotChange=()=>{this._attachThListeners()}}render(){return C`
2
2
  <div class="scb-table-scroll-wrapper">
3
3
  <slot @slotchange=${this._onSlotChange}></slot>
4
4
  </div>
5
- `}firstUpdated(){const e=this.shadowRoot?.querySelector("slot");e&&(e.addEventListener("slotchange",()=>this._attachThListeners()),this._attachThListeners())}updated(e){e.has("dataSorting")&&(this.dataSorting||(this._sortedColumn=null,this._sortDirection="asc"),this._attachThListeners()),e.has("columnWidthMode")&&this._queueColumnWidthUpdate()}disconnectedCallback(){super.disconnectedCallback(),this._columnWidthFrame!==null&&(cancelAnimationFrame(this._columnWidthFrame),this._columnWidthFrame=null)}_getTbody(){const e=this.shadowRoot?.querySelector("slot");if(!e)return null;const r=e.assignedNodes({flatten:!0});for(const s of r)if(s.nodeType===Node.ELEMENT_NODE){const o=s,l=o.tagName.toLowerCase()==="tbody"?o:o.querySelector("tbody");if(l)return l}return null}_getTables(){const e=this.shadowRoot?.querySelector("slot");if(!e)return[];const r=e.assignedNodes({flatten:!0}),s=[];return r.forEach(o=>{if(o.nodeType===Node.ELEMENT_NODE){const l=o;l.tagName.toLowerCase()==="table"&&s.push(l),s.push(...Array.from(l.querySelectorAll("table")))}}),s}_attachThListeners(){const e=this.shadowRoot?.querySelector("slot");if(!e)return;const r=e.assignedNodes({flatten:!0}),s=[],o=[],l=[],n=[];r.forEach(t=>{t.nodeType===Node.ELEMENT_NODE&&(s.push(...t.querySelectorAll("thead")),o.push(...t.querySelectorAll("th")),l.push(...t.querySelectorAll("td")),n.push(...t.querySelectorAll("tr")))}),s.forEach(t=>{t.style.borderTop="1px solid var(--md-sys-color-on-surface)"}),o.forEach((t,d)=>{t.style.textAlign="left",t.style.padding="12px",t.style.position="relative",t.style.backgroundColor="var(--md-sys-color-surface)",t.style.fontFamily="var(--md-sys-typescale-label-medium-font)",t.style.fontSize="var(--md-sys-typescale-label-medium-size)",t.style.lineHeight="var(--md-sys-typescale-label-medium-line-height)",t.style.fontWeight=" var(--weight-bold)",t.style.letterSpacing="var(--md-sys-typescale-label-medium-tracking)",t.style.verticalAlign="bottom",t.style.borderRight="1px solid var(--md-sys-color-on-surface)",t.style.borderBottom="1px solid var(--md-sys-color-on-surface)";const u=(t.textContent??"").replace(/\s+/g," ").trim();for(;t.firstChild;)t.removeChild(t.firstChild);const c=document.createElement("p");if(c.textContent=u,c.style.margin="0",this.dataSorting){const a=document.createElement("scb-icon-button");a.className="scb-sort-icon",a.onclick=()=>this._onThClick(d),a.setAttribute("variant","standard"),a.setAttribute("size","small"),a.style.alignSelf="end",this._sortedColumn===d?(a.setAttribute("variant","filled-tonal"),a.setAttribute("icon",this._sortDirection==="asc"?"arrow_downward":"arrow_upward")):(a.setAttribute("icon","swap_horiz"),a.style.transform+=" rotate(90deg)");const h=document.createElement("div");h.style.display="flex",h.style.gap="8px",h.style.flexWrap="nowrap",h.style.alignItems="center",h.appendChild(c),h.appendChild(a),t.appendChild(h)}else t.appendChild(c)}),l.forEach(t=>{t.style.padding="12px",t.style.textAlign="left",t.style.borderTop="1px solid var(--md-sys-color-outline-variant)",t.style.verticalAlign="text-top",t.style.backgroundColor="var(--md-sys-color-surface)",t.style.fontFamily="var(--md-sys-typescale-body-medium-font)",t.style.fontSize="var(--md-sys-typescale-body-medium-size)",t.style.lineHeight="var(--md-sys-typescale-body-medium-line-height)",t.style.fontWeight="var(--md-sys-typescale-body-medium-weight)",t.style.letterSpacing="var(--md-sys-typescale-body-medium-tracking)",t.style.borderRight="1px solid var(--md-sys-color-on-surface)",t.style.borderBottom="1px solid var(--md-sys-color-on-surface)"}),n.forEach(t=>{const d=t.querySelectorAll("th");d.length>0&&d.forEach((c,a)=>{a===d.length-1&&(c.style.borderRight="none")});const u=t.querySelectorAll("td");u.length>0&&u.forEach((c,a)=>{a===u.length-1&&(c.style.borderRight="none")})});const i=this._getTbody();i&&Array.from(i.querySelectorAll("tr")).forEach((t,d)=>{const u=d%2===0?"var(--md-sys-color-surface-container)":"var(--md-sys-color-surface)";t.querySelectorAll("td").forEach(c=>{c.style.backgroundColor=u})}),this._queueColumnWidthUpdate()}_queueColumnWidthUpdate(){this._columnWidthFrame!==null&&cancelAnimationFrame(this._columnWidthFrame),this._columnWidthFrame=requestAnimationFrame(()=>{this._columnWidthFrame=null,this._applyColumnWidthMode()})}_applyColumnWidthMode(){this._getTables().forEach(e=>{if(this._removeGeneratedColGroup(e),e.style.tableLayout="",e.style.width="",e.style.minWidth="",e.style.maxWidth="",this.columnWidthMode!=="header")return;const r=Array.from(e.querySelectorAll("thead tr")),s=r[r.length-1];if(!s)return;const o=Array.from(s.cells).map(n=>`${Math.ceil(this._measureCellContentWidth(n))}px`),l=o.reduce((n,i)=>n+parseFloat(i),0);this._applyGeneratedColGroup(e,o),e.style.tableLayout="fixed",e.style.width=`${Math.ceil(l)}px`,e.style.minWidth=`${Math.ceil(l)}px`,e.style.maxWidth="none"})}_applyGeneratedColGroup(e,r){const s=document.createElement("colgroup");s.setAttribute("data-scb-generated-column-widths","true"),r.forEach(o=>{const l=document.createElement("col");l.style.width=o,l.style.minWidth=o,s.appendChild(l)}),e.insertBefore(s,e.firstChild)}_removeGeneratedColGroup(e){e.querySelector('colgroup[data-scb-generated-column-widths="true"]')?.remove()}_measureCellContentWidth(e){const r=e.firstElementChild?.cloneNode(!0)??document.createElement("span");e.firstElementChild||(r.textContent=e.textContent??"");const s=window.getComputedStyle(e),o=document.createElement("div");o.style.position="absolute",o.style.left="-99999px",o.style.top="0",o.style.visibility="hidden",o.style.pointerEvents="none",o.style.width="max-content",o.style.maxWidth="none",o.style.whiteSpace="nowrap",o.style.fontFamily=s.fontFamily,o.style.fontSize=s.fontSize,o.style.fontWeight=s.fontWeight,o.style.lineHeight=s.lineHeight,o.style.letterSpacing=s.letterSpacing,r instanceof HTMLElement&&(r.style.width="max-content",r.style.maxWidth="none",r.style.whiteSpace="nowrap"),o.appendChild(r),document.body.appendChild(o);const l=parseFloat(s.paddingLeft||"0"),n=parseFloat(s.paddingRight||"0"),i=o.getBoundingClientRect().width+l+n;return document.body.removeChild(o),i}_onThClick(e){this.dataSorting&&(this._sortedColumn===e?this._sortDirection=this._sortDirection==="asc"?"desc":"asc":(this._sortedColumn=e,this._sortDirection="asc"),this._sortTable(e,this._sortDirection),this._attachThListeners(),this.dispatchEvent(new CustomEvent("tablesortchange",{detail:{sortedColumn:this._sortedColumn,sortDirection:this._sortDirection},bubbles:!0,composed:!0})))}_sortTable(e,r){const s=this._getTbody();if(!s)return;const o=Array.from(s.querySelectorAll("tr"));o.sort((l,n)=>{const i=l.children[e]?.textContent?.trim()??"",t=n.children[e]?.textContent?.trim()??"";return this._compareCellValues(i,t,r)}),o.forEach(l=>s.appendChild(l))}_compareCellValues(e,r,s){const o=this._parseSortableNumber(e),l=this._parseSortableNumber(r);if(o!==null&&l!==null)return s==="asc"?o-l:l-o;const n=Date.parse(e.replace(/\s+/g," ")),i=Date.parse(r.replace(/\s+/g," "));if(!isNaN(n)&&!isNaN(i))return s==="asc"?n-i:i-n;const t=e.localeCompare(r,"sv");return s==="asc"?t:-t}_parseSortableNumber(e){const r=e.trim();if(!/^[+-]?(?:\d+|\d{1,3}(?:[\s\u00a0\u202f]\d{3})+)(?:[,.]\d+)?$/.test(r))return null;const s=Number(r.replace(/[\s\u00a0\u202f]/g,"").replace(",","."));return Number.isNaN(s)?null:s}},p.styles=_`
5
+ `}firstUpdated(){const t=this.shadowRoot?.querySelector("slot");t&&(t.addEventListener("slotchange",()=>this._attachThListeners()),this._attachThListeners())}updated(t){t.has("dataSorting")&&(this.dataSorting||(this._sortedColumn=null,this._sortDirection="asc"),this._attachThListeners()),t.has("columnWidthMode")&&this._queueColumnWidthUpdate()}disconnectedCallback(){super.disconnectedCallback(),this._columnWidthFrame!==null&&(cancelAnimationFrame(this._columnWidthFrame),this._columnWidthFrame=null)}_getTbody(){const t=this.shadowRoot?.querySelector("slot");if(!t)return null;const r=t.assignedNodes({flatten:!0});for(const s of r)if(s.nodeType===Node.ELEMENT_NODE){const o=s,l=o.tagName.toLowerCase()==="tbody"?o:o.querySelector("tbody");if(l)return l}return null}_getTables(){const t=this.shadowRoot?.querySelector("slot");if(!t)return[];const r=t.assignedNodes({flatten:!0}),s=[];return r.forEach(o=>{if(o.nodeType===Node.ELEMENT_NODE){const l=o;l.tagName.toLowerCase()==="table"&&s.push(l),s.push(...Array.from(l.querySelectorAll("table")))}}),s}_attachThListeners(){const t=this.shadowRoot?.querySelector("slot");if(!t)return;const r=t.assignedNodes({flatten:!0}),s=[],o=[],l=[],a=[];r.forEach(e=>{e.nodeType===Node.ELEMENT_NODE&&(s.push(...e.querySelectorAll("thead")),o.push(...e.querySelectorAll("th")),l.push(...e.querySelectorAll("td")),a.push(...e.querySelectorAll("tr")))}),s.forEach(e=>{e.style.borderTop="1px solid var(--md-sys-color-on-surface)"}),o.forEach((e,d)=>{e.style.textAlign="left",e.style.padding="12px",e.style.position="relative",e.style.backgroundColor="var(--md-sys-color-surface)",e.style.fontFamily="var(--md-sys-typescale-label-medium-font)",e.style.fontSize="var(--md-sys-typescale-label-medium-size)",e.style.lineHeight="var(--md-sys-typescale-label-medium-line-height)",e.style.fontWeight=" var(--weight-bold)",e.style.letterSpacing="var(--md-sys-typescale-label-medium-tracking)",e.style.verticalAlign="bottom",e.style.borderRight="1px solid var(--md-sys-color-on-surface)",e.style.borderBottom="1px solid var(--md-sys-color-on-surface)";const u=(e.textContent??"").replace(/\s+/g," ").trim();for(;e.firstChild;)e.removeChild(e.firstChild);const c=document.createElement("p");if(c.textContent=u,c.style.margin="0",this.dataSorting){const n=document.createElement("scb-icon-button");n.className="scb-sort-icon",n.onclick=()=>this._onThClick(d),n.setAttribute("variant","standard"),n.setAttribute("size","small"),n.style.alignSelf="end",this._sortedColumn===d?(n.setAttribute("variant","filled-tonal"),n.setAttribute("icon",this._sortDirection==="asc"?"arrow_downward":"arrow_upward")):(n.setAttribute("icon","swap_horiz"),n.style.transform+=" rotate(90deg)");const h=document.createElement("div");h.style.display="flex",h.style.gap="8px",h.style.flexWrap="nowrap",h.style.alignItems="center",h.appendChild(c),h.appendChild(n),e.appendChild(h)}else e.appendChild(c)}),l.forEach(e=>{e.style.padding="12px",e.style.textAlign="left",e.style.borderTop="1px solid var(--md-sys-color-outline-variant)",e.style.verticalAlign="text-top",e.style.backgroundColor="var(--md-sys-color-surface)",e.style.fontFamily="var(--md-sys-typescale-body-medium-font)",e.style.fontSize="var(--md-sys-typescale-body-medium-size)",e.style.lineHeight="var(--md-sys-typescale-body-medium-line-height)",e.style.fontWeight="var(--md-sys-typescale-body-medium-weight)",e.style.letterSpacing="var(--md-sys-typescale-body-medium-tracking)",e.style.borderRight="1px solid var(--md-sys-color-on-surface)",e.style.borderBottom="1px solid var(--md-sys-color-on-surface)"}),a.forEach(e=>{const d=e.querySelectorAll("th");d.length>0&&d.forEach((c,n)=>{n===d.length-1&&(c.style.borderRight="none")});const u=e.querySelectorAll("td");u.length>0&&u.forEach((c,n)=>{n===u.length-1&&(c.style.borderRight="none")})});const i=this._getTbody();i&&Array.from(i.querySelectorAll("tr")).forEach((e,d)=>{const u=d%2===0?"var(--md-sys-color-surface-container)":"var(--md-sys-color-surface)";e.querySelectorAll("td").forEach(c=>{c.style.backgroundColor=u})}),this._queueColumnWidthUpdate()}_queueColumnWidthUpdate(){this._columnWidthFrame!==null&&cancelAnimationFrame(this._columnWidthFrame),this._columnWidthFrame=requestAnimationFrame(()=>{this._columnWidthFrame=null,this._applyColumnWidthMode()})}_applyColumnWidthMode(){this._getTables().forEach(t=>{if(this._removeGeneratedColGroup(t),t.style.tableLayout="",t.style.width="",t.style.minWidth="",t.style.maxWidth="",this.columnWidthMode!=="header")return;const r=Array.from(t.querySelectorAll("thead tr")),s=r[r.length-1];if(!s)return;const o=Array.from(s.cells).map(a=>`${Math.ceil(this._measureCellContentWidth(a))}px`),l=o.reduce((a,i)=>a+parseFloat(i),0);this._applyGeneratedColGroup(t,o),t.style.tableLayout="fixed",t.style.width=`${Math.ceil(l)}px`,t.style.minWidth=`${Math.ceil(l)}px`,t.style.maxWidth="none"})}_applyGeneratedColGroup(t,r){const s=document.createElement("colgroup");s.setAttribute("data-scb-generated-column-widths","true"),r.forEach(o=>{const l=document.createElement("col");l.style.width=o,l.style.minWidth=o,s.appendChild(l)}),t.insertBefore(s,t.firstChild)}_removeGeneratedColGroup(t){t.querySelector('colgroup[data-scb-generated-column-widths="true"]')?.remove()}_measureCellContentWidth(t){const r=t.firstElementChild?.cloneNode(!0)??document.createElement("span");t.firstElementChild||(r.textContent=t.textContent??"");const s=window.getComputedStyle(t),o=document.createElement("div");o.style.position="absolute",o.style.left="-99999px",o.style.top="0",o.style.visibility="hidden",o.style.pointerEvents="none",o.style.width="max-content",o.style.maxWidth="none",o.style.whiteSpace="nowrap",o.style.fontFamily=s.fontFamily,o.style.fontSize=s.fontSize,o.style.fontWeight=s.fontWeight,o.style.lineHeight=s.lineHeight,o.style.letterSpacing=s.letterSpacing,r instanceof HTMLElement&&(r.style.width="max-content",r.style.maxWidth="none",r.style.whiteSpace="nowrap"),o.appendChild(r),document.body.appendChild(o);const l=parseFloat(s.paddingLeft||"0"),a=parseFloat(s.paddingRight||"0"),i=o.getBoundingClientRect().width+l+a;return document.body.removeChild(o),i}_onThClick(t){this.dataSorting&&(this._sortedColumn===t?this._sortDirection=this._sortDirection==="asc"?"desc":"asc":(this._sortedColumn=t,this._sortDirection="asc"),this._sortTable(t,this._sortDirection),this._attachThListeners(),this.dispatchEvent(new CustomEvent("tablesortchange",{detail:{sortedColumn:this._sortedColumn,sortDirection:this._sortDirection},bubbles:!0,composed:!0})))}_sortTable(t,r){const s=this._getTbody();if(!s)return;const o=Array.from(s.querySelectorAll("tr"));o.sort((l,a)=>{const i=this._getCellSortableValue(l.children[t]),e=this._getCellSortableValue(a.children[t]);return this._compareCellValues(i,e,r)}),o.forEach(l=>s.appendChild(l))}_getCellSortableValue(t){if(!t)return"";const r=t,s=this._getSortableAttributeValue(r);if(s)return s;const o=[],l=r.textContent?.replace(/\s+/g," ").trim();return l&&o.push(l),r.querySelectorAll("[data-sort-value], [data-sort], [aria-label], [label], [value], [title]").forEach(a=>{const i=this._getSortableAttributeValue(a);i&&!o.includes(i)&&o.push(i)}),o.join(" ").trim()}_getSortableAttributeValue(t){return(t.getAttribute("data-sort-value")??t.getAttribute("data-sort")??t.getAttribute("aria-label")??t.getAttribute("label")??t.getAttribute("value")??t.getAttribute("title")??"").replace(/\s+/g," ").trim()}_compareCellValues(t,r,s){const o=this._parseSortableNumber(t),l=this._parseSortableNumber(r);if(o!==null&&l!==null)return s==="asc"?o-l:l-o;const a=Date.parse(t.replace(/\s+/g," ")),i=Date.parse(r.replace(/\s+/g," "));if(!isNaN(a)&&!isNaN(i))return s==="asc"?a-i:i-a;const e=t.localeCompare(r,"sv");return s==="asc"?e:-e}_parseSortableNumber(t){const r=t.trim();if(!/^[+-]?(?:\d+|\d{1,3}(?:[\s\u00a0\u202f]\d{3})+)(?:[,.]\d+)?$/.test(r))return null;const s=Number(r.replace(/[\s\u00a0\u202f]/g,"").replace(",","."));return Number.isNaN(s)?null:s}},p.styles=_`
6
6
  :host {
7
7
  display: block;
8
8
  color: var(--md-sys-color-on-surface);
@@ -48,4 +48,4 @@ import{_ as g,b as _,g as v,h as b,y as C}from"../../vendor/vendor.js";import"..
48
48
  ::slotted(th:hover) .scb-sort-icon {
49
49
  pointer-events: auto;
50
50
  }
51
- `,p);f([b({type:Boolean,attribute:"data-sorting"})],m.prototype,"dataSorting",void 0);f([b({type:String,attribute:"column-width-mode"})],m.prototype,"columnWidthMode",void 0);m=f([v("scb-table")],m);
51
+ `,p);b([f({type:Boolean,attribute:"data-sorting"})],m.prototype,"dataSorting",void 0);b([f({type:String,attribute:"column-width-mode"})],m.prototype,"columnWidthMode",void 0);m=b([v("scb-table")],m);
@@ -1,19 +1,19 @@
1
- import{_,b as m,g as v,h as p,y as b}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as u}from"../../vendor/decorate.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-search/scb-search.js";import"../scb-pagination/scb-pagination.js";(function(){try{var f=typeof globalThis<"u"?globalThis:window;if(!f.__scb_ce_guard_installed__){f.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(o,s,n){try{customElements.get(o)||e(o,s,n)}catch(t){var a=String(t||"");if(a.indexOf("already been used")===-1&&a.indexOf("NotSupportedError")===-1)throw t}}}}catch{}})();var y,d=(y=class extends _{constructor(...e){super(...e),this.searchTerm="",this.pagination=!1,this.filteringSearch=!1,this.noScroll=!1,this.pageSize=10,this.currentPage=1,this.totalRows=0,this._sortedColumn=null,this._sortDirection="asc",this._filteredRows=null,this._tbodyObserver=null,this._observedTbody=null,this._pendingTableRefresh=!1,this._suppressTbodyObserver=!1,this._onSlotChange=()=>{this._attachTbodyObserver(),this._refreshFromTableContent()},this._onPaginationChange=o=>{const s=o.detail;s&&typeof s.page=="number"&&this._changePage(s.page)}}disconnectedCallback(){super.disconnectedCallback(),this._disconnectTbodyObserver()}attributeChangedCallback(e,o,s){if(super.attributeChangedCallback(e,o,s),o!==s){if(e==="searchterm"){queueMicrotask(()=>{this.isConnected&&this._filterTable()});return}if(e==="currentpage"){queueMicrotask(()=>{this.isConnected&&this._paginateTable()});return}(e==="page-size"||e==="with-filtering-search"||e==="with-pagination")&&this._scheduleTableRefresh()}}render(){const e=Math.ceil(this.totalRows/this.pageSize);return b`
2
- ${this.filteringSearch?b`
1
+ import{_,b as m,g as v,h as b,y as p}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as u}from"../../vendor/decorate.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-search/scb-search.js";import"../scb-pagination/scb-pagination.js";(function(){try{var f=typeof globalThis<"u"?globalThis:window;if(!f.__scb_ce_guard_installed__){f.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(s,r,l){try{customElements.get(s)||e(s,r,l)}catch(t){var a=String(t||"");if(a.indexOf("already been used")===-1&&a.indexOf("NotSupportedError")===-1)throw t}}}}catch{}})();var y,d=(y=class extends _{constructor(...e){super(...e),this.searchTerm="",this.pagination=!1,this.filteringSearch=!1,this.noScroll=!1,this.pageSize=10,this.currentPage=1,this.totalRows=0,this._sortedColumn=null,this._sortDirection="asc",this._filteredRows=null,this._tbodyObserver=null,this._observedTbody=null,this._pendingTableRefresh=!1,this._suppressTbodyObserver=!1,this._onSlotChange=()=>{this._attachTbodyObserver(),this._refreshFromTableContent()},this._onPaginationChange=s=>{const r=s.detail;r&&typeof r.page=="number"&&this._changePage(r.page)}}disconnectedCallback(){super.disconnectedCallback(),this._disconnectTbodyObserver()}attributeChangedCallback(e,s,r){if(super.attributeChangedCallback(e,s,r),s!==r){if(e==="searchterm"){queueMicrotask(()=>{this.isConnected&&this._filterTable()});return}if(e==="currentpage"){queueMicrotask(()=>{this.isConnected&&this._paginateTable()});return}(e==="page-size"||e==="with-filtering-search"||e==="with-pagination")&&this._scheduleTableRefresh()}}render(){const e=Math.ceil(this.totalRows/this.pageSize);return p`
2
+ ${this.filteringSearch?p`
3
3
  <div style="margin-bottom: 12px;">
4
4
  <scb-search
5
5
  value=${this.searchTerm}
6
- @input=${o=>this._onSearchInput(o)}
6
+ @input=${s=>this._onSearchInput(s)}
7
7
  />
8
8
  </div>
9
9
  `:""}
10
- ${this.noScroll?b`<slot @slotchange=${this._onSlotChange}></slot>`:b`
10
+ ${this.noScroll?p`<slot @slotchange=${this._onSlotChange}></slot>`:p`
11
11
  <div class="scb-table-scroll-wrapper">
12
12
  <slot @slotchange=${this._onSlotChange}></slot>
13
13
  </div>
14
14
  `}
15
15
  <div class="pagination">
16
- ${this.pagination&&e>1?b`
16
+ ${this.pagination&&e>1?p`
17
17
  <scb-pagination
18
18
  .page=${this.currentPage}
19
19
  .totalPages=${e}
@@ -22,7 +22,7 @@ import{_,b as m,g as v,h as p,y as b}from"../../vendor/vendor.js";import"../../v
22
22
  ></scb-pagination>
23
23
  `:""}
24
24
  </div>
25
- `}_onSearchInput(e){const o=e.target.value;this.searchTerm=o,this._filterTable(),this.dispatchEvent(new CustomEvent("tableadvancedchange",{detail:{searchTerm:this.searchTerm,currentPage:this.currentPage},bubbles:!0,composed:!0}))}_filterTable(){const e=this.shadowRoot.querySelector("slot");if(!e)return;const o=e.assignedNodes({flatten:!0});let s=null;if(o.forEach(i=>{if(i.nodeType===Node.ELEMENT_NODE){const r=i.querySelector("tbody");r&&(s=r)}}),!s)return;const a=Array.from(s.querySelectorAll("tr")),t=this.searchTerm.trim().toLowerCase();if(!t)this._filteredRows=null,a.forEach(i=>i.style.display=""),this._updateTotalRows(),this._ensureCurrentPageWithinBounds(),this.pagination&&this._paginateTable(),this._sortedColumn!==null&&this._sortTable(this._sortedColumn,this._sortDirection);else{this._filteredRows=a.filter(r=>(r.textContent?.toLowerCase()??"").includes(t)),a.forEach(r=>r.style.display="none");let i=this._filteredRows;this._sortedColumn!==null&&(i=[...i],i.sort((r,c)=>{const h=r.children[this._sortedColumn]?.textContent?.trim()??"",l=c.children[this._sortedColumn]?.textContent?.trim()??"";return this._compareCellValues(h,l,this._sortDirection)}),this._filteredRows=i),this.totalRows=this._filteredRows.length,this._ensureCurrentPageWithinBounds(),this.pagination?this._paginateTable():this._filteredRows.forEach(r=>r.style.display="")}}firstUpdated(){const e=this.shadowRoot.querySelector("slot");e&&(e.addEventListener("slotchange",()=>this._attachThListeners()),this._attachThListeners(),this._attachTbodyObserver(),this._refreshFromTableContent())}updated(e){super.updated(e),(e.has("searchTerm")||e.has("currentPage")||e.has("pageSize")||e.has("filteringSearch")||e.has("pagination"))&&this.updateComplete.then(()=>{this.isConnected&&this._refreshFromTableContent()})}_disconnectTbodyObserver(){this._tbodyObserver&&(this._tbodyObserver.disconnect(),this._tbodyObserver=null),this._observedTbody=null}_attachTbodyObserver(){const e=this._getTbody();if(!e){this._disconnectTbodyObserver();return}this._observedTbody!==e&&(this._disconnectTbodyObserver(),this._observedTbody=e,this._tbodyObserver=new MutationObserver(()=>{this._suppressTbodyObserver||this._scheduleTableRefresh()}),this._tbodyObserver.observe(e,{childList:!0,subtree:!0,characterData:!0}))}_scheduleTableRefresh(){this._pendingTableRefresh||(this._pendingTableRefresh=!0,queueMicrotask(()=>{this._pendingTableRefresh=!1,this._refreshFromTableContent()}))}_refreshFromTableContent(){if(this._attachTbodyObserver(),this.filteringSearch){this._filterTable();return}if(this._updateTotalRows(),this._ensureCurrentPageWithinBounds(),this._sortedColumn!==null){this._sortTable(this._sortedColumn,this._sortDirection);return}this.pagination&&this._paginateTable()}_ensureCurrentPageWithinBounds(){const e=Math.max(1,Math.ceil(this.totalRows/this.pageSize)),o=Math.min(Math.max(1,this.currentPage),e);o!==this.currentPage&&(this.currentPage=o)}_getTbody(){const e=this.shadowRoot.querySelector("slot");if(!e)return null;const o=e.assignedNodes({flatten:!0});for(const s of o)if(s.nodeType===Node.ELEMENT_NODE){const n=s.querySelector("tbody");if(n)return n}return null}_attachThListeners(){const e=this.shadowRoot.querySelector("slot");if(!e)return;const o=e.assignedNodes({flatten:!0}),s=[],n=[],a=[];o.forEach(t=>{t.nodeType===Node.ELEMENT_NODE&&(s.push(...t.querySelectorAll("th")),n.push(...t.querySelectorAll("td")),a.push(...t.querySelectorAll("tr")))}),s.forEach((t,i)=>{t.style.textAlign="left",t.style.padding="16px 0px 16px 32px",t.style.position="relative",t.style.backgroundColor="var(--md-sys-color-surface)",t.style.fontFamily="var(--md-sys-typescale-label-medium-font)",t.style.fontSize="var(--md-sys-typescale-label-medium-size)",t.style.lineHeight="var(--md-sys-typescale-label-medium-line-height)",t.style.fontWeight="var(--md-sys-typescale-label-medium-weight)",t.style.letterSpacing="var(--md-sys-typescale-label-medium-tracking)",t.style.verticalAlign="bottom";const r=t.firstChild;if(r&&r.nodeType===Node.TEXT_NODE&&r.textContent?.trim()||r&&r.nodeType===Node.ELEMENT_NODE&&r.tagName.toLowerCase()!=="p"){const h=document.createElement("p");h.textContent=r.textContent?r.textContent.trim():"",h.style.margin="0",t.replaceChild(h,r),t.querySelectorAll("scb-icon-button.scb-sort-icon").forEach(g=>g.remove());const l=document.createElement("scb-icon-button");l.className="scb-sort-icon",l.onclick=()=>this._onThClick(i),l.setAttribute("variant","standard"),l.setAttribute("size","small"),this._sortedColumn===i?(l.setAttribute("variant","filled-tonal"),l.setAttribute("icon",this._sortDirection==="asc"?"arrow_downward":"arrow_upward")):(l.setAttribute("icon","swap_horiz"),l.style.transform+=" rotate(90deg)",l.style.alignSelf="end");var c=document.createElement("div");c.style.display="flex",c.style.gap="8px",c.style.flexWrap="nowrap",c.style.alignItems="center",c.appendChild(h),c.appendChild(l),t.appendChild(c)}}),n.forEach(t=>{t.style.padding="16px 0px 16px 32px",t.style.textAlign="left",t.style.borderTop="1px solid var(--md-sys-color-outline-variant)",t.style.verticalAlign="text-top",t.style.backgroundColor="var(--md-sys-color-surface)",t.style.fontFamily="var(--md-sys-typescale-body-medium-font)",t.style.fontSize="var(--md-sys-typescale-body-medium-size)",t.style.lineHeight="var(--md-sys-typescale-body-medium-line-height)",t.style.fontWeight="var(--md-sys-typescale-body-medium-weight)",t.style.letterSpacing="var(--md-sys-typescale-body-medium-tracking)"}),a.forEach((t,i)=>{i%2===1&&t.querySelectorAll("td").forEach(h=>{h.style.backgroundColor="var(--scb-background-row)"});const r=t.querySelectorAll("th");r.length>0&&r.forEach((h,l)=>{l===0&&(h.style.paddingLeft="24px"),l===r.length-1?h.style.paddingRight="24px":h.style.paddingRight=""});const c=t.querySelectorAll("td");c.length>0&&c.forEach((h,l)=>{l===0&&(h.style.paddingLeft="24px"),l===c.length-1?h.style.paddingRight="24px":h.style.paddingRight=""})}),this.pagination&&this._paginateTable()}_onThClick(e){this._sortedColumn===e?this._sortDirection=this._sortDirection==="asc"?"desc":"asc":(this._sortedColumn=e,this._sortDirection="asc"),this._sortTable(e,this._sortDirection),this._attachThListeners()}_sortTable(e,o){const s=this.shadowRoot.querySelector("slot");if(!s)return;const n=s.assignedNodes({flatten:!0});let a=null;if(n.forEach(r=>{if(r.nodeType===Node.ELEMENT_NODE){const c=r.querySelector("tbody");c&&(a=c)}}),!a)return;let t;this._filteredRows?t=[...this._filteredRows]:t=Array.from(a.querySelectorAll("tr")),t.sort((r,c)=>{const h=r.children[e]?.textContent?.trim()??"",l=c.children[e]?.textContent?.trim()??"";return this._compareCellValues(h,l,o)});const i=this._tbodyObserver!==null;i&&this._disconnectTbodyObserver();try{t.forEach(r=>a.appendChild(r))}finally{i&&this._attachTbodyObserver()}this._filteredRows&&(this._filteredRows=t,this.totalRows=this._filteredRows.length),this.pagination&&this._paginateTable()}_compareCellValues(e,o,s){const n=this._parseSortableNumber(e),a=this._parseSortableNumber(o);if(n!==null&&a!==null)return s==="asc"?n-a:a-n;const t=Date.parse(e.replace(/\s+/g," ")),i=Date.parse(o.replace(/\s+/g," "));if(!isNaN(t)&&!isNaN(i))return s==="asc"?t-i:i-t;const r=e.localeCompare(o,"sv");return s==="asc"?r:-r}_parseSortableNumber(e){const o=e.trim();if(!/^[+-]?(?:\d+|\d{1,3}(?:[\s\u00a0\u202f]\d{3})+)(?:[,.]\d+)?$/.test(o))return null;const s=Number(o.replace(/[\s\u00a0\u202f]/g,"").replace(",","."));return Number.isNaN(s)?null:s}_updateTotalRows(){const e=this.shadowRoot.querySelector("slot");if(!e)return;const o=e.assignedNodes({flatten:!0});let s=null;o.forEach(n=>{if(n.nodeType===Node.ELEMENT_NODE){const a=n.querySelector("tbody");a&&(s=a)}}),s&&(this.totalRows=s.querySelectorAll("tr").length,this._ensureCurrentPageWithinBounds())}_paginateTable(){const e=this.shadowRoot.querySelector("slot");if(!e)return;const o=e.assignedNodes({flatten:!0});let s=null;if(o.forEach(i=>{if(i.nodeType===Node.ELEMENT_NODE){const r=i.querySelector("tbody");r&&(s=r)}}),!s)return;let n;this._filteredRows?n=this._filteredRows:n=Array.from(s.querySelectorAll("tr")),Array.from(s.querySelectorAll("tr")).forEach(i=>i.style.display="none");const a=(this.currentPage-1)*this.pageSize,t=a+this.pageSize;n.slice(a,t).forEach(i=>i.style.display="")}_changePage(e){const o=Math.ceil(this.totalRows/this.pageSize);e<1||e>o||(this.currentPage=e,this._paginateTable(),this.dispatchEvent(new CustomEvent("tableadvancedchange",{detail:{searchTerm:this.searchTerm,currentPage:this.currentPage},bubbles:!0,composed:!0})),this.requestUpdate())}},y.styles=m`
25
+ `}_onSearchInput(e){const s=e.target.value;this.searchTerm=s,this._filterTable(),this.dispatchEvent(new CustomEvent("tableadvancedchange",{detail:{searchTerm:this.searchTerm,currentPage:this.currentPage},bubbles:!0,composed:!0}))}_filterTable(){const e=this.shadowRoot.querySelector("slot");if(!e)return;const s=e.assignedNodes({flatten:!0});let r=null;if(s.forEach(i=>{if(i.nodeType===Node.ELEMENT_NODE){const o=i.querySelector("tbody");o&&(r=o)}}),!r)return;const a=Array.from(r.querySelectorAll("tr")),t=this.searchTerm.trim().toLowerCase();if(!t)this._filteredRows=null,a.forEach(i=>i.style.display=""),this._updateTotalRows(),this._ensureCurrentPageWithinBounds(),this.pagination&&this._paginateTable(),this._sortedColumn!==null&&this._sortTable(this._sortedColumn,this._sortDirection);else{this._filteredRows=a.filter(o=>this._getRowSearchText(o).toLowerCase().includes(t)),a.forEach(o=>o.style.display="none");let i=this._filteredRows;this._sortedColumn!==null&&(i=[...i],i.sort((o,c)=>{const h=this._getCellSortableValue(o.children[this._sortedColumn]),n=this._getCellSortableValue(c.children[this._sortedColumn]);return this._compareCellValues(h,n,this._sortDirection)}),this._filteredRows=i),this.totalRows=this._filteredRows.length,this._ensureCurrentPageWithinBounds(),this.pagination?this._paginateTable():this._filteredRows.forEach(o=>o.style.display="")}}firstUpdated(){const e=this.shadowRoot.querySelector("slot");e&&(e.addEventListener("slotchange",()=>this._attachThListeners()),this._attachThListeners(),this._attachTbodyObserver(),this._refreshFromTableContent())}updated(e){super.updated(e),(e.has("searchTerm")||e.has("currentPage")||e.has("pageSize")||e.has("filteringSearch")||e.has("pagination"))&&this.updateComplete.then(()=>{this.isConnected&&this._refreshFromTableContent()})}_disconnectTbodyObserver(){this._tbodyObserver&&(this._tbodyObserver.disconnect(),this._tbodyObserver=null),this._observedTbody=null}_attachTbodyObserver(){const e=this._getTbody();if(!e){this._disconnectTbodyObserver();return}this._observedTbody!==e&&(this._disconnectTbodyObserver(),this._observedTbody=e,this._tbodyObserver=new MutationObserver(()=>{this._suppressTbodyObserver||this._scheduleTableRefresh()}),this._tbodyObserver.observe(e,{childList:!0,subtree:!0,characterData:!0}))}_scheduleTableRefresh(){this._pendingTableRefresh||(this._pendingTableRefresh=!0,queueMicrotask(()=>{this._pendingTableRefresh=!1,this._refreshFromTableContent()}))}_refreshFromTableContent(){if(this._attachTbodyObserver(),this.filteringSearch){this._filterTable();return}if(this._updateTotalRows(),this._ensureCurrentPageWithinBounds(),this._sortedColumn!==null){this._sortTable(this._sortedColumn,this._sortDirection);return}this.pagination&&this._paginateTable()}_ensureCurrentPageWithinBounds(){const e=Math.max(1,Math.ceil(this.totalRows/this.pageSize)),s=Math.min(Math.max(1,this.currentPage),e);s!==this.currentPage&&(this.currentPage=s)}_getTbody(){const e=this.shadowRoot.querySelector("slot");if(!e)return null;const s=e.assignedNodes({flatten:!0});for(const r of s)if(r.nodeType===Node.ELEMENT_NODE){const l=r.querySelector("tbody");if(l)return l}return null}_attachThListeners(){const e=this.shadowRoot.querySelector("slot");if(!e)return;const s=e.assignedNodes({flatten:!0}),r=[],l=[],a=[];s.forEach(t=>{t.nodeType===Node.ELEMENT_NODE&&(r.push(...t.querySelectorAll("th")),l.push(...t.querySelectorAll("td")),a.push(...t.querySelectorAll("tr")))}),r.forEach((t,i)=>{t.style.textAlign="left",t.style.padding="16px 0px 16px 32px",t.style.position="relative",t.style.backgroundColor="var(--md-sys-color-surface)",t.style.fontFamily="var(--md-sys-typescale-label-medium-font)",t.style.fontSize="var(--md-sys-typescale-label-medium-size)",t.style.lineHeight="var(--md-sys-typescale-label-medium-line-height)",t.style.fontWeight="var(--md-sys-typescale-label-medium-weight)",t.style.letterSpacing="var(--md-sys-typescale-label-medium-tracking)",t.style.verticalAlign="bottom";const o=t.firstChild;if(o&&o.nodeType===Node.TEXT_NODE&&o.textContent?.trim()||o&&o.nodeType===Node.ELEMENT_NODE&&o.tagName.toLowerCase()!=="p"){const h=document.createElement("p");h.textContent=o.textContent?o.textContent.trim():"",h.style.margin="0",t.replaceChild(h,o),t.querySelectorAll("scb-icon-button.scb-sort-icon").forEach(g=>g.remove());const n=document.createElement("scb-icon-button");n.className="scb-sort-icon",n.onclick=()=>this._onThClick(i),n.setAttribute("variant","standard"),n.setAttribute("size","small"),this._sortedColumn===i?(n.setAttribute("variant","filled-tonal"),n.setAttribute("icon",this._sortDirection==="asc"?"arrow_downward":"arrow_upward")):(n.setAttribute("icon","swap_horiz"),n.style.transform+=" rotate(90deg)",n.style.alignSelf="end");var c=document.createElement("div");c.style.display="flex",c.style.gap="8px",c.style.flexWrap="nowrap",c.style.alignItems="center",c.appendChild(h),c.appendChild(n),t.appendChild(c)}}),l.forEach(t=>{t.style.padding="16px 0px 16px 32px",t.style.textAlign="left",t.style.borderTop="1px solid var(--md-sys-color-outline-variant)",t.style.verticalAlign="text-top",t.style.backgroundColor="var(--md-sys-color-surface)",t.style.fontFamily="var(--md-sys-typescale-body-medium-font)",t.style.fontSize="var(--md-sys-typescale-body-medium-size)",t.style.lineHeight="var(--md-sys-typescale-body-medium-line-height)",t.style.fontWeight="var(--md-sys-typescale-body-medium-weight)",t.style.letterSpacing="var(--md-sys-typescale-body-medium-tracking)"}),a.forEach((t,i)=>{i%2===1&&t.querySelectorAll("td").forEach(h=>{h.style.backgroundColor="var(--scb-background-row)"});const o=t.querySelectorAll("th");o.length>0&&o.forEach((h,n)=>{n===0&&(h.style.paddingLeft="24px"),n===o.length-1?h.style.paddingRight="24px":h.style.paddingRight=""});const c=t.querySelectorAll("td");c.length>0&&c.forEach((h,n)=>{n===0&&(h.style.paddingLeft="24px"),n===c.length-1?h.style.paddingRight="24px":h.style.paddingRight=""})}),this.pagination&&this._paginateTable()}_onThClick(e){this._sortedColumn===e?this._sortDirection=this._sortDirection==="asc"?"desc":"asc":(this._sortedColumn=e,this._sortDirection="asc"),this._sortTable(e,this._sortDirection),this._attachThListeners()}_sortTable(e,s){const r=this.shadowRoot.querySelector("slot");if(!r)return;const l=r.assignedNodes({flatten:!0});let a=null;if(l.forEach(o=>{if(o.nodeType===Node.ELEMENT_NODE){const c=o.querySelector("tbody");c&&(a=c)}}),!a)return;let t;this._filteredRows?t=[...this._filteredRows]:t=Array.from(a.querySelectorAll("tr")),t.sort((o,c)=>{const h=this._getCellSortableValue(o.children[e]),n=this._getCellSortableValue(c.children[e]);return this._compareCellValues(h,n,s)});const i=this._tbodyObserver!==null;i&&this._disconnectTbodyObserver();try{t.forEach(o=>a.appendChild(o))}finally{i&&this._attachTbodyObserver()}this._filteredRows&&(this._filteredRows=t,this.totalRows=this._filteredRows.length),this.pagination&&this._paginateTable()}_getRowSearchText(e){return Array.from(e.cells).map(s=>this._getCellSortableValue(s)).join(" ")}_getCellSortableValue(e){if(!e)return"";const s=e,r=this._getSortableAttributeValue(s);if(r)return r;const l=[],a=s.textContent?.replace(/\s+/g," ").trim();return a&&l.push(a),s.querySelectorAll("[data-sort-value], [data-sort], [aria-label], [label], [value], [title]").forEach(t=>{const i=this._getSortableAttributeValue(t);i&&!l.includes(i)&&l.push(i)}),l.join(" ").trim()}_getSortableAttributeValue(e){return(e.getAttribute("data-sort-value")??e.getAttribute("data-sort")??e.getAttribute("aria-label")??e.getAttribute("label")??e.getAttribute("value")??e.getAttribute("title")??"").replace(/\s+/g," ").trim()}_compareCellValues(e,s,r){const l=this._parseSortableNumber(e),a=this._parseSortableNumber(s);if(l!==null&&a!==null)return r==="asc"?l-a:a-l;const t=Date.parse(e.replace(/\s+/g," ")),i=Date.parse(s.replace(/\s+/g," "));if(!isNaN(t)&&!isNaN(i))return r==="asc"?t-i:i-t;const o=e.localeCompare(s,"sv");return r==="asc"?o:-o}_parseSortableNumber(e){const s=e.trim();if(!/^[+-]?(?:\d+|\d{1,3}(?:[\s\u00a0\u202f]\d{3})+)(?:[,.]\d+)?$/.test(s))return null;const r=Number(s.replace(/[\s\u00a0\u202f]/g,"").replace(",","."));return Number.isNaN(r)?null:r}_updateTotalRows(){const e=this.shadowRoot.querySelector("slot");if(!e)return;const s=e.assignedNodes({flatten:!0});let r=null;s.forEach(l=>{if(l.nodeType===Node.ELEMENT_NODE){const a=l.querySelector("tbody");a&&(r=a)}}),r&&(this.totalRows=r.querySelectorAll("tr").length,this._ensureCurrentPageWithinBounds())}_paginateTable(){const e=this.shadowRoot.querySelector("slot");if(!e)return;const s=e.assignedNodes({flatten:!0});let r=null;if(s.forEach(i=>{if(i.nodeType===Node.ELEMENT_NODE){const o=i.querySelector("tbody");o&&(r=o)}}),!r)return;let l;this._filteredRows?l=this._filteredRows:l=Array.from(r.querySelectorAll("tr")),Array.from(r.querySelectorAll("tr")).forEach(i=>i.style.display="none");const a=(this.currentPage-1)*this.pageSize,t=a+this.pageSize;l.slice(a,t).forEach(i=>i.style.display="")}_changePage(e){const s=Math.ceil(this.totalRows/this.pageSize);e<1||e>s||(this.currentPage=e,this._paginateTable(),this.dispatchEvent(new CustomEvent("tableadvancedchange",{detail:{searchTerm:this.searchTerm,currentPage:this.currentPage},bubbles:!0,composed:!0})),this.requestUpdate())}},y.styles=m`
26
26
  :host {
27
27
  display: block;
28
28
  color: var(--md-sys-color-on-surface);
@@ -73,4 +73,4 @@ import{_,b as m,g as v,h as p,y as b}from"../../vendor/vendor.js";import"../../v
73
73
  ::slotted(th:hover) .scb-sort-icon {
74
74
  pointer-events: auto;
75
75
  }
76
- `,y);u([p({type:String})],d.prototype,"searchTerm",void 0);u([p({type:Boolean,attribute:"with-pagination"})],d.prototype,"pagination",void 0);u([p({type:Boolean,attribute:"with-filtering-search"})],d.prototype,"filteringSearch",void 0);u([p({type:Boolean,attribute:"no-scroll"})],d.prototype,"noScroll",void 0);u([p({type:Number,attribute:"page-size"})],d.prototype,"pageSize",void 0);u([p({type:Number})],d.prototype,"currentPage",void 0);u([p({type:Number})],d.prototype,"totalRows",void 0);d=u([v("scb-table-advanced")],d);
76
+ `,y);u([b({type:String})],d.prototype,"searchTerm",void 0);u([b({type:Boolean,attribute:"with-pagination"})],d.prototype,"pagination",void 0);u([b({type:Boolean,attribute:"with-filtering-search"})],d.prototype,"filteringSearch",void 0);u([b({type:Boolean,attribute:"no-scroll"})],d.prototype,"noScroll",void 0);u([b({type:Number,attribute:"page-size"})],d.prototype,"pageSize",void 0);u([b({type:Number})],d.prototype,"currentPage",void 0);u([b({type:Number})],d.prototype,"totalRows",void 0);d=u([v("scb-table-advanced")],d);
package/mvc/scb-logo.svg CHANGED
@@ -1,21 +1,21 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <svg viewBox="-0.0002 -0.0066 1344.9076 377.9532" xmlns="http://www.w3.org/2000/svg">
3
- <defs>
4
- <style type="text/css">
5
- g {
6
- fill: #100f0d;
7
- }
8
- g:target {
9
- fill: #fff;
10
- }
11
- </style>
12
- </defs>
13
- <g transform="matrix(1.3333330154418945, 0, 0, -1.3333330154418945, 0, 377.9466552734375)" id="g10">
14
- <g transform="scale(0.1)" id="inverted">
15
- <path id="path14" d="m 1346.6,2515.59 c 0,48.24 -39.11,87.31 -87.4,87.31 -48.29,0 -87.4,-39.07 -87.4,-87.31 V 312.898 c 0,-48.339 39.11,-87.5 87.4,-87.5 48.29,0 87.4,39.161 87.4,87.5 V 1106.8 c 0,5.77 4.79,10.45 10.51,10.45 h 287.22 c 5.76,0 10.5,-4.68 10.5,-10.45 V 305.969 C 1654.83,137.02 1477.67,0 1259.2,0 1040.63,0 863.523,137.02 863.523,305.969 V 2528.77 c 0,168.86 177.107,305.88 395.677,305.88 218.47,0 395.63,-137.02 395.63,-305.88 V 1738.1 c 0,-5.86 -4.74,-10.45 -10.5,-10.45 h -287.22 c -5.72,0 -10.51,4.59 -10.51,10.45 v 777.49"/>
16
- <path id="path16" d="M 10.4414,2265.38 C -8.01563,2136.85 -1.52734,1926.1 26.1172,1807.73 56.4922,1678.71 231.645,1417.96 310.555,1296.86 389.566,1175.85 494.949,1049.49 493.375,880.922 V 477.18 c 0,-48.25 -39.109,-87.41 -87.406,-87.41 -48.145,0 -87.254,39.16 -87.254,87.41 v 618.79 c 0,5.76 -4.785,10.55 -10.645,10.55 H 20.9453 c -5.8711,0 -10.5039,-4.79 -10.5039,-10.55 V 458.719 c 0,-168.957 177.1056,-305.969 395.5276,-305.969 218.574,0 395.683,137.012 395.683,305.969 v 422.203 c -1.324,289.568 -80.332,331.748 -182.867,505.398 -73.445,124.71 -254.121,381.95 -284.398,510.97 -27.735,118.36 -26.516,255.39 -15.672,379.9 0,48.25 39.109,87.41 87.254,87.41 48.297,0 87.406,-39.16 87.406,-87.41 v -550.32 c 0,-5.77 4.746,-10.45 10.645,-10.45 h 287.085 c 5.911,0 10.547,4.68 10.547,10.45 v 538.51 c 0,169.06 -177.109,305.97 -395.683,305.97 -218.422,0 -395.5276,-136.91 -395.5276,-305.97"/>
17
- <path id="path18" d="m 1726.57,2547.82 h 440.8 c 182.04,0 329.61,-147.57 329.61,-329.52 v -462.24 c 0,-129.59 -84.97,-238.98 -202.16,-276.48 v -6.24 c 117.19,-37.4 202.16,-146.89 202.16,-276.58 V 491.148 c 0,-160.367 -130.2,-290.457 -290.45,-290.457 l -479.96,-0.293 c -5.91,0 -10.6,4.793 -10.6,10.454 V 2537.37 c 0,5.66 4.69,10.45 10.6,10.45 m 308.27,-229.22 c -5.97,0 -10.65,-4.78 -10.65,-10.55 v -729.33 c 0,-5.97 4.68,-10.65 10.65,-10.65 h 43.36 c 58.01,0 105.08,47.16 105.08,105.18 v 540.18 c 0,58 -47.07,105.17 -105.08,105.17 z m 0,-982.29 c -5.97,0 -10.65,-4.69 -10.65,-10.45 V 430.59 c 0,-5.86 4.68,-10.649 10.65,-10.649 h 51.85 c 58.12,0 105.09,47.18 105.09,105.188 v 706.011 c 0,58.19 -46.97,105.17 -105.09,105.17 h -51.85"/>
18
- </g>
19
- </g>
20
- <text style="fill: rgb(1, 1, 1); font-family: Roboto; font-size: 139.2px; font-weight: 500; stroke: rgb(0, 0, 0); white-space: pre;" x="455.182" y="234.25">Designsystem</text>
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <svg viewBox="-0.0002 -0.0066 1344.9076 377.9532" xmlns="http://www.w3.org/2000/svg">
3
+ <defs>
4
+ <style type="text/css">
5
+ g {
6
+ fill: #100f0d;
7
+ }
8
+ g:target {
9
+ fill: #fff;
10
+ }
11
+ </style>
12
+ </defs>
13
+ <g transform="matrix(1.3333330154418945, 0, 0, -1.3333330154418945, 0, 377.9466552734375)" id="g10">
14
+ <g transform="scale(0.1)" id="inverted">
15
+ <path id="path14" d="m 1346.6,2515.59 c 0,48.24 -39.11,87.31 -87.4,87.31 -48.29,0 -87.4,-39.07 -87.4,-87.31 V 312.898 c 0,-48.339 39.11,-87.5 87.4,-87.5 48.29,0 87.4,39.161 87.4,87.5 V 1106.8 c 0,5.77 4.79,10.45 10.51,10.45 h 287.22 c 5.76,0 10.5,-4.68 10.5,-10.45 V 305.969 C 1654.83,137.02 1477.67,0 1259.2,0 1040.63,0 863.523,137.02 863.523,305.969 V 2528.77 c 0,168.86 177.107,305.88 395.677,305.88 218.47,0 395.63,-137.02 395.63,-305.88 V 1738.1 c 0,-5.86 -4.74,-10.45 -10.5,-10.45 h -287.22 c -5.72,0 -10.51,4.59 -10.51,10.45 v 777.49"/>
16
+ <path id="path16" d="M 10.4414,2265.38 C -8.01563,2136.85 -1.52734,1926.1 26.1172,1807.73 56.4922,1678.71 231.645,1417.96 310.555,1296.86 389.566,1175.85 494.949,1049.49 493.375,880.922 V 477.18 c 0,-48.25 -39.109,-87.41 -87.406,-87.41 -48.145,0 -87.254,39.16 -87.254,87.41 v 618.79 c 0,5.76 -4.785,10.55 -10.645,10.55 H 20.9453 c -5.8711,0 -10.5039,-4.79 -10.5039,-10.55 V 458.719 c 0,-168.957 177.1056,-305.969 395.5276,-305.969 218.574,0 395.683,137.012 395.683,305.969 v 422.203 c -1.324,289.568 -80.332,331.748 -182.867,505.398 -73.445,124.71 -254.121,381.95 -284.398,510.97 -27.735,118.36 -26.516,255.39 -15.672,379.9 0,48.25 39.109,87.41 87.254,87.41 48.297,0 87.406,-39.16 87.406,-87.41 v -550.32 c 0,-5.77 4.746,-10.45 10.645,-10.45 h 287.085 c 5.911,0 10.547,4.68 10.547,10.45 v 538.51 c 0,169.06 -177.109,305.97 -395.683,305.97 -218.422,0 -395.5276,-136.91 -395.5276,-305.97"/>
17
+ <path id="path18" d="m 1726.57,2547.82 h 440.8 c 182.04,0 329.61,-147.57 329.61,-329.52 v -462.24 c 0,-129.59 -84.97,-238.98 -202.16,-276.48 v -6.24 c 117.19,-37.4 202.16,-146.89 202.16,-276.58 V 491.148 c 0,-160.367 -130.2,-290.457 -290.45,-290.457 l -479.96,-0.293 c -5.91,0 -10.6,4.793 -10.6,10.454 V 2537.37 c 0,5.66 4.69,10.45 10.6,10.45 m 308.27,-229.22 c -5.97,0 -10.65,-4.78 -10.65,-10.55 v -729.33 c 0,-5.97 4.68,-10.65 10.65,-10.65 h 43.36 c 58.01,0 105.08,47.16 105.08,105.18 v 540.18 c 0,58 -47.07,105.17 -105.08,105.17 z m 0,-982.29 c -5.97,0 -10.65,-4.69 -10.65,-10.45 V 430.59 c 0,-5.86 4.68,-10.649 10.65,-10.649 h 51.85 c 58.12,0 105.09,47.18 105.09,105.188 v 706.011 c 0,58.19 -46.97,105.17 -105.09,105.17 h -51.85"/>
18
+ </g>
19
+ </g>
20
+ <text style="fill: rgb(1, 1, 1); font-family: Roboto; font-size: 139.2px; font-weight: 500; stroke: rgb(0, 0, 0); white-space: pre;" x="455.182" y="234.25">Designsystem</text>
21
21
  </svg>
package/mvc/scb.svg CHANGED
@@ -1,14 +1,14 @@
1
- <svg
2
- xmlns="http://www.w3.org/2000/svg"
3
- xmlns:xlink="http://www.w3.org/1999/xlink"
4
- aria-hidden="true"
5
- role="img"
6
- width="48"
7
- height="48"
8
- preserveAspectRatio="xMidYMid meet"
9
- viewBox="0 0 1300 1300"
10
- >
11
- <path d="M539.3,128.2c0-19.3-15.7-35-35-35c-19.3,0-35,15.6-35,35v882.1c0,19.4,15.7,35,35,35c19.3,0,35-15.7,35-35V692.4 c0-2.3,1.9-4.2,4.2-4.2h115c2.3,0,4.2,1.9,4.2,4.2v320.7c0,67.7-71,122.5-158.4,122.5c-87.5,0-158.5-54.9-158.5-122.5V122.9 c0-67.6,70.9-122.5,158.5-122.5c87.5,0,158.4,54.9,158.4,122.5v316.6c0,2.3-1.9,4.2-4.2,4.2h-115c-2.3,0-4.2-1.8-4.2-4.2V128.2z" />
12
- <path d="M4.2,228.4c-7.4,51.5-4.8,135.9,6.3,183.3c12.2,51.7,82.3,156.1,113.9,204.6c31.6,48.5,73.8,99.1,73.2,166.6v161.7 c0,19.3-15.7,35-35,35c-19.3,0-34.9-15.7-34.9-35V696.7c0-2.3-1.9-4.2-4.3-4.2H8.4c-2.4,0-4.2,1.9-4.2,4.2v255.2 c0,67.7,70.9,122.5,158.4,122.5c87.5,0,158.5-54.9,158.5-122.5V782.8c-0.5-116-32.2-132.9-73.2-202.4 c-29.4-49.9-101.8-153-113.9-204.6c-11.1-47.4-10.6-102.3-6.3-152.1c0-19.3,15.7-35,34.9-35c19.3,0,35,15.7,35,35V444 c0,2.3,1.9,4.2,4.3,4.2h115c2.4,0,4.2-1.9,4.2-4.2V228.4c0-67.7-70.9-122.5-158.5-122.5C75.1,105.8,4.2,160.7,4.2,228.4" />
13
- <path d="M814.9,600.4c-2.4,0-4.3,1.9-4.3,4.2v358.5c0,2.3,1.9,4.3,4.3,4.3h20.8c23.3,0,42.1-18.9,42.1-42.1V642.6 c0-23.3-18.8-42.1-42.1-42.1H814.9z M814.9,207.1c-2.4,0-4.3,1.9-4.3,4.2v292.1c0,2.4,1.9,4.3,4.3,4.3h17.4 c23.2,0,42.1-18.9,42.1-42.1V249.2c0-23.2-18.9-42.1-42.1-42.1H814.9z M691.5,115.3H868c72.9,0,132,59.1,132,132v185.1 c0,51.9-34,95.7-81,110.7v2.5c46.9,15,81,58.8,81,110.8v282.6c0,64.2-52.1,116.3-116.3,116.3l-192.2,0.1c-2.4,0-4.2-1.9-4.2-4.2 V119.4C687.2,117.2,689.1,115.3,691.5,115.3" />
1
+ <svg
2
+ xmlns="http://www.w3.org/2000/svg"
3
+ xmlns:xlink="http://www.w3.org/1999/xlink"
4
+ aria-hidden="true"
5
+ role="img"
6
+ width="48"
7
+ height="48"
8
+ preserveAspectRatio="xMidYMid meet"
9
+ viewBox="0 0 1300 1300"
10
+ >
11
+ <path d="M539.3,128.2c0-19.3-15.7-35-35-35c-19.3,0-35,15.6-35,35v882.1c0,19.4,15.7,35,35,35c19.3,0,35-15.7,35-35V692.4 c0-2.3,1.9-4.2,4.2-4.2h115c2.3,0,4.2,1.9,4.2,4.2v320.7c0,67.7-71,122.5-158.4,122.5c-87.5,0-158.5-54.9-158.5-122.5V122.9 c0-67.6,70.9-122.5,158.5-122.5c87.5,0,158.4,54.9,158.4,122.5v316.6c0,2.3-1.9,4.2-4.2,4.2h-115c-2.3,0-4.2-1.8-4.2-4.2V128.2z" />
12
+ <path d="M4.2,228.4c-7.4,51.5-4.8,135.9,6.3,183.3c12.2,51.7,82.3,156.1,113.9,204.6c31.6,48.5,73.8,99.1,73.2,166.6v161.7 c0,19.3-15.7,35-35,35c-19.3,0-34.9-15.7-34.9-35V696.7c0-2.3-1.9-4.2-4.3-4.2H8.4c-2.4,0-4.2,1.9-4.2,4.2v255.2 c0,67.7,70.9,122.5,158.4,122.5c87.5,0,158.5-54.9,158.5-122.5V782.8c-0.5-116-32.2-132.9-73.2-202.4 c-29.4-49.9-101.8-153-113.9-204.6c-11.1-47.4-10.6-102.3-6.3-152.1c0-19.3,15.7-35,34.9-35c19.3,0,35,15.7,35,35V444 c0,2.3,1.9,4.2,4.3,4.2h115c2.4,0,4.2-1.9,4.2-4.2V228.4c0-67.7-70.9-122.5-158.5-122.5C75.1,105.8,4.2,160.7,4.2,228.4" />
13
+ <path d="M814.9,600.4c-2.4,0-4.3,1.9-4.3,4.2v358.5c0,2.3,1.9,4.3,4.3,4.3h20.8c23.3,0,42.1-18.9,42.1-42.1V642.6 c0-23.3-18.8-42.1-42.1-42.1H814.9z M814.9,207.1c-2.4,0-4.3,1.9-4.3,4.2v292.1c0,2.4,1.9,4.3,4.3,4.3h17.4 c23.2,0,42.1-18.9,42.1-42.1V249.2c0-23.2-18.9-42.1-42.1-42.1H814.9z M691.5,115.3H868c72.9,0,132,59.1,132,132v185.1 c0,51.9-34,95.7-81,110.7v2.5c46.9,15,81,58.8,81,110.8v282.6c0,64.2-52.1,116.3-116.3,116.3l-192.2,0.1c-2.4,0-4.2-1.9-4.2-4.2 V119.4C687.2,117.2,689.1,115.3,691.5,115.3" />
14
14
  </svg>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scb-wc",
3
- "version": "0.1.24",
3
+ "version": "0.1.26",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -417,5 +417,5 @@
417
417
  },
418
418
  "./mvc/*": "./mvc/*"
419
419
  },
420
- "buildHash": "979822D164178328C1A1B8311E0AB80D0A04B17F519F6FC3B5C5B58E4605D22E"
420
+ "buildHash": "458C1B8AEDE69F1820B80ACE8E8D87E2D19195DAFD4D14A997D4EE17AA997116"
421
421
  }
@@ -1,6 +1,7 @@
1
1
  import { LitElement, PropertyValues } from 'lit';
2
2
  export declare class ScbPagination extends LitElement {
3
3
  variant: 'icon-text' | 'icon';
4
+ alignment: 'start' | 'center' | 'end';
4
5
  page: number;
5
6
  totalPages: number;
6
7
  pagingHref: string;
@@ -21,6 +21,8 @@ export declare class ScbTable extends LitElement {
21
21
  private _measureCellContentWidth;
22
22
  private _onThClick;
23
23
  private _sortTable;
24
+ private _getCellSortableValue;
25
+ private _getSortableAttributeValue;
24
26
  private _compareCellValues;
25
27
  private _parseSortableNumber;
26
28
  }
@@ -31,6 +31,9 @@ export declare class ScbTableAdvanced extends LitElement {
31
31
  private _attachThListeners;
32
32
  private _onThClick;
33
33
  private _sortTable;
34
+ private _getRowSearchText;
35
+ private _getCellSortableValue;
36
+ private _getSortableAttributeValue;
34
37
  private _compareCellValues;
35
38
  private _parseSortableNumber;
36
39
  private _onSlotChange;
@@ -30,10 +30,10 @@ var o = { fromAttribute(e) {
30
30
  this.#e();
31
31
  }
32
32
  #e() {
33
- this.#t("--col-span", this.hasAttribute("col-span") ? String(this.colSpan) : null), this.#t("--col-span-compact", this.hasAttribute("col-span-compact") ? String(this.colSpanCompact) : null), this.#t("--col-span-medium", this.hasAttribute("col-span-medium") ? String(this.colSpanMedium) : null), this.#t("--col-span-expanded", this.hasAttribute("col-span-expanded") ? String(this.colSpanExpanded) : null), this.#t("--row-rule", this.hasAttribute("row-span") ? `span ${this.rowSpan}` : null), this.#t("--row-rule-compact", this.hasAttribute("row-span-compact") ? `span ${this.rowSpanCompact}` : null), this.#t("--row-rule-medium", this.hasAttribute("row-span-medium") ? `span ${this.rowSpanMedium}` : null), this.#t("--row-rule-expanded", this.hasAttribute("row-span-expanded") ? `span ${this.rowSpanExpanded}` : null), this.align ? (this.style.setProperty("--scb-grid-item-align", this.align), this.style.setProperty("align-self", this.align)) : (this.style.removeProperty("--scb-grid-item-align"), this.style.removeProperty("align-self")), this.justify ? (this.style.setProperty("--scb-grid-item-justify", this.justify), this.style.setProperty("justify-self", this.justify)) : (this.style.removeProperty("--scb-grid-item-justify"), this.style.removeProperty("justify-self"));
33
+ this.#t("--col-span", this.hasAttribute("col-span") ? String(this.colSpan) : null), this.#t("--col-span-compact", this.hasAttribute("col-span-compact") ? String(this.colSpanCompact) : null), this.#t("--col-span-medium", this.hasAttribute("col-span-medium") ? String(this.colSpanMedium) : null), this.#t("--col-span-expanded", this.hasAttribute("col-span-expanded") ? String(this.colSpanExpanded) : null), this.#t("--row-rule", this.hasAttribute("row-span") ? `span ${this.rowSpan}` : null), this.#t("--row-rule-compact", this.hasAttribute("row-span-compact") ? `span ${this.rowSpanCompact}` : null), this.#t("--row-rule-medium", this.hasAttribute("row-span-medium") ? `span ${this.rowSpanMedium}` : null), this.#t("--row-rule-expanded", this.hasAttribute("row-span-expanded") ? `span ${this.rowSpanExpanded}` : null), this.align ? (this.style.setProperty("--scb-grid-item-align", this.align), this.style.setProperty("align-self", this.align)) : (this.style.setProperty("--scb-grid-item-align", "initial"), this.style.removeProperty("align-self")), this.justify ? (this.style.setProperty("--scb-grid-item-justify", this.justify), this.style.setProperty("justify-self", this.justify)) : (this.style.setProperty("--scb-grid-item-justify", "initial"), this.style.removeProperty("justify-self"));
34
34
  }
35
35
  #t(e, t) {
36
- t === null || t === "" ? this.style.removeProperty(e) : this.style.setProperty(e, t);
36
+ this.style.setProperty(e, t === null || t === "" ? "initial" : t);
37
37
  }
38
38
  render() {
39
39
  return r`<slot></slot>`;
@@ -139,10 +139,7 @@ var o = class extends t {
139
139
  let e = "var(--spacing-7, 24px)", t = this.parseGapShorthand(this.gap), n = this.mapSpacingToken(this.rowGap) ?? t.row ?? e, r = this.mapSpacingToken(this.columnGap) ?? t.col ?? e;
140
140
  this.style.setProperty("--scb-grid-row-gap", n), this.style.setProperty("--scb-grid-column-gap", r), this.style.setProperty("--scb-grid-gap", `${n} ${r}`), this.style.setProperty("--scb-grid-align-items", this.alignItems), this.style.setProperty("--scb-grid-justify-items", this.justifyItems);
141
141
  let i = this.mapSpacingToken(this.paddingInline), a = this.mapSpacingToken(this.paddingBlock);
142
- this.#t("--scb-grid-max-width", this.maxWidth), this.#t("--scb-grid-padding-inline", i ?? ""), this.#t("--scb-grid-padding-block", a ?? ""), this.#t("--scb-grid-auto-rows", this.autoRows);
143
- }
144
- #t(e, t) {
145
- t ? this.style.setProperty(e, t) : this.style.removeProperty(e);
142
+ this.style.setProperty("--scb-grid-max-width", this.maxWidth || "1440px"), this.style.setProperty("--scb-grid-padding-inline", i ?? "0"), this.style.setProperty("--scb-grid-padding-block", a ?? "0"), this.style.setProperty("--scb-grid-auto-rows", this.autoRows || "auto");
146
143
  }
147
144
  render() {
148
145
  return r`<div class="grid"><slot></slot></div>`;