@stonecrop/atable 0.3.0 → 0.3.1

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