iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
3 lines • 13.3 kB
JavaScript
/*! For license information please see chunk.94b8639390bad6bafac5.js.LICENSE.txt */
(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[5],{51654:function(t,e,n){"use strict";n.d(e,{Z:function(){return r},n:function(){return l}});n(65233);var o=n(75009),i=n(87156),r={hostAttributes:{role:"dialog",tabindex:"-1"},properties:{modal:{type:Boolean,value:!1},__readied:{type:Boolean,value:!1}},observers:["_modalChanged(modal, __readied)"],listeners:{tap:"_onDialogClick"},ready:function(){this.__prevNoCancelOnOutsideClick=this.noCancelOnOutsideClick,this.__prevNoCancelOnEscKey=this.noCancelOnEscKey,this.__prevWithBackdrop=this.withBackdrop,this.__readied=!0},_modalChanged:function(t,e){e&&(t?(this.__prevNoCancelOnOutsideClick=this.noCancelOnOutsideClick,this.__prevNoCancelOnEscKey=this.noCancelOnEscKey,this.__prevWithBackdrop=this.withBackdrop,this.noCancelOnOutsideClick=!0,this.noCancelOnEscKey=!0,this.withBackdrop=!0):(this.noCancelOnOutsideClick=this.noCancelOnOutsideClick&&this.__prevNoCancelOnOutsideClick,this.noCancelOnEscKey=this.noCancelOnEscKey&&this.__prevNoCancelOnEscKey,this.withBackdrop=this.withBackdrop&&this.__prevWithBackdrop))},_updateClosingReasonConfirmed:function(t){this.closingReason=this.closingReason||{},this.closingReason.confirmed=t},_onDialogClick:function(t){for(var e=(0,i.vz)(t).path,n=0,o=e.indexOf(this);n<o;n++){var r=e[n];if(r.hasAttribute&&(r.hasAttribute("dialog-dismiss")||r.hasAttribute("dialog-confirm"))){this._updateClosingReasonConfirmed(r.hasAttribute("dialog-confirm")),this.close(),t.stopPropagation();break}}}},l=[o.$,r]},22626:function(t,e,n){"use strict";n(65233),n(65660),n(1656);var o,i,r,l=n(51654),a=n(9672),s=n(50856);(0,a.k)({_template:(0,s.d)(o||(i=['\n <style>\n\n :host {\n display: block;\n @apply --layout-relative;\n }\n\n :host(.is-scrolled:not(:first-child))::before {\n content: \'\';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n height: 1px;\n background: var(--divider-color);\n }\n\n :host(.can-scroll:not(.scrolled-to-bottom):not(:last-child))::after {\n content: \'\';\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n height: 1px;\n background: var(--divider-color);\n }\n\n .scrollable {\n padding: 0 24px;\n\n @apply --layout-scroll;\n @apply --paper-dialog-scrollable;\n }\n\n .fit {\n @apply --layout-fit;\n }\n </style>\n\n <div id="scrollable" class="scrollable" on-scroll="updateScrollState">\n <slot></slot>\n </div>\n'],r||(r=i.slice(0)),o=Object.freeze(Object.defineProperties(i,{raw:{value:Object.freeze(r)}})))),is:"paper-dialog-scrollable",properties:{dialogElement:{type:Object}},get scrollTarget(){return this.$.scrollable},ready:function(){this._ensureTarget(),this.classList.add("no-padding")},attached:function(){this._ensureTarget(),requestAnimationFrame(this.updateScrollState.bind(this))},updateScrollState:function(){this.toggleClass("is-scrolled",this.scrollTarget.scrollTop>0),this.toggleClass("can-scroll",this.scrollTarget.offsetHeight<this.scrollTarget.scrollHeight),this.toggleClass("scrolled-to-bottom",this.scrollTarget.scrollTop+this.scrollTarget.offsetHeight>=this.scrollTarget.scrollHeight)},_ensureTarget:function(){this.dialogElement=this.dialogElement||this.parentElement,this.dialogElement&&this.dialogElement.behaviors&&this.dialogElement.behaviors.indexOf(l.Z)>=0?(this.dialogElement.sizingTarget=this.scrollTarget,this.scrollTarget.classList.remove("fit")):this.dialogElement&&this.scrollTarget.classList.add("fit")}})},50808:function(t,e,n){"use strict";n(65233),n(65660),n(1656),n(47686),n(54242);var o=document.createElement("template");o.setAttribute("style","display: none;"),o.innerHTML='<dom-module id="paper-dialog-shared-styles">\n <template>\n <style>\n :host {\n display: block;\n margin: 24px 40px;\n\n background: var(--paper-dialog-background-color, var(--primary-background-color));\n color: var(--paper-dialog-color, var(--primary-text-color));\n\n @apply --paper-font-body1;\n @apply --shadow-elevation-16dp;\n @apply --paper-dialog;\n }\n\n :host > ::slotted(*) {\n margin-top: 20px;\n padding: 0 24px;\n }\n\n :host > ::slotted(.no-padding) {\n padding: 0;\n }\n\n \n :host > ::slotted(*:first-child) {\n margin-top: 24px;\n }\n\n :host > ::slotted(*:last-child) {\n margin-bottom: 24px;\n }\n\n /* In 1.x, this selector was `:host > ::content h2`. In 2.x <slot> allows\n to select direct children only, which increases the weight of this\n selector, so we have to re-define first-child/last-child margins below. */\n :host > ::slotted(h2) {\n position: relative;\n margin: 0;\n\n @apply --paper-font-title;\n @apply --paper-dialog-title;\n }\n\n /* Apply mixin again, in case it sets margin-top. */\n :host > ::slotted(h2:first-child) {\n margin-top: 24px;\n @apply --paper-dialog-title;\n }\n\n /* Apply mixin again, in case it sets margin-bottom. */\n :host > ::slotted(h2:last-child) {\n margin-bottom: 24px;\n @apply --paper-dialog-title;\n }\n\n :host > ::slotted(.paper-dialog-buttons),\n :host > ::slotted(.buttons) {\n position: relative;\n padding: 8px 8px 8px 24px;\n margin: 0;\n\n color: var(--paper-dialog-button-color, var(--primary-color));\n\n @apply --layout-horizontal;\n @apply --layout-end-justified;\n }\n </style>\n </template>\n</dom-module>',document.head.appendChild(o.content);var i,r,l,a=n(96540),s=n(51654),c=n(9672),p=n(50856);(0,c.k)({_template:(0,p.d)(i||(r=['\n <style include="paper-dialog-shared-styles"></style>\n <slot></slot>\n'],l||(l=r.slice(0)),i=Object.freeze(Object.defineProperties(r,{raw:{value:Object.freeze(l)}})))),is:"paper-dialog",behaviors:[s.n,a.t],listeners:{"neon-animation-finish":"_onNeonAnimationFinish"},_renderOpened:function(){this.cancelAnimation(),this.playAnimation("entry")},_renderClosed:function(){this.cancelAnimation(),this.playAnimation("exit")},_onNeonAnimationFinish:function(){this.opened?this._finishRenderOpened():this._finishRenderClosed()}})},28417:function(t,e,n){"use strict";n(50808);var o=n(33367),i=n(93592),r=n(87156),l={getTabbableNodes:function(t){var e=[];return this._collectTabbableNodes(t,e)?i.H._sortByTabIndex(e):e},_collectTabbableNodes:function(t,e){if(t.nodeType!==Node.ELEMENT_NODE||!i.H._isVisible(t))return!1;var n,o=t,l=i.H._normalizedTabIndex(o),a=l>0;l>=0&&e.push(o),n="content"===o.localName||"slot"===o.localName?(0,r.vz)(o).getDistributedNodes():(0,r.vz)(o.shadowRoot||o.root||o).children;for(var s=0;s<n.length;s++)a=this._collectTabbableNodes(n[s],e)||a;return a}};function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){return(c=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function p(t){var e=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(t){return!1}}();return function(){var n,o=d(t);if(e){var i=d(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return u(this,n)}}function u(t,e){return!e||"object"!==a(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function d(t){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var h=customElements.get("paper-dialog"),f={get _focusableNodes(){return l.getTabbableNodes(this)}},g=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&c(t,e)}(n,t);var e=p(n);function n(){return s(this,n),e.apply(this,arguments)}return n}((0,o.P)([f],h));customElements.define("ha-paper-dialog",g)},20005:function(t,e,n){"use strict";n.r(e);n(22626);var o,i=n(50856),r=n(28426),l=(n(28417),n(11052));n(36436);function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t,e,n,o,i,r,l){try{var a=t[r](l),s=a.value}catch(c){return void n(c)}a.done?e(s):Promise.resolve(s).then(o,i)}function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function p(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function u(t,e,n){return(u="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var o=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=g(t)););return t}(t,e);if(o){var i=Object.getOwnPropertyDescriptor(o,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function d(t,e){return(d=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function h(t){var e=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(t){return!1}}();return function(){var n,o=g(t);if(e){var i=g(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return f(this,n)}}function f(t,e){return!e||"object"!==a(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function g(t){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var y=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&d(t,e)}(y,t);var e,n,r,l,a,f=h(y);function y(){return c(this,y),f.apply(this,arguments)}return e=y,n=[{key:"ready",value:function(){var t=this;u(g(y.prototype),"ready",this).call(this),this.addEventListener("iron-overlay-closed",(function(e){return t._dialogClosed(e)}))}},{key:"showDialog",value:function(t){var e=this,n=t._ozwLog,o=t.hass,i=t._tail,r=t._numLogLines,l=t.dialogClosedCallback;this.hass=o,this._ozwLog=n,this._opened=!0,this._dialogClosedCallback=l,this._numLogLines=r,setTimeout((function(){return e.$.pwaDialog.center()}),0),i&&this.setProperties({_intervalId:setInterval((function(){e._refreshLog()}),1500)})}},{key:"_refreshLog",value:(l=regeneratorRuntime.mark((function t(){var e;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.hass.callApi("GET","zwave/ozwlog?lines="+this._numLogLines);case 2:e=t.sent,this.setProperties({_ozwLog:e});case 4:case"end":return t.stop()}}),t,this)})),a=function(){var t=this,e=arguments;return new Promise((function(n,o){var i=l.apply(t,e);function r(t){s(i,n,o,r,a,"next",t)}function a(t){s(i,n,o,r,a,"throw",t)}r(void 0)}))},function(){return a.apply(this,arguments)})},{key:"_dialogClosed",value:function(t){"ZWAVE-LOG-DIALOG"===t.target.nodeName&&(clearInterval(this._intervalId),this._opened=!1,this._dialogClosedCallback({closedEvent:!0}),this._dialogClosedCallback=null)}}],r=[{key:"template",get:function(){return(0,i.d)(o||(t=['\n <style include="ha-style-dialog">\n pre {\n font-family: var(--code-font-family, monospace);\n }\n </style>\n <ha-paper-dialog id="pwaDialog" with-backdrop="" opened="{{_opened}}">\n <h2>OpenZwave internal logfile</h2>\n <paper-dialog-scrollable>\n <pre>[[_ozwLog]]</pre>\n <paper-dialog-scrollable>\n </ha-paper-dialog>\n '],e||(e=t.slice(0)),o=Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))));var t,e}},{key:"properties",get:function(){return{hass:Object,_ozwLog:String,_dialogClosedCallback:Function,_opened:{type:Boolean,value:!1},_intervalId:String,_numLogLines:{type:Number}}}}],n&&p(e.prototype,n),r&&p(e,r),y}((0,l.I)(r.H3));customElements.define("zwave-log-dialog",y)},36436:function(t,e,n){"use strict";n(21384);var o=n(11654),i=document.createElement("template");i.setAttribute("style","display: none;"),i.innerHTML='<dom-module id="ha-style-dialog">\n<template>\n <style>\n '.concat(o.yu.cssText,"\n </style>\n</template>\n</dom-module>"),document.head.appendChild(i.content)}}]);
//# sourceMappingURL=chunk.94b8639390bad6bafac5.js.map