@stonecrop/atable 0.2.61 → 0.2.63
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 +380 -380
- 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/ATable.vue +2 -0
package/dist/atable.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import './assets/index.css';var Ue = Object.defineProperty;
|
|
2
2
|
var qe = (e, t, n) => t in e ? Ue(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var T = (e, t, n) => qe(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
-
import { onMounted as G, ref as
|
|
4
|
+
import { onMounted as G, ref as g, watch as C, onBeforeUnmount as Ye, computed as x, unref as m, getCurrentScope as ie, onScopeDispose as se, getCurrentInstance as re, nextTick as Te, defineComponent as M, inject as Q, useTemplateRef as Z, openBlock as y, createElementBlock as k, normalizeStyle as P, normalizeClass as N, createBlock as Y, resolveDynamicComponent as De, mergeProps as ae, toDisplayString as B, Fragment as J, createElementVNode as W, renderSlot as S, createCommentVNode as V, 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
5
|
function Re(e) {
|
|
6
6
|
return ie() ? (se(e), !0) : !1;
|
|
7
7
|
}
|
|
@@ -18,30 +18,30 @@ function z(e) {
|
|
|
18
18
|
return (t = n == null ? void 0 : n.$el) != null ? t : n;
|
|
19
19
|
}
|
|
20
20
|
function F(...e) {
|
|
21
|
-
let t, n,
|
|
22
|
-
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n,
|
|
21
|
+
let t, n, o, i;
|
|
22
|
+
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, o, i] = e, t = U) : [t, n, o, i] = e, !t)
|
|
23
23
|
return ot;
|
|
24
|
-
Array.isArray(n) || (n = [n]), Array.isArray(
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
},
|
|
24
|
+
Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
|
|
25
|
+
const s = [], l = () => {
|
|
26
|
+
s.forEach((d) => d()), s.length = 0;
|
|
27
|
+
}, a = (d, p, c, u) => (d.addEventListener(p, c, u), () => d.removeEventListener(p, c, u)), f = C(
|
|
28
28
|
() => [z(t), ce(i)],
|
|
29
|
-
([
|
|
30
|
-
if (
|
|
29
|
+
([d, p]) => {
|
|
30
|
+
if (l(), !d)
|
|
31
31
|
return;
|
|
32
32
|
const c = nt(p) ? { ...p } : p;
|
|
33
|
-
|
|
34
|
-
...n.flatMap((
|
|
33
|
+
s.push(
|
|
34
|
+
...n.flatMap((u) => o.map((v) => a(d, u, v, c)))
|
|
35
35
|
);
|
|
36
36
|
},
|
|
37
37
|
{ immediate: !0, flush: "post" }
|
|
38
38
|
), r = () => {
|
|
39
|
-
|
|
39
|
+
f(), l();
|
|
40
40
|
};
|
|
41
41
|
return Re(r), r;
|
|
42
42
|
}
|
|
43
43
|
function lt() {
|
|
44
|
-
const e =
|
|
44
|
+
const e = g(!1), t = re();
|
|
45
45
|
return t && G(() => {
|
|
46
46
|
e.value = !0;
|
|
47
47
|
}, t), e;
|
|
@@ -51,69 +51,69 @@ function it(e) {
|
|
|
51
51
|
return x(() => (t.value, !!e()));
|
|
52
52
|
}
|
|
53
53
|
function st(e, t, n = {}) {
|
|
54
|
-
const { window:
|
|
55
|
-
let
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
},
|
|
59
|
-
const c = ce(e),
|
|
60
|
-
return new Set(
|
|
54
|
+
const { window: o = U, ...i } = n;
|
|
55
|
+
let s;
|
|
56
|
+
const l = it(() => o && "MutationObserver" in o), a = () => {
|
|
57
|
+
s && (s.disconnect(), s = void 0);
|
|
58
|
+
}, f = x(() => {
|
|
59
|
+
const c = ce(e), u = (Array.isArray(c) ? c : [c]).map(z).filter(et);
|
|
60
|
+
return new Set(u);
|
|
61
61
|
}), r = C(
|
|
62
|
-
() =>
|
|
62
|
+
() => f.value,
|
|
63
63
|
(c) => {
|
|
64
|
-
|
|
64
|
+
a(), l.value && c.size && (s = new MutationObserver(t), c.forEach((u) => s.observe(u, i)));
|
|
65
65
|
},
|
|
66
66
|
{ immediate: !0, flush: "post" }
|
|
67
|
-
),
|
|
68
|
-
r(),
|
|
67
|
+
), d = () => s == null ? void 0 : s.takeRecords(), p = () => {
|
|
68
|
+
r(), a();
|
|
69
69
|
};
|
|
70
70
|
return Re(p), {
|
|
71
|
-
isSupported:
|
|
71
|
+
isSupported: l,
|
|
72
72
|
stop: p,
|
|
73
|
-
takeRecords:
|
|
73
|
+
takeRecords: d
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
76
|
function rt(e = {}) {
|
|
77
77
|
var t;
|
|
78
78
|
const {
|
|
79
79
|
window: n = U,
|
|
80
|
-
deep:
|
|
80
|
+
deep: o = !0,
|
|
81
81
|
triggerOnRemoval: i = !1
|
|
82
|
-
} = e,
|
|
82
|
+
} = e, s = (t = e.document) != null ? t : n == null ? void 0 : n.document, l = () => {
|
|
83
83
|
var r;
|
|
84
|
-
let
|
|
85
|
-
if (
|
|
86
|
-
for (;
|
|
87
|
-
|
|
88
|
-
return
|
|
89
|
-
},
|
|
90
|
-
|
|
84
|
+
let d = s == null ? void 0 : s.activeElement;
|
|
85
|
+
if (o)
|
|
86
|
+
for (; d != null && d.shadowRoot; )
|
|
87
|
+
d = (r = d == null ? void 0 : d.shadowRoot) == null ? void 0 : r.activeElement;
|
|
88
|
+
return d;
|
|
89
|
+
}, a = g(), f = () => {
|
|
90
|
+
a.value = l();
|
|
91
91
|
};
|
|
92
92
|
return n && (F(n, "blur", (r) => {
|
|
93
|
-
r.relatedTarget === null &&
|
|
94
|
-
}, !0), F(n, "focus",
|
|
95
|
-
r.filter((
|
|
96
|
-
|
|
93
|
+
r.relatedTarget === null && f();
|
|
94
|
+
}, !0), F(n, "focus", f, !0)), i && st(s, (r) => {
|
|
95
|
+
r.filter((d) => d.removedNodes.length).map((d) => Array.from(d.removedNodes)).flat().forEach((d) => {
|
|
96
|
+
d === a.value && f();
|
|
97
97
|
});
|
|
98
98
|
}, {
|
|
99
99
|
childList: !0,
|
|
100
100
|
subtree: !0
|
|
101
|
-
}),
|
|
101
|
+
}), f(), a;
|
|
102
102
|
}
|
|
103
103
|
const at = "focusin", ct = "focusout";
|
|
104
104
|
function dt(e, t = {}) {
|
|
105
|
-
const { window: n = U } = t,
|
|
106
|
-
return !n || !
|
|
105
|
+
const { window: n = U } = t, o = x(() => z(e)), i = g(!1), s = x(() => i.value), l = rt(t);
|
|
106
|
+
return !n || !l.value ? { focused: s } : (F(o, at, () => i.value = !0), F(o, ct, () => i.value = !1), { focused: s });
|
|
107
107
|
}
|
|
108
108
|
function ut(e, { window: t = U, scrollTarget: n } = {}) {
|
|
109
|
-
const
|
|
109
|
+
const o = g(!1), i = () => {
|
|
110
110
|
if (!t) return;
|
|
111
|
-
const
|
|
112
|
-
if (!
|
|
113
|
-
|
|
111
|
+
const s = t.document, l = z(e);
|
|
112
|
+
if (!l)
|
|
113
|
+
o.value = !1;
|
|
114
114
|
else {
|
|
115
|
-
const
|
|
116
|
-
|
|
115
|
+
const a = l.getBoundingClientRect();
|
|
116
|
+
o.value = a.top <= (t.innerHeight || s.documentElement.clientHeight) && a.left <= (t.innerWidth || s.documentElement.clientWidth) && a.bottom >= 0 && a.right >= 0;
|
|
117
117
|
}
|
|
118
118
|
};
|
|
119
119
|
return C(
|
|
@@ -123,7 +123,7 @@ function ut(e, { window: t = U, scrollTarget: n } = {}) {
|
|
|
123
123
|
), t && F(n || t, "scroll", i, {
|
|
124
124
|
capture: !1,
|
|
125
125
|
passive: !0
|
|
126
|
-
}),
|
|
126
|
+
}), o;
|
|
127
127
|
}
|
|
128
128
|
const O = (e) => {
|
|
129
129
|
let t = ut(e).value;
|
|
@@ -135,34 +135,34 @@ const O = (e) => {
|
|
|
135
135
|
var t;
|
|
136
136
|
let n;
|
|
137
137
|
if (e instanceof HTMLTableCellElement) {
|
|
138
|
-
const
|
|
139
|
-
if (
|
|
140
|
-
const i = Array.from(
|
|
138
|
+
const o = (t = e.parentElement) == null ? void 0 : t.previousElementSibling;
|
|
139
|
+
if (o) {
|
|
140
|
+
const i = Array.from(o.children)[e.cellIndex];
|
|
141
141
|
i && (n = i);
|
|
142
142
|
}
|
|
143
143
|
} else if (e instanceof HTMLTableRowElement) {
|
|
144
|
-
const
|
|
145
|
-
|
|
144
|
+
const o = e.previousElementSibling;
|
|
145
|
+
o && (n = o);
|
|
146
146
|
}
|
|
147
147
|
return n && (!$(n) || !O(n)) ? de(n) : n;
|
|
148
148
|
}, ft = (e) => {
|
|
149
149
|
var t;
|
|
150
150
|
const n = e.target;
|
|
151
|
-
let
|
|
151
|
+
let o;
|
|
152
152
|
if (n instanceof HTMLTableCellElement) {
|
|
153
153
|
const i = (t = n.parentElement) == null ? void 0 : t.parentElement;
|
|
154
154
|
if (i) {
|
|
155
|
-
const
|
|
156
|
-
|
|
155
|
+
const s = i.firstElementChild.children[n.cellIndex];
|
|
156
|
+
s && (o = s);
|
|
157
157
|
}
|
|
158
158
|
} else if (n instanceof HTMLTableRowElement) {
|
|
159
159
|
const i = n.parentElement;
|
|
160
160
|
if (i) {
|
|
161
|
-
const
|
|
162
|
-
|
|
161
|
+
const s = i.firstElementChild;
|
|
162
|
+
s && (o = s);
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
|
-
return
|
|
165
|
+
return o && (!$(o) || !O(o)) ? ue(o) : o;
|
|
166
166
|
}, xe = (e) => {
|
|
167
167
|
const t = e.target;
|
|
168
168
|
return ue(t);
|
|
@@ -170,34 +170,34 @@ const O = (e) => {
|
|
|
170
170
|
var t;
|
|
171
171
|
let n;
|
|
172
172
|
if (e instanceof HTMLTableCellElement) {
|
|
173
|
-
const
|
|
174
|
-
if (
|
|
175
|
-
const i = Array.from(
|
|
173
|
+
const o = (t = e.parentElement) == null ? void 0 : t.nextElementSibling;
|
|
174
|
+
if (o) {
|
|
175
|
+
const i = Array.from(o.children)[e.cellIndex];
|
|
176
176
|
i && (n = i);
|
|
177
177
|
}
|
|
178
178
|
} else if (e instanceof HTMLTableRowElement) {
|
|
179
|
-
const
|
|
180
|
-
|
|
179
|
+
const o = e.nextElementSibling;
|
|
180
|
+
o && (n = o);
|
|
181
181
|
}
|
|
182
182
|
return n && (!$(n) || !O(n)) ? ue(n) : n;
|
|
183
183
|
}, pt = (e) => {
|
|
184
184
|
var t;
|
|
185
185
|
const n = e.target;
|
|
186
|
-
let
|
|
186
|
+
let o;
|
|
187
187
|
if (n instanceof HTMLTableCellElement) {
|
|
188
188
|
const i = (t = n.parentElement) == null ? void 0 : t.parentElement;
|
|
189
189
|
if (i) {
|
|
190
|
-
const
|
|
191
|
-
|
|
190
|
+
const s = i.lastElementChild.children[n.cellIndex];
|
|
191
|
+
s && (o = s);
|
|
192
192
|
}
|
|
193
193
|
} else if (n instanceof HTMLTableRowElement) {
|
|
194
194
|
const i = n.parentElement;
|
|
195
195
|
if (i) {
|
|
196
|
-
const
|
|
197
|
-
|
|
196
|
+
const s = i.lastElementChild;
|
|
197
|
+
s && (o = s);
|
|
198
198
|
}
|
|
199
199
|
}
|
|
200
|
-
return
|
|
200
|
+
return o && (!$(o) || !O(o)) ? de(o) : o;
|
|
201
201
|
}, Ee = (e) => {
|
|
202
202
|
const t = e.target;
|
|
203
203
|
return fe(t);
|
|
@@ -207,8 +207,8 @@ const O = (e) => {
|
|
|
207
207
|
if (e.previousElementSibling)
|
|
208
208
|
n = e.previousElementSibling;
|
|
209
209
|
else {
|
|
210
|
-
const
|
|
211
|
-
n =
|
|
210
|
+
const o = (t = e.parentElement) == null ? void 0 : t.previousElementSibling;
|
|
211
|
+
n = o == null ? void 0 : o.lastElementChild;
|
|
212
212
|
}
|
|
213
213
|
return n && (!$(n) || !O(n)) ? fe(n) : n;
|
|
214
214
|
}, ke = (e) => {
|
|
@@ -220,8 +220,8 @@ const O = (e) => {
|
|
|
220
220
|
if (e.nextElementSibling)
|
|
221
221
|
n = e.nextElementSibling;
|
|
222
222
|
else {
|
|
223
|
-
const
|
|
224
|
-
n =
|
|
223
|
+
const o = (t = e.parentElement) == null ? void 0 : t.nextElementSibling;
|
|
224
|
+
n = o == null ? void 0 : o.firstElementChild;
|
|
225
225
|
}
|
|
226
226
|
return n && (!$(n) || !O(n)) ? pe(n) : n;
|
|
227
227
|
}, Ce = (e) => {
|
|
@@ -300,66 +300,66 @@ const O = (e) => {
|
|
|
300
300
|
}
|
|
301
301
|
};
|
|
302
302
|
function ve(e) {
|
|
303
|
-
const t = (
|
|
304
|
-
let
|
|
305
|
-
return
|
|
306
|
-
}, n = (
|
|
307
|
-
const
|
|
308
|
-
let
|
|
309
|
-
if (typeof
|
|
310
|
-
|
|
311
|
-
else if (Array.isArray(
|
|
312
|
-
for (const r of
|
|
313
|
-
r instanceof HTMLElement ?
|
|
314
|
-
else if (
|
|
315
|
-
|
|
316
|
-
else if (Array.isArray(
|
|
317
|
-
for (const r of
|
|
318
|
-
r instanceof HTMLElement ?
|
|
303
|
+
const t = (l) => {
|
|
304
|
+
let a = null;
|
|
305
|
+
return l.parent && (typeof l.parent == "string" ? a = document.querySelector(l.parent) : l.parent instanceof HTMLElement ? a = l.parent : a = l.parent.value), a;
|
|
306
|
+
}, n = (l) => {
|
|
307
|
+
const a = t(l);
|
|
308
|
+
let f = [];
|
|
309
|
+
if (typeof l.selectors == "string")
|
|
310
|
+
f = a ? Array.from(a.querySelectorAll(l.selectors)) : Array.from(document.querySelectorAll(l.selectors));
|
|
311
|
+
else if (Array.isArray(l.selectors))
|
|
312
|
+
for (const r of l.selectors)
|
|
313
|
+
r instanceof HTMLElement ? f.push(r) : f.push(r.$el);
|
|
314
|
+
else if (l.selectors instanceof HTMLElement)
|
|
315
|
+
f.push(l.selectors);
|
|
316
|
+
else if (Array.isArray(l.selectors.value))
|
|
317
|
+
for (const r of l.selectors.value)
|
|
318
|
+
r instanceof HTMLElement ? f.push(r) : f.push(r.$el);
|
|
319
319
|
else
|
|
320
|
-
|
|
321
|
-
return
|
|
322
|
-
},
|
|
323
|
-
const
|
|
324
|
-
let
|
|
325
|
-
return
|
|
326
|
-
}, i = (
|
|
327
|
-
const
|
|
328
|
-
if (q.includes(
|
|
329
|
-
const r =
|
|
330
|
-
for (const
|
|
331
|
-
const [p, ...c] =
|
|
332
|
-
if (p === "keydown" && c.includes(
|
|
333
|
-
const
|
|
334
|
-
const E =
|
|
335
|
-
return
|
|
320
|
+
f.push(l.selectors.value);
|
|
321
|
+
return f;
|
|
322
|
+
}, o = (l) => {
|
|
323
|
+
const a = t(l);
|
|
324
|
+
let f = [];
|
|
325
|
+
return l.selectors ? f = n(l) : a && (f = Array.from(a.children).filter((r) => $(r) && O(r))), f;
|
|
326
|
+
}, i = (l) => (a) => {
|
|
327
|
+
const f = mt[a.key] || a.key.toLowerCase();
|
|
328
|
+
if (q.includes(f)) return;
|
|
329
|
+
const r = l.handlers || me;
|
|
330
|
+
for (const d of Object.keys(r)) {
|
|
331
|
+
const [p, ...c] = d.split(".");
|
|
332
|
+
if (p === "keydown" && c.includes(f)) {
|
|
333
|
+
const u = r[d], v = c.filter((w) => q.includes(w)), b = q.some((w) => {
|
|
334
|
+
const E = w.charAt(0).toUpperCase() + w.slice(1);
|
|
335
|
+
return a.getModifierState(E);
|
|
336
336
|
});
|
|
337
337
|
if (v.length > 0) {
|
|
338
|
-
if (
|
|
339
|
-
for (const
|
|
340
|
-
if (c.includes(
|
|
341
|
-
const E =
|
|
342
|
-
|
|
338
|
+
if (b) {
|
|
339
|
+
for (const w of q)
|
|
340
|
+
if (c.includes(w)) {
|
|
341
|
+
const E = w.charAt(0).toUpperCase() + w.slice(1);
|
|
342
|
+
a.getModifierState(E) && u(a);
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
345
|
} else
|
|
346
|
-
|
|
346
|
+
b || u(a);
|
|
347
347
|
}
|
|
348
348
|
}
|
|
349
|
-
},
|
|
349
|
+
}, s = [];
|
|
350
350
|
G(() => {
|
|
351
|
-
for (const
|
|
352
|
-
const
|
|
353
|
-
for (const p of
|
|
354
|
-
const { focused: c } = dt(
|
|
351
|
+
for (const l of e) {
|
|
352
|
+
const a = t(l), f = o(l), r = i(l), d = a ? [a] : f;
|
|
353
|
+
for (const p of d) {
|
|
354
|
+
const { focused: c } = dt(g(p)), u = C(c, (v) => {
|
|
355
355
|
v ? p.addEventListener("keydown", r) : p.removeEventListener("keydown", r);
|
|
356
356
|
});
|
|
357
|
-
|
|
357
|
+
s.push(u);
|
|
358
358
|
}
|
|
359
359
|
}
|
|
360
360
|
}), Ye(() => {
|
|
361
|
-
for (const
|
|
362
|
-
|
|
361
|
+
for (const l of s)
|
|
362
|
+
l();
|
|
363
363
|
});
|
|
364
364
|
}
|
|
365
365
|
function we(e) {
|
|
@@ -385,30 +385,30 @@ function D(e) {
|
|
|
385
385
|
return (t = n == null ? void 0 : n.$el) != null ? t : n;
|
|
386
386
|
}
|
|
387
387
|
function Ae(...e) {
|
|
388
|
-
let t, n,
|
|
389
|
-
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n,
|
|
388
|
+
let t, n, o, i;
|
|
389
|
+
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, o, i] = e, t = he) : [t, n, o, i] = e, !t)
|
|
390
390
|
return bt;
|
|
391
|
-
Array.isArray(n) || (n = [n]), Array.isArray(
|
|
392
|
-
const
|
|
393
|
-
|
|
394
|
-
},
|
|
391
|
+
Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
|
|
392
|
+
const s = [], l = () => {
|
|
393
|
+
s.forEach((d) => d()), s.length = 0;
|
|
394
|
+
}, a = (d, p, c, u) => (d.addEventListener(p, c, u), () => d.removeEventListener(p, c, u)), f = C(
|
|
395
395
|
() => [D(t), K(i)],
|
|
396
|
-
([
|
|
397
|
-
if (
|
|
396
|
+
([d, p]) => {
|
|
397
|
+
if (l(), !d)
|
|
398
398
|
return;
|
|
399
399
|
const c = yt(p) ? { ...p } : p;
|
|
400
|
-
|
|
401
|
-
...n.flatMap((
|
|
400
|
+
s.push(
|
|
401
|
+
...n.flatMap((u) => o.map((v) => a(d, u, v, c)))
|
|
402
402
|
);
|
|
403
403
|
},
|
|
404
404
|
{ immediate: !0, flush: "post" }
|
|
405
405
|
), r = () => {
|
|
406
|
-
|
|
406
|
+
f(), l();
|
|
407
407
|
};
|
|
408
408
|
return we(r), r;
|
|
409
409
|
}
|
|
410
410
|
function Et() {
|
|
411
|
-
const e =
|
|
411
|
+
const e = g(!1), t = re();
|
|
412
412
|
return t && G(() => {
|
|
413
413
|
e.value = !0;
|
|
414
414
|
}, t), e;
|
|
@@ -418,88 +418,88 @@ function Le(e) {
|
|
|
418
418
|
return x(() => (t.value, !!e()));
|
|
419
419
|
}
|
|
420
420
|
function Pe(e, t, n = {}) {
|
|
421
|
-
const { window:
|
|
422
|
-
let
|
|
423
|
-
const
|
|
424
|
-
|
|
425
|
-
},
|
|
426
|
-
const c = K(e),
|
|
427
|
-
return new Set(
|
|
421
|
+
const { window: o = he, ...i } = n;
|
|
422
|
+
let s;
|
|
423
|
+
const l = Le(() => o && "MutationObserver" in o), a = () => {
|
|
424
|
+
s && (s.disconnect(), s = void 0);
|
|
425
|
+
}, f = x(() => {
|
|
426
|
+
const c = K(e), u = (Array.isArray(c) ? c : [c]).map(D).filter(wt);
|
|
427
|
+
return new Set(u);
|
|
428
428
|
}), r = C(
|
|
429
|
-
() =>
|
|
429
|
+
() => f.value,
|
|
430
430
|
(c) => {
|
|
431
|
-
|
|
431
|
+
a(), l.value && c.size && (s = new MutationObserver(t), c.forEach((u) => s.observe(u, i)));
|
|
432
432
|
},
|
|
433
433
|
{ immediate: !0, flush: "post" }
|
|
434
|
-
),
|
|
435
|
-
r(),
|
|
434
|
+
), d = () => s == null ? void 0 : s.takeRecords(), p = () => {
|
|
435
|
+
r(), a();
|
|
436
436
|
};
|
|
437
437
|
return we(p), {
|
|
438
|
-
isSupported:
|
|
438
|
+
isSupported: l,
|
|
439
439
|
stop: p,
|
|
440
|
-
takeRecords:
|
|
440
|
+
takeRecords: d
|
|
441
441
|
};
|
|
442
442
|
}
|
|
443
443
|
function kt(e, t, n = {}) {
|
|
444
|
-
const { window:
|
|
445
|
-
let
|
|
446
|
-
const
|
|
447
|
-
|
|
448
|
-
},
|
|
444
|
+
const { window: o = he, ...i } = n;
|
|
445
|
+
let s;
|
|
446
|
+
const l = Le(() => o && "ResizeObserver" in o), a = () => {
|
|
447
|
+
s && (s.disconnect(), s = void 0);
|
|
448
|
+
}, f = 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
|
+
f,
|
|
453
453
|
(p) => {
|
|
454
|
-
if (
|
|
455
|
-
|
|
454
|
+
if (a(), l.value && o) {
|
|
455
|
+
s = new ResizeObserver(t);
|
|
456
456
|
for (const c of p)
|
|
457
|
-
c &&
|
|
457
|
+
c && s.observe(c, i);
|
|
458
458
|
}
|
|
459
459
|
},
|
|
460
460
|
{ immediate: !0, flush: "post" }
|
|
461
|
-
),
|
|
462
|
-
|
|
461
|
+
), d = () => {
|
|
462
|
+
a(), r();
|
|
463
463
|
};
|
|
464
|
-
return we(
|
|
465
|
-
isSupported:
|
|
466
|
-
stop:
|
|
464
|
+
return we(d), {
|
|
465
|
+
isSupported: l,
|
|
466
|
+
stop: d
|
|
467
467
|
};
|
|
468
468
|
}
|
|
469
469
|
function Ct(e, t = {}) {
|
|
470
470
|
const {
|
|
471
471
|
reset: n = !0,
|
|
472
|
-
windowResize:
|
|
472
|
+
windowResize: o = !0,
|
|
473
473
|
windowScroll: i = !0,
|
|
474
|
-
immediate:
|
|
475
|
-
updateTiming:
|
|
476
|
-
} = t,
|
|
477
|
-
function
|
|
474
|
+
immediate: s = !0,
|
|
475
|
+
updateTiming: l = "sync"
|
|
476
|
+
} = t, a = g(0), f = g(0), r = g(0), d = g(0), p = g(0), c = g(0), u = g(0), v = g(0);
|
|
477
|
+
function b() {
|
|
478
478
|
const E = D(e);
|
|
479
479
|
if (!E) {
|
|
480
|
-
n && (
|
|
480
|
+
n && (a.value = 0, f.value = 0, r.value = 0, d.value = 0, p.value = 0, c.value = 0, u.value = 0, v.value = 0);
|
|
481
481
|
return;
|
|
482
482
|
}
|
|
483
483
|
const I = E.getBoundingClientRect();
|
|
484
|
-
|
|
484
|
+
a.value = I.height, f.value = I.bottom, r.value = I.left, d.value = I.right, p.value = I.top, c.value = I.width, u.value = I.x, v.value = I.y;
|
|
485
485
|
}
|
|
486
|
-
function
|
|
487
|
-
|
|
486
|
+
function w() {
|
|
487
|
+
l === "sync" ? b() : l === "next-frame" && requestAnimationFrame(() => b());
|
|
488
488
|
}
|
|
489
|
-
return kt(e,
|
|
489
|
+
return kt(e, w), C(() => D(e), (E) => !E && w()), Pe(e, w, {
|
|
490
490
|
attributeFilter: ["style", "class"]
|
|
491
|
-
}), i && Ae("scroll",
|
|
492
|
-
|
|
491
|
+
}), i && Ae("scroll", w, { capture: !0, passive: !0 }), o && Ae("resize", w, { passive: !0 }), xt(() => {
|
|
492
|
+
s && w();
|
|
493
493
|
}), {
|
|
494
|
-
height:
|
|
495
|
-
bottom:
|
|
494
|
+
height: a,
|
|
495
|
+
bottom: f,
|
|
496
496
|
left: r,
|
|
497
|
-
right:
|
|
497
|
+
right: d,
|
|
498
498
|
top: p,
|
|
499
499
|
width: c,
|
|
500
|
-
x:
|
|
500
|
+
x: u,
|
|
501
501
|
y: v,
|
|
502
|
-
update:
|
|
502
|
+
update: w
|
|
503
503
|
};
|
|
504
504
|
}
|
|
505
505
|
const It = (e) => {
|
|
@@ -516,26 +516,26 @@ const It = (e) => {
|
|
|
516
516
|
pinned: { type: Boolean }
|
|
517
517
|
},
|
|
518
518
|
setup(e) {
|
|
519
|
-
const t = Q(e.tableid), n = Z("cell"), { bottom:
|
|
520
|
-
var
|
|
519
|
+
const t = Q(e.tableid), n = Z("cell"), { bottom: o, left: i } = Ct(n), s = t.cellData(e.colIndex, e.rowIndex), l = g(""), a = g(!1), f = t.table, r = t.columns[e.colIndex], d = t.rows[e.rowIndex], p = r.align || "center", c = r.width || "40ch", u = x(() => typeof b.value == "string" ? It(b.value) : !1), v = x(() => {
|
|
520
|
+
var h;
|
|
521
521
|
return {
|
|
522
522
|
textAlign: p,
|
|
523
523
|
width: c,
|
|
524
|
-
backgroundColor:
|
|
525
|
-
fontWeight:
|
|
526
|
-
paddingLeft: Ge(e.colIndex, (
|
|
524
|
+
backgroundColor: a.value ? "var(--sc-cell-modified)" : "inherit",
|
|
525
|
+
fontWeight: a.value ? "bold" : "inherit",
|
|
526
|
+
paddingLeft: Ge(e.colIndex, (h = t.display[e.rowIndex]) == null ? void 0 : h.indent)
|
|
527
527
|
};
|
|
528
|
-
}),
|
|
529
|
-
const
|
|
530
|
-
return
|
|
531
|
-
}),
|
|
528
|
+
}), b = x(() => {
|
|
529
|
+
const h = t.cellData(e.colIndex, e.rowIndex);
|
|
530
|
+
return w(h);
|
|
531
|
+
}), w = (h) => {
|
|
532
532
|
const A = r.format;
|
|
533
|
-
return A ? typeof A == "function" ? A(
|
|
533
|
+
return A ? typeof A == "function" ? A(h, { table: f, row: d, column: r }) : typeof A == "string" ? Function(`"use strict";return (${A})`)()(h, { table: f, row: d, column: r }) : h : h;
|
|
534
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 =
|
|
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 = o.value, t.modal.left = i.value, t.modal.width = c, typeof r.modalComponent == "function" ? t.modal.component = r.modalComponent({ table: f, row: d, column: r }) : t.modal.component = r.modalComponent, t.modal.componentProps = r.modalComponentExtraProps);
|
|
536
536
|
};
|
|
537
537
|
if (e.addNavigation) {
|
|
538
|
-
let
|
|
538
|
+
let h = {
|
|
539
539
|
...me,
|
|
540
540
|
"keydown.f2": E,
|
|
541
541
|
"keydown.alt.up": E,
|
|
@@ -543,28 +543,28 @@ const It = (e) => {
|
|
|
543
543
|
"keydown.alt.left": E,
|
|
544
544
|
"keydown.alt.right": E
|
|
545
545
|
};
|
|
546
|
-
typeof e.addNavigation == "object" && (
|
|
547
|
-
...
|
|
546
|
+
typeof e.addNavigation == "object" && (h = {
|
|
547
|
+
...h,
|
|
548
548
|
...e.addNavigation
|
|
549
549
|
}), ve([
|
|
550
550
|
{
|
|
551
551
|
selectors: n,
|
|
552
|
-
handlers:
|
|
552
|
+
handlers: h
|
|
553
553
|
}
|
|
554
554
|
]);
|
|
555
555
|
}
|
|
556
556
|
const I = () => {
|
|
557
|
-
n.value && (
|
|
557
|
+
n.value && (l.value = n.value.textContent);
|
|
558
558
|
}, _ = () => {
|
|
559
|
-
n.value && (r.format ?
|
|
560
|
-
}, Ge = (
|
|
561
|
-
return (
|
|
559
|
+
n.value && (r.format ? a.value = n.value.textContent !== w(s) : a.value = n.value.textContent !== s, n.value.textContent !== l.value && (l.value = n.value.textContent, n.value.dispatchEvent(new Event("change")), r.format || t.setCellData(e.rowIndex, e.colIndex, l.value)));
|
|
560
|
+
}, Ge = (h, A) => A && h === 0 && A > 0 ? `${A}ch` : "inherit";
|
|
561
|
+
return (h, A) => (y(), k("td", {
|
|
562
562
|
ref: "cell",
|
|
563
|
-
"data-colindex":
|
|
564
|
-
"data-rowindex":
|
|
563
|
+
"data-colindex": h.colIndex,
|
|
564
|
+
"data-rowindex": h.rowIndex,
|
|
565
565
|
"data-editable": m(r).edit,
|
|
566
566
|
contenteditable: m(r).edit,
|
|
567
|
-
tabindex:
|
|
567
|
+
tabindex: h.tabIndex,
|
|
568
568
|
spellcheck: !1,
|
|
569
569
|
style: P(v.value),
|
|
570
570
|
onFocus: I,
|
|
@@ -573,15 +573,15 @@ const It = (e) => {
|
|
|
573
573
|
onInput: _,
|
|
574
574
|
onClick: E,
|
|
575
575
|
onMousedown: E,
|
|
576
|
-
class: N(["atable-cell",
|
|
576
|
+
class: N(["atable-cell", h.pinned ? "sticky-column" : ""])
|
|
577
577
|
}, [
|
|
578
|
-
m(r).cellComponent ? (
|
|
578
|
+
m(r).cellComponent ? (y(), Y(De(m(r).cellComponent), ae({
|
|
579
579
|
key: 0,
|
|
580
|
-
value:
|
|
581
|
-
}, m(r).cellComponentProps), null, 16, ["value"])) :
|
|
580
|
+
value: b.value
|
|
581
|
+
}, m(r).cellComponentProps), null, 16, ["value"])) : u.value ? (y(), k("span", {
|
|
582
582
|
key: 1,
|
|
583
|
-
innerHTML:
|
|
584
|
-
}, null, 8, St)) : (
|
|
583
|
+
innerHTML: b.value
|
|
584
|
+
}, null, 8, St)) : (y(), k("span", Ot, B(b.value), 1))
|
|
585
585
|
], 46, At));
|
|
586
586
|
}
|
|
587
587
|
}), $t = ["tabindex"], Tt = ["tabindex"], Dt = ["colspan"], Mt = /* @__PURE__ */ M({
|
|
@@ -593,11 +593,11 @@ const It = (e) => {
|
|
|
593
593
|
addNavigation: { type: [Boolean, Object] }
|
|
594
594
|
},
|
|
595
595
|
setup(e) {
|
|
596
|
-
const t = Q(e.tableid), n = Z("rowEl"),
|
|
596
|
+
const t = Q(e.tableid), n = Z("rowEl"), o = x(() => t.display[e.rowIndex].expanded ? "▼" : "►");
|
|
597
597
|
if (e.addNavigation) {
|
|
598
598
|
const i = {
|
|
599
|
-
"keydown.control.g": (
|
|
600
|
-
|
|
599
|
+
"keydown.control.g": (s) => {
|
|
600
|
+
s.stopPropagation(), s.preventDefault(), t.toggleRowExpand(e.rowIndex);
|
|
601
601
|
}
|
|
602
602
|
};
|
|
603
603
|
typeof e.addNavigation == "object" && Object.assign(i, e.addNavigation), ve([
|
|
@@ -607,7 +607,7 @@ const It = (e) => {
|
|
|
607
607
|
}
|
|
608
608
|
]);
|
|
609
609
|
}
|
|
610
|
-
return (i,
|
|
610
|
+
return (i, s) => (y(), k(J, null, [
|
|
611
611
|
W("tr", ae(i.$attrs, {
|
|
612
612
|
ref: "rowEl",
|
|
613
613
|
tabindex: i.tabIndex,
|
|
@@ -615,12 +615,12 @@ const It = (e) => {
|
|
|
615
615
|
}), [
|
|
616
616
|
W("td", {
|
|
617
617
|
tabIndex: -1,
|
|
618
|
-
onClick:
|
|
618
|
+
onClick: s[0] || (s[0] = (l) => m(t).toggleRowExpand(i.rowIndex)),
|
|
619
619
|
class: "row-index"
|
|
620
|
-
}, B(
|
|
620
|
+
}, B(o.value), 1),
|
|
621
621
|
S(i.$slots, "row")
|
|
622
622
|
], 16, $t),
|
|
623
|
-
m(t).display[i.rowIndex].expanded ? (
|
|
623
|
+
m(t).display[i.rowIndex].expanded ? (y(), k("tr", {
|
|
624
624
|
key: 0,
|
|
625
625
|
ref: "rowExpanded",
|
|
626
626
|
tabindex: i.tabIndex,
|
|
@@ -645,39 +645,39 @@ const It = (e) => {
|
|
|
645
645
|
addNavigation: { type: [Boolean, Object], default: !1 }
|
|
646
646
|
},
|
|
647
647
|
setup(e) {
|
|
648
|
-
const t = Q(e.tableid), n = Z("rowEl"),
|
|
649
|
-
t.toggleRowExpand(
|
|
648
|
+
const t = Q(e.tableid), n = Z("rowEl"), o = x(() => t.columns.some((a) => a.pinned)), i = x(() => t.config.view !== "tree" || t.display[e.rowIndex].isRoot || t.display[e.rowIndex].open), s = x(() => t.config.view !== "tree" ? "" : t.display[e.rowIndex].isRoot || t.display[e.rowIndex].isParent ? t.display[e.rowIndex].childrenOpen ? "-" : "+" : ""), l = (a) => {
|
|
649
|
+
t.toggleRowExpand(a);
|
|
650
650
|
};
|
|
651
651
|
if (e.addNavigation) {
|
|
652
|
-
let
|
|
653
|
-
typeof e.addNavigation == "object" && (
|
|
654
|
-
...
|
|
652
|
+
let a = me;
|
|
653
|
+
typeof e.addNavigation == "object" && (a = {
|
|
654
|
+
...a,
|
|
655
655
|
...e.addNavigation
|
|
656
656
|
}), ve([
|
|
657
657
|
{
|
|
658
658
|
selectors: n,
|
|
659
|
-
handlers:
|
|
659
|
+
handlers: a
|
|
660
660
|
}
|
|
661
661
|
]);
|
|
662
662
|
}
|
|
663
|
-
return (
|
|
663
|
+
return (a, f) => ne((y(), k("tr", {
|
|
664
664
|
ref: "rowEl",
|
|
665
|
-
tabindex:
|
|
665
|
+
tabindex: a.tabIndex,
|
|
666
666
|
class: "table-row"
|
|
667
667
|
}, [
|
|
668
|
-
m(t).config.view !== "uncounted" ? S(
|
|
669
|
-
m(t).config.view === "list" ? (
|
|
668
|
+
m(t).config.view !== "uncounted" ? S(a.$slots, "index", { key: 0 }, () => [
|
|
669
|
+
m(t).config.view === "list" ? (y(), k("td", {
|
|
670
670
|
key: 0,
|
|
671
671
|
tabIndex: -1,
|
|
672
|
-
class: N(["list-index",
|
|
673
|
-
}, B(
|
|
672
|
+
class: N(["list-index", o.value ? "sticky-index" : ""])
|
|
673
|
+
}, B(a.rowIndex + 1), 3)) : m(t).config.view === "tree" ? (y(), k("td", {
|
|
674
674
|
key: 1,
|
|
675
675
|
tabIndex: -1,
|
|
676
|
-
class: N(["tree-index",
|
|
677
|
-
onClick:
|
|
678
|
-
}, B(
|
|
676
|
+
class: N(["tree-index", o.value ? "sticky-index" : ""]),
|
|
677
|
+
onClick: f[0] || (f[0] = (r) => l(a.rowIndex))
|
|
678
|
+
}, B(s.value), 3)) : V("", !0)
|
|
679
679
|
]) : V("", !0),
|
|
680
|
-
S(
|
|
680
|
+
S(a.$slots, "default")
|
|
681
681
|
], 8, Rt)), [
|
|
682
682
|
[Me, i.value]
|
|
683
683
|
]);
|
|
@@ -706,7 +706,7 @@ function Ht(...e) {
|
|
|
706
706
|
if (e.length !== 1)
|
|
707
707
|
return Xe(...e);
|
|
708
708
|
const t = e[0];
|
|
709
|
-
return typeof t == "function" ? Je(Qe(() => ({ get: t, set: j }))) :
|
|
709
|
+
return typeof t == "function" ? Je(Qe(() => ({ get: t, set: j }))) : g(t);
|
|
710
710
|
}
|
|
711
711
|
function L(e) {
|
|
712
712
|
var t;
|
|
@@ -715,66 +715,66 @@ function L(e) {
|
|
|
715
715
|
}
|
|
716
716
|
const Be = Ne ? window : void 0;
|
|
717
717
|
function X(...e) {
|
|
718
|
-
let t, n,
|
|
719
|
-
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n,
|
|
718
|
+
let t, n, o, i;
|
|
719
|
+
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, o, i] = e, t = Be) : [t, n, o, i] = e, !t)
|
|
720
720
|
return j;
|
|
721
|
-
Array.isArray(n) || (n = [n]), Array.isArray(
|
|
722
|
-
const
|
|
723
|
-
|
|
724
|
-
},
|
|
721
|
+
Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
|
|
722
|
+
const s = [], l = () => {
|
|
723
|
+
s.forEach((d) => d()), s.length = 0;
|
|
724
|
+
}, a = (d, p, c, u) => (d.addEventListener(p, c, u), () => d.removeEventListener(p, c, u)), f = C(
|
|
725
725
|
() => [L(t), H(i)],
|
|
726
|
-
([
|
|
727
|
-
if (
|
|
726
|
+
([d, p]) => {
|
|
727
|
+
if (l(), !d)
|
|
728
728
|
return;
|
|
729
729
|
const c = Pt(p) ? { ...p } : p;
|
|
730
|
-
|
|
731
|
-
...n.flatMap((
|
|
730
|
+
s.push(
|
|
731
|
+
...n.flatMap((u) => o.map((v) => a(d, u, v, c)))
|
|
732
732
|
);
|
|
733
733
|
},
|
|
734
734
|
{ immediate: !0, flush: "post" }
|
|
735
735
|
), r = () => {
|
|
736
|
-
|
|
736
|
+
f(), l();
|
|
737
737
|
};
|
|
738
738
|
return je(r), r;
|
|
739
739
|
}
|
|
740
740
|
let Oe = !1;
|
|
741
741
|
function $e(e, t, n = {}) {
|
|
742
|
-
const { window:
|
|
743
|
-
if (!
|
|
742
|
+
const { window: o = Be, ignore: i = [], capture: s = !0, detectIframe: l = !1 } = n;
|
|
743
|
+
if (!o)
|
|
744
744
|
return j;
|
|
745
|
-
le && !Oe && (Oe = !0, Array.from(
|
|
746
|
-
let
|
|
747
|
-
const
|
|
748
|
-
if (typeof
|
|
749
|
-
return Array.from(
|
|
745
|
+
le && !Oe && (Oe = !0, Array.from(o.document.body.children).forEach((c) => c.addEventListener("click", j)), o.document.documentElement.addEventListener("click", j));
|
|
746
|
+
let a = !0;
|
|
747
|
+
const f = (c) => i.some((u) => {
|
|
748
|
+
if (typeof u == "string")
|
|
749
|
+
return Array.from(o.document.querySelectorAll(u)).some((v) => v === c.target || c.composedPath().includes(v));
|
|
750
750
|
{
|
|
751
|
-
const v = L(
|
|
751
|
+
const v = L(u);
|
|
752
752
|
return v && (c.target === v || c.composedPath().includes(v));
|
|
753
753
|
}
|
|
754
|
-
}),
|
|
755
|
-
X(
|
|
756
|
-
const
|
|
757
|
-
if (!(!
|
|
758
|
-
if (c.detail === 0 && (
|
|
759
|
-
|
|
754
|
+
}), d = [
|
|
755
|
+
X(o, "click", (c) => {
|
|
756
|
+
const u = L(e);
|
|
757
|
+
if (!(!u || u === c.target || c.composedPath().includes(u))) {
|
|
758
|
+
if (c.detail === 0 && (a = !f(c)), !a) {
|
|
759
|
+
a = !0;
|
|
760
760
|
return;
|
|
761
761
|
}
|
|
762
762
|
t(c);
|
|
763
763
|
}
|
|
764
|
-
}, { passive: !0, capture:
|
|
765
|
-
X(
|
|
766
|
-
const
|
|
767
|
-
|
|
764
|
+
}, { passive: !0, capture: s }),
|
|
765
|
+
X(o, "pointerdown", (c) => {
|
|
766
|
+
const u = L(e);
|
|
767
|
+
a = !f(c) && !!(u && !c.composedPath().includes(u));
|
|
768
768
|
}, { passive: !0 }),
|
|
769
|
-
|
|
769
|
+
l && X(o, "blur", (c) => {
|
|
770
770
|
setTimeout(() => {
|
|
771
|
-
var
|
|
771
|
+
var u;
|
|
772
772
|
const v = L(e);
|
|
773
|
-
((
|
|
773
|
+
((u = o.document.activeElement) == null ? void 0 : u.tagName) === "IFRAME" && !(v != null && v.contains(o.document.activeElement)) && t(c);
|
|
774
774
|
}, 0);
|
|
775
775
|
})
|
|
776
776
|
].filter(Boolean);
|
|
777
|
-
return () =>
|
|
777
|
+
return () => d.forEach((c) => c());
|
|
778
778
|
}
|
|
779
779
|
const jt = {
|
|
780
780
|
[Se.mounted](e, t) {
|
|
@@ -782,8 +782,8 @@ const jt = {
|
|
|
782
782
|
if (typeof t.value == "function")
|
|
783
783
|
e.__onClickOutside_stop = $e(e, t.value, { capture: n });
|
|
784
784
|
else {
|
|
785
|
-
const [
|
|
786
|
-
e.__onClickOutside_stop = $e(e,
|
|
785
|
+
const [o, i] = t.value;
|
|
786
|
+
e.__onClickOutside_stop = $e(e, o, Object.assign({ capture: n }, i));
|
|
787
787
|
}
|
|
788
788
|
},
|
|
789
789
|
[Se.unmounted](e) {
|
|
@@ -808,12 +808,12 @@ function Nt(e) {
|
|
|
808
808
|
}
|
|
809
809
|
const te = /* @__PURE__ */ new WeakMap();
|
|
810
810
|
function Bt(e, t = !1) {
|
|
811
|
-
const n =
|
|
812
|
-
let
|
|
813
|
-
C(Ht(e), (
|
|
814
|
-
const
|
|
815
|
-
if (
|
|
816
|
-
const r =
|
|
811
|
+
const n = g(t);
|
|
812
|
+
let o = null, i = "";
|
|
813
|
+
C(Ht(e), (a) => {
|
|
814
|
+
const f = ee(H(a));
|
|
815
|
+
if (f) {
|
|
816
|
+
const r = f;
|
|
817
817
|
if (te.get(r) || te.set(r, r.style.overflow), r.style.overflow !== "hidden" && (i = r.style.overflow), r.style.overflow === "hidden")
|
|
818
818
|
return n.value = !0;
|
|
819
819
|
if (n.value)
|
|
@@ -822,43 +822,43 @@ function Bt(e, t = !1) {
|
|
|
822
822
|
}, {
|
|
823
823
|
immediate: !0
|
|
824
824
|
});
|
|
825
|
-
const
|
|
826
|
-
const
|
|
827
|
-
!
|
|
828
|
-
|
|
825
|
+
const s = () => {
|
|
826
|
+
const a = ee(H(e));
|
|
827
|
+
!a || n.value || (le && (o = X(
|
|
828
|
+
a,
|
|
829
829
|
"touchmove",
|
|
830
|
-
(
|
|
831
|
-
Nt(
|
|
830
|
+
(f) => {
|
|
831
|
+
Nt(f);
|
|
832
832
|
},
|
|
833
833
|
{ passive: !1 }
|
|
834
|
-
)),
|
|
835
|
-
},
|
|
836
|
-
const
|
|
837
|
-
!
|
|
834
|
+
)), a.style.overflow = "hidden", n.value = !0);
|
|
835
|
+
}, l = () => {
|
|
836
|
+
const a = ee(H(e));
|
|
837
|
+
!a || !n.value || (le && (o == null || o()), a.style.overflow = i, te.delete(a), n.value = !1);
|
|
838
838
|
};
|
|
839
|
-
return je(
|
|
839
|
+
return je(l), x({
|
|
840
840
|
get() {
|
|
841
841
|
return n.value;
|
|
842
842
|
},
|
|
843
|
-
set(
|
|
844
|
-
|
|
843
|
+
set(a) {
|
|
844
|
+
a ? s() : l();
|
|
845
845
|
}
|
|
846
846
|
});
|
|
847
847
|
}
|
|
848
848
|
function Vt() {
|
|
849
849
|
let e = !1;
|
|
850
|
-
const t =
|
|
851
|
-
return (n,
|
|
852
|
-
if (t.value =
|
|
850
|
+
const t = g(!1);
|
|
851
|
+
return (n, o) => {
|
|
852
|
+
if (t.value = o.value, e)
|
|
853
853
|
return;
|
|
854
854
|
e = !0;
|
|
855
|
-
const i = Bt(n,
|
|
856
|
-
C(t, (
|
|
855
|
+
const i = Bt(n, o.value);
|
|
856
|
+
C(t, (s) => i.value = s);
|
|
857
857
|
};
|
|
858
858
|
}
|
|
859
859
|
Vt();
|
|
860
860
|
class zt {
|
|
861
|
-
constructor(t, n,
|
|
861
|
+
constructor(t, n, o, i, s, l) {
|
|
862
862
|
T(this, "id");
|
|
863
863
|
T(this, "rows");
|
|
864
864
|
T(this, "columns");
|
|
@@ -866,31 +866,31 @@ class zt {
|
|
|
866
866
|
T(this, "table");
|
|
867
867
|
T(this, "display");
|
|
868
868
|
T(this, "modal");
|
|
869
|
-
this.id = t || crypto.randomUUID(), this.rows =
|
|
869
|
+
this.id = t || crypto.randomUUID(), this.rows = o, this.columns = R(n), this.config = R(i), this.table = s || R(this.createTableObject()), this.display = this.createDisplayObject(l), this.modal = R({ visible: !1 });
|
|
870
870
|
}
|
|
871
871
|
createTableObject() {
|
|
872
872
|
const t = {};
|
|
873
|
-
for (const [n,
|
|
874
|
-
for (const [i,
|
|
875
|
-
t[`${n}:${i}`] = o
|
|
873
|
+
for (const [n, o] of this.columns.entries())
|
|
874
|
+
for (const [i, s] of this.rows.entries())
|
|
875
|
+
t[`${n}:${i}`] = s[o.name];
|
|
876
876
|
return t;
|
|
877
877
|
}
|
|
878
878
|
createDisplayObject(t) {
|
|
879
879
|
const n = [Object.assign({}, { rowModified: !1 })];
|
|
880
880
|
if (t && "0:0" in t)
|
|
881
881
|
return t;
|
|
882
|
-
const
|
|
882
|
+
const o = /* @__PURE__ */ new Set();
|
|
883
883
|
for (let i = this.rows.length - 1; i >= 0; i--) {
|
|
884
|
-
const
|
|
885
|
-
|
|
884
|
+
const s = this.rows[i];
|
|
885
|
+
s.parent && o.add(s.parent), n[i] = {
|
|
886
886
|
childrenOpen: !1,
|
|
887
887
|
expanded: !1,
|
|
888
|
-
indent:
|
|
889
|
-
isParent:
|
|
890
|
-
isRoot:
|
|
888
|
+
indent: s.indent || null,
|
|
889
|
+
isParent: o.has(i),
|
|
890
|
+
isRoot: s.parent === null || s.parent === void 0,
|
|
891
891
|
rowModified: !1,
|
|
892
|
-
open:
|
|
893
|
-
parent:
|
|
892
|
+
open: s.parent === null || s.parent === void 0,
|
|
893
|
+
parent: s.parent
|
|
894
894
|
};
|
|
895
895
|
}
|
|
896
896
|
return R(n);
|
|
@@ -904,9 +904,9 @@ class zt {
|
|
|
904
904
|
cellData(t, n) {
|
|
905
905
|
return this.table[`${t}:${n}`];
|
|
906
906
|
}
|
|
907
|
-
setCellData(t, n,
|
|
908
|
-
const i = `${n}:${t}`,
|
|
909
|
-
return this.table[i] !==
|
|
907
|
+
setCellData(t, n, o) {
|
|
908
|
+
const i = `${n}:${t}`, s = this.columns[n];
|
|
909
|
+
return this.table[i] !== o && (this.display[t].rowModified = !0), this.table[i] = o, this.rows[t][s.name] = o, this.table[i];
|
|
910
910
|
}
|
|
911
911
|
toggleRowExpand(t) {
|
|
912
912
|
if (this.config.view === "tree") {
|
|
@@ -929,14 +929,14 @@ const Ft = {
|
|
|
929
929
|
tableid: {}
|
|
930
930
|
},
|
|
931
931
|
setup(e) {
|
|
932
|
-
const t = Q(e.tableid), n = x(() => t.columns.some((i) => i.pinned)),
|
|
932
|
+
const t = Q(e.tableid), n = x(() => t.columns.some((i) => i.pinned)), o = (i) => ({
|
|
933
933
|
minWidth: i.width || "40ch",
|
|
934
934
|
textAlign: i.align || "center",
|
|
935
935
|
width: t.config.fullWidth ? "auto" : null
|
|
936
936
|
});
|
|
937
|
-
return (i,
|
|
937
|
+
return (i, s) => i.columns.length ? (y(), k("thead", Ft, [
|
|
938
938
|
W("tr", Gt, [
|
|
939
|
-
m(t).zeroColumn ? (
|
|
939
|
+
m(t).zeroColumn ? (y(), k("th", {
|
|
940
940
|
key: 0,
|
|
941
941
|
id: "header-index",
|
|
942
942
|
class: N([[
|
|
@@ -945,14 +945,14 @@ const Ft = {
|
|
|
945
945
|
m(t).config.view === "list-expansion" ? "list-expansion-index" : ""
|
|
946
946
|
], "list-index"])
|
|
947
947
|
}, null, 2)) : V("", !0),
|
|
948
|
-
(
|
|
949
|
-
key:
|
|
948
|
+
(y(!0), k(J, null, oe(i.columns, (l, a) => (y(), k("th", {
|
|
949
|
+
key: l.name,
|
|
950
950
|
tabindex: "-1",
|
|
951
|
-
style: P(l
|
|
952
|
-
class: N(
|
|
951
|
+
style: P(o(l)),
|
|
952
|
+
class: N(l.pinned ? "sticky-column" : "")
|
|
953
953
|
}, [
|
|
954
954
|
S(i.$slots, "default", {}, () => [
|
|
955
|
-
Ze(B(
|
|
955
|
+
Ze(B(l.label || String.fromCharCode(a + 97).toUpperCase()), 1)
|
|
956
956
|
])
|
|
957
957
|
], 6))), 128))
|
|
958
958
|
])
|
|
@@ -969,7 +969,7 @@ const Ft = {
|
|
|
969
969
|
const t = (n) => {
|
|
970
970
|
n.stopPropagation();
|
|
971
971
|
};
|
|
972
|
-
return (n,
|
|
972
|
+
return (n, o) => (y(), k("div", {
|
|
973
973
|
class: "amodal",
|
|
974
974
|
tabindex: "-1",
|
|
975
975
|
onClick: t,
|
|
@@ -988,75 +988,75 @@ const Ft = {
|
|
|
988
988
|
config: { default: () => new Object() }
|
|
989
989
|
},
|
|
990
990
|
emits: ["update:modelValue"],
|
|
991
|
-
setup(e, {
|
|
992
|
-
const
|
|
993
|
-
Ke(
|
|
994
|
-
() =>
|
|
995
|
-
(
|
|
996
|
-
|
|
991
|
+
setup(e, { expose: t, emit: n }) {
|
|
992
|
+
const o = n, i = Z("table"), s = e.modelValue ? e.modelValue : e.rows, l = new zt(e.id, e.columns, s, e.config);
|
|
993
|
+
Ke(l.id, l), C(
|
|
994
|
+
() => l.rows,
|
|
995
|
+
(r) => {
|
|
996
|
+
o("update:modelValue", r);
|
|
997
997
|
},
|
|
998
998
|
{ deep: !0 }
|
|
999
999
|
), G(() => {
|
|
1000
|
-
e.columns.some((
|
|
1000
|
+
e.columns.some((r) => r.pinned) && (a(), l.config.view === "tree" && Pe(i, a, { childList: !0, subtree: !0 }));
|
|
1001
1001
|
});
|
|
1002
1002
|
const a = () => {
|
|
1003
|
-
const
|
|
1004
|
-
for (const [
|
|
1005
|
-
const
|
|
1006
|
-
|
|
1003
|
+
const r = i.value, d = r.rows[0], p = r.rows[1], c = d ? Array.from(d.cells) : [];
|
|
1004
|
+
for (const [u, v] of c.entries()) {
|
|
1005
|
+
const b = p.cells[u];
|
|
1006
|
+
b && (v.style.width = `${b.offsetWidth}px`);
|
|
1007
1007
|
}
|
|
1008
|
-
for (const
|
|
1009
|
-
let
|
|
1010
|
-
const
|
|
1011
|
-
for (const
|
|
1012
|
-
(
|
|
1013
|
-
|
|
1008
|
+
for (const u of r.rows) {
|
|
1009
|
+
let v = 0;
|
|
1010
|
+
const b = [];
|
|
1011
|
+
for (const w of u.cells)
|
|
1012
|
+
(w.classList.contains("sticky-column") || w.classList.contains("sticky-index")) && (w.style.left = `${v}px`, v += w.offsetWidth, b.push(w));
|
|
1013
|
+
b.length > 0 && b[b.length - 1].classList.add("sticky-column-edge");
|
|
1014
1014
|
}
|
|
1015
|
-
},
|
|
1016
|
-
var
|
|
1017
|
-
|
|
1015
|
+
}, f = (r) => {
|
|
1016
|
+
var d;
|
|
1017
|
+
r.target instanceof Node && (d = l.modal.parent) != null && d.contains(r.target) || l.modal.visible && (l.modal.visible = !1);
|
|
1018
1018
|
};
|
|
1019
|
-
return window.addEventListener("keydown", (
|
|
1020
|
-
if (
|
|
1021
|
-
|
|
1022
|
-
const
|
|
1023
|
-
|
|
1024
|
-
|
|
1019
|
+
return window.addEventListener("keydown", (r) => {
|
|
1020
|
+
if (r.key === "Escape" && l.modal.visible) {
|
|
1021
|
+
l.modal.visible = !1;
|
|
1022
|
+
const d = l.modal.parent;
|
|
1023
|
+
d && Te().then(() => {
|
|
1024
|
+
d.focus();
|
|
1025
1025
|
});
|
|
1026
1026
|
}
|
|
1027
|
-
}), (
|
|
1027
|
+
}), t({ tableData: l }), (r, d) => ne((y(), k("table", {
|
|
1028
1028
|
ref: "table",
|
|
1029
1029
|
class: "atable",
|
|
1030
|
-
style: P({ width: m(
|
|
1030
|
+
style: P({ width: m(l).config.fullWidth ? "100%" : "auto" })
|
|
1031
1031
|
}, [
|
|
1032
|
-
S(
|
|
1032
|
+
S(r.$slots, "header", { data: m(l) }, () => [
|
|
1033
1033
|
ye(ze, {
|
|
1034
|
-
columns: m(
|
|
1035
|
-
tableid: m(
|
|
1034
|
+
columns: m(l).columns,
|
|
1035
|
+
tableid: m(l).id
|
|
1036
1036
|
}, null, 8, ["columns", "tableid"])
|
|
1037
1037
|
], !0),
|
|
1038
1038
|
W("tbody", null, [
|
|
1039
|
-
S(
|
|
1040
|
-
(
|
|
1041
|
-
key:
|
|
1042
|
-
row:
|
|
1043
|
-
rowIndex:
|
|
1044
|
-
tableid: m(
|
|
1039
|
+
S(r.$slots, "body", { data: m(l) }, () => [
|
|
1040
|
+
(y(!0), k(J, null, oe(m(l).rows, (p, c) => (y(), Y(He, {
|
|
1041
|
+
key: p.id,
|
|
1042
|
+
row: p,
|
|
1043
|
+
rowIndex: c,
|
|
1044
|
+
tableid: m(l).id
|
|
1045
1045
|
}, {
|
|
1046
1046
|
default: be(() => [
|
|
1047
|
-
(
|
|
1048
|
-
key:
|
|
1049
|
-
tableid: m(
|
|
1050
|
-
col:
|
|
1047
|
+
(y(!0), k(J, null, oe(m(l).columns, (u, v) => (y(), Y(We, {
|
|
1048
|
+
key: u.name,
|
|
1049
|
+
tableid: m(l).id,
|
|
1050
|
+
col: u,
|
|
1051
1051
|
spellcheck: "false",
|
|
1052
|
-
pinned:
|
|
1053
|
-
rowIndex:
|
|
1054
|
-
colIndex:
|
|
1055
|
-
component:
|
|
1052
|
+
pinned: u.pinned,
|
|
1053
|
+
rowIndex: c,
|
|
1054
|
+
colIndex: v,
|
|
1055
|
+
component: u.cellComponent,
|
|
1056
1056
|
style: P({
|
|
1057
|
-
textAlign: (
|
|
1058
|
-
minWidth: (
|
|
1059
|
-
width: m(
|
|
1057
|
+
textAlign: (u == null ? void 0 : u.align) || "center",
|
|
1058
|
+
minWidth: (u == null ? void 0 : u.width) || "40ch",
|
|
1059
|
+
width: m(l).config.fullWidth ? "auto" : null
|
|
1060
1060
|
})
|
|
1061
1061
|
}, null, 8, ["tableid", "col", "pinned", "rowIndex", "colIndex", "component", "style"]))), 128))
|
|
1062
1062
|
]),
|
|
@@ -1064,41 +1064,41 @@ const Ft = {
|
|
|
1064
1064
|
}, 1032, ["row", "rowIndex", "tableid"]))), 128))
|
|
1065
1065
|
], !0)
|
|
1066
1066
|
]),
|
|
1067
|
-
S(
|
|
1068
|
-
S(
|
|
1067
|
+
S(r.$slots, "footer", { data: m(l) }, void 0, !0),
|
|
1068
|
+
S(r.$slots, "modal", { data: m(l) }, () => [
|
|
1069
1069
|
ne(ye(Fe, {
|
|
1070
|
-
colIndex: m(
|
|
1071
|
-
rowIndex: m(
|
|
1072
|
-
tableid: m(
|
|
1070
|
+
colIndex: m(l).modal.colIndex,
|
|
1071
|
+
rowIndex: m(l).modal.rowIndex,
|
|
1072
|
+
tableid: m(l).id,
|
|
1073
1073
|
style: P({
|
|
1074
|
-
left: m(
|
|
1075
|
-
top: m(
|
|
1076
|
-
maxWidth: m(
|
|
1074
|
+
left: m(l).modal.left + "px",
|
|
1075
|
+
top: m(l).modal.top + "px",
|
|
1076
|
+
maxWidth: m(l).modal.width + "px"
|
|
1077
1077
|
})
|
|
1078
1078
|
}, {
|
|
1079
1079
|
default: be(() => [
|
|
1080
|
-
(
|
|
1081
|
-
key: `${m(
|
|
1082
|
-
colIndex: m(
|
|
1083
|
-
rowIndex: m(
|
|
1084
|
-
tableid: m(
|
|
1085
|
-
}, m(
|
|
1080
|
+
(y(), Y(De(m(l).modal.component), ae({
|
|
1081
|
+
key: `${m(l).modal.rowIndex}:${m(l).modal.colIndex}`,
|
|
1082
|
+
colIndex: m(l).modal.colIndex,
|
|
1083
|
+
rowIndex: m(l).modal.rowIndex,
|
|
1084
|
+
tableid: m(l).id
|
|
1085
|
+
}, m(l).modal.componentProps), null, 16, ["colIndex", "rowIndex", "tableid"]))
|
|
1086
1086
|
]),
|
|
1087
1087
|
_: 1
|
|
1088
1088
|
}, 8, ["colIndex", "rowIndex", "tableid", "style"]), [
|
|
1089
|
-
[Me, m(
|
|
1089
|
+
[Me, m(l).modal.visible]
|
|
1090
1090
|
])
|
|
1091
1091
|
], !0)
|
|
1092
1092
|
], 4)), [
|
|
1093
|
-
[m(jt),
|
|
1093
|
+
[m(jt), f]
|
|
1094
1094
|
]);
|
|
1095
1095
|
}
|
|
1096
1096
|
}), qt = (e, t) => {
|
|
1097
1097
|
const n = e.__vccOpts || e;
|
|
1098
|
-
for (const [
|
|
1099
|
-
n[
|
|
1098
|
+
for (const [o, i] of t)
|
|
1099
|
+
n[o] = i;
|
|
1100
1100
|
return n;
|
|
1101
|
-
}, Yt = /* @__PURE__ */ qt(Ut, [["__scopeId", "data-v-
|
|
1101
|
+
}, Yt = /* @__PURE__ */ qt(Ut, [["__scopeId", "data-v-183c4dd3"]]);
|
|
1102
1102
|
function Zt(e) {
|
|
1103
1103
|
e.component("ACell", We), e.component("AExpansionRow", Mt), e.component("ARow", He), e.component("ATable", Yt), e.component("ATableHeader", ze), e.component("ATableModal", Fe);
|
|
1104
1104
|
}
|