@warp-ds/elements 2.2.0-next.27 → 2.2.0-next.28

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,4 +1,4 @@
1
- var xe=Object.defineProperty;var ke=Object.getOwnPropertyDescriptor;var ae=a=>{throw TypeError(a)};var s=(a,t,e,r)=>{for(var i=r>1?void 0:r?ke(t,e):t,c=a.length-1,m;c>=0;c--)(m=a[c])&&(i=(r?m(t,e,i):m(i))||i);return r&&i&&xe(t,e,i),i};var Q=(a,t,e)=>t.has(a)||ae("Cannot "+e);var ie=(a,t,e)=>(Q(a,t,"read from private field"),e?e.call(a):t.get(a)),j=(a,t,e)=>t.has(a)?ae("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(a):t.set(a,e),se=(a,t,e,r)=>(Q(a,t,"write to private field"),r?r.call(a,e):t.set(a,e),e),h=(a,t,e)=>(Q(a,t,"access private method"),e);var l=function(a,t,e,r){if(e==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?a!==t||!r:!t.has(a))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?r:e==="a"?r.call(a):r?r.value:t.get(a)},p=function(a,t,e,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?a!==t||!i:!t.has(a))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(a,e):i?i.value=e:t.set(a,e),e};function R(a){var t,e,r,i,c,m,x,E,C,_,D,U,L,P,A,F,B,H,G;class we extends a{constructor(...o){var n,b,u;super(...o),t.add(this),this.internals=this.attachInternals(),e.set(this,!1),r.set(this,!1),i.set(this,!1),c.set(this,void 0),m.set(this,void 0),x.set(this,!0),C.set(this,""),_.set(this,()=>{p(this,i,!0,"f"),p(this,e,!0,"f"),l(this,t,"m",F).call(this)}),D.set(this,()=>{p(this,e,!1,"f"),l(this,t,"m",B).call(this,this.shouldFormValueUpdate()?l(this,C,"f"):""),!this.validity.valid&&l(this,i,"f")&&p(this,r,!0,"f");let z=l(this,t,"m",F).call(this);this.validationMessageCallback&&this.validationMessageCallback(z?this.internals.validationMessage:"")}),U.set(this,()=>{var z;l(this,x,"f")&&this.validationTarget&&(this.internals.setValidity(this.validity,this.validationMessage,this.validationTarget),p(this,x,!1,"f")),p(this,i,!0,"f"),p(this,r,!0,"f"),l(this,t,"m",F).call(this),(z=this===null||this===void 0?void 0:this.validationMessageCallback)===null||z===void 0||z.call(this,this.showError?this.internals.validationMessage:"")}),L.set(this,void 0),P.set(this,!1),A.set(this,Promise.resolve()),(n=this.addEventListener)===null||n===void 0||n.call(this,"focus",l(this,_,"f")),(b=this.addEventListener)===null||b===void 0||b.call(this,"blur",l(this,D,"f")),(u=this.addEventListener)===null||u===void 0||u.call(this,"invalid",l(this,U,"f")),this.setValue(null)}static get formAssociated(){return!0}static get validators(){return this.formControlValidators||[]}static get observedAttributes(){let o=this.validators.map(u=>u.attribute).flat(),n=super.observedAttributes||[];return[...new Set([...n,...o])]}static getValidator(o){return this.validators.find(n=>n.attribute===o)||null}static getValidators(o){return this.validators.filter(n=>{var b;if(n.attribute===o||!((b=n.attribute)===null||b===void 0)&&b.includes(o))return!0})}get form(){return this.internals.form}get showError(){return l(this,t,"m",F).call(this)}checkValidity(){return this.internals.checkValidity()}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}attributeChangedCallback(o,n,b){var u;(u=super.attributeChangedCallback)===null||u===void 0||u.call(this,o,n,b);let I=this.constructor.getValidators(o);I!=null&&I.length&&this.validationTarget&&this.setValue(l(this,C,"f"))}setValue(o){var n;p(this,r,!1,"f"),(n=this.validationMessageCallback)===null||n===void 0||n.call(this,""),p(this,C,o,"f");let u=this.shouldFormValueUpdate()?o:null;this.internals.setFormValue(u),l(this,t,"m",B).call(this,u),this.valueChangedCallback&&this.valueChangedCallback(u),l(this,t,"m",F).call(this)}shouldFormValueUpdate(){return!0}get validationComplete(){return new Promise(o=>o(l(this,A,"f")))}formResetCallback(){var o,n;p(this,i,!1,"f"),p(this,r,!1,"f"),l(this,t,"m",F).call(this),(o=this.resetFormControl)===null||o===void 0||o.call(this),(n=this.validationMessageCallback)===null||n===void 0||n.call(this,l(this,t,"m",F).call(this)?this.validationMessage:"")}}return e=new WeakMap,r=new WeakMap,i=new WeakMap,c=new WeakMap,m=new WeakMap,x=new WeakMap,C=new WeakMap,_=new WeakMap,D=new WeakMap,U=new WeakMap,L=new WeakMap,P=new WeakMap,A=new WeakMap,t=new WeakSet,E=function(){let o=this.getRootNode(),n=`${this.localName}[name="${this.getAttribute("name")}"]`;return o.querySelectorAll(n)},F=function(){if(this.hasAttribute("disabled"))return!1;let o=l(this,r,"f")||l(this,i,"f")&&!this.validity.valid&&!l(this,e,"f");return o&&this.internals.states?this.internals.states.add("--show-error"):this.internals.states&&this.internals.states.delete("--show-error"),o},B=function(o){let n=this.constructor,b={},u=n.validators,z=[],I=u.some(w=>w.isValid instanceof Promise);l(this,P,"f")||(p(this,A,new Promise(w=>{p(this,L,w,"f")}),"f"),p(this,P,!0,"f")),l(this,c,"f")&&(l(this,c,"f").abort(),p(this,m,l(this,c,"f"),"f"));let N=new AbortController;p(this,c,N,"f");let S,oe=!1;u.length&&(u.forEach(w=>{let J=w.key||"customError",$=w.isValid(this,o,N.signal);$ instanceof Promise?(z.push($),$.then(K=>{K!=null&&(b[J]=!K,S=l(this,t,"m",G).call(this,w,o),l(this,t,"m",H).call(this,b,S))})):(b[J]=!$,this.validity[J]!==!$&&(oe=!0),!$&&!S&&(S=l(this,t,"m",G).call(this,w,o)))}),Promise.allSettled(z).then(()=>{var w;N!=null&&N.signal.aborted||(p(this,P,!1,"f"),(w=l(this,L,"f"))===null||w===void 0||w.call(this))}),(oe||!I)&&l(this,t,"m",H).call(this,b,S))},H=function(o,n){if(this.validationTarget)this.internals.setValidity(o,n,this.validationTarget),p(this,x,!1,"f");else{if(this.internals.setValidity(o,n),this.internals.validity.valid)return;p(this,x,!0,"f")}},G=function(o,n){if(this.validityCallback){let b=this.validityCallback(o.key||"customError");if(b)return b}return o.message instanceof Function?o.message(this,n):o.message},we}import{html as de,LitElement as ce,nothing as _e}from"lit";import{property as y}from"lit/decorators.js";import{css as ne}from"lit";var X=ne`
1
+ var ue=Object.defineProperty;var me=Object.getOwnPropertyDescriptor;var te=d=>{throw TypeError(d)};var s=(d,r,e,o)=>{for(var i=o>1?void 0:o?me(r,e):r,t=d.length-1,v;t>=0;t--)(v=d[t])&&(i=(o?v(r,e,i):v(i))||i);return o&&i&&ue(r,e,i),i};var ve=(d,r,e)=>r.has(d)||te("Cannot "+e);var X=(d,r,e)=>r.has(d)?te("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(d):r.set(d,e);var b=(d,r,e)=>(ve(d,r,"access private method"),e);var l=function(d,r,e,o){if(e==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof r=="function"?d!==r||!o:!r.has(d))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?o:e==="a"?o.call(d):o?o.value:r.get(d)},p=function(d,r,e,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof r=="function"?d!==r||!i:!r.has(d))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(d,e):i?i.value=e:r.set(d,e),e};function S(d){var r,e,o,i,t,v,_,P,z,F,E,O,A,I,L,C,U,B,H;class ge extends d{constructor(...a){var n,h,g;super(...a),r.add(this),this.internals=this.attachInternals(),e.set(this,!1),o.set(this,!1),i.set(this,!1),t.set(this,void 0),v.set(this,void 0),_.set(this,!0),z.set(this,""),F.set(this,()=>{p(this,i,!0,"f"),p(this,e,!0,"f"),l(this,r,"m",C).call(this)}),E.set(this,()=>{p(this,e,!1,"f"),l(this,r,"m",U).call(this,this.shouldFormValueUpdate()?l(this,z,"f"):""),!this.validity.valid&&l(this,i,"f")&&p(this,o,!0,"f");let y=l(this,r,"m",C).call(this);this.validationMessageCallback&&this.validationMessageCallback(y?this.internals.validationMessage:"")}),O.set(this,()=>{var y;l(this,_,"f")&&this.validationTarget&&(this.internals.setValidity(this.validity,this.validationMessage,this.validationTarget),p(this,_,!1,"f")),p(this,i,!0,"f"),p(this,o,!0,"f"),l(this,r,"m",C).call(this),(y=this===null||this===void 0?void 0:this.validationMessageCallback)===null||y===void 0||y.call(this,this.showError?this.internals.validationMessage:"")}),A.set(this,void 0),I.set(this,!1),L.set(this,Promise.resolve()),(n=this.addEventListener)===null||n===void 0||n.call(this,"focus",l(this,F,"f")),(h=this.addEventListener)===null||h===void 0||h.call(this,"blur",l(this,E,"f")),(g=this.addEventListener)===null||g===void 0||g.call(this,"invalid",l(this,O,"f")),this.setValue(null)}static get formAssociated(){return!0}static get validators(){return this.formControlValidators||[]}static get observedAttributes(){let a=this.validators.map(g=>g.attribute).flat(),n=super.observedAttributes||[];return[...new Set([...n,...a])]}static getValidator(a){return this.validators.find(n=>n.attribute===a)||null}static getValidators(a){return this.validators.filter(n=>{var h;if(n.attribute===a||!((h=n.attribute)===null||h===void 0)&&h.includes(a))return!0})}get form(){return this.internals.form}get showError(){return l(this,r,"m",C).call(this)}checkValidity(){return this.internals.checkValidity()}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}attributeChangedCallback(a,n,h){var g;(g=super.attributeChangedCallback)===null||g===void 0||g.call(this,a,n,h);let T=this.constructor.getValidators(a);T!=null&&T.length&&this.validationTarget&&this.setValue(l(this,z,"f"))}setValue(a){var n;p(this,o,!1,"f"),(n=this.validationMessageCallback)===null||n===void 0||n.call(this,""),p(this,z,a,"f");let g=this.shouldFormValueUpdate()?a:null;this.internals.setFormValue(g),l(this,r,"m",U).call(this,g),this.valueChangedCallback&&this.valueChangedCallback(g),l(this,r,"m",C).call(this)}shouldFormValueUpdate(){return!0}get validationComplete(){return new Promise(a=>a(l(this,L,"f")))}formResetCallback(){var a,n;p(this,i,!1,"f"),p(this,o,!1,"f"),l(this,r,"m",C).call(this),(a=this.resetFormControl)===null||a===void 0||a.call(this),(n=this.validationMessageCallback)===null||n===void 0||n.call(this,l(this,r,"m",C).call(this)?this.validationMessage:"")}}return e=new WeakMap,o=new WeakMap,i=new WeakMap,t=new WeakMap,v=new WeakMap,_=new WeakMap,z=new WeakMap,F=new WeakMap,E=new WeakMap,O=new WeakMap,A=new WeakMap,I=new WeakMap,L=new WeakMap,r=new WeakSet,P=function(){let a=this.getRootNode(),n=`${this.localName}[name="${this.getAttribute("name")}"]`;return a.querySelectorAll(n)},C=function(){if(this.hasAttribute("disabled"))return!1;let a=l(this,o,"f")||l(this,i,"f")&&!this.validity.valid&&!l(this,e,"f");return a&&this.internals.states?this.internals.states.add("--show-error"):this.internals.states&&this.internals.states.delete("--show-error"),a},U=function(a){let n=this.constructor,h={},g=n.validators,y=[],T=g.some(f=>f.isValid instanceof Promise);l(this,I,"f")||(p(this,L,new Promise(f=>{p(this,A,f,"f")}),"f"),p(this,I,!0,"f")),l(this,t,"f")&&(l(this,t,"f").abort(),p(this,v,l(this,t,"f"),"f"));let j=new AbortController;p(this,t,j,"f");let N,re=!1;g.length&&(g.forEach(f=>{let G=f.key||"customError",$=f.isValid(this,a,j.signal);$ instanceof Promise?(y.push($),$.then(J=>{J!=null&&(h[G]=!J,N=l(this,r,"m",H).call(this,f,a),l(this,r,"m",B).call(this,h,N))})):(h[G]=!$,this.validity[G]!==!$&&(re=!0),!$&&!N&&(N=l(this,r,"m",H).call(this,f,a)))}),Promise.allSettled(y).then(()=>{var f;j!=null&&j.signal.aborted||(p(this,I,!1,"f"),(f=l(this,A,"f"))===null||f===void 0||f.call(this))}),(re||!T)&&l(this,r,"m",B).call(this,h,N))},B=function(a,n){if(this.validationTarget)this.internals.setValidity(a,n,this.validationTarget),p(this,_,!1,"f");else{if(this.internals.setValidity(a,n),this.internals.validity.valid)return;p(this,_,!0,"f")}},H=function(a,n){if(this.validityCallback){let h=this.validityCallback(a.key||"customError");if(h)return h}return a.message instanceof Function?a.message(this,n):a.message},ge}import{html as ie,LitElement as se,nothing as fe}from"lit";import{property as k}from"lit/decorators.js";import{css as oe}from"lit";var R=oe`
2
2
  *,
3
3
  :before,
4
4
  :after {
@@ -271,7 +271,7 @@ var xe=Object.defineProperty;var ke=Object.getOwnPropertyDescriptor;var ae=a=>{t
271
271
  svg {
272
272
  pointer-events: none;
273
273
  }
274
- `,Pe=ne`*, :before, :after {
274
+ `,Fe=oe`*, :before, :after {
275
275
  --w-rotate: 0;
276
276
  --w-rotate-x: 0;
277
277
  --w-rotate-y: 0;
@@ -2437,7 +2437,7 @@ var xe=Object.defineProperty;var ke=Object.getOwnPropertyDescriptor;var ae=a=>{t
2437
2437
  display: none
2438
2438
  }
2439
2439
  }
2440
- `;import{css as ye}from"lit";var le=ye`
2440
+ `;import{css as we}from"lit";var ae=we`
2441
2441
  .w-slider {
2442
2442
  position: relative;
2443
2443
  border: none;
@@ -2465,10 +2465,12 @@ var xe=Object.defineProperty;var ke=Object.getOwnPropertyDescriptor;var ae=a=>{t
2465
2465
 
2466
2466
  /* The --min value can be non-zero, f. ex. choosing a year from 1950 to 2025. Normalize the values so we start at 0 and run to max - min. */
2467
2467
  --_value-range: calc(var(--max) - var(--min));
2468
- --_from-in-range: max(calc(var(--from) - var(--min)), 0);
2468
+
2469
+ /** Round up to the nearest --step, which defaults to 1 (https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input/range#step) */
2470
+ --_from-in-range: round(up, max(calc(var(--from) - var(--min)), 0), var(--step, 1));
2469
2471
 
2470
2472
  /* limit to maximum value in range so typing a value larger than max doesn't explode layouts */
2471
- --_to-in-range: min(calc(var(--to) - var(--min)), var(--_value-range));
2473
+ --_to-in-range: round(up, min(calc(var(--to) - var(--min)), var(--_value-range)), var(--step, 1));
2472
2474
 
2473
2475
  /* Position the starting point of the fill in the case of a non-zero --from value in a range slider.
2474
2476
  * In other words, given a width of 100% how many percent should be left unfilled/blank
@@ -2501,17 +2503,36 @@ var xe=Object.defineProperty;var ke=Object.getOwnPropertyDescriptor;var ae=a=>{t
2501
2503
  grid-area: description;
2502
2504
  }
2503
2505
 
2504
- .w-slider__active-range {
2506
+ .w-slider__range {
2505
2507
  align-self: center;
2506
2508
  background: var(--w-slider-track-background);
2507
2509
  border-radius: 4px;
2510
+ height: var(--w-slider-track-active-height);
2508
2511
  position: absolute;
2512
+ /* For range sliders to avoid overlapping the slider thumbs we transform them to
2513
+ be visually to the left and right of their respective input[type="range"]. This
2514
+ padding is here so the active-range element is the same width as the input fields. */
2515
+ padding-inline-start: var(--active-range-inline-start-padding, 0);
2516
+ padding-inline-end: var(--active-range-inline-end-padding, 0);
2509
2517
  top: var(--_range-top);
2510
2518
  left: 0;
2511
2519
  right: 0;
2512
2520
  grid-area: slider;
2513
2521
  }
2514
2522
 
2523
+ .w-slider__active-range {
2524
+ box-sizing: content-box;
2525
+ background: var(--w-slider-track-active-background);
2526
+ height: var(--w-slider-track-active-height);
2527
+
2528
+ border-start-start-radius: var(--active-range-border-radius, 0);
2529
+ border-end-start-radius: var(--active-range-border-radius, 0);
2530
+
2531
+ margin-left: calc(calc(var(--_blank-values-before) * 1%) - var(--active-range-inline-start-padding, 0px));
2532
+ width: calc(calc(var(--_filled-values) * 1%) + var(--active-range-inline-end-padding, 0px));
2533
+ z-index: 1;
2534
+ }
2535
+
2515
2536
  .w-slider__markers {
2516
2537
  --_marker-height: 7px;
2517
2538
  --_marker-width: 1px;
@@ -2521,9 +2542,14 @@ var xe=Object.defineProperty;var ke=Object.getOwnPropertyDescriptor;var ae=a=>{t
2521
2542
  /* Creates a linear gradient with --_marker-width wide markers
2522
2543
  followed by enough transparent that we can repeat the gradient
2523
2544
  along the X axis and have markers visible where we want them. */
2524
- background: linear-gradient(to right, var(--w-slider-marker-color) var(--_marker-width), rgba(0, 0, 0, 0) 1px) repeat-x;
2545
+ background: linear-gradient(
2546
+ to right,
2547
+ var(--w-slider-marker-color) var(--_marker-width),
2548
+ rgba(0, 0, 0, 0) 1px calc(100% - 1px),
2549
+ var(--w-slider-marker-color) 100%
2550
+ ) repeat-x;
2525
2551
  --_step-width-as-percent: calc(var(--markers) / var(--_value-range) * 100);
2526
- background-size: calc(var(--_step-width-as-percent) * 1% - 0.1%) var(--_marker-height);
2552
+ background-size: calc(var(--_step-width-as-percent) * 1%) var(--_marker-height);
2527
2553
 
2528
2554
  background-position: bottom 0 left 8px right 8px;
2529
2555
  position: absolute;
@@ -2532,17 +2558,7 @@ var xe=Object.defineProperty;var ke=Object.getOwnPropertyDescriptor;var ae=a=>{t
2532
2558
  right: 1px;
2533
2559
  grid-area: slider;
2534
2560
  height: var(--_marker-height);
2535
- }
2536
-
2537
- .w-slider__active-range::before {
2538
- background: var(--w-slider-track-active-background);
2539
- border-radius: 4px;
2540
- content: '';
2541
- display: block;
2542
- height: var(--w-slider-track-active-height);
2543
-
2544
- margin-left: calc(var(--_blank-values-before) * 1%);
2545
- width: calc(var(--_filled-values) * 1%);
2561
+ margin-inline: var(--w-slider-thumb-offset);
2546
2562
  }
2547
2563
 
2548
2564
  slot::slotted(w-slider-thumb) {
@@ -2553,19 +2569,21 @@ var xe=Object.defineProperty;var ke=Object.getOwnPropertyDescriptor;var ae=a=>{t
2553
2569
  bottom: 0;
2554
2570
  grid-area: slider;
2555
2571
  }
2556
- `;var T,g,V,he,be,W,pe,v=class extends R(ce){constructor(){super(...arguments);j(this,g);this.disabled=!1;this.invalid=!1;this.required=!1;j(this,T)}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.style.setProperty("--min",this.min),this.style.setProperty("--max",this.max),this.markers&&this.style.setProperty("--markers",String(this.markers));let e=getComputedStyle(this.shadowRoot.querySelector(".w-slider"));se(this,T,Number.parseFloat(e.getPropertyValue("--w-slider-thumb-size").replace("px",""))),h(this,g,V).call(this)}updated(e){(e.has("disabled")||e.has("invalid")||e.has("required")||e.has("min")||e.has("step")||e.has("max")||e.has("suffix")||e.has("formatter"))&&h(this,g,V).call(this)}render(){return de`
2557
- <fieldset id="fieldset" class="w-slider" @input="${h(this,g,he)}" @slidervalidity="${h(this,g,be)}">
2572
+ `;var m,V,ne,le,K,u=class extends S(se){constructor(){super(...arguments);X(this,m);this.disabled=!1;this.invalid=!1;this.required=!1}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.step&&this.style.setProperty("--step",String(this.step)),this.style.setProperty("--min",this.min),this.style.setProperty("--max",this.max),this.markers&&this.style.setProperty("--markers",String(this.markers)),b(this,m,V).call(this)}updated(e){(e.has("disabled")||e.has("invalid")||e.has("required")||e.has("min")||e.has("step")||e.has("max")||e.has("suffix")||e.has("formatter"))&&b(this,m,V).call(this)}render(){return ie`
2573
+ <fieldset id="fieldset" class="w-slider" @input="${b(this,m,ne)}" @slidervalidity="${b(this,m,le)}">
2558
2574
  <legend class="w-slider__label">
2559
2575
  <slot id="label" name="label">${this.label}</slot>
2560
2576
  </legend>
2561
2577
  <slot class="w-slider__description" name="description"></slot>
2562
- ${this.markers?de`<div class="w-slider__markers"></div>`:_e}
2563
- <div class="w-slider__active-range"></div>
2564
- <slot class="w-slider__slider" @slotchange=${h(this,g,V)}></slot>
2565
- <slot class="w-slider__slider" name="from" @slotchange=${h(this,g,V)}></slot>
2566
- <slot class="w-slider__slider" name="to" @slotchange=${h(this,g,V)}></slot>
2578
+ ${this.markers?ie`<div class="w-slider__markers"></div>`:fe}
2579
+ <div class="w-slider__range">
2580
+ <div class="w-slider__active-range"></div>
2581
+ </div>
2582
+ <slot class="w-slider__slider" @slotchange=${b(this,m,V)}></slot>
2583
+ <slot class="w-slider__slider" name="from" @slotchange=${b(this,m,V)}></slot>
2584
+ <slot class="w-slider__slider" name="to" @slotchange=${b(this,m,V)}></slot>
2567
2585
  </fieldset>
2568
- `}};T=new WeakMap,g=new WeakSet,V=function(){let e=this.querySelectorAll("w-slider-thumb");for(let r of e.values())r.min=this.min,r.max=this.max,r.step=this.step,r.suffix=this.suffix,r.required=this.required,r.formatter=this.formatter,r.ariaLabel||(r.slot||(r.ariaLabel=this.label),r.slot==="from"&&(r.ariaLabel=`${this.label} min`),r.slot==="to"&&(r.ariaLabel=`${this.label} max`)),r.forceDisabled=this.disabled,r.forceInvalid=this.invalid,h(this,g,W).call(this,r)},he=function(e){let r=e.target;h(this,g,W).call(this,r)},be=function(e){e.stopPropagation(),this.invalid=e.detail.invalid},W=function(e){var i,c;let r=e.slot;if(r){let m=h(this,g,pe).call(this),x=ie(this,T),E=x-m;m<=x&&this.style.setProperty("--thumb-offset",String(E))}if(r||this.style.setProperty("--from","0"),r==="from"){let m=(i=e.value)!=null?i:e.value=this.min;this.style.setProperty("--from",m)}if(!r||r==="to"){let m=(c=e.value)!=null?c:e.value=this.max;this.style.setProperty("--to",m)}},pe=function(){let e=window.getComputedStyle(this.shadowRoot.querySelector(".w-slider__active-range"),"::before").width;return Number.parseFloat(e.replace("px",""))},v.shadowRootOptions={...ce.shadowRootOptions,delegatesFocus:!0},v.styles=[X,le],s([y({reflect:!0})],v.prototype,"label",2),s([y({type:Boolean,reflect:!0})],v.prototype,"disabled",2),s([y({type:Boolean,reflect:!0})],v.prototype,"invalid",2),s([y({type:Boolean,reflect:!0})],v.prototype,"required",2),s([y({reflect:!0})],v.prototype,"min",2),s([y({reflect:!0})],v.prototype,"max",2),s([y({type:Number,reflect:!0})],v.prototype,"markers",2),s([y({type:Number,reflect:!0})],v.prototype,"step",2),s([y({reflect:!0})],v.prototype,"suffix",2),s([y({attribute:!1})],v.prototype,"formatter",2);customElements.get("w-slider")||customElements.define("w-slider",v);import{html as q,LitElement as me,nothing as ee}from"lit";import{property as M,query as ve,state as k}from"lit/decorators.js";import{classMap as Fe}from"lit/directives/class-map.js";import{ifDefined as re}from"lit/directives/if-defined.js";import{css as ze}from"lit";var ue=ze`
2586
+ `}};m=new WeakSet,V=function(){let e=this.querySelectorAll("w-slider-thumb"),o=!1;for(let t of e.values())t.min=this.min,t.max=this.max,t.step=this.step,t.suffix=this.suffix,t.required=this.required,t.formatter=this.formatter,t.ariaLabel||(t.slot||(t.ariaLabel=this.label),t.slot==="from"&&(t.ariaLabel=`${this.label} min`),t.slot==="to"&&(t.ariaLabel=`${this.label} max`)),(t.slot==="from"||t.slot==="to")&&(o=!0),t.forceDisabled=this.disabled,t.forceInvalid=this.invalid,b(this,m,K).call(this,t);let i=this.shadowRoot.querySelector("fieldset");o?(i.style.setProperty("--active-range-inline-start-padding","var(--w-slider-thumb-size)"),i.style.setProperty("--active-range-inline-end-padding","var(--w-slider-thumb-size)")):i.style.setProperty("--active-range-border-radius","4px")},ne=function(e){let o=e.target;b(this,m,K).call(this,o)},le=function(e){e.stopPropagation(),this.invalid=e.detail.invalid},K=function(e){var i,t;let o=e.slot;if(o||this.style.setProperty("--from","0"),o==="from"){let v=(i=e.value)!=null?i:e.value=this.min;this.style.setProperty("--from",v)}if(!o||o==="to"){let v=(t=e.value)!=null?t:e.value=this.max;this.style.setProperty("--to",v)}},u.shadowRootOptions={...se.shadowRootOptions,delegatesFocus:!0},u.styles=[R,ae],s([k({reflect:!0})],u.prototype,"label",2),s([k({type:Boolean,reflect:!0})],u.prototype,"disabled",2),s([k({type:Boolean,reflect:!0})],u.prototype,"invalid",2),s([k({type:Boolean,reflect:!0})],u.prototype,"required",2),s([k({reflect:!0})],u.prototype,"min",2),s([k({reflect:!0})],u.prototype,"max",2),s([k({type:Number,reflect:!0})],u.prototype,"markers",2),s([k({type:Number,reflect:!0})],u.prototype,"step",2),s([k({reflect:!0})],u.prototype,"suffix",2),s([k({attribute:!1})],u.prototype,"formatter",2);customElements.get("w-slider")||customElements.define("w-slider",u);import{html as q,LitElement as he,nothing as Q}from"lit";import{property as M,query as be,state as x}from"lit/decorators.js";import{ifDefined as W}from"lit/directives/if-defined.js";import{css as xe}from"lit";var de=xe`
2569
2587
  .w-slider-thumb {
2570
2588
  position: relative;
2571
2589
  display: grid;
@@ -2582,6 +2600,7 @@ var xe=Object.defineProperty;var ke=Object.getOwnPropertyDescriptor;var ae=a=>{t
2582
2600
  background-color: transparent;
2583
2601
  grid-area: slider;
2584
2602
  height: 44px; /* touch target */
2603
+ margin-left: 0;
2585
2604
  pointer-events: none; /* let clicks pass through for range slider where we place two inputs over each other */
2586
2605
  }
2587
2606
 
@@ -2591,14 +2610,6 @@ var xe=Object.defineProperty;var ke=Object.getOwnPropertyDescriptor;var ae=a=>{t
2591
2610
  height: var(--w-slider-track-height);
2592
2611
  }
2593
2612
 
2594
- .w-slider-thumb__range:hover::-webkit-slider-thumb {
2595
- background: var(--w-s-color-background-primary-hover);
2596
- }
2597
-
2598
- .w-slider-thumb__range:hover::-moz-range-thumb {
2599
- background: var(--w-s-color-background-primary-hover);
2600
- }
2601
-
2602
2613
  /*
2603
2614
  Use anchor positioning to place the tooltip target in relation to the slider thumb.
2604
2615
  We use a polyfill to bring support to older Safari, Firefox at time of writing.
@@ -2607,11 +2618,12 @@ var xe=Object.defineProperty;var ke=Object.getOwnPropertyDescriptor;var ae=a=>{t
2607
2618
  anchor-name: --thumb;
2608
2619
 
2609
2620
  appearance: none;
2621
+ cursor: pointer;
2610
2622
  background: var(--w-s-color-background-primary);
2611
2623
  border-radius: 50%;
2612
2624
  height: var(--w-slider-thumb-size);
2613
2625
  margin-top: calc(-1 * calc(var(--w-slider-thumb-offset) - calc(var(--w-slider-track-height) / 2)));
2614
- pointer-events: auto;
2626
+ pointer-events: initial;
2615
2627
  width: var(--w-slider-thumb-size);
2616
2628
  z-index: 1;
2617
2629
  }
@@ -2620,6 +2632,7 @@ var xe=Object.defineProperty;var ke=Object.getOwnPropertyDescriptor;var ae=a=>{t
2620
2632
  anchor-name: --thumb;
2621
2633
 
2622
2634
  appearance: none;
2635
+ cursor: pointer;
2623
2636
  background: var(--w-s-color-background-primary);
2624
2637
  border-radius: 50%;
2625
2638
  border-color: transparent;
@@ -2628,32 +2641,54 @@ var xe=Object.defineProperty;var ke=Object.getOwnPropertyDescriptor;var ae=a=>{t
2628
2641
  pointer-events: initial;
2629
2642
  width: var(--w-slider-thumb-size);
2630
2643
  z-index: 1;
2644
+
2645
+ box-shadow: none;
2631
2646
  }
2632
2647
 
2633
- .w-slider-thumb__tooltip {
2634
- display: none;
2635
- position: absolute;
2648
+ .w-slider-thumb__range:active::-webkit-slider-thumb,
2649
+ .w-slider-thumb__range:hover::-webkit-slider-thumb {
2650
+ background: var(--w-s-color-background-primary-hover);
2651
+ box-shadow: var(--w-shadow-slider-handle-hover);
2652
+ }
2636
2653
 
2637
- background-color: var(--w-s-color-background-inverted);
2638
- color: var(--w-s-color-text-inverted-static);
2639
- border-color: var(--w-s-color-background-inverted);
2654
+ .w-slider-thumb__range:focus,
2655
+ .w-slider-thumb__range:focus-visible {
2656
+ outline: none;
2657
+ }
2640
2658
 
2641
- padding: 4px 8px;
2642
- border-radius: 4px;
2643
- font-size: 12px;
2644
- white-space: nowrap;
2645
- z-index: 1;
2659
+ .w-slider-thumb__range:focus-visible::-webkit-slider-thumb {
2660
+ outline: 2px solid var(--w-s-color-border-focus);
2661
+ outline-offset: var(--w-outline-offset, 1px);
2662
+ box-shadow: none;
2663
+ }
2646
2664
 
2647
- position-anchor: --thumb;
2665
+ .w-slider-thumb__range:active::-moz-range-thumb,
2666
+ .w-slider-thumb__range:hover::-moz-range-thumb {
2667
+ background: var(--w-s-color-background-primary-hover);
2668
+ box-shadow: var(--w-shadow-slider-handle-hover);
2669
+ }
2648
2670
 
2649
- bottom: calc(anchor(top) + 5px);
2650
- justify-self: anchor-center;
2671
+ .w-slider-thumb__range:focus-visible::-moz-range-thumb {
2672
+ outline: 2px solid var(--w-s-color-border-focus);
2673
+ outline-offset: var(--w-outline-offset, 1px);
2674
+ box-shadow: none;
2651
2675
  }
2652
2676
 
2653
- .w-slider-thumb__tooltip--visible {
2677
+ .w-slider-thumb__tooltip-target {
2654
2678
  display: block;
2679
+ pointer-events: none;
2680
+ position: absolute;
2681
+ border: 2px solid transparent;
2682
+ border-radius: 20px;
2683
+ width: 8px;
2684
+ height: 8px;
2685
+ position-anchor: --thumb;
2686
+ position-area: center; /* Position the tooltip target right on the range thumb */
2655
2687
  }
2656
2688
 
2689
+ /* Uncomment this to debug the invisible anchor target */
2690
+ /* .w-slider-thumb__tooltip-target { border-color: lime; } */
2691
+
2657
2692
  .w-slider-thumb__from-marker,
2658
2693
  .w-slider-thumb__to-marker {
2659
2694
  margin-inline: 2px; /* visual alignment with input border, slider thumb */
@@ -2682,8 +2717,21 @@ var xe=Object.defineProperty;var ke=Object.getOwnPropertyDescriptor;var ae=a=>{t
2682
2717
  grid-column: 1 / 2; /* Range sliders should leave the gap empty. */
2683
2718
  }
2684
2719
 
2685
- :host([name='from']) .w-slider-thumb__range::-webkit-slider-thumb {
2686
- margin-left: calc(-1px * var(--thumb-offset) / 2);
2720
+ :host([name='from']) .w-slider-thumb__range {
2721
+ margin-left: var(--w-slider-thumb-size);
2722
+ }
2723
+
2724
+ :host([name='to']) .w-slider-thumb__range {
2725
+ margin-right: var(--w-slider-thumb-size);
2726
+ }
2727
+
2728
+ :host([name='from']) .w-slider-thumb__range::-webkit-slider-thumb,
2729
+ :host([name='from']) .w-slider-thumb__tooltip-target {
2730
+ transform: translateX(calc(-1 * var(--w-slider-thumb-size) - 1px));
2731
+ }
2732
+
2733
+ :host([name='from']) .w-slider-thumb__range::-moz-range-thumb {
2734
+ transform: translateX(calc(-1 * var(--w-slider-thumb-size) - 1px));
2687
2735
  }
2688
2736
 
2689
2737
  :host([name='to']) .w-slider-thumb__textfield {
@@ -2691,84 +2739,93 @@ var xe=Object.defineProperty;var ke=Object.getOwnPropertyDescriptor;var ae=a=>{t
2691
2739
  grid-column: 3 / 4;
2692
2740
  }
2693
2741
 
2742
+ :host([name='to']) .w-slider-thumb__tooltip-target,
2694
2743
  :host([name='to']) .w-slider-thumb__range::-webkit-slider-thumb {
2695
- margin-left: calc(1px * var(--thumb-offset) / 2);
2744
+ transform: translateX(calc(var(--w-slider-thumb-size) - 1px));
2745
+ }
2746
+
2747
+ :host([name='to']) .w-slider-thumb__range::-moz-range-thumb {
2748
+ transform: translateX(calc(var(--w-slider-thumb-size) - 1px));
2696
2749
  }
2697
- `;import{css as Ce}from"lit";var ge=Ce`*,:before,:after{--w-rotate:0;--w-rotate-x:0;--w-rotate-y:0;--w-rotate-z:0;--w-scale-x:1;--w-scale-y:1;--w-scale-z:1;--w-skew-x:0;--w-skew-y:0;--w-translate-x:0;--w-translate-y:0;--w-translate-z:0}.hidden{display:none}.absolute{position:absolute}.relative{position:relative}.static{position:static}.sr-only{clip:rect(0,0,0,0);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}`;var fe={};var f,Z,O,te,d=class extends R(me){constructor(){super(...arguments);j(this,f);this._invalid=!1;this._showTooltip=!1;this.anchorPositioningStyleElement=null}async connectedCallback(){var e;if(super.connectedCallback(),"anchorName"in document.documentElement.style)await this.updateComplete;else{let r=fe.url.substring(0,fe.url.lastIndexOf("/"));try{let[{default:i}]=await Promise.all([import(`${r}/oddbird-css-anchor-positioning.js`),this.updateComplete]);this.anchorPositioningStyleElement||(this.anchorPositioningStyleElement=document.createElement("style"),this.shadowRoot.prepend(this.anchorPositioningStyleElement)),this.anchorPositioningStyleElement.textContent=`
2750
+ `;import{css as ke}from"lit";var ce=ke`*,:before,:after{--w-rotate:0;--w-rotate-x:0;--w-rotate-y:0;--w-rotate-z:0;--w-scale-x:1;--w-scale-y:1;--w-scale-z:1;--w-skew-x:0;--w-skew-y:0;--w-translate-x:0;--w-translate-y:0;--w-translate-z:0}.hidden{display:none}.absolute{position:absolute}.relative{position:relative}.static{position:static}.sr-only{clip:rect(0,0,0,0);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}`;var pe={};var w,Z,D,ee,c=class extends S(he){constructor(){super(...arguments);X(this,w);this._invalid=!1;this._showTooltip=!1;this.anchorPositioningStyleElement=null}async connectedCallback(){var e;if(super.connectedCallback(),"anchorName"in document.documentElement.style)await this.updateComplete;else{let o=pe.url.substring(0,pe.url.lastIndexOf("/"));try{let[{default:i}]=await Promise.all([import(`${o}/oddbird-css-anchor-positioning.js`),this.updateComplete]);this.anchorPositioningStyleElement||(this.anchorPositioningStyleElement=document.createElement("style"),this.shadowRoot.prepend(this.anchorPositioningStyleElement)),this.anchorPositioningStyleElement.textContent=`
2698
2751
  /*
2699
- * The polyfill can only anchor to ::before and ::after pseudo elements.
2752
+ * The polyfill can only anchor to ::before and ::after pseudo elements, not the pseudo element slider thumb.
2700
2753
  * We work around that by recreating a transparent version of the active range
2701
2754
  * so that we can position relative to that, without crossing the shadow root boundary.
2702
2755
  */
2703
- #anchor {
2704
- anchor-name: --polyfilled-thumb;
2705
-
2706
- /* We have to compensate for the width of the thumb inside the track to find its center. */
2707
- --_value: var(--_to-as-percent-of-max);
2708
- --_offset-origin: 50; /* at this point the offset is zero */
2709
- --_thumb-offset-percent: calc(var(--_value) - var(--_offset-origin));
2710
- --_thumb-offset-pixels: calc(var(--w-slider-thumb-size) * calc(var(--_thumb-offset-percent) / 100));
2711
-
2756
+ .polyfill-range {
2712
2757
  align-self: center;
2713
2758
  background: transparent;
2759
+ height: var(--w-slider-track-active-height);
2714
2760
  position: absolute;
2761
+ padding-inline-start: var(--active-range-inline-start-padding, 0);
2762
+ padding-inline-end: var(--active-range-inline-end-padding, 0);
2715
2763
  top: var(--_range-top);
2716
- height: var(--w-slider-track-active-height);
2717
2764
  left: 0;
2718
2765
  right: 0;
2719
2766
  grid-area: slider;
2720
- margin-left: calc(var(--_blank-values-before) * 1%);
2721
- width: calc(calc(var(--_filled-values) * 1%) - var(--_thumb-offset-pixels));
2722
2767
  }
2723
2768
 
2724
- #target {
2725
- position: absolute;
2769
+ .polyfill-active-range {
2770
+ anchor-name: --polyfilled-thumb;
2771
+
2772
+ box-sizing: content-box;
2773
+ background: transparent;
2774
+ height: var(--w-slider-track-active-height);
2775
+
2776
+ border-start-start-radius: var(--active-range-border-radius, 0);
2777
+ border-end-start-radius: var(--active-range-border-radius, 0);
2726
2778
 
2727
- position-anchor: --polyfilled-thumb;
2728
- bottom: calc(anchor(top) + 16px);
2729
- left: anchor(--polyfilled-thumb right);
2779
+ margin-left: calc(calc(var(--_blank-values-before) * 1%) - var(--active-range-inline-start-padding, 0px));
2780
+ width: calc(calc(var(--_filled-values) * 1%) + var(--active-range-inline-end-padding, 0px));
2730
2781
  }
2731
2782
 
2732
- :host([name='from']) #anchor {
2733
- --_value: var(--_from-as-percent-of-max);
2783
+ #target {
2784
+ position: absolute;
2785
+ top: anchor(--polyfilled-thumb top);
2786
+ right: anchor(--polyfilled-thumb right);
2787
+ margin-right: 12px;
2788
+ }
2734
2789
 
2735
- margin-left: calc(calc(var(--_blank-values-before) * 1%) - var(--_thumb-offset-pixels));
2736
- width: calc(calc(var(--_filled-values) * 1%) - var(--w-slider-thumb-size));
2790
+ :host([name='from']) .polyfill-active-range {
2791
+ margin-left: calc(calc(var(--_blank-values-before) * 1%) - var(--active-range-inline-start-padding, 0px));
2792
+ width: calc(calc(var(--_filled-values) * 1%) + var(--active-range-inline-end-padding, 0px));
2737
2793
  }
2738
2794
 
2739
2795
  :host([name='from']) #target {
2740
2796
  left: anchor(--polyfilled-thumb left);
2797
+ margin-left: 38px;
2741
2798
  }
2742
- `,await i({roots:[this.shadowRoot],elements:[this.anchorPositioningStyleElement]})}catch(i){console.error(new Error("Error registering the CSS anchor positioning polyfill. The UI will look broken.",{cause:i}))}}this.range.value=(e=this.value)!=null?e:this.max}updated(e){if(e.has("value")&&(this.setValue(this.value),!("anchorName"in document.documentElement.style))){let r=this.shadowRoot.querySelector("#target"),i=getComputedStyle(r).getPropertyValue("width"),c=Number.parseFloat(i.replace("px",""))/2;r.style.setProperty("margin-left",`-${c}px`)}e.has("_invalid")&&this.dispatchEvent(new CustomEvent("slidervalidity",{bubbles:!0,detail:{invalid:this._invalid}}))}render(){return q`
2799
+ `,await i({roots:[this.shadowRoot],elements:[this.anchorPositioningStyleElement]})}catch(i){console.error(new Error("Error registering the CSS anchor positioning polyfill. The UI will look broken.",{cause:i}))}}this.range.value=(e=this.value)!=null?e:this.max}updated(e){e.has("value")&&this.setValue(this.value),e.has("_invalid")&&this.dispatchEvent(new CustomEvent("slidervalidity",{bubbles:!0,detail:{invalid:this._invalid}}))}render(){return q`
2743
2800
  <div class="w-slider-thumb">
2744
2801
  <label for="range">${this.label}</label>
2745
- ${"anchorName"in document.documentElement.style?ee:q`<div id="anchor"></div>`}
2802
+ ${"anchorName"in document.documentElement.style?Q:q`<div class="polyfill-range"><div class="polyfill-active-range"></div></div>`}
2746
2803
  <input
2747
2804
  id="range"
2748
2805
  aria-label="${this.ariaLabel}"
2749
- aria-describedby="${re(this.ariaDescription?"aria-description":void 0)}"
2806
+ aria-describedby="${W(this.ariaDescription?"aria-description":void 0)}"
2750
2807
  class="w-slider-thumb__range"
2751
2808
  type="range"
2752
2809
  .value="${this.value}"
2753
2810
  min="${this.min}"
2754
2811
  max="${this.max}"
2755
2812
  name="${this.name}"
2756
- step="${re(this.step?this.step:void 0)}"
2813
+ step="${W(this.step?this.step:void 0)}"
2757
2814
  ?disabled="${this.disabled||this.forceDisabled}"
2758
- @mousedown="${h(this,f,Z)}"
2759
- @mouseup="${h(this,f,O)}"
2760
- @touchstart="${h(this,f,Z)}"
2761
- @touchend="${h(this,f,O)}"
2762
- @focus="${h(this,f,Z)}"
2763
- @blur="${h(this,f,O)}"
2764
- @input="${h(this,f,te)}" />
2815
+ @mousedown="${b(this,w,Z)}"
2816
+ @mouseup="${b(this,w,D)}"
2817
+ @touchstart="${b(this,w,Z)}"
2818
+ @touchend="${b(this,w,D)}"
2819
+ @focus="${b(this,w,Z)}"
2820
+ @blur="${b(this,w,D)}"
2821
+ @input="${b(this,w,ee)}" />
2765
2822
 
2766
2823
  <span class="w-slider-thumb__from-marker">${this.formatter?this.formatter(this.min):this.min} ${this.suffix}</span>
2767
2824
  <span class="w-slider-thumb__to-marker">${this.formatter?this.formatter(this.max):this.max} ${this.suffix}</span>
2768
2825
 
2769
2826
  <w-textfield
2770
2827
  aria-label="${this.ariaLabel}"
2771
- aria-description="${re(this.ariaDescription)}"
2828
+ aria-description="${W(this.ariaDescription)}"
2772
2829
  class="w-slider-thumb__textfield"
2773
2830
  type="number"
2774
2831
  min="${this.min}"
@@ -2776,16 +2833,19 @@ var xe=Object.defineProperty;var ke=Object.getOwnPropertyDescriptor;var ae=a=>{t
2776
2833
  .formatter=${this.formatter}
2777
2834
  .value="${this.value}"
2778
2835
  ?invalid="${this.forceInvalid||this._invalid}"
2779
- @input="${h(this,f,te)}">
2780
- ${this.suffix?q`<w-affix slot="suffix" label="${this.suffix}"></w-affix>`:ee}
2836
+ @input="${b(this,w,ee)}">
2837
+ ${this.suffix?q`<w-affix slot="suffix" label="${this.suffix}"></w-affix>`:Q}
2781
2838
  </w-textfield>
2782
2839
 
2783
- <div id="target" class="${Fe({"w-slider-thumb__tooltip":!0,"w-slider-thumb__tooltip--visible":this._showTooltip})}">
2784
- ${this.value?this.formatter?this.formatter(this.value):this.value:0}${this.suffix?q`&nbsp;${this.suffix}`:ee}
2785
- </div>
2840
+ <w-attention tooltip placement="top" flip distance="24" .show="${this._showTooltip}">
2841
+ <output id="target" class="w-slider-thumb__tooltip-target" slot="target"></output>
2842
+ <span slot="message">
2843
+ ${this.value?this.formatter?this.formatter(this.value):this.value:0}${this.suffix?q`&nbsp;${this.suffix}`:Q}
2844
+ </span>
2845
+ </w-attention>
2786
2846
 
2787
2847
  <!-- aria-description is still not recommended for general use, so make a visually hidden element and refer to it with aria-describedby -->
2788
2848
  <span class="sr-only" id="aria-description">${this.ariaDescription}</span>
2789
2849
  </div>
2790
- `}};f=new WeakSet,Z=function(){this._showTooltip=!0},O=function(){this._showTooltip=!1},te=function(e){let r=e.currentTarget.tagName==="W-TEXTFIELD";if(e instanceof CustomEvent)return;let i=e.currentTarget.value;if(i==="")return this.required&&(this._invalid=!0),!1;r&&this._invalid&&(this._invalid=!1);let c=Number.parseInt(i),m=Number.parseInt(this.max),x=Number.parseInt(this.min);(c>m||c<x)&&(this._invalid=!0);let E=!1;if(this.slot){let C=getComputedStyle(this);if(this.slot==="from"){let _=C.getPropertyValue("--to");if(c>Number.parseInt(_)){if(r)return this._invalid=!0,!1;E=!0,this.value=_}}else{let _=C.getPropertyValue("--from");if(c<Number.parseInt(_)){if(r)return this._invalid=!0,!1;E=!0,this.value=_}}}return E?(e.preventDefault(),this.range.value=this.value,!1):(this.value=i,!0)},d.shadowRootOptions={...me.shadowRootOptions,delegatesFocus:!0},d.styles=[X,ge,ue],s([M({attribute:"aria-label",reflect:!0})],d.prototype,"ariaLabel",2),s([M({attribute:"aria-description",reflect:!0})],d.prototype,"ariaDescription",2),s([M({reflect:!0})],d.prototype,"label",2),s([M({reflect:!0})],d.prototype,"name",2),s([M({reflect:!0})],d.prototype,"value",2),s([M({type:Boolean,reflect:!0})],d.prototype,"disabled",2),s([k()],d.prototype,"markers",2),s([k()],d.prototype,"required",2),s([k()],d.prototype,"step",2),s([k()],d.prototype,"min",2),s([k()],d.prototype,"max",2),s([k()],d.prototype,"suffix",2),s([k()],d.prototype,"forceDisabled",2),s([k()],d.prototype,"forceInvalid",2),s([k()],d.prototype,"formatter",2),s([ve('input[type="range"]')],d.prototype,"range",2),s([ve("w-textfield")],d.prototype,"textfield",2),s([k()],d.prototype,"_invalid",2),s([k()],d.prototype,"_showTooltip",2);customElements.get("w-slider-thumb")||customElements.define("w-slider-thumb",d);export{v as WarpSlider,d as WarpSliderThumb};
2850
+ `}};w=new WeakSet,Z=function(){this._showTooltip=!0,this.shadowRoot.querySelector("w-attention").handleDone()},D=function(){this._showTooltip=!1},ee=function(e){let o=e.currentTarget.tagName==="W-TEXTFIELD";if(e instanceof CustomEvent)return;let i=e.currentTarget.value;if(i==="")return this.required&&(this._invalid=!0),!1;this._invalid&&(this._invalid=!1);let t=Number.parseInt(i),v=Number.parseInt(this.max),_=Number.parseInt(this.min);(t>v||t<_)&&(this._invalid=!0);let P=!1;if(this.slot){let z=getComputedStyle(this),F=z.getPropertyValue("--to"),E=z.getPropertyValue("--from");if(o&&(t>Number.parseInt(F)||t<Number.parseInt(E)))return this._invalid=!0,!1;this.slot==="from"?t>Number.parseInt(F)&&(P=!0,this.value=F):t<Number.parseInt(E)&&(P=!0,this.value=E)}return P?(e.preventDefault(),this.range.value=this.value,!1):(this.value=i,this.shadowRoot.querySelector("w-attention").handleDone(),!0)},c.shadowRootOptions={...he.shadowRootOptions,delegatesFocus:!0},c.styles=[R,ce,de],s([M({attribute:"aria-label",reflect:!0})],c.prototype,"ariaLabel",2),s([M({attribute:"aria-description",reflect:!0})],c.prototype,"ariaDescription",2),s([M({reflect:!0})],c.prototype,"label",2),s([M({reflect:!0})],c.prototype,"name",2),s([M({reflect:!0})],c.prototype,"value",2),s([M({type:Boolean,reflect:!0})],c.prototype,"disabled",2),s([x()],c.prototype,"markers",2),s([x()],c.prototype,"required",2),s([x()],c.prototype,"step",2),s([x()],c.prototype,"min",2),s([x()],c.prototype,"max",2),s([x()],c.prototype,"suffix",2),s([x()],c.prototype,"forceDisabled",2),s([x()],c.prototype,"forceInvalid",2),s([x()],c.prototype,"formatter",2),s([be('input[type="range"]')],c.prototype,"range",2),s([be("w-textfield")],c.prototype,"textfield",2),s([x()],c.prototype,"_invalid",2),s([x()],c.prototype,"_showTooltip",2);customElements.get("w-slider-thumb")||customElements.define("w-slider-thumb",c);export{u as WarpSlider,c as WarpSliderThumb};
2791
2851
  //# sourceMappingURL=index.js.map