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