@stonecrop/atable 0.3.1 → 0.3.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 +42 -21
- package/dist/atable.js +200 -187
- package/dist/atable.js.map +1 -1
- package/dist/atable.umd.cjs +2 -2
- package/dist/atable.umd.cjs.map +1 -1
- package/dist/src/stores/table.d.ts +24 -18
- package/dist/src/stores/table.d.ts.map +1 -1
- package/dist/src/types/index.d.ts +18 -3
- package/dist/src/types/index.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/components/ACell.vue +15 -7
- package/src/components/ATable.vue +2 -5
- package/src/components/ATableModal.vue +34 -11
- package/src/types/index.ts +18 -3
package/dist/atable.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { onMounted as Y, ref as x, watch as
|
|
2
|
-
import { defineStore as
|
|
1
|
+
import { onMounted as Y, ref as x, watch as T, onBeforeUnmount as Ge, computed as S, unref as g, getCurrentScope as Te, onScopeDispose as Me, getCurrentInstance as se, nextTick as Re, toRef as Ye, readonly as Xe, customRef as Je, defineComponent as H, useTemplateRef as X, openBlock as E, createElementBlock as k, normalizeStyle as B, normalizeClass as z, createBlock as K, resolveDynamicComponent as Oe, mergeProps as ae, toDisplayString as F, Fragment as ee, createElementVNode as j, renderSlot as R, createCommentVNode as U, withDirectives as oe, vShow as Le, renderList as le, createTextVNode as Qe, createVNode as ge, withCtx as ye } from "vue";
|
|
2
|
+
import { defineStore as Ze } from "pinia";
|
|
3
3
|
import './assets/index.css';function Pe(e) {
|
|
4
4
|
return Te() ? (Me(e), !0) : !1;
|
|
5
5
|
}
|
|
6
6
|
function ie(e) {
|
|
7
7
|
return typeof e == "function" ? e() : g(e);
|
|
8
8
|
}
|
|
9
|
-
const
|
|
9
|
+
const Ke = typeof window < "u" && typeof document < "u";
|
|
10
10
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
11
|
-
const
|
|
12
|
-
},
|
|
11
|
+
const _e = (e) => e != null, et = Object.prototype.toString, tt = (e) => et.call(e) === "[object Object]", nt = () => {
|
|
12
|
+
}, J = Ke ? window : void 0;
|
|
13
13
|
function q(e) {
|
|
14
14
|
var t;
|
|
15
15
|
const n = ie(e);
|
|
@@ -17,17 +17,17 @@ function q(e) {
|
|
|
17
17
|
}
|
|
18
18
|
function G(...e) {
|
|
19
19
|
let t, n, o, r;
|
|
20
|
-
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, o, r] = e, t =
|
|
21
|
-
return
|
|
20
|
+
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, o, r] = e, t = J) : [t, n, o, r] = e, !t)
|
|
21
|
+
return nt;
|
|
22
22
|
Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
|
|
23
23
|
const a = [], l = () => {
|
|
24
24
|
a.forEach((u) => u()), a.length = 0;
|
|
25
|
-
}, i = (u, f, d, v) => (u.addEventListener(f, d, v), () => u.removeEventListener(f, d, v)), s =
|
|
25
|
+
}, i = (u, f, d, v) => (u.addEventListener(f, d, v), () => u.removeEventListener(f, d, v)), s = T(
|
|
26
26
|
() => [q(t), ie(r)],
|
|
27
27
|
([u, f]) => {
|
|
28
28
|
if (l(), !u)
|
|
29
29
|
return;
|
|
30
|
-
const d =
|
|
30
|
+
const d = tt(f) ? { ...f } : f;
|
|
31
31
|
a.push(
|
|
32
32
|
...n.flatMap((v) => o.map((y) => i(u, v, y, d)))
|
|
33
33
|
);
|
|
@@ -38,25 +38,25 @@ function G(...e) {
|
|
|
38
38
|
};
|
|
39
39
|
return Pe(c), c;
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function ot() {
|
|
42
42
|
const e = x(!1), t = se();
|
|
43
43
|
return t && Y(() => {
|
|
44
44
|
e.value = !0;
|
|
45
45
|
}, t), e;
|
|
46
46
|
}
|
|
47
|
-
function
|
|
48
|
-
const t =
|
|
49
|
-
return
|
|
47
|
+
function lt(e) {
|
|
48
|
+
const t = ot();
|
|
49
|
+
return S(() => (t.value, !!e()));
|
|
50
50
|
}
|
|
51
|
-
function
|
|
52
|
-
const { window: o =
|
|
51
|
+
function rt(e, t, n = {}) {
|
|
52
|
+
const { window: o = J, ...r } = n;
|
|
53
53
|
let a;
|
|
54
|
-
const l =
|
|
54
|
+
const l = lt(() => o && "MutationObserver" in o), i = () => {
|
|
55
55
|
a && (a.disconnect(), a = void 0);
|
|
56
|
-
}, s =
|
|
57
|
-
const d = ie(e), v = (Array.isArray(d) ? d : [d]).map(q).filter(
|
|
56
|
+
}, s = S(() => {
|
|
57
|
+
const d = ie(e), v = (Array.isArray(d) ? d : [d]).map(q).filter(_e);
|
|
58
58
|
return new Set(v);
|
|
59
|
-
}), c =
|
|
59
|
+
}), c = T(
|
|
60
60
|
() => s.value,
|
|
61
61
|
(d) => {
|
|
62
62
|
i(), l.value && d.size && (a = new MutationObserver(t), d.forEach((v) => a.observe(v, r)));
|
|
@@ -71,10 +71,10 @@ function lt(e, t, n = {}) {
|
|
|
71
71
|
takeRecords: u
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function st(e = {}) {
|
|
75
75
|
var t;
|
|
76
76
|
const {
|
|
77
|
-
window: n =
|
|
77
|
+
window: n = J,
|
|
78
78
|
deep: o = !0,
|
|
79
79
|
triggerOnRemoval: r = !1
|
|
80
80
|
} = e, a = (t = e.document) != null ? t : n == null ? void 0 : n.document, l = () => {
|
|
@@ -89,7 +89,7 @@ function rt(e = {}) {
|
|
|
89
89
|
};
|
|
90
90
|
return n && (G(n, "blur", (c) => {
|
|
91
91
|
c.relatedTarget === null && s();
|
|
92
|
-
}, !0), G(n, "focus", s, !0)), r &&
|
|
92
|
+
}, !0), G(n, "focus", s, !0)), r && rt(a, (c) => {
|
|
93
93
|
c.filter((u) => u.removedNodes.length).map((u) => Array.from(u.removedNodes)).flat().forEach((u) => {
|
|
94
94
|
u === i.value && s();
|
|
95
95
|
});
|
|
@@ -98,12 +98,12 @@ function rt(e = {}) {
|
|
|
98
98
|
subtree: !0
|
|
99
99
|
}), s(), i;
|
|
100
100
|
}
|
|
101
|
-
const
|
|
102
|
-
function
|
|
103
|
-
const { window: n =
|
|
104
|
-
return !n || !l.value ? { focused: a } : (G(o,
|
|
101
|
+
const at = "focusin", it = "focusout";
|
|
102
|
+
function ct(e, t = {}) {
|
|
103
|
+
const { window: n = J } = t, o = S(() => q(e)), r = x(!1), a = S(() => r.value), l = st(t);
|
|
104
|
+
return !n || !l.value ? { focused: a } : (G(o, at, () => r.value = !0), G(o, it, () => r.value = !1), { focused: a });
|
|
105
105
|
}
|
|
106
|
-
function
|
|
106
|
+
function ut(e, { window: t = J, scrollTarget: n } = {}) {
|
|
107
107
|
const o = x(!1), r = () => {
|
|
108
108
|
if (!t) return;
|
|
109
109
|
const a = t.document, l = q(e);
|
|
@@ -114,7 +114,7 @@ function ct(e, { window: t = X, scrollTarget: n } = {}) {
|
|
|
114
114
|
o.value = i.top <= (t.innerHeight || a.documentElement.clientHeight) && i.left <= (t.innerWidth || a.documentElement.clientWidth) && i.bottom >= 0 && i.right >= 0;
|
|
115
115
|
}
|
|
116
116
|
};
|
|
117
|
-
return
|
|
117
|
+
return T(
|
|
118
118
|
() => q(e),
|
|
119
119
|
() => r(),
|
|
120
120
|
{ immediate: !0, flush: "post" }
|
|
@@ -124,7 +124,7 @@ function ct(e, { window: t = X, scrollTarget: n } = {}) {
|
|
|
124
124
|
}), o;
|
|
125
125
|
}
|
|
126
126
|
const O = (e) => {
|
|
127
|
-
let t =
|
|
127
|
+
let t = ut(e).value;
|
|
128
128
|
return t = t && e.offsetHeight > 0, t;
|
|
129
129
|
}, L = (e) => e.tabIndex >= 0, be = (e) => {
|
|
130
130
|
const t = e.target;
|
|
@@ -143,7 +143,7 @@ const O = (e) => {
|
|
|
143
143
|
o && (n = o);
|
|
144
144
|
}
|
|
145
145
|
return n && (!L(n) || !O(n)) ? ce(n) : n;
|
|
146
|
-
},
|
|
146
|
+
}, dt = (e) => {
|
|
147
147
|
var t;
|
|
148
148
|
const n = e.target;
|
|
149
149
|
let o;
|
|
@@ -178,7 +178,7 @@ const O = (e) => {
|
|
|
178
178
|
o && (n = o);
|
|
179
179
|
}
|
|
180
180
|
return n && (!L(n) || !O(n)) ? ue(n) : n;
|
|
181
|
-
},
|
|
181
|
+
}, ft = (e) => {
|
|
182
182
|
var t;
|
|
183
183
|
const n = e.target;
|
|
184
184
|
let o;
|
|
@@ -225,10 +225,10 @@ const O = (e) => {
|
|
|
225
225
|
}, Ce = (e) => {
|
|
226
226
|
const t = e.target.parentElement.firstElementChild;
|
|
227
227
|
return t && (!L(t) || !O(t)) ? fe(t) : t;
|
|
228
|
-
},
|
|
228
|
+
}, Ie = (e) => {
|
|
229
229
|
const t = e.target.parentElement.lastElementChild;
|
|
230
230
|
return t && (!L(t) || !O(t)) ? de(t) : t;
|
|
231
|
-
},
|
|
231
|
+
}, Z = ["alt", "control", "shift", "meta"], mt = {
|
|
232
232
|
ArrowUp: "up",
|
|
233
233
|
ArrowDown: "down",
|
|
234
234
|
ArrowLeft: "left",
|
|
@@ -251,11 +251,11 @@ const O = (e) => {
|
|
|
251
251
|
e.preventDefault(), e.stopPropagation(), t && t.focus();
|
|
252
252
|
},
|
|
253
253
|
"keydown.control.up": (e) => {
|
|
254
|
-
const t =
|
|
254
|
+
const t = dt(e);
|
|
255
255
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
256
256
|
},
|
|
257
257
|
"keydown.control.down": (e) => {
|
|
258
|
-
const t =
|
|
258
|
+
const t = ft(e);
|
|
259
259
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
260
260
|
},
|
|
261
261
|
"keydown.control.left": (e) => {
|
|
@@ -263,11 +263,11 @@ const O = (e) => {
|
|
|
263
263
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
264
264
|
},
|
|
265
265
|
"keydown.control.right": (e) => {
|
|
266
|
-
const t =
|
|
266
|
+
const t = Ie(e);
|
|
267
267
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
268
268
|
},
|
|
269
269
|
"keydown.end": (e) => {
|
|
270
|
-
const t =
|
|
270
|
+
const t = Ie(e);
|
|
271
271
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
272
272
|
},
|
|
273
273
|
"keydown.enter": (e) => {
|
|
@@ -322,19 +322,19 @@ function ve(e) {
|
|
|
322
322
|
let s = [];
|
|
323
323
|
return l.selectors ? s = n(l) : i && (s = Array.from(i.children).filter((c) => L(c) && O(c))), s;
|
|
324
324
|
}, r = (l) => (i) => {
|
|
325
|
-
const s =
|
|
326
|
-
if (
|
|
325
|
+
const s = mt[i.key] || i.key.toLowerCase();
|
|
326
|
+
if (Z.includes(s)) return;
|
|
327
327
|
const c = l.handlers || me;
|
|
328
328
|
for (const u of Object.keys(c)) {
|
|
329
329
|
const [f, ...d] = u.split(".");
|
|
330
330
|
if (f === "keydown" && d.includes(s)) {
|
|
331
|
-
const v = c[u], y = d.filter((w) =>
|
|
331
|
+
const v = c[u], y = d.filter((w) => Z.includes(w)), p = Z.some((w) => {
|
|
332
332
|
const m = w.charAt(0).toUpperCase() + w.slice(1);
|
|
333
333
|
return i.getModifierState(m);
|
|
334
334
|
});
|
|
335
335
|
if (y.length > 0) {
|
|
336
336
|
if (p) {
|
|
337
|
-
for (const w of
|
|
337
|
+
for (const w of Z)
|
|
338
338
|
if (d.includes(w)) {
|
|
339
339
|
const m = w.charAt(0).toUpperCase() + w.slice(1);
|
|
340
340
|
i.getModifierState(m) && v(i);
|
|
@@ -349,58 +349,58 @@ function ve(e) {
|
|
|
349
349
|
for (const l of e) {
|
|
350
350
|
const i = t(l), s = o(l), c = r(l), u = i ? [i] : s;
|
|
351
351
|
for (const f of u) {
|
|
352
|
-
const { focused: d } =
|
|
352
|
+
const { focused: d } = ct(x(f)), v = T(d, (y) => {
|
|
353
353
|
y ? f.addEventListener("keydown", c) : f.removeEventListener("keydown", c);
|
|
354
354
|
});
|
|
355
355
|
a.push(v);
|
|
356
356
|
}
|
|
357
357
|
}
|
|
358
|
-
}),
|
|
358
|
+
}), Ge(() => {
|
|
359
359
|
for (const l of a)
|
|
360
360
|
l();
|
|
361
361
|
});
|
|
362
362
|
}
|
|
363
|
-
function
|
|
363
|
+
function Q(e) {
|
|
364
364
|
return Te() ? (Me(e), !0) : !1;
|
|
365
365
|
}
|
|
366
|
-
function
|
|
366
|
+
function M(e) {
|
|
367
367
|
return typeof e == "function" ? e() : g(e);
|
|
368
368
|
}
|
|
369
369
|
const pe = typeof window < "u" && typeof document < "u";
|
|
370
370
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
371
|
-
const
|
|
372
|
-
}, re = /* @__PURE__ */
|
|
373
|
-
function
|
|
371
|
+
const vt = (e) => e != null, pt = Object.prototype.toString, De = (e) => pt.call(e) === "[object Object]", P = () => {
|
|
372
|
+
}, re = /* @__PURE__ */ wt();
|
|
373
|
+
function wt() {
|
|
374
374
|
var e, t;
|
|
375
375
|
return pe && ((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));
|
|
376
376
|
}
|
|
377
|
-
function
|
|
377
|
+
function ht(e) {
|
|
378
378
|
return se();
|
|
379
379
|
}
|
|
380
|
-
function
|
|
380
|
+
function gt(...e) {
|
|
381
381
|
if (e.length !== 1)
|
|
382
|
-
return
|
|
382
|
+
return Ye(...e);
|
|
383
383
|
const t = e[0];
|
|
384
|
-
return typeof t == "function" ?
|
|
384
|
+
return typeof t == "function" ? Xe(Je(() => ({ get: t, set: P }))) : x(t);
|
|
385
385
|
}
|
|
386
|
-
function
|
|
387
|
-
|
|
386
|
+
function yt(e, t = !0, n) {
|
|
387
|
+
ht() ? Y(e, n) : t ? e() : Re(e);
|
|
388
388
|
}
|
|
389
389
|
const we = pe ? window : void 0;
|
|
390
390
|
function D(e) {
|
|
391
391
|
var t;
|
|
392
|
-
const n =
|
|
392
|
+
const n = M(e);
|
|
393
393
|
return (t = n == null ? void 0 : n.$el) != null ? t : n;
|
|
394
394
|
}
|
|
395
|
-
function
|
|
395
|
+
function Ae(...e) {
|
|
396
396
|
let t, n, o, r;
|
|
397
397
|
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, o, r] = e, t = we) : [t, n, o, r] = e, !t)
|
|
398
398
|
return P;
|
|
399
399
|
Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
|
|
400
400
|
const a = [], l = () => {
|
|
401
401
|
a.forEach((u) => u()), a.length = 0;
|
|
402
|
-
}, i = (u, f, d, v) => (u.addEventListener(f, d, v), () => u.removeEventListener(f, d, v)), s =
|
|
403
|
-
() => [D(t),
|
|
402
|
+
}, i = (u, f, d, v) => (u.addEventListener(f, d, v), () => u.removeEventListener(f, d, v)), s = T(
|
|
403
|
+
() => [D(t), M(r)],
|
|
404
404
|
([u, f]) => {
|
|
405
405
|
if (l(), !u)
|
|
406
406
|
return;
|
|
@@ -413,27 +413,27 @@ function Ie(...e) {
|
|
|
413
413
|
), c = () => {
|
|
414
414
|
s(), l();
|
|
415
415
|
};
|
|
416
|
-
return
|
|
416
|
+
return Q(c), c;
|
|
417
417
|
}
|
|
418
|
-
function
|
|
418
|
+
function bt() {
|
|
419
419
|
const e = x(!1), t = se();
|
|
420
420
|
return t && Y(() => {
|
|
421
421
|
e.value = !0;
|
|
422
422
|
}, t), e;
|
|
423
423
|
}
|
|
424
|
-
function
|
|
425
|
-
const t =
|
|
426
|
-
return
|
|
424
|
+
function He(e) {
|
|
425
|
+
const t = bt();
|
|
426
|
+
return S(() => (t.value, !!e()));
|
|
427
427
|
}
|
|
428
|
-
function
|
|
428
|
+
function We(e, t, n = {}) {
|
|
429
429
|
const { window: o = we, ...r } = n;
|
|
430
430
|
let a;
|
|
431
|
-
const l =
|
|
431
|
+
const l = He(() => o && "MutationObserver" in o), i = () => {
|
|
432
432
|
a && (a.disconnect(), a = void 0);
|
|
433
|
-
}, s =
|
|
434
|
-
const d =
|
|
433
|
+
}, s = S(() => {
|
|
434
|
+
const d = M(e), v = (Array.isArray(d) ? d : [d]).map(D).filter(vt);
|
|
435
435
|
return new Set(v);
|
|
436
|
-
}), c =
|
|
436
|
+
}), c = T(
|
|
437
437
|
() => s.value,
|
|
438
438
|
(d) => {
|
|
439
439
|
i(), l.value && d.size && (a = new MutationObserver(t), d.forEach((v) => a.observe(v, r)));
|
|
@@ -442,21 +442,21 @@ function He(e, t, n = {}) {
|
|
|
442
442
|
), u = () => a == null ? void 0 : a.takeRecords(), f = () => {
|
|
443
443
|
c(), i();
|
|
444
444
|
};
|
|
445
|
-
return
|
|
445
|
+
return Q(f), {
|
|
446
446
|
isSupported: l,
|
|
447
447
|
stop: f,
|
|
448
448
|
takeRecords: u
|
|
449
449
|
};
|
|
450
450
|
}
|
|
451
|
-
function
|
|
451
|
+
function xt(e, t, n = {}) {
|
|
452
452
|
const { window: o = we, ...r } = n;
|
|
453
453
|
let a;
|
|
454
|
-
const l =
|
|
454
|
+
const l = He(() => o && "ResizeObserver" in o), i = () => {
|
|
455
455
|
a && (a.disconnect(), a = void 0);
|
|
456
|
-
}, s =
|
|
457
|
-
const f =
|
|
456
|
+
}, s = S(() => {
|
|
457
|
+
const f = M(e);
|
|
458
458
|
return Array.isArray(f) ? f.map((d) => D(d)) : [D(f)];
|
|
459
|
-
}), c =
|
|
459
|
+
}), c = T(
|
|
460
460
|
s,
|
|
461
461
|
(f) => {
|
|
462
462
|
if (i(), l.value && o) {
|
|
@@ -469,12 +469,12 @@ function bt(e, t, n = {}) {
|
|
|
469
469
|
), u = () => {
|
|
470
470
|
i(), c();
|
|
471
471
|
};
|
|
472
|
-
return
|
|
472
|
+
return Q(u), {
|
|
473
473
|
isSupported: l,
|
|
474
474
|
stop: u
|
|
475
475
|
};
|
|
476
476
|
}
|
|
477
|
-
function
|
|
477
|
+
function Ne(e, t = {}) {
|
|
478
478
|
const {
|
|
479
479
|
reset: n = !0,
|
|
480
480
|
windowResize: o = !0,
|
|
@@ -494,9 +494,9 @@ function xt(e, t = {}) {
|
|
|
494
494
|
function w() {
|
|
495
495
|
l === "sync" ? p() : l === "next-frame" && requestAnimationFrame(() => p());
|
|
496
496
|
}
|
|
497
|
-
return
|
|
497
|
+
return xt(e, w), T(() => D(e), (m) => !m && w()), We(e, w, {
|
|
498
498
|
attributeFilter: ["style", "class"]
|
|
499
|
-
}), r &&
|
|
499
|
+
}), r && Ae("scroll", w, { capture: !0, passive: !0 }), o && Ae("resize", w, { passive: !0 }), yt(() => {
|
|
500
500
|
a && w();
|
|
501
501
|
}), {
|
|
502
502
|
height: i,
|
|
@@ -513,7 +513,7 @@ function xt(e, t = {}) {
|
|
|
513
513
|
const Et = (e) => {
|
|
514
514
|
const t = new DOMParser().parseFromString(e, "text/html");
|
|
515
515
|
return Array.from(t.body.childNodes).some((n) => n.nodeType === 1);
|
|
516
|
-
}, kt = ["data-colindex", "data-rowindex", "data-editable", "contenteditable", "tabindex"], Ct = ["innerHTML"],
|
|
516
|
+
}, kt = ["data-colindex", "data-rowindex", "data-editable", "contenteditable", "tabindex"], Ct = ["innerHTML"], It = { key: 2 }, Ve = /* @__PURE__ */ H({
|
|
517
517
|
__name: "ACell",
|
|
518
518
|
props: {
|
|
519
519
|
colIndex: {},
|
|
@@ -524,7 +524,14 @@ const Et = (e) => {
|
|
|
524
524
|
pinned: { type: Boolean }
|
|
525
525
|
},
|
|
526
526
|
setup(e) {
|
|
527
|
-
const t =
|
|
527
|
+
const t = X("cell"), { width: n, height: o } = Ne(t), r = e.store.getCellData(e.colIndex, e.rowIndex), a = x(e.store.getCellDisplayValue(e.colIndex, e.rowIndex)), l = x(""), i = x(!1), s = e.store.columns[e.colIndex], c = e.store.rows[e.rowIndex], u = s.align || "center", f = s.width || "40ch";
|
|
528
|
+
T(
|
|
529
|
+
() => e.store.getCellData(e.colIndex, e.rowIndex),
|
|
530
|
+
(m) => {
|
|
531
|
+
a.value = e.store.getFormattedValue(e.colIndex, e.rowIndex, m);
|
|
532
|
+
}
|
|
533
|
+
);
|
|
534
|
+
const d = S(() => typeof a.value == "string" ? Et(a.value) : !1), v = S(() => {
|
|
528
535
|
var m;
|
|
529
536
|
return {
|
|
530
537
|
textAlign: u,
|
|
@@ -535,7 +542,7 @@ const Et = (e) => {
|
|
|
535
542
|
};
|
|
536
543
|
}), y = () => {
|
|
537
544
|
s.mask, s.modalComponent && e.store.$patch((m) => {
|
|
538
|
-
m.modal.visible = !0, m.modal.colIndex = e.colIndex, m.modal.rowIndex = e.rowIndex, m.modal.parent = t.value, m.modal.top =
|
|
545
|
+
m.modal.visible = !0, m.modal.colIndex = e.colIndex, m.modal.rowIndex = e.rowIndex, m.modal.parent = t.value, m.modal.top = t.value.offsetTop + t.value.offsetHeight, m.modal.left = t.value.offsetLeft, m.modal.width = n.value, m.modal.height = o.value, typeof s.modalComponent == "function" ? m.modal.component = s.modalComponent({ table: m.table, row: c, column: s }) : m.modal.component = s.modalComponent, m.modal.componentProps = s.modalComponentExtraProps;
|
|
539
546
|
});
|
|
540
547
|
};
|
|
541
548
|
if (e.addNavigation) {
|
|
@@ -570,7 +577,7 @@ const Et = (e) => {
|
|
|
570
577
|
contenteditable: g(s).edit,
|
|
571
578
|
tabindex: m.tabIndex,
|
|
572
579
|
spellcheck: !1,
|
|
573
|
-
style:
|
|
580
|
+
style: B(v.value),
|
|
574
581
|
onFocus: p,
|
|
575
582
|
onPaste: w,
|
|
576
583
|
onBlur: w,
|
|
@@ -578,16 +585,16 @@ const Et = (e) => {
|
|
|
578
585
|
onClick: y,
|
|
579
586
|
class: z(["atable-cell", m.pinned ? "sticky-column" : ""])
|
|
580
587
|
}, [
|
|
581
|
-
g(s).cellComponent ? (E(),
|
|
588
|
+
g(s).cellComponent ? (E(), K(Oe(g(s).cellComponent), ae({
|
|
582
589
|
key: 0,
|
|
583
|
-
value:
|
|
590
|
+
value: a.value
|
|
584
591
|
}, g(s).cellComponentProps), null, 16, ["value"])) : d.value ? (E(), k("span", {
|
|
585
592
|
key: 1,
|
|
586
|
-
innerHTML:
|
|
587
|
-
}, null, 8, Ct)) : (E(), k("span",
|
|
593
|
+
innerHTML: a.value
|
|
594
|
+
}, null, 8, Ct)) : (E(), k("span", It, F(a.value), 1))
|
|
588
595
|
], 46, kt));
|
|
589
596
|
}
|
|
590
|
-
}),
|
|
597
|
+
}), At = ["tabindex"], St = ["tabindex"], $t = ["colspan"], Tt = /* @__PURE__ */ H({
|
|
591
598
|
__name: "AExpansionRow",
|
|
592
599
|
props: {
|
|
593
600
|
rowIndex: {},
|
|
@@ -596,7 +603,7 @@ const Et = (e) => {
|
|
|
596
603
|
addNavigation: { type: [Boolean, Object] }
|
|
597
604
|
},
|
|
598
605
|
setup(e) {
|
|
599
|
-
const t =
|
|
606
|
+
const t = X("rowEl"), n = S(() => e.store.display[e.rowIndex].expanded ? "▼" : "►");
|
|
600
607
|
if (e.addNavigation) {
|
|
601
608
|
const o = {
|
|
602
609
|
"keydown.control.g": (r) => {
|
|
@@ -610,26 +617,26 @@ const Et = (e) => {
|
|
|
610
617
|
}
|
|
611
618
|
]);
|
|
612
619
|
}
|
|
613
|
-
return (o, r) => (E(), k(
|
|
614
|
-
|
|
620
|
+
return (o, r) => (E(), k(ee, null, [
|
|
621
|
+
j("tr", ae(o.$attrs, {
|
|
615
622
|
ref: "rowEl",
|
|
616
623
|
tabindex: o.tabIndex,
|
|
617
624
|
class: "expandable-row"
|
|
618
625
|
}), [
|
|
619
|
-
|
|
626
|
+
j("td", {
|
|
620
627
|
tabIndex: -1,
|
|
621
628
|
onClick: r[0] || (r[0] = (a) => o.store.toggleRowExpand(o.rowIndex)),
|
|
622
629
|
class: "row-index"
|
|
623
630
|
}, F(n.value), 1),
|
|
624
631
|
R(o.$slots, "row")
|
|
625
|
-
], 16,
|
|
632
|
+
], 16, At),
|
|
626
633
|
o.store.display[o.rowIndex].expanded ? (E(), k("tr", {
|
|
627
634
|
key: 0,
|
|
628
635
|
ref: "rowExpanded",
|
|
629
636
|
tabindex: o.tabIndex,
|
|
630
637
|
class: "expanded-row"
|
|
631
638
|
}, [
|
|
632
|
-
|
|
639
|
+
j("td", {
|
|
633
640
|
tabIndex: -1,
|
|
634
641
|
colspan: o.store.columns.length + 1,
|
|
635
642
|
class: "expanded-row-content"
|
|
@@ -639,7 +646,7 @@ const Et = (e) => {
|
|
|
639
646
|
], 8, St)) : U("", !0)
|
|
640
647
|
], 64));
|
|
641
648
|
}
|
|
642
|
-
}), Mt = ["tabindex"],
|
|
649
|
+
}), Mt = ["tabindex"], je = /* @__PURE__ */ H({
|
|
643
650
|
__name: "ARow",
|
|
644
651
|
props: {
|
|
645
652
|
rowIndex: {},
|
|
@@ -648,7 +655,7 @@ const Et = (e) => {
|
|
|
648
655
|
addNavigation: { type: [Boolean, Object], default: !1 }
|
|
649
656
|
},
|
|
650
657
|
setup(e) {
|
|
651
|
-
const t =
|
|
658
|
+
const t = X("rowEl"), n = e.store.isRowVisible(e.rowIndex), o = e.store.getRowExpandSymbol(e.rowIndex);
|
|
652
659
|
if (e.addNavigation) {
|
|
653
660
|
let r = me;
|
|
654
661
|
typeof e.addNavigation == "object" && (r = {
|
|
@@ -683,21 +690,21 @@ const Et = (e) => {
|
|
|
683
690
|
[Le, g(n)]
|
|
684
691
|
]);
|
|
685
692
|
}
|
|
686
|
-
}),
|
|
693
|
+
}), Be = pe ? window : void 0;
|
|
687
694
|
function V(e) {
|
|
688
695
|
var t;
|
|
689
|
-
const n =
|
|
696
|
+
const n = M(e);
|
|
690
697
|
return (t = n == null ? void 0 : n.$el) != null ? t : n;
|
|
691
698
|
}
|
|
692
|
-
function
|
|
699
|
+
function _(...e) {
|
|
693
700
|
let t, n, o, r;
|
|
694
|
-
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, o, r] = e, t =
|
|
701
|
+
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, o, r] = e, t = Be) : [t, n, o, r] = e, !t)
|
|
695
702
|
return P;
|
|
696
703
|
Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
|
|
697
704
|
const a = [], l = () => {
|
|
698
705
|
a.forEach((u) => u()), a.length = 0;
|
|
699
|
-
}, i = (u, f, d, v) => (u.addEventListener(f, d, v), () => u.removeEventListener(f, d, v)), s =
|
|
700
|
-
() => [V(t),
|
|
706
|
+
}, i = (u, f, d, v) => (u.addEventListener(f, d, v), () => u.removeEventListener(f, d, v)), s = T(
|
|
707
|
+
() => [V(t), M(r)],
|
|
701
708
|
([u, f]) => {
|
|
702
709
|
if (l(), !u)
|
|
703
710
|
return;
|
|
@@ -710,16 +717,16 @@ function K(...e) {
|
|
|
710
717
|
), c = () => {
|
|
711
718
|
s(), l();
|
|
712
719
|
};
|
|
713
|
-
return
|
|
720
|
+
return Q(c), c;
|
|
714
721
|
}
|
|
715
722
|
let Se = !1;
|
|
716
723
|
function $e(e, t, n = {}) {
|
|
717
|
-
const { window: o =
|
|
724
|
+
const { window: o = Be, ignore: r = [], capture: a = !0, detectIframe: l = !1 } = n;
|
|
718
725
|
if (!o)
|
|
719
726
|
return P;
|
|
720
727
|
re && !Se && (Se = !0, Array.from(o.document.body.children).forEach((p) => p.addEventListener("click", P)), o.document.documentElement.addEventListener("click", P));
|
|
721
728
|
let i = !0;
|
|
722
|
-
const s = (p) =>
|
|
729
|
+
const s = (p) => M(r).some((w) => {
|
|
723
730
|
if (typeof w == "string")
|
|
724
731
|
return Array.from(o.document.querySelectorAll(w)).some((m) => m === p.target || p.composedPath().includes(m));
|
|
725
732
|
{
|
|
@@ -728,12 +735,12 @@ function $e(e, t, n = {}) {
|
|
|
728
735
|
}
|
|
729
736
|
});
|
|
730
737
|
function c(p) {
|
|
731
|
-
const w =
|
|
738
|
+
const w = M(p);
|
|
732
739
|
return w && w.$.subTree.shapeFlag === 16;
|
|
733
740
|
}
|
|
734
741
|
function u(p, w) {
|
|
735
|
-
const m =
|
|
736
|
-
return C == null || !Array.isArray(C) ? !1 : C.some((
|
|
742
|
+
const m = M(p), C = m.$.subTree && m.$.subTree.children;
|
|
743
|
+
return C == null || !Array.isArray(C) ? !1 : C.some((W) => W.el === w.target || w.composedPath().includes(W.el));
|
|
737
744
|
}
|
|
738
745
|
const f = (p) => {
|
|
739
746
|
const w = V(e);
|
|
@@ -747,16 +754,16 @@ function $e(e, t, n = {}) {
|
|
|
747
754
|
};
|
|
748
755
|
let d = !1;
|
|
749
756
|
const v = [
|
|
750
|
-
|
|
757
|
+
_(o, "click", (p) => {
|
|
751
758
|
d || (d = !0, setTimeout(() => {
|
|
752
759
|
d = !1;
|
|
753
760
|
}, 0), f(p));
|
|
754
761
|
}, { passive: !0, capture: a }),
|
|
755
|
-
|
|
762
|
+
_(o, "pointerdown", (p) => {
|
|
756
763
|
const w = V(e);
|
|
757
764
|
i = !s(p) && !!(w && !p.composedPath().includes(w));
|
|
758
765
|
}, { passive: !0 }),
|
|
759
|
-
l &&
|
|
766
|
+
l && _(o, "blur", (p) => {
|
|
760
767
|
setTimeout(() => {
|
|
761
768
|
var w;
|
|
762
769
|
const m = V(e);
|
|
@@ -783,25 +790,25 @@ const Rt = {
|
|
|
783
790
|
function te(e) {
|
|
784
791
|
return typeof Window < "u" && e instanceof Window ? e.document.documentElement : typeof Document < "u" && e instanceof Document ? e.documentElement : e;
|
|
785
792
|
}
|
|
786
|
-
function
|
|
793
|
+
function ze(e) {
|
|
787
794
|
const t = window.getComputedStyle(e);
|
|
788
795
|
if (t.overflowX === "scroll" || t.overflowY === "scroll" || t.overflowX === "auto" && e.clientWidth < e.scrollWidth || t.overflowY === "auto" && e.clientHeight < e.scrollHeight)
|
|
789
796
|
return !0;
|
|
790
797
|
{
|
|
791
798
|
const n = e.parentNode;
|
|
792
|
-
return !n || n.tagName === "BODY" ? !1 :
|
|
799
|
+
return !n || n.tagName === "BODY" ? !1 : ze(n);
|
|
793
800
|
}
|
|
794
801
|
}
|
|
795
802
|
function Ot(e) {
|
|
796
803
|
const t = e || window.event, n = t.target;
|
|
797
|
-
return
|
|
804
|
+
return ze(n) ? !1 : t.touches.length > 1 ? !0 : (t.preventDefault && t.preventDefault(), !1);
|
|
798
805
|
}
|
|
799
806
|
const ne = /* @__PURE__ */ new WeakMap();
|
|
800
807
|
function Lt(e, t = !1) {
|
|
801
808
|
const n = x(t);
|
|
802
809
|
let o = null, r = "";
|
|
803
|
-
|
|
804
|
-
const s = te(
|
|
810
|
+
T(gt(e), (i) => {
|
|
811
|
+
const s = te(M(i));
|
|
805
812
|
if (s) {
|
|
806
813
|
const c = s;
|
|
807
814
|
if (ne.get(c) || ne.set(c, c.style.overflow), c.style.overflow !== "hidden" && (r = c.style.overflow), c.style.overflow === "hidden")
|
|
@@ -813,8 +820,8 @@ function Lt(e, t = !1) {
|
|
|
813
820
|
immediate: !0
|
|
814
821
|
});
|
|
815
822
|
const a = () => {
|
|
816
|
-
const i = te(
|
|
817
|
-
!i || n.value || (re && (o =
|
|
823
|
+
const i = te(M(e));
|
|
824
|
+
!i || n.value || (re && (o = _(
|
|
818
825
|
i,
|
|
819
826
|
"touchmove",
|
|
820
827
|
(s) => {
|
|
@@ -823,10 +830,10 @@ function Lt(e, t = !1) {
|
|
|
823
830
|
{ passive: !1 }
|
|
824
831
|
)), i.style.overflow = "hidden", n.value = !0);
|
|
825
832
|
}, l = () => {
|
|
826
|
-
const i = te(
|
|
833
|
+
const i = te(M(e));
|
|
827
834
|
!i || !n.value || (re && (o == null || o()), i.style.overflow = r, ne.delete(i), n.value = !1);
|
|
828
835
|
};
|
|
829
|
-
return
|
|
836
|
+
return Q(l), S({
|
|
830
837
|
get() {
|
|
831
838
|
return n.value;
|
|
832
839
|
},
|
|
@@ -843,17 +850,17 @@ function Pt() {
|
|
|
843
850
|
return;
|
|
844
851
|
e = !0;
|
|
845
852
|
const r = Lt(n, o.value);
|
|
846
|
-
|
|
853
|
+
T(t, (a) => r.value = a);
|
|
847
854
|
};
|
|
848
855
|
}
|
|
849
856
|
Pt();
|
|
850
857
|
const Dt = {
|
|
851
858
|
key: 0,
|
|
852
859
|
id: "resizable"
|
|
853
|
-
},
|
|
860
|
+
}, Ht = {
|
|
854
861
|
class: "atable-header-row",
|
|
855
862
|
tabindex: "-1"
|
|
856
|
-
},
|
|
863
|
+
}, Fe = /* @__PURE__ */ H({
|
|
857
864
|
__name: "ATableHeader",
|
|
858
865
|
props: {
|
|
859
866
|
columns: {},
|
|
@@ -861,7 +868,7 @@ const Dt = {
|
|
|
861
868
|
},
|
|
862
869
|
setup(e) {
|
|
863
870
|
return (t, n) => t.columns.length ? (E(), k("thead", Dt, [
|
|
864
|
-
|
|
871
|
+
j("tr", Ht, [
|
|
865
872
|
t.store.zeroColumn ? (E(), k("th", {
|
|
866
873
|
key: 0,
|
|
867
874
|
id: "header-index",
|
|
@@ -871,86 +878,96 @@ const Dt = {
|
|
|
871
878
|
t.store.config.view === "list-expansion" ? "list-expansion-index" : ""
|
|
872
879
|
], "list-index"])
|
|
873
880
|
}, null, 2)) : U("", !0),
|
|
874
|
-
(E(!0), k(
|
|
881
|
+
(E(!0), k(ee, null, le(t.columns, (o, r) => (E(), k("th", {
|
|
875
882
|
key: o.name,
|
|
876
883
|
tabindex: "-1",
|
|
877
|
-
style:
|
|
884
|
+
style: B(t.store.getHeaderCellStyle(o)),
|
|
878
885
|
class: z(o.pinned ? "sticky-column" : "")
|
|
879
886
|
}, [
|
|
880
887
|
R(t.$slots, "default", {}, () => [
|
|
881
|
-
|
|
888
|
+
Qe(F(o.label || String.fromCharCode(r + 97).toUpperCase()), 1)
|
|
882
889
|
])
|
|
883
890
|
], 6))), 128))
|
|
884
891
|
])
|
|
885
892
|
])) : U("", !0);
|
|
886
893
|
}
|
|
887
|
-
}),
|
|
894
|
+
}), Ue = /* @__PURE__ */ H({
|
|
888
895
|
__name: "ATableModal",
|
|
889
896
|
props: {
|
|
890
897
|
colIndex: {},
|
|
891
898
|
rowIndex: {},
|
|
892
|
-
store: {}
|
|
899
|
+
store: {},
|
|
900
|
+
container: {}
|
|
893
901
|
},
|
|
894
902
|
setup(e) {
|
|
895
|
-
const t = (n) => {
|
|
896
|
-
|
|
903
|
+
const t = X("amodal"), { width: n, height: o } = Ne(t), r = S(() => {
|
|
904
|
+
var u, f;
|
|
905
|
+
const l = ((u = e.container) == null ? void 0 : u.offsetWidth) || 0, i = ((f = e.container) == null ? void 0 : f.offsetHeight) || 0, s = e.store.modal.left + n.value > l ? e.store.modal.left - (n.value - e.store.modal.width) : e.store.modal.left, c = e.store.modal.top + o.value > i ? e.store.modal.top - o.value - e.store.modal.height : e.store.modal.top;
|
|
906
|
+
return {
|
|
907
|
+
left: `${s}px`,
|
|
908
|
+
top: `${c}px`
|
|
909
|
+
};
|
|
910
|
+
}), a = (l) => {
|
|
911
|
+
l.stopPropagation();
|
|
897
912
|
};
|
|
898
|
-
return (
|
|
913
|
+
return (l, i) => (E(), k("div", {
|
|
899
914
|
class: "amodal",
|
|
915
|
+
ref: "amodal",
|
|
900
916
|
tabindex: "-1",
|
|
901
|
-
onClick:
|
|
902
|
-
onInput:
|
|
917
|
+
onClick: a,
|
|
918
|
+
onInput: a,
|
|
919
|
+
style: B(r.value)
|
|
903
920
|
}, [
|
|
904
|
-
R(
|
|
905
|
-
],
|
|
921
|
+
R(l.$slots, "default")
|
|
922
|
+
], 36));
|
|
906
923
|
}
|
|
907
|
-
}),
|
|
924
|
+
}), Wt = (e) => {
|
|
908
925
|
const t = e.id || crypto.randomUUID();
|
|
909
|
-
return
|
|
926
|
+
return Ze(`table-${t}`, () => {
|
|
910
927
|
const o = () => {
|
|
911
928
|
const h = {};
|
|
912
|
-
for (const [b,
|
|
913
|
-
for (const [
|
|
914
|
-
h[`${b}:${
|
|
929
|
+
for (const [b, I] of a.value.entries())
|
|
930
|
+
for (const [$, A] of l.value.entries())
|
|
931
|
+
h[`${b}:${$}`] = A[I.name];
|
|
915
932
|
return h;
|
|
916
933
|
}, r = (h) => {
|
|
917
934
|
const b = [Object.assign({}, { rowModified: !1 })];
|
|
918
935
|
if (h && "0:0" in h)
|
|
919
936
|
return h;
|
|
920
|
-
const
|
|
921
|
-
for (let
|
|
922
|
-
const
|
|
923
|
-
|
|
937
|
+
const I = /* @__PURE__ */ new Set();
|
|
938
|
+
for (let $ = l.value.length - 1; $ >= 0; $--) {
|
|
939
|
+
const A = l.value[$];
|
|
940
|
+
A.parent && I.add(A.parent), b[$] = {
|
|
924
941
|
childrenOpen: !1,
|
|
925
942
|
expanded: !1,
|
|
926
|
-
indent:
|
|
927
|
-
isParent:
|
|
928
|
-
isRoot:
|
|
943
|
+
indent: A.indent || null,
|
|
944
|
+
isParent: I.has($),
|
|
945
|
+
isRoot: A.parent === null || A.parent === void 0,
|
|
929
946
|
rowModified: !1,
|
|
930
|
-
open:
|
|
931
|
-
parent:
|
|
947
|
+
open: A.parent === null || A.parent === void 0,
|
|
948
|
+
parent: A.parent
|
|
932
949
|
};
|
|
933
950
|
}
|
|
934
951
|
return b;
|
|
935
|
-
}, a = x(e.columns), l = x(e.rows), i = x(e.config || {}), s = x(e.table || o()), c = x(r(e.display)), u = x(e.modal || { visible: !1 }), f =
|
|
936
|
-
const
|
|
937
|
-
s.value[
|
|
952
|
+
}, a = x(e.columns), l = x(e.rows), i = x(e.config || {}), s = x(e.table || o()), c = x(r(e.display)), u = x(e.modal || { visible: !1 }), f = S(() => a.value.some((h) => h.pinned)), d = S(() => `${Math.ceil(l.value.length / 100 + 1)}ch`), v = S(() => ["list", "tree", "list-expansion"].includes(i.value.view)), y = (h, b) => s.value[`${h}:${b}`], p = (h, b, I) => {
|
|
953
|
+
const $ = `${h}:${b}`, A = a.value[h];
|
|
954
|
+
s.value[$] !== I && (c.value[b].rowModified = !0), s.value[$] = I, l.value[b][A.name] = I;
|
|
938
955
|
}, w = (h) => ({
|
|
939
956
|
minWidth: h.width || "40ch",
|
|
940
957
|
textAlign: h.align || "center",
|
|
941
958
|
width: i.value.fullWidth ? "auto" : null
|
|
942
|
-
}), m = (h) => i.value.view !== "tree" || c.value[h].isRoot || c.value[h].open, C = (h) => i.value.view !== "tree" ? "" : c.value[h].isRoot || c.value[h].isParent ? c.value[h].childrenOpen ? "-" : "+" : "",
|
|
959
|
+
}), m = (h) => i.value.view !== "tree" || c.value[h].isRoot || c.value[h].open, C = (h) => i.value.view !== "tree" ? "" : c.value[h].isRoot || c.value[h].isParent ? c.value[h].childrenOpen ? "-" : "+" : "", W = (h) => {
|
|
943
960
|
if (i.value.view === "tree") {
|
|
944
961
|
c.value[h].childrenOpen = !c.value[h].childrenOpen;
|
|
945
962
|
for (let b = l.value.length - 1; b >= 0; b--)
|
|
946
|
-
c.value[b].parent === h && (c.value[b].open = !c.value[b].open, c.value[b].childrenOpen &&
|
|
963
|
+
c.value[b].parent === h && (c.value[b].open = !c.value[b].open, c.value[b].childrenOpen && W(b));
|
|
947
964
|
} else i.value.view === "list-expansion" && (c.value[h].expanded = !c.value[h].expanded);
|
|
948
|
-
},
|
|
949
|
-
const
|
|
950
|
-
return he(h, b,
|
|
951
|
-
}, he = (h, b,
|
|
952
|
-
const
|
|
953
|
-
return N ? typeof N == "function" ? N(
|
|
965
|
+
}, qe = (h, b) => {
|
|
966
|
+
const I = y(h, b);
|
|
967
|
+
return he(h, b, I);
|
|
968
|
+
}, he = (h, b, I) => {
|
|
969
|
+
const $ = a.value[h], A = l.value[b], N = $.format;
|
|
970
|
+
return N ? typeof N == "function" ? N(I, { table: s.value, row: A, column: $ }) : typeof N == "string" ? Function(`"use strict";return (${N})`)()(I, { table: s.value, row: A, column: $ }) : I : I;
|
|
954
971
|
};
|
|
955
972
|
return {
|
|
956
973
|
// state
|
|
@@ -970,17 +987,17 @@ const Dt = {
|
|
|
970
987
|
h.target instanceof Node && (b = u.value.parent) != null && b.contains(h.target) || u.value.visible && (u.value.visible = !1);
|
|
971
988
|
},
|
|
972
989
|
getCellData: y,
|
|
973
|
-
getCellDisplayValue:
|
|
990
|
+
getCellDisplayValue: qe,
|
|
974
991
|
getFormattedValue: he,
|
|
975
992
|
getHeaderCellStyle: w,
|
|
976
993
|
getIndent: (h, b) => b && h === 0 && b > 0 ? `${b}ch` : "inherit",
|
|
977
994
|
getRowExpandSymbol: C,
|
|
978
995
|
isRowVisible: m,
|
|
979
996
|
setCellData: p,
|
|
980
|
-
toggleRowExpand:
|
|
997
|
+
toggleRowExpand: W
|
|
981
998
|
};
|
|
982
999
|
})();
|
|
983
|
-
}, Nt = /* @__PURE__ */
|
|
1000
|
+
}, Nt = /* @__PURE__ */ H({
|
|
984
1001
|
__name: "ATable",
|
|
985
1002
|
props: {
|
|
986
1003
|
id: {},
|
|
@@ -991,20 +1008,20 @@ const Dt = {
|
|
|
991
1008
|
},
|
|
992
1009
|
emits: ["update:modelValue", "cellUpdate"],
|
|
993
1010
|
setup(e, { expose: t, emit: n }) {
|
|
994
|
-
const o = n, r =
|
|
1011
|
+
const o = n, r = X("table"), a = e.modelValue ? e.modelValue : e.rows, l = Wt({ columns: e.columns, rows: a, id: e.id, config: e.config });
|
|
995
1012
|
l.$onAction(({ name: s, store: c, args: u }) => {
|
|
996
1013
|
if (s === "setCellData") {
|
|
997
1014
|
const [f, d, v] = u, y = c.getCellData(f, d);
|
|
998
1015
|
o("cellUpdate", [f, d, v, y]);
|
|
999
1016
|
}
|
|
1000
|
-
}),
|
|
1017
|
+
}), T(
|
|
1001
1018
|
() => l.rows,
|
|
1002
1019
|
(s) => {
|
|
1003
1020
|
o("update:modelValue", s);
|
|
1004
1021
|
},
|
|
1005
1022
|
{ deep: !0 }
|
|
1006
1023
|
), Y(() => {
|
|
1007
|
-
e.columns.some((s) => s.pinned) && (i(), l.config.view === "tree" &&
|
|
1024
|
+
e.columns.some((s) => s.pinned) && (i(), l.config.view === "tree" && We(r, i, { childList: !0, subtree: !0 }));
|
|
1008
1025
|
});
|
|
1009
1026
|
const i = () => {
|
|
1010
1027
|
const s = r.value, c = s.rows[0], u = s.rows[1], f = c ? Array.from(c.cells) : [];
|
|
@@ -1031,24 +1048,24 @@ const Dt = {
|
|
|
1031
1048
|
}), t({ store: l }), (s, c) => oe((E(), k("table", {
|
|
1032
1049
|
ref: "table",
|
|
1033
1050
|
class: "atable",
|
|
1034
|
-
style:
|
|
1051
|
+
style: B({ width: g(l).config.fullWidth ? "100%" : "auto" })
|
|
1035
1052
|
}, [
|
|
1036
1053
|
R(s.$slots, "header", { data: g(l) }, () => [
|
|
1037
|
-
ge(
|
|
1054
|
+
ge(Fe, {
|
|
1038
1055
|
columns: g(l).columns,
|
|
1039
1056
|
store: g(l)
|
|
1040
1057
|
}, null, 8, ["columns", "store"])
|
|
1041
1058
|
], !0),
|
|
1042
|
-
|
|
1059
|
+
j("tbody", null, [
|
|
1043
1060
|
R(s.$slots, "body", { data: g(l) }, () => [
|
|
1044
|
-
(E(!0), k(
|
|
1061
|
+
(E(!0), k(ee, null, le(g(l).rows, (u, f) => (E(), K(je, {
|
|
1045
1062
|
key: u.id,
|
|
1046
1063
|
row: u,
|
|
1047
1064
|
rowIndex: f,
|
|
1048
1065
|
store: g(l)
|
|
1049
1066
|
}, {
|
|
1050
1067
|
default: ye(() => [
|
|
1051
|
-
(E(!0), k(
|
|
1068
|
+
(E(!0), k(ee, null, le(g(l).columns, (d, v) => (E(), K(Ve, {
|
|
1052
1069
|
key: d.name,
|
|
1053
1070
|
store: g(l),
|
|
1054
1071
|
col: d,
|
|
@@ -1057,7 +1074,7 @@ const Dt = {
|
|
|
1057
1074
|
rowIndex: f,
|
|
1058
1075
|
colIndex: v,
|
|
1059
1076
|
component: d.cellComponent,
|
|
1060
|
-
style:
|
|
1077
|
+
style: B({
|
|
1061
1078
|
textAlign: (d == null ? void 0 : d.align) || "center",
|
|
1062
1079
|
minWidth: (d == null ? void 0 : d.width) || "40ch",
|
|
1063
1080
|
width: g(l).config.fullWidth ? "auto" : null
|
|
@@ -1070,18 +1087,14 @@ const Dt = {
|
|
|
1070
1087
|
]),
|
|
1071
1088
|
R(s.$slots, "footer", { data: g(l) }, void 0, !0),
|
|
1072
1089
|
R(s.$slots, "modal", { data: g(l) }, () => [
|
|
1073
|
-
oe(ge(
|
|
1090
|
+
oe(ge(Ue, {
|
|
1074
1091
|
colIndex: g(l).modal.colIndex,
|
|
1075
1092
|
rowIndex: g(l).modal.rowIndex,
|
|
1076
1093
|
store: g(l),
|
|
1077
|
-
|
|
1078
|
-
left: g(l).modal.left + "px",
|
|
1079
|
-
top: g(l).modal.top + "px",
|
|
1080
|
-
maxWidth: g(l).modal.width + "px"
|
|
1081
|
-
})
|
|
1094
|
+
container: g(r)
|
|
1082
1095
|
}, {
|
|
1083
1096
|
default: ye(() => [
|
|
1084
|
-
(E(),
|
|
1097
|
+
(E(), K(Oe(g(l).modal.component), ae({
|
|
1085
1098
|
key: `${g(l).modal.rowIndex}:${g(l).modal.colIndex}`,
|
|
1086
1099
|
colIndex: g(l).modal.colIndex,
|
|
1087
1100
|
rowIndex: g(l).modal.rowIndex,
|
|
@@ -1089,7 +1102,7 @@ const Dt = {
|
|
|
1089
1102
|
}, g(l).modal.componentProps), null, 16, ["colIndex", "rowIndex", "store"]))
|
|
1090
1103
|
]),
|
|
1091
1104
|
_: 1
|
|
1092
|
-
}, 8, ["colIndex", "rowIndex", "store", "
|
|
1105
|
+
}, 8, ["colIndex", "rowIndex", "store", "container"]), [
|
|
1093
1106
|
[Le, g(l).modal.visible]
|
|
1094
1107
|
])
|
|
1095
1108
|
], !0)
|
|
@@ -1102,18 +1115,18 @@ const Dt = {
|
|
|
1102
1115
|
for (const [o, r] of t)
|
|
1103
1116
|
n[o] = r;
|
|
1104
1117
|
return n;
|
|
1105
|
-
}, jt = /* @__PURE__ */ Vt(Nt, [["__scopeId", "data-v-
|
|
1118
|
+
}, jt = /* @__PURE__ */ Vt(Nt, [["__scopeId", "data-v-7a1c014a"]]);
|
|
1106
1119
|
function Gt(e) {
|
|
1107
|
-
e.component("ACell",
|
|
1120
|
+
e.component("ACell", Ve), e.component("AExpansionRow", Tt), e.component("ARow", je), e.component("ATable", jt), e.component("ATableHeader", Fe), e.component("ATableModal", Ue);
|
|
1108
1121
|
}
|
|
1109
1122
|
export {
|
|
1110
|
-
|
|
1123
|
+
Ve as ACell,
|
|
1111
1124
|
Tt as AExpansionRow,
|
|
1112
|
-
|
|
1125
|
+
je as ARow,
|
|
1113
1126
|
jt as ATable,
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1127
|
+
Fe as ATableHeader,
|
|
1128
|
+
Ue as ATableModal,
|
|
1129
|
+
Wt as createTableStore,
|
|
1117
1130
|
Gt as install
|
|
1118
1131
|
};
|
|
1119
1132
|
//# sourceMappingURL=atable.js.map
|