@nuralyui/slider-input 0.0.5 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/bundle.js +4 -48
  2. package/package.json +1 -1
package/bundle.js CHANGED
@@ -1,49 +1,5 @@
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`
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`
2
+ ${r`
47
3
  :host {
48
4
  /* Component dimensions */
49
5
  --nuraly-slider-input-local-width: var(--nuraly-size-slider-input-width, 100%);
@@ -265,7 +221,7 @@ const Lt=(t,i)=>"method"===i.kind&&i.descriptor&&!("value"in i.descriptor)?{...i
265
221
  :host([success]) .range-thumb {
266
222
  border-color: var(--nuraly-slider-input-local-success-color);
267
223
  }
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`
224
+ `;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`
269
225
  <div class="slider-wrapper">
270
226
  <input
271
227
  max=${this.max}
@@ -282,4 +238,4 @@ const Lt=(t,i)=>"method"===i.kind&&i.descriptor&&!("value"in i.descriptor)?{...i
282
238
  <div class="range-slider-value"></div>
283
239
  <div class="range-thumb"></div>
284
240
  </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};
241
+ </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};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuralyui/slider-input",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",