@stonecrop/atable 0.4.11 → 0.4.12
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 +14 -8
- package/dist/atable.js +548 -547
- 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 +10 -7
- package/dist/src/stores/table.d.ts.map +1 -1
- package/dist/src/types/index.d.ts +4 -1
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/stores/table.js +6 -0
- package/package.json +3 -3
- package/src/components/AGanttCell.vue +2 -2
- package/src/components/ATable.vue +6 -9
- package/src/stores/table.ts +7 -0
- package/src/types/index.ts +5 -1
package/dist/atable.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { onMounted as
|
|
2
|
-
import { defineStore as
|
|
3
|
-
import './assets/index.css';function
|
|
4
|
-
return
|
|
1
|
+
import { onMounted as te, ref as P, watch as N, onBeforeUnmount as ot, computed as A, shallowRef as W, toValue as C, watchEffect as lt, getCurrentScope as Fe, onScopeDispose as je, unref as x, getCurrentInstance as Ee, nextTick as Ge, isRef as at, toRefs as st, customRef as Ue, toRef as rt, readonly as it, defineComponent as J, useTemplateRef as B, createElementBlock as R, openBlock as $, normalizeClass as G, normalizeStyle as Y, createBlock as ae, resolveDynamicComponent as fe, mergeProps as ke, toDisplayString as Z, Fragment as re, createElementVNode as D, createCommentVNode as K, renderSlot as X, useCssVars as ut, withDirectives as be, vShow as Ye, renderList as xe, createTextVNode as ct, withModifiers as Pe, createVNode as Oe, withCtx as Le } from "vue";
|
|
2
|
+
import { defineStore as dt } from "pinia";
|
|
3
|
+
import './assets/index.css';function Me(e) {
|
|
4
|
+
return Fe() ? (je(e), !0) : !1;
|
|
5
5
|
}
|
|
6
|
-
const
|
|
6
|
+
const ft = typeof window < "u" && typeof document < "u";
|
|
7
7
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
8
|
-
const
|
|
8
|
+
const vt = (e) => e != null, mt = Object.prototype.toString, pt = (e) => mt.call(e) === "[object Object]", ht = () => {
|
|
9
9
|
};
|
|
10
|
-
function
|
|
10
|
+
function ve(e) {
|
|
11
11
|
return Array.isArray(e) ? e : [e];
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function gt(e, t, n) {
|
|
14
14
|
return N(
|
|
15
15
|
e,
|
|
16
16
|
t,
|
|
@@ -20,37 +20,37 @@ function ht(e, t, n) {
|
|
|
20
20
|
}
|
|
21
21
|
);
|
|
22
22
|
}
|
|
23
|
-
const
|
|
24
|
-
function
|
|
23
|
+
const ne = ft ? window : void 0;
|
|
24
|
+
function _(e) {
|
|
25
25
|
var t;
|
|
26
26
|
const n = C(e);
|
|
27
27
|
return (t = n == null ? void 0 : n.$el) != null ? t : n;
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function ue(...e) {
|
|
30
30
|
const t = [], n = () => {
|
|
31
|
-
t.forEach((
|
|
32
|
-
}, l = (
|
|
33
|
-
const
|
|
34
|
-
return
|
|
35
|
-
}), u =
|
|
31
|
+
t.forEach((a) => a()), t.length = 0;
|
|
32
|
+
}, l = (a, r, s, c) => (a.addEventListener(r, s, c), () => a.removeEventListener(r, s, c)), i = A(() => {
|
|
33
|
+
const a = ve(C(e[0])).filter((r) => r != null);
|
|
34
|
+
return a.every((r) => typeof r != "string") ? a : void 0;
|
|
35
|
+
}), u = gt(
|
|
36
36
|
() => {
|
|
37
|
-
var
|
|
37
|
+
var a, r;
|
|
38
38
|
return [
|
|
39
|
-
(r = (
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
(r = (a = i.value) == null ? void 0 : a.map((s) => _(s))) != null ? r : [ne].filter((s) => s != null),
|
|
40
|
+
ve(C(i.value ? e[1] : e[0])),
|
|
41
|
+
ve(x(i.value ? e[2] : e[1])),
|
|
42
42
|
// @ts-expect-error - TypeScript gets the correct types, but somehow still complains
|
|
43
43
|
C(i.value ? e[3] : e[2])
|
|
44
44
|
];
|
|
45
45
|
},
|
|
46
|
-
([
|
|
47
|
-
if (n(), !(
|
|
46
|
+
([a, r, s, c]) => {
|
|
47
|
+
if (n(), !(a != null && a.length) || !(r != null && r.length) || !(s != null && s.length))
|
|
48
48
|
return;
|
|
49
|
-
const v =
|
|
49
|
+
const v = pt(c) ? { ...c } : c;
|
|
50
50
|
t.push(
|
|
51
|
-
...
|
|
51
|
+
...a.flatMap(
|
|
52
52
|
(m) => r.flatMap(
|
|
53
|
-
(d) =>
|
|
53
|
+
(d) => s.map((g) => l(m, d, g, v))
|
|
54
54
|
)
|
|
55
55
|
)
|
|
56
56
|
);
|
|
@@ -59,56 +59,56 @@ function ie(...e) {
|
|
|
59
59
|
), o = () => {
|
|
60
60
|
u(), n();
|
|
61
61
|
};
|
|
62
|
-
return
|
|
62
|
+
return Me(n), o;
|
|
63
63
|
}
|
|
64
|
-
function
|
|
65
|
-
const e = W(!1), t =
|
|
66
|
-
return t &&
|
|
64
|
+
function wt() {
|
|
65
|
+
const e = W(!1), t = Ee();
|
|
66
|
+
return t && te(() => {
|
|
67
67
|
e.value = !0;
|
|
68
68
|
}, t), e;
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
const t =
|
|
72
|
-
return
|
|
70
|
+
function yt(e) {
|
|
71
|
+
const t = wt();
|
|
72
|
+
return A(() => (t.value, !!e()));
|
|
73
73
|
}
|
|
74
|
-
function
|
|
75
|
-
const { window: l =
|
|
74
|
+
function bt(e, t, n = {}) {
|
|
75
|
+
const { window: l = ne, ...i } = n;
|
|
76
76
|
let u;
|
|
77
|
-
const o =
|
|
77
|
+
const o = yt(() => l && "MutationObserver" in l), a = () => {
|
|
78
78
|
u && (u.disconnect(), u = void 0);
|
|
79
|
-
}, r =
|
|
80
|
-
const m = C(e), d =
|
|
79
|
+
}, r = A(() => {
|
|
80
|
+
const m = C(e), d = ve(m).map(_).filter(vt);
|
|
81
81
|
return new Set(d);
|
|
82
|
-
}),
|
|
82
|
+
}), s = N(
|
|
83
83
|
() => r.value,
|
|
84
84
|
(m) => {
|
|
85
|
-
|
|
85
|
+
a(), o.value && m.size && (u = new MutationObserver(t), m.forEach((d) => u.observe(d, i)));
|
|
86
86
|
},
|
|
87
87
|
{ immediate: !0, flush: "post" }
|
|
88
88
|
), c = () => u == null ? void 0 : u.takeRecords(), v = () => {
|
|
89
|
-
|
|
89
|
+
s(), a();
|
|
90
90
|
};
|
|
91
|
-
return
|
|
91
|
+
return Me(v), {
|
|
92
92
|
isSupported: o,
|
|
93
93
|
stop: v,
|
|
94
94
|
takeRecords: c
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function xt(e, t, n = {}) {
|
|
98
98
|
const {
|
|
99
|
-
window: l =
|
|
99
|
+
window: l = ne,
|
|
100
100
|
document: i = l == null ? void 0 : l.document,
|
|
101
101
|
flush: u = "sync"
|
|
102
102
|
} = n;
|
|
103
103
|
if (!l || !i)
|
|
104
|
-
return
|
|
104
|
+
return ht;
|
|
105
105
|
let o;
|
|
106
|
-
const
|
|
106
|
+
const a = (c) => {
|
|
107
107
|
o == null || o(), o = c;
|
|
108
|
-
}, r =
|
|
109
|
-
const c =
|
|
108
|
+
}, r = lt(() => {
|
|
109
|
+
const c = _(e);
|
|
110
110
|
if (c) {
|
|
111
|
-
const { stop: v } =
|
|
111
|
+
const { stop: v } = bt(
|
|
112
112
|
i,
|
|
113
113
|
(m) => {
|
|
114
114
|
m.map((d) => [...d.removedNodes]).flat().some((d) => d === c || d.contains(c)) && t(m);
|
|
@@ -119,88 +119,88 @@ function bt(e, t, n = {}) {
|
|
|
119
119
|
subtree: !0
|
|
120
120
|
}
|
|
121
121
|
);
|
|
122
|
-
|
|
122
|
+
a(v);
|
|
123
123
|
}
|
|
124
|
-
}, { flush: u }),
|
|
125
|
-
r(),
|
|
124
|
+
}, { flush: u }), s = () => {
|
|
125
|
+
r(), a();
|
|
126
126
|
};
|
|
127
|
-
return
|
|
127
|
+
return Me(s), s;
|
|
128
128
|
}
|
|
129
|
-
function
|
|
129
|
+
function Ct(e = {}) {
|
|
130
130
|
var t;
|
|
131
131
|
const {
|
|
132
|
-
window: n =
|
|
132
|
+
window: n = ne,
|
|
133
133
|
deep: l = !0,
|
|
134
134
|
triggerOnRemoval: i = !1
|
|
135
135
|
} = e, u = (t = e.document) != null ? t : n == null ? void 0 : n.document, o = () => {
|
|
136
|
-
var
|
|
136
|
+
var s;
|
|
137
137
|
let c = u == null ? void 0 : u.activeElement;
|
|
138
138
|
if (l)
|
|
139
139
|
for (; c != null && c.shadowRoot; )
|
|
140
|
-
c = (
|
|
140
|
+
c = (s = c == null ? void 0 : c.shadowRoot) == null ? void 0 : s.activeElement;
|
|
141
141
|
return c;
|
|
142
|
-
},
|
|
143
|
-
|
|
142
|
+
}, a = P(), r = () => {
|
|
143
|
+
a.value = o();
|
|
144
144
|
};
|
|
145
145
|
if (n) {
|
|
146
|
-
const
|
|
146
|
+
const s = {
|
|
147
147
|
capture: !0,
|
|
148
148
|
passive: !0
|
|
149
149
|
};
|
|
150
|
-
|
|
150
|
+
ue(
|
|
151
151
|
n,
|
|
152
152
|
"blur",
|
|
153
153
|
(c) => {
|
|
154
154
|
c.relatedTarget === null && r();
|
|
155
155
|
},
|
|
156
|
-
|
|
157
|
-
),
|
|
156
|
+
s
|
|
157
|
+
), ue(
|
|
158
158
|
n,
|
|
159
159
|
"focus",
|
|
160
160
|
r,
|
|
161
|
-
|
|
161
|
+
s
|
|
162
162
|
);
|
|
163
163
|
}
|
|
164
|
-
return i &&
|
|
164
|
+
return i && xt(a, r, { document: u }), r(), a;
|
|
165
165
|
}
|
|
166
|
-
const
|
|
167
|
-
function
|
|
168
|
-
const { window: n =
|
|
166
|
+
const Et = "focusin", kt = "focusout", Mt = ":focus-within";
|
|
167
|
+
function $t(e, t = {}) {
|
|
168
|
+
const { window: n = ne } = t, l = A(() => _(e)), i = W(!1), u = A(() => i.value), o = Ct(t);
|
|
169
169
|
if (!n || !o.value)
|
|
170
170
|
return { focused: u };
|
|
171
|
-
const
|
|
172
|
-
return
|
|
173
|
-
var r,
|
|
174
|
-
return i.value = (c = (
|
|
175
|
-
},
|
|
171
|
+
const a = { passive: !0 };
|
|
172
|
+
return ue(l, Et, () => i.value = !0, a), ue(l, kt, () => {
|
|
173
|
+
var r, s, c;
|
|
174
|
+
return i.value = (c = (s = (r = l.value) == null ? void 0 : r.matches) == null ? void 0 : s.call(r, Mt)) != null ? c : !1;
|
|
175
|
+
}, a), { focused: u };
|
|
176
176
|
}
|
|
177
|
-
function
|
|
177
|
+
function At(e, { window: t = ne, scrollTarget: n } = {}) {
|
|
178
178
|
const l = P(!1), i = () => {
|
|
179
179
|
if (!t) return;
|
|
180
|
-
const u = t.document, o =
|
|
180
|
+
const u = t.document, o = _(e);
|
|
181
181
|
if (!o)
|
|
182
182
|
l.value = !1;
|
|
183
183
|
else {
|
|
184
|
-
const
|
|
185
|
-
l.value =
|
|
184
|
+
const a = o.getBoundingClientRect();
|
|
185
|
+
l.value = a.top <= (t.innerHeight || u.documentElement.clientHeight) && a.left <= (t.innerWidth || u.documentElement.clientWidth) && a.bottom >= 0 && a.right >= 0;
|
|
186
186
|
}
|
|
187
187
|
};
|
|
188
188
|
return N(
|
|
189
|
-
() =>
|
|
189
|
+
() => _(e),
|
|
190
190
|
() => i(),
|
|
191
191
|
{ immediate: !0, flush: "post" }
|
|
192
|
-
), t &&
|
|
192
|
+
), t && ue(n || t, "scroll", i, {
|
|
193
193
|
capture: !1,
|
|
194
194
|
passive: !0
|
|
195
195
|
}), l;
|
|
196
196
|
}
|
|
197
197
|
const z = (e) => {
|
|
198
|
-
let t =
|
|
198
|
+
let t = At(e).value;
|
|
199
199
|
return t = t && e.offsetHeight > 0, t;
|
|
200
|
-
}, F = (e) => e.tabIndex >= 0,
|
|
200
|
+
}, F = (e) => e.tabIndex >= 0, De = (e) => {
|
|
201
201
|
const t = e.target;
|
|
202
|
-
return
|
|
203
|
-
},
|
|
202
|
+
return $e(t);
|
|
203
|
+
}, $e = (e) => {
|
|
204
204
|
var t;
|
|
205
205
|
let n;
|
|
206
206
|
if (e instanceof HTMLTableCellElement) {
|
|
@@ -213,7 +213,7 @@ const z = (e) => {
|
|
|
213
213
|
const l = e.previousElementSibling;
|
|
214
214
|
l && (n = l);
|
|
215
215
|
}
|
|
216
|
-
return n && (!F(n) || !z(n)) ?
|
|
216
|
+
return n && (!F(n) || !z(n)) ? $e(n) : n;
|
|
217
217
|
}, It = (e) => {
|
|
218
218
|
var t;
|
|
219
219
|
const n = e.target;
|
|
@@ -231,11 +231,11 @@ const z = (e) => {
|
|
|
231
231
|
u && (l = u);
|
|
232
232
|
}
|
|
233
233
|
}
|
|
234
|
-
return l && (!F(l) || !z(l)) ?
|
|
235
|
-
},
|
|
234
|
+
return l && (!F(l) || !z(l)) ? Ae(l) : l;
|
|
235
|
+
}, He = (e) => {
|
|
236
236
|
const t = e.target;
|
|
237
|
-
return
|
|
238
|
-
},
|
|
237
|
+
return Ae(t);
|
|
238
|
+
}, Ae = (e) => {
|
|
239
239
|
var t;
|
|
240
240
|
let n;
|
|
241
241
|
if (e instanceof HTMLTableCellElement) {
|
|
@@ -248,8 +248,8 @@ const z = (e) => {
|
|
|
248
248
|
const l = e.nextElementSibling;
|
|
249
249
|
l && (n = l);
|
|
250
250
|
}
|
|
251
|
-
return n && (!F(n) || !z(n)) ?
|
|
252
|
-
},
|
|
251
|
+
return n && (!F(n) || !z(n)) ? Ae(n) : n;
|
|
252
|
+
}, St = (e) => {
|
|
253
253
|
var t;
|
|
254
254
|
const n = e.target;
|
|
255
255
|
let l;
|
|
@@ -266,8 +266,8 @@ const z = (e) => {
|
|
|
266
266
|
u && (l = u);
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
|
-
return l && (!F(l) || !z(l)) ?
|
|
270
|
-
},
|
|
269
|
+
return l && (!F(l) || !z(l)) ? $e(l) : l;
|
|
270
|
+
}, We = (e) => {
|
|
271
271
|
const t = e.target;
|
|
272
272
|
return Ie(t);
|
|
273
273
|
}, Ie = (e) => {
|
|
@@ -280,10 +280,10 @@ const z = (e) => {
|
|
|
280
280
|
n = l == null ? void 0 : l.lastElementChild;
|
|
281
281
|
}
|
|
282
282
|
return n && (!F(n) || !z(n)) ? Ie(n) : n;
|
|
283
|
-
},
|
|
283
|
+
}, Xe = (e) => {
|
|
284
284
|
const t = e.target;
|
|
285
|
-
return
|
|
286
|
-
},
|
|
285
|
+
return Se(t);
|
|
286
|
+
}, Se = (e) => {
|
|
287
287
|
var t;
|
|
288
288
|
let n;
|
|
289
289
|
if (e.nextElementSibling)
|
|
@@ -292,33 +292,33 @@ const z = (e) => {
|
|
|
292
292
|
const l = (t = e.parentElement) == null ? void 0 : t.nextElementSibling;
|
|
293
293
|
n = l == null ? void 0 : l.firstElementChild;
|
|
294
294
|
}
|
|
295
|
-
return n && (!F(n) || !z(n)) ?
|
|
296
|
-
}, Xe = (e) => {
|
|
297
|
-
const t = e.target.parentElement, n = t == null ? void 0 : t.firstElementChild;
|
|
298
|
-
return n && (!F(n) || !z(n)) ? Ae(n) : n;
|
|
295
|
+
return n && (!F(n) || !z(n)) ? Se(n) : n;
|
|
299
296
|
}, Ve = (e) => {
|
|
297
|
+
const t = e.target.parentElement, n = t == null ? void 0 : t.firstElementChild;
|
|
298
|
+
return n && (!F(n) || !z(n)) ? Se(n) : n;
|
|
299
|
+
}, Ne = (e) => {
|
|
300
300
|
const t = e.target.parentElement, n = t == null ? void 0 : t.lastElementChild;
|
|
301
301
|
return n && (!F(n) || !z(n)) ? Ie(n) : n;
|
|
302
|
-
},
|
|
302
|
+
}, de = ["alt", "control", "shift", "meta"], Tt = {
|
|
303
303
|
ArrowUp: "up",
|
|
304
304
|
ArrowDown: "down",
|
|
305
305
|
ArrowLeft: "left",
|
|
306
306
|
ArrowRight: "right"
|
|
307
|
-
},
|
|
307
|
+
}, Te = {
|
|
308
308
|
"keydown.up": (e) => {
|
|
309
|
-
const t =
|
|
309
|
+
const t = De(e);
|
|
310
310
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
311
311
|
},
|
|
312
312
|
"keydown.down": (e) => {
|
|
313
|
-
const t =
|
|
313
|
+
const t = He(e);
|
|
314
314
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
315
315
|
},
|
|
316
316
|
"keydown.left": (e) => {
|
|
317
|
-
const t =
|
|
317
|
+
const t = We(e);
|
|
318
318
|
e.preventDefault(), e.stopPropagation(), t && t.focus();
|
|
319
319
|
},
|
|
320
320
|
"keydown.right": (e) => {
|
|
321
|
-
const t =
|
|
321
|
+
const t = Xe(e);
|
|
322
322
|
e.preventDefault(), e.stopPropagation(), t && t.focus();
|
|
323
323
|
},
|
|
324
324
|
"keydown.control.up": (e) => {
|
|
@@ -326,142 +326,142 @@ const z = (e) => {
|
|
|
326
326
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
327
327
|
},
|
|
328
328
|
"keydown.control.down": (e) => {
|
|
329
|
-
const t =
|
|
329
|
+
const t = St(e);
|
|
330
330
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
331
331
|
},
|
|
332
332
|
"keydown.control.left": (e) => {
|
|
333
|
-
const t =
|
|
333
|
+
const t = Ve(e);
|
|
334
334
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
335
335
|
},
|
|
336
336
|
"keydown.control.right": (e) => {
|
|
337
|
-
const t =
|
|
337
|
+
const t = Ne(e);
|
|
338
338
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
339
339
|
},
|
|
340
340
|
"keydown.end": (e) => {
|
|
341
|
-
const t =
|
|
341
|
+
const t = Ne(e);
|
|
342
342
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
343
343
|
},
|
|
344
344
|
"keydown.enter": (e) => {
|
|
345
345
|
if (e.target instanceof HTMLTableCellElement) {
|
|
346
346
|
e.preventDefault(), e.stopPropagation();
|
|
347
|
-
const t =
|
|
347
|
+
const t = He(e);
|
|
348
348
|
t && t.focus();
|
|
349
349
|
}
|
|
350
350
|
},
|
|
351
351
|
"keydown.shift.enter": (e) => {
|
|
352
352
|
if (e.target instanceof HTMLTableCellElement) {
|
|
353
353
|
e.preventDefault(), e.stopPropagation();
|
|
354
|
-
const t =
|
|
354
|
+
const t = De(e);
|
|
355
355
|
t && t.focus();
|
|
356
356
|
}
|
|
357
357
|
},
|
|
358
358
|
"keydown.home": (e) => {
|
|
359
|
-
const t =
|
|
359
|
+
const t = Ve(e);
|
|
360
360
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
361
361
|
},
|
|
362
362
|
"keydown.tab": (e) => {
|
|
363
|
-
const t =
|
|
363
|
+
const t = Xe(e);
|
|
364
364
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
365
365
|
},
|
|
366
366
|
"keydown.shift.tab": (e) => {
|
|
367
|
-
const t =
|
|
367
|
+
const t = We(e);
|
|
368
368
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
369
369
|
}
|
|
370
370
|
};
|
|
371
|
-
function
|
|
371
|
+
function Re(e) {
|
|
372
372
|
const t = (o) => {
|
|
373
|
-
let
|
|
374
|
-
return o.parent && (typeof o.parent == "string" ?
|
|
373
|
+
let a = null;
|
|
374
|
+
return o.parent && (typeof o.parent == "string" ? a = document.querySelector(o.parent) : o.parent instanceof HTMLElement ? a = o.parent : a = o.parent.value), a;
|
|
375
375
|
}, n = (o) => {
|
|
376
|
-
var
|
|
376
|
+
var a;
|
|
377
377
|
const r = t(o);
|
|
378
|
-
let
|
|
378
|
+
let s = [];
|
|
379
379
|
if (typeof o.selectors == "string")
|
|
380
|
-
|
|
380
|
+
s = r ? Array.from(r.querySelectorAll(o.selectors)) : Array.from(document.querySelectorAll(o.selectors));
|
|
381
381
|
else if (Array.isArray(o.selectors))
|
|
382
382
|
for (const c of o.selectors)
|
|
383
|
-
c instanceof HTMLElement ?
|
|
383
|
+
c instanceof HTMLElement ? s.push(c) : s.push(c.$el);
|
|
384
384
|
else if (o.selectors instanceof HTMLElement)
|
|
385
|
-
|
|
386
|
-
else if ((
|
|
385
|
+
s.push(o.selectors);
|
|
386
|
+
else if ((a = o.selectors) != null && a.value)
|
|
387
387
|
if (Array.isArray(o.selectors.value))
|
|
388
388
|
for (const c of o.selectors.value)
|
|
389
|
-
c instanceof HTMLElement ?
|
|
389
|
+
c instanceof HTMLElement ? s.push(c) : s.push(c.$el);
|
|
390
390
|
else
|
|
391
|
-
|
|
392
|
-
return
|
|
391
|
+
s.push(o.selectors.value);
|
|
392
|
+
return s;
|
|
393
393
|
}, l = (o) => {
|
|
394
|
-
const
|
|
394
|
+
const a = t(o);
|
|
395
395
|
let r = [];
|
|
396
|
-
return o.selectors ? r = n(o) :
|
|
397
|
-
}, i = (o) => (
|
|
398
|
-
const r =
|
|
399
|
-
if (
|
|
400
|
-
const
|
|
401
|
-
for (const c of Object.keys(
|
|
396
|
+
return o.selectors ? r = n(o) : a && (r = Array.from(a.children).filter((s) => F(s) && z(s))), r;
|
|
397
|
+
}, i = (o) => (a) => {
|
|
398
|
+
const r = Tt[a.key] || a.key.toLowerCase();
|
|
399
|
+
if (de.includes(r)) return;
|
|
400
|
+
const s = o.handlers || Te;
|
|
401
|
+
for (const c of Object.keys(s)) {
|
|
402
402
|
const [v, ...m] = c.split(".");
|
|
403
403
|
if (v === "keydown" && m.includes(r)) {
|
|
404
|
-
const d =
|
|
404
|
+
const d = s[c], g = m.filter((f) => de.includes(f)), M = de.some((f) => {
|
|
405
405
|
const p = f.charAt(0).toUpperCase() + f.slice(1);
|
|
406
|
-
return
|
|
406
|
+
return a.getModifierState(p);
|
|
407
407
|
});
|
|
408
|
-
if (
|
|
408
|
+
if (g.length > 0) {
|
|
409
409
|
if (M) {
|
|
410
|
-
for (const f of
|
|
410
|
+
for (const f of de)
|
|
411
411
|
if (m.includes(f)) {
|
|
412
412
|
const p = f.charAt(0).toUpperCase() + f.slice(1);
|
|
413
|
-
|
|
413
|
+
a.getModifierState(p) && d(a);
|
|
414
414
|
}
|
|
415
415
|
}
|
|
416
416
|
} else
|
|
417
|
-
M || d(
|
|
417
|
+
M || d(a);
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
420
|
}, u = [];
|
|
421
|
-
|
|
421
|
+
te(() => {
|
|
422
422
|
for (const o of e) {
|
|
423
|
-
const
|
|
423
|
+
const a = t(o), r = l(o), s = i(o), c = a ? [a] : r;
|
|
424
424
|
for (const v of c) {
|
|
425
|
-
const { focused: m } =
|
|
426
|
-
|
|
425
|
+
const { focused: m } = $t(P(v)), d = N(m, (g) => {
|
|
426
|
+
g ? v.addEventListener("keydown", s) : v.removeEventListener("keydown", s);
|
|
427
427
|
});
|
|
428
428
|
u.push(d);
|
|
429
429
|
}
|
|
430
430
|
}
|
|
431
|
-
}),
|
|
431
|
+
}), ot(() => {
|
|
432
432
|
for (const o of u)
|
|
433
433
|
o();
|
|
434
434
|
});
|
|
435
435
|
}
|
|
436
|
-
function
|
|
437
|
-
return
|
|
436
|
+
function ce(e) {
|
|
437
|
+
return Fe() ? (je(e), !0) : !1;
|
|
438
438
|
}
|
|
439
|
-
const
|
|
439
|
+
const pe = typeof window < "u" && typeof document < "u";
|
|
440
440
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
441
|
-
const
|
|
442
|
-
},
|
|
443
|
-
function
|
|
441
|
+
const Rt = (e) => e != null, Pt = Object.prototype.toString, qe = (e) => Pt.call(e) === "[object Object]", U = () => {
|
|
442
|
+
}, Ce = /* @__PURE__ */ Ot();
|
|
443
|
+
function Ot() {
|
|
444
444
|
var e, t;
|
|
445
|
-
return
|
|
445
|
+
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));
|
|
446
446
|
}
|
|
447
|
-
function
|
|
448
|
-
return
|
|
447
|
+
function Lt(e) {
|
|
448
|
+
return Ee();
|
|
449
449
|
}
|
|
450
|
-
function
|
|
450
|
+
function q(e) {
|
|
451
451
|
return Array.isArray(e) ? e : [e];
|
|
452
452
|
}
|
|
453
|
-
function
|
|
453
|
+
function Dt(...e) {
|
|
454
454
|
if (e.length !== 1)
|
|
455
|
-
return
|
|
455
|
+
return rt(...e);
|
|
456
456
|
const t = e[0];
|
|
457
|
-
return typeof t == "function" ?
|
|
457
|
+
return typeof t == "function" ? it(Ue(() => ({ get: t, set: U }))) : P(t);
|
|
458
458
|
}
|
|
459
|
-
function
|
|
460
|
-
if (!
|
|
461
|
-
return
|
|
459
|
+
function Ht(e, t = {}) {
|
|
460
|
+
if (!at(e))
|
|
461
|
+
return st(e);
|
|
462
462
|
const n = Array.isArray(e.value) ? Array.from({ length: e.value.length }) : {};
|
|
463
463
|
for (const l in e.value)
|
|
464
|
-
n[l] =
|
|
464
|
+
n[l] = Ue(() => ({
|
|
465
465
|
get() {
|
|
466
466
|
return e.value[l];
|
|
467
467
|
},
|
|
@@ -469,11 +469,11 @@ function Dt(e, t = {}) {
|
|
|
469
469
|
var u;
|
|
470
470
|
if ((u = C(t.replaceRef)) != null ? u : !0)
|
|
471
471
|
if (Array.isArray(e.value)) {
|
|
472
|
-
const
|
|
473
|
-
|
|
472
|
+
const a = [...e.value];
|
|
473
|
+
a[l] = i, e.value = a;
|
|
474
474
|
} else {
|
|
475
|
-
const
|
|
476
|
-
Object.setPrototypeOf(
|
|
475
|
+
const a = { ...e.value, [l]: i };
|
|
476
|
+
Object.setPrototypeOf(a, Object.getPrototypeOf(e.value)), e.value = a;
|
|
477
477
|
}
|
|
478
478
|
else
|
|
479
479
|
e.value[l] = i;
|
|
@@ -481,10 +481,10 @@ function Dt(e, t = {}) {
|
|
|
481
481
|
}));
|
|
482
482
|
return n;
|
|
483
483
|
}
|
|
484
|
-
function
|
|
485
|
-
|
|
484
|
+
function Wt(e, t = !0, n) {
|
|
485
|
+
Lt() ? te(e, n) : t ? e() : Ge(e);
|
|
486
486
|
}
|
|
487
|
-
function
|
|
487
|
+
function Je(e, t, n) {
|
|
488
488
|
return N(
|
|
489
489
|
e,
|
|
490
490
|
t,
|
|
@@ -494,37 +494,37 @@ function qe(e, t, n) {
|
|
|
494
494
|
}
|
|
495
495
|
);
|
|
496
496
|
}
|
|
497
|
-
const
|
|
498
|
-
function
|
|
497
|
+
const he = pe ? window : void 0;
|
|
498
|
+
function ee(e) {
|
|
499
499
|
var t;
|
|
500
500
|
const n = C(e);
|
|
501
501
|
return (t = n == null ? void 0 : n.$el) != null ? t : n;
|
|
502
502
|
}
|
|
503
|
-
function
|
|
503
|
+
function ie(...e) {
|
|
504
504
|
const t = [], n = () => {
|
|
505
|
-
t.forEach((
|
|
506
|
-
}, l = (
|
|
507
|
-
const
|
|
508
|
-
return
|
|
509
|
-
}), u =
|
|
505
|
+
t.forEach((a) => a()), t.length = 0;
|
|
506
|
+
}, l = (a, r, s, c) => (a.addEventListener(r, s, c), () => a.removeEventListener(r, s, c)), i = A(() => {
|
|
507
|
+
const a = q(C(e[0])).filter((r) => r != null);
|
|
508
|
+
return a.every((r) => typeof r != "string") ? a : void 0;
|
|
509
|
+
}), u = Je(
|
|
510
510
|
() => {
|
|
511
|
-
var
|
|
511
|
+
var a, r;
|
|
512
512
|
return [
|
|
513
|
-
(r = (
|
|
514
|
-
|
|
515
|
-
|
|
513
|
+
(r = (a = i.value) == null ? void 0 : a.map((s) => ee(s))) != null ? r : [he].filter((s) => s != null),
|
|
514
|
+
q(C(i.value ? e[1] : e[0])),
|
|
515
|
+
q(x(i.value ? e[2] : e[1])),
|
|
516
516
|
// @ts-expect-error - TypeScript gets the correct types, but somehow still complains
|
|
517
517
|
C(i.value ? e[3] : e[2])
|
|
518
518
|
];
|
|
519
519
|
},
|
|
520
|
-
([
|
|
521
|
-
if (n(), !(
|
|
520
|
+
([a, r, s, c]) => {
|
|
521
|
+
if (n(), !(a != null && a.length) || !(r != null && r.length) || !(s != null && s.length))
|
|
522
522
|
return;
|
|
523
|
-
const v =
|
|
523
|
+
const v = qe(c) ? { ...c } : c;
|
|
524
524
|
t.push(
|
|
525
|
-
...
|
|
525
|
+
...a.flatMap(
|
|
526
526
|
(m) => r.flatMap(
|
|
527
|
-
(d) =>
|
|
527
|
+
(d) => s.map((g) => l(m, d, g, v))
|
|
528
528
|
)
|
|
529
529
|
)
|
|
530
530
|
);
|
|
@@ -533,113 +533,113 @@ function re(...e) {
|
|
|
533
533
|
), o = () => {
|
|
534
534
|
u(), n();
|
|
535
535
|
};
|
|
536
|
-
return
|
|
536
|
+
return ce(n), o;
|
|
537
537
|
}
|
|
538
|
-
function
|
|
539
|
-
const e = W(!1), t =
|
|
540
|
-
return t &&
|
|
538
|
+
function Xt() {
|
|
539
|
+
const e = W(!1), t = Ee();
|
|
540
|
+
return t && te(() => {
|
|
541
541
|
e.value = !0;
|
|
542
542
|
}, t), e;
|
|
543
543
|
}
|
|
544
|
-
function
|
|
545
|
-
const t =
|
|
546
|
-
return
|
|
544
|
+
function Qe(e) {
|
|
545
|
+
const t = Xt();
|
|
546
|
+
return A(() => (t.value, !!e()));
|
|
547
547
|
}
|
|
548
|
-
function
|
|
549
|
-
const { window: l =
|
|
548
|
+
function Ze(e, t, n = {}) {
|
|
549
|
+
const { window: l = he, ...i } = n;
|
|
550
550
|
let u;
|
|
551
|
-
const o =
|
|
551
|
+
const o = Qe(() => l && "MutationObserver" in l), a = () => {
|
|
552
552
|
u && (u.disconnect(), u = void 0);
|
|
553
|
-
}, r =
|
|
554
|
-
const m = C(e), d =
|
|
553
|
+
}, r = A(() => {
|
|
554
|
+
const m = C(e), d = q(m).map(ee).filter(Rt);
|
|
555
555
|
return new Set(d);
|
|
556
|
-
}),
|
|
556
|
+
}), s = N(
|
|
557
557
|
() => r.value,
|
|
558
558
|
(m) => {
|
|
559
|
-
|
|
559
|
+
a(), o.value && m.size && (u = new MutationObserver(t), m.forEach((d) => u.observe(d, i)));
|
|
560
560
|
},
|
|
561
561
|
{ immediate: !0, flush: "post" }
|
|
562
562
|
), c = () => u == null ? void 0 : u.takeRecords(), v = () => {
|
|
563
|
-
|
|
563
|
+
s(), a();
|
|
564
564
|
};
|
|
565
|
-
return
|
|
565
|
+
return ce(v), {
|
|
566
566
|
isSupported: o,
|
|
567
567
|
stop: v,
|
|
568
568
|
takeRecords: c
|
|
569
569
|
};
|
|
570
570
|
}
|
|
571
|
-
function
|
|
571
|
+
function ge(e, t = {}) {
|
|
572
572
|
var n;
|
|
573
573
|
const {
|
|
574
574
|
pointerTypes: l,
|
|
575
575
|
preventDefault: i,
|
|
576
576
|
stopPropagation: u,
|
|
577
577
|
exact: o,
|
|
578
|
-
onMove:
|
|
578
|
+
onMove: a,
|
|
579
579
|
onEnd: r,
|
|
580
|
-
onStart:
|
|
580
|
+
onStart: s,
|
|
581
581
|
initialValue: c,
|
|
582
582
|
axis: v = "both",
|
|
583
|
-
draggingElement: m =
|
|
583
|
+
draggingElement: m = he,
|
|
584
584
|
containerElement: d,
|
|
585
|
-
handle:
|
|
585
|
+
handle: g = e,
|
|
586
586
|
buttons: M = [0]
|
|
587
587
|
} = t, f = P(
|
|
588
588
|
(n = C(c)) != null ? n : { x: 0, y: 0 }
|
|
589
|
-
), p = P(),
|
|
589
|
+
), p = P(), w = (b) => l ? l.includes(b.pointerType) : !0, E = (b) => {
|
|
590
590
|
C(i) && b.preventDefault(), C(u) && b.stopPropagation();
|
|
591
|
-
},
|
|
592
|
-
var
|
|
593
|
-
if (!C(M).includes(b.button) || C(t.disabled) || !
|
|
591
|
+
}, I = (b) => {
|
|
592
|
+
var T;
|
|
593
|
+
if (!C(M).includes(b.button) || C(t.disabled) || !w(b) || C(o) && b.target !== C(e))
|
|
594
594
|
return;
|
|
595
|
-
const V = C(d),
|
|
596
|
-
x: b.clientX - (V ?
|
|
597
|
-
y: b.clientY - (V ?
|
|
595
|
+
const V = C(d), j = (T = V == null ? void 0 : V.getBoundingClientRect) == null ? void 0 : T.call(V), h = C(e).getBoundingClientRect(), y = {
|
|
596
|
+
x: b.clientX - (V ? h.left - j.left + V.scrollLeft : h.left),
|
|
597
|
+
y: b.clientY - (V ? h.top - j.top + V.scrollTop : h.top)
|
|
598
598
|
};
|
|
599
|
-
(
|
|
599
|
+
(s == null ? void 0 : s(y, b)) !== !1 && (p.value = y, E(b));
|
|
600
600
|
}, k = (b) => {
|
|
601
|
-
if (C(t.disabled) || !
|
|
601
|
+
if (C(t.disabled) || !w(b) || !p.value)
|
|
602
602
|
return;
|
|
603
|
-
const
|
|
604
|
-
let { x:
|
|
605
|
-
(v === "x" || v === "both") && (
|
|
606
|
-
x:
|
|
607
|
-
y:
|
|
608
|
-
},
|
|
603
|
+
const T = C(d), V = C(e).getBoundingClientRect();
|
|
604
|
+
let { x: j, y: h } = f.value;
|
|
605
|
+
(v === "x" || v === "both") && (j = b.clientX - p.value.x, T && (j = Math.min(Math.max(0, j), T.scrollWidth - V.width))), (v === "y" || v === "both") && (h = b.clientY - p.value.y, T && (h = Math.min(Math.max(0, h), T.scrollHeight - V.height))), f.value = {
|
|
606
|
+
x: j,
|
|
607
|
+
y: h
|
|
608
|
+
}, a == null || a(f.value, b), E(b);
|
|
609
609
|
}, S = (b) => {
|
|
610
|
-
C(t.disabled) || !
|
|
610
|
+
C(t.disabled) || !w(b) || p.value && (p.value = void 0, r == null || r(f.value, b), E(b));
|
|
611
611
|
};
|
|
612
|
-
if (
|
|
612
|
+
if (pe) {
|
|
613
613
|
const b = () => {
|
|
614
|
-
var
|
|
614
|
+
var T;
|
|
615
615
|
return {
|
|
616
|
-
capture: (
|
|
616
|
+
capture: (T = t.capture) != null ? T : !0,
|
|
617
617
|
passive: !C(i)
|
|
618
618
|
};
|
|
619
619
|
};
|
|
620
|
-
|
|
620
|
+
ie(g, "pointerdown", I, b), ie(m, "pointermove", k, b), ie(m, "pointerup", S, b);
|
|
621
621
|
}
|
|
622
622
|
return {
|
|
623
|
-
...
|
|
623
|
+
...Ht(f),
|
|
624
624
|
position: f,
|
|
625
|
-
isDragging:
|
|
626
|
-
style:
|
|
625
|
+
isDragging: A(() => !!p.value),
|
|
626
|
+
style: A(
|
|
627
627
|
() => `left:${f.value.x}px;top:${f.value.y}px;`
|
|
628
628
|
)
|
|
629
629
|
};
|
|
630
630
|
}
|
|
631
|
-
function
|
|
632
|
-
const { window: l =
|
|
631
|
+
function Vt(e, t, n = {}) {
|
|
632
|
+
const { window: l = he, ...i } = n;
|
|
633
633
|
let u;
|
|
634
|
-
const o =
|
|
634
|
+
const o = Qe(() => l && "ResizeObserver" in l), a = () => {
|
|
635
635
|
u && (u.disconnect(), u = void 0);
|
|
636
|
-
}, r =
|
|
636
|
+
}, r = A(() => {
|
|
637
637
|
const v = C(e);
|
|
638
|
-
return Array.isArray(v) ? v.map((m) =>
|
|
639
|
-
}),
|
|
638
|
+
return Array.isArray(v) ? v.map((m) => ee(m)) : [ee(v)];
|
|
639
|
+
}), s = N(
|
|
640
640
|
r,
|
|
641
641
|
(v) => {
|
|
642
|
-
if (
|
|
642
|
+
if (a(), o.value && l) {
|
|
643
643
|
u = new ResizeObserver(t);
|
|
644
644
|
for (const m of v)
|
|
645
645
|
m && u.observe(m, i);
|
|
@@ -647,53 +647,53 @@ function Xt(e, t, n = {}) {
|
|
|
647
647
|
},
|
|
648
648
|
{ immediate: !0, flush: "post" }
|
|
649
649
|
), c = () => {
|
|
650
|
-
|
|
650
|
+
a(), s();
|
|
651
651
|
};
|
|
652
|
-
return
|
|
652
|
+
return ce(c), {
|
|
653
653
|
isSupported: o,
|
|
654
654
|
stop: c
|
|
655
655
|
};
|
|
656
656
|
}
|
|
657
|
-
function
|
|
657
|
+
function me(e, t = {}) {
|
|
658
658
|
const {
|
|
659
659
|
reset: n = !0,
|
|
660
660
|
windowResize: l = !0,
|
|
661
661
|
windowScroll: i = !0,
|
|
662
662
|
immediate: u = !0,
|
|
663
663
|
updateTiming: o = "sync"
|
|
664
|
-
} = t,
|
|
664
|
+
} = t, a = W(0), r = W(0), s = W(0), c = W(0), v = W(0), m = W(0), d = W(0), g = W(0);
|
|
665
665
|
function M() {
|
|
666
|
-
const p =
|
|
666
|
+
const p = ee(e);
|
|
667
667
|
if (!p) {
|
|
668
|
-
n && (
|
|
668
|
+
n && (a.value = 0, r.value = 0, s.value = 0, c.value = 0, v.value = 0, m.value = 0, d.value = 0, g.value = 0);
|
|
669
669
|
return;
|
|
670
670
|
}
|
|
671
|
-
const
|
|
672
|
-
|
|
671
|
+
const w = p.getBoundingClientRect();
|
|
672
|
+
a.value = w.height, r.value = w.bottom, s.value = w.left, c.value = w.right, v.value = w.top, m.value = w.width, d.value = w.x, g.value = w.y;
|
|
673
673
|
}
|
|
674
674
|
function f() {
|
|
675
675
|
o === "sync" ? M() : o === "next-frame" && requestAnimationFrame(() => M());
|
|
676
676
|
}
|
|
677
|
-
return
|
|
677
|
+
return Vt(e, f), N(() => ee(e), (p) => !p && f()), Ze(e, f, {
|
|
678
678
|
attributeFilter: ["style", "class"]
|
|
679
|
-
}), i &&
|
|
679
|
+
}), i && ie("scroll", f, { capture: !0, passive: !0 }), l && ie("resize", f, { passive: !0 }), Wt(() => {
|
|
680
680
|
u && f();
|
|
681
681
|
}), {
|
|
682
|
-
height:
|
|
682
|
+
height: a,
|
|
683
683
|
bottom: r,
|
|
684
|
-
left:
|
|
684
|
+
left: s,
|
|
685
685
|
right: c,
|
|
686
686
|
top: v,
|
|
687
687
|
width: m,
|
|
688
688
|
x: d,
|
|
689
|
-
y:
|
|
689
|
+
y: g,
|
|
690
690
|
update: f
|
|
691
691
|
};
|
|
692
692
|
}
|
|
693
|
-
const
|
|
693
|
+
const Nt = (e) => {
|
|
694
694
|
const t = new DOMParser().parseFromString(e, "text/html");
|
|
695
695
|
return Array.from(t.body.childNodes).some((n) => n.nodeType === 1);
|
|
696
|
-
},
|
|
696
|
+
}, Bt = (e = 8) => Array.from({ length: e }, () => Math.floor(Math.random() * 16).toString(16)).join(""), zt = ["data-colindex", "data-rowindex", "data-editable", "contenteditable", "tabindex"], Ft = ["innerHTML"], jt = { key: 2 }, Gt = /* @__PURE__ */ J({
|
|
697
697
|
__name: "ACell",
|
|
698
698
|
props: {
|
|
699
699
|
colIndex: {},
|
|
@@ -704,36 +704,36 @@ const Vt = (e) => {
|
|
|
704
704
|
pinned: { type: Boolean, default: !1 }
|
|
705
705
|
},
|
|
706
706
|
setup(e, { expose: t }) {
|
|
707
|
-
const n = B("cell"), l = e.store.getCellData(e.colIndex, e.rowIndex), i = P(""), u = P(!1), o = e.store.columns[e.colIndex],
|
|
707
|
+
const n = B("cell"), l = e.store.getCellData(e.colIndex, e.rowIndex), i = P(""), u = P(!1), o = e.store.columns[e.colIndex], a = e.store.rows[e.rowIndex], r = o.align || "center", s = o.width || "40ch", c = A(() => e.store.getCellDisplayValue(e.colIndex, e.rowIndex)), v = A(() => typeof c.value == "string" ? Nt(c.value) : !1), m = A(() => {
|
|
708
708
|
var p;
|
|
709
709
|
return {
|
|
710
710
|
textAlign: r,
|
|
711
|
-
width:
|
|
711
|
+
width: s,
|
|
712
712
|
fontWeight: u.value ? "bold" : "inherit",
|
|
713
713
|
paddingLeft: e.store.getIndent(e.colIndex, (p = e.store.display[e.rowIndex]) == null ? void 0 : p.indent)
|
|
714
714
|
};
|
|
715
|
-
}), d =
|
|
715
|
+
}), d = A(() => ({
|
|
716
716
|
"sticky-column": e.pinned,
|
|
717
717
|
"cell-modified": u.value
|
|
718
|
-
})),
|
|
719
|
-
const { left: p, bottom:
|
|
718
|
+
})), g = () => {
|
|
719
|
+
const { left: p, bottom: w, width: E, height: I } = me(n);
|
|
720
720
|
o.mask, o.modalComponent && e.store.$patch((k) => {
|
|
721
|
-
k.modal.visible = !0, k.modal.colIndex = e.colIndex, k.modal.rowIndex = e.rowIndex, k.modal.left = p, k.modal.bottom =
|
|
721
|
+
k.modal.visible = !0, k.modal.colIndex = e.colIndex, k.modal.rowIndex = e.rowIndex, k.modal.left = p, k.modal.bottom = w, k.modal.width = E, k.modal.height = I, k.modal.cell = n.value, typeof o.modalComponent == "function" ? k.modal.component = o.modalComponent({ table: k.table, row: a, column: o }) : k.modal.component = o.modalComponent, k.modal.componentProps = o.modalComponentExtraProps;
|
|
722
722
|
});
|
|
723
723
|
};
|
|
724
724
|
if (e.addNavigation) {
|
|
725
725
|
let p = {
|
|
726
|
-
...
|
|
727
|
-
"keydown.f2":
|
|
728
|
-
"keydown.alt.up":
|
|
729
|
-
"keydown.alt.down":
|
|
730
|
-
"keydown.alt.left":
|
|
731
|
-
"keydown.alt.right":
|
|
726
|
+
...Te,
|
|
727
|
+
"keydown.f2": g,
|
|
728
|
+
"keydown.alt.up": g,
|
|
729
|
+
"keydown.alt.down": g,
|
|
730
|
+
"keydown.alt.left": g,
|
|
731
|
+
"keydown.alt.right": g
|
|
732
732
|
};
|
|
733
733
|
typeof e.addNavigation == "object" && (p = {
|
|
734
734
|
...p,
|
|
735
735
|
...e.addNavigation
|
|
736
|
-
}),
|
|
736
|
+
}), Re([
|
|
737
737
|
{
|
|
738
738
|
selectors: n,
|
|
739
739
|
handlers: p
|
|
@@ -743,12 +743,12 @@ const Vt = (e) => {
|
|
|
743
743
|
const M = () => {
|
|
744
744
|
n.value && (i.value = n.value.textContent);
|
|
745
745
|
}, f = (p) => {
|
|
746
|
-
const
|
|
747
|
-
|
|
746
|
+
const w = p.target;
|
|
747
|
+
w.textContent !== i.value && (i.value = w.textContent, o.format ? (u.value = w.textContent !== e.store.getFormattedValue(e.colIndex, e.rowIndex, l), e.store.setCellText(e.colIndex, e.rowIndex, w.textContent)) : (u.value = w.textContent !== l, e.store.setCellData(e.colIndex, e.rowIndex, w.textContent)));
|
|
748
748
|
};
|
|
749
749
|
return t({
|
|
750
750
|
currentData: i
|
|
751
|
-
}), (p,
|
|
751
|
+
}), (p, w) => ($(), R("td", {
|
|
752
752
|
ref: "cell",
|
|
753
753
|
"data-colindex": p.colIndex,
|
|
754
754
|
"data-rowindex": p.rowIndex,
|
|
@@ -756,23 +756,23 @@ const Vt = (e) => {
|
|
|
756
756
|
contenteditable: x(o).edit,
|
|
757
757
|
tabindex: p.tabIndex,
|
|
758
758
|
spellcheck: !1,
|
|
759
|
-
style:
|
|
759
|
+
style: Y(m.value),
|
|
760
760
|
onFocus: M,
|
|
761
761
|
onPaste: f,
|
|
762
762
|
onInput: f,
|
|
763
|
-
onClick:
|
|
764
|
-
class:
|
|
763
|
+
onClick: g,
|
|
764
|
+
class: G(["atable-cell", d.value])
|
|
765
765
|
}, [
|
|
766
|
-
x(o).cellComponent ? ($(),
|
|
766
|
+
x(o).cellComponent ? ($(), ae(fe(x(o).cellComponent), ke({
|
|
767
767
|
key: 0,
|
|
768
768
|
value: c.value
|
|
769
769
|
}, x(o).cellComponentProps), null, 16, ["value"])) : v.value ? ($(), R("span", {
|
|
770
770
|
key: 1,
|
|
771
771
|
innerHTML: c.value
|
|
772
|
-
}, null, 8,
|
|
773
|
-
], 46,
|
|
772
|
+
}, null, 8, Ft)) : ($(), R("span", jt, Z(c.value), 1))
|
|
773
|
+
], 46, zt));
|
|
774
774
|
}
|
|
775
|
-
}),
|
|
775
|
+
}), Ut = ["tabindex"], Yt = ["tabindex"], qt = ["colspan"], Jt = /* @__PURE__ */ J({
|
|
776
776
|
__name: "AExpansionRow",
|
|
777
777
|
props: {
|
|
778
778
|
rowIndex: {},
|
|
@@ -781,22 +781,22 @@ const Vt = (e) => {
|
|
|
781
781
|
addNavigation: { type: [Boolean, Object] }
|
|
782
782
|
},
|
|
783
783
|
setup(e) {
|
|
784
|
-
const t = B("rowEl"), n =
|
|
784
|
+
const t = B("rowEl"), n = A(() => e.store.display[e.rowIndex].expanded ? "▼" : "►");
|
|
785
785
|
if (e.addNavigation) {
|
|
786
786
|
const l = {
|
|
787
787
|
"keydown.control.g": (i) => {
|
|
788
788
|
i.stopPropagation(), i.preventDefault(), e.store.toggleRowExpand(e.rowIndex);
|
|
789
789
|
}
|
|
790
790
|
};
|
|
791
|
-
typeof e.addNavigation == "object" && Object.assign(l, e.addNavigation),
|
|
791
|
+
typeof e.addNavigation == "object" && Object.assign(l, e.addNavigation), Re([
|
|
792
792
|
{
|
|
793
793
|
selectors: t,
|
|
794
794
|
handlers: l
|
|
795
795
|
}
|
|
796
796
|
]);
|
|
797
797
|
}
|
|
798
|
-
return (l, i) => ($(), R(
|
|
799
|
-
D("tr",
|
|
798
|
+
return (l, i) => ($(), R(re, null, [
|
|
799
|
+
D("tr", ke(l.$attrs, {
|
|
800
800
|
ref: "rowEl",
|
|
801
801
|
tabindex: l.tabIndex,
|
|
802
802
|
class: "expandable-row"
|
|
@@ -805,9 +805,9 @@ const Vt = (e) => {
|
|
|
805
805
|
tabIndex: -1,
|
|
806
806
|
onClick: i[0] || (i[0] = (u) => l.store.toggleRowExpand(l.rowIndex)),
|
|
807
807
|
class: "row-index"
|
|
808
|
-
},
|
|
808
|
+
}, Z(n.value), 1),
|
|
809
809
|
X(l.$slots, "row", {}, void 0, !0)
|
|
810
|
-
], 16,
|
|
810
|
+
], 16, Ut),
|
|
811
811
|
l.store.display[l.rowIndex].expanded ? ($(), R("tr", {
|
|
812
812
|
key: 0,
|
|
813
813
|
ref: "rowExpanded",
|
|
@@ -820,22 +820,22 @@ const Vt = (e) => {
|
|
|
820
820
|
class: "expanded-row-content"
|
|
821
821
|
}, [
|
|
822
822
|
X(l.$slots, "content", {}, void 0, !0)
|
|
823
|
-
], 8,
|
|
824
|
-
], 8,
|
|
823
|
+
], 8, qt)
|
|
824
|
+
], 8, Yt)) : K("", !0)
|
|
825
825
|
], 64));
|
|
826
826
|
}
|
|
827
|
-
}),
|
|
827
|
+
}), oe = (e, t) => {
|
|
828
828
|
const n = e.__vccOpts || e;
|
|
829
829
|
for (const [l, i] of t)
|
|
830
830
|
n[l] = i;
|
|
831
831
|
return n;
|
|
832
|
-
},
|
|
832
|
+
}, Qt = /* @__PURE__ */ oe(Jt, [["__scopeId", "data-v-5ad4bb41"]]), Zt = ["colspan"], Kt = {
|
|
833
833
|
ref: "container",
|
|
834
834
|
class: "gantt-handler"
|
|
835
|
-
},
|
|
835
|
+
}, _t = {
|
|
836
836
|
key: 0,
|
|
837
837
|
class: "gantt-label"
|
|
838
|
-
},
|
|
838
|
+
}, en = /* @__PURE__ */ J({
|
|
839
839
|
__name: "AGanttCell",
|
|
840
840
|
props: {
|
|
841
841
|
start: {},
|
|
@@ -846,42 +846,42 @@ const Vt = (e) => {
|
|
|
846
846
|
},
|
|
847
847
|
emits: ["update:start", "update:end", "drag"],
|
|
848
848
|
setup(e, { emit: t }) {
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
"
|
|
849
|
+
ut((E) => ({
|
|
850
|
+
"00252b09": n.value,
|
|
851
|
+
"9d36bafe": E.colspan
|
|
852
852
|
}));
|
|
853
853
|
const n = P();
|
|
854
|
-
|
|
854
|
+
te(() => {
|
|
855
855
|
!e.color || e.color == "" || e.color.length < 6 ? n.value = "#cccccc" : n.value = e.color;
|
|
856
856
|
});
|
|
857
|
-
const l = t, i = B("container"), u = B("bar"), o = B("leftHandle"),
|
|
858
|
-
const E = v.value / e.colspan * 100,
|
|
857
|
+
const l = t, i = B("container"), u = B("bar"), o = B("leftHandle"), a = B("rightHandle"), { width: r } = me(i), { left: s, right: c } = me(u), v = P(e.start || 0), m = P(e.end || e.colspan), d = P({ startX: 0, startPos: 0 }), g = A(() => e.colspan > 0 ? r.value / e.colspan : 0), M = A(() => {
|
|
858
|
+
const E = v.value / e.colspan * 100, I = m.value / e.colspan * 100;
|
|
859
859
|
return {
|
|
860
860
|
left: `${E}%`,
|
|
861
|
-
width: `${
|
|
861
|
+
width: `${I - E}%`,
|
|
862
862
|
backgroundColor: n.value
|
|
863
863
|
};
|
|
864
|
-
}), { isDragging: f } =
|
|
864
|
+
}), { isDragging: f } = ge(o, {
|
|
865
865
|
axis: "x",
|
|
866
866
|
onStart: () => {
|
|
867
867
|
u.value && (u.value.style.transition = "none"), d.value = {
|
|
868
|
-
startX:
|
|
868
|
+
startX: s.value,
|
|
869
869
|
startPos: v.value
|
|
870
870
|
};
|
|
871
871
|
},
|
|
872
872
|
onMove: ({ x: E }) => {
|
|
873
873
|
if (f.value && u.value) {
|
|
874
|
-
const k = (E - d.value.startX) /
|
|
874
|
+
const k = (E - d.value.startX) / g.value, S = Math.max(0, Math.min(m.value - 1, d.value.startPos + k));
|
|
875
875
|
u.value.style.left = `${S / e.colspan * 100}%`, u.value.style.width = `${(m.value - S) / e.colspan * 100}%`;
|
|
876
876
|
}
|
|
877
877
|
},
|
|
878
878
|
onEnd: ({ x: E }) => {
|
|
879
879
|
if (u.value) {
|
|
880
|
-
const
|
|
880
|
+
const I = E - d.value.startX, k = Math.round(I / g.value), S = Math.max(0, Math.min(m.value - 1, d.value.startPos + k));
|
|
881
881
|
v.value = S, l("update:start", S), l("drag", { type: "resize", edge: "start", value: S });
|
|
882
882
|
}
|
|
883
883
|
}
|
|
884
|
-
}), { isDragging: p } =
|
|
884
|
+
}), { isDragging: p } = ge(a, {
|
|
885
885
|
axis: "x",
|
|
886
886
|
onStart: () => {
|
|
887
887
|
u.value && (u.value.style.transition = "none"), d.value = {
|
|
@@ -891,70 +891,70 @@ const Vt = (e) => {
|
|
|
891
891
|
},
|
|
892
892
|
onMove: ({ x: E }) => {
|
|
893
893
|
if (p.value && u.value) {
|
|
894
|
-
const k = (E - d.value.startX) /
|
|
894
|
+
const k = (E - d.value.startX) / g.value, S = Math.max(v.value + 1, Math.min(e.colspan, d.value.startPos + k));
|
|
895
895
|
u.value.style.width = `${(S - v.value) / e.colspan * 100}%`;
|
|
896
896
|
}
|
|
897
897
|
},
|
|
898
898
|
onEnd: ({ x: E }) => {
|
|
899
899
|
if (u.value) {
|
|
900
|
-
const
|
|
900
|
+
const I = E - d.value.startX, k = Math.round(I / g.value), S = Math.max(v.value + 1, Math.min(e.colspan, d.value.startPos + k));
|
|
901
901
|
m.value = S, l("update:end", S), l("drag", { type: "resize", edge: "end", value: S });
|
|
902
902
|
}
|
|
903
903
|
}
|
|
904
|
-
}), { isDragging:
|
|
904
|
+
}), { isDragging: w } = ge(u, {
|
|
905
905
|
exact: !0,
|
|
906
906
|
// to avoid triggering when the left and right handles are being used
|
|
907
907
|
axis: "x",
|
|
908
908
|
onStart: () => {
|
|
909
909
|
u.value && (u.value.style.transition = "none"), d.value = {
|
|
910
|
-
startX:
|
|
910
|
+
startX: s.value,
|
|
911
911
|
startPos: v.value
|
|
912
912
|
};
|
|
913
913
|
},
|
|
914
914
|
onMove: ({ x: E }) => {
|
|
915
|
-
if (
|
|
916
|
-
const k = (E - d.value.startX) /
|
|
915
|
+
if (w.value && u.value) {
|
|
916
|
+
const k = (E - d.value.startX) / g.value, S = m.value - v.value, b = Math.max(0, Math.min(d.value.startPos + k, e.colspan - S));
|
|
917
917
|
u.value.style.left = `${b / e.colspan * 100}%`;
|
|
918
918
|
}
|
|
919
919
|
},
|
|
920
920
|
onEnd: ({ x: E }) => {
|
|
921
921
|
if (u.value) {
|
|
922
|
-
const
|
|
923
|
-
let b = d.value.startPos + k,
|
|
924
|
-
b < 0 ? (b = 0,
|
|
922
|
+
const I = E - d.value.startX, k = Math.round(I / g.value), S = m.value - v.value;
|
|
923
|
+
let b = d.value.startPos + k, T = b + S;
|
|
924
|
+
b < 0 ? (b = 0, T = S) : T > e.colspan && (T = e.colspan, b = T - S), v.value = b, m.value = T, l("update:start", b), l("update:end", T), l("drag", { type: "bar", start: b, end: T });
|
|
925
925
|
}
|
|
926
926
|
}
|
|
927
927
|
});
|
|
928
|
-
return (E,
|
|
928
|
+
return (E, I) => ($(), R("td", {
|
|
929
929
|
class: "aganttcell",
|
|
930
930
|
colspan: E.colspan
|
|
931
931
|
}, [
|
|
932
|
-
D("div",
|
|
932
|
+
D("div", Kt, [
|
|
933
933
|
D("div", {
|
|
934
934
|
ref: "bar",
|
|
935
|
-
class:
|
|
936
|
-
style:
|
|
935
|
+
class: G(["gantt-bar", { "is-dragging": x(w) || x(f) || x(p) }]),
|
|
936
|
+
style: Y(M.value)
|
|
937
937
|
}, [
|
|
938
938
|
D("div", {
|
|
939
939
|
ref: "leftHandle",
|
|
940
|
-
class:
|
|
941
|
-
},
|
|
940
|
+
class: G(["gantt-handle left-handle", { "is-dragging": x(f) }])
|
|
941
|
+
}, I[0] || (I[0] = [
|
|
942
942
|
D("div", { class: "handle-grip" }, null, -1),
|
|
943
943
|
D("div", { class: "vertical-indicator left-indicator" }, null, -1)
|
|
944
944
|
]), 2),
|
|
945
|
-
E.label ? ($(), R("label",
|
|
945
|
+
E.label ? ($(), R("label", _t, Z(E.label), 1)) : K("", !0),
|
|
946
946
|
D("div", {
|
|
947
947
|
ref: "rightHandle",
|
|
948
|
-
class:
|
|
949
|
-
},
|
|
948
|
+
class: G(["gantt-handle right-handle", { "is-dragging": x(p) }])
|
|
949
|
+
}, I[1] || (I[1] = [
|
|
950
950
|
D("div", { class: "handle-grip" }, null, -1),
|
|
951
951
|
D("div", { class: "vertical-indicator right-indicator" }, null, -1)
|
|
952
952
|
]), 2)
|
|
953
953
|
], 6)
|
|
954
954
|
], 512)
|
|
955
|
-
], 8,
|
|
955
|
+
], 8, Zt));
|
|
956
956
|
}
|
|
957
|
-
}),
|
|
957
|
+
}), tn = /* @__PURE__ */ oe(en, [["__scopeId", "data-v-630a49bb"]]), nn = ["tabindex"], on = /* @__PURE__ */ J({
|
|
958
958
|
__name: "ARow",
|
|
959
959
|
props: {
|
|
960
960
|
rowIndex: {},
|
|
@@ -963,20 +963,20 @@ const Vt = (e) => {
|
|
|
963
963
|
addNavigation: { type: [Boolean, Object], default: !1 }
|
|
964
964
|
},
|
|
965
965
|
setup(e) {
|
|
966
|
-
const t = B("rowEl"), n =
|
|
966
|
+
const t = B("rowEl"), n = A(() => e.store.isRowVisible(e.rowIndex)), l = A(() => e.store.getRowExpandSymbol(e.rowIndex));
|
|
967
967
|
if (e.addNavigation) {
|
|
968
|
-
let i =
|
|
968
|
+
let i = Te;
|
|
969
969
|
typeof e.addNavigation == "object" && (i = {
|
|
970
970
|
...i,
|
|
971
971
|
...e.addNavigation
|
|
972
|
-
}),
|
|
972
|
+
}), Re([
|
|
973
973
|
{
|
|
974
974
|
selectors: t,
|
|
975
975
|
handlers: i
|
|
976
976
|
}
|
|
977
977
|
]);
|
|
978
978
|
}
|
|
979
|
-
return (i, u) =>
|
|
979
|
+
return (i, u) => be(($(), R("tr", {
|
|
980
980
|
ref: "rowEl",
|
|
981
981
|
tabindex: i.tabIndex,
|
|
982
982
|
class: "atable-row"
|
|
@@ -985,50 +985,50 @@ const Vt = (e) => {
|
|
|
985
985
|
i.store.config.view === "list" ? ($(), R("td", {
|
|
986
986
|
key: 0,
|
|
987
987
|
tabIndex: -1,
|
|
988
|
-
class:
|
|
989
|
-
},
|
|
988
|
+
class: G(["list-index", i.store.hasPinnedColumns ? "sticky-index" : ""])
|
|
989
|
+
}, Z(i.rowIndex + 1), 3)) : i.store.config.view === "tree" ? ($(), R("td", {
|
|
990
990
|
key: 1,
|
|
991
991
|
tabIndex: -1,
|
|
992
|
-
class:
|
|
992
|
+
class: G(["tree-index", i.store.hasPinnedColumns ? "sticky-index" : ""]),
|
|
993
993
|
onClick: u[0] || (u[0] = (o) => i.store.toggleRowExpand(i.rowIndex))
|
|
994
|
-
},
|
|
995
|
-
], !0) :
|
|
994
|
+
}, Z(l.value), 3)) : K("", !0)
|
|
995
|
+
], !0) : K("", !0),
|
|
996
996
|
X(i.$slots, "default", {}, void 0, !0)
|
|
997
|
-
], 8,
|
|
998
|
-
[
|
|
997
|
+
], 8, nn)), [
|
|
998
|
+
[Ye, n.value]
|
|
999
999
|
]);
|
|
1000
1000
|
}
|
|
1001
|
-
}),
|
|
1002
|
-
function
|
|
1001
|
+
}), Ke = /* @__PURE__ */ oe(on, [["__scopeId", "data-v-4cb4f254"]]), _e = pe ? window : void 0;
|
|
1002
|
+
function se(e) {
|
|
1003
1003
|
var t;
|
|
1004
1004
|
const n = C(e);
|
|
1005
1005
|
return (t = n == null ? void 0 : n.$el) != null ? t : n;
|
|
1006
1006
|
}
|
|
1007
|
-
function
|
|
1007
|
+
function Q(...e) {
|
|
1008
1008
|
const t = [], n = () => {
|
|
1009
|
-
t.forEach((
|
|
1010
|
-
}, l = (
|
|
1011
|
-
const
|
|
1012
|
-
return
|
|
1013
|
-
}), u =
|
|
1009
|
+
t.forEach((a) => a()), t.length = 0;
|
|
1010
|
+
}, l = (a, r, s, c) => (a.addEventListener(r, s, c), () => a.removeEventListener(r, s, c)), i = A(() => {
|
|
1011
|
+
const a = q(C(e[0])).filter((r) => r != null);
|
|
1012
|
+
return a.every((r) => typeof r != "string") ? a : void 0;
|
|
1013
|
+
}), u = Je(
|
|
1014
1014
|
() => {
|
|
1015
|
-
var
|
|
1015
|
+
var a, r;
|
|
1016
1016
|
return [
|
|
1017
|
-
(r = (
|
|
1018
|
-
|
|
1019
|
-
|
|
1017
|
+
(r = (a = i.value) == null ? void 0 : a.map((s) => se(s))) != null ? r : [_e].filter((s) => s != null),
|
|
1018
|
+
q(C(i.value ? e[1] : e[0])),
|
|
1019
|
+
q(x(i.value ? e[2] : e[1])),
|
|
1020
1020
|
// @ts-expect-error - TypeScript gets the correct types, but somehow still complains
|
|
1021
1021
|
C(i.value ? e[3] : e[2])
|
|
1022
1022
|
];
|
|
1023
1023
|
},
|
|
1024
|
-
([
|
|
1025
|
-
if (n(), !(
|
|
1024
|
+
([a, r, s, c]) => {
|
|
1025
|
+
if (n(), !(a != null && a.length) || !(r != null && r.length) || !(s != null && s.length))
|
|
1026
1026
|
return;
|
|
1027
|
-
const v =
|
|
1027
|
+
const v = qe(c) ? { ...c } : c;
|
|
1028
1028
|
t.push(
|
|
1029
|
-
...
|
|
1029
|
+
...a.flatMap(
|
|
1030
1030
|
(m) => r.flatMap(
|
|
1031
|
-
(d) =>
|
|
1031
|
+
(d) => s.map((g) => l(m, d, g, v))
|
|
1032
1032
|
)
|
|
1033
1033
|
)
|
|
1034
1034
|
);
|
|
@@ -1037,25 +1037,25 @@ function J(...e) {
|
|
|
1037
1037
|
), o = () => {
|
|
1038
1038
|
u(), n();
|
|
1039
1039
|
};
|
|
1040
|
-
return
|
|
1040
|
+
return ce(n), o;
|
|
1041
1041
|
}
|
|
1042
|
-
let
|
|
1043
|
-
function
|
|
1044
|
-
const { window: l =
|
|
1042
|
+
let Be = !1;
|
|
1043
|
+
function ze(e, t, n = {}) {
|
|
1044
|
+
const { window: l = _e, ignore: i = [], capture: u = !0, detectIframe: o = !1, controls: a = !1 } = n;
|
|
1045
1045
|
if (!l)
|
|
1046
|
-
return
|
|
1047
|
-
if (
|
|
1048
|
-
|
|
1046
|
+
return a ? { stop: U, cancel: U, trigger: U } : U;
|
|
1047
|
+
if (Ce && !Be) {
|
|
1048
|
+
Be = !0;
|
|
1049
1049
|
const f = { passive: !0 };
|
|
1050
|
-
Array.from(l.document.body.children).forEach((p) =>
|
|
1050
|
+
Array.from(l.document.body.children).forEach((p) => Q(p, "click", U, f)), Q(l.document.documentElement, "click", U, f);
|
|
1051
1051
|
}
|
|
1052
1052
|
let r = !0;
|
|
1053
|
-
const
|
|
1053
|
+
const s = (f) => C(i).some((p) => {
|
|
1054
1054
|
if (typeof p == "string")
|
|
1055
|
-
return Array.from(l.document.querySelectorAll(p)).some((
|
|
1055
|
+
return Array.from(l.document.querySelectorAll(p)).some((w) => w === f.target || f.composedPath().includes(w));
|
|
1056
1056
|
{
|
|
1057
|
-
const
|
|
1058
|
-
return
|
|
1057
|
+
const w = se(p);
|
|
1058
|
+
return w && (f.target === w || f.composedPath().includes(w));
|
|
1059
1059
|
}
|
|
1060
1060
|
});
|
|
1061
1061
|
function c(f) {
|
|
@@ -1063,13 +1063,13 @@ function Be(e, t, n = {}) {
|
|
|
1063
1063
|
return p && p.$.subTree.shapeFlag === 16;
|
|
1064
1064
|
}
|
|
1065
1065
|
function v(f, p) {
|
|
1066
|
-
const
|
|
1067
|
-
return E == null || !Array.isArray(E) ? !1 : E.some((
|
|
1066
|
+
const w = C(f), E = w.$.subTree && w.$.subTree.children;
|
|
1067
|
+
return E == null || !Array.isArray(E) ? !1 : E.some((I) => I.el === p.target || p.composedPath().includes(I.el));
|
|
1068
1068
|
}
|
|
1069
1069
|
const m = (f) => {
|
|
1070
|
-
const p =
|
|
1070
|
+
const p = se(e);
|
|
1071
1071
|
if (f.target != null && !(!(p instanceof Element) && c(e) && v(e, f)) && !(!p || p === f.target || f.composedPath().includes(p))) {
|
|
1072
|
-
if ("detail" in f && f.detail === 0 && (r = !
|
|
1072
|
+
if ("detail" in f && f.detail === 0 && (r = !s(f)), !r) {
|
|
1073
1073
|
r = !0;
|
|
1074
1074
|
return;
|
|
1075
1075
|
}
|
|
@@ -1077,25 +1077,25 @@ function Be(e, t, n = {}) {
|
|
|
1077
1077
|
}
|
|
1078
1078
|
};
|
|
1079
1079
|
let d = !1;
|
|
1080
|
-
const
|
|
1081
|
-
|
|
1080
|
+
const g = [
|
|
1081
|
+
Q(l, "click", (f) => {
|
|
1082
1082
|
d || (d = !0, setTimeout(() => {
|
|
1083
1083
|
d = !1;
|
|
1084
1084
|
}, 0), m(f));
|
|
1085
1085
|
}, { passive: !0, capture: u }),
|
|
1086
|
-
|
|
1087
|
-
const p =
|
|
1088
|
-
r = !
|
|
1086
|
+
Q(l, "pointerdown", (f) => {
|
|
1087
|
+
const p = se(e);
|
|
1088
|
+
r = !s(f) && !!(p && !f.composedPath().includes(p));
|
|
1089
1089
|
}, { passive: !0 }),
|
|
1090
|
-
o &&
|
|
1090
|
+
o && Q(l, "blur", (f) => {
|
|
1091
1091
|
setTimeout(() => {
|
|
1092
1092
|
var p;
|
|
1093
|
-
const
|
|
1094
|
-
((p = l.document.activeElement) == null ? void 0 : p.tagName) === "IFRAME" && !(
|
|
1093
|
+
const w = se(e);
|
|
1094
|
+
((p = l.document.activeElement) == null ? void 0 : p.tagName) === "IFRAME" && !(w != null && w.contains(l.document.activeElement)) && t(f);
|
|
1095
1095
|
}, 0);
|
|
1096
1096
|
}, { passive: !0 })
|
|
1097
|
-
].filter(Boolean), M = () =>
|
|
1098
|
-
return
|
|
1097
|
+
].filter(Boolean), M = () => g.forEach((f) => f());
|
|
1098
|
+
return a ? {
|
|
1099
1099
|
stop: M,
|
|
1100
1100
|
cancel: () => {
|
|
1101
1101
|
r = !1;
|
|
@@ -1105,139 +1105,139 @@ function Be(e, t, n = {}) {
|
|
|
1105
1105
|
}
|
|
1106
1106
|
} : M;
|
|
1107
1107
|
}
|
|
1108
|
-
const
|
|
1108
|
+
const ln = {
|
|
1109
1109
|
mounted(e, t) {
|
|
1110
1110
|
const n = !t.modifiers.bubble;
|
|
1111
1111
|
if (typeof t.value == "function")
|
|
1112
|
-
e.__onClickOutside_stop =
|
|
1112
|
+
e.__onClickOutside_stop = ze(e, t.value, { capture: n });
|
|
1113
1113
|
else {
|
|
1114
1114
|
const [l, i] = t.value;
|
|
1115
|
-
e.__onClickOutside_stop =
|
|
1115
|
+
e.__onClickOutside_stop = ze(e, l, Object.assign({ capture: n }, i));
|
|
1116
1116
|
}
|
|
1117
1117
|
},
|
|
1118
1118
|
unmounted(e) {
|
|
1119
1119
|
e.__onClickOutside_stop();
|
|
1120
1120
|
}
|
|
1121
1121
|
};
|
|
1122
|
-
function
|
|
1122
|
+
function we(e) {
|
|
1123
1123
|
return typeof Window < "u" && e instanceof Window ? e.document.documentElement : typeof Document < "u" && e instanceof Document ? e.documentElement : e;
|
|
1124
1124
|
}
|
|
1125
|
-
function
|
|
1125
|
+
function et(e) {
|
|
1126
1126
|
const t = window.getComputedStyle(e);
|
|
1127
1127
|
if (t.overflowX === "scroll" || t.overflowY === "scroll" || t.overflowX === "auto" && e.clientWidth < e.scrollWidth || t.overflowY === "auto" && e.clientHeight < e.scrollHeight)
|
|
1128
1128
|
return !0;
|
|
1129
1129
|
{
|
|
1130
1130
|
const n = e.parentNode;
|
|
1131
|
-
return !n || n.tagName === "BODY" ? !1 :
|
|
1131
|
+
return !n || n.tagName === "BODY" ? !1 : et(n);
|
|
1132
1132
|
}
|
|
1133
1133
|
}
|
|
1134
|
-
function
|
|
1134
|
+
function an(e) {
|
|
1135
1135
|
const t = e || window.event, n = t.target;
|
|
1136
|
-
return
|
|
1136
|
+
return et(n) ? !1 : t.touches.length > 1 ? !0 : (t.preventDefault && t.preventDefault(), !1);
|
|
1137
1137
|
}
|
|
1138
|
-
const
|
|
1139
|
-
function
|
|
1138
|
+
const ye = /* @__PURE__ */ new WeakMap();
|
|
1139
|
+
function sn(e, t = !1) {
|
|
1140
1140
|
const n = P(t);
|
|
1141
1141
|
let l = null, i = "";
|
|
1142
|
-
N(
|
|
1143
|
-
const r =
|
|
1142
|
+
N(Dt(e), (a) => {
|
|
1143
|
+
const r = we(C(a));
|
|
1144
1144
|
if (r) {
|
|
1145
|
-
const
|
|
1146
|
-
if (
|
|
1145
|
+
const s = r;
|
|
1146
|
+
if (ye.get(s) || ye.set(s, s.style.overflow), s.style.overflow !== "hidden" && (i = s.style.overflow), s.style.overflow === "hidden")
|
|
1147
1147
|
return n.value = !0;
|
|
1148
1148
|
if (n.value)
|
|
1149
|
-
return
|
|
1149
|
+
return s.style.overflow = "hidden";
|
|
1150
1150
|
}
|
|
1151
1151
|
}, {
|
|
1152
1152
|
immediate: !0
|
|
1153
1153
|
});
|
|
1154
1154
|
const u = () => {
|
|
1155
|
-
const
|
|
1156
|
-
!
|
|
1157
|
-
|
|
1155
|
+
const a = we(C(e));
|
|
1156
|
+
!a || n.value || (Ce && (l = Q(
|
|
1157
|
+
a,
|
|
1158
1158
|
"touchmove",
|
|
1159
1159
|
(r) => {
|
|
1160
|
-
|
|
1160
|
+
an(r);
|
|
1161
1161
|
},
|
|
1162
1162
|
{ passive: !1 }
|
|
1163
|
-
)),
|
|
1163
|
+
)), a.style.overflow = "hidden", n.value = !0);
|
|
1164
1164
|
}, o = () => {
|
|
1165
|
-
const
|
|
1166
|
-
!
|
|
1165
|
+
const a = we(C(e));
|
|
1166
|
+
!a || !n.value || (Ce && (l == null || l()), a.style.overflow = i, ye.delete(a), n.value = !1);
|
|
1167
1167
|
};
|
|
1168
|
-
return
|
|
1168
|
+
return ce(o), A({
|
|
1169
1169
|
get() {
|
|
1170
1170
|
return n.value;
|
|
1171
1171
|
},
|
|
1172
|
-
set(
|
|
1173
|
-
|
|
1172
|
+
set(a) {
|
|
1173
|
+
a ? u() : o();
|
|
1174
1174
|
}
|
|
1175
1175
|
});
|
|
1176
1176
|
}
|
|
1177
|
-
function
|
|
1177
|
+
function rn() {
|
|
1178
1178
|
let e = !1;
|
|
1179
1179
|
const t = W(!1);
|
|
1180
1180
|
return (n, l) => {
|
|
1181
1181
|
if (t.value = l.value, e)
|
|
1182
1182
|
return;
|
|
1183
1183
|
e = !0;
|
|
1184
|
-
const i =
|
|
1184
|
+
const i = sn(n, l.value);
|
|
1185
1185
|
N(t, (u) => i.value = u);
|
|
1186
1186
|
};
|
|
1187
1187
|
}
|
|
1188
|
-
|
|
1189
|
-
const
|
|
1188
|
+
rn();
|
|
1189
|
+
const un = {
|
|
1190
1190
|
key: 0,
|
|
1191
1191
|
id: "resizable"
|
|
1192
|
-
},
|
|
1192
|
+
}, cn = {
|
|
1193
1193
|
class: "atable-header-row",
|
|
1194
1194
|
tabindex: "-1"
|
|
1195
|
-
},
|
|
1195
|
+
}, tt = /* @__PURE__ */ J({
|
|
1196
1196
|
__name: "ATableHeader",
|
|
1197
1197
|
props: {
|
|
1198
1198
|
columns: {},
|
|
1199
1199
|
store: {}
|
|
1200
1200
|
},
|
|
1201
1201
|
setup(e) {
|
|
1202
|
-
return (t, n) => t.columns.length ? ($(), R("thead",
|
|
1203
|
-
D("tr",
|
|
1202
|
+
return (t, n) => t.columns.length ? ($(), R("thead", un, [
|
|
1203
|
+
D("tr", cn, [
|
|
1204
1204
|
t.store.zeroColumn ? ($(), R("th", {
|
|
1205
1205
|
key: 0,
|
|
1206
1206
|
id: "header-index",
|
|
1207
|
-
class:
|
|
1207
|
+
class: G([[
|
|
1208
1208
|
t.store.hasPinnedColumns ? "sticky-index" : "",
|
|
1209
1209
|
t.store.config.view === "tree" ? "tree-index" : "",
|
|
1210
1210
|
t.store.config.view === "list-expansion" ? "list-expansion-index" : ""
|
|
1211
1211
|
], "list-index"])
|
|
1212
|
-
}, null, 2)) :
|
|
1213
|
-
($(!0), R(
|
|
1212
|
+
}, null, 2)) : K("", !0),
|
|
1213
|
+
($(!0), R(re, null, xe(t.columns, (l, i) => ($(), R("th", {
|
|
1214
1214
|
key: l.name,
|
|
1215
1215
|
tabindex: "-1",
|
|
1216
|
-
style:
|
|
1217
|
-
class:
|
|
1216
|
+
style: Y(t.store.getHeaderCellStyle(l)),
|
|
1217
|
+
class: G(l.pinned ? "sticky-column" : "")
|
|
1218
1218
|
}, [
|
|
1219
1219
|
X(t.$slots, "default", {}, () => [
|
|
1220
|
-
|
|
1220
|
+
ct(Z(l.label || String.fromCharCode(i + 97).toUpperCase()), 1)
|
|
1221
1221
|
])
|
|
1222
1222
|
], 6))), 128))
|
|
1223
1223
|
])
|
|
1224
|
-
])) :
|
|
1224
|
+
])) : K("", !0);
|
|
1225
1225
|
}
|
|
1226
|
-
}),
|
|
1226
|
+
}), nt = /* @__PURE__ */ J({
|
|
1227
1227
|
__name: "ATableModal",
|
|
1228
1228
|
props: {
|
|
1229
1229
|
store: {}
|
|
1230
1230
|
},
|
|
1231
1231
|
setup(e) {
|
|
1232
|
-
const t = B("amodal"), { width: n, height: l } =
|
|
1233
|
-
var v, m, d,
|
|
1232
|
+
const t = B("amodal"), { width: n, height: l } = me(t), i = A(() => {
|
|
1233
|
+
var v, m, d, g;
|
|
1234
1234
|
if (!(e.store.modal.height && e.store.modal.width && e.store.modal.left && e.store.modal.bottom)) return;
|
|
1235
|
-
const u = (v = e.store.modal.cell) == null ? void 0 : v.closest("table"), o = u.offsetHeight || 0,
|
|
1235
|
+
const u = (v = e.store.modal.cell) == null ? void 0 : v.closest("table"), o = u.offsetHeight || 0, a = u.offsetWidth || 0;
|
|
1236
1236
|
let r = ((m = e.store.modal.cell) == null ? void 0 : m.offsetTop) || 0;
|
|
1237
|
-
const
|
|
1238
|
-
r +=
|
|
1239
|
-
let c = ((
|
|
1240
|
-
return c = c + n.value <=
|
|
1237
|
+
const s = ((d = u.querySelector("thead")) == null ? void 0 : d.offsetHeight) || 0;
|
|
1238
|
+
r += s, r = r + l.value < o ? r : r - (l.value + e.store.modal.height);
|
|
1239
|
+
let c = ((g = e.store.modal.cell) == null ? void 0 : g.offsetLeft) || 0;
|
|
1240
|
+
return c = c + n.value <= a ? c : c - (n.value - e.store.modal.width), {
|
|
1241
1241
|
left: `${c}px`,
|
|
1242
1242
|
top: `${r}px`
|
|
1243
1243
|
};
|
|
@@ -1246,73 +1246,76 @@ const rn = {
|
|
|
1246
1246
|
class: "amodal",
|
|
1247
1247
|
ref: "amodal",
|
|
1248
1248
|
tabindex: "-1",
|
|
1249
|
-
onClick: o[0] || (o[0] =
|
|
1249
|
+
onClick: o[0] || (o[0] = Pe(() => {
|
|
1250
1250
|
}, ["stop"])),
|
|
1251
|
-
onInput: o[1] || (o[1] =
|
|
1251
|
+
onInput: o[1] || (o[1] = Pe(() => {
|
|
1252
1252
|
}, ["stop"])),
|
|
1253
|
-
style:
|
|
1253
|
+
style: Y(i.value)
|
|
1254
1254
|
}, [
|
|
1255
1255
|
X(u.$slots, "default")
|
|
1256
1256
|
], 36));
|
|
1257
1257
|
}
|
|
1258
|
-
}),
|
|
1259
|
-
const t = e.id ||
|
|
1260
|
-
return
|
|
1258
|
+
}), dn = (e) => {
|
|
1259
|
+
const t = e.id || Bt();
|
|
1260
|
+
return dt(`table-${t}`, () => {
|
|
1261
1261
|
const l = () => {
|
|
1262
|
-
const
|
|
1263
|
-
for (const [
|
|
1262
|
+
const h = {};
|
|
1263
|
+
for (const [y, O] of u.value.entries())
|
|
1264
1264
|
for (const [L, H] of o.value.entries())
|
|
1265
|
-
|
|
1266
|
-
return
|
|
1267
|
-
}, i = (
|
|
1268
|
-
const
|
|
1269
|
-
if (
|
|
1270
|
-
return
|
|
1271
|
-
const
|
|
1265
|
+
h[`${y}:${L}`] = H[O.name];
|
|
1266
|
+
return h;
|
|
1267
|
+
}, i = (h) => {
|
|
1268
|
+
const y = [Object.assign({}, { rowModified: !1 })];
|
|
1269
|
+
if (h && "0:0" in h)
|
|
1270
|
+
return h;
|
|
1271
|
+
const O = /* @__PURE__ */ new Set();
|
|
1272
1272
|
for (let L = o.value.length - 1; L >= 0; L--) {
|
|
1273
1273
|
const H = o.value[L];
|
|
1274
|
-
H.parent &&
|
|
1274
|
+
H.parent && O.add(H.parent), y[L] = {
|
|
1275
1275
|
childrenOpen: !1,
|
|
1276
1276
|
expanded: !1,
|
|
1277
1277
|
indent: H.indent || 0,
|
|
1278
|
-
isParent:
|
|
1278
|
+
isParent: O.has(L),
|
|
1279
1279
|
isRoot: H.parent === null || H.parent === void 0,
|
|
1280
1280
|
rowModified: !1,
|
|
1281
1281
|
open: H.parent === null || H.parent === void 0,
|
|
1282
1282
|
parent: H.parent
|
|
1283
1283
|
};
|
|
1284
1284
|
}
|
|
1285
|
-
return
|
|
1286
|
-
}, u = P(e.columns), o = P(e.rows),
|
|
1287
|
-
() =>
|
|
1288
|
-
), M = (
|
|
1289
|
-
const L = `${
|
|
1290
|
-
r.value[L] !==
|
|
1291
|
-
}, p = (
|
|
1292
|
-
const L = `${
|
|
1293
|
-
r.value[L] !==
|
|
1294
|
-
},
|
|
1295
|
-
minWidth:
|
|
1296
|
-
textAlign:
|
|
1297
|
-
width:
|
|
1298
|
-
}), E = (
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
}, b = (
|
|
1308
|
-
const
|
|
1309
|
-
return
|
|
1285
|
+
return y;
|
|
1286
|
+
}, u = P(e.columns), o = P(e.rows), a = P(e.config || {}), r = P(e.table || l()), s = P(i(e.display)), c = P(e.modal || { visible: !1 }), v = P({}), m = A(() => u.value.some((h) => h.pinned)), d = A(() => `${Math.ceil(o.value.length / 100 + 1)}ch`), g = A(
|
|
1287
|
+
() => a.value.view ? ["list", "tree", "list-expansion"].includes(a.value.view) : !1
|
|
1288
|
+
), M = (h, y) => r.value[`${h}:${y}`], f = (h, y, O) => {
|
|
1289
|
+
const L = `${h}:${y}`, H = u.value[h];
|
|
1290
|
+
r.value[L] !== O && (s.value[y].rowModified = !0), r.value[L] = O, o.value[y][H.name] = O;
|
|
1291
|
+
}, p = (h, y, O) => {
|
|
1292
|
+
const L = `${h}:${y}`;
|
|
1293
|
+
r.value[L] !== O && (s.value[y].rowModified = !0, v.value[L] = O);
|
|
1294
|
+
}, w = (h) => ({
|
|
1295
|
+
minWidth: h.width || "40ch",
|
|
1296
|
+
textAlign: h.align || "center",
|
|
1297
|
+
width: a.value.fullWidth ? "auto" : void 0
|
|
1298
|
+
}), E = (h) => {
|
|
1299
|
+
const y = o.value[h];
|
|
1300
|
+
return console.log(a.value.view, y.indent), a.value.view === "gantt" && y.indent === 0;
|
|
1301
|
+
}, I = (h) => a.value.view !== "tree" || s.value[h].isRoot || s.value[h].open, k = (h) => a.value.view !== "tree" ? "" : s.value[h].isRoot || s.value[h].isParent ? s.value[h].childrenOpen ? "-" : "+" : "", S = (h) => {
|
|
1302
|
+
if (a.value.view === "tree") {
|
|
1303
|
+
s.value[h].childrenOpen = !s.value[h].childrenOpen;
|
|
1304
|
+
for (let y = o.value.length - 1; y >= 0; y--)
|
|
1305
|
+
s.value[y].parent === h && (s.value[y].open = !s.value[y].open, s.value[y].childrenOpen && S(y));
|
|
1306
|
+
} else a.value.view === "list-expansion" && (s.value[h].expanded = !s.value[h].expanded);
|
|
1307
|
+
}, b = (h, y) => {
|
|
1308
|
+
const O = M(h, y);
|
|
1309
|
+
return T(h, y, O);
|
|
1310
|
+
}, T = (h, y, O) => {
|
|
1311
|
+
const L = u.value[h], H = o.value[y], le = L.format;
|
|
1312
|
+
return le ? typeof le == "function" ? le(O, { table: r.value, row: H, column: L }) : typeof le == "string" ? Function(`"use strict";return (${le})`)()(O, { table: r.value, row: H, column: L }) : O : O;
|
|
1310
1313
|
};
|
|
1311
1314
|
return {
|
|
1312
1315
|
// state
|
|
1313
1316
|
columns: u,
|
|
1314
|
-
config:
|
|
1315
|
-
display:
|
|
1317
|
+
config: a,
|
|
1318
|
+
display: s,
|
|
1316
1319
|
modal: c,
|
|
1317
1320
|
rows: o,
|
|
1318
1321
|
table: r,
|
|
@@ -1320,25 +1323,26 @@ const rn = {
|
|
|
1320
1323
|
// getters
|
|
1321
1324
|
hasPinnedColumns: m,
|
|
1322
1325
|
numberedRowWidth: d,
|
|
1323
|
-
zeroColumn:
|
|
1326
|
+
zeroColumn: g,
|
|
1324
1327
|
// actions
|
|
1325
|
-
closeModal: (
|
|
1326
|
-
var
|
|
1327
|
-
|
|
1328
|
+
closeModal: (h) => {
|
|
1329
|
+
var y;
|
|
1330
|
+
h.target instanceof Node && (y = c.value.parent) != null && y.contains(h.target) || c.value.visible && (c.value.visible = !1);
|
|
1328
1331
|
},
|
|
1329
1332
|
getCellData: M,
|
|
1330
|
-
getCellDisplayValue:
|
|
1331
|
-
getFormattedValue:
|
|
1332
|
-
getHeaderCellStyle:
|
|
1333
|
-
getIndent: (
|
|
1334
|
-
getRowExpandSymbol:
|
|
1335
|
-
|
|
1333
|
+
getCellDisplayValue: b,
|
|
1334
|
+
getFormattedValue: T,
|
|
1335
|
+
getHeaderCellStyle: w,
|
|
1336
|
+
getIndent: (h, y) => y && h === 0 && y > 0 ? `${y}ch` : "inherit",
|
|
1337
|
+
getRowExpandSymbol: k,
|
|
1338
|
+
isRowGantt: E,
|
|
1339
|
+
isRowVisible: I,
|
|
1336
1340
|
setCellData: f,
|
|
1337
1341
|
setCellText: p,
|
|
1338
|
-
toggleRowExpand:
|
|
1342
|
+
toggleRowExpand: S
|
|
1339
1343
|
};
|
|
1340
1344
|
})();
|
|
1341
|
-
},
|
|
1345
|
+
}, fn = /* @__PURE__ */ J({
|
|
1342
1346
|
__name: "ATable",
|
|
1343
1347
|
props: {
|
|
1344
1348
|
id: {},
|
|
@@ -1349,112 +1353,109 @@ const rn = {
|
|
|
1349
1353
|
},
|
|
1350
1354
|
emits: ["update:modelValue", "cellUpdate"],
|
|
1351
1355
|
setup(e, { expose: t, emit: n }) {
|
|
1352
|
-
const l = n, i = B("table"), u = e.modelValue ? e.modelValue : e.rows, o =
|
|
1353
|
-
o.$onAction(({ name:
|
|
1354
|
-
if (
|
|
1355
|
-
const [d,
|
|
1356
|
+
const l = n, i = B("table"), u = e.modelValue ? e.modelValue : e.rows, o = dn({ columns: e.columns, rows: u, id: e.id, config: e.config });
|
|
1357
|
+
o.$onAction(({ name: s, store: c, args: v, after: m }) => {
|
|
1358
|
+
if (s === "setCellData" || s === "setCellText") {
|
|
1359
|
+
const [d, g, M] = v, f = c.getCellData(d, g);
|
|
1356
1360
|
m(() => {
|
|
1357
|
-
l("cellUpdate", { colIndex: d, rowIndex:
|
|
1361
|
+
l("cellUpdate", { colIndex: d, rowIndex: g, newValue: M, oldValue: f });
|
|
1358
1362
|
});
|
|
1359
1363
|
}
|
|
1360
1364
|
}), N(
|
|
1361
1365
|
() => o.rows,
|
|
1362
|
-
(
|
|
1363
|
-
l("update:modelValue",
|
|
1366
|
+
(s) => {
|
|
1367
|
+
l("update:modelValue", s);
|
|
1364
1368
|
},
|
|
1365
1369
|
{ deep: !0 }
|
|
1366
|
-
),
|
|
1367
|
-
e.columns.some((
|
|
1370
|
+
), te(() => {
|
|
1371
|
+
e.columns.some((s) => s.pinned) && (a(), o.config.view === "tree" && Ze(i, a, { childList: !0, subtree: !0 }));
|
|
1368
1372
|
});
|
|
1369
|
-
const
|
|
1370
|
-
const
|
|
1371
|
-
for (const [d,
|
|
1373
|
+
const a = () => {
|
|
1374
|
+
const s = i.value, c = s == null ? void 0 : s.rows[0], v = s == null ? void 0 : s.rows[1], m = c ? Array.from(c.cells) : [];
|
|
1375
|
+
for (const [d, g] of m.entries()) {
|
|
1372
1376
|
const M = v == null ? void 0 : v.cells[d];
|
|
1373
|
-
M && (
|
|
1377
|
+
M && (g.style.width = `${M.offsetWidth}px`);
|
|
1374
1378
|
}
|
|
1375
|
-
for (const d of (
|
|
1376
|
-
let
|
|
1379
|
+
for (const d of (s == null ? void 0 : s.rows) || []) {
|
|
1380
|
+
let g = 0;
|
|
1377
1381
|
const M = [];
|
|
1378
1382
|
for (const f of d.cells)
|
|
1379
|
-
(f.classList.contains("sticky-column") || f.classList.contains("sticky-index")) && (f.style.left = `${
|
|
1383
|
+
(f.classList.contains("sticky-column") || f.classList.contains("sticky-index")) && (f.style.left = `${g}px`, g += f.offsetWidth, M.push(f));
|
|
1380
1384
|
M.length > 0 && M[M.length - 1].classList.add("sticky-column-edge");
|
|
1381
1385
|
}
|
|
1382
1386
|
};
|
|
1383
|
-
window.addEventListener("keydown", (
|
|
1384
|
-
if (
|
|
1387
|
+
window.addEventListener("keydown", (s) => {
|
|
1388
|
+
if (s.key === "Escape" && o.modal.visible) {
|
|
1385
1389
|
o.modal.visible = !1;
|
|
1386
1390
|
const c = o.modal.parent;
|
|
1387
|
-
c &&
|
|
1391
|
+
c && Ge().then(() => {
|
|
1388
1392
|
c.focus();
|
|
1389
1393
|
});
|
|
1390
1394
|
}
|
|
1391
1395
|
});
|
|
1392
|
-
const r = (
|
|
1393
|
-
const c =
|
|
1396
|
+
const r = (s) => {
|
|
1397
|
+
const c = s.indent === 0, v = o.columns.filter((d) => d.pinned).length;
|
|
1394
1398
|
if (!c || v === 0)
|
|
1395
1399
|
return o.columns;
|
|
1396
1400
|
const m = [];
|
|
1397
1401
|
for (let d = 0; d < v; d++) {
|
|
1398
|
-
const
|
|
1399
|
-
|
|
1402
|
+
const g = { ...o.columns[d] };
|
|
1403
|
+
g.originalIndex = d, m.push(g);
|
|
1400
1404
|
}
|
|
1401
1405
|
return m.push({
|
|
1402
1406
|
...o.columns[v],
|
|
1403
|
-
colspan: o.columns.length - v,
|
|
1404
1407
|
isGantt: !0,
|
|
1408
|
+
colspan: o.columns.length - v,
|
|
1405
1409
|
originalIndex: v,
|
|
1406
|
-
color: c ? a.resource_name.color : "",
|
|
1407
1410
|
width: "auto"
|
|
1408
1411
|
// TODO: refactor to API that can detect when data exists in a cell. Might have be custom and not generalizable
|
|
1409
1412
|
}), m;
|
|
1410
1413
|
};
|
|
1411
|
-
return t({ store: o }), (
|
|
1414
|
+
return t({ store: o }), (s, c) => be(($(), R("table", {
|
|
1412
1415
|
ref: "table",
|
|
1413
1416
|
class: "atable",
|
|
1414
|
-
style:
|
|
1417
|
+
style: Y({
|
|
1415
1418
|
width: x(o).config.fullWidth ? "100%" : "auto"
|
|
1416
1419
|
})
|
|
1417
1420
|
}, [
|
|
1418
|
-
X(
|
|
1419
|
-
|
|
1421
|
+
X(s.$slots, "header", { data: x(o) }, () => [
|
|
1422
|
+
Oe(tt, {
|
|
1420
1423
|
columns: x(o).columns,
|
|
1421
1424
|
store: x(o)
|
|
1422
1425
|
}, null, 8, ["columns", "store"])
|
|
1423
1426
|
], !0),
|
|
1424
1427
|
D("tbody", null, [
|
|
1425
|
-
X(
|
|
1426
|
-
($(!0), R(
|
|
1428
|
+
X(s.$slots, "body", { data: x(o) }, () => [
|
|
1429
|
+
($(!0), R(re, null, xe(x(o).rows, (v, m) => ($(), ae(Ke, {
|
|
1427
1430
|
key: v.id,
|
|
1428
1431
|
row: v,
|
|
1429
1432
|
rowIndex: m,
|
|
1430
1433
|
store: x(o)
|
|
1431
1434
|
}, {
|
|
1432
|
-
default:
|
|
1433
|
-
($(!0), R(
|
|
1435
|
+
default: Le(() => [
|
|
1436
|
+
($(!0), R(re, null, xe(r(v), (d, g) => ($(), R(re, {
|
|
1434
1437
|
key: d.name
|
|
1435
1438
|
}, [
|
|
1436
|
-
d.isGantt ? ($(),
|
|
1439
|
+
d.isGantt ? ($(), ae(fe(d.ganttComponent || "AGanttCell"), {
|
|
1437
1440
|
key: 0,
|
|
1438
1441
|
store: x(o),
|
|
1439
|
-
color:
|
|
1442
|
+
color: v.gantt_color,
|
|
1440
1443
|
colspan: d.colspan,
|
|
1441
1444
|
pinned: d.pinned,
|
|
1442
1445
|
rowIndex: m,
|
|
1443
|
-
colIndex: d.originalIndex
|
|
1444
|
-
style:
|
|
1446
|
+
colIndex: d.originalIndex ?? g,
|
|
1447
|
+
style: Y({
|
|
1445
1448
|
textAlign: (d == null ? void 0 : d.align) || "center",
|
|
1446
1449
|
minWidth: (d == null ? void 0 : d.width) || "40ch",
|
|
1447
1450
|
width: x(o).config.fullWidth ? "auto" : null
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
spellcheck: "false"
|
|
1451
|
-
}, null, 8, ["store", "color", "colspan", "pinned", "rowIndex", "colIndex", "style"])) : ($(), le(de(d.cellComponent || "ACell"), {
|
|
1451
|
+
})
|
|
1452
|
+
}, null, 8, ["store", "color", "colspan", "pinned", "rowIndex", "colIndex", "style"])) : ($(), ae(fe(d.cellComponent || "ACell"), {
|
|
1452
1453
|
key: 1,
|
|
1453
1454
|
store: x(o),
|
|
1454
1455
|
pinned: d.pinned,
|
|
1455
1456
|
rowIndex: m,
|
|
1456
|
-
colIndex:
|
|
1457
|
-
style:
|
|
1457
|
+
colIndex: g,
|
|
1458
|
+
style: Y({
|
|
1458
1459
|
textAlign: (d == null ? void 0 : d.align) || "center",
|
|
1459
1460
|
minWidth: (d == null ? void 0 : d.width) || "40ch",
|
|
1460
1461
|
width: x(o).config.fullWidth ? "auto" : null
|
|
@@ -1467,11 +1468,11 @@ const rn = {
|
|
|
1467
1468
|
}, 1032, ["row", "rowIndex", "store"]))), 128))
|
|
1468
1469
|
], !0)
|
|
1469
1470
|
]),
|
|
1470
|
-
X(
|
|
1471
|
-
X(
|
|
1472
|
-
|
|
1473
|
-
default:
|
|
1474
|
-
($(),
|
|
1471
|
+
X(s.$slots, "footer", { data: x(o) }, void 0, !0),
|
|
1472
|
+
X(s.$slots, "modal", { data: x(o) }, () => [
|
|
1473
|
+
be(Oe(nt, { store: x(o) }, {
|
|
1474
|
+
default: Le(() => [
|
|
1475
|
+
($(), ae(fe(x(o).modal.component), ke({
|
|
1475
1476
|
key: `${x(o).modal.rowIndex}:${x(o).modal.colIndex}`,
|
|
1476
1477
|
colIndex: x(o).modal.colIndex,
|
|
1477
1478
|
rowIndex: x(o).modal.rowIndex,
|
|
@@ -1480,46 +1481,46 @@ const rn = {
|
|
|
1480
1481
|
]),
|
|
1481
1482
|
_: 1
|
|
1482
1483
|
}, 8, ["store"]), [
|
|
1483
|
-
[
|
|
1484
|
+
[Ye, x(o).modal.visible]
|
|
1484
1485
|
])
|
|
1485
1486
|
], !0)
|
|
1486
1487
|
], 4)), [
|
|
1487
|
-
[x(
|
|
1488
|
+
[x(ln), x(o).closeModal]
|
|
1488
1489
|
]);
|
|
1489
1490
|
}
|
|
1490
|
-
}),
|
|
1491
|
-
function
|
|
1492
|
-
return $(), R("div",
|
|
1493
|
-
D("h2",
|
|
1491
|
+
}), vn = /* @__PURE__ */ oe(fn, [["__scopeId", "data-v-8ce56718"]]), mn = {}, pn = { class: "aloading" }, hn = { class: "aloading-header" };
|
|
1492
|
+
function gn(e, t) {
|
|
1493
|
+
return $(), R("div", pn, [
|
|
1494
|
+
D("h2", hn, [
|
|
1494
1495
|
X(e.$slots, "default", {}, void 0, !0)
|
|
1495
1496
|
]),
|
|
1496
1497
|
t[0] || (t[0] = D("div", { class: "aloading-bar" }, null, -1))
|
|
1497
1498
|
]);
|
|
1498
1499
|
}
|
|
1499
|
-
const
|
|
1500
|
-
function
|
|
1501
|
-
return $(), R("div",
|
|
1502
|
-
D("h2",
|
|
1500
|
+
const wn = /* @__PURE__ */ oe(mn, [["render", gn], ["__scopeId", "data-v-a930a25b"]]), yn = {}, bn = { class: "aloading" }, xn = { class: "aloading-header" };
|
|
1501
|
+
function Cn(e, t) {
|
|
1502
|
+
return $(), R("div", bn, [
|
|
1503
|
+
D("h2", xn, [
|
|
1503
1504
|
X(e.$slots, "default", {}, void 0, !0)
|
|
1504
1505
|
]),
|
|
1505
1506
|
t[0] || (t[0] = D("div", { class: "aloading-bar" }, null, -1))
|
|
1506
1507
|
]);
|
|
1507
1508
|
}
|
|
1508
|
-
const
|
|
1509
|
-
function
|
|
1510
|
-
e.component("ACell",
|
|
1509
|
+
const En = /* @__PURE__ */ oe(yn, [["render", Cn], ["__scopeId", "data-v-e1165876"]]);
|
|
1510
|
+
function An(e) {
|
|
1511
|
+
e.component("ACell", Gt), e.component("AExpansionRow", Qt), e.component("AGanttCell", tn), e.component("ARow", Ke), e.component("ATable", vn), e.component("ATableHeader", tt), e.component("ATableLoading", wn), e.component("ATableLoadingBar", En), e.component("ATableModal", nt);
|
|
1511
1512
|
}
|
|
1512
1513
|
export {
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1514
|
+
Gt as ACell,
|
|
1515
|
+
Qt as AExpansionRow,
|
|
1516
|
+
tn as AGanttCell,
|
|
1517
|
+
Ke as ARow,
|
|
1518
|
+
vn as ATable,
|
|
1519
|
+
tt as ATableHeader,
|
|
1520
|
+
wn as ATableLoading,
|
|
1521
|
+
En as ATableLoadingBar,
|
|
1522
|
+
nt as ATableModal,
|
|
1523
|
+
dn as createTableStore,
|
|
1524
|
+
An as install
|
|
1524
1525
|
};
|
|
1525
1526
|
//# sourceMappingURL=atable.js.map
|