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