@stonecrop/atable 0.2.26 → 0.2.27
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.d.ts +3 -0
- package/dist/atable.js +254 -254
- package/dist/atable.js.map +1 -1
- package/dist/atable.umd.cjs +1 -1
- package/dist/atable.umd.cjs.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/types/index.d.ts +7 -1
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +3 -3
- package/src/components/ACell.vue +10 -5
- package/src/index.ts +1 -1
- package/src/types/index.ts +9 -1
package/dist/atable.js
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var C = (t, e, n) =>
|
|
4
|
-
import { onMounted as
|
|
5
|
-
function
|
|
6
|
-
return
|
|
1
|
+
var Me = Object.defineProperty;
|
|
2
|
+
var Pe = (t, e, n) => e in t ? Me(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var C = (t, e, n) => Pe(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import { onMounted as xe, ref as x, watch as S, onBeforeUnmount as He, computed as E, unref as f, getCurrentScope as Ee, onScopeDispose as Ie, getCurrentInstance as je, defineComponent as D, inject as F, openBlock as h, createElementBlock as b, createBlock as N, resolveDynamicComponent as ke, mergeProps as te, toDisplayString as M, Fragment as B, createElementVNode as O, renderSlot as I, createCommentVNode as z, withDirectives as Q, vShow as Ae, toRef as We, readonly as Ne, customRef as Ue, reactive as T, renderList as Z, normalizeStyle as U, createTextVNode as Ve, provide as Be, nextTick as ze, createVNode as de, withCtx as ce } from "vue";
|
|
5
|
+
function Ce(t) {
|
|
6
|
+
return Ee() ? (Ie(t), !0) : !1;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function ne(t) {
|
|
9
9
|
return typeof t == "function" ? t() : f(t);
|
|
10
10
|
}
|
|
11
|
-
const
|
|
11
|
+
const Fe = typeof window < "u" && typeof document < "u";
|
|
12
12
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
13
|
-
const
|
|
13
|
+
const qe = (t) => t != null, Ge = Object.prototype.toString, Ye = (t) => Ge.call(t) === "[object Object]", Xe = () => {
|
|
14
14
|
};
|
|
15
|
-
function
|
|
15
|
+
function P(t) {
|
|
16
16
|
var e;
|
|
17
|
-
const n =
|
|
17
|
+
const n = ne(t);
|
|
18
18
|
return (e = n == null ? void 0 : n.$el) != null ? e : n;
|
|
19
19
|
}
|
|
20
|
-
const
|
|
21
|
-
function
|
|
20
|
+
const q = Fe ? window : void 0;
|
|
21
|
+
function K(...t) {
|
|
22
22
|
let e, n, o, a;
|
|
23
|
-
if (typeof t[0] == "string" || Array.isArray(t[0]) ? ([n, o, a] = t, e =
|
|
24
|
-
return
|
|
23
|
+
if (typeof t[0] == "string" || Array.isArray(t[0]) ? ([n, o, a] = t, e = q) : [e, n, o, a] = t, !e)
|
|
24
|
+
return Xe;
|
|
25
25
|
Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
|
|
26
26
|
const l = [], s = () => {
|
|
27
27
|
l.forEach((u) => u()), l.length = 0;
|
|
28
28
|
}, r = (u, p, c, m) => (u.addEventListener(p, c, m), () => u.removeEventListener(p, c, m)), i = S(
|
|
29
|
-
() => [
|
|
29
|
+
() => [P(e), ne(a)],
|
|
30
30
|
([u, p]) => {
|
|
31
31
|
if (s(), !u)
|
|
32
32
|
return;
|
|
33
|
-
const c =
|
|
33
|
+
const c = Ye(p) ? { ...p } : p;
|
|
34
34
|
l.push(
|
|
35
|
-
...n.flatMap((m) => o.map((
|
|
35
|
+
...n.flatMap((m) => o.map((w) => r(u, m, w, c)))
|
|
36
36
|
);
|
|
37
37
|
},
|
|
38
38
|
{ immediate: !0, flush: "post" }
|
|
39
39
|
), d = () => {
|
|
40
40
|
i(), s();
|
|
41
41
|
};
|
|
42
|
-
return
|
|
42
|
+
return Ce(d), d;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
45
|
-
const t = x(!1), e =
|
|
46
|
-
return e &&
|
|
44
|
+
function Je() {
|
|
45
|
+
const t = x(!1), e = je();
|
|
46
|
+
return e && xe(() => {
|
|
47
47
|
t.value = !0;
|
|
48
48
|
}, e), t;
|
|
49
49
|
}
|
|
50
|
-
function
|
|
51
|
-
const e =
|
|
50
|
+
function Qe(t) {
|
|
51
|
+
const e = Je();
|
|
52
52
|
return E(() => (e.value, !!t()));
|
|
53
53
|
}
|
|
54
|
-
function
|
|
55
|
-
const { window: o =
|
|
54
|
+
function Ze(t, e, n = {}) {
|
|
55
|
+
const { window: o = q, ...a } = n;
|
|
56
56
|
let l;
|
|
57
|
-
const s =
|
|
57
|
+
const s = Qe(() => o && "MutationObserver" in o), r = () => {
|
|
58
58
|
l && (l.disconnect(), l = void 0);
|
|
59
59
|
}, i = E(() => {
|
|
60
|
-
const c =
|
|
60
|
+
const c = ne(t), m = (Array.isArray(c) ? c : [c]).map(P).filter(qe);
|
|
61
61
|
return new Set(m);
|
|
62
62
|
}), d = S(
|
|
63
63
|
() => i.value,
|
|
@@ -68,16 +68,16 @@ function Je(t, e, n = {}) {
|
|
|
68
68
|
), u = () => l == null ? void 0 : l.takeRecords(), p = () => {
|
|
69
69
|
r(), d();
|
|
70
70
|
};
|
|
71
|
-
return
|
|
71
|
+
return Ce(p), {
|
|
72
72
|
isSupported: s,
|
|
73
73
|
stop: p,
|
|
74
74
|
takeRecords: u
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function Ke(t = {}) {
|
|
78
78
|
var e;
|
|
79
79
|
const {
|
|
80
|
-
window: n =
|
|
80
|
+
window: n = q,
|
|
81
81
|
deep: o = !0,
|
|
82
82
|
triggerOnRemoval: a = !1
|
|
83
83
|
} = t, l = (e = t.document) != null ? e : n == null ? void 0 : n.document, s = () => {
|
|
@@ -90,9 +90,9 @@ function Qe(t = {}) {
|
|
|
90
90
|
}, r = x(), i = () => {
|
|
91
91
|
r.value = s();
|
|
92
92
|
};
|
|
93
|
-
return n && (
|
|
93
|
+
return n && (K(n, "blur", (d) => {
|
|
94
94
|
d.relatedTarget === null && i();
|
|
95
|
-
}, !0),
|
|
95
|
+
}, !0), K(n, "focus", i, !0)), a && Ze(l, (d) => {
|
|
96
96
|
d.filter((u) => u.removedNodes.length).map((u) => Array.from(u.removedNodes)).flat().forEach((u) => {
|
|
97
97
|
u === r.value && i();
|
|
98
98
|
});
|
|
@@ -101,14 +101,14 @@ function Qe(t = {}) {
|
|
|
101
101
|
subtree: !0
|
|
102
102
|
}), i(), r;
|
|
103
103
|
}
|
|
104
|
-
function
|
|
105
|
-
const n =
|
|
104
|
+
function et(t, e = {}) {
|
|
105
|
+
const n = Ke(e), o = E(() => P(t));
|
|
106
106
|
return { focused: E(() => o.value && n.value ? o.value.contains(n.value) : !1) };
|
|
107
107
|
}
|
|
108
|
-
function
|
|
108
|
+
function tt(t, { window: e = q, scrollTarget: n } = {}) {
|
|
109
109
|
const o = x(!1), a = () => {
|
|
110
110
|
if (!e) return;
|
|
111
|
-
const l = e.document, s =
|
|
111
|
+
const l = e.document, s = P(t);
|
|
112
112
|
if (!s)
|
|
113
113
|
o.value = !1;
|
|
114
114
|
else {
|
|
@@ -117,21 +117,21 @@ function Ke(t, { window: e = F, scrollTarget: n } = {}) {
|
|
|
117
117
|
}
|
|
118
118
|
};
|
|
119
119
|
return S(
|
|
120
|
-
() =>
|
|
120
|
+
() => P(t),
|
|
121
121
|
() => a(),
|
|
122
122
|
{ immediate: !0, flush: "post" }
|
|
123
|
-
), e &&
|
|
123
|
+
), e && K(n || e, "scroll", a, {
|
|
124
124
|
capture: !1,
|
|
125
125
|
passive: !0
|
|
126
126
|
}), o;
|
|
127
127
|
}
|
|
128
128
|
const k = (t) => {
|
|
129
|
-
let e =
|
|
129
|
+
let e = tt(t).value;
|
|
130
130
|
return e = e && t.offsetHeight > 0, e;
|
|
131
|
-
}, A = (t) => t.tabIndex >= 0,
|
|
131
|
+
}, A = (t) => t.tabIndex >= 0, ue = (t) => {
|
|
132
132
|
const e = t.target;
|
|
133
|
-
return
|
|
134
|
-
},
|
|
133
|
+
return oe(e);
|
|
134
|
+
}, oe = (t) => {
|
|
135
135
|
var e;
|
|
136
136
|
let n;
|
|
137
137
|
if (t instanceof HTMLTableCellElement) {
|
|
@@ -144,8 +144,8 @@ const k = (t) => {
|
|
|
144
144
|
const o = t.previousElementSibling;
|
|
145
145
|
o && (n = o);
|
|
146
146
|
}
|
|
147
|
-
return n && (!A(n) || !k(n)) ?
|
|
148
|
-
},
|
|
147
|
+
return n && (!A(n) || !k(n)) ? oe(n) : n;
|
|
148
|
+
}, nt = (t) => {
|
|
149
149
|
var e;
|
|
150
150
|
const n = t.target;
|
|
151
151
|
let o;
|
|
@@ -162,11 +162,11 @@ const k = (t) => {
|
|
|
162
162
|
l && (o = l);
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
|
-
return o && (!A(o) || !k(o)) ?
|
|
166
|
-
},
|
|
165
|
+
return o && (!A(o) || !k(o)) ? le(o) : o;
|
|
166
|
+
}, fe = (t) => {
|
|
167
167
|
const e = t.target;
|
|
168
|
-
return
|
|
169
|
-
},
|
|
168
|
+
return le(e);
|
|
169
|
+
}, le = (t) => {
|
|
170
170
|
var e;
|
|
171
171
|
let n;
|
|
172
172
|
if (t instanceof HTMLTableCellElement) {
|
|
@@ -179,8 +179,8 @@ const k = (t) => {
|
|
|
179
179
|
const o = t.nextElementSibling;
|
|
180
180
|
o && (n = o);
|
|
181
181
|
}
|
|
182
|
-
return n && (!A(n) || !k(n)) ?
|
|
183
|
-
},
|
|
182
|
+
return n && (!A(n) || !k(n)) ? le(n) : n;
|
|
183
|
+
}, ot = (t) => {
|
|
184
184
|
var e;
|
|
185
185
|
const n = t.target;
|
|
186
186
|
let o;
|
|
@@ -197,11 +197,11 @@ const k = (t) => {
|
|
|
197
197
|
l && (o = l);
|
|
198
198
|
}
|
|
199
199
|
}
|
|
200
|
-
return o && (!A(o) || !k(o)) ?
|
|
201
|
-
},
|
|
200
|
+
return o && (!A(o) || !k(o)) ? oe(o) : o;
|
|
201
|
+
}, pe = (t) => {
|
|
202
202
|
const e = t.target;
|
|
203
|
-
return
|
|
204
|
-
},
|
|
203
|
+
return re(e);
|
|
204
|
+
}, re = (t) => {
|
|
205
205
|
var e;
|
|
206
206
|
let n;
|
|
207
207
|
if (t.previousElementSibling)
|
|
@@ -210,11 +210,11 @@ const k = (t) => {
|
|
|
210
210
|
const o = (e = t.parentElement) == null ? void 0 : e.previousElementSibling;
|
|
211
211
|
n = o == null ? void 0 : o.lastElementChild;
|
|
212
212
|
}
|
|
213
|
-
return n && (!A(n) || !k(n)) ?
|
|
214
|
-
},
|
|
213
|
+
return n && (!A(n) || !k(n)) ? re(n) : n;
|
|
214
|
+
}, me = (t) => {
|
|
215
215
|
const e = t.target;
|
|
216
|
-
return
|
|
217
|
-
},
|
|
216
|
+
return ae(e);
|
|
217
|
+
}, ae = (t) => {
|
|
218
218
|
var e;
|
|
219
219
|
let n;
|
|
220
220
|
if (t.nextElementSibling)
|
|
@@ -223,83 +223,83 @@ const k = (t) => {
|
|
|
223
223
|
const o = (e = t.parentElement) == null ? void 0 : e.nextElementSibling;
|
|
224
224
|
n = o == null ? void 0 : o.firstElementChild;
|
|
225
225
|
}
|
|
226
|
-
return n && (!A(n) || !k(n)) ?
|
|
227
|
-
},
|
|
226
|
+
return n && (!A(n) || !k(n)) ? ae(n) : n;
|
|
227
|
+
}, ve = (t) => {
|
|
228
228
|
const e = t.target.parentElement.firstElementChild;
|
|
229
|
-
return e && (!A(e) || !k(e)) ?
|
|
230
|
-
},
|
|
229
|
+
return e && (!A(e) || !k(e)) ? ae(e) : e;
|
|
230
|
+
}, we = (t) => {
|
|
231
231
|
const e = t.target.parentElement.lastElementChild;
|
|
232
|
-
return e && (!A(e) || !k(e)) ?
|
|
233
|
-
},
|
|
232
|
+
return e && (!A(e) || !k(e)) ? re(e) : e;
|
|
233
|
+
}, j = ["alt", "control", "shift", "meta"], lt = {
|
|
234
234
|
ArrowUp: "up",
|
|
235
235
|
ArrowDown: "down",
|
|
236
236
|
ArrowLeft: "left",
|
|
237
237
|
ArrowRight: "right"
|
|
238
|
-
},
|
|
238
|
+
}, se = {
|
|
239
239
|
"keydown.up": (t) => {
|
|
240
|
-
const e =
|
|
240
|
+
const e = ue(t);
|
|
241
241
|
e && (t.preventDefault(), t.stopPropagation(), e.focus());
|
|
242
242
|
},
|
|
243
243
|
"keydown.down": (t) => {
|
|
244
|
-
const e =
|
|
244
|
+
const e = fe(t);
|
|
245
245
|
e && (t.preventDefault(), t.stopPropagation(), e.focus());
|
|
246
246
|
},
|
|
247
247
|
"keydown.left": (t) => {
|
|
248
|
-
const e =
|
|
248
|
+
const e = pe(t);
|
|
249
249
|
t.preventDefault(), t.stopPropagation(), e && e.focus();
|
|
250
250
|
},
|
|
251
251
|
"keydown.right": (t) => {
|
|
252
|
-
const e =
|
|
252
|
+
const e = me(t);
|
|
253
253
|
t.preventDefault(), t.stopPropagation(), e && e.focus();
|
|
254
254
|
},
|
|
255
255
|
"keydown.control.up": (t) => {
|
|
256
|
-
const e =
|
|
256
|
+
const e = nt(t);
|
|
257
257
|
e && (t.preventDefault(), t.stopPropagation(), e.focus());
|
|
258
258
|
},
|
|
259
259
|
"keydown.control.down": (t) => {
|
|
260
|
-
const e =
|
|
260
|
+
const e = ot(t);
|
|
261
261
|
e && (t.preventDefault(), t.stopPropagation(), e.focus());
|
|
262
262
|
},
|
|
263
263
|
"keydown.control.left": (t) => {
|
|
264
|
-
const e =
|
|
264
|
+
const e = ve(t);
|
|
265
265
|
e && (t.preventDefault(), t.stopPropagation(), e.focus());
|
|
266
266
|
},
|
|
267
267
|
"keydown.control.right": (t) => {
|
|
268
|
-
const e =
|
|
268
|
+
const e = we(t);
|
|
269
269
|
e && (t.preventDefault(), t.stopPropagation(), e.focus());
|
|
270
270
|
},
|
|
271
271
|
"keydown.end": (t) => {
|
|
272
|
-
const e =
|
|
272
|
+
const e = we(t);
|
|
273
273
|
e && (t.preventDefault(), t.stopPropagation(), e.focus());
|
|
274
274
|
},
|
|
275
275
|
"keydown.enter": (t) => {
|
|
276
276
|
if (t.target instanceof HTMLTableCellElement) {
|
|
277
277
|
t.preventDefault(), t.stopPropagation();
|
|
278
|
-
const e =
|
|
278
|
+
const e = fe(t);
|
|
279
279
|
e && e.focus();
|
|
280
280
|
}
|
|
281
281
|
},
|
|
282
282
|
"keydown.shift.enter": (t) => {
|
|
283
283
|
if (t.target instanceof HTMLTableCellElement) {
|
|
284
284
|
t.preventDefault(), t.stopPropagation();
|
|
285
|
-
const e =
|
|
285
|
+
const e = ue(t);
|
|
286
286
|
e && e.focus();
|
|
287
287
|
}
|
|
288
288
|
},
|
|
289
289
|
"keydown.home": (t) => {
|
|
290
|
-
const e =
|
|
290
|
+
const e = ve(t);
|
|
291
291
|
e && (t.preventDefault(), t.stopPropagation(), e.focus());
|
|
292
292
|
},
|
|
293
293
|
"keydown.tab": (t) => {
|
|
294
|
-
const e =
|
|
294
|
+
const e = me(t);
|
|
295
295
|
e && (t.preventDefault(), t.stopPropagation(), e.focus());
|
|
296
296
|
},
|
|
297
297
|
"keydown.shift.tab": (t) => {
|
|
298
|
-
const e =
|
|
298
|
+
const e = pe(t);
|
|
299
299
|
e && (t.preventDefault(), t.stopPropagation(), e.focus());
|
|
300
300
|
}
|
|
301
301
|
};
|
|
302
|
-
function
|
|
302
|
+
function ie(t) {
|
|
303
303
|
const e = (s) => {
|
|
304
304
|
let r = null;
|
|
305
305
|
return s.parent && (typeof s.parent == "string" ? r = document.querySelector(s.parent) : s.parent instanceof HTMLElement ? r = s.parent : r = s.parent.value), r;
|
|
@@ -324,22 +324,22 @@ function ae(t) {
|
|
|
324
324
|
let i = [];
|
|
325
325
|
return s.selectors ? i = n(s) : r && (i = Array.from(r.children).filter((d) => A(d) && k(d))), i;
|
|
326
326
|
}, a = (s) => (r) => {
|
|
327
|
-
const i =
|
|
328
|
-
if (
|
|
329
|
-
const d = s.handlers ||
|
|
327
|
+
const i = lt[r.key] || r.key.toLowerCase();
|
|
328
|
+
if (j.includes(i)) return;
|
|
329
|
+
const d = s.handlers || se;
|
|
330
330
|
for (const u of Object.keys(d)) {
|
|
331
331
|
const [p, ...c] = u.split(".");
|
|
332
332
|
if (p === "keydown" && c.includes(i)) {
|
|
333
|
-
const m = d[u],
|
|
334
|
-
const
|
|
335
|
-
return r.getModifierState(
|
|
333
|
+
const m = d[u], w = c.filter((y) => j.includes(y)), v = j.some((y) => {
|
|
334
|
+
const _ = y.charAt(0).toUpperCase() + y.slice(1);
|
|
335
|
+
return r.getModifierState(_);
|
|
336
336
|
});
|
|
337
|
-
if (
|
|
337
|
+
if (w.length > 0) {
|
|
338
338
|
if (v) {
|
|
339
|
-
for (const
|
|
340
|
-
if (c.includes(
|
|
341
|
-
const
|
|
342
|
-
r.getModifierState(
|
|
339
|
+
for (const y of j)
|
|
340
|
+
if (c.includes(y)) {
|
|
341
|
+
const _ = y.charAt(0).toUpperCase() + y.slice(1);
|
|
342
|
+
r.getModifierState(_) && m(r);
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
345
|
} else
|
|
@@ -347,22 +347,22 @@ function ae(t) {
|
|
|
347
347
|
}
|
|
348
348
|
}
|
|
349
349
|
}, l = [];
|
|
350
|
-
|
|
350
|
+
xe(() => {
|
|
351
351
|
for (const s of t) {
|
|
352
352
|
const r = e(s), i = o(s), d = a(s), u = r ? [r] : i;
|
|
353
353
|
for (const p of u) {
|
|
354
|
-
const { focused: c } =
|
|
355
|
-
|
|
354
|
+
const { focused: c } = et(x(p)), m = S(c, (w) => {
|
|
355
|
+
w ? p.addEventListener("keydown", d) : p.removeEventListener("keydown", d);
|
|
356
356
|
});
|
|
357
357
|
l.push(m);
|
|
358
358
|
}
|
|
359
359
|
}
|
|
360
|
-
}),
|
|
360
|
+
}), He(() => {
|
|
361
361
|
for (const s of l)
|
|
362
362
|
s();
|
|
363
363
|
});
|
|
364
364
|
}
|
|
365
|
-
const
|
|
365
|
+
const rt = ["data-colindex", "data-rowindex", "data-editable", "contenteditable", "tabindex"], at = { key: 1 }, Se = /* @__PURE__ */ D({
|
|
366
366
|
__name: "ACell",
|
|
367
367
|
props: {
|
|
368
368
|
colIndex: {},
|
|
@@ -372,12 +372,12 @@ const ot = ["data-colindex", "data-rowindex", "data-editable", "contenteditable"
|
|
|
372
372
|
tabIndex: { default: 0 }
|
|
373
373
|
},
|
|
374
374
|
setup(t) {
|
|
375
|
-
var
|
|
376
|
-
const e = t, n =
|
|
375
|
+
var w;
|
|
376
|
+
const e = t, n = F(e.tableid), o = x(null), a = x(""), l = x(!1), s = E(() => {
|
|
377
377
|
const v = n.cellData(e.colIndex, e.rowIndex);
|
|
378
378
|
if (n.columns[e.colIndex].format) {
|
|
379
|
-
const
|
|
380
|
-
return typeof
|
|
379
|
+
const y = n.table, _ = n.rows[e.rowIndex], G = n.columns[e.colIndex], H = G.format;
|
|
380
|
+
return typeof H == "function" ? H(v, { table: y, row: _, column: G }) : typeof H == "string" ? Function(`"use strict";return (${H})`)()(v, { table: y, row: _, column: G }) : v;
|
|
381
381
|
} else
|
|
382
382
|
return v;
|
|
383
383
|
}), r = () => {
|
|
@@ -388,7 +388,7 @@ const ot = ["data-colindex", "data-rowindex", "data-editable", "contenteditable"
|
|
|
388
388
|
};
|
|
389
389
|
if (e.addNavigation) {
|
|
390
390
|
let v = {
|
|
391
|
-
...
|
|
391
|
+
...se,
|
|
392
392
|
"keydown.f2": r,
|
|
393
393
|
"keydown.alt.up": r,
|
|
394
394
|
"keydown.alt.down": r,
|
|
@@ -398,7 +398,7 @@ const ot = ["data-colindex", "data-rowindex", "data-editable", "contenteditable"
|
|
|
398
398
|
typeof e.addNavigation == "object" && (v = {
|
|
399
399
|
...v,
|
|
400
400
|
...e.addNavigation
|
|
401
|
-
}),
|
|
401
|
+
}), ie([
|
|
402
402
|
{
|
|
403
403
|
selectors: o,
|
|
404
404
|
handlers: v
|
|
@@ -409,14 +409,14 @@ const ot = ["data-colindex", "data-rowindex", "data-editable", "contenteditable"
|
|
|
409
409
|
o.value && (a.value = o.value.textContent);
|
|
410
410
|
}, p = () => {
|
|
411
411
|
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));
|
|
412
|
-
}, c = (v,
|
|
412
|
+
}, c = (v, y) => y && v === 0 && y > 0 ? `${y}ch` : "inherit", m = {
|
|
413
413
|
textAlign: i.value,
|
|
414
414
|
width: d.value,
|
|
415
415
|
backgroundColor: l.value ? "var(--cell-modified-color)" : "inherit",
|
|
416
416
|
fontWeight: l.value ? "bold" : "inherit",
|
|
417
|
-
paddingLeft: c(e.colIndex, (
|
|
417
|
+
paddingLeft: c(e.colIndex, (w = n.display[e.rowIndex]) == null ? void 0 : w.indent)
|
|
418
418
|
};
|
|
419
|
-
return (v,
|
|
419
|
+
return (v, y) => (h(), b("td", {
|
|
420
420
|
ref_key: "cell",
|
|
421
421
|
ref: o,
|
|
422
422
|
"data-colindex": v.colIndex,
|
|
@@ -434,13 +434,13 @@ const ot = ["data-colindex", "data-rowindex", "data-editable", "contenteditable"
|
|
|
434
434
|
onMousedown: r,
|
|
435
435
|
class: "atable__cell"
|
|
436
436
|
}, [
|
|
437
|
-
f(n).columns[v.colIndex].cellComponent ? (
|
|
437
|
+
f(n).columns[v.colIndex].cellComponent ? (h(), N(ke(f(n).columns[v.colIndex].cellComponent), te({
|
|
438
438
|
key: 0,
|
|
439
439
|
value: s.value
|
|
440
|
-
}, f(n).columns[v.colIndex].cellComponentProps), null, 16, ["value"])) : (
|
|
441
|
-
], 40,
|
|
440
|
+
}, f(n).columns[v.colIndex].cellComponentProps), null, 16, ["value"])) : (h(), b("span", at, M(s.value), 1))
|
|
441
|
+
], 40, rt));
|
|
442
442
|
}
|
|
443
|
-
}),
|
|
443
|
+
}), st = ["tabindex"], it = ["tabindex"], dt = ["colspan"], ct = /* @__PURE__ */ D({
|
|
444
444
|
__name: "AExpansionRow",
|
|
445
445
|
props: {
|
|
446
446
|
row: {},
|
|
@@ -450,56 +450,56 @@ const ot = ["data-colindex", "data-rowindex", "data-editable", "contenteditable"
|
|
|
450
450
|
addNavigation: { type: [Boolean, Object] }
|
|
451
451
|
},
|
|
452
452
|
setup(t) {
|
|
453
|
-
const e = t, n =
|
|
453
|
+
const e = t, n = F(e.tableid), o = x(null), a = x(null), l = E(() => n.display[e.rowIndex].expanded ? "▼" : "►");
|
|
454
454
|
if (e.addNavigation) {
|
|
455
455
|
const s = {
|
|
456
456
|
"keydown.control.g": (r) => {
|
|
457
457
|
r.stopPropagation(), r.preventDefault(), n.toggleRowExpand(e.rowIndex);
|
|
458
458
|
}
|
|
459
459
|
};
|
|
460
|
-
typeof e.addNavigation == "object" && Object.assign(s, e.addNavigation),
|
|
460
|
+
typeof e.addNavigation == "object" && Object.assign(s, e.addNavigation), ie([
|
|
461
461
|
{
|
|
462
462
|
selectors: o,
|
|
463
463
|
handlers: s
|
|
464
464
|
}
|
|
465
465
|
]);
|
|
466
466
|
}
|
|
467
|
-
return (s, r) => (
|
|
468
|
-
|
|
467
|
+
return (s, r) => (h(), b(B, null, [
|
|
468
|
+
O("tr", te(s.$attrs, {
|
|
469
469
|
ref_key: "rowEl",
|
|
470
470
|
ref: o,
|
|
471
471
|
tabindex: s.tabIndex,
|
|
472
472
|
class: "expandable-row"
|
|
473
473
|
}), [
|
|
474
|
-
|
|
474
|
+
O("td", {
|
|
475
475
|
tabIndex: -1,
|
|
476
476
|
onClick: r[0] || (r[0] = (i) => f(n).toggleRowExpand(s.rowIndex)),
|
|
477
477
|
class: "row-index"
|
|
478
|
-
},
|
|
478
|
+
}, M(l.value), 1),
|
|
479
479
|
I(s.$slots, "row")
|
|
480
|
-
], 16,
|
|
481
|
-
f(n).display[e.rowIndex].expanded ? (
|
|
480
|
+
], 16, st),
|
|
481
|
+
f(n).display[e.rowIndex].expanded ? (h(), b("tr", {
|
|
482
482
|
key: 0,
|
|
483
483
|
ref_key: "rowExpanded",
|
|
484
484
|
ref: a,
|
|
485
485
|
tabindex: s.tabIndex,
|
|
486
486
|
class: "expanded-row"
|
|
487
487
|
}, [
|
|
488
|
-
|
|
488
|
+
O("td", {
|
|
489
489
|
tabIndex: -1,
|
|
490
490
|
colspan: f(n).columns.length + 1,
|
|
491
491
|
class: "expanded-row-content"
|
|
492
492
|
}, [
|
|
493
493
|
I(s.$slots, "content")
|
|
494
|
-
], 8,
|
|
495
|
-
], 8,
|
|
494
|
+
], 8, dt)
|
|
495
|
+
], 8, it)) : z("", !0)
|
|
496
496
|
], 64));
|
|
497
497
|
}
|
|
498
|
-
}),
|
|
498
|
+
}), ut = ["tabindex"], ft = {
|
|
499
499
|
key: 0,
|
|
500
500
|
tabIndex: -1,
|
|
501
501
|
class: "list-index"
|
|
502
|
-
},
|
|
502
|
+
}, _e = /* @__PURE__ */ D({
|
|
503
503
|
__name: "ARow",
|
|
504
504
|
props: {
|
|
505
505
|
row: {},
|
|
@@ -509,112 +509,112 @@ const ot = ["data-colindex", "data-rowindex", "data-editable", "contenteditable"
|
|
|
509
509
|
addNavigation: { type: [Boolean, Object], default: !1 }
|
|
510
510
|
},
|
|
511
511
|
setup(t) {
|
|
512
|
-
const e = t, n =
|
|
512
|
+
const e = t, n = F(e.tableid), o = x(null), a = E(() => n.config.view !== "tree" || n.display[e.rowIndex].isRoot || n.display[e.rowIndex].open), l = E(() => n.config.view !== "tree" ? "" : n.display[e.rowIndex].isRoot || n.display[e.rowIndex].isParent ? n.display[e.rowIndex].childrenOpen ? "-" : "+" : ""), s = (r) => {
|
|
513
513
|
n.toggleRowExpand(r);
|
|
514
514
|
};
|
|
515
515
|
if (e.addNavigation) {
|
|
516
|
-
let r =
|
|
516
|
+
let r = se;
|
|
517
517
|
typeof e.addNavigation == "object" && (r = {
|
|
518
518
|
...r,
|
|
519
519
|
...e.addNavigation
|
|
520
|
-
}),
|
|
520
|
+
}), ie([
|
|
521
521
|
{
|
|
522
522
|
selectors: o,
|
|
523
523
|
handlers: r
|
|
524
524
|
}
|
|
525
525
|
]);
|
|
526
526
|
}
|
|
527
|
-
return (r, i) =>
|
|
527
|
+
return (r, i) => Q((h(), b("tr", {
|
|
528
528
|
ref_key: "rowEl",
|
|
529
529
|
ref: o,
|
|
530
530
|
tabindex: r.tabIndex,
|
|
531
531
|
class: "table-row"
|
|
532
532
|
}, [
|
|
533
533
|
I(r.$slots, "index", {}, () => [
|
|
534
|
-
f(n).config.view === "list" ? (
|
|
534
|
+
f(n).config.view === "list" ? (h(), b("td", ft, M(r.rowIndex + 1), 1)) : f(n).config.view === "tree" ? (h(), b("td", {
|
|
535
535
|
key: 1,
|
|
536
536
|
tabIndex: -1,
|
|
537
537
|
class: "tree-index",
|
|
538
538
|
onClick: i[0] || (i[0] = (d) => s(r.rowIndex))
|
|
539
|
-
},
|
|
539
|
+
}, M(l.value), 1)) : z("", !0)
|
|
540
540
|
]),
|
|
541
541
|
I(r.$slots, "default")
|
|
542
|
-
], 8,
|
|
543
|
-
[
|
|
542
|
+
], 8, ut)), [
|
|
543
|
+
[Ae, a.value]
|
|
544
544
|
]);
|
|
545
545
|
}
|
|
546
546
|
});
|
|
547
|
-
function
|
|
548
|
-
return
|
|
547
|
+
function De(t) {
|
|
548
|
+
return Ee() ? (Ie(t), !0) : !1;
|
|
549
549
|
}
|
|
550
|
-
function
|
|
550
|
+
function R(t) {
|
|
551
551
|
return typeof t == "function" ? t() : f(t);
|
|
552
552
|
}
|
|
553
|
-
const
|
|
553
|
+
const Te = typeof window < "u" && typeof document < "u";
|
|
554
554
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
555
|
-
const
|
|
556
|
-
},
|
|
557
|
-
function
|
|
555
|
+
const pt = Object.prototype.toString, mt = (t) => pt.call(t) === "[object Object]", L = () => {
|
|
556
|
+
}, ee = /* @__PURE__ */ vt();
|
|
557
|
+
function vt() {
|
|
558
558
|
var t, e;
|
|
559
|
-
return
|
|
559
|
+
return Te && ((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));
|
|
560
560
|
}
|
|
561
|
-
const
|
|
561
|
+
const he = {
|
|
562
562
|
mounted: "mounted",
|
|
563
563
|
updated: "updated",
|
|
564
564
|
unmounted: "unmounted"
|
|
565
565
|
};
|
|
566
|
-
function
|
|
566
|
+
function wt(...t) {
|
|
567
567
|
if (t.length !== 1)
|
|
568
|
-
return
|
|
568
|
+
return We(...t);
|
|
569
569
|
const e = t[0];
|
|
570
|
-
return typeof e == "function" ?
|
|
570
|
+
return typeof e == "function" ? Ne(Ue(() => ({ get: e, set: L }))) : x(e);
|
|
571
571
|
}
|
|
572
|
-
function
|
|
572
|
+
function $(t) {
|
|
573
573
|
var e;
|
|
574
|
-
const n =
|
|
574
|
+
const n = R(t);
|
|
575
575
|
return (e = n == null ? void 0 : n.$el) != null ? e : n;
|
|
576
576
|
}
|
|
577
|
-
const
|
|
578
|
-
function
|
|
577
|
+
const $e = Te ? window : void 0;
|
|
578
|
+
function V(...t) {
|
|
579
579
|
let e, n, o, a;
|
|
580
|
-
if (typeof t[0] == "string" || Array.isArray(t[0]) ? ([n, o, a] = t, e =
|
|
581
|
-
return
|
|
580
|
+
if (typeof t[0] == "string" || Array.isArray(t[0]) ? ([n, o, a] = t, e = $e) : [e, n, o, a] = t, !e)
|
|
581
|
+
return L;
|
|
582
582
|
Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
|
|
583
583
|
const l = [], s = () => {
|
|
584
584
|
l.forEach((u) => u()), l.length = 0;
|
|
585
585
|
}, r = (u, p, c, m) => (u.addEventListener(p, c, m), () => u.removeEventListener(p, c, m)), i = S(
|
|
586
|
-
() => [
|
|
586
|
+
() => [$(e), R(a)],
|
|
587
587
|
([u, p]) => {
|
|
588
588
|
if (s(), !u)
|
|
589
589
|
return;
|
|
590
|
-
const c =
|
|
590
|
+
const c = mt(p) ? { ...p } : p;
|
|
591
591
|
l.push(
|
|
592
|
-
...n.flatMap((m) => o.map((
|
|
592
|
+
...n.flatMap((m) => o.map((w) => r(u, m, w, c)))
|
|
593
593
|
);
|
|
594
594
|
},
|
|
595
595
|
{ immediate: !0, flush: "post" }
|
|
596
596
|
), d = () => {
|
|
597
597
|
i(), s();
|
|
598
598
|
};
|
|
599
|
-
return
|
|
599
|
+
return De(d), d;
|
|
600
600
|
}
|
|
601
|
-
let
|
|
602
|
-
function
|
|
603
|
-
const { window: o =
|
|
601
|
+
let ge = !1;
|
|
602
|
+
function ye(t, e, n = {}) {
|
|
603
|
+
const { window: o = $e, ignore: a = [], capture: l = !0, detectIframe: s = !1 } = n;
|
|
604
604
|
if (!o)
|
|
605
|
-
return
|
|
606
|
-
|
|
605
|
+
return L;
|
|
606
|
+
ee && !ge && (ge = !0, Array.from(o.document.body.children).forEach((c) => c.addEventListener("click", L)), o.document.documentElement.addEventListener("click", L));
|
|
607
607
|
let r = !0;
|
|
608
608
|
const i = (c) => a.some((m) => {
|
|
609
609
|
if (typeof m == "string")
|
|
610
|
-
return Array.from(o.document.querySelectorAll(m)).some((
|
|
610
|
+
return Array.from(o.document.querySelectorAll(m)).some((w) => w === c.target || c.composedPath().includes(w));
|
|
611
611
|
{
|
|
612
|
-
const
|
|
613
|
-
return
|
|
612
|
+
const w = $(m);
|
|
613
|
+
return w && (c.target === w || c.composedPath().includes(w));
|
|
614
614
|
}
|
|
615
615
|
}), u = [
|
|
616
|
-
|
|
617
|
-
const m =
|
|
616
|
+
V(o, "click", (c) => {
|
|
617
|
+
const m = $(t);
|
|
618
618
|
if (!(!m || m === c.target || c.composedPath().includes(m))) {
|
|
619
619
|
if (c.detail === 0 && (r = !i(c)), !r) {
|
|
620
620
|
r = !0;
|
|
@@ -623,59 +623,59 @@ function we(t, e, n = {}) {
|
|
|
623
623
|
e(c);
|
|
624
624
|
}
|
|
625
625
|
}, { passive: !0, capture: l }),
|
|
626
|
-
|
|
627
|
-
const m =
|
|
626
|
+
V(o, "pointerdown", (c) => {
|
|
627
|
+
const m = $(t);
|
|
628
628
|
r = !i(c) && !!(m && !c.composedPath().includes(m));
|
|
629
629
|
}, { passive: !0 }),
|
|
630
|
-
s &&
|
|
630
|
+
s && V(o, "blur", (c) => {
|
|
631
631
|
setTimeout(() => {
|
|
632
632
|
var m;
|
|
633
|
-
const
|
|
634
|
-
((m = o.document.activeElement) == null ? void 0 : m.tagName) === "IFRAME" && !(
|
|
633
|
+
const w = $(t);
|
|
634
|
+
((m = o.document.activeElement) == null ? void 0 : m.tagName) === "IFRAME" && !(w != null && w.contains(o.document.activeElement)) && e(c);
|
|
635
635
|
}, 0);
|
|
636
636
|
})
|
|
637
637
|
].filter(Boolean);
|
|
638
638
|
return () => u.forEach((c) => c());
|
|
639
639
|
}
|
|
640
|
-
const
|
|
641
|
-
[
|
|
640
|
+
const ht = {
|
|
641
|
+
[he.mounted](t, e) {
|
|
642
642
|
const n = !e.modifiers.bubble;
|
|
643
643
|
if (typeof e.value == "function")
|
|
644
|
-
t.__onClickOutside_stop =
|
|
644
|
+
t.__onClickOutside_stop = ye(t, e.value, { capture: n });
|
|
645
645
|
else {
|
|
646
646
|
const [o, a] = e.value;
|
|
647
|
-
t.__onClickOutside_stop =
|
|
647
|
+
t.__onClickOutside_stop = ye(t, o, Object.assign({ capture: n }, a));
|
|
648
648
|
}
|
|
649
649
|
},
|
|
650
|
-
[
|
|
650
|
+
[he.unmounted](t) {
|
|
651
651
|
t.__onClickOutside_stop();
|
|
652
652
|
}
|
|
653
653
|
};
|
|
654
|
-
function
|
|
654
|
+
function Y(t) {
|
|
655
655
|
return typeof Window < "u" && t instanceof Window ? t.document.documentElement : typeof Document < "u" && t instanceof Document ? t.documentElement : t;
|
|
656
656
|
}
|
|
657
|
-
function
|
|
657
|
+
function Oe(t) {
|
|
658
658
|
const e = window.getComputedStyle(t);
|
|
659
659
|
if (e.overflowX === "scroll" || e.overflowY === "scroll" || e.overflowX === "auto" && t.clientWidth < t.scrollWidth || e.overflowY === "auto" && t.clientHeight < t.scrollHeight)
|
|
660
660
|
return !0;
|
|
661
661
|
{
|
|
662
662
|
const n = t.parentNode;
|
|
663
|
-
return !n || n.tagName === "BODY" ? !1 :
|
|
663
|
+
return !n || n.tagName === "BODY" ? !1 : Oe(n);
|
|
664
664
|
}
|
|
665
665
|
}
|
|
666
|
-
function
|
|
666
|
+
function gt(t) {
|
|
667
667
|
const e = t || window.event, n = e.target;
|
|
668
|
-
return
|
|
668
|
+
return Oe(n) ? !1 : e.touches.length > 1 ? !0 : (e.preventDefault && e.preventDefault(), !1);
|
|
669
669
|
}
|
|
670
|
-
const
|
|
671
|
-
function
|
|
670
|
+
const X = /* @__PURE__ */ new WeakMap();
|
|
671
|
+
function yt(t, e = !1) {
|
|
672
672
|
const n = x(e);
|
|
673
673
|
let o = null, a = "";
|
|
674
|
-
S(
|
|
675
|
-
const i =
|
|
674
|
+
S(wt(t), (r) => {
|
|
675
|
+
const i = Y(R(r));
|
|
676
676
|
if (i) {
|
|
677
677
|
const d = i;
|
|
678
|
-
if (
|
|
678
|
+
if (X.get(d) || X.set(d, d.style.overflow), d.style.overflow !== "hidden" && (a = d.style.overflow), d.style.overflow === "hidden")
|
|
679
679
|
return n.value = !0;
|
|
680
680
|
if (n.value)
|
|
681
681
|
return d.style.overflow = "hidden";
|
|
@@ -684,20 +684,20 @@ function wt(t, e = !1) {
|
|
|
684
684
|
immediate: !0
|
|
685
685
|
});
|
|
686
686
|
const l = () => {
|
|
687
|
-
const r =
|
|
688
|
-
!r || n.value || (
|
|
687
|
+
const r = Y(R(t));
|
|
688
|
+
!r || n.value || (ee && (o = V(
|
|
689
689
|
r,
|
|
690
690
|
"touchmove",
|
|
691
691
|
(i) => {
|
|
692
|
-
|
|
692
|
+
gt(i);
|
|
693
693
|
},
|
|
694
694
|
{ passive: !1 }
|
|
695
695
|
)), r.style.overflow = "hidden", n.value = !0);
|
|
696
696
|
}, s = () => {
|
|
697
|
-
const r =
|
|
698
|
-
!r || !n.value || (
|
|
697
|
+
const r = Y(R(t));
|
|
698
|
+
!r || !n.value || (ee && (o == null || o()), r.style.overflow = a, X.delete(r), n.value = !1);
|
|
699
699
|
};
|
|
700
|
-
return
|
|
700
|
+
return De(s), E({
|
|
701
701
|
get() {
|
|
702
702
|
return n.value;
|
|
703
703
|
},
|
|
@@ -706,48 +706,48 @@ function wt(t, e = !1) {
|
|
|
706
706
|
}
|
|
707
707
|
});
|
|
708
708
|
}
|
|
709
|
-
function
|
|
709
|
+
function bt() {
|
|
710
710
|
let t = !1;
|
|
711
711
|
const e = x(!1);
|
|
712
712
|
return (n, o) => {
|
|
713
713
|
if (e.value = o.value, t)
|
|
714
714
|
return;
|
|
715
715
|
t = !0;
|
|
716
|
-
const a =
|
|
716
|
+
const a = yt(n, o.value);
|
|
717
717
|
S(e, (l) => a.value = l);
|
|
718
718
|
};
|
|
719
719
|
}
|
|
720
|
-
|
|
721
|
-
var
|
|
722
|
-
for (var
|
|
723
|
-
|
|
724
|
-
function
|
|
725
|
-
return (
|
|
720
|
+
bt();
|
|
721
|
+
var g = [];
|
|
722
|
+
for (var J = 0; J < 256; ++J)
|
|
723
|
+
g.push((J + 256).toString(16).slice(1));
|
|
724
|
+
function xt(t, e = 0) {
|
|
725
|
+
return (g[t[e + 0]] + g[t[e + 1]] + g[t[e + 2]] + g[t[e + 3]] + "-" + g[t[e + 4]] + g[t[e + 5]] + "-" + g[t[e + 6]] + g[t[e + 7]] + "-" + g[t[e + 8]] + g[t[e + 9]] + "-" + g[t[e + 10]] + g[t[e + 11]] + g[t[e + 12]] + g[t[e + 13]] + g[t[e + 14]] + g[t[e + 15]]).toLowerCase();
|
|
726
726
|
}
|
|
727
|
-
var
|
|
728
|
-
function
|
|
729
|
-
if (!
|
|
727
|
+
var W, Et = new Uint8Array(16);
|
|
728
|
+
function It() {
|
|
729
|
+
if (!W && (W = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !W))
|
|
730
730
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
731
|
-
return
|
|
731
|
+
return W(Et);
|
|
732
732
|
}
|
|
733
|
-
var
|
|
734
|
-
const
|
|
735
|
-
randomUUID:
|
|
733
|
+
var kt = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
734
|
+
const be = {
|
|
735
|
+
randomUUID: kt
|
|
736
736
|
};
|
|
737
|
-
function
|
|
738
|
-
if (
|
|
739
|
-
return
|
|
737
|
+
function At(t, e, n) {
|
|
738
|
+
if (be.randomUUID && !e && !t)
|
|
739
|
+
return be.randomUUID();
|
|
740
740
|
t = t || {};
|
|
741
|
-
var o = t.random || (t.rng ||
|
|
741
|
+
var o = t.random || (t.rng || It)();
|
|
742
742
|
if (o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, e) {
|
|
743
743
|
n = n || 0;
|
|
744
744
|
for (var a = 0; a < 16; ++a)
|
|
745
745
|
e[n + a] = o[a];
|
|
746
746
|
return e;
|
|
747
747
|
}
|
|
748
|
-
return
|
|
748
|
+
return xt(o);
|
|
749
749
|
}
|
|
750
|
-
class
|
|
750
|
+
class Ct {
|
|
751
751
|
constructor(e, n, o, a, l, s) {
|
|
752
752
|
C(this, "id");
|
|
753
753
|
C(this, "rows");
|
|
@@ -756,7 +756,7 @@ class kt {
|
|
|
756
756
|
C(this, "table");
|
|
757
757
|
C(this, "display");
|
|
758
758
|
C(this, "modal");
|
|
759
|
-
this.id = e ||
|
|
759
|
+
this.id = e || At(), this.rows = o, this.columns = T(n), this.config = T(a), this.table = l || T(this.createTableObject()), this.display = this.createDisplayObject(s), this.modal = T({ visible: !1 });
|
|
760
760
|
}
|
|
761
761
|
createTableObject() {
|
|
762
762
|
const e = {};
|
|
@@ -783,7 +783,7 @@ class kt {
|
|
|
783
783
|
parent: l.parent
|
|
784
784
|
};
|
|
785
785
|
}
|
|
786
|
-
return
|
|
786
|
+
return T(n);
|
|
787
787
|
}
|
|
788
788
|
get zeroColumn() {
|
|
789
789
|
return ["list", "tree", "list-expansion"].includes(this.config.view);
|
|
@@ -807,16 +807,16 @@ class kt {
|
|
|
807
807
|
} else this.config.view === "list-expansion" && (this.display[e].expanded = !this.display[e].expanded);
|
|
808
808
|
}
|
|
809
809
|
}
|
|
810
|
-
const
|
|
810
|
+
const St = {
|
|
811
811
|
key: 0,
|
|
812
812
|
id: "resizable"
|
|
813
|
-
},
|
|
813
|
+
}, _t = {
|
|
814
814
|
class: "atable-header-row",
|
|
815
815
|
tabindex: "-1"
|
|
816
|
-
},
|
|
816
|
+
}, Dt = {
|
|
817
817
|
key: 0,
|
|
818
818
|
id: "header-index"
|
|
819
|
-
},
|
|
819
|
+
}, Re = /* @__PURE__ */ D({
|
|
820
820
|
__name: "ATableHeader",
|
|
821
821
|
props: {
|
|
822
822
|
columns: {},
|
|
@@ -824,27 +824,27 @@ const At = {
|
|
|
824
824
|
tableid: {}
|
|
825
825
|
},
|
|
826
826
|
setup(t) {
|
|
827
|
-
const n =
|
|
827
|
+
const n = F(t.tableid), o = (a) => ({
|
|
828
828
|
minWidth: a.width || "40ch",
|
|
829
829
|
textAlign: a.align || "center",
|
|
830
830
|
width: n.config.fullWidth ? "auto" : null
|
|
831
831
|
});
|
|
832
|
-
return (a, l) => a.columns.length ? (
|
|
833
|
-
|
|
834
|
-
f(n).zeroColumn ? (
|
|
835
|
-
(
|
|
832
|
+
return (a, l) => a.columns.length ? (h(), b("thead", St, [
|
|
833
|
+
O("tr", _t, [
|
|
834
|
+
f(n).zeroColumn ? (h(), b("th", Dt)) : z("", !0),
|
|
835
|
+
(h(!0), b(B, null, Z(a.columns, (s, r) => (h(), b("th", {
|
|
836
836
|
key: s.name,
|
|
837
837
|
tabindex: "-1",
|
|
838
|
-
style:
|
|
838
|
+
style: U(o(s))
|
|
839
839
|
}, [
|
|
840
840
|
I(a.$slots, "default", {}, () => [
|
|
841
|
-
|
|
841
|
+
Ve(M(s.label || String.fromCharCode(r + 97).toUpperCase()), 1)
|
|
842
842
|
])
|
|
843
843
|
], 4))), 128))
|
|
844
844
|
])
|
|
845
|
-
])) :
|
|
845
|
+
])) : z("", !0);
|
|
846
846
|
}
|
|
847
|
-
}),
|
|
847
|
+
}), Le = /* @__PURE__ */ D({
|
|
848
848
|
__name: "ATableModal",
|
|
849
849
|
props: {
|
|
850
850
|
colIndex: {},
|
|
@@ -855,7 +855,7 @@ const At = {
|
|
|
855
855
|
const e = (n) => {
|
|
856
856
|
n.stopPropagation();
|
|
857
857
|
};
|
|
858
|
-
return (n, o) => (
|
|
858
|
+
return (n, o) => (h(), b("div", {
|
|
859
859
|
ref: "amodal",
|
|
860
860
|
class: "amodal",
|
|
861
861
|
tabindex: "-1",
|
|
@@ -865,7 +865,7 @@ const At = {
|
|
|
865
865
|
I(n.$slots, "default")
|
|
866
866
|
], 544));
|
|
867
867
|
}
|
|
868
|
-
}),
|
|
868
|
+
}), Tt = /* @__PURE__ */ D({
|
|
869
869
|
__name: "ATable",
|
|
870
870
|
props: {
|
|
871
871
|
id: {},
|
|
@@ -878,8 +878,8 @@ const At = {
|
|
|
878
878
|
emits: ["update:modelValue"],
|
|
879
879
|
setup(t, { emit: e }) {
|
|
880
880
|
const n = t, o = e;
|
|
881
|
-
let a = n.modelValue ? n.modelValue : n.rows, l = new
|
|
882
|
-
|
|
881
|
+
let a = n.modelValue ? n.modelValue : n.rows, l = new Ct(n.id, n.columns, a, n.config);
|
|
882
|
+
Be(l.id, l), S(
|
|
883
883
|
() => l.rows,
|
|
884
884
|
(r) => {
|
|
885
885
|
o("update:modelValue", r);
|
|
@@ -894,31 +894,31 @@ const At = {
|
|
|
894
894
|
if (r.key === "Escape" && l.modal.visible) {
|
|
895
895
|
l.modal.visible = !1;
|
|
896
896
|
const i = l.modal.parent;
|
|
897
|
-
i &&
|
|
897
|
+
i && ze().then(() => {
|
|
898
898
|
i.focus();
|
|
899
899
|
});
|
|
900
900
|
}
|
|
901
|
-
}), (r, i) =>
|
|
901
|
+
}), (r, i) => Q((h(), b("table", {
|
|
902
902
|
class: "atable",
|
|
903
|
-
style:
|
|
903
|
+
style: U({ width: f(l).config.fullWidth ? "100%" : "auto" })
|
|
904
904
|
}, [
|
|
905
905
|
I(r.$slots, "header", { data: f(l) }, () => [
|
|
906
|
-
|
|
906
|
+
de(Re, {
|
|
907
907
|
columns: f(l).columns,
|
|
908
908
|
config: f(l).config,
|
|
909
909
|
tableid: f(l).id
|
|
910
910
|
}, null, 8, ["columns", "config", "tableid"])
|
|
911
911
|
]),
|
|
912
|
-
|
|
912
|
+
O("tbody", null, [
|
|
913
913
|
I(r.$slots, "body", { data: f(l) }, () => [
|
|
914
|
-
(
|
|
914
|
+
(h(!0), b(B, null, Z(f(l).rows, (d, u) => (h(), N(_e, {
|
|
915
915
|
key: d.id,
|
|
916
916
|
row: d,
|
|
917
917
|
rowIndex: u,
|
|
918
918
|
tableid: f(l).id
|
|
919
919
|
}, {
|
|
920
|
-
default:
|
|
921
|
-
(
|
|
920
|
+
default: ce(() => [
|
|
921
|
+
(h(!0), b(B, null, Z(f(l).columns, (p, c) => (h(), N(Se, {
|
|
922
922
|
key: p.name,
|
|
923
923
|
tableid: f(l).id,
|
|
924
924
|
col: p,
|
|
@@ -926,7 +926,7 @@ const At = {
|
|
|
926
926
|
rowIndex: u,
|
|
927
927
|
colIndex: c + (f(l).zeroColumn ? 0 : -1),
|
|
928
928
|
component: p.cellComponent,
|
|
929
|
-
style:
|
|
929
|
+
style: U({
|
|
930
930
|
textAlign: (p == null ? void 0 : p.align) || "center",
|
|
931
931
|
minWidth: (p == null ? void 0 : p.width) || "40ch",
|
|
932
932
|
width: f(l).config.fullWidth ? "auto" : null
|
|
@@ -939,18 +939,18 @@ const At = {
|
|
|
939
939
|
]),
|
|
940
940
|
I(r.$slots, "footer", { data: f(l) }),
|
|
941
941
|
I(r.$slots, "modal", { data: f(l) }, () => [
|
|
942
|
-
|
|
942
|
+
Q(de(Le, {
|
|
943
943
|
colIndex: f(l).modal.colIndex,
|
|
944
944
|
rowIndex: f(l).modal.rowIndex,
|
|
945
945
|
tableid: f(l).id,
|
|
946
|
-
style:
|
|
946
|
+
style: U({
|
|
947
947
|
left: f(l).modal.left + "px",
|
|
948
948
|
top: f(l).modal.top + "px",
|
|
949
949
|
maxWidth: f(l).modal.width + "px"
|
|
950
950
|
})
|
|
951
951
|
}, {
|
|
952
|
-
default:
|
|
953
|
-
(
|
|
952
|
+
default: ce(() => [
|
|
953
|
+
(h(), N(ke(f(l).modal.component), te({
|
|
954
954
|
key: `${f(l).modal.rowIndex}:${f(l).modal.colIndex}`,
|
|
955
955
|
colIndex: f(l).modal.colIndex,
|
|
956
956
|
rowIndex: f(l).modal.rowIndex,
|
|
@@ -959,25 +959,25 @@ const At = {
|
|
|
959
959
|
]),
|
|
960
960
|
_: 1
|
|
961
961
|
}, 8, ["colIndex", "rowIndex", "tableid", "style"]), [
|
|
962
|
-
[
|
|
962
|
+
[Ae, f(l).modal.visible]
|
|
963
963
|
])
|
|
964
964
|
])
|
|
965
965
|
], 4)), [
|
|
966
|
-
[f(
|
|
966
|
+
[f(ht), s]
|
|
967
967
|
]);
|
|
968
968
|
}
|
|
969
969
|
});
|
|
970
|
-
function
|
|
971
|
-
t.component("ACell",
|
|
970
|
+
function Lt(t) {
|
|
971
|
+
t.component("ACell", Se), t.component("AExpansionRow", ct), t.component("ARow", _e), t.component("ATable", Tt), t.component("ATableHeader", Re), t.component("ATableModal", Le);
|
|
972
972
|
}
|
|
973
973
|
export {
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
974
|
+
Se as ACell,
|
|
975
|
+
ct as AExpansionRow,
|
|
976
|
+
_e as ARow,
|
|
977
|
+
Tt as ATable,
|
|
978
|
+
Re as ATableHeader,
|
|
979
|
+
Le as ATableModal,
|
|
980
|
+
Ct as TableDataStore,
|
|
981
|
+
Lt as install
|
|
982
982
|
};
|
|
983
983
|
//# sourceMappingURL=atable.js.map
|