@nuralyui/checkbox 0.0.9 → 0.0.11
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 +7 -51
- package/package.json +1 -1
package/bundle.js
CHANGED
|
@@ -1,48 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2019 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/
|
|
6
|
-
const t=window,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,i=Symbol(),o=new WeakMap;class s{constructor(t,e,o){if(this._$cssResult$=!0,o!==i)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const i=this.t;if(e&&void 0===t){const e=void 0!==i&&1===i.length;e&&(t=o.get(i)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o.set(i,t))}return t}toString(){return this.cssText}}const r=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new s("string"==typeof t?t:t+"",void 0,i))(e)})(t):t
|
|
7
|
-
/**
|
|
8
|
-
* @license
|
|
9
|
-
* Copyright 2017 Google LLC
|
|
10
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
|
-
*/;var n;const l=window,c=l.trustedTypes,a=c?c.emptyScript:"",h=l.reactiveElementPolyfillSupport,d={toAttribute(t,e){switch(e){case Boolean:t=t?a:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},u=(t,e)=>e!==t&&(e==e||t==t),v={attribute:!0,type:String,converter:d,reflect:!1,hasChanged:u},b="finalized";class k extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(t){var e;this.finalize(),(null!==(e=this.h)&&void 0!==e?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,i)=>{const o=this._$Ep(i,e);void 0!==o&&(this._$Ev.set(o,i),t.push(o))})),t}static createProperty(t,e=v){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i="symbol"==typeof t?Symbol():"__"+t,o=this.getPropertyDescriptor(t,i,e);void 0!==o&&Object.defineProperty(this.prototype,t,o)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(o){const s=this[t];this[e]=o,this.requestUpdate(t,s,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||v}static finalize(){if(this.hasOwnProperty(b))return!1;this[b]=!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,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const i of e)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(r(t))}else void 0!==t&&e.push(r(t));return e}static _$Ep(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"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 e,i;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(i=t.hostConnected)||void 0===i||i.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var i;const o=null!==(i=this.shadowRoot)&&void 0!==i?i:this.attachShadow(this.constructor.shadowRootOptions);return((i,o)=>{e?i.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):o.forEach((e=>{const o=document.createElement("style"),s=t.litNonce;void 0!==s&&o.setAttribute("nonce",s),o.textContent=e.cssText,i.appendChild(o)}))})(o,this.constructor.elementStyles),o}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 e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EO(t,e,i=v){var o;const s=this.constructor._$Ep(t,i);if(void 0!==s&&!0===i.reflect){const r=(void 0!==(null===(o=i.converter)||void 0===o?void 0:o.toAttribute)?i.converter:d).toAttribute(e,i.type);this._$El=t,null==r?this.removeAttribute(s):this.setAttribute(s,r),this._$El=null}}_$AK(t,e){var i;const o=this.constructor,s=o._$Ev.get(t);if(void 0!==s&&this._$El!==s){const t=o.getPropertyOptions(s),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(i=t.converter)||void 0===i?void 0:i.fromAttribute)?t.converter:d;this._$El=s,this[s]=r.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,i){let o=!0;void 0!==t&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||u)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,i))):o=!1),!this.isUpdatePending&&o&&(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,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(i)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.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,e)=>this._$EO(e,this[e],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 y;k[b]=!0,k.elementProperties=new Map,k.elementStyles=[],k.shadowRootOptions={mode:"open"},null==h||h({ReactiveElement:k}),(null!==(n=l.reactiveElementVersions)&&void 0!==n?n:l.reactiveElementVersions=[]).push("1.6.3");const f=window,m=f.trustedTypes,p=m?m.createPolicy("lit-html",{createHTML:t=>t}):void 0,x="$lit$",g=`lit$${(Math.random()+"").slice(9)}$`,w="?"+g,$=`<${w}>`,S=document,E=()=>S.createComment(""),z=t=>null===t||"object"!=typeof t&&"function"!=typeof t,A=Array.isArray,C="[ \t\n\f\r]",T=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,_=/-->/g,M=/>/g,I=RegExp(`>|${C}(?:([^\\s"'>=/]+)(${C}*=${C}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),O=/'/g,L=/"/g,N=/^(?:script|style|textarea|title)$/i,B=Symbol.for("lit-noChange"),R=Symbol.for("lit-nothing"),U=new WeakMap,j=S.createTreeWalker(S,129,null,!1);function D(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==p?p.createHTML(e):e}class K{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let s=0,r=0;const n=t.length-1,l=this.parts,[c,a]=((t,e)=>{const i=t.length-1,o=[];let s,r=2===e?"<svg>":"",n=T;for(let e=0;e<i;e++){const i=t[e];let l,c,a=-1,h=0;for(;h<i.length&&(n.lastIndex=h,c=n.exec(i),null!==c);)h=n.lastIndex,n===T?"!--"===c[1]?n=_:void 0!==c[1]?n=M:void 0!==c[2]?(N.test(c[2])&&(s=RegExp("</"+c[2],"g")),n=I):void 0!==c[3]&&(n=I):n===I?">"===c[0]?(n=null!=s?s:T,a=-1):void 0===c[1]?a=-2:(a=n.lastIndex-c[2].length,l=c[1],n=void 0===c[3]?I:'"'===c[3]?L:O):n===L||n===O?n=I:n===_||n===M?n=T:(n=I,s=void 0);const d=n===I&&t[e+1].startsWith("/>")?" ":"";r+=n===T?i+$:a>=0?(o.push(l),i.slice(0,a)+x+i.slice(a)+g+d):i+g+(-2===a?(o.push(void 0),e):d)}return[D(t,r+(t[i]||"<?>")+(2===e?"</svg>":"")),o]})(t,e);if(this.el=K.createElement(c,i),j.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(o=j.nextNode())&&l.length<n;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const e of o.getAttributeNames())if(e.endsWith(x)||e.startsWith(g)){const i=a[r++];if(t.push(e),void 0!==i){const t=o.getAttribute(i.toLowerCase()+x).split(g),e=/([.?@])?(.*)/.exec(i);l.push({type:1,index:s,name:e[2],strings:t,ctor:"."===e[1]?q:"?"===e[1]?W:"@"===e[1]?X:V})}else l.push({type:6,index:s})}for(const e of t)o.removeAttribute(e)}if(N.test(o.tagName)){const t=o.textContent.split(g),e=t.length-1;if(e>0){o.textContent=m?m.emptyScript:"";for(let i=0;i<e;i++)o.append(t[i],E()),j.nextNode(),l.push({type:2,index:++s});o.append(t[e],E())}}}else if(8===o.nodeType)if(o.data===w)l.push({type:2,index:s});else{let t=-1;for(;-1!==(t=o.data.indexOf(g,t+1));)l.push({type:7,index:s}),t+=g.length-1}s++}}static createElement(t,e){const i=S.createElement("template");return i.innerHTML=t,i}}function P(t,e,i=t,o){var s,r,n,l;if(e===B)return e;let c=void 0!==o?null===(s=i._$Co)||void 0===s?void 0:s[o]:i._$Cl;const a=z(e)?void 0:e._$litDirective$;return(null==c?void 0:c.constructor)!==a&&(null===(r=null==c?void 0:c._$AO)||void 0===r||r.call(c,!1),void 0===a?c=void 0:(c=new a(t),c._$AT(t,i,o)),void 0!==o?(null!==(n=(l=i)._$Co)&&void 0!==n?n:l._$Co=[])[o]=c:i._$Cl=c),void 0!==c&&(e=P(t,c._$AS(t,e.values),c,o)),e}class H{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var e;const{el:{content:i},parts:o}=this._$AD,s=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:S).importNode(i,!0);j.currentNode=s;let r=j.nextNode(),n=0,l=0,c=o[0];for(;void 0!==c;){if(n===c.index){let e;2===c.type?e=new F(r,r.nextSibling,this,t):1===c.type?e=new c.ctor(r,c.name,c.strings,this,t):6===c.type&&(e=new Z(r,this,t)),this._$AV.push(e),c=o[++l]}n!==(null==c?void 0:c.index)&&(r=j.nextNode(),n++)}return j.currentNode=S,s}v(t){let e=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class F{constructor(t,e,i,o){var s;this.type=2,this._$AH=R,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=o,this._$Cp=null===(s=null==o?void 0:o.isConnected)||void 0===s||s}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cp}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===(null==t?void 0:t.nodeType)&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=P(this,t,e),z(t)?t===R||null==t||""===t?(this._$AH!==R&&this._$AR(),this._$AH=R):t!==this._$AH&&t!==B&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):(t=>A(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!==R&&z(this._$AH)?this._$AA.nextSibling.data=t:this.$(S.createTextNode(t)),this._$AH=t}g(t){var e;const{values:i,_$litType$:o}=t,s="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=K.createElement(D(o.h,o.h[0]),this.options)),o);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===s)this._$AH.v(i);else{const t=new H(s,this),e=t.u(this.options);t.v(i),this.$(e),this._$AH=t}}_$AC(t){let e=U.get(t.strings);return void 0===e&&U.set(t.strings,e=new K(t)),e}T(t){A(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,o=0;for(const s of t)o===e.length?e.push(i=new F(this.k(E()),this.k(E()),this,this.options)):i=e[o],i._$AI(s),o++;o<e.length&&(this._$AR(i&&i._$AB.nextSibling,o),e.length=o)}_$AR(t=this._$AA.nextSibling,e){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cp=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class V{constructor(t,e,i,o,s){this.type=1,this._$AH=R,this._$AN=void 0,this.element=t,this.name=e,this._$AM=o,this.options=s,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=R}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,o){const s=this.strings;let r=!1;if(void 0===s)t=P(this,t,e,0),r=!z(t)||t!==this._$AH&&t!==B,r&&(this._$AH=t);else{const o=t;let n,l;for(t=s[0],n=0;n<s.length-1;n++)l=P(this,o[i+n],e,n),l===B&&(l=this._$AH[n]),r||(r=!z(l)||l!==this._$AH[n]),l===R?t=R:t!==R&&(t+=(null!=l?l:"")+s[n+1]),this._$AH[n]=l}r&&!o&&this.j(t)}j(t){t===R?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class q extends V{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===R?void 0:t}}const Y=m?m.emptyScript:"";class W extends V{constructor(){super(...arguments),this.type=4}j(t){t&&t!==R?this.element.setAttribute(this.name,Y):this.element.removeAttribute(this.name)}}class X extends V{constructor(t,e,i,o,s){super(t,e,i,o,s),this.type=5}_$AI(t,e=this){var i;if((t=null!==(i=P(this,t,e,0))&&void 0!==i?i:R)===B)return;const o=this._$AH,s=t===R&&o!==R||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,r=t!==R&&(o===R||s);s&&this.element.removeEventListener(this.name,this,o),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this._$AH.handleEvent(t)}}class Z{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){P(this,t)}}const G=f.litHtmlPolyfillSupport;
|
|
18
|
-
/**
|
|
19
|
-
* @license
|
|
20
|
-
* Copyright 2017 Google LLC
|
|
21
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
22
|
-
*/
|
|
23
|
-
var J;null==G||G(K,F),(null!==(y=f.litHtmlVersions)&&void 0!==y?y:f.litHtmlVersions=[]).push("2.8.0");const Q=window,tt=Q.trustedTypes,et=tt?tt.createPolicy("lit-html",{createHTML:t=>t}):void 0,it="$lit$",ot=`lit$${(Math.random()+"").slice(9)}$`,st="?"+ot,rt=`<${st}>`,nt=document,lt=()=>nt.createComment(""),ct=t=>null===t||"object"!=typeof t&&"function"!=typeof t,at=Array.isArray,ht="[ \t\n\f\r]",dt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ut=/-->/g,vt=/>/g,bt=RegExp(`>|${ht}(?:([^\\s"'>=/]+)(${ht}*=${ht}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),kt=/'/g,yt=/"/g,ft=/^(?:script|style|textarea|title)$/i,mt=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),pt=Symbol.for("lit-noChange"),xt=Symbol.for("lit-nothing"),gt=new WeakMap,wt=nt.createTreeWalker(nt,129,null,!1);function $t(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==et?et.createHTML(e):e}const St=(t,e)=>{const i=t.length-1,o=[];let s,r=2===e?"<svg>":"",n=dt;for(let e=0;e<i;e++){const i=t[e];let l,c,a=-1,h=0;for(;h<i.length&&(n.lastIndex=h,c=n.exec(i),null!==c);)h=n.lastIndex,n===dt?"!--"===c[1]?n=ut:void 0!==c[1]?n=vt:void 0!==c[2]?(ft.test(c[2])&&(s=RegExp("</"+c[2],"g")),n=bt):void 0!==c[3]&&(n=bt):n===bt?">"===c[0]?(n=null!=s?s:dt,a=-1):void 0===c[1]?a=-2:(a=n.lastIndex-c[2].length,l=c[1],n=void 0===c[3]?bt:'"'===c[3]?yt:kt):n===yt||n===kt?n=bt:n===ut||n===vt?n=dt:(n=bt,s=void 0);const d=n===bt&&t[e+1].startsWith("/>")?" ":"";r+=n===dt?i+rt:a>=0?(o.push(l),i.slice(0,a)+it+i.slice(a)+ot+d):i+ot+(-2===a?(o.push(void 0),e):d)}return[$t(t,r+(t[i]||"<?>")+(2===e?"</svg>":"")),o]};class Et{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let s=0,r=0;const n=t.length-1,l=this.parts,[c,a]=St(t,e);if(this.el=Et.createElement(c,i),wt.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(o=wt.nextNode())&&l.length<n;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const e of o.getAttributeNames())if(e.endsWith(it)||e.startsWith(ot)){const i=a[r++];if(t.push(e),void 0!==i){const t=o.getAttribute(i.toLowerCase()+it).split(ot),e=/([.?@])?(.*)/.exec(i);l.push({type:1,index:s,name:e[2],strings:t,ctor:"."===e[1]?_t:"?"===e[1]?It:"@"===e[1]?Ot:Tt})}else l.push({type:6,index:s})}for(const e of t)o.removeAttribute(e)}if(ft.test(o.tagName)){const t=o.textContent.split(ot),e=t.length-1;if(e>0){o.textContent=tt?tt.emptyScript:"";for(let i=0;i<e;i++)o.append(t[i],lt()),wt.nextNode(),l.push({type:2,index:++s});o.append(t[e],lt())}}}else if(8===o.nodeType)if(o.data===st)l.push({type:2,index:s});else{let t=-1;for(;-1!==(t=o.data.indexOf(ot,t+1));)l.push({type:7,index:s}),t+=ot.length-1}s++}}static createElement(t,e){const i=nt.createElement("template");return i.innerHTML=t,i}}function zt(t,e,i=t,o){var s,r,n,l;if(e===pt)return e;let c=void 0!==o?null===(s=i._$Co)||void 0===s?void 0:s[o]:i._$Cl;const a=ct(e)?void 0:e._$litDirective$;return(null==c?void 0:c.constructor)!==a&&(null===(r=null==c?void 0:c._$AO)||void 0===r||r.call(c,!1),void 0===a?c=void 0:(c=new a(t),c._$AT(t,i,o)),void 0!==o?(null!==(n=(l=i)._$Co)&&void 0!==n?n:l._$Co=[])[o]=c:i._$Cl=c),void 0!==c&&(e=zt(t,c._$AS(t,e.values),c,o)),e}class At{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var e;const{el:{content:i},parts:o}=this._$AD,s=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:nt).importNode(i,!0);wt.currentNode=s;let r=wt.nextNode(),n=0,l=0,c=o[0];for(;void 0!==c;){if(n===c.index){let e;2===c.type?e=new Ct(r,r.nextSibling,this,t):1===c.type?e=new c.ctor(r,c.name,c.strings,this,t):6===c.type&&(e=new Lt(r,this,t)),this._$AV.push(e),c=o[++l]}n!==(null==c?void 0:c.index)&&(r=wt.nextNode(),n++)}return wt.currentNode=nt,s}v(t){let e=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class Ct{constructor(t,e,i,o){var s;this.type=2,this._$AH=xt,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=o,this._$Cp=null===(s=null==o?void 0:o.isConnected)||void 0===s||s}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cp}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===(null==t?void 0:t.nodeType)&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=zt(this,t,e),ct(t)?t===xt||null==t||""===t?(this._$AH!==xt&&this._$AR(),this._$AH=xt):t!==this._$AH&&t!==pt&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):(t=>at(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!==xt&&ct(this._$AH)?this._$AA.nextSibling.data=t:this.$(nt.createTextNode(t)),this._$AH=t}g(t){var e;const{values:i,_$litType$:o}=t,s="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=Et.createElement($t(o.h,o.h[0]),this.options)),o);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===s)this._$AH.v(i);else{const t=new At(s,this),e=t.u(this.options);t.v(i),this.$(e),this._$AH=t}}_$AC(t){let e=gt.get(t.strings);return void 0===e&>.set(t.strings,e=new Et(t)),e}T(t){at(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,o=0;for(const s of t)o===e.length?e.push(i=new Ct(this.k(lt()),this.k(lt()),this,this.options)):i=e[o],i._$AI(s),o++;o<e.length&&(this._$AR(i&&i._$AB.nextSibling,o),e.length=o)}_$AR(t=this._$AA.nextSibling,e){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cp=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class Tt{constructor(t,e,i,o,s){this.type=1,this._$AH=xt,this._$AN=void 0,this.element=t,this.name=e,this._$AM=o,this.options=s,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=xt}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,o){const s=this.strings;let r=!1;if(void 0===s)t=zt(this,t,e,0),r=!ct(t)||t!==this._$AH&&t!==pt,r&&(this._$AH=t);else{const o=t;let n,l;for(t=s[0],n=0;n<s.length-1;n++)l=zt(this,o[i+n],e,n),l===pt&&(l=this._$AH[n]),r||(r=!ct(l)||l!==this._$AH[n]),l===xt?t=xt:t!==xt&&(t+=(null!=l?l:"")+s[n+1]),this._$AH[n]=l}r&&!o&&this.j(t)}j(t){t===xt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class _t extends Tt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===xt?void 0:t}}const Mt=tt?tt.emptyScript:"";class It extends Tt{constructor(){super(...arguments),this.type=4}j(t){t&&t!==xt?this.element.setAttribute(this.name,Mt):this.element.removeAttribute(this.name)}}class Ot extends Tt{constructor(t,e,i,o,s){super(t,e,i,o,s),this.type=5}_$AI(t,e=this){var i;if((t=null!==(i=zt(this,t,e,0))&&void 0!==i?i:xt)===pt)return;const o=this._$AH,s=t===xt&&o!==xt||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,r=t!==xt&&(o===xt||s);s&&this.element.removeEventListener(this.name,this,o),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this._$AH.handleEvent(t)}}class Lt{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){zt(this,t)}}const Nt=Q.litHtmlPolyfillSupport;null==Nt||Nt(Et,Ct),(null!==(J=Q.litHtmlVersions)&&void 0!==J?J:Q.litHtmlVersions=[]).push("2.8.0");
|
|
24
|
-
/**
|
|
25
|
-
* @license
|
|
26
|
-
* Copyright 2017 Google LLC
|
|
27
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
28
|
-
*/
|
|
29
|
-
var Bt,Rt;class Ut extends k{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,i)=>{var o,s;const r=null!==(o=null==i?void 0:i.renderBefore)&&void 0!==o?o:e;let n=r._$litPart$;if(void 0===n){const t=null!==(s=null==i?void 0:i.renderBefore)&&void 0!==s?s:null;r._$litPart$=n=new Ct(e.insertBefore(lt(),t),t,void 0,null!=i?i:{})}return n._$AI(t),n})(e,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 pt}}Ut.finalized=!0,Ut._$litElement$=!0,null===(Bt=globalThis.litElementHydrateSupport)||void 0===Bt||Bt.call(globalThis,{LitElement:Ut});const jt=globalThis.litElementPolyfillSupport;null==jt||jt({LitElement:Ut}),(null!==(Rt=globalThis.litElementVersions)&&void 0!==Rt?Rt:globalThis.litElementVersions=[]).push("3.3.3");
|
|
30
|
-
/**
|
|
31
|
-
* @license
|
|
32
|
-
* Copyright 2017 Google LLC
|
|
33
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
34
|
-
*/
|
|
35
|
-
const Dt=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(i){i.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(i){i.createProperty(e.key,t)}};
|
|
36
|
-
/**
|
|
37
|
-
* @license
|
|
38
|
-
* Copyright 2017 Google LLC
|
|
39
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
40
|
-
*/function Kt(t){return(e,i)=>void 0!==i?((t,e,i)=>{e.constructor.createProperty(i,t)})(t,e,i):Dt(t,e)
|
|
41
|
-
/**
|
|
42
|
-
* @license
|
|
43
|
-
* Copyright 2021 Google LLC
|
|
44
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
45
|
-
*/}var Pt;null===(Pt=window.HTMLSlotElement)||void 0===Pt||Pt.prototype.assignedElements;const Ht=((t,...e)=>{const o=1===t.length?t[0]:e.reduce(((e,i,o)=>e+(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.")})(i)+t[o+1]),t[0]);return new s(o,t,i)})`
|
|
1
|
+
import{css as e,LitElement as r,html as a}from"lit";import{property as c,customElement as o}from"lit/decorators.js";import{NuralyUIBaseMixin as l}from"@nuralyui/common/mixins";const t=e`
|
|
46
2
|
/* ========================================
|
|
47
3
|
* CHECKBOX CSS VARIABLES - FALLBACK VALUES
|
|
48
4
|
* ========================================
|
|
@@ -361,20 +317,20 @@ const Dt=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e
|
|
|
361
317
|
font-weight: 900;
|
|
362
318
|
}
|
|
363
319
|
}
|
|
364
|
-
`,
|
|
320
|
+
`,i=e=>class extends e{get checkboxElement(){var e;const r=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('input[type="checkbox"]');if(!r)throw new Error("CheckboxFocusMixin requires a checkbox input element");return r}focus(e={}){const r=this.checkboxElement;r&&r.focus({preventScroll:e.preventScroll})}blur(){const e=this.checkboxElement;e&&e.blur()}isFocused(){const e=this.checkboxElement;return!!e&&document.activeElement===e}get nativeElement(){var e;return(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('input[type="checkbox"]'))||null}},n=e=>class extends e{handleChange(e){var r;const a=e.target.checked,c=this.name,o=this.value;this.indeterminate&&(this.indeterminate=!1),this.checked=a,null===(r=this.dispatchCustomEvent)||void 0===r||r.call(this,"nr-change",{checked:a,value:o,name:c,indeterminate:!1})}handleFocus(e){var r;null===(r=this.dispatchCustomEvent)||void 0===r||r.call(this,"nr-focus",{originalEvent:e})}handleBlur(e){var r;null===(r=this.dispatchCustomEvent)||void 0===r||r.call(this,"nr-blur",{originalEvent:e})}handleKeydown(e){var r,a,c;if(null===(r=this.isActivationKey)||void 0===r?void 0:r.call(this,e)){e.preventDefault();const r=null===(a=this.shadowRoot)||void 0===a?void 0:a.querySelector('input[type="checkbox"]'),c=this.disabled;r&&!c&&r.click()}null===(c=this.dispatchCustomEvent)||void 0===c||c.call(this,"nr-keydown",{key:e.key,code:e.code,originalEvent:e})}handleMouseEnter(e){var r;null===(r=this.dispatchCustomEvent)||void 0===r||r.call(this,"nr-mouseenter",{originalEvent:e})}handleMouseLeave(e){var r;null===(r=this.dispatchCustomEvent)||void 0===r||r.call(this,"nr-mouseleave",{originalEvent:e})}};
|
|
365
321
|
/**
|
|
366
322
|
* @license
|
|
367
323
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
368
324
|
* SPDX-License-Identifier: MIT
|
|
369
325
|
*/
|
|
370
|
-
var
|
|
326
|
+
var h=function(e,r,a,c){for(var o,l=arguments.length,t=l<3?r:null===c?c=Object.getOwnPropertyDescriptor(r,a):c,i=e.length-1;i>=0;i--)(o=e[i])&&(t=(l<3?o(t):l>3?o(r,a,t):o(r,a))||t);return l>3&&t&&Object.defineProperty(r,a,t),t};let s=class extends(n(i(l(r)))){constructor(){super(...arguments),this.checked=!1,this.disabled=!1,this.indeterminate=!1,this._size="medium",this.autoFocus=!1,this.title="",this.tabIndex=0,this.required=!1,this.id=""}get size(){return this._size}set size(e){["small","medium","large"].includes(e)?this._size=e:(console.warn(`Invalid size value: ${e}. Using default size: medium`),this._size="medium")}connectedCallback(){super.connectedCallback(),this.validateDependencies(),this.autoFocus&&requestAnimationFrame((()=>{this.focus()}))}updated(e){super.updated(e),this.setAttribute("data-theme",this.currentTheme)}getCommonAttributes(){return{"data-theme":this.currentTheme,"data-size":this.size}}handleLabelClick(e){this.disabled||(e.preventDefault(),this.checked=!this.checked,this.dispatchEvent(new CustomEvent("nr-change",{detail:{checked:this.checked,value:this.value},bubbles:!0})))}render(){var e,r,c;const o=this.getCommonAttributes();return a`
|
|
371
327
|
<input
|
|
372
328
|
type="checkbox"
|
|
373
329
|
.checked=${this.checked}
|
|
374
330
|
.disabled=${this.disabled}
|
|
375
331
|
.indeterminate=${this.indeterminate}
|
|
376
|
-
name=${null!==(
|
|
377
|
-
value=${null!==(
|
|
332
|
+
name=${null!==(e=this.name)&&void 0!==e?e:""}
|
|
333
|
+
value=${null!==(r=this.value)&&void 0!==r?r:""}
|
|
378
334
|
id=${this.id}
|
|
379
335
|
title=${this.title}
|
|
380
336
|
?required=${this.required}
|
|
@@ -382,7 +338,7 @@ var Gt=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.
|
|
|
382
338
|
data-size="${o["data-size"]}"
|
|
383
339
|
aria-checked=${this.indeterminate?"mixed":this.checked?"true":"false"}
|
|
384
340
|
aria-disabled=${this.disabled?"true":"false"}
|
|
385
|
-
tabindex=${this.disabled?-1:null!==(
|
|
341
|
+
tabindex=${this.disabled?-1:null!==(c=this.tabIndex)&&void 0!==c?c:0}
|
|
386
342
|
@change=${this.handleChange}
|
|
387
343
|
@focus=${this.handleFocus}
|
|
388
344
|
@blur=${this.handleBlur}
|
|
@@ -393,4 +349,4 @@ var Gt=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.
|
|
|
393
349
|
<label class="checkbox-label" for=${this.id} @click=${this.handleLabelClick}>
|
|
394
350
|
<slot></slot>
|
|
395
351
|
</label>
|
|
396
|
-
`}};
|
|
352
|
+
`}};s.styles=t,h([c({type:Boolean,reflect:!0})],s.prototype,"checked",void 0),h([c({type:Boolean,reflect:!0})],s.prototype,"disabled",void 0),h([c({type:Boolean,reflect:!0})],s.prototype,"indeterminate",void 0),h([c({reflect:!0})],s.prototype,"size",null),h([c({type:String})],s.prototype,"name",void 0),h([c({type:String})],s.prototype,"value",void 0),h([c({type:Boolean})],s.prototype,"autoFocus",void 0),h([c({type:String})],s.prototype,"title",void 0),h([c({type:Number})],s.prototype,"tabIndex",void 0),h([c({type:Boolean})],s.prototype,"required",void 0),h([c({type:String})],s.prototype,"id",void 0),s=h([o("nr-checkbox")],s);export{s as NrCheckboxElement};
|