@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/vue2/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { runer as
|
|
2
|
-
import { runer as
|
|
3
|
-
import
|
|
4
|
-
let
|
|
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 =
|
|
13
|
-
let s = i.length, l,
|
|
12
|
+
if (i = w("match", t, gt)) {
|
|
13
|
+
let s = i.length, l, h = 0, n, a = [];
|
|
14
14
|
for (; s--; )
|
|
15
|
-
|
|
16
|
-
+l || (l = +
|
|
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 = {},
|
|
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
|
|
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),
|
|
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(
|
|
31
|
-
|
|
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, !
|
|
34
|
-
}, r._ssrRegister = o) : l && (o =
|
|
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
|
|
42
|
+
var f = r.render;
|
|
43
43
|
r.render = function(c, p) {
|
|
44
|
-
return o.call(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
|
-
|
|
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
|
|
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
|
|
123
|
-
"--width":
|
|
124
|
-
"--height":
|
|
125
|
-
"--flyweight-content":
|
|
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":
|
|
294
|
+
"--flyweight-h": b(e)
|
|
128
295
|
}, t && s, {
|
|
129
|
-
"--flyweight-w":
|
|
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
|
-
|
|
348
|
+
$t(t);
|
|
182
349
|
}
|
|
183
|
-
this.scrollx =
|
|
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:
|
|
354
|
+
exec: b,
|
|
188
355
|
trigger(t, e) {
|
|
189
|
-
|
|
190
|
-
|
|
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
|
-
|
|
367
|
+
w([this.cheackflys, (e) => {
|
|
201
368
|
e = e || {};
|
|
202
|
-
let i = e.index ||
|
|
203
|
-
if (l[
|
|
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
|
-
|
|
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
|
-
|
|
386
|
+
w(t);
|
|
220
387
|
}, e || this.lazy);
|
|
221
388
|
},
|
|
222
389
|
run(t) {
|
|
223
|
-
let e = [], i =
|
|
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
|
-
|
|
399
|
+
R(s, this.space), t.from || e.push(["onscroll", s]);
|
|
233
400
|
let l = !1;
|
|
234
|
-
|
|
401
|
+
O(
|
|
235
402
|
this.flyweights,
|
|
236
|
-
(
|
|
237
|
-
if (
|
|
238
|
-
(+(
|
|
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 =
|
|
409
|
+
n.index = u, n.i = c, n.data = this.flys[c];
|
|
243
410
|
let p = [
|
|
244
411
|
/* top */
|
|
245
|
-
|
|
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 =
|
|
434
|
+
let i = this.scrollx, s = this.flyweight, l = k(s, this.BoxRule);
|
|
268
435
|
this.$nextTick(() => {
|
|
269
|
-
let
|
|
270
|
-
i &&
|
|
271
|
-
let [c, p] =
|
|
272
|
-
i ? (
|
|
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
|
-
|
|
275
|
-
)) : (
|
|
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
|
-
|
|
445
|
+
T = m - v, this.$set(e, T, {
|
|
279
446
|
x: n,
|
|
280
|
-
y:
|
|
281
|
-
width:
|
|
282
|
-
height: d -
|
|
283
|
-
space: y(
|
|
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
|
|
288
|
-
o /
|
|
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
|
-
}),
|
|
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(
|
|
462
|
+
}]), this.trigger(z);
|
|
296
463
|
});
|
|
297
464
|
}
|
|
298
465
|
}
|
|
299
466
|
};
|
|
300
|
-
var
|
|
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
|
-
},
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
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
|
|
321
|
-
|
|
322
|
-
|
|
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
|
|
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 &&
|
|
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
|
|
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
|
-
},
|
|
521
|
-
|
|
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
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
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
|
|
538
|
-
|
|
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
|
-
|
|
566
|
+
_(L);
|
|
549
567
|
}, t), this._delay = t;
|
|
550
568
|
}
|
|
551
569
|
});
|
|
552
|
-
|
|
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,
|
|
575
|
+
s - i >= e && (i = s, _(t, this, arguments));
|
|
558
576
|
};
|
|
559
577
|
}
|
|
560
578
|
const E = () => {
|
|
561
579
|
ot();
|
|
562
580
|
};
|
|
563
|
-
function
|
|
564
|
-
|
|
581
|
+
function Ft(t) {
|
|
582
|
+
L.push(t);
|
|
565
583
|
}
|
|
566
|
-
const
|
|
567
|
-
|
|
568
|
-
function
|
|
569
|
-
t.onresize || (
|
|
570
|
-
var e = lt, i = e.clientHeight, s =
|
|
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 -
|
|
590
|
+
r.left - f,
|
|
573
591
|
/* top: 1 */
|
|
574
592
|
r.top - o,
|
|
575
593
|
/* right: 2 */
|
|
576
|
-
|
|
594
|
+
x - r.right,
|
|
577
595
|
/* bottom: 3 */
|
|
578
|
-
|
|
596
|
+
C - r.bottom
|
|
579
597
|
];
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
function(
|
|
583
|
-
ft.push(
|
|
584
|
-
},
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
), d.unshift.apply(d,
|
|
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(
|
|
590
|
-
if (
|
|
607
|
+
function(ct, H, P) {
|
|
608
|
+
if (P[H] > 0)
|
|
591
609
|
return H;
|
|
592
610
|
},
|
|
593
|
-
|
|
611
|
+
S
|
|
594
612
|
);
|
|
595
|
-
var
|
|
613
|
+
var g = 0, y = 0, v = 0;
|
|
596
614
|
if (n != null) {
|
|
597
|
-
var m = n == 0 || n == 2,
|
|
598
|
-
|
|
599
|
-
var
|
|
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
|
-
),
|
|
620
|
+
), B = ($ - o + Math.min(i - o, z)) / 2;
|
|
603
621
|
y = Math.max(
|
|
604
|
-
m ?
|
|
622
|
+
m ? B : n == 3 ? r.top + c + s : Math.min(B, S[1]),
|
|
605
623
|
0
|
|
606
|
-
),
|
|
624
|
+
), T && r.left > x && (v = r.left - g - s + p / 2);
|
|
607
625
|
}
|
|
608
|
-
let
|
|
609
|
-
|
|
610
|
-
let U =
|
|
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,
|
|
630
|
+
Math.max(y, z) - y,
|
|
613
631
|
o - s
|
|
614
|
-
) : Z, X =
|
|
615
|
-
|
|
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
|
|
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
|
-
|
|
715
|
+
__parent(t) {
|
|
694
716
|
let e = this.$el, i;
|
|
695
|
-
for (; e && (e = e.parentNode, e && e.nodeType == 1 || (e = window, i = !0),
|
|
717
|
+
for (; e && (e = e.parentNode, e && e.nodeType == 1 || (e = window, i = !0), _(t, null, e, i), !i); )
|
|
696
718
|
;
|
|
697
719
|
},
|
|
698
|
-
|
|
699
|
-
return
|
|
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
|
|
730
|
+
let t = this.$el;
|
|
731
|
+
t.nodeName != "#comment" && at({
|
|
709
732
|
onresize: !1,
|
|
710
733
|
/* 监控的目标 */
|
|
711
|
-
target:
|
|
734
|
+
target: t.parentNode,
|
|
712
735
|
/* 显示的元素 */
|
|
713
|
-
room:
|
|
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
|
-
|
|
723
|
-
this.static || this.
|
|
724
|
-
e ?
|
|
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
|
-
|
|
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.
|
|
741
|
-
|
|
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
|
|
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
|
-
},
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
783
|
+
}, Ut = [], Xt = /* @__PURE__ */ j(
|
|
784
|
+
Bt,
|
|
785
|
+
It,
|
|
786
|
+
Ut,
|
|
758
787
|
!1,
|
|
759
788
|
null,
|
|
760
|
-
"
|
|
789
|
+
"b7f54162",
|
|
761
790
|
null,
|
|
762
791
|
null
|
|
763
792
|
);
|
|
764
|
-
const
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
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
|
-
|
|
773
|
-
|
|
774
|
-
Mt as Stream,
|
|
775
|
-
Bt as Tips,
|
|
776
|
-
Dt as default
|
|
807
|
+
ut as components,
|
|
808
|
+
ut as default
|
|
777
809
|
};
|