@stonecrop/atable 0.4.6 → 0.4.8

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