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