@warp-ds/elements 2.3.0-next.25 → 2.3.0-next.27
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 +93 -14
- package/dist/index.d.ts +222 -0
- package/dist/packages/checkbox/checkbox-group.js +2 -2
- package/dist/packages/checkbox/checkbox-group.js.map +2 -2
- package/dist/packages/checkbox/checkbox.js +1 -1
- package/dist/packages/checkbox/checkbox.js.map +2 -2
- package/dist/packages/checkbox/index.d.ts +2 -1
- package/dist/packages/checkbox/index.js +2 -6
- package/dist/packages/radio/index.d.ts +2 -1
- package/dist/packages/radio/index.js +2 -6
- package/dist/packages/radio/radio-group.js +5 -5
- package/dist/packages/radio/radio-group.js.map +2 -2
- package/dist/packages/radio/radio.js +1 -1
- package/dist/packages/radio/radio.js.map +2 -2
- package/dist/packages/radio/radio.stories.js +3 -3
- package/dist/packages/radio/radio.stories.js.map +4 -4
- package/dist/packages/slider/slider-thumb.js +19 -19
- package/dist/packages/slider/slider-thumb.js.map +3 -3
- package/dist/packages/slider/slider.stories.js +9 -9
- package/dist/web-types.json +334 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var Ue=Object.create;var ae=Object.defineProperty;var me=Object.getOwnPropertyDescriptor;var Xe=Object.getOwnPropertyNames;var He=Object.getPrototypeOf,qe=Object.prototype.hasOwnProperty;var ve=t=>{throw TypeError(t)};var fe=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Ze=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Xe(e))!qe.call(t,a)&&a!==r&&ae(t,a,{get:()=>e[a],enumerable:!(o=me(e,a))||o.enumerable});return t};var Be=(t,e,r)=>(r=t!=null?Ue(He(t)):{},Ze(e||!t||!t.__esModule?ae(r,"default",{value:t,enumerable:!0}):r,t));var m=(t,e,r,o)=>{for(var a=o>1?void 0:o?me(e,r):e,n=t.length-1,s;n>=0;n--)(s=t[n])&&(a=(o?s(e,r,a):s(a))||a);return o&&a&&ae(e,r,a),a};var ie=(t,e,r)=>e.has(t)||ve("Cannot "+r);var we=(t,e,r)=>(ie(t,e,"read from private field"),r?r.call(t):e.get(t)),se=(t,e,r)=>e.has(t)?ve("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),xe=(t,e,r,o)=>(ie(t,e,"write to private field"),o?o.call(t,r):e.set(t,r),r),g=(t,e,r)=>(ie(t,e,"access private method"),r);var Ee=fe(D=>{"use strict";Object.defineProperty(D,"__esModule",{value:!0});D.errorMessages=D.ErrorType=void 0;var A;(function(t){t.MalformedUnicode="MALFORMED_UNICODE",t.MalformedHexadecimal="MALFORMED_HEXADECIMAL",t.CodePointLimit="CODE_POINT_LIMIT",t.OctalDeprecation="OCTAL_DEPRECATION",t.EndOfString="END_OF_STRING"})(A=D.ErrorType||(D.ErrorType={}));D.errorMessages=new Map([[A.MalformedUnicode,"malformed Unicode character escape sequence"],[A.MalformedHexadecimal,"malformed hexadecimal character escape sequence"],[A.CodePointLimit,"Unicode codepoint must not be greater than 0x10FFFF in escape sequence"],[A.OctalDeprecation,'"0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead'],[A.EndOfString,"malformed escape sequence at end of string"]])});var
|
|
2
|
-
`],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function or(t){return tr.get(t)||t}var ar=/\\(?:(\\)|x([\s\S]{0,2})|u(\{[^}]*\}?)|u([\s\S]{4})\\u([^{][\s\S]{0,3})|u([\s\S]{0,4})|([0-3]?[0-7]{1,2})|([\s\S])|$)/g;function
|
|
1
|
+
var Ue=Object.create;var ae=Object.defineProperty;var me=Object.getOwnPropertyDescriptor;var Xe=Object.getOwnPropertyNames;var He=Object.getPrototypeOf,qe=Object.prototype.hasOwnProperty;var ve=t=>{throw TypeError(t)};var fe=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Ze=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Xe(e))!qe.call(t,a)&&a!==r&&ae(t,a,{get:()=>e[a],enumerable:!(o=me(e,a))||o.enumerable});return t};var Be=(t,e,r)=>(r=t!=null?Ue(He(t)):{},Ze(e||!t||!t.__esModule?ae(r,"default",{value:t,enumerable:!0}):r,t));var m=(t,e,r,o)=>{for(var a=o>1?void 0:o?me(e,r):e,n=t.length-1,s;n>=0;n--)(s=t[n])&&(a=(o?s(e,r,a):s(a))||a);return o&&a&&ae(e,r,a),a};var ie=(t,e,r)=>e.has(t)||ve("Cannot "+r);var we=(t,e,r)=>(ie(t,e,"read from private field"),r?r.call(t):e.get(t)),se=(t,e,r)=>e.has(t)?ve("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),xe=(t,e,r,o)=>(ie(t,e,"write to private field"),o?o.call(t,r):e.set(t,r),r),g=(t,e,r)=>(ie(t,e,"access private method"),r);var Ee=fe(D=>{"use strict";Object.defineProperty(D,"__esModule",{value:!0});D.errorMessages=D.ErrorType=void 0;var A;(function(t){t.MalformedUnicode="MALFORMED_UNICODE",t.MalformedHexadecimal="MALFORMED_HEXADECIMAL",t.CodePointLimit="CODE_POINT_LIMIT",t.OctalDeprecation="OCTAL_DEPRECATION",t.EndOfString="END_OF_STRING"})(A=D.ErrorType||(D.ErrorType={}));D.errorMessages=new Map([[A.MalformedUnicode,"malformed Unicode character escape sequence"],[A.MalformedHexadecimal,"malformed hexadecimal character escape sequence"],[A.CodePointLimit,"Unicode codepoint must not be greater than 0x10FFFF in escape sequence"],[A.OctalDeprecation,'"0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead'],[A.EndOfString,"malformed escape sequence at end of string"]])});var Fe=fe($=>{"use strict";Object.defineProperty($,"__esModule",{value:!0});$.unraw=$.errorMessages=$.ErrorType=void 0;var y=Ee();Object.defineProperty($,"ErrorType",{enumerable:!0,get:function(){return y.ErrorType}});Object.defineProperty($,"errorMessages",{enumerable:!0,get:function(){return y.errorMessages}});function Je(t){return!t.match(/[^a-f0-9]/i)?parseInt(t,16):NaN}function B(t,e,r){let o=Je(t);if(Number.isNaN(o)||r!==void 0&&r!==t.length)throw new SyntaxError(y.errorMessages.get(e));return o}function We(t){let e=B(t,y.ErrorType.MalformedHexadecimal,2);return String.fromCharCode(e)}function Me(t,e){let r=B(t,y.ErrorType.MalformedUnicode,4);if(e!==void 0){let o=B(e,y.ErrorType.MalformedUnicode,4);return String.fromCharCode(r,o)}return String.fromCharCode(r)}function Qe(t){return t.charAt(0)==="{"&&t.charAt(t.length-1)==="}"}function er(t){if(!Qe(t))throw new SyntaxError(y.errorMessages.get(y.ErrorType.MalformedUnicode));let e=t.slice(1,-1),r=B(e,y.ErrorType.MalformedUnicode);try{return String.fromCodePoint(r)}catch(o){throw o instanceof RangeError?new SyntaxError(y.errorMessages.get(y.ErrorType.CodePointLimit)):o}}function rr(t,e=!1){if(e)throw new SyntaxError(y.errorMessages.get(y.ErrorType.OctalDeprecation));let r=parseInt(t,8);return String.fromCharCode(r)}var tr=new Map([["b","\b"],["f","\f"],["n",`
|
|
2
|
+
`],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function or(t){return tr.get(t)||t}var ar=/\\(?:(\\)|x([\s\S]{0,2})|u(\{[^}]*\}?)|u([\s\S]{4})\\u([^{][\s\S]{0,3})|u([\s\S]{0,4})|([0-3]?[0-7]{1,2})|([\s\S])|$)/g;function Ve(t,e=!1){return t.replace(ar,function(r,o,a,n,s,i,d,p,w){if(o!==void 0)return"\\";if(a!==void 0)return We(a);if(n!==void 0)return er(n);if(s!==void 0)return Me(s,i);if(d!==void 0)return Me(d);if(p==="0")return"\0";if(p!==void 0)return rr(p,!e);if(w!==void 0)return or(w);throw new SyntaxError(y.errorMessages.get(y.ErrorType.EndOfString))})}$.unraw=Ve;$.default=Ve});var u=function(t,e,r,o){if(r==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?o:r==="a"?o.call(t):o?o.value:e.get(t)},f=function(t,e,r,o,a){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!a:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?a.call(t,r):a?a.value=r:e.set(t,r),r};function ke(t){var e,r,o,a,n,s,i,d,p,w,z,V,k,M,_,C,L,Y,re;class Ye extends t{constructor(...l){var h,v,x;super(...l),e.add(this),this.internals=this.attachInternals(),r.set(this,!1),o.set(this,!1),a.set(this,!1),n.set(this,void 0),s.set(this,void 0),i.set(this,!0),p.set(this,""),w.set(this,()=>{f(this,a,!0,"f"),f(this,r,!0,"f"),u(this,e,"m",C).call(this)}),z.set(this,()=>{f(this,r,!1,"f"),u(this,e,"m",L).call(this,this.shouldFormValueUpdate()?u(this,p,"f"):""),!this.validity.valid&&u(this,a,"f")&&f(this,o,!0,"f");let F=u(this,e,"m",C).call(this);this.validationMessageCallback&&this.validationMessageCallback(F?this.internals.validationMessage:"")}),V.set(this,()=>{var F;u(this,i,"f")&&this.validationTarget&&(this.internals.setValidity(this.validity,this.validationMessage,this.validationTarget),f(this,i,!1,"f")),f(this,a,!0,"f"),f(this,o,!0,"f"),u(this,e,"m",C).call(this),(F=this===null||this===void 0?void 0:this.validationMessageCallback)===null||F===void 0||F.call(this,this.showError?this.internals.validationMessage:"")}),k.set(this,void 0),M.set(this,!1),_.set(this,Promise.resolve()),(h=this.addEventListener)===null||h===void 0||h.call(this,"focus",u(this,w,"f")),(v=this.addEventListener)===null||v===void 0||v.call(this,"blur",u(this,z,"f")),(x=this.addEventListener)===null||x===void 0||x.call(this,"invalid",u(this,V,"f")),this.setValue(null)}static get formAssociated(){return!0}static get validators(){return this.formControlValidators||[]}static get observedAttributes(){let l=this.validators.map(x=>x.attribute).flat(),h=super.observedAttributes||[];return[...new Set([...h,...l])]}static getValidator(l){return this.validators.find(h=>h.attribute===l)||null}static getValidators(l){return this.validators.filter(h=>{var v;if(h.attribute===l||!((v=h.attribute)===null||v===void 0)&&v.includes(l))return!0})}get form(){return this.internals.form}get showError(){return u(this,e,"m",C).call(this)}checkValidity(){return this.internals.checkValidity()}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}attributeChangedCallback(l,h,v){var x;(x=super.attributeChangedCallback)===null||x===void 0||x.call(this,l,h,v);let X=this.constructor.getValidators(l);X!=null&&X.length&&this.validationTarget&&this.setValue(u(this,p,"f"))}setValue(l){var h;f(this,o,!1,"f"),(h=this.validationMessageCallback)===null||h===void 0||h.call(this,""),f(this,p,l,"f");let x=this.shouldFormValueUpdate()?l:null;this.internals.setFormValue(x),u(this,e,"m",L).call(this,x),this.valueChangedCallback&&this.valueChangedCallback(x),u(this,e,"m",C).call(this)}shouldFormValueUpdate(){return!0}get validationComplete(){return new Promise(l=>l(u(this,_,"f")))}formResetCallback(){var l,h;f(this,a,!1,"f"),f(this,o,!1,"f"),u(this,e,"m",C).call(this),(l=this.resetFormControl)===null||l===void 0||l.call(this),(h=this.validationMessageCallback)===null||h===void 0||h.call(this,u(this,e,"m",C).call(this)?this.validationMessage:"")}}return r=new WeakMap,o=new WeakMap,a=new WeakMap,n=new WeakMap,s=new WeakMap,i=new WeakMap,p=new WeakMap,w=new WeakMap,z=new WeakMap,V=new WeakMap,k=new WeakMap,M=new WeakMap,_=new WeakMap,e=new WeakSet,d=function(){let l=this.getRootNode(),h=`${this.localName}[name="${this.getAttribute("name")}"]`;return l.querySelectorAll(h)},C=function(){if(this.hasAttribute("disabled"))return!1;let l=u(this,o,"f")||u(this,a,"f")&&!this.validity.valid&&!u(this,r,"f");return l&&this.internals.states?this.internals.states.add("--show-error"):this.internals.states&&this.internals.states.delete("--show-error"),l},L=function(l){let h=this.constructor,v={},x=h.validators,F=[],X=x.some(E=>E.isValid instanceof Promise);u(this,M,"f")||(f(this,_,new Promise(E=>{f(this,k,E,"f")}),"f"),f(this,M,!0,"f")),u(this,n,"f")&&(u(this,n,"f").abort(),f(this,s,u(this,n,"f"),"f"));let H=new AbortController;f(this,n,H,"f");let q,ge=!1;x.length&&(x.forEach(E=>{let te=E.key||"customError",T=E.isValid(this,l,H.signal);T instanceof Promise?(F.push(T),T.then(oe=>{oe!=null&&(v[te]=!oe,q=u(this,e,"m",re).call(this,E,l),u(this,e,"m",Y).call(this,v,q))})):(v[te]=!T,this.validity[te]!==!T&&(ge=!0),!T&&!q&&(q=u(this,e,"m",re).call(this,E,l)))}),Promise.allSettled(F).then(()=>{var E;H!=null&&H.signal.aborted||(f(this,M,!1,"f"),(E=u(this,k,"f"))===null||E===void 0||E.call(this))}),(ge||!X)&&u(this,e,"m",Y).call(this,v,q))},Y=function(l,h){if(this.validationTarget)this.internals.setValidity(l,h,this.validationTarget),f(this,i,!1,"f");else{if(this.internals.setValidity(l,h),this.internals.validity.valid)return;f(this,i,!0,"f")}},re=function(l,h){if(this.validityCallback){let v=this.validityCallback(l.key||"customError");if(v)return v}return l.message instanceof Function?l.message(this,h):l.message},Ye}import{html as I,LitElement as De,nothing as O}from"lit";import{property as S,query as Re,state as P}from"lit/decorators.js";import{ifDefined as W}from"lit/directives/if-defined.js";import{css as ye}from"lit";var _e=ye`
|
|
3
3
|
*,
|
|
4
4
|
:before,
|
|
5
5
|
:after {
|
|
@@ -2610,7 +2610,7 @@ var Ue=Object.create;var ae=Object.defineProperty;var me=Object.getOwnPropertyDe
|
|
|
2610
2610
|
:host([name="to"]) .w-slider-thumb__range::-moz-range-thumb {
|
|
2611
2611
|
transform: translateX(calc(var(--w-slider-thumb-size) - 1px));
|
|
2612
2612
|
}
|
|
2613
|
-
`;import{css as Ke}from"lit";var ze=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=Be(
|
|
2613
|
+
`;import{css as Ke}from"lit";var ze=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=Be(Fe(),1);var N=t=>typeof t=="string",ir=t=>typeof t=="function",$e=new Map,Ne="en";function ce(t){return[...Array.isArray(t)?t:[t],Ne]}function he(t,e,r){let o=ce(t);r||(r="default");let a;if(typeof r=="string")switch(a={day:"numeric",month:"short",year:"numeric"},r){case"full":a.weekday="long";case"long":a.month="long";break;case"short":a.month="numeric";break}else a=r;return G(()=>K("date",o,r),()=>new Intl.DateTimeFormat(o,a)).format(N(e)?new Date(e):e)}function sr(t,e,r){let o;if(r||(r="default"),typeof r=="string")switch(o={second:"numeric",minute:"numeric",hour:"numeric"},r){case"full":case"long":o.timeZoneName="short";break;case"short":delete o.second}else o=r;return he(t,e,o)}function ne(t,e,r){let o=ce(t);return G(()=>K("number",o,r),()=>new Intl.NumberFormat(o,r)).format(e)}function Oe(t,e,r,{offset:o=0,...a}){var i,d;let n=ce(t),s=e?G(()=>K("plural-ordinal",n),()=>new Intl.PluralRules(n,{type:"ordinal"})):G(()=>K("plural-cardinal",n),()=>new Intl.PluralRules(n,{type:"cardinal"}));return(d=(i=a[r])!=null?i:a[s.select(r-o)])!=null?d:a.other}function G(t,e){let r=t(),o=$e.get(r);return o||(o=e(),$e.set(r,o)),o}function K(t,e,r){let o=e.join("-");return`${t}-${o}-${JSON.stringify(r)}`}var Se=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,Le="%__lingui_octothorpe__%",nr=(t,e,r={})=>{let o=e||t,a=s=>typeof s=="object"?s:r[s],n=(s,i)=>{let d=Object.keys(r).length?a("number"):void 0,p=ne(o,s,d);return i.replace(new RegExp(Le,"g"),p)};return{plural:(s,i)=>{let{offset:d=0}=i,p=Oe(o,!1,s,i);return n(s-d,p)},selectordinal:(s,i)=>{let{offset:d=0}=i,p=Oe(o,!0,s,i);return n(s-d,p)},select:lr,number:(s,i)=>ne(o,s,a(i)||{style:i}),date:(s,i)=>he(o,s,a(i)||i),time:(s,i)=>sr(o,s,a(i)||i)}},lr=(t,e)=>{var r;return(r=e[t])!=null?r:e.other};function dr(t,e,r){return(o={},a)=>{let n=nr(e,r,a),s=(d,p=!1)=>Array.isArray(d)?d.reduce((w,z)=>{if(z==="#"&&p)return w+Le;if(N(z))return w+z;let[V,k,M]=z,_={};k==="plural"||k==="selectordinal"||k==="select"?Object.entries(M).forEach(([L,Y])=>{_[L]=s(Y,k==="plural"||k==="selectordinal")}):_=M;let C;if(k){let L=n[k];C=L(o[V],_)}else C=o[V];return C==null?w:w+C},""):d,i=s(t);return N(i)&&Se.test(i)?(0,Pe.unraw)(i):N(i)?i:i?String(i):""}}var cr=Object.defineProperty,hr=(t,e,r)=>e in t?cr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ur=(t,e,r)=>(hr(t,typeof e!="symbol"?e+"":e,r),r),le=class{constructor(){ur(this,"_events",{})}on(e,r){var a;var o;return(a=(o=this._events)[e])!=null||(o[e]=[]),this._events[e].push(r),()=>this.removeListener(e,r)}removeListener(e,r){let o=this._getListeners(e);if(!o)return;let a=o.indexOf(r);~a&&o.splice(a,1)}emit(e,...r){let o=this._getListeners(e);o&&o.map(a=>a.apply(this,r))}_getListeners(e){let r=this._events[e];return Array.isArray(r)?r:!1}},br=Object.defineProperty,pr=(t,e,r)=>e in t?br(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,R=(t,e,r)=>(pr(t,typeof e!="symbol"?e+"":e,r),r),de=class extends le{constructor(e){var r;super(),R(this,"_locale",""),R(this,"_locales"),R(this,"_localeData",{}),R(this,"_messages",{}),R(this,"_missing"),R(this,"_messageCompiler"),R(this,"t",this._.bind(this)),e.missing!=null&&(this._missing=e.missing),e.messages!=null&&this.load(e.messages),e.localeData!=null&&this.loadLocaleData(e.localeData),(typeof e.locale=="string"||e.locales)&&this.activate((r=e.locale)!=null?r:Ne,e.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){var e;return(e=this._messages[this._locale])!=null?e:{}}get localeData(){var e;return(e=this._localeData[this._locale])!=null?e:{}}_loadLocaleData(e,r){let o=this._localeData[e];o?Object.assign(o,r):this._localeData[e]=r}setMessagesCompiler(e){return this._messageCompiler=e,this}loadLocaleData(e,r){typeof e=="string"?this._loadLocaleData(e,r):Object.keys(e).forEach(o=>this._loadLocaleData(o,e[o])),this.emit("change")}_load(e,r){let o=this._messages[e];o?Object.assign(o,r):this._messages[e]=r}load(e,r){typeof e=="string"&&typeof r=="object"?this._load(e,r):Object.entries(e).forEach(([o,a])=>this._load(o,a)),this.emit("change")}loadAndActivate({locale:e,locales:r,messages:o}){this._locale=e,this._locales=r||void 0,this._messages[this._locale]=o,this.emit("change")}activate(e,r){this._locale=e,this._locales=r,this.emit("change")}_(e,r,o){if(!this.locale)throw new Error("Lingui: Attempted to call a translation function without setting a locale.\nMake sure to call `i18n.activate(locale)` before using Lingui functions.\nThis issue may also occur due to a race condition in your initialization logic.");let a=o==null?void 0:o.message;e||(e=""),N(e)||(r=e.values||r,a=e.message,e=e.id);let n=this.messages[e],s=n===void 0,i=this._missing;if(i&&s)return ir(i)?i(this._locale,e):i;s&&this.emit("missing",{id:e,locale:this._locale});let d=n||a||e;return N(d)&&(this._messageCompiler?d=this._messageCompiler(d):console.warn(`Uncompiled message detected! Message:
|
|
2614
2614
|
|
|
2615
2615
|
> ${d}
|
|
2616
2616
|
|
|
@@ -2618,7 +2618,7 @@ That means you use raw catalog or your catalog doesn't have a translation for th
|
|
|
2618
2618
|
ICU features such as interpolation and plurals will not work properly for that message.
|
|
2619
2619
|
|
|
2620
2620
|
Please compile your catalog first.
|
|
2621
|
-
`)),
|
|
2621
|
+
`)),N(d)&&Se.test(d)?JSON.parse(`"${d}"`):N(d)?d:dr(d,this._locale,this._locales)(r,o==null?void 0:o.formats)}date(e,r){return he(this._locales||this._locale,e,r)}number(e,r){return ne(this._locales||this._locale,e,r)}};function gr(t={}){return new de(t)}var J=gr();var Te={};var Z,c,Q,ee,ue,j,be,pe,Ae,Ie,je,b=class extends ke(De){constructor(){super(...arguments);se(this,c);this.invalid=!1;this.allowValuesOutsideRange=!1;this.suffix="";this._showTooltip=!1;this._inputHasFocus=!1;se(this,Z,null);this.anchorPositioningStyleElement=null}resetFormControl(){this.value=we(this,Z)}async connectedCallback(){if(super.connectedCallback(),xe(this,Z,this.value),this.setValue(this.value),"anchorName"in document.documentElement.style)await this.updateComplete;else{let r=Te.url.substring(0,Te.url.lastIndexOf("/"));try{let[{default:o}]=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=`
|
|
2622
2622
|
/*
|
|
2623
2623
|
* The polyfill can only anchor to ::before and ::after pseudo elements, not the pseudo element slider thumb.
|
|
2624
2624
|
* We work around that by recreating a transparent version of the active range
|
|
@@ -2667,10 +2667,10 @@ Please compile your catalog first.
|
|
|
2667
2667
|
left: anchor(--polyfilled-thumb left);
|
|
2668
2668
|
margin-left: 38px;
|
|
2669
2669
|
}
|
|
2670
|
-
`,await o({roots:[this.shadowRoot],elements:[this.anchorPositioningStyleElement]})}catch(o){console.error(new Error("Error registering the CSS anchor positioning polyfill. The UI will look broken.",{cause:o}))}}g(this,c,ue).call(this)}get boundaryValue(){return this.slot==="from"?this.min:this.max}get textFieldDisplayValue(){var r;return this._inputHasFocus?this.value!==""?this.value:(r=this.range)!=null&&r.value?Math.min(Math.max(Number(this.range.value),Number(this.min)+1),Number(this.max)-1).toString():"":this.value}get tooltipDisplayValue(){var r,o;return this.formatter?this.formatter(this.value,this.slot):this.value===""?(o=(r=this.range)==null?void 0:r.value)!=null?o:this.boundaryValue:this.value||0}updated(r){r.has("value")&&(this.setValue(this.value),g(this,c,ue).call(this))}render(){return
|
|
2670
|
+
`,await o({roots:[this.shadowRoot],elements:[this.anchorPositioningStyleElement]})}catch(o){console.error(new Error("Error registering the CSS anchor positioning polyfill. The UI will look broken.",{cause:o}))}}g(this,c,ue).call(this)}get boundaryValue(){return this.slot==="from"?this.min:this.max}get textFieldDisplayValue(){var r;return this._inputHasFocus?this.value!==""?this.value:(r=this.range)!=null&&r.value?Math.min(Math.max(Number(this.range.value),Number(this.min)+1),Number(this.max)-1).toString():"":this.value}get tooltipDisplayValue(){var r,o;return this.formatter?this.formatter(this.value,this.slot):this.value===""?(o=(r=this.range)==null?void 0:r.value)!=null?o:this.boundaryValue:this.value||0}updated(r){r.has("value")&&(this.setValue(this.value),g(this,c,ue).call(this))}render(){return I`
|
|
2671
2671
|
<div class="w-slider-thumb">
|
|
2672
2672
|
<label for="range">${this.label}</label>
|
|
2673
|
-
${"anchorName"in document.documentElement.style?
|
|
2673
|
+
${"anchorName"in document.documentElement.style?O:I`<div class="polyfill-range">
|
|
2674
2674
|
<div class="polyfill-active-range"></div>
|
|
2675
2675
|
</div>`}
|
|
2676
2676
|
<input
|
|
@@ -2692,34 +2692,34 @@ Please compile your catalog first.
|
|
|
2692
2692
|
@focus="${g(this,c,Q)}"
|
|
2693
2693
|
@blur="${g(this,c,ee)}"
|
|
2694
2694
|
@input="${g(this,c,pe)}"
|
|
2695
|
-
@keydown="${this.allowValuesOutsideRange?g(this,c,Ae):
|
|
2695
|
+
@keydown="${this.allowValuesOutsideRange?g(this,c,Ae):O}"
|
|
2696
2696
|
/>
|
|
2697
2697
|
|
|
2698
|
-
${this.slot==="from"?
|
|
2698
|
+
${this.slot==="from"?I`<span class="w-slider-thumb__from-marker"
|
|
2699
2699
|
>${this.formatter?this.formatter(this.allowValuesOutsideRange?"":this.min,"from"):this.min}
|
|
2700
2700
|
${this.suffix}</span
|
|
2701
|
-
>`:
|
|
2702
|
-
${this.slot==="to"?
|
|
2701
|
+
>`:O}
|
|
2702
|
+
${this.slot==="to"?I`<span class="w-slider-thumb__to-marker"
|
|
2703
2703
|
>${this.formatter?this.formatter(this.allowValuesOutsideRange?"":this.max,"to"):this.max}
|
|
2704
2704
|
${this.suffix}</span
|
|
2705
|
-
>`:
|
|
2705
|
+
>`:O}
|
|
2706
2706
|
|
|
2707
2707
|
<w-textfield
|
|
2708
2708
|
aria-label="${this.ariaLabel}"
|
|
2709
2709
|
aria-description="${W(this.ariaDescription)}"
|
|
2710
2710
|
class="w-slider-thumb__textfield"
|
|
2711
2711
|
type="number"
|
|
2712
|
-
.formatter=${this.formatter?r=>this.formatter(r,this.slot):
|
|
2712
|
+
.formatter=${this.formatter?r=>this.formatter(r,this.slot):O}
|
|
2713
2713
|
.value="${this.textFieldDisplayValue}"
|
|
2714
|
-
min="${this.allowValuesOutsideRange?
|
|
2715
|
-
max="${this.allowValuesOutsideRange?
|
|
2714
|
+
min="${this.allowValuesOutsideRange?O:this.min}"
|
|
2715
|
+
max="${this.allowValuesOutsideRange?O:this.max}"
|
|
2716
2716
|
step="${W(this.step)}"
|
|
2717
2717
|
?invalid="${!!this.invalid}"
|
|
2718
2718
|
@input="${g(this,c,pe)}"
|
|
2719
|
-
@focus="${g(this,c,
|
|
2720
|
-
@blur="${g(this,c,
|
|
2719
|
+
@focus="${g(this,c,Ie)}"
|
|
2720
|
+
@blur="${g(this,c,je)}"
|
|
2721
2721
|
>
|
|
2722
|
-
${this.suffix?
|
|
2722
|
+
${this.suffix?I`<w-affix slot="suffix" label="${this.suffix}"></w-affix>`:O}
|
|
2723
2723
|
</w-textfield>
|
|
2724
2724
|
|
|
2725
2725
|
<w-attention
|
|
@@ -2735,7 +2735,7 @@ Please compile your catalog first.
|
|
|
2735
2735
|
slot="target"
|
|
2736
2736
|
></output>
|
|
2737
2737
|
<span slot="message">
|
|
2738
|
-
${this.tooltipDisplayValue}${this.suffix?
|
|
2738
|
+
${this.tooltipDisplayValue}${this.suffix?I` ${this.suffix}`:O}
|
|
2739
2739
|
</span>
|
|
2740
2740
|
</w-attention>
|
|
2741
2741
|
|
|
@@ -2744,5 +2744,5 @@ Please compile your catalog first.
|
|
|
2744
2744
|
>${this.ariaDescription}</span
|
|
2745
2745
|
>
|
|
2746
2746
|
</div>
|
|
2747
|
-
`}};Z=new WeakMap,c=new WeakSet,Q=function(){this._showTooltip=!0,this.shadowRoot.querySelector("w-attention").handleDone()},ee=function(){this._showTooltip=!1},ue=function(){this.range&&(this.value===""?this.range.value=this.boundaryValue:this.value&&(this.range.value=this.value))},
|
|
2747
|
+
`}};Z=new WeakMap,c=new WeakSet,Q=function(){this._showTooltip=!0,this.shadowRoot.querySelector("w-attention").handleDone()},ee=function(){this._showTooltip=!1},ue=function(){this.range&&(this.value===""?this.range.value=this.boundaryValue:this.value&&(this.range.value=this.value))},j=function(r){this.dispatchEvent(new CustomEvent("slidervalidity",{bubbles:!0,detail:{invalid:r,slot:this.slot}}))},be=async function(r,o){let a=Number.parseInt(r);if(this.allowValuesOutsideRange&&!o&&this.step&&!(this.slot==="to"&&a>=Number(this.max)-1||this.slot==="from"&&a<=Number(this.min)+1)){let w=1/this.step;a=Math.round(a*w)/w,r=a.toString()}let n=Number.parseInt(this.max),s=Number.parseInt(this.min);if(!this.allowValuesOutsideRange&&(a>n||a<s))return g(this,c,j).call(this,J.t({id:"slider.error.out_of_bounds",message:"Value must be between {min} and {max}",values:{min:`${this.min} ${this.suffix}`.trim(),max:`${this.max} ${this.suffix}`.trim()}})),{shouldCancel:!0};if(r==="")return this.required&&g(this,c,j).call(this,J.t({id:"slider.error.required",message:"This field is required"})),{shouldCancel:!0};this.value=r;let i=r===this.max||r===this.min,d=!1;if(this.slot){let p=getComputedStyle(this),w=p.getPropertyValue("--to"),z=p.getPropertyValue("--from"),V=Number.parseInt(w),k=Number.parseInt(z),M=J.t({id:"slider.error.overlap",message:"The maximum value cannot be less than the minimum"});if(this.slot==="from"){let _=this.allowValuesOutsideRange&&V>n?V:Math.min(V,this.allowValuesOutsideRange?n-1:n);a>_&&(d=!0,this.allowValuesOutsideRange&&i?this.value=String(_):this.value=w,o&&(g(this,c,j).call(this,M),await this.updateComplete,this.textfield.value=r))}else{let _=this.allowValuesOutsideRange&&k<s?k:Math.max(Number.parseInt(z),this.allowValuesOutsideRange?s+1:s);a<_&&(d=!0,this.allowValuesOutsideRange&&i?this.value=String(_):this.value=z,o&&(g(this,c,j).call(this,M),await this.updateComplete,this.textfield.value=r))}}return d?{shouldCancel:!0}:(g(this,c,j).call(this,""),this.range.value=Math.min(Math.max(Number(r),Number(this.min)),Number(this.max)).toString(),this.value=this.allowValuesOutsideRange&&!o&&i?"":r,this.shadowRoot.querySelector("w-attention").handleDone(),{shouldCancel:!1})},pe=async function(r){let o=r.currentTarget.tagName==="W-TEXTFIELD";if(r instanceof CustomEvent)return;let a=r.currentTarget.value;return(await g(this,c,be).call(this,a,o)).shouldCancel?(r.preventDefault(),!1):!0},Ae=async function(r){if(r.key!=="ArrowLeft"&&r.key!=="ArrowRight")return;let o=Number(this.range.value),a=this.step||1,n;r.key==="ArrowLeft"?n=o-a:n=o+a,n=Math.min(Math.max(n,Number(this.min)),Number(this.max)),(await g(this,c,be).call(this,n.toString(),!1)).shouldCancel&&r.preventDefault()},Ie=function(r){r instanceof CustomEvent&&r.type==="focus"&&(this._inputHasFocus=!0)},je=function(r){r instanceof CustomEvent&&r.type==="blur"&&(this._inputHasFocus=!1)},b.shadowRootOptions={...De.shadowRootOptions,delegatesFocus:!0},b.styles=[_e,ze,Ce],m([S({attribute:"aria-label",reflect:!0})],b.prototype,"ariaLabel",2),m([S({attribute:"aria-description",reflect:!0})],b.prototype,"ariaDescription",2),m([S({reflect:!0})],b.prototype,"label",2),m([S({reflect:!0})],b.prototype,"name",2),m([S({reflect:!0})],b.prototype,"value",2),m([S({type:Boolean,reflect:!0})],b.prototype,"disabled",2),m([S({type:Boolean,reflect:!0})],b.prototype,"invalid",2),m([S({attribute:!1,reflect:!1})],b.prototype,"allowValuesOutsideRange",2),m([P()],b.prototype,"markers",2),m([P()],b.prototype,"required",2),m([P()],b.prototype,"step",2),m([P()],b.prototype,"min",2),m([P()],b.prototype,"max",2),m([P()],b.prototype,"suffix",2),m([P()],b.prototype,"formatter",2),m([Re('input[type="range"]')],b.prototype,"range",2),m([Re("w-textfield")],b.prototype,"textfield",2),m([P()],b.prototype,"_showTooltip",2),m([P()],b.prototype,"_inputHasFocus",2);customElements.get("w-slider-thumb")||customElements.define("w-slider-thumb",b);export{b as WarpSliderThumb};
|
|
2748
2748
|
//# sourceMappingURL=slider-thumb.js.map
|