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