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