@soei/flyweight 0.3.13 → 0.4.1

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.
package/Flyweight.js CHANGED
@@ -1,8 +1,8 @@
1
- import { runer as T, merge as B, isArray as at, each as C, picker as O, isEmpty as dt, isSimplyType as Q, isString as St } from "@soei/util";
2
- import { openBlock as N, createElementBlock as M, normalizeClass as ct, normalizeStyle as P, createElementVNode as W, Fragment as ut, renderList as ft, renderSlot as g, mergeProps as I, createCommentVNode as pt, createTextVNode as gt, toDisplayString as G, createBlock as $t, resolveDynamicComponent as Nt, withCtx as zt } from "vue";
3
- import { runer as p, isNil as kt, each as Z } from "@soei/tools";
4
- import Tt from "@soei/picker";
5
- let Mt = /(\d+|[+\-\*/]|%)/g, tt = {
1
+ import { runer as v, each as H, isEmpty as at, picker as C, isSimplyType as Q, merge as L, isString as zt, isArray as ut } from "@soei/util";
2
+ import { openBlock as T, createElementBlock as O, normalizeStyle as A, renderSlot as d, createElementVNode as M, createTextVNode as ct, toDisplayString as G, normalizeProps as Tt, guardReactiveProps as Nt, normalizeClass as dt, Fragment as ft, renderList as pt, mergeProps as B, createCommentVNode as gt, createBlock as kt, resolveDynamicComponent as Mt, withCtx as Ot } from "vue";
3
+ import { runer as g, isNil as Pt, each as Z } from "@soei/tools";
4
+ import jt from "@soei/picker";
5
+ let Et = /(\d+|[+\-\*/]|%)/g, tt = {
6
6
  "+": (t, e) => t + e,
7
7
  "-": (t, e) => t - e,
8
8
  "*": (t, e) => t * e,
@@ -10,30 +10,212 @@ let Mt = /(\d+|[+\-\*/]|%)/g, tt = {
10
10
  "%": (t, e, i) => parseFloat(t) / 100 * i
11
11
  }, et = (t, e) => {
12
12
  let i;
13
- if (i = T("match", t, Mt)) {
14
- let r = i.length, n, l = 0, s, h = [];
13
+ if (i = v("match", t, Et)) {
14
+ let r = i.length, l, n = 0, s, h = [];
15
15
  for (; r--; )
16
- l = i.shift(), l in tt ? (n && h.push(n), l === "%" && (h.length = 2), s = l) : +l && h.push(+l), h.length == 2 && (h.push(e), n = tt[s].apply(null, h), h.length = 0);
17
- +n || (n = +h.pop()), t = n >> 0;
16
+ n = i.shift(), n in tt ? (l && h.push(l), n === "%" && (h.length = 2), s = n) : +n && h.push(+n), h.length == 2 && (h.push(e), l = tt[s].apply(null, h), h.length = 0);
17
+ +l || (l = +h.pop()), t = l >> 0;
18
18
  }
19
19
  return t;
20
- }, it = {}, b = (t, e) => (t + "").replace(
20
+ }, it = {}, w = (t, e) => (t + "").replace(
21
21
  /\w+\((.*)\)/g,
22
22
  "$1"
23
23
  ).replace(
24
24
  it[e] || (it[e] = new RegExp("(?=\\s+|^)(\\d+)(?:\\.\\d{1,})?(?!(?:\\.)*\\d|%|\\w)", "g")),
25
25
  "$1px"
26
26
  );
27
- const j = (t, e) => {
27
+ const F = (t, e) => {
28
28
  const i = t.__vccOpts || t;
29
- for (const [r, n] of e)
30
- i[r] = n;
29
+ for (const [r, l] of e)
30
+ i[r] = l;
31
31
  return i;
32
32
  };
33
- let st = (t) => t == null || t == null, Et = (...t) => {
33
+ function V(t, e) {
34
+ return e && (t = t.replace(/[a-z]/g, "")), t.toLowerCase();
35
+ }
36
+ let _t = {
37
+ close: {
38
+ handler(t) {
39
+ this.change(t);
40
+ },
41
+ deep: !0
42
+ },
43
+ offset: {
44
+ handler(t) {
45
+ this.margin(t);
46
+ },
47
+ deep: !0
48
+ }
49
+ }, Ht = [
50
+ "BackGround",
51
+ "BordeR",
52
+ "Height",
53
+ "Width",
54
+ "Top",
55
+ "Right",
56
+ "Bottom",
57
+ "Left"
58
+ ], yt = {};
59
+ H(
60
+ Ht,
61
+ (t, e, i) => {
62
+ t = V(e), yt["--" + V(e, !0)] = t, i[t] = function() {
63
+ this.trigger++;
64
+ };
65
+ },
66
+ _t
67
+ );
68
+ const Ct = {
69
+ name: "Card",
70
+ // inheritAttrs: false,
71
+ props: {
72
+ offset: {
73
+ type: [String, Array],
74
+ default: () => [0, 0, 0, 0]
75
+ },
76
+ background: {
77
+ type: String,
78
+ default: ""
79
+ },
80
+ border: {
81
+ type: String,
82
+ default: "1px"
83
+ },
84
+ height: {
85
+ type: String,
86
+ default: "100%"
87
+ },
88
+ width: {
89
+ type: String,
90
+ default: "100%"
91
+ },
92
+ show: {
93
+ type: String,
94
+ default: ""
95
+ },
96
+ close: {
97
+ type: Object,
98
+ default: null
99
+ },
100
+ title: {
101
+ type: String,
102
+ default: ""
103
+ }
104
+ },
105
+ data() {
106
+ return {
107
+ closecss: {},
108
+ // style: {},
109
+ trigger: 0,
110
+ default: {
111
+ top: "0px",
112
+ right: "0px",
113
+ bottom: "0px",
114
+ left: "0px",
115
+ height: "100%",
116
+ width: "100%",
117
+ background: "",
118
+ border: "1px"
119
+ }
120
+ };
121
+ },
122
+ computed: {
123
+ style() {
124
+ return this.tr();
125
+ },
126
+ sub() {
127
+ return this.show || this.title;
128
+ },
129
+ tips() {
130
+ return v("tips", this.close || {}) || "关闭[" + this.sub + "]";
131
+ }
132
+ },
133
+ watch: _t,
134
+ methods: {
135
+ exec: w,
136
+ isEmpty: at,
137
+ picker: C,
138
+ runer: v,
139
+ isSimplyType: Q,
140
+ tr() {
141
+ let t = {};
142
+ return this.margin(this.offset), H(yt, (e, i) => {
143
+ this.css(t, e, i);
144
+ }), t;
145
+ },
146
+ tolower: V,
147
+ css(t, e, i) {
148
+ let r = this[i] || this.default[i];
149
+ !r || this.default[i] == r || (t[e] = w(r));
150
+ },
151
+ change(t) {
152
+ Q(t) || (this.closecss = C(
153
+ t,
154
+ "color=>--s-card-close-color,size=>--s-close-width,bold=>--s-close-height,*"
155
+ ));
156
+ },
157
+ margin(t) {
158
+ L(
159
+ this,
160
+ C(
161
+ zt(t) ? t.split(/\s*(?:,|\s+)\s*/) : t,
162
+ "0=>top,1|0=>right,2|0=>bottom,3|1|0=>left",
163
+ !0
164
+ ),
165
+ !0
166
+ );
167
+ }
168
+ },
169
+ mounted() {
170
+ this.change(this.close);
171
+ }
172
+ }, Lt = {
173
+ class: "card-title",
174
+ space: ""
175
+ }, Rt = {
176
+ class: "card-ico-items",
177
+ flex: "",
178
+ vcenter: ""
179
+ }, Wt = ["title"], At = { class: "card-content" };
180
+ function Bt(t, e, i, r, l, n) {
181
+ return T(), O("div", {
182
+ class: "card",
183
+ key: l.trigger,
184
+ style: A(n.isEmpty(n.style) ? n.tr() : n.style)
185
+ }, [
186
+ d(t.$slots, "default", {}, () => [
187
+ d(t.$slots, "title", {}, () => [
188
+ M("div", Lt, [
189
+ ct(G(n.sub) + " ", 1),
190
+ d(t.$slots, "icons", {}, () => [
191
+ M("div", Rt, [
192
+ d(t.$slots, "icon", Tt(Nt({ el: t.$el, picker: n.picker, runer: n.runer })), void 0, !0),
193
+ M("div", {
194
+ class: dt(["card-close", { hide: n.isSimplyType(i.close) ? !i.close : !1 }]),
195
+ style: A(l.closecss),
196
+ onClick: e[0] || (e[0] = (s) => t.$emit("close")),
197
+ title: n.tips
198
+ }, null, 14, Wt)
199
+ ])
200
+ ], !0)
201
+ ])
202
+ ], !0),
203
+ d(t.$slots, "content", {}, () => [
204
+ M("div", At, [
205
+ d(t.$slots, "inner", {}, void 0, !0)
206
+ ])
207
+ ], !0)
208
+ ], !0)
209
+ ], 4);
210
+ }
211
+ const Ft = /* @__PURE__ */ F(Ct, [["render", Bt], ["__scopeId", "data-v-7fa6225c"]]), It = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
212
+ __proto__: null,
213
+ default: Ft
214
+ }, Symbol.toStringTag, { value: "Module" }));
215
+ let st = (t) => t == null || t == null, Dt = (...t) => {
34
216
  console.info("::::FLYWEIGHT", ...t);
35
217
  };
36
- const Ht = {
218
+ const Gt = {
37
219
  name: "Flyweight",
38
220
  props: {
39
221
  flys: {
@@ -97,14 +279,14 @@ const Ht = {
97
279
  },
98
280
  style() {
99
281
  var t = this.w, e = this.h, i = this.Size, r = {};
100
- return B(r, {
101
- "--width": b(this.realW),
102
- "--height": b(this.realH),
103
- "--flyweight-content": b(i)
282
+ return L(r, {
283
+ "--width": w(this.realW),
284
+ "--height": w(this.realH),
285
+ "--flyweight-content": w(i)
104
286
  }, e && {
105
- "--flyweight-h": b(e)
287
+ "--flyweight-h": w(e)
106
288
  }, t && r, {
107
- "--flyweight-w": b(t)
289
+ "--flyweight-w": w(t)
108
290
  }, "mix"), r;
109
291
  }
110
292
  },
@@ -156,16 +338,16 @@ const Ht = {
156
338
  this.rebuild(), this.$emit("resize");
157
339
  }).observe(this.flyweight);
158
340
  } catch (t) {
159
- Et(t);
341
+ Dt(t);
160
342
  }
161
- this.scrollx = T("hasAttribute", this.flyweight, "scroll-x"), this.BoxRule = /* this.scrollx ? 'clientHeight=>width,clientWidth=>height' : */
343
+ this.scrollx = v("hasAttribute", this.flyweight, "scroll-x"), this.BoxRule = /* this.scrollx ? 'clientHeight=>width,clientWidth=>height' : */
162
344
  "clientHeight=>height,clientWidth=>width", this.direction = this.scrollx ? "scrollLeft" : "scrollTop";
163
345
  },
164
346
  methods: {
165
- exec: b,
347
+ exec: w,
166
348
  trigger(t, e) {
167
- at(t) || (t = t && e ? [[t, e]] : []), t.length && this.lazyrun(() => {
168
- C(t, (i, r) => {
349
+ ut(t) || (t = t && e ? [[t, e]] : []), t.length && this.lazyrun(() => {
350
+ H(t, (i, r) => {
169
351
  this.$emit(r[0], st(r[1]) ? !0 : r[1]);
170
352
  });
171
353
  });
@@ -175,17 +357,17 @@ const Ht = {
175
357
  return t && this.task.push(t), !0;
176
358
  },
177
359
  setview(t) {
178
- T([this.cheackflys, (e) => {
360
+ v([this.cheackflys, (e) => {
179
361
  e = e || {};
180
- let i = e.index || C(this.flys, (r, n, l, s) => {
181
- if (n[l] == s)
362
+ let i = e.index || H(this.flys, (r, l, n, s) => {
363
+ if (l[n] == s)
182
364
  return r;
183
365
  }, e.picker, e.id);
184
366
  st(i) || this.setindex(i);
185
367
  }], this, t);
186
368
  },
187
369
  setindex(t) {
188
- T([this.cheackflys, ({ index: e }) => {
370
+ v([this.cheackflys, ({ index: e }) => {
189
371
  this.selectIndex = e, this.$nextTick(() => {
190
372
  let i = e / this.column >> 0, r = this.expand;
191
373
  (this.flyweight[this.direction] / r >> 0) + this.row - i - 1 > 0 || (this.flyweight[this.direction] = i * r, this.scroll());
@@ -194,11 +376,11 @@ const Ht = {
194
376
  },
195
377
  lazyrun(t, e) {
196
378
  clearTimeout(this.time), this.time = setTimeout(() => {
197
- T(t);
379
+ v(t);
198
380
  }, e || this.lazy);
199
381
  },
200
382
  run(t) {
201
- let e = [], i = T(this.direction, t.target), r = {
383
+ let e = [], i = v(this.direction, t.target), r = {
202
384
  // ...this
203
385
  offset: i,
204
386
  top: i,
@@ -207,24 +389,24 @@ const Ht = {
207
389
  /* 显示区域第一行的索引 */
208
390
  index: i / this.expand >> 0
209
391
  };
210
- B(r, this.space), t.from || e.push(["onscroll", r]);
211
- let n = !1;
212
- C(
392
+ L(r, this.space), t.from || e.push(["onscroll", r]);
393
+ let l = !1;
394
+ H(
213
395
  this.flyweights,
214
- (l, s, h, o, d, c, u, f, a) => {
215
- if (h = l / d >> 0, f = h + o * /* 偏移量, 如果超出顶部 + 1轮,排列到列队后, 否则保持在当前*/
216
- (+(h < c % o) + (c / o >> 0)), a = f * d + l % d, a >= this.count) {
217
- n || (e.push(["onend"]), n = !0);
396
+ (n, s, h, o, u, c, f, p, a) => {
397
+ if (h = n / u >> 0, p = h + o * /* 偏移量, 如果超出顶部 + 1轮,排列到列队后, 否则保持在当前*/
398
+ (+(h < c % o) + (c / o >> 0)), a = p * u + n % u, a >= this.count) {
399
+ l || (e.push(["onend"]), l = !0);
218
400
  return;
219
401
  }
220
- s.index = f, s.i = a, s.data = this.flys[a];
221
- let v = [
402
+ s.index = p, s.i = a, s.data = this.flys[a];
403
+ let S = [
222
404
  /* top */
223
- f * this.expand + s.x,
405
+ p * this.expand + s.x,
224
406
  /* left */
225
407
  s.space
226
408
  ];
227
- u && v.reverse(), s.top = v[0], s.left = v[1];
409
+ f && S.reverse(), s.top = S[0], s.left = S[1];
228
410
  },
229
411
  null,
230
412
  this.row,
@@ -242,31 +424,31 @@ const Ht = {
242
424
  if (!t)
243
425
  return e.length = t;
244
426
  this.count = t;
245
- let i = this.scrollx, r = this.flyweight, n = O(r, this.BoxRule);
427
+ let i = this.scrollx, r = this.flyweight, l = C(r, this.BoxRule);
246
428
  this.$nextTick(() => {
247
- let l = /true/.test(this.auto), [s, h] = this.offset, o = n.width, d = n.height, c = (et(this.width, o) || o) + s, u = et(this.height, d) + h, f = [o / c >> 0 || 1, d / u >> 0 || 1];
248
- i && f.reverse();
249
- let [a, v] = f, x = this.padding, E, S = 0, y, _;
250
- i ? (y = c, c -= s, _ = ($) => (
429
+ let n = /true/.test(this.auto), [s, h] = this.offset, o = l.width, u = l.height, c = (et(this.width, o) || o) + s, f = et(this.height, u) + h, p = [o / c >> 0 || 1, u / f >> 0 || 1];
430
+ i && p.reverse();
431
+ let [a, S] = p, x = this.padding, P, $ = 0, _, m;
432
+ i ? (_ = c, c -= s, m = (z) => (
251
433
  /* 计算top偏移量 */
252
- $ * (u - h) + ($ + 1) * h
253
- )) : (l ? (c = (o - s * (a + 2 * x - 1)) / a, E = !x * s, S = x * s) : (E = 0, S = (o % c + s * a) / (a + 1) >> 0, c -= s), _ = ($) => $ * (c + E) + ($ + 1) * S, y = u), this.row = v + 2, this.column = a, this.realH = u - h, this.realW = c, this.expand = y, this.Size = Math.ceil(t / a) * y;
254
- let w = Math.min(t, a * this.row), m = w - 1, z;
255
- for (; w-- > 0; )
256
- z = m - w, this.$set(e, z, {
434
+ z * (f - h) + (z + 1) * h
435
+ )) : (n ? (c = (o - s * (a + 2 * x - 1)) / a, P = !x * s, $ = x * s) : (P = 0, $ = (o % c + s * a) / (a + 1) >> 0, c -= s), m = (z) => z * (c + P) + (z + 1) * $, _ = f), this.row = S + 2, this.column = a, this.realH = f - h, this.realW = c, this.expand = _, this.Size = Math.ceil(t / a) * _;
436
+ let b = Math.min(t, a * this.row), y = b - 1, N;
437
+ for (; b-- > 0; )
438
+ N = y - b, this.$set(e, N, {
257
439
  x: s,
258
440
  y: h,
259
441
  width: c,
260
- height: u - h,
261
- space: _(z % a),
442
+ height: f - h,
443
+ space: m(N % a),
262
444
  data: {}
263
445
  });
264
- e.length = m + 1;
446
+ e.length = y + 1;
265
447
  let k = [];
266
- d / y > m / a && k.push(["onend"]), this.flyweight && (this.flyweight[this.direction] = 0), this.$nextTick(() => {
448
+ u / _ > y / a && k.push(["onend"]), this.flyweight && (this.flyweight[this.direction] = 0), this.$nextTick(() => {
267
449
  this.setindex(this.selectIndex || 0), this.scroll();
268
450
  }), k.push(["update:space", {
269
- row: (m / a >> 0) + 1,
451
+ row: (y / a >> 0) + 1,
270
452
  column: a,
271
453
  showrow: this.row,
272
454
  showcolumn: this.column
@@ -274,193 +456,34 @@ const Ht = {
274
456
  });
275
457
  }
276
458
  }
277
- }, Lt = { class: "flyweight-all" };
278
- function Ct(t, e, i, r, n, l) {
279
- return N(), M("div", {
459
+ }, Vt = { class: "flyweight-all" };
460
+ function qt(t, e, i, r, l, n) {
461
+ return T(), O("div", {
280
462
  ref: "flyweight",
281
- class: ct(["flyweight", {
282
- "flyweight-active": n.actice
463
+ class: dt(["flyweight", {
464
+ "flyweight-active": l.actice
283
465
  }]),
284
- style: P(l.style),
285
- onScroll: e[0] || (e[0] = (...s) => l.scroll && l.scroll(...s))
466
+ style: A(n.style),
467
+ onScroll: e[0] || (e[0] = (...s) => n.scroll && n.scroll(...s))
286
468
  }, [
287
- W("div", Lt, [
288
- (N(!0), M(ut, null, ft(n.flyweights, (s, h) => (N(), M("div", {
469
+ M("div", Vt, [
470
+ (T(!0), O(ft, null, pt(l.flyweights, (s, h) => (T(), O("div", {
289
471
  key: h,
290
- style: P({
472
+ style: A({
291
473
  top: s.top + "px",
292
474
  left: s.left + "px"
293
475
  })
294
476
  }, [
295
- g(t.$slots, "default", I({ ref_for: !0 }, s), void 0, !0)
477
+ d(t.$slots, "default", B({ ref_for: !0 }, s), void 0, !0)
296
478
  ], 4))), 128))
297
479
  ]),
298
- n.flyweights.length ? g(t.$slots, "end", { key: 0 }, void 0, !0) : pt("", !0)
480
+ l.flyweights.length ? d(t.$slots, "end", { key: 0 }, void 0, !0) : gt("", !0)
299
481
  ], 38);
300
482
  }
301
- const Wt = /* @__PURE__ */ j(Ht, [["render", Ct], ["__scopeId", "data-v-35b94e9b"]]);
302
- function U(t, e) {
303
- return e && (t = t.replace(/[a-z]/g, "")), t.toLowerCase();
304
- }
305
- let yt = {
306
- close: {
307
- handler(t) {
308
- this.change(t);
309
- },
310
- deep: !0
311
- },
312
- offset: {
313
- handler(t) {
314
- this.margin(t);
315
- },
316
- deep: !0
317
- }
318
- }, Bt = [
319
- "BackGround",
320
- "BordeR",
321
- "Height",
322
- "Width",
323
- "Top",
324
- "Right",
325
- "Bottom",
326
- "Left"
327
- ], mt = {};
328
- C(
329
- Bt,
330
- (t, e, i) => {
331
- t = U(e), mt["--" + U(e, !0)] = t, i[t] = function() {
332
- this.trigger++;
333
- };
334
- },
335
- yt
336
- );
337
- const Rt = {
338
- name: "Card",
339
- // inheritAttrs: false,
340
- props: {
341
- offset: {
342
- type: [String, Array],
343
- default: () => [0, 0, 0, 0]
344
- },
345
- background: {
346
- type: String,
347
- default: ""
348
- },
349
- border: {
350
- type: String,
351
- default: "1px"
352
- },
353
- height: {
354
- type: String,
355
- default: "100%"
356
- },
357
- width: {
358
- type: String,
359
- default: "100%"
360
- },
361
- show: {
362
- type: String,
363
- default: ""
364
- },
365
- close: {
366
- type: Object,
367
- default: null
368
- },
369
- title: {
370
- type: String,
371
- default: ""
372
- }
373
- },
374
- data() {
375
- return {
376
- closecss: {},
377
- // style: {},
378
- trigger: 0,
379
- default: {
380
- top: "0px",
381
- right: "0px",
382
- bottom: "0px",
383
- left: "0px",
384
- height: "100%",
385
- width: "100%",
386
- background: "",
387
- border: "1px"
388
- }
389
- };
390
- },
391
- computed: {
392
- style() {
393
- return this.tr();
394
- }
395
- },
396
- watch: yt,
397
- methods: {
398
- exec: b,
399
- isEmpty: dt,
400
- isSimplyType: Q,
401
- tr() {
402
- let t = {};
403
- return this.margin(this.offset), C(mt, (e, i) => {
404
- this.css(t, e, i);
405
- }), t;
406
- },
407
- tolower: U,
408
- css(t, e, i) {
409
- let r = this[i] || this.default[i];
410
- !r || this.default[i] == r || (t[e] = b(r));
411
- },
412
- change(t) {
413
- Q(t) || (this.closecss = O(
414
- t,
415
- "color=>--s-card-close-color,size=>--s-close-width,bold=>--s-close-height,*"
416
- ));
417
- },
418
- margin(t) {
419
- B(
420
- this,
421
- O(
422
- St(t) ? t.split(/\s*(?:,|\s+)\s*/) : t,
423
- "0=>top,1|0=>right,2|0=>bottom,3|1|0=>left",
424
- !0
425
- ),
426
- !0
427
- );
428
- }
429
- },
430
- mounted() {
431
- this.change(this.close);
432
- }
433
- }, At = { class: "card-title" }, Ot = ["title"], Pt = { class: "card-content" };
434
- function It(t, e, i, r, n, l) {
435
- return N(), M("div", {
436
- class: "card",
437
- key: n.trigger,
438
- style: P(l.isEmpty(l.style) ? l.tr() : l.style)
439
- }, [
440
- g(t.$slots, "default", {}, () => [
441
- g(t.$slots, "title", {}, () => {
442
- var s;
443
- return [
444
- W("div", At, [
445
- gt(G(i.show || i.title) + " ", 1),
446
- W("div", {
447
- class: ct(["card-close", { hide: l.isSimplyType(i.close) ? !i.close : !1 }]),
448
- style: P(n.closecss),
449
- onClick: e[0] || (e[0] = (h) => t.$emit("close")),
450
- title: (s = i.close) == null ? void 0 : s.tips
451
- }, null, 14, Ot)
452
- ])
453
- ];
454
- }, !0),
455
- g(t.$slots, "content", {}, () => [
456
- W("div", Pt, [
457
- g(t.$slots, "inner", {}, void 0, !0)
458
- ])
459
- ], !0)
460
- ], !0)
461
- ], 4);
462
- }
463
- const jt = /* @__PURE__ */ j(Rt, [["render", It], ["__scopeId", "data-v-85bce7b7"]]), Ft = {
483
+ const Ut = /* @__PURE__ */ F(Gt, [["render", qt], ["__scopeId", "data-v-35b94e9b"]]), Xt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
484
+ __proto__: null,
485
+ default: Ut
486
+ }, Symbol.toStringTag, { value: "Module" })), Yt = {
464
487
  name: "Stream",
465
488
  computed: {
466
489
  component() {
@@ -468,7 +491,7 @@ const jt = /* @__PURE__ */ j(Rt, [["render", It], ["__scopeId", "data-v-85bce7b7
468
491
  },
469
492
  column() {
470
493
  let { columns: t, T: e } = this, i = t || e;
471
- return dt(i) ? [] : at(i) ? i : [i];
494
+ return at(i) ? [] : ut(i) ? i : [i];
472
495
  }
473
496
  },
474
497
  props: {
@@ -491,7 +514,7 @@ const jt = /* @__PURE__ */ j(Rt, [["render", It], ["__scopeId", "data-v-85bce7b7
491
514
  }
492
515
  },
493
516
  mounted() {
494
- this.$.vnode.ref && B(this, { ...this.component });
517
+ this.$.vnode.ref && L(this, { ...this.component });
495
518
  },
496
519
  methods: {
497
520
  __trigger(t) {
@@ -500,25 +523,28 @@ const jt = /* @__PURE__ */ j(Rt, [["render", It], ["__scopeId", "data-v-85bce7b7
500
523
  }
501
524
  }
502
525
  };
503
- function Dt(t, e, i, r, n, l) {
504
- return N(), $t(Nt(i.type), I({ ref: "component" }, t.$attrs), {
505
- default: zt(() => [
506
- (N(!0), M(ut, null, ft(l.column, (s) => g(t.$slots, l.__trigger(s), I({
526
+ function Jt(t, e, i, r, l, n) {
527
+ return T(), kt(Mt(i.type), B({ ref: "component" }, t.$attrs), {
528
+ default: Ot(() => [
529
+ (T(!0), O(ft, null, pt(n.column, (s) => d(t.$slots, n.__trigger(s), B({
507
530
  key: s.type
508
531
  }, { ref_for: !0 }, s))), 128))
509
532
  ]),
510
533
  _: 3
511
534
  }, 16);
512
535
  }
513
- const Gt = /* @__PURE__ */ j(Ft, [["render", Dt]]), rt = /(?:\,|\|{2})/, lt = "px", nt = "";
514
- let _t = document.documentElement, ot, ht = ["s-left", "s-top", "s-right", "s-bottom"], Ut = { left: 0, top: 1, right: 2, bottom: 3 };
515
- const V = [];
516
- var Vt = Tt(
536
+ const Kt = /* @__PURE__ */ F(Yt, [["render", Jt]]), Qt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
537
+ __proto__: null,
538
+ default: Kt
539
+ }, Symbol.toStringTag, { value: "Module" })), rt = /(?:\,|\|{2})/, nt = "px", lt = "";
540
+ let mt = document.documentElement, ot, ht = ["s-left", "s-top", "s-right", "s-bottom"], Zt = { left: 0, top: 1, right: 2, bottom: 3 };
541
+ const q = [];
542
+ var te = jt(
517
543
  window,
518
544
  "Reflect.defineProperty|Object.defineProperty=>Proxy"
519
545
  ).Proxy;
520
- let q = {}, wt = null;
521
- Vt(q, "delay", {
546
+ let U = {}, bt = null;
547
+ te(U, "delay", {
522
548
  /**
523
549
  * 获取延迟时间值
524
550
  * @returns {number} 返回当前实例的延迟时间属性值
@@ -527,79 +553,83 @@ Vt(q, "delay", {
527
553
  return this._delay;
528
554
  },
529
555
  set(t) {
530
- wt = qt(() => {
531
- p(V);
556
+ bt = ee(() => {
557
+ g(q);
532
558
  }, t), this._delay = t;
533
559
  }
534
560
  });
535
- q.delay = 60;
536
- function qt(t, e) {
561
+ U.delay = 60;
562
+ function ee(t, e) {
537
563
  let i = 0;
538
564
  return function() {
539
565
  const r = Date.now();
540
- r - i >= e && (i = r, p(t, this, arguments));
566
+ r - i >= e && (i = r, g(t, this, arguments));
541
567
  };
542
568
  }
543
- const A = () => {
544
- wt();
569
+ const W = () => {
570
+ bt();
545
571
  };
546
- function Xt(t) {
547
- V.push(t);
572
+ function ie(t) {
573
+ q.push(t);
548
574
  }
549
- const L = new ResizeObserver(A);
550
- L.observe(_t);
551
- function bt(t) {
552
- t.onresize || (V.push([bt, null, t]), t.onresize = !0);
553
- var e = _t, i = e.clientHeight, r = kt(t.offset) ? 15 : t.offset, n = t.target, l = t.room, s = t.index, h = t.position, o = n.getBoundingClientRect(), d = l.offsetHeight + r, c = l.offsetWidth + r, u = "3,0,2,1".split(rt), f, a = (o.height == ot ? o.bottom - o.top : o.height) >> 0, v = (o.width == ot ? o.right - o.left : o.width) >> 0, x = e.clientWidth - c, E = i - d, S = [
575
+ const E = new ResizeObserver(W);
576
+ E.observe(mt);
577
+ function wt(t) {
578
+ t.onresize || (q.push([wt, null, t]), t.onresize = !0);
579
+ var e = mt, i = e.clientHeight, r = Pt(t.offset) ? 15 : t.offset, l = t.target, n = t.room, s = t.index, h = t.position, o = l.getBoundingClientRect(), u = n.offsetHeight + r, c = n.offsetWidth + r, f = "3,0,2,1".split(rt), p, a = (o.height == ot ? o.bottom - o.top : o.height) >> 0, S = (o.width == ot ? o.right - o.left : o.width) >> 0, x = e.clientWidth - c, P = i - u, $ = [
554
580
  /* left: 0 */
555
581
  o.left - c,
556
582
  /* top: 1 */
557
- o.top - d,
583
+ o.top - u,
558
584
  /* right: 2 */
559
585
  x - o.right,
560
586
  /* bottom: 3 */
561
- E - o.bottom
587
+ P - o.bottom
562
588
  ];
563
589
  h && (Z(
564
590
  h.split(rt),
565
- function(vt, R, F, xt) {
566
- xt.push(F[R]);
567
- },
568
- Ut,
569
- f = []
570
- ), u.unshift.apply(u, f)), s = Z(
571
- u,
572
- function(vt, R, F) {
573
- if (F[R] > 0)
591
+ function(xt, R, I, $t) {
592
+ $t.push(I[R]);
593
+ },
594
+ Zt,
595
+ p = []
596
+ ), f.unshift.apply(f, p)), s = Z(
597
+ f,
598
+ function(xt, R, I) {
599
+ if (I[R] > 0)
574
600
  return R;
575
601
  },
576
- S
602
+ $
577
603
  );
578
- var y = 0, _ = 0, w = 0;
604
+ var _ = 0, m = 0, b = 0;
579
605
  if (s != null) {
580
- var m = s == 0 || s == 2, z = s == 3 || s == 1;
581
- y = z ? Math.min(o.left, x) : s == 2 ? o.right + r : S[0], d -= r * +m;
582
- var k = Math.max(o.top, 0), $ = Math.min(
606
+ var y = s == 0 || s == 2, N = s == 3 || s == 1;
607
+ _ = N ? Math.min(o.left, x) : s == 2 ? o.right + r : $[0], u -= r * +y;
608
+ var k = Math.max(o.top, 0), z = Math.min(
583
609
  o.bottom,
584
610
  i
585
- ), X = ($ - d + Math.min(i - d, k)) / 2;
586
- _ = Math.max(
587
- m ? X : s == 3 ? o.top + a + r : Math.min(X, S[1]),
611
+ ), X = (z - u + Math.min(i - u, k)) / 2;
612
+ m = Math.max(
613
+ y ? X : s == 3 ? o.top + a + r : Math.min(X, $[1]),
588
614
  0
589
- ), z && o.left > x && (w = o.left - y - r + v / 2);
615
+ ), N && o.left > x && (b = o.left - _ - r + S / 2);
590
616
  }
591
- let Y = l.classList, H = t.css;
592
- Y.remove(...ht), Y.add(ht[s]), t.index = s, H.left = y + lt, H.top = _ + lt;
593
- let J = H["--tips-arrow-top"] = m ? Math.min(
617
+ let Y = n.classList, j = t.css;
618
+ Y.remove(...ht), Y.add(ht[s]), t.index = s, j.left = _ + nt, j.top = m + nt;
619
+ let J = j["--tips-arrow-top"] = y ? Math.min(
594
620
  /* 底边距 */
595
- Math.max(_, k) - _,
596
- d - r
597
- ) : nt, K = c - 3 * r;
598
- H["--tips-arrow"] = w > K - 10 || m && (J + (d > 50 ? 15 : 0) > d || !J) ? "hidden" : "visible", H["--tips-arrow-left"] = w ? Math.min(w, K) : nt;
621
+ Math.max(m, k) - m,
622
+ u - r
623
+ ) : lt, K = c - 3 * r;
624
+ j["--tips-arrow"] = b > K - 10 || y && (J + (u > 50 ? 15 : 0) > u || !J) ? "hidden" : "visible", j["--tips-arrow-left"] = b ? Math.min(b, K) : lt;
599
625
  }
600
- const D = "data-tips-scroll", Yt = {
626
+ const D = "data-tips-scroll", se = {
601
627
  name: "Tips",
602
628
  props: {
629
+ /* 目标对象 */
630
+ target: {
631
+ type: [HTMLElement]
632
+ },
603
633
  /* 是否显示 */
604
634
  visible: {
605
635
  type: [Boolean, String, Number],
@@ -673,13 +703,13 @@ const D = "data-tips-scroll", Yt = {
673
703
  };
674
704
  },
675
705
  methods: {
676
- parent(t) {
706
+ __parent(t) {
677
707
  let e = this.$el, i;
678
- for (; e && (e = e.parentNode, e && e.nodeType == 1 || (e = window, i = !0), p(t, null, e, i), !i); )
708
+ for (; e && (e = e.parentNode, e && e.nodeType == 1 || (e = window, i = !0), g(t, null, e, i), !i); )
679
709
  ;
680
710
  },
681
- attr(t, e, i) {
682
- return p(
711
+ __attr(t, e, i) {
712
+ return g(
683
713
  t[i === void 0 ? "getAttribute" : "setAttribute"],
684
714
  t,
685
715
  e,
@@ -688,12 +718,13 @@ const D = "data-tips-scroll", Yt = {
688
718
  },
689
719
  /* 初始化 */
690
720
  init() {
691
- this.$el.nodeName != "#comment" && bt({
721
+ let t = this.$el;
722
+ t.nodeName != "#comment" && wt({
692
723
  onresize: !1,
693
724
  /* 监控的目标 */
694
- target: this.$el.parentNode,
725
+ target: t.parentNode,
695
726
  /* 显示的元素 */
696
- room: this.$el,
727
+ room: t,
697
728
  /* 显示位置 */
698
729
  position: this.position,
699
730
  /* CSS样式集合 */
@@ -702,57 +733,65 @@ const D = "data-tips-scroll", Yt = {
702
733
  offset: +this.offset >> 0
703
734
  });
704
735
  },
705
- scrollListener() {
706
- this.static || this.parent((t, e, i) => {
707
- e ? p(t.addEventListener, t, "scroll", A) : (p(L.observe, L, t), (t.offsetHeight < t.scrollHeight || t.offsetWidth < t.scrollWidth) && (i = this.attr(t, D), i || (p(t.addEventListener, t, "scroll", A), this.attr(t, D, "true"))));
736
+ __2listener() {
737
+ this.static || this.__parent((t, e, i) => {
738
+ e ? g(t.addEventListener, t, "scroll", W) : (g(E.observe, E, t), (t.offsetHeight < t.scrollHeight || t.offsetWidth < t.scrollWidth) && (i = this.__attr(t, D), i || (g(t.addEventListener, t, "scroll", W), this.__attr(t, D, "true"))));
708
739
  });
740
+ },
741
+ __css() {
742
+ let t = {}, e;
743
+ return this.target ? e = {
744
+ [this.position]: this.offset + "px"
745
+ } : (e = C(
746
+ this.$props,
747
+ "color=>--tips-color,background=>--tips-background-color,border=>--tips-border-width,fontSize=>--tips-font-size,borderRadius=>--tips-border-radius"
748
+ ), t["--arrow-size"] = Math.sqrt(2 * Math.pow((this.border || 3) * 2 + 2, 2)) / 2 >> 0), L(t, e), t;
749
+ },
750
+ __2next() {
751
+ this.target || (this.init(), U.delay = +this.delay, ie((t) => {
752
+ this.__2listener();
753
+ }), this.__2listener());
709
754
  }
710
755
  },
711
756
  mounted() {
712
- B(
713
- this.css,
714
- O(
715
- this.$props,
716
- "color=>--tips-color,background=>--tips-background-color,border=>--tips-border-width,fontSize=>--tips-font-size,borderRadius=>--tips-border-radius"
717
- )
718
- ), this.css["--arrow-size"] = Math.sqrt(2 * Math.pow((this.border || 3) * 2 + 2, 2)) / 2 >> 0, this.init(), q.delay = +this.delay, Xt((t) => {
719
- this.scrollListener();
720
- }), this.scrollListener();
757
+ this.css = this.__css(), this.__2next();
721
758
  },
722
759
  unmounted() {
723
- this.parent(function(t, e) {
724
- p(t.removeEventListener, t, "scroll", A), p(t.removeAttribute, t, D, void 0), e || p(L.unobserve, L, t);
760
+ this.__parent(function(t, e) {
761
+ g(t.removeEventListener, t, "scroll", W), g(t.removeAttribute, t, D, void 0), e || g(E.unobserve, E, t);
725
762
  });
726
763
  }
727
- }, Jt = ["static"], Kt = { class: "tips-title" };
728
- function Qt(t, e, i, r, n, l) {
729
- return i.visible ? (N(), M("div", I({
730
- key: 0,
731
- class: "tips",
732
- style: i.static ? null : n.css,
764
+ }, re = ["static"], ne = { class: "tips-title" };
765
+ function le(t, e, i, r, l, n) {
766
+ return i.visible ? (T(), O("div", B({ key: 0 }, t.$attrs, {
767
+ class: ["tips", i.target ? "tips-" + i.position : ""],
768
+ style: i.static ? null : l.css,
733
769
  static: i.static ? "" : null
734
- }, t.$attrs), [
735
- g(t.$slots, "default", {}, () => [
736
- g(t.$slots, "title", {}, () => [
737
- W("div", Kt, G(i.title), 1)
770
+ }), [
771
+ d(t.$slots, "default", {}, () => [
772
+ d(t.$slots, "title", {}, () => [
773
+ M("div", ne, G(i.title), 1)
738
774
  ], !0),
739
- g(t.$slots, "content", {}, () => [
740
- gt(G(i.content), 1)
775
+ d(t.$slots, "content", {}, () => [
776
+ ct(G(i.content), 1)
741
777
  ], !0)
742
778
  ], !0)
743
- ], 16, Jt)) : pt("", !0);
779
+ ], 16, re)) : gt("", !0);
744
780
  }
745
- const Zt = /* @__PURE__ */ j(Yt, [["render", Qt], ["__scopeId", "data-v-e7d22ab3"]]), te = [Wt, jt, Gt, Zt], le = {
746
- install(t) {
747
- te.forEach((e) => {
748
- t.component("S" + e.name, e), t.component(e.name + "S", e);
749
- });
750
- }
781
+ const oe = /* @__PURE__ */ F(se, [["render", le], ["__scopeId", "data-v-9b313627"]]), he = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
782
+ __proto__: null,
783
+ default: oe
784
+ }, Symbol.toStringTag, { value: "Module" })), ae = /* @__PURE__ */ Object.assign({ "./components/Card.vue": It, "./components/Flyweight.vue": Xt, "./components/Stream.vue": Qt, "./components/Tips.vue": he }), vt = [], St = {};
785
+ for (const [t, e] of Object.entries(ae)) {
786
+ const i = t.split("/").pop().replace(/\.vue$/, "");
787
+ St[i] = e.default, vt.push(e.default);
788
+ }
789
+ St.install = function(t, e = {}) {
790
+ vt.forEach((i) => {
791
+ t.component(i.name, i), t.component("S" + i.name, i), t.component(i.name + "S", i);
792
+ });
751
793
  };
752
794
  export {
753
- jt as Card,
754
- Wt as Flyweight,
755
- Gt as Stream,
756
- Zt as Tips,
757
- le as default
795
+ St as components,
796
+ St as default
758
797
  };