iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
3 lines • 20.6 kB
JavaScript
/*! For license information please see chunk.3de8cb6e7d51de436611.js.LICENSE.txt */
(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[9266],{89266:function(e,r,t){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}t.d(r,{Y:function(){return V}});function n(e,r,t,n){var i,c=arguments.length,a=c<3?r:null===n?n=Object.getOwnPropertyDescriptor(r,t):n;if("object"===("undefined"==typeof Reflect?"undefined":o(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,r,t,n);else for(var d=e.length-1;d>=0;d--)(i=e[d])&&(a=(c<3?i(a):c>3?i(r,t,a):i(r,t))||a);return c>3&&a&&Object.defineProperty(r,t,a),a}Object.create;Object.create;var i=t(55704),c=t(38103),a=t(18601),d=t(14114);function l(e,r){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,r){if(!e)return;if("string"==typeof e)return u(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return u(e,r)}(e))||r&&e&&"number"==typeof e.length){t&&(e=t);var o=0,n=function(){};return{s:n,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return c=e.done,e},e:function(e){a=!0,i=e},f:function(){try{c||null==t.return||t.return()}finally{if(a)throw i}}}}function u(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,o=new Array(r);t<r;t++)o[t]=e[t];return o}function s(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function f(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}var m,b,p=Symbol("selection controller"),h=function e(){f(this,e),this.selected=null,this.ordered=null,this.set=new Set},_=function(){function e(r){var t=this;f(this,e),this.sets={},this.focusedSet=null,this.mouseIsDown=!1,this.updating=!1,r.addEventListener("keydown",(function(e){t.keyDownHandler(e)})),r.addEventListener("mousedown",(function(){t.mousedownHandler()})),r.addEventListener("mouseup",(function(){t.mouseupHandler()}))}var r,t,o;return r=e,o=[{key:"getController",value:function(r){var t=!("global"in r)||"global"in r&&r.global?document:r.getRootNode(),o=t[p];return void 0===o&&(o=new e(t),t[p]=o),o}}],(t=[{key:"keyDownHandler",value:function(e){var r=e.target;"checked"in r&&this.has(r)&&("ArrowRight"==e.key||"ArrowDown"==e.key?this.selectNext(r):"ArrowLeft"!=e.key&&"ArrowUp"!=e.key||this.selectPrevious(r))}},{key:"mousedownHandler",value:function(){this.mouseIsDown=!0}},{key:"mouseupHandler",value:function(){this.mouseIsDown=!1}},{key:"has",value:function(e){return this.getSet(e.name).set.has(e)}},{key:"selectPrevious",value:function(e){var r=this.getOrdered(e),t=r.indexOf(e),o=r[t-1]||r[r.length-1];return this.select(o),o}},{key:"selectNext",value:function(e){var r=this.getOrdered(e),t=r.indexOf(e),o=r[t+1]||r[0];return this.select(o),o}},{key:"select",value:function(e){e.click()}},{key:"focus",value:function(e){if(!this.mouseIsDown){var r=this.getSet(e.name),t=this.focusedSet;this.focusedSet=r,t!=r&&r.selected&&r.selected!=e&&r.selected.focus()}}},{key:"isAnySelected",value:function(e){var r,t=l(this.getSet(e.name).set);try{for(t.s();!(r=t.n()).done;)if(r.value.checked)return!0}catch(o){t.e(o)}finally{t.f()}return!1}},{key:"getOrdered",value:function(e){var r=this.getSet(e.name);return r.ordered||(r.ordered=Array.from(r.set),r.ordered.sort((function(e,r){return e.compareDocumentPosition(r)==Node.DOCUMENT_POSITION_PRECEDING?1:0}))),r.ordered}},{key:"getSet",value:function(e){return this.sets[e]||(this.sets[e]=new h),this.sets[e]}},{key:"register",value:function(e){var r=e.name||e.getAttribute("name")||"",t=this.getSet(r);t.set.add(e),t.ordered=null}},{key:"unregister",value:function(e){var r=this.getSet(e.name);r.set.delete(e),r.ordered=null,r.selected==e&&(r.selected=null)}},{key:"update",value:function(e){if(!this.updating){this.updating=!0;var r=this.getSet(e.name);if(e.checked){var t,o=l(r.set);try{for(o.s();!(t=o.n()).done;){var n=t.value;n!=e&&(n.checked=!1)}}catch(d){o.e(d)}finally{o.f()}r.selected=e}if(this.isAnySelected(e)){var i,c=l(r.set);try{for(c.s();!(i=c.n()).done;){var a=i.value;if(void 0===a.formElementTabIndex)break;a.formElementTabIndex=a.checked?0:-1}}catch(d){c.e(d)}finally{c.f()}}this.updating=!1}}}])&&s(r.prototype,t),o&&s(r,o),e}(),v=t(98734),y=t(87480),g=t(72774),k={NATIVE_CONTROL_SELECTOR:".mdc-radio__native-control"},w={DISABLED:"mdc-radio--disabled",ROOT:"mdc-radio"},O=function(e){function r(t){return e.call(this,(0,y.__assign)((0,y.__assign)({},r.defaultAdapter),t))||this}return(0,y.__extends)(r,e),Object.defineProperty(r,"cssClasses",{get:function(){return w},enumerable:!1,configurable:!0}),Object.defineProperty(r,"strings",{get:function(){return k},enumerable:!1,configurable:!0}),Object.defineProperty(r,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},setNativeControlDisabled:function(){}}},enumerable:!1,configurable:!0}),r.prototype.setDisabled=function(e){var t=r.cssClasses.DISABLED;this.adapter.setNativeControlDisabled(e),e?this.adapter.addClass(t):this.adapter.removeClass(t)},r}(g.K),x=t(81471),R=t(49629);function S(e){return(S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function C(e,r){return r||(r=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(r)}}))}function E(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function j(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function P(e,r,t){return(P="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,r,t){var o=function(e,r){for(;!Object.prototype.hasOwnProperty.call(e,r)&&null!==(e=A(e)););return e}(e,r);if(o){var n=Object.getOwnPropertyDescriptor(o,r);return n.get?n.get.call(t):n.value}})(e,r,t||e)}function T(e,r){return(T=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e})(e,r)}function D(e){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var t,o=A(e);if(r){var n=A(this).constructor;t=Reflect.construct(o,arguments,n)}else t=o.apply(this,arguments);return z(this,t)}}function z(e,r){return!r||"object"!==S(r)&&"function"!=typeof r?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):r}function A(e){return(A=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var I,H=function(e){!function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&T(e,r)}(c,e);var r,t,o,n=D(c);function c(){var e;return E(this,c),(e=n.apply(this,arguments))._checked=!1,e.global=!1,e.disabled=!1,e.value="",e.name="",e.reducedTouchTarget=!1,e.mdcFoundationClass=O,e.formElementTabIndex=0,e.shouldRenderRipple=!1,e.rippleElement=null,e.rippleHandlers=new v.A((function(){return e.shouldRenderRipple=!0,e.ripple.then((function(r){e.rippleElement=r})),e.ripple})),e}return r=c,(t=[{key:"checked",get:function(){return this._checked},set:function(e){var r,t,o=this._checked;e!==o&&(this._checked=e,this.formElement&&(this.formElement.checked=e),null===(r=this._selectionController)||void 0===r||r.update(this),!1===e&&(null===(t=this.formElement)||void 0===t||t.blur()),this.requestUpdate("checked",o),this.dispatchEvent(new Event("checked",{bubbles:!0,composed:!0})))}},{key:"_handleUpdatedValue",value:function(e){this.formElement.value=e}},{key:"renderRipple",value:function(){return this.shouldRenderRipple?(0,i.dy)(m||(m=C(['<mwc-ripple unbounded accent .disabled="','"></mwc-ripple>'])),this.disabled):""}},{key:"isRippleActive",get:function(){var e;return(null===(e=this.rippleElement)||void 0===e?void 0:e.isActive)||!1}},{key:"connectedCallback",value:function(){P(A(c.prototype),"connectedCallback",this).call(this),this._selectionController=_.getController(this),this._selectionController.register(this),this._selectionController.update(this)}},{key:"disconnectedCallback",value:function(){this._selectionController.unregister(this),this._selectionController=void 0}},{key:"focus",value:function(){this.formElement.focus()}},{key:"createAdapter",value:function(){var e=this;return Object.assign(Object.assign({},(0,a.qN)(this.mdcRoot)),{setNativeControlDisabled:function(r){e.formElement.disabled=r}})}},{key:"handleFocus",value:function(){this.handleRippleFocus()}},{key:"handleClick",value:function(){this.formElement.focus()}},{key:"handleBlur",value:function(){this.formElement.blur(),this.rippleHandlers.endFocus()}},{key:"render",value:function(){var e={"mdc-radio--touch":!this.reducedTouchTarget,"mdc-radio--disabled":this.disabled};return(0,i.dy)(b||(b=C(['\n <div class="mdc-radio ','">\n <input\n tabindex="','"\n class="mdc-radio__native-control"\n type="radio"\n name="','"\n aria-label="','"\n aria-labelledby="','"\n .checked="','"\n .value="','"\n ?disabled="','"\n @change="','"\n @focus="','"\n @click="','"\n @blur="','"\n @mousedown="','"\n @mouseenter="','"\n @mouseleave="','"\n @touchstart="','"\n @touchend="','"\n @touchcancel="','">\n <div class="mdc-radio__background">\n <div class="mdc-radio__outer-circle"></div>\n <div class="mdc-radio__inner-circle"></div>\n </div>\n ',"\n </div>"])),(0,x.$)(e),this.formElementTabIndex,this.name,(0,R.o)(this.ariaLabel),(0,R.o)(this.ariaLabelledBy),this.checked,this.value,this.disabled,this.changeHandler,this.handleFocus,this.handleClick,this.handleBlur,this.handleRippleMouseDown,this.handleRippleMouseEnter,this.handleRippleMouseLeave,this.handleRippleTouchStart,this.handleRippleDeactivate,this.handleRippleDeactivate,this.renderRipple())}},{key:"handleRippleMouseDown",value:function(e){var r=this;window.addEventListener("mouseup",(function e(){window.removeEventListener("mouseup",e),r.handleRippleDeactivate()})),this.rippleHandlers.startPress(e)}},{key:"handleRippleTouchStart",value:function(e){this.rippleHandlers.startPress(e)}},{key:"handleRippleDeactivate",value:function(){this.rippleHandlers.endPress()}},{key:"handleRippleMouseEnter",value:function(){this.rippleHandlers.startHover()}},{key:"handleRippleMouseLeave",value:function(){this.rippleHandlers.endHover()}},{key:"handleRippleFocus",value:function(){this.rippleHandlers.startFocus()}},{key:"changeHandler",value:function(){this.checked=this.formElement.checked}}])&&j(r.prototype,t),o&&j(r,o),c}(a.Wg);n([(0,i.IO)(".mdc-radio")],H.prototype,"mdcRoot",void 0),n([(0,i.IO)("input")],H.prototype,"formElement",void 0),n([(0,i.Cb)({type:Boolean})],H.prototype,"global",void 0),n([(0,i.Cb)({type:Boolean,reflect:!0})],H.prototype,"checked",null),n([(0,i.Cb)({type:Boolean}),(0,d.P)((function(e){this.mdcFoundation.setDisabled(e)}))],H.prototype,"disabled",void 0),n([(0,i.Cb)({type:String}),(0,d.P)((function(e){this._handleUpdatedValue(e)}))],H.prototype,"value",void 0),n([(0,i.Cb)({type:String})],H.prototype,"name",void 0),n([(0,i.Cb)({type:Boolean})],H.prototype,"reducedTouchTarget",void 0),n([(0,i.Cb)({type:Number})],H.prototype,"formElementTabIndex",void 0),n([(0,i.SB)()],H.prototype,"shouldRenderRipple",void 0),n([(0,i.GC)("mwc-ripple")],H.prototype,"ripple",void 0),n([c.L,(0,i.Cb)({attribute:"aria-label"})],H.prototype,"ariaLabel",void 0),n([c.L,(0,i.Cb)({attribute:"aria-labelledby"})],H.prototype,"ariaLabelledBy",void 0),n([(0,i.hO)({passive:!0})],H.prototype,"handleRippleTouchStart",null);var L=(0,i.iv)(I||(I=function(e,r){return r||(r=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(r)}}))}(['.mdc-touch-target-wrapper{display:inline}.mdc-radio{padding:10px;display:inline-block;position:relative;flex:0 0 auto;box-sizing:content-box;width:20px;height:20px;cursor:pointer;will-change:opacity,transform,border-color,color}.mdc-radio .mdc-radio__native-control:enabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:rgba(0, 0, 0, 0.54)}.mdc-radio .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:#018786;border-color:var(--mdc-theme-secondary, #018786)}.mdc-radio .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:#018786;border-color:var(--mdc-theme-secondary, #018786)}.mdc-radio [aria-disabled=true] .mdc-radio__native-control:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle,.mdc-radio .mdc-radio__native-control:disabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:rgba(0, 0, 0, 0.38)}.mdc-radio [aria-disabled=true] .mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle,.mdc-radio .mdc-radio__native-control:disabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:rgba(0, 0, 0, 0.38)}.mdc-radio [aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background .mdc-radio__inner-circle,.mdc-radio .mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:rgba(0, 0, 0, 0.38)}.mdc-radio .mdc-radio__background::before{background-color:#018786;background-color:var(--mdc-theme-secondary, #018786)}.mdc-radio .mdc-radio__background::before{top:-10px;left:-10px;width:40px;height:40px}.mdc-radio .mdc-radio__native-control{top:0px;right:0px;left:0px;width:40px;height:40px}@media screen and (-ms-high-contrast: active){.mdc-radio [aria-disabled=true] .mdc-radio__native-control:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle,.mdc-radio .mdc-radio__native-control:disabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:GrayText}.mdc-radio [aria-disabled=true] .mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle,.mdc-radio .mdc-radio__native-control:disabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:GrayText}.mdc-radio [aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background .mdc-radio__inner-circle,.mdc-radio .mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:GrayText}}.mdc-radio__background{display:inline-block;position:relative;box-sizing:border-box;width:20px;height:20px}.mdc-radio__background::before{position:absolute;transform:scale(0, 0);border-radius:50%;opacity:0;pointer-events:none;content:"";transition:opacity 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1),transform 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-radio__outer-circle{position:absolute;top:0;left:0;box-sizing:border-box;width:100%;height:100%;border-width:2px;border-style:solid;border-radius:50%;transition:border-color 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-radio__inner-circle{position:absolute;top:0;left:0;box-sizing:border-box;width:100%;height:100%;transform:scale(0, 0);border-width:10px;border-style:solid;border-radius:50%;transition:transform 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1),border-color 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-radio__native-control{position:absolute;margin:0;padding:0;opacity:0;cursor:inherit;z-index:1}.mdc-radio--touch{margin-top:4px;margin-bottom:4px;margin-right:4px;margin-left:4px}.mdc-radio--touch .mdc-radio__native-control{top:-4px;right:-4px;left:-4px;width:48px;height:48px}.mdc-radio__native-control:checked+.mdc-radio__background,.mdc-radio__native-control:disabled+.mdc-radio__background{transition:opacity 120ms 0ms cubic-bezier(0, 0, 0.2, 1),transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle,.mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__outer-circle{transition:border-color 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__inner-circle,.mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle{transition:transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1),border-color 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio--disabled{cursor:default;pointer-events:none}.mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__inner-circle{transform:scale(0.5);transition:transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1),border-color 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio__native-control:disabled+.mdc-radio__background,[aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background{cursor:default}.mdc-radio__native-control:focus+.mdc-radio__background::before{transform:scale(1);opacity:.12;transition:opacity 120ms 0ms cubic-bezier(0, 0, 0.2, 1),transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}:host{display:inline-block;outline:none}.mdc-radio{vertical-align:bottom}.mdc-radio .mdc-radio__native-control:enabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-unchecked-color, rgba(0, 0, 0, 0.54))}.mdc-radio [aria-disabled=true] .mdc-radio__native-control:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle,.mdc-radio .mdc-radio__native-control:disabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-disabled-color, rgba(0, 0, 0, 0.38))}.mdc-radio [aria-disabled=true] .mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle,.mdc-radio .mdc-radio__native-control:disabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-disabled-color, rgba(0, 0, 0, 0.38))}.mdc-radio [aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background .mdc-radio__inner-circle,.mdc-radio .mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-disabled-color, rgba(0, 0, 0, 0.38))}'])));function B(e){return(B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function N(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function M(e,r){return(M=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e})(e,r)}function F(e){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var t,o=G(e);if(r){var n=G(this).constructor;t=Reflect.construct(o,arguments,n)}else t=o.apply(this,arguments);return U(this,t)}}function U(e,r){return!r||"object"!==B(r)&&"function"!=typeof r?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):r}function G(e){return(G=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var V=function(e){!function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&M(e,r)}(t,e);var r=F(t);function t(){return N(this,t),r.apply(this,arguments)}return t}(H);V.styles=L,V=n([(0,i.Mo)("mwc-radio")],V)}}]);
//# sourceMappingURL=chunk.3de8cb6e7d51de436611.js.map