@stonecrop/atable 0.4.5 → 0.4.7

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,555 +1,614 @@
1
- import { onMounted as G, ref as y, watch as L, onBeforeUnmount as Je, computed as k, unref as g, getCurrentScope as Le, onScopeDispose as Pe, getCurrentInstance as fe, nextTick as We, toRef as Qe, readonly as Ze, customRef as Ke, defineComponent as V, useTemplateRef as J, openBlock as C, createElementBlock as I, normalizeStyle as z, normalizeClass as F, createBlock as te, resolveDynamicComponent as De, mergeProps as me, toDisplayString as Y, Fragment as oe, createElementVNode as P, renderSlot as R, createCommentVNode as U, withDirectives as ie, vShow as He, renderList as ce, createTextVNode as _e, createVNode as Ce, withCtx as ke } from "vue";
2
- import { defineStore as et } from "pinia";
3
- import './assets/index.css';function Ne(e) {
4
- return Le() ? (Pe(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 ve(e) {
7
- return typeof e == "function" ? e() : g(e);
8
- }
9
- const tt = 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 nt = (e) => e != null, ot = Object.prototype.toString, lt = (e) => ot.call(e) === "[object Object]", rt = () => {
12
- }, Q = tt ? window : void 0;
13
- function X(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 = ve(e);
26
+ const n = k(e);
16
27
  return (t = n == null ? void 0 : n.$el) != null ? t : n;
17
28
  }
18
- function q(...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 rt;
22
- Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
23
- const i = [], l = () => {
24
- i.forEach((c) => c()), i.length = 0;
25
- }, r = (c, u, f, m) => (c.addEventListener(u, f, m), () => c.removeEventListener(u, f, m)), d = L(
26
- () => [X(t), ve(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 f = lt(u) ? { ...u } : u;
31
- i.push(
32
- ...n.flatMap((m) => o.map((x) => r(c, m, x, f)))
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" }
36
- ), s = () => {
37
- d(), l();
58
+ { flush: "post" }
59
+ ), r = () => {
60
+ c(), n();
38
61
  };
39
- return Ne(s), s;
62
+ return pe(n), r;
40
63
  }
41
- function st() {
42
- const e = y(!1), t = fe();
43
- return t && G(() => {
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 at(e) {
48
- const t = st();
49
- return k(() => (t.value, !!e()));
70
+ function mt(e) {
71
+ const t = ft();
72
+ return C(() => (t.value, !!e()));
50
73
  }
51
- function it(e, t, n = {}) {
52
- const { window: o = Q, ...a } = n;
53
- let i;
54
- const l = at(() => o && "MutationObserver" in o), r = () => {
55
- i && (i.disconnect(), i = void 0);
56
- }, d = k(() => {
57
- const f = ve(e), m = (Array.isArray(f) ? f : [f]).map(X).filter(nt);
58
- return new Set(m);
59
- }), s = L(
60
- () => d.value,
61
- (f) => {
62
- r(), l.value && f.size && (i = new MutationObserver(t), f.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
- s(), r();
88
+ ), u = () => c == null ? void 0 : c.takeRecords(), m = () => {
89
+ l(), o();
67
90
  };
68
- return Ne(u), {
69
- isSupported: l,
70
- stop: u,
71
- takeRecords: c
91
+ return pe(m), {
92
+ isSupported: r,
93
+ stop: m,
94
+ takeRecords: u
72
95
  };
73
96
  }
74
- function ct(e = {}) {
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();
126
+ };
127
+ return pe(l), l;
128
+ }
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 s;
82
- let c = i == null ? void 0 : i.activeElement;
83
- if (o)
84
- for (; c != null && c.shadowRoot; )
85
- c = (s = c == null ? void 0 : c.shadowRoot) == null ? void 0 : s.activeElement;
86
- return c;
87
- }, r = y(), d = () => {
88
- r.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 && (q(n, "blur", (s) => {
91
- s.relatedTarget === null && d();
92
- }, !0), q(n, "focus", d, !0)), a && it(i, (s) => {
93
- s.filter((c) => c.removedNodes.length).map((c) => Array.from(c.removedNodes)).flat().forEach((c) => {
94
- c === r.value && d();
95
- });
96
- }, {
97
- childList: !0,
98
- subtree: !0
99
- }), d(), r;
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 ut = "focusin", dt = "focusout";
102
- function ft(e, t = {}) {
103
- const { window: n = Q } = t, o = k(() => X(e)), a = y(!1), i = k(() => a.value), l = ct(t);
104
- return !n || !l.value ? { focused: i } : (q(o, ut, () => a.value = !0), q(o, dt, () => 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 mt(e, { window: t = Q, scrollTarget: n } = {}) {
107
- const o = y(!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 = X(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 r = l.getBoundingClientRect();
114
- o.value = r.top <= (t.innerHeight || i.documentElement.clientHeight) && r.left <= (t.innerWidth || i.documentElement.clientWidth) && r.bottom >= 0 && r.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 L(
118
- () => X(e),
119
- () => a(),
188
+ return P(
189
+ () => z(e),
190
+ () => i(),
120
191
  { immediate: !0, flush: "post" }
121
- ), t && q(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 W = (e) => {
127
- let t = mt(e).value;
197
+ const H = (e) => {
198
+ let t = xt(e).value;
128
199
  return t = t && e.offsetHeight > 0, t;
129
- }, D = (e) => e.tabIndex >= 0, Ae = (e) => {
200
+ }, W = (e) => e.tabIndex >= 0, Se = (e) => {
130
201
  const t = e.target;
131
- return pe(t);
132
- }, pe = (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 && (!D(n) || !W(n)) ? pe(n) : n;
146
- }, vt = (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 && (!D(o) || !W(o)) ? he(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 he(t);
167
- }, he = (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 && (!D(n) || !W(n)) ? he(n) : n;
181
- }, pt = (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 && (!D(o) || !W(o)) ? pe(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 we(t);
202
- }, we = (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 && (!D(n) || !W(n)) ? we(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 ge(t);
215
- }, ge = (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 && (!D(n) || !W(n)) ? ge(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 && (!D(n) || !W(n)) ? ge(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 && (!D(n) || !W(n)) ? we(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
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 = vt(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 = pt(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 be(e) {
301
- const t = (l) => {
302
- let r = null;
303
- return l.parent && (typeof l.parent == "string" ? r = document.querySelector(l.parent) : l.parent instanceof HTMLElement ? r = l.parent : r = l.parent.value), r;
304
- }, n = (l) => {
305
- var r;
306
- const d = t(l);
307
- let s = [];
308
- if (typeof l.selectors == "string")
309
- s = d ? Array.from(d.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 ? s.push(c) : s.push(c.$el);
313
- else if (l.selectors instanceof HTMLElement)
314
- s.push(l.selectors);
315
- else if ((r = l.selectors) != null && r.value)
316
- if (Array.isArray(l.selectors.value))
317
- for (const c of l.selectors.value)
318
- c instanceof HTMLElement ? s.push(c) : s.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
- s.push(l.selectors.value);
321
- return s;
322
- }, o = (l) => {
323
- const r = t(l);
324
- let d = [];
325
- return l.selectors ? d = n(l) : r && (d = Array.from(r.children).filter((s) => D(s) && W(s))), d;
326
- }, a = (l) => (r) => {
327
- const d = ht[r.key] || r.key.toLowerCase();
328
- if (ee.includes(d)) return;
329
- const s = l.handlers || ye;
330
- for (const c of Object.keys(s)) {
331
- const [u, ...f] = c.split(".");
332
- if (u === "keydown" && f.includes(d)) {
333
- const m = s[c], x = f.filter((p) => ee.includes(p)), v = ee.some((p) => {
334
- const E = p.charAt(0).toUpperCase() + p.slice(1);
335
- return r.getModifierState(E);
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 (x.length > 0) {
338
- if (v) {
339
- for (const p of ee)
340
- if (f.includes(p)) {
341
- const E = p.charAt(0).toUpperCase() + p.slice(1);
342
- r.getModifierState(E) && m(r);
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(r);
417
+ x || f(o);
347
418
  }
348
419
  }
349
- }, i = [];
350
- G(() => {
351
- for (const l of e) {
352
- const r = t(l), d = o(l), s = a(l), c = r ? [r] : d;
353
- for (const u of c) {
354
- const { focused: f } = ft(y(u)), m = L(f, (x) => {
355
- x ? u.addEventListener("keydown", s) : u.removeEventListener("keydown", s);
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
- }), Je(() => {
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 Le() ? (Pe(e), !0) : !1;
367
- }
368
- function O(e) {
369
- return typeof e == "function" ? e() : g(e);
436
+ function te(e) {
437
+ return We() ? (Ne(e), !0) : !1;
370
438
  }
371
- const xe = 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 wt = (e) => e != null, gt = Object.prototype.toString, Ve = (e) => gt.call(e) === "[object Object]", H = () => {
374
- }, ue = /* @__PURE__ */ yt();
375
- function yt() {
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 xe && ((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 bt(e) {
380
- return fe();
447
+ function St(e) {
448
+ return me();
381
449
  }
382
- function xt(...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 Qe(...e);
455
+ return tt(...e);
385
456
  const t = e[0];
386
- return typeof t == "function" ? Ze(Ke(() => ({ get: t, set: H }))) : y(t);
457
+ return typeof t == "function" ? nt(ot(() => ({ get: t, set: N }))) : R(t);
387
458
  }
388
- function Et(e, t = !0, n) {
389
- bt() ? G(e, n) : t ? e() : We(e);
459
+ function Mt(e, t = !0, n) {
460
+ St() ? _(e, n) : t ? e() : Ve(e);
390
461
  }
391
- const le = xe ? window : void 0;
392
- function N(e) {
462
+ function Fe(e, t, n) {
463
+ return P(
464
+ e,
465
+ t,
466
+ {
467
+ ...n,
468
+ immediate: !0
469
+ }
470
+ );
471
+ }
472
+ const Ce = Ee ? window : void 0;
473
+ function F(e) {
393
474
  var t;
394
- const n = O(e);
475
+ const n = k(e);
395
476
  return (t = n == null ? void 0 : n.$el) != null ? t : n;
396
477
  }
397
- function de(...e) {
398
- let t, n, o, a;
399
- if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, o, a] = e, t = le) : [t, n, o, a] = e, !t)
400
- return H;
401
- Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
402
- const i = [], l = () => {
403
- i.forEach((c) => c()), i.length = 0;
404
- }, r = (c, u, f, m) => (c.addEventListener(u, f, m), () => c.removeEventListener(u, f, m)), d = L(
405
- () => [N(t), O(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 f = Ve(u) ? { ...u } : u;
410
- i.push(
411
- ...n.flatMap((m) => o.map((x) => r(c, m, x, f)))
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" }
415
- ), s = () => {
416
- d(), l();
507
+ { flush: "post" }
508
+ ), r = () => {
509
+ c(), n();
417
510
  };
418
- return Z(s), s;
511
+ return te(n), r;
419
512
  }
420
- function Ct() {
421
- const e = y(!1), t = fe();
422
- return t && G(() => {
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 je(e) {
427
- const t = Ct();
428
- return k(() => (t.value, !!e()));
519
+ function Ue(e) {
520
+ const t = Rt();
521
+ return C(() => (t.value, !!e()));
429
522
  }
430
- function Be(e, t, n = {}) {
431
- const { window: o = le, ...a } = n;
432
- let i;
433
- const l = je(() => o && "MutationObserver" in o), r = () => {
434
- i && (i.disconnect(), i = void 0);
435
- }, d = k(() => {
436
- const f = O(e), m = (Array.isArray(f) ? f : [f]).map(N).filter(wt);
437
- return new Set(m);
438
- }), s = L(
439
- () => d.value,
440
- (f) => {
441
- r(), l.value && f.size && (i = new MutationObserver(t), f.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
- s(), r();
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 kt(e, t, n = {}) {
454
- const { window: o = le, ...a } = n;
455
- let i;
456
- const l = je(() => o && "ResizeObserver" in o), r = () => {
457
- i && (i.disconnect(), i = void 0);
458
- }, d = k(() => {
459
- const u = O(e);
460
- return Array.isArray(u) ? u.map((f) => N(f)) : [N(u)];
461
- }), s = L(
462
- d,
463
- (u) => {
464
- if (r(), l.value && o) {
465
- i = new ResizeObserver(t);
466
- for (const f of u)
467
- f && i.observe(f, 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
- r(), s();
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 ze(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, r = y(0), d = y(0), s = y(0), c = y(0), u = y(0), f = y(0), m = y(0), x = y(0);
487
- function v() {
488
- const E = N(e);
489
- if (!E) {
490
- n && (r.value = 0, d.value = 0, s.value = 0, c.value = 0, u.value = 0, f.value = 0, m.value = 0, x.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 = E.getBoundingClientRect();
494
- r.value = b.height, d.value = b.bottom, s.value = b.left, c.value = b.right, u.value = b.top, f.value = b.width, m.value = b.x, x.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 kt(e, p), L(() => N(e), (E) => !E && p()), Be(e, p, {
592
+ return Ot(e, d), P(() => F(e), (w) => !w && d()), qe(e, d, {
500
593
  attributeFilter: ["style", "class"]
501
- }), a && de("scroll", p, { capture: !0, passive: !0 }), o && de("resize", p, { passive: !0 }), Et(() => {
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: r,
505
- bottom: d,
506
- left: s,
507
- right: c,
508
- top: u,
509
- width: f,
510
- x: m,
511
- y: x,
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
- function At(e = {}) {
516
- const { window: t = le, behavior: n = "auto" } = e;
517
- if (!t)
518
- return {
519
- x: y(0),
520
- y: y(0)
521
- };
522
- const o = y(t.scrollX), a = y(t.scrollY), i = k({
523
- get() {
524
- return o.value;
525
- },
526
- set(r) {
527
- scrollTo({ left: r, behavior: n });
528
- }
529
- }), l = k({
530
- get() {
531
- return a.value;
532
- },
533
- set(r) {
534
- scrollTo({ top: r, behavior: n });
535
- }
536
- });
537
- return de(
538
- t,
539
- "scroll",
540
- () => {
541
- o.value = t.scrollX, a.value = t.scrollY;
542
- },
543
- {
544
- capture: !1,
545
- passive: !0
546
- }
547
- ), { x: i, y: l };
548
- }
549
- const It = (e) => {
608
+ const Lt = (e) => {
550
609
  const t = new DOMParser().parseFromString(e, "text/html");
551
610
  return Array.from(t.body.childNodes).some((n) => n.nodeType === 1);
552
- }, $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 }, Fe = /* @__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({
553
612
  __name: "ACell",
554
613
  props: {
555
614
  colIndex: {},
@@ -561,73 +620,73 @@ const It = (e) => {
561
620
  },
562
621
  emits: ["cellInput"],
563
622
  setup(e, { emit: t }) {
564
- const n = t, o = J("cell"), a = e.store.getCellData(e.colIndex, e.rowIndex), i = y(""), l = y(!1), r = e.store.columns[e.colIndex], d = e.store.rows[e.rowIndex], s = r.align || "center", c = r.width || "40ch", u = k(() => e.store.getCellDisplayValue(e.colIndex, e.rowIndex)), f = k(() => typeof u.value == "string" ? It(u.value) : !1), m = k(() => {
565
- 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;
566
625
  return {
567
- textAlign: s,
568
- width: c,
569
- fontWeight: l.value ? "bold" : "inherit",
570
- 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)
571
630
  };
572
- }), x = k(() => ({
631
+ }), b = C(() => ({
573
632
  "sticky-column": e.pinned,
574
- "cell-modified": l.value
575
- })), v = () => {
576
- const { left: b, bottom: S, width: re, height: _ } = ze(o);
577
- r.mask, r.modalComponent && e.store.$patch((M) => {
578
- 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 = re, M.modal.height = _, typeof r.modalComponent == "function" ? M.modal.component = r.modalComponent({ table: M.table, row: d, column: r }) : M.modal.component = r.modalComponent, M.modal.componentProps = r.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;
579
638
  });
580
639
  };
581
640
  if (e.addNavigation) {
582
- let b = {
641
+ let h = {
583
642
  ...ye,
584
- "keydown.f2": v,
585
- "keydown.alt.up": v,
586
- "keydown.alt.down": v,
587
- "keydown.alt.left": v,
588
- "keydown.alt.right": v
643
+ "keydown.f2": x,
644
+ "keydown.alt.up": x,
645
+ "keydown.alt.down": x,
646
+ "keydown.alt.left": x,
647
+ "keydown.alt.right": x
589
648
  };
590
- typeof e.addNavigation == "object" && (b = {
591
- ...b,
649
+ typeof e.addNavigation == "object" && (h = {
650
+ ...h,
592
651
  ...e.addNavigation
593
- }), be([
652
+ }), xe([
594
653
  {
595
- selectors: o,
596
- handlers: b
654
+ selectors: s,
655
+ handlers: h
597
656
  }
598
657
  ]);
599
658
  }
600
- const p = () => {
601
- o.value && (i.value = o.value.textContent);
602
- }, E = (b) => {
603
- const S = b.target;
604
- S.textContent !== i.value && (n("cellInput", e.colIndex, e.rowIndex, S.textContent, i.value), i.value = S.textContent, r.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)));
605
664
  };
606
- return (b, S) => (C(), I("td", {
665
+ return (h, S) => (E(), $("td", {
607
666
  ref: "cell",
608
- "data-colindex": b.colIndex,
609
- "data-rowindex": b.rowIndex,
610
- "data-editable": g(r).edit,
611
- contenteditable: g(r).edit,
612
- 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,
613
672
  spellcheck: !1,
614
- style: z(m.value),
615
- onFocus: p,
616
- onPaste: E,
617
- onInput: E,
618
- onClick: v,
619
- class: F(["atable-cell", x.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])
620
679
  }, [
621
- g(r).cellComponent ? (C(), te(De(g(r).cellComponent), me({
680
+ y(o).cellComponent ? (E(), se(je(y(o).cellComponent), ve({
622
681
  key: 0,
623
- value: u.value
624
- }, g(r).cellComponentProps), null, 16, ["value"])) : f.value ? (C(), I("span", {
682
+ value: m.value
683
+ }, y(o).cellComponentProps), null, 16, ["value"])) : v.value ? (E(), $("span", {
625
684
  key: 1,
626
- innerHTML: u.value
627
- }, null, 8, Tt)) : (C(), I("span", Mt, Y(u.value), 1))
628
- ], 46, St));
685
+ innerHTML: m.value
686
+ }, null, 8, Ht)) : (E(), $("span", Wt, Q(m.value), 1))
687
+ ], 46, Dt));
629
688
  }
630
- }), Rt = ["tabindex"], Ot = ["tabindex"], Lt = ["colspan"], Pt = /* @__PURE__ */ V({
689
+ }), Nt = ["tabindex"], Vt = ["tabindex"], jt = ["colspan"], Bt = /* @__PURE__ */ U({
631
690
  __name: "AExpansionRow",
632
691
  props: {
633
692
  rowIndex: {},
@@ -636,55 +695,55 @@ const It = (e) => {
636
695
  addNavigation: { type: [Boolean, Object] }
637
696
  },
638
697
  setup(e) {
639
- 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 ? "▼" : "►");
640
699
  if (e.addNavigation) {
641
- const o = {
642
- "keydown.control.g": (a) => {
643
- 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);
644
703
  }
645
704
  };
646
- typeof e.addNavigation == "object" && Object.assign(o, e.addNavigation), be([
705
+ typeof e.addNavigation == "object" && Object.assign(s, e.addNavigation), xe([
647
706
  {
648
707
  selectors: t,
649
- handlers: o
708
+ handlers: s
650
709
  }
651
710
  ]);
652
711
  }
653
- return (o, a) => (C(), I(oe, null, [
654
- P("tr", me(o.$attrs, {
712
+ return (s, i) => (E(), $(ae, null, [
713
+ D("tr", ve(s.$attrs, {
655
714
  ref: "rowEl",
656
- tabindex: o.tabIndex,
715
+ tabindex: s.tabIndex,
657
716
  class: "expandable-row"
658
717
  }), [
659
- P("td", {
718
+ D("td", {
660
719
  tabIndex: -1,
661
- onClick: a[0] || (a[0] = (i) => o.store.toggleRowExpand(o.rowIndex)),
720
+ onClick: i[0] || (i[0] = (c) => s.store.toggleRowExpand(s.rowIndex)),
662
721
  class: "row-index"
663
- }, Y(n.value), 1),
664
- R(o.$slots, "row", {}, void 0, !0)
665
- ], 16, Rt),
666
- 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", {
667
726
  key: 0,
668
727
  ref: "rowExpanded",
669
- tabindex: o.tabIndex,
728
+ tabindex: s.tabIndex,
670
729
  class: "expanded-row"
671
730
  }, [
672
- P("td", {
731
+ D("td", {
673
732
  tabIndex: -1,
674
- colspan: o.store.columns.length + 1,
733
+ colspan: s.store.columns.length + 1,
675
734
  class: "expanded-row-content"
676
735
  }, [
677
- R(o.$slots, "content", {}, void 0, !0)
678
- ], 8, Lt)
679
- ], 8, Ot)) : U("", !0)
736
+ L(s.$slots, "content", {}, void 0, !0)
737
+ ], 8, jt)
738
+ ], 8, Vt)) : Z("", !0)
680
739
  ], 64));
681
740
  }
682
- }), K = (e, t) => {
741
+ }), ne = (e, t) => {
683
742
  const n = e.__vccOpts || e;
684
- for (const [o, a] of t)
685
- n[o] = a;
743
+ for (const [s, i] of t)
744
+ n[s] = i;
686
745
  return n;
687
- }, Wt = /* @__PURE__ */ K(Pt, [["__scopeId", "data-v-60affd71"]]), Dt = ["tabindex"], Ht = /* @__PURE__ */ V({
746
+ }, zt = /* @__PURE__ */ ne(Bt, [["__scopeId", "data-v-60affd71"]]), Ft = ["tabindex"], Ut = /* @__PURE__ */ U({
688
747
  __name: "ARow",
689
748
  props: {
690
749
  rowIndex: {},
@@ -693,359 +752,382 @@ const It = (e) => {
693
752
  addNavigation: { type: [Boolean, Object], default: !1 }
694
753
  },
695
754
  setup(e) {
696
- 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));
697
756
  if (e.addNavigation) {
698
- let a = ye;
699
- typeof e.addNavigation == "object" && (a = {
700
- ...a,
757
+ let i = ye;
758
+ typeof e.addNavigation == "object" && (i = {
759
+ ...i,
701
760
  ...e.addNavigation
702
- }), be([
761
+ }), xe([
703
762
  {
704
763
  selectors: t,
705
- handlers: a
764
+ handlers: i
706
765
  }
707
766
  ]);
708
767
  }
709
- return (a, i) => ie((C(), I("tr", {
768
+ return (i, c) => ce((E(), $("tr", {
710
769
  ref: "rowEl",
711
- tabindex: a.tabIndex,
770
+ tabindex: i.tabIndex,
712
771
  class: "atable-row"
713
772
  }, [
714
- a.store.config.view !== "uncounted" ? R(a.$slots, "index", { key: 0 }, () => [
715
- 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", {
716
775
  key: 0,
717
776
  tabIndex: -1,
718
- class: F(["list-index", a.store.hasPinnedColumns ? "sticky-index" : ""])
719
- }, Y(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", {
720
779
  key: 1,
721
780
  tabIndex: -1,
722
- class: F(["tree-index", a.store.hasPinnedColumns ? "sticky-index" : ""]),
723
- onClick: i[0] || (i[0] = (l) => a.store.toggleRowExpand(a.rowIndex))
724
- }, Y(o.value), 3)) : U("", !0)
725
- ], !0) : U("", !0),
726
- R(a.$slots, "default", {}, void 0, !0)
727
- ], 8, Dt)), [
728
- [He, 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]
729
788
  ]);
730
789
  }
731
- }), Ye = /* @__PURE__ */ K(Ht, [["__scopeId", "data-v-e02365ea"]]), Ue = xe ? window : void 0;
732
- function B(e) {
790
+ }), Xe = /* @__PURE__ */ ne(Ut, [["__scopeId", "data-v-9c529d3d"]]), Je = Ee ? window : void 0;
791
+ function G(e) {
733
792
  var t;
734
- const n = O(e);
793
+ const n = k(e);
735
794
  return (t = n == null ? void 0 : n.$el) != null ? t : n;
736
795
  }
737
- function ne(...e) {
738
- let t, n, o, a;
739
- if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, o, a] = e, t = Ue) : [t, n, o, a] = e, !t)
740
- return H;
741
- Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
742
- const i = [], l = () => {
743
- i.forEach((c) => c()), i.length = 0;
744
- }, r = (c, u, f, m) => (c.addEventListener(u, f, m), () => c.removeEventListener(u, f, m)), d = L(
745
- () => [B(t), O(a)],
746
- ([c, u]) => {
747
- 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))
748
815
  return;
749
- const f = Ve(u) ? { ...u } : u;
750
- i.push(
751
- ...n.flatMap((m) => o.map((x) => r(c, m, x, f)))
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
+ )
752
823
  );
753
824
  },
754
- { immediate: !0, flush: "post" }
755
- ), s = () => {
756
- d(), l();
825
+ { flush: "post" }
826
+ ), r = () => {
827
+ c(), n();
757
828
  };
758
- return Z(s), s;
829
+ return te(n), r;
759
830
  }
760
- let Re = !1;
761
- function Oe(e, t, n = {}) {
762
- const { window: o = Ue, ignore: a = [], capture: i = !0, detectIframe: l = !1 } = n;
763
- if (!o)
764
- return H;
765
- ue && !Re && (Re = !0, Array.from(o.document.body.children).forEach((v) => v.addEventListener("click", H)), o.document.documentElement.addEventListener("click", H));
766
- let r = !0;
767
- const d = (v) => O(a).some((p) => {
768
- if (typeof p == "string")
769
- return Array.from(o.document.querySelectorAll(p)).some((E) => E === v.target || v.composedPath().includes(E));
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));
770
845
  {
771
- const E = B(p);
772
- return E && (v.target === E || v.composedPath().includes(E));
846
+ const h = G(w);
847
+ return h && (d.target === h || d.composedPath().includes(h));
773
848
  }
774
849
  });
775
- function s(v) {
776
- const p = O(v);
777
- return p && p.$.subTree.shapeFlag === 16;
850
+ function u(d) {
851
+ const w = k(d);
852
+ return w && w.$.subTree.shapeFlag === 16;
778
853
  }
779
- function c(v, p) {
780
- const E = O(v), b = E.$.subTree && E.$.subTree.children;
781
- 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));
782
857
  }
783
- const u = (v) => {
784
- const p = B(e);
785
- if (v.target != null && !(!(p instanceof Element) && s(e) && c(e, v)) && !(!p || p === v.target || v.composedPath().includes(p))) {
786
- if (v.detail === 0 && (r = !d(v)), !r) {
787
- r = !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;
788
863
  return;
789
864
  }
790
- t(v);
865
+ t(d);
791
866
  }
792
867
  };
793
868
  let f = !1;
794
- const m = [
795
- ne(o, "click", (v) => {
869
+ const b = [
870
+ B(s, "click", (d) => {
796
871
  f || (f = !0, setTimeout(() => {
797
872
  f = !1;
798
- }, 0), u(v));
799
- }, { passive: !0, capture: i }),
800
- ne(o, "pointerdown", (v) => {
801
- const p = B(e);
802
- r = !d(v) && !!(p && !v.composedPath().includes(p));
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));
803
878
  }, { passive: !0 }),
804
- l && ne(o, "blur", (v) => {
879
+ r && B(s, "blur", (d) => {
805
880
  setTimeout(() => {
806
- var p;
807
- const E = B(e);
808
- ((p = o.document.activeElement) == null ? void 0 : p.tagName) === "IFRAME" && !(E != null && E.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);
809
884
  }, 0);
810
- })
811
- ].filter(Boolean);
812
- 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;
813
896
  }
814
- const Nt = {
897
+ const qt = {
815
898
  mounted(e, t) {
816
899
  const n = !t.modifiers.bubble;
817
900
  if (typeof t.value == "function")
818
- e.__onClickOutside_stop = Oe(e, t.value, { capture: n });
901
+ e.__onClickOutside_stop = He(e, t.value, { capture: n });
819
902
  else {
820
- const [o, a] = t.value;
821
- 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));
822
905
  }
823
906
  },
824
907
  unmounted(e) {
825
908
  e.__onClickOutside_stop();
826
909
  }
827
910
  };
828
- function se(e) {
911
+ function ie(e) {
829
912
  return typeof Window < "u" && e instanceof Window ? e.document.documentElement : typeof Document < "u" && e instanceof Document ? e.documentElement : e;
830
913
  }
831
- function Xe(e) {
914
+ function Qe(e) {
832
915
  const t = window.getComputedStyle(e);
833
916
  if (t.overflowX === "scroll" || t.overflowY === "scroll" || t.overflowX === "auto" && e.clientWidth < e.scrollWidth || t.overflowY === "auto" && e.clientHeight < e.scrollHeight)
834
917
  return !0;
835
918
  {
836
919
  const n = e.parentNode;
837
- return !n || n.tagName === "BODY" ? !1 : Xe(n);
920
+ return !n || n.tagName === "BODY" ? !1 : Qe(n);
838
921
  }
839
922
  }
840
- function Vt(e) {
923
+ function Yt(e) {
841
924
  const t = e || window.event, n = t.target;
842
- return Xe(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);
843
926
  }
844
- const ae = /* @__PURE__ */ new WeakMap();
845
- function jt(e, t = !1) {
846
- const n = y(t);
847
- let o = null, a = "";
848
- L(xt(e), (r) => {
849
- const d = se(O(r));
850
- if (d) {
851
- const s = d;
852
- if (ae.get(s) || ae.set(s, s.style.overflow), s.style.overflow !== "hidden" && (a = s.style.overflow), s.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")
853
936
  return n.value = !0;
854
937
  if (n.value)
855
- return s.style.overflow = "hidden";
938
+ return l.style.overflow = "hidden";
856
939
  }
857
940
  }, {
858
941
  immediate: !0
859
942
  });
860
- const i = () => {
861
- const r = se(O(e));
862
- !r || n.value || (ue && (o = ne(
863
- r,
943
+ const c = () => {
944
+ const o = ie(k(e));
945
+ !o || n.value || (fe && (s = B(
946
+ o,
864
947
  "touchmove",
865
- (d) => {
866
- Vt(d);
948
+ (a) => {
949
+ Yt(a);
867
950
  },
868
951
  { passive: !1 }
869
- )), r.style.overflow = "hidden", n.value = !0);
870
- }, l = () => {
871
- const r = se(O(e));
872
- !r || !n.value || (ue && (o == null || o()), r.style.overflow = a, ae.delete(r), 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);
873
956
  };
874
- return Z(l), k({
957
+ return te(r), C({
875
958
  get() {
876
959
  return n.value;
877
960
  },
878
- set(r) {
879
- r ? i() : l();
961
+ set(o) {
962
+ o ? c() : r();
880
963
  }
881
964
  });
882
965
  }
883
- function Bt() {
966
+ function Xt() {
884
967
  let e = !1;
885
- const t = y(!1);
886
- return (n, o) => {
887
- if (t.value = o.value, e)
968
+ const t = O(!1);
969
+ return (n, s) => {
970
+ if (t.value = s.value, e)
888
971
  return;
889
972
  e = !0;
890
- const a = jt(n, o.value);
891
- L(t, (i) => a.value = i);
973
+ const i = Gt(n, s.value);
974
+ P(t, (c) => i.value = c);
892
975
  };
893
976
  }
894
- Bt();
895
- const zt = {
977
+ Xt();
978
+ const Jt = {
896
979
  key: 0,
897
980
  id: "resizable"
898
- }, Ft = {
981
+ }, Qt = {
899
982
  class: "atable-header-row",
900
983
  tabindex: "-1"
901
- }, qe = /* @__PURE__ */ V({
984
+ }, Ze = /* @__PURE__ */ U({
902
985
  __name: "ATableHeader",
903
986
  props: {
904
987
  columns: {},
905
988
  store: {}
906
989
  },
907
990
  setup(e) {
908
- return (t, n) => t.columns.length ? (C(), I("thead", zt, [
909
- P("tr", Ft, [
910
- 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", {
911
994
  key: 0,
912
995
  id: "header-index",
913
- class: F([[
996
+ class: X([[
914
997
  t.store.hasPinnedColumns ? "sticky-index" : "",
915
998
  t.store.config.view === "tree" ? "tree-index" : "",
916
999
  t.store.config.view === "list-expansion" ? "list-expansion-index" : ""
917
1000
  ], "list-index"])
918
- }, null, 2)) : U("", !0),
919
- (C(!0), I(oe, null, ce(t.columns, (o, a) => (C(), I("th", {
920
- key: o.name,
1001
+ }, null, 2)) : Z("", !0),
1002
+ (E(!0), $(ae, null, de(t.columns, (s, i) => (E(), $("th", {
1003
+ key: s.name,
921
1004
  tabindex: "-1",
922
- style: z(t.store.getHeaderCellStyle(o)),
923
- class: F(o.pinned ? "sticky-column" : "")
1005
+ style: J(t.store.getHeaderCellStyle(s)),
1006
+ class: X(s.pinned ? "sticky-column" : "")
924
1007
  }, [
925
- R(t.$slots, "default", {}, () => [
926
- _e(Y(o.label || String.fromCharCode(a + 97).toUpperCase()), 1)
1008
+ L(t.$slots, "default", {}, () => [
1009
+ lt(Q(s.label || String.fromCharCode(i + 97).toUpperCase()), 1)
927
1010
  ])
928
1011
  ], 6))), 128))
929
1012
  ])
930
- ])) : U("", !0);
1013
+ ])) : Z("", !0);
931
1014
  }
932
- }), Ge = /* @__PURE__ */ V({
1015
+ }), Ke = /* @__PURE__ */ U({
933
1016
  __name: "ATableModal",
934
1017
  props: {
935
1018
  store: {}
936
1019
  },
937
1020
  setup(e) {
938
- const t = J("amodal"), { width: n, height: o } = ze(t), { y: a } = At(), i = k(() => {
1021
+ const t = ee("amodal"), { width: n, height: s } = Ye(t), i = C(() => {
1022
+ var m, v, f, b;
939
1023
  if (!(e.store.modal.height && e.store.modal.width && e.store.modal.left && e.store.modal.bottom)) return;
940
- const r = document.body, d = document.documentElement, s = Math.max(
941
- r.scrollHeight,
942
- r.offsetHeight,
943
- d.clientHeight,
944
- d.scrollHeight,
945
- d.offsetHeight
946
- ), c = Math.max(r.scrollWidth, r.offsetWidth, d.clientWidth, d.scrollWidth, d.offsetWidth), u = e.store.modal.bottom + o.value + a.value <= s ? e.store.modal.bottom : e.store.modal.bottom - o.value - e.store.modal.height;
947
- return {
948
- left: `${e.store.modal.left + n.value <= c ? e.store.modal.left : e.store.modal.left - (n.value - e.store.modal.width)}px`,
949
- top: `${u}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`
950
1032
  };
951
- }), l = (r) => {
952
- r.stopPropagation();
953
- };
954
- return (r, d) => (C(), I("div", {
1033
+ });
1034
+ return (c, r) => (E(), $("div", {
955
1035
  class: "amodal",
956
1036
  ref: "amodal",
957
1037
  tabindex: "-1",
958
- onClick: l,
959
- onInput: l,
960
- style: z(i.value)
1038
+ onClick: r[0] || (r[0] = Ie(() => {
1039
+ }, ["stop"])),
1040
+ onInput: r[1] || (r[1] = Ie(() => {
1041
+ }, ["stop"])),
1042
+ style: J(i.value)
961
1043
  }, [
962
- R(r.$slots, "default")
1044
+ L(c.$slots, "default")
963
1045
  ], 36));
964
1046
  }
965
- }), Yt = (e) => {
966
- const t = e.id || $t();
967
- return et(`table-${t}`, () => {
968
- const o = () => {
969
- const h = {};
970
- for (const [w, A] of i.value.entries())
971
- for (const [$, T] of l.value.entries())
972
- h[`${w}:${$}`] = T[A.name];
973
- return h;
974
- }, a = (h) => {
975
- const w = [Object.assign({}, { rowModified: !1 })];
976
- if (h && "0:0" in h)
977
- return h;
978
- const A = /* @__PURE__ */ new Set();
979
- for (let $ = l.value.length - 1; $ >= 0; $--) {
980
- const T = l.value[$];
981
- T.parent && A.add(T.parent), w[$] = {
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] = {
982
1064
  childrenOpen: !1,
983
1065
  expanded: !1,
984
1066
  indent: T.indent || 0,
985
- isParent: A.has($),
1067
+ isParent: I.has(A),
986
1068
  isRoot: T.parent === null || T.parent === void 0,
987
1069
  rowModified: !1,
988
1070
  open: T.parent === null || T.parent === void 0,
989
1071
  parent: T.parent
990
1072
  };
991
1073
  }
992
- return w;
993
- }, i = y(e.columns), l = y(e.rows), r = y(e.config || {}), d = y(e.table || o()), s = y(a(e.display)), c = y(e.modal || { visible: !1 }), u = y({}), f = k(() => i.value.some((h) => h.pinned)), m = k(() => `${Math.ceil(l.value.length / 100 + 1)}ch`), x = k(
994
- () => r.value.view ? ["list", "tree", "list-expansion"].includes(r.value.view) : !1
995
- ), v = (h, w) => d.value[`${h}:${w}`], p = (h, w, A) => {
996
- const $ = `${h}:${w}`, T = i.value[h];
997
- d.value[$] !== A && (s.value[w].rowModified = !0), d.value[$] = A, l.value[w][T.name] = A;
998
- }, E = (h, w, A) => {
999
- const $ = `${h}:${w}`;
1000
- d.value[$] !== A && (s.value[w].rowModified = !0, u.value[$] = A);
1001
- }, b = (h) => ({
1002
- minWidth: h.width || "40ch",
1003
- textAlign: h.align || "center",
1004
- width: r.value.fullWidth ? "auto" : void 0
1005
- }), S = (h) => r.value.view !== "tree" || s.value[h].isRoot || s.value[h].open, re = (h) => r.value.view !== "tree" ? "" : s.value[h].isRoot || s.value[h].isParent ? s.value[h].childrenOpen ? "-" : "+" : "", _ = (h) => {
1006
- if (r.value.view === "tree") {
1007
- s.value[h].childrenOpen = !s.value[h].childrenOpen;
1008
- for (let w = l.value.length - 1; w >= 0; w--)
1009
- s.value[w].parent === h && (s.value[w].open = !s.value[w].open, s.value[w].childrenOpen && _(w));
1010
- } else r.value.view === "list-expansion" && (s.value[h].expanded = !s.value[h].expanded);
1011
- }, M = (h, w) => {
1012
- const A = v(h, w);
1013
- return Ee(h, w, A);
1014
- }, Ee = (h, w, A) => {
1015
- const $ = i.value[h], T = l.value[w], j = $.format;
1016
- return j ? typeof j == "function" ? j(A, { table: d.value, row: T, column: $ }) : typeof j == "string" ? Function(`"use strict";return (${j})`)()(A, { table: d.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;
1017
1099
  };
1018
1100
  return {
1019
1101
  // state
1020
- columns: i,
1021
- config: r,
1022
- display: s,
1023
- modal: c,
1024
- rows: l,
1025
- table: d,
1026
- updates: u,
1102
+ columns: c,
1103
+ config: o,
1104
+ display: l,
1105
+ modal: u,
1106
+ rows: r,
1107
+ table: a,
1108
+ updates: m,
1027
1109
  // getters
1028
- hasPinnedColumns: f,
1029
- numberedRowWidth: m,
1030
- zeroColumn: x,
1110
+ hasPinnedColumns: v,
1111
+ numberedRowWidth: f,
1112
+ zeroColumn: b,
1031
1113
  // actions
1032
- closeModal: (h) => {
1033
- var w;
1034
- h.target instanceof Node && (w = c.value.parent) != null && w.contains(h.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);
1035
1117
  },
1036
- getCellData: v,
1118
+ getCellData: x,
1037
1119
  getCellDisplayValue: M,
1038
- getFormattedValue: Ee,
1039
- getHeaderCellStyle: b,
1040
- getIndent: (h, w) => w && h === 0 && w > 0 ? `${w}ch` : "inherit",
1041
- getRowExpandSymbol: re,
1120
+ getFormattedValue: ke,
1121
+ getHeaderCellStyle: h,
1122
+ getIndent: (p, g) => g && p === 0 && g > 0 ? `${g}ch` : "inherit",
1123
+ getRowExpandSymbol: j,
1042
1124
  isRowVisible: S,
1043
- setCellData: p,
1044
- setCellText: E,
1045
- toggleRowExpand: _
1125
+ setCellData: d,
1126
+ setCellText: w,
1127
+ toggleRowExpand: oe
1046
1128
  };
1047
1129
  })();
1048
- }, Ut = /* @__PURE__ */ V({
1130
+ }, Kt = /* @__PURE__ */ U({
1049
1131
  __name: "ATable",
1050
1132
  props: {
1051
1133
  id: {},
@@ -1056,140 +1138,140 @@ const zt = {
1056
1138
  },
1057
1139
  emits: ["update:modelValue", "cellUpdate"],
1058
1140
  setup(e, { expose: t, emit: n }) {
1059
- const o = n, a = J("table"), i = e.modelValue ? e.modelValue : e.rows, l = Yt({ columns: e.columns, rows: i, id: e.id, config: e.config });
1060
- l.$onAction(({ name: s, store: c, args: u, after: f }) => {
1061
- if (s === "setCellData") {
1062
- const [m, x, v] = u, p = c.getCellData(m, x);
1063
- f(() => {
1064
- o("cellUpdate", m, x, 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);
1065
1147
  });
1066
1148
  }
1067
- }), L(
1068
- () => l.rows,
1069
- (s) => {
1070
- o("update:modelValue", s);
1149
+ }), P(
1150
+ () => r.rows,
1151
+ (l) => {
1152
+ s("update:modelValue", l);
1071
1153
  },
1072
1154
  { deep: !0 }
1073
- ), G(() => {
1074
- e.columns.some((s) => s.pinned) && (d(), l.config.view === "tree" && Be(a, d, { childList: !0, subtree: !0 }));
1155
+ ), _(() => {
1156
+ e.columns.some((l) => l.pinned) && (a(), r.config.view === "tree" && qe(i, a, { childList: !0, subtree: !0 }));
1075
1157
  });
1076
- const r = (s, c, u, f) => {
1077
- o("cellUpdate", s, c, u, f);
1078
- }, d = () => {
1079
- const s = a.value, c = s == null ? void 0 : s.rows[0], u = s == null ? void 0 : s.rows[1], f = c ? Array.from(c.cells) : [];
1080
- for (const [m, x] of f.entries()) {
1081
- const v = u == null ? void 0 : u.cells[m];
1082
- v && (x.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`);
1083
1165
  }
1084
- for (const m of (s == null ? void 0 : s.rows) || []) {
1085
- let x = 0;
1086
- const v = [];
1087
- for (const p of m.cells)
1088
- (p.classList.contains("sticky-column") || p.classList.contains("sticky-index")) && (p.style.left = `${x}px`, x += p.offsetWidth, v.push(p));
1089
- 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");
1090
1172
  }
1091
1173
  };
1092
- return window.addEventListener("keydown", (s) => {
1093
- if (s.key === "Escape" && l.modal.visible) {
1094
- l.modal.visible = !1;
1095
- const c = l.modal.parent;
1096
- c && We().then(() => {
1097
- 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();
1098
1180
  });
1099
1181
  }
1100
- }), t({ store: l }), (s, c) => ie((C(), I("table", {
1182
+ }), t({ store: r }), (l, u) => ce((E(), $("table", {
1101
1183
  ref: "table",
1102
1184
  class: "atable",
1103
- style: z({ width: g(l).config.fullWidth ? "100%" : "auto" })
1185
+ style: J({ width: y(r).config.fullWidth ? "100%" : "auto" })
1104
1186
  }, [
1105
- R(s.$slots, "header", { data: g(l) }, () => [
1106
- Ce(qe, {
1107
- columns: g(l).columns,
1108
- store: g(l)
1187
+ L(l.$slots, "header", { data: y(r) }, () => [
1188
+ $e(Ze, {
1189
+ columns: y(r).columns,
1190
+ store: y(r)
1109
1191
  }, null, 8, ["columns", "store"])
1110
1192
  ], !0),
1111
- P("tbody", null, [
1112
- R(s.$slots, "body", { data: g(l) }, () => [
1113
- (C(!0), I(oe, null, ce(g(l).rows, (u, f) => (C(), te(Ye, {
1114
- key: u.id,
1115
- row: u,
1116
- rowIndex: f,
1117
- store: g(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)
1118
1200
  }, {
1119
- default: ke(() => [
1120
- (C(!0), I(oe, null, ce(g(l).columns, (m, x) => (C(), te(Fe, {
1121
- key: m.name,
1122
- store: g(l),
1123
- 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,
1124
1206
  spellcheck: "false",
1125
- pinned: m.pinned,
1126
- rowIndex: f,
1127
- colIndex: x,
1128
- component: m.cellComponent,
1129
- style: z({
1130
- textAlign: (m == null ? void 0 : m.align) || "center",
1131
- minWidth: (m == null ? void 0 : m.width) || "40ch",
1132
- width: g(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
1133
1215
  }),
1134
- onCellInput: r
1216
+ onCellInput: o
1135
1217
  }, null, 8, ["store", "col", "pinned", "rowIndex", "colIndex", "component", "style"]))), 128))
1136
1218
  ]),
1137
1219
  _: 2
1138
1220
  }, 1032, ["row", "rowIndex", "store"]))), 128))
1139
1221
  ], !0)
1140
1222
  ]),
1141
- R(s.$slots, "footer", { data: g(l) }, void 0, !0),
1142
- R(s.$slots, "modal", { data: g(l) }, () => [
1143
- ie(Ce(Ge, { store: g(l) }, {
1144
- default: ke(() => [
1145
- (C(), te(De(g(l).modal.component), me({
1146
- key: `${g(l).modal.rowIndex}:${g(l).modal.colIndex}`,
1147
- colIndex: g(l).modal.colIndex,
1148
- rowIndex: g(l).modal.rowIndex,
1149
- store: g(l)
1150
- }, g(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"]))
1151
1233
  ]),
1152
1234
  _: 1
1153
1235
  }, 8, ["store"]), [
1154
- [He, g(l).modal.visible]
1236
+ [Be, y(r).modal.visible]
1155
1237
  ])
1156
1238
  ], !0)
1157
1239
  ], 4)), [
1158
- [g(Nt), g(l).closeModal]
1240
+ [y(qt), y(r).closeModal]
1159
1241
  ]);
1160
1242
  }
1161
- }), Xt = /* @__PURE__ */ K(Ut, [["__scopeId", "data-v-bd5101d3"]]), qt = {}, Gt = { class: "aloading" }, Jt = { class: "aloading-header" };
1162
- function Qt(e, t) {
1163
- return C(), I("div", Gt, [
1164
- P("h2", Jt, [
1165
- 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)
1166
1248
  ]),
1167
- t[0] || (t[0] = P("div", { class: "aloading-bar" }, null, -1))
1249
+ t[0] || (t[0] = D("div", { class: "aloading-bar" }, null, -1))
1168
1250
  ]);
1169
1251
  }
1170
- const Zt = /* @__PURE__ */ K(qt, [["render", Qt], ["__scopeId", "data-v-a930a25b"]]), Kt = {}, _t = { class: "aloading" }, en = { class: "aloading-header" };
1171
- function tn(e, t) {
1172
- return C(), I("div", _t, [
1173
- P("h2", en, [
1174
- 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)
1175
1257
  ]),
1176
- t[0] || (t[0] = P("div", { class: "aloading-bar" }, null, -1))
1258
+ t[0] || (t[0] = D("div", { class: "aloading-bar" }, null, -1))
1177
1259
  ]);
1178
1260
  }
1179
- const nn = /* @__PURE__ */ K(Kt, [["render", tn], ["__scopeId", "data-v-e1165876"]]);
1180
- function cn(e) {
1181
- e.component("ACell", Fe), e.component("AExpansionRow", Wt), e.component("ARow", Ye), e.component("ATable", Xt), e.component("ATableHeader", qe), e.component("ATableLoading", Zt), e.component("ATableLoadingBar", nn), e.component("ATableModal", Ge);
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);
1182
1264
  }
1183
1265
  export {
1184
- Fe as ACell,
1185
- Wt as AExpansionRow,
1186
- Ye as ARow,
1187
- Xt as ATable,
1188
- qe as ATableHeader,
1189
- Zt as ATableLoading,
1190
- nn as ATableLoadingBar,
1191
- Ge as ATableModal,
1192
- Yt as createTableStore,
1193
- 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
1194
1276
  };
1195
1277
  //# sourceMappingURL=atable.js.map