@stonecrop/atable 0.4.35 → 0.4.36
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.js +623 -623
- package/dist/atable.js.map +1 -1
- package/dist/atable.tsbuildinfo +1 -1
- package/dist/atable.umd.cjs +2 -2
- package/dist/atable.umd.cjs.map +1 -1
- package/package.json +8 -8
package/dist/atable.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { onMounted as re, ref as z, watch as V, onBeforeUnmount as At, computed as D, shallowRef as G, toValue as
|
|
1
|
+
import { onMounted as re, ref as z, watch as V, onBeforeUnmount as At, computed as D, shallowRef as G, toValue as S, watchEffect as Tt, getCurrentScope as pt, onScopeDispose as xt, unref as R, getCurrentInstance as Ae, nextTick as Fe, isRef as Dt, toRefs as Ot, customRef as yt, toRef as Ht, readonly as Pt, defineComponent as te, useTemplateRef as U, createElementBlock as L, openBlock as T, normalizeClass as q, normalizeStyle as ee, createBlock as ce, resolveDynamicComponent as ke, mergeProps as Ve, toDisplayString as ue, Fragment as ae, createElementVNode as N, createCommentVNode as J, renderSlot as j, useCssVars as Lt, onUnmounted as Bt, withModifiers as Se, withDirectives as Me, vShow as bt, renderList as we, createTextVNode as Wt, mergeModels as at, useModel as st, createVNode as rt, withCtx as it } from "vue";
|
|
2
2
|
import { defineStore as zt } from "pinia";
|
|
3
3
|
import './assets/index.css';function Ye(e) {
|
|
4
|
-
return
|
|
4
|
+
return pt() ? (xt(e), !0) : !1;
|
|
5
5
|
}
|
|
6
6
|
const Nt = typeof window < "u" && typeof document < "u";
|
|
7
7
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
@@ -23,43 +23,43 @@ function Yt(e, t, o) {
|
|
|
23
23
|
const ve = Nt ? window : void 0;
|
|
24
24
|
function de(e) {
|
|
25
25
|
var t;
|
|
26
|
-
const o =
|
|
26
|
+
const o = S(e);
|
|
27
27
|
return (t = o?.$el) != null ? t : o;
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function pe(...e) {
|
|
30
30
|
const t = [], o = () => {
|
|
31
31
|
t.forEach((n) => n()), t.length = 0;
|
|
32
|
-
},
|
|
33
|
-
const n = $e(
|
|
32
|
+
}, r = (n, l, d, f) => (n.addEventListener(l, d, f), () => n.removeEventListener(l, d, f)), c = D(() => {
|
|
33
|
+
const n = $e(S(e[0])).filter((l) => l != null);
|
|
34
34
|
return n.every((l) => typeof l != "string") ? n : void 0;
|
|
35
|
-
}),
|
|
35
|
+
}), i = Yt(
|
|
36
36
|
() => {
|
|
37
37
|
var n, l;
|
|
38
38
|
return [
|
|
39
|
-
(l = (n =
|
|
40
|
-
$e(
|
|
41
|
-
$e(R(
|
|
39
|
+
(l = (n = c.value) == null ? void 0 : n.map((d) => de(d))) != null ? l : [ve].filter((d) => d != null),
|
|
40
|
+
$e(S(c.value ? e[1] : e[0])),
|
|
41
|
+
$e(R(c.value ? e[2] : e[1])),
|
|
42
42
|
// @ts-expect-error - TypeScript gets the correct types, but somehow still complains
|
|
43
|
-
|
|
43
|
+
S(c.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 w = Ft(f) ? { ...f } : f;
|
|
50
50
|
t.push(
|
|
51
51
|
...n.flatMap(
|
|
52
|
-
(
|
|
53
|
-
(m) => d.map((
|
|
52
|
+
(y) => l.flatMap(
|
|
53
|
+
(m) => d.map((E) => r(y, m, E, w))
|
|
54
54
|
)
|
|
55
55
|
)
|
|
56
56
|
);
|
|
57
57
|
},
|
|
58
58
|
{ flush: "post" }
|
|
59
|
-
),
|
|
60
|
-
|
|
59
|
+
), s = () => {
|
|
60
|
+
i(), o();
|
|
61
61
|
};
|
|
62
|
-
return Ye(o),
|
|
62
|
+
return Ye(o), s;
|
|
63
63
|
}
|
|
64
64
|
// @__NO_SIDE_EFFECTS__
|
|
65
65
|
function jt() {
|
|
@@ -74,56 +74,56 @@ function Ut(e) {
|
|
|
74
74
|
return D(() => (t.value, !!e()));
|
|
75
75
|
}
|
|
76
76
|
function qt(e, t, o = {}) {
|
|
77
|
-
const { window:
|
|
78
|
-
let
|
|
79
|
-
const
|
|
80
|
-
|
|
77
|
+
const { window: r = ve, ...c } = o;
|
|
78
|
+
let i;
|
|
79
|
+
const s = /* @__PURE__ */ Ut(() => r && "MutationObserver" in r), n = () => {
|
|
80
|
+
i && (i.disconnect(), i = void 0);
|
|
81
81
|
}, l = D(() => {
|
|
82
|
-
const
|
|
82
|
+
const y = S(e), m = $e(y).map(de).filter(Xt);
|
|
83
83
|
return new Set(m);
|
|
84
84
|
}), d = V(
|
|
85
85
|
() => l.value,
|
|
86
|
-
(
|
|
87
|
-
n(),
|
|
86
|
+
(y) => {
|
|
87
|
+
n(), s.value && y.size && (i = new MutationObserver(t), y.forEach((m) => i.observe(m, c)));
|
|
88
88
|
},
|
|
89
89
|
{ immediate: !0, flush: "post" }
|
|
90
|
-
), f = () =>
|
|
90
|
+
), f = () => i?.takeRecords(), w = () => {
|
|
91
91
|
d(), n();
|
|
92
92
|
};
|
|
93
|
-
return Ye(
|
|
94
|
-
isSupported:
|
|
95
|
-
stop:
|
|
93
|
+
return Ye(w), {
|
|
94
|
+
isSupported: s,
|
|
95
|
+
stop: w,
|
|
96
96
|
takeRecords: f
|
|
97
97
|
};
|
|
98
98
|
}
|
|
99
99
|
function Jt(e, t, o = {}) {
|
|
100
100
|
const {
|
|
101
|
-
window:
|
|
102
|
-
document:
|
|
103
|
-
flush:
|
|
101
|
+
window: r = ve,
|
|
102
|
+
document: c = r?.document,
|
|
103
|
+
flush: i = "sync"
|
|
104
104
|
} = o;
|
|
105
|
-
if (!
|
|
105
|
+
if (!r || !c)
|
|
106
106
|
return Vt;
|
|
107
|
-
let
|
|
107
|
+
let s;
|
|
108
108
|
const n = (f) => {
|
|
109
|
-
|
|
109
|
+
s?.(), s = f;
|
|
110
110
|
}, l = Tt(() => {
|
|
111
111
|
const f = de(e);
|
|
112
112
|
if (f) {
|
|
113
|
-
const { stop:
|
|
114
|
-
|
|
115
|
-
(
|
|
116
|
-
|
|
113
|
+
const { stop: w } = qt(
|
|
114
|
+
c,
|
|
115
|
+
(y) => {
|
|
116
|
+
y.map((m) => [...m.removedNodes]).flat().some((m) => m === f || m.contains(f)) && t(y);
|
|
117
117
|
},
|
|
118
118
|
{
|
|
119
|
-
window:
|
|
119
|
+
window: r,
|
|
120
120
|
childList: !0,
|
|
121
121
|
subtree: !0
|
|
122
122
|
}
|
|
123
123
|
);
|
|
124
|
-
n(
|
|
124
|
+
n(w);
|
|
125
125
|
}
|
|
126
|
-
}, { flush:
|
|
126
|
+
}, { flush: i }), d = () => {
|
|
127
127
|
l(), n();
|
|
128
128
|
};
|
|
129
129
|
return Ye(d), d;
|
|
@@ -133,69 +133,69 @@ function Zt(e = {}) {
|
|
|
133
133
|
var t;
|
|
134
134
|
const {
|
|
135
135
|
window: o = ve,
|
|
136
|
-
deep:
|
|
137
|
-
triggerOnRemoval:
|
|
138
|
-
} = e,
|
|
136
|
+
deep: r = !0,
|
|
137
|
+
triggerOnRemoval: c = !1
|
|
138
|
+
} = e, i = (t = e.document) != null ? t : o?.document, s = () => {
|
|
139
139
|
var d;
|
|
140
|
-
let f =
|
|
141
|
-
if (
|
|
140
|
+
let f = i?.activeElement;
|
|
141
|
+
if (r)
|
|
142
142
|
for (; f?.shadowRoot; )
|
|
143
143
|
f = (d = f?.shadowRoot) == null ? void 0 : d.activeElement;
|
|
144
144
|
return f;
|
|
145
145
|
}, n = G(), l = () => {
|
|
146
|
-
n.value =
|
|
146
|
+
n.value = s();
|
|
147
147
|
};
|
|
148
148
|
if (o) {
|
|
149
149
|
const d = {
|
|
150
150
|
capture: !0,
|
|
151
151
|
passive: !0
|
|
152
152
|
};
|
|
153
|
-
|
|
153
|
+
pe(
|
|
154
154
|
o,
|
|
155
155
|
"blur",
|
|
156
156
|
(f) => {
|
|
157
157
|
f.relatedTarget === null && l();
|
|
158
158
|
},
|
|
159
159
|
d
|
|
160
|
-
),
|
|
160
|
+
), pe(
|
|
161
161
|
o,
|
|
162
162
|
"focus",
|
|
163
163
|
l,
|
|
164
164
|
d
|
|
165
165
|
);
|
|
166
166
|
}
|
|
167
|
-
return
|
|
167
|
+
return c && Jt(n, l, { document: i }), l(), n;
|
|
168
168
|
}
|
|
169
169
|
const Qt = "focusin", Kt = "focusout", _t = ":focus-within";
|
|
170
170
|
function en(e, t = {}) {
|
|
171
|
-
const { window: o = ve } = t,
|
|
171
|
+
const { window: o = ve } = t, r = D(() => de(e)), c = G(!1), i = D(() => c.value);
|
|
172
172
|
if (!o || !(/* @__PURE__ */ Zt(t)).value)
|
|
173
|
-
return { focused:
|
|
174
|
-
const
|
|
175
|
-
return
|
|
173
|
+
return { focused: i };
|
|
174
|
+
const s = { passive: !0 };
|
|
175
|
+
return pe(r, Qt, () => c.value = !0, s), pe(r, Kt, () => {
|
|
176
176
|
var n, l, d;
|
|
177
|
-
return
|
|
178
|
-
},
|
|
177
|
+
return c.value = (d = (l = (n = r.value) == null ? void 0 : n.matches) == null ? void 0 : l.call(n, _t)) != null ? d : !1;
|
|
178
|
+
}, s), { focused: i };
|
|
179
179
|
}
|
|
180
180
|
function tn(e, { window: t = ve, scrollTarget: o } = {}) {
|
|
181
|
-
const
|
|
181
|
+
const r = z(!1), c = () => {
|
|
182
182
|
if (!t) return;
|
|
183
|
-
const
|
|
184
|
-
if (!
|
|
185
|
-
|
|
183
|
+
const i = t.document, s = de(e);
|
|
184
|
+
if (!s)
|
|
185
|
+
r.value = !1;
|
|
186
186
|
else {
|
|
187
|
-
const n =
|
|
188
|
-
|
|
187
|
+
const n = s.getBoundingClientRect();
|
|
188
|
+
r.value = n.top <= (t.innerHeight || i.documentElement.clientHeight) && n.left <= (t.innerWidth || i.documentElement.clientWidth) && n.bottom >= 0 && n.right >= 0;
|
|
189
189
|
}
|
|
190
190
|
};
|
|
191
191
|
return V(
|
|
192
192
|
() => de(e),
|
|
193
|
-
() =>
|
|
193
|
+
() => c(),
|
|
194
194
|
{ immediate: !0, flush: "post" }
|
|
195
|
-
), t &&
|
|
195
|
+
), t && pe(o || t, "scroll", c, {
|
|
196
196
|
capture: !1,
|
|
197
197
|
passive: !0
|
|
198
|
-
}),
|
|
198
|
+
}), r;
|
|
199
199
|
}
|
|
200
200
|
const Q = (e) => {
|
|
201
201
|
let t = tn(e).value;
|
|
@@ -208,8 +208,8 @@ const Q = (e) => {
|
|
|
208
208
|
if (e instanceof HTMLTableCellElement) {
|
|
209
209
|
const o = e.parentElement?.previousElementSibling;
|
|
210
210
|
if (o) {
|
|
211
|
-
const
|
|
212
|
-
|
|
211
|
+
const r = Array.from(o.children)[e.cellIndex];
|
|
212
|
+
r && (t = r);
|
|
213
213
|
}
|
|
214
214
|
} else if (e instanceof HTMLTableRowElement) {
|
|
215
215
|
const o = e.previousElementSibling;
|
|
@@ -220,16 +220,16 @@ const Q = (e) => {
|
|
|
220
220
|
const t = e.target;
|
|
221
221
|
let o;
|
|
222
222
|
if (t instanceof HTMLTableCellElement) {
|
|
223
|
-
const
|
|
224
|
-
if (
|
|
225
|
-
const
|
|
226
|
-
|
|
223
|
+
const r = t.parentElement?.parentElement;
|
|
224
|
+
if (r) {
|
|
225
|
+
const c = r.firstElementChild?.children[t.cellIndex];
|
|
226
|
+
c && (o = c);
|
|
227
227
|
}
|
|
228
228
|
} else if (t instanceof HTMLTableRowElement) {
|
|
229
|
-
const
|
|
230
|
-
if (
|
|
231
|
-
const
|
|
232
|
-
|
|
229
|
+
const r = t.parentElement;
|
|
230
|
+
if (r) {
|
|
231
|
+
const c = r.firstElementChild;
|
|
232
|
+
c && (o = c);
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
235
|
return o && (!K(o) || !Q(o)) ? Ue(o) : o;
|
|
@@ -241,8 +241,8 @@ const Q = (e) => {
|
|
|
241
241
|
if (e instanceof HTMLTableCellElement) {
|
|
242
242
|
const o = e.parentElement?.nextElementSibling;
|
|
243
243
|
if (o) {
|
|
244
|
-
const
|
|
245
|
-
|
|
244
|
+
const r = Array.from(o.children)[e.cellIndex];
|
|
245
|
+
r && (t = r);
|
|
246
246
|
}
|
|
247
247
|
} else if (e instanceof HTMLTableRowElement) {
|
|
248
248
|
const o = e.nextElementSibling;
|
|
@@ -253,16 +253,16 @@ const Q = (e) => {
|
|
|
253
253
|
const t = e.target;
|
|
254
254
|
let o;
|
|
255
255
|
if (t instanceof HTMLTableCellElement) {
|
|
256
|
-
const
|
|
257
|
-
if (
|
|
258
|
-
const
|
|
259
|
-
|
|
256
|
+
const r = t.parentElement?.parentElement;
|
|
257
|
+
if (r) {
|
|
258
|
+
const c = r.lastElementChild?.children[t.cellIndex];
|
|
259
|
+
c && (o = c);
|
|
260
260
|
}
|
|
261
261
|
} else if (t instanceof HTMLTableRowElement) {
|
|
262
|
-
const
|
|
263
|
-
if (
|
|
264
|
-
const
|
|
265
|
-
|
|
262
|
+
const r = t.parentElement;
|
|
263
|
+
if (r) {
|
|
264
|
+
const c = r.lastElementChild;
|
|
265
|
+
c && (o = c);
|
|
266
266
|
}
|
|
267
267
|
}
|
|
268
268
|
return o && (!K(o) || !Q(o)) ? je(o) : o;
|
|
@@ -354,71 +354,71 @@ const Q = (e) => {
|
|
|
354
354
|
}
|
|
355
355
|
};
|
|
356
356
|
function Qe(e) {
|
|
357
|
-
const t = (
|
|
357
|
+
const t = (s) => {
|
|
358
358
|
let n = null;
|
|
359
|
-
return
|
|
360
|
-
}, o = (
|
|
361
|
-
const n = t(
|
|
359
|
+
return s.parent && (typeof s.parent == "string" ? n = document.querySelector(s.parent) : s.parent instanceof HTMLElement ? n = s.parent : n = s.parent.value), n;
|
|
360
|
+
}, o = (s) => {
|
|
361
|
+
const n = t(s);
|
|
362
362
|
let l = [];
|
|
363
|
-
if (typeof
|
|
364
|
-
l = n ? Array.from(n.querySelectorAll(
|
|
365
|
-
else if (Array.isArray(
|
|
366
|
-
for (const d of
|
|
363
|
+
if (typeof s.selectors == "string")
|
|
364
|
+
l = n ? Array.from(n.querySelectorAll(s.selectors)) : Array.from(document.querySelectorAll(s.selectors));
|
|
365
|
+
else if (Array.isArray(s.selectors))
|
|
366
|
+
for (const d of s.selectors)
|
|
367
367
|
d instanceof HTMLElement ? l.push(d) : l.push(d.$el);
|
|
368
|
-
else if (
|
|
369
|
-
l.push(
|
|
370
|
-
else if (
|
|
371
|
-
if (Array.isArray(
|
|
372
|
-
for (const d of
|
|
368
|
+
else if (s.selectors instanceof HTMLElement)
|
|
369
|
+
l.push(s.selectors);
|
|
370
|
+
else if (s.selectors?.value)
|
|
371
|
+
if (Array.isArray(s.selectors.value))
|
|
372
|
+
for (const d of s.selectors.value)
|
|
373
373
|
d instanceof HTMLElement ? l.push(d) : l.push(d.$el);
|
|
374
374
|
else
|
|
375
|
-
l.push(
|
|
375
|
+
l.push(s.selectors.value);
|
|
376
376
|
return l;
|
|
377
|
-
},
|
|
378
|
-
const n = t(
|
|
377
|
+
}, r = (s) => {
|
|
378
|
+
const n = t(s);
|
|
379
379
|
let l = [];
|
|
380
|
-
return
|
|
381
|
-
},
|
|
380
|
+
return s.selectors ? l = o(s) : n && (l = Array.from(n.children).filter((d) => K(d) && Q(d))), l;
|
|
381
|
+
}, c = (s) => (n) => {
|
|
382
382
|
const l = ln[n.key] || n.key.toLowerCase();
|
|
383
383
|
if (Ee.includes(l)) return;
|
|
384
|
-
const d =
|
|
384
|
+
const d = s.handlers || Ze;
|
|
385
385
|
for (const f of Object.keys(d)) {
|
|
386
|
-
const [
|
|
387
|
-
if (
|
|
388
|
-
const m = d[f],
|
|
386
|
+
const [w, ...y] = f.split(".");
|
|
387
|
+
if (w === "keydown" && y.includes(l)) {
|
|
388
|
+
const m = d[f], E = y.filter((v) => Ee.includes(v)), p = Ee.some((v) => {
|
|
389
389
|
const g = v.charAt(0).toUpperCase() + v.slice(1);
|
|
390
390
|
return n.getModifierState(g);
|
|
391
391
|
});
|
|
392
|
-
if (
|
|
393
|
-
if (
|
|
392
|
+
if (E.length > 0) {
|
|
393
|
+
if (p) {
|
|
394
394
|
for (const v of Ee)
|
|
395
|
-
if (
|
|
395
|
+
if (y.includes(v)) {
|
|
396
396
|
const g = v.charAt(0).toUpperCase() + v.slice(1);
|
|
397
397
|
n.getModifierState(g) && m(n);
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
400
|
} else
|
|
401
|
-
|
|
401
|
+
p || m(n);
|
|
402
402
|
}
|
|
403
403
|
}
|
|
404
|
-
},
|
|
404
|
+
}, i = [];
|
|
405
405
|
re(() => {
|
|
406
|
-
for (const
|
|
407
|
-
const n = t(
|
|
408
|
-
for (const
|
|
409
|
-
const { focused:
|
|
410
|
-
|
|
406
|
+
for (const s of e) {
|
|
407
|
+
const n = t(s), l = r(s), d = c(s), f = n ? [n] : l;
|
|
408
|
+
for (const w of f) {
|
|
409
|
+
const { focused: y } = en(z(w)), m = V(y, (E) => {
|
|
410
|
+
E ? w.addEventListener("keydown", d) : w.removeEventListener("keydown", d);
|
|
411
411
|
});
|
|
412
|
-
|
|
412
|
+
i.push(m);
|
|
413
413
|
}
|
|
414
414
|
}
|
|
415
415
|
}), At(() => {
|
|
416
|
-
for (const
|
|
417
|
-
|
|
416
|
+
for (const s of i)
|
|
417
|
+
s();
|
|
418
418
|
});
|
|
419
419
|
}
|
|
420
420
|
function me(e) {
|
|
421
|
-
return
|
|
421
|
+
return pt() ? (xt(e), !0) : !1;
|
|
422
422
|
}
|
|
423
423
|
const Te = typeof window < "u" && typeof document < "u";
|
|
424
424
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
@@ -432,29 +432,29 @@ 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(
|
|
435
|
+
return typeof t == "function" ? Pt(yt(() => ({ get: t, set: Z }))) : z(t);
|
|
436
436
|
}
|
|
437
437
|
function un(e, t) {
|
|
438
|
-
function o(...
|
|
439
|
-
return new Promise((
|
|
440
|
-
Promise.resolve(e(() => t.apply(this,
|
|
438
|
+
function o(...r) {
|
|
439
|
+
return new Promise((c, i) => {
|
|
440
|
+
Promise.resolve(e(() => t.apply(this, r), { fn: t, thisArg: this, args: r })).then(c).catch(i);
|
|
441
441
|
});
|
|
442
442
|
}
|
|
443
443
|
return o;
|
|
444
444
|
}
|
|
445
445
|
function dn(e, t = {}) {
|
|
446
|
-
let o,
|
|
447
|
-
const
|
|
448
|
-
clearTimeout(l),
|
|
446
|
+
let o, r, c = Z;
|
|
447
|
+
const i = (l) => {
|
|
448
|
+
clearTimeout(l), c(), c = Z;
|
|
449
449
|
};
|
|
450
|
-
let
|
|
450
|
+
let s;
|
|
451
451
|
return (l) => {
|
|
452
|
-
const d =
|
|
453
|
-
return o &&
|
|
454
|
-
|
|
455
|
-
o &&
|
|
452
|
+
const d = S(e), f = S(t.maxWait);
|
|
453
|
+
return o && i(o), d <= 0 || f !== void 0 && f <= 0 ? (r && (i(r), r = void 0), Promise.resolve(l())) : new Promise((w, y) => {
|
|
454
|
+
c = t.rejectOnCancel ? y : w, s = l, f && !r && (r = setTimeout(() => {
|
|
455
|
+
o && i(o), r = void 0, w(s());
|
|
456
456
|
}, f)), o = setTimeout(() => {
|
|
457
|
-
|
|
457
|
+
r && i(r), r = void 0, w(l());
|
|
458
458
|
}, d);
|
|
459
459
|
});
|
|
460
460
|
};
|
|
@@ -476,23 +476,23 @@ function mn(e, t = {}) {
|
|
|
476
476
|
if (!Dt(e))
|
|
477
477
|
return Ot(e);
|
|
478
478
|
const o = Array.isArray(e.value) ? Array.from({ length: e.value.length }) : {};
|
|
479
|
-
for (const
|
|
480
|
-
o[
|
|
479
|
+
for (const r in e.value)
|
|
480
|
+
o[r] = yt(() => ({
|
|
481
481
|
get() {
|
|
482
|
-
return e.value[
|
|
482
|
+
return e.value[r];
|
|
483
483
|
},
|
|
484
|
-
set(
|
|
485
|
-
var
|
|
486
|
-
if ((
|
|
484
|
+
set(c) {
|
|
485
|
+
var i;
|
|
486
|
+
if ((i = S(t.replaceRef)) != null ? i : !0)
|
|
487
487
|
if (Array.isArray(e.value)) {
|
|
488
488
|
const n = [...e.value];
|
|
489
|
-
n[
|
|
489
|
+
n[r] = c, e.value = n;
|
|
490
490
|
} else {
|
|
491
|
-
const n = { ...e.value, [
|
|
491
|
+
const n = { ...e.value, [r]: c };
|
|
492
492
|
Object.setPrototypeOf(n, Object.getPrototypeOf(e.value)), e.value = n;
|
|
493
493
|
}
|
|
494
494
|
else
|
|
495
|
-
e.value[
|
|
495
|
+
e.value[r] = c;
|
|
496
496
|
}
|
|
497
497
|
}));
|
|
498
498
|
return o;
|
|
@@ -513,43 +513,43 @@ function Et(e, t, o) {
|
|
|
513
513
|
const De = Te ? window : void 0;
|
|
514
514
|
function fe(e) {
|
|
515
515
|
var t;
|
|
516
|
-
const o =
|
|
516
|
+
const o = S(e);
|
|
517
517
|
return (t = o?.$el) != null ? t : o;
|
|
518
518
|
}
|
|
519
519
|
function he(...e) {
|
|
520
520
|
const t = [], o = () => {
|
|
521
521
|
t.forEach((n) => n()), t.length = 0;
|
|
522
|
-
},
|
|
523
|
-
const n = se(
|
|
522
|
+
}, r = (n, l, d, f) => (n.addEventListener(l, d, f), () => n.removeEventListener(l, d, f)), c = D(() => {
|
|
523
|
+
const n = se(S(e[0])).filter((l) => l != null);
|
|
524
524
|
return n.every((l) => typeof l != "string") ? n : void 0;
|
|
525
|
-
}),
|
|
525
|
+
}), i = Et(
|
|
526
526
|
() => {
|
|
527
527
|
var n, l;
|
|
528
528
|
return [
|
|
529
|
-
(l = (n =
|
|
530
|
-
se(
|
|
531
|
-
se(R(
|
|
529
|
+
(l = (n = c.value) == null ? void 0 : n.map((d) => fe(d))) != null ? l : [De].filter((d) => d != null),
|
|
530
|
+
se(S(c.value ? e[1] : e[0])),
|
|
531
|
+
se(R(c.value ? e[2] : e[1])),
|
|
532
532
|
// @ts-expect-error - TypeScript gets the correct types, but somehow still complains
|
|
533
|
-
|
|
533
|
+
S(c.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 w = Ct(f) ? { ...f } : f;
|
|
540
540
|
t.push(
|
|
541
541
|
...n.flatMap(
|
|
542
|
-
(
|
|
543
|
-
(m) => d.map((
|
|
542
|
+
(y) => l.flatMap(
|
|
543
|
+
(m) => d.map((E) => r(y, m, E, w))
|
|
544
544
|
)
|
|
545
545
|
)
|
|
546
546
|
);
|
|
547
547
|
},
|
|
548
548
|
{ flush: "post" }
|
|
549
|
-
),
|
|
550
|
-
|
|
549
|
+
), s = () => {
|
|
550
|
+
i(), o();
|
|
551
551
|
};
|
|
552
|
-
return me(o),
|
|
552
|
+
return me(o), s;
|
|
553
553
|
}
|
|
554
554
|
// @__NO_SIDE_EFFECTS__
|
|
555
555
|
function hn() {
|
|
@@ -564,78 +564,78 @@ function It(e) {
|
|
|
564
564
|
return D(() => (t.value, !!e()));
|
|
565
565
|
}
|
|
566
566
|
function kt(e, t, o = {}) {
|
|
567
|
-
const { window:
|
|
568
|
-
let
|
|
569
|
-
const
|
|
570
|
-
|
|
567
|
+
const { window: r = De, ...c } = o;
|
|
568
|
+
let i;
|
|
569
|
+
const s = /* @__PURE__ */ It(() => r && "MutationObserver" in r), n = () => {
|
|
570
|
+
i && (i.disconnect(), i = void 0);
|
|
571
571
|
}, l = D(() => {
|
|
572
|
-
const
|
|
572
|
+
const y = S(e), m = se(y).map(fe).filter(an);
|
|
573
573
|
return new Set(m);
|
|
574
574
|
}), d = V(
|
|
575
575
|
() => l.value,
|
|
576
|
-
(
|
|
577
|
-
n(),
|
|
576
|
+
(y) => {
|
|
577
|
+
n(), s.value && y.size && (i = new MutationObserver(t), y.forEach((m) => i.observe(m, c)));
|
|
578
578
|
},
|
|
579
579
|
{ immediate: !0, flush: "post" }
|
|
580
|
-
), f = () =>
|
|
580
|
+
), f = () => i?.takeRecords(), w = () => {
|
|
581
581
|
d(), n();
|
|
582
582
|
};
|
|
583
|
-
return me(
|
|
584
|
-
isSupported:
|
|
585
|
-
stop:
|
|
583
|
+
return me(w), {
|
|
584
|
+
isSupported: s,
|
|
585
|
+
stop: w,
|
|
586
586
|
takeRecords: f
|
|
587
587
|
};
|
|
588
588
|
}
|
|
589
589
|
function We(e, t = {}) {
|
|
590
590
|
var o;
|
|
591
591
|
const {
|
|
592
|
-
pointerTypes:
|
|
593
|
-
preventDefault:
|
|
594
|
-
stopPropagation:
|
|
595
|
-
exact:
|
|
592
|
+
pointerTypes: r,
|
|
593
|
+
preventDefault: c,
|
|
594
|
+
stopPropagation: i,
|
|
595
|
+
exact: s,
|
|
596
596
|
onMove: n,
|
|
597
597
|
onEnd: l,
|
|
598
598
|
onStart: d,
|
|
599
599
|
initialValue: f,
|
|
600
|
-
axis:
|
|
601
|
-
draggingElement:
|
|
600
|
+
axis: w = "both",
|
|
601
|
+
draggingElement: y = De,
|
|
602
602
|
containerElement: m,
|
|
603
|
-
handle:
|
|
604
|
-
buttons:
|
|
603
|
+
handle: E = e,
|
|
604
|
+
buttons: p = [0]
|
|
605
605
|
} = t, v = z(
|
|
606
|
-
(o =
|
|
607
|
-
), g = z(), b = (
|
|
608
|
-
|
|
609
|
-
}, B = (
|
|
606
|
+
(o = S(f)) != null ? o : { x: 0, y: 0 }
|
|
607
|
+
), g = z(), b = (x) => r ? r.includes(x.pointerType) : !0, P = (x) => {
|
|
608
|
+
S(c) && x.preventDefault(), S(i) && x.stopPropagation();
|
|
609
|
+
}, B = (x) => {
|
|
610
610
|
var $;
|
|
611
|
-
if (!
|
|
611
|
+
if (!S(p).includes(x.button) || S(t.disabled) || !b(x) || S(s) && x.target !== S(e))
|
|
612
612
|
return;
|
|
613
|
-
const X =
|
|
614
|
-
x:
|
|
615
|
-
y:
|
|
613
|
+
const X = S(m), W = ($ = X?.getBoundingClientRect) == null ? void 0 : $.call(X), O = S(e).getBoundingClientRect(), Y = {
|
|
614
|
+
x: x.clientX - (X ? O.left - W.left + X.scrollLeft : O.left),
|
|
615
|
+
y: x.clientY - (X ? O.top - W.top + X.scrollTop : O.top)
|
|
616
616
|
};
|
|
617
|
-
d?.(Y,
|
|
618
|
-
}, F = (
|
|
619
|
-
if (
|
|
617
|
+
d?.(Y, x) !== !1 && (g.value = Y, P(x));
|
|
618
|
+
}, F = (x) => {
|
|
619
|
+
if (S(t.disabled) || !b(x) || !g.value)
|
|
620
620
|
return;
|
|
621
|
-
const $ =
|
|
621
|
+
const $ = S(m), X = S(e).getBoundingClientRect();
|
|
622
622
|
let { x: W, y: O } = v.value;
|
|
623
|
-
(
|
|
623
|
+
(w === "x" || w === "both") && (W = x.clientX - g.value.x, $ && (W = Math.min(Math.max(0, W), $.scrollWidth - X.width))), (w === "y" || w === "both") && (O = x.clientY - g.value.y, $ && (O = Math.min(Math.max(0, O), $.scrollHeight - X.height))), v.value = {
|
|
624
624
|
x: W,
|
|
625
625
|
y: O
|
|
626
|
-
}, n?.(v.value,
|
|
627
|
-
},
|
|
628
|
-
|
|
626
|
+
}, n?.(v.value, x), P(x);
|
|
627
|
+
}, M = (x) => {
|
|
628
|
+
S(t.disabled) || !b(x) || g.value && (g.value = void 0, l?.(v.value, x), P(x));
|
|
629
629
|
};
|
|
630
630
|
if (Te) {
|
|
631
|
-
const
|
|
631
|
+
const x = () => {
|
|
632
632
|
var $;
|
|
633
633
|
return {
|
|
634
634
|
capture: ($ = t.capture) != null ? $ : !0,
|
|
635
|
-
passive: !
|
|
635
|
+
passive: !S(c)
|
|
636
636
|
};
|
|
637
637
|
};
|
|
638
|
-
he(
|
|
638
|
+
he(E, "pointerdown", B, x), he(y, "pointermove", F, x), he(y, "pointerup", M, x);
|
|
639
639
|
}
|
|
640
640
|
return {
|
|
641
641
|
...mn(v),
|
|
@@ -646,21 +646,21 @@ function We(e, t = {}) {
|
|
|
646
646
|
)
|
|
647
647
|
};
|
|
648
648
|
}
|
|
649
|
-
function
|
|
650
|
-
const { window:
|
|
651
|
-
let
|
|
652
|
-
const
|
|
653
|
-
|
|
649
|
+
function wn(e, t, o = {}) {
|
|
650
|
+
const { window: r = De, ...c } = o;
|
|
651
|
+
let i;
|
|
652
|
+
const s = /* @__PURE__ */ It(() => r && "ResizeObserver" in r), n = () => {
|
|
653
|
+
i && (i.disconnect(), i = void 0);
|
|
654
654
|
}, l = D(() => {
|
|
655
|
-
const
|
|
656
|
-
return Array.isArray(
|
|
655
|
+
const w = S(e);
|
|
656
|
+
return Array.isArray(w) ? w.map((y) => fe(y)) : [fe(w)];
|
|
657
657
|
}), d = V(
|
|
658
658
|
l,
|
|
659
|
-
(
|
|
660
|
-
if (n(),
|
|
661
|
-
|
|
662
|
-
for (const
|
|
663
|
-
|
|
659
|
+
(w) => {
|
|
660
|
+
if (n(), s.value && r) {
|
|
661
|
+
i = new ResizeObserver(t);
|
|
662
|
+
for (const y of w)
|
|
663
|
+
y && i.observe(y, c);
|
|
664
664
|
}
|
|
665
665
|
},
|
|
666
666
|
{ immediate: !0, flush: "post" }
|
|
@@ -668,50 +668,50 @@ function pn(e, t, o = {}) {
|
|
|
668
668
|
n(), d();
|
|
669
669
|
};
|
|
670
670
|
return me(f), {
|
|
671
|
-
isSupported:
|
|
671
|
+
isSupported: s,
|
|
672
672
|
stop: f
|
|
673
673
|
};
|
|
674
674
|
}
|
|
675
675
|
function oe(e, t = {}) {
|
|
676
676
|
const {
|
|
677
677
|
reset: o = !0,
|
|
678
|
-
windowResize:
|
|
679
|
-
windowScroll:
|
|
680
|
-
immediate:
|
|
681
|
-
updateTiming:
|
|
682
|
-
} = t, n = G(0), l = G(0), d = G(0), f = G(0),
|
|
683
|
-
function
|
|
678
|
+
windowResize: r = !0,
|
|
679
|
+
windowScroll: c = !0,
|
|
680
|
+
immediate: i = !0,
|
|
681
|
+
updateTiming: s = "sync"
|
|
682
|
+
} = t, n = G(0), l = G(0), d = G(0), f = G(0), w = G(0), y = G(0), m = G(0), E = G(0);
|
|
683
|
+
function p() {
|
|
684
684
|
const g = fe(e);
|
|
685
685
|
if (!g) {
|
|
686
|
-
o && (n.value = 0, l.value = 0, d.value = 0, f.value = 0,
|
|
686
|
+
o && (n.value = 0, l.value = 0, d.value = 0, f.value = 0, w.value = 0, y.value = 0, m.value = 0, E.value = 0);
|
|
687
687
|
return;
|
|
688
688
|
}
|
|
689
689
|
const b = g.getBoundingClientRect();
|
|
690
|
-
n.value = b.height, l.value = b.bottom, d.value = b.left, f.value = b.right,
|
|
690
|
+
n.value = b.height, l.value = b.bottom, d.value = b.left, f.value = b.right, w.value = b.top, y.value = b.width, m.value = b.x, E.value = b.y;
|
|
691
691
|
}
|
|
692
692
|
function v() {
|
|
693
|
-
|
|
693
|
+
s === "sync" ? p() : s === "next-frame" && requestAnimationFrame(() => p());
|
|
694
694
|
}
|
|
695
|
-
return
|
|
695
|
+
return wn(e, v), V(() => fe(e), (g) => !g && v()), kt(e, v, {
|
|
696
696
|
attributeFilter: ["style", "class"]
|
|
697
|
-
}),
|
|
698
|
-
|
|
697
|
+
}), c && he("scroll", v, { capture: !0, passive: !0 }), r && he("resize", v, { passive: !0 }), gn(() => {
|
|
698
|
+
i && 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: w,
|
|
705
|
+
width: y,
|
|
706
706
|
x: m,
|
|
707
|
-
y:
|
|
707
|
+
y: E,
|
|
708
708
|
update: v
|
|
709
709
|
};
|
|
710
710
|
}
|
|
711
|
-
const
|
|
711
|
+
const pn = (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
|
-
},
|
|
714
|
+
}, xn = (e = 8) => Array.from({ length: e }, () => Math.floor(Math.random() * 16).toString(16)).join(""), yn = ["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,120 +723,120 @@ const wn = (e) => {
|
|
|
723
723
|
debounce: { default: 300 }
|
|
724
724
|
},
|
|
725
725
|
setup(e, { expose: t }) {
|
|
726
|
-
const o = U("cell"),
|
|
726
|
+
const o = U("cell"), r = e.store.getCellData(e.colIndex, e.rowIndex), c = z(""), i = z(!1), s = e.store.columns[e.colIndex], n = e.store.rows[e.rowIndex], l = s.align || "center", d = s.width || "40ch", f = D(() => e.store.getCellDisplayValue(e.colIndex, e.rowIndex)), w = D(() => typeof f.value == "string" ? pn(f.value) : !1), y = D(() => ({
|
|
727
727
|
textAlign: l,
|
|
728
728
|
width: d,
|
|
729
|
-
fontWeight:
|
|
729
|
+
fontWeight: i.value ? "bold" : "inherit",
|
|
730
730
|
paddingLeft: e.store.getIndent(e.colIndex, e.store.display[e.rowIndex]?.indent)
|
|
731
731
|
})), m = D(() => ({
|
|
732
732
|
"sticky-column": e.pinned,
|
|
733
|
-
"cell-modified":
|
|
734
|
-
})),
|
|
735
|
-
v(),
|
|
736
|
-
},
|
|
737
|
-
const { left:
|
|
738
|
-
|
|
739
|
-
W.modal.visible = !0, W.modal.colIndex = e.colIndex, W.modal.rowIndex = e.rowIndex, W.modal.left =
|
|
733
|
+
"cell-modified": i.value
|
|
734
|
+
})), E = () => {
|
|
735
|
+
v(), p();
|
|
736
|
+
}, p = () => {
|
|
737
|
+
const { left: M, bottom: x, width: $, height: X } = oe(o);
|
|
738
|
+
s.mask, s.modalComponent && e.store.$patch((W) => {
|
|
739
|
+
W.modal.visible = !0, W.modal.colIndex = e.colIndex, W.modal.rowIndex = e.rowIndex, W.modal.left = M, W.modal.bottom = x, W.modal.width = $, W.modal.height = X, W.modal.cell = o.value, typeof s.modalComponent == "function" ? W.modal.component = s.modalComponent({ table: W.table, row: n, column: s }) : W.modal.component = s.modalComponent, W.modal.componentProps = s.modalComponentExtraProps;
|
|
740
740
|
});
|
|
741
741
|
};
|
|
742
742
|
if (e.addNavigation) {
|
|
743
|
-
let
|
|
743
|
+
let M = {
|
|
744
744
|
...Ze,
|
|
745
|
-
"keydown.f2":
|
|
746
|
-
"keydown.alt.up":
|
|
747
|
-
"keydown.alt.down":
|
|
748
|
-
"keydown.alt.left":
|
|
749
|
-
"keydown.alt.right":
|
|
745
|
+
"keydown.f2": p,
|
|
746
|
+
"keydown.alt.up": p,
|
|
747
|
+
"keydown.alt.down": p,
|
|
748
|
+
"keydown.alt.left": p,
|
|
749
|
+
"keydown.alt.right": p
|
|
750
750
|
};
|
|
751
|
-
typeof e.addNavigation == "object" && (
|
|
752
|
-
...
|
|
751
|
+
typeof e.addNavigation == "object" && (M = {
|
|
752
|
+
...M,
|
|
753
753
|
...e.addNavigation
|
|
754
754
|
}), Qe([
|
|
755
755
|
{
|
|
756
756
|
selectors: o,
|
|
757
|
-
handlers:
|
|
757
|
+
handlers: M
|
|
758
758
|
}
|
|
759
759
|
]);
|
|
760
760
|
}
|
|
761
761
|
const v = () => {
|
|
762
|
-
if (o.value &&
|
|
763
|
-
const
|
|
764
|
-
if (
|
|
762
|
+
if (o.value && s.edit) {
|
|
763
|
+
const M = window.getSelection();
|
|
764
|
+
if (M)
|
|
765
765
|
try {
|
|
766
|
-
const
|
|
767
|
-
|
|
766
|
+
const x = document.createRange();
|
|
767
|
+
x.selectNodeContents && (x.selectNodeContents(o.value), M.removeAllRanges(), M.addRange(x));
|
|
768
768
|
} catch {
|
|
769
769
|
}
|
|
770
770
|
}
|
|
771
771
|
}, g = () => {
|
|
772
|
-
o.value && (
|
|
772
|
+
o.value && (c.value = o.value.textContent, v());
|
|
773
773
|
}, b = () => {
|
|
774
774
|
try {
|
|
775
|
-
const
|
|
776
|
-
if (
|
|
777
|
-
const
|
|
775
|
+
const M = window.getSelection();
|
|
776
|
+
if (M && M.rangeCount > 0 && o.value) {
|
|
777
|
+
const x = M.getRangeAt(0), $ = x.cloneRange();
|
|
778
778
|
if ($.selectNodeContents && $.setEnd)
|
|
779
|
-
return $.selectNodeContents(o.value), $.setEnd(
|
|
779
|
+
return $.selectNodeContents(o.value), $.setEnd(x.endContainer, x.endOffset), $.toString().length;
|
|
780
780
|
}
|
|
781
781
|
} catch {
|
|
782
782
|
}
|
|
783
783
|
return 0;
|
|
784
|
-
}, P = (
|
|
784
|
+
}, P = (M) => {
|
|
785
785
|
if (o.value)
|
|
786
786
|
try {
|
|
787
|
-
const
|
|
788
|
-
if (!
|
|
787
|
+
const x = window.getSelection();
|
|
788
|
+
if (!x) return;
|
|
789
789
|
let $ = 0;
|
|
790
790
|
const X = document.createTreeWalker ? document.createTreeWalker(o.value, NodeFilter.SHOW_TEXT, null) : null;
|
|
791
791
|
if (!X) return;
|
|
792
792
|
let W, O = null;
|
|
793
793
|
for (; W = X.nextNode(); ) {
|
|
794
794
|
const Y = W, _ = $ + Y.textContent.length;
|
|
795
|
-
if (
|
|
796
|
-
O.setStart(Y,
|
|
795
|
+
if (M <= _ && (O = document.createRange(), O.setStart && O.setEnd)) {
|
|
796
|
+
O.setStart(Y, M - $), O.setEnd(Y, M - $);
|
|
797
797
|
break;
|
|
798
798
|
}
|
|
799
799
|
$ = _;
|
|
800
800
|
}
|
|
801
|
-
O &&
|
|
801
|
+
O && x.removeAllRanges && x.addRange && (x.removeAllRanges(), x.addRange(O));
|
|
802
802
|
} catch {
|
|
803
803
|
}
|
|
804
|
-
}, B = (
|
|
805
|
-
if (!
|
|
806
|
-
const
|
|
807
|
-
if (
|
|
804
|
+
}, B = (M) => {
|
|
805
|
+
if (!s.edit) return;
|
|
806
|
+
const x = M.target;
|
|
807
|
+
if (x.textContent === c.value)
|
|
808
808
|
return;
|
|
809
809
|
const $ = b();
|
|
810
|
-
|
|
810
|
+
c.value = x.textContent, s.format ? (i.value = x.textContent !== e.store.getFormattedValue(e.colIndex, e.rowIndex, r), e.store.setCellText(e.colIndex, e.rowIndex, x.textContent)) : (i.value = x.textContent !== r, e.store.setCellData(e.colIndex, e.rowIndex, x.textContent)), Fe().then(() => {
|
|
811
811
|
P($);
|
|
812
812
|
});
|
|
813
813
|
}, F = /* @__PURE__ */ vn(B, e.debounce);
|
|
814
814
|
return t({
|
|
815
|
-
currentData:
|
|
816
|
-
}), (
|
|
815
|
+
currentData: c
|
|
816
|
+
}), (M, x) => (T(), L("td", {
|
|
817
817
|
ref: "cell",
|
|
818
|
-
"data-colindex":
|
|
819
|
-
"data-rowindex":
|
|
820
|
-
"data-editable": R(
|
|
821
|
-
contenteditable: R(
|
|
822
|
-
tabindex:
|
|
818
|
+
"data-colindex": e.colIndex,
|
|
819
|
+
"data-rowindex": e.rowIndex,
|
|
820
|
+
"data-editable": R(s).edit,
|
|
821
|
+
contenteditable: R(s).edit,
|
|
822
|
+
tabindex: e.tabIndex,
|
|
823
823
|
spellcheck: !1,
|
|
824
|
-
style: ee(
|
|
824
|
+
style: ee(y.value),
|
|
825
825
|
onFocus: g,
|
|
826
826
|
onPaste: B,
|
|
827
|
-
onInput:
|
|
827
|
+
onInput: x[0] || (x[0] = //@ts-ignore
|
|
828
828
|
(...$) => R(F) && R(F)(...$)),
|
|
829
|
-
onClick:
|
|
829
|
+
onClick: E,
|
|
830
830
|
class: q(["atable-cell", m.value])
|
|
831
831
|
}, [
|
|
832
|
-
R(
|
|
832
|
+
R(s).cellComponent ? (T(), ce(ke(R(s).cellComponent), Ve({
|
|
833
833
|
key: 0,
|
|
834
834
|
value: f.value
|
|
835
|
-
}, R(
|
|
835
|
+
}, R(s).cellComponentProps), null, 16, ["value"])) : w.value ? (T(), L("span", {
|
|
836
836
|
key: 1,
|
|
837
837
|
innerHTML: f.value
|
|
838
838
|
}, null, 8, bn)) : (T(), L("span", Cn, ue(f.value), 1))
|
|
839
|
-
], 46,
|
|
839
|
+
], 46, yn));
|
|
840
840
|
}
|
|
841
841
|
}), In = ["tabindex"], kn = ["tabindex"], $n = ["colspan"], Rn = /* @__PURE__ */ te({
|
|
842
842
|
__name: "AExpansionRow",
|
|
@@ -849,51 +849,51 @@ const wn = (e) => {
|
|
|
849
849
|
setup(e) {
|
|
850
850
|
const t = U("rowEl"), o = D(() => e.store.display[e.rowIndex].expanded ? "▼" : "►");
|
|
851
851
|
if (e.addNavigation) {
|
|
852
|
-
const
|
|
853
|
-
"keydown.control.g": (
|
|
854
|
-
|
|
852
|
+
const r = {
|
|
853
|
+
"keydown.control.g": (c) => {
|
|
854
|
+
c.stopPropagation(), c.preventDefault(), e.store.toggleRowExpand(e.rowIndex);
|
|
855
855
|
}
|
|
856
856
|
};
|
|
857
|
-
typeof e.addNavigation == "object" && Object.assign(
|
|
857
|
+
typeof e.addNavigation == "object" && Object.assign(r, e.addNavigation), Qe([
|
|
858
858
|
{
|
|
859
859
|
selectors: t,
|
|
860
|
-
handlers:
|
|
860
|
+
handlers: r
|
|
861
861
|
}
|
|
862
862
|
]);
|
|
863
863
|
}
|
|
864
|
-
return (
|
|
865
|
-
N("tr", Ve(
|
|
864
|
+
return (r, c) => (T(), L(ae, null, [
|
|
865
|
+
N("tr", Ve(r.$attrs, {
|
|
866
866
|
ref: "rowEl",
|
|
867
|
-
tabindex:
|
|
867
|
+
tabindex: e.tabIndex,
|
|
868
868
|
class: "expandable-row"
|
|
869
869
|
}), [
|
|
870
870
|
N("td", {
|
|
871
871
|
tabIndex: -1,
|
|
872
|
-
onClick:
|
|
872
|
+
onClick: c[0] || (c[0] = (i) => e.store.toggleRowExpand(e.rowIndex)),
|
|
873
873
|
class: "row-index"
|
|
874
874
|
}, ue(o.value), 1),
|
|
875
|
-
j(
|
|
875
|
+
j(r.$slots, "row", {}, void 0, !0)
|
|
876
876
|
], 16, In),
|
|
877
|
-
|
|
877
|
+
e.store.display[e.rowIndex].expanded ? (T(), L("tr", {
|
|
878
878
|
key: 0,
|
|
879
879
|
ref: "rowExpanded",
|
|
880
|
-
tabindex:
|
|
880
|
+
tabindex: e.tabIndex,
|
|
881
881
|
class: "expanded-row"
|
|
882
882
|
}, [
|
|
883
883
|
N("td", {
|
|
884
884
|
tabIndex: -1,
|
|
885
|
-
colspan:
|
|
885
|
+
colspan: e.store.columns.length + 1,
|
|
886
886
|
class: "expanded-row-content"
|
|
887
887
|
}, [
|
|
888
|
-
j(
|
|
888
|
+
j(r.$slots, "content", {}, void 0, !0)
|
|
889
889
|
], 8, $n)
|
|
890
890
|
], 8, kn)) : J("", !0)
|
|
891
891
|
], 64));
|
|
892
892
|
}
|
|
893
893
|
}), ie = (e, t) => {
|
|
894
894
|
const o = e.__vccOpts || e;
|
|
895
|
-
for (const [
|
|
896
|
-
o[
|
|
895
|
+
for (const [r, c] of t)
|
|
896
|
+
o[r] = c;
|
|
897
897
|
return o;
|
|
898
898
|
}, Sn = /* @__PURE__ */ ie(Rn, [["__scopeId", "data-v-5ad4bb41"]]), Mn = ["colspan"], An = {
|
|
899
899
|
ref: "container",
|
|
@@ -916,16 +916,16 @@ const wn = (e) => {
|
|
|
916
916
|
},
|
|
917
917
|
emits: ["connection:create"],
|
|
918
918
|
setup(e, { expose: t, emit: o }) {
|
|
919
|
-
Lt((
|
|
920
|
-
|
|
921
|
-
|
|
919
|
+
Lt((I) => ({
|
|
920
|
+
v17bc2643: c.value,
|
|
921
|
+
v0a8a9192: I.colspan
|
|
922
922
|
}));
|
|
923
|
-
const
|
|
924
|
-
const
|
|
923
|
+
const r = o, c = z(e.color.length >= 6 ? e.color : "#cccccc"), i = `gantt-bar-row-${e.rowIndex}-col-${e.colIndex}`, s = U("container"), n = U("bar"), l = U("leftResizeHandle"), d = U("rightResizeHandle"), f = U("leftConnectionHandle"), w = U("rightConnectionHandle"), { width: y } = oe(s), { left: m, right: E } = oe(n), p = z(e.start), v = z(e.end || p.value + e.colspan), g = z(!1), b = z(!1), P = z(!1), B = z(!1), F = z(!1), M = z({ startX: 0, startY: 0, endX: 0, endY: 0 }), x = D(() => xe.value || Y.value || _.value), $ = D(() => e.colspan > 0 ? y.value / e.colspan : 0), X = D(() => {
|
|
924
|
+
const I = p.value / e.colspan * 100, a = v.value / e.colspan * 100;
|
|
925
925
|
return {
|
|
926
|
-
left: `${
|
|
927
|
-
width: `${a -
|
|
928
|
-
backgroundColor:
|
|
926
|
+
left: `${I}%`,
|
|
927
|
+
width: `${a - I}%`,
|
|
928
|
+
backgroundColor: c.value
|
|
929
929
|
};
|
|
930
930
|
}), W = D(
|
|
931
931
|
() => ({
|
|
@@ -939,85 +939,85 @@ const wn = (e) => {
|
|
|
939
939
|
})
|
|
940
940
|
), O = z({ startX: 0, startPos: 0 }), { isDragging: Y } = We(l, {
|
|
941
941
|
axis: "x",
|
|
942
|
-
onStart: () => ge(m.value,
|
|
943
|
-
onMove: ({ x:
|
|
944
|
-
onEnd: ({ x:
|
|
942
|
+
onStart: () => ge(m.value, p.value),
|
|
943
|
+
onMove: ({ x: I }) => ye(I),
|
|
944
|
+
onEnd: ({ x: I }) => Oe(I)
|
|
945
945
|
}), { isDragging: _ } = We(d, {
|
|
946
946
|
axis: "x",
|
|
947
|
-
onStart: () => ge(
|
|
948
|
-
onMove: ({ x:
|
|
949
|
-
onEnd: ({ x:
|
|
950
|
-
}), { isDragging:
|
|
947
|
+
onStart: () => ge(E.value, v.value),
|
|
948
|
+
onMove: ({ x: I }) => be(I),
|
|
949
|
+
onEnd: ({ x: I }) => _e(I)
|
|
950
|
+
}), { isDragging: xe } = We(n, {
|
|
951
951
|
exact: !0,
|
|
952
952
|
axis: "x",
|
|
953
|
-
onStart: () => ge(m.value,
|
|
954
|
-
onMove: ({ x:
|
|
955
|
-
onEnd: ({ x:
|
|
953
|
+
onStart: () => ge(m.value, p.value),
|
|
954
|
+
onMove: ({ x: I }) => et(I),
|
|
955
|
+
onEnd: ({ x: I }) => tt(I)
|
|
956
956
|
});
|
|
957
957
|
re(() => {
|
|
958
958
|
nt();
|
|
959
959
|
}), Bt(() => {
|
|
960
960
|
ot();
|
|
961
961
|
});
|
|
962
|
-
function ge(
|
|
963
|
-
n.value && (n.value.style.transition = "none"), O.value = { startX:
|
|
962
|
+
function ge(I, a) {
|
|
963
|
+
n.value && (n.value.style.transition = "none"), O.value = { startX: I, startPos: a };
|
|
964
964
|
}
|
|
965
|
-
function
|
|
965
|
+
function ye(I) {
|
|
966
966
|
if (!Y.value || !n.value) return;
|
|
967
|
-
const u = (
|
|
967
|
+
const u = (I - O.value.startX) / $.value, h = Math.max(0, Math.min(v.value - 1, O.value.startPos + u));
|
|
968
968
|
n.value.style.left = `${h / e.colspan * 100}%`, n.value.style.width = `${(v.value - h) / e.colspan * 100}%`;
|
|
969
969
|
}
|
|
970
|
-
function Oe(
|
|
970
|
+
function Oe(I) {
|
|
971
971
|
if (!n.value) return;
|
|
972
|
-
const a =
|
|
973
|
-
|
|
972
|
+
const a = I - O.value.startX, u = Math.round(a / $.value), h = p.value, C = Math.max(0, Math.min(v.value - 1, O.value.startPos + u));
|
|
973
|
+
p.value = C, e.store.updateGanttBar({
|
|
974
974
|
rowIndex: e.rowIndex,
|
|
975
975
|
colIndex: e.colIndex,
|
|
976
976
|
type: "resize",
|
|
977
977
|
edge: "start",
|
|
978
978
|
oldStart: h,
|
|
979
|
-
newStart:
|
|
979
|
+
newStart: C,
|
|
980
980
|
end: v.value,
|
|
981
981
|
delta: u,
|
|
982
982
|
oldColspan: v.value - h,
|
|
983
|
-
newColspan: v.value -
|
|
983
|
+
newColspan: v.value - C
|
|
984
984
|
});
|
|
985
985
|
}
|
|
986
|
-
function be(
|
|
986
|
+
function be(I) {
|
|
987
987
|
if (!_.value || !n.value) return;
|
|
988
|
-
const u = (
|
|
989
|
-
n.value.style.width = `${(h -
|
|
988
|
+
const u = (I - O.value.startX) / $.value, h = Math.max(p.value + 1, Math.min(e.columnsCount, O.value.startPos + u));
|
|
989
|
+
n.value.style.width = `${(h - p.value) / e.colspan * 100}%`;
|
|
990
990
|
}
|
|
991
|
-
function _e(
|
|
991
|
+
function _e(I) {
|
|
992
992
|
if (!n.value) return;
|
|
993
|
-
const a =
|
|
994
|
-
v.value =
|
|
993
|
+
const a = I - O.value.startX, u = Math.round(a / $.value), h = v.value, C = Math.max(p.value + 1, Math.min(e.columnsCount, O.value.startPos + u));
|
|
994
|
+
v.value = C, e.store.updateGanttBar({
|
|
995
995
|
rowIndex: e.rowIndex,
|
|
996
996
|
colIndex: e.colIndex,
|
|
997
997
|
type: "resize",
|
|
998
998
|
edge: "end",
|
|
999
999
|
oldEnd: h,
|
|
1000
|
-
newEnd:
|
|
1001
|
-
start:
|
|
1000
|
+
newEnd: C,
|
|
1001
|
+
start: p.value,
|
|
1002
1002
|
delta: u,
|
|
1003
|
-
oldColspan: h -
|
|
1004
|
-
newColspan:
|
|
1003
|
+
oldColspan: h - p.value,
|
|
1004
|
+
newColspan: C - p.value
|
|
1005
1005
|
});
|
|
1006
1006
|
}
|
|
1007
|
-
function et(
|
|
1008
|
-
if (!
|
|
1009
|
-
const u = (
|
|
1010
|
-
n.value.style.left = `${
|
|
1007
|
+
function et(I) {
|
|
1008
|
+
if (!xe.value || !n.value) return;
|
|
1009
|
+
const u = (I - O.value.startX) / $.value, h = v.value - p.value, C = Math.max(0, Math.min(O.value.startPos + u, e.columnsCount - h));
|
|
1010
|
+
n.value.style.left = `${C / e.colspan * 100}%`;
|
|
1011
1011
|
}
|
|
1012
|
-
function tt(
|
|
1012
|
+
function tt(I) {
|
|
1013
1013
|
if (!n.value) return;
|
|
1014
|
-
const a =
|
|
1014
|
+
const a = I - O.value.startX, u = Math.round(a / $.value), h = v.value - p.value, C = p.value, H = v.value;
|
|
1015
1015
|
let k = O.value.startPos + u, A = k + h;
|
|
1016
|
-
k < 0 ? (k = 0, A = h) : A > e.columnsCount && (A = e.columnsCount, k = A - h),
|
|
1016
|
+
k < 0 ? (k = 0, A = h) : A > e.columnsCount && (A = e.columnsCount, k = A - h), p.value = k, v.value = A, e.store.updateGanttBar({
|
|
1017
1017
|
rowIndex: e.rowIndex,
|
|
1018
1018
|
colIndex: e.colIndex,
|
|
1019
1019
|
type: "bar",
|
|
1020
|
-
oldStart:
|
|
1020
|
+
oldStart: C,
|
|
1021
1021
|
oldEnd: H,
|
|
1022
1022
|
newStart: k,
|
|
1023
1023
|
newEnd: A,
|
|
@@ -1026,36 +1026,36 @@ const wn = (e) => {
|
|
|
1026
1026
|
});
|
|
1027
1027
|
}
|
|
1028
1028
|
function nt() {
|
|
1029
|
-
const { x:
|
|
1029
|
+
const { x: I, y: a } = oe(n), { x: u, y: h } = oe(f), { x: C, y: H } = oe(w);
|
|
1030
1030
|
e.store.registerGanttBar({
|
|
1031
|
-
id:
|
|
1031
|
+
id: i,
|
|
1032
1032
|
rowIndex: e.rowIndex,
|
|
1033
1033
|
colIndex: e.colIndex,
|
|
1034
|
-
startIndex:
|
|
1034
|
+
startIndex: p,
|
|
1035
1035
|
endIndex: v,
|
|
1036
|
-
color:
|
|
1036
|
+
color: c,
|
|
1037
1037
|
label: e.label,
|
|
1038
|
-
position: { x:
|
|
1038
|
+
position: { x: I, y: a }
|
|
1039
1039
|
}), e.store.isDependencyGraphEnabled && (e.store.registerConnectionHandle({
|
|
1040
|
-
id: `${
|
|
1040
|
+
id: `${i}-connection-left`,
|
|
1041
1041
|
rowIndex: e.rowIndex,
|
|
1042
1042
|
colIndex: e.colIndex,
|
|
1043
1043
|
side: "left",
|
|
1044
1044
|
position: { x: u, y: h },
|
|
1045
1045
|
visible: g,
|
|
1046
|
-
barId:
|
|
1046
|
+
barId: i
|
|
1047
1047
|
}), e.store.registerConnectionHandle({
|
|
1048
|
-
id: `${
|
|
1048
|
+
id: `${i}-connection-right`,
|
|
1049
1049
|
rowIndex: e.rowIndex,
|
|
1050
1050
|
colIndex: e.colIndex,
|
|
1051
1051
|
side: "right",
|
|
1052
|
-
position: { x:
|
|
1052
|
+
position: { x: C, y: H },
|
|
1053
1053
|
visible: b,
|
|
1054
|
-
barId:
|
|
1054
|
+
barId: i
|
|
1055
1055
|
}));
|
|
1056
1056
|
}
|
|
1057
1057
|
function ot() {
|
|
1058
|
-
e.store.unregisterGanttBar(
|
|
1058
|
+
e.store.unregisterGanttBar(i), e.store.isDependencyGraphEnabled && (e.store.unregisterConnectionHandle(`${i}-connection-left`), e.store.unregisterConnectionHandle(`${i}-connection-right`));
|
|
1059
1059
|
}
|
|
1060
1060
|
function lt() {
|
|
1061
1061
|
e.store.isDependencyGraphEnabled && (g.value = !0, b.value = !0);
|
|
@@ -1063,35 +1063,35 @@ const wn = (e) => {
|
|
|
1063
1063
|
function He() {
|
|
1064
1064
|
!P.value && !B.value && (g.value = !1, b.value = !1);
|
|
1065
1065
|
}
|
|
1066
|
-
function Pe(
|
|
1067
|
-
a.preventDefault(), a.stopPropagation(), F.value = !0,
|
|
1068
|
-
const u =
|
|
1066
|
+
function Pe(I, a) {
|
|
1067
|
+
a.preventDefault(), a.stopPropagation(), F.value = !0, I === "left" ? P.value = !0 : B.value = !0;
|
|
1068
|
+
const u = I === "left" ? f.value : w.value;
|
|
1069
1069
|
if (u) {
|
|
1070
1070
|
const H = u.getBoundingClientRect(), k = H.left + H.width / 2, A = H.top + H.height / 2;
|
|
1071
|
-
|
|
1071
|
+
M.value = { startX: k, startY: A, endX: k, endY: A };
|
|
1072
1072
|
}
|
|
1073
1073
|
const h = (H) => {
|
|
1074
|
-
|
|
1075
|
-
},
|
|
1076
|
-
Le(H,
|
|
1074
|
+
M.value.endX = H.clientX, M.value.endY = H.clientY;
|
|
1075
|
+
}, C = (H) => {
|
|
1076
|
+
Le(H, I), Be(h, C);
|
|
1077
1077
|
};
|
|
1078
|
-
document.addEventListener("mousemove", h), document.addEventListener("mouseup",
|
|
1078
|
+
document.addEventListener("mousemove", h), document.addEventListener("mouseup", C);
|
|
1079
1079
|
}
|
|
1080
|
-
function Le(
|
|
1081
|
-
const h = document.elementFromPoint(
|
|
1082
|
-
if (h && h !== (a === "left" ? f.value :
|
|
1083
|
-
const
|
|
1084
|
-
if (
|
|
1085
|
-
const H = parseInt(
|
|
1086
|
-
`${
|
|
1080
|
+
function Le(I, a) {
|
|
1081
|
+
const h = document.elementFromPoint(I.clientX, I.clientY)?.closest(".connection-handle");
|
|
1082
|
+
if (h && h !== (a === "left" ? f.value : w.value)) {
|
|
1083
|
+
const C = h.closest(".gantt-bar");
|
|
1084
|
+
if (C) {
|
|
1085
|
+
const H = parseInt(C.getAttribute("data-rowindex") || "0"), k = parseInt(C.getAttribute("data-colindex") || "0"), A = h.classList.contains("left-connection-handle") ? "left" : "right", ne = `gantt-bar-row-${H}-col-${k}`, Ce = e.store.createConnection(
|
|
1086
|
+
`${i}-connection-${a}`,
|
|
1087
1087
|
`${ne}-connection-${A}`
|
|
1088
1088
|
);
|
|
1089
|
-
Ce &&
|
|
1089
|
+
Ce && r("connection:create", Ce);
|
|
1090
1090
|
}
|
|
1091
1091
|
}
|
|
1092
1092
|
}
|
|
1093
|
-
function Be(
|
|
1094
|
-
F.value = !1, P.value = !1, B.value = !1, document.removeEventListener("mousemove",
|
|
1093
|
+
function Be(I, a) {
|
|
1094
|
+
F.value = !1, P.value = !1, B.value = !1, document.removeEventListener("mousemove", I), document.removeEventListener("mouseup", a), n.value?.matches(":hover") || He();
|
|
1095
1095
|
}
|
|
1096
1096
|
return t({
|
|
1097
1097
|
barStyle: X,
|
|
@@ -1103,62 +1103,62 @@ const wn = (e) => {
|
|
|
1103
1103
|
isRightConnectionDragging: B,
|
|
1104
1104
|
isRightConnectionVisible: b,
|
|
1105
1105
|
showDragPreview: F
|
|
1106
|
-
}), (
|
|
1106
|
+
}), (I, a) => (T(), L("td", {
|
|
1107
1107
|
class: "aganttcell",
|
|
1108
|
-
colspan:
|
|
1108
|
+
colspan: e.colspan
|
|
1109
1109
|
}, [
|
|
1110
1110
|
N("div", An, [
|
|
1111
1111
|
N("div", {
|
|
1112
1112
|
ref: "bar",
|
|
1113
|
-
"data-rowindex":
|
|
1114
|
-
"data-colindex":
|
|
1115
|
-
class: q(["gantt-bar", { "is-dragging":
|
|
1113
|
+
"data-rowindex": e.rowIndex,
|
|
1114
|
+
"data-colindex": e.colIndex,
|
|
1115
|
+
class: q(["gantt-bar", { "is-dragging": x.value }]),
|
|
1116
1116
|
style: ee(X.value),
|
|
1117
1117
|
onMouseenter: lt,
|
|
1118
1118
|
onMouseleave: He
|
|
1119
1119
|
}, [
|
|
1120
|
-
|
|
1120
|
+
e.store.isDependencyGraphEnabled ? (T(), L("div", {
|
|
1121
1121
|
key: 0,
|
|
1122
1122
|
ref: "leftConnectionHandle",
|
|
1123
1123
|
class: q(["connection-handle left-connection-handle", { visible: g.value, "is-dragging": P.value }]),
|
|
1124
1124
|
onMousedown: a[0] || (a[0] = Se((u) => Pe("left", u), ["stop"]))
|
|
1125
|
-
}, a[2] || (a[2] = [
|
|
1125
|
+
}, [...a[2] || (a[2] = [
|
|
1126
1126
|
N("div", { class: "connection-dot" }, null, -1)
|
|
1127
|
-
]), 34)) : J("", !0),
|
|
1128
|
-
|
|
1127
|
+
])], 34)) : J("", !0),
|
|
1128
|
+
e.store.isDependencyGraphEnabled ? (T(), L("div", {
|
|
1129
1129
|
key: 1,
|
|
1130
1130
|
ref: "rightConnectionHandle",
|
|
1131
1131
|
class: q(["connection-handle right-connection-handle", { visible: b.value, "is-dragging": B.value }]),
|
|
1132
1132
|
onMousedown: a[1] || (a[1] = Se((u) => Pe("right", u), ["stop"]))
|
|
1133
|
-
}, a[3] || (a[3] = [
|
|
1133
|
+
}, [...a[3] || (a[3] = [
|
|
1134
1134
|
N("div", { class: "connection-dot" }, null, -1)
|
|
1135
|
-
]), 34)) : J("", !0),
|
|
1135
|
+
])], 34)) : J("", !0),
|
|
1136
1136
|
N("div", {
|
|
1137
1137
|
ref: "leftResizeHandle",
|
|
1138
1138
|
class: q(["resize-handle left-resize-handle", { "is-dragging": R(Y) }])
|
|
1139
|
-
}, a[4] || (a[4] = [
|
|
1139
|
+
}, [...a[4] || (a[4] = [
|
|
1140
1140
|
N("div", { class: "handle-grip" }, null, -1),
|
|
1141
1141
|
N("div", { class: "vertical-indicator left-indicator" }, null, -1)
|
|
1142
|
-
]), 2),
|
|
1143
|
-
|
|
1142
|
+
])], 2),
|
|
1143
|
+
e.label ? (T(), L("label", Dn, ue(e.label), 1)) : J("", !0),
|
|
1144
1144
|
N("div", {
|
|
1145
1145
|
ref: "rightResizeHandle",
|
|
1146
1146
|
class: q(["resize-handle right-resize-handle", { "is-dragging": R(_) }])
|
|
1147
|
-
}, a[5] || (a[5] = [
|
|
1147
|
+
}, [...a[5] || (a[5] = [
|
|
1148
1148
|
N("div", { class: "handle-grip" }, null, -1),
|
|
1149
1149
|
N("div", { class: "vertical-indicator right-indicator" }, null, -1)
|
|
1150
|
-
]), 2)
|
|
1150
|
+
])], 2)
|
|
1151
1151
|
], 46, Tn)
|
|
1152
1152
|
], 512),
|
|
1153
|
-
|
|
1153
|
+
e.store.isDependencyGraphEnabled && F.value ? (T(), L("svg", {
|
|
1154
1154
|
key: 0,
|
|
1155
1155
|
style: ee(W.value)
|
|
1156
1156
|
}, [
|
|
1157
1157
|
N("line", {
|
|
1158
|
-
x1:
|
|
1159
|
-
y1:
|
|
1160
|
-
x2:
|
|
1161
|
-
y2:
|
|
1158
|
+
x1: M.value.startX,
|
|
1159
|
+
y1: M.value.startY,
|
|
1160
|
+
x2: M.value.endX,
|
|
1161
|
+
y2: M.value.endY,
|
|
1162
1162
|
stroke: "#2196f3",
|
|
1163
1163
|
"stroke-width": "2",
|
|
1164
1164
|
"stroke-dasharray": "5,5"
|
|
@@ -1175,37 +1175,37 @@ const wn = (e) => {
|
|
|
1175
1175
|
addNavigation: { type: [Boolean, Object], default: !1 }
|
|
1176
1176
|
},
|
|
1177
1177
|
setup(e) {
|
|
1178
|
-
const t = U("rowEl"), o = D(() => e.store.isRowVisible(e.rowIndex)),
|
|
1178
|
+
const t = U("rowEl"), o = D(() => e.store.isRowVisible(e.rowIndex)), r = D(() => e.store.getRowExpandSymbol(e.rowIndex));
|
|
1179
1179
|
if (e.addNavigation) {
|
|
1180
|
-
let
|
|
1181
|
-
typeof e.addNavigation == "object" && (
|
|
1182
|
-
...
|
|
1180
|
+
let c = Ze;
|
|
1181
|
+
typeof e.addNavigation == "object" && (c = {
|
|
1182
|
+
...c,
|
|
1183
1183
|
...e.addNavigation
|
|
1184
1184
|
}), Qe([
|
|
1185
1185
|
{
|
|
1186
1186
|
selectors: t,
|
|
1187
|
-
handlers:
|
|
1187
|
+
handlers: c
|
|
1188
1188
|
}
|
|
1189
1189
|
]);
|
|
1190
1190
|
}
|
|
1191
|
-
return (
|
|
1191
|
+
return (c, i) => Me((T(), L("tr", {
|
|
1192
1192
|
ref: "rowEl",
|
|
1193
|
-
tabindex:
|
|
1193
|
+
tabindex: e.tabIndex,
|
|
1194
1194
|
class: "atable-row"
|
|
1195
1195
|
}, [
|
|
1196
|
-
|
|
1197
|
-
|
|
1196
|
+
e.store.config.view !== "uncounted" ? j(c.$slots, "index", { key: 0 }, () => [
|
|
1197
|
+
e.store.config.view === "list" ? (T(), L("td", {
|
|
1198
1198
|
key: 0,
|
|
1199
1199
|
tabIndex: -1,
|
|
1200
|
-
class: q(["list-index",
|
|
1201
|
-
}, ue(
|
|
1200
|
+
class: q(["list-index", e.store.hasPinnedColumns ? "sticky-index" : ""])
|
|
1201
|
+
}, ue(e.rowIndex + 1), 3)) : e.store.isTreeView ? (T(), L("td", {
|
|
1202
1202
|
key: 1,
|
|
1203
1203
|
tabIndex: -1,
|
|
1204
|
-
class: q(["tree-index",
|
|
1205
|
-
onClick:
|
|
1206
|
-
}, ue(
|
|
1204
|
+
class: q(["tree-index", e.store.hasPinnedColumns ? "sticky-index" : ""]),
|
|
1205
|
+
onClick: i[0] || (i[0] = (s) => e.store.toggleRowExpand(e.rowIndex))
|
|
1206
|
+
}, ue(r.value), 3)) : J("", !0)
|
|
1207
1207
|
], !0) : J("", !0),
|
|
1208
|
-
j(
|
|
1208
|
+
j(c.$slots, "default", {}, void 0, !0)
|
|
1209
1209
|
], 8, Ln)), [
|
|
1210
1210
|
[bt, o.value]
|
|
1211
1211
|
]);
|
|
@@ -1213,74 +1213,74 @@ const wn = (e) => {
|
|
|
1213
1213
|
}), $t = /* @__PURE__ */ ie(Bn, [["__scopeId", "data-v-c554ee0f"]]), Ke = Te ? window : void 0;
|
|
1214
1214
|
function le(e) {
|
|
1215
1215
|
var t;
|
|
1216
|
-
const o =
|
|
1216
|
+
const o = S(e);
|
|
1217
1217
|
return (t = o?.$el) != null ? t : o;
|
|
1218
1218
|
}
|
|
1219
1219
|
function Re(...e) {
|
|
1220
1220
|
const t = [], o = () => {
|
|
1221
1221
|
t.forEach((n) => n()), t.length = 0;
|
|
1222
|
-
},
|
|
1223
|
-
const n = se(
|
|
1222
|
+
}, r = (n, l, d, f) => (n.addEventListener(l, d, f), () => n.removeEventListener(l, d, f)), c = D(() => {
|
|
1223
|
+
const n = se(S(e[0])).filter((l) => l != null);
|
|
1224
1224
|
return n.every((l) => typeof l != "string") ? n : void 0;
|
|
1225
|
-
}),
|
|
1225
|
+
}), i = Et(
|
|
1226
1226
|
() => {
|
|
1227
1227
|
var n, l;
|
|
1228
1228
|
return [
|
|
1229
|
-
(l = (n =
|
|
1230
|
-
se(
|
|
1231
|
-
se(R(
|
|
1229
|
+
(l = (n = c.value) == null ? void 0 : n.map((d) => le(d))) != null ? l : [Ke].filter((d) => d != null),
|
|
1230
|
+
se(S(c.value ? e[1] : e[0])),
|
|
1231
|
+
se(R(c.value ? e[2] : e[1])),
|
|
1232
1232
|
// @ts-expect-error - TypeScript gets the correct types, but somehow still complains
|
|
1233
|
-
|
|
1233
|
+
S(c.value ? e[3] : e[2])
|
|
1234
1234
|
];
|
|
1235
1235
|
},
|
|
1236
1236
|
([n, l, d, f]) => {
|
|
1237
1237
|
if (o(), !n?.length || !l?.length || !d?.length)
|
|
1238
1238
|
return;
|
|
1239
|
-
const
|
|
1239
|
+
const w = Ct(f) ? { ...f } : f;
|
|
1240
1240
|
t.push(
|
|
1241
1241
|
...n.flatMap(
|
|
1242
|
-
(
|
|
1243
|
-
(m) => d.map((
|
|
1242
|
+
(y) => l.flatMap(
|
|
1243
|
+
(m) => d.map((E) => r(y, m, E, w))
|
|
1244
1244
|
)
|
|
1245
1245
|
)
|
|
1246
1246
|
);
|
|
1247
1247
|
},
|
|
1248
1248
|
{ flush: "post" }
|
|
1249
|
-
),
|
|
1250
|
-
|
|
1249
|
+
), s = () => {
|
|
1250
|
+
i(), o();
|
|
1251
1251
|
};
|
|
1252
|
-
return me(o),
|
|
1252
|
+
return me(o), s;
|
|
1253
1253
|
}
|
|
1254
1254
|
let gt = !1;
|
|
1255
1255
|
function ht(e, t, o = {}) {
|
|
1256
|
-
const { window:
|
|
1257
|
-
if (!
|
|
1256
|
+
const { window: r = Ke, ignore: c = [], capture: i = !0, detectIframe: s = !1, controls: n = !1 } = o;
|
|
1257
|
+
if (!r)
|
|
1258
1258
|
return n ? { stop: Z, cancel: Z, trigger: Z } : Z;
|
|
1259
1259
|
if (Ge && !gt) {
|
|
1260
1260
|
gt = !0;
|
|
1261
1261
|
const v = { passive: !0 };
|
|
1262
|
-
Array.from(
|
|
1262
|
+
Array.from(r.document.body.children).forEach((g) => g.addEventListener("click", Z, v)), r.document.documentElement.addEventListener("click", Z, v);
|
|
1263
1263
|
}
|
|
1264
1264
|
let l = !0;
|
|
1265
|
-
const d = (v) =>
|
|
1265
|
+
const d = (v) => S(c).some((g) => {
|
|
1266
1266
|
if (typeof g == "string")
|
|
1267
|
-
return Array.from(
|
|
1267
|
+
return Array.from(r.document.querySelectorAll(g)).some((b) => b === v.target || v.composedPath().includes(b));
|
|
1268
1268
|
{
|
|
1269
1269
|
const b = le(g);
|
|
1270
1270
|
return b && (v.target === b || v.composedPath().includes(b));
|
|
1271
1271
|
}
|
|
1272
1272
|
});
|
|
1273
1273
|
function f(v) {
|
|
1274
|
-
const g =
|
|
1274
|
+
const g = S(v);
|
|
1275
1275
|
return g && g.$.subTree.shapeFlag === 16;
|
|
1276
1276
|
}
|
|
1277
|
-
function
|
|
1278
|
-
const b =
|
|
1277
|
+
function w(v, g) {
|
|
1278
|
+
const b = S(v), P = b.$.subTree && b.$.subTree.children;
|
|
1279
1279
|
return P == null || !Array.isArray(P) ? !1 : P.some((B) => B.el === g.target || g.composedPath().includes(B.el));
|
|
1280
1280
|
}
|
|
1281
|
-
const
|
|
1281
|
+
const y = (v) => {
|
|
1282
1282
|
const g = le(e);
|
|
1283
|
-
if (v.target != null && !(!(g instanceof Element) && f(e) &&
|
|
1283
|
+
if (v.target != null && !(!(g instanceof Element) && f(e) && w(e, v)) && !(!g || g === v.target || v.composedPath().includes(g))) {
|
|
1284
1284
|
if ("detail" in v && v.detail === 0 && (l = !d(v)), !l) {
|
|
1285
1285
|
l = !0;
|
|
1286
1286
|
return;
|
|
@@ -1289,45 +1289,45 @@ function ht(e, t, o = {}) {
|
|
|
1289
1289
|
}
|
|
1290
1290
|
};
|
|
1291
1291
|
let m = !1;
|
|
1292
|
-
const
|
|
1293
|
-
Re(
|
|
1292
|
+
const E = [
|
|
1293
|
+
Re(r, "click", (v) => {
|
|
1294
1294
|
m || (m = !0, setTimeout(() => {
|
|
1295
1295
|
m = !1;
|
|
1296
|
-
}, 0),
|
|
1297
|
-
}, { passive: !0, capture:
|
|
1298
|
-
Re(
|
|
1296
|
+
}, 0), y(v));
|
|
1297
|
+
}, { passive: !0, capture: i }),
|
|
1298
|
+
Re(r, "pointerdown", (v) => {
|
|
1299
1299
|
const g = le(e);
|
|
1300
1300
|
l = !d(v) && !!(g && !v.composedPath().includes(g));
|
|
1301
1301
|
}, { passive: !0 }),
|
|
1302
|
-
|
|
1302
|
+
s && Re(r, "blur", (v) => {
|
|
1303
1303
|
setTimeout(() => {
|
|
1304
1304
|
var g;
|
|
1305
1305
|
const b = le(e);
|
|
1306
|
-
((g =
|
|
1306
|
+
((g = r.document.activeElement) == null ? void 0 : g.tagName) === "IFRAME" && !b?.contains(r.document.activeElement) && t(v);
|
|
1307
1307
|
}, 0);
|
|
1308
1308
|
}, { passive: !0 })
|
|
1309
|
-
].filter(Boolean),
|
|
1309
|
+
].filter(Boolean), p = () => E.forEach((v) => v());
|
|
1310
1310
|
return n ? {
|
|
1311
|
-
stop:
|
|
1311
|
+
stop: p,
|
|
1312
1312
|
cancel: () => {
|
|
1313
1313
|
l = !1;
|
|
1314
1314
|
},
|
|
1315
1315
|
trigger: (v) => {
|
|
1316
|
-
l = !0,
|
|
1316
|
+
l = !0, y(v), l = !1;
|
|
1317
1317
|
}
|
|
1318
|
-
} :
|
|
1318
|
+
} : p;
|
|
1319
1319
|
}
|
|
1320
1320
|
const ze = /* @__PURE__ */ new WeakMap(), Wn = {
|
|
1321
1321
|
mounted(e, t) {
|
|
1322
1322
|
const o = !t.modifiers.bubble;
|
|
1323
|
-
let
|
|
1323
|
+
let r;
|
|
1324
1324
|
if (typeof t.value == "function")
|
|
1325
|
-
|
|
1325
|
+
r = ht(e, t.value, { capture: o });
|
|
1326
1326
|
else {
|
|
1327
|
-
const [
|
|
1328
|
-
|
|
1327
|
+
const [c, i] = t.value;
|
|
1328
|
+
r = ht(e, c, Object.assign({ capture: o }, i));
|
|
1329
1329
|
}
|
|
1330
|
-
ze.set(e,
|
|
1330
|
+
ze.set(e, r);
|
|
1331
1331
|
},
|
|
1332
1332
|
unmounted(e) {
|
|
1333
1333
|
const t = ze.get(e);
|
|
@@ -1346,21 +1346,21 @@ function Nn(e) {
|
|
|
1346
1346
|
const t = /* @__PURE__ */ zn();
|
|
1347
1347
|
return D(() => (t.value, !!e()));
|
|
1348
1348
|
}
|
|
1349
|
-
function
|
|
1350
|
-
const { window:
|
|
1351
|
-
let
|
|
1352
|
-
const
|
|
1353
|
-
|
|
1349
|
+
function wt(e, t, o = {}) {
|
|
1350
|
+
const { window: r = Ke, ...c } = o;
|
|
1351
|
+
let i;
|
|
1352
|
+
const s = /* @__PURE__ */ Nn(() => r && "ResizeObserver" in r), n = () => {
|
|
1353
|
+
i && (i.disconnect(), i = void 0);
|
|
1354
1354
|
}, l = D(() => {
|
|
1355
|
-
const
|
|
1356
|
-
return Array.isArray(
|
|
1355
|
+
const w = S(e);
|
|
1356
|
+
return Array.isArray(w) ? w.map((y) => le(y)) : [le(w)];
|
|
1357
1357
|
}), d = V(
|
|
1358
1358
|
l,
|
|
1359
|
-
(
|
|
1360
|
-
if (n(),
|
|
1361
|
-
|
|
1362
|
-
for (const
|
|
1363
|
-
|
|
1359
|
+
(w) => {
|
|
1360
|
+
if (n(), s.value && r) {
|
|
1361
|
+
i = new ResizeObserver(t);
|
|
1362
|
+
for (const y of w)
|
|
1363
|
+
y && i.observe(y, c);
|
|
1364
1364
|
}
|
|
1365
1365
|
},
|
|
1366
1366
|
{ immediate: !0, flush: "post" }
|
|
@@ -1368,7 +1368,7 @@ function pt(e, t, o = {}) {
|
|
|
1368
1368
|
n(), d();
|
|
1369
1369
|
};
|
|
1370
1370
|
return me(f), {
|
|
1371
|
-
isSupported:
|
|
1371
|
+
isSupported: s,
|
|
1372
1372
|
stop: f
|
|
1373
1373
|
};
|
|
1374
1374
|
}
|
|
@@ -1377,7 +1377,7 @@ function Ne(e) {
|
|
|
1377
1377
|
}
|
|
1378
1378
|
const Xn = {
|
|
1379
1379
|
mounted(e, t) {
|
|
1380
|
-
typeof t.value == "function" ?
|
|
1380
|
+
typeof t.value == "function" ? wt(e, t.value) : wt(e, ...t.value);
|
|
1381
1381
|
}
|
|
1382
1382
|
};
|
|
1383
1383
|
function Rt(e) {
|
|
@@ -1396,12 +1396,12 @@ function Gn(e) {
|
|
|
1396
1396
|
const Xe = /* @__PURE__ */ new WeakMap();
|
|
1397
1397
|
function Fn(e, t = !1) {
|
|
1398
1398
|
const o = G(t);
|
|
1399
|
-
let
|
|
1399
|
+
let r = null, c = "";
|
|
1400
1400
|
V(cn(e), (n) => {
|
|
1401
|
-
const l = Ne(
|
|
1401
|
+
const l = Ne(S(n));
|
|
1402
1402
|
if (l) {
|
|
1403
1403
|
const d = l;
|
|
1404
|
-
if (Xe.get(d) || Xe.set(d, d.style.overflow), d.style.overflow !== "hidden" && (
|
|
1404
|
+
if (Xe.get(d) || Xe.set(d, d.style.overflow), d.style.overflow !== "hidden" && (c = d.style.overflow), d.style.overflow === "hidden")
|
|
1405
1405
|
return o.value = !0;
|
|
1406
1406
|
if (o.value)
|
|
1407
1407
|
return d.style.overflow = "hidden";
|
|
@@ -1409,9 +1409,9 @@ function Fn(e, t = !1) {
|
|
|
1409
1409
|
}, {
|
|
1410
1410
|
immediate: !0
|
|
1411
1411
|
});
|
|
1412
|
-
const
|
|
1413
|
-
const n = Ne(
|
|
1414
|
-
!n || o.value || (Ge && (
|
|
1412
|
+
const i = () => {
|
|
1413
|
+
const n = Ne(S(e));
|
|
1414
|
+
!n || o.value || (Ge && (r = Re(
|
|
1415
1415
|
n,
|
|
1416
1416
|
"touchmove",
|
|
1417
1417
|
(l) => {
|
|
@@ -1419,28 +1419,28 @@ function Fn(e, t = !1) {
|
|
|
1419
1419
|
},
|
|
1420
1420
|
{ passive: !1 }
|
|
1421
1421
|
)), n.style.overflow = "hidden", o.value = !0);
|
|
1422
|
-
},
|
|
1423
|
-
const n = Ne(
|
|
1424
|
-
!n || !o.value || (Ge &&
|
|
1422
|
+
}, s = () => {
|
|
1423
|
+
const n = Ne(S(e));
|
|
1424
|
+
!n || !o.value || (Ge && r?.(), n.style.overflow = c, Xe.delete(n), o.value = !1);
|
|
1425
1425
|
};
|
|
1426
|
-
return me(
|
|
1426
|
+
return me(s), D({
|
|
1427
1427
|
get() {
|
|
1428
1428
|
return o.value;
|
|
1429
1429
|
},
|
|
1430
1430
|
set(n) {
|
|
1431
|
-
n ?
|
|
1431
|
+
n ? i() : s();
|
|
1432
1432
|
}
|
|
1433
1433
|
});
|
|
1434
1434
|
}
|
|
1435
1435
|
function Vn() {
|
|
1436
1436
|
let e = !1;
|
|
1437
1437
|
const t = G(!1);
|
|
1438
|
-
return (o,
|
|
1439
|
-
if (t.value =
|
|
1438
|
+
return (o, r) => {
|
|
1439
|
+
if (t.value = r.value, e)
|
|
1440
1440
|
return;
|
|
1441
1441
|
e = !0;
|
|
1442
|
-
const
|
|
1443
|
-
V(t, (
|
|
1442
|
+
const c = Fn(o, r.value);
|
|
1443
|
+
V(t, (i) => c.value = i);
|
|
1444
1444
|
};
|
|
1445
1445
|
}
|
|
1446
1446
|
Vn();
|
|
@@ -1462,22 +1462,22 @@ const Yn = { class: "gantt-connection-overlay" }, jn = {
|
|
|
1462
1462
|
},
|
|
1463
1463
|
emits: ["connection:delete"],
|
|
1464
1464
|
setup(e, { emit: t }) {
|
|
1465
|
-
const o = t,
|
|
1466
|
-
const n = e.store.ganttBars.find((d) => d.id ===
|
|
1465
|
+
const o = t, r = D(() => e.store.connectionPaths.filter((s) => {
|
|
1466
|
+
const n = e.store.ganttBars.find((d) => d.id === s.from.barId), l = e.store.ganttBars.find((d) => d.id === s.to.barId);
|
|
1467
1467
|
return n && l;
|
|
1468
|
-
})),
|
|
1468
|
+
})), c = (s, n = !1) => {
|
|
1469
1469
|
const l = e.store.connectionHandles.find(
|
|
1470
|
-
($) => $.barId ===
|
|
1470
|
+
($) => $.barId === s.from.barId && $.side === s.from.side
|
|
1471
1471
|
), d = e.store.connectionHandles.find(
|
|
1472
|
-
($) => $.barId ===
|
|
1472
|
+
($) => $.barId === s.to.barId && $.side === s.to.side
|
|
1473
1473
|
);
|
|
1474
1474
|
if (!l || !d) return "";
|
|
1475
|
-
const f = l.position.x + Ie / 2,
|
|
1476
|
-
return `M ${f} ${
|
|
1477
|
-
},
|
|
1478
|
-
e.store.deleteConnection(
|
|
1475
|
+
const f = l.position.x + Ie / 2, w = l.position.y + Ie / 2, y = d.position.x + Ie / 2, m = d.position.y + Ie / 2, E = Math.abs(y - f), p = Math.max(E * Jn, 50), v = f + (s.from.side === "left" ? -p : p), g = y + (s.to.side === "left" ? -p : p), b = { x: 0.5 * f + 0.5 * v, y: 0.5 * w + 0.5 * w }, P = { x: 0.5 * v + 0.5 * g, y: 0.5 * w + 0.5 * m }, B = { x: 0.5 * g + 0.5 * y, y: 0.5 * m + 0.5 * m }, F = { x: 0.5 * b.x + 0.5 * P.x, y: 0.5 * b.y + 0.5 * P.y }, M = { x: 0.5 * P.x + 0.5 * B.x, y: 0.5 * P.y + 0.5 * B.y }, x = { x: 0.5 * F.x + 0.5 * M.x, y: 0.5 * F.y + 0.5 * M.y };
|
|
1476
|
+
return `M ${f} ${w} Q ${v} ${w}, ${x.x} ${x.y} Q ${g} ${m}, ${y} ${m}`;
|
|
1477
|
+
}, i = (s) => {
|
|
1478
|
+
e.store.deleteConnection(s.id) && o("connection:delete", s);
|
|
1479
1479
|
};
|
|
1480
|
-
return (
|
|
1480
|
+
return (s, n) => (T(), L("div", Yn, [
|
|
1481
1481
|
(T(), L("svg", jn, [
|
|
1482
1482
|
n[0] || (n[0] = N("defs", null, [
|
|
1483
1483
|
N("path", {
|
|
@@ -1502,25 +1502,25 @@ const Yn = { class: "gantt-connection-overlay" }, jn = {
|
|
|
1502
1502
|
})
|
|
1503
1503
|
])
|
|
1504
1504
|
], -1)),
|
|
1505
|
-
(T(!0), L(ae, null,
|
|
1505
|
+
(T(!0), L(ae, null, we(r.value, (l) => (T(), L("path", {
|
|
1506
1506
|
key: `${l.id}-hitbox`,
|
|
1507
|
-
d:
|
|
1507
|
+
d: c(l),
|
|
1508
1508
|
stroke: "transparent",
|
|
1509
1509
|
"stroke-width": (l.style?.width || 2) + 10,
|
|
1510
1510
|
fill: "none",
|
|
1511
1511
|
class: "connection-hitbox",
|
|
1512
|
-
onDblclick: (d) =>
|
|
1512
|
+
onDblclick: (d) => i(l)
|
|
1513
1513
|
}, null, 40, Un))), 128)),
|
|
1514
|
-
(T(!0), L(ae, null,
|
|
1514
|
+
(T(!0), L(ae, null, we(r.value, (l) => (T(), L("path", {
|
|
1515
1515
|
key: l.id,
|
|
1516
|
-
d:
|
|
1516
|
+
d: c(l),
|
|
1517
1517
|
stroke: l.style?.color || "#666",
|
|
1518
1518
|
"stroke-width": l.style?.width || 2,
|
|
1519
1519
|
fill: "none",
|
|
1520
1520
|
"marker-mid": "url(#arrowhead-marker)",
|
|
1521
1521
|
id: l.id,
|
|
1522
1522
|
class: "connection-path animated-path",
|
|
1523
|
-
onDblclick: (d) =>
|
|
1523
|
+
onDblclick: (d) => i(l)
|
|
1524
1524
|
}, null, 40, qn))), 128))
|
|
1525
1525
|
]))
|
|
1526
1526
|
]));
|
|
@@ -1536,32 +1536,32 @@ const Yn = { class: "gantt-connection-overlay" }, jn = {
|
|
|
1536
1536
|
},
|
|
1537
1537
|
setup(e) {
|
|
1538
1538
|
const t = (o) => {
|
|
1539
|
-
for (const
|
|
1540
|
-
if (
|
|
1541
|
-
const
|
|
1542
|
-
typeof n == "number" && n !==
|
|
1539
|
+
for (const r of o) {
|
|
1540
|
+
if (r.borderBoxSize.length === 0) continue;
|
|
1541
|
+
const i = r.borderBoxSize[0].inlineSize, s = Number(r.target.dataset.colindex), n = e.store.columns[s]?.width;
|
|
1542
|
+
typeof n == "number" && n !== i && e.store.resizeColumn(s, i);
|
|
1543
1543
|
}
|
|
1544
1544
|
};
|
|
1545
|
-
return (o,
|
|
1545
|
+
return (o, r) => e.columns.length ? (T(), L("thead", Kn, [
|
|
1546
1546
|
N("tr", _n, [
|
|
1547
|
-
|
|
1547
|
+
e.store.zeroColumn ? (T(), L("th", {
|
|
1548
1548
|
key: 0,
|
|
1549
1549
|
id: "header-index",
|
|
1550
1550
|
class: q([[
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1551
|
+
e.store.hasPinnedColumns ? "sticky-index" : "",
|
|
1552
|
+
e.store.isTreeView ? "tree-index" : "",
|
|
1553
|
+
e.store.config.view === "list-expansion" ? "list-expansion-index" : ""
|
|
1554
1554
|
], "list-index"])
|
|
1555
1555
|
}, null, 2)) : J("", !0),
|
|
1556
|
-
(T(!0), L(ae, null,
|
|
1557
|
-
key:
|
|
1558
|
-
"data-colindex":
|
|
1556
|
+
(T(!0), L(ae, null, we(e.columns, (c, i) => Me((T(), L("th", {
|
|
1557
|
+
key: c.name,
|
|
1558
|
+
"data-colindex": i,
|
|
1559
1559
|
tabindex: "-1",
|
|
1560
|
-
style: ee(
|
|
1561
|
-
class: q(
|
|
1560
|
+
style: ee(e.store.getHeaderCellStyle(c)),
|
|
1561
|
+
class: q(c.pinned ? "sticky-column" : "")
|
|
1562
1562
|
}, [
|
|
1563
1563
|
j(o.$slots, "default", {}, () => [
|
|
1564
|
-
Wt(ue(
|
|
1564
|
+
Wt(ue(c.label || String.fromCharCode(i + 97).toUpperCase()), 1)
|
|
1565
1565
|
])
|
|
1566
1566
|
], 14, eo)), [
|
|
1567
1567
|
[R(Xn), t]
|
|
@@ -1575,54 +1575,54 @@ const Yn = { class: "gantt-connection-overlay" }, jn = {
|
|
|
1575
1575
|
store: {}
|
|
1576
1576
|
},
|
|
1577
1577
|
setup(e) {
|
|
1578
|
-
const t = U("amodal"), { width: o, height:
|
|
1578
|
+
const t = U("amodal"), { width: o, height: r } = oe(t), c = D(() => {
|
|
1579
1579
|
if (!(e.store.modal.height && e.store.modal.width && e.store.modal.left && e.store.modal.bottom)) return;
|
|
1580
|
-
const
|
|
1580
|
+
const i = e.store.modal.cell?.closest("table"), s = i.offsetHeight || 0, n = i.offsetWidth || 0;
|
|
1581
1581
|
let l = e.store.modal.cell?.offsetTop || 0;
|
|
1582
|
-
const d =
|
|
1583
|
-
l += d, l = l +
|
|
1582
|
+
const d = i.querySelector("thead")?.offsetHeight || 0;
|
|
1583
|
+
l += d, l = l + r.value < s ? l : l - (r.value + e.store.modal.height);
|
|
1584
1584
|
let f = e.store.modal.cell?.offsetLeft || 0;
|
|
1585
1585
|
return f = f + o.value <= n ? f : f - (o.value - e.store.modal.width), {
|
|
1586
1586
|
left: `${f}px`,
|
|
1587
1587
|
top: `${l}px`
|
|
1588
1588
|
};
|
|
1589
1589
|
});
|
|
1590
|
-
return (
|
|
1590
|
+
return (i, s) => (T(), L("div", {
|
|
1591
1591
|
class: "amodal",
|
|
1592
1592
|
ref: "amodal",
|
|
1593
1593
|
tabindex: "-1",
|
|
1594
|
-
onClick:
|
|
1594
|
+
onClick: s[0] || (s[0] = Se(() => {
|
|
1595
1595
|
}, ["stop"])),
|
|
1596
|
-
onInput:
|
|
1596
|
+
onInput: s[1] || (s[1] = Se(() => {
|
|
1597
1597
|
}, ["stop"])),
|
|
1598
|
-
style: ee(
|
|
1598
|
+
style: ee(c.value)
|
|
1599
1599
|
}, [
|
|
1600
|
-
j(
|
|
1600
|
+
j(i.$slots, "default")
|
|
1601
1601
|
], 36));
|
|
1602
1602
|
}
|
|
1603
1603
|
}), to = (e) => {
|
|
1604
|
-
const t = e.id ||
|
|
1604
|
+
const t = e.id || xn();
|
|
1605
1605
|
return zt(`table-${t}`, () => {
|
|
1606
|
-
const
|
|
1606
|
+
const r = () => {
|
|
1607
1607
|
const a = [Object.assign({}, { rowModified: !1 })], u = /* @__PURE__ */ new Set();
|
|
1608
|
-
for (let k = 0; k <
|
|
1609
|
-
const A =
|
|
1608
|
+
for (let k = 0; k < i.value.length; k++) {
|
|
1609
|
+
const A = i.value[k];
|
|
1610
1610
|
A.parent !== null && A.parent !== void 0 && u.add(A.parent);
|
|
1611
1611
|
}
|
|
1612
|
-
const h = (k) =>
|
|
1613
|
-
for (let A = 0; A <
|
|
1614
|
-
if (
|
|
1612
|
+
const h = (k) => i.value[k]?.gantt !== void 0, C = (k) => {
|
|
1613
|
+
for (let A = 0; A < i.value.length; A++)
|
|
1614
|
+
if (i.value[A].parent === k && (h(A) || C(A)))
|
|
1615
1615
|
return !0;
|
|
1616
1616
|
return !1;
|
|
1617
1617
|
}, H = (k) => {
|
|
1618
|
-
const A =
|
|
1618
|
+
const A = s.value, ne = A.view === "tree" || A.view === "tree-gantt" ? A.defaultTreeExpansion : void 0;
|
|
1619
1619
|
if (!ne) return !0;
|
|
1620
1620
|
switch (ne) {
|
|
1621
1621
|
case "root":
|
|
1622
1622
|
return !1;
|
|
1623
1623
|
// Only root nodes are visible, all children start collapsed
|
|
1624
1624
|
case "branch":
|
|
1625
|
-
return
|
|
1625
|
+
return C(k);
|
|
1626
1626
|
case "leaf":
|
|
1627
1627
|
return !0;
|
|
1628
1628
|
// All nodes should be expanded
|
|
@@ -1630,8 +1630,8 @@ const Yn = { class: "gantt-connection-overlay" }, jn = {
|
|
|
1630
1630
|
return !0;
|
|
1631
1631
|
}
|
|
1632
1632
|
};
|
|
1633
|
-
for (let k = 0; k <
|
|
1634
|
-
const A =
|
|
1633
|
+
for (let k = 0; k < i.value.length; k++) {
|
|
1634
|
+
const A = i.value[k], ne = A.parent === null || A.parent === void 0, Ce = u.has(k);
|
|
1635
1635
|
a[k] = {
|
|
1636
1636
|
childrenOpen: H(k),
|
|
1637
1637
|
expanded: !1,
|
|
@@ -1645,24 +1645,24 @@ const Yn = { class: "gantt-connection-overlay" }, jn = {
|
|
|
1645
1645
|
};
|
|
1646
1646
|
}
|
|
1647
1647
|
return a;
|
|
1648
|
-
},
|
|
1648
|
+
}, c = z(e.columns), i = z(e.rows), s = z(e.config || {}), n = z({}), l = z({}), d = D(() => {
|
|
1649
1649
|
const a = {};
|
|
1650
|
-
for (const [u, h] of
|
|
1651
|
-
for (const [
|
|
1652
|
-
a[`${u}:${
|
|
1650
|
+
for (const [u, h] of c.value.entries())
|
|
1651
|
+
for (const [C, H] of i.value.entries())
|
|
1652
|
+
a[`${u}:${C}`] = H[h.name];
|
|
1653
1653
|
return a;
|
|
1654
1654
|
}), f = D({
|
|
1655
1655
|
get: () => {
|
|
1656
|
-
const a =
|
|
1656
|
+
const a = r();
|
|
1657
1657
|
for (let u = 0; u < a.length; u++)
|
|
1658
1658
|
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));
|
|
1659
1659
|
if (b.value) {
|
|
1660
|
-
const u = (h,
|
|
1661
|
-
const H =
|
|
1660
|
+
const u = (h, C) => {
|
|
1661
|
+
const H = C[h];
|
|
1662
1662
|
if (H.isRoot || H.parent === null || H.parent === void 0)
|
|
1663
1663
|
return !0;
|
|
1664
1664
|
const k = H.parent;
|
|
1665
|
-
return k < 0 || k >=
|
|
1665
|
+
return k < 0 || k >= C.length ? !1 : (C[k].childrenOpen || !1) && u(k, C);
|
|
1666
1666
|
};
|
|
1667
1667
|
for (let h = 0; h < a.length; h++)
|
|
1668
1668
|
a[h].isRoot || (a[h].open = u(h, a));
|
|
@@ -1672,24 +1672,24 @@ const Yn = { class: "gantt-connection-overlay" }, jn = {
|
|
|
1672
1672
|
set: (a) => {
|
|
1673
1673
|
JSON.stringify(a) !== JSON.stringify(f.value) && (f.value = a);
|
|
1674
1674
|
}
|
|
1675
|
-
}),
|
|
1676
|
-
const a =
|
|
1675
|
+
}), w = z(e.modal || { visible: !1 }), y = z({}), m = z([]), E = z([]), p = z([]), v = D(() => c.value.some((a) => a.pinned)), g = D(() => s.value.view === "gantt" || s.value.view === "tree-gantt"), b = D(() => s.value.view === "tree" || s.value.view === "tree-gantt"), P = D(() => {
|
|
1676
|
+
const a = s.value;
|
|
1677
1677
|
return a.view === "gantt" || a.view === "tree-gantt" ? a.dependencyGraph !== !1 : !0;
|
|
1678
|
-
}), B = D(() => `${Math.ceil(
|
|
1679
|
-
() =>
|
|
1680
|
-
),
|
|
1681
|
-
const
|
|
1682
|
-
d.value[
|
|
1683
|
-
...
|
|
1678
|
+
}), B = D(() => `${Math.ceil(i.value.length / 100 + 1)}ch`), F = D(
|
|
1679
|
+
() => s.value.view ? ["list", "tree", "tree-gantt", "list-expansion"].includes(s.value.view) : !1
|
|
1680
|
+
), M = (a, u) => d.value[`${a}:${u}`], x = (a, u, h) => {
|
|
1681
|
+
const C = `${a}:${u}`, H = c.value[a];
|
|
1682
|
+
d.value[C] !== h && (n.value[u] = !0), d.value[C] = h, i.value[u] = {
|
|
1683
|
+
...i.value[u],
|
|
1684
1684
|
[H.name]: h
|
|
1685
1685
|
};
|
|
1686
1686
|
}, $ = (a) => {
|
|
1687
|
-
|
|
1687
|
+
i.value = a;
|
|
1688
1688
|
}, X = (a, u, h) => {
|
|
1689
|
-
const
|
|
1690
|
-
d.value[
|
|
1689
|
+
const C = `${a}:${u}`;
|
|
1690
|
+
d.value[C] !== h && (n.value[u] = !0, y.value[C] = h);
|
|
1691
1691
|
}, W = (a) => {
|
|
1692
|
-
const u =
|
|
1692
|
+
const u = c.value.indexOf(a) === c.value.length - 1, h = s.value.fullWidth ? a.resizable && !u : a.resizable;
|
|
1693
1693
|
return {
|
|
1694
1694
|
width: a.width || "40ch",
|
|
1695
1695
|
textAlign: a.align || "center",
|
|
@@ -1700,57 +1700,57 @@ const Yn = { class: "gantt-connection-overlay" }, jn = {
|
|
|
1700
1700
|
}
|
|
1701
1701
|
};
|
|
1702
1702
|
}, O = (a, u) => {
|
|
1703
|
-
if (a < 0 || a >=
|
|
1704
|
-
const
|
|
1705
|
-
|
|
1706
|
-
...
|
|
1707
|
-
width: `${
|
|
1703
|
+
if (a < 0 || a >= c.value.length) return;
|
|
1704
|
+
const C = Math.max(u, 40);
|
|
1705
|
+
c.value[a] = {
|
|
1706
|
+
...c.value[a],
|
|
1707
|
+
width: `${C}px`
|
|
1708
1708
|
};
|
|
1709
1709
|
}, Y = (a) => {
|
|
1710
|
-
const u =
|
|
1710
|
+
const u = i.value[a];
|
|
1711
1711
|
return g.value && u.gantt !== void 0;
|
|
1712
|
-
}, _ = (a) => !b.value || f.value[a].isRoot || f.value[a].open,
|
|
1712
|
+
}, _ = (a) => !b.value || f.value[a].isRoot || f.value[a].open, xe = (a) => !b.value && s.value.view !== "list-expansion" ? "" : b.value && (f.value[a].isRoot || f.value[a].isParent) ? f.value[a].childrenOpen ? "▼" : "►" : s.value.view === "list-expansion" ? f.value[a].expanded ? "▼" : "►" : "", ge = (a) => {
|
|
1713
1713
|
if (b.value) {
|
|
1714
|
-
const u = l.value[a] || {},
|
|
1714
|
+
const u = l.value[a] || {}, C = !(u.childrenOpen ?? f.value[a].childrenOpen);
|
|
1715
1715
|
l.value[a] = {
|
|
1716
1716
|
...u,
|
|
1717
|
-
childrenOpen:
|
|
1718
|
-
},
|
|
1719
|
-
} else if (
|
|
1717
|
+
childrenOpen: C
|
|
1718
|
+
}, C || ye(a);
|
|
1719
|
+
} else if (s.value.view === "list-expansion") {
|
|
1720
1720
|
const u = l.value[a] || {}, h = u.expanded ?? f.value[a].expanded;
|
|
1721
1721
|
l.value[a] = {
|
|
1722
1722
|
...u,
|
|
1723
1723
|
expanded: !h
|
|
1724
1724
|
};
|
|
1725
1725
|
}
|
|
1726
|
-
},
|
|
1727
|
-
for (let u = 0; u <
|
|
1726
|
+
}, ye = (a) => {
|
|
1727
|
+
for (let u = 0; u < i.value.length; u++)
|
|
1728
1728
|
if (f.value[u].parent === a) {
|
|
1729
1729
|
const h = l.value[u] || {};
|
|
1730
1730
|
l.value[u] = {
|
|
1731
1731
|
...h,
|
|
1732
1732
|
childrenOpen: !1
|
|
1733
|
-
},
|
|
1733
|
+
}, ye(u);
|
|
1734
1734
|
}
|
|
1735
1735
|
}, Oe = (a, u) => {
|
|
1736
|
-
const h =
|
|
1736
|
+
const h = M(a, u);
|
|
1737
1737
|
return be(a, u, h);
|
|
1738
1738
|
}, be = (a, u, h) => {
|
|
1739
|
-
const
|
|
1740
|
-
return k ? typeof k == "function" ? k(h, { table: d.value, row: H, column:
|
|
1739
|
+
const C = c.value[a], H = i.value[u], k = C.format;
|
|
1740
|
+
return k ? typeof k == "function" ? k(h, { table: d.value, row: H, column: C }) : typeof k == "string" ? Function(`"use strict";return (${k})`)()(h, { table: d.value, row: H, column: C }) : h : h;
|
|
1741
1741
|
};
|
|
1742
1742
|
return {
|
|
1743
1743
|
// state
|
|
1744
|
-
columns:
|
|
1745
|
-
config:
|
|
1746
|
-
connectionHandles:
|
|
1747
|
-
connectionPaths:
|
|
1744
|
+
columns: c,
|
|
1745
|
+
config: s,
|
|
1746
|
+
connectionHandles: E,
|
|
1747
|
+
connectionPaths: p,
|
|
1748
1748
|
display: f,
|
|
1749
1749
|
ganttBars: m,
|
|
1750
|
-
modal:
|
|
1751
|
-
rows:
|
|
1750
|
+
modal: w,
|
|
1751
|
+
rows: i,
|
|
1752
1752
|
table: d,
|
|
1753
|
-
updates:
|
|
1753
|
+
updates: y,
|
|
1754
1754
|
// getters
|
|
1755
1755
|
hasPinnedColumns: v,
|
|
1756
1756
|
isGanttView: g,
|
|
@@ -1760,17 +1760,17 @@ const Yn = { class: "gantt-connection-overlay" }, jn = {
|
|
|
1760
1760
|
zeroColumn: F,
|
|
1761
1761
|
// actions
|
|
1762
1762
|
closeModal: (a) => {
|
|
1763
|
-
a.target instanceof Node &&
|
|
1763
|
+
a.target instanceof Node && w.value.parent?.contains(a.target) || w.value.visible && (w.value.visible = !1);
|
|
1764
1764
|
},
|
|
1765
1765
|
createConnection: (a, u, h) => {
|
|
1766
|
-
const
|
|
1767
|
-
if (!
|
|
1766
|
+
const C = E.value.find((A) => A.id === a), H = E.value.find((A) => A.id === u);
|
|
1767
|
+
if (!C || !H)
|
|
1768
1768
|
return console.warn("Cannot create connection: handle not found"), null;
|
|
1769
1769
|
const k = {
|
|
1770
1770
|
id: `connection-${a}-${u}`,
|
|
1771
1771
|
from: {
|
|
1772
|
-
barId:
|
|
1773
|
-
side:
|
|
1772
|
+
barId: C.barId,
|
|
1773
|
+
side: C.side
|
|
1774
1774
|
},
|
|
1775
1775
|
to: {
|
|
1776
1776
|
barId: H.barId,
|
|
@@ -1779,44 +1779,44 @@ const Yn = { class: "gantt-connection-overlay" }, jn = {
|
|
|
1779
1779
|
style: h?.style,
|
|
1780
1780
|
label: h?.label
|
|
1781
1781
|
};
|
|
1782
|
-
return
|
|
1782
|
+
return p.value.push(k), k;
|
|
1783
1783
|
},
|
|
1784
1784
|
deleteConnection: (a) => {
|
|
1785
|
-
const u =
|
|
1786
|
-
return u >= 0 ? (
|
|
1785
|
+
const u = p.value.findIndex((h) => h.id === a);
|
|
1786
|
+
return u >= 0 ? (p.value.splice(u, 1), !0) : !1;
|
|
1787
1787
|
},
|
|
1788
|
-
getCellData:
|
|
1788
|
+
getCellData: M,
|
|
1789
1789
|
getCellDisplayValue: Oe,
|
|
1790
|
-
getConnectionsForBar: (a) =>
|
|
1790
|
+
getConnectionsForBar: (a) => p.value.filter((u) => u.from.barId === a || u.to.barId === a),
|
|
1791
1791
|
getFormattedValue: be,
|
|
1792
|
-
getHandlesForBar: (a) =>
|
|
1792
|
+
getHandlesForBar: (a) => E.value.filter((u) => u.barId === a),
|
|
1793
1793
|
getHeaderCellStyle: W,
|
|
1794
1794
|
getIndent: (a, u) => u && a === 0 && u > 0 ? `${u}ch` : "inherit",
|
|
1795
|
-
getRowExpandSymbol:
|
|
1795
|
+
getRowExpandSymbol: xe,
|
|
1796
1796
|
isRowGantt: Y,
|
|
1797
1797
|
isRowVisible: _,
|
|
1798
1798
|
registerConnectionHandle: (a) => {
|
|
1799
|
-
const u =
|
|
1800
|
-
u >= 0 ?
|
|
1799
|
+
const u = E.value.findIndex((h) => h.id === a.id);
|
|
1800
|
+
u >= 0 ? E.value[u] = a : E.value.push(a);
|
|
1801
1801
|
},
|
|
1802
1802
|
registerGanttBar: (a) => {
|
|
1803
1803
|
const u = m.value.findIndex((h) => h.id === a.id);
|
|
1804
1804
|
u >= 0 ? m.value[u] = a : m.value.push(a);
|
|
1805
1805
|
},
|
|
1806
1806
|
resizeColumn: O,
|
|
1807
|
-
setCellData:
|
|
1807
|
+
setCellData: x,
|
|
1808
1808
|
setCellText: X,
|
|
1809
1809
|
toggleRowExpand: ge,
|
|
1810
1810
|
unregisterConnectionHandle: (a) => {
|
|
1811
|
-
const u =
|
|
1812
|
-
u >= 0 &&
|
|
1811
|
+
const u = E.value.findIndex((h) => h.id === a);
|
|
1812
|
+
u >= 0 && E.value.splice(u, 1);
|
|
1813
1813
|
},
|
|
1814
1814
|
unregisterGanttBar: (a) => {
|
|
1815
1815
|
const u = m.value.findIndex((h) => h.id === a);
|
|
1816
1816
|
u >= 0 && m.value.splice(u, 1);
|
|
1817
1817
|
},
|
|
1818
1818
|
updateGanttBar: (a) => {
|
|
1819
|
-
const u =
|
|
1819
|
+
const u = i.value[a.rowIndex]?.gantt;
|
|
1820
1820
|
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));
|
|
1821
1821
|
},
|
|
1822
1822
|
updateRows: $
|
|
@@ -1838,41 +1838,41 @@ const Yn = { class: "gantt-connection-overlay" }, jn = {
|
|
|
1838
1838
|
}),
|
|
1839
1839
|
emits: /* @__PURE__ */ at(["cellUpdate", "gantt:drag", "connection:event", "columns:update"], ["update:rows", "update:columns"]),
|
|
1840
1840
|
setup(e, { expose: t, emit: o }) {
|
|
1841
|
-
const
|
|
1842
|
-
n.$onAction(({ name: m, store:
|
|
1841
|
+
const r = st(e, "rows"), c = st(e, "columns"), i = o, s = U("table"), n = to({ columns: c.value, rows: r.value, id: e.id, config: e.config });
|
|
1842
|
+
n.$onAction(({ name: m, store: E, args: p, after: v }) => {
|
|
1843
1843
|
if (m === "setCellData" || m === "setCellText") {
|
|
1844
|
-
const [g, b, P] =
|
|
1844
|
+
const [g, b, P] = p, B = E.getCellData(g, b);
|
|
1845
1845
|
v(() => {
|
|
1846
|
-
|
|
1846
|
+
r.value = [...E.rows], i("cellUpdate", { colIndex: g, rowIndex: b, newValue: P, oldValue: B });
|
|
1847
1847
|
});
|
|
1848
1848
|
} else if (m === "updateGanttBar") {
|
|
1849
|
-
const [g] =
|
|
1849
|
+
const [g] = p;
|
|
1850
1850
|
let b = !1;
|
|
1851
1851
|
g.type === "resize" ? b = g.oldColspan !== g.newColspan : g.type === "bar" && (b = g.oldStart !== g.newStart || g.oldEnd !== g.newEnd), b && v(() => {
|
|
1852
|
-
|
|
1852
|
+
i("gantt:drag", g);
|
|
1853
1853
|
});
|
|
1854
1854
|
} else m === "resizeColumn" && v(() => {
|
|
1855
|
-
|
|
1855
|
+
c.value = [...E.columns], i("columns:update", [...E.columns]);
|
|
1856
1856
|
});
|
|
1857
1857
|
}), V(
|
|
1858
|
-
() =>
|
|
1858
|
+
() => r.value,
|
|
1859
1859
|
(m) => {
|
|
1860
1860
|
JSON.stringify(m) !== JSON.stringify(n.rows) && (n.rows = [...m]);
|
|
1861
1861
|
},
|
|
1862
1862
|
{ deep: !0 }
|
|
1863
1863
|
), V(
|
|
1864
|
-
|
|
1864
|
+
c,
|
|
1865
1865
|
(m) => {
|
|
1866
|
-
JSON.stringify(m) !== JSON.stringify(n.columns) && (n.columns = [...m],
|
|
1866
|
+
JSON.stringify(m) !== JSON.stringify(n.columns) && (n.columns = [...m], i("columns:update", [...m]));
|
|
1867
1867
|
},
|
|
1868
1868
|
{ deep: !0 }
|
|
1869
1869
|
), re(() => {
|
|
1870
|
-
|
|
1870
|
+
c.value.some((m) => m.pinned) && (d(), n.isTreeView && kt(s, d, { childList: !0, subtree: !0 }));
|
|
1871
1871
|
});
|
|
1872
1872
|
const l = D(() => n.columns.filter((m) => m.pinned).length), d = () => {
|
|
1873
|
-
const m =
|
|
1873
|
+
const m = s.value, E = m?.rows[0], p = m?.rows[1], v = E ? Array.from(E.cells) : [];
|
|
1874
1874
|
for (const [g, b] of v.entries()) {
|
|
1875
|
-
const P =
|
|
1875
|
+
const P = p?.cells[g];
|
|
1876
1876
|
P && (b.style.width = `${P.offsetWidth}px`);
|
|
1877
1877
|
}
|
|
1878
1878
|
for (const g of m?.rows || []) {
|
|
@@ -1886,32 +1886,32 @@ const Yn = { class: "gantt-connection-overlay" }, jn = {
|
|
|
1886
1886
|
window.addEventListener("keydown", (m) => {
|
|
1887
1887
|
if (m.key === "Escape" && n.modal.visible) {
|
|
1888
1888
|
n.modal.visible = !1;
|
|
1889
|
-
const
|
|
1890
|
-
|
|
1891
|
-
|
|
1889
|
+
const E = n.modal.parent;
|
|
1890
|
+
E && Fe().then(() => {
|
|
1891
|
+
E.focus();
|
|
1892
1892
|
});
|
|
1893
1893
|
}
|
|
1894
1894
|
});
|
|
1895
1895
|
const f = (m) => {
|
|
1896
1896
|
if (!m.gantt || l.value === 0)
|
|
1897
1897
|
return n.columns;
|
|
1898
|
-
const
|
|
1899
|
-
for (let
|
|
1900
|
-
const v = { ...n.columns[
|
|
1901
|
-
v.originalIndex =
|
|
1898
|
+
const E = [];
|
|
1899
|
+
for (let p = 0; p < l.value; p++) {
|
|
1900
|
+
const v = { ...n.columns[p] };
|
|
1901
|
+
v.originalIndex = p, E.push(v);
|
|
1902
1902
|
}
|
|
1903
|
-
return
|
|
1903
|
+
return E.push({
|
|
1904
1904
|
...n.columns[l.value],
|
|
1905
1905
|
isGantt: !0,
|
|
1906
1906
|
colspan: m.gantt?.colspan || n.columns.length - l.value,
|
|
1907
1907
|
originalIndex: l.value,
|
|
1908
1908
|
width: "auto"
|
|
1909
1909
|
// TODO: refactor to API that can detect when data exists in a cell. Might have be custom and not generalizable
|
|
1910
|
-
}),
|
|
1911
|
-
},
|
|
1912
|
-
|
|
1913
|
-
},
|
|
1914
|
-
|
|
1910
|
+
}), E;
|
|
1911
|
+
}, w = (m) => {
|
|
1912
|
+
i("connection:event", { type: "create", connection: m });
|
|
1913
|
+
}, y = (m) => {
|
|
1914
|
+
i("connection:event", { type: "delete", connection: m });
|
|
1915
1915
|
};
|
|
1916
1916
|
return t({
|
|
1917
1917
|
store: n,
|
|
@@ -1919,7 +1919,7 @@ const Yn = { class: "gantt-connection-overlay" }, jn = {
|
|
|
1919
1919
|
deleteConnection: n.deleteConnection,
|
|
1920
1920
|
getConnectionsForBar: n.getConnectionsForBar,
|
|
1921
1921
|
getHandlesForBar: n.getHandlesForBar
|
|
1922
|
-
}), (m,
|
|
1922
|
+
}), (m, E) => (T(), L("div", no, [
|
|
1923
1923
|
Me((T(), L("table", {
|
|
1924
1924
|
ref: "table",
|
|
1925
1925
|
class: "atable",
|
|
@@ -1935,23 +1935,23 @@ const Yn = { class: "gantt-connection-overlay" }, jn = {
|
|
|
1935
1935
|
], !0),
|
|
1936
1936
|
N("tbody", null, [
|
|
1937
1937
|
j(m.$slots, "body", { data: R(n) }, () => [
|
|
1938
|
-
(T(!0), L(ae, null,
|
|
1939
|
-
key:
|
|
1940
|
-
row:
|
|
1938
|
+
(T(!0), L(ae, null, we(R(n).rows, (p, v) => (T(), ce($t, {
|
|
1939
|
+
key: p.id,
|
|
1940
|
+
row: p,
|
|
1941
1941
|
rowIndex: v,
|
|
1942
1942
|
store: R(n)
|
|
1943
1943
|
}, {
|
|
1944
1944
|
default: it(() => [
|
|
1945
|
-
(T(!0), L(ae, null,
|
|
1945
|
+
(T(!0), L(ae, null, we(f(p), (g, b) => (T(), L(ae, {
|
|
1946
1946
|
key: g.name
|
|
1947
1947
|
}, [
|
|
1948
1948
|
g.isGantt ? (T(), ce(ke(g.ganttComponent || "AGanttCell"), {
|
|
1949
1949
|
key: 0,
|
|
1950
1950
|
store: R(n),
|
|
1951
1951
|
columnsCount: R(n).columns.length - l.value,
|
|
1952
|
-
color:
|
|
1953
|
-
start:
|
|
1954
|
-
end:
|
|
1952
|
+
color: p.gantt?.color,
|
|
1953
|
+
start: p.gantt?.startIndex,
|
|
1954
|
+
end: p.gantt?.endIndex,
|
|
1955
1955
|
colspan: g.colspan,
|
|
1956
1956
|
pinned: g.pinned,
|
|
1957
1957
|
rowIndex: v,
|
|
@@ -1961,7 +1961,7 @@ const Yn = { class: "gantt-connection-overlay" }, jn = {
|
|
|
1961
1961
|
minWidth: g?.width || "40ch",
|
|
1962
1962
|
width: R(n).config.fullWidth ? "auto" : null
|
|
1963
1963
|
}),
|
|
1964
|
-
"onConnection:create":
|
|
1964
|
+
"onConnection:create": w
|
|
1965
1965
|
}, null, 40, ["store", "columnsCount", "color", "start", "end", "colspan", "pinned", "rowIndex", "colIndex", "style"])) : (T(), ce(ke(g.cellComponent || "ACell"), {
|
|
1966
1966
|
key: 1,
|
|
1967
1967
|
store: R(n),
|
|
@@ -2002,7 +2002,7 @@ const Yn = { class: "gantt-connection-overlay" }, jn = {
|
|
|
2002
2002
|
R(n).isGanttView && R(n).isDependencyGraphEnabled ? (T(), ce(Qn, {
|
|
2003
2003
|
key: 0,
|
|
2004
2004
|
store: R(n),
|
|
2005
|
-
"onConnection:delete":
|
|
2005
|
+
"onConnection:delete": y
|
|
2006
2006
|
}, null, 8, ["store"])) : J("", !0)
|
|
2007
2007
|
]));
|
|
2008
2008
|
}
|
|
@@ -2025,7 +2025,7 @@ function mo(e, t) {
|
|
|
2025
2025
|
]);
|
|
2026
2026
|
}
|
|
2027
2027
|
const go = /* @__PURE__ */ ie(uo, [["render", mo], ["__scopeId", "data-v-e1165876"]]);
|
|
2028
|
-
function
|
|
2028
|
+
function po(e) {
|
|
2029
2029
|
e.component("ACell", En), e.component("AExpansionRow", Sn), e.component("AGanttCell", Pn), e.component("ARow", $t), e.component("ATable", lo), e.component("ATableHeader", St), e.component("ATableLoading", co), e.component("ATableLoadingBar", go), e.component("ATableModal", Mt);
|
|
2030
2030
|
}
|
|
2031
2031
|
export {
|
|
@@ -2039,6 +2039,6 @@ export {
|
|
|
2039
2039
|
go as ATableLoadingBar,
|
|
2040
2040
|
Mt as ATableModal,
|
|
2041
2041
|
to as createTableStore,
|
|
2042
|
-
|
|
2042
|
+
po as install
|
|
2043
2043
|
};
|
|
2044
2044
|
//# sourceMappingURL=atable.js.map
|