@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.cjs +1 -1
- package/Flyweight.js +371 -332
- package/README.md +62 -10
- package/package.json +1 -1
- package/style.css +1 -1
- package/vue2/index.cjs +1 -1
- package/vue2/index.js +342 -310
- package/vue2/style.css +1 -1
package/Flyweight.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { runer as
|
|
2
|
-
import { openBlock as
|
|
3
|
-
import { runer 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 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 =
|
|
14
|
-
let r = i.length,
|
|
13
|
+
if (i = v("match", t, Et)) {
|
|
14
|
+
let r = i.length, l, n = 0, s, h = [];
|
|
15
15
|
for (; r--; )
|
|
16
|
-
|
|
17
|
-
+
|
|
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 = {},
|
|
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
|
-
for (const [r,
|
|
30
|
-
i[r] =
|
|
29
|
+
for (const [r, l] of e)
|
|
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 Ht = {
|
|
|
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 Ht = {
|
|
|
156
338
|
this.rebuild(), this.$emit("resize");
|
|
157
339
|
}).observe(this.flyweight);
|
|
158
340
|
} catch (t) {
|
|
159
|
-
|
|
341
|
+
Dt(t);
|
|
160
342
|
}
|
|
161
|
-
this.scrollx =
|
|
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
|
});
|
|
@@ -175,17 +357,17 @@ const Ht = {
|
|
|
175
357
|
return t && this.task.push(t), !0;
|
|
176
358
|
},
|
|
177
359
|
setview(t) {
|
|
178
|
-
|
|
360
|
+
v([this.cheackflys, (e) => {
|
|
179
361
|
e = e || {};
|
|
180
|
-
let i = e.index ||
|
|
181
|
-
if (n
|
|
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
|
-
|
|
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
|
-
|
|
379
|
+
v(t);
|
|
198
380
|
}, e || this.lazy);
|
|
199
381
|
},
|
|
200
382
|
run(t) {
|
|
201
|
-
let e = [], i =
|
|
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
|
-
|
|
211
|
-
let
|
|
212
|
-
|
|
392
|
+
L(r, this.space), t.from || e.push(["onscroll", r]);
|
|
393
|
+
let l = !1;
|
|
394
|
+
H(
|
|
213
395
|
this.flyweights,
|
|
214
|
-
(
|
|
215
|
-
if (h =
|
|
216
|
-
(+(h < c % o) + (c / o >> 0)), a =
|
|
217
|
-
|
|
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 =
|
|
221
|
-
let
|
|
402
|
+
s.index = p, s.i = a, s.data = this.flys[a];
|
|
403
|
+
let S = [
|
|
222
404
|
/* top */
|
|
223
|
-
|
|
405
|
+
p * this.expand + s.x,
|
|
224
406
|
/* left */
|
|
225
407
|
s.space
|
|
226
408
|
];
|
|
227
|
-
|
|
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,
|
|
427
|
+
let i = this.scrollx, r = this.flyweight, l = C(r, this.BoxRule);
|
|
246
428
|
this.$nextTick(() => {
|
|
247
|
-
let
|
|
248
|
-
i &&
|
|
249
|
-
let [a,
|
|
250
|
-
i ? (
|
|
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
|
-
|
|
253
|
-
)) : (
|
|
254
|
-
let
|
|
255
|
-
for (;
|
|
256
|
-
|
|
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:
|
|
261
|
-
space:
|
|
442
|
+
height: f - h,
|
|
443
|
+
space: m(N % a),
|
|
262
444
|
data: {}
|
|
263
445
|
});
|
|
264
|
-
e.length =
|
|
446
|
+
e.length = y + 1;
|
|
265
447
|
let k = [];
|
|
266
|
-
|
|
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: (
|
|
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
|
-
},
|
|
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:
|
|
282
|
-
"flyweight-active":
|
|
463
|
+
class: dt(["flyweight", {
|
|
464
|
+
"flyweight-active": l.actice
|
|
283
465
|
}]),
|
|
284
|
-
style:
|
|
285
|
-
onScroll: e[0] || (e[0] = (...s) =>
|
|
466
|
+
style: A(n.style),
|
|
467
|
+
onScroll: e[0] || (e[0] = (...s) => n.scroll && n.scroll(...s))
|
|
286
468
|
}, [
|
|
287
|
-
|
|
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
|
-
|
|
477
|
+
d(t.$slots, "default", B({ ref_for: !0 }, s), void 0, !0)
|
|
296
478
|
], 4))), 128))
|
|
297
479
|
]),
|
|
298
|
-
|
|
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
|
-
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
|
|
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 &&
|
|
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
|
|
504
|
-
return
|
|
505
|
-
default:
|
|
506
|
-
(
|
|
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
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
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
|
|
521
|
-
|
|
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
|
-
|
|
531
|
-
|
|
556
|
+
bt = ee(() => {
|
|
557
|
+
g(q);
|
|
532
558
|
}, t), this._delay = t;
|
|
533
559
|
}
|
|
534
560
|
});
|
|
535
|
-
|
|
536
|
-
function
|
|
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,
|
|
566
|
+
r - i >= e && (i = r, g(t, this, arguments));
|
|
541
567
|
};
|
|
542
568
|
}
|
|
543
|
-
const
|
|
544
|
-
|
|
569
|
+
const W = () => {
|
|
570
|
+
bt();
|
|
545
571
|
};
|
|
546
|
-
function
|
|
547
|
-
|
|
572
|
+
function ie(t) {
|
|
573
|
+
q.push(t);
|
|
548
574
|
}
|
|
549
|
-
const
|
|
550
|
-
|
|
551
|
-
function
|
|
552
|
-
t.onresize || (
|
|
553
|
-
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, $ = [
|
|
554
580
|
/* left: 0 */
|
|
555
581
|
o.left - c,
|
|
556
582
|
/* top: 1 */
|
|
557
|
-
o.top -
|
|
583
|
+
o.top - u,
|
|
558
584
|
/* right: 2 */
|
|
559
585
|
x - o.right,
|
|
560
586
|
/* bottom: 3 */
|
|
561
|
-
|
|
587
|
+
P - o.bottom
|
|
562
588
|
];
|
|
563
589
|
h && (Z(
|
|
564
590
|
h.split(rt),
|
|
565
|
-
function(
|
|
566
|
-
|
|
567
|
-
},
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
),
|
|
571
|
-
|
|
572
|
-
function(
|
|
573
|
-
if (
|
|
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
|
-
|
|
602
|
+
$
|
|
577
603
|
);
|
|
578
|
-
var
|
|
604
|
+
var _ = 0, m = 0, b = 0;
|
|
579
605
|
if (s != null) {
|
|
580
|
-
var
|
|
581
|
-
|
|
582
|
-
var k = Math.max(o.top, 0),
|
|
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 = (
|
|
586
|
-
|
|
587
|
-
|
|
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
|
-
),
|
|
615
|
+
), N && o.left > x && (b = o.left - _ - r + S / 2);
|
|
590
616
|
}
|
|
591
|
-
let Y =
|
|
592
|
-
Y.remove(...ht), Y.add(ht[s]), t.index = s,
|
|
593
|
-
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(
|
|
594
620
|
/* 底边距 */
|
|
595
|
-
Math.max(
|
|
596
|
-
|
|
597
|
-
) :
|
|
598
|
-
|
|
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",
|
|
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
|
-
|
|
706
|
+
__parent(t) {
|
|
677
707
|
let e = this.$el, i;
|
|
678
|
-
for (; e && (e = e.parentNode, e && e.nodeType == 1 || (e = window, i = !0),
|
|
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
|
-
|
|
682
|
-
return
|
|
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
|
|
721
|
+
let t = this.$el;
|
|
722
|
+
t.nodeName != "#comment" && wt({
|
|
692
723
|
onresize: !1,
|
|
693
724
|
/* 监控的目标 */
|
|
694
|
-
target:
|
|
725
|
+
target: t.parentNode,
|
|
695
726
|
/* 显示的元素 */
|
|
696
|
-
room:
|
|
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
|
-
|
|
706
|
-
this.static || this.
|
|
707
|
-
e ?
|
|
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
|
-
|
|
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.
|
|
724
|
-
|
|
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
|
-
},
|
|
728
|
-
function
|
|
729
|
-
return i.visible ? (
|
|
730
|
-
|
|
731
|
-
|
|
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
|
-
}
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
770
|
+
}), [
|
|
771
|
+
d(t.$slots, "default", {}, () => [
|
|
772
|
+
d(t.$slots, "title", {}, () => [
|
|
773
|
+
M("div", ne, G(i.title), 1)
|
|
738
774
|
], !0),
|
|
739
|
-
|
|
740
|
-
|
|
775
|
+
d(t.$slots, "content", {}, () => [
|
|
776
|
+
ct(G(i.content), 1)
|
|
741
777
|
], !0)
|
|
742
778
|
], !0)
|
|
743
|
-
], 16,
|
|
779
|
+
], 16, re)) : gt("", !0);
|
|
744
780
|
}
|
|
745
|
-
const
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
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
|
-
|
|
754
|
-
|
|
755
|
-
Gt as Stream,
|
|
756
|
-
Zt as Tips,
|
|
757
|
-
le as default
|
|
795
|
+
St as components,
|
|
796
|
+
St as default
|
|
758
797
|
};
|