smarteye-e-components 0.0.24 → 0.0.26

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,118 +1,134 @@
1
- import { defineComponent as F, computed as M, openBlock as f, createElementBlock as b, renderSlot as y, createElementVNode as _, toDisplayString as O, h as L, inject as te, ref as z, resolveComponent as $, normalizeClass as B, createVNode as I, withCtx as C, createBlock as P, createCommentVNode as j, Fragment as H, renderList as A, provide as oe, pushScopeId as ne, popScopeId as se } from "vue";
2
- var N;
1
+ import { defineComponent as H, computed as k, openBlock as m, createElementBlock as S, renderSlot as $, createElementVNode as g, toDisplayString as j, h as L, ref as b, normalizeStyle as D, Fragment as E, renderList as F, inject as se, resolveComponent as C, normalizeClass as x, createVNode as O, withCtx as P, createBlock as Y, createCommentVNode as V, provide as le, pushScopeId as ae, popScopeId as ce } from "vue";
2
+ var A;
3
3
  ((e) => {
4
- ((o) => {
5
- function s(a) {
4
+ ((t) => {
5
+ function s(l) {
6
6
  const i = [];
7
- for (let l = 0; l < a; l++)
7
+ for (let a = 0; a < l; a++)
8
8
  i.push({
9
9
  id: "testId",
10
10
  pid: "",
11
- name: `device-${l}`,
12
- online: l % 2 == 0,
11
+ name: `device-${a}`,
12
+ online: a % 2 == 0,
13
13
  channels: []
14
14
  });
15
15
  return i;
16
16
  }
17
- function t(a) {
17
+ function o(l) {
18
18
  const i = [];
19
- for (let l = 0; l < a; l++)
19
+ for (let a = 0; a < l; a++)
20
20
  i.push({
21
- id: `groupid-${l}`,
22
- name: `group-${l}`,
21
+ id: `groupid-${a}`,
22
+ name: `group-${a}`,
23
23
  pid: "",
24
24
  onlineCount: 0,
25
25
  totalCount: 0,
26
- devices: s(10),
27
- items: t(a - l - 1)
26
+ devices: s(4),
27
+ items: o(l - a - 1)
28
28
  });
29
29
  return i;
30
30
  }
31
- function r(a) {
31
+ function r(l) {
32
32
  return {
33
33
  name: "hah",
34
34
  onlineCount: 0,
35
35
  totalCount: 0,
36
- items: t(a)
36
+ items: o(l)
37
37
  };
38
38
  }
39
- o.RandomDeviceGroup = r;
39
+ t.RandomDeviceGroup = r;
40
40
  })(e.Test || (e.Test = {}));
41
- function n(o, s) {
42
- for (let t = 0; t < o.length; t++)
43
- s(o[t]), n(o[t].items, s);
41
+ function n(t, s) {
42
+ for (let o = 0; o < t.length; o++)
43
+ s(t[o]), n(t[o].items, s);
44
44
  }
45
- ((o) => {
46
- function s(t) {
47
- const r = {}, a = {};
48
- return n(t.items, (i) => {
45
+ ((t) => {
46
+ function s(o) {
47
+ const r = {}, l = {};
48
+ return n(o.items, (i) => {
49
49
  r[i.id] = i;
50
- for (let l = 0; l < i.devices.length; l++)
51
- a[i.devices[l].id] = i.devices[l];
50
+ for (let a = 0; a < i.devices.length; a++)
51
+ l[i.devices[a].id] = i.devices[a];
52
52
  }), {
53
53
  getGroup(i) {
54
54
  return r[i];
55
55
  },
56
56
  getDevice(i) {
57
- return a[i];
57
+ return l[i];
58
58
  },
59
59
  foreachGroup(i) {
60
- for (let l in r)
61
- i(r[l]);
60
+ for (let a in r)
61
+ i(r[a]);
62
62
  }
63
63
  };
64
64
  }
65
- o.AccessSession = s;
65
+ t.AccessSession = s;
66
66
  })(e.Utils || (e.Utils = {}));
67
- })(N || (N = {}));
68
- const re = F({
67
+ })(A || (A = {}));
68
+ const ue = H({
69
69
  props: {
70
70
  countInfo: Object,
71
71
  controlParams: Object
72
72
  },
73
73
  setup(e) {
74
- function n(t, r) {
74
+ function n(o, r) {
75
75
  if (r) {
76
- let a = 0;
76
+ let l = 0;
77
77
  return r.items.forEach((i) => {
78
- a += n(t, i);
79
- }), t(r) + a;
78
+ l += n(o, i);
79
+ }), o(r) + l;
80
80
  }
81
81
  return 0;
82
82
  }
83
- const o = M(() => n((t) => t.onlineCount, e.countInfo));
83
+ const t = k(() => n((o) => {
84
+ var r, l;
85
+ if (o.devices) {
86
+ let i = (r = o.devices) == null ? void 0 : r.filter((c) => c.online);
87
+ const a = (l = e.controlParams) == null ? void 0 : l.searchStr;
88
+ return a && (i = i.filter((c) => c.name.includes(a) || c.id.includes(a))), i.length;
89
+ }
90
+ return 0;
91
+ }, e.countInfo));
84
92
  return {
85
- totalCount: M(() => n((t) => t.totalCount, e.countInfo)),
86
- onlineCount: o
93
+ totalCount: k(() => n((o) => {
94
+ var r;
95
+ if (o.devices) {
96
+ let l = o.devices;
97
+ const i = (r = e.controlParams) == null ? void 0 : r.searchStr;
98
+ return i && (l = l.filter((a) => a.name.includes(i) || a.id.includes(i))), l.length;
99
+ }
100
+ return o.totalCount;
101
+ }, e.countInfo)),
102
+ onlineCount: t
87
103
  };
88
104
  }
89
105
  });
90
- const E = (e, n) => {
91
- const o = e.__vccOpts || e;
92
- for (const [s, t] of n)
93
- o[s] = t;
94
- return o;
95
- }, ie = { class: "root" }, le = { class: "count-show" };
96
- function ae(e, n, o, s, t, r) {
97
- return f(), b("div", ie, [
98
- y(e.$slots, "default", {}, void 0, !0),
99
- _("span", le, O(e.onlineCount) + "/" + O(e.totalCount), 1)
106
+ const z = (e, n) => {
107
+ const t = e.__vccOpts || e;
108
+ for (const [s, o] of n)
109
+ t[s] = o;
110
+ return t;
111
+ }, de = { class: "root" }, he = { class: "count-show" };
112
+ function fe(e, n, t, s, o, r) {
113
+ return m(), S("div", de, [
114
+ $(e.$slots, "default", {}, void 0, !0),
115
+ g("span", he, j(e.onlineCount) + "/" + j(e.totalCount), 1)
100
116
  ]);
101
117
  }
102
- const q = /* @__PURE__ */ E(re, [["render", ae], ["__scopeId", "data-v-6a3c7483"]]), J = Object.freeze(
118
+ const Z = /* @__PURE__ */ z(ue, [["render", fe], ["__scopeId", "data-v-1962595f"]]), ee = Object.freeze(
103
119
  {
104
120
  left: 0,
105
121
  top: 0,
106
122
  width: 16,
107
123
  height: 16
108
124
  }
109
- ), Q = Object.freeze({
125
+ ), te = Object.freeze({
110
126
  rotate: 0,
111
127
  vFlip: !1,
112
128
  hFlip: !1
113
129
  }), T = Object.freeze({
114
- ...J,
115
- ...Q
130
+ ...ee,
131
+ ...te
116
132
  });
117
133
  Object.freeze({
118
134
  ...T,
@@ -120,29 +136,29 @@ Object.freeze({
120
136
  hidden: !1
121
137
  });
122
138
  ({
123
- ...J
139
+ ...ee
124
140
  });
125
- const X = Object.freeze({
141
+ const ne = Object.freeze({
126
142
  width: null,
127
143
  height: null
128
- }), Y = Object.freeze({
129
- ...X,
130
- ...Q
144
+ }), oe = Object.freeze({
145
+ ...ne,
146
+ ...te
131
147
  });
132
- function ce(e, n) {
133
- const o = {
148
+ function pe(e, n) {
149
+ const t = {
134
150
  ...e
135
151
  };
136
152
  for (const s in n) {
137
- const t = n[s], r = typeof t;
138
- s in X ? (t === null || t && (r === "string" || r === "number")) && (o[s] = t) : r === typeof o[s] && (o[s] = s === "rotate" ? t % 4 : t);
153
+ const o = n[s], r = typeof o;
154
+ s in ne ? (o === null || o && (r === "string" || r === "number")) && (t[s] = o) : r === typeof t[s] && (t[s] = s === "rotate" ? o % 4 : o);
139
155
  }
140
- return o;
156
+ return t;
141
157
  }
142
- const ue = /[\s,]+/;
143
- function de(e, n) {
144
- n.split(ue).forEach((o) => {
145
- switch (o.trim()) {
158
+ const ve = /[\s,]+/;
159
+ function ge(e, n) {
160
+ n.split(ve).forEach((t) => {
161
+ switch (t.trim()) {
146
162
  case "horizontal":
147
163
  e.hFlip = !0;
148
164
  break;
@@ -152,163 +168,163 @@ function de(e, n) {
152
168
  }
153
169
  });
154
170
  }
155
- function he(e, n = 0) {
156
- const o = e.replace(/^-?[0-9.]*/, "");
157
- function s(t) {
158
- for (; t < 0; )
159
- t += 4;
160
- return t % 4;
171
+ function me(e, n = 0) {
172
+ const t = e.replace(/^-?[0-9.]*/, "");
173
+ function s(o) {
174
+ for (; o < 0; )
175
+ o += 4;
176
+ return o % 4;
161
177
  }
162
- if (o === "") {
163
- const t = parseInt(e);
164
- return isNaN(t) ? 0 : s(t);
165
- } else if (o !== e) {
166
- let t = 0;
167
- switch (o) {
178
+ if (t === "") {
179
+ const o = parseInt(e);
180
+ return isNaN(o) ? 0 : s(o);
181
+ } else if (t !== e) {
182
+ let o = 0;
183
+ switch (t) {
168
184
  case "%":
169
- t = 25;
185
+ o = 25;
170
186
  break;
171
187
  case "deg":
172
- t = 90;
188
+ o = 90;
173
189
  }
174
- if (t) {
175
- let r = parseFloat(e.slice(0, e.length - o.length));
176
- return isNaN(r) ? 0 : (r = r / t, r % 1 === 0 ? s(r) : 0);
190
+ if (o) {
191
+ let r = parseFloat(e.slice(0, e.length - t.length));
192
+ return isNaN(r) ? 0 : (r = r / o, r % 1 === 0 ? s(r) : 0);
177
193
  }
178
194
  }
179
195
  return n;
180
196
  }
181
- const pe = /(-?[0-9.]*[0-9]+[0-9.]*)/g, fe = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
182
- function R(e, n, o) {
197
+ const _e = /(-?[0-9.]*[0-9]+[0-9.]*)/g, we = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
198
+ function N(e, n, t) {
183
199
  if (n === 1)
184
200
  return e;
185
- if (o = o || 100, typeof e == "number")
186
- return Math.ceil(e * n * o) / o;
201
+ if (t = t || 100, typeof e == "number")
202
+ return Math.ceil(e * n * t) / t;
187
203
  if (typeof e != "string")
188
204
  return e;
189
- const s = e.split(pe);
205
+ const s = e.split(_e);
190
206
  if (s === null || !s.length)
191
207
  return e;
192
- const t = [];
193
- let r = s.shift(), a = fe.test(r);
208
+ const o = [];
209
+ let r = s.shift(), l = we.test(r);
194
210
  for (; ; ) {
195
- if (a) {
211
+ if (l) {
196
212
  const i = parseFloat(r);
197
- isNaN(i) ? t.push(r) : t.push(Math.ceil(i * n * o) / o);
213
+ isNaN(i) ? o.push(r) : o.push(Math.ceil(i * n * t) / t);
198
214
  } else
199
- t.push(r);
215
+ o.push(r);
200
216
  if (r = s.shift(), r === void 0)
201
- return t.join("");
202
- a = !a;
217
+ return o.join("");
218
+ l = !l;
203
219
  }
204
220
  }
205
- function ge(e, n) {
206
- const o = {
221
+ function Se(e, n) {
222
+ const t = {
207
223
  ...T,
208
224
  ...e
209
225
  }, s = {
210
- ...Y,
226
+ ...oe,
211
227
  ...n
212
- }, t = {
213
- left: o.left,
214
- top: o.top,
215
- width: o.width,
216
- height: o.height
228
+ }, o = {
229
+ left: t.left,
230
+ top: t.top,
231
+ width: t.width,
232
+ height: t.height
217
233
  };
218
- let r = o.body;
219
- [o, s].forEach((g) => {
220
- const h = [], p = g.hFlip, c = g.vFlip;
221
- let w = g.rotate;
222
- p ? c ? w += 2 : (h.push(
223
- "translate(" + (t.width + t.left).toString() + " " + (0 - t.top).toString() + ")"
224
- ), h.push("scale(-1 1)"), t.top = t.left = 0) : c && (h.push(
225
- "translate(" + (0 - t.left).toString() + " " + (t.height + t.top).toString() + ")"
226
- ), h.push("scale(1 -1)"), t.top = t.left = 0);
227
- let S;
234
+ let r = t.body;
235
+ [t, s].forEach((p) => {
236
+ const f = [], v = p.hFlip, d = p.vFlip;
237
+ let w = p.rotate;
238
+ v ? d ? w += 2 : (f.push(
239
+ "translate(" + (o.width + o.left).toString() + " " + (0 - o.top).toString() + ")"
240
+ ), f.push("scale(-1 1)"), o.top = o.left = 0) : d && (f.push(
241
+ "translate(" + (0 - o.left).toString() + " " + (o.height + o.top).toString() + ")"
242
+ ), f.push("scale(1 -1)"), o.top = o.left = 0);
243
+ let y;
228
244
  switch (w < 0 && (w -= Math.floor(w / 4) * 4), w = w % 4, w) {
229
245
  case 1:
230
- S = t.height / 2 + t.top, h.unshift(
231
- "rotate(90 " + S.toString() + " " + S.toString() + ")"
246
+ y = o.height / 2 + o.top, f.unshift(
247
+ "rotate(90 " + y.toString() + " " + y.toString() + ")"
232
248
  );
233
249
  break;
234
250
  case 2:
235
- h.unshift(
236
- "rotate(180 " + (t.width / 2 + t.left).toString() + " " + (t.height / 2 + t.top).toString() + ")"
251
+ f.unshift(
252
+ "rotate(180 " + (o.width / 2 + o.left).toString() + " " + (o.height / 2 + o.top).toString() + ")"
237
253
  );
238
254
  break;
239
255
  case 3:
240
- S = t.width / 2 + t.left, h.unshift(
241
- "rotate(-90 " + S.toString() + " " + S.toString() + ")"
256
+ y = o.width / 2 + o.left, f.unshift(
257
+ "rotate(-90 " + y.toString() + " " + y.toString() + ")"
242
258
  );
243
259
  break;
244
260
  }
245
- w % 2 === 1 && (t.left !== t.top && (S = t.left, t.left = t.top, t.top = S), t.width !== t.height && (S = t.width, t.width = t.height, t.height = S)), h.length && (r = '<g transform="' + h.join(" ") + '">' + r + "</g>");
261
+ w % 2 === 1 && (o.left !== o.top && (y = o.left, o.left = o.top, o.top = y), o.width !== o.height && (y = o.width, o.width = o.height, o.height = y)), f.length && (r = '<g transform="' + f.join(" ") + '">' + r + "</g>");
246
262
  });
247
- const a = s.width, i = s.height, l = t.width, d = t.height;
248
- let v, u;
249
- return a === null ? (u = i === null ? "1em" : i === "auto" ? d : i, v = R(u, l / d)) : (v = a === "auto" ? l : a, u = i === null ? R(v, d / l) : i === "auto" ? d : i), {
263
+ const l = s.width, i = s.height, a = o.width, c = o.height;
264
+ let h, u;
265
+ return l === null ? (u = i === null ? "1em" : i === "auto" ? c : i, h = N(u, a / c)) : (h = l === "auto" ? a : l, u = i === null ? N(h, c / a) : i === "auto" ? c : i), {
250
266
  attributes: {
251
- width: v.toString(),
267
+ width: h.toString(),
252
268
  height: u.toString(),
253
- viewBox: t.left.toString() + " " + t.top.toString() + " " + l.toString() + " " + d.toString()
269
+ viewBox: o.left.toString() + " " + o.top.toString() + " " + a.toString() + " " + c.toString()
254
270
  },
255
271
  body: r
256
272
  };
257
273
  }
258
- const ve = /\sid="(\S+)"/g, me = "IconifyId" + Date.now().toString(16) + (Math.random() * 16777216 | 0).toString(16);
259
- let we = 0;
260
- function _e(e, n = me) {
261
- const o = [];
274
+ const ye = /\sid="(\S+)"/g, be = "IconifyId" + Date.now().toString(16) + (Math.random() * 16777216 | 0).toString(16);
275
+ let $e = 0;
276
+ function Pe(e, n = be) {
277
+ const t = [];
262
278
  let s;
263
- for (; s = ve.exec(e); )
264
- o.push(s[1]);
265
- return o.length && o.forEach((t) => {
266
- const r = typeof n == "function" ? n(t) : n + (we++).toString(), a = t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
279
+ for (; s = ye.exec(e); )
280
+ t.push(s[1]);
281
+ return t.length && t.forEach((o) => {
282
+ const r = typeof n == "function" ? n(o) : n + ($e++).toString(), l = o.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
267
283
  e = e.replace(
268
- new RegExp('([#;"])(' + a + ')([")]|\\.[a-z])', "g"),
284
+ new RegExp('([#;"])(' + l + ')([")]|\\.[a-z])', "g"),
269
285
  "$1" + r + "$3"
270
286
  );
271
287
  }), e;
272
288
  }
273
- function Se(e, n) {
274
- let o = e.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
289
+ function Oe(e, n) {
290
+ let t = e.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
275
291
  for (const s in n)
276
- o += " " + s + '="' + n[s] + '"';
277
- return '<svg xmlns="http://www.w3.org/2000/svg"' + o + ">" + e + "</svg>";
292
+ t += " " + s + '="' + n[s] + '"';
293
+ return '<svg xmlns="http://www.w3.org/2000/svg"' + t + ">" + e + "</svg>";
278
294
  }
279
- function be(e) {
295
+ function Ce(e) {
280
296
  return e.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
281
297
  }
282
- function ye(e) {
283
- return 'url("data:image/svg+xml,' + be(e) + '")';
298
+ function ke(e) {
299
+ return 'url("data:image/svg+xml,' + Ce(e) + '")';
284
300
  }
285
- const V = {
286
- ...Y,
301
+ const R = {
302
+ ...oe,
287
303
  inline: !1
288
- }, Ce = {
304
+ }, Ie = {
289
305
  xmlns: "http://www.w3.org/2000/svg",
290
306
  "xmlns:xlink": "http://www.w3.org/1999/xlink",
291
307
  "aria-hidden": !0,
292
308
  role: "img"
293
- }, $e = {
309
+ }, De = {
294
310
  display: "inline-block"
295
- }, D = {
311
+ }, M = {
296
312
  backgroundColor: "currentColor"
297
- }, Z = {
313
+ }, ie = {
298
314
  backgroundColor: "transparent"
299
- }, x = {
315
+ }, B = {
300
316
  Image: "var(--svg)",
301
317
  Repeat: "no-repeat",
302
318
  Size: "100% 100%"
303
319
  }, U = {
304
- webkitMask: D,
305
- mask: D,
306
- background: Z
320
+ webkitMask: M,
321
+ mask: M,
322
+ background: ie
307
323
  };
308
324
  for (const e in U) {
309
325
  const n = U[e];
310
- for (const o in x)
311
- n[e + o] = x[o];
326
+ for (const t in B)
327
+ n[e + t] = B[t];
312
328
  }
313
329
  const G = {};
314
330
  ["horizontal", "vertical"].forEach((e) => {
@@ -318,12 +334,12 @@ const G = {};
318
334
  function W(e) {
319
335
  return e + (e.match(/^[-0-9.]+$/) ? "px" : "");
320
336
  }
321
- const ke = (e, n) => {
322
- const o = ce(V, n), s = { ...Ce }, t = n.mode || "svg", r = {}, a = n.style, i = typeof a == "object" && !(a instanceof Array) ? a : {};
323
- for (let p in n) {
324
- const c = n[p];
325
- if (c !== void 0)
326
- switch (p) {
337
+ const Ge = (e, n) => {
338
+ const t = pe(R, n), s = { ...Ie }, o = n.mode || "svg", r = {}, l = n.style, i = typeof l == "object" && !(l instanceof Array) ? l : {};
339
+ for (let v in n) {
340
+ const d = n[v];
341
+ if (d !== void 0)
342
+ switch (v) {
327
343
  case "icon":
328
344
  case "style":
329
345
  case "onLoad":
@@ -332,67 +348,161 @@ const ke = (e, n) => {
332
348
  case "inline":
333
349
  case "hFlip":
334
350
  case "vFlip":
335
- o[p] = c === !0 || c === "true" || c === 1;
351
+ t[v] = d === !0 || d === "true" || d === 1;
336
352
  break;
337
353
  case "flip":
338
- typeof c == "string" && de(o, c);
354
+ typeof d == "string" && ge(t, d);
339
355
  break;
340
356
  case "color":
341
- r.color = c;
357
+ r.color = d;
342
358
  break;
343
359
  case "rotate":
344
- typeof c == "string" ? o[p] = he(c) : typeof c == "number" && (o[p] = c);
360
+ typeof d == "string" ? t[v] = me(d) : typeof d == "number" && (t[v] = d);
345
361
  break;
346
362
  case "ariaHidden":
347
363
  case "aria-hidden":
348
- c !== !0 && c !== "true" && delete s["aria-hidden"];
364
+ d !== !0 && d !== "true" && delete s["aria-hidden"];
349
365
  break;
350
366
  default: {
351
- const w = G[p];
352
- w ? (c === !0 || c === "true" || c === 1) && (o[w] = !0) : V[p] === void 0 && (s[p] = c);
367
+ const w = G[v];
368
+ w ? (d === !0 || d === "true" || d === 1) && (t[w] = !0) : R[v] === void 0 && (s[v] = d);
353
369
  }
354
370
  }
355
371
  }
356
- const l = ge(e, o), d = l.attributes;
357
- if (o.inline && (r.verticalAlign = "-0.125em"), t === "svg") {
372
+ const a = Se(e, t), c = a.attributes;
373
+ if (t.inline && (r.verticalAlign = "-0.125em"), o === "svg") {
358
374
  s.style = {
359
375
  ...r,
360
376
  ...i
361
- }, Object.assign(s, d);
362
- let p = 0, c = n.id;
363
- return typeof c == "string" && (c = c.replace(/-/g, "_")), s.innerHTML = _e(l.body, c ? () => c + "ID" + p++ : "iconifyVue"), L("svg", s);
377
+ }, Object.assign(s, c);
378
+ let v = 0, d = n.id;
379
+ return typeof d == "string" && (d = d.replace(/-/g, "_")), s.innerHTML = Pe(a.body, d ? () => d + "ID" + v++ : "iconifyVue"), L("svg", s);
364
380
  }
365
- const { body: v, width: u, height: m } = e, g = t === "mask" || (t === "bg" ? !1 : v.indexOf("currentColor") !== -1), h = Se(v, {
366
- ...d,
381
+ const { body: h, width: u, height: _ } = e, p = o === "mask" || (o === "bg" ? !1 : h.indexOf("currentColor") !== -1), f = Oe(h, {
382
+ ...c,
367
383
  width: u + "",
368
- height: m + ""
384
+ height: _ + ""
369
385
  });
370
386
  return s.style = {
371
387
  ...r,
372
- "--svg": ye(h),
373
- width: W(d.width),
374
- height: W(d.height),
375
- ...$e,
376
- ...g ? D : Z,
388
+ "--svg": ke(f),
389
+ width: W(c.width),
390
+ height: W(c.height),
391
+ ...De,
392
+ ...p ? M : ie,
377
393
  ...i
378
394
  }, L("span", s);
379
- }, ee = /* @__PURE__ */ Object.create(null);
380
- function k(e, n) {
381
- ee[e] = n;
395
+ }, re = /* @__PURE__ */ Object.create(null);
396
+ function I(e, n) {
397
+ re[e] = n;
382
398
  }
383
- const Ie = F({
399
+ const je = H({
384
400
  inheritAttrs: !1,
385
401
  render() {
386
- const e = this.$attrs, n = e.icon, o = typeof n == "string" ? ee[n] : typeof n == "object" ? n : null;
387
- return o === null || typeof o != "object" || typeof o.body != "string" ? this.$slots.default ? this.$slots.default() : null : ke({
402
+ const e = this.$attrs, n = e.icon, t = typeof n == "string" ? re[n] : typeof n == "object" ? n : null;
403
+ return t === null || typeof t != "object" || typeof t.body != "string" ? this.$slots.default ? this.$slots.default() : null : Ge({
388
404
  ...T,
389
- ...o
405
+ ...t
406
+ }, e);
407
+ }
408
+ });
409
+ var He = Object.defineProperty, K = Object.getOwnPropertySymbols, ze = Object.prototype.hasOwnProperty, Me = Object.prototype.propertyIsEnumerable, q = (e, n, t) => n in e ? He(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t, Ee = (e, n) => {
410
+ for (var t in n || (n = {}))
411
+ ze.call(n, t) && q(e, t, n[t]);
412
+ if (K)
413
+ for (var t of K(n))
414
+ Me.call(n, t) && q(e, t, n[t]);
415
+ return e;
416
+ };
417
+ const Fe = {
418
+ name: "VirtualList",
419
+ props: {
420
+ listData: {
421
+ type: Object,
422
+ default: () => []
423
+ },
424
+ itemSize: {
425
+ type: Number,
426
+ default: 200
427
+ }
428
+ },
429
+ computed: {
430
+ listHeight() {
431
+ return this.listData.length * this.itemSize;
432
+ },
433
+ visibleCount() {
434
+ return Math.ceil(this.screenHeight / this.itemSize);
435
+ },
436
+ getTransform() {
437
+ return `translate3d(0,${this.startOffset}px,0)`;
438
+ },
439
+ visibleData() {
440
+ return this.listData.slice(this.start, Math.min(this.end, this.listData.length));
441
+ }
442
+ },
443
+ setup() {
444
+ const e = {
445
+ screenHeight: b(0),
446
+ startOffset: b(0),
447
+ start: b(0),
448
+ end: b(0)
449
+ }, n = b();
450
+ return Ee({
451
+ virList: n
390
452
  }, e);
453
+ },
454
+ mounted() {
455
+ this.screenHeight = this.$el.clientHeight, this.screenHeight == 0 && (this.screenHeight = 400), this.start = 0, this.end = this.start + this.visibleCount;
456
+ },
457
+ methods: {
458
+ scrollEvent() {
459
+ if (this.virList) {
460
+ let e = this.virList.scrollTop;
461
+ this.start = Math.floor(e / this.itemSize), this.end = this.start + this.visibleCount, this.startOffset = e - e % this.itemSize;
462
+ }
463
+ }
391
464
  }
392
- }), Pe = F({
465
+ };
466
+ function Te(e, n, t, s, o, r) {
467
+ return m(), S("div", {
468
+ ref: "virList",
469
+ class: "infinite-list-container",
470
+ onScroll: n[0] || (n[0] = (l) => r.scrollEvent())
471
+ }, [
472
+ g("div", {
473
+ class: "infinite-list-phantom",
474
+ style: D({ height: r.listHeight + "px" })
475
+ }, null, 4),
476
+ g("div", {
477
+ class: "infinite-list",
478
+ style: D({ transform: r.getTransform })
479
+ }, [
480
+ (m(!0), S(E, null, F(r.visibleData, (l) => (m(), S("div", {
481
+ ref_for: !0,
482
+ ref: "items",
483
+ class: "infinite-list-item",
484
+ key: l.id,
485
+ style: D({ height: t.itemSize + "px", lineHeight: t.itemSize + "px" })
486
+ }, [
487
+ $(e.$slots, "default", { data: l }, void 0, !0)
488
+ ], 4))), 128))
489
+ ], 4)
490
+ ], 544);
491
+ }
492
+ const Le = /* @__PURE__ */ z(Fe, [["render", Te], ["__scopeId", "data-v-67c5afcc"]]);
493
+ var xe = Object.defineProperty, Ve = Object.defineProperties, Ae = Object.getOwnPropertyDescriptors, J = Object.getOwnPropertySymbols, Ne = Object.prototype.hasOwnProperty, Re = Object.prototype.propertyIsEnumerable, Q = (e, n, t) => n in e ? xe(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t, Be = (e, n) => {
494
+ for (var t in n || (n = {}))
495
+ Ne.call(n, t) && Q(e, t, n[t]);
496
+ if (J)
497
+ for (var t of J(n))
498
+ Re.call(n, t) && Q(e, t, n[t]);
499
+ return e;
500
+ }, Ue = (e, n) => Ve(e, Ae(n));
501
+ const We = H({
393
502
  components: {
394
- CountShow: q,
395
- Icon: Ie
503
+ VirtualList: Le,
504
+ CountShow: Z,
505
+ Icon: je
396
506
  },
397
507
  name: "group-show",
398
508
  props: {
@@ -400,159 +510,173 @@ const Ie = F({
400
510
  controlParams: Object
401
511
  },
402
512
  setup(e) {
403
- const n = te("theme");
404
- function o(r) {
405
- var a;
406
- return ((a = r && r.filter((i) => {
407
- var l;
408
- return !((l = e.controlParams) != null && l.onlyShowOnline) || i.online;
409
- })) == null ? void 0 : a.filter((i) => {
410
- var l, d;
411
- return e.controlParams ? i.name.indexOf((l = e.controlParams) == null ? void 0 : l.searchStr) >= 0 || i.id.indexOf((d = e.controlParams) == null ? void 0 : d.searchStr) >= 0 : !0;
412
- })) || [];
413
- }
414
- const s = M(() => {
415
- var r, a;
416
- const i = e.controlParams.searchStr;
417
- return i.length == 0 || e.deviceGroup && ((r = e.deviceGroup) == null ? void 0 : r.name.indexOf(i)) > 0 ? !0 : (a = e.deviceGroup) == null ? void 0 : a.devices.find((l) => l.name.indexOf(e.controlParams.searchStr) >= 0 || l.id.indexOf(e.controlParams.searchStr) >= 0);
418
- }), t = z(!1);
419
- return {
420
- showGroup: s,
421
- FilterDevice: o,
422
- bShow: t,
513
+ const n = se("theme"), t = {
514
+ filterDevice(i) {
515
+ var a, c, h, u;
516
+ let _ = !0;
517
+ (a = e.controlParams) != null && a.searchStr && (_ = i.name.indexOf((c = e.controlParams) == null ? void 0 : c.searchStr) >= 0 || i.id.indexOf((h = e.controlParams) == null ? void 0 : h.searchStr) >= 0);
518
+ let p = !0;
519
+ return (u = e.controlParams) != null && u.onlyShowOnline && (p = i.online), _ && p;
520
+ },
521
+ deviceText(i) {
522
+ return i.name.length > 0 ? i.name : i.id;
523
+ }
524
+ }, s = {
525
+ filteredDevices: k(() => {
526
+ var i;
527
+ const a = (i = e.deviceGroup) == null ? void 0 : i.devices, c = a && a.filter((u) => t.filterDevice(u)) || [];
528
+ return c.filter((u) => u.online).concat(c.filter((u) => !u.online));
529
+ })
530
+ }, o = k(() => s.filteredDevices.value.length > 10 ? "400px" : `${s.filteredDevices.value.length * 40}px`), r = k(() => {
531
+ var i, a;
532
+ const c = e.controlParams.searchStr;
533
+ return c.length == 0 || e.deviceGroup && ((i = e.deviceGroup) == null ? void 0 : i.name.indexOf(c)) > 0 ? !0 : (a = e.deviceGroup) == null ? void 0 : a.devices.find((h) => h.name.indexOf(e.controlParams.searchStr) >= 0 || h.id.indexOf(e.controlParams.searchStr) >= 0);
534
+ }), l = b(!1);
535
+ return Ue(Be({
536
+ innerUtils: t
537
+ }, s), {
538
+ devicePanelHeight: o,
539
+ showGroup: r,
540
+ bShow: l,
423
541
  theme: n
424
- };
542
+ });
425
543
  }
426
544
  });
427
- const Ge = {
545
+ const Ke = {
428
546
  key: 0,
429
547
  class: "head-op"
430
- }, Oe = ["title"], Fe = { class: "group-slot" }, je = {
548
+ }, qe = {
549
+ key: 1,
550
+ style: { display: "inline-block", width: "25px" }
551
+ }, Je = ["title"], Qe = { class: "group-slot" }, Xe = {
431
552
  key: 0,
432
553
  style: { "margin-left": "26px" }
433
- }, Me = { class: "device-show-div" }, ze = ["title"], He = { class: "device-slot" };
434
- function Ae(e, n, o, s, t, r) {
435
- var a, i;
436
- const l = $("Icon"), d = $("CountShow"), v = $("group-show");
437
- return e.showGroup ? (f(), b("div", {
554
+ }, Ye = ["title"], Ze = { class: "device-slot" };
555
+ function et(e, n, t, s, o, r) {
556
+ var l;
557
+ const i = C("Icon"), a = C("CountShow"), c = C("group-show"), h = C("VirtualList");
558
+ return e.showGroup ? (m(), S("div", {
438
559
  key: 0,
439
- class: B("group " + e.theme)
560
+ class: x("group " + e.theme)
440
561
  }, [
441
- I(d, {
562
+ O(a, {
442
563
  countInfo: e.deviceGroup,
443
564
  controlParams: e.controlParams
444
565
  }, {
445
- default: C(() => {
446
- var u, m, g, h, p;
566
+ default: P(() => {
567
+ var u, _, p, f, v;
447
568
  return [
448
- e.deviceGroup && e.deviceGroup.devices.length + e.deviceGroup.items.length > 0 ? (f(), b("span", Ge, [
449
- e.bShow ? (f(), P(l, {
450
- key: 1,
451
- icon: "minus",
569
+ e.deviceGroup && e.deviceGroup.devices.length + e.deviceGroup.items.length > 0 ? (m(), S("span", Ke, [
570
+ O(i, {
571
+ icon: e.bShow ? "minus" : "plus",
452
572
  width: "20",
453
- onClick: n[1] || (n[1] = (c) => e.bShow = !e.bShow),
573
+ onClick: n[0] || (n[0] = (d) => e.bShow = !e.bShow),
454
574
  class: "handle-ls-svg"
455
- })) : (f(), P(l, {
456
- key: 0,
457
- icon: "plus",
458
- width: "20",
459
- onClick: n[0] || (n[0] = (c) => e.bShow = !e.bShow),
460
- class: "handle-ls-svg"
461
- }))
462
- ])) : j("", !0),
463
- _("span", {
575
+ }, null, 8, ["icon"])
576
+ ])) : (m(), S("span", qe)),
577
+ g("span", {
464
578
  class: "group-head-db-click",
465
- onDblclick: n[2] || (n[2] = (c) => e.bShow = !e.bShow)
579
+ onDblclick: n[1] || (n[1] = (d) => e.bShow = !e.bShow)
466
580
  }, [
467
- I(l, {
581
+ O(i, {
468
582
  icon: "group",
469
583
  width: "24",
470
584
  class: "group-avatar"
471
585
  }),
472
- _("span", {
586
+ g("span", {
473
587
  class: "group-name",
474
588
  title: (u = e.deviceGroup) == null ? void 0 : u.name
475
- }, O(((m = e.deviceGroup) == null ? void 0 : m.name) && ((g = e.deviceGroup) == null ? void 0 : g.name.length) > 0 ? (h = e.deviceGroup) == null ? void 0 : h.name : (p = e.deviceGroup) == null ? void 0 : p.id), 9, Oe)
589
+ }, j(((_ = e.deviceGroup) == null ? void 0 : _.name) && ((p = e.deviceGroup) == null ? void 0 : p.name.length) > 0 ? (f = e.deviceGroup) == null ? void 0 : f.name : (v = e.deviceGroup) == null ? void 0 : v.id), 9, Je)
476
590
  ], 32),
477
- _("div", Fe, [
478
- y(e.$slots, "group", { group: e.deviceGroup }, void 0, !0)
591
+ g("div", Qe, [
592
+ $(e.$slots, "group", { group: e.deviceGroup }, void 0, !0)
479
593
  ])
480
594
  ];
481
595
  }),
482
596
  _: 3
483
597
  }, 8, ["countInfo", "controlParams"]),
484
- e.bShow ? (f(), b("div", je, [
485
- (f(!0), b(H, null, A((a = e.deviceGroup) == null ? void 0 : a.items, (u, m) => (f(), P(v, {
486
- key: m,
598
+ e.bShow ? (m(), S("div", Xe, [
599
+ (m(!0), S(E, null, F((l = e.deviceGroup) == null ? void 0 : l.items, (u, _) => (m(), Y(c, {
600
+ key: _,
487
601
  deviceGroup: u,
488
602
  controlParams: e.controlParams
489
603
  }, {
490
- group: C(({ group: g }) => [
491
- y(e.$slots, "group", { group: g }, void 0, !0)
604
+ group: P(({ group: p }) => [
605
+ $(e.$slots, "group", { group: p }, void 0, !0)
492
606
  ]),
493
- device: C(({ device: g, group: h }) => [
494
- y(e.$slots, "device", {
495
- device: g,
496
- group: h
607
+ device: P(({ device: p, group: f }) => [
608
+ $(e.$slots, "device", {
609
+ device: p,
610
+ group: f
497
611
  }, void 0, !0)
498
612
  ]),
499
613
  _: 2
500
614
  }, 1032, ["deviceGroup", "controlParams"]))), 128)),
501
- _("div", Me, [
502
- (f(!0), b(H, null, A(e.FilterDevice((i = e.deviceGroup) == null ? void 0 : i.devices), (u, m) => (f(), b("div", {
503
- key: m,
504
- class: B(["device", u.online && "online-device"])
505
- }, [
506
- I(l, {
507
- icon: "user",
508
- width: "16",
509
- class: "device-avatar"
510
- }),
511
- _("span", {
512
- title: u.id,
513
- class: "device-name"
514
- }, O(u.name.length > 0 ? u.name : u.id), 9, ze),
515
- _("div", He, [
516
- y(e.$slots, "device", {
517
- device: u,
518
- group: e.deviceGroup
519
- }, void 0, !0)
520
- ])
521
- ], 2))), 128))
522
- ])
523
- ])) : j("", !0)
524
- ], 2)) : j("", !0);
615
+ g("div", {
616
+ class: "device-show-div",
617
+ style: D(`height: ${e.filteredDevices.length > 10 ? "400px" : `${e.filteredDevices.length * 40}px`}`)
618
+ }, [
619
+ O(h, {
620
+ "list-data": e.filteredDevices,
621
+ "item-size": 40
622
+ }, {
623
+ default: P(({ data: u }) => [
624
+ g("div", {
625
+ class: x(u.online && "online-device")
626
+ }, [
627
+ O(i, {
628
+ icon: "user",
629
+ width: "16",
630
+ class: "device-avatar"
631
+ }),
632
+ g("span", {
633
+ title: u.id,
634
+ class: "device-name"
635
+ }, j(e.innerUtils.deviceText(u)), 9, Ye),
636
+ g("div", Ze, [
637
+ $(e.$slots, "device", {
638
+ device: u,
639
+ group: e.deviceGroup
640
+ }, void 0, !0)
641
+ ])
642
+ ], 2)
643
+ ]),
644
+ _: 3
645
+ }, 8, ["list-data"])
646
+ ], 4)
647
+ ])) : V("", !0)
648
+ ], 2)) : V("", !0);
525
649
  }
526
- const De = /* @__PURE__ */ E(Pe, [["render", Ae], ["__scopeId", "data-v-100c06ff"]]), Ee = {
650
+ const tt = /* @__PURE__ */ z(We, [["render", et], ["__scopeId", "data-v-ec49c748"]]), nt = {
527
651
  width: 1024,
528
652
  height: 1024,
529
653
  body: '<path fill="currentColor" d="M384 192v640l384-320.064z"/>'
530
- }, Te = {
654
+ }, ot = {
531
655
  width: 1024,
532
656
  height: 1024,
533
657
  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"/>'
534
- }, Le = {
658
+ }, it = {
535
659
  width: 1024,
536
660
  height: 1024,
537
661
  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"/>'
538
- }, Be = {
662
+ }, rt = {
539
663
  width: 1024,
540
664
  height: 1024,
541
665
  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"/>'
542
- }, Ne = {
666
+ }, st = {
543
667
  width: 1024,
544
668
  height: 1024,
545
669
  body: '<path fill="currentColor" d="M128 544h768a32 32 0 1 0 0-64H128a32 32 0 0 0 0 64z"/>'
546
670
  };
547
- k("right", Ee);
548
- k("group", Te);
549
- k("user", Le);
550
- k("plus", Be);
551
- k("minus", Ne);
552
- const Re = F({
671
+ I("right", nt);
672
+ I("group", ot);
673
+ I("user", it);
674
+ I("plus", rt);
675
+ I("minus", st);
676
+ const lt = H({
553
677
  components: {
554
- CountShow: q,
555
- GroupShow: De
678
+ CountShow: Z,
679
+ GroupShow: tt
556
680
  },
557
681
  props: {
558
682
  deviceGroup: Object,
@@ -574,49 +698,49 @@ const Re = F({
574
698
  }
575
699
  },
576
700
  setup(e) {
577
- oe("theme", e.theme);
578
- const n = z({
701
+ le("theme", e.theme);
702
+ const n = b({
579
703
  onlyShowOnline: !1,
580
704
  searchStr: ""
581
705
  });
582
706
  return {
583
- inputSearchRef: z(),
707
+ inputSearchRef: b(),
584
708
  controlParams: n
585
709
  };
586
710
  }
587
711
  });
588
- const Ve = (e) => (ne("data-v-7e0a8034"), e = e(), se(), e), xe = { class: "device-group-list" }, Ue = { class: "search-panel" }, We = /* @__PURE__ */ Ve(() => /* @__PURE__ */ _("label", { for: "onlineShow" }, "\u53EA\u663E\u793A\u5728\u7EBF\u8BBE\u5907", -1)), Ke = { class: "device-panel" };
589
- function qe(e, n, o, s, t, r) {
590
- var a;
591
- const i = $("CountShow"), l = $("group-show");
592
- return f(), b("div", xe, [
593
- _("div", Ue, [
594
- I(i, { countInfo: e.deviceGroup }, {
595
- default: C(() => [
596
- _("input", {
712
+ const at = (e) => (ae("data-v-7e0a8034"), e = e(), ce(), e), ct = { class: "device-group-list" }, ut = { class: "search-panel" }, dt = /* @__PURE__ */ at(() => /* @__PURE__ */ g("label", { for: "onlineShow" }, "\u53EA\u663E\u793A\u5728\u7EBF\u8BBE\u5907", -1)), ht = { class: "device-panel" };
713
+ function ft(e, n, t, s, o, r) {
714
+ var l;
715
+ const i = C("CountShow"), a = C("group-show");
716
+ return m(), S("div", ct, [
717
+ g("div", ut, [
718
+ O(i, { countInfo: e.deviceGroup }, {
719
+ default: P(() => [
720
+ g("input", {
597
721
  type: "checkbox",
598
722
  id: "onlineShow",
599
723
  value: "onlineShow",
600
- onChange: n[0] || (n[0] = (...d) => e.onCheckBoxChange && e.onCheckBoxChange(...d))
724
+ onChange: n[0] || (n[0] = (...c) => e.onCheckBoxChange && e.onCheckBoxChange(...c))
601
725
  }, null, 32),
602
- We
726
+ dt
603
727
  ]),
604
728
  _: 1
605
729
  }, 8, ["countInfo"])
606
730
  ]),
607
- _("div", Ke, [
608
- (f(!0), b(H, null, A((a = e.deviceGroup) == null ? void 0 : a.items, (d, v) => (f(), P(l, {
731
+ g("div", ht, [
732
+ (m(!0), S(E, null, F((l = e.deviceGroup) == null ? void 0 : l.items, (c, h) => (m(), Y(a, {
609
733
  controlParams: e.controlParams,
610
- key: v,
611
- deviceGroup: d
734
+ key: h,
735
+ deviceGroup: c
612
736
  }, {
613
- group: C(({ group: u }) => [
614
- y(e.$slots, "group", { group: u }, void 0, !0)
737
+ group: P(({ group: u }) => [
738
+ $(e.$slots, "group", { group: u }, void 0, !0)
615
739
  ]),
616
- device: C(({ device: u, group: m }) => [
617
- y(e.$slots, "device", {
740
+ device: P(({ device: u, group: _ }) => [
741
+ $(e.$slots, "device", {
618
742
  device: u,
619
- group: m
743
+ group: _
620
744
  }, void 0, !0)
621
745
  ]),
622
746
  _: 2
@@ -624,18 +748,18 @@ function qe(e, n, o, s, t, r) {
624
748
  ])
625
749
  ]);
626
750
  }
627
- const Je = /* @__PURE__ */ E(Re, [["render", qe], ["__scopeId", "data-v-7e0a8034"]]), K = {
628
- RecursionDeviceGroup: Je
629
- }, Xe = {
751
+ const pt = /* @__PURE__ */ z(lt, [["render", ft], ["__scopeId", "data-v-7e0a8034"]]), X = {
752
+ RecursionDeviceGroup: pt
753
+ }, gt = {
630
754
  install(e) {
631
- for (const n in K) {
632
- const o = K[n];
633
- e.component(n, o);
755
+ for (const n in X) {
756
+ const t = X[n];
757
+ e.component(n, t);
634
758
  }
635
759
  }
636
760
  };
637
761
  export {
638
- N as RecursionDeviceGroup,
639
- Xe as default
762
+ A as RecursionDeviceGroup,
763
+ gt as default
640
764
  };
641
765
  //# sourceMappingURL=smarteye-e-components.mjs.map