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