UNPKG

iobroker.lovelace

Version:

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

2 lines 9.76 kB
/*! For license information please see 55412.831fec4f25b2b82a.js.LICENSE.txt */ export const __rspack_esm_id=55412;export const __rspack_esm_ids=[55412];export const __webpack_modules__={97577(e,t,i){i.d(t,{A:()=>k});var n=i(5124),r=i(22441),a=i(6412),s=i(63672),o=i(34514),c=i(40991),l=i(92070),h=i(49546),d=i(9395),u=i(62676),p=i(15477),f=i(31896),m=(i(38625),n.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)}`),v=Object.defineProperty,b=Object.getOwnPropertyDescriptor,g=(e,t,i,n)=>{for(var r,a=n>1?void 0:n?b(t,i):t,s=e.length-1;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&v(t,i,a),a};let k=class extends u.q{static get validators(){const e=n.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=!!n.S$||this.hasSlotController.test("hint"),t=!!this.hint||!!e,i=!this.checked&&this.indeterminate,r=i?"indeterminate":"check",c=i?"indeterminate":"check";return n.qy` <label part="base"> <span part="control"> <input class="input" type="checkbox" title="${this.title}" name="${(0,s.J)(this.name)}" value="${(0,s.J)(this._value)}" .indeterminate="${(0,o.V)(this.indeterminate)}" .checked="${(0,o.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="${r}"></wa-icon> </span> <slot part="label"></slot> </label> <slot id="hint" part="hint" name="hint" aria-hidden="${t?"false":"true"}" class="${(0,a.H)({"has-slotted":t})}"> ${this.hint} </slot> `}constructor(){super(...arguments),this.hasSlotController=new l.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=""}};k.css=[p.A,f.A,m],k.shadowRootOptions={...u.q.shadowRootOptions,delegatesFocus:!0},g([(0,r.P)('input[type="checkbox"]')],k.prototype,"input",2),g([(0,r.MZ)()],k.prototype,"title",2),g([(0,r.MZ)({reflect:!0})],k.prototype,"name",2),g([(0,r.MZ)({reflect:!0})],k.prototype,"value",1),g([(0,r.MZ)({reflect:!0})],k.prototype,"size",2),g([(0,d.w)("size")],k.prototype,"handleSizeChange",1),g([(0,r.MZ)({type:Boolean})],k.prototype,"disabled",2),g([(0,r.MZ)({type:Boolean,reflect:!0})],k.prototype,"indeterminate",2),g([(0,r.MZ)({type:Boolean,attribute:!1})],k.prototype,"checked",1),g([(0,r.MZ)({type:Boolean,reflect:!0,attribute:"checked"})],k.prototype,"defaultChecked",2),g([(0,r.MZ)({type:Boolean,reflect:!0})],k.prototype,"required",2),g([(0,r.MZ)()],k.prototype,"hint",2),g([(0,d.w)(["checked","defaultChecked"])],k.prototype,"handleDefaultCheckedChange",1),g([(0,d.w)(["checked","indeterminate"])],k.prototype,"handleStateChange",1),g([(0,d.w)("disabled")],k.prototype,"handleDisabledChange",1),k=g([(0,r.EM)("wa-checkbox")],k),k.disableWarning?.("change-in-update")},49546(e,t,i){i.d(t,{Y:()=>n});i(44114);const n=(e={})=>{let{validationElement:t,validationProperty:i}=e;t||(t=Object.assign(document.createElement("input"),{required:!0})),i||(i="value");const n={observedAttributes:["required"],message:t.validationMessage,checkValidity(e){const t={message:"",isValid:!0,invalidKeys:[]};if(!(e.required??e.hasAttribute("required")))return t;return!e[i]&&(t.message="function"==typeof n.message?n.message(e):n.message||"",t.isValid=!1,t.invalidKeys.push("valueMissing")),t}};return n}},74816(e,t,i){i.d(t,{x:()=>r});i(18111),i(20116),i(61701);var n=i(73420);function r(e,...t){const i=n.w.bind(null,e||t.find(e=>"object"==typeof e));return t.map(i)}},9160(e,t,i){i.d(t,{_P:()=>s,my:()=>n,s0:()=>a,w4:()=>r});Math.pow(10,8);const n=6048e5,r=864e5,a=36e5,s=Symbol.for("constructDateFrom")},73420(e,t,i){i.d(t,{w:()=>r});var n=i(9160);function r(e,t){return"function"==typeof e?e(t):e&&"object"==typeof e&&n._P in e?e[n._P](t):e instanceof Date?new e.constructor(t):new Date(t)}},35932(e,t,i){i.d(t,{o:()=>r});var n=i(83504);function r(e,t){const i=(0,n.a)(e,t?.in);return i.setHours(0,0,0,0),i}},83504(e,t,i){i.d(t,{a:()=>r});var n=i(73420);function r(e,t){return(0,n.w)(t||e,e)}},89784(e,t,i){i.d(t,{W:()=>o});i(74423),i(18111),i(18237),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);var n=i(5055),r=i(42017);const a="important",s=" !"+a,o=(0,r.u$)(class extends r.WL{render(e){return Object.keys(e).reduce((t,i)=>{const n=e[i];return null==n?t:t+`${i=i.includes("-")?i:i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${n};`},"")}update(e,[t]){const{style:i}=e.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(t)),this.render(t);for(const e of this.ft)null==t[e]&&(this.ft.delete(e),e.includes("-")?i.removeProperty(e):i[e]=null);for(const e in t){const n=t[e];if(null!=n){this.ft.add(e);const t="string"==typeof n&&n.endsWith(s);e.includes("-")||t?i.setProperty(e,t?n.slice(0,-11):n,t?a:""):i[e]=n}}return n.c0}constructor(e){if(super(e),e.type!==r.OA.ATTRIBUTE||"style"!==e.name||e.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}})},91450(e,t,i){i.d(t,{T:()=>u});i(18111),i(20116);var n=i(5055),r=i(63937),a=i(37540);class s{disconnect(){this.G=void 0}reconnect(e){this.G=e}deref(){return this.G}constructor(e){this.G=e}}class o{get(){return this.Y}pause(){this.Y??=new Promise(e=>this.Z=e)}resume(){this.Z?.(),this.Y=this.Z=void 0}constructor(){this.Y=void 0,this.Z=void 0}}var c=i(42017);const l=e=>!(0,r.sO)(e)&&"function"==typeof e.then,h=1073741823;class d extends a.Kq{render(...e){return e.find(e=>!l(e))??n.c0}update(e,t){const i=this._$Cbt;let r=i.length;this._$Cbt=t;const a=this._$CK,s=this._$CX;this.isConnected||this.disconnected();for(let e=0;e<t.length&&!(e>this._$Cwt);e++){const n=t[e];if(!l(n))return this._$Cwt=e,n;e<r&&n===i[e]||(this._$Cwt=h,r=0,Promise.resolve(n).then(async e=>{for(;s.get();)await s.get();const t=a.deref();if(void 0!==t){const i=t._$Cbt.indexOf(n);i>-1&&i<t._$Cwt&&(t._$Cwt=i,t.setValue(e))}}))}return n.c0}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}constructor(){super(...arguments),this._$Cwt=h,this._$Cbt=[],this._$CK=new s(this),this._$CX=new o}}const u=(0,c.u$)(d)}};