UNPKG

iobroker.lovelace

Version:

With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI

23 lines 11.8 kB
/*! For license information please see 81347.c55a6db05fec645d.js.LICENSE.txt */ export const __rspack_esm_id=81347;export const __rspack_esm_ids=[81347];export const __webpack_modules__={9503(e,t,r){var o=r(62826),a=r(97577),i=r(5124),n=r(22441);class l extends a.A{get value(){return this._value??null}set value(e){this._value=e}static get styles(){return[a.A.styles,i.AH`:host{--wa-form-control-toggle-size:var(--ha-checkbox-size, 20px);--wa-form-control-border-color:var( --ha-checkbox-border-color, var(--ha-color-border-neutral-normal) );--wa-form-control-background-color:var( --ha-checkbox-background-color, var(--wa-form-control-background-color) );--checked-icon-color:var( --ha-checkbox-checked-icon-color, var(--wa-color-brand-on-loud) );--wa-form-control-activated-color:var( --ha-checkbox-checked-background-color, var(--ha-color-fill-primary-loud-resting) );-webkit-tap-highlight-color:transparent;--checked-icon-scale:var(--ha-checkbox-checked-icon-scale, 0.9);--wa-form-control-required-content:var( --ha-checkbox-required-marker, var(--ha-input-required-marker, "*") );--wa-form-control-required-content-offset:var( --ha-checkbox-required-marker-offset, 0.1rem )}[part~=base]{align-items:center;gap:var(--ha-space-2)}[part~=control]{border-radius:var(--ha-checkbox-border-radius,var(--ha-border-radius-sm));border-width:var(--ha-checkbox-border-width,var(--ha-border-width-md));margin-inline-end:0}[part~=label]{line-height:1}#hint{font-size:var(--ha-font-size-xs);color:var(--ha-color-text-secondary)}label:has(input:not(:disabled)):hover{--wa-form-control-border-color:var( --ha-checkbox-border-color-hover, var(--ha-checkbox-border-color, var(--ha-color-border-neutral-loud)) )}label:has(input:not(:disabled)):hover [part~=control]{background-color:var(--ha-checkbox-background-color-hover,var(--ha-color-form-background-hover))}label:has(input:checked:not(:disabled)):hover [part~=control],label:has(input:indeterminate:not(:disabled)):hover [part~=control]{background-color:var(--ha-checkbox-checked-background-color-hover,var(--ha-color-fill-primary-loud-hover));border-color:var(--ha-checkbox-checked-background-color-hover,var(--ha-color-fill-primary-loud-hover))}`]}}l=(0,o.Cg)([(0,n.EM)("ha-checkbox")],l)},46990(e,t,r){r.r(t),r.d(t,{HaFormBoolean:()=>l});var o=r(62826),a=r(5124),i=r(22441),n=r(1087);r(9503);class l extends a.WF{focus(){this._input&&this._input.focus()}render(){return a.qy` <ha-checkbox .checked="${this.data}" .disabled="${this.disabled}" @change="${this._valueChanged}" .hint="${this.helper}"> ${this.label} </ha-checkbox> `}_valueChanged(e){(0,n.r)(this,"value-changed",{value:e.target.checked})}constructor(...e){super(...e),this.disabled=!1}}l.styles=a.AH`ha-checkbox{min-height:56px;justify-content:center}ha-checkbox::part(base){align-items:center}`,(0,o.Cg)([(0,i.MZ)({attribute:!1})],l.prototype,"schema",void 0),(0,o.Cg)([(0,i.MZ)({attribute:!1})],l.prototype,"data",void 0),(0,o.Cg)([(0,i.MZ)()],l.prototype,"label",void 0),(0,o.Cg)([(0,i.MZ)()],l.prototype,"helper",void 0),(0,o.Cg)([(0,i.MZ)({type:Boolean})],l.prototype,"disabled",void 0),(0,o.Cg)([(0,i.P)("ha-checkbox",!0)],l.prototype,"_input",void 0),l=(0,o.Cg)([(0,i.EM)("ha-form-boolean")],l)},97577(e,t,r){r.d(t,{A:()=>g});var o=r(5124),a=r(22441),i=r(6412),n=r(63672),l=r(34514),c=r(40991),s=r(92070),h=r(49546),d=r(9395),u=r(62676),p=r(15477),b=r(31896),v=(r(38625),o.AH`:host{--checked-icon-color:var(--wa-color-brand-on-loud);--checked-icon-scale:0.8;display:inline-flex;color:var(--wa-form-control-value-color);font-family:inherit;font-weight:var(--wa-form-control-value-font-weight);line-height:var(--wa-form-control-value-line-height);user-select:none;-webkit-user-select:none}[part~=control]{display:inline-flex;flex:0 0 auto;position:relative;align-items:center;justify-content:center;width:var(--wa-form-control-toggle-size);height:var(--wa-form-control-toggle-size);border-color:var(--wa-form-control-border-color);border-radius:min(calc(var(--wa-form-control-toggle-size) * .375),var(--wa-border-radius-s));border-style:var(--wa-border-style);border-width:var(--wa-form-control-border-width);background-color:var(--wa-form-control-background-color);transition:background var(--wa-transition-normal),border-color var(--wa-transition-fast),box-shadow var(--wa-transition-fast),color var(--wa-transition-fast);transition-timing-function:var(--wa-transition-easing);margin-inline-end:.5em}[part~=base]{display:flex;align-items:flex-start;position:relative;color:currentColor;vertical-align:middle;cursor:pointer}[part~=label]{display:inline}[part~=control]:has(:checked,:indeterminate){color:var(--checked-icon-color);border-color:var(--wa-form-control-activated-color);background-color:var(--wa-form-control-activated-color)}[part~=control]:has(> input:focus-visible:not(:disabled)){outline:var(--wa-focus-ring);outline-offset:var(--wa-focus-ring-offset)}:host [part~=base]:has(input:disabled){opacity:.5;cursor:not-allowed}input{position:absolute;padding:0;margin:0;height:100%;width:100%;opacity:0;pointer-events:none}[part~=icon]{display:flex;scale:var(--checked-icon-scale)}[part~=icon]::part(svg){translate:0.0009765625em}input:not(:checked,:indeterminate)+[part~=icon]{visibility:hidden}:host([required]) [part~=label]::after{content:var(--wa-form-control-required-content);color:var(--wa-form-control-required-content-color);margin-inline-start:var(--wa-form-control-required-content-offset)}`),m=Object.defineProperty,f=Object.getOwnPropertyDescriptor,k=(e,t,r,o)=>{for(var a,i=o>1?void 0:o?f(t,r):t,n=e.length-1;n>=0;n--)(a=e[n])&&(i=(o?a(t,r,i):a(i))||i);return o&&i&&m(t,r,i),i};let g=class extends u.q{static get validators(){const e=o.S$?[]:[(0,h.Y)({validationProperty:"checked",validationElement:Object.assign(document.createElement("input"),{type:"checkbox",required:!0})})];return[...super.validators,...e]}get value(){return this._value??"on"}set value(e){this._value=e}handleSizeChange(){(0,c.b)(this.localName,this.size)}get checked(){return this.valueHasChanged?Boolean(this._checked):this._checked??this.defaultChecked}set checked(e){this._checked=Boolean(e),this.valueHasChanged=!0}handleClick(){this.hasInteracted=!0,this.checked=!this.checked,this.indeterminate=!1,this.updateComplete.then(()=>{this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))})}connectedCallback(){super.connectedCallback(),this.handleDefaultCheckedChange()}handleDefaultCheckedChange(){this.handleValueOrCheckedChange()}handleValueOrCheckedChange(){this.setValue(this.checked?this.value:null,this._value),this.updateValidity()}handleStateChange(){this.hasUpdated&&(this.input.checked=this.checked,this.input.indeterminate=this.indeterminate),this.customStates.set("checked",this.checked),this.customStates.set("indeterminate",this.indeterminate),this.updateValidity()}handleDisabledChange(){this.customStates.set("disabled",this.disabled)}willUpdate(e){super.willUpdate(e),(e.has("value")||e.has("checked")||e.has("defaultChecked"))&&this.handleValueOrCheckedChange()}formResetCallback(){this._checked=null,super.formResetCallback(),this.handleValueOrCheckedChange()}click(){this.input.click()}focus(e){this.input.focus(e)}blur(){this.input.blur()}render(){const e=!!o.S$||this.hasSlotController.test("hint"),t=!!this.hint||!!e,r=!this.checked&&this.indeterminate,a=r?"indeterminate":"check",c=r?"indeterminate":"check";return o.qy` <label part="base"> <span part="control"> <input class="input" type="checkbox" title="${this.title}" name="${(0,n.J)(this.name)}" value="${(0,n.J)(this._value)}" .indeterminate="${(0,l.V)(this.indeterminate)}" .checked="${(0,l.V)(this.checked)}" .disabled="${this.disabled}" .required="${this.required}" aria-checked="${this.indeterminate?"mixed":this.checked?"true":"false"}" aria-describedby="hint" @click="${this.handleClick}"> <wa-icon part="${c}-icon icon" library="system" name="${a}"></wa-icon> </span> <slot part="label"></slot> </label> <slot id="hint" part="hint" name="hint" aria-hidden="${t?"false":"true"}" class="${(0,i.H)({"has-slotted":t})}"> ${this.hint} </slot> `}constructor(){super(...arguments),this.hasSlotController=new s.X(this,"hint"),this.title="",this.name=null,this._value=this.getAttribute("value")??null,this.size="m",this.disabled=!1,this.indeterminate=!1,this._checked=null,this.defaultChecked=this.hasAttribute("checked"),this.required=!1,this.hint=""}};g.css=[p.A,b.A,v],g.shadowRootOptions={...u.q.shadowRootOptions,delegatesFocus:!0},k([(0,a.P)('input[type="checkbox"]')],g.prototype,"input",2),k([(0,a.MZ)()],g.prototype,"title",2),k([(0,a.MZ)({reflect:!0})],g.prototype,"name",2),k([(0,a.MZ)({reflect:!0})],g.prototype,"value",1),k([(0,a.MZ)({reflect:!0})],g.prototype,"size",2),k([(0,d.w)("size")],g.prototype,"handleSizeChange",1),k([(0,a.MZ)({type:Boolean})],g.prototype,"disabled",2),k([(0,a.MZ)({type:Boolean,reflect:!0})],g.prototype,"indeterminate",2),k([(0,a.MZ)({type:Boolean,attribute:!1})],g.prototype,"checked",1),k([(0,a.MZ)({type:Boolean,reflect:!0,attribute:"checked"})],g.prototype,"defaultChecked",2),k([(0,a.MZ)({type:Boolean,reflect:!0})],g.prototype,"required",2),k([(0,a.MZ)()],g.prototype,"hint",2),k([(0,d.w)(["checked","defaultChecked"])],g.prototype,"handleDefaultCheckedChange",1),k([(0,d.w)(["checked","indeterminate"])],g.prototype,"handleStateChange",1),k([(0,d.w)("disabled")],g.prototype,"handleDisabledChange",1),g=k([(0,a.EM)("wa-checkbox")],g),g.disableWarning?.("change-in-update")},49546(e,t,r){r.d(t,{Y:()=>o});r(44114);const o=(e={})=>{let{validationElement:t,validationProperty:r}=e;t||(t=Object.assign(document.createElement("input"),{required:!0})),r||(r="value");const o={observedAttributes:["required"],message:t.validationMessage,checkValidity(e){const t={message:"",isValid:!0,invalidKeys:[]};if(!(e.required??e.hasAttribute("required")))return t;return!e[r]&&(t.message="function"==typeof o.message?o.message(e):o.message||"",t.isValid=!1,t.invalidKeys.push("valueMissing")),t}};return o}},15477(e,t,r){r.d(t,{A:()=>o});var o=r(5124).AH`:host{display:flex;flex-direction:column}[part~=form-control]{display:contents}:is([part~=form-control-label],[part~=label]).has-label,:is([part~=form-control-label],[part~=label]):has(:not(:empty)){display:inline-flex;color:var(--wa-form-control-label-color);font-weight:var(--wa-form-control-label-font-weight);line-height:var(--wa-form-control-label-line-height);margin-block-end:0.5em}:host([required]) :is([part~=form-control-label],[part~=label])::after{content:var(--wa-form-control-required-content);margin-inline-start:var(--wa-form-control-required-content-offset);color:var(--wa-form-control-required-content-color)}[part~=hint]{display:block;color:var(--wa-form-control-hint-color);font-weight:var(--wa-form-control-hint-font-weight);line-height:var(--wa-form-control-hint-line-height);margin-block-start:0.5em;font-size:var(--wa-font-size-smaller)}[part~=hint]:not(.has-slotted,.has-hint){display:none}`},34514(e,t,r){r.d(t,{V:()=>n});var o=r(5055),a=r(42017),i=r(63937);const n=(0,a.u$)(class extends a.WL{render(e){return e}update(e,[t]){if(t===o.c0||t===o.s6)return t;const r=e.element,n=e.name;if(e.type===a.OA.PROPERTY){if(t===r[n])return o.c0}else if(e.type===a.OA.BOOLEAN_ATTRIBUTE){if(!!t===r.hasAttribute(n))return o.c0}else if(e.type===a.OA.ATTRIBUTE&&r.getAttribute(n)===t+"")return o.c0;return(0,i.mY)(e),t}constructor(e){if(super(e),e.type!==a.OA.PROPERTY&&e.type!==a.OA.ATTRIBUTE&&e.type!==a.OA.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!(0,i.Rt)(e))throw Error("`live` bindings can only contain a single expression")}})}};