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