@warp-ds/elements 2.2.0-next.26 → 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.
- package/dist/custom-elements.json +0 -18
- package/dist/packages/slider/index.js +155 -95
- package/dist/packages/slider/index.js.map +3 -3
- package/dist/packages/slider/slider-thumb.js +108 -66
- package/dist/packages/slider/slider-thumb.js.map +3 -3
- package/dist/packages/slider/slider.js +45 -27
- package/dist/packages/slider/slider.js.map +3 -3
- package/dist/packages/slider/slider.react.stories.js +2 -3
- package/dist/packages/slider/slider.stories.d.ts +1 -0
- package/dist/packages/slider/slider.stories.js +6 -12
- package/dist/packages/slider/styles/w-slider-thumb.styles.js +62 -27
- package/dist/packages/slider/styles/w-slider.styles.js +32 -16
- package/dist/packages/steps/index.js +7 -7
- package/dist/packages/steps/index.js.map +2 -2
- package/dist/packages/textfield/index.js +12 -3
- package/dist/packages/textfield/index.js.map +2 -2
- package/dist/packages/textfield/styles/w-textfield.styles.js +9 -0
- package/dist/web-types.json +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var K=Object.defineProperty;var Q=Object.getOwnPropertyDescriptor;var l=(h,o,i,r)=>{for(var n=r>1?void 0:r?Q(o,i):o,g=h.length-1,w;g>=0;g--)(w=h[g])&&(n=(r?w(o,i,n):w(n))||n);return r&&n&&K(o,i,n),n};var Y=function(){for(var h=[],o=arguments.length;o--;)h[o]=arguments[o];return h.reduce(function(i,r){return i.concat(typeof r=="string"?r:Array.isArray(r)?Y.apply(void 0,r):typeof r=="object"&&r?Object.keys(r).map(function(n){return r[n]?n:""}):"")},[]).join(" ")};var a=function(h,o,i,r){if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof o=="function"?h!==o||!r:!o.has(h))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?r:i==="a"?r.call(h):r?r.value:o.get(h)},b=function(h,o,i,r,n){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof o=="function"?h!==o||!n:!o.has(h))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?n.call(h,i):n?n.value=i:o.set(h,i),i};function R(h){var o,i,r,n,g,w,k,T,_,P,F,A,V,z,E,f,L,X,O;class J extends h{constructor(...e){var t,c,p;super(...e),o.add(this),this.internals=this.attachInternals(),i.set(this,!1),r.set(this,!1),n.set(this,!1),g.set(this,void 0),w.set(this,void 0),k.set(this,!0),_.set(this,""),P.set(this,()=>{b(this,n,!0,"f"),b(this,i,!0,"f"),a(this,o,"m",f).call(this)}),F.set(this,()=>{b(this,i,!1,"f"),a(this,o,"m",L).call(this,this.shouldFormValueUpdate()?a(this,_,"f"):""),!this.validity.valid&&a(this,n,"f")&&b(this,r,!0,"f");let m=a(this,o,"m",f).call(this);this.validationMessageCallback&&this.validationMessageCallback(m?this.internals.validationMessage:"")}),A.set(this,()=>{var m;a(this,k,"f")&&this.validationTarget&&(this.internals.setValidity(this.validity,this.validationMessage,this.validationTarget),b(this,k,!1,"f")),b(this,n,!0,"f"),b(this,r,!0,"f"),a(this,o,"m",f).call(this),(m=this===null||this===void 0?void 0:this.validationMessageCallback)===null||m===void 0||m.call(this,this.showError?this.internals.validationMessage:"")}),V.set(this,void 0),z.set(this,!1),E.set(this,Promise.resolve()),(t=this.addEventListener)===null||t===void 0||t.call(this,"focus",a(this,P,"f")),(c=this.addEventListener)===null||c===void 0||c.call(this,"blur",a(this,F,"f")),(p=this.addEventListener)===null||p===void 0||p.call(this,"invalid",a(this,A,"f")),this.setValue(null)}static get formAssociated(){return!0}static get validators(){return this.formControlValidators||[]}static get observedAttributes(){let e=this.validators.map(p=>p.attribute).flat(),t=super.observedAttributes||[];return[...new Set([...t,...e])]}static getValidator(e){return this.validators.find(t=>t.attribute===e)||null}static getValidators(e){return this.validators.filter(t=>{var c;if(t.attribute===e||!((c=t.attribute)===null||c===void 0)&&c.includes(e))return!0})}get form(){return this.internals.form}get showError(){return a(this,o,"m",f).call(this)}checkValidity(){return this.internals.checkValidity()}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}attributeChangedCallback(e,t,c){var p;(p=super.attributeChangedCallback)===null||p===void 0||p.call(this,e,t,c);let $=this.constructor.getValidators(e);$!=null&&$.length&&this.validationTarget&&this.setValue(a(this,_,"f"))}setValue(e){var t;b(this,r,!1,"f"),(t=this.validationMessageCallback)===null||t===void 0||t.call(this,""),b(this,_,e,"f");let p=this.shouldFormValueUpdate()?e:null;this.internals.setFormValue(p),a(this,o,"m",L).call(this,p),this.valueChangedCallback&&this.valueChangedCallback(p),a(this,o,"m",f).call(this)}shouldFormValueUpdate(){return!0}get validationComplete(){return new Promise(e=>e(a(this,E,"f")))}formResetCallback(){var e,t;b(this,n,!1,"f"),b(this,r,!1,"f"),a(this,o,"m",f).call(this),(e=this.resetFormControl)===null||e===void 0||e.call(this),(t=this.validationMessageCallback)===null||t===void 0||t.call(this,a(this,o,"m",f).call(this)?this.validationMessage:"")}}return i=new WeakMap,r=new WeakMap,n=new WeakMap,g=new WeakMap,w=new WeakMap,k=new WeakMap,_=new WeakMap,P=new WeakMap,F=new WeakMap,A=new WeakMap,V=new WeakMap,z=new WeakMap,E=new WeakMap,o=new WeakSet,T=function(){let e=this.getRootNode(),t=`${this.localName}[name="${this.getAttribute("name")}"]`;return e.querySelectorAll(t)},f=function(){if(this.hasAttribute("disabled"))return!1;let e=a(this,r,"f")||a(this,n,"f")&&!this.validity.valid&&!a(this,i,"f");return e&&this.internals.states?this.internals.states.add("--show-error"):this.internals.states&&this.internals.states.delete("--show-error"),e},L=function(e){let t=this.constructor,c={},p=t.validators,m=[],$=p.some(v=>v.isValid instanceof Promise);a(this,z,"f")||(b(this,E,new Promise(v=>{b(this,V,v,"f")}),"f"),b(this,z,!0,"f")),a(this,g,"f")&&(a(this,g,"f").abort(),b(this,w,a(this,g,"f"),"f"));let M=new AbortController;b(this,g,M,"f");let S,q=!1;p.length&&(p.forEach(v=>{let Z=v.key||"customError",y=v.isValid(this,e,M.signal);y instanceof Promise?(m.push(y),y.then(I=>{I!=null&&(c[Z]=!I,S=a(this,o,"m",O).call(this,v,e),a(this,o,"m",X).call(this,c,S))})):(c[Z]=!y,this.validity[Z]!==!y&&(q=!0),!y&&!S&&(S=a(this,o,"m",O).call(this,v,e)))}),Promise.allSettled(m).then(()=>{var v;M!=null&&M.signal.aborted||(b(this,z,!1,"f"),(v=a(this,V,"f"))===null||v===void 0||v.call(this))}),(q||!$)&&a(this,o,"m",X).call(this,c,S))},X=function(e,t){if(this.validationTarget)this.internals.setValidity(e,t,this.validationTarget),b(this,k,!1,"f");else{if(this.internals.setValidity(e,t),this.internals.validity.valid)return;b(this,k,!0,"f")}},O=function(e,t){if(this.validityCallback){let c=this.validityCallback(e.key||"customError");if(c)return c}return e.message instanceof Function?e.message(this,t):e.message},J}import{html as j,LitElement as G,nothing as re}from"lit";import{property as d,query as oe}from"lit/decorators.js";import{classMap as te}from"lit/directives/class-map.js";import{ifDefined as u}from"lit/directives/if-defined.js";import{css as B}from"lit";var
|
|
1
|
+
var K=Object.defineProperty;var Q=Object.getOwnPropertyDescriptor;var l=(h,o,i,r)=>{for(var n=r>1?void 0:r?Q(o,i):o,g=h.length-1,w;g>=0;g--)(w=h[g])&&(n=(r?w(o,i,n):w(n))||n);return r&&n&&K(o,i,n),n};var Y=function(){for(var h=[],o=arguments.length;o--;)h[o]=arguments[o];return h.reduce(function(i,r){return i.concat(typeof r=="string"?r:Array.isArray(r)?Y.apply(void 0,r):typeof r=="object"&&r?Object.keys(r).map(function(n){return r[n]?n:""}):"")},[]).join(" ")};var a=function(h,o,i,r){if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof o=="function"?h!==o||!r:!o.has(h))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?r:i==="a"?r.call(h):r?r.value:o.get(h)},b=function(h,o,i,r,n){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof o=="function"?h!==o||!n:!o.has(h))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?n.call(h,i):n?n.value=i:o.set(h,i),i};function R(h){var o,i,r,n,g,w,k,T,_,P,F,A,V,z,E,f,L,X,O;class J extends h{constructor(...e){var t,c,p;super(...e),o.add(this),this.internals=this.attachInternals(),i.set(this,!1),r.set(this,!1),n.set(this,!1),g.set(this,void 0),w.set(this,void 0),k.set(this,!0),_.set(this,""),P.set(this,()=>{b(this,n,!0,"f"),b(this,i,!0,"f"),a(this,o,"m",f).call(this)}),F.set(this,()=>{b(this,i,!1,"f"),a(this,o,"m",L).call(this,this.shouldFormValueUpdate()?a(this,_,"f"):""),!this.validity.valid&&a(this,n,"f")&&b(this,r,!0,"f");let m=a(this,o,"m",f).call(this);this.validationMessageCallback&&this.validationMessageCallback(m?this.internals.validationMessage:"")}),A.set(this,()=>{var m;a(this,k,"f")&&this.validationTarget&&(this.internals.setValidity(this.validity,this.validationMessage,this.validationTarget),b(this,k,!1,"f")),b(this,n,!0,"f"),b(this,r,!0,"f"),a(this,o,"m",f).call(this),(m=this===null||this===void 0?void 0:this.validationMessageCallback)===null||m===void 0||m.call(this,this.showError?this.internals.validationMessage:"")}),V.set(this,void 0),z.set(this,!1),E.set(this,Promise.resolve()),(t=this.addEventListener)===null||t===void 0||t.call(this,"focus",a(this,P,"f")),(c=this.addEventListener)===null||c===void 0||c.call(this,"blur",a(this,F,"f")),(p=this.addEventListener)===null||p===void 0||p.call(this,"invalid",a(this,A,"f")),this.setValue(null)}static get formAssociated(){return!0}static get validators(){return this.formControlValidators||[]}static get observedAttributes(){let e=this.validators.map(p=>p.attribute).flat(),t=super.observedAttributes||[];return[...new Set([...t,...e])]}static getValidator(e){return this.validators.find(t=>t.attribute===e)||null}static getValidators(e){return this.validators.filter(t=>{var c;if(t.attribute===e||!((c=t.attribute)===null||c===void 0)&&c.includes(e))return!0})}get form(){return this.internals.form}get showError(){return a(this,o,"m",f).call(this)}checkValidity(){return this.internals.checkValidity()}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}attributeChangedCallback(e,t,c){var p;(p=super.attributeChangedCallback)===null||p===void 0||p.call(this,e,t,c);let $=this.constructor.getValidators(e);$!=null&&$.length&&this.validationTarget&&this.setValue(a(this,_,"f"))}setValue(e){var t;b(this,r,!1,"f"),(t=this.validationMessageCallback)===null||t===void 0||t.call(this,""),b(this,_,e,"f");let p=this.shouldFormValueUpdate()?e:null;this.internals.setFormValue(p),a(this,o,"m",L).call(this,p),this.valueChangedCallback&&this.valueChangedCallback(p),a(this,o,"m",f).call(this)}shouldFormValueUpdate(){return!0}get validationComplete(){return new Promise(e=>e(a(this,E,"f")))}formResetCallback(){var e,t;b(this,n,!1,"f"),b(this,r,!1,"f"),a(this,o,"m",f).call(this),(e=this.resetFormControl)===null||e===void 0||e.call(this),(t=this.validationMessageCallback)===null||t===void 0||t.call(this,a(this,o,"m",f).call(this)?this.validationMessage:"")}}return i=new WeakMap,r=new WeakMap,n=new WeakMap,g=new WeakMap,w=new WeakMap,k=new WeakMap,_=new WeakMap,P=new WeakMap,F=new WeakMap,A=new WeakMap,V=new WeakMap,z=new WeakMap,E=new WeakMap,o=new WeakSet,T=function(){let e=this.getRootNode(),t=`${this.localName}[name="${this.getAttribute("name")}"]`;return e.querySelectorAll(t)},f=function(){if(this.hasAttribute("disabled"))return!1;let e=a(this,r,"f")||a(this,n,"f")&&!this.validity.valid&&!a(this,i,"f");return e&&this.internals.states?this.internals.states.add("--show-error"):this.internals.states&&this.internals.states.delete("--show-error"),e},L=function(e){let t=this.constructor,c={},p=t.validators,m=[],$=p.some(v=>v.isValid instanceof Promise);a(this,z,"f")||(b(this,E,new Promise(v=>{b(this,V,v,"f")}),"f"),b(this,z,!0,"f")),a(this,g,"f")&&(a(this,g,"f").abort(),b(this,w,a(this,g,"f"),"f"));let M=new AbortController;b(this,g,M,"f");let S,q=!1;p.length&&(p.forEach(v=>{let Z=v.key||"customError",y=v.isValid(this,e,M.signal);y instanceof Promise?(m.push(y),y.then(I=>{I!=null&&(c[Z]=!I,S=a(this,o,"m",O).call(this,v,e),a(this,o,"m",X).call(this,c,S))})):(c[Z]=!y,this.validity[Z]!==!y&&(q=!0),!y&&!S&&(S=a(this,o,"m",O).call(this,v,e)))}),Promise.allSettled(m).then(()=>{var v;M!=null&&M.signal.aborted||(b(this,z,!1,"f"),(v=a(this,V,"f"))===null||v===void 0||v.call(this))}),(q||!$)&&a(this,o,"m",X).call(this,c,S))},X=function(e,t){if(this.validationTarget)this.internals.setValidity(e,t,this.validationTarget),b(this,k,!1,"f");else{if(this.internals.setValidity(e,t),this.internals.validity.valid)return;b(this,k,!0,"f")}},O=function(e,t){if(this.validityCallback){let c=this.validityCallback(e.key||"customError");if(c)return c}return e.message instanceof Function?e.message(this,t):e.message},J}import{html as j,LitElement as G,nothing as re}from"lit";import{property as d,query as oe}from"lit/decorators.js";import{classMap as te}from"lit/directives/class-map.js";import{ifDefined as u}from"lit/directives/if-defined.js";import{css as B}from"lit";var H=B`
|
|
2
2
|
*,
|
|
3
3
|
:before,
|
|
4
4
|
:after {
|
|
@@ -2437,7 +2437,7 @@ var K=Object.defineProperty;var Q=Object.getOwnPropertyDescriptor;var l=(h,o,i,r
|
|
|
2437
2437
|
display: none
|
|
2438
2438
|
}
|
|
2439
2439
|
}
|
|
2440
|
-
`;import{css as W}from"lit";var
|
|
2440
|
+
`;import{css as W}from"lit";var U=W`
|
|
2441
2441
|
.w-textfield {
|
|
2442
2442
|
--_input-padding-top: 12px;
|
|
2443
2443
|
--_input-padding-left: 8px;
|
|
@@ -2462,6 +2462,15 @@ var K=Object.defineProperty;var Q=Object.getOwnPropertyDescriptor;var l=(h,o,i,r
|
|
|
2462
2462
|
display: none;
|
|
2463
2463
|
}
|
|
2464
2464
|
|
|
2465
|
+
/* Hide the native browser controls */
|
|
2466
|
+
input[type="number"] {
|
|
2467
|
+
-moz-appearance:textfield;
|
|
2468
|
+
}
|
|
2469
|
+
|
|
2470
|
+
input[type="number"]::-webkit-inner-spin-button {
|
|
2471
|
+
display: none;
|
|
2472
|
+
}
|
|
2473
|
+
|
|
2465
2474
|
/* Could also consider giving the input mask a background color instead of this */
|
|
2466
2475
|
.w-textfield__input-wrapper:has(.w-textfield__mask):not(:focus-within) input {
|
|
2467
2476
|
color: transparent;
|
|
@@ -2515,5 +2524,5 @@ var K=Object.defineProperty;var Q=Object.getOwnPropertyDescriptor;var l=(h,o,i,r
|
|
|
2515
2524
|
</div>
|
|
2516
2525
|
<span class="sr-only" id="aria-description">${this.ariaDescription}</span>
|
|
2517
2526
|
${this.helpText&&j`<div class="${this._helptextstyles}" id="${this._helpId}">${this.helpText}</div>`}
|
|
2518
|
-
`}};s.shadowRootOptions={...G.shadowRootOptions,delegatesFocus:!0},s.styles=[
|
|
2527
|
+
`}};s.shadowRootOptions={...G.shadowRootOptions,delegatesFocus:!0},s.styles=[H,D,U],l([d({type:Boolean,reflect:!0})],s.prototype,"disabled",2),l([d({type:Boolean,reflect:!0})],s.prototype,"invalid",2),l([d({type:String,reflect:!0})],s.prototype,"id",2),l([d({type:String,reflect:!0})],s.prototype,"label",2),l([d({type:String,reflect:!0,attribute:"help-text"})],s.prototype,"helpText",2),l([d({type:String,reflect:!0})],s.prototype,"size",2),l([d({type:Number,reflect:!0})],s.prototype,"max",2),l([d({type:Number,reflect:!0})],s.prototype,"min",2),l([d({type:Number,reflect:!0,attribute:"min-length"})],s.prototype,"minLength",2),l([d({type:Number,reflect:!0,attribute:"max-length"})],s.prototype,"maxLength",2),l([d({type:String,reflect:!0})],s.prototype,"pattern",2),l([d({type:String,reflect:!0})],s.prototype,"placeholder",2),l([d({type:Boolean,reflect:!0,attribute:"read-only"})],s.prototype,"readOnly",2),l([d({type:Boolean,reflect:!0})],s.prototype,"required",2),l([d({type:String,reflect:!0})],s.prototype,"type",2),l([d({type:String,reflect:!0})],s.prototype,"value",2),l([d({type:String,reflect:!0})],s.prototype,"name",2),l([d({attribute:!1})],s.prototype,"formatter",2),l([oe(".w-textfield__mask")],s.prototype,"mask",2),l([d({type:Boolean})],s.prototype,"_hasPrefix",2),l([d({type:Boolean})],s.prototype,"_hasSuffix",2);customElements.get("w-textfield")||customElements.define("w-textfield",s);export{s as WarpTextField,N as ccHelpText,ae as ccLabel,x as ccinput};
|
|
2519
2528
|
//# sourceMappingURL=index.js.map
|