@nuralyui/slider-input 0.0.4 → 0.0.6
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/bundle.js +1 -285
- package/package.json +1 -1
package/bundle.js
CHANGED
|
@@ -1,285 +1 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2019 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/
|
|
6
|
-
const t=window,i=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,r=Symbol(),s=new WeakMap;class l{constructor(t,i,s){if(this._$cssResult$=!0,s!==r)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=i}get styleSheet(){let t=this.o;const r=this.t;if(i&&void 0===t){const i=void 0!==r&&1===r.length;i&&(t=s.get(r)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&s.set(r,t))}return t}toString(){return this.cssText}}const e=(t,...i)=>{const s=1===t.length?t[0]:i.reduce(((i,r,s)=>i+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+t[s+1]),t[0]);return new l(s,t,r)},n=i?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let i="";for(const r of t.cssRules)i+=r.cssText;return(t=>new l("string"==typeof t?t:t+"",void 0,r))(i)})(t):t
|
|
7
|
-
/**
|
|
8
|
-
* @license
|
|
9
|
-
* Copyright 2017 Google LLC
|
|
10
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
|
-
*/;var o;const a=window,u=a.trustedTypes,h=u?u.emptyScript:"",d=a.reactiveElementPolyfillSupport,c={toAttribute(t,i){switch(i){case Boolean:t=t?h:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,i){let r=t;switch(i){case Boolean:r=null!==t;break;case Number:r=null===t?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch(t){r=null}}return r}},v=(t,i)=>i!==t&&(i==i||t==t),p={attribute:!0,type:String,converter:c,reflect:!1,hasChanged:v},y="finalized";class b extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(t){var i;this.finalize(),(null!==(i=this.h)&&void 0!==i?i:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((i,r)=>{const s=this._$Ep(r,i);void 0!==s&&(this._$Ev.set(s,r),t.push(s))})),t}static createProperty(t,i=p){if(i.state&&(i.attribute=!1),this.finalize(),this.elementProperties.set(t,i),!i.noAccessor&&!this.prototype.hasOwnProperty(t)){const r="symbol"==typeof t?Symbol():"__"+t,s=this.getPropertyDescriptor(t,r,i);void 0!==s&&Object.defineProperty(this.prototype,t,s)}}static getPropertyDescriptor(t,i,r){return{get(){return this[i]},set(s){const l=this[t];this[i]=s,this.requestUpdate(t,l,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||p}static finalize(){if(this.hasOwnProperty(y))return!1;this[y]=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,i=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const r of i)this.createProperty(r,t[r])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const i=[];if(Array.isArray(t)){const r=new Set(t.flat(1/0).reverse());for(const t of r)i.unshift(n(t))}else void 0!==t&&i.push(n(t));return i}static _$Ep(t,i){const r=i.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof t?t.toLowerCase():void 0}_$Eu(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var i,r;(null!==(i=this._$ES)&&void 0!==i?i:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(r=t.hostConnected)||void 0===r||r.call(t))}removeController(t){var i;null===(i=this._$ES)||void 0===i||i.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,i)=>{this.hasOwnProperty(i)&&(this._$Ei.set(i,this[i]),delete this[i])}))}createRenderRoot(){var r;const s=null!==(r=this.shadowRoot)&&void 0!==r?r:this.attachShadow(this.constructor.shadowRootOptions);return((r,s)=>{i?r.adoptedStyleSheets=s.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):s.forEach((i=>{const s=document.createElement("style"),l=t.litNonce;void 0!==l&&s.setAttribute("nonce",l),s.textContent=i.cssText,r.appendChild(s)}))})(s,this.constructor.elementStyles),s}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostConnected)||void 0===i?void 0:i.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostDisconnected)||void 0===i?void 0:i.call(t)}))}attributeChangedCallback(t,i,r){this._$AK(t,r)}_$EO(t,i,r=p){var s;const l=this.constructor._$Ep(t,r);if(void 0!==l&&!0===r.reflect){const e=(void 0!==(null===(s=r.converter)||void 0===s?void 0:s.toAttribute)?r.converter:c).toAttribute(i,r.type);this._$El=t,null==e?this.removeAttribute(l):this.setAttribute(l,e),this._$El=null}}_$AK(t,i){var r;const s=this.constructor,l=s._$Ev.get(t);if(void 0!==l&&this._$El!==l){const t=s.getPropertyOptions(l),e="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(r=t.converter)||void 0===r?void 0:r.fromAttribute)?t.converter:c;this._$El=l,this[l]=e.fromAttribute(i,t.type),this._$El=null}}requestUpdate(t,i,r){let s=!0;void 0!==t&&(((r=r||this.constructor.getPropertyOptions(t)).hasChanged||v)(this[t],i)?(this._$AL.has(t)||this._$AL.set(t,i),!0===r.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,r))):s=!1),!this.isUpdatePending&&s&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,i)=>this[i]=t)),this._$Ei=void 0);let i=!1;const r=this._$AL;try{i=this.shouldUpdate(r),i?(this.willUpdate(r),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostUpdate)||void 0===i?void 0:i.call(t)})),this.update(r)):this._$Ek()}catch(t){throw i=!1,this._$Ek(),t}i&&this._$AE(r)}willUpdate(t){}_$AE(t){var i;null===(i=this._$ES)||void 0===i||i.forEach((t=>{var i;return null===(i=t.hostUpdated)||void 0===i?void 0:i.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,i)=>this._$EO(i,this[i],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}
|
|
12
|
-
/**
|
|
13
|
-
* @license
|
|
14
|
-
* Copyright 2017 Google LLC
|
|
15
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
16
|
-
*/
|
|
17
|
-
var f;b[y]=!0,b.elementProperties=new Map,b.elementStyles=[],b.shadowRootOptions={mode:"open"},null==d||d({ReactiveElement:b}),(null!==(o=a.reactiveElementVersions)&&void 0!==o?o:a.reactiveElementVersions=[]).push("1.6.3");const g=window,m=g.trustedTypes,w=m?m.createPolicy("lit-html",{createHTML:t=>t}):void 0,$="$lit$",x=`lit$${(Math.random()+"").slice(9)}$`,k="?"+x,S=`<${k}>`,_=document,A=()=>_.createComment(""),z=t=>null===t||"object"!=typeof t&&"function"!=typeof t,C=Array.isArray,E="[ \t\n\f\r]",M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,N=/-->/g,T=/>/g,U=RegExp(`>|${E}(?:([^\\s"'>=/]+)(${E}*=${E}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),j=/'/g,R=/"/g,O=/^(?:script|style|textarea|title)$/i,I=Symbol.for("lit-noChange"),H=Symbol.for("lit-nothing"),P=new WeakMap,B=_.createTreeWalker(_,129,null,!1);function L(t,i){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==w?w.createHTML(i):i}class D{constructor({strings:t,_$litType$:i},r){let s;this.parts=[];let l=0,e=0;const n=t.length-1,o=this.parts,[a,u]=((t,i)=>{const r=t.length-1,s=[];let l,e=2===i?"<svg>":"",n=M;for(let i=0;i<r;i++){const r=t[i];let o,a,u=-1,h=0;for(;h<r.length&&(n.lastIndex=h,a=n.exec(r),null!==a);)h=n.lastIndex,n===M?"!--"===a[1]?n=N:void 0!==a[1]?n=T:void 0!==a[2]?(O.test(a[2])&&(l=RegExp("</"+a[2],"g")),n=U):void 0!==a[3]&&(n=U):n===U?">"===a[0]?(n=null!=l?l:M,u=-1):void 0===a[1]?u=-2:(u=n.lastIndex-a[2].length,o=a[1],n=void 0===a[3]?U:'"'===a[3]?R:j):n===R||n===j?n=U:n===N||n===T?n=M:(n=U,l=void 0);const d=n===U&&t[i+1].startsWith("/>")?" ":"";e+=n===M?r+S:u>=0?(s.push(o),r.slice(0,u)+$+r.slice(u)+x+d):r+x+(-2===u?(s.push(void 0),i):d)}return[L(t,e+(t[r]||"<?>")+(2===i?"</svg>":"")),s]})(t,i);if(this.el=D.createElement(a,r),B.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(s=B.nextNode())&&o.length<n;){if(1===s.nodeType){if(s.hasAttributes()){const t=[];for(const i of s.getAttributeNames())if(i.endsWith($)||i.startsWith(x)){const r=u[e++];if(t.push(i),void 0!==r){const t=s.getAttribute(r.toLowerCase()+$).split(x),i=/([.?@])?(.*)/.exec(r);o.push({type:1,index:l,name:i[2],strings:t,ctor:"."===i[1]?J:"?"===i[1]?V:"@"===i[1]?G:F})}else o.push({type:6,index:l})}for(const i of t)s.removeAttribute(i)}if(O.test(s.tagName)){const t=s.textContent.split(x),i=t.length-1;if(i>0){s.textContent=m?m.emptyScript:"";for(let r=0;r<i;r++)s.append(t[r],A()),B.nextNode(),o.push({type:2,index:++l});s.append(t[i],A())}}}else if(8===s.nodeType)if(s.data===k)o.push({type:2,index:l});else{let t=-1;for(;-1!==(t=s.data.indexOf(x,t+1));)o.push({type:7,index:l}),t+=x.length-1}l++}}static createElement(t,i){const r=_.createElement("template");return r.innerHTML=t,r}}function W(t,i,r=t,s){var l,e,n,o;if(i===I)return i;let a=void 0!==s?null===(l=r._$Co)||void 0===l?void 0:l[s]:r._$Cl;const u=z(i)?void 0:i._$litDirective$;return(null==a?void 0:a.constructor)!==u&&(null===(e=null==a?void 0:a._$AO)||void 0===e||e.call(a,!1),void 0===u?a=void 0:(a=new u(t),a._$AT(t,r,s)),void 0!==s?(null!==(n=(o=r)._$Co)&&void 0!==n?n:o._$Co=[])[s]=a:r._$Cl=a),void 0!==a&&(i=W(t,a._$AS(t,i.values),a,s)),i}class Z{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var i;const{el:{content:r},parts:s}=this._$AD,l=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:_).importNode(r,!0);B.currentNode=l;let e=B.nextNode(),n=0,o=0,a=s[0];for(;void 0!==a;){if(n===a.index){let i;2===a.type?i=new q(e,e.nextSibling,this,t):1===a.type?i=new a.ctor(e,a.name,a.strings,this,t):6===a.type&&(i=new Q(e,this,t)),this._$AV.push(i),a=s[++o]}n!==(null==a?void 0:a.index)&&(e=B.nextNode(),n++)}return B.currentNode=_,l}v(t){let i=0;for(const r of this._$AV)void 0!==r&&(void 0!==r.strings?(r._$AI(t,r,i),i+=r.strings.length-2):r._$AI(t[i])),i++}}class q{constructor(t,i,r,s){var l;this.type=2,this._$AH=H,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=r,this.options=s,this._$Cp=null===(l=null==s?void 0:s.isConnected)||void 0===l||l}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$Cp}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===(null==t?void 0:t.nodeType)&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=W(this,t,i),z(t)?t===H||null==t||""===t?(this._$AH!==H&&this._$AR(),this._$AH=H):t!==this._$AH&&t!==I&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):(t=>C(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==H&&z(this._$AH)?this._$AA.nextSibling.data=t:this.$(_.createTextNode(t)),this._$AH=t}g(t){var i;const{values:r,_$litType$:s}=t,l="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=D.createElement(L(s.h,s.h[0]),this.options)),s);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===l)this._$AH.v(r);else{const t=new Z(l,this),i=t.u(this.options);t.v(r),this.$(i),this._$AH=t}}_$AC(t){let i=P.get(t.strings);return void 0===i&&P.set(t.strings,i=new D(t)),i}T(t){C(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let r,s=0;for(const l of t)s===i.length?i.push(r=new q(this.k(A()),this.k(A()),this,this.options)):r=i[s],r._$AI(l),s++;s<i.length&&(this._$AR(r&&r._$AB.nextSibling,s),i.length=s)}_$AR(t=this._$AA.nextSibling,i){var r;for(null===(r=this._$AP)||void 0===r||r.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var i;void 0===this._$AM&&(this._$Cp=t,null===(i=this._$AP)||void 0===i||i.call(this,t))}}class F{constructor(t,i,r,s,l){this.type=1,this._$AH=H,this._$AN=void 0,this.element=t,this.name=i,this._$AM=s,this.options=l,r.length>2||""!==r[0]||""!==r[1]?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=H}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,r,s){const l=this.strings;let e=!1;if(void 0===l)t=W(this,t,i,0),e=!z(t)||t!==this._$AH&&t!==I,e&&(this._$AH=t);else{const s=t;let n,o;for(t=l[0],n=0;n<l.length-1;n++)o=W(this,s[r+n],i,n),o===I&&(o=this._$AH[n]),e||(e=!z(o)||o!==this._$AH[n]),o===H?t=H:t!==H&&(t+=(null!=o?o:"")+l[n+1]),this._$AH[n]=o}e&&!s&&this.j(t)}j(t){t===H?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class J extends F{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===H?void 0:t}}const K=m?m.emptyScript:"";class V extends F{constructor(){super(...arguments),this.type=4}j(t){t&&t!==H?this.element.setAttribute(this.name,K):this.element.removeAttribute(this.name)}}class G extends F{constructor(t,i,r,s,l){super(t,i,r,s,l),this.type=5}_$AI(t,i=this){var r;if((t=null!==(r=W(this,t,i,0))&&void 0!==r?r:H)===I)return;const s=this._$AH,l=t===H&&s!==H||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,e=t!==H&&(s===H||l);l&&this.element.removeEventListener(this.name,this,s),e&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var i,r;"function"==typeof this._$AH?this._$AH.call(null!==(r=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==r?r:this.element,t):this._$AH.handleEvent(t)}}class Q{constructor(t,i,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){W(this,t)}}const X=g.litHtmlPolyfillSupport;
|
|
18
|
-
/**
|
|
19
|
-
* @license
|
|
20
|
-
* Copyright 2017 Google LLC
|
|
21
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
22
|
-
*/
|
|
23
|
-
var Y;null==X||X(D,q),(null!==(f=g.litHtmlVersions)&&void 0!==f?f:g.litHtmlVersions=[]).push("2.8.0");const tt=window,it=tt.trustedTypes,rt=it?it.createPolicy("lit-html",{createHTML:t=>t}):void 0,st="$lit$",lt=`lit$${(Math.random()+"").slice(9)}$`,et="?"+lt,nt=`<${et}>`,ot=document,at=()=>ot.createComment(""),ut=t=>null===t||"object"!=typeof t&&"function"!=typeof t,ht=Array.isArray,dt="[ \t\n\f\r]",ct=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,vt=/-->/g,pt=/>/g,yt=RegExp(`>|${dt}(?:([^\\s"'>=/]+)(${dt}*=${dt}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),bt=/'/g,ft=/"/g,gt=/^(?:script|style|textarea|title)$/i,mt=(t=>(i,...r)=>({_$litType$:t,strings:i,values:r}))(1),wt=Symbol.for("lit-noChange"),$t=Symbol.for("lit-nothing"),xt=new WeakMap,kt=ot.createTreeWalker(ot,129,null,!1);function St(t,i){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==rt?rt.createHTML(i):i}const _t=(t,i)=>{const r=t.length-1,s=[];let l,e=2===i?"<svg>":"",n=ct;for(let i=0;i<r;i++){const r=t[i];let o,a,u=-1,h=0;for(;h<r.length&&(n.lastIndex=h,a=n.exec(r),null!==a);)h=n.lastIndex,n===ct?"!--"===a[1]?n=vt:void 0!==a[1]?n=pt:void 0!==a[2]?(gt.test(a[2])&&(l=RegExp("</"+a[2],"g")),n=yt):void 0!==a[3]&&(n=yt):n===yt?">"===a[0]?(n=null!=l?l:ct,u=-1):void 0===a[1]?u=-2:(u=n.lastIndex-a[2].length,o=a[1],n=void 0===a[3]?yt:'"'===a[3]?ft:bt):n===ft||n===bt?n=yt:n===vt||n===pt?n=ct:(n=yt,l=void 0);const d=n===yt&&t[i+1].startsWith("/>")?" ":"";e+=n===ct?r+nt:u>=0?(s.push(o),r.slice(0,u)+st+r.slice(u)+lt+d):r+lt+(-2===u?(s.push(void 0),i):d)}return[St(t,e+(t[r]||"<?>")+(2===i?"</svg>":"")),s]};class At{constructor({strings:t,_$litType$:i},r){let s;this.parts=[];let l=0,e=0;const n=t.length-1,o=this.parts,[a,u]=_t(t,i);if(this.el=At.createElement(a,r),kt.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(s=kt.nextNode())&&o.length<n;){if(1===s.nodeType){if(s.hasAttributes()){const t=[];for(const i of s.getAttributeNames())if(i.endsWith(st)||i.startsWith(lt)){const r=u[e++];if(t.push(i),void 0!==r){const t=s.getAttribute(r.toLowerCase()+st).split(lt),i=/([.?@])?(.*)/.exec(r);o.push({type:1,index:l,name:i[2],strings:t,ctor:"."===i[1]?Nt:"?"===i[1]?Ut:"@"===i[1]?jt:Mt})}else o.push({type:6,index:l})}for(const i of t)s.removeAttribute(i)}if(gt.test(s.tagName)){const t=s.textContent.split(lt),i=t.length-1;if(i>0){s.textContent=it?it.emptyScript:"";for(let r=0;r<i;r++)s.append(t[r],at()),kt.nextNode(),o.push({type:2,index:++l});s.append(t[i],at())}}}else if(8===s.nodeType)if(s.data===et)o.push({type:2,index:l});else{let t=-1;for(;-1!==(t=s.data.indexOf(lt,t+1));)o.push({type:7,index:l}),t+=lt.length-1}l++}}static createElement(t,i){const r=ot.createElement("template");return r.innerHTML=t,r}}function zt(t,i,r=t,s){var l,e,n,o;if(i===wt)return i;let a=void 0!==s?null===(l=r._$Co)||void 0===l?void 0:l[s]:r._$Cl;const u=ut(i)?void 0:i._$litDirective$;return(null==a?void 0:a.constructor)!==u&&(null===(e=null==a?void 0:a._$AO)||void 0===e||e.call(a,!1),void 0===u?a=void 0:(a=new u(t),a._$AT(t,r,s)),void 0!==s?(null!==(n=(o=r)._$Co)&&void 0!==n?n:o._$Co=[])[s]=a:r._$Cl=a),void 0!==a&&(i=zt(t,a._$AS(t,i.values),a,s)),i}class Ct{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var i;const{el:{content:r},parts:s}=this._$AD,l=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:ot).importNode(r,!0);kt.currentNode=l;let e=kt.nextNode(),n=0,o=0,a=s[0];for(;void 0!==a;){if(n===a.index){let i;2===a.type?i=new Et(e,e.nextSibling,this,t):1===a.type?i=new a.ctor(e,a.name,a.strings,this,t):6===a.type&&(i=new Rt(e,this,t)),this._$AV.push(i),a=s[++o]}n!==(null==a?void 0:a.index)&&(e=kt.nextNode(),n++)}return kt.currentNode=ot,l}v(t){let i=0;for(const r of this._$AV)void 0!==r&&(void 0!==r.strings?(r._$AI(t,r,i),i+=r.strings.length-2):r._$AI(t[i])),i++}}class Et{constructor(t,i,r,s){var l;this.type=2,this._$AH=$t,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=r,this.options=s,this._$Cp=null===(l=null==s?void 0:s.isConnected)||void 0===l||l}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$Cp}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===(null==t?void 0:t.nodeType)&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=zt(this,t,i),ut(t)?t===$t||null==t||""===t?(this._$AH!==$t&&this._$AR(),this._$AH=$t):t!==this._$AH&&t!==wt&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):(t=>ht(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==$t&&ut(this._$AH)?this._$AA.nextSibling.data=t:this.$(ot.createTextNode(t)),this._$AH=t}g(t){var i;const{values:r,_$litType$:s}=t,l="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=At.createElement(St(s.h,s.h[0]),this.options)),s);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===l)this._$AH.v(r);else{const t=new Ct(l,this),i=t.u(this.options);t.v(r),this.$(i),this._$AH=t}}_$AC(t){let i=xt.get(t.strings);return void 0===i&&xt.set(t.strings,i=new At(t)),i}T(t){ht(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let r,s=0;for(const l of t)s===i.length?i.push(r=new Et(this.k(at()),this.k(at()),this,this.options)):r=i[s],r._$AI(l),s++;s<i.length&&(this._$AR(r&&r._$AB.nextSibling,s),i.length=s)}_$AR(t=this._$AA.nextSibling,i){var r;for(null===(r=this._$AP)||void 0===r||r.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var i;void 0===this._$AM&&(this._$Cp=t,null===(i=this._$AP)||void 0===i||i.call(this,t))}}class Mt{constructor(t,i,r,s,l){this.type=1,this._$AH=$t,this._$AN=void 0,this.element=t,this.name=i,this._$AM=s,this.options=l,r.length>2||""!==r[0]||""!==r[1]?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=$t}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,r,s){const l=this.strings;let e=!1;if(void 0===l)t=zt(this,t,i,0),e=!ut(t)||t!==this._$AH&&t!==wt,e&&(this._$AH=t);else{const s=t;let n,o;for(t=l[0],n=0;n<l.length-1;n++)o=zt(this,s[r+n],i,n),o===wt&&(o=this._$AH[n]),e||(e=!ut(o)||o!==this._$AH[n]),o===$t?t=$t:t!==$t&&(t+=(null!=o?o:"")+l[n+1]),this._$AH[n]=o}e&&!s&&this.j(t)}j(t){t===$t?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class Nt extends Mt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===$t?void 0:t}}const Tt=it?it.emptyScript:"";class Ut extends Mt{constructor(){super(...arguments),this.type=4}j(t){t&&t!==$t?this.element.setAttribute(this.name,Tt):this.element.removeAttribute(this.name)}}class jt extends Mt{constructor(t,i,r,s,l){super(t,i,r,s,l),this.type=5}_$AI(t,i=this){var r;if((t=null!==(r=zt(this,t,i,0))&&void 0!==r?r:$t)===wt)return;const s=this._$AH,l=t===$t&&s!==$t||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,e=t!==$t&&(s===$t||l);l&&this.element.removeEventListener(this.name,this,s),e&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var i,r;"function"==typeof this._$AH?this._$AH.call(null!==(r=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==r?r:this.element,t):this._$AH.handleEvent(t)}}class Rt{constructor(t,i,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){zt(this,t)}}const Ot=tt.litHtmlPolyfillSupport;null==Ot||Ot(At,Et),(null!==(Y=tt.litHtmlVersions)&&void 0!==Y?Y:tt.litHtmlVersions=[]).push("2.8.0");
|
|
24
|
-
/**
|
|
25
|
-
* @license
|
|
26
|
-
* Copyright 2017 Google LLC
|
|
27
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
28
|
-
*/
|
|
29
|
-
var It,Ht;class Pt extends b{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,i;const r=super.createRenderRoot();return null!==(t=(i=this.renderOptions).renderBefore)&&void 0!==t||(i.renderBefore=r.firstChild),r}update(t){const i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,i,r)=>{var s,l;const e=null!==(s=null==r?void 0:r.renderBefore)&&void 0!==s?s:i;let n=e._$litPart$;if(void 0===n){const t=null!==(l=null==r?void 0:r.renderBefore)&&void 0!==l?l:null;e._$litPart$=n=new Et(i.insertBefore(at(),t),t,void 0,null!=r?r:{})}return n._$AI(t),n})(i,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return wt}}Pt.finalized=!0,Pt._$litElement$=!0,null===(It=globalThis.litElementHydrateSupport)||void 0===It||It.call(globalThis,{LitElement:Pt});const Bt=globalThis.litElementPolyfillSupport;null==Bt||Bt({LitElement:Pt}),(null!==(Ht=globalThis.litElementVersions)&&void 0!==Ht?Ht:globalThis.litElementVersions=[]).push("3.3.3");
|
|
30
|
-
/**
|
|
31
|
-
* @license
|
|
32
|
-
* Copyright 2017 Google LLC
|
|
33
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
34
|
-
*/
|
|
35
|
-
const Lt=(t,i)=>"method"===i.kind&&i.descriptor&&!("value"in i.descriptor)?{...i,finisher(r){r.createProperty(i.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:i.key,initializer(){"function"==typeof i.initializer&&(this[i.key]=i.initializer.call(this))},finisher(r){r.createProperty(i.key,t)}},Dt=(t,i,r)=>{i.constructor.createProperty(r,t)};function Wt(t){return(i,r)=>void 0!==r?Dt(t,i,r):Lt(t,i)
|
|
36
|
-
/**
|
|
37
|
-
* @license
|
|
38
|
-
* Copyright 2017 Google LLC
|
|
39
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
40
|
-
*/}function Zt(t){return Wt({...t,state:!0})}
|
|
41
|
-
/**
|
|
42
|
-
* @license
|
|
43
|
-
* Copyright 2021 Google LLC
|
|
44
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
45
|
-
*/var qt;null===(qt=window.HTMLSlotElement)||void 0===qt||qt.prototype.assignedElements;var Ft=e`
|
|
46
|
-
${e`
|
|
47
|
-
:host {
|
|
48
|
-
/* Component dimensions */
|
|
49
|
-
--nuraly-slider-input-local-width: var(--nuraly-size-slider-input-width, 100%);
|
|
50
|
-
--nuraly-slider-input-local-track-height: var(--nuraly-size-slider-input-track-height, 8px);
|
|
51
|
-
--nuraly-slider-input-local-thumb-diameter: var(--nuraly-size-slider-input-thumb-diameter, 20px);
|
|
52
|
-
--nuraly-slider-input-local-border-width: var(--nuraly-border-slider-input-width, 1px);
|
|
53
|
-
|
|
54
|
-
/* Size variants */
|
|
55
|
-
--nuraly-slider-input-local-small-height: var(--nuraly-size-slider-input-small-height, 6px);
|
|
56
|
-
--nuraly-slider-input-local-small-thumb-diameter: var(--nuraly-size-slider-input-small-thumb-diameter, 16px);
|
|
57
|
-
--nuraly-slider-input-local-large-height: var(--nuraly-size-slider-input-large-height, 10px);
|
|
58
|
-
--nuraly-slider-input-local-large-thumb-diameter: var(--nuraly-size-slider-input-large-thumb-diameter, 24px);
|
|
59
|
-
|
|
60
|
-
/* Typography */
|
|
61
|
-
--nuraly-slider-input-local-font-family: var(--nuraly-typograpnr-slider-input-font-family, var(--nuraly-font-family-base, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif));
|
|
62
|
-
--nuraly-slider-input-local-font-size: var(--nuraly-typograpnr-slider-input-font-size, var(--nuraly-font-size-base, 14px));
|
|
63
|
-
--nuraly-slider-input-local-font-weight: var(--nuraly-typograpnr-slider-input-font-weight, var(--nuraly-font-weight-normal, 400));
|
|
64
|
-
|
|
65
|
-
/* Border radius */
|
|
66
|
-
--nuraly-slider-input-local-border-radius: var(--nuraly-border-slider-input-radius, var(--nuraly-border-radius-base, 6px));
|
|
67
|
-
--nuraly-slider-input-local-thumb-border-radius: var(--nuraly-border-slider-input-thumb-radius, var(--nuraly-border-radius-round, 50%));
|
|
68
|
-
|
|
69
|
-
/* Colors - Track */
|
|
70
|
-
--nuraly-slider-input-local-track-color: var(--nuraly-color-slider-input-track, var(--nuraly-color-neutral-200, #e5e7eb));
|
|
71
|
-
--nuraly-slider-input-local-track-filled-color: var(--nuraly-color-slider-input-track-filled, var(--nuraly-color-primary-500, #3b82f6));
|
|
72
|
-
--nuraly-slider-input-local-border-color: var(--nuraly-color-slider-input-border, var(--nuraly-color-neutral-300, #d1d5db));
|
|
73
|
-
|
|
74
|
-
/* Colors - Thumb */
|
|
75
|
-
--nuraly-slider-input-local-thumb-color: var(--nuraly-color-slider-input-thumb, var(--nuraly-color-white, #ffffff));
|
|
76
|
-
--nuraly-slider-input-local-thumb-border-color: var(--nuraly-color-slider-input-thumb-border, var(--nuraly-color-primary-500, #3b82f6));
|
|
77
|
-
--nuraly-slider-input-local-thumb-hover-color: var(--nuraly-color-slider-input-thumb-hover, var(--nuraly-color-primary-50, #eff6ff));
|
|
78
|
-
--nuraly-slider-input-local-thumb-active-color: var(--nuraly-color-slider-input-thumb-active, var(--nuraly-color-primary-100, #dbeafe));
|
|
79
|
-
|
|
80
|
-
/* Colors - Disabled states */
|
|
81
|
-
--nuraly-slider-input-local-disabled-track-color: var(--nuraly-color-slider-input-disabled-track, var(--nuraly-color-neutral-100, #f5f5f5));
|
|
82
|
-
--nuraly-slider-input-local-disabled-color: var(--nuraly-color-slider-input-disabled, var(--nuraly-color-neutral-300, #d1d5db));
|
|
83
|
-
--nuraly-slider-input-local-disabled-thumb-color: var(--nuraly-color-slider-input-disabled-thumb, var(--nuraly-color-neutral-200, #e5e7eb));
|
|
84
|
-
--nuraly-slider-input-local-disabled-border-color: var(--nuraly-color-slider-input-disabled-border, var(--nuraly-color-neutral-200, #e5e7eb));
|
|
85
|
-
|
|
86
|
-
/* Colors - Status states */
|
|
87
|
-
--nuraly-slider-input-local-error-color: var(--nuraly-color-slider-input-error, var(--nuraly-color-error-500, #ef4444));
|
|
88
|
-
--nuraly-slider-input-local-warning-color: var(--nuraly-color-slider-input-warning, var(--nuraly-color-warning-500, #f59e0b));
|
|
89
|
-
--nuraly-slider-input-local-success-color: var(--nuraly-color-slider-input-success, var(--nuraly-color-success-500, #10b981));
|
|
90
|
-
|
|
91
|
-
/* Shadows */
|
|
92
|
-
--nuraly-slider-input-local-thumb-shadow: var(--nuraly-shadow-slider-input-thumb, var(--nuraly-shadow-sm, 0 1px 2px 0 rgba(0, 0, 0, 0.05)));
|
|
93
|
-
--nuraly-slider-input-local-focus-shadow: var(--nuraly-shadow-slider-input-focus, var(--nuraly-shadow-focus, 0 0 0 3px rgba(59, 130, 246, 0.15)));
|
|
94
|
-
|
|
95
|
-
/* Elevation */
|
|
96
|
-
--nuraly-slider-input-local-z-index: var(--nuraly-elevation-slider-input-z-index, var(--nuraly-z-index-base, 1));
|
|
97
|
-
|
|
98
|
-
/* Transitions */
|
|
99
|
-
--nuraly-slider-input-local-transition-duration: var(--nuraly-transition-slider-input-duration, var(--nuraly-transition-duration-base, 150ms));
|
|
100
|
-
--nuraly-slider-input-local-transition-timing: var(--nuraly-transition-slider-input-timing, var(--nuraly-transition-timing-ease, ease));
|
|
101
|
-
}
|
|
102
|
-
`}
|
|
103
|
-
|
|
104
|
-
:host {
|
|
105
|
-
display: inline-block;
|
|
106
|
-
width: var(--nuraly-slider-input-local-width);
|
|
107
|
-
font-family: var(--nuraly-slider-input-local-font-family);
|
|
108
|
-
font-size: var(--nuraly-slider-input-local-font-size);
|
|
109
|
-
font-weight: var(--nuraly-slider-input-local-font-weight);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/* Host attribute selectors for configuration */
|
|
113
|
-
:host([disabled]) {
|
|
114
|
-
opacity: 0.6;
|
|
115
|
-
pointer-events: none;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.slider-wrapper {
|
|
119
|
-
position: relative;
|
|
120
|
-
padding: calc(var(--nuraly-slider-input-local-thumb-diameter) / 2) 0;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
.range-container {
|
|
124
|
-
position: relative;
|
|
125
|
-
width: 100%;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
.range-slider,
|
|
129
|
-
.range-slider-value {
|
|
130
|
-
border-radius: var(--nuraly-slider-input-local-border-radius);
|
|
131
|
-
height: var(--nuraly-slider-input-local-track-height);
|
|
132
|
-
position: absolute;
|
|
133
|
-
top: calc((var(--nuraly-slider-input-local-thumb-diameter) - var(--nuraly-slider-input-local-track-height)) / 2);
|
|
134
|
-
transition: all var(--nuraly-slider-input-local-transition-duration) var(--nuraly-slider-input-local-transition-timing);
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
.range-slider {
|
|
138
|
-
background: var(--nuraly-slider-input-local-track-color);
|
|
139
|
-
width: 100%;
|
|
140
|
-
border: var(--nuraly-slider-input-local-border-width) solid var(--nuraly-slider-input-local-border-color);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
.range-slider-value {
|
|
144
|
-
background: var(--nuraly-slider-input-local-track-filled-color);
|
|
145
|
-
width: var(--nr-slider-value-width, 0%);
|
|
146
|
-
z-index: calc(var(--nuraly-slider-input-local-z-index) + 1);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
.range-thumb {
|
|
150
|
-
background: var(--nuraly-slider-input-local-thumb-color);
|
|
151
|
-
border: 2px solid var(--nuraly-slider-input-local-thumb-border-color);
|
|
152
|
-
border-radius: var(--nuraly-slider-input-local-thumb-border-radius);
|
|
153
|
-
height: var(--nuraly-slider-input-local-thumb-diameter);
|
|
154
|
-
width: var(--nuraly-slider-input-local-thumb-diameter);
|
|
155
|
-
position: absolute;
|
|
156
|
-
top: calc((var(--nuraly-slider-input-local-track-height) - var(--nuraly-slider-input-local-thumb-diameter)) / 2);
|
|
157
|
-
left: var(--nr-slider-thumb-offset, 0px);
|
|
158
|
-
cursor: pointer;
|
|
159
|
-
z-index: calc(var(--nuraly-slider-input-local-z-index) + 2);
|
|
160
|
-
box-shadow: var(--nuraly-slider-input-local-thumb-shadow);
|
|
161
|
-
transition: all var(--nuraly-slider-input-local-transition-duration) var(--nuraly-slider-input-local-transition-timing);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
.range-thumb:hover {
|
|
165
|
-
background: var(--nuraly-slider-input-local-thumb-hover-color);
|
|
166
|
-
box-shadow: var(--nuraly-slider-input-local-focus-shadow);
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
.range-thumb:active {
|
|
170
|
-
background: var(--nuraly-slider-input-local-thumb-active-color);
|
|
171
|
-
box-shadow: var(--nuraly-slider-input-local-focus-shadow);
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
input {
|
|
175
|
-
position: absolute;
|
|
176
|
-
top: 0;
|
|
177
|
-
left: 0;
|
|
178
|
-
height: 100%;
|
|
179
|
-
margin: 0;
|
|
180
|
-
opacity: 0;
|
|
181
|
-
width: 100%;
|
|
182
|
-
cursor: pointer;
|
|
183
|
-
z-index: calc(var(--nuraly-slider-input-local-z-index) + 3);
|
|
184
|
-
appearance: none;
|
|
185
|
-
background: transparent;
|
|
186
|
-
pointer-events: auto;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
input::-webkit-slider-thumb {
|
|
190
|
-
appearance: none;
|
|
191
|
-
width: var(--nuraly-slider-input-local-thumb-diameter);
|
|
192
|
-
height: var(--nuraly-slider-input-local-thumb-diameter);
|
|
193
|
-
background: transparent;
|
|
194
|
-
cursor: pointer;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
input::-moz-range-thumb {
|
|
198
|
-
appearance: none;
|
|
199
|
-
width: var(--nuraly-slider-input-local-thumb-diameter);
|
|
200
|
-
height: var(--nuraly-slider-input-local-thumb-diameter);
|
|
201
|
-
background: transparent;
|
|
202
|
-
border: none;
|
|
203
|
-
cursor: pointer;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
input:focus-visible + .range-container .range-thumb {
|
|
207
|
-
box-shadow: var(--nuraly-slider-input-local-focus-shadow);
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
/* Disabled state styling */
|
|
211
|
-
:host([disabled]) .range-slider {
|
|
212
|
-
background: var(--nuraly-slider-input-local-disabled-track-color);
|
|
213
|
-
border-color: var(--nuraly-slider-input-local-disabled-border-color);
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
:host([disabled]) .range-slider-value {
|
|
217
|
-
background: var(--nuraly-slider-input-local-disabled-color);
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
:host([disabled]) .range-thumb {
|
|
221
|
-
background: var(--nuraly-slider-input-local-disabled-thumb-color);
|
|
222
|
-
border-color: var(--nuraly-slider-input-local-disabled-border-color);
|
|
223
|
-
cursor: not-allowed;
|
|
224
|
-
box-shadow: none;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
:host([disabled]) input {
|
|
228
|
-
cursor: not-allowed;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
/* Size variants */
|
|
232
|
-
:host([size="small"]) {
|
|
233
|
-
--nuraly-slider-input-local-track-height: var(--nuraly-slider-input-local-small-height);
|
|
234
|
-
--nuraly-slider-input-local-thumb-diameter: var(--nuraly-slider-input-local-small-thumb-diameter);
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
:host([size="large"]) {
|
|
238
|
-
--nuraly-slider-input-local-track-height: var(--nuraly-slider-input-local-large-height);
|
|
239
|
-
--nuraly-slider-input-local-thumb-diameter: var(--nuraly-slider-input-local-large-thumb-diameter);
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
/* Error state */
|
|
243
|
-
:host([error]) .range-slider-value {
|
|
244
|
-
background: var(--nuraly-slider-input-local-error-color);
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
:host([error]) .range-thumb {
|
|
248
|
-
border-color: var(--nuraly-slider-input-local-error-color);
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
/* Warning state */
|
|
252
|
-
:host([warning]) .range-slider-value {
|
|
253
|
-
background: var(--nuraly-slider-input-local-warning-color);
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
:host([warning]) .range-thumb {
|
|
257
|
-
border-color: var(--nuraly-slider-input-local-warning-color);
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
/* Success state */
|
|
261
|
-
:host([success]) .range-slider-value {
|
|
262
|
-
background: var(--nuraly-slider-input-local-success-color);
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
:host([success]) .range-thumb {
|
|
266
|
-
border-color: var(--nuraly-slider-input-local-success-color);
|
|
267
|
-
}
|
|
268
|
-
`;var Jt=function(t,i,r,s){for(var l,e=arguments.length,n=e<3?i:null===s?s=Object.getOwnPropertyDescriptor(i,r):s,o=t.length-1;o>=0;o--)(l=t[o])&&(n=(e<3?l(n):e>3?l(i,r,n):l(i,r))||n);return e>3&&n&&Object.defineProperty(i,r,n),n},Kt=function(t,i,r,s){return new(r||(r=Promise))((function(l,e){function n(t){try{a(s.next(t))}catch(t){e(t)}}function o(t){try{a(s.throw(t))}catch(t){e(t)}}function a(t){var i;t.done?l(t.value):(i=t.value,i instanceof r?i:new r((function(t){t(i)}))).then(n,o)}a((s=s.apply(t,i||[])).next())}))};class Vt extends Pt{constructor(){super(...arguments),this.disabled=!1,this.max=100,this.min=0,this.step=1,this.value=0,this._actualMin=0,this._actualMax=0,this._dispatchChangeEvents=function(t,i=100){let r;return function(...s){clearTimeout(r),r=setTimeout((()=>t.apply(this,s)),i)}}((()=>{this.dispatchEvent(new Event("change")),this.dispatchEvent(new CustomEvent("changed",{detail:{value:Number(this.value)}}))}),50)}firstUpdated(){return Kt(this,void 0,void 0,(function*(){if(yield this.updateComplete,this._input=this.shadowRoot.querySelector("input"),this._slider=this.shadowRoot.querySelector(".range-slider"),this._thumb=this.shadowRoot.querySelector(".range-thumb"),this._actualMin=this.min,this._actualMax=this.max,this.step){const t=this.min%this.step,i=this.max%this.step;0!==t&&(this.min=this.min-t),0!==i&&(this.max=this.max+this.step-i)}requestAnimationFrame((()=>{this._updateSliderVisuals()}))}))}render(){return mt`
|
|
269
|
-
<div class="slider-wrapper">
|
|
270
|
-
<input
|
|
271
|
-
max=${this.max}
|
|
272
|
-
min=${this.min}
|
|
273
|
-
step=${this.step}
|
|
274
|
-
type="range"
|
|
275
|
-
value=${this.value}
|
|
276
|
-
?disabled=${this.disabled}
|
|
277
|
-
@input=${this._inputHandler}
|
|
278
|
-
@change=${this._changeHandler}
|
|
279
|
-
/>
|
|
280
|
-
<div class="range-container">
|
|
281
|
-
<div class="range-slider"></div>
|
|
282
|
-
<div class="range-slider-value"></div>
|
|
283
|
-
<div class="range-thumb"></div>
|
|
284
|
-
</div>
|
|
285
|
-
</div>`}updated(t){(t.has("value")||t.has("min")||t.has("max"))&&requestAnimationFrame((()=>{this._updateSliderVisuals()}))}_inputHandler(t){t.stopPropagation();const i=t.target,r=Number(i.value);this.value=r>this._actualMax?this._actualMax:r<this._actualMin?this._actualMin:r,this._updateSliderVisuals(),this.requestUpdate()}_changeHandler(t){t.stopPropagation();const i=t.target,r=Number(i.value);this.value=r>this._actualMax?this._actualMax:r<this._actualMin?this._actualMin:r,this._dispatchChangeEvents(),this.requestUpdate()}_updateSliderVisuals(){if(!this._thumb||!this._slider)return;const t=this.min<this._actualMin?this._actualMin:this.min,i=(this.max>this._actualMax?this._actualMax:this.max)-t;if(0===i)return;const r=Math.max(0,Math.min(1,(this.value-t)/i)),s=this._thumb.offsetWidth||20,l=100*r+"%",e=(this._slider.offsetWidth||200)-s,n=`${Math.max(0,Math.min(e,e*r))}px`;this.style.setProperty("--nr-slider-value-width",l),this.style.setProperty("--nr-slider-thumb-offset",n)}_updateSlider(){this._updateSliderVisuals(),this._dispatchChangeEvents(),this.requestUpdate()}}Vt.styles=Ft,Jt([Wt({type:Boolean,reflect:!0})],Vt.prototype,"disabled",void 0),Jt([Wt({type:Number})],Vt.prototype,"max",void 0),Jt([Wt({type:Number})],Vt.prototype,"min",void 0),Jt([Wt({type:Number})],Vt.prototype,"step",void 0),Jt([Wt({type:Number})],Vt.prototype,"value",void 0),Jt([Zt()],Vt.prototype,"_actualMin",void 0),Jt([Zt()],Vt.prototype,"_actualMax",void 0),Jt([Zt()],Vt.prototype,"_input",void 0),Jt([Zt()],Vt.prototype,"_slider",void 0),Jt([Zt()],Vt.prototype,"_thumb",void 0),customElements.define("nr-slider-input",Vt);export{Vt as SliderInput};
|
|
1
|
+
import{css as r,LitElement as l,html as a}from"lit";import{property as i,state as t}from"lit/decorators.js";var n=r`${r`:host{--nuraly-slider-input-local-width:var(--nuraly-size-slider-input-width, 100%);--nuraly-slider-input-local-track-height:var(--nuraly-size-slider-input-track-height, 8px);--nuraly-slider-input-local-thumb-diameter:var(--nuraly-size-slider-input-thumb-diameter, 20px);--nuraly-slider-input-local-border-width:var(--nuraly-border-slider-input-width, 1px);--nuraly-slider-input-local-small-height:var(--nuraly-size-slider-input-small-height, 6px);--nuraly-slider-input-local-small-thumb-diameter:var(--nuraly-size-slider-input-small-thumb-diameter, 16px);--nuraly-slider-input-local-large-height:var(--nuraly-size-slider-input-large-height, 10px);--nuraly-slider-input-local-large-thumb-diameter:var(--nuraly-size-slider-input-large-thumb-diameter, 24px);--nuraly-slider-input-local-font-family:var(--nuraly-typograpnr-slider-input-font-family, var(--nuraly-font-family-base, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif));--nuraly-slider-input-local-font-size:var(--nuraly-typograpnr-slider-input-font-size, var(--nuraly-font-size-base, 14px));--nuraly-slider-input-local-font-weight:var(--nuraly-typograpnr-slider-input-font-weight, var(--nuraly-font-weight-normal, 400));--nuraly-slider-input-local-border-radius:var(--nuraly-border-slider-input-radius, var(--nuraly-border-radius-base, 6px));--nuraly-slider-input-local-thumb-border-radius:var(--nuraly-border-slider-input-thumb-radius, var(--nuraly-border-radius-round, 50%));--nuraly-slider-input-local-track-color:var(--nuraly-color-slider-input-track, var(--nuraly-color-neutral-200, #e5e7eb));--nuraly-slider-input-local-track-filled-color:var(--nuraly-color-slider-input-track-filled, var(--nuraly-color-primary-500, #3b82f6));--nuraly-slider-input-local-border-color:var(--nuraly-color-slider-input-border, var(--nuraly-color-neutral-300, #d1d5db));--nuraly-slider-input-local-thumb-color:var(--nuraly-color-slider-input-thumb, var(--nuraly-color-white, #ffffff));--nuraly-slider-input-local-thumb-border-color:var(--nuraly-color-slider-input-thumb-border, var(--nuraly-color-primary-500, #3b82f6));--nuraly-slider-input-local-thumb-hover-color:var(--nuraly-color-slider-input-thumb-hover, var(--nuraly-color-primary-50, #eff6ff));--nuraly-slider-input-local-thumb-active-color:var(--nuraly-color-slider-input-thumb-active, var(--nuraly-color-primary-100, #dbeafe));--nuraly-slider-input-local-disabled-track-color:var(--nuraly-color-slider-input-disabled-track, var(--nuraly-color-neutral-100, #f5f5f5));--nuraly-slider-input-local-disabled-color:var(--nuraly-color-slider-input-disabled, var(--nuraly-color-neutral-300, #d1d5db));--nuraly-slider-input-local-disabled-thumb-color:var(--nuraly-color-slider-input-disabled-thumb, var(--nuraly-color-neutral-200, #e5e7eb));--nuraly-slider-input-local-disabled-border-color:var(--nuraly-color-slider-input-disabled-border, var(--nuraly-color-neutral-200, #e5e7eb));--nuraly-slider-input-local-error-color:var(--nuraly-color-slider-input-error, var(--nuraly-color-error-500, #ef4444));--nuraly-slider-input-local-warning-color:var(--nuraly-color-slider-input-warning, var(--nuraly-color-warning-500, #f59e0b));--nuraly-slider-input-local-success-color:var(--nuraly-color-slider-input-success, var(--nuraly-color-success-500, #10b981));--nuraly-slider-input-local-thumb-shadow:var(--nuraly-shadow-slider-input-thumb, var(--nuraly-shadow-sm, 0 1px 2px 0 rgba(0, 0, 0, 0.05)));--nuraly-slider-input-local-focus-shadow:var(--nuraly-shadow-slider-input-focus, var(--nuraly-shadow-focus, 0 0 0 3px rgba(59, 130, 246, 0.15)));--nuraly-slider-input-local-z-index:var(--nuraly-elevation-slider-input-z-index, var(--nuraly-z-index-base, 1));--nuraly-slider-input-local-transition-duration:var(--nuraly-transition-slider-input-duration, var(--nuraly-transition-duration-base, 150ms));--nuraly-slider-input-local-transition-timing:var(--nuraly-transition-slider-input-timing, var(--nuraly-transition-timing-ease, ease))}`}:host{display:inline-block;width:var(--nuraly-slider-input-local-width);font-family:var(--nuraly-slider-input-local-font-family);font-size:var(--nuraly-slider-input-local-font-size);font-weight:var(--nuraly-slider-input-local-font-weight)}:host([disabled]){opacity:.6;pointer-events:none}.slider-wrapper{position:relative;padding:calc(var(--nuraly-slider-input-local-thumb-diameter)/ 2) 0}.range-container{position:relative;width:100%}.range-slider,.range-slider-value{border-radius:var(--nuraly-slider-input-local-border-radius);height:var(--nuraly-slider-input-local-track-height);position:absolute;top:calc((var(--nuraly-slider-input-local-thumb-diameter) - var(--nuraly-slider-input-local-track-height))/ 2);transition:all var(--nuraly-slider-input-local-transition-duration) var(--nuraly-slider-input-local-transition-timing)}.range-slider{background:var(--nuraly-slider-input-local-track-color);width:100%;border:var(--nuraly-slider-input-local-border-width) solid var(--nuraly-slider-input-local-border-color)}.range-slider-value{background:var(--nuraly-slider-input-local-track-filled-color);width:var(--nr-slider-value-width,0%);z-index:calc(var(--nuraly-slider-input-local-z-index) + 1)}.range-thumb{background:var(--nuraly-slider-input-local-thumb-color);border:2px solid var(--nuraly-slider-input-local-thumb-border-color);border-radius:var(--nuraly-slider-input-local-thumb-border-radius);height:var(--nuraly-slider-input-local-thumb-diameter);width:var(--nuraly-slider-input-local-thumb-diameter);position:absolute;top:calc((var(--nuraly-slider-input-local-track-height) - var(--nuraly-slider-input-local-thumb-diameter))/ 2);left:var(--nr-slider-thumb-offset,0);cursor:pointer;z-index:calc(var(--nuraly-slider-input-local-z-index) + 2);box-shadow:var(--nuraly-slider-input-local-thumb-shadow);transition:all var(--nuraly-slider-input-local-transition-duration) var(--nuraly-slider-input-local-transition-timing)}.range-thumb:hover{background:var(--nuraly-slider-input-local-thumb-hover-color);box-shadow:var(--nuraly-slider-input-local-focus-shadow)}.range-thumb:active{background:var(--nuraly-slider-input-local-thumb-active-color);box-shadow:var(--nuraly-slider-input-local-focus-shadow)}input{position:absolute;top:0;left:0;height:100%;margin:0;opacity:0;width:100%;cursor:pointer;z-index:calc(var(--nuraly-slider-input-local-z-index) + 3);appearance:none;background:0 0;pointer-events:auto}input::-webkit-slider-thumb{appearance:none;width:var(--nuraly-slider-input-local-thumb-diameter);height:var(--nuraly-slider-input-local-thumb-diameter);background:0 0;cursor:pointer}input::-moz-range-thumb{appearance:none;width:var(--nuraly-slider-input-local-thumb-diameter);height:var(--nuraly-slider-input-local-thumb-diameter);background:0 0;border:none;cursor:pointer}input:focus-visible+.range-container .range-thumb{box-shadow:var(--nuraly-slider-input-local-focus-shadow)}:host([disabled]) .range-slider{background:var(--nuraly-slider-input-local-disabled-track-color);border-color:var(--nuraly-slider-input-local-disabled-border-color)}:host([disabled]) .range-slider-value{background:var(--nuraly-slider-input-local-disabled-color)}:host([disabled]) .range-thumb{background:var(--nuraly-slider-input-local-disabled-thumb-color);border-color:var(--nuraly-slider-input-local-disabled-border-color);cursor:not-allowed;box-shadow:none}:host([disabled]) input{cursor:not-allowed}:host([size=small]){--nuraly-slider-input-local-track-height:var(--nuraly-slider-input-local-small-height);--nuraly-slider-input-local-thumb-diameter:var(--nuraly-slider-input-local-small-thumb-diameter)}:host([size=large]){--nuraly-slider-input-local-track-height:var(--nuraly-slider-input-local-large-height);--nuraly-slider-input-local-thumb-diameter:var(--nuraly-slider-input-local-large-thumb-diameter)}:host([error]) .range-slider-value{background:var(--nuraly-slider-input-local-error-color)}:host([error]) .range-thumb{border-color:var(--nuraly-slider-input-local-error-color)}:host([warning]) .range-slider-value{background:var(--nuraly-slider-input-local-warning-color)}:host([warning]) .range-thumb{border-color:var(--nuraly-slider-input-local-warning-color)}:host([success]) .range-slider-value{background:var(--nuraly-slider-input-local-success-color)}:host([success]) .range-thumb{border-color:var(--nuraly-slider-input-local-success-color)}`;var e=function(r,l,a,i){for(var t,n=arguments.length,e=n<3?l:null===i?i=Object.getOwnPropertyDescriptor(l,a):i,o=r.length-1;o>=0;o--)(t=r[o])&&(e=(n<3?t(e):n>3?t(l,a,e):t(l,a))||e);return n>3&&e&&Object.defineProperty(l,a,e),e},o=function(r,l,a,i){return new(a||(a=Promise))((function(t,n){function e(r){try{u(i.next(r))}catch(r){n(r)}}function o(r){try{u(i.throw(r))}catch(r){n(r)}}function u(r){var l;r.done?t(r.value):(l=r.value,l instanceof a?l:new a((function(r){r(l)}))).then(e,o)}u((i=i.apply(r,l||[])).next())}))};class u extends l{constructor(){super(...arguments),this.disabled=!1,this.max=100,this.min=0,this.step=1,this.value=0,this._actualMin=0,this._actualMax=0,this._dispatchChangeEvents=function(r,l=100){let a;return function(...i){clearTimeout(a),a=setTimeout((()=>r.apply(this,i)),l)}}((()=>{this.dispatchEvent(new Event("change")),this.dispatchEvent(new CustomEvent("changed",{detail:{value:Number(this.value)}}))}),50)}firstUpdated(){return o(this,void 0,void 0,(function*(){if(yield this.updateComplete,this._input=this.shadowRoot.querySelector("input"),this._slider=this.shadowRoot.querySelector(".range-slider"),this._thumb=this.shadowRoot.querySelector(".range-thumb"),this._actualMin=this.min,this._actualMax=this.max,this.step){const r=this.min%this.step,l=this.max%this.step;0!==r&&(this.min=this.min-r),0!==l&&(this.max=this.max+this.step-l)}requestAnimationFrame((()=>{this._updateSliderVisuals()}))}))}render(){return a`<div class="slider-wrapper"><input max="${this.max}" min="${this.min}" step="${this.step}" type="range" value="${this.value}" ?disabled="${this.disabled}" @input="${this._inputHandler}" @change="${this._changeHandler}"><div class="range-container"><div class="range-slider"></div><div class="range-slider-value"></div><div class="range-thumb"></div></div></div>`}updated(r){(r.has("value")||r.has("min")||r.has("max"))&&requestAnimationFrame((()=>{this._updateSliderVisuals()}))}_inputHandler(r){r.stopPropagation();const l=r.target,a=Number(l.value);this.value=a>this._actualMax?this._actualMax:a<this._actualMin?this._actualMin:a,this._updateSliderVisuals(),this.requestUpdate()}_changeHandler(r){r.stopPropagation();const l=r.target,a=Number(l.value);this.value=a>this._actualMax?this._actualMax:a<this._actualMin?this._actualMin:a,this._dispatchChangeEvents(),this.requestUpdate()}_updateSliderVisuals(){if(!this._thumb||!this._slider)return;const r=this.min<this._actualMin?this._actualMin:this.min,l=(this.max>this._actualMax?this._actualMax:this.max)-r;if(0===l)return;const a=Math.max(0,Math.min(1,(this.value-r)/l)),i=this._thumb.offsetWidth||20,t=100*a+"%",n=(this._slider.offsetWidth||200)-i,e=`${Math.max(0,Math.min(n,n*a))}px`;this.style.setProperty("--nr-slider-value-width",t),this.style.setProperty("--nr-slider-thumb-offset",e)}_updateSlider(){this._updateSliderVisuals(),this._dispatchChangeEvents(),this.requestUpdate()}}u.styles=n,e([i({type:Boolean,reflect:!0})],u.prototype,"disabled",void 0),e([i({type:Number})],u.prototype,"max",void 0),e([i({type:Number})],u.prototype,"min",void 0),e([i({type:Number})],u.prototype,"step",void 0),e([i({type:Number})],u.prototype,"value",void 0),e([t()],u.prototype,"_actualMin",void 0),e([t()],u.prototype,"_actualMax",void 0),e([t()],u.prototype,"_input",void 0),e([t()],u.prototype,"_slider",void 0),e([t()],u.prototype,"_thumb",void 0),customElements.define("nr-slider-input",u);export{u as SliderInput};
|