iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
2 lines • 4.89 kB
JavaScript
export const __webpack_ids__=["29579"];export const __webpack_modules__={55486:function(e,t,c){var i=c(44249),d=c(4918),o=c(6394),a=c(57243),l=c(15093),n=c(35359),r=c(36522);(0,i.Z)([(0,l.Mo)("ha-formfield")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,l.Cb)({type:Boolean,reflect:!0})],key:"disabled",value:()=>!1},{kind:"method",key:"render",value:function(){const e={"mdc-form-field--align-end":this.alignEnd,"mdc-form-field--space-between":this.spaceBetween,"mdc-form-field--nowrap":this.nowrap};return a.dy` <div class="mdc-form-field ${(0,n.$)(e)}"> <slot></slot> <label class="mdc-label" @click="${this._labelClick}"> <slot name="label">${this.label}</slot> </label> </div>`}},{kind:"method",key:"_labelClick",value:function(){const e=this.input;if(e&&(e.focus(),!e.disabled))switch(e.tagName){case"HA-CHECKBOX":e.checked=!e.checked,(0,r.B)(e,"change");break;case"HA-RADIO":e.checked=!0,(0,r.B)(e,"change");break;default:e.click()}}},{kind:"field",static:!0,key:"styles",value:()=>[o.W,a.iv`:host(:not([alignEnd])) ::slotted(ha-switch){margin-right:10px;margin-inline-end:10px;margin-inline-start:inline}.mdc-form-field{align-items:var(--ha-formfield-align-items,center);gap:4px}.mdc-form-field>label{direction:var(--direction);margin-inline-start:0;margin-inline-end:auto;padding:0}:host([disabled]) label{color:var(--disabled-text-color)}`]}]}}),d.a)},34363:function(e,t,c){var i=c(44249),d=c(57243),o=c(15093);(0,i.Z)([(0,o.Mo)("ha-input-helper-text")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"method",key:"render",value:function(){return d.dy`<slot></slot>`}},{kind:"field",static:!0,key:"styles",value:()=>d.iv`:host{display:block;color:var(--mdc-text-field-label-ink-color,rgba(0,0,0,.6));font-size:.75rem;padding-left:16px;padding-right:16px;padding-inline-start:16px;padding-inline-end:16px}`}]}}),d.oi)},56070:function(e,t,c){c.r(t),c.d(t,{HaBooleanSelector:()=>l});var i=c(44249),d=c(57243),o=c(15093),a=c(36522);c(55486),c(1888),c(34363);let l=(0,i.Z)([(0,o.Mo)("ha-selector-boolean")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"value",value:()=>!1},{kind:"field",decorators:[(0,o.Cb)()],key:"placeholder",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"helper",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"method",key:"render",value:function(){return d.dy` <ha-formfield alignEnd spaceBetween .label="${this.label}"> <ha-switch .checked="${this.value??!0===this.placeholder}" @change="${this._handleChange}" .disabled="${this.disabled}"></ha-switch> <span slot="label"> <p class="primary">${this.label}</p> ${this.helper?d.dy`<p class="secondary">${this.helper}</p>`:d.Ld} </span> </ha-formfield> `}},{kind:"method",key:"_handleChange",value:function(e){const t=e.target.checked;this.value!==t&&(0,a.B)(this,"value-changed",{value:t})}},{kind:"field",static:!0,key:"styles",value:()=>d.iv`ha-formfield{display:flex;min-height:56px;align-items:center;--mdc-typography-body2-font-size:1em}p{margin:0}.secondary{direction:var(--direction);padding-top:4px;box-sizing:border-box;color:var(--secondary-text-color);font-size:.875rem;font-weight:var(--mdc-typography-body2-font-weight,400)}`}]}}),d.oi)},1888:function(e,t,c){var i=c(44249),d=c(72621),o=c(62523),a=c(83835),l=c(57243),n=c(15093),r=c(13560);(0,i.Z)([(0,n.Mo)("ha-switch")],(function(e,t){class c extends t{constructor(...t){super(...t),e(this)}}return{F:c,d:[{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"haptic",value:()=>!1},{kind:"method",key:"firstUpdated",value:function(){(0,d.Z)(c,"firstUpdated",this,3)([]),this.addEventListener("change",(()=>{this.haptic&&(0,r.j)("light")}))}},{kind:"field",static:!0,key:"styles",value:()=>[a.W,l.iv`:host{--mdc-theme-secondary:var(--switch-checked-color)}.mdc-switch.mdc-switch--checked .mdc-switch__thumb{background-color:var(--switch-checked-button-color);border-color:var(--switch-checked-button-color)}.mdc-switch.mdc-switch--checked .mdc-switch__track{background-color:var(--switch-checked-track-color);border-color:var(--switch-checked-track-color)}.mdc-switch:not(.mdc-switch--checked) .mdc-switch__thumb{background-color:var(--switch-unchecked-button-color);border-color:var(--switch-unchecked-button-color)}.mdc-switch:not(.mdc-switch--checked) .mdc-switch__track{background-color:var(--switch-unchecked-track-color);border-color:var(--switch-unchecked-track-color)}`]}]}}),o.H)},13560:function(e,t,c){c.d(t,{j:()=>d});var i=c(36522);const d=e=>{(0,i.B)(window,"haptic",e)}}};
//# sourceMappingURL=29579.39cad172d209dbd5.js.map