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