Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@umbraco-ui/uui-checkbox

Package Overview
Dependencies
Maintainers
3
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@umbraco-ui/uui-checkbox - npm Package Compare versions

Comparing version 0.0.10 to 0.0.11

6

dist/uui-checkbox.min.js

@@ -13,7 +13,7 @@ var We=Object.defineProperty,Fe=Object.defineProperties;var Ge=Object.getOwnPropertyDescriptors;var ye=Object.getOwnPropertySymbols;var Je=Object.prototype.hasOwnProperty,Ze=Object.prototype.propertyIsEnumerable;var ge=(p,v,f)=>v in p?We(p,v,{enumerable:!0,configurable:!0,writable:!0,value:f}):p[v]=f,j=(p,v)=>{for(var f in v||(v={}))Je.call(v,f)&&ge(p,f,v[f]);if(ye)for(var f of ye(v))Ze.call(v,f)&&ge(p,f,v[f]);return p},D=(p,v)=>Fe(p,Ge(v));(function(p){typeof define=="function"&&define.amd?define(p):p()})(function(){"use strict";/**

* SPDX-License-Identifier: BSD-3-Clause
*/var W,F;const M=globalThis.trustedTypes,se=M?M.createPolicy("lit-html",{createHTML:r=>r}):void 0,y=`lit$${(Math.random()+"").slice(9)}$`,re="?"+y,ke=`<${re}>`,x=document,P=(r="")=>x.createComment(r),U=r=>r===null||typeof r!="object"&&typeof r!="function",oe=Array.isArray,xe=r=>{var e;return oe(r)||typeof((e=r)===null||e===void 0?void 0:e[Symbol.iterator])=="function"},H=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ne=/-->/g,le=/>/g,A=/>|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,ae=/'/g,ce=/"/g,he=/^(?:script|style|textarea)$/i,ue=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),R=ue(1),Se=ue(2),S=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),de=new WeakMap,Ee=(r,e,t)=>{var i,s;const o=(i=t==null?void 0:t.renderBefore)!==null&&i!==void 0?i:e;let n=o._$litPart$;if(n===void 0){const c=(s=t==null?void 0:t.renderBefore)!==null&&s!==void 0?s:null;o._$litPart$=n=new O(e.insertBefore(P(),c),c,void 0,t!=null?t:{})}return n._$AI(r),n},E=x.createTreeWalker(x,129,null,!1),we=(r,e)=>{const t=r.length-1,i=[];let s,o=e===2?"<svg>":"",n=H;for(let l=0;l<t;l++){const a=r[l];let $,h,u=-1,_=0;for(;_<a.length&&(n.lastIndex=_,h=n.exec(a),h!==null);)_=n.lastIndex,n===H?h[1]==="!--"?n=ne:h[1]!==void 0?n=le:h[2]!==void 0?(he.test(h[2])&&(s=RegExp("</"+h[2],"g")),n=A):h[3]!==void 0&&(n=A):n===A?h[0]===">"?(n=s!=null?s:H,u=-1):h[1]===void 0?u=-2:(u=n.lastIndex-h[2].length,$=h[1],n=h[3]===void 0?A:h[3]==='"'?ce:ae):n===ce||n===ae?n=A:n===ne||n===le?n=H:(n=A,s=void 0);const L=n===A&&r[l+1].startsWith("/>")?" ":"";o+=n===H?a+ke:u>=0?(i.push($),a.slice(0,u)+"$lit$"+a.slice(u)+y+L):a+y+(u===-2?(i.push(void 0),l):L)}const c=o+(r[t]||"<?>")+(e===2?"</svg>":"");return[se!==void 0?se.createHTML(c):c,i]};class T{constructor({strings:e,_$litType$:t},i){let s;this.parts=[];let o=0,n=0;const c=e.length-1,l=this.parts,[a,$]=we(e,t);if(this.el=T.createElement(a,i),E.currentNode=this.el.content,t===2){const h=this.el.content,u=h.firstChild;u.remove(),h.append(...u.childNodes)}for(;(s=E.nextNode())!==null&&l.length<c;){if(s.nodeType===1){if(s.hasAttributes()){const h=[];for(const u of s.getAttributeNames())if(u.endsWith("$lit$")||u.startsWith(y)){const _=$[n++];if(h.push(u),_!==void 0){const L=s.getAttribute(_.toLowerCase()+"$lit$").split(y),B=/([.?@])?(.*)/.exec(_);l.push({type:1,index:o,name:B[2],strings:L,ctor:B[1]==="."?Pe:B[1]==="?"?Ue:B[1]==="@"?He:I})}else l.push({type:6,index:o})}for(const u of h)s.removeAttribute(u)}if(he.test(s.tagName)){const h=s.textContent.split(y),u=h.length-1;if(u>0){s.textContent=M?M.emptyScript:"";for(let _=0;_<u;_++)s.append(h[_],P()),E.nextNode(),l.push({type:2,index:++o});s.append(h[u],P())}}}else if(s.nodeType===8)if(s.data===re)l.push({type:2,index:o});else{let h=-1;for(;(h=s.data.indexOf(y,h+1))!==-1;)l.push({type:7,index:o}),h+=y.length-1}o++}}static createElement(e,t){const i=x.createElement("template");return i.innerHTML=e,i}}function w(r,e,t=r,i){var s,o,n,c;if(e===S)return e;let l=i!==void 0?(s=t._$Cl)===null||s===void 0?void 0:s[i]:t._$Cu;const a=U(e)?void 0:e._$litDirective$;return(l==null?void 0:l.constructor)!==a&&((o=l==null?void 0:l._$AO)===null||o===void 0||o.call(l,!1),a===void 0?l=void 0:(l=new a(r),l._$AT(r,t,i)),i!==void 0?((n=(c=t)._$Cl)!==null&&n!==void 0?n:c._$Cl=[])[i]=l:t._$Cu=l),l!==void 0&&(e=w(r,l._$AS(r,e.values),l,i)),e}class Ce{constructor(e,t){this.v=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(e){var t;const{el:{content:i},parts:s}=this._$AD,o=((t=e==null?void 0:e.creationScope)!==null&&t!==void 0?t:x).importNode(i,!0);E.currentNode=o;let n=E.nextNode(),c=0,l=0,a=s[0];for(;a!==void 0;){if(c===a.index){let $;a.type===2?$=new O(n,n.nextSibling,this,e):a.type===1?$=new a.ctor(n,a.name,a.strings,this,e):a.type===6&&($=new Te(n,this,e)),this.v.push($),a=s[++l]}c!==(a==null?void 0:a.index)&&(n=E.nextNode(),c++)}return o}m(e){let t=0;for(const i of this.v)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}}class O{constructor(e,t,i,s){var o;this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=s,this._$Cg=(o=s==null?void 0:s.isConnected)===null||o===void 0||o}get _$AU(){var e,t;return(t=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&t!==void 0?t:this._$Cg}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&e.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=w(this,e,t),U(e)?e===d||e==null||e===""?(this._$AH!==d&&this._$AR(),this._$AH=d):e!==this._$AH&&e!==S&&this.$(e):e._$litType$!==void 0?this.T(e):e.nodeType!==void 0?this.S(e):xe(e)?this.M(e):this.$(e)}A(e,t=this._$AB){return this._$AA.parentNode.insertBefore(e,t)}S(e){this._$AH!==e&&(this._$AR(),this._$AH=this.A(e))}$(e){this._$AH!==d&&U(this._$AH)?this._$AA.nextSibling.data=e:this.S(x.createTextNode(e)),this._$AH=e}T(e){var t;const{values:i,_$litType$:s}=e,o=typeof s=="number"?this._$AC(e):(s.el===void 0&&(s.el=T.createElement(s.h,this.options)),s);if(((t=this._$AH)===null||t===void 0?void 0:t._$AD)===o)this._$AH.m(i);else{const n=new Ce(o,this),c=n.p(this.options);n.m(i),this.S(c),this._$AH=n}}_$AC(e){let t=de.get(e.strings);return t===void 0&&de.set(e.strings,t=new T(e)),t}M(e){oe(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,s=0;for(const o of e)s===t.length?t.push(i=new O(this.A(P()),this.A(P()),this,this.options)):i=t[s],i._$AI(o),s++;s<t.length&&(this._$AR(i&&i._$AB.nextSibling,s),t.length=s)}_$AR(e=this._$AA.nextSibling,t){var i;for((i=this._$AP)===null||i===void 0||i.call(this,!1,!0,t);e&&e!==this._$AB;){const s=e.nextSibling;e.remove(),e=s}}setConnected(e){var t;this._$AM===void 0&&(this._$Cg=e,(t=this._$AP)===null||t===void 0||t.call(this,e))}}class I{constructor(e,t,i,s,o){this.type=1,this._$AH=d,this._$AN=void 0,this.element=e,this.name=t,this._$AM=s,this.options=o,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=d}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,i,s){const o=this.strings;let n=!1;if(o===void 0)e=w(this,e,t,0),n=!U(e)||e!==this._$AH&&e!==S,n&&(this._$AH=e);else{const c=e;let l,a;for(e=o[0],l=0;l<o.length-1;l++)a=w(this,c[i+l],t,l),a===S&&(a=this._$AH[l]),n||(n=!U(a)||a!==this._$AH[l]),a===d?e=d:e!==d&&(e+=(a!=null?a:"")+o[l+1]),this._$AH[l]=a}n&&!s&&this.k(e)}k(e){e===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e!=null?e:"")}}class Pe extends I{constructor(){super(...arguments),this.type=3}k(e){this.element[this.name]=e===d?void 0:e}}class Ue extends I{constructor(){super(...arguments),this.type=4}k(e){e&&e!==d?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name)}}class He extends I{constructor(e,t,i,s,o){super(e,t,i,s,o),this.type=5}_$AI(e,t=this){var i;if((e=(i=w(this,e,t,0))!==null&&i!==void 0?i:d)===S)return;const s=this._$AH,o=e===d&&s!==d||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,n=e!==d&&(s===d||o);o&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t,i;typeof this._$AH=="function"?this._$AH.call((i=(t=this.options)===null||t===void 0?void 0:t.host)!==null&&i!==void 0?i:this.element,e):this._$AH.handleEvent(e)}}class Te{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){w(this,e)}}(W=globalThis.litHtmlPolyfillSupport)===null||W===void 0||W.call(globalThis,T,O),((F=globalThis.litHtmlVersions)!==null&&F!==void 0?F:globalThis.litHtmlVersions=[]).push("2.0.0");/**
*/var W,F;const M=globalThis.trustedTypes,se=M?M.createPolicy("lit-html",{createHTML:r=>r}):void 0,y=`lit$${(Math.random()+"").slice(9)}$`,re="?"+y,ke=`<${re}>`,E=document,P=(r="")=>E.createComment(r),U=r=>r===null||typeof r!="object"&&typeof r!="function",oe=Array.isArray,Ee=r=>{var e;return oe(r)||typeof((e=r)===null||e===void 0?void 0:e[Symbol.iterator])=="function"},H=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ne=/-->/g,le=/>/g,A=/>|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,ae=/'/g,ce=/"/g,he=/^(?:script|style|textarea)$/i,de=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),R=de(1),xe=de(2),x=Symbol.for("lit-noChange"),u=Symbol.for("lit-nothing"),ue=new WeakMap,Se=(r,e,t)=>{var i,s;const o=(i=t==null?void 0:t.renderBefore)!==null&&i!==void 0?i:e;let n=o._$litPart$;if(n===void 0){const c=(s=t==null?void 0:t.renderBefore)!==null&&s!==void 0?s:null;o._$litPart$=n=new O(e.insertBefore(P(),c),c,void 0,t!=null?t:{})}return n._$AI(r),n},S=E.createTreeWalker(E,129,null,!1),we=(r,e)=>{const t=r.length-1,i=[];let s,o=e===2?"<svg>":"",n=H;for(let l=0;l<t;l++){const a=r[l];let $,h,d=-1,_=0;for(;_<a.length&&(n.lastIndex=_,h=n.exec(a),h!==null);)_=n.lastIndex,n===H?h[1]==="!--"?n=ne:h[1]!==void 0?n=le:h[2]!==void 0?(he.test(h[2])&&(s=RegExp("</"+h[2],"g")),n=A):h[3]!==void 0&&(n=A):n===A?h[0]===">"?(n=s!=null?s:H,d=-1):h[1]===void 0?d=-2:(d=n.lastIndex-h[2].length,$=h[1],n=h[3]===void 0?A:h[3]==='"'?ce:ae):n===ce||n===ae?n=A:n===ne||n===le?n=H:(n=A,s=void 0);const L=n===A&&r[l+1].startsWith("/>")?" ":"";o+=n===H?a+ke:d>=0?(i.push($),a.slice(0,d)+"$lit$"+a.slice(d)+y+L):a+y+(d===-2?(i.push(void 0),l):L)}const c=o+(r[t]||"<?>")+(e===2?"</svg>":"");return[se!==void 0?se.createHTML(c):c,i]};class T{constructor({strings:e,_$litType$:t},i){let s;this.parts=[];let o=0,n=0;const c=e.length-1,l=this.parts,[a,$]=we(e,t);if(this.el=T.createElement(a,i),S.currentNode=this.el.content,t===2){const h=this.el.content,d=h.firstChild;d.remove(),h.append(...d.childNodes)}for(;(s=S.nextNode())!==null&&l.length<c;){if(s.nodeType===1){if(s.hasAttributes()){const h=[];for(const d of s.getAttributeNames())if(d.endsWith("$lit$")||d.startsWith(y)){const _=$[n++];if(h.push(d),_!==void 0){const L=s.getAttribute(_.toLowerCase()+"$lit$").split(y),B=/([.?@])?(.*)/.exec(_);l.push({type:1,index:o,name:B[2],strings:L,ctor:B[1]==="."?Pe:B[1]==="?"?Ue:B[1]==="@"?He:I})}else l.push({type:6,index:o})}for(const d of h)s.removeAttribute(d)}if(he.test(s.tagName)){const h=s.textContent.split(y),d=h.length-1;if(d>0){s.textContent=M?M.emptyScript:"";for(let _=0;_<d;_++)s.append(h[_],P()),S.nextNode(),l.push({type:2,index:++o});s.append(h[d],P())}}}else if(s.nodeType===8)if(s.data===re)l.push({type:2,index:o});else{let h=-1;for(;(h=s.data.indexOf(y,h+1))!==-1;)l.push({type:7,index:o}),h+=y.length-1}o++}}static createElement(e,t){const i=E.createElement("template");return i.innerHTML=e,i}}function w(r,e,t=r,i){var s,o,n,c;if(e===x)return e;let l=i!==void 0?(s=t._$Cl)===null||s===void 0?void 0:s[i]:t._$Cu;const a=U(e)?void 0:e._$litDirective$;return(l==null?void 0:l.constructor)!==a&&((o=l==null?void 0:l._$AO)===null||o===void 0||o.call(l,!1),a===void 0?l=void 0:(l=new a(r),l._$AT(r,t,i)),i!==void 0?((n=(c=t)._$Cl)!==null&&n!==void 0?n:c._$Cl=[])[i]=l:t._$Cu=l),l!==void 0&&(e=w(r,l._$AS(r,e.values),l,i)),e}class Ce{constructor(e,t){this.v=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(e){var t;const{el:{content:i},parts:s}=this._$AD,o=((t=e==null?void 0:e.creationScope)!==null&&t!==void 0?t:E).importNode(i,!0);S.currentNode=o;let n=S.nextNode(),c=0,l=0,a=s[0];for(;a!==void 0;){if(c===a.index){let $;a.type===2?$=new O(n,n.nextSibling,this,e):a.type===1?$=new a.ctor(n,a.name,a.strings,this,e):a.type===6&&($=new Te(n,this,e)),this.v.push($),a=s[++l]}c!==(a==null?void 0:a.index)&&(n=S.nextNode(),c++)}return o}m(e){let t=0;for(const i of this.v)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}}class O{constructor(e,t,i,s){var o;this.type=2,this._$AH=u,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=s,this._$Cg=(o=s==null?void 0:s.isConnected)===null||o===void 0||o}get _$AU(){var e,t;return(t=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&t!==void 0?t:this._$Cg}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&e.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=w(this,e,t),U(e)?e===u||e==null||e===""?(this._$AH!==u&&this._$AR(),this._$AH=u):e!==this._$AH&&e!==x&&this.$(e):e._$litType$!==void 0?this.T(e):e.nodeType!==void 0?this.S(e):Ee(e)?this.M(e):this.$(e)}A(e,t=this._$AB){return this._$AA.parentNode.insertBefore(e,t)}S(e){this._$AH!==e&&(this._$AR(),this._$AH=this.A(e))}$(e){this._$AH!==u&&U(this._$AH)?this._$AA.nextSibling.data=e:this.S(E.createTextNode(e)),this._$AH=e}T(e){var t;const{values:i,_$litType$:s}=e,o=typeof s=="number"?this._$AC(e):(s.el===void 0&&(s.el=T.createElement(s.h,this.options)),s);if(((t=this._$AH)===null||t===void 0?void 0:t._$AD)===o)this._$AH.m(i);else{const n=new Ce(o,this),c=n.p(this.options);n.m(i),this.S(c),this._$AH=n}}_$AC(e){let t=ue.get(e.strings);return t===void 0&&ue.set(e.strings,t=new T(e)),t}M(e){oe(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,s=0;for(const o of e)s===t.length?t.push(i=new O(this.A(P()),this.A(P()),this,this.options)):i=t[s],i._$AI(o),s++;s<t.length&&(this._$AR(i&&i._$AB.nextSibling,s),t.length=s)}_$AR(e=this._$AA.nextSibling,t){var i;for((i=this._$AP)===null||i===void 0||i.call(this,!1,!0,t);e&&e!==this._$AB;){const s=e.nextSibling;e.remove(),e=s}}setConnected(e){var t;this._$AM===void 0&&(this._$Cg=e,(t=this._$AP)===null||t===void 0||t.call(this,e))}}class I{constructor(e,t,i,s,o){this.type=1,this._$AH=u,this._$AN=void 0,this.element=e,this.name=t,this._$AM=s,this.options=o,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=u}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,i,s){const o=this.strings;let n=!1;if(o===void 0)e=w(this,e,t,0),n=!U(e)||e!==this._$AH&&e!==x,n&&(this._$AH=e);else{const c=e;let l,a;for(e=o[0],l=0;l<o.length-1;l++)a=w(this,c[i+l],t,l),a===x&&(a=this._$AH[l]),n||(n=!U(a)||a!==this._$AH[l]),a===u?e=u:e!==u&&(e+=(a!=null?a:"")+o[l+1]),this._$AH[l]=a}n&&!s&&this.k(e)}k(e){e===u?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e!=null?e:"")}}class Pe extends I{constructor(){super(...arguments),this.type=3}k(e){this.element[this.name]=e===u?void 0:e}}class Ue extends I{constructor(){super(...arguments),this.type=4}k(e){e&&e!==u?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name)}}class He extends I{constructor(e,t,i,s,o){super(e,t,i,s,o),this.type=5}_$AI(e,t=this){var i;if((e=(i=w(this,e,t,0))!==null&&i!==void 0?i:u)===x)return;const s=this._$AH,o=e===u&&s!==u||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,n=e!==u&&(s===u||o);o&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t,i;typeof this._$AH=="function"?this._$AH.call((i=(t=this.options)===null||t===void 0?void 0:t.host)!==null&&i!==void 0?i:this.element,e):this._$AH.handleEvent(e)}}class Te{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){w(this,e)}}(W=globalThis.litHtmlPolyfillSupport)===null||W===void 0||W.call(globalThis,T,O),((F=globalThis.litHtmlVersions)!==null&&F!==void 0?F:globalThis.litHtmlVersions=[]).push("2.0.0");/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/var G,J,Z;class N extends k{constructor(){super(...arguments),this.renderOptions={host:this},this._$Dt=void 0}createRenderRoot(){var e,t;const i=super.createRenderRoot();return(e=(t=this.renderOptions).renderBefore)!==null&&e!==void 0||(t.renderBefore=i.firstChild),i}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Dt=Ee(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Dt)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Dt)===null||e===void 0||e.setConnected(!1)}render(){return S}}N.finalized=!0,N._$litElement$=!0,(G=globalThis.litElementHydrateSupport)===null||G===void 0||G.call(globalThis,{LitElement:N}),(J=globalThis.litElementPolyfillSupport)===null||J===void 0||J.call(globalThis,{LitElement:N}),((Z=globalThis.litElementVersions)!==null&&Z!==void 0?Z:globalThis.litElementVersions=[]).push("3.0.0"),C`@-webkit-keyframes uui-blink{0%{opacity:1}50%{opacity:.5}100%{opacity:1}}@keyframes uui-blink{0%{opacity:1}50%{opacity:.5}100%{opacity:1}}`,z("uui-blink 0.9s infinite both"),C`@-webkit-keyframes pulse{0%{transform:translate(-50%,-50%) scale(.2);opacity:.9}80%{transform:translate(-50%,-50%) scale(1.2);opacity:0}100%{transform:translate(-50%,-50%) scale(2.2);opacity:0}}@keyframes pulse{0%{transform:translate(-50%,-50%) scale(.2);opacity:.9}80%{transform:translate(-50%,-50%) scale(1.2);opacity:0}100%{transform:translate(-50%,-50%) scale(2.2);opacity:0}}`,z("pulse 0.8s ease-in-out infinite both");const Oe=C`@-webkit-keyframes uui-horizontal-shake{10%,90%{transform:translateX(-1px)}20%,80%{transform:translateX(1px)}30%,50%,70%{transform:translateX(-2px)}40%,60%{transform:translateX(2px)}}@keyframes uui-horizontal-shake{10%,90%{transform:translateX(-1px)}20%,80%{transform:translateX(1px)}30%,50%,70%{transform:translateX(-2px)}40%,60%{transform:translateX(2px)}}`,pe=z("uui-horizontal-shake 600ms ease backwards");/**
*/var G,J,Z;class N extends k{constructor(){super(...arguments),this.renderOptions={host:this},this._$Dt=void 0}createRenderRoot(){var e,t;const i=super.createRenderRoot();return(e=(t=this.renderOptions).renderBefore)!==null&&e!==void 0||(t.renderBefore=i.firstChild),i}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Dt=Se(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Dt)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Dt)===null||e===void 0||e.setConnected(!1)}render(){return x}}N.finalized=!0,N._$litElement$=!0,(G=globalThis.litElementHydrateSupport)===null||G===void 0||G.call(globalThis,{LitElement:N}),(J=globalThis.litElementPolyfillSupport)===null||J===void 0||J.call(globalThis,{LitElement:N}),((Z=globalThis.litElementVersions)!==null&&Z!==void 0?Z:globalThis.litElementVersions=[]).push("3.0.0"),C`@-webkit-keyframes uui-blink{0%{opacity:1}50%{opacity:.5}100%{opacity:1}}@keyframes uui-blink{0%{opacity:1}50%{opacity:.5}100%{opacity:1}}`,z("uui-blink 0.9s infinite both"),C`@-webkit-keyframes pulse{0%{transform:translate(-50%,-50%) scale(.2);opacity:.9}80%{transform:translate(-50%,-50%) scale(1.2);opacity:0}100%{transform:translate(-50%,-50%) scale(2.2);opacity:0}}@keyframes pulse{0%{transform:translate(-50%,-50%) scale(.2);opacity:.9}80%{transform:translate(-50%,-50%) scale(1.2);opacity:0}100%{transform:translate(-50%,-50%) scale(2.2);opacity:0}}`,z("pulse 0.8s ease-in-out infinite both");const Oe=C`@-webkit-keyframes uui-horizontal-shake{10%,90%{transform:translateX(-1px)}20%,80%{transform:translateX(1px)}30%,50%,70%{transform:translateX(-2px)}40%,60%{transform:translateX(2px)}}@keyframes uui-horizontal-shake{10%,90%{transform:translateX(-1px)}20%,80%{transform:translateX(1px)}30%,50%,70%{transform:translateX(-2px)}40%,60%{transform:translateX(2px)}}`,pe=z("uui-horizontal-shake 600ms ease backwards");/**
* @license

@@ -34,3 +34,3 @@ * Copyright 2017 Google LLC

* SPDX-License-Identifier: BSD-3-Clause
*/function Re(r,e){return Me({descriptor:t=>{const i={get(){var s,o;return(o=(s=this.renderRoot)===null||s===void 0?void 0:s.querySelector(r))!==null&&o!==void 0?o:null},enumerable:!0,configurable:!0};if(e){const s=typeof t=="symbol"?Symbol():"__"+t;i.get=function(){var o,n;return this[s]===void 0&&(this[s]=(n=(o=this.renderRoot)===null||o===void 0?void 0:o.querySelector(r))!==null&&n!==void 0?n:null),this[s]}}return i}})}var Ie=Object.defineProperty,Le=Object.getOwnPropertyDescriptor,ve=(r,e,t,i)=>{for(var s=i>1?void 0:i?Le(e,t):e,o=r.length-1,n;o>=0;o--)(n=r[o])&&(s=(i?n(e,t,s):n(s))||s);return i&&s&&Ie(e,t,s),s};const Be=(r,e)=>{class t extends e{constructor(){super(...arguments);this.labelSlotHasContent=!1}connectedCallback(){super.connectedCallback(),this.label||console.warn(this.tagName+" needs a `label`")}labelSlotChanged(s){this.labelSlotHasContent=s.target.assignedNodes({flatten:!0}).length>0}renderLabel(){return R`${this.labelSlotHasContent===!1?R`<span class="label">${this.label}</span>`:""}<slot class="label" style="${this.labelSlotHasContent?"":"visibility: hidden"}" name="${r||""}" @slotchange="${this.labelSlotChanged}"></slot>`}}return ve([m({type:String})],t.prototype,"label",2),ve([ze()],t.prototype,"labelSlotHasContent",2),t};var je=Object.defineProperty,fe=Object.getOwnPropertySymbols,De=Object.prototype.hasOwnProperty,Ve=Object.prototype.propertyIsEnumerable,be=(r,e,t)=>e in r?je(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,$e=(r,e)=>{for(var t in e||(e={}))De.call(e,t)&&be(r,t,e[t]);if(fe)for(var t of fe(e))Ve.call(e,t)&&be(r,t,e[t]);return r};const _e=class extends Event{constructor(r,e={}){super(r,$e($e({},_e.defaultInit),e));this.detail=e.detail||{}}};let me=_e;me.defaultInit={composed:!0};class Q extends me{}Q.CHANGE="change";var Xe=Object.defineProperty,qe=Object.getOwnPropertyDescriptor,g=(r,e,t,i)=>{for(var s=i>1?void 0:i?qe(e,t):e,o=r.length-1,n;o>=0;o--)(n=r[o])&&(s=(i?n(e,t,s):n(s))||s);return i&&s&&Xe(e,t,s),s};class b extends Be("",N){constructor(e="checkbox"){super();this._value="on",this.name="",this.labelPosition="right",this.hideLabel=!1,this.error=!1,this._checked=!1,this.disabled=!1,this.inputRole=e,this._internals=this.attachInternals()}get value(){return this._value}set value(e){const t=this._value;this._value=e,this._internals.setFormValue(this._checked&&this.name!==""?this._value:null),this.requestUpdate("value",t)}get checked(){return this._checked}set checked(e){const t=this._checked;this._checked=e,this._internals.setFormValue(this._checked&&this.name!==""?this._value?this._value:"on":null),this.requestUpdate("checked",t)}_onInputChange(){this.checked=this._input.checked,this.dispatchEvent(new Q(Q.CHANGE,{bubbles:!0}))}render(){return R`<label><input type="checkbox" id="input" ?disabled="${this.disabled}" @change="${this._onInputChange}" .checked="${this.checked}" aria-checked="${this.checked?"true":"false"}" aria-label="${this.label}" role="${this.inputRole}"> ${this.renderCheckbox()} ${this.hideLabel===!1?this.renderLabel():""}</label>`}}b.styles=[C`:host{display:inline-block}label{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-wrap:nowrap;align-items:center;justify-items:center;gap:var(--uui-size-xsmall,9px)}input{position:absolute;height:0;width:0}:host([label-position=left]) label{flex-direction:row-reverse}:host([label-position=top]) label{gap:var(--uui-size-half-base-unit,3px);flex-direction:column-reverse}:host([label-position=bottom]) label{gap:var(--uui-size-half-base-unit,3px);flex-direction:column}:host([disabled]) .label{opacity:.5}`],b.formAssociated=!0,g([Re("#input")],b.prototype,"_input",2),g([m({type:String})],b.prototype,"value",1),g([m({type:String})],b.prototype,"name",2),g([m({type:String,attribute:"label-position",reflect:!0})],b.prototype,"labelPosition",2),g([m({type:Boolean,attribute:"hide-label",reflect:!0})],b.prototype,"hideLabel",2),g([m({type:Boolean,reflect:!0})],b.prototype,"error",2),g([m({type:Boolean,reflect:!0})],b.prototype,"checked",1),g([m({type:Boolean,reflect:!0})],b.prototype,"disabled",2);const Ke=Se`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M461.884 68.14c-132.601 81.297-228.817 183.87-272.048 235.345l-105.874-82.95-46.751 37.691 182.941 186.049c31.485-80.646 131.198-238.264 252.956-350.252L461.884 68.14z"/></svg>`;class Y extends b{renderCheckbox(){return R`<div id="ticker"><div id="icon-check">${Ke}</div></div>`}}Y.styles=[...b.styles,Oe,C`:host{--uui-checkbox-size:18px}#ticker{position:relative;grid-area:'input';display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:var(--uui-checkbox-size);height:var(--uui-checkbox-size);border-radius:var(--uui-checkbox-border-radius,var(--uui-size-border-radius,3px));color:var(--uui-toggle-color,var(--uui-interface-chosen-contrast,#fefefe));background-color:var(--uui-toggle-background-color,var(--uui-interface-surface,#fefefe));border:1px solid var(--uui-checkbox-border-color,var(--uui-interface-border,#c4c4c4));font-size:calc(var(--uui-checkbox-size) * .7)}label:hover input:not([disabled])+#ticker{border-color:var(--uui-checkbox-border-color-hover,var(--uui-interface-border-hover,#b3b3b3));background-color:var(--uui-checkbox-background-color-hover,var(--uui-interface-surface-hover,#fafafa))}label:focus #ticker{border-color:var(--uui-checkbox-border-color-focus,var(--uui-interface-border-focus,#b3b3b3));background-color:var(--uui-checkbox-background-color-focus,var(--uui-interface-surface-alt-focus,#d8d7d9))}input:checked+#ticker{border-color:var(--uui-interface-chosen,#1b264f)}label:hover input:checked:not([disabled])+#ticker{border-color:var(--uui-interface-chosen-hover,#26356e)}label:focus input:checked+#ticker{border-color:var(--uui-interface-chosen-focus,#1b264f)}#icon-check{position:absolute;vertical-align:middle;width:1em;height:1em;line-height:0;transition:fill 120ms,opacity 120ms;fill:var(--uui-interface-chosen-contrast,#fefefe);opacity:0}#ticker::before{content:'';position:absolute;top:0;left:0;bottom:0;right:0;border-radius:calc(var(--uui-checkbox-border-radius,var(--uui-size-border-radius,3px)) * .5);background-color:var(--uui-interface-chosen,#1b264f);transition:transform 120ms ease,opacity 120ms,background-color 120ms;transform:scale(0);opacity:0}label:hover input:checked:not([disabled])+#ticker::before{background-color:var(--uui-interface-chosen-hover,#26356e)}input:checked+#ticker::before{transform:scale(1);opacity:1}input:checked+#ticker #icon-check{opacity:1}label:focus input:checked+#ticker{background-color:var(--uui-interface-chosen-focus,#1b264f)}:host(:not([disabled])) label:active input:checked+#ticker::before{transform:scale(.9)}:host([error]) #ticker{border:1px solid var(--uui-look-danger-border,#d42054)}:host([error]) label:hover #ticker{border:1px solid var(--uui-look-danger-border,#d42054)}:host([error]) label:hover input:checked:not([disabled])+#ticker{border:1px solid var(--uui-look-danger-border,#d42054)}:host([error]) label:focus input:checked+#ticker{border:1px solid var(--uui-look-danger-border,#d42054)}:host([disabled]) #ticker{background-color:var(--uui-interface-surface-disabled,#e4e4e4)}:host([disabled]) input:checked+#ticker{background-color:var(--uui-interface-chosen-disabled,#6a759a)}:host([disabled]) #ticker:after{background-color:var(--uui-interface-surface-disabled,#e4e4e4)}:host([disabled]) #ticker #icon-check{fill:var(--uui-interface-contrast-disabled,#73716e)}:host([disabled]) label:active #ticker{-webkit-animation:${pe};animation:${pe}}:host([disabled]) input:checked+#ticker #icon-check{fill:var(--uui-interface-chosen-contrast-disabled,#e4e4e4)}`],Y.formAssociated=!0,customElements.define("uui-checkbox",Y)});
*/function Re(r,e){return Me({descriptor:t=>{const i={get(){var s,o;return(o=(s=this.renderRoot)===null||s===void 0?void 0:s.querySelector(r))!==null&&o!==void 0?o:null},enumerable:!0,configurable:!0};if(e){const s=typeof t=="symbol"?Symbol():"__"+t;i.get=function(){var o,n;return this[s]===void 0&&(this[s]=(n=(o=this.renderRoot)===null||o===void 0?void 0:o.querySelector(r))!==null&&n!==void 0?n:null),this[s]}}return i}})}var Ie=Object.defineProperty,Le=Object.getOwnPropertyDescriptor,ve=(r,e,t,i)=>{for(var s=i>1?void 0:i?Le(e,t):e,o=r.length-1,n;o>=0;o--)(n=r[o])&&(s=(i?n(e,t,s):n(s))||s);return i&&s&&Ie(e,t,s),s};const Be=(r,e)=>{class t extends e{constructor(){super(...arguments);this.labelSlotHasContent=!1}connectedCallback(){super.connectedCallback(),this.label||console.warn(this.tagName+" needs a `label`")}labelSlotChanged(s){this.labelSlotHasContent=s.target.assignedNodes({flatten:!0}).length>0}renderLabel(){return R`${this.labelSlotHasContent===!1?R`<span class="label">${this.label}</span>`:""}<slot class="label" style="${this.labelSlotHasContent?"":"visibility: hidden"}" name="${r||""}" @slotchange="${this.labelSlotChanged}"></slot>`}}return ve([m({type:String})],t.prototype,"label",2),ve([ze()],t.prototype,"labelSlotHasContent",2),t};var je=Object.defineProperty,fe=Object.getOwnPropertySymbols,De=Object.prototype.hasOwnProperty,Ve=Object.prototype.propertyIsEnumerable,be=(r,e,t)=>e in r?je(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,$e=(r,e)=>{for(var t in e||(e={}))De.call(e,t)&&be(r,t,e[t]);if(fe)for(var t of fe(e))Ve.call(e,t)&&be(r,t,e[t]);return r};const _e=class extends Event{constructor(r,e={}){super(r,$e($e({},_e.defaultInit),e));this.detail=e.detail||{}}};let me=_e;me.defaultInit={composed:!0};class Q extends me{}Q.CHANGE="change";var Xe=Object.defineProperty,qe=Object.getOwnPropertyDescriptor,g=(r,e,t,i)=>{for(var s=i>1?void 0:i?qe(e,t):e,o=r.length-1,n;o>=0;o--)(n=r[o])&&(s=(i?n(e,t,s):n(s))||s);return i&&s&&Xe(e,t,s),s};class b extends Be("",N){constructor(e="checkbox"){super();this._value="on",this.name="",this.labelPosition="right",this.hideLabel=!1,this.error=!1,this._checked=!1,this.disabled=!1,this.inputRole=e,this._internals=this.attachInternals()}get value(){return this._value}set value(e){const t=this._value;this._value=e,this._internals.setFormValue(this._checked&&this.name!==""?this._value:null),this.requestUpdate("value",t)}get checked(){return this._checked}set checked(e){const t=this._checked;this._checked=e,this._internals.setFormValue(this._checked&&this.name!==""?this._value?this._value:"on":null),this.requestUpdate("checked",t)}_onInputChange(){this.checked=this._input.checked,this.dispatchEvent(new Q(Q.CHANGE,{bubbles:!0}))}render(){return R`<label><input type="checkbox" id="input" ?disabled="${this.disabled}" @change="${this._onInputChange}" .checked="${this.checked}" aria-checked="${this.checked?"true":"false"}" aria-label="${this.label}" role="${this.inputRole}"> ${this.renderCheckbox()} ${this.hideLabel===!1?this.renderLabel():""}</label>`}}b.styles=[C`:host{display:inline-block}label{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-wrap:nowrap;align-items:center;justify-items:center;gap:var(--uui-size-xsmall,9px)}input{position:absolute;height:0;width:0}:host([label-position=left]) label{flex-direction:row-reverse}:host([label-position=top]) label{gap:var(--uui-size-half-base-unit,3px);flex-direction:column-reverse}:host([label-position=bottom]) label{gap:var(--uui-size-half-base-unit,3px);flex-direction:column}:host([disabled]) .label{opacity:.5}`],b.formAssociated=!0,g([Re("#input")],b.prototype,"_input",2),g([m({type:String})],b.prototype,"value",1),g([m({type:String})],b.prototype,"name",2),g([m({type:String,attribute:"label-position",reflect:!0})],b.prototype,"labelPosition",2),g([m({type:Boolean,attribute:"hide-label",reflect:!0})],b.prototype,"hideLabel",2),g([m({type:Boolean,reflect:!0})],b.prototype,"error",2),g([m({type:Boolean,reflect:!0})],b.prototype,"checked",1),g([m({type:Boolean,reflect:!0})],b.prototype,"disabled",2);const Ke=xe`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M461.884 68.14c-132.601 81.297-228.817 183.87-272.048 235.345l-105.874-82.95-46.751 37.691 182.941 186.049c31.485-80.646 131.198-238.264 252.956-350.252L461.884 68.14z"/></svg>`;class Y extends b{renderCheckbox(){return R`<div id="ticker"><div id="icon-check">${Ke}</div></div>`}}Y.styles=[...b.styles,Oe,C`:host{--uui-checkbox-size:18px}#ticker{position:relative;grid-area:'input';display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:var(--uui-checkbox-size);height:var(--uui-checkbox-size);border-radius:var(--uui-checkbox-border-radius,var(--uui-size-border-radius,3px));color:var(--uui-toggle-color,var(--uui-interface-chosen-contrast,#fefefe));background-color:var(--uui-toggle-background-color,var(--uui-interface-surface,#fefefe));border:1px solid var(--uui-checkbox-border-color,var(--uui-interface-border,#c4c4c4));font-size:calc(var(--uui-checkbox-size) * .7)}label:hover input:not([disabled])+#ticker{border-color:var(--uui-checkbox-border-color-hover,var(--uui-interface-border-hover,#b3b3b3));background-color:var(--uui-checkbox-background-color-hover,var(--uui-interface-surface-hover,#fafafa))}label:focus #ticker{border-color:var(--uui-checkbox-border-color-focus,var(--uui-interface-border-focus,#b3b3b3));background-color:var(--uui-checkbox-background-color-focus,var(--uui-interface-surface-alt-focus,#d8d7d9))}input:checked+#ticker{border-color:var(--uui-interface-chosen,#1b264f)}label:hover input:checked:not([disabled])+#ticker{border-color:var(--uui-interface-chosen-hover,#26356e)}label:focus input:checked+#ticker{border-color:var(--uui-interface-chosen-focus,#1b264f)}#icon-check{position:absolute;vertical-align:middle;width:1em;height:1em;line-height:0;transition:fill 120ms,opacity 120ms;fill:var(--uui-interface-chosen-contrast,#fefefe);opacity:0}#ticker::before{content:'';position:absolute;top:0;left:0;bottom:0;right:0;border-radius:calc(var(--uui-checkbox-border-radius,var(--uui-size-border-radius,3px)) * .5);background-color:var(--uui-interface-chosen,#1b264f);transition:transform 120ms ease,opacity 120ms,background-color 120ms;transform:scale(0);opacity:0}label:hover input:checked:not([disabled])+#ticker::before{background-color:var(--uui-interface-chosen-hover,#26356e)}input:checked+#ticker::before{transform:scale(1);opacity:1}input:checked+#ticker #icon-check{opacity:1}label:focus input:checked+#ticker{background-color:var(--uui-interface-chosen-focus,#1b264f)}:host(:not([disabled])) label:active input:checked+#ticker::before{transform:scale(.9)}:host([error]) #ticker{border:1px solid var(--uui-look-danger-border,#d42054)}:host([error]) label:hover #ticker{border:1px solid var(--uui-look-danger-border,#d42054)}:host([error]) label:hover input:checked:not([disabled])+#ticker{border:1px solid var(--uui-look-danger-border,#d42054)}:host([error]) label:focus input:checked+#ticker{border:1px solid var(--uui-look-danger-border,#d42054)}:host([disabled]) #ticker{background-color:var(--uui-interface-surface-disabled,#e4e4e4)}:host([disabled]) input:checked+#ticker{background-color:var(--uui-interface-chosen-disabled,#6a759a)}:host([disabled]) #ticker:after{background-color:var(--uui-interface-surface-disabled,#e4e4e4)}:host([disabled]) #ticker #icon-check{fill:var(--uui-interface-contrast-disabled,#73716e)}:host([disabled]) label:active #ticker{-webkit-animation:${pe};animation:${pe}}:host([disabled]) input:checked+#ticker #icon-check{fill:var(--uui-interface-chosen-contrast-disabled,#e4e4e4)}`],Y.formAssociated=!0,((r,e,t)=>{if(r.indexOf("-")>0===!1){console.error(`${r} is not a valid custom element name. A custom element name should consist of at least two words separated by a hyphen.`);return}customElements.get(r)?console.error(`${r} is already defined`):customElements.define(r,e,t)})("uui-checkbox",Y)});
//# sourceMappingURL=uui-checkbox.min.js.map
import { svg, css, html } from 'lit';
import { UUIHorizontalShakeKeyframes, UUIHorizontalShakeAnimationValue } from '@umbraco-ui/uui-base/lib/animations';
import { UUIBooleanInputBaseElement } from '@umbraco-ui/uui-base/lib/uui-boolean-input';
import { defineElement } from '@umbraco-ui/uui-base/lib/registration';

@@ -164,2 +165,2 @@ const iconCheck = svg`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">

customElements.define("uui-checkbox", UUICheckboxElement);
defineElement("uui-checkbox", UUICheckboxElement);
{
"name": "@umbraco-ui/uui-checkbox",
"version": "0.0.10",
"version": "0.0.11",
"license": "MIT",

@@ -35,3 +35,3 @@ "keywords": [

"dependencies": {
"@umbraco-ui/uui-base": "^0.0.8"
"@umbraco-ui/uui-base": "^0.0.9"
},

@@ -47,3 +47,3 @@ "scripts": {

"homepage": "https://uui.umbraco.com/?path=/story/uui-checkbox",
"gitHead": "9f7c81684dfb6113d0ee6b08866fb6429322eb2f"
"gitHead": "ffb7ad3be3197ddb38f2a2917ffc3d70334d1ce2"
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc