@stonecrop/atable 0.18.0 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/atable.js +410 -406
- package/dist/atable.js.map +1 -1
- package/package.json +4 -4
- package/src/components/ACell.vue +8 -0
package/dist/atable.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { ref as E, computed as
|
|
1
|
+
import { ref as E, computed as Z, defineComponent as ce, useTemplateRef as ne, onMounted as Ne, openBlock as h, createElementBlock as w, unref as A, normalizeClass as J, normalizeStyle as se, createBlock as oe, resolveDynamicComponent as me, mergeProps as Oe, toDisplayString as ie, nextTick as Ye, useCssVars as nt, onUnmounted as ot, createElementVNode as V, withModifiers as fe, createCommentVNode as W, withDirectives as te, Fragment as ae, renderList as re, vShow as Le, renderSlot as le, reactive as lt, vModelText as ge, vModelCheckbox as at, vModelSelect as st, createTextVNode as it, useModel as Xe, inject as rt, watch as Ge, createVNode as We, withCtx as je, mergeModels as Ue } from "vue";
|
|
2
2
|
import { defaultKeypressHandlers as Ve, useKeyboardNav as qe } from "@stonecrop/utilities";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { vResizeObserver as
|
|
7
|
-
import './assets/index.css';const
|
|
3
|
+
import { componentCategory as Re, linkDisplayFieldname as ct } from "@stonecrop/schema";
|
|
4
|
+
import { useDebounceFn as dt, useElementBounding as ve, useDraggable as Te, useResizeObserver as ut, onClickOutside as vt, useMutationObserver as ft } from "@vueuse/core";
|
|
5
|
+
import { defineStore as ht } from "pinia";
|
|
6
|
+
import { vResizeObserver as gt, vOnClickOutside as mt } from "@vueuse/components";
|
|
7
|
+
import './assets/index.css';const wt = (e) => {
|
|
8
8
|
const k = new DOMParser().parseFromString(e, "text/html");
|
|
9
9
|
return Array.from(k.body.childNodes).some((i) => i.nodeType === 1);
|
|
10
|
-
},
|
|
10
|
+
}, xt = (e = 8) => Array.from({ length: e }, () => Math.floor(Math.random() * 16).toString(16)).join(""), Je = (e) => {
|
|
11
11
|
if (e == null) return "";
|
|
12
12
|
if (typeof e == "object") {
|
|
13
13
|
const k = e.qty ?? "", i = e.uom ?? "";
|
|
@@ -38,7 +38,7 @@ function Ke(e, k) {
|
|
|
38
38
|
const u = i.parent;
|
|
39
39
|
return u < 0 || u >= k.length ? !1 : (k[u].childrenOpen || !1) && Ke(u, k);
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function bt(e, k, i) {
|
|
42
42
|
const u = i.filterType || "text", M = k.value;
|
|
43
43
|
if (!M && u !== "dateRange" && u !== "checkbox") return !0;
|
|
44
44
|
switch (u) {
|
|
@@ -55,8 +55,8 @@ function xt(e, k, i) {
|
|
|
55
55
|
case "date": {
|
|
56
56
|
let s;
|
|
57
57
|
if (typeof e == "number") {
|
|
58
|
-
const
|
|
59
|
-
s = new Date(v,
|
|
58
|
+
const r = new Date(e), v = (/* @__PURE__ */ new Date()).getFullYear();
|
|
59
|
+
s = new Date(v, r.getMonth(), r.getDate());
|
|
60
60
|
} else
|
|
61
61
|
s = new Date(String(e));
|
|
62
62
|
const l = new Date(String(M));
|
|
@@ -65,37 +65,37 @@ function xt(e, k, i) {
|
|
|
65
65
|
case "dateRange": {
|
|
66
66
|
const s = k.startValue, l = k.endValue;
|
|
67
67
|
if (!s && !l) return !0;
|
|
68
|
-
let
|
|
68
|
+
let r;
|
|
69
69
|
if (typeof e == "number") {
|
|
70
70
|
const v = new Date(e), n = (/* @__PURE__ */ new Date()).getFullYear();
|
|
71
|
-
|
|
71
|
+
r = new Date(n, v.getMonth(), v.getDate());
|
|
72
72
|
} else
|
|
73
|
-
|
|
74
|
-
return !(s &&
|
|
73
|
+
r = new Date(String(e));
|
|
74
|
+
return !(s && r < new Date(String(s)) || l && r > new Date(String(l)));
|
|
75
75
|
}
|
|
76
76
|
default:
|
|
77
77
|
return !0;
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function yt(e, k) {
|
|
81
81
|
return k && e === 0 && k > 0 ? `${k}ch` : "inherit";
|
|
82
82
|
}
|
|
83
|
-
const
|
|
84
|
-
const k = e.id ||
|
|
85
|
-
return
|
|
83
|
+
const Ct = (e) => {
|
|
84
|
+
const k = e.id || xt(), i = e.linkResolver ?? null;
|
|
85
|
+
return ht(`table-${k}`, () => {
|
|
86
86
|
const M = () => {
|
|
87
87
|
const t = [Object.assign({}, { rowModified: !1 })], o = /* @__PURE__ */ new Set();
|
|
88
88
|
for (let D = 0; D < l.value.length; D++) {
|
|
89
89
|
const R = l.value[D];
|
|
90
90
|
R.parent !== null && R.parent !== void 0 && o.add(R.parent);
|
|
91
91
|
}
|
|
92
|
-
const
|
|
92
|
+
const c = (D) => l.value[D]?.gantt !== void 0, S = (D) => {
|
|
93
93
|
for (let R = 0; R < l.value.length; R++)
|
|
94
|
-
if (l.value[R].parent === D && (
|
|
94
|
+
if (l.value[R].parent === D && (c(R) || S(R)))
|
|
95
95
|
return !0;
|
|
96
96
|
return !1;
|
|
97
|
-
},
|
|
98
|
-
const R =
|
|
97
|
+
}, F = (D) => {
|
|
98
|
+
const R = r.value, N = R.view === "tree" || R.view === "tree-gantt" ? R.defaultTreeExpansion : void 0;
|
|
99
99
|
if (!N) return !0;
|
|
100
100
|
switch (N) {
|
|
101
101
|
case "root":
|
|
@@ -113,7 +113,7 @@ const yt = (e) => {
|
|
|
113
113
|
for (let D = 0; D < l.value.length; D++) {
|
|
114
114
|
const R = l.value[D], N = R.parent === null || R.parent === void 0, K = o.has(D);
|
|
115
115
|
t[D] = {
|
|
116
|
-
childrenOpen:
|
|
116
|
+
childrenOpen: F(D),
|
|
117
117
|
expanded: !1,
|
|
118
118
|
indent: R.indent || 0,
|
|
119
119
|
isParent: K,
|
|
@@ -125,13 +125,13 @@ const yt = (e) => {
|
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
127
|
return t;
|
|
128
|
-
}, s = E(e.columns), l = E(e.rows),
|
|
128
|
+
}, s = E(e.columns), l = E(e.rows), r = E(e.config || {}), v = E({}), n = E({}), C = Z(() => {
|
|
129
129
|
const t = {};
|
|
130
|
-
for (const [o,
|
|
131
|
-
for (const [S,
|
|
132
|
-
t[`${o}:${S}`] =
|
|
130
|
+
for (const [o, c] of s.value.entries())
|
|
131
|
+
for (const [S, F] of l.value.entries())
|
|
132
|
+
t[`${o}:${S}`] = F[c.name];
|
|
133
133
|
return t;
|
|
134
|
-
}), d =
|
|
134
|
+
}), d = Z({
|
|
135
135
|
get: () => {
|
|
136
136
|
const t = M();
|
|
137
137
|
for (let o = 0; o < t.length; o++)
|
|
@@ -144,57 +144,57 @@ const yt = (e) => {
|
|
|
144
144
|
set: (t) => {
|
|
145
145
|
JSON.stringify(t) !== JSON.stringify(d.value) && (d.value = t);
|
|
146
146
|
}
|
|
147
|
-
}), m = E(e.modal || { visible: !1 }),
|
|
147
|
+
}), m = E(e.modal || { visible: !1 }), Y = E({}), j = E([]), b = E([]), $ = E([]), a = E({
|
|
148
148
|
column: null,
|
|
149
149
|
direction: null
|
|
150
|
-
}), f = E({}), x =
|
|
151
|
-
const t =
|
|
150
|
+
}), f = E({}), x = Z(() => s.value.some((t) => t.pinned)), y = Z(() => r.value.view === "gantt" || r.value.view === "tree-gantt"), g = Z(() => r.value.view === "tree" || r.value.view === "tree-gantt"), T = Z(() => {
|
|
151
|
+
const t = r.value;
|
|
152
152
|
return t.view === "gantt" || t.view === "tree-gantt" ? t.dependencyGraph !== !1 : !0;
|
|
153
|
-
}), O =
|
|
154
|
-
() =>
|
|
155
|
-
),
|
|
156
|
-
let t = l.value.map((o,
|
|
153
|
+
}), O = Z(() => `${Math.ceil(l.value.length / 100 + 1)}ch`), p = Z(
|
|
154
|
+
() => r.value.view ? ["list", "tree", "tree-gantt", "list-expansion"].includes(r.value.view) : !1
|
|
155
|
+
), H = Z(() => {
|
|
156
|
+
let t = l.value.map((o, c) => ({
|
|
157
157
|
...o,
|
|
158
|
-
originalIndex:
|
|
158
|
+
originalIndex: c
|
|
159
159
|
}));
|
|
160
|
-
if (Object.entries(f.value).forEach(([o,
|
|
161
|
-
const S = parseInt(o),
|
|
162
|
-
!
|
|
163
|
-
const N = R[
|
|
164
|
-
return
|
|
160
|
+
if (Object.entries(f.value).forEach(([o, c]) => {
|
|
161
|
+
const S = parseInt(o), F = s.value[S];
|
|
162
|
+
!F || !(c.value || c.startValue || c.endValue || F.filterType === "checkbox" && c.value !== void 0) || (t = t.filter((R) => {
|
|
163
|
+
const N = R[F.name];
|
|
164
|
+
return bt(N, c, F);
|
|
165
165
|
}));
|
|
166
166
|
}), a.value.column !== null && a.value.direction) {
|
|
167
|
-
const o = s.value[a.value.column],
|
|
168
|
-
t.sort((S,
|
|
169
|
-
let D = S[o.name], R =
|
|
167
|
+
const o = s.value[a.value.column], c = a.value.direction;
|
|
168
|
+
t.sort((S, F) => {
|
|
169
|
+
let D = S[o.name], R = F[o.name];
|
|
170
170
|
D == null && (D = ""), R == null && (R = "");
|
|
171
171
|
const N = Ee(D), K = Ee(R);
|
|
172
172
|
if (!isNaN(N) && !isNaN(K) && D !== "" && R !== "")
|
|
173
|
-
return
|
|
173
|
+
return c === "asc" ? N - K : K - N;
|
|
174
174
|
{
|
|
175
175
|
const Pe = String(D).toLowerCase(), ze = String(R).toLowerCase();
|
|
176
|
-
return
|
|
176
|
+
return c === "asc" ? Pe.localeCompare(ze) : ze.localeCompare(Pe);
|
|
177
177
|
}
|
|
178
178
|
});
|
|
179
179
|
}
|
|
180
180
|
return t;
|
|
181
|
-
}),
|
|
182
|
-
const S = `${t}:${o}`,
|
|
183
|
-
C.value[S] !==
|
|
181
|
+
}), X = (t, o) => C.value[`${t}:${o}`], P = (t, o, c) => {
|
|
182
|
+
const S = `${t}:${o}`, F = s.value[t];
|
|
183
|
+
C.value[S] !== c && (v.value[o] = !0), C.value[S] = c, l.value[o] = {
|
|
184
184
|
...l.value[o],
|
|
185
|
-
[
|
|
185
|
+
[F.name]: c
|
|
186
186
|
};
|
|
187
|
-
},
|
|
187
|
+
}, G = (t) => {
|
|
188
188
|
l.value = t;
|
|
189
|
-
}, ee = (t, o,
|
|
189
|
+
}, ee = (t, o, c) => {
|
|
190
190
|
const S = `${t}:${o}`;
|
|
191
|
-
C.value[S] !==
|
|
191
|
+
C.value[S] !== c && (v.value[o] = !0, Y.value[S] = c);
|
|
192
192
|
}, de = (t) => {
|
|
193
|
-
const o = s.value.indexOf(t) === s.value.length - 1,
|
|
193
|
+
const o = s.value.indexOf(t) === s.value.length - 1, c = r.value.fullWidth ? t.resizable && !o : t.resizable;
|
|
194
194
|
return {
|
|
195
195
|
width: t.width || "40ch",
|
|
196
196
|
textAlign: t.align || "center",
|
|
197
|
-
...
|
|
197
|
+
...c && {
|
|
198
198
|
resize: "horizontal",
|
|
199
199
|
overflow: "hidden",
|
|
200
200
|
whiteSpace: "nowrap"
|
|
@@ -210,59 +210,59 @@ const yt = (e) => {
|
|
|
210
210
|
}, $e = (t) => {
|
|
211
211
|
const o = l.value[t];
|
|
212
212
|
return y.value && o.gantt !== void 0;
|
|
213
|
-
}, Ie = (t) => !g.value || d.value[t].isRoot || d.value[t].open, Se = (t) => !g.value &&
|
|
213
|
+
}, Ie = (t) => !g.value || d.value[t].isRoot || d.value[t].open, Se = (t) => !g.value && r.value.view !== "list-expansion" ? "" : g.value && (d.value[t].isRoot || d.value[t].isParent) ? d.value[t].childrenOpen ? "▼" : "►" : r.value.view === "list-expansion" ? d.value[t].expanded ? "▼" : "►" : "", De = (t) => {
|
|
214
214
|
if (g.value) {
|
|
215
215
|
const o = n.value[t] || {}, S = !(o.childrenOpen ?? d.value[t].childrenOpen);
|
|
216
216
|
n.value[t] = {
|
|
217
217
|
...o,
|
|
218
218
|
childrenOpen: S
|
|
219
219
|
}, S || we(t);
|
|
220
|
-
} else if (
|
|
221
|
-
const o = n.value[t] || {},
|
|
220
|
+
} else if (r.value.view === "list-expansion") {
|
|
221
|
+
const o = n.value[t] || {}, c = o.expanded ?? d.value[t].expanded;
|
|
222
222
|
n.value[t] = {
|
|
223
223
|
...o,
|
|
224
|
-
expanded: !
|
|
224
|
+
expanded: !c
|
|
225
225
|
};
|
|
226
226
|
}
|
|
227
227
|
}, we = (t) => {
|
|
228
228
|
for (let o = 0; o < l.value.length; o++)
|
|
229
229
|
if (d.value[o].parent === t) {
|
|
230
|
-
const
|
|
230
|
+
const c = n.value[o] || {};
|
|
231
231
|
n.value[o] = {
|
|
232
|
-
...
|
|
232
|
+
...c,
|
|
233
233
|
childrenOpen: !1
|
|
234
234
|
}, we(o);
|
|
235
235
|
}
|
|
236
236
|
}, Ae = (t, o) => {
|
|
237
|
-
const
|
|
238
|
-
return xe(t, o,
|
|
239
|
-
}, xe = (t, o,
|
|
240
|
-
const S = s.value[t],
|
|
237
|
+
const c = X(t, o);
|
|
238
|
+
return xe(t, o, c);
|
|
239
|
+
}, xe = (t, o, c) => {
|
|
240
|
+
const S = s.value[t], F = l.value[o], D = S.format;
|
|
241
241
|
if (!D) {
|
|
242
242
|
const R = Re(S.component);
|
|
243
|
-
return R === "boolean" ?
|
|
243
|
+
return R === "boolean" ? c ? "✓" : "✗" : R === "date" ? c != null ? new Date(String(c)).toLocaleDateString() : c : R === "datetime" ? c != null ? new Date(String(c)).toLocaleString() : c : R === "quantity" ? Je(c) : R === "currency" ? Qe(c) : c;
|
|
244
244
|
}
|
|
245
|
-
return typeof D == "function" ? D(
|
|
245
|
+
return typeof D == "function" ? D(c, { table: C.value, row: F, column: S }) : typeof D == "string" ? Function(`"use strict";return (${D})`)()(c, { table: C.value, row: F, column: S }) : c;
|
|
246
246
|
}, He = (t) => {
|
|
247
247
|
t.target instanceof Node && m.value.parent?.contains(t.target) || m.value.visible && (m.value.visible = !1);
|
|
248
248
|
}, Be = (t) => {
|
|
249
249
|
const o = l.value[t.rowIndex]?.gantt;
|
|
250
250
|
o && (t.type === "resize" ? t.edge === "start" ? (o.startIndex = t.newStart, o.endIndex = t.end, o.colspan = o.endIndex - o.startIndex) : t.edge === "end" && (o.startIndex = t.start, o.endIndex = t.newEnd, o.colspan = o.endIndex - o.startIndex) : t.type === "bar" && (o.startIndex = t.newStart, o.endIndex = t.newEnd, o.colspan = o.endIndex - o.startIndex));
|
|
251
251
|
}, be = (t) => {
|
|
252
|
-
const o =
|
|
253
|
-
o >= 0 ?
|
|
252
|
+
const o = j.value.findIndex((c) => c.id === t.id);
|
|
253
|
+
o >= 0 ? j.value[o] = t : j.value.push(t);
|
|
254
254
|
}, ye = (t) => {
|
|
255
|
-
const o =
|
|
256
|
-
o >= 0 &&
|
|
255
|
+
const o = j.value.findIndex((c) => c.id === t);
|
|
256
|
+
o >= 0 && j.value.splice(o, 1);
|
|
257
257
|
}, Ce = (t) => {
|
|
258
|
-
const o = b.value.findIndex((
|
|
258
|
+
const o = b.value.findIndex((c) => c.id === t.id);
|
|
259
259
|
o >= 0 ? b.value[o] = t : b.value.push(t);
|
|
260
260
|
}, pe = (t) => {
|
|
261
|
-
const o = b.value.findIndex((
|
|
261
|
+
const o = b.value.findIndex((c) => c.id === t);
|
|
262
262
|
o >= 0 && b.value.splice(o, 1);
|
|
263
|
-
}, I = (t, o,
|
|
264
|
-
const S = b.value.find((R) => R.id === t),
|
|
265
|
-
if (!S || !
|
|
263
|
+
}, I = (t, o, c) => {
|
|
264
|
+
const S = b.value.find((R) => R.id === t), F = b.value.find((R) => R.id === o);
|
|
265
|
+
if (!S || !F)
|
|
266
266
|
return console.warn("Cannot create connection: handle not found"), null;
|
|
267
267
|
const D = {
|
|
268
268
|
id: `connection-${t}-${o}`,
|
|
@@ -271,48 +271,48 @@ const yt = (e) => {
|
|
|
271
271
|
side: S.side
|
|
272
272
|
},
|
|
273
273
|
to: {
|
|
274
|
-
barId:
|
|
275
|
-
side:
|
|
274
|
+
barId: F.barId,
|
|
275
|
+
side: F.side
|
|
276
276
|
},
|
|
277
|
-
style:
|
|
278
|
-
label:
|
|
277
|
+
style: c?.style,
|
|
278
|
+
label: c?.label
|
|
279
279
|
};
|
|
280
280
|
return $.value.push(D), D;
|
|
281
|
-
},
|
|
282
|
-
const o = $.value.findIndex((
|
|
281
|
+
}, B = (t) => {
|
|
282
|
+
const o = $.value.findIndex((c) => c.id === t);
|
|
283
283
|
return o >= 0 ? ($.value.splice(o, 1), !0) : !1;
|
|
284
|
-
}, z = (t) => $.value.filter((o) => o.from.barId === t || o.to.barId === t),
|
|
284
|
+
}, z = (t) => $.value.filter((o) => o.from.barId === t || o.to.barId === t), L = (t) => b.value.filter((o) => o.barId === t), U = (t) => {
|
|
285
285
|
if (s.value[t].sortable === !1) return;
|
|
286
|
-
let
|
|
287
|
-
a.value.column === t && a.value.direction === "asc" ?
|
|
286
|
+
let c;
|
|
287
|
+
a.value.column === t && a.value.direction === "asc" ? c = "desc" : c = "asc", a.value.column = t, a.value.direction = c;
|
|
288
288
|
}, q = (t, o) => {
|
|
289
289
|
!o.value && !o.startValue && !o.endValue ? delete f.value[t] : f.value[t] = o;
|
|
290
290
|
}, _ = (t) => {
|
|
291
291
|
delete f.value[t];
|
|
292
292
|
}, Q = (t, o = "end") => {
|
|
293
|
-
const
|
|
294
|
-
for (const
|
|
295
|
-
|
|
296
|
-
t && Object.assign(
|
|
293
|
+
const c = {};
|
|
294
|
+
for (const F of s.value)
|
|
295
|
+
c[F.name] = "";
|
|
296
|
+
t && Object.assign(c, t);
|
|
297
297
|
let S;
|
|
298
|
-
return o === "start" ? (S = 0, l.value.unshift(
|
|
298
|
+
return o === "start" ? (S = 0, l.value.unshift(c)) : o === "end" ? (S = l.value.length, l.value.push(c)) : (S = Math.max(0, Math.min(o, l.value.length)), l.value.splice(S, 0, c)), S;
|
|
299
299
|
};
|
|
300
300
|
return {
|
|
301
301
|
// state
|
|
302
302
|
columns: s,
|
|
303
|
-
config:
|
|
303
|
+
config: r,
|
|
304
304
|
connectionHandles: b,
|
|
305
305
|
connectionPaths: $,
|
|
306
306
|
display: d,
|
|
307
307
|
filterState: f,
|
|
308
|
-
ganttBars:
|
|
308
|
+
ganttBars: j,
|
|
309
309
|
modal: m,
|
|
310
310
|
rows: l,
|
|
311
311
|
sortState: a,
|
|
312
312
|
table: C,
|
|
313
|
-
updates:
|
|
313
|
+
updates: Y,
|
|
314
314
|
// getters
|
|
315
|
-
filteredRows:
|
|
315
|
+
filteredRows: H,
|
|
316
316
|
hasPinnedColumns: x,
|
|
317
317
|
isGanttView: y,
|
|
318
318
|
isTreeView: g,
|
|
@@ -326,52 +326,52 @@ const yt = (e) => {
|
|
|
326
326
|
clearFilter: _,
|
|
327
327
|
closeModal: He,
|
|
328
328
|
createConnection: I,
|
|
329
|
-
deleteConnection:
|
|
329
|
+
deleteConnection: B,
|
|
330
330
|
deleteRow: (t) => {
|
|
331
331
|
if (t < 0 || t >= l.value.length)
|
|
332
332
|
return null;
|
|
333
333
|
const [o] = l.value.splice(t, 1);
|
|
334
334
|
delete v.value[t], delete n.value[t];
|
|
335
|
-
const
|
|
336
|
-
for (const [
|
|
337
|
-
const R = parseInt(
|
|
338
|
-
R > t ?
|
|
335
|
+
const c = {}, S = {};
|
|
336
|
+
for (const [F, D] of Object.entries(v.value)) {
|
|
337
|
+
const R = parseInt(F);
|
|
338
|
+
R > t ? c[R - 1] = D : c[R] = D;
|
|
339
339
|
}
|
|
340
|
-
for (const [
|
|
341
|
-
const R = parseInt(
|
|
340
|
+
for (const [F, D] of Object.entries(n.value)) {
|
|
341
|
+
const R = parseInt(F);
|
|
342
342
|
R > t ? S[R - 1] = D : S[R] = D;
|
|
343
343
|
}
|
|
344
|
-
return v.value =
|
|
344
|
+
return v.value = c, n.value = S, o;
|
|
345
345
|
},
|
|
346
346
|
duplicateRow: (t) => {
|
|
347
347
|
if (t < 0 || t >= l.value.length)
|
|
348
348
|
return -1;
|
|
349
|
-
const o = l.value[t],
|
|
350
|
-
return l.value.splice(S, 0,
|
|
349
|
+
const o = l.value[t], c = JSON.parse(JSON.stringify(o)), S = t + 1;
|
|
350
|
+
return l.value.splice(S, 0, c), S;
|
|
351
351
|
},
|
|
352
|
-
getCellData:
|
|
352
|
+
getCellData: X,
|
|
353
353
|
getCellDisplayValue: Ae,
|
|
354
354
|
getConnectionsForBar: z,
|
|
355
355
|
getFormattedValue: xe,
|
|
356
|
-
getHandlesForBar:
|
|
356
|
+
getHandlesForBar: L,
|
|
357
357
|
getHeaderCellStyle: de,
|
|
358
358
|
getRowExpandSymbol: Se,
|
|
359
359
|
insertRowAbove: (t, o) => {
|
|
360
|
-
const
|
|
361
|
-
return Q(o,
|
|
360
|
+
const c = Math.max(0, t);
|
|
361
|
+
return Q(o, c);
|
|
362
362
|
},
|
|
363
363
|
insertRowBelow: (t, o) => {
|
|
364
|
-
const
|
|
365
|
-
return Q(o,
|
|
364
|
+
const c = Math.min(t + 1, l.value.length);
|
|
365
|
+
return Q(o, c);
|
|
366
366
|
},
|
|
367
367
|
isRowGantt: $e,
|
|
368
368
|
isRowVisible: Ie,
|
|
369
369
|
moveRow: (t, o) => {
|
|
370
370
|
if (t < 0 || t >= l.value.length || o < 0 || o >= l.value.length || t === o)
|
|
371
371
|
return !1;
|
|
372
|
-
const [
|
|
373
|
-
l.value.splice(o, 0,
|
|
374
|
-
const S = {},
|
|
372
|
+
const [c] = l.value.splice(t, 1);
|
|
373
|
+
l.value.splice(o, 0, c);
|
|
374
|
+
const S = {}, F = {};
|
|
375
375
|
for (const [D, R] of Object.entries(v.value)) {
|
|
376
376
|
const N = parseInt(D);
|
|
377
377
|
let K = N;
|
|
@@ -380,25 +380,25 @@ const yt = (e) => {
|
|
|
380
380
|
for (const [D, R] of Object.entries(n.value)) {
|
|
381
381
|
const N = parseInt(D);
|
|
382
382
|
let K = N;
|
|
383
|
-
N === t ? K = o : t < o ? N > t && N <= o && (K = N - 1) : N >= o && N < t && (K = N + 1),
|
|
383
|
+
N === t ? K = o : t < o ? N > t && N <= o && (K = N - 1) : N >= o && N < t && (K = N + 1), F[K] = R;
|
|
384
384
|
}
|
|
385
|
-
return v.value = S, n.value =
|
|
385
|
+
return v.value = S, n.value = F, !0;
|
|
386
386
|
},
|
|
387
387
|
registerConnectionHandle: Ce,
|
|
388
388
|
registerGanttBar: be,
|
|
389
389
|
resizeColumn: ue,
|
|
390
|
-
setCellData:
|
|
390
|
+
setCellData: P,
|
|
391
391
|
setCellText: ee,
|
|
392
392
|
setFilter: q,
|
|
393
|
-
sortByColumn:
|
|
393
|
+
sortByColumn: U,
|
|
394
394
|
toggleRowExpand: De,
|
|
395
395
|
unregisterConnectionHandle: pe,
|
|
396
396
|
unregisterGanttBar: ye,
|
|
397
397
|
updateGanttBar: Be,
|
|
398
|
-
updateRows:
|
|
398
|
+
updateRows: G
|
|
399
399
|
};
|
|
400
400
|
})();
|
|
401
|
-
},
|
|
401
|
+
}, pt = ["data-colindex", "data-rowindex", "data-editable", "contenteditable", "tabindex"], kt = ["innerHTML"], Mt = { key: 2 }, Rt = /* @__PURE__ */ ce({
|
|
402
402
|
__name: "ACell",
|
|
403
403
|
props: {
|
|
404
404
|
colIndex: {},
|
|
@@ -410,32 +410,36 @@ const yt = (e) => {
|
|
|
410
410
|
debounce: { default: 300 }
|
|
411
411
|
},
|
|
412
412
|
setup(e, { expose: k }) {
|
|
413
|
-
const i = ne("cell"), u = e.store.getCellData(e.colIndex, e.rowIndex), M = E(""), s = E(!1), l = e.store.columns[e.colIndex],
|
|
413
|
+
const i = ne("cell"), u = e.store.getCellData(e.colIndex, e.rowIndex), M = E(""), s = E(!1), l = e.store.columns[e.colIndex], r = e.store.rows[e.rowIndex], v = l.align || "center", n = l.width || "40ch", C = Z(() => e.store.getCellDisplayValue(e.colIndex, e.rowIndex)), d = E(null);
|
|
414
414
|
Ne(() => {
|
|
415
415
|
if (!l.linkDoctype) return;
|
|
416
|
-
const p = e.store.getCellData(e.colIndex, e.rowIndex);
|
|
416
|
+
const p = e.store.getCellData(e.colIndex, e.rowIndex), H = r?.[ct(l.name)];
|
|
417
|
+
if (typeof H == "string" || typeof H == "number") {
|
|
418
|
+
d.value = String(H);
|
|
419
|
+
return;
|
|
420
|
+
}
|
|
417
421
|
if (p != null && typeof p == "object") {
|
|
418
|
-
const
|
|
419
|
-
(typeof
|
|
422
|
+
const P = p, G = P.displayText ?? P.id;
|
|
423
|
+
(typeof G == "string" || typeof G == "number") && (d.value = String(G));
|
|
420
424
|
return;
|
|
421
425
|
}
|
|
422
|
-
const
|
|
423
|
-
!
|
|
426
|
+
const X = e.store.linkResolver;
|
|
427
|
+
!X || typeof p != "string" || p === "" || X(l.linkDoctype, p).then((P) => (P != null && (d.value = P), P));
|
|
424
428
|
});
|
|
425
|
-
const m =
|
|
429
|
+
const m = Z(() => d.value ?? C.value), Y = Z(() => typeof m.value == "string" ? wt(m.value) : !1), j = Z(() => ({
|
|
426
430
|
textAlign: v,
|
|
427
431
|
width: n,
|
|
428
432
|
fontWeight: s.value ? "bold" : "inherit",
|
|
429
|
-
paddingLeft:
|
|
430
|
-
})), b =
|
|
433
|
+
paddingLeft: yt(e.colIndex, e.store.display[e.rowIndex]?.indent)
|
|
434
|
+
})), b = Z(() => ({
|
|
431
435
|
"sticky-column": e.pinned,
|
|
432
436
|
"cell-modified": s.value
|
|
433
437
|
})), $ = () => {
|
|
434
438
|
f(), a();
|
|
435
439
|
}, a = () => {
|
|
436
|
-
const { left: p, bottom:
|
|
437
|
-
l.mask, l.modalComponent && e.store.$patch((
|
|
438
|
-
|
|
440
|
+
const { left: p, bottom: H, width: X, height: P } = ve(i);
|
|
441
|
+
l.mask, l.modalComponent && e.store.$patch((G) => {
|
|
442
|
+
G.modal.visible = !0, G.modal.colIndex = e.colIndex, G.modal.rowIndex = e.rowIndex, G.modal.left = p.value, G.modal.bottom = H.value, G.modal.width = X.value, G.modal.height = P.value, G.modal.cell = i.value, typeof l.modalComponent == "function" ? G.modal.component = l.modalComponent({ table: e.store.table, row: r, column: l }) : G.modal.component = l.modalComponent, G.modal.componentProps = l.modalComponentExtraProps;
|
|
439
443
|
});
|
|
440
444
|
};
|
|
441
445
|
if (e.addNavigation) {
|
|
@@ -462,8 +466,8 @@ const yt = (e) => {
|
|
|
462
466
|
const p = window.getSelection();
|
|
463
467
|
if (p)
|
|
464
468
|
try {
|
|
465
|
-
const
|
|
466
|
-
|
|
469
|
+
const H = document.createRange();
|
|
470
|
+
H.selectNodeContents && (H.selectNodeContents(i.value), p.removeAllRanges(), p.addRange(H));
|
|
467
471
|
} catch {
|
|
468
472
|
}
|
|
469
473
|
}
|
|
@@ -473,9 +477,9 @@ const yt = (e) => {
|
|
|
473
477
|
try {
|
|
474
478
|
const p = window.getSelection();
|
|
475
479
|
if (p && p.rangeCount > 0 && i.value) {
|
|
476
|
-
const
|
|
477
|
-
if (
|
|
478
|
-
return
|
|
480
|
+
const H = p.getRangeAt(0), X = H.cloneRange();
|
|
481
|
+
if (X.selectNodeContents && X.setEnd)
|
|
482
|
+
return X.selectNodeContents(i.value), X.setEnd(H.endContainer, H.endOffset), X.toString().length;
|
|
479
483
|
}
|
|
480
484
|
} catch {
|
|
481
485
|
}
|
|
@@ -483,34 +487,34 @@ const yt = (e) => {
|
|
|
483
487
|
}, g = (p) => {
|
|
484
488
|
if (i.value)
|
|
485
489
|
try {
|
|
486
|
-
const
|
|
487
|
-
if (!
|
|
488
|
-
let
|
|
489
|
-
const
|
|
490
|
-
if (!
|
|
491
|
-
let
|
|
492
|
-
for (;
|
|
493
|
-
const de =
|
|
490
|
+
const H = window.getSelection();
|
|
491
|
+
if (!H) return;
|
|
492
|
+
let X = 0;
|
|
493
|
+
const P = document.createTreeWalker ? document.createTreeWalker(i.value, NodeFilter.SHOW_TEXT, null) : null;
|
|
494
|
+
if (!P) return;
|
|
495
|
+
let G, ee = null;
|
|
496
|
+
for (; G = P.nextNode(); ) {
|
|
497
|
+
const de = G, ue = X + de.textContent.length;
|
|
494
498
|
if (p <= ue && (ee = document.createRange(), ee.setStart && ee.setEnd)) {
|
|
495
|
-
ee.setStart(de, p -
|
|
499
|
+
ee.setStart(de, p - X), ee.setEnd(de, p - X);
|
|
496
500
|
break;
|
|
497
501
|
}
|
|
498
|
-
|
|
502
|
+
X = ue;
|
|
499
503
|
}
|
|
500
|
-
ee &&
|
|
504
|
+
ee && H.removeAllRanges && H.addRange && (H.removeAllRanges(), H.addRange(ee));
|
|
501
505
|
} catch {
|
|
502
506
|
}
|
|
503
507
|
}, T = (p) => {
|
|
504
508
|
if (!l.edit) return;
|
|
505
|
-
const
|
|
506
|
-
if (
|
|
509
|
+
const H = p.target;
|
|
510
|
+
if (H.textContent === M.value)
|
|
507
511
|
return;
|
|
508
|
-
const
|
|
509
|
-
M.value =
|
|
510
|
-
}, O =
|
|
512
|
+
const X = y();
|
|
513
|
+
M.value = H.textContent, l.format ? (s.value = H.textContent !== e.store.getFormattedValue(e.colIndex, e.rowIndex, u), e.store.setCellText(e.colIndex, e.rowIndex, H.textContent)) : (s.value = H.textContent !== u, e.store.setCellData(e.colIndex, e.rowIndex, H.textContent)), Ye().then(() => g(X));
|
|
514
|
+
}, O = dt(T, e.debounce);
|
|
511
515
|
return k({
|
|
512
516
|
currentData: M
|
|
513
|
-
}), (p,
|
|
517
|
+
}), (p, H) => (h(), w("td", {
|
|
514
518
|
ref: "cell",
|
|
515
519
|
"data-colindex": e.colIndex,
|
|
516
520
|
"data-rowindex": e.rowIndex,
|
|
@@ -518,30 +522,30 @@ const yt = (e) => {
|
|
|
518
522
|
contenteditable: A(l).edit,
|
|
519
523
|
tabindex: e.tabIndex,
|
|
520
524
|
spellcheck: !1,
|
|
521
|
-
style: se(
|
|
525
|
+
style: se(j.value),
|
|
522
526
|
class: J(["atable-cell", b.value]),
|
|
523
527
|
onFocus: x,
|
|
524
528
|
onPaste: T,
|
|
525
|
-
onInput:
|
|
526
|
-
(...
|
|
529
|
+
onInput: H[0] || (H[0] = //@ts-ignore
|
|
530
|
+
(...X) => A(O) && A(O)(...X)),
|
|
527
531
|
onClick: $
|
|
528
532
|
}, [
|
|
529
533
|
A(l).cellComponent ? (h(), oe(me(A(l).cellComponent), Oe({
|
|
530
534
|
key: 0,
|
|
531
535
|
value: m.value
|
|
532
|
-
}, A(l).cellComponentProps), null, 16, ["value"])) :
|
|
536
|
+
}, A(l).cellComponentProps), null, 16, ["value"])) : Y.value ? (h(), w("span", {
|
|
533
537
|
key: 1,
|
|
534
538
|
innerHTML: m.value
|
|
535
|
-
}, null, 8,
|
|
536
|
-
], 46,
|
|
539
|
+
}, null, 8, kt)) : (h(), w("span", Mt, ie(m.value), 1))
|
|
540
|
+
], 46, pt));
|
|
537
541
|
}
|
|
538
|
-
}),
|
|
542
|
+
}), $t = ["colspan"], It = {
|
|
539
543
|
ref: "container",
|
|
540
544
|
class: "gantt-container"
|
|
541
|
-
},
|
|
545
|
+
}, St = ["data-rowindex", "data-colindex"], Dt = {
|
|
542
546
|
key: 2,
|
|
543
547
|
class: "gantt-label"
|
|
544
|
-
},
|
|
548
|
+
}, At = ["x1", "y1", "x2", "y2"], Ht = /* @__PURE__ */ ce({
|
|
545
549
|
__name: "AGanttCell",
|
|
546
550
|
props: {
|
|
547
551
|
store: {},
|
|
@@ -560,14 +564,14 @@ const yt = (e) => {
|
|
|
560
564
|
v564d6da1: M.value,
|
|
561
565
|
v4f540c19: I.colspan
|
|
562
566
|
}));
|
|
563
|
-
const u = i, M = E(e.color.length >= 6 ? e.color : "#cccccc"), s = `gantt-bar-row-${e.rowIndex}-col-${e.colIndex}`, l = ne("container"),
|
|
564
|
-
const I = b.value / e.colspan * 100,
|
|
567
|
+
const u = i, M = E(e.color.length >= 6 ? e.color : "#cccccc"), s = `gantt-bar-row-${e.rowIndex}-col-${e.colIndex}`, l = ne("container"), r = ne("bar"), v = ne("leftResizeHandle"), n = ne("rightResizeHandle"), C = ne("leftConnectionHandle"), d = ne("rightConnectionHandle"), { width: m } = ve(l), { left: Y, right: j } = ve(r), b = E(e.start), $ = E(e.end || b.value + e.colspan), a = E(!1), f = E(!1), x = E(!1), y = E(!1), g = E(!1), T = E({ startX: 0, startY: 0, endX: 0, endY: 0 }), O = Z(() => de.value || G.value || ee.value), p = Z(() => e.colspan > 0 ? m.value / e.colspan : 0), H = Z(() => {
|
|
568
|
+
const I = b.value / e.colspan * 100, B = $.value / e.colspan * 100;
|
|
565
569
|
return {
|
|
566
570
|
left: `${I}%`,
|
|
567
|
-
width: `${
|
|
571
|
+
width: `${B - I}%`,
|
|
568
572
|
backgroundColor: M.value
|
|
569
573
|
};
|
|
570
|
-
}),
|
|
574
|
+
}), X = Z(() => ({
|
|
571
575
|
position: "fixed",
|
|
572
576
|
top: 0,
|
|
573
577
|
left: 0,
|
|
@@ -575,20 +579,20 @@ const yt = (e) => {
|
|
|
575
579
|
height: "100vh",
|
|
576
580
|
pointerEvents: "none",
|
|
577
581
|
zIndex: 1e3
|
|
578
|
-
})),
|
|
582
|
+
})), P = E({ startX: 0, startPos: 0 }), { isDragging: G } = Te(v, {
|
|
579
583
|
axis: "x",
|
|
580
|
-
onStart: () => ue(
|
|
584
|
+
onStart: () => ue(Y.value, b.value),
|
|
581
585
|
onMove: ({ x: I }) => $e(I),
|
|
582
586
|
onEnd: ({ x: I }) => Ie(I)
|
|
583
587
|
}), { isDragging: ee } = Te(n, {
|
|
584
588
|
axis: "x",
|
|
585
|
-
onStart: () => ue(
|
|
589
|
+
onStart: () => ue(j.value, $.value),
|
|
586
590
|
onMove: ({ x: I }) => Se(I),
|
|
587
591
|
onEnd: ({ x: I }) => De(I)
|
|
588
|
-
}), { isDragging: de } = Te(
|
|
592
|
+
}), { isDragging: de } = Te(r, {
|
|
589
593
|
exact: !0,
|
|
590
594
|
axis: "x",
|
|
591
|
-
onStart: () => ue(
|
|
595
|
+
onStart: () => ue(Y.value, b.value),
|
|
592
596
|
onMove: ({ x: I }) => we(I),
|
|
593
597
|
onEnd: ({ x: I }) => Ae(I)
|
|
594
598
|
});
|
|
@@ -597,65 +601,65 @@ const yt = (e) => {
|
|
|
597
601
|
}), ot(() => {
|
|
598
602
|
He();
|
|
599
603
|
});
|
|
600
|
-
function ue(I,
|
|
601
|
-
|
|
604
|
+
function ue(I, B) {
|
|
605
|
+
r.value && (r.value.style.transition = "none"), P.value = { startX: I, startPos: B };
|
|
602
606
|
}
|
|
603
607
|
function $e(I) {
|
|
604
|
-
if (!
|
|
605
|
-
const z = (I -
|
|
606
|
-
|
|
608
|
+
if (!G.value || !r.value) return;
|
|
609
|
+
const z = (I - P.value.startX) / p.value, L = Math.max(0, Math.min($.value - 1, P.value.startPos + z));
|
|
610
|
+
r.value.style.left = `${L / e.colspan * 100}%`, r.value.style.width = `${($.value - L) / e.colspan * 100}%`;
|
|
607
611
|
}
|
|
608
612
|
function Ie(I) {
|
|
609
|
-
if (!
|
|
610
|
-
const
|
|
611
|
-
b.value =
|
|
613
|
+
if (!r.value) return;
|
|
614
|
+
const B = I - P.value.startX, z = Math.round(B / p.value), L = b.value, U = Math.max(0, Math.min($.value - 1, P.value.startPos + z));
|
|
615
|
+
b.value = U, e.store.updateGanttBar({
|
|
612
616
|
rowIndex: e.rowIndex,
|
|
613
617
|
colIndex: e.colIndex,
|
|
614
618
|
type: "resize",
|
|
615
619
|
edge: "start",
|
|
616
|
-
oldStart:
|
|
617
|
-
newStart:
|
|
620
|
+
oldStart: L,
|
|
621
|
+
newStart: U,
|
|
618
622
|
end: $.value,
|
|
619
623
|
delta: z,
|
|
620
|
-
oldColspan: $.value -
|
|
621
|
-
newColspan: $.value -
|
|
624
|
+
oldColspan: $.value - L,
|
|
625
|
+
newColspan: $.value - U
|
|
622
626
|
});
|
|
623
627
|
}
|
|
624
628
|
function Se(I) {
|
|
625
|
-
if (!ee.value || !
|
|
626
|
-
const z = (I -
|
|
627
|
-
|
|
629
|
+
if (!ee.value || !r.value) return;
|
|
630
|
+
const z = (I - P.value.startX) / p.value, L = Math.max(b.value + 1, Math.min(e.columnsCount, P.value.startPos + z));
|
|
631
|
+
r.value.style.width = `${(L - b.value) / e.colspan * 100}%`;
|
|
628
632
|
}
|
|
629
633
|
function De(I) {
|
|
630
|
-
if (!
|
|
631
|
-
const
|
|
632
|
-
$.value =
|
|
634
|
+
if (!r.value) return;
|
|
635
|
+
const B = I - P.value.startX, z = Math.round(B / p.value), L = $.value, U = Math.max(b.value + 1, Math.min(e.columnsCount, P.value.startPos + z));
|
|
636
|
+
$.value = U, e.store.updateGanttBar({
|
|
633
637
|
rowIndex: e.rowIndex,
|
|
634
638
|
colIndex: e.colIndex,
|
|
635
639
|
type: "resize",
|
|
636
640
|
edge: "end",
|
|
637
|
-
oldEnd:
|
|
638
|
-
newEnd:
|
|
641
|
+
oldEnd: L,
|
|
642
|
+
newEnd: U,
|
|
639
643
|
start: b.value,
|
|
640
644
|
delta: z,
|
|
641
|
-
oldColspan:
|
|
642
|
-
newColspan:
|
|
645
|
+
oldColspan: L - b.value,
|
|
646
|
+
newColspan: U - b.value
|
|
643
647
|
});
|
|
644
648
|
}
|
|
645
649
|
function we(I) {
|
|
646
|
-
if (!de.value || !
|
|
647
|
-
const z = (I -
|
|
648
|
-
|
|
650
|
+
if (!de.value || !r.value) return;
|
|
651
|
+
const z = (I - P.value.startX) / p.value, L = $.value - b.value, U = Math.max(0, Math.min(P.value.startPos + z, e.columnsCount - L));
|
|
652
|
+
r.value.style.left = `${U / e.colspan * 100}%`;
|
|
649
653
|
}
|
|
650
654
|
function Ae(I) {
|
|
651
|
-
if (!
|
|
652
|
-
const
|
|
653
|
-
let _ =
|
|
654
|
-
_ < 0 ? (_ = 0, Q =
|
|
655
|
+
if (!r.value) return;
|
|
656
|
+
const B = I - P.value.startX, z = Math.round(B / p.value), L = $.value - b.value, U = b.value, q = $.value;
|
|
657
|
+
let _ = P.value.startPos + z, Q = _ + L;
|
|
658
|
+
_ < 0 ? (_ = 0, Q = L) : Q > e.columnsCount && (Q = e.columnsCount, _ = Q - L), b.value = _, $.value = Q, e.store.updateGanttBar({
|
|
655
659
|
rowIndex: e.rowIndex,
|
|
656
660
|
colIndex: e.colIndex,
|
|
657
661
|
type: "bar",
|
|
658
|
-
oldStart:
|
|
662
|
+
oldStart: U,
|
|
659
663
|
oldEnd: q,
|
|
660
664
|
newStart: _,
|
|
661
665
|
newEnd: Q,
|
|
@@ -664,7 +668,7 @@ const yt = (e) => {
|
|
|
664
668
|
});
|
|
665
669
|
}
|
|
666
670
|
function xe() {
|
|
667
|
-
const { x: I, y:
|
|
671
|
+
const { x: I, y: B } = ve(r), { x: z, y: L } = ve(C), { x: U, y: q } = ve(d);
|
|
668
672
|
e.store.registerGanttBar({
|
|
669
673
|
id: s,
|
|
670
674
|
rowIndex: e.rowIndex,
|
|
@@ -673,13 +677,13 @@ const yt = (e) => {
|
|
|
673
677
|
endIndex: $,
|
|
674
678
|
color: M,
|
|
675
679
|
label: e.label,
|
|
676
|
-
position: { x: I, y:
|
|
680
|
+
position: { x: I, y: B }
|
|
677
681
|
}), e.store.isDependencyGraphEnabled && (e.store.registerConnectionHandle({
|
|
678
682
|
id: `${s}-connection-left`,
|
|
679
683
|
rowIndex: e.rowIndex,
|
|
680
684
|
colIndex: e.colIndex,
|
|
681
685
|
side: "left",
|
|
682
|
-
position: { x: z, y:
|
|
686
|
+
position: { x: z, y: L },
|
|
683
687
|
visible: a,
|
|
684
688
|
barId: s
|
|
685
689
|
}), e.store.registerConnectionHandle({
|
|
@@ -687,7 +691,7 @@ const yt = (e) => {
|
|
|
687
691
|
rowIndex: e.rowIndex,
|
|
688
692
|
colIndex: e.colIndex,
|
|
689
693
|
side: "right",
|
|
690
|
-
position: { x:
|
|
694
|
+
position: { x: U, y: q },
|
|
691
695
|
visible: f,
|
|
692
696
|
barId: s
|
|
693
697
|
}));
|
|
@@ -701,38 +705,38 @@ const yt = (e) => {
|
|
|
701
705
|
function be() {
|
|
702
706
|
!x.value && !y.value && (a.value = !1, f.value = !1);
|
|
703
707
|
}
|
|
704
|
-
function ye(I,
|
|
705
|
-
|
|
708
|
+
function ye(I, B) {
|
|
709
|
+
B.preventDefault(), B.stopPropagation(), g.value = !0, I === "left" ? x.value = !0 : y.value = !0;
|
|
706
710
|
const z = I === "left" ? C.value : d.value;
|
|
707
711
|
if (z) {
|
|
708
712
|
const q = z.getBoundingClientRect(), _ = q.left + q.width / 2, Q = q.top + q.height / 2;
|
|
709
713
|
T.value = { startX: _, startY: Q, endX: _, endY: Q };
|
|
710
714
|
}
|
|
711
|
-
const
|
|
715
|
+
const L = (q) => {
|
|
712
716
|
T.value.endX = q.clientX, T.value.endY = q.clientY;
|
|
713
|
-
},
|
|
714
|
-
Ce(q, I), pe(
|
|
717
|
+
}, U = (q) => {
|
|
718
|
+
Ce(q, I), pe(L, U);
|
|
715
719
|
};
|
|
716
|
-
document.addEventListener("mousemove",
|
|
720
|
+
document.addEventListener("mousemove", L), document.addEventListener("mouseup", U);
|
|
717
721
|
}
|
|
718
|
-
function Ce(I,
|
|
719
|
-
const
|
|
720
|
-
if (
|
|
721
|
-
const
|
|
722
|
-
if (
|
|
723
|
-
const q = parseInt(
|
|
724
|
-
`${s}-connection-${
|
|
722
|
+
function Ce(I, B) {
|
|
723
|
+
const L = document.elementFromPoint(I.clientX, I.clientY)?.closest(".connection-handle");
|
|
724
|
+
if (L && L !== (B === "left" ? C.value : d.value)) {
|
|
725
|
+
const U = L.closest(".gantt-bar");
|
|
726
|
+
if (U) {
|
|
727
|
+
const q = parseInt(U.getAttribute("data-rowindex") || "0"), _ = parseInt(U.getAttribute("data-colindex") || "0"), Q = L.classList.contains("left-connection-handle") ? "left" : "right", Fe = `gantt-bar-row-${q}-col-${_}`, Ze = e.store.createConnection(
|
|
728
|
+
`${s}-connection-${B}`,
|
|
725
729
|
`${Fe}-connection-${Q}`
|
|
726
730
|
);
|
|
727
731
|
Ze && u("connection:create", Ze);
|
|
728
732
|
}
|
|
729
733
|
}
|
|
730
734
|
}
|
|
731
|
-
function pe(I,
|
|
732
|
-
g.value = !1, x.value = !1, y.value = !1, document.removeEventListener("mousemove", I), document.removeEventListener("mouseup",
|
|
735
|
+
function pe(I, B) {
|
|
736
|
+
g.value = !1, x.value = !1, y.value = !1, document.removeEventListener("mousemove", I), document.removeEventListener("mouseup", B), r.value?.matches(":hover") || be();
|
|
733
737
|
}
|
|
734
738
|
return k({
|
|
735
|
-
barStyle:
|
|
739
|
+
barStyle: H,
|
|
736
740
|
cleanupConnectionDrag: pe,
|
|
737
741
|
currentEnd: $,
|
|
738
742
|
handleConnectionDrop: Ce,
|
|
@@ -741,17 +745,17 @@ const yt = (e) => {
|
|
|
741
745
|
isRightConnectionDragging: y,
|
|
742
746
|
isRightConnectionVisible: f,
|
|
743
747
|
showDragPreview: g
|
|
744
|
-
}), (I,
|
|
748
|
+
}), (I, B) => (h(), w("td", {
|
|
745
749
|
class: "aganttcell",
|
|
746
750
|
colspan: e.colspan
|
|
747
751
|
}, [
|
|
748
|
-
V("div",
|
|
752
|
+
V("div", It, [
|
|
749
753
|
V("div", {
|
|
750
754
|
ref: "bar",
|
|
751
755
|
"data-rowindex": e.rowIndex,
|
|
752
756
|
"data-colindex": e.colIndex,
|
|
753
757
|
class: J(["gantt-bar", { "is-dragging": O.value }]),
|
|
754
|
-
style: se(
|
|
758
|
+
style: se(H.value),
|
|
755
759
|
onMouseenter: Be,
|
|
756
760
|
onMouseleave: be
|
|
757
761
|
}, [
|
|
@@ -759,38 +763,38 @@ const yt = (e) => {
|
|
|
759
763
|
key: 0,
|
|
760
764
|
ref: "leftConnectionHandle",
|
|
761
765
|
class: J(["connection-handle left-connection-handle", { visible: a.value, "is-dragging": x.value }]),
|
|
762
|
-
onMousedown:
|
|
763
|
-
}, [...
|
|
766
|
+
onMousedown: B[0] || (B[0] = fe((z) => ye("left", z), ["stop"]))
|
|
767
|
+
}, [...B[2] || (B[2] = [
|
|
764
768
|
V("div", { class: "connection-dot" }, null, -1)
|
|
765
|
-
])], 34)) :
|
|
769
|
+
])], 34)) : W("", !0),
|
|
766
770
|
e.store.isDependencyGraphEnabled ? (h(), w("div", {
|
|
767
771
|
key: 1,
|
|
768
772
|
ref: "rightConnectionHandle",
|
|
769
773
|
class: J(["connection-handle right-connection-handle", { visible: f.value, "is-dragging": y.value }]),
|
|
770
|
-
onMousedown:
|
|
771
|
-
}, [...
|
|
774
|
+
onMousedown: B[1] || (B[1] = fe((z) => ye("right", z), ["stop"]))
|
|
775
|
+
}, [...B[3] || (B[3] = [
|
|
772
776
|
V("div", { class: "connection-dot" }, null, -1)
|
|
773
|
-
])], 34)) :
|
|
777
|
+
])], 34)) : W("", !0),
|
|
774
778
|
V("div", {
|
|
775
779
|
ref: "leftResizeHandle",
|
|
776
|
-
class: J(["resize-handle left-resize-handle", { "is-dragging": A(
|
|
777
|
-
}, [...
|
|
780
|
+
class: J(["resize-handle left-resize-handle", { "is-dragging": A(G) }])
|
|
781
|
+
}, [...B[4] || (B[4] = [
|
|
778
782
|
V("div", { class: "handle-grip" }, null, -1),
|
|
779
783
|
V("div", { class: "vertical-indicator left-indicator" }, null, -1)
|
|
780
784
|
])], 2),
|
|
781
|
-
e.label ? (h(), w("label",
|
|
785
|
+
e.label ? (h(), w("label", Dt, ie(e.label), 1)) : W("", !0),
|
|
782
786
|
V("div", {
|
|
783
787
|
ref: "rightResizeHandle",
|
|
784
788
|
class: J(["resize-handle right-resize-handle", { "is-dragging": A(ee) }])
|
|
785
|
-
}, [...
|
|
789
|
+
}, [...B[5] || (B[5] = [
|
|
786
790
|
V("div", { class: "handle-grip" }, null, -1),
|
|
787
791
|
V("div", { class: "vertical-indicator right-indicator" }, null, -1)
|
|
788
792
|
])], 2)
|
|
789
|
-
], 46,
|
|
793
|
+
], 46, St)
|
|
790
794
|
], 512),
|
|
791
795
|
e.store.isDependencyGraphEnabled && g.value ? (h(), w("svg", {
|
|
792
796
|
key: 0,
|
|
793
|
-
style: se(
|
|
797
|
+
style: se(X.value)
|
|
794
798
|
}, [
|
|
795
799
|
V("line", {
|
|
796
800
|
x1: T.value.startX,
|
|
@@ -800,29 +804,29 @@ const yt = (e) => {
|
|
|
800
804
|
stroke: "#2196f3",
|
|
801
805
|
"stroke-width": "2",
|
|
802
806
|
"stroke-dasharray": "5,5"
|
|
803
|
-
}, null, 8,
|
|
804
|
-
], 4)) :
|
|
805
|
-
], 8,
|
|
807
|
+
}, null, 8, At)
|
|
808
|
+
], 4)) : W("", !0)
|
|
809
|
+
], 8, $t));
|
|
806
810
|
}
|
|
807
811
|
}), he = (e, k) => {
|
|
808
812
|
const i = e.__vccOpts || e;
|
|
809
813
|
for (const [u, M] of k)
|
|
810
814
|
i[u] = M;
|
|
811
815
|
return i;
|
|
812
|
-
},
|
|
816
|
+
}, Bt = /* @__PURE__ */ he(Ht, [["__scopeId", "data-v-032ef6d9"]]), Zt = `<?xml version="1.0" encoding="UTF-8"?>
|
|
813
817
|
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
|
|
814
818
|
<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;"/>
|
|
815
819
|
<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;"/>
|
|
816
820
|
</svg>
|
|
817
|
-
`,
|
|
821
|
+
`, Tt = `<?xml version="1.0" encoding="UTF-8"?>
|
|
818
822
|
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
|
|
819
823
|
<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;"/>
|
|
820
824
|
<polygon points="46.84 19.99 44.01 17.16 32 29.17 19.99 17.16 17.16 19.99 29.17 32 17.16 44.01 19.99 46.84 32 34.83 44.01 46.84 46.84 44.01 34.83 32 46.84 19.99" style="fill: #000; stroke-width: 0px;"/>
|
|
821
|
-
</svg>`,
|
|
825
|
+
</svg>`, Vt = `<?xml version="1.0" encoding="UTF-8"?>
|
|
822
826
|
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 70.67 70.67">
|
|
823
827
|
<path d="M68.67,16.67h-14.67V2c0-1.1-.9-2-2-2H2C.9,0,0,.9,0,2v50c0,1.1.9,2,2,2h14.67v14.67c0,1.1.9,2,2,2h50c1.1,0,2-.9,2-2V18.67c0-1.1-.9-2-2-2ZM4,4h46v46H4V4ZM66.67,66.67H20.67v-12.67h31.33c1.1,0,2-.9,2-2v-31.33h12.67v46Z" style="fill: #000; stroke-width: 0px;"/>
|
|
824
828
|
<polygon points="41 25 29 25 29 13 25 13 25 25 13 25 13 29 25 29 25 41 29 41 29 29 41 29 41 25" style="fill: #000; stroke-width: 0px;"/>
|
|
825
|
-
</svg>`,
|
|
829
|
+
</svg>`, Et = `<?xml version="1.0" encoding="UTF-8"?>
|
|
826
830
|
<svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 70.6 61.5">
|
|
827
831
|
<path d="M68.6,45.8v13.7H2v-13.7h66.6M70.6,43.8H0v17.7h70.6v-17.7h0Z"/>
|
|
828
832
|
<path d="M68.6,24.2v13.7H2v-13.7h66.6M70.6,22.2H0v17.7h70.6v-17.7h0Z"/>
|
|
@@ -836,7 +840,7 @@ const yt = (e) => {
|
|
|
836
840
|
<polygon points="70.6 18.7 68.1 18.7 68.1 16.7 68.6 16.7 68.6 16.2 70.6 16.2 70.6 18.7"/>
|
|
837
841
|
<path d="M70.6,13.4h-2v-2.7h2v2.7ZM70.6,8h-2v-2.7h2v2.7Z"/>
|
|
838
842
|
</g>
|
|
839
|
-
</svg>`,
|
|
843
|
+
</svg>`, Nt = `<?xml version="1.0" encoding="UTF-8"?>
|
|
840
844
|
<svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 70.6 61.5">
|
|
841
845
|
<g>
|
|
842
846
|
<polygon points="70.6 45.3 68.6 45.3 68.6 44.8 68.1 44.8 68.1 42.8 70.6 42.8 70.6 45.3"/>
|
|
@@ -850,31 +854,31 @@ const yt = (e) => {
|
|
|
850
854
|
</g>
|
|
851
855
|
<path d="M68.6,23.7v13.7H2v-13.7h66.6M70.6,21.7H0v17.7h70.6v-17.7h0Z"/>
|
|
852
856
|
<path d="M68.6,2v13.7H2V2h66.6M70.6,0H0v17.7h70.6V0h0Z"/>
|
|
853
|
-
</svg>`,
|
|
857
|
+
</svg>`, Ot = `<?xml version="1.0" encoding="UTF-8"?>
|
|
854
858
|
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 70.67 70.64">
|
|
855
859
|
<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;"/>
|
|
856
|
-
</svg>`,
|
|
860
|
+
</svg>`, Lt = `<?xml version="1.0" encoding="UTF-8"?>
|
|
857
861
|
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
|
|
858
862
|
<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;"/>
|
|
859
863
|
<polygon points="18,20 18,44 46,32" style="fill: #000; stroke-width: 0px;"/>
|
|
860
864
|
</svg>
|
|
861
|
-
`,
|
|
862
|
-
add:
|
|
863
|
-
delete:
|
|
864
|
-
duplicate:
|
|
865
|
-
insertAbove:
|
|
866
|
-
insertBelow:
|
|
867
|
-
move:
|
|
868
|
-
moveUp:
|
|
869
|
-
moveDown:
|
|
870
|
-
open:
|
|
871
|
-
},
|
|
865
|
+
`, Ft = '<svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M8 13V3.5M4.5 7 8 3.5 11.5 7" stroke-linecap="round" stroke-linejoin="round"/></svg>', Pt = '<svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M8 3v9.5M4.5 9 8 12.5 11.5 9" stroke-linecap="round" stroke-linejoin="round"/></svg>', zt = {
|
|
866
|
+
add: Zt,
|
|
867
|
+
delete: Tt,
|
|
868
|
+
duplicate: Vt,
|
|
869
|
+
insertAbove: Et,
|
|
870
|
+
insertBelow: Nt,
|
|
871
|
+
move: Ot,
|
|
872
|
+
moveUp: Ft,
|
|
873
|
+
moveDown: Pt,
|
|
874
|
+
open: Lt
|
|
875
|
+
}, Xt = {
|
|
872
876
|
key: 0,
|
|
873
877
|
class: "row-actions-dropdown"
|
|
874
|
-
},
|
|
878
|
+
}, Gt = ["aria-expanded"], Wt = ["disabled", "onClick"], jt = ["innerHTML"], Ut = { class: "action-label" }, Yt = {
|
|
875
879
|
key: 1,
|
|
876
880
|
class: "row-actions-icons"
|
|
877
|
-
},
|
|
881
|
+
}, qt = ["title", "aria-label", "disabled", "onClick"], Jt = ["innerHTML"], Me = /* @__PURE__ */ ce({
|
|
878
882
|
__name: "ARowActions",
|
|
879
883
|
props: {
|
|
880
884
|
rowIndex: {},
|
|
@@ -884,7 +888,7 @@ const yt = (e) => {
|
|
|
884
888
|
},
|
|
885
889
|
emits: ["action"],
|
|
886
890
|
setup(e, { emit: k }) {
|
|
887
|
-
const i = e, u = k, M = ne("actionsCell"), s = ne("toggleButton"), l = E(0),
|
|
891
|
+
const i = e, u = k, M = ne("actionsCell"), s = ne("toggleButton"), l = E(0), r = E(!1), v = E(!1), n = E({ top: 0, left: 0 }), C = {
|
|
888
892
|
add: "Add Record",
|
|
889
893
|
delete: "Delete Record",
|
|
890
894
|
duplicate: "Duplicate Record",
|
|
@@ -894,7 +898,7 @@ const yt = (e) => {
|
|
|
894
898
|
moveUp: "Move Up",
|
|
895
899
|
moveDown: "Move Down",
|
|
896
900
|
open: "Open Record"
|
|
897
|
-
}, d =
|
|
901
|
+
}, d = Z(() => {
|
|
898
902
|
const a = [], f = i.config.actions || {}, x = [
|
|
899
903
|
"open",
|
|
900
904
|
"moveUp",
|
|
@@ -909,15 +913,15 @@ const yt = (e) => {
|
|
|
909
913
|
for (const y of x) {
|
|
910
914
|
const g = f[y];
|
|
911
915
|
if (g === !1 || g === void 0) continue;
|
|
912
|
-
let T = !0, O = C[y], p =
|
|
913
|
-
typeof g == "object" && (T = g.enabled !== !1, O = g.label || O, p = g.icon || p, g.disabled && (
|
|
916
|
+
let T = !0, O = C[y], p = zt[y], H = !1;
|
|
917
|
+
typeof g == "object" && (T = g.enabled !== !1, O = g.label || O, p = g.icon || p, g.disabled && (H = g.disabled(i.rowIndex, i.store))), T && a.push({ type: y, label: O, icon: p, disabled: H });
|
|
914
918
|
}
|
|
915
919
|
return a;
|
|
916
|
-
}), m =
|
|
920
|
+
}), m = Z(() => {
|
|
917
921
|
if (i.config.forceDropdown) return !0;
|
|
918
922
|
const a = i.config.dropdownThreshold ?? 150;
|
|
919
923
|
return a === 0 ? !1 : l.value > 0 && l.value < a;
|
|
920
|
-
}),
|
|
924
|
+
}), Y = Z(() => r.value ? v.value ? {
|
|
921
925
|
position: "fixed",
|
|
922
926
|
bottom: `${window.innerHeight - n.value.top}px`,
|
|
923
927
|
left: `${n.value.left}px`,
|
|
@@ -927,12 +931,12 @@ const yt = (e) => {
|
|
|
927
931
|
top: `${n.value.top}px`,
|
|
928
932
|
left: `${n.value.left}px`
|
|
929
933
|
} : {});
|
|
930
|
-
|
|
934
|
+
ut(M, (a) => {
|
|
931
935
|
const f = a[0];
|
|
932
936
|
f && (l.value = f.contentRect.width);
|
|
933
937
|
});
|
|
934
|
-
const
|
|
935
|
-
|
|
938
|
+
const j = () => {
|
|
939
|
+
r.value || b(), r.value = !r.value;
|
|
936
940
|
}, b = () => {
|
|
937
941
|
if (!s.value) return;
|
|
938
942
|
const a = s.value.getBoundingClientRect(), f = window.innerHeight, x = window.innerWidth, y = d.value.length * 40 + 16, g = 160, T = f - a.bottom, O = a.top;
|
|
@@ -943,32 +947,32 @@ const yt = (e) => {
|
|
|
943
947
|
left: p
|
|
944
948
|
};
|
|
945
949
|
};
|
|
946
|
-
|
|
947
|
-
|
|
950
|
+
vt(M, () => {
|
|
951
|
+
r.value = !1;
|
|
948
952
|
});
|
|
949
953
|
const $ = (a, f) => {
|
|
950
|
-
|
|
954
|
+
r.value = !1;
|
|
951
955
|
const x = i.config.actions?.[a];
|
|
952
956
|
typeof x == "object" && x.handler && x.handler(i.rowIndex, i.store) === !1 || u("action", a, i.rowIndex, f);
|
|
953
957
|
};
|
|
954
958
|
return (a, f) => (h(), w("td", {
|
|
955
959
|
ref: "actionsCell",
|
|
956
|
-
class: J(["atable-row-actions", { "sticky-column": e.position === "before-index", "dropdown-active":
|
|
960
|
+
class: J(["atable-row-actions", { "sticky-column": e.position === "before-index", "dropdown-active": r.value }])
|
|
957
961
|
}, [
|
|
958
|
-
m.value ? (h(), w("div",
|
|
962
|
+
m.value ? (h(), w("div", Xt, [
|
|
959
963
|
V("button", {
|
|
960
964
|
ref: "toggleButton",
|
|
961
965
|
type: "button",
|
|
962
966
|
class: "row-actions-toggle",
|
|
963
|
-
"aria-expanded":
|
|
967
|
+
"aria-expanded": r.value,
|
|
964
968
|
"aria-haspopup": "true",
|
|
965
|
-
onClick: fe(
|
|
969
|
+
onClick: fe(j, ["stop"])
|
|
966
970
|
}, [...f[0] || (f[0] = [
|
|
967
971
|
V("span", { class: "dropdown-icon" }, "⋮", -1)
|
|
968
|
-
])], 8,
|
|
972
|
+
])], 8, Gt),
|
|
969
973
|
te(V("div", {
|
|
970
974
|
class: J(["row-actions-menu", { "menu-flipped": v.value }]),
|
|
971
|
-
style: se(
|
|
975
|
+
style: se(Y.value),
|
|
972
976
|
role: "menu"
|
|
973
977
|
}, [
|
|
974
978
|
(h(!0), w(ae, null, re(d.value, (x) => (h(), w("button", {
|
|
@@ -982,13 +986,13 @@ const yt = (e) => {
|
|
|
982
986
|
V("span", {
|
|
983
987
|
class: "action-icon",
|
|
984
988
|
innerHTML: x.icon
|
|
985
|
-
}, null, 8,
|
|
986
|
-
V("span",
|
|
987
|
-
], 8,
|
|
989
|
+
}, null, 8, jt),
|
|
990
|
+
V("span", Ut, ie(x.label), 1)
|
|
991
|
+
], 8, Wt))), 128))
|
|
988
992
|
], 6), [
|
|
989
|
-
[Le,
|
|
993
|
+
[Le, r.value]
|
|
990
994
|
])
|
|
991
|
-
])) : (h(), w("div",
|
|
995
|
+
])) : (h(), w("div", Yt, [
|
|
992
996
|
(h(!0), w(ae, null, re(d.value, (x) => (h(), w("button", {
|
|
993
997
|
key: x.type,
|
|
994
998
|
type: "button",
|
|
@@ -1001,12 +1005,12 @@ const yt = (e) => {
|
|
|
1001
1005
|
V("span", {
|
|
1002
1006
|
class: "action-icon",
|
|
1003
1007
|
innerHTML: x.icon
|
|
1004
|
-
}, null, 8,
|
|
1005
|
-
], 8,
|
|
1008
|
+
}, null, 8, Jt)
|
|
1009
|
+
], 8, qt))), 128))
|
|
1006
1010
|
]))
|
|
1007
1011
|
], 2));
|
|
1008
1012
|
}
|
|
1009
|
-
}),
|
|
1013
|
+
}), Qt = ["tabindex"], Kt = ["tabindex"], _t = ["colspan"], en = /* @__PURE__ */ ce({
|
|
1010
1014
|
__name: "ARow",
|
|
1011
1015
|
props: {
|
|
1012
1016
|
rowIndex: {},
|
|
@@ -1016,18 +1020,18 @@ const yt = (e) => {
|
|
|
1016
1020
|
},
|
|
1017
1021
|
emits: ["row:action", "row:click"],
|
|
1018
1022
|
setup(e, { emit: k }) {
|
|
1019
|
-
const i = k, u = ne("rowEl"), M =
|
|
1023
|
+
const i = k, u = ne("rowEl"), M = Z(() => e.store.isRowVisible(e.rowIndex)), s = Z(() => e.store.getRowExpandSymbol(e.rowIndex)), l = Z(() => e.store.config.clickable ?? !1), r = Z(() => e.store.config.rowActions || { enabled: !1 }), v = Z(() => r.value.enabled), n = Z(() => r.value.position || "before-index"), C = Z(() => e.store.config.view === "list-expansion" && !!e.store.display[e.rowIndex]?.expanded), d = Z(() => {
|
|
1020
1024
|
const b = e.store.config.view === "uncounted" ? 0 : 1, $ = v.value ? 1 : 0;
|
|
1021
1025
|
return e.store.columns.length + b + $;
|
|
1022
1026
|
}), m = (b, $, a) => {
|
|
1023
1027
|
i("row:action", b, $, a);
|
|
1024
|
-
},
|
|
1028
|
+
}, Y = (b) => {
|
|
1025
1029
|
const $ = b.target;
|
|
1026
1030
|
$.closest(".atable-row-actions") || $.closest(".tree-index") || $.closest(".expansion-index") || i("row:click", e.rowIndex, b);
|
|
1027
|
-
},
|
|
1028
|
-
if (e.addNavigation ||
|
|
1031
|
+
}, j = e.store.config.view === "list-expansion";
|
|
1032
|
+
if (e.addNavigation || j) {
|
|
1029
1033
|
let b = {};
|
|
1030
|
-
e.addNavigation === !0 ? b = { ...Ve } : typeof e.addNavigation == "object" && (b = { ...Ve, ...e.addNavigation }),
|
|
1034
|
+
e.addNavigation === !0 ? b = { ...Ve } : typeof e.addNavigation == "object" && (b = { ...Ve, ...e.addNavigation }), j && !b["keydown.control.g"] && (b["keydown.control.g"] = ($) => {
|
|
1031
1035
|
$.stopPropagation(), $.preventDefault(), e.store.toggleRowExpand(e.rowIndex);
|
|
1032
1036
|
}), qe([
|
|
1033
1037
|
{
|
|
@@ -1041,16 +1045,16 @@ const yt = (e) => {
|
|
|
1041
1045
|
ref: "rowEl",
|
|
1042
1046
|
tabindex: e.tabIndex,
|
|
1043
1047
|
class: ["atable-row", { "atable-row-clickable": l.value }],
|
|
1044
|
-
onClick:
|
|
1048
|
+
onClick: Y
|
|
1045
1049
|
}), [
|
|
1046
1050
|
v.value && n.value === "before-index" ? (h(), oe(Me, {
|
|
1047
1051
|
key: 0,
|
|
1048
1052
|
"row-index": e.rowIndex,
|
|
1049
1053
|
store: e.store,
|
|
1050
|
-
config:
|
|
1054
|
+
config: r.value,
|
|
1051
1055
|
position: n.value,
|
|
1052
1056
|
onAction: m
|
|
1053
|
-
}, null, 8, ["row-index", "store", "config", "position"])) :
|
|
1057
|
+
}, null, 8, ["row-index", "store", "config", "position"])) : W("", !0),
|
|
1054
1058
|
e.store.config.view !== "uncounted" ? le(b.$slots, "index", {}, () => [
|
|
1055
1059
|
e.store.config.view === "list" ? (h(), w("td", {
|
|
1056
1060
|
key: 0,
|
|
@@ -1066,26 +1070,26 @@ const yt = (e) => {
|
|
|
1066
1070
|
tabIndex: -1,
|
|
1067
1071
|
class: J(["expansion-index", e.store.hasPinnedColumns ? "sticky-index" : ""]),
|
|
1068
1072
|
onClick: $[1] || ($[1] = (a) => e.store.toggleRowExpand(e.rowIndex))
|
|
1069
|
-
}, ie(s.value), 3)) :
|
|
1070
|
-
], !0, 1) :
|
|
1073
|
+
}, ie(s.value), 3)) : W("", !0)
|
|
1074
|
+
], !0, 1) : W("", !0),
|
|
1071
1075
|
v.value && n.value === "after-index" ? (h(), oe(Me, {
|
|
1072
1076
|
key: 2,
|
|
1073
1077
|
"row-index": e.rowIndex,
|
|
1074
1078
|
store: e.store,
|
|
1075
|
-
config:
|
|
1079
|
+
config: r.value,
|
|
1076
1080
|
position: n.value,
|
|
1077
1081
|
onAction: m
|
|
1078
|
-
}, null, 8, ["row-index", "store", "config", "position"])) :
|
|
1082
|
+
}, null, 8, ["row-index", "store", "config", "position"])) : W("", !0),
|
|
1079
1083
|
le(b.$slots, "default", {}, void 0, !0),
|
|
1080
1084
|
v.value && n.value === "end" ? (h(), oe(Me, {
|
|
1081
1085
|
key: 3,
|
|
1082
1086
|
"row-index": e.rowIndex,
|
|
1083
1087
|
store: e.store,
|
|
1084
|
-
config:
|
|
1088
|
+
config: r.value,
|
|
1085
1089
|
position: n.value,
|
|
1086
1090
|
onAction: m
|
|
1087
|
-
}, null, 8, ["row-index", "store", "config", "position"])) :
|
|
1088
|
-
], 16,
|
|
1091
|
+
}, null, 8, ["row-index", "store", "config", "position"])) : W("", !0)
|
|
1092
|
+
], 16, Qt), [
|
|
1089
1093
|
[Le, M.value]
|
|
1090
1094
|
]),
|
|
1091
1095
|
C.value ? (h(), w("tr", {
|
|
@@ -1103,11 +1107,11 @@ const yt = (e) => {
|
|
|
1103
1107
|
rowIndex: e.rowIndex,
|
|
1104
1108
|
store: e.store
|
|
1105
1109
|
}, void 0, !0)
|
|
1106
|
-
], 8,
|
|
1107
|
-
], 8,
|
|
1110
|
+
], 8, _t)
|
|
1111
|
+
], 8, Kt)) : W("", !0)
|
|
1108
1112
|
], 64));
|
|
1109
1113
|
}
|
|
1110
|
-
}), _e = /* @__PURE__ */ he(
|
|
1114
|
+
}), _e = /* @__PURE__ */ he(en, [["__scopeId", "data-v-4dd47763"]]), tn = { class: "gantt-connection-overlay" }, nn = {
|
|
1111
1115
|
class: "connection-svg",
|
|
1112
1116
|
style: {
|
|
1113
1117
|
position: "absolute",
|
|
@@ -1118,31 +1122,31 @@ const yt = (e) => {
|
|
|
1118
1122
|
pointerEvents: "none",
|
|
1119
1123
|
zIndex: 1
|
|
1120
1124
|
}
|
|
1121
|
-
},
|
|
1125
|
+
}, on = ["d", "stroke-width", "onDblclick"], ln = ["id", "d", "stroke", "stroke-width", "onDblclick"], an = 0.25, ke = 16, sn = /* @__PURE__ */ ce({
|
|
1122
1126
|
__name: "AGanttConnection",
|
|
1123
1127
|
props: {
|
|
1124
1128
|
store: {}
|
|
1125
1129
|
},
|
|
1126
1130
|
emits: ["connection:delete"],
|
|
1127
1131
|
setup(e, { emit: k }) {
|
|
1128
|
-
const i = k, u =
|
|
1129
|
-
const
|
|
1130
|
-
return
|
|
1132
|
+
const i = k, u = Z(() => e.store.connectionPaths.filter((l) => {
|
|
1133
|
+
const r = e.store.ganttBars.find((n) => n.id === l.from.barId), v = e.store.ganttBars.find((n) => n.id === l.to.barId);
|
|
1134
|
+
return r && v;
|
|
1131
1135
|
})), M = (l) => {
|
|
1132
|
-
const
|
|
1136
|
+
const r = e.store.connectionHandles.find(
|
|
1133
1137
|
(O) => O.barId === l.from.barId && O.side === l.from.side
|
|
1134
1138
|
), v = e.store.connectionHandles.find(
|
|
1135
1139
|
(O) => O.barId === l.to.barId && O.side === l.to.side
|
|
1136
1140
|
);
|
|
1137
|
-
if (!
|
|
1138
|
-
const n =
|
|
1141
|
+
if (!r || !v) return "";
|
|
1142
|
+
const n = r.position.x + ke / 2, C = r.position.y + ke / 2, d = v.position.x + ke / 2, m = v.position.y + ke / 2, Y = Math.abs(d - n), j = Math.max(Y * an, 50), b = n + (l.from.side === "left" ? -j : j), $ = d + (l.to.side === "left" ? -j : j), a = { x: 0.5 * n + 0.5 * b, y: 0.5 * C + 0.5 * C }, f = { x: 0.5 * b + 0.5 * $, y: 0.5 * C + 0.5 * m }, x = { x: 0.5 * $ + 0.5 * d, y: 0.5 * m + 0.5 * m }, y = { x: 0.5 * a.x + 0.5 * f.x, y: 0.5 * a.y + 0.5 * f.y }, g = { x: 0.5 * f.x + 0.5 * x.x, y: 0.5 * f.y + 0.5 * x.y }, T = { x: 0.5 * y.x + 0.5 * g.x, y: 0.5 * y.y + 0.5 * g.y };
|
|
1139
1143
|
return `M ${n} ${C} Q ${b} ${C}, ${T.x} ${T.y} Q ${$} ${m}, ${d} ${m}`;
|
|
1140
1144
|
}, s = (l) => {
|
|
1141
1145
|
e.store.deleteConnection(l.id) && i("connection:delete", l);
|
|
1142
1146
|
};
|
|
1143
|
-
return (l,
|
|
1144
|
-
(h(), w("svg",
|
|
1145
|
-
|
|
1147
|
+
return (l, r) => (h(), w("div", tn, [
|
|
1148
|
+
(h(), w("svg", nn, [
|
|
1149
|
+
r[0] || (r[0] = V("defs", null, [
|
|
1146
1150
|
V("path", {
|
|
1147
1151
|
id: "arrowhead",
|
|
1148
1152
|
d: "M 0 -7 L 20 0 L 0 7Z",
|
|
@@ -1173,7 +1177,7 @@ const yt = (e) => {
|
|
|
1173
1177
|
fill: "none",
|
|
1174
1178
|
class: "connection-hitbox",
|
|
1175
1179
|
onDblclick: (n) => s(v)
|
|
1176
|
-
}, null, 40,
|
|
1180
|
+
}, null, 40, on))), 128)),
|
|
1177
1181
|
(h(!0), w(ae, null, re(u.value, (v) => (h(), w("path", {
|
|
1178
1182
|
id: v.id,
|
|
1179
1183
|
key: v.id,
|
|
@@ -1184,17 +1188,17 @@ const yt = (e) => {
|
|
|
1184
1188
|
"marker-mid": "url(#arrowhead-marker)",
|
|
1185
1189
|
class: "connection-path animated-path",
|
|
1186
1190
|
onDblclick: (n) => s(v)
|
|
1187
|
-
}, null, 40,
|
|
1191
|
+
}, null, 40, ln))), 128))
|
|
1188
1192
|
]))
|
|
1189
1193
|
]));
|
|
1190
1194
|
}
|
|
1191
|
-
}),
|
|
1195
|
+
}), rn = /* @__PURE__ */ he(sn, [["__scopeId", "data-v-d5929c98"]]), cn = { class: "column-filter" }, dn = {
|
|
1192
1196
|
key: 2,
|
|
1193
1197
|
class: "checkbox-filter"
|
|
1194
|
-
},
|
|
1198
|
+
}, un = ["value"], vn = {
|
|
1195
1199
|
key: 5,
|
|
1196
1200
|
class: "date-range-filter"
|
|
1197
|
-
},
|
|
1201
|
+
}, fn = /* @__PURE__ */ ce({
|
|
1198
1202
|
__name: "ATableColumnFilter",
|
|
1199
1203
|
props: {
|
|
1200
1204
|
column: {},
|
|
@@ -1217,7 +1221,7 @@ const yt = (e) => {
|
|
|
1217
1221
|
}, i = E(""), u = lt({
|
|
1218
1222
|
startValue: "",
|
|
1219
1223
|
endValue: ""
|
|
1220
|
-
}), M =
|
|
1224
|
+
}), M = Z(() => {
|
|
1221
1225
|
if (e.column.filterType) return e.column.filterType;
|
|
1222
1226
|
const C = Re(e.column.component);
|
|
1223
1227
|
return C ? k[C] : "text";
|
|
@@ -1225,13 +1229,13 @@ const yt = (e) => {
|
|
|
1225
1229
|
if (C.filterOptions) return C.filterOptions;
|
|
1226
1230
|
const d = /* @__PURE__ */ new Set();
|
|
1227
1231
|
return e.store.rows.forEach((m) => {
|
|
1228
|
-
const
|
|
1229
|
-
|
|
1232
|
+
const Y = m[C.name];
|
|
1233
|
+
Y != null && Y !== "" && d.add(Y);
|
|
1230
1234
|
}), Array.from(d).map((m) => ({
|
|
1231
1235
|
value: m,
|
|
1232
1236
|
label: String(m)
|
|
1233
1237
|
}));
|
|
1234
|
-
}, l =
|
|
1238
|
+
}, l = Z(() => !!(i.value || u.startValue || u.endValue)), r = (C) => {
|
|
1235
1239
|
!C && M.value !== "checkbox" ? (e.store.clearFilter(e.colIndex), i.value = "") : (i.value = C, e.store.setFilter(e.colIndex, { value: C }));
|
|
1236
1240
|
}, v = (C, d) => {
|
|
1237
1241
|
C === "start" ? u.startValue = d : u.endValue = d, !u.startValue && !u.endValue ? e.store.clearFilter(e.colIndex) : e.store.setFilter(e.colIndex, {
|
|
@@ -1242,13 +1246,13 @@ const yt = (e) => {
|
|
|
1242
1246
|
}, n = () => {
|
|
1243
1247
|
i.value = "", u.startValue = "", u.endValue = "", e.store.clearFilter(e.colIndex);
|
|
1244
1248
|
};
|
|
1245
|
-
return (C, d) => (h(), w("div",
|
|
1249
|
+
return (C, d) => (h(), w("div", cn, [
|
|
1246
1250
|
M.value === "text" ? te((h(), w("input", {
|
|
1247
1251
|
key: 0,
|
|
1248
1252
|
"onUpdate:modelValue": d[0] || (d[0] = (m) => i.value = m),
|
|
1249
1253
|
type: "text",
|
|
1250
1254
|
class: "filter-input",
|
|
1251
|
-
onInput: d[1] || (d[1] = (m) =>
|
|
1255
|
+
onInput: d[1] || (d[1] = (m) => r(i.value))
|
|
1252
1256
|
}, null, 544)), [
|
|
1253
1257
|
[ge, i.value]
|
|
1254
1258
|
]) : M.value === "number" ? te((h(), w("input", {
|
|
@@ -1256,15 +1260,15 @@ const yt = (e) => {
|
|
|
1256
1260
|
"onUpdate:modelValue": d[2] || (d[2] = (m) => i.value = m),
|
|
1257
1261
|
type: "number",
|
|
1258
1262
|
class: "filter-input",
|
|
1259
|
-
onInput: d[3] || (d[3] = (m) =>
|
|
1263
|
+
onInput: d[3] || (d[3] = (m) => r(i.value))
|
|
1260
1264
|
}, null, 544)), [
|
|
1261
1265
|
[ge, i.value]
|
|
1262
|
-
]) : M.value === "checkbox" ? (h(), w("label",
|
|
1266
|
+
]) : M.value === "checkbox" ? (h(), w("label", dn, [
|
|
1263
1267
|
te(V("input", {
|
|
1264
1268
|
"onUpdate:modelValue": d[4] || (d[4] = (m) => i.value = m),
|
|
1265
1269
|
type: "checkbox",
|
|
1266
1270
|
class: "filter-checkbox",
|
|
1267
|
-
onChange: d[5] || (d[5] = (m) =>
|
|
1271
|
+
onChange: d[5] || (d[5] = (m) => r(i.value))
|
|
1268
1272
|
}, null, 544), [
|
|
1269
1273
|
[at, i.value]
|
|
1270
1274
|
]),
|
|
@@ -1273,13 +1277,13 @@ const yt = (e) => {
|
|
|
1273
1277
|
key: 3,
|
|
1274
1278
|
"onUpdate:modelValue": d[6] || (d[6] = (m) => i.value = m),
|
|
1275
1279
|
class: "filter-select",
|
|
1276
|
-
onChange: d[7] || (d[7] = (m) =>
|
|
1280
|
+
onChange: d[7] || (d[7] = (m) => r(i.value))
|
|
1277
1281
|
}, [
|
|
1278
1282
|
d[15] || (d[15] = V("option", { value: "" }, "All", -1)),
|
|
1279
1283
|
(h(!0), w(ae, null, re(s(e.column), (m) => (h(), w("option", {
|
|
1280
1284
|
key: m.value || m,
|
|
1281
1285
|
value: m.value || m
|
|
1282
|
-
}, ie(m.label || m), 9,
|
|
1286
|
+
}, ie(m.label || m), 9, un))), 128))
|
|
1283
1287
|
], 544)), [
|
|
1284
1288
|
[st, i.value]
|
|
1285
1289
|
]) : M.value === "date" ? te((h(), w("input", {
|
|
@@ -1287,10 +1291,10 @@ const yt = (e) => {
|
|
|
1287
1291
|
"onUpdate:modelValue": d[8] || (d[8] = (m) => i.value = m),
|
|
1288
1292
|
type: "date",
|
|
1289
1293
|
class: "filter-input",
|
|
1290
|
-
onChange: d[9] || (d[9] = (m) =>
|
|
1294
|
+
onChange: d[9] || (d[9] = (m) => r(i.value))
|
|
1291
1295
|
}, null, 544)), [
|
|
1292
1296
|
[ge, i.value]
|
|
1293
|
-
]) : M.value === "dateRange" ? (h(), w("div",
|
|
1297
|
+
]) : M.value === "dateRange" ? (h(), w("div", vn, [
|
|
1294
1298
|
te(V("input", {
|
|
1295
1299
|
"onUpdate:modelValue": d[10] || (d[10] = (m) => u.startValue = m),
|
|
1296
1300
|
type: "date",
|
|
@@ -1314,32 +1318,32 @@ const yt = (e) => {
|
|
|
1314
1318
|
column: e.column,
|
|
1315
1319
|
"col-index": e.colIndex,
|
|
1316
1320
|
store: e.store,
|
|
1317
|
-
"onUpdate:value": d[14] || (d[14] = (m) =>
|
|
1318
|
-
}, null, 40, ["value", "column", "col-index", "store"])) :
|
|
1321
|
+
"onUpdate:value": d[14] || (d[14] = (m) => r(m))
|
|
1322
|
+
}, null, 40, ["value", "column", "col-index", "store"])) : W("", !0),
|
|
1319
1323
|
l.value ? (h(), w("button", {
|
|
1320
1324
|
key: 7,
|
|
1321
1325
|
class: "clear-btn",
|
|
1322
1326
|
title: "Clear",
|
|
1323
1327
|
onClick: n
|
|
1324
|
-
}, "×")) :
|
|
1328
|
+
}, "×")) : W("", !0)
|
|
1325
1329
|
]));
|
|
1326
1330
|
}
|
|
1327
|
-
}),
|
|
1331
|
+
}), hn = /* @__PURE__ */ he(fn, [["__scopeId", "data-v-a0263c77"]]), gn = { key: 0 }, mn = {
|
|
1328
1332
|
class: "atable-header-row",
|
|
1329
1333
|
tabindex: "-1"
|
|
1330
|
-
},
|
|
1334
|
+
}, wn = {
|
|
1331
1335
|
key: 2,
|
|
1332
1336
|
class: "row-actions-header"
|
|
1333
|
-
},
|
|
1337
|
+
}, xn = ["data-colindex", "onClick"], bn = {
|
|
1334
1338
|
key: 3,
|
|
1335
1339
|
class: "row-actions-header"
|
|
1336
|
-
},
|
|
1340
|
+
}, yn = {
|
|
1337
1341
|
key: 0,
|
|
1338
1342
|
class: "atable-filters-row"
|
|
1339
|
-
},
|
|
1343
|
+
}, Cn = {
|
|
1340
1344
|
key: 2,
|
|
1341
1345
|
class: "row-actions-header"
|
|
1342
|
-
},
|
|
1346
|
+
}, pn = {
|
|
1343
1347
|
key: 3,
|
|
1344
1348
|
class: "row-actions-header"
|
|
1345
1349
|
}, et = /* @__PURE__ */ ce({
|
|
@@ -1349,19 +1353,19 @@ const yt = (e) => {
|
|
|
1349
1353
|
store: {}
|
|
1350
1354
|
},
|
|
1351
1355
|
setup(e) {
|
|
1352
|
-
const k =
|
|
1353
|
-
for (const
|
|
1354
|
-
if (
|
|
1355
|
-
const n =
|
|
1356
|
+
const k = Z(() => e.columns.filter((l) => l.filterable)), i = Z(() => e.store.config.rowActions?.enabled ?? !1), u = Z(() => e.store.config.rowActions?.position ?? "before-index"), M = (l) => e.store.sortByColumn(l), s = (l) => {
|
|
1357
|
+
for (const r of l) {
|
|
1358
|
+
if (r.borderBoxSize.length === 0) continue;
|
|
1359
|
+
const n = r.borderBoxSize[0].inlineSize, C = Number(r.target.dataset.colindex), d = e.store.columns[C]?.width;
|
|
1356
1360
|
typeof d == "number" && d !== n && e.store.resizeColumn(C, n);
|
|
1357
1361
|
}
|
|
1358
1362
|
};
|
|
1359
|
-
return (l,
|
|
1360
|
-
V("tr",
|
|
1363
|
+
return (l, r) => e.columns.length ? (h(), w("thead", gn, [
|
|
1364
|
+
V("tr", mn, [
|
|
1361
1365
|
i.value && u.value === "before-index" ? (h(), w("th", {
|
|
1362
1366
|
key: 0,
|
|
1363
1367
|
class: J(["row-actions-header", { "sticky-column": u.value === "before-index" }])
|
|
1364
|
-
}, null, 2)) :
|
|
1368
|
+
}, null, 2)) : W("", !0),
|
|
1365
1369
|
e.store.zeroColumn ? (h(), w("th", {
|
|
1366
1370
|
key: 1,
|
|
1367
1371
|
id: "header-index",
|
|
@@ -1370,8 +1374,8 @@ const yt = (e) => {
|
|
|
1370
1374
|
e.store.isTreeView ? "tree-index" : "",
|
|
1371
1375
|
e.store.config.view === "list-expansion" ? "list-expansion-index" : ""
|
|
1372
1376
|
], "list-index"])
|
|
1373
|
-
}, null, 2)) :
|
|
1374
|
-
i.value && u.value === "after-index" ? (h(), w("th",
|
|
1377
|
+
}, null, 2)) : W("", !0),
|
|
1378
|
+
i.value && u.value === "after-index" ? (h(), w("th", wn)) : W("", !0),
|
|
1375
1379
|
(h(!0), w(ae, null, re(e.columns, (v, n) => te((h(), w("th", {
|
|
1376
1380
|
key: v.name,
|
|
1377
1381
|
"data-colindex": n,
|
|
@@ -1383,16 +1387,16 @@ const yt = (e) => {
|
|
|
1383
1387
|
le(l.$slots, "default", {}, () => [
|
|
1384
1388
|
it(ie(v.label || String.fromCharCode(n + 97).toUpperCase()), 1)
|
|
1385
1389
|
])
|
|
1386
|
-
], 14,
|
|
1387
|
-
[A(
|
|
1390
|
+
], 14, xn)), [
|
|
1391
|
+
[A(gt), s]
|
|
1388
1392
|
])), 128)),
|
|
1389
|
-
i.value && u.value === "end" ? (h(), w("th",
|
|
1393
|
+
i.value && u.value === "end" ? (h(), w("th", bn)) : W("", !0)
|
|
1390
1394
|
]),
|
|
1391
|
-
k.value.length > 0 ? (h(), w("tr",
|
|
1395
|
+
k.value.length > 0 ? (h(), w("tr", yn, [
|
|
1392
1396
|
i.value && u.value === "before-index" ? (h(), w("th", {
|
|
1393
1397
|
key: 0,
|
|
1394
1398
|
class: J(["row-actions-header", { "sticky-column": u.value === "before-index" }])
|
|
1395
|
-
}, null, 2)) :
|
|
1399
|
+
}, null, 2)) : W("", !0),
|
|
1396
1400
|
e.store.zeroColumn ? (h(), w("th", {
|
|
1397
1401
|
key: 1,
|
|
1398
1402
|
class: J([[
|
|
@@ -1400,23 +1404,23 @@ const yt = (e) => {
|
|
|
1400
1404
|
e.store.isTreeView ? "tree-index" : "",
|
|
1401
1405
|
e.store.config.view === "list-expansion" ? "list-expansion-index" : ""
|
|
1402
1406
|
], "list-index"])
|
|
1403
|
-
}, null, 2)) :
|
|
1404
|
-
i.value && u.value === "after-index" ? (h(), w("th",
|
|
1407
|
+
}, null, 2)) : W("", !0),
|
|
1408
|
+
i.value && u.value === "after-index" ? (h(), w("th", Cn)) : W("", !0),
|
|
1405
1409
|
(h(!0), w(ae, null, re(e.columns, (v, n) => (h(), w("th", {
|
|
1406
1410
|
key: `filter-${v.name}`,
|
|
1407
1411
|
class: J(`${v.pinned ? "sticky-column" : ""}`),
|
|
1408
1412
|
style: se(e.store.getHeaderCellStyle(v))
|
|
1409
1413
|
}, [
|
|
1410
|
-
v.filterable ? (h(), oe(
|
|
1414
|
+
v.filterable ? (h(), oe(hn, {
|
|
1411
1415
|
key: 0,
|
|
1412
1416
|
column: v,
|
|
1413
1417
|
"col-index": n,
|
|
1414
1418
|
store: e.store
|
|
1415
|
-
}, null, 8, ["column", "col-index", "store"])) :
|
|
1419
|
+
}, null, 8, ["column", "col-index", "store"])) : W("", !0)
|
|
1416
1420
|
], 6))), 128)),
|
|
1417
|
-
i.value && u.value === "end" ? (h(), w("th",
|
|
1418
|
-
])) :
|
|
1419
|
-
])) :
|
|
1421
|
+
i.value && u.value === "end" ? (h(), w("th", pn)) : W("", !0)
|
|
1422
|
+
])) : W("", !0)
|
|
1423
|
+
])) : W("", !0);
|
|
1420
1424
|
}
|
|
1421
1425
|
}), tt = /* @__PURE__ */ ce({
|
|
1422
1426
|
__name: "ATableModal",
|
|
@@ -1424,16 +1428,16 @@ const yt = (e) => {
|
|
|
1424
1428
|
store: {}
|
|
1425
1429
|
},
|
|
1426
1430
|
setup(e) {
|
|
1427
|
-
const k = ne("amodal"), { width: i, height: u } = ve(k), M =
|
|
1431
|
+
const k = ne("amodal"), { width: i, height: u } = ve(k), M = Z(() => {
|
|
1428
1432
|
if (!(e.store.modal.height && e.store.modal.width && e.store.modal.left && e.store.modal.bottom)) return {};
|
|
1429
1433
|
const s = e.store.modal.cell?.closest("table");
|
|
1430
1434
|
if (!s) return {};
|
|
1431
|
-
const l = s.offsetHeight || 0,
|
|
1435
|
+
const l = s.offsetHeight || 0, r = s.offsetWidth || 0;
|
|
1432
1436
|
let v = e.store.modal.cell?.offsetTop || 0;
|
|
1433
1437
|
const n = s.querySelector("thead")?.offsetHeight || 0;
|
|
1434
1438
|
v += n, v = v + u.value < l ? v : v - (u.value + e.store.modal.height);
|
|
1435
1439
|
let C = e.store.modal.cell?.offsetLeft || 0;
|
|
1436
|
-
return C = C + i.value <=
|
|
1440
|
+
return C = C + i.value <= r ? C : C - (i.value - e.store.modal.width), {
|
|
1437
1441
|
left: `${C}px`,
|
|
1438
1442
|
top: `${v}px`
|
|
1439
1443
|
};
|
|
@@ -1452,7 +1456,7 @@ const yt = (e) => {
|
|
|
1452
1456
|
], 36));
|
|
1453
1457
|
}
|
|
1454
1458
|
});
|
|
1455
|
-
function
|
|
1459
|
+
function kn(e) {
|
|
1456
1460
|
return e.filter((k) => !k.hidden && k.component).map(({ fieldname: k, hidden: i, ...u }) => {
|
|
1457
1461
|
const M = Object.assign({ name: k }, u);
|
|
1458
1462
|
return u.doctype && !u.cellComponent && (M.linkDoctype = u.doctype, u.format || (M.format = (s) => {
|
|
@@ -1465,10 +1469,10 @@ function pn(e) {
|
|
|
1465
1469
|
})), Re(u.component) === "quantity" && !u.format && (M.format = Je), Re(u.component) === "currency" && !u.format && (M.format = Qe), M;
|
|
1466
1470
|
});
|
|
1467
1471
|
}
|
|
1468
|
-
const
|
|
1472
|
+
const Mn = {
|
|
1469
1473
|
class: "atable-container",
|
|
1470
1474
|
style: { position: "relative" }
|
|
1471
|
-
},
|
|
1475
|
+
}, Rn = /* @__PURE__ */ ce({
|
|
1472
1476
|
__name: "ATable",
|
|
1473
1477
|
props: /* @__PURE__ */ Ue({
|
|
1474
1478
|
id: { default: "" },
|
|
@@ -1483,8 +1487,8 @@ const kn = {
|
|
|
1483
1487
|
}),
|
|
1484
1488
|
emits: /* @__PURE__ */ Ue(["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"]),
|
|
1485
1489
|
setup(e, { expose: k, emit: i }) {
|
|
1486
|
-
const u = Xe(e, "rows"), M = Xe(e, "columns"), s = i, l = ne("table"),
|
|
1487
|
-
columns:
|
|
1490
|
+
const u = Xe(e, "rows"), M = Xe(e, "columns"), s = i, l = ne("table"), r = M.value?.length ? M.value : kn(e.schema ?? []), v = rt("aformLinkResolver", null), n = Ct({
|
|
1491
|
+
columns: r,
|
|
1488
1492
|
rows: u.value,
|
|
1489
1493
|
id: e.id,
|
|
1490
1494
|
config: e.config,
|
|
@@ -1518,9 +1522,9 @@ const kn = {
|
|
|
1518
1522
|
},
|
|
1519
1523
|
{ deep: !0 }
|
|
1520
1524
|
), Ne(() => {
|
|
1521
|
-
M.value?.some((a) => a.pinned) && (d(), n.isTreeView &&
|
|
1525
|
+
M.value?.some((a) => a.pinned) && (d(), n.isTreeView && ft(l, d, { childList: !0, subtree: !0 }));
|
|
1522
1526
|
});
|
|
1523
|
-
const C =
|
|
1527
|
+
const C = Z(() => n.columns.filter((a) => a.pinned).length), d = () => {
|
|
1524
1528
|
const a = l.value, f = a?.rows[0], x = a?.rows[1], y = f ? Array.from(f.cells) : [];
|
|
1525
1529
|
for (const [g, T] of y.entries()) {
|
|
1526
1530
|
const O = x?.cells[g];
|
|
@@ -1557,9 +1561,9 @@ const kn = {
|
|
|
1557
1561
|
width: "auto"
|
|
1558
1562
|
// TODO: refactor to API that can detect when data exists in a cell. Might have be custom and not generalizable
|
|
1559
1563
|
}), f;
|
|
1560
|
-
},
|
|
1564
|
+
}, Y = (a) => {
|
|
1561
1565
|
s("connection:event", { type: "create", connection: a });
|
|
1562
|
-
},
|
|
1566
|
+
}, j = (a) => {
|
|
1563
1567
|
s("connection:event", { type: "delete", connection: a });
|
|
1564
1568
|
}, b = (a, f) => {
|
|
1565
1569
|
const x = n.rows[a];
|
|
@@ -1626,7 +1630,7 @@ const kn = {
|
|
|
1626
1630
|
insertRowAbove: n.insertRowAbove,
|
|
1627
1631
|
insertRowBelow: n.insertRowBelow,
|
|
1628
1632
|
moveRow: n.moveRow
|
|
1629
|
-
}), (a, f) => (h(), w("div",
|
|
1633
|
+
}), (a, f) => (h(), w("div", Mn, [
|
|
1630
1634
|
te((h(), w("table", {
|
|
1631
1635
|
ref: "table",
|
|
1632
1636
|
class: "atable",
|
|
@@ -1670,7 +1674,7 @@ const kn = {
|
|
|
1670
1674
|
minWidth: g?.width || "40ch",
|
|
1671
1675
|
width: A(n).config.fullWidth ? "auto" : null
|
|
1672
1676
|
}),
|
|
1673
|
-
"onConnection:create":
|
|
1677
|
+
"onConnection:create": Y
|
|
1674
1678
|
}, null, 40, ["store", "columns-count", "color", "start", "end", "colspan", "pinned", "row-index", "col-index", "style"])) : (h(), oe(me(g.cellComponent || "ACell"), {
|
|
1675
1679
|
key: 1,
|
|
1676
1680
|
store: A(n),
|
|
@@ -1706,57 +1710,57 @@ const kn = {
|
|
|
1706
1710
|
])
|
|
1707
1711
|
], !0)
|
|
1708
1712
|
], 4)), [
|
|
1709
|
-
[A(
|
|
1713
|
+
[A(mt), A(n).closeModal]
|
|
1710
1714
|
]),
|
|
1711
|
-
A(n).isGanttView && A(n).isDependencyGraphEnabled ? (h(), oe(
|
|
1715
|
+
A(n).isGanttView && A(n).isDependencyGraphEnabled ? (h(), oe(rn, {
|
|
1712
1716
|
key: 0,
|
|
1713
1717
|
store: A(n),
|
|
1714
|
-
"onConnection:delete":
|
|
1715
|
-
}, null, 8, ["store"])) :
|
|
1718
|
+
"onConnection:delete": j
|
|
1719
|
+
}, null, 8, ["store"])) : W("", !0)
|
|
1716
1720
|
]));
|
|
1717
1721
|
}
|
|
1718
|
-
}),
|
|
1719
|
-
function
|
|
1720
|
-
return h(), w("div",
|
|
1721
|
-
V("h2",
|
|
1722
|
+
}), $n = /* @__PURE__ */ he(Rn, [["__scopeId", "data-v-4bfbbeab"]]), In = {}, Sn = { class: "aloading" }, Dn = { class: "aloading-header" };
|
|
1723
|
+
function An(e, k) {
|
|
1724
|
+
return h(), w("div", Sn, [
|
|
1725
|
+
V("h2", Dn, [
|
|
1722
1726
|
le(e.$slots, "default", {}, void 0, !0)
|
|
1723
1727
|
]),
|
|
1724
1728
|
k[0] || (k[0] = V("div", { class: "aloading-bar" }, null, -1))
|
|
1725
1729
|
]);
|
|
1726
1730
|
}
|
|
1727
|
-
const
|
|
1728
|
-
function
|
|
1729
|
-
return h(), w("div",
|
|
1730
|
-
V("h2",
|
|
1731
|
+
const Hn = /* @__PURE__ */ he(In, [["render", An], ["__scopeId", "data-v-a930a25b"]]), Bn = {}, Zn = { class: "aloading" }, Tn = { class: "aloading-header" };
|
|
1732
|
+
function Vn(e, k) {
|
|
1733
|
+
return h(), w("div", Zn, [
|
|
1734
|
+
V("h2", Tn, [
|
|
1731
1735
|
le(e.$slots, "default", {}, void 0, !0)
|
|
1732
1736
|
]),
|
|
1733
1737
|
k[0] || (k[0] = V("div", { class: "aloading-bar" }, null, -1))
|
|
1734
1738
|
]);
|
|
1735
1739
|
}
|
|
1736
|
-
const
|
|
1737
|
-
function
|
|
1738
|
-
e.component("ACell",
|
|
1740
|
+
const En = /* @__PURE__ */ he(Bn, [["render", Vn], ["__scopeId", "data-v-e1165876"]]);
|
|
1741
|
+
function Un(e) {
|
|
1742
|
+
e.component("ACell", Rt), e.component("AGanttCell", Bt), e.component("ARow", _e), e.component("ARowActions", Me), e.component("ATable", $n), e.component("ATableHeader", et), e.component("ATableLoading", Hn), e.component("ATableLoadingBar", En), e.component("ATableModal", tt);
|
|
1739
1743
|
}
|
|
1740
1744
|
export {
|
|
1741
|
-
|
|
1742
|
-
|
|
1745
|
+
Rt as ACell,
|
|
1746
|
+
Bt as AGanttCell,
|
|
1743
1747
|
_e as ARow,
|
|
1744
1748
|
Me as ARowActions,
|
|
1745
|
-
|
|
1749
|
+
$n as ATable,
|
|
1746
1750
|
et as ATableHeader,
|
|
1747
|
-
|
|
1748
|
-
|
|
1751
|
+
Hn as ATableLoading,
|
|
1752
|
+
En as ATableLoadingBar,
|
|
1749
1753
|
tt as ATableModal,
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1754
|
+
Zt as AddIcon,
|
|
1755
|
+
Tt as DeleteIcon,
|
|
1756
|
+
Vt as DuplicateIcon,
|
|
1757
|
+
Et as InsertAboveIcon,
|
|
1758
|
+
Nt as InsertBelowIcon,
|
|
1759
|
+
Ot as MoveIcon,
|
|
1760
|
+
Lt as OpenIcon,
|
|
1761
|
+
zt as actionIcons,
|
|
1762
|
+
Ct as createTableStore,
|
|
1763
|
+
Un as install,
|
|
1764
|
+
kn as schemaToColumns
|
|
1761
1765
|
};
|
|
1762
1766
|
//# sourceMappingURL=atable.js.map
|