@stonecrop/atable 0.4.34 → 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 -622
- 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/src/components/ACell.vue +2 -0
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,119 +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
|
-
|
|
806
|
-
|
|
804
|
+
}, B = (M) => {
|
|
805
|
+
if (!s.edit) return;
|
|
806
|
+
const x = M.target;
|
|
807
|
+
if (x.textContent === c.value)
|
|
807
808
|
return;
|
|
808
809
|
const $ = b();
|
|
809
|
-
|
|
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(() => {
|
|
810
811
|
P($);
|
|
811
812
|
});
|
|
812
813
|
}, F = /* @__PURE__ */ vn(B, e.debounce);
|
|
813
814
|
return t({
|
|
814
|
-
currentData:
|
|
815
|
-
}), (
|
|
815
|
+
currentData: c
|
|
816
|
+
}), (M, x) => (T(), L("td", {
|
|
816
817
|
ref: "cell",
|
|
817
|
-
"data-colindex":
|
|
818
|
-
"data-rowindex":
|
|
819
|
-
"data-editable": R(
|
|
820
|
-
contenteditable: R(
|
|
821
|
-
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,
|
|
822
823
|
spellcheck: !1,
|
|
823
|
-
style: ee(
|
|
824
|
+
style: ee(y.value),
|
|
824
825
|
onFocus: g,
|
|
825
826
|
onPaste: B,
|
|
826
|
-
onInput:
|
|
827
|
+
onInput: x[0] || (x[0] = //@ts-ignore
|
|
827
828
|
(...$) => R(F) && R(F)(...$)),
|
|
828
|
-
onClick:
|
|
829
|
+
onClick: E,
|
|
829
830
|
class: q(["atable-cell", m.value])
|
|
830
831
|
}, [
|
|
831
|
-
R(
|
|
832
|
+
R(s).cellComponent ? (T(), ce(ke(R(s).cellComponent), Ve({
|
|
832
833
|
key: 0,
|
|
833
834
|
value: f.value
|
|
834
|
-
}, R(
|
|
835
|
+
}, R(s).cellComponentProps), null, 16, ["value"])) : w.value ? (T(), L("span", {
|
|
835
836
|
key: 1,
|
|
836
837
|
innerHTML: f.value
|
|
837
838
|
}, null, 8, bn)) : (T(), L("span", Cn, ue(f.value), 1))
|
|
838
|
-
], 46,
|
|
839
|
+
], 46, yn));
|
|
839
840
|
}
|
|
840
841
|
}), In = ["tabindex"], kn = ["tabindex"], $n = ["colspan"], Rn = /* @__PURE__ */ te({
|
|
841
842
|
__name: "AExpansionRow",
|
|
@@ -848,51 +849,51 @@ const wn = (e) => {
|
|
|
848
849
|
setup(e) {
|
|
849
850
|
const t = U("rowEl"), o = D(() => e.store.display[e.rowIndex].expanded ? "▼" : "►");
|
|
850
851
|
if (e.addNavigation) {
|
|
851
|
-
const
|
|
852
|
-
"keydown.control.g": (
|
|
853
|
-
|
|
852
|
+
const r = {
|
|
853
|
+
"keydown.control.g": (c) => {
|
|
854
|
+
c.stopPropagation(), c.preventDefault(), e.store.toggleRowExpand(e.rowIndex);
|
|
854
855
|
}
|
|
855
856
|
};
|
|
856
|
-
typeof e.addNavigation == "object" && Object.assign(
|
|
857
|
+
typeof e.addNavigation == "object" && Object.assign(r, e.addNavigation), Qe([
|
|
857
858
|
{
|
|
858
859
|
selectors: t,
|
|
859
|
-
handlers:
|
|
860
|
+
handlers: r
|
|
860
861
|
}
|
|
861
862
|
]);
|
|
862
863
|
}
|
|
863
|
-
return (
|
|
864
|
-
N("tr", Ve(
|
|
864
|
+
return (r, c) => (T(), L(ae, null, [
|
|
865
|
+
N("tr", Ve(r.$attrs, {
|
|
865
866
|
ref: "rowEl",
|
|
866
|
-
tabindex:
|
|
867
|
+
tabindex: e.tabIndex,
|
|
867
868
|
class: "expandable-row"
|
|
868
869
|
}), [
|
|
869
870
|
N("td", {
|
|
870
871
|
tabIndex: -1,
|
|
871
|
-
onClick:
|
|
872
|
+
onClick: c[0] || (c[0] = (i) => e.store.toggleRowExpand(e.rowIndex)),
|
|
872
873
|
class: "row-index"
|
|
873
874
|
}, ue(o.value), 1),
|
|
874
|
-
j(
|
|
875
|
+
j(r.$slots, "row", {}, void 0, !0)
|
|
875
876
|
], 16, In),
|
|
876
|
-
|
|
877
|
+
e.store.display[e.rowIndex].expanded ? (T(), L("tr", {
|
|
877
878
|
key: 0,
|
|
878
879
|
ref: "rowExpanded",
|
|
879
|
-
tabindex:
|
|
880
|
+
tabindex: e.tabIndex,
|
|
880
881
|
class: "expanded-row"
|
|
881
882
|
}, [
|
|
882
883
|
N("td", {
|
|
883
884
|
tabIndex: -1,
|
|
884
|
-
colspan:
|
|
885
|
+
colspan: e.store.columns.length + 1,
|
|
885
886
|
class: "expanded-row-content"
|
|
886
887
|
}, [
|
|
887
|
-
j(
|
|
888
|
+
j(r.$slots, "content", {}, void 0, !0)
|
|
888
889
|
], 8, $n)
|
|
889
890
|
], 8, kn)) : J("", !0)
|
|
890
891
|
], 64));
|
|
891
892
|
}
|
|
892
893
|
}), ie = (e, t) => {
|
|
893
894
|
const o = e.__vccOpts || e;
|
|
894
|
-
for (const [
|
|
895
|
-
o[
|
|
895
|
+
for (const [r, c] of t)
|
|
896
|
+
o[r] = c;
|
|
896
897
|
return o;
|
|
897
898
|
}, Sn = /* @__PURE__ */ ie(Rn, [["__scopeId", "data-v-5ad4bb41"]]), Mn = ["colspan"], An = {
|
|
898
899
|
ref: "container",
|
|
@@ -915,16 +916,16 @@ const wn = (e) => {
|
|
|
915
916
|
},
|
|
916
917
|
emits: ["connection:create"],
|
|
917
918
|
setup(e, { expose: t, emit: o }) {
|
|
918
|
-
Lt((
|
|
919
|
-
|
|
920
|
-
|
|
919
|
+
Lt((I) => ({
|
|
920
|
+
v17bc2643: c.value,
|
|
921
|
+
v0a8a9192: I.colspan
|
|
921
922
|
}));
|
|
922
|
-
const
|
|
923
|
-
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;
|
|
924
925
|
return {
|
|
925
|
-
left: `${
|
|
926
|
-
width: `${a -
|
|
927
|
-
backgroundColor:
|
|
926
|
+
left: `${I}%`,
|
|
927
|
+
width: `${a - I}%`,
|
|
928
|
+
backgroundColor: c.value
|
|
928
929
|
};
|
|
929
930
|
}), W = D(
|
|
930
931
|
() => ({
|
|
@@ -938,85 +939,85 @@ const wn = (e) => {
|
|
|
938
939
|
})
|
|
939
940
|
), O = z({ startX: 0, startPos: 0 }), { isDragging: Y } = We(l, {
|
|
940
941
|
axis: "x",
|
|
941
|
-
onStart: () => ge(m.value,
|
|
942
|
-
onMove: ({ x:
|
|
943
|
-
onEnd: ({ x:
|
|
942
|
+
onStart: () => ge(m.value, p.value),
|
|
943
|
+
onMove: ({ x: I }) => ye(I),
|
|
944
|
+
onEnd: ({ x: I }) => Oe(I)
|
|
944
945
|
}), { isDragging: _ } = We(d, {
|
|
945
946
|
axis: "x",
|
|
946
|
-
onStart: () => ge(
|
|
947
|
-
onMove: ({ x:
|
|
948
|
-
onEnd: ({ x:
|
|
949
|
-
}), { 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, {
|
|
950
951
|
exact: !0,
|
|
951
952
|
axis: "x",
|
|
952
|
-
onStart: () => ge(m.value,
|
|
953
|
-
onMove: ({ x:
|
|
954
|
-
onEnd: ({ x:
|
|
953
|
+
onStart: () => ge(m.value, p.value),
|
|
954
|
+
onMove: ({ x: I }) => et(I),
|
|
955
|
+
onEnd: ({ x: I }) => tt(I)
|
|
955
956
|
});
|
|
956
957
|
re(() => {
|
|
957
958
|
nt();
|
|
958
959
|
}), Bt(() => {
|
|
959
960
|
ot();
|
|
960
961
|
});
|
|
961
|
-
function ge(
|
|
962
|
-
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 };
|
|
963
964
|
}
|
|
964
|
-
function
|
|
965
|
+
function ye(I) {
|
|
965
966
|
if (!Y.value || !n.value) return;
|
|
966
|
-
const u = (
|
|
967
|
+
const u = (I - O.value.startX) / $.value, h = Math.max(0, Math.min(v.value - 1, O.value.startPos + u));
|
|
967
968
|
n.value.style.left = `${h / e.colspan * 100}%`, n.value.style.width = `${(v.value - h) / e.colspan * 100}%`;
|
|
968
969
|
}
|
|
969
|
-
function Oe(
|
|
970
|
+
function Oe(I) {
|
|
970
971
|
if (!n.value) return;
|
|
971
|
-
const a =
|
|
972
|
-
|
|
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({
|
|
973
974
|
rowIndex: e.rowIndex,
|
|
974
975
|
colIndex: e.colIndex,
|
|
975
976
|
type: "resize",
|
|
976
977
|
edge: "start",
|
|
977
978
|
oldStart: h,
|
|
978
|
-
newStart:
|
|
979
|
+
newStart: C,
|
|
979
980
|
end: v.value,
|
|
980
981
|
delta: u,
|
|
981
982
|
oldColspan: v.value - h,
|
|
982
|
-
newColspan: v.value -
|
|
983
|
+
newColspan: v.value - C
|
|
983
984
|
});
|
|
984
985
|
}
|
|
985
|
-
function be(
|
|
986
|
+
function be(I) {
|
|
986
987
|
if (!_.value || !n.value) return;
|
|
987
|
-
const u = (
|
|
988
|
-
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}%`;
|
|
989
990
|
}
|
|
990
|
-
function _e(
|
|
991
|
+
function _e(I) {
|
|
991
992
|
if (!n.value) return;
|
|
992
|
-
const a =
|
|
993
|
-
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({
|
|
994
995
|
rowIndex: e.rowIndex,
|
|
995
996
|
colIndex: e.colIndex,
|
|
996
997
|
type: "resize",
|
|
997
998
|
edge: "end",
|
|
998
999
|
oldEnd: h,
|
|
999
|
-
newEnd:
|
|
1000
|
-
start:
|
|
1000
|
+
newEnd: C,
|
|
1001
|
+
start: p.value,
|
|
1001
1002
|
delta: u,
|
|
1002
|
-
oldColspan: h -
|
|
1003
|
-
newColspan:
|
|
1003
|
+
oldColspan: h - p.value,
|
|
1004
|
+
newColspan: C - p.value
|
|
1004
1005
|
});
|
|
1005
1006
|
}
|
|
1006
|
-
function et(
|
|
1007
|
-
if (!
|
|
1008
|
-
const u = (
|
|
1009
|
-
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}%`;
|
|
1010
1011
|
}
|
|
1011
|
-
function tt(
|
|
1012
|
+
function tt(I) {
|
|
1012
1013
|
if (!n.value) return;
|
|
1013
|
-
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;
|
|
1014
1015
|
let k = O.value.startPos + u, A = k + h;
|
|
1015
|
-
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({
|
|
1016
1017
|
rowIndex: e.rowIndex,
|
|
1017
1018
|
colIndex: e.colIndex,
|
|
1018
1019
|
type: "bar",
|
|
1019
|
-
oldStart:
|
|
1020
|
+
oldStart: C,
|
|
1020
1021
|
oldEnd: H,
|
|
1021
1022
|
newStart: k,
|
|
1022
1023
|
newEnd: A,
|
|
@@ -1025,36 +1026,36 @@ const wn = (e) => {
|
|
|
1025
1026
|
});
|
|
1026
1027
|
}
|
|
1027
1028
|
function nt() {
|
|
1028
|
-
const { x:
|
|
1029
|
+
const { x: I, y: a } = oe(n), { x: u, y: h } = oe(f), { x: C, y: H } = oe(w);
|
|
1029
1030
|
e.store.registerGanttBar({
|
|
1030
|
-
id:
|
|
1031
|
+
id: i,
|
|
1031
1032
|
rowIndex: e.rowIndex,
|
|
1032
1033
|
colIndex: e.colIndex,
|
|
1033
|
-
startIndex:
|
|
1034
|
+
startIndex: p,
|
|
1034
1035
|
endIndex: v,
|
|
1035
|
-
color:
|
|
1036
|
+
color: c,
|
|
1036
1037
|
label: e.label,
|
|
1037
|
-
position: { x:
|
|
1038
|
+
position: { x: I, y: a }
|
|
1038
1039
|
}), e.store.isDependencyGraphEnabled && (e.store.registerConnectionHandle({
|
|
1039
|
-
id: `${
|
|
1040
|
+
id: `${i}-connection-left`,
|
|
1040
1041
|
rowIndex: e.rowIndex,
|
|
1041
1042
|
colIndex: e.colIndex,
|
|
1042
1043
|
side: "left",
|
|
1043
1044
|
position: { x: u, y: h },
|
|
1044
1045
|
visible: g,
|
|
1045
|
-
barId:
|
|
1046
|
+
barId: i
|
|
1046
1047
|
}), e.store.registerConnectionHandle({
|
|
1047
|
-
id: `${
|
|
1048
|
+
id: `${i}-connection-right`,
|
|
1048
1049
|
rowIndex: e.rowIndex,
|
|
1049
1050
|
colIndex: e.colIndex,
|
|
1050
1051
|
side: "right",
|
|
1051
|
-
position: { x:
|
|
1052
|
+
position: { x: C, y: H },
|
|
1052
1053
|
visible: b,
|
|
1053
|
-
barId:
|
|
1054
|
+
barId: i
|
|
1054
1055
|
}));
|
|
1055
1056
|
}
|
|
1056
1057
|
function ot() {
|
|
1057
|
-
e.store.unregisterGanttBar(
|
|
1058
|
+
e.store.unregisterGanttBar(i), e.store.isDependencyGraphEnabled && (e.store.unregisterConnectionHandle(`${i}-connection-left`), e.store.unregisterConnectionHandle(`${i}-connection-right`));
|
|
1058
1059
|
}
|
|
1059
1060
|
function lt() {
|
|
1060
1061
|
e.store.isDependencyGraphEnabled && (g.value = !0, b.value = !0);
|
|
@@ -1062,35 +1063,35 @@ const wn = (e) => {
|
|
|
1062
1063
|
function He() {
|
|
1063
1064
|
!P.value && !B.value && (g.value = !1, b.value = !1);
|
|
1064
1065
|
}
|
|
1065
|
-
function Pe(
|
|
1066
|
-
a.preventDefault(), a.stopPropagation(), F.value = !0,
|
|
1067
|
-
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;
|
|
1068
1069
|
if (u) {
|
|
1069
1070
|
const H = u.getBoundingClientRect(), k = H.left + H.width / 2, A = H.top + H.height / 2;
|
|
1070
|
-
|
|
1071
|
+
M.value = { startX: k, startY: A, endX: k, endY: A };
|
|
1071
1072
|
}
|
|
1072
1073
|
const h = (H) => {
|
|
1073
|
-
|
|
1074
|
-
},
|
|
1075
|
-
Le(H,
|
|
1074
|
+
M.value.endX = H.clientX, M.value.endY = H.clientY;
|
|
1075
|
+
}, C = (H) => {
|
|
1076
|
+
Le(H, I), Be(h, C);
|
|
1076
1077
|
};
|
|
1077
|
-
document.addEventListener("mousemove", h), document.addEventListener("mouseup",
|
|
1078
|
+
document.addEventListener("mousemove", h), document.addEventListener("mouseup", C);
|
|
1078
1079
|
}
|
|
1079
|
-
function Le(
|
|
1080
|
-
const h = document.elementFromPoint(
|
|
1081
|
-
if (h && h !== (a === "left" ? f.value :
|
|
1082
|
-
const
|
|
1083
|
-
if (
|
|
1084
|
-
const H = parseInt(
|
|
1085
|
-
`${
|
|
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}`,
|
|
1086
1087
|
`${ne}-connection-${A}`
|
|
1087
1088
|
);
|
|
1088
|
-
Ce &&
|
|
1089
|
+
Ce && r("connection:create", Ce);
|
|
1089
1090
|
}
|
|
1090
1091
|
}
|
|
1091
1092
|
}
|
|
1092
|
-
function Be(
|
|
1093
|
-
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();
|
|
1094
1095
|
}
|
|
1095
1096
|
return t({
|
|
1096
1097
|
barStyle: X,
|
|
@@ -1102,62 +1103,62 @@ const wn = (e) => {
|
|
|
1102
1103
|
isRightConnectionDragging: B,
|
|
1103
1104
|
isRightConnectionVisible: b,
|
|
1104
1105
|
showDragPreview: F
|
|
1105
|
-
}), (
|
|
1106
|
+
}), (I, a) => (T(), L("td", {
|
|
1106
1107
|
class: "aganttcell",
|
|
1107
|
-
colspan:
|
|
1108
|
+
colspan: e.colspan
|
|
1108
1109
|
}, [
|
|
1109
1110
|
N("div", An, [
|
|
1110
1111
|
N("div", {
|
|
1111
1112
|
ref: "bar",
|
|
1112
|
-
"data-rowindex":
|
|
1113
|
-
"data-colindex":
|
|
1114
|
-
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 }]),
|
|
1115
1116
|
style: ee(X.value),
|
|
1116
1117
|
onMouseenter: lt,
|
|
1117
1118
|
onMouseleave: He
|
|
1118
1119
|
}, [
|
|
1119
|
-
|
|
1120
|
+
e.store.isDependencyGraphEnabled ? (T(), L("div", {
|
|
1120
1121
|
key: 0,
|
|
1121
1122
|
ref: "leftConnectionHandle",
|
|
1122
1123
|
class: q(["connection-handle left-connection-handle", { visible: g.value, "is-dragging": P.value }]),
|
|
1123
1124
|
onMousedown: a[0] || (a[0] = Se((u) => Pe("left", u), ["stop"]))
|
|
1124
|
-
}, a[2] || (a[2] = [
|
|
1125
|
+
}, [...a[2] || (a[2] = [
|
|
1125
1126
|
N("div", { class: "connection-dot" }, null, -1)
|
|
1126
|
-
]), 34)) : J("", !0),
|
|
1127
|
-
|
|
1127
|
+
])], 34)) : J("", !0),
|
|
1128
|
+
e.store.isDependencyGraphEnabled ? (T(), L("div", {
|
|
1128
1129
|
key: 1,
|
|
1129
1130
|
ref: "rightConnectionHandle",
|
|
1130
1131
|
class: q(["connection-handle right-connection-handle", { visible: b.value, "is-dragging": B.value }]),
|
|
1131
1132
|
onMousedown: a[1] || (a[1] = Se((u) => Pe("right", u), ["stop"]))
|
|
1132
|
-
}, a[3] || (a[3] = [
|
|
1133
|
+
}, [...a[3] || (a[3] = [
|
|
1133
1134
|
N("div", { class: "connection-dot" }, null, -1)
|
|
1134
|
-
]), 34)) : J("", !0),
|
|
1135
|
+
])], 34)) : J("", !0),
|
|
1135
1136
|
N("div", {
|
|
1136
1137
|
ref: "leftResizeHandle",
|
|
1137
1138
|
class: q(["resize-handle left-resize-handle", { "is-dragging": R(Y) }])
|
|
1138
|
-
}, a[4] || (a[4] = [
|
|
1139
|
+
}, [...a[4] || (a[4] = [
|
|
1139
1140
|
N("div", { class: "handle-grip" }, null, -1),
|
|
1140
1141
|
N("div", { class: "vertical-indicator left-indicator" }, null, -1)
|
|
1141
|
-
]), 2),
|
|
1142
|
-
|
|
1142
|
+
])], 2),
|
|
1143
|
+
e.label ? (T(), L("label", Dn, ue(e.label), 1)) : J("", !0),
|
|
1143
1144
|
N("div", {
|
|
1144
1145
|
ref: "rightResizeHandle",
|
|
1145
1146
|
class: q(["resize-handle right-resize-handle", { "is-dragging": R(_) }])
|
|
1146
|
-
}, a[5] || (a[5] = [
|
|
1147
|
+
}, [...a[5] || (a[5] = [
|
|
1147
1148
|
N("div", { class: "handle-grip" }, null, -1),
|
|
1148
1149
|
N("div", { class: "vertical-indicator right-indicator" }, null, -1)
|
|
1149
|
-
]), 2)
|
|
1150
|
+
])], 2)
|
|
1150
1151
|
], 46, Tn)
|
|
1151
1152
|
], 512),
|
|
1152
|
-
|
|
1153
|
+
e.store.isDependencyGraphEnabled && F.value ? (T(), L("svg", {
|
|
1153
1154
|
key: 0,
|
|
1154
1155
|
style: ee(W.value)
|
|
1155
1156
|
}, [
|
|
1156
1157
|
N("line", {
|
|
1157
|
-
x1:
|
|
1158
|
-
y1:
|
|
1159
|
-
x2:
|
|
1160
|
-
y2:
|
|
1158
|
+
x1: M.value.startX,
|
|
1159
|
+
y1: M.value.startY,
|
|
1160
|
+
x2: M.value.endX,
|
|
1161
|
+
y2: M.value.endY,
|
|
1161
1162
|
stroke: "#2196f3",
|
|
1162
1163
|
"stroke-width": "2",
|
|
1163
1164
|
"stroke-dasharray": "5,5"
|
|
@@ -1174,37 +1175,37 @@ const wn = (e) => {
|
|
|
1174
1175
|
addNavigation: { type: [Boolean, Object], default: !1 }
|
|
1175
1176
|
},
|
|
1176
1177
|
setup(e) {
|
|
1177
|
-
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));
|
|
1178
1179
|
if (e.addNavigation) {
|
|
1179
|
-
let
|
|
1180
|
-
typeof e.addNavigation == "object" && (
|
|
1181
|
-
...
|
|
1180
|
+
let c = Ze;
|
|
1181
|
+
typeof e.addNavigation == "object" && (c = {
|
|
1182
|
+
...c,
|
|
1182
1183
|
...e.addNavigation
|
|
1183
1184
|
}), Qe([
|
|
1184
1185
|
{
|
|
1185
1186
|
selectors: t,
|
|
1186
|
-
handlers:
|
|
1187
|
+
handlers: c
|
|
1187
1188
|
}
|
|
1188
1189
|
]);
|
|
1189
1190
|
}
|
|
1190
|
-
return (
|
|
1191
|
+
return (c, i) => Me((T(), L("tr", {
|
|
1191
1192
|
ref: "rowEl",
|
|
1192
|
-
tabindex:
|
|
1193
|
+
tabindex: e.tabIndex,
|
|
1193
1194
|
class: "atable-row"
|
|
1194
1195
|
}, [
|
|
1195
|
-
|
|
1196
|
-
|
|
1196
|
+
e.store.config.view !== "uncounted" ? j(c.$slots, "index", { key: 0 }, () => [
|
|
1197
|
+
e.store.config.view === "list" ? (T(), L("td", {
|
|
1197
1198
|
key: 0,
|
|
1198
1199
|
tabIndex: -1,
|
|
1199
|
-
class: q(["list-index",
|
|
1200
|
-
}, ue(
|
|
1200
|
+
class: q(["list-index", e.store.hasPinnedColumns ? "sticky-index" : ""])
|
|
1201
|
+
}, ue(e.rowIndex + 1), 3)) : e.store.isTreeView ? (T(), L("td", {
|
|
1201
1202
|
key: 1,
|
|
1202
1203
|
tabIndex: -1,
|
|
1203
|
-
class: q(["tree-index",
|
|
1204
|
-
onClick:
|
|
1205
|
-
}, 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)
|
|
1206
1207
|
], !0) : J("", !0),
|
|
1207
|
-
j(
|
|
1208
|
+
j(c.$slots, "default", {}, void 0, !0)
|
|
1208
1209
|
], 8, Ln)), [
|
|
1209
1210
|
[bt, o.value]
|
|
1210
1211
|
]);
|
|
@@ -1212,74 +1213,74 @@ const wn = (e) => {
|
|
|
1212
1213
|
}), $t = /* @__PURE__ */ ie(Bn, [["__scopeId", "data-v-c554ee0f"]]), Ke = Te ? window : void 0;
|
|
1213
1214
|
function le(e) {
|
|
1214
1215
|
var t;
|
|
1215
|
-
const o =
|
|
1216
|
+
const o = S(e);
|
|
1216
1217
|
return (t = o?.$el) != null ? t : o;
|
|
1217
1218
|
}
|
|
1218
1219
|
function Re(...e) {
|
|
1219
1220
|
const t = [], o = () => {
|
|
1220
1221
|
t.forEach((n) => n()), t.length = 0;
|
|
1221
|
-
},
|
|
1222
|
-
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);
|
|
1223
1224
|
return n.every((l) => typeof l != "string") ? n : void 0;
|
|
1224
|
-
}),
|
|
1225
|
+
}), i = Et(
|
|
1225
1226
|
() => {
|
|
1226
1227
|
var n, l;
|
|
1227
1228
|
return [
|
|
1228
|
-
(l = (n =
|
|
1229
|
-
se(
|
|
1230
|
-
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])),
|
|
1231
1232
|
// @ts-expect-error - TypeScript gets the correct types, but somehow still complains
|
|
1232
|
-
|
|
1233
|
+
S(c.value ? e[3] : e[2])
|
|
1233
1234
|
];
|
|
1234
1235
|
},
|
|
1235
1236
|
([n, l, d, f]) => {
|
|
1236
1237
|
if (o(), !n?.length || !l?.length || !d?.length)
|
|
1237
1238
|
return;
|
|
1238
|
-
const
|
|
1239
|
+
const w = Ct(f) ? { ...f } : f;
|
|
1239
1240
|
t.push(
|
|
1240
1241
|
...n.flatMap(
|
|
1241
|
-
(
|
|
1242
|
-
(m) => d.map((
|
|
1242
|
+
(y) => l.flatMap(
|
|
1243
|
+
(m) => d.map((E) => r(y, m, E, w))
|
|
1243
1244
|
)
|
|
1244
1245
|
)
|
|
1245
1246
|
);
|
|
1246
1247
|
},
|
|
1247
1248
|
{ flush: "post" }
|
|
1248
|
-
),
|
|
1249
|
-
|
|
1249
|
+
), s = () => {
|
|
1250
|
+
i(), o();
|
|
1250
1251
|
};
|
|
1251
|
-
return me(o),
|
|
1252
|
+
return me(o), s;
|
|
1252
1253
|
}
|
|
1253
1254
|
let gt = !1;
|
|
1254
1255
|
function ht(e, t, o = {}) {
|
|
1255
|
-
const { window:
|
|
1256
|
-
if (!
|
|
1256
|
+
const { window: r = Ke, ignore: c = [], capture: i = !0, detectIframe: s = !1, controls: n = !1 } = o;
|
|
1257
|
+
if (!r)
|
|
1257
1258
|
return n ? { stop: Z, cancel: Z, trigger: Z } : Z;
|
|
1258
1259
|
if (Ge && !gt) {
|
|
1259
1260
|
gt = !0;
|
|
1260
1261
|
const v = { passive: !0 };
|
|
1261
|
-
Array.from(
|
|
1262
|
+
Array.from(r.document.body.children).forEach((g) => g.addEventListener("click", Z, v)), r.document.documentElement.addEventListener("click", Z, v);
|
|
1262
1263
|
}
|
|
1263
1264
|
let l = !0;
|
|
1264
|
-
const d = (v) =>
|
|
1265
|
+
const d = (v) => S(c).some((g) => {
|
|
1265
1266
|
if (typeof g == "string")
|
|
1266
|
-
return Array.from(
|
|
1267
|
+
return Array.from(r.document.querySelectorAll(g)).some((b) => b === v.target || v.composedPath().includes(b));
|
|
1267
1268
|
{
|
|
1268
1269
|
const b = le(g);
|
|
1269
1270
|
return b && (v.target === b || v.composedPath().includes(b));
|
|
1270
1271
|
}
|
|
1271
1272
|
});
|
|
1272
1273
|
function f(v) {
|
|
1273
|
-
const g =
|
|
1274
|
+
const g = S(v);
|
|
1274
1275
|
return g && g.$.subTree.shapeFlag === 16;
|
|
1275
1276
|
}
|
|
1276
|
-
function
|
|
1277
|
-
const b =
|
|
1277
|
+
function w(v, g) {
|
|
1278
|
+
const b = S(v), P = b.$.subTree && b.$.subTree.children;
|
|
1278
1279
|
return P == null || !Array.isArray(P) ? !1 : P.some((B) => B.el === g.target || g.composedPath().includes(B.el));
|
|
1279
1280
|
}
|
|
1280
|
-
const
|
|
1281
|
+
const y = (v) => {
|
|
1281
1282
|
const g = le(e);
|
|
1282
|
-
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))) {
|
|
1283
1284
|
if ("detail" in v && v.detail === 0 && (l = !d(v)), !l) {
|
|
1284
1285
|
l = !0;
|
|
1285
1286
|
return;
|
|
@@ -1288,45 +1289,45 @@ function ht(e, t, o = {}) {
|
|
|
1288
1289
|
}
|
|
1289
1290
|
};
|
|
1290
1291
|
let m = !1;
|
|
1291
|
-
const
|
|
1292
|
-
Re(
|
|
1292
|
+
const E = [
|
|
1293
|
+
Re(r, "click", (v) => {
|
|
1293
1294
|
m || (m = !0, setTimeout(() => {
|
|
1294
1295
|
m = !1;
|
|
1295
|
-
}, 0),
|
|
1296
|
-
}, { passive: !0, capture:
|
|
1297
|
-
Re(
|
|
1296
|
+
}, 0), y(v));
|
|
1297
|
+
}, { passive: !0, capture: i }),
|
|
1298
|
+
Re(r, "pointerdown", (v) => {
|
|
1298
1299
|
const g = le(e);
|
|
1299
1300
|
l = !d(v) && !!(g && !v.composedPath().includes(g));
|
|
1300
1301
|
}, { passive: !0 }),
|
|
1301
|
-
|
|
1302
|
+
s && Re(r, "blur", (v) => {
|
|
1302
1303
|
setTimeout(() => {
|
|
1303
1304
|
var g;
|
|
1304
1305
|
const b = le(e);
|
|
1305
|
-
((g =
|
|
1306
|
+
((g = r.document.activeElement) == null ? void 0 : g.tagName) === "IFRAME" && !b?.contains(r.document.activeElement) && t(v);
|
|
1306
1307
|
}, 0);
|
|
1307
1308
|
}, { passive: !0 })
|
|
1308
|
-
].filter(Boolean),
|
|
1309
|
+
].filter(Boolean), p = () => E.forEach((v) => v());
|
|
1309
1310
|
return n ? {
|
|
1310
|
-
stop:
|
|
1311
|
+
stop: p,
|
|
1311
1312
|
cancel: () => {
|
|
1312
1313
|
l = !1;
|
|
1313
1314
|
},
|
|
1314
1315
|
trigger: (v) => {
|
|
1315
|
-
l = !0,
|
|
1316
|
+
l = !0, y(v), l = !1;
|
|
1316
1317
|
}
|
|
1317
|
-
} :
|
|
1318
|
+
} : p;
|
|
1318
1319
|
}
|
|
1319
1320
|
const ze = /* @__PURE__ */ new WeakMap(), Wn = {
|
|
1320
1321
|
mounted(e, t) {
|
|
1321
1322
|
const o = !t.modifiers.bubble;
|
|
1322
|
-
let
|
|
1323
|
+
let r;
|
|
1323
1324
|
if (typeof t.value == "function")
|
|
1324
|
-
|
|
1325
|
+
r = ht(e, t.value, { capture: o });
|
|
1325
1326
|
else {
|
|
1326
|
-
const [
|
|
1327
|
-
|
|
1327
|
+
const [c, i] = t.value;
|
|
1328
|
+
r = ht(e, c, Object.assign({ capture: o }, i));
|
|
1328
1329
|
}
|
|
1329
|
-
ze.set(e,
|
|
1330
|
+
ze.set(e, r);
|
|
1330
1331
|
},
|
|
1331
1332
|
unmounted(e) {
|
|
1332
1333
|
const t = ze.get(e);
|
|
@@ -1345,21 +1346,21 @@ function Nn(e) {
|
|
|
1345
1346
|
const t = /* @__PURE__ */ zn();
|
|
1346
1347
|
return D(() => (t.value, !!e()));
|
|
1347
1348
|
}
|
|
1348
|
-
function
|
|
1349
|
-
const { window:
|
|
1350
|
-
let
|
|
1351
|
-
const
|
|
1352
|
-
|
|
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);
|
|
1353
1354
|
}, l = D(() => {
|
|
1354
|
-
const
|
|
1355
|
-
return Array.isArray(
|
|
1355
|
+
const w = S(e);
|
|
1356
|
+
return Array.isArray(w) ? w.map((y) => le(y)) : [le(w)];
|
|
1356
1357
|
}), d = V(
|
|
1357
1358
|
l,
|
|
1358
|
-
(
|
|
1359
|
-
if (n(),
|
|
1360
|
-
|
|
1361
|
-
for (const
|
|
1362
|
-
|
|
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);
|
|
1363
1364
|
}
|
|
1364
1365
|
},
|
|
1365
1366
|
{ immediate: !0, flush: "post" }
|
|
@@ -1367,7 +1368,7 @@ function pt(e, t, o = {}) {
|
|
|
1367
1368
|
n(), d();
|
|
1368
1369
|
};
|
|
1369
1370
|
return me(f), {
|
|
1370
|
-
isSupported:
|
|
1371
|
+
isSupported: s,
|
|
1371
1372
|
stop: f
|
|
1372
1373
|
};
|
|
1373
1374
|
}
|
|
@@ -1376,7 +1377,7 @@ function Ne(e) {
|
|
|
1376
1377
|
}
|
|
1377
1378
|
const Xn = {
|
|
1378
1379
|
mounted(e, t) {
|
|
1379
|
-
typeof t.value == "function" ?
|
|
1380
|
+
typeof t.value == "function" ? wt(e, t.value) : wt(e, ...t.value);
|
|
1380
1381
|
}
|
|
1381
1382
|
};
|
|
1382
1383
|
function Rt(e) {
|
|
@@ -1395,12 +1396,12 @@ function Gn(e) {
|
|
|
1395
1396
|
const Xe = /* @__PURE__ */ new WeakMap();
|
|
1396
1397
|
function Fn(e, t = !1) {
|
|
1397
1398
|
const o = G(t);
|
|
1398
|
-
let
|
|
1399
|
+
let r = null, c = "";
|
|
1399
1400
|
V(cn(e), (n) => {
|
|
1400
|
-
const l = Ne(
|
|
1401
|
+
const l = Ne(S(n));
|
|
1401
1402
|
if (l) {
|
|
1402
1403
|
const d = l;
|
|
1403
|
-
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")
|
|
1404
1405
|
return o.value = !0;
|
|
1405
1406
|
if (o.value)
|
|
1406
1407
|
return d.style.overflow = "hidden";
|
|
@@ -1408,9 +1409,9 @@ function Fn(e, t = !1) {
|
|
|
1408
1409
|
}, {
|
|
1409
1410
|
immediate: !0
|
|
1410
1411
|
});
|
|
1411
|
-
const
|
|
1412
|
-
const n = Ne(
|
|
1413
|
-
!n || o.value || (Ge && (
|
|
1412
|
+
const i = () => {
|
|
1413
|
+
const n = Ne(S(e));
|
|
1414
|
+
!n || o.value || (Ge && (r = Re(
|
|
1414
1415
|
n,
|
|
1415
1416
|
"touchmove",
|
|
1416
1417
|
(l) => {
|
|
@@ -1418,28 +1419,28 @@ function Fn(e, t = !1) {
|
|
|
1418
1419
|
},
|
|
1419
1420
|
{ passive: !1 }
|
|
1420
1421
|
)), n.style.overflow = "hidden", o.value = !0);
|
|
1421
|
-
},
|
|
1422
|
-
const n = Ne(
|
|
1423
|
-
!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);
|
|
1424
1425
|
};
|
|
1425
|
-
return me(
|
|
1426
|
+
return me(s), D({
|
|
1426
1427
|
get() {
|
|
1427
1428
|
return o.value;
|
|
1428
1429
|
},
|
|
1429
1430
|
set(n) {
|
|
1430
|
-
n ?
|
|
1431
|
+
n ? i() : s();
|
|
1431
1432
|
}
|
|
1432
1433
|
});
|
|
1433
1434
|
}
|
|
1434
1435
|
function Vn() {
|
|
1435
1436
|
let e = !1;
|
|
1436
1437
|
const t = G(!1);
|
|
1437
|
-
return (o,
|
|
1438
|
-
if (t.value =
|
|
1438
|
+
return (o, r) => {
|
|
1439
|
+
if (t.value = r.value, e)
|
|
1439
1440
|
return;
|
|
1440
1441
|
e = !0;
|
|
1441
|
-
const
|
|
1442
|
-
V(t, (
|
|
1442
|
+
const c = Fn(o, r.value);
|
|
1443
|
+
V(t, (i) => c.value = i);
|
|
1443
1444
|
};
|
|
1444
1445
|
}
|
|
1445
1446
|
Vn();
|
|
@@ -1461,22 +1462,22 @@ const Yn = { class: "gantt-connection-overlay" }, jn = {
|
|
|
1461
1462
|
},
|
|
1462
1463
|
emits: ["connection:delete"],
|
|
1463
1464
|
setup(e, { emit: t }) {
|
|
1464
|
-
const o = t,
|
|
1465
|
-
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);
|
|
1466
1467
|
return n && l;
|
|
1467
|
-
})),
|
|
1468
|
+
})), c = (s, n = !1) => {
|
|
1468
1469
|
const l = e.store.connectionHandles.find(
|
|
1469
|
-
($) => $.barId ===
|
|
1470
|
+
($) => $.barId === s.from.barId && $.side === s.from.side
|
|
1470
1471
|
), d = e.store.connectionHandles.find(
|
|
1471
|
-
($) => $.barId ===
|
|
1472
|
+
($) => $.barId === s.to.barId && $.side === s.to.side
|
|
1472
1473
|
);
|
|
1473
1474
|
if (!l || !d) return "";
|
|
1474
|
-
const f = l.position.x + Ie / 2,
|
|
1475
|
-
return `M ${f} ${
|
|
1476
|
-
},
|
|
1477
|
-
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);
|
|
1478
1479
|
};
|
|
1479
|
-
return (
|
|
1480
|
+
return (s, n) => (T(), L("div", Yn, [
|
|
1480
1481
|
(T(), L("svg", jn, [
|
|
1481
1482
|
n[0] || (n[0] = N("defs", null, [
|
|
1482
1483
|
N("path", {
|
|
@@ -1501,25 +1502,25 @@ const Yn = { class: "gantt-connection-overlay" }, jn = {
|
|
|
1501
1502
|
})
|
|
1502
1503
|
])
|
|
1503
1504
|
], -1)),
|
|
1504
|
-
(T(!0), L(ae, null,
|
|
1505
|
+
(T(!0), L(ae, null, we(r.value, (l) => (T(), L("path", {
|
|
1505
1506
|
key: `${l.id}-hitbox`,
|
|
1506
|
-
d:
|
|
1507
|
+
d: c(l),
|
|
1507
1508
|
stroke: "transparent",
|
|
1508
1509
|
"stroke-width": (l.style?.width || 2) + 10,
|
|
1509
1510
|
fill: "none",
|
|
1510
1511
|
class: "connection-hitbox",
|
|
1511
|
-
onDblclick: (d) =>
|
|
1512
|
+
onDblclick: (d) => i(l)
|
|
1512
1513
|
}, null, 40, Un))), 128)),
|
|
1513
|
-
(T(!0), L(ae, null,
|
|
1514
|
+
(T(!0), L(ae, null, we(r.value, (l) => (T(), L("path", {
|
|
1514
1515
|
key: l.id,
|
|
1515
|
-
d:
|
|
1516
|
+
d: c(l),
|
|
1516
1517
|
stroke: l.style?.color || "#666",
|
|
1517
1518
|
"stroke-width": l.style?.width || 2,
|
|
1518
1519
|
fill: "none",
|
|
1519
1520
|
"marker-mid": "url(#arrowhead-marker)",
|
|
1520
1521
|
id: l.id,
|
|
1521
1522
|
class: "connection-path animated-path",
|
|
1522
|
-
onDblclick: (d) =>
|
|
1523
|
+
onDblclick: (d) => i(l)
|
|
1523
1524
|
}, null, 40, qn))), 128))
|
|
1524
1525
|
]))
|
|
1525
1526
|
]));
|
|
@@ -1535,32 +1536,32 @@ const Yn = { class: "gantt-connection-overlay" }, jn = {
|
|
|
1535
1536
|
},
|
|
1536
1537
|
setup(e) {
|
|
1537
1538
|
const t = (o) => {
|
|
1538
|
-
for (const
|
|
1539
|
-
if (
|
|
1540
|
-
const
|
|
1541
|
-
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);
|
|
1542
1543
|
}
|
|
1543
1544
|
};
|
|
1544
|
-
return (o,
|
|
1545
|
+
return (o, r) => e.columns.length ? (T(), L("thead", Kn, [
|
|
1545
1546
|
N("tr", _n, [
|
|
1546
|
-
|
|
1547
|
+
e.store.zeroColumn ? (T(), L("th", {
|
|
1547
1548
|
key: 0,
|
|
1548
1549
|
id: "header-index",
|
|
1549
1550
|
class: q([[
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1551
|
+
e.store.hasPinnedColumns ? "sticky-index" : "",
|
|
1552
|
+
e.store.isTreeView ? "tree-index" : "",
|
|
1553
|
+
e.store.config.view === "list-expansion" ? "list-expansion-index" : ""
|
|
1553
1554
|
], "list-index"])
|
|
1554
1555
|
}, null, 2)) : J("", !0),
|
|
1555
|
-
(T(!0), L(ae, null,
|
|
1556
|
-
key:
|
|
1557
|
-
"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,
|
|
1558
1559
|
tabindex: "-1",
|
|
1559
|
-
style: ee(
|
|
1560
|
-
class: q(
|
|
1560
|
+
style: ee(e.store.getHeaderCellStyle(c)),
|
|
1561
|
+
class: q(c.pinned ? "sticky-column" : "")
|
|
1561
1562
|
}, [
|
|
1562
1563
|
j(o.$slots, "default", {}, () => [
|
|
1563
|
-
Wt(ue(
|
|
1564
|
+
Wt(ue(c.label || String.fromCharCode(i + 97).toUpperCase()), 1)
|
|
1564
1565
|
])
|
|
1565
1566
|
], 14, eo)), [
|
|
1566
1567
|
[R(Xn), t]
|
|
@@ -1574,54 +1575,54 @@ const Yn = { class: "gantt-connection-overlay" }, jn = {
|
|
|
1574
1575
|
store: {}
|
|
1575
1576
|
},
|
|
1576
1577
|
setup(e) {
|
|
1577
|
-
const t = U("amodal"), { width: o, height:
|
|
1578
|
+
const t = U("amodal"), { width: o, height: r } = oe(t), c = D(() => {
|
|
1578
1579
|
if (!(e.store.modal.height && e.store.modal.width && e.store.modal.left && e.store.modal.bottom)) return;
|
|
1579
|
-
const
|
|
1580
|
+
const i = e.store.modal.cell?.closest("table"), s = i.offsetHeight || 0, n = i.offsetWidth || 0;
|
|
1580
1581
|
let l = e.store.modal.cell?.offsetTop || 0;
|
|
1581
|
-
const d =
|
|
1582
|
-
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);
|
|
1583
1584
|
let f = e.store.modal.cell?.offsetLeft || 0;
|
|
1584
1585
|
return f = f + o.value <= n ? f : f - (o.value - e.store.modal.width), {
|
|
1585
1586
|
left: `${f}px`,
|
|
1586
1587
|
top: `${l}px`
|
|
1587
1588
|
};
|
|
1588
1589
|
});
|
|
1589
|
-
return (
|
|
1590
|
+
return (i, s) => (T(), L("div", {
|
|
1590
1591
|
class: "amodal",
|
|
1591
1592
|
ref: "amodal",
|
|
1592
1593
|
tabindex: "-1",
|
|
1593
|
-
onClick:
|
|
1594
|
+
onClick: s[0] || (s[0] = Se(() => {
|
|
1594
1595
|
}, ["stop"])),
|
|
1595
|
-
onInput:
|
|
1596
|
+
onInput: s[1] || (s[1] = Se(() => {
|
|
1596
1597
|
}, ["stop"])),
|
|
1597
|
-
style: ee(
|
|
1598
|
+
style: ee(c.value)
|
|
1598
1599
|
}, [
|
|
1599
|
-
j(
|
|
1600
|
+
j(i.$slots, "default")
|
|
1600
1601
|
], 36));
|
|
1601
1602
|
}
|
|
1602
1603
|
}), to = (e) => {
|
|
1603
|
-
const t = e.id ||
|
|
1604
|
+
const t = e.id || xn();
|
|
1604
1605
|
return zt(`table-${t}`, () => {
|
|
1605
|
-
const
|
|
1606
|
+
const r = () => {
|
|
1606
1607
|
const a = [Object.assign({}, { rowModified: !1 })], u = /* @__PURE__ */ new Set();
|
|
1607
|
-
for (let k = 0; k <
|
|
1608
|
-
const A =
|
|
1608
|
+
for (let k = 0; k < i.value.length; k++) {
|
|
1609
|
+
const A = i.value[k];
|
|
1609
1610
|
A.parent !== null && A.parent !== void 0 && u.add(A.parent);
|
|
1610
1611
|
}
|
|
1611
|
-
const h = (k) =>
|
|
1612
|
-
for (let A = 0; A <
|
|
1613
|
-
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)))
|
|
1614
1615
|
return !0;
|
|
1615
1616
|
return !1;
|
|
1616
1617
|
}, H = (k) => {
|
|
1617
|
-
const A =
|
|
1618
|
+
const A = s.value, ne = A.view === "tree" || A.view === "tree-gantt" ? A.defaultTreeExpansion : void 0;
|
|
1618
1619
|
if (!ne) return !0;
|
|
1619
1620
|
switch (ne) {
|
|
1620
1621
|
case "root":
|
|
1621
1622
|
return !1;
|
|
1622
1623
|
// Only root nodes are visible, all children start collapsed
|
|
1623
1624
|
case "branch":
|
|
1624
|
-
return
|
|
1625
|
+
return C(k);
|
|
1625
1626
|
case "leaf":
|
|
1626
1627
|
return !0;
|
|
1627
1628
|
// All nodes should be expanded
|
|
@@ -1629,8 +1630,8 @@ const Yn = { class: "gantt-connection-overlay" }, jn = {
|
|
|
1629
1630
|
return !0;
|
|
1630
1631
|
}
|
|
1631
1632
|
};
|
|
1632
|
-
for (let k = 0; k <
|
|
1633
|
-
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);
|
|
1634
1635
|
a[k] = {
|
|
1635
1636
|
childrenOpen: H(k),
|
|
1636
1637
|
expanded: !1,
|
|
@@ -1644,24 +1645,24 @@ const Yn = { class: "gantt-connection-overlay" }, jn = {
|
|
|
1644
1645
|
};
|
|
1645
1646
|
}
|
|
1646
1647
|
return a;
|
|
1647
|
-
},
|
|
1648
|
+
}, c = z(e.columns), i = z(e.rows), s = z(e.config || {}), n = z({}), l = z({}), d = D(() => {
|
|
1648
1649
|
const a = {};
|
|
1649
|
-
for (const [u, h] of
|
|
1650
|
-
for (const [
|
|
1651
|
-
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];
|
|
1652
1653
|
return a;
|
|
1653
1654
|
}), f = D({
|
|
1654
1655
|
get: () => {
|
|
1655
|
-
const a =
|
|
1656
|
+
const a = r();
|
|
1656
1657
|
for (let u = 0; u < a.length; u++)
|
|
1657
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));
|
|
1658
1659
|
if (b.value) {
|
|
1659
|
-
const u = (h,
|
|
1660
|
-
const H =
|
|
1660
|
+
const u = (h, C) => {
|
|
1661
|
+
const H = C[h];
|
|
1661
1662
|
if (H.isRoot || H.parent === null || H.parent === void 0)
|
|
1662
1663
|
return !0;
|
|
1663
1664
|
const k = H.parent;
|
|
1664
|
-
return k < 0 || k >=
|
|
1665
|
+
return k < 0 || k >= C.length ? !1 : (C[k].childrenOpen || !1) && u(k, C);
|
|
1665
1666
|
};
|
|
1666
1667
|
for (let h = 0; h < a.length; h++)
|
|
1667
1668
|
a[h].isRoot || (a[h].open = u(h, a));
|
|
@@ -1671,24 +1672,24 @@ const Yn = { class: "gantt-connection-overlay" }, jn = {
|
|
|
1671
1672
|
set: (a) => {
|
|
1672
1673
|
JSON.stringify(a) !== JSON.stringify(f.value) && (f.value = a);
|
|
1673
1674
|
}
|
|
1674
|
-
}),
|
|
1675
|
-
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;
|
|
1676
1677
|
return a.view === "gantt" || a.view === "tree-gantt" ? a.dependencyGraph !== !1 : !0;
|
|
1677
|
-
}), B = D(() => `${Math.ceil(
|
|
1678
|
-
() =>
|
|
1679
|
-
),
|
|
1680
|
-
const
|
|
1681
|
-
d.value[
|
|
1682
|
-
...
|
|
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],
|
|
1683
1684
|
[H.name]: h
|
|
1684
1685
|
};
|
|
1685
1686
|
}, $ = (a) => {
|
|
1686
|
-
|
|
1687
|
+
i.value = a;
|
|
1687
1688
|
}, X = (a, u, h) => {
|
|
1688
|
-
const
|
|
1689
|
-
d.value[
|
|
1689
|
+
const C = `${a}:${u}`;
|
|
1690
|
+
d.value[C] !== h && (n.value[u] = !0, y.value[C] = h);
|
|
1690
1691
|
}, W = (a) => {
|
|
1691
|
-
const u =
|
|
1692
|
+
const u = c.value.indexOf(a) === c.value.length - 1, h = s.value.fullWidth ? a.resizable && !u : a.resizable;
|
|
1692
1693
|
return {
|
|
1693
1694
|
width: a.width || "40ch",
|
|
1694
1695
|
textAlign: a.align || "center",
|
|
@@ -1699,57 +1700,57 @@ const Yn = { class: "gantt-connection-overlay" }, jn = {
|
|
|
1699
1700
|
}
|
|
1700
1701
|
};
|
|
1701
1702
|
}, O = (a, u) => {
|
|
1702
|
-
if (a < 0 || a >=
|
|
1703
|
-
const
|
|
1704
|
-
|
|
1705
|
-
...
|
|
1706
|
-
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`
|
|
1707
1708
|
};
|
|
1708
1709
|
}, Y = (a) => {
|
|
1709
|
-
const u =
|
|
1710
|
+
const u = i.value[a];
|
|
1710
1711
|
return g.value && u.gantt !== void 0;
|
|
1711
|
-
}, _ = (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) => {
|
|
1712
1713
|
if (b.value) {
|
|
1713
|
-
const u = l.value[a] || {},
|
|
1714
|
+
const u = l.value[a] || {}, C = !(u.childrenOpen ?? f.value[a].childrenOpen);
|
|
1714
1715
|
l.value[a] = {
|
|
1715
1716
|
...u,
|
|
1716
|
-
childrenOpen:
|
|
1717
|
-
},
|
|
1718
|
-
} else if (
|
|
1717
|
+
childrenOpen: C
|
|
1718
|
+
}, C || ye(a);
|
|
1719
|
+
} else if (s.value.view === "list-expansion") {
|
|
1719
1720
|
const u = l.value[a] || {}, h = u.expanded ?? f.value[a].expanded;
|
|
1720
1721
|
l.value[a] = {
|
|
1721
1722
|
...u,
|
|
1722
1723
|
expanded: !h
|
|
1723
1724
|
};
|
|
1724
1725
|
}
|
|
1725
|
-
},
|
|
1726
|
-
for (let u = 0; u <
|
|
1726
|
+
}, ye = (a) => {
|
|
1727
|
+
for (let u = 0; u < i.value.length; u++)
|
|
1727
1728
|
if (f.value[u].parent === a) {
|
|
1728
1729
|
const h = l.value[u] || {};
|
|
1729
1730
|
l.value[u] = {
|
|
1730
1731
|
...h,
|
|
1731
1732
|
childrenOpen: !1
|
|
1732
|
-
},
|
|
1733
|
+
}, ye(u);
|
|
1733
1734
|
}
|
|
1734
1735
|
}, Oe = (a, u) => {
|
|
1735
|
-
const h =
|
|
1736
|
+
const h = M(a, u);
|
|
1736
1737
|
return be(a, u, h);
|
|
1737
1738
|
}, be = (a, u, h) => {
|
|
1738
|
-
const
|
|
1739
|
-
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;
|
|
1740
1741
|
};
|
|
1741
1742
|
return {
|
|
1742
1743
|
// state
|
|
1743
|
-
columns:
|
|
1744
|
-
config:
|
|
1745
|
-
connectionHandles:
|
|
1746
|
-
connectionPaths:
|
|
1744
|
+
columns: c,
|
|
1745
|
+
config: s,
|
|
1746
|
+
connectionHandles: E,
|
|
1747
|
+
connectionPaths: p,
|
|
1747
1748
|
display: f,
|
|
1748
1749
|
ganttBars: m,
|
|
1749
|
-
modal:
|
|
1750
|
-
rows:
|
|
1750
|
+
modal: w,
|
|
1751
|
+
rows: i,
|
|
1751
1752
|
table: d,
|
|
1752
|
-
updates:
|
|
1753
|
+
updates: y,
|
|
1753
1754
|
// getters
|
|
1754
1755
|
hasPinnedColumns: v,
|
|
1755
1756
|
isGanttView: g,
|
|
@@ -1759,17 +1760,17 @@ const Yn = { class: "gantt-connection-overlay" }, jn = {
|
|
|
1759
1760
|
zeroColumn: F,
|
|
1760
1761
|
// actions
|
|
1761
1762
|
closeModal: (a) => {
|
|
1762
|
-
a.target instanceof Node &&
|
|
1763
|
+
a.target instanceof Node && w.value.parent?.contains(a.target) || w.value.visible && (w.value.visible = !1);
|
|
1763
1764
|
},
|
|
1764
1765
|
createConnection: (a, u, h) => {
|
|
1765
|
-
const
|
|
1766
|
-
if (!
|
|
1766
|
+
const C = E.value.find((A) => A.id === a), H = E.value.find((A) => A.id === u);
|
|
1767
|
+
if (!C || !H)
|
|
1767
1768
|
return console.warn("Cannot create connection: handle not found"), null;
|
|
1768
1769
|
const k = {
|
|
1769
1770
|
id: `connection-${a}-${u}`,
|
|
1770
1771
|
from: {
|
|
1771
|
-
barId:
|
|
1772
|
-
side:
|
|
1772
|
+
barId: C.barId,
|
|
1773
|
+
side: C.side
|
|
1773
1774
|
},
|
|
1774
1775
|
to: {
|
|
1775
1776
|
barId: H.barId,
|
|
@@ -1778,44 +1779,44 @@ const Yn = { class: "gantt-connection-overlay" }, jn = {
|
|
|
1778
1779
|
style: h?.style,
|
|
1779
1780
|
label: h?.label
|
|
1780
1781
|
};
|
|
1781
|
-
return
|
|
1782
|
+
return p.value.push(k), k;
|
|
1782
1783
|
},
|
|
1783
1784
|
deleteConnection: (a) => {
|
|
1784
|
-
const u =
|
|
1785
|
-
return u >= 0 ? (
|
|
1785
|
+
const u = p.value.findIndex((h) => h.id === a);
|
|
1786
|
+
return u >= 0 ? (p.value.splice(u, 1), !0) : !1;
|
|
1786
1787
|
},
|
|
1787
|
-
getCellData:
|
|
1788
|
+
getCellData: M,
|
|
1788
1789
|
getCellDisplayValue: Oe,
|
|
1789
|
-
getConnectionsForBar: (a) =>
|
|
1790
|
+
getConnectionsForBar: (a) => p.value.filter((u) => u.from.barId === a || u.to.barId === a),
|
|
1790
1791
|
getFormattedValue: be,
|
|
1791
|
-
getHandlesForBar: (a) =>
|
|
1792
|
+
getHandlesForBar: (a) => E.value.filter((u) => u.barId === a),
|
|
1792
1793
|
getHeaderCellStyle: W,
|
|
1793
1794
|
getIndent: (a, u) => u && a === 0 && u > 0 ? `${u}ch` : "inherit",
|
|
1794
|
-
getRowExpandSymbol:
|
|
1795
|
+
getRowExpandSymbol: xe,
|
|
1795
1796
|
isRowGantt: Y,
|
|
1796
1797
|
isRowVisible: _,
|
|
1797
1798
|
registerConnectionHandle: (a) => {
|
|
1798
|
-
const u =
|
|
1799
|
-
u >= 0 ?
|
|
1799
|
+
const u = E.value.findIndex((h) => h.id === a.id);
|
|
1800
|
+
u >= 0 ? E.value[u] = a : E.value.push(a);
|
|
1800
1801
|
},
|
|
1801
1802
|
registerGanttBar: (a) => {
|
|
1802
1803
|
const u = m.value.findIndex((h) => h.id === a.id);
|
|
1803
1804
|
u >= 0 ? m.value[u] = a : m.value.push(a);
|
|
1804
1805
|
},
|
|
1805
1806
|
resizeColumn: O,
|
|
1806
|
-
setCellData:
|
|
1807
|
+
setCellData: x,
|
|
1807
1808
|
setCellText: X,
|
|
1808
1809
|
toggleRowExpand: ge,
|
|
1809
1810
|
unregisterConnectionHandle: (a) => {
|
|
1810
|
-
const u =
|
|
1811
|
-
u >= 0 &&
|
|
1811
|
+
const u = E.value.findIndex((h) => h.id === a);
|
|
1812
|
+
u >= 0 && E.value.splice(u, 1);
|
|
1812
1813
|
},
|
|
1813
1814
|
unregisterGanttBar: (a) => {
|
|
1814
1815
|
const u = m.value.findIndex((h) => h.id === a);
|
|
1815
1816
|
u >= 0 && m.value.splice(u, 1);
|
|
1816
1817
|
},
|
|
1817
1818
|
updateGanttBar: (a) => {
|
|
1818
|
-
const u =
|
|
1819
|
+
const u = i.value[a.rowIndex]?.gantt;
|
|
1819
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));
|
|
1820
1821
|
},
|
|
1821
1822
|
updateRows: $
|
|
@@ -1837,41 +1838,41 @@ const Yn = { class: "gantt-connection-overlay" }, jn = {
|
|
|
1837
1838
|
}),
|
|
1838
1839
|
emits: /* @__PURE__ */ at(["cellUpdate", "gantt:drag", "connection:event", "columns:update"], ["update:rows", "update:columns"]),
|
|
1839
1840
|
setup(e, { expose: t, emit: o }) {
|
|
1840
|
-
const
|
|
1841
|
-
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 }) => {
|
|
1842
1843
|
if (m === "setCellData" || m === "setCellText") {
|
|
1843
|
-
const [g, b, P] =
|
|
1844
|
+
const [g, b, P] = p, B = E.getCellData(g, b);
|
|
1844
1845
|
v(() => {
|
|
1845
|
-
|
|
1846
|
+
r.value = [...E.rows], i("cellUpdate", { colIndex: g, rowIndex: b, newValue: P, oldValue: B });
|
|
1846
1847
|
});
|
|
1847
1848
|
} else if (m === "updateGanttBar") {
|
|
1848
|
-
const [g] =
|
|
1849
|
+
const [g] = p;
|
|
1849
1850
|
let b = !1;
|
|
1850
1851
|
g.type === "resize" ? b = g.oldColspan !== g.newColspan : g.type === "bar" && (b = g.oldStart !== g.newStart || g.oldEnd !== g.newEnd), b && v(() => {
|
|
1851
|
-
|
|
1852
|
+
i("gantt:drag", g);
|
|
1852
1853
|
});
|
|
1853
1854
|
} else m === "resizeColumn" && v(() => {
|
|
1854
|
-
|
|
1855
|
+
c.value = [...E.columns], i("columns:update", [...E.columns]);
|
|
1855
1856
|
});
|
|
1856
1857
|
}), V(
|
|
1857
|
-
() =>
|
|
1858
|
+
() => r.value,
|
|
1858
1859
|
(m) => {
|
|
1859
1860
|
JSON.stringify(m) !== JSON.stringify(n.rows) && (n.rows = [...m]);
|
|
1860
1861
|
},
|
|
1861
1862
|
{ deep: !0 }
|
|
1862
1863
|
), V(
|
|
1863
|
-
|
|
1864
|
+
c,
|
|
1864
1865
|
(m) => {
|
|
1865
|
-
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]));
|
|
1866
1867
|
},
|
|
1867
1868
|
{ deep: !0 }
|
|
1868
1869
|
), re(() => {
|
|
1869
|
-
|
|
1870
|
+
c.value.some((m) => m.pinned) && (d(), n.isTreeView && kt(s, d, { childList: !0, subtree: !0 }));
|
|
1870
1871
|
});
|
|
1871
1872
|
const l = D(() => n.columns.filter((m) => m.pinned).length), d = () => {
|
|
1872
|
-
const m =
|
|
1873
|
+
const m = s.value, E = m?.rows[0], p = m?.rows[1], v = E ? Array.from(E.cells) : [];
|
|
1873
1874
|
for (const [g, b] of v.entries()) {
|
|
1874
|
-
const P =
|
|
1875
|
+
const P = p?.cells[g];
|
|
1875
1876
|
P && (b.style.width = `${P.offsetWidth}px`);
|
|
1876
1877
|
}
|
|
1877
1878
|
for (const g of m?.rows || []) {
|
|
@@ -1885,32 +1886,32 @@ const Yn = { class: "gantt-connection-overlay" }, jn = {
|
|
|
1885
1886
|
window.addEventListener("keydown", (m) => {
|
|
1886
1887
|
if (m.key === "Escape" && n.modal.visible) {
|
|
1887
1888
|
n.modal.visible = !1;
|
|
1888
|
-
const
|
|
1889
|
-
|
|
1890
|
-
|
|
1889
|
+
const E = n.modal.parent;
|
|
1890
|
+
E && Fe().then(() => {
|
|
1891
|
+
E.focus();
|
|
1891
1892
|
});
|
|
1892
1893
|
}
|
|
1893
1894
|
});
|
|
1894
1895
|
const f = (m) => {
|
|
1895
1896
|
if (!m.gantt || l.value === 0)
|
|
1896
1897
|
return n.columns;
|
|
1897
|
-
const
|
|
1898
|
-
for (let
|
|
1899
|
-
const v = { ...n.columns[
|
|
1900
|
-
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);
|
|
1901
1902
|
}
|
|
1902
|
-
return
|
|
1903
|
+
return E.push({
|
|
1903
1904
|
...n.columns[l.value],
|
|
1904
1905
|
isGantt: !0,
|
|
1905
1906
|
colspan: m.gantt?.colspan || n.columns.length - l.value,
|
|
1906
1907
|
originalIndex: l.value,
|
|
1907
1908
|
width: "auto"
|
|
1908
1909
|
// TODO: refactor to API that can detect when data exists in a cell. Might have be custom and not generalizable
|
|
1909
|
-
}),
|
|
1910
|
-
},
|
|
1911
|
-
|
|
1912
|
-
},
|
|
1913
|
-
|
|
1910
|
+
}), E;
|
|
1911
|
+
}, w = (m) => {
|
|
1912
|
+
i("connection:event", { type: "create", connection: m });
|
|
1913
|
+
}, y = (m) => {
|
|
1914
|
+
i("connection:event", { type: "delete", connection: m });
|
|
1914
1915
|
};
|
|
1915
1916
|
return t({
|
|
1916
1917
|
store: n,
|
|
@@ -1918,7 +1919,7 @@ const Yn = { class: "gantt-connection-overlay" }, jn = {
|
|
|
1918
1919
|
deleteConnection: n.deleteConnection,
|
|
1919
1920
|
getConnectionsForBar: n.getConnectionsForBar,
|
|
1920
1921
|
getHandlesForBar: n.getHandlesForBar
|
|
1921
|
-
}), (m,
|
|
1922
|
+
}), (m, E) => (T(), L("div", no, [
|
|
1922
1923
|
Me((T(), L("table", {
|
|
1923
1924
|
ref: "table",
|
|
1924
1925
|
class: "atable",
|
|
@@ -1934,23 +1935,23 @@ const Yn = { class: "gantt-connection-overlay" }, jn = {
|
|
|
1934
1935
|
], !0),
|
|
1935
1936
|
N("tbody", null, [
|
|
1936
1937
|
j(m.$slots, "body", { data: R(n) }, () => [
|
|
1937
|
-
(T(!0), L(ae, null,
|
|
1938
|
-
key:
|
|
1939
|
-
row:
|
|
1938
|
+
(T(!0), L(ae, null, we(R(n).rows, (p, v) => (T(), ce($t, {
|
|
1939
|
+
key: p.id,
|
|
1940
|
+
row: p,
|
|
1940
1941
|
rowIndex: v,
|
|
1941
1942
|
store: R(n)
|
|
1942
1943
|
}, {
|
|
1943
1944
|
default: it(() => [
|
|
1944
|
-
(T(!0), L(ae, null,
|
|
1945
|
+
(T(!0), L(ae, null, we(f(p), (g, b) => (T(), L(ae, {
|
|
1945
1946
|
key: g.name
|
|
1946
1947
|
}, [
|
|
1947
1948
|
g.isGantt ? (T(), ce(ke(g.ganttComponent || "AGanttCell"), {
|
|
1948
1949
|
key: 0,
|
|
1949
1950
|
store: R(n),
|
|
1950
1951
|
columnsCount: R(n).columns.length - l.value,
|
|
1951
|
-
color:
|
|
1952
|
-
start:
|
|
1953
|
-
end:
|
|
1952
|
+
color: p.gantt?.color,
|
|
1953
|
+
start: p.gantt?.startIndex,
|
|
1954
|
+
end: p.gantt?.endIndex,
|
|
1954
1955
|
colspan: g.colspan,
|
|
1955
1956
|
pinned: g.pinned,
|
|
1956
1957
|
rowIndex: v,
|
|
@@ -1960,7 +1961,7 @@ const Yn = { class: "gantt-connection-overlay" }, jn = {
|
|
|
1960
1961
|
minWidth: g?.width || "40ch",
|
|
1961
1962
|
width: R(n).config.fullWidth ? "auto" : null
|
|
1962
1963
|
}),
|
|
1963
|
-
"onConnection:create":
|
|
1964
|
+
"onConnection:create": w
|
|
1964
1965
|
}, null, 40, ["store", "columnsCount", "color", "start", "end", "colspan", "pinned", "rowIndex", "colIndex", "style"])) : (T(), ce(ke(g.cellComponent || "ACell"), {
|
|
1965
1966
|
key: 1,
|
|
1966
1967
|
store: R(n),
|
|
@@ -2001,7 +2002,7 @@ const Yn = { class: "gantt-connection-overlay" }, jn = {
|
|
|
2001
2002
|
R(n).isGanttView && R(n).isDependencyGraphEnabled ? (T(), ce(Qn, {
|
|
2002
2003
|
key: 0,
|
|
2003
2004
|
store: R(n),
|
|
2004
|
-
"onConnection:delete":
|
|
2005
|
+
"onConnection:delete": y
|
|
2005
2006
|
}, null, 8, ["store"])) : J("", !0)
|
|
2006
2007
|
]));
|
|
2007
2008
|
}
|
|
@@ -2024,7 +2025,7 @@ function mo(e, t) {
|
|
|
2024
2025
|
]);
|
|
2025
2026
|
}
|
|
2026
2027
|
const go = /* @__PURE__ */ ie(uo, [["render", mo], ["__scopeId", "data-v-e1165876"]]);
|
|
2027
|
-
function
|
|
2028
|
+
function po(e) {
|
|
2028
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);
|
|
2029
2030
|
}
|
|
2030
2031
|
export {
|
|
@@ -2038,6 +2039,6 @@ export {
|
|
|
2038
2039
|
go as ATableLoadingBar,
|
|
2039
2040
|
Mt as ATableModal,
|
|
2040
2041
|
to as createTableStore,
|
|
2041
|
-
|
|
2042
|
+
po as install
|
|
2042
2043
|
};
|
|
2043
2044
|
//# sourceMappingURL=atable.js.map
|