@stonecrop/atable 0.13.12 → 0.13.14
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 +209 -13
- package/dist/atable.js +1040 -1021
- package/dist/atable.js.map +1 -1
- package/dist/src/icons/index.d.ts +2 -1
- package/dist/src/icons/index.d.ts.map +1 -1
- package/dist/src/icons/index.js +3 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/stores/table.d.ts +168 -0
- package/dist/src/stores/table.d.ts.map +1 -1
- package/dist/src/types/index.d.ts +37 -13
- package/dist/src/types/index.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/components/AGanttCell.vue +9 -11
- package/src/components/ARow.vue +27 -4
- package/src/components/ARowActions.vue +11 -10
- package/src/components/ATable.vue +19 -2
- package/src/icons/index.ts +3 -1
- package/src/icons/stonecrop-ui-icon-open.svg +5 -0
- package/src/index.ts +10 -1
- package/src/types/index.ts +39 -13
package/dist/atable.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { onMounted as Ae, ref as z, watch as ue, onBeforeUnmount as Pt, computed as
|
|
1
|
+
import { onMounted as Ae, ref as z, watch as ue, onBeforeUnmount as Pt, computed as $, shallowRef as re, toValue as H, watchEffect as Zt, getCurrentScope as $t, onScopeDispose as Tt, getCurrentInstance as lt, unref as B, nextTick as at, isRef as Nt, toRefs as Ft, customRef as It, toRef as Wt, readonly as zt, defineComponent as xe, useTemplateRef as ce, openBlock as y, createElementBlock as k, normalizeClass as ae, normalizeStyle as pe, createBlock as he, resolveDynamicComponent as Ne, mergeProps as st, toDisplayString as be, Fragment as me, createElementVNode as F, renderSlot as fe, createCommentVNode as ee, useCssVars as Xt, onUnmounted as Gt, withModifiers as Se, withDirectives as de, renderList as Ce, vShow as it, reactive as jt, vModelText as Ze, vModelCheckbox as Yt, vModelSelect as Ut, createTextVNode as Jt, useModel as wt, inject as qt, createVNode as pt, withCtx as xt, mergeModels as yt } from "vue";
|
|
2
2
|
import { defineStore as Qt } from "pinia";
|
|
3
3
|
import './assets/index.css';function St(e, t) {
|
|
4
|
-
return $t() ? (
|
|
4
|
+
return $t() ? (Tt(e, t), !0) : !1;
|
|
5
5
|
}
|
|
6
6
|
const Kt = typeof window < "u" && typeof document < "u";
|
|
7
7
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
@@ -19,27 +19,27 @@ function on(e, t, n) {
|
|
|
19
19
|
const De = Kt ? window : void 0;
|
|
20
20
|
function Le(e) {
|
|
21
21
|
var t;
|
|
22
|
-
const n =
|
|
22
|
+
const n = H(e);
|
|
23
23
|
return (t = n?.$el) !== null && t !== void 0 ? t : n;
|
|
24
24
|
}
|
|
25
25
|
function Fe(...e) {
|
|
26
|
-
const t = (l, u, a, o) => (l.addEventListener(u, a, o), () => l.removeEventListener(u, a, o)), n =
|
|
27
|
-
const l = je(
|
|
26
|
+
const t = (l, u, a, o) => (l.addEventListener(u, a, o), () => l.removeEventListener(u, a, o)), n = $(() => {
|
|
27
|
+
const l = je(H(e[0])).filter((u) => u != null);
|
|
28
28
|
return l.every((u) => typeof u != "string") ? l : void 0;
|
|
29
29
|
});
|
|
30
30
|
return on(() => {
|
|
31
31
|
var l, u;
|
|
32
32
|
return [
|
|
33
33
|
(l = (u = n.value) === null || u === void 0 ? void 0 : u.map((a) => Le(a))) !== null && l !== void 0 ? l : [De].filter((a) => a != null),
|
|
34
|
-
je(
|
|
35
|
-
je(
|
|
36
|
-
|
|
34
|
+
je(H(n.value ? e[1] : e[0])),
|
|
35
|
+
je(B(n.value ? e[2] : e[1])),
|
|
36
|
+
H(n.value ? e[3] : e[2])
|
|
37
37
|
];
|
|
38
|
-
}, ([l, u, a, o],
|
|
38
|
+
}, ([l, u, a, o], r, c) => {
|
|
39
39
|
if (!l?.length || !u?.length || !a?.length) return;
|
|
40
|
-
const s = tn(o) ? { ...o } : o,
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
const s = tn(o) ? { ...o } : o, f = l.flatMap((v) => u.flatMap((x) => a.map((I) => t(v, x, I, s))));
|
|
41
|
+
c(() => {
|
|
42
|
+
f.forEach((v) => v());
|
|
43
43
|
});
|
|
44
44
|
}, { flush: "post" });
|
|
45
45
|
}
|
|
@@ -53,27 +53,27 @@ function ln() {
|
|
|
53
53
|
// @__NO_SIDE_EFFECTS__
|
|
54
54
|
function an(e) {
|
|
55
55
|
const t = /* @__PURE__ */ ln();
|
|
56
|
-
return
|
|
56
|
+
return $(() => (t.value, !!e()));
|
|
57
57
|
}
|
|
58
58
|
function sn(e, t, n = {}) {
|
|
59
59
|
const { window: l = De, ...u } = n;
|
|
60
60
|
let a;
|
|
61
|
-
const o = /* @__PURE__ */ an(() => l && "MutationObserver" in l),
|
|
61
|
+
const o = /* @__PURE__ */ an(() => l && "MutationObserver" in l), r = () => {
|
|
62
62
|
a && (a.disconnect(), a = void 0);
|
|
63
|
-
},
|
|
64
|
-
const v = je(
|
|
63
|
+
}, c = ue($(() => {
|
|
64
|
+
const v = je(H(e)).map(Le).filter(_t);
|
|
65
65
|
return new Set(v);
|
|
66
66
|
}), (v) => {
|
|
67
|
-
|
|
67
|
+
r(), o.value && v.size && (a = new MutationObserver(t), v.forEach((x) => a.observe(x, u)));
|
|
68
68
|
}, {
|
|
69
69
|
immediate: !0,
|
|
70
70
|
flush: "post"
|
|
71
|
-
}), s = () => a?.takeRecords(),
|
|
72
|
-
|
|
71
|
+
}), s = () => a?.takeRecords(), f = () => {
|
|
72
|
+
c(), r();
|
|
73
73
|
};
|
|
74
|
-
return St(
|
|
74
|
+
return St(f), {
|
|
75
75
|
isSupported: o,
|
|
76
|
-
stop:
|
|
76
|
+
stop: f,
|
|
77
77
|
takeRecords: s
|
|
78
78
|
};
|
|
79
79
|
}
|
|
@@ -81,22 +81,22 @@ function rn(e, t, n = {}) {
|
|
|
81
81
|
const { window: l = De, document: u = l?.document, flush: a = "sync" } = n;
|
|
82
82
|
if (!l || !u) return nn;
|
|
83
83
|
let o;
|
|
84
|
-
const
|
|
85
|
-
o?.(), o =
|
|
86
|
-
},
|
|
87
|
-
const
|
|
88
|
-
if (
|
|
89
|
-
const { stop: v } = sn(u, (
|
|
90
|
-
|
|
84
|
+
const r = (f) => {
|
|
85
|
+
o?.(), o = f;
|
|
86
|
+
}, c = Zt(() => {
|
|
87
|
+
const f = Le(e);
|
|
88
|
+
if (f) {
|
|
89
|
+
const { stop: v } = sn(u, (x) => {
|
|
90
|
+
x.map((I) => [...I.removedNodes]).flat().some((I) => I === f || I.contains(f)) && t(x);
|
|
91
91
|
}, {
|
|
92
92
|
window: l,
|
|
93
93
|
childList: !0,
|
|
94
94
|
subtree: !0
|
|
95
95
|
});
|
|
96
|
-
|
|
96
|
+
r(v);
|
|
97
97
|
}
|
|
98
98
|
}, { flush: a }), s = () => {
|
|
99
|
-
|
|
99
|
+
c(), r();
|
|
100
100
|
};
|
|
101
101
|
return St(s), s;
|
|
102
102
|
}
|
|
@@ -106,30 +106,30 @@ function cn(e = {}) {
|
|
|
106
106
|
const { window: n = De, deep: l = !0, triggerOnRemoval: u = !1 } = e, a = (t = e.document) !== null && t !== void 0 ? t : n?.document, o = () => {
|
|
107
107
|
let s = a?.activeElement;
|
|
108
108
|
if (l)
|
|
109
|
-
for (var
|
|
109
|
+
for (var f; s?.shadowRoot; ) s = s == null || (f = s.shadowRoot) === null || f === void 0 ? void 0 : f.activeElement;
|
|
110
110
|
return s;
|
|
111
|
-
},
|
|
112
|
-
|
|
111
|
+
}, r = re(), c = () => {
|
|
112
|
+
r.value = o();
|
|
113
113
|
};
|
|
114
114
|
if (n) {
|
|
115
115
|
const s = {
|
|
116
116
|
capture: !0,
|
|
117
117
|
passive: !0
|
|
118
118
|
};
|
|
119
|
-
Fe(n, "blur", (
|
|
120
|
-
|
|
121
|
-
}, s), Fe(n, "focus",
|
|
119
|
+
Fe(n, "blur", (f) => {
|
|
120
|
+
f.relatedTarget === null && c();
|
|
121
|
+
}, s), Fe(n, "focus", c, s);
|
|
122
122
|
}
|
|
123
|
-
return u && rn(
|
|
123
|
+
return u && rn(r, c, { document: a }), c(), r;
|
|
124
124
|
}
|
|
125
125
|
const un = "focusin", dn = "focusout", fn = ":focus-within";
|
|
126
126
|
function vn(e, t = {}) {
|
|
127
|
-
const { window: n = De } = t, l =
|
|
127
|
+
const { window: n = De } = t, l = $(() => Le(e)), u = re(!1), a = $(() => u.value);
|
|
128
128
|
if (!n || !(/* @__PURE__ */ cn(t)).value) return { focused: a };
|
|
129
129
|
const o = { passive: !0 };
|
|
130
130
|
return Fe(l, un, () => u.value = !0, o), Fe(l, dn, () => {
|
|
131
|
-
var
|
|
132
|
-
return u.value = (
|
|
131
|
+
var r, c, s;
|
|
132
|
+
return u.value = (r = (c = l.value) === null || c === void 0 || (s = c.matches) === null || s === void 0 ? void 0 : s.call(c, fn)) !== null && r !== void 0 ? r : !1;
|
|
133
133
|
}, o), { focused: a };
|
|
134
134
|
}
|
|
135
135
|
function hn(e, { window: t = De, scrollTarget: n } = {}) {
|
|
@@ -139,8 +139,8 @@ function hn(e, { window: t = De, scrollTarget: n } = {}) {
|
|
|
139
139
|
if (!o)
|
|
140
140
|
l.value = !1;
|
|
141
141
|
else {
|
|
142
|
-
const
|
|
143
|
-
l.value =
|
|
142
|
+
const r = o.getBoundingClientRect();
|
|
143
|
+
l.value = r.top <= (t.innerHeight || a.documentElement.clientHeight) && r.left <= (t.innerWidth || a.documentElement.clientWidth) && r.bottom >= 0 && r.right >= 0;
|
|
144
144
|
}
|
|
145
145
|
};
|
|
146
146
|
return ue(
|
|
@@ -152,10 +152,10 @@ function hn(e, { window: t = De, scrollTarget: n } = {}) {
|
|
|
152
152
|
passive: !0
|
|
153
153
|
}), l;
|
|
154
154
|
}
|
|
155
|
-
const
|
|
155
|
+
const ke = (e) => {
|
|
156
156
|
let t = hn(e).value;
|
|
157
157
|
return t = t && e.offsetHeight > 0, t;
|
|
158
|
-
},
|
|
158
|
+
}, Me = (e) => e.tabIndex >= 0, bt = (e) => {
|
|
159
159
|
if (e.target instanceof HTMLElement)
|
|
160
160
|
return rt(e.target);
|
|
161
161
|
}, rt = (e) => {
|
|
@@ -170,7 +170,7 @@ const Me = (e) => {
|
|
|
170
170
|
const n = e.previousElementSibling;
|
|
171
171
|
n instanceof HTMLTableRowElement && (t = n);
|
|
172
172
|
}
|
|
173
|
-
return t && (!
|
|
173
|
+
return t && (!Me(t) || !ke(t)) ? rt(t) : t;
|
|
174
174
|
}, mn = (e) => {
|
|
175
175
|
if (!(e.target instanceof HTMLElement)) return;
|
|
176
176
|
const t = e.target;
|
|
@@ -188,7 +188,7 @@ const Me = (e) => {
|
|
|
188
188
|
u instanceof HTMLTableRowElement && (n = u);
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
|
-
return n && (!
|
|
191
|
+
return n && (!Me(n) || !ke(n)) ? ct(n) : n;
|
|
192
192
|
}, Ct = (e) => {
|
|
193
193
|
if (e.target instanceof HTMLElement)
|
|
194
194
|
return ct(e.target);
|
|
@@ -204,7 +204,7 @@ const Me = (e) => {
|
|
|
204
204
|
const n = e.nextElementSibling;
|
|
205
205
|
n instanceof HTMLTableRowElement && (t = n);
|
|
206
206
|
}
|
|
207
|
-
return t && (!
|
|
207
|
+
return t && (!Me(t) || !ke(t)) ? ct(t) : t;
|
|
208
208
|
}, gn = (e) => {
|
|
209
209
|
if (!(e.target instanceof HTMLElement)) return;
|
|
210
210
|
const t = e.target;
|
|
@@ -222,8 +222,8 @@ const Me = (e) => {
|
|
|
222
222
|
u instanceof HTMLTableRowElement && (n = u);
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
|
-
return n && (!
|
|
226
|
-
},
|
|
225
|
+
return n && (!Me(n) || !ke(n)) ? rt(n) : n;
|
|
226
|
+
}, kt = (e) => {
|
|
227
227
|
if (e.target instanceof HTMLElement)
|
|
228
228
|
return ut(e.target);
|
|
229
229
|
}, ut = (e) => {
|
|
@@ -235,8 +235,8 @@ const Me = (e) => {
|
|
|
235
235
|
const l = e.parentElement?.previousElementSibling?.lastElementChild;
|
|
236
236
|
l instanceof HTMLElement && (t = l);
|
|
237
237
|
}
|
|
238
|
-
return t && (!
|
|
239
|
-
},
|
|
238
|
+
return t && (!Me(t) || !ke(t)) ? ut(t) : t;
|
|
239
|
+
}, Mt = (e) => {
|
|
240
240
|
if (e.target instanceof HTMLElement)
|
|
241
241
|
return dt(e.target);
|
|
242
242
|
}, dt = (e) => {
|
|
@@ -248,15 +248,15 @@ const Me = (e) => {
|
|
|
248
248
|
const l = e.parentElement?.nextElementSibling?.firstElementChild;
|
|
249
249
|
l instanceof HTMLElement && (t = l);
|
|
250
250
|
}
|
|
251
|
-
return t && (!
|
|
251
|
+
return t && (!Me(t) || !ke(t)) ? dt(t) : t;
|
|
252
252
|
}, Rt = (e) => {
|
|
253
253
|
if (!(e.target instanceof HTMLElement)) return;
|
|
254
254
|
const t = e.target.parentElement?.firstElementChild, n = t instanceof HTMLElement ? t : null;
|
|
255
|
-
return n && (!
|
|
255
|
+
return n && (!Me(n) || !ke(n)) ? dt(n) : n;
|
|
256
256
|
}, Et = (e) => {
|
|
257
257
|
if (!(e.target instanceof HTMLElement)) return;
|
|
258
258
|
const t = e.target.parentElement?.lastElementChild, n = t instanceof HTMLElement ? t : null;
|
|
259
|
-
return n && (!
|
|
259
|
+
return n && (!Me(n) || !ke(n)) ? ut(n) : n;
|
|
260
260
|
}, ze = ["alt", "control", "shift", "meta"], wn = {
|
|
261
261
|
ArrowUp: "up",
|
|
262
262
|
ArrowDown: "down",
|
|
@@ -272,11 +272,11 @@ const Me = (e) => {
|
|
|
272
272
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
273
273
|
},
|
|
274
274
|
"keydown.left": (e) => {
|
|
275
|
-
const t =
|
|
275
|
+
const t = kt(e);
|
|
276
276
|
e.preventDefault(), e.stopPropagation(), t && t.focus();
|
|
277
277
|
},
|
|
278
278
|
"keydown.right": (e) => {
|
|
279
|
-
const t =
|
|
279
|
+
const t = Mt(e);
|
|
280
280
|
e.preventDefault(), e.stopPropagation(), t && t.focus();
|
|
281
281
|
},
|
|
282
282
|
"keydown.control.up": (e) => {
|
|
@@ -318,11 +318,11 @@ const Me = (e) => {
|
|
|
318
318
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
319
319
|
},
|
|
320
320
|
"keydown.tab": (e) => {
|
|
321
|
-
const t =
|
|
321
|
+
const t = Mt(e);
|
|
322
322
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
323
323
|
},
|
|
324
324
|
"keydown.shift.tab": (e) => {
|
|
325
|
-
const t =
|
|
325
|
+
const t = kt(e);
|
|
326
326
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
327
327
|
}
|
|
328
328
|
};
|
|
@@ -333,57 +333,57 @@ function Ke(e) {
|
|
|
333
333
|
function ft(e) {
|
|
334
334
|
const t = (a) => {
|
|
335
335
|
const o = Ke(a);
|
|
336
|
-
let
|
|
336
|
+
let r = [];
|
|
337
337
|
if (typeof a.selectors == "string")
|
|
338
|
-
|
|
338
|
+
r = Array.from(o ? o.querySelectorAll(a.selectors) : document.querySelectorAll(a.selectors));
|
|
339
339
|
else if (Array.isArray(a.selectors))
|
|
340
|
-
for (const
|
|
341
|
-
|
|
340
|
+
for (const c of a.selectors)
|
|
341
|
+
c instanceof HTMLElement ? r.push(c) : r.push(c.$el);
|
|
342
342
|
else if (a.selectors instanceof HTMLElement)
|
|
343
|
-
|
|
343
|
+
r.push(a.selectors);
|
|
344
344
|
else if (a.selectors?.value)
|
|
345
345
|
if (Array.isArray(a.selectors.value))
|
|
346
|
-
for (const
|
|
347
|
-
|
|
346
|
+
for (const c of a.selectors.value)
|
|
347
|
+
c instanceof HTMLElement ? r.push(c) : r.push(c.$el);
|
|
348
348
|
else
|
|
349
|
-
|
|
350
|
-
return
|
|
349
|
+
r.push(a.selectors.value);
|
|
350
|
+
return r;
|
|
351
351
|
}, n = (a) => {
|
|
352
352
|
const o = Ke(a);
|
|
353
|
-
let
|
|
354
|
-
return a.selectors ?
|
|
353
|
+
let r = [];
|
|
354
|
+
return a.selectors ? r = t(a) : o && (r = Array.from(o.children).filter((c) => c instanceof HTMLElement).filter((c) => Me(c) && ke(c))), r;
|
|
355
355
|
}, l = (a) => (o) => {
|
|
356
|
-
const
|
|
357
|
-
if (ze.includes(
|
|
358
|
-
const
|
|
359
|
-
for (const s of Object.keys(
|
|
360
|
-
const [
|
|
361
|
-
if (
|
|
362
|
-
const
|
|
363
|
-
const
|
|
364
|
-
return o.getModifierState(
|
|
356
|
+
const r = wn[o.key] || o.key.toLowerCase();
|
|
357
|
+
if (ze.includes(r)) return;
|
|
358
|
+
const c = a.handlers || qe;
|
|
359
|
+
for (const s of Object.keys(c)) {
|
|
360
|
+
const [f, ...v] = s.split(".");
|
|
361
|
+
if (f === "keydown" && v.includes(r)) {
|
|
362
|
+
const x = c[s], I = v.filter((R) => ze.includes(R)), P = ze.some((R) => {
|
|
363
|
+
const w = R.charAt(0).toUpperCase() + R.slice(1);
|
|
364
|
+
return o.getModifierState(w);
|
|
365
365
|
});
|
|
366
|
-
if (
|
|
367
|
-
if (
|
|
368
|
-
for (const
|
|
369
|
-
if (v.includes(
|
|
370
|
-
const
|
|
371
|
-
o.getModifierState(
|
|
366
|
+
if (I.length > 0) {
|
|
367
|
+
if (P) {
|
|
368
|
+
for (const R of ze)
|
|
369
|
+
if (v.includes(R)) {
|
|
370
|
+
const w = R.charAt(0).toUpperCase() + R.slice(1);
|
|
371
|
+
o.getModifierState(w) && x(o);
|
|
372
372
|
}
|
|
373
373
|
}
|
|
374
374
|
} else
|
|
375
|
-
|
|
375
|
+
P || x(o);
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
378
|
}, u = [];
|
|
379
379
|
Ae(() => {
|
|
380
380
|
for (const a of e) {
|
|
381
|
-
const o = Ke(a),
|
|
382
|
-
for (const
|
|
383
|
-
const { focused: v } = vn(z(
|
|
384
|
-
|
|
381
|
+
const o = Ke(a), r = n(a), c = l(a), s = o ? [o] : r;
|
|
382
|
+
for (const f of s) {
|
|
383
|
+
const { focused: v } = vn(z(f)), x = ue(v, (I) => {
|
|
384
|
+
I ? f.addEventListener("keydown", c) : f.removeEventListener("keydown", c);
|
|
385
385
|
});
|
|
386
|
-
u.push(
|
|
386
|
+
u.push(x);
|
|
387
387
|
}
|
|
388
388
|
}
|
|
389
389
|
}), Pt(() => {
|
|
@@ -392,18 +392,18 @@ function ft(e) {
|
|
|
392
392
|
});
|
|
393
393
|
}
|
|
394
394
|
function vt(e, t) {
|
|
395
|
-
return $t() ? (
|
|
395
|
+
return $t() ? (Tt(e, t), !0) : !1;
|
|
396
396
|
}
|
|
397
397
|
const At = typeof window < "u" && typeof document < "u";
|
|
398
398
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
399
|
-
const pn = (e) => e != null, xn = Object.prototype.toString, yn = (e) => xn.call(e) === "[object Object]",
|
|
399
|
+
const pn = (e) => e != null, xn = Object.prototype.toString, yn = (e) => xn.call(e) === "[object Object]", Ie = () => {
|
|
400
400
|
};
|
|
401
401
|
function bn(...e) {
|
|
402
402
|
if (e.length !== 1) return Wt(...e);
|
|
403
403
|
const t = e[0];
|
|
404
|
-
return typeof t == "function" ? zt(
|
|
404
|
+
return typeof t == "function" ? zt(It(() => ({
|
|
405
405
|
get: t,
|
|
406
|
-
set:
|
|
406
|
+
set: Ie
|
|
407
407
|
}))) : z(t);
|
|
408
408
|
}
|
|
409
409
|
function Cn(e, t) {
|
|
@@ -418,19 +418,19 @@ function Cn(e, t) {
|
|
|
418
418
|
}
|
|
419
419
|
return n;
|
|
420
420
|
}
|
|
421
|
-
function
|
|
422
|
-
let n, l, u =
|
|
423
|
-
const a = (
|
|
424
|
-
clearTimeout(
|
|
421
|
+
function kn(e, t = {}) {
|
|
422
|
+
let n, l, u = Ie;
|
|
423
|
+
const a = (c) => {
|
|
424
|
+
clearTimeout(c), u(), u = Ie;
|
|
425
425
|
};
|
|
426
426
|
let o;
|
|
427
|
-
return (
|
|
428
|
-
const s =
|
|
429
|
-
return n && a(n), s <= 0 ||
|
|
430
|
-
u = t.rejectOnCancel ?
|
|
427
|
+
return (c) => {
|
|
428
|
+
const s = H(e), f = H(t.maxWait);
|
|
429
|
+
return n && a(n), s <= 0 || f !== void 0 && f <= 0 ? (l && (a(l), l = void 0), Promise.resolve(c())) : new Promise((v, x) => {
|
|
430
|
+
u = t.rejectOnCancel ? x : v, o = c, f && !l && (l = setTimeout(() => {
|
|
431
431
|
n && a(n), l = void 0, v(o());
|
|
432
|
-
},
|
|
433
|
-
l && a(l), l = void 0, v(
|
|
432
|
+
}, f)), n = setTimeout(() => {
|
|
433
|
+
l && a(l), l = void 0, v(c());
|
|
434
434
|
}, s);
|
|
435
435
|
});
|
|
436
436
|
};
|
|
@@ -438,23 +438,23 @@ function Mn(e, t = {}) {
|
|
|
438
438
|
function Ye(e) {
|
|
439
439
|
return Array.isArray(e) ? e : [e];
|
|
440
440
|
}
|
|
441
|
-
function
|
|
441
|
+
function Mn(e) {
|
|
442
442
|
return lt();
|
|
443
443
|
}
|
|
444
444
|
// @__NO_SIDE_EFFECTS__
|
|
445
445
|
function Rn(e, t = 200, n = {}) {
|
|
446
|
-
return Cn(
|
|
446
|
+
return Cn(kn(t, n), e);
|
|
447
447
|
}
|
|
448
448
|
function En(e, t = {}) {
|
|
449
449
|
if (!Nt(e)) return Ft(e);
|
|
450
450
|
const n = Array.isArray(e.value) ? Array.from({ length: e.value.length }) : {};
|
|
451
|
-
for (const l in e.value) n[l] =
|
|
451
|
+
for (const l in e.value) n[l] = It(() => ({
|
|
452
452
|
get() {
|
|
453
453
|
return e.value[l];
|
|
454
454
|
},
|
|
455
455
|
set(u) {
|
|
456
456
|
var a;
|
|
457
|
-
if (!((a =
|
|
457
|
+
if (!((a = H(t.replaceRef)) !== null && a !== void 0) || a) if (Array.isArray(e.value)) {
|
|
458
458
|
const o = [...e.value];
|
|
459
459
|
o[l] = u, e.value = o;
|
|
460
460
|
} else {
|
|
@@ -470,9 +470,9 @@ function En(e, t = {}) {
|
|
|
470
470
|
return n;
|
|
471
471
|
}
|
|
472
472
|
function $n(e, t = !0, n) {
|
|
473
|
-
|
|
473
|
+
Mn() ? Ae(e, n) : t ? e() : at(e);
|
|
474
474
|
}
|
|
475
|
-
function
|
|
475
|
+
function Tn(e, t, n) {
|
|
476
476
|
return ue(e, t, {
|
|
477
477
|
...n,
|
|
478
478
|
immediate: !0
|
|
@@ -481,97 +481,97 @@ function In(e, t, n) {
|
|
|
481
481
|
const We = At ? window : void 0;
|
|
482
482
|
function we(e) {
|
|
483
483
|
var t;
|
|
484
|
-
const n =
|
|
484
|
+
const n = H(e);
|
|
485
485
|
return (t = n?.$el) !== null && t !== void 0 ? t : n;
|
|
486
486
|
}
|
|
487
487
|
function Ee(...e) {
|
|
488
|
-
const t = (l, u, a, o) => (l.addEventListener(u, a, o), () => l.removeEventListener(u, a, o)), n =
|
|
489
|
-
const l = Ye(
|
|
488
|
+
const t = (l, u, a, o) => (l.addEventListener(u, a, o), () => l.removeEventListener(u, a, o)), n = $(() => {
|
|
489
|
+
const l = Ye(H(e[0])).filter((u) => u != null);
|
|
490
490
|
return l.every((u) => typeof u != "string") ? l : void 0;
|
|
491
491
|
});
|
|
492
|
-
return
|
|
492
|
+
return Tn(() => {
|
|
493
493
|
var l, u;
|
|
494
494
|
return [
|
|
495
495
|
(l = (u = n.value) === null || u === void 0 ? void 0 : u.map((a) => we(a))) !== null && l !== void 0 ? l : [We].filter((a) => a != null),
|
|
496
|
-
Ye(
|
|
497
|
-
Ye(
|
|
498
|
-
|
|
496
|
+
Ye(H(n.value ? e[1] : e[0])),
|
|
497
|
+
Ye(B(n.value ? e[2] : e[1])),
|
|
498
|
+
H(n.value ? e[3] : e[2])
|
|
499
499
|
];
|
|
500
|
-
}, ([l, u, a, o],
|
|
500
|
+
}, ([l, u, a, o], r, c) => {
|
|
501
501
|
if (!l?.length || !u?.length || !a?.length) return;
|
|
502
|
-
const s = yn(o) ? { ...o } : o,
|
|
503
|
-
|
|
504
|
-
|
|
502
|
+
const s = yn(o) ? { ...o } : o, f = l.flatMap((v) => u.flatMap((x) => a.map((I) => t(v, x, I, s))));
|
|
503
|
+
c(() => {
|
|
504
|
+
f.forEach((v) => v());
|
|
505
505
|
});
|
|
506
506
|
}, { flush: "post" });
|
|
507
507
|
}
|
|
508
508
|
function ot(e, t, n = {}) {
|
|
509
|
-
const { window: l = We, ignore: u = [], capture: a = !0, detectIframe: o = !1, controls:
|
|
510
|
-
if (!l) return
|
|
511
|
-
stop:
|
|
512
|
-
cancel:
|
|
513
|
-
trigger:
|
|
514
|
-
} :
|
|
515
|
-
let
|
|
516
|
-
const s = (
|
|
517
|
-
if (typeof
|
|
509
|
+
const { window: l = We, ignore: u = [], capture: a = !0, detectIframe: o = !1, controls: r = !1 } = n;
|
|
510
|
+
if (!l) return r ? {
|
|
511
|
+
stop: Ie,
|
|
512
|
+
cancel: Ie,
|
|
513
|
+
trigger: Ie
|
|
514
|
+
} : Ie;
|
|
515
|
+
let c = !0;
|
|
516
|
+
const s = (w) => H(u).some((h) => {
|
|
517
|
+
if (typeof h == "string") return Array.from(l.document.querySelectorAll(h)).some((m) => m === w.target || w.composedPath().includes(m));
|
|
518
518
|
{
|
|
519
|
-
const
|
|
520
|
-
return
|
|
519
|
+
const m = we(h);
|
|
520
|
+
return m && (w.target === m || w.composedPath().includes(m));
|
|
521
521
|
}
|
|
522
522
|
});
|
|
523
|
-
function
|
|
524
|
-
const
|
|
525
|
-
return
|
|
523
|
+
function f(w) {
|
|
524
|
+
const h = H(w);
|
|
525
|
+
return h && h.$.subTree.shapeFlag === 16;
|
|
526
526
|
}
|
|
527
|
-
function v(
|
|
528
|
-
const
|
|
529
|
-
return
|
|
527
|
+
function v(w, h) {
|
|
528
|
+
const m = H(w), C = m.$.subTree && m.$.subTree.children;
|
|
529
|
+
return C == null || !Array.isArray(C) ? !1 : C.some((b) => b.el === h.target || h.composedPath().includes(b.el));
|
|
530
530
|
}
|
|
531
|
-
const
|
|
532
|
-
const
|
|
533
|
-
if (
|
|
534
|
-
if ("detail" in
|
|
535
|
-
|
|
531
|
+
const x = (w) => {
|
|
532
|
+
const h = we(e);
|
|
533
|
+
if (w.target != null && !(!(h instanceof Element) && f(e) && v(e, w)) && !(!h || h === w.target || w.composedPath().includes(h))) {
|
|
534
|
+
if ("detail" in w && w.detail === 0 && (c = !s(w)), !c) {
|
|
535
|
+
c = !0;
|
|
536
536
|
return;
|
|
537
537
|
}
|
|
538
|
-
t(
|
|
538
|
+
t(w);
|
|
539
539
|
}
|
|
540
540
|
};
|
|
541
|
-
let
|
|
542
|
-
const
|
|
543
|
-
Ee(l, "click", (
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
}, 0),
|
|
541
|
+
let I = !1;
|
|
542
|
+
const P = [
|
|
543
|
+
Ee(l, "click", (w) => {
|
|
544
|
+
I || (I = !0, setTimeout(() => {
|
|
545
|
+
I = !1;
|
|
546
|
+
}, 0), x(w));
|
|
547
547
|
}, {
|
|
548
548
|
passive: !0,
|
|
549
549
|
capture: a
|
|
550
550
|
}),
|
|
551
|
-
Ee(l, "pointerdown", (
|
|
552
|
-
const
|
|
553
|
-
|
|
551
|
+
Ee(l, "pointerdown", (w) => {
|
|
552
|
+
const h = we(e);
|
|
553
|
+
c = !s(w) && !!(h && !w.composedPath().includes(h));
|
|
554
554
|
}, { passive: !0 }),
|
|
555
|
-
o && Ee(l, "blur", (
|
|
555
|
+
o && Ee(l, "blur", (w) => {
|
|
556
556
|
setTimeout(() => {
|
|
557
|
-
var
|
|
558
|
-
const
|
|
559
|
-
((
|
|
557
|
+
var h;
|
|
558
|
+
const m = we(e);
|
|
559
|
+
((h = l.document.activeElement) === null || h === void 0 ? void 0 : h.tagName) === "IFRAME" && !m?.contains(l.document.activeElement) && t(w);
|
|
560
560
|
}, 0);
|
|
561
561
|
}, { passive: !0 })
|
|
562
|
-
].filter(Boolean),
|
|
563
|
-
return
|
|
564
|
-
stop:
|
|
562
|
+
].filter(Boolean), R = () => P.forEach((w) => w());
|
|
563
|
+
return r ? {
|
|
564
|
+
stop: R,
|
|
565
565
|
cancel: () => {
|
|
566
|
-
|
|
566
|
+
c = !1;
|
|
567
567
|
},
|
|
568
|
-
trigger: (
|
|
569
|
-
|
|
568
|
+
trigger: (w) => {
|
|
569
|
+
c = !0, x(w), c = !1;
|
|
570
570
|
}
|
|
571
|
-
} :
|
|
571
|
+
} : R;
|
|
572
572
|
}
|
|
573
573
|
// @__NO_SIDE_EFFECTS__
|
|
574
|
-
function
|
|
574
|
+
function In() {
|
|
575
575
|
const e = re(!1), t = lt();
|
|
576
576
|
return t && Ae(() => {
|
|
577
577
|
e.value = !0;
|
|
@@ -579,28 +579,28 @@ function Tn() {
|
|
|
579
579
|
}
|
|
580
580
|
// @__NO_SIDE_EFFECTS__
|
|
581
581
|
function Ht(e) {
|
|
582
|
-
const t = /* @__PURE__ */
|
|
583
|
-
return
|
|
582
|
+
const t = /* @__PURE__ */ In();
|
|
583
|
+
return $(() => (t.value, !!e()));
|
|
584
584
|
}
|
|
585
585
|
function Lt(e, t, n = {}) {
|
|
586
586
|
const { window: l = We, ...u } = n;
|
|
587
587
|
let a;
|
|
588
|
-
const o = /* @__PURE__ */ Ht(() => l && "MutationObserver" in l),
|
|
588
|
+
const o = /* @__PURE__ */ Ht(() => l && "MutationObserver" in l), r = () => {
|
|
589
589
|
a && (a.disconnect(), a = void 0);
|
|
590
|
-
},
|
|
591
|
-
const v = Ye(
|
|
590
|
+
}, c = ue($(() => {
|
|
591
|
+
const v = Ye(H(e)).map(we).filter(pn);
|
|
592
592
|
return new Set(v);
|
|
593
593
|
}), (v) => {
|
|
594
|
-
|
|
594
|
+
r(), o.value && v.size && (a = new MutationObserver(t), v.forEach((x) => a.observe(x, u)));
|
|
595
595
|
}, {
|
|
596
596
|
immediate: !0,
|
|
597
597
|
flush: "post"
|
|
598
|
-
}), s = () => a?.takeRecords(),
|
|
599
|
-
|
|
598
|
+
}), s = () => a?.takeRecords(), f = () => {
|
|
599
|
+
c(), r();
|
|
600
600
|
};
|
|
601
|
-
return vt(
|
|
601
|
+
return vt(f), {
|
|
602
602
|
isSupported: o,
|
|
603
|
-
stop:
|
|
603
|
+
stop: f,
|
|
604
604
|
takeRecords: s
|
|
605
605
|
};
|
|
606
606
|
}
|
|
@@ -614,19 +614,19 @@ function Sn(e) {
|
|
|
614
614
|
}
|
|
615
615
|
function _e(e, t = {}) {
|
|
616
616
|
var n, l, u, a;
|
|
617
|
-
const { pointerTypes: o, preventDefault:
|
|
617
|
+
const { pointerTypes: o, preventDefault: r, stopPropagation: c, exact: s, onMove: f, onEnd: v, onStart: x, initialValue: I, axis: P = "both", draggingElement: R = We, containerElement: w, handle: h = e, buttons: m = [0], restrictInView: C, autoScroll: b = !1 } = t, p = z((n = H(I)) !== null && n !== void 0 ? n : {
|
|
618
618
|
x: 0,
|
|
619
619
|
y: 0
|
|
620
|
-
}),
|
|
621
|
-
|
|
622
|
-
},
|
|
623
|
-
speed: (l =
|
|
624
|
-
margin: (u =
|
|
625
|
-
direction: (a =
|
|
626
|
-
} : Xe, q = (
|
|
627
|
-
const { clientWidth: Q, clientHeight: X, scrollLeft: oe, scrollTop: ye, scrollWidth: Re, scrollHeight:
|
|
620
|
+
}), O = z(), j = (M) => o ? o.includes(M.pointerType) : !0, E = (M) => {
|
|
621
|
+
H(r) && M.preventDefault(), H(c) && M.stopPropagation();
|
|
622
|
+
}, Z = H(b), N = typeof Z == "object" ? {
|
|
623
|
+
speed: (l = H(Z.speed)) !== null && l !== void 0 ? l : Xe.speed,
|
|
624
|
+
margin: (u = H(Z.margin)) !== null && u !== void 0 ? u : Xe.margin,
|
|
625
|
+
direction: (a = Z.direction) !== null && a !== void 0 ? a : Xe.direction
|
|
626
|
+
} : Xe, q = (M) => typeof M == "number" ? [M, M] : [M.x, M.y], _ = (M, L, W) => {
|
|
627
|
+
const { clientWidth: Q, clientHeight: X, scrollLeft: oe, scrollTop: ye, scrollWidth: Re, scrollHeight: T } = M, [V, Y] = q(N.margin), [G, K] = q(N.speed);
|
|
628
628
|
let te = 0, le = 0;
|
|
629
|
-
(
|
|
629
|
+
(N.direction === "x" || N.direction === "both") && (W.x < V && oe > 0 ? te = -G : W.x + L.width > Q - V && oe < Re - Q && (te = G)), (N.direction === "y" || N.direction === "both") && (W.y < Y && ye > 0 ? le = -K : W.y + L.height > X - Y && ye < T - X && (le = K)), (te || le) && M.scrollBy({
|
|
630
630
|
left: te,
|
|
631
631
|
top: le,
|
|
632
632
|
behavior: "auto"
|
|
@@ -634,138 +634,138 @@ function _e(e, t = {}) {
|
|
|
634
634
|
};
|
|
635
635
|
let ne = null;
|
|
636
636
|
const ge = () => {
|
|
637
|
-
const
|
|
638
|
-
|
|
639
|
-
const
|
|
640
|
-
x: W -
|
|
641
|
-
y: Q -
|
|
637
|
+
const M = H(w);
|
|
638
|
+
M && !ne && (ne = setInterval(() => {
|
|
639
|
+
const L = H(e).getBoundingClientRect(), { x: W, y: Q } = p.value, X = {
|
|
640
|
+
x: W - M.scrollLeft,
|
|
641
|
+
y: Q - M.scrollTop
|
|
642
642
|
};
|
|
643
|
-
X.x >= 0 && X.y >= 0 && (_(
|
|
643
|
+
X.x >= 0 && X.y >= 0 && (_(M, L, X), X.x += M.scrollLeft, X.y += M.scrollTop, p.value = X);
|
|
644
644
|
}, 1e3 / 60));
|
|
645
645
|
}, ve = () => {
|
|
646
646
|
ne && (clearInterval(ne), ne = null);
|
|
647
|
-
}, Oe = (
|
|
648
|
-
const [X, oe] = typeof W == "number" ? [W, W] : [W.x, W.y], { clientWidth: ye, clientHeight: Re } =
|
|
649
|
-
return
|
|
647
|
+
}, Oe = (M, L, W, Q) => {
|
|
648
|
+
const [X, oe] = typeof W == "number" ? [W, W] : [W.x, W.y], { clientWidth: ye, clientHeight: Re } = L;
|
|
649
|
+
return M.x < X || M.x + Q.width > ye - X || M.y < oe || M.y + Q.height > Re - oe;
|
|
650
650
|
}, Ve = () => {
|
|
651
|
-
if (
|
|
652
|
-
const
|
|
653
|
-
if (!
|
|
654
|
-
const
|
|
651
|
+
if (H(t.disabled) || !O.value) return;
|
|
652
|
+
const M = H(w);
|
|
653
|
+
if (!M) return;
|
|
654
|
+
const L = H(e).getBoundingClientRect(), { x: W, y: Q } = p.value;
|
|
655
655
|
Oe({
|
|
656
|
-
x: W -
|
|
657
|
-
y: Q -
|
|
658
|
-
},
|
|
656
|
+
x: W - M.scrollLeft,
|
|
657
|
+
y: Q - M.scrollTop
|
|
658
|
+
}, M, N.margin, L) ? ge() : ve();
|
|
659
659
|
};
|
|
660
|
-
|
|
661
|
-
const Be = (
|
|
662
|
-
var
|
|
663
|
-
if (!
|
|
664
|
-
const W =
|
|
665
|
-
x:
|
|
666
|
-
y:
|
|
660
|
+
H(b) && ue(p, Ve);
|
|
661
|
+
const Be = (M) => {
|
|
662
|
+
var L;
|
|
663
|
+
if (!H(m).includes(M.button) || H(t.disabled) || !j(M) || H(s) && M.target !== H(e)) return;
|
|
664
|
+
const W = H(w), Q = W == null || (L = W.getBoundingClientRect) === null || L === void 0 ? void 0 : L.call(W), X = H(e).getBoundingClientRect(), oe = {
|
|
665
|
+
x: M.clientX - (W ? X.left - Q.left + (b ? 0 : W.scrollLeft) : X.left),
|
|
666
|
+
y: M.clientY - (W ? X.top - Q.top + (b ? 0 : W.scrollTop) : X.top)
|
|
667
667
|
};
|
|
668
|
-
|
|
669
|
-
}, Pe = (
|
|
670
|
-
if (
|
|
671
|
-
const
|
|
672
|
-
|
|
673
|
-
const W =
|
|
674
|
-
let { x: Q, y: X } =
|
|
675
|
-
if ((
|
|
668
|
+
x?.(oe, M) !== !1 && (O.value = oe, E(M));
|
|
669
|
+
}, Pe = (M) => {
|
|
670
|
+
if (H(t.disabled) || !j(M) || !O.value) return;
|
|
671
|
+
const L = H(w);
|
|
672
|
+
L instanceof HTMLElement && Sn(L);
|
|
673
|
+
const W = H(e).getBoundingClientRect();
|
|
674
|
+
let { x: Q, y: X } = p.value;
|
|
675
|
+
if ((P === "x" || P === "both") && (Q = M.clientX - O.value.x, L && (Q = Math.min(Math.max(0, Q), L.scrollWidth - W.width))), (P === "y" || P === "both") && (X = M.clientY - O.value.y, L && (X = Math.min(Math.max(0, X), L.scrollHeight - W.height))), H(b) && L && (ne === null && _(L, W, {
|
|
676
676
|
x: Q,
|
|
677
677
|
y: X
|
|
678
|
-
}), Q +=
|
|
679
|
-
if (
|
|
680
|
-
const oe = Q -
|
|
681
|
-
oe < 0 ? Q =
|
|
678
|
+
}), Q += L.scrollLeft, X += L.scrollTop), L && (C || b)) {
|
|
679
|
+
if (P !== "y") {
|
|
680
|
+
const oe = Q - L.scrollLeft;
|
|
681
|
+
oe < 0 ? Q = L.scrollLeft : oe > L.clientWidth - W.width && (Q = L.clientWidth - W.width + L.scrollLeft);
|
|
682
682
|
}
|
|
683
|
-
if (
|
|
684
|
-
const oe = X -
|
|
685
|
-
oe < 0 ? X =
|
|
683
|
+
if (P !== "x") {
|
|
684
|
+
const oe = X - L.scrollTop;
|
|
685
|
+
oe < 0 ? X = L.scrollTop : oe > L.clientHeight - W.height && (X = L.clientHeight - W.height + L.scrollTop);
|
|
686
686
|
}
|
|
687
687
|
}
|
|
688
|
-
|
|
688
|
+
p.value = {
|
|
689
689
|
x: Q,
|
|
690
690
|
y: X
|
|
691
|
-
},
|
|
692
|
-
}, He = (
|
|
693
|
-
|
|
691
|
+
}, f?.(p.value, M), E(M);
|
|
692
|
+
}, He = (M) => {
|
|
693
|
+
H(t.disabled) || !j(M) || O.value && (O.value = void 0, b && ve(), v?.(p.value, M), E(M));
|
|
694
694
|
};
|
|
695
695
|
if (At) {
|
|
696
|
-
const
|
|
697
|
-
var
|
|
696
|
+
const M = () => {
|
|
697
|
+
var L;
|
|
698
698
|
return {
|
|
699
|
-
capture: (
|
|
700
|
-
passive: !
|
|
699
|
+
capture: (L = t.capture) !== null && L !== void 0 ? L : !0,
|
|
700
|
+
passive: !H(r)
|
|
701
701
|
};
|
|
702
702
|
};
|
|
703
|
-
Ee(
|
|
703
|
+
Ee(h, "pointerdown", Be, M), Ee(R, "pointermove", Pe, M), Ee(R, "pointerup", He, M);
|
|
704
704
|
}
|
|
705
705
|
return {
|
|
706
|
-
...En(
|
|
707
|
-
position:
|
|
708
|
-
isDragging:
|
|
709
|
-
style:
|
|
710
|
-
left: ${
|
|
711
|
-
top: ${
|
|
712
|
-
${
|
|
706
|
+
...En(p),
|
|
707
|
+
position: p,
|
|
708
|
+
isDragging: $(() => !!O.value),
|
|
709
|
+
style: $(() => `
|
|
710
|
+
left: ${p.value.x}px;
|
|
711
|
+
top: ${p.value.y}px;
|
|
712
|
+
${b ? "text-wrap: nowrap;" : ""}
|
|
713
713
|
`)
|
|
714
714
|
};
|
|
715
715
|
}
|
|
716
716
|
function Je(e, t, n = {}) {
|
|
717
717
|
const { window: l = We, ...u } = n;
|
|
718
718
|
let a;
|
|
719
|
-
const o = /* @__PURE__ */ Ht(() => l && "ResizeObserver" in l),
|
|
719
|
+
const o = /* @__PURE__ */ Ht(() => l && "ResizeObserver" in l), r = () => {
|
|
720
720
|
a && (a.disconnect(), a = void 0);
|
|
721
|
-
},
|
|
722
|
-
const
|
|
723
|
-
return Array.isArray(
|
|
724
|
-
}), (
|
|
725
|
-
if (
|
|
721
|
+
}, c = ue($(() => {
|
|
722
|
+
const f = H(e);
|
|
723
|
+
return Array.isArray(f) ? f.map((v) => we(v)) : [we(f)];
|
|
724
|
+
}), (f) => {
|
|
725
|
+
if (r(), o.value && l) {
|
|
726
726
|
a = new ResizeObserver(t);
|
|
727
|
-
for (const v of
|
|
727
|
+
for (const v of f) v && a.observe(v, u);
|
|
728
728
|
}
|
|
729
729
|
}, {
|
|
730
730
|
immediate: !0,
|
|
731
731
|
flush: "post"
|
|
732
732
|
}), s = () => {
|
|
733
|
-
|
|
733
|
+
r(), c();
|
|
734
734
|
};
|
|
735
735
|
return vt(s), {
|
|
736
736
|
isSupported: o,
|
|
737
737
|
stop: s
|
|
738
738
|
};
|
|
739
739
|
}
|
|
740
|
-
function
|
|
741
|
-
const { reset: n = !0, windowResize: l = !0, windowScroll: u = !0, immediate: a = !0, updateTiming: o = "sync" } = t,
|
|
742
|
-
function
|
|
743
|
-
const
|
|
744
|
-
if (!
|
|
745
|
-
n && (
|
|
740
|
+
function Te(e, t = {}) {
|
|
741
|
+
const { reset: n = !0, windowResize: l = !0, windowScroll: u = !0, immediate: a = !0, updateTiming: o = "sync" } = t, r = re(0), c = re(0), s = re(0), f = re(0), v = re(0), x = re(0), I = re(0), P = re(0);
|
|
742
|
+
function R() {
|
|
743
|
+
const h = we(e);
|
|
744
|
+
if (!h) {
|
|
745
|
+
n && (r.value = 0, c.value = 0, s.value = 0, f.value = 0, v.value = 0, x.value = 0, I.value = 0, P.value = 0);
|
|
746
746
|
return;
|
|
747
747
|
}
|
|
748
|
-
const
|
|
749
|
-
|
|
748
|
+
const m = h.getBoundingClientRect();
|
|
749
|
+
r.value = m.height, c.value = m.bottom, s.value = m.left, f.value = m.right, v.value = m.top, x.value = m.width, I.value = m.x, P.value = m.y;
|
|
750
750
|
}
|
|
751
|
-
function
|
|
752
|
-
o === "sync" ?
|
|
751
|
+
function w() {
|
|
752
|
+
o === "sync" ? R() : o === "next-frame" && requestAnimationFrame(() => R());
|
|
753
753
|
}
|
|
754
|
-
return Je(e,
|
|
754
|
+
return Je(e, w), ue(() => we(e), (h) => !h && w()), Lt(e, w, { attributeFilter: ["style", "class"] }), u && Ee("scroll", w, {
|
|
755
755
|
capture: !0,
|
|
756
756
|
passive: !0
|
|
757
|
-
}), l && Ee("resize",
|
|
758
|
-
a &&
|
|
757
|
+
}), l && Ee("resize", w, { passive: !0 }), $n(() => {
|
|
758
|
+
a && w();
|
|
759
759
|
}), {
|
|
760
|
-
height:
|
|
761
|
-
bottom:
|
|
760
|
+
height: r,
|
|
761
|
+
bottom: c,
|
|
762
762
|
left: s,
|
|
763
|
-
right:
|
|
763
|
+
right: f,
|
|
764
764
|
top: v,
|
|
765
|
-
width:
|
|
766
|
-
x:
|
|
767
|
-
y:
|
|
768
|
-
update:
|
|
765
|
+
width: x,
|
|
766
|
+
x: I,
|
|
767
|
+
y: P,
|
|
768
|
+
update: w
|
|
769
769
|
};
|
|
770
770
|
}
|
|
771
771
|
function et(e) {
|
|
@@ -776,21 +776,21 @@ function An(e, t = !1) {
|
|
|
776
776
|
const n = re(t);
|
|
777
777
|
let l = "";
|
|
778
778
|
ue(bn(e), (o) => {
|
|
779
|
-
const
|
|
780
|
-
if (
|
|
781
|
-
const
|
|
782
|
-
if (tt.get(
|
|
783
|
-
if (n.value) return
|
|
779
|
+
const r = et(H(o));
|
|
780
|
+
if (r) {
|
|
781
|
+
const c = r;
|
|
782
|
+
if (tt.get(c) || tt.set(c, c.style.overflow), c.style.overflow !== "hidden" && (l = c.style.overflow), c.style.overflow === "hidden") return n.value = !0;
|
|
783
|
+
if (n.value) return c.style.overflow = "hidden";
|
|
784
784
|
}
|
|
785
785
|
}, { immediate: !0 });
|
|
786
786
|
const u = () => {
|
|
787
|
-
const o = et(
|
|
787
|
+
const o = et(H(e));
|
|
788
788
|
!o || n.value || (o.style.overflow = "hidden", n.value = !0);
|
|
789
789
|
}, a = () => {
|
|
790
|
-
const o = et(
|
|
790
|
+
const o = et(H(e));
|
|
791
791
|
!o || !n.value || (o.style.overflow = l, tt.delete(o), n.value = !1);
|
|
792
792
|
};
|
|
793
|
-
return vt(a),
|
|
793
|
+
return vt(a), $({
|
|
794
794
|
get() {
|
|
795
795
|
return n.value;
|
|
796
796
|
},
|
|
@@ -814,129 +814,129 @@ const Hn = (e) => {
|
|
|
814
814
|
debounce: { default: 300 }
|
|
815
815
|
},
|
|
816
816
|
setup(e, { expose: t }) {
|
|
817
|
-
const n = ce("cell"), l = e.store.getCellData(e.colIndex, e.rowIndex), u = z(""), a = z(!1), o = e.store.columns[e.colIndex],
|
|
817
|
+
const n = ce("cell"), l = e.store.getCellData(e.colIndex, e.rowIndex), u = z(""), a = z(!1), o = e.store.columns[e.colIndex], r = e.store.rows[e.rowIndex], c = o.align || "center", s = o.width || "40ch", f = $(() => e.store.getCellDisplayValue(e.colIndex, e.rowIndex)), v = z(null);
|
|
818
818
|
Ae(() => {
|
|
819
819
|
if (!o.linkDoctype) return;
|
|
820
|
-
const
|
|
821
|
-
if (
|
|
822
|
-
const
|
|
820
|
+
const E = e.store.getCellData(e.colIndex, e.rowIndex);
|
|
821
|
+
if (E != null && typeof E == "object") {
|
|
822
|
+
const N = E, q = N.displayText ?? N.id;
|
|
823
823
|
(typeof q == "string" || typeof q == "number") && (v.value = String(q));
|
|
824
824
|
return;
|
|
825
825
|
}
|
|
826
|
-
const
|
|
827
|
-
!
|
|
826
|
+
const Z = e.store.linkResolver;
|
|
827
|
+
!Z || typeof E != "string" || E === "" || Z(o.linkDoctype, E).then((N) => (N != null && (v.value = N), N));
|
|
828
828
|
});
|
|
829
|
-
const
|
|
830
|
-
textAlign:
|
|
829
|
+
const x = $(() => v.value ?? f.value), I = $(() => typeof x.value == "string" ? Hn(x.value) : !1), P = $(() => ({
|
|
830
|
+
textAlign: c,
|
|
831
831
|
width: s,
|
|
832
832
|
fontWeight: a.value ? "bold" : "inherit",
|
|
833
833
|
paddingLeft: e.store.getIndent(e.colIndex, e.store.display[e.rowIndex]?.indent)
|
|
834
|
-
})),
|
|
834
|
+
})), R = $(() => ({
|
|
835
835
|
"sticky-column": e.pinned,
|
|
836
836
|
"cell-modified": a.value
|
|
837
|
-
})),
|
|
838
|
-
|
|
839
|
-
},
|
|
840
|
-
const { left:
|
|
837
|
+
})), w = () => {
|
|
838
|
+
m(), h();
|
|
839
|
+
}, h = () => {
|
|
840
|
+
const { left: E, bottom: Z, width: N, height: q } = Te(n);
|
|
841
841
|
o.mask, o.modalComponent && e.store.$patch((_) => {
|
|
842
|
-
_.modal.visible = !0, _.modal.colIndex = e.colIndex, _.modal.rowIndex = e.rowIndex, _.modal.left =
|
|
842
|
+
_.modal.visible = !0, _.modal.colIndex = e.colIndex, _.modal.rowIndex = e.rowIndex, _.modal.left = E, _.modal.bottom = Z, _.modal.width = N, _.modal.height = q, _.modal.cell = n.value, typeof o.modalComponent == "function" ? _.modal.component = o.modalComponent({ table: _.table, row: r, column: o }) : _.modal.component = o.modalComponent, _.modal.componentProps = o.modalComponentExtraProps;
|
|
843
843
|
});
|
|
844
844
|
};
|
|
845
845
|
if (e.addNavigation) {
|
|
846
|
-
let
|
|
846
|
+
let E = {
|
|
847
847
|
...qe,
|
|
848
|
-
"keydown.f2":
|
|
849
|
-
"keydown.alt.up":
|
|
850
|
-
"keydown.alt.down":
|
|
851
|
-
"keydown.alt.left":
|
|
852
|
-
"keydown.alt.right":
|
|
848
|
+
"keydown.f2": h,
|
|
849
|
+
"keydown.alt.up": h,
|
|
850
|
+
"keydown.alt.down": h,
|
|
851
|
+
"keydown.alt.left": h,
|
|
852
|
+
"keydown.alt.right": h
|
|
853
853
|
};
|
|
854
|
-
typeof e.addNavigation == "object" && (
|
|
855
|
-
...
|
|
854
|
+
typeof e.addNavigation == "object" && (E = {
|
|
855
|
+
...E,
|
|
856
856
|
...e.addNavigation
|
|
857
857
|
}), ft([
|
|
858
858
|
{
|
|
859
859
|
selectors: n,
|
|
860
|
-
handlers:
|
|
860
|
+
handlers: E
|
|
861
861
|
}
|
|
862
862
|
]);
|
|
863
863
|
}
|
|
864
|
-
const
|
|
864
|
+
const m = () => {
|
|
865
865
|
if (n.value && o.edit) {
|
|
866
|
-
const
|
|
867
|
-
if (
|
|
866
|
+
const E = window.getSelection();
|
|
867
|
+
if (E)
|
|
868
868
|
try {
|
|
869
|
-
const
|
|
870
|
-
|
|
869
|
+
const Z = document.createRange();
|
|
870
|
+
Z.selectNodeContents && (Z.selectNodeContents(n.value), E.removeAllRanges(), E.addRange(Z));
|
|
871
871
|
} catch {
|
|
872
872
|
}
|
|
873
873
|
}
|
|
874
|
-
},
|
|
875
|
-
n.value && (u.value = n.value.textContent,
|
|
876
|
-
},
|
|
874
|
+
}, C = () => {
|
|
875
|
+
n.value && (u.value = n.value.textContent, m());
|
|
876
|
+
}, b = () => {
|
|
877
877
|
try {
|
|
878
|
-
const
|
|
879
|
-
if (
|
|
880
|
-
const
|
|
881
|
-
if (
|
|
882
|
-
return
|
|
878
|
+
const E = window.getSelection();
|
|
879
|
+
if (E && E.rangeCount > 0 && n.value) {
|
|
880
|
+
const Z = E.getRangeAt(0), N = Z.cloneRange();
|
|
881
|
+
if (N.selectNodeContents && N.setEnd)
|
|
882
|
+
return N.selectNodeContents(n.value), N.setEnd(Z.endContainer, Z.endOffset), N.toString().length;
|
|
883
883
|
}
|
|
884
884
|
} catch {
|
|
885
885
|
}
|
|
886
886
|
return 0;
|
|
887
|
-
},
|
|
887
|
+
}, p = (E) => {
|
|
888
888
|
if (n.value)
|
|
889
889
|
try {
|
|
890
|
-
const
|
|
891
|
-
if (!
|
|
892
|
-
let
|
|
890
|
+
const Z = window.getSelection();
|
|
891
|
+
if (!Z) return;
|
|
892
|
+
let N = 0;
|
|
893
893
|
const q = document.createTreeWalker ? document.createTreeWalker(n.value, NodeFilter.SHOW_TEXT, null) : null;
|
|
894
894
|
if (!q) return;
|
|
895
895
|
let _, ne = null;
|
|
896
896
|
for (; _ = q.nextNode(); ) {
|
|
897
|
-
const ge = _, ve =
|
|
898
|
-
if (
|
|
899
|
-
ne.setStart(ge,
|
|
897
|
+
const ge = _, ve = N + ge.textContent.length;
|
|
898
|
+
if (E <= ve && (ne = document.createRange(), ne.setStart && ne.setEnd)) {
|
|
899
|
+
ne.setStart(ge, E - N), ne.setEnd(ge, E - N);
|
|
900
900
|
break;
|
|
901
901
|
}
|
|
902
|
-
|
|
902
|
+
N = ve;
|
|
903
903
|
}
|
|
904
|
-
ne &&
|
|
904
|
+
ne && Z.removeAllRanges && Z.addRange && (Z.removeAllRanges(), Z.addRange(ne));
|
|
905
905
|
} catch {
|
|
906
906
|
}
|
|
907
|
-
},
|
|
907
|
+
}, O = (E) => {
|
|
908
908
|
if (!o.edit) return;
|
|
909
|
-
const
|
|
910
|
-
if (
|
|
909
|
+
const Z = E.target;
|
|
910
|
+
if (Z.textContent === u.value)
|
|
911
911
|
return;
|
|
912
|
-
const
|
|
913
|
-
u.value =
|
|
914
|
-
}, j = /* @__PURE__ */ Rn(
|
|
912
|
+
const N = b();
|
|
913
|
+
u.value = Z.textContent, o.format ? (a.value = Z.textContent !== e.store.getFormattedValue(e.colIndex, e.rowIndex, l), e.store.setCellText(e.colIndex, e.rowIndex, Z.textContent)) : (a.value = Z.textContent !== l, e.store.setCellData(e.colIndex, e.rowIndex, Z.textContent)), at().then(() => p(N));
|
|
914
|
+
}, j = /* @__PURE__ */ Rn(O, e.debounce);
|
|
915
915
|
return t({
|
|
916
916
|
currentData: u
|
|
917
|
-
}), (
|
|
917
|
+
}), (E, Z) => (y(), k("td", {
|
|
918
918
|
ref: "cell",
|
|
919
919
|
"data-colindex": e.colIndex,
|
|
920
920
|
"data-rowindex": e.rowIndex,
|
|
921
|
-
"data-editable":
|
|
922
|
-
contenteditable:
|
|
921
|
+
"data-editable": B(o).edit,
|
|
922
|
+
contenteditable: B(o).edit,
|
|
923
923
|
tabindex: e.tabIndex,
|
|
924
924
|
spellcheck: !1,
|
|
925
|
-
style: pe(
|
|
926
|
-
class:
|
|
927
|
-
onFocus:
|
|
928
|
-
onPaste:
|
|
929
|
-
onInput:
|
|
930
|
-
(...
|
|
931
|
-
onClick:
|
|
925
|
+
style: pe(P.value),
|
|
926
|
+
class: ae(["atable-cell", R.value]),
|
|
927
|
+
onFocus: C,
|
|
928
|
+
onPaste: O,
|
|
929
|
+
onInput: Z[0] || (Z[0] = //@ts-ignore
|
|
930
|
+
(...N) => B(j) && B(j)(...N)),
|
|
931
|
+
onClick: w
|
|
932
932
|
}, [
|
|
933
|
-
|
|
933
|
+
B(o).cellComponent ? (y(), he(Ne(B(o).cellComponent), st({
|
|
934
934
|
key: 0,
|
|
935
|
-
value:
|
|
936
|
-
},
|
|
935
|
+
value: x.value
|
|
936
|
+
}, B(o).cellComponentProps), null, 16, ["value"])) : I.value ? (y(), k("span", {
|
|
937
937
|
key: 1,
|
|
938
|
-
innerHTML:
|
|
939
|
-
}, null, 8, On)) : (
|
|
938
|
+
innerHTML: x.value
|
|
939
|
+
}, null, 8, On)) : (y(), k("span", Vn, be(x.value), 1))
|
|
940
940
|
], 46, Dn));
|
|
941
941
|
}
|
|
942
942
|
}), Pn = ["tabindex"], Zn = ["tabindex"], Nn = ["colspan"], Fn = /* @__PURE__ */ xe({
|
|
@@ -948,7 +948,7 @@ const Hn = (e) => {
|
|
|
948
948
|
addNavigation: { type: [Boolean, Object], default: () => qe }
|
|
949
949
|
},
|
|
950
950
|
setup(e) {
|
|
951
|
-
const t = ce("rowEl"), n =
|
|
951
|
+
const t = ce("rowEl"), n = $(() => e.store.display[e.rowIndex].expanded ? "▼" : "►");
|
|
952
952
|
if (e.addNavigation) {
|
|
953
953
|
const l = {
|
|
954
954
|
"keydown.control.g": (u) => {
|
|
@@ -962,26 +962,26 @@ const Hn = (e) => {
|
|
|
962
962
|
}
|
|
963
963
|
]);
|
|
964
964
|
}
|
|
965
|
-
return (l, u) => (
|
|
966
|
-
|
|
965
|
+
return (l, u) => (y(), k(me, null, [
|
|
966
|
+
F("tr", st(l.$attrs, {
|
|
967
967
|
ref: "rowEl",
|
|
968
968
|
tabindex: e.tabIndex,
|
|
969
969
|
class: "expandable-row"
|
|
970
970
|
}), [
|
|
971
|
-
|
|
971
|
+
F("td", {
|
|
972
972
|
tabIndex: -1,
|
|
973
973
|
class: "row-index",
|
|
974
974
|
onClick: u[0] || (u[0] = (a) => e.store.toggleRowExpand(e.rowIndex))
|
|
975
975
|
}, be(n.value), 1),
|
|
976
976
|
fe(l.$slots, "row", {}, void 0, !0)
|
|
977
977
|
], 16, Pn),
|
|
978
|
-
e.store.display[e.rowIndex].expanded ? (
|
|
978
|
+
e.store.display[e.rowIndex].expanded ? (y(), k("tr", {
|
|
979
979
|
key: 0,
|
|
980
980
|
ref: "rowExpanded",
|
|
981
981
|
tabindex: e.tabIndex,
|
|
982
982
|
class: "expanded-row"
|
|
983
983
|
}, [
|
|
984
|
-
|
|
984
|
+
F("td", {
|
|
985
985
|
tabIndex: -1,
|
|
986
986
|
colspan: e.store.columns.length + 1,
|
|
987
987
|
class: "expanded-row-content"
|
|
@@ -1017,133 +1017,131 @@ const Hn = (e) => {
|
|
|
1017
1017
|
},
|
|
1018
1018
|
emits: ["connection:create"],
|
|
1019
1019
|
setup(e, { expose: t, emit: n }) {
|
|
1020
|
-
Xt((
|
|
1021
|
-
|
|
1022
|
-
|
|
1020
|
+
Xt((T) => ({
|
|
1021
|
+
v564d6da1: u.value,
|
|
1022
|
+
v4f540c19: T.colspan
|
|
1023
1023
|
}));
|
|
1024
|
-
const l = n, u = z(e.color.length >= 6 ? e.color : "#cccccc"), a = `gantt-bar-row-${e.rowIndex}-col-${e.colIndex}`, o = ce("container"),
|
|
1025
|
-
const
|
|
1024
|
+
const l = n, u = z(e.color.length >= 6 ? e.color : "#cccccc"), a = `gantt-bar-row-${e.rowIndex}-col-${e.colIndex}`, o = ce("container"), r = ce("bar"), c = ce("leftResizeHandle"), s = ce("rightResizeHandle"), f = ce("leftConnectionHandle"), v = ce("rightConnectionHandle"), { width: x } = Te(o), { left: I, right: P } = Te(r), R = z(e.start), w = z(e.end || R.value + e.colspan), h = z(!1), m = z(!1), C = z(!1), b = z(!1), p = z(!1), O = z({ startX: 0, startY: 0, endX: 0, endY: 0 }), j = $(() => ge.value || _.value || ne.value), E = $(() => e.colspan > 0 ? x.value / e.colspan : 0), Z = $(() => {
|
|
1025
|
+
const T = R.value / e.colspan * 100, V = w.value / e.colspan * 100;
|
|
1026
1026
|
return {
|
|
1027
|
-
left: `${
|
|
1028
|
-
width: `${
|
|
1027
|
+
left: `${T}%`,
|
|
1028
|
+
width: `${V - T}%`,
|
|
1029
1029
|
backgroundColor: u.value
|
|
1030
1030
|
};
|
|
1031
|
-
}),
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
})
|
|
1041
|
-
), q = z({ startX: 0, startPos: 0 }), { isDragging: _ } = _e(r, {
|
|
1031
|
+
}), N = $(() => ({
|
|
1032
|
+
position: "fixed",
|
|
1033
|
+
top: 0,
|
|
1034
|
+
left: 0,
|
|
1035
|
+
width: "100vw",
|
|
1036
|
+
height: "100vh",
|
|
1037
|
+
pointerEvents: "none",
|
|
1038
|
+
zIndex: 1e3
|
|
1039
|
+
})), q = z({ startX: 0, startPos: 0 }), { isDragging: _ } = _e(c, {
|
|
1042
1040
|
axis: "x",
|
|
1043
|
-
onStart: () => ve(
|
|
1044
|
-
onMove: ({ x:
|
|
1045
|
-
onEnd: ({ x:
|
|
1041
|
+
onStart: () => ve(I.value, R.value),
|
|
1042
|
+
onMove: ({ x: T }) => Oe(T),
|
|
1043
|
+
onEnd: ({ x: T }) => Ve(T)
|
|
1046
1044
|
}), { isDragging: ne } = _e(s, {
|
|
1047
1045
|
axis: "x",
|
|
1048
|
-
onStart: () => ve(
|
|
1049
|
-
onMove: ({ x:
|
|
1050
|
-
onEnd: ({ x:
|
|
1051
|
-
}), { isDragging: ge } = _e(
|
|
1046
|
+
onStart: () => ve(P.value, w.value),
|
|
1047
|
+
onMove: ({ x: T }) => Be(T),
|
|
1048
|
+
onEnd: ({ x: T }) => Pe(T)
|
|
1049
|
+
}), { isDragging: ge } = _e(r, {
|
|
1052
1050
|
exact: !0,
|
|
1053
1051
|
axis: "x",
|
|
1054
|
-
onStart: () => ve(
|
|
1055
|
-
onMove: ({ x:
|
|
1056
|
-
onEnd: ({ x:
|
|
1052
|
+
onStart: () => ve(I.value, R.value),
|
|
1053
|
+
onMove: ({ x: T }) => He(T),
|
|
1054
|
+
onEnd: ({ x: T }) => M(T)
|
|
1057
1055
|
});
|
|
1058
1056
|
Ae(() => {
|
|
1059
|
-
|
|
1057
|
+
L();
|
|
1060
1058
|
}), Gt(() => {
|
|
1061
1059
|
W();
|
|
1062
1060
|
});
|
|
1063
|
-
function ve(
|
|
1064
|
-
|
|
1061
|
+
function ve(T, V) {
|
|
1062
|
+
r.value && (r.value.style.transition = "none"), q.value = { startX: T, startPos: V };
|
|
1065
1063
|
}
|
|
1066
|
-
function Oe(
|
|
1067
|
-
if (!_.value || !
|
|
1068
|
-
const Y = (
|
|
1069
|
-
|
|
1064
|
+
function Oe(T) {
|
|
1065
|
+
if (!_.value || !r.value) return;
|
|
1066
|
+
const Y = (T - q.value.startX) / E.value, G = Math.max(0, Math.min(w.value - 1, q.value.startPos + Y));
|
|
1067
|
+
r.value.style.left = `${G / e.colspan * 100}%`, r.value.style.width = `${(w.value - G) / e.colspan * 100}%`;
|
|
1070
1068
|
}
|
|
1071
|
-
function Ve(
|
|
1072
|
-
if (!
|
|
1073
|
-
const
|
|
1074
|
-
|
|
1069
|
+
function Ve(T) {
|
|
1070
|
+
if (!r.value) return;
|
|
1071
|
+
const V = T - q.value.startX, Y = Math.round(V / E.value), G = R.value, K = Math.max(0, Math.min(w.value - 1, q.value.startPos + Y));
|
|
1072
|
+
R.value = K, e.store.updateGanttBar({
|
|
1075
1073
|
rowIndex: e.rowIndex,
|
|
1076
1074
|
colIndex: e.colIndex,
|
|
1077
1075
|
type: "resize",
|
|
1078
1076
|
edge: "start",
|
|
1079
1077
|
oldStart: G,
|
|
1080
1078
|
newStart: K,
|
|
1081
|
-
end:
|
|
1079
|
+
end: w.value,
|
|
1082
1080
|
delta: Y,
|
|
1083
|
-
oldColspan:
|
|
1084
|
-
newColspan:
|
|
1081
|
+
oldColspan: w.value - G,
|
|
1082
|
+
newColspan: w.value - K
|
|
1085
1083
|
});
|
|
1086
1084
|
}
|
|
1087
|
-
function Be(
|
|
1088
|
-
if (!ne.value || !
|
|
1089
|
-
const Y = (
|
|
1090
|
-
|
|
1085
|
+
function Be(T) {
|
|
1086
|
+
if (!ne.value || !r.value) return;
|
|
1087
|
+
const Y = (T - q.value.startX) / E.value, G = Math.max(R.value + 1, Math.min(e.columnsCount, q.value.startPos + Y));
|
|
1088
|
+
r.value.style.width = `${(G - R.value) / e.colspan * 100}%`;
|
|
1091
1089
|
}
|
|
1092
|
-
function Pe(
|
|
1093
|
-
if (!
|
|
1094
|
-
const
|
|
1095
|
-
|
|
1090
|
+
function Pe(T) {
|
|
1091
|
+
if (!r.value) return;
|
|
1092
|
+
const V = T - q.value.startX, Y = Math.round(V / E.value), G = w.value, K = Math.max(R.value + 1, Math.min(e.columnsCount, q.value.startPos + Y));
|
|
1093
|
+
w.value = K, e.store.updateGanttBar({
|
|
1096
1094
|
rowIndex: e.rowIndex,
|
|
1097
1095
|
colIndex: e.colIndex,
|
|
1098
1096
|
type: "resize",
|
|
1099
1097
|
edge: "end",
|
|
1100
1098
|
oldEnd: G,
|
|
1101
1099
|
newEnd: K,
|
|
1102
|
-
start:
|
|
1100
|
+
start: R.value,
|
|
1103
1101
|
delta: Y,
|
|
1104
|
-
oldColspan: G -
|
|
1105
|
-
newColspan: K -
|
|
1102
|
+
oldColspan: G - R.value,
|
|
1103
|
+
newColspan: K - R.value
|
|
1106
1104
|
});
|
|
1107
1105
|
}
|
|
1108
|
-
function He(
|
|
1109
|
-
if (!ge.value || !
|
|
1110
|
-
const Y = (
|
|
1111
|
-
|
|
1106
|
+
function He(T) {
|
|
1107
|
+
if (!ge.value || !r.value) return;
|
|
1108
|
+
const Y = (T - q.value.startX) / E.value, G = w.value - R.value, K = Math.max(0, Math.min(q.value.startPos + Y, e.columnsCount - G));
|
|
1109
|
+
r.value.style.left = `${K / e.colspan * 100}%`;
|
|
1112
1110
|
}
|
|
1113
|
-
function
|
|
1114
|
-
if (!
|
|
1115
|
-
const
|
|
1116
|
-
let le = q.value.startPos + Y,
|
|
1117
|
-
le < 0 ? (le = 0,
|
|
1111
|
+
function M(T) {
|
|
1112
|
+
if (!r.value) return;
|
|
1113
|
+
const V = T - q.value.startX, Y = Math.round(V / E.value), G = w.value - R.value, K = R.value, te = w.value;
|
|
1114
|
+
let le = q.value.startPos + Y, se = le + G;
|
|
1115
|
+
le < 0 ? (le = 0, se = G) : se > e.columnsCount && (se = e.columnsCount, le = se - G), R.value = le, w.value = se, e.store.updateGanttBar({
|
|
1118
1116
|
rowIndex: e.rowIndex,
|
|
1119
1117
|
colIndex: e.colIndex,
|
|
1120
1118
|
type: "bar",
|
|
1121
1119
|
oldStart: K,
|
|
1122
1120
|
oldEnd: te,
|
|
1123
1121
|
newStart: le,
|
|
1124
|
-
newEnd:
|
|
1122
|
+
newEnd: se,
|
|
1125
1123
|
delta: Y,
|
|
1126
|
-
colspan:
|
|
1124
|
+
colspan: se - le
|
|
1127
1125
|
});
|
|
1128
1126
|
}
|
|
1129
|
-
function
|
|
1130
|
-
const { x:
|
|
1127
|
+
function L() {
|
|
1128
|
+
const { x: T, y: V } = Te(r), { x: Y, y: G } = Te(f), { x: K, y: te } = Te(v);
|
|
1131
1129
|
e.store.registerGanttBar({
|
|
1132
1130
|
id: a,
|
|
1133
1131
|
rowIndex: e.rowIndex,
|
|
1134
1132
|
colIndex: e.colIndex,
|
|
1135
|
-
startIndex:
|
|
1136
|
-
endIndex:
|
|
1133
|
+
startIndex: R,
|
|
1134
|
+
endIndex: w,
|
|
1137
1135
|
color: u,
|
|
1138
1136
|
label: e.label,
|
|
1139
|
-
position: { x:
|
|
1137
|
+
position: { x: T, y: V }
|
|
1140
1138
|
}), e.store.isDependencyGraphEnabled && (e.store.registerConnectionHandle({
|
|
1141
1139
|
id: `${a}-connection-left`,
|
|
1142
1140
|
rowIndex: e.rowIndex,
|
|
1143
1141
|
colIndex: e.colIndex,
|
|
1144
1142
|
side: "left",
|
|
1145
1143
|
position: { x: Y, y: G },
|
|
1146
|
-
visible:
|
|
1144
|
+
visible: h,
|
|
1147
1145
|
barId: a
|
|
1148
1146
|
}), e.store.registerConnectionHandle({
|
|
1149
1147
|
id: `${a}-connection-right`,
|
|
@@ -1151,7 +1149,7 @@ const Hn = (e) => {
|
|
|
1151
1149
|
colIndex: e.colIndex,
|
|
1152
1150
|
side: "right",
|
|
1153
1151
|
position: { x: K, y: te },
|
|
1154
|
-
visible:
|
|
1152
|
+
visible: m,
|
|
1155
1153
|
barId: a
|
|
1156
1154
|
}));
|
|
1157
1155
|
}
|
|
@@ -1159,107 +1157,107 @@ const Hn = (e) => {
|
|
|
1159
1157
|
e.store.unregisterGanttBar(a), e.store.isDependencyGraphEnabled && (e.store.unregisterConnectionHandle(`${a}-connection-left`), e.store.unregisterConnectionHandle(`${a}-connection-right`));
|
|
1160
1158
|
}
|
|
1161
1159
|
function Q() {
|
|
1162
|
-
e.store.isDependencyGraphEnabled && (
|
|
1160
|
+
e.store.isDependencyGraphEnabled && (h.value = !0, m.value = !0);
|
|
1163
1161
|
}
|
|
1164
1162
|
function X() {
|
|
1165
|
-
!
|
|
1163
|
+
!C.value && !b.value && (h.value = !1, m.value = !1);
|
|
1166
1164
|
}
|
|
1167
|
-
function oe(
|
|
1168
|
-
|
|
1169
|
-
const Y =
|
|
1165
|
+
function oe(T, V) {
|
|
1166
|
+
V.preventDefault(), V.stopPropagation(), p.value = !0, T === "left" ? C.value = !0 : b.value = !0;
|
|
1167
|
+
const Y = T === "left" ? f.value : v.value;
|
|
1170
1168
|
if (Y) {
|
|
1171
|
-
const te = Y.getBoundingClientRect(), le = te.left + te.width / 2,
|
|
1172
|
-
|
|
1169
|
+
const te = Y.getBoundingClientRect(), le = te.left + te.width / 2, se = te.top + te.height / 2;
|
|
1170
|
+
O.value = { startX: le, startY: se, endX: le, endY: se };
|
|
1173
1171
|
}
|
|
1174
1172
|
const G = (te) => {
|
|
1175
|
-
|
|
1173
|
+
O.value.endX = te.clientX, O.value.endY = te.clientY;
|
|
1176
1174
|
}, K = (te) => {
|
|
1177
|
-
ye(te,
|
|
1175
|
+
ye(te, T), Re(G, K);
|
|
1178
1176
|
};
|
|
1179
1177
|
document.addEventListener("mousemove", G), document.addEventListener("mouseup", K);
|
|
1180
1178
|
}
|
|
1181
|
-
function ye(
|
|
1182
|
-
const G = document.elementFromPoint(
|
|
1183
|
-
if (G && G !== (
|
|
1179
|
+
function ye(T, V) {
|
|
1180
|
+
const G = document.elementFromPoint(T.clientX, T.clientY)?.closest(".connection-handle");
|
|
1181
|
+
if (G && G !== (V === "left" ? f.value : v.value)) {
|
|
1184
1182
|
const K = G.closest(".gantt-bar");
|
|
1185
1183
|
if (K) {
|
|
1186
|
-
const te = parseInt(K.getAttribute("data-rowindex") || "0"), le = parseInt(K.getAttribute("data-colindex") || "0"),
|
|
1187
|
-
`${a}-connection-${
|
|
1188
|
-
`${ht}-connection-${
|
|
1184
|
+
const te = parseInt(K.getAttribute("data-rowindex") || "0"), le = parseInt(K.getAttribute("data-colindex") || "0"), se = G.classList.contains("left-connection-handle") ? "left" : "right", ht = `gantt-bar-row-${te}-col-${le}`, Qe = e.store.createConnection(
|
|
1185
|
+
`${a}-connection-${V}`,
|
|
1186
|
+
`${ht}-connection-${se}`
|
|
1189
1187
|
);
|
|
1190
1188
|
Qe && l("connection:create", Qe);
|
|
1191
1189
|
}
|
|
1192
1190
|
}
|
|
1193
1191
|
}
|
|
1194
|
-
function Re(
|
|
1195
|
-
|
|
1192
|
+
function Re(T, V) {
|
|
1193
|
+
p.value = !1, C.value = !1, b.value = !1, document.removeEventListener("mousemove", T), document.removeEventListener("mouseup", V), r.value?.matches(":hover") || X();
|
|
1196
1194
|
}
|
|
1197
1195
|
return t({
|
|
1198
|
-
barStyle:
|
|
1196
|
+
barStyle: Z,
|
|
1199
1197
|
cleanupConnectionDrag: Re,
|
|
1200
|
-
currentEnd:
|
|
1198
|
+
currentEnd: w,
|
|
1201
1199
|
handleConnectionDrop: ye,
|
|
1202
|
-
isLeftConnectionDragging:
|
|
1203
|
-
isLeftConnectionVisible:
|
|
1204
|
-
isRightConnectionDragging:
|
|
1205
|
-
isRightConnectionVisible:
|
|
1206
|
-
showDragPreview:
|
|
1207
|
-
}), (
|
|
1200
|
+
isLeftConnectionDragging: C,
|
|
1201
|
+
isLeftConnectionVisible: h,
|
|
1202
|
+
isRightConnectionDragging: b,
|
|
1203
|
+
isRightConnectionVisible: m,
|
|
1204
|
+
showDragPreview: p
|
|
1205
|
+
}), (T, V) => (y(), k("td", {
|
|
1208
1206
|
class: "aganttcell",
|
|
1209
1207
|
colspan: e.colspan
|
|
1210
1208
|
}, [
|
|
1211
|
-
|
|
1212
|
-
|
|
1209
|
+
F("div", Xn, [
|
|
1210
|
+
F("div", {
|
|
1213
1211
|
ref: "bar",
|
|
1214
1212
|
"data-rowindex": e.rowIndex,
|
|
1215
1213
|
"data-colindex": e.colIndex,
|
|
1216
|
-
class:
|
|
1217
|
-
style: pe(
|
|
1214
|
+
class: ae(["gantt-bar", { "is-dragging": j.value }]),
|
|
1215
|
+
style: pe(Z.value),
|
|
1218
1216
|
onMouseenter: Q,
|
|
1219
1217
|
onMouseleave: X
|
|
1220
1218
|
}, [
|
|
1221
|
-
e.store.isDependencyGraphEnabled ? (
|
|
1219
|
+
e.store.isDependencyGraphEnabled ? (y(), k("div", {
|
|
1222
1220
|
key: 0,
|
|
1223
1221
|
ref: "leftConnectionHandle",
|
|
1224
|
-
class:
|
|
1225
|
-
onMousedown:
|
|
1226
|
-
}, [...
|
|
1227
|
-
|
|
1222
|
+
class: ae(["connection-handle left-connection-handle", { visible: h.value, "is-dragging": C.value }]),
|
|
1223
|
+
onMousedown: V[0] || (V[0] = Se((Y) => oe("left", Y), ["stop"]))
|
|
1224
|
+
}, [...V[2] || (V[2] = [
|
|
1225
|
+
F("div", { class: "connection-dot" }, null, -1)
|
|
1228
1226
|
])], 34)) : ee("", !0),
|
|
1229
|
-
e.store.isDependencyGraphEnabled ? (
|
|
1227
|
+
e.store.isDependencyGraphEnabled ? (y(), k("div", {
|
|
1230
1228
|
key: 1,
|
|
1231
1229
|
ref: "rightConnectionHandle",
|
|
1232
|
-
class:
|
|
1233
|
-
onMousedown:
|
|
1234
|
-
}, [...
|
|
1235
|
-
|
|
1230
|
+
class: ae(["connection-handle right-connection-handle", { visible: m.value, "is-dragging": b.value }]),
|
|
1231
|
+
onMousedown: V[1] || (V[1] = Se((Y) => oe("right", Y), ["stop"]))
|
|
1232
|
+
}, [...V[3] || (V[3] = [
|
|
1233
|
+
F("div", { class: "connection-dot" }, null, -1)
|
|
1236
1234
|
])], 34)) : ee("", !0),
|
|
1237
|
-
|
|
1235
|
+
F("div", {
|
|
1238
1236
|
ref: "leftResizeHandle",
|
|
1239
|
-
class:
|
|
1240
|
-
}, [...
|
|
1241
|
-
|
|
1242
|
-
|
|
1237
|
+
class: ae(["resize-handle left-resize-handle", { "is-dragging": B(_) }])
|
|
1238
|
+
}, [...V[4] || (V[4] = [
|
|
1239
|
+
F("div", { class: "handle-grip" }, null, -1),
|
|
1240
|
+
F("div", { class: "vertical-indicator left-indicator" }, null, -1)
|
|
1243
1241
|
])], 2),
|
|
1244
|
-
e.label ? (
|
|
1245
|
-
|
|
1242
|
+
e.label ? (y(), k("label", jn, be(e.label), 1)) : ee("", !0),
|
|
1243
|
+
F("div", {
|
|
1246
1244
|
ref: "rightResizeHandle",
|
|
1247
|
-
class:
|
|
1248
|
-
}, [...
|
|
1249
|
-
|
|
1250
|
-
|
|
1245
|
+
class: ae(["resize-handle right-resize-handle", { "is-dragging": B(ne) }])
|
|
1246
|
+
}, [...V[5] || (V[5] = [
|
|
1247
|
+
F("div", { class: "handle-grip" }, null, -1),
|
|
1248
|
+
F("div", { class: "vertical-indicator right-indicator" }, null, -1)
|
|
1251
1249
|
])], 2)
|
|
1252
1250
|
], 46, Gn)
|
|
1253
1251
|
], 512),
|
|
1254
|
-
e.store.isDependencyGraphEnabled &&
|
|
1252
|
+
e.store.isDependencyGraphEnabled && p.value ? (y(), k("svg", {
|
|
1255
1253
|
key: 0,
|
|
1256
|
-
style: pe(
|
|
1254
|
+
style: pe(N.value)
|
|
1257
1255
|
}, [
|
|
1258
|
-
|
|
1259
|
-
x1:
|
|
1260
|
-
y1:
|
|
1261
|
-
x2:
|
|
1262
|
-
y2:
|
|
1256
|
+
F("line", {
|
|
1257
|
+
x1: O.value.startX,
|
|
1258
|
+
y1: O.value.startY,
|
|
1259
|
+
x2: O.value.endX,
|
|
1260
|
+
y2: O.value.endY,
|
|
1263
1261
|
stroke: "#2196f3",
|
|
1264
1262
|
"stroke-width": "2",
|
|
1265
1263
|
"stroke-dasharray": "5,5"
|
|
@@ -1267,7 +1265,7 @@ const Hn = (e) => {
|
|
|
1267
1265
|
], 4)) : ee("", !0)
|
|
1268
1266
|
], 8, zn));
|
|
1269
1267
|
}
|
|
1270
|
-
}), Jn = /* @__PURE__ */ $e(Un, [["__scopeId", "data-v-
|
|
1268
|
+
}), Jn = /* @__PURE__ */ $e(Un, [["__scopeId", "data-v-032ef6d9"]]), qn = `<?xml version="1.0" encoding="UTF-8"?>
|
|
1271
1269
|
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
|
|
1272
1270
|
<path d="M32,64C14.35,64,0,49.65,0,32S14.35,0,32,0s32,14.35,32,32-14.35,32-32,32ZM32,4c-15.44,0-28,12.56-28,28s12.56,28,28,28,28-12.56,28-28S47.44,4,32,4Z" style="fill: #000; stroke-width: 0px;"/>
|
|
1273
1271
|
<polygon points="34 18 30 18 30 30 18 30 18 34 30 34 30 46 34 46 34 34 46 34 46 30 34 30 34 18" style="fill: #000; stroke-width: 0px;"/>
|
|
@@ -1311,20 +1309,26 @@ const Hn = (e) => {
|
|
|
1311
1309
|
</svg>`, to = `<?xml version="1.0" encoding="UTF-8"?>
|
|
1312
1310
|
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 70.67 70.64">
|
|
1313
1311
|
<path d="M70.08,33.9l-9.75-9.75-2.83,2.83,6.33,6.33h-26.51V6.81l6.33,6.33,2.83-2.83L36.75.56c-.75-.75-2.08-.75-2.83,0l-9.75,9.75,2.83,2.83,6.33-6.33v26.5H6.83l6.33-6.33-2.83-2.83L.59,33.9c-.38.38-.59.88-.59,1.41s.21,1.04.59,1.41l9.75,9.75,2.83-2.83-6.33-6.33h26.5v26.51l-6.33-6.33-2.83,2.83,9.75,9.75c.38.38.88.59,1.41.59s1.04-.21,1.41-.59l9.75-9.75-2.83-2.83-6.33,6.33v-26.51h26.51l-6.33,6.33,2.83,2.83,9.75-9.75c.38-.38.59-.88.59-1.41s-.21-1.04-.59-1.41Z" style="fill: #000; stroke-width: 0px;"/>
|
|
1314
|
-
</svg>`, no =
|
|
1312
|
+
</svg>`, no = `<?xml version="1.0" encoding="UTF-8"?>
|
|
1313
|
+
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
|
|
1314
|
+
<path d="M32,64C14.35,64,0,49.65,0,32S14.35,0,32,0s32,14.35,32,32-14.35,32-32,32ZM32,4c-15.44,0-28,12.56-28,28s12.56,28,28,28,28-12.56,28-28S47.44,4,32,4Z" style="fill: #000; stroke-width: 0px;"/>
|
|
1315
|
+
<polygon points="18,20 18,44 46,32" style="fill: #000; stroke-width: 0px;"/>
|
|
1316
|
+
</svg>
|
|
1317
|
+
`, oo = {
|
|
1315
1318
|
add: qn,
|
|
1316
1319
|
delete: Qn,
|
|
1317
1320
|
duplicate: Kn,
|
|
1318
1321
|
insertAbove: _n,
|
|
1319
1322
|
insertBelow: eo,
|
|
1320
|
-
move: to
|
|
1321
|
-
|
|
1323
|
+
move: to,
|
|
1324
|
+
open: no
|
|
1325
|
+
}, lo = {
|
|
1322
1326
|
key: 0,
|
|
1323
1327
|
class: "row-actions-dropdown"
|
|
1324
|
-
},
|
|
1328
|
+
}, ao = ["aria-expanded"], so = ["onClick"], io = ["innerHTML"], ro = { class: "action-label" }, co = {
|
|
1325
1329
|
key: 1,
|
|
1326
1330
|
class: "row-actions-icons"
|
|
1327
|
-
},
|
|
1331
|
+
}, uo = ["title", "aria-label", "onClick"], fo = ["innerHTML"], Ue = /* @__PURE__ */ xe({
|
|
1328
1332
|
__name: "ARowActions",
|
|
1329
1333
|
props: {
|
|
1330
1334
|
rowIndex: {},
|
|
@@ -1334,27 +1338,28 @@ const Hn = (e) => {
|
|
|
1334
1338
|
},
|
|
1335
1339
|
emits: ["action"],
|
|
1336
1340
|
setup(e, { emit: t }) {
|
|
1337
|
-
const n = e, l = t, u = ce("actionsCell"), a = ce("toggleButton"), o = z(0),
|
|
1338
|
-
add: "Add
|
|
1339
|
-
delete: "Delete
|
|
1340
|
-
duplicate: "Duplicate
|
|
1341
|
+
const n = e, l = t, u = ce("actionsCell"), a = ce("toggleButton"), o = z(0), r = z(!1), c = z(!1), s = z({ top: 0, left: 0 }), f = {
|
|
1342
|
+
add: "Add Record",
|
|
1343
|
+
delete: "Delete Record",
|
|
1344
|
+
duplicate: "Duplicate Record",
|
|
1341
1345
|
insertAbove: "Insert Above",
|
|
1342
1346
|
insertBelow: "Insert Below",
|
|
1343
|
-
move: "Move
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1347
|
+
move: "Move Record",
|
|
1348
|
+
open: "Open Record"
|
|
1349
|
+
}, v = $(() => {
|
|
1350
|
+
const h = [], m = n.config.actions || {}, C = ["open", "add", "delete", "duplicate", "insertAbove", "insertBelow", "move"];
|
|
1351
|
+
for (const b of C) {
|
|
1352
|
+
const p = m[b];
|
|
1353
|
+
if (p === !1 || p === void 0) continue;
|
|
1354
|
+
let O = !0, j = f[b], E = oo[b];
|
|
1355
|
+
typeof p == "object" && (O = p.enabled !== !1, j = p.label || j, E = p.icon || E), O && h.push({ type: b, label: j, icon: E });
|
|
1351
1356
|
}
|
|
1352
|
-
return
|
|
1353
|
-
}),
|
|
1357
|
+
return h;
|
|
1358
|
+
}), x = $(() => {
|
|
1354
1359
|
if (n.config.forceDropdown) return !0;
|
|
1355
|
-
const
|
|
1356
|
-
return
|
|
1357
|
-
}),
|
|
1360
|
+
const h = n.config.dropdownThreshold ?? 150;
|
|
1361
|
+
return h === 0 ? !1 : o.value > 0 && o.value < h;
|
|
1362
|
+
}), I = $(() => r.value ? c.value ? {
|
|
1358
1363
|
position: "fixed",
|
|
1359
1364
|
bottom: `${window.innerHeight - s.value.top}px`,
|
|
1360
1365
|
left: `${s.value.left}px`,
|
|
@@ -1364,85 +1369,85 @@ const Hn = (e) => {
|
|
|
1364
1369
|
top: `${s.value.top}px`,
|
|
1365
1370
|
left: `${s.value.left}px`
|
|
1366
1371
|
} : {});
|
|
1367
|
-
Je(u, (
|
|
1368
|
-
const
|
|
1369
|
-
|
|
1372
|
+
Je(u, (h) => {
|
|
1373
|
+
const m = h[0];
|
|
1374
|
+
m && (o.value = m.contentRect.width);
|
|
1370
1375
|
});
|
|
1371
|
-
const
|
|
1372
|
-
|
|
1373
|
-
},
|
|
1376
|
+
const P = () => {
|
|
1377
|
+
r.value || R(), r.value = !r.value;
|
|
1378
|
+
}, R = () => {
|
|
1374
1379
|
if (!a.value) return;
|
|
1375
|
-
const
|
|
1376
|
-
|
|
1377
|
-
top:
|
|
1378
|
-
left:
|
|
1380
|
+
const h = a.value.getBoundingClientRect(), m = window.innerHeight, C = v.value.length * 40 + 16, b = m - h.bottom, p = h.top;
|
|
1381
|
+
c.value = b < C && p > C, c.value ? s.value = {
|
|
1382
|
+
top: h.top,
|
|
1383
|
+
left: h.left
|
|
1379
1384
|
} : s.value = {
|
|
1380
|
-
top:
|
|
1381
|
-
left:
|
|
1385
|
+
top: h.bottom,
|
|
1386
|
+
left: h.left
|
|
1382
1387
|
};
|
|
1383
1388
|
};
|
|
1384
1389
|
ot(u, () => {
|
|
1385
|
-
|
|
1390
|
+
r.value = !1;
|
|
1386
1391
|
});
|
|
1387
|
-
const
|
|
1388
|
-
|
|
1389
|
-
const
|
|
1390
|
-
typeof
|
|
1392
|
+
const w = (h, m) => {
|
|
1393
|
+
r.value = !1;
|
|
1394
|
+
const C = n.config.actions?.[h];
|
|
1395
|
+
typeof C == "object" && C.handler && C.handler(n.rowIndex, n.store) === !1 || l("action", h, n.rowIndex, m);
|
|
1391
1396
|
};
|
|
1392
|
-
return (
|
|
1397
|
+
return (h, m) => (y(), k("td", {
|
|
1393
1398
|
ref: "actionsCell",
|
|
1394
|
-
class:
|
|
1399
|
+
class: ae(["atable-row-actions", { "sticky-column": e.position === "before-index", "dropdown-active": r.value }])
|
|
1395
1400
|
}, [
|
|
1396
|
-
|
|
1397
|
-
|
|
1401
|
+
x.value ? (y(), k("div", lo, [
|
|
1402
|
+
F("button", {
|
|
1398
1403
|
ref: "toggleButton",
|
|
1399
1404
|
type: "button",
|
|
1400
1405
|
class: "row-actions-toggle",
|
|
1401
|
-
"aria-expanded":
|
|
1406
|
+
"aria-expanded": r.value,
|
|
1402
1407
|
"aria-haspopup": "true",
|
|
1403
|
-
onClick: Se(
|
|
1404
|
-
}, [...
|
|
1405
|
-
|
|
1406
|
-
])], 8,
|
|
1407
|
-
de(
|
|
1408
|
-
class:
|
|
1409
|
-
style: pe(
|
|
1408
|
+
onClick: Se(P, ["stop"])
|
|
1409
|
+
}, [...m[0] || (m[0] = [
|
|
1410
|
+
F("span", { class: "dropdown-icon" }, "⋮", -1)
|
|
1411
|
+
])], 8, ao),
|
|
1412
|
+
de(F("div", {
|
|
1413
|
+
class: ae(["row-actions-menu", { "menu-flipped": c.value }]),
|
|
1414
|
+
style: pe(I.value),
|
|
1410
1415
|
role: "menu"
|
|
1411
1416
|
}, [
|
|
1412
|
-
(
|
|
1413
|
-
key:
|
|
1417
|
+
(y(!0), k(me, null, Ce(v.value, (C) => (y(), k("button", {
|
|
1418
|
+
key: C.type,
|
|
1414
1419
|
type: "button",
|
|
1415
1420
|
class: "row-action-menu-item",
|
|
1416
1421
|
role: "menuitem",
|
|
1417
|
-
onClick: Se((
|
|
1422
|
+
onClick: Se((b) => w(C.type, b), ["stop"])
|
|
1418
1423
|
}, [
|
|
1419
|
-
|
|
1424
|
+
F("span", {
|
|
1420
1425
|
class: "action-icon",
|
|
1421
|
-
innerHTML:
|
|
1422
|
-
}, null, 8,
|
|
1423
|
-
|
|
1424
|
-
], 8,
|
|
1426
|
+
innerHTML: C.icon
|
|
1427
|
+
}, null, 8, io),
|
|
1428
|
+
F("span", ro, be(C.label), 1)
|
|
1429
|
+
], 8, so))), 128))
|
|
1425
1430
|
], 6), [
|
|
1426
|
-
[it,
|
|
1431
|
+
[it, r.value]
|
|
1427
1432
|
])
|
|
1428
|
-
])) : (
|
|
1429
|
-
(
|
|
1430
|
-
key:
|
|
1433
|
+
])) : (y(), k("div", co, [
|
|
1434
|
+
(y(!0), k(me, null, Ce(v.value, (C) => (y(), k("button", {
|
|
1435
|
+
key: C.type,
|
|
1431
1436
|
type: "button",
|
|
1432
1437
|
class: "row-action-btn",
|
|
1433
|
-
title:
|
|
1434
|
-
"aria-label":
|
|
1435
|
-
onClick: Se((
|
|
1438
|
+
title: C.label,
|
|
1439
|
+
"aria-label": C.label,
|
|
1440
|
+
onClick: Se((b) => w(C.type, b), ["stop"])
|
|
1436
1441
|
}, [
|
|
1437
|
-
|
|
1442
|
+
F("span", {
|
|
1438
1443
|
class: "action-icon",
|
|
1439
|
-
innerHTML:
|
|
1440
|
-
}, null, 8,
|
|
1441
|
-
], 8,
|
|
1444
|
+
innerHTML: C.icon
|
|
1445
|
+
}, null, 8, fo)
|
|
1446
|
+
], 8, uo))), 128))
|
|
1442
1447
|
]))
|
|
1443
1448
|
], 2));
|
|
1444
1449
|
}
|
|
1445
|
-
}),
|
|
1450
|
+
}), vo = ["tabindex"], ho = /* @__PURE__ */ xe({
|
|
1446
1451
|
__name: "ARow",
|
|
1447
1452
|
props: {
|
|
1448
1453
|
rowIndex: {},
|
|
@@ -1450,70 +1455,74 @@ const Hn = (e) => {
|
|
|
1450
1455
|
tabIndex: { default: () => -1 },
|
|
1451
1456
|
addNavigation: { type: [Boolean, Object], default: !1 }
|
|
1452
1457
|
},
|
|
1453
|
-
emits: ["row:action"],
|
|
1458
|
+
emits: ["row:action", "row:click"],
|
|
1454
1459
|
setup(e, { emit: t }) {
|
|
1455
|
-
const n = t, l = ce("rowEl"), u =
|
|
1456
|
-
n("row:action",
|
|
1460
|
+
const n = t, l = ce("rowEl"), u = $(() => e.store.isRowVisible(e.rowIndex)), a = $(() => e.store.getRowExpandSymbol(e.rowIndex)), o = $(() => e.store.config.clickable ?? !1), r = $(() => e.store.config.rowActions || { enabled: !1 }), c = $(() => r.value.enabled), s = $(() => r.value.position || "before-index"), f = (x, I, P) => {
|
|
1461
|
+
n("row:action", x, I, P);
|
|
1462
|
+
}, v = (x) => {
|
|
1463
|
+
const I = x.target;
|
|
1464
|
+
I.closest(".atable-row-actions") || I.closest(".tree-index") || n("row:click", e.rowIndex, x);
|
|
1457
1465
|
};
|
|
1458
1466
|
if (e.addNavigation) {
|
|
1459
|
-
let
|
|
1460
|
-
typeof e.addNavigation == "object" && (
|
|
1461
|
-
...
|
|
1467
|
+
let x = qe;
|
|
1468
|
+
typeof e.addNavigation == "object" && (x = {
|
|
1469
|
+
...x,
|
|
1462
1470
|
...e.addNavigation
|
|
1463
1471
|
}), ft([
|
|
1464
1472
|
{
|
|
1465
1473
|
selectors: l,
|
|
1466
|
-
handlers:
|
|
1474
|
+
handlers: x
|
|
1467
1475
|
}
|
|
1468
1476
|
]);
|
|
1469
1477
|
}
|
|
1470
|
-
return (
|
|
1478
|
+
return (x, I) => de((y(), k("tr", {
|
|
1471
1479
|
ref: "rowEl",
|
|
1472
1480
|
tabindex: e.tabIndex,
|
|
1473
|
-
class: "atable-row"
|
|
1481
|
+
class: ae(["atable-row", { "atable-row-clickable": o.value }]),
|
|
1482
|
+
onClick: v
|
|
1474
1483
|
}, [
|
|
1475
|
-
c.value &&
|
|
1484
|
+
c.value && s.value === "before-index" ? (y(), he(Ue, {
|
|
1476
1485
|
key: 0,
|
|
1477
1486
|
"row-index": e.rowIndex,
|
|
1478
1487
|
store: e.store,
|
|
1479
|
-
config:
|
|
1480
|
-
position:
|
|
1481
|
-
onAction:
|
|
1488
|
+
config: r.value,
|
|
1489
|
+
position: s.value,
|
|
1490
|
+
onAction: f
|
|
1482
1491
|
}, null, 8, ["row-index", "store", "config", "position"])) : ee("", !0),
|
|
1483
|
-
e.store.config.view !== "uncounted" ? fe(
|
|
1484
|
-
e.store.config.view === "list" ? (
|
|
1492
|
+
e.store.config.view !== "uncounted" ? fe(x.$slots, "index", { key: 1 }, () => [
|
|
1493
|
+
e.store.config.view === "list" ? (y(), k("td", {
|
|
1485
1494
|
key: 0,
|
|
1486
1495
|
tabIndex: -1,
|
|
1487
|
-
class:
|
|
1488
|
-
}, be(e.rowIndex + 1), 3)) : e.store.isTreeView ? (
|
|
1496
|
+
class: ae(["list-index", e.store.hasPinnedColumns ? "sticky-index" : ""])
|
|
1497
|
+
}, be(e.rowIndex + 1), 3)) : e.store.isTreeView ? (y(), k("td", {
|
|
1489
1498
|
key: 1,
|
|
1490
1499
|
tabIndex: -1,
|
|
1491
|
-
class:
|
|
1492
|
-
onClick:
|
|
1500
|
+
class: ae(["tree-index", e.store.hasPinnedColumns ? "sticky-index" : ""]),
|
|
1501
|
+
onClick: I[0] || (I[0] = (P) => e.store.toggleRowExpand(e.rowIndex))
|
|
1493
1502
|
}, be(a.value), 3)) : ee("", !0)
|
|
1494
1503
|
], !0) : ee("", !0),
|
|
1495
|
-
c.value &&
|
|
1504
|
+
c.value && s.value === "after-index" ? (y(), he(Ue, {
|
|
1496
1505
|
key: 2,
|
|
1497
1506
|
"row-index": e.rowIndex,
|
|
1498
1507
|
store: e.store,
|
|
1499
|
-
config:
|
|
1500
|
-
position:
|
|
1501
|
-
onAction:
|
|
1508
|
+
config: r.value,
|
|
1509
|
+
position: s.value,
|
|
1510
|
+
onAction: f
|
|
1502
1511
|
}, null, 8, ["row-index", "store", "config", "position"])) : ee("", !0),
|
|
1503
|
-
fe(
|
|
1504
|
-
c.value &&
|
|
1512
|
+
fe(x.$slots, "default", {}, void 0, !0),
|
|
1513
|
+
c.value && s.value === "end" ? (y(), he(Ue, {
|
|
1505
1514
|
key: 3,
|
|
1506
1515
|
"row-index": e.rowIndex,
|
|
1507
1516
|
store: e.store,
|
|
1508
|
-
config:
|
|
1509
|
-
position:
|
|
1510
|
-
onAction:
|
|
1517
|
+
config: r.value,
|
|
1518
|
+
position: s.value,
|
|
1519
|
+
onAction: f
|
|
1511
1520
|
}, null, 8, ["row-index", "store", "config", "position"])) : ee("", !0)
|
|
1512
|
-
],
|
|
1521
|
+
], 10, vo)), [
|
|
1513
1522
|
[it, u.value]
|
|
1514
1523
|
]);
|
|
1515
1524
|
}
|
|
1516
|
-
}), Dt = /* @__PURE__ */ $e(
|
|
1525
|
+
}), Dt = /* @__PURE__ */ $e(ho, [["__scopeId", "data-v-533161af"]]), nt = /* @__PURE__ */ new WeakMap(), mo = {
|
|
1517
1526
|
mounted(e, t) {
|
|
1518
1527
|
const n = !t.modifiers.bubble;
|
|
1519
1528
|
let l;
|
|
@@ -1528,10 +1537,10 @@ const Hn = (e) => {
|
|
|
1528
1537
|
const t = nt.get(e);
|
|
1529
1538
|
t && typeof t == "function" ? t() : t?.stop(), nt.delete(e);
|
|
1530
1539
|
}
|
|
1531
|
-
},
|
|
1540
|
+
}, go = { mounted(e, t) {
|
|
1532
1541
|
typeof t.value == "function" ? Je(e, t.value) : Je(e, ...t.value);
|
|
1533
1542
|
} };
|
|
1534
|
-
function
|
|
1543
|
+
function wo() {
|
|
1535
1544
|
let e = !1;
|
|
1536
1545
|
const t = re(!1);
|
|
1537
1546
|
return (n, l) => {
|
|
@@ -1541,8 +1550,8 @@ function go() {
|
|
|
1541
1550
|
ue(t, (a) => u.value = a);
|
|
1542
1551
|
};
|
|
1543
1552
|
}
|
|
1544
|
-
|
|
1545
|
-
const
|
|
1553
|
+
wo();
|
|
1554
|
+
const po = { class: "gantt-connection-overlay" }, xo = {
|
|
1546
1555
|
class: "connection-svg",
|
|
1547
1556
|
style: {
|
|
1548
1557
|
position: "absolute",
|
|
@@ -1553,39 +1562,39 @@ const wo = { class: "gantt-connection-overlay" }, po = {
|
|
|
1553
1562
|
pointerEvents: "none",
|
|
1554
1563
|
zIndex: 1
|
|
1555
1564
|
}
|
|
1556
|
-
},
|
|
1565
|
+
}, yo = ["d", "stroke-width", "onDblclick"], bo = ["id", "d", "stroke", "stroke-width", "onDblclick"], Co = 0.25, Ge = 16, ko = /* @__PURE__ */ xe({
|
|
1557
1566
|
__name: "AGanttConnection",
|
|
1558
1567
|
props: {
|
|
1559
1568
|
store: {}
|
|
1560
1569
|
},
|
|
1561
1570
|
emits: ["connection:delete"],
|
|
1562
1571
|
setup(e, { emit: t }) {
|
|
1563
|
-
const n = t, l =
|
|
1564
|
-
const
|
|
1565
|
-
return
|
|
1572
|
+
const n = t, l = $(() => e.store.connectionPaths.filter((o) => {
|
|
1573
|
+
const r = e.store.ganttBars.find((s) => s.id === o.from.barId), c = e.store.ganttBars.find((s) => s.id === o.to.barId);
|
|
1574
|
+
return r && c;
|
|
1566
1575
|
})), u = (o) => {
|
|
1567
|
-
const
|
|
1576
|
+
const r = e.store.connectionHandles.find(
|
|
1568
1577
|
(j) => j.barId === o.from.barId && j.side === o.from.side
|
|
1569
|
-
),
|
|
1578
|
+
), c = e.store.connectionHandles.find(
|
|
1570
1579
|
(j) => j.barId === o.to.barId && j.side === o.to.side
|
|
1571
1580
|
);
|
|
1572
|
-
if (!
|
|
1573
|
-
const s =
|
|
1574
|
-
return `M ${s} ${
|
|
1581
|
+
if (!r || !c) return "";
|
|
1582
|
+
const s = r.position.x + Ge / 2, f = r.position.y + Ge / 2, v = c.position.x + Ge / 2, x = c.position.y + Ge / 2, I = Math.abs(v - s), P = Math.max(I * Co, 50), R = s + (o.from.side === "left" ? -P : P), w = v + (o.to.side === "left" ? -P : P), h = { x: 0.5 * s + 0.5 * R, y: 0.5 * f + 0.5 * f }, m = { x: 0.5 * R + 0.5 * w, y: 0.5 * f + 0.5 * x }, C = { x: 0.5 * w + 0.5 * v, y: 0.5 * x + 0.5 * x }, b = { x: 0.5 * h.x + 0.5 * m.x, y: 0.5 * h.y + 0.5 * m.y }, p = { x: 0.5 * m.x + 0.5 * C.x, y: 0.5 * m.y + 0.5 * C.y }, O = { x: 0.5 * b.x + 0.5 * p.x, y: 0.5 * b.y + 0.5 * p.y };
|
|
1583
|
+
return `M ${s} ${f} Q ${R} ${f}, ${O.x} ${O.y} Q ${w} ${x}, ${v} ${x}`;
|
|
1575
1584
|
}, a = (o) => {
|
|
1576
1585
|
e.store.deleteConnection(o.id) && n("connection:delete", o);
|
|
1577
1586
|
};
|
|
1578
|
-
return (o,
|
|
1579
|
-
(
|
|
1580
|
-
|
|
1581
|
-
|
|
1587
|
+
return (o, r) => (y(), k("div", po, [
|
|
1588
|
+
(y(), k("svg", xo, [
|
|
1589
|
+
r[0] || (r[0] = F("defs", null, [
|
|
1590
|
+
F("path", {
|
|
1582
1591
|
id: "arrowhead",
|
|
1583
1592
|
d: "M 0 -7 L 20 0 L 0 7Z",
|
|
1584
1593
|
stroke: "black",
|
|
1585
1594
|
"stroke-width": "1",
|
|
1586
1595
|
fill: "currentColor"
|
|
1587
1596
|
}),
|
|
1588
|
-
|
|
1597
|
+
F("marker", {
|
|
1589
1598
|
id: "arrowhead-marker",
|
|
1590
1599
|
markerWidth: "10",
|
|
1591
1600
|
markerHeight: "7",
|
|
@@ -1594,39 +1603,39 @@ const wo = { class: "gantt-connection-overlay" }, po = {
|
|
|
1594
1603
|
orient: "auto",
|
|
1595
1604
|
markerUnits: "strokeWidth"
|
|
1596
1605
|
}, [
|
|
1597
|
-
|
|
1606
|
+
F("polygon", {
|
|
1598
1607
|
points: "0 0, 10 3.5, 0 7",
|
|
1599
1608
|
fill: "currentColor"
|
|
1600
1609
|
})
|
|
1601
1610
|
])
|
|
1602
1611
|
], -1)),
|
|
1603
|
-
(
|
|
1604
|
-
key: `${
|
|
1605
|
-
d: u(
|
|
1612
|
+
(y(!0), k(me, null, Ce(l.value, (c) => (y(), k("path", {
|
|
1613
|
+
key: `${c.id}-hitbox`,
|
|
1614
|
+
d: u(c),
|
|
1606
1615
|
stroke: "transparent",
|
|
1607
|
-
"stroke-width": (
|
|
1616
|
+
"stroke-width": (c.style?.width || 2) + 10,
|
|
1608
1617
|
fill: "none",
|
|
1609
1618
|
class: "connection-hitbox",
|
|
1610
|
-
onDblclick: (s) => a(
|
|
1611
|
-
}, null, 40,
|
|
1612
|
-
(
|
|
1613
|
-
id:
|
|
1614
|
-
key:
|
|
1615
|
-
d: u(
|
|
1616
|
-
stroke:
|
|
1617
|
-
"stroke-width":
|
|
1619
|
+
onDblclick: (s) => a(c)
|
|
1620
|
+
}, null, 40, yo))), 128)),
|
|
1621
|
+
(y(!0), k(me, null, Ce(l.value, (c) => (y(), k("path", {
|
|
1622
|
+
id: c.id,
|
|
1623
|
+
key: c.id,
|
|
1624
|
+
d: u(c),
|
|
1625
|
+
stroke: c.style?.color || "#666",
|
|
1626
|
+
"stroke-width": c.style?.width || 2,
|
|
1618
1627
|
fill: "none",
|
|
1619
1628
|
"marker-mid": "url(#arrowhead-marker)",
|
|
1620
1629
|
class: "connection-path animated-path",
|
|
1621
|
-
onDblclick: (s) => a(
|
|
1622
|
-
}, null, 40,
|
|
1630
|
+
onDblclick: (s) => a(c)
|
|
1631
|
+
}, null, 40, bo))), 128))
|
|
1623
1632
|
]))
|
|
1624
1633
|
]));
|
|
1625
1634
|
}
|
|
1626
|
-
}), Mo = /* @__PURE__ */ $e(
|
|
1635
|
+
}), Mo = /* @__PURE__ */ $e(ko, [["__scopeId", "data-v-d5929c98"]]), Ro = { class: "column-filter" }, Eo = {
|
|
1627
1636
|
key: 2,
|
|
1628
1637
|
class: "checkbox-filter"
|
|
1629
|
-
},
|
|
1638
|
+
}, $o = ["value"], To = {
|
|
1630
1639
|
key: 5,
|
|
1631
1640
|
class: "date-range-filter"
|
|
1632
1641
|
}, Io = /* @__PURE__ */ xe({
|
|
@@ -1640,7 +1649,7 @@ const wo = { class: "gantt-connection-overlay" }, po = {
|
|
|
1640
1649
|
const t = z(""), n = jt({
|
|
1641
1650
|
startValue: "",
|
|
1642
1651
|
endValue: ""
|
|
1643
|
-
}), l =
|
|
1652
|
+
}), l = $(() => {
|
|
1644
1653
|
if (e.column.filterType) return e.column.filterType;
|
|
1645
1654
|
switch (e.column.fieldtype) {
|
|
1646
1655
|
case "Check":
|
|
@@ -1662,123 +1671,123 @@ const wo = { class: "gantt-connection-overlay" }, po = {
|
|
|
1662
1671
|
}
|
|
1663
1672
|
}), u = (s) => {
|
|
1664
1673
|
if (s.filterOptions) return s.filterOptions;
|
|
1665
|
-
const
|
|
1674
|
+
const f = /* @__PURE__ */ new Set();
|
|
1666
1675
|
return e.store.rows.forEach((v) => {
|
|
1667
|
-
const
|
|
1668
|
-
|
|
1669
|
-
}), Array.from(
|
|
1676
|
+
const x = v[s.name];
|
|
1677
|
+
x != null && x !== "" && f.add(x);
|
|
1678
|
+
}), Array.from(f).map((v) => ({
|
|
1670
1679
|
value: v,
|
|
1671
1680
|
label: String(v)
|
|
1672
1681
|
}));
|
|
1673
|
-
}, a =
|
|
1682
|
+
}, a = $(() => !!(t.value || n.startValue || n.endValue)), o = (s) => {
|
|
1674
1683
|
!s && l.value !== "checkbox" ? (e.store.clearFilter(e.colIndex), t.value = "") : (t.value = s, e.store.setFilter(e.colIndex, { value: s }));
|
|
1675
|
-
},
|
|
1676
|
-
s === "start" ? n.startValue =
|
|
1684
|
+
}, r = (s, f) => {
|
|
1685
|
+
s === "start" ? n.startValue = f : n.endValue = f, !n.startValue && !n.endValue ? e.store.clearFilter(e.colIndex) : e.store.setFilter(e.colIndex, {
|
|
1677
1686
|
value: null,
|
|
1678
1687
|
startValue: n.startValue,
|
|
1679
1688
|
endValue: n.endValue
|
|
1680
1689
|
});
|
|
1681
|
-
},
|
|
1690
|
+
}, c = () => {
|
|
1682
1691
|
t.value = "", n.startValue = "", n.endValue = "", e.store.clearFilter(e.colIndex);
|
|
1683
1692
|
};
|
|
1684
|
-
return (s,
|
|
1685
|
-
l.value === "text" ? de((
|
|
1693
|
+
return (s, f) => (y(), k("div", Ro, [
|
|
1694
|
+
l.value === "text" ? de((y(), k("input", {
|
|
1686
1695
|
key: 0,
|
|
1687
|
-
"onUpdate:modelValue":
|
|
1696
|
+
"onUpdate:modelValue": f[0] || (f[0] = (v) => t.value = v),
|
|
1688
1697
|
type: "text",
|
|
1689
1698
|
class: "filter-input",
|
|
1690
|
-
onInput:
|
|
1699
|
+
onInput: f[1] || (f[1] = (v) => o(t.value))
|
|
1691
1700
|
}, null, 544)), [
|
|
1692
1701
|
[Ze, t.value]
|
|
1693
|
-
]) : l.value === "number" ? de((
|
|
1702
|
+
]) : l.value === "number" ? de((y(), k("input", {
|
|
1694
1703
|
key: 1,
|
|
1695
|
-
"onUpdate:modelValue":
|
|
1704
|
+
"onUpdate:modelValue": f[2] || (f[2] = (v) => t.value = v),
|
|
1696
1705
|
type: "number",
|
|
1697
1706
|
class: "filter-input",
|
|
1698
|
-
onInput:
|
|
1707
|
+
onInput: f[3] || (f[3] = (v) => o(t.value))
|
|
1699
1708
|
}, null, 544)), [
|
|
1700
1709
|
[Ze, t.value]
|
|
1701
|
-
]) : l.value === "checkbox" ? (
|
|
1702
|
-
de(
|
|
1703
|
-
"onUpdate:modelValue":
|
|
1710
|
+
]) : l.value === "checkbox" ? (y(), k("label", Eo, [
|
|
1711
|
+
de(F("input", {
|
|
1712
|
+
"onUpdate:modelValue": f[4] || (f[4] = (v) => t.value = v),
|
|
1704
1713
|
type: "checkbox",
|
|
1705
1714
|
class: "filter-checkbox",
|
|
1706
|
-
onChange:
|
|
1715
|
+
onChange: f[5] || (f[5] = (v) => o(t.value))
|
|
1707
1716
|
}, null, 544), [
|
|
1708
1717
|
[Yt, t.value]
|
|
1709
1718
|
]),
|
|
1710
|
-
|
|
1711
|
-
])) : l.value === "select" ? de((
|
|
1719
|
+
F("span", null, be(e.column.label), 1)
|
|
1720
|
+
])) : l.value === "select" ? de((y(), k("select", {
|
|
1712
1721
|
key: 3,
|
|
1713
|
-
"onUpdate:modelValue":
|
|
1722
|
+
"onUpdate:modelValue": f[6] || (f[6] = (v) => t.value = v),
|
|
1714
1723
|
class: "filter-select",
|
|
1715
|
-
onChange:
|
|
1724
|
+
onChange: f[7] || (f[7] = (v) => o(t.value))
|
|
1716
1725
|
}, [
|
|
1717
|
-
|
|
1718
|
-
(
|
|
1726
|
+
f[15] || (f[15] = F("option", { value: "" }, "All", -1)),
|
|
1727
|
+
(y(!0), k(me, null, Ce(u(e.column), (v) => (y(), k("option", {
|
|
1719
1728
|
key: v.value || v,
|
|
1720
1729
|
value: v.value || v
|
|
1721
|
-
}, be(v.label || v), 9,
|
|
1730
|
+
}, be(v.label || v), 9, $o))), 128))
|
|
1722
1731
|
], 544)), [
|
|
1723
1732
|
[Ut, t.value]
|
|
1724
|
-
]) : l.value === "date" ? de((
|
|
1733
|
+
]) : l.value === "date" ? de((y(), k("input", {
|
|
1725
1734
|
key: 4,
|
|
1726
|
-
"onUpdate:modelValue":
|
|
1735
|
+
"onUpdate:modelValue": f[8] || (f[8] = (v) => t.value = v),
|
|
1727
1736
|
type: "date",
|
|
1728
1737
|
class: "filter-input",
|
|
1729
|
-
onChange:
|
|
1738
|
+
onChange: f[9] || (f[9] = (v) => o(t.value))
|
|
1730
1739
|
}, null, 544)), [
|
|
1731
1740
|
[Ze, t.value]
|
|
1732
|
-
]) : l.value === "dateRange" ? (
|
|
1733
|
-
de(
|
|
1734
|
-
"onUpdate:modelValue":
|
|
1741
|
+
]) : l.value === "dateRange" ? (y(), k("div", To, [
|
|
1742
|
+
de(F("input", {
|
|
1743
|
+
"onUpdate:modelValue": f[10] || (f[10] = (v) => n.startValue = v),
|
|
1735
1744
|
type: "date",
|
|
1736
1745
|
class: "filter-input",
|
|
1737
|
-
onChange:
|
|
1746
|
+
onChange: f[11] || (f[11] = (v) => r("start", n.startValue))
|
|
1738
1747
|
}, null, 544), [
|
|
1739
1748
|
[Ze, n.startValue]
|
|
1740
1749
|
]),
|
|
1741
|
-
|
|
1742
|
-
de(
|
|
1743
|
-
"onUpdate:modelValue":
|
|
1750
|
+
f[16] || (f[16] = F("span", { class: "date-separator" }, "-", -1)),
|
|
1751
|
+
de(F("input", {
|
|
1752
|
+
"onUpdate:modelValue": f[12] || (f[12] = (v) => n.endValue = v),
|
|
1744
1753
|
type: "date",
|
|
1745
1754
|
class: "filter-input",
|
|
1746
|
-
onChange:
|
|
1755
|
+
onChange: f[13] || (f[13] = (v) => r("end", n.endValue))
|
|
1747
1756
|
}, null, 544), [
|
|
1748
1757
|
[Ze, n.endValue]
|
|
1749
1758
|
])
|
|
1750
|
-
])) : l.value === "component" && e.column.filterComponent ? (
|
|
1759
|
+
])) : l.value === "component" && e.column.filterComponent ? (y(), he(Ne(e.column.filterComponent), {
|
|
1751
1760
|
key: 6,
|
|
1752
1761
|
value: t.value,
|
|
1753
1762
|
column: e.column,
|
|
1754
1763
|
"col-index": e.colIndex,
|
|
1755
1764
|
store: e.store,
|
|
1756
|
-
"onUpdate:value":
|
|
1765
|
+
"onUpdate:value": f[14] || (f[14] = (v) => o(v))
|
|
1757
1766
|
}, null, 40, ["value", "column", "col-index", "store"])) : ee("", !0),
|
|
1758
|
-
a.value ? (
|
|
1767
|
+
a.value ? (y(), k("button", {
|
|
1759
1768
|
key: 7,
|
|
1760
1769
|
class: "clear-btn",
|
|
1761
1770
|
title: "Clear",
|
|
1762
|
-
onClick:
|
|
1771
|
+
onClick: c
|
|
1763
1772
|
}, "×")) : ee("", !0)
|
|
1764
1773
|
]));
|
|
1765
1774
|
}
|
|
1766
|
-
}),
|
|
1775
|
+
}), So = /* @__PURE__ */ $e(Io, [["__scopeId", "data-v-e0efa4a9"]]), Ao = { key: 0 }, Ho = {
|
|
1767
1776
|
class: "atable-header-row",
|
|
1768
1777
|
tabindex: "-1"
|
|
1769
|
-
},
|
|
1778
|
+
}, Lo = {
|
|
1770
1779
|
key: 2,
|
|
1771
1780
|
class: "row-actions-header"
|
|
1772
|
-
},
|
|
1781
|
+
}, Do = ["data-colindex", "onClick"], Oo = {
|
|
1773
1782
|
key: 3,
|
|
1774
1783
|
class: "row-actions-header"
|
|
1775
|
-
},
|
|
1784
|
+
}, Vo = {
|
|
1776
1785
|
key: 0,
|
|
1777
1786
|
class: "atable-filters-row"
|
|
1778
|
-
},
|
|
1787
|
+
}, Bo = {
|
|
1779
1788
|
key: 2,
|
|
1780
1789
|
class: "row-actions-header"
|
|
1781
|
-
},
|
|
1790
|
+
}, Po = {
|
|
1782
1791
|
key: 3,
|
|
1783
1792
|
class: "row-actions-header"
|
|
1784
1793
|
}, Ot = /* @__PURE__ */ xe({
|
|
@@ -1788,72 +1797,72 @@ const wo = { class: "gantt-connection-overlay" }, po = {
|
|
|
1788
1797
|
store: {}
|
|
1789
1798
|
},
|
|
1790
1799
|
setup(e) {
|
|
1791
|
-
const t =
|
|
1792
|
-
for (const
|
|
1793
|
-
if (
|
|
1794
|
-
const s =
|
|
1795
|
-
typeof v == "number" && v !== s && e.store.resizeColumn(
|
|
1800
|
+
const t = $(() => e.columns.filter((o) => o.filterable)), n = $(() => e.store.config.rowActions?.enabled ?? !1), l = $(() => e.store.config.rowActions?.position ?? "before-index"), u = (o) => e.store.sortByColumn(o), a = (o) => {
|
|
1801
|
+
for (const r of o) {
|
|
1802
|
+
if (r.borderBoxSize.length === 0) continue;
|
|
1803
|
+
const s = r.borderBoxSize[0].inlineSize, f = Number(r.target.dataset.colindex), v = e.store.columns[f]?.width;
|
|
1804
|
+
typeof v == "number" && v !== s && e.store.resizeColumn(f, s);
|
|
1796
1805
|
}
|
|
1797
1806
|
};
|
|
1798
|
-
return (o,
|
|
1799
|
-
|
|
1800
|
-
n.value && l.value === "before-index" ? (
|
|
1807
|
+
return (o, r) => e.columns.length ? (y(), k("thead", Ao, [
|
|
1808
|
+
F("tr", Ho, [
|
|
1809
|
+
n.value && l.value === "before-index" ? (y(), k("th", {
|
|
1801
1810
|
key: 0,
|
|
1802
|
-
class:
|
|
1811
|
+
class: ae(["row-actions-header", { "sticky-column": l.value === "before-index" }])
|
|
1803
1812
|
}, null, 2)) : ee("", !0),
|
|
1804
|
-
e.store.zeroColumn ? (
|
|
1813
|
+
e.store.zeroColumn ? (y(), k("th", {
|
|
1805
1814
|
key: 1,
|
|
1806
1815
|
id: "header-index",
|
|
1807
|
-
class:
|
|
1816
|
+
class: ae([[
|
|
1808
1817
|
e.store.hasPinnedColumns ? "sticky-index" : "",
|
|
1809
1818
|
e.store.isTreeView ? "tree-index" : "",
|
|
1810
1819
|
e.store.config.view === "list-expansion" ? "list-expansion-index" : ""
|
|
1811
1820
|
], "list-index"])
|
|
1812
1821
|
}, null, 2)) : ee("", !0),
|
|
1813
|
-
n.value && l.value === "after-index" ? (
|
|
1814
|
-
(
|
|
1815
|
-
key:
|
|
1822
|
+
n.value && l.value === "after-index" ? (y(), k("th", Lo)) : ee("", !0),
|
|
1823
|
+
(y(!0), k(me, null, Ce(e.columns, (c, s) => de((y(), k("th", {
|
|
1824
|
+
key: c.name,
|
|
1816
1825
|
"data-colindex": s,
|
|
1817
1826
|
tabindex: "-1",
|
|
1818
|
-
style: pe(e.store.getHeaderCellStyle(
|
|
1819
|
-
class:
|
|
1820
|
-
onClick: (
|
|
1827
|
+
style: pe(e.store.getHeaderCellStyle(c)),
|
|
1828
|
+
class: ae(`${c.pinned ? "sticky-column" : ""} ${c.sortable === !1 ? "" : "cursor-pointer"}`),
|
|
1829
|
+
onClick: (f) => c.sortable !== !1 ? u(s) : void 0
|
|
1821
1830
|
}, [
|
|
1822
1831
|
fe(o.$slots, "default", {}, () => [
|
|
1823
|
-
Jt(be(
|
|
1832
|
+
Jt(be(c.label || String.fromCharCode(s + 97).toUpperCase()), 1)
|
|
1824
1833
|
])
|
|
1825
|
-
], 14,
|
|
1826
|
-
[
|
|
1834
|
+
], 14, Do)), [
|
|
1835
|
+
[B(go), a]
|
|
1827
1836
|
])), 128)),
|
|
1828
|
-
n.value && l.value === "end" ? (
|
|
1837
|
+
n.value && l.value === "end" ? (y(), k("th", Oo)) : ee("", !0)
|
|
1829
1838
|
]),
|
|
1830
|
-
t.value.length > 0 ? (
|
|
1831
|
-
n.value && l.value === "before-index" ? (
|
|
1839
|
+
t.value.length > 0 ? (y(), k("tr", Vo, [
|
|
1840
|
+
n.value && l.value === "before-index" ? (y(), k("th", {
|
|
1832
1841
|
key: 0,
|
|
1833
|
-
class:
|
|
1842
|
+
class: ae(["row-actions-header", { "sticky-column": l.value === "before-index" }])
|
|
1834
1843
|
}, null, 2)) : ee("", !0),
|
|
1835
|
-
e.store.zeroColumn ? (
|
|
1844
|
+
e.store.zeroColumn ? (y(), k("th", {
|
|
1836
1845
|
key: 1,
|
|
1837
|
-
class:
|
|
1846
|
+
class: ae([[
|
|
1838
1847
|
e.store.hasPinnedColumns ? "sticky-index" : "",
|
|
1839
1848
|
e.store.isTreeView ? "tree-index" : "",
|
|
1840
1849
|
e.store.config.view === "list-expansion" ? "list-expansion-index" : ""
|
|
1841
1850
|
], "list-index"])
|
|
1842
1851
|
}, null, 2)) : ee("", !0),
|
|
1843
|
-
n.value && l.value === "after-index" ? (
|
|
1844
|
-
(
|
|
1845
|
-
key: `filter-${
|
|
1846
|
-
class:
|
|
1847
|
-
style: pe(e.store.getHeaderCellStyle(
|
|
1852
|
+
n.value && l.value === "after-index" ? (y(), k("th", Bo)) : ee("", !0),
|
|
1853
|
+
(y(!0), k(me, null, Ce(e.columns, (c, s) => (y(), k("th", {
|
|
1854
|
+
key: `filter-${c.name}`,
|
|
1855
|
+
class: ae(`${c.pinned ? "sticky-column" : ""}`),
|
|
1856
|
+
style: pe(e.store.getHeaderCellStyle(c))
|
|
1848
1857
|
}, [
|
|
1849
|
-
|
|
1858
|
+
c.filterable ? (y(), he(So, {
|
|
1850
1859
|
key: 0,
|
|
1851
|
-
column:
|
|
1860
|
+
column: c,
|
|
1852
1861
|
"col-index": s,
|
|
1853
1862
|
store: e.store
|
|
1854
1863
|
}, null, 8, ["column", "col-index", "store"])) : ee("", !0)
|
|
1855
1864
|
], 6))), 128)),
|
|
1856
|
-
n.value && l.value === "end" ? (
|
|
1865
|
+
n.value && l.value === "end" ? (y(), k("th", Po)) : ee("", !0)
|
|
1857
1866
|
])) : ee("", !0)
|
|
1858
1867
|
])) : ee("", !0);
|
|
1859
1868
|
}
|
|
@@ -1863,21 +1872,21 @@ const wo = { class: "gantt-connection-overlay" }, po = {
|
|
|
1863
1872
|
store: {}
|
|
1864
1873
|
},
|
|
1865
1874
|
setup(e) {
|
|
1866
|
-
const t = ce("amodal"), { width: n, height: l } =
|
|
1875
|
+
const t = ce("amodal"), { width: n, height: l } = Te(t), u = $(() => {
|
|
1867
1876
|
if (!(e.store.modal.height && e.store.modal.width && e.store.modal.left && e.store.modal.bottom)) return {};
|
|
1868
1877
|
const a = e.store.modal.cell?.closest("table");
|
|
1869
1878
|
if (!a) return {};
|
|
1870
|
-
const o = a.offsetHeight || 0,
|
|
1871
|
-
let
|
|
1879
|
+
const o = a.offsetHeight || 0, r = a.offsetWidth || 0;
|
|
1880
|
+
let c = e.store.modal.cell?.offsetTop || 0;
|
|
1872
1881
|
const s = a.querySelector("thead")?.offsetHeight || 0;
|
|
1873
|
-
|
|
1874
|
-
let
|
|
1875
|
-
return
|
|
1876
|
-
left: `${
|
|
1877
|
-
top: `${
|
|
1882
|
+
c += s, c = c + l.value < o ? c : c - (l.value + e.store.modal.height);
|
|
1883
|
+
let f = e.store.modal.cell?.offsetLeft || 0;
|
|
1884
|
+
return f = f + n.value <= r ? f : f - (n.value - e.store.modal.width), {
|
|
1885
|
+
left: `${f}px`,
|
|
1886
|
+
top: `${c}px`
|
|
1878
1887
|
};
|
|
1879
1888
|
});
|
|
1880
|
-
return (a, o) => (
|
|
1889
|
+
return (a, o) => (y(), k("div", {
|
|
1881
1890
|
ref: "amodal",
|
|
1882
1891
|
class: "amodal",
|
|
1883
1892
|
tabindex: "-1",
|
|
@@ -1898,7 +1907,7 @@ function Bt(e, t) {
|
|
|
1898
1907
|
const l = n.parent;
|
|
1899
1908
|
return l < 0 || l >= t.length ? !1 : (t[l].childrenOpen || !1) && Bt(l, t);
|
|
1900
1909
|
}
|
|
1901
|
-
function
|
|
1910
|
+
function Zo(e, t, n) {
|
|
1902
1911
|
const l = n.filterType || "text", u = t.value;
|
|
1903
1912
|
if (!u && l !== "dateRange" && l !== "checkbox") return !0;
|
|
1904
1913
|
switch (l) {
|
|
@@ -1915,8 +1924,8 @@ function Po(e, t, n) {
|
|
|
1915
1924
|
case "date": {
|
|
1916
1925
|
let a;
|
|
1917
1926
|
if (typeof e == "number") {
|
|
1918
|
-
const
|
|
1919
|
-
a = new Date(
|
|
1927
|
+
const r = new Date(e), c = (/* @__PURE__ */ new Date()).getFullYear();
|
|
1928
|
+
a = new Date(c, r.getMonth(), r.getDate());
|
|
1920
1929
|
} else
|
|
1921
1930
|
a = new Date(String(e));
|
|
1922
1931
|
const o = new Date(String(u));
|
|
@@ -1925,44 +1934,44 @@ function Po(e, t, n) {
|
|
|
1925
1934
|
case "dateRange": {
|
|
1926
1935
|
const a = t.startValue, o = t.endValue;
|
|
1927
1936
|
if (!a && !o) return !0;
|
|
1928
|
-
let
|
|
1937
|
+
let r;
|
|
1929
1938
|
if (typeof e == "number") {
|
|
1930
|
-
const
|
|
1931
|
-
|
|
1939
|
+
const c = new Date(e), s = (/* @__PURE__ */ new Date()).getFullYear();
|
|
1940
|
+
r = new Date(s, c.getMonth(), c.getDate());
|
|
1932
1941
|
} else
|
|
1933
|
-
|
|
1934
|
-
return !(a &&
|
|
1942
|
+
r = new Date(String(e));
|
|
1943
|
+
return !(a && r < new Date(String(a)) || o && r > new Date(String(o)));
|
|
1935
1944
|
}
|
|
1936
1945
|
default:
|
|
1937
1946
|
return !0;
|
|
1938
1947
|
}
|
|
1939
1948
|
}
|
|
1940
|
-
function
|
|
1949
|
+
function No(e, t) {
|
|
1941
1950
|
return t && e === 0 && t > 0 ? `${t}ch` : "inherit";
|
|
1942
1951
|
}
|
|
1943
|
-
const
|
|
1952
|
+
const Fo = (e) => {
|
|
1944
1953
|
const t = e.id || Ln(), n = e.linkResolver ?? null;
|
|
1945
1954
|
return Qt(`table-${t}`, () => {
|
|
1946
1955
|
const u = () => {
|
|
1947
|
-
const i = [Object.assign({}, { rowModified: !1 })],
|
|
1948
|
-
for (let
|
|
1949
|
-
const
|
|
1950
|
-
|
|
1956
|
+
const i = [Object.assign({}, { rowModified: !1 })], d = /* @__PURE__ */ new Set();
|
|
1957
|
+
for (let D = 0; D < o.value.length; D++) {
|
|
1958
|
+
const A = o.value[D];
|
|
1959
|
+
A.parent !== null && A.parent !== void 0 && d.add(A.parent);
|
|
1951
1960
|
}
|
|
1952
|
-
const
|
|
1953
|
-
for (let
|
|
1954
|
-
if (o.value[
|
|
1961
|
+
const g = (D) => o.value[D]?.gantt !== void 0, S = (D) => {
|
|
1962
|
+
for (let A = 0; A < o.value.length; A++)
|
|
1963
|
+
if (o.value[A].parent === D && (g(A) || S(A)))
|
|
1955
1964
|
return !0;
|
|
1956
1965
|
return !1;
|
|
1957
|
-
}, J = (
|
|
1958
|
-
const
|
|
1966
|
+
}, J = (D) => {
|
|
1967
|
+
const A = r.value, U = A.view === "tree" || A.view === "tree-gantt" ? A.defaultTreeExpansion : void 0;
|
|
1959
1968
|
if (!U) return !0;
|
|
1960
1969
|
switch (U) {
|
|
1961
1970
|
case "root":
|
|
1962
1971
|
return !1;
|
|
1963
1972
|
// Only root nodes are visible, all children start collapsed
|
|
1964
1973
|
case "branch":
|
|
1965
|
-
return
|
|
1974
|
+
return S(D);
|
|
1966
1975
|
case "leaf":
|
|
1967
1976
|
return !0;
|
|
1968
1977
|
// All nodes should be expanded
|
|
@@ -1970,287 +1979,287 @@ const No = (e) => {
|
|
|
1970
1979
|
return !0;
|
|
1971
1980
|
}
|
|
1972
1981
|
};
|
|
1973
|
-
for (let
|
|
1974
|
-
const
|
|
1975
|
-
i[
|
|
1976
|
-
childrenOpen: J(
|
|
1982
|
+
for (let D = 0; D < o.value.length; D++) {
|
|
1983
|
+
const A = o.value[D], U = A.parent === null || A.parent === void 0, ie = d.has(D);
|
|
1984
|
+
i[D] = {
|
|
1985
|
+
childrenOpen: J(D),
|
|
1977
1986
|
expanded: !1,
|
|
1978
|
-
indent:
|
|
1987
|
+
indent: A.indent || 0,
|
|
1979
1988
|
isParent: ie,
|
|
1980
1989
|
isRoot: U,
|
|
1981
1990
|
rowModified: !1,
|
|
1982
1991
|
open: U,
|
|
1983
1992
|
// This will be recalculated later for non-root nodes
|
|
1984
|
-
parent:
|
|
1993
|
+
parent: A.parent
|
|
1985
1994
|
};
|
|
1986
1995
|
}
|
|
1987
1996
|
return i;
|
|
1988
|
-
}, a = z(e.columns), o = z(e.rows),
|
|
1997
|
+
}, a = z(e.columns), o = z(e.rows), r = z(e.config || {}), c = z({}), s = z({}), f = $(() => {
|
|
1989
1998
|
const i = {};
|
|
1990
|
-
for (const [
|
|
1991
|
-
for (const [
|
|
1992
|
-
i[`${
|
|
1999
|
+
for (const [d, g] of a.value.entries())
|
|
2000
|
+
for (const [S, J] of o.value.entries())
|
|
2001
|
+
i[`${d}:${S}`] = J[g.name];
|
|
1993
2002
|
return i;
|
|
1994
|
-
}), v =
|
|
2003
|
+
}), v = $({
|
|
1995
2004
|
get: () => {
|
|
1996
2005
|
const i = u();
|
|
1997
|
-
for (let
|
|
1998
|
-
|
|
1999
|
-
if (
|
|
2000
|
-
for (let
|
|
2001
|
-
i[
|
|
2006
|
+
for (let d = 0; d < i.length; d++)
|
|
2007
|
+
c.value[d] && (i[d].rowModified = c.value[d]), s.value[d] && (s.value[d].childrenOpen !== void 0 && (i[d].childrenOpen = s.value[d].childrenOpen), s.value[d].expanded !== void 0 && (i[d].expanded = s.value[d].expanded));
|
|
2008
|
+
if (p.value)
|
|
2009
|
+
for (let d = 0; d < i.length; d++)
|
|
2010
|
+
i[d].isRoot || (i[d].open = Bt(d, i));
|
|
2002
2011
|
return i;
|
|
2003
2012
|
},
|
|
2004
2013
|
set: (i) => {
|
|
2005
2014
|
JSON.stringify(i) !== JSON.stringify(v.value) && (v.value = i);
|
|
2006
2015
|
}
|
|
2007
|
-
}),
|
|
2016
|
+
}), x = z(e.modal || { visible: !1 }), I = z({}), P = z([]), R = z([]), w = z([]), h = z({
|
|
2008
2017
|
column: null,
|
|
2009
2018
|
direction: null
|
|
2010
|
-
}),
|
|
2011
|
-
const i =
|
|
2019
|
+
}), m = z({}), C = $(() => a.value.some((i) => i.pinned)), b = $(() => r.value.view === "gantt" || r.value.view === "tree-gantt"), p = $(() => r.value.view === "tree" || r.value.view === "tree-gantt"), O = $(() => {
|
|
2020
|
+
const i = r.value;
|
|
2012
2021
|
return i.view === "gantt" || i.view === "tree-gantt" ? i.dependencyGraph !== !1 : !0;
|
|
2013
|
-
}), j =
|
|
2014
|
-
() =>
|
|
2015
|
-
),
|
|
2016
|
-
let i = o.value.map((
|
|
2017
|
-
...
|
|
2018
|
-
originalIndex:
|
|
2022
|
+
}), j = $(() => `${Math.ceil(o.value.length / 100 + 1)}ch`), E = $(
|
|
2023
|
+
() => r.value.view ? ["list", "tree", "tree-gantt", "list-expansion"].includes(r.value.view) : !1
|
|
2024
|
+
), Z = $(() => {
|
|
2025
|
+
let i = o.value.map((d, g) => ({
|
|
2026
|
+
...d,
|
|
2027
|
+
originalIndex: g
|
|
2019
2028
|
}));
|
|
2020
|
-
if (Object.entries(
|
|
2021
|
-
const
|
|
2022
|
-
!J || !(
|
|
2023
|
-
const U =
|
|
2024
|
-
return
|
|
2029
|
+
if (Object.entries(m.value).forEach(([d, g]) => {
|
|
2030
|
+
const S = parseInt(d), J = a.value[S];
|
|
2031
|
+
!J || !(g.value || g.startValue || g.endValue || J.filterType === "checkbox" && g.value !== void 0) || (i = i.filter((A) => {
|
|
2032
|
+
const U = A[J.name];
|
|
2033
|
+
return Zo(U, g, J);
|
|
2025
2034
|
}));
|
|
2026
|
-
}),
|
|
2027
|
-
const
|
|
2028
|
-
i.sort((
|
|
2029
|
-
let
|
|
2030
|
-
|
|
2031
|
-
const U = Number(
|
|
2032
|
-
if (!isNaN(U) && !isNaN(ie) &&
|
|
2033
|
-
return
|
|
2035
|
+
}), h.value.column !== null && h.value.direction) {
|
|
2036
|
+
const d = a.value[h.value.column], g = h.value.direction;
|
|
2037
|
+
i.sort((S, J) => {
|
|
2038
|
+
let D = S[d.name], A = J[d.name];
|
|
2039
|
+
D == null && (D = ""), A == null && (A = "");
|
|
2040
|
+
const U = Number(D), ie = Number(A);
|
|
2041
|
+
if (!isNaN(U) && !isNaN(ie) && D !== "" && A !== "")
|
|
2042
|
+
return g === "asc" ? U - ie : ie - U;
|
|
2034
2043
|
{
|
|
2035
|
-
const mt = String(
|
|
2036
|
-
return
|
|
2044
|
+
const mt = String(D).toLowerCase(), gt = String(A).toLowerCase();
|
|
2045
|
+
return g === "asc" ? mt.localeCompare(gt) : gt.localeCompare(mt);
|
|
2037
2046
|
}
|
|
2038
2047
|
});
|
|
2039
2048
|
}
|
|
2040
2049
|
return i;
|
|
2041
|
-
}),
|
|
2042
|
-
const
|
|
2043
|
-
|
|
2044
|
-
...o.value[
|
|
2045
|
-
[J.name]:
|
|
2050
|
+
}), N = (i, d) => f.value[`${i}:${d}`], q = (i, d, g) => {
|
|
2051
|
+
const S = `${i}:${d}`, J = a.value[i];
|
|
2052
|
+
f.value[S] !== g && (c.value[d] = !0), f.value[S] = g, o.value[d] = {
|
|
2053
|
+
...o.value[d],
|
|
2054
|
+
[J.name]: g
|
|
2046
2055
|
};
|
|
2047
2056
|
}, _ = (i) => {
|
|
2048
2057
|
o.value = i;
|
|
2049
|
-
}, ne = (i,
|
|
2050
|
-
const
|
|
2051
|
-
|
|
2058
|
+
}, ne = (i, d, g) => {
|
|
2059
|
+
const S = `${i}:${d}`;
|
|
2060
|
+
f.value[S] !== g && (c.value[d] = !0, I.value[S] = g);
|
|
2052
2061
|
}, ge = (i) => {
|
|
2053
|
-
const
|
|
2062
|
+
const d = a.value.indexOf(i) === a.value.length - 1, g = r.value.fullWidth ? i.resizable && !d : i.resizable;
|
|
2054
2063
|
return {
|
|
2055
2064
|
width: i.width || "40ch",
|
|
2056
2065
|
textAlign: i.align || "center",
|
|
2057
|
-
...
|
|
2066
|
+
...g && {
|
|
2058
2067
|
resize: "horizontal",
|
|
2059
2068
|
overflow: "hidden",
|
|
2060
2069
|
whiteSpace: "nowrap"
|
|
2061
2070
|
}
|
|
2062
2071
|
};
|
|
2063
|
-
}, ve = (i,
|
|
2072
|
+
}, ve = (i, d) => {
|
|
2064
2073
|
if (i < 0 || i >= a.value.length) return;
|
|
2065
|
-
const
|
|
2074
|
+
const S = Math.max(d, 40);
|
|
2066
2075
|
a.value[i] = {
|
|
2067
2076
|
...a.value[i],
|
|
2068
|
-
width: `${
|
|
2077
|
+
width: `${S}px`
|
|
2069
2078
|
};
|
|
2070
2079
|
}, Oe = (i) => {
|
|
2071
|
-
const
|
|
2072
|
-
return
|
|
2073
|
-
}, Ve = (i) => !
|
|
2074
|
-
if (
|
|
2075
|
-
const
|
|
2080
|
+
const d = o.value[i];
|
|
2081
|
+
return b.value && d.gantt !== void 0;
|
|
2082
|
+
}, Ve = (i) => !p.value || v.value[i].isRoot || v.value[i].open, Be = (i) => !p.value && r.value.view !== "list-expansion" ? "" : p.value && (v.value[i].isRoot || v.value[i].isParent) ? v.value[i].childrenOpen ? "▼" : "►" : r.value.view === "list-expansion" ? v.value[i].expanded ? "▼" : "►" : "", Pe = (i) => {
|
|
2083
|
+
if (p.value) {
|
|
2084
|
+
const d = s.value[i] || {}, S = !(d.childrenOpen ?? v.value[i].childrenOpen);
|
|
2076
2085
|
s.value[i] = {
|
|
2077
|
-
...
|
|
2078
|
-
childrenOpen:
|
|
2079
|
-
},
|
|
2080
|
-
} else if (
|
|
2081
|
-
const
|
|
2086
|
+
...d,
|
|
2087
|
+
childrenOpen: S
|
|
2088
|
+
}, S || He(i);
|
|
2089
|
+
} else if (r.value.view === "list-expansion") {
|
|
2090
|
+
const d = s.value[i] || {}, g = d.expanded ?? v.value[i].expanded;
|
|
2082
2091
|
s.value[i] = {
|
|
2083
|
-
...
|
|
2084
|
-
expanded: !
|
|
2092
|
+
...d,
|
|
2093
|
+
expanded: !g
|
|
2085
2094
|
};
|
|
2086
2095
|
}
|
|
2087
2096
|
}, He = (i) => {
|
|
2088
|
-
for (let
|
|
2089
|
-
if (v.value[
|
|
2090
|
-
const
|
|
2091
|
-
s.value[
|
|
2092
|
-
...
|
|
2097
|
+
for (let d = 0; d < o.value.length; d++)
|
|
2098
|
+
if (v.value[d].parent === i) {
|
|
2099
|
+
const g = s.value[d] || {};
|
|
2100
|
+
s.value[d] = {
|
|
2101
|
+
...g,
|
|
2093
2102
|
childrenOpen: !1
|
|
2094
|
-
}, He(
|
|
2103
|
+
}, He(d);
|
|
2095
2104
|
}
|
|
2096
|
-
},
|
|
2097
|
-
const
|
|
2098
|
-
return
|
|
2099
|
-
},
|
|
2100
|
-
const
|
|
2101
|
-
if (!
|
|
2102
|
-
switch (
|
|
2105
|
+
}, M = (i, d) => {
|
|
2106
|
+
const g = N(i, d);
|
|
2107
|
+
return L(i, d, g);
|
|
2108
|
+
}, L = (i, d, g) => {
|
|
2109
|
+
const S = a.value[i], J = o.value[d], D = S.format;
|
|
2110
|
+
if (!D)
|
|
2111
|
+
switch (S.fieldtype) {
|
|
2103
2112
|
case "Check":
|
|
2104
|
-
return
|
|
2113
|
+
return g ? "✓" : "✗";
|
|
2105
2114
|
case "Date":
|
|
2106
|
-
return
|
|
2115
|
+
return g != null ? new Date(String(g)).toLocaleDateString() : g;
|
|
2107
2116
|
case "Datetime":
|
|
2108
|
-
return
|
|
2117
|
+
return g != null ? new Date(String(g)).toLocaleString() : g;
|
|
2109
2118
|
default:
|
|
2110
|
-
return
|
|
2119
|
+
return g;
|
|
2111
2120
|
}
|
|
2112
|
-
return typeof
|
|
2121
|
+
return typeof D == "function" ? D(g, { table: f.value, row: J, column: S }) : typeof D == "string" ? Function(`"use strict";return (${D})`)()(g, { table: f.value, row: J, column: S }) : g;
|
|
2113
2122
|
}, W = (i) => {
|
|
2114
|
-
i.target instanceof Node &&
|
|
2123
|
+
i.target instanceof Node && x.value.parent?.contains(i.target) || x.value.visible && (x.value.visible = !1);
|
|
2115
2124
|
}, Q = (i) => {
|
|
2116
|
-
const
|
|
2117
|
-
|
|
2125
|
+
const d = o.value[i.rowIndex]?.gantt;
|
|
2126
|
+
d && (i.type === "resize" ? i.edge === "start" ? (d.startIndex = i.newStart, d.endIndex = i.end, d.colspan = d.endIndex - d.startIndex) : i.edge === "end" && (d.startIndex = i.start, d.endIndex = i.newEnd, d.colspan = d.endIndex - d.startIndex) : i.type === "bar" && (d.startIndex = i.newStart, d.endIndex = i.newEnd, d.colspan = d.endIndex - d.startIndex));
|
|
2118
2127
|
}, X = (i) => {
|
|
2119
|
-
const
|
|
2120
|
-
|
|
2128
|
+
const d = P.value.findIndex((g) => g.id === i.id);
|
|
2129
|
+
d >= 0 ? P.value[d] = i : P.value.push(i);
|
|
2121
2130
|
}, oe = (i) => {
|
|
2122
|
-
const
|
|
2123
|
-
|
|
2131
|
+
const d = P.value.findIndex((g) => g.id === i);
|
|
2132
|
+
d >= 0 && P.value.splice(d, 1);
|
|
2124
2133
|
}, ye = (i) => {
|
|
2125
|
-
const
|
|
2126
|
-
|
|
2134
|
+
const d = R.value.findIndex((g) => g.id === i.id);
|
|
2135
|
+
d >= 0 ? R.value[d] = i : R.value.push(i);
|
|
2127
2136
|
}, Re = (i) => {
|
|
2128
|
-
const
|
|
2129
|
-
|
|
2130
|
-
},
|
|
2131
|
-
const
|
|
2132
|
-
if (!
|
|
2137
|
+
const d = R.value.findIndex((g) => g.id === i);
|
|
2138
|
+
d >= 0 && R.value.splice(d, 1);
|
|
2139
|
+
}, T = (i, d, g) => {
|
|
2140
|
+
const S = R.value.find((A) => A.id === i), J = R.value.find((A) => A.id === d);
|
|
2141
|
+
if (!S || !J)
|
|
2133
2142
|
return console.warn("Cannot create connection: handle not found"), null;
|
|
2134
|
-
const
|
|
2135
|
-
id: `connection-${i}-${
|
|
2143
|
+
const D = {
|
|
2144
|
+
id: `connection-${i}-${d}`,
|
|
2136
2145
|
from: {
|
|
2137
|
-
barId:
|
|
2138
|
-
side:
|
|
2146
|
+
barId: S.barId,
|
|
2147
|
+
side: S.side
|
|
2139
2148
|
},
|
|
2140
2149
|
to: {
|
|
2141
2150
|
barId: J.barId,
|
|
2142
2151
|
side: J.side
|
|
2143
2152
|
},
|
|
2144
|
-
style:
|
|
2145
|
-
label:
|
|
2153
|
+
style: g?.style,
|
|
2154
|
+
label: g?.label
|
|
2146
2155
|
};
|
|
2147
|
-
return
|
|
2148
|
-
},
|
|
2149
|
-
const
|
|
2150
|
-
return
|
|
2151
|
-
}, Y = (i) =>
|
|
2156
|
+
return w.value.push(D), D;
|
|
2157
|
+
}, V = (i) => {
|
|
2158
|
+
const d = w.value.findIndex((g) => g.id === i);
|
|
2159
|
+
return d >= 0 ? (w.value.splice(d, 1), !0) : !1;
|
|
2160
|
+
}, Y = (i) => w.value.filter((d) => d.from.barId === i || d.to.barId === i), G = (i) => R.value.filter((d) => d.barId === i), K = (i) => {
|
|
2152
2161
|
if (a.value[i].sortable === !1) return;
|
|
2153
|
-
let
|
|
2154
|
-
|
|
2155
|
-
}, te = (i,
|
|
2156
|
-
!
|
|
2162
|
+
let g;
|
|
2163
|
+
h.value.column === i && h.value.direction === "asc" ? g = "desc" : g = "asc", h.value.column = i, h.value.direction = g;
|
|
2164
|
+
}, te = (i, d) => {
|
|
2165
|
+
!d.value && !d.startValue && !d.endValue ? delete m.value[i] : m.value[i] = d;
|
|
2157
2166
|
}, le = (i) => {
|
|
2158
|
-
delete
|
|
2159
|
-
},
|
|
2160
|
-
const
|
|
2167
|
+
delete m.value[i];
|
|
2168
|
+
}, se = (i, d = "end") => {
|
|
2169
|
+
const g = {};
|
|
2161
2170
|
for (const J of a.value)
|
|
2162
|
-
|
|
2163
|
-
i && Object.assign(
|
|
2164
|
-
let
|
|
2165
|
-
return
|
|
2171
|
+
g[J.name] = "";
|
|
2172
|
+
i && Object.assign(g, i);
|
|
2173
|
+
let S;
|
|
2174
|
+
return d === "start" ? (S = 0, o.value.unshift(g)) : d === "end" ? (S = o.value.length, o.value.push(g)) : (S = Math.max(0, Math.min(d, o.value.length)), o.value.splice(S, 0, g)), S;
|
|
2166
2175
|
};
|
|
2167
2176
|
return {
|
|
2168
2177
|
// state
|
|
2169
2178
|
columns: a,
|
|
2170
|
-
config:
|
|
2171
|
-
connectionHandles:
|
|
2172
|
-
connectionPaths:
|
|
2179
|
+
config: r,
|
|
2180
|
+
connectionHandles: R,
|
|
2181
|
+
connectionPaths: w,
|
|
2173
2182
|
display: v,
|
|
2174
|
-
filterState:
|
|
2175
|
-
ganttBars:
|
|
2176
|
-
modal:
|
|
2183
|
+
filterState: m,
|
|
2184
|
+
ganttBars: P,
|
|
2185
|
+
modal: x,
|
|
2177
2186
|
rows: o,
|
|
2178
|
-
sortState:
|
|
2179
|
-
table:
|
|
2180
|
-
updates:
|
|
2187
|
+
sortState: h,
|
|
2188
|
+
table: f,
|
|
2189
|
+
updates: I,
|
|
2181
2190
|
// getters
|
|
2182
|
-
filteredRows:
|
|
2183
|
-
hasPinnedColumns:
|
|
2184
|
-
isGanttView:
|
|
2185
|
-
isTreeView:
|
|
2186
|
-
isDependencyGraphEnabled:
|
|
2191
|
+
filteredRows: Z,
|
|
2192
|
+
hasPinnedColumns: C,
|
|
2193
|
+
isGanttView: b,
|
|
2194
|
+
isTreeView: p,
|
|
2195
|
+
isDependencyGraphEnabled: O,
|
|
2187
2196
|
numberedRowWidth: j,
|
|
2188
|
-
zeroColumn:
|
|
2197
|
+
zeroColumn: E,
|
|
2189
2198
|
// resolver
|
|
2190
2199
|
linkResolver: n,
|
|
2191
2200
|
// actions
|
|
2192
|
-
addRow:
|
|
2201
|
+
addRow: se,
|
|
2193
2202
|
clearFilter: le,
|
|
2194
2203
|
closeModal: W,
|
|
2195
|
-
createConnection:
|
|
2196
|
-
deleteConnection:
|
|
2204
|
+
createConnection: T,
|
|
2205
|
+
deleteConnection: V,
|
|
2197
2206
|
deleteRow: (i) => {
|
|
2198
2207
|
if (i < 0 || i >= o.value.length)
|
|
2199
2208
|
return null;
|
|
2200
|
-
const [
|
|
2201
|
-
delete
|
|
2202
|
-
const
|
|
2203
|
-
for (const [J,
|
|
2204
|
-
const
|
|
2205
|
-
|
|
2209
|
+
const [d] = o.value.splice(i, 1);
|
|
2210
|
+
delete c.value[i], delete s.value[i];
|
|
2211
|
+
const g = {}, S = {};
|
|
2212
|
+
for (const [J, D] of Object.entries(c.value)) {
|
|
2213
|
+
const A = parseInt(J);
|
|
2214
|
+
A > i ? g[A - 1] = D : g[A] = D;
|
|
2206
2215
|
}
|
|
2207
|
-
for (const [J,
|
|
2208
|
-
const
|
|
2209
|
-
|
|
2216
|
+
for (const [J, D] of Object.entries(s.value)) {
|
|
2217
|
+
const A = parseInt(J);
|
|
2218
|
+
A > i ? S[A - 1] = D : S[A] = D;
|
|
2210
2219
|
}
|
|
2211
|
-
return
|
|
2220
|
+
return c.value = g, s.value = S, d;
|
|
2212
2221
|
},
|
|
2213
2222
|
duplicateRow: (i) => {
|
|
2214
2223
|
if (i < 0 || i >= o.value.length)
|
|
2215
2224
|
return -1;
|
|
2216
|
-
const
|
|
2217
|
-
return o.value.splice(
|
|
2225
|
+
const d = o.value[i], g = JSON.parse(JSON.stringify(d)), S = i + 1;
|
|
2226
|
+
return o.value.splice(S, 0, g), S;
|
|
2218
2227
|
},
|
|
2219
|
-
getCellData:
|
|
2220
|
-
getCellDisplayValue:
|
|
2228
|
+
getCellData: N,
|
|
2229
|
+
getCellDisplayValue: M,
|
|
2221
2230
|
getConnectionsForBar: Y,
|
|
2222
|
-
getFormattedValue:
|
|
2231
|
+
getFormattedValue: L,
|
|
2223
2232
|
getHandlesForBar: G,
|
|
2224
2233
|
getHeaderCellStyle: ge,
|
|
2225
|
-
getIndent:
|
|
2234
|
+
getIndent: No,
|
|
2226
2235
|
getRowExpandSymbol: Be,
|
|
2227
|
-
insertRowAbove: (i,
|
|
2228
|
-
const
|
|
2229
|
-
return
|
|
2236
|
+
insertRowAbove: (i, d) => {
|
|
2237
|
+
const g = Math.max(0, i);
|
|
2238
|
+
return se(d, g);
|
|
2230
2239
|
},
|
|
2231
|
-
insertRowBelow: (i,
|
|
2232
|
-
const
|
|
2233
|
-
return
|
|
2240
|
+
insertRowBelow: (i, d) => {
|
|
2241
|
+
const g = Math.min(i + 1, o.value.length);
|
|
2242
|
+
return se(d, g);
|
|
2234
2243
|
},
|
|
2235
2244
|
isRowGantt: Oe,
|
|
2236
2245
|
isRowVisible: Ve,
|
|
2237
|
-
moveRow: (i,
|
|
2238
|
-
if (i < 0 || i >= o.value.length ||
|
|
2246
|
+
moveRow: (i, d) => {
|
|
2247
|
+
if (i < 0 || i >= o.value.length || d < 0 || d >= o.value.length || i === d)
|
|
2239
2248
|
return !1;
|
|
2240
|
-
const [
|
|
2241
|
-
o.value.splice(
|
|
2242
|
-
const
|
|
2243
|
-
for (const [
|
|
2244
|
-
const U = parseInt(
|
|
2249
|
+
const [g] = o.value.splice(i, 1);
|
|
2250
|
+
o.value.splice(d, 0, g);
|
|
2251
|
+
const S = {}, J = {};
|
|
2252
|
+
for (const [D, A] of Object.entries(c.value)) {
|
|
2253
|
+
const U = parseInt(D);
|
|
2245
2254
|
let ie = U;
|
|
2246
|
-
U === i ? ie =
|
|
2255
|
+
U === i ? ie = d : i < d ? U > i && U <= d && (ie = U - 1) : U >= d && U < i && (ie = U + 1), S[ie] = A;
|
|
2247
2256
|
}
|
|
2248
|
-
for (const [
|
|
2249
|
-
const U = parseInt(
|
|
2257
|
+
for (const [D, A] of Object.entries(s.value)) {
|
|
2258
|
+
const U = parseInt(D);
|
|
2250
2259
|
let ie = U;
|
|
2251
|
-
U === i ? ie =
|
|
2260
|
+
U === i ? ie = d : i < d ? U > i && U <= d && (ie = U - 1) : U >= d && U < i && (ie = U + 1), J[ie] = A;
|
|
2252
2261
|
}
|
|
2253
|
-
return
|
|
2262
|
+
return c.value = S, s.value = J, !0;
|
|
2254
2263
|
},
|
|
2255
2264
|
registerConnectionHandle: ye,
|
|
2256
2265
|
registerGanttBar: X,
|
|
@@ -2267,27 +2276,27 @@ const No = (e) => {
|
|
|
2267
2276
|
};
|
|
2268
2277
|
})();
|
|
2269
2278
|
};
|
|
2270
|
-
function
|
|
2279
|
+
function Wo(e) {
|
|
2271
2280
|
return e.filter((t) => !t.hidden && t.fieldtype).map(({ fieldname: t, hidden: n, ...l }) => {
|
|
2272
2281
|
const u = Object.assign({ name: t }, l);
|
|
2273
2282
|
if (l.fieldtype === "Link" && !l.cellComponent) {
|
|
2274
2283
|
const a = l, o = typeof a.doctype == "string" ? a.doctype : void 0;
|
|
2275
|
-
o && (u.linkDoctype = o), l.format || (u.format = (
|
|
2276
|
-
if (
|
|
2277
|
-
if (typeof
|
|
2278
|
-
const
|
|
2279
|
-
return typeof
|
|
2284
|
+
o && (u.linkDoctype = o), l.format || (u.format = (r) => {
|
|
2285
|
+
if (r == null) return "";
|
|
2286
|
+
if (typeof r == "object") {
|
|
2287
|
+
const c = r.displayText ?? r.id ?? "";
|
|
2288
|
+
return typeof c == "string" || typeof c == "number" ? String(c) : "";
|
|
2280
2289
|
}
|
|
2281
|
-
return String(
|
|
2290
|
+
return String(r);
|
|
2282
2291
|
});
|
|
2283
2292
|
}
|
|
2284
2293
|
return u;
|
|
2285
2294
|
});
|
|
2286
2295
|
}
|
|
2287
|
-
const
|
|
2296
|
+
const zo = {
|
|
2288
2297
|
class: "atable-container",
|
|
2289
2298
|
style: { position: "relative" }
|
|
2290
|
-
},
|
|
2299
|
+
}, Xo = /* @__PURE__ */ xe({
|
|
2291
2300
|
__name: "ATable",
|
|
2292
2301
|
props: /* @__PURE__ */ yt({
|
|
2293
2302
|
id: { default: "" },
|
|
@@ -2300,28 +2309,28 @@ const Wo = {
|
|
|
2300
2309
|
columns: {},
|
|
2301
2310
|
columnsModifiers: {}
|
|
2302
2311
|
}),
|
|
2303
|
-
emits: /* @__PURE__ */ yt(["cellUpdate", "gantt:drag", "connection:event", "columns:update", "row:add", "row:delete", "row:duplicate", "row:insert-above", "row:insert-below", "row:move"], ["update:rows", "update:columns"]),
|
|
2312
|
+
emits: /* @__PURE__ */ yt(["cellUpdate", "gantt:drag", "connection:event", "columns:update", "row:add", "row:click", "row:delete", "row:duplicate", "row:insert-above", "row:insert-below", "row:move", "row:open"], ["update:rows", "update:columns"]),
|
|
2304
2313
|
setup(e, { expose: t, emit: n }) {
|
|
2305
|
-
const l = wt(e, "rows"), u = wt(e, "columns"), a = n, o = ce("table"),
|
|
2306
|
-
columns:
|
|
2314
|
+
const l = wt(e, "rows"), u = wt(e, "columns"), a = n, o = ce("table"), r = u.value?.length ? u.value : Wo(e.schema ?? []), c = qt("aformLinkResolver", null), s = Fo({
|
|
2315
|
+
columns: r,
|
|
2307
2316
|
rows: l.value,
|
|
2308
2317
|
id: e.id,
|
|
2309
2318
|
config: e.config,
|
|
2310
|
-
linkResolver: e.linkResolver ??
|
|
2319
|
+
linkResolver: e.linkResolver ?? c
|
|
2311
2320
|
});
|
|
2312
|
-
s.$onAction(({ name: h, store: m, args:
|
|
2321
|
+
s.$onAction(({ name: h, store: m, args: C, after: b }) => {
|
|
2313
2322
|
if (h === "setCellData" || h === "setCellText") {
|
|
2314
|
-
const [
|
|
2315
|
-
|
|
2316
|
-
l.value = [...s.rows], a("cellUpdate", { colIndex:
|
|
2323
|
+
const [p, O, j] = C, E = m.getCellData(p, O);
|
|
2324
|
+
b(() => {
|
|
2325
|
+
l.value = [...s.rows], a("cellUpdate", { colIndex: p, rowIndex: O, newValue: j, oldValue: E });
|
|
2317
2326
|
});
|
|
2318
2327
|
} else if (h === "updateGanttBar") {
|
|
2319
|
-
const [
|
|
2320
|
-
let
|
|
2321
|
-
|
|
2322
|
-
a("gantt:drag",
|
|
2328
|
+
const [p] = C;
|
|
2329
|
+
let O = !1;
|
|
2330
|
+
p.type === "resize" ? O = p.oldColspan !== p.newColspan : p.type === "bar" && (O = p.oldStart !== p.newStart || p.oldEnd !== p.newEnd), O && b(() => {
|
|
2331
|
+
a("gantt:drag", p);
|
|
2323
2332
|
});
|
|
2324
|
-
} else h === "resizeColumn" &&
|
|
2333
|
+
} else h === "resizeColumn" && b(() => {
|
|
2325
2334
|
u.value = [...s.columns], a("columns:update", [...s.columns]);
|
|
2326
2335
|
});
|
|
2327
2336
|
}), ue(
|
|
@@ -2339,18 +2348,18 @@ const Wo = {
|
|
|
2339
2348
|
), Ae(() => {
|
|
2340
2349
|
u.value?.some((h) => h.pinned) && (v(), s.isTreeView && Lt(o, v, { childList: !0, subtree: !0 }));
|
|
2341
2350
|
});
|
|
2342
|
-
const
|
|
2343
|
-
const h = o.value, m = h?.rows[0],
|
|
2344
|
-
for (const [
|
|
2345
|
-
const
|
|
2346
|
-
|
|
2351
|
+
const f = $(() => s.columns.filter((h) => h.pinned).length), v = () => {
|
|
2352
|
+
const h = o.value, m = h?.rows[0], C = h?.rows[1], b = m ? Array.from(m.cells) : [];
|
|
2353
|
+
for (const [p, O] of b.entries()) {
|
|
2354
|
+
const j = C?.cells[p];
|
|
2355
|
+
j && (O.style.width = `${j.offsetWidth}px`);
|
|
2347
2356
|
}
|
|
2348
|
-
for (const
|
|
2349
|
-
let
|
|
2350
|
-
const
|
|
2351
|
-
for (const
|
|
2352
|
-
(
|
|
2353
|
-
|
|
2357
|
+
for (const p of h?.rows || []) {
|
|
2358
|
+
let O = 0;
|
|
2359
|
+
const j = [];
|
|
2360
|
+
for (const E of p.cells)
|
|
2361
|
+
(E.classList.contains("sticky-column") || E.classList.contains("sticky-index")) && (E.style.left = `${O}px`, O += E.offsetWidth, j.push(E));
|
|
2362
|
+
j.length > 0 && j[j.length - 1].classList.add("sticky-column-edge");
|
|
2354
2363
|
}
|
|
2355
2364
|
};
|
|
2356
2365
|
window.addEventListener("keydown", (h) => {
|
|
@@ -2360,60 +2369,68 @@ const Wo = {
|
|
|
2360
2369
|
m && at().then(() => m.focus());
|
|
2361
2370
|
}
|
|
2362
2371
|
});
|
|
2363
|
-
const
|
|
2364
|
-
if (!h.gantt ||
|
|
2372
|
+
const x = (h) => {
|
|
2373
|
+
if (!h.gantt || f.value === 0)
|
|
2365
2374
|
return s.columns;
|
|
2366
2375
|
const m = [];
|
|
2367
|
-
for (let
|
|
2368
|
-
const
|
|
2369
|
-
|
|
2376
|
+
for (let C = 0; C < f.value; C++) {
|
|
2377
|
+
const b = { ...s.columns[C] };
|
|
2378
|
+
b.originalIndex = C, m.push(b);
|
|
2370
2379
|
}
|
|
2371
2380
|
return m.push({
|
|
2372
|
-
...s.columns[
|
|
2381
|
+
...s.columns[f.value],
|
|
2373
2382
|
isGantt: !0,
|
|
2374
|
-
colspan: h.gantt?.colspan || s.columns.length -
|
|
2375
|
-
originalIndex:
|
|
2383
|
+
colspan: h.gantt?.colspan || s.columns.length - f.value,
|
|
2384
|
+
originalIndex: f.value,
|
|
2376
2385
|
width: "auto"
|
|
2377
2386
|
// TODO: refactor to API that can detect when data exists in a cell. Might have be custom and not generalizable
|
|
2378
2387
|
}), m;
|
|
2379
|
-
},
|
|
2388
|
+
}, I = (h) => {
|
|
2380
2389
|
a("connection:event", { type: "create", connection: h });
|
|
2381
|
-
},
|
|
2390
|
+
}, P = (h) => {
|
|
2382
2391
|
a("connection:event", { type: "delete", connection: h });
|
|
2383
|
-
},
|
|
2392
|
+
}, R = (h, m) => {
|
|
2393
|
+
const C = s.rows[h];
|
|
2394
|
+
a("row:click", { row: C, rowIndex: h, event: m });
|
|
2395
|
+
}, w = (h, m, C) => {
|
|
2384
2396
|
switch (h) {
|
|
2385
2397
|
case "add": {
|
|
2386
|
-
const
|
|
2387
|
-
l.value = [...s.rows], a("row:add", { rowIndex:
|
|
2398
|
+
const b = s.addRow({}, m + 1), p = s.rows[b];
|
|
2399
|
+
l.value = [...s.rows], a("row:add", { rowIndex: b, row: p });
|
|
2388
2400
|
break;
|
|
2389
2401
|
}
|
|
2390
2402
|
case "delete": {
|
|
2391
|
-
const
|
|
2392
|
-
|
|
2403
|
+
const b = s.deleteRow(m);
|
|
2404
|
+
b && (l.value = [...s.rows], a("row:delete", { rowIndex: m, row: b }));
|
|
2393
2405
|
break;
|
|
2394
2406
|
}
|
|
2395
2407
|
case "duplicate": {
|
|
2396
|
-
const
|
|
2397
|
-
if (
|
|
2398
|
-
const
|
|
2399
|
-
l.value = [...s.rows], a("row:duplicate", { sourceIndex: m, newIndex:
|
|
2408
|
+
const b = s.duplicateRow(m);
|
|
2409
|
+
if (b >= 0) {
|
|
2410
|
+
const p = s.rows[b];
|
|
2411
|
+
l.value = [...s.rows], a("row:duplicate", { sourceIndex: m, newIndex: b, row: p });
|
|
2400
2412
|
}
|
|
2401
2413
|
break;
|
|
2402
2414
|
}
|
|
2403
2415
|
case "insertAbove": {
|
|
2404
|
-
const
|
|
2405
|
-
l.value = [...s.rows], a("row:insert-above", { targetIndex: m, newIndex:
|
|
2416
|
+
const b = s.insertRowAbove(m), p = s.rows[b];
|
|
2417
|
+
l.value = [...s.rows], a("row:insert-above", { targetIndex: m, newIndex: b, row: p });
|
|
2406
2418
|
break;
|
|
2407
2419
|
}
|
|
2408
2420
|
case "insertBelow": {
|
|
2409
|
-
const
|
|
2410
|
-
l.value = [...s.rows], a("row:insert-below", { targetIndex: m, newIndex:
|
|
2421
|
+
const b = s.insertRowBelow(m), p = s.rows[b];
|
|
2422
|
+
l.value = [...s.rows], a("row:insert-below", { targetIndex: m, newIndex: b, row: p });
|
|
2411
2423
|
break;
|
|
2412
2424
|
}
|
|
2413
2425
|
case "move": {
|
|
2414
2426
|
a("row:move", { fromIndex: m, toIndex: -1 });
|
|
2415
2427
|
break;
|
|
2416
2428
|
}
|
|
2429
|
+
case "open": {
|
|
2430
|
+
const b = s.rows[m];
|
|
2431
|
+
a("row:open", { row: b, rowIndex: m, event: C });
|
|
2432
|
+
break;
|
|
2433
|
+
}
|
|
2417
2434
|
}
|
|
2418
2435
|
};
|
|
2419
2436
|
return t({
|
|
@@ -2429,59 +2446,60 @@ const Wo = {
|
|
|
2429
2446
|
insertRowAbove: s.insertRowAbove,
|
|
2430
2447
|
insertRowBelow: s.insertRowBelow,
|
|
2431
2448
|
moveRow: s.moveRow
|
|
2432
|
-
}), (h, m) => (
|
|
2433
|
-
de((
|
|
2449
|
+
}), (h, m) => (y(), k("div", zo, [
|
|
2450
|
+
de((y(), k("table", {
|
|
2434
2451
|
ref: "table",
|
|
2435
2452
|
class: "atable",
|
|
2436
2453
|
style: pe({
|
|
2437
|
-
width:
|
|
2454
|
+
width: B(s).config.fullWidth ? "100%" : "auto"
|
|
2438
2455
|
})
|
|
2439
2456
|
}, [
|
|
2440
|
-
fe(h.$slots, "header", { data:
|
|
2457
|
+
fe(h.$slots, "header", { data: B(s) }, () => [
|
|
2441
2458
|
pt(Ot, {
|
|
2442
|
-
columns:
|
|
2443
|
-
store:
|
|
2459
|
+
columns: B(s).columns,
|
|
2460
|
+
store: B(s)
|
|
2444
2461
|
}, null, 8, ["columns", "store"])
|
|
2445
2462
|
], !0),
|
|
2446
|
-
|
|
2447
|
-
fe(h.$slots, "body", { data:
|
|
2448
|
-
(
|
|
2449
|
-
key: `${
|
|
2450
|
-
row:
|
|
2451
|
-
"row-index":
|
|
2452
|
-
store:
|
|
2453
|
-
"onRow:action":
|
|
2463
|
+
F("tbody", null, [
|
|
2464
|
+
fe(h.$slots, "body", { data: B(s) }, () => [
|
|
2465
|
+
(y(!0), k(me, null, Ce(B(s).filteredRows, (C, b) => (y(), he(Dt, {
|
|
2466
|
+
key: `${C.originalIndex}-${b}`,
|
|
2467
|
+
row: C,
|
|
2468
|
+
"row-index": C.originalIndex,
|
|
2469
|
+
store: B(s),
|
|
2470
|
+
"onRow:action": w,
|
|
2471
|
+
"onRow:click": R
|
|
2454
2472
|
}, {
|
|
2455
2473
|
default: xt(() => [
|
|
2456
|
-
(
|
|
2457
|
-
key:
|
|
2474
|
+
(y(!0), k(me, null, Ce(x(C), (p, O) => (y(), k(me, {
|
|
2475
|
+
key: p.name
|
|
2458
2476
|
}, [
|
|
2459
|
-
|
|
2477
|
+
p.isGantt ? (y(), he(Ne(p.ganttComponent || "AGanttCell"), {
|
|
2460
2478
|
key: 0,
|
|
2461
|
-
store:
|
|
2462
|
-
"columns-count":
|
|
2463
|
-
color:
|
|
2464
|
-
start:
|
|
2465
|
-
end:
|
|
2466
|
-
colspan:
|
|
2467
|
-
pinned:
|
|
2468
|
-
"row-index":
|
|
2469
|
-
"col-index":
|
|
2479
|
+
store: B(s),
|
|
2480
|
+
"columns-count": B(s).columns.length - f.value,
|
|
2481
|
+
color: C.gantt?.color,
|
|
2482
|
+
start: C.gantt?.startIndex,
|
|
2483
|
+
end: C.gantt?.endIndex,
|
|
2484
|
+
colspan: p.colspan,
|
|
2485
|
+
pinned: p.pinned,
|
|
2486
|
+
"row-index": C.originalIndex,
|
|
2487
|
+
"col-index": p.originalIndex ?? O,
|
|
2470
2488
|
style: pe({
|
|
2471
|
-
textAlign:
|
|
2472
|
-
minWidth:
|
|
2473
|
-
width:
|
|
2489
|
+
textAlign: p?.align || "center",
|
|
2490
|
+
minWidth: p?.width || "40ch",
|
|
2491
|
+
width: B(s).config.fullWidth ? "auto" : null
|
|
2474
2492
|
}),
|
|
2475
|
-
"onConnection:create":
|
|
2476
|
-
}, null, 40, ["store", "columns-count", "color", "start", "end", "colspan", "pinned", "row-index", "col-index", "style"])) : (
|
|
2493
|
+
"onConnection:create": I
|
|
2494
|
+
}, null, 40, ["store", "columns-count", "color", "start", "end", "colspan", "pinned", "row-index", "col-index", "style"])) : (y(), he(Ne(p.cellComponent || "ACell"), {
|
|
2477
2495
|
key: 1,
|
|
2478
|
-
store:
|
|
2479
|
-
pinned:
|
|
2480
|
-
"row-index":
|
|
2481
|
-
"col-index":
|
|
2496
|
+
store: B(s),
|
|
2497
|
+
pinned: p.pinned,
|
|
2498
|
+
"row-index": C.originalIndex,
|
|
2499
|
+
"col-index": O,
|
|
2482
2500
|
style: pe({
|
|
2483
|
-
textAlign:
|
|
2484
|
-
width:
|
|
2501
|
+
textAlign: p?.align || "center",
|
|
2502
|
+
width: B(s).config.fullWidth ? "auto" : null
|
|
2485
2503
|
}),
|
|
2486
2504
|
spellcheck: "false"
|
|
2487
2505
|
}, null, 8, ["store", "pinned", "row-index", "col-index", "style"]))
|
|
@@ -2491,53 +2509,53 @@ const Wo = {
|
|
|
2491
2509
|
}, 1032, ["row", "row-index", "store"]))), 128))
|
|
2492
2510
|
], !0)
|
|
2493
2511
|
]),
|
|
2494
|
-
fe(h.$slots, "footer", { data:
|
|
2495
|
-
fe(h.$slots, "modal", { data:
|
|
2496
|
-
de(pt(Vt, { store:
|
|
2512
|
+
fe(h.$slots, "footer", { data: B(s) }, void 0, !0),
|
|
2513
|
+
fe(h.$slots, "modal", { data: B(s) }, () => [
|
|
2514
|
+
de(pt(Vt, { store: B(s) }, {
|
|
2497
2515
|
default: xt(() => [
|
|
2498
|
-
(
|
|
2499
|
-
key: `${
|
|
2500
|
-
"col-index":
|
|
2501
|
-
"row-index":
|
|
2502
|
-
store:
|
|
2503
|
-
},
|
|
2516
|
+
(y(), he(Ne(B(s).modal.component), st({
|
|
2517
|
+
key: `${B(s).modal.rowIndex}:${B(s).modal.colIndex}`,
|
|
2518
|
+
"col-index": B(s).modal.colIndex,
|
|
2519
|
+
"row-index": B(s).modal.rowIndex,
|
|
2520
|
+
store: B(s)
|
|
2521
|
+
}, B(s).modal.componentProps), null, 16, ["col-index", "row-index", "store"]))
|
|
2504
2522
|
]),
|
|
2505
2523
|
_: 1
|
|
2506
2524
|
}, 8, ["store"]), [
|
|
2507
|
-
[it,
|
|
2525
|
+
[it, B(s).modal.visible]
|
|
2508
2526
|
])
|
|
2509
2527
|
], !0)
|
|
2510
2528
|
], 4)), [
|
|
2511
|
-
[
|
|
2529
|
+
[B(mo), B(s).closeModal]
|
|
2512
2530
|
]),
|
|
2513
|
-
|
|
2531
|
+
B(s).isGanttView && B(s).isDependencyGraphEnabled ? (y(), he(Mo, {
|
|
2514
2532
|
key: 0,
|
|
2515
|
-
store:
|
|
2516
|
-
"onConnection:delete":
|
|
2533
|
+
store: B(s),
|
|
2534
|
+
"onConnection:delete": P
|
|
2517
2535
|
}, null, 8, ["store"])) : ee("", !0)
|
|
2518
2536
|
]));
|
|
2519
2537
|
}
|
|
2520
|
-
}),
|
|
2521
|
-
function
|
|
2522
|
-
return
|
|
2523
|
-
|
|
2538
|
+
}), Go = /* @__PURE__ */ $e(Xo, [["__scopeId", "data-v-ffa2a0fc"]]), jo = {}, Yo = { class: "aloading" }, Uo = { class: "aloading-header" };
|
|
2539
|
+
function Jo(e, t) {
|
|
2540
|
+
return y(), k("div", Yo, [
|
|
2541
|
+
F("h2", Uo, [
|
|
2524
2542
|
fe(e.$slots, "default", {}, void 0, !0)
|
|
2525
2543
|
]),
|
|
2526
|
-
t[0] || (t[0] =
|
|
2544
|
+
t[0] || (t[0] = F("div", { class: "aloading-bar" }, null, -1))
|
|
2527
2545
|
]);
|
|
2528
2546
|
}
|
|
2529
|
-
const
|
|
2530
|
-
function
|
|
2531
|
-
return
|
|
2532
|
-
|
|
2547
|
+
const qo = /* @__PURE__ */ $e(jo, [["render", Jo], ["__scopeId", "data-v-a930a25b"]]), Qo = {}, Ko = { class: "aloading" }, _o = { class: "aloading-header" };
|
|
2548
|
+
function el(e, t) {
|
|
2549
|
+
return y(), k("div", Ko, [
|
|
2550
|
+
F("h2", _o, [
|
|
2533
2551
|
fe(e.$slots, "default", {}, void 0, !0)
|
|
2534
2552
|
]),
|
|
2535
|
-
t[0] || (t[0] =
|
|
2553
|
+
t[0] || (t[0] = F("div", { class: "aloading-bar" }, null, -1))
|
|
2536
2554
|
]);
|
|
2537
2555
|
}
|
|
2538
|
-
const
|
|
2539
|
-
function
|
|
2540
|
-
e.component("ACell", Bn), e.component("AExpansionRow", Wn), e.component("AGanttCell", Jn), e.component("ARow", Dt), e.component("ARowActions", Ue), e.component("ATable",
|
|
2556
|
+
const tl = /* @__PURE__ */ $e(Qo, [["render", el], ["__scopeId", "data-v-e1165876"]]);
|
|
2557
|
+
function rl(e) {
|
|
2558
|
+
e.component("ACell", Bn), e.component("AExpansionRow", Wn), e.component("AGanttCell", Jn), e.component("ARow", Dt), e.component("ARowActions", Ue), e.component("ATable", Go), e.component("ATableHeader", Ot), e.component("ATableLoading", qo), e.component("ATableLoadingBar", tl), e.component("ATableModal", Vt);
|
|
2541
2559
|
}
|
|
2542
2560
|
export {
|
|
2543
2561
|
Bn as ACell,
|
|
@@ -2545,10 +2563,10 @@ export {
|
|
|
2545
2563
|
Jn as AGanttCell,
|
|
2546
2564
|
Dt as ARow,
|
|
2547
2565
|
Ue as ARowActions,
|
|
2548
|
-
|
|
2566
|
+
Go as ATable,
|
|
2549
2567
|
Ot as ATableHeader,
|
|
2550
|
-
|
|
2551
|
-
|
|
2568
|
+
qo as ATableLoading,
|
|
2569
|
+
tl as ATableLoadingBar,
|
|
2552
2570
|
Vt as ATableModal,
|
|
2553
2571
|
qn as AddIcon,
|
|
2554
2572
|
Qn as DeleteIcon,
|
|
@@ -2556,9 +2574,10 @@ export {
|
|
|
2556
2574
|
_n as InsertAboveIcon,
|
|
2557
2575
|
eo as InsertBelowIcon,
|
|
2558
2576
|
to as MoveIcon,
|
|
2559
|
-
no as
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2577
|
+
no as OpenIcon,
|
|
2578
|
+
oo as actionIcons,
|
|
2579
|
+
Fo as createTableStore,
|
|
2580
|
+
rl as install,
|
|
2581
|
+
Wo as schemaToColumns
|
|
2563
2582
|
};
|
|
2564
2583
|
//# sourceMappingURL=atable.js.map
|