@stonecrop/atable 0.4.31 → 0.4.33
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.js +749 -701
- 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/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/package.json +7 -3
- package/src/components/ACell.vue +100 -2
- package/src/index.ts +1 -15
package/dist/atable.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { onMounted as
|
|
2
|
-
import { defineStore as
|
|
3
|
-
import './assets/index.css';function
|
|
4
|
-
return
|
|
1
|
+
import { onMounted as se, ref as B, watch as V, onBeforeUnmount as At, computed as A, shallowRef as G, toValue as R, watchEffect as Tt, getCurrentScope as pt, onScopeDispose as wt, unref as $, getCurrentInstance as Re, nextTick as Xe, isRef as Dt, toRefs as Ot, customRef as yt, toRef as Ht, readonly as Pt, defineComponent as te, useTemplateRef as U, createElementBlock as H, openBlock as M, normalizeClass as q, normalizeStyle as ee, createBlock as ie, resolveDynamicComponent as Ee, mergeProps as Ge, toDisplayString as ce, Fragment as le, createElementVNode as z, createCommentVNode as J, renderSlot as j, useCssVars as Lt, onUnmounted as Bt, withModifiers as $e, withDirectives as Se, vShow as xt, renderList as he, createTextVNode as Wt, mergeModels as lt, useModel as at, createVNode as st, withCtx as rt } from "vue";
|
|
2
|
+
import { defineStore as zt } from "pinia";
|
|
3
|
+
import './assets/index.css';function Fe(e) {
|
|
4
|
+
return pt() ? (wt(e), !0) : !1;
|
|
5
5
|
}
|
|
6
|
-
const
|
|
6
|
+
const Nt = typeof window < "u" && typeof document < "u";
|
|
7
7
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
8
|
-
const
|
|
8
|
+
const Xt = (e) => e != null, Gt = Object.prototype.toString, Ft = (e) => Gt.call(e) === "[object Object]", Vt = () => {
|
|
9
9
|
};
|
|
10
|
-
function
|
|
10
|
+
function Ie(e) {
|
|
11
11
|
return Array.isArray(e) ? e : [e];
|
|
12
12
|
}
|
|
13
13
|
function Yt(e, t, o) {
|
|
@@ -20,37 +20,37 @@ function Yt(e, t, o) {
|
|
|
20
20
|
}
|
|
21
21
|
);
|
|
22
22
|
}
|
|
23
|
-
const
|
|
24
|
-
function
|
|
23
|
+
const fe = Nt ? window : void 0;
|
|
24
|
+
function ue(e) {
|
|
25
25
|
var t;
|
|
26
|
-
const o =
|
|
26
|
+
const o = R(e);
|
|
27
27
|
return (t = o?.$el) != null ? t : o;
|
|
28
28
|
}
|
|
29
29
|
function pe(...e) {
|
|
30
30
|
const t = [], o = () => {
|
|
31
31
|
t.forEach((n) => n()), t.length = 0;
|
|
32
|
-
}, s = (n, l, d, f) => (n.addEventListener(l, d, f), () => n.removeEventListener(l, d, f)), i =
|
|
33
|
-
const n =
|
|
32
|
+
}, s = (n, l, d, f) => (n.addEventListener(l, d, f), () => n.removeEventListener(l, d, f)), i = A(() => {
|
|
33
|
+
const n = Ie(R(e[0])).filter((l) => l != null);
|
|
34
34
|
return n.every((l) => typeof l != "string") ? n : void 0;
|
|
35
35
|
}), c = Yt(
|
|
36
36
|
() => {
|
|
37
37
|
var n, l;
|
|
38
38
|
return [
|
|
39
|
-
(l = (n = i.value) == null ? void 0 : n.map((d) =>
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
(l = (n = i.value) == null ? void 0 : n.map((d) => ue(d))) != null ? l : [fe].filter((d) => d != null),
|
|
40
|
+
Ie(R(i.value ? e[1] : e[0])),
|
|
41
|
+
Ie($(i.value ? e[2] : e[1])),
|
|
42
42
|
// @ts-expect-error - TypeScript gets the correct types, but somehow still complains
|
|
43
|
-
|
|
43
|
+
R(i.value ? e[3] : e[2])
|
|
44
44
|
];
|
|
45
45
|
},
|
|
46
46
|
([n, l, d, f]) => {
|
|
47
47
|
if (o(), !n?.length || !l?.length || !d?.length)
|
|
48
48
|
return;
|
|
49
|
-
const
|
|
49
|
+
const p = Ft(f) ? { ...f } : f;
|
|
50
50
|
t.push(
|
|
51
51
|
...n.flatMap(
|
|
52
|
-
(
|
|
53
|
-
(m) => d.map((
|
|
52
|
+
(x) => l.flatMap(
|
|
53
|
+
(m) => d.map((I) => s(x, m, I, p))
|
|
54
54
|
)
|
|
55
55
|
)
|
|
56
56
|
);
|
|
@@ -59,61 +59,61 @@ function pe(...e) {
|
|
|
59
59
|
), r = () => {
|
|
60
60
|
c(), o();
|
|
61
61
|
};
|
|
62
|
-
return
|
|
62
|
+
return Fe(o), r;
|
|
63
63
|
}
|
|
64
64
|
// @__NO_SIDE_EFFECTS__
|
|
65
65
|
function jt() {
|
|
66
|
-
const e = G(!1), t =
|
|
67
|
-
return t &&
|
|
66
|
+
const e = G(!1), t = Re();
|
|
67
|
+
return t && se(() => {
|
|
68
68
|
e.value = !0;
|
|
69
69
|
}, t), e;
|
|
70
70
|
}
|
|
71
71
|
// @__NO_SIDE_EFFECTS__
|
|
72
72
|
function Ut(e) {
|
|
73
73
|
const t = /* @__PURE__ */ jt();
|
|
74
|
-
return
|
|
74
|
+
return A(() => (t.value, !!e()));
|
|
75
75
|
}
|
|
76
76
|
function qt(e, t, o = {}) {
|
|
77
|
-
const { window: s =
|
|
77
|
+
const { window: s = fe, ...i } = o;
|
|
78
78
|
let c;
|
|
79
79
|
const r = /* @__PURE__ */ Ut(() => s && "MutationObserver" in s), n = () => {
|
|
80
80
|
c && (c.disconnect(), c = void 0);
|
|
81
|
-
}, l =
|
|
82
|
-
const
|
|
81
|
+
}, l = A(() => {
|
|
82
|
+
const x = R(e), m = Ie(x).map(ue).filter(Xt);
|
|
83
83
|
return new Set(m);
|
|
84
84
|
}), d = V(
|
|
85
85
|
() => l.value,
|
|
86
|
-
(
|
|
87
|
-
n(), r.value &&
|
|
86
|
+
(x) => {
|
|
87
|
+
n(), r.value && x.size && (c = new MutationObserver(t), x.forEach((m) => c.observe(m, i)));
|
|
88
88
|
},
|
|
89
89
|
{ immediate: !0, flush: "post" }
|
|
90
|
-
), f = () => c?.takeRecords(),
|
|
90
|
+
), f = () => c?.takeRecords(), p = () => {
|
|
91
91
|
d(), n();
|
|
92
92
|
};
|
|
93
|
-
return
|
|
93
|
+
return Fe(p), {
|
|
94
94
|
isSupported: r,
|
|
95
|
-
stop:
|
|
95
|
+
stop: p,
|
|
96
96
|
takeRecords: f
|
|
97
97
|
};
|
|
98
98
|
}
|
|
99
99
|
function Jt(e, t, o = {}) {
|
|
100
100
|
const {
|
|
101
|
-
window: s =
|
|
101
|
+
window: s = fe,
|
|
102
102
|
document: i = s?.document,
|
|
103
103
|
flush: c = "sync"
|
|
104
104
|
} = o;
|
|
105
105
|
if (!s || !i)
|
|
106
|
-
return
|
|
106
|
+
return Vt;
|
|
107
107
|
let r;
|
|
108
108
|
const n = (f) => {
|
|
109
109
|
r?.(), r = f;
|
|
110
|
-
}, l =
|
|
111
|
-
const f =
|
|
110
|
+
}, l = Tt(() => {
|
|
111
|
+
const f = ue(e);
|
|
112
112
|
if (f) {
|
|
113
|
-
const { stop:
|
|
113
|
+
const { stop: p } = qt(
|
|
114
114
|
i,
|
|
115
|
-
(
|
|
116
|
-
|
|
115
|
+
(x) => {
|
|
116
|
+
x.map((m) => [...m.removedNodes]).flat().some((m) => m === f || m.contains(f)) && t(x);
|
|
117
117
|
},
|
|
118
118
|
{
|
|
119
119
|
window: s,
|
|
@@ -121,18 +121,18 @@ function Jt(e, t, o = {}) {
|
|
|
121
121
|
subtree: !0
|
|
122
122
|
}
|
|
123
123
|
);
|
|
124
|
-
n(
|
|
124
|
+
n(p);
|
|
125
125
|
}
|
|
126
126
|
}, { flush: c }), d = () => {
|
|
127
127
|
l(), n();
|
|
128
128
|
};
|
|
129
|
-
return
|
|
129
|
+
return Fe(d), d;
|
|
130
130
|
}
|
|
131
131
|
// @__NO_SIDE_EFFECTS__
|
|
132
132
|
function Zt(e = {}) {
|
|
133
133
|
var t;
|
|
134
134
|
const {
|
|
135
|
-
window: o =
|
|
135
|
+
window: o = fe,
|
|
136
136
|
deep: s = !0,
|
|
137
137
|
triggerOnRemoval: i = !1
|
|
138
138
|
} = e, c = (t = e.document) != null ? t : o?.document, r = () => {
|
|
@@ -168,7 +168,7 @@ function Zt(e = {}) {
|
|
|
168
168
|
}
|
|
169
169
|
const Qt = "focusin", Kt = "focusout", _t = ":focus-within";
|
|
170
170
|
function en(e, t = {}) {
|
|
171
|
-
const { window: o =
|
|
171
|
+
const { window: o = fe } = t, s = A(() => ue(e)), i = G(!1), c = A(() => i.value);
|
|
172
172
|
if (!o || !(/* @__PURE__ */ Zt(t)).value)
|
|
173
173
|
return { focused: c };
|
|
174
174
|
const r = { passive: !0 };
|
|
@@ -177,10 +177,10 @@ function en(e, t = {}) {
|
|
|
177
177
|
return i.value = (d = (l = (n = s.value) == null ? void 0 : n.matches) == null ? void 0 : l.call(n, _t)) != null ? d : !1;
|
|
178
178
|
}, r), { focused: c };
|
|
179
179
|
}
|
|
180
|
-
function tn(e, { window: t =
|
|
181
|
-
const s =
|
|
180
|
+
function tn(e, { window: t = fe, scrollTarget: o } = {}) {
|
|
181
|
+
const s = B(!1), i = () => {
|
|
182
182
|
if (!t) return;
|
|
183
|
-
const c = t.document, r =
|
|
183
|
+
const c = t.document, r = ue(e);
|
|
184
184
|
if (!r)
|
|
185
185
|
s.value = !1;
|
|
186
186
|
else {
|
|
@@ -189,7 +189,7 @@ function tn(e, { window: t = de, scrollTarget: o } = {}) {
|
|
|
189
189
|
}
|
|
190
190
|
};
|
|
191
191
|
return V(
|
|
192
|
-
() =>
|
|
192
|
+
() => ue(e),
|
|
193
193
|
() => i(),
|
|
194
194
|
{ immediate: !0, flush: "post" }
|
|
195
195
|
), t && pe(o || t, "scroll", i, {
|
|
@@ -197,10 +197,10 @@ function tn(e, { window: t = de, scrollTarget: o } = {}) {
|
|
|
197
197
|
passive: !0
|
|
198
198
|
}), s;
|
|
199
199
|
}
|
|
200
|
-
const
|
|
200
|
+
const Q = (e) => {
|
|
201
201
|
let t = tn(e).value;
|
|
202
202
|
return t = t && e.offsetHeight > 0, t;
|
|
203
|
-
},
|
|
203
|
+
}, K = (e) => e.tabIndex >= 0, it = (e) => {
|
|
204
204
|
const t = e.target;
|
|
205
205
|
return Ve(t);
|
|
206
206
|
}, Ve = (e) => {
|
|
@@ -215,7 +215,7 @@ const Z = (e) => {
|
|
|
215
215
|
const o = e.previousElementSibling;
|
|
216
216
|
o && (t = o);
|
|
217
217
|
}
|
|
218
|
-
return t && (!
|
|
218
|
+
return t && (!K(t) || !Q(t)) ? Ve(t) : t;
|
|
219
219
|
}, nn = (e) => {
|
|
220
220
|
const t = e.target;
|
|
221
221
|
let o;
|
|
@@ -232,11 +232,11 @@ const Z = (e) => {
|
|
|
232
232
|
i && (o = i);
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
|
-
return o && (!
|
|
236
|
-
},
|
|
235
|
+
return o && (!K(o) || !Q(o)) ? Ye(o) : o;
|
|
236
|
+
}, ct = (e) => {
|
|
237
237
|
const t = e.target;
|
|
238
|
-
return
|
|
239
|
-
},
|
|
238
|
+
return Ye(t);
|
|
239
|
+
}, Ye = (e) => {
|
|
240
240
|
let t;
|
|
241
241
|
if (e instanceof HTMLTableCellElement) {
|
|
242
242
|
const o = e.parentElement?.nextElementSibling;
|
|
@@ -248,7 +248,7 @@ const Z = (e) => {
|
|
|
248
248
|
const o = e.nextElementSibling;
|
|
249
249
|
o && (t = o);
|
|
250
250
|
}
|
|
251
|
-
return t && (!
|
|
251
|
+
return t && (!K(t) || !Q(t)) ? Ye(t) : t;
|
|
252
252
|
}, on = (e) => {
|
|
253
253
|
const t = e.target;
|
|
254
254
|
let o;
|
|
@@ -265,45 +265,45 @@ const Z = (e) => {
|
|
|
265
265
|
i && (o = i);
|
|
266
266
|
}
|
|
267
267
|
}
|
|
268
|
-
return o && (!
|
|
269
|
-
}, ct = (e) => {
|
|
270
|
-
const t = e.target;
|
|
271
|
-
return Ye(t);
|
|
272
|
-
}, Ye = (e) => {
|
|
273
|
-
let t;
|
|
274
|
-
return e.previousElementSibling ? t = e.previousElementSibling : t = e.parentElement?.previousElementSibling?.lastElementChild, t && (!Q(t) || !Z(t)) ? Ye(t) : t;
|
|
268
|
+
return o && (!K(o) || !Q(o)) ? Ve(o) : o;
|
|
275
269
|
}, ut = (e) => {
|
|
276
270
|
const t = e.target;
|
|
277
271
|
return je(t);
|
|
278
272
|
}, je = (e) => {
|
|
279
273
|
let t;
|
|
280
|
-
return e.
|
|
274
|
+
return e.previousElementSibling ? t = e.previousElementSibling : t = e.parentElement?.previousElementSibling?.lastElementChild, t && (!K(t) || !Q(t)) ? je(t) : t;
|
|
281
275
|
}, dt = (e) => {
|
|
282
|
-
const t = e.target
|
|
283
|
-
return
|
|
276
|
+
const t = e.target;
|
|
277
|
+
return Ue(t);
|
|
278
|
+
}, Ue = (e) => {
|
|
279
|
+
let t;
|
|
280
|
+
return e.nextElementSibling ? t = e.nextElementSibling : t = e.parentElement?.nextElementSibling?.firstElementChild, t && (!K(t) || !Q(t)) ? Ue(t) : t;
|
|
284
281
|
}, ft = (e) => {
|
|
282
|
+
const t = e.target.parentElement?.firstElementChild;
|
|
283
|
+
return t && (!K(t) || !Q(t)) ? Ue(t) : t;
|
|
284
|
+
}, vt = (e) => {
|
|
285
285
|
const t = e.target.parentElement?.lastElementChild;
|
|
286
|
-
return t && (!
|
|
287
|
-
},
|
|
286
|
+
return t && (!K(t) || !Q(t)) ? je(t) : t;
|
|
287
|
+
}, be = ["alt", "control", "shift", "meta"], ln = {
|
|
288
288
|
ArrowUp: "up",
|
|
289
289
|
ArrowDown: "down",
|
|
290
290
|
ArrowLeft: "left",
|
|
291
291
|
ArrowRight: "right"
|
|
292
|
-
},
|
|
292
|
+
}, qe = {
|
|
293
293
|
"keydown.up": (e) => {
|
|
294
|
-
const t =
|
|
294
|
+
const t = it(e);
|
|
295
295
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
296
296
|
},
|
|
297
297
|
"keydown.down": (e) => {
|
|
298
|
-
const t =
|
|
298
|
+
const t = ct(e);
|
|
299
299
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
300
300
|
},
|
|
301
301
|
"keydown.left": (e) => {
|
|
302
|
-
const t =
|
|
302
|
+
const t = ut(e);
|
|
303
303
|
e.preventDefault(), e.stopPropagation(), t && t.focus();
|
|
304
304
|
},
|
|
305
305
|
"keydown.right": (e) => {
|
|
306
|
-
const t =
|
|
306
|
+
const t = dt(e);
|
|
307
307
|
e.preventDefault(), e.stopPropagation(), t && t.focus();
|
|
308
308
|
},
|
|
309
309
|
"keydown.control.up": (e) => {
|
|
@@ -315,45 +315,45 @@ const Z = (e) => {
|
|
|
315
315
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
316
316
|
},
|
|
317
317
|
"keydown.control.left": (e) => {
|
|
318
|
-
const t =
|
|
318
|
+
const t = ft(e);
|
|
319
319
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
320
320
|
},
|
|
321
321
|
"keydown.control.right": (e) => {
|
|
322
|
-
const t =
|
|
322
|
+
const t = vt(e);
|
|
323
323
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
324
324
|
},
|
|
325
325
|
"keydown.end": (e) => {
|
|
326
|
-
const t =
|
|
326
|
+
const t = vt(e);
|
|
327
327
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
328
328
|
},
|
|
329
329
|
"keydown.enter": (e) => {
|
|
330
330
|
if (e.target instanceof HTMLTableCellElement) {
|
|
331
331
|
e.preventDefault(), e.stopPropagation();
|
|
332
|
-
const t =
|
|
332
|
+
const t = ct(e);
|
|
333
333
|
t && t.focus();
|
|
334
334
|
}
|
|
335
335
|
},
|
|
336
336
|
"keydown.shift.enter": (e) => {
|
|
337
337
|
if (e.target instanceof HTMLTableCellElement) {
|
|
338
338
|
e.preventDefault(), e.stopPropagation();
|
|
339
|
-
const t =
|
|
339
|
+
const t = it(e);
|
|
340
340
|
t && t.focus();
|
|
341
341
|
}
|
|
342
342
|
},
|
|
343
343
|
"keydown.home": (e) => {
|
|
344
|
-
const t =
|
|
344
|
+
const t = ft(e);
|
|
345
345
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
346
346
|
},
|
|
347
347
|
"keydown.tab": (e) => {
|
|
348
|
-
const t =
|
|
348
|
+
const t = dt(e);
|
|
349
349
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
350
350
|
},
|
|
351
351
|
"keydown.shift.tab": (e) => {
|
|
352
|
-
const t =
|
|
352
|
+
const t = ut(e);
|
|
353
353
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
354
354
|
}
|
|
355
355
|
};
|
|
356
|
-
function
|
|
356
|
+
function Je(e) {
|
|
357
357
|
const t = (r) => {
|
|
358
358
|
let n = null;
|
|
359
359
|
return r.parent && (typeof r.parent == "string" ? n = document.querySelector(r.parent) : r.parent instanceof HTMLElement ? n = r.parent : n = r.parent.value), n;
|
|
@@ -377,37 +377,37 @@ function qe(e) {
|
|
|
377
377
|
}, s = (r) => {
|
|
378
378
|
const n = t(r);
|
|
379
379
|
let l = [];
|
|
380
|
-
return r.selectors ? l = o(r) : n && (l = Array.from(n.children).filter((d) =>
|
|
380
|
+
return r.selectors ? l = o(r) : n && (l = Array.from(n.children).filter((d) => K(d) && Q(d))), l;
|
|
381
381
|
}, i = (r) => (n) => {
|
|
382
382
|
const l = ln[n.key] || n.key.toLowerCase();
|
|
383
|
-
if (
|
|
384
|
-
const d = r.handlers ||
|
|
383
|
+
if (be.includes(l)) return;
|
|
384
|
+
const d = r.handlers || qe;
|
|
385
385
|
for (const f of Object.keys(d)) {
|
|
386
|
-
const [
|
|
387
|
-
if (
|
|
388
|
-
const m = d[f],
|
|
389
|
-
const
|
|
390
|
-
return n.getModifierState(
|
|
386
|
+
const [p, ...x] = f.split(".");
|
|
387
|
+
if (p === "keydown" && x.includes(l)) {
|
|
388
|
+
const m = d[f], I = x.filter((v) => be.includes(v)), w = be.some((v) => {
|
|
389
|
+
const g = v.charAt(0).toUpperCase() + v.slice(1);
|
|
390
|
+
return n.getModifierState(g);
|
|
391
391
|
});
|
|
392
|
-
if (
|
|
393
|
-
if (
|
|
394
|
-
for (const v of
|
|
395
|
-
if (
|
|
396
|
-
const
|
|
397
|
-
n.getModifierState(
|
|
392
|
+
if (I.length > 0) {
|
|
393
|
+
if (w) {
|
|
394
|
+
for (const v of be)
|
|
395
|
+
if (x.includes(v)) {
|
|
396
|
+
const g = v.charAt(0).toUpperCase() + v.slice(1);
|
|
397
|
+
n.getModifierState(g) && m(n);
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
400
|
} else
|
|
401
|
-
|
|
401
|
+
w || m(n);
|
|
402
402
|
}
|
|
403
403
|
}
|
|
404
404
|
}, c = [];
|
|
405
|
-
|
|
405
|
+
se(() => {
|
|
406
406
|
for (const r of e) {
|
|
407
407
|
const n = t(r), l = s(r), d = i(r), f = n ? [n] : l;
|
|
408
|
-
for (const
|
|
409
|
-
const { focused:
|
|
410
|
-
|
|
408
|
+
for (const p of f) {
|
|
409
|
+
const { focused: x } = en(B(p)), m = V(x, (I) => {
|
|
410
|
+
I ? p.addEventListener("keydown", d) : p.removeEventListener("keydown", d);
|
|
411
411
|
});
|
|
412
412
|
c.push(m);
|
|
413
413
|
}
|
|
@@ -417,22 +417,22 @@ function qe(e) {
|
|
|
417
417
|
r();
|
|
418
418
|
});
|
|
419
419
|
}
|
|
420
|
-
function
|
|
421
|
-
return
|
|
420
|
+
function ve(e) {
|
|
421
|
+
return pt() ? (wt(e), !0) : !1;
|
|
422
422
|
}
|
|
423
|
-
const
|
|
423
|
+
const Me = typeof window < "u" && typeof document < "u";
|
|
424
424
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
425
|
-
const an = (e) => e != null, sn = Object.prototype.toString,
|
|
426
|
-
},
|
|
425
|
+
const an = (e) => e != null, sn = Object.prototype.toString, bt = (e) => sn.call(e) === "[object Object]", Z = () => {
|
|
426
|
+
}, Ne = /* @__PURE__ */ rn();
|
|
427
427
|
function rn() {
|
|
428
428
|
var e, t;
|
|
429
|
-
return
|
|
429
|
+
return Me && ((e = window?.navigator) == null ? void 0 : e.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((t = window?.navigator) == null ? void 0 : t.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window?.navigator.userAgent));
|
|
430
430
|
}
|
|
431
431
|
function cn(...e) {
|
|
432
432
|
if (e.length !== 1)
|
|
433
433
|
return Ht(...e);
|
|
434
434
|
const t = e[0];
|
|
435
|
-
return typeof t == "function" ? Pt(yt(() => ({ get: t, set:
|
|
435
|
+
return typeof t == "function" ? Pt(yt(() => ({ get: t, set: Z }))) : B(t);
|
|
436
436
|
}
|
|
437
437
|
function un(e, t) {
|
|
438
438
|
function o(...s) {
|
|
@@ -443,27 +443,27 @@ function un(e, t) {
|
|
|
443
443
|
return o;
|
|
444
444
|
}
|
|
445
445
|
function dn(e, t = {}) {
|
|
446
|
-
let o, s, i =
|
|
446
|
+
let o, s, i = Z;
|
|
447
447
|
const c = (l) => {
|
|
448
|
-
clearTimeout(l), i(), i =
|
|
448
|
+
clearTimeout(l), i(), i = Z;
|
|
449
449
|
};
|
|
450
450
|
let r;
|
|
451
451
|
return (l) => {
|
|
452
|
-
const d =
|
|
453
|
-
return o && c(o), d <= 0 || f !== void 0 && f <= 0 ? (s && (c(s), s = void 0), Promise.resolve(l())) : new Promise((
|
|
454
|
-
i = t.rejectOnCancel ?
|
|
455
|
-
o && c(o), s = void 0,
|
|
452
|
+
const d = R(e), f = R(t.maxWait);
|
|
453
|
+
return o && c(o), d <= 0 || f !== void 0 && f <= 0 ? (s && (c(s), s = void 0), Promise.resolve(l())) : new Promise((p, x) => {
|
|
454
|
+
i = t.rejectOnCancel ? x : p, r = l, f && !s && (s = setTimeout(() => {
|
|
455
|
+
o && c(o), s = void 0, p(r());
|
|
456
456
|
}, f)), o = setTimeout(() => {
|
|
457
|
-
s && c(s), s = void 0,
|
|
457
|
+
s && c(s), s = void 0, p(l());
|
|
458
458
|
}, d);
|
|
459
459
|
});
|
|
460
460
|
};
|
|
461
461
|
}
|
|
462
|
-
function
|
|
462
|
+
function ae(e) {
|
|
463
463
|
return Array.isArray(e) ? e : [e];
|
|
464
464
|
}
|
|
465
465
|
function fn(e) {
|
|
466
|
-
return
|
|
466
|
+
return Re();
|
|
467
467
|
}
|
|
468
468
|
// @__NO_SIDE_EFFECTS__
|
|
469
469
|
function vn(e, t = 200, o = {}) {
|
|
@@ -473,7 +473,7 @@ function vn(e, t = 200, o = {}) {
|
|
|
473
473
|
);
|
|
474
474
|
}
|
|
475
475
|
function mn(e, t = {}) {
|
|
476
|
-
if (!
|
|
476
|
+
if (!Dt(e))
|
|
477
477
|
return Ot(e);
|
|
478
478
|
const o = Array.isArray(e.value) ? Array.from({ length: e.value.length }) : {};
|
|
479
479
|
for (const s in e.value)
|
|
@@ -483,7 +483,7 @@ function mn(e, t = {}) {
|
|
|
483
483
|
},
|
|
484
484
|
set(i) {
|
|
485
485
|
var c;
|
|
486
|
-
if ((c =
|
|
486
|
+
if ((c = R(t.replaceRef)) != null ? c : !0)
|
|
487
487
|
if (Array.isArray(e.value)) {
|
|
488
488
|
const n = [...e.value];
|
|
489
489
|
n[s] = i, e.value = n;
|
|
@@ -497,8 +497,8 @@ function mn(e, t = {}) {
|
|
|
497
497
|
}));
|
|
498
498
|
return o;
|
|
499
499
|
}
|
|
500
|
-
function
|
|
501
|
-
fn() ?
|
|
500
|
+
function gn(e, t = !0, o) {
|
|
501
|
+
fn() ? se(e, o) : t ? e() : Xe(e);
|
|
502
502
|
}
|
|
503
503
|
function Ct(e, t, o) {
|
|
504
504
|
return V(
|
|
@@ -510,37 +510,37 @@ function Ct(e, t, o) {
|
|
|
510
510
|
}
|
|
511
511
|
);
|
|
512
512
|
}
|
|
513
|
-
const Ae =
|
|
514
|
-
function
|
|
513
|
+
const Ae = Me ? window : void 0;
|
|
514
|
+
function de(e) {
|
|
515
515
|
var t;
|
|
516
|
-
const o =
|
|
516
|
+
const o = R(e);
|
|
517
517
|
return (t = o?.$el) != null ? t : o;
|
|
518
518
|
}
|
|
519
|
-
function
|
|
519
|
+
function ge(...e) {
|
|
520
520
|
const t = [], o = () => {
|
|
521
521
|
t.forEach((n) => n()), t.length = 0;
|
|
522
|
-
}, s = (n, l, d, f) => (n.addEventListener(l, d, f), () => n.removeEventListener(l, d, f)), i =
|
|
523
|
-
const n =
|
|
522
|
+
}, s = (n, l, d, f) => (n.addEventListener(l, d, f), () => n.removeEventListener(l, d, f)), i = A(() => {
|
|
523
|
+
const n = ae(R(e[0])).filter((l) => l != null);
|
|
524
524
|
return n.every((l) => typeof l != "string") ? n : void 0;
|
|
525
525
|
}), c = Ct(
|
|
526
526
|
() => {
|
|
527
527
|
var n, l;
|
|
528
528
|
return [
|
|
529
|
-
(l = (n = i.value) == null ? void 0 : n.map((d) =>
|
|
530
|
-
|
|
531
|
-
|
|
529
|
+
(l = (n = i.value) == null ? void 0 : n.map((d) => de(d))) != null ? l : [Ae].filter((d) => d != null),
|
|
530
|
+
ae(R(i.value ? e[1] : e[0])),
|
|
531
|
+
ae($(i.value ? e[2] : e[1])),
|
|
532
532
|
// @ts-expect-error - TypeScript gets the correct types, but somehow still complains
|
|
533
|
-
|
|
533
|
+
R(i.value ? e[3] : e[2])
|
|
534
534
|
];
|
|
535
535
|
},
|
|
536
536
|
([n, l, d, f]) => {
|
|
537
537
|
if (o(), !n?.length || !l?.length || !d?.length)
|
|
538
538
|
return;
|
|
539
|
-
const
|
|
539
|
+
const p = bt(f) ? { ...f } : f;
|
|
540
540
|
t.push(
|
|
541
541
|
...n.flatMap(
|
|
542
|
-
(
|
|
543
|
-
(m) => d.map((
|
|
542
|
+
(x) => l.flatMap(
|
|
543
|
+
(m) => d.map((I) => s(x, m, I, p))
|
|
544
544
|
)
|
|
545
545
|
)
|
|
546
546
|
);
|
|
@@ -549,40 +549,40 @@ function he(...e) {
|
|
|
549
549
|
), r = () => {
|
|
550
550
|
c(), o();
|
|
551
551
|
};
|
|
552
|
-
return
|
|
552
|
+
return ve(o), r;
|
|
553
553
|
}
|
|
554
554
|
// @__NO_SIDE_EFFECTS__
|
|
555
|
-
function
|
|
556
|
-
const e = G(!1), t =
|
|
557
|
-
return t &&
|
|
555
|
+
function hn() {
|
|
556
|
+
const e = G(!1), t = Re();
|
|
557
|
+
return t && se(() => {
|
|
558
558
|
e.value = !0;
|
|
559
559
|
}, t), e;
|
|
560
560
|
}
|
|
561
561
|
// @__NO_SIDE_EFFECTS__
|
|
562
|
-
function
|
|
563
|
-
const t = /* @__PURE__ */
|
|
564
|
-
return
|
|
562
|
+
function Et(e) {
|
|
563
|
+
const t = /* @__PURE__ */ hn();
|
|
564
|
+
return A(() => (t.value, !!e()));
|
|
565
565
|
}
|
|
566
|
-
function
|
|
566
|
+
function It(e, t, o = {}) {
|
|
567
567
|
const { window: s = Ae, ...i } = o;
|
|
568
568
|
let c;
|
|
569
|
-
const r = /* @__PURE__ */
|
|
569
|
+
const r = /* @__PURE__ */ Et(() => s && "MutationObserver" in s), n = () => {
|
|
570
570
|
c && (c.disconnect(), c = void 0);
|
|
571
|
-
}, l =
|
|
572
|
-
const
|
|
571
|
+
}, l = A(() => {
|
|
572
|
+
const x = R(e), m = ae(x).map(de).filter(an);
|
|
573
573
|
return new Set(m);
|
|
574
574
|
}), d = V(
|
|
575
575
|
() => l.value,
|
|
576
|
-
(
|
|
577
|
-
n(), r.value &&
|
|
576
|
+
(x) => {
|
|
577
|
+
n(), r.value && x.size && (c = new MutationObserver(t), x.forEach((m) => c.observe(m, i)));
|
|
578
578
|
},
|
|
579
579
|
{ immediate: !0, flush: "post" }
|
|
580
|
-
), f = () => c?.takeRecords(),
|
|
580
|
+
), f = () => c?.takeRecords(), p = () => {
|
|
581
581
|
d(), n();
|
|
582
582
|
};
|
|
583
|
-
return
|
|
583
|
+
return ve(p), {
|
|
584
584
|
isSupported: r,
|
|
585
|
-
stop:
|
|
585
|
+
stop: p,
|
|
586
586
|
takeRecords: f
|
|
587
587
|
};
|
|
588
588
|
}
|
|
@@ -597,51 +597,51 @@ function Le(e, t = {}) {
|
|
|
597
597
|
onEnd: l,
|
|
598
598
|
onStart: d,
|
|
599
599
|
initialValue: f,
|
|
600
|
-
axis:
|
|
601
|
-
draggingElement:
|
|
600
|
+
axis: p = "both",
|
|
601
|
+
draggingElement: x = Ae,
|
|
602
602
|
containerElement: m,
|
|
603
|
-
handle:
|
|
604
|
-
buttons:
|
|
605
|
-
} = t, v =
|
|
606
|
-
(o =
|
|
607
|
-
),
|
|
608
|
-
|
|
609
|
-
},
|
|
610
|
-
var
|
|
611
|
-
if (
|
|
603
|
+
handle: I = e,
|
|
604
|
+
buttons: w = [0]
|
|
605
|
+
} = t, v = B(
|
|
606
|
+
(o = R(f)) != null ? o : { x: 0, y: 0 }
|
|
607
|
+
), g = B(), b = (y) => s ? s.includes(y.pointerType) : !0, D = (y) => {
|
|
608
|
+
R(i) && y.preventDefault(), R(c) && y.stopPropagation();
|
|
609
|
+
}, P = (y) => {
|
|
610
|
+
var k;
|
|
611
|
+
if (!R(w).includes(y.button) || R(t.disabled) || !b(y) || R(r) && y.target !== R(e))
|
|
612
612
|
return;
|
|
613
|
-
const
|
|
614
|
-
x:
|
|
615
|
-
y:
|
|
613
|
+
const N = R(m), L = (k = N?.getBoundingClientRect) == null ? void 0 : k.call(N), T = R(e).getBoundingClientRect(), Y = {
|
|
614
|
+
x: y.clientX - (N ? T.left - L.left + N.scrollLeft : T.left),
|
|
615
|
+
y: y.clientY - (N ? T.top - L.top + N.scrollTop : T.top)
|
|
616
616
|
};
|
|
617
|
-
d?.(
|
|
618
|
-
},
|
|
619
|
-
if (
|
|
617
|
+
d?.(Y, y) !== !1 && (g.value = Y, D(y));
|
|
618
|
+
}, F = (y) => {
|
|
619
|
+
if (R(t.disabled) || !b(y) || !g.value)
|
|
620
620
|
return;
|
|
621
|
-
const
|
|
622
|
-
let { x:
|
|
623
|
-
(
|
|
624
|
-
x:
|
|
625
|
-
y:
|
|
626
|
-
}, n?.(v.value,
|
|
627
|
-
},
|
|
628
|
-
|
|
621
|
+
const k = R(m), N = R(e).getBoundingClientRect();
|
|
622
|
+
let { x: L, y: T } = v.value;
|
|
623
|
+
(p === "x" || p === "both") && (L = y.clientX - g.value.x, k && (L = Math.min(Math.max(0, L), k.scrollWidth - N.width))), (p === "y" || p === "both") && (T = y.clientY - g.value.y, k && (T = Math.min(Math.max(0, T), k.scrollHeight - N.height))), v.value = {
|
|
624
|
+
x: L,
|
|
625
|
+
y: T
|
|
626
|
+
}, n?.(v.value, y), D(y);
|
|
627
|
+
}, S = (y) => {
|
|
628
|
+
R(t.disabled) || !b(y) || g.value && (g.value = void 0, l?.(v.value, y), D(y));
|
|
629
629
|
};
|
|
630
|
-
if (
|
|
631
|
-
const
|
|
632
|
-
var
|
|
630
|
+
if (Me) {
|
|
631
|
+
const y = () => {
|
|
632
|
+
var k;
|
|
633
633
|
return {
|
|
634
|
-
capture: (
|
|
635
|
-
passive:
|
|
634
|
+
capture: (k = t.capture) != null ? k : !0,
|
|
635
|
+
passive: !R(i)
|
|
636
636
|
};
|
|
637
637
|
};
|
|
638
|
-
|
|
638
|
+
ge(I, "pointerdown", P, y), ge(x, "pointermove", F, y), ge(x, "pointerup", S, y);
|
|
639
639
|
}
|
|
640
640
|
return {
|
|
641
641
|
...mn(v),
|
|
642
642
|
position: v,
|
|
643
|
-
isDragging:
|
|
644
|
-
style:
|
|
643
|
+
isDragging: A(() => !!g.value),
|
|
644
|
+
style: A(
|
|
645
645
|
() => `left:${v.value.x}px;top:${v.value.y}px;`
|
|
646
646
|
)
|
|
647
647
|
};
|
|
@@ -649,69 +649,69 @@ function Le(e, t = {}) {
|
|
|
649
649
|
function pn(e, t, o = {}) {
|
|
650
650
|
const { window: s = Ae, ...i } = o;
|
|
651
651
|
let c;
|
|
652
|
-
const r = /* @__PURE__ */
|
|
652
|
+
const r = /* @__PURE__ */ Et(() => s && "ResizeObserver" in s), n = () => {
|
|
653
653
|
c && (c.disconnect(), c = void 0);
|
|
654
|
-
}, l =
|
|
655
|
-
const
|
|
656
|
-
return Array.isArray(
|
|
654
|
+
}, l = A(() => {
|
|
655
|
+
const p = R(e);
|
|
656
|
+
return Array.isArray(p) ? p.map((x) => de(x)) : [de(p)];
|
|
657
657
|
}), d = V(
|
|
658
658
|
l,
|
|
659
|
-
(
|
|
659
|
+
(p) => {
|
|
660
660
|
if (n(), r.value && s) {
|
|
661
661
|
c = new ResizeObserver(t);
|
|
662
|
-
for (const
|
|
663
|
-
|
|
662
|
+
for (const x of p)
|
|
663
|
+
x && c.observe(x, i);
|
|
664
664
|
}
|
|
665
665
|
},
|
|
666
666
|
{ immediate: !0, flush: "post" }
|
|
667
667
|
), f = () => {
|
|
668
668
|
n(), d();
|
|
669
669
|
};
|
|
670
|
-
return
|
|
670
|
+
return ve(f), {
|
|
671
671
|
isSupported: r,
|
|
672
672
|
stop: f
|
|
673
673
|
};
|
|
674
674
|
}
|
|
675
|
-
function
|
|
675
|
+
function ne(e, t = {}) {
|
|
676
676
|
const {
|
|
677
677
|
reset: o = !0,
|
|
678
678
|
windowResize: s = !0,
|
|
679
679
|
windowScroll: i = !0,
|
|
680
680
|
immediate: c = !0,
|
|
681
681
|
updateTiming: r = "sync"
|
|
682
|
-
} = t, n = G(0), l = G(0), d = G(0), f = G(0),
|
|
683
|
-
function
|
|
684
|
-
const
|
|
685
|
-
if (!
|
|
686
|
-
o && (n.value = 0, l.value = 0, d.value = 0, f.value = 0,
|
|
682
|
+
} = t, n = G(0), l = G(0), d = G(0), f = G(0), p = G(0), x = G(0), m = G(0), I = G(0);
|
|
683
|
+
function w() {
|
|
684
|
+
const g = de(e);
|
|
685
|
+
if (!g) {
|
|
686
|
+
o && (n.value = 0, l.value = 0, d.value = 0, f.value = 0, p.value = 0, x.value = 0, m.value = 0, I.value = 0);
|
|
687
687
|
return;
|
|
688
688
|
}
|
|
689
|
-
const
|
|
690
|
-
n.value =
|
|
689
|
+
const b = g.getBoundingClientRect();
|
|
690
|
+
n.value = b.height, l.value = b.bottom, d.value = b.left, f.value = b.right, p.value = b.top, x.value = b.width, m.value = b.x, I.value = b.y;
|
|
691
691
|
}
|
|
692
692
|
function v() {
|
|
693
|
-
r === "sync" ?
|
|
693
|
+
r === "sync" ? w() : r === "next-frame" && requestAnimationFrame(() => w());
|
|
694
694
|
}
|
|
695
|
-
return pn(e, v), V(() =>
|
|
695
|
+
return pn(e, v), V(() => de(e), (g) => !g && v()), It(e, v, {
|
|
696
696
|
attributeFilter: ["style", "class"]
|
|
697
|
-
}), i &&
|
|
697
|
+
}), i && ge("scroll", v, { capture: !0, passive: !0 }), s && ge("resize", v, { passive: !0 }), gn(() => {
|
|
698
698
|
c && v();
|
|
699
699
|
}), {
|
|
700
700
|
height: n,
|
|
701
701
|
bottom: l,
|
|
702
702
|
left: d,
|
|
703
703
|
right: f,
|
|
704
|
-
top:
|
|
705
|
-
width:
|
|
704
|
+
top: p,
|
|
705
|
+
width: x,
|
|
706
706
|
x: m,
|
|
707
|
-
y:
|
|
707
|
+
y: I,
|
|
708
708
|
update: v
|
|
709
709
|
};
|
|
710
710
|
}
|
|
711
711
|
const wn = (e) => {
|
|
712
712
|
const t = new DOMParser().parseFromString(e, "text/html");
|
|
713
713
|
return Array.from(t.body.childNodes).some((o) => o.nodeType === 1);
|
|
714
|
-
}, yn = (e = 8) => Array.from({ length: e }, () => Math.floor(Math.random() * 16).toString(16)).join(""),
|
|
714
|
+
}, yn = (e = 8) => Array.from({ length: e }, () => Math.floor(Math.random() * 16).toString(16)).join(""), xn = ["data-colindex", "data-rowindex", "data-editable", "contenteditable", "tabindex"], bn = ["innerHTML"], Cn = { key: 2 }, En = /* @__PURE__ */ te({
|
|
715
715
|
__name: "ACell",
|
|
716
716
|
props: {
|
|
717
717
|
colIndex: {},
|
|
@@ -723,73 +723,121 @@ const wn = (e) => {
|
|
|
723
723
|
debounce: { default: 300 }
|
|
724
724
|
},
|
|
725
725
|
setup(e, { expose: t }) {
|
|
726
|
-
const o =
|
|
726
|
+
const o = U("cell"), s = e.store.getCellData(e.colIndex, e.rowIndex), i = B(""), c = B(!1), r = e.store.columns[e.colIndex], n = e.store.rows[e.rowIndex], l = r.align || "center", d = r.width || "40ch", f = A(() => e.store.getCellDisplayValue(e.colIndex, e.rowIndex)), p = A(() => typeof f.value == "string" ? wn(f.value) : !1), x = A(() => ({
|
|
727
727
|
textAlign: l,
|
|
728
728
|
width: d,
|
|
729
729
|
fontWeight: c.value ? "bold" : "inherit",
|
|
730
730
|
paddingLeft: e.store.getIndent(e.colIndex, e.store.display[e.rowIndex]?.indent)
|
|
731
|
-
})), m =
|
|
731
|
+
})), m = A(() => ({
|
|
732
732
|
"sticky-column": e.pinned,
|
|
733
733
|
"cell-modified": c.value
|
|
734
|
-
})),
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
734
|
+
})), I = () => {
|
|
735
|
+
v(), w();
|
|
736
|
+
}, w = () => {
|
|
737
|
+
const { left: S, bottom: y, width: k, height: N } = ne(o);
|
|
738
|
+
r.mask, r.modalComponent && e.store.$patch((L) => {
|
|
739
|
+
L.modal.visible = !0, L.modal.colIndex = e.colIndex, L.modal.rowIndex = e.rowIndex, L.modal.left = S, L.modal.bottom = y, L.modal.width = k, L.modal.height = N, L.modal.cell = o.value, typeof r.modalComponent == "function" ? L.modal.component = r.modalComponent({ table: L.table, row: n, column: r }) : L.modal.component = r.modalComponent, L.modal.componentProps = r.modalComponentExtraProps;
|
|
738
740
|
});
|
|
739
741
|
};
|
|
740
742
|
if (e.addNavigation) {
|
|
741
|
-
let
|
|
742
|
-
...
|
|
743
|
-
"keydown.f2":
|
|
744
|
-
"keydown.alt.up":
|
|
745
|
-
"keydown.alt.down":
|
|
746
|
-
"keydown.alt.left":
|
|
747
|
-
"keydown.alt.right":
|
|
743
|
+
let S = {
|
|
744
|
+
...qe,
|
|
745
|
+
"keydown.f2": w,
|
|
746
|
+
"keydown.alt.up": w,
|
|
747
|
+
"keydown.alt.down": w,
|
|
748
|
+
"keydown.alt.left": w,
|
|
749
|
+
"keydown.alt.right": w
|
|
748
750
|
};
|
|
749
|
-
typeof e.addNavigation == "object" && (
|
|
750
|
-
...
|
|
751
|
+
typeof e.addNavigation == "object" && (S = {
|
|
752
|
+
...S,
|
|
751
753
|
...e.addNavigation
|
|
752
|
-
}),
|
|
754
|
+
}), Je([
|
|
753
755
|
{
|
|
754
756
|
selectors: o,
|
|
755
|
-
handlers:
|
|
757
|
+
handlers: S
|
|
756
758
|
}
|
|
757
759
|
]);
|
|
758
760
|
}
|
|
759
|
-
const
|
|
760
|
-
o.value &&
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
761
|
+
const v = () => {
|
|
762
|
+
if (o.value && r.edit) {
|
|
763
|
+
const S = window.getSelection();
|
|
764
|
+
if (S)
|
|
765
|
+
try {
|
|
766
|
+
const y = document.createRange();
|
|
767
|
+
y.selectNodeContents && (y.selectNodeContents(o.value), S.removeAllRanges(), S.addRange(y));
|
|
768
|
+
} catch {
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
}, g = () => {
|
|
772
|
+
o.value && (i.value = o.value.textContent, v());
|
|
773
|
+
}, b = () => {
|
|
774
|
+
try {
|
|
775
|
+
const S = window.getSelection();
|
|
776
|
+
if (S && S.rangeCount > 0 && o.value) {
|
|
777
|
+
const y = S.getRangeAt(0), k = y.cloneRange();
|
|
778
|
+
if (k.selectNodeContents && k.setEnd)
|
|
779
|
+
return k.selectNodeContents(o.value), k.setEnd(y.endContainer, y.endOffset), k.toString().length;
|
|
780
|
+
}
|
|
781
|
+
} catch {
|
|
782
|
+
}
|
|
783
|
+
return 0;
|
|
784
|
+
}, D = (S) => {
|
|
785
|
+
if (o.value)
|
|
786
|
+
try {
|
|
787
|
+
const y = window.getSelection();
|
|
788
|
+
if (!y) return;
|
|
789
|
+
let k = 0;
|
|
790
|
+
const N = document.createTreeWalker ? document.createTreeWalker(o.value, NodeFilter.SHOW_TEXT, null) : null;
|
|
791
|
+
if (!N) return;
|
|
792
|
+
let L, T = null;
|
|
793
|
+
for (; L = N.nextNode(); ) {
|
|
794
|
+
const Y = L, _ = k + Y.textContent.length;
|
|
795
|
+
if (S <= _ && (T = document.createRange(), T.setStart && T.setEnd)) {
|
|
796
|
+
T.setStart(Y, S - k), T.setEnd(Y, S - k);
|
|
797
|
+
break;
|
|
798
|
+
}
|
|
799
|
+
k = _;
|
|
800
|
+
}
|
|
801
|
+
T && y.removeAllRanges && y.addRange && (y.removeAllRanges(), y.addRange(T));
|
|
802
|
+
} catch {
|
|
803
|
+
}
|
|
804
|
+
}, P = (S) => {
|
|
805
|
+
const y = S.target;
|
|
806
|
+
if (y.textContent === i.value)
|
|
807
|
+
return;
|
|
808
|
+
const k = b();
|
|
809
|
+
i.value = y.textContent, r.format ? (c.value = y.textContent !== e.store.getFormattedValue(e.colIndex, e.rowIndex, s), e.store.setCellText(e.colIndex, e.rowIndex, y.textContent)) : (c.value = y.textContent !== s, e.store.setCellData(e.colIndex, e.rowIndex, y.textContent)), Xe().then(() => {
|
|
810
|
+
D(k);
|
|
811
|
+
});
|
|
812
|
+
}, F = /* @__PURE__ */ vn(P, e.debounce);
|
|
765
813
|
return t({
|
|
766
814
|
currentData: i
|
|
767
|
-
}), (
|
|
815
|
+
}), (S, y) => (M(), H("td", {
|
|
768
816
|
ref: "cell",
|
|
769
|
-
"data-colindex":
|
|
770
|
-
"data-rowindex":
|
|
771
|
-
"data-editable":
|
|
772
|
-
contenteditable:
|
|
773
|
-
tabindex:
|
|
817
|
+
"data-colindex": S.colIndex,
|
|
818
|
+
"data-rowindex": S.rowIndex,
|
|
819
|
+
"data-editable": $(r).edit,
|
|
820
|
+
contenteditable: $(r).edit,
|
|
821
|
+
tabindex: S.tabIndex,
|
|
774
822
|
spellcheck: !1,
|
|
775
|
-
style:
|
|
776
|
-
onFocus:
|
|
777
|
-
onPaste:
|
|
778
|
-
onInput:
|
|
779
|
-
(...
|
|
780
|
-
onClick:
|
|
781
|
-
class:
|
|
823
|
+
style: ee(x.value),
|
|
824
|
+
onFocus: g,
|
|
825
|
+
onPaste: P,
|
|
826
|
+
onInput: y[0] || (y[0] = //@ts-ignore
|
|
827
|
+
(...k) => $(F) && $(F)(...k)),
|
|
828
|
+
onClick: I,
|
|
829
|
+
class: q(["atable-cell", m.value])
|
|
782
830
|
}, [
|
|
783
|
-
|
|
831
|
+
$(r).cellComponent ? (M(), ie(Ee($(r).cellComponent), Ge({
|
|
784
832
|
key: 0,
|
|
785
833
|
value: f.value
|
|
786
|
-
},
|
|
834
|
+
}, $(r).cellComponentProps), null, 16, ["value"])) : p.value ? (M(), H("span", {
|
|
787
835
|
key: 1,
|
|
788
836
|
innerHTML: f.value
|
|
789
|
-
}, null, 8,
|
|
790
|
-
], 46,
|
|
837
|
+
}, null, 8, bn)) : (M(), H("span", Cn, ce(f.value), 1))
|
|
838
|
+
], 46, xn));
|
|
791
839
|
}
|
|
792
|
-
}),
|
|
840
|
+
}), In = ["tabindex"], kn = ["tabindex"], $n = ["colspan"], Sn = /* @__PURE__ */ te({
|
|
793
841
|
__name: "AExpansionRow",
|
|
794
842
|
props: {
|
|
795
843
|
rowIndex: {},
|
|
@@ -798,21 +846,21 @@ const wn = (e) => {
|
|
|
798
846
|
addNavigation: { type: [Boolean, Object] }
|
|
799
847
|
},
|
|
800
848
|
setup(e) {
|
|
801
|
-
const t =
|
|
849
|
+
const t = U("rowEl"), o = A(() => e.store.display[e.rowIndex].expanded ? "▼" : "►");
|
|
802
850
|
if (e.addNavigation) {
|
|
803
851
|
const s = {
|
|
804
852
|
"keydown.control.g": (i) => {
|
|
805
853
|
i.stopPropagation(), i.preventDefault(), e.store.toggleRowExpand(e.rowIndex);
|
|
806
854
|
}
|
|
807
855
|
};
|
|
808
|
-
typeof e.addNavigation == "object" && Object.assign(s, e.addNavigation),
|
|
856
|
+
typeof e.addNavigation == "object" && Object.assign(s, e.addNavigation), Je([
|
|
809
857
|
{
|
|
810
858
|
selectors: t,
|
|
811
859
|
handlers: s
|
|
812
860
|
}
|
|
813
861
|
]);
|
|
814
862
|
}
|
|
815
|
-
return (s, i) => (M(),
|
|
863
|
+
return (s, i) => (M(), H(le, null, [
|
|
816
864
|
z("tr", Ge(s.$attrs, {
|
|
817
865
|
ref: "rowEl",
|
|
818
866
|
tabindex: s.tabIndex,
|
|
@@ -822,10 +870,10 @@ const wn = (e) => {
|
|
|
822
870
|
tabIndex: -1,
|
|
823
871
|
onClick: i[0] || (i[0] = (c) => s.store.toggleRowExpand(s.rowIndex)),
|
|
824
872
|
class: "row-index"
|
|
825
|
-
},
|
|
826
|
-
|
|
827
|
-
], 16,
|
|
828
|
-
s.store.display[s.rowIndex].expanded ? (M(),
|
|
873
|
+
}, ce(o.value), 1),
|
|
874
|
+
j(s.$slots, "row", {}, void 0, !0)
|
|
875
|
+
], 16, In),
|
|
876
|
+
s.store.display[s.rowIndex].expanded ? (M(), H("tr", {
|
|
829
877
|
key: 0,
|
|
830
878
|
ref: "rowExpanded",
|
|
831
879
|
tabindex: s.tabIndex,
|
|
@@ -836,23 +884,23 @@ const wn = (e) => {
|
|
|
836
884
|
colspan: s.store.columns.length + 1,
|
|
837
885
|
class: "expanded-row-content"
|
|
838
886
|
}, [
|
|
839
|
-
|
|
887
|
+
j(s.$slots, "content", {}, void 0, !0)
|
|
840
888
|
], 8, $n)
|
|
841
|
-
], 8, kn)) :
|
|
889
|
+
], 8, kn)) : J("", !0)
|
|
842
890
|
], 64));
|
|
843
891
|
}
|
|
844
|
-
}),
|
|
892
|
+
}), re = (e, t) => {
|
|
845
893
|
const o = e.__vccOpts || e;
|
|
846
894
|
for (const [s, i] of t)
|
|
847
895
|
o[s] = i;
|
|
848
896
|
return o;
|
|
849
|
-
},
|
|
897
|
+
}, Rn = /* @__PURE__ */ re(Sn, [["__scopeId", "data-v-5ad4bb41"]]), Mn = ["colspan"], An = {
|
|
850
898
|
ref: "container",
|
|
851
899
|
class: "gantt-container"
|
|
852
|
-
},
|
|
900
|
+
}, Tn = ["data-rowindex", "data-colindex"], Dn = {
|
|
853
901
|
key: 2,
|
|
854
902
|
class: "gantt-label"
|
|
855
|
-
}, On = ["x1", "y1", "x2", "y2"], Hn = /* @__PURE__ */
|
|
903
|
+
}, On = ["x1", "y1", "x2", "y2"], Hn = /* @__PURE__ */ te({
|
|
856
904
|
__name: "AGanttCell",
|
|
857
905
|
props: {
|
|
858
906
|
store: {},
|
|
@@ -867,18 +915,18 @@ const wn = (e) => {
|
|
|
867
915
|
},
|
|
868
916
|
emits: ["connection:create"],
|
|
869
917
|
setup(e, { expose: t, emit: o }) {
|
|
870
|
-
Lt((
|
|
918
|
+
Lt((E) => ({
|
|
871
919
|
"17bc2643": i.value,
|
|
872
|
-
"0a8a9192":
|
|
920
|
+
"0a8a9192": E.colspan
|
|
873
921
|
}));
|
|
874
|
-
const s = o, i =
|
|
875
|
-
const
|
|
922
|
+
const s = o, i = B(e.color.length >= 6 ? e.color : "#cccccc"), c = `gantt-bar-row-${e.rowIndex}-col-${e.colIndex}`, r = U("container"), n = U("bar"), l = U("leftResizeHandle"), d = U("rightResizeHandle"), f = U("leftConnectionHandle"), p = U("rightConnectionHandle"), { width: x } = ne(r), { left: m, right: I } = ne(n), w = B(e.start), v = B(e.end || w.value + e.colspan), g = B(!1), b = B(!1), D = B(!1), P = B(!1), F = B(!1), S = B({ startX: 0, startY: 0, endX: 0, endY: 0 }), y = A(() => we.value || Y.value || _.value), k = A(() => e.colspan > 0 ? x.value / e.colspan : 0), N = A(() => {
|
|
923
|
+
const E = w.value / e.colspan * 100, a = v.value / e.colspan * 100;
|
|
876
924
|
return {
|
|
877
|
-
left: `${
|
|
878
|
-
width: `${a -
|
|
925
|
+
left: `${E}%`,
|
|
926
|
+
width: `${a - E}%`,
|
|
879
927
|
backgroundColor: i.value
|
|
880
928
|
};
|
|
881
|
-
}),
|
|
929
|
+
}), L = A(
|
|
882
930
|
() => ({
|
|
883
931
|
position: "fixed",
|
|
884
932
|
top: 0,
|
|
@@ -888,236 +936,236 @@ const wn = (e) => {
|
|
|
888
936
|
pointerEvents: "none",
|
|
889
937
|
zIndex: 1e3
|
|
890
938
|
})
|
|
891
|
-
),
|
|
939
|
+
), T = B({ startX: 0, startPos: 0 }), { isDragging: Y } = Le(l, {
|
|
892
940
|
axis: "x",
|
|
893
|
-
onStart: () => me(m.value,
|
|
894
|
-
onMove: ({ x:
|
|
895
|
-
onEnd: ({ x:
|
|
896
|
-
}), { isDragging:
|
|
941
|
+
onStart: () => me(m.value, w.value),
|
|
942
|
+
onMove: ({ x: E }) => ye(E),
|
|
943
|
+
onEnd: ({ x: E }) => Te(E)
|
|
944
|
+
}), { isDragging: _ } = Le(d, {
|
|
897
945
|
axis: "x",
|
|
898
|
-
onStart: () => me(
|
|
899
|
-
onMove: ({ x:
|
|
900
|
-
onEnd: ({ x:
|
|
946
|
+
onStart: () => me(I.value, v.value),
|
|
947
|
+
onMove: ({ x: E }) => xe(E),
|
|
948
|
+
onEnd: ({ x: E }) => Qe(E)
|
|
901
949
|
}), { isDragging: we } = Le(n, {
|
|
902
950
|
exact: !0,
|
|
903
951
|
axis: "x",
|
|
904
|
-
onStart: () => me(m.value,
|
|
905
|
-
onMove: ({ x:
|
|
906
|
-
onEnd: ({ x:
|
|
952
|
+
onStart: () => me(m.value, w.value),
|
|
953
|
+
onMove: ({ x: E }) => Ke(E),
|
|
954
|
+
onEnd: ({ x: E }) => _e(E)
|
|
907
955
|
});
|
|
908
|
-
|
|
909
|
-
_e();
|
|
910
|
-
}), Bt(() => {
|
|
956
|
+
se(() => {
|
|
911
957
|
et();
|
|
958
|
+
}), Bt(() => {
|
|
959
|
+
tt();
|
|
912
960
|
});
|
|
913
|
-
function me(
|
|
914
|
-
n.value && (n.value.style.transition = "none"),
|
|
961
|
+
function me(E, a) {
|
|
962
|
+
n.value && (n.value.style.transition = "none"), T.value = { startX: E, startPos: a };
|
|
915
963
|
}
|
|
916
|
-
function ye(
|
|
917
|
-
if (!
|
|
918
|
-
const u = (
|
|
919
|
-
n.value.style.left = `${
|
|
964
|
+
function ye(E) {
|
|
965
|
+
if (!Y.value || !n.value) return;
|
|
966
|
+
const u = (E - T.value.startX) / k.value, h = Math.max(0, Math.min(v.value - 1, T.value.startPos + u));
|
|
967
|
+
n.value.style.left = `${h / e.colspan * 100}%`, n.value.style.width = `${(v.value - h) / e.colspan * 100}%`;
|
|
920
968
|
}
|
|
921
|
-
function
|
|
969
|
+
function Te(E) {
|
|
922
970
|
if (!n.value) return;
|
|
923
|
-
const a =
|
|
924
|
-
|
|
971
|
+
const a = E - T.value.startX, u = Math.round(a / k.value), h = w.value, C = Math.max(0, Math.min(v.value - 1, T.value.startPos + u));
|
|
972
|
+
w.value = C, e.store.updateGanttBar({
|
|
925
973
|
rowIndex: e.rowIndex,
|
|
926
974
|
colIndex: e.colIndex,
|
|
927
975
|
type: "resize",
|
|
928
976
|
edge: "start",
|
|
929
|
-
oldStart:
|
|
930
|
-
newStart:
|
|
977
|
+
oldStart: h,
|
|
978
|
+
newStart: C,
|
|
931
979
|
end: v.value,
|
|
932
980
|
delta: u,
|
|
933
|
-
oldColspan: v.value -
|
|
934
|
-
newColspan: v.value -
|
|
981
|
+
oldColspan: v.value - h,
|
|
982
|
+
newColspan: v.value - C
|
|
935
983
|
});
|
|
936
984
|
}
|
|
937
|
-
function
|
|
938
|
-
if (!
|
|
939
|
-
const u = (
|
|
940
|
-
n.value.style.width = `${(
|
|
985
|
+
function xe(E) {
|
|
986
|
+
if (!_.value || !n.value) return;
|
|
987
|
+
const u = (E - T.value.startX) / k.value, h = Math.max(w.value + 1, Math.min(e.columnsCount, T.value.startPos + u));
|
|
988
|
+
n.value.style.width = `${(h - w.value) / e.colspan * 100}%`;
|
|
941
989
|
}
|
|
942
|
-
function
|
|
990
|
+
function Qe(E) {
|
|
943
991
|
if (!n.value) return;
|
|
944
|
-
const a =
|
|
945
|
-
v.value =
|
|
992
|
+
const a = E - T.value.startX, u = Math.round(a / k.value), h = v.value, C = Math.max(w.value + 1, Math.min(e.columnsCount, T.value.startPos + u));
|
|
993
|
+
v.value = C, e.store.updateGanttBar({
|
|
946
994
|
rowIndex: e.rowIndex,
|
|
947
995
|
colIndex: e.colIndex,
|
|
948
996
|
type: "resize",
|
|
949
997
|
edge: "end",
|
|
950
|
-
oldEnd:
|
|
951
|
-
newEnd:
|
|
952
|
-
start:
|
|
998
|
+
oldEnd: h,
|
|
999
|
+
newEnd: C,
|
|
1000
|
+
start: w.value,
|
|
953
1001
|
delta: u,
|
|
954
|
-
oldColspan:
|
|
955
|
-
newColspan:
|
|
1002
|
+
oldColspan: h - w.value,
|
|
1003
|
+
newColspan: C - w.value
|
|
956
1004
|
});
|
|
957
1005
|
}
|
|
958
|
-
function
|
|
1006
|
+
function Ke(E) {
|
|
959
1007
|
if (!we.value || !n.value) return;
|
|
960
|
-
const u = (
|
|
961
|
-
n.value.style.left = `${
|
|
1008
|
+
const u = (E - T.value.startX) / k.value, h = v.value - w.value, C = Math.max(0, Math.min(T.value.startPos + u, e.columnsCount - h));
|
|
1009
|
+
n.value.style.left = `${C / e.colspan * 100}%`;
|
|
962
1010
|
}
|
|
963
|
-
function
|
|
1011
|
+
function _e(E) {
|
|
964
1012
|
if (!n.value) return;
|
|
965
|
-
const a =
|
|
966
|
-
let
|
|
967
|
-
|
|
1013
|
+
const a = E - T.value.startX, u = Math.round(a / k.value), h = v.value - w.value, C = w.value, O = v.value;
|
|
1014
|
+
let W = T.value.startPos + u, X = W + h;
|
|
1015
|
+
W < 0 ? (W = 0, X = h) : X > e.columnsCount && (X = e.columnsCount, W = X - h), w.value = W, v.value = X, e.store.updateGanttBar({
|
|
968
1016
|
rowIndex: e.rowIndex,
|
|
969
1017
|
colIndex: e.colIndex,
|
|
970
1018
|
type: "bar",
|
|
971
|
-
oldStart:
|
|
972
|
-
oldEnd:
|
|
973
|
-
newStart:
|
|
974
|
-
newEnd:
|
|
1019
|
+
oldStart: C,
|
|
1020
|
+
oldEnd: O,
|
|
1021
|
+
newStart: W,
|
|
1022
|
+
newEnd: X,
|
|
975
1023
|
delta: u,
|
|
976
|
-
colspan:
|
|
1024
|
+
colspan: X - W
|
|
977
1025
|
});
|
|
978
1026
|
}
|
|
979
|
-
function
|
|
980
|
-
const { x:
|
|
1027
|
+
function et() {
|
|
1028
|
+
const { x: E, y: a } = ne(n), { x: u, y: h } = ne(f), { x: C, y: O } = ne(p);
|
|
981
1029
|
e.store.registerGanttBar({
|
|
982
1030
|
id: c,
|
|
983
1031
|
rowIndex: e.rowIndex,
|
|
984
1032
|
colIndex: e.colIndex,
|
|
985
|
-
startIndex:
|
|
1033
|
+
startIndex: w,
|
|
986
1034
|
endIndex: v,
|
|
987
1035
|
color: i,
|
|
988
1036
|
label: e.label,
|
|
989
|
-
position: { x:
|
|
1037
|
+
position: { x: E, y: a }
|
|
990
1038
|
}), e.store.isDependencyGraphEnabled && (e.store.registerConnectionHandle({
|
|
991
1039
|
id: `${c}-connection-left`,
|
|
992
1040
|
rowIndex: e.rowIndex,
|
|
993
1041
|
colIndex: e.colIndex,
|
|
994
1042
|
side: "left",
|
|
995
|
-
position: { x: u, y:
|
|
996
|
-
visible:
|
|
1043
|
+
position: { x: u, y: h },
|
|
1044
|
+
visible: g,
|
|
997
1045
|
barId: c
|
|
998
1046
|
}), e.store.registerConnectionHandle({
|
|
999
1047
|
id: `${c}-connection-right`,
|
|
1000
1048
|
rowIndex: e.rowIndex,
|
|
1001
1049
|
colIndex: e.colIndex,
|
|
1002
1050
|
side: "right",
|
|
1003
|
-
position: { x, y:
|
|
1004
|
-
visible:
|
|
1051
|
+
position: { x: C, y: O },
|
|
1052
|
+
visible: b,
|
|
1005
1053
|
barId: c
|
|
1006
1054
|
}));
|
|
1007
1055
|
}
|
|
1008
|
-
function
|
|
1056
|
+
function tt() {
|
|
1009
1057
|
e.store.unregisterGanttBar(c), e.store.isDependencyGraphEnabled && (e.store.unregisterConnectionHandle(`${c}-connection-left`), e.store.unregisterConnectionHandle(`${c}-connection-right`));
|
|
1010
1058
|
}
|
|
1011
|
-
function
|
|
1012
|
-
e.store.isDependencyGraphEnabled && (
|
|
1059
|
+
function nt() {
|
|
1060
|
+
e.store.isDependencyGraphEnabled && (g.value = !0, b.value = !0);
|
|
1013
1061
|
}
|
|
1014
|
-
function
|
|
1015
|
-
!
|
|
1062
|
+
function De() {
|
|
1063
|
+
!D.value && !P.value && (g.value = !1, b.value = !1);
|
|
1016
1064
|
}
|
|
1017
|
-
function Oe(
|
|
1018
|
-
a.preventDefault(), a.stopPropagation(),
|
|
1019
|
-
const u =
|
|
1065
|
+
function Oe(E, a) {
|
|
1066
|
+
a.preventDefault(), a.stopPropagation(), F.value = !0, E === "left" ? D.value = !0 : P.value = !0;
|
|
1067
|
+
const u = E === "left" ? f.value : p.value;
|
|
1020
1068
|
if (u) {
|
|
1021
|
-
const
|
|
1022
|
-
|
|
1069
|
+
const O = u.getBoundingClientRect(), W = O.left + O.width / 2, X = O.top + O.height / 2;
|
|
1070
|
+
S.value = { startX: W, startY: X, endX: W, endY: X };
|
|
1023
1071
|
}
|
|
1024
|
-
const
|
|
1025
|
-
|
|
1026
|
-
},
|
|
1027
|
-
He(
|
|
1072
|
+
const h = (O) => {
|
|
1073
|
+
S.value.endX = O.clientX, S.value.endY = O.clientY;
|
|
1074
|
+
}, C = (O) => {
|
|
1075
|
+
He(O, E), Pe(h, C);
|
|
1028
1076
|
};
|
|
1029
|
-
document.addEventListener("mousemove",
|
|
1077
|
+
document.addEventListener("mousemove", h), document.addEventListener("mouseup", C);
|
|
1030
1078
|
}
|
|
1031
|
-
function He(
|
|
1032
|
-
const
|
|
1033
|
-
if (
|
|
1034
|
-
const
|
|
1035
|
-
if (
|
|
1036
|
-
const
|
|
1079
|
+
function He(E, a) {
|
|
1080
|
+
const h = document.elementFromPoint(E.clientX, E.clientY)?.closest(".connection-handle");
|
|
1081
|
+
if (h && h !== (a === "left" ? f.value : p.value)) {
|
|
1082
|
+
const C = h.closest(".gantt-bar");
|
|
1083
|
+
if (C) {
|
|
1084
|
+
const O = parseInt(C.getAttribute("data-rowindex") || "0"), W = parseInt(C.getAttribute("data-colindex") || "0"), X = h.classList.contains("left-connection-handle") ? "left" : "right", Mt = `gantt-bar-row-${O}-col-${W}`, ot = e.store.createConnection(
|
|
1037
1085
|
`${c}-connection-${a}`,
|
|
1038
|
-
`${
|
|
1086
|
+
`${Mt}-connection-${X}`
|
|
1039
1087
|
);
|
|
1040
|
-
|
|
1088
|
+
ot && s("connection:create", ot);
|
|
1041
1089
|
}
|
|
1042
1090
|
}
|
|
1043
1091
|
}
|
|
1044
|
-
function Pe(
|
|
1045
|
-
|
|
1092
|
+
function Pe(E, a) {
|
|
1093
|
+
F.value = !1, D.value = !1, P.value = !1, document.removeEventListener("mousemove", E), document.removeEventListener("mouseup", a), n.value?.matches(":hover") || De();
|
|
1046
1094
|
}
|
|
1047
1095
|
return t({
|
|
1048
|
-
barStyle:
|
|
1096
|
+
barStyle: N,
|
|
1049
1097
|
cleanupConnectionDrag: Pe,
|
|
1050
1098
|
currentEnd: v,
|
|
1051
1099
|
handleConnectionDrop: He,
|
|
1052
|
-
isLeftConnectionDragging:
|
|
1053
|
-
isLeftConnectionVisible:
|
|
1054
|
-
isRightConnectionDragging:
|
|
1055
|
-
isRightConnectionVisible:
|
|
1056
|
-
showDragPreview:
|
|
1057
|
-
}), (
|
|
1100
|
+
isLeftConnectionDragging: D,
|
|
1101
|
+
isLeftConnectionVisible: g,
|
|
1102
|
+
isRightConnectionDragging: P,
|
|
1103
|
+
isRightConnectionVisible: b,
|
|
1104
|
+
showDragPreview: F
|
|
1105
|
+
}), (E, a) => (M(), H("td", {
|
|
1058
1106
|
class: "aganttcell",
|
|
1059
|
-
colspan:
|
|
1107
|
+
colspan: E.colspan
|
|
1060
1108
|
}, [
|
|
1061
1109
|
z("div", An, [
|
|
1062
1110
|
z("div", {
|
|
1063
1111
|
ref: "bar",
|
|
1064
|
-
"data-rowindex":
|
|
1065
|
-
"data-colindex":
|
|
1066
|
-
class:
|
|
1067
|
-
style:
|
|
1068
|
-
onMouseenter:
|
|
1069
|
-
onMouseleave:
|
|
1112
|
+
"data-rowindex": E.rowIndex,
|
|
1113
|
+
"data-colindex": E.colIndex,
|
|
1114
|
+
class: q(["gantt-bar", { "is-dragging": y.value }]),
|
|
1115
|
+
style: ee(N.value),
|
|
1116
|
+
onMouseenter: nt,
|
|
1117
|
+
onMouseleave: De
|
|
1070
1118
|
}, [
|
|
1071
|
-
|
|
1119
|
+
E.store.isDependencyGraphEnabled ? (M(), H("div", {
|
|
1072
1120
|
key: 0,
|
|
1073
1121
|
ref: "leftConnectionHandle",
|
|
1074
|
-
class:
|
|
1122
|
+
class: q(["connection-handle left-connection-handle", { visible: g.value, "is-dragging": D.value }]),
|
|
1075
1123
|
onMousedown: a[0] || (a[0] = $e((u) => Oe("left", u), ["stop"]))
|
|
1076
1124
|
}, a[2] || (a[2] = [
|
|
1077
1125
|
z("div", { class: "connection-dot" }, null, -1)
|
|
1078
|
-
]), 34)) :
|
|
1079
|
-
|
|
1126
|
+
]), 34)) : J("", !0),
|
|
1127
|
+
E.store.isDependencyGraphEnabled ? (M(), H("div", {
|
|
1080
1128
|
key: 1,
|
|
1081
1129
|
ref: "rightConnectionHandle",
|
|
1082
|
-
class:
|
|
1130
|
+
class: q(["connection-handle right-connection-handle", { visible: b.value, "is-dragging": P.value }]),
|
|
1083
1131
|
onMousedown: a[1] || (a[1] = $e((u) => Oe("right", u), ["stop"]))
|
|
1084
1132
|
}, a[3] || (a[3] = [
|
|
1085
1133
|
z("div", { class: "connection-dot" }, null, -1)
|
|
1086
|
-
]), 34)) :
|
|
1134
|
+
]), 34)) : J("", !0),
|
|
1087
1135
|
z("div", {
|
|
1088
1136
|
ref: "leftResizeHandle",
|
|
1089
|
-
class:
|
|
1137
|
+
class: q(["resize-handle left-resize-handle", { "is-dragging": $(Y) }])
|
|
1090
1138
|
}, a[4] || (a[4] = [
|
|
1091
1139
|
z("div", { class: "handle-grip" }, null, -1),
|
|
1092
1140
|
z("div", { class: "vertical-indicator left-indicator" }, null, -1)
|
|
1093
1141
|
]), 2),
|
|
1094
|
-
|
|
1142
|
+
E.label ? (M(), H("label", Dn, ce(E.label), 1)) : J("", !0),
|
|
1095
1143
|
z("div", {
|
|
1096
1144
|
ref: "rightResizeHandle",
|
|
1097
|
-
class:
|
|
1145
|
+
class: q(["resize-handle right-resize-handle", { "is-dragging": $(_) }])
|
|
1098
1146
|
}, a[5] || (a[5] = [
|
|
1099
1147
|
z("div", { class: "handle-grip" }, null, -1),
|
|
1100
1148
|
z("div", { class: "vertical-indicator right-indicator" }, null, -1)
|
|
1101
1149
|
]), 2)
|
|
1102
|
-
], 46,
|
|
1150
|
+
], 46, Tn)
|
|
1103
1151
|
], 512),
|
|
1104
|
-
|
|
1152
|
+
E.store.isDependencyGraphEnabled && F.value ? (M(), H("svg", {
|
|
1105
1153
|
key: 0,
|
|
1106
|
-
style:
|
|
1154
|
+
style: ee(L.value)
|
|
1107
1155
|
}, [
|
|
1108
1156
|
z("line", {
|
|
1109
|
-
x1:
|
|
1110
|
-
y1:
|
|
1111
|
-
x2:
|
|
1112
|
-
y2:
|
|
1157
|
+
x1: S.value.startX,
|
|
1158
|
+
y1: S.value.startY,
|
|
1159
|
+
x2: S.value.endX,
|
|
1160
|
+
y2: S.value.endY,
|
|
1113
1161
|
stroke: "#2196f3",
|
|
1114
1162
|
"stroke-width": "2",
|
|
1115
1163
|
"stroke-dasharray": "5,5"
|
|
1116
1164
|
}, null, 8, On)
|
|
1117
|
-
], 4)) :
|
|
1118
|
-
], 8,
|
|
1165
|
+
], 4)) : J("", !0)
|
|
1166
|
+
], 8, Mn));
|
|
1119
1167
|
}
|
|
1120
|
-
}), Pn = /* @__PURE__ */
|
|
1168
|
+
}), Pn = /* @__PURE__ */ re(Hn, [["__scopeId", "data-v-52febd32"]]), Ln = ["tabindex"], Bn = /* @__PURE__ */ te({
|
|
1121
1169
|
__name: "ARow",
|
|
1122
1170
|
props: {
|
|
1123
1171
|
rowIndex: {},
|
|
@@ -1126,72 +1174,72 @@ const wn = (e) => {
|
|
|
1126
1174
|
addNavigation: { type: [Boolean, Object], default: !1 }
|
|
1127
1175
|
},
|
|
1128
1176
|
setup(e) {
|
|
1129
|
-
const t =
|
|
1177
|
+
const t = U("rowEl"), o = A(() => e.store.isRowVisible(e.rowIndex)), s = A(() => e.store.getRowExpandSymbol(e.rowIndex));
|
|
1130
1178
|
if (e.addNavigation) {
|
|
1131
|
-
let i =
|
|
1179
|
+
let i = qe;
|
|
1132
1180
|
typeof e.addNavigation == "object" && (i = {
|
|
1133
1181
|
...i,
|
|
1134
1182
|
...e.addNavigation
|
|
1135
|
-
}),
|
|
1183
|
+
}), Je([
|
|
1136
1184
|
{
|
|
1137
1185
|
selectors: t,
|
|
1138
1186
|
handlers: i
|
|
1139
1187
|
}
|
|
1140
1188
|
]);
|
|
1141
1189
|
}
|
|
1142
|
-
return (i, c) =>
|
|
1190
|
+
return (i, c) => Se((M(), H("tr", {
|
|
1143
1191
|
ref: "rowEl",
|
|
1144
1192
|
tabindex: i.tabIndex,
|
|
1145
1193
|
class: "atable-row"
|
|
1146
1194
|
}, [
|
|
1147
|
-
i.store.config.view !== "uncounted" ?
|
|
1148
|
-
i.store.config.view === "list" ? (M(),
|
|
1195
|
+
i.store.config.view !== "uncounted" ? j(i.$slots, "index", { key: 0 }, () => [
|
|
1196
|
+
i.store.config.view === "list" ? (M(), H("td", {
|
|
1149
1197
|
key: 0,
|
|
1150
1198
|
tabIndex: -1,
|
|
1151
|
-
class:
|
|
1152
|
-
},
|
|
1199
|
+
class: q(["list-index", i.store.hasPinnedColumns ? "sticky-index" : ""])
|
|
1200
|
+
}, ce(i.rowIndex + 1), 3)) : i.store.isTreeView ? (M(), H("td", {
|
|
1153
1201
|
key: 1,
|
|
1154
1202
|
tabIndex: -1,
|
|
1155
|
-
class:
|
|
1203
|
+
class: q(["tree-index", i.store.hasPinnedColumns ? "sticky-index" : ""]),
|
|
1156
1204
|
onClick: c[0] || (c[0] = (r) => i.store.toggleRowExpand(i.rowIndex))
|
|
1157
|
-
},
|
|
1158
|
-
], !0) :
|
|
1159
|
-
|
|
1205
|
+
}, ce(s.value), 3)) : J("", !0)
|
|
1206
|
+
], !0) : J("", !0),
|
|
1207
|
+
j(i.$slots, "default", {}, void 0, !0)
|
|
1160
1208
|
], 8, Ln)), [
|
|
1161
|
-
[
|
|
1209
|
+
[xt, o.value]
|
|
1162
1210
|
]);
|
|
1163
1211
|
}
|
|
1164
|
-
}), kt = /* @__PURE__ */
|
|
1165
|
-
function
|
|
1212
|
+
}), kt = /* @__PURE__ */ re(Bn, [["__scopeId", "data-v-c554ee0f"]]), Ze = Me ? window : void 0;
|
|
1213
|
+
function oe(e) {
|
|
1166
1214
|
var t;
|
|
1167
|
-
const o =
|
|
1215
|
+
const o = R(e);
|
|
1168
1216
|
return (t = o?.$el) != null ? t : o;
|
|
1169
1217
|
}
|
|
1170
1218
|
function ke(...e) {
|
|
1171
1219
|
const t = [], o = () => {
|
|
1172
1220
|
t.forEach((n) => n()), t.length = 0;
|
|
1173
|
-
}, s = (n, l, d, f) => (n.addEventListener(l, d, f), () => n.removeEventListener(l, d, f)), i =
|
|
1174
|
-
const n =
|
|
1221
|
+
}, s = (n, l, d, f) => (n.addEventListener(l, d, f), () => n.removeEventListener(l, d, f)), i = A(() => {
|
|
1222
|
+
const n = ae(R(e[0])).filter((l) => l != null);
|
|
1175
1223
|
return n.every((l) => typeof l != "string") ? n : void 0;
|
|
1176
1224
|
}), c = Ct(
|
|
1177
1225
|
() => {
|
|
1178
1226
|
var n, l;
|
|
1179
1227
|
return [
|
|
1180
|
-
(l = (n = i.value) == null ? void 0 : n.map((d) =>
|
|
1181
|
-
|
|
1182
|
-
|
|
1228
|
+
(l = (n = i.value) == null ? void 0 : n.map((d) => oe(d))) != null ? l : [Ze].filter((d) => d != null),
|
|
1229
|
+
ae(R(i.value ? e[1] : e[0])),
|
|
1230
|
+
ae($(i.value ? e[2] : e[1])),
|
|
1183
1231
|
// @ts-expect-error - TypeScript gets the correct types, but somehow still complains
|
|
1184
|
-
|
|
1232
|
+
R(i.value ? e[3] : e[2])
|
|
1185
1233
|
];
|
|
1186
1234
|
},
|
|
1187
1235
|
([n, l, d, f]) => {
|
|
1188
1236
|
if (o(), !n?.length || !l?.length || !d?.length)
|
|
1189
1237
|
return;
|
|
1190
|
-
const
|
|
1238
|
+
const p = bt(f) ? { ...f } : f;
|
|
1191
1239
|
t.push(
|
|
1192
1240
|
...n.flatMap(
|
|
1193
|
-
(
|
|
1194
|
-
(m) => d.map((
|
|
1241
|
+
(x) => l.flatMap(
|
|
1242
|
+
(m) => d.map((I) => s(x, m, I, p))
|
|
1195
1243
|
)
|
|
1196
1244
|
)
|
|
1197
1245
|
);
|
|
@@ -1200,38 +1248,38 @@ function ke(...e) {
|
|
|
1200
1248
|
), r = () => {
|
|
1201
1249
|
c(), o();
|
|
1202
1250
|
};
|
|
1203
|
-
return
|
|
1251
|
+
return ve(o), r;
|
|
1204
1252
|
}
|
|
1205
|
-
let
|
|
1206
|
-
function
|
|
1207
|
-
const { window: s =
|
|
1253
|
+
let mt = !1;
|
|
1254
|
+
function gt(e, t, o = {}) {
|
|
1255
|
+
const { window: s = Ze, ignore: i = [], capture: c = !0, detectIframe: r = !1, controls: n = !1 } = o;
|
|
1208
1256
|
if (!s)
|
|
1209
|
-
return n ? { stop:
|
|
1210
|
-
if (
|
|
1211
|
-
|
|
1257
|
+
return n ? { stop: Z, cancel: Z, trigger: Z } : Z;
|
|
1258
|
+
if (Ne && !mt) {
|
|
1259
|
+
mt = !0;
|
|
1212
1260
|
const v = { passive: !0 };
|
|
1213
|
-
Array.from(s.document.body.children).forEach((
|
|
1261
|
+
Array.from(s.document.body.children).forEach((g) => g.addEventListener("click", Z, v)), s.document.documentElement.addEventListener("click", Z, v);
|
|
1214
1262
|
}
|
|
1215
1263
|
let l = !0;
|
|
1216
|
-
const d = (v) =>
|
|
1217
|
-
if (typeof
|
|
1218
|
-
return Array.from(s.document.querySelectorAll(
|
|
1264
|
+
const d = (v) => R(i).some((g) => {
|
|
1265
|
+
if (typeof g == "string")
|
|
1266
|
+
return Array.from(s.document.querySelectorAll(g)).some((b) => b === v.target || v.composedPath().includes(b));
|
|
1219
1267
|
{
|
|
1220
|
-
const
|
|
1221
|
-
return
|
|
1268
|
+
const b = oe(g);
|
|
1269
|
+
return b && (v.target === b || v.composedPath().includes(b));
|
|
1222
1270
|
}
|
|
1223
1271
|
});
|
|
1224
1272
|
function f(v) {
|
|
1225
|
-
const
|
|
1226
|
-
return
|
|
1273
|
+
const g = R(v);
|
|
1274
|
+
return g && g.$.subTree.shapeFlag === 16;
|
|
1227
1275
|
}
|
|
1228
|
-
function
|
|
1229
|
-
const
|
|
1230
|
-
return
|
|
1276
|
+
function p(v, g) {
|
|
1277
|
+
const b = R(v), D = b.$.subTree && b.$.subTree.children;
|
|
1278
|
+
return D == null || !Array.isArray(D) ? !1 : D.some((P) => P.el === g.target || g.composedPath().includes(P.el));
|
|
1231
1279
|
}
|
|
1232
|
-
const
|
|
1233
|
-
const
|
|
1234
|
-
if (v.target != null && !(!(
|
|
1280
|
+
const x = (v) => {
|
|
1281
|
+
const g = oe(e);
|
|
1282
|
+
if (v.target != null && !(!(g instanceof Element) && f(e) && p(e, v)) && !(!g || g === v.target || v.composedPath().includes(g))) {
|
|
1235
1283
|
if ("detail" in v && v.detail === 0 && (l = !d(v)), !l) {
|
|
1236
1284
|
l = !0;
|
|
1237
1285
|
return;
|
|
@@ -1240,43 +1288,43 @@ function mt(e, t, o = {}) {
|
|
|
1240
1288
|
}
|
|
1241
1289
|
};
|
|
1242
1290
|
let m = !1;
|
|
1243
|
-
const
|
|
1291
|
+
const I = [
|
|
1244
1292
|
ke(s, "click", (v) => {
|
|
1245
1293
|
m || (m = !0, setTimeout(() => {
|
|
1246
1294
|
m = !1;
|
|
1247
|
-
}, 0),
|
|
1295
|
+
}, 0), x(v));
|
|
1248
1296
|
}, { passive: !0, capture: c }),
|
|
1249
1297
|
ke(s, "pointerdown", (v) => {
|
|
1250
|
-
const
|
|
1251
|
-
l = !d(v) && !!(
|
|
1298
|
+
const g = oe(e);
|
|
1299
|
+
l = !d(v) && !!(g && !v.composedPath().includes(g));
|
|
1252
1300
|
}, { passive: !0 }),
|
|
1253
1301
|
r && ke(s, "blur", (v) => {
|
|
1254
1302
|
setTimeout(() => {
|
|
1255
|
-
var
|
|
1256
|
-
const
|
|
1257
|
-
((
|
|
1303
|
+
var g;
|
|
1304
|
+
const b = oe(e);
|
|
1305
|
+
((g = s.document.activeElement) == null ? void 0 : g.tagName) === "IFRAME" && !b?.contains(s.document.activeElement) && t(v);
|
|
1258
1306
|
}, 0);
|
|
1259
1307
|
}, { passive: !0 })
|
|
1260
|
-
].filter(Boolean),
|
|
1308
|
+
].filter(Boolean), w = () => I.forEach((v) => v());
|
|
1261
1309
|
return n ? {
|
|
1262
|
-
stop:
|
|
1310
|
+
stop: w,
|
|
1263
1311
|
cancel: () => {
|
|
1264
1312
|
l = !1;
|
|
1265
1313
|
},
|
|
1266
1314
|
trigger: (v) => {
|
|
1267
|
-
l = !0,
|
|
1315
|
+
l = !0, x(v), l = !1;
|
|
1268
1316
|
}
|
|
1269
|
-
} :
|
|
1317
|
+
} : w;
|
|
1270
1318
|
}
|
|
1271
|
-
const Be = /* @__PURE__ */ new WeakMap(),
|
|
1319
|
+
const Be = /* @__PURE__ */ new WeakMap(), Wn = {
|
|
1272
1320
|
mounted(e, t) {
|
|
1273
1321
|
const o = !t.modifiers.bubble;
|
|
1274
1322
|
let s;
|
|
1275
1323
|
if (typeof t.value == "function")
|
|
1276
|
-
s =
|
|
1324
|
+
s = gt(e, t.value, { capture: o });
|
|
1277
1325
|
else {
|
|
1278
1326
|
const [i, c] = t.value;
|
|
1279
|
-
s =
|
|
1327
|
+
s = gt(e, i, Object.assign({ capture: o }, c));
|
|
1280
1328
|
}
|
|
1281
1329
|
Be.set(e, s);
|
|
1282
1330
|
},
|
|
@@ -1286,47 +1334,47 @@ const Be = /* @__PURE__ */ new WeakMap(), zn = {
|
|
|
1286
1334
|
}
|
|
1287
1335
|
};
|
|
1288
1336
|
// @__NO_SIDE_EFFECTS__
|
|
1289
|
-
function
|
|
1290
|
-
const e = G(!1), t =
|
|
1291
|
-
return t &&
|
|
1337
|
+
function zn() {
|
|
1338
|
+
const e = G(!1), t = Re();
|
|
1339
|
+
return t && se(() => {
|
|
1292
1340
|
e.value = !0;
|
|
1293
1341
|
}, t), e;
|
|
1294
1342
|
}
|
|
1295
1343
|
// @__NO_SIDE_EFFECTS__
|
|
1296
|
-
function
|
|
1297
|
-
const t = /* @__PURE__ */
|
|
1298
|
-
return
|
|
1344
|
+
function Nn(e) {
|
|
1345
|
+
const t = /* @__PURE__ */ zn();
|
|
1346
|
+
return A(() => (t.value, !!e()));
|
|
1299
1347
|
}
|
|
1300
1348
|
function ht(e, t, o = {}) {
|
|
1301
|
-
const { window: s =
|
|
1349
|
+
const { window: s = Ze, ...i } = o;
|
|
1302
1350
|
let c;
|
|
1303
|
-
const r = /* @__PURE__ */
|
|
1351
|
+
const r = /* @__PURE__ */ Nn(() => s && "ResizeObserver" in s), n = () => {
|
|
1304
1352
|
c && (c.disconnect(), c = void 0);
|
|
1305
|
-
}, l =
|
|
1306
|
-
const
|
|
1307
|
-
return Array.isArray(
|
|
1353
|
+
}, l = A(() => {
|
|
1354
|
+
const p = R(e);
|
|
1355
|
+
return Array.isArray(p) ? p.map((x) => oe(x)) : [oe(p)];
|
|
1308
1356
|
}), d = V(
|
|
1309
1357
|
l,
|
|
1310
|
-
(
|
|
1358
|
+
(p) => {
|
|
1311
1359
|
if (n(), r.value && s) {
|
|
1312
1360
|
c = new ResizeObserver(t);
|
|
1313
|
-
for (const
|
|
1314
|
-
|
|
1361
|
+
for (const x of p)
|
|
1362
|
+
x && c.observe(x, i);
|
|
1315
1363
|
}
|
|
1316
1364
|
},
|
|
1317
1365
|
{ immediate: !0, flush: "post" }
|
|
1318
1366
|
), f = () => {
|
|
1319
1367
|
n(), d();
|
|
1320
1368
|
};
|
|
1321
|
-
return
|
|
1369
|
+
return ve(f), {
|
|
1322
1370
|
isSupported: r,
|
|
1323
1371
|
stop: f
|
|
1324
1372
|
};
|
|
1325
1373
|
}
|
|
1326
|
-
function
|
|
1374
|
+
function We(e) {
|
|
1327
1375
|
return typeof Window < "u" && e instanceof Window ? e.document.documentElement : typeof Document < "u" && e instanceof Document ? e.documentElement : e;
|
|
1328
1376
|
}
|
|
1329
|
-
const
|
|
1377
|
+
const Xn = {
|
|
1330
1378
|
mounted(e, t) {
|
|
1331
1379
|
typeof t.value == "function" ? ht(e, t.value) : ht(e, ...t.value);
|
|
1332
1380
|
}
|
|
@@ -1340,19 +1388,19 @@ function $t(e) {
|
|
|
1340
1388
|
return !o || o.tagName === "BODY" ? !1 : $t(o);
|
|
1341
1389
|
}
|
|
1342
1390
|
}
|
|
1343
|
-
function
|
|
1391
|
+
function Gn(e) {
|
|
1344
1392
|
const t = e || window.event, o = t.target;
|
|
1345
1393
|
return $t(o) ? !1 : t.touches.length > 1 ? !0 : (t.preventDefault && t.preventDefault(), !1);
|
|
1346
1394
|
}
|
|
1347
|
-
const
|
|
1348
|
-
function
|
|
1395
|
+
const ze = /* @__PURE__ */ new WeakMap();
|
|
1396
|
+
function Fn(e, t = !1) {
|
|
1349
1397
|
const o = G(t);
|
|
1350
1398
|
let s = null, i = "";
|
|
1351
1399
|
V(cn(e), (n) => {
|
|
1352
|
-
const l =
|
|
1400
|
+
const l = We(R(n));
|
|
1353
1401
|
if (l) {
|
|
1354
1402
|
const d = l;
|
|
1355
|
-
if (
|
|
1403
|
+
if (ze.get(d) || ze.set(d, d.style.overflow), d.style.overflow !== "hidden" && (i = d.style.overflow), d.style.overflow === "hidden")
|
|
1356
1404
|
return o.value = !0;
|
|
1357
1405
|
if (o.value)
|
|
1358
1406
|
return d.style.overflow = "hidden";
|
|
@@ -1361,20 +1409,20 @@ function Vn(e, t = !1) {
|
|
|
1361
1409
|
immediate: !0
|
|
1362
1410
|
});
|
|
1363
1411
|
const c = () => {
|
|
1364
|
-
const n =
|
|
1365
|
-
!n || o.value || (
|
|
1412
|
+
const n = We(R(e));
|
|
1413
|
+
!n || o.value || (Ne && (s = ke(
|
|
1366
1414
|
n,
|
|
1367
1415
|
"touchmove",
|
|
1368
1416
|
(l) => {
|
|
1369
|
-
|
|
1417
|
+
Gn(l);
|
|
1370
1418
|
},
|
|
1371
1419
|
{ passive: !1 }
|
|
1372
1420
|
)), n.style.overflow = "hidden", o.value = !0);
|
|
1373
1421
|
}, r = () => {
|
|
1374
|
-
const n =
|
|
1375
|
-
!n || !o.value || (
|
|
1422
|
+
const n = We(R(e));
|
|
1423
|
+
!n || !o.value || (Ne && s?.(), n.style.overflow = i, ze.delete(n), o.value = !1);
|
|
1376
1424
|
};
|
|
1377
|
-
return
|
|
1425
|
+
return ve(r), A({
|
|
1378
1426
|
get() {
|
|
1379
1427
|
return o.value;
|
|
1380
1428
|
},
|
|
@@ -1383,18 +1431,18 @@ function Vn(e, t = !1) {
|
|
|
1383
1431
|
}
|
|
1384
1432
|
});
|
|
1385
1433
|
}
|
|
1386
|
-
function
|
|
1434
|
+
function Vn() {
|
|
1387
1435
|
let e = !1;
|
|
1388
1436
|
const t = G(!1);
|
|
1389
1437
|
return (o, s) => {
|
|
1390
1438
|
if (t.value = s.value, e)
|
|
1391
1439
|
return;
|
|
1392
1440
|
e = !0;
|
|
1393
|
-
const i =
|
|
1441
|
+
const i = Fn(o, s.value);
|
|
1394
1442
|
V(t, (c) => i.value = c);
|
|
1395
1443
|
};
|
|
1396
1444
|
}
|
|
1397
|
-
|
|
1445
|
+
Vn();
|
|
1398
1446
|
const Yn = { class: "gantt-connection-overlay" }, jn = {
|
|
1399
1447
|
class: "connection-svg",
|
|
1400
1448
|
style: {
|
|
@@ -1406,30 +1454,30 @@ const Yn = { class: "gantt-connection-overlay" }, jn = {
|
|
|
1406
1454
|
pointerEvents: "none",
|
|
1407
1455
|
zIndex: 1
|
|
1408
1456
|
}
|
|
1409
|
-
}, Un = ["d", "stroke-width", "onDblclick"], qn = ["d", "stroke", "stroke-width", "id", "onDblclick"], Jn = 0.25, Ce = 16, Zn = /* @__PURE__ */
|
|
1457
|
+
}, Un = ["d", "stroke-width", "onDblclick"], qn = ["d", "stroke", "stroke-width", "id", "onDblclick"], Jn = 0.25, Ce = 16, Zn = /* @__PURE__ */ te({
|
|
1410
1458
|
__name: "AGanttConnection",
|
|
1411
1459
|
props: {
|
|
1412
1460
|
store: {}
|
|
1413
1461
|
},
|
|
1414
1462
|
emits: ["connection:delete"],
|
|
1415
1463
|
setup(e, { emit: t }) {
|
|
1416
|
-
const o = t, s =
|
|
1464
|
+
const o = t, s = A(() => e.store.connectionPaths.filter((r) => {
|
|
1417
1465
|
const n = e.store.ganttBars.find((d) => d.id === r.from.barId), l = e.store.ganttBars.find((d) => d.id === r.to.barId);
|
|
1418
1466
|
return n && l;
|
|
1419
1467
|
})), i = (r, n = !1) => {
|
|
1420
1468
|
const l = e.store.connectionHandles.find(
|
|
1421
|
-
(
|
|
1469
|
+
(k) => k.barId === r.from.barId && k.side === r.from.side
|
|
1422
1470
|
), d = e.store.connectionHandles.find(
|
|
1423
|
-
(
|
|
1471
|
+
(k) => k.barId === r.to.barId && k.side === r.to.side
|
|
1424
1472
|
);
|
|
1425
1473
|
if (!l || !d) return "";
|
|
1426
|
-
const f = l.position.x + Ce / 2,
|
|
1427
|
-
return `M ${f} ${
|
|
1474
|
+
const f = l.position.x + Ce / 2, p = l.position.y + Ce / 2, x = d.position.x + Ce / 2, m = d.position.y + Ce / 2, I = Math.abs(x - f), w = Math.max(I * Jn, 50), v = f + (r.from.side === "left" ? -w : w), g = x + (r.to.side === "left" ? -w : w), b = { x: 0.5 * f + 0.5 * v, y: 0.5 * p + 0.5 * p }, D = { x: 0.5 * v + 0.5 * g, y: 0.5 * p + 0.5 * m }, P = { x: 0.5 * g + 0.5 * x, y: 0.5 * m + 0.5 * m }, F = { x: 0.5 * b.x + 0.5 * D.x, y: 0.5 * b.y + 0.5 * D.y }, S = { x: 0.5 * D.x + 0.5 * P.x, y: 0.5 * D.y + 0.5 * P.y }, y = { x: 0.5 * F.x + 0.5 * S.x, y: 0.5 * F.y + 0.5 * S.y };
|
|
1475
|
+
return `M ${f} ${p} Q ${v} ${p}, ${y.x} ${y.y} Q ${g} ${m}, ${x} ${m}`;
|
|
1428
1476
|
}, c = (r) => {
|
|
1429
1477
|
e.store.deleteConnection(r.id) && o("connection:delete", r);
|
|
1430
1478
|
};
|
|
1431
|
-
return (r, n) => (M(),
|
|
1432
|
-
(M(),
|
|
1479
|
+
return (r, n) => (M(), H("div", Yn, [
|
|
1480
|
+
(M(), H("svg", jn, [
|
|
1433
1481
|
n[0] || (n[0] = z("defs", null, [
|
|
1434
1482
|
z("path", {
|
|
1435
1483
|
id: "arrowhead",
|
|
@@ -1453,7 +1501,7 @@ const Yn = { class: "gantt-connection-overlay" }, jn = {
|
|
|
1453
1501
|
})
|
|
1454
1502
|
])
|
|
1455
1503
|
], -1)),
|
|
1456
|
-
(M(!0),
|
|
1504
|
+
(M(!0), H(le, null, he(s.value, (l) => (M(), H("path", {
|
|
1457
1505
|
key: `${l.id}-hitbox`,
|
|
1458
1506
|
d: i(l),
|
|
1459
1507
|
stroke: "transparent",
|
|
@@ -1462,7 +1510,7 @@ const Yn = { class: "gantt-connection-overlay" }, jn = {
|
|
|
1462
1510
|
class: "connection-hitbox",
|
|
1463
1511
|
onDblclick: (d) => c(l)
|
|
1464
1512
|
}, null, 40, Un))), 128)),
|
|
1465
|
-
(M(!0),
|
|
1513
|
+
(M(!0), H(le, null, he(s.value, (l) => (M(), H("path", {
|
|
1466
1514
|
key: l.id,
|
|
1467
1515
|
d: i(l),
|
|
1468
1516
|
stroke: l.style?.color || "#666",
|
|
@@ -1476,10 +1524,10 @@ const Yn = { class: "gantt-connection-overlay" }, jn = {
|
|
|
1476
1524
|
]))
|
|
1477
1525
|
]));
|
|
1478
1526
|
}
|
|
1479
|
-
}), Qn = /* @__PURE__ */
|
|
1527
|
+
}), Qn = /* @__PURE__ */ re(Zn, [["__scopeId", "data-v-955111b6"]]), Kn = { key: 0 }, _n = {
|
|
1480
1528
|
class: "atable-header-row",
|
|
1481
1529
|
tabindex: "-1"
|
|
1482
|
-
}, eo = ["data-colindex"],
|
|
1530
|
+
}, eo = ["data-colindex"], St = /* @__PURE__ */ te({
|
|
1483
1531
|
__name: "ATableHeader",
|
|
1484
1532
|
props: {
|
|
1485
1533
|
columns: {},
|
|
@@ -1493,40 +1541,40 @@ const Yn = { class: "gantt-connection-overlay" }, jn = {
|
|
|
1493
1541
|
typeof n == "number" && n !== c && e.store.resizeColumn(r, c);
|
|
1494
1542
|
}
|
|
1495
1543
|
};
|
|
1496
|
-
return (o, s) => o.columns.length ? (M(),
|
|
1544
|
+
return (o, s) => o.columns.length ? (M(), H("thead", Kn, [
|
|
1497
1545
|
z("tr", _n, [
|
|
1498
|
-
o.store.zeroColumn ? (M(),
|
|
1546
|
+
o.store.zeroColumn ? (M(), H("th", {
|
|
1499
1547
|
key: 0,
|
|
1500
1548
|
id: "header-index",
|
|
1501
|
-
class:
|
|
1549
|
+
class: q([[
|
|
1502
1550
|
o.store.hasPinnedColumns ? "sticky-index" : "",
|
|
1503
1551
|
o.store.isTreeView ? "tree-index" : "",
|
|
1504
1552
|
o.store.config.view === "list-expansion" ? "list-expansion-index" : ""
|
|
1505
1553
|
], "list-index"])
|
|
1506
|
-
}, null, 2)) :
|
|
1507
|
-
(M(!0),
|
|
1554
|
+
}, null, 2)) : J("", !0),
|
|
1555
|
+
(M(!0), H(le, null, he(o.columns, (i, c) => Se((M(), H("th", {
|
|
1508
1556
|
key: i.name,
|
|
1509
1557
|
"data-colindex": c,
|
|
1510
1558
|
tabindex: "-1",
|
|
1511
|
-
style:
|
|
1512
|
-
class:
|
|
1559
|
+
style: ee(o.store.getHeaderCellStyle(i)),
|
|
1560
|
+
class: q(i.pinned ? "sticky-column" : "")
|
|
1513
1561
|
}, [
|
|
1514
|
-
|
|
1515
|
-
|
|
1562
|
+
j(o.$slots, "default", {}, () => [
|
|
1563
|
+
Wt(ce(i.label || String.fromCharCode(c + 97).toUpperCase()), 1)
|
|
1516
1564
|
])
|
|
1517
1565
|
], 14, eo)), [
|
|
1518
|
-
[
|
|
1566
|
+
[$(Xn), t]
|
|
1519
1567
|
])), 128))
|
|
1520
1568
|
])
|
|
1521
|
-
])) :
|
|
1569
|
+
])) : J("", !0);
|
|
1522
1570
|
}
|
|
1523
|
-
}),
|
|
1571
|
+
}), Rt = /* @__PURE__ */ te({
|
|
1524
1572
|
__name: "ATableModal",
|
|
1525
1573
|
props: {
|
|
1526
1574
|
store: {}
|
|
1527
1575
|
},
|
|
1528
1576
|
setup(e) {
|
|
1529
|
-
const t =
|
|
1577
|
+
const t = U("amodal"), { width: o, height: s } = ne(t), i = A(() => {
|
|
1530
1578
|
if (!(e.store.modal.height && e.store.modal.width && e.store.modal.left && e.store.modal.bottom)) return;
|
|
1531
1579
|
const c = e.store.modal.cell?.closest("table"), r = c.offsetHeight || 0, n = c.offsetWidth || 0;
|
|
1532
1580
|
let l = e.store.modal.cell?.offsetTop || 0;
|
|
@@ -1538,7 +1586,7 @@ const Yn = { class: "gantt-connection-overlay" }, jn = {
|
|
|
1538
1586
|
top: `${l}px`
|
|
1539
1587
|
};
|
|
1540
1588
|
});
|
|
1541
|
-
return (c, r) => (M(),
|
|
1589
|
+
return (c, r) => (M(), H("div", {
|
|
1542
1590
|
class: "amodal",
|
|
1543
1591
|
ref: "amodal",
|
|
1544
1592
|
tabindex: "-1",
|
|
@@ -1546,214 +1594,214 @@ const Yn = { class: "gantt-connection-overlay" }, jn = {
|
|
|
1546
1594
|
}, ["stop"])),
|
|
1547
1595
|
onInput: r[1] || (r[1] = $e(() => {
|
|
1548
1596
|
}, ["stop"])),
|
|
1549
|
-
style:
|
|
1597
|
+
style: ee(i.value)
|
|
1550
1598
|
}, [
|
|
1551
|
-
|
|
1599
|
+
j(c.$slots, "default")
|
|
1552
1600
|
], 36));
|
|
1553
1601
|
}
|
|
1554
1602
|
}), to = (e) => {
|
|
1555
1603
|
const t = e.id || yn();
|
|
1556
|
-
return
|
|
1604
|
+
return zt(`table-${t}`, () => {
|
|
1557
1605
|
const s = () => {
|
|
1558
1606
|
const a = [Object.assign({}, { rowModified: !1 })], u = /* @__PURE__ */ new Set();
|
|
1559
|
-
for (let
|
|
1560
|
-
const
|
|
1561
|
-
|
|
1607
|
+
for (let h = 0; h < c.value.length; h++) {
|
|
1608
|
+
const C = c.value[h];
|
|
1609
|
+
C.parent !== null && C.parent !== void 0 && u.add(C.parent);
|
|
1562
1610
|
}
|
|
1563
|
-
for (let
|
|
1564
|
-
const
|
|
1565
|
-
a[
|
|
1611
|
+
for (let h = 0; h < c.value.length; h++) {
|
|
1612
|
+
const C = c.value[h];
|
|
1613
|
+
a[h] = {
|
|
1566
1614
|
childrenOpen: !1,
|
|
1567
1615
|
expanded: !1,
|
|
1568
|
-
indent:
|
|
1569
|
-
isParent: u.has(
|
|
1570
|
-
isRoot:
|
|
1616
|
+
indent: C.indent || 0,
|
|
1617
|
+
isParent: u.has(h),
|
|
1618
|
+
isRoot: C.parent === null || C.parent === void 0,
|
|
1571
1619
|
rowModified: !1,
|
|
1572
|
-
open:
|
|
1573
|
-
parent:
|
|
1620
|
+
open: C.parent === null || C.parent === void 0,
|
|
1621
|
+
parent: C.parent
|
|
1574
1622
|
};
|
|
1575
1623
|
}
|
|
1576
1624
|
return a;
|
|
1577
|
-
}, i =
|
|
1625
|
+
}, i = B(e.columns), c = B(e.rows), r = B(e.config || {}), n = B({}), l = B({}), d = A(() => {
|
|
1578
1626
|
const a = {};
|
|
1579
|
-
for (const [u,
|
|
1580
|
-
for (const [
|
|
1581
|
-
a[`${u}:${
|
|
1627
|
+
for (const [u, h] of i.value.entries())
|
|
1628
|
+
for (const [C, O] of c.value.entries())
|
|
1629
|
+
a[`${u}:${C}`] = O[h.name];
|
|
1582
1630
|
return a;
|
|
1583
|
-
}), f =
|
|
1631
|
+
}), f = A({
|
|
1584
1632
|
get: () => {
|
|
1585
1633
|
const a = s();
|
|
1586
1634
|
for (let u = 0; u < a.length; u++)
|
|
1587
1635
|
n.value[u] && (a[u].rowModified = n.value[u]), l.value[u] && (l.value[u].childrenOpen !== void 0 && (a[u].childrenOpen = l.value[u].childrenOpen), l.value[u].expanded !== void 0 && (a[u].expanded = l.value[u].expanded));
|
|
1588
|
-
if (
|
|
1589
|
-
const u = (
|
|
1590
|
-
const
|
|
1591
|
-
if (
|
|
1636
|
+
if (b.value) {
|
|
1637
|
+
const u = (h, C) => {
|
|
1638
|
+
const O = C[h];
|
|
1639
|
+
if (O.isRoot || O.parent === null || O.parent === void 0)
|
|
1592
1640
|
return !0;
|
|
1593
|
-
const
|
|
1594
|
-
return
|
|
1641
|
+
const W = O.parent;
|
|
1642
|
+
return W < 0 || W >= C.length ? !1 : (C[W].childrenOpen || !1) && u(W, C);
|
|
1595
1643
|
};
|
|
1596
|
-
for (let
|
|
1597
|
-
a[
|
|
1644
|
+
for (let h = 0; h < a.length; h++)
|
|
1645
|
+
a[h].isRoot || (a[h].open = u(h, a));
|
|
1598
1646
|
}
|
|
1599
1647
|
return a;
|
|
1600
1648
|
},
|
|
1601
1649
|
set: (a) => {
|
|
1602
1650
|
JSON.stringify(a) !== JSON.stringify(f.value) && (f.value = a);
|
|
1603
1651
|
}
|
|
1604
|
-
}),
|
|
1652
|
+
}), p = B(e.modal || { visible: !1 }), x = B({}), m = B([]), I = B([]), w = B([]), v = A(() => i.value.some((a) => a.pinned)), g = A(() => r.value.view === "gantt" || r.value.view === "tree-gantt"), b = A(() => r.value.view === "tree" || r.value.view === "tree-gantt"), D = A(() => r.value.dependencyGraph !== !1), P = A(() => `${Math.ceil(c.value.length / 100 + 1)}ch`), F = A(
|
|
1605
1653
|
() => r.value.view ? ["list", "tree", "tree-gantt", "list-expansion"].includes(r.value.view) : !1
|
|
1606
|
-
),
|
|
1607
|
-
const
|
|
1608
|
-
d.value[
|
|
1654
|
+
), S = (a, u) => d.value[`${a}:${u}`], y = (a, u, h) => {
|
|
1655
|
+
const C = `${a}:${u}`, O = i.value[a];
|
|
1656
|
+
d.value[C] !== h && (n.value[u] = !0), d.value[C] = h, c.value[u] = {
|
|
1609
1657
|
...c.value[u],
|
|
1610
|
-
[
|
|
1658
|
+
[O.name]: h
|
|
1611
1659
|
};
|
|
1612
|
-
},
|
|
1660
|
+
}, k = (a) => {
|
|
1613
1661
|
c.value = a;
|
|
1614
|
-
},
|
|
1615
|
-
const
|
|
1616
|
-
d.value[
|
|
1617
|
-
},
|
|
1618
|
-
const u = i.value.indexOf(a) === i.value.length - 1,
|
|
1662
|
+
}, N = (a, u, h) => {
|
|
1663
|
+
const C = `${a}:${u}`;
|
|
1664
|
+
d.value[C] !== h && (n.value[u] = !0, x.value[C] = h);
|
|
1665
|
+
}, L = (a) => {
|
|
1666
|
+
const u = i.value.indexOf(a) === i.value.length - 1, h = r.value.fullWidth ? a.resizable && !u : a.resizable;
|
|
1619
1667
|
return {
|
|
1620
1668
|
width: a.width || "40ch",
|
|
1621
1669
|
textAlign: a.align || "center",
|
|
1622
|
-
...
|
|
1670
|
+
...h && {
|
|
1623
1671
|
resize: "horizontal",
|
|
1624
1672
|
overflow: "hidden",
|
|
1625
1673
|
whiteSpace: "nowrap"
|
|
1626
1674
|
}
|
|
1627
1675
|
};
|
|
1628
|
-
},
|
|
1676
|
+
}, T = (a, u) => {
|
|
1629
1677
|
if (a < 0 || a >= i.value.length) return;
|
|
1630
|
-
const
|
|
1678
|
+
const C = Math.max(u, 40);
|
|
1631
1679
|
i.value[a] = {
|
|
1632
1680
|
...i.value[a],
|
|
1633
|
-
width: `${
|
|
1681
|
+
width: `${C}px`
|
|
1634
1682
|
};
|
|
1635
|
-
},
|
|
1683
|
+
}, Y = (a) => {
|
|
1636
1684
|
const u = c.value[a];
|
|
1637
|
-
return
|
|
1638
|
-
},
|
|
1639
|
-
if (
|
|
1640
|
-
const u = l.value[a] || {},
|
|
1685
|
+
return g.value && u.gantt !== void 0;
|
|
1686
|
+
}, _ = (a) => !b.value || f.value[a].isRoot || f.value[a].open, we = (a) => !b.value && r.value.view !== "list-expansion" ? "" : b.value && (f.value[a].isRoot || f.value[a].isParent) ? f.value[a].childrenOpen ? "▼" : "►" : r.value.view === "list-expansion" ? f.value[a].expanded ? "▼" : "►" : "", me = (a) => {
|
|
1687
|
+
if (b.value) {
|
|
1688
|
+
const u = l.value[a] || {}, C = !(u.childrenOpen ?? f.value[a].childrenOpen);
|
|
1641
1689
|
l.value[a] = {
|
|
1642
1690
|
...u,
|
|
1643
|
-
childrenOpen:
|
|
1644
|
-
},
|
|
1691
|
+
childrenOpen: C
|
|
1692
|
+
}, C || ye(a);
|
|
1645
1693
|
} else if (r.value.view === "list-expansion") {
|
|
1646
|
-
const u = l.value[a] || {},
|
|
1694
|
+
const u = l.value[a] || {}, h = u.expanded ?? f.value[a].expanded;
|
|
1647
1695
|
l.value[a] = {
|
|
1648
1696
|
...u,
|
|
1649
|
-
expanded: !
|
|
1697
|
+
expanded: !h
|
|
1650
1698
|
};
|
|
1651
1699
|
}
|
|
1652
1700
|
}, ye = (a) => {
|
|
1653
1701
|
for (let u = 0; u < c.value.length; u++)
|
|
1654
1702
|
if (f.value[u].parent === a) {
|
|
1655
|
-
const
|
|
1703
|
+
const h = l.value[u] || {};
|
|
1656
1704
|
l.value[u] = {
|
|
1657
|
-
...
|
|
1705
|
+
...h,
|
|
1658
1706
|
childrenOpen: !1
|
|
1659
1707
|
}, ye(u);
|
|
1660
1708
|
}
|
|
1661
|
-
},
|
|
1662
|
-
const
|
|
1663
|
-
return
|
|
1664
|
-
},
|
|
1665
|
-
const
|
|
1666
|
-
return
|
|
1709
|
+
}, Te = (a, u) => {
|
|
1710
|
+
const h = S(a, u);
|
|
1711
|
+
return xe(a, u, h);
|
|
1712
|
+
}, xe = (a, u, h) => {
|
|
1713
|
+
const C = i.value[a], O = c.value[u], W = C.format;
|
|
1714
|
+
return W ? typeof W == "function" ? W(h, { table: d.value, row: O, column: C }) : typeof W == "string" ? Function(`"use strict";return (${W})`)()(h, { table: d.value, row: O, column: C }) : h : h;
|
|
1667
1715
|
};
|
|
1668
1716
|
return {
|
|
1669
1717
|
// state
|
|
1670
1718
|
columns: i,
|
|
1671
1719
|
config: r,
|
|
1672
|
-
connectionHandles:
|
|
1673
|
-
connectionPaths:
|
|
1720
|
+
connectionHandles: I,
|
|
1721
|
+
connectionPaths: w,
|
|
1674
1722
|
display: f,
|
|
1675
1723
|
ganttBars: m,
|
|
1676
|
-
modal:
|
|
1724
|
+
modal: p,
|
|
1677
1725
|
rows: c,
|
|
1678
1726
|
table: d,
|
|
1679
|
-
updates:
|
|
1727
|
+
updates: x,
|
|
1680
1728
|
// getters
|
|
1681
1729
|
hasPinnedColumns: v,
|
|
1682
|
-
isGanttView:
|
|
1683
|
-
isTreeView:
|
|
1684
|
-
isDependencyGraphEnabled:
|
|
1685
|
-
numberedRowWidth:
|
|
1686
|
-
zeroColumn:
|
|
1730
|
+
isGanttView: g,
|
|
1731
|
+
isTreeView: b,
|
|
1732
|
+
isDependencyGraphEnabled: D,
|
|
1733
|
+
numberedRowWidth: P,
|
|
1734
|
+
zeroColumn: F,
|
|
1687
1735
|
// actions
|
|
1688
1736
|
closeModal: (a) => {
|
|
1689
|
-
a.target instanceof Node &&
|
|
1737
|
+
a.target instanceof Node && p.value.parent?.contains(a.target) || p.value.visible && (p.value.visible = !1);
|
|
1690
1738
|
},
|
|
1691
|
-
createConnection: (a, u,
|
|
1692
|
-
const
|
|
1693
|
-
if (!
|
|
1739
|
+
createConnection: (a, u, h) => {
|
|
1740
|
+
const C = I.value.find((X) => X.id === a), O = I.value.find((X) => X.id === u);
|
|
1741
|
+
if (!C || !O)
|
|
1694
1742
|
return console.warn("Cannot create connection: handle not found"), null;
|
|
1695
|
-
const
|
|
1743
|
+
const W = {
|
|
1696
1744
|
id: `connection-${a}-${u}`,
|
|
1697
1745
|
from: {
|
|
1698
|
-
barId:
|
|
1699
|
-
side:
|
|
1746
|
+
barId: C.barId,
|
|
1747
|
+
side: C.side
|
|
1700
1748
|
},
|
|
1701
1749
|
to: {
|
|
1702
|
-
barId:
|
|
1703
|
-
side:
|
|
1750
|
+
barId: O.barId,
|
|
1751
|
+
side: O.side
|
|
1704
1752
|
},
|
|
1705
|
-
style:
|
|
1706
|
-
label:
|
|
1753
|
+
style: h?.style,
|
|
1754
|
+
label: h?.label
|
|
1707
1755
|
};
|
|
1708
|
-
return
|
|
1756
|
+
return w.value.push(W), W;
|
|
1709
1757
|
},
|
|
1710
1758
|
deleteConnection: (a) => {
|
|
1711
|
-
const u =
|
|
1712
|
-
return u >= 0 ? (
|
|
1759
|
+
const u = w.value.findIndex((h) => h.id === a);
|
|
1760
|
+
return u >= 0 ? (w.value.splice(u, 1), !0) : !1;
|
|
1713
1761
|
},
|
|
1714
|
-
getCellData:
|
|
1715
|
-
getCellDisplayValue:
|
|
1716
|
-
getConnectionsForBar: (a) =>
|
|
1717
|
-
getFormattedValue:
|
|
1718
|
-
getHandlesForBar: (a) =>
|
|
1719
|
-
getHeaderCellStyle:
|
|
1762
|
+
getCellData: S,
|
|
1763
|
+
getCellDisplayValue: Te,
|
|
1764
|
+
getConnectionsForBar: (a) => w.value.filter((u) => u.from.barId === a || u.to.barId === a),
|
|
1765
|
+
getFormattedValue: xe,
|
|
1766
|
+
getHandlesForBar: (a) => I.value.filter((u) => u.barId === a),
|
|
1767
|
+
getHeaderCellStyle: L,
|
|
1720
1768
|
getIndent: (a, u) => u && a === 0 && u > 0 ? `${u}ch` : "inherit",
|
|
1721
1769
|
getRowExpandSymbol: we,
|
|
1722
|
-
isRowGantt:
|
|
1723
|
-
isRowVisible:
|
|
1770
|
+
isRowGantt: Y,
|
|
1771
|
+
isRowVisible: _,
|
|
1724
1772
|
registerConnectionHandle: (a) => {
|
|
1725
|
-
const u =
|
|
1726
|
-
u >= 0 ?
|
|
1773
|
+
const u = I.value.findIndex((h) => h.id === a.id);
|
|
1774
|
+
u >= 0 ? I.value[u] = a : I.value.push(a);
|
|
1727
1775
|
},
|
|
1728
1776
|
registerGanttBar: (a) => {
|
|
1729
|
-
const u = m.value.findIndex((
|
|
1777
|
+
const u = m.value.findIndex((h) => h.id === a.id);
|
|
1730
1778
|
u >= 0 ? m.value[u] = a : m.value.push(a);
|
|
1731
1779
|
},
|
|
1732
|
-
resizeColumn:
|
|
1733
|
-
setCellData:
|
|
1734
|
-
setCellText:
|
|
1780
|
+
resizeColumn: T,
|
|
1781
|
+
setCellData: y,
|
|
1782
|
+
setCellText: N,
|
|
1735
1783
|
toggleRowExpand: me,
|
|
1736
1784
|
unregisterConnectionHandle: (a) => {
|
|
1737
|
-
const u =
|
|
1738
|
-
u >= 0 &&
|
|
1785
|
+
const u = I.value.findIndex((h) => h.id === a);
|
|
1786
|
+
u >= 0 && I.value.splice(u, 1);
|
|
1739
1787
|
},
|
|
1740
1788
|
unregisterGanttBar: (a) => {
|
|
1741
|
-
const u = m.value.findIndex((
|
|
1789
|
+
const u = m.value.findIndex((h) => h.id === a);
|
|
1742
1790
|
u >= 0 && m.value.splice(u, 1);
|
|
1743
1791
|
},
|
|
1744
1792
|
updateGanttBar: (a) => {
|
|
1745
1793
|
const u = c.value[a.rowIndex]?.gantt;
|
|
1746
1794
|
u && (a.type === "resize" ? a.edge === "start" ? (u.startIndex = a.newStart, u.endIndex = a.end, u.colspan = u.endIndex - u.startIndex) : a.edge === "end" && (u.startIndex = a.start, u.endIndex = a.newEnd, u.colspan = u.endIndex - u.startIndex) : a.type === "bar" && (u.startIndex = a.newStart, u.endIndex = a.newEnd, u.colspan = u.endIndex - u.startIndex));
|
|
1747
1795
|
},
|
|
1748
|
-
updateRows:
|
|
1796
|
+
updateRows: k
|
|
1749
1797
|
};
|
|
1750
1798
|
})();
|
|
1751
1799
|
}, no = {
|
|
1752
1800
|
class: "atable-container",
|
|
1753
1801
|
style: { position: "relative" }
|
|
1754
|
-
}, oo = /* @__PURE__ */
|
|
1802
|
+
}, oo = /* @__PURE__ */ te({
|
|
1755
1803
|
__name: "ATable",
|
|
1756
|
-
props: /* @__PURE__ */
|
|
1804
|
+
props: /* @__PURE__ */ lt({
|
|
1757
1805
|
id: {},
|
|
1758
1806
|
config: { default: () => new Object() }
|
|
1759
1807
|
}, {
|
|
@@ -1762,23 +1810,23 @@ const Yn = { class: "gantt-connection-overlay" }, jn = {
|
|
|
1762
1810
|
columns: { required: !0 },
|
|
1763
1811
|
columnsModifiers: {}
|
|
1764
1812
|
}),
|
|
1765
|
-
emits: /* @__PURE__ */
|
|
1813
|
+
emits: /* @__PURE__ */ lt(["cellUpdate", "gantt:drag", "connection:event", "columns:update"], ["update:rows", "update:columns"]),
|
|
1766
1814
|
setup(e, { expose: t, emit: o }) {
|
|
1767
|
-
const s =
|
|
1768
|
-
n.$onAction(({ name: m, store:
|
|
1815
|
+
const s = at(e, "rows"), i = at(e, "columns"), c = o, r = U("table"), n = to({ columns: i.value, rows: s.value, id: e.id, config: e.config });
|
|
1816
|
+
n.$onAction(({ name: m, store: I, args: w, after: v }) => {
|
|
1769
1817
|
if (m === "setCellData" || m === "setCellText") {
|
|
1770
|
-
const [
|
|
1818
|
+
const [g, b, D] = w, P = I.getCellData(g, b);
|
|
1771
1819
|
v(() => {
|
|
1772
|
-
s.value = [...
|
|
1820
|
+
s.value = [...I.rows], c("cellUpdate", { colIndex: g, rowIndex: b, newValue: D, oldValue: P });
|
|
1773
1821
|
});
|
|
1774
1822
|
} else if (m === "updateGanttBar") {
|
|
1775
|
-
const [
|
|
1776
|
-
let
|
|
1777
|
-
|
|
1778
|
-
c("gantt:drag",
|
|
1823
|
+
const [g] = w;
|
|
1824
|
+
let b = !1;
|
|
1825
|
+
g.type === "resize" ? b = g.oldColspan !== g.newColspan : g.type === "bar" && (b = g.oldStart !== g.newStart || g.oldEnd !== g.newEnd), b && v(() => {
|
|
1826
|
+
c("gantt:drag", g);
|
|
1779
1827
|
});
|
|
1780
1828
|
} else m === "resizeColumn" && v(() => {
|
|
1781
|
-
i.value = [...
|
|
1829
|
+
i.value = [...I.columns], c("columns:update", [...I.columns]);
|
|
1782
1830
|
});
|
|
1783
1831
|
}), V(
|
|
1784
1832
|
() => s.value,
|
|
@@ -1792,51 +1840,51 @@ const Yn = { class: "gantt-connection-overlay" }, jn = {
|
|
|
1792
1840
|
JSON.stringify(m) !== JSON.stringify(n.columns) && (n.columns = [...m], c("columns:update", [...m]));
|
|
1793
1841
|
},
|
|
1794
1842
|
{ deep: !0 }
|
|
1795
|
-
),
|
|
1796
|
-
i.value.some((m) => m.pinned) && (d(), n.isTreeView &&
|
|
1843
|
+
), se(() => {
|
|
1844
|
+
i.value.some((m) => m.pinned) && (d(), n.isTreeView && It(r, d, { childList: !0, subtree: !0 }));
|
|
1797
1845
|
});
|
|
1798
|
-
const l =
|
|
1799
|
-
const m = r.value,
|
|
1800
|
-
for (const [
|
|
1801
|
-
const
|
|
1802
|
-
|
|
1846
|
+
const l = A(() => n.columns.filter((m) => m.pinned).length), d = () => {
|
|
1847
|
+
const m = r.value, I = m?.rows[0], w = m?.rows[1], v = I ? Array.from(I.cells) : [];
|
|
1848
|
+
for (const [g, b] of v.entries()) {
|
|
1849
|
+
const D = w?.cells[g];
|
|
1850
|
+
D && (b.style.width = `${D.offsetWidth}px`);
|
|
1803
1851
|
}
|
|
1804
|
-
for (const
|
|
1805
|
-
let
|
|
1806
|
-
const
|
|
1807
|
-
for (const
|
|
1808
|
-
(
|
|
1809
|
-
|
|
1852
|
+
for (const g of m?.rows || []) {
|
|
1853
|
+
let b = 0;
|
|
1854
|
+
const D = [];
|
|
1855
|
+
for (const P of g.cells)
|
|
1856
|
+
(P.classList.contains("sticky-column") || P.classList.contains("sticky-index")) && (P.style.left = `${b}px`, b += P.offsetWidth, D.push(P));
|
|
1857
|
+
D.length > 0 && D[D.length - 1].classList.add("sticky-column-edge");
|
|
1810
1858
|
}
|
|
1811
1859
|
};
|
|
1812
1860
|
window.addEventListener("keydown", (m) => {
|
|
1813
1861
|
if (m.key === "Escape" && n.modal.visible) {
|
|
1814
1862
|
n.modal.visible = !1;
|
|
1815
|
-
const
|
|
1816
|
-
|
|
1817
|
-
|
|
1863
|
+
const I = n.modal.parent;
|
|
1864
|
+
I && Xe().then(() => {
|
|
1865
|
+
I.focus();
|
|
1818
1866
|
});
|
|
1819
1867
|
}
|
|
1820
1868
|
});
|
|
1821
1869
|
const f = (m) => {
|
|
1822
1870
|
if (!m.gantt || l.value === 0)
|
|
1823
1871
|
return n.columns;
|
|
1824
|
-
const
|
|
1825
|
-
for (let
|
|
1826
|
-
const v = { ...n.columns[
|
|
1827
|
-
v.originalIndex =
|
|
1872
|
+
const I = [];
|
|
1873
|
+
for (let w = 0; w < l.value; w++) {
|
|
1874
|
+
const v = { ...n.columns[w] };
|
|
1875
|
+
v.originalIndex = w, I.push(v);
|
|
1828
1876
|
}
|
|
1829
|
-
return
|
|
1877
|
+
return I.push({
|
|
1830
1878
|
...n.columns[l.value],
|
|
1831
1879
|
isGantt: !0,
|
|
1832
1880
|
colspan: m.gantt?.colspan || n.columns.length - l.value,
|
|
1833
1881
|
originalIndex: l.value,
|
|
1834
1882
|
width: "auto"
|
|
1835
1883
|
// TODO: refactor to API that can detect when data exists in a cell. Might have be custom and not generalizable
|
|
1836
|
-
}),
|
|
1837
|
-
},
|
|
1884
|
+
}), I;
|
|
1885
|
+
}, p = (m) => {
|
|
1838
1886
|
c("connection:event", { type: "create", connection: m });
|
|
1839
|
-
},
|
|
1887
|
+
}, x = (m) => {
|
|
1840
1888
|
c("connection:event", { type: "delete", connection: m });
|
|
1841
1889
|
};
|
|
1842
1890
|
return t({
|
|
@@ -1845,58 +1893,58 @@ const Yn = { class: "gantt-connection-overlay" }, jn = {
|
|
|
1845
1893
|
deleteConnection: n.deleteConnection,
|
|
1846
1894
|
getConnectionsForBar: n.getConnectionsForBar,
|
|
1847
1895
|
getHandlesForBar: n.getHandlesForBar
|
|
1848
|
-
}), (m,
|
|
1849
|
-
|
|
1896
|
+
}), (m, I) => (M(), H("div", no, [
|
|
1897
|
+
Se((M(), H("table", {
|
|
1850
1898
|
ref: "table",
|
|
1851
1899
|
class: "atable",
|
|
1852
|
-
style:
|
|
1853
|
-
width:
|
|
1900
|
+
style: ee({
|
|
1901
|
+
width: $(n).config.fullWidth ? "100%" : "auto"
|
|
1854
1902
|
})
|
|
1855
1903
|
}, [
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
columns:
|
|
1859
|
-
store:
|
|
1904
|
+
j(m.$slots, "header", { data: $(n) }, () => [
|
|
1905
|
+
st(St, {
|
|
1906
|
+
columns: $(n).columns,
|
|
1907
|
+
store: $(n)
|
|
1860
1908
|
}, null, 8, ["columns", "store"])
|
|
1861
1909
|
], !0),
|
|
1862
1910
|
z("tbody", null, [
|
|
1863
|
-
|
|
1864
|
-
(M(!0),
|
|
1865
|
-
key:
|
|
1866
|
-
row:
|
|
1911
|
+
j(m.$slots, "body", { data: $(n) }, () => [
|
|
1912
|
+
(M(!0), H(le, null, he($(n).rows, (w, v) => (M(), ie(kt, {
|
|
1913
|
+
key: w.id,
|
|
1914
|
+
row: w,
|
|
1867
1915
|
rowIndex: v,
|
|
1868
|
-
store:
|
|
1916
|
+
store: $(n)
|
|
1869
1917
|
}, {
|
|
1870
|
-
default:
|
|
1871
|
-
(M(!0),
|
|
1872
|
-
key:
|
|
1918
|
+
default: rt(() => [
|
|
1919
|
+
(M(!0), H(le, null, he(f(w), (g, b) => (M(), H(le, {
|
|
1920
|
+
key: g.name
|
|
1873
1921
|
}, [
|
|
1874
|
-
|
|
1922
|
+
g.isGantt ? (M(), ie(Ee(g.ganttComponent || "AGanttCell"), {
|
|
1875
1923
|
key: 0,
|
|
1876
|
-
store:
|
|
1877
|
-
columnsCount:
|
|
1878
|
-
color:
|
|
1879
|
-
start:
|
|
1880
|
-
end:
|
|
1881
|
-
colspan:
|
|
1882
|
-
pinned:
|
|
1924
|
+
store: $(n),
|
|
1925
|
+
columnsCount: $(n).columns.length - l.value,
|
|
1926
|
+
color: w.gantt?.color,
|
|
1927
|
+
start: w.gantt?.startIndex,
|
|
1928
|
+
end: w.gantt?.endIndex,
|
|
1929
|
+
colspan: g.colspan,
|
|
1930
|
+
pinned: g.pinned,
|
|
1883
1931
|
rowIndex: v,
|
|
1884
|
-
colIndex:
|
|
1885
|
-
style:
|
|
1886
|
-
textAlign:
|
|
1887
|
-
minWidth:
|
|
1888
|
-
width:
|
|
1932
|
+
colIndex: g.originalIndex ?? b,
|
|
1933
|
+
style: ee({
|
|
1934
|
+
textAlign: g?.align || "center",
|
|
1935
|
+
minWidth: g?.width || "40ch",
|
|
1936
|
+
width: $(n).config.fullWidth ? "auto" : null
|
|
1889
1937
|
}),
|
|
1890
|
-
"onConnection:create":
|
|
1891
|
-
}, null, 40, ["store", "columnsCount", "color", "start", "end", "colspan", "pinned", "rowIndex", "colIndex", "style"])) : (M(),
|
|
1938
|
+
"onConnection:create": p
|
|
1939
|
+
}, null, 40, ["store", "columnsCount", "color", "start", "end", "colspan", "pinned", "rowIndex", "colIndex", "style"])) : (M(), ie(Ee(g.cellComponent || "ACell"), {
|
|
1892
1940
|
key: 1,
|
|
1893
|
-
store:
|
|
1894
|
-
pinned:
|
|
1941
|
+
store: $(n),
|
|
1942
|
+
pinned: g.pinned,
|
|
1895
1943
|
rowIndex: v,
|
|
1896
|
-
colIndex:
|
|
1897
|
-
style:
|
|
1898
|
-
textAlign:
|
|
1899
|
-
width:
|
|
1944
|
+
colIndex: b,
|
|
1945
|
+
style: ee({
|
|
1946
|
+
textAlign: g?.align || "center",
|
|
1947
|
+
width: $(n).config.fullWidth ? "auto" : null
|
|
1900
1948
|
}),
|
|
1901
1949
|
spellcheck: "false"
|
|
1902
1950
|
}, null, 8, ["store", "pinned", "rowIndex", "colIndex", "style"]))
|
|
@@ -1906,64 +1954,64 @@ const Yn = { class: "gantt-connection-overlay" }, jn = {
|
|
|
1906
1954
|
}, 1032, ["row", "rowIndex", "store"]))), 128))
|
|
1907
1955
|
], !0)
|
|
1908
1956
|
]),
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
default:
|
|
1913
|
-
(M(),
|
|
1914
|
-
key: `${
|
|
1915
|
-
colIndex:
|
|
1916
|
-
rowIndex:
|
|
1917
|
-
store:
|
|
1918
|
-
},
|
|
1957
|
+
j(m.$slots, "footer", { data: $(n) }, void 0, !0),
|
|
1958
|
+
j(m.$slots, "modal", { data: $(n) }, () => [
|
|
1959
|
+
Se(st(Rt, { store: $(n) }, {
|
|
1960
|
+
default: rt(() => [
|
|
1961
|
+
(M(), ie(Ee($(n).modal.component), Ge({
|
|
1962
|
+
key: `${$(n).modal.rowIndex}:${$(n).modal.colIndex}`,
|
|
1963
|
+
colIndex: $(n).modal.colIndex,
|
|
1964
|
+
rowIndex: $(n).modal.rowIndex,
|
|
1965
|
+
store: $(n)
|
|
1966
|
+
}, $(n).modal.componentProps), null, 16, ["colIndex", "rowIndex", "store"]))
|
|
1919
1967
|
]),
|
|
1920
1968
|
_: 1
|
|
1921
1969
|
}, 8, ["store"]), [
|
|
1922
|
-
[
|
|
1970
|
+
[xt, $(n).modal.visible]
|
|
1923
1971
|
])
|
|
1924
1972
|
], !0)
|
|
1925
1973
|
], 4)), [
|
|
1926
|
-
[
|
|
1974
|
+
[$(Wn), $(n).closeModal]
|
|
1927
1975
|
]),
|
|
1928
|
-
|
|
1976
|
+
$(n).isGanttView && $(n).isDependencyGraphEnabled ? (M(), ie(Qn, {
|
|
1929
1977
|
key: 0,
|
|
1930
|
-
store:
|
|
1931
|
-
"onConnection:delete":
|
|
1932
|
-
}, null, 8, ["store"])) :
|
|
1978
|
+
store: $(n),
|
|
1979
|
+
"onConnection:delete": x
|
|
1980
|
+
}, null, 8, ["store"])) : J("", !0)
|
|
1933
1981
|
]));
|
|
1934
1982
|
}
|
|
1935
|
-
}), lo = /* @__PURE__ */
|
|
1983
|
+
}), lo = /* @__PURE__ */ re(oo, [["__scopeId", "data-v-51a03d16"]]), ao = {}, so = { class: "aloading" }, ro = { class: "aloading-header" };
|
|
1936
1984
|
function io(e, t) {
|
|
1937
|
-
return M(),
|
|
1985
|
+
return M(), H("div", so, [
|
|
1938
1986
|
z("h2", ro, [
|
|
1939
|
-
|
|
1987
|
+
j(e.$slots, "default", {}, void 0, !0)
|
|
1940
1988
|
]),
|
|
1941
1989
|
t[0] || (t[0] = z("div", { class: "aloading-bar" }, null, -1))
|
|
1942
1990
|
]);
|
|
1943
1991
|
}
|
|
1944
|
-
const co = /* @__PURE__ */
|
|
1992
|
+
const co = /* @__PURE__ */ re(ao, [["render", io], ["__scopeId", "data-v-a930a25b"]]), uo = {}, fo = { class: "aloading" }, vo = { class: "aloading-header" };
|
|
1945
1993
|
function mo(e, t) {
|
|
1946
|
-
return M(),
|
|
1994
|
+
return M(), H("div", fo, [
|
|
1947
1995
|
z("h2", vo, [
|
|
1948
|
-
|
|
1996
|
+
j(e.$slots, "default", {}, void 0, !0)
|
|
1949
1997
|
]),
|
|
1950
1998
|
t[0] || (t[0] = z("div", { class: "aloading-bar" }, null, -1))
|
|
1951
1999
|
]);
|
|
1952
2000
|
}
|
|
1953
|
-
const
|
|
2001
|
+
const go = /* @__PURE__ */ re(uo, [["render", mo], ["__scopeId", "data-v-e1165876"]]);
|
|
1954
2002
|
function wo(e) {
|
|
1955
|
-
e.component("ACell",
|
|
2003
|
+
e.component("ACell", En), e.component("AExpansionRow", Rn), e.component("AGanttCell", Pn), e.component("ARow", kt), e.component("ATable", lo), e.component("ATableHeader", St), e.component("ATableLoading", co), e.component("ATableLoadingBar", go), e.component("ATableModal", Rt);
|
|
1956
2004
|
}
|
|
1957
2005
|
export {
|
|
1958
|
-
|
|
1959
|
-
|
|
2006
|
+
En as ACell,
|
|
2007
|
+
Rn as AExpansionRow,
|
|
1960
2008
|
Pn as AGanttCell,
|
|
1961
2009
|
kt as ARow,
|
|
1962
2010
|
lo as ATable,
|
|
1963
|
-
|
|
2011
|
+
St as ATableHeader,
|
|
1964
2012
|
co as ATableLoading,
|
|
1965
|
-
|
|
1966
|
-
|
|
2013
|
+
go as ATableLoadingBar,
|
|
2014
|
+
Rt as ATableModal,
|
|
1967
2015
|
to as createTableStore,
|
|
1968
2016
|
wo as install
|
|
1969
2017
|
};
|