scb-wc-test 0.1.68 → 0.1.69

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.
@@ -1,6 +1,14 @@
1
- import{a as d,n as o,i as y,x as g,t as b}from"../../vendor/vendor.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(s,i,a){try{customElements.get(s)||t(s,i,a)}catch(p){var c=String(p||"");if(c.indexOf("already been used")===-1&&c.indexOf("NotSupportedError")===-1)throw p}}}}catch{}})();var v=Object.defineProperty,m=Object.getOwnPropertyDescriptor,u=e=>{throw TypeError(e)},n=(e,t,s,i)=>{for(var a=i>1?void 0:i?m(t,s):t,c=e.length-1,p;c>=0;c--)(p=e[c])&&(a=(i?p(t,s,a):p(a))||a);return i&&a&&v(t,s,a),a},w=(e,t,s)=>t.has(e)||u("Cannot "+s),_=(e,t,s)=>t.has(e)?u("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),f=(e,t,s)=>(w(e,t,"access private method"),s),l,h;let r=class extends y{constructor(){super(...arguments),_(this,l),this.direction="column",this.gap="",this.rowGap="",this.columnGap="",this.align="stretch",this.justify="start",this.wrap=!1,this.inline=!1}firstUpdated(){f(this,l,h).call(this)}updated(){f(this,l,h).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 s=this.mapSpacingToken(t[0]);return{row:s,col:s}}return{row:this.mapSpacingToken(t[0]),col:this.mapSpacingToken(t[1])}}render(){return g`<slot></slot>`}};l=new WeakSet;h=function(){this.style.setProperty("--scb-stack-direction",this.direction);const e="var(--spacing-5, 16px)",t=this.parseGapShorthand(this.gap),s=this.mapSpacingToken(this.rowGap)??t.row??e,i=this.mapSpacingToken(this.columnGap)??t.col??e;this.style.setProperty("--scb-stack-gap",`${s}`),this.style.setProperty("--scb-stack-row-gap",s),this.style.setProperty("--scb-stack-column-gap",i);const a={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch",baseline:"baseline"},c={start:"flex-start",center:"center",end:"flex-end",between:"space-between",around:"space-around",evenly:"space-evenly"};this.style.setProperty("--scb-stack-align",a[this.align]??"stretch"),this.style.setProperty("--scb-stack-justify",c[this.justify]??"flex-start"),this.style.setProperty("--scb-stack-wrap",this.wrap?"wrap":"nowrap")};r.styles=d`
1
+ import{a as u,n as o,i as y,x as g,t as b}from"../../vendor/vendor.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(s,i,a){try{customElements.get(s)||t(s,i,a)}catch(l){var c=String(l||"");if(c.indexOf("already been used")===-1&&c.indexOf("NotSupportedError")===-1)throw l}}}}catch{}})();var v=Object.defineProperty,w=Object.getOwnPropertyDescriptor,f=e=>{throw TypeError(e)},n=(e,t,s,i)=>{for(var a=i>1?void 0:i?w(t,s):t,c=e.length-1,l;c>=0;c--)(l=e[c])&&(a=(i?l(t,s,a):l(a))||a);return i&&a&&v(t,s,a),a},m=(e,t,s)=>t.has(e)||f("Cannot "+s),_=(e,t,s)=>t.has(e)?f("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),d=(e,t,s)=>(m(e,t,"access private method"),s),p,h;let r=class extends y{constructor(){super(...arguments),_(this,p),this.direction="column",this.gap="",this.rowGap="",this.columnGap="",this.align="stretch",this.justify="start",this.wrap=!1,this.inline=!1}firstUpdated(){d(this,p,h).call(this)}updated(){d(this,p,h).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 s=this.mapSpacingToken(t[0]);return{row:s,col:s}}return{row:this.mapSpacingToken(t[0]),col:this.mapSpacingToken(t[1])}}render(){return g`<div class="base"><slot></slot></div>`}};p=new WeakSet;h=function(){this.style.setProperty("--scb-stack-direction",this.direction);const e="var(--spacing-5, 16px)",t=this.parseGapShorthand(this.gap),s=this.mapSpacingToken(this.rowGap)??t.row??e,i=this.mapSpacingToken(this.columnGap)??t.col??e;this.style.setProperty("--scb-stack-gap",`${s}`),this.style.setProperty("--scb-stack-row-gap",s),this.style.setProperty("--scb-stack-column-gap",i);const a={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch",baseline:"baseline"},c={start:"flex-start",center:"center",end:"flex-end",between:"space-between",around:"space-around",evenly:"space-evenly"};this.style.setProperty("--scb-stack-align",a[this.align]??"stretch"),this.style.setProperty("--scb-stack-justify",c[this.justify]??"flex-start"),this.style.setProperty("--scb-stack-wrap",this.wrap?"wrap":"nowrap")};r.styles=u`
2
2
  :host {
3
3
  box-sizing: border-box;
4
+ display: block;
5
+ width: auto;
6
+ max-width: 100%;
7
+ min-inline-size: 0;
8
+ }
9
+
10
+ /* Inre flexlayout så att gap även fungerar för slottat innehåll */
11
+ .base {
4
12
  display: var(--scb-stack-display, flex);
5
13
  flex-direction: var(--scb-stack-direction, column);
6
14
 
@@ -11,14 +19,14 @@ import{a as d,n as o,i as y,x as g,t as b}from"../../vendor/vendor.js";(function
11
19
  align-items: var(--scb-stack-align, stretch);
12
20
  justify-content: var(--scb-stack-justify, flex-start);
13
21
  flex-wrap: var(--scb-stack-wrap, nowrap);
14
-
15
- width: auto;
16
- max-width: 100%;
17
- min-inline-size: 0;
18
22
  }
19
- :host([inline]) { --scb-stack-display: inline-flex; }
20
23
 
21
- /* Barnens flex-beteende i rad-läge kan styras via variabeln och defaultar till att inte ta full bredd */
24
+ /* Gör att slotens tilldelade noder blir barn till .base */
25
+ slot { display: contents; }
26
+
27
+ :host([inline]) .base { --scb-stack-display: inline-flex; }
28
+
29
+ /* Barnens flex-beteende i row-läge kan styras via variabeln och defaultar till att inte ta full bredd */
22
30
  :host([direction="row"]) ::slotted(*) {
23
31
  flex: var(--scb-stack-item-flex, 0 0 auto);
24
32
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scb-wc-test",
3
- "version": "0.1.68",
3
+ "version": "0.1.69",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -288,5 +288,5 @@
288
288
  },
289
289
  "./mvc/*": "./mvc/*"
290
290
  },
291
- "buildHash": "8C7654B75AE853BC0D20A7FE0B96E864BB124CB1889BBCBAB35B038B36C66B0B"
291
+ "buildHash": "FE9B59510D9ECD28B7D24E5FB48881AD15C3F106C90BCCCB8F207A27AA59E61B"
292
292
  }
@@ -1,13 +1,13 @@
1
- import { css as y, LitElement as g, html as d } from "lit";
1
+ import { css as y, LitElement as d, html as g } from "lit";
2
2
  import { property as i, customElement as b } from "lit/decorators.js";
3
- var m = Object.defineProperty, v = Object.getOwnPropertyDescriptor, u = (e) => {
3
+ var v = Object.defineProperty, m = Object.getOwnPropertyDescriptor, u = (e) => {
4
4
  throw TypeError(e);
5
5
  }, n = (e, t, s, c) => {
6
- for (var r = c > 1 ? void 0 : c ? v(t, s) : t, o = e.length - 1, l; o >= 0; o--)
6
+ for (var r = c > 1 ? void 0 : c ? m(t, s) : t, o = e.length - 1, l; o >= 0; o--)
7
7
  (l = e[o]) && (r = (c ? l(t, s, r) : l(r)) || r);
8
- return c && r && m(t, s, r), r;
8
+ return c && r && v(t, s, r), r;
9
9
  }, k = (e, t, s) => t.has(e) || u("Cannot " + s), w = (e, t, s) => t.has(e) ? u("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s), f = (e, t, s) => (k(e, t, "access private method"), s), p, h;
10
- let a = class extends g {
10
+ let a = class extends d {
11
11
  constructor() {
12
12
  super(...arguments), w(this, p), this.direction = "column", this.gap = "", this.rowGap = "", this.columnGap = "", this.align = "stretch", this.justify = "start", this.wrap = !1, this.inline = !1;
13
13
  }
@@ -32,7 +32,7 @@ let a = class extends g {
32
32
  return { row: this.mapSpacingToken(t[0]), col: this.mapSpacingToken(t[1]) };
33
33
  }
34
34
  render() {
35
- return d`<slot></slot>`;
35
+ return g`<div class="base"><slot></slot></div>`;
36
36
  }
37
37
  };
38
38
  p = /* @__PURE__ */ new WeakSet();
@@ -59,6 +59,14 @@ h = function() {
59
59
  a.styles = y`
60
60
  :host {
61
61
  box-sizing: border-box;
62
+ display: block;
63
+ width: auto;
64
+ max-width: 100%;
65
+ min-inline-size: 0;
66
+ }
67
+
68
+ /* Inre flexlayout så att gap även fungerar för slottat innehåll */
69
+ .base {
62
70
  display: var(--scb-stack-display, flex);
63
71
  flex-direction: var(--scb-stack-direction, column);
64
72
 
@@ -69,14 +77,14 @@ a.styles = y`
69
77
  align-items: var(--scb-stack-align, stretch);
70
78
  justify-content: var(--scb-stack-justify, flex-start);
71
79
  flex-wrap: var(--scb-stack-wrap, nowrap);
72
-
73
- width: auto;
74
- max-width: 100%;
75
- min-inline-size: 0;
76
80
  }
77
- :host([inline]) { --scb-stack-display: inline-flex; }
78
81
 
79
- /* Barnens flex-beteende i rad-läge kan styras via variabeln och defaultar till att inte ta full bredd */
82
+ /* Gör att slotens tilldelade noder blir barn till .base */
83
+ slot { display: contents; }
84
+
85
+ :host([inline]) .base { --scb-stack-display: inline-flex; }
86
+
87
+ /* Barnens flex-beteende i row-läge kan styras via variabeln och defaultar till att inte ta full bredd */
80
88
  :host([direction="row"]) ::slotted(*) {
81
89
  flex: var(--scb-stack-item-flex, 0 0 auto);
82
90
  }
@@ -4738,9 +4738,17 @@ var ScbWcTest=function(a){"use strict";var Ss;function d(o,e,t,r){var i=argument
4738
4738
 
4739
4739
  .spacer { display: none; }
4740
4740
  @media (min-width: 840px) { .spacer { display: block; } }
4741
- `,rr([l({type:String,attribute:"max-width",reflect:!0,converter:{fromAttribute:o=>{if(o==null)return"1440px";const e=o.trim();return e===""?"1440px":/^\d+$/.test(e)?`${e}px`:e}}})],a.ScbFooter.prototype,"maxWidth",2),rr([l({type:Boolean,reflect:!0,attribute:"defer-paint"})],a.ScbFooter.prototype,"deferPaint",2),rr([l({type:Array})],a.ScbFooter.prototype,"sections",2),rr([l({type:String})],a.ScbFooter.prototype,"description",2),a.ScbFooter=rr([g("scb-footer")],a.ScbFooter);var Gd=Object.defineProperty,Kd=Object.getOwnPropertyDescriptor,vs=o=>{throw TypeError(o)},Oe=(o,e,t,r)=>{for(var i=r>1?void 0:r?Kd(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&Gd(e,t,i),i},Yd=(o,e,t)=>e.has(o)||vs("Cannot "+t),Xd=(o,e,t)=>e.has(o)?vs("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,t),ms=(o,e,t)=>(Yd(o,e,"access private method"),t),si,Io;a.ScbStack=class extends y{constructor(){super(...arguments),Xd(this,si),this.direction="column",this.gap="",this.rowGap="",this.columnGap="",this.align="stretch",this.justify="start",this.wrap=!1,this.inline=!1}firstUpdated(){ms(this,si,Io).call(this)}updated(){ms(this,si,Io).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 r=this.mapSpacingToken(t[0]);return{row:r,col:r}}return{row:this.mapSpacingToken(t[0]),col:this.mapSpacingToken(t[1])}}render(){return c`<slot></slot>`}},si=new WeakSet,Io=function(){this.style.setProperty("--scb-stack-direction",this.direction);const o="var(--spacing-5, 16px)",e=this.parseGapShorthand(this.gap),t=this.mapSpacingToken(this.rowGap)??e.row??o,r=this.mapSpacingToken(this.columnGap)??e.col??o;this.style.setProperty("--scb-stack-gap",`${t}`),this.style.setProperty("--scb-stack-row-gap",t),this.style.setProperty("--scb-stack-column-gap",r);const i={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch",baseline:"baseline"},s={start:"flex-start",center:"center",end:"flex-end",between:"space-between",around:"space-around",evenly:"space-evenly"};this.style.setProperty("--scb-stack-align",i[this.align]??"stretch"),this.style.setProperty("--scb-stack-justify",s[this.justify]??"flex-start"),this.style.setProperty("--scb-stack-wrap",this.wrap?"wrap":"nowrap")},a.ScbStack.styles=b`
4741
+ `,rr([l({type:String,attribute:"max-width",reflect:!0,converter:{fromAttribute:o=>{if(o==null)return"1440px";const e=o.trim();return e===""?"1440px":/^\d+$/.test(e)?`${e}px`:e}}})],a.ScbFooter.prototype,"maxWidth",2),rr([l({type:Boolean,reflect:!0,attribute:"defer-paint"})],a.ScbFooter.prototype,"deferPaint",2),rr([l({type:Array})],a.ScbFooter.prototype,"sections",2),rr([l({type:String})],a.ScbFooter.prototype,"description",2),a.ScbFooter=rr([g("scb-footer")],a.ScbFooter);var Gd=Object.defineProperty,Kd=Object.getOwnPropertyDescriptor,vs=o=>{throw TypeError(o)},Oe=(o,e,t,r)=>{for(var i=r>1?void 0:r?Kd(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&Gd(e,t,i),i},Yd=(o,e,t)=>e.has(o)||vs("Cannot "+t),Xd=(o,e,t)=>e.has(o)?vs("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,t),ms=(o,e,t)=>(Yd(o,e,"access private method"),t),si,Io;a.ScbStack=class extends y{constructor(){super(...arguments),Xd(this,si),this.direction="column",this.gap="",this.rowGap="",this.columnGap="",this.align="stretch",this.justify="start",this.wrap=!1,this.inline=!1}firstUpdated(){ms(this,si,Io).call(this)}updated(){ms(this,si,Io).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 r=this.mapSpacingToken(t[0]);return{row:r,col:r}}return{row:this.mapSpacingToken(t[0]),col:this.mapSpacingToken(t[1])}}render(){return c`<div class="base"><slot></slot></div>`}},si=new WeakSet,Io=function(){this.style.setProperty("--scb-stack-direction",this.direction);const o="var(--spacing-5, 16px)",e=this.parseGapShorthand(this.gap),t=this.mapSpacingToken(this.rowGap)??e.row??o,r=this.mapSpacingToken(this.columnGap)??e.col??o;this.style.setProperty("--scb-stack-gap",`${t}`),this.style.setProperty("--scb-stack-row-gap",t),this.style.setProperty("--scb-stack-column-gap",r);const i={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch",baseline:"baseline"},s={start:"flex-start",center:"center",end:"flex-end",between:"space-between",around:"space-around",evenly:"space-evenly"};this.style.setProperty("--scb-stack-align",i[this.align]??"stretch"),this.style.setProperty("--scb-stack-justify",s[this.justify]??"flex-start"),this.style.setProperty("--scb-stack-wrap",this.wrap?"wrap":"nowrap")},a.ScbStack.styles=b`
4742
4742
  :host {
4743
4743
  box-sizing: border-box;
4744
+ display: block;
4745
+ width: auto;
4746
+ max-width: 100%;
4747
+ min-inline-size: 0;
4748
+ }
4749
+
4750
+ /* Inre flexlayout så att gap även fungerar för slottat innehåll */
4751
+ .base {
4744
4752
  display: var(--scb-stack-display, flex);
4745
4753
  flex-direction: var(--scb-stack-direction, column);
4746
4754
 
@@ -4751,14 +4759,14 @@ var ScbWcTest=function(a){"use strict";var Ss;function d(o,e,t,r){var i=argument
4751
4759
  align-items: var(--scb-stack-align, stretch);
4752
4760
  justify-content: var(--scb-stack-justify, flex-start);
4753
4761
  flex-wrap: var(--scb-stack-wrap, nowrap);
4754
-
4755
- width: auto;
4756
- max-width: 100%;
4757
- min-inline-size: 0;
4758
4762
  }
4759
- :host([inline]) { --scb-stack-display: inline-flex; }
4760
4763
 
4761
- /* Barnens flex-beteende i rad-läge kan styras via variabeln och defaultar till att inte ta full bredd */
4764
+ /* Gör att slotens tilldelade noder blir barn till .base */
4765
+ slot { display: contents; }
4766
+
4767
+ :host([inline]) .base { --scb-stack-display: inline-flex; }
4768
+
4769
+ /* Barnens flex-beteende i row-läge kan styras via variabeln och defaultar till att inte ta full bredd */
4762
4770
  :host([direction="row"]) ::slotted(*) {
4763
4771
  flex: var(--scb-stack-item-flex, 0 0 auto);
4764
4772
  }