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