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