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