@soei/flyweight 0.4.0 → 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.cjs +1 -1
- package/Flyweight.js +311 -299
- package/package.json +1 -1
- package/style.css +1 -1
- package/vue2/index.cjs +1 -1
- package/vue2/index.js +315 -303
- package/vue2/style.css +1 -1
package/Flyweight.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { runer as v,
|
|
2
|
-
import { openBlock as
|
|
3
|
-
import { runer as g, isNil as
|
|
4
|
-
import
|
|
5
|
-
let
|
|
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 Ht = /(\d+|[+\-\*/]|%)/g, tt = {
|
|
|
10
10
|
"%": (t, e, i) => parseFloat(t) / 100 * i
|
|
11
11
|
}, et = (t, e) => {
|
|
12
12
|
let i;
|
|
13
|
-
if (i = v("match", t,
|
|
13
|
+
if (i = v("match", t, Et)) {
|
|
14
14
|
let r = i.length, l, n = 0, s, h = [];
|
|
15
15
|
for (; r--; )
|
|
16
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
17
|
+l || (l = +h.pop()), t = l >> 0;
|
|
18
18
|
}
|
|
19
19
|
return t;
|
|
20
|
-
}, it = {},
|
|
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
|
|
27
|
+
const F = (t, e) => {
|
|
28
28
|
const i = t.__vccOpts || t;
|
|
29
29
|
for (const [r, l] of e)
|
|
30
30
|
i[r] = l;
|
|
31
31
|
return i;
|
|
32
32
|
};
|
|
33
|
-
|
|
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
|
|
218
|
+
const Gt = {
|
|
37
219
|
name: "Flyweight",
|
|
38
220
|
props: {
|
|
39
221
|
flys: {
|
|
@@ -97,14 +279,14 @@ const Lt = {
|
|
|
97
279
|
},
|
|
98
280
|
style() {
|
|
99
281
|
var t = this.w, e = this.h, i = this.Size, r = {};
|
|
100
|
-
return
|
|
101
|
-
"--width":
|
|
102
|
-
"--height":
|
|
103
|
-
"--flyweight-content":
|
|
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":
|
|
287
|
+
"--flyweight-h": w(e)
|
|
106
288
|
}, t && r, {
|
|
107
|
-
"--flyweight-w":
|
|
289
|
+
"--flyweight-w": w(t)
|
|
108
290
|
}, "mix"), r;
|
|
109
291
|
}
|
|
110
292
|
},
|
|
@@ -156,16 +338,16 @@ const Lt = {
|
|
|
156
338
|
this.rebuild(), this.$emit("resize");
|
|
157
339
|
}).observe(this.flyweight);
|
|
158
340
|
} catch (t) {
|
|
159
|
-
|
|
341
|
+
Dt(t);
|
|
160
342
|
}
|
|
161
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:
|
|
347
|
+
exec: w,
|
|
166
348
|
trigger(t, e) {
|
|
167
|
-
|
|
168
|
-
|
|
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
|
});
|
|
@@ -177,7 +359,7 @@ const Lt = {
|
|
|
177
359
|
setview(t) {
|
|
178
360
|
v([this.cheackflys, (e) => {
|
|
179
361
|
e = e || {};
|
|
180
|
-
let i = e.index ||
|
|
362
|
+
let i = e.index || H(this.flys, (r, l, n, s) => {
|
|
181
363
|
if (l[n] == s)
|
|
182
364
|
return r;
|
|
183
365
|
}, e.picker, e.id);
|
|
@@ -207,9 +389,9 @@ const Lt = {
|
|
|
207
389
|
/* 显示区域第一行的索引 */
|
|
208
390
|
index: i / this.expand >> 0
|
|
209
391
|
};
|
|
210
|
-
|
|
392
|
+
L(r, this.space), t.from || e.push(["onscroll", r]);
|
|
211
393
|
let l = !1;
|
|
212
|
-
|
|
394
|
+
H(
|
|
213
395
|
this.flyweights,
|
|
214
396
|
(n, s, h, o, u, c, f, p, a) => {
|
|
215
397
|
if (h = n / u >> 0, p = h + o * /* 偏移量, 如果超出顶部 + 1轮,排列到列队后, 否则保持在当前*/
|
|
@@ -218,13 +400,13 @@ const Lt = {
|
|
|
218
400
|
return;
|
|
219
401
|
}
|
|
220
402
|
s.index = p, s.i = a, s.data = this.flys[a];
|
|
221
|
-
let
|
|
403
|
+
let S = [
|
|
222
404
|
/* top */
|
|
223
405
|
p * this.expand + s.x,
|
|
224
406
|
/* left */
|
|
225
407
|
s.space
|
|
226
408
|
];
|
|
227
|
-
f &&
|
|
409
|
+
f && S.reverse(), s.top = S[0], s.left = S[1];
|
|
228
410
|
},
|
|
229
411
|
null,
|
|
230
412
|
this.row,
|
|
@@ -242,242 +424,66 @@ const Lt = {
|
|
|
242
424
|
if (!t)
|
|
243
425
|
return e.length = t;
|
|
244
426
|
this.count = t;
|
|
245
|
-
let i = this.scrollx, r = this.flyweight, l =
|
|
427
|
+
let i = this.scrollx, r = this.flyweight, l = C(r, this.BoxRule);
|
|
246
428
|
this.$nextTick(() => {
|
|
247
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];
|
|
248
430
|
i && p.reverse();
|
|
249
|
-
let [a,
|
|
250
|
-
i ? (
|
|
431
|
+
let [a, S] = p, x = this.padding, P, $ = 0, _, m;
|
|
432
|
+
i ? (_ = c, c -= s, m = (z) => (
|
|
251
433
|
/* 计算top偏移量 */
|
|
252
434
|
z * (f - h) + (z + 1) * h
|
|
253
|
-
)) : (n ? (c = (o - s * (a + 2 *
|
|
254
|
-
let
|
|
255
|
-
for (;
|
|
256
|
-
|
|
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
442
|
height: f - h,
|
|
261
|
-
space:
|
|
443
|
+
space: m(N % a),
|
|
262
444
|
data: {}
|
|
263
445
|
});
|
|
264
|
-
e.length =
|
|
265
|
-
let
|
|
266
|
-
u /
|
|
446
|
+
e.length = y + 1;
|
|
447
|
+
let k = [];
|
|
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
|
-
}),
|
|
269
|
-
row: (
|
|
450
|
+
}), k.push(["update:space", {
|
|
451
|
+
row: (y / a >> 0) + 1,
|
|
270
452
|
column: a,
|
|
271
453
|
showrow: this.row,
|
|
272
454
|
showcolumn: this.column
|
|
273
|
-
}]), this.trigger(
|
|
455
|
+
}]), this.trigger(k);
|
|
274
456
|
});
|
|
275
457
|
}
|
|
276
458
|
}
|
|
277
|
-
},
|
|
278
|
-
function
|
|
279
|
-
return
|
|
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:
|
|
463
|
+
class: dt(["flyweight", {
|
|
282
464
|
"flyweight-active": l.actice
|
|
283
465
|
}]),
|
|
284
|
-
style:
|
|
466
|
+
style: A(n.style),
|
|
285
467
|
onScroll: e[0] || (e[0] = (...s) => n.scroll && n.scroll(...s))
|
|
286
468
|
}, [
|
|
287
|
-
M("div",
|
|
288
|
-
(
|
|
469
|
+
M("div", Vt, [
|
|
470
|
+
(T(!0), O(ft, null, pt(l.flyweights, (s, h) => (T(), O("div", {
|
|
289
471
|
key: h,
|
|
290
|
-
style:
|
|
472
|
+
style: A({
|
|
291
473
|
top: s.top + "px",
|
|
292
474
|
left: s.left + "px"
|
|
293
475
|
})
|
|
294
476
|
}, [
|
|
295
|
-
d(t.$slots, "default",
|
|
477
|
+
d(t.$slots, "default", B({ ref_for: !0 }, s), void 0, !0)
|
|
296
478
|
], 4))), 128))
|
|
297
479
|
]),
|
|
298
|
-
l.flyweights.length ? d(t.$slots, "end", { key: 0 }, void 0, !0) :
|
|
480
|
+
l.flyweights.length ? d(t.$slots, "end", { key: 0 }, void 0, !0) : gt("", !0)
|
|
299
481
|
], 38);
|
|
300
482
|
}
|
|
301
|
-
const
|
|
302
|
-
|
|
303
|
-
|
|
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
|
-
P(
|
|
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 At = {
|
|
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
|
-
sub() {
|
|
396
|
-
return this.show || this.title;
|
|
397
|
-
},
|
|
398
|
-
tips() {
|
|
399
|
-
return v("tips", this.close || {}) || "关闭[" + this.sub + "]";
|
|
400
|
-
}
|
|
401
|
-
},
|
|
402
|
-
watch: yt,
|
|
403
|
-
methods: {
|
|
404
|
-
exec: b,
|
|
405
|
-
isEmpty: ut,
|
|
406
|
-
picker: R,
|
|
407
|
-
runer: v,
|
|
408
|
-
isSimplyType: Q,
|
|
409
|
-
tr() {
|
|
410
|
-
let t = {};
|
|
411
|
-
return this.margin(this.offset), P(mt, (e, i) => {
|
|
412
|
-
this.css(t, e, i);
|
|
413
|
-
}), t;
|
|
414
|
-
},
|
|
415
|
-
tolower: U,
|
|
416
|
-
css(t, e, i) {
|
|
417
|
-
let r = this[i] || this.default[i];
|
|
418
|
-
!r || this.default[i] == r || (t[e] = b(r));
|
|
419
|
-
},
|
|
420
|
-
change(t) {
|
|
421
|
-
Q(t) || (this.closecss = R(
|
|
422
|
-
t,
|
|
423
|
-
"color=>--s-card-close-color,size=>--s-close-width,bold=>--s-close-height,*"
|
|
424
|
-
));
|
|
425
|
-
},
|
|
426
|
-
margin(t) {
|
|
427
|
-
W(
|
|
428
|
-
this,
|
|
429
|
-
R(
|
|
430
|
-
St(t) ? t.split(/\s*(?:,|\s+)\s*/) : t,
|
|
431
|
-
"0=>top,1|0=>right,2|0=>bottom,3|1|0=>left",
|
|
432
|
-
!0
|
|
433
|
-
),
|
|
434
|
-
!0
|
|
435
|
-
);
|
|
436
|
-
}
|
|
437
|
-
},
|
|
438
|
-
mounted() {
|
|
439
|
-
this.change(this.close);
|
|
440
|
-
}
|
|
441
|
-
}, Ot = {
|
|
442
|
-
class: "card-title",
|
|
443
|
-
space: ""
|
|
444
|
-
}, It = {
|
|
445
|
-
class: "card-ico-items",
|
|
446
|
-
flex: "",
|
|
447
|
-
vcenter: ""
|
|
448
|
-
}, jt = ["title"], Ft = { class: "card-content" };
|
|
449
|
-
function Dt(t, e, i, r, l, n) {
|
|
450
|
-
return N(), E("div", {
|
|
451
|
-
class: "card",
|
|
452
|
-
key: l.trigger,
|
|
453
|
-
style: O(n.isEmpty(n.style) ? n.tr() : n.style)
|
|
454
|
-
}, [
|
|
455
|
-
d(t.$slots, "default", {}, () => [
|
|
456
|
-
d(t.$slots, "title", {}, () => [
|
|
457
|
-
M("div", Ot, [
|
|
458
|
-
gt(G(n.sub) + " ", 1),
|
|
459
|
-
d(t.$slots, "icons", {}, () => [
|
|
460
|
-
M("div", It, [
|
|
461
|
-
d(t.$slots, "icon", $t(zt({ el: t.$el, picker: n.picker, runer: n.runer })), void 0, !0),
|
|
462
|
-
M("div", {
|
|
463
|
-
class: ct(["card-close", { hide: n.isSimplyType(i.close) ? !i.close : !1 }]),
|
|
464
|
-
style: O(l.closecss),
|
|
465
|
-
onClick: e[0] || (e[0] = (s) => t.$emit("close")),
|
|
466
|
-
title: n.tips
|
|
467
|
-
}, null, 14, jt)
|
|
468
|
-
])
|
|
469
|
-
], !0)
|
|
470
|
-
])
|
|
471
|
-
], !0),
|
|
472
|
-
d(t.$slots, "content", {}, () => [
|
|
473
|
-
M("div", Ft, [
|
|
474
|
-
d(t.$slots, "inner", {}, void 0, !0)
|
|
475
|
-
])
|
|
476
|
-
], !0)
|
|
477
|
-
], !0)
|
|
478
|
-
], 4);
|
|
479
|
-
}
|
|
480
|
-
const Gt = /* @__PURE__ */ j(At, [["render", Dt], ["__scopeId", "data-v-7fa6225c"]]), Ut = {
|
|
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 = {
|
|
481
487
|
name: "Stream",
|
|
482
488
|
computed: {
|
|
483
489
|
component() {
|
|
@@ -485,7 +491,7 @@ const Gt = /* @__PURE__ */ j(At, [["render", Dt], ["__scopeId", "data-v-7fa6225c
|
|
|
485
491
|
},
|
|
486
492
|
column() {
|
|
487
493
|
let { columns: t, T: e } = this, i = t || e;
|
|
488
|
-
return
|
|
494
|
+
return at(i) ? [] : ut(i) ? i : [i];
|
|
489
495
|
}
|
|
490
496
|
},
|
|
491
497
|
props: {
|
|
@@ -508,7 +514,7 @@ const Gt = /* @__PURE__ */ j(At, [["render", Dt], ["__scopeId", "data-v-7fa6225c
|
|
|
508
514
|
}
|
|
509
515
|
},
|
|
510
516
|
mounted() {
|
|
511
|
-
this.$.vnode.ref &&
|
|
517
|
+
this.$.vnode.ref && L(this, { ...this.component });
|
|
512
518
|
},
|
|
513
519
|
methods: {
|
|
514
520
|
__trigger(t) {
|
|
@@ -517,25 +523,28 @@ const Gt = /* @__PURE__ */ j(At, [["render", Dt], ["__scopeId", "data-v-7fa6225c
|
|
|
517
523
|
}
|
|
518
524
|
}
|
|
519
525
|
};
|
|
520
|
-
function
|
|
521
|
-
return
|
|
522
|
-
default:
|
|
523
|
-
(
|
|
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({
|
|
524
530
|
key: s.type
|
|
525
531
|
}, { ref_for: !0 }, s))), 128))
|
|
526
532
|
]),
|
|
527
533
|
_: 3
|
|
528
534
|
}, 16);
|
|
529
535
|
}
|
|
530
|
-
const
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
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(
|
|
534
543
|
window,
|
|
535
544
|
"Reflect.defineProperty|Object.defineProperty=>Proxy"
|
|
536
545
|
).Proxy;
|
|
537
|
-
let
|
|
538
|
-
|
|
546
|
+
let U = {}, bt = null;
|
|
547
|
+
te(U, "delay", {
|
|
539
548
|
/**
|
|
540
549
|
* 获取延迟时间值
|
|
541
550
|
* @returns {number} 返回当前实例的延迟时间属性值
|
|
@@ -544,77 +553,77 @@ Yt(q, "delay", {
|
|
|
544
553
|
return this._delay;
|
|
545
554
|
},
|
|
546
555
|
set(t) {
|
|
547
|
-
|
|
548
|
-
g(
|
|
556
|
+
bt = ee(() => {
|
|
557
|
+
g(q);
|
|
549
558
|
}, t), this._delay = t;
|
|
550
559
|
}
|
|
551
560
|
});
|
|
552
|
-
|
|
553
|
-
function
|
|
561
|
+
U.delay = 60;
|
|
562
|
+
function ee(t, e) {
|
|
554
563
|
let i = 0;
|
|
555
564
|
return function() {
|
|
556
565
|
const r = Date.now();
|
|
557
566
|
r - i >= e && (i = r, g(t, this, arguments));
|
|
558
567
|
};
|
|
559
568
|
}
|
|
560
|
-
const
|
|
561
|
-
|
|
569
|
+
const W = () => {
|
|
570
|
+
bt();
|
|
562
571
|
};
|
|
563
|
-
function
|
|
564
|
-
|
|
572
|
+
function ie(t) {
|
|
573
|
+
q.push(t);
|
|
565
574
|
}
|
|
566
|
-
const
|
|
567
|
-
|
|
568
|
-
function
|
|
569
|
-
t.onresize || (
|
|
570
|
-
var e =
|
|
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, $ = [
|
|
571
580
|
/* left: 0 */
|
|
572
581
|
o.left - c,
|
|
573
582
|
/* top: 1 */
|
|
574
583
|
o.top - u,
|
|
575
584
|
/* right: 2 */
|
|
576
|
-
|
|
585
|
+
x - o.right,
|
|
577
586
|
/* bottom: 3 */
|
|
578
|
-
|
|
587
|
+
P - o.bottom
|
|
579
588
|
];
|
|
580
589
|
h && (Z(
|
|
581
590
|
h.split(rt),
|
|
582
|
-
function(
|
|
583
|
-
|
|
591
|
+
function(xt, R, I, $t) {
|
|
592
|
+
$t.push(I[R]);
|
|
584
593
|
},
|
|
585
|
-
|
|
594
|
+
Zt,
|
|
586
595
|
p = []
|
|
587
596
|
), f.unshift.apply(f, p)), s = Z(
|
|
588
597
|
f,
|
|
589
|
-
function(
|
|
590
|
-
if (
|
|
591
|
-
return
|
|
598
|
+
function(xt, R, I) {
|
|
599
|
+
if (I[R] > 0)
|
|
600
|
+
return R;
|
|
592
601
|
},
|
|
593
602
|
$
|
|
594
603
|
);
|
|
595
|
-
var
|
|
604
|
+
var _ = 0, m = 0, b = 0;
|
|
596
605
|
if (s != null) {
|
|
597
|
-
var
|
|
598
|
-
|
|
599
|
-
var
|
|
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(
|
|
600
609
|
o.bottom,
|
|
601
610
|
i
|
|
602
|
-
), X = (z - u + Math.min(i - u,
|
|
603
|
-
|
|
604
|
-
|
|
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]),
|
|
605
614
|
0
|
|
606
|
-
),
|
|
615
|
+
), N && o.left > x && (b = o.left - _ - r + S / 2);
|
|
607
616
|
}
|
|
608
|
-
let Y = n.classList,
|
|
609
|
-
Y.remove(...ht), Y.add(ht[s]), t.index = s,
|
|
610
|
-
let J =
|
|
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(
|
|
611
620
|
/* 底边距 */
|
|
612
|
-
Math.max(
|
|
621
|
+
Math.max(m, k) - m,
|
|
613
622
|
u - r
|
|
614
623
|
) : lt, K = c - 3 * r;
|
|
615
|
-
|
|
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;
|
|
616
625
|
}
|
|
617
|
-
const D = "data-tips-scroll",
|
|
626
|
+
const D = "data-tips-scroll", se = {
|
|
618
627
|
name: "Tips",
|
|
619
628
|
props: {
|
|
620
629
|
/* 目标对象 */
|
|
@@ -710,7 +719,7 @@ const D = "data-tips-scroll", Qt = {
|
|
|
710
719
|
/* 初始化 */
|
|
711
720
|
init() {
|
|
712
721
|
let t = this.$el;
|
|
713
|
-
t.nodeName != "#comment" &&
|
|
722
|
+
t.nodeName != "#comment" && wt({
|
|
714
723
|
onresize: !1,
|
|
715
724
|
/* 监控的目标 */
|
|
716
725
|
target: t.parentNode,
|
|
@@ -726,20 +735,20 @@ const D = "data-tips-scroll", Qt = {
|
|
|
726
735
|
},
|
|
727
736
|
__2listener() {
|
|
728
737
|
this.static || this.__parent((t, e, i) => {
|
|
729
|
-
e ? g(t.addEventListener, t, "scroll",
|
|
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"))));
|
|
730
739
|
});
|
|
731
740
|
},
|
|
732
741
|
__css() {
|
|
733
742
|
let t = {}, e;
|
|
734
743
|
return this.target ? e = {
|
|
735
744
|
[this.position]: this.offset + "px"
|
|
736
|
-
} : (e =
|
|
745
|
+
} : (e = C(
|
|
737
746
|
this.$props,
|
|
738
747
|
"color=>--tips-color,background=>--tips-background-color,border=>--tips-border-width,fontSize=>--tips-font-size,borderRadius=>--tips-border-radius"
|
|
739
|
-
), t["--arrow-size"] = Math.sqrt(2 * Math.pow((this.border || 3) * 2 + 2, 2)) / 2 >> 0),
|
|
748
|
+
), t["--arrow-size"] = Math.sqrt(2 * Math.pow((this.border || 3) * 2 + 2, 2)) / 2 >> 0), L(t, e), t;
|
|
740
749
|
},
|
|
741
750
|
__2next() {
|
|
742
|
-
this.target || (this.init(),
|
|
751
|
+
this.target || (this.init(), U.delay = +this.delay, ie((t) => {
|
|
743
752
|
this.__2listener();
|
|
744
753
|
}), this.__2listener());
|
|
745
754
|
}
|
|
@@ -749,37 +758,40 @@ const D = "data-tips-scroll", Qt = {
|
|
|
749
758
|
},
|
|
750
759
|
unmounted() {
|
|
751
760
|
this.__parent(function(t, e) {
|
|
752
|
-
g(t.removeEventListener, t, "scroll",
|
|
761
|
+
g(t.removeEventListener, t, "scroll", W), g(t.removeAttribute, t, D, void 0), e || g(E.unobserve, E, t);
|
|
753
762
|
});
|
|
754
763
|
}
|
|
755
|
-
},
|
|
756
|
-
function
|
|
757
|
-
return i.visible ? (
|
|
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, {
|
|
758
767
|
class: ["tips", i.target ? "tips-" + i.position : ""],
|
|
759
768
|
style: i.static ? null : l.css,
|
|
760
769
|
static: i.static ? "" : null
|
|
761
770
|
}), [
|
|
762
771
|
d(t.$slots, "default", {}, () => [
|
|
763
772
|
d(t.$slots, "title", {}, () => [
|
|
764
|
-
M("div",
|
|
773
|
+
M("div", ne, G(i.title), 1)
|
|
765
774
|
], !0),
|
|
766
775
|
d(t.$slots, "content", {}, () => [
|
|
767
|
-
|
|
776
|
+
ct(G(i.content), 1)
|
|
768
777
|
], !0)
|
|
769
778
|
], !0)
|
|
770
|
-
], 16,
|
|
779
|
+
], 16, re)) : gt("", !0);
|
|
771
780
|
}
|
|
772
|
-
const
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
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
|
+
});
|
|
778
793
|
};
|
|
779
794
|
export {
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
qt as Stream,
|
|
783
|
-
ie as Tips,
|
|
784
|
-
he as default
|
|
795
|
+
St as components,
|
|
796
|
+
St as default
|
|
785
797
|
};
|