@stonecrop/atable 0.4.16 → 0.4.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/atable.d.ts +18 -18
- package/dist/atable.js +341 -338
- package/dist/atable.js.map +1 -1
- package/dist/atable.tsbuildinfo +1 -1
- package/dist/atable.umd.cjs +2 -2
- package/dist/atable.umd.cjs.map +1 -1
- package/dist/src/stores/table.d.ts +18 -18
- package/dist/src/stores/table.d.ts.map +1 -1
- package/dist/src/tsdoc-metadata.json +1 -1
- package/dist/src/utils.d.ts.map +1 -1
- package/package.json +24 -24
package/dist/atable.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { onMounted as Q, ref as
|
|
2
|
-
import { defineStore as
|
|
3
|
-
import './assets/index.css';function
|
|
4
|
-
return
|
|
1
|
+
import { onMounted as Q, ref as P, watch as B, onBeforeUnmount as rt, computed as I, shallowRef as W, toValue as E, watchEffect as it, getCurrentScope as qe, onScopeDispose as Je, unref as b, getCurrentInstance as pe, nextTick as Qe, isRef as ut, toRefs as ct, customRef as Ze, toRef as dt, readonly as ft, defineComponent as Z, useTemplateRef as N, createElementBlock as R, openBlock as S, normalizeClass as j, normalizeStyle as q, createBlock as re, resolveDynamicComponent as fe, mergeProps as Se, toDisplayString as K, Fragment as ie, createElementVNode as L, createCommentVNode as _, renderSlot as z, useCssVars as vt, withDirectives as he, vShow as Ke, renderList as ke, createTextVNode as mt, withModifiers as We, createVNode as He, withCtx as ze } from "vue";
|
|
2
|
+
import { defineStore as ht } from "pinia";
|
|
3
|
+
import './assets/index.css';function $e(e) {
|
|
4
|
+
return qe() ? (Je(e), !0) : !1;
|
|
5
5
|
}
|
|
6
|
-
const
|
|
6
|
+
const gt = typeof window < "u" && typeof document < "u";
|
|
7
7
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
8
|
-
const
|
|
8
|
+
const pt = (e) => e != null, wt = Object.prototype.toString, yt = (e) => wt.call(e) === "[object Object]", bt = () => {
|
|
9
9
|
};
|
|
10
|
-
function
|
|
10
|
+
function ve(e) {
|
|
11
11
|
return Array.isArray(e) ? e : [e];
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function xt(e, t, n) {
|
|
14
14
|
return B(
|
|
15
15
|
e,
|
|
16
16
|
t,
|
|
@@ -20,25 +20,25 @@ function bt(e, t, n) {
|
|
|
20
20
|
}
|
|
21
21
|
);
|
|
22
22
|
}
|
|
23
|
-
const
|
|
24
|
-
function
|
|
23
|
+
const ne = gt ? window : void 0;
|
|
24
|
+
function ee(e) {
|
|
25
25
|
var t;
|
|
26
26
|
const n = E(e);
|
|
27
27
|
return (t = n == null ? void 0 : n.$el) != null ? t : n;
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function ce(...e) {
|
|
30
30
|
const t = [], n = () => {
|
|
31
31
|
t.forEach((a) => a()), t.length = 0;
|
|
32
32
|
}, o = (a, u, r, s) => (a.addEventListener(u, r, s), () => a.removeEventListener(u, r, s)), i = I(() => {
|
|
33
|
-
const a =
|
|
33
|
+
const a = ve(E(e[0])).filter((u) => u != null);
|
|
34
34
|
return a.every((u) => typeof u != "string") ? a : void 0;
|
|
35
|
-
}), c =
|
|
35
|
+
}), c = xt(
|
|
36
36
|
() => {
|
|
37
37
|
var a, u;
|
|
38
38
|
return [
|
|
39
|
-
(u = (a = i.value) == null ? void 0 : a.map((r) =>
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
(u = (a = i.value) == null ? void 0 : a.map((r) => ee(r))) != null ? u : [ne].filter((r) => r != null),
|
|
40
|
+
ve(E(i.value ? e[1] : e[0])),
|
|
41
|
+
ve(b(i.value ? e[2] : e[1])),
|
|
42
42
|
// @ts-expect-error - TypeScript gets the correct types, but somehow still complains
|
|
43
43
|
E(i.value ? e[3] : e[2])
|
|
44
44
|
];
|
|
@@ -46,7 +46,7 @@ function de(...e) {
|
|
|
46
46
|
([a, u, r, s]) => {
|
|
47
47
|
if (n(), !(a != null && a.length) || !(u != null && u.length) || !(r != null && r.length))
|
|
48
48
|
return;
|
|
49
|
-
const v =
|
|
49
|
+
const v = yt(s) ? { ...s } : s;
|
|
50
50
|
t.push(
|
|
51
51
|
...a.flatMap(
|
|
52
52
|
(m) => u.flatMap(
|
|
@@ -59,25 +59,25 @@ function de(...e) {
|
|
|
59
59
|
), l = () => {
|
|
60
60
|
c(), n();
|
|
61
61
|
};
|
|
62
|
-
return
|
|
62
|
+
return $e(n), l;
|
|
63
63
|
}
|
|
64
|
-
function
|
|
65
|
-
const e =
|
|
64
|
+
function Ct() {
|
|
65
|
+
const e = W(!1), t = pe();
|
|
66
66
|
return t && Q(() => {
|
|
67
67
|
e.value = !0;
|
|
68
68
|
}, t), e;
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
const t =
|
|
70
|
+
function Et(e) {
|
|
71
|
+
const t = Ct();
|
|
72
72
|
return I(() => (t.value, !!e()));
|
|
73
73
|
}
|
|
74
|
-
function
|
|
75
|
-
const { window: o =
|
|
74
|
+
function It(e, t, n = {}) {
|
|
75
|
+
const { window: o = ne, ...i } = n;
|
|
76
76
|
let c;
|
|
77
|
-
const l =
|
|
77
|
+
const l = Et(() => o && "MutationObserver" in o), a = () => {
|
|
78
78
|
c && (c.disconnect(), c = void 0);
|
|
79
79
|
}, u = I(() => {
|
|
80
|
-
const m = E(e), y =
|
|
80
|
+
const m = E(e), y = ve(m).map(ee).filter(pt);
|
|
81
81
|
return new Set(y);
|
|
82
82
|
}), r = B(
|
|
83
83
|
() => u.value,
|
|
@@ -88,27 +88,27 @@ function Et(e, t, n = {}) {
|
|
|
88
88
|
), s = () => c == null ? void 0 : c.takeRecords(), v = () => {
|
|
89
89
|
r(), a();
|
|
90
90
|
};
|
|
91
|
-
return
|
|
91
|
+
return $e(v), {
|
|
92
92
|
isSupported: l,
|
|
93
93
|
stop: v,
|
|
94
94
|
takeRecords: s
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function kt(e, t, n = {}) {
|
|
98
98
|
const {
|
|
99
|
-
window: o =
|
|
99
|
+
window: o = ne,
|
|
100
100
|
document: i = o == null ? void 0 : o.document,
|
|
101
101
|
flush: c = "sync"
|
|
102
102
|
} = n;
|
|
103
103
|
if (!o || !i)
|
|
104
|
-
return
|
|
104
|
+
return bt;
|
|
105
105
|
let l;
|
|
106
106
|
const a = (s) => {
|
|
107
107
|
l == null || l(), l = s;
|
|
108
|
-
}, u =
|
|
109
|
-
const s =
|
|
108
|
+
}, u = it(() => {
|
|
109
|
+
const s = ee(e);
|
|
110
110
|
if (s) {
|
|
111
|
-
const { stop: v } =
|
|
111
|
+
const { stop: v } = It(
|
|
112
112
|
i,
|
|
113
113
|
(m) => {
|
|
114
114
|
m.map((y) => [...y.removedNodes]).flat().some((y) => y === s || y.contains(s)) && t(m);
|
|
@@ -124,12 +124,12 @@ function It(e, t, n = {}) {
|
|
|
124
124
|
}, { flush: c }), r = () => {
|
|
125
125
|
u(), a();
|
|
126
126
|
};
|
|
127
|
-
return
|
|
127
|
+
return $e(r), r;
|
|
128
128
|
}
|
|
129
|
-
function
|
|
129
|
+
function Mt(e = {}) {
|
|
130
130
|
var t;
|
|
131
131
|
const {
|
|
132
|
-
window: n =
|
|
132
|
+
window: n = ne,
|
|
133
133
|
deep: o = !0,
|
|
134
134
|
triggerOnRemoval: i = !1
|
|
135
135
|
} = e, c = (t = e.document) != null ? t : n == null ? void 0 : n.document, l = () => {
|
|
@@ -139,7 +139,7 @@ function kt(e = {}) {
|
|
|
139
139
|
for (; s != null && s.shadowRoot; )
|
|
140
140
|
s = (r = s == null ? void 0 : s.shadowRoot) == null ? void 0 : r.activeElement;
|
|
141
141
|
return s;
|
|
142
|
-
}, a =
|
|
142
|
+
}, a = W(), u = () => {
|
|
143
143
|
a.value = l();
|
|
144
144
|
};
|
|
145
145
|
if (n) {
|
|
@@ -147,37 +147,37 @@ function kt(e = {}) {
|
|
|
147
147
|
capture: !0,
|
|
148
148
|
passive: !0
|
|
149
149
|
};
|
|
150
|
-
|
|
150
|
+
ce(
|
|
151
151
|
n,
|
|
152
152
|
"blur",
|
|
153
153
|
(s) => {
|
|
154
154
|
s.relatedTarget === null && u();
|
|
155
155
|
},
|
|
156
156
|
r
|
|
157
|
-
),
|
|
157
|
+
), ce(
|
|
158
158
|
n,
|
|
159
159
|
"focus",
|
|
160
160
|
u,
|
|
161
161
|
r
|
|
162
162
|
);
|
|
163
163
|
}
|
|
164
|
-
return i &&
|
|
164
|
+
return i && kt(a, u, { document: c }), u(), a;
|
|
165
165
|
}
|
|
166
|
-
const St = "focusin",
|
|
167
|
-
function
|
|
168
|
-
const { window: n =
|
|
166
|
+
const St = "focusin", $t = "focusout", At = ":focus-within";
|
|
167
|
+
function Rt(e, t = {}) {
|
|
168
|
+
const { window: n = ne } = t, o = I(() => ee(e)), i = W(!1), c = I(() => i.value), l = Mt(t);
|
|
169
169
|
if (!n || !l.value)
|
|
170
170
|
return { focused: c };
|
|
171
171
|
const a = { passive: !0 };
|
|
172
|
-
return
|
|
172
|
+
return ce(o, St, () => i.value = !0, a), ce(o, $t, () => {
|
|
173
173
|
var u, r, s;
|
|
174
|
-
return i.value = (s = (r = (u = o.value) == null ? void 0 : u.matches) == null ? void 0 : r.call(u,
|
|
174
|
+
return i.value = (s = (r = (u = o.value) == null ? void 0 : u.matches) == null ? void 0 : r.call(u, At)) != null ? s : !1;
|
|
175
175
|
}, a), { focused: c };
|
|
176
176
|
}
|
|
177
|
-
function
|
|
178
|
-
const o =
|
|
177
|
+
function Tt(e, { window: t = ne, scrollTarget: n } = {}) {
|
|
178
|
+
const o = P(!1), i = () => {
|
|
179
179
|
if (!t) return;
|
|
180
|
-
const c = t.document, l =
|
|
180
|
+
const c = t.document, l = ee(e);
|
|
181
181
|
if (!l)
|
|
182
182
|
o.value = !1;
|
|
183
183
|
else {
|
|
@@ -186,21 +186,21 @@ function Rt(e, { window: t = oe, scrollTarget: n } = {}) {
|
|
|
186
186
|
}
|
|
187
187
|
};
|
|
188
188
|
return B(
|
|
189
|
-
() =>
|
|
189
|
+
() => ee(e),
|
|
190
190
|
() => i(),
|
|
191
191
|
{ immediate: !0, flush: "post" }
|
|
192
|
-
), t &&
|
|
192
|
+
), t && ce(n || t, "scroll", i, {
|
|
193
193
|
capture: !1,
|
|
194
194
|
passive: !0
|
|
195
195
|
}), o;
|
|
196
196
|
}
|
|
197
197
|
const V = (e) => {
|
|
198
|
-
let t =
|
|
198
|
+
let t = Tt(e).value;
|
|
199
199
|
return t = t && e.offsetHeight > 0, t;
|
|
200
|
-
}, G = (e) => e.tabIndex >= 0,
|
|
200
|
+
}, G = (e) => e.tabIndex >= 0, Be = (e) => {
|
|
201
201
|
const t = e.target;
|
|
202
|
-
return
|
|
203
|
-
},
|
|
202
|
+
return Ae(t);
|
|
203
|
+
}, Ae = (e) => {
|
|
204
204
|
var t;
|
|
205
205
|
let n;
|
|
206
206
|
if (e instanceof HTMLTableCellElement) {
|
|
@@ -213,8 +213,8 @@ const V = (e) => {
|
|
|
213
213
|
const o = e.previousElementSibling;
|
|
214
214
|
o && (n = o);
|
|
215
215
|
}
|
|
216
|
-
return n && (!G(n) || !V(n)) ?
|
|
217
|
-
},
|
|
216
|
+
return n && (!G(n) || !V(n)) ? Ae(n) : n;
|
|
217
|
+
}, Ot = (e) => {
|
|
218
218
|
var t;
|
|
219
219
|
const n = e.target;
|
|
220
220
|
let o;
|
|
@@ -231,11 +231,11 @@ const V = (e) => {
|
|
|
231
231
|
c && (o = c);
|
|
232
232
|
}
|
|
233
233
|
}
|
|
234
|
-
return o && (!G(o) || !V(o)) ?
|
|
235
|
-
},
|
|
234
|
+
return o && (!G(o) || !V(o)) ? Re(o) : o;
|
|
235
|
+
}, Xe = (e) => {
|
|
236
236
|
const t = e.target;
|
|
237
|
-
return
|
|
238
|
-
},
|
|
237
|
+
return Re(t);
|
|
238
|
+
}, Re = (e) => {
|
|
239
239
|
var t;
|
|
240
240
|
let n;
|
|
241
241
|
if (e instanceof HTMLTableCellElement) {
|
|
@@ -248,8 +248,8 @@ const V = (e) => {
|
|
|
248
248
|
const o = e.nextElementSibling;
|
|
249
249
|
o && (n = o);
|
|
250
250
|
}
|
|
251
|
-
return n && (!G(n) || !V(n)) ?
|
|
252
|
-
},
|
|
251
|
+
return n && (!G(n) || !V(n)) ? Re(n) : n;
|
|
252
|
+
}, Pt = (e) => {
|
|
253
253
|
var t;
|
|
254
254
|
const n = e.target;
|
|
255
255
|
let o;
|
|
@@ -266,11 +266,11 @@ const V = (e) => {
|
|
|
266
266
|
c && (o = c);
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
|
-
return o && (!G(o) || !V(o)) ?
|
|
270
|
-
},
|
|
269
|
+
return o && (!G(o) || !V(o)) ? Ae(o) : o;
|
|
270
|
+
}, Ne = (e) => {
|
|
271
271
|
const t = e.target;
|
|
272
|
-
return
|
|
273
|
-
},
|
|
272
|
+
return Te(t);
|
|
273
|
+
}, Te = (e) => {
|
|
274
274
|
var t;
|
|
275
275
|
let n;
|
|
276
276
|
if (e.previousElementSibling)
|
|
@@ -279,11 +279,11 @@ const V = (e) => {
|
|
|
279
279
|
const o = (t = e.parentElement) == null ? void 0 : t.previousElementSibling;
|
|
280
280
|
n = o == null ? void 0 : o.lastElementChild;
|
|
281
281
|
}
|
|
282
|
-
return n && (!G(n) || !V(n)) ?
|
|
283
|
-
},
|
|
282
|
+
return n && (!G(n) || !V(n)) ? Te(n) : n;
|
|
283
|
+
}, Ve = (e) => {
|
|
284
284
|
const t = e.target;
|
|
285
|
-
return
|
|
286
|
-
},
|
|
285
|
+
return Oe(t);
|
|
286
|
+
}, Oe = (e) => {
|
|
287
287
|
var t;
|
|
288
288
|
let n;
|
|
289
289
|
if (e.nextElementSibling)
|
|
@@ -292,83 +292,83 @@ const V = (e) => {
|
|
|
292
292
|
const o = (t = e.parentElement) == null ? void 0 : t.nextElementSibling;
|
|
293
293
|
n = o == null ? void 0 : o.firstElementChild;
|
|
294
294
|
}
|
|
295
|
-
return n && (!G(n) || !V(n)) ?
|
|
296
|
-
}, Ve = (e) => {
|
|
297
|
-
const t = e.target.parentElement, n = t == null ? void 0 : t.firstElementChild;
|
|
298
|
-
return n && (!G(n) || !V(n)) ? Te(n) : n;
|
|
295
|
+
return n && (!G(n) || !V(n)) ? Oe(n) : n;
|
|
299
296
|
}, Ge = (e) => {
|
|
297
|
+
const t = e.target.parentElement, n = t == null ? void 0 : t.firstElementChild;
|
|
298
|
+
return n && (!G(n) || !V(n)) ? Oe(n) : n;
|
|
299
|
+
}, Fe = (e) => {
|
|
300
300
|
const t = e.target.parentElement, n = t == null ? void 0 : t.lastElementChild;
|
|
301
|
-
return n && (!G(n) || !V(n)) ?
|
|
302
|
-
},
|
|
301
|
+
return n && (!G(n) || !V(n)) ? Te(n) : n;
|
|
302
|
+
}, de = ["alt", "control", "shift", "meta"], Lt = {
|
|
303
303
|
ArrowUp: "up",
|
|
304
304
|
ArrowDown: "down",
|
|
305
305
|
ArrowLeft: "left",
|
|
306
306
|
ArrowRight: "right"
|
|
307
|
-
},
|
|
307
|
+
}, Pe = {
|
|
308
308
|
"keydown.up": (e) => {
|
|
309
|
-
const t =
|
|
309
|
+
const t = Be(e);
|
|
310
310
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
311
311
|
},
|
|
312
312
|
"keydown.down": (e) => {
|
|
313
|
-
const t =
|
|
313
|
+
const t = Xe(e);
|
|
314
314
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
315
315
|
},
|
|
316
316
|
"keydown.left": (e) => {
|
|
317
|
-
const t =
|
|
317
|
+
const t = Ne(e);
|
|
318
318
|
e.preventDefault(), e.stopPropagation(), t && t.focus();
|
|
319
319
|
},
|
|
320
320
|
"keydown.right": (e) => {
|
|
321
|
-
const t =
|
|
321
|
+
const t = Ve(e);
|
|
322
322
|
e.preventDefault(), e.stopPropagation(), t && t.focus();
|
|
323
323
|
},
|
|
324
324
|
"keydown.control.up": (e) => {
|
|
325
|
-
const t =
|
|
325
|
+
const t = Ot(e);
|
|
326
326
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
327
327
|
},
|
|
328
328
|
"keydown.control.down": (e) => {
|
|
329
|
-
const t =
|
|
329
|
+
const t = Pt(e);
|
|
330
330
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
331
331
|
},
|
|
332
332
|
"keydown.control.left": (e) => {
|
|
333
|
-
const t =
|
|
333
|
+
const t = Ge(e);
|
|
334
334
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
335
335
|
},
|
|
336
336
|
"keydown.control.right": (e) => {
|
|
337
|
-
const t =
|
|
337
|
+
const t = Fe(e);
|
|
338
338
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
339
339
|
},
|
|
340
340
|
"keydown.end": (e) => {
|
|
341
|
-
const t =
|
|
341
|
+
const t = Fe(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 = Xe(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 = Be(e);
|
|
355
355
|
t && t.focus();
|
|
356
356
|
}
|
|
357
357
|
},
|
|
358
358
|
"keydown.home": (e) => {
|
|
359
|
-
const t =
|
|
359
|
+
const t = Ge(e);
|
|
360
360
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
361
361
|
},
|
|
362
362
|
"keydown.tab": (e) => {
|
|
363
|
-
const t =
|
|
363
|
+
const t = Ve(e);
|
|
364
364
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
365
365
|
},
|
|
366
366
|
"keydown.shift.tab": (e) => {
|
|
367
|
-
const t =
|
|
367
|
+
const t = Ne(e);
|
|
368
368
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
369
369
|
}
|
|
370
370
|
};
|
|
371
|
-
function
|
|
371
|
+
function Le(e) {
|
|
372
372
|
const t = (l) => {
|
|
373
373
|
let a = null;
|
|
374
374
|
return l.parent && (typeof l.parent == "string" ? a = document.querySelector(l.parent) : l.parent instanceof HTMLElement ? a = l.parent : a = l.parent.value), a;
|
|
@@ -395,19 +395,19 @@ function Pe(e) {
|
|
|
395
395
|
let u = [];
|
|
396
396
|
return l.selectors ? u = n(l) : a && (u = Array.from(a.children).filter((r) => G(r) && V(r))), u;
|
|
397
397
|
}, i = (l) => (a) => {
|
|
398
|
-
const u =
|
|
399
|
-
if (
|
|
400
|
-
const r = l.handlers ||
|
|
398
|
+
const u = Lt[a.key] || a.key.toLowerCase();
|
|
399
|
+
if (de.includes(u)) return;
|
|
400
|
+
const r = l.handlers || Pe;
|
|
401
401
|
for (const s of Object.keys(r)) {
|
|
402
402
|
const [v, ...m] = s.split(".");
|
|
403
403
|
if (v === "keydown" && m.includes(u)) {
|
|
404
|
-
const y = r[s], h = m.filter((f) =>
|
|
404
|
+
const y = r[s], h = m.filter((f) => de.includes(f)), x = de.some((f) => {
|
|
405
405
|
const d = f.charAt(0).toUpperCase() + f.slice(1);
|
|
406
406
|
return a.getModifierState(d);
|
|
407
407
|
});
|
|
408
408
|
if (h.length > 0) {
|
|
409
409
|
if (x) {
|
|
410
|
-
for (const f of
|
|
410
|
+
for (const f of de)
|
|
411
411
|
if (m.includes(f)) {
|
|
412
412
|
const d = f.charAt(0).toUpperCase() + f.slice(1);
|
|
413
413
|
a.getModifierState(d) && y(a);
|
|
@@ -422,46 +422,46 @@ function Pe(e) {
|
|
|
422
422
|
for (const l of e) {
|
|
423
423
|
const a = t(l), u = o(l), r = i(l), s = a ? [a] : u;
|
|
424
424
|
for (const v of s) {
|
|
425
|
-
const { focused: m } =
|
|
425
|
+
const { focused: m } = Rt(P(v)), y = B(m, (h) => {
|
|
426
426
|
h ? v.addEventListener("keydown", r) : v.removeEventListener("keydown", r);
|
|
427
427
|
});
|
|
428
428
|
c.push(y);
|
|
429
429
|
}
|
|
430
430
|
}
|
|
431
|
-
}),
|
|
431
|
+
}), rt(() => {
|
|
432
432
|
for (const l of c)
|
|
433
433
|
l();
|
|
434
434
|
});
|
|
435
435
|
}
|
|
436
|
-
function
|
|
437
|
-
return
|
|
436
|
+
function oe(e) {
|
|
437
|
+
return qe() ? (Je(e), !0) : !1;
|
|
438
438
|
}
|
|
439
439
|
const we = typeof window < "u" && typeof document < "u";
|
|
440
440
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
441
|
-
const
|
|
442
|
-
},
|
|
443
|
-
function
|
|
441
|
+
const Dt = (e) => e != null, Wt = Object.prototype.toString, _e = (e) => Wt.call(e) === "[object Object]", U = () => {
|
|
442
|
+
}, Me = /* @__PURE__ */ Ht();
|
|
443
|
+
function Ht() {
|
|
444
444
|
var e, t;
|
|
445
445
|
return we && ((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
|
-
|
|
447
|
+
function zt(...e) {
|
|
448
|
+
if (e.length !== 1)
|
|
449
|
+
return dt(...e);
|
|
450
|
+
const t = e[0];
|
|
451
|
+
return typeof t == "function" ? ft(Ze(() => ({ get: t, set: U }))) : P(t);
|
|
449
452
|
}
|
|
450
453
|
function J(e) {
|
|
451
454
|
return Array.isArray(e) ? e : [e];
|
|
452
455
|
}
|
|
453
|
-
function
|
|
454
|
-
|
|
455
|
-
return ct(...e);
|
|
456
|
-
const t = e[0];
|
|
457
|
-
return typeof t == "function" ? dt(Qe(() => ({ get: t, set: U }))) : O(t);
|
|
456
|
+
function Bt(e) {
|
|
457
|
+
return pe();
|
|
458
458
|
}
|
|
459
|
-
function
|
|
460
|
-
if (!
|
|
461
|
-
return
|
|
459
|
+
function Xt(e, t = {}) {
|
|
460
|
+
if (!ut(e))
|
|
461
|
+
return ct(e);
|
|
462
462
|
const n = Array.isArray(e.value) ? Array.from({ length: e.value.length }) : {};
|
|
463
463
|
for (const o in e.value)
|
|
464
|
-
n[o] =
|
|
464
|
+
n[o] = Ze(() => ({
|
|
465
465
|
get() {
|
|
466
466
|
return e.value[o];
|
|
467
467
|
},
|
|
@@ -481,10 +481,10 @@ function Bt(e, t = {}) {
|
|
|
481
481
|
}));
|
|
482
482
|
return n;
|
|
483
483
|
}
|
|
484
|
-
function
|
|
485
|
-
|
|
484
|
+
function Nt(e, t = !0, n) {
|
|
485
|
+
Bt() ? Q(e, n) : t ? e() : Qe(e);
|
|
486
486
|
}
|
|
487
|
-
function
|
|
487
|
+
function et(e, t, n) {
|
|
488
488
|
return B(
|
|
489
489
|
e,
|
|
490
490
|
t,
|
|
@@ -495,22 +495,22 @@ function _e(e, t, n) {
|
|
|
495
495
|
);
|
|
496
496
|
}
|
|
497
497
|
const ye = we ? window : void 0;
|
|
498
|
-
function
|
|
498
|
+
function te(e) {
|
|
499
499
|
var t;
|
|
500
500
|
const n = E(e);
|
|
501
501
|
return (t = n == null ? void 0 : n.$el) != null ? t : n;
|
|
502
502
|
}
|
|
503
|
-
function
|
|
503
|
+
function ue(...e) {
|
|
504
504
|
const t = [], n = () => {
|
|
505
505
|
t.forEach((a) => a()), t.length = 0;
|
|
506
506
|
}, o = (a, u, r, s) => (a.addEventListener(u, r, s), () => a.removeEventListener(u, r, s)), i = I(() => {
|
|
507
507
|
const a = J(E(e[0])).filter((u) => u != null);
|
|
508
508
|
return a.every((u) => typeof u != "string") ? a : void 0;
|
|
509
|
-
}), c =
|
|
509
|
+
}), c = et(
|
|
510
510
|
() => {
|
|
511
511
|
var a, u;
|
|
512
512
|
return [
|
|
513
|
-
(u = (a = i.value) == null ? void 0 : a.map((r) =>
|
|
513
|
+
(u = (a = i.value) == null ? void 0 : a.map((r) => te(r))) != null ? u : [ye].filter((r) => r != null),
|
|
514
514
|
J(E(i.value ? e[1] : e[0])),
|
|
515
515
|
J(b(i.value ? e[2] : e[1])),
|
|
516
516
|
// @ts-expect-error - TypeScript gets the correct types, but somehow still complains
|
|
@@ -520,7 +520,7 @@ function ce(...e) {
|
|
|
520
520
|
([a, u, r, s]) => {
|
|
521
521
|
if (n(), !(a != null && a.length) || !(u != null && u.length) || !(r != null && r.length))
|
|
522
522
|
return;
|
|
523
|
-
const v =
|
|
523
|
+
const v = _e(s) ? { ...s } : s;
|
|
524
524
|
t.push(
|
|
525
525
|
...a.flatMap(
|
|
526
526
|
(m) => u.flatMap(
|
|
@@ -533,25 +533,25 @@ function ce(...e) {
|
|
|
533
533
|
), l = () => {
|
|
534
534
|
c(), n();
|
|
535
535
|
};
|
|
536
|
-
return
|
|
536
|
+
return oe(n), l;
|
|
537
537
|
}
|
|
538
|
-
function
|
|
539
|
-
const e =
|
|
538
|
+
function Vt() {
|
|
539
|
+
const e = W(!1), t = pe();
|
|
540
540
|
return t && Q(() => {
|
|
541
541
|
e.value = !0;
|
|
542
542
|
}, t), e;
|
|
543
543
|
}
|
|
544
|
-
function
|
|
545
|
-
const t =
|
|
544
|
+
function tt(e) {
|
|
545
|
+
const t = Vt();
|
|
546
546
|
return I(() => (t.value, !!e()));
|
|
547
547
|
}
|
|
548
|
-
function
|
|
548
|
+
function nt(e, t, n = {}) {
|
|
549
549
|
const { window: o = ye, ...i } = n;
|
|
550
550
|
let c;
|
|
551
|
-
const l =
|
|
551
|
+
const l = tt(() => o && "MutationObserver" in o), a = () => {
|
|
552
552
|
c && (c.disconnect(), c = void 0);
|
|
553
553
|
}, u = I(() => {
|
|
554
|
-
const m = E(e), y = J(m).map(
|
|
554
|
+
const m = E(e), y = J(m).map(te).filter(Dt);
|
|
555
555
|
return new Set(y);
|
|
556
556
|
}), r = B(
|
|
557
557
|
() => u.value,
|
|
@@ -562,7 +562,7 @@ function tt(e, t, n = {}) {
|
|
|
562
562
|
), s = () => c == null ? void 0 : c.takeRecords(), v = () => {
|
|
563
563
|
r(), a();
|
|
564
564
|
};
|
|
565
|
-
return
|
|
565
|
+
return oe(v), {
|
|
566
566
|
isSupported: l,
|
|
567
567
|
stop: v,
|
|
568
568
|
takeRecords: s
|
|
@@ -584,30 +584,30 @@ function xe(e, t = {}) {
|
|
|
584
584
|
containerElement: y,
|
|
585
585
|
handle: h = e,
|
|
586
586
|
buttons: x = [0]
|
|
587
|
-
} = t, f =
|
|
587
|
+
} = t, f = P(
|
|
588
588
|
(n = E(s)) != null ? n : { x: 0, y: 0 }
|
|
589
|
-
), d =
|
|
589
|
+
), d = P(), p = (C) => o ? o.includes(C.pointerType) : !0, M = (C) => {
|
|
590
590
|
E(i) && C.preventDefault(), E(c) && C.stopPropagation();
|
|
591
591
|
}, $ = (C) => {
|
|
592
592
|
var T;
|
|
593
593
|
if (!E(x).includes(C.button) || E(t.disabled) || !p(C) || E(l) && C.target !== E(e))
|
|
594
594
|
return;
|
|
595
|
-
const
|
|
596
|
-
x: C.clientX - (
|
|
597
|
-
y: C.clientY - (
|
|
595
|
+
const H = E(y), F = (T = H == null ? void 0 : H.getBoundingClientRect) == null ? void 0 : T.call(H), X = E(e).getBoundingClientRect(), be = {
|
|
596
|
+
x: C.clientX - (H ? X.left - F.left + H.scrollLeft : X.left),
|
|
597
|
+
y: C.clientY - (H ? X.top - F.top + H.scrollTop : X.top)
|
|
598
598
|
};
|
|
599
|
-
(r == null ? void 0 : r(be, C)) !== !1 && (d.value = be,
|
|
599
|
+
(r == null ? void 0 : r(be, C)) !== !1 && (d.value = be, M(C));
|
|
600
600
|
}, k = (C) => {
|
|
601
601
|
if (E(t.disabled) || !p(C) || !d.value)
|
|
602
602
|
return;
|
|
603
|
-
const T = E(y),
|
|
603
|
+
const T = E(y), H = E(e).getBoundingClientRect();
|
|
604
604
|
let { x: F, y: X } = f.value;
|
|
605
|
-
(v === "x" || v === "both") && (F = C.clientX - d.value.x, T && (F = Math.min(Math.max(0, F), T.scrollWidth -
|
|
605
|
+
(v === "x" || v === "both") && (F = C.clientX - d.value.x, T && (F = Math.min(Math.max(0, F), T.scrollWidth - H.width))), (v === "y" || v === "both") && (X = C.clientY - d.value.y, T && (X = Math.min(Math.max(0, X), T.scrollHeight - H.height))), f.value = {
|
|
606
606
|
x: F,
|
|
607
607
|
y: X
|
|
608
|
-
}, a == null || a(f.value, C),
|
|
609
|
-
},
|
|
610
|
-
E(t.disabled) || !p(C) || d.value && (d.value = void 0, u == null || u(f.value, C),
|
|
608
|
+
}, a == null || a(f.value, C), M(C);
|
|
609
|
+
}, ae = (C) => {
|
|
610
|
+
E(t.disabled) || !p(C) || d.value && (d.value = void 0, u == null || u(f.value, C), M(C));
|
|
611
611
|
};
|
|
612
612
|
if (we) {
|
|
613
613
|
const C = () => {
|
|
@@ -617,10 +617,10 @@ function xe(e, t = {}) {
|
|
|
617
617
|
passive: !E(i)
|
|
618
618
|
};
|
|
619
619
|
};
|
|
620
|
-
|
|
620
|
+
ue(h, "pointerdown", $, C), ue(m, "pointermove", k, C), ue(m, "pointerup", ae, C);
|
|
621
621
|
}
|
|
622
622
|
return {
|
|
623
|
-
...
|
|
623
|
+
...Xt(f),
|
|
624
624
|
position: f,
|
|
625
625
|
isDragging: I(() => !!d.value),
|
|
626
626
|
style: I(
|
|
@@ -628,14 +628,14 @@ function xe(e, t = {}) {
|
|
|
628
628
|
)
|
|
629
629
|
};
|
|
630
630
|
}
|
|
631
|
-
function
|
|
631
|
+
function Gt(e, t, n = {}) {
|
|
632
632
|
const { window: o = ye, ...i } = n;
|
|
633
633
|
let c;
|
|
634
|
-
const l =
|
|
634
|
+
const l = tt(() => o && "ResizeObserver" in o), a = () => {
|
|
635
635
|
c && (c.disconnect(), c = void 0);
|
|
636
636
|
}, u = I(() => {
|
|
637
637
|
const v = E(e);
|
|
638
|
-
return Array.isArray(v) ? v.map((m) =>
|
|
638
|
+
return Array.isArray(v) ? v.map((m) => te(m)) : [te(v)];
|
|
639
639
|
}), r = B(
|
|
640
640
|
u,
|
|
641
641
|
(v) => {
|
|
@@ -649,7 +649,7 @@ function Vt(e, t, n = {}) {
|
|
|
649
649
|
), s = () => {
|
|
650
650
|
a(), r();
|
|
651
651
|
};
|
|
652
|
-
return
|
|
652
|
+
return oe(s), {
|
|
653
653
|
isSupported: l,
|
|
654
654
|
stop: s
|
|
655
655
|
};
|
|
@@ -661,9 +661,9 @@ function ge(e, t = {}) {
|
|
|
661
661
|
windowScroll: i = !0,
|
|
662
662
|
immediate: c = !0,
|
|
663
663
|
updateTiming: l = "sync"
|
|
664
|
-
} = t, a =
|
|
664
|
+
} = t, a = W(0), u = W(0), r = W(0), s = W(0), v = W(0), m = W(0), y = W(0), h = W(0);
|
|
665
665
|
function x() {
|
|
666
|
-
const d =
|
|
666
|
+
const d = te(e);
|
|
667
667
|
if (!d) {
|
|
668
668
|
n && (a.value = 0, u.value = 0, r.value = 0, s.value = 0, v.value = 0, m.value = 0, y.value = 0, h.value = 0);
|
|
669
669
|
return;
|
|
@@ -674,9 +674,9 @@ function ge(e, t = {}) {
|
|
|
674
674
|
function f() {
|
|
675
675
|
l === "sync" ? x() : l === "next-frame" && requestAnimationFrame(() => x());
|
|
676
676
|
}
|
|
677
|
-
return
|
|
677
|
+
return Gt(e, f), B(() => te(e), (d) => !d && f()), nt(e, f, {
|
|
678
678
|
attributeFilter: ["style", "class"]
|
|
679
|
-
}), i &&
|
|
679
|
+
}), i && ue("scroll", f, { capture: !0, passive: !0 }), o && ue("resize", f, { passive: !0 }), Nt(() => {
|
|
680
680
|
c && f();
|
|
681
681
|
}), {
|
|
682
682
|
height: a,
|
|
@@ -690,10 +690,10 @@ function ge(e, t = {}) {
|
|
|
690
690
|
update: f
|
|
691
691
|
};
|
|
692
692
|
}
|
|
693
|
-
const
|
|
693
|
+
const Ft = (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
|
+
}, jt = (e = 8) => Array.from({ length: e }, () => Math.floor(Math.random() * 16).toString(16)).join(""), Ut = ["data-colindex", "data-rowindex", "data-editable", "contenteditable", "tabindex"], Yt = ["innerHTML"], qt = { key: 2 }, Jt = /* @__PURE__ */ Z({
|
|
697
697
|
__name: "ACell",
|
|
698
698
|
props: {
|
|
699
699
|
colIndex: {},
|
|
@@ -704,7 +704,7 @@ const Gt = (e) => {
|
|
|
704
704
|
pinned: { type: Boolean, default: !1 }
|
|
705
705
|
},
|
|
706
706
|
setup(e, { expose: t }) {
|
|
707
|
-
const n = N("cell"), o = e.store.getCellData(e.colIndex, e.rowIndex), i =
|
|
707
|
+
const n = N("cell"), o = e.store.getCellData(e.colIndex, e.rowIndex), i = P(""), c = P(!1), l = e.store.columns[e.colIndex], a = e.store.rows[e.rowIndex], u = l.align || "center", r = l.width || "40ch", s = I(() => e.store.getCellDisplayValue(e.colIndex, e.rowIndex)), v = I(() => typeof s.value == "string" ? Ft(s.value) : !1), m = I(() => {
|
|
708
708
|
var d;
|
|
709
709
|
return {
|
|
710
710
|
textAlign: u,
|
|
@@ -716,14 +716,14 @@ const Gt = (e) => {
|
|
|
716
716
|
"sticky-column": e.pinned,
|
|
717
717
|
"cell-modified": c.value
|
|
718
718
|
})), h = () => {
|
|
719
|
-
const { left: d, bottom: p, width:
|
|
719
|
+
const { left: d, bottom: p, width: M, height: $ } = ge(n);
|
|
720
720
|
l.mask, l.modalComponent && e.store.$patch((k) => {
|
|
721
|
-
k.modal.visible = !0, k.modal.colIndex = e.colIndex, k.modal.rowIndex = e.rowIndex, k.modal.left = d, k.modal.bottom = p, k.modal.width =
|
|
721
|
+
k.modal.visible = !0, k.modal.colIndex = e.colIndex, k.modal.rowIndex = e.rowIndex, k.modal.left = d, k.modal.bottom = p, k.modal.width = M, k.modal.height = $, k.modal.cell = n.value, typeof l.modalComponent == "function" ? k.modal.component = l.modalComponent({ table: k.table, row: a, column: l }) : k.modal.component = l.modalComponent, k.modal.componentProps = l.modalComponentExtraProps;
|
|
722
722
|
});
|
|
723
723
|
};
|
|
724
724
|
if (e.addNavigation) {
|
|
725
725
|
let d = {
|
|
726
|
-
...
|
|
726
|
+
...Pe,
|
|
727
727
|
"keydown.f2": h,
|
|
728
728
|
"keydown.alt.up": h,
|
|
729
729
|
"keydown.alt.down": h,
|
|
@@ -733,7 +733,7 @@ const Gt = (e) => {
|
|
|
733
733
|
typeof e.addNavigation == "object" && (d = {
|
|
734
734
|
...d,
|
|
735
735
|
...e.addNavigation
|
|
736
|
-
}),
|
|
736
|
+
}), Le([
|
|
737
737
|
{
|
|
738
738
|
selectors: n,
|
|
739
739
|
handlers: d
|
|
@@ -748,7 +748,7 @@ const Gt = (e) => {
|
|
|
748
748
|
};
|
|
749
749
|
return t({
|
|
750
750
|
currentData: i
|
|
751
|
-
}), (d, p) => (
|
|
751
|
+
}), (d, p) => (S(), R("td", {
|
|
752
752
|
ref: "cell",
|
|
753
753
|
"data-colindex": d.colIndex,
|
|
754
754
|
"data-rowindex": d.rowIndex,
|
|
@@ -763,16 +763,16 @@ const Gt = (e) => {
|
|
|
763
763
|
onClick: h,
|
|
764
764
|
class: j(["atable-cell", y.value])
|
|
765
765
|
}, [
|
|
766
|
-
b(l).cellComponent ? (
|
|
766
|
+
b(l).cellComponent ? (S(), re(fe(b(l).cellComponent), Se({
|
|
767
767
|
key: 0,
|
|
768
768
|
value: s.value
|
|
769
|
-
}, b(l).cellComponentProps), null, 16, ["value"])) : v.value ? (
|
|
769
|
+
}, b(l).cellComponentProps), null, 16, ["value"])) : v.value ? (S(), R("span", {
|
|
770
770
|
key: 1,
|
|
771
771
|
innerHTML: s.value
|
|
772
|
-
}, null, 8,
|
|
773
|
-
], 46,
|
|
772
|
+
}, null, 8, Yt)) : (S(), R("span", qt, K(s.value), 1))
|
|
773
|
+
], 46, Ut));
|
|
774
774
|
}
|
|
775
|
-
}),
|
|
775
|
+
}), Qt = ["tabindex"], Zt = ["tabindex"], Kt = ["colspan"], _t = /* @__PURE__ */ Z({
|
|
776
776
|
__name: "AExpansionRow",
|
|
777
777
|
props: {
|
|
778
778
|
rowIndex: {},
|
|
@@ -788,14 +788,14 @@ const Gt = (e) => {
|
|
|
788
788
|
i.stopPropagation(), i.preventDefault(), e.store.toggleRowExpand(e.rowIndex);
|
|
789
789
|
}
|
|
790
790
|
};
|
|
791
|
-
typeof e.addNavigation == "object" && Object.assign(o, e.addNavigation),
|
|
791
|
+
typeof e.addNavigation == "object" && Object.assign(o, e.addNavigation), Le([
|
|
792
792
|
{
|
|
793
793
|
selectors: t,
|
|
794
794
|
handlers: o
|
|
795
795
|
}
|
|
796
796
|
]);
|
|
797
797
|
}
|
|
798
|
-
return (o, i) => (
|
|
798
|
+
return (o, i) => (S(), R(ie, null, [
|
|
799
799
|
L("tr", Se(o.$attrs, {
|
|
800
800
|
ref: "rowEl",
|
|
801
801
|
tabindex: o.tabIndex,
|
|
@@ -805,10 +805,10 @@ const Gt = (e) => {
|
|
|
805
805
|
tabIndex: -1,
|
|
806
806
|
onClick: i[0] || (i[0] = (c) => o.store.toggleRowExpand(o.rowIndex)),
|
|
807
807
|
class: "row-index"
|
|
808
|
-
},
|
|
808
|
+
}, K(n.value), 1),
|
|
809
809
|
z(o.$slots, "row", {}, void 0, !0)
|
|
810
|
-
], 16,
|
|
811
|
-
o.store.display[o.rowIndex].expanded ? (
|
|
810
|
+
], 16, Qt),
|
|
811
|
+
o.store.display[o.rowIndex].expanded ? (S(), R("tr", {
|
|
812
812
|
key: 0,
|
|
813
813
|
ref: "rowExpanded",
|
|
814
814
|
tabindex: o.tabIndex,
|
|
@@ -820,22 +820,22 @@ const Gt = (e) => {
|
|
|
820
820
|
class: "expanded-row-content"
|
|
821
821
|
}, [
|
|
822
822
|
z(o.$slots, "content", {}, void 0, !0)
|
|
823
|
-
], 8,
|
|
824
|
-
], 8,
|
|
823
|
+
], 8, Kt)
|
|
824
|
+
], 8, Zt)) : _("", !0)
|
|
825
825
|
], 64));
|
|
826
826
|
}
|
|
827
|
-
}),
|
|
827
|
+
}), le = (e, t) => {
|
|
828
828
|
const n = e.__vccOpts || e;
|
|
829
829
|
for (const [o, i] of t)
|
|
830
830
|
n[o] = i;
|
|
831
831
|
return n;
|
|
832
|
-
},
|
|
832
|
+
}, en = /* @__PURE__ */ le(_t, [["__scopeId", "data-v-5ad4bb41"]]), tn = ["colspan"], nn = {
|
|
833
833
|
ref: "container",
|
|
834
834
|
class: "gantt-handler"
|
|
835
|
-
},
|
|
835
|
+
}, on = {
|
|
836
836
|
key: 0,
|
|
837
837
|
class: "gantt-label"
|
|
838
|
-
},
|
|
838
|
+
}, ln = /* @__PURE__ */ Z({
|
|
839
839
|
__name: "AGanttCell",
|
|
840
840
|
props: {
|
|
841
841
|
store: {},
|
|
@@ -849,15 +849,15 @@ const Gt = (e) => {
|
|
|
849
849
|
color: {}
|
|
850
850
|
},
|
|
851
851
|
setup(e) {
|
|
852
|
-
|
|
852
|
+
vt((d) => ({
|
|
853
853
|
"78862e08": t.value,
|
|
854
854
|
"18ad7d98": d.colspan
|
|
855
855
|
}));
|
|
856
|
-
const t =
|
|
856
|
+
const t = P();
|
|
857
857
|
Q(() => {
|
|
858
858
|
!e.color || e.color == "" || e.color.length < 6 ? t.value = "#cccccc" : t.value = e.color;
|
|
859
859
|
});
|
|
860
|
-
const n = N("container"), o = N("bar"), i = N("leftHandle"), c = N("rightHandle"), { width: l } = ge(n), { left: a, right: u } = ge(o), r =
|
|
860
|
+
const n = N("container"), o = N("bar"), i = N("leftHandle"), c = N("rightHandle"), { width: l } = ge(n), { left: a, right: u } = ge(o), r = P(e.start || 0), s = P(e.end || r.value + e.colspan), v = P({ startX: 0, startPos: 0 }), m = I(() => e.colspan > 0 ? l.value / e.colspan : 0), y = I(() => {
|
|
861
861
|
const d = r.value / e.colspan * 100, p = s.value / e.colspan * 100;
|
|
862
862
|
return {
|
|
863
863
|
left: `${d}%`,
|
|
@@ -874,13 +874,13 @@ const Gt = (e) => {
|
|
|
874
874
|
},
|
|
875
875
|
onMove: ({ x: d }) => {
|
|
876
876
|
if (h.value && o.value) {
|
|
877
|
-
const
|
|
877
|
+
const M = (d - v.value.startX) / m.value, $ = Math.max(0, Math.min(s.value - 1, v.value.startPos + M));
|
|
878
878
|
o.value.style.left = `${$ / e.colspan * 100}%`, o.value.style.width = `${(s.value - $) / e.colspan * 100}%`;
|
|
879
879
|
}
|
|
880
880
|
},
|
|
881
881
|
onEnd: ({ x: d }) => {
|
|
882
882
|
if (o.value) {
|
|
883
|
-
const p = d - v.value.startX,
|
|
883
|
+
const p = d - v.value.startX, M = Math.round(p / m.value), $ = r.value, k = Math.max(0, Math.min(s.value - 1, v.value.startPos + M));
|
|
884
884
|
r.value = k, e.store.updateGanttBar({
|
|
885
885
|
rowIndex: e.rowIndex,
|
|
886
886
|
colIndex: e.colIndex,
|
|
@@ -889,7 +889,7 @@ const Gt = (e) => {
|
|
|
889
889
|
oldStart: $,
|
|
890
890
|
newStart: k,
|
|
891
891
|
end: s.value,
|
|
892
|
-
delta:
|
|
892
|
+
delta: M,
|
|
893
893
|
oldColspan: s.value - $,
|
|
894
894
|
newColspan: s.value - k
|
|
895
895
|
});
|
|
@@ -905,18 +905,18 @@ const Gt = (e) => {
|
|
|
905
905
|
},
|
|
906
906
|
onMove: ({ x: d }) => {
|
|
907
907
|
if (x.value && o.value) {
|
|
908
|
-
const
|
|
908
|
+
const M = (d - v.value.startX) / m.value, $ = Math.max(
|
|
909
909
|
r.value + 1,
|
|
910
|
-
Math.min(e.columnsCount, v.value.startPos +
|
|
910
|
+
Math.min(e.columnsCount, v.value.startPos + M)
|
|
911
911
|
);
|
|
912
912
|
o.value.style.width = `${($ - r.value) / e.colspan * 100}%`;
|
|
913
913
|
}
|
|
914
914
|
},
|
|
915
915
|
onEnd: ({ x: d }) => {
|
|
916
916
|
if (o.value) {
|
|
917
|
-
const p = d - v.value.startX,
|
|
917
|
+
const p = d - v.value.startX, M = Math.round(p / m.value), $ = s.value, k = Math.max(
|
|
918
918
|
r.value + 1,
|
|
919
|
-
Math.min(e.columnsCount, v.value.startPos +
|
|
919
|
+
Math.min(e.columnsCount, v.value.startPos + M)
|
|
920
920
|
);
|
|
921
921
|
s.value = k, e.store.updateGanttBar({
|
|
922
922
|
rowIndex: e.rowIndex,
|
|
@@ -926,7 +926,7 @@ const Gt = (e) => {
|
|
|
926
926
|
oldEnd: $,
|
|
927
927
|
newEnd: k,
|
|
928
928
|
start: r.value,
|
|
929
|
-
delta:
|
|
929
|
+
delta: M,
|
|
930
930
|
oldColspan: $ - r.value,
|
|
931
931
|
newColspan: k - r.value
|
|
932
932
|
});
|
|
@@ -944,33 +944,33 @@ const Gt = (e) => {
|
|
|
944
944
|
},
|
|
945
945
|
onMove: ({ x: d }) => {
|
|
946
946
|
if (f.value && o.value) {
|
|
947
|
-
const
|
|
947
|
+
const M = (d - v.value.startX) / m.value, $ = s.value - r.value, k = Math.max(0, Math.min(v.value.startPos + M, e.columnsCount - $));
|
|
948
948
|
o.value.style.left = `${k / e.colspan * 100}%`;
|
|
949
949
|
}
|
|
950
950
|
},
|
|
951
951
|
onEnd: ({ x: d }) => {
|
|
952
952
|
if (o.value) {
|
|
953
|
-
const p = d - v.value.startX,
|
|
954
|
-
let C = v.value.startPos +
|
|
953
|
+
const p = d - v.value.startX, M = Math.round(p / m.value), $ = s.value - r.value, k = r.value, ae = s.value;
|
|
954
|
+
let C = v.value.startPos + M, T = C + $;
|
|
955
955
|
C < 0 ? (C = 0, T = $) : T > e.columnsCount && (T = e.columnsCount, C = T - $), r.value = C, s.value = T, e.store.updateGanttBar({
|
|
956
956
|
rowIndex: e.rowIndex,
|
|
957
957
|
colIndex: e.colIndex,
|
|
958
958
|
type: "bar",
|
|
959
959
|
oldStart: k,
|
|
960
|
-
oldEnd:
|
|
960
|
+
oldEnd: ae,
|
|
961
961
|
newStart: C,
|
|
962
962
|
newEnd: T,
|
|
963
|
-
delta:
|
|
963
|
+
delta: M,
|
|
964
964
|
colspan: T - C
|
|
965
965
|
});
|
|
966
966
|
}
|
|
967
967
|
}
|
|
968
968
|
});
|
|
969
|
-
return (d, p) => (
|
|
969
|
+
return (d, p) => (S(), R("td", {
|
|
970
970
|
class: "aganttcell",
|
|
971
971
|
colspan: d.colspan
|
|
972
972
|
}, [
|
|
973
|
-
L("div",
|
|
973
|
+
L("div", nn, [
|
|
974
974
|
L("div", {
|
|
975
975
|
ref: "bar",
|
|
976
976
|
class: j(["gantt-bar", { "is-dragging": b(f) || b(h) || b(x) }]),
|
|
@@ -983,7 +983,7 @@ const Gt = (e) => {
|
|
|
983
983
|
L("div", { class: "handle-grip" }, null, -1),
|
|
984
984
|
L("div", { class: "vertical-indicator left-indicator" }, null, -1)
|
|
985
985
|
]), 2),
|
|
986
|
-
d.label ? (
|
|
986
|
+
d.label ? (S(), R("label", on, K(d.label), 1)) : _("", !0),
|
|
987
987
|
L("div", {
|
|
988
988
|
ref: "rightHandle",
|
|
989
989
|
class: j(["gantt-handle right-handle", { "is-dragging": b(x) }])
|
|
@@ -993,9 +993,9 @@ const Gt = (e) => {
|
|
|
993
993
|
]), 2)
|
|
994
994
|
], 6)
|
|
995
995
|
], 512)
|
|
996
|
-
], 8,
|
|
996
|
+
], 8, tn));
|
|
997
997
|
}
|
|
998
|
-
}),
|
|
998
|
+
}), an = /* @__PURE__ */ le(ln, [["__scopeId", "data-v-a929e8e3"]]), sn = ["tabindex"], rn = /* @__PURE__ */ Z({
|
|
999
999
|
__name: "ARow",
|
|
1000
1000
|
props: {
|
|
1001
1001
|
rowIndex: {},
|
|
@@ -1006,56 +1006,56 @@ const Gt = (e) => {
|
|
|
1006
1006
|
setup(e) {
|
|
1007
1007
|
const t = N("rowEl"), n = I(() => e.store.isRowVisible(e.rowIndex)), o = I(() => e.store.getRowExpandSymbol(e.rowIndex));
|
|
1008
1008
|
if (e.addNavigation) {
|
|
1009
|
-
let i =
|
|
1009
|
+
let i = Pe;
|
|
1010
1010
|
typeof e.addNavigation == "object" && (i = {
|
|
1011
1011
|
...i,
|
|
1012
1012
|
...e.addNavigation
|
|
1013
|
-
}),
|
|
1013
|
+
}), Le([
|
|
1014
1014
|
{
|
|
1015
1015
|
selectors: t,
|
|
1016
1016
|
handlers: i
|
|
1017
1017
|
}
|
|
1018
1018
|
]);
|
|
1019
1019
|
}
|
|
1020
|
-
return (i, c) => he((
|
|
1020
|
+
return (i, c) => he((S(), R("tr", {
|
|
1021
1021
|
ref: "rowEl",
|
|
1022
1022
|
tabindex: i.tabIndex,
|
|
1023
1023
|
class: "atable-row"
|
|
1024
1024
|
}, [
|
|
1025
1025
|
i.store.config.view !== "uncounted" ? z(i.$slots, "index", { key: 0 }, () => [
|
|
1026
|
-
i.store.config.view === "list" ? (
|
|
1026
|
+
i.store.config.view === "list" ? (S(), R("td", {
|
|
1027
1027
|
key: 0,
|
|
1028
1028
|
tabIndex: -1,
|
|
1029
1029
|
class: j(["list-index", i.store.hasPinnedColumns ? "sticky-index" : ""])
|
|
1030
|
-
},
|
|
1030
|
+
}, K(i.rowIndex + 1), 3)) : i.store.config.view === "tree" ? (S(), R("td", {
|
|
1031
1031
|
key: 1,
|
|
1032
1032
|
tabIndex: -1,
|
|
1033
1033
|
class: j(["tree-index", i.store.hasPinnedColumns ? "sticky-index" : ""]),
|
|
1034
1034
|
onClick: c[0] || (c[0] = (l) => i.store.toggleRowExpand(i.rowIndex))
|
|
1035
|
-
},
|
|
1036
|
-
], !0) :
|
|
1035
|
+
}, K(o.value), 3)) : _("", !0)
|
|
1036
|
+
], !0) : _("", !0),
|
|
1037
1037
|
z(i.$slots, "default", {}, void 0, !0)
|
|
1038
|
-
], 8,
|
|
1039
|
-
[
|
|
1038
|
+
], 8, sn)), [
|
|
1039
|
+
[Ke, n.value]
|
|
1040
1040
|
]);
|
|
1041
1041
|
}
|
|
1042
|
-
}),
|
|
1042
|
+
}), ot = /* @__PURE__ */ le(rn, [["__scopeId", "data-v-4cb4f254"]]), De = we ? window : void 0;
|
|
1043
1043
|
function Y(e) {
|
|
1044
1044
|
var t;
|
|
1045
1045
|
const n = E(e);
|
|
1046
1046
|
return (t = n == null ? void 0 : n.$el) != null ? t : n;
|
|
1047
1047
|
}
|
|
1048
|
-
function
|
|
1048
|
+
function me(...e) {
|
|
1049
1049
|
const t = [], n = () => {
|
|
1050
1050
|
t.forEach((a) => a()), t.length = 0;
|
|
1051
1051
|
}, o = (a, u, r, s) => (a.addEventListener(u, r, s), () => a.removeEventListener(u, r, s)), i = I(() => {
|
|
1052
1052
|
const a = J(E(e[0])).filter((u) => u != null);
|
|
1053
1053
|
return a.every((u) => typeof u != "string") ? a : void 0;
|
|
1054
|
-
}), c =
|
|
1054
|
+
}), c = et(
|
|
1055
1055
|
() => {
|
|
1056
1056
|
var a, u;
|
|
1057
1057
|
return [
|
|
1058
|
-
(u = (a = i.value) == null ? void 0 : a.map((r) => Y(r))) != null ? u : [
|
|
1058
|
+
(u = (a = i.value) == null ? void 0 : a.map((r) => Y(r))) != null ? u : [De].filter((r) => r != null),
|
|
1059
1059
|
J(E(i.value ? e[1] : e[0])),
|
|
1060
1060
|
J(b(i.value ? e[2] : e[1])),
|
|
1061
1061
|
// @ts-expect-error - TypeScript gets the correct types, but somehow still complains
|
|
@@ -1065,7 +1065,7 @@ function K(...e) {
|
|
|
1065
1065
|
([a, u, r, s]) => {
|
|
1066
1066
|
if (n(), !(a != null && a.length) || !(u != null && u.length) || !(r != null && r.length))
|
|
1067
1067
|
return;
|
|
1068
|
-
const v =
|
|
1068
|
+
const v = _e(s) ? { ...s } : s;
|
|
1069
1069
|
t.push(
|
|
1070
1070
|
...a.flatMap(
|
|
1071
1071
|
(m) => u.flatMap(
|
|
@@ -1078,17 +1078,17 @@ function K(...e) {
|
|
|
1078
1078
|
), l = () => {
|
|
1079
1079
|
c(), n();
|
|
1080
1080
|
};
|
|
1081
|
-
return
|
|
1081
|
+
return oe(n), l;
|
|
1082
1082
|
}
|
|
1083
|
-
let
|
|
1084
|
-
function
|
|
1085
|
-
const { window: o =
|
|
1083
|
+
let je = !1;
|
|
1084
|
+
function Ue(e, t, n = {}) {
|
|
1085
|
+
const { window: o = De, ignore: i = [], capture: c = !0, detectIframe: l = !1, controls: a = !1 } = n;
|
|
1086
1086
|
if (!o)
|
|
1087
1087
|
return a ? { stop: U, cancel: U, trigger: U } : U;
|
|
1088
|
-
if (
|
|
1089
|
-
|
|
1088
|
+
if (Me && !je) {
|
|
1089
|
+
je = !0;
|
|
1090
1090
|
const f = { passive: !0 };
|
|
1091
|
-
Array.from(o.document.body.children).forEach((d) =>
|
|
1091
|
+
Array.from(o.document.body.children).forEach((d) => d.addEventListener("click", U, f)), o.document.documentElement.addEventListener("click", U, f);
|
|
1092
1092
|
}
|
|
1093
1093
|
let u = !0;
|
|
1094
1094
|
const r = (f) => E(i).some((d) => {
|
|
@@ -1104,8 +1104,8 @@ function je(e, t, n = {}) {
|
|
|
1104
1104
|
return d && d.$.subTree.shapeFlag === 16;
|
|
1105
1105
|
}
|
|
1106
1106
|
function v(f, d) {
|
|
1107
|
-
const p = E(f),
|
|
1108
|
-
return
|
|
1107
|
+
const p = E(f), M = p.$.subTree && p.$.subTree.children;
|
|
1108
|
+
return M == null || !Array.isArray(M) ? !1 : M.some(($) => $.el === d.target || d.composedPath().includes($.el));
|
|
1109
1109
|
}
|
|
1110
1110
|
const m = (f) => {
|
|
1111
1111
|
const d = Y(e);
|
|
@@ -1119,16 +1119,16 @@ function je(e, t, n = {}) {
|
|
|
1119
1119
|
};
|
|
1120
1120
|
let y = !1;
|
|
1121
1121
|
const h = [
|
|
1122
|
-
|
|
1122
|
+
me(o, "click", (f) => {
|
|
1123
1123
|
y || (y = !0, setTimeout(() => {
|
|
1124
1124
|
y = !1;
|
|
1125
1125
|
}, 0), m(f));
|
|
1126
1126
|
}, { passive: !0, capture: c }),
|
|
1127
|
-
|
|
1127
|
+
me(o, "pointerdown", (f) => {
|
|
1128
1128
|
const d = Y(e);
|
|
1129
1129
|
u = !r(f) && !!(d && !f.composedPath().includes(d));
|
|
1130
1130
|
}, { passive: !0 }),
|
|
1131
|
-
l &&
|
|
1131
|
+
l && me(o, "blur", (f) => {
|
|
1132
1132
|
setTimeout(() => {
|
|
1133
1133
|
var d;
|
|
1134
1134
|
const p = Y(e);
|
|
@@ -1146,34 +1146,37 @@ function je(e, t, n = {}) {
|
|
|
1146
1146
|
}
|
|
1147
1147
|
} : x;
|
|
1148
1148
|
}
|
|
1149
|
-
const
|
|
1149
|
+
const Ce = /* @__PURE__ */ new WeakMap(), un = {
|
|
1150
1150
|
mounted(e, t) {
|
|
1151
1151
|
const n = !t.modifiers.bubble;
|
|
1152
|
+
let o;
|
|
1152
1153
|
if (typeof t.value == "function")
|
|
1153
|
-
|
|
1154
|
+
o = Ue(e, t.value, { capture: n });
|
|
1154
1155
|
else {
|
|
1155
|
-
const [
|
|
1156
|
-
|
|
1156
|
+
const [i, c] = t.value;
|
|
1157
|
+
o = Ue(e, i, Object.assign({ capture: n }, c));
|
|
1157
1158
|
}
|
|
1159
|
+
Ce.set(e, o);
|
|
1158
1160
|
},
|
|
1159
1161
|
unmounted(e) {
|
|
1160
|
-
|
|
1162
|
+
const t = Ce.get(e);
|
|
1163
|
+
t && typeof t == "function" ? t() : t == null || t.stop(), Ce.delete(e);
|
|
1161
1164
|
}
|
|
1162
1165
|
};
|
|
1163
|
-
function
|
|
1164
|
-
const e =
|
|
1166
|
+
function cn() {
|
|
1167
|
+
const e = W(!1), t = pe();
|
|
1165
1168
|
return t && Q(() => {
|
|
1166
1169
|
e.value = !0;
|
|
1167
1170
|
}, t), e;
|
|
1168
1171
|
}
|
|
1169
|
-
function
|
|
1170
|
-
const t =
|
|
1172
|
+
function dn(e) {
|
|
1173
|
+
const t = cn();
|
|
1171
1174
|
return I(() => (t.value, !!e()));
|
|
1172
1175
|
}
|
|
1173
|
-
function
|
|
1174
|
-
const { window: o =
|
|
1176
|
+
function Ye(e, t, n = {}) {
|
|
1177
|
+
const { window: o = De, ...i } = n;
|
|
1175
1178
|
let c;
|
|
1176
|
-
const l =
|
|
1179
|
+
const l = dn(() => o && "ResizeObserver" in o), a = () => {
|
|
1177
1180
|
c && (c.disconnect(), c = void 0);
|
|
1178
1181
|
}, u = I(() => {
|
|
1179
1182
|
const v = E(e);
|
|
@@ -1191,41 +1194,41 @@ function Ue(e, t, n = {}) {
|
|
|
1191
1194
|
), s = () => {
|
|
1192
1195
|
a(), r();
|
|
1193
1196
|
};
|
|
1194
|
-
return
|
|
1197
|
+
return oe(s), {
|
|
1195
1198
|
isSupported: l,
|
|
1196
1199
|
stop: s
|
|
1197
1200
|
};
|
|
1198
1201
|
}
|
|
1199
|
-
function
|
|
1202
|
+
function Ee(e) {
|
|
1200
1203
|
return typeof Window < "u" && e instanceof Window ? e.document.documentElement : typeof Document < "u" && e instanceof Document ? e.documentElement : e;
|
|
1201
1204
|
}
|
|
1202
|
-
const
|
|
1205
|
+
const fn = {
|
|
1203
1206
|
mounted(e, t) {
|
|
1204
|
-
typeof t.value == "function" ?
|
|
1207
|
+
typeof t.value == "function" ? Ye(e, t.value) : Ye(e, ...t.value);
|
|
1205
1208
|
}
|
|
1206
1209
|
};
|
|
1207
|
-
function
|
|
1210
|
+
function lt(e) {
|
|
1208
1211
|
const t = window.getComputedStyle(e);
|
|
1209
1212
|
if (t.overflowX === "scroll" || t.overflowY === "scroll" || t.overflowX === "auto" && e.clientWidth < e.scrollWidth || t.overflowY === "auto" && e.clientHeight < e.scrollHeight)
|
|
1210
1213
|
return !0;
|
|
1211
1214
|
{
|
|
1212
1215
|
const n = e.parentNode;
|
|
1213
|
-
return !n || n.tagName === "BODY" ? !1 :
|
|
1216
|
+
return !n || n.tagName === "BODY" ? !1 : lt(n);
|
|
1214
1217
|
}
|
|
1215
1218
|
}
|
|
1216
|
-
function
|
|
1219
|
+
function vn(e) {
|
|
1217
1220
|
const t = e || window.event, n = t.target;
|
|
1218
|
-
return
|
|
1221
|
+
return lt(n) ? !1 : t.touches.length > 1 ? !0 : (t.preventDefault && t.preventDefault(), !1);
|
|
1219
1222
|
}
|
|
1220
|
-
const
|
|
1221
|
-
function
|
|
1222
|
-
const n =
|
|
1223
|
+
const Ie = /* @__PURE__ */ new WeakMap();
|
|
1224
|
+
function mn(e, t = !1) {
|
|
1225
|
+
const n = W(t);
|
|
1223
1226
|
let o = null, i = "";
|
|
1224
1227
|
B(zt(e), (a) => {
|
|
1225
|
-
const u =
|
|
1228
|
+
const u = Ee(E(a));
|
|
1226
1229
|
if (u) {
|
|
1227
1230
|
const r = u;
|
|
1228
|
-
if (
|
|
1231
|
+
if (Ie.get(r) || Ie.set(r, r.style.overflow), r.style.overflow !== "hidden" && (i = r.style.overflow), r.style.overflow === "hidden")
|
|
1229
1232
|
return n.value = !0;
|
|
1230
1233
|
if (n.value)
|
|
1231
1234
|
return r.style.overflow = "hidden";
|
|
@@ -1234,20 +1237,20 @@ function vn(e, t = !1) {
|
|
|
1234
1237
|
immediate: !0
|
|
1235
1238
|
});
|
|
1236
1239
|
const c = () => {
|
|
1237
|
-
const a =
|
|
1238
|
-
!a || n.value || (
|
|
1240
|
+
const a = Ee(E(e));
|
|
1241
|
+
!a || n.value || (Me && (o = me(
|
|
1239
1242
|
a,
|
|
1240
1243
|
"touchmove",
|
|
1241
1244
|
(u) => {
|
|
1242
|
-
|
|
1245
|
+
vn(u);
|
|
1243
1246
|
},
|
|
1244
1247
|
{ passive: !1 }
|
|
1245
1248
|
)), a.style.overflow = "hidden", n.value = !0);
|
|
1246
1249
|
}, l = () => {
|
|
1247
|
-
const a =
|
|
1248
|
-
!a || !n.value || (
|
|
1250
|
+
const a = Ee(E(e));
|
|
1251
|
+
!a || !n.value || (Me && (o == null || o()), a.style.overflow = i, Ie.delete(a), n.value = !1);
|
|
1249
1252
|
};
|
|
1250
|
-
return
|
|
1253
|
+
return oe(l), I({
|
|
1251
1254
|
get() {
|
|
1252
1255
|
return n.value;
|
|
1253
1256
|
},
|
|
@@ -1256,22 +1259,22 @@ function vn(e, t = !1) {
|
|
|
1256
1259
|
}
|
|
1257
1260
|
});
|
|
1258
1261
|
}
|
|
1259
|
-
function
|
|
1262
|
+
function hn() {
|
|
1260
1263
|
let e = !1;
|
|
1261
|
-
const t =
|
|
1264
|
+
const t = W(!1);
|
|
1262
1265
|
return (n, o) => {
|
|
1263
1266
|
if (t.value = o.value, e)
|
|
1264
1267
|
return;
|
|
1265
1268
|
e = !0;
|
|
1266
|
-
const i =
|
|
1269
|
+
const i = mn(n, o.value);
|
|
1267
1270
|
B(t, (c) => i.value = c);
|
|
1268
1271
|
};
|
|
1269
1272
|
}
|
|
1270
|
-
|
|
1271
|
-
const
|
|
1273
|
+
hn();
|
|
1274
|
+
const gn = { key: 0 }, pn = {
|
|
1272
1275
|
class: "atable-header-row",
|
|
1273
1276
|
tabindex: "-1"
|
|
1274
|
-
},
|
|
1277
|
+
}, wn = ["data-colindex"], at = /* @__PURE__ */ Z({
|
|
1275
1278
|
__name: "ATableHeader",
|
|
1276
1279
|
props: {
|
|
1277
1280
|
columns: {},
|
|
@@ -1286,9 +1289,9 @@ const hn = { key: 0 }, gn = {
|
|
|
1286
1289
|
typeof u == "number" && u !== l && e.store.resizeColumn(a, l);
|
|
1287
1290
|
}
|
|
1288
1291
|
};
|
|
1289
|
-
return (n, o) => n.columns.length ? (
|
|
1290
|
-
L("tr",
|
|
1291
|
-
n.store.zeroColumn ? (
|
|
1292
|
+
return (n, o) => n.columns.length ? (S(), R("thead", gn, [
|
|
1293
|
+
L("tr", pn, [
|
|
1294
|
+
n.store.zeroColumn ? (S(), R("th", {
|
|
1292
1295
|
key: 0,
|
|
1293
1296
|
id: "header-index",
|
|
1294
1297
|
class: j([[
|
|
@@ -1296,8 +1299,8 @@ const hn = { key: 0 }, gn = {
|
|
|
1296
1299
|
n.store.config.view === "tree" ? "tree-index" : "",
|
|
1297
1300
|
n.store.config.view === "list-expansion" ? "list-expansion-index" : ""
|
|
1298
1301
|
], "list-index"])
|
|
1299
|
-
}, null, 2)) :
|
|
1300
|
-
(
|
|
1302
|
+
}, null, 2)) : _("", !0),
|
|
1303
|
+
(S(!0), R(ie, null, ke(n.columns, (i, c) => he((S(), R("th", {
|
|
1301
1304
|
key: i.name,
|
|
1302
1305
|
"data-colindex": c,
|
|
1303
1306
|
tabindex: "-1",
|
|
@@ -1305,15 +1308,15 @@ const hn = { key: 0 }, gn = {
|
|
|
1305
1308
|
class: j(i.pinned ? "sticky-column" : "")
|
|
1306
1309
|
}, [
|
|
1307
1310
|
z(n.$slots, "default", {}, () => [
|
|
1308
|
-
|
|
1311
|
+
mt(K(i.label || String.fromCharCode(c + 97).toUpperCase()), 1)
|
|
1309
1312
|
])
|
|
1310
|
-
], 14,
|
|
1311
|
-
[b(
|
|
1313
|
+
], 14, wn)), [
|
|
1314
|
+
[b(fn), t]
|
|
1312
1315
|
])), 128))
|
|
1313
1316
|
])
|
|
1314
|
-
])) :
|
|
1317
|
+
])) : _("", !0);
|
|
1315
1318
|
}
|
|
1316
|
-
}),
|
|
1319
|
+
}), st = /* @__PURE__ */ Z({
|
|
1317
1320
|
__name: "ATableModal",
|
|
1318
1321
|
props: {
|
|
1319
1322
|
store: {}
|
|
@@ -1332,40 +1335,40 @@ const hn = { key: 0 }, gn = {
|
|
|
1332
1335
|
top: `${u}px`
|
|
1333
1336
|
};
|
|
1334
1337
|
});
|
|
1335
|
-
return (c, l) => (
|
|
1338
|
+
return (c, l) => (S(), R("div", {
|
|
1336
1339
|
class: "amodal",
|
|
1337
1340
|
ref: "amodal",
|
|
1338
1341
|
tabindex: "-1",
|
|
1339
|
-
onClick: l[0] || (l[0] =
|
|
1342
|
+
onClick: l[0] || (l[0] = We(() => {
|
|
1340
1343
|
}, ["stop"])),
|
|
1341
|
-
onInput: l[1] || (l[1] =
|
|
1344
|
+
onInput: l[1] || (l[1] = We(() => {
|
|
1342
1345
|
}, ["stop"])),
|
|
1343
1346
|
style: q(i.value)
|
|
1344
1347
|
}, [
|
|
1345
1348
|
z(c.$slots, "default")
|
|
1346
1349
|
], 36));
|
|
1347
1350
|
}
|
|
1348
|
-
}),
|
|
1349
|
-
const t = e.id ||
|
|
1350
|
-
return
|
|
1351
|
+
}), yn = (e) => {
|
|
1352
|
+
const t = e.id || jt();
|
|
1353
|
+
return ht(`table-${t}`, () => {
|
|
1351
1354
|
const o = () => {
|
|
1352
1355
|
const g = {};
|
|
1353
1356
|
for (const [w, A] of c.value.entries())
|
|
1354
|
-
for (const [
|
|
1355
|
-
g[`${w}:${
|
|
1357
|
+
for (const [O, D] of l.value.entries())
|
|
1358
|
+
g[`${w}:${O}`] = D[A.name];
|
|
1356
1359
|
return g;
|
|
1357
1360
|
}, i = (g) => {
|
|
1358
1361
|
const w = [Object.assign({}, { rowModified: !1 })];
|
|
1359
1362
|
if (g && "0:0" in g)
|
|
1360
1363
|
return g;
|
|
1361
1364
|
const A = /* @__PURE__ */ new Set();
|
|
1362
|
-
for (let
|
|
1363
|
-
const D = l.value[
|
|
1364
|
-
D.parent && A.add(D.parent), w[
|
|
1365
|
+
for (let O = l.value.length - 1; O >= 0; O--) {
|
|
1366
|
+
const D = l.value[O];
|
|
1367
|
+
D.parent && A.add(D.parent), w[O] = {
|
|
1365
1368
|
childrenOpen: !1,
|
|
1366
1369
|
expanded: !1,
|
|
1367
1370
|
indent: D.indent || 0,
|
|
1368
|
-
isParent: A.has(
|
|
1371
|
+
isParent: A.has(O),
|
|
1369
1372
|
isRoot: D.parent === null || D.parent === void 0,
|
|
1370
1373
|
rowModified: !1,
|
|
1371
1374
|
open: D.parent === null || D.parent === void 0,
|
|
@@ -1373,14 +1376,14 @@ const hn = { key: 0 }, gn = {
|
|
|
1373
1376
|
};
|
|
1374
1377
|
}
|
|
1375
1378
|
return w;
|
|
1376
|
-
}, c =
|
|
1379
|
+
}, c = P(e.columns), l = P(e.rows), a = P(e.config || {}), u = P(e.table || o()), r = P(i(e.display)), s = P(e.modal || { visible: !1 }), v = P({}), m = I(() => c.value.some((g) => g.pinned)), y = I(() => `${Math.ceil(l.value.length / 100 + 1)}ch`), h = I(
|
|
1377
1380
|
() => a.value.view ? ["list", "tree", "list-expansion"].includes(a.value.view) : !1
|
|
1378
1381
|
), x = (g, w) => u.value[`${g}:${w}`], f = (g, w, A) => {
|
|
1379
|
-
const
|
|
1380
|
-
u.value[
|
|
1382
|
+
const O = `${g}:${w}`, D = c.value[g];
|
|
1383
|
+
u.value[O] !== A && (r.value[w].rowModified = !0), u.value[O] = A, l.value[w][D.name] = A;
|
|
1381
1384
|
}, d = (g, w, A) => {
|
|
1382
|
-
const
|
|
1383
|
-
u.value[
|
|
1385
|
+
const O = `${g}:${w}`;
|
|
1386
|
+
u.value[O] !== A && (r.value[w].rowModified = !0, v.value[O] = A);
|
|
1384
1387
|
}, p = (g) => {
|
|
1385
1388
|
const w = c.value.indexOf(g) === c.value.length - 1, A = a.value.fullWidth ? g.resizable && !w : g.resizable;
|
|
1386
1389
|
return {
|
|
@@ -1392,17 +1395,17 @@ const hn = { key: 0 }, gn = {
|
|
|
1392
1395
|
whiteSpace: "nowrap"
|
|
1393
1396
|
}
|
|
1394
1397
|
};
|
|
1395
|
-
},
|
|
1398
|
+
}, M = (g, w) => {
|
|
1396
1399
|
if (g < 0 || g >= c.value.length) return;
|
|
1397
|
-
const
|
|
1400
|
+
const O = Math.max(w, 40);
|
|
1398
1401
|
c.value[g] = {
|
|
1399
1402
|
...c.value[g],
|
|
1400
|
-
width: `${
|
|
1403
|
+
width: `${O}px`
|
|
1401
1404
|
};
|
|
1402
1405
|
}, $ = (g) => {
|
|
1403
1406
|
const w = l.value[g];
|
|
1404
1407
|
return a.value.view === "gantt" && w.indent === 0;
|
|
1405
|
-
}, k = (g) => a.value.view !== "tree" || r.value[g].isRoot || r.value[g].open,
|
|
1408
|
+
}, k = (g) => a.value.view !== "tree" || r.value[g].isRoot || r.value[g].open, ae = (g) => a.value.view !== "tree" ? "" : r.value[g].isRoot || r.value[g].isParent ? r.value[g].childrenOpen ? "-" : "+" : "", C = (g) => {
|
|
1406
1409
|
if (a.value.view === "tree") {
|
|
1407
1410
|
r.value[g].childrenOpen = !r.value[g].childrenOpen;
|
|
1408
1411
|
for (let w = l.value.length - 1; w >= 0; w--)
|
|
@@ -1410,10 +1413,10 @@ const hn = { key: 0 }, gn = {
|
|
|
1410
1413
|
} else a.value.view === "list-expansion" && (r.value[g].expanded = !r.value[g].expanded);
|
|
1411
1414
|
}, T = (g, w) => {
|
|
1412
1415
|
const A = x(g, w);
|
|
1413
|
-
return
|
|
1414
|
-
},
|
|
1415
|
-
const
|
|
1416
|
-
return
|
|
1416
|
+
return H(g, w, A);
|
|
1417
|
+
}, H = (g, w, A) => {
|
|
1418
|
+
const O = c.value[g], D = l.value[w], se = O.format;
|
|
1419
|
+
return se ? typeof se == "function" ? se(A, { table: u.value, row: D, column: O }) : typeof se == "string" ? Function(`"use strict";return (${se})`)()(A, { table: u.value, row: D, column: O }) : A : A;
|
|
1417
1420
|
};
|
|
1418
1421
|
return {
|
|
1419
1422
|
// state
|
|
@@ -1435,11 +1438,11 @@ const hn = { key: 0 }, gn = {
|
|
|
1435
1438
|
},
|
|
1436
1439
|
getCellData: x,
|
|
1437
1440
|
getCellDisplayValue: T,
|
|
1438
|
-
getFormattedValue:
|
|
1441
|
+
getFormattedValue: H,
|
|
1439
1442
|
getHeaderCellStyle: p,
|
|
1440
|
-
resizeColumn:
|
|
1443
|
+
resizeColumn: M,
|
|
1441
1444
|
getIndent: (g, w) => w && g === 0 && w > 0 ? `${w}ch` : "inherit",
|
|
1442
|
-
getRowExpandSymbol:
|
|
1445
|
+
getRowExpandSymbol: ae,
|
|
1443
1446
|
isRowGantt: $,
|
|
1444
1447
|
isRowVisible: k,
|
|
1445
1448
|
setCellData: f,
|
|
@@ -1452,7 +1455,7 @@ const hn = { key: 0 }, gn = {
|
|
|
1452
1455
|
}
|
|
1453
1456
|
};
|
|
1454
1457
|
})();
|
|
1455
|
-
},
|
|
1458
|
+
}, bn = /* @__PURE__ */ Z({
|
|
1456
1459
|
__name: "ATable",
|
|
1457
1460
|
props: {
|
|
1458
1461
|
id: {},
|
|
@@ -1463,7 +1466,7 @@ const hn = { key: 0 }, gn = {
|
|
|
1463
1466
|
},
|
|
1464
1467
|
emits: ["update:modelValue", "cellUpdate", "gantt:drag"],
|
|
1465
1468
|
setup(e, { expose: t, emit: n }) {
|
|
1466
|
-
const o = n, i = N("table"), c = e.modelValue ? e.modelValue : e.rows, l =
|
|
1469
|
+
const o = n, i = N("table"), c = e.modelValue ? e.modelValue : e.rows, l = yn({ columns: e.columns, rows: c, id: e.id, config: e.config });
|
|
1467
1470
|
l.$onAction(({ name: s, store: v, args: m, after: y }) => {
|
|
1468
1471
|
if (s === "setCellData" || s === "setCellText") {
|
|
1469
1472
|
const [h, x, f] = m, d = v.getCellData(h, x);
|
|
@@ -1484,7 +1487,7 @@ const hn = { key: 0 }, gn = {
|
|
|
1484
1487
|
},
|
|
1485
1488
|
{ deep: !0 }
|
|
1486
1489
|
), Q(() => {
|
|
1487
|
-
e.columns.some((s) => s.pinned) && (u(), l.config.view === "tree" &&
|
|
1490
|
+
e.columns.some((s) => s.pinned) && (u(), l.config.view === "tree" && nt(i, u, { childList: !0, subtree: !0 }));
|
|
1488
1491
|
});
|
|
1489
1492
|
const a = I(() => l.columns.filter((s) => s.pinned).length), u = () => {
|
|
1490
1493
|
const s = i.value, v = s == null ? void 0 : s.rows[0], m = s == null ? void 0 : s.rows[1], y = v ? Array.from(v.cells) : [];
|
|
@@ -1504,7 +1507,7 @@ const hn = { key: 0 }, gn = {
|
|
|
1504
1507
|
if (s.key === "Escape" && l.modal.visible) {
|
|
1505
1508
|
l.modal.visible = !1;
|
|
1506
1509
|
const v = l.modal.parent;
|
|
1507
|
-
v &&
|
|
1510
|
+
v && Qe().then(() => {
|
|
1508
1511
|
v.focus();
|
|
1509
1512
|
});
|
|
1510
1513
|
}
|
|
@@ -1527,7 +1530,7 @@ const hn = { key: 0 }, gn = {
|
|
|
1527
1530
|
// TODO: refactor to API that can detect when data exists in a cell. Might have be custom and not generalizable
|
|
1528
1531
|
}), m;
|
|
1529
1532
|
};
|
|
1530
|
-
return t({ store: l }), (s, v) => he((
|
|
1533
|
+
return t({ store: l }), (s, v) => he((S(), R("table", {
|
|
1531
1534
|
ref: "table",
|
|
1532
1535
|
class: "atable",
|
|
1533
1536
|
style: q({
|
|
@@ -1535,26 +1538,26 @@ const hn = { key: 0 }, gn = {
|
|
|
1535
1538
|
})
|
|
1536
1539
|
}, [
|
|
1537
1540
|
z(s.$slots, "header", { data: b(l) }, () => [
|
|
1538
|
-
|
|
1541
|
+
He(at, {
|
|
1539
1542
|
columns: b(l).columns,
|
|
1540
1543
|
store: b(l)
|
|
1541
1544
|
}, null, 8, ["columns", "store"])
|
|
1542
1545
|
], !0),
|
|
1543
1546
|
L("tbody", null, [
|
|
1544
1547
|
z(s.$slots, "body", { data: b(l) }, () => [
|
|
1545
|
-
(
|
|
1548
|
+
(S(!0), R(ie, null, ke(b(l).rows, (m, y) => (S(), re(ot, {
|
|
1546
1549
|
key: m.id,
|
|
1547
1550
|
row: m,
|
|
1548
1551
|
rowIndex: y,
|
|
1549
1552
|
store: b(l)
|
|
1550
1553
|
}, {
|
|
1551
|
-
default:
|
|
1552
|
-
(
|
|
1554
|
+
default: ze(() => [
|
|
1555
|
+
(S(!0), R(ie, null, ke(r(m), (h, x) => {
|
|
1553
1556
|
var f, d, p;
|
|
1554
|
-
return
|
|
1557
|
+
return S(), R(ie, {
|
|
1555
1558
|
key: h.name
|
|
1556
1559
|
}, [
|
|
1557
|
-
h.isGantt ? (
|
|
1560
|
+
h.isGantt ? (S(), re(fe(h.ganttComponent || "AGanttCell"), {
|
|
1558
1561
|
key: 0,
|
|
1559
1562
|
store: b(l),
|
|
1560
1563
|
columnsCount: b(l).columns.length - a.value,
|
|
@@ -1570,7 +1573,7 @@ const hn = { key: 0 }, gn = {
|
|
|
1570
1573
|
minWidth: (h == null ? void 0 : h.width) || "40ch",
|
|
1571
1574
|
width: b(l).config.fullWidth ? "auto" : null
|
|
1572
1575
|
})
|
|
1573
|
-
}, null, 8, ["store", "columnsCount", "color", "start", "end", "colspan", "pinned", "rowIndex", "colIndex", "style"])) : (
|
|
1576
|
+
}, null, 8, ["store", "columnsCount", "color", "start", "end", "colspan", "pinned", "rowIndex", "colIndex", "style"])) : (S(), re(fe(h.cellComponent || "ACell"), {
|
|
1574
1577
|
key: 1,
|
|
1575
1578
|
store: b(l),
|
|
1576
1579
|
pinned: h.pinned,
|
|
@@ -1591,9 +1594,9 @@ const hn = { key: 0 }, gn = {
|
|
|
1591
1594
|
]),
|
|
1592
1595
|
z(s.$slots, "footer", { data: b(l) }, void 0, !0),
|
|
1593
1596
|
z(s.$slots, "modal", { data: b(l) }, () => [
|
|
1594
|
-
he(
|
|
1595
|
-
default:
|
|
1596
|
-
(
|
|
1597
|
+
he(He(st, { store: b(l) }, {
|
|
1598
|
+
default: ze(() => [
|
|
1599
|
+
(S(), re(fe(b(l).modal.component), Se({
|
|
1597
1600
|
key: `${b(l).modal.rowIndex}:${b(l).modal.colIndex}`,
|
|
1598
1601
|
colIndex: b(l).modal.colIndex,
|
|
1599
1602
|
rowIndex: b(l).modal.rowIndex,
|
|
@@ -1602,46 +1605,46 @@ const hn = { key: 0 }, gn = {
|
|
|
1602
1605
|
]),
|
|
1603
1606
|
_: 1
|
|
1604
1607
|
}, 8, ["store"]), [
|
|
1605
|
-
[
|
|
1608
|
+
[Ke, b(l).modal.visible]
|
|
1606
1609
|
])
|
|
1607
1610
|
], !0)
|
|
1608
1611
|
], 4)), [
|
|
1609
|
-
[b(
|
|
1612
|
+
[b(un), b(l).closeModal]
|
|
1610
1613
|
]);
|
|
1611
1614
|
}
|
|
1612
|
-
}),
|
|
1613
|
-
function
|
|
1614
|
-
return
|
|
1615
|
-
L("h2",
|
|
1615
|
+
}), xn = /* @__PURE__ */ le(bn, [["__scopeId", "data-v-785e5fa3"]]), Cn = {}, En = { class: "aloading" }, In = { class: "aloading-header" };
|
|
1616
|
+
function kn(e, t) {
|
|
1617
|
+
return S(), R("div", En, [
|
|
1618
|
+
L("h2", In, [
|
|
1616
1619
|
z(e.$slots, "default", {}, void 0, !0)
|
|
1617
1620
|
]),
|
|
1618
1621
|
t[0] || (t[0] = L("div", { class: "aloading-bar" }, null, -1))
|
|
1619
1622
|
]);
|
|
1620
1623
|
}
|
|
1621
|
-
const
|
|
1622
|
-
function
|
|
1623
|
-
return
|
|
1624
|
-
L("h2",
|
|
1624
|
+
const Mn = /* @__PURE__ */ le(Cn, [["render", kn], ["__scopeId", "data-v-a930a25b"]]), Sn = {}, $n = { class: "aloading" }, An = { class: "aloading-header" };
|
|
1625
|
+
function Rn(e, t) {
|
|
1626
|
+
return S(), R("div", $n, [
|
|
1627
|
+
L("h2", An, [
|
|
1625
1628
|
z(e.$slots, "default", {}, void 0, !0)
|
|
1626
1629
|
]),
|
|
1627
1630
|
t[0] || (t[0] = L("div", { class: "aloading-bar" }, null, -1))
|
|
1628
1631
|
]);
|
|
1629
1632
|
}
|
|
1630
|
-
const
|
|
1631
|
-
function
|
|
1632
|
-
e.component("ACell",
|
|
1633
|
+
const Tn = /* @__PURE__ */ le(Sn, [["render", Rn], ["__scopeId", "data-v-e1165876"]]);
|
|
1634
|
+
function Dn(e) {
|
|
1635
|
+
e.component("ACell", Jt), e.component("AExpansionRow", en), e.component("AGanttCell", an), e.component("ARow", ot), e.component("ATable", xn), e.component("ATableHeader", at), e.component("ATableLoading", Mn), e.component("ATableLoadingBar", Tn), e.component("ATableModal", st);
|
|
1633
1636
|
}
|
|
1634
1637
|
export {
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1638
|
+
Jt as ACell,
|
|
1639
|
+
en as AExpansionRow,
|
|
1640
|
+
an as AGanttCell,
|
|
1641
|
+
ot as ARow,
|
|
1642
|
+
xn as ATable,
|
|
1643
|
+
at as ATableHeader,
|
|
1644
|
+
Mn as ATableLoading,
|
|
1645
|
+
Tn as ATableLoadingBar,
|
|
1646
|
+
st as ATableModal,
|
|
1647
|
+
yn as createTableStore,
|
|
1648
|
+
Dn as install
|
|
1646
1649
|
};
|
|
1647
1650
|
//# sourceMappingURL=atable.js.map
|