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