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