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