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