UNPKG

iobroker.lovelace

Version:

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

4 lines 13.3 kB
/*! For license information please see 49577.a0f73409c18a8a6f.js.LICENSE.txt */ "use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["49577"],{88618:function(e,t,i){i.d(t,{Wg:()=>d,qN:()=>a.q});i(71695),i(47021);var n,o,r=i(9065),l=i(50778),a=i(11911);const s=null!==(o=null===(n=window.ShadyDOM)||void 0===n?void 0:n.inUse)&&void 0!==o&&o;class d extends a.H{constructor(){super(...arguments),this.disabled=!1,this.containingForm=null,this.formDataListener=e=>{this.disabled||this.setFormData(e.formData)}}findFormElement(){if(!this.shadowRoot||s)return null;const e=this.getRootNode().querySelectorAll("form");for(const t of Array.from(e))if(t.contains(this))return t;return null}connectedCallback(){var e;super.connectedCallback(),this.containingForm=this.findFormElement(),null===(e=this.containingForm)||void 0===e||e.addEventListener("formdata",this.formDataListener)}disconnectedCallback(){var e;super.disconnectedCallback(),null===(e=this.containingForm)||void 0===e||e.removeEventListener("formdata",this.formDataListener),this.containingForm=null}click(){this.formElement&&!this.disabled&&(this.formElement.focus(),this.formElement.click())}firstUpdated(){super.firstUpdated(),this.shadowRoot&&this.mdcRoot.addEventListener("change",(e=>{this.dispatchEvent(new Event("change",e))}))}}d.shadowRootOptions={mode:"open",delegatesFocus:!0},(0,r.__decorate)([(0,l.Cb)({type:Boolean})],d.prototype,"disabled",void 0)},4918:function(e,t,i){i.d(t,{a:()=>g});i(71695),i(40251),i(47021);var n=i(9065),o=i(80573),r={ROOT:"mdc-form-field"},l={LABEL_SELECTOR:".mdc-form-field > label"};const a=function(e){function t(i){var o=e.call(this,(0,n.__assign)((0,n.__assign)({},t.defaultAdapter),i))||this;return o.click=function(){o.handleClick()},o}return(0,n.__extends)(t,e),Object.defineProperty(t,"cssClasses",{get:function(){return r},enumerable:!1,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return l},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{activateInputRipple:function(){},deactivateInputRipple:function(){},deregisterInteractionHandler:function(){},registerInteractionHandler:function(){}}},enumerable:!1,configurable:!0}),t.prototype.init=function(){this.adapter.registerInteractionHandler("click",this.click)},t.prototype.destroy=function(){this.adapter.deregisterInteractionHandler("click",this.click)},t.prototype.handleClick=function(){var e=this;this.adapter.activateInputRipple(),requestAnimationFrame((function(){e.adapter.deactivateInputRipple()}))},t}(o.K);var s=i(11911),d=i(88618),c=i(78611),h=i(57243),f=i(50778),m=i(35359);let p,u=e=>e;class g extends s.H{constructor(){super(...arguments),this.alignEnd=!1,this.spaceBetween=!1,this.nowrap=!1,this.label="",this.mdcFoundationClass=a}createAdapter(){return{registerInteractionHandler:(e,t)=>{this.labelEl.addEventListener(e,t)},deregisterInteractionHandler:(e,t)=>{this.labelEl.removeEventListener(e,t)},activateInputRipple:async()=>{const e=this.input;if(e instanceof d.Wg){const t=await e.ripple;t&&t.startPress()}},deactivateInputRipple:async()=>{const e=this.input;if(e instanceof d.Wg){const t=await e.ripple;t&&t.endPress()}}}}get input(){var e,t;return null!==(t=null===(e=this.slottedInputs)||void 0===e?void 0:e[0])&&void 0!==t?t:null}render(){const e={"mdc-form-field--align-end":this.alignEnd,"mdc-form-field--space-between":this.spaceBetween,"mdc-form-field--nowrap":this.nowrap};return(0,h.dy)(p||(p=u` <div class="mdc-form-field ${0}"> <slot></slot> <label class="mdc-label" @click="${0}">${0}</label> </div>`),(0,m.$)(e),this._labelClick,this.label)}click(){this._labelClick()}_labelClick(){const e=this.input;e&&(e.focus(),e.click())}}(0,n.__decorate)([(0,f.Cb)({type:Boolean})],g.prototype,"alignEnd",void 0),(0,n.__decorate)([(0,f.Cb)({type:Boolean})],g.prototype,"spaceBetween",void 0),(0,n.__decorate)([(0,f.Cb)({type:Boolean})],g.prototype,"nowrap",void 0),(0,n.__decorate)([(0,f.Cb)({type:String}),(0,c.P)((async function(e){var t;null===(t=this.input)||void 0===t||t.setAttribute("aria-label",e)}))],g.prototype,"label",void 0),(0,n.__decorate)([(0,f.IO)(".mdc-form-field")],g.prototype,"mdcRoot",void 0),(0,n.__decorate)([(0,f.vZ)("",!0,"*")],g.prototype,"slottedInputs",void 0),(0,n.__decorate)([(0,f.IO)("label")],g.prototype,"labelEl",void 0)},6394:function(e,t,i){i.d(t,{W:()=>o});let n;const o=(0,i(57243).iv)(n||(n=(e=>e)`.mdc-form-field{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-body2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.875rem;font-size:var(--mdc-typography-body2-font-size, .875rem);line-height:1.25rem;line-height:var(--mdc-typography-body2-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-body2-font-weight,400);letter-spacing:.0178571429em;letter-spacing:var(--mdc-typography-body2-letter-spacing, .0178571429em);text-decoration:inherit;text-decoration:var(--mdc-typography-body2-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-body2-text-transform,inherit);color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87));display:inline-flex;align-items:center;vertical-align:middle}.mdc-form-field>label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0;order:0}.mdc-form-field>label[dir=rtl],[dir=rtl] .mdc-form-field>label{margin-left:auto;margin-right:0}.mdc-form-field>label[dir=rtl],[dir=rtl] .mdc-form-field>label{padding-left:0;padding-right:4px}.mdc-form-field--nowrap>label{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.mdc-form-field--align-end>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px;order:-1}.mdc-form-field--align-end>label[dir=rtl],[dir=rtl] .mdc-form-field--align-end>label{margin-left:0;margin-right:auto}.mdc-form-field--align-end>label[dir=rtl],[dir=rtl] .mdc-form-field--align-end>label{padding-left:4px;padding-right:0}.mdc-form-field--space-between{justify-content:space-between}.mdc-form-field--space-between>label{margin:0}.mdc-form-field--space-between>label[dir=rtl],[dir=rtl] .mdc-form-field--space-between>label{margin:0}:host{display:inline-flex}.mdc-form-field{width:100%}::slotted(*){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-body2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.875rem;font-size:var(--mdc-typography-body2-font-size, .875rem);line-height:1.25rem;line-height:var(--mdc-typography-body2-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-body2-font-weight,400);letter-spacing:.0178571429em;letter-spacing:var(--mdc-typography-body2-letter-spacing, .0178571429em);text-decoration:inherit;text-decoration:var(--mdc-typography-body2-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-body2-text-transform,inherit);color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87))}::slotted(mwc-switch){margin-right:10px}::slotted(mwc-switch[dir=rtl]),[dir=rtl] ::slotted(mwc-switch){margin-left:10px}`))},99152:function(e,t,i){i.d(t,{V:()=>r});i(63721),i(71695),i(61893),i(92519),i(42179),i(89256),i(24931),i(88463),i(57449),i(19814),i(47021);const n=Symbol("selection controller");class o{constructor(){this.selected=null,this.ordered=null,this.set=new Set}}class r{constructor(e){this.sets={},this.focusedSet=null,this.mouseIsDown=!1,this.updating=!1,e.addEventListener("keydown",(e=>{this.keyDownHandler(e)})),e.addEventListener("mousedown",(()=>{this.mousedownHandler()})),e.addEventListener("mouseup",(()=>{this.mouseupHandler()}))}static getController(e){const t=!("global"in e)||"global"in e&&e.global?document:e.getRootNode();let i=t[n];return void 0===i&&(i=new r(t),t[n]=i),i}keyDownHandler(e){const t=e.target;"checked"in t&&this.has(t)&&("ArrowRight"==e.key||"ArrowDown"==e.key?this.selectNext(t):"ArrowLeft"!=e.key&&"ArrowUp"!=e.key||this.selectPrevious(t))}mousedownHandler(){this.mouseIsDown=!0}mouseupHandler(){this.mouseIsDown=!1}has(e){return this.getSet(e.name).set.has(e)}selectPrevious(e){const t=this.getOrdered(e),i=t.indexOf(e),n=t[i-1]||t[t.length-1];return this.select(n),n}selectNext(e){const t=this.getOrdered(e),i=t.indexOf(e),n=t[i+1]||t[0];return this.select(n),n}select(e){e.click()}focus(e){if(this.mouseIsDown)return;const t=this.getSet(e.name),i=this.focusedSet;this.focusedSet=t,i!=t&&t.selected&&t.selected!=e&&t.selected.focus()}isAnySelected(e){const t=this.getSet(e.name);for(const i of t.set)if(i.checked)return!0;return!1}getOrdered(e){const t=this.getSet(e.name);return t.ordered||(t.ordered=Array.from(t.set),t.ordered.sort(((e,t)=>e.compareDocumentPosition(t)==Node.DOCUMENT_POSITION_PRECEDING?1:0))),t.ordered}getSet(e){return this.sets[e]||(this.sets[e]=new o),this.sets[e]}register(e){const t=e.name||e.getAttribute("name")||"",i=this.getSet(t);i.set.add(e),i.ordered=null}unregister(e){const t=this.getSet(e.name);t.set.delete(e),t.ordered=null,t.selected==e&&(t.selected=null)}update(e){if(this.updating)return;this.updating=!0;const t=this.getSet(e.name);if(e.checked){for(const i of t.set)i!=e&&(i.checked=!1);t.selected=e}if(this.isAnySelected(e))for(const i of t.set){if(void 0===i.formElementTabIndex)break;i.formElementTabIndex=i.checked?0:-1}this.updating=!1}}},27323:function(e,t,i){i.d(t,{O:()=>p});i(71695),i(47021);var n=i(9065),o=i(1105),r=i(57243),l=i(50778),a=i(35359),s=i(20552),d=i(91928);let c,h,f=e=>e;const m={fromAttribute(e){return null!==e&&(""===e||e)},toAttribute(e){return"boolean"==typeof e?e?"":null:e}};class p extends o.P{constructor(){super(...arguments),this.rows=2,this.cols=20,this.charCounter=!1}render(){const e=this.charCounter&&-1!==this.maxLength,t=e&&"internal"===this.charCounter,i=e&&!t,n=!!this.helper||!!this.validationMessage||i,o={"mdc-text-field--disabled":this.disabled,"mdc-text-field--no-label":!this.label,"mdc-text-field--filled":!this.outlined,"mdc-text-field--outlined":this.outlined,"mdc-text-field--end-aligned":this.endAligned,"mdc-text-field--with-internal-counter":t};return(0,r.dy)(c||(c=f` <label class="mdc-text-field mdc-text-field--textarea ${0}"> ${0} ${0} ${0} ${0} ${0} </label> ${0} `),(0,a.$)(o),this.renderRipple(),this.outlined?this.renderOutline():this.renderLabel(),this.renderInput(),this.renderCharCounter(t),this.renderLineRipple(),this.renderHelperText(n,i))}renderInput(){const e=this.label?"label":void 0,t=-1===this.minLength?void 0:this.minLength,i=-1===this.maxLength?void 0:this.maxLength,n=this.autocapitalize?this.autocapitalize:void 0;return(0,r.dy)(h||(h=f` <textarea aria-labelledby="${0}" class="mdc-text-field__input" .value="${0}" rows="${0}" cols="${0}" ?disabled="${0}" placeholder="${0}" ?required="${0}" ?readonly="${0}" minlength="${0}" maxlength="${0}" name="${0}" inputmode="${0}" autocapitalize="${0}" @input="${0}" @blur="${0}"> </textarea>`),(0,s.o)(e),(0,d.a)(this.value),this.rows,this.cols,this.disabled,this.placeholder,this.required,this.readOnly,(0,s.o)(t),(0,s.o)(i),(0,s.o)(""===this.name?void 0:this.name),(0,s.o)(this.inputMode),(0,s.o)(n),this.handleInputChange,this.onInputBlur)}}(0,n.__decorate)([(0,l.IO)("textarea")],p.prototype,"formElement",void 0),(0,n.__decorate)([(0,l.Cb)({type:Number})],p.prototype,"rows",void 0),(0,n.__decorate)([(0,l.Cb)({type:Number})],p.prototype,"cols",void 0),(0,n.__decorate)([(0,l.Cb)({converter:m})],p.prototype,"charCounter",void 0)},88540:function(e,t,i){i.d(t,{W:()=>o});let n;const o=(0,i(57243).iv)(n||(n=(e=>e)`.mdc-text-field{height:100%}.mdc-text-field__input{resize:none}`))},96526:function(e,t,i){var n=i(1569),o=i(29660),r=i(72878),l=i(72616),a=i(36888).trim,s=i(91430),d=r("".charAt),c=n.parseFloat,h=n.Symbol,f=h&&h.iterator,m=1/c(s+"-0")!=-1/0||f&&!o((function(){c(Object(f))}));e.exports=m?function(e){var t=a(l(e)),i=c(t);return 0===i&&"-"===d(t,0)?-0:i}:c},95078:function(e,t,i){var n=i(40810),o=i(96526);n({global:!0,forced:parseFloat!==o},{parseFloat:o})},53232:function(e,t,i){i.d(t,{E_:()=>g,OR:()=>s,_Y:()=>c,dZ:()=>a,fk:()=>h,hN:()=>l,hl:()=>m,i9:()=>p,pt:()=>r,ws:()=>u});var n=i(2841);const{I:o}=n.Al,r=e=>null===e||"object"!=typeof e&&"function"!=typeof e,l=(e,t)=>void 0===t?void 0!==(null==e?void 0:e._$litType$):(null==e?void 0:e._$litType$)===t,a=e=>{var t;return null!=(null===(t=null==e?void 0:e._$litType$)||void 0===t?void 0:t.h)},s=e=>void 0===e.strings,d=()=>document.createComment(""),c=(e,t,i)=>{var n;const r=e._$AA.parentNode,l=void 0===t?e._$AB:t._$AA;if(void 0===i){const t=r.insertBefore(d(),l),n=r.insertBefore(d(),l);i=new o(t,n,e,e.options)}else{const t=i._$AB.nextSibling,o=i._$AM,a=o!==e;if(a){let t;null===(n=i._$AQ)||void 0===n||n.call(i,e),i._$AM=e,void 0!==i._$AP&&(t=e._$AU)!==o._$AU&&i._$AP(t)}if(t!==l||a){let e=i._$AA;for(;e!==t;){const t=e.nextSibling;r.insertBefore(e,l),e=t}}}return i},h=(e,t,i=e)=>(e._$AI(t,i),e),f={},m=(e,t=f)=>e._$AH=t,p=e=>e._$AH,u=e=>{var t;null===(t=e._$AP)||void 0===t||t.call(e,!1,!0);let i=e._$AA;const n=e._$AB.nextSibling;for(;i!==n;){const e=i.nextSibling;i.remove(),i=e}},g=e=>{e._$AR()}}}]); //# sourceMappingURL=49577.a0f73409c18a8a6f.js.map