scb-wc-test 0.1.360 → 0.1.362

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,10 +1,10 @@
1
- import{a as x,n as _,i as w,E as f,x as k,t as E}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,n,i){try{customElements.get(s)||t(s,n,i)}catch(r){var a=String(r||"");if(a.indexOf("already been used")===-1&&a.indexOf("NotSupportedError")===-1)throw r}}}}catch{}})();var C=Object.defineProperty,z=Object.getOwnPropertyDescriptor,y=e=>{throw TypeError(e)},b=(e,t,s,n)=>{for(var i=n>1?void 0:n?z(t,s):t,a=e.length-1,r;a>=0;a--)(r=e[a])&&(i=(n?r(t,s,i):r(i))||i);return n&&i&&C(t,s,i),i},m=(e,t,s)=>t.has(e)||y("Cannot "+s),d=(e,t,s)=>(m(e,t,"read from private field"),s?s.call(e):t.get(e)),p=(e,t,s)=>t.has(e)?y("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),v=(e,t,s)=>(m(e,t,"access private method"),s),o,u,g,h,c;let l=class extends w{constructor(){super(...arguments),p(this,o),this.open=!1,this.ariaLabel="",p(this,h,e=>{v(this,o,g).call(this,e)||v(this,o,u).call(this)}),p(this,c,e=>{this.open&&e.key==="Escape"&&v(this,o,u).call(this)})}render(){return this.open?k`
2
- <div class="scrim" @click=${d(this,h)}>
3
- <div class="content" role="dialog" aria-modal="true" aria-label="${this.ariaLabel||f}">
1
+ import{a as x,n as b,i as w,E as _,x as k,t as E}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(i,a,s){try{customElements.get(i)||t(i,a,s)}catch(r){var n=String(r||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw r}}}}catch{}})();var S=Object.defineProperty,C=Object.getOwnPropertyDescriptor,y=e=>{throw TypeError(e)},d=(e,t,i,a)=>{for(var s=a>1?void 0:a?C(t,i):t,n=e.length-1,r;n>=0;n--)(r=e[n])&&(s=(a?r(t,i,s):r(s))||s);return a&&s&&S(t,i,s),s},m=(e,t,i)=>t.has(e)||y("Cannot "+i),p=(e,t,i)=>(m(e,t,"read from private field"),i?i.call(e):t.get(e)),u=(e,t,i)=>t.has(e)?y("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,i),v=(e,t,i)=>(m(e,t,"access private method"),i),c,h,g,f,l;let o=class extends w{constructor(){super(...arguments),u(this,c),this.open=!1,this.isStatic=!1,this.ariaLabel="",u(this,f,e=>{this.isStatic||v(this,c,g).call(this,e)||v(this,c,h).call(this)}),u(this,l,e=>{this.open&&e.key==="Escape"&&v(this,c,h).call(this)})}render(){return this.open?k`
2
+ <div class="scrim" @click=${p(this,f)}>
3
+ <div class="content" role="dialog" aria-modal="true" aria-label="${this.ariaLabel||_}">
4
4
  <slot></slot>
5
5
  </div>
6
6
  </div>
7
- `:f}connectedCallback(){super.connectedCallback(),window.addEventListener("keydown",d(this,c))}disconnectedCallback(){window.removeEventListener("keydown",d(this,c)),super.disconnectedCallback()}};o=new WeakSet;u=function(){this.open&&(this.open=!1,this.dispatchEvent(new CustomEvent("scb-overlay-dismiss",{bubbles:!0,composed:!0})))};g=function(e){const t=this.renderRoot.querySelector("slot");if(!(t instanceof HTMLSlotElement))return!1;const s=e.composedPath();return t.assignedNodes({flatten:!0}).some(i=>s.includes(i))};h=new WeakMap;c=new WeakMap;l.styles=x`
7
+ `:_}connectedCallback(){super.connectedCallback(),window.addEventListener("keydown",p(this,l))}disconnectedCallback(){window.removeEventListener("keydown",p(this,l)),super.disconnectedCallback()}};c=new WeakSet;h=function(){this.open&&(this.isStatic||(this.open=!1,this.dispatchEvent(new CustomEvent("scb-overlay-dismiss",{bubbles:!0,composed:!0}))))};g=function(e){const t=this.renderRoot.querySelector("slot");if(!(t instanceof HTMLSlotElement))return!1;const i=e.composedPath();return t.assignedNodes({flatten:!0}).some(s=>i.includes(s))};f=new WeakMap;l=new WeakMap;o.styles=x`
8
8
  :host {
9
9
  position: fixed;
10
10
  inset: 0;
@@ -39,4 +39,4 @@ import{a as x,n as _,i as w,E as f,x as k,t as E}from"../../vendor/vendor.js";(f
39
39
  max-inline-size: 100%;
40
40
  max-block-size: 100%;
41
41
  }
42
- `;b([_({type:Boolean,reflect:!0})],l.prototype,"open",2);b([_({type:String,attribute:"aria-label"})],l.prototype,"ariaLabel",2);l=b([E("scb-overlay")],l);
42
+ `;d([b({type:Boolean,reflect:!0})],o.prototype,"open",2);d([b({type:Boolean,reflect:!0,attribute:"static"})],o.prototype,"isStatic",2);d([b({type:String,attribute:"aria-label"})],o.prototype,"ariaLabel",2);o=d([E("scb-overlay")],o);
@@ -55,7 +55,8 @@ import{a as I,n as p,i as V,x as b,E as j,k as A,t as q}from"../../vendor/vendor
55
55
  .scb-tooltip {
56
56
  position: absolute;
57
57
  min-width: 120px;
58
- max-width: 300px;
58
+ max-width: none;
59
+ width: max-content;
59
60
  opacity: 0;
60
61
  visibility: hidden;
61
62
  z-index: var(--scb-tooltip-z-index, 1000);
@@ -79,12 +80,13 @@ import{a as I,n as p,i as V,x as b,E as j,k as A,t as q}from"../../vendor/vendor
79
80
  font-style: normal;
80
81
  line-height: var(--md-sys-typescale-body-small-line-height);
81
82
  letter-spacing: var(--md-sys-typescale-body-small-tracking);
83
+ white-space: nowrap;
82
84
  }
83
85
 
84
86
  /* Plain variant */
85
87
 
86
88
  :host([variant='plain']) .scb-tooltip {
87
- max-width: 184px;
89
+ max-width: none;
88
90
  }
89
91
 
90
92
  :host([variant='plain']) .scb-tooltip-container {
@@ -157,7 +159,7 @@ import{a as I,n as p,i as V,x as b,E as j,k as A,t as q}from"../../vendor/vendor
157
159
  gap: var(--spacing-3);
158
160
  border-radius: var(--md-sys-shape-corner-medium);
159
161
  min-width: 200px;
160
- max-width: 300px;
162
+ max-width: none;
161
163
  }
162
164
 
163
165
  :host([variant='rich']) .scb-tooltip-text-container {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scb-wc-test",
3
- "version": "0.1.360",
3
+ "version": "0.1.362",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -428,5 +428,5 @@
428
428
  },
429
429
  "./mvc/*": "./mvc/*"
430
430
  },
431
- "buildHash": "530340BB4644B59ED139CA0ABF800C2B95574D6419CA3C01D4C11F650DFE7F0A"
431
+ "buildHash": "FC9D7D265E8562DD969E6ABE139740DCD76EE8CFD602F96452AAEBD7E080971C"
432
432
  }
@@ -2,6 +2,7 @@ import { LitElement, nothing } from 'lit';
2
2
  export declare class ScbOverlay extends LitElement {
3
3
  #private;
4
4
  open: boolean;
5
+ isStatic: boolean;
5
6
  ariaLabel: string;
6
7
  static styles: import('lit').CSSResult;
7
8
  render(): import('lit-html').TemplateResult<1> | typeof nothing;
@@ -1,44 +1,44 @@
1
- import { css as k, LitElement as x, nothing as f, html as w } from "lit";
2
- import { property as m, customElement as C } from "lit/decorators.js";
3
- var z = Object.defineProperty, E = Object.getOwnPropertyDescriptor, y = (e) => {
1
+ import { css as k, LitElement as x, nothing as m, html as w } from "lit";
2
+ import { property as f, customElement as C } from "lit/decorators.js";
3
+ var S = Object.defineProperty, z = Object.getOwnPropertyDescriptor, y = (e) => {
4
4
  throw TypeError(e);
5
- }, u = (e, t, s, r) => {
6
- for (var i = r > 1 ? void 0 : r ? E(t, s) : t, l = e.length - 1, c; l >= 0; l--)
7
- (c = e[l]) && (i = (r ? c(t, s, i) : c(i)) || i);
8
- return r && i && z(t, s, i), i;
9
- }, _ = (e, t, s) => t.has(e) || y("Cannot " + s), d = (e, t, s) => (_(e, t, "read from private field"), s ? s.call(e) : t.get(e)), p = (e, t, s) => t.has(e) ? y("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s), v = (e, t, s) => (_(e, t, "access private method"), s), n, h, g, b, o;
10
- let a = class extends x {
5
+ }, l = (e, t, s, a) => {
6
+ for (var i = a > 1 ? void 0 : a ? z(t, s) : t, c = e.length - 1, d; c >= 0; c--)
7
+ (d = e[c]) && (i = (a ? d(t, s, i) : d(i)) || i);
8
+ return a && i && S(t, s, i), i;
9
+ }, _ = (e, t, s) => t.has(e) || y("Cannot " + s), p = (e, t, s) => (_(e, t, "read from private field"), s ? s.call(e) : t.get(e)), v = (e, t, s) => t.has(e) ? y("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s), h = (e, t, s) => (_(e, t, "access private method"), s), n, u, g, b, o;
10
+ let r = class extends x {
11
11
  constructor() {
12
- super(...arguments), p(this, n), this.open = !1, this.ariaLabel = "", p(this, b, (e) => {
13
- v(this, n, g).call(this, e) || v(this, n, h).call(this);
14
- }), p(this, o, (e) => {
15
- this.open && e.key === "Escape" && v(this, n, h).call(this);
12
+ super(...arguments), v(this, n), this.open = !1, this.isStatic = !1, this.ariaLabel = "", v(this, b, (e) => {
13
+ this.isStatic || h(this, n, g).call(this, e) || h(this, n, u).call(this);
14
+ }), v(this, o, (e) => {
15
+ this.open && e.key === "Escape" && h(this, n, u).call(this);
16
16
  });
17
17
  }
18
18
  render() {
19
19
  return this.open ? w`
20
- <div class="scrim" @click=${d(this, b)}>
21
- <div class="content" role="dialog" aria-modal="true" aria-label="${this.ariaLabel || f}">
20
+ <div class="scrim" @click=${p(this, b)}>
21
+ <div class="content" role="dialog" aria-modal="true" aria-label="${this.ariaLabel || m}">
22
22
  <slot></slot>
23
23
  </div>
24
24
  </div>
25
- ` : f;
25
+ ` : m;
26
26
  }
27
27
  connectedCallback() {
28
- super.connectedCallback(), window.addEventListener("keydown", d(this, o));
28
+ super.connectedCallback(), window.addEventListener("keydown", p(this, o));
29
29
  }
30
30
  disconnectedCallback() {
31
- window.removeEventListener("keydown", d(this, o)), super.disconnectedCallback();
31
+ window.removeEventListener("keydown", p(this, o)), super.disconnectedCallback();
32
32
  }
33
33
  };
34
34
  n = /* @__PURE__ */ new WeakSet();
35
- h = function() {
36
- this.open && (this.open = !1, this.dispatchEvent(
35
+ u = function() {
36
+ this.open && (this.isStatic || (this.open = !1, this.dispatchEvent(
37
37
  new CustomEvent("scb-overlay-dismiss", {
38
38
  bubbles: !0,
39
39
  composed: !0
40
40
  })
41
- ));
41
+ )));
42
42
  };
43
43
  g = function(e) {
44
44
  const t = this.renderRoot.querySelector("slot");
@@ -48,7 +48,7 @@ g = function(e) {
48
48
  };
49
49
  b = /* @__PURE__ */ new WeakMap();
50
50
  o = /* @__PURE__ */ new WeakMap();
51
- a.styles = k`
51
+ r.styles = k`
52
52
  :host {
53
53
  position: fixed;
54
54
  inset: 0;
@@ -84,15 +84,18 @@ a.styles = k`
84
84
  max-block-size: 100%;
85
85
  }
86
86
  `;
87
- u([
88
- m({ type: Boolean, reflect: !0 })
89
- ], a.prototype, "open", 2);
90
- u([
91
- m({ type: String, attribute: "aria-label" })
92
- ], a.prototype, "ariaLabel", 2);
93
- a = u([
87
+ l([
88
+ f({ type: Boolean, reflect: !0 })
89
+ ], r.prototype, "open", 2);
90
+ l([
91
+ f({ type: Boolean, reflect: !0, attribute: "static" })
92
+ ], r.prototype, "isStatic", 2);
93
+ l([
94
+ f({ type: String, attribute: "aria-label" })
95
+ ], r.prototype, "ariaLabel", 2);
96
+ r = l([
94
97
  C("scb-overlay")
95
- ], a);
98
+ ], r);
96
99
  export {
97
- a as ScbOverlay
100
+ r as ScbOverlay
98
101
  };
@@ -195,7 +195,7 @@ let U = 0, l = class extends V {
195
195
  - uppdaterar host-attributet position när vi byter sida
196
196
  */
197
197
  _positionTooltip(t, e) {
198
- const o = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = this.getBoundingClientRect(), f = (this.offset ?? 0) + 8, v = 8, y = v, T = window.innerHeight - v, x = v, w = window.innerWidth - v, O = (s) => s >= y && s + r.height <= T, $ = (s) => s >= x && s + r.width <= w, E = (s, n, a, d) => {
198
+ const o = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = this.getBoundingClientRect(), f = (this.offset ?? 0) + 8, v = 8, y = v, T = window.innerHeight - v, w = v, x = window.innerWidth - v, O = (s) => s >= y && s + r.height <= T, $ = (s) => s >= w && s + r.width <= x, E = (s, n, a, d) => {
199
199
  let c = 0;
200
200
  s < a && (c += a - s);
201
201
  const _ = s + n;
@@ -224,8 +224,8 @@ let U = 0, l = class extends V {
224
224
  ), I = E(
225
225
  c,
226
226
  r.width,
227
- x,
228
- w
227
+ w,
228
+ x
229
229
  );
230
230
  return {
231
231
  pos: s,
@@ -239,7 +239,7 @@ let U = 0, l = class extends V {
239
239
  let m = k.find((s) => s.fitsV && s.fitsH) ?? k.reduce(
240
240
  (s, n) => n.totalOverflow < s.totalOverflow ? n : s
241
241
  );
242
- const M = (s, n, a) => Math.min(Math.max(s, n), a), S = y - i.top, B = T - r.height - i.top, D = x - i.left, z = w - r.width - i.left, R = M(m.top, S, B), F = M(m.left, D, z);
242
+ const M = (s, n, a) => Math.min(Math.max(s, n), a), S = y - i.top, B = T - r.height - i.top, D = w - i.left, z = x - r.width - i.left, R = M(m.top, S, B), F = M(m.left, D, z);
243
243
  t.style.top = `${R}px`, t.style.left = `${F}px`, this.position !== m.pos && (this.position = m.pos);
244
244
  }
245
245
  /*
@@ -332,7 +332,8 @@ l.styles = N`
332
332
  .scb-tooltip {
333
333
  position: absolute;
334
334
  min-width: 120px;
335
- max-width: 300px;
335
+ max-width: none;
336
+ width: max-content;
336
337
  opacity: 0;
337
338
  visibility: hidden;
338
339
  z-index: var(--scb-tooltip-z-index, 1000);
@@ -356,12 +357,13 @@ l.styles = N`
356
357
  font-style: normal;
357
358
  line-height: var(--md-sys-typescale-body-small-line-height);
358
359
  letter-spacing: var(--md-sys-typescale-body-small-tracking);
360
+ white-space: nowrap;
359
361
  }
360
362
 
361
363
  /* Plain variant */
362
364
 
363
365
  :host([variant='plain']) .scb-tooltip {
364
- max-width: 184px;
366
+ max-width: none;
365
367
  }
366
368
 
367
369
  :host([variant='plain']) .scb-tooltip-container {
@@ -434,7 +436,7 @@ l.styles = N`
434
436
  gap: var(--spacing-3);
435
437
  border-radius: var(--md-sys-shape-corner-medium);
436
438
  min-width: 200px;
437
- max-width: 300px;
439
+ max-width: none;
438
440
  }
439
441
 
440
442
  :host([variant='rich']) .scb-tooltip-text-container {