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