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