@stonecrop/atable 0.3.7 → 0.3.8

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