@stonecrop/atable 0.4.21 → 0.4.22
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/atable.js +577 -544
- package/dist/atable.js.map +1 -1
- package/dist/atable.umd.cjs +2 -2
- package/dist/atable.umd.cjs.map +1 -1
- package/package.json +3 -3
- package/src/components/ACell.vue +6 -2
package/dist/atable.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { onMounted as
|
|
1
|
+
import { onMounted as Z, ref as O, watch as X, onBeforeUnmount as rt, computed as k, shallowRef as H, toValue as x, watchEffect as it, getCurrentScope as qe, onScopeDispose as Je, unref as b, getCurrentInstance as ge, nextTick as Qe, isRef as ut, toRefs as ct, customRef as Ze, toRef as dt, readonly as ft, defineComponent as K, useTemplateRef as G, createElementBlock as A, openBlock as S, normalizeClass as Y, normalizeStyle as J, createBlock as re, resolveDynamicComponent as fe, mergeProps as Se, toDisplayString as _, Fragment as ie, createElementVNode as D, createCommentVNode as ee, renderSlot as B, useCssVars as vt, withDirectives as he, vShow as Ke, renderList as ke, createTextVNode as mt, withModifiers as We, createVNode as He, withCtx as ze } from "vue";
|
|
2
2
|
import { defineStore as ht } from "pinia";
|
|
3
3
|
import './assets/index.css';function $e(e) {
|
|
4
4
|
return qe() ? (Je(e), !0) : !1;
|
|
5
5
|
}
|
|
6
|
-
const
|
|
6
|
+
const pt = typeof window < "u" && typeof document < "u";
|
|
7
7
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
8
|
-
const
|
|
8
|
+
const gt = (e) => e != null, wt = Object.prototype.toString, yt = (e) => wt.call(e) === "[object Object]", bt = () => {
|
|
9
9
|
};
|
|
10
10
|
function ve(e) {
|
|
11
11
|
return Array.isArray(e) ? e : [e];
|
|
12
12
|
}
|
|
13
13
|
function xt(e, t, n) {
|
|
14
|
-
return
|
|
14
|
+
return X(
|
|
15
15
|
e,
|
|
16
16
|
t,
|
|
17
17
|
{
|
|
@@ -20,37 +20,37 @@ function xt(e, t, n) {
|
|
|
20
20
|
}
|
|
21
21
|
);
|
|
22
22
|
}
|
|
23
|
-
const
|
|
24
|
-
function
|
|
23
|
+
const oe = pt ? window : void 0;
|
|
24
|
+
function te(e) {
|
|
25
25
|
var t;
|
|
26
|
-
const n =
|
|
26
|
+
const n = x(e);
|
|
27
27
|
return (t = n == null ? void 0 : n.$el) != null ? t : n;
|
|
28
28
|
}
|
|
29
29
|
function ce(...e) {
|
|
30
30
|
const t = [], n = () => {
|
|
31
31
|
t.forEach((a) => a()), t.length = 0;
|
|
32
|
-
}, o = (a, u, r, s) => (a.addEventListener(u, r, s), () => a.removeEventListener(u, r, s)), i =
|
|
33
|
-
const a = ve(
|
|
32
|
+
}, o = (a, u, r, s) => (a.addEventListener(u, r, s), () => a.removeEventListener(u, r, s)), i = k(() => {
|
|
33
|
+
const a = ve(x(e[0])).filter((u) => u != null);
|
|
34
34
|
return a.every((u) => typeof u != "string") ? a : void 0;
|
|
35
35
|
}), c = xt(
|
|
36
36
|
() => {
|
|
37
37
|
var a, u;
|
|
38
38
|
return [
|
|
39
|
-
(u = (a = i.value) == null ? void 0 : a.map((r) =>
|
|
40
|
-
ve(
|
|
39
|
+
(u = (a = i.value) == null ? void 0 : a.map((r) => te(r))) != null ? u : [oe].filter((r) => r != null),
|
|
40
|
+
ve(x(i.value ? e[1] : e[0])),
|
|
41
41
|
ve(b(i.value ? e[2] : e[1])),
|
|
42
42
|
// @ts-expect-error - TypeScript gets the correct types, but somehow still complains
|
|
43
|
-
|
|
43
|
+
x(i.value ? e[3] : e[2])
|
|
44
44
|
];
|
|
45
45
|
},
|
|
46
46
|
([a, u, r, s]) => {
|
|
47
47
|
if (n(), !(a != null && a.length) || !(u != null && u.length) || !(r != null && r.length))
|
|
48
48
|
return;
|
|
49
|
-
const
|
|
49
|
+
const d = yt(s) ? { ...s } : s;
|
|
50
50
|
t.push(
|
|
51
51
|
...a.flatMap(
|
|
52
|
-
(
|
|
53
|
-
(y) => r.map((h) => o(
|
|
52
|
+
(f) => u.flatMap(
|
|
53
|
+
(y) => r.map((h) => o(f, y, h, d))
|
|
54
54
|
)
|
|
55
55
|
)
|
|
56
56
|
);
|
|
@@ -62,41 +62,41 @@ function ce(...e) {
|
|
|
62
62
|
return $e(n), l;
|
|
63
63
|
}
|
|
64
64
|
function Ct() {
|
|
65
|
-
const e =
|
|
66
|
-
return t &&
|
|
65
|
+
const e = H(!1), t = ge();
|
|
66
|
+
return t && Z(() => {
|
|
67
67
|
e.value = !0;
|
|
68
68
|
}, t), e;
|
|
69
69
|
}
|
|
70
70
|
function Et(e) {
|
|
71
71
|
const t = Ct();
|
|
72
|
-
return
|
|
72
|
+
return k(() => (t.value, !!e()));
|
|
73
73
|
}
|
|
74
74
|
function It(e, t, n = {}) {
|
|
75
|
-
const { window: o =
|
|
75
|
+
const { window: o = oe, ...i } = n;
|
|
76
76
|
let c;
|
|
77
77
|
const l = Et(() => o && "MutationObserver" in o), a = () => {
|
|
78
78
|
c && (c.disconnect(), c = void 0);
|
|
79
|
-
}, u =
|
|
80
|
-
const
|
|
79
|
+
}, u = k(() => {
|
|
80
|
+
const f = x(e), y = ve(f).map(te).filter(gt);
|
|
81
81
|
return new Set(y);
|
|
82
|
-
}), r =
|
|
82
|
+
}), r = X(
|
|
83
83
|
() => u.value,
|
|
84
|
-
(
|
|
85
|
-
a(), l.value &&
|
|
84
|
+
(f) => {
|
|
85
|
+
a(), l.value && f.size && (c = new MutationObserver(t), f.forEach((y) => c.observe(y, i)));
|
|
86
86
|
},
|
|
87
87
|
{ immediate: !0, flush: "post" }
|
|
88
|
-
), s = () => c == null ? void 0 : c.takeRecords(),
|
|
88
|
+
), s = () => c == null ? void 0 : c.takeRecords(), d = () => {
|
|
89
89
|
r(), a();
|
|
90
90
|
};
|
|
91
|
-
return $e(
|
|
91
|
+
return $e(d), {
|
|
92
92
|
isSupported: l,
|
|
93
|
-
stop:
|
|
93
|
+
stop: d,
|
|
94
94
|
takeRecords: s
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
97
|
function kt(e, t, n = {}) {
|
|
98
98
|
const {
|
|
99
|
-
window: o =
|
|
99
|
+
window: o = oe,
|
|
100
100
|
document: i = o == null ? void 0 : o.document,
|
|
101
101
|
flush: c = "sync"
|
|
102
102
|
} = n;
|
|
@@ -106,12 +106,12 @@ function kt(e, t, n = {}) {
|
|
|
106
106
|
const a = (s) => {
|
|
107
107
|
l == null || l(), l = s;
|
|
108
108
|
}, u = it(() => {
|
|
109
|
-
const s =
|
|
109
|
+
const s = te(e);
|
|
110
110
|
if (s) {
|
|
111
|
-
const { stop:
|
|
111
|
+
const { stop: d } = It(
|
|
112
112
|
i,
|
|
113
|
-
(
|
|
114
|
-
|
|
113
|
+
(f) => {
|
|
114
|
+
f.map((y) => [...y.removedNodes]).flat().some((y) => y === s || y.contains(s)) && t(f);
|
|
115
115
|
},
|
|
116
116
|
{
|
|
117
117
|
window: o,
|
|
@@ -119,7 +119,7 @@ function kt(e, t, n = {}) {
|
|
|
119
119
|
subtree: !0
|
|
120
120
|
}
|
|
121
121
|
);
|
|
122
|
-
a(
|
|
122
|
+
a(d);
|
|
123
123
|
}
|
|
124
124
|
}, { flush: c }), r = () => {
|
|
125
125
|
u(), a();
|
|
@@ -129,7 +129,7 @@ function kt(e, t, n = {}) {
|
|
|
129
129
|
function Mt(e = {}) {
|
|
130
130
|
var t;
|
|
131
131
|
const {
|
|
132
|
-
window: n =
|
|
132
|
+
window: n = oe,
|
|
133
133
|
deep: o = !0,
|
|
134
134
|
triggerOnRemoval: i = !1
|
|
135
135
|
} = e, c = (t = e.document) != null ? t : n == null ? void 0 : n.document, l = () => {
|
|
@@ -139,7 +139,7 @@ function Mt(e = {}) {
|
|
|
139
139
|
for (; s != null && s.shadowRoot; )
|
|
140
140
|
s = (r = s == null ? void 0 : s.shadowRoot) == null ? void 0 : r.activeElement;
|
|
141
141
|
return s;
|
|
142
|
-
}, a =
|
|
142
|
+
}, a = H(), u = () => {
|
|
143
143
|
a.value = l();
|
|
144
144
|
};
|
|
145
145
|
if (n) {
|
|
@@ -164,8 +164,8 @@ function Mt(e = {}) {
|
|
|
164
164
|
return i && kt(a, u, { document: c }), u(), a;
|
|
165
165
|
}
|
|
166
166
|
const St = "focusin", $t = "focusout", At = ":focus-within";
|
|
167
|
-
function
|
|
168
|
-
const { window: n =
|
|
167
|
+
function Tt(e, t = {}) {
|
|
168
|
+
const { window: n = oe } = t, o = k(() => te(e)), i = H(!1), c = k(() => i.value), l = Mt(t);
|
|
169
169
|
if (!n || !l.value)
|
|
170
170
|
return { focused: c };
|
|
171
171
|
const a = { passive: !0 };
|
|
@@ -174,10 +174,10 @@ function Rt(e, t = {}) {
|
|
|
174
174
|
return i.value = (s = (r = (u = o.value) == null ? void 0 : u.matches) == null ? void 0 : r.call(u, At)) != null ? s : !1;
|
|
175
175
|
}, a), { focused: c };
|
|
176
176
|
}
|
|
177
|
-
function
|
|
178
|
-
const o =
|
|
177
|
+
function Rt(e, { window: t = oe, scrollTarget: n } = {}) {
|
|
178
|
+
const o = O(!1), i = () => {
|
|
179
179
|
if (!t) return;
|
|
180
|
-
const c = t.document, l =
|
|
180
|
+
const c = t.document, l = te(e);
|
|
181
181
|
if (!l)
|
|
182
182
|
o.value = !1;
|
|
183
183
|
else {
|
|
@@ -185,8 +185,8 @@ function Tt(e, { window: t = ne, scrollTarget: n } = {}) {
|
|
|
185
185
|
o.value = a.top <= (t.innerHeight || c.documentElement.clientHeight) && a.left <= (t.innerWidth || c.documentElement.clientWidth) && a.bottom >= 0 && a.right >= 0;
|
|
186
186
|
}
|
|
187
187
|
};
|
|
188
|
-
return
|
|
189
|
-
() =>
|
|
188
|
+
return X(
|
|
189
|
+
() => te(e),
|
|
190
190
|
() => i(),
|
|
191
191
|
{ immediate: !0, flush: "post" }
|
|
192
192
|
), t && ce(n || t, "scroll", i, {
|
|
@@ -194,10 +194,10 @@ function Tt(e, { window: t = ne, scrollTarget: n } = {}) {
|
|
|
194
194
|
passive: !0
|
|
195
195
|
}), o;
|
|
196
196
|
}
|
|
197
|
-
const
|
|
198
|
-
let t =
|
|
197
|
+
const F = (e) => {
|
|
198
|
+
let t = Rt(e).value;
|
|
199
199
|
return t = t && e.offsetHeight > 0, t;
|
|
200
|
-
},
|
|
200
|
+
}, j = (e) => e.tabIndex >= 0, Be = (e) => {
|
|
201
201
|
const t = e.target;
|
|
202
202
|
return Ae(t);
|
|
203
203
|
}, Ae = (e) => {
|
|
@@ -213,8 +213,8 @@ const V = (e) => {
|
|
|
213
213
|
const o = e.previousElementSibling;
|
|
214
214
|
o && (n = o);
|
|
215
215
|
}
|
|
216
|
-
return n && (!
|
|
217
|
-
},
|
|
216
|
+
return n && (!j(n) || !F(n)) ? Ae(n) : n;
|
|
217
|
+
}, Pt = (e) => {
|
|
218
218
|
var t;
|
|
219
219
|
const n = e.target;
|
|
220
220
|
let o;
|
|
@@ -231,11 +231,11 @@ const V = (e) => {
|
|
|
231
231
|
c && (o = c);
|
|
232
232
|
}
|
|
233
233
|
}
|
|
234
|
-
return o && (!
|
|
234
|
+
return o && (!j(o) || !F(o)) ? Te(o) : o;
|
|
235
235
|
}, Xe = (e) => {
|
|
236
236
|
const t = e.target;
|
|
237
|
-
return
|
|
238
|
-
},
|
|
237
|
+
return Te(t);
|
|
238
|
+
}, Te = (e) => {
|
|
239
239
|
var t;
|
|
240
240
|
let n;
|
|
241
241
|
if (e instanceof HTMLTableCellElement) {
|
|
@@ -248,8 +248,8 @@ const V = (e) => {
|
|
|
248
248
|
const o = e.nextElementSibling;
|
|
249
249
|
o && (n = o);
|
|
250
250
|
}
|
|
251
|
-
return n && (!
|
|
252
|
-
},
|
|
251
|
+
return n && (!j(n) || !F(n)) ? Te(n) : n;
|
|
252
|
+
}, Ot = (e) => {
|
|
253
253
|
var t;
|
|
254
254
|
const n = e.target;
|
|
255
255
|
let o;
|
|
@@ -266,11 +266,11 @@ const V = (e) => {
|
|
|
266
266
|
c && (o = c);
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
|
-
return o && (!
|
|
269
|
+
return o && (!j(o) || !F(o)) ? Ae(o) : o;
|
|
270
270
|
}, Ne = (e) => {
|
|
271
271
|
const t = e.target;
|
|
272
|
-
return
|
|
273
|
-
},
|
|
272
|
+
return Re(t);
|
|
273
|
+
}, Re = (e) => {
|
|
274
274
|
var t;
|
|
275
275
|
let n;
|
|
276
276
|
if (e.previousElementSibling)
|
|
@@ -279,11 +279,11 @@ const V = (e) => {
|
|
|
279
279
|
const o = (t = e.parentElement) == null ? void 0 : t.previousElementSibling;
|
|
280
280
|
n = o == null ? void 0 : o.lastElementChild;
|
|
281
281
|
}
|
|
282
|
-
return n && (!
|
|
282
|
+
return n && (!j(n) || !F(n)) ? Re(n) : n;
|
|
283
283
|
}, Ve = (e) => {
|
|
284
284
|
const t = e.target;
|
|
285
|
-
return
|
|
286
|
-
},
|
|
285
|
+
return Pe(t);
|
|
286
|
+
}, Pe = (e) => {
|
|
287
287
|
var t;
|
|
288
288
|
let n;
|
|
289
289
|
if (e.nextElementSibling)
|
|
@@ -292,19 +292,19 @@ const V = (e) => {
|
|
|
292
292
|
const o = (t = e.parentElement) == null ? void 0 : t.nextElementSibling;
|
|
293
293
|
n = o == null ? void 0 : o.firstElementChild;
|
|
294
294
|
}
|
|
295
|
-
return n && (!
|
|
295
|
+
return n && (!j(n) || !F(n)) ? Pe(n) : n;
|
|
296
296
|
}, Ge = (e) => {
|
|
297
297
|
const t = e.target.parentElement, n = t == null ? void 0 : t.firstElementChild;
|
|
298
|
-
return n && (!
|
|
298
|
+
return n && (!j(n) || !F(n)) ? Pe(n) : n;
|
|
299
299
|
}, Fe = (e) => {
|
|
300
300
|
const t = e.target.parentElement, n = t == null ? void 0 : t.lastElementChild;
|
|
301
|
-
return n && (!
|
|
301
|
+
return n && (!j(n) || !F(n)) ? Re(n) : n;
|
|
302
302
|
}, de = ["alt", "control", "shift", "meta"], Lt = {
|
|
303
303
|
ArrowUp: "up",
|
|
304
304
|
ArrowDown: "down",
|
|
305
305
|
ArrowLeft: "left",
|
|
306
306
|
ArrowRight: "right"
|
|
307
|
-
},
|
|
307
|
+
}, Oe = {
|
|
308
308
|
"keydown.up": (e) => {
|
|
309
309
|
const t = Be(e);
|
|
310
310
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
@@ -322,11 +322,11 @@ const V = (e) => {
|
|
|
322
322
|
e.preventDefault(), e.stopPropagation(), t && t.focus();
|
|
323
323
|
},
|
|
324
324
|
"keydown.control.up": (e) => {
|
|
325
|
-
const t =
|
|
325
|
+
const t = Pt(e);
|
|
326
326
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
327
327
|
},
|
|
328
328
|
"keydown.control.down": (e) => {
|
|
329
|
-
const t =
|
|
329
|
+
const t = Ot(e);
|
|
330
330
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
331
331
|
},
|
|
332
332
|
"keydown.control.left": (e) => {
|
|
@@ -393,37 +393,37 @@ function Le(e) {
|
|
|
393
393
|
}, o = (l) => {
|
|
394
394
|
const a = t(l);
|
|
395
395
|
let u = [];
|
|
396
|
-
return l.selectors ? u = n(l) : a && (u = Array.from(a.children).filter((r) =>
|
|
396
|
+
return l.selectors ? u = n(l) : a && (u = Array.from(a.children).filter((r) => j(r) && F(r))), u;
|
|
397
397
|
}, i = (l) => (a) => {
|
|
398
398
|
const u = Lt[a.key] || a.key.toLowerCase();
|
|
399
399
|
if (de.includes(u)) return;
|
|
400
|
-
const r = l.handlers ||
|
|
400
|
+
const r = l.handlers || Oe;
|
|
401
401
|
for (const s of Object.keys(r)) {
|
|
402
|
-
const [
|
|
403
|
-
if (
|
|
404
|
-
const y = r[s], h =
|
|
405
|
-
const
|
|
406
|
-
return a.getModifierState(
|
|
402
|
+
const [d, ...f] = s.split(".");
|
|
403
|
+
if (d === "keydown" && f.includes(u)) {
|
|
404
|
+
const y = r[s], h = f.filter((v) => de.includes(v)), C = de.some((v) => {
|
|
405
|
+
const m = v.charAt(0).toUpperCase() + v.slice(1);
|
|
406
|
+
return a.getModifierState(m);
|
|
407
407
|
});
|
|
408
408
|
if (h.length > 0) {
|
|
409
|
-
if (
|
|
410
|
-
for (const
|
|
411
|
-
if (
|
|
412
|
-
const
|
|
413
|
-
a.getModifierState(
|
|
409
|
+
if (C) {
|
|
410
|
+
for (const v of de)
|
|
411
|
+
if (f.includes(v)) {
|
|
412
|
+
const m = v.charAt(0).toUpperCase() + v.slice(1);
|
|
413
|
+
a.getModifierState(m) && y(a);
|
|
414
414
|
}
|
|
415
415
|
}
|
|
416
416
|
} else
|
|
417
|
-
|
|
417
|
+
C || y(a);
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
420
|
}, c = [];
|
|
421
|
-
|
|
421
|
+
Z(() => {
|
|
422
422
|
for (const l of e) {
|
|
423
423
|
const a = t(l), u = o(l), r = i(l), s = a ? [a] : u;
|
|
424
|
-
for (const
|
|
425
|
-
const { focused:
|
|
426
|
-
h ?
|
|
424
|
+
for (const d of s) {
|
|
425
|
+
const { focused: f } = Tt(O(d)), y = X(f, (h) => {
|
|
426
|
+
h ? d.addEventListener("keydown", r) : d.removeEventListener("keydown", r);
|
|
427
427
|
});
|
|
428
428
|
c.push(y);
|
|
429
429
|
}
|
|
@@ -433,12 +433,12 @@ function Le(e) {
|
|
|
433
433
|
l();
|
|
434
434
|
});
|
|
435
435
|
}
|
|
436
|
-
function
|
|
436
|
+
function le(e) {
|
|
437
437
|
return qe() ? (Je(e), !0) : !1;
|
|
438
438
|
}
|
|
439
439
|
const we = typeof window < "u" && typeof document < "u";
|
|
440
440
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
441
|
-
const Dt = (e) => e != null, Wt = Object.prototype.toString, _e = (e) => Wt.call(e) === "[object Object]",
|
|
441
|
+
const Dt = (e) => e != null, Wt = Object.prototype.toString, _e = (e) => Wt.call(e) === "[object Object]", V = () => {
|
|
442
442
|
}, Me = /* @__PURE__ */ Ht();
|
|
443
443
|
function Ht() {
|
|
444
444
|
var e, t;
|
|
@@ -448,15 +448,46 @@ function zt(...e) {
|
|
|
448
448
|
if (e.length !== 1)
|
|
449
449
|
return dt(...e);
|
|
450
450
|
const t = e[0];
|
|
451
|
-
return typeof t == "function" ? ft(Ze(() => ({ get: t, set:
|
|
451
|
+
return typeof t == "function" ? ft(Ze(() => ({ get: t, set: V }))) : O(t);
|
|
452
452
|
}
|
|
453
|
-
function
|
|
453
|
+
function Bt(e, t) {
|
|
454
|
+
function n(...o) {
|
|
455
|
+
return new Promise((i, c) => {
|
|
456
|
+
Promise.resolve(e(() => t.apply(this, o), { fn: t, thisArg: this, args: o })).then(i).catch(c);
|
|
457
|
+
});
|
|
458
|
+
}
|
|
459
|
+
return n;
|
|
460
|
+
}
|
|
461
|
+
function Xt(e, t = {}) {
|
|
462
|
+
let n, o, i = V;
|
|
463
|
+
const c = (u) => {
|
|
464
|
+
clearTimeout(u), i(), i = V;
|
|
465
|
+
};
|
|
466
|
+
let l;
|
|
467
|
+
return (u) => {
|
|
468
|
+
const r = x(e), s = x(t.maxWait);
|
|
469
|
+
return n && c(n), r <= 0 || s !== void 0 && s <= 0 ? (o && (c(o), o = void 0), Promise.resolve(u())) : new Promise((d, f) => {
|
|
470
|
+
i = t.rejectOnCancel ? f : d, l = u, s && !o && (o = setTimeout(() => {
|
|
471
|
+
n && c(n), o = void 0, d(l());
|
|
472
|
+
}, s)), n = setTimeout(() => {
|
|
473
|
+
o && c(o), o = void 0, d(u());
|
|
474
|
+
}, r);
|
|
475
|
+
});
|
|
476
|
+
};
|
|
477
|
+
}
|
|
478
|
+
function Q(e) {
|
|
454
479
|
return Array.isArray(e) ? e : [e];
|
|
455
480
|
}
|
|
456
|
-
function
|
|
457
|
-
return
|
|
481
|
+
function Nt(e) {
|
|
482
|
+
return ge();
|
|
458
483
|
}
|
|
459
|
-
function
|
|
484
|
+
function Vt(e, t = 200, n = {}) {
|
|
485
|
+
return Bt(
|
|
486
|
+
Xt(t, n),
|
|
487
|
+
e
|
|
488
|
+
);
|
|
489
|
+
}
|
|
490
|
+
function Gt(e, t = {}) {
|
|
460
491
|
if (!ut(e))
|
|
461
492
|
return ct(e);
|
|
462
493
|
const n = Array.isArray(e.value) ? Array.from({ length: e.value.length }) : {};
|
|
@@ -467,7 +498,7 @@ function Xt(e, t = {}) {
|
|
|
467
498
|
},
|
|
468
499
|
set(i) {
|
|
469
500
|
var c;
|
|
470
|
-
if ((c =
|
|
501
|
+
if ((c = x(t.replaceRef)) != null ? c : !0)
|
|
471
502
|
if (Array.isArray(e.value)) {
|
|
472
503
|
const a = [...e.value];
|
|
473
504
|
a[o] = i, e.value = a;
|
|
@@ -481,11 +512,11 @@ function Xt(e, t = {}) {
|
|
|
481
512
|
}));
|
|
482
513
|
return n;
|
|
483
514
|
}
|
|
484
|
-
function
|
|
485
|
-
|
|
515
|
+
function Ft(e, t = !0, n) {
|
|
516
|
+
Nt() ? Z(e, n) : t ? e() : Qe(e);
|
|
486
517
|
}
|
|
487
518
|
function et(e, t, n) {
|
|
488
|
-
return
|
|
519
|
+
return X(
|
|
489
520
|
e,
|
|
490
521
|
t,
|
|
491
522
|
{
|
|
@@ -495,36 +526,36 @@ function et(e, t, n) {
|
|
|
495
526
|
);
|
|
496
527
|
}
|
|
497
528
|
const ye = we ? window : void 0;
|
|
498
|
-
function
|
|
529
|
+
function ne(e) {
|
|
499
530
|
var t;
|
|
500
|
-
const n =
|
|
531
|
+
const n = x(e);
|
|
501
532
|
return (t = n == null ? void 0 : n.$el) != null ? t : n;
|
|
502
533
|
}
|
|
503
534
|
function ue(...e) {
|
|
504
535
|
const t = [], n = () => {
|
|
505
536
|
t.forEach((a) => a()), t.length = 0;
|
|
506
|
-
}, o = (a, u, r, s) => (a.addEventListener(u, r, s), () => a.removeEventListener(u, r, s)), i =
|
|
507
|
-
const a =
|
|
537
|
+
}, o = (a, u, r, s) => (a.addEventListener(u, r, s), () => a.removeEventListener(u, r, s)), i = k(() => {
|
|
538
|
+
const a = Q(x(e[0])).filter((u) => u != null);
|
|
508
539
|
return a.every((u) => typeof u != "string") ? a : void 0;
|
|
509
540
|
}), c = et(
|
|
510
541
|
() => {
|
|
511
542
|
var a, u;
|
|
512
543
|
return [
|
|
513
|
-
(u = (a = i.value) == null ? void 0 : a.map((r) =>
|
|
514
|
-
|
|
515
|
-
|
|
544
|
+
(u = (a = i.value) == null ? void 0 : a.map((r) => ne(r))) != null ? u : [ye].filter((r) => r != null),
|
|
545
|
+
Q(x(i.value ? e[1] : e[0])),
|
|
546
|
+
Q(b(i.value ? e[2] : e[1])),
|
|
516
547
|
// @ts-expect-error - TypeScript gets the correct types, but somehow still complains
|
|
517
|
-
|
|
548
|
+
x(i.value ? e[3] : e[2])
|
|
518
549
|
];
|
|
519
550
|
},
|
|
520
551
|
([a, u, r, s]) => {
|
|
521
552
|
if (n(), !(a != null && a.length) || !(u != null && u.length) || !(r != null && r.length))
|
|
522
553
|
return;
|
|
523
|
-
const
|
|
554
|
+
const d = _e(s) ? { ...s } : s;
|
|
524
555
|
t.push(
|
|
525
556
|
...a.flatMap(
|
|
526
|
-
(
|
|
527
|
-
(y) => r.map((h) => o(
|
|
557
|
+
(f) => u.flatMap(
|
|
558
|
+
(y) => r.map((h) => o(f, y, h, d))
|
|
528
559
|
)
|
|
529
560
|
)
|
|
530
561
|
);
|
|
@@ -533,38 +564,38 @@ function ue(...e) {
|
|
|
533
564
|
), l = () => {
|
|
534
565
|
c(), n();
|
|
535
566
|
};
|
|
536
|
-
return
|
|
567
|
+
return le(n), l;
|
|
537
568
|
}
|
|
538
|
-
function
|
|
539
|
-
const e =
|
|
540
|
-
return t &&
|
|
569
|
+
function jt() {
|
|
570
|
+
const e = H(!1), t = ge();
|
|
571
|
+
return t && Z(() => {
|
|
541
572
|
e.value = !0;
|
|
542
573
|
}, t), e;
|
|
543
574
|
}
|
|
544
575
|
function tt(e) {
|
|
545
|
-
const t =
|
|
546
|
-
return
|
|
576
|
+
const t = jt();
|
|
577
|
+
return k(() => (t.value, !!e()));
|
|
547
578
|
}
|
|
548
579
|
function nt(e, t, n = {}) {
|
|
549
580
|
const { window: o = ye, ...i } = n;
|
|
550
581
|
let c;
|
|
551
582
|
const l = tt(() => o && "MutationObserver" in o), a = () => {
|
|
552
583
|
c && (c.disconnect(), c = void 0);
|
|
553
|
-
}, u =
|
|
554
|
-
const
|
|
584
|
+
}, u = k(() => {
|
|
585
|
+
const f = x(e), y = Q(f).map(ne).filter(Dt);
|
|
555
586
|
return new Set(y);
|
|
556
|
-
}), r =
|
|
587
|
+
}), r = X(
|
|
557
588
|
() => u.value,
|
|
558
|
-
(
|
|
559
|
-
a(), l.value &&
|
|
589
|
+
(f) => {
|
|
590
|
+
a(), l.value && f.size && (c = new MutationObserver(t), f.forEach((y) => c.observe(y, i)));
|
|
560
591
|
},
|
|
561
592
|
{ immediate: !0, flush: "post" }
|
|
562
|
-
), s = () => c == null ? void 0 : c.takeRecords(),
|
|
593
|
+
), s = () => c == null ? void 0 : c.takeRecords(), d = () => {
|
|
563
594
|
r(), a();
|
|
564
595
|
};
|
|
565
|
-
return
|
|
596
|
+
return le(d), {
|
|
566
597
|
isSupported: l,
|
|
567
|
-
stop:
|
|
598
|
+
stop: d,
|
|
568
599
|
takeRecords: s
|
|
569
600
|
};
|
|
570
601
|
}
|
|
@@ -579,121 +610,121 @@ function xe(e, t = {}) {
|
|
|
579
610
|
onEnd: u,
|
|
580
611
|
onStart: r,
|
|
581
612
|
initialValue: s,
|
|
582
|
-
axis:
|
|
583
|
-
draggingElement:
|
|
613
|
+
axis: d = "both",
|
|
614
|
+
draggingElement: f = ye,
|
|
584
615
|
containerElement: y,
|
|
585
616
|
handle: h = e,
|
|
586
|
-
buttons:
|
|
587
|
-
} = t,
|
|
588
|
-
(n =
|
|
589
|
-
),
|
|
590
|
-
|
|
591
|
-
},
|
|
617
|
+
buttons: C = [0]
|
|
618
|
+
} = t, v = O(
|
|
619
|
+
(n = x(s)) != null ? n : { x: 0, y: 0 }
|
|
620
|
+
), m = O(), g = (E) => o ? o.includes(E.pointerType) : !0, I = (E) => {
|
|
621
|
+
x(i) && E.preventDefault(), x(c) && E.stopPropagation();
|
|
622
|
+
}, M = (E) => {
|
|
592
623
|
var T;
|
|
593
|
-
if (!
|
|
624
|
+
if (!x(C).includes(E.button) || x(t.disabled) || !g(E) || x(l) && E.target !== x(e))
|
|
594
625
|
return;
|
|
595
|
-
const
|
|
596
|
-
x:
|
|
597
|
-
y:
|
|
626
|
+
const z = x(y), U = (T = z == null ? void 0 : z.getBoundingClientRect) == null ? void 0 : T.call(z), N = x(e).getBoundingClientRect(), be = {
|
|
627
|
+
x: E.clientX - (z ? N.left - U.left + z.scrollLeft : N.left),
|
|
628
|
+
y: E.clientY - (z ? N.top - U.top + z.scrollTop : N.top)
|
|
598
629
|
};
|
|
599
|
-
(r == null ? void 0 : r(be,
|
|
600
|
-
},
|
|
601
|
-
if (
|
|
630
|
+
(r == null ? void 0 : r(be, E)) !== !1 && (m.value = be, I(E));
|
|
631
|
+
}, L = (E) => {
|
|
632
|
+
if (x(t.disabled) || !g(E) || !m.value)
|
|
602
633
|
return;
|
|
603
|
-
const T =
|
|
604
|
-
let { x:
|
|
605
|
-
(
|
|
606
|
-
x:
|
|
607
|
-
y:
|
|
608
|
-
}, a == null || a(
|
|
609
|
-
},
|
|
610
|
-
|
|
634
|
+
const T = x(y), z = x(e).getBoundingClientRect();
|
|
635
|
+
let { x: U, y: N } = v.value;
|
|
636
|
+
(d === "x" || d === "both") && (U = E.clientX - m.value.x, T && (U = Math.min(Math.max(0, U), T.scrollWidth - z.width))), (d === "y" || d === "both") && (N = E.clientY - m.value.y, T && (N = Math.min(Math.max(0, N), T.scrollHeight - z.height))), v.value = {
|
|
637
|
+
x: U,
|
|
638
|
+
y: N
|
|
639
|
+
}, a == null || a(v.value, E), I(E);
|
|
640
|
+
}, P = (E) => {
|
|
641
|
+
x(t.disabled) || !g(E) || m.value && (m.value = void 0, u == null || u(v.value, E), I(E));
|
|
611
642
|
};
|
|
612
643
|
if (we) {
|
|
613
|
-
const
|
|
644
|
+
const E = () => {
|
|
614
645
|
var T;
|
|
615
646
|
return {
|
|
616
647
|
capture: (T = t.capture) != null ? T : !0,
|
|
617
|
-
passive: !
|
|
648
|
+
passive: !x(i)
|
|
618
649
|
};
|
|
619
650
|
};
|
|
620
|
-
ue(h, "pointerdown",
|
|
651
|
+
ue(h, "pointerdown", M, E), ue(f, "pointermove", L, E), ue(f, "pointerup", P, E);
|
|
621
652
|
}
|
|
622
653
|
return {
|
|
623
|
-
...
|
|
624
|
-
position:
|
|
625
|
-
isDragging:
|
|
626
|
-
style:
|
|
627
|
-
() => `left:${
|
|
654
|
+
...Gt(v),
|
|
655
|
+
position: v,
|
|
656
|
+
isDragging: k(() => !!m.value),
|
|
657
|
+
style: k(
|
|
658
|
+
() => `left:${v.value.x}px;top:${v.value.y}px;`
|
|
628
659
|
)
|
|
629
660
|
};
|
|
630
661
|
}
|
|
631
|
-
function
|
|
662
|
+
function Ut(e, t, n = {}) {
|
|
632
663
|
const { window: o = ye, ...i } = n;
|
|
633
664
|
let c;
|
|
634
665
|
const l = tt(() => o && "ResizeObserver" in o), a = () => {
|
|
635
666
|
c && (c.disconnect(), c = void 0);
|
|
636
|
-
}, u =
|
|
637
|
-
const
|
|
638
|
-
return Array.isArray(
|
|
639
|
-
}), r =
|
|
667
|
+
}, u = k(() => {
|
|
668
|
+
const d = x(e);
|
|
669
|
+
return Array.isArray(d) ? d.map((f) => ne(f)) : [ne(d)];
|
|
670
|
+
}), r = X(
|
|
640
671
|
u,
|
|
641
|
-
(
|
|
672
|
+
(d) => {
|
|
642
673
|
if (a(), l.value && o) {
|
|
643
674
|
c = new ResizeObserver(t);
|
|
644
|
-
for (const
|
|
645
|
-
|
|
675
|
+
for (const f of d)
|
|
676
|
+
f && c.observe(f, i);
|
|
646
677
|
}
|
|
647
678
|
},
|
|
648
679
|
{ immediate: !0, flush: "post" }
|
|
649
680
|
), s = () => {
|
|
650
681
|
a(), r();
|
|
651
682
|
};
|
|
652
|
-
return
|
|
683
|
+
return le(s), {
|
|
653
684
|
isSupported: l,
|
|
654
685
|
stop: s
|
|
655
686
|
};
|
|
656
687
|
}
|
|
657
|
-
function
|
|
688
|
+
function pe(e, t = {}) {
|
|
658
689
|
const {
|
|
659
690
|
reset: n = !0,
|
|
660
691
|
windowResize: o = !0,
|
|
661
692
|
windowScroll: i = !0,
|
|
662
693
|
immediate: c = !0,
|
|
663
694
|
updateTiming: l = "sync"
|
|
664
|
-
} = t, a =
|
|
665
|
-
function
|
|
666
|
-
const
|
|
667
|
-
if (!
|
|
668
|
-
n && (a.value = 0, u.value = 0, r.value = 0, s.value = 0,
|
|
695
|
+
} = t, a = H(0), u = H(0), r = H(0), s = H(0), d = H(0), f = H(0), y = H(0), h = H(0);
|
|
696
|
+
function C() {
|
|
697
|
+
const m = ne(e);
|
|
698
|
+
if (!m) {
|
|
699
|
+
n && (a.value = 0, u.value = 0, r.value = 0, s.value = 0, d.value = 0, f.value = 0, y.value = 0, h.value = 0);
|
|
669
700
|
return;
|
|
670
701
|
}
|
|
671
|
-
const
|
|
672
|
-
a.value =
|
|
702
|
+
const g = m.getBoundingClientRect();
|
|
703
|
+
a.value = g.height, u.value = g.bottom, r.value = g.left, s.value = g.right, d.value = g.top, f.value = g.width, y.value = g.x, h.value = g.y;
|
|
673
704
|
}
|
|
674
|
-
function
|
|
675
|
-
l === "sync" ?
|
|
705
|
+
function v() {
|
|
706
|
+
l === "sync" ? C() : l === "next-frame" && requestAnimationFrame(() => C());
|
|
676
707
|
}
|
|
677
|
-
return
|
|
708
|
+
return Ut(e, v), X(() => ne(e), (m) => !m && v()), nt(e, v, {
|
|
678
709
|
attributeFilter: ["style", "class"]
|
|
679
|
-
}), i && ue("scroll",
|
|
680
|
-
c &&
|
|
710
|
+
}), i && ue("scroll", v, { capture: !0, passive: !0 }), o && ue("resize", v, { passive: !0 }), Ft(() => {
|
|
711
|
+
c && v();
|
|
681
712
|
}), {
|
|
682
713
|
height: a,
|
|
683
714
|
bottom: u,
|
|
684
715
|
left: r,
|
|
685
716
|
right: s,
|
|
686
|
-
top:
|
|
687
|
-
width:
|
|
717
|
+
top: d,
|
|
718
|
+
width: f,
|
|
688
719
|
x: y,
|
|
689
720
|
y: h,
|
|
690
|
-
update:
|
|
721
|
+
update: v
|
|
691
722
|
};
|
|
692
723
|
}
|
|
693
|
-
const
|
|
724
|
+
const Yt = (e) => {
|
|
694
725
|
const t = new DOMParser().parseFromString(e, "text/html");
|
|
695
726
|
return Array.from(t.body.childNodes).some((n) => n.nodeType === 1);
|
|
696
|
-
},
|
|
727
|
+
}, qt = (e = 8) => Array.from({ length: e }, () => Math.floor(Math.random() * 16).toString(16)).join(""), Jt = ["data-colindex", "data-rowindex", "data-editable", "contenteditable", "tabindex"], Qt = ["innerHTML"], Zt = { key: 2 }, Kt = /* @__PURE__ */ K({
|
|
697
728
|
__name: "ACell",
|
|
698
729
|
props: {
|
|
699
730
|
colIndex: {},
|
|
@@ -701,78 +732,80 @@ const Ft = (e) => {
|
|
|
701
732
|
store: {},
|
|
702
733
|
addNavigation: { type: [Boolean, Object], default: !0 },
|
|
703
734
|
tabIndex: { default: 0 },
|
|
704
|
-
pinned: { type: Boolean, default: !1 }
|
|
735
|
+
pinned: { type: Boolean, default: !1 },
|
|
736
|
+
debounce: { default: 300 }
|
|
705
737
|
},
|
|
706
738
|
setup(e, { expose: t }) {
|
|
707
|
-
const n =
|
|
708
|
-
var
|
|
739
|
+
const n = G("cell"), o = e.store.getCellData(e.colIndex, e.rowIndex), i = O(""), c = O(!1), l = e.store.columns[e.colIndex], a = e.store.rows[e.rowIndex], u = l.align || "center", r = l.width || "40ch", s = k(() => e.store.getCellDisplayValue(e.colIndex, e.rowIndex)), d = k(() => typeof s.value == "string" ? Yt(s.value) : !1), f = k(() => {
|
|
740
|
+
var g;
|
|
709
741
|
return {
|
|
710
742
|
textAlign: u,
|
|
711
743
|
width: r,
|
|
712
744
|
fontWeight: c.value ? "bold" : "inherit",
|
|
713
|
-
paddingLeft: e.store.getIndent(e.colIndex, (
|
|
745
|
+
paddingLeft: e.store.getIndent(e.colIndex, (g = e.store.display[e.rowIndex]) == null ? void 0 : g.indent)
|
|
714
746
|
};
|
|
715
|
-
}), y =
|
|
747
|
+
}), y = k(() => ({
|
|
716
748
|
"sticky-column": e.pinned,
|
|
717
749
|
"cell-modified": c.value
|
|
718
750
|
})), h = () => {
|
|
719
|
-
const { left:
|
|
720
|
-
l.mask, l.modalComponent && e.store.$patch((
|
|
721
|
-
|
|
751
|
+
const { left: g, bottom: I, width: M, height: L } = pe(n);
|
|
752
|
+
l.mask, l.modalComponent && e.store.$patch((P) => {
|
|
753
|
+
P.modal.visible = !0, P.modal.colIndex = e.colIndex, P.modal.rowIndex = e.rowIndex, P.modal.left = g, P.modal.bottom = I, P.modal.width = M, P.modal.height = L, P.modal.cell = n.value, typeof l.modalComponent == "function" ? P.modal.component = l.modalComponent({ table: P.table, row: a, column: l }) : P.modal.component = l.modalComponent, P.modal.componentProps = l.modalComponentExtraProps;
|
|
722
754
|
});
|
|
723
755
|
};
|
|
724
756
|
if (e.addNavigation) {
|
|
725
|
-
let
|
|
726
|
-
...
|
|
757
|
+
let g = {
|
|
758
|
+
...Oe,
|
|
727
759
|
"keydown.f2": h,
|
|
728
760
|
"keydown.alt.up": h,
|
|
729
761
|
"keydown.alt.down": h,
|
|
730
762
|
"keydown.alt.left": h,
|
|
731
763
|
"keydown.alt.right": h
|
|
732
764
|
};
|
|
733
|
-
typeof e.addNavigation == "object" && (
|
|
734
|
-
...
|
|
765
|
+
typeof e.addNavigation == "object" && (g = {
|
|
766
|
+
...g,
|
|
735
767
|
...e.addNavigation
|
|
736
768
|
}), Le([
|
|
737
769
|
{
|
|
738
770
|
selectors: n,
|
|
739
|
-
handlers:
|
|
771
|
+
handlers: g
|
|
740
772
|
}
|
|
741
773
|
]);
|
|
742
774
|
}
|
|
743
|
-
const
|
|
775
|
+
const C = () => {
|
|
744
776
|
n.value && (i.value = n.value.textContent);
|
|
745
|
-
},
|
|
746
|
-
const
|
|
747
|
-
|
|
748
|
-
};
|
|
777
|
+
}, v = (g) => {
|
|
778
|
+
const I = g.target;
|
|
779
|
+
I.textContent !== i.value && (i.value = I.textContent, l.format ? (c.value = I.textContent !== e.store.getFormattedValue(e.colIndex, e.rowIndex, o), e.store.setCellText(e.colIndex, e.rowIndex, I.textContent)) : (c.value = I.textContent !== o, e.store.setCellData(e.colIndex, e.rowIndex, I.textContent)));
|
|
780
|
+
}, m = Vt(v, e.debounce);
|
|
749
781
|
return t({
|
|
750
782
|
currentData: i
|
|
751
|
-
}), (
|
|
783
|
+
}), (g, I) => (S(), A("td", {
|
|
752
784
|
ref: "cell",
|
|
753
|
-
"data-colindex":
|
|
754
|
-
"data-rowindex":
|
|
785
|
+
"data-colindex": g.colIndex,
|
|
786
|
+
"data-rowindex": g.rowIndex,
|
|
755
787
|
"data-editable": b(l).edit,
|
|
756
788
|
contenteditable: b(l).edit,
|
|
757
|
-
tabindex:
|
|
789
|
+
tabindex: g.tabIndex,
|
|
758
790
|
spellcheck: !1,
|
|
759
|
-
style:
|
|
760
|
-
onFocus:
|
|
761
|
-
onPaste:
|
|
762
|
-
onInput:
|
|
791
|
+
style: J(f.value),
|
|
792
|
+
onFocus: C,
|
|
793
|
+
onPaste: v,
|
|
794
|
+
onInput: I[0] || (I[0] = //@ts-ignore
|
|
795
|
+
(...M) => b(m) && b(m)(...M)),
|
|
763
796
|
onClick: h,
|
|
764
|
-
class:
|
|
797
|
+
class: Y(["atable-cell", y.value])
|
|
765
798
|
}, [
|
|
766
799
|
b(l).cellComponent ? (S(), re(fe(b(l).cellComponent), Se({
|
|
767
800
|
key: 0,
|
|
768
801
|
value: s.value
|
|
769
|
-
}, b(l).cellComponentProps), null, 16, ["value"])) :
|
|
802
|
+
}, b(l).cellComponentProps), null, 16, ["value"])) : d.value ? (S(), A("span", {
|
|
770
803
|
key: 1,
|
|
771
804
|
innerHTML: s.value
|
|
772
|
-
}, null, 8,
|
|
773
|
-
], 46,
|
|
805
|
+
}, null, 8, Qt)) : (S(), A("span", Zt, _(s.value), 1))
|
|
806
|
+
], 46, Jt));
|
|
774
807
|
}
|
|
775
|
-
}),
|
|
808
|
+
}), _t = ["tabindex"], en = ["tabindex"], tn = ["colspan"], nn = /* @__PURE__ */ K({
|
|
776
809
|
__name: "AExpansionRow",
|
|
777
810
|
props: {
|
|
778
811
|
rowIndex: {},
|
|
@@ -781,7 +814,7 @@ const Ft = (e) => {
|
|
|
781
814
|
addNavigation: { type: [Boolean, Object] }
|
|
782
815
|
},
|
|
783
816
|
setup(e) {
|
|
784
|
-
const t =
|
|
817
|
+
const t = G("rowEl"), n = k(() => e.store.display[e.rowIndex].expanded ? "▼" : "►");
|
|
785
818
|
if (e.addNavigation) {
|
|
786
819
|
const o = {
|
|
787
820
|
"keydown.control.g": (i) => {
|
|
@@ -795,47 +828,47 @@ const Ft = (e) => {
|
|
|
795
828
|
}
|
|
796
829
|
]);
|
|
797
830
|
}
|
|
798
|
-
return (o, i) => (S(),
|
|
799
|
-
|
|
831
|
+
return (o, i) => (S(), A(ie, null, [
|
|
832
|
+
D("tr", Se(o.$attrs, {
|
|
800
833
|
ref: "rowEl",
|
|
801
834
|
tabindex: o.tabIndex,
|
|
802
835
|
class: "expandable-row"
|
|
803
836
|
}), [
|
|
804
|
-
|
|
837
|
+
D("td", {
|
|
805
838
|
tabIndex: -1,
|
|
806
839
|
onClick: i[0] || (i[0] = (c) => o.store.toggleRowExpand(o.rowIndex)),
|
|
807
840
|
class: "row-index"
|
|
808
|
-
},
|
|
809
|
-
|
|
810
|
-
], 16,
|
|
811
|
-
o.store.display[o.rowIndex].expanded ? (S(),
|
|
841
|
+
}, _(n.value), 1),
|
|
842
|
+
B(o.$slots, "row", {}, void 0, !0)
|
|
843
|
+
], 16, _t),
|
|
844
|
+
o.store.display[o.rowIndex].expanded ? (S(), A("tr", {
|
|
812
845
|
key: 0,
|
|
813
846
|
ref: "rowExpanded",
|
|
814
847
|
tabindex: o.tabIndex,
|
|
815
848
|
class: "expanded-row"
|
|
816
849
|
}, [
|
|
817
|
-
|
|
850
|
+
D("td", {
|
|
818
851
|
tabIndex: -1,
|
|
819
852
|
colspan: o.store.columns.length + 1,
|
|
820
853
|
class: "expanded-row-content"
|
|
821
854
|
}, [
|
|
822
|
-
|
|
823
|
-
], 8,
|
|
824
|
-
], 8,
|
|
855
|
+
B(o.$slots, "content", {}, void 0, !0)
|
|
856
|
+
], 8, tn)
|
|
857
|
+
], 8, en)) : ee("", !0)
|
|
825
858
|
], 64));
|
|
826
859
|
}
|
|
827
|
-
}),
|
|
860
|
+
}), ae = (e, t) => {
|
|
828
861
|
const n = e.__vccOpts || e;
|
|
829
862
|
for (const [o, i] of t)
|
|
830
863
|
n[o] = i;
|
|
831
864
|
return n;
|
|
832
|
-
},
|
|
865
|
+
}, on = /* @__PURE__ */ ae(nn, [["__scopeId", "data-v-5ad4bb41"]]), ln = ["colspan"], an = {
|
|
833
866
|
ref: "container",
|
|
834
867
|
class: "gantt-handler"
|
|
835
|
-
},
|
|
868
|
+
}, sn = {
|
|
836
869
|
key: 0,
|
|
837
870
|
class: "gantt-label"
|
|
838
|
-
},
|
|
871
|
+
}, rn = /* @__PURE__ */ K({
|
|
839
872
|
__name: "AGanttCell",
|
|
840
873
|
props: {
|
|
841
874
|
store: {},
|
|
@@ -849,153 +882,153 @@ const Ft = (e) => {
|
|
|
849
882
|
color: {}
|
|
850
883
|
},
|
|
851
884
|
setup(e) {
|
|
852
|
-
vt((
|
|
885
|
+
vt((m) => ({
|
|
853
886
|
"78862e08": t.value,
|
|
854
|
-
"18ad7d98":
|
|
887
|
+
"18ad7d98": m.colspan
|
|
855
888
|
}));
|
|
856
|
-
const t =
|
|
857
|
-
|
|
889
|
+
const t = O();
|
|
890
|
+
Z(() => {
|
|
858
891
|
!e.color || e.color == "" || e.color.length < 6 ? t.value = "#cccccc" : t.value = e.color;
|
|
859
892
|
});
|
|
860
|
-
const n =
|
|
861
|
-
const
|
|
893
|
+
const n = G("container"), o = G("bar"), i = G("leftHandle"), c = G("rightHandle"), { width: l } = pe(n), { left: a, right: u } = pe(o), r = O(e.start || 0), s = O(e.end || r.value + e.colspan), d = O({ startX: 0, startPos: 0 }), f = k(() => e.colspan > 0 ? l.value / e.colspan : 0), y = k(() => {
|
|
894
|
+
const m = r.value / e.colspan * 100, g = s.value / e.colspan * 100;
|
|
862
895
|
return {
|
|
863
|
-
left: `${
|
|
864
|
-
width: `${
|
|
896
|
+
left: `${m}%`,
|
|
897
|
+
width: `${g - m}%`,
|
|
865
898
|
backgroundColor: t.value
|
|
866
899
|
};
|
|
867
900
|
}), { isDragging: h } = xe(i, {
|
|
868
901
|
axis: "x",
|
|
869
902
|
onStart: () => {
|
|
870
|
-
o.value && (o.value.style.transition = "none"),
|
|
903
|
+
o.value && (o.value.style.transition = "none"), d.value = {
|
|
871
904
|
startX: a.value,
|
|
872
905
|
startPos: r.value
|
|
873
906
|
};
|
|
874
907
|
},
|
|
875
|
-
onMove: ({ x:
|
|
908
|
+
onMove: ({ x: m }) => {
|
|
876
909
|
if (h.value && o.value) {
|
|
877
|
-
const
|
|
878
|
-
o.value.style.left = `${
|
|
910
|
+
const I = (m - d.value.startX) / f.value, M = Math.max(0, Math.min(s.value - 1, d.value.startPos + I));
|
|
911
|
+
o.value.style.left = `${M / e.colspan * 100}%`, o.value.style.width = `${(s.value - M) / e.colspan * 100}%`;
|
|
879
912
|
}
|
|
880
913
|
},
|
|
881
|
-
onEnd: ({ x:
|
|
914
|
+
onEnd: ({ x: m }) => {
|
|
882
915
|
if (o.value) {
|
|
883
|
-
const
|
|
884
|
-
r.value =
|
|
916
|
+
const g = m - d.value.startX, I = Math.round(g / f.value), M = r.value, L = Math.max(0, Math.min(s.value - 1, d.value.startPos + I));
|
|
917
|
+
r.value = L, e.store.updateGanttBar({
|
|
885
918
|
rowIndex: e.rowIndex,
|
|
886
919
|
colIndex: e.colIndex,
|
|
887
920
|
type: "resize",
|
|
888
921
|
edge: "start",
|
|
889
|
-
oldStart:
|
|
890
|
-
newStart:
|
|
922
|
+
oldStart: M,
|
|
923
|
+
newStart: L,
|
|
891
924
|
end: s.value,
|
|
892
|
-
delta:
|
|
893
|
-
oldColspan: s.value -
|
|
894
|
-
newColspan: s.value -
|
|
925
|
+
delta: I,
|
|
926
|
+
oldColspan: s.value - M,
|
|
927
|
+
newColspan: s.value - L
|
|
895
928
|
});
|
|
896
929
|
}
|
|
897
930
|
}
|
|
898
|
-
}), { isDragging:
|
|
931
|
+
}), { isDragging: C } = xe(c, {
|
|
899
932
|
axis: "x",
|
|
900
933
|
onStart: () => {
|
|
901
|
-
o.value && (o.value.style.transition = "none"),
|
|
934
|
+
o.value && (o.value.style.transition = "none"), d.value = {
|
|
902
935
|
startX: u.value,
|
|
903
936
|
startPos: s.value
|
|
904
937
|
};
|
|
905
938
|
},
|
|
906
|
-
onMove: ({ x:
|
|
907
|
-
if (
|
|
908
|
-
const
|
|
939
|
+
onMove: ({ x: m }) => {
|
|
940
|
+
if (C.value && o.value) {
|
|
941
|
+
const I = (m - d.value.startX) / f.value, M = Math.max(
|
|
909
942
|
r.value + 1,
|
|
910
|
-
Math.min(e.columnsCount,
|
|
943
|
+
Math.min(e.columnsCount, d.value.startPos + I)
|
|
911
944
|
);
|
|
912
|
-
o.value.style.width = `${(
|
|
945
|
+
o.value.style.width = `${(M - r.value) / e.colspan * 100}%`;
|
|
913
946
|
}
|
|
914
947
|
},
|
|
915
|
-
onEnd: ({ x:
|
|
948
|
+
onEnd: ({ x: m }) => {
|
|
916
949
|
if (o.value) {
|
|
917
|
-
const
|
|
950
|
+
const g = m - d.value.startX, I = Math.round(g / f.value), M = s.value, L = Math.max(
|
|
918
951
|
r.value + 1,
|
|
919
|
-
Math.min(e.columnsCount,
|
|
952
|
+
Math.min(e.columnsCount, d.value.startPos + I)
|
|
920
953
|
);
|
|
921
|
-
s.value =
|
|
954
|
+
s.value = L, e.store.updateGanttBar({
|
|
922
955
|
rowIndex: e.rowIndex,
|
|
923
956
|
colIndex: e.colIndex,
|
|
924
957
|
type: "resize",
|
|
925
958
|
edge: "end",
|
|
926
|
-
oldEnd:
|
|
927
|
-
newEnd:
|
|
959
|
+
oldEnd: M,
|
|
960
|
+
newEnd: L,
|
|
928
961
|
start: r.value,
|
|
929
|
-
delta:
|
|
930
|
-
oldColspan:
|
|
931
|
-
newColspan:
|
|
962
|
+
delta: I,
|
|
963
|
+
oldColspan: M - r.value,
|
|
964
|
+
newColspan: L - r.value
|
|
932
965
|
});
|
|
933
966
|
}
|
|
934
967
|
}
|
|
935
|
-
}), { isDragging:
|
|
968
|
+
}), { isDragging: v } = xe(o, {
|
|
936
969
|
exact: !0,
|
|
937
970
|
// to avoid triggering when the left and right handles are being used
|
|
938
971
|
axis: "x",
|
|
939
972
|
onStart: () => {
|
|
940
|
-
o.value && (o.value.style.transition = "none"),
|
|
973
|
+
o.value && (o.value.style.transition = "none"), d.value = {
|
|
941
974
|
startX: a.value,
|
|
942
975
|
startPos: r.value
|
|
943
976
|
};
|
|
944
977
|
},
|
|
945
|
-
onMove: ({ x:
|
|
946
|
-
if (
|
|
947
|
-
const
|
|
948
|
-
o.value.style.left = `${
|
|
978
|
+
onMove: ({ x: m }) => {
|
|
979
|
+
if (v.value && o.value) {
|
|
980
|
+
const I = (m - d.value.startX) / f.value, M = s.value - r.value, L = Math.max(0, Math.min(d.value.startPos + I, e.columnsCount - M));
|
|
981
|
+
o.value.style.left = `${L / e.colspan * 100}%`;
|
|
949
982
|
}
|
|
950
983
|
},
|
|
951
|
-
onEnd: ({ x:
|
|
984
|
+
onEnd: ({ x: m }) => {
|
|
952
985
|
if (o.value) {
|
|
953
|
-
const
|
|
954
|
-
let
|
|
955
|
-
|
|
986
|
+
const g = m - d.value.startX, I = Math.round(g / f.value), M = s.value - r.value, L = r.value, P = s.value;
|
|
987
|
+
let E = d.value.startPos + I, T = E + M;
|
|
988
|
+
E < 0 ? (E = 0, T = M) : T > e.columnsCount && (T = e.columnsCount, E = T - M), r.value = E, s.value = T, e.store.updateGanttBar({
|
|
956
989
|
rowIndex: e.rowIndex,
|
|
957
990
|
colIndex: e.colIndex,
|
|
958
991
|
type: "bar",
|
|
959
|
-
oldStart:
|
|
960
|
-
oldEnd:
|
|
961
|
-
newStart:
|
|
992
|
+
oldStart: L,
|
|
993
|
+
oldEnd: P,
|
|
994
|
+
newStart: E,
|
|
962
995
|
newEnd: T,
|
|
963
|
-
delta:
|
|
964
|
-
colspan: T -
|
|
996
|
+
delta: I,
|
|
997
|
+
colspan: T - E
|
|
965
998
|
});
|
|
966
999
|
}
|
|
967
1000
|
}
|
|
968
1001
|
});
|
|
969
|
-
return (
|
|
1002
|
+
return (m, g) => (S(), A("td", {
|
|
970
1003
|
class: "aganttcell",
|
|
971
|
-
colspan:
|
|
1004
|
+
colspan: m.colspan
|
|
972
1005
|
}, [
|
|
973
|
-
|
|
974
|
-
|
|
1006
|
+
D("div", an, [
|
|
1007
|
+
D("div", {
|
|
975
1008
|
ref: "bar",
|
|
976
|
-
class:
|
|
977
|
-
style:
|
|
1009
|
+
class: Y(["gantt-bar", { "is-dragging": b(v) || b(h) || b(C) }]),
|
|
1010
|
+
style: J(y.value)
|
|
978
1011
|
}, [
|
|
979
|
-
|
|
1012
|
+
D("div", {
|
|
980
1013
|
ref: "leftHandle",
|
|
981
|
-
class:
|
|
982
|
-
},
|
|
983
|
-
|
|
984
|
-
|
|
1014
|
+
class: Y(["gantt-handle left-handle", { "is-dragging": b(h) }])
|
|
1015
|
+
}, g[0] || (g[0] = [
|
|
1016
|
+
D("div", { class: "handle-grip" }, null, -1),
|
|
1017
|
+
D("div", { class: "vertical-indicator left-indicator" }, null, -1)
|
|
985
1018
|
]), 2),
|
|
986
|
-
|
|
987
|
-
|
|
1019
|
+
m.label ? (S(), A("label", sn, _(m.label), 1)) : ee("", !0),
|
|
1020
|
+
D("div", {
|
|
988
1021
|
ref: "rightHandle",
|
|
989
|
-
class:
|
|
990
|
-
},
|
|
991
|
-
|
|
992
|
-
|
|
1022
|
+
class: Y(["gantt-handle right-handle", { "is-dragging": b(C) }])
|
|
1023
|
+
}, g[1] || (g[1] = [
|
|
1024
|
+
D("div", { class: "handle-grip" }, null, -1),
|
|
1025
|
+
D("div", { class: "vertical-indicator right-indicator" }, null, -1)
|
|
993
1026
|
]), 2)
|
|
994
1027
|
], 6)
|
|
995
1028
|
], 512)
|
|
996
|
-
], 8,
|
|
1029
|
+
], 8, ln));
|
|
997
1030
|
}
|
|
998
|
-
}),
|
|
1031
|
+
}), un = /* @__PURE__ */ ae(rn, [["__scopeId", "data-v-a929e8e3"]]), cn = ["tabindex"], dn = /* @__PURE__ */ K({
|
|
999
1032
|
__name: "ARow",
|
|
1000
1033
|
props: {
|
|
1001
1034
|
rowIndex: {},
|
|
@@ -1004,9 +1037,9 @@ const Ft = (e) => {
|
|
|
1004
1037
|
addNavigation: { type: [Boolean, Object], default: !1 }
|
|
1005
1038
|
},
|
|
1006
1039
|
setup(e) {
|
|
1007
|
-
const t =
|
|
1040
|
+
const t = G("rowEl"), n = k(() => e.store.isRowVisible(e.rowIndex)), o = k(() => e.store.getRowExpandSymbol(e.rowIndex));
|
|
1008
1041
|
if (e.addNavigation) {
|
|
1009
|
-
let i =
|
|
1042
|
+
let i = Oe;
|
|
1010
1043
|
typeof e.addNavigation == "object" && (i = {
|
|
1011
1044
|
...i,
|
|
1012
1045
|
...e.addNavigation
|
|
@@ -1017,59 +1050,59 @@ const Ft = (e) => {
|
|
|
1017
1050
|
}
|
|
1018
1051
|
]);
|
|
1019
1052
|
}
|
|
1020
|
-
return (i, c) => he((S(),
|
|
1053
|
+
return (i, c) => he((S(), A("tr", {
|
|
1021
1054
|
ref: "rowEl",
|
|
1022
1055
|
tabindex: i.tabIndex,
|
|
1023
1056
|
class: "atable-row"
|
|
1024
1057
|
}, [
|
|
1025
|
-
i.store.config.view !== "uncounted" ?
|
|
1026
|
-
i.store.config.view === "list" ? (S(),
|
|
1058
|
+
i.store.config.view !== "uncounted" ? B(i.$slots, "index", { key: 0 }, () => [
|
|
1059
|
+
i.store.config.view === "list" ? (S(), A("td", {
|
|
1027
1060
|
key: 0,
|
|
1028
1061
|
tabIndex: -1,
|
|
1029
|
-
class:
|
|
1030
|
-
},
|
|
1062
|
+
class: Y(["list-index", i.store.hasPinnedColumns ? "sticky-index" : ""])
|
|
1063
|
+
}, _(i.rowIndex + 1), 3)) : i.store.config.view === "tree" ? (S(), A("td", {
|
|
1031
1064
|
key: 1,
|
|
1032
1065
|
tabIndex: -1,
|
|
1033
|
-
class:
|
|
1066
|
+
class: Y(["tree-index", i.store.hasPinnedColumns ? "sticky-index" : ""]),
|
|
1034
1067
|
onClick: c[0] || (c[0] = (l) => i.store.toggleRowExpand(i.rowIndex))
|
|
1035
|
-
},
|
|
1036
|
-
], !0) :
|
|
1037
|
-
|
|
1038
|
-
], 8,
|
|
1068
|
+
}, _(o.value), 3)) : ee("", !0)
|
|
1069
|
+
], !0) : ee("", !0),
|
|
1070
|
+
B(i.$slots, "default", {}, void 0, !0)
|
|
1071
|
+
], 8, cn)), [
|
|
1039
1072
|
[Ke, n.value]
|
|
1040
1073
|
]);
|
|
1041
1074
|
}
|
|
1042
|
-
}), ot = /* @__PURE__ */
|
|
1043
|
-
function
|
|
1075
|
+
}), ot = /* @__PURE__ */ ae(dn, [["__scopeId", "data-v-4cb4f254"]]), De = we ? window : void 0;
|
|
1076
|
+
function q(e) {
|
|
1044
1077
|
var t;
|
|
1045
|
-
const n =
|
|
1078
|
+
const n = x(e);
|
|
1046
1079
|
return (t = n == null ? void 0 : n.$el) != null ? t : n;
|
|
1047
1080
|
}
|
|
1048
1081
|
function me(...e) {
|
|
1049
1082
|
const t = [], n = () => {
|
|
1050
1083
|
t.forEach((a) => a()), t.length = 0;
|
|
1051
|
-
}, o = (a, u, r, s) => (a.addEventListener(u, r, s), () => a.removeEventListener(u, r, s)), i =
|
|
1052
|
-
const a =
|
|
1084
|
+
}, o = (a, u, r, s) => (a.addEventListener(u, r, s), () => a.removeEventListener(u, r, s)), i = k(() => {
|
|
1085
|
+
const a = Q(x(e[0])).filter((u) => u != null);
|
|
1053
1086
|
return a.every((u) => typeof u != "string") ? a : void 0;
|
|
1054
1087
|
}), c = et(
|
|
1055
1088
|
() => {
|
|
1056
1089
|
var a, u;
|
|
1057
1090
|
return [
|
|
1058
|
-
(u = (a = i.value) == null ? void 0 : a.map((r) =>
|
|
1059
|
-
|
|
1060
|
-
|
|
1091
|
+
(u = (a = i.value) == null ? void 0 : a.map((r) => q(r))) != null ? u : [De].filter((r) => r != null),
|
|
1092
|
+
Q(x(i.value ? e[1] : e[0])),
|
|
1093
|
+
Q(b(i.value ? e[2] : e[1])),
|
|
1061
1094
|
// @ts-expect-error - TypeScript gets the correct types, but somehow still complains
|
|
1062
|
-
|
|
1095
|
+
x(i.value ? e[3] : e[2])
|
|
1063
1096
|
];
|
|
1064
1097
|
},
|
|
1065
1098
|
([a, u, r, s]) => {
|
|
1066
1099
|
if (n(), !(a != null && a.length) || !(u != null && u.length) || !(r != null && r.length))
|
|
1067
1100
|
return;
|
|
1068
|
-
const
|
|
1101
|
+
const d = _e(s) ? { ...s } : s;
|
|
1069
1102
|
t.push(
|
|
1070
1103
|
...a.flatMap(
|
|
1071
|
-
(
|
|
1072
|
-
(y) => r.map((h) => o(
|
|
1104
|
+
(f) => u.flatMap(
|
|
1105
|
+
(y) => r.map((h) => o(f, y, h, d))
|
|
1073
1106
|
)
|
|
1074
1107
|
)
|
|
1075
1108
|
);
|
|
@@ -1078,75 +1111,75 @@ function me(...e) {
|
|
|
1078
1111
|
), l = () => {
|
|
1079
1112
|
c(), n();
|
|
1080
1113
|
};
|
|
1081
|
-
return
|
|
1114
|
+
return le(n), l;
|
|
1082
1115
|
}
|
|
1083
1116
|
let je = !1;
|
|
1084
1117
|
function Ue(e, t, n = {}) {
|
|
1085
1118
|
const { window: o = De, ignore: i = [], capture: c = !0, detectIframe: l = !1, controls: a = !1 } = n;
|
|
1086
1119
|
if (!o)
|
|
1087
|
-
return a ? { stop:
|
|
1120
|
+
return a ? { stop: V, cancel: V, trigger: V } : V;
|
|
1088
1121
|
if (Me && !je) {
|
|
1089
1122
|
je = !0;
|
|
1090
|
-
const
|
|
1091
|
-
Array.from(o.document.body.children).forEach((
|
|
1123
|
+
const v = { passive: !0 };
|
|
1124
|
+
Array.from(o.document.body.children).forEach((m) => m.addEventListener("click", V, v)), o.document.documentElement.addEventListener("click", V, v);
|
|
1092
1125
|
}
|
|
1093
1126
|
let u = !0;
|
|
1094
|
-
const r = (
|
|
1095
|
-
if (typeof
|
|
1096
|
-
return Array.from(o.document.querySelectorAll(
|
|
1127
|
+
const r = (v) => x(i).some((m) => {
|
|
1128
|
+
if (typeof m == "string")
|
|
1129
|
+
return Array.from(o.document.querySelectorAll(m)).some((g) => g === v.target || v.composedPath().includes(g));
|
|
1097
1130
|
{
|
|
1098
|
-
const
|
|
1099
|
-
return
|
|
1131
|
+
const g = q(m);
|
|
1132
|
+
return g && (v.target === g || v.composedPath().includes(g));
|
|
1100
1133
|
}
|
|
1101
1134
|
});
|
|
1102
|
-
function s(
|
|
1103
|
-
const
|
|
1104
|
-
return
|
|
1135
|
+
function s(v) {
|
|
1136
|
+
const m = x(v);
|
|
1137
|
+
return m && m.$.subTree.shapeFlag === 16;
|
|
1105
1138
|
}
|
|
1106
|
-
function v
|
|
1107
|
-
const
|
|
1108
|
-
return
|
|
1139
|
+
function d(v, m) {
|
|
1140
|
+
const g = x(v), I = g.$.subTree && g.$.subTree.children;
|
|
1141
|
+
return I == null || !Array.isArray(I) ? !1 : I.some((M) => M.el === m.target || m.composedPath().includes(M.el));
|
|
1109
1142
|
}
|
|
1110
|
-
const
|
|
1111
|
-
const
|
|
1112
|
-
if (
|
|
1113
|
-
if ("detail" in
|
|
1143
|
+
const f = (v) => {
|
|
1144
|
+
const m = q(e);
|
|
1145
|
+
if (v.target != null && !(!(m instanceof Element) && s(e) && d(e, v)) && !(!m || m === v.target || v.composedPath().includes(m))) {
|
|
1146
|
+
if ("detail" in v && v.detail === 0 && (u = !r(v)), !u) {
|
|
1114
1147
|
u = !0;
|
|
1115
1148
|
return;
|
|
1116
1149
|
}
|
|
1117
|
-
t(
|
|
1150
|
+
t(v);
|
|
1118
1151
|
}
|
|
1119
1152
|
};
|
|
1120
1153
|
let y = !1;
|
|
1121
1154
|
const h = [
|
|
1122
|
-
me(o, "click", (
|
|
1155
|
+
me(o, "click", (v) => {
|
|
1123
1156
|
y || (y = !0, setTimeout(() => {
|
|
1124
1157
|
y = !1;
|
|
1125
|
-
}, 0),
|
|
1158
|
+
}, 0), f(v));
|
|
1126
1159
|
}, { passive: !0, capture: c }),
|
|
1127
|
-
me(o, "pointerdown", (
|
|
1128
|
-
const
|
|
1129
|
-
u = !r(
|
|
1160
|
+
me(o, "pointerdown", (v) => {
|
|
1161
|
+
const m = q(e);
|
|
1162
|
+
u = !r(v) && !!(m && !v.composedPath().includes(m));
|
|
1130
1163
|
}, { passive: !0 }),
|
|
1131
|
-
l && me(o, "blur", (
|
|
1164
|
+
l && me(o, "blur", (v) => {
|
|
1132
1165
|
setTimeout(() => {
|
|
1133
|
-
var
|
|
1134
|
-
const
|
|
1135
|
-
((
|
|
1166
|
+
var m;
|
|
1167
|
+
const g = q(e);
|
|
1168
|
+
((m = o.document.activeElement) == null ? void 0 : m.tagName) === "IFRAME" && !(g != null && g.contains(o.document.activeElement)) && t(v);
|
|
1136
1169
|
}, 0);
|
|
1137
1170
|
}, { passive: !0 })
|
|
1138
|
-
].filter(Boolean),
|
|
1171
|
+
].filter(Boolean), C = () => h.forEach((v) => v());
|
|
1139
1172
|
return a ? {
|
|
1140
|
-
stop:
|
|
1173
|
+
stop: C,
|
|
1141
1174
|
cancel: () => {
|
|
1142
1175
|
u = !1;
|
|
1143
1176
|
},
|
|
1144
|
-
trigger: (
|
|
1145
|
-
u = !0,
|
|
1177
|
+
trigger: (v) => {
|
|
1178
|
+
u = !0, f(v), u = !1;
|
|
1146
1179
|
}
|
|
1147
|
-
} :
|
|
1180
|
+
} : C;
|
|
1148
1181
|
}
|
|
1149
|
-
const Ce = /* @__PURE__ */ new WeakMap(),
|
|
1182
|
+
const Ce = /* @__PURE__ */ new WeakMap(), fn = {
|
|
1150
1183
|
mounted(e, t) {
|
|
1151
1184
|
const n = !t.modifiers.bubble;
|
|
1152
1185
|
let o;
|
|
@@ -1163,38 +1196,38 @@ const Ce = /* @__PURE__ */ new WeakMap(), un = {
|
|
|
1163
1196
|
t && typeof t == "function" ? t() : t == null || t.stop(), Ce.delete(e);
|
|
1164
1197
|
}
|
|
1165
1198
|
};
|
|
1166
|
-
function
|
|
1167
|
-
const e =
|
|
1168
|
-
return t &&
|
|
1199
|
+
function vn() {
|
|
1200
|
+
const e = H(!1), t = ge();
|
|
1201
|
+
return t && Z(() => {
|
|
1169
1202
|
e.value = !0;
|
|
1170
1203
|
}, t), e;
|
|
1171
1204
|
}
|
|
1172
|
-
function
|
|
1173
|
-
const t =
|
|
1174
|
-
return
|
|
1205
|
+
function mn(e) {
|
|
1206
|
+
const t = vn();
|
|
1207
|
+
return k(() => (t.value, !!e()));
|
|
1175
1208
|
}
|
|
1176
1209
|
function Ye(e, t, n = {}) {
|
|
1177
1210
|
const { window: o = De, ...i } = n;
|
|
1178
1211
|
let c;
|
|
1179
|
-
const l =
|
|
1212
|
+
const l = mn(() => o && "ResizeObserver" in o), a = () => {
|
|
1180
1213
|
c && (c.disconnect(), c = void 0);
|
|
1181
|
-
}, u =
|
|
1182
|
-
const
|
|
1183
|
-
return Array.isArray(
|
|
1184
|
-
}), r =
|
|
1214
|
+
}, u = k(() => {
|
|
1215
|
+
const d = x(e);
|
|
1216
|
+
return Array.isArray(d) ? d.map((f) => q(f)) : [q(d)];
|
|
1217
|
+
}), r = X(
|
|
1185
1218
|
u,
|
|
1186
|
-
(
|
|
1219
|
+
(d) => {
|
|
1187
1220
|
if (a(), l.value && o) {
|
|
1188
1221
|
c = new ResizeObserver(t);
|
|
1189
|
-
for (const
|
|
1190
|
-
|
|
1222
|
+
for (const f of d)
|
|
1223
|
+
f && c.observe(f, i);
|
|
1191
1224
|
}
|
|
1192
1225
|
},
|
|
1193
1226
|
{ immediate: !0, flush: "post" }
|
|
1194
1227
|
), s = () => {
|
|
1195
1228
|
a(), r();
|
|
1196
1229
|
};
|
|
1197
|
-
return
|
|
1230
|
+
return le(s), {
|
|
1198
1231
|
isSupported: l,
|
|
1199
1232
|
stop: s
|
|
1200
1233
|
};
|
|
@@ -1202,7 +1235,7 @@ function Ye(e, t, n = {}) {
|
|
|
1202
1235
|
function Ee(e) {
|
|
1203
1236
|
return typeof Window < "u" && e instanceof Window ? e.document.documentElement : typeof Document < "u" && e instanceof Document ? e.documentElement : e;
|
|
1204
1237
|
}
|
|
1205
|
-
const
|
|
1238
|
+
const hn = {
|
|
1206
1239
|
mounted(e, t) {
|
|
1207
1240
|
typeof t.value == "function" ? Ye(e, t.value) : Ye(e, ...t.value);
|
|
1208
1241
|
}
|
|
@@ -1216,16 +1249,16 @@ function lt(e) {
|
|
|
1216
1249
|
return !n || n.tagName === "BODY" ? !1 : lt(n);
|
|
1217
1250
|
}
|
|
1218
1251
|
}
|
|
1219
|
-
function
|
|
1252
|
+
function pn(e) {
|
|
1220
1253
|
const t = e || window.event, n = t.target;
|
|
1221
1254
|
return lt(n) ? !1 : t.touches.length > 1 ? !0 : (t.preventDefault && t.preventDefault(), !1);
|
|
1222
1255
|
}
|
|
1223
1256
|
const Ie = /* @__PURE__ */ new WeakMap();
|
|
1224
|
-
function
|
|
1225
|
-
const n =
|
|
1257
|
+
function gn(e, t = !1) {
|
|
1258
|
+
const n = H(t);
|
|
1226
1259
|
let o = null, i = "";
|
|
1227
|
-
|
|
1228
|
-
const u = Ee(
|
|
1260
|
+
X(zt(e), (a) => {
|
|
1261
|
+
const u = Ee(x(a));
|
|
1229
1262
|
if (u) {
|
|
1230
1263
|
const r = u;
|
|
1231
1264
|
if (Ie.get(r) || Ie.set(r, r.style.overflow), r.style.overflow !== "hidden" && (i = r.style.overflow), r.style.overflow === "hidden")
|
|
@@ -1237,20 +1270,20 @@ function mn(e, t = !1) {
|
|
|
1237
1270
|
immediate: !0
|
|
1238
1271
|
});
|
|
1239
1272
|
const c = () => {
|
|
1240
|
-
const a = Ee(
|
|
1273
|
+
const a = Ee(x(e));
|
|
1241
1274
|
!a || n.value || (Me && (o = me(
|
|
1242
1275
|
a,
|
|
1243
1276
|
"touchmove",
|
|
1244
1277
|
(u) => {
|
|
1245
|
-
|
|
1278
|
+
pn(u);
|
|
1246
1279
|
},
|
|
1247
1280
|
{ passive: !1 }
|
|
1248
1281
|
)), a.style.overflow = "hidden", n.value = !0);
|
|
1249
1282
|
}, l = () => {
|
|
1250
|
-
const a = Ee(
|
|
1283
|
+
const a = Ee(x(e));
|
|
1251
1284
|
!a || !n.value || (Me && (o == null || o()), a.style.overflow = i, Ie.delete(a), n.value = !1);
|
|
1252
1285
|
};
|
|
1253
|
-
return
|
|
1286
|
+
return le(l), k({
|
|
1254
1287
|
get() {
|
|
1255
1288
|
return n.value;
|
|
1256
1289
|
},
|
|
@@ -1259,22 +1292,22 @@ function mn(e, t = !1) {
|
|
|
1259
1292
|
}
|
|
1260
1293
|
});
|
|
1261
1294
|
}
|
|
1262
|
-
function
|
|
1295
|
+
function wn() {
|
|
1263
1296
|
let e = !1;
|
|
1264
|
-
const t =
|
|
1297
|
+
const t = H(!1);
|
|
1265
1298
|
return (n, o) => {
|
|
1266
1299
|
if (t.value = o.value, e)
|
|
1267
1300
|
return;
|
|
1268
1301
|
e = !0;
|
|
1269
|
-
const i =
|
|
1270
|
-
|
|
1302
|
+
const i = gn(n, o.value);
|
|
1303
|
+
X(t, (c) => i.value = c);
|
|
1271
1304
|
};
|
|
1272
1305
|
}
|
|
1273
|
-
|
|
1274
|
-
const
|
|
1306
|
+
wn();
|
|
1307
|
+
const yn = { key: 0 }, bn = {
|
|
1275
1308
|
class: "atable-header-row",
|
|
1276
1309
|
tabindex: "-1"
|
|
1277
|
-
},
|
|
1310
|
+
}, xn = ["data-colindex"], at = /* @__PURE__ */ K({
|
|
1278
1311
|
__name: "ATableHeader",
|
|
1279
1312
|
props: {
|
|
1280
1313
|
columns: {},
|
|
@@ -1289,44 +1322,44 @@ const gn = { key: 0 }, pn = {
|
|
|
1289
1322
|
typeof u == "number" && u !== l && e.store.resizeColumn(a, l);
|
|
1290
1323
|
}
|
|
1291
1324
|
};
|
|
1292
|
-
return (n, o) => n.columns.length ? (S(),
|
|
1293
|
-
|
|
1294
|
-
n.store.zeroColumn ? (S(),
|
|
1325
|
+
return (n, o) => n.columns.length ? (S(), A("thead", yn, [
|
|
1326
|
+
D("tr", bn, [
|
|
1327
|
+
n.store.zeroColumn ? (S(), A("th", {
|
|
1295
1328
|
key: 0,
|
|
1296
1329
|
id: "header-index",
|
|
1297
|
-
class:
|
|
1330
|
+
class: Y([[
|
|
1298
1331
|
n.store.hasPinnedColumns ? "sticky-index" : "",
|
|
1299
1332
|
n.store.config.view === "tree" ? "tree-index" : "",
|
|
1300
1333
|
n.store.config.view === "list-expansion" ? "list-expansion-index" : ""
|
|
1301
1334
|
], "list-index"])
|
|
1302
|
-
}, null, 2)) :
|
|
1303
|
-
(S(!0),
|
|
1335
|
+
}, null, 2)) : ee("", !0),
|
|
1336
|
+
(S(!0), A(ie, null, ke(n.columns, (i, c) => he((S(), A("th", {
|
|
1304
1337
|
key: i.name,
|
|
1305
1338
|
"data-colindex": c,
|
|
1306
1339
|
tabindex: "-1",
|
|
1307
|
-
style:
|
|
1308
|
-
class:
|
|
1340
|
+
style: J(n.store.getHeaderCellStyle(i)),
|
|
1341
|
+
class: Y(i.pinned ? "sticky-column" : "")
|
|
1309
1342
|
}, [
|
|
1310
|
-
|
|
1311
|
-
mt(
|
|
1343
|
+
B(n.$slots, "default", {}, () => [
|
|
1344
|
+
mt(_(i.label || String.fromCharCode(c + 97).toUpperCase()), 1)
|
|
1312
1345
|
])
|
|
1313
|
-
], 14,
|
|
1314
|
-
[b(
|
|
1346
|
+
], 14, xn)), [
|
|
1347
|
+
[b(hn), t]
|
|
1315
1348
|
])), 128))
|
|
1316
1349
|
])
|
|
1317
|
-
])) :
|
|
1350
|
+
])) : ee("", !0);
|
|
1318
1351
|
}
|
|
1319
|
-
}), st = /* @__PURE__ */
|
|
1352
|
+
}), st = /* @__PURE__ */ K({
|
|
1320
1353
|
__name: "ATableModal",
|
|
1321
1354
|
props: {
|
|
1322
1355
|
store: {}
|
|
1323
1356
|
},
|
|
1324
1357
|
setup(e) {
|
|
1325
|
-
const t =
|
|
1326
|
-
var
|
|
1358
|
+
const t = G("amodal"), { width: n, height: o } = pe(t), i = k(() => {
|
|
1359
|
+
var d, f, y, h;
|
|
1327
1360
|
if (!(e.store.modal.height && e.store.modal.width && e.store.modal.left && e.store.modal.bottom)) return;
|
|
1328
|
-
const c = (
|
|
1329
|
-
let u = ((
|
|
1361
|
+
const c = (d = e.store.modal.cell) == null ? void 0 : d.closest("table"), l = c.offsetHeight || 0, a = c.offsetWidth || 0;
|
|
1362
|
+
let u = ((f = e.store.modal.cell) == null ? void 0 : f.offsetTop) || 0;
|
|
1330
1363
|
const r = ((y = c.querySelector("thead")) == null ? void 0 : y.offsetHeight) || 0;
|
|
1331
1364
|
u += r, u = u + o.value < l ? u : u - (o.value + e.store.modal.height);
|
|
1332
1365
|
let s = ((h = e.store.modal.cell) == null ? void 0 : h.offsetLeft) || 0;
|
|
@@ -1335,7 +1368,7 @@ const gn = { key: 0 }, pn = {
|
|
|
1335
1368
|
top: `${u}px`
|
|
1336
1369
|
};
|
|
1337
1370
|
});
|
|
1338
|
-
return (c, l) => (S(),
|
|
1371
|
+
return (c, l) => (S(), A("div", {
|
|
1339
1372
|
class: "amodal",
|
|
1340
1373
|
ref: "amodal",
|
|
1341
1374
|
tabindex: "-1",
|
|
@@ -1343,80 +1376,80 @@ const gn = { key: 0 }, pn = {
|
|
|
1343
1376
|
}, ["stop"])),
|
|
1344
1377
|
onInput: l[1] || (l[1] = We(() => {
|
|
1345
1378
|
}, ["stop"])),
|
|
1346
|
-
style:
|
|
1379
|
+
style: J(i.value)
|
|
1347
1380
|
}, [
|
|
1348
|
-
|
|
1381
|
+
B(c.$slots, "default")
|
|
1349
1382
|
], 36));
|
|
1350
1383
|
}
|
|
1351
|
-
}),
|
|
1352
|
-
const t = e.id ||
|
|
1384
|
+
}), Cn = (e) => {
|
|
1385
|
+
const t = e.id || qt();
|
|
1353
1386
|
return ht(`table-${t}`, () => {
|
|
1354
1387
|
const o = () => {
|
|
1355
|
-
const
|
|
1356
|
-
for (const [w,
|
|
1357
|
-
for (const [
|
|
1358
|
-
|
|
1359
|
-
return
|
|
1360
|
-
}, i = (
|
|
1388
|
+
const p = {};
|
|
1389
|
+
for (const [w, $] of c.value.entries())
|
|
1390
|
+
for (const [R, W] of l.value.entries())
|
|
1391
|
+
p[`${w}:${R}`] = W[$.name];
|
|
1392
|
+
return p;
|
|
1393
|
+
}, i = (p) => {
|
|
1361
1394
|
const w = [Object.assign({}, { rowModified: !1 })];
|
|
1362
|
-
if (
|
|
1363
|
-
return
|
|
1364
|
-
const
|
|
1365
|
-
for (let
|
|
1366
|
-
const
|
|
1367
|
-
|
|
1395
|
+
if (p && "0:0" in p)
|
|
1396
|
+
return p;
|
|
1397
|
+
const $ = /* @__PURE__ */ new Set();
|
|
1398
|
+
for (let R = l.value.length - 1; R >= 0; R--) {
|
|
1399
|
+
const W = l.value[R];
|
|
1400
|
+
W.parent && $.add(W.parent), w[R] = {
|
|
1368
1401
|
childrenOpen: !1,
|
|
1369
1402
|
expanded: !1,
|
|
1370
|
-
indent:
|
|
1371
|
-
isParent:
|
|
1372
|
-
isRoot:
|
|
1403
|
+
indent: W.indent || 0,
|
|
1404
|
+
isParent: $.has(R),
|
|
1405
|
+
isRoot: W.parent === null || W.parent === void 0,
|
|
1373
1406
|
rowModified: !1,
|
|
1374
|
-
open:
|
|
1375
|
-
parent:
|
|
1407
|
+
open: W.parent === null || W.parent === void 0,
|
|
1408
|
+
parent: W.parent
|
|
1376
1409
|
};
|
|
1377
1410
|
}
|
|
1378
1411
|
return w;
|
|
1379
|
-
}, c =
|
|
1412
|
+
}, c = O(e.columns), l = O(e.rows), a = O(e.config || {}), u = O(e.table || o()), r = O(i(e.display)), s = O(e.modal || { visible: !1 }), d = O({}), f = k(() => c.value.some((p) => p.pinned)), y = k(() => `${Math.ceil(l.value.length / 100 + 1)}ch`), h = k(
|
|
1380
1413
|
() => a.value.view ? ["list", "tree", "list-expansion"].includes(a.value.view) : !1
|
|
1381
|
-
),
|
|
1382
|
-
const
|
|
1383
|
-
u.value[
|
|
1384
|
-
},
|
|
1385
|
-
const
|
|
1386
|
-
u.value[
|
|
1387
|
-
},
|
|
1388
|
-
const w = c.value.indexOf(
|
|
1414
|
+
), C = (p, w) => u.value[`${p}:${w}`], v = (p, w, $) => {
|
|
1415
|
+
const R = `${p}:${w}`, W = c.value[p];
|
|
1416
|
+
u.value[R] !== $ && (r.value[w].rowModified = !0), u.value[R] = $, l.value[w][W.name] = $;
|
|
1417
|
+
}, m = (p, w, $) => {
|
|
1418
|
+
const R = `${p}:${w}`;
|
|
1419
|
+
u.value[R] !== $ && (r.value[w].rowModified = !0, d.value[R] = $);
|
|
1420
|
+
}, g = (p) => {
|
|
1421
|
+
const w = c.value.indexOf(p) === c.value.length - 1, $ = a.value.fullWidth ? p.resizable && !w : p.resizable;
|
|
1389
1422
|
return {
|
|
1390
|
-
width:
|
|
1391
|
-
textAlign:
|
|
1392
|
-
|
|
1423
|
+
width: p.width || "40ch",
|
|
1424
|
+
textAlign: p.align || "center",
|
|
1425
|
+
...$ && {
|
|
1393
1426
|
resize: "horizontal",
|
|
1394
1427
|
overflow: "hidden",
|
|
1395
1428
|
whiteSpace: "nowrap"
|
|
1396
1429
|
}
|
|
1397
1430
|
};
|
|
1398
|
-
},
|
|
1399
|
-
if (
|
|
1400
|
-
const
|
|
1401
|
-
c.value[
|
|
1402
|
-
...c.value[
|
|
1403
|
-
width: `${
|
|
1431
|
+
}, I = (p, w) => {
|
|
1432
|
+
if (p < 0 || p >= c.value.length) return;
|
|
1433
|
+
const R = Math.max(w, 40);
|
|
1434
|
+
c.value[p] = {
|
|
1435
|
+
...c.value[p],
|
|
1436
|
+
width: `${R}px`
|
|
1404
1437
|
};
|
|
1405
|
-
},
|
|
1406
|
-
const w = l.value[
|
|
1438
|
+
}, M = (p) => {
|
|
1439
|
+
const w = l.value[p];
|
|
1407
1440
|
return a.value.view === "gantt" && w.indent === 0;
|
|
1408
|
-
},
|
|
1441
|
+
}, L = (p) => a.value.view !== "tree" || r.value[p].isRoot || r.value[p].open, P = (p) => a.value.view !== "tree" ? "" : r.value[p].isRoot || r.value[p].isParent ? r.value[p].childrenOpen ? "-" : "+" : "", E = (p) => {
|
|
1409
1442
|
if (a.value.view === "tree") {
|
|
1410
|
-
r.value[
|
|
1443
|
+
r.value[p].childrenOpen = !r.value[p].childrenOpen;
|
|
1411
1444
|
for (let w = l.value.length - 1; w >= 0; w--)
|
|
1412
|
-
r.value[w].parent ===
|
|
1413
|
-
} else a.value.view === "list-expansion" && (r.value[
|
|
1414
|
-
}, T = (
|
|
1415
|
-
const
|
|
1416
|
-
return
|
|
1417
|
-
},
|
|
1418
|
-
const
|
|
1419
|
-
return se ? typeof se == "function" ? se(
|
|
1445
|
+
r.value[w].parent === p && (r.value[w].open = !r.value[w].open, r.value[w].childrenOpen && E(w));
|
|
1446
|
+
} else a.value.view === "list-expansion" && (r.value[p].expanded = !r.value[p].expanded);
|
|
1447
|
+
}, T = (p, w) => {
|
|
1448
|
+
const $ = C(p, w);
|
|
1449
|
+
return z(p, w, $);
|
|
1450
|
+
}, z = (p, w, $) => {
|
|
1451
|
+
const R = c.value[p], W = l.value[w], se = R.format;
|
|
1452
|
+
return se ? typeof se == "function" ? se($, { table: u.value, row: W, column: R }) : typeof se == "string" ? Function(`"use strict";return (${se})`)()($, { table: u.value, row: W, column: R }) : $ : $;
|
|
1420
1453
|
};
|
|
1421
1454
|
return {
|
|
1422
1455
|
// state
|
|
@@ -1426,36 +1459,36 @@ const gn = { key: 0 }, pn = {
|
|
|
1426
1459
|
modal: s,
|
|
1427
1460
|
rows: l,
|
|
1428
1461
|
table: u,
|
|
1429
|
-
updates:
|
|
1462
|
+
updates: d,
|
|
1430
1463
|
// getters
|
|
1431
|
-
hasPinnedColumns:
|
|
1464
|
+
hasPinnedColumns: f,
|
|
1432
1465
|
numberedRowWidth: y,
|
|
1433
1466
|
zeroColumn: h,
|
|
1434
1467
|
// actions
|
|
1435
|
-
closeModal: (
|
|
1468
|
+
closeModal: (p) => {
|
|
1436
1469
|
var w;
|
|
1437
|
-
|
|
1470
|
+
p.target instanceof Node && (w = s.value.parent) != null && w.contains(p.target) || s.value.visible && (s.value.visible = !1);
|
|
1438
1471
|
},
|
|
1439
|
-
getCellData:
|
|
1472
|
+
getCellData: C,
|
|
1440
1473
|
getCellDisplayValue: T,
|
|
1441
|
-
getFormattedValue:
|
|
1442
|
-
getHeaderCellStyle:
|
|
1443
|
-
resizeColumn:
|
|
1444
|
-
getIndent: (
|
|
1445
|
-
getRowExpandSymbol:
|
|
1446
|
-
isRowGantt:
|
|
1447
|
-
isRowVisible:
|
|
1448
|
-
setCellData:
|
|
1449
|
-
setCellText:
|
|
1450
|
-
toggleRowExpand:
|
|
1451
|
-
updateGanttBar: (
|
|
1452
|
-
var
|
|
1453
|
-
const w = (
|
|
1454
|
-
w && (
|
|
1474
|
+
getFormattedValue: z,
|
|
1475
|
+
getHeaderCellStyle: g,
|
|
1476
|
+
resizeColumn: I,
|
|
1477
|
+
getIndent: (p, w) => w && p === 0 && w > 0 ? `${w}ch` : "inherit",
|
|
1478
|
+
getRowExpandSymbol: P,
|
|
1479
|
+
isRowGantt: M,
|
|
1480
|
+
isRowVisible: L,
|
|
1481
|
+
setCellData: v,
|
|
1482
|
+
setCellText: m,
|
|
1483
|
+
toggleRowExpand: E,
|
|
1484
|
+
updateGanttBar: (p) => {
|
|
1485
|
+
var $;
|
|
1486
|
+
const w = ($ = l.value[p.rowIndex]) == null ? void 0 : $.gantt;
|
|
1487
|
+
w && (p.type === "resize" ? p.edge === "start" ? (w.startIndex = p.newStart, w.endIndex = p.end, w.colspan = w.endIndex - w.startIndex) : p.edge === "end" && (w.startIndex = p.start, w.endIndex = p.newEnd, w.colspan = w.endIndex - w.startIndex) : p.type === "bar" && (w.startIndex = p.newStart, w.endIndex = p.newEnd, w.colspan = w.endIndex - w.startIndex));
|
|
1455
1488
|
}
|
|
1456
1489
|
};
|
|
1457
1490
|
})();
|
|
1458
|
-
},
|
|
1491
|
+
}, En = /* @__PURE__ */ K({
|
|
1459
1492
|
__name: "ATable",
|
|
1460
1493
|
props: {
|
|
1461
1494
|
id: {},
|
|
@@ -1466,49 +1499,49 @@ const gn = { key: 0 }, pn = {
|
|
|
1466
1499
|
},
|
|
1467
1500
|
emits: ["update:modelValue", "cellUpdate", "gantt:drag"],
|
|
1468
1501
|
setup(e, { expose: t, emit: n }) {
|
|
1469
|
-
const o = n, i =
|
|
1470
|
-
l.$onAction(({ name: s, store:
|
|
1502
|
+
const o = n, i = G("table"), c = e.modelValue ? e.modelValue : e.rows, l = Cn({ columns: e.columns, rows: c, id: e.id, config: e.config });
|
|
1503
|
+
l.$onAction(({ name: s, store: d, args: f, after: y }) => {
|
|
1471
1504
|
if (s === "setCellData" || s === "setCellText") {
|
|
1472
|
-
const [h,
|
|
1505
|
+
const [h, C, v] = f, m = d.getCellData(h, C);
|
|
1473
1506
|
y(() => {
|
|
1474
|
-
o("cellUpdate", { colIndex: h, rowIndex:
|
|
1507
|
+
o("cellUpdate", { colIndex: h, rowIndex: C, newValue: v, oldValue: m });
|
|
1475
1508
|
});
|
|
1476
1509
|
} else if (s === "updateGanttBar") {
|
|
1477
|
-
const [h] =
|
|
1478
|
-
let
|
|
1479
|
-
h.type === "resize" ?
|
|
1510
|
+
const [h] = f;
|
|
1511
|
+
let C = !1;
|
|
1512
|
+
h.type === "resize" ? C = h.oldColspan !== h.newColspan : h.type === "bar" && (C = h.oldStart !== h.newStart || h.oldEnd !== h.newEnd), C && y(() => {
|
|
1480
1513
|
o("gantt:drag", h);
|
|
1481
1514
|
});
|
|
1482
1515
|
}
|
|
1483
|
-
}),
|
|
1516
|
+
}), X(
|
|
1484
1517
|
() => l.rows,
|
|
1485
1518
|
(s) => {
|
|
1486
1519
|
o("update:modelValue", s);
|
|
1487
1520
|
},
|
|
1488
1521
|
{ deep: !0 }
|
|
1489
|
-
),
|
|
1522
|
+
), Z(() => {
|
|
1490
1523
|
e.columns.some((s) => s.pinned) && (u(), l.config.view === "tree" && nt(i, u, { childList: !0, subtree: !0 }));
|
|
1491
1524
|
});
|
|
1492
|
-
const a =
|
|
1493
|
-
const s = i.value,
|
|
1494
|
-
for (const [h,
|
|
1495
|
-
const
|
|
1496
|
-
|
|
1525
|
+
const a = k(() => l.columns.filter((s) => s.pinned).length), u = () => {
|
|
1526
|
+
const s = i.value, d = s == null ? void 0 : s.rows[0], f = s == null ? void 0 : s.rows[1], y = d ? Array.from(d.cells) : [];
|
|
1527
|
+
for (const [h, C] of y.entries()) {
|
|
1528
|
+
const v = f == null ? void 0 : f.cells[h];
|
|
1529
|
+
v && (C.style.width = `${v.offsetWidth}px`);
|
|
1497
1530
|
}
|
|
1498
1531
|
for (const h of (s == null ? void 0 : s.rows) || []) {
|
|
1499
|
-
let
|
|
1500
|
-
const
|
|
1501
|
-
for (const
|
|
1502
|
-
(
|
|
1503
|
-
|
|
1532
|
+
let C = 0;
|
|
1533
|
+
const v = [];
|
|
1534
|
+
for (const m of h.cells)
|
|
1535
|
+
(m.classList.contains("sticky-column") || m.classList.contains("sticky-index")) && (m.style.left = `${C}px`, C += m.offsetWidth, v.push(m));
|
|
1536
|
+
v.length > 0 && v[v.length - 1].classList.add("sticky-column-edge");
|
|
1504
1537
|
}
|
|
1505
1538
|
};
|
|
1506
1539
|
window.addEventListener("keydown", (s) => {
|
|
1507
1540
|
if (s.key === "Escape" && l.modal.visible) {
|
|
1508
1541
|
l.modal.visible = !1;
|
|
1509
|
-
const
|
|
1510
|
-
|
|
1511
|
-
|
|
1542
|
+
const d = l.modal.parent;
|
|
1543
|
+
d && Qe().then(() => {
|
|
1544
|
+
d.focus();
|
|
1512
1545
|
});
|
|
1513
1546
|
}
|
|
1514
1547
|
});
|
|
@@ -1516,59 +1549,59 @@ const gn = { key: 0 }, pn = {
|
|
|
1516
1549
|
var y;
|
|
1517
1550
|
if (!(s.indent === 0) || a.value === 0)
|
|
1518
1551
|
return l.columns;
|
|
1519
|
-
const
|
|
1552
|
+
const f = [];
|
|
1520
1553
|
for (let h = 0; h < a.value; h++) {
|
|
1521
|
-
const
|
|
1522
|
-
|
|
1554
|
+
const C = { ...l.columns[h] };
|
|
1555
|
+
C.originalIndex = h, f.push(C);
|
|
1523
1556
|
}
|
|
1524
|
-
return
|
|
1557
|
+
return f.push({
|
|
1525
1558
|
...l.columns[a.value],
|
|
1526
1559
|
isGantt: !0,
|
|
1527
1560
|
colspan: ((y = s.gantt) == null ? void 0 : y.colspan) || l.columns.length - a.value,
|
|
1528
1561
|
originalIndex: a.value,
|
|
1529
1562
|
width: "auto"
|
|
1530
1563
|
// TODO: refactor to API that can detect when data exists in a cell. Might have be custom and not generalizable
|
|
1531
|
-
}),
|
|
1564
|
+
}), f;
|
|
1532
1565
|
};
|
|
1533
|
-
return t({ store: l }), (s,
|
|
1566
|
+
return t({ store: l }), (s, d) => he((S(), A("table", {
|
|
1534
1567
|
ref: "table",
|
|
1535
1568
|
class: "atable",
|
|
1536
|
-
style:
|
|
1569
|
+
style: J({
|
|
1537
1570
|
width: b(l).config.fullWidth ? "100%" : "auto"
|
|
1538
1571
|
})
|
|
1539
1572
|
}, [
|
|
1540
|
-
|
|
1573
|
+
B(s.$slots, "header", { data: b(l) }, () => [
|
|
1541
1574
|
He(at, {
|
|
1542
1575
|
columns: b(l).columns,
|
|
1543
1576
|
store: b(l)
|
|
1544
1577
|
}, null, 8, ["columns", "store"])
|
|
1545
1578
|
], !0),
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
(S(!0),
|
|
1549
|
-
key:
|
|
1550
|
-
row:
|
|
1579
|
+
D("tbody", null, [
|
|
1580
|
+
B(s.$slots, "body", { data: b(l) }, () => [
|
|
1581
|
+
(S(!0), A(ie, null, ke(b(l).rows, (f, y) => (S(), re(ot, {
|
|
1582
|
+
key: f.id,
|
|
1583
|
+
row: f,
|
|
1551
1584
|
rowIndex: y,
|
|
1552
1585
|
store: b(l)
|
|
1553
1586
|
}, {
|
|
1554
1587
|
default: ze(() => [
|
|
1555
|
-
(S(!0),
|
|
1556
|
-
var
|
|
1557
|
-
return S(),
|
|
1588
|
+
(S(!0), A(ie, null, ke(r(f), (h, C) => {
|
|
1589
|
+
var v, m, g;
|
|
1590
|
+
return S(), A(ie, {
|
|
1558
1591
|
key: h.name
|
|
1559
1592
|
}, [
|
|
1560
1593
|
h.isGantt ? (S(), re(fe(h.ganttComponent || "AGanttCell"), {
|
|
1561
1594
|
key: 0,
|
|
1562
1595
|
store: b(l),
|
|
1563
1596
|
columnsCount: b(l).columns.length - a.value,
|
|
1564
|
-
color: (
|
|
1565
|
-
start: (
|
|
1566
|
-
end: (
|
|
1597
|
+
color: (v = f.gantt) == null ? void 0 : v.color,
|
|
1598
|
+
start: (m = f.gantt) == null ? void 0 : m.startIndex,
|
|
1599
|
+
end: (g = f.gantt) == null ? void 0 : g.endIndex,
|
|
1567
1600
|
colspan: h.colspan,
|
|
1568
1601
|
pinned: h.pinned,
|
|
1569
1602
|
rowIndex: y,
|
|
1570
|
-
colIndex: h.originalIndex ??
|
|
1571
|
-
style:
|
|
1603
|
+
colIndex: h.originalIndex ?? C,
|
|
1604
|
+
style: J({
|
|
1572
1605
|
textAlign: (h == null ? void 0 : h.align) || "center",
|
|
1573
1606
|
minWidth: (h == null ? void 0 : h.width) || "40ch",
|
|
1574
1607
|
width: b(l).config.fullWidth ? "auto" : null
|
|
@@ -1578,8 +1611,8 @@ const gn = { key: 0 }, pn = {
|
|
|
1578
1611
|
store: b(l),
|
|
1579
1612
|
pinned: h.pinned,
|
|
1580
1613
|
rowIndex: y,
|
|
1581
|
-
colIndex:
|
|
1582
|
-
style:
|
|
1614
|
+
colIndex: C,
|
|
1615
|
+
style: J({
|
|
1583
1616
|
textAlign: (h == null ? void 0 : h.align) || "center",
|
|
1584
1617
|
width: b(l).config.fullWidth ? "auto" : null
|
|
1585
1618
|
}),
|
|
@@ -1592,8 +1625,8 @@ const gn = { key: 0 }, pn = {
|
|
|
1592
1625
|
}, 1032, ["row", "rowIndex", "store"]))), 128))
|
|
1593
1626
|
], !0)
|
|
1594
1627
|
]),
|
|
1595
|
-
|
|
1596
|
-
|
|
1628
|
+
B(s.$slots, "footer", { data: b(l) }, void 0, !0),
|
|
1629
|
+
B(s.$slots, "modal", { data: b(l) }, () => [
|
|
1597
1630
|
he(He(st, { store: b(l) }, {
|
|
1598
1631
|
default: ze(() => [
|
|
1599
1632
|
(S(), re(fe(b(l).modal.component), Se({
|
|
@@ -1609,42 +1642,42 @@ const gn = { key: 0 }, pn = {
|
|
|
1609
1642
|
])
|
|
1610
1643
|
], !0)
|
|
1611
1644
|
], 4)), [
|
|
1612
|
-
[b(
|
|
1645
|
+
[b(fn), b(l).closeModal]
|
|
1613
1646
|
]);
|
|
1614
1647
|
}
|
|
1615
|
-
}),
|
|
1616
|
-
function
|
|
1617
|
-
return S(),
|
|
1618
|
-
|
|
1619
|
-
|
|
1648
|
+
}), In = /* @__PURE__ */ ae(En, [["__scopeId", "data-v-785e5fa3"]]), kn = {}, Mn = { class: "aloading" }, Sn = { class: "aloading-header" };
|
|
1649
|
+
function $n(e, t) {
|
|
1650
|
+
return S(), A("div", Mn, [
|
|
1651
|
+
D("h2", Sn, [
|
|
1652
|
+
B(e.$slots, "default", {}, void 0, !0)
|
|
1620
1653
|
]),
|
|
1621
|
-
t[0] || (t[0] =
|
|
1654
|
+
t[0] || (t[0] = D("div", { class: "aloading-bar" }, null, -1))
|
|
1622
1655
|
]);
|
|
1623
1656
|
}
|
|
1624
|
-
const
|
|
1625
|
-
function
|
|
1626
|
-
return S(),
|
|
1627
|
-
|
|
1628
|
-
|
|
1657
|
+
const An = /* @__PURE__ */ ae(kn, [["render", $n], ["__scopeId", "data-v-a930a25b"]]), Tn = {}, Rn = { class: "aloading" }, Pn = { class: "aloading-header" };
|
|
1658
|
+
function On(e, t) {
|
|
1659
|
+
return S(), A("div", Rn, [
|
|
1660
|
+
D("h2", Pn, [
|
|
1661
|
+
B(e.$slots, "default", {}, void 0, !0)
|
|
1629
1662
|
]),
|
|
1630
|
-
t[0] || (t[0] =
|
|
1663
|
+
t[0] || (t[0] = D("div", { class: "aloading-bar" }, null, -1))
|
|
1631
1664
|
]);
|
|
1632
1665
|
}
|
|
1633
|
-
const
|
|
1634
|
-
function
|
|
1635
|
-
e.component("ACell",
|
|
1666
|
+
const Ln = /* @__PURE__ */ ae(Tn, [["render", On], ["__scopeId", "data-v-e1165876"]]);
|
|
1667
|
+
function zn(e) {
|
|
1668
|
+
e.component("ACell", Kt), e.component("AExpansionRow", on), e.component("AGanttCell", un), e.component("ARow", ot), e.component("ATable", In), e.component("ATableHeader", at), e.component("ATableLoading", An), e.component("ATableLoadingBar", Ln), e.component("ATableModal", st);
|
|
1636
1669
|
}
|
|
1637
1670
|
export {
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1671
|
+
Kt as ACell,
|
|
1672
|
+
on as AExpansionRow,
|
|
1673
|
+
un as AGanttCell,
|
|
1641
1674
|
ot as ARow,
|
|
1642
|
-
|
|
1675
|
+
In as ATable,
|
|
1643
1676
|
at as ATableHeader,
|
|
1644
|
-
|
|
1645
|
-
|
|
1677
|
+
An as ATableLoading,
|
|
1678
|
+
Ln as ATableLoadingBar,
|
|
1646
1679
|
st as ATableModal,
|
|
1647
|
-
|
|
1648
|
-
|
|
1680
|
+
Cn as createTableStore,
|
|
1681
|
+
zn as install
|
|
1649
1682
|
};
|
|
1650
1683
|
//# sourceMappingURL=atable.js.map
|