@soei/flyweight 0.3.7 → 0.3.9

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,59 +1,61 @@
1
- import { runer as y, merge as R, isArray as W, each as w, picker as k, isEmpty as E, isSimplyType as O, isString as U } from "@soei/util";
2
- let X = /(\d+|[+\-\*/]|%)/g, A = {
3
- "+": (e, t) => e + t,
4
- "-": (e, t) => e - t,
5
- "*": (e, t) => e * t,
6
- "/": (e, t) => e / t,
7
- "%": (e, t, s) => parseFloat(e) / 100 * s
8
- }, H = (e, t) => {
9
- let s;
10
- if (s = y("match", e, X)) {
11
- let i = s.length, l, a = 0, r, h = [];
12
- for (; i--; )
13
- a = s.shift(), a in A ? (l && h.push(l), a === "%" && (h.length = 2), r = a) : +a && h.push(+a), h.length == 2 && (h.push(t), l = A[r].apply(null, h), h.length = 0);
14
- +l || (l = +h.pop()), e = l >> 0;
1
+ import { runer as T, merge as E, isArray as Z, each as R, picker as W, isEmpty as tt, isSimplyType as U, isString as ht } from "@soei/util";
2
+ import { runer as g, each as X } from "@soei/tools";
3
+ import at from "@soei/picker";
4
+ let ct = /(\d+|[+\-\*/]|%)/g, G = {
5
+ "+": (t, e) => t + e,
6
+ "-": (t, e) => t - e,
7
+ "*": (t, e) => t * e,
8
+ "/": (t, e) => t / e,
9
+ "%": (t, e, i) => parseFloat(t) / 100 * i
10
+ }, D = (t, e) => {
11
+ let i;
12
+ if (i = T("match", t, ct)) {
13
+ let s = i.length, l, a = 0, n, o = [];
14
+ for (; s--; )
15
+ a = i.shift(), a in G ? (l && o.push(l), a === "%" && (o.length = 2), n = a) : +a && o.push(+a), o.length == 2 && (o.push(e), l = G[n].apply(null, o), o.length = 0);
16
+ +l || (l = +o.pop()), t = l >> 0;
15
17
  }
16
- return e;
17
- }, L = {}, g = (e, t) => (e + "").replace(
18
+ return t;
19
+ }, V = {}, w = (t, e) => (t + "").replace(
18
20
  /\w+\((.*)\)/g,
19
21
  "$1"
20
22
  ).replace(
21
- L[t] || (L[t] = new RegExp("(?=\\s+|^)(\\d+)(?:\\.\\d{1,})?(?!(?:\\.)*\\d|%|\\w)", "g")),
23
+ V[e] || (V[e] = new RegExp("(?=\\s+|^)(\\d+)(?:\\.\\d{1,})?(?!(?:\\.)*\\d|%|\\w)", "g")),
22
24
  "$1px"
23
25
  );
24
- function F(e, t, s, i, l, a, r, h) {
25
- var n = typeof e == "function" ? e.options : e;
26
- t && (n.render = t, n.staticRenderFns = s, n._compiled = !0), i && (n.functional = !0), a && (n._scopeId = "data-v-" + a);
27
- var u;
28
- if (r ? (u = function(c) {
26
+ function A(t, e, i, s, l, a, n, o) {
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);
29
+ var h;
30
+ if (n ? (h = function(c) {
29
31
  c = c || // cached call
30
32
  this.$vnode && this.$vnode.ssrContext || // stateful
31
- this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !c && typeof __VUE_SSR_CONTEXT__ < "u" && (c = __VUE_SSR_CONTEXT__), l && l.call(this, c), c && c._registeredComponents && c._registeredComponents.add(r);
32
- }, n._ssrRegister = u) : l && (u = h ? function() {
33
+ this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !c && typeof __VUE_SSR_CONTEXT__ < "u" && (c = __VUE_SSR_CONTEXT__), l && l.call(this, c), c && c._registeredComponents && c._registeredComponents.add(n);
34
+ }, r._ssrRegister = h) : l && (h = o ? function() {
33
35
  l.call(
34
36
  this,
35
- (n.functional ? this.parent : this).$root.$options.shadowRoot
37
+ (r.functional ? this.parent : this).$root.$options.shadowRoot
36
38
  );
37
- } : l), u)
38
- if (n.functional) {
39
- n._injectStyles = u;
40
- var f = n.render;
41
- n.render = function(o, p) {
42
- return u.call(p), f(o, p);
39
+ } : l), h)
40
+ if (r.functional) {
41
+ r._injectStyles = h;
42
+ var u = r.render;
43
+ r.render = function(f, p) {
44
+ return h.call(p), u(f, p);
43
45
  };
44
46
  } else {
45
- var d = n.beforeCreate;
46
- n.beforeCreate = d ? [].concat(d, u) : [u];
47
+ var d = r.beforeCreate;
48
+ r.beforeCreate = d ? [].concat(d, h) : [h];
47
49
  }
48
50
  return {
49
- exports: e,
50
- options: n
51
+ exports: t,
52
+ options: r
51
53
  };
52
54
  }
53
- let B = (e) => e == null || e == null, j = (...e) => {
54
- console.info("::::FLYWEIGHT", ...e);
55
+ let Y = (t) => t == null || t == null, ft = (...t) => {
56
+ console.info("::::FLYWEIGHT", ...t);
55
57
  };
56
- const G = {
58
+ const ut = {
57
59
  name: "Flyweight",
58
60
  props: {
59
61
  flys: {
@@ -61,11 +63,11 @@ const G = {
61
63
  default: () => []
62
64
  },
63
65
  width: {
64
- type: Number,
66
+ type: [String, Number],
65
67
  default: 0
66
68
  },
67
69
  height: {
68
- type: Number,
70
+ type: [String, Number],
69
71
  default: 100
70
72
  },
71
73
  w: {
@@ -91,12 +93,12 @@ const G = {
91
93
  default: 0
92
94
  },
93
95
  top: {
94
- type: Number,
95
- default: !1
96
+ type: [String, Number],
97
+ default: 0
96
98
  },
97
99
  left: {
98
- type: Number,
99
- default: !1
100
+ type: [String, Number],
101
+ default: 0
100
102
  },
101
103
  auto: {
102
104
  type: [Boolean, String],
@@ -116,16 +118,16 @@ const G = {
116
118
  return this.$refs.flyweight || "";
117
119
  },
118
120
  style() {
119
- var e = this.w, t = this.h, s = this.Size, i = {};
120
- return R(i, {
121
- "--width": g(this.realW),
122
- "--height": g(this.realH),
123
- "--flyweight-content": g(s)
124
- }, t && {
125
- "--flyweight-h": g(t)
126
- }, e && i, {
127
- "--flyweight-w": g(e)
128
- }, "mix"), i;
121
+ var t = this.w, e = this.h, i = this.Size, s = {};
122
+ return E(s, {
123
+ "--width": w(this.realW),
124
+ "--height": w(this.realH),
125
+ "--flyweight-content": w(i)
126
+ }, e && {
127
+ "--flyweight-h": w(e)
128
+ }, t && s, {
129
+ "--flyweight-w": w(t)
130
+ }, "mix"), s;
129
131
  }
130
132
  },
131
133
  data() {
@@ -143,151 +145,151 @@ const G = {
143
145
  };
144
146
  },
145
147
  watch: {
146
- flys(e) {
147
- this.count = e.length, this.rebuild();
148
- let t = this.task.shift();
149
- t && this.$nextTick(() => {
150
- this.setview(t);
148
+ flys(t) {
149
+ this.count = t.length, this.rebuild();
150
+ let e = this.task.shift();
151
+ e && this.$nextTick(() => {
152
+ this.setview(e);
151
153
  });
152
154
  },
153
155
  view: {
154
- handler(e) {
155
- this.setview(e);
156
+ handler(t) {
157
+ this.setview(t);
156
158
  },
157
159
  immediate: !0,
158
160
  deep: !0
159
161
  },
160
- index(e) {
161
- this.setindex(e);
162
+ index(t) {
163
+ this.setindex(t);
162
164
  },
163
- top(e) {
164
- this.flyweight.scrollTop = e;
165
+ top(t) {
166
+ this.flyweight.scrollTop = t;
165
167
  },
166
- left(e) {
167
- this.flyweight.scrollLeft = e;
168
+ left(t) {
169
+ this.flyweight.scrollLeft = t;
168
170
  }
169
171
  },
170
172
  mounted() {
171
- this.flyweights = [], this.$set || (this.$set = (e, t, s) => {
172
- e[t] = s;
173
+ this.flyweights = [], this.$set || (this.$set = (t, e, i) => {
174
+ t[e] = i;
173
175
  }), this.setindex(this.index);
174
176
  try {
175
177
  new ResizeObserver(() => {
176
178
  this.rebuild(), this.$emit("resize");
177
179
  }).observe(this.flyweight);
178
- } catch (e) {
179
- j(e);
180
+ } catch (t) {
181
+ ft(t);
180
182
  }
181
- this.scrollx = y("hasAttribute", this.flyweight, "scroll-x"), this.BoxRule = /* this.scrollx ? 'clientHeight=>width,clientWidth=>height' : */
183
+ this.scrollx = T("hasAttribute", this.flyweight, "scroll-x"), this.BoxRule = /* this.scrollx ? 'clientHeight=>width,clientWidth=>height' : */
182
184
  "clientHeight=>height,clientWidth=>width", this.direction = this.scrollx ? "scrollLeft" : "scrollTop";
183
185
  },
184
186
  methods: {
185
- exec: g,
186
- trigger(e, t) {
187
- W(e) || (e = e && t ? [[e, t]] : []), e.length && this.lazyrun(() => {
188
- w(e, (s, i) => {
189
- this.$emit(i[0], B(i[1]) ? !0 : i[1]);
187
+ exec: w,
188
+ trigger(t, e) {
189
+ Z(t) || (t = t && e ? [[t, e]] : []), t.length && this.lazyrun(() => {
190
+ R(t, (i, s) => {
191
+ this.$emit(s[0], Y(s[1]) ? !0 : s[1]);
190
192
  });
191
193
  });
192
194
  },
193
- cheackflys(e) {
195
+ cheackflys(t) {
194
196
  if (!this.flys.length)
195
- return e && this.task.push(e), !0;
196
- },
197
- setview(e) {
198
- y([this.cheackflys, (t) => {
199
- t = t || {};
200
- let s = t.index || w(this.flys, (i, l, a, r) => {
201
- if (l[a] == r)
202
- return i;
203
- }, t.picker, t.id);
204
- B(s) || this.setindex(s);
205
- }], this, e);
206
- },
207
- setindex(e) {
208
- y([this.cheackflys, ({ index: t }) => {
209
- this.selectIndex = t, this.$nextTick(() => {
210
- let s = t / this.column >> 0, i = this.expand;
211
- (this.flyweight[this.direction] / i >> 0) + this.row - s - 1 > 0 || (this.flyweight[this.direction] = s * i, this.scroll());
197
+ return t && this.task.push(t), !0;
198
+ },
199
+ setview(t) {
200
+ T([this.cheackflys, (e) => {
201
+ e = e || {};
202
+ let i = e.index || R(this.flys, (s, l, a, n) => {
203
+ if (l[a] == n)
204
+ return s;
205
+ }, e.picker, e.id);
206
+ Y(i) || this.setindex(i);
207
+ }], this, t);
208
+ },
209
+ setindex(t) {
210
+ T([this.cheackflys, ({ index: e }) => {
211
+ this.selectIndex = e, this.$nextTick(() => {
212
+ let i = e / this.column >> 0, s = this.expand;
213
+ (this.flyweight[this.direction] / s >> 0) + this.row - i - 1 > 0 || (this.flyweight[this.direction] = i * s, this.scroll());
212
214
  });
213
- }], this, { index: e });
215
+ }], this, { index: t });
214
216
  },
215
- lazyrun(e, t) {
217
+ lazyrun(t, e) {
216
218
  clearTimeout(this.time), this.time = setTimeout(() => {
217
- y(e);
218
- }, t || this.lazy);
219
+ T(t);
220
+ }, e || this.lazy);
219
221
  },
220
- run(e) {
221
- let t = [], s = y(this.direction, e.target), i = {
222
+ run(t) {
223
+ let e = [], i = T(this.direction, t.target), s = {
222
224
  // ...this
223
- offset: s,
224
- top: s,
225
+ offset: i,
226
+ top: i,
225
227
  width: this.realW,
226
228
  height: this.realH,
227
229
  /* 显示区域第一行的索引 */
228
- index: s / this.expand >> 0
230
+ index: i / this.expand >> 0
229
231
  };
230
- R(i, this.space), e.from || t.push(["onscroll", i]);
232
+ E(s, this.space), t.from || e.push(["onscroll", s]);
231
233
  let l = !1;
232
- w(
234
+ R(
233
235
  this.flyweights,
234
- (a, r, h, n, u, f, d, c, o) => {
235
- if (h = a / u >> 0, c = h + n * /* 偏移量, 如果超出顶部 + 1轮,排列到列队后, 否则保持在当前*/
236
- (+(h < f % n) + (f / n >> 0)), o = c * u + a % u, o >= this.count) {
237
- l || (t.push(["onend"]), l = !0);
236
+ (a, n, o, r, h, u, d, c, f) => {
237
+ if (o = a / h >> 0, c = o + r * /* 偏移量, 如果超出顶部 + 1轮,排列到列队后, 否则保持在当前*/
238
+ (+(o < u % r) + (u / r >> 0)), f = c * h + a % h, f >= this.count) {
239
+ l || (e.push(["onend"]), l = !0);
238
240
  return;
239
241
  }
240
- r.index = c, r.i = o, r.data = this.flys[o];
242
+ n.index = c, n.i = f, n.data = this.flys[f];
241
243
  let p = [
242
244
  /* top */
243
- c * this.expand + r.x,
245
+ c * this.expand + n.x,
244
246
  /* left */
245
- r.space
247
+ n.space
246
248
  ];
247
- d && p.reverse(), r.top = p[0], r.left = p[1];
249
+ d && p.reverse(), n.top = p[0], n.left = p[1];
248
250
  },
249
251
  null,
250
252
  this.row,
251
253
  this.column,
252
254
  /* 显示区域第一行的索引 */
253
- i.index,
255
+ s.index,
254
256
  this.scrollx
255
- ), this.trigger(t), t = null;
257
+ ), this.trigger(e), e = null;
256
258
  },
257
- scroll(e) {
258
- this.run(e || { target: this.flyweight, from: "space" });
259
+ scroll(t) {
260
+ this.run(t || { target: this.flyweight, from: "space" });
259
261
  },
260
262
  rebuild() {
261
- let e = this.count || this.flys.length, t = this.flyweights;
262
- if (!e)
263
- return t.length = e;
264
- this.count = e;
265
- let s = this.scrollx, i = this.flyweight, l = k(i, this.BoxRule);
263
+ let t = this.count || this.flys.length, e = this.flyweights;
264
+ if (!t)
265
+ return e.length = t;
266
+ this.count = t;
267
+ let i = this.scrollx, s = this.flyweight, l = W(s, this.BoxRule);
266
268
  this.$nextTick(() => {
267
- let a = /true/.test(this.auto), [r, h] = this.offset, n = l.width, u = l.height, f = (H(this.width, n) || n) + r, d = H(this.height, u) + h, c = [n / f >> 0 || 1, u / d >> 0 || 1];
268
- s && c.reverse();
269
- let [o, p] = c, v = this.padding, b, $ = 0, _, S;
270
- s ? (_ = f, f -= r, S = (m) => (
269
+ let a = /true/.test(this.auto), [n, o] = this.offset, r = l.width, h = l.height, u = (D(this.width, r) || r) + n, d = D(this.height, h) + o, c = [r / u >> 0 || 1, h / d >> 0 || 1];
270
+ i && c.reverse();
271
+ let [f, p] = c, b = this.padding, C, x = 0, _, y;
272
+ i ? (_ = u, u -= n, y = (v) => (
271
273
  /* 计算top偏移量 */
272
- m * (d - h) + (m + 1) * h
273
- )) : (a ? (f = (n - r * (o + 2 * v - 1)) / o, b = !v * r, $ = v * r) : (b = 0, $ = (n % f + r * o) / (o + 1) >> 0, f -= r), S = (m) => m * (f + b) + (m + 1) * $, _ = d), this.row = p + 2, this.column = o, this.realH = d - h, this.realW = f, this.expand = _, this.Size = Math.ceil(e / o) * _;
274
- let T = Math.min(e, o * this.row), x = T - 1, C;
275
- for (; T-- > 0; )
276
- C = x - T, this.$set(t, C, {
277
- x: r,
278
- y: h,
279
- width: f,
280
- height: d - h,
281
- space: S(C % o),
274
+ v * (d - o) + (v + 1) * o
275
+ )) : (a ? (u = (r - n * (f + 2 * b - 1)) / f, C = !b * n, x = b * n) : (C = 0, x = (r % u + n * f) / (f + 1) >> 0, u -= n), y = (v) => v * (u + C) + (v + 1) * x, _ = d), this.row = p + 2, this.column = f, this.realH = d - o, this.realW = u, this.expand = _, this.Size = Math.ceil(t / f) * _;
276
+ let S = Math.min(t, f * this.row), m = S - 1, $;
277
+ for (; S-- > 0; )
278
+ $ = m - S, this.$set(e, $, {
279
+ x: n,
280
+ y: o,
281
+ width: u,
282
+ height: d - o,
283
+ space: y($ % f),
282
284
  data: {}
283
285
  });
284
- t.length = x + 1;
286
+ e.length = m + 1;
285
287
  let z = [];
286
- u / _ > x / o && z.push(["onend"]), this.flyweight && (this.flyweight[this.direction] = 0), this.$nextTick(() => {
288
+ h / _ > m / f && z.push(["onend"]), this.flyweight && (this.flyweight[this.direction] = 0), this.$nextTick(() => {
287
289
  this.setindex(this.selectIndex || 0), this.scroll();
288
290
  }), z.push(["update:space", {
289
- row: (x / o >> 0) + 1,
290
- column: o,
291
+ row: (m / f >> 0) + 1,
292
+ column: f,
291
293
  showrow: this.row,
292
294
  showcolumn: this.column
293
295
  }]), this.trigger(z);
@@ -295,44 +297,44 @@ const G = {
295
297
  }
296
298
  }
297
299
  };
298
- var V = function() {
299
- var t = this, s = t._self._c;
300
- return s("div", { ref: "flyweight", staticClass: "flyweight", class: {
301
- "flyweight-active": t.actice
302
- }, style: t.style, on: { scroll: t.scroll } }, [s("div", { staticClass: "flyweight-all" }, t._l(t.flyweights, function(i, l) {
303
- return s("div", { key: l, style: {
304
- top: i.top + "px",
305
- left: i.left + "px"
306
- } }, [t._t("default", null, null, i)], 2);
307
- }), 0), t.flyweights.length ? t._t("end") : t._e()], 2);
308
- }, Y = [], q = /* @__PURE__ */ F(
309
- G,
310
- V,
311
- Y,
300
+ var dt = function() {
301
+ var e = this, i = e._self._c;
302
+ return i("div", { ref: "flyweight", staticClass: "flyweight", class: {
303
+ "flyweight-active": e.actice
304
+ }, style: e.style, on: { scroll: e.scroll } }, [i("div", { staticClass: "flyweight-all" }, e._l(e.flyweights, function(s, l) {
305
+ return i("div", { key: l, style: {
306
+ top: s.top + "px",
307
+ left: s.left + "px"
308
+ } }, [e._t("default", null, null, s)], 2);
309
+ }), 0), e.flyweights.length ? e._t("end") : e._e()], 2);
310
+ }, pt = [], gt = /* @__PURE__ */ A(
311
+ ut,
312
+ dt,
313
+ pt,
312
314
  !1,
313
315
  null,
314
- "3416ac53",
316
+ "d5f1cd63",
315
317
  null,
316
318
  null
317
319
  );
318
- const D = q.exports;
319
- function N(e, t) {
320
- return t && (e = e.replace(/[a-z]/g, "")), e.toLowerCase();
320
+ const _t = gt.exports;
321
+ function F(t, e) {
322
+ return e && (t = t.replace(/[a-z]/g, "")), t.toLowerCase();
321
323
  }
322
- let I = {
324
+ let et = {
323
325
  close: {
324
- handler(e) {
325
- this.change(e);
326
+ handler(t) {
327
+ this.change(t);
326
328
  },
327
329
  deep: !0
328
330
  },
329
331
  offset: {
330
- handler(e) {
331
- this.margin(e);
332
+ handler(t) {
333
+ this.margin(t);
332
334
  },
333
335
  deep: !0
334
336
  }
335
- }, J = [
337
+ }, yt = [
336
338
  "BackGround",
337
339
  "BordeR",
338
340
  "Height",
@@ -341,17 +343,17 @@ let I = {
341
343
  "Right",
342
344
  "Bottom",
343
345
  "Left"
344
- ], M = {};
345
- w(
346
- J,
347
- (e, t, s) => {
348
- e = N(t), M["--" + N(t, !0)] = e, s[e] = function() {
346
+ ], it = {};
347
+ R(
348
+ yt,
349
+ (t, e, i) => {
350
+ t = F(e), it["--" + F(e, !0)] = t, i[t] = function() {
349
351
  this.trigger++;
350
352
  };
351
353
  },
352
- I
354
+ et
353
355
  );
354
- const K = {
356
+ const mt = {
355
357
  name: "Card",
356
358
  // inheritAttrs: false,
357
359
  props: {
@@ -410,33 +412,33 @@ const K = {
410
412
  return this.tr();
411
413
  }
412
414
  },
413
- watch: I,
415
+ watch: et,
414
416
  methods: {
415
- exec: g,
416
- isEmpty: E,
417
- isSimplyType: O,
417
+ exec: w,
418
+ isEmpty: tt,
419
+ isSimplyType: U,
418
420
  tr() {
419
- let e = {};
420
- return this.margin(this.offset), w(M, (t, s) => {
421
- this.css(e, t, s);
422
- }), e;
423
- },
424
- tolower: N,
425
- css(e, t, s) {
426
- let i = this[s] || this.default[s];
427
- !i || this.default[s] == i || (e[t] = g(i));
428
- },
429
- change(e) {
430
- O(e) || (this.closecss = k(
431
- e,
421
+ let t = {};
422
+ return this.margin(this.offset), R(it, (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
+ U(t) || (this.closecss = W(
433
+ t,
432
434
  "color=>--s-card-close-color,size=>--s-close-width,bold=>--s-close-height,*"
433
435
  ));
434
436
  },
435
- margin(e) {
436
- R(
437
+ margin(t) {
438
+ E(
437
439
  this,
438
- k(
439
- U(e) ? e.split(/\s*(?:,|\s+)\s*/) : e,
440
+ W(
441
+ ht(t) ? t.split(/\s*(?:,|\s+)\s*/) : t,
440
442
  "0=>top,1|0=>right,2|0=>bottom,3|1|0=>left",
441
443
  !0
442
444
  ),
@@ -448,34 +450,34 @@ const K = {
448
450
  this.change(this.close);
449
451
  }
450
452
  };
451
- var P = function() {
452
- var t = this, s = t._self._c;
453
- return s("div", { key: t.trigger, staticClass: "card", style: t.isEmpty(t.style) ? t.tr() : t.style }, [t._t("default", function() {
454
- return [t._t("title", function() {
455
- var i;
456
- return [s("div", { staticClass: "card-title" }, [t._v(" " + t._s(t.show || t.title) + " "), s("div", { staticClass: "card-close", class: { hide: t.isSimplyType(t.close) ? !t.close : !1 }, style: t.closecss, attrs: { title: (i = t.close) == null ? void 0 : i.tips }, on: { click: function(l) {
457
- return t.$emit("close");
453
+ var vt = 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");
458
460
  } } })])];
459
- }), t._t("content", function() {
460
- return [s("div", { staticClass: "card-content" }, [t._t("inner")], 2)];
461
+ }), e._t("content", function() {
462
+ return [i("div", { staticClass: "card-content" }, [e._t("inner")], 2)];
461
463
  })];
462
464
  })], 2);
463
- }, Q = [], Z = /* @__PURE__ */ F(
464
- K,
465
- P,
466
- Q,
465
+ }, wt = [], bt = /* @__PURE__ */ A(
466
+ mt,
467
+ vt,
468
+ wt,
467
469
  !1,
468
470
  null,
469
- "16139b86",
471
+ "ec96bb2a",
470
472
  null,
471
473
  null
472
474
  );
473
- const tt = Z.exports, et = {
475
+ const xt = bt.exports, St = {
474
476
  name: "Stream",
475
477
  computed: {
476
478
  column() {
477
- let { columns: e, T: t } = this, s = e || t;
478
- return E(s) ? [] : W(s) ? s : [s];
479
+ let { columns: t, T: e } = this, i = t || e;
480
+ return tt(i) ? [] : Z(i) ? i : [i];
479
481
  }
480
482
  },
481
483
  props: {
@@ -497,42 +499,272 @@ const tt = Z.exports, et = {
497
499
  default: () => null
498
500
  },
499
501
  T: {
500
- type: Array,
502
+ type: [Array, Object],
501
503
  default: () => null
502
504
  }
503
505
  },
504
506
  methods: {
505
- trigger(e) {
506
- let t = e[this.bridge] || e.type;
507
- return (this.$slots || this.$scopedSlots)[t] ? t : "default";
507
+ trigger(t) {
508
+ let e = t[this.bridge] || t.type;
509
+ return (this.$slots || this.$scopedSlots)[e] ? e : "default";
508
510
  }
509
511
  }
510
512
  };
511
- var st = function() {
512
- var t = this, s = t._self._c;
513
- return s(t.type, t._b({ tag: "component" }, "component", t.$attrs, !1), [t._l(t.column, function(i) {
514
- return t._t(t.trigger(i), null, null, i);
513
+ var $t = function() {
514
+ var e = this, i = e._self._c;
515
+ return i(e.type, e._b({ tag: "component" }, "component", e.$attrs, !1), [e._l(e.column, function(s) {
516
+ return e._t(e.trigger(s), null, null, s);
515
517
  })], 2);
516
- }, it = [], lt = /* @__PURE__ */ F(
517
- et,
518
- st,
519
- it,
518
+ }, zt = [], Tt = /* @__PURE__ */ A(
519
+ St,
520
+ $t,
521
+ zt,
520
522
  !1,
521
523
  null,
522
524
  null,
523
525
  null,
524
526
  null
525
527
  );
526
- const rt = lt.exports, nt = [D, tt, rt], ot = {
527
- install(e) {
528
- nt.forEach((t) => {
529
- e.component("S" + t.name, t), e.component(t.name + "S", t);
528
+ const Ct = Tt.exports, q = /(?:\,|\|{2})/, H = "px", J = "";
529
+ let st = document.documentElement, K, Q = ["s-left", "s-top", "s-right", "s-bottom"], Nt = { left: 0, top: 1, right: 2, bottom: 3 };
530
+ const P = [];
531
+ var Rt = at(
532
+ window,
533
+ "Reflect.defineProperty|Object.defineProperty=>Proxy"
534
+ ).Proxy;
535
+ let B = {}, rt = null;
536
+ Rt(B, "delay", {
537
+ /**
538
+ * 获取延迟时间值
539
+ * @returns {number} 返回当前实例的延迟时间属性值
540
+ */
541
+ get() {
542
+ return this._delay;
543
+ },
544
+ set(t) {
545
+ rt = kt(() => {
546
+ g(P);
547
+ }, t), this._delay = t;
548
+ }
549
+ });
550
+ B.delay = 60;
551
+ function kt(t, e) {
552
+ let i = 0;
553
+ return function() {
554
+ const s = Date.now();
555
+ s - i >= e && (i = s, g(t, this, arguments));
556
+ };
557
+ }
558
+ const L = () => {
559
+ rt();
560
+ };
561
+ function Mt(t) {
562
+ P.push(t);
563
+ }
564
+ const N = new ResizeObserver(L);
565
+ N.observe(st);
566
+ function nt(t) {
567
+ t.onresize || (P.push([nt, null, t]), t.onresize = !0);
568
+ var e = st, i = e.clientHeight, s = t.offset || 15, l = t.target, a = t.room, n = t.index, o = t.position, r = l.getBoundingClientRect(), h = a.offsetHeight + s, u = a.offsetWidth + s, d = "3,0,2,1".split(q), c, f = (r.height == K ? r.bottom - r.top : r.height) >> 0, p = (r.width == K ? r.right - r.left : r.width) >> 0, b = e.clientWidth - u, C = i - h, x = [
569
+ /* left: 0 */
570
+ r.left - u,
571
+ /* top: 1 */
572
+ r.top - h,
573
+ /* right: 2 */
574
+ b - r.right,
575
+ /* bottom: 3 */
576
+ C - r.bottom
577
+ ];
578
+ o && (X(
579
+ o.split(q),
580
+ function(lt, M, O, ot) {
581
+ ot.push(O[M]);
582
+ },
583
+ Nt,
584
+ c = []
585
+ ), d.unshift.apply(d, c)), n = X(
586
+ d,
587
+ function(lt, M, O) {
588
+ if (O[M] > 0)
589
+ return M;
590
+ },
591
+ x
592
+ );
593
+ var _ = 0, y = 0, S = 0;
594
+ if (n != null) {
595
+ var m = n == 0 || n == 2, $ = n == 3 || n == 1;
596
+ _ = $ ? Math.min(r.left, b) : n == 2 ? r.right + s : x[0], h -= s * +m;
597
+ var z = Math.max(r.top, 0), v = Math.min(
598
+ r.bottom,
599
+ i
600
+ ), I = (v - h + Math.min(i - h, z)) / 2;
601
+ y = Math.max(
602
+ m ? I : n == 3 ? r.top + f + s : Math.min(I, x[1]),
603
+ 0
604
+ ), $ && r.left > b && (S = r.left - _ - s + p / 2);
605
+ }
606
+ let j = a.classList, k = t.css;
607
+ j.remove(...Q), j.add(Q[n]), t.index = n, k.left = _ + H, k.top = y + H, k["--tips-position-top"] = m ? Math.max(
608
+ s,
609
+ Math.min(
610
+ /* 底边距 */
611
+ (Math.min(y + h, v) + Math.max(y, z)) / 2 - y + s / 2,
612
+ /* 容器高度 - offset / 2 */
613
+ h - 0.5 * s
614
+ )
615
+ ) + H : J, k["--tips-position-left"] = S ? Math.min(S, u - 3 * s) + H : J;
616
+ }
617
+ const Ht = {
618
+ name: "Tips",
619
+ props: {
620
+ /* 是否显示 */
621
+ visible: {
622
+ type: [Boolean, String, Number],
623
+ default: !0
624
+ },
625
+ /* 提示内容 */
626
+ content: {
627
+ type: String,
628
+ default: ""
629
+ },
630
+ /* 提示标题 */
631
+ title: {
632
+ type: [String, Number],
633
+ default: ""
634
+ },
635
+ /* 显示位置 */
636
+ position: {
637
+ type: String,
638
+ default: "top"
639
+ },
640
+ /* tips容器的偏移量 */
641
+ offset: {
642
+ type: [String, Number],
643
+ default: void 0
644
+ },
645
+ /* 字体大小 */
646
+ fontSize: {
647
+ type: [String, Number],
648
+ default: void 0
649
+ },
650
+ /* 边框宽度 */
651
+ border: {
652
+ type: [String, Number],
653
+ default: void 0
654
+ },
655
+ /* 边框和颜色 */
656
+ color: {
657
+ type: [String, Number],
658
+ default: void 0
659
+ },
660
+ /* 背景色 */
661
+ background: {
662
+ type: [String, Number],
663
+ default: void 0
664
+ },
665
+ /* 静态显示 */
666
+ static: {
667
+ type: Boolean,
668
+ default: !1
669
+ },
670
+ delay: {
671
+ type: [String, Number],
672
+ default: 10
673
+ }
674
+ },
675
+ watch: {
676
+ visible: function(t) {
677
+ t && this.$nextTick(() => {
678
+ this.init();
679
+ });
680
+ }
681
+ },
682
+ data() {
683
+ return {
684
+ css: {}
685
+ };
686
+ },
687
+ methods: {
688
+ parent(t) {
689
+ let e = this.$el, i;
690
+ for (; e && (e = e.parentNode, e && e.nodeType == 1 || (e = window, i = !0), g(t, null, e, i), !i); )
691
+ ;
692
+ },
693
+ attr(t, e, i) {
694
+ return g(
695
+ t[i === void 0 ? "getAttribute" : "setAttribute"],
696
+ t,
697
+ e,
698
+ i
699
+ );
700
+ },
701
+ /* 初始化 */
702
+ init() {
703
+ this.$el.nodeName != "#comment" && nt({
704
+ onresize: !1,
705
+ /* 监控的目标 */
706
+ target: this.$el.parentNode,
707
+ /* 显示的元素 */
708
+ room: this.$el,
709
+ /* 显示位置 */
710
+ position: this.position,
711
+ /* CSS样式集合 */
712
+ css: this.css,
713
+ /* 偏移量 */
714
+ offset: +this.offset
715
+ });
716
+ },
717
+ scrollListener() {
718
+ this.static || this.parent((t, e, i) => {
719
+ e ? g(t.addEventListener, t, "scroll", L) : (g(N.observe, N, t), (t.offsetHeight < t.scrollHeight || t.offsetWidth < t.scrollWidth) && (i = this.attr(t, "-tips-scroll"), i || (g(t.addEventListener, t, "scroll", L), this.attr(t, "-tips-scroll", "true"))));
720
+ });
721
+ }
722
+ },
723
+ mounted() {
724
+ E(
725
+ this.css,
726
+ W(
727
+ this.$props,
728
+ "color=>--tips-color,background=>--tips-background-color,border=>--tips-border-width,fontSize=>--tips-font-size"
729
+ )
730
+ ), this.init(), B.delay = +this.delay, Mt((t) => {
731
+ this.scrollListener();
732
+ }), this.scrollListener();
733
+ },
734
+ unmounted() {
735
+ this.parent(function(t, e) {
736
+ g(t.removeEventListener, t, "scroll", L), g(t.removeAttribute, t, "-tips-scroll", void 0), e || g(N.unobserve, N, t);
737
+ });
738
+ }
739
+ };
740
+ var Lt = function() {
741
+ var e = this, i = e._self._c;
742
+ 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("title", function() {
743
+ return [i("div", { staticClass: "tips-title" }, [e._v(e._s(e.title))])];
744
+ }), e._t("content", function() {
745
+ return [e._v(e._s(e.content))];
746
+ })], 2) : e._e();
747
+ }, Et = [], Wt = /* @__PURE__ */ A(
748
+ Ht,
749
+ Lt,
750
+ Et,
751
+ !1,
752
+ null,
753
+ "053dbb37",
754
+ null,
755
+ null
756
+ );
757
+ const At = Wt.exports, Ot = [_t, xt, Ct, At], It = {
758
+ install(t) {
759
+ Ot.forEach((e) => {
760
+ t.component("S" + e.name, e), t.component(e.name + "S", e);
530
761
  });
531
762
  }
532
763
  };
533
764
  export {
534
- tt as Card,
535
- D as Flyweight,
536
- rt as Stream,
537
- ot as default
765
+ xt as Card,
766
+ _t as Flyweight,
767
+ Ct as Stream,
768
+ At as Tips,
769
+ It as default
538
770
  };