@soei/flyweight 0.3.10 → 0.3.12
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 +173 -166
- package/README.md +20 -0
- package/package.json +1 -1
- package/style.css +1 -1
- package/vue2/index.cjs +1 -1
- package/vue2/index.js +169 -162
- package/vue2/style.css +1 -1
package/vue2/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { runer as
|
|
2
|
-
import { runer as g, each as
|
|
3
|
-
import
|
|
4
|
-
let
|
|
1
|
+
import { runer as z, merge as M, isArray as et, each as k, picker as L, isEmpty as it, isSimplyType as X, isString as ct } from "@soei/util";
|
|
2
|
+
import { runer as g, isNil as ft, each as G } from "@soei/tools";
|
|
3
|
+
import ut from "@soei/picker";
|
|
4
|
+
let dt = /(\d+|[+\-\*/]|%)/g, q = {
|
|
5
5
|
"+": (t, e) => t + e,
|
|
6
6
|
"-": (t, e) => t - e,
|
|
7
7
|
"*": (t, e) => t * e,
|
|
@@ -9,11 +9,11 @@ let ct = /(\d+|[+\-\*/]|%)/g, G = {
|
|
|
9
9
|
"%": (t, e, i) => parseFloat(t) / 100 * i
|
|
10
10
|
}, D = (t, e) => {
|
|
11
11
|
let i;
|
|
12
|
-
if (i =
|
|
13
|
-
let s = i.length, l, a = 0, n,
|
|
12
|
+
if (i = z("match", t, dt)) {
|
|
13
|
+
let s = i.length, l, a = 0, n, h = [];
|
|
14
14
|
for (; s--; )
|
|
15
|
-
a = i.shift(), a in
|
|
16
|
-
+l || (l = +
|
|
15
|
+
a = i.shift(), a in q ? (l && h.push(l), a === "%" && (h.length = 2), n = a) : +a && h.push(+a), h.length == 2 && (h.push(e), l = q[n].apply(null, h), h.length = 0);
|
|
16
|
+
+l || (l = +h.pop()), t = l >> 0;
|
|
17
17
|
}
|
|
18
18
|
return t;
|
|
19
19
|
}, V = {}, w = (t, e) => (t + "").replace(
|
|
@@ -23,39 +23,39 @@ let ct = /(\d+|[+\-\*/]|%)/g, G = {
|
|
|
23
23
|
V[e] || (V[e] = new RegExp("(?=\\s+|^)(\\d+)(?:\\.\\d{1,})?(?!(?:\\.)*\\d|%|\\w)", "g")),
|
|
24
24
|
"$1px"
|
|
25
25
|
);
|
|
26
|
-
function
|
|
26
|
+
function W(t, e, i, s, l, a, n, h) {
|
|
27
27
|
var r = typeof t == "function" ? t.options : t;
|
|
28
28
|
e && (r.render = e, r.staticRenderFns = i, r._compiled = !0), s && (r.functional = !0), a && (r._scopeId = "data-v-" + a);
|
|
29
|
-
var
|
|
30
|
-
if (n ? (
|
|
29
|
+
var o;
|
|
30
|
+
if (n ? (o = function(c) {
|
|
31
31
|
c = c || // cached call
|
|
32
32
|
this.$vnode && this.$vnode.ssrContext || // stateful
|
|
33
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 =
|
|
34
|
+
}, r._ssrRegister = o) : l && (o = h ? function() {
|
|
35
35
|
l.call(
|
|
36
36
|
this,
|
|
37
37
|
(r.functional ? this.parent : this).$root.$options.shadowRoot
|
|
38
38
|
);
|
|
39
|
-
} : l),
|
|
39
|
+
} : l), o)
|
|
40
40
|
if (r.functional) {
|
|
41
|
-
r._injectStyles =
|
|
41
|
+
r._injectStyles = o;
|
|
42
42
|
var u = r.render;
|
|
43
43
|
r.render = function(f, p) {
|
|
44
|
-
return
|
|
44
|
+
return o.call(p), u(f, p);
|
|
45
45
|
};
|
|
46
46
|
} else {
|
|
47
47
|
var d = r.beforeCreate;
|
|
48
|
-
r.beforeCreate = d ? [].concat(d,
|
|
48
|
+
r.beforeCreate = d ? [].concat(d, o) : [o];
|
|
49
49
|
}
|
|
50
50
|
return {
|
|
51
51
|
exports: t,
|
|
52
52
|
options: r
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
|
-
let Y = (t) => t == null || t == null,
|
|
55
|
+
let Y = (t) => t == null || t == null, pt = (...t) => {
|
|
56
56
|
console.info("::::FLYWEIGHT", ...t);
|
|
57
57
|
};
|
|
58
|
-
const
|
|
58
|
+
const gt = {
|
|
59
59
|
name: "Flyweight",
|
|
60
60
|
props: {
|
|
61
61
|
flys: {
|
|
@@ -119,7 +119,7 @@ const ut = {
|
|
|
119
119
|
},
|
|
120
120
|
style() {
|
|
121
121
|
var t = this.w, e = this.h, i = this.Size, s = {};
|
|
122
|
-
return
|
|
122
|
+
return M(s, {
|
|
123
123
|
"--width": w(this.realW),
|
|
124
124
|
"--height": w(this.realH),
|
|
125
125
|
"--flyweight-content": w(i)
|
|
@@ -178,16 +178,16 @@ const ut = {
|
|
|
178
178
|
this.rebuild(), this.$emit("resize");
|
|
179
179
|
}).observe(this.flyweight);
|
|
180
180
|
} catch (t) {
|
|
181
|
-
|
|
181
|
+
pt(t);
|
|
182
182
|
}
|
|
183
|
-
this.scrollx =
|
|
183
|
+
this.scrollx = z("hasAttribute", this.flyweight, "scroll-x"), this.BoxRule = /* this.scrollx ? 'clientHeight=>width,clientWidth=>height' : */
|
|
184
184
|
"clientHeight=>height,clientWidth=>width", this.direction = this.scrollx ? "scrollLeft" : "scrollTop";
|
|
185
185
|
},
|
|
186
186
|
methods: {
|
|
187
187
|
exec: w,
|
|
188
188
|
trigger(t, e) {
|
|
189
|
-
|
|
190
|
-
|
|
189
|
+
et(t) || (t = t && e ? [[t, e]] : []), t.length && this.lazyrun(() => {
|
|
190
|
+
k(t, (i, s) => {
|
|
191
191
|
this.$emit(s[0], Y(s[1]) ? !0 : s[1]);
|
|
192
192
|
});
|
|
193
193
|
});
|
|
@@ -197,9 +197,9 @@ const ut = {
|
|
|
197
197
|
return t && this.task.push(t), !0;
|
|
198
198
|
},
|
|
199
199
|
setview(t) {
|
|
200
|
-
|
|
200
|
+
z([this.cheackflys, (e) => {
|
|
201
201
|
e = e || {};
|
|
202
|
-
let i = e.index ||
|
|
202
|
+
let i = e.index || k(this.flys, (s, l, a, n) => {
|
|
203
203
|
if (l[a] == n)
|
|
204
204
|
return s;
|
|
205
205
|
}, e.picker, e.id);
|
|
@@ -207,7 +207,7 @@ const ut = {
|
|
|
207
207
|
}], this, t);
|
|
208
208
|
},
|
|
209
209
|
setindex(t) {
|
|
210
|
-
|
|
210
|
+
z([this.cheackflys, ({ index: e }) => {
|
|
211
211
|
this.selectIndex = e, this.$nextTick(() => {
|
|
212
212
|
let i = e / this.column >> 0, s = this.expand;
|
|
213
213
|
(this.flyweight[this.direction] / s >> 0) + this.row - i - 1 > 0 || (this.flyweight[this.direction] = i * s, this.scroll());
|
|
@@ -216,11 +216,11 @@ const ut = {
|
|
|
216
216
|
},
|
|
217
217
|
lazyrun(t, e) {
|
|
218
218
|
clearTimeout(this.time), this.time = setTimeout(() => {
|
|
219
|
-
|
|
219
|
+
z(t);
|
|
220
220
|
}, e || this.lazy);
|
|
221
221
|
},
|
|
222
222
|
run(t) {
|
|
223
|
-
let e = [], i =
|
|
223
|
+
let e = [], i = z(this.direction, t.target), s = {
|
|
224
224
|
// ...this
|
|
225
225
|
offset: i,
|
|
226
226
|
top: i,
|
|
@@ -229,13 +229,13 @@ const ut = {
|
|
|
229
229
|
/* 显示区域第一行的索引 */
|
|
230
230
|
index: i / this.expand >> 0
|
|
231
231
|
};
|
|
232
|
-
|
|
232
|
+
M(s, this.space), t.from || e.push(["onscroll", s]);
|
|
233
233
|
let l = !1;
|
|
234
|
-
|
|
234
|
+
k(
|
|
235
235
|
this.flyweights,
|
|
236
|
-
(a, n,
|
|
237
|
-
if (
|
|
238
|
-
(+(
|
|
236
|
+
(a, n, h, r, o, u, d, c, f) => {
|
|
237
|
+
if (h = a / o >> 0, c = h + r * /* 偏移量, 如果超出顶部 + 1轮,排列到列队后, 否则保持在当前*/
|
|
238
|
+
(+(h < u % r) + (u / r >> 0)), f = c * o + a % o, f >= this.count) {
|
|
239
239
|
l || (e.push(["onend"]), l = !0);
|
|
240
240
|
return;
|
|
241
241
|
}
|
|
@@ -264,40 +264,40 @@ const ut = {
|
|
|
264
264
|
if (!t)
|
|
265
265
|
return e.length = t;
|
|
266
266
|
this.count = t;
|
|
267
|
-
let i = this.scrollx, s = this.flyweight, l =
|
|
267
|
+
let i = this.scrollx, s = this.flyweight, l = L(s, this.BoxRule);
|
|
268
268
|
this.$nextTick(() => {
|
|
269
|
-
let a = /true/.test(this.auto), [n,
|
|
269
|
+
let a = /true/.test(this.auto), [n, h] = this.offset, r = l.width, o = l.height, u = (D(this.width, r) || r) + n, d = D(this.height, o) + h, c = [r / u >> 0 || 1, o / d >> 0 || 1];
|
|
270
270
|
i && c.reverse();
|
|
271
|
-
let [f, p] = c, b = this.padding,
|
|
272
|
-
i ? (_ = u, u -= n, y = (
|
|
271
|
+
let [f, p] = c, b = this.padding, T, x = 0, _, y;
|
|
272
|
+
i ? (_ = u, u -= n, y = (S) => (
|
|
273
273
|
/* 计算top偏移量 */
|
|
274
|
-
|
|
275
|
-
)) : (a ? (u = (r - n * (f + 2 * b - 1)) / f,
|
|
276
|
-
let
|
|
277
|
-
for (;
|
|
278
|
-
$ = m -
|
|
274
|
+
S * (d - h) + (S + 1) * h
|
|
275
|
+
)) : (a ? (u = (r - n * (f + 2 * b - 1)) / f, T = !b * n, x = b * n) : (T = 0, x = (r % u + n * f) / (f + 1) >> 0, u -= n), y = (S) => S * (u + T) + (S + 1) * x, _ = d), this.row = p + 2, this.column = f, this.realH = d - h, this.realW = u, this.expand = _, this.Size = Math.ceil(t / f) * _;
|
|
276
|
+
let v = Math.min(t, f * this.row), m = v - 1, $;
|
|
277
|
+
for (; v-- > 0; )
|
|
278
|
+
$ = m - v, this.$set(e, $, {
|
|
279
279
|
x: n,
|
|
280
|
-
y:
|
|
280
|
+
y: h,
|
|
281
281
|
width: u,
|
|
282
|
-
height: d -
|
|
282
|
+
height: d - h,
|
|
283
283
|
space: y($ % f),
|
|
284
284
|
data: {}
|
|
285
285
|
});
|
|
286
286
|
e.length = m + 1;
|
|
287
|
-
let
|
|
288
|
-
|
|
287
|
+
let N = [];
|
|
288
|
+
o / _ > m / f && N.push(["onend"]), this.flyweight && (this.flyweight[this.direction] = 0), this.$nextTick(() => {
|
|
289
289
|
this.setindex(this.selectIndex || 0), this.scroll();
|
|
290
|
-
}),
|
|
290
|
+
}), N.push(["update:space", {
|
|
291
291
|
row: (m / f >> 0) + 1,
|
|
292
292
|
column: f,
|
|
293
293
|
showrow: this.row,
|
|
294
294
|
showcolumn: this.column
|
|
295
|
-
}]), this.trigger(
|
|
295
|
+
}]), this.trigger(N);
|
|
296
296
|
});
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
299
|
};
|
|
300
|
-
var
|
|
300
|
+
var _t = function() {
|
|
301
301
|
var e = this, i = e._self._c;
|
|
302
302
|
return i("div", { ref: "flyweight", staticClass: "flyweight", class: {
|
|
303
303
|
"flyweight-active": e.actice
|
|
@@ -307,21 +307,21 @@ var dt = function() {
|
|
|
307
307
|
left: s.left + "px"
|
|
308
308
|
} }, [e._t("default", null, null, s)], 2);
|
|
309
309
|
}), 0), e.flyweights.length ? e._t("end") : e._e()], 2);
|
|
310
|
-
},
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
310
|
+
}, mt = [], yt = /* @__PURE__ */ W(
|
|
311
|
+
gt,
|
|
312
|
+
_t,
|
|
313
|
+
mt,
|
|
314
314
|
!1,
|
|
315
315
|
null,
|
|
316
316
|
"d5f1cd63",
|
|
317
317
|
null,
|
|
318
318
|
null
|
|
319
319
|
);
|
|
320
|
-
const
|
|
321
|
-
function
|
|
320
|
+
const vt = yt.exports;
|
|
321
|
+
function A(t, e) {
|
|
322
322
|
return e && (t = t.replace(/[a-z]/g, "")), t.toLowerCase();
|
|
323
323
|
}
|
|
324
|
-
let
|
|
324
|
+
let st = {
|
|
325
325
|
close: {
|
|
326
326
|
handler(t) {
|
|
327
327
|
this.change(t);
|
|
@@ -334,7 +334,7 @@ let et = {
|
|
|
334
334
|
},
|
|
335
335
|
deep: !0
|
|
336
336
|
}
|
|
337
|
-
},
|
|
337
|
+
}, wt = [
|
|
338
338
|
"BackGround",
|
|
339
339
|
"BordeR",
|
|
340
340
|
"Height",
|
|
@@ -343,17 +343,17 @@ let et = {
|
|
|
343
343
|
"Right",
|
|
344
344
|
"Bottom",
|
|
345
345
|
"Left"
|
|
346
|
-
],
|
|
347
|
-
|
|
348
|
-
|
|
346
|
+
], rt = {};
|
|
347
|
+
k(
|
|
348
|
+
wt,
|
|
349
349
|
(t, e, i) => {
|
|
350
|
-
t =
|
|
350
|
+
t = A(e), rt["--" + A(e, !0)] = t, i[t] = function() {
|
|
351
351
|
this.trigger++;
|
|
352
352
|
};
|
|
353
353
|
},
|
|
354
|
-
|
|
354
|
+
st
|
|
355
355
|
);
|
|
356
|
-
const
|
|
356
|
+
const bt = {
|
|
357
357
|
name: "Card",
|
|
358
358
|
// inheritAttrs: false,
|
|
359
359
|
props: {
|
|
@@ -412,33 +412,33 @@ const mt = {
|
|
|
412
412
|
return this.tr();
|
|
413
413
|
}
|
|
414
414
|
},
|
|
415
|
-
watch:
|
|
415
|
+
watch: st,
|
|
416
416
|
methods: {
|
|
417
417
|
exec: w,
|
|
418
|
-
isEmpty:
|
|
419
|
-
isSimplyType:
|
|
418
|
+
isEmpty: it,
|
|
419
|
+
isSimplyType: X,
|
|
420
420
|
tr() {
|
|
421
421
|
let t = {};
|
|
422
|
-
return this.margin(this.offset),
|
|
422
|
+
return this.margin(this.offset), k(rt, (e, i) => {
|
|
423
423
|
this.css(t, e, i);
|
|
424
424
|
}), t;
|
|
425
425
|
},
|
|
426
|
-
tolower:
|
|
426
|
+
tolower: A,
|
|
427
427
|
css(t, e, i) {
|
|
428
428
|
let s = this[i] || this.default[i];
|
|
429
429
|
!s || this.default[i] == s || (t[e] = w(s));
|
|
430
430
|
},
|
|
431
431
|
change(t) {
|
|
432
|
-
|
|
432
|
+
X(t) || (this.closecss = L(
|
|
433
433
|
t,
|
|
434
434
|
"color=>--s-card-close-color,size=>--s-close-width,bold=>--s-close-height,*"
|
|
435
435
|
));
|
|
436
436
|
},
|
|
437
437
|
margin(t) {
|
|
438
|
-
|
|
438
|
+
M(
|
|
439
439
|
this,
|
|
440
|
-
|
|
441
|
-
|
|
440
|
+
L(
|
|
441
|
+
ct(t) ? t.split(/\s*(?:,|\s+)\s*/) : t,
|
|
442
442
|
"0=>top,1|0=>right,2|0=>bottom,3|1|0=>left",
|
|
443
443
|
!0
|
|
444
444
|
),
|
|
@@ -450,7 +450,7 @@ const mt = {
|
|
|
450
450
|
this.change(this.close);
|
|
451
451
|
}
|
|
452
452
|
};
|
|
453
|
-
var
|
|
453
|
+
var xt = function() {
|
|
454
454
|
var e = this, i = e._self._c;
|
|
455
455
|
return i("div", { key: e.trigger, staticClass: "card", style: e.isEmpty(e.style) ? e.tr() : e.style }, [e._t("default", function() {
|
|
456
456
|
return [e._t("title", function() {
|
|
@@ -462,22 +462,25 @@ var vt = function() {
|
|
|
462
462
|
return [i("div", { staticClass: "card-content" }, [e._t("inner")], 2)];
|
|
463
463
|
})];
|
|
464
464
|
})], 2);
|
|
465
|
-
},
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
465
|
+
}, St = [], $t = /* @__PURE__ */ W(
|
|
466
|
+
bt,
|
|
467
|
+
xt,
|
|
468
|
+
St,
|
|
469
469
|
!1,
|
|
470
470
|
null,
|
|
471
471
|
"ec96bb2a",
|
|
472
472
|
null,
|
|
473
473
|
null
|
|
474
474
|
);
|
|
475
|
-
const
|
|
475
|
+
const Nt = $t.exports, zt = {
|
|
476
476
|
name: "Stream",
|
|
477
477
|
computed: {
|
|
478
|
+
component() {
|
|
479
|
+
return this.$refs.component;
|
|
480
|
+
},
|
|
478
481
|
column() {
|
|
479
482
|
let { columns: t, T: e } = this, i = t || e;
|
|
480
|
-
return
|
|
483
|
+
return it(i) ? [] : et(i) ? i : [i];
|
|
481
484
|
}
|
|
482
485
|
},
|
|
483
486
|
props: {
|
|
@@ -490,10 +493,6 @@ const xt = bt.exports, St = {
|
|
|
490
493
|
type: String,
|
|
491
494
|
default: "div"
|
|
492
495
|
},
|
|
493
|
-
data: {
|
|
494
|
-
type: Array,
|
|
495
|
-
default: () => []
|
|
496
|
-
},
|
|
497
496
|
columns: {
|
|
498
497
|
type: [Object, Array],
|
|
499
498
|
default: () => null
|
|
@@ -503,37 +502,40 @@ const xt = bt.exports, St = {
|
|
|
503
502
|
default: () => null
|
|
504
503
|
}
|
|
505
504
|
},
|
|
505
|
+
mounted() {
|
|
506
|
+
this.$.vnode.ref && M(this, { ...this.component });
|
|
507
|
+
},
|
|
506
508
|
methods: {
|
|
507
|
-
|
|
509
|
+
__trigger(t) {
|
|
508
510
|
let e = t[this.bridge] || t.type;
|
|
509
511
|
return (this.$slots || this.$scopedSlots)[e] ? e : "default";
|
|
510
512
|
}
|
|
511
513
|
}
|
|
512
514
|
};
|
|
513
|
-
var
|
|
515
|
+
var Tt = function() {
|
|
514
516
|
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.
|
|
517
|
+
return i(e.type, e._b({ ref: "component", tag: "component" }, "component", e.$attrs, !1), [e._l(e.column, function(s) {
|
|
518
|
+
return e._t(e.__trigger(s), null, null, s);
|
|
517
519
|
})], 2);
|
|
518
|
-
},
|
|
519
|
-
St,
|
|
520
|
-
$t,
|
|
520
|
+
}, Ct = [], Rt = /* @__PURE__ */ W(
|
|
521
521
|
zt,
|
|
522
|
+
Tt,
|
|
523
|
+
Ct,
|
|
522
524
|
!1,
|
|
523
525
|
null,
|
|
524
526
|
null,
|
|
525
527
|
null,
|
|
526
528
|
null
|
|
527
529
|
);
|
|
528
|
-
const
|
|
529
|
-
let
|
|
530
|
-
const
|
|
531
|
-
var
|
|
530
|
+
const kt = Rt.exports, J = /(?:\,|\|{2})/, K = "px", Q = "";
|
|
531
|
+
let nt = document.documentElement, Z, tt = ["s-left", "s-top", "s-right", "s-bottom"], Mt = { left: 0, top: 1, right: 2, bottom: 3 };
|
|
532
|
+
const F = [];
|
|
533
|
+
var Ht = ut(
|
|
532
534
|
window,
|
|
533
535
|
"Reflect.defineProperty|Object.defineProperty=>Proxy"
|
|
534
536
|
).Proxy;
|
|
535
|
-
let
|
|
536
|
-
|
|
537
|
+
let P = {}, lt = null;
|
|
538
|
+
Ht(P, "delay", {
|
|
537
539
|
/**
|
|
538
540
|
* 获取延迟时间值
|
|
539
541
|
* @returns {number} 返回当前实例的延迟时间属性值
|
|
@@ -542,79 +544,77 @@ Rt(B, "delay", {
|
|
|
542
544
|
return this._delay;
|
|
543
545
|
},
|
|
544
546
|
set(t) {
|
|
545
|
-
|
|
546
|
-
g(
|
|
547
|
+
lt = Et(() => {
|
|
548
|
+
g(F);
|
|
547
549
|
}, t), this._delay = t;
|
|
548
550
|
}
|
|
549
551
|
});
|
|
550
|
-
|
|
551
|
-
function
|
|
552
|
+
P.delay = 60;
|
|
553
|
+
function Et(t, e) {
|
|
552
554
|
let i = 0;
|
|
553
555
|
return function() {
|
|
554
556
|
const s = Date.now();
|
|
555
557
|
s - i >= e && (i = s, g(t, this, arguments));
|
|
556
558
|
};
|
|
557
559
|
}
|
|
558
|
-
const
|
|
559
|
-
|
|
560
|
+
const E = () => {
|
|
561
|
+
lt();
|
|
560
562
|
};
|
|
561
|
-
function
|
|
562
|
-
|
|
563
|
+
function Lt(t) {
|
|
564
|
+
F.push(t);
|
|
563
565
|
}
|
|
564
|
-
const
|
|
565
|
-
|
|
566
|
-
function
|
|
567
|
-
t.onresize || (
|
|
568
|
-
var e =
|
|
566
|
+
const R = new ResizeObserver(E);
|
|
567
|
+
R.observe(nt);
|
|
568
|
+
function ot(t) {
|
|
569
|
+
t.onresize || (F.push([ot, null, t]), t.onresize = !0);
|
|
570
|
+
var e = nt, i = e.clientHeight, s = ft(t.offset) ? 15 : t.offset, l = t.target, a = t.room, n = t.index, h = t.position, r = l.getBoundingClientRect(), o = a.offsetHeight + s, u = a.offsetWidth + s, d = "3,0,2,1".split(J), c, f = (r.height == Z ? r.bottom - r.top : r.height) >> 0, p = (r.width == Z ? r.right - r.left : r.width) >> 0, b = e.clientWidth - u, T = i - o, x = [
|
|
569
571
|
/* left: 0 */
|
|
570
572
|
r.left - u,
|
|
571
573
|
/* top: 1 */
|
|
572
|
-
r.top -
|
|
574
|
+
r.top - o,
|
|
573
575
|
/* right: 2 */
|
|
574
576
|
b - r.right,
|
|
575
577
|
/* bottom: 3 */
|
|
576
|
-
|
|
578
|
+
T - r.bottom
|
|
577
579
|
];
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
function(
|
|
581
|
-
|
|
580
|
+
h && (G(
|
|
581
|
+
h.split(J),
|
|
582
|
+
function(ht, H, O, at) {
|
|
583
|
+
at.push(O[H]);
|
|
582
584
|
},
|
|
583
|
-
|
|
585
|
+
Mt,
|
|
584
586
|
c = []
|
|
585
|
-
), d.unshift.apply(d, c)), n =
|
|
587
|
+
), d.unshift.apply(d, c)), n = G(
|
|
586
588
|
d,
|
|
587
|
-
function(
|
|
588
|
-
if (O[
|
|
589
|
-
return
|
|
589
|
+
function(ht, H, O) {
|
|
590
|
+
if (O[H] > 0)
|
|
591
|
+
return H;
|
|
590
592
|
},
|
|
591
593
|
x
|
|
592
594
|
);
|
|
593
|
-
var _ = 0, y = 0,
|
|
595
|
+
var _ = 0, y = 0, v = 0;
|
|
594
596
|
if (n != null) {
|
|
595
597
|
var m = n == 0 || n == 2, $ = n == 3 || n == 1;
|
|
596
|
-
_ = $ ? Math.min(r.left, b) : n == 2 ? r.right + s : x[0],
|
|
597
|
-
var
|
|
598
|
+
_ = $ ? Math.min(r.left, b) : n == 2 ? r.right + s : x[0], o -= s * +m;
|
|
599
|
+
var N = Math.max(r.top, 0), S = Math.min(
|
|
598
600
|
r.bottom,
|
|
599
601
|
i
|
|
600
|
-
),
|
|
602
|
+
), B = (S - o + Math.min(i - o, N)) / 2;
|
|
601
603
|
y = Math.max(
|
|
602
|
-
m ?
|
|
604
|
+
m ? B : n == 3 ? r.top + f + s : Math.min(B, x[1]),
|
|
603
605
|
0
|
|
604
|
-
), $ && r.left > b && (
|
|
606
|
+
), $ && r.left > b && (v = r.left - _ - s + p / 2);
|
|
605
607
|
}
|
|
606
|
-
let
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
)
|
|
615
|
-
) + H : J, k["--tips-position-left"] = S ? Math.min(S, u - 3 * s) + H : J;
|
|
608
|
+
let I = a.classList, C = t.css;
|
|
609
|
+
I.remove(...tt), I.add(tt[n]), t.index = n, C.left = _ + K, C.top = y + K;
|
|
610
|
+
let j = C["--tips-arrow-top"] = m ? Math.min(
|
|
611
|
+
/* 底边距 */
|
|
612
|
+
Math.max(y, N) - y,
|
|
613
|
+
o - s
|
|
614
|
+
) : Q, U = u - 3 * s;
|
|
615
|
+
C["--tips-arrow"] = v > U - 10 || m && (j + (o > 50 ? 15 : 0) > o || !j) ? "hidden" : "visible", C["--tips-arrow-left"] = v ? Math.min(v, U) : Q;
|
|
616
616
|
}
|
|
617
|
-
const
|
|
617
|
+
const Wt = {
|
|
618
618
|
name: "Tips",
|
|
619
619
|
props: {
|
|
620
620
|
/* 是否显示 */
|
|
@@ -670,6 +670,11 @@ const Ht = {
|
|
|
670
670
|
delay: {
|
|
671
671
|
type: [String, Number],
|
|
672
672
|
default: 10
|
|
673
|
+
},
|
|
674
|
+
/* 显示箭头 */
|
|
675
|
+
borderRadius: {
|
|
676
|
+
type: [String, Number],
|
|
677
|
+
default: 10
|
|
673
678
|
}
|
|
674
679
|
},
|
|
675
680
|
watch: {
|
|
@@ -700,7 +705,7 @@ const Ht = {
|
|
|
700
705
|
},
|
|
701
706
|
/* 初始化 */
|
|
702
707
|
init() {
|
|
703
|
-
this.$el.nodeName != "#comment" &&
|
|
708
|
+
this.$el.nodeName != "#comment" && ot({
|
|
704
709
|
onresize: !1,
|
|
705
710
|
/* 监控的目标 */
|
|
706
711
|
target: this.$el.parentNode,
|
|
@@ -711,60 +716,62 @@ const Ht = {
|
|
|
711
716
|
/* CSS样式集合 */
|
|
712
717
|
css: this.css,
|
|
713
718
|
/* 偏移量 */
|
|
714
|
-
offset: +this.offset
|
|
719
|
+
offset: +this.offset >> 0
|
|
715
720
|
});
|
|
716
721
|
},
|
|
717
722
|
scrollListener() {
|
|
718
723
|
this.static || this.parent((t, e, i) => {
|
|
719
|
-
e ? g(t.addEventListener, t, "scroll",
|
|
724
|
+
e ? g(t.addEventListener, t, "scroll", E) : (g(R.observe, R, t), (t.offsetHeight < t.scrollHeight || t.offsetWidth < t.scrollWidth) && (i = this.attr(t, "-tips-scroll"), i || (g(t.addEventListener, t, "scroll", E), this.attr(t, "-tips-scroll", "true"))));
|
|
720
725
|
});
|
|
721
726
|
}
|
|
722
727
|
},
|
|
723
728
|
mounted() {
|
|
724
|
-
|
|
729
|
+
M(
|
|
725
730
|
this.css,
|
|
726
|
-
|
|
731
|
+
L(
|
|
727
732
|
this.$props,
|
|
728
|
-
"color=>--tips-color,background=>--tips-background-color,border=>--tips-border-width,fontSize=>--tips-font-size"
|
|
733
|
+
"color=>--tips-color,background=>--tips-background-color,border=>--tips-border-width,fontSize=>--tips-font-size,borderRadius=>--tips-border-radius"
|
|
729
734
|
)
|
|
730
|
-
), this.init(),
|
|
735
|
+
), this.css["--arrow-size"] = Math.sqrt(2 * Math.pow((this.border || 3) * 2 + 2, 2)) / 2 >> 0, this.init(), P.delay = +this.delay, Lt((t) => {
|
|
731
736
|
this.scrollListener();
|
|
732
737
|
}), this.scrollListener();
|
|
733
738
|
},
|
|
734
739
|
unmounted() {
|
|
735
740
|
this.parent(function(t, e) {
|
|
736
|
-
g(t.removeEventListener, t, "scroll",
|
|
741
|
+
g(t.removeEventListener, t, "scroll", E), g(t.removeAttribute, t, "-tips-scroll", void 0), e || g(R.unobserve, R, t);
|
|
737
742
|
});
|
|
738
743
|
}
|
|
739
744
|
};
|
|
740
|
-
var
|
|
745
|
+
var Ot = function() {
|
|
741
746
|
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("
|
|
743
|
-
return [
|
|
744
|
-
|
|
745
|
-
|
|
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() {
|
|
748
|
+
return [e._t("title", function() {
|
|
749
|
+
return [i("div", { staticClass: "tips-title" }, [e._v(e._s(e.title))])];
|
|
750
|
+
}), e._t("content", function() {
|
|
751
|
+
return [e._v(e._s(e.content))];
|
|
752
|
+
})];
|
|
746
753
|
})], 2) : e._e();
|
|
747
|
-
},
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
754
|
+
}, At = [], Ft = /* @__PURE__ */ W(
|
|
755
|
+
Wt,
|
|
756
|
+
Ot,
|
|
757
|
+
At,
|
|
751
758
|
!1,
|
|
752
759
|
null,
|
|
753
|
-
"
|
|
760
|
+
"72d69fdc",
|
|
754
761
|
null,
|
|
755
762
|
null
|
|
756
763
|
);
|
|
757
|
-
const
|
|
764
|
+
const Pt = Ft.exports, Bt = [vt, Nt, kt, Pt], Xt = {
|
|
758
765
|
install(t) {
|
|
759
|
-
|
|
766
|
+
Bt.forEach((e) => {
|
|
760
767
|
t.component("S" + e.name, e), t.component(e.name + "S", e);
|
|
761
768
|
});
|
|
762
769
|
}
|
|
763
770
|
};
|
|
764
771
|
export {
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
772
|
+
Nt as Card,
|
|
773
|
+
vt as Flyweight,
|
|
774
|
+
kt as Stream,
|
|
775
|
+
Pt as Tips,
|
|
776
|
+
Xt as default
|
|
770
777
|
};
|