@warp-ds/elements 2.7.0-next.2 → 2.8.0-next.1
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 +8 -0
- package/dist/index.d.ts +6 -0
- package/dist/packages/slider/slider.d.ts +2 -0
- package/dist/packages/slider/slider.js +4 -4
- package/dist/packages/slider/slider.js.map +2 -2
- package/dist/packages/slider/slider.test.js +33 -0
- package/dist/packages/slider-thumb/slider-thumb.d.ts +2 -0
- package/dist/packages/slider-thumb/slider-thumb.js +20 -20
- package/dist/packages/slider-thumb/slider-thumb.js.map +2 -2
- package/dist/web-types.json +6 -1
- package/package.json +1 -1
|
@@ -6889,6 +6889,14 @@
|
|
|
6889
6889
|
},
|
|
6890
6890
|
"description": "Formatter for the tooltip and input mask values."
|
|
6891
6891
|
},
|
|
6892
|
+
{
|
|
6893
|
+
"kind": "field",
|
|
6894
|
+
"name": "tooltipFormatter",
|
|
6895
|
+
"type": {
|
|
6896
|
+
"text": "(value: string, slot: SliderSlot) => string"
|
|
6897
|
+
},
|
|
6898
|
+
"description": "Replaces valueFormatter for the tooltip. Use in open-ended sliders to show for example \"300+ hk\" instead of \"Max\" in the tooltip."
|
|
6899
|
+
},
|
|
6892
6900
|
{
|
|
6893
6901
|
"kind": "field",
|
|
6894
6902
|
"name": "labelFormatter",
|
package/dist/index.d.ts
CHANGED
|
@@ -1625,6 +1625,8 @@ If you need to display HTML, use the `label` slot instead (f. ex. `<legend class
|
|
|
1625
1625
|
hiddenTextfield?: WarpSlider["hiddenTextfield"];
|
|
1626
1626
|
/** Formatter for the tooltip and input mask values. */
|
|
1627
1627
|
valueFormatter?: WarpSlider["valueFormatter"];
|
|
1628
|
+
/** Replaces valueFormatter for the tooltip. Use in open-ended sliders to show for example "300+ hk" instead of "Max" in the tooltip. */
|
|
1629
|
+
tooltipFormatter?: WarpSlider["tooltipFormatter"];
|
|
1628
1630
|
/** Formatter for the min and max labels below the range. */
|
|
1629
1631
|
labelFormatter?: WarpSlider["labelFormatter"];
|
|
1630
1632
|
/** */
|
|
@@ -1674,6 +1676,8 @@ If you need to display HTML, use the `label` slot instead (f. ex. `<legend class
|
|
|
1674
1676
|
"prop:hiddenTextfield"?: WarpSlider["hiddenTextfield"];
|
|
1675
1677
|
/** Formatter for the tooltip and input mask values. */
|
|
1676
1678
|
"prop:valueFormatter"?: WarpSlider["valueFormatter"];
|
|
1679
|
+
/** Replaces valueFormatter for the tooltip. Use in open-ended sliders to show for example "300+ hk" instead of "Max" in the tooltip. */
|
|
1680
|
+
"prop:tooltipFormatter"?: WarpSlider["tooltipFormatter"];
|
|
1677
1681
|
/** Formatter for the min and max labels below the range. */
|
|
1678
1682
|
"prop:labelFormatter"?: WarpSlider["labelFormatter"];
|
|
1679
1683
|
/** */
|
|
@@ -2567,6 +2571,7 @@ export type CustomElements = {
|
|
|
2567
2571
|
* - `suffix`: Suffix used in text input fields and for the min and max values of the slider.
|
|
2568
2572
|
* - `hidden-textfield`/`hiddenTextfield`: undefined
|
|
2569
2573
|
* - `valueFormatter`: Formatter for the tooltip and input mask values. (property only)
|
|
2574
|
+
* - `tooltipFormatter`: Replaces valueFormatter for the tooltip. Use in open-ended sliders to show for example "300+ hk" instead of "Max" in the tooltip. (property only)
|
|
2570
2575
|
* - `labelFormatter`: Formatter for the min and max labels below the range. (property only)
|
|
2571
2576
|
* - `_invalidMessage`: undefined (property only)
|
|
2572
2577
|
* - `_hasInternalError`: undefined (property only)
|
|
@@ -3555,6 +3560,7 @@ export type CustomElementsSolidJs = {
|
|
|
3555
3560
|
* - `suffix`: Suffix used in text input fields and for the min and max values of the slider.
|
|
3556
3561
|
* - `hidden-textfield`/`hiddenTextfield`: undefined
|
|
3557
3562
|
* - `valueFormatter`: Formatter for the tooltip and input mask values. (property only)
|
|
3563
|
+
* - `tooltipFormatter`: Replaces valueFormatter for the tooltip. Use in open-ended sliders to show for example "300+ hk" instead of "Max" in the tooltip. (property only)
|
|
3558
3564
|
* - `labelFormatter`: Formatter for the min and max labels below the range. (property only)
|
|
3559
3565
|
* - `_invalidMessage`: undefined (property only)
|
|
3560
3566
|
* - `_hasInternalError`: undefined (property only)
|
|
@@ -46,6 +46,8 @@ declare class WarpSlider extends LitElement {
|
|
|
46
46
|
hiddenTextfield: boolean;
|
|
47
47
|
/** Formatter for the tooltip and input mask values. */
|
|
48
48
|
valueFormatter: (value: string, slot: SliderSlot) => string;
|
|
49
|
+
/** Replaces {@link valueFormatter} for the tooltip. Use in open-ended sliders to show for example "300+ hk" instead of "Max" in the tooltip. */
|
|
50
|
+
tooltipFormatter: (value: string, slot: SliderSlot) => string;
|
|
49
51
|
/** Formatter for the min and max labels below the range. */
|
|
50
52
|
labelFormatter: (slot: SliderSlot) => string;
|
|
51
53
|
_invalidMessage: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var Se=Object.create;var A=Object.defineProperty;var Z=Object.getOwnPropertyDescriptor;var Le=Object.getOwnPropertyNames;var Ce=Object.getPrototypeOf,
|
|
2
|
-
`],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function $e(o){return Ye.get(o)||o}var Re=/\\(?:(\\)|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 W(o,e=!1){return o.replace(Re,function(r,t,a,i,n,s,l,h,x){if(t!==void 0)return"\\";if(a!==void 0)return Ie(a);if(i!==void 0)return je(i);if(n!==void 0)return Q(n,s);if(l!==void 0)return Q(l);if(h==="0")return"\0";if(h!==void 0)return Pe(h,!e);if(x!==void 0)return $e(x);throw new SyntaxError(
|
|
1
|
+
var Se=Object.create;var A=Object.defineProperty;var Z=Object.getOwnPropertyDescriptor;var Le=Object.getOwnPropertyNames;var Ce=Object.getPrototypeOf,Fe=Object.prototype.hasOwnProperty;var B=o=>{throw TypeError(o)};var J=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports);var Oe=(o,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Le(e))!Fe.call(o,a)&&a!==r&&A(o,a,{get:()=>e[a],enumerable:!(t=Z(e,a))||t.enumerable});return o};var Ne=(o,e,r)=>(r=o!=null?Se(Ce(o)):{},Oe(e||!o||!o.__esModule?A(r,"default",{value:o,enumerable:!0}):r,o));var b=(o,e,r,t)=>{for(var a=t>1?void 0:t?Z(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&&A(e,r,a),a};var De=(o,e,r)=>e.has(o)||B("Cannot "+r);var G=(o,e,r)=>e.has(o)?B("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,r);var u=(o,e,r)=>(De(o,e,"access private method"),r);var K=J(y=>{"use strict";Object.defineProperty(y,"__esModule",{value:!0});y.errorMessages=y.ErrorType=void 0;var E;(function(o){o.MalformedUnicode="MALFORMED_UNICODE",o.MalformedHexadecimal="MALFORMED_HEXADECIMAL",o.CodePointLimit="CODE_POINT_LIMIT",o.OctalDeprecation="OCTAL_DEPRECATION",o.EndOfString="END_OF_STRING"})(E=y.ErrorType||(y.ErrorType={}));y.errorMessages=new Map([[E.MalformedUnicode,"malformed Unicode character escape sequence"],[E.MalformedHexadecimal,"malformed hexadecimal character escape sequence"],[E.CodePointLimit,"Unicode codepoint must not be greater than 0x10FFFF in escape sequence"],[E.OctalDeprecation,'"0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead'],[E.EndOfString,"malformed escape sequence at end of string"]])});var ee=J(m=>{"use strict";Object.defineProperty(m,"__esModule",{value:!0});m.unraw=m.errorMessages=m.ErrorType=void 0;var g=K();Object.defineProperty(m,"ErrorType",{enumerable:!0,get:function(){return g.ErrorType}});Object.defineProperty(m,"errorMessages",{enumerable:!0,get:function(){return g.errorMessages}});function Ae(o){return!o.match(/[^a-f0-9]/i)?parseInt(o,16):NaN}function S(o,e,r){let t=Ae(o);if(Number.isNaN(t)||r!==void 0&&r!==o.length)throw new SyntaxError(g.errorMessages.get(e));return t}function Ie(o){let e=S(o,g.ErrorType.MalformedHexadecimal,2);return String.fromCharCode(e)}function Q(o,e){let r=S(o,g.ErrorType.MalformedUnicode,4);if(e!==void 0){let t=S(e,g.ErrorType.MalformedUnicode,4);return String.fromCharCode(r,t)}return String.fromCharCode(r)}function qe(o){return o.charAt(0)==="{"&&o.charAt(o.length-1)==="}"}function je(o){if(!qe(o))throw new SyntaxError(g.errorMessages.get(g.ErrorType.MalformedUnicode));let e=o.slice(1,-1),r=S(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 Pe(o,e=!1){if(e)throw new SyntaxError(g.errorMessages.get(g.ErrorType.OctalDeprecation));let r=parseInt(o,8);return String.fromCharCode(r)}var Ye=new Map([["b","\b"],["f","\f"],["n",`
|
|
2
|
+
`],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function $e(o){return Ye.get(o)||o}var Re=/\\(?:(\\)|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 W(o,e=!1){return o.replace(Re,function(r,t,a,i,n,s,l,h,x){if(t!==void 0)return"\\";if(a!==void 0)return Ie(a);if(i!==void 0)return je(i);if(n!==void 0)return Q(n,s);if(l!==void 0)return Q(l);if(h==="0")return"\0";if(h!==void 0)return Pe(h,!e);if(x!==void 0)return $e(x);throw new SyntaxError(g.errorMessages.get(g.ErrorType.EndOfString))})}m.unraw=W;m.default=W});import{html as z,LitElement as ke,nothing as R}from"lit";import{property as p,state as O}from"lit/decorators.js";var te=Ne(ee(),1);var f=o=>typeof o=="string",He=o=>typeof o=="function",re=new Map,ae="en";function P(o){return[...Array.isArray(o)?o:[o],ae]}function Y(o,e,r){let t=P(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 L(()=>C("date",t,r),()=>new Intl.DateTimeFormat(t,a)).format(f(e)?new Date(e):e)}function Xe(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 Y(o,e,t)}function I(o,e,r){let t=P(o);return L(()=>C("number",t,r),()=>new Intl.NumberFormat(t,r)).format(e)}function oe(o,e,r,{offset:t=0,...a}){var s,l;let i=P(o),n=e?L(()=>C("plural-ordinal",i),()=>new Intl.PluralRules(i,{type:"ordinal"})):L(()=>C("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 L(o,e){let r=o(),t=re.get(r);return t||(t=e(),re.set(r,t)),t}function C(o,e,r){let t=e.join("-");return`${o}-${t}-${JSON.stringify(r)}`}var ie=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,ne="%__lingui_octothorpe__%",Ue=(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=I(t,n,l);return s.replace(new RegExp(ne,"g"),h)};return{plural:(n,s)=>{let{offset:l=0}=s,h=oe(t,!1,n,s);return i(n-l,h)},selectordinal:(n,s)=>{let{offset:l=0}=s,h=oe(t,!0,n,s);return i(n-l,h)},select:Ve,number:(n,s)=>I(t,n,a(s)||{style:s}),date:(n,s)=>Y(t,n,a(s)||s),time:(n,s)=>Xe(t,n,a(s)||s)}},Ve=(o,e)=>{var r;return(r=e[o])!=null?r:e.other};function Ze(o,e,r){return(t={},a)=>{let i=Ue(e,r,a),n=(l,h=!1)=>Array.isArray(l)?l.reduce((x,M)=>{if(M==="#"&&h)return x+ne;if(f(M))return x+M;let[U,k,V]=M,N={};k==="plural"||k==="selectordinal"||k==="select"?Object.entries(V).forEach(([D,Te])=>{N[D]=n(Te,k==="plural"||k==="selectordinal")}):N=V;let T;if(k){let D=i[k];T=D(t[U],N)}else T=t[U];return T==null?x:x+T},""):l,s=n(o);return f(s)&&ie.test(s)?(0,te.unraw)(s):f(s)?s:s?String(s):""}}var Be=Object.defineProperty,Je=(o,e,r)=>e in o?Be(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,Ge=(o,e,r)=>(Je(o,typeof e!="symbol"?e+"":e,r),r),q=class{constructor(){Ge(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}},Ke=Object.defineProperty,Qe=(o,e,r)=>e in o?Ke(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,_=(o,e,r)=>(Qe(o,typeof e!="symbol"?e+"":e,r),r),j=class extends q{constructor(e){var r;super(),_(this,"_locale",""),_(this,"_locales"),_(this,"_localeData",{}),_(this,"_messages",{}),_(this,"_missing"),_(this,"_messageCompiler"),_(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:ae,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=""),f(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 He(s)?s(this._locale,e):s;n&&this.emit("missing",{id:e,locale:this._locale});let l=i||a||e;return f(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
|
-
`)),f(l)&&ie.test(l)?JSON.parse(`"${l}"`):f(l)?l:Ze(l,this._locale,this._locales)(r,t==null?void 0:t.formats)}date(e,r){return Y(this._locales||this._locale,e,r)}number(e,r){return I(this._locales||this._locale,e,r)}};function We(o={}){return new j(o)}var v=We();var er=["en","nb","fi","da","sv"],$="en",
|
|
10
|
+
`)),f(l)&&ie.test(l)?JSON.parse(`"${l}"`):f(l)?l:Ze(l,this._locale,this._locales)(r,t==null?void 0:t.formats)}date(e,r){return Y(this._locales||this._locale,e,r)}number(e,r){return I(this._locales||this._locale,e,r)}};function We(o={}){return new j(o)}var v=We();var er=["en","nb","fi","da","sv"],$="en",F=o=>er.find(e=>o===e||o.toLowerCase().includes(e))||$;function de(){if(typeof window=="undefined"){let o=process.env.NMP_LANGUAGE||Intl.DateTimeFormat().resolvedOptions().locale;return F(o)}try{let o=le(document);if(o)return F(o);let e=ar();if(e)return F(e);let r=le(ue());return r?F(r):$}catch(o){return console.warn("could not detect locale, falling back to source locale",o),$}}var ce=(o,e,r,t,a)=>{v.load("en",o),v.load("nb",e),v.load("fi",r),v.load("da",t),v.load("sv",a);let i=de();v.activate(i),be(),or()},rr="warp-i18n-change";function be(){typeof window!="undefined"&&window.dispatchEvent(new Event(rr))}var se=!1;function or(){if(se||typeof window=="undefined"||!(document!=null&&document.documentElement))return;se=!0;let o=()=>{let a=de();v.locale!==a&&(v.activate(a),be())},e=new MutationObserver(a=>{for(let i of a)if(i.type==="attributes"&&i.attributeName==="lang"){o();break}});e.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"]});let r=ue();r&&r.documentElement&&r!==document&&e.observe(r.documentElement,{attributes:!0,attributeFilter:["lang"]});let t=tr();t&&e.observe(t,{attributes:!0,attributeFilter:["lang"]})}function ue(){var o,e;try{return(e=(o=window.parent)==null?void 0:o.document)!=null?e:null}catch(r){return null}}function le(o){var e,r;try{return(r=(e=o==null?void 0:o.documentElement)==null?void 0:e.lang)!=null?r:""}catch(t){return""}}function tr(){var o;try{return(o=window.frameElement)!=null?o:null}catch(e){return null}}function ar(){var o,e,r;try{return(r=(e=(o=window.frameElement)==null?void 0:o.getAttribute)==null?void 0:e.call(o,"lang"))!=null?r:""}catch(t){return""}}import{css as pe}from"lit";var ge=pe`
|
|
11
11
|
*,
|
|
12
12
|
:before,
|
|
13
13
|
:after {
|
|
@@ -2637,5 +2637,5 @@ Please compile your catalog first.
|
|
|
2637
2637
|
${this.helpText}
|
|
2638
2638
|
</p>`:R}
|
|
2639
2639
|
</fieldset>
|
|
2640
|
-
`}};d=new WeakSet,w=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.labelFormatter=this.labelFormatter,i.valueFormatter=this.valueFormatter,i.openEnded=this.openEnded,i._hiddenTextfield=this.hiddenTextfield,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.errorText,u(this,d,X).call(this,i);let a=this.shadowRoot.querySelector("fieldset");t?(a.style.setProperty("--active-range-inline-start-padding","var(--w-slider-thumb-size, 28px)"),a.style.setProperty("--active-range-inline-end-padding","var(--w-slider-thumb-size, 28px)")):a.style.setProperty("--active-range-border-radius","4px")},ye=function(r){let t=r.target;u(this,d,X).call(this,t),t.slot&&u(this,d,ze).call(this)},_e=function(){this.componentHasError?this._showError=!0:this._showError=!1,u(this,d,w).call(this)},Ee=function(r){if(r.key==="Tab"){let t=this._tabbableElements.indexOf(r.target.shadowRoot.activeElement);if(t===-1)return;let a=r.shiftKey?-1:1,i=this._tabbableElements[t+a];if(!i)return;r.preventDefault(),i.focus()}},ze=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},Me=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 n of i.values())n!==a&&n.updateFieldAfterValidation()}},H=function(r,t){return(t.value===void 0||t.value===null)&&(t.value=this.openEnded?"":r),t.value===""?r:t.value},X=function(r){let t=r.slot;t||this.style.setProperty("--from","0"),t==="from"&&this.style.setProperty("--from",u(this,d,H).call(this,this.edgeMin,r)),(!t||t==="to")&&this.style.setProperty("--to",u(this,d,H).call(this,this.edgeMax,r))},c.shadowRootOptions={...ke.shadowRootOptions,delegatesFocus:!0},c.styles=[ge,xe],b([
|
|
2640
|
+
`}};d=new WeakSet,w=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.labelFormatter=this.labelFormatter,i.valueFormatter=this.valueFormatter,i.tooltipFormatter=this.tooltipFormatter,i.openEnded=this.openEnded,i._hiddenTextfield=this.hiddenTextfield,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.errorText,u(this,d,X).call(this,i);let a=this.shadowRoot.querySelector("fieldset");t?(a.style.setProperty("--active-range-inline-start-padding","var(--w-slider-thumb-size, 28px)"),a.style.setProperty("--active-range-inline-end-padding","var(--w-slider-thumb-size, 28px)")):a.style.setProperty("--active-range-border-radius","4px")},ye=function(r){let t=r.target;u(this,d,X).call(this,t),t.slot&&u(this,d,ze).call(this)},_e=function(){this.componentHasError?this._showError=!0:this._showError=!1,u(this,d,w).call(this)},Ee=function(r){if(r.key==="Tab"){let t=this._tabbableElements.indexOf(r.target.shadowRoot.activeElement);if(t===-1)return;let a=r.shiftKey?-1:1,i=this._tabbableElements[t+a];if(!i)return;r.preventDefault(),i.focus()}},ze=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},Me=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 n of i.values())n!==a&&n.updateFieldAfterValidation()}},H=function(r,t){return(t.value===void 0||t.value===null)&&(t.value=this.openEnded?"":r),t.value===""?r:t.value},X=function(r){let t=r.slot;t||this.style.setProperty("--from","0"),t==="from"&&this.style.setProperty("--from",u(this,d,H).call(this,this.edgeMin,r)),(!t||t==="to")&&this.style.setProperty("--to",u(this,d,H).call(this,this.edgeMax,r))},c.shadowRootOptions={...ke.shadowRootOptions,delegatesFocus:!0},c.styles=[ge,xe],b([p({reflect:!0})],c.prototype,"label",2),b([p({type:Boolean,reflect:!0})],c.prototype,"disabled",2),b([p({type:Boolean,attribute:"open-ended"})],c.prototype,"openEnded",2),b([p({type:String,reflect:!0})],c.prototype,"error",2),b([p({type:String,reflect:!0,attribute:"help-text"})],c.prototype,"helpText",2),b([p({type:Boolean,reflect:!0})],c.prototype,"invalid",2),b([p({type:Boolean,reflect:!0})],c.prototype,"required",2),b([p({reflect:!0})],c.prototype,"min",2),b([p({reflect:!0})],c.prototype,"max",2),b([p({type:Number,reflect:!0})],c.prototype,"markers",2),b([p({type:Number,reflect:!0})],c.prototype,"step",2),b([p({reflect:!0})],c.prototype,"suffix",2),b([p({type:Boolean,reflect:!0,attribute:"hidden-textfield"})],c.prototype,"hiddenTextfield",2),b([p({attribute:!1})],c.prototype,"valueFormatter",2),b([p({attribute:!1})],c.prototype,"tooltipFormatter",2),b([p({attribute:!1})],c.prototype,"labelFormatter",2),b([O()],c.prototype,"_invalidMessage",2),b([O()],c.prototype,"_hasInternalError",2),b([O()],c.prototype,"_showError",2),b([O()],c.prototype,"_tabbableElements",2);customElements.get("w-slider")||customElements.define("w-slider",c);export{c as WarpSlider};
|
|
2641
2641
|
//# sourceMappingURL=slider.js.map
|