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