@stonecrop/atable 0.2.24 → 0.2.26
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 +489 -441
- 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 +1 -1
- package/src/components/ARow.vue +2 -3
- package/src/components/ATable.vue +6 -5
- package/src/components/ATableHeader.vue +1 -2
- package/src/components/index.ts +1 -1
- package/src/icons/stonecrop-ui-icon-delete.svg +5 -0
- package/src/icons/stonecrop-ui-icon-duplicate.svg +5 -0
- package/src/icons/stonecrop-ui-icon-insert-above.svg +15 -0
- package/src/icons/stonecrop-ui-icon-insert-below.svg +15 -0
- package/src/icons/stonecrop-ui-icon-move.svg +4 -0
- 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,164 +1,207 @@
|
|
|
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
|
|
19
|
-
let e, n, o,
|
|
20
|
-
if (typeof t[0] == "string" || Array.isArray(t[0]) ? ([n, o,
|
|
21
|
-
return
|
|
20
|
+
const F = Be ? window : void 0;
|
|
21
|
+
function Q(...t) {
|
|
22
|
+
let e, n, o, a;
|
|
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();
|
|
38
41
|
};
|
|
39
|
-
return
|
|
42
|
+
return ke(d), d;
|
|
40
43
|
}
|
|
41
|
-
function
|
|
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
|
|
75
|
+
};
|
|
76
|
+
}
|
|
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
|
|
65
|
-
const o = x(!1),
|
|
66
|
-
if (!e)
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
if (!a)
|
|
108
|
+
function Ke(t, { window: e = F, scrollTarget: n } = {}) {
|
|
109
|
+
const o = x(!1), a = () => {
|
|
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
|
-
() =>
|
|
78
|
-
() =>
|
|
119
|
+
return S(
|
|
120
|
+
() => M(t),
|
|
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
128
|
const k = (t) => {
|
|
86
|
-
let e =
|
|
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) {
|
|
95
138
|
const o = (e = t.parentElement) == null ? void 0 : e.previousElementSibling;
|
|
96
139
|
if (o) {
|
|
97
|
-
const
|
|
98
|
-
|
|
140
|
+
const a = Array.from(o.children)[t.cellIndex];
|
|
141
|
+
a && (n = a);
|
|
99
142
|
}
|
|
100
143
|
} else if (t instanceof HTMLTableRowElement) {
|
|
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;
|
|
109
152
|
if (n instanceof HTMLTableCellElement) {
|
|
110
|
-
const
|
|
111
|
-
if (
|
|
112
|
-
const l =
|
|
153
|
+
const a = (e = n.parentElement) == null ? void 0 : e.parentElement;
|
|
154
|
+
if (a) {
|
|
155
|
+
const l = a.firstElementChild.children[n.cellIndex];
|
|
113
156
|
l && (o = l);
|
|
114
157
|
}
|
|
115
158
|
} else if (n instanceof HTMLTableRowElement) {
|
|
116
|
-
const
|
|
117
|
-
if (
|
|
118
|
-
const l =
|
|
159
|
+
const a = n.parentElement;
|
|
160
|
+
if (a) {
|
|
161
|
+
const l = a.firstElementChild;
|
|
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) {
|
|
130
173
|
const o = (e = t.parentElement) == null ? void 0 : e.nextElementSibling;
|
|
131
174
|
if (o) {
|
|
132
|
-
const
|
|
133
|
-
|
|
175
|
+
const a = Array.from(o.children)[t.cellIndex];
|
|
176
|
+
a && (n = a);
|
|
134
177
|
}
|
|
135
178
|
} else if (t instanceof HTMLTableRowElement) {
|
|
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;
|
|
144
187
|
if (n instanceof HTMLTableCellElement) {
|
|
145
|
-
const
|
|
146
|
-
if (
|
|
147
|
-
const l =
|
|
188
|
+
const a = (e = n.parentElement) == null ? void 0 : e.parentElement;
|
|
189
|
+
if (a) {
|
|
190
|
+
const l = a.lastElementChild.children[n.cellIndex];
|
|
148
191
|
l && (o = l);
|
|
149
192
|
}
|
|
150
193
|
} else if (n instanceof HTMLTableRowElement) {
|
|
151
|
-
const
|
|
152
|
-
if (
|
|
153
|
-
const l =
|
|
194
|
+
const a = n.parentElement;
|
|
195
|
+
if (a) {
|
|
196
|
+
const l = a.lastElementChild;
|
|
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 k = (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 k = (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
|
-
},
|
|
284
|
-
const
|
|
285
|
-
if (
|
|
286
|
-
|
|
287
|
-
const u
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
return r.getModifierState(O);
|
|
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);
|
|
335
|
+
return r.getModifierState(P);
|
|
294
336
|
});
|
|
295
|
-
if (
|
|
296
|
-
if (
|
|
297
|
-
for (const
|
|
298
|
-
if (c.includes(
|
|
299
|
-
const
|
|
300
|
-
r.getModifierState(
|
|
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 Ye = ["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
|
|
367
|
-
o.value && (
|
|
368
|
-
},
|
|
369
|
-
o.value && o.value.textContent !==
|
|
370
|
-
}, c = (
|
|
371
|
-
textAlign:
|
|
372
|
-
width:
|
|
408
|
+
const i = E(() => n.columns[e.colIndex].align || "center"), d = E(() => n.columns[e.colIndex].width || "40ch"), u = () => {
|
|
409
|
+
o.value && (a.value = o.value.textContent);
|
|
410
|
+
}, p = () => {
|
|
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));
|
|
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 Ye = ["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
478
|
}, L(l.value), 1),
|
|
437
|
-
|
|
438
|
-
], 16,
|
|
439
|
-
|
|
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
|
-
ref:
|
|
443
|
-
tabindex:
|
|
484
|
+
ref: a,
|
|
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,253 +509,260 @@ const Ye = ["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 i = I(() => n.config.view !== "tree" || n.display[e.rowIndex].isRoot || n.display[e.rowIndex].open), l = I(() => n.config.view !== "tree" ? "" : n.display[e.rowIndex].isRoot || n.display[e.rowIndex].isParent ? n.display[e.rowIndex].childrenOpen ? "-" : "+" : ""), a = (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
|
-
}, L(l.value), 1)) :
|
|
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
|
-
function
|
|
508
|
-
return
|
|
547
|
+
function Se(t) {
|
|
548
|
+
return be() ? (xe(t), !0) : !1;
|
|
509
549
|
}
|
|
510
|
-
function
|
|
511
|
-
return typeof t == "function" ? t() :
|
|
550
|
+
function O(t) {
|
|
551
|
+
return typeof t == "function" ? t() : f(t);
|
|
512
552
|
}
|
|
513
|
-
const
|
|
553
|
+
const _e = typeof window < "u" && typeof document < "u";
|
|
514
554
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
515
|
-
const
|
|
516
|
-
},
|
|
517
|
-
function
|
|
555
|
+
const ut = Object.prototype.toString, ft = (t) => ut.call(t) === "[object Object]", R = () => {
|
|
556
|
+
}, Z = /* @__PURE__ */ pt();
|
|
557
|
+
function pt() {
|
|
518
558
|
var t, e;
|
|
519
|
-
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));
|
|
520
560
|
}
|
|
521
|
-
const
|
|
561
|
+
const ve = {
|
|
522
562
|
mounted: "mounted",
|
|
523
563
|
updated: "updated",
|
|
524
564
|
unmounted: "unmounted"
|
|
525
565
|
};
|
|
526
|
-
function
|
|
566
|
+
function mt(...t) {
|
|
527
567
|
if (t.length !== 1)
|
|
528
|
-
return
|
|
568
|
+
return He(...t);
|
|
529
569
|
const e = t[0];
|
|
530
|
-
return typeof e == "function" ?
|
|
570
|
+
return typeof e == "function" ? je(We(() => ({ get: e, set: R }))) : x(e);
|
|
531
571
|
}
|
|
532
|
-
function
|
|
572
|
+
function T(t) {
|
|
533
573
|
var e;
|
|
534
|
-
const n =
|
|
574
|
+
const n = O(t);
|
|
535
575
|
return (e = n == null ? void 0 : n.$el) != null ? e : n;
|
|
536
576
|
}
|
|
537
|
-
const
|
|
538
|
-
function
|
|
539
|
-
let e, n, o,
|
|
540
|
-
if (typeof t[0] == "string" || Array.isArray(t[0]) ? ([n, o,
|
|
577
|
+
const De = _e ? window : void 0;
|
|
578
|
+
function U(...t) {
|
|
579
|
+
let e, n, o, a;
|
|
580
|
+
if (typeof t[0] == "string" || Array.isArray(t[0]) ? ([n, o, a] = t, e = De) : [e, n, o, a] = t, !e)
|
|
541
581
|
return R;
|
|
542
582
|
Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
|
|
543
|
-
const l = [],
|
|
544
|
-
l.forEach((
|
|
545
|
-
}, r = (
|
|
546
|
-
() => [
|
|
547
|
-
([
|
|
548
|
-
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)
|
|
549
589
|
return;
|
|
550
|
-
const c =
|
|
590
|
+
const c = ft(p) ? { ...p } : p;
|
|
551
591
|
l.push(
|
|
552
|
-
...n.flatMap((
|
|
592
|
+
...n.flatMap((m) => o.map((h) => r(u, m, h, c)))
|
|
553
593
|
);
|
|
554
594
|
},
|
|
555
595
|
{ immediate: !0, flush: "post" }
|
|
556
|
-
),
|
|
557
|
-
|
|
596
|
+
), d = () => {
|
|
597
|
+
i(), s();
|
|
558
598
|
};
|
|
559
|
-
return
|
|
599
|
+
return Se(d), d;
|
|
560
600
|
}
|
|
561
|
-
let
|
|
562
|
-
function
|
|
563
|
-
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;
|
|
564
604
|
if (!o)
|
|
565
605
|
return R;
|
|
566
|
-
|
|
606
|
+
Z && !he && (he = !0, Array.from(o.document.body.children).forEach((c) => c.addEventListener("click", R)), o.document.documentElement.addEventListener("click", R));
|
|
567
607
|
let r = !0;
|
|
568
|
-
const
|
|
569
|
-
if (typeof
|
|
570
|
-
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));
|
|
571
611
|
{
|
|
572
|
-
const
|
|
573
|
-
return
|
|
612
|
+
const h = T(m);
|
|
613
|
+
return h && (c.target === h || c.composedPath().includes(h));
|
|
574
614
|
}
|
|
575
|
-
}),
|
|
576
|
-
|
|
577
|
-
const
|
|
578
|
-
if (!(!
|
|
579
|
-
if (c.detail === 0 && (r = !
|
|
615
|
+
}), u = [
|
|
616
|
+
U(o, "click", (c) => {
|
|
617
|
+
const m = T(t);
|
|
618
|
+
if (!(!m || m === c.target || c.composedPath().includes(m))) {
|
|
619
|
+
if (c.detail === 0 && (r = !i(c)), !r) {
|
|
580
620
|
r = !0;
|
|
581
621
|
return;
|
|
582
622
|
}
|
|
583
623
|
e(c);
|
|
584
624
|
}
|
|
585
625
|
}, { passive: !0, capture: l }),
|
|
586
|
-
|
|
587
|
-
const
|
|
588
|
-
r = !
|
|
626
|
+
U(o, "pointerdown", (c) => {
|
|
627
|
+
const m = T(t);
|
|
628
|
+
r = !i(c) && !!(m && !c.composedPath().includes(m));
|
|
589
629
|
}, { passive: !0 }),
|
|
590
|
-
|
|
630
|
+
s && U(o, "blur", (c) => {
|
|
591
631
|
setTimeout(() => {
|
|
592
|
-
var
|
|
593
|
-
const
|
|
594
|
-
((
|
|
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);
|
|
595
635
|
}, 0);
|
|
596
636
|
})
|
|
597
637
|
].filter(Boolean);
|
|
598
|
-
return () =>
|
|
638
|
+
return () => u.forEach((c) => c());
|
|
599
639
|
}
|
|
600
|
-
const
|
|
601
|
-
[
|
|
640
|
+
const vt = {
|
|
641
|
+
[ve.mounted](t, e) {
|
|
602
642
|
const n = !e.modifiers.bubble;
|
|
603
643
|
if (typeof e.value == "function")
|
|
604
|
-
t.__onClickOutside_stop =
|
|
644
|
+
t.__onClickOutside_stop = we(t, e.value, { capture: n });
|
|
605
645
|
else {
|
|
606
|
-
const [o,
|
|
607
|
-
t.__onClickOutside_stop =
|
|
646
|
+
const [o, a] = e.value;
|
|
647
|
+
t.__onClickOutside_stop = we(t, o, Object.assign({ capture: n }, a));
|
|
608
648
|
}
|
|
609
649
|
},
|
|
610
|
-
[
|
|
650
|
+
[ve.unmounted](t) {
|
|
611
651
|
t.__onClickOutside_stop();
|
|
612
652
|
}
|
|
613
653
|
};
|
|
614
|
-
function
|
|
654
|
+
function q(t) {
|
|
615
655
|
return typeof Window < "u" && t instanceof Window ? t.document.documentElement : typeof Document < "u" && t instanceof Document ? t.documentElement : t;
|
|
616
656
|
}
|
|
617
|
-
function
|
|
657
|
+
function Te(t) {
|
|
618
658
|
const e = window.getComputedStyle(t);
|
|
619
659
|
if (e.overflowX === "scroll" || e.overflowY === "scroll" || e.overflowX === "auto" && t.clientWidth < t.scrollWidth || e.overflowY === "auto" && t.clientHeight < t.scrollHeight)
|
|
620
660
|
return !0;
|
|
621
661
|
{
|
|
622
662
|
const n = t.parentNode;
|
|
623
|
-
return !n || n.tagName === "BODY" ? !1 :
|
|
663
|
+
return !n || n.tagName === "BODY" ? !1 : Te(n);
|
|
624
664
|
}
|
|
625
665
|
}
|
|
626
|
-
function
|
|
666
|
+
function ht(t) {
|
|
627
667
|
const e = t || window.event, n = e.target;
|
|
628
|
-
return
|
|
668
|
+
return Te(n) ? !1 : e.touches.length > 1 ? !0 : (e.preventDefault && e.preventDefault(), !1);
|
|
629
669
|
}
|
|
630
|
-
const
|
|
631
|
-
function
|
|
670
|
+
const G = /* @__PURE__ */ new WeakMap();
|
|
671
|
+
function wt(t, e = !1) {
|
|
632
672
|
const n = x(e);
|
|
633
|
-
let o = null;
|
|
634
|
-
|
|
635
|
-
const
|
|
636
|
-
if (
|
|
637
|
-
const
|
|
638
|
-
|
|
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";
|
|
639
682
|
}
|
|
640
683
|
}, {
|
|
641
684
|
immediate: !0
|
|
642
685
|
});
|
|
643
|
-
const
|
|
644
|
-
const
|
|
645
|
-
!
|
|
646
|
-
|
|
686
|
+
const l = () => {
|
|
687
|
+
const r = q(O(t));
|
|
688
|
+
!r || n.value || (Z && (o = U(
|
|
689
|
+
r,
|
|
647
690
|
"touchmove",
|
|
648
|
-
(
|
|
649
|
-
|
|
691
|
+
(i) => {
|
|
692
|
+
ht(i);
|
|
650
693
|
},
|
|
651
694
|
{ passive: !1 }
|
|
652
|
-
)),
|
|
653
|
-
},
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
!r || !n.value || (X && (o == null || o()), r.style.overflow = (a = M.get(r)) != null ? a : "", M.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);
|
|
657
699
|
};
|
|
658
|
-
return
|
|
700
|
+
return Se(s), E({
|
|
659
701
|
get() {
|
|
660
702
|
return n.value;
|
|
661
703
|
},
|
|
662
|
-
set(
|
|
663
|
-
|
|
704
|
+
set(r) {
|
|
705
|
+
r ? l() : s();
|
|
664
706
|
}
|
|
665
707
|
});
|
|
666
708
|
}
|
|
667
|
-
function
|
|
709
|
+
function gt() {
|
|
668
710
|
let t = !1;
|
|
669
711
|
const e = x(!1);
|
|
670
712
|
return (n, o) => {
|
|
671
713
|
if (e.value = o.value, t)
|
|
672
714
|
return;
|
|
673
715
|
t = !0;
|
|
674
|
-
const
|
|
675
|
-
|
|
716
|
+
const a = wt(n, o.value);
|
|
717
|
+
S(e, (l) => a.value = l);
|
|
676
718
|
};
|
|
677
719
|
}
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
return H(ct);
|
|
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();
|
|
685
726
|
}
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
return
|
|
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);
|
|
691
732
|
}
|
|
692
|
-
|
|
693
|
-
|
|
733
|
+
var Et = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
734
|
+
const ge = {
|
|
735
|
+
randomUUID: Et
|
|
694
736
|
};
|
|
695
|
-
function
|
|
696
|
-
if (
|
|
697
|
-
return
|
|
737
|
+
function It(t, e, n) {
|
|
738
|
+
if (ge.randomUUID && !e && !t)
|
|
739
|
+
return ge.randomUUID();
|
|
698
740
|
t = t || {};
|
|
699
|
-
|
|
741
|
+
var o = t.random || (t.rng || xt)();
|
|
700
742
|
if (o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, e) {
|
|
701
743
|
n = n || 0;
|
|
702
|
-
for (
|
|
703
|
-
e[n +
|
|
744
|
+
for (var a = 0; a < 16; ++a)
|
|
745
|
+
e[n + a] = o[a];
|
|
704
746
|
return e;
|
|
705
747
|
}
|
|
706
|
-
return
|
|
748
|
+
return yt(o);
|
|
707
749
|
}
|
|
708
|
-
class
|
|
709
|
-
constructor(e, n, o,
|
|
710
|
-
|
|
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 = {};
|
|
714
763
|
for (const [n, o] of this.columns.entries())
|
|
715
|
-
for (const [
|
|
716
|
-
e[`${n}:${
|
|
764
|
+
for (const [a, l] of this.rows.entries())
|
|
765
|
+
e[`${n}:${a}`] = l[o.name];
|
|
717
766
|
return e;
|
|
718
767
|
}
|
|
719
768
|
createDisplayObject(e) {
|
|
@@ -721,54 +770,53 @@ class ht {
|
|
|
721
770
|
if (e && "0:0" in e)
|
|
722
771
|
return e;
|
|
723
772
|
const o = /* @__PURE__ */ new Set();
|
|
724
|
-
for (let
|
|
725
|
-
const l = this.rows[
|
|
726
|
-
l.parent && o.add(l.parent), n[
|
|
773
|
+
for (let a = this.rows.length - 1; a >= 0; a--) {
|
|
774
|
+
const l = this.rows[a];
|
|
775
|
+
l.parent && o.add(l.parent), n[a] = {
|
|
727
776
|
childrenOpen: !1,
|
|
728
777
|
expanded: !1,
|
|
729
778
|
indent: l.indent || null,
|
|
730
|
-
isParent: o.has(
|
|
779
|
+
isParent: o.has(a),
|
|
731
780
|
isRoot: l.parent === null || l.parent === void 0,
|
|
732
781
|
modified: !1,
|
|
733
782
|
open: l.parent === null || l.parent === void 0,
|
|
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}`];
|
|
747
796
|
}
|
|
748
797
|
setCellData(e, n, o) {
|
|
749
798
|
this.table[`${n}:${e}`] !== o && (this.display[e].modified = !0), this.table[`${n}:${e}`] = o;
|
|
750
|
-
const
|
|
751
|
-
return this.rows[e][
|
|
799
|
+
const a = this.columns[n];
|
|
800
|
+
return this.rows[e][a.name] = o, this.table[`${n}:${e}`];
|
|
752
801
|
}
|
|
753
802
|
toggleRowExpand(e) {
|
|
754
803
|
if (this.config.view === "tree") {
|
|
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
|
-
|
|
781
|
-
|
|
782
|
-
minWidth: i.width || "40ch",
|
|
783
|
-
textAlign: i.align || "center",
|
|
827
|
+
const n = z(t.tableid), o = (a) => ({
|
|
828
|
+
minWidth: a.width || "40ch",
|
|
829
|
+
textAlign: a.align || "center",
|
|
784
830
|
width: n.config.fullWidth ? "auto" : null
|
|
785
831
|
});
|
|
786
|
-
return (
|
|
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:
|
|
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: {},
|
|
@@ -809,17 +855,17 @@ const wt = {
|
|
|
809
855
|
const e = (n) => {
|
|
810
856
|
n.stopPropagation();
|
|
811
857
|
};
|
|
812
|
-
return (n, o) => (
|
|
858
|
+
return (n, o) => (w(), b("div", {
|
|
813
859
|
ref: "amodal",
|
|
814
860
|
class: "amodal",
|
|
815
861
|
tabindex: "-1",
|
|
816
862
|
onClick: e,
|
|
817
863
|
onInput: e
|
|
818
864
|
}, [
|
|
819
|
-
|
|
865
|
+
I(n.$slots, "default")
|
|
820
866
|
], 544));
|
|
821
867
|
}
|
|
822
|
-
}),
|
|
868
|
+
}), _t = /* @__PURE__ */ _({
|
|
823
869
|
__name: "ATable",
|
|
824
870
|
props: {
|
|
825
871
|
id: {},
|
|
@@ -832,56 +878,58 @@ const wt = {
|
|
|
832
878
|
emits: ["update:modelValue"],
|
|
833
879
|
setup(t, { emit: e }) {
|
|
834
880
|
const n = t, o = e;
|
|
835
|
-
let
|
|
836
|
-
|
|
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(
|
|
837
883
|
() => l.rows,
|
|
838
884
|
(r) => {
|
|
839
885
|
o("update:modelValue", r);
|
|
840
886
|
},
|
|
841
887
|
{ deep: !0 }
|
|
842
888
|
);
|
|
843
|
-
const
|
|
844
|
-
var
|
|
845
|
-
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);
|
|
846
892
|
};
|
|
847
|
-
return window.addEventListener("keydown",
|
|
893
|
+
return window.addEventListener("keydown", (r) => {
|
|
848
894
|
if (r.key === "Escape" && l.modal.visible) {
|
|
849
895
|
l.modal.visible = !1;
|
|
850
|
-
const
|
|
851
|
-
|
|
896
|
+
const i = l.modal.parent;
|
|
897
|
+
i && Ve().then(() => {
|
|
898
|
+
i.focus();
|
|
899
|
+
});
|
|
852
900
|
}
|
|
853
|
-
}), (r,
|
|
901
|
+
}), (r, i) => X((w(), b("table", {
|
|
854
902
|
class: "atable",
|
|
855
|
-
style:
|
|
903
|
+
style: N({ width: f(l).config.fullWidth ? "100%" : "auto" })
|
|
856
904
|
}, [
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
columns:
|
|
860
|
-
config:
|
|
861
|
-
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
|
|
862
910
|
}, null, 8, ["columns", "config", "tableid"])
|
|
863
911
|
]),
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
(
|
|
867
|
-
key:
|
|
868
|
-
row:
|
|
869
|
-
rowIndex:
|
|
870
|
-
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
|
|
871
919
|
}, {
|
|
872
|
-
default:
|
|
873
|
-
(
|
|
874
|
-
key:
|
|
875
|
-
tableid:
|
|
876
|
-
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,
|
|
877
925
|
spellcheck: "false",
|
|
878
|
-
rowIndex:
|
|
879
|
-
colIndex: c + (
|
|
880
|
-
component:
|
|
881
|
-
style:
|
|
882
|
-
textAlign: (
|
|
883
|
-
minWidth: (
|
|
884
|
-
width:
|
|
926
|
+
rowIndex: u,
|
|
927
|
+
colIndex: c + (f(l).zeroColumn ? 0 : -1),
|
|
928
|
+
component: p.cellComponent,
|
|
929
|
+
style: N({
|
|
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
|
|
885
933
|
})
|
|
886
934
|
}, null, 8, ["tableid", "col", "rowIndex", "colIndex", "component", "style"]))), 128))
|
|
887
935
|
]),
|
|
@@ -889,47 +937,47 @@ const wt = {
|
|
|
889
937
|
}, 1032, ["row", "rowIndex", "tableid"]))), 128))
|
|
890
938
|
])
|
|
891
939
|
]),
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
colIndex:
|
|
896
|
-
rowIndex:
|
|
897
|
-
tableid:
|
|
898
|
-
style:
|
|
899
|
-
left:
|
|
900
|
-
top:
|
|
901
|
-
maxWidth:
|
|
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,
|
|
946
|
+
style: N({
|
|
947
|
+
left: f(l).modal.left + "px",
|
|
948
|
+
top: f(l).modal.top + "px",
|
|
949
|
+
maxWidth: f(l).modal.width + "px"
|
|
902
950
|
})
|
|
903
951
|
}, {
|
|
904
|
-
default:
|
|
905
|
-
(
|
|
906
|
-
key: `${
|
|
907
|
-
colIndex:
|
|
908
|
-
rowIndex:
|
|
909
|
-
tableid:
|
|
910
|
-
},
|
|
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"]))
|
|
911
959
|
]),
|
|
912
960
|
_: 1
|
|
913
961
|
}, 8, ["colIndex", "rowIndex", "tableid", "style"]), [
|
|
914
|
-
[
|
|
962
|
+
[Ie, f(l).modal.visible]
|
|
915
963
|
])
|
|
916
964
|
])
|
|
917
965
|
], 4)), [
|
|
918
|
-
[
|
|
966
|
+
[f(vt), s]
|
|
919
967
|
]);
|
|
920
968
|
}
|
|
921
969
|
});
|
|
922
|
-
function
|
|
923
|
-
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);
|
|
924
972
|
}
|
|
925
973
|
export {
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
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
|
|
934
982
|
};
|
|
935
983
|
//# sourceMappingURL=atable.js.map
|