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