@stonecrop/atable 0.2.23 → 0.2.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/atable/src/tsdoc-metadata.json +11 -0
- package/dist/atable.d.ts +46 -0
- package/dist/atable.js +463 -416
- package/dist/atable.js.map +1 -1
- package/dist/atable.tsbuildinfo +1 -0
- package/dist/atable.umd.cjs +1 -1
- package/dist/atable.umd.cjs.map +1 -1
- package/dist/components/index.js +97 -0
- package/dist/index.js +21 -0
- package/dist/src/components/index.d.ts +23 -0
- package/dist/src/components/index.d.ts.map +1 -0
- package/dist/src/index.d.ts +17 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/types/index.d.ts +46 -0
- package/dist/src/types/index.d.ts.map +1 -0
- package/dist/style.css +1 -1
- package/dist/types/index.js +0 -0
- package/package.json +26 -31
- package/src/components/ACell.vue +1 -1
- package/src/components/AExpansionRow.vue +5 -6
- package/src/components/ARow.vue +15 -28
- package/src/components/ATable.vue +8 -8
- package/src/components/ATableHeader.vue +2 -3
- package/src/components/ATableModal.vue +8 -9
- package/src/components/index.ts +1 -1
- package/src/index.ts +6 -0
- package/src/themes/default.css +0 -2
- package/src/types/index.ts +53 -0
- package/src/histoire.setup.ts +0 -24
package/dist/atable.js
CHANGED
|
@@ -1,94 +1,137 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
var Re = Object.defineProperty;
|
|
2
|
+
var Le = (t, e, n) => e in t ? Re(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var C = (t, e, n) => Le(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import { onMounted as ye, ref as x, watch as S, onBeforeUnmount as Me, computed as E, unref as f, getCurrentScope as be, onScopeDispose as xe, getCurrentInstance as Pe, defineComponent as _, inject as z, openBlock as w, createElementBlock as b, createBlock as W, resolveDynamicComponent as Ee, mergeProps as K, toDisplayString as L, Fragment as V, createElementVNode as $, renderSlot as I, createCommentVNode as B, withDirectives as X, vShow as Ie, toRef as He, readonly as je, customRef as We, reactive as D, renderList as J, normalizeStyle as N, createTextVNode as Ne, provide as Ue, nextTick as Ve, createVNode as se, withCtx as ie } from "vue";
|
|
5
|
+
function ke(t) {
|
|
6
|
+
return be() ? (xe(t), !0) : !1;
|
|
4
7
|
}
|
|
5
|
-
function
|
|
6
|
-
return typeof t == "function" ? t() :
|
|
8
|
+
function ee(t) {
|
|
9
|
+
return typeof t == "function" ? t() : f(t);
|
|
7
10
|
}
|
|
8
|
-
const
|
|
11
|
+
const Be = typeof window < "u" && typeof document < "u";
|
|
9
12
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
10
|
-
const
|
|
13
|
+
const ze = (t) => t != null, Fe = Object.prototype.toString, qe = (t) => Fe.call(t) === "[object Object]", Ge = () => {
|
|
11
14
|
};
|
|
12
|
-
function
|
|
15
|
+
function M(t) {
|
|
13
16
|
var e;
|
|
14
|
-
const n =
|
|
17
|
+
const n = ee(t);
|
|
15
18
|
return (e = n == null ? void 0 : n.$el) != null ? e : n;
|
|
16
19
|
}
|
|
17
|
-
const
|
|
18
|
-
function
|
|
20
|
+
const F = Be ? window : void 0;
|
|
21
|
+
function Q(...t) {
|
|
19
22
|
let e, n, o, a;
|
|
20
|
-
if (typeof t[0] == "string" || Array.isArray(t[0]) ? ([n, o, a] = t, e =
|
|
21
|
-
return
|
|
23
|
+
if (typeof t[0] == "string" || Array.isArray(t[0]) ? ([n, o, a] = t, e = F) : [e, n, o, a] = t, !e)
|
|
24
|
+
return Ge;
|
|
22
25
|
Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
|
|
23
|
-
const l = [],
|
|
24
|
-
l.forEach((
|
|
25
|
-
}, r = (
|
|
26
|
-
() => [
|
|
27
|
-
([
|
|
28
|
-
if (
|
|
26
|
+
const l = [], s = () => {
|
|
27
|
+
l.forEach((u) => u()), l.length = 0;
|
|
28
|
+
}, r = (u, p, c, m) => (u.addEventListener(p, c, m), () => u.removeEventListener(p, c, m)), i = S(
|
|
29
|
+
() => [M(e), ee(a)],
|
|
30
|
+
([u, p]) => {
|
|
31
|
+
if (s(), !u)
|
|
29
32
|
return;
|
|
30
|
-
const c =
|
|
33
|
+
const c = qe(p) ? { ...p } : p;
|
|
31
34
|
l.push(
|
|
32
|
-
...n.flatMap((
|
|
35
|
+
...n.flatMap((m) => o.map((h) => r(u, m, h, c)))
|
|
33
36
|
);
|
|
34
37
|
},
|
|
35
38
|
{ immediate: !0, flush: "post" }
|
|
36
|
-
),
|
|
37
|
-
|
|
39
|
+
), d = () => {
|
|
40
|
+
i(), s();
|
|
41
|
+
};
|
|
42
|
+
return ke(d), d;
|
|
43
|
+
}
|
|
44
|
+
function Ye() {
|
|
45
|
+
const t = x(!1), e = Pe();
|
|
46
|
+
return e && ye(() => {
|
|
47
|
+
t.value = !0;
|
|
48
|
+
}, e), t;
|
|
49
|
+
}
|
|
50
|
+
function Xe(t) {
|
|
51
|
+
const e = Ye();
|
|
52
|
+
return E(() => (e.value, !!t()));
|
|
53
|
+
}
|
|
54
|
+
function Je(t, e, n = {}) {
|
|
55
|
+
const { window: o = F, ...a } = n;
|
|
56
|
+
let l;
|
|
57
|
+
const s = Xe(() => o && "MutationObserver" in o), r = () => {
|
|
58
|
+
l && (l.disconnect(), l = void 0);
|
|
59
|
+
}, i = E(() => {
|
|
60
|
+
const c = ee(t), m = (Array.isArray(c) ? c : [c]).map(M).filter(ze);
|
|
61
|
+
return new Set(m);
|
|
62
|
+
}), d = S(
|
|
63
|
+
() => i.value,
|
|
64
|
+
(c) => {
|
|
65
|
+
r(), s.value && c.size && (l = new MutationObserver(e), c.forEach((m) => l.observe(m, a)));
|
|
66
|
+
},
|
|
67
|
+
{ immediate: !0, flush: "post" }
|
|
68
|
+
), u = () => l == null ? void 0 : l.takeRecords(), p = () => {
|
|
69
|
+
r(), d();
|
|
70
|
+
};
|
|
71
|
+
return ke(p), {
|
|
72
|
+
isSupported: s,
|
|
73
|
+
stop: p,
|
|
74
|
+
takeRecords: u
|
|
38
75
|
};
|
|
39
|
-
return We(u), u;
|
|
40
76
|
}
|
|
41
|
-
function
|
|
77
|
+
function Qe(t = {}) {
|
|
42
78
|
var e;
|
|
43
79
|
const {
|
|
44
|
-
window: n =
|
|
45
|
-
deep: o = !0
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
80
|
+
window: n = F,
|
|
81
|
+
deep: o = !0,
|
|
82
|
+
triggerOnRemoval: a = !1
|
|
83
|
+
} = t, l = (e = t.document) != null ? e : n == null ? void 0 : n.document, s = () => {
|
|
84
|
+
var d;
|
|
85
|
+
let u = l == null ? void 0 : l.activeElement;
|
|
49
86
|
if (o)
|
|
50
87
|
for (; u != null && u.shadowRoot; )
|
|
51
|
-
u = (
|
|
88
|
+
u = (d = u == null ? void 0 : u.shadowRoot) == null ? void 0 : d.activeElement;
|
|
52
89
|
return u;
|
|
53
|
-
},
|
|
54
|
-
|
|
90
|
+
}, r = x(), i = () => {
|
|
91
|
+
r.value = s();
|
|
55
92
|
};
|
|
56
|
-
return n && (
|
|
57
|
-
|
|
58
|
-
}, !0),
|
|
93
|
+
return n && (Q(n, "blur", (d) => {
|
|
94
|
+
d.relatedTarget === null && i();
|
|
95
|
+
}, !0), Q(n, "focus", i, !0)), a && Je(l, (d) => {
|
|
96
|
+
d.filter((u) => u.removedNodes.length).map((u) => Array.from(u.removedNodes)).flat().forEach((u) => {
|
|
97
|
+
u === r.value && i();
|
|
98
|
+
});
|
|
99
|
+
}, {
|
|
100
|
+
childList: !0,
|
|
101
|
+
subtree: !0
|
|
102
|
+
}), i(), r;
|
|
59
103
|
}
|
|
60
|
-
function
|
|
61
|
-
const n =
|
|
62
|
-
return { focused:
|
|
104
|
+
function Ze(t, e = {}) {
|
|
105
|
+
const n = Qe(e), o = E(() => M(t));
|
|
106
|
+
return { focused: E(() => o.value && n.value ? o.value.contains(n.value) : !1) };
|
|
63
107
|
}
|
|
64
|
-
function
|
|
108
|
+
function Ke(t, { window: e = F, scrollTarget: n } = {}) {
|
|
65
109
|
const o = x(!1), a = () => {
|
|
66
|
-
if (!e)
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
if (!i)
|
|
110
|
+
if (!e) return;
|
|
111
|
+
const l = e.document, s = M(t);
|
|
112
|
+
if (!s)
|
|
70
113
|
o.value = !1;
|
|
71
114
|
else {
|
|
72
|
-
const r =
|
|
115
|
+
const r = s.getBoundingClientRect();
|
|
73
116
|
o.value = r.top <= (e.innerHeight || l.documentElement.clientHeight) && r.left <= (e.innerWidth || l.documentElement.clientWidth) && r.bottom >= 0 && r.right >= 0;
|
|
74
117
|
}
|
|
75
118
|
};
|
|
76
|
-
return
|
|
77
|
-
() =>
|
|
119
|
+
return S(
|
|
120
|
+
() => M(t),
|
|
78
121
|
() => a(),
|
|
79
122
|
{ immediate: !0, flush: "post" }
|
|
80
|
-
), e &&
|
|
123
|
+
), e && Q(n || e, "scroll", a, {
|
|
81
124
|
capture: !1,
|
|
82
125
|
passive: !0
|
|
83
126
|
}), o;
|
|
84
127
|
}
|
|
85
|
-
const
|
|
86
|
-
let e =
|
|
128
|
+
const k = (t) => {
|
|
129
|
+
let e = Ke(t).value;
|
|
87
130
|
return e = e && t.offsetHeight > 0, e;
|
|
88
|
-
},
|
|
131
|
+
}, A = (t) => t.tabIndex >= 0, de = (t) => {
|
|
89
132
|
const e = t.target;
|
|
90
|
-
return
|
|
91
|
-
},
|
|
133
|
+
return te(e);
|
|
134
|
+
}, te = (t) => {
|
|
92
135
|
var e;
|
|
93
136
|
let n;
|
|
94
137
|
if (t instanceof HTMLTableCellElement) {
|
|
@@ -101,8 +144,8 @@ const I = (t) => {
|
|
|
101
144
|
const o = t.previousElementSibling;
|
|
102
145
|
o && (n = o);
|
|
103
146
|
}
|
|
104
|
-
return n && (!
|
|
105
|
-
},
|
|
147
|
+
return n && (!A(n) || !k(n)) ? te(n) : n;
|
|
148
|
+
}, et = (t) => {
|
|
106
149
|
var e;
|
|
107
150
|
const n = t.target;
|
|
108
151
|
let o;
|
|
@@ -119,11 +162,11 @@ const I = (t) => {
|
|
|
119
162
|
l && (o = l);
|
|
120
163
|
}
|
|
121
164
|
}
|
|
122
|
-
return o && (!
|
|
123
|
-
},
|
|
165
|
+
return o && (!A(o) || !k(o)) ? ne(o) : o;
|
|
166
|
+
}, ce = (t) => {
|
|
124
167
|
const e = t.target;
|
|
125
|
-
return
|
|
126
|
-
},
|
|
168
|
+
return ne(e);
|
|
169
|
+
}, ne = (t) => {
|
|
127
170
|
var e;
|
|
128
171
|
let n;
|
|
129
172
|
if (t instanceof HTMLTableCellElement) {
|
|
@@ -136,8 +179,8 @@ const I = (t) => {
|
|
|
136
179
|
const o = t.nextElementSibling;
|
|
137
180
|
o && (n = o);
|
|
138
181
|
}
|
|
139
|
-
return n && (!
|
|
140
|
-
},
|
|
182
|
+
return n && (!A(n) || !k(n)) ? ne(n) : n;
|
|
183
|
+
}, tt = (t) => {
|
|
141
184
|
var e;
|
|
142
185
|
const n = t.target;
|
|
143
186
|
let o;
|
|
@@ -154,11 +197,11 @@ const I = (t) => {
|
|
|
154
197
|
l && (o = l);
|
|
155
198
|
}
|
|
156
199
|
}
|
|
157
|
-
return o && (!
|
|
158
|
-
},
|
|
200
|
+
return o && (!A(o) || !k(o)) ? te(o) : o;
|
|
201
|
+
}, ue = (t) => {
|
|
159
202
|
const e = t.target;
|
|
160
|
-
return
|
|
161
|
-
},
|
|
203
|
+
return oe(e);
|
|
204
|
+
}, oe = (t) => {
|
|
162
205
|
var e;
|
|
163
206
|
let n;
|
|
164
207
|
if (t.previousElementSibling)
|
|
@@ -167,11 +210,11 @@ const I = (t) => {
|
|
|
167
210
|
const o = (e = t.parentElement) == null ? void 0 : e.previousElementSibling;
|
|
168
211
|
n = o == null ? void 0 : o.lastElementChild;
|
|
169
212
|
}
|
|
170
|
-
return n && (!
|
|
171
|
-
},
|
|
213
|
+
return n && (!A(n) || !k(n)) ? oe(n) : n;
|
|
214
|
+
}, fe = (t) => {
|
|
172
215
|
const e = t.target;
|
|
173
|
-
return
|
|
174
|
-
},
|
|
216
|
+
return le(e);
|
|
217
|
+
}, le = (t) => {
|
|
175
218
|
var e;
|
|
176
219
|
let n;
|
|
177
220
|
if (t.nextElementSibling)
|
|
@@ -180,147 +223,146 @@ const I = (t) => {
|
|
|
180
223
|
const o = (e = t.parentElement) == null ? void 0 : e.nextElementSibling;
|
|
181
224
|
n = o == null ? void 0 : o.firstElementChild;
|
|
182
225
|
}
|
|
183
|
-
return n && (!
|
|
184
|
-
},
|
|
226
|
+
return n && (!A(n) || !k(n)) ? le(n) : n;
|
|
227
|
+
}, pe = (t) => {
|
|
185
228
|
const e = t.target.parentElement.firstElementChild;
|
|
186
|
-
return e && (!
|
|
187
|
-
},
|
|
229
|
+
return e && (!A(e) || !k(e)) ? le(e) : e;
|
|
230
|
+
}, me = (t) => {
|
|
188
231
|
const e = t.target.parentElement.lastElementChild;
|
|
189
|
-
return e && (!
|
|
190
|
-
},
|
|
232
|
+
return e && (!A(e) || !k(e)) ? oe(e) : e;
|
|
233
|
+
}, H = ["alt", "control", "shift", "meta"], nt = {
|
|
191
234
|
ArrowUp: "up",
|
|
192
235
|
ArrowDown: "down",
|
|
193
236
|
ArrowLeft: "left",
|
|
194
237
|
ArrowRight: "right"
|
|
195
|
-
},
|
|
238
|
+
}, re = {
|
|
196
239
|
"keydown.up": (t) => {
|
|
197
|
-
const e =
|
|
240
|
+
const e = de(t);
|
|
198
241
|
e && (t.preventDefault(), t.stopPropagation(), e.focus());
|
|
199
242
|
},
|
|
200
243
|
"keydown.down": (t) => {
|
|
201
|
-
const e =
|
|
244
|
+
const e = ce(t);
|
|
202
245
|
e && (t.preventDefault(), t.stopPropagation(), e.focus());
|
|
203
246
|
},
|
|
204
247
|
"keydown.left": (t) => {
|
|
205
|
-
const e =
|
|
248
|
+
const e = ue(t);
|
|
206
249
|
t.preventDefault(), t.stopPropagation(), e && e.focus();
|
|
207
250
|
},
|
|
208
251
|
"keydown.right": (t) => {
|
|
209
|
-
const e =
|
|
252
|
+
const e = fe(t);
|
|
210
253
|
t.preventDefault(), t.stopPropagation(), e && e.focus();
|
|
211
254
|
},
|
|
212
255
|
"keydown.control.up": (t) => {
|
|
213
|
-
const e =
|
|
256
|
+
const e = et(t);
|
|
214
257
|
e && (t.preventDefault(), t.stopPropagation(), e.focus());
|
|
215
258
|
},
|
|
216
259
|
"keydown.control.down": (t) => {
|
|
217
|
-
const e =
|
|
260
|
+
const e = tt(t);
|
|
218
261
|
e && (t.preventDefault(), t.stopPropagation(), e.focus());
|
|
219
262
|
},
|
|
220
263
|
"keydown.control.left": (t) => {
|
|
221
|
-
const e =
|
|
264
|
+
const e = pe(t);
|
|
222
265
|
e && (t.preventDefault(), t.stopPropagation(), e.focus());
|
|
223
266
|
},
|
|
224
267
|
"keydown.control.right": (t) => {
|
|
225
|
-
const e =
|
|
268
|
+
const e = me(t);
|
|
226
269
|
e && (t.preventDefault(), t.stopPropagation(), e.focus());
|
|
227
270
|
},
|
|
228
271
|
"keydown.end": (t) => {
|
|
229
|
-
const e =
|
|
272
|
+
const e = me(t);
|
|
230
273
|
e && (t.preventDefault(), t.stopPropagation(), e.focus());
|
|
231
274
|
},
|
|
232
275
|
"keydown.enter": (t) => {
|
|
233
276
|
if (t.target instanceof HTMLTableCellElement) {
|
|
234
277
|
t.preventDefault(), t.stopPropagation();
|
|
235
|
-
const e =
|
|
278
|
+
const e = ce(t);
|
|
236
279
|
e && e.focus();
|
|
237
280
|
}
|
|
238
281
|
},
|
|
239
282
|
"keydown.shift.enter": (t) => {
|
|
240
283
|
if (t.target instanceof HTMLTableCellElement) {
|
|
241
284
|
t.preventDefault(), t.stopPropagation();
|
|
242
|
-
const e =
|
|
285
|
+
const e = de(t);
|
|
243
286
|
e && e.focus();
|
|
244
287
|
}
|
|
245
288
|
},
|
|
246
289
|
"keydown.home": (t) => {
|
|
247
|
-
const e =
|
|
290
|
+
const e = pe(t);
|
|
248
291
|
e && (t.preventDefault(), t.stopPropagation(), e.focus());
|
|
249
292
|
},
|
|
250
293
|
"keydown.tab": (t) => {
|
|
251
|
-
const e =
|
|
294
|
+
const e = fe(t);
|
|
252
295
|
e && (t.preventDefault(), t.stopPropagation(), e.focus());
|
|
253
296
|
},
|
|
254
297
|
"keydown.shift.tab": (t) => {
|
|
255
|
-
const e =
|
|
298
|
+
const e = ue(t);
|
|
256
299
|
e && (t.preventDefault(), t.stopPropagation(), e.focus());
|
|
257
300
|
}
|
|
258
301
|
};
|
|
259
|
-
function
|
|
260
|
-
const e = (
|
|
302
|
+
function ae(t) {
|
|
303
|
+
const e = (s) => {
|
|
261
304
|
let r = null;
|
|
262
|
-
return
|
|
263
|
-
}, n = (
|
|
264
|
-
const r = e(
|
|
265
|
-
let
|
|
266
|
-
if (typeof
|
|
267
|
-
|
|
268
|
-
else if (Array.isArray(
|
|
269
|
-
for (const
|
|
270
|
-
|
|
271
|
-
else if (
|
|
272
|
-
|
|
273
|
-
else if (Array.isArray(
|
|
274
|
-
for (const
|
|
275
|
-
|
|
305
|
+
return s.parent && (typeof s.parent == "string" ? r = document.querySelector(s.parent) : s.parent instanceof HTMLElement ? r = s.parent : r = s.parent.value), r;
|
|
306
|
+
}, n = (s) => {
|
|
307
|
+
const r = e(s);
|
|
308
|
+
let i = [];
|
|
309
|
+
if (typeof s.selectors == "string")
|
|
310
|
+
i = r ? Array.from(r.querySelectorAll(s.selectors)) : Array.from(document.querySelectorAll(s.selectors));
|
|
311
|
+
else if (Array.isArray(s.selectors))
|
|
312
|
+
for (const d of s.selectors)
|
|
313
|
+
d instanceof HTMLElement ? i.push(d) : i.push(d.$el);
|
|
314
|
+
else if (s.selectors instanceof HTMLElement)
|
|
315
|
+
i.push(s.selectors);
|
|
316
|
+
else if (Array.isArray(s.selectors.value))
|
|
317
|
+
for (const d of s.selectors.value)
|
|
318
|
+
d instanceof HTMLElement ? i.push(d) : i.push(d.$el);
|
|
276
319
|
else
|
|
277
|
-
|
|
278
|
-
return
|
|
279
|
-
}, o = (
|
|
280
|
-
const r = e(
|
|
281
|
-
let
|
|
282
|
-
return
|
|
283
|
-
}, a = (
|
|
284
|
-
const
|
|
285
|
-
if (
|
|
286
|
-
|
|
287
|
-
const u
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
const P = w.charAt(0).toUpperCase() + w.slice(1);
|
|
320
|
+
i.push(s.selectors.value);
|
|
321
|
+
return i;
|
|
322
|
+
}, o = (s) => {
|
|
323
|
+
const r = e(s);
|
|
324
|
+
let i = [];
|
|
325
|
+
return s.selectors ? i = n(s) : r && (i = Array.from(r.children).filter((d) => A(d) && k(d))), i;
|
|
326
|
+
}, a = (s) => (r) => {
|
|
327
|
+
const i = nt[r.key] || r.key.toLowerCase();
|
|
328
|
+
if (H.includes(i)) return;
|
|
329
|
+
const d = s.handlers || re;
|
|
330
|
+
for (const u of Object.keys(d)) {
|
|
331
|
+
const [p, ...c] = u.split(".");
|
|
332
|
+
if (p === "keydown" && c.includes(i)) {
|
|
333
|
+
const m = d[u], h = c.filter((g) => H.includes(g)), v = H.some((g) => {
|
|
334
|
+
const P = g.charAt(0).toUpperCase() + g.slice(1);
|
|
293
335
|
return r.getModifierState(P);
|
|
294
336
|
});
|
|
295
|
-
if (
|
|
296
|
-
if (
|
|
297
|
-
for (const
|
|
298
|
-
if (c.includes(
|
|
299
|
-
const P =
|
|
300
|
-
r.getModifierState(P) &&
|
|
337
|
+
if (h.length > 0) {
|
|
338
|
+
if (v) {
|
|
339
|
+
for (const g of H)
|
|
340
|
+
if (c.includes(g)) {
|
|
341
|
+
const P = g.charAt(0).toUpperCase() + g.slice(1);
|
|
342
|
+
r.getModifierState(P) && m(r);
|
|
301
343
|
}
|
|
302
344
|
}
|
|
303
345
|
} else
|
|
304
|
-
|
|
346
|
+
v || m(r);
|
|
305
347
|
}
|
|
306
348
|
}
|
|
307
349
|
}, l = [];
|
|
308
|
-
|
|
309
|
-
for (const
|
|
310
|
-
const r = e(
|
|
311
|
-
for (const
|
|
312
|
-
const { focused: c } =
|
|
313
|
-
|
|
350
|
+
ye(() => {
|
|
351
|
+
for (const s of t) {
|
|
352
|
+
const r = e(s), i = o(s), d = a(s), u = r ? [r] : i;
|
|
353
|
+
for (const p of u) {
|
|
354
|
+
const { focused: c } = Ze(x(p)), m = S(c, (h) => {
|
|
355
|
+
h ? p.addEventListener("keydown", d) : p.removeEventListener("keydown", d);
|
|
314
356
|
});
|
|
315
|
-
l.push(
|
|
357
|
+
l.push(m);
|
|
316
358
|
}
|
|
317
359
|
}
|
|
318
|
-
}),
|
|
319
|
-
for (const
|
|
320
|
-
|
|
360
|
+
}), Me(() => {
|
|
361
|
+
for (const s of l)
|
|
362
|
+
s();
|
|
321
363
|
});
|
|
322
364
|
}
|
|
323
|
-
const
|
|
365
|
+
const ot = ["data-colindex", "data-rowindex", "data-editable", "contenteditable", "tabindex"], lt = { key: 1 }, Ae = /* @__PURE__ */ _({
|
|
324
366
|
__name: "ACell",
|
|
325
367
|
props: {
|
|
326
368
|
colIndex: {},
|
|
@@ -330,75 +372,75 @@ const Xe = ["data-colindex", "data-rowindex", "data-editable", "contenteditable"
|
|
|
330
372
|
tabIndex: { default: 0 }
|
|
331
373
|
},
|
|
332
374
|
setup(t) {
|
|
333
|
-
var
|
|
334
|
-
const e = t, n =
|
|
335
|
-
const
|
|
375
|
+
var h;
|
|
376
|
+
const e = t, n = z(e.tableid), o = x(null), a = x(""), l = x(!1), s = E(() => {
|
|
377
|
+
const v = n.cellData(e.colIndex, e.rowIndex);
|
|
336
378
|
if (n.columns[e.colIndex].format) {
|
|
337
|
-
const
|
|
338
|
-
return typeof
|
|
379
|
+
const g = n.columns[e.colIndex].format;
|
|
380
|
+
return typeof g == "function" ? g(v) : typeof g == "string" ? Function(`"use strict";return (${g})`)()(v) : v;
|
|
339
381
|
} else
|
|
340
|
-
return
|
|
341
|
-
}), r = (
|
|
382
|
+
return v;
|
|
383
|
+
}), r = () => {
|
|
342
384
|
if (n.columns[e.colIndex].mask, n.columns[e.colIndex].modalComponent) {
|
|
343
|
-
const
|
|
344
|
-
n.modal.visible = !0, n.modal.colIndex = e.colIndex, n.modal.rowIndex = e.rowIndex, n.modal.parent = o.value, n.modal.top =
|
|
385
|
+
const v = o.value.getBoundingClientRect();
|
|
386
|
+
n.modal.visible = !0, n.modal.colIndex = e.colIndex, n.modal.rowIndex = e.rowIndex, n.modal.parent = o.value, n.modal.top = v.top + v.height, n.modal.left = v.left, n.modal.width = d.value, n.modal.component = n.columns[e.colIndex].modalComponent, n.modal.componentProps = n.columns[e.colIndex].modalComponentProps;
|
|
345
387
|
}
|
|
346
388
|
};
|
|
347
389
|
if (e.addNavigation) {
|
|
348
|
-
let
|
|
349
|
-
...
|
|
390
|
+
let v = {
|
|
391
|
+
...re,
|
|
350
392
|
"keydown.f2": r,
|
|
351
393
|
"keydown.alt.up": r,
|
|
352
394
|
"keydown.alt.down": r,
|
|
353
395
|
"keydown.alt.left": r,
|
|
354
396
|
"keydown.alt.right": r
|
|
355
397
|
};
|
|
356
|
-
typeof e.addNavigation == "object" && (
|
|
357
|
-
...
|
|
398
|
+
typeof e.addNavigation == "object" && (v = {
|
|
399
|
+
...v,
|
|
358
400
|
...e.addNavigation
|
|
359
|
-
}),
|
|
401
|
+
}), ae([
|
|
360
402
|
{
|
|
361
403
|
selectors: o,
|
|
362
|
-
handlers:
|
|
404
|
+
handlers: v
|
|
363
405
|
}
|
|
364
406
|
]);
|
|
365
407
|
}
|
|
366
|
-
const
|
|
408
|
+
const i = E(() => n.columns[e.colIndex].align || "center"), d = E(() => n.columns[e.colIndex].width || "40ch"), u = () => {
|
|
367
409
|
o.value && (a.value = o.value.textContent);
|
|
368
|
-
},
|
|
410
|
+
}, p = () => {
|
|
369
411
|
o.value && o.value.textContent !== a.value && (a.value = o.value.textContent, o.value.dispatchEvent(new Event("change")), l.value = !0, n.columns[e.colIndex].format || n.setCellData(e.rowIndex, e.colIndex, a.value));
|
|
370
|
-
}, c = (
|
|
371
|
-
textAlign:
|
|
372
|
-
width:
|
|
412
|
+
}, c = (v, g) => g && v === 0 && g > 0 ? `${g}ch` : "inherit", m = {
|
|
413
|
+
textAlign: i.value,
|
|
414
|
+
width: d.value,
|
|
373
415
|
backgroundColor: l.value ? "var(--cell-modified-color)" : "inherit",
|
|
374
416
|
fontWeight: l.value ? "bold" : "inherit",
|
|
375
|
-
paddingLeft: c(e.colIndex, (
|
|
417
|
+
paddingLeft: c(e.colIndex, (h = n.display[e.rowIndex]) == null ? void 0 : h.indent)
|
|
376
418
|
};
|
|
377
|
-
return (
|
|
419
|
+
return (v, g) => (w(), b("td", {
|
|
378
420
|
ref_key: "cell",
|
|
379
421
|
ref: o,
|
|
380
|
-
"data-colindex":
|
|
381
|
-
"data-rowindex":
|
|
382
|
-
"data-editable":
|
|
383
|
-
contenteditable:
|
|
384
|
-
tabindex:
|
|
422
|
+
"data-colindex": v.colIndex,
|
|
423
|
+
"data-rowindex": v.rowIndex,
|
|
424
|
+
"data-editable": f(n).columns[v.colIndex].edit,
|
|
425
|
+
contenteditable: f(n).columns[v.colIndex].edit,
|
|
426
|
+
tabindex: v.tabIndex,
|
|
385
427
|
spellcheck: !1,
|
|
386
|
-
style:
|
|
387
|
-
onFocus:
|
|
388
|
-
onPaste:
|
|
389
|
-
onBlur:
|
|
390
|
-
onInput:
|
|
428
|
+
style: m,
|
|
429
|
+
onFocus: u,
|
|
430
|
+
onPaste: p,
|
|
431
|
+
onBlur: p,
|
|
432
|
+
onInput: p,
|
|
391
433
|
onClick: r,
|
|
392
434
|
onMousedown: r,
|
|
393
435
|
class: "atable__cell"
|
|
394
436
|
}, [
|
|
395
|
-
|
|
437
|
+
f(n).columns[v.colIndex].cellComponent ? (w(), W(Ee(f(n).columns[v.colIndex].cellComponent), K({
|
|
396
438
|
key: 0,
|
|
397
|
-
value:
|
|
398
|
-
},
|
|
399
|
-
], 40,
|
|
439
|
+
value: s.value
|
|
440
|
+
}, f(n).columns[v.colIndex].cellComponentProps), null, 16, ["value"])) : (w(), b("span", lt, L(s.value), 1))
|
|
441
|
+
], 40, ot));
|
|
400
442
|
}
|
|
401
|
-
}),
|
|
443
|
+
}), rt = ["tabindex"], at = ["tabindex"], st = ["colspan"], it = /* @__PURE__ */ _({
|
|
402
444
|
__name: "AExpansionRow",
|
|
403
445
|
props: {
|
|
404
446
|
row: {},
|
|
@@ -408,56 +450,56 @@ const Xe = ["data-colindex", "data-rowindex", "data-editable", "contenteditable"
|
|
|
408
450
|
addNavigation: { type: [Boolean, Object] }
|
|
409
451
|
},
|
|
410
452
|
setup(t) {
|
|
411
|
-
const e = t, n =
|
|
453
|
+
const e = t, n = z(e.tableid), o = x(null), a = x(null), l = E(() => n.display[e.rowIndex].expanded ? "▼" : "►");
|
|
412
454
|
if (e.addNavigation) {
|
|
413
|
-
const
|
|
455
|
+
const s = {
|
|
414
456
|
"keydown.control.g": (r) => {
|
|
415
457
|
r.stopPropagation(), r.preventDefault(), n.toggleRowExpand(e.rowIndex);
|
|
416
458
|
}
|
|
417
459
|
};
|
|
418
|
-
typeof e.addNavigation == "object" && Object.assign(
|
|
460
|
+
typeof e.addNavigation == "object" && Object.assign(s, e.addNavigation), ae([
|
|
419
461
|
{
|
|
420
462
|
selectors: o,
|
|
421
|
-
handlers:
|
|
463
|
+
handlers: s
|
|
422
464
|
}
|
|
423
465
|
]);
|
|
424
466
|
}
|
|
425
|
-
return (
|
|
426
|
-
|
|
467
|
+
return (s, r) => (w(), b(V, null, [
|
|
468
|
+
$("tr", K(s.$attrs, {
|
|
427
469
|
ref_key: "rowEl",
|
|
428
470
|
ref: o,
|
|
429
|
-
tabindex:
|
|
471
|
+
tabindex: s.tabIndex,
|
|
430
472
|
class: "expandable-row"
|
|
431
473
|
}), [
|
|
432
|
-
|
|
474
|
+
$("td", {
|
|
433
475
|
tabIndex: -1,
|
|
434
|
-
onClick: r[0] || (r[0] = (
|
|
476
|
+
onClick: r[0] || (r[0] = (i) => f(n).toggleRowExpand(s.rowIndex)),
|
|
435
477
|
class: "row-index"
|
|
436
|
-
},
|
|
437
|
-
|
|
438
|
-
], 16,
|
|
439
|
-
|
|
478
|
+
}, L(l.value), 1),
|
|
479
|
+
I(s.$slots, "row")
|
|
480
|
+
], 16, rt),
|
|
481
|
+
f(n).display[e.rowIndex].expanded ? (w(), b("tr", {
|
|
440
482
|
key: 0,
|
|
441
483
|
ref_key: "rowExpanded",
|
|
442
484
|
ref: a,
|
|
443
|
-
tabindex:
|
|
485
|
+
tabindex: s.tabIndex,
|
|
444
486
|
class: "expanded-row"
|
|
445
487
|
}, [
|
|
446
|
-
|
|
488
|
+
$("td", {
|
|
447
489
|
tabIndex: -1,
|
|
448
|
-
colspan:
|
|
490
|
+
colspan: f(n).columns.length + 1,
|
|
449
491
|
class: "expanded-row-content"
|
|
450
492
|
}, [
|
|
451
|
-
|
|
452
|
-
], 8,
|
|
453
|
-
], 8,
|
|
493
|
+
I(s.$slots, "content")
|
|
494
|
+
], 8, st)
|
|
495
|
+
], 8, at)) : B("", !0)
|
|
454
496
|
], 64));
|
|
455
497
|
}
|
|
456
|
-
}),
|
|
498
|
+
}), dt = ["tabindex"], ct = {
|
|
457
499
|
key: 0,
|
|
458
500
|
tabIndex: -1,
|
|
459
501
|
class: "list-index"
|
|
460
|
-
},
|
|
502
|
+
}, Ce = /* @__PURE__ */ _({
|
|
461
503
|
__name: "ARow",
|
|
462
504
|
props: {
|
|
463
505
|
row: {},
|
|
@@ -467,145 +509,114 @@ const Xe = ["data-colindex", "data-rowindex", "data-editable", "contenteditable"
|
|
|
467
509
|
addNavigation: { type: [Boolean, Object], default: !1 }
|
|
468
510
|
},
|
|
469
511
|
setup(t) {
|
|
470
|
-
const e = t, n =
|
|
471
|
-
n.numberedRowWidth.value;
|
|
472
|
-
const a = () => n.config.view !== "tree" ? "" : n.display[e.rowIndex].isRoot || n.display[e.rowIndex].isParent ? n.display[e.rowIndex].childrenOpen ? "-" : "+" : "", l = C(() => n.config.view !== "tree" || n.display[e.rowIndex].isRoot || n.display[e.rowIndex].open), i = (r) => {
|
|
512
|
+
const e = t, n = z(e.tableid), o = x(null), a = E(() => n.config.view !== "tree" || n.display[e.rowIndex].isRoot || n.display[e.rowIndex].open), l = E(() => n.config.view !== "tree" ? "" : n.display[e.rowIndex].isRoot || n.display[e.rowIndex].isParent ? n.display[e.rowIndex].childrenOpen ? "-" : "+" : ""), s = (r) => {
|
|
473
513
|
n.toggleRowExpand(r);
|
|
474
514
|
};
|
|
475
515
|
if (e.addNavigation) {
|
|
476
|
-
let r =
|
|
516
|
+
let r = re;
|
|
477
517
|
typeof e.addNavigation == "object" && (r = {
|
|
478
518
|
...r,
|
|
479
519
|
...e.addNavigation
|
|
480
|
-
}),
|
|
520
|
+
}), ae([
|
|
481
521
|
{
|
|
482
522
|
selectors: o,
|
|
483
523
|
handlers: r
|
|
484
524
|
}
|
|
485
525
|
]);
|
|
486
526
|
}
|
|
487
|
-
return (r,
|
|
527
|
+
return (r, i) => X((w(), b("tr", {
|
|
488
528
|
ref_key: "rowEl",
|
|
489
529
|
ref: o,
|
|
490
530
|
tabindex: r.tabIndex,
|
|
491
531
|
class: "table-row"
|
|
492
532
|
}, [
|
|
493
|
-
|
|
494
|
-
|
|
533
|
+
I(r.$slots, "index", {}, () => [
|
|
534
|
+
f(n).config.view === "list" ? (w(), b("td", ct, L(r.rowIndex + 1), 1)) : f(n).config.view === "tree" ? (w(), b("td", {
|
|
495
535
|
key: 1,
|
|
496
536
|
tabIndex: -1,
|
|
497
537
|
class: "tree-index",
|
|
498
|
-
onClick:
|
|
499
|
-
},
|
|
538
|
+
onClick: i[0] || (i[0] = (d) => s(r.rowIndex))
|
|
539
|
+
}, L(l.value), 1)) : B("", !0)
|
|
500
540
|
]),
|
|
501
|
-
|
|
502
|
-
], 8,
|
|
503
|
-
[
|
|
541
|
+
I(r.$slots, "default")
|
|
542
|
+
], 8, dt)), [
|
|
543
|
+
[Ie, a.value]
|
|
504
544
|
]);
|
|
505
545
|
}
|
|
506
546
|
});
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
function lt() {
|
|
510
|
-
if (!H && (H = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !H))
|
|
511
|
-
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
512
|
-
return H(ot);
|
|
513
|
-
}
|
|
514
|
-
const y = [];
|
|
515
|
-
for (let t = 0; t < 256; ++t)
|
|
516
|
-
y.push((t + 256).toString(16).slice(1));
|
|
517
|
-
function rt(t, e = 0) {
|
|
518
|
-
return y[t[e + 0]] + y[t[e + 1]] + y[t[e + 2]] + y[t[e + 3]] + "-" + y[t[e + 4]] + y[t[e + 5]] + "-" + y[t[e + 6]] + y[t[e + 7]] + "-" + y[t[e + 8]] + y[t[e + 9]] + "-" + y[t[e + 10]] + y[t[e + 11]] + y[t[e + 12]] + y[t[e + 13]] + y[t[e + 14]] + y[t[e + 15]];
|
|
519
|
-
}
|
|
520
|
-
const at = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), fe = {
|
|
521
|
-
randomUUID: at
|
|
522
|
-
};
|
|
523
|
-
function Ie(t, e, n) {
|
|
524
|
-
if (fe.randomUUID && !e && !t)
|
|
525
|
-
return fe.randomUUID();
|
|
526
|
-
t = t || {};
|
|
527
|
-
const o = t.random || (t.rng || lt)();
|
|
528
|
-
if (o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, e) {
|
|
529
|
-
n = n || 0;
|
|
530
|
-
for (let a = 0; a < 16; ++a)
|
|
531
|
-
e[n + a] = o[a];
|
|
532
|
-
return e;
|
|
533
|
-
}
|
|
534
|
-
return rt(o);
|
|
535
|
-
}
|
|
536
|
-
function ke(t) {
|
|
537
|
-
return we() ? (ve(t), !0) : !1;
|
|
547
|
+
function Se(t) {
|
|
548
|
+
return be() ? (xe(t), !0) : !1;
|
|
538
549
|
}
|
|
539
|
-
function
|
|
540
|
-
return typeof t == "function" ? t() :
|
|
550
|
+
function O(t) {
|
|
551
|
+
return typeof t == "function" ? t() : f(t);
|
|
541
552
|
}
|
|
542
|
-
const
|
|
553
|
+
const _e = typeof window < "u" && typeof document < "u";
|
|
543
554
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
544
|
-
const
|
|
545
|
-
},
|
|
546
|
-
function
|
|
555
|
+
const ut = Object.prototype.toString, ft = (t) => ut.call(t) === "[object Object]", R = () => {
|
|
556
|
+
}, Z = /* @__PURE__ */ pt();
|
|
557
|
+
function pt() {
|
|
547
558
|
var t, e;
|
|
548
|
-
return
|
|
559
|
+
return _e && ((t = window == null ? void 0 : window.navigator) == null ? void 0 : t.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((e = window == null ? void 0 : window.navigator) == null ? void 0 : e.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent));
|
|
549
560
|
}
|
|
550
|
-
const
|
|
561
|
+
const ve = {
|
|
551
562
|
mounted: "mounted",
|
|
552
563
|
updated: "updated",
|
|
553
564
|
unmounted: "unmounted"
|
|
554
565
|
};
|
|
555
|
-
function
|
|
566
|
+
function mt(...t) {
|
|
556
567
|
if (t.length !== 1)
|
|
557
|
-
return
|
|
568
|
+
return He(...t);
|
|
558
569
|
const e = t[0];
|
|
559
|
-
return typeof e == "function" ?
|
|
570
|
+
return typeof e == "function" ? je(We(() => ({ get: e, set: R }))) : x(e);
|
|
560
571
|
}
|
|
561
|
-
function
|
|
572
|
+
function T(t) {
|
|
562
573
|
var e;
|
|
563
|
-
const n =
|
|
574
|
+
const n = O(t);
|
|
564
575
|
return (e = n == null ? void 0 : n.$el) != null ? e : n;
|
|
565
576
|
}
|
|
566
|
-
const
|
|
577
|
+
const De = _e ? window : void 0;
|
|
567
578
|
function U(...t) {
|
|
568
579
|
let e, n, o, a;
|
|
569
|
-
if (typeof t[0] == "string" || Array.isArray(t[0]) ? ([n, o, a] = t, e =
|
|
580
|
+
if (typeof t[0] == "string" || Array.isArray(t[0]) ? ([n, o, a] = t, e = De) : [e, n, o, a] = t, !e)
|
|
570
581
|
return R;
|
|
571
582
|
Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
|
|
572
|
-
const l = [],
|
|
573
|
-
l.forEach((
|
|
574
|
-
}, r = (
|
|
575
|
-
() => [
|
|
576
|
-
([
|
|
577
|
-
if (
|
|
583
|
+
const l = [], s = () => {
|
|
584
|
+
l.forEach((u) => u()), l.length = 0;
|
|
585
|
+
}, r = (u, p, c, m) => (u.addEventListener(p, c, m), () => u.removeEventListener(p, c, m)), i = S(
|
|
586
|
+
() => [T(e), O(a)],
|
|
587
|
+
([u, p]) => {
|
|
588
|
+
if (s(), !u)
|
|
578
589
|
return;
|
|
579
|
-
const c =
|
|
590
|
+
const c = ft(p) ? { ...p } : p;
|
|
580
591
|
l.push(
|
|
581
|
-
...n.flatMap((
|
|
592
|
+
...n.flatMap((m) => o.map((h) => r(u, m, h, c)))
|
|
582
593
|
);
|
|
583
594
|
},
|
|
584
595
|
{ immediate: !0, flush: "post" }
|
|
585
|
-
),
|
|
586
|
-
|
|
596
|
+
), d = () => {
|
|
597
|
+
i(), s();
|
|
587
598
|
};
|
|
588
|
-
return
|
|
599
|
+
return Se(d), d;
|
|
589
600
|
}
|
|
590
|
-
let
|
|
591
|
-
function
|
|
592
|
-
const { window: o =
|
|
601
|
+
let he = !1;
|
|
602
|
+
function we(t, e, n = {}) {
|
|
603
|
+
const { window: o = De, ignore: a = [], capture: l = !0, detectIframe: s = !1 } = n;
|
|
593
604
|
if (!o)
|
|
594
605
|
return R;
|
|
595
|
-
|
|
606
|
+
Z && !he && (he = !0, Array.from(o.document.body.children).forEach((c) => c.addEventListener("click", R)), o.document.documentElement.addEventListener("click", R));
|
|
596
607
|
let r = !0;
|
|
597
|
-
const
|
|
598
|
-
if (typeof
|
|
599
|
-
return Array.from(o.document.querySelectorAll(
|
|
608
|
+
const i = (c) => a.some((m) => {
|
|
609
|
+
if (typeof m == "string")
|
|
610
|
+
return Array.from(o.document.querySelectorAll(m)).some((h) => h === c.target || c.composedPath().includes(h));
|
|
600
611
|
{
|
|
601
|
-
const
|
|
602
|
-
return
|
|
612
|
+
const h = T(m);
|
|
613
|
+
return h && (c.target === h || c.composedPath().includes(h));
|
|
603
614
|
}
|
|
604
|
-
}),
|
|
615
|
+
}), u = [
|
|
605
616
|
U(o, "click", (c) => {
|
|
606
|
-
const
|
|
607
|
-
if (!(!
|
|
608
|
-
if (c.detail === 0 && (r = !
|
|
617
|
+
const m = T(t);
|
|
618
|
+
if (!(!m || m === c.target || c.composedPath().includes(m))) {
|
|
619
|
+
if (c.detail === 0 && (r = !i(c)), !r) {
|
|
609
620
|
r = !0;
|
|
610
621
|
return;
|
|
611
622
|
}
|
|
@@ -613,101 +624,139 @@ function he(t, e, n = {}) {
|
|
|
613
624
|
}
|
|
614
625
|
}, { passive: !0, capture: l }),
|
|
615
626
|
U(o, "pointerdown", (c) => {
|
|
616
|
-
const
|
|
617
|
-
r = !
|
|
627
|
+
const m = T(t);
|
|
628
|
+
r = !i(c) && !!(m && !c.composedPath().includes(m));
|
|
618
629
|
}, { passive: !0 }),
|
|
619
|
-
|
|
630
|
+
s && U(o, "blur", (c) => {
|
|
620
631
|
setTimeout(() => {
|
|
621
|
-
var
|
|
622
|
-
const
|
|
623
|
-
((
|
|
632
|
+
var m;
|
|
633
|
+
const h = T(t);
|
|
634
|
+
((m = o.document.activeElement) == null ? void 0 : m.tagName) === "IFRAME" && !(h != null && h.contains(o.document.activeElement)) && e(c);
|
|
624
635
|
}, 0);
|
|
625
636
|
})
|
|
626
637
|
].filter(Boolean);
|
|
627
|
-
return () =>
|
|
638
|
+
return () => u.forEach((c) => c());
|
|
628
639
|
}
|
|
629
|
-
const
|
|
630
|
-
[
|
|
640
|
+
const vt = {
|
|
641
|
+
[ve.mounted](t, e) {
|
|
631
642
|
const n = !e.modifiers.bubble;
|
|
632
643
|
if (typeof e.value == "function")
|
|
633
|
-
t.__onClickOutside_stop =
|
|
644
|
+
t.__onClickOutside_stop = we(t, e.value, { capture: n });
|
|
634
645
|
else {
|
|
635
646
|
const [o, a] = e.value;
|
|
636
|
-
t.__onClickOutside_stop =
|
|
647
|
+
t.__onClickOutside_stop = we(t, o, Object.assign({ capture: n }, a));
|
|
637
648
|
}
|
|
638
649
|
},
|
|
639
|
-
[
|
|
650
|
+
[ve.unmounted](t) {
|
|
640
651
|
t.__onClickOutside_stop();
|
|
641
652
|
}
|
|
642
653
|
};
|
|
643
|
-
function
|
|
654
|
+
function q(t) {
|
|
644
655
|
return typeof Window < "u" && t instanceof Window ? t.document.documentElement : typeof Document < "u" && t instanceof Document ? t.documentElement : t;
|
|
645
656
|
}
|
|
646
|
-
function
|
|
657
|
+
function Te(t) {
|
|
647
658
|
const e = window.getComputedStyle(t);
|
|
648
659
|
if (e.overflowX === "scroll" || e.overflowY === "scroll" || e.overflowX === "auto" && t.clientWidth < t.scrollWidth || e.overflowY === "auto" && t.clientHeight < t.scrollHeight)
|
|
649
660
|
return !0;
|
|
650
661
|
{
|
|
651
662
|
const n = t.parentNode;
|
|
652
|
-
return !n || n.tagName === "BODY" ? !1 :
|
|
663
|
+
return !n || n.tagName === "BODY" ? !1 : Te(n);
|
|
653
664
|
}
|
|
654
665
|
}
|
|
655
|
-
function
|
|
666
|
+
function ht(t) {
|
|
656
667
|
const e = t || window.event, n = e.target;
|
|
657
|
-
return
|
|
668
|
+
return Te(n) ? !1 : e.touches.length > 1 ? !0 : (e.preventDefault && e.preventDefault(), !1);
|
|
658
669
|
}
|
|
659
|
-
const
|
|
660
|
-
function
|
|
670
|
+
const G = /* @__PURE__ */ new WeakMap();
|
|
671
|
+
function wt(t, e = !1) {
|
|
661
672
|
const n = x(e);
|
|
662
|
-
let o = null;
|
|
663
|
-
|
|
664
|
-
const
|
|
665
|
-
if (
|
|
666
|
-
const
|
|
667
|
-
|
|
673
|
+
let o = null, a = "";
|
|
674
|
+
S(mt(t), (r) => {
|
|
675
|
+
const i = q(O(r));
|
|
676
|
+
if (i) {
|
|
677
|
+
const d = i;
|
|
678
|
+
if (G.get(d) || G.set(d, d.style.overflow), d.style.overflow !== "hidden" && (a = d.style.overflow), d.style.overflow === "hidden")
|
|
679
|
+
return n.value = !0;
|
|
680
|
+
if (n.value)
|
|
681
|
+
return d.style.overflow = "hidden";
|
|
668
682
|
}
|
|
669
683
|
}, {
|
|
670
684
|
immediate: !0
|
|
671
685
|
});
|
|
672
|
-
const
|
|
673
|
-
const
|
|
674
|
-
!
|
|
675
|
-
|
|
686
|
+
const l = () => {
|
|
687
|
+
const r = q(O(t));
|
|
688
|
+
!r || n.value || (Z && (o = U(
|
|
689
|
+
r,
|
|
676
690
|
"touchmove",
|
|
677
|
-
(
|
|
678
|
-
|
|
691
|
+
(i) => {
|
|
692
|
+
ht(i);
|
|
679
693
|
},
|
|
680
694
|
{ passive: !1 }
|
|
681
|
-
)),
|
|
682
|
-
},
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
!r || !n.value || (X && (o == null || o()), r.style.overflow = (i = W.get(r)) != null ? i : "", W.delete(r), n.value = !1);
|
|
695
|
+
)), r.style.overflow = "hidden", n.value = !0);
|
|
696
|
+
}, s = () => {
|
|
697
|
+
const r = q(O(t));
|
|
698
|
+
!r || !n.value || (Z && (o == null || o()), r.style.overflow = a, G.delete(r), n.value = !1);
|
|
686
699
|
};
|
|
687
|
-
return
|
|
700
|
+
return Se(s), E({
|
|
688
701
|
get() {
|
|
689
702
|
return n.value;
|
|
690
703
|
},
|
|
691
|
-
set(
|
|
692
|
-
|
|
704
|
+
set(r) {
|
|
705
|
+
r ? l() : s();
|
|
693
706
|
}
|
|
694
707
|
});
|
|
695
708
|
}
|
|
696
|
-
function
|
|
709
|
+
function gt() {
|
|
697
710
|
let t = !1;
|
|
698
711
|
const e = x(!1);
|
|
699
712
|
return (n, o) => {
|
|
700
713
|
if (e.value = o.value, t)
|
|
701
714
|
return;
|
|
702
715
|
t = !0;
|
|
703
|
-
const a =
|
|
704
|
-
|
|
716
|
+
const a = wt(n, o.value);
|
|
717
|
+
S(e, (l) => a.value = l);
|
|
705
718
|
};
|
|
706
719
|
}
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
720
|
+
gt();
|
|
721
|
+
var y = [];
|
|
722
|
+
for (var Y = 0; Y < 256; ++Y)
|
|
723
|
+
y.push((Y + 256).toString(16).slice(1));
|
|
724
|
+
function yt(t, e = 0) {
|
|
725
|
+
return (y[t[e + 0]] + y[t[e + 1]] + y[t[e + 2]] + y[t[e + 3]] + "-" + y[t[e + 4]] + y[t[e + 5]] + "-" + y[t[e + 6]] + y[t[e + 7]] + "-" + y[t[e + 8]] + y[t[e + 9]] + "-" + y[t[e + 10]] + y[t[e + 11]] + y[t[e + 12]] + y[t[e + 13]] + y[t[e + 14]] + y[t[e + 15]]).toLowerCase();
|
|
726
|
+
}
|
|
727
|
+
var j, bt = new Uint8Array(16);
|
|
728
|
+
function xt() {
|
|
729
|
+
if (!j && (j = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !j))
|
|
730
|
+
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
731
|
+
return j(bt);
|
|
732
|
+
}
|
|
733
|
+
var Et = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
734
|
+
const ge = {
|
|
735
|
+
randomUUID: Et
|
|
736
|
+
};
|
|
737
|
+
function It(t, e, n) {
|
|
738
|
+
if (ge.randomUUID && !e && !t)
|
|
739
|
+
return ge.randomUUID();
|
|
740
|
+
t = t || {};
|
|
741
|
+
var o = t.random || (t.rng || xt)();
|
|
742
|
+
if (o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, e) {
|
|
743
|
+
n = n || 0;
|
|
744
|
+
for (var a = 0; a < 16; ++a)
|
|
745
|
+
e[n + a] = o[a];
|
|
746
|
+
return e;
|
|
747
|
+
}
|
|
748
|
+
return yt(o);
|
|
749
|
+
}
|
|
750
|
+
class kt {
|
|
751
|
+
constructor(e, n, o, a, l, s) {
|
|
752
|
+
C(this, "id");
|
|
753
|
+
C(this, "rows");
|
|
754
|
+
C(this, "columns");
|
|
755
|
+
C(this, "config");
|
|
756
|
+
C(this, "table");
|
|
757
|
+
C(this, "display");
|
|
758
|
+
C(this, "modal");
|
|
759
|
+
this.id = e || It(), this.rows = o, this.columns = D(n), this.config = D(a), this.table = l || D(this.createTableObject()), this.display = this.createDisplayObject(s), this.modal = D({ visible: !1 });
|
|
711
760
|
}
|
|
712
761
|
createTableObject() {
|
|
713
762
|
const e = {};
|
|
@@ -734,13 +783,13 @@ class ht {
|
|
|
734
783
|
parent: l.parent
|
|
735
784
|
};
|
|
736
785
|
}
|
|
737
|
-
return
|
|
786
|
+
return D(n);
|
|
738
787
|
}
|
|
739
788
|
get zeroColumn() {
|
|
740
789
|
return ["list", "tree", "list-expansion"].includes(this.config.view);
|
|
741
790
|
}
|
|
742
791
|
get numberedRowWidth() {
|
|
743
|
-
return
|
|
792
|
+
return E(() => String(Math.ceil(this.rows.length / 100) + 1) + "ch");
|
|
744
793
|
}
|
|
745
794
|
cellData(e, n) {
|
|
746
795
|
return this.table[`${e}:${n}`];
|
|
@@ -755,20 +804,19 @@ class ht {
|
|
|
755
804
|
this.display[e].childrenOpen = !this.display[e].childrenOpen;
|
|
756
805
|
for (let n = this.rows.length - 1; n >= 0; n--)
|
|
757
806
|
this.display[n].parent === e && (this.display[n].open = !this.display[n].open, this.display[n].childrenOpen && this.toggleRowExpand(n));
|
|
758
|
-
} else
|
|
759
|
-
this.config.view === "list-expansion" && (this.display[e].expanded = !this.display[e].expanded);
|
|
807
|
+
} else this.config.view === "list-expansion" && (this.display[e].expanded = !this.display[e].expanded);
|
|
760
808
|
}
|
|
761
809
|
}
|
|
762
|
-
const
|
|
810
|
+
const At = {
|
|
763
811
|
key: 0,
|
|
764
812
|
id: "resizable"
|
|
765
|
-
},
|
|
813
|
+
}, Ct = {
|
|
766
814
|
class: "atable-header-row",
|
|
767
815
|
tabindex: "-1"
|
|
768
|
-
},
|
|
816
|
+
}, St = {
|
|
769
817
|
key: 0,
|
|
770
818
|
id: "header-index"
|
|
771
|
-
},
|
|
819
|
+
}, $e = /* @__PURE__ */ _({
|
|
772
820
|
__name: "ATableHeader",
|
|
773
821
|
props: {
|
|
774
822
|
columns: {},
|
|
@@ -776,29 +824,27 @@ const wt = {
|
|
|
776
824
|
tableid: {}
|
|
777
825
|
},
|
|
778
826
|
setup(t) {
|
|
779
|
-
const n =
|
|
780
|
-
n.numberedRowWidth.value;
|
|
781
|
-
const o = (a) => ({
|
|
827
|
+
const n = z(t.tableid), o = (a) => ({
|
|
782
828
|
minWidth: a.width || "40ch",
|
|
783
829
|
textAlign: a.align || "center",
|
|
784
830
|
width: n.config.fullWidth ? "auto" : null
|
|
785
831
|
});
|
|
786
|
-
return (a, l) => a.columns.length ? (
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
(
|
|
790
|
-
key:
|
|
832
|
+
return (a, l) => a.columns.length ? (w(), b("thead", At, [
|
|
833
|
+
$("tr", Ct, [
|
|
834
|
+
f(n).zeroColumn ? (w(), b("th", St)) : B("", !0),
|
|
835
|
+
(w(!0), b(V, null, J(a.columns, (s, r) => (w(), b("th", {
|
|
836
|
+
key: s.name,
|
|
791
837
|
tabindex: "-1",
|
|
792
|
-
style: N(o(
|
|
838
|
+
style: N(o(s))
|
|
793
839
|
}, [
|
|
794
|
-
|
|
795
|
-
|
|
840
|
+
I(a.$slots, "default", {}, () => [
|
|
841
|
+
Ne(L(s.label || String.fromCharCode(r + 97).toUpperCase()), 1)
|
|
796
842
|
])
|
|
797
843
|
], 4))), 128))
|
|
798
844
|
])
|
|
799
845
|
])) : B("", !0);
|
|
800
846
|
}
|
|
801
|
-
}),
|
|
847
|
+
}), Oe = /* @__PURE__ */ _({
|
|
802
848
|
__name: "ATableModal",
|
|
803
849
|
props: {
|
|
804
850
|
colIndex: {},
|
|
@@ -806,21 +852,20 @@ const wt = {
|
|
|
806
852
|
tableid: {}
|
|
807
853
|
},
|
|
808
854
|
setup(t) {
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
o.stopPropagation();
|
|
855
|
+
const e = (n) => {
|
|
856
|
+
n.stopPropagation();
|
|
812
857
|
};
|
|
813
|
-
return (
|
|
858
|
+
return (n, o) => (w(), b("div", {
|
|
814
859
|
ref: "amodal",
|
|
815
860
|
class: "amodal",
|
|
816
861
|
tabindex: "-1",
|
|
817
|
-
onClick:
|
|
818
|
-
onInput:
|
|
862
|
+
onClick: e,
|
|
863
|
+
onInput: e
|
|
819
864
|
}, [
|
|
820
|
-
|
|
865
|
+
I(n.$slots, "default")
|
|
821
866
|
], 544));
|
|
822
867
|
}
|
|
823
|
-
}),
|
|
868
|
+
}), _t = /* @__PURE__ */ _({
|
|
824
869
|
__name: "ATable",
|
|
825
870
|
props: {
|
|
826
871
|
id: {},
|
|
@@ -833,56 +878,58 @@ const wt = {
|
|
|
833
878
|
emits: ["update:modelValue"],
|
|
834
879
|
setup(t, { emit: e }) {
|
|
835
880
|
const n = t, o = e;
|
|
836
|
-
let a = n.modelValue ? n.modelValue : n.rows, l = new
|
|
837
|
-
|
|
881
|
+
let a = n.modelValue ? n.modelValue : n.rows, l = new kt(n.id, n.columns, a, n.config);
|
|
882
|
+
Ue(l.id, l), S(
|
|
838
883
|
() => l.rows,
|
|
839
884
|
(r) => {
|
|
840
885
|
o("update:modelValue", r);
|
|
841
886
|
},
|
|
842
887
|
{ deep: !0 }
|
|
843
888
|
);
|
|
844
|
-
const
|
|
845
|
-
var
|
|
846
|
-
r.target instanceof Node && (
|
|
889
|
+
const s = (r) => {
|
|
890
|
+
var i;
|
|
891
|
+
r.target instanceof Node && (i = l.modal.parent) != null && i.contains(r.target) || l.modal.visible && (l.modal.visible = !1);
|
|
847
892
|
};
|
|
848
|
-
return window.addEventListener("keydown",
|
|
893
|
+
return window.addEventListener("keydown", (r) => {
|
|
849
894
|
if (r.key === "Escape" && l.modal.visible) {
|
|
850
895
|
l.modal.visible = !1;
|
|
851
|
-
const
|
|
852
|
-
|
|
896
|
+
const i = l.modal.parent;
|
|
897
|
+
i && Ve().then(() => {
|
|
898
|
+
i.focus();
|
|
899
|
+
});
|
|
853
900
|
}
|
|
854
|
-
}), (r,
|
|
901
|
+
}), (r, i) => X((w(), b("table", {
|
|
855
902
|
class: "atable",
|
|
856
|
-
style: N({ width:
|
|
903
|
+
style: N({ width: f(l).config.fullWidth ? "100%" : "auto" })
|
|
857
904
|
}, [
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
columns:
|
|
861
|
-
config:
|
|
862
|
-
tableid:
|
|
905
|
+
I(r.$slots, "header", { data: f(l) }, () => [
|
|
906
|
+
se($e, {
|
|
907
|
+
columns: f(l).columns,
|
|
908
|
+
config: f(l).config,
|
|
909
|
+
tableid: f(l).id
|
|
863
910
|
}, null, 8, ["columns", "config", "tableid"])
|
|
864
911
|
]),
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
(
|
|
868
|
-
key:
|
|
869
|
-
row:
|
|
870
|
-
rowIndex:
|
|
871
|
-
tableid:
|
|
912
|
+
$("tbody", null, [
|
|
913
|
+
I(r.$slots, "body", { data: f(l) }, () => [
|
|
914
|
+
(w(!0), b(V, null, J(f(l).rows, (d, u) => (w(), W(Ce, {
|
|
915
|
+
key: d.id,
|
|
916
|
+
row: d,
|
|
917
|
+
rowIndex: u,
|
|
918
|
+
tableid: f(l).id
|
|
872
919
|
}, {
|
|
873
|
-
default:
|
|
874
|
-
(
|
|
875
|
-
key:
|
|
876
|
-
tableid:
|
|
877
|
-
col:
|
|
920
|
+
default: ie(() => [
|
|
921
|
+
(w(!0), b(V, null, J(f(l).columns, (p, c) => (w(), W(Ae, {
|
|
922
|
+
key: p.name,
|
|
923
|
+
tableid: f(l).id,
|
|
924
|
+
col: p,
|
|
878
925
|
spellcheck: "false",
|
|
879
|
-
rowIndex:
|
|
880
|
-
colIndex: c + (
|
|
881
|
-
component:
|
|
926
|
+
rowIndex: u,
|
|
927
|
+
colIndex: c + (f(l).zeroColumn ? 0 : -1),
|
|
928
|
+
component: p.cellComponent,
|
|
882
929
|
style: N({
|
|
883
|
-
textAlign: (
|
|
884
|
-
minWidth: (
|
|
885
|
-
width:
|
|
930
|
+
textAlign: (p == null ? void 0 : p.align) || "center",
|
|
931
|
+
minWidth: (p == null ? void 0 : p.width) || "40ch",
|
|
932
|
+
width: f(l).config.fullWidth ? "auto" : null
|
|
886
933
|
})
|
|
887
934
|
}, null, 8, ["tableid", "col", "rowIndex", "colIndex", "component", "style"]))), 128))
|
|
888
935
|
]),
|
|
@@ -890,47 +937,47 @@ const wt = {
|
|
|
890
937
|
}, 1032, ["row", "rowIndex", "tableid"]))), 128))
|
|
891
938
|
])
|
|
892
939
|
]),
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
colIndex:
|
|
897
|
-
rowIndex:
|
|
898
|
-
tableid:
|
|
940
|
+
I(r.$slots, "footer", { data: f(l) }),
|
|
941
|
+
I(r.$slots, "modal", { data: f(l) }, () => [
|
|
942
|
+
X(se(Oe, {
|
|
943
|
+
colIndex: f(l).modal.colIndex,
|
|
944
|
+
rowIndex: f(l).modal.rowIndex,
|
|
945
|
+
tableid: f(l).id,
|
|
899
946
|
style: N({
|
|
900
|
-
left:
|
|
901
|
-
top:
|
|
902
|
-
maxWidth:
|
|
947
|
+
left: f(l).modal.left + "px",
|
|
948
|
+
top: f(l).modal.top + "px",
|
|
949
|
+
maxWidth: f(l).modal.width + "px"
|
|
903
950
|
})
|
|
904
951
|
}, {
|
|
905
|
-
default:
|
|
906
|
-
(
|
|
907
|
-
key: `${
|
|
908
|
-
colIndex:
|
|
909
|
-
rowIndex:
|
|
910
|
-
tableid:
|
|
911
|
-
},
|
|
952
|
+
default: ie(() => [
|
|
953
|
+
(w(), W(Ee(f(l).modal.component), K({
|
|
954
|
+
key: `${f(l).modal.rowIndex}:${f(l).modal.colIndex}`,
|
|
955
|
+
colIndex: f(l).modal.colIndex,
|
|
956
|
+
rowIndex: f(l).modal.rowIndex,
|
|
957
|
+
tableid: f(l).id
|
|
958
|
+
}, f(l).modal.componentProps), null, 16, ["colIndex", "rowIndex", "tableid"]))
|
|
912
959
|
]),
|
|
913
960
|
_: 1
|
|
914
961
|
}, 8, ["colIndex", "rowIndex", "tableid", "style"]), [
|
|
915
|
-
[
|
|
962
|
+
[Ie, f(l).modal.visible]
|
|
916
963
|
])
|
|
917
964
|
])
|
|
918
965
|
], 4)), [
|
|
919
|
-
[
|
|
966
|
+
[f(vt), s]
|
|
920
967
|
]);
|
|
921
968
|
}
|
|
922
969
|
});
|
|
923
|
-
function
|
|
924
|
-
t.component("ACell",
|
|
970
|
+
function $t(t) {
|
|
971
|
+
t.component("ACell", Ae), t.component("AExpansionRow", it), t.component("ARow", Ce), t.component("ATable", _t), t.component("ATableHeader", $e), t.component("ATableModal", Oe);
|
|
925
972
|
}
|
|
926
973
|
export {
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
974
|
+
Ae as ACell,
|
|
975
|
+
it as AExpansionRow,
|
|
976
|
+
Ce as ARow,
|
|
977
|
+
_t as ATable,
|
|
978
|
+
$e as ATableHeader,
|
|
979
|
+
Oe as ATableModal,
|
|
980
|
+
kt as TableDataStore,
|
|
981
|
+
$t as install
|
|
935
982
|
};
|
|
936
983
|
//# sourceMappingURL=atable.js.map
|