@stonecrop/atable 0.4.2 → 0.4.3
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/dist/assets/index.css +1 -1
- package/dist/atable.d.ts +6 -0
- package/dist/atable.js +251 -231
- package/dist/atable.js.map +1 -1
- package/dist/atable.umd.cjs +2 -2
- package/dist/atable.umd.cjs.map +1 -1
- package/dist/index.js +5 -1
- package/dist/src/index.d.ts +3 -1
- package/dist/src/index.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/components/ATableLoading.vue +86 -0
- package/src/components/ATableLoadingBar.vue +81 -0
- package/src/index.ts +5 -1
package/dist/atable.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { onMounted as G, ref as x, watch as
|
|
2
|
-
import { defineStore as
|
|
3
|
-
import './assets/index.css';function
|
|
4
|
-
return
|
|
1
|
+
import { onMounted as G, ref as x, watch as O, onBeforeUnmount as Je, computed as k, unref as b, getCurrentScope as Oe, onScopeDispose as Le, getCurrentInstance as ue, nextTick as Pe, toRef as Qe, readonly as Ze, customRef as Ke, defineComponent as V, useTemplateRef as J, openBlock as C, createElementBlock as I, normalizeStyle as z, normalizeClass as F, createBlock as _, resolveDynamicComponent as We, mergeProps as de, toDisplayString as Y, Fragment as te, createElementVNode as L, renderSlot as M, createCommentVNode as U, withDirectives as se, vShow as De, renderList as ae, createTextVNode as _e, createVNode as Ee, withCtx as Ce } from "vue";
|
|
2
|
+
import { defineStore as et } from "pinia";
|
|
3
|
+
import './assets/index.css';function He(e) {
|
|
4
|
+
return Oe() ? (Le(e), !0) : !1;
|
|
5
5
|
}
|
|
6
6
|
function fe(e) {
|
|
7
7
|
return typeof e == "function" ? e() : b(e);
|
|
8
8
|
}
|
|
9
|
-
const
|
|
9
|
+
const tt = typeof window < "u" && typeof document < "u";
|
|
10
10
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
11
|
-
const
|
|
12
|
-
}, Q =
|
|
11
|
+
const nt = (e) => e != null, ot = Object.prototype.toString, lt = (e) => ot.call(e) === "[object Object]", rt = () => {
|
|
12
|
+
}, Q = tt ? window : void 0;
|
|
13
13
|
function X(e) {
|
|
14
14
|
var t;
|
|
15
15
|
const n = fe(e);
|
|
@@ -18,16 +18,16 @@ function X(e) {
|
|
|
18
18
|
function q(...e) {
|
|
19
19
|
let t, n, o, a;
|
|
20
20
|
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, o, a] = e, t = Q) : [t, n, o, a] = e, !t)
|
|
21
|
-
return
|
|
21
|
+
return rt;
|
|
22
22
|
Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
|
|
23
23
|
const i = [], l = () => {
|
|
24
24
|
i.forEach((c) => c()), i.length = 0;
|
|
25
|
-
}, r = (c, u, f, m) => (c.addEventListener(u, f, m), () => c.removeEventListener(u, f, m)), d =
|
|
25
|
+
}, r = (c, u, f, m) => (c.addEventListener(u, f, m), () => c.removeEventListener(u, f, m)), d = O(
|
|
26
26
|
() => [X(t), fe(a)],
|
|
27
27
|
([c, u]) => {
|
|
28
28
|
if (l(), !c)
|
|
29
29
|
return;
|
|
30
|
-
const f =
|
|
30
|
+
const f = lt(u) ? { ...u } : u;
|
|
31
31
|
i.push(
|
|
32
32
|
...n.flatMap((m) => o.map((g) => r(c, m, g, f)))
|
|
33
33
|
);
|
|
@@ -36,27 +36,27 @@ function q(...e) {
|
|
|
36
36
|
), s = () => {
|
|
37
37
|
d(), l();
|
|
38
38
|
};
|
|
39
|
-
return
|
|
39
|
+
return He(s), s;
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function st() {
|
|
42
42
|
const e = x(!1), t = ue();
|
|
43
43
|
return t && G(() => {
|
|
44
44
|
e.value = !0;
|
|
45
45
|
}, t), e;
|
|
46
46
|
}
|
|
47
|
-
function
|
|
48
|
-
const t =
|
|
47
|
+
function at(e) {
|
|
48
|
+
const t = st();
|
|
49
49
|
return k(() => (t.value, !!e()));
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function it(e, t, n = {}) {
|
|
52
52
|
const { window: o = Q, ...a } = n;
|
|
53
53
|
let i;
|
|
54
|
-
const l =
|
|
54
|
+
const l = at(() => o && "MutationObserver" in o), r = () => {
|
|
55
55
|
i && (i.disconnect(), i = void 0);
|
|
56
56
|
}, d = k(() => {
|
|
57
|
-
const f = fe(e), m = (Array.isArray(f) ? f : [f]).map(X).filter(
|
|
57
|
+
const f = fe(e), m = (Array.isArray(f) ? f : [f]).map(X).filter(nt);
|
|
58
58
|
return new Set(m);
|
|
59
|
-
}), s =
|
|
59
|
+
}), s = O(
|
|
60
60
|
() => d.value,
|
|
61
61
|
(f) => {
|
|
62
62
|
r(), l.value && f.size && (i = new MutationObserver(t), f.forEach((m) => i.observe(m, a)));
|
|
@@ -65,13 +65,13 @@ function at(e, t, n = {}) {
|
|
|
65
65
|
), c = () => i == null ? void 0 : i.takeRecords(), u = () => {
|
|
66
66
|
s(), r();
|
|
67
67
|
};
|
|
68
|
-
return
|
|
68
|
+
return He(u), {
|
|
69
69
|
isSupported: l,
|
|
70
70
|
stop: u,
|
|
71
71
|
takeRecords: c
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function ct(e = {}) {
|
|
75
75
|
var t;
|
|
76
76
|
const {
|
|
77
77
|
window: n = Q,
|
|
@@ -89,7 +89,7 @@ function it(e = {}) {
|
|
|
89
89
|
};
|
|
90
90
|
return n && (q(n, "blur", (s) => {
|
|
91
91
|
s.relatedTarget === null && d();
|
|
92
|
-
}, !0), q(n, "focus", d, !0)), a &&
|
|
92
|
+
}, !0), q(n, "focus", d, !0)), a && it(i, (s) => {
|
|
93
93
|
s.filter((c) => c.removedNodes.length).map((c) => Array.from(c.removedNodes)).flat().forEach((c) => {
|
|
94
94
|
c === r.value && d();
|
|
95
95
|
});
|
|
@@ -98,12 +98,12 @@ function it(e = {}) {
|
|
|
98
98
|
subtree: !0
|
|
99
99
|
}), d(), r;
|
|
100
100
|
}
|
|
101
|
-
const
|
|
102
|
-
function
|
|
103
|
-
const { window: n = Q } = t, o = k(() => X(e)), a = x(!1), i = k(() => a.value), l =
|
|
104
|
-
return !n || !l.value ? { focused: i } : (q(o,
|
|
101
|
+
const ut = "focusin", dt = "focusout";
|
|
102
|
+
function ft(e, t = {}) {
|
|
103
|
+
const { window: n = Q } = t, o = k(() => X(e)), a = x(!1), i = k(() => a.value), l = ct(t);
|
|
104
|
+
return !n || !l.value ? { focused: i } : (q(o, ut, () => a.value = !0), q(o, dt, () => a.value = !1), { focused: i });
|
|
105
105
|
}
|
|
106
|
-
function
|
|
106
|
+
function mt(e, { window: t = Q, scrollTarget: n } = {}) {
|
|
107
107
|
const o = x(!1), a = () => {
|
|
108
108
|
if (!t) return;
|
|
109
109
|
const i = t.document, l = X(e);
|
|
@@ -114,7 +114,7 @@ function ft(e, { window: t = Q, scrollTarget: n } = {}) {
|
|
|
114
114
|
o.value = r.top <= (t.innerHeight || i.documentElement.clientHeight) && r.left <= (t.innerWidth || i.documentElement.clientWidth) && r.bottom >= 0 && r.right >= 0;
|
|
115
115
|
}
|
|
116
116
|
};
|
|
117
|
-
return
|
|
117
|
+
return O(
|
|
118
118
|
() => X(e),
|
|
119
119
|
() => a(),
|
|
120
120
|
{ immediate: !0, flush: "post" }
|
|
@@ -123,10 +123,10 @@ function ft(e, { window: t = Q, scrollTarget: n } = {}) {
|
|
|
123
123
|
passive: !0
|
|
124
124
|
}), o;
|
|
125
125
|
}
|
|
126
|
-
const
|
|
127
|
-
let t =
|
|
126
|
+
const P = (e) => {
|
|
127
|
+
let t = mt(e).value;
|
|
128
128
|
return t = t && e.offsetHeight > 0, t;
|
|
129
|
-
},
|
|
129
|
+
}, W = (e) => e.tabIndex >= 0, ke = (e) => {
|
|
130
130
|
const t = e.target;
|
|
131
131
|
return me(t);
|
|
132
132
|
}, me = (e) => {
|
|
@@ -142,8 +142,8 @@ const L = (e) => {
|
|
|
142
142
|
const o = e.previousElementSibling;
|
|
143
143
|
o && (n = o);
|
|
144
144
|
}
|
|
145
|
-
return n && (!
|
|
146
|
-
},
|
|
145
|
+
return n && (!W(n) || !P(n)) ? me(n) : n;
|
|
146
|
+
}, vt = (e) => {
|
|
147
147
|
var t;
|
|
148
148
|
const n = e.target;
|
|
149
149
|
let o;
|
|
@@ -160,8 +160,8 @@ const L = (e) => {
|
|
|
160
160
|
i && (o = i);
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
|
-
return o && (!
|
|
164
|
-
},
|
|
163
|
+
return o && (!W(o) || !P(o)) ? ve(o) : o;
|
|
164
|
+
}, Ae = (e) => {
|
|
165
165
|
const t = e.target;
|
|
166
166
|
return ve(t);
|
|
167
167
|
}, ve = (e) => {
|
|
@@ -177,8 +177,8 @@ const L = (e) => {
|
|
|
177
177
|
const o = e.nextElementSibling;
|
|
178
178
|
o && (n = o);
|
|
179
179
|
}
|
|
180
|
-
return n && (!
|
|
181
|
-
},
|
|
180
|
+
return n && (!W(n) || !P(n)) ? ve(n) : n;
|
|
181
|
+
}, pt = (e) => {
|
|
182
182
|
var t;
|
|
183
183
|
const n = e.target;
|
|
184
184
|
let o;
|
|
@@ -195,8 +195,8 @@ const L = (e) => {
|
|
|
195
195
|
i && (o = i);
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
|
-
return o && (!
|
|
199
|
-
},
|
|
198
|
+
return o && (!W(o) || !P(o)) ? me(o) : o;
|
|
199
|
+
}, Ie = (e) => {
|
|
200
200
|
const t = e.target;
|
|
201
201
|
return pe(t);
|
|
202
202
|
}, pe = (e) => {
|
|
@@ -208,8 +208,8 @@ const L = (e) => {
|
|
|
208
208
|
const o = (t = e.parentElement) == null ? void 0 : t.previousElementSibling;
|
|
209
209
|
n = o == null ? void 0 : o.lastElementChild;
|
|
210
210
|
}
|
|
211
|
-
return n && (!
|
|
212
|
-
},
|
|
211
|
+
return n && (!W(n) || !P(n)) ? pe(n) : n;
|
|
212
|
+
}, $e = (e) => {
|
|
213
213
|
const t = e.target;
|
|
214
214
|
return he(t);
|
|
215
215
|
}, he = (e) => {
|
|
@@ -221,41 +221,41 @@ const L = (e) => {
|
|
|
221
221
|
const o = (t = e.parentElement) == null ? void 0 : t.nextElementSibling;
|
|
222
222
|
n = o == null ? void 0 : o.firstElementChild;
|
|
223
223
|
}
|
|
224
|
-
return n && (!
|
|
224
|
+
return n && (!W(n) || !P(n)) ? he(n) : n;
|
|
225
225
|
}, Se = (e) => {
|
|
226
226
|
const t = e.target.parentElement, n = t == null ? void 0 : t.firstElementChild;
|
|
227
|
-
return n && (!
|
|
227
|
+
return n && (!W(n) || !P(n)) ? he(n) : n;
|
|
228
228
|
}, Te = (e) => {
|
|
229
229
|
const t = e.target.parentElement, n = t == null ? void 0 : t.lastElementChild;
|
|
230
|
-
return n && (!
|
|
231
|
-
}, K = ["alt", "control", "shift", "meta"],
|
|
230
|
+
return n && (!W(n) || !P(n)) ? pe(n) : n;
|
|
231
|
+
}, K = ["alt", "control", "shift", "meta"], ht = {
|
|
232
232
|
ArrowUp: "up",
|
|
233
233
|
ArrowDown: "down",
|
|
234
234
|
ArrowLeft: "left",
|
|
235
235
|
ArrowRight: "right"
|
|
236
236
|
}, we = {
|
|
237
237
|
"keydown.up": (e) => {
|
|
238
|
-
const t =
|
|
238
|
+
const t = ke(e);
|
|
239
239
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
240
240
|
},
|
|
241
241
|
"keydown.down": (e) => {
|
|
242
|
-
const t =
|
|
242
|
+
const t = Ae(e);
|
|
243
243
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
244
244
|
},
|
|
245
245
|
"keydown.left": (e) => {
|
|
246
|
-
const t =
|
|
246
|
+
const t = Ie(e);
|
|
247
247
|
e.preventDefault(), e.stopPropagation(), t && t.focus();
|
|
248
248
|
},
|
|
249
249
|
"keydown.right": (e) => {
|
|
250
|
-
const t =
|
|
250
|
+
const t = $e(e);
|
|
251
251
|
e.preventDefault(), e.stopPropagation(), t && t.focus();
|
|
252
252
|
},
|
|
253
253
|
"keydown.control.up": (e) => {
|
|
254
|
-
const t =
|
|
254
|
+
const t = vt(e);
|
|
255
255
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
256
256
|
},
|
|
257
257
|
"keydown.control.down": (e) => {
|
|
258
|
-
const t =
|
|
258
|
+
const t = pt(e);
|
|
259
259
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
260
260
|
},
|
|
261
261
|
"keydown.control.left": (e) => {
|
|
@@ -273,14 +273,14 @@ const L = (e) => {
|
|
|
273
273
|
"keydown.enter": (e) => {
|
|
274
274
|
if (e.target instanceof HTMLTableCellElement) {
|
|
275
275
|
e.preventDefault(), e.stopPropagation();
|
|
276
|
-
const t =
|
|
276
|
+
const t = Ae(e);
|
|
277
277
|
t && t.focus();
|
|
278
278
|
}
|
|
279
279
|
},
|
|
280
280
|
"keydown.shift.enter": (e) => {
|
|
281
281
|
if (e.target instanceof HTMLTableCellElement) {
|
|
282
282
|
e.preventDefault(), e.stopPropagation();
|
|
283
|
-
const t =
|
|
283
|
+
const t = ke(e);
|
|
284
284
|
t && t.focus();
|
|
285
285
|
}
|
|
286
286
|
},
|
|
@@ -289,11 +289,11 @@ const L = (e) => {
|
|
|
289
289
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
290
290
|
},
|
|
291
291
|
"keydown.tab": (e) => {
|
|
292
|
-
const t =
|
|
292
|
+
const t = $e(e);
|
|
293
293
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
294
294
|
},
|
|
295
295
|
"keydown.shift.tab": (e) => {
|
|
296
|
-
const t =
|
|
296
|
+
const t = Ie(e);
|
|
297
297
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
298
298
|
}
|
|
299
299
|
};
|
|
@@ -322,9 +322,9 @@ function ge(e) {
|
|
|
322
322
|
}, o = (l) => {
|
|
323
323
|
const r = t(l);
|
|
324
324
|
let d = [];
|
|
325
|
-
return l.selectors ? d = n(l) : r && (d = Array.from(r.children).filter((s) =>
|
|
325
|
+
return l.selectors ? d = n(l) : r && (d = Array.from(r.children).filter((s) => W(s) && P(s))), d;
|
|
326
326
|
}, a = (l) => (r) => {
|
|
327
|
-
const d =
|
|
327
|
+
const d = ht[r.key] || r.key.toLowerCase();
|
|
328
328
|
if (K.includes(d)) return;
|
|
329
329
|
const s = l.handlers || we;
|
|
330
330
|
for (const c of Object.keys(s)) {
|
|
@@ -351,62 +351,62 @@ function ge(e) {
|
|
|
351
351
|
for (const l of e) {
|
|
352
352
|
const r = t(l), d = o(l), s = a(l), c = r ? [r] : d;
|
|
353
353
|
for (const u of c) {
|
|
354
|
-
const { focused: f } =
|
|
354
|
+
const { focused: f } = ft(x(u)), m = O(f, (g) => {
|
|
355
355
|
g ? u.addEventListener("keydown", s) : u.removeEventListener("keydown", s);
|
|
356
356
|
});
|
|
357
357
|
i.push(m);
|
|
358
358
|
}
|
|
359
359
|
}
|
|
360
|
-
}),
|
|
360
|
+
}), Je(() => {
|
|
361
361
|
for (const l of i)
|
|
362
362
|
l();
|
|
363
363
|
});
|
|
364
364
|
}
|
|
365
365
|
function Z(e) {
|
|
366
|
-
return
|
|
366
|
+
return Oe() ? (Le(e), !0) : !1;
|
|
367
367
|
}
|
|
368
|
-
function
|
|
368
|
+
function R(e) {
|
|
369
369
|
return typeof e == "function" ? e() : b(e);
|
|
370
370
|
}
|
|
371
371
|
const ye = typeof window < "u" && typeof document < "u";
|
|
372
372
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
373
|
-
const
|
|
374
|
-
}, ie = /* @__PURE__ */
|
|
375
|
-
function
|
|
373
|
+
const wt = (e) => e != null, gt = Object.prototype.toString, Ne = (e) => gt.call(e) === "[object Object]", H = () => {
|
|
374
|
+
}, ie = /* @__PURE__ */ yt();
|
|
375
|
+
function yt() {
|
|
376
376
|
var e, t;
|
|
377
377
|
return ye && ((e = window == null ? void 0 : window.navigator) == null ? void 0 : e.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((t = window == null ? void 0 : window.navigator) == null ? void 0 : t.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent));
|
|
378
378
|
}
|
|
379
|
-
function
|
|
379
|
+
function bt(e) {
|
|
380
380
|
return ue();
|
|
381
381
|
}
|
|
382
|
-
function
|
|
382
|
+
function xt(...e) {
|
|
383
383
|
if (e.length !== 1)
|
|
384
|
-
return
|
|
384
|
+
return Qe(...e);
|
|
385
385
|
const t = e[0];
|
|
386
|
-
return typeof t == "function" ?
|
|
386
|
+
return typeof t == "function" ? Ze(Ke(() => ({ get: t, set: H }))) : x(t);
|
|
387
387
|
}
|
|
388
|
-
function
|
|
389
|
-
|
|
388
|
+
function Et(e, t = !0, n) {
|
|
389
|
+
bt() ? G(e, n) : t ? e() : Pe(e);
|
|
390
390
|
}
|
|
391
391
|
const ne = ye ? window : void 0;
|
|
392
|
-
function
|
|
392
|
+
function N(e) {
|
|
393
393
|
var t;
|
|
394
|
-
const n =
|
|
394
|
+
const n = R(e);
|
|
395
395
|
return (t = n == null ? void 0 : n.$el) != null ? t : n;
|
|
396
396
|
}
|
|
397
397
|
function ce(...e) {
|
|
398
398
|
let t, n, o, a;
|
|
399
399
|
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, o, a] = e, t = ne) : [t, n, o, a] = e, !t)
|
|
400
|
-
return
|
|
400
|
+
return H;
|
|
401
401
|
Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
|
|
402
402
|
const i = [], l = () => {
|
|
403
403
|
i.forEach((c) => c()), i.length = 0;
|
|
404
|
-
}, r = (c, u, f, m) => (c.addEventListener(u, f, m), () => c.removeEventListener(u, f, m)), d =
|
|
405
|
-
() => [
|
|
404
|
+
}, r = (c, u, f, m) => (c.addEventListener(u, f, m), () => c.removeEventListener(u, f, m)), d = O(
|
|
405
|
+
() => [N(t), R(a)],
|
|
406
406
|
([c, u]) => {
|
|
407
407
|
if (l(), !c)
|
|
408
408
|
return;
|
|
409
|
-
const f =
|
|
409
|
+
const f = Ne(u) ? { ...u } : u;
|
|
410
410
|
i.push(
|
|
411
411
|
...n.flatMap((m) => o.map((g) => r(c, m, g, f)))
|
|
412
412
|
);
|
|
@@ -417,25 +417,25 @@ function ce(...e) {
|
|
|
417
417
|
};
|
|
418
418
|
return Z(s), s;
|
|
419
419
|
}
|
|
420
|
-
function
|
|
420
|
+
function Ct() {
|
|
421
421
|
const e = x(!1), t = ue();
|
|
422
422
|
return t && G(() => {
|
|
423
423
|
e.value = !0;
|
|
424
424
|
}, t), e;
|
|
425
425
|
}
|
|
426
|
-
function
|
|
427
|
-
const t =
|
|
426
|
+
function Ve(e) {
|
|
427
|
+
const t = Ct();
|
|
428
428
|
return k(() => (t.value, !!e()));
|
|
429
429
|
}
|
|
430
|
-
function
|
|
430
|
+
function je(e, t, n = {}) {
|
|
431
431
|
const { window: o = ne, ...a } = n;
|
|
432
432
|
let i;
|
|
433
|
-
const l =
|
|
433
|
+
const l = Ve(() => o && "MutationObserver" in o), r = () => {
|
|
434
434
|
i && (i.disconnect(), i = void 0);
|
|
435
435
|
}, d = k(() => {
|
|
436
|
-
const f =
|
|
436
|
+
const f = R(e), m = (Array.isArray(f) ? f : [f]).map(N).filter(wt);
|
|
437
437
|
return new Set(m);
|
|
438
|
-
}), s =
|
|
438
|
+
}), s = O(
|
|
439
439
|
() => d.value,
|
|
440
440
|
(f) => {
|
|
441
441
|
r(), l.value && f.size && (i = new MutationObserver(t), f.forEach((m) => i.observe(m, a)));
|
|
@@ -450,15 +450,15 @@ function Ve(e, t, n = {}) {
|
|
|
450
450
|
takeRecords: c
|
|
451
451
|
};
|
|
452
452
|
}
|
|
453
|
-
function
|
|
453
|
+
function kt(e, t, n = {}) {
|
|
454
454
|
const { window: o = ne, ...a } = n;
|
|
455
455
|
let i;
|
|
456
|
-
const l =
|
|
456
|
+
const l = Ve(() => o && "ResizeObserver" in o), r = () => {
|
|
457
457
|
i && (i.disconnect(), i = void 0);
|
|
458
458
|
}, d = k(() => {
|
|
459
|
-
const u =
|
|
460
|
-
return Array.isArray(u) ? u.map((f) =>
|
|
461
|
-
}), s =
|
|
459
|
+
const u = R(e);
|
|
460
|
+
return Array.isArray(u) ? u.map((f) => N(f)) : [N(u)];
|
|
461
|
+
}), s = O(
|
|
462
462
|
d,
|
|
463
463
|
(u) => {
|
|
464
464
|
if (r(), l.value && o) {
|
|
@@ -476,7 +476,7 @@ function Ct(e, t, n = {}) {
|
|
|
476
476
|
stop: c
|
|
477
477
|
};
|
|
478
478
|
}
|
|
479
|
-
function
|
|
479
|
+
function Be(e, t = {}) {
|
|
480
480
|
const {
|
|
481
481
|
reset: n = !0,
|
|
482
482
|
windowResize: o = !0,
|
|
@@ -485,7 +485,7 @@ function je(e, t = {}) {
|
|
|
485
485
|
updateTiming: l = "sync"
|
|
486
486
|
} = t, r = x(0), d = x(0), s = x(0), c = x(0), u = x(0), f = x(0), m = x(0), g = x(0);
|
|
487
487
|
function p() {
|
|
488
|
-
const w =
|
|
488
|
+
const w = N(e);
|
|
489
489
|
if (!w) {
|
|
490
490
|
n && (r.value = 0, d.value = 0, s.value = 0, c.value = 0, u.value = 0, f.value = 0, m.value = 0, g.value = 0);
|
|
491
491
|
return;
|
|
@@ -496,9 +496,9 @@ function je(e, t = {}) {
|
|
|
496
496
|
function v() {
|
|
497
497
|
l === "sync" ? p() : l === "next-frame" && requestAnimationFrame(() => p());
|
|
498
498
|
}
|
|
499
|
-
return
|
|
499
|
+
return kt(e, v), O(() => N(e), (w) => !w && v()), je(e, v, {
|
|
500
500
|
attributeFilter: ["style", "class"]
|
|
501
|
-
}), a && ce("scroll", v, { capture: !0, passive: !0 }), o && ce("resize", v, { passive: !0 }),
|
|
501
|
+
}), a && ce("scroll", v, { capture: !0, passive: !0 }), o && ce("resize", v, { passive: !0 }), Et(() => {
|
|
502
502
|
i && v();
|
|
503
503
|
}), {
|
|
504
504
|
height: r,
|
|
@@ -512,7 +512,7 @@ function je(e, t = {}) {
|
|
|
512
512
|
update: v
|
|
513
513
|
};
|
|
514
514
|
}
|
|
515
|
-
function
|
|
515
|
+
function At(e = {}) {
|
|
516
516
|
const { window: t = ne, behavior: n = "auto" } = e;
|
|
517
517
|
if (!t)
|
|
518
518
|
return {
|
|
@@ -546,10 +546,10 @@ function kt(e = {}) {
|
|
|
546
546
|
}
|
|
547
547
|
), { x: i, y: l };
|
|
548
548
|
}
|
|
549
|
-
const
|
|
549
|
+
const It = (e) => {
|
|
550
550
|
const t = new DOMParser().parseFromString(e, "text/html");
|
|
551
551
|
return Array.from(t.body.childNodes).some((n) => n.nodeType === 1);
|
|
552
|
-
},
|
|
552
|
+
}, $t = (e = 8) => Array.from({ length: e }, () => Math.floor(Math.random() * 16).toString(16)).join(""), St = ["data-colindex", "data-rowindex", "data-editable", "contenteditable", "tabindex"], Tt = ["innerHTML"], Mt = { key: 2 }, ze = /* @__PURE__ */ V({
|
|
553
553
|
__name: "ACell",
|
|
554
554
|
props: {
|
|
555
555
|
colIndex: {},
|
|
@@ -561,7 +561,7 @@ const At = (e) => {
|
|
|
561
561
|
},
|
|
562
562
|
emits: ["cellInput"],
|
|
563
563
|
setup(e, { emit: t }) {
|
|
564
|
-
const n = t, o = J("cell"), a = e.store.getCellData(e.colIndex, e.rowIndex), i = x(""), l = x(!1), r = e.store.columns[e.colIndex], d = e.store.rows[e.rowIndex], s = r.align || "center", c = r.width || "40ch", u = k(() => e.store.getCellDisplayValue(e.colIndex, e.rowIndex)), f = k(() => typeof u.value == "string" ?
|
|
564
|
+
const n = t, o = J("cell"), a = e.store.getCellData(e.colIndex, e.rowIndex), i = x(""), l = x(!1), r = e.store.columns[e.colIndex], d = e.store.rows[e.rowIndex], s = r.align || "center", c = r.width || "40ch", u = k(() => e.store.getCellDisplayValue(e.colIndex, e.rowIndex)), f = k(() => typeof u.value == "string" ? It(u.value) : !1), m = k(() => {
|
|
565
565
|
var w;
|
|
566
566
|
return {
|
|
567
567
|
textAlign: s,
|
|
@@ -571,9 +571,9 @@ const At = (e) => {
|
|
|
571
571
|
paddingLeft: e.store.getIndent(e.colIndex, (w = e.store.display[e.rowIndex]) == null ? void 0 : w.indent)
|
|
572
572
|
};
|
|
573
573
|
}), g = () => {
|
|
574
|
-
const { left: w, bottom: E, width:
|
|
575
|
-
r.mask, r.modalComponent && e.store.$patch((
|
|
576
|
-
|
|
574
|
+
const { left: w, bottom: E, width: D, height: oe } = Be(o);
|
|
575
|
+
r.mask, r.modalComponent && e.store.$patch((T) => {
|
|
576
|
+
T.modal.visible = !0, T.modal.colIndex = e.colIndex, T.modal.rowIndex = e.rowIndex, T.modal.left = w, T.modal.bottom = E, T.modal.width = D, T.modal.height = oe, typeof r.modalComponent == "function" ? T.modal.component = r.modalComponent({ table: T.table, row: d, column: r }) : T.modal.component = r.modalComponent, T.modal.componentProps = r.modalComponentExtraProps;
|
|
577
577
|
});
|
|
578
578
|
};
|
|
579
579
|
if (e.addNavigation) {
|
|
@@ -601,7 +601,7 @@ const At = (e) => {
|
|
|
601
601
|
const E = w.target;
|
|
602
602
|
E.textContent !== i.value && (n("cellInput", e.colIndex, e.rowIndex, E.textContent, i.value), i.value = E.textContent, r.format ? (l.value = E.textContent !== e.store.getFormattedValue(e.colIndex, e.rowIndex, a), e.store.setCellText(e.colIndex, e.rowIndex, E.textContent)) : (l.value = E.textContent !== a, e.store.setCellData(e.colIndex, e.rowIndex, E.textContent)));
|
|
603
603
|
};
|
|
604
|
-
return (w, E) => (C(),
|
|
604
|
+
return (w, E) => (C(), I("td", {
|
|
605
605
|
ref: "cell",
|
|
606
606
|
"data-colindex": w.colIndex,
|
|
607
607
|
"data-rowindex": w.rowIndex,
|
|
@@ -616,16 +616,16 @@ const At = (e) => {
|
|
|
616
616
|
onClick: g,
|
|
617
617
|
class: F(["atable-cell", w.pinned ? "sticky-column" : ""])
|
|
618
618
|
}, [
|
|
619
|
-
b(r).cellComponent ? (C(), _(
|
|
619
|
+
b(r).cellComponent ? (C(), _(We(b(r).cellComponent), de({
|
|
620
620
|
key: 0,
|
|
621
621
|
value: u.value
|
|
622
|
-
}, b(r).cellComponentProps), null, 16, ["value"])) : f.value ? (C(),
|
|
622
|
+
}, b(r).cellComponentProps), null, 16, ["value"])) : f.value ? (C(), I("span", {
|
|
623
623
|
key: 1,
|
|
624
624
|
innerHTML: u.value
|
|
625
|
-
}, null, 8, Tt)) : (C(),
|
|
625
|
+
}, null, 8, Tt)) : (C(), I("span", Mt, Y(u.value), 1))
|
|
626
626
|
], 46, St));
|
|
627
627
|
}
|
|
628
|
-
}),
|
|
628
|
+
}), Rt = ["tabindex"], Ot = ["tabindex"], Lt = ["colspan"], Pt = /* @__PURE__ */ V({
|
|
629
629
|
__name: "AExpansionRow",
|
|
630
630
|
props: {
|
|
631
631
|
rowIndex: {},
|
|
@@ -648,36 +648,36 @@ const At = (e) => {
|
|
|
648
648
|
}
|
|
649
649
|
]);
|
|
650
650
|
}
|
|
651
|
-
return (o, a) => (C(),
|
|
652
|
-
|
|
651
|
+
return (o, a) => (C(), I(te, null, [
|
|
652
|
+
L("tr", de(o.$attrs, {
|
|
653
653
|
ref: "rowEl",
|
|
654
654
|
tabindex: o.tabIndex,
|
|
655
655
|
class: "expandable-row"
|
|
656
656
|
}), [
|
|
657
|
-
|
|
657
|
+
L("td", {
|
|
658
658
|
tabIndex: -1,
|
|
659
659
|
onClick: a[0] || (a[0] = (i) => o.store.toggleRowExpand(o.rowIndex)),
|
|
660
660
|
class: "row-index"
|
|
661
661
|
}, Y(n.value), 1),
|
|
662
|
-
|
|
663
|
-
], 16,
|
|
664
|
-
o.store.display[o.rowIndex].expanded ? (C(),
|
|
662
|
+
M(o.$slots, "row")
|
|
663
|
+
], 16, Rt),
|
|
664
|
+
o.store.display[o.rowIndex].expanded ? (C(), I("tr", {
|
|
665
665
|
key: 0,
|
|
666
666
|
ref: "rowExpanded",
|
|
667
667
|
tabindex: o.tabIndex,
|
|
668
668
|
class: "expanded-row"
|
|
669
669
|
}, [
|
|
670
|
-
|
|
670
|
+
L("td", {
|
|
671
671
|
tabIndex: -1,
|
|
672
672
|
colspan: o.store.columns.length + 1,
|
|
673
673
|
class: "expanded-row-content"
|
|
674
674
|
}, [
|
|
675
|
-
|
|
676
|
-
], 8,
|
|
677
|
-
], 8,
|
|
675
|
+
M(o.$slots, "content")
|
|
676
|
+
], 8, Lt)
|
|
677
|
+
], 8, Ot)) : U("", !0)
|
|
678
678
|
], 64));
|
|
679
679
|
}
|
|
680
|
-
}),
|
|
680
|
+
}), Wt = ["tabindex"], Fe = /* @__PURE__ */ V({
|
|
681
681
|
__name: "ARow",
|
|
682
682
|
props: {
|
|
683
683
|
rowIndex: {},
|
|
@@ -699,47 +699,47 @@ const At = (e) => {
|
|
|
699
699
|
}
|
|
700
700
|
]);
|
|
701
701
|
}
|
|
702
|
-
return (a, i) => se((C(),
|
|
702
|
+
return (a, i) => se((C(), I("tr", {
|
|
703
703
|
ref: "rowEl",
|
|
704
704
|
tabindex: a.tabIndex,
|
|
705
705
|
class: "table-row"
|
|
706
706
|
}, [
|
|
707
|
-
a.store.config.view !== "uncounted" ?
|
|
708
|
-
a.store.config.view === "list" ? (C(),
|
|
707
|
+
a.store.config.view !== "uncounted" ? M(a.$slots, "index", { key: 0 }, () => [
|
|
708
|
+
a.store.config.view === "list" ? (C(), I("td", {
|
|
709
709
|
key: 0,
|
|
710
710
|
tabIndex: -1,
|
|
711
711
|
class: F(["list-index", a.store.hasPinnedColumns ? "sticky-index" : ""])
|
|
712
|
-
}, Y(a.rowIndex + 1), 3)) : a.store.config.view === "tree" ? (C(),
|
|
712
|
+
}, Y(a.rowIndex + 1), 3)) : a.store.config.view === "tree" ? (C(), I("td", {
|
|
713
713
|
key: 1,
|
|
714
714
|
tabIndex: -1,
|
|
715
715
|
class: F(["tree-index", a.store.hasPinnedColumns ? "sticky-index" : ""]),
|
|
716
716
|
onClick: i[0] || (i[0] = (l) => a.store.toggleRowExpand(a.rowIndex))
|
|
717
717
|
}, Y(o.value), 3)) : U("", !0)
|
|
718
718
|
]) : U("", !0),
|
|
719
|
-
|
|
720
|
-
], 8,
|
|
721
|
-
[
|
|
719
|
+
M(a.$slots, "default")
|
|
720
|
+
], 8, Wt)), [
|
|
721
|
+
[De, n.value]
|
|
722
722
|
]);
|
|
723
723
|
}
|
|
724
|
-
}),
|
|
725
|
-
function
|
|
724
|
+
}), Ye = ye ? window : void 0;
|
|
725
|
+
function B(e) {
|
|
726
726
|
var t;
|
|
727
|
-
const n =
|
|
727
|
+
const n = R(e);
|
|
728
728
|
return (t = n == null ? void 0 : n.$el) != null ? t : n;
|
|
729
729
|
}
|
|
730
730
|
function ee(...e) {
|
|
731
731
|
let t, n, o, a;
|
|
732
|
-
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, o, a] = e, t =
|
|
733
|
-
return
|
|
732
|
+
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, o, a] = e, t = Ye) : [t, n, o, a] = e, !t)
|
|
733
|
+
return H;
|
|
734
734
|
Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
|
|
735
735
|
const i = [], l = () => {
|
|
736
736
|
i.forEach((c) => c()), i.length = 0;
|
|
737
|
-
}, r = (c, u, f, m) => (c.addEventListener(u, f, m), () => c.removeEventListener(u, f, m)), d =
|
|
738
|
-
() => [
|
|
737
|
+
}, r = (c, u, f, m) => (c.addEventListener(u, f, m), () => c.removeEventListener(u, f, m)), d = O(
|
|
738
|
+
() => [B(t), R(a)],
|
|
739
739
|
([c, u]) => {
|
|
740
740
|
if (l(), !c)
|
|
741
741
|
return;
|
|
742
|
-
const f =
|
|
742
|
+
const f = Ne(u) ? { ...u } : u;
|
|
743
743
|
i.push(
|
|
744
744
|
...n.flatMap((m) => o.map((g) => r(c, m, g, f)))
|
|
745
745
|
);
|
|
@@ -750,31 +750,31 @@ function ee(...e) {
|
|
|
750
750
|
};
|
|
751
751
|
return Z(s), s;
|
|
752
752
|
}
|
|
753
|
-
let
|
|
754
|
-
function
|
|
755
|
-
const { window: o =
|
|
753
|
+
let Me = !1;
|
|
754
|
+
function Re(e, t, n = {}) {
|
|
755
|
+
const { window: o = Ye, ignore: a = [], capture: i = !0, detectIframe: l = !1 } = n;
|
|
756
756
|
if (!o)
|
|
757
|
-
return
|
|
758
|
-
ie &&
|
|
757
|
+
return H;
|
|
758
|
+
ie && !Me && (Me = !0, Array.from(o.document.body.children).forEach((p) => p.addEventListener("click", H)), o.document.documentElement.addEventListener("click", H));
|
|
759
759
|
let r = !0;
|
|
760
|
-
const d = (p) =>
|
|
760
|
+
const d = (p) => R(a).some((v) => {
|
|
761
761
|
if (typeof v == "string")
|
|
762
762
|
return Array.from(o.document.querySelectorAll(v)).some((w) => w === p.target || p.composedPath().includes(w));
|
|
763
763
|
{
|
|
764
|
-
const w =
|
|
764
|
+
const w = B(v);
|
|
765
765
|
return w && (p.target === w || p.composedPath().includes(w));
|
|
766
766
|
}
|
|
767
767
|
});
|
|
768
768
|
function s(p) {
|
|
769
|
-
const v =
|
|
769
|
+
const v = R(p);
|
|
770
770
|
return v && v.$.subTree.shapeFlag === 16;
|
|
771
771
|
}
|
|
772
772
|
function c(p, v) {
|
|
773
|
-
const w =
|
|
774
|
-
return E == null || !Array.isArray(E) ? !1 : E.some((
|
|
773
|
+
const w = R(p), E = w.$.subTree && w.$.subTree.children;
|
|
774
|
+
return E == null || !Array.isArray(E) ? !1 : E.some((D) => D.el === v.target || v.composedPath().includes(D.el));
|
|
775
775
|
}
|
|
776
776
|
const u = (p) => {
|
|
777
|
-
const v =
|
|
777
|
+
const v = B(e);
|
|
778
778
|
if (p.target != null && !(!(v instanceof Element) && s(e) && c(e, p)) && !(!v || v === p.target || p.composedPath().includes(v))) {
|
|
779
779
|
if (p.detail === 0 && (r = !d(p)), !r) {
|
|
780
780
|
r = !0;
|
|
@@ -791,27 +791,27 @@ function Me(e, t, n = {}) {
|
|
|
791
791
|
}, 0), u(p));
|
|
792
792
|
}, { passive: !0, capture: i }),
|
|
793
793
|
ee(o, "pointerdown", (p) => {
|
|
794
|
-
const v =
|
|
794
|
+
const v = B(e);
|
|
795
795
|
r = !d(p) && !!(v && !p.composedPath().includes(v));
|
|
796
796
|
}, { passive: !0 }),
|
|
797
797
|
l && ee(o, "blur", (p) => {
|
|
798
798
|
setTimeout(() => {
|
|
799
799
|
var v;
|
|
800
|
-
const w =
|
|
800
|
+
const w = B(e);
|
|
801
801
|
((v = o.document.activeElement) == null ? void 0 : v.tagName) === "IFRAME" && !(w != null && w.contains(o.document.activeElement)) && t(p);
|
|
802
802
|
}, 0);
|
|
803
803
|
})
|
|
804
804
|
].filter(Boolean);
|
|
805
805
|
return () => m.forEach((p) => p());
|
|
806
806
|
}
|
|
807
|
-
const
|
|
807
|
+
const Dt = {
|
|
808
808
|
mounted(e, t) {
|
|
809
809
|
const n = !t.modifiers.bubble;
|
|
810
810
|
if (typeof t.value == "function")
|
|
811
|
-
e.__onClickOutside_stop =
|
|
811
|
+
e.__onClickOutside_stop = Re(e, t.value, { capture: n });
|
|
812
812
|
else {
|
|
813
813
|
const [o, a] = t.value;
|
|
814
|
-
e.__onClickOutside_stop =
|
|
814
|
+
e.__onClickOutside_stop = Re(e, o, Object.assign({ capture: n }, a));
|
|
815
815
|
}
|
|
816
816
|
},
|
|
817
817
|
unmounted(e) {
|
|
@@ -821,25 +821,25 @@ const Wt = {
|
|
|
821
821
|
function le(e) {
|
|
822
822
|
return typeof Window < "u" && e instanceof Window ? e.document.documentElement : typeof Document < "u" && e instanceof Document ? e.documentElement : e;
|
|
823
823
|
}
|
|
824
|
-
function
|
|
824
|
+
function Ue(e) {
|
|
825
825
|
const t = window.getComputedStyle(e);
|
|
826
826
|
if (t.overflowX === "scroll" || t.overflowY === "scroll" || t.overflowX === "auto" && e.clientWidth < e.scrollWidth || t.overflowY === "auto" && e.clientHeight < e.scrollHeight)
|
|
827
827
|
return !0;
|
|
828
828
|
{
|
|
829
829
|
const n = e.parentNode;
|
|
830
|
-
return !n || n.tagName === "BODY" ? !1 :
|
|
830
|
+
return !n || n.tagName === "BODY" ? !1 : Ue(n);
|
|
831
831
|
}
|
|
832
832
|
}
|
|
833
|
-
function
|
|
833
|
+
function Ht(e) {
|
|
834
834
|
const t = e || window.event, n = t.target;
|
|
835
|
-
return
|
|
835
|
+
return Ue(n) ? !1 : t.touches.length > 1 ? !0 : (t.preventDefault && t.preventDefault(), !1);
|
|
836
836
|
}
|
|
837
837
|
const re = /* @__PURE__ */ new WeakMap();
|
|
838
|
-
function
|
|
838
|
+
function Nt(e, t = !1) {
|
|
839
839
|
const n = x(t);
|
|
840
840
|
let o = null, a = "";
|
|
841
|
-
|
|
842
|
-
const d = le(
|
|
841
|
+
O(xt(e), (r) => {
|
|
842
|
+
const d = le(R(r));
|
|
843
843
|
if (d) {
|
|
844
844
|
const s = d;
|
|
845
845
|
if (re.get(s) || re.set(s, s.style.overflow), s.style.overflow !== "hidden" && (a = s.style.overflow), s.style.overflow === "hidden")
|
|
@@ -851,17 +851,17 @@ function Ht(e, t = !1) {
|
|
|
851
851
|
immediate: !0
|
|
852
852
|
});
|
|
853
853
|
const i = () => {
|
|
854
|
-
const r = le(
|
|
854
|
+
const r = le(R(e));
|
|
855
855
|
!r || n.value || (ie && (o = ee(
|
|
856
856
|
r,
|
|
857
857
|
"touchmove",
|
|
858
858
|
(d) => {
|
|
859
|
-
|
|
859
|
+
Ht(d);
|
|
860
860
|
},
|
|
861
861
|
{ passive: !1 }
|
|
862
862
|
)), r.style.overflow = "hidden", n.value = !0);
|
|
863
863
|
}, l = () => {
|
|
864
|
-
const r = le(
|
|
864
|
+
const r = le(R(e));
|
|
865
865
|
!r || !n.value || (ie && (o == null || o()), r.style.overflow = a, re.delete(r), n.value = !1);
|
|
866
866
|
};
|
|
867
867
|
return Z(l), k({
|
|
@@ -873,34 +873,34 @@ function Ht(e, t = !1) {
|
|
|
873
873
|
}
|
|
874
874
|
});
|
|
875
875
|
}
|
|
876
|
-
function
|
|
876
|
+
function Vt() {
|
|
877
877
|
let e = !1;
|
|
878
878
|
const t = x(!1);
|
|
879
879
|
return (n, o) => {
|
|
880
880
|
if (t.value = o.value, e)
|
|
881
881
|
return;
|
|
882
882
|
e = !0;
|
|
883
|
-
const a =
|
|
884
|
-
|
|
883
|
+
const a = Nt(n, o.value);
|
|
884
|
+
O(t, (i) => a.value = i);
|
|
885
885
|
};
|
|
886
886
|
}
|
|
887
|
-
|
|
888
|
-
const
|
|
887
|
+
Vt();
|
|
888
|
+
const jt = {
|
|
889
889
|
key: 0,
|
|
890
890
|
id: "resizable"
|
|
891
|
-
},
|
|
891
|
+
}, Bt = {
|
|
892
892
|
class: "atable-header-row",
|
|
893
893
|
tabindex: "-1"
|
|
894
|
-
},
|
|
894
|
+
}, Xe = /* @__PURE__ */ V({
|
|
895
895
|
__name: "ATableHeader",
|
|
896
896
|
props: {
|
|
897
897
|
columns: {},
|
|
898
898
|
store: {}
|
|
899
899
|
},
|
|
900
900
|
setup(e) {
|
|
901
|
-
return (t, n) => t.columns.length ? (C(),
|
|
902
|
-
|
|
903
|
-
t.store.zeroColumn ? (C(),
|
|
901
|
+
return (t, n) => t.columns.length ? (C(), I("thead", jt, [
|
|
902
|
+
L("tr", Bt, [
|
|
903
|
+
t.store.zeroColumn ? (C(), I("th", {
|
|
904
904
|
key: 0,
|
|
905
905
|
id: "header-index",
|
|
906
906
|
class: F([[
|
|
@@ -909,26 +909,26 @@ const Vt = {
|
|
|
909
909
|
t.store.config.view === "list-expansion" ? "list-expansion-index" : ""
|
|
910
910
|
], "list-index"])
|
|
911
911
|
}, null, 2)) : U("", !0),
|
|
912
|
-
(C(!0),
|
|
912
|
+
(C(!0), I(te, null, ae(t.columns, (o, a) => (C(), I("th", {
|
|
913
913
|
key: o.name,
|
|
914
914
|
tabindex: "-1",
|
|
915
915
|
style: z(t.store.getHeaderCellStyle(o)),
|
|
916
916
|
class: F(o.pinned ? "sticky-column" : "")
|
|
917
917
|
}, [
|
|
918
|
-
|
|
919
|
-
|
|
918
|
+
M(t.$slots, "default", {}, () => [
|
|
919
|
+
_e(Y(o.label || String.fromCharCode(a + 97).toUpperCase()), 1)
|
|
920
920
|
])
|
|
921
921
|
], 6))), 128))
|
|
922
922
|
])
|
|
923
923
|
])) : U("", !0);
|
|
924
924
|
}
|
|
925
|
-
}),
|
|
925
|
+
}), qe = /* @__PURE__ */ V({
|
|
926
926
|
__name: "ATableModal",
|
|
927
927
|
props: {
|
|
928
928
|
store: {}
|
|
929
929
|
},
|
|
930
930
|
setup(e) {
|
|
931
|
-
const t = J("amodal"), { width: n, height: o } =
|
|
931
|
+
const t = J("amodal"), { width: n, height: o } = Be(t), { y: a } = At(), i = k(() => {
|
|
932
932
|
if (!(e.store.modal.height && e.store.modal.width && e.store.modal.left && e.store.modal.bottom)) return;
|
|
933
933
|
const r = document.body, d = document.documentElement, s = Math.max(
|
|
934
934
|
r.scrollHeight,
|
|
@@ -944,7 +944,7 @@ const Vt = {
|
|
|
944
944
|
}), l = (r) => {
|
|
945
945
|
r.stopPropagation();
|
|
946
946
|
};
|
|
947
|
-
return (r, d) => (C(),
|
|
947
|
+
return (r, d) => (C(), I("div", {
|
|
948
948
|
class: "amodal",
|
|
949
949
|
ref: "amodal",
|
|
950
950
|
tabindex: "-1",
|
|
@@ -952,61 +952,61 @@ const Vt = {
|
|
|
952
952
|
onInput: l,
|
|
953
953
|
style: z(i.value)
|
|
954
954
|
}, [
|
|
955
|
-
|
|
955
|
+
M(r.$slots, "default")
|
|
956
956
|
], 36));
|
|
957
957
|
}
|
|
958
|
-
}),
|
|
959
|
-
const t = e.id ||
|
|
960
|
-
return
|
|
958
|
+
}), zt = (e) => {
|
|
959
|
+
const t = e.id || $t();
|
|
960
|
+
return et(`table-${t}`, () => {
|
|
961
961
|
const o = () => {
|
|
962
962
|
const h = {};
|
|
963
963
|
for (const [y, A] of i.value.entries())
|
|
964
|
-
for (const [
|
|
965
|
-
h[`${y}:${
|
|
964
|
+
for (const [$, S] of l.value.entries())
|
|
965
|
+
h[`${y}:${$}`] = S[A.name];
|
|
966
966
|
return h;
|
|
967
967
|
}, a = (h) => {
|
|
968
968
|
const y = [Object.assign({}, { rowModified: !1 })];
|
|
969
969
|
if (h && "0:0" in h)
|
|
970
970
|
return h;
|
|
971
971
|
const A = /* @__PURE__ */ new Set();
|
|
972
|
-
for (let
|
|
973
|
-
const
|
|
974
|
-
|
|
972
|
+
for (let $ = l.value.length - 1; $ >= 0; $--) {
|
|
973
|
+
const S = l.value[$];
|
|
974
|
+
S.parent && A.add(S.parent), y[$] = {
|
|
975
975
|
childrenOpen: !1,
|
|
976
976
|
expanded: !1,
|
|
977
|
-
indent:
|
|
978
|
-
isParent: A.has(
|
|
979
|
-
isRoot:
|
|
977
|
+
indent: S.indent || 0,
|
|
978
|
+
isParent: A.has($),
|
|
979
|
+
isRoot: S.parent === null || S.parent === void 0,
|
|
980
980
|
rowModified: !1,
|
|
981
|
-
open:
|
|
982
|
-
parent:
|
|
981
|
+
open: S.parent === null || S.parent === void 0,
|
|
982
|
+
parent: S.parent
|
|
983
983
|
};
|
|
984
984
|
}
|
|
985
985
|
return y;
|
|
986
986
|
}, i = x(e.columns), l = x(e.rows), r = x(e.config || {}), d = x(e.table || o()), s = x(a(e.display)), c = x(e.modal || { visible: !1 }), u = x({}), f = k(() => i.value.some((h) => h.pinned)), m = k(() => `${Math.ceil(l.value.length / 100 + 1)}ch`), g = k(
|
|
987
987
|
() => r.value.view ? ["list", "tree", "list-expansion"].includes(r.value.view) : !1
|
|
988
988
|
), p = (h, y) => d.value[`${h}:${y}`], v = (h, y, A) => {
|
|
989
|
-
const
|
|
990
|
-
d.value[
|
|
989
|
+
const $ = `${h}:${y}`, S = i.value[h];
|
|
990
|
+
d.value[$] !== A && (s.value[y].rowModified = !0), d.value[$] = A, l.value[y][S.name] = A;
|
|
991
991
|
}, w = (h, y, A) => {
|
|
992
|
-
const
|
|
993
|
-
d.value[
|
|
992
|
+
const $ = `${h}:${y}`;
|
|
993
|
+
d.value[$] !== A && (s.value[y].rowModified = !0, u.value[$] = A);
|
|
994
994
|
}, E = (h) => ({
|
|
995
995
|
minWidth: h.width || "40ch",
|
|
996
996
|
textAlign: h.align || "center",
|
|
997
997
|
width: r.value.fullWidth ? "auto" : void 0
|
|
998
|
-
}),
|
|
998
|
+
}), D = (h) => r.value.view !== "tree" || s.value[h].isRoot || s.value[h].open, oe = (h) => r.value.view !== "tree" ? "" : s.value[h].isRoot || s.value[h].isParent ? s.value[h].childrenOpen ? "-" : "+" : "", T = (h) => {
|
|
999
999
|
if (r.value.view === "tree") {
|
|
1000
1000
|
s.value[h].childrenOpen = !s.value[h].childrenOpen;
|
|
1001
1001
|
for (let y = l.value.length - 1; y >= 0; y--)
|
|
1002
|
-
s.value[y].parent === h && (s.value[y].open = !s.value[y].open, s.value[y].childrenOpen &&
|
|
1002
|
+
s.value[y].parent === h && (s.value[y].open = !s.value[y].open, s.value[y].childrenOpen && T(y));
|
|
1003
1003
|
} else r.value.view === "list-expansion" && (s.value[h].expanded = !s.value[h].expanded);
|
|
1004
|
-
},
|
|
1004
|
+
}, Ge = (h, y) => {
|
|
1005
1005
|
const A = p(h, y);
|
|
1006
|
-
return
|
|
1007
|
-
},
|
|
1008
|
-
const
|
|
1009
|
-
return
|
|
1006
|
+
return xe(h, y, A);
|
|
1007
|
+
}, xe = (h, y, A) => {
|
|
1008
|
+
const $ = i.value[h], S = l.value[y], j = $.format;
|
|
1009
|
+
return j ? typeof j == "function" ? j(A, { table: d.value, row: S, column: $ }) : typeof j == "string" ? Function(`"use strict";return (${j})`)()(A, { table: d.value, row: S, column: $ }) : A : A;
|
|
1010
1010
|
};
|
|
1011
1011
|
return {
|
|
1012
1012
|
// state
|
|
@@ -1027,18 +1027,18 @@ const Vt = {
|
|
|
1027
1027
|
h.target instanceof Node && (y = c.value.parent) != null && y.contains(h.target) || c.value.visible && (c.value.visible = !1);
|
|
1028
1028
|
},
|
|
1029
1029
|
getCellData: p,
|
|
1030
|
-
getCellDisplayValue:
|
|
1031
|
-
getFormattedValue:
|
|
1030
|
+
getCellDisplayValue: Ge,
|
|
1031
|
+
getFormattedValue: xe,
|
|
1032
1032
|
getHeaderCellStyle: E,
|
|
1033
1033
|
getIndent: (h, y) => y && h === 0 && y > 0 ? `${y}ch` : "inherit",
|
|
1034
1034
|
getRowExpandSymbol: oe,
|
|
1035
|
-
isRowVisible:
|
|
1035
|
+
isRowVisible: D,
|
|
1036
1036
|
setCellData: v,
|
|
1037
1037
|
setCellText: w,
|
|
1038
|
-
toggleRowExpand:
|
|
1038
|
+
toggleRowExpand: T
|
|
1039
1039
|
};
|
|
1040
1040
|
})();
|
|
1041
|
-
},
|
|
1041
|
+
}, Ft = /* @__PURE__ */ V({
|
|
1042
1042
|
__name: "ATable",
|
|
1043
1043
|
props: {
|
|
1044
1044
|
id: {},
|
|
@@ -1049,7 +1049,7 @@ const Vt = {
|
|
|
1049
1049
|
},
|
|
1050
1050
|
emits: ["update:modelValue", "cellUpdate"],
|
|
1051
1051
|
setup(e, { expose: t, emit: n }) {
|
|
1052
|
-
const o = n, a = J("table"), i = e.modelValue ? e.modelValue : e.rows, l =
|
|
1052
|
+
const o = n, a = J("table"), i = e.modelValue ? e.modelValue : e.rows, l = zt({ columns: e.columns, rows: i, id: e.id, config: e.config });
|
|
1053
1053
|
l.$onAction(({ name: s, store: c, args: u, after: f }) => {
|
|
1054
1054
|
if (s === "setCellData") {
|
|
1055
1055
|
const [m, g, p] = u, v = c.getCellData(m, g);
|
|
@@ -1057,14 +1057,14 @@ const Vt = {
|
|
|
1057
1057
|
o("cellUpdate", m, g, p, v);
|
|
1058
1058
|
});
|
|
1059
1059
|
}
|
|
1060
|
-
}),
|
|
1060
|
+
}), O(
|
|
1061
1061
|
() => l.rows,
|
|
1062
1062
|
(s) => {
|
|
1063
1063
|
o("update:modelValue", s);
|
|
1064
1064
|
},
|
|
1065
1065
|
{ deep: !0 }
|
|
1066
1066
|
), G(() => {
|
|
1067
|
-
e.columns.some((s) => s.pinned) && (d(), l.config.view === "tree" &&
|
|
1067
|
+
e.columns.some((s) => s.pinned) && (d(), l.config.view === "tree" && je(a, d, { childList: !0, subtree: !0 }));
|
|
1068
1068
|
});
|
|
1069
1069
|
const r = (s, c, u, f) => {
|
|
1070
1070
|
o("cellUpdate", s, c, u, f);
|
|
@@ -1086,31 +1086,31 @@ const Vt = {
|
|
|
1086
1086
|
if (s.key === "Escape" && l.modal.visible) {
|
|
1087
1087
|
l.modal.visible = !1;
|
|
1088
1088
|
const c = l.modal.parent;
|
|
1089
|
-
c &&
|
|
1089
|
+
c && Pe().then(() => {
|
|
1090
1090
|
c.focus();
|
|
1091
1091
|
});
|
|
1092
1092
|
}
|
|
1093
|
-
}), t({ store: l }), (s, c) => se((C(),
|
|
1093
|
+
}), t({ store: l }), (s, c) => se((C(), I("table", {
|
|
1094
1094
|
ref: "table",
|
|
1095
1095
|
class: "atable",
|
|
1096
1096
|
style: z({ width: b(l).config.fullWidth ? "100%" : "auto" })
|
|
1097
1097
|
}, [
|
|
1098
|
-
|
|
1099
|
-
|
|
1098
|
+
M(s.$slots, "header", { data: b(l) }, () => [
|
|
1099
|
+
Ee(Xe, {
|
|
1100
1100
|
columns: b(l).columns,
|
|
1101
1101
|
store: b(l)
|
|
1102
1102
|
}, null, 8, ["columns", "store"])
|
|
1103
1103
|
], !0),
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
(C(!0),
|
|
1104
|
+
L("tbody", null, [
|
|
1105
|
+
M(s.$slots, "body", { data: b(l) }, () => [
|
|
1106
|
+
(C(!0), I(te, null, ae(b(l).rows, (u, f) => (C(), _(Fe, {
|
|
1107
1107
|
key: u.id,
|
|
1108
1108
|
row: u,
|
|
1109
1109
|
rowIndex: f,
|
|
1110
1110
|
store: b(l)
|
|
1111
1111
|
}, {
|
|
1112
|
-
default:
|
|
1113
|
-
(C(!0),
|
|
1112
|
+
default: Ce(() => [
|
|
1113
|
+
(C(!0), I(te, null, ae(b(l).columns, (m, g) => (C(), _(ze, {
|
|
1114
1114
|
key: m.name,
|
|
1115
1115
|
store: b(l),
|
|
1116
1116
|
col: m,
|
|
@@ -1131,11 +1131,11 @@ const Vt = {
|
|
|
1131
1131
|
}, 1032, ["row", "rowIndex", "store"]))), 128))
|
|
1132
1132
|
], !0)
|
|
1133
1133
|
]),
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
se(
|
|
1137
|
-
default:
|
|
1138
|
-
(C(), _(
|
|
1134
|
+
M(s.$slots, "footer", { data: b(l) }, void 0, !0),
|
|
1135
|
+
M(s.$slots, "modal", { data: b(l) }, () => [
|
|
1136
|
+
se(Ee(qe, { store: b(l) }, {
|
|
1137
|
+
default: Ce(() => [
|
|
1138
|
+
(C(), _(We(b(l).modal.component), de({
|
|
1139
1139
|
key: `${b(l).modal.rowIndex}:${b(l).modal.colIndex}`,
|
|
1140
1140
|
colIndex: b(l).modal.colIndex,
|
|
1141
1141
|
rowIndex: b(l).modal.rowIndex,
|
|
@@ -1144,30 +1144,50 @@ const Vt = {
|
|
|
1144
1144
|
]),
|
|
1145
1145
|
_: 1
|
|
1146
1146
|
}, 8, ["store"]), [
|
|
1147
|
-
[
|
|
1147
|
+
[De, b(l).modal.visible]
|
|
1148
1148
|
])
|
|
1149
1149
|
], !0)
|
|
1150
1150
|
], 4)), [
|
|
1151
|
-
[b(
|
|
1151
|
+
[b(Dt), b(l).closeModal]
|
|
1152
1152
|
]);
|
|
1153
1153
|
}
|
|
1154
|
-
}),
|
|
1154
|
+
}), be = (e, t) => {
|
|
1155
1155
|
const n = e.__vccOpts || e;
|
|
1156
1156
|
for (const [o, a] of t)
|
|
1157
1157
|
n[o] = a;
|
|
1158
1158
|
return n;
|
|
1159
|
-
}, Yt = /* @__PURE__ */ Ft
|
|
1160
|
-
function
|
|
1161
|
-
|
|
1159
|
+
}, Yt = /* @__PURE__ */ be(Ft, [["__scopeId", "data-v-bd5101d3"]]), Ut = {}, Xt = { class: "aloading" }, qt = { class: "aloading-header" };
|
|
1160
|
+
function Gt(e, t) {
|
|
1161
|
+
return C(), I("div", Xt, [
|
|
1162
|
+
L("h2", qt, [
|
|
1163
|
+
M(e.$slots, "default", {}, void 0, !0)
|
|
1164
|
+
]),
|
|
1165
|
+
t[0] || (t[0] = L("div", { class: "aloading-bar" }, null, -1))
|
|
1166
|
+
]);
|
|
1167
|
+
}
|
|
1168
|
+
const Jt = /* @__PURE__ */ be(Ut, [["render", Gt], ["__scopeId", "data-v-a930a25b"]]), Qt = {}, Zt = { class: "aloading" }, Kt = { class: "aloading-header" };
|
|
1169
|
+
function _t(e, t) {
|
|
1170
|
+
return C(), I("div", Zt, [
|
|
1171
|
+
L("h2", Kt, [
|
|
1172
|
+
M(e.$slots, "default", {}, void 0, !0)
|
|
1173
|
+
]),
|
|
1174
|
+
t[0] || (t[0] = L("div", { class: "aloading-bar" }, null, -1))
|
|
1175
|
+
]);
|
|
1176
|
+
}
|
|
1177
|
+
const en = /* @__PURE__ */ be(Qt, [["render", _t], ["__scopeId", "data-v-e1165876"]]);
|
|
1178
|
+
function sn(e) {
|
|
1179
|
+
e.component("ACell", ze), e.component("AExpansionRow", Pt), e.component("ARow", Fe), e.component("ATable", Yt), e.component("ATableHeader", Xe), e.component("ATableLoading", Jt), e.component("ATableLoadingBar", en), e.component("ATableModal", qe);
|
|
1162
1180
|
}
|
|
1163
1181
|
export {
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1182
|
+
ze as ACell,
|
|
1183
|
+
Pt as AExpansionRow,
|
|
1184
|
+
Fe as ARow,
|
|
1167
1185
|
Yt as ATable,
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1186
|
+
Xe as ATableHeader,
|
|
1187
|
+
Jt as ATableLoading,
|
|
1188
|
+
en as ATableLoadingBar,
|
|
1189
|
+
qe as ATableModal,
|
|
1190
|
+
zt as createTableStore,
|
|
1191
|
+
sn as install
|
|
1172
1192
|
};
|
|
1173
1193
|
//# sourceMappingURL=atable.js.map
|