@cas-smartdesign/checkbox 5.0.1
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/LICENSE +8 -0
- package/dist/checkbox-with-externals.js +84 -0
- package/dist/checkbox-with-externals.js.map +7 -0
- package/dist/checkbox.d.ts +46 -0
- package/dist/checkbox.mjs +124 -0
- package/dist/checkbox.mjs.map +1 -0
- package/dist/docs/doc.css +1 -0
- package/dist/docs/doc.mjs +173 -0
- package/dist/docs/indeterminate.js +1 -0
- package/dist/docs/index.html +26 -0
- package/dist/docs/validation.js +1 -0
- package/npm-third-party-licenses.json +192 -0
- package/package.json +37 -0
- package/readme.md +37 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
Copyright 2019 CAS Software AG
|
|
2
|
+
|
|
3
|
+
This software is confidential and proprietary information of CAS Software AG. You shall not
|
|
4
|
+
disclose such Confidential Information and shall use it only in accordance with the terms of
|
|
5
|
+
the license agreement you entered into with CAS Software AG or SmartWe World AG.
|
|
6
|
+
|
|
7
|
+
To obtain a license (e.g. by joining the partner programs of CAS Software AG or SmartWe World AG)
|
|
8
|
+
please contact partnerinfo@cas.de or partnerinfo@smartwe.world.
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
var window;(window||={})["@cas-smartdesign/checkbox"]=(()=>{var K=Object.defineProperty;var Me=Object.getOwnPropertyDescriptor;var Re=Object.getOwnPropertyNames;var Te=Object.prototype.hasOwnProperty;var ze=(i,e)=>{for(var t in e)K(i,t,{get:e[t],enumerable:!0})},Ne=(i,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Re(e))!Te.call(i,o)&&o!==t&&K(i,o,{get:()=>e[o],enumerable:!(s=Me(e,o))||s.enumerable});return i};var Ie=i=>Ne(K({},"__esModule",{value:!0}),i);var it={};ze(it,{SDCheckbox:()=>Le});var V=window,j=V.ShadowRoot&&(V.ShadyCSS===void 0||V.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,J=Symbol(),ue=new WeakMap,L=class{constructor(e,t,s){if(this._$cssResult$=!0,s!==J)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(j&&e===void 0){let s=t!==void 0&&t.length===1;s&&(e=ue.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),s&&ue.set(t,e))}return e}toString(){return this.cssText}},E=i=>new L(typeof i=="string"?i:i+"",void 0,J),O=(i,...e)=>{let t=i.length===1?i[0]:e.reduce((s,o,r)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+i[r+1],i[0]);return new L(t,i,J)},Z=(i,e)=>{j?i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet):e.forEach(t=>{let s=document.createElement("style"),o=V.litNonce;o!==void 0&&s.setAttribute("nonce",o),s.textContent=t.cssText,i.appendChild(s)})},q=j?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(let s of e.cssRules)t+=s.cssText;return E(t)})(i):i;var G,W=window,ve=W.trustedTypes,De=ve?ve.emptyScript:"",ge=W.reactiveElementPolyfillSupport,X={toAttribute(i,e){switch(e){case Boolean:i=i?De:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let t=i;switch(e){case Boolean:t=i!==null;break;case Number:t=i===null?null:Number(i);break;case Object:case Array:try{t=JSON.parse(i)}catch{t=null}}return t}},fe=(i,e)=>e!==i&&(e==e||i==i),Q={attribute:!0,type:String,converter:X,reflect:!1,hasChanged:fe},Y="finalized",$=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(e){var t;this.finalize(),((t=this.h)!==null&&t!==void 0?t:this.h=[]).push(e)}static get observedAttributes(){this.finalize();let e=[];return this.elementProperties.forEach((t,s)=>{let o=this._$Ep(s,t);o!==void 0&&(this._$Ev.set(o,s),e.push(o))}),e}static createProperty(e,t=Q){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){let s=typeof e=="symbol"?Symbol():"__"+e,o=this.getPropertyDescriptor(e,s,t);o!==void 0&&Object.defineProperty(this.prototype,e,o)}}static getPropertyDescriptor(e,t,s){return{get(){return this[t]},set(o){let r=this[e];this[t]=o,this.requestUpdate(e,r,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||Q}static finalize(){if(this.hasOwnProperty(Y))return!1;this[Y]=!0;let e=Object.getPrototypeOf(this);if(e.finalize(),e.h!==void 0&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){let t=this.properties,s=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(let o of s)this.createProperty(o,t[o])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let s=new Set(e.flat(1/0).reverse());for(let o of s)t.unshift(q(o))}else e!==void 0&&t.push(q(e));return t}static _$Ep(e,t){let s=t.attribute;return s===!1?void 0:typeof s=="string"?s:typeof e=="string"?e.toLowerCase():void 0}_$Eu(){var e;this._$E_=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(t=>t(this))}addController(e){var t,s;((t=this._$ES)!==null&&t!==void 0?t:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((s=e.hostConnected)===null||s===void 0||s.call(e))}removeController(e){var t;(t=this._$ES)===null||t===void 0||t.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,t)=>{this.hasOwnProperty(t)&&(this._$Ei.set(t,this[t]),delete this[t])})}createRenderRoot(){var e;let t=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return Z(t,this.constructor.elementStyles),t}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(t=>{var s;return(s=t.hostConnected)===null||s===void 0?void 0:s.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(t=>{var s;return(s=t.hostDisconnected)===null||s===void 0?void 0:s.call(t)})}attributeChangedCallback(e,t,s){this._$AK(e,s)}_$EO(e,t,s=Q){var o;let r=this.constructor._$Ep(e,s);if(r!==void 0&&s.reflect===!0){let n=(((o=s.converter)===null||o===void 0?void 0:o.toAttribute)!==void 0?s.converter:X).toAttribute(t,s.type);this._$El=e,n==null?this.removeAttribute(r):this.setAttribute(r,n),this._$El=null}}_$AK(e,t){var s;let o=this.constructor,r=o._$Ev.get(e);if(r!==void 0&&this._$El!==r){let n=o.getPropertyOptions(r),h=typeof n.converter=="function"?{fromAttribute:n.converter}:((s=n.converter)===null||s===void 0?void 0:s.fromAttribute)!==void 0?n.converter:X;this._$El=r,this[r]=h.fromAttribute(t,n.type),this._$El=null}}requestUpdate(e,t,s){let o=!0;e!==void 0&&(((s=s||this.constructor.getPropertyOptions(e)).hasChanged||fe)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),s.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,s))):o=!1),!this.isUpdatePending&&o&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((o,r)=>this[r]=o),this._$Ei=void 0);let t=!1,s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),(e=this._$ES)===null||e===void 0||e.forEach(o=>{var r;return(r=o.hostUpdate)===null||r===void 0?void 0:r.call(o)}),this.update(s)):this._$Ek()}catch(o){throw t=!1,this._$Ek(),o}t&&this._$AE(s)}willUpdate(e){}_$AE(e){var t;(t=this._$ES)===null||t===void 0||t.forEach(s=>{var o;return(o=s.hostUpdated)===null||o===void 0?void 0:o.call(s)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){this._$EC!==void 0&&(this._$EC.forEach((t,s)=>this._$EO(s,this[s],t)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}};$[Y]=!0,$.elementProperties=new Map,$.elementStyles=[],$.shadowRootOptions={mode:"open"},ge?.({ReactiveElement:$}),((G=W.reactiveElementVersions)!==null&&G!==void 0?G:W.reactiveElementVersions=[]).push("1.6.3");var ee,F=window,C=F.trustedTypes,me=C?C.createPolicy("lit-html",{createHTML:i=>i}):void 0,se="$lit$",y=`lit$${(Math.random()+"").slice(9)}$`,Se="?"+y,Be=`<${Se}>`,S=document,R=()=>S.createComment(""),T=i=>i===null||typeof i!="object"&&typeof i!="function",we=Array.isArray,Ve=i=>we(i)||typeof i?.[Symbol.iterator]=="function",te=`[
|
|
2
|
+
\f\r]`,M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,$e=/-->/g,_e=/>/g,A=RegExp(`>|${te}(?:([^\\s"'>=/]+)(${te}*=${te}*(?:[^
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),ye=/'/g,be=/"/g,Ee=/^(?:script|style|textarea|title)$/i,Ce=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),P=Ce(1),ht=Ce(2),w=Symbol.for("lit-noChange"),p=Symbol.for("lit-nothing"),Ae=new WeakMap,x=S.createTreeWalker(S,129,null,!1);function ke(i,e){if(!Array.isArray(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return me!==void 0?me.createHTML(e):e}var je=(i,e)=>{let t=i.length-1,s=[],o,r=e===2?"<svg>":"",n=M;for(let h=0;h<t;h++){let l=i[h],a,c,d=-1,u=0;for(;u<l.length&&(n.lastIndex=u,c=n.exec(l),c!==null);)u=n.lastIndex,n===M?c[1]==="!--"?n=$e:c[1]!==void 0?n=_e:c[2]!==void 0?(Ee.test(c[2])&&(o=RegExp("</"+c[2],"g")),n=A):c[3]!==void 0&&(n=A):n===A?c[0]===">"?(n=o??M,d=-1):c[1]===void 0?d=-2:(d=n.lastIndex-c[2].length,a=c[1],n=c[3]===void 0?A:c[3]==='"'?be:ye):n===be||n===ye?n=A:n===$e||n===_e?n=M:(n=A,o=void 0);let f=n===A&&i[h+1].startsWith("/>")?" ":"";r+=n===M?l+Be:d>=0?(s.push(a),l.slice(0,d)+se+l.slice(d)+y+f):l+y+(d===-2?(s.push(void 0),h):f)}return[ke(i,r+(i[t]||"<?>")+(e===2?"</svg>":"")),s]},z=class i{constructor({strings:e,_$litType$:t},s){let o;this.parts=[];let r=0,n=0,h=e.length-1,l=this.parts,[a,c]=je(e,t);if(this.el=i.createElement(a,s),x.currentNode=this.el.content,t===2){let d=this.el.content,u=d.firstChild;u.remove(),d.append(...u.childNodes)}for(;(o=x.nextNode())!==null&&l.length<h;){if(o.nodeType===1){if(o.hasAttributes()){let d=[];for(let u of o.getAttributeNames())if(u.endsWith(se)||u.startsWith(y)){let f=c[n++];if(d.push(u),f!==void 0){let Oe=o.getAttribute(f.toLowerCase()+se).split(y),B=/([.?@])?(.*)/.exec(f);l.push({type:1,index:r,name:B[2],strings:Oe,ctor:B[1]==="."?oe:B[1]==="?"?ne:B[1]==="@"?re:U})}else l.push({type:6,index:r})}for(let u of d)o.removeAttribute(u)}if(Ee.test(o.tagName)){let d=o.textContent.split(y),u=d.length-1;if(u>0){o.textContent=C?C.emptyScript:"";for(let f=0;f<u;f++)o.append(d[f],R()),x.nextNode(),l.push({type:2,index:++r});o.append(d[u],R())}}}else if(o.nodeType===8)if(o.data===Se)l.push({type:2,index:r});else{let d=-1;for(;(d=o.data.indexOf(y,d+1))!==-1;)l.push({type:7,index:r}),d+=y.length-1}r++}}static createElement(e,t){let s=S.createElement("template");return s.innerHTML=e,s}};function k(i,e,t=i,s){var o,r,n,h;if(e===w)return e;let l=s!==void 0?(o=t._$Co)===null||o===void 0?void 0:o[s]:t._$Cl,a=T(e)?void 0:e._$litDirective$;return l?.constructor!==a&&((r=l?._$AO)===null||r===void 0||r.call(l,!1),a===void 0?l=void 0:(l=new a(i),l._$AT(i,t,s)),s!==void 0?((n=(h=t)._$Co)!==null&&n!==void 0?n:h._$Co=[])[s]=l:t._$Cl=l),l!==void 0&&(e=k(i,l._$AS(i,e.values),l,s)),e}var ie=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var t;let{el:{content:s},parts:o}=this._$AD,r=((t=e?.creationScope)!==null&&t!==void 0?t:S).importNode(s,!0);x.currentNode=r;let n=x.nextNode(),h=0,l=0,a=o[0];for(;a!==void 0;){if(h===a.index){let c;a.type===2?c=new N(n,n.nextSibling,this,e):a.type===1?c=new a.ctor(n,a.name,a.strings,this,e):a.type===6&&(c=new le(n,this,e)),this._$AV.push(c),a=o[++l]}h!==a?.index&&(n=x.nextNode(),h++)}return x.currentNode=S,r}v(e){let t=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(e,s,t),t+=s.strings.length-2):s._$AI(e[t])),t++}},N=class i{constructor(e,t,s,o){var r;this.type=2,this._$AH=p,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=s,this.options=o,this._$Cp=(r=o?.isConnected)===null||r===void 0||r}get _$AU(){var e,t;return(t=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&t!==void 0?t:this._$Cp}get parentNode(){let e=this._$AA.parentNode,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=k(this,e,t),T(e)?e===p||e==null||e===""?(this._$AH!==p&&this._$AR(),this._$AH=p):e!==this._$AH&&e!==w&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):Ve(e)?this.T(e):this._(e)}k(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}$(e){this._$AH!==e&&(this._$AR(),this._$AH=this.k(e))}_(e){this._$AH!==p&&T(this._$AH)?this._$AA.nextSibling.data=e:this.$(S.createTextNode(e)),this._$AH=e}g(e){var t;let{values:s,_$litType$:o}=e,r=typeof o=="number"?this._$AC(e):(o.el===void 0&&(o.el=z.createElement(ke(o.h,o.h[0]),this.options)),o);if(((t=this._$AH)===null||t===void 0?void 0:t._$AD)===r)this._$AH.v(s);else{let n=new ie(r,this),h=n.u(this.options);n.v(s),this.$(h),this._$AH=n}}_$AC(e){let t=Ae.get(e.strings);return t===void 0&&Ae.set(e.strings,t=new z(e)),t}T(e){we(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,s,o=0;for(let r of e)o===t.length?t.push(s=new i(this.k(R()),this.k(R()),this,this.options)):s=t[o],s._$AI(r),o++;o<t.length&&(this._$AR(s&&s._$AB.nextSibling,o),t.length=o)}_$AR(e=this._$AA.nextSibling,t){var s;for((s=this._$AP)===null||s===void 0||s.call(this,!1,!0,t);e&&e!==this._$AB;){let o=e.nextSibling;e.remove(),e=o}}setConnected(e){var t;this._$AM===void 0&&(this._$Cp=e,(t=this._$AP)===null||t===void 0||t.call(this,e))}},U=class{constructor(e,t,s,o,r){this.type=1,this._$AH=p,this._$AN=void 0,this.element=e,this.name=t,this._$AM=o,this.options=r,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=p}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,s,o){let r=this.strings,n=!1;if(r===void 0)e=k(this,e,t,0),n=!T(e)||e!==this._$AH&&e!==w,n&&(this._$AH=e);else{let h=e,l,a;for(e=r[0],l=0;l<r.length-1;l++)a=k(this,h[s+l],t,l),a===w&&(a=this._$AH[l]),n||(n=!T(a)||a!==this._$AH[l]),a===p?e=p:e!==p&&(e+=(a??"")+r[l+1]),this._$AH[l]=a}n&&!o&&this.j(e)}j(e){e===p?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},oe=class extends U{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===p?void 0:e}},qe=C?C.emptyScript:"",ne=class extends U{constructor(){super(...arguments),this.type=4}j(e){e&&e!==p?this.element.setAttribute(this.name,qe):this.element.removeAttribute(this.name)}},re=class extends U{constructor(e,t,s,o,r){super(e,t,s,o,r),this.type=5}_$AI(e,t=this){var s;if((e=(s=k(this,e,t,0))!==null&&s!==void 0?s:p)===w)return;let o=this._$AH,r=e===p&&o!==p||e.capture!==o.capture||e.once!==o.once||e.passive!==o.passive,n=e!==p&&(o===p||r);r&&this.element.removeEventListener(this.name,this,o),n&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t,s;typeof this._$AH=="function"?this._$AH.call((s=(t=this.options)===null||t===void 0?void 0:t.host)!==null&&s!==void 0?s:this.element,e):this._$AH.handleEvent(e)}},le=class{constructor(e,t,s){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(e){k(this,e)}};var xe=F.litHtmlPolyfillSupport;xe?.(z,N),((ee=F.litHtmlVersions)!==null&&ee!==void 0?ee:F.litHtmlVersions=[]).push("2.8.0");var Ue=(i,e,t)=>{var s,o;let r=(s=t?.renderBefore)!==null&&s!==void 0?s:e,n=r._$litPart$;if(n===void 0){let h=(o=t?.renderBefore)!==null&&o!==void 0?o:null;r._$litPart$=n=new N(e.insertBefore(R(),h),h,void 0,t??{})}return n._$AI(i),n};var ae,he;var g=class extends ${constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,t;let s=super.createRenderRoot();return(e=(t=this.renderOptions).renderBefore)!==null&&e!==void 0||(t.renderBefore=s.firstChild),s}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Ue(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!1)}render(){return w}};g.finalized=!0,g._$litElement$=!0,(ae=globalThis.litElementHydrateSupport)===null||ae===void 0||ae.call(globalThis,{LitElement:g});var Pe=globalThis.litElementPolyfillSupport;Pe?.({LitElement:g});((he=globalThis.litElementVersions)!==null&&he!==void 0?he:globalThis.litElementVersions=[]).push("3.3.3");var We=(i,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(t){t.createProperty(e.key,i)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(t){t.createProperty(e.key,i)}},Fe=(i,e,t)=>{e.constructor.createProperty(t,i)};function v(i){return(e,t)=>t!==void 0?Fe(i,e,t):We(i,e)}var He=i=>i??p;var Ke=":host{display:inline-block;font-size:13px;line-height:20px;font-family:Segoe UI,Lucida Sans,Arial,sans-serif;color:#111;contain:content}:host([hidden]){display:none!important}:host([level=warn i]){color:#555}:host([level=suggest i]){color:#bf8800}:host([level=error i]){color:#cc0017}:host([level=warn]){color:#555}:host([level=suggest]){color:#bf8800}:host([level=error]){color:#cc0017}.icon{height:12px;width:12px;padding-right:4px;margin-bottom:-1px}",Je="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2012%2012'%3e%3cstyle%20id='style3'%3e%20.st0{fill:%23fff}.st1{fill:%23c00}%20%3c/style%3e%3cg%20id='g5'%3e%3cpath%20class='st1'%20d='M6%20.9c2.8%200%205.1%202.3%205.1%205.1S8.8%2011.1%206%2011.1.9%208.8.9%206%203.2.9%206%20.9m0-1C2.7-.1-.1%202.7-.1%206s2.7%206.1%206.1%206.1%206.1-2.7%206.1-6.1S9.3-.1%206-.1z'%20id='path9'/%3e%3c/g%3e%3cg%20id='g11'%3e%3cpath%20class='st0'%20id='rect13'%20d='M5.5%202.5h1v4h-1z'/%3e%3cpath%20class='st1'%20d='M6%203v3-3m1-1H5v5h2V2z'%20id='path15'/%3e%3c/g%3e%3cg%20id='g17'%3e%3cpath%20class='st0'%20id='rect19'%20d='M5.5%208.5h1v1h-1z'/%3e%3cpath%20class='st1'%20id='polygon21'%20d='M7%208H5v2h2V8z'/%3e%3c/g%3e%3c/svg%3e",Ze="data:image/svg+xml,%3csvg%20id='Ebene_1'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cstyle%3e%20.st0{fill:%23bf8800}%20%3c/style%3e%3cpath%20class='st0'%20d='M12%20.8l11%2019.8v1.3H1v-1.3L12%20.8zm.8-.6h-1.6L0%2020v3h24v-3L12.8.2z'/%3e%3cpath%20class='st0'%20d='M11%208h2v8h-2zm0%2010h2v2h-2z'/%3e%3c/svg%3e",Ge="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2012%2012'%3e%3cpath%20class='st1'%20d='M6%20.9c2.8%200%205.1%202.3%205.1%205.1S8.8%2011.1%206%2011.1.9%208.8.9%206%203.2.9%206%20.9m0-1C2.7-.1-.1%202.7-.1%206s2.7%206.1%206.1%206.1%206.1-2.7%206.1-6.1S9.3-.1%206-.1z'%20fill='%23555'/%3e%3cpath%20d='M6%209V6v3m-1%201h2V5H5v5zm2-8H5v2h2z'%20class='st1'%20fill='%23555'/%3e%3c/svg%3e",Qe=Object.defineProperty,Xe=Object.getOwnPropertyDescriptor,de=(i,e,t,s)=>{for(var o=s>1?void 0:s?Xe(e,t):e,r=i.length-1,n;r>=0;r--)(n=i[r])&&(o=(s?n(e,t,o):n(o))||o);return s&&o&&Qe(e,t,o),o},H,I=(H=class extends g{static parseLevel(i){if(i){let e=Object.keys(D).find(t=>t.toLowerCase()===i.toLowerCase());return e&&D[e]}}static get styles(){return[O`
|
|
4
|
+
${E(Ke)}
|
|
5
|
+
`]}render(){return P`${this.iconToUse&&P`<img class="icon" src="${this.iconToUse}">`}${this.message}`}get iconToUse(){return this.icon||this._defaultIconPath}shouldUpdate(i){return i.has("level")&&(this._defaultIconPath=this.iconForLevel,!this.icon)?!0:super.shouldUpdate(i)}get iconForLevel(){switch(H.parseLevel(this.level)){case"warn":return Ge;case"suggest":return Ze;case"error":return Je;default:return null}}},H.ID="sd-field-validation-message",H.levelConverter={fromAttribute(i){return H.parseLevel(i)},toAttribute(i){return i&&i.toLowerCase()}},H);de([v({type:String,attribute:!0})],I.prototype,"message",2);de([v({type:String,attribute:!0})],I.prototype,"icon",2);de([v({converter:I.levelConverter,reflect:!0})],I.prototype,"level",2);var ce=I,D=(i=>(i.Warn="warn",i.Suggest="suggest",i.Error="error",i))(D||{});customElements.get(ce.ID)||customElements.define(ce.ID,ce);var Ye=`:host{display:block}:host,.label,.checkbox{outline:none}.checkbox-container{display:flex;flex-direction:row;align-items:flex-start}.checkbox{appearance:none;-moz-appearance:none;-webkit-appearance:none;display:block;margin:0;width:20px;height:20px;border:2px solid #767676;cursor:pointer;background-color:#fff}:host(:not([disabled]):focus) .highlight,:host(:not([disabled])[focused]) .highlight{background-color:#1467ba4d;border-radius:4px}:host(:not([disabled]):focus) .highlight .checkbox,:host(:not([disabled])[focused]) .highlight .checkbox{border-color:#1467ba}:host([checked]) .checkbox{background:#1467ba url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='15'%20height='15'%20viewBox='0%200%2020%2020'%3e%3cpath%20d='M15.9%204.6L17.4%206l-9.5%209.5-5.2-5.2%201.4-1.4%203.8%203.8%208-8.1z'%20fill='%23fff'/%3e%3c/svg%3e") no-repeat center center;border-color:#1467ba}.checkbox.indeterminate{background:#1467ba url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='32'%20height='32'%3e%3cpath%20fill='%23fff'%20d='M8%2014h16v4H8z'/%3e%3c/svg%3e") no-repeat center center;background-size:20px;border-color:#1467ba}.highlight{border:4px solid transparent;margin-right:6px}:host([disabled]) .checkbox-container{opacity:.6;cursor:default;filter:grayscale(100%);pointer-events:none}.validation-message{margin-left:4px}.label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;margin-top:4px;line-height:20px}:host([oneline]) .label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}`,et=Object.defineProperty,tt=Object.getOwnPropertyDescriptor,_=(i,e,t,s)=>{for(var o=s>1?void 0:s?tt(e,t):e,r=i.length-1,n;r>=0;r--)(n=i[r])&&(o=(s?n(e,t,o):n(o))||o);return s&&o&&et(e,t,o),o},st="indeterminate",pe="delegatesFocus"in window.ShadowRoot.prototype,b,m=(b=class extends g{constructor(){super(...arguments),this._checked=!1,this._indeterminate=!1}get checked(){return this._checked}set checked(i){let e=this._checked;this._checked=i,this._checked&&(this.indeterminate=!1),this.requestUpdate("checked",e)}get indeterminate(){return this._indeterminate}set indeterminate(i){let e=this._indeterminate;this._indeterminate=i,this._indeterminate&&(this.checked=!1),this.requestUpdate("indeterminate",e)}firstUpdated(i){super.firstUpdated(i),pe||(this.checkboxElement.onfocus=()=>this.setAttribute("focused",""),this.checkboxElement.onblur=()=>this.removeAttribute("focused"),this.addEventListener("focus",e=>{e.target===this&&this.checkboxElement.focus()}))}focus(){this.checkboxElement?this.checkboxElement.focus():super.focus()}attributeChangedCallback(i,e,t){super.attributeChangedCallback(i,e,t),!pe&&i==="tabindex"&&e!==t&&t==="0"&&this.removeAttribute("tabindex")}render(){return P`
|
|
6
|
+
<div class="checkbox-container">
|
|
7
|
+
<div class="highlight">
|
|
8
|
+
<input
|
|
9
|
+
type="checkbox"
|
|
10
|
+
id="input"
|
|
11
|
+
?disabled=${this.disabled}
|
|
12
|
+
tabindex=${He(this.tabIndex==null?void 0:this.tabIndex)}
|
|
13
|
+
.checked=${this.checked}
|
|
14
|
+
.indeterminate=${this.indeterminate}
|
|
15
|
+
class="checkbox${this.indeterminate?" "+st:""}"
|
|
16
|
+
@change="${this.onInputValueChange}"
|
|
17
|
+
/>
|
|
18
|
+
</div>
|
|
19
|
+
<label class="label" for="input">${this.label}</label>
|
|
20
|
+
</div>
|
|
21
|
+
${this.validationMessage&&P`
|
|
22
|
+
<sd-field-validation-message
|
|
23
|
+
class="validation-message"
|
|
24
|
+
.message=${this.validationMessage}
|
|
25
|
+
.icon=${this.validationIconSrc}
|
|
26
|
+
.level=${this.validationLevel}
|
|
27
|
+
>
|
|
28
|
+
</sd-field-validation-message>
|
|
29
|
+
`}
|
|
30
|
+
`}onInputValueChange(i){i.preventDefault(),i.stopPropagation(),this.checked=i.target.checked,this.fireValueChange()}fireValueChange(){this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this.checked}}))}get checkboxElement(){return this.shadowRoot.querySelector(".checkbox")}static get styles(){return[O`
|
|
31
|
+
${E(Ye)}
|
|
32
|
+
`]}},b.ID="sd-checkbox",b.ensureDefined=()=>{customElements.get(b.ID)||customElements.define(b.ID,b)},b.shadowRootOptions={...g.shadowRootOptions,delegatesFocus:pe},b);_([v({type:Boolean,reflect:!0})],m.prototype,"disabled",2);_([v({type:String,reflect:!0})],m.prototype,"label",2);_([v({type:String})],m.prototype,"validationMessage",2);_([v({type:String})],m.prototype,"validationIconSrc",2);_([v({type:D,reflect:!0})],m.prototype,"validationLevel",2);_([v({type:Number})],m.prototype,"tabIndex",2);_([v({type:Boolean,reflect:!0})],m.prototype,"oneLine",2);_([v({type:Boolean,reflect:!0})],m.prototype,"checked",1);_([v({type:Boolean,reflect:!1,attribute:!1})],m.prototype,"indeterminate",1);var Le=m;Le.ensureDefined();return Ie(it);})();
|
|
33
|
+
/*! Bundled license information:
|
|
34
|
+
|
|
35
|
+
@lit/reactive-element/css-tag.js:
|
|
36
|
+
(**
|
|
37
|
+
* @license
|
|
38
|
+
* Copyright 2019 Google LLC
|
|
39
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
40
|
+
*)
|
|
41
|
+
|
|
42
|
+
@lit/reactive-element/reactive-element.js:
|
|
43
|
+
(**
|
|
44
|
+
* @license
|
|
45
|
+
* Copyright 2017 Google LLC
|
|
46
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
47
|
+
*)
|
|
48
|
+
|
|
49
|
+
lit-html/lit-html.js:
|
|
50
|
+
(**
|
|
51
|
+
* @license
|
|
52
|
+
* Copyright 2017 Google LLC
|
|
53
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
54
|
+
*)
|
|
55
|
+
|
|
56
|
+
lit-element/lit-element.js:
|
|
57
|
+
(**
|
|
58
|
+
* @license
|
|
59
|
+
* Copyright 2017 Google LLC
|
|
60
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
61
|
+
*)
|
|
62
|
+
|
|
63
|
+
lit-html/is-server.js:
|
|
64
|
+
(**
|
|
65
|
+
* @license
|
|
66
|
+
* Copyright 2022 Google LLC
|
|
67
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
68
|
+
*)
|
|
69
|
+
|
|
70
|
+
@lit/reactive-element/decorators/property.js:
|
|
71
|
+
(**
|
|
72
|
+
* @license
|
|
73
|
+
* Copyright 2017 Google LLC
|
|
74
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
75
|
+
*)
|
|
76
|
+
|
|
77
|
+
lit-html/directives/if-defined.js:
|
|
78
|
+
(**
|
|
79
|
+
* @license
|
|
80
|
+
* Copyright 2018 Google LLC
|
|
81
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
82
|
+
*)
|
|
83
|
+
*/
|
|
84
|
+
//# sourceMappingURL=checkbox-with-externals.js.map
|