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