@stonecrop/atable 0.2.21 → 0.2.23
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/atable.js +341 -347
- package/dist/atable.js.map +1 -1
- package/dist/atable.umd.cjs +1 -1
- package/dist/atable.umd.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +5 -5
- package/src/components/ACell.vue +3 -33
- package/src/components/AExpansionRow.vue +1 -24
- package/src/components/ARow.vue +1 -24
- package/src/components/ATable.vue +1 -26
- package/src/components/ATableHeader.vue +1 -30
- package/src/components/ATableModal.vue +1 -15
- package/src/themes/default.css +1 -57
package/dist/atable.js
CHANGED
|
@@ -1,94 +1,94 @@
|
|
|
1
|
-
import { onMounted as
|
|
2
|
-
function
|
|
3
|
-
return we() ? (
|
|
1
|
+
import { onMounted as Te, ref as x, watch as A, onBeforeUnmount as $e, computed as C, unref as d, getCurrentScope as we, onScopeDispose as ve, defineComponent as _, inject as L, openBlock as g, createElementBlock as b, createBlock as j, resolveDynamicComponent as ge, mergeProps as J, toDisplayString as O, Fragment as V, createElementVNode as T, renderSlot as E, createCommentVNode as B, withDirectives as q, vShow as ye, toRef as Re, readonly as Oe, customRef as Le, reactive as S, renderList as G, normalizeStyle as N, createTextVNode as Pe, provide as Me, nextTick as He, createVNode as le, withCtx as re } from "vue";
|
|
2
|
+
function We(t) {
|
|
3
|
+
return we() ? (ve(t), !0) : !1;
|
|
4
4
|
}
|
|
5
|
-
function
|
|
5
|
+
function be(t) {
|
|
6
6
|
return typeof t == "function" ? t() : d(t);
|
|
7
7
|
}
|
|
8
|
-
const
|
|
8
|
+
const je = typeof window < "u" && typeof document < "u";
|
|
9
9
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
10
|
-
const
|
|
10
|
+
const Ne = Object.prototype.toString, Ue = (t) => Ne.call(t) === "[object Object]", Ve = () => {
|
|
11
11
|
};
|
|
12
|
-
function
|
|
12
|
+
function F(t) {
|
|
13
13
|
var e;
|
|
14
|
-
const n =
|
|
14
|
+
const n = be(t);
|
|
15
15
|
return (e = n == null ? void 0 : n.$el) != null ? e : n;
|
|
16
16
|
}
|
|
17
|
-
const
|
|
18
|
-
function
|
|
17
|
+
const Q = je ? window : void 0;
|
|
18
|
+
function Y(...t) {
|
|
19
19
|
let e, n, o, a;
|
|
20
|
-
if (typeof t[0] == "string" || Array.isArray(t[0]) ? ([n, o, a] = t, e =
|
|
21
|
-
return
|
|
20
|
+
if (typeof t[0] == "string" || Array.isArray(t[0]) ? ([n, o, a] = t, e = Q) : [e, n, o, a] = t, !e)
|
|
21
|
+
return Ve;
|
|
22
22
|
Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
|
|
23
|
-
const l = [],
|
|
23
|
+
const l = [], i = () => {
|
|
24
24
|
l.forEach((m) => m()), l.length = 0;
|
|
25
|
-
}, r = (m, f, c, p) => (m.addEventListener(f, c, p), () => m.removeEventListener(f, c, p)),
|
|
26
|
-
() => [
|
|
25
|
+
}, r = (m, f, c, p) => (m.addEventListener(f, c, p), () => m.removeEventListener(f, c, p)), s = A(
|
|
26
|
+
() => [F(e), be(a)],
|
|
27
27
|
([m, f]) => {
|
|
28
|
-
if (
|
|
28
|
+
if (i(), !m)
|
|
29
29
|
return;
|
|
30
|
-
const c =
|
|
30
|
+
const c = Ue(f) ? { ...f } : f;
|
|
31
31
|
l.push(
|
|
32
|
-
...n.flatMap((p) => o.map((
|
|
32
|
+
...n.flatMap((p) => o.map((v) => r(m, p, v, c)))
|
|
33
33
|
);
|
|
34
34
|
},
|
|
35
35
|
{ immediate: !0, flush: "post" }
|
|
36
36
|
), u = () => {
|
|
37
|
-
|
|
37
|
+
s(), i();
|
|
38
38
|
};
|
|
39
|
-
return
|
|
39
|
+
return We(u), u;
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function Be(t = {}) {
|
|
42
42
|
var e;
|
|
43
43
|
const {
|
|
44
|
-
window: n =
|
|
44
|
+
window: n = Q,
|
|
45
45
|
deep: o = !0
|
|
46
46
|
} = t, a = (e = t.document) != null ? e : n == null ? void 0 : n.document, l = () => {
|
|
47
|
-
var
|
|
47
|
+
var s;
|
|
48
48
|
let u = a == null ? void 0 : a.activeElement;
|
|
49
49
|
if (o)
|
|
50
50
|
for (; u != null && u.shadowRoot; )
|
|
51
|
-
u = (
|
|
51
|
+
u = (s = u == null ? void 0 : u.shadowRoot) == null ? void 0 : s.activeElement;
|
|
52
52
|
return u;
|
|
53
|
-
},
|
|
54
|
-
|
|
53
|
+
}, i = x(), r = () => {
|
|
54
|
+
i.value = l();
|
|
55
55
|
};
|
|
56
|
-
return n && (
|
|
57
|
-
|
|
58
|
-
}, !0),
|
|
56
|
+
return n && (Y(n, "blur", (s) => {
|
|
57
|
+
s.relatedTarget === null && r();
|
|
58
|
+
}, !0), Y(n, "focus", r, !0)), r(), i;
|
|
59
59
|
}
|
|
60
|
-
function
|
|
61
|
-
const n =
|
|
62
|
-
return { focused:
|
|
60
|
+
function Fe(t, e = {}) {
|
|
61
|
+
const n = Be(e), o = C(() => F(t));
|
|
62
|
+
return { focused: C(() => o.value && n.value ? o.value.contains(n.value) : !1) };
|
|
63
63
|
}
|
|
64
|
-
function
|
|
64
|
+
function ze(t, { window: e = Q, scrollTarget: n } = {}) {
|
|
65
65
|
const o = x(!1), a = () => {
|
|
66
66
|
if (!e)
|
|
67
67
|
return;
|
|
68
|
-
const l = e.document,
|
|
69
|
-
if (!
|
|
68
|
+
const l = e.document, i = F(t);
|
|
69
|
+
if (!i)
|
|
70
70
|
o.value = !1;
|
|
71
71
|
else {
|
|
72
|
-
const r =
|
|
72
|
+
const r = i.getBoundingClientRect();
|
|
73
73
|
o.value = r.top <= (e.innerHeight || l.documentElement.clientHeight) && r.left <= (e.innerWidth || l.documentElement.clientWidth) && r.bottom >= 0 && r.right >= 0;
|
|
74
74
|
}
|
|
75
75
|
};
|
|
76
|
-
return
|
|
77
|
-
() =>
|
|
76
|
+
return A(
|
|
77
|
+
() => F(t),
|
|
78
78
|
() => a(),
|
|
79
79
|
{ immediate: !0, flush: "post" }
|
|
80
|
-
), e &&
|
|
80
|
+
), e && Y(n || e, "scroll", a, {
|
|
81
81
|
capture: !1,
|
|
82
82
|
passive: !0
|
|
83
83
|
}), o;
|
|
84
84
|
}
|
|
85
85
|
const I = (t) => {
|
|
86
|
-
let e =
|
|
86
|
+
let e = ze(t).value;
|
|
87
87
|
return e = e && t.offsetHeight > 0, e;
|
|
88
88
|
}, k = (t) => t.tabIndex >= 0, ae = (t) => {
|
|
89
89
|
const e = t.target;
|
|
90
|
-
return
|
|
91
|
-
},
|
|
90
|
+
return Z(e);
|
|
91
|
+
}, Z = (t) => {
|
|
92
92
|
var e;
|
|
93
93
|
let n;
|
|
94
94
|
if (t instanceof HTMLTableCellElement) {
|
|
@@ -101,8 +101,8 @@ const I = (t) => {
|
|
|
101
101
|
const o = t.previousElementSibling;
|
|
102
102
|
o && (n = o);
|
|
103
103
|
}
|
|
104
|
-
return n && (!k(n) || !I(n)) ?
|
|
105
|
-
},
|
|
104
|
+
return n && (!k(n) || !I(n)) ? Z(n) : n;
|
|
105
|
+
}, qe = (t) => {
|
|
106
106
|
var e;
|
|
107
107
|
const n = t.target;
|
|
108
108
|
let o;
|
|
@@ -119,11 +119,11 @@ const I = (t) => {
|
|
|
119
119
|
l && (o = l);
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
|
-
return o && (!k(o) || !I(o)) ?
|
|
122
|
+
return o && (!k(o) || !I(o)) ? K(o) : o;
|
|
123
123
|
}, ie = (t) => {
|
|
124
124
|
const e = t.target;
|
|
125
|
-
return
|
|
126
|
-
},
|
|
125
|
+
return K(e);
|
|
126
|
+
}, K = (t) => {
|
|
127
127
|
var e;
|
|
128
128
|
let n;
|
|
129
129
|
if (t instanceof HTMLTableCellElement) {
|
|
@@ -136,8 +136,8 @@ const I = (t) => {
|
|
|
136
136
|
const o = t.nextElementSibling;
|
|
137
137
|
o && (n = o);
|
|
138
138
|
}
|
|
139
|
-
return n && (!k(n) || !I(n)) ?
|
|
140
|
-
},
|
|
139
|
+
return n && (!k(n) || !I(n)) ? K(n) : n;
|
|
140
|
+
}, Ge = (t) => {
|
|
141
141
|
var e;
|
|
142
142
|
const n = t.target;
|
|
143
143
|
let o;
|
|
@@ -154,11 +154,11 @@ const I = (t) => {
|
|
|
154
154
|
l && (o = l);
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
|
-
return o && (!k(o) || !I(o)) ?
|
|
158
|
-
},
|
|
157
|
+
return o && (!k(o) || !I(o)) ? Z(o) : o;
|
|
158
|
+
}, se = (t) => {
|
|
159
159
|
const e = t.target;
|
|
160
|
-
return
|
|
161
|
-
},
|
|
160
|
+
return ee(e);
|
|
161
|
+
}, ee = (t) => {
|
|
162
162
|
var e;
|
|
163
163
|
let n;
|
|
164
164
|
if (t.previousElementSibling)
|
|
@@ -167,11 +167,11 @@ const I = (t) => {
|
|
|
167
167
|
const o = (e = t.parentElement) == null ? void 0 : e.previousElementSibling;
|
|
168
168
|
n = o == null ? void 0 : o.lastElementChild;
|
|
169
169
|
}
|
|
170
|
-
return n && (!k(n) || !I(n)) ?
|
|
171
|
-
},
|
|
170
|
+
return n && (!k(n) || !I(n)) ? ee(n) : n;
|
|
171
|
+
}, de = (t) => {
|
|
172
172
|
const e = t.target;
|
|
173
|
-
return
|
|
174
|
-
},
|
|
173
|
+
return te(e);
|
|
174
|
+
}, te = (t) => {
|
|
175
175
|
var e;
|
|
176
176
|
let n;
|
|
177
177
|
if (t.nextElementSibling)
|
|
@@ -180,19 +180,19 @@ const I = (t) => {
|
|
|
180
180
|
const o = (e = t.parentElement) == null ? void 0 : e.nextElementSibling;
|
|
181
181
|
n = o == null ? void 0 : o.firstElementChild;
|
|
182
182
|
}
|
|
183
|
-
return n && (!k(n) || !I(n)) ?
|
|
184
|
-
},
|
|
183
|
+
return n && (!k(n) || !I(n)) ? te(n) : n;
|
|
184
|
+
}, ce = (t) => {
|
|
185
185
|
const e = t.target.parentElement.firstElementChild;
|
|
186
|
-
return e && (!k(e) || !I(e)) ? ne(e) : e;
|
|
187
|
-
}, fe = (t) => {
|
|
188
|
-
const e = t.target.parentElement.lastElementChild;
|
|
189
186
|
return e && (!k(e) || !I(e)) ? te(e) : e;
|
|
190
|
-
},
|
|
187
|
+
}, ue = (t) => {
|
|
188
|
+
const e = t.target.parentElement.lastElementChild;
|
|
189
|
+
return e && (!k(e) || !I(e)) ? ee(e) : e;
|
|
190
|
+
}, M = ["alt", "control", "shift", "meta"], Ye = {
|
|
191
191
|
ArrowUp: "up",
|
|
192
192
|
ArrowDown: "down",
|
|
193
193
|
ArrowLeft: "left",
|
|
194
194
|
ArrowRight: "right"
|
|
195
|
-
},
|
|
195
|
+
}, ne = {
|
|
196
196
|
"keydown.up": (t) => {
|
|
197
197
|
const e = ae(t);
|
|
198
198
|
e && (t.preventDefault(), t.stopPropagation(), e.focus());
|
|
@@ -202,31 +202,31 @@ const I = (t) => {
|
|
|
202
202
|
e && (t.preventDefault(), t.stopPropagation(), e.focus());
|
|
203
203
|
},
|
|
204
204
|
"keydown.left": (t) => {
|
|
205
|
-
const e =
|
|
205
|
+
const e = se(t);
|
|
206
206
|
t.preventDefault(), t.stopPropagation(), e && e.focus();
|
|
207
207
|
},
|
|
208
208
|
"keydown.right": (t) => {
|
|
209
|
-
const e =
|
|
209
|
+
const e = de(t);
|
|
210
210
|
t.preventDefault(), t.stopPropagation(), e && e.focus();
|
|
211
211
|
},
|
|
212
212
|
"keydown.control.up": (t) => {
|
|
213
|
-
const e =
|
|
213
|
+
const e = qe(t);
|
|
214
214
|
e && (t.preventDefault(), t.stopPropagation(), e.focus());
|
|
215
215
|
},
|
|
216
216
|
"keydown.control.down": (t) => {
|
|
217
|
-
const e =
|
|
217
|
+
const e = Ge(t);
|
|
218
218
|
e && (t.preventDefault(), t.stopPropagation(), e.focus());
|
|
219
219
|
},
|
|
220
220
|
"keydown.control.left": (t) => {
|
|
221
|
-
const e =
|
|
221
|
+
const e = ce(t);
|
|
222
222
|
e && (t.preventDefault(), t.stopPropagation(), e.focus());
|
|
223
223
|
},
|
|
224
224
|
"keydown.control.right": (t) => {
|
|
225
|
-
const e =
|
|
225
|
+
const e = ue(t);
|
|
226
226
|
e && (t.preventDefault(), t.stopPropagation(), e.focus());
|
|
227
227
|
},
|
|
228
228
|
"keydown.end": (t) => {
|
|
229
|
-
const e =
|
|
229
|
+
const e = ue(t);
|
|
230
230
|
e && (t.preventDefault(), t.stopPropagation(), e.focus());
|
|
231
231
|
},
|
|
232
232
|
"keydown.enter": (t) => {
|
|
@@ -244,83 +244,83 @@ const I = (t) => {
|
|
|
244
244
|
}
|
|
245
245
|
},
|
|
246
246
|
"keydown.home": (t) => {
|
|
247
|
-
const e =
|
|
247
|
+
const e = ce(t);
|
|
248
248
|
e && (t.preventDefault(), t.stopPropagation(), e.focus());
|
|
249
249
|
},
|
|
250
250
|
"keydown.tab": (t) => {
|
|
251
|
-
const e =
|
|
251
|
+
const e = de(t);
|
|
252
252
|
e && (t.preventDefault(), t.stopPropagation(), e.focus());
|
|
253
253
|
},
|
|
254
254
|
"keydown.shift.tab": (t) => {
|
|
255
|
-
const e =
|
|
255
|
+
const e = se(t);
|
|
256
256
|
e && (t.preventDefault(), t.stopPropagation(), e.focus());
|
|
257
257
|
}
|
|
258
258
|
};
|
|
259
|
-
function
|
|
260
|
-
const e = (
|
|
259
|
+
function oe(t) {
|
|
260
|
+
const e = (i) => {
|
|
261
261
|
let r = null;
|
|
262
|
-
return
|
|
263
|
-
}, n = (
|
|
264
|
-
const r = e(
|
|
265
|
-
let
|
|
266
|
-
if (typeof
|
|
267
|
-
|
|
268
|
-
else if (Array.isArray(
|
|
269
|
-
for (const u of
|
|
270
|
-
u instanceof HTMLElement ?
|
|
271
|
-
else if (
|
|
272
|
-
|
|
273
|
-
else if (Array.isArray(
|
|
274
|
-
for (const u of
|
|
275
|
-
u instanceof HTMLElement ?
|
|
262
|
+
return i.parent && (typeof i.parent == "string" ? r = document.querySelector(i.parent) : i.parent instanceof HTMLElement ? r = i.parent : r = i.parent.value), r;
|
|
263
|
+
}, n = (i) => {
|
|
264
|
+
const r = e(i);
|
|
265
|
+
let s = [];
|
|
266
|
+
if (typeof i.selectors == "string")
|
|
267
|
+
s = r ? Array.from(r.querySelectorAll(i.selectors)) : Array.from(document.querySelectorAll(i.selectors));
|
|
268
|
+
else if (Array.isArray(i.selectors))
|
|
269
|
+
for (const u of i.selectors)
|
|
270
|
+
u instanceof HTMLElement ? s.push(u) : s.push(u.$el);
|
|
271
|
+
else if (i.selectors instanceof HTMLElement)
|
|
272
|
+
s.push(i.selectors);
|
|
273
|
+
else if (Array.isArray(i.selectors.value))
|
|
274
|
+
for (const u of i.selectors.value)
|
|
275
|
+
u instanceof HTMLElement ? s.push(u) : s.push(u.$el);
|
|
276
276
|
else
|
|
277
|
-
|
|
278
|
-
return
|
|
279
|
-
}, o = (
|
|
280
|
-
const r = e(
|
|
281
|
-
let
|
|
282
|
-
return
|
|
283
|
-
}, a = (
|
|
284
|
-
const
|
|
285
|
-
if (
|
|
277
|
+
s.push(i.selectors.value);
|
|
278
|
+
return s;
|
|
279
|
+
}, o = (i) => {
|
|
280
|
+
const r = e(i);
|
|
281
|
+
let s = [];
|
|
282
|
+
return i.selectors ? s = n(i) : r && (s = Array.from(r.children).filter((u) => k(u) && I(u))), s;
|
|
283
|
+
}, a = (i) => (r) => {
|
|
284
|
+
const s = Ye[r.key] || r.key.toLowerCase();
|
|
285
|
+
if (M.includes(s))
|
|
286
286
|
return;
|
|
287
|
-
const u =
|
|
287
|
+
const u = i.handlers || ne;
|
|
288
288
|
for (const m of Object.keys(u)) {
|
|
289
289
|
const [f, ...c] = m.split(".");
|
|
290
|
-
if (f === "keydown" && c.includes(
|
|
291
|
-
const p = u[m],
|
|
292
|
-
const
|
|
293
|
-
return r.getModifierState(
|
|
290
|
+
if (f === "keydown" && c.includes(s)) {
|
|
291
|
+
const p = u[m], v = c.filter((w) => M.includes(w)), h = M.some((w) => {
|
|
292
|
+
const P = w.charAt(0).toUpperCase() + w.slice(1);
|
|
293
|
+
return r.getModifierState(P);
|
|
294
294
|
});
|
|
295
|
-
if (
|
|
296
|
-
if (
|
|
297
|
-
for (const
|
|
298
|
-
if (c.includes(
|
|
299
|
-
const
|
|
300
|
-
r.getModifierState(
|
|
295
|
+
if (v.length > 0) {
|
|
296
|
+
if (h) {
|
|
297
|
+
for (const w of M)
|
|
298
|
+
if (c.includes(w)) {
|
|
299
|
+
const P = w.charAt(0).toUpperCase() + w.slice(1);
|
|
300
|
+
r.getModifierState(P) && p(r);
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
303
|
} else
|
|
304
|
-
|
|
304
|
+
h || p(r);
|
|
305
305
|
}
|
|
306
306
|
}
|
|
307
307
|
}, l = [];
|
|
308
|
-
|
|
309
|
-
for (const
|
|
310
|
-
const r = e(
|
|
308
|
+
Te(() => {
|
|
309
|
+
for (const i of t) {
|
|
310
|
+
const r = e(i), s = o(i), u = a(i), m = r ? [r] : s;
|
|
311
311
|
for (const f of m) {
|
|
312
|
-
const { focused: c } =
|
|
313
|
-
|
|
312
|
+
const { focused: c } = Fe(x(f)), p = A(c, (v) => {
|
|
313
|
+
v ? f.addEventListener("keydown", u) : f.removeEventListener("keydown", u);
|
|
314
314
|
});
|
|
315
315
|
l.push(p);
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
|
-
}),
|
|
319
|
-
for (const
|
|
320
|
-
|
|
318
|
+
}), $e(() => {
|
|
319
|
+
for (const i of l)
|
|
320
|
+
i();
|
|
321
321
|
});
|
|
322
322
|
}
|
|
323
|
-
const
|
|
323
|
+
const Xe = ["data-colindex", "data-rowindex", "data-editable", "contenteditable", "tabindex"], Je = { key: 1 }, xe = /* @__PURE__ */ _({
|
|
324
324
|
__name: "ACell",
|
|
325
325
|
props: {
|
|
326
326
|
colIndex: {},
|
|
@@ -330,58 +330,58 @@ const Qe = ["data-colindex", "data-rowindex", "data-editable", "contenteditable"
|
|
|
330
330
|
tabIndex: { default: 0 }
|
|
331
331
|
},
|
|
332
332
|
setup(t) {
|
|
333
|
-
var
|
|
334
|
-
const e = t, n =
|
|
335
|
-
const
|
|
333
|
+
var v;
|
|
334
|
+
const e = t, n = L(e.tableid), o = x(null), a = x(""), l = x(!1), i = C(() => {
|
|
335
|
+
const h = n.cellData(e.colIndex, e.rowIndex);
|
|
336
336
|
if (n.columns[e.colIndex].format) {
|
|
337
|
-
const
|
|
338
|
-
return typeof
|
|
337
|
+
const w = n.columns[e.colIndex].format;
|
|
338
|
+
return typeof w == "function" ? w(h) : typeof w == "string" ? Function(`"use strict";return (${w})`)()(h) : h;
|
|
339
339
|
} else
|
|
340
|
-
return
|
|
341
|
-
}), r = (
|
|
340
|
+
return h;
|
|
341
|
+
}), r = (h) => {
|
|
342
342
|
if (n.columns[e.colIndex].mask, n.columns[e.colIndex].modalComponent) {
|
|
343
|
-
const
|
|
344
|
-
n.modal.visible = !0, n.modal.colIndex = e.colIndex, n.modal.rowIndex = e.rowIndex, n.modal.parent = o.value, n.modal.top =
|
|
343
|
+
const w = o.value.getBoundingClientRect();
|
|
344
|
+
n.modal.visible = !0, n.modal.colIndex = e.colIndex, n.modal.rowIndex = e.rowIndex, n.modal.parent = o.value, n.modal.top = w.top + w.height, n.modal.left = w.left, n.modal.width = u.value, n.modal.component = n.columns[e.colIndex].modalComponent, n.modal.componentProps = n.columns[e.colIndex].modalComponentProps;
|
|
345
345
|
}
|
|
346
346
|
};
|
|
347
347
|
if (e.addNavigation) {
|
|
348
|
-
let
|
|
349
|
-
...
|
|
348
|
+
let h = {
|
|
349
|
+
...ne,
|
|
350
350
|
"keydown.f2": r,
|
|
351
351
|
"keydown.alt.up": r,
|
|
352
352
|
"keydown.alt.down": r,
|
|
353
353
|
"keydown.alt.left": r,
|
|
354
354
|
"keydown.alt.right": r
|
|
355
355
|
};
|
|
356
|
-
typeof e.addNavigation == "object" && (
|
|
357
|
-
...
|
|
356
|
+
typeof e.addNavigation == "object" && (h = {
|
|
357
|
+
...h,
|
|
358
358
|
...e.addNavigation
|
|
359
|
-
}),
|
|
359
|
+
}), oe([
|
|
360
360
|
{
|
|
361
361
|
selectors: o,
|
|
362
|
-
handlers:
|
|
362
|
+
handlers: h
|
|
363
363
|
}
|
|
364
364
|
]);
|
|
365
365
|
}
|
|
366
|
-
const
|
|
366
|
+
const s = C(() => n.columns[e.colIndex].align || "center"), u = C(() => n.columns[e.colIndex].width || "40ch"), m = () => {
|
|
367
367
|
o.value && (a.value = o.value.textContent);
|
|
368
368
|
}, f = () => {
|
|
369
369
|
o.value && o.value.textContent !== a.value && (a.value = o.value.textContent, o.value.dispatchEvent(new Event("change")), l.value = !0, n.columns[e.colIndex].format || n.setCellData(e.rowIndex, e.colIndex, a.value));
|
|
370
|
-
}, c = (
|
|
371
|
-
textAlign:
|
|
370
|
+
}, c = (h, w) => w && h === 0 && w > 0 ? `${w}ch` : "inherit", p = {
|
|
371
|
+
textAlign: s.value,
|
|
372
372
|
width: u.value,
|
|
373
373
|
backgroundColor: l.value ? "var(--cell-modified-color)" : "inherit",
|
|
374
374
|
fontWeight: l.value ? "bold" : "inherit",
|
|
375
|
-
paddingLeft: c(e.colIndex, (
|
|
375
|
+
paddingLeft: c(e.colIndex, (v = n.display[e.rowIndex]) == null ? void 0 : v.indent)
|
|
376
376
|
};
|
|
377
|
-
return (
|
|
377
|
+
return (h, w) => (g(), b("td", {
|
|
378
378
|
ref_key: "cell",
|
|
379
379
|
ref: o,
|
|
380
|
-
"data-colindex":
|
|
381
|
-
"data-rowindex":
|
|
382
|
-
"data-editable": d(n).columns[
|
|
383
|
-
contenteditable: d(n).columns[
|
|
384
|
-
tabindex:
|
|
380
|
+
"data-colindex": h.colIndex,
|
|
381
|
+
"data-rowindex": h.rowIndex,
|
|
382
|
+
"data-editable": d(n).columns[h.colIndex].edit,
|
|
383
|
+
contenteditable: d(n).columns[h.colIndex].edit,
|
|
384
|
+
tabindex: h.tabIndex,
|
|
385
385
|
spellcheck: !1,
|
|
386
386
|
style: p,
|
|
387
387
|
onFocus: m,
|
|
@@ -389,20 +389,16 @@ const Qe = ["data-colindex", "data-rowindex", "data-editable", "contenteditable"
|
|
|
389
389
|
onBlur: f,
|
|
390
390
|
onInput: f,
|
|
391
391
|
onClick: r,
|
|
392
|
-
onMousedown: r
|
|
392
|
+
onMousedown: r,
|
|
393
|
+
class: "atable__cell"
|
|
393
394
|
}, [
|
|
394
|
-
d(n).columns[
|
|
395
|
+
d(n).columns[h.colIndex].cellComponent ? (g(), j(ge(d(n).columns[h.colIndex].cellComponent), J({
|
|
395
396
|
key: 0,
|
|
396
|
-
value:
|
|
397
|
-
}, d(n).columns[
|
|
398
|
-
], 40,
|
|
397
|
+
value: i.value
|
|
398
|
+
}, d(n).columns[h.colIndex].cellComponentProps), null, 16, ["value"])) : (g(), b("span", Je, O(i.value), 1))
|
|
399
|
+
], 40, Xe));
|
|
399
400
|
}
|
|
400
|
-
}),
|
|
401
|
-
const n = t.__vccOpts || t;
|
|
402
|
-
for (const [o, a] of e)
|
|
403
|
-
n[o] = a;
|
|
404
|
-
return n;
|
|
405
|
-
}, Ie = /* @__PURE__ */ S(Ke, [["__scopeId", "data-v-f3597719"]]), et = ["tabindex"], tt = ["tabindex"], nt = ["colspan"], ot = /* @__PURE__ */ A({
|
|
401
|
+
}), Qe = ["tabindex"], Ze = ["tabindex"], Ke = ["colspan"], et = /* @__PURE__ */ _({
|
|
406
402
|
__name: "AExpansionRow",
|
|
407
403
|
props: {
|
|
408
404
|
row: {},
|
|
@@ -412,56 +408,56 @@ const Qe = ["data-colindex", "data-rowindex", "data-editable", "contenteditable"
|
|
|
412
408
|
addNavigation: { type: [Boolean, Object] }
|
|
413
409
|
},
|
|
414
410
|
setup(t) {
|
|
415
|
-
const e = t, n =
|
|
411
|
+
const e = t, n = L(e.tableid), o = x(null), a = x(null), l = () => n.display[e.rowIndex].expanded ? "▼" : "►";
|
|
416
412
|
if (e.addNavigation) {
|
|
417
|
-
const
|
|
413
|
+
const i = {
|
|
418
414
|
"keydown.control.g": (r) => {
|
|
419
415
|
r.stopPropagation(), r.preventDefault(), n.toggleRowExpand(e.rowIndex);
|
|
420
416
|
}
|
|
421
417
|
};
|
|
422
|
-
typeof e.addNavigation == "object" && Object.assign(
|
|
418
|
+
typeof e.addNavigation == "object" && Object.assign(i, e.addNavigation), oe([
|
|
423
419
|
{
|
|
424
420
|
selectors: o,
|
|
425
|
-
handlers:
|
|
421
|
+
handlers: i
|
|
426
422
|
}
|
|
427
423
|
]);
|
|
428
424
|
}
|
|
429
|
-
return (
|
|
430
|
-
|
|
425
|
+
return (i, r) => (g(), b(V, null, [
|
|
426
|
+
T("tr", J(i.$attrs, {
|
|
431
427
|
ref_key: "rowEl",
|
|
432
428
|
ref: o,
|
|
433
|
-
tabindex:
|
|
429
|
+
tabindex: i.tabIndex,
|
|
434
430
|
class: "expandable-row"
|
|
435
431
|
}), [
|
|
436
|
-
|
|
432
|
+
T("td", {
|
|
437
433
|
tabIndex: -1,
|
|
438
|
-
onClick: r[0] || (r[0] = (
|
|
434
|
+
onClick: r[0] || (r[0] = (s) => d(n).toggleRowExpand(i.rowIndex)),
|
|
439
435
|
class: "row-index"
|
|
440
|
-
},
|
|
441
|
-
E(
|
|
442
|
-
], 16,
|
|
443
|
-
d(n).display[e.rowIndex].expanded ? (g(),
|
|
436
|
+
}, O(l()), 1),
|
|
437
|
+
E(i.$slots, "row")
|
|
438
|
+
], 16, Qe),
|
|
439
|
+
d(n).display[e.rowIndex].expanded ? (g(), b("tr", {
|
|
444
440
|
key: 0,
|
|
445
441
|
ref_key: "rowExpanded",
|
|
446
442
|
ref: a,
|
|
447
|
-
tabindex:
|
|
443
|
+
tabindex: i.tabIndex,
|
|
448
444
|
class: "expanded-row"
|
|
449
445
|
}, [
|
|
450
|
-
|
|
446
|
+
T("td", {
|
|
451
447
|
tabIndex: -1,
|
|
452
448
|
colspan: d(n).columns.length + 1,
|
|
453
449
|
class: "expanded-row-content"
|
|
454
450
|
}, [
|
|
455
|
-
E(
|
|
456
|
-
], 8,
|
|
457
|
-
], 8,
|
|
451
|
+
E(i.$slots, "content")
|
|
452
|
+
], 8, Ke)
|
|
453
|
+
], 8, Ze)) : B("", !0)
|
|
458
454
|
], 64));
|
|
459
455
|
}
|
|
460
|
-
}),
|
|
456
|
+
}), tt = ["tabindex"], nt = {
|
|
461
457
|
key: 0,
|
|
462
458
|
tabIndex: -1,
|
|
463
459
|
class: "list-index"
|
|
464
|
-
},
|
|
460
|
+
}, Ee = /* @__PURE__ */ _({
|
|
465
461
|
__name: "ARow",
|
|
466
462
|
props: {
|
|
467
463
|
row: {},
|
|
@@ -471,146 +467,145 @@ const Qe = ["data-colindex", "data-rowindex", "data-editable", "contenteditable"
|
|
|
471
467
|
addNavigation: { type: [Boolean, Object], default: !1 }
|
|
472
468
|
},
|
|
473
469
|
setup(t) {
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
n.toggleRowExpand(i);
|
|
470
|
+
const e = t, n = L(e.tableid), o = x(null);
|
|
471
|
+
n.numberedRowWidth.value;
|
|
472
|
+
const a = () => n.config.view !== "tree" ? "" : n.display[e.rowIndex].isRoot || n.display[e.rowIndex].isParent ? n.display[e.rowIndex].childrenOpen ? "-" : "+" : "", l = C(() => n.config.view !== "tree" || n.display[e.rowIndex].isRoot || n.display[e.rowIndex].open), i = (r) => {
|
|
473
|
+
n.toggleRowExpand(r);
|
|
479
474
|
};
|
|
480
475
|
if (e.addNavigation) {
|
|
481
|
-
let
|
|
482
|
-
typeof e.addNavigation == "object" && (
|
|
483
|
-
...
|
|
476
|
+
let r = ne;
|
|
477
|
+
typeof e.addNavigation == "object" && (r = {
|
|
478
|
+
...r,
|
|
484
479
|
...e.addNavigation
|
|
485
|
-
}),
|
|
480
|
+
}), oe([
|
|
486
481
|
{
|
|
487
482
|
selectors: o,
|
|
488
|
-
handlers:
|
|
483
|
+
handlers: r
|
|
489
484
|
}
|
|
490
485
|
]);
|
|
491
486
|
}
|
|
492
|
-
return (
|
|
487
|
+
return (r, s) => q((g(), b("tr", {
|
|
493
488
|
ref_key: "rowEl",
|
|
494
489
|
ref: o,
|
|
495
|
-
tabindex:
|
|
490
|
+
tabindex: r.tabIndex,
|
|
496
491
|
class: "table-row"
|
|
497
492
|
}, [
|
|
498
|
-
E(
|
|
499
|
-
d(n).config.view === "list" ? (g(),
|
|
493
|
+
E(r.$slots, "index", {}, () => [
|
|
494
|
+
d(n).config.view === "list" ? (g(), b("td", nt, O(r.rowIndex + 1), 1)) : d(n).config.view === "tree" ? (g(), b("td", {
|
|
500
495
|
key: 1,
|
|
501
496
|
tabIndex: -1,
|
|
502
497
|
class: "tree-index",
|
|
503
|
-
onClick:
|
|
504
|
-
},
|
|
505
|
-
]
|
|
506
|
-
E(
|
|
507
|
-
], 8,
|
|
508
|
-
[
|
|
498
|
+
onClick: s[0] || (s[0] = (u) => i(r.rowIndex))
|
|
499
|
+
}, O(a()), 1)) : B("", !0)
|
|
500
|
+
]),
|
|
501
|
+
E(r.$slots, "default")
|
|
502
|
+
], 8, tt)), [
|
|
503
|
+
[ye, l.value]
|
|
509
504
|
]);
|
|
510
505
|
}
|
|
511
|
-
})
|
|
506
|
+
});
|
|
512
507
|
let H;
|
|
513
|
-
const
|
|
514
|
-
function
|
|
508
|
+
const ot = new Uint8Array(16);
|
|
509
|
+
function lt() {
|
|
515
510
|
if (!H && (H = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !H))
|
|
516
511
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
517
|
-
return H(
|
|
512
|
+
return H(ot);
|
|
518
513
|
}
|
|
519
|
-
const
|
|
514
|
+
const y = [];
|
|
520
515
|
for (let t = 0; t < 256; ++t)
|
|
521
|
-
|
|
522
|
-
function
|
|
523
|
-
return
|
|
516
|
+
y.push((t + 256).toString(16).slice(1));
|
|
517
|
+
function rt(t, e = 0) {
|
|
518
|
+
return y[t[e + 0]] + y[t[e + 1]] + y[t[e + 2]] + y[t[e + 3]] + "-" + y[t[e + 4]] + y[t[e + 5]] + "-" + y[t[e + 6]] + y[t[e + 7]] + "-" + y[t[e + 8]] + y[t[e + 9]] + "-" + y[t[e + 10]] + y[t[e + 11]] + y[t[e + 12]] + y[t[e + 13]] + y[t[e + 14]] + y[t[e + 15]];
|
|
524
519
|
}
|
|
525
|
-
const
|
|
526
|
-
randomUUID:
|
|
520
|
+
const at = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), fe = {
|
|
521
|
+
randomUUID: at
|
|
527
522
|
};
|
|
528
|
-
function
|
|
529
|
-
if (
|
|
530
|
-
return
|
|
523
|
+
function Ie(t, e, n) {
|
|
524
|
+
if (fe.randomUUID && !e && !t)
|
|
525
|
+
return fe.randomUUID();
|
|
531
526
|
t = t || {};
|
|
532
|
-
const o = t.random || (t.rng ||
|
|
527
|
+
const o = t.random || (t.rng || lt)();
|
|
533
528
|
if (o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, e) {
|
|
534
529
|
n = n || 0;
|
|
535
530
|
for (let a = 0; a < 16; ++a)
|
|
536
531
|
e[n + a] = o[a];
|
|
537
532
|
return e;
|
|
538
533
|
}
|
|
539
|
-
return
|
|
534
|
+
return rt(o);
|
|
540
535
|
}
|
|
541
|
-
function
|
|
542
|
-
return we() ? (
|
|
536
|
+
function ke(t) {
|
|
537
|
+
return we() ? (ve(t), !0) : !1;
|
|
543
538
|
}
|
|
544
|
-
function
|
|
539
|
+
function $(t) {
|
|
545
540
|
return typeof t == "function" ? t() : d(t);
|
|
546
541
|
}
|
|
547
|
-
const
|
|
542
|
+
const Ce = typeof window < "u" && typeof document < "u";
|
|
548
543
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
549
|
-
const
|
|
550
|
-
},
|
|
551
|
-
function
|
|
544
|
+
const it = Object.prototype.toString, st = (t) => it.call(t) === "[object Object]", R = () => {
|
|
545
|
+
}, X = /* @__PURE__ */ dt();
|
|
546
|
+
function dt() {
|
|
552
547
|
var t, e;
|
|
553
|
-
return
|
|
548
|
+
return Ce && ((t = window == null ? void 0 : window.navigator) == null ? void 0 : t.userAgent) && (/iP(ad|hone|od)/.test(window.navigator.userAgent) || ((e = window == null ? void 0 : window.navigator) == null ? void 0 : e.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent));
|
|
554
549
|
}
|
|
555
|
-
const
|
|
550
|
+
const pe = {
|
|
556
551
|
mounted: "mounted",
|
|
557
552
|
updated: "updated",
|
|
558
553
|
unmounted: "unmounted"
|
|
559
554
|
};
|
|
560
|
-
function
|
|
555
|
+
function ct(...t) {
|
|
561
556
|
if (t.length !== 1)
|
|
562
|
-
return
|
|
557
|
+
return Re(...t);
|
|
563
558
|
const e = t[0];
|
|
564
|
-
return typeof e == "function" ?
|
|
559
|
+
return typeof e == "function" ? Oe(Le(() => ({ get: e, set: R }))) : x(e);
|
|
565
560
|
}
|
|
566
|
-
function
|
|
561
|
+
function D(t) {
|
|
567
562
|
var e;
|
|
568
|
-
const n =
|
|
563
|
+
const n = $(t);
|
|
569
564
|
return (e = n == null ? void 0 : n.$el) != null ? e : n;
|
|
570
565
|
}
|
|
571
|
-
const
|
|
566
|
+
const Ae = Ce ? window : void 0;
|
|
572
567
|
function U(...t) {
|
|
573
568
|
let e, n, o, a;
|
|
574
|
-
if (typeof t[0] == "string" || Array.isArray(t[0]) ? ([n, o, a] = t, e =
|
|
575
|
-
return
|
|
569
|
+
if (typeof t[0] == "string" || Array.isArray(t[0]) ? ([n, o, a] = t, e = Ae) : [e, n, o, a] = t, !e)
|
|
570
|
+
return R;
|
|
576
571
|
Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
|
|
577
|
-
const l = [],
|
|
572
|
+
const l = [], i = () => {
|
|
578
573
|
l.forEach((m) => m()), l.length = 0;
|
|
579
|
-
}, r = (m, f, c, p) => (m.addEventListener(f, c, p), () => m.removeEventListener(f, c, p)),
|
|
580
|
-
() => [
|
|
574
|
+
}, r = (m, f, c, p) => (m.addEventListener(f, c, p), () => m.removeEventListener(f, c, p)), s = A(
|
|
575
|
+
() => [D(e), $(a)],
|
|
581
576
|
([m, f]) => {
|
|
582
|
-
if (
|
|
577
|
+
if (i(), !m)
|
|
583
578
|
return;
|
|
584
|
-
const c =
|
|
579
|
+
const c = st(f) ? { ...f } : f;
|
|
585
580
|
l.push(
|
|
586
|
-
...n.flatMap((p) => o.map((
|
|
581
|
+
...n.flatMap((p) => o.map((v) => r(m, p, v, c)))
|
|
587
582
|
);
|
|
588
583
|
},
|
|
589
584
|
{ immediate: !0, flush: "post" }
|
|
590
585
|
), u = () => {
|
|
591
|
-
|
|
586
|
+
s(), i();
|
|
592
587
|
};
|
|
593
|
-
return
|
|
588
|
+
return ke(u), u;
|
|
594
589
|
}
|
|
595
|
-
let
|
|
590
|
+
let me = !1;
|
|
596
591
|
function he(t, e, n = {}) {
|
|
597
|
-
const { window: o =
|
|
592
|
+
const { window: o = Ae, ignore: a = [], capture: l = !0, detectIframe: i = !1 } = n;
|
|
598
593
|
if (!o)
|
|
599
|
-
return
|
|
600
|
-
|
|
594
|
+
return R;
|
|
595
|
+
X && !me && (me = !0, Array.from(o.document.body.children).forEach((c) => c.addEventListener("click", R)), o.document.documentElement.addEventListener("click", R));
|
|
601
596
|
let r = !0;
|
|
602
|
-
const
|
|
597
|
+
const s = (c) => a.some((p) => {
|
|
603
598
|
if (typeof p == "string")
|
|
604
|
-
return Array.from(o.document.querySelectorAll(p)).some((
|
|
599
|
+
return Array.from(o.document.querySelectorAll(p)).some((v) => v === c.target || c.composedPath().includes(v));
|
|
605
600
|
{
|
|
606
|
-
const
|
|
607
|
-
return
|
|
601
|
+
const v = D(p);
|
|
602
|
+
return v && (c.target === v || c.composedPath().includes(v));
|
|
608
603
|
}
|
|
609
604
|
}), m = [
|
|
610
605
|
U(o, "click", (c) => {
|
|
611
|
-
const p =
|
|
606
|
+
const p = D(t);
|
|
612
607
|
if (!(!p || p === c.target || c.composedPath().includes(p))) {
|
|
613
|
-
if (c.detail === 0 && (r = !
|
|
608
|
+
if (c.detail === 0 && (r = !s(c)), !r) {
|
|
614
609
|
r = !0;
|
|
615
610
|
return;
|
|
616
611
|
}
|
|
@@ -618,21 +613,21 @@ function he(t, e, n = {}) {
|
|
|
618
613
|
}
|
|
619
614
|
}, { passive: !0, capture: l }),
|
|
620
615
|
U(o, "pointerdown", (c) => {
|
|
621
|
-
const p =
|
|
622
|
-
r = !
|
|
616
|
+
const p = D(t);
|
|
617
|
+
r = !s(c) && !!(p && !c.composedPath().includes(p));
|
|
623
618
|
}, { passive: !0 }),
|
|
624
|
-
|
|
619
|
+
i && U(o, "blur", (c) => {
|
|
625
620
|
setTimeout(() => {
|
|
626
621
|
var p;
|
|
627
|
-
const
|
|
628
|
-
((p = o.document.activeElement) == null ? void 0 : p.tagName) === "IFRAME" && !(
|
|
622
|
+
const v = D(t);
|
|
623
|
+
((p = o.document.activeElement) == null ? void 0 : p.tagName) === "IFRAME" && !(v != null && v.contains(o.document.activeElement)) && e(c);
|
|
629
624
|
}, 0);
|
|
630
625
|
})
|
|
631
626
|
].filter(Boolean);
|
|
632
627
|
return () => m.forEach((c) => c());
|
|
633
628
|
}
|
|
634
|
-
const
|
|
635
|
-
[
|
|
629
|
+
const ut = {
|
|
630
|
+
[pe.mounted](t, e) {
|
|
636
631
|
const n = !e.modifiers.bubble;
|
|
637
632
|
if (typeof e.value == "function")
|
|
638
633
|
t.__onClickOutside_stop = he(t, e.value, { capture: n });
|
|
@@ -641,78 +636,78 @@ const ht = {
|
|
|
641
636
|
t.__onClickOutside_stop = he(t, o, Object.assign({ capture: n }, a));
|
|
642
637
|
}
|
|
643
638
|
},
|
|
644
|
-
[
|
|
639
|
+
[pe.unmounted](t) {
|
|
645
640
|
t.__onClickOutside_stop();
|
|
646
641
|
}
|
|
647
642
|
};
|
|
648
|
-
function
|
|
643
|
+
function z(t) {
|
|
649
644
|
return typeof Window < "u" && t instanceof Window ? t.document.documentElement : typeof Document < "u" && t instanceof Document ? t.documentElement : t;
|
|
650
645
|
}
|
|
651
|
-
function
|
|
646
|
+
function _e(t) {
|
|
652
647
|
const e = window.getComputedStyle(t);
|
|
653
648
|
if (e.overflowX === "scroll" || e.overflowY === "scroll" || e.overflowX === "auto" && t.clientWidth < t.scrollWidth || e.overflowY === "auto" && t.clientHeight < t.scrollHeight)
|
|
654
649
|
return !0;
|
|
655
650
|
{
|
|
656
651
|
const n = t.parentNode;
|
|
657
|
-
return !n || n.tagName === "BODY" ? !1 :
|
|
652
|
+
return !n || n.tagName === "BODY" ? !1 : _e(n);
|
|
658
653
|
}
|
|
659
654
|
}
|
|
660
|
-
function
|
|
655
|
+
function ft(t) {
|
|
661
656
|
const e = t || window.event, n = e.target;
|
|
662
|
-
return
|
|
657
|
+
return _e(n) ? !1 : e.touches.length > 1 ? !0 : (e.preventDefault && e.preventDefault(), !1);
|
|
663
658
|
}
|
|
664
|
-
const
|
|
665
|
-
function
|
|
659
|
+
const W = /* @__PURE__ */ new WeakMap();
|
|
660
|
+
function pt(t, e = !1) {
|
|
666
661
|
const n = x(e);
|
|
667
662
|
let o = null;
|
|
668
|
-
|
|
669
|
-
const r =
|
|
663
|
+
A(ct(t), (i) => {
|
|
664
|
+
const r = z($(i));
|
|
670
665
|
if (r) {
|
|
671
|
-
const
|
|
672
|
-
|
|
666
|
+
const s = r;
|
|
667
|
+
W.get(s) || W.set(s, s.style.overflow), n.value && (s.style.overflow = "hidden");
|
|
673
668
|
}
|
|
674
669
|
}, {
|
|
675
670
|
immediate: !0
|
|
676
671
|
});
|
|
677
672
|
const a = () => {
|
|
678
|
-
const
|
|
679
|
-
!
|
|
680
|
-
|
|
673
|
+
const i = z($(t));
|
|
674
|
+
!i || n.value || (X && (o = U(
|
|
675
|
+
i,
|
|
681
676
|
"touchmove",
|
|
682
677
|
(r) => {
|
|
683
|
-
|
|
678
|
+
ft(r);
|
|
684
679
|
},
|
|
685
680
|
{ passive: !1 }
|
|
686
|
-
)),
|
|
681
|
+
)), i.style.overflow = "hidden", n.value = !0);
|
|
687
682
|
}, l = () => {
|
|
688
|
-
var
|
|
689
|
-
const r =
|
|
690
|
-
!r || !n.value || (
|
|
683
|
+
var i;
|
|
684
|
+
const r = z($(t));
|
|
685
|
+
!r || !n.value || (X && (o == null || o()), r.style.overflow = (i = W.get(r)) != null ? i : "", W.delete(r), n.value = !1);
|
|
691
686
|
};
|
|
692
|
-
return
|
|
687
|
+
return ke(l), C({
|
|
693
688
|
get() {
|
|
694
689
|
return n.value;
|
|
695
690
|
},
|
|
696
|
-
set(
|
|
697
|
-
|
|
691
|
+
set(i) {
|
|
692
|
+
i ? a() : l();
|
|
698
693
|
}
|
|
699
694
|
});
|
|
700
695
|
}
|
|
701
|
-
function
|
|
696
|
+
function mt() {
|
|
702
697
|
let t = !1;
|
|
703
698
|
const e = x(!1);
|
|
704
699
|
return (n, o) => {
|
|
705
700
|
if (e.value = o.value, t)
|
|
706
701
|
return;
|
|
707
702
|
t = !0;
|
|
708
|
-
const a =
|
|
709
|
-
|
|
703
|
+
const a = pt(n, o.value);
|
|
704
|
+
A(e, (l) => a.value = l);
|
|
710
705
|
};
|
|
711
706
|
}
|
|
712
|
-
|
|
713
|
-
class
|
|
714
|
-
constructor(e, n, o, a, l,
|
|
715
|
-
this.id = e ||
|
|
707
|
+
mt();
|
|
708
|
+
class ht {
|
|
709
|
+
constructor(e, n, o, a, l, i) {
|
|
710
|
+
this.id = e || Ie(), this.rows = o, this.columns = S(n), this.config = S(a), this.table = l || S(this.createTableObject()), this.display = this.createDisplayObject(i), this.modal = S({ visible: !1 });
|
|
716
711
|
}
|
|
717
712
|
createTableObject() {
|
|
718
713
|
const e = {};
|
|
@@ -739,13 +734,13 @@ class yt {
|
|
|
739
734
|
parent: l.parent
|
|
740
735
|
};
|
|
741
736
|
}
|
|
742
|
-
return
|
|
737
|
+
return S(n);
|
|
743
738
|
}
|
|
744
739
|
get zeroColumn() {
|
|
745
740
|
return ["list", "tree", "list-expansion"].includes(this.config.view);
|
|
746
741
|
}
|
|
747
742
|
get numberedRowWidth() {
|
|
748
|
-
return
|
|
743
|
+
return C(() => String(Math.ceil(this.rows.length / 100) + 1) + "ch");
|
|
749
744
|
}
|
|
750
745
|
cellData(e, n) {
|
|
751
746
|
return this.table[`${e}:${n}`];
|
|
@@ -764,16 +759,16 @@ class yt {
|
|
|
764
759
|
this.config.view === "list-expansion" && (this.display[e].expanded = !this.display[e].expanded);
|
|
765
760
|
}
|
|
766
761
|
}
|
|
767
|
-
const
|
|
762
|
+
const wt = {
|
|
768
763
|
key: 0,
|
|
769
764
|
id: "resizable"
|
|
770
|
-
},
|
|
765
|
+
}, vt = {
|
|
771
766
|
class: "atable-header-row",
|
|
772
767
|
tabindex: "-1"
|
|
773
|
-
},
|
|
768
|
+
}, gt = {
|
|
774
769
|
key: 0,
|
|
775
770
|
id: "header-index"
|
|
776
|
-
},
|
|
771
|
+
}, Se = /* @__PURE__ */ _({
|
|
777
772
|
__name: "ATableHeader",
|
|
778
773
|
props: {
|
|
779
774
|
columns: {},
|
|
@@ -781,30 +776,29 @@ const xt = {
|
|
|
781
776
|
tableid: {}
|
|
782
777
|
},
|
|
783
778
|
setup(t) {
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
textAlign: l.align || "center",
|
|
779
|
+
const n = L(t.tableid);
|
|
780
|
+
n.numberedRowWidth.value;
|
|
781
|
+
const o = (a) => ({
|
|
782
|
+
minWidth: a.width || "40ch",
|
|
783
|
+
textAlign: a.align || "center",
|
|
790
784
|
width: n.config.fullWidth ? "auto" : null
|
|
791
785
|
});
|
|
792
|
-
return (
|
|
793
|
-
|
|
794
|
-
d(n).zeroColumn ? (g(),
|
|
795
|
-
(g(!0),
|
|
796
|
-
key:
|
|
786
|
+
return (a, l) => a.columns.length ? (g(), b("thead", wt, [
|
|
787
|
+
T("tr", vt, [
|
|
788
|
+
d(n).zeroColumn ? (g(), b("th", gt)) : B("", !0),
|
|
789
|
+
(g(!0), b(V, null, G(a.columns, (i, r) => (g(), b("th", {
|
|
790
|
+
key: r,
|
|
797
791
|
tabindex: "-1",
|
|
798
|
-
style:
|
|
792
|
+
style: N(o(i))
|
|
799
793
|
}, [
|
|
800
|
-
E(
|
|
801
|
-
|
|
802
|
-
]
|
|
794
|
+
E(a.$slots, "default", {}, () => [
|
|
795
|
+
Pe(O(i.label || String.fromCharCode(r + 97).toUpperCase()), 1)
|
|
796
|
+
])
|
|
803
797
|
], 4))), 128))
|
|
804
798
|
])
|
|
805
|
-
])) :
|
|
799
|
+
])) : B("", !0);
|
|
806
800
|
}
|
|
807
|
-
}),
|
|
801
|
+
}), De = /* @__PURE__ */ _({
|
|
808
802
|
__name: "ATableModal",
|
|
809
803
|
props: {
|
|
810
804
|
colIndex: {},
|
|
@@ -812,21 +806,21 @@ const xt = {
|
|
|
812
806
|
tableid: {}
|
|
813
807
|
},
|
|
814
808
|
setup(t) {
|
|
815
|
-
|
|
809
|
+
L(t.tableid);
|
|
816
810
|
const n = (o) => {
|
|
817
811
|
o.stopPropagation();
|
|
818
812
|
};
|
|
819
|
-
return (o, a) => (g(),
|
|
813
|
+
return (o, a) => (g(), b("div", {
|
|
820
814
|
ref: "amodal",
|
|
821
815
|
class: "amodal",
|
|
822
816
|
tabindex: "-1",
|
|
823
817
|
onClick: n,
|
|
824
818
|
onInput: n
|
|
825
819
|
}, [
|
|
826
|
-
E(o.$slots, "default"
|
|
820
|
+
E(o.$slots, "default")
|
|
827
821
|
], 544));
|
|
828
822
|
}
|
|
829
|
-
}),
|
|
823
|
+
}), yt = /* @__PURE__ */ _({
|
|
830
824
|
__name: "ATable",
|
|
831
825
|
props: {
|
|
832
826
|
id: {},
|
|
@@ -839,45 +833,45 @@ const xt = {
|
|
|
839
833
|
emits: ["update:modelValue"],
|
|
840
834
|
setup(t, { emit: e }) {
|
|
841
835
|
const n = t, o = e;
|
|
842
|
-
let a = n.modelValue ? n.modelValue : n.rows, l = new
|
|
843
|
-
|
|
836
|
+
let a = n.modelValue ? n.modelValue : n.rows, l = new ht(n.id, n.columns, a, n.config);
|
|
837
|
+
Me(l.id, l), A(
|
|
844
838
|
() => l.rows,
|
|
845
839
|
(r) => {
|
|
846
840
|
o("update:modelValue", r);
|
|
847
841
|
},
|
|
848
842
|
{ deep: !0 }
|
|
849
843
|
);
|
|
850
|
-
const
|
|
851
|
-
var
|
|
852
|
-
r.target instanceof Node && (
|
|
844
|
+
const i = (r) => {
|
|
845
|
+
var s;
|
|
846
|
+
r.target instanceof Node && (s = l.modal.parent) != null && s.contains(r.target) || l.modal.visible && (l.modal.visible = !1);
|
|
853
847
|
};
|
|
854
848
|
return window.addEventListener("keydown", async (r) => {
|
|
855
849
|
if (r.key === "Escape" && l.modal.visible) {
|
|
856
850
|
l.modal.visible = !1;
|
|
857
|
-
const
|
|
858
|
-
|
|
851
|
+
const s = l.modal.parent;
|
|
852
|
+
s && (await He(), s.focus());
|
|
859
853
|
}
|
|
860
|
-
}), (r,
|
|
854
|
+
}), (r, s) => q((g(), b("table", {
|
|
861
855
|
class: "atable",
|
|
862
|
-
style:
|
|
856
|
+
style: N({ width: d(l).config.fullWidth ? "100%" : "auto" })
|
|
863
857
|
}, [
|
|
864
858
|
E(r.$slots, "header", { data: d(l) }, () => [
|
|
865
|
-
|
|
859
|
+
le(Se, {
|
|
866
860
|
columns: d(l).columns,
|
|
867
861
|
config: d(l).config,
|
|
868
862
|
tableid: d(l).id
|
|
869
863
|
}, null, 8, ["columns", "config", "tableid"])
|
|
870
|
-
]
|
|
871
|
-
|
|
864
|
+
]),
|
|
865
|
+
T("tbody", null, [
|
|
872
866
|
E(r.$slots, "body", { data: d(l) }, () => [
|
|
873
|
-
(g(!0),
|
|
874
|
-
key: u.id || d(
|
|
867
|
+
(g(!0), b(V, null, G(d(l).rows, (u, m) => (g(), j(Ee, {
|
|
868
|
+
key: u.id || d(Ie)(),
|
|
875
869
|
row: u,
|
|
876
870
|
rowIndex: m,
|
|
877
871
|
tableid: d(l).id
|
|
878
872
|
}, {
|
|
879
|
-
default:
|
|
880
|
-
(g(!0),
|
|
873
|
+
default: re(() => [
|
|
874
|
+
(g(!0), b(V, null, G(d(l).columns, (f, c) => (g(), j(xe, {
|
|
881
875
|
key: `${c}:${m}`,
|
|
882
876
|
tableid: d(l).id,
|
|
883
877
|
col: f,
|
|
@@ -885,7 +879,7 @@ const xt = {
|
|
|
885
879
|
rowIndex: m,
|
|
886
880
|
colIndex: c + (d(l).zeroColumn ? 0 : -1),
|
|
887
881
|
component: f.cellComponent,
|
|
888
|
-
style:
|
|
882
|
+
style: N({
|
|
889
883
|
textAlign: (f == null ? void 0 : f.align) || "center",
|
|
890
884
|
minWidth: (f == null ? void 0 : f.width) || "40ch",
|
|
891
885
|
width: d(l).config.fullWidth ? "auto" : null
|
|
@@ -894,22 +888,22 @@ const xt = {
|
|
|
894
888
|
]),
|
|
895
889
|
_: 2
|
|
896
890
|
}, 1032, ["row", "rowIndex", "tableid"]))), 128))
|
|
897
|
-
]
|
|
891
|
+
])
|
|
898
892
|
]),
|
|
899
|
-
E(r.$slots, "footer", { data: d(l) }
|
|
893
|
+
E(r.$slots, "footer", { data: d(l) }),
|
|
900
894
|
E(r.$slots, "modal", { data: d(l) }, () => [
|
|
901
|
-
|
|
895
|
+
q(le(De, {
|
|
902
896
|
colIndex: d(l).modal.colIndex,
|
|
903
897
|
rowIndex: d(l).modal.rowIndex,
|
|
904
898
|
tableid: d(l).id,
|
|
905
|
-
style:
|
|
899
|
+
style: N({
|
|
906
900
|
left: d(l).modal.left + "px",
|
|
907
901
|
top: d(l).modal.top + "px",
|
|
908
902
|
maxWidth: d(l).modal.width + "px"
|
|
909
903
|
})
|
|
910
904
|
}, {
|
|
911
|
-
default:
|
|
912
|
-
(g(),
|
|
905
|
+
default: re(() => [
|
|
906
|
+
(g(), j(ge(d(l).modal.component), J({
|
|
913
907
|
key: `${d(l).modal.rowIndex}:${d(l).modal.colIndex}`,
|
|
914
908
|
colIndex: d(l).modal.colIndex,
|
|
915
909
|
rowIndex: d(l).modal.rowIndex,
|
|
@@ -918,25 +912,25 @@ const xt = {
|
|
|
918
912
|
]),
|
|
919
913
|
_: 1
|
|
920
914
|
}, 8, ["colIndex", "rowIndex", "tableid", "style"]), [
|
|
921
|
-
[
|
|
915
|
+
[ye, d(l).modal.visible]
|
|
922
916
|
])
|
|
923
|
-
]
|
|
917
|
+
])
|
|
924
918
|
], 4)), [
|
|
925
|
-
[d(
|
|
919
|
+
[d(ut), i]
|
|
926
920
|
]);
|
|
927
921
|
}
|
|
928
|
-
})
|
|
929
|
-
function
|
|
930
|
-
t.component("ACell",
|
|
922
|
+
});
|
|
923
|
+
function xt(t) {
|
|
924
|
+
t.component("ACell", xe), t.component("AExpansionRow", et), t.component("ARow", Ee), t.component("ATable", yt), t.component("ATableHeader", Se), t.component("ATableModal", De);
|
|
931
925
|
}
|
|
932
926
|
export {
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
927
|
+
xe as ACell,
|
|
928
|
+
et as AExpansionRow,
|
|
929
|
+
Ee as ARow,
|
|
930
|
+
yt as ATable,
|
|
931
|
+
Se as ATableHeader,
|
|
932
|
+
De as ATableModal,
|
|
933
|
+
ht as TableDataStore,
|
|
934
|
+
xt as install
|
|
941
935
|
};
|
|
942
936
|
//# sourceMappingURL=atable.js.map
|