@stonecrop/atable 0.3.0 → 0.3.2
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 +28 -14
- package/dist/atable.js +655 -648
- 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 +12 -12
- package/dist/src/stores/table.d.ts.map +1 -1
- package/dist/src/types/index.d.ts +16 -2
- package/dist/src/types/index.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/components/ACell.vue +11 -6
- package/src/components/ATable.vue +7 -2
- package/src/types/index.ts +16 -2
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 T, 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 = T(
|
|
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 = T(
|
|
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 T(
|
|
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
|
+
}, Ie = (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 = Ie(e);
|
|
267
267
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
268
268
|
},
|
|
269
269
|
"keydown.end": (e) => {
|
|
270
|
-
const t =
|
|
270
|
+
const t = Ie(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 = T(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 M(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;
|
|
384
|
+
return typeof t == "function" ? Ye(Xe(() => ({ get: t, set: P }))) : x(t);
|
|
416
385
|
}
|
|
417
|
-
|
|
418
|
-
|
|
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());
|
|
386
|
+
function gt(e, t = !0, n) {
|
|
387
|
+
wt() ? Y(e, n) : t ? e() : Re(e);
|
|
455
388
|
}
|
|
456
|
-
const
|
|
457
|
-
|
|
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
|
-
});
|
|
524
|
-
}
|
|
525
|
-
function Et() {
|
|
526
|
-
let e = !1;
|
|
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
|
-
};
|
|
535
|
-
}
|
|
536
|
-
Et();
|
|
537
|
-
function we(e) {
|
|
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 = M(e);
|
|
557
393
|
return (t = n == null ? void 0 : n.$el) != null ? t : n;
|
|
558
394
|
}
|
|
559
|
-
function
|
|
395
|
+
function Ae(...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 = T(
|
|
403
|
+
() => [D(t), M(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 = M(e), v = (Array.isArray(d) ? d : [d]).map(D).filter(mt);
|
|
435
|
+
return new Set(v);
|
|
436
|
+
}), c = T(
|
|
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 = M(e);
|
|
458
|
+
return Array.isArray(f) ? f.map((d) => D(d)) : [D(f)];
|
|
459
|
+
}), c = T(
|
|
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), T(() => D(e), (m) => !m && w()), He(e, w, {
|
|
662
498
|
attributeFilter: ["style", "class"]
|
|
663
|
-
}), r &&
|
|
664
|
-
|
|
499
|
+
}), r && Ae("scroll", w, { capture: !0, passive: !0 }), o && Ae("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"], It = { key: 2 }, Ne = /* @__PURE__ */ W({
|
|
681
517
|
__name: "ACell",
|
|
682
518
|
props: {
|
|
683
519
|
colIndex: {},
|
|
@@ -688,72 +524,77 @@ const Lt = (e) => {
|
|
|
688
524
|
pinned: { type: Boolean }
|
|
689
525
|
},
|
|
690
526
|
setup(e) {
|
|
691
|
-
const t =
|
|
692
|
-
|
|
527
|
+
const t = ee("cell"), { bottom: n, left: o } = xt(t), r = e.store.getCellData(e.colIndex, e.rowIndex), a = x(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";
|
|
528
|
+
T(
|
|
529
|
+
() => e.store.getCellData(e.colIndex, e.rowIndex),
|
|
530
|
+
(m) => {
|
|
531
|
+
a.value = e.store.getFormattedValue(e.colIndex, e.rowIndex, m);
|
|
532
|
+
}
|
|
533
|
+
);
|
|
534
|
+
const d = $(() => typeof a.value == "string" ? Et(a.value) : !1), v = $(() => {
|
|
535
|
+
var m;
|
|
693
536
|
return {
|
|
694
|
-
textAlign:
|
|
695
|
-
width:
|
|
696
|
-
backgroundColor:
|
|
697
|
-
fontWeight:
|
|
698
|
-
paddingLeft: e.store.getIndent(e.colIndex, (
|
|
537
|
+
textAlign: u,
|
|
538
|
+
width: f,
|
|
539
|
+
backgroundColor: i.value ? "var(--sc-cell-changed-color)" : "inherit",
|
|
540
|
+
fontWeight: i.value ? "bold" : "inherit",
|
|
541
|
+
paddingLeft: e.store.getIndent(e.colIndex, (m = e.store.display[e.rowIndex]) == null ? void 0 : m.indent)
|
|
699
542
|
};
|
|
700
|
-
}),
|
|
701
|
-
s.mask, s.modalComponent && e.store.$patch((
|
|
702
|
-
|
|
543
|
+
}), y = () => {
|
|
544
|
+
s.mask, s.modalComponent && e.store.$patch((m) => {
|
|
545
|
+
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
546
|
});
|
|
704
547
|
};
|
|
705
548
|
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":
|
|
549
|
+
let m = {
|
|
550
|
+
...me,
|
|
551
|
+
"keydown.f2": y,
|
|
552
|
+
"keydown.alt.up": y,
|
|
553
|
+
"keydown.alt.down": y,
|
|
554
|
+
"keydown.alt.left": y,
|
|
555
|
+
"keydown.alt.right": y
|
|
713
556
|
};
|
|
714
|
-
typeof e.addNavigation == "object" && (
|
|
715
|
-
...
|
|
557
|
+
typeof e.addNavigation == "object" && (m = {
|
|
558
|
+
...m,
|
|
716
559
|
...e.addNavigation
|
|
717
|
-
}),
|
|
560
|
+
}), ve([
|
|
718
561
|
{
|
|
719
562
|
selectors: t,
|
|
720
|
-
handlers:
|
|
563
|
+
handlers: m
|
|
721
564
|
}
|
|
722
565
|
]);
|
|
723
566
|
}
|
|
724
|
-
const
|
|
567
|
+
const p = () => {
|
|
725
568
|
t.value && (l.value = t.value.textContent);
|
|
726
|
-
},
|
|
727
|
-
t.value && (s.format ?
|
|
569
|
+
}, w = () => {
|
|
570
|
+
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
571
|
};
|
|
729
|
-
return (
|
|
572
|
+
return (m, C) => (E(), k("td", {
|
|
730
573
|
ref: "cell",
|
|
731
|
-
"data-colindex":
|
|
732
|
-
"data-rowindex":
|
|
733
|
-
"data-editable":
|
|
734
|
-
contenteditable:
|
|
735
|
-
tabindex:
|
|
574
|
+
"data-colindex": m.colIndex,
|
|
575
|
+
"data-rowindex": m.rowIndex,
|
|
576
|
+
"data-editable": g(s).edit,
|
|
577
|
+
contenteditable: g(s).edit,
|
|
578
|
+
tabindex: m.tabIndex,
|
|
736
579
|
spellcheck: !1,
|
|
737
|
-
style:
|
|
738
|
-
onFocus:
|
|
739
|
-
onPaste:
|
|
740
|
-
onBlur:
|
|
741
|
-
onInput:
|
|
742
|
-
onClick:
|
|
743
|
-
class:
|
|
580
|
+
style: j(v.value),
|
|
581
|
+
onFocus: p,
|
|
582
|
+
onPaste: w,
|
|
583
|
+
onBlur: w,
|
|
584
|
+
onInput: w,
|
|
585
|
+
onClick: y,
|
|
586
|
+
class: z(["atable-cell", m.pinned ? "sticky-column" : ""])
|
|
744
587
|
}, [
|
|
745
|
-
|
|
588
|
+
g(s).cellComponent ? (E(), Z(Oe(g(s).cellComponent), ae({
|
|
746
589
|
key: 0,
|
|
747
|
-
value:
|
|
748
|
-
},
|
|
590
|
+
value: a.value
|
|
591
|
+
}, g(s).cellComponentProps), null, 16, ["value"])) : d.value ? (E(), k("span", {
|
|
749
592
|
key: 1,
|
|
750
|
-
innerHTML:
|
|
751
|
-
}, null, 8,
|
|
752
|
-
], 46,
|
|
753
|
-
[w(yt), h.store.closeModal]
|
|
754
|
-
]);
|
|
593
|
+
innerHTML: a.value
|
|
594
|
+
}, null, 8, Ct)) : (E(), k("span", It, F(a.value), 1))
|
|
595
|
+
], 46, kt));
|
|
755
596
|
}
|
|
756
|
-
}),
|
|
597
|
+
}), At = ["tabindex"], St = ["tabindex"], $t = ["colspan"], Tt = /* @__PURE__ */ W({
|
|
757
598
|
__name: "AExpansionRow",
|
|
758
599
|
props: {
|
|
759
600
|
rowIndex: {},
|
|
@@ -762,50 +603,50 @@ const Lt = (e) => {
|
|
|
762
603
|
addNavigation: { type: [Boolean, Object] }
|
|
763
604
|
},
|
|
764
605
|
setup(e) {
|
|
765
|
-
const t =
|
|
606
|
+
const t = ee("rowEl"), n = $(() => e.store.display[e.rowIndex].expanded ? "▼" : "►");
|
|
766
607
|
if (e.addNavigation) {
|
|
767
608
|
const o = {
|
|
768
609
|
"keydown.control.g": (r) => {
|
|
769
610
|
r.stopPropagation(), r.preventDefault(), e.store.toggleRowExpand(e.rowIndex);
|
|
770
611
|
}
|
|
771
612
|
};
|
|
772
|
-
typeof e.addNavigation == "object" && Object.assign(o, e.addNavigation),
|
|
613
|
+
typeof e.addNavigation == "object" && Object.assign(o, e.addNavigation), ve([
|
|
773
614
|
{
|
|
774
615
|
selectors: t,
|
|
775
616
|
handlers: o
|
|
776
617
|
}
|
|
777
618
|
]);
|
|
778
619
|
}
|
|
779
|
-
return (o, r) => (
|
|
780
|
-
|
|
620
|
+
return (o, r) => (E(), k(_, null, [
|
|
621
|
+
B("tr", ae(o.$attrs, {
|
|
781
622
|
ref: "rowEl",
|
|
782
623
|
tabindex: o.tabIndex,
|
|
783
624
|
class: "expandable-row"
|
|
784
625
|
}), [
|
|
785
|
-
|
|
626
|
+
B("td", {
|
|
786
627
|
tabIndex: -1,
|
|
787
|
-
onClick: r[0] || (r[0] = (
|
|
628
|
+
onClick: r[0] || (r[0] = (a) => o.store.toggleRowExpand(o.rowIndex)),
|
|
788
629
|
class: "row-index"
|
|
789
|
-
},
|
|
790
|
-
|
|
791
|
-
], 16,
|
|
792
|
-
o.store.display[o.rowIndex].expanded ? (
|
|
630
|
+
}, F(n.value), 1),
|
|
631
|
+
R(o.$slots, "row")
|
|
632
|
+
], 16, At),
|
|
633
|
+
o.store.display[o.rowIndex].expanded ? (E(), k("tr", {
|
|
793
634
|
key: 0,
|
|
794
635
|
ref: "rowExpanded",
|
|
795
636
|
tabindex: o.tabIndex,
|
|
796
637
|
class: "expanded-row"
|
|
797
638
|
}, [
|
|
798
|
-
|
|
639
|
+
B("td", {
|
|
799
640
|
tabIndex: -1,
|
|
800
641
|
colspan: o.store.columns.length + 1,
|
|
801
642
|
class: "expanded-row-content"
|
|
802
643
|
}, [
|
|
803
|
-
|
|
804
|
-
], 8,
|
|
805
|
-
], 8,
|
|
644
|
+
R(o.$slots, "content")
|
|
645
|
+
], 8, $t)
|
|
646
|
+
], 8, St)) : U("", !0)
|
|
806
647
|
], 64));
|
|
807
648
|
}
|
|
808
|
-
}),
|
|
649
|
+
}), Mt = ["tabindex"], Ve = /* @__PURE__ */ W({
|
|
809
650
|
__name: "ARow",
|
|
810
651
|
props: {
|
|
811
652
|
rowIndex: {},
|
|
@@ -814,79 +655,243 @@ const Lt = (e) => {
|
|
|
814
655
|
addNavigation: { type: [Boolean, Object], default: !1 }
|
|
815
656
|
},
|
|
816
657
|
setup(e) {
|
|
817
|
-
const t =
|
|
658
|
+
const t = ee("rowEl"), n = e.store.isRowVisible(e.rowIndex), o = e.store.getRowExpandSymbol(e.rowIndex);
|
|
818
659
|
if (e.addNavigation) {
|
|
819
|
-
let r =
|
|
660
|
+
let r = me;
|
|
820
661
|
typeof e.addNavigation == "object" && (r = {
|
|
821
662
|
...r,
|
|
822
663
|
...e.addNavigation
|
|
823
|
-
}),
|
|
664
|
+
}), ve([
|
|
824
665
|
{
|
|
825
666
|
selectors: t,
|
|
826
667
|
handlers: r
|
|
827
668
|
}
|
|
828
669
|
]);
|
|
829
670
|
}
|
|
830
|
-
return (r,
|
|
671
|
+
return (r, a) => oe((E(), k("tr", {
|
|
831
672
|
ref: "rowEl",
|
|
832
673
|
tabindex: r.tabIndex,
|
|
833
674
|
class: "table-row"
|
|
834
675
|
}, [
|
|
835
|
-
r.store.config.view !== "uncounted" ?
|
|
836
|
-
r.store.config.view === "list" ? (
|
|
676
|
+
r.store.config.view !== "uncounted" ? R(r.$slots, "index", { key: 0 }, () => [
|
|
677
|
+
r.store.config.view === "list" ? (E(), k("td", {
|
|
837
678
|
key: 0,
|
|
838
679
|
tabIndex: -1,
|
|
839
|
-
class:
|
|
840
|
-
},
|
|
680
|
+
class: z(["list-index", r.store.hasPinnedColumns ? "sticky-index" : ""])
|
|
681
|
+
}, F(r.rowIndex + 1), 3)) : r.store.config.view === "tree" ? (E(), k("td", {
|
|
841
682
|
key: 1,
|
|
842
683
|
tabIndex: -1,
|
|
843
|
-
class:
|
|
844
|
-
onClick:
|
|
845
|
-
},
|
|
846
|
-
]) :
|
|
847
|
-
|
|
848
|
-
], 8,
|
|
849
|
-
[
|
|
684
|
+
class: z(["tree-index", r.store.hasPinnedColumns ? "sticky-index" : ""]),
|
|
685
|
+
onClick: a[0] || (a[0] = (l) => r.store.toggleRowExpand(r.rowIndex))
|
|
686
|
+
}, F(g(o)), 3)) : U("", !0)
|
|
687
|
+
]) : U("", !0),
|
|
688
|
+
R(r.$slots, "default")
|
|
689
|
+
], 8, Mt)), [
|
|
690
|
+
[Le, g(n)]
|
|
850
691
|
]);
|
|
851
692
|
}
|
|
852
|
-
}),
|
|
693
|
+
}), je = pe ? window : void 0;
|
|
694
|
+
function V(e) {
|
|
695
|
+
var t;
|
|
696
|
+
const n = M(e);
|
|
697
|
+
return (t = n == null ? void 0 : n.$el) != null ? t : n;
|
|
698
|
+
}
|
|
699
|
+
function K(...e) {
|
|
700
|
+
let t, n, o, r;
|
|
701
|
+
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, o, r] = e, t = je) : [t, n, o, r] = e, !t)
|
|
702
|
+
return P;
|
|
703
|
+
Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
|
|
704
|
+
const a = [], l = () => {
|
|
705
|
+
a.forEach((u) => u()), a.length = 0;
|
|
706
|
+
}, i = (u, f, d, v) => (u.addEventListener(f, d, v), () => u.removeEventListener(f, d, v)), s = T(
|
|
707
|
+
() => [V(t), M(r)],
|
|
708
|
+
([u, f]) => {
|
|
709
|
+
if (l(), !u)
|
|
710
|
+
return;
|
|
711
|
+
const d = De(f) ? { ...f } : f;
|
|
712
|
+
a.push(
|
|
713
|
+
...n.flatMap((v) => o.map((y) => i(u, v, y, d)))
|
|
714
|
+
);
|
|
715
|
+
},
|
|
716
|
+
{ immediate: !0, flush: "post" }
|
|
717
|
+
), c = () => {
|
|
718
|
+
s(), l();
|
|
719
|
+
};
|
|
720
|
+
return J(c), c;
|
|
721
|
+
}
|
|
722
|
+
let Se = !1;
|
|
723
|
+
function $e(e, t, n = {}) {
|
|
724
|
+
const { window: o = je, ignore: r = [], capture: a = !0, detectIframe: l = !1 } = n;
|
|
725
|
+
if (!o)
|
|
726
|
+
return P;
|
|
727
|
+
re && !Se && (Se = !0, Array.from(o.document.body.children).forEach((p) => p.addEventListener("click", P)), o.document.documentElement.addEventListener("click", P));
|
|
728
|
+
let i = !0;
|
|
729
|
+
const s = (p) => M(r).some((w) => {
|
|
730
|
+
if (typeof w == "string")
|
|
731
|
+
return Array.from(o.document.querySelectorAll(w)).some((m) => m === p.target || p.composedPath().includes(m));
|
|
732
|
+
{
|
|
733
|
+
const m = V(w);
|
|
734
|
+
return m && (p.target === m || p.composedPath().includes(m));
|
|
735
|
+
}
|
|
736
|
+
});
|
|
737
|
+
function c(p) {
|
|
738
|
+
const w = M(p);
|
|
739
|
+
return w && w.$.subTree.shapeFlag === 16;
|
|
740
|
+
}
|
|
741
|
+
function u(p, w) {
|
|
742
|
+
const m = M(p), C = m.$.subTree && m.$.subTree.children;
|
|
743
|
+
return C == null || !Array.isArray(C) ? !1 : C.some((H) => H.el === w.target || w.composedPath().includes(H.el));
|
|
744
|
+
}
|
|
745
|
+
const f = (p) => {
|
|
746
|
+
const w = V(e);
|
|
747
|
+
if (p.target != null && !(!(w instanceof Element) && c(e) && u(e, p)) && !(!w || w === p.target || p.composedPath().includes(w))) {
|
|
748
|
+
if (p.detail === 0 && (i = !s(p)), !i) {
|
|
749
|
+
i = !0;
|
|
750
|
+
return;
|
|
751
|
+
}
|
|
752
|
+
t(p);
|
|
753
|
+
}
|
|
754
|
+
};
|
|
755
|
+
let d = !1;
|
|
756
|
+
const v = [
|
|
757
|
+
K(o, "click", (p) => {
|
|
758
|
+
d || (d = !0, setTimeout(() => {
|
|
759
|
+
d = !1;
|
|
760
|
+
}, 0), f(p));
|
|
761
|
+
}, { passive: !0, capture: a }),
|
|
762
|
+
K(o, "pointerdown", (p) => {
|
|
763
|
+
const w = V(e);
|
|
764
|
+
i = !s(p) && !!(w && !p.composedPath().includes(w));
|
|
765
|
+
}, { passive: !0 }),
|
|
766
|
+
l && K(o, "blur", (p) => {
|
|
767
|
+
setTimeout(() => {
|
|
768
|
+
var w;
|
|
769
|
+
const m = V(e);
|
|
770
|
+
((w = o.document.activeElement) == null ? void 0 : w.tagName) === "IFRAME" && !(m != null && m.contains(o.document.activeElement)) && t(p);
|
|
771
|
+
}, 0);
|
|
772
|
+
})
|
|
773
|
+
].filter(Boolean);
|
|
774
|
+
return () => v.forEach((p) => p());
|
|
775
|
+
}
|
|
776
|
+
const Rt = {
|
|
777
|
+
mounted(e, t) {
|
|
778
|
+
const n = !t.modifiers.bubble;
|
|
779
|
+
if (typeof t.value == "function")
|
|
780
|
+
e.__onClickOutside_stop = $e(e, t.value, { capture: n });
|
|
781
|
+
else {
|
|
782
|
+
const [o, r] = t.value;
|
|
783
|
+
e.__onClickOutside_stop = $e(e, o, Object.assign({ capture: n }, r));
|
|
784
|
+
}
|
|
785
|
+
},
|
|
786
|
+
unmounted(e) {
|
|
787
|
+
e.__onClickOutside_stop();
|
|
788
|
+
}
|
|
789
|
+
};
|
|
790
|
+
function te(e) {
|
|
791
|
+
return typeof Window < "u" && e instanceof Window ? e.document.documentElement : typeof Document < "u" && e instanceof Document ? e.documentElement : e;
|
|
792
|
+
}
|
|
793
|
+
function Be(e) {
|
|
794
|
+
const t = window.getComputedStyle(e);
|
|
795
|
+
if (t.overflowX === "scroll" || t.overflowY === "scroll" || t.overflowX === "auto" && e.clientWidth < e.scrollWidth || t.overflowY === "auto" && e.clientHeight < e.scrollHeight)
|
|
796
|
+
return !0;
|
|
797
|
+
{
|
|
798
|
+
const n = e.parentNode;
|
|
799
|
+
return !n || n.tagName === "BODY" ? !1 : Be(n);
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
function Ot(e) {
|
|
803
|
+
const t = e || window.event, n = t.target;
|
|
804
|
+
return Be(n) ? !1 : t.touches.length > 1 ? !0 : (t.preventDefault && t.preventDefault(), !1);
|
|
805
|
+
}
|
|
806
|
+
const ne = /* @__PURE__ */ new WeakMap();
|
|
807
|
+
function Lt(e, t = !1) {
|
|
808
|
+
const n = x(t);
|
|
809
|
+
let o = null, r = "";
|
|
810
|
+
T(ht(e), (i) => {
|
|
811
|
+
const s = te(M(i));
|
|
812
|
+
if (s) {
|
|
813
|
+
const c = s;
|
|
814
|
+
if (ne.get(c) || ne.set(c, c.style.overflow), c.style.overflow !== "hidden" && (r = c.style.overflow), c.style.overflow === "hidden")
|
|
815
|
+
return n.value = !0;
|
|
816
|
+
if (n.value)
|
|
817
|
+
return c.style.overflow = "hidden";
|
|
818
|
+
}
|
|
819
|
+
}, {
|
|
820
|
+
immediate: !0
|
|
821
|
+
});
|
|
822
|
+
const a = () => {
|
|
823
|
+
const i = te(M(e));
|
|
824
|
+
!i || n.value || (re && (o = K(
|
|
825
|
+
i,
|
|
826
|
+
"touchmove",
|
|
827
|
+
(s) => {
|
|
828
|
+
Ot(s);
|
|
829
|
+
},
|
|
830
|
+
{ passive: !1 }
|
|
831
|
+
)), i.style.overflow = "hidden", n.value = !0);
|
|
832
|
+
}, l = () => {
|
|
833
|
+
const i = te(M(e));
|
|
834
|
+
!i || !n.value || (re && (o == null || o()), i.style.overflow = r, ne.delete(i), n.value = !1);
|
|
835
|
+
};
|
|
836
|
+
return J(l), $({
|
|
837
|
+
get() {
|
|
838
|
+
return n.value;
|
|
839
|
+
},
|
|
840
|
+
set(i) {
|
|
841
|
+
i ? a() : l();
|
|
842
|
+
}
|
|
843
|
+
});
|
|
844
|
+
}
|
|
845
|
+
function Pt() {
|
|
846
|
+
let e = !1;
|
|
847
|
+
const t = x(!1);
|
|
848
|
+
return (n, o) => {
|
|
849
|
+
if (t.value = o.value, e)
|
|
850
|
+
return;
|
|
851
|
+
e = !0;
|
|
852
|
+
const r = Lt(n, o.value);
|
|
853
|
+
T(t, (a) => r.value = a);
|
|
854
|
+
};
|
|
855
|
+
}
|
|
856
|
+
Pt();
|
|
857
|
+
const Dt = {
|
|
853
858
|
key: 0,
|
|
854
859
|
id: "resizable"
|
|
855
|
-
},
|
|
860
|
+
}, Wt = {
|
|
856
861
|
class: "atable-header-row",
|
|
857
862
|
tabindex: "-1"
|
|
858
|
-
},
|
|
863
|
+
}, ze = /* @__PURE__ */ W({
|
|
859
864
|
__name: "ATableHeader",
|
|
860
865
|
props: {
|
|
861
866
|
columns: {},
|
|
862
867
|
store: {}
|
|
863
868
|
},
|
|
864
869
|
setup(e) {
|
|
865
|
-
return (t, n) => t.columns.length ? (
|
|
866
|
-
|
|
867
|
-
t.store.zeroColumn ? (
|
|
870
|
+
return (t, n) => t.columns.length ? (E(), k("thead", Dt, [
|
|
871
|
+
B("tr", Wt, [
|
|
872
|
+
t.store.zeroColumn ? (E(), k("th", {
|
|
868
873
|
key: 0,
|
|
869
874
|
id: "header-index",
|
|
870
|
-
class:
|
|
875
|
+
class: z([[
|
|
871
876
|
t.store.hasPinnedColumns ? "sticky-index" : "",
|
|
872
877
|
t.store.config.view === "tree" ? "tree-index" : "",
|
|
873
878
|
t.store.config.view === "list-expansion" ? "list-expansion-index" : ""
|
|
874
879
|
], "list-index"])
|
|
875
|
-
}, null, 2)) :
|
|
876
|
-
(
|
|
880
|
+
}, null, 2)) : U("", !0),
|
|
881
|
+
(E(!0), k(_, null, le(t.columns, (o, r) => (E(), k("th", {
|
|
877
882
|
key: o.name,
|
|
878
883
|
tabindex: "-1",
|
|
879
|
-
style:
|
|
880
|
-
class:
|
|
884
|
+
style: j(t.store.getHeaderCellStyle(o)),
|
|
885
|
+
class: z(o.pinned ? "sticky-column" : "")
|
|
881
886
|
}, [
|
|
882
|
-
|
|
883
|
-
|
|
887
|
+
R(t.$slots, "default", {}, () => [
|
|
888
|
+
Je(F(o.label || String.fromCharCode(r + 97).toUpperCase()), 1)
|
|
884
889
|
])
|
|
885
890
|
], 6))), 128))
|
|
886
891
|
])
|
|
887
|
-
])) :
|
|
892
|
+
])) : U("", !0);
|
|
888
893
|
}
|
|
889
|
-
}),
|
|
894
|
+
}), Fe = /* @__PURE__ */ W({
|
|
890
895
|
__name: "ATableModal",
|
|
891
896
|
props: {
|
|
892
897
|
colIndex: {},
|
|
@@ -897,92 +902,92 @@ const Lt = (e) => {
|
|
|
897
902
|
const t = (n) => {
|
|
898
903
|
n.stopPropagation();
|
|
899
904
|
};
|
|
900
|
-
return (n, o) => (
|
|
905
|
+
return (n, o) => (E(), k("div", {
|
|
901
906
|
class: "amodal",
|
|
902
907
|
tabindex: "-1",
|
|
903
908
|
onClick: t,
|
|
904
909
|
onInput: t
|
|
905
910
|
}, [
|
|
906
|
-
|
|
911
|
+
R(n.$slots, "default")
|
|
907
912
|
], 32));
|
|
908
913
|
}
|
|
909
|
-
}),
|
|
914
|
+
}), Ht = (e) => {
|
|
910
915
|
const t = e.id || crypto.randomUUID();
|
|
911
|
-
return
|
|
916
|
+
return Qe(`table-${t}`, () => {
|
|
912
917
|
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 A = l.value[
|
|
925
|
-
A.parent &&
|
|
918
|
+
const h = {};
|
|
919
|
+
for (const [b, I] of a.value.entries())
|
|
920
|
+
for (const [S, A] of l.value.entries())
|
|
921
|
+
h[`${b}:${S}`] = A[I.name];
|
|
922
|
+
return h;
|
|
923
|
+
}, r = (h) => {
|
|
924
|
+
const b = [Object.assign({}, { rowModified: !1 })];
|
|
925
|
+
if (h && "0:0" in h)
|
|
926
|
+
return h;
|
|
927
|
+
const I = /* @__PURE__ */ new Set();
|
|
928
|
+
for (let S = l.value.length - 1; S >= 0; S--) {
|
|
929
|
+
const A = l.value[S];
|
|
930
|
+
A.parent && I.add(A.parent), b[S] = {
|
|
926
931
|
childrenOpen: !1,
|
|
927
932
|
expanded: !1,
|
|
928
933
|
indent: A.indent || null,
|
|
929
|
-
isParent:
|
|
934
|
+
isParent: I.has(S),
|
|
930
935
|
isRoot: A.parent === null || A.parent === void 0,
|
|
931
936
|
rowModified: !1,
|
|
932
937
|
open: A.parent === null || A.parent === void 0,
|
|
933
938
|
parent: A.parent
|
|
934
939
|
};
|
|
935
940
|
}
|
|
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
|
|
941
|
+
return b;
|
|
942
|
+
}, 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, I) => {
|
|
943
|
+
const S = `${h}:${b}`, A = a.value[h];
|
|
944
|
+
s.value[S] !== I && (c.value[b].rowModified = !0), s.value[S] = I, l.value[b][A.name] = I;
|
|
945
|
+
}, w = (h) => ({
|
|
946
|
+
minWidth: h.width || "40ch",
|
|
947
|
+
textAlign: h.align || "center",
|
|
948
|
+
width: i.value.fullWidth ? "auto" : null
|
|
949
|
+
}), 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) => {
|
|
950
|
+
if (i.value.view === "tree") {
|
|
951
|
+
c.value[h].childrenOpen = !c.value[h].childrenOpen;
|
|
952
|
+
for (let b = l.value.length - 1; b >= 0; b--)
|
|
953
|
+
c.value[b].parent === h && (c.value[b].open = !c.value[b].open, c.value[b].childrenOpen && H(b));
|
|
954
|
+
} else i.value.view === "list-expansion" && (c.value[h].expanded = !c.value[h].expanded);
|
|
955
|
+
}, Ue = (h, b) => {
|
|
956
|
+
const I = y(h, b);
|
|
957
|
+
return he(h, b, I);
|
|
958
|
+
}, he = (h, b, I) => {
|
|
959
|
+
const S = a.value[h], A = l.value[b], N = S.format;
|
|
960
|
+
return N ? typeof N == "function" ? N(I, { table: s.value, row: A, column: S }) : typeof N == "string" ? Function(`"use strict";return (${N})`)()(I, { table: s.value, row: A, column: S }) : I : I;
|
|
956
961
|
};
|
|
957
962
|
return {
|
|
958
963
|
// state
|
|
959
|
-
columns:
|
|
964
|
+
columns: a,
|
|
960
965
|
rows: l,
|
|
961
|
-
config:
|
|
966
|
+
config: i,
|
|
962
967
|
table: s,
|
|
963
|
-
display:
|
|
964
|
-
modal:
|
|
968
|
+
display: c,
|
|
969
|
+
modal: u,
|
|
965
970
|
// getters
|
|
966
|
-
hasPinnedColumns:
|
|
967
|
-
numberedRowWidth:
|
|
968
|
-
zeroColumn:
|
|
971
|
+
hasPinnedColumns: f,
|
|
972
|
+
numberedRowWidth: d,
|
|
973
|
+
zeroColumn: v,
|
|
969
974
|
// actions
|
|
970
|
-
closeModal: (
|
|
971
|
-
var
|
|
972
|
-
|
|
975
|
+
closeModal: (h) => {
|
|
976
|
+
var b;
|
|
977
|
+
h.target instanceof Node && (b = u.value.parent) != null && b.contains(h.target) || u.value.visible && (u.value.visible = !1);
|
|
973
978
|
},
|
|
974
|
-
getCellData:
|
|
975
|
-
getCellDisplayValue:
|
|
976
|
-
getFormattedValue:
|
|
977
|
-
getHeaderCellStyle:
|
|
978
|
-
getIndent: (
|
|
979
|
-
getRowExpandSymbol:
|
|
980
|
-
isRowVisible:
|
|
981
|
-
setCellData:
|
|
982
|
-
toggleRowExpand:
|
|
979
|
+
getCellData: y,
|
|
980
|
+
getCellDisplayValue: Ue,
|
|
981
|
+
getFormattedValue: he,
|
|
982
|
+
getHeaderCellStyle: w,
|
|
983
|
+
getIndent: (h, b) => b && h === 0 && b > 0 ? `${b}ch` : "inherit",
|
|
984
|
+
getRowExpandSymbol: C,
|
|
985
|
+
isRowVisible: m,
|
|
986
|
+
setCellData: p,
|
|
987
|
+
toggleRowExpand: H
|
|
983
988
|
};
|
|
984
989
|
})();
|
|
985
|
-
},
|
|
990
|
+
}, Nt = /* @__PURE__ */ W({
|
|
986
991
|
__name: "ATable",
|
|
987
992
|
props: {
|
|
988
993
|
id: {},
|
|
@@ -993,76 +998,76 @@ const Lt = (e) => {
|
|
|
993
998
|
},
|
|
994
999
|
emits: ["update:modelValue", "cellUpdate"],
|
|
995
1000
|
setup(e, { expose: t, emit: n }) {
|
|
996
|
-
const o = n, r =
|
|
997
|
-
l.$onAction(({ name: s, store:
|
|
1001
|
+
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 });
|
|
1002
|
+
l.$onAction(({ name: s, store: c, args: u }) => {
|
|
998
1003
|
if (s === "setCellData") {
|
|
999
|
-
const [
|
|
1000
|
-
o("cellUpdate", [
|
|
1004
|
+
const [f, d, v] = u, y = c.getCellData(f, d);
|
|
1005
|
+
o("cellUpdate", [f, d, v, y]);
|
|
1001
1006
|
}
|
|
1002
|
-
}),
|
|
1007
|
+
}), T(
|
|
1003
1008
|
() => l.rows,
|
|
1004
1009
|
(s) => {
|
|
1005
1010
|
o("update:modelValue", s);
|
|
1006
1011
|
},
|
|
1007
1012
|
{ deep: !0 }
|
|
1008
|
-
),
|
|
1009
|
-
e.columns.some((s) => s.pinned) && (
|
|
1013
|
+
), Y(() => {
|
|
1014
|
+
e.columns.some((s) => s.pinned) && (i(), l.config.view === "tree" && He(r, i, { childList: !0, subtree: !0 }));
|
|
1010
1015
|
});
|
|
1011
|
-
const
|
|
1012
|
-
const s = r.value,
|
|
1013
|
-
for (const [
|
|
1014
|
-
const
|
|
1015
|
-
|
|
1016
|
+
const i = () => {
|
|
1017
|
+
const s = r.value, c = s.rows[0], u = s.rows[1], f = c ? Array.from(c.cells) : [];
|
|
1018
|
+
for (const [d, v] of f.entries()) {
|
|
1019
|
+
const y = u == null ? void 0 : u.cells[d];
|
|
1020
|
+
y && (v.style.width = `${y.offsetWidth}px`);
|
|
1016
1021
|
}
|
|
1017
|
-
for (const
|
|
1018
|
-
let
|
|
1019
|
-
const
|
|
1020
|
-
for (const
|
|
1021
|
-
(
|
|
1022
|
-
|
|
1022
|
+
for (const d of s.rows) {
|
|
1023
|
+
let v = 0;
|
|
1024
|
+
const y = [];
|
|
1025
|
+
for (const p of d.cells)
|
|
1026
|
+
(p.classList.contains("sticky-column") || p.classList.contains("sticky-index")) && (p.style.left = `${v}px`, v += p.offsetWidth, y.push(p));
|
|
1027
|
+
y.length > 0 && y[y.length - 1].classList.add("sticky-column-edge");
|
|
1023
1028
|
}
|
|
1024
1029
|
};
|
|
1025
1030
|
return window.addEventListener("keydown", (s) => {
|
|
1026
1031
|
if (s.key === "Escape" && l.modal.visible) {
|
|
1027
1032
|
l.modal.visible = !1;
|
|
1028
|
-
const
|
|
1029
|
-
|
|
1030
|
-
|
|
1033
|
+
const c = l.modal.parent;
|
|
1034
|
+
c && Re().then(() => {
|
|
1035
|
+
c.focus();
|
|
1031
1036
|
});
|
|
1032
1037
|
}
|
|
1033
|
-
}), t({ store: l }), (s,
|
|
1038
|
+
}), t({ store: l }), (s, c) => oe((E(), k("table", {
|
|
1034
1039
|
ref: "table",
|
|
1035
1040
|
class: "atable",
|
|
1036
|
-
style:
|
|
1041
|
+
style: j({ width: g(l).config.fullWidth ? "100%" : "auto" })
|
|
1037
1042
|
}, [
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
columns:
|
|
1041
|
-
store:
|
|
1043
|
+
R(s.$slots, "header", { data: g(l) }, () => [
|
|
1044
|
+
ge(ze, {
|
|
1045
|
+
columns: g(l).columns,
|
|
1046
|
+
store: g(l)
|
|
1042
1047
|
}, null, 8, ["columns", "store"])
|
|
1043
1048
|
], !0),
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
(
|
|
1047
|
-
key:
|
|
1048
|
-
row:
|
|
1049
|
-
rowIndex:
|
|
1050
|
-
store:
|
|
1049
|
+
B("tbody", null, [
|
|
1050
|
+
R(s.$slots, "body", { data: g(l) }, () => [
|
|
1051
|
+
(E(!0), k(_, null, le(g(l).rows, (u, f) => (E(), Z(Ve, {
|
|
1052
|
+
key: u.id,
|
|
1053
|
+
row: u,
|
|
1054
|
+
rowIndex: f,
|
|
1055
|
+
store: g(l)
|
|
1051
1056
|
}, {
|
|
1052
|
-
default:
|
|
1053
|
-
(
|
|
1054
|
-
key:
|
|
1055
|
-
store:
|
|
1056
|
-
col:
|
|
1057
|
+
default: ye(() => [
|
|
1058
|
+
(E(!0), k(_, null, le(g(l).columns, (d, v) => (E(), Z(Ne, {
|
|
1059
|
+
key: d.name,
|
|
1060
|
+
store: g(l),
|
|
1061
|
+
col: d,
|
|
1057
1062
|
spellcheck: "false",
|
|
1058
|
-
pinned:
|
|
1059
|
-
rowIndex:
|
|
1060
|
-
colIndex:
|
|
1061
|
-
component:
|
|
1062
|
-
style:
|
|
1063
|
-
textAlign: (
|
|
1064
|
-
minWidth: (
|
|
1065
|
-
width:
|
|
1063
|
+
pinned: d.pinned,
|
|
1064
|
+
rowIndex: f,
|
|
1065
|
+
colIndex: v,
|
|
1066
|
+
component: d.cellComponent,
|
|
1067
|
+
style: j({
|
|
1068
|
+
textAlign: (d == null ? void 0 : d.align) || "center",
|
|
1069
|
+
minWidth: (d == null ? void 0 : d.width) || "40ch",
|
|
1070
|
+
width: g(l).config.fullWidth ? "auto" : null
|
|
1066
1071
|
})
|
|
1067
1072
|
}, null, 8, ["store", "col", "pinned", "rowIndex", "colIndex", "component", "style"]))), 128))
|
|
1068
1073
|
]),
|
|
@@ -1070,50 +1075,52 @@ const Lt = (e) => {
|
|
|
1070
1075
|
}, 1032, ["row", "rowIndex", "store"]))), 128))
|
|
1071
1076
|
], !0)
|
|
1072
1077
|
]),
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
colIndex:
|
|
1077
|
-
rowIndex:
|
|
1078
|
-
store:
|
|
1079
|
-
style:
|
|
1080
|
-
left:
|
|
1081
|
-
top:
|
|
1082
|
-
maxWidth:
|
|
1078
|
+
R(s.$slots, "footer", { data: g(l) }, void 0, !0),
|
|
1079
|
+
R(s.$slots, "modal", { data: g(l) }, () => [
|
|
1080
|
+
oe(ge(Fe, {
|
|
1081
|
+
colIndex: g(l).modal.colIndex,
|
|
1082
|
+
rowIndex: g(l).modal.rowIndex,
|
|
1083
|
+
store: g(l),
|
|
1084
|
+
style: j({
|
|
1085
|
+
left: g(l).modal.left + "px",
|
|
1086
|
+
top: g(l).modal.top + "px",
|
|
1087
|
+
maxWidth: g(l).modal.width + "px"
|
|
1083
1088
|
})
|
|
1084
1089
|
}, {
|
|
1085
|
-
default:
|
|
1086
|
-
(
|
|
1087
|
-
key: `${
|
|
1088
|
-
colIndex:
|
|
1089
|
-
rowIndex:
|
|
1090
|
-
store:
|
|
1091
|
-
},
|
|
1090
|
+
default: ye(() => [
|
|
1091
|
+
(E(), Z(Oe(g(l).modal.component), ae({
|
|
1092
|
+
key: `${g(l).modal.rowIndex}:${g(l).modal.colIndex}`,
|
|
1093
|
+
colIndex: g(l).modal.colIndex,
|
|
1094
|
+
rowIndex: g(l).modal.rowIndex,
|
|
1095
|
+
store: g(l)
|
|
1096
|
+
}, g(l).modal.componentProps), null, 16, ["colIndex", "rowIndex", "store"]))
|
|
1092
1097
|
]),
|
|
1093
1098
|
_: 1
|
|
1094
1099
|
}, 8, ["colIndex", "rowIndex", "store", "style"]), [
|
|
1095
|
-
[
|
|
1100
|
+
[Le, g(l).modal.visible]
|
|
1096
1101
|
])
|
|
1097
1102
|
], !0)
|
|
1098
|
-
], 4))
|
|
1103
|
+
], 4)), [
|
|
1104
|
+
[g(Rt), g(l).closeModal]
|
|
1105
|
+
]);
|
|
1099
1106
|
}
|
|
1100
|
-
}),
|
|
1107
|
+
}), Vt = (e, t) => {
|
|
1101
1108
|
const n = e.__vccOpts || e;
|
|
1102
1109
|
for (const [o, r] of t)
|
|
1103
1110
|
n[o] = r;
|
|
1104
1111
|
return n;
|
|
1105
|
-
},
|
|
1106
|
-
function
|
|
1107
|
-
e.component("ACell",
|
|
1112
|
+
}, jt = /* @__PURE__ */ Vt(Nt, [["__scopeId", "data-v-a7848db7"]]);
|
|
1113
|
+
function Gt(e) {
|
|
1114
|
+
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
1115
|
}
|
|
1109
1116
|
export {
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1117
|
+
Ne as ACell,
|
|
1118
|
+
Tt as AExpansionRow,
|
|
1119
|
+
Ve as ARow,
|
|
1120
|
+
jt as ATable,
|
|
1121
|
+
ze as ATableHeader,
|
|
1122
|
+
Fe as ATableModal,
|
|
1123
|
+
Ht as createTableStore,
|
|
1124
|
+
Gt as install
|
|
1118
1125
|
};
|
|
1119
1126
|
//# sourceMappingURL=atable.js.map
|