@stonecrop/atable 0.2.39 → 0.2.41
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 +704 -547
- 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/types/index.d.ts +1 -0
- 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 +20 -17
- package/src/components/AExpansionRow.vue +0 -3
- package/src/components/ARow.vue +8 -4
- package/src/components/ATable.vue +50 -3
- package/src/components/ATableHeader.vue +10 -3
- package/src/types/index.ts +1 -0
package/dist/atable.js
CHANGED
|
@@ -1,789 +1,928 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { onMounted as
|
|
5
|
-
function
|
|
6
|
-
return
|
|
1
|
+
var qe = Object.defineProperty;
|
|
2
|
+
var Ye = (e, t, n) => t in e ? qe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var O = (e, t, n) => Ye(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import { onMounted as B, ref as g, watch as A, onBeforeUnmount as Xe, computed as E, unref as m, getCurrentScope as ie, onScopeDispose as se, getCurrentInstance as re, nextTick as Te, defineComponent as D, inject as Q, useTemplateRef as Z, openBlock as b, createElementBlock as k, normalizeClass as j, createBlock as G, resolveDynamicComponent as Le, mergeProps as ae, toDisplayString as H, Fragment as X, createElementVNode as M, renderSlot as I, createCommentVNode as J, withDirectives as ne, vShow as Me, toRef as Je, readonly as Qe, customRef as Ze, reactive as T, renderList as oe, normalizeStyle as q, createTextVNode as Ke, provide as _e, createVNode as ge, withCtx as be } from "vue";
|
|
5
|
+
function Pe(e) {
|
|
6
|
+
return ie() ? (se(e), !0) : !1;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
return typeof e == "function" ? e() :
|
|
8
|
+
function ce(e) {
|
|
9
|
+
return typeof e == "function" ? e() : m(e);
|
|
10
10
|
}
|
|
11
|
-
const
|
|
11
|
+
const et = typeof window < "u" && typeof document < "u";
|
|
12
12
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
13
|
-
const
|
|
14
|
-
},
|
|
15
|
-
function
|
|
13
|
+
const tt = (e) => e != null, nt = Object.prototype.toString, ot = (e) => nt.call(e) === "[object Object]", lt = () => {
|
|
14
|
+
}, U = et ? window : void 0;
|
|
15
|
+
function N(e) {
|
|
16
16
|
var t;
|
|
17
|
-
const n =
|
|
17
|
+
const n = ce(e);
|
|
18
18
|
return (t = n == null ? void 0 : n.$el) != null ? t : n;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
let t, n,
|
|
22
|
-
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n,
|
|
23
|
-
return
|
|
24
|
-
Array.isArray(n) || (n = [n]), Array.isArray(
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
}, r = (
|
|
28
|
-
() => [
|
|
29
|
-
([
|
|
30
|
-
if (
|
|
20
|
+
function V(...e) {
|
|
21
|
+
let t, n, l, i;
|
|
22
|
+
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, l, i] = e, t = U) : [t, n, l, i] = e, !t)
|
|
23
|
+
return lt;
|
|
24
|
+
Array.isArray(n) || (n = [n]), Array.isArray(l) || (l = [l]);
|
|
25
|
+
const o = [], s = () => {
|
|
26
|
+
o.forEach((u) => u()), o.length = 0;
|
|
27
|
+
}, r = (u, f, a, p) => (u.addEventListener(f, a, p), () => u.removeEventListener(f, a, p)), c = A(
|
|
28
|
+
() => [N(t), ce(i)],
|
|
29
|
+
([u, f]) => {
|
|
30
|
+
if (s(), !u)
|
|
31
31
|
return;
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
...n.flatMap((
|
|
32
|
+
const a = ot(f) ? { ...f } : f;
|
|
33
|
+
o.push(
|
|
34
|
+
...n.flatMap((p) => l.map((v) => r(u, p, v, a)))
|
|
35
35
|
);
|
|
36
36
|
},
|
|
37
37
|
{ immediate: !0, flush: "post" }
|
|
38
|
-
),
|
|
39
|
-
|
|
38
|
+
), d = () => {
|
|
39
|
+
c(), s();
|
|
40
40
|
};
|
|
41
|
-
return
|
|
41
|
+
return Pe(d), d;
|
|
42
42
|
}
|
|
43
|
-
function
|
|
44
|
-
const e =
|
|
45
|
-
return t &&
|
|
43
|
+
function it() {
|
|
44
|
+
const e = g(!1), t = re();
|
|
45
|
+
return t && B(() => {
|
|
46
46
|
e.value = !0;
|
|
47
47
|
}, t), e;
|
|
48
48
|
}
|
|
49
|
-
function
|
|
50
|
-
const t =
|
|
51
|
-
return
|
|
52
|
-
}
|
|
53
|
-
function
|
|
54
|
-
const { window:
|
|
55
|
-
let
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
},
|
|
59
|
-
const
|
|
60
|
-
return new Set(
|
|
61
|
-
}),
|
|
62
|
-
() =>
|
|
63
|
-
(
|
|
64
|
-
r(),
|
|
49
|
+
function st(e) {
|
|
50
|
+
const t = it();
|
|
51
|
+
return E(() => (t.value, !!e()));
|
|
52
|
+
}
|
|
53
|
+
function rt(e, t, n = {}) {
|
|
54
|
+
const { window: l = U, ...i } = n;
|
|
55
|
+
let o;
|
|
56
|
+
const s = st(() => l && "MutationObserver" in l), r = () => {
|
|
57
|
+
o && (o.disconnect(), o = void 0);
|
|
58
|
+
}, c = E(() => {
|
|
59
|
+
const a = ce(e), p = (Array.isArray(a) ? a : [a]).map(N).filter(tt);
|
|
60
|
+
return new Set(p);
|
|
61
|
+
}), d = A(
|
|
62
|
+
() => c.value,
|
|
63
|
+
(a) => {
|
|
64
|
+
r(), s.value && a.size && (o = new MutationObserver(t), a.forEach((p) => o.observe(p, i)));
|
|
65
65
|
},
|
|
66
66
|
{ immediate: !0, flush: "post" }
|
|
67
|
-
),
|
|
68
|
-
|
|
67
|
+
), u = () => o == null ? void 0 : o.takeRecords(), f = () => {
|
|
68
|
+
d(), r();
|
|
69
69
|
};
|
|
70
|
-
return
|
|
71
|
-
isSupported:
|
|
72
|
-
stop:
|
|
73
|
-
takeRecords:
|
|
70
|
+
return Pe(f), {
|
|
71
|
+
isSupported: s,
|
|
72
|
+
stop: f,
|
|
73
|
+
takeRecords: u
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function at(e = {}) {
|
|
77
77
|
var t;
|
|
78
78
|
const {
|
|
79
|
-
window: n =
|
|
80
|
-
deep:
|
|
81
|
-
triggerOnRemoval:
|
|
82
|
-
} = e,
|
|
83
|
-
var
|
|
84
|
-
let
|
|
85
|
-
if (
|
|
86
|
-
for (;
|
|
87
|
-
|
|
88
|
-
return
|
|
89
|
-
}, r =
|
|
90
|
-
r.value =
|
|
79
|
+
window: n = U,
|
|
80
|
+
deep: l = !0,
|
|
81
|
+
triggerOnRemoval: i = !1
|
|
82
|
+
} = e, o = (t = e.document) != null ? t : n == null ? void 0 : n.document, s = () => {
|
|
83
|
+
var d;
|
|
84
|
+
let u = o == null ? void 0 : o.activeElement;
|
|
85
|
+
if (l)
|
|
86
|
+
for (; u != null && u.shadowRoot; )
|
|
87
|
+
u = (d = u == null ? void 0 : u.shadowRoot) == null ? void 0 : d.activeElement;
|
|
88
|
+
return u;
|
|
89
|
+
}, r = g(), c = () => {
|
|
90
|
+
r.value = s();
|
|
91
91
|
};
|
|
92
|
-
return n && (
|
|
93
|
-
|
|
94
|
-
}, !0),
|
|
95
|
-
|
|
96
|
-
|
|
92
|
+
return n && (V(n, "blur", (d) => {
|
|
93
|
+
d.relatedTarget === null && c();
|
|
94
|
+
}, !0), V(n, "focus", c, !0)), i && rt(o, (d) => {
|
|
95
|
+
d.filter((u) => u.removedNodes.length).map((u) => Array.from(u.removedNodes)).flat().forEach((u) => {
|
|
96
|
+
u === r.value && c();
|
|
97
97
|
});
|
|
98
98
|
}, {
|
|
99
99
|
childList: !0,
|
|
100
100
|
subtree: !0
|
|
101
|
-
}),
|
|
101
|
+
}), c(), r;
|
|
102
102
|
}
|
|
103
|
-
const
|
|
104
|
-
function
|
|
105
|
-
const { window: n =
|
|
106
|
-
return !n || !
|
|
103
|
+
const ct = "focusin", dt = "focusout";
|
|
104
|
+
function ut(e, t = {}) {
|
|
105
|
+
const { window: n = U } = t, l = E(() => N(e)), i = g(!1), o = E(() => i.value), s = at(t);
|
|
106
|
+
return !n || !s.value ? { focused: o } : (V(l, ct, () => i.value = !0), V(l, dt, () => i.value = !1), { focused: o });
|
|
107
107
|
}
|
|
108
|
-
function
|
|
109
|
-
const
|
|
108
|
+
function ft(e, { window: t = U, scrollTarget: n } = {}) {
|
|
109
|
+
const l = g(!1), i = () => {
|
|
110
110
|
if (!t) return;
|
|
111
|
-
const
|
|
112
|
-
if (!
|
|
113
|
-
|
|
111
|
+
const o = t.document, s = N(e);
|
|
112
|
+
if (!s)
|
|
113
|
+
l.value = !1;
|
|
114
114
|
else {
|
|
115
|
-
const r =
|
|
116
|
-
|
|
115
|
+
const r = s.getBoundingClientRect();
|
|
116
|
+
l.value = r.top <= (t.innerHeight || o.documentElement.clientHeight) && r.left <= (t.innerWidth || o.documentElement.clientWidth) && r.bottom >= 0 && r.right >= 0;
|
|
117
117
|
}
|
|
118
118
|
};
|
|
119
|
-
return
|
|
120
|
-
() =>
|
|
121
|
-
() =>
|
|
119
|
+
return A(
|
|
120
|
+
() => N(e),
|
|
121
|
+
() => i(),
|
|
122
122
|
{ immediate: !0, flush: "post" }
|
|
123
|
-
), t &&
|
|
123
|
+
), t && V(n || t, "scroll", i, {
|
|
124
124
|
capture: !1,
|
|
125
125
|
passive: !0
|
|
126
|
-
}),
|
|
126
|
+
}), l;
|
|
127
127
|
}
|
|
128
|
-
const
|
|
129
|
-
let t =
|
|
128
|
+
const S = (e) => {
|
|
129
|
+
let t = ft(e).value;
|
|
130
130
|
return t = t && e.offsetHeight > 0, t;
|
|
131
|
-
},
|
|
131
|
+
}, $ = (e) => e.tabIndex >= 0, xe = (e) => {
|
|
132
132
|
const t = e.target;
|
|
133
|
-
return
|
|
134
|
-
},
|
|
133
|
+
return de(t);
|
|
134
|
+
}, de = (e) => {
|
|
135
135
|
var t;
|
|
136
136
|
let n;
|
|
137
137
|
if (e instanceof HTMLTableCellElement) {
|
|
138
|
-
const
|
|
139
|
-
if (
|
|
140
|
-
const
|
|
141
|
-
|
|
138
|
+
const l = (t = e.parentElement) == null ? void 0 : t.previousElementSibling;
|
|
139
|
+
if (l) {
|
|
140
|
+
const i = Array.from(l.children)[e.cellIndex];
|
|
141
|
+
i && (n = i);
|
|
142
142
|
}
|
|
143
143
|
} else if (e instanceof HTMLTableRowElement) {
|
|
144
|
-
const
|
|
145
|
-
|
|
144
|
+
const l = e.previousElementSibling;
|
|
145
|
+
l && (n = l);
|
|
146
146
|
}
|
|
147
|
-
return n && (
|
|
148
|
-
},
|
|
147
|
+
return n && (!$(n) || !S(n)) ? de(n) : n;
|
|
148
|
+
}, pt = (e) => {
|
|
149
149
|
var t;
|
|
150
150
|
const n = e.target;
|
|
151
|
-
let
|
|
151
|
+
let l;
|
|
152
152
|
if (n instanceof HTMLTableCellElement) {
|
|
153
|
-
const
|
|
154
|
-
if (
|
|
155
|
-
const
|
|
156
|
-
|
|
153
|
+
const i = (t = n.parentElement) == null ? void 0 : t.parentElement;
|
|
154
|
+
if (i) {
|
|
155
|
+
const o = i.firstElementChild.children[n.cellIndex];
|
|
156
|
+
o && (l = o);
|
|
157
157
|
}
|
|
158
158
|
} else if (n instanceof HTMLTableRowElement) {
|
|
159
|
-
const
|
|
160
|
-
if (
|
|
161
|
-
const
|
|
162
|
-
|
|
159
|
+
const i = n.parentElement;
|
|
160
|
+
if (i) {
|
|
161
|
+
const o = i.firstElementChild;
|
|
162
|
+
o && (l = o);
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
|
-
return
|
|
166
|
-
},
|
|
165
|
+
return l && (!$(l) || !S(l)) ? ue(l) : l;
|
|
166
|
+
}, Ee = (e) => {
|
|
167
167
|
const t = e.target;
|
|
168
|
-
return
|
|
169
|
-
},
|
|
168
|
+
return ue(t);
|
|
169
|
+
}, ue = (e) => {
|
|
170
170
|
var t;
|
|
171
171
|
let n;
|
|
172
172
|
if (e instanceof HTMLTableCellElement) {
|
|
173
|
-
const
|
|
174
|
-
if (
|
|
175
|
-
const
|
|
176
|
-
|
|
173
|
+
const l = (t = e.parentElement) == null ? void 0 : t.nextElementSibling;
|
|
174
|
+
if (l) {
|
|
175
|
+
const i = Array.from(l.children)[e.cellIndex];
|
|
176
|
+
i && (n = i);
|
|
177
177
|
}
|
|
178
178
|
} else if (e instanceof HTMLTableRowElement) {
|
|
179
|
-
const
|
|
180
|
-
|
|
179
|
+
const l = e.nextElementSibling;
|
|
180
|
+
l && (n = l);
|
|
181
181
|
}
|
|
182
|
-
return n && (
|
|
183
|
-
},
|
|
182
|
+
return n && (!$(n) || !S(n)) ? ue(n) : n;
|
|
183
|
+
}, mt = (e) => {
|
|
184
184
|
var t;
|
|
185
185
|
const n = e.target;
|
|
186
|
-
let
|
|
186
|
+
let l;
|
|
187
187
|
if (n instanceof HTMLTableCellElement) {
|
|
188
|
-
const
|
|
189
|
-
if (
|
|
190
|
-
const
|
|
191
|
-
|
|
188
|
+
const i = (t = n.parentElement) == null ? void 0 : t.parentElement;
|
|
189
|
+
if (i) {
|
|
190
|
+
const o = i.lastElementChild.children[n.cellIndex];
|
|
191
|
+
o && (l = o);
|
|
192
192
|
}
|
|
193
193
|
} else if (n instanceof HTMLTableRowElement) {
|
|
194
|
-
const
|
|
195
|
-
if (
|
|
196
|
-
const
|
|
197
|
-
|
|
194
|
+
const i = n.parentElement;
|
|
195
|
+
if (i) {
|
|
196
|
+
const o = i.lastElementChild;
|
|
197
|
+
o && (l = o);
|
|
198
198
|
}
|
|
199
199
|
}
|
|
200
|
-
return
|
|
201
|
-
},
|
|
200
|
+
return l && (!$(l) || !S(l)) ? de(l) : l;
|
|
201
|
+
}, ke = (e) => {
|
|
202
202
|
const t = e.target;
|
|
203
|
-
return
|
|
204
|
-
},
|
|
203
|
+
return fe(t);
|
|
204
|
+
}, fe = (e) => {
|
|
205
205
|
var t;
|
|
206
206
|
let n;
|
|
207
207
|
if (e.previousElementSibling)
|
|
208
208
|
n = e.previousElementSibling;
|
|
209
209
|
else {
|
|
210
|
-
const
|
|
211
|
-
n =
|
|
210
|
+
const l = (t = e.parentElement) == null ? void 0 : t.previousElementSibling;
|
|
211
|
+
n = l == null ? void 0 : l.lastElementChild;
|
|
212
212
|
}
|
|
213
|
-
return n && (
|
|
214
|
-
},
|
|
213
|
+
return n && (!$(n) || !S(n)) ? fe(n) : n;
|
|
214
|
+
}, Ce = (e) => {
|
|
215
215
|
const t = e.target;
|
|
216
|
-
return
|
|
217
|
-
},
|
|
216
|
+
return pe(t);
|
|
217
|
+
}, pe = (e) => {
|
|
218
218
|
var t;
|
|
219
219
|
let n;
|
|
220
220
|
if (e.nextElementSibling)
|
|
221
221
|
n = e.nextElementSibling;
|
|
222
222
|
else {
|
|
223
|
-
const
|
|
224
|
-
n =
|
|
223
|
+
const l = (t = e.parentElement) == null ? void 0 : t.nextElementSibling;
|
|
224
|
+
n = l == null ? void 0 : l.firstElementChild;
|
|
225
225
|
}
|
|
226
|
-
return n && (
|
|
227
|
-
},
|
|
226
|
+
return n && (!$(n) || !S(n)) ? pe(n) : n;
|
|
227
|
+
}, Ae = (e) => {
|
|
228
228
|
const t = e.target.parentElement.firstElementChild;
|
|
229
|
-
return t && (
|
|
230
|
-
},
|
|
229
|
+
return t && (!$(t) || !S(t)) ? pe(t) : t;
|
|
230
|
+
}, Ie = (e) => {
|
|
231
231
|
const t = e.target.parentElement.lastElementChild;
|
|
232
|
-
return t && (
|
|
233
|
-
},
|
|
232
|
+
return t && (!$(t) || !S(t)) ? fe(t) : t;
|
|
233
|
+
}, z = ["alt", "control", "shift", "meta"], vt = {
|
|
234
234
|
ArrowUp: "up",
|
|
235
235
|
ArrowDown: "down",
|
|
236
236
|
ArrowLeft: "left",
|
|
237
237
|
ArrowRight: "right"
|
|
238
|
-
},
|
|
238
|
+
}, me = {
|
|
239
239
|
"keydown.up": (e) => {
|
|
240
|
-
const t =
|
|
240
|
+
const t = xe(e);
|
|
241
241
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
242
242
|
},
|
|
243
243
|
"keydown.down": (e) => {
|
|
244
|
-
const t =
|
|
244
|
+
const t = Ee(e);
|
|
245
245
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
246
246
|
},
|
|
247
247
|
"keydown.left": (e) => {
|
|
248
|
-
const t =
|
|
248
|
+
const t = ke(e);
|
|
249
249
|
e.preventDefault(), e.stopPropagation(), t && t.focus();
|
|
250
250
|
},
|
|
251
251
|
"keydown.right": (e) => {
|
|
252
|
-
const t =
|
|
252
|
+
const t = Ce(e);
|
|
253
253
|
e.preventDefault(), e.stopPropagation(), t && t.focus();
|
|
254
254
|
},
|
|
255
255
|
"keydown.control.up": (e) => {
|
|
256
|
-
const t =
|
|
256
|
+
const t = pt(e);
|
|
257
257
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
258
258
|
},
|
|
259
259
|
"keydown.control.down": (e) => {
|
|
260
|
-
const t =
|
|
260
|
+
const t = mt(e);
|
|
261
261
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
262
262
|
},
|
|
263
263
|
"keydown.control.left": (e) => {
|
|
264
|
-
const t =
|
|
264
|
+
const t = Ae(e);
|
|
265
265
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
266
266
|
},
|
|
267
267
|
"keydown.control.right": (e) => {
|
|
268
|
-
const t =
|
|
268
|
+
const t = Ie(e);
|
|
269
269
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
270
270
|
},
|
|
271
271
|
"keydown.end": (e) => {
|
|
272
|
-
const t =
|
|
272
|
+
const t = Ie(e);
|
|
273
273
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
274
274
|
},
|
|
275
275
|
"keydown.enter": (e) => {
|
|
276
276
|
if (e.target instanceof HTMLTableCellElement) {
|
|
277
277
|
e.preventDefault(), e.stopPropagation();
|
|
278
|
-
const t =
|
|
278
|
+
const t = Ee(e);
|
|
279
279
|
t && t.focus();
|
|
280
280
|
}
|
|
281
281
|
},
|
|
282
282
|
"keydown.shift.enter": (e) => {
|
|
283
283
|
if (e.target instanceof HTMLTableCellElement) {
|
|
284
284
|
e.preventDefault(), e.stopPropagation();
|
|
285
|
-
const t =
|
|
285
|
+
const t = xe(e);
|
|
286
286
|
t && t.focus();
|
|
287
287
|
}
|
|
288
288
|
},
|
|
289
289
|
"keydown.home": (e) => {
|
|
290
|
-
const t =
|
|
290
|
+
const t = Ae(e);
|
|
291
291
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
292
292
|
},
|
|
293
293
|
"keydown.tab": (e) => {
|
|
294
|
-
const t =
|
|
294
|
+
const t = Ce(e);
|
|
295
295
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
296
296
|
},
|
|
297
297
|
"keydown.shift.tab": (e) => {
|
|
298
|
-
const t =
|
|
298
|
+
const t = ke(e);
|
|
299
299
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
300
300
|
}
|
|
301
301
|
};
|
|
302
|
-
function
|
|
303
|
-
const t = (
|
|
302
|
+
function ve(e) {
|
|
303
|
+
const t = (s) => {
|
|
304
304
|
let r = null;
|
|
305
|
-
return
|
|
306
|
-
}, n = (
|
|
307
|
-
const r = t(
|
|
308
|
-
let
|
|
309
|
-
if (typeof
|
|
310
|
-
|
|
311
|
-
else if (Array.isArray(
|
|
312
|
-
for (const
|
|
313
|
-
|
|
314
|
-
else if (
|
|
315
|
-
|
|
316
|
-
else if (Array.isArray(
|
|
317
|
-
for (const
|
|
318
|
-
|
|
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;
|
|
306
|
+
}, n = (s) => {
|
|
307
|
+
const r = t(s);
|
|
308
|
+
let c = [];
|
|
309
|
+
if (typeof s.selectors == "string")
|
|
310
|
+
c = r ? Array.from(r.querySelectorAll(s.selectors)) : Array.from(document.querySelectorAll(s.selectors));
|
|
311
|
+
else if (Array.isArray(s.selectors))
|
|
312
|
+
for (const d of s.selectors)
|
|
313
|
+
d instanceof HTMLElement ? c.push(d) : c.push(d.$el);
|
|
314
|
+
else if (s.selectors instanceof HTMLElement)
|
|
315
|
+
c.push(s.selectors);
|
|
316
|
+
else if (Array.isArray(s.selectors.value))
|
|
317
|
+
for (const d of s.selectors.value)
|
|
318
|
+
d instanceof HTMLElement ? c.push(d) : c.push(d.$el);
|
|
319
319
|
else
|
|
320
|
-
|
|
321
|
-
return
|
|
322
|
-
},
|
|
323
|
-
const r = t(
|
|
324
|
-
let
|
|
325
|
-
return
|
|
326
|
-
},
|
|
327
|
-
const
|
|
328
|
-
if (
|
|
329
|
-
const
|
|
330
|
-
for (const
|
|
331
|
-
const [
|
|
332
|
-
if (
|
|
333
|
-
const
|
|
334
|
-
const
|
|
335
|
-
return r.getModifierState(
|
|
320
|
+
c.push(s.selectors.value);
|
|
321
|
+
return c;
|
|
322
|
+
}, l = (s) => {
|
|
323
|
+
const r = t(s);
|
|
324
|
+
let c = [];
|
|
325
|
+
return s.selectors ? c = n(s) : r && (c = Array.from(r.children).filter((d) => $(d) && S(d))), c;
|
|
326
|
+
}, i = (s) => (r) => {
|
|
327
|
+
const c = vt[r.key] || r.key.toLowerCase();
|
|
328
|
+
if (z.includes(c)) return;
|
|
329
|
+
const d = s.handlers || me;
|
|
330
|
+
for (const u of Object.keys(d)) {
|
|
331
|
+
const [f, ...a] = u.split(".");
|
|
332
|
+
if (f === "keydown" && a.includes(c)) {
|
|
333
|
+
const p = d[u], v = a.filter((y) => z.includes(y)), C = z.some((y) => {
|
|
334
|
+
const h = y.charAt(0).toUpperCase() + y.slice(1);
|
|
335
|
+
return r.getModifierState(h);
|
|
336
336
|
});
|
|
337
|
-
if (
|
|
338
|
-
if (
|
|
339
|
-
for (const
|
|
340
|
-
if (
|
|
341
|
-
const
|
|
342
|
-
r.getModifierState(
|
|
337
|
+
if (v.length > 0) {
|
|
338
|
+
if (C) {
|
|
339
|
+
for (const y of z)
|
|
340
|
+
if (a.includes(y)) {
|
|
341
|
+
const h = y.charAt(0).toUpperCase() + y.slice(1);
|
|
342
|
+
r.getModifierState(h) && p(r);
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
345
|
} else
|
|
346
|
-
|
|
346
|
+
C || p(r);
|
|
347
347
|
}
|
|
348
348
|
}
|
|
349
|
-
},
|
|
350
|
-
|
|
351
|
-
for (const
|
|
352
|
-
const r = t(
|
|
353
|
-
for (const
|
|
354
|
-
const { focused:
|
|
355
|
-
|
|
349
|
+
}, o = [];
|
|
350
|
+
B(() => {
|
|
351
|
+
for (const s of e) {
|
|
352
|
+
const r = t(s), c = l(s), d = i(s), u = r ? [r] : c;
|
|
353
|
+
for (const f of u) {
|
|
354
|
+
const { focused: a } = ut(g(f)), p = A(a, (v) => {
|
|
355
|
+
v ? f.addEventListener("keydown", d) : f.removeEventListener("keydown", d);
|
|
356
356
|
});
|
|
357
|
-
|
|
357
|
+
o.push(p);
|
|
358
358
|
}
|
|
359
359
|
}
|
|
360
|
-
}),
|
|
361
|
-
for (const
|
|
362
|
-
|
|
360
|
+
}), Xe(() => {
|
|
361
|
+
for (const s of o)
|
|
362
|
+
s();
|
|
363
363
|
});
|
|
364
364
|
}
|
|
365
|
-
|
|
365
|
+
function he(e) {
|
|
366
|
+
return ie() ? (se(e), !0) : !1;
|
|
367
|
+
}
|
|
368
|
+
function K(e) {
|
|
369
|
+
return typeof e == "function" ? e() : m(e);
|
|
370
|
+
}
|
|
371
|
+
const ht = typeof window < "u" && typeof document < "u";
|
|
372
|
+
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
373
|
+
const wt = (e) => e != null, yt = Object.prototype.toString, gt = (e) => yt.call(e) === "[object Object]", bt = () => {
|
|
374
|
+
};
|
|
375
|
+
function xt(e) {
|
|
376
|
+
return re();
|
|
377
|
+
}
|
|
378
|
+
function Et(e, t = !0, n) {
|
|
379
|
+
xt() ? B(e, n) : t ? e() : Te(e);
|
|
380
|
+
}
|
|
381
|
+
const we = ht ? window : void 0;
|
|
382
|
+
function R(e) {
|
|
383
|
+
var t;
|
|
384
|
+
const n = K(e);
|
|
385
|
+
return (t = n == null ? void 0 : n.$el) != null ? t : n;
|
|
386
|
+
}
|
|
387
|
+
function Se(...e) {
|
|
388
|
+
let t, n, l, i;
|
|
389
|
+
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, l, i] = e, t = we) : [t, n, l, i] = e, !t)
|
|
390
|
+
return bt;
|
|
391
|
+
Array.isArray(n) || (n = [n]), Array.isArray(l) || (l = [l]);
|
|
392
|
+
const o = [], s = () => {
|
|
393
|
+
o.forEach((u) => u()), o.length = 0;
|
|
394
|
+
}, r = (u, f, a, p) => (u.addEventListener(f, a, p), () => u.removeEventListener(f, a, p)), c = A(
|
|
395
|
+
() => [R(t), K(i)],
|
|
396
|
+
([u, f]) => {
|
|
397
|
+
if (s(), !u)
|
|
398
|
+
return;
|
|
399
|
+
const a = gt(f) ? { ...f } : f;
|
|
400
|
+
o.push(
|
|
401
|
+
...n.flatMap((p) => l.map((v) => r(u, p, v, a)))
|
|
402
|
+
);
|
|
403
|
+
},
|
|
404
|
+
{ immediate: !0, flush: "post" }
|
|
405
|
+
), d = () => {
|
|
406
|
+
c(), s();
|
|
407
|
+
};
|
|
408
|
+
return he(d), d;
|
|
409
|
+
}
|
|
410
|
+
function kt() {
|
|
411
|
+
const e = g(!1), t = re();
|
|
412
|
+
return t && B(() => {
|
|
413
|
+
e.value = !0;
|
|
414
|
+
}, t), e;
|
|
415
|
+
}
|
|
416
|
+
function We(e) {
|
|
417
|
+
const t = kt();
|
|
418
|
+
return E(() => (t.value, !!e()));
|
|
419
|
+
}
|
|
420
|
+
function je(e, t, n = {}) {
|
|
421
|
+
const { window: l = we, ...i } = n;
|
|
422
|
+
let o;
|
|
423
|
+
const s = We(() => l && "MutationObserver" in l), r = () => {
|
|
424
|
+
o && (o.disconnect(), o = void 0);
|
|
425
|
+
}, c = E(() => {
|
|
426
|
+
const a = K(e), p = (Array.isArray(a) ? a : [a]).map(R).filter(wt);
|
|
427
|
+
return new Set(p);
|
|
428
|
+
}), d = A(
|
|
429
|
+
() => c.value,
|
|
430
|
+
(a) => {
|
|
431
|
+
r(), s.value && a.size && (o = new MutationObserver(t), a.forEach((p) => o.observe(p, i)));
|
|
432
|
+
},
|
|
433
|
+
{ immediate: !0, flush: "post" }
|
|
434
|
+
), u = () => o == null ? void 0 : o.takeRecords(), f = () => {
|
|
435
|
+
d(), r();
|
|
436
|
+
};
|
|
437
|
+
return he(f), {
|
|
438
|
+
isSupported: s,
|
|
439
|
+
stop: f,
|
|
440
|
+
takeRecords: u
|
|
441
|
+
};
|
|
442
|
+
}
|
|
443
|
+
function Ct(e, t, n = {}) {
|
|
444
|
+
const { window: l = we, ...i } = n;
|
|
445
|
+
let o;
|
|
446
|
+
const s = We(() => l && "ResizeObserver" in l), r = () => {
|
|
447
|
+
o && (o.disconnect(), o = void 0);
|
|
448
|
+
}, c = E(() => {
|
|
449
|
+
const f = K(e);
|
|
450
|
+
return Array.isArray(f) ? f.map((a) => R(a)) : [R(f)];
|
|
451
|
+
}), d = A(
|
|
452
|
+
c,
|
|
453
|
+
(f) => {
|
|
454
|
+
if (r(), s.value && l) {
|
|
455
|
+
o = new ResizeObserver(t);
|
|
456
|
+
for (const a of f)
|
|
457
|
+
a && o.observe(a, i);
|
|
458
|
+
}
|
|
459
|
+
},
|
|
460
|
+
{ immediate: !0, flush: "post" }
|
|
461
|
+
), u = () => {
|
|
462
|
+
r(), d();
|
|
463
|
+
};
|
|
464
|
+
return he(u), {
|
|
465
|
+
isSupported: s,
|
|
466
|
+
stop: u
|
|
467
|
+
};
|
|
468
|
+
}
|
|
469
|
+
function At(e, t = {}) {
|
|
470
|
+
const {
|
|
471
|
+
reset: n = !0,
|
|
472
|
+
windowResize: l = !0,
|
|
473
|
+
windowScroll: i = !0,
|
|
474
|
+
immediate: o = !0,
|
|
475
|
+
updateTiming: s = "sync"
|
|
476
|
+
} = t, r = g(0), c = g(0), d = g(0), u = g(0), f = g(0), a = g(0), p = g(0), v = g(0);
|
|
477
|
+
function C() {
|
|
478
|
+
const h = R(e);
|
|
479
|
+
if (!h) {
|
|
480
|
+
n && (r.value = 0, c.value = 0, d.value = 0, u.value = 0, f.value = 0, a.value = 0, p.value = 0, v.value = 0);
|
|
481
|
+
return;
|
|
482
|
+
}
|
|
483
|
+
const w = h.getBoundingClientRect();
|
|
484
|
+
r.value = w.height, c.value = w.bottom, d.value = w.left, u.value = w.right, f.value = w.top, a.value = w.width, p.value = w.x, v.value = w.y;
|
|
485
|
+
}
|
|
486
|
+
function y() {
|
|
487
|
+
s === "sync" ? C() : s === "next-frame" && requestAnimationFrame(() => C());
|
|
488
|
+
}
|
|
489
|
+
return Ct(e, y), A(() => R(e), (h) => !h && y()), je(e, y, {
|
|
490
|
+
attributeFilter: ["style", "class"]
|
|
491
|
+
}), i && Se("scroll", y, { capture: !0, passive: !0 }), l && Se("resize", y, { passive: !0 }), Et(() => {
|
|
492
|
+
o && y();
|
|
493
|
+
}), {
|
|
494
|
+
height: r,
|
|
495
|
+
bottom: c,
|
|
496
|
+
left: d,
|
|
497
|
+
right: u,
|
|
498
|
+
top: f,
|
|
499
|
+
width: a,
|
|
500
|
+
x: p,
|
|
501
|
+
y: v,
|
|
502
|
+
update: y
|
|
503
|
+
};
|
|
504
|
+
}
|
|
505
|
+
const It = ["data-colindex", "data-rowindex", "data-editable", "contenteditable", "tabindex"], St = { key: 1 }, He = /* @__PURE__ */ D({
|
|
366
506
|
__name: "ACell",
|
|
367
507
|
props: {
|
|
368
508
|
colIndex: {},
|
|
369
509
|
rowIndex: {},
|
|
370
510
|
tableid: {},
|
|
371
511
|
addNavigation: { type: [Boolean, Object], default: !0 },
|
|
372
|
-
tabIndex: { default: 0 }
|
|
512
|
+
tabIndex: { default: 0 },
|
|
513
|
+
pinned: { type: Boolean }
|
|
373
514
|
},
|
|
374
515
|
setup(e) {
|
|
375
|
-
var
|
|
376
|
-
const t =
|
|
377
|
-
const
|
|
378
|
-
return
|
|
379
|
-
}),
|
|
380
|
-
if (
|
|
381
|
-
const
|
|
382
|
-
t.modal.visible = !0, t.modal.colIndex = e.colIndex, t.modal.rowIndex = e.rowIndex, t.modal.parent = n.value, t.modal.top =
|
|
516
|
+
var y;
|
|
517
|
+
const t = Q(e.tableid), n = Z("cell"), l = g(""), i = g(!1), o = t.table, s = t.columns[e.colIndex], r = t.rows[e.rowIndex], c = E(() => s.align || "center"), d = E(() => s.width || "40ch"), u = E(() => {
|
|
518
|
+
const h = t.cellData(e.colIndex, e.rowIndex), w = s.format;
|
|
519
|
+
return w ? typeof w == "function" ? w(h, { table: o, row: r, column: s }) : typeof w == "string" ? Function(`"use strict";return (${w})`)()(h, { table: o, row: r, column: s }) : h : h;
|
|
520
|
+
}), f = () => {
|
|
521
|
+
if (s.mask, s.modalComponent) {
|
|
522
|
+
const { top: h, left: w, height: ye } = At(n);
|
|
523
|
+
t.modal.visible = !0, t.modal.colIndex = e.colIndex, t.modal.rowIndex = e.rowIndex, t.modal.parent = n.value, t.modal.top = h.value + ye.value, t.modal.left = w.value, t.modal.width = d.value, typeof s.modalComponent == "function" ? t.modal.component = s.modalComponent({ table: o, row: r, column: s }) : t.modal.component = s.modalComponent, t.modal.componentProps = s.modalComponentExtraProps;
|
|
383
524
|
}
|
|
384
525
|
};
|
|
385
526
|
if (e.addNavigation) {
|
|
386
|
-
let
|
|
387
|
-
...
|
|
388
|
-
"keydown.f2":
|
|
389
|
-
"keydown.alt.up":
|
|
390
|
-
"keydown.alt.down":
|
|
391
|
-
"keydown.alt.left":
|
|
392
|
-
"keydown.alt.right":
|
|
527
|
+
let h = {
|
|
528
|
+
...me,
|
|
529
|
+
"keydown.f2": f,
|
|
530
|
+
"keydown.alt.up": f,
|
|
531
|
+
"keydown.alt.down": f,
|
|
532
|
+
"keydown.alt.left": f,
|
|
533
|
+
"keydown.alt.right": f
|
|
393
534
|
};
|
|
394
|
-
typeof e.addNavigation == "object" && (
|
|
395
|
-
...
|
|
535
|
+
typeof e.addNavigation == "object" && (h = {
|
|
536
|
+
...h,
|
|
396
537
|
...e.addNavigation
|
|
397
|
-
}),
|
|
538
|
+
}), ve([
|
|
398
539
|
{
|
|
399
540
|
selectors: n,
|
|
400
|
-
handlers:
|
|
541
|
+
handlers: h
|
|
401
542
|
}
|
|
402
543
|
]);
|
|
403
544
|
}
|
|
404
|
-
const
|
|
405
|
-
n.value && (
|
|
406
|
-
},
|
|
407
|
-
n.value && n.value.textContent !==
|
|
408
|
-
},
|
|
409
|
-
textAlign:
|
|
410
|
-
width:
|
|
411
|
-
backgroundColor:
|
|
412
|
-
fontWeight:
|
|
413
|
-
paddingLeft:
|
|
545
|
+
const a = () => {
|
|
546
|
+
n.value && (l.value = n.value.textContent);
|
|
547
|
+
}, p = () => {
|
|
548
|
+
n.value && n.value.textContent !== l.value && (l.value = n.value.textContent, n.value.dispatchEvent(new Event("change")), i.value = !0, s.format || t.setCellData(e.rowIndex, e.colIndex, l.value));
|
|
549
|
+
}, v = (h, w) => w && h === 0 && w > 0 ? `${w}ch` : "inherit", C = {
|
|
550
|
+
textAlign: c.value,
|
|
551
|
+
width: d.value,
|
|
552
|
+
backgroundColor: i.value ? "var(--cell-modified-color)" : "inherit",
|
|
553
|
+
fontWeight: i.value ? "bold" : "inherit",
|
|
554
|
+
paddingLeft: v(e.colIndex, (y = t.display[e.rowIndex]) == null ? void 0 : y.indent)
|
|
414
555
|
};
|
|
415
|
-
return (
|
|
556
|
+
return (h, w) => (b(), k("td", {
|
|
416
557
|
ref: "cell",
|
|
417
|
-
"data-colindex":
|
|
418
|
-
"data-rowindex":
|
|
419
|
-
"data-editable":
|
|
420
|
-
contenteditable:
|
|
421
|
-
tabindex:
|
|
558
|
+
"data-colindex": h.colIndex,
|
|
559
|
+
"data-rowindex": h.rowIndex,
|
|
560
|
+
"data-editable": m(s).edit,
|
|
561
|
+
contenteditable: m(s).edit,
|
|
562
|
+
tabindex: h.tabIndex,
|
|
422
563
|
spellcheck: !1,
|
|
423
|
-
style:
|
|
424
|
-
onFocus:
|
|
425
|
-
onPaste:
|
|
426
|
-
onBlur:
|
|
427
|
-
onInput:
|
|
428
|
-
onClick:
|
|
429
|
-
onMousedown:
|
|
430
|
-
class: "atable__cell"
|
|
564
|
+
style: C,
|
|
565
|
+
onFocus: a,
|
|
566
|
+
onPaste: p,
|
|
567
|
+
onBlur: p,
|
|
568
|
+
onInput: p,
|
|
569
|
+
onClick: f,
|
|
570
|
+
onMousedown: f,
|
|
571
|
+
class: j(["atable__cell", h.pinned ? "sticky-column" : ""])
|
|
431
572
|
}, [
|
|
432
|
-
|
|
573
|
+
m(s).cellComponent ? (b(), G(Le(m(s).cellComponent), ae({
|
|
433
574
|
key: 0,
|
|
434
575
|
value: u.value
|
|
435
|
-
},
|
|
436
|
-
],
|
|
576
|
+
}, m(s).cellComponentProps), null, 16, ["value"])) : (b(), k("span", St, H(u.value), 1))
|
|
577
|
+
], 42, It));
|
|
437
578
|
}
|
|
438
|
-
}),
|
|
579
|
+
}), $t = ["tabindex"], Ot = ["tabindex"], Rt = ["colspan"], Dt = /* @__PURE__ */ D({
|
|
439
580
|
__name: "AExpansionRow",
|
|
440
581
|
props: {
|
|
441
|
-
row: {},
|
|
442
582
|
rowIndex: {},
|
|
443
583
|
tableid: {},
|
|
444
584
|
tabIndex: { default: () => -1 },
|
|
445
585
|
addNavigation: { type: [Boolean, Object] }
|
|
446
586
|
},
|
|
447
587
|
setup(e) {
|
|
448
|
-
const t =
|
|
588
|
+
const t = Q(e.tableid), n = Z("rowEl"), l = E(() => t.display[e.rowIndex].expanded ? "▼" : "►");
|
|
449
589
|
if (e.addNavigation) {
|
|
450
|
-
const
|
|
451
|
-
"keydown.control.g": (
|
|
452
|
-
|
|
590
|
+
const i = {
|
|
591
|
+
"keydown.control.g": (o) => {
|
|
592
|
+
o.stopPropagation(), o.preventDefault(), t.toggleRowExpand(e.rowIndex);
|
|
453
593
|
}
|
|
454
594
|
};
|
|
455
|
-
typeof e.addNavigation == "object" && Object.assign(
|
|
595
|
+
typeof e.addNavigation == "object" && Object.assign(i, e.addNavigation), ve([
|
|
456
596
|
{
|
|
457
597
|
selectors: n,
|
|
458
|
-
handlers:
|
|
598
|
+
handlers: i
|
|
459
599
|
}
|
|
460
600
|
]);
|
|
461
601
|
}
|
|
462
|
-
return (
|
|
463
|
-
|
|
602
|
+
return (i, o) => (b(), k(X, null, [
|
|
603
|
+
M("tr", ae(i.$attrs, {
|
|
464
604
|
ref: "rowEl",
|
|
465
|
-
tabindex:
|
|
605
|
+
tabindex: i.tabIndex,
|
|
466
606
|
class: "expandable-row"
|
|
467
607
|
}), [
|
|
468
|
-
|
|
608
|
+
M("td", {
|
|
469
609
|
tabIndex: -1,
|
|
470
|
-
onClick:
|
|
610
|
+
onClick: o[0] || (o[0] = (s) => m(t).toggleRowExpand(i.rowIndex)),
|
|
471
611
|
class: "row-index"
|
|
472
|
-
},
|
|
473
|
-
I(
|
|
474
|
-
], 16,
|
|
475
|
-
|
|
612
|
+
}, H(l.value), 1),
|
|
613
|
+
I(i.$slots, "row")
|
|
614
|
+
], 16, $t),
|
|
615
|
+
m(t).display[i.rowIndex].expanded ? (b(), k("tr", {
|
|
476
616
|
key: 0,
|
|
477
617
|
ref: "rowExpanded",
|
|
478
|
-
tabindex:
|
|
618
|
+
tabindex: i.tabIndex,
|
|
479
619
|
class: "expanded-row"
|
|
480
620
|
}, [
|
|
481
|
-
|
|
621
|
+
M("td", {
|
|
482
622
|
tabIndex: -1,
|
|
483
|
-
colspan:
|
|
623
|
+
colspan: m(t).columns.length + 1,
|
|
484
624
|
class: "expanded-row-content"
|
|
485
625
|
}, [
|
|
486
|
-
I(
|
|
487
|
-
], 8,
|
|
488
|
-
], 8,
|
|
626
|
+
I(i.$slots, "content")
|
|
627
|
+
], 8, Rt)
|
|
628
|
+
], 8, Ot)) : J("", !0)
|
|
489
629
|
], 64));
|
|
490
630
|
}
|
|
491
|
-
}),
|
|
492
|
-
key: 0,
|
|
493
|
-
tabIndex: -1,
|
|
494
|
-
class: "list-index"
|
|
495
|
-
}, De = /* @__PURE__ */ T({
|
|
631
|
+
}), Tt = ["tabindex"], Ne = /* @__PURE__ */ D({
|
|
496
632
|
__name: "ARow",
|
|
497
633
|
props: {
|
|
498
|
-
row: {},
|
|
499
634
|
rowIndex: {},
|
|
500
635
|
tableid: {},
|
|
501
636
|
tabIndex: { default: () => -1 },
|
|
502
637
|
addNavigation: { type: [Boolean, Object], default: !1 }
|
|
503
638
|
},
|
|
504
639
|
setup(e) {
|
|
505
|
-
const t =
|
|
506
|
-
t.toggleRowExpand(
|
|
640
|
+
const t = Q(e.tableid), n = Z("rowEl"), l = E(() => t.columns.some((r) => r.pinned)), i = E(() => t.config.view !== "tree" || t.display[e.rowIndex].isRoot || t.display[e.rowIndex].open), o = E(() => t.config.view !== "tree" ? "" : t.display[e.rowIndex].isRoot || t.display[e.rowIndex].isParent ? t.display[e.rowIndex].childrenOpen ? "-" : "+" : ""), s = (r) => {
|
|
641
|
+
t.toggleRowExpand(r);
|
|
507
642
|
};
|
|
508
643
|
if (e.addNavigation) {
|
|
509
|
-
let
|
|
510
|
-
typeof e.addNavigation == "object" && (
|
|
511
|
-
...
|
|
644
|
+
let r = me;
|
|
645
|
+
typeof e.addNavigation == "object" && (r = {
|
|
646
|
+
...r,
|
|
512
647
|
...e.addNavigation
|
|
513
|
-
}),
|
|
648
|
+
}), ve([
|
|
514
649
|
{
|
|
515
650
|
selectors: n,
|
|
516
|
-
handlers:
|
|
651
|
+
handlers: r
|
|
517
652
|
}
|
|
518
653
|
]);
|
|
519
654
|
}
|
|
520
|
-
return (
|
|
655
|
+
return (r, c) => ne((b(), k("tr", {
|
|
521
656
|
ref: "rowEl",
|
|
522
|
-
tabindex:
|
|
657
|
+
tabindex: r.tabIndex,
|
|
523
658
|
class: "table-row"
|
|
524
659
|
}, [
|
|
525
|
-
I(
|
|
526
|
-
|
|
660
|
+
I(r.$slots, "index", {}, () => [
|
|
661
|
+
m(t).config.view === "list" ? (b(), k("td", {
|
|
662
|
+
key: 0,
|
|
663
|
+
tabIndex: -1,
|
|
664
|
+
class: j(["list-index", l.value ? "sticky-index" : ""])
|
|
665
|
+
}, H(r.rowIndex + 1), 3)) : m(t).config.view === "tree" ? (b(), k("td", {
|
|
527
666
|
key: 1,
|
|
528
667
|
tabIndex: -1,
|
|
529
|
-
class: "tree-index",
|
|
530
|
-
onClick:
|
|
531
|
-
},
|
|
668
|
+
class: j(["tree-index", l.value ? "sticky-index" : ""]),
|
|
669
|
+
onClick: c[0] || (c[0] = (d) => s(r.rowIndex))
|
|
670
|
+
}, H(o.value), 3)) : J("", !0)
|
|
532
671
|
]),
|
|
533
|
-
I(
|
|
534
|
-
], 8,
|
|
535
|
-
[
|
|
672
|
+
I(r.$slots, "default")
|
|
673
|
+
], 8, Tt)), [
|
|
674
|
+
[Me, i.value]
|
|
536
675
|
]);
|
|
537
676
|
}
|
|
538
677
|
});
|
|
539
|
-
function
|
|
540
|
-
return
|
|
678
|
+
function Ve(e) {
|
|
679
|
+
return ie() ? (se(e), !0) : !1;
|
|
541
680
|
}
|
|
542
|
-
function
|
|
543
|
-
return typeof e == "function" ? e() :
|
|
681
|
+
function P(e) {
|
|
682
|
+
return typeof e == "function" ? e() : m(e);
|
|
544
683
|
}
|
|
545
|
-
const
|
|
684
|
+
const Be = typeof window < "u" && typeof document < "u";
|
|
546
685
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
547
|
-
const
|
|
548
|
-
},
|
|
549
|
-
function
|
|
686
|
+
const Lt = Object.prototype.toString, Mt = (e) => Lt.call(e) === "[object Object]", W = () => {
|
|
687
|
+
}, le = /* @__PURE__ */ Pt();
|
|
688
|
+
function Pt() {
|
|
550
689
|
var e, t;
|
|
551
|
-
return
|
|
690
|
+
return Be && ((e = window == null ? void 0 : window.navigator) == null ? void 0 : e.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((t = window == null ? void 0 : window.navigator) == null ? void 0 : t.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent));
|
|
552
691
|
}
|
|
553
|
-
const
|
|
692
|
+
const $e = {
|
|
554
693
|
mounted: "mounted",
|
|
555
694
|
updated: "updated",
|
|
556
695
|
unmounted: "unmounted"
|
|
557
696
|
};
|
|
558
|
-
function
|
|
697
|
+
function Wt(...e) {
|
|
559
698
|
if (e.length !== 1)
|
|
560
|
-
return
|
|
699
|
+
return Je(...e);
|
|
561
700
|
const t = e[0];
|
|
562
|
-
return typeof t == "function" ?
|
|
701
|
+
return typeof t == "function" ? Qe(Ze(() => ({ get: t, set: W }))) : g(t);
|
|
563
702
|
}
|
|
564
|
-
function
|
|
703
|
+
function L(e) {
|
|
565
704
|
var t;
|
|
566
|
-
const n =
|
|
705
|
+
const n = P(e);
|
|
567
706
|
return (t = n == null ? void 0 : n.$el) != null ? t : n;
|
|
568
707
|
}
|
|
569
|
-
const
|
|
570
|
-
function
|
|
571
|
-
let t, n,
|
|
572
|
-
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n,
|
|
573
|
-
return
|
|
574
|
-
Array.isArray(n) || (n = [n]), Array.isArray(
|
|
575
|
-
const
|
|
576
|
-
|
|
577
|
-
}, r = (
|
|
578
|
-
() => [
|
|
579
|
-
([
|
|
580
|
-
if (
|
|
708
|
+
const Ue = Be ? window : void 0;
|
|
709
|
+
function Y(...e) {
|
|
710
|
+
let t, n, l, i;
|
|
711
|
+
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, l, i] = e, t = Ue) : [t, n, l, i] = e, !t)
|
|
712
|
+
return W;
|
|
713
|
+
Array.isArray(n) || (n = [n]), Array.isArray(l) || (l = [l]);
|
|
714
|
+
const o = [], s = () => {
|
|
715
|
+
o.forEach((u) => u()), o.length = 0;
|
|
716
|
+
}, r = (u, f, a, p) => (u.addEventListener(f, a, p), () => u.removeEventListener(f, a, p)), c = A(
|
|
717
|
+
() => [L(t), P(i)],
|
|
718
|
+
([u, f]) => {
|
|
719
|
+
if (s(), !u)
|
|
581
720
|
return;
|
|
582
|
-
const
|
|
583
|
-
|
|
584
|
-
...n.flatMap((
|
|
721
|
+
const a = Mt(f) ? { ...f } : f;
|
|
722
|
+
o.push(
|
|
723
|
+
...n.flatMap((p) => l.map((v) => r(u, p, v, a)))
|
|
585
724
|
);
|
|
586
725
|
},
|
|
587
726
|
{ immediate: !0, flush: "post" }
|
|
588
|
-
),
|
|
589
|
-
|
|
727
|
+
), d = () => {
|
|
728
|
+
c(), s();
|
|
590
729
|
};
|
|
591
|
-
return
|
|
592
|
-
}
|
|
593
|
-
let
|
|
594
|
-
function
|
|
595
|
-
const { window:
|
|
596
|
-
if (!
|
|
597
|
-
return
|
|
598
|
-
|
|
730
|
+
return Ve(d), d;
|
|
731
|
+
}
|
|
732
|
+
let Oe = !1;
|
|
733
|
+
function Re(e, t, n = {}) {
|
|
734
|
+
const { window: l = Ue, ignore: i = [], capture: o = !0, detectIframe: s = !1 } = n;
|
|
735
|
+
if (!l)
|
|
736
|
+
return W;
|
|
737
|
+
le && !Oe && (Oe = !0, Array.from(l.document.body.children).forEach((a) => a.addEventListener("click", W)), l.document.documentElement.addEventListener("click", W));
|
|
599
738
|
let r = !0;
|
|
600
|
-
const
|
|
601
|
-
if (typeof
|
|
602
|
-
return Array.from(
|
|
739
|
+
const c = (a) => i.some((p) => {
|
|
740
|
+
if (typeof p == "string")
|
|
741
|
+
return Array.from(l.document.querySelectorAll(p)).some((v) => v === a.target || a.composedPath().includes(v));
|
|
603
742
|
{
|
|
604
|
-
const
|
|
605
|
-
return
|
|
743
|
+
const v = L(p);
|
|
744
|
+
return v && (a.target === v || a.composedPath().includes(v));
|
|
606
745
|
}
|
|
607
|
-
}),
|
|
608
|
-
|
|
609
|
-
const
|
|
610
|
-
if (!(!
|
|
611
|
-
if (
|
|
746
|
+
}), u = [
|
|
747
|
+
Y(l, "click", (a) => {
|
|
748
|
+
const p = L(e);
|
|
749
|
+
if (!(!p || p === a.target || a.composedPath().includes(p))) {
|
|
750
|
+
if (a.detail === 0 && (r = !c(a)), !r) {
|
|
612
751
|
r = !0;
|
|
613
752
|
return;
|
|
614
753
|
}
|
|
615
|
-
t(
|
|
754
|
+
t(a);
|
|
616
755
|
}
|
|
617
|
-
}, { passive: !0, capture:
|
|
618
|
-
|
|
619
|
-
const
|
|
620
|
-
r = !
|
|
756
|
+
}, { passive: !0, capture: o }),
|
|
757
|
+
Y(l, "pointerdown", (a) => {
|
|
758
|
+
const p = L(e);
|
|
759
|
+
r = !c(a) && !!(p && !a.composedPath().includes(p));
|
|
621
760
|
}, { passive: !0 }),
|
|
622
|
-
|
|
761
|
+
s && Y(l, "blur", (a) => {
|
|
623
762
|
setTimeout(() => {
|
|
624
|
-
var
|
|
625
|
-
const
|
|
626
|
-
((
|
|
763
|
+
var p;
|
|
764
|
+
const v = L(e);
|
|
765
|
+
((p = l.document.activeElement) == null ? void 0 : p.tagName) === "IFRAME" && !(v != null && v.contains(l.document.activeElement)) && t(a);
|
|
627
766
|
}, 0);
|
|
628
767
|
})
|
|
629
768
|
].filter(Boolean);
|
|
630
|
-
return () =>
|
|
769
|
+
return () => u.forEach((a) => a());
|
|
631
770
|
}
|
|
632
|
-
const
|
|
633
|
-
[
|
|
771
|
+
const jt = {
|
|
772
|
+
[$e.mounted](e, t) {
|
|
634
773
|
const n = !t.modifiers.bubble;
|
|
635
774
|
if (typeof t.value == "function")
|
|
636
|
-
e.__onClickOutside_stop =
|
|
775
|
+
e.__onClickOutside_stop = Re(e, t.value, { capture: n });
|
|
637
776
|
else {
|
|
638
|
-
const [
|
|
639
|
-
e.__onClickOutside_stop =
|
|
777
|
+
const [l, i] = t.value;
|
|
778
|
+
e.__onClickOutside_stop = Re(e, l, Object.assign({ capture: n }, i));
|
|
640
779
|
}
|
|
641
780
|
},
|
|
642
|
-
[
|
|
781
|
+
[$e.unmounted](e) {
|
|
643
782
|
e.__onClickOutside_stop();
|
|
644
783
|
}
|
|
645
784
|
};
|
|
646
|
-
function
|
|
785
|
+
function _(e) {
|
|
647
786
|
return typeof Window < "u" && e instanceof Window ? e.document.documentElement : typeof Document < "u" && e instanceof Document ? e.documentElement : e;
|
|
648
787
|
}
|
|
649
|
-
function
|
|
788
|
+
function ze(e) {
|
|
650
789
|
const t = window.getComputedStyle(e);
|
|
651
790
|
if (t.overflowX === "scroll" || t.overflowY === "scroll" || t.overflowX === "auto" && e.clientWidth < e.scrollWidth || t.overflowY === "auto" && e.clientHeight < e.scrollHeight)
|
|
652
791
|
return !0;
|
|
653
792
|
{
|
|
654
793
|
const n = e.parentNode;
|
|
655
|
-
return !n || n.tagName === "BODY" ? !1 :
|
|
794
|
+
return !n || n.tagName === "BODY" ? !1 : ze(n);
|
|
656
795
|
}
|
|
657
796
|
}
|
|
658
|
-
function
|
|
797
|
+
function Ht(e) {
|
|
659
798
|
const t = e || window.event, n = t.target;
|
|
660
|
-
return
|
|
661
|
-
}
|
|
662
|
-
const
|
|
663
|
-
function
|
|
664
|
-
const n =
|
|
665
|
-
let
|
|
666
|
-
|
|
667
|
-
const
|
|
668
|
-
if (
|
|
669
|
-
const
|
|
670
|
-
if (
|
|
799
|
+
return ze(n) ? !1 : t.touches.length > 1 ? !0 : (t.preventDefault && t.preventDefault(), !1);
|
|
800
|
+
}
|
|
801
|
+
const ee = /* @__PURE__ */ new WeakMap();
|
|
802
|
+
function Nt(e, t = !1) {
|
|
803
|
+
const n = g(t);
|
|
804
|
+
let l = null, i = "";
|
|
805
|
+
A(Wt(e), (r) => {
|
|
806
|
+
const c = _(P(r));
|
|
807
|
+
if (c) {
|
|
808
|
+
const d = c;
|
|
809
|
+
if (ee.get(d) || ee.set(d, d.style.overflow), d.style.overflow !== "hidden" && (i = d.style.overflow), d.style.overflow === "hidden")
|
|
671
810
|
return n.value = !0;
|
|
672
811
|
if (n.value)
|
|
673
|
-
return
|
|
812
|
+
return d.style.overflow = "hidden";
|
|
674
813
|
}
|
|
675
814
|
}, {
|
|
676
815
|
immediate: !0
|
|
677
816
|
});
|
|
678
|
-
const
|
|
679
|
-
const r =
|
|
680
|
-
!r || n.value || (
|
|
817
|
+
const o = () => {
|
|
818
|
+
const r = _(P(e));
|
|
819
|
+
!r || n.value || (le && (l = Y(
|
|
681
820
|
r,
|
|
682
821
|
"touchmove",
|
|
683
|
-
(
|
|
684
|
-
|
|
822
|
+
(c) => {
|
|
823
|
+
Ht(c);
|
|
685
824
|
},
|
|
686
825
|
{ passive: !1 }
|
|
687
826
|
)), r.style.overflow = "hidden", n.value = !0);
|
|
688
|
-
},
|
|
689
|
-
const r =
|
|
690
|
-
!r || !n.value || (
|
|
827
|
+
}, s = () => {
|
|
828
|
+
const r = _(P(e));
|
|
829
|
+
!r || !n.value || (le && (l == null || l()), r.style.overflow = i, ee.delete(r), n.value = !1);
|
|
691
830
|
};
|
|
692
|
-
return
|
|
831
|
+
return Ve(s), E({
|
|
693
832
|
get() {
|
|
694
833
|
return n.value;
|
|
695
834
|
},
|
|
696
835
|
set(r) {
|
|
697
|
-
r ?
|
|
836
|
+
r ? o() : s();
|
|
698
837
|
}
|
|
699
838
|
});
|
|
700
839
|
}
|
|
701
|
-
function
|
|
840
|
+
function Vt() {
|
|
702
841
|
let e = !1;
|
|
703
|
-
const t =
|
|
704
|
-
return (n,
|
|
705
|
-
if (t.value =
|
|
842
|
+
const t = g(!1);
|
|
843
|
+
return (n, l) => {
|
|
844
|
+
if (t.value = l.value, e)
|
|
706
845
|
return;
|
|
707
846
|
e = !0;
|
|
708
|
-
const
|
|
709
|
-
|
|
847
|
+
const i = Nt(n, l.value);
|
|
848
|
+
A(t, (o) => i.value = o);
|
|
710
849
|
};
|
|
711
850
|
}
|
|
712
|
-
|
|
713
|
-
var
|
|
714
|
-
for (var
|
|
715
|
-
|
|
716
|
-
function
|
|
717
|
-
return (
|
|
851
|
+
Vt();
|
|
852
|
+
var x = [];
|
|
853
|
+
for (var te = 0; te < 256; ++te)
|
|
854
|
+
x.push((te + 256).toString(16).slice(1));
|
|
855
|
+
function Bt(e, t = 0) {
|
|
856
|
+
return (x[e[t + 0]] + x[e[t + 1]] + x[e[t + 2]] + x[e[t + 3]] + "-" + x[e[t + 4]] + x[e[t + 5]] + "-" + x[e[t + 6]] + x[e[t + 7]] + "-" + x[e[t + 8]] + x[e[t + 9]] + "-" + x[e[t + 10]] + x[e[t + 11]] + x[e[t + 12]] + x[e[t + 13]] + x[e[t + 14]] + x[e[t + 15]]).toLowerCase();
|
|
718
857
|
}
|
|
719
|
-
var
|
|
720
|
-
function
|
|
721
|
-
if (!
|
|
858
|
+
var F, Ut = new Uint8Array(16);
|
|
859
|
+
function zt() {
|
|
860
|
+
if (!F && (F = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !F))
|
|
722
861
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
723
|
-
return
|
|
862
|
+
return F(Ut);
|
|
724
863
|
}
|
|
725
|
-
var
|
|
726
|
-
const
|
|
727
|
-
randomUUID:
|
|
864
|
+
var Ft = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
865
|
+
const De = {
|
|
866
|
+
randomUUID: Ft
|
|
728
867
|
};
|
|
729
|
-
function
|
|
730
|
-
if (
|
|
731
|
-
return
|
|
868
|
+
function Gt(e, t, n) {
|
|
869
|
+
if (De.randomUUID && !t && !e)
|
|
870
|
+
return De.randomUUID();
|
|
732
871
|
e = e || {};
|
|
733
|
-
var
|
|
734
|
-
return
|
|
735
|
-
}
|
|
736
|
-
class
|
|
737
|
-
constructor(t, n,
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
this.id = t ||
|
|
872
|
+
var l = e.random || (e.rng || zt)();
|
|
873
|
+
return l[6] = l[6] & 15 | 64, l[8] = l[8] & 63 | 128, Bt(l);
|
|
874
|
+
}
|
|
875
|
+
class qt {
|
|
876
|
+
constructor(t, n, l, i, o, s) {
|
|
877
|
+
O(this, "id");
|
|
878
|
+
O(this, "rows");
|
|
879
|
+
O(this, "columns");
|
|
880
|
+
O(this, "config");
|
|
881
|
+
O(this, "table");
|
|
882
|
+
O(this, "display");
|
|
883
|
+
O(this, "modal");
|
|
884
|
+
this.id = t || Gt(), this.rows = l, this.columns = T(n), this.config = T(i), this.table = o || T(this.createTableObject()), this.display = this.createDisplayObject(s), this.modal = T({ visible: !1 });
|
|
746
885
|
}
|
|
747
886
|
createTableObject() {
|
|
748
887
|
const t = {};
|
|
749
|
-
for (const [n,
|
|
750
|
-
for (const [
|
|
751
|
-
t[`${n}:${
|
|
888
|
+
for (const [n, l] of this.columns.entries())
|
|
889
|
+
for (const [i, o] of this.rows.entries())
|
|
890
|
+
t[`${n}:${i}`] = o[l.name];
|
|
752
891
|
return t;
|
|
753
892
|
}
|
|
754
893
|
createDisplayObject(t) {
|
|
755
894
|
const n = [Object.assign({}, { modified: !1 })];
|
|
756
895
|
if (t && "0:0" in t)
|
|
757
896
|
return t;
|
|
758
|
-
const
|
|
759
|
-
for (let
|
|
760
|
-
const
|
|
761
|
-
|
|
897
|
+
const l = /* @__PURE__ */ new Set();
|
|
898
|
+
for (let i = this.rows.length - 1; i >= 0; i--) {
|
|
899
|
+
const o = this.rows[i];
|
|
900
|
+
o.parent && l.add(o.parent), n[i] = {
|
|
762
901
|
childrenOpen: !1,
|
|
763
902
|
expanded: !1,
|
|
764
|
-
indent:
|
|
765
|
-
isParent:
|
|
766
|
-
isRoot:
|
|
903
|
+
indent: o.indent || null,
|
|
904
|
+
isParent: l.has(i),
|
|
905
|
+
isRoot: o.parent === null || o.parent === void 0,
|
|
767
906
|
modified: !1,
|
|
768
|
-
open:
|
|
769
|
-
parent:
|
|
907
|
+
open: o.parent === null || o.parent === void 0,
|
|
908
|
+
parent: o.parent
|
|
770
909
|
};
|
|
771
910
|
}
|
|
772
|
-
return
|
|
911
|
+
return T(n);
|
|
773
912
|
}
|
|
774
913
|
get zeroColumn() {
|
|
775
914
|
return ["list", "tree", "list-expansion"].includes(this.config.view);
|
|
776
915
|
}
|
|
777
916
|
get numberedRowWidth() {
|
|
778
|
-
return
|
|
917
|
+
return E(() => String(Math.ceil(this.rows.length / 100) + 1) + "ch");
|
|
779
918
|
}
|
|
780
919
|
cellData(t, n) {
|
|
781
920
|
return this.table[`${t}:${n}`];
|
|
782
921
|
}
|
|
783
|
-
setCellData(t, n,
|
|
784
|
-
this.table[`${n}:${t}`] !==
|
|
785
|
-
const
|
|
786
|
-
return this.rows[t][
|
|
922
|
+
setCellData(t, n, l) {
|
|
923
|
+
this.table[`${n}:${t}`] !== l && (this.display[t].modified = !0), this.table[`${n}:${t}`] = l;
|
|
924
|
+
const i = this.columns[n];
|
|
925
|
+
return this.rows[t][i.name] = l, this.table[`${n}:${t}`];
|
|
787
926
|
}
|
|
788
927
|
toggleRowExpand(t) {
|
|
789
928
|
if (this.config.view === "tree") {
|
|
@@ -793,43 +932,45 @@ class Dt {
|
|
|
793
932
|
} else this.config.view === "list-expansion" && (this.display[t].expanded = !this.display[t].expanded);
|
|
794
933
|
}
|
|
795
934
|
}
|
|
796
|
-
const
|
|
935
|
+
const Yt = {
|
|
797
936
|
key: 0,
|
|
798
937
|
id: "resizable"
|
|
799
|
-
},
|
|
938
|
+
}, Xt = {
|
|
800
939
|
class: "atable-header-row",
|
|
801
940
|
tabindex: "-1"
|
|
802
|
-
},
|
|
803
|
-
key: 0,
|
|
804
|
-
id: "header-index"
|
|
805
|
-
}, Le = /* @__PURE__ */ T({
|
|
941
|
+
}, Fe = /* @__PURE__ */ D({
|
|
806
942
|
__name: "ATableHeader",
|
|
807
943
|
props: {
|
|
808
944
|
columns: {},
|
|
809
945
|
tableid: {}
|
|
810
946
|
},
|
|
811
947
|
setup(e) {
|
|
812
|
-
const t =
|
|
813
|
-
minWidth:
|
|
814
|
-
textAlign:
|
|
948
|
+
const t = Q(e.tableid), n = E(() => t.columns.some((i) => i.pinned)), l = (i) => ({
|
|
949
|
+
minWidth: i.width || "40ch",
|
|
950
|
+
textAlign: i.align || "center",
|
|
815
951
|
width: t.config.fullWidth ? "auto" : null
|
|
816
952
|
});
|
|
817
|
-
return (
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
953
|
+
return (i, o) => i.columns.length ? (b(), k("thead", Yt, [
|
|
954
|
+
M("tr", Xt, [
|
|
955
|
+
m(t).zeroColumn ? (b(), k("th", {
|
|
956
|
+
key: 0,
|
|
957
|
+
id: "header-index",
|
|
958
|
+
class: j(n.value ? "sticky-index" : "")
|
|
959
|
+
}, null, 2)) : J("", !0),
|
|
960
|
+
(b(!0), k(X, null, oe(i.columns, (s, r) => (b(), k("th", {
|
|
961
|
+
key: s.name,
|
|
822
962
|
tabindex: "-1",
|
|
823
|
-
style:
|
|
963
|
+
style: q(l(s)),
|
|
964
|
+
class: j(s.pinned ? "sticky-column" : "")
|
|
824
965
|
}, [
|
|
825
|
-
I(
|
|
826
|
-
|
|
966
|
+
I(i.$slots, "default", {}, () => [
|
|
967
|
+
Ke(H(s.label || String.fromCharCode(r + 97).toUpperCase()), 1)
|
|
827
968
|
])
|
|
828
|
-
],
|
|
969
|
+
], 6))), 128))
|
|
829
970
|
])
|
|
830
|
-
])) :
|
|
971
|
+
])) : J("", !0);
|
|
831
972
|
}
|
|
832
|
-
}),
|
|
973
|
+
}), Ge = /* @__PURE__ */ D({
|
|
833
974
|
__name: "ATableModal",
|
|
834
975
|
props: {
|
|
835
976
|
colIndex: {},
|
|
@@ -840,7 +981,7 @@ const Tt = {
|
|
|
840
981
|
const t = (n) => {
|
|
841
982
|
n.stopPropagation();
|
|
842
983
|
};
|
|
843
|
-
return (n,
|
|
984
|
+
return (n, l) => (b(), k("div", {
|
|
844
985
|
class: "amodal",
|
|
845
986
|
tabindex: "-1",
|
|
846
987
|
onClick: t,
|
|
@@ -849,117 +990,133 @@ const Tt = {
|
|
|
849
990
|
I(n.$slots, "default")
|
|
850
991
|
], 32));
|
|
851
992
|
}
|
|
852
|
-
}),
|
|
993
|
+
}), Jt = /* @__PURE__ */ D({
|
|
853
994
|
__name: "ATable",
|
|
854
995
|
props: {
|
|
855
996
|
id: {},
|
|
856
997
|
modelValue: {},
|
|
857
998
|
columns: {},
|
|
858
999
|
rows: { default: () => [] },
|
|
859
|
-
config: { default: () => new Object() }
|
|
860
|
-
tableid: {}
|
|
1000
|
+
config: { default: () => new Object() }
|
|
861
1001
|
},
|
|
862
1002
|
emits: ["update:modelValue"],
|
|
863
1003
|
setup(e, { emit: t }) {
|
|
864
|
-
const n = t,
|
|
865
|
-
|
|
866
|
-
() =>
|
|
867
|
-
(
|
|
868
|
-
n("update:modelValue",
|
|
1004
|
+
const n = t, l = Z("table"), i = e.modelValue ? e.modelValue : e.rows, o = new qt(e.id, e.columns, i, e.config);
|
|
1005
|
+
_e(o.id, o), A(
|
|
1006
|
+
() => o.rows,
|
|
1007
|
+
(c) => {
|
|
1008
|
+
n("update:modelValue", c);
|
|
869
1009
|
},
|
|
870
1010
|
{ deep: !0 }
|
|
871
|
-
)
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
1011
|
+
), B(() => {
|
|
1012
|
+
e.columns.some((c) => c.pinned) && (s(), o.config.view === "tree" && je(l, s, { childList: !0, subtree: !0 }));
|
|
1013
|
+
});
|
|
1014
|
+
const s = () => {
|
|
1015
|
+
const c = l.value, d = c.rows[0], u = c.rows[1], f = d ? Array.from(d.cells) : [];
|
|
1016
|
+
for (const [a, p] of f.entries()) {
|
|
1017
|
+
const v = u.cells[a];
|
|
1018
|
+
v && (p.style.width = `${v.offsetWidth}px`);
|
|
1019
|
+
}
|
|
1020
|
+
for (const a of c.rows) {
|
|
1021
|
+
let p = 0;
|
|
1022
|
+
const v = [];
|
|
1023
|
+
for (const C of a.cells)
|
|
1024
|
+
(C.classList.contains("sticky-column") || C.classList.contains("sticky-index")) && (C.style.left = `${p}px`, p += C.offsetWidth, v.push(C));
|
|
1025
|
+
v.length > 0 && v[v.length - 1].classList.add("sticky-column-edge");
|
|
1026
|
+
}
|
|
1027
|
+
}, r = (c) => {
|
|
1028
|
+
var d;
|
|
1029
|
+
c.target instanceof Node && (d = o.modal.parent) != null && d.contains(c.target) || o.modal.visible && (o.modal.visible = !1);
|
|
875
1030
|
};
|
|
876
|
-
return window.addEventListener("keydown", (
|
|
877
|
-
if (
|
|
878
|
-
|
|
879
|
-
const
|
|
880
|
-
|
|
881
|
-
|
|
1031
|
+
return window.addEventListener("keydown", (c) => {
|
|
1032
|
+
if (c.key === "Escape" && o.modal.visible) {
|
|
1033
|
+
o.modal.visible = !1;
|
|
1034
|
+
const d = o.modal.parent;
|
|
1035
|
+
d && Te().then(() => {
|
|
1036
|
+
d.focus();
|
|
882
1037
|
});
|
|
883
1038
|
}
|
|
884
|
-
}), (
|
|
1039
|
+
}), (c, d) => ne((b(), k("table", {
|
|
1040
|
+
ref: "table",
|
|
885
1041
|
class: "atable",
|
|
886
|
-
style:
|
|
1042
|
+
style: q({ width: m(o).config.fullWidth ? "100%" : "auto" })
|
|
887
1043
|
}, [
|
|
888
|
-
I(
|
|
889
|
-
|
|
890
|
-
columns:
|
|
891
|
-
tableid:
|
|
1044
|
+
I(c.$slots, "header", { data: m(o) }, () => [
|
|
1045
|
+
ge(Fe, {
|
|
1046
|
+
columns: m(o).columns,
|
|
1047
|
+
tableid: m(o).id
|
|
892
1048
|
}, null, 8, ["columns", "tableid"])
|
|
893
1049
|
]),
|
|
894
|
-
|
|
895
|
-
I(
|
|
896
|
-
(
|
|
1050
|
+
M("tbody", null, [
|
|
1051
|
+
I(c.$slots, "body", { data: m(o) }, () => [
|
|
1052
|
+
(b(!0), k(X, null, oe(m(o).rows, (u, f) => (b(), G(Ne, {
|
|
897
1053
|
key: u.id,
|
|
898
1054
|
row: u,
|
|
899
|
-
rowIndex:
|
|
900
|
-
tableid:
|
|
1055
|
+
rowIndex: f,
|
|
1056
|
+
tableid: m(o).id
|
|
901
1057
|
}, {
|
|
902
|
-
default:
|
|
903
|
-
(
|
|
904
|
-
key:
|
|
905
|
-
tableid:
|
|
906
|
-
col:
|
|
1058
|
+
default: be(() => [
|
|
1059
|
+
(b(!0), k(X, null, oe(m(o).columns, (a, p) => (b(), G(He, {
|
|
1060
|
+
key: a.name,
|
|
1061
|
+
tableid: m(o).id,
|
|
1062
|
+
col: a,
|
|
907
1063
|
spellcheck: "false",
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
1064
|
+
pinned: a.pinned,
|
|
1065
|
+
rowIndex: f,
|
|
1066
|
+
colIndex: p + (m(o).zeroColumn ? 0 : -1),
|
|
1067
|
+
component: a.cellComponent,
|
|
1068
|
+
style: q({
|
|
1069
|
+
textAlign: (a == null ? void 0 : a.align) || "center",
|
|
1070
|
+
minWidth: (a == null ? void 0 : a.width) || "40ch",
|
|
1071
|
+
width: m(o).config.fullWidth ? "auto" : null
|
|
915
1072
|
})
|
|
916
|
-
}, null, 8, ["tableid", "col", "rowIndex", "colIndex", "component", "style"]))), 128))
|
|
1073
|
+
}, null, 8, ["tableid", "col", "pinned", "rowIndex", "colIndex", "component", "style"]))), 128))
|
|
917
1074
|
]),
|
|
918
1075
|
_: 2
|
|
919
1076
|
}, 1032, ["row", "rowIndex", "tableid"]))), 128))
|
|
920
1077
|
])
|
|
921
1078
|
]),
|
|
922
|
-
I(
|
|
923
|
-
I(
|
|
924
|
-
|
|
925
|
-
colIndex:
|
|
926
|
-
rowIndex:
|
|
927
|
-
tableid:
|
|
928
|
-
style:
|
|
929
|
-
left:
|
|
930
|
-
top:
|
|
931
|
-
maxWidth:
|
|
1079
|
+
I(c.$slots, "footer", { data: m(o) }),
|
|
1080
|
+
I(c.$slots, "modal", { data: m(o) }, () => [
|
|
1081
|
+
ne(ge(Ge, {
|
|
1082
|
+
colIndex: m(o).modal.colIndex,
|
|
1083
|
+
rowIndex: m(o).modal.rowIndex,
|
|
1084
|
+
tableid: m(o).id,
|
|
1085
|
+
style: q({
|
|
1086
|
+
left: m(o).modal.left + "px",
|
|
1087
|
+
top: m(o).modal.top + "px",
|
|
1088
|
+
maxWidth: m(o).modal.width + "px"
|
|
932
1089
|
})
|
|
933
1090
|
}, {
|
|
934
|
-
default:
|
|
935
|
-
(
|
|
936
|
-
key: `${
|
|
937
|
-
colIndex:
|
|
938
|
-
rowIndex:
|
|
939
|
-
tableid:
|
|
940
|
-
},
|
|
1091
|
+
default: be(() => [
|
|
1092
|
+
(b(), G(Le(m(o).modal.component), ae({
|
|
1093
|
+
key: `${m(o).modal.rowIndex}:${m(o).modal.colIndex}`,
|
|
1094
|
+
colIndex: m(o).modal.colIndex,
|
|
1095
|
+
rowIndex: m(o).modal.rowIndex,
|
|
1096
|
+
tableid: m(o).id
|
|
1097
|
+
}, m(o).modal.componentProps), null, 16, ["colIndex", "rowIndex", "tableid"]))
|
|
941
1098
|
]),
|
|
942
1099
|
_: 1
|
|
943
1100
|
}, 8, ["colIndex", "rowIndex", "tableid", "style"]), [
|
|
944
|
-
[
|
|
1101
|
+
[Me, m(o).modal.visible]
|
|
945
1102
|
])
|
|
946
1103
|
])
|
|
947
1104
|
], 4)), [
|
|
948
|
-
[
|
|
1105
|
+
[m(jt), r]
|
|
949
1106
|
]);
|
|
950
1107
|
}
|
|
951
1108
|
});
|
|
952
|
-
function
|
|
953
|
-
e.component("ACell",
|
|
1109
|
+
function Kt(e) {
|
|
1110
|
+
e.component("ACell", He), e.component("AExpansionRow", Dt), e.component("ARow", Ne), e.component("ATable", Jt), e.component("ATableHeader", Fe), e.component("ATableModal", Ge);
|
|
954
1111
|
}
|
|
955
1112
|
export {
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
1113
|
+
He as ACell,
|
|
1114
|
+
Dt as AExpansionRow,
|
|
1115
|
+
Ne as ARow,
|
|
1116
|
+
Jt as ATable,
|
|
1117
|
+
Fe as ATableHeader,
|
|
1118
|
+
Ge as ATableModal,
|
|
1119
|
+
qt as TableDataStore,
|
|
1120
|
+
Kt as install
|
|
964
1121
|
};
|
|
965
1122
|
//# sourceMappingURL=atable.js.map
|