Verified Commit d0790aab authored by Fabio Manganiello's avatar Fabio Manganiello
Browse files

Better style for toggle switches

parent bb28617c
Pipeline #180 passed with stages
in 8 minutes and 41 seconds
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>platypush</title><script defer="defer" type="module" src="/static/js/chunk-vendors.5adf1720.js"></script><script defer="defer" type="module" src="/static/js/app.a93abe27.js"></script><link href="/static/css/chunk-vendors.5cf89a0c.css" rel="stylesheet"><link href="/static/css/app.d92849a2.css" rel="stylesheet"><script defer="defer" src="/static/js/chunk-vendors-legacy.cc8c0644.js" nomodule></script><script defer="defer" src="/static/js/app-legacy.aa2fb82a.js" nomodule></script></head><body><noscript><strong>We're sorry but platypush doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
\ No newline at end of file
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>platypush</title><script defer="defer" type="module" src="/static/js/chunk-vendors.5adf1720.js"></script><script defer="defer" type="module" src="/static/js/app.f7ae2c87.js"></script><link href="/static/css/chunk-vendors.5cf89a0c.css" rel="stylesheet"><link href="/static/css/app.d92849a2.css" rel="stylesheet"><script defer="defer" src="/static/js/chunk-vendors-legacy.cc8c0644.js" nomodule></script><script defer="defer" src="/static/js/app-legacy.4cc2e832.js" nomodule></script></head><body><noscript><strong>We're sorry but platypush doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
\ No newline at end of file
"use strict";(self["webpackChunkplatypush"]=self["webpackChunkplatypush"]||[]).push([[2380],{3567:function(e,n,t){t.d(n,{Z:function(){return p}});var i=t(6252),o=t(3577),a=function(e){return(0,i.dD)("data-v-8fae7678"),e=e(),(0,i.Cn)(),e},r=["checked"],s=a((function(){return(0,i._)("div",{class:"switch"},[(0,i._)("div",{class:"dot"})],-1)})),u={class:"label"};function c(e,n,t,a,c,l){return(0,i.wg)(),(0,i.iD)("div",{class:(0,o.C_)(["power-switch",{disabled:t.disabled}]),onClick:n[0]||(n[0]=function(){return l.onInput&&l.onInput.apply(l,arguments)})},[(0,i._)("input",{type:"checkbox",checked:t.value},null,8,r),(0,i._)("label",null,[s,(0,i._)("span",u,[(0,i.WI)(e.$slots,"default",{},void 0,!0)])])],2)}var l={name:"ToggleSwitch",emits:["input"],props:{value:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},methods:{onInput:function(e){if(e.stopPropagation(),this.disabled)return!1;this.$emit("input",e)}}},d=t(3744);const f=(0,d.Z)(l,[["render",c],["__scopeId","data-v-8fae7678"]]);var p=f},4004:function(e,n,t){t.d(n,{Z:function(){return s}});var i=t(8534),o=(t(1539),t(8309),t(5666),t(2628)),a={name:"SwitchesMixin",mixins:[o.Z],props:{pluginName:{type:String,required:!0},bus:{type:Object,required:!0},config:{type:Object,default:function(){return{}}},selected:{type:Boolean,default:!1}},data:function(){return{loading:!1,initialized:!1,selectedDevice:null,devices:{}}},methods:{onRefreshEvent:function(e){e===this.pluginName&&this.refresh()},toggle:function(e,n){var t=this;return(0,i.Z)(regeneratorRuntime.mark((function i(){var o;return regeneratorRuntime.wrap((function(i){while(1)switch(i.prev=i.next){case 0:return null==n&&(n=e),i.next=3,t.request("".concat(t.pluginName,".toggle"),{device:n});case 3:o=i.sent,t.devices[e].on=o.on;case 5:case"end":return i.stop()}}),i)})))()},refresh:function(){var e=this;return(0,i.Z)(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return e.loading=!0,n.prev=1,n.next=4,e.request("".concat(e.pluginName,".switch_status"));case 4:e.devices=n.sent.reduce((function(e,n){var t,i=null!==(t=n.name)&&void 0!==t&&t.length?n.name:n.id;return e[i]=n,e}),{});case 5:return n.prev=5,e.loading=!1,n.finish(5);case 8:case"end":return n.stop()}}),n,null,[[1,,5,8]])})))()}},mounted:function(){var e=this;this.$watch((function(){return e.selected}),(function(n){n&&!e.initialized&&(e.refresh(),e.initialized=!0)})),this.bus.on("refresh",this.onRefreshEvent)},unmounted:function(){this.bus.off("refresh",this.onRefreshEvent)}};const r=a;var s=r},8671:function(e,n,t){t.d(n,{Z:function(){return w}});t(8309);var i=t(6252),o=t(9963),a=t(3577),r=function(e){return(0,i.dD)("data-v-38eb9831"),e=e(),(0,i.Cn)(),e},s={class:"name col-l-10 col-m-9 col-s-8"},u=r((function(){return(0,i._)("i",{class:"fa fa-info"},null,-1)})),c=[u],l=["textContent"],d={class:"toggler col-l-2 col-m-3 col-s-4"};function f(e,n,t,r,u,f){var p=(0,i.up)("Loading"),g=(0,i.up)("ToggleSwitch");return(0,i.wg)(),(0,i.iD)("div",{class:"switch",onClick:n[1]||(n[1]=(0,o.iM)((function(){return f.onToggle&&f.onToggle.apply(f,arguments)}),["stop"]))},[t.loading?((0,i.wg)(),(0,i.j4)(p,{key:0})):(0,i.kq)("",!0),(0,i._)("div",s,[t.hasInfo?((0,i.wg)(),(0,i.iD)("button",{key:0,onClick:n[0]||(n[0]=(0,o.iM)((function(){return f.onInfo&&f.onInfo.apply(f,arguments)}),["prevent"]))},c)):(0,i.kq)("",!0),(0,i._)("span",{class:"name-content",textContent:(0,a.zw)(t.name)},null,8,l)]),(0,i._)("div",d,[(0,i.Wm)(g,{disabled:t.loading,value:t.state,onInput:f.onToggle},null,8,["disabled","value","onInput"])])])}var p=t(3567),g=t(1232),h={name:"Switch",components:{Loading:g.Z,ToggleSwitch:p.Z},emits:["toggle","info"],props:{name:{type:String,required:!0},state:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},hasInfo:{type:Boolean,default:!1},id:{type:String}},methods:{onInfo:function(e){return e.stopPropagation(),this.$emit("info"),!1},onToggle:function(e){return e.stopPropagation(),this.$emit("toggle"),!1}}},v=t(3744);const m=(0,v.Z)(h,[["render",f],["__scopeId","data-v-38eb9831"]]);var w=m},2380:function(e,n,t){t.r(n),t.d(n,{default:function(){return p}});t(7941);var i=t(6252),o={class:"switches zwave-mqtt-switches"},a={key:1,class:"no-content"};function r(e,n,t,r,s,u){var c=(0,i.up)("Loading"),l=(0,i.up)("Switch");return(0,i.wg)(),(0,i.iD)("div",o,[e.loading?((0,i.wg)(),(0,i.j4)(c,{key:0})):Object.keys(e.devices).length?(0,i.kq)("",!0):((0,i.wg)(),(0,i.iD)("div",a,"No Z-Wave switches found.")),((0,i.wg)(!0),(0,i.iD)(i.HY,null,(0,i.Ko)(e.devices,(function(n,t){return(0,i.wg)(),(0,i.j4)(l,{loading:e.loading,name:t,state:n.on,id:n.id,onToggle:function(i){return e.toggle(t,n.id)},key:t},null,8,["loading","name","state","id","onToggle"])})),128))])}var s=t(1232),u=t(4004),c=t(8671),l={name:"ZwaveMqtt",components:{Switch:c.Z,Loading:s.Z},mixins:[u.Z]},d=t(3744);const f=(0,d.Z)(l,[["render",r],["__scopeId","data-v-c92e52f8"]]);var p=f}}]);
//# sourceMappingURL=2380-legacy.44d382a4.js.map
\ No newline at end of file
{"version":3,"file":"static/js/2380-legacy.44d382a4.js","mappings":"mRAMM,OAEM,OAFDA,MAAM,UAAQ,EACjB,OAAmB,OAAdA,MAAM,UADb,M,GAGMA,MAAM,S,0CARhB,QAYM,OAZDA,OAAK,SAAC,eAAc,UAAoB,EAAAC,YAAY,QAAK,8BAAE,EAAAC,SAAA,EAAAA,QAAA,sBAAhE,EAEE,OAAwC,SAAjCC,KAAK,WAAYC,QAAS,EAAAC,OAAjC,WACA,OAQQ,cANN,GAGA,OAEO,OAFP,EAEO,EADL,QAAQ,sCATd,GAgBF,OACEC,KAAM,eACNC,MAAO,CAAC,SACRC,MAAO,CACLH,MAAO,CACLF,KAAMM,QACNC,SAAS,GAGXT,SAAU,CACRE,KAAMM,QACNC,SAAS,IAIbC,QAAS,CACPT,QADO,SACCU,GAEN,GADAA,EAAMC,kBACFC,KA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WAAzD,QAAgG,MAAhG,EAAiE,gCAI7D,aAFJ,QACwD,mBAAvB,EAAAX,SAAO,SAAxBI,EAAQ7B,G,kBADxB,QACwD,GAD/CsB,QAAS,EAAAA,QAAUtB,KAAMA,EAAO6C,MAAOhB,EAAOI,GAAKH,GAAID,EAAOC,GAAK,SAAM,mBAAE,EAAAF,OAAO5B,EAAM6B,EAAOC,KAC7DoB,IAAKlD,GADhD,8D,kCAUJ,GACEA,KAAM,YACN8C,WAAY,CAACK,OAAAA,EAAA,EAAQJ,QAAAA,EAAA,GACrBnC,OAAQ,CAAC,M,UCXX,MAAMF,GAA2B,OAAgB,EAAQ,CAAC,CAAC,SAASC,GAAQ,CAAC,YAAY,qBAEzF","sources":["webpack://platypush/./src/components/elements/ToggleSwitch.vue","webpack://platypush/./src/components/elements/ToggleSwitch.vue?94aa","webpack://platypush/./src/components/panels/Switches/Mixin.vue","webpack://platypush/./src/components/panels/Switches/Mixin.vue?f0e3","webpack://platypush/./src/components/panels/Switches/Switch.vue","webpack://platypush/./src/components/panels/Switches/Switch.vue?f006","webpack://platypush/./src/components/panels/Switches/ZwaveMqtt/Index.vue","webpack://platypush/./src/components/panels/Switches/ZwaveMqtt/Index.vue?0a3b"],"sourcesContent":["<template>\n <div class=\"power-switch\" :class=\"{disabled: disabled}\" @click=\"onInput\">\n <!--suppress HtmlFormInputWithoutLabel -->\n <input type=\"checkbox\" :checked=\"value\">\n <label>\n <!--suppress HtmlUnknownTag -->\n <div class=\"switch\">\n <div class=\"dot\" />\n </div>\n <span class=\"label\">\n <slot />\n </span>\n </label>\n </div>\n</template>\n\n<script>\nexport default {\n name: \"ToggleSwitch\",\n emits: ['input'],\n props: {\n value: {\n type: Boolean,\n default: false,\n },\n\n disabled: {\n type: Boolean,\n default: false,\n },\n },\n\n methods: {\n onInput(event) {\n event.stopPropagation()\n if (this.disabled)\n return false\n\n this.$emit('input', event)\n },\n },\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.power-switch {\n position: relative;\n transition: transform .3s;\n transform: scale(var(--scale, 1)) translateZ(0);\n\n &:active {\n --scale: .96;\n }\n\n &.disabled {\n opacity: 0.6;\n }\n\n input {\n display: none;\n & + label {\n border-radius: 1em;\n display: block;\n cursor: pointer;\n position: relative;\n transition: box-shadow .4s;\n\n &:before {\n content: '';\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n border-radius: inherit;\n background: none;\n opacity: var(--gradient, 0);\n transition: opacity .4s;\n }\n\n .switch {\n position: relative;\n display: inline-block;\n vertical-align: top;\n height: 1.4em;\n width: 2.5em;\n border-radius: 1em;\n background: $toggle-bg;\n box-shadow: $toggle-shadow;\n\n &:before {\n content: '';\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n border-radius: inherit;\n background: $toggle-selected-bg;\n opacity: var(--gradient, 0);\n transition: opacity .4s;\n }\n\n .dot {\n background: $toggle-dot-bg;\n position: absolute;\n width: 1.5em;\n height: 1.5em;\n border-radius: 50%;\n box-shadow: $toggle-dot-shadow;\n left: -0.25em;\n top: -0.05em;\n transform: translateX(var(--offset, 0));\n transition: transform .4s, box-shadow .4s;\n\n &:before {\n content: '';\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n border-radius: inherit;\n background: $toggle-selected-dot-bg;\n box-shadow: $toggle-dot-shadow;\n opacity: var(--gradient, 0);\n transition: opacity .4s;\n }\n }\n }\n\n span {\n line-height: 2em;\n font-size: 1.2em;\n color: var(--text, #646B8C);\n font-weight: 500;\n display: inline-block;\n vertical-align: top;\n position: relative;\n margin-left: 0.5em;\n transition: color .4s;\n }\n\n & + span {\n text-align: center;\n display: block;\n position: absolute;\n left: 0;\n right: 0;\n top: 100%;\n opacity: 0;\n font-size: 1em;\n font-weight: 500;\n color: #A6ACCD;\n transform: translateY(0.2em);\n transition: opacity .4s, transform .4s;\n }\n }\n\n &:not(:checked) {\n & + label {\n pointer-events: none;\n & + span {\n opacity: 1;\n transform: translateY(0.6em);\n }\n }\n }\n\n &:checked {\n & + label {\n --offset: 1.5em;\n --text: #406046;\n --gradient: 1;\n --shadow: rgba(0, 39, 6, .1);\n }\n }\n }\n}\n</style>\n","import { render } from \"./ToggleSwitch.vue?vue&type=template&id=8fae7678&scoped=true\"\nimport script from \"./ToggleSwitch.vue?vue&type=script&lang=js\"\nexport * from \"./ToggleSwitch.vue?vue&type=script&lang=js\"\n\nimport \"./ToggleSwitch.vue?vue&type=style&index=0&id=8fae7678&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/blacklight/git_tree/platypush/platypush/backend/http/webapp/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-8fae7678\"]])\n\nexport default __exports__","<script>\nimport Utils from \"@/Utils\";\n\nexport default {\n name: \"SwitchesMixin\",\n mixins: [Utils],\n\n props: {\n pluginName: {\n type: String,\n required: true,\n },\n\n bus: {\n type: Object,\n required: true,\n },\n\n config: {\n type: Object,\n default: () => { return {} },\n },\n\n selected: {\n type: Boolean,\n default: false,\n }\n },\n\n data() {\n return {\n loading: false,\n initialized: false,\n selectedDevice: null,\n devices: {},\n }\n },\n\n methods: {\n onRefreshEvent(pluginName) {\n if (pluginName !== this.pluginName)\n return\n\n this.refresh()\n },\n\n async toggle(device, id) {\n if (id == null)\n id = device\n\n const response = await this.request(`${this.pluginName}.toggle`, {device: id})\n this.devices[device].on = response.on\n },\n\n async refresh() {\n this.loading = true\n try {\n this.devices = (await this.request(`${this.pluginName}.switch_status`)).reduce((obj, device) => {\n const name = device.name?.length ? device.name : device.id\n obj[name] = device\n return obj\n }, {})\n } finally {\n this.loading = false\n }\n }\n },\n\n mounted() {\n this.$watch(() => this.selected, (newValue) => {\n if (newValue && !this.initialized) {\n this.refresh()\n this.initialized = true\n }\n })\n\n this.bus.on('refresh', this.onRefreshEvent)\n },\n\n unmounted() {\n this.bus.off('refresh', this.onRefreshEvent)\n },\n}\n</script>\n","import script from \"./Mixin.vue?vue&type=script&lang=js\"\nexport * from \"./Mixin.vue?vue&type=script&lang=js\"\n\nconst __exports__ = script;\n\nexport default __exports__","<template>\n <div class=\"switch\" @click.stop=\"onToggle\">\n <Loading v-if=\"loading\" />\n <div class=\"name col-l-10 col-m-9 col-s-8\">\n <button v-if=\"hasInfo\" @click.prevent=\"onInfo\">\n <i class=\"fa fa-info\" />\n </button>\n <span class=\"name-content\" v-text=\"name\" />\n </div>\n <div class=\"toggler col-l-2 col-m-3 col-s-4\">\n <ToggleSwitch :disabled=\"loading\" :value=\"state\" @input=\"onToggle\" />\n </div>\n </div>\n</template>\n\n<script>\nimport ToggleSwitch from \"@/components/elements/ToggleSwitch\";\nimport Loading from \"@/components/Loading\";\n\nexport default {\n name: \"Switch\",\n components: {Loading, ToggleSwitch},\n emits: ['toggle', 'info'],\n\n props: {\n name: {\n type: String,\n required: true,\n },\n\n state: {\n type: Boolean,\n default: false,\n },\n\n loading: {\n type: Boolean,\n default: false,\n },\n\n hasInfo: {\n type: Boolean,\n default: false,\n },\n\n id: {\n type: String,\n },\n },\n\n methods: {\n onInfo(event) {\n event.stopPropagation()\n this.$emit('info')\n return false\n },\n\n onToggle(event) {\n event.stopPropagation()\n this.$emit('toggle')\n return false\n },\n }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.switch {\n width: 100%;\n display: flex;\n position: relative;\n align-items: center;\n padding: .75em .5em;\n border-bottom: $default-border-2;\n cursor: pointer;\n\n &:hover {\n background: $hover-bg;\n }\n\n .toggler {\n text-align: right;\n }\n\n button {\n background: none;\n border: none;\n\n &:hover {\n color: $default-hover-fg-2;\n }\n }\n}\n</style>\n","import { render } from \"./Switch.vue?vue&type=template&id=38eb9831&scoped=true\"\nimport script from \"./Switch.vue?vue&type=script&lang=js\"\nexport * from \"./Switch.vue?vue&type=script&lang=js\"\n\nimport \"./Switch.vue?vue&type=style&index=0&id=38eb9831&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/blacklight/git_tree/platypush/platypush/backend/http/webapp/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-38eb9831\"]])\n\nexport default __exports__","<template>\n <div class=\"switches zwave-mqtt-switches\">\n <Loading v-if=\"loading\" />\n <div class=\"no-content\" v-else-if=\"!Object.keys(devices).length\">No Z-Wave switches found.</div>\n\n <Switch :loading=\"loading\" :name=\"name\" :state=\"device.on\" :id=\"device.id\" @toggle=\"toggle(name, device.id)\"\n v-for=\"(device, name) in devices\" :key=\"name\" />\n </div>\n</template>\n\n<script>\nimport Loading from \"@/components/Loading\";\nimport SwitchMixin from \"@/components/panels/Switches/Mixin\";\nimport Switch from \"@/components/panels/Switches/Switch\";\n\nexport default {\n name: \"ZwaveMqtt\",\n components: {Switch, Loading},\n mixins: [SwitchMixin],\n}\n</script>\n\n<style lang=\"scss\" scoped>\n@import \"../common\";\n</style>\n","import { render } from \"./Index.vue?vue&type=template&id=c92e52f8&scoped=true\"\nimport script from \"./Index.vue?vue&type=script&lang=js\"\nexport * from \"./Index.vue?vue&type=script&lang=js\"\n\nimport \"./Index.vue?vue&type=style&index=0&id=c92e52f8&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/blacklight/git_tree/platypush/platypush/backend/http/webapp/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-c92e52f8\"]])\n\nexport default __exports__"],"names":["class","disabled","onInput","type","checked","value","name","emits","props","Boolean","default","methods","event","stopPropagation","this","$emit","__exports__","render","mixins","Utils","pluginName","String","required","bus","Object","config","selected","data","loading","initialized","selectedDevice","devices","onRefreshEvent","refresh","toggle","device","id","request","response","on","reduce","obj","length","mounted","$watch","newValue","unmounted","off","onToggle","hasInfo","onInfo","state","components","Loading","ToggleSwitch","keys","key","Switch"],"sourceRoot":""}
\ No newline at end of file
"use strict";(self["webpackChunkplatypush"]=self["webpackChunkplatypush"]||[]).push([[2380],{6137:function(e,n,t){t.d(n,{Z:function(){return g}});var i=t(6252),o=t(3577),a=t(9963),r=function(e){return(0,i.dD)("data-v-8e097228"),e=e(),(0,i.Cn)(),e},s=["checked"],u=r((function(){return(0,i._)("div",{class:"switch"},[(0,i._)("div",{class:"dot"})],-1)})),c={class:"label"};function l(e,n,t,r,l,d){return(0,i.wg)(),(0,i.iD)("div",{class:(0,o.C_)(["power-switch",{disabled:t.disabled}]),onClick:n[0]||(n[0]=(0,a.iM)((function(){return d.onInput&&d.onInput.apply(d,arguments)}),["stop"]))},[(0,i._)("input",{type:"checkbox",checked:t.value},null,8,s),(0,i._)("label",null,[u,(0,i._)("span",c,[(0,i.WI)(e.$slots,"default",{},void 0,!0)])])],2)}var d={name:"ToggleSwitch",emits:["input"],props:{value:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},methods:{onInput:function(e){if(this.disabled)return!1;this.$emit("input",e)}}},f=t(3744);const p=(0,f.Z)(d,[["render",l],["__scopeId","data-v-8e097228"]]);var g=p},4004:function(e,n,t){t.d(n,{Z:function(){return s}});var i=t(8534),o=(t(1539),t(8309),t(5666),t(2628)),a={name:"SwitchesMixin",mixins:[o.Z],props:{pluginName:{type:String,required:!0},bus:{type:Object,required:!0},config:{type:Object,default:function(){return{}}},selected:{type:Boolean,default:!1}},data:function(){return{loading:!1,initialized:!1,selectedDevice:null,devices:{}}},methods:{onRefreshEvent:function(e){e===this.pluginName&&this.refresh()},toggle:function(e,n){var t=this;return(0,i.Z)(regeneratorRuntime.mark((function i(){var o;return regeneratorRuntime.wrap((function(i){while(1)switch(i.prev=i.next){case 0:return null==n&&(n=e),i.next=3,t.request("".concat(t.pluginName,".toggle"),{device:n});case 3:o=i.sent,t.devices[e].on=o.on;case 5:case"end":return i.stop()}}),i)})))()},refresh:function(){var e=this;return(0,i.Z)(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return e.loading=!0,n.prev=1,n.next=4,e.request("".concat(e.pluginName,".switch_status"));case 4:e.devices=n.sent.reduce((function(e,n){var t,i=null!==(t=n.name)&&void 0!==t&&t.length?n.name:n.id;return e[i]=n,e}),{});case 5:return n.prev=5,e.loading=!1,n.finish(5);case 8:case"end":return n.stop()}}),n,null,[[1,,5,8]])})))()}},mounted:function(){var e=this;this.$watch((function(){return e.selected}),(function(n){n&&!e.initialized&&(e.refresh(),e.initialized=!0)})),this.bus.on("refresh",this.onRefreshEvent)},unmounted:function(){this.bus.off("refresh",this.onRefreshEvent)}};const r=a;var s=r},8671:function(e,n,t){t.d(n,{Z:function(){return w}});t(8309);var i=t(6252),o=t(9963),a=t(3577),r=function(e){return(0,i.dD)("data-v-38eb9831"),e=e(),(0,i.Cn)(),e},s={class:"name col-l-10 col-m-9 col-s-8"},u=r((function(){return(0,i._)("i",{class:"fa fa-info"},null,-1)})),c=[u],l=["textContent"],d={class:"toggler col-l-2 col-m-3 col-s-4"};function f(e,n,t,r,u,f){var p=(0,i.up)("Loading"),g=(0,i.up)("ToggleSwitch");return(0,i.wg)(),(0,i.iD)("div",{class:"switch",onClick:n[1]||(n[1]=(0,o.iM)((function(){return f.onToggle&&f.onToggle.apply(f,arguments)}),["stop"]))},[t.loading?((0,i.wg)(),(0,i.j4)(p,{key:0})):(0,i.kq)("",!0),(0,i._)("div",s,[t.hasInfo?((0,i.wg)(),(0,i.iD)("button",{key:0,onClick:n[0]||(n[0]=(0,o.iM)((function(){return f.onInfo&&f.onInfo.apply(f,arguments)}),["prevent"]))},c)):(0,i.kq)("",!0),(0,i._)("span",{class:"name-content",textContent:(0,a.zw)(t.name)},null,8,l)]),(0,i._)("div",d,[(0,i.Wm)(g,{disabled:t.loading,value:t.state,onInput:f.onToggle},null,8,["disabled","value","onInput"])])])}var p=t(6137),g=t(1232),h={name:"Switch",components:{Loading:g.Z,ToggleSwitch:p.Z},emits:["toggle","info"],props:{name:{type:String,required:!0},state:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},hasInfo:{type:Boolean,default:!1},id:{type:String}},methods:{onInfo:function(e){return e.stopPropagation(),this.$emit("info"),!1},onToggle:function(e){return e.stopPropagation(),this.$emit("toggle"),!1}}},v=t(3744);const m=(0,v.Z)(h,[["render",f],["__scopeId","data-v-38eb9831"]]);var w=m},2380:function(e,n,t){t.r(n),t.d(n,{default:function(){return p}});t(7941);var i=t(6252),o={class:"switches zwave-mqtt-switches"},a={key:1,class:"no-content"};function r(e,n,t,r,s,u){var c=(0,i.up)("Loading"),l=(0,i.up)("Switch");return(0,i.wg)(),(0,i.iD)("div",o,[e.loading?((0,i.wg)(),(0,i.j4)(c,{key:0})):Object.keys(e.devices).length?(0,i.kq)("",!0):((0,i.wg)(),(0,i.iD)("div",a,"No Z-Wave switches found.")),((0,i.wg)(!0),(0,i.iD)(i.HY,null,(0,i.Ko)(e.devices,(function(n,t){return(0,i.wg)(),(0,i.j4)(l,{loading:e.loading,name:t,state:n.on,id:n.id,onToggle:function(i){return e.toggle(t,n.id)},key:t},null,8,["loading","name","state","id","onToggle"])})),128))])}var s=t(1232),u=t(4004),c=t(8671),l={name:"ZwaveMqtt",components:{Switch:c.Z,Loading:s.Z},mixins:[u.Z]},d=t(3744);const f=(0,d.Z)(l,[["render",r],["__scopeId","data-v-c92e52f8"]]);var p=f}}]);
//# sourceMappingURL=2380-legacy.b3f2d86a.js.map
\ No newline at end of file
{"version":3,"file":"static/js/2380-legacy.b3f2d86a.js","mappings":"6RAMM,OAEM,OAFDA,MAAM,UAAQ,EACjB,OAAmB,OAAdA,MAAM,UADb,M,GAGMA,MAAM,S,0CARhB,QAYM,OAZDA,OAAK,SAAC,eAAc,UAAoB,EAAAC,YAAY,QAAK,wCAAO,EAAAC,SAAA,EAAAA,QAAA,qBAAO,YAA5E,EAEE,OAAwC,SAAjCC,KAAK,WAAYC,QAAS,EAAAC,OAAjC,WACA,OAQQ,cANN,GAGA,OAEO,OAFP,EAEO,EADL,QAAQ,sCATd,GAgBF,OACEC,KAAM,eACNC,MAAO,CAAC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ROhB,MAAM,gC,SAEJA,MAAM,c,yFAFb,QAMM,MANN,EAMM,CALW,EAAA2B,UAAA,WAAf,QAA0B,YACUJ,OAAOgC,KAAK,EAAAzB,SAASW,QAAzD,iBAAyD,WAAzD,QAAgG,MAAhG,EAAiE,gCAI7D,aAFJ,QACwD,mBAAvB,EAAAX,SAAO,SAAxBI,EAAQ5B,G,kBADxB,QACwD,GAD/CqB,QAAS,EAAAA,QAAUrB,KAAMA,EAAO4C,MAAOhB,EAAOI,GAAKH,GAAID,EAAOC,GAAK,SAAM,mBAAE,EAAAF,OAAO3B,EAAM4B,EAAOC,KAC7DqB,IAAKlD,GADhD,8D,kCAUJ,GACEA,KAAM,YACN6C,WAAY,CAACM,OAAAA,EAAA,EAAQL,QAAAA,EAAA,GACrBnC,OAAQ,CAAC,M,UCXX,MAAMF,GAA2B,OAAgB,EAAQ,CAAC,CAAC,SAASC,GAAQ,CAAC,YAAY,qBAEzF","sources":["webpack://platypush/./src/components/elements/ToggleSwitch.vue","webpack://platypush/./src/components/elements/ToggleSwitch.vue?94aa","webpack://platypush/./src/components/panels/Switches/Mixin.vue","webpack://platypush/./src/components/panels/Switches/Mixin.vue?f0e3","webpack://platypush/./src/components/panels/Switches/Switch.vue","webpack://platypush/./src/components/panels/Switches/Switch.vue?f006","webpack://platypush/./src/components/panels/Switches/ZwaveMqtt/Index.vue","webpack://platypush/./src/components/panels/Switches/ZwaveMqtt/Index.vue?0a3b"],"sourcesContent":["<template>\n <div class=\"power-switch\" :class=\"{disabled: disabled}\" @click.stop=\"onInput\">\n <!--suppress HtmlFormInputWithoutLabel -->\n <input type=\"checkbox\" :checked=\"value\">\n <label>\n <!--suppress HtmlUnknownTag -->\n <div class=\"switch\">\n <div class=\"dot\" />\n </div>\n <span class=\"label\">\n <slot />\n </span>\n </label>\n </div>\n</template>\n\n<script>\nexport default {\n name: \"ToggleSwitch\",\n emits: ['input'],\n props: {\n value: {\n type: Boolean,\n default: false,\n },\n\n disabled: {\n type: Boolean,\n default: false,\n },\n },\n\n methods: {\n onInput(event) {\n if (this.disabled)\n return false\n\n this.$emit('input', event)\n },\n },\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.power-switch {\n position: relative;\n transition: transform .3s;\n transform: scale(var(--scale, 1)) translateZ(0);\n\n &:active {\n --scale: .96;\n }\n\n &.disabled {\n opacity: 0.6;\n }\n\n input {\n display: none;\n & + label {\n border-radius: 1em;\n display: block;\n cursor: pointer;\n position: relative;\n transition: box-shadow .4s;\n\n &:before {\n content: '';\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n border-radius: inherit;\n background: none;\n opacity: var(--gradient, 0);\n transition: opacity .4s;\n }\n\n .switch {\n position: relative;\n display: inline-block;\n vertical-align: top;\n height: 1.4em;\n width: 2.5em;\n border-radius: 1em;\n background: $slider-bg;\n box-shadow: inset 1px 0px 3px 0 $slider-track-shadow;\n\n &:before {\n content: '';\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n border-radius: inherit;\n background: $slider-progress-bg;\n opacity: var(--gradient, 0);\n transition: opacity .4s;\n }\n\n .dot {\n background: $toggle-dot-bg;\n position: absolute;\n width: 1.5em;\n height: 1.5em;\n border-radius: 50%;\n box-shadow: 1px 0px 3.5px 0 $slider-thumb-shadow;\n left: -0.25em;\n top: -0.05em;\n transform: translateX(var(--offset, 0));\n transition: transform .4s, box-shadow .4s;\n\n &:before {\n content: '';\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n border-radius: inherit;\n background: $toggle-selected-dot-bg;\n opacity: var(--gradient, 0);\n transition: opacity .4s;\n }\n }\n }\n\n span {\n line-height: 2em;\n font-size: 1.2em;\n color: var(--text, #646B8C);\n font-weight: 500;\n display: inline-block;\n vertical-align: top;\n position: relative;\n margin-left: 0.5em;\n transition: color .4s;\n }\n\n & + span {\n text-align: center;\n display: block;\n position: absolute;\n left: 0;\n right: 0;\n top: 100%;\n opacity: 0;\n font-size: 1em;\n font-weight: 500;\n color: $slider-bg;\n transform: translateY(0.2em);\n transition: opacity .4s, transform .4s;\n }\n }\n\n &:not(:checked) {\n & + label {\n pointer-events: none;\n & + span {\n opacity: 1;\n transform: translateY(0.6em);\n }\n }\n }\n\n &:checked {\n & + label {\n --offset: 1.5em;\n --text: $slider-progress-bg;\n --gradient: 1;\n --shadow: rgba(0, 39, 6, .1);\n }\n }\n }\n}\n</style>\n","import { render } from \"./ToggleSwitch.vue?vue&type=template&id=8e097228&scoped=true\"\nimport script from \"./ToggleSwitch.vue?vue&type=script&lang=js\"\nexport * from \"./ToggleSwitch.vue?vue&type=script&lang=js\"\n\nimport \"./ToggleSwitch.vue?vue&type=style&index=0&id=8e097228&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/blacklight/git_tree/platypush/platypush/backend/http/webapp/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-8e097228\"]])\n\nexport default __exports__","<script>\nimport Utils from \"@/Utils\";\n\nexport default {\n name: \"SwitchesMixin\",\n mixins: [Utils],\n\n props: {\n pluginName: {\n type: String,\n required: true,\n },\n\n bus: {\n type: Object,\n required: true,\n },\n\n config: {\n type: Object,\n default: () => { return {} },\n },\n\n selected: {\n type: Boolean,\n default: false,\n }\n },\n\n data() {\n return {\n loading: false,\n initialized: false,\n selectedDevice: null,\n devices: {},\n }\n },\n\n methods: {\n onRefreshEvent(pluginName) {\n if (pluginName !== this.pluginName)\n return\n\n this.refresh()\n },\n\n async toggle(device, id) {\n if (id == null)\n id = device\n\n const response = await this.request(`${this.pluginName}.toggle`, {device: id})\n this.devices[device].on = response.on\n },\n\n async refresh() {\n this.loading = true\n try {\n this.devices = (await this.request(`${this.pluginName}.switch_status`)).reduce((obj, device) => {\n const name = device.name?.length ? device.name : device.id\n obj[name] = device\n return obj\n }, {})\n } finally {\n this.loading = false\n }\n }\n },\n\n mounted() {\n this.$watch(() => this.selected, (newValue) => {\n if (newValue && !this.initialized) {\n this.refresh()\n this.initialized = true\n }\n })\n\n this.bus.on('refresh', this.onRefreshEvent)\n },\n\n unmounted() {\n this.bus.off('refresh', this.onRefreshEvent)\n },\n}\n</script>\n","import script from \"./Mixin.vue?vue&type=script&lang=js\"\nexport * from \"./Mixin.vue?vue&type=script&lang=js\"\n\nconst __exports__ = script;\n\nexport default __exports__","<template>\n <div class=\"switch\" @click.stop=\"onToggle\">\n <Loading v-if=\"loading\" />\n <div class=\"name col-l-10 col-m-9 col-s-8\">\n <button v-if=\"hasInfo\" @click.prevent=\"onInfo\">\n <i class=\"fa fa-info\" />\n </button>\n <span class=\"name-content\" v-text=\"name\" />\n </div>\n <div class=\"toggler col-l-2 col-m-3 col-s-4\">\n <ToggleSwitch :disabled=\"loading\" :value=\"state\" @input=\"onToggle\" />\n </div>\n </div>\n</template>\n\n<script>\nimport ToggleSwitch from \"@/components/elements/ToggleSwitch\";\nimport Loading from \"@/components/Loading\";\n\nexport default {\n name: \"Switch\",\n components: {Loading, ToggleSwitch},\n emits: ['toggle', 'info'],\n\n props: {\n name: {\n type: String,\n required: true,\n },\n\n state: {\n type: Boolean,\n default: false,\n },\n\n loading: {\n type: Boolean,\n default: false,\n },\n\n hasInfo: {\n type: Boolean,\n default: false,\n },\n\n id: {\n type: String,\n },\n },\n\n methods: {\n onInfo(event) {\n event.stopPropagation()\n this.$emit('info')\n return false\n },\n\n onToggle(event) {\n event.stopPropagation()\n this.$emit('toggle')\n return false\n },\n }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.switch {\n width: 100%;\n display: flex;\n position: relative;\n align-items: center;\n padding: .75em .5em;\n border-bottom: $default-border-2;\n cursor: pointer;\n\n &:hover {\n background: $hover-bg;\n }\n\n .toggler {\n text-align: right;\n }\n\n button {\n background: none;\n border: none;\n\n &:hover {\n color: $default-hover-fg-2;\n }\n }\n}\n</style>\n","import { render } from \"./Switch.vue?vue&type=template&id=38eb9831&scoped=true\"\nimport script from \"./Switch.vue?vue&type=script&lang=js\"\nexport * from \"./Switch.vue?vue&type=script&lang=js\"\n\nimport \"./Switch.vue?vue&type=style&index=0&id=38eb9831&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/blacklight/git_tree/platypush/platypush/backend/http/webapp/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-38eb9831\"]])\n\nexport default __exports__","<template>\n <div class=\"switches zwave-mqtt-switches\">\n <Loading v-if=\"loading\" />\n <div class=\"no-content\" v-else-if=\"!Object.keys(devices).length\">No Z-Wave switches found.</div>\n\n <Switch :loading=\"loading\" :name=\"name\" :state=\"device.on\" :id=\"device.id\" @toggle=\"toggle(name, device.id)\"\n v-for=\"(device, name) in devices\" :key=\"name\" />\n </div>\n</template>\n\n<script>\nimport Loading from \"@/components/Loading\";\nimport SwitchMixin from \"@/components/panels/Switches/Mixin\";\nimport Switch from \"@/components/panels/Switches/Switch\";\n\nexport default {\n name: \"ZwaveMqtt\",\n components: {Switch, Loading},\n mixins: [SwitchMixin],\n}\n</script>\n\n<style lang=\"scss\" scoped>\n@import \"../common\";\n</style>\n","import { render } from \"./Index.vue?vue&type=template&id=c92e52f8&scoped=true\"\nimport script from \"./Index.vue?vue&type=script&lang=js\"\nexport * from \"./Index.vue?vue&type=script&lang=js\"\n\nimport \"./Index.vue?vue&type=style&index=0&id=c92e52f8&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/blacklight/git_tree/platypush/platypush/backend/http/webapp/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-c92e52f8\"]])\n\nexport default __exports__"],"names":["class","disabled","onInput","type","checked","value","name","emits","props","Boolean","default","methods","event","this","$emit","__exports__","render","mixins","Utils","pluginName","String","required","bus","Object","config","selected","data","loading","initialized","selectedDevice","devices","onRefreshEvent","refresh","toggle","device","id","request","response","on","reduce","obj","length","mounted","$watch","newValue","unmounted","off","onToggle","hasInfo","onInfo","state","components","Loading","ToggleSwitch","stopPropagation","keys","key","Switch"],"sourceRoot":""}
\ No newline at end of file
"use strict";(self["webpackChunkplatypush"]=self["webpackChunkplatypush"]||[]).push([[2380],{6137:function(e,t,n){n.d(t,{Z:function(){return p}});var i=n(6252),o=n(3577),s=n(9963);const a=e=>((0,i.dD)("data-v-8e097228"),e=e(),(0,i.Cn)(),e),l=["checked"],d=a((()=>(0,i._)("div",{class:"switch"},[(0,i._)("div",{class:"dot"})],-1))),c={class:"label"};function u(e,t,n,a,u,r){return(0,i.wg)(),(0,i.iD)("div",{class:(0,o.C_)(["power-switch",{disabled:n.disabled}]),onClick:t[0]||(t[0]=(0,s.iM)(((...e)=>r.onInput&&r.onInput(...e)),["stop"]))},[(0,i._)("input",{type:"checkbox",checked:n.value},null,8,l),(0,i._)("label",null,[d,(0,i._)("span",c,[(0,i.WI)(e.$slots,"default",{},void 0,!0)])])],2)}var r={name:"ToggleSwitch",emits:["input"],props:{value:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},methods:{onInput(e){if(this.disabled)return!1;this.$emit("input",e)}}},g=n(3744);const h=(0,g.Z)(r,[["render",u],["__scopeId","data-v-8e097228"]]);var p=h},4004:function(e,t,n){n.d(t,{Z:function(){return a}});var i=n(2628),o={name:"SwitchesMixin",mixins:[i.Z],props:{pluginName:{type:String,required:!0},bus:{type:Object,required:!0},config:{type:Object,default:()=>({})},selected:{type:Boolean,default:!1}},data(){return{loading:!1,initialized:!1,selectedDevice:null,devices:{}}},methods:{onRefreshEvent(e){e===this.pluginName&&this.refresh()},async toggle(e,t){null==t&&(t=e);const n=await this.request(`${this.pluginName}.toggle`,{device:t});this.devices[e].on=n.on},async refresh(){this.loading=!0;try{this.devices=(await this.request(`${this.pluginName}.switch_status`)).reduce(((e,t)=>{const n=t.name?.length?t.name:t.id;return e[n]=t,e}),{})}finally{this.loading=!1}}},mounted(){this.$watch((()=>this.selected),(e=>{e&&!this.initialized&&(this.refresh(),this.initialized=!0)})),this.bus.on("refresh",this.onRefreshEvent)},unmounted(){this.bus.off("refresh",this.onRefreshEvent)}};const s=o;var a=s},8671:function(e,t,n){n.d(t,{Z:function(){return w}});var i=n(6252),o=n(9963),s=n(3577);const a=e=>((0,i.dD)("data-v-38eb9831"),e=e(),(0,i.Cn)(),e),l={class:"name col-l-10 col-m-9 col-s-8"},d=a((()=>(0,i._)("i",{class:"fa fa-info"},null,-1))),c=[d],u=["textContent"],r={class:"toggler col-l-2 col-m-3 col-s-4"};function g(e,t,n,a,d,g){const h=(0,i.up)("Loading"),p=(0,i.up)("ToggleSwitch");return(0,i.wg)(),(0,i.iD)("div",{class:"switch",onClick:t[1]||(t[1]=(0,o.iM)(((...e)=>g.onToggle&&g.onToggle(...e)),["stop"]))},[n.loading?((0,i.wg)(),(0,i.j4)(h,{key:0})):(0,i.kq)("",!0),(0,i._)("div",l,[n.hasInfo?((0,i.wg)(),(0,i.iD)("button",{key:0,onClick:t[0]||(t[0]=(0,o.iM)(((...e)=>g.onInfo&&g.onInfo(...e)),["prevent"]))},c)):(0,i.kq)("",!0),(0,i._)("span",{class:"name-content",textContent:(0,s.zw)(n.name)},null,8,u)]),(0,i._)("div",r,[(0,i.Wm)(p,{disabled:n.loading,value:n.state,onInput:g.onToggle},null,8,["disabled","value","onInput"])])])}var h=n(6137),p=n(1232),f={name:"Switch",components:{Loading:p.Z,ToggleSwitch:h.Z},emits:["toggle","info"],props:{name:{type:String,required:!0},state:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},hasInfo:{type:Boolean,default:!1},id:{type:String}},methods:{onInfo(e){return e.stopPropagation(),this.$emit("info"),!1},onToggle(e){return e.stopPropagation(),this.$emit("toggle"),!1}}},v=n(3744);const m=(0,v.Z)(f,[["render",g],["__scopeId","data-v-38eb9831"]]);var w=m},2380:function(e,t,n){n.r(t),n.d(t,{default:function(){return h}});var i=n(6252);const o={class:"switches zwave-mqtt-switches"},s={key:1,class:"no-content"};function a(e,t,n,a,l,d){const c=(0,i.up)("Loading"),u=(0,i.up)("Switch");return(0,i.wg)(),(0,i.iD)("div",o,[e.loading?((0,i.wg)(),(0,i.j4)(c,{key:0})):Object.keys(e.devices).length?(0,i.kq)("",!0):((0,i.wg)(),(0,i.iD)("div",s,"No Z-Wave switches found.")),((0,i.wg)(!0),(0,i.iD)(i.HY,null,(0,i.Ko)(e.devices,((t,n)=>((0,i.wg)(),(0,i.j4)(u,{loading:e.loading,name:n,state:t.on,id:t.id,onToggle:i=>e.toggle(n,t.id),key:n},null,8,["loading","name","state","id","onToggle"])))),128))])}var l=n(1232),d=n(4004),c=n(8671),u={name:"ZwaveMqtt",components:{Switch:c.Z,Loading:l.Z},mixins:[d.Z]},r=n(3744);const g=(0,r.Z)(u,[["render",a],["__scopeId","data-v-c92e52f8"]]);var h=g}}]);
//# sourceMappingURL=2380.73b1a20d.js.map
\ No newline at end of file
{"version":3,"file":"static/js/2380.73b1a20d.js","mappings":"wQAMM,OAEM,OAFDA,MAAM,UAAQ,EACjB,OAAmB,OAAdA,MAAM,UADb,K,GAGMA,MAAM,S,0CARhB,QAYM,OAZDA,OAAK,SAAC,eAAc,UAAoB,EAAAC,YAAY,QAAK,8BAAO,EAAAC,SAAA,EAAAA,WAAA,IAAO,YAA5E,EAEE,OAAwC,SAAjCC,KAAK,WAAYC,QAAS,EAAAC,OAAjC,WACA,OAQQ,cANN,GAGA,OAEO,OAFP,EAEO,EADL,QAAQ,sCATd,GAgBF,OACEC,KAAM,eACNC,MAAO,CAAC,SACRC,MAAO,CACLH,MAAO,CACLF,KAAMM,QACNC,SAAS,GAGXT,SAAU,CACRE,KAAMM,QACNC,SAAS,IAIbC,QAAS,CACPT,QAAQU,GACN,GAAIC,KAAKZ,SACP,OAAO,EAETY,KAAKC,MAAM,QAASF,M,UC9B1B,MAAMG,GAA2B,OAAgB,EAAQ,CAAC,CAAC,SAASC,GAAQ,CAAC,YAAY,qBAEzF,S,mECNA,GACEV,KAAM,gBACNW,OAAQ,CAACC,E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QAAO,KAC5BnC,OAAQ,CAAC,M,UCXX,MAAMF,GAA2B,OAAgB,EAAQ,CAAC,CAAC,SAASC,GAAQ,CAAC,YAAY,qBAEzF","sources":["webpack://platypush/./src/components/elements/ToggleSwitch.vue","webpack://platypush/./src/components/elements/ToggleSwitch.vue?94aa","webpack://platypush/./src/components/panels/Switches/Mixin.vue","webpack://platypush/./src/components/panels/Switches/Mixin.vue?f0e3","webpack://platypush/./src/components/panels/Switches/Switch.vue","webpack://platypush/./src/components/panels/Switches/Switch.vue?f006","webpack://platypush/./src/components/panels/Switches/ZwaveMqtt/Index.vue","webpack://platypush/./src/components/panels/Switches/ZwaveMqtt/Index.vue?0a3b"],"sourcesContent":["<template>\n <div class=\"power-switch\" :class=\"{disabled: disabled}\" @click.stop=\"onInput\">\n <!--suppress HtmlFormInputWithoutLabel -->\n <input type=\"checkbox\" :checked=\"value\">\n <label>\n <!--suppress HtmlUnknownTag -->\n <div class=\"switch\">\n <div class=\"dot\" />\n </div>\n <span class=\"label\">\n <slot />\n </span>\n </label>\n </div>\n</template>\n\n<script>\nexport default {\n name: \"ToggleSwitch\",\n emits: ['input'],\n props: {\n value: {\n type: Boolean,\n default: false,\n },\n\n disabled: {\n type: Boolean,\n default: false,\n },\n },\n\n methods: {\n onInput(event) {\n if (this.disabled)\n return false\n\n this.$emit('input', event)\n },\n },\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.power-switch {\n position: relative;\n transition: transform .3s;\n transform: scale(var(--scale, 1)) translateZ(0);\n\n &:active {\n --scale: .96;\n }\n\n &.disabled {\n opacity: 0.6;\n }\n\n input {\n display: none;\n & + label {\n border-radius: 1em;\n display: block;\n cursor: pointer;\n position: relative;\n transition: box-shadow .4s;\n\n &:before {\n content: '';\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n border-radius: inherit;\n background: none;\n opacity: var(--gradient, 0);\n transition: opacity .4s;\n }\n\n .switch {\n position: relative;\n display: inline-block;\n vertical-align: top;\n height: 1.4em;\n width: 2.5em;\n border-radius: 1em;\n background: $slider-bg;\n box-shadow: inset 1px 0px 3px 0 $slider-track-shadow;\n\n &:before {\n content: '';\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n border-radius: inherit;\n background: $slider-progress-bg;\n opacity: var(--gradient, 0);\n transition: opacity .4s;\n }\n\n .dot {\n background: $toggle-dot-bg;\n position: absolute;\n width: 1.5em;\n height: 1.5em;\n border-radius: 50%;\n box-shadow: 1px 0px 3.5px 0 $slider-thumb-shadow;\n left: -0.25em;\n top: -0.05em;\n transform: translateX(var(--offset, 0));\n transition: transform .4s, box-shadow .4s;\n\n &:before {\n content: '';\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n border-radius: inherit;\n background: $toggle-selected-dot-bg;\n opacity: var(--gradient, 0);\n transition: opacity .4s;\n }\n }\n }\n\n span {\n line-height: 2em;\n font-size: 1.2em;\n color: var(--text, #646B8C);\n font-weight: 500;\n display: inline-block;\n vertical-align: top;\n position: relative;\n margin-left: 0.5em;\n transition: color .4s;\n }\n\n & + span {\n text-align: center;\n display: block;\n position: absolute;\n left: 0;\n right: 0;\n top: 100%;\n opacity: 0;\n font-size: 1em;\n font-weight: 500;\n color: $slider-bg;\n transform: translateY(0.2em);\n transition: opacity .4s, transform .4s;\n }\n }\n\n &:not(:checked) {\n & + label {\n pointer-events: none;\n & + span {\n opacity: 1;\n transform: translateY(0.6em);\n }\n }\n }\n\n &:checked {\n & + label {\n --offset: 1.5em;\n --text: $slider-progress-bg;\n --gradient: 1;\n --shadow: rgba(0, 39, 6, .1);\n }\n }\n }\n}\n</style>\n","import { render } from \"./ToggleSwitch.vue?vue&type=template&id=8e097228&scoped=true\"\nimport script from \"./ToggleSwitch.vue?vue&type=script&lang=js\"\nexport * from \"./ToggleSwitch.vue?vue&type=script&lang=js\"\n\nimport \"./ToggleSwitch.vue?vue&type=style&index=0&id=8e097228&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/blacklight/git_tree/platypush/platypush/backend/http/webapp/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-8e097228\"]])\n\nexport default __exports__","<script>\nimport Utils from \"@/Utils\";\n\nexport default {\n name: \"SwitchesMixin\",\n mixins: [Utils],\n\n props: {\n pluginName: {\n type: String,\n required: true,\n },\n\n bus: {\n type: Object,\n required: true,\n },\n\n config: {\n type: Object,\n default: () => { return {} },\n },\n\n selected: {\n type: Boolean,\n default: false,\n }\n },\n\n data() {\n return {\n loading: false,\n initialized: false,\n selectedDevice: null,\n devices: {},\n }\n },\n\n methods: {\n onRefreshEvent(pluginName) {\n if (pluginName !== this.pluginName)\n return\n\n this.refresh()\n },\n\n async toggle(device, id) {\n if (id == null)\n id = device\n\n const response = await this.request(`${this.pluginName}.toggle`, {device: id})\n this.devices[device].on = response.on\n },\n\n async refresh() {\n this.loading = true\n try {\n this.devices = (await this.request(`${this.pluginName}.switch_status`)).reduce((obj, device) => {\n const name = device.name?.length ? device.name : device.id\n obj[name] = device\n return obj\n }, {})\n } finally {\n this.loading = false\n }\n }\n },\n\n mounted() {\n this.$watch(() => this.selected, (newValue) => {\n if (newValue && !this.initialized) {\n this.refresh()\n this.initialized = true\n }\n })\n\n this.bus.on('refresh', this.onRefreshEvent)\n },\n\n unmounted() {\n this.bus.off('refresh', this.onRefreshEvent)\n },\n}\n</script>\n","import script from \"./Mixin.vue?vue&type=script&lang=js\"\nexport * from \"./Mixin.vue?vue&type=script&lang=js\"\n\nconst __exports__ = script;\n\nexport default __exports__","<template>\n <div class=\"switch\" @click.stop=\"onToggle\">\n <Loading v-if=\"loading\" />\n <div class=\"name col-l-10 col-m-9 col-s-8\">\n <button v-if=\"hasInfo\" @click.prevent=\"onInfo\">\n <i class=\"fa fa-info\" />\n </button>\n <span class=\"name-content\" v-text=\"name\" />\n </div>\n <div class=\"toggler col-l-2 col-m-3 col-s-4\">\n <ToggleSwitch :disabled=\"loading\" :value=\"state\" @input=\"onToggle\" />\n </div>\n </div>\n</template>\n\n<script>\nimport ToggleSwitch from \"@/components/elements/ToggleSwitch\";\nimport Loading from \"@/components/Loading\";\n\nexport default {\n name: \"Switch\",\n components: {Loading, ToggleSwitch},\n emits: ['toggle', 'info'],\n\n props: {\n name: {\n type: String,\n required: true,\n },\n\n state: {\n type: Boolean,\n default: false,\n },\n\n loading: {\n type: Boolean,\n default: false,\n },\n\n hasInfo: {\n type: Boolean,\n default: false,\n },\n\n id: {\n type: String,\n },\n },\n\n methods: {\n onInfo(event) {\n event.stopPropagation()\n this.$emit('info')\n return false\n },\n\n onToggle(event) {\n event.stopPropagation()\n this.$emit('toggle')\n return false\n },\n }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.switch {\n width: 100%;\n display: flex;\n position: relative;\n align-items: center;\n padding: .75em .5em;\n border-bottom: $default-border-2;\n cursor: pointer;\n\n &:hover {\n background: $hover-bg;\n }\n\n .toggler {\n text-align: right;\n }\n\n button {\n background: none;\n border: none;\n\n &:hover {\n color: $default-hover-fg-2;\n }\n }\n}\n</style>\n","import { render } from \"./Switch.vue?vue&type=template&id=38eb9831&scoped=true\"\nimport script from \"./Switch.vue?vue&type=script&lang=js\"\nexport * from \"./Switch.vue?vue&type=script&lang=js\"\n\nimport \"./Switch.vue?vue&type=style&index=0&id=38eb9831&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/blacklight/git_tree/platypush/platypush/backend/http/webapp/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-38eb9831\"]])\n\nexport default __exports__","<template>\n <div class=\"switches zwave-mqtt-switches\">\n <Loading v-if=\"loading\" />\n <div class=\"no-content\" v-else-if=\"!Object.keys(devices).length\">No Z-Wave switches found.</div>\n\n <Switch :loading=\"loading\" :name=\"name\" :state=\"device.on\" :id=\"device.id\" @toggle=\"toggle(name, device.id)\"\n v-for=\"(device, name) in devices\" :key=\"name\" />\n </div>\n</template>\n\n<script>\nimport Loading from \"@/components/Loading\";\nimport SwitchMixin from \"@/components/panels/Switches/Mixin\";\nimport Switch from \"@/components/panels/Switches/Switch\";\n\nexport default {\n name: \"ZwaveMqtt\",\n components: {Switch, Loading},\n mixins: [SwitchMixin],\n}\n</script>\n\n<style lang=\"scss\" scoped>\n@import \"../common\";\n</style>\n","import { render } from \"./Index.vue?vue&type=template&id=c92e52f8&scoped=true\"\nimport script from \"./Index.vue?vue&type=script&lang=js\"\nexport * from \"./Index.vue?vue&type=script&lang=js\"\n\nimport \"./Index.vue?vue&type=style&index=0&id=c92e52f8&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/blacklight/git_tree/platypush/platypush/backend/http/webapp/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-c92e52f8\"]])\n\nexport default __exports__"],"names":["class","disabled","onInput","type","checked","value","name","emits","props","Boolean","default","methods","event","this","$emit","__exports__","render","mixins","Utils","pluginName","String","required","bus","Object","config","selected","data","loading","initialized","selectedDevice","devices","onRefreshEvent","refresh","async","device","id","response","request","on","reduce","obj","length","mounted","$watch","newValue","unmounted","off","onToggle","hasInfo","onInfo","state","components","Loading","ToggleSwitch","stopPropagation","keys","toggle","key","Switch"],"sourceRoot":""}
\ No newline at end of file
"use strict";(self["webpackChunkplatypush"]=self["webpackChunkplatypush"]||[]).push([[2380],{3567:function(e,t,n){n.d(t,{Z:function(){return h}});var i=n(6252),o=n(3577);const s=e=>((0,i.dD)("data-v-8fae7678"),e=e(),(0,i.Cn)(),e),a=["checked"],l=s((()=>(0,i._)("div",{class:"switch"},[(0,i._)("div",{class:"dot"})],-1))),d={class:"label"};function c(e,t,n,s,c,u){return(0,i.wg)(),(0,i.iD)("div",{class:(0,o.C_)(["power-switch",{disabled:n.disabled}]),onClick:t[0]||(t[0]=(...e)=>u.onInput&&u.onInput(...e))},[(0,i._)("input",{type:"checkbox",checked:n.value},null,8,a),(0,i._)("label",null,[l,(0,i._)("span",d,[(0,i.WI)(e.$slots,"default",{},void 0,!0)])])],2)}var u={name:"ToggleSwitch",emits:["input"],props:{value:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},methods:{onInput(e){if(e.stopPropagation(),this.disabled)return!1;this.$emit("input",e)}}},r=n(3744);const g=(0,r.Z)(u,[["render",c],["__scopeId","data-v-8fae7678"]]);var h=g},4004:function(e,t,n){n.d(t,{Z:function(){return a}});var i=n(2628),o={name:"SwitchesMixin",mixins:[i.Z],props:{pluginName:{type:String,required:!0},bus:{type:Object,required:!0},config:{type:Object,default:()=>({})},selected:{type:Boolean,default:!1}},data(){return{loading:!1,initialized:!1,selectedDevice:null,devices:{}}},methods:{onRefreshEvent(e){e===this.pluginName&&this.refresh()},async toggle(e,t){null==t&&(t=e);const n=await this.request(`${this.pluginName}.toggle`,{device:t});this.devices[e].on=n.on},async refresh(){this.loading=!0;try{this.devices=(await this.request(`${this.pluginName}.switch_status`)).reduce(((e,t)=>{const n=t.name?.length?t.name:t.id;return e[n]=t,e}),{})}finally{this.loading=!1}}},mounted(){this.$watch((()=>this.selected),(e=>{e&&!this.initialized&&(this.refresh(),this.initialized=!0)})),this.bus.on("refresh",this.onRefreshEvent)},unmounted(){this.bus.off("refresh",this.onRefreshEvent)}};const s=o;var a=s},8671:function(e,t,n){n.d(t,{Z:function(){return w}});var i=n(6252),o=n(9963),s=n(3577);const a=e=>((0,i.dD)("data-v-38eb9831"),e=e(),(0,i.Cn)(),e),l={class:"name col-l-10 col-m-9 col-s-8"},d=a((()=>(0,i._)("i",{class:"fa fa-info"},null,-1))),c=[d],u=["textContent"],r={class:"toggler col-l-2 col-m-3 col-s-4"};function g(e,t,n,a,d,g){const h=(0,i.up)("Loading"),p=(0,i.up)("ToggleSwitch");return(0,i.wg)(),(0,i.iD)("div",{class:"switch",onClick:t[1]||(t[1]=(0,o.iM)(((...e)=>g.onToggle&&g.onToggle(...e)),["stop"]))},[n.loading?((0,i.wg)(),(0,i.j4)(h,{key:0})):(0,i.kq)("",!0),(0,i._)("div",l,[n.hasInfo?((0,i.wg)(),(0,i.iD)("button",{key:0,onClick:t[0]||(t[0]=(0,o.iM)(((...e)=>g.onInfo&&g.onInfo(...e)),["prevent"]))},c)):(0,i.kq)("",!0),(0,i._)("span",{class:"name-content",textContent:(0,s.zw)(n.name)},null,8,u)]),(0,i._)("div",r,[(0,i.Wm)(p,{disabled:n.loading,value:n.state,onInput:g.onToggle},null,8,["disabled","value","onInput"])])])}var h=n(3567),p=n(1232),f={name:"Switch",components:{Loading:p.Z,ToggleSwitch:h.Z},emits:["toggle","info"],props:{name:{type:String,required:!0},state:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},hasInfo:{type:Boolean,default:!1},id:{type:String}},methods:{onInfo(e){return e.stopPropagation(),this.$emit("info"),!1},onToggle(e){return e.stopPropagation(),this.$emit("toggle"),!1}}},v=n(3744);const m=(0,v.Z)(f,[["render",g],["__scopeId","data-v-38eb9831"]]);var w=m},2380:function(e,t,n){n.r(t),n.d(t,{default:function(){return h}});var i=n(6252);const o={class:"switches zwave-mqtt-switches"},s={key:1,class:"no-content"};function a(e,t,n,a,l,d){const c=(0,i.up)("Loading"),u=(0,i.up)("Switch");return(0,i.wg)(),(0,i.iD)("div",o,[e.loading?((0,i.wg)(),(0,i.j4)(c,{key:0})):Object.keys(e.devices).length?(0,i.kq)("",!0):((0,i.wg)(),(0,i.iD)("div",s,"No Z-Wave switches found.")),((0,i.wg)(!0),(0,i.iD)(i.HY,null,(0,i.Ko)(e.devices,((t,n)=>((0,i.wg)(),(0,i.j4)(u,{loading:e.loading,name:n,state:t.on,id:t.id,onToggle:i=>e.toggle(n,t.id),key:n},null,8,["loading","name","state","id","onToggle"])))),128))])}var l=n(1232),d=n(4004),c=n(8671),u={name:"ZwaveMqtt",components:{Switch:c.Z,Loading:l.Z},mixins:[d.Z]},r=n(3744);const g=(0,r.Z)(u,[["render",a],["__scopeId","data-v-c92e52f8"]]);var h=g}}]);
//# sourceMappingURL=2380.bae8d47d.js.map
\ No newline at end of file
{"version":3,"file":"static/js/2380.bae8d47d.js","mappings":"8PAMM,OAEM,OAFDA,MAAM,UAAQ,EACjB,OAAmB,OAAdA,MAAM,UADb,K,GAGMA,MAAM,S,0CARhB,QAYM,OAZDA,OAAK,SAAC,eAAc,UAAoB,EAAAC,YAAY,QAAK,oBAAE,EAAAC,SAAA,EAAAA,WAAA,KAAhE,EAEE,OAAwC,SAAjCC,KAAK,WAAYC,QAAS,EAAAC,OAAjC,WACA,OAQQ,cANN,GAGA,OAEO,OAFP,EAEO,EADL,QAAQ,sCATd,GAgBF,OACEC,KAAM,eACNC,MAAO,CAAC,SACRC,MAAO,CACLH,MAAO,CACLF,KAAMM,QACNC,SAAS,GAGXT,SAAU,CACRE,KAAMM,QACNC,SAAS,IAIbC,QAAS,CACPT,QAAQU,GAEN,GADAA,EAAMC,kBACFC,KAAKb,SACP,OAAO,EAETa,KAAKC,MAAM,QAASH,M,UC/B1B,MAAMI,GAA2B,OAAgB,EAAQ,CAAC,CAAC,SAASC,GAAQ,CAAC,YAAY,qBAEzF,S,mECNA,GACEX,KAAM,gBACNY,OAAQ,CAACC,EAAA,GAETX,MAAO,CACLY,WAAY,CACVjB,KAAMkB,OACNC,UAAU,GAGZC,IAAK,CACHpB,KAAMqB,OACNF,UAAU,GAGZG,OAAQ,CACNtB,KAAMqB,OACNd,QAAS,KAAe,KAG1BgB,SAAU,CACRvB,KAAMM,QACNC,SAAS,IAIbiB,OACE,MAAO,CACLC,SAAS,EACTC,aAAa,EACbC,eAAgB,KAChBC,QAAS,KAIbpB,QAAS,CACPqB,eAAeZ,GACTA,IAAeN,KAAKM,YAGxBN,KAAKmB,WAGPC,aAAaC,EAAQC,GACT,MAANA,IACFA,EAAKD,GAEP,MAAME,QAAiBvB,KAAKwB,QAAS,GAAExB,KAAKM,oBAAqB,CAACe,OAAQC,IAC1EtB,KAAKiB,QAAQI,GAAQI,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uC,QAAS,CACP9C,KAAMM,QACNC,SAAS,GAGX0B,GAAI,CACFjC,KAAMkB,SAIVV,QAAS,CACPuC,OAAOtC,GAGL,OAFAA,EAAMC,kBACNC,KAAKC,MAAM,SACJ,GAGTiC,SAASpC,GAGP,OAFAA,EAAMC,kBACNC,KAAKC,MAAM,WACJ,K,UCrDb,MAAMC,GAA2B,OAAgB,EAAQ,CAAC,CAAC,SAASC,GAAQ,CAAC,YAAY,qBAEzF,S,yFCROjB,MAAM,gC,SAEJA,MAAM,c,2FAFb,QAMM,MANN,EAMM,CALW,EAAA4B,UAAA,WAAf,QAA0B,YACUJ,OAAO+B,KAAK,EAAAxB,SAASW,QAAzD,iBAAyD,WAAzD,QAAgG,MAAhG,EAAiE,gCAI7D,aAFJ,QACwD,mBAAvB,EAAAX,SAAO,CAAxBI,EAAQ7B,M,WADxB,QACwD,GAD/CsB,QAAS,EAAAA,QAAUtB,KAAMA,EAAO6C,MAAOhB,EAAOI,GAAKH,GAAID,EAAOC,GAAK,SAAM,GAAE,EAAAoB,OAAOlD,EAAM6B,EAAOC,IAC7DqB,IAAKnD,GADhD,8D,kCAUJ,GACEA,KAAM,YACN8C,WAAY,CAACM,OAAD,IAASL,QAAO,KAC5BnC,OAAQ,CAAC,M,UCXX,MAAMF,GAA2B,OAAgB,EAAQ,CAAC,CAAC,SAASC,GAAQ,CAAC,YAAY,qBAEzF","sources":["webpack://platypush/./src/components/elements/ToggleSwitch.vue","webpack://platypush/./src/components/elements/ToggleSwitch.vue?94aa","webpack://platypush/./src/components/panels/Switches/Mixin.vue","webpack://platypush/./src/components/panels/Switches/Mixin.vue?f0e3","webpack://platypush/./src/components/panels/Switches/Switch.vue","webpack://platypush/./src/components/panels/Switches/Switch.vue?f006","webpack://platypush/./src/components/panels/Switches/ZwaveMqtt/Index.vue","webpack://platypush/./src/components/panels/Switches/ZwaveMqtt/Index.vue?0a3b"],"sourcesContent":["<template>\n <div class=\"power-switch\" :class=\"{disabled: disabled}\" @click=\"onInput\">\n <!--suppress HtmlFormInputWithoutLabel -->\n <input type=\"checkbox\" :checked=\"value\">\n <label>\n <!--suppress HtmlUnknownTag -->\n <div class=\"switch\">\n <div class=\"dot\" />\n </div>\n <span class=\"label\">\n <slot />\n </span>\n </label>\n </div>\n</template>\n\n<script>\nexport default {\n name: \"ToggleSwitch\",\n emits: ['input'],\n props: {\n value: {\n type: Boolean,\n default: false,\n },\n\n disabled: {\n type: Boolean,\n default: false,\n },\n },\n\n methods: {\n onInput(event) {\n event.stopPropagation()\n if (this.disabled)\n return false\n\n this.$emit('input', event)\n },\n },\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.power-switch {\n position: relative;\n transition: transform .3s;\n transform: scale(var(--scale, 1)) translateZ(0);\n\n &:active {\n --scale: .96;\n }\n\n &.disabled {\n opacity: 0.6;\n }\n\n input {\n display: none;\n & + label {\n border-radius: 1em;\n display: block;\n cursor: pointer;\n position: relative;\n transition: box-shadow .4s;\n\n &:before {\n content: '';\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n border-radius: inherit;\n background: none;\n opacity: var(--gradient, 0);\n transition: opacity .4s;\n }\n\n .switch {\n position: relative;\n display: inline-block;\n vertical-align: top;\n height: 1.4em;\n width: 2.5em;\n border-radius: 1em;\n background: $toggle-bg;\n box-shadow: $toggle-shadow;\n\n &:before {\n content: '';\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n border-radius: inherit;\n background: $toggle-selected-bg;\n opacity: var(--gradient, 0);\n transition: opacity .4s;\n }\n\n .dot {\n background: $toggle-dot-bg;\n position: absolute;\n width: 1.5em;\n height: 1.5em;\n border-radius: 50%;\n box-shadow: $toggle-dot-shadow;\n left: -0.25em;\n top: -0.05em;\n transform: translateX(var(--offset, 0));\n transition: transform .4s, box-shadow .4s;\n\n &:before {\n content: '';\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n border-radius: inherit;\n background: $toggle-selected-dot-bg;\n box-shadow: $toggle-dot-shadow;\n opacity: var(--gradient, 0);\n transition: opacity .4s;\n }\n }\n }\n\n span {\n line-height: 2em;\n font-size: 1.2em;\n color: var(--text, #646B8C);\n font-weight: 500;\n display: inline-block;\n vertical-align: top;\n position: relative;\n margin-left: 0.5em;\n transition: color .4s;\n }\n\n & + span {\n text-align: center;\n display: block;\n position: absolute;\n left: 0;\n right: 0;\n top: 100%;\n opacity: 0;\n font-size: 1em;\n font-weight: 500;\n color: #A6ACCD;\n transform: translateY(0.2em);\n transition: opacity .4s, transform .4s;\n }\n }\n\n &:not(:checked) {\n & + label {\n pointer-events: none;\n & + span {\n opacity: 1;\n transform: translateY(0.6em);\n }\n }\n }\n\n &:checked {\n & + label {\n --offset: 1.5em;\n --text: #406046;\n --gradient: 1;\n --shadow: rgba(0, 39, 6, .1);\n }\n }\n }\n}\n</style>\n","import { render } from \"./ToggleSwitch.vue?vue&type=template&id=8fae7678&scoped=true\"\nimport script from \"./ToggleSwitch.vue?vue&type=script&lang=js\"\nexport * from \"./ToggleSwitch.vue?vue&type=script&lang=js\"\n\nimport \"./ToggleSwitch.vue?vue&type=style&index=0&id=8fae7678&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/blacklight/git_tree/platypush/platypush/backend/http/webapp/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-8fae7678\"]])\n\nexport default __exports__","<script>\nimport Utils from \"@/Utils\";\n\nexport default {\n name: \"SwitchesMixin\",\n mixins: [Utils],\n\n props: {\n pluginName: {\n type: String,\n required: true,\n },\n\n bus: {\n type: Object,\n required: true,\n },\n\n config: {\n type: Object,\n default: () => { return {} },\n },\n\n selected: {\n type: Boolean,\n default: false,\n }\n },\n\n data() {\n return {\n loading: false,\n initialized: false,\n selectedDevice: null,\n devices: {},\n }\n },\n\n methods: {\n onRefreshEvent(pluginName) {\n if (pluginName !== this.pluginName)\n return\n\n this.refresh()\n },\n\n async toggle(device, id) {\n if (id == null)\n id = device\n\n const response = await this.request(`${this.pluginName}.toggle`, {device: id})\n this.devices[device].on = response.on\n },\n\n async refresh() {\n this.loading = true\n try {\n this.devices = (await this.request(`${this.pluginName}.switch_status`)).reduce((obj, device) => {\n const name = device.name?.length ? device.name : device.id\n obj[name] = device\n return obj\n }, {})\n } finally {\n this.loading = false\n }\n }\n },\n\n mounted() {\n this.$watch(() => this.selected, (newValue) => {\n if (newValue && !this.initialized) {\n this.refresh()\n this.initialized = true\n }\n })\n\n this.bus.on('refresh', this.onRefreshEvent)\n },\n\n unmounted() {\n this.bus.off('refresh', this.onRefreshEvent)\n },\n}\n</script>\n","import script from \"./Mixin.vue?vue&type=script&lang=js\"\nexport * from \"./Mixin.vue?vue&type=script&lang=js\"\n\nconst __exports__ = script;\n\nexport default __exports__","<template>\n <div class=\"switch\" @click.stop=\"onToggle\">\n <Loading v-if=\"loading\" />\n <div class=\"name col-l-10 col-m-9 col-s-8\">\n <button v-if=\"hasInfo\" @click.prevent=\"onInfo\">\n <i class=\"fa fa-info\" />\n </button>\n <span class=\"name-content\" v-text=\"name\" />\n </div>\n <div class=\"toggler col-l-2 col-m-3 col-s-4\">\n <ToggleSwitch :disabled=\"loading\" :value=\"state\" @input=\"onToggle\" />\n </div>\n </div>\n</template>\n\n<script>\nimport ToggleSwitch from \"@/components/elements/ToggleSwitch\";\nimport Loading from \"@/components/Loading\";\n\nexport default {\n name: \"Switch\",\n components: {Loading, ToggleSwitch},\n emits: ['toggle', 'info'],\n\n props: {\n name: {\n type: String,\n required: true,\n },\n\n state: {\n type: Boolean,\n default: false,\n },\n\n loading: {\n type: Boolean,\n default: false,\n },\n\n hasInfo: {\n type: Boolean,\n default: false,\n },\n\n id: {\n type: String,\n },\n },\n\n methods: {\n onInfo(event) {\n event.stopPropagation()\n this.$emit('info')\n return false\n },\n\n onToggle(event) {\n event.stopPropagation()\n this.$emit('toggle')\n return false\n },\n }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.switch {\n width: 100%;\n display: flex;\n position: relative;\n align-items: center;\n padding: .75em .5em;\n border-bottom: $default-border-2;\n cursor: pointer;\n\n &:hover {\n background: $hover-bg;\n }\n\n .toggler {\n text-align: right;\n }\n\n button {\n background: none;\n border: none;\n\n &:hover {\n color: $default-hover-fg-2;\n }\n }\n}\n</style>\n","import { render } from \"./Switch.vue?vue&type=template&id=38eb9831&scoped=true\"\nimport script from \"./Switch.vue?vue&type=script&lang=js\"\nexport * from \"./Switch.vue?vue&type=script&lang=js\"\n\nimport \"./Switch.vue?vue&type=style&index=0&id=38eb9831&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/blacklight/git_tree/platypush/platypush/backend/http/webapp/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-38eb9831\"]])\n\nexport default __exports__","<template>\n <div class=\"switches zwave-mqtt-switches\">\n <Loading v-if=\"loading\" />\n <div class=\"no-content\" v-else-if=\"!Object.keys(devices).length\">No Z-Wave switches found.</div>\n\n <Switch :loading=\"loading\" :name=\"name\" :state=\"device.on\" :id=\"device.id\" @toggle=\"toggle(name, device.id)\"\n v-for=\"(device, name) in devices\" :key=\"name\" />\n </div>\n</template>\n\n<script>\nimport Loading from \"@/components/Loading\";\nimport SwitchMixin from \"@/components/panels/Switches/Mixin\";\nimport Switch from \"@/components/panels/Switches/Switch\";\n\nexport default {\n name: \"ZwaveMqtt\",\n components: {Switch, Loading},\n mixins: [SwitchMixin],\n}\n</script>\n\n<style lang=\"scss\" scoped>\n@import \"../common\";\n</style>\n","import { render } from \"./Index.vue?vue&type=template&id=c92e52f8&scoped=true\"\nimport script from \"./Index.vue?vue&type=script&lang=js\"\nexport * from \"./Index.vue?vue&type=script&lang=js\"\n\nimport \"./Index.vue?vue&type=style&index=0&id=c92e52f8&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/blacklight/git_tree/platypush/platypush/backend/http/webapp/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-c92e52f8\"]])\n\nexport default __exports__"],"names":["class","disabled","onInput","type","checked","value","name","emits","props","Boolean","default","methods","event","stopPropagation","this","$emit","__exports__","render","mixins","Utils","pluginName","String","required","bus","Object","config","selected","data","loading","initialized","selectedDevice","devices","onRefreshEvent","refresh","async","device","id","response","request","on","reduce","obj","length","mounted","$watch","newValue","unmounted","off","onToggle","hasInfo","onInfo","state","components","Loading","ToggleSwitch","keys","toggle","key","Switch"],"sourceRoot":""}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment