@stonecrop/atable 0.4.14 → 0.4.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index.css +1 -1
- package/dist/atable.d.ts +18 -8
- package/dist/atable.js +179 -163
- package/dist/atable.js.map +1 -1
- package/dist/atable.umd.cjs +2 -2
- package/dist/atable.umd.cjs.map +1 -1
- package/dist/src/stores/table.d.ts.map +1 -1
- package/dist/src/types/index.d.ts +18 -8
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/stores/table.js +7 -2
- package/package.json +3 -3
- package/src/components/AGanttCell.vue +21 -5
- package/src/components/ATable.vue +1 -1
- package/src/stores/table.ts +7 -2
- package/src/types/index.ts +28 -15
package/dist/atable.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { onMounted as ne, ref as P, watch as
|
|
1
|
+
import { onMounted as ne, ref as P, watch as X, onBeforeUnmount as lt, computed as k, shallowRef as H, toValue as E, watchEffect as at, getCurrentScope as Fe, onScopeDispose as je, unref as b, getCurrentInstance as Ie, nextTick as Ue, isRef as st, toRefs as rt, customRef as Ye, toRef as it, readonly as ut, defineComponent as J, useTemplateRef as N, createElementBlock as R, openBlock as S, normalizeClass as j, normalizeStyle as Y, createBlock as se, resolveDynamicComponent as ve, mergeProps as ke, toDisplayString as K, Fragment as ie, createElementVNode as L, createCommentVNode as _, renderSlot as W, useCssVars as ct, withDirectives as xe, vShow as qe, renderList as Ce, createTextVNode as dt, withModifiers as Oe, createVNode as Le, withCtx as De } from "vue";
|
|
2
2
|
import { defineStore as ft } from "pinia";
|
|
3
3
|
import './assets/index.css';function Me(e) {
|
|
4
4
|
return Fe() ? (je(e), !0) : !1;
|
|
@@ -11,7 +11,7 @@ function me(e) {
|
|
|
11
11
|
return Array.isArray(e) ? e : [e];
|
|
12
12
|
}
|
|
13
13
|
function wt(e, t, n) {
|
|
14
|
-
return
|
|
14
|
+
return X(
|
|
15
15
|
e,
|
|
16
16
|
t,
|
|
17
17
|
{
|
|
@@ -23,24 +23,24 @@ function wt(e, t, n) {
|
|
|
23
23
|
const oe = vt ? window : void 0;
|
|
24
24
|
function ee(e) {
|
|
25
25
|
var t;
|
|
26
|
-
const n =
|
|
26
|
+
const n = E(e);
|
|
27
27
|
return (t = n == null ? void 0 : n.$el) != null ? t : n;
|
|
28
28
|
}
|
|
29
29
|
function ce(...e) {
|
|
30
30
|
const t = [], n = () => {
|
|
31
31
|
t.forEach((a) => a()), t.length = 0;
|
|
32
|
-
}, o = (a, i, r, s) => (a.addEventListener(i, r, s), () => a.removeEventListener(i, r, s)), u =
|
|
33
|
-
const a = me(
|
|
32
|
+
}, o = (a, i, r, s) => (a.addEventListener(i, r, s), () => a.removeEventListener(i, r, s)), u = k(() => {
|
|
33
|
+
const a = me(E(e[0])).filter((i) => i != null);
|
|
34
34
|
return a.every((i) => typeof i != "string") ? a : void 0;
|
|
35
35
|
}), c = wt(
|
|
36
36
|
() => {
|
|
37
37
|
var a, i;
|
|
38
38
|
return [
|
|
39
39
|
(i = (a = u.value) == null ? void 0 : a.map((r) => ee(r))) != null ? i : [oe].filter((r) => r != null),
|
|
40
|
-
me(
|
|
40
|
+
me(E(u.value ? e[1] : e[0])),
|
|
41
41
|
me(b(u.value ? e[2] : e[1])),
|
|
42
42
|
// @ts-expect-error - TypeScript gets the correct types, but somehow still complains
|
|
43
|
-
|
|
43
|
+
E(u.value ? e[3] : e[2])
|
|
44
44
|
];
|
|
45
45
|
},
|
|
46
46
|
([a, i, r, s]) => {
|
|
@@ -69,17 +69,17 @@ function yt() {
|
|
|
69
69
|
}
|
|
70
70
|
function bt(e) {
|
|
71
71
|
const t = yt();
|
|
72
|
-
return
|
|
72
|
+
return k(() => (t.value, !!e()));
|
|
73
73
|
}
|
|
74
74
|
function xt(e, t, n = {}) {
|
|
75
75
|
const { window: o = oe, ...u } = n;
|
|
76
76
|
let c;
|
|
77
77
|
const l = bt(() => o && "MutationObserver" in o), a = () => {
|
|
78
78
|
c && (c.disconnect(), c = void 0);
|
|
79
|
-
}, i =
|
|
80
|
-
const m =
|
|
79
|
+
}, i = k(() => {
|
|
80
|
+
const m = E(e), w = me(m).map(ee).filter(mt);
|
|
81
81
|
return new Set(w);
|
|
82
|
-
}), r =
|
|
82
|
+
}), r = X(
|
|
83
83
|
() => i.value,
|
|
84
84
|
(m) => {
|
|
85
85
|
a(), l.value && m.size && (c = new MutationObserver(t), m.forEach((w) => c.observe(w, u)));
|
|
@@ -165,7 +165,7 @@ function Et(e = {}) {
|
|
|
165
165
|
}
|
|
166
166
|
const It = "focusin", kt = "focusout", Mt = ":focus-within";
|
|
167
167
|
function St(e, t = {}) {
|
|
168
|
-
const { window: n = oe } = t, o =
|
|
168
|
+
const { window: n = oe } = t, o = k(() => ee(e)), u = H(!1), c = k(() => u.value), l = Et(t);
|
|
169
169
|
if (!n || !l.value)
|
|
170
170
|
return { focused: c };
|
|
171
171
|
const a = { passive: !0 };
|
|
@@ -185,7 +185,7 @@ function $t(e, { window: t = oe, scrollTarget: n } = {}) {
|
|
|
185
185
|
o.value = a.top <= (t.innerHeight || c.documentElement.clientHeight) && a.left <= (t.innerWidth || c.documentElement.clientWidth) && a.bottom >= 0 && a.right >= 0;
|
|
186
186
|
}
|
|
187
187
|
};
|
|
188
|
-
return
|
|
188
|
+
return X(
|
|
189
189
|
() => ee(e),
|
|
190
190
|
() => u(),
|
|
191
191
|
{ immediate: !0, flush: "post" }
|
|
@@ -267,7 +267,7 @@ const G = (e) => {
|
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
269
|
return o && (!z(o) || !G(o)) ? Se(o) : o;
|
|
270
|
-
},
|
|
270
|
+
}, Be = (e) => {
|
|
271
271
|
const t = e.target;
|
|
272
272
|
return Ae(t);
|
|
273
273
|
}, Ae = (e) => {
|
|
@@ -280,7 +280,7 @@ const G = (e) => {
|
|
|
280
280
|
n = o == null ? void 0 : o.lastElementChild;
|
|
281
281
|
}
|
|
282
282
|
return n && (!z(n) || !G(n)) ? Ae(n) : n;
|
|
283
|
-
},
|
|
283
|
+
}, Xe = (e) => {
|
|
284
284
|
const t = e.target;
|
|
285
285
|
return Te(t);
|
|
286
286
|
}, Te = (e) => {
|
|
@@ -293,7 +293,7 @@ const G = (e) => {
|
|
|
293
293
|
n = o == null ? void 0 : o.firstElementChild;
|
|
294
294
|
}
|
|
295
295
|
return n && (!z(n) || !G(n)) ? Te(n) : n;
|
|
296
|
-
},
|
|
296
|
+
}, Ve = (e) => {
|
|
297
297
|
const t = e.target.parentElement, n = t == null ? void 0 : t.firstElementChild;
|
|
298
298
|
return n && (!z(n) || !G(n)) ? Te(n) : n;
|
|
299
299
|
}, Ne = (e) => {
|
|
@@ -314,11 +314,11 @@ const G = (e) => {
|
|
|
314
314
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
315
315
|
},
|
|
316
316
|
"keydown.left": (e) => {
|
|
317
|
-
const t =
|
|
317
|
+
const t = Be(e);
|
|
318
318
|
e.preventDefault(), e.stopPropagation(), t && t.focus();
|
|
319
319
|
},
|
|
320
320
|
"keydown.right": (e) => {
|
|
321
|
-
const t =
|
|
321
|
+
const t = Xe(e);
|
|
322
322
|
e.preventDefault(), e.stopPropagation(), t && t.focus();
|
|
323
323
|
},
|
|
324
324
|
"keydown.control.up": (e) => {
|
|
@@ -330,7 +330,7 @@ const G = (e) => {
|
|
|
330
330
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
331
331
|
},
|
|
332
332
|
"keydown.control.left": (e) => {
|
|
333
|
-
const t =
|
|
333
|
+
const t = Ve(e);
|
|
334
334
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
335
335
|
},
|
|
336
336
|
"keydown.control.right": (e) => {
|
|
@@ -356,15 +356,15 @@ const G = (e) => {
|
|
|
356
356
|
}
|
|
357
357
|
},
|
|
358
358
|
"keydown.home": (e) => {
|
|
359
|
-
const t =
|
|
359
|
+
const t = Ve(e);
|
|
360
360
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
361
361
|
},
|
|
362
362
|
"keydown.tab": (e) => {
|
|
363
|
-
const t =
|
|
363
|
+
const t = Xe(e);
|
|
364
364
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
365
365
|
},
|
|
366
366
|
"keydown.shift.tab": (e) => {
|
|
367
|
-
const t =
|
|
367
|
+
const t = Be(e);
|
|
368
368
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
369
369
|
}
|
|
370
370
|
};
|
|
@@ -422,7 +422,7 @@ function Pe(e) {
|
|
|
422
422
|
for (const l of e) {
|
|
423
423
|
const a = t(l), i = o(l), r = u(l), s = a ? [a] : i;
|
|
424
424
|
for (const g of s) {
|
|
425
|
-
const { focused: m } = St(P(g)), w =
|
|
425
|
+
const { focused: m } = St(P(g)), w = X(m, (v) => {
|
|
426
426
|
v ? g.addEventListener("keydown", r) : g.removeEventListener("keydown", r);
|
|
427
427
|
});
|
|
428
428
|
c.push(w);
|
|
@@ -467,7 +467,7 @@ function Wt(e, t = {}) {
|
|
|
467
467
|
},
|
|
468
468
|
set(u) {
|
|
469
469
|
var c;
|
|
470
|
-
if ((c =
|
|
470
|
+
if ((c = E(t.replaceRef)) != null ? c : !0)
|
|
471
471
|
if (Array.isArray(e.value)) {
|
|
472
472
|
const a = [...e.value];
|
|
473
473
|
a[o] = u, e.value = a;
|
|
@@ -481,11 +481,11 @@ function Wt(e, t = {}) {
|
|
|
481
481
|
}));
|
|
482
482
|
return n;
|
|
483
483
|
}
|
|
484
|
-
function
|
|
484
|
+
function Bt(e, t = !0, n) {
|
|
485
485
|
Dt() ? ne(e, n) : t ? e() : Ue(e);
|
|
486
486
|
}
|
|
487
487
|
function Qe(e, t, n) {
|
|
488
|
-
return
|
|
488
|
+
return X(
|
|
489
489
|
e,
|
|
490
490
|
t,
|
|
491
491
|
{
|
|
@@ -497,24 +497,24 @@ function Qe(e, t, n) {
|
|
|
497
497
|
const pe = he ? window : void 0;
|
|
498
498
|
function te(e) {
|
|
499
499
|
var t;
|
|
500
|
-
const n =
|
|
500
|
+
const n = E(e);
|
|
501
501
|
return (t = n == null ? void 0 : n.$el) != null ? t : n;
|
|
502
502
|
}
|
|
503
503
|
function ue(...e) {
|
|
504
504
|
const t = [], n = () => {
|
|
505
505
|
t.forEach((a) => a()), t.length = 0;
|
|
506
|
-
}, o = (a, i, r, s) => (a.addEventListener(i, r, s), () => a.removeEventListener(i, r, s)), u =
|
|
507
|
-
const a = q(
|
|
506
|
+
}, o = (a, i, r, s) => (a.addEventListener(i, r, s), () => a.removeEventListener(i, r, s)), u = k(() => {
|
|
507
|
+
const a = q(E(e[0])).filter((i) => i != null);
|
|
508
508
|
return a.every((i) => typeof i != "string") ? a : void 0;
|
|
509
509
|
}), c = Qe(
|
|
510
510
|
() => {
|
|
511
511
|
var a, i;
|
|
512
512
|
return [
|
|
513
513
|
(i = (a = u.value) == null ? void 0 : a.map((r) => te(r))) != null ? i : [pe].filter((r) => r != null),
|
|
514
|
-
q(
|
|
514
|
+
q(E(u.value ? e[1] : e[0])),
|
|
515
515
|
q(b(u.value ? e[2] : e[1])),
|
|
516
516
|
// @ts-expect-error - TypeScript gets the correct types, but somehow still complains
|
|
517
|
-
|
|
517
|
+
E(u.value ? e[3] : e[2])
|
|
518
518
|
];
|
|
519
519
|
},
|
|
520
520
|
([a, i, r, s]) => {
|
|
@@ -535,25 +535,25 @@ function ue(...e) {
|
|
|
535
535
|
};
|
|
536
536
|
return de(n), l;
|
|
537
537
|
}
|
|
538
|
-
function
|
|
538
|
+
function Xt() {
|
|
539
539
|
const e = H(!1), t = Ie();
|
|
540
540
|
return t && ne(() => {
|
|
541
541
|
e.value = !0;
|
|
542
542
|
}, t), e;
|
|
543
543
|
}
|
|
544
544
|
function Ze(e) {
|
|
545
|
-
const t =
|
|
546
|
-
return
|
|
545
|
+
const t = Xt();
|
|
546
|
+
return k(() => (t.value, !!e()));
|
|
547
547
|
}
|
|
548
548
|
function Ke(e, t, n = {}) {
|
|
549
549
|
const { window: o = pe, ...u } = n;
|
|
550
550
|
let c;
|
|
551
551
|
const l = Ze(() => o && "MutationObserver" in o), a = () => {
|
|
552
552
|
c && (c.disconnect(), c = void 0);
|
|
553
|
-
}, i =
|
|
554
|
-
const m =
|
|
553
|
+
}, i = k(() => {
|
|
554
|
+
const m = E(e), w = q(m).map(te).filter(Pt);
|
|
555
555
|
return new Set(w);
|
|
556
|
-
}), r =
|
|
556
|
+
}), r = X(
|
|
557
557
|
() => i.value,
|
|
558
558
|
(m) => {
|
|
559
559
|
a(), l.value && m.size && (c = new MutationObserver(t), m.forEach((w) => c.observe(w, u)));
|
|
@@ -585,58 +585,58 @@ function we(e, t = {}) {
|
|
|
585
585
|
handle: v = e,
|
|
586
586
|
buttons: x = [0]
|
|
587
587
|
} = t, f = P(
|
|
588
|
-
(n =
|
|
589
|
-
), d = P(), p = (
|
|
590
|
-
|
|
591
|
-
}, $ = (
|
|
592
|
-
var
|
|
593
|
-
if (!
|
|
588
|
+
(n = E(s)) != null ? n : { x: 0, y: 0 }
|
|
589
|
+
), d = P(), p = (C) => o ? o.includes(C.pointerType) : !0, M = (C) => {
|
|
590
|
+
E(u) && C.preventDefault(), E(c) && C.stopPropagation();
|
|
591
|
+
}, $ = (C) => {
|
|
592
|
+
var A;
|
|
593
|
+
if (!E(x).includes(C.button) || E(t.disabled) || !p(C) || E(l) && C.target !== E(e))
|
|
594
594
|
return;
|
|
595
|
-
const
|
|
596
|
-
x:
|
|
597
|
-
y:
|
|
595
|
+
const B = E(w), F = (A = B == null ? void 0 : B.getBoundingClientRect) == null ? void 0 : A.call(B), V = E(e).getBoundingClientRect(), h = {
|
|
596
|
+
x: C.clientX - (B ? V.left - F.left + B.scrollLeft : V.left),
|
|
597
|
+
y: C.clientY - (B ? V.top - F.top + B.scrollTop : V.top)
|
|
598
598
|
};
|
|
599
|
-
(r == null ? void 0 : r(h,
|
|
600
|
-
},
|
|
601
|
-
if (
|
|
599
|
+
(r == null ? void 0 : r(h, C)) !== !1 && (d.value = h, M(C));
|
|
600
|
+
}, I = (C) => {
|
|
601
|
+
if (E(t.disabled) || !p(C) || !d.value)
|
|
602
602
|
return;
|
|
603
|
-
const
|
|
604
|
-
let { x: F, y:
|
|
605
|
-
(g === "x" || g === "both") && (F =
|
|
603
|
+
const A = E(w), B = E(e).getBoundingClientRect();
|
|
604
|
+
let { x: F, y: V } = f.value;
|
|
605
|
+
(g === "x" || g === "both") && (F = C.clientX - d.value.x, A && (F = Math.min(Math.max(0, F), A.scrollWidth - B.width))), (g === "y" || g === "both") && (V = C.clientY - d.value.y, A && (V = Math.min(Math.max(0, V), A.scrollHeight - B.height))), f.value = {
|
|
606
606
|
x: F,
|
|
607
|
-
y:
|
|
608
|
-
}, a == null || a(f.value,
|
|
609
|
-
}, Q = (
|
|
610
|
-
|
|
607
|
+
y: V
|
|
608
|
+
}, a == null || a(f.value, C), M(C);
|
|
609
|
+
}, Q = (C) => {
|
|
610
|
+
E(t.disabled) || !p(C) || d.value && (d.value = void 0, i == null || i(f.value, C), M(C));
|
|
611
611
|
};
|
|
612
612
|
if (he) {
|
|
613
|
-
const
|
|
614
|
-
var
|
|
613
|
+
const C = () => {
|
|
614
|
+
var A;
|
|
615
615
|
return {
|
|
616
|
-
capture: (
|
|
617
|
-
passive: !
|
|
616
|
+
capture: (A = t.capture) != null ? A : !0,
|
|
617
|
+
passive: !E(u)
|
|
618
618
|
};
|
|
619
619
|
};
|
|
620
|
-
ue(v, "pointerdown", $,
|
|
620
|
+
ue(v, "pointerdown", $, C), ue(m, "pointermove", I, C), ue(m, "pointerup", Q, C);
|
|
621
621
|
}
|
|
622
622
|
return {
|
|
623
623
|
...Wt(f),
|
|
624
624
|
position: f,
|
|
625
|
-
isDragging:
|
|
626
|
-
style:
|
|
625
|
+
isDragging: k(() => !!d.value),
|
|
626
|
+
style: k(
|
|
627
627
|
() => `left:${f.value.x}px;top:${f.value.y}px;`
|
|
628
628
|
)
|
|
629
629
|
};
|
|
630
630
|
}
|
|
631
|
-
function
|
|
631
|
+
function Vt(e, t, n = {}) {
|
|
632
632
|
const { window: o = pe, ...u } = n;
|
|
633
633
|
let c;
|
|
634
634
|
const l = Ze(() => o && "ResizeObserver" in o), a = () => {
|
|
635
635
|
c && (c.disconnect(), c = void 0);
|
|
636
|
-
}, i =
|
|
637
|
-
const g =
|
|
636
|
+
}, i = k(() => {
|
|
637
|
+
const g = E(e);
|
|
638
638
|
return Array.isArray(g) ? g.map((m) => te(m)) : [te(g)];
|
|
639
|
-
}), r =
|
|
639
|
+
}), r = X(
|
|
640
640
|
i,
|
|
641
641
|
(g) => {
|
|
642
642
|
if (a(), l.value && o) {
|
|
@@ -674,9 +674,9 @@ function ge(e, t = {}) {
|
|
|
674
674
|
function f() {
|
|
675
675
|
l === "sync" ? x() : l === "next-frame" && requestAnimationFrame(() => x());
|
|
676
676
|
}
|
|
677
|
-
return
|
|
677
|
+
return Vt(e, f), X(() => te(e), (d) => !d && f()), Ke(e, f, {
|
|
678
678
|
attributeFilter: ["style", "class"]
|
|
679
|
-
}), u && ue("scroll", f, { capture: !0, passive: !0 }), o && ue("resize", f, { passive: !0 }),
|
|
679
|
+
}), u && ue("scroll", f, { capture: !0, passive: !0 }), o && ue("resize", f, { passive: !0 }), Bt(() => {
|
|
680
680
|
c && f();
|
|
681
681
|
}), {
|
|
682
682
|
height: a,
|
|
@@ -704,7 +704,7 @@ const Nt = (e) => {
|
|
|
704
704
|
pinned: { type: Boolean, default: !1 }
|
|
705
705
|
},
|
|
706
706
|
setup(e, { expose: t }) {
|
|
707
|
-
const n = N("cell"), o = e.store.getCellData(e.colIndex, e.rowIndex), u = P(""), c = P(!1), l = e.store.columns[e.colIndex], a = e.store.rows[e.rowIndex], i = l.align || "center", r = l.width || "40ch", s =
|
|
707
|
+
const n = N("cell"), o = e.store.getCellData(e.colIndex, e.rowIndex), u = P(""), c = P(!1), l = e.store.columns[e.colIndex], a = e.store.rows[e.rowIndex], i = l.align || "center", r = l.width || "40ch", s = k(() => e.store.getCellDisplayValue(e.colIndex, e.rowIndex)), g = k(() => typeof s.value == "string" ? Nt(s.value) : !1), m = k(() => {
|
|
708
708
|
var d;
|
|
709
709
|
return {
|
|
710
710
|
textAlign: i,
|
|
@@ -712,13 +712,13 @@ const Nt = (e) => {
|
|
|
712
712
|
fontWeight: c.value ? "bold" : "inherit",
|
|
713
713
|
paddingLeft: e.store.getIndent(e.colIndex, (d = e.store.display[e.rowIndex]) == null ? void 0 : d.indent)
|
|
714
714
|
};
|
|
715
|
-
}), w =
|
|
715
|
+
}), w = k(() => ({
|
|
716
716
|
"sticky-column": e.pinned,
|
|
717
717
|
"cell-modified": c.value
|
|
718
718
|
})), v = () => {
|
|
719
|
-
const { left: d, bottom: p, width:
|
|
720
|
-
l.mask, l.modalComponent && e.store.$patch((
|
|
721
|
-
|
|
719
|
+
const { left: d, bottom: p, width: M, height: $ } = ge(n);
|
|
720
|
+
l.mask, l.modalComponent && e.store.$patch((I) => {
|
|
721
|
+
I.modal.visible = !0, I.modal.colIndex = e.colIndex, I.modal.rowIndex = e.rowIndex, I.modal.left = d, I.modal.bottom = p, I.modal.width = M, I.modal.height = $, I.modal.cell = n.value, typeof l.modalComponent == "function" ? I.modal.component = l.modalComponent({ table: I.table, row: a, column: l }) : I.modal.component = l.modalComponent, I.modal.componentProps = l.modalComponentExtraProps;
|
|
722
722
|
});
|
|
723
723
|
};
|
|
724
724
|
if (e.addNavigation) {
|
|
@@ -748,7 +748,7 @@ const Nt = (e) => {
|
|
|
748
748
|
};
|
|
749
749
|
return t({
|
|
750
750
|
currentData: u
|
|
751
|
-
}), (d, p) => (S(),
|
|
751
|
+
}), (d, p) => (S(), R("td", {
|
|
752
752
|
ref: "cell",
|
|
753
753
|
"data-colindex": d.colIndex,
|
|
754
754
|
"data-rowindex": d.rowIndex,
|
|
@@ -766,10 +766,10 @@ const Nt = (e) => {
|
|
|
766
766
|
b(l).cellComponent ? (S(), se(ve(b(l).cellComponent), ke({
|
|
767
767
|
key: 0,
|
|
768
768
|
value: s.value
|
|
769
|
-
}, b(l).cellComponentProps), null, 16, ["value"])) : g.value ? (S(),
|
|
769
|
+
}, b(l).cellComponentProps), null, 16, ["value"])) : g.value ? (S(), R("span", {
|
|
770
770
|
key: 1,
|
|
771
771
|
innerHTML: s.value
|
|
772
|
-
}, null, 8, Ft)) : (S(),
|
|
772
|
+
}, null, 8, Ft)) : (S(), R("span", jt, K(s.value), 1))
|
|
773
773
|
], 46, zt));
|
|
774
774
|
}
|
|
775
775
|
}), Yt = ["tabindex"], qt = ["tabindex"], Jt = ["colspan"], Qt = /* @__PURE__ */ J({
|
|
@@ -781,7 +781,7 @@ const Nt = (e) => {
|
|
|
781
781
|
addNavigation: { type: [Boolean, Object] }
|
|
782
782
|
},
|
|
783
783
|
setup(e) {
|
|
784
|
-
const t = N("rowEl"), n =
|
|
784
|
+
const t = N("rowEl"), n = k(() => e.store.display[e.rowIndex].expanded ? "▼" : "►");
|
|
785
785
|
if (e.addNavigation) {
|
|
786
786
|
const o = {
|
|
787
787
|
"keydown.control.g": (u) => {
|
|
@@ -795,7 +795,7 @@ const Nt = (e) => {
|
|
|
795
795
|
}
|
|
796
796
|
]);
|
|
797
797
|
}
|
|
798
|
-
return (o, u) => (S(),
|
|
798
|
+
return (o, u) => (S(), R(ie, null, [
|
|
799
799
|
L("tr", ke(o.$attrs, {
|
|
800
800
|
ref: "rowEl",
|
|
801
801
|
tabindex: o.tabIndex,
|
|
@@ -808,7 +808,7 @@ const Nt = (e) => {
|
|
|
808
808
|
}, K(n.value), 1),
|
|
809
809
|
W(o.$slots, "row", {}, void 0, !0)
|
|
810
810
|
], 16, Yt),
|
|
811
|
-
o.store.display[o.rowIndex].expanded ? (S(),
|
|
811
|
+
o.store.display[o.rowIndex].expanded ? (S(), R("tr", {
|
|
812
812
|
key: 0,
|
|
813
813
|
ref: "rowExpanded",
|
|
814
814
|
tabindex: o.tabIndex,
|
|
@@ -850,14 +850,14 @@ const Nt = (e) => {
|
|
|
850
850
|
},
|
|
851
851
|
setup(e) {
|
|
852
852
|
ct((d) => ({
|
|
853
|
-
"
|
|
854
|
-
"
|
|
853
|
+
"78862e08": t.value,
|
|
854
|
+
"18ad7d98": d.colspan
|
|
855
855
|
}));
|
|
856
856
|
const t = P();
|
|
857
857
|
ne(() => {
|
|
858
858
|
!e.color || e.color == "" || e.color.length < 6 ? t.value = "#cccccc" : t.value = e.color;
|
|
859
859
|
});
|
|
860
|
-
const n = N("container"), o = N("bar"), u = N("leftHandle"), c = N("rightHandle"), { width: l } = ge(n), { left: a, right: i } = ge(o), r = P(e.start || 0), s = P(e.end || r.value + e.colspan), g = P({ startX: 0, startPos: 0 }), m =
|
|
860
|
+
const n = N("container"), o = N("bar"), u = N("leftHandle"), c = N("rightHandle"), { width: l } = ge(n), { left: a, right: i } = ge(o), r = P(e.start || 0), s = P(e.end || r.value + e.colspan), g = P({ startX: 0, startPos: 0 }), m = k(() => e.colspan > 0 ? l.value / e.colspan : 0), w = k(() => {
|
|
861
861
|
const d = r.value / e.colspan * 100, p = s.value / e.colspan * 100;
|
|
862
862
|
return {
|
|
863
863
|
left: `${d}%`,
|
|
@@ -874,21 +874,24 @@ const Nt = (e) => {
|
|
|
874
874
|
},
|
|
875
875
|
onMove: ({ x: d }) => {
|
|
876
876
|
if (v.value && o.value) {
|
|
877
|
-
const
|
|
877
|
+
const M = (d - g.value.startX) / m.value, $ = Math.max(0, Math.min(s.value - 1, g.value.startPos + M));
|
|
878
878
|
o.value.style.left = `${$ / e.colspan * 100}%`, o.value.style.width = `${(s.value - $) / e.colspan * 100}%`;
|
|
879
879
|
}
|
|
880
880
|
},
|
|
881
881
|
onEnd: ({ x: d }) => {
|
|
882
882
|
if (o.value) {
|
|
883
|
-
const p = d - g.value.startX,
|
|
884
|
-
r.value =
|
|
883
|
+
const p = d - g.value.startX, M = Math.round(p / m.value), $ = r.value, I = Math.max(0, Math.min(s.value - 1, g.value.startPos + M));
|
|
884
|
+
r.value = I, e.store.updateGanttBar({
|
|
885
885
|
rowIndex: e.rowIndex,
|
|
886
886
|
colIndex: e.colIndex,
|
|
887
887
|
type: "resize",
|
|
888
888
|
edge: "start",
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
889
|
+
oldStart: $,
|
|
890
|
+
newStart: I,
|
|
891
|
+
end: s.value,
|
|
892
|
+
delta: M,
|
|
893
|
+
oldColspan: s.value - $,
|
|
894
|
+
newColspan: s.value - I
|
|
892
895
|
});
|
|
893
896
|
}
|
|
894
897
|
}
|
|
@@ -902,27 +905,30 @@ const Nt = (e) => {
|
|
|
902
905
|
},
|
|
903
906
|
onMove: ({ x: d }) => {
|
|
904
907
|
if (x.value && o.value) {
|
|
905
|
-
const
|
|
908
|
+
const M = (d - g.value.startX) / m.value, $ = Math.max(
|
|
906
909
|
r.value + 1,
|
|
907
|
-
Math.min(e.columnsCount, g.value.startPos +
|
|
910
|
+
Math.min(e.columnsCount, g.value.startPos + M)
|
|
908
911
|
);
|
|
909
912
|
o.value.style.width = `${($ - r.value) / e.colspan * 100}%`;
|
|
910
913
|
}
|
|
911
914
|
},
|
|
912
915
|
onEnd: ({ x: d }) => {
|
|
913
916
|
if (o.value) {
|
|
914
|
-
const p = d - g.value.startX,
|
|
917
|
+
const p = d - g.value.startX, M = Math.round(p / m.value), $ = s.value, I = Math.max(
|
|
915
918
|
r.value + 1,
|
|
916
|
-
Math.min(e.columnsCount, g.value.startPos +
|
|
919
|
+
Math.min(e.columnsCount, g.value.startPos + M)
|
|
917
920
|
);
|
|
918
|
-
s.value =
|
|
921
|
+
s.value = I, e.store.updateGanttBar({
|
|
919
922
|
rowIndex: e.rowIndex,
|
|
920
923
|
colIndex: e.colIndex,
|
|
921
924
|
type: "resize",
|
|
922
925
|
edge: "end",
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
+
oldEnd: $,
|
|
927
|
+
newEnd: I,
|
|
928
|
+
start: r.value,
|
|
929
|
+
delta: M,
|
|
930
|
+
oldColspan: $ - r.value,
|
|
931
|
+
newColspan: I - r.value
|
|
926
932
|
});
|
|
927
933
|
}
|
|
928
934
|
}
|
|
@@ -938,19 +944,29 @@ const Nt = (e) => {
|
|
|
938
944
|
},
|
|
939
945
|
onMove: ({ x: d }) => {
|
|
940
946
|
if (f.value && o.value) {
|
|
941
|
-
const
|
|
942
|
-
o.value.style.left = `${
|
|
947
|
+
const M = (d - g.value.startX) / m.value, $ = s.value - r.value, I = Math.max(0, Math.min(g.value.startPos + M, e.columnsCount - $));
|
|
948
|
+
o.value.style.left = `${I / e.colspan * 100}%`;
|
|
943
949
|
}
|
|
944
950
|
},
|
|
945
951
|
onEnd: ({ x: d }) => {
|
|
946
952
|
if (o.value) {
|
|
947
|
-
const p = d - g.value.startX,
|
|
948
|
-
let
|
|
949
|
-
|
|
953
|
+
const p = d - g.value.startX, M = Math.round(p / m.value), $ = s.value - r.value, I = r.value, Q = s.value;
|
|
954
|
+
let C = g.value.startPos + M, A = C + $;
|
|
955
|
+
C < 0 ? (C = 0, A = $) : A > e.columnsCount && (A = e.columnsCount, C = A - $), r.value = C, s.value = A, e.store.updateGanttBar({
|
|
956
|
+
rowIndex: e.rowIndex,
|
|
957
|
+
colIndex: e.colIndex,
|
|
958
|
+
type: "bar",
|
|
959
|
+
oldStart: I,
|
|
960
|
+
oldEnd: Q,
|
|
961
|
+
newStart: C,
|
|
962
|
+
newEnd: A,
|
|
963
|
+
delta: M,
|
|
964
|
+
colspan: A - C
|
|
965
|
+
});
|
|
950
966
|
}
|
|
951
967
|
}
|
|
952
968
|
});
|
|
953
|
-
return (d, p) => (S(),
|
|
969
|
+
return (d, p) => (S(), R("td", {
|
|
954
970
|
class: "aganttcell",
|
|
955
971
|
colspan: d.colspan
|
|
956
972
|
}, [
|
|
@@ -967,7 +983,7 @@ const Nt = (e) => {
|
|
|
967
983
|
L("div", { class: "handle-grip" }, null, -1),
|
|
968
984
|
L("div", { class: "vertical-indicator left-indicator" }, null, -1)
|
|
969
985
|
]), 2),
|
|
970
|
-
d.label ? (S(),
|
|
986
|
+
d.label ? (S(), R("label", en, K(d.label), 1)) : _("", !0),
|
|
971
987
|
L("div", {
|
|
972
988
|
ref: "rightHandle",
|
|
973
989
|
class: j(["gantt-handle right-handle", { "is-dragging": b(x) }])
|
|
@@ -979,7 +995,7 @@ const Nt = (e) => {
|
|
|
979
995
|
], 512)
|
|
980
996
|
], 8, Kt));
|
|
981
997
|
}
|
|
982
|
-
}), nn = /* @__PURE__ */ le(tn, [["__scopeId", "data-v-
|
|
998
|
+
}), nn = /* @__PURE__ */ le(tn, [["__scopeId", "data-v-a929e8e3"]]), on = ["tabindex"], ln = /* @__PURE__ */ J({
|
|
983
999
|
__name: "ARow",
|
|
984
1000
|
props: {
|
|
985
1001
|
rowIndex: {},
|
|
@@ -988,7 +1004,7 @@ const Nt = (e) => {
|
|
|
988
1004
|
addNavigation: { type: [Boolean, Object], default: !1 }
|
|
989
1005
|
},
|
|
990
1006
|
setup(e) {
|
|
991
|
-
const t = N("rowEl"), n =
|
|
1007
|
+
const t = N("rowEl"), n = k(() => e.store.isRowVisible(e.rowIndex)), o = k(() => e.store.getRowExpandSymbol(e.rowIndex));
|
|
992
1008
|
if (e.addNavigation) {
|
|
993
1009
|
let u = Re;
|
|
994
1010
|
typeof e.addNavigation == "object" && (u = {
|
|
@@ -1001,17 +1017,17 @@ const Nt = (e) => {
|
|
|
1001
1017
|
}
|
|
1002
1018
|
]);
|
|
1003
1019
|
}
|
|
1004
|
-
return (u, c) => xe((S(),
|
|
1020
|
+
return (u, c) => xe((S(), R("tr", {
|
|
1005
1021
|
ref: "rowEl",
|
|
1006
1022
|
tabindex: u.tabIndex,
|
|
1007
1023
|
class: "atable-row"
|
|
1008
1024
|
}, [
|
|
1009
1025
|
u.store.config.view !== "uncounted" ? W(u.$slots, "index", { key: 0 }, () => [
|
|
1010
|
-
u.store.config.view === "list" ? (S(),
|
|
1026
|
+
u.store.config.view === "list" ? (S(), R("td", {
|
|
1011
1027
|
key: 0,
|
|
1012
1028
|
tabIndex: -1,
|
|
1013
1029
|
class: j(["list-index", u.store.hasPinnedColumns ? "sticky-index" : ""])
|
|
1014
|
-
}, K(u.rowIndex + 1), 3)) : u.store.config.view === "tree" ? (S(),
|
|
1030
|
+
}, K(u.rowIndex + 1), 3)) : u.store.config.view === "tree" ? (S(), R("td", {
|
|
1015
1031
|
key: 1,
|
|
1016
1032
|
tabIndex: -1,
|
|
1017
1033
|
class: j(["tree-index", u.store.hasPinnedColumns ? "sticky-index" : ""]),
|
|
@@ -1026,24 +1042,24 @@ const Nt = (e) => {
|
|
|
1026
1042
|
}), _e = /* @__PURE__ */ le(ln, [["__scopeId", "data-v-4cb4f254"]]), et = he ? window : void 0;
|
|
1027
1043
|
function re(e) {
|
|
1028
1044
|
var t;
|
|
1029
|
-
const n =
|
|
1045
|
+
const n = E(e);
|
|
1030
1046
|
return (t = n == null ? void 0 : n.$el) != null ? t : n;
|
|
1031
1047
|
}
|
|
1032
1048
|
function Z(...e) {
|
|
1033
1049
|
const t = [], n = () => {
|
|
1034
1050
|
t.forEach((a) => a()), t.length = 0;
|
|
1035
|
-
}, o = (a, i, r, s) => (a.addEventListener(i, r, s), () => a.removeEventListener(i, r, s)), u =
|
|
1036
|
-
const a = q(
|
|
1051
|
+
}, o = (a, i, r, s) => (a.addEventListener(i, r, s), () => a.removeEventListener(i, r, s)), u = k(() => {
|
|
1052
|
+
const a = q(E(e[0])).filter((i) => i != null);
|
|
1037
1053
|
return a.every((i) => typeof i != "string") ? a : void 0;
|
|
1038
1054
|
}), c = Qe(
|
|
1039
1055
|
() => {
|
|
1040
1056
|
var a, i;
|
|
1041
1057
|
return [
|
|
1042
1058
|
(i = (a = u.value) == null ? void 0 : a.map((r) => re(r))) != null ? i : [et].filter((r) => r != null),
|
|
1043
|
-
q(
|
|
1059
|
+
q(E(u.value ? e[1] : e[0])),
|
|
1044
1060
|
q(b(u.value ? e[2] : e[1])),
|
|
1045
1061
|
// @ts-expect-error - TypeScript gets the correct types, but somehow still complains
|
|
1046
|
-
|
|
1062
|
+
E(u.value ? e[3] : e[2])
|
|
1047
1063
|
];
|
|
1048
1064
|
},
|
|
1049
1065
|
([a, i, r, s]) => {
|
|
@@ -1075,7 +1091,7 @@ function ze(e, t, n = {}) {
|
|
|
1075
1091
|
Array.from(o.document.body.children).forEach((d) => Z(d, "click", U, f)), Z(o.document.documentElement, "click", U, f);
|
|
1076
1092
|
}
|
|
1077
1093
|
let i = !0;
|
|
1078
|
-
const r = (f) =>
|
|
1094
|
+
const r = (f) => E(u).some((d) => {
|
|
1079
1095
|
if (typeof d == "string")
|
|
1080
1096
|
return Array.from(o.document.querySelectorAll(d)).some((p) => p === f.target || f.composedPath().includes(p));
|
|
1081
1097
|
{
|
|
@@ -1084,12 +1100,12 @@ function ze(e, t, n = {}) {
|
|
|
1084
1100
|
}
|
|
1085
1101
|
});
|
|
1086
1102
|
function s(f) {
|
|
1087
|
-
const d =
|
|
1103
|
+
const d = E(f);
|
|
1088
1104
|
return d && d.$.subTree.shapeFlag === 16;
|
|
1089
1105
|
}
|
|
1090
1106
|
function g(f, d) {
|
|
1091
|
-
const p =
|
|
1092
|
-
return
|
|
1107
|
+
const p = E(f), M = p.$.subTree && p.$.subTree.children;
|
|
1108
|
+
return M == null || !Array.isArray(M) ? !1 : M.some(($) => $.el === d.target || d.composedPath().includes($.el));
|
|
1093
1109
|
}
|
|
1094
1110
|
const m = (f) => {
|
|
1095
1111
|
const d = re(e);
|
|
@@ -1164,8 +1180,8 @@ const be = /* @__PURE__ */ new WeakMap();
|
|
|
1164
1180
|
function rn(e, t = !1) {
|
|
1165
1181
|
const n = P(t);
|
|
1166
1182
|
let o = null, u = "";
|
|
1167
|
-
|
|
1168
|
-
const i = ye(
|
|
1183
|
+
X(Ht(e), (a) => {
|
|
1184
|
+
const i = ye(E(a));
|
|
1169
1185
|
if (i) {
|
|
1170
1186
|
const r = i;
|
|
1171
1187
|
if (be.get(r) || be.set(r, r.style.overflow), r.style.overflow !== "hidden" && (u = r.style.overflow), r.style.overflow === "hidden")
|
|
@@ -1177,7 +1193,7 @@ function rn(e, t = !1) {
|
|
|
1177
1193
|
immediate: !0
|
|
1178
1194
|
});
|
|
1179
1195
|
const c = () => {
|
|
1180
|
-
const a = ye(
|
|
1196
|
+
const a = ye(E(e));
|
|
1181
1197
|
!a || n.value || (Ee && (o = Z(
|
|
1182
1198
|
a,
|
|
1183
1199
|
"touchmove",
|
|
@@ -1187,10 +1203,10 @@ function rn(e, t = !1) {
|
|
|
1187
1203
|
{ passive: !1 }
|
|
1188
1204
|
)), a.style.overflow = "hidden", n.value = !0);
|
|
1189
1205
|
}, l = () => {
|
|
1190
|
-
const a = ye(
|
|
1206
|
+
const a = ye(E(e));
|
|
1191
1207
|
!a || !n.value || (Ee && (o == null || o()), a.style.overflow = u, be.delete(a), n.value = !1);
|
|
1192
1208
|
};
|
|
1193
|
-
return de(l),
|
|
1209
|
+
return de(l), k({
|
|
1194
1210
|
get() {
|
|
1195
1211
|
return n.value;
|
|
1196
1212
|
},
|
|
@@ -1207,7 +1223,7 @@ function un() {
|
|
|
1207
1223
|
return;
|
|
1208
1224
|
e = !0;
|
|
1209
1225
|
const u = rn(n, o.value);
|
|
1210
|
-
|
|
1226
|
+
X(t, (c) => u.value = c);
|
|
1211
1227
|
};
|
|
1212
1228
|
}
|
|
1213
1229
|
un();
|
|
@@ -1224,9 +1240,9 @@ const cn = {
|
|
|
1224
1240
|
store: {}
|
|
1225
1241
|
},
|
|
1226
1242
|
setup(e) {
|
|
1227
|
-
return (t, n) => t.columns.length ? (S(),
|
|
1243
|
+
return (t, n) => t.columns.length ? (S(), R("thead", cn, [
|
|
1228
1244
|
L("tr", dn, [
|
|
1229
|
-
t.store.zeroColumn ? (S(),
|
|
1245
|
+
t.store.zeroColumn ? (S(), R("th", {
|
|
1230
1246
|
key: 0,
|
|
1231
1247
|
id: "header-index",
|
|
1232
1248
|
class: j([[
|
|
@@ -1235,7 +1251,7 @@ const cn = {
|
|
|
1235
1251
|
t.store.config.view === "list-expansion" ? "list-expansion-index" : ""
|
|
1236
1252
|
], "list-index"])
|
|
1237
1253
|
}, null, 2)) : _("", !0),
|
|
1238
|
-
(S(!0),
|
|
1254
|
+
(S(!0), R(ie, null, Ce(t.columns, (o, u) => (S(), R("th", {
|
|
1239
1255
|
key: o.name,
|
|
1240
1256
|
tabindex: "-1",
|
|
1241
1257
|
style: Y(t.store.getHeaderCellStyle(o)),
|
|
@@ -1254,7 +1270,7 @@ const cn = {
|
|
|
1254
1270
|
store: {}
|
|
1255
1271
|
},
|
|
1256
1272
|
setup(e) {
|
|
1257
|
-
const t = N("amodal"), { width: n, height: o } = ge(t), u =
|
|
1273
|
+
const t = N("amodal"), { width: n, height: o } = ge(t), u = k(() => {
|
|
1258
1274
|
var g, m, w, v;
|
|
1259
1275
|
if (!(e.store.modal.height && e.store.modal.width && e.store.modal.left && e.store.modal.bottom)) return;
|
|
1260
1276
|
const c = (g = e.store.modal.cell) == null ? void 0 : g.closest("table"), l = c.offsetHeight || 0, a = c.offsetWidth || 0;
|
|
@@ -1267,7 +1283,7 @@ const cn = {
|
|
|
1267
1283
|
top: `${i}px`
|
|
1268
1284
|
};
|
|
1269
1285
|
});
|
|
1270
|
-
return (c, l) => (S(),
|
|
1286
|
+
return (c, l) => (S(), R("div", {
|
|
1271
1287
|
class: "amodal",
|
|
1272
1288
|
ref: "amodal",
|
|
1273
1289
|
tabindex: "-1",
|
|
@@ -1285,22 +1301,22 @@ const cn = {
|
|
|
1285
1301
|
return ft(`table-${t}`, () => {
|
|
1286
1302
|
const o = () => {
|
|
1287
1303
|
const h = {};
|
|
1288
|
-
for (const [y,
|
|
1304
|
+
for (const [y, T] of c.value.entries())
|
|
1289
1305
|
for (const [O, D] of l.value.entries())
|
|
1290
|
-
h[`${y}:${O}`] = D[
|
|
1306
|
+
h[`${y}:${O}`] = D[T.name];
|
|
1291
1307
|
return h;
|
|
1292
1308
|
}, u = (h) => {
|
|
1293
1309
|
const y = [Object.assign({}, { rowModified: !1 })];
|
|
1294
1310
|
if (h && "0:0" in h)
|
|
1295
1311
|
return h;
|
|
1296
|
-
const
|
|
1312
|
+
const T = /* @__PURE__ */ new Set();
|
|
1297
1313
|
for (let O = l.value.length - 1; O >= 0; O--) {
|
|
1298
1314
|
const D = l.value[O];
|
|
1299
|
-
D.parent &&
|
|
1315
|
+
D.parent && T.add(D.parent), y[O] = {
|
|
1300
1316
|
childrenOpen: !1,
|
|
1301
1317
|
expanded: !1,
|
|
1302
1318
|
indent: D.indent || 0,
|
|
1303
|
-
isParent:
|
|
1319
|
+
isParent: T.has(O),
|
|
1304
1320
|
isRoot: D.parent === null || D.parent === void 0,
|
|
1305
1321
|
rowModified: !1,
|
|
1306
1322
|
open: D.parent === null || D.parent === void 0,
|
|
@@ -1308,33 +1324,33 @@ const cn = {
|
|
|
1308
1324
|
};
|
|
1309
1325
|
}
|
|
1310
1326
|
return y;
|
|
1311
|
-
}, c = P(e.columns), l = P(e.rows), a = P(e.config || {}), i = P(e.table || o()), r = P(u(e.display)), s = P(e.modal || { visible: !1 }), g = P({}), m =
|
|
1327
|
+
}, c = P(e.columns), l = P(e.rows), a = P(e.config || {}), i = P(e.table || o()), r = P(u(e.display)), s = P(e.modal || { visible: !1 }), g = P({}), m = k(() => c.value.some((h) => h.pinned)), w = k(() => `${Math.ceil(l.value.length / 100 + 1)}ch`), v = k(
|
|
1312
1328
|
() => a.value.view ? ["list", "tree", "list-expansion"].includes(a.value.view) : !1
|
|
1313
|
-
), x = (h, y) => i.value[`${h}:${y}`], f = (h, y,
|
|
1329
|
+
), x = (h, y) => i.value[`${h}:${y}`], f = (h, y, T) => {
|
|
1314
1330
|
const O = `${h}:${y}`, D = c.value[h];
|
|
1315
|
-
i.value[O] !==
|
|
1316
|
-
}, d = (h, y,
|
|
1331
|
+
i.value[O] !== T && (r.value[y].rowModified = !0), i.value[O] = T, l.value[y][D.name] = T;
|
|
1332
|
+
}, d = (h, y, T) => {
|
|
1317
1333
|
const O = `${h}:${y}`;
|
|
1318
|
-
i.value[O] !==
|
|
1334
|
+
i.value[O] !== T && (r.value[y].rowModified = !0, g.value[O] = T);
|
|
1319
1335
|
}, p = (h) => ({
|
|
1320
1336
|
minWidth: h.width || "40ch",
|
|
1321
1337
|
textAlign: h.align || "center",
|
|
1322
1338
|
width: a.value.fullWidth ? "auto" : void 0
|
|
1323
|
-
}),
|
|
1339
|
+
}), M = (h) => {
|
|
1324
1340
|
const y = l.value[h];
|
|
1325
1341
|
return a.value.view === "gantt" && y.indent === 0;
|
|
1326
|
-
}, $ = (h) => a.value.view !== "tree" || r.value[h].isRoot || r.value[h].open,
|
|
1342
|
+
}, $ = (h) => a.value.view !== "tree" || r.value[h].isRoot || r.value[h].open, I = (h) => a.value.view !== "tree" ? "" : r.value[h].isRoot || r.value[h].isParent ? r.value[h].childrenOpen ? "-" : "+" : "", Q = (h) => {
|
|
1327
1343
|
if (a.value.view === "tree") {
|
|
1328
1344
|
r.value[h].childrenOpen = !r.value[h].childrenOpen;
|
|
1329
1345
|
for (let y = l.value.length - 1; y >= 0; y--)
|
|
1330
1346
|
r.value[y].parent === h && (r.value[y].open = !r.value[y].open, r.value[y].childrenOpen && Q(y));
|
|
1331
1347
|
} else a.value.view === "list-expansion" && (r.value[h].expanded = !r.value[h].expanded);
|
|
1332
|
-
},
|
|
1333
|
-
const
|
|
1334
|
-
return
|
|
1335
|
-
},
|
|
1348
|
+
}, C = (h, y) => {
|
|
1349
|
+
const T = x(h, y);
|
|
1350
|
+
return A(h, y, T);
|
|
1351
|
+
}, A = (h, y, T) => {
|
|
1336
1352
|
const O = c.value[h], D = l.value[y], ae = O.format;
|
|
1337
|
-
return ae ? typeof ae == "function" ? ae(
|
|
1353
|
+
return ae ? typeof ae == "function" ? ae(T, { table: i.value, row: D, column: O }) : typeof ae == "string" ? Function(`"use strict";return (${ae})`)()(T, { table: i.value, row: D, column: O }) : T : T;
|
|
1338
1354
|
};
|
|
1339
1355
|
return {
|
|
1340
1356
|
// state
|
|
@@ -1355,20 +1371,20 @@ const cn = {
|
|
|
1355
1371
|
h.target instanceof Node && (y = s.value.parent) != null && y.contains(h.target) || s.value.visible && (s.value.visible = !1);
|
|
1356
1372
|
},
|
|
1357
1373
|
getCellData: x,
|
|
1358
|
-
getCellDisplayValue:
|
|
1359
|
-
getFormattedValue:
|
|
1374
|
+
getCellDisplayValue: C,
|
|
1375
|
+
getFormattedValue: A,
|
|
1360
1376
|
getHeaderCellStyle: p,
|
|
1361
1377
|
getIndent: (h, y) => y && h === 0 && y > 0 ? `${y}ch` : "inherit",
|
|
1362
|
-
getRowExpandSymbol:
|
|
1363
|
-
isRowGantt:
|
|
1378
|
+
getRowExpandSymbol: I,
|
|
1379
|
+
isRowGantt: M,
|
|
1364
1380
|
isRowVisible: $,
|
|
1365
1381
|
setCellData: f,
|
|
1366
1382
|
setCellText: d,
|
|
1367
1383
|
toggleRowExpand: Q,
|
|
1368
1384
|
updateGanttBar: (h) => {
|
|
1369
|
-
var
|
|
1370
|
-
const y = (
|
|
1371
|
-
y && (h.type === "resize" ? h.edge === "start" ? y.startIndex = h.
|
|
1385
|
+
var T;
|
|
1386
|
+
const y = (T = l.value[h.rowIndex]) == null ? void 0 : T.gantt;
|
|
1387
|
+
y && (h.type === "resize" ? h.edge === "start" ? (y.startIndex = h.newStart, y.endIndex = h.end, y.colspan = y.endIndex - y.startIndex) : h.edge === "end" && (y.startIndex = h.start, y.endIndex = h.newEnd, y.colspan = y.endIndex - y.startIndex) : h.type === "bar" && (y.startIndex = h.newStart, y.endIndex = h.newEnd, y.colspan = y.endIndex - y.startIndex));
|
|
1372
1388
|
}
|
|
1373
1389
|
};
|
|
1374
1390
|
})();
|
|
@@ -1393,11 +1409,11 @@ const cn = {
|
|
|
1393
1409
|
} else if (s === "updateGanttBar") {
|
|
1394
1410
|
const [v] = m;
|
|
1395
1411
|
let x = !1;
|
|
1396
|
-
v.type === "resize" ? x = v.
|
|
1412
|
+
v.type === "resize" ? x = v.oldColspan !== v.newColspan : v.type === "bar" && (x = v.oldStart !== v.newStart || v.oldEnd !== v.newEnd), x && w(() => {
|
|
1397
1413
|
o("gantt:drag", v);
|
|
1398
1414
|
});
|
|
1399
1415
|
}
|
|
1400
|
-
}),
|
|
1416
|
+
}), X(
|
|
1401
1417
|
() => l.rows,
|
|
1402
1418
|
(s) => {
|
|
1403
1419
|
o("update:modelValue", s);
|
|
@@ -1406,7 +1422,7 @@ const cn = {
|
|
|
1406
1422
|
), ne(() => {
|
|
1407
1423
|
e.columns.some((s) => s.pinned) && (i(), l.config.view === "tree" && Ke(u, i, { childList: !0, subtree: !0 }));
|
|
1408
1424
|
});
|
|
1409
|
-
const a =
|
|
1425
|
+
const a = k(() => l.columns.filter((s) => s.pinned).length), i = () => {
|
|
1410
1426
|
const s = u.value, g = s == null ? void 0 : s.rows[0], m = s == null ? void 0 : s.rows[1], w = g ? Array.from(g.cells) : [];
|
|
1411
1427
|
for (const [v, x] of w.entries()) {
|
|
1412
1428
|
const f = m == null ? void 0 : m.cells[v];
|
|
@@ -1447,7 +1463,7 @@ const cn = {
|
|
|
1447
1463
|
// TODO: refactor to API that can detect when data exists in a cell. Might have be custom and not generalizable
|
|
1448
1464
|
}), m;
|
|
1449
1465
|
};
|
|
1450
|
-
return t({ store: l }), (s, g) => xe((S(),
|
|
1466
|
+
return t({ store: l }), (s, g) => xe((S(), R("table", {
|
|
1451
1467
|
ref: "table",
|
|
1452
1468
|
class: "atable",
|
|
1453
1469
|
style: Y({
|
|
@@ -1462,16 +1478,16 @@ const cn = {
|
|
|
1462
1478
|
], !0),
|
|
1463
1479
|
L("tbody", null, [
|
|
1464
1480
|
W(s.$slots, "body", { data: b(l) }, () => [
|
|
1465
|
-
(S(!0),
|
|
1481
|
+
(S(!0), R(ie, null, Ce(b(l).rows, (m, w) => (S(), se(_e, {
|
|
1466
1482
|
key: m.id,
|
|
1467
1483
|
row: m,
|
|
1468
1484
|
rowIndex: w,
|
|
1469
1485
|
store: b(l)
|
|
1470
1486
|
}, {
|
|
1471
1487
|
default: De(() => [
|
|
1472
|
-
(S(!0),
|
|
1488
|
+
(S(!0), R(ie, null, Ce(r(m), (v, x) => {
|
|
1473
1489
|
var f, d, p;
|
|
1474
|
-
return S(),
|
|
1490
|
+
return S(), R(ie, {
|
|
1475
1491
|
key: v.name
|
|
1476
1492
|
}, [
|
|
1477
1493
|
v.isGantt ? (S(), se(ve(v.ganttComponent || "AGanttCell"), {
|
|
@@ -1530,9 +1546,9 @@ const cn = {
|
|
|
1530
1546
|
[b(an), b(l).closeModal]
|
|
1531
1547
|
]);
|
|
1532
1548
|
}
|
|
1533
|
-
}), mn = /* @__PURE__ */ le(vn, [["__scopeId", "data-v-
|
|
1549
|
+
}), mn = /* @__PURE__ */ le(vn, [["__scopeId", "data-v-fcb81c06"]]), gn = {}, hn = { class: "aloading" }, pn = { class: "aloading-header" };
|
|
1534
1550
|
function wn(e, t) {
|
|
1535
|
-
return S(),
|
|
1551
|
+
return S(), R("div", hn, [
|
|
1536
1552
|
L("h2", pn, [
|
|
1537
1553
|
W(e.$slots, "default", {}, void 0, !0)
|
|
1538
1554
|
]),
|
|
@@ -1541,7 +1557,7 @@ function wn(e, t) {
|
|
|
1541
1557
|
}
|
|
1542
1558
|
const yn = /* @__PURE__ */ le(gn, [["render", wn], ["__scopeId", "data-v-a930a25b"]]), bn = {}, xn = { class: "aloading" }, Cn = { class: "aloading-header" };
|
|
1543
1559
|
function En(e, t) {
|
|
1544
|
-
return S(),
|
|
1560
|
+
return S(), R("div", xn, [
|
|
1545
1561
|
L("h2", Cn, [
|
|
1546
1562
|
W(e.$slots, "default", {}, void 0, !0)
|
|
1547
1563
|
]),
|