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