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