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