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