platypush/platypush/backend/http/webapp/dist/static/js/6062.7c0fec11.js

2 lines
29 KiB
JavaScript
Raw Normal View History

2023-12-30 04:39:44 +01:00
(self["webpackChunkplatypush"]=self["webpackChunkplatypush"]||[]).push([[6062],{3222:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var a=n(6252),s=n(3577);const l={class:"no-items-container"};function i(e,t,n,i,o,r){return(0,a.wg)(),(0,a.iD)("div",l,[(0,a._)("div",{class:(0,s.C_)(["no-items fade-in",{shadow:n.withShadow}])},[(0,a.WI)(e.$slots,"default",{},void 0,!0)],2)])}var o={name:"NoItems",props:{withShadow:{type:Boolean,default:!0}}},r=n(3744);const c=(0,r.Z)(o,[["render",i],["__scopeId","data-v-4856c4d7"]]);var u=c},4558:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return f}});var a=n(6252),s=n(3577),l=n(9963);const i={key:0,class:"children fade-in"};function o(e,t,n,o,r,c){const u=(0,a.up)("Entity",!0);return(0,a.wg)(),(0,a.iD)("div",{class:(0,s.C_)(["entity-container-wrapper",{"with-children":c.hasChildren,collapsed:c.isCollapsed,hidden:!e.value?.name?.length}])},[(0,a._)("div",{class:(0,s.C_)(["row item entity-container",{"with-children":c.hasChildren,collapsed:c.isCollapsed,blink:r.justUpdated}])},[(0,a._)("div",{class:(0,s.C_)(["adjuster",{"with-children":c.hasChildren}])},[((0,a.wg)(),(0,a.j4)((0,a.LL)(r.component),{value:e.value,parent:e.parent,children:e.children,loading:e.loading,ref:"instance",error:e.error||0==e.value?.reachable,onClick:c.onClick,onInput:t[0]||(t[0]=t=>e.$emit("input",t)),onLoading:t[1]||(t[1]=t=>e.$emit("loading",t))},null,40,["value","parent","children","loading","error","onClick"]))],2),c.hasChildren?((0,a.wg)(),(0,a.iD)("div",{key:0,class:"col-1 collapse-toggler",onClick:t[2]||(t[2]=(0,l.iM)(((...e)=>c.toggleCollapsed&&c.toggleCollapsed(...e)),["stop"]))},[(0,a._)("i",{class:(0,s.C_)(["fas",{"fa-chevron-down":c.isCollapsed,"fa-chevron-up":!c.isCollapsed}])},null,2)])):(0,a.kq)("",!0)],2),c.hasChildren&&!c.isCollapsed?((0,a.wg)(),(0,a.iD)("div",i,[((0,a.wg)(!0),(0,a.iD)(a.HY,null,(0,a.Ko)(e.children,(n=>((0,a.wg)(),(0,a.iD)("div",{class:"child",key:n.id},[(0,a.Wm)(u,{value:n,parent:e.value,children:c.childrenByParentId(n.id),loading:e.loading,level:e.level+1,onShowModal:t[3]||(t[3]=t=>e.$emit("show-modal",t)),onInput:t=>e.$emit("input",n)},null,8,["value","parent","children","loading","level","onInput"])])))),128))])):(0,a.kq)("",!0)],2)}var r=n(2262),c=n(847),u=n(5250),d={name:"Entity",mixins:[c["default"]],emits:["input","loading","update","show-modal"],data(){return{component:null,justUpdated:!1}},computed:{hasChildren(){return!!Object.keys(this.children||{}).length},isCollapsed(){return!this.hasChildren||this.collapsed},instance(){return this.$refs.instance}},methods:{valuesEqual(e,t){e={...e},t={...t};for(const n of["updated_at","data"])delete e[n],delete t[n];return this.objectsEqual(e,t)},childrenByParentId(e){const t=this.allEntities?.[e];return t?(t.children_ids||[]).reduce(((e,t)=>{const n=this.allEntities[t];return n&&!n.is_configuration&&(e[n.id]=n),e}),{}):{}},onClick(e){e.stopPropagation(),e.target.classList.contains("label")||e.target.classList.contains("head")?this.toggleCollapsed():this.$emit("show-modal",this.value.id)},onEntityUpdate(e){const t=e?.id,n=null!=t&&this.children&&t in this.children;n&&this.notifyUpdate()},toggleCollapsed(){this.collapsed=!this.collapsed,this.instance&&(this.instance.collapsed=!this.instance.collapsed)},notifyUpdate(){this.justUpdated=!0;const e=this;setTimeout((()=>e.justUpdated=!1),1e3)}},mounted(){if("Entity"!==this.type){const e=this.type.split("_").map((e=>e[0].toUpperCase()+e.slice(1))).join("");this.$watch((()=>this.value),((e,t)=>{if(this.valuesEqual(t,e))return!1;this.notifyUpdate(),this.$emit("update",{value:e})})),this.component=(0,r.XI)((0,a.RC)((()=>n(7243)(`./${e}`))))}u.$.onEntity(this.onEntityUpdate)}},m=n(3744);const p=(0,m.Z)(d,[["render",o],["__scopeId","data-v-7b0732e4"]]);var f=p},4967:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return f}});var a=n(6252),s=n(3577);const l=["title"],i={key:0,class:"fas fa-spinner fa-spin loading"},o={key:1,class:"fas fa-circle-exclamation error"};function r(e,t,n,r,c,u){const d=(0,a.up)("Icon");return(0,a.wg)(),(0,a.iD)("div",{class:(
2024-01-01 14:24:56 +01:00
//# sourceMappingURL=6062.7c0fec11.js.map