@stonecrop/atable 0.4.9 → 0.4.10

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