@nuralyui/checkbox 0.0.7 → 0.0.8
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 +291 -116
- package/checkbox.component.d.ts +3 -2
- package/checkbox.component.js +16 -2
- package/checkbox.component.js.map +1 -1
- package/checkbox.style.d.ts +1 -1
- package/checkbox.style.js +274 -67
- package/checkbox.style.js.map +1 -1
- package/package.json +1 -1
- package/checkbox.style.variables.d.ts +0 -2
- package/checkbox.style.variables.js +0 -38
- package/checkbox.style.variables.js.map +0 -1
package/bundle.js
CHANGED
|
@@ -3,213 +3,386 @@
|
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
5
|
*/
|
|
6
|
-
const t=window,
|
|
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
7
|
/**
|
|
8
8
|
* @license
|
|
9
9
|
* Copyright 2017 Google LLC
|
|
10
10
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
|
-
*/;var n;const l=window,c=l.trustedTypes,
|
|
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
12
|
/**
|
|
13
13
|
* @license
|
|
14
14
|
* Copyright 2017 Google LLC
|
|
15
15
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
16
16
|
*/
|
|
17
|
-
var
|
|
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
18
|
/**
|
|
19
19
|
* @license
|
|
20
20
|
* Copyright 2017 Google LLC
|
|
21
21
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
22
22
|
*/
|
|
23
|
-
var
|
|
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
24
|
/**
|
|
25
25
|
* @license
|
|
26
26
|
* Copyright 2017 Google LLC
|
|
27
27
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
28
28
|
*/
|
|
29
|
-
var
|
|
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
30
|
/**
|
|
31
31
|
* @license
|
|
32
32
|
* Copyright 2017 Google LLC
|
|
33
33
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
34
34
|
*/
|
|
35
|
-
const
|
|
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
36
|
/**
|
|
37
37
|
* @license
|
|
38
38
|
* Copyright 2017 Google LLC
|
|
39
39
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
40
|
-
*/function
|
|
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
41
|
/**
|
|
42
42
|
* @license
|
|
43
43
|
* Copyright 2021 Google LLC
|
|
44
44
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
45
|
-
*/}var
|
|
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)})`
|
|
46
|
+
/* ========================================
|
|
47
|
+
* CHECKBOX CSS VARIABLES - FALLBACK VALUES
|
|
48
|
+
* ========================================
|
|
49
|
+
* These fallback values ensure the component works even without theme files
|
|
50
|
+
*/
|
|
51
|
+
:host {
|
|
52
|
+
/* Base checkbox appearance */
|
|
53
|
+
--nuraly-checkbox-background: var(--nuraly-color-checkbox-background, #ffffff);
|
|
54
|
+
--nuraly-checkbox-text-color: var(--nuraly-color-checkbox-text, rgba(0, 0, 0, 0.88));
|
|
55
|
+
--nuraly-checkbox-label-color: var(--nuraly-color-checkbox-label, rgba(0, 0, 0, 0.88));
|
|
56
|
+
|
|
57
|
+
/* Checkbox borders and outline */
|
|
58
|
+
--nuraly-checkbox-border: var(--nuraly-border-width-checkbox, 1px) solid var(--nuraly-color-checkbox-border, #d9d9d9);
|
|
59
|
+
--nuraly-checkbox-border-radius: var(--nuraly-border-radius-checkbox, 2px);
|
|
60
|
+
--nuraly-checkbox-border-focus: var(--nuraly-border-width-checkbox, 1px) solid var(--nuraly-color-checkbox-border-focus, #1890ff);
|
|
61
|
+
--nuraly-checkbox-border-hover: var(--nuraly-border-width-checkbox, 1px) solid var(--nuraly-color-checkbox-border-hover, #40a9ff);
|
|
62
|
+
|
|
63
|
+
/* Checked/active states */
|
|
64
|
+
--nuraly-checkbox-checked-background: var(--nuraly-color-checkbox-checked-background, #1890ff);
|
|
65
|
+
--nuraly-checkbox-checked-border: var(--nuraly-color-checkbox-checked-border, #1890ff);
|
|
66
|
+
--nuraly-checkbox-checkmark-color: var(--nuraly-color-checkbox-checkmark, #ffffff);
|
|
67
|
+
--nuraly-checkbox-indeterminate-background: var(--nuraly-color-checkbox-indeterminate-background, #1890ff);
|
|
68
|
+
--nuraly-checkbox-indeterminate-mark-color: var(--nuraly-color-checkbox-indeterminate-mark, #ffffff);
|
|
69
|
+
|
|
70
|
+
/* Disabled states */
|
|
71
|
+
--nuraly-checkbox-disabled-background: var(--nuraly-color-checkbox-disabled-background, #f5f5f5);
|
|
72
|
+
--nuraly-checkbox-disabled-border: var(--nuraly-color-checkbox-disabled-border, #d9d9d9);
|
|
73
|
+
--nuraly-checkbox-disabled-text-color: var(--nuraly-color-checkbox-disabled-text, rgba(0, 0, 0, 0.25));
|
|
74
|
+
--nuraly-checkbox-disabled-checkmark-color: var(--nuraly-color-checkbox-disabled-checkmark, rgba(0, 0, 0, 0.25));
|
|
75
|
+
|
|
76
|
+
/* Focus states */
|
|
77
|
+
--nuraly-checkbox-focus-outline: var(--nuraly-size-checkbox-focus-outline, 2px) solid var(--nuraly-color-checkbox-focus-outline, rgba(24, 144, 255, 0.2));
|
|
78
|
+
|
|
79
|
+
/* Typography */
|
|
80
|
+
--nuraly-checkbox-font-family: var(--nuraly-font-family-checkbox, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif);
|
|
81
|
+
--nuraly-checkbox-font-size: var(--nuraly-font-size-checkbox, 14px);
|
|
82
|
+
--nuraly-checkbox-font-weight: var(--nuraly-font-weight-checkbox, 400);
|
|
83
|
+
--nuraly-checkbox-line-height: var(--nuraly-line-height-checkbox, 1.5715);
|
|
84
|
+
|
|
85
|
+
/* Sizing */
|
|
86
|
+
--nuraly-checkbox-size-small: var(--nuraly-size-checkbox-small, 14px);
|
|
87
|
+
--nuraly-checkbox-size-medium: var(--nuraly-size-checkbox-medium, 16px);
|
|
88
|
+
--nuraly-checkbox-size-large: var(--nuraly-size-checkbox-large, 18px);
|
|
89
|
+
|
|
90
|
+
/* Spacing */
|
|
91
|
+
--nuraly-checkbox-gap: var(--nuraly-spacing-checkbox-gap, 8px);
|
|
92
|
+
--nuraly-checkbox-padding: var(--nuraly-spacing-checkbox-padding, 4px);
|
|
93
|
+
|
|
94
|
+
/* Animation */
|
|
95
|
+
--nuraly-checkbox-transition: var(--nuraly-transition-checkbox, all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1));
|
|
96
|
+
|
|
97
|
+
/* ========================================
|
|
98
|
+
* LEGACY COMPATIBILITY VARIABLES
|
|
99
|
+
* ========================================
|
|
100
|
+
* Keep old variable names for backward compatibility
|
|
101
|
+
* These will be deprecated in future versions
|
|
102
|
+
*/
|
|
103
|
+
|
|
104
|
+
/* Legacy local variables for backward compatibility */
|
|
105
|
+
--nuraly-checkbox-local-filled-background-color: var(--nuraly-checkbox-checked-background);
|
|
106
|
+
--nuraly-checkbox-local-color: var(--nuraly-checkbox-text-color);
|
|
107
|
+
--nuraly-checkbox-local-empty-background-color: var(--nuraly-checkbox-background);
|
|
108
|
+
--nuraly-checkbox-local-disabled-background-color: var(--nuraly-checkbox-disabled-background);
|
|
109
|
+
--nuraly-checkbox-local-disabled-text-color: var(--nuraly-checkbox-disabled-text-color);
|
|
110
|
+
--nuraly-checkbox-local-empty-border: var(--nuraly-checkbox-border);
|
|
111
|
+
--nuraly-checkbox-local-symbol-color: var(--nuraly-checkbox-checkmark-color);
|
|
112
|
+
--nuraly-checkbox-local-focus-border: var(--nuraly-checkbox-border-focus);
|
|
113
|
+
--nuraly-checkbox-local-focus-outline: var(--nuraly-checkbox-focus-outline);
|
|
114
|
+
--nuraly-checkbox-local-font-family: var(--nuraly-checkbox-font-family);
|
|
115
|
+
--nuraly-checkbox-local-border-radius: var(--nuraly-checkbox-border-radius);
|
|
116
|
+
--nuraly-checkbox-local-gap: var(--nuraly-checkbox-gap);
|
|
117
|
+
|
|
118
|
+
/* Legacy size variables */
|
|
119
|
+
--nuraly-checkbox-local-medium-width: var(--nuraly-checkbox-size-medium);
|
|
120
|
+
--nuraly-checkbox-local-medium-height: var(--nuraly-checkbox-size-medium);
|
|
121
|
+
--nuraly-checkbox-local-small-width: var(--nuraly-checkbox-size-small);
|
|
122
|
+
--nuraly-checkbox-local-small-height: var(--nuraly-checkbox-size-small);
|
|
123
|
+
--nuraly-checkbox-local-large-width: var(--nuraly-checkbox-size-large);
|
|
124
|
+
--nuraly-checkbox-local-large-height: var(--nuraly-checkbox-size-large);
|
|
125
|
+
|
|
126
|
+
/* Legacy checkmark sizing */
|
|
127
|
+
--nuraly-checkbox-local-small-indeterminate-size: calc(var(--nuraly-checkbox-size-small) * 0.7);
|
|
128
|
+
--nuraly-checkbox-local-large-indeterminate-size: calc(var(--nuraly-checkbox-size-large) * 0.7);
|
|
129
|
+
--nuraly-checkbox-local-medium-indeterminate-size: calc(var(--nuraly-checkbox-size-medium) * 0.7);
|
|
130
|
+
|
|
131
|
+
--nuraly-checkbox-local-small-checked-width: calc(var(--nuraly-checkbox-size-small) * 0.14);
|
|
132
|
+
--nuraly-checkbox-local-small-checked-height: calc(var(--nuraly-checkbox-size-small) * 0.5);
|
|
133
|
+
--nuraly-checkbox-local-medium-checked-width: calc(var(--nuraly-checkbox-size-medium) * 0.19);
|
|
134
|
+
--nuraly-checkbox-local-medium-checked-height: calc(var(--nuraly-checkbox-size-medium) * 0.56);
|
|
135
|
+
--nuraly-checkbox-local-large-checked-width: calc(var(--nuraly-checkbox-size-large) * 0.22);
|
|
136
|
+
--nuraly-checkbox-local-large-checked-height: calc(var(--nuraly-checkbox-size-large) * 0.56);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/* ========================================
|
|
140
|
+
* CHECKBOX COMPONENT STYLES
|
|
141
|
+
* ========================================
|
|
142
|
+
* Modern checkbox component with theme-aware styling
|
|
143
|
+
* Uses CSS custom properties for consistent theming
|
|
144
|
+
*/
|
|
145
|
+
|
|
46
146
|
:host {
|
|
47
147
|
display: flex;
|
|
48
148
|
align-items: center;
|
|
49
149
|
flex-wrap: wrap;
|
|
50
|
-
gap: var(--
|
|
51
|
-
font-family: var(--
|
|
52
|
-
|
|
150
|
+
gap: var(--nuraly-checkbox-gap);
|
|
151
|
+
font-family: var(--nuraly-checkbox-font-family);
|
|
152
|
+
font-size: var(--nuraly-checkbox-font-size);
|
|
153
|
+
font-weight: var(--nuraly-checkbox-font-weight);
|
|
154
|
+
line-height: var(--nuraly-checkbox-line-height);
|
|
155
|
+
color: var(--nuraly-checkbox-text-color);
|
|
156
|
+
cursor: pointer;
|
|
157
|
+
transition: var(--nuraly-checkbox-transition);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/* ========================================
|
|
161
|
+
* CHECKBOX INPUT ELEMENT STYLES
|
|
162
|
+
* ======================================== */
|
|
163
|
+
|
|
164
|
+
input {
|
|
165
|
+
appearance: none;
|
|
166
|
+
-webkit-appearance: none;
|
|
167
|
+
-moz-appearance: none;
|
|
168
|
+
cursor: pointer;
|
|
169
|
+
position: relative;
|
|
170
|
+
border-radius: var(--nuraly-checkbox-border-radius);
|
|
171
|
+
background-color: var(--nuraly-checkbox-background);
|
|
172
|
+
border: var(--nuraly-checkbox-border);
|
|
173
|
+
transition: var(--nuraly-checkbox-transition);
|
|
174
|
+
margin: 0;
|
|
175
|
+
outline: none;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/* ========================================
|
|
179
|
+
* SIZE VARIATIONS
|
|
180
|
+
* ======================================== */
|
|
181
|
+
|
|
182
|
+
/* Medium size (default) */
|
|
183
|
+
input {
|
|
184
|
+
width: var(--nuraly-checkbox-size-medium);
|
|
185
|
+
height: var(--nuraly-checkbox-size-medium);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
:host([size='small']) input {
|
|
189
|
+
width: var(--nuraly-checkbox-size-small);
|
|
190
|
+
height: var(--nuraly-checkbox-size-small);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
:host([size='large']) input {
|
|
194
|
+
width: var(--nuraly-checkbox-size-large);
|
|
195
|
+
height: var(--nuraly-checkbox-size-large);
|
|
53
196
|
}
|
|
54
197
|
|
|
198
|
+
/* ========================================
|
|
199
|
+
* CHECKBOX STATE STYLES
|
|
200
|
+
* ======================================== */
|
|
201
|
+
|
|
202
|
+
/* Empty/unchecked state */
|
|
55
203
|
:host(:not([checked]):not([indeterminate]):not([disabled])) input {
|
|
56
|
-
background-color: var(--
|
|
57
|
-
border: var(--
|
|
204
|
+
background-color: var(--nuraly-checkbox-background);
|
|
205
|
+
border: var(--nuraly-checkbox-border);
|
|
58
206
|
}
|
|
59
207
|
|
|
208
|
+
/* Checked and indeterminate states */
|
|
60
209
|
:host(:not([disabled])[checked]) input,
|
|
61
210
|
:host(:not([disabled])[indeterminate]) input {
|
|
62
|
-
background-color: var(--
|
|
211
|
+
background-color: var(--nuraly-checkbox-checked-background);
|
|
212
|
+
border: 1px solid var(--nuraly-checkbox-checked-border);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/* Hover states for interactive elements */
|
|
216
|
+
:host(:not([disabled]):hover) input {
|
|
217
|
+
border: var(--nuraly-checkbox-border-hover);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
:host(:not([disabled]):hover[checked]) input,
|
|
221
|
+
:host(:not([disabled]):hover[indeterminate]) input {
|
|
222
|
+
background-color: var(--nuraly-checkbox-checked-background);
|
|
223
|
+
border: 1px solid var(--nuraly-checkbox-border-hover);
|
|
224
|
+
filter: brightness(1.1);
|
|
63
225
|
}
|
|
226
|
+
|
|
227
|
+
/* Focus states */
|
|
228
|
+
input:focus,
|
|
229
|
+
input:focus-visible {
|
|
230
|
+
border: var(--nuraly-checkbox-border-focus);
|
|
231
|
+
outline: var(--nuraly-checkbox-focus-outline);
|
|
232
|
+
outline-offset: 2px;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/* ========================================
|
|
236
|
+
* DISABLED STATE
|
|
237
|
+
* ======================================== */
|
|
238
|
+
|
|
64
239
|
:host([disabled]) {
|
|
65
|
-
color: var(--
|
|
240
|
+
color: var(--nuraly-checkbox-disabled-text-color);
|
|
241
|
+
cursor: not-allowed;
|
|
66
242
|
}
|
|
243
|
+
|
|
67
244
|
:host([disabled]) input {
|
|
68
|
-
background-color: var(--
|
|
245
|
+
background-color: var(--nuraly-checkbox-disabled-background);
|
|
246
|
+
border: 1px solid var(--nuraly-checkbox-disabled-border);
|
|
69
247
|
cursor: not-allowed;
|
|
70
248
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
border-radius: var(--hybrid-checkbox-border-radius, var(--hybrid-checkbox-local-border-radius));
|
|
78
|
-
}
|
|
249
|
+
|
|
250
|
+
/* ========================================
|
|
251
|
+
* CHECKMARK AND INDETERMINATE SYMBOLS
|
|
252
|
+
* ======================================== */
|
|
253
|
+
|
|
254
|
+
/* Base symbol styling */
|
|
79
255
|
input:after {
|
|
80
|
-
color: var(--
|
|
256
|
+
color: var(--nuraly-checkbox-checkmark-color);
|
|
81
257
|
position: absolute;
|
|
82
258
|
left: 50%;
|
|
83
259
|
top: 50%;
|
|
84
260
|
transform: translate(-50%, -51%);
|
|
85
|
-
|
|
86
|
-
input:focus {
|
|
87
|
-
border: var(--hybrid-checkbox-focus-border, var(--hybrid-checkbox-local-focus-border));
|
|
88
|
-
outline: var(--hybrid-checkbox-focus-outline, var(--hybrid-checkbox-local-focus-outline));
|
|
89
|
-
}
|
|
90
|
-
:host([size='large']) input {
|
|
91
|
-
width: var(--hybrid-checkbox-large-width, var(--hybrid-checkbox-local-large-width));
|
|
92
|
-
height: var(--hybrid-checkbox-large-height, var(--hybrid-checkbox-local-large-height));
|
|
93
|
-
}
|
|
94
|
-
:host([size='small']) input {
|
|
95
|
-
width: var(--hybrid-checkbox-small-width, var(--hybrid-checkbox-local-small-width));
|
|
96
|
-
height: var(--hybrid-checkbox-small-height, var(--hybrid-checkbox-local-small-height));
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
:host([indeterminate][size='medium']) input:after {
|
|
100
|
-
font-size: var(--hybrid-checkbox-medium-indeterminate-size, var(--hybrid-checkbox-local-medium-indeterminate-size));
|
|
101
|
-
}
|
|
102
|
-
:host([indeterminate][size='large']) input:after {
|
|
103
|
-
font-size: var(--hybrid-checkbox-large-indeterminate-size, var(--hybrid-checkbox-local-large-indeterminate-size));
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
:host([indeterminate][size='small']) input:after {
|
|
107
|
-
font-size: var(--hybrid-checkbox-small-indeterminate-size, var(--hybrid-checkbox-local-small-indeterminate-size));
|
|
261
|
+
transition: var(--nuraly-checkbox-transition);
|
|
108
262
|
}
|
|
109
263
|
|
|
264
|
+
/* Checked state checkmark */
|
|
110
265
|
:host([checked]) input:after {
|
|
111
|
-
border: solid;
|
|
266
|
+
border: solid var(--nuraly-checkbox-checkmark-color);
|
|
112
267
|
border-width: 0 2px 2px 0;
|
|
113
268
|
transform: translate(-50%, -51%) rotate(45deg);
|
|
114
269
|
content: '';
|
|
270
|
+
width: var(--nuraly-checkbox-local-medium-checked-width); /* Default to medium size */
|
|
271
|
+
height: var(--nuraly-checkbox-local-medium-checked-height); /* Default to medium size */
|
|
115
272
|
}
|
|
273
|
+
|
|
274
|
+
/* Checkmark sizing per size variant */
|
|
116
275
|
:host([checked][size='small']) input:after {
|
|
117
|
-
width: var(--
|
|
118
|
-
height: var(--
|
|
119
|
-
}
|
|
120
|
-
:host([checked][size='large']) input:after {
|
|
121
|
-
width: var(--hybrid-checkbox-large-checked-width, var(--hybrid-checkbox-local-large-checked-width));
|
|
122
|
-
height: var(--hybrid-checkbox-large-checked-height, var(--hybrid-checkbox-local-large-checked-height));
|
|
276
|
+
width: var(--nuraly-checkbox-local-small-checked-width);
|
|
277
|
+
height: var(--nuraly-checkbox-local-small-checked-height);
|
|
123
278
|
}
|
|
279
|
+
|
|
124
280
|
:host([checked][size='medium']) input:after {
|
|
125
|
-
width: var(--
|
|
126
|
-
height: var(--
|
|
281
|
+
width: var(--nuraly-checkbox-local-medium-checked-width);
|
|
282
|
+
height: var(--nuraly-checkbox-local-medium-checked-height);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
:host([checked][size='large']) input:after {
|
|
286
|
+
width: var(--nuraly-checkbox-local-large-checked-width);
|
|
287
|
+
height: var(--nuraly-checkbox-local-large-checked-height);
|
|
127
288
|
}
|
|
128
289
|
|
|
290
|
+
/* Indeterminate state symbol */
|
|
129
291
|
:host([indeterminate]:not([checked])) input:after {
|
|
130
292
|
content: '-';
|
|
293
|
+
color: var(--nuraly-checkbox-indeterminate-mark-color);
|
|
294
|
+
font-weight: bold;
|
|
295
|
+
transform: translate(-50%, -51%);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/* Indeterminate symbol sizing per size variant */
|
|
299
|
+
:host([indeterminate][size='small']) input:after {
|
|
300
|
+
font-size: var(--nuraly-checkbox-local-small-indeterminate-size);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
:host([indeterminate][size='medium']) input:after {
|
|
304
|
+
font-size: var(--nuraly-checkbox-local-medium-indeterminate-size);
|
|
131
305
|
}
|
|
306
|
+
|
|
307
|
+
:host([indeterminate][size='large']) input:after {
|
|
308
|
+
font-size: var(--nuraly-checkbox-local-large-indeterminate-size);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/* Empty state - no symbol */
|
|
132
312
|
:host(:not([checked]):not([indeterminate])) input:after {
|
|
133
313
|
content: '';
|
|
134
314
|
}
|
|
135
315
|
|
|
136
316
|
/* ========================================
|
|
137
|
-
*
|
|
138
|
-
* ========================================
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
--hybrid-checkbox-local-empty-border: 1px solid #ffffff;
|
|
144
|
-
--hybrid-checkbox-local-empty-background-color: #161616;
|
|
145
|
-
--hybrid-checkbox-local-filled-background-color: #ffffff;
|
|
146
|
-
--hybrid-checkbox-local-symbol-color: #161616;
|
|
147
|
-
--hybrid-checkbox-local-focus-outline: 2px solid #ffffff;
|
|
148
|
-
--hybrid-checkbox-local-focus-border: 2px solid #161616;
|
|
149
|
-
--hybrid-checkbox-local-disabled-background-color: #6f6f6f;
|
|
150
|
-
--hybrid-checkbox-local-disabled-text-color: #6f6f6f;
|
|
317
|
+
* DISABLED STATE SYMBOLS
|
|
318
|
+
* ======================================== */
|
|
319
|
+
|
|
320
|
+
:host([disabled]) input:after {
|
|
321
|
+
color: var(--nuraly-checkbox-disabled-checkmark-color);
|
|
322
|
+
border-color: var(--nuraly-checkbox-disabled-checkmark-color);
|
|
151
323
|
}
|
|
152
324
|
|
|
153
|
-
|
|
154
|
-
|
|
325
|
+
/* ========================================
|
|
326
|
+
* LABEL TEXT STYLING
|
|
327
|
+
* ======================================== */
|
|
328
|
+
|
|
329
|
+
.checkbox-label {
|
|
330
|
+
flex: 1;
|
|
331
|
+
cursor: pointer;
|
|
332
|
+
user-select: none;
|
|
333
|
+
transition: var(--nuraly-checkbox-transition);
|
|
155
334
|
}
|
|
156
|
-
|
|
157
|
-
:host {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
--hybrid-checkbox-local-medium-checked-width: 3px;
|
|
187
|
-
--hybrid-checkbox-local-medium-checked-height: 9px;
|
|
188
|
-
--hybrid-checkbox-local-large-checked-width: 4px;
|
|
189
|
-
--hybrid-checkbox-local-large-checked-height: 10px;
|
|
190
|
-
}
|
|
191
|
-
`],Ht=t=>class extends t{constructor(){super(...arguments),this.handleSystemThemeChange=()=>{this.closest("[data-theme]")||document.documentElement.hasAttribute("data-theme")||this.requestUpdate()}}connectedCallback(){super.connectedCallback(),this.setupThemeObserver(),this.setupSystemThemeListener()}disconnectedCallback(){var t,i;super.disconnectedCallback(),null===(t=this.themeObserver)||void 0===t||t.disconnect(),null===(i=this.mediaQuery)||void 0===i||i.removeEventListener("change",this.handleSystemThemeChange)}get currentTheme(){var t,i;const e=(null===(t=this.closest("[data-theme]"))||void 0===t?void 0:t.getAttribute("data-theme"))||document.documentElement.getAttribute("data-theme");return"dark"===e||"light"===e?e:(null===(i=window.matchMedia)||void 0===i?void 0:i.call(window,"(prefers-color-scheme: dark)").matches)?"dark":"light"}setupThemeObserver(){this.themeObserver=new MutationObserver((()=>{this.requestUpdate()})),this.themeObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})}setupSystemThemeListener(){window.matchMedia&&(this.mediaQuery=window.matchMedia("(prefers-color-scheme: dark)"),this.mediaQuery.addEventListener("change",this.handleSystemThemeChange))}},Vt=()=>{var t;return void 0!==globalThis.litElementVersions||"undefined"!=typeof process&&"development"===(null===(t=process.env)||void 0===t?void 0:t.NODE_ENV)||"undefined"!=typeof window&&("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname)},Wt=t=>class extends t{constructor(){super(...arguments),this.requiredComponents=[]}validateDependencies(){if(Vt())for(const t of this.requiredComponents)if(!this.isComponentAvailable(t))throw new Error(`Required component "${t}" is not registered. Please import and register the component before using ${this.tagName.toLowerCase()}. Example: import '@nuralyui/${t}';`)}validateDependenciesWithHandler(t){if(!Vt())return!0;let i=!0;for(const e of this.requiredComponents)if(!this.isComponentAvailable(e)){i=!1;const s=new Error(`Required component "${e}" is not registered. Please import and register the component before using ${this.tagName.toLowerCase()}.`);t?t(e,s):console.error(s.message)}return i}isComponentAvailable(t){return!!customElements.get(t)}getMissingDependencies(){return this.requiredComponents.filter((t=>!this.isComponentAvailable(t)))}areDependenciesAvailable(){return this.requiredComponents.every((t=>this.isComponentAvailable(t)))}addRequiredComponent(t){this.requiredComponents.includes(t)||this.requiredComponents.push(t)}removeRequiredComponent(t){const i=this.requiredComponents.indexOf(t);i>-1&&this.requiredComponents.splice(i,1)}},Zt=t=>class extends t{dispatchCustomEvent(t,i){this.dispatchEvent(new CustomEvent(t,{detail:i,bubbles:!0,composed:!0}))}dispatchEventWithMetadata(t,i){var e;const s=Object.assign(Object.assign({},i),{timestamp:Date.now(),componentName:(null===(e=this.tagName)||void 0===e?void 0:e.toLowerCase())||"unknown"});this.dispatchCustomEvent(t,s)}dispatchInputEvent(t,i){const e=Object.assign({target:i.target||this,value:i.value,originalEvent:i.originalEvent},i);this.dispatchCustomEvent(t,e)}dispatchFocusEvent(t,i){const e=Object.assign({target:i.target||this,value:i.value,focused:i.focused,cursorPosition:i.cursorPosition,selectedText:i.selectedText},i);this.dispatchCustomEvent(t,e)}dispatchValidationEvent(t,i){var e;const s=Object.assign({target:i.target||this,value:i.value,isValid:null!==(e=i.isValid)&&void 0!==e&&e,error:i.error},i);this.dispatchCustomEvent(t,s)}dispatchActionEvent(t,i){const e=Object.assign({target:i.target||this,action:i.action,previousValue:i.previousValue,newValue:i.newValue},i);this.dispatchCustomEvent(t,e)}isReadonlyKeyAllowed(t){if(t.ctrlKey||t.metaKey){return["KeyA","KeyC"].includes(t.code)}return["Tab","Escape","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(t.key)}isActivationKey(t){return"Enter"===t.key||" "===t.key}},Jt=t=>class extends t{get checkboxElement(){var t;const i=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('input[type="checkbox"]');if(!i)throw new Error("CheckboxFocusMixin requires a checkbox input element");return i}focus(t={}){const i=this.checkboxElement;i&&i.focus({preventScroll:t.preventScroll})}blur(){const t=this.checkboxElement;t&&t.blur()}isFocused(){const t=this.checkboxElement;return!!t&&document.activeElement===t}get nativeElement(){var t;return(null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('input[type="checkbox"]'))||null}},Gt=t=>class extends t{handleChange(t){var i;const e=t.target.checked,s=this.name,o=this.value;this.indeterminate&&(this.indeterminate=!1),this.checked=e,null===(i=this.dispatchCustomEvent)||void 0===i||i.call(this,"nr-change",{checked:e,value:o,name:s,indeterminate:!1})}handleFocus(t){var i;null===(i=this.dispatchCustomEvent)||void 0===i||i.call(this,"nr-focus",{originalEvent:t})}handleBlur(t){var i;null===(i=this.dispatchCustomEvent)||void 0===i||i.call(this,"nr-blur",{originalEvent:t})}handleKeydown(t){var i,e,s;if(null===(i=this.isActivationKey)||void 0===i?void 0:i.call(this,t)){t.preventDefault();const i=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('input[type="checkbox"]'),s=this.disabled;i&&!s&&i.click()}null===(s=this.dispatchCustomEvent)||void 0===s||s.call(this,"nr-keydown",{key:t.key,code:t.code,originalEvent:t})}handleMouseEnter(t){var i;null===(i=this.dispatchCustomEvent)||void 0===i||i.call(this,"nr-mouseenter",{originalEvent:t})}handleMouseLeave(t){var i;null===(i=this.dispatchCustomEvent)||void 0===i||i.call(this,"nr-mouseleave",{originalEvent:t})}};
|
|
335
|
+
|
|
336
|
+
:host([disabled]) .checkbox-label {
|
|
337
|
+
cursor: not-allowed;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/* ========================================
|
|
341
|
+
* ACCESSIBILITY IMPROVEMENTS
|
|
342
|
+
* ======================================== */
|
|
343
|
+
|
|
344
|
+
@media (prefers-reduced-motion: reduce) {
|
|
345
|
+
:host,
|
|
346
|
+
input,
|
|
347
|
+
input:after,
|
|
348
|
+
.checkbox-label {
|
|
349
|
+
transition: none;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
/* High contrast mode support */
|
|
354
|
+
@media (prefers-contrast: high) {
|
|
355
|
+
input {
|
|
356
|
+
border-width: 2px;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
:host([checked]) input:after,
|
|
360
|
+
:host([indeterminate]) input:after {
|
|
361
|
+
font-weight: 900;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
`,Ft=Ht,Vt=t=>class extends t{constructor(){super(...arguments),this.handleSystemThemeChange=()=>{this.closest("[data-theme]")||document.documentElement.hasAttribute("data-theme")||this.requestUpdate()}}connectedCallback(){super.connectedCallback(),this.setupThemeObserver(),this.setupDesignSystemObserver(),this.setupSystemThemeListener()}disconnectedCallback(){var t,e,i;super.disconnectedCallback(),null===(t=this.themeObserver)||void 0===t||t.disconnect(),null===(e=this.designSystemObserver)||void 0===e||e.disconnect(),null===(i=this.mediaQuery)||void 0===i||i.removeEventListener("change",this.handleSystemThemeChange)}get currentTheme(){var t,e;const i=(null===(t=this.closest("[data-theme]"))||void 0===t?void 0:t.getAttribute("data-theme"))||document.documentElement.getAttribute("data-theme");return i||((null===(e=window.matchMedia)||void 0===e?void 0:e.call(window,"(prefers-color-scheme: dark)").matches)?"dark":"light")}get currentDesignSystem(){var t;const e=(null===(t=this.closest("[design-system]"))||void 0===t?void 0:t.getAttribute("design-system"))||document.documentElement.getAttribute("design-system");return"carbon"===e?e:"default"}setupThemeObserver(){this.themeObserver=new MutationObserver((()=>{this.requestUpdate()})),this.themeObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})}setupDesignSystemObserver(){this.designSystemObserver=new MutationObserver((()=>{this.requestUpdate()})),this.designSystemObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["design-system"]})}setupSystemThemeListener(){window.matchMedia&&(this.mediaQuery=window.matchMedia("(prefers-color-scheme: dark)"),this.mediaQuery.addEventListener("change",this.handleSystemThemeChange))}},qt=()=>{var t;return void 0!==globalThis.litElementVersions||"undefined"!=typeof process&&"development"===(null===(t=process.env)||void 0===t?void 0:t.NODE_ENV)||"undefined"!=typeof window&&("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname)},Yt=t=>class extends t{constructor(){super(...arguments),this.requiredComponents=[]}validateDependencies(){if(qt())for(const t of this.requiredComponents)if(!this.isComponentAvailable(t))throw new Error(`Required component "${t}" is not registered. Please import and register the component before using ${this.tagName.toLowerCase()}. Example: import '@nuralyui/${t}';`)}validateDependenciesWithHandler(t){if(!qt())return!0;let e=!0;for(const i of this.requiredComponents)if(!this.isComponentAvailable(i)){e=!1;const o=new Error(`Required component "${i}" is not registered. Please import and register the component before using ${this.tagName.toLowerCase()}.`);t?t(i,o):console.error(o.message)}return e}isComponentAvailable(t){return!!customElements.get(t)}getMissingDependencies(){return this.requiredComponents.filter((t=>!this.isComponentAvailable(t)))}areDependenciesAvailable(){return this.requiredComponents.every((t=>this.isComponentAvailable(t)))}addRequiredComponent(t){this.requiredComponents.includes(t)||this.requiredComponents.push(t)}removeRequiredComponent(t){const e=this.requiredComponents.indexOf(t);e>-1&&this.requiredComponents.splice(e,1)}},Wt=t=>class extends t{dispatchCustomEvent(t,e){this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0,composed:!0}))}dispatchEventWithMetadata(t,e){var i;const o=Object.assign(Object.assign({},e),{timestamp:Date.now(),componentName:(null===(i=this.tagName)||void 0===i?void 0:i.toLowerCase())||"unknown"});this.dispatchCustomEvent(t,o)}dispatchInputEvent(t,e){const i=Object.assign({target:e.target||this,value:e.value,originalEvent:e.originalEvent},e);this.dispatchCustomEvent(t,i)}dispatchFocusEvent(t,e){const i=Object.assign({target:e.target||this,value:e.value,focused:e.focused,cursorPosition:e.cursorPosition,selectedText:e.selectedText},e);this.dispatchCustomEvent(t,i)}dispatchValidationEvent(t,e){var i;const o=Object.assign({target:e.target||this,value:e.value,isValid:null!==(i=e.isValid)&&void 0!==i&&i,error:e.error},e);this.dispatchCustomEvent(t,o)}dispatchActionEvent(t,e){const i=Object.assign({target:e.target||this,action:e.action,previousValue:e.previousValue,newValue:e.newValue},e);this.dispatchCustomEvent(t,i)}isReadonlyKeyAllowed(t){if(t.ctrlKey||t.metaKey){return["KeyA","KeyC"].includes(t.code)}return["Tab","Escape","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(t.key)}isActivationKey(t){return"Enter"===t.key||" "===t.key}},Xt=t=>class extends t{get checkboxElement(){var t;const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('input[type="checkbox"]');if(!e)throw new Error("CheckboxFocusMixin requires a checkbox input element");return e}focus(t={}){const e=this.checkboxElement;e&&e.focus({preventScroll:t.preventScroll})}blur(){const t=this.checkboxElement;t&&t.blur()}isFocused(){const t=this.checkboxElement;return!!t&&document.activeElement===t}get nativeElement(){var t;return(null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('input[type="checkbox"]'))||null}},Zt=t=>class extends t{handleChange(t){var e;const i=t.target.checked,o=this.name,s=this.value;this.indeterminate&&(this.indeterminate=!1),this.checked=i,null===(e=this.dispatchCustomEvent)||void 0===e||e.call(this,"nr-change",{checked:i,value:s,name:o,indeterminate:!1})}handleFocus(t){var e;null===(e=this.dispatchCustomEvent)||void 0===e||e.call(this,"nr-focus",{originalEvent:t})}handleBlur(t){var e;null===(e=this.dispatchCustomEvent)||void 0===e||e.call(this,"nr-blur",{originalEvent:t})}handleKeydown(t){var e,i,o;if(null===(e=this.isActivationKey)||void 0===e?void 0:e.call(this,t)){t.preventDefault();const e=null===(i=this.shadowRoot)||void 0===i?void 0:i.querySelector('input[type="checkbox"]'),o=this.disabled;e&&!o&&e.click()}null===(o=this.dispatchCustomEvent)||void 0===o||o.call(this,"nr-keydown",{key:t.key,code:t.code,originalEvent:t})}handleMouseEnter(t){var e;null===(e=this.dispatchCustomEvent)||void 0===e||e.call(this,"nr-mouseenter",{originalEvent:t})}handleMouseLeave(t){var e;null===(e=this.dispatchCustomEvent)||void 0===e||e.call(this,"nr-mouseleave",{originalEvent:t})}};
|
|
192
365
|
/**
|
|
193
366
|
* @license
|
|
194
367
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
195
368
|
* SPDX-License-Identifier: MIT
|
|
196
369
|
*/
|
|
197
|
-
var
|
|
370
|
+
var Gt=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let Jt=class extends(Zt(Xt((t=>Yt(Vt(Wt(t))))(Ut)))){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(t){["small","medium","large"].includes(t)?this._size=t:(console.warn(`Invalid size value: ${t}. Using default size: medium`),this._size="medium")}connectedCallback(){super.connectedCallback(),this.validateDependencies(),this.autoFocus&&requestAnimationFrame((()=>{this.focus()}))}updated(t){super.updated(t),this.setAttribute("data-theme",this.currentTheme)}getCommonAttributes(){return{"data-theme":this.currentTheme,"data-size":this.size}}handleLabelClick(t){this.disabled||(t.preventDefault(),this.checked=!this.checked,this.dispatchEvent(new CustomEvent("nr-change",{detail:{checked:this.checked,value:this.value},bubbles:!0})))}render(){var t,e,i;const o=this.getCommonAttributes();return mt`
|
|
198
371
|
<input
|
|
199
372
|
type="checkbox"
|
|
200
373
|
.checked=${this.checked}
|
|
201
374
|
.disabled=${this.disabled}
|
|
202
375
|
.indeterminate=${this.indeterminate}
|
|
203
376
|
name=${null!==(t=this.name)&&void 0!==t?t:""}
|
|
204
|
-
value=${null!==(
|
|
377
|
+
value=${null!==(e=this.value)&&void 0!==e?e:""}
|
|
205
378
|
id=${this.id}
|
|
206
379
|
title=${this.title}
|
|
207
380
|
?required=${this.required}
|
|
208
|
-
data-theme="${
|
|
209
|
-
data-size="${
|
|
381
|
+
data-theme="${o["data-theme"]}"
|
|
382
|
+
data-size="${o["data-size"]}"
|
|
210
383
|
aria-checked=${this.indeterminate?"mixed":this.checked?"true":"false"}
|
|
211
384
|
aria-disabled=${this.disabled?"true":"false"}
|
|
212
|
-
tabindex=${this.disabled?-1:null!==(
|
|
385
|
+
tabindex=${this.disabled?-1:null!==(i=this.tabIndex)&&void 0!==i?i:0}
|
|
213
386
|
@change=${this.handleChange}
|
|
214
387
|
@focus=${this.handleFocus}
|
|
215
388
|
@blur=${this.handleBlur}
|
|
@@ -217,5 +390,7 @@ var Qt=function(t,i,e,s){for(var o,h=arguments.length,r=h<3?i:null===s?s=Object.
|
|
|
217
390
|
@mouseenter=${this.handleMouseEnter}
|
|
218
391
|
@mouseleave=${this.handleMouseLeave}
|
|
219
392
|
/>
|
|
220
|
-
<
|
|
221
|
-
|
|
393
|
+
<label class="checkbox-label" for=${this.id} @click=${this.handleLabelClick}>
|
|
394
|
+
<slot></slot>
|
|
395
|
+
</label>
|
|
396
|
+
`}};Jt.styles=Ft,Gt([Kt({type:Boolean,reflect:!0})],Jt.prototype,"checked",void 0),Gt([Kt({type:Boolean,reflect:!0})],Jt.prototype,"disabled",void 0),Gt([Kt({type:Boolean,reflect:!0})],Jt.prototype,"indeterminate",void 0),Gt([Kt({reflect:!0})],Jt.prototype,"size",null),Gt([Kt({type:String})],Jt.prototype,"name",void 0),Gt([Kt({type:String})],Jt.prototype,"value",void 0),Gt([Kt({type:Boolean})],Jt.prototype,"autoFocus",void 0),Gt([Kt({type:String})],Jt.prototype,"title",void 0),Gt([Kt({type:Number})],Jt.prototype,"tabIndex",void 0),Gt([Kt({type:Boolean})],Jt.prototype,"required",void 0),Gt([Kt({type:String})],Jt.prototype,"id",void 0),Jt=Gt([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:i,elements:o}=e;return{kind:i,elements:o,finisher(e){customElements.define(t,e)}}})(t,e))("nr-checkbox")],Jt);export{Jt as NrCheckboxElement};
|