@warp-ds/elements 2.3.0-next.23 → 2.3.0-next.25

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.
Files changed (54) hide show
  1. package/dist/custom-elements.json +218 -8
  2. package/dist/index.d.ts +39 -0
  3. package/dist/packages/attention/index.js +20 -20
  4. package/dist/packages/attention/index.js.map +3 -3
  5. package/dist/packages/button/button.react.stories.d.ts +1 -1
  6. package/dist/packages/button/button.test.js +30 -1
  7. package/dist/packages/button/index.d.ts +2 -0
  8. package/dist/packages/button/index.js +12 -12
  9. package/dist/packages/button/index.js.map +3 -3
  10. package/dist/packages/combobox/combobox.react.stories.d.ts +1 -1
  11. package/dist/packages/combobox/combobox.stories.d.ts +1 -0
  12. package/dist/packages/combobox/combobox.stories.js +29 -3
  13. package/dist/packages/combobox/index.d.ts +7 -1
  14. package/dist/packages/combobox/index.js +19 -19
  15. package/dist/packages/combobox/index.js.map +4 -4
  16. package/dist/packages/datepicker/datepicker.d.ts +1 -0
  17. package/dist/packages/datepicker/datepicker.js +35 -35
  18. package/dist/packages/datepicker/datepicker.js.map +3 -3
  19. package/dist/packages/datepicker/datepicker.react.stories.d.ts +1 -1
  20. package/dist/packages/datepicker/datepicker.test.js +27 -0
  21. package/dist/packages/link/link.react.stories.d.ts +1 -1
  22. package/dist/packages/select/index.d.ts +1 -0
  23. package/dist/packages/select/index.js +15 -15
  24. package/dist/packages/select/index.js.map +3 -3
  25. package/dist/packages/select/select.react.stories.d.ts +1 -1
  26. package/dist/packages/select/select.test.js +30 -0
  27. package/dist/packages/slider/slider-thumb.d.ts +1 -0
  28. package/dist/packages/slider/slider-thumb.js +23 -23
  29. package/dist/packages/slider/slider-thumb.js.map +3 -3
  30. package/dist/packages/slider/slider.d.ts +2 -2
  31. package/dist/packages/slider/slider.js +27 -17
  32. package/dist/packages/slider/slider.js.map +4 -4
  33. package/dist/packages/slider/slider.stories.js +2 -2
  34. package/dist/packages/slider/slider.test.js +28 -0
  35. package/dist/packages/switch/index.d.ts +10 -2
  36. package/dist/packages/switch/index.js +5 -5
  37. package/dist/packages/switch/index.js.map +4 -4
  38. package/dist/packages/switch/switch.react.stories.js +4 -4
  39. package/dist/packages/switch/switch.stories.js +6 -5
  40. package/dist/packages/switch/switch.test.d.ts +1 -0
  41. package/dist/packages/switch/switch.test.js +40 -0
  42. package/dist/packages/textarea/textarea.d.ts +1 -0
  43. package/dist/packages/textarea/textarea.js +14 -14
  44. package/dist/packages/textarea/textarea.js.map +3 -3
  45. package/dist/packages/textarea/textarea.react.stories.d.ts +1 -1
  46. package/dist/packages/textarea/textarea.test.js +19 -0
  47. package/dist/packages/textfield/index.d.ts +3 -0
  48. package/dist/packages/textfield/index.js +8 -8
  49. package/dist/packages/textfield/index.js.map +3 -3
  50. package/dist/packages/textfield/textfield.react.stories.d.ts +1 -1
  51. package/dist/packages/textfield/textfield.stories.d.ts +1 -0
  52. package/dist/packages/textfield/textfield.stories.js +17 -0
  53. package/dist/web-types.json +7 -3
  54. package/package.json +1 -1
@@ -1,5 +1,4 @@
1
1
  import { LitElement, PropertyValues } from 'lit';
2
- declare const WarpSlider_base: import("@open-wc/form-control").Constructor<import("@open-wc/form-control").FormControlInterface> & typeof LitElement;
3
2
  /**
4
3
  * Parent component for sliders (both single and range sliders). Used in combination with a `<w-slider-thumb>`.
5
4
  *
@@ -11,7 +10,7 @@ declare const WarpSlider_base: import("@open-wc/form-control").Constructor<impor
11
10
  * @slot from - Range sliders need to place a `<w-slider-thumb>` in the from and to slots.
12
11
  * @slot to - Range sliders need to place a `<w-slider-thumb>` in the from and to slots.
13
12
  */
14
- declare class WarpSlider extends WarpSlider_base {
13
+ declare class WarpSlider extends LitElement {
15
14
  #private;
16
15
  static shadowRootOptions: {
17
16
  delegatesFocus: boolean;
@@ -44,6 +43,7 @@ declare class WarpSlider extends WarpSlider_base {
44
43
  formatter: (value: string, type: 'to' | 'from') => string;
45
44
  _invalidMessage: string;
46
45
  _hasInternalError: boolean;
46
+ constructor();
47
47
  get edgeMin(): string;
48
48
  get edgeMax(): string;
49
49
  connectedCallback(): Promise<void>;
@@ -1,4 +1,13 @@
1
- var ae=Object.defineProperty;var ie=Object.getOwnPropertyDescriptor;var W=l=>{throw TypeError(l)};var p=(l,o,e,r)=>{for(var n=r>1?void 0:r?ie(o,e):o,a=l.length-1,x;a>=0;a--)(x=l[a])&&(n=(r?x(o,e,n):x(n))||n);return r&&n&&ae(o,e,n),n};var se=(l,o,e)=>o.has(l)||W("Cannot "+e);var U=(l,o,e)=>o.has(l)?W("Cannot add the same private member more than once"):o instanceof WeakSet?o.add(l):o.set(l,e);var v=(l,o,e)=>(se(l,o,"access private method"),e);var s=function(l,o,e,r){if(e==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof o=="function"?l!==o||!r:!o.has(l))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?r:e==="a"?r.call(l):r?r.value:o.get(l)},b=function(l,o,e,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"?l!==o||!n:!o.has(l))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?n.call(l,e):n?n.value=e:o.set(l,e),e};function B(l){var o,e,r,n,a,x,k,oe,z,P,A,R,Y,C,S,f,$,I,X;class te extends l{constructor(...t){var i,h,g;super(...t),o.add(this),this.internals=this.attachInternals(),e.set(this,!1),r.set(this,!1),n.set(this,!1),a.set(this,void 0),x.set(this,void 0),k.set(this,!0),z.set(this,""),P.set(this,()=>{b(this,n,!0,"f"),b(this,e,!0,"f"),s(this,o,"m",f).call(this)}),A.set(this,()=>{b(this,e,!1,"f"),s(this,o,"m",$).call(this,this.shouldFormValueUpdate()?s(this,z,"f"):""),!this.validity.valid&&s(this,n,"f")&&b(this,r,!0,"f");let w=s(this,o,"m",f).call(this);this.validationMessageCallback&&this.validationMessageCallback(w?this.internals.validationMessage:"")}),R.set(this,()=>{var w;s(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"),s(this,o,"m",f).call(this),(w=this===null||this===void 0?void 0:this.validationMessageCallback)===null||w===void 0||w.call(this,this.showError?this.internals.validationMessage:"")}),Y.set(this,void 0),C.set(this,!1),S.set(this,Promise.resolve()),(i=this.addEventListener)===null||i===void 0||i.call(this,"focus",s(this,P,"f")),(h=this.addEventListener)===null||h===void 0||h.call(this,"blur",s(this,A,"f")),(g=this.addEventListener)===null||g===void 0||g.call(this,"invalid",s(this,R,"f")),this.setValue(null)}static get formAssociated(){return!0}static get validators(){return this.formControlValidators||[]}static get observedAttributes(){let t=this.validators.map(g=>g.attribute).flat(),i=super.observedAttributes||[];return[...new Set([...i,...t])]}static getValidator(t){return this.validators.find(i=>i.attribute===t)||null}static getValidators(t){return this.validators.filter(i=>{var h;if(i.attribute===t||!((h=i.attribute)===null||h===void 0)&&h.includes(t))return!0})}get form(){return this.internals.form}get showError(){return s(this,o,"m",f).call(this)}checkValidity(){return this.internals.checkValidity()}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}attributeChangedCallback(t,i,h){var g;(g=super.attributeChangedCallback)===null||g===void 0||g.call(this,t,i,h);let F=this.constructor.getValidators(t);F!=null&&F.length&&this.validationTarget&&this.setValue(s(this,z,"f"))}setValue(t){var i;b(this,r,!1,"f"),(i=this.validationMessageCallback)===null||i===void 0||i.call(this,""),b(this,z,t,"f");let g=this.shouldFormValueUpdate()?t:null;this.internals.setFormValue(g),s(this,o,"m",$).call(this,g),this.valueChangedCallback&&this.valueChangedCallback(g),s(this,o,"m",f).call(this)}shouldFormValueUpdate(){return!0}get validationComplete(){return new Promise(t=>t(s(this,S,"f")))}formResetCallback(){var t,i;b(this,n,!1,"f"),b(this,r,!1,"f"),s(this,o,"m",f).call(this),(t=this.resetFormControl)===null||t===void 0||t.call(this),(i=this.validationMessageCallback)===null||i===void 0||i.call(this,s(this,o,"m",f).call(this)?this.validationMessage:"")}}return e=new WeakMap,r=new WeakMap,n=new WeakMap,a=new WeakMap,x=new WeakMap,k=new WeakMap,z=new WeakMap,P=new WeakMap,A=new WeakMap,R=new WeakMap,Y=new WeakMap,C=new WeakMap,S=new WeakMap,o=new WeakSet,oe=function(){let t=this.getRootNode(),i=`${this.localName}[name="${this.getAttribute("name")}"]`;return t.querySelectorAll(i)},f=function(){if(this.hasAttribute("disabled"))return!1;let t=s(this,r,"f")||s(this,n,"f")&&!this.validity.valid&&!s(this,e,"f");return t&&this.internals.states?this.internals.states.add("--show-error"):this.internals.states&&this.internals.states.delete("--show-error"),t},$=function(t){let i=this.constructor,h={},g=i.validators,w=[],F=g.some(m=>m.isValid instanceof Promise);s(this,C,"f")||(b(this,S,new Promise(m=>{b(this,Y,m,"f")}),"f"),b(this,C,!0,"f")),s(this,a,"f")&&(s(this,a,"f").abort(),b(this,x,s(this,a,"f"),"f"));let V=new AbortController;b(this,a,V,"f");let T,L=!1;g.length&&(g.forEach(m=>{let O=m.key||"customError",y=m.isValid(this,t,V.signal);y instanceof Promise?(w.push(y),y.then(Z=>{Z!=null&&(h[O]=!Z,T=s(this,o,"m",X).call(this,m,t),s(this,o,"m",I).call(this,h,T))})):(h[O]=!y,this.validity[O]!==!y&&(L=!0),!y&&!T&&(T=s(this,o,"m",X).call(this,m,t)))}),Promise.allSettled(w).then(()=>{var m;V!=null&&V.signal.aborted||(b(this,C,!1,"f"),(m=s(this,Y,"f"))===null||m===void 0||m.call(this))}),(L||!F)&&s(this,o,"m",I).call(this,h,T))},I=function(t,i){if(this.validationTarget)this.internals.setValidity(t,i,this.validationTarget),b(this,k,!1,"f");else{if(this.internals.setValidity(t,i),this.internals.validity.valid)return;b(this,k,!0,"f")}},X=function(t,i){if(this.validityCallback){let h=this.validityCallback(t.key||"customError");if(h)return h}return t.message instanceof Function?t.message(this,i):t.message},te}import{html as E,LitElement as J,nothing as j}from"lit";import{property as u,state as K}from"lit/decorators.js";import{css as G}from"lit";var H=G`
1
+ var ke=Object.create;var I=Object.defineProperty;var X=Object.getOwnPropertyDescriptor;var ye=Object.getOwnPropertyNames;var _e=Object.getPrototypeOf,ze=Object.prototype.hasOwnProperty;var U=o=>{throw TypeError(o)};var H=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports);var Me=(o,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of ye(e))!ze.call(o,a)&&a!==r&&I(o,a,{get:()=>e[a],enumerable:!(t=X(e,a))||t.enumerable});return o};var Ee=(o,e,r)=>(r=o!=null?ke(_e(o)):{},Me(e||!o||!o.__esModule?I(r,"default",{value:o,enumerable:!0}):r,o));var b=(o,e,r,t)=>{for(var a=t>1?void 0:t?X(e,r):e,i=o.length-1,n;i>=0;i--)(n=o[i])&&(a=(t?n(e,r,a):n(a))||a);return t&&a&&I(e,r,a),a};var Ce=(o,e,r)=>e.has(o)||U("Cannot "+r);var Z=(o,e,r)=>e.has(o)?U("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,r);var p=(o,e,r)=>(Ce(o,e,"access private method"),r);var B=H(x=>{"use strict";Object.defineProperty(x,"__esModule",{value:!0});x.errorMessages=x.ErrorType=void 0;var y;(function(o){o.MalformedUnicode="MALFORMED_UNICODE",o.MalformedHexadecimal="MALFORMED_HEXADECIMAL",o.CodePointLimit="CODE_POINT_LIMIT",o.OctalDeprecation="OCTAL_DEPRECATION",o.EndOfString="END_OF_STRING"})(y=x.ErrorType||(x.ErrorType={}));x.errorMessages=new Map([[y.MalformedUnicode,"malformed Unicode character escape sequence"],[y.MalformedHexadecimal,"malformed hexadecimal character escape sequence"],[y.CodePointLimit,"Unicode codepoint must not be greater than 0x10FFFF in escape sequence"],[y.OctalDeprecation,'"0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead'],[y.EndOfString,"malformed escape sequence at end of string"]])});var K=H(m=>{"use strict";Object.defineProperty(m,"__esModule",{value:!0});m.unraw=m.errorMessages=m.ErrorType=void 0;var g=B();Object.defineProperty(m,"ErrorType",{enumerable:!0,get:function(){return g.ErrorType}});Object.defineProperty(m,"errorMessages",{enumerable:!0,get:function(){return g.errorMessages}});function Oe(o){return!o.match(/[^a-f0-9]/i)?parseInt(o,16):NaN}function C(o,e,r){let t=Oe(o);if(Number.isNaN(t)||r!==void 0&&r!==o.length)throw new SyntaxError(g.errorMessages.get(e));return t}function Te(o){let e=C(o,g.ErrorType.MalformedHexadecimal,2);return String.fromCharCode(e)}function J(o,e){let r=C(o,g.ErrorType.MalformedUnicode,4);if(e!==void 0){let t=C(e,g.ErrorType.MalformedUnicode,4);return String.fromCharCode(r,t)}return String.fromCharCode(r)}function Se(o){return o.charAt(0)==="{"&&o.charAt(o.length-1)==="}"}function Le(o){if(!Se(o))throw new SyntaxError(g.errorMessages.get(g.ErrorType.MalformedUnicode));let e=o.slice(1,-1),r=C(e,g.ErrorType.MalformedUnicode);try{return String.fromCodePoint(r)}catch(t){throw t instanceof RangeError?new SyntaxError(g.errorMessages.get(g.ErrorType.CodePointLimit)):t}}function Ne(o,e=!1){if(e)throw new SyntaxError(g.errorMessages.get(g.ErrorType.OctalDeprecation));let r=parseInt(o,8);return String.fromCharCode(r)}var Ie=new Map([["b","\b"],["f","\f"],["n",`
2
+ `],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function De(o){return Ie.get(o)||o}var je=/\\(?:(\\)|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 G(o,e=!1){return o.replace(je,function(r,t,a,i,n,s,l,h,f){if(t!==void 0)return"\\";if(a!==void 0)return Te(a);if(i!==void 0)return Le(i);if(n!==void 0)return J(n,s);if(l!==void 0)return J(l);if(h==="0")return"\0";if(h!==void 0)return Ne(h,!e);if(f!==void 0)return De(f);throw new SyntaxError(g.errorMessages.get(g.ErrorType.EndOfString))})}m.unraw=G;m.default=G});import{html as z,LitElement as he,nothing as S}from"lit";import{property as u,state as me}from"lit/decorators.js";var ee=Ee(K(),1);var v=o=>typeof o=="string",Pe=o=>typeof o=="function",Q=new Map,re="en";function Y(o){return[...Array.isArray(o)?o:[o],re]}function A(o,e,r){let t=Y(o);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 O(()=>T("date",t,r),()=>new Intl.DateTimeFormat(t,a)).format(v(e)?new Date(e):e)}function Ye(o,e,r){let t;if(r||(r="default"),typeof r=="string")switch(t={second:"numeric",minute:"numeric",hour:"numeric"},r){case"full":case"long":t.timeZoneName="short";break;case"short":delete t.second}else t=r;return A(o,e,t)}function D(o,e,r){let t=Y(o);return O(()=>T("number",t,r),()=>new Intl.NumberFormat(t,r)).format(e)}function W(o,e,r,{offset:t=0,...a}){var s,l;let i=Y(o),n=e?O(()=>T("plural-ordinal",i),()=>new Intl.PluralRules(i,{type:"ordinal"})):O(()=>T("plural-cardinal",i),()=>new Intl.PluralRules(i,{type:"cardinal"}));return(l=(s=a[r])!=null?s:a[n.select(r-t)])!=null?l:a.other}function O(o,e){let r=o(),t=Q.get(r);return t||(t=e(),Q.set(r,t)),t}function T(o,e,r){let t=e.join("-");return`${o}-${t}-${JSON.stringify(r)}`}var oe=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,te="%__lingui_octothorpe__%",Ae=(o,e,r={})=>{let t=e||o,a=n=>typeof n=="object"?n:r[n],i=(n,s)=>{let l=Object.keys(r).length?a("number"):void 0,h=D(t,n,l);return s.replace(new RegExp(te,"g"),h)};return{plural:(n,s)=>{let{offset:l=0}=s,h=W(t,!1,n,s);return i(n-l,h)},selectordinal:(n,s)=>{let{offset:l=0}=s,h=W(t,!0,n,s);return i(n-l,h)},select:Re,number:(n,s)=>D(t,n,a(s)||{style:s}),date:(n,s)=>A(t,n,a(s)||s),time:(n,s)=>Ye(t,n,a(s)||s)}},Re=(o,e)=>{var r;return(r=e[o])!=null?r:e.other};function $e(o,e,r){return(t={},a)=>{let i=Ae(e,r,a),n=(l,h=!1)=>Array.isArray(l)?l.reduce((f,M)=>{if(M==="#"&&h)return f+te;if(v(M))return f+M;let[q,w,V]=M,L={};w==="plural"||w==="selectordinal"||w==="select"?Object.entries(V).forEach(([N,xe])=>{L[N]=n(xe,w==="plural"||w==="selectordinal")}):L=V;let E;if(w){let N=i[w];E=N(t[q],L)}else E=t[q];return E==null?f:f+E},""):l,s=n(o);return v(s)&&oe.test(s)?(0,ee.unraw)(s):v(s)?s:s?String(s):""}}var Fe=Object.defineProperty,qe=(o,e,r)=>e in o?Fe(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,Ve=(o,e,r)=>(qe(o,typeof e!="symbol"?e+"":e,r),r),j=class{constructor(){Ve(this,"_events",{})}on(e,r){var a;var t;return(a=(t=this._events)[e])!=null||(t[e]=[]),this._events[e].push(r),()=>this.removeListener(e,r)}removeListener(e,r){let t=this._getListeners(e);if(!t)return;let a=t.indexOf(r);~a&&t.splice(a,1)}emit(e,...r){let t=this._getListeners(e);t&&t.map(a=>a.apply(this,r))}_getListeners(e){let r=this._events[e];return Array.isArray(r)?r:!1}},Xe=Object.defineProperty,Ue=(o,e,r)=>e in o?Xe(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,k=(o,e,r)=>(Ue(o,typeof e!="symbol"?e+"":e,r),r),P=class extends j{constructor(e){var r;super(),k(this,"_locale",""),k(this,"_locales"),k(this,"_localeData",{}),k(this,"_messages",{}),k(this,"_missing"),k(this,"_messageCompiler"),k(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:re,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 t=this._localeData[e];t?Object.assign(t,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(t=>this._loadLocaleData(t,e[t])),this.emit("change")}_load(e,r){let t=this._messages[e];t?Object.assign(t,r):this._messages[e]=r}load(e,r){typeof e=="string"&&typeof r=="object"?this._load(e,r):Object.entries(e).forEach(([t,a])=>this._load(t,a)),this.emit("change")}loadAndActivate({locale:e,locales:r,messages:t}){this._locale=e,this._locales=r||void 0,this._messages[this._locale]=t,this.emit("change")}activate(e,r){this._locale=e,this._locales=r,this.emit("change")}_(e,r,t){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=t==null?void 0:t.message;e||(e=""),v(e)||(r=e.values||r,a=e.message,e=e.id);let i=this.messages[e],n=i===void 0,s=this._missing;if(s&&n)return Pe(s)?s(this._locale,e):s;n&&this.emit("missing",{id:e,locale:this._locale});let l=i||a||e;return v(l)&&(this._messageCompiler?l=this._messageCompiler(l):console.warn(`Uncompiled message detected! Message:
3
+
4
+ > ${l}
5
+
6
+ That means you use raw catalog or your catalog doesn't have a translation for the message and fallback was used.
7
+ ICU features such as interpolation and plurals will not work properly for that message.
8
+
9
+ Please compile your catalog first.
10
+ `)),v(l)&&oe.test(l)?JSON.parse(`"${l}"`):v(l)?l:$e(l,this._locale,this._locales)(r,t==null?void 0:t.formats)}date(e,r){return A(this._locales||this._locale,e,r)}number(e,r){return D(this._locales||this._locale,e,r)}};function He(o={}){return new P(o)}var R=He();var Ze=["en","nb","fi","da","sv"],ie="en",ae=o=>Ze.find(e=>o===e||o.toLowerCase().includes(e))||ie;function Be(){if(typeof window=="undefined"){let o=process.env.NMP_LANGUAGE||Intl.DateTimeFormat().resolvedOptions().locale;return ae(o)}try{let o=document.documentElement.lang;return ae(o)}catch(o){return console.warn("could not detect locale, falling back to source locale",o),ie}}var Je=(o,e,r,t,a,i)=>o==="nb"?r:o==="fi"?t:o==="da"?a:o==="sv"?i:e,ne=(o,e,r,t,a)=>{let i=Be(),n=Je(i,o,e,r,t,a);R.load(i,n),R.activate(i)};var se=JSON.parse('{"slider.error.overlap":["Maksimumv\xE6rdien m\xE5 ikke v\xE6re mindre end minimumv\xE6rdien"],"slider.error.required":["Dette felt er p\xE5kr\xE6vet"],"slider.error.out_of_bounds":["V\xE6rdien skal v\xE6re mellem ",["min"]," og ",["max"]]}');var le=JSON.parse('{"slider.error.overlap":["The maximum value cannot be less than the minimum"],"slider.error.required":["This field is required"],"slider.error.out_of_bounds":["Value must be between ",["min"]," and ",["max"]]}');var de=JSON.parse('{"slider.error.overlap":["Maksimiarvo ei voi olla pienempi kuin minimiarvo"],"slider.error.required":["T\xE4m\xE4 kentt\xE4 on pakollinen"],"slider.error.out_of_bounds":["Arvon on oltava v\xE4lill\xE4 ",["min"]," - ",["max"]]}');var ce=JSON.parse('{"slider.error.overlap":["Maksimumsverdien kan ikke v\xE6re mindre enn minimumsverdien"],"slider.error.required":["Dette feltet er p\xE5krevd"],"slider.error.out_of_bounds":["Verdien m\xE5 v\xE6re mellom ",["min"]," og ",["max"]]}');var be=JSON.parse('{"slider.error.overlap":["Maxv\xE4rdet kan inte vara mindre \xE4n minimiv\xE4rdet"],"slider.error.required":["Detta f\xE4lt \xE4r obligatoriskt"],"slider.error.out_of_bounds":["V\xE4rdet m\xE5ste vara mellan ",["min"]," och ",["max"]]}');import{css as ge}from"lit";var pe=ge`
2
11
  *,
3
12
  :before,
4
13
  :after {
@@ -271,7 +280,7 @@ var ae=Object.defineProperty;var ie=Object.getOwnPropertyDescriptor;var W=l=>{th
271
280
  svg {
272
281
  pointer-events: none;
273
282
  }
274
- `,be=G`*, :before, :after {
283
+ `,cr=ge`*, :before, :after {
275
284
  --w-rotate: 0;
276
285
  --w-rotate-x: 0;
277
286
  --w-rotate-y: 0;
@@ -2437,7 +2446,7 @@ var ae=Object.defineProperty;var ie=Object.getOwnPropertyDescriptor;var W=l=>{th
2437
2446
  display: none
2438
2447
  }
2439
2448
  }
2440
- `;import{css as ne}from"lit";var D=ne`
2449
+ `;import{css as Ge}from"lit";var ue=Ge`
2441
2450
  .w-slider {
2442
2451
  position: relative;
2443
2452
  border: none;
@@ -2616,40 +2625,41 @@ var ae=Object.defineProperty;var ie=Object.getOwnPropertyDescriptor;var W=l=>{th
2616
2625
  bottom: 0;
2617
2626
  grid-area: slider;
2618
2627
  }
2619
- `;var c,_,Q,ee,re,N,q,d=class extends B(J){constructor(){super(...arguments);U(this,c);this.disabled=!1;this.allowValuesOutsideRange=!1;this.error="";this.helpText="";this.invalid=!1;this.required=!1;this.suffix="";this._invalidMessage="";this._hasInternalError=!1}get edgeMin(){return this.allowValuesOutsideRange?(Number(this.min)-1).toString():this.min}get edgeMax(){return this.allowValuesOutsideRange?(Number(this.max)+1).toString():this.max}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.step&&this.style.setProperty("--step",String(this.step)),this.style.setProperty("--min",this.edgeMin),this.style.setProperty("--max",this.max),this.markers&&this.style.setProperty("--markers",String(this.markers)),v(this,c,_).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")||e.has("_invalidMessage")||e.has("_hasInternalError"))&&v(this,c,_).call(this)}get componentHasError(){return this.invalid||this._hasInternalError}get errorText(){return this.componentHasError?this.error||this._invalidMessage:""}render(){return E`
2628
+ `;var c,_,ve,fe,we,$,F,d=class extends he{constructor(){super();Z(this,c);this.disabled=!1;this.allowValuesOutsideRange=!1;this.error="";this.helpText="";this.invalid=!1;this.required=!1;this.suffix="";this._invalidMessage="";this._hasInternalError=!1;ne(le,ce,de,se,be)}get edgeMin(){return this.allowValuesOutsideRange?(Number(this.min)-1).toString():this.min}get edgeMax(){return this.allowValuesOutsideRange?(Number(this.max)+1).toString():this.max}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.step&&this.style.setProperty("--step",String(this.step)),this.style.setProperty("--min",this.edgeMin),this.style.setProperty("--max",this.max),this.markers&&this.style.setProperty("--markers",String(this.markers)),p(this,c,_).call(this)}updated(r){(r.has("disabled")||r.has("invalid")||r.has("required")||r.has("min")||r.has("step")||r.has("max")||r.has("suffix")||r.has("formatter")||r.has("_invalidMessage")||r.has("_hasInternalError"))&&p(this,c,_).call(this)}get componentHasError(){return this.invalid||this._hasInternalError}get errorText(){return this.componentHasError?this.error||this._invalidMessage:""}render(){return z`
2620
2629
  <fieldset
2621
2630
  id="fieldset"
2622
2631
  class="w-slider"
2623
- @input="${v(this,c,Q)}"
2624
- @slidervalidity="${v(this,c,re)}"
2625
- aria-invalid="${this.errorText?"true":j}"
2632
+ @input="${p(this,c,ve)}"
2633
+ @slidervalidity="${p(this,c,we)}"
2634
+ aria-invalid="${this.errorText?"true":S}"
2626
2635
  >
2627
- ${this.label?E`<legend class="w-slider__label">
2636
+ ${this.label?z`<legend class="w-slider__label">
2628
2637
  <slot id="label" name="label">${this.label}</slot>
2629
- </legend>`:j}
2638
+ </legend>`:S}
2630
2639
  <slot class="w-slider__description" name="description"></slot>
2631
- ${this.markers?E`<div class="w-slider__markers"></div>`:j}
2640
+ ${this.markers?z`<div class="w-slider__markers"></div>`:S}
2632
2641
  <div class="w-slider__range">
2633
2642
  <div class="w-slider__active-range"></div>
2634
2643
  </div>
2635
2644
  <slot
2636
2645
  class="w-slider__slider"
2637
- @slotchange=${v(this,c,_)}
2646
+ @slotchange=${p(this,c,_)}
2638
2647
  ></slot>
2639
2648
  <slot
2640
2649
  class="w-slider__slider"
2641
2650
  name="from"
2642
- @slotchange=${v(this,c,_)}
2651
+ @slotchange=${p(this,c,_)}
2643
2652
  ></slot>
2644
2653
  <slot
2645
2654
  class="w-slider__slider"
2646
2655
  name="to"
2647
- @slotchange=${v(this,c,_)}
2656
+ @slotchange=${p(this,c,_)}
2648
2657
  ></slot>
2649
- ${this.errorText?E`<p class="w-slider__error" aria-describes="fieldset">
2658
+ ${this.errorText?z`<p class="w-slider__error" aria-describes="fieldset">
2650
2659
  ${this.errorText}
2651
- </p>`:this.helpText?E`<p class="w-slider__help-text" aria-describes="fieldset">
2652
- ${this.helpText}</p>`:j}
2660
+ </p>`:this.helpText?z`<p class="w-slider__help-text" aria-describes="fieldset">
2661
+ ${this.helpText}
2662
+ </p>`:S}
2653
2663
  </fieldset>
2654
- `}};c=new WeakSet,_=function(){let e=this.querySelectorAll("w-slider-thumb"),r=!1;for(let a of e.values())a.min=this.edgeMin,a.max=this.edgeMax,a.step=this.step,a.suffix=this.suffix,a.required=this.required,a.formatter=this.formatter,a.allowValuesOutsideRange=this.allowValuesOutsideRange,a.ariaLabel||(a.slot||(a.ariaLabel=this.label),a.slot==="from"&&(a.ariaLabel=`${this.label} min`),a.slot==="to"&&(a.ariaLabel=`${this.label} max`)),(a.slot==="from"||a.slot==="to")&&(r=!0),a.disabled=this.disabled,a.invalid=this.invalid||this._hasInternalError,v(this,c,q).call(this,a);let n=this.shadowRoot.querySelector("fieldset");r?(n.style.setProperty("--active-range-inline-start-padding","var(--w-slider-thumb-size)"),n.style.setProperty("--active-range-inline-end-padding","var(--w-slider-thumb-size)")):n.style.setProperty("--active-range-border-radius","4px")},Q=function(e){let r=e.target;v(this,c,q).call(this,r),r.slot&&v(this,c,ee).call(this)},ee=function(){let e,r,n=this.querySelectorAll("w-slider-thumb");for(let a of n.values())a.slot==="from"&&(e=a),a.slot==="to"&&(r=a);!e||!r||!e.invalid&&r.invalid},re=function(e){e.stopPropagation(),this._hasInternalError=!!e.detail.invalid,this._invalidMessage=e.detail.invalid},N=function(e,r){return(r.value===void 0||r.value===null)&&(r.value=this.allowValuesOutsideRange?"":e),r.value===""?e:r.value},q=function(e){let r=e.slot;r||this.style.setProperty("--from","0"),r==="from"&&this.style.setProperty("--from",v(this,c,N).call(this,this.edgeMin,e)),(!r||r==="to")&&this.style.setProperty("--to",v(this,c,N).call(this,this.edgeMax,e))},d.shadowRootOptions={...J.shadowRootOptions,delegatesFocus:!0},d.styles=[H,D],p([u({reflect:!0})],d.prototype,"label",2),p([u({type:Boolean,reflect:!0})],d.prototype,"disabled",2),p([u({type:Boolean,attribute:"allow-values-outside-range"})],d.prototype,"allowValuesOutsideRange",2),p([u({type:String,reflect:!0})],d.prototype,"error",2),p([u({type:String,reflect:!0,attribute:"help-text"})],d.prototype,"helpText",2),p([u({type:Boolean,reflect:!0})],d.prototype,"invalid",2),p([u({type:Boolean,reflect:!0})],d.prototype,"required",2),p([u({reflect:!0})],d.prototype,"min",2),p([u({reflect:!0})],d.prototype,"max",2),p([u({type:Number,reflect:!0})],d.prototype,"markers",2),p([u({type:Number,reflect:!0})],d.prototype,"step",2),p([u({reflect:!0})],d.prototype,"suffix",2),p([u({attribute:!1})],d.prototype,"formatter",2),p([K()],d.prototype,"_invalidMessage",2),p([K()],d.prototype,"_hasInternalError",2);customElements.get("w-slider")||customElements.define("w-slider",d);export{d as WarpSlider};
2664
+ `}};c=new WeakSet,_=function(){let r=this.querySelectorAll("w-slider-thumb"),t=!1;for(let i of r.values())i.min=this.edgeMin,i.max=this.edgeMax,i.step=this.step,i.suffix=this.suffix,i.required=this.required,i.formatter=this.formatter,i.allowValuesOutsideRange=this.allowValuesOutsideRange,i.ariaLabel||(i.slot||(i.ariaLabel=this.label),i.slot==="from"&&(i.ariaLabel=`${this.label} min`),i.slot==="to"&&(i.ariaLabel=`${this.label} max`)),(i.slot==="from"||i.slot==="to")&&(t=!0),i.disabled=this.disabled,i.invalid=this.invalid||this._hasInternalError,p(this,c,F).call(this,i);let a=this.shadowRoot.querySelector("fieldset");t?(a.style.setProperty("--active-range-inline-start-padding","var(--w-slider-thumb-size)"),a.style.setProperty("--active-range-inline-end-padding","var(--w-slider-thumb-size)")):a.style.setProperty("--active-range-border-radius","4px")},ve=function(r){let t=r.target;p(this,c,F).call(this,t),t.slot&&p(this,c,fe).call(this)},fe=function(){let r,t,a=this.querySelectorAll("w-slider-thumb");for(let i of a.values())i.slot==="from"&&(r=i),i.slot==="to"&&(t=i);!r||!t||!r.invalid&&t.invalid},we=function(r){r.stopPropagation(),this._hasInternalError=!!r.detail.invalid,this._invalidMessage=r.detail.invalid},$=function(r,t){return(t.value===void 0||t.value===null)&&(t.value=this.allowValuesOutsideRange?"":r),t.value===""?r:t.value},F=function(r){let t=r.slot;t||this.style.setProperty("--from","0"),t==="from"&&this.style.setProperty("--from",p(this,c,$).call(this,this.edgeMin,r)),(!t||t==="to")&&this.style.setProperty("--to",p(this,c,$).call(this,this.edgeMax,r))},d.shadowRootOptions={...he.shadowRootOptions,delegatesFocus:!0},d.styles=[pe,ue],b([u({reflect:!0})],d.prototype,"label",2),b([u({type:Boolean,reflect:!0})],d.prototype,"disabled",2),b([u({type:Boolean,attribute:"allow-values-outside-range"})],d.prototype,"allowValuesOutsideRange",2),b([u({type:String,reflect:!0})],d.prototype,"error",2),b([u({type:String,reflect:!0,attribute:"help-text"})],d.prototype,"helpText",2),b([u({type:Boolean,reflect:!0})],d.prototype,"invalid",2),b([u({type:Boolean,reflect:!0})],d.prototype,"required",2),b([u({reflect:!0})],d.prototype,"min",2),b([u({reflect:!0})],d.prototype,"max",2),b([u({type:Number,reflect:!0})],d.prototype,"markers",2),b([u({type:Number,reflect:!0})],d.prototype,"step",2),b([u({reflect:!0})],d.prototype,"suffix",2),b([u({attribute:!1})],d.prototype,"formatter",2),b([me()],d.prototype,"_invalidMessage",2),b([me()],d.prototype,"_hasInternalError",2);customElements.get("w-slider")||customElements.define("w-slider",d);export{d as WarpSlider};
2655
2665
  //# sourceMappingURL=slider.js.map