@warp-ds/elements 2.2.0-next.16 → 2.2.0-next.18

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 ie=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var G=s=>{throw TypeError(s)};var d=(s,e,o,t)=>{for(var a=t>1?void 0:t?ne(e,o):e,b=s.length-1,m;b>=0;b--)(m=s[b])&&(a=(t?m(e,o,a):m(a))||a);return t&&a&&ie(e,o,a),a};var se=(s,e,o)=>e.has(s)||G("Cannot "+o);var B=(s,e,o)=>e.has(s)?G("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(s):e.set(s,o);var x=(s,e,o)=>(se(s,e,"access private method"),o);import{html as I,LitElement as re,nothing as U}from"lit";var n=function(s,e,o,t){if(o==="a"&&!t)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?s!==e||!t:!e.has(s))throw new TypeError("Cannot read private member from an object whose class did not declare it");return o==="m"?t:o==="a"?t.call(s):t?t.value:e.get(s)},h=function(s,e,o,t,a){if(t==="m")throw new TypeError("Private method is not writable");if(t==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?s!==e||!a:!e.has(s))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t==="a"?a.call(s,o):a?a.value=o:e.set(s,o),o};function W(s){var e,o,t,a,b,m,k,F,y,w,X,T,Y,E,j,_,A,S,Z;class ae extends s{constructor(...r){var i,c,p;super(...r),e.add(this),this.internals=this.attachInternals(),o.set(this,!1),t.set(this,!1),a.set(this,!1),b.set(this,void 0),m.set(this,void 0),k.set(this,!0),y.set(this,""),w.set(this,()=>{h(this,a,!0,"f"),h(this,o,!0,"f"),n(this,e,"m",_).call(this)}),X.set(this,()=>{h(this,o,!1,"f"),n(this,e,"m",A).call(this,this.shouldFormValueUpdate()?n(this,y,"f"):""),!this.validity.valid&&n(this,a,"f")&&h(this,t,!0,"f");let f=n(this,e,"m",_).call(this);this.validationMessageCallback&&this.validationMessageCallback(f?this.internals.validationMessage:"")}),T.set(this,()=>{var f;n(this,k,"f")&&this.validationTarget&&(this.internals.setValidity(this.validity,this.validationMessage,this.validationTarget),h(this,k,!1,"f")),h(this,a,!0,"f"),h(this,t,!0,"f"),n(this,e,"m",_).call(this),(f=this===null||this===void 0?void 0:this.validationMessageCallback)===null||f===void 0||f.call(this,this.showError?this.internals.validationMessage:"")}),Y.set(this,void 0),E.set(this,!1),j.set(this,Promise.resolve()),(i=this.addEventListener)===null||i===void 0||i.call(this,"focus",n(this,w,"f")),(c=this.addEventListener)===null||c===void 0||c.call(this,"blur",n(this,X,"f")),(p=this.addEventListener)===null||p===void 0||p.call(this,"invalid",n(this,T,"f")),this.setValue(null)}static get formAssociated(){return!0}static get validators(){return this.formControlValidators||[]}static get observedAttributes(){let r=this.validators.map(p=>p.attribute).flat(),i=super.observedAttributes||[];return[...new Set([...i,...r])]}static getValidator(r){return this.validators.find(i=>i.attribute===r)||null}static getValidators(r){return this.validators.filter(i=>{var c;if(i.attribute===r||!((c=i.attribute)===null||c===void 0)&&c.includes(r))return!0})}get form(){return this.internals.form}get showError(){return n(this,e,"m",_).call(this)}checkValidity(){return this.internals.checkValidity()}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}attributeChangedCallback(r,i,c){var p;(p=super.attributeChangedCallback)===null||p===void 0||p.call(this,r,i,c);let V=this.constructor.getValidators(r);V!=null&&V.length&&this.validationTarget&&this.setValue(n(this,y,"f"))}setValue(r){var i;h(this,t,!1,"f"),(i=this.validationMessageCallback)===null||i===void 0||i.call(this,""),h(this,y,r,"f");let p=this.shouldFormValueUpdate()?r:null;this.internals.setFormValue(p),n(this,e,"m",A).call(this,p),this.valueChangedCallback&&this.valueChangedCallback(p),n(this,e,"m",_).call(this)}shouldFormValueUpdate(){return!0}get validationComplete(){return new Promise(r=>r(n(this,j,"f")))}formResetCallback(){var r,i;h(this,a,!1,"f"),h(this,t,!1,"f"),n(this,e,"m",_).call(this),(r=this.resetFormControl)===null||r===void 0||r.call(this),(i=this.validationMessageCallback)===null||i===void 0||i.call(this,n(this,e,"m",_).call(this)?this.validationMessage:"")}}return o=new WeakMap,t=new WeakMap,a=new WeakMap,b=new WeakMap,m=new WeakMap,k=new WeakMap,y=new WeakMap,w=new WeakMap,X=new WeakMap,T=new WeakMap,Y=new WeakMap,E=new WeakMap,j=new WeakMap,e=new WeakSet,F=function(){let r=this.getRootNode(),i=`${this.localName}[name="${this.getAttribute("name")}"]`;return r.querySelectorAll(i)},_=function(){if(this.hasAttribute("disabled"))return!1;let r=n(this,t,"f")||n(this,a,"f")&&!this.validity.valid&&!n(this,o,"f");return r&&this.internals.states?this.internals.states.add("--show-error"):this.internals.states&&this.internals.states.delete("--show-error"),r},A=function(r){let i=this.constructor,c={},p=i.validators,f=[],V=p.some(g=>g.isValid instanceof Promise);n(this,E,"f")||(h(this,j,new Promise(g=>{h(this,Y,g,"f")}),"f"),h(this,E,!0,"f")),n(this,b,"f")&&(n(this,b,"f").abort(),h(this,m,n(this,b,"f"),"f"));let M=new AbortController;h(this,b,M,"f");let P,H=!1;p.length&&(p.forEach(g=>{let D=g.key||"customError",z=g.isValid(this,r,M.signal);z instanceof Promise?(f.push(z),z.then(R=>{R!=null&&(c[D]=!R,P=n(this,e,"m",Z).call(this,g,r),n(this,e,"m",S).call(this,c,P))})):(c[D]=!z,this.validity[D]!==!z&&(H=!0),!z&&!P&&(P=n(this,e,"m",Z).call(this,g,r)))}),Promise.allSettled(f).then(()=>{var g;M!=null&&M.signal.aborted||(h(this,E,!1,"f"),(g=n(this,Y,"f"))===null||g===void 0||g.call(this))}),(H||!V)&&n(this,e,"m",S).call(this,c,P))},S=function(r,i){if(this.validationTarget)this.internals.setValidity(r,i,this.validationTarget),h(this,k,!1,"f");else{if(this.internals.setValidity(r,i),this.internals.validity.valid)return;h(this,k,!0,"f")}},Z=function(r,i){if(this.validityCallback){let c=this.validityCallback(r.key||"customError");if(c)return c}return r.message instanceof Function?r.message(this,i):r.message},ae}import{property as C,query as oe,state as v}from"lit/decorators.js";import{classMap as ce}from"lit/directives/class-map.js";import{ifDefined as q}from"lit/directives/if-defined.js";import{css as J}from"lit";var K=J`
1
+ var ie=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var G=s=>{throw TypeError(s)};var d=(s,e,o,t)=>{for(var a=t>1?void 0:t?ne(e,o):e,b=s.length-1,m;b>=0;b--)(m=s[b])&&(a=(t?m(e,o,a):m(a))||a);return t&&a&&ie(e,o,a),a};var se=(s,e,o)=>e.has(s)||G("Cannot "+o);var B=(s,e,o)=>e.has(s)?G("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(s):e.set(s,o);var x=(s,e,o)=>(se(s,e,"access private method"),o);import{html as I,LitElement as re,nothing as U}from"lit";var n=function(s,e,o,t){if(o==="a"&&!t)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?s!==e||!t:!e.has(s))throw new TypeError("Cannot read private member from an object whose class did not declare it");return o==="m"?t:o==="a"?t.call(s):t?t.value:e.get(s)},h=function(s,e,o,t,a){if(t==="m")throw new TypeError("Private method is not writable");if(t==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?s!==e||!a:!e.has(s))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t==="a"?a.call(s,o):a?a.value=o:e.set(s,o),o};function W(s){var e,o,t,a,b,m,k,F,y,w,X,T,Y,E,j,_,A,S,Z;class ae extends s{constructor(...r){var i,c,p;super(...r),e.add(this),this.internals=this.attachInternals(),o.set(this,!1),t.set(this,!1),a.set(this,!1),b.set(this,void 0),m.set(this,void 0),k.set(this,!0),y.set(this,""),w.set(this,()=>{h(this,a,!0,"f"),h(this,o,!0,"f"),n(this,e,"m",_).call(this)}),X.set(this,()=>{h(this,o,!1,"f"),n(this,e,"m",A).call(this,this.shouldFormValueUpdate()?n(this,y,"f"):""),!this.validity.valid&&n(this,a,"f")&&h(this,t,!0,"f");let f=n(this,e,"m",_).call(this);this.validationMessageCallback&&this.validationMessageCallback(f?this.internals.validationMessage:"")}),T.set(this,()=>{var f;n(this,k,"f")&&this.validationTarget&&(this.internals.setValidity(this.validity,this.validationMessage,this.validationTarget),h(this,k,!1,"f")),h(this,a,!0,"f"),h(this,t,!0,"f"),n(this,e,"m",_).call(this),(f=this===null||this===void 0?void 0:this.validationMessageCallback)===null||f===void 0||f.call(this,this.showError?this.internals.validationMessage:"")}),Y.set(this,void 0),E.set(this,!1),j.set(this,Promise.resolve()),(i=this.addEventListener)===null||i===void 0||i.call(this,"focus",n(this,w,"f")),(c=this.addEventListener)===null||c===void 0||c.call(this,"blur",n(this,X,"f")),(p=this.addEventListener)===null||p===void 0||p.call(this,"invalid",n(this,T,"f")),this.setValue(null)}static get formAssociated(){return!0}static get validators(){return this.formControlValidators||[]}static get observedAttributes(){let r=this.validators.map(p=>p.attribute).flat(),i=super.observedAttributes||[];return[...new Set([...i,...r])]}static getValidator(r){return this.validators.find(i=>i.attribute===r)||null}static getValidators(r){return this.validators.filter(i=>{var c;if(i.attribute===r||!((c=i.attribute)===null||c===void 0)&&c.includes(r))return!0})}get form(){return this.internals.form}get showError(){return n(this,e,"m",_).call(this)}checkValidity(){return this.internals.checkValidity()}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}attributeChangedCallback(r,i,c){var p;(p=super.attributeChangedCallback)===null||p===void 0||p.call(this,r,i,c);let V=this.constructor.getValidators(r);V!=null&&V.length&&this.validationTarget&&this.setValue(n(this,y,"f"))}setValue(r){var i;h(this,t,!1,"f"),(i=this.validationMessageCallback)===null||i===void 0||i.call(this,""),h(this,y,r,"f");let p=this.shouldFormValueUpdate()?r:null;this.internals.setFormValue(p),n(this,e,"m",A).call(this,p),this.valueChangedCallback&&this.valueChangedCallback(p),n(this,e,"m",_).call(this)}shouldFormValueUpdate(){return!0}get validationComplete(){return new Promise(r=>r(n(this,j,"f")))}formResetCallback(){var r,i;h(this,a,!1,"f"),h(this,t,!1,"f"),n(this,e,"m",_).call(this),(r=this.resetFormControl)===null||r===void 0||r.call(this),(i=this.validationMessageCallback)===null||i===void 0||i.call(this,n(this,e,"m",_).call(this)?this.validationMessage:"")}}return o=new WeakMap,t=new WeakMap,a=new WeakMap,b=new WeakMap,m=new WeakMap,k=new WeakMap,y=new WeakMap,w=new WeakMap,X=new WeakMap,T=new WeakMap,Y=new WeakMap,E=new WeakMap,j=new WeakMap,e=new WeakSet,F=function(){let r=this.getRootNode(),i=`${this.localName}[name="${this.getAttribute("name")}"]`;return r.querySelectorAll(i)},_=function(){if(this.hasAttribute("disabled"))return!1;let r=n(this,t,"f")||n(this,a,"f")&&!this.validity.valid&&!n(this,o,"f");return r&&this.internals.states?this.internals.states.add("--show-error"):this.internals.states&&this.internals.states.delete("--show-error"),r},A=function(r){let i=this.constructor,c={},p=i.validators,f=[],V=p.some(g=>g.isValid instanceof Promise);n(this,E,"f")||(h(this,j,new Promise(g=>{h(this,Y,g,"f")}),"f"),h(this,E,!0,"f")),n(this,b,"f")&&(n(this,b,"f").abort(),h(this,m,n(this,b,"f"),"f"));let M=new AbortController;h(this,b,M,"f");let P,H=!1;p.length&&(p.forEach(g=>{let R=g.key||"customError",z=g.isValid(this,r,M.signal);z instanceof Promise?(f.push(z),z.then(D=>{D!=null&&(c[R]=!D,P=n(this,e,"m",Z).call(this,g,r),n(this,e,"m",S).call(this,c,P))})):(c[R]=!z,this.validity[R]!==!z&&(H=!0),!z&&!P&&(P=n(this,e,"m",Z).call(this,g,r)))}),Promise.allSettled(f).then(()=>{var g;M!=null&&M.signal.aborted||(h(this,E,!1,"f"),(g=n(this,Y,"f"))===null||g===void 0||g.call(this))}),(H||!V)&&n(this,e,"m",S).call(this,c,P))},S=function(r,i){if(this.validationTarget)this.internals.setValidity(r,i,this.validationTarget),h(this,k,!1,"f");else{if(this.internals.setValidity(r,i),this.internals.validity.valid)return;h(this,k,!0,"f")}},Z=function(r,i){if(this.validityCallback){let c=this.validityCallback(r.key||"customError");if(c)return c}return r.message instanceof Function?r.message(this,i):r.message},ae}import{property as C,query as oe,state as v}from"lit/decorators.js";import{classMap as ce}from"lit/directives/class-map.js";import{ifDefined as q}from"lit/directives/if-defined.js";import{css as J}from"lit";var K=J`
2
2
  *,
3
3
  :before,
4
4
  :after {
@@ -2611,7 +2611,7 @@ var ie=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var G=s=>{th
2611
2611
  :host([name='from']) #target {
2612
2612
  left: anchor(--polyfilled-thumb left);
2613
2613
  }
2614
- `,await a.call(this,{elements:[this.anchorPositioningStyleElement]})}catch(a){console.error(new Error("Error registering the CSS anchor positioning polyfill. The UI will look broken.",{cause:a}))}}this.range.value=(o=this.value)!=null?o:this.max}updated(o){if(o.has("value")&&(this.setValue(this.value),!("anchorName"in document.documentElement.style))){let t=this.shadowRoot.querySelector("#target"),a=getComputedStyle(t).getPropertyValue("width"),b=Number.parseFloat(a.replace("px",""))/2;t.style.setProperty("margin-left",`-${b}px`)}o.has("_invalid")&&this.dispatchEvent(new CustomEvent("slidervalidity",{bubbles:!0,detail:{invalid:this._invalid}}))}render(){return I`
2614
+ `,await a({roots:[this.shadowRoot],elements:[this.anchorPositioningStyleElement]})}catch(a){console.error(new Error("Error registering the CSS anchor positioning polyfill. The UI will look broken.",{cause:a}))}}this.range.value=(o=this.value)!=null?o:this.max}updated(o){if(o.has("value")&&(this.setValue(this.value),!("anchorName"in document.documentElement.style))){let t=this.shadowRoot.querySelector("#target"),a=getComputedStyle(t).getPropertyValue("width"),b=Number.parseFloat(a.replace("px",""))/2;t.style.setProperty("margin-left",`-${b}px`)}o.has("_invalid")&&this.dispatchEvent(new CustomEvent("slidervalidity",{bubbles:!0,detail:{invalid:this._invalid}}))}render(){return I`
2615
2615
  <div class="w-slider-thumb">
2616
2616
  <label for="range">${this.label}</label>
2617
2617
  ${"anchorName"in document.documentElement.style?U:I`<div id="anchor"></div>`}