@stonecrop/atable 0.2.61 → 0.2.63

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,7 +1,7 @@
1
1
  import './assets/index.css';var Ue = Object.defineProperty;
2
2
  var qe = (e, t, n) => t in e ? Ue(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var T = (e, t, n) => qe(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { onMounted as G, ref as b, watch as C, onBeforeUnmount as Ye, computed as x, unref as m, getCurrentScope as ie, onScopeDispose as se, getCurrentInstance as re, nextTick as Te, defineComponent as M, inject as Q, useTemplateRef as Z, openBlock as h, createElementBlock as k, normalizeStyle as P, normalizeClass as N, createBlock as Y, resolveDynamicComponent as De, mergeProps as ae, toDisplayString as B, Fragment as J, createElementVNode as W, renderSlot as S, createCommentVNode as V, withDirectives as ne, vShow as Me, toRef as Xe, readonly as Je, customRef as Qe, reactive as R, renderList as oe, createTextVNode as Ze, provide as Ke, createVNode as ye, withCtx as be } from "vue";
4
+ import { onMounted as G, ref as g, watch as C, onBeforeUnmount as Ye, computed as x, unref as m, getCurrentScope as ie, onScopeDispose as se, getCurrentInstance as re, nextTick as Te, defineComponent as M, inject as Q, useTemplateRef as Z, openBlock as y, createElementBlock as k, normalizeStyle as P, normalizeClass as N, createBlock as Y, resolveDynamicComponent as De, mergeProps as ae, toDisplayString as B, Fragment as J, createElementVNode as W, renderSlot as S, createCommentVNode as V, withDirectives as ne, vShow as Me, toRef as Xe, readonly as Je, customRef as Qe, reactive as R, renderList as oe, createTextVNode as Ze, provide as Ke, createVNode as ye, withCtx as be } from "vue";
5
5
  function Re(e) {
6
6
  return ie() ? (se(e), !0) : !1;
7
7
  }
@@ -18,30 +18,30 @@ function z(e) {
18
18
  return (t = n == null ? void 0 : n.$el) != null ? t : n;
19
19
  }
20
20
  function F(...e) {
21
- let t, n, l, i;
22
- if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, l, i] = e, t = U) : [t, n, l, i] = e, !t)
21
+ let t, n, o, i;
22
+ if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, o, i] = e, t = U) : [t, n, o, i] = e, !t)
23
23
  return ot;
24
- Array.isArray(n) || (n = [n]), Array.isArray(l) || (l = [l]);
25
- const o = [], a = () => {
26
- o.forEach((u) => u()), o.length = 0;
27
- }, s = (u, p, c, f) => (u.addEventListener(p, c, f), () => u.removeEventListener(p, c, f)), d = C(
24
+ Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
25
+ const s = [], l = () => {
26
+ s.forEach((d) => d()), s.length = 0;
27
+ }, a = (d, p, c, u) => (d.addEventListener(p, c, u), () => d.removeEventListener(p, c, u)), f = C(
28
28
  () => [z(t), ce(i)],
29
- ([u, p]) => {
30
- if (a(), !u)
29
+ ([d, p]) => {
30
+ if (l(), !d)
31
31
  return;
32
32
  const c = nt(p) ? { ...p } : p;
33
- o.push(
34
- ...n.flatMap((f) => l.map((v) => s(u, f, v, c)))
33
+ s.push(
34
+ ...n.flatMap((u) => o.map((v) => a(d, u, v, c)))
35
35
  );
36
36
  },
37
37
  { immediate: !0, flush: "post" }
38
38
  ), r = () => {
39
- d(), a();
39
+ f(), l();
40
40
  };
41
41
  return Re(r), r;
42
42
  }
43
43
  function lt() {
44
- const e = b(!1), t = re();
44
+ const e = g(!1), t = re();
45
45
  return t && G(() => {
46
46
  e.value = !0;
47
47
  }, t), e;
@@ -51,69 +51,69 @@ function it(e) {
51
51
  return x(() => (t.value, !!e()));
52
52
  }
53
53
  function st(e, t, n = {}) {
54
- const { window: l = U, ...i } = n;
55
- let o;
56
- const a = it(() => l && "MutationObserver" in l), s = () => {
57
- o && (o.disconnect(), o = void 0);
58
- }, d = x(() => {
59
- const c = ce(e), f = (Array.isArray(c) ? c : [c]).map(z).filter(et);
60
- return new Set(f);
54
+ const { window: o = U, ...i } = n;
55
+ let s;
56
+ const l = it(() => o && "MutationObserver" in o), a = () => {
57
+ s && (s.disconnect(), s = void 0);
58
+ }, f = x(() => {
59
+ const c = ce(e), u = (Array.isArray(c) ? c : [c]).map(z).filter(et);
60
+ return new Set(u);
61
61
  }), r = C(
62
- () => d.value,
62
+ () => f.value,
63
63
  (c) => {
64
- s(), a.value && c.size && (o = new MutationObserver(t), c.forEach((f) => o.observe(f, i)));
64
+ a(), l.value && c.size && (s = new MutationObserver(t), c.forEach((u) => s.observe(u, i)));
65
65
  },
66
66
  { immediate: !0, flush: "post" }
67
- ), u = () => o == null ? void 0 : o.takeRecords(), p = () => {
68
- r(), s();
67
+ ), d = () => s == null ? void 0 : s.takeRecords(), p = () => {
68
+ r(), a();
69
69
  };
70
70
  return Re(p), {
71
- isSupported: a,
71
+ isSupported: l,
72
72
  stop: p,
73
- takeRecords: u
73
+ takeRecords: d
74
74
  };
75
75
  }
76
76
  function rt(e = {}) {
77
77
  var t;
78
78
  const {
79
79
  window: n = U,
80
- deep: l = !0,
80
+ deep: o = !0,
81
81
  triggerOnRemoval: i = !1
82
- } = e, o = (t = e.document) != null ? t : n == null ? void 0 : n.document, a = () => {
82
+ } = e, s = (t = e.document) != null ? t : n == null ? void 0 : n.document, l = () => {
83
83
  var r;
84
- let u = o == null ? void 0 : o.activeElement;
85
- if (l)
86
- for (; u != null && u.shadowRoot; )
87
- u = (r = u == null ? void 0 : u.shadowRoot) == null ? void 0 : r.activeElement;
88
- return u;
89
- }, s = b(), d = () => {
90
- s.value = a();
84
+ let d = s == null ? void 0 : s.activeElement;
85
+ if (o)
86
+ for (; d != null && d.shadowRoot; )
87
+ d = (r = d == null ? void 0 : d.shadowRoot) == null ? void 0 : r.activeElement;
88
+ return d;
89
+ }, a = g(), f = () => {
90
+ a.value = l();
91
91
  };
92
92
  return n && (F(n, "blur", (r) => {
93
- r.relatedTarget === null && d();
94
- }, !0), F(n, "focus", d, !0)), i && st(o, (r) => {
95
- r.filter((u) => u.removedNodes.length).map((u) => Array.from(u.removedNodes)).flat().forEach((u) => {
96
- u === s.value && d();
93
+ r.relatedTarget === null && f();
94
+ }, !0), F(n, "focus", f, !0)), i && st(s, (r) => {
95
+ r.filter((d) => d.removedNodes.length).map((d) => Array.from(d.removedNodes)).flat().forEach((d) => {
96
+ d === a.value && f();
97
97
  });
98
98
  }, {
99
99
  childList: !0,
100
100
  subtree: !0
101
- }), d(), s;
101
+ }), f(), a;
102
102
  }
103
103
  const at = "focusin", ct = "focusout";
104
104
  function dt(e, t = {}) {
105
- const { window: n = U } = t, l = x(() => z(e)), i = b(!1), o = x(() => i.value), a = rt(t);
106
- return !n || !a.value ? { focused: o } : (F(l, at, () => i.value = !0), F(l, ct, () => i.value = !1), { focused: o });
105
+ const { window: n = U } = t, o = x(() => z(e)), i = g(!1), s = x(() => i.value), l = rt(t);
106
+ return !n || !l.value ? { focused: s } : (F(o, at, () => i.value = !0), F(o, ct, () => i.value = !1), { focused: s });
107
107
  }
108
108
  function ut(e, { window: t = U, scrollTarget: n } = {}) {
109
- const l = b(!1), i = () => {
109
+ const o = g(!1), i = () => {
110
110
  if (!t) return;
111
- const o = t.document, a = z(e);
112
- if (!a)
113
- l.value = !1;
111
+ const s = t.document, l = z(e);
112
+ if (!l)
113
+ o.value = !1;
114
114
  else {
115
- const s = a.getBoundingClientRect();
116
- l.value = s.top <= (t.innerHeight || o.documentElement.clientHeight) && s.left <= (t.innerWidth || o.documentElement.clientWidth) && s.bottom >= 0 && s.right >= 0;
115
+ const a = l.getBoundingClientRect();
116
+ o.value = a.top <= (t.innerHeight || s.documentElement.clientHeight) && a.left <= (t.innerWidth || s.documentElement.clientWidth) && a.bottom >= 0 && a.right >= 0;
117
117
  }
118
118
  };
119
119
  return C(
@@ -123,7 +123,7 @@ function ut(e, { window: t = U, scrollTarget: n } = {}) {
123
123
  ), t && F(n || t, "scroll", i, {
124
124
  capture: !1,
125
125
  passive: !0
126
- }), l;
126
+ }), o;
127
127
  }
128
128
  const O = (e) => {
129
129
  let t = ut(e).value;
@@ -135,34 +135,34 @@ const O = (e) => {
135
135
  var t;
136
136
  let n;
137
137
  if (e instanceof HTMLTableCellElement) {
138
- const l = (t = e.parentElement) == null ? void 0 : t.previousElementSibling;
139
- if (l) {
140
- const i = Array.from(l.children)[e.cellIndex];
138
+ const o = (t = e.parentElement) == null ? void 0 : t.previousElementSibling;
139
+ if (o) {
140
+ const i = Array.from(o.children)[e.cellIndex];
141
141
  i && (n = i);
142
142
  }
143
143
  } else if (e instanceof HTMLTableRowElement) {
144
- const l = e.previousElementSibling;
145
- l && (n = l);
144
+ const o = e.previousElementSibling;
145
+ o && (n = o);
146
146
  }
147
147
  return n && (!$(n) || !O(n)) ? de(n) : n;
148
148
  }, ft = (e) => {
149
149
  var t;
150
150
  const n = e.target;
151
- let l;
151
+ let o;
152
152
  if (n instanceof HTMLTableCellElement) {
153
153
  const i = (t = n.parentElement) == null ? void 0 : t.parentElement;
154
154
  if (i) {
155
- const o = i.firstElementChild.children[n.cellIndex];
156
- o && (l = o);
155
+ const s = i.firstElementChild.children[n.cellIndex];
156
+ s && (o = s);
157
157
  }
158
158
  } else if (n instanceof HTMLTableRowElement) {
159
159
  const i = n.parentElement;
160
160
  if (i) {
161
- const o = i.firstElementChild;
162
- o && (l = o);
161
+ const s = i.firstElementChild;
162
+ s && (o = s);
163
163
  }
164
164
  }
165
- return l && (!$(l) || !O(l)) ? ue(l) : l;
165
+ return o && (!$(o) || !O(o)) ? ue(o) : o;
166
166
  }, xe = (e) => {
167
167
  const t = e.target;
168
168
  return ue(t);
@@ -170,34 +170,34 @@ const O = (e) => {
170
170
  var t;
171
171
  let n;
172
172
  if (e instanceof HTMLTableCellElement) {
173
- const l = (t = e.parentElement) == null ? void 0 : t.nextElementSibling;
174
- if (l) {
175
- const i = Array.from(l.children)[e.cellIndex];
173
+ const o = (t = e.parentElement) == null ? void 0 : t.nextElementSibling;
174
+ if (o) {
175
+ const i = Array.from(o.children)[e.cellIndex];
176
176
  i && (n = i);
177
177
  }
178
178
  } else if (e instanceof HTMLTableRowElement) {
179
- const l = e.nextElementSibling;
180
- l && (n = l);
179
+ const o = e.nextElementSibling;
180
+ o && (n = o);
181
181
  }
182
182
  return n && (!$(n) || !O(n)) ? ue(n) : n;
183
183
  }, pt = (e) => {
184
184
  var t;
185
185
  const n = e.target;
186
- let l;
186
+ let o;
187
187
  if (n instanceof HTMLTableCellElement) {
188
188
  const i = (t = n.parentElement) == null ? void 0 : t.parentElement;
189
189
  if (i) {
190
- const o = i.lastElementChild.children[n.cellIndex];
191
- o && (l = o);
190
+ const s = i.lastElementChild.children[n.cellIndex];
191
+ s && (o = s);
192
192
  }
193
193
  } else if (n instanceof HTMLTableRowElement) {
194
194
  const i = n.parentElement;
195
195
  if (i) {
196
- const o = i.lastElementChild;
197
- o && (l = o);
196
+ const s = i.lastElementChild;
197
+ s && (o = s);
198
198
  }
199
199
  }
200
- return l && (!$(l) || !O(l)) ? de(l) : l;
200
+ return o && (!$(o) || !O(o)) ? de(o) : o;
201
201
  }, Ee = (e) => {
202
202
  const t = e.target;
203
203
  return fe(t);
@@ -207,8 +207,8 @@ const O = (e) => {
207
207
  if (e.previousElementSibling)
208
208
  n = e.previousElementSibling;
209
209
  else {
210
- const l = (t = e.parentElement) == null ? void 0 : t.previousElementSibling;
211
- n = l == null ? void 0 : l.lastElementChild;
210
+ const o = (t = e.parentElement) == null ? void 0 : t.previousElementSibling;
211
+ n = o == null ? void 0 : o.lastElementChild;
212
212
  }
213
213
  return n && (!$(n) || !O(n)) ? fe(n) : n;
214
214
  }, ke = (e) => {
@@ -220,8 +220,8 @@ const O = (e) => {
220
220
  if (e.nextElementSibling)
221
221
  n = e.nextElementSibling;
222
222
  else {
223
- const l = (t = e.parentElement) == null ? void 0 : t.nextElementSibling;
224
- n = l == null ? void 0 : l.firstElementChild;
223
+ const o = (t = e.parentElement) == null ? void 0 : t.nextElementSibling;
224
+ n = o == null ? void 0 : o.firstElementChild;
225
225
  }
226
226
  return n && (!$(n) || !O(n)) ? pe(n) : n;
227
227
  }, Ce = (e) => {
@@ -300,66 +300,66 @@ const O = (e) => {
300
300
  }
301
301
  };
302
302
  function ve(e) {
303
- const t = (a) => {
304
- let s = null;
305
- return a.parent && (typeof a.parent == "string" ? s = document.querySelector(a.parent) : a.parent instanceof HTMLElement ? s = a.parent : s = a.parent.value), s;
306
- }, n = (a) => {
307
- const s = t(a);
308
- let d = [];
309
- if (typeof a.selectors == "string")
310
- d = s ? Array.from(s.querySelectorAll(a.selectors)) : Array.from(document.querySelectorAll(a.selectors));
311
- else if (Array.isArray(a.selectors))
312
- for (const r of a.selectors)
313
- r instanceof HTMLElement ? d.push(r) : d.push(r.$el);
314
- else if (a.selectors instanceof HTMLElement)
315
- d.push(a.selectors);
316
- else if (Array.isArray(a.selectors.value))
317
- for (const r of a.selectors.value)
318
- r instanceof HTMLElement ? d.push(r) : d.push(r.$el);
303
+ const t = (l) => {
304
+ let a = null;
305
+ return l.parent && (typeof l.parent == "string" ? a = document.querySelector(l.parent) : l.parent instanceof HTMLElement ? a = l.parent : a = l.parent.value), a;
306
+ }, n = (l) => {
307
+ const a = t(l);
308
+ let f = [];
309
+ if (typeof l.selectors == "string")
310
+ f = a ? Array.from(a.querySelectorAll(l.selectors)) : Array.from(document.querySelectorAll(l.selectors));
311
+ else if (Array.isArray(l.selectors))
312
+ for (const r of l.selectors)
313
+ r instanceof HTMLElement ? f.push(r) : f.push(r.$el);
314
+ else if (l.selectors instanceof HTMLElement)
315
+ f.push(l.selectors);
316
+ else if (Array.isArray(l.selectors.value))
317
+ for (const r of l.selectors.value)
318
+ r instanceof HTMLElement ? f.push(r) : f.push(r.$el);
319
319
  else
320
- d.push(a.selectors.value);
321
- return d;
322
- }, l = (a) => {
323
- const s = t(a);
324
- let d = [];
325
- return a.selectors ? d = n(a) : s && (d = Array.from(s.children).filter((r) => $(r) && O(r))), d;
326
- }, i = (a) => (s) => {
327
- const d = mt[s.key] || s.key.toLowerCase();
328
- if (q.includes(d)) return;
329
- const r = a.handlers || me;
330
- for (const u of Object.keys(r)) {
331
- const [p, ...c] = u.split(".");
332
- if (p === "keydown" && c.includes(d)) {
333
- const f = r[u], v = c.filter((y) => q.includes(y)), g = q.some((y) => {
334
- const E = y.charAt(0).toUpperCase() + y.slice(1);
335
- return s.getModifierState(E);
320
+ f.push(l.selectors.value);
321
+ return f;
322
+ }, o = (l) => {
323
+ const a = t(l);
324
+ let f = [];
325
+ return l.selectors ? f = n(l) : a && (f = Array.from(a.children).filter((r) => $(r) && O(r))), f;
326
+ }, i = (l) => (a) => {
327
+ const f = mt[a.key] || a.key.toLowerCase();
328
+ if (q.includes(f)) return;
329
+ const r = l.handlers || me;
330
+ for (const d of Object.keys(r)) {
331
+ const [p, ...c] = d.split(".");
332
+ if (p === "keydown" && c.includes(f)) {
333
+ const u = r[d], v = c.filter((w) => q.includes(w)), b = q.some((w) => {
334
+ const E = w.charAt(0).toUpperCase() + w.slice(1);
335
+ return a.getModifierState(E);
336
336
  });
337
337
  if (v.length > 0) {
338
- if (g) {
339
- for (const y of q)
340
- if (c.includes(y)) {
341
- const E = y.charAt(0).toUpperCase() + y.slice(1);
342
- s.getModifierState(E) && f(s);
338
+ if (b) {
339
+ for (const w of q)
340
+ if (c.includes(w)) {
341
+ const E = w.charAt(0).toUpperCase() + w.slice(1);
342
+ a.getModifierState(E) && u(a);
343
343
  }
344
344
  }
345
345
  } else
346
- g || f(s);
346
+ b || u(a);
347
347
  }
348
348
  }
349
- }, o = [];
349
+ }, s = [];
350
350
  G(() => {
351
- for (const a of e) {
352
- const s = t(a), d = l(a), r = i(a), u = s ? [s] : d;
353
- for (const p of u) {
354
- const { focused: c } = dt(b(p)), f = C(c, (v) => {
351
+ for (const l of e) {
352
+ const a = t(l), f = o(l), r = i(l), d = a ? [a] : f;
353
+ for (const p of d) {
354
+ const { focused: c } = dt(g(p)), u = C(c, (v) => {
355
355
  v ? p.addEventListener("keydown", r) : p.removeEventListener("keydown", r);
356
356
  });
357
- o.push(f);
357
+ s.push(u);
358
358
  }
359
359
  }
360
360
  }), Ye(() => {
361
- for (const a of o)
362
- a();
361
+ for (const l of s)
362
+ l();
363
363
  });
364
364
  }
365
365
  function we(e) {
@@ -385,30 +385,30 @@ function D(e) {
385
385
  return (t = n == null ? void 0 : n.$el) != null ? t : n;
386
386
  }
387
387
  function Ae(...e) {
388
- let t, n, l, i;
389
- if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, l, i] = e, t = he) : [t, n, l, i] = e, !t)
388
+ let t, n, o, i;
389
+ if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, o, i] = e, t = he) : [t, n, o, i] = e, !t)
390
390
  return bt;
391
- Array.isArray(n) || (n = [n]), Array.isArray(l) || (l = [l]);
392
- const o = [], a = () => {
393
- o.forEach((u) => u()), o.length = 0;
394
- }, s = (u, p, c, f) => (u.addEventListener(p, c, f), () => u.removeEventListener(p, c, f)), d = C(
391
+ Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
392
+ const s = [], l = () => {
393
+ s.forEach((d) => d()), s.length = 0;
394
+ }, a = (d, p, c, u) => (d.addEventListener(p, c, u), () => d.removeEventListener(p, c, u)), f = C(
395
395
  () => [D(t), K(i)],
396
- ([u, p]) => {
397
- if (a(), !u)
396
+ ([d, p]) => {
397
+ if (l(), !d)
398
398
  return;
399
399
  const c = yt(p) ? { ...p } : p;
400
- o.push(
401
- ...n.flatMap((f) => l.map((v) => s(u, f, v, c)))
400
+ s.push(
401
+ ...n.flatMap((u) => o.map((v) => a(d, u, v, c)))
402
402
  );
403
403
  },
404
404
  { immediate: !0, flush: "post" }
405
405
  ), r = () => {
406
- d(), a();
406
+ f(), l();
407
407
  };
408
408
  return we(r), r;
409
409
  }
410
410
  function Et() {
411
- const e = b(!1), t = re();
411
+ const e = g(!1), t = re();
412
412
  return t && G(() => {
413
413
  e.value = !0;
414
414
  }, t), e;
@@ -418,88 +418,88 @@ function Le(e) {
418
418
  return x(() => (t.value, !!e()));
419
419
  }
420
420
  function Pe(e, t, n = {}) {
421
- const { window: l = he, ...i } = n;
422
- let o;
423
- const a = Le(() => l && "MutationObserver" in l), s = () => {
424
- o && (o.disconnect(), o = void 0);
425
- }, d = x(() => {
426
- const c = K(e), f = (Array.isArray(c) ? c : [c]).map(D).filter(wt);
427
- return new Set(f);
421
+ const { window: o = he, ...i } = n;
422
+ let s;
423
+ const l = Le(() => o && "MutationObserver" in o), a = () => {
424
+ s && (s.disconnect(), s = void 0);
425
+ }, f = x(() => {
426
+ const c = K(e), u = (Array.isArray(c) ? c : [c]).map(D).filter(wt);
427
+ return new Set(u);
428
428
  }), r = C(
429
- () => d.value,
429
+ () => f.value,
430
430
  (c) => {
431
- s(), a.value && c.size && (o = new MutationObserver(t), c.forEach((f) => o.observe(f, i)));
431
+ a(), l.value && c.size && (s = new MutationObserver(t), c.forEach((u) => s.observe(u, i)));
432
432
  },
433
433
  { immediate: !0, flush: "post" }
434
- ), u = () => o == null ? void 0 : o.takeRecords(), p = () => {
435
- r(), s();
434
+ ), d = () => s == null ? void 0 : s.takeRecords(), p = () => {
435
+ r(), a();
436
436
  };
437
437
  return we(p), {
438
- isSupported: a,
438
+ isSupported: l,
439
439
  stop: p,
440
- takeRecords: u
440
+ takeRecords: d
441
441
  };
442
442
  }
443
443
  function kt(e, t, n = {}) {
444
- const { window: l = he, ...i } = n;
445
- let o;
446
- const a = Le(() => l && "ResizeObserver" in l), s = () => {
447
- o && (o.disconnect(), o = void 0);
448
- }, d = x(() => {
444
+ const { window: o = he, ...i } = n;
445
+ let s;
446
+ const l = Le(() => o && "ResizeObserver" in o), a = () => {
447
+ s && (s.disconnect(), s = void 0);
448
+ }, f = x(() => {
449
449
  const p = K(e);
450
450
  return Array.isArray(p) ? p.map((c) => D(c)) : [D(p)];
451
451
  }), r = C(
452
- d,
452
+ f,
453
453
  (p) => {
454
- if (s(), a.value && l) {
455
- o = new ResizeObserver(t);
454
+ if (a(), l.value && o) {
455
+ s = new ResizeObserver(t);
456
456
  for (const c of p)
457
- c && o.observe(c, i);
457
+ c && s.observe(c, i);
458
458
  }
459
459
  },
460
460
  { immediate: !0, flush: "post" }
461
- ), u = () => {
462
- s(), r();
461
+ ), d = () => {
462
+ a(), r();
463
463
  };
464
- return we(u), {
465
- isSupported: a,
466
- stop: u
464
+ return we(d), {
465
+ isSupported: l,
466
+ stop: d
467
467
  };
468
468
  }
469
469
  function Ct(e, t = {}) {
470
470
  const {
471
471
  reset: n = !0,
472
- windowResize: l = !0,
472
+ windowResize: o = !0,
473
473
  windowScroll: i = !0,
474
- immediate: o = !0,
475
- updateTiming: a = "sync"
476
- } = t, s = b(0), d = b(0), r = b(0), u = b(0), p = b(0), c = b(0), f = b(0), v = b(0);
477
- function g() {
474
+ immediate: s = !0,
475
+ updateTiming: l = "sync"
476
+ } = t, a = g(0), f = g(0), r = g(0), d = g(0), p = g(0), c = g(0), u = g(0), v = g(0);
477
+ function b() {
478
478
  const E = D(e);
479
479
  if (!E) {
480
- n && (s.value = 0, d.value = 0, r.value = 0, u.value = 0, p.value = 0, c.value = 0, f.value = 0, v.value = 0);
480
+ n && (a.value = 0, f.value = 0, r.value = 0, d.value = 0, p.value = 0, c.value = 0, u.value = 0, v.value = 0);
481
481
  return;
482
482
  }
483
483
  const I = E.getBoundingClientRect();
484
- s.value = I.height, d.value = I.bottom, r.value = I.left, u.value = I.right, p.value = I.top, c.value = I.width, f.value = I.x, v.value = I.y;
484
+ a.value = I.height, f.value = I.bottom, r.value = I.left, d.value = I.right, p.value = I.top, c.value = I.width, u.value = I.x, v.value = I.y;
485
485
  }
486
- function y() {
487
- a === "sync" ? g() : a === "next-frame" && requestAnimationFrame(() => g());
486
+ function w() {
487
+ l === "sync" ? b() : l === "next-frame" && requestAnimationFrame(() => b());
488
488
  }
489
- return kt(e, y), C(() => D(e), (E) => !E && y()), Pe(e, y, {
489
+ return kt(e, w), C(() => D(e), (E) => !E && w()), Pe(e, w, {
490
490
  attributeFilter: ["style", "class"]
491
- }), i && Ae("scroll", y, { capture: !0, passive: !0 }), l && Ae("resize", y, { passive: !0 }), xt(() => {
492
- o && y();
491
+ }), i && Ae("scroll", w, { capture: !0, passive: !0 }), o && Ae("resize", w, { passive: !0 }), xt(() => {
492
+ s && w();
493
493
  }), {
494
- height: s,
495
- bottom: d,
494
+ height: a,
495
+ bottom: f,
496
496
  left: r,
497
- right: u,
497
+ right: d,
498
498
  top: p,
499
499
  width: c,
500
- x: f,
500
+ x: u,
501
501
  y: v,
502
- update: y
502
+ update: w
503
503
  };
504
504
  }
505
505
  const It = (e) => {
@@ -516,26 +516,26 @@ const It = (e) => {
516
516
  pinned: { type: Boolean }
517
517
  },
518
518
  setup(e) {
519
- const t = Q(e.tableid), n = Z("cell"), { bottom: l, left: i } = Ct(n), o = t.cellData(e.colIndex, e.rowIndex), a = b(""), s = b(!1), d = t.table, r = t.columns[e.colIndex], u = t.rows[e.rowIndex], p = r.align || "center", c = r.width || "40ch", f = x(() => typeof g.value == "string" ? It(g.value) : !1), v = x(() => {
520
- var w;
519
+ const t = Q(e.tableid), n = Z("cell"), { bottom: o, left: i } = Ct(n), s = t.cellData(e.colIndex, e.rowIndex), l = g(""), a = g(!1), f = t.table, r = t.columns[e.colIndex], d = t.rows[e.rowIndex], p = r.align || "center", c = r.width || "40ch", u = x(() => typeof b.value == "string" ? It(b.value) : !1), v = x(() => {
520
+ var h;
521
521
  return {
522
522
  textAlign: p,
523
523
  width: c,
524
- backgroundColor: s.value ? "var(--sc-cell-modified)" : "inherit",
525
- fontWeight: s.value ? "bold" : "inherit",
526
- paddingLeft: Ge(e.colIndex, (w = t.display[e.rowIndex]) == null ? void 0 : w.indent)
524
+ backgroundColor: a.value ? "var(--sc-cell-modified)" : "inherit",
525
+ fontWeight: a.value ? "bold" : "inherit",
526
+ paddingLeft: Ge(e.colIndex, (h = t.display[e.rowIndex]) == null ? void 0 : h.indent)
527
527
  };
528
- }), g = x(() => {
529
- const w = t.cellData(e.colIndex, e.rowIndex);
530
- return y(w);
531
- }), y = (w) => {
528
+ }), b = x(() => {
529
+ const h = t.cellData(e.colIndex, e.rowIndex);
530
+ return w(h);
531
+ }), w = (h) => {
532
532
  const A = r.format;
533
- return A ? typeof A == "function" ? A(w, { table: d, row: u, column: r }) : typeof A == "string" ? Function(`"use strict";return (${A})`)()(w, { table: d, row: u, column: r }) : w : w;
533
+ return A ? typeof A == "function" ? A(h, { table: f, row: d, column: r }) : typeof A == "string" ? Function(`"use strict";return (${A})`)()(h, { table: f, row: d, column: r }) : h : h;
534
534
  }, E = () => {
535
- r.mask, r.modalComponent && (t.modal.visible = !0, t.modal.colIndex = e.colIndex, t.modal.rowIndex = e.rowIndex, t.modal.parent = n.value, t.modal.top = l.value, t.modal.left = i.value, t.modal.width = c, typeof r.modalComponent == "function" ? t.modal.component = r.modalComponent({ table: d, row: u, column: r }) : t.modal.component = r.modalComponent, t.modal.componentProps = r.modalComponentExtraProps);
535
+ r.mask, r.modalComponent && (t.modal.visible = !0, t.modal.colIndex = e.colIndex, t.modal.rowIndex = e.rowIndex, t.modal.parent = n.value, t.modal.top = o.value, t.modal.left = i.value, t.modal.width = c, typeof r.modalComponent == "function" ? t.modal.component = r.modalComponent({ table: f, row: d, column: r }) : t.modal.component = r.modalComponent, t.modal.componentProps = r.modalComponentExtraProps);
536
536
  };
537
537
  if (e.addNavigation) {
538
- let w = {
538
+ let h = {
539
539
  ...me,
540
540
  "keydown.f2": E,
541
541
  "keydown.alt.up": E,
@@ -543,28 +543,28 @@ const It = (e) => {
543
543
  "keydown.alt.left": E,
544
544
  "keydown.alt.right": E
545
545
  };
546
- typeof e.addNavigation == "object" && (w = {
547
- ...w,
546
+ typeof e.addNavigation == "object" && (h = {
547
+ ...h,
548
548
  ...e.addNavigation
549
549
  }), ve([
550
550
  {
551
551
  selectors: n,
552
- handlers: w
552
+ handlers: h
553
553
  }
554
554
  ]);
555
555
  }
556
556
  const I = () => {
557
- n.value && (a.value = n.value.textContent);
557
+ n.value && (l.value = n.value.textContent);
558
558
  }, _ = () => {
559
- n.value && (r.format ? s.value = n.value.textContent !== y(o) : s.value = n.value.textContent !== o, n.value.textContent !== a.value && (a.value = n.value.textContent, n.value.dispatchEvent(new Event("change")), r.format || t.setCellData(e.rowIndex, e.colIndex, a.value)));
560
- }, Ge = (w, A) => A && w === 0 && A > 0 ? `${A}ch` : "inherit";
561
- return (w, A) => (h(), k("td", {
559
+ n.value && (r.format ? a.value = n.value.textContent !== w(s) : a.value = n.value.textContent !== s, n.value.textContent !== l.value && (l.value = n.value.textContent, n.value.dispatchEvent(new Event("change")), r.format || t.setCellData(e.rowIndex, e.colIndex, l.value)));
560
+ }, Ge = (h, A) => A && h === 0 && A > 0 ? `${A}ch` : "inherit";
561
+ return (h, A) => (y(), k("td", {
562
562
  ref: "cell",
563
- "data-colindex": w.colIndex,
564
- "data-rowindex": w.rowIndex,
563
+ "data-colindex": h.colIndex,
564
+ "data-rowindex": h.rowIndex,
565
565
  "data-editable": m(r).edit,
566
566
  contenteditable: m(r).edit,
567
- tabindex: w.tabIndex,
567
+ tabindex: h.tabIndex,
568
568
  spellcheck: !1,
569
569
  style: P(v.value),
570
570
  onFocus: I,
@@ -573,15 +573,15 @@ const It = (e) => {
573
573
  onInput: _,
574
574
  onClick: E,
575
575
  onMousedown: E,
576
- class: N(["atable-cell", w.pinned ? "sticky-column" : ""])
576
+ class: N(["atable-cell", h.pinned ? "sticky-column" : ""])
577
577
  }, [
578
- m(r).cellComponent ? (h(), Y(De(m(r).cellComponent), ae({
578
+ m(r).cellComponent ? (y(), Y(De(m(r).cellComponent), ae({
579
579
  key: 0,
580
- value: g.value
581
- }, m(r).cellComponentProps), null, 16, ["value"])) : f.value ? (h(), k("span", {
580
+ value: b.value
581
+ }, m(r).cellComponentProps), null, 16, ["value"])) : u.value ? (y(), k("span", {
582
582
  key: 1,
583
- innerHTML: g.value
584
- }, null, 8, St)) : (h(), k("span", Ot, B(g.value), 1))
583
+ innerHTML: b.value
584
+ }, null, 8, St)) : (y(), k("span", Ot, B(b.value), 1))
585
585
  ], 46, At));
586
586
  }
587
587
  }), $t = ["tabindex"], Tt = ["tabindex"], Dt = ["colspan"], Mt = /* @__PURE__ */ M({
@@ -593,11 +593,11 @@ const It = (e) => {
593
593
  addNavigation: { type: [Boolean, Object] }
594
594
  },
595
595
  setup(e) {
596
- const t = Q(e.tableid), n = Z("rowEl"), l = x(() => t.display[e.rowIndex].expanded ? "▼" : "►");
596
+ const t = Q(e.tableid), n = Z("rowEl"), o = x(() => t.display[e.rowIndex].expanded ? "▼" : "►");
597
597
  if (e.addNavigation) {
598
598
  const i = {
599
- "keydown.control.g": (o) => {
600
- o.stopPropagation(), o.preventDefault(), t.toggleRowExpand(e.rowIndex);
599
+ "keydown.control.g": (s) => {
600
+ s.stopPropagation(), s.preventDefault(), t.toggleRowExpand(e.rowIndex);
601
601
  }
602
602
  };
603
603
  typeof e.addNavigation == "object" && Object.assign(i, e.addNavigation), ve([
@@ -607,7 +607,7 @@ const It = (e) => {
607
607
  }
608
608
  ]);
609
609
  }
610
- return (i, o) => (h(), k(J, null, [
610
+ return (i, s) => (y(), k(J, null, [
611
611
  W("tr", ae(i.$attrs, {
612
612
  ref: "rowEl",
613
613
  tabindex: i.tabIndex,
@@ -615,12 +615,12 @@ const It = (e) => {
615
615
  }), [
616
616
  W("td", {
617
617
  tabIndex: -1,
618
- onClick: o[0] || (o[0] = (a) => m(t).toggleRowExpand(i.rowIndex)),
618
+ onClick: s[0] || (s[0] = (l) => m(t).toggleRowExpand(i.rowIndex)),
619
619
  class: "row-index"
620
- }, B(l.value), 1),
620
+ }, B(o.value), 1),
621
621
  S(i.$slots, "row")
622
622
  ], 16, $t),
623
- m(t).display[i.rowIndex].expanded ? (h(), k("tr", {
623
+ m(t).display[i.rowIndex].expanded ? (y(), k("tr", {
624
624
  key: 0,
625
625
  ref: "rowExpanded",
626
626
  tabindex: i.tabIndex,
@@ -645,39 +645,39 @@ const It = (e) => {
645
645
  addNavigation: { type: [Boolean, Object], default: !1 }
646
646
  },
647
647
  setup(e) {
648
- const t = Q(e.tableid), n = Z("rowEl"), l = x(() => t.columns.some((s) => s.pinned)), i = x(() => t.config.view !== "tree" || t.display[e.rowIndex].isRoot || t.display[e.rowIndex].open), o = x(() => t.config.view !== "tree" ? "" : t.display[e.rowIndex].isRoot || t.display[e.rowIndex].isParent ? t.display[e.rowIndex].childrenOpen ? "-" : "+" : ""), a = (s) => {
649
- t.toggleRowExpand(s);
648
+ const t = Q(e.tableid), n = Z("rowEl"), o = x(() => t.columns.some((a) => a.pinned)), i = x(() => t.config.view !== "tree" || t.display[e.rowIndex].isRoot || t.display[e.rowIndex].open), s = x(() => t.config.view !== "tree" ? "" : t.display[e.rowIndex].isRoot || t.display[e.rowIndex].isParent ? t.display[e.rowIndex].childrenOpen ? "-" : "+" : ""), l = (a) => {
649
+ t.toggleRowExpand(a);
650
650
  };
651
651
  if (e.addNavigation) {
652
- let s = me;
653
- typeof e.addNavigation == "object" && (s = {
654
- ...s,
652
+ let a = me;
653
+ typeof e.addNavigation == "object" && (a = {
654
+ ...a,
655
655
  ...e.addNavigation
656
656
  }), ve([
657
657
  {
658
658
  selectors: n,
659
- handlers: s
659
+ handlers: a
660
660
  }
661
661
  ]);
662
662
  }
663
- return (s, d) => ne((h(), k("tr", {
663
+ return (a, f) => ne((y(), k("tr", {
664
664
  ref: "rowEl",
665
- tabindex: s.tabIndex,
665
+ tabindex: a.tabIndex,
666
666
  class: "table-row"
667
667
  }, [
668
- m(t).config.view !== "uncounted" ? S(s.$slots, "index", { key: 0 }, () => [
669
- m(t).config.view === "list" ? (h(), k("td", {
668
+ m(t).config.view !== "uncounted" ? S(a.$slots, "index", { key: 0 }, () => [
669
+ m(t).config.view === "list" ? (y(), k("td", {
670
670
  key: 0,
671
671
  tabIndex: -1,
672
- class: N(["list-index", l.value ? "sticky-index" : ""])
673
- }, B(s.rowIndex + 1), 3)) : m(t).config.view === "tree" ? (h(), k("td", {
672
+ class: N(["list-index", o.value ? "sticky-index" : ""])
673
+ }, B(a.rowIndex + 1), 3)) : m(t).config.view === "tree" ? (y(), k("td", {
674
674
  key: 1,
675
675
  tabIndex: -1,
676
- class: N(["tree-index", l.value ? "sticky-index" : ""]),
677
- onClick: d[0] || (d[0] = (r) => a(s.rowIndex))
678
- }, B(o.value), 3)) : V("", !0)
676
+ class: N(["tree-index", o.value ? "sticky-index" : ""]),
677
+ onClick: f[0] || (f[0] = (r) => l(a.rowIndex))
678
+ }, B(s.value), 3)) : V("", !0)
679
679
  ]) : V("", !0),
680
- S(s.$slots, "default")
680
+ S(a.$slots, "default")
681
681
  ], 8, Rt)), [
682
682
  [Me, i.value]
683
683
  ]);
@@ -706,7 +706,7 @@ function Ht(...e) {
706
706
  if (e.length !== 1)
707
707
  return Xe(...e);
708
708
  const t = e[0];
709
- return typeof t == "function" ? Je(Qe(() => ({ get: t, set: j }))) : b(t);
709
+ return typeof t == "function" ? Je(Qe(() => ({ get: t, set: j }))) : g(t);
710
710
  }
711
711
  function L(e) {
712
712
  var t;
@@ -715,66 +715,66 @@ function L(e) {
715
715
  }
716
716
  const Be = Ne ? window : void 0;
717
717
  function X(...e) {
718
- let t, n, l, i;
719
- if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, l, i] = e, t = Be) : [t, n, l, i] = e, !t)
718
+ let t, n, o, i;
719
+ if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, o, i] = e, t = Be) : [t, n, o, i] = e, !t)
720
720
  return j;
721
- Array.isArray(n) || (n = [n]), Array.isArray(l) || (l = [l]);
722
- const o = [], a = () => {
723
- o.forEach((u) => u()), o.length = 0;
724
- }, s = (u, p, c, f) => (u.addEventListener(p, c, f), () => u.removeEventListener(p, c, f)), d = C(
721
+ Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
722
+ const s = [], l = () => {
723
+ s.forEach((d) => d()), s.length = 0;
724
+ }, a = (d, p, c, u) => (d.addEventListener(p, c, u), () => d.removeEventListener(p, c, u)), f = C(
725
725
  () => [L(t), H(i)],
726
- ([u, p]) => {
727
- if (a(), !u)
726
+ ([d, p]) => {
727
+ if (l(), !d)
728
728
  return;
729
729
  const c = Pt(p) ? { ...p } : p;
730
- o.push(
731
- ...n.flatMap((f) => l.map((v) => s(u, f, v, c)))
730
+ s.push(
731
+ ...n.flatMap((u) => o.map((v) => a(d, u, v, c)))
732
732
  );
733
733
  },
734
734
  { immediate: !0, flush: "post" }
735
735
  ), r = () => {
736
- d(), a();
736
+ f(), l();
737
737
  };
738
738
  return je(r), r;
739
739
  }
740
740
  let Oe = !1;
741
741
  function $e(e, t, n = {}) {
742
- const { window: l = Be, ignore: i = [], capture: o = !0, detectIframe: a = !1 } = n;
743
- if (!l)
742
+ const { window: o = Be, ignore: i = [], capture: s = !0, detectIframe: l = !1 } = n;
743
+ if (!o)
744
744
  return j;
745
- le && !Oe && (Oe = !0, Array.from(l.document.body.children).forEach((c) => c.addEventListener("click", j)), l.document.documentElement.addEventListener("click", j));
746
- let s = !0;
747
- const d = (c) => i.some((f) => {
748
- if (typeof f == "string")
749
- return Array.from(l.document.querySelectorAll(f)).some((v) => v === c.target || c.composedPath().includes(v));
745
+ le && !Oe && (Oe = !0, Array.from(o.document.body.children).forEach((c) => c.addEventListener("click", j)), o.document.documentElement.addEventListener("click", j));
746
+ let a = !0;
747
+ const f = (c) => i.some((u) => {
748
+ if (typeof u == "string")
749
+ return Array.from(o.document.querySelectorAll(u)).some((v) => v === c.target || c.composedPath().includes(v));
750
750
  {
751
- const v = L(f);
751
+ const v = L(u);
752
752
  return v && (c.target === v || c.composedPath().includes(v));
753
753
  }
754
- }), u = [
755
- X(l, "click", (c) => {
756
- const f = L(e);
757
- if (!(!f || f === c.target || c.composedPath().includes(f))) {
758
- if (c.detail === 0 && (s = !d(c)), !s) {
759
- s = !0;
754
+ }), d = [
755
+ X(o, "click", (c) => {
756
+ const u = L(e);
757
+ if (!(!u || u === c.target || c.composedPath().includes(u))) {
758
+ if (c.detail === 0 && (a = !f(c)), !a) {
759
+ a = !0;
760
760
  return;
761
761
  }
762
762
  t(c);
763
763
  }
764
- }, { passive: !0, capture: o }),
765
- X(l, "pointerdown", (c) => {
766
- const f = L(e);
767
- s = !d(c) && !!(f && !c.composedPath().includes(f));
764
+ }, { passive: !0, capture: s }),
765
+ X(o, "pointerdown", (c) => {
766
+ const u = L(e);
767
+ a = !f(c) && !!(u && !c.composedPath().includes(u));
768
768
  }, { passive: !0 }),
769
- a && X(l, "blur", (c) => {
769
+ l && X(o, "blur", (c) => {
770
770
  setTimeout(() => {
771
- var f;
771
+ var u;
772
772
  const v = L(e);
773
- ((f = l.document.activeElement) == null ? void 0 : f.tagName) === "IFRAME" && !(v != null && v.contains(l.document.activeElement)) && t(c);
773
+ ((u = o.document.activeElement) == null ? void 0 : u.tagName) === "IFRAME" && !(v != null && v.contains(o.document.activeElement)) && t(c);
774
774
  }, 0);
775
775
  })
776
776
  ].filter(Boolean);
777
- return () => u.forEach((c) => c());
777
+ return () => d.forEach((c) => c());
778
778
  }
779
779
  const jt = {
780
780
  [Se.mounted](e, t) {
@@ -782,8 +782,8 @@ const jt = {
782
782
  if (typeof t.value == "function")
783
783
  e.__onClickOutside_stop = $e(e, t.value, { capture: n });
784
784
  else {
785
- const [l, i] = t.value;
786
- e.__onClickOutside_stop = $e(e, l, Object.assign({ capture: n }, i));
785
+ const [o, i] = t.value;
786
+ e.__onClickOutside_stop = $e(e, o, Object.assign({ capture: n }, i));
787
787
  }
788
788
  },
789
789
  [Se.unmounted](e) {
@@ -808,12 +808,12 @@ function Nt(e) {
808
808
  }
809
809
  const te = /* @__PURE__ */ new WeakMap();
810
810
  function Bt(e, t = !1) {
811
- const n = b(t);
812
- let l = null, i = "";
813
- C(Ht(e), (s) => {
814
- const d = ee(H(s));
815
- if (d) {
816
- const r = d;
811
+ const n = g(t);
812
+ let o = null, i = "";
813
+ C(Ht(e), (a) => {
814
+ const f = ee(H(a));
815
+ if (f) {
816
+ const r = f;
817
817
  if (te.get(r) || te.set(r, r.style.overflow), r.style.overflow !== "hidden" && (i = r.style.overflow), r.style.overflow === "hidden")
818
818
  return n.value = !0;
819
819
  if (n.value)
@@ -822,43 +822,43 @@ function Bt(e, t = !1) {
822
822
  }, {
823
823
  immediate: !0
824
824
  });
825
- const o = () => {
826
- const s = ee(H(e));
827
- !s || n.value || (le && (l = X(
828
- s,
825
+ const s = () => {
826
+ const a = ee(H(e));
827
+ !a || n.value || (le && (o = X(
828
+ a,
829
829
  "touchmove",
830
- (d) => {
831
- Nt(d);
830
+ (f) => {
831
+ Nt(f);
832
832
  },
833
833
  { passive: !1 }
834
- )), s.style.overflow = "hidden", n.value = !0);
835
- }, a = () => {
836
- const s = ee(H(e));
837
- !s || !n.value || (le && (l == null || l()), s.style.overflow = i, te.delete(s), n.value = !1);
834
+ )), a.style.overflow = "hidden", n.value = !0);
835
+ }, l = () => {
836
+ const a = ee(H(e));
837
+ !a || !n.value || (le && (o == null || o()), a.style.overflow = i, te.delete(a), n.value = !1);
838
838
  };
839
- return je(a), x({
839
+ return je(l), x({
840
840
  get() {
841
841
  return n.value;
842
842
  },
843
- set(s) {
844
- s ? o() : a();
843
+ set(a) {
844
+ a ? s() : l();
845
845
  }
846
846
  });
847
847
  }
848
848
  function Vt() {
849
849
  let e = !1;
850
- const t = b(!1);
851
- return (n, l) => {
852
- if (t.value = l.value, e)
850
+ const t = g(!1);
851
+ return (n, o) => {
852
+ if (t.value = o.value, e)
853
853
  return;
854
854
  e = !0;
855
- const i = Bt(n, l.value);
856
- C(t, (o) => i.value = o);
855
+ const i = Bt(n, o.value);
856
+ C(t, (s) => i.value = s);
857
857
  };
858
858
  }
859
859
  Vt();
860
860
  class zt {
861
- constructor(t, n, l, i, o, a) {
861
+ constructor(t, n, o, i, s, l) {
862
862
  T(this, "id");
863
863
  T(this, "rows");
864
864
  T(this, "columns");
@@ -866,31 +866,31 @@ class zt {
866
866
  T(this, "table");
867
867
  T(this, "display");
868
868
  T(this, "modal");
869
- this.id = t || crypto.randomUUID(), this.rows = l, this.columns = R(n), this.config = R(i), this.table = o || R(this.createTableObject()), this.display = this.createDisplayObject(a), this.modal = R({ visible: !1 });
869
+ this.id = t || crypto.randomUUID(), this.rows = o, this.columns = R(n), this.config = R(i), this.table = s || R(this.createTableObject()), this.display = this.createDisplayObject(l), this.modal = R({ visible: !1 });
870
870
  }
871
871
  createTableObject() {
872
872
  const t = {};
873
- for (const [n, l] of this.columns.entries())
874
- for (const [i, o] of this.rows.entries())
875
- t[`${n}:${i}`] = o[l.name];
873
+ for (const [n, o] of this.columns.entries())
874
+ for (const [i, s] of this.rows.entries())
875
+ t[`${n}:${i}`] = s[o.name];
876
876
  return t;
877
877
  }
878
878
  createDisplayObject(t) {
879
879
  const n = [Object.assign({}, { rowModified: !1 })];
880
880
  if (t && "0:0" in t)
881
881
  return t;
882
- const l = /* @__PURE__ */ new Set();
882
+ const o = /* @__PURE__ */ new Set();
883
883
  for (let i = this.rows.length - 1; i >= 0; i--) {
884
- const o = this.rows[i];
885
- o.parent && l.add(o.parent), n[i] = {
884
+ const s = this.rows[i];
885
+ s.parent && o.add(s.parent), n[i] = {
886
886
  childrenOpen: !1,
887
887
  expanded: !1,
888
- indent: o.indent || null,
889
- isParent: l.has(i),
890
- isRoot: o.parent === null || o.parent === void 0,
888
+ indent: s.indent || null,
889
+ isParent: o.has(i),
890
+ isRoot: s.parent === null || s.parent === void 0,
891
891
  rowModified: !1,
892
- open: o.parent === null || o.parent === void 0,
893
- parent: o.parent
892
+ open: s.parent === null || s.parent === void 0,
893
+ parent: s.parent
894
894
  };
895
895
  }
896
896
  return R(n);
@@ -904,9 +904,9 @@ class zt {
904
904
  cellData(t, n) {
905
905
  return this.table[`${t}:${n}`];
906
906
  }
907
- setCellData(t, n, l) {
908
- const i = `${n}:${t}`, o = this.columns[n];
909
- return this.table[i] !== l && (this.display[t].rowModified = !0), this.table[i] = l, this.rows[t][o.name] = l, this.table[i];
907
+ setCellData(t, n, o) {
908
+ const i = `${n}:${t}`, s = this.columns[n];
909
+ return this.table[i] !== o && (this.display[t].rowModified = !0), this.table[i] = o, this.rows[t][s.name] = o, this.table[i];
910
910
  }
911
911
  toggleRowExpand(t) {
912
912
  if (this.config.view === "tree") {
@@ -929,14 +929,14 @@ const Ft = {
929
929
  tableid: {}
930
930
  },
931
931
  setup(e) {
932
- const t = Q(e.tableid), n = x(() => t.columns.some((i) => i.pinned)), l = (i) => ({
932
+ const t = Q(e.tableid), n = x(() => t.columns.some((i) => i.pinned)), o = (i) => ({
933
933
  minWidth: i.width || "40ch",
934
934
  textAlign: i.align || "center",
935
935
  width: t.config.fullWidth ? "auto" : null
936
936
  });
937
- return (i, o) => i.columns.length ? (h(), k("thead", Ft, [
937
+ return (i, s) => i.columns.length ? (y(), k("thead", Ft, [
938
938
  W("tr", Gt, [
939
- m(t).zeroColumn ? (h(), k("th", {
939
+ m(t).zeroColumn ? (y(), k("th", {
940
940
  key: 0,
941
941
  id: "header-index",
942
942
  class: N([[
@@ -945,14 +945,14 @@ const Ft = {
945
945
  m(t).config.view === "list-expansion" ? "list-expansion-index" : ""
946
946
  ], "list-index"])
947
947
  }, null, 2)) : V("", !0),
948
- (h(!0), k(J, null, oe(i.columns, (a, s) => (h(), k("th", {
949
- key: a.name,
948
+ (y(!0), k(J, null, oe(i.columns, (l, a) => (y(), k("th", {
949
+ key: l.name,
950
950
  tabindex: "-1",
951
- style: P(l(a)),
952
- class: N(a.pinned ? "sticky-column" : "")
951
+ style: P(o(l)),
952
+ class: N(l.pinned ? "sticky-column" : "")
953
953
  }, [
954
954
  S(i.$slots, "default", {}, () => [
955
- Ze(B(a.label || String.fromCharCode(s + 97).toUpperCase()), 1)
955
+ Ze(B(l.label || String.fromCharCode(a + 97).toUpperCase()), 1)
956
956
  ])
957
957
  ], 6))), 128))
958
958
  ])
@@ -969,7 +969,7 @@ const Ft = {
969
969
  const t = (n) => {
970
970
  n.stopPropagation();
971
971
  };
972
- return (n, l) => (h(), k("div", {
972
+ return (n, o) => (y(), k("div", {
973
973
  class: "amodal",
974
974
  tabindex: "-1",
975
975
  onClick: t,
@@ -988,75 +988,75 @@ const Ft = {
988
988
  config: { default: () => new Object() }
989
989
  },
990
990
  emits: ["update:modelValue"],
991
- setup(e, { emit: t }) {
992
- const n = t, l = Z("table"), i = e.modelValue ? e.modelValue : e.rows, o = new zt(e.id, e.columns, i, e.config);
993
- Ke(o.id, o), C(
994
- () => o.rows,
995
- (d) => {
996
- n("update:modelValue", d);
991
+ setup(e, { expose: t, emit: n }) {
992
+ const o = n, i = Z("table"), s = e.modelValue ? e.modelValue : e.rows, l = new zt(e.id, e.columns, s, e.config);
993
+ Ke(l.id, l), C(
994
+ () => l.rows,
995
+ (r) => {
996
+ o("update:modelValue", r);
997
997
  },
998
998
  { deep: !0 }
999
999
  ), G(() => {
1000
- e.columns.some((d) => d.pinned) && (a(), o.config.view === "tree" && Pe(l, a, { childList: !0, subtree: !0 }));
1000
+ e.columns.some((r) => r.pinned) && (a(), l.config.view === "tree" && Pe(i, a, { childList: !0, subtree: !0 }));
1001
1001
  });
1002
1002
  const a = () => {
1003
- const d = l.value, r = d.rows[0], u = d.rows[1], p = r ? Array.from(r.cells) : [];
1004
- for (const [c, f] of p.entries()) {
1005
- const v = u.cells[c];
1006
- v && (f.style.width = `${v.offsetWidth}px`);
1003
+ const r = i.value, d = r.rows[0], p = r.rows[1], c = d ? Array.from(d.cells) : [];
1004
+ for (const [u, v] of c.entries()) {
1005
+ const b = p.cells[u];
1006
+ b && (v.style.width = `${b.offsetWidth}px`);
1007
1007
  }
1008
- for (const c of d.rows) {
1009
- let f = 0;
1010
- const v = [];
1011
- for (const g of c.cells)
1012
- (g.classList.contains("sticky-column") || g.classList.contains("sticky-index")) && (g.style.left = `${f}px`, f += g.offsetWidth, v.push(g));
1013
- v.length > 0 && v[v.length - 1].classList.add("sticky-column-edge");
1008
+ for (const u of r.rows) {
1009
+ let v = 0;
1010
+ const b = [];
1011
+ for (const w of u.cells)
1012
+ (w.classList.contains("sticky-column") || w.classList.contains("sticky-index")) && (w.style.left = `${v}px`, v += w.offsetWidth, b.push(w));
1013
+ b.length > 0 && b[b.length - 1].classList.add("sticky-column-edge");
1014
1014
  }
1015
- }, s = (d) => {
1016
- var r;
1017
- d.target instanceof Node && (r = o.modal.parent) != null && r.contains(d.target) || o.modal.visible && (o.modal.visible = !1);
1015
+ }, f = (r) => {
1016
+ var d;
1017
+ r.target instanceof Node && (d = l.modal.parent) != null && d.contains(r.target) || l.modal.visible && (l.modal.visible = !1);
1018
1018
  };
1019
- return window.addEventListener("keydown", (d) => {
1020
- if (d.key === "Escape" && o.modal.visible) {
1021
- o.modal.visible = !1;
1022
- const r = o.modal.parent;
1023
- r && Te().then(() => {
1024
- r.focus();
1019
+ return window.addEventListener("keydown", (r) => {
1020
+ if (r.key === "Escape" && l.modal.visible) {
1021
+ l.modal.visible = !1;
1022
+ const d = l.modal.parent;
1023
+ d && Te().then(() => {
1024
+ d.focus();
1025
1025
  });
1026
1026
  }
1027
- }), (d, r) => ne((h(), k("table", {
1027
+ }), t({ tableData: l }), (r, d) => ne((y(), k("table", {
1028
1028
  ref: "table",
1029
1029
  class: "atable",
1030
- style: P({ width: m(o).config.fullWidth ? "100%" : "auto" })
1030
+ style: P({ width: m(l).config.fullWidth ? "100%" : "auto" })
1031
1031
  }, [
1032
- S(d.$slots, "header", { data: m(o) }, () => [
1032
+ S(r.$slots, "header", { data: m(l) }, () => [
1033
1033
  ye(ze, {
1034
- columns: m(o).columns,
1035
- tableid: m(o).id
1034
+ columns: m(l).columns,
1035
+ tableid: m(l).id
1036
1036
  }, null, 8, ["columns", "tableid"])
1037
1037
  ], !0),
1038
1038
  W("tbody", null, [
1039
- S(d.$slots, "body", { data: m(o) }, () => [
1040
- (h(!0), k(J, null, oe(m(o).rows, (u, p) => (h(), Y(He, {
1041
- key: u.id,
1042
- row: u,
1043
- rowIndex: p,
1044
- tableid: m(o).id
1039
+ S(r.$slots, "body", { data: m(l) }, () => [
1040
+ (y(!0), k(J, null, oe(m(l).rows, (p, c) => (y(), Y(He, {
1041
+ key: p.id,
1042
+ row: p,
1043
+ rowIndex: c,
1044
+ tableid: m(l).id
1045
1045
  }, {
1046
1046
  default: be(() => [
1047
- (h(!0), k(J, null, oe(m(o).columns, (c, f) => (h(), Y(We, {
1048
- key: c.name,
1049
- tableid: m(o).id,
1050
- col: c,
1047
+ (y(!0), k(J, null, oe(m(l).columns, (u, v) => (y(), Y(We, {
1048
+ key: u.name,
1049
+ tableid: m(l).id,
1050
+ col: u,
1051
1051
  spellcheck: "false",
1052
- pinned: c.pinned,
1053
- rowIndex: p,
1054
- colIndex: f,
1055
- component: c.cellComponent,
1052
+ pinned: u.pinned,
1053
+ rowIndex: c,
1054
+ colIndex: v,
1055
+ component: u.cellComponent,
1056
1056
  style: P({
1057
- textAlign: (c == null ? void 0 : c.align) || "center",
1058
- minWidth: (c == null ? void 0 : c.width) || "40ch",
1059
- width: m(o).config.fullWidth ? "auto" : null
1057
+ textAlign: (u == null ? void 0 : u.align) || "center",
1058
+ minWidth: (u == null ? void 0 : u.width) || "40ch",
1059
+ width: m(l).config.fullWidth ? "auto" : null
1060
1060
  })
1061
1061
  }, null, 8, ["tableid", "col", "pinned", "rowIndex", "colIndex", "component", "style"]))), 128))
1062
1062
  ]),
@@ -1064,41 +1064,41 @@ const Ft = {
1064
1064
  }, 1032, ["row", "rowIndex", "tableid"]))), 128))
1065
1065
  ], !0)
1066
1066
  ]),
1067
- S(d.$slots, "footer", { data: m(o) }, void 0, !0),
1068
- S(d.$slots, "modal", { data: m(o) }, () => [
1067
+ S(r.$slots, "footer", { data: m(l) }, void 0, !0),
1068
+ S(r.$slots, "modal", { data: m(l) }, () => [
1069
1069
  ne(ye(Fe, {
1070
- colIndex: m(o).modal.colIndex,
1071
- rowIndex: m(o).modal.rowIndex,
1072
- tableid: m(o).id,
1070
+ colIndex: m(l).modal.colIndex,
1071
+ rowIndex: m(l).modal.rowIndex,
1072
+ tableid: m(l).id,
1073
1073
  style: P({
1074
- left: m(o).modal.left + "px",
1075
- top: m(o).modal.top + "px",
1076
- maxWidth: m(o).modal.width + "px"
1074
+ left: m(l).modal.left + "px",
1075
+ top: m(l).modal.top + "px",
1076
+ maxWidth: m(l).modal.width + "px"
1077
1077
  })
1078
1078
  }, {
1079
1079
  default: be(() => [
1080
- (h(), Y(De(m(o).modal.component), ae({
1081
- key: `${m(o).modal.rowIndex}:${m(o).modal.colIndex}`,
1082
- colIndex: m(o).modal.colIndex,
1083
- rowIndex: m(o).modal.rowIndex,
1084
- tableid: m(o).id
1085
- }, m(o).modal.componentProps), null, 16, ["colIndex", "rowIndex", "tableid"]))
1080
+ (y(), Y(De(m(l).modal.component), ae({
1081
+ key: `${m(l).modal.rowIndex}:${m(l).modal.colIndex}`,
1082
+ colIndex: m(l).modal.colIndex,
1083
+ rowIndex: m(l).modal.rowIndex,
1084
+ tableid: m(l).id
1085
+ }, m(l).modal.componentProps), null, 16, ["colIndex", "rowIndex", "tableid"]))
1086
1086
  ]),
1087
1087
  _: 1
1088
1088
  }, 8, ["colIndex", "rowIndex", "tableid", "style"]), [
1089
- [Me, m(o).modal.visible]
1089
+ [Me, m(l).modal.visible]
1090
1090
  ])
1091
1091
  ], !0)
1092
1092
  ], 4)), [
1093
- [m(jt), s]
1093
+ [m(jt), f]
1094
1094
  ]);
1095
1095
  }
1096
1096
  }), qt = (e, t) => {
1097
1097
  const n = e.__vccOpts || e;
1098
- for (const [l, i] of t)
1099
- n[l] = i;
1098
+ for (const [o, i] of t)
1099
+ n[o] = i;
1100
1100
  return n;
1101
- }, Yt = /* @__PURE__ */ qt(Ut, [["__scopeId", "data-v-5fc77917"]]);
1101
+ }, Yt = /* @__PURE__ */ qt(Ut, [["__scopeId", "data-v-183c4dd3"]]);
1102
1102
  function Zt(e) {
1103
1103
  e.component("ACell", We), e.component("AExpansionRow", Mt), e.component("ARow", He), e.component("ATable", Yt), e.component("ATableHeader", ze), e.component("ATableModal", Fe);
1104
1104
  }