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