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