@warp-ds/elements 2.4.0-next.1 → 2.4.0-next.3
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 +30 -30
- package/dist/index.d.ts +6 -10
- package/dist/packages/combobox/combobox.react.stories.d.ts +1 -1
- package/dist/packages/combobox/combobox.test.d.ts +2 -0
- package/dist/packages/combobox/combobox.test.js +21 -0
- package/dist/packages/combobox/index.d.ts +2 -4
- package/dist/packages/combobox/index.js +9 -8
- package/dist/packages/combobox/index.js.map +2 -2
- package/dist/packages/slider/slider.js +18 -51
- package/dist/packages/slider/slider.js.map +2 -2
- package/dist/packages/slider/slider.stories.js +8 -8
- package/dist/packages/slider/styles/w-slider.styles.js +13 -46
- package/dist/packages/textfield/index.d.ts +1 -0
- package/dist/packages/textfield/index.js +18 -17
- package/dist/packages/textfield/index.js.map +2 -2
- package/dist/packages/textfield/textfield.react.stories.d.ts +1 -1
- package/dist/packages/textfield/textfield.test.js +9 -0
- package/dist/web-types.json +16 -21
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var ke=Object.create;var
|
|
2
|
-
`],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function De(o){return
|
|
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 H=o=>{throw TypeError(o)};var U=(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,s;i>=0;i--)(s=o[i])&&(a=(t?s(e,r,a):s(a))||a);return t&&a&&I(e,r,a),a};var Te=(o,e,r)=>e.has(o)||H("Cannot "+r);var Z=(o,e,r)=>e.has(o)?H("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,r);var p=(o,e,r)=>(Te(o,e,"access private method"),r);var B=U(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=U(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 Ce(o){return!o.match(/[^a-f0-9]/i)?parseInt(o,16):NaN}function T(o,e,r){let t=Ce(o);if(Number.isNaN(t)||r!==void 0&&r!==o.length)throw new SyntaxError(g.errorMessages.get(e));return t}function Oe(o){let e=T(o,g.ErrorType.MalformedHexadecimal,2);return String.fromCharCode(e)}function J(o,e){let r=T(o,g.ErrorType.MalformedUnicode,4);if(e!==void 0){let t=T(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=T(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,s,n,l,h,f){if(t!==void 0)return"\\";if(a!==void 0)return Oe(a);if(i!==void 0)return Le(i);if(s!==void 0)return J(s,n);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 C(()=>O("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 C(()=>O("number",t,r),()=>new Intl.NumberFormat(t,r)).format(e)}function W(o,e,r,{offset:t=0,...a}){var n,l;let i=Y(o),s=e?C(()=>O("plural-ordinal",i),()=>new Intl.PluralRules(i,{type:"ordinal"})):C(()=>O("plural-cardinal",i),()=>new Intl.PluralRules(i,{type:"cardinal"}));return(l=(n=a[r])!=null?n:a[s.select(r-t)])!=null?l:a.other}function C(o,e){let r=o(),t=Q.get(r);return t||(t=e(),Q.set(r,t)),t}function O(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=s=>typeof s=="object"?s:r[s],i=(s,n)=>{let l=Object.keys(r).length?a("number"):void 0,h=D(t,s,l);return n.replace(new RegExp(te,"g"),h)};return{plural:(s,n)=>{let{offset:l=0}=n,h=W(t,!1,s,n);return i(s-l,h)},selectordinal:(s,n)=>{let{offset:l=0}=n,h=W(t,!0,s,n);return i(s-l,h)},select:Fe,number:(s,n)=>D(t,s,a(n)||{style:n}),date:(s,n)=>A(t,s,a(n)||n),time:(s,n)=>Ye(t,s,a(n)||n)}},Fe=(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),s=(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]=s(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,n=s(o);return v(n)&&oe.test(n)?(0,ee.unraw)(n):v(n)?n:n?String(n):""}}var Re=Object.defineProperty,qe=(o,e,r)=>e in o?Re(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,He=(o,e,r)=>e in o?Xe(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,k=(o,e,r)=>(He(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],s=i===void 0,n=this._missing;if(n&&s)return Pe(n)?n(this._locale,e):n;s&&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
3
|
|
|
4
4
|
> ${l}
|
|
5
5
|
|
|
@@ -7,7 +7,7 @@ That means you use raw catalog or your catalog doesn't have a translation for th
|
|
|
7
7
|
ICU features such as interpolation and plurals will not work properly for that message.
|
|
8
8
|
|
|
9
9
|
Please compile your catalog first.
|
|
10
|
-
`)),v(l)&&oe.test(l)?JSON.parse(`"${l}"`):v(l)?l
|
|
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 Ue(o={}){return new P(o)}var F=Ue();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,se=(o,e,r,t,a)=>{let i=Be(),s=Je(i,o,e,r,t,a);F.load(i,s),F.activate(i)};var ne=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`
|
|
11
11
|
*,
|
|
12
12
|
:before,
|
|
13
13
|
:after {
|
|
@@ -2473,42 +2473,6 @@ Please compile your catalog first.
|
|
|
2473
2473
|
--w-slider-thumb-offset: calc(var(--w-slider-thumb-size) / 2);
|
|
2474
2474
|
--w-slider-marker-color: var(--w-s-color-border);
|
|
2475
2475
|
|
|
2476
|
-
/* Math corner to calculate the fill of the slider and placement of markers. */
|
|
2477
|
-
|
|
2478
|
-
/* The --min value can be non-zero, f. ex. choosing a year from 1950 to 2025. Normalize the values so we start at 0 and run to max - min. */
|
|
2479
|
-
--_value-range: calc(var(--max) - var(--min));
|
|
2480
|
-
|
|
2481
|
-
/** Round up to the nearest --step, which defaults to 1 (https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input/range#step) */
|
|
2482
|
-
--_from-in-range: round(
|
|
2483
|
-
up,
|
|
2484
|
-
max(calc(var(--from) - var(--min)), 0),
|
|
2485
|
-
var(--step, 1)
|
|
2486
|
-
);
|
|
2487
|
-
|
|
2488
|
-
/* limit to maximum value in range so typing a value larger than max doesn't explode layouts */
|
|
2489
|
-
--_to-in-range: round(
|
|
2490
|
-
up,
|
|
2491
|
-
min(calc(var(--to) - var(--min)), var(--_value-range)),
|
|
2492
|
-
var(--step, 1)
|
|
2493
|
-
);
|
|
2494
|
-
|
|
2495
|
-
/* Position the starting point of the fill in the case of a non-zero --from value in a range slider.
|
|
2496
|
-
* In other words, given a width of 100% how many percent should be left unfilled/blank
|
|
2497
|
-
* at the beginning of the range slider (dashes in this ASCII-range-slider: |---O******O|) */
|
|
2498
|
-
--_from-as-percent-of-max: calc(
|
|
2499
|
-
var(--_from-in-range) / var(--_value-range) * 100
|
|
2500
|
-
);
|
|
2501
|
-
--_blank-values-before: var(--_from-as-percent-of-max);
|
|
2502
|
-
|
|
2503
|
-
/* Set the width of the fill as a percentage.
|
|
2504
|
-
* In other words, given a width of 100% how many percent should be left unfilled/blank
|
|
2505
|
-
* at the end of the slider (dashes in this ASCII-slider: |******O---|) */
|
|
2506
|
-
--_to-as-percent-of-max: calc(
|
|
2507
|
-
var(--_to-in-range) / var(--_value-range) * 100
|
|
2508
|
-
);
|
|
2509
|
-
--_filled-values: calc(
|
|
2510
|
-
var(--_to-as-percent-of-max) - var(--_blank-values-before)
|
|
2511
|
-
);
|
|
2512
2476
|
|
|
2513
2477
|
/* Vertical position of range and markers */
|
|
2514
2478
|
--_range-top: calc(
|
|
@@ -2559,16 +2523,19 @@ Please compile your catalog first.
|
|
|
2559
2523
|
border-start-start-radius: var(--active-range-border-radius, 0);
|
|
2560
2524
|
border-end-start-radius: var(--active-range-border-radius, 0);
|
|
2561
2525
|
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
);
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
);
|
|
2526
|
+
/* takes over-under into the calculation if set, as this makes the ranges longer in reality */
|
|
2527
|
+
--max-with-offset: calc(var(--max) + var(--over-under-offset, 0));
|
|
2528
|
+
|
|
2529
|
+
/* calculate the offset for the "from" thumb in percentage to move the range visualisation from the left edge, using max() to avoid going off screen */
|
|
2530
|
+
--offset-percentage: calc(calc(var(--from) - var(--min)) / calc(var(--max-with-offset) - var(--min)) * 100);
|
|
2531
|
+
margin-left: calc(max(var(--offset-percentage) * 1%, 0px) - 1px);
|
|
2532
|
+
|
|
2533
|
+
/* calculate the width of the selected range in percentage, clamped between min/max */
|
|
2534
|
+
--value-range: calc(var(--max-with-offset) - var(--min));
|
|
2535
|
+
--range-span-percentage: calc(calc(min(var(--to), var(--max-with-offset)) - max(var(--min), var(--from))) / var(--value-range) * 100 );
|
|
2536
|
+
width: calc(var(--range-span-percentage) * 1% + 1px);
|
|
2537
|
+
|
|
2538
|
+
|
|
2572
2539
|
z-index: 1;
|
|
2573
2540
|
}
|
|
2574
2541
|
|
|
@@ -2625,7 +2592,7 @@ Please compile your catalog first.
|
|
|
2625
2592
|
bottom: 0;
|
|
2626
2593
|
grid-area: slider;
|
|
2627
2594
|
}
|
|
2628
|
-
`;var c,_,ve,fe,we,
|
|
2595
|
+
`;var c,_,ve,fe,we,$,R,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;se(le,ce,de,ne,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)),this.allowValuesOutsideRange&&this.style.setProperty("--over-under-offset","1"),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`
|
|
2629
2596
|
<fieldset
|
|
2630
2597
|
id="fieldset"
|
|
2631
2598
|
class="w-slider"
|
|
@@ -2661,5 +2628,5 @@ Please compile your catalog first.
|
|
|
2661
2628
|
${this.helpText}
|
|
2662
2629
|
</p>`:S}
|
|
2663
2630
|
</fieldset>
|
|
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
|
|
2631
|
+
`}};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,R).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,R).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();let t=this._hasInternalError||this.invalid,a=r.target;if(this._hasInternalError=!!r.detail.invalid||this.invalid,this._invalidMessage=r.detail.invalid,t===!0&&this._hasInternalError===!1){let i=this.querySelectorAll("w-slider-thumb");for(let s of i.values())s!==a&&s.updateFieldAfterValidation()}},$=function(r,t){return(t.value===void 0||t.value===null)&&(t.value=this.allowValuesOutsideRange?"":r),t.value===""?r:t.value},R=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};
|
|
2665
2632
|
//# sourceMappingURL=slider.js.map
|