smarteye-e-components 0.0.36 → 0.0.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("vue");exports.RecursionDeviceGroup=void 0;(e=>{(n=>{function r(s){const l=[];for(let i=0;i<s;i++)l.push({id:"testId",pid:"",name:`device-${i}`,online:i%2==0,channels:[]});return l}function o(s){const l=[];for(let i=0;i<s;i++)l.push({id:`groupid-${i}`,name:`group-${i}`,pid:"",onlineCount:0,totalCount:0,devices:r(14),items:o(s-i-1)});return l}function a(s){const l=o(s);return l[s-1].items.push({id:"groupid-ttttttt",name:"group-ttttt",pid:"",onlineCount:0,totalCount:0,devices:[{id:"testId",pid:"",name:"999999",online:!1,channels:[]}],items:[]}),console.log(l),{name:"hah",onlineCount:0,totalCount:0,items:l}}n.RandomDeviceGroup=a})(e.Test||(e.Test={}));function t(n,r){for(let o=0;o<n.length;o++)r(n[o]),t(n[o].items,r)}(n=>{function r(o){const a={},s={};return t(o.items,l=>{a[l.id]=l;for(let i=0;i<l.devices.length;i++)s[l.devices[i].id]=l.devices[i]}),{getGroup(l){return a[l]},getDevice(l){return s[l]},foreachGroup(l){for(let i in a)l(a[i])}}}n.AccessSession=r})(e.Utils||(e.Utils={}))})(exports.RecursionDeviceGroup||(exports.RecursionDeviceGroup={}));const Hn=c.defineComponent({props:{countInfo:Object,controlParams:Object},setup(e){function t(o,a){if(a){let s=0;return a.items.forEach(l=>{s+=t(o,l)}),o(a)+s}return 0}const n=c.computed(()=>t(o=>{var a,s;if(o.devices){let l=(a=o.devices)==null?void 0:a.filter(u=>u.online);const i=(s=e.controlParams)==null?void 0:s.searchStr;return i&&(l=l.filter(u=>u.name.includes(i)||u.id.includes(i))),l.length}return 0},e.countInfo));return{totalCount:c.computed(()=>t(o=>{var a;if(o.devices){let s=o.devices;const l=(a=e.controlParams)==null?void 0:a.searchStr;return l&&(s=s.filter(i=>i.name.includes(l)||i.id.includes(l))),s.length}return o.totalCount},e.countInfo)),onlineCount:n}}});const be=(e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n},jn={class:"root"},zn={class:"count-show"};function Yn(e,t,n,r,o,a){return c.openBlock(),c.createElementBlock("div",jn,[c.renderSlot(e.$slots,"default",{total:e.totalCount,online:e.onlineCount},void 0,!0),c.createElementVNode("span",zn,c.toDisplayString(e.onlineCount)+"/"+c.toDisplayString(e.totalCount),1)])}const Ut=be(Hn,[["render",Yn],["__scopeId","data-v-a063c331"]]),$t=Object.freeze({left:0,top:0,width:16,height:16}),xt=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Ge=Object.freeze({...$t,...xt});Object.freeze({...Ge,body:"",hidden:!1});({...$t});const Wt=Object.freeze({width:null,height:null}),Gt=Object.freeze({...Wt,...xt});function Kn(e,t){const n={...e};for(const r in t){const o=t[r],a=typeof o;r in Wt?(o===null||o&&(a==="string"||a==="number"))&&(n[r]=o):a===typeof n[r]&&(n[r]=r==="rotate"?o%4:o)}return n}const Xn=/[\s,]+/;function Qn(e,t){t.split(Xn).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function Jn(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(o){for(;o<0;)o+=4;return o%4}if(n===""){const o=parseInt(e);return isNaN(o)?0:r(o)}else if(n!==e){let o=0;switch(n){case"%":o=25;break;case"deg":o=90}if(o){let a=parseFloat(e.slice(0,e.length-n.length));return isNaN(a)?0:(a=a/o,a%1===0?r(a):0)}}return t}const qn=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Zn=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function tt(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const r=e.split(qn);if(r===null||!r.length)return e;const o=[];let a=r.shift(),s=Zn.test(a);for(;;){if(s){const l=parseFloat(a);isNaN(l)?o.push(a):o.push(Math.ceil(l*t*n)/n)}else o.push(a);if(a=r.shift(),a===void 0)return o.join("");s=!s}}function eo(e,t){const n={...Ge,...e},r={...Gt,...t},o={left:n.left,top:n.top,width:n.width,height:n.height};let a=n.body;[n,r].forEach(p=>{const v=[],b=p.hFlip,N=p.vFlip;let T=p.rotate;b?N?T+=2:(v.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),v.push("scale(-1 1)"),o.top=o.left=0):N&&(v.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),v.push("scale(1 -1)"),o.top=o.left=0);let O;switch(T<0&&(T-=Math.floor(T/4)*4),T=T%4,T){case 1:O=o.height/2+o.top,v.unshift("rotate(90 "+O.toString()+" "+O.toString()+")");break;case 2:v.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:O=o.width/2+o.left,v.unshift("rotate(-90 "+O.toString()+" "+O.toString()+")");break}T%2===1&&(o.left!==o.top&&(O=o.left,o.left=o.top,o.top=O),o.width!==o.height&&(O=o.width,o.width=o.height,o.height=O)),v.length&&(a='<g transform="'+v.join(" ")+'">'+a+"</g>")});const s=r.width,l=r.height,i=o.width,u=o.height;let m,d;return s===null?(d=l===null?"1em":l==="auto"?u:l,m=tt(d,i/u)):(m=s==="auto"?i:s,d=l===null?tt(m,u/i):l==="auto"?u:l),{attributes:{width:m.toString(),height:d.toString(),viewBox:o.left.toString()+" "+o.top.toString()+" "+i.toString()+" "+u.toString()},body:a}}const to=/\sid="(\S+)"/g,no="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let oo=0;function ro(e,t=no){const n=[];let r;for(;r=to.exec(e);)n.push(r[1]);return n.length&&n.forEach(o=>{const a=typeof t=="function"?t(o):t+(oo++).toString(),s=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+s+')([")]|\\.[a-z])',"g"),"$1"+a+"$3")}),e}function so(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in t)n+=" "+r+'="'+t[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+e+"</svg>"}function ao(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function lo(e){return'url("data:image/svg+xml,'+ao(e)+'")'}const nt={...Gt,inline:!1},io={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},co={display:"inline-block"},Ae={backgroundColor:"currentColor"},Bt={backgroundColor:"transparent"},ot={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},rt={webkitMask:Ae,mask:Ae,background:Bt};for(const e in rt){const t=rt[e];for(const n in ot)t[e+n]=ot[n]}const Ee={};["horizontal","vertical"].forEach(e=>{const t=e.slice(0,1)+"Flip";Ee[e+"-flip"]=t,Ee[e.slice(0,1)+"-flip"]=t,Ee[e+"Flip"]=t});function st(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const uo=(e,t)=>{const n=Kn(nt,t),r={...io},o=t.mode||"svg",a={},s=t.style,l=typeof s=="object"&&!(s instanceof Array)?s:{};for(let b in t){const N=t[b];if(N!==void 0)switch(b){case"icon":case"style":case"onLoad":case"mode":break;case"inline":case"hFlip":case"vFlip":n[b]=N===!0||N==="true"||N===1;break;case"flip":typeof N=="string"&&Qn(n,N);break;case"color":a.color=N;break;case"rotate":typeof N=="string"?n[b]=Jn(N):typeof N=="number"&&(n[b]=N);break;case"ariaHidden":case"aria-hidden":N!==!0&&N!=="true"&&delete r["aria-hidden"];break;default:{const T=Ee[b];T?(N===!0||N==="true"||N===1)&&(n[T]=!0):nt[b]===void 0&&(r[b]=N)}}}const i=eo(e,n),u=i.attributes;if(n.inline&&(a.verticalAlign="-0.125em"),o==="svg"){r.style={...a,...l},Object.assign(r,u);let b=0,N=t.id;return typeof N=="string"&&(N=N.replace(/-/g,"_")),r.innerHTML=ro(i.body,N?()=>N+"ID"+b++:"iconifyVue"),c.h("svg",r)}const{body:m,width:d,height:_}=e,p=o==="mask"||(o==="bg"?!1:m.indexOf("currentColor")!==-1),v=so(m,{...u,width:d+"",height:_+""});return r.style={...a,"--svg":lo(v),width:st(u.width),height:st(u.height),...co,...p?Ae:Bt,...l},c.h("span",r)},Ht=Object.create(null);function ie(e,t){Ht[e]=t}const fo=c.defineComponent({inheritAttrs:!1,render(){const e=this.$attrs,t=e.icon,n=typeof t=="string"?Ht[t]:typeof t=="object"?t:null;return n===null||typeof n!="object"||typeof n.body!="string"?this.$slots.default?this.$slots.default():null:uo({...Ge,...n},e)}});var mo=Object.defineProperty,_o=Object.defineProperties,go=Object.getOwnPropertyDescriptors,at=Object.getOwnPropertySymbols,po=Object.prototype.hasOwnProperty,ho=Object.prototype.propertyIsEnumerable,lt=(e,t,n)=>t in e?mo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,it=(e,t)=>{for(var n in t||(t={}))po.call(t,n)&<(e,n,t[n]);if(at)for(var n of at(t))ho.call(t,n)&<(e,n,t[n]);return e},Eo=(e,t)=>_o(e,go(t)),vo=(e,t,n)=>new Promise((r,o)=>{var a=i=>{try{l(n.next(i))}catch(u){o(u)}},s=i=>{try{l(n.throw(i))}catch(u){o(u)}},l=i=>i.done?r(i.value):Promise.resolve(i.value).then(a,s);l((n=n.apply(e,t)).next())});const No={name:"VirtualList",props:{listData:{type:Object,default:()=>[]},itemSize:{type:Number,default:200}},setup(e){const t={screenHeight:c.ref(0),startOffset:c.ref(0),start:c.ref(0),end:c.ref(0)},n=c.ref(),r={listHeight:c.computed(()=>e.listData.length*e.itemSize),visibleCount:c.computed(()=>Math.ceil(t.screenHeight.value/e.itemSize)),getTransform:c.computed(()=>`translate3d(0,${t.startOffset.value}px,0)`),visibleData:c.computed(()=>e.listData.slice(t.start.value,Math.min(t.end.value,e.listData.length)))};return it(Eo(it({},r),{virList:n}),t)},mounted(){this.init(),c.watch(()=>this.listData.length,()=>vo(this,null,function*(){yield this.$nextTick(),this.init()}))},methods:{init(){this.screenHeight=this.$el.clientHeight,this.screenHeight==0&&(this.screenHeight=400),this.start=0,this.end=this.start+this.visibleCount},scrollEvent(){if(this.virList){let e=this.virList.scrollTop;this.start=Math.floor(e/this.itemSize),this.end=this.start+this.visibleCount,this.startOffset=e-e%this.itemSize}}}};function bo(e,t,n,r,o,a){return c.openBlock(),c.createElementBlock("div",{ref:"virList",class:"infinite-list-container",onScroll:t[0]||(t[0]=s=>a.scrollEvent())},[c.createElementVNode("div",{class:"infinite-list-phantom",style:c.normalizeStyle({height:e.listHeight+"px"})},null,4),c.createElementVNode("div",{class:"infinite-list",style:c.normalizeStyle({transform:e.getTransform})},[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(e.visibleData,s=>(c.openBlock(),c.createElementBlock("div",{ref_for:!0,ref:"items",class:"infinite-list-item",key:s.id,style:c.normalizeStyle({height:n.itemSize+"px",lineHeight:n.itemSize+"px"})},[c.renderSlot(e.$slots,"default",{data:s},void 0,!0)],4))),128))],4)],544)}const Oo=be(No,[["render",bo],["__scopeId","data-v-12d2a294"]]);var To=Object.defineProperty,Io=Object.defineProperties,So=Object.getOwnPropertyDescriptors,ct=Object.getOwnPropertySymbols,Lo=Object.prototype.hasOwnProperty,yo=Object.prototype.propertyIsEnumerable,ut=(e,t,n)=>t in e?To(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Do=(e,t)=>{for(var n in t||(t={}))Lo.call(t,n)&&ut(e,n,t[n]);if(ct)for(var n of ct(t))yo.call(t,n)&&ut(e,n,t[n]);return e},Co=(e,t)=>Io(e,So(t));const Ao=c.defineComponent({components:{VirtualList:Oo,CountShow:Ut,Icon:fo},name:"group-show",props:{deviceGroup:Object,controlParams:Object},setup(e,t){const n=c.ref(),r=c.inject("theme"),o={filterDevice(m){var d,_,p,v;let b=!0;(d=e.controlParams)!=null&&d.searchStr&&(b=m.name.indexOf((_=e.controlParams)==null?void 0:_.searchStr)>=0||m.id.indexOf((p=e.controlParams)==null?void 0:p.searchStr)>=0);let N=!0;return(v=e.controlParams)!=null&&v.onlyShowOnline&&(N=m.online),b&&N},deviceText(m){return m.user?m.name.length>0?`${m.user} [${m.id}] [${m.name}]`:`${m.user} [${m.id}] []`:m.name.length>0?`${m.name} [${m.id}]`:` [${m.id}]`},groupText(m){if(m)return m.name.length>0?m.name:m.id}},a={filteredDevices:c.computed(()=>{var m;const d=(m=e.deviceGroup)==null?void 0:m.devices,_=d&&d.filter(v=>o.filterDevice(v))||[];return _.filter(v=>v.online).concat(_.filter(v=>!v.online))})},s=c.computed(()=>a.filteredDevices.value.length>10?"400px":`${a.filteredDevices.value.length*40}px`);function l(m,d){if(d.length==0)return!0;let _=!1;if((m==null?void 0:m.name.indexOf(d))>0&&(_=!0),_||(_=(m==null?void 0:m.devices.find(p=>p.name.indexOf(d)>=0||p.id.indexOf(d)>=0))!=null),!_){for(let p=0;p<m.items.length;p++)if(l(m.items[p],d))return!0}return _}const i=c.computed(()=>{if(e.controlParams){const m=e.controlParams.searchStr;if(e.deviceGroup)return l(e.deviceGroup,m)}return!1}),u=c.ref(!1);return Co(Do({innerUtils:o},a),{devicePanelHeight:s,showGroup:i,bShow:u,theme:r,countRef:n})}});const wo={key:0,class:"head-op"},Po={key:1,style:{display:"inline-block",width:"25px"}},ko={key:0,class:"group-head-count"},Ro=["title"],Fo={class:"group-slot"},Vo={key:0,style:{"margin-left":"26px"}},Mo=["title"],Uo={class:"device-slot"};function $o(e,t,n,r,o,a){var s;const l=c.resolveComponent("Icon"),i=c.resolveComponent("CountShow"),u=c.resolveComponent("group-show"),m=c.resolveComponent("VirtualList");return e.showGroup?(c.openBlock(),c.createElementBlock("div",{key:0,class:c.normalizeClass("group "+e.theme)},[c.createVNode(i,{countInfo:e.deviceGroup,controlParams:e.controlParams,ref:"countRef"},{default:c.withCtx(({online:d,total:_})=>{var p,v;return[e.deviceGroup&&e.deviceGroup.devices.length+e.deviceGroup.items.length>0?(c.openBlock(),c.createElementBlock("span",wo,[c.createVNode(l,{icon:e.bShow?"minus":"plus",width:"20",onClick:t[0]||(t[0]=b=>e.bShow=!e.bShow),class:"handle-ls-svg"},null,8,["icon"])])):(c.openBlock(),c.createElementBlock("span",Po)),c.createElementVNode("span",{class:"group-head-db-click",onDblclick:t[1]||(t[1]=b=>e.bShow=!e.bShow)},[c.createVNode(l,{icon:e.bShow?"group":"group-closed",width:"24",class:"group-avatar"},null,8,["icon"]),e.bShow?c.createCommentVNode("",!0):(c.openBlock(),c.createElementBlock("span",ko,c.toDisplayString((p=e.deviceGroup)==null?void 0:p.items.length),1)),c.createElementVNode("span",{class:"group-name",title:(v=e.deviceGroup)==null?void 0:v.name},c.toDisplayString(e.innerUtils.groupText(e.deviceGroup)),9,Ro)],32),c.createElementVNode("div",Fo,[c.renderSlot(e.$slots,"group",{group:e.deviceGroup},void 0,!0)])]}),_:3},8,["countInfo","controlParams"]),e.bShow?(c.openBlock(),c.createElementBlock("div",Vo,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList((s=e.deviceGroup)==null?void 0:s.items,(d,_)=>(c.openBlock(),c.createBlock(u,{key:_,deviceGroup:d,controlParams:e.controlParams},{group:c.withCtx(({group:p})=>[c.renderSlot(e.$slots,"group",{group:p},void 0,!0)]),device:c.withCtx(({device:p,group:v})=>[c.renderSlot(e.$slots,"device",{device:p,group:v},void 0,!0)]),_:2},1032,["deviceGroup","controlParams"]))),128)),c.createElementVNode("div",{class:"device-show-div",style:c.normalizeStyle(`height: ${e.filteredDevices.length>10?"400px":`${e.filteredDevices.length*40}px`}`)},[c.createVNode(m,{"list-data":e.filteredDevices,"item-size":40},{default:c.withCtx(({data:d})=>[c.createElementVNode("div",{class:c.normalizeClass(d.online&&"online-device")},[c.createVNode(l,{icon:"user",width:"16",class:"device-avatar"}),c.createElementVNode("span",{title:e.innerUtils.deviceText(d),class:"device-name"},c.toDisplayString(e.innerUtils.deviceText(d)),9,Mo),c.createElementVNode("div",Uo,[c.renderSlot(e.$slots,"device",{device:d,group:e.deviceGroup},void 0,!0)])],2)]),_:3},8,["list-data"])],4)])):c.createCommentVNode("",!0)],2)):c.createCommentVNode("",!0)}const xo=be(Ao,[["render",$o],["__scopeId","data-v-da25b40e"]]),Wo={width:1024,height:1024,body:'<path fill="currentColor" d="M384 192v640l384-320.064z"/>'},Go={width:1024,height:1024,body:'<path fill="currentColor" d="M878.08 448H241.92l-96 384h636.16l96-384zM832 384v-64H485.76L357.504 192H128v448l57.92-231.744A32 32 0 0 1 216.96 384H832zm-24.96 512H96a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h287.872l128.384 128H864a32 32 0 0 1 32 32v96h23.04a32 32 0 0 1 31.04 39.744l-112 448A32 32 0 0 1 807.04 896z"/>'},Bo={width:1024,height:1024,body:'<path fill="currentColor" d="M128 192v640h768V320H485.76L357.504 192H128zm-32-64h287.872l128.384 128H928a32 32 0 0 1 32 32v576a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32z"/>'},Ho={width:1024,height:1024,body:'<path fill="currentColor" d="M628.736 528.896A416 416 0 0 1 928 928H96a415.872 415.872 0 0 1 299.264-399.104L512 704l116.736-175.104zM720 304a208 208 0 1 1-416 0a208 208 0 0 1 416 0z"/>'},jo={width:1024,height:1024,body:'<path fill="currentColor" d="M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64h352z"/>'},zo={width:1024,height:1024,body:'<path fill="currentColor" d="M128 544h768a32 32 0 1 0 0-64H128a32 32 0 0 0 0 64z"/>'};/*!
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("vue");exports.RecursionDeviceGroup=void 0;(e=>{(n=>{function r(s){const l=[];for(let i=0;i<s;i++)l.push({id:"testId",pid:"",name:`device-${i}`,online:i%2==0,channels:[]});return l}function o(s){const l=[];for(let i=0;i<s;i++)l.push({id:`groupid-${i}`,name:`group-${i}`,pid:"",onlineCount:0,totalCount:0,devices:r(14),items:o(s-i-1)});return l}function a(s){const l=o(s);return l[s-1].items.push({id:"groupid-ttttttt",name:"group-ttttt",pid:"",onlineCount:0,totalCount:0,devices:[{id:"testId",pid:"",name:"999999",online:!1,channels:[]}],items:[]}),console.log(l),{name:"hah",onlineCount:0,totalCount:0,items:l}}n.RandomDeviceGroup=a})(e.Test||(e.Test={}));function t(n,r){for(let o=0;o<n.length;o++)r(n[o]),t(n[o].items,r)}(n=>{function r(o){const a={},s={};return t(o.items,l=>{a[l.id]=l;for(let i=0;i<l.devices.length;i++)s[l.devices[i].id]=l.devices[i]}),{getGroup(l){return a[l]},getDevice(l){return s[l]},foreachGroup(l){for(let i in a)l(a[i])}}}n.AccessSession=r})(e.Utils||(e.Utils={}))})(exports.RecursionDeviceGroup||(exports.RecursionDeviceGroup={}));const Hn=c.defineComponent({props:{countInfo:Object,controlParams:Object},setup(e){function t(o,a){if(a){let s=0;return a.items.forEach(l=>{s+=t(o,l)}),o(a)+s}return 0}const n=c.computed(()=>t(o=>{var a,s;if(o.devices){let l=(a=o.devices)==null?void 0:a.filter(u=>u.online);const i=(s=e.controlParams)==null?void 0:s.searchStr;return i&&(l=l.filter(u=>u.name.includes(i)||u.id.includes(i))),l.length}return 0},e.countInfo));return{totalCount:c.computed(()=>t(o=>{var a;if(o.devices){let s=o.devices;const l=(a=e.controlParams)==null?void 0:a.searchStr;return l&&(s=s.filter(i=>i.name.includes(l)||i.id.includes(l))),s.length}return o.totalCount},e.countInfo)),onlineCount:n}}});const be=(e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n},jn={class:"root"},zn={class:"count-show"};function Yn(e,t,n,r,o,a){return c.openBlock(),c.createElementBlock("div",jn,[c.renderSlot(e.$slots,"default",{total:e.totalCount,online:e.onlineCount},void 0,!0),c.createElementVNode("span",zn,c.toDisplayString(e.onlineCount)+"/"+c.toDisplayString(e.totalCount),1)])}const Ut=be(Hn,[["render",Yn],["__scopeId","data-v-a063c331"]]),$t=Object.freeze({left:0,top:0,width:16,height:16}),xt=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Ge=Object.freeze({...$t,...xt});Object.freeze({...Ge,body:"",hidden:!1});({...$t});const Wt=Object.freeze({width:null,height:null}),Gt=Object.freeze({...Wt,...xt});function Kn(e,t){const n={...e};for(const r in t){const o=t[r],a=typeof o;r in Wt?(o===null||o&&(a==="string"||a==="number"))&&(n[r]=o):a===typeof n[r]&&(n[r]=r==="rotate"?o%4:o)}return n}const Xn=/[\s,]+/;function Qn(e,t){t.split(Xn).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function Jn(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(o){for(;o<0;)o+=4;return o%4}if(n===""){const o=parseInt(e);return isNaN(o)?0:r(o)}else if(n!==e){let o=0;switch(n){case"%":o=25;break;case"deg":o=90}if(o){let a=parseFloat(e.slice(0,e.length-n.length));return isNaN(a)?0:(a=a/o,a%1===0?r(a):0)}}return t}const qn=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Zn=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function tt(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const r=e.split(qn);if(r===null||!r.length)return e;const o=[];let a=r.shift(),s=Zn.test(a);for(;;){if(s){const l=parseFloat(a);isNaN(l)?o.push(a):o.push(Math.ceil(l*t*n)/n)}else o.push(a);if(a=r.shift(),a===void 0)return o.join("");s=!s}}function eo(e,t){const n={...Ge,...e},r={...Gt,...t},o={left:n.left,top:n.top,width:n.width,height:n.height};let a=n.body;[n,r].forEach(p=>{const v=[],b=p.hFlip,N=p.vFlip;let T=p.rotate;b?N?T+=2:(v.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),v.push("scale(-1 1)"),o.top=o.left=0):N&&(v.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),v.push("scale(1 -1)"),o.top=o.left=0);let O;switch(T<0&&(T-=Math.floor(T/4)*4),T=T%4,T){case 1:O=o.height/2+o.top,v.unshift("rotate(90 "+O.toString()+" "+O.toString()+")");break;case 2:v.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:O=o.width/2+o.left,v.unshift("rotate(-90 "+O.toString()+" "+O.toString()+")");break}T%2===1&&(o.left!==o.top&&(O=o.left,o.left=o.top,o.top=O),o.width!==o.height&&(O=o.width,o.width=o.height,o.height=O)),v.length&&(a='<g transform="'+v.join(" ")+'">'+a+"</g>")});const s=r.width,l=r.height,i=o.width,u=o.height;let m,d;return s===null?(d=l===null?"1em":l==="auto"?u:l,m=tt(d,i/u)):(m=s==="auto"?i:s,d=l===null?tt(m,u/i):l==="auto"?u:l),{attributes:{width:m.toString(),height:d.toString(),viewBox:o.left.toString()+" "+o.top.toString()+" "+i.toString()+" "+u.toString()},body:a}}const to=/\sid="(\S+)"/g,no="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let oo=0;function ro(e,t=no){const n=[];let r;for(;r=to.exec(e);)n.push(r[1]);return n.length&&n.forEach(o=>{const a=typeof t=="function"?t(o):t+(oo++).toString(),s=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+s+')([")]|\\.[a-z])',"g"),"$1"+a+"$3")}),e}function so(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in t)n+=" "+r+'="'+t[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+e+"</svg>"}function ao(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function lo(e){return'url("data:image/svg+xml,'+ao(e)+'")'}const nt={...Gt,inline:!1},io={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},co={display:"inline-block"},Ae={backgroundColor:"currentColor"},Bt={backgroundColor:"transparent"},ot={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},rt={webkitMask:Ae,mask:Ae,background:Bt};for(const e in rt){const t=rt[e];for(const n in ot)t[e+n]=ot[n]}const Ee={};["horizontal","vertical"].forEach(e=>{const t=e.slice(0,1)+"Flip";Ee[e+"-flip"]=t,Ee[e.slice(0,1)+"-flip"]=t,Ee[e+"Flip"]=t});function st(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const uo=(e,t)=>{const n=Kn(nt,t),r={...io},o=t.mode||"svg",a={},s=t.style,l=typeof s=="object"&&!(s instanceof Array)?s:{};for(let b in t){const N=t[b];if(N!==void 0)switch(b){case"icon":case"style":case"onLoad":case"mode":break;case"inline":case"hFlip":case"vFlip":n[b]=N===!0||N==="true"||N===1;break;case"flip":typeof N=="string"&&Qn(n,N);break;case"color":a.color=N;break;case"rotate":typeof N=="string"?n[b]=Jn(N):typeof N=="number"&&(n[b]=N);break;case"ariaHidden":case"aria-hidden":N!==!0&&N!=="true"&&delete r["aria-hidden"];break;default:{const T=Ee[b];T?(N===!0||N==="true"||N===1)&&(n[T]=!0):nt[b]===void 0&&(r[b]=N)}}}const i=eo(e,n),u=i.attributes;if(n.inline&&(a.verticalAlign="-0.125em"),o==="svg"){r.style={...a,...l},Object.assign(r,u);let b=0,N=t.id;return typeof N=="string"&&(N=N.replace(/-/g,"_")),r.innerHTML=ro(i.body,N?()=>N+"ID"+b++:"iconifyVue"),c.h("svg",r)}const{body:m,width:d,height:_}=e,p=o==="mask"||(o==="bg"?!1:m.indexOf("currentColor")!==-1),v=so(m,{...u,width:d+"",height:_+""});return r.style={...a,"--svg":lo(v),width:st(u.width),height:st(u.height),...co,...p?Ae:Bt,...l},c.h("span",r)},Ht=Object.create(null);function ie(e,t){Ht[e]=t}const fo=c.defineComponent({inheritAttrs:!1,render(){const e=this.$attrs,t=e.icon,n=typeof t=="string"?Ht[t]:typeof t=="object"?t:null;return n===null||typeof n!="object"||typeof n.body!="string"?this.$slots.default?this.$slots.default():null:uo({...Ge,...n},e)}});var mo=Object.defineProperty,_o=Object.defineProperties,go=Object.getOwnPropertyDescriptors,at=Object.getOwnPropertySymbols,po=Object.prototype.hasOwnProperty,ho=Object.prototype.propertyIsEnumerable,lt=(e,t,n)=>t in e?mo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,it=(e,t)=>{for(var n in t||(t={}))po.call(t,n)&<(e,n,t[n]);if(at)for(var n of at(t))ho.call(t,n)&<(e,n,t[n]);return e},Eo=(e,t)=>_o(e,go(t)),vo=(e,t,n)=>new Promise((r,o)=>{var a=i=>{try{l(n.next(i))}catch(u){o(u)}},s=i=>{try{l(n.throw(i))}catch(u){o(u)}},l=i=>i.done?r(i.value):Promise.resolve(i.value).then(a,s);l((n=n.apply(e,t)).next())});const No={name:"VirtualList",props:{listData:{type:Object,default:()=>[]},itemSize:{type:Number,default:200}},setup(e){const t={screenHeight:c.ref(0),startOffset:c.ref(0),start:c.ref(0),end:c.ref(0)},n=c.ref(),r={listHeight:c.computed(()=>e.listData.length*e.itemSize),visibleCount:c.computed(()=>Math.ceil(t.screenHeight.value/e.itemSize)),getTransform:c.computed(()=>`translate3d(0,${t.startOffset.value}px,0)`),visibleData:c.computed(()=>e.listData.slice(t.start.value,Math.min(t.end.value,e.listData.length)))};return it(Eo(it({},r),{virList:n}),t)},mounted(){this.init(),c.watch(()=>this.listData.length,()=>vo(this,null,function*(){yield this.$nextTick(),this.init()}))},methods:{init(){this.screenHeight=this.$el.clientHeight,this.screenHeight==0&&(this.screenHeight=400),this.start=0,this.end=this.start+this.visibleCount},scrollEvent(){if(this.virList){let e=this.virList.scrollTop;this.start=Math.floor(e/this.itemSize),this.end=this.start+this.visibleCount,this.startOffset=e-e%this.itemSize}}}};function bo(e,t,n,r,o,a){return c.openBlock(),c.createElementBlock("div",{ref:"virList",class:"infinite-list-container",onScroll:t[0]||(t[0]=s=>a.scrollEvent())},[c.createElementVNode("div",{class:"infinite-list-phantom",style:c.normalizeStyle({height:e.listHeight+"px"})},null,4),c.createElementVNode("div",{class:"infinite-list",style:c.normalizeStyle({transform:e.getTransform})},[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(e.visibleData,s=>(c.openBlock(),c.createElementBlock("div",{ref_for:!0,ref:"items",class:"infinite-list-item",key:s.id,style:c.normalizeStyle({height:n.itemSize+"px",lineHeight:n.itemSize+"px"})},[c.renderSlot(e.$slots,"default",{data:s},void 0,!0)],4))),128))],4)],544)}const Oo=be(No,[["render",bo],["__scopeId","data-v-12d2a294"]]);var To=Object.defineProperty,Io=Object.defineProperties,So=Object.getOwnPropertyDescriptors,ct=Object.getOwnPropertySymbols,Lo=Object.prototype.hasOwnProperty,yo=Object.prototype.propertyIsEnumerable,ut=(e,t,n)=>t in e?To(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Do=(e,t)=>{for(var n in t||(t={}))Lo.call(t,n)&&ut(e,n,t[n]);if(ct)for(var n of ct(t))yo.call(t,n)&&ut(e,n,t[n]);return e},Co=(e,t)=>Io(e,So(t));const Ao=c.defineComponent({components:{VirtualList:Oo,CountShow:Ut,Icon:fo},name:"group-show",props:{deviceGroup:Object,controlParams:Object},setup(e,t){const n=c.ref(),r=c.inject("theme"),o={filterDevice(m){var d,_,p,v;let b=!0;(d=e.controlParams)!=null&&d.searchStr&&(b=m.name.indexOf((_=e.controlParams)==null?void 0:_.searchStr)>=0||m.id.indexOf((p=e.controlParams)==null?void 0:p.searchStr)>=0);let N=!0;return(v=e.controlParams)!=null&&v.onlyShowOnline&&(N=m.online),b&&N},deviceText(m){return m.user?m.name.length>0?`${m.user} [${m.id}] [${m.name}]`:`${m.user} [${m.id}] []`:m.name.length>0?`${m.name} [${m.id}]`:` [${m.id}]`},groupText(m){if(m)return m.name.length>0?m.name:m.id}},a={filteredDevices:c.computed(()=>{var m;const d=(m=e.deviceGroup)==null?void 0:m.devices,_=d&&d.filter(v=>o.filterDevice(v))||[];return _.filter(v=>v.online).concat(_.filter(v=>!v.online))})},s=c.computed(()=>a.filteredDevices.value.length>10?"400px":`${a.filteredDevices.value.length*40}px`);function l(m,d){if(d.length==0)return!0;let _=!1;if((m==null?void 0:m.name.indexOf(d))>0&&(_=!0),_||(_=(m==null?void 0:m.devices.find(p=>p.name.indexOf(d)>=0||p.id.indexOf(d)>=0||p.user&&p.user.indexOf(d)>=0))!=null),!_){for(let p=0;p<m.items.length;p++)if(l(m.items[p],d))return!0}return _}const i=c.computed(()=>{if(e.controlParams){const m=e.controlParams.searchStr;if(e.deviceGroup)return l(e.deviceGroup,m)}return!1}),u=c.ref(!1);return Co(Do({innerUtils:o},a),{devicePanelHeight:s,showGroup:i,bShow:u,theme:r,countRef:n})}});const wo={key:0,class:"head-op"},Po={key:1,style:{display:"inline-block",width:"25px"}},ko={key:0,class:"group-head-count"},Ro=["title"],Fo={class:"group-slot"},Vo={key:0,style:{"margin-left":"26px"}},Mo=["title"],Uo={class:"device-slot"};function $o(e,t,n,r,o,a){var s;const l=c.resolveComponent("Icon"),i=c.resolveComponent("CountShow"),u=c.resolveComponent("group-show"),m=c.resolveComponent("VirtualList");return e.showGroup?(c.openBlock(),c.createElementBlock("div",{key:0,class:c.normalizeClass("group "+e.theme)},[c.createVNode(i,{countInfo:e.deviceGroup,controlParams:e.controlParams,ref:"countRef"},{default:c.withCtx(({online:d,total:_})=>{var p,v;return[e.deviceGroup&&e.deviceGroup.devices.length+e.deviceGroup.items.length>0?(c.openBlock(),c.createElementBlock("span",wo,[c.createVNode(l,{icon:e.bShow?"minus":"plus",width:"20",onClick:t[0]||(t[0]=b=>e.bShow=!e.bShow),class:"handle-ls-svg"},null,8,["icon"])])):(c.openBlock(),c.createElementBlock("span",Po)),c.createElementVNode("span",{class:"group-head-db-click",onDblclick:t[1]||(t[1]=b=>e.bShow=!e.bShow)},[c.createVNode(l,{icon:e.bShow?"group":"group-closed",width:"24",class:"group-avatar"},null,8,["icon"]),e.bShow?c.createCommentVNode("",!0):(c.openBlock(),c.createElementBlock("span",ko,c.toDisplayString((p=e.deviceGroup)==null?void 0:p.items.length),1)),c.createElementVNode("span",{class:"group-name",title:(v=e.deviceGroup)==null?void 0:v.name},c.toDisplayString(e.innerUtils.groupText(e.deviceGroup)),9,Ro)],32),c.createElementVNode("div",Fo,[c.renderSlot(e.$slots,"group",{group:e.deviceGroup},void 0,!0)])]}),_:3},8,["countInfo","controlParams"]),e.bShow?(c.openBlock(),c.createElementBlock("div",Vo,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList((s=e.deviceGroup)==null?void 0:s.items,(d,_)=>(c.openBlock(),c.createBlock(u,{key:_,deviceGroup:d,controlParams:e.controlParams},{group:c.withCtx(({group:p})=>[c.renderSlot(e.$slots,"group",{group:p},void 0,!0)]),device:c.withCtx(({device:p,group:v})=>[c.renderSlot(e.$slots,"device",{device:p,group:v},void 0,!0)]),_:2},1032,["deviceGroup","controlParams"]))),128)),c.createElementVNode("div",{class:"device-show-div",style:c.normalizeStyle(`height: ${e.filteredDevices.length>10?"400px":`${e.filteredDevices.length*40}px`}`)},[c.createVNode(m,{"list-data":e.filteredDevices,"item-size":40},{default:c.withCtx(({data:d})=>[c.createElementVNode("div",{class:c.normalizeClass(d.online&&"online-device")},[c.createVNode(l,{icon:"user",width:"16",class:"device-avatar"}),c.createElementVNode("span",{title:e.innerUtils.deviceText(d),class:"device-name"},c.toDisplayString(e.innerUtils.deviceText(d)),9,Mo),c.createElementVNode("div",Uo,[c.renderSlot(e.$slots,"device",{device:d,group:e.deviceGroup},void 0,!0)])],2)]),_:3},8,["list-data"])],4)])):c.createCommentVNode("",!0)],2)):c.createCommentVNode("",!0)}const xo=be(Ao,[["render",$o],["__scopeId","data-v-38529838"]]),Wo={width:1024,height:1024,body:'<path fill="currentColor" d="M384 192v640l384-320.064z"/>'},Go={width:1024,height:1024,body:'<path fill="currentColor" d="M878.08 448H241.92l-96 384h636.16l96-384zM832 384v-64H485.76L357.504 192H128v448l57.92-231.744A32 32 0 0 1 216.96 384H832zm-24.96 512H96a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h287.872l128.384 128H864a32 32 0 0 1 32 32v96h23.04a32 32 0 0 1 31.04 39.744l-112 448A32 32 0 0 1 807.04 896z"/>'},Bo={width:1024,height:1024,body:'<path fill="currentColor" d="M128 192v640h768V320H485.76L357.504 192H128zm-32-64h287.872l128.384 128H928a32 32 0 0 1 32 32v576a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32z"/>'},Ho={width:1024,height:1024,body:'<path fill="currentColor" d="M628.736 528.896A416 416 0 0 1 928 928H96a415.872 415.872 0 0 1 299.264-399.104L512 704l116.736-175.104zM720 304a208 208 0 1 1-416 0a208 208 0 0 1 416 0z"/>'},jo={width:1024,height:1024,body:'<path fill="currentColor" d="M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64h352z"/>'},zo={width:1024,height:1024,body:'<path fill="currentColor" d="M128 544h768a32 32 0 1 0 0-64H128a32 32 0 0 0 0 64z"/>'};/*!
|
|
2
2
|
* shared v9.2.2
|
|
3
3
|
* (c) 2022 kazuya kawaguchi
|
|
4
4
|
* Released under the MIT License.
|