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