@stonecrop/atable 0.3.0 → 0.3.2

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 T, 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 = T(
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 = T(
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 T(
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
+ }, Ie = (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 = Ie(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 = Ie(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 = T(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 M(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;
384
+ return typeof t == "function" ? Ye(Xe(() => ({ get: t, set: P }))) : x(t);
416
385
  }
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());
386
+ function gt(e, t = !0, n) {
387
+ wt() ? Y(e, n) : t ? e() : Re(e);
455
388
  }
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
- });
524
- }
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
- };
535
- }
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 = M(e);
557
393
  return (t = n == null ? void 0 : n.$el) != null ? t : n;
558
394
  }
559
- function Me(...e) {
395
+ function Ae(...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 = T(
403
+ () => [D(t), M(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 = M(e), v = (Array.isArray(d) ? d : [d]).map(D).filter(mt);
435
+ return new Set(v);
436
+ }), c = T(
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 = M(e);
458
+ return Array.isArray(f) ? f.map((d) => D(d)) : [D(f)];
459
+ }), c = T(
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), T(() => 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 && Ae("scroll", w, { capture: !0, passive: !0 }), o && Ae("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"], It = { key: 2 }, Ne = /* @__PURE__ */ W({
681
517
  __name: "ACell",
682
518
  props: {
683
519
  colIndex: {},
@@ -688,72 +524,77 @@ 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 = x(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";
528
+ T(
529
+ () => e.store.getCellData(e.colIndex, e.rowIndex),
530
+ (m) => {
531
+ a.value = e.store.getFormattedValue(e.colIndex, e.rowIndex, m);
532
+ }
533
+ );
534
+ const d = $(() => typeof a.value == "string" ? Et(a.value) : !1), v = $(() => {
535
+ var m;
693
536
  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)
537
+ textAlign: u,
538
+ width: f,
539
+ backgroundColor: i.value ? "var(--sc-cell-changed-color)" : "inherit",
540
+ fontWeight: i.value ? "bold" : "inherit",
541
+ paddingLeft: e.store.getIndent(e.colIndex, (m = e.store.display[e.rowIndex]) == null ? void 0 : m.indent)
699
542
  };
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;
543
+ }), y = () => {
544
+ s.mask, s.modalComponent && e.store.$patch((m) => {
545
+ 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
546
  });
704
547
  };
705
548
  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
549
+ let m = {
550
+ ...me,
551
+ "keydown.f2": y,
552
+ "keydown.alt.up": y,
553
+ "keydown.alt.down": y,
554
+ "keydown.alt.left": y,
555
+ "keydown.alt.right": y
713
556
  };
714
- typeof e.addNavigation == "object" && (h = {
715
- ...h,
557
+ typeof e.addNavigation == "object" && (m = {
558
+ ...m,
716
559
  ...e.addNavigation
717
- }), pe([
560
+ }), ve([
718
561
  {
719
562
  selectors: t,
720
- handlers: h
563
+ handlers: m
721
564
  }
722
565
  ]);
723
566
  }
724
- const E = () => {
567
+ const p = () => {
725
568
  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)));
569
+ }, w = () => {
570
+ 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
571
  };
729
- return (h, O) => ae((x(), k("td", {
572
+ return (m, C) => (E(), k("td", {
730
573
  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,
574
+ "data-colindex": m.colIndex,
575
+ "data-rowindex": m.rowIndex,
576
+ "data-editable": g(s).edit,
577
+ contenteditable: g(s).edit,
578
+ tabindex: m.tabIndex,
736
579
  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" : ""])
580
+ style: j(v.value),
581
+ onFocus: p,
582
+ onPaste: w,
583
+ onBlur: w,
584
+ onInput: w,
585
+ onClick: y,
586
+ class: z(["atable-cell", m.pinned ? "sticky-column" : ""])
744
587
  }, [
745
- w(s).cellComponent ? (x(), J(Le(w(s).cellComponent), ie({
588
+ g(s).cellComponent ? (E(), Z(Oe(g(s).cellComponent), ae({
746
589
  key: 0,
747
- value: w(i)
748
- }, w(s).cellComponentProps), null, 16, ["value"])) : a.value ? (x(), k("span", {
590
+ value: a.value
591
+ }, g(s).cellComponentProps), null, 16, ["value"])) : d.value ? (E(), k("span", {
749
592
  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
- ]);
593
+ innerHTML: a.value
594
+ }, null, 8, Ct)) : (E(), k("span", It, F(a.value), 1))
595
+ ], 46, kt));
755
596
  }
756
- }), Ht = ["tabindex"], Nt = ["tabindex"], jt = ["colspan"], Vt = /* @__PURE__ */ D({
597
+ }), At = ["tabindex"], St = ["tabindex"], $t = ["colspan"], Tt = /* @__PURE__ */ W({
757
598
  __name: "AExpansionRow",
758
599
  props: {
759
600
  rowIndex: {},
@@ -762,50 +603,50 @@ const Lt = (e) => {
762
603
  addNavigation: { type: [Boolean, Object] }
763
604
  },
764
605
  setup(e) {
765
- const t = K("rowEl"), n = S(() => e.store.display[e.rowIndex].expanded ? "▼" : "►");
606
+ const t = ee("rowEl"), n = $(() => e.store.display[e.rowIndex].expanded ? "▼" : "►");
766
607
  if (e.addNavigation) {
767
608
  const o = {
768
609
  "keydown.control.g": (r) => {
769
610
  r.stopPropagation(), r.preventDefault(), e.store.toggleRowExpand(e.rowIndex);
770
611
  }
771
612
  };
772
- typeof e.addNavigation == "object" && Object.assign(o, e.addNavigation), pe([
613
+ typeof e.addNavigation == "object" && Object.assign(o, e.addNavigation), ve([
773
614
  {
774
615
  selectors: t,
775
616
  handlers: o
776
617
  }
777
618
  ]);
778
619
  }
779
- return (o, r) => (x(), k(Z, null, [
780
- N("tr", ie(o.$attrs, {
620
+ return (o, r) => (E(), k(_, null, [
621
+ B("tr", ae(o.$attrs, {
781
622
  ref: "rowEl",
782
623
  tabindex: o.tabIndex,
783
624
  class: "expandable-row"
784
625
  }), [
785
- N("td", {
626
+ B("td", {
786
627
  tabIndex: -1,
787
- onClick: r[0] || (r[0] = (i) => o.store.toggleRowExpand(o.rowIndex)),
628
+ onClick: r[0] || (r[0] = (a) => o.store.toggleRowExpand(o.rowIndex)),
788
629
  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", {
630
+ }, F(n.value), 1),
631
+ R(o.$slots, "row")
632
+ ], 16, At),
633
+ o.store.display[o.rowIndex].expanded ? (E(), k("tr", {
793
634
  key: 0,
794
635
  ref: "rowExpanded",
795
636
  tabindex: o.tabIndex,
796
637
  class: "expanded-row"
797
638
  }, [
798
- N("td", {
639
+ B("td", {
799
640
  tabIndex: -1,
800
641
  colspan: o.store.columns.length + 1,
801
642
  class: "expanded-row-content"
802
643
  }, [
803
- T(o.$slots, "content")
804
- ], 8, jt)
805
- ], 8, Nt)) : F("", !0)
644
+ R(o.$slots, "content")
645
+ ], 8, $t)
646
+ ], 8, St)) : U("", !0)
806
647
  ], 64));
807
648
  }
808
- }), Bt = ["tabindex"], Fe = /* @__PURE__ */ D({
649
+ }), Mt = ["tabindex"], Ve = /* @__PURE__ */ W({
809
650
  __name: "ARow",
810
651
  props: {
811
652
  rowIndex: {},
@@ -814,79 +655,243 @@ const Lt = (e) => {
814
655
  addNavigation: { type: [Boolean, Object], default: !1 }
815
656
  },
816
657
  setup(e) {
817
- const t = K("rowEl"), n = e.store.isRowVisible(e.rowIndex), o = e.store.getRowExpandSymbol(e.rowIndex);
658
+ const t = ee("rowEl"), n = e.store.isRowVisible(e.rowIndex), o = e.store.getRowExpandSymbol(e.rowIndex);
818
659
  if (e.addNavigation) {
819
- let r = ve;
660
+ let r = me;
820
661
  typeof e.addNavigation == "object" && (r = {
821
662
  ...r,
822
663
  ...e.addNavigation
823
- }), pe([
664
+ }), ve([
824
665
  {
825
666
  selectors: t,
826
667
  handlers: r
827
668
  }
828
669
  ]);
829
670
  }
830
- return (r, i) => ae((x(), k("tr", {
671
+ return (r, a) => oe((E(), k("tr", {
831
672
  ref: "rowEl",
832
673
  tabindex: r.tabIndex,
833
674
  class: "table-row"
834
675
  }, [
835
- r.store.config.view !== "uncounted" ? T(r.$slots, "index", { key: 0 }, () => [
836
- r.store.config.view === "list" ? (x(), k("td", {
676
+ r.store.config.view !== "uncounted" ? R(r.$slots, "index", { key: 0 }, () => [
677
+ r.store.config.view === "list" ? (E(), k("td", {
837
678
  key: 0,
838
679
  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", {
680
+ class: z(["list-index", r.store.hasPinnedColumns ? "sticky-index" : ""])
681
+ }, F(r.rowIndex + 1), 3)) : r.store.config.view === "tree" ? (E(), k("td", {
841
682
  key: 1,
842
683
  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)]
684
+ class: z(["tree-index", r.store.hasPinnedColumns ? "sticky-index" : ""]),
685
+ onClick: a[0] || (a[0] = (l) => r.store.toggleRowExpand(r.rowIndex))
686
+ }, F(g(o)), 3)) : U("", !0)
687
+ ]) : U("", !0),
688
+ R(r.$slots, "default")
689
+ ], 8, Mt)), [
690
+ [Le, g(n)]
850
691
  ]);
851
692
  }
852
- }), zt = {
693
+ }), je = pe ? window : void 0;
694
+ function V(e) {
695
+ var t;
696
+ const n = M(e);
697
+ return (t = n == null ? void 0 : n.$el) != null ? t : n;
698
+ }
699
+ function K(...e) {
700
+ let t, n, o, r;
701
+ if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, o, r] = e, t = je) : [t, n, o, r] = e, !t)
702
+ return P;
703
+ Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
704
+ const a = [], l = () => {
705
+ a.forEach((u) => u()), a.length = 0;
706
+ }, i = (u, f, d, v) => (u.addEventListener(f, d, v), () => u.removeEventListener(f, d, v)), s = T(
707
+ () => [V(t), M(r)],
708
+ ([u, f]) => {
709
+ if (l(), !u)
710
+ return;
711
+ const d = De(f) ? { ...f } : f;
712
+ a.push(
713
+ ...n.flatMap((v) => o.map((y) => i(u, v, y, d)))
714
+ );
715
+ },
716
+ { immediate: !0, flush: "post" }
717
+ ), c = () => {
718
+ s(), l();
719
+ };
720
+ return J(c), c;
721
+ }
722
+ let Se = !1;
723
+ function $e(e, t, n = {}) {
724
+ const { window: o = je, ignore: r = [], capture: a = !0, detectIframe: l = !1 } = n;
725
+ if (!o)
726
+ return P;
727
+ re && !Se && (Se = !0, Array.from(o.document.body.children).forEach((p) => p.addEventListener("click", P)), o.document.documentElement.addEventListener("click", P));
728
+ let i = !0;
729
+ const s = (p) => M(r).some((w) => {
730
+ if (typeof w == "string")
731
+ return Array.from(o.document.querySelectorAll(w)).some((m) => m === p.target || p.composedPath().includes(m));
732
+ {
733
+ const m = V(w);
734
+ return m && (p.target === m || p.composedPath().includes(m));
735
+ }
736
+ });
737
+ function c(p) {
738
+ const w = M(p);
739
+ return w && w.$.subTree.shapeFlag === 16;
740
+ }
741
+ function u(p, w) {
742
+ const m = M(p), C = m.$.subTree && m.$.subTree.children;
743
+ return C == null || !Array.isArray(C) ? !1 : C.some((H) => H.el === w.target || w.composedPath().includes(H.el));
744
+ }
745
+ const f = (p) => {
746
+ const w = V(e);
747
+ if (p.target != null && !(!(w instanceof Element) && c(e) && u(e, p)) && !(!w || w === p.target || p.composedPath().includes(w))) {
748
+ if (p.detail === 0 && (i = !s(p)), !i) {
749
+ i = !0;
750
+ return;
751
+ }
752
+ t(p);
753
+ }
754
+ };
755
+ let d = !1;
756
+ const v = [
757
+ K(o, "click", (p) => {
758
+ d || (d = !0, setTimeout(() => {
759
+ d = !1;
760
+ }, 0), f(p));
761
+ }, { passive: !0, capture: a }),
762
+ K(o, "pointerdown", (p) => {
763
+ const w = V(e);
764
+ i = !s(p) && !!(w && !p.composedPath().includes(w));
765
+ }, { passive: !0 }),
766
+ l && K(o, "blur", (p) => {
767
+ setTimeout(() => {
768
+ var w;
769
+ const m = V(e);
770
+ ((w = o.document.activeElement) == null ? void 0 : w.tagName) === "IFRAME" && !(m != null && m.contains(o.document.activeElement)) && t(p);
771
+ }, 0);
772
+ })
773
+ ].filter(Boolean);
774
+ return () => v.forEach((p) => p());
775
+ }
776
+ const Rt = {
777
+ mounted(e, t) {
778
+ const n = !t.modifiers.bubble;
779
+ if (typeof t.value == "function")
780
+ e.__onClickOutside_stop = $e(e, t.value, { capture: n });
781
+ else {
782
+ const [o, r] = t.value;
783
+ e.__onClickOutside_stop = $e(e, o, Object.assign({ capture: n }, r));
784
+ }
785
+ },
786
+ unmounted(e) {
787
+ e.__onClickOutside_stop();
788
+ }
789
+ };
790
+ function te(e) {
791
+ return typeof Window < "u" && e instanceof Window ? e.document.documentElement : typeof Document < "u" && e instanceof Document ? e.documentElement : e;
792
+ }
793
+ function Be(e) {
794
+ const t = window.getComputedStyle(e);
795
+ if (t.overflowX === "scroll" || t.overflowY === "scroll" || t.overflowX === "auto" && e.clientWidth < e.scrollWidth || t.overflowY === "auto" && e.clientHeight < e.scrollHeight)
796
+ return !0;
797
+ {
798
+ const n = e.parentNode;
799
+ return !n || n.tagName === "BODY" ? !1 : Be(n);
800
+ }
801
+ }
802
+ function Ot(e) {
803
+ const t = e || window.event, n = t.target;
804
+ return Be(n) ? !1 : t.touches.length > 1 ? !0 : (t.preventDefault && t.preventDefault(), !1);
805
+ }
806
+ const ne = /* @__PURE__ */ new WeakMap();
807
+ function Lt(e, t = !1) {
808
+ const n = x(t);
809
+ let o = null, r = "";
810
+ T(ht(e), (i) => {
811
+ const s = te(M(i));
812
+ if (s) {
813
+ const c = s;
814
+ if (ne.get(c) || ne.set(c, c.style.overflow), c.style.overflow !== "hidden" && (r = c.style.overflow), c.style.overflow === "hidden")
815
+ return n.value = !0;
816
+ if (n.value)
817
+ return c.style.overflow = "hidden";
818
+ }
819
+ }, {
820
+ immediate: !0
821
+ });
822
+ const a = () => {
823
+ const i = te(M(e));
824
+ !i || n.value || (re && (o = K(
825
+ i,
826
+ "touchmove",
827
+ (s) => {
828
+ Ot(s);
829
+ },
830
+ { passive: !1 }
831
+ )), i.style.overflow = "hidden", n.value = !0);
832
+ }, l = () => {
833
+ const i = te(M(e));
834
+ !i || !n.value || (re && (o == null || o()), i.style.overflow = r, ne.delete(i), n.value = !1);
835
+ };
836
+ return J(l), $({
837
+ get() {
838
+ return n.value;
839
+ },
840
+ set(i) {
841
+ i ? a() : l();
842
+ }
843
+ });
844
+ }
845
+ function Pt() {
846
+ let e = !1;
847
+ const t = x(!1);
848
+ return (n, o) => {
849
+ if (t.value = o.value, e)
850
+ return;
851
+ e = !0;
852
+ const r = Lt(n, o.value);
853
+ T(t, (a) => r.value = a);
854
+ };
855
+ }
856
+ Pt();
857
+ const Dt = {
853
858
  key: 0,
854
859
  id: "resizable"
855
- }, Ft = {
860
+ }, Wt = {
856
861
  class: "atable-header-row",
857
862
  tabindex: "-1"
858
- }, Ue = /* @__PURE__ */ D({
863
+ }, ze = /* @__PURE__ */ W({
859
864
  __name: "ATableHeader",
860
865
  props: {
861
866
  columns: {},
862
867
  store: {}
863
868
  },
864
869
  setup(e) {
865
- return (t, n) => t.columns.length ? (x(), k("thead", zt, [
866
- N("tr", Ft, [
867
- t.store.zeroColumn ? (x(), k("th", {
870
+ return (t, n) => t.columns.length ? (E(), k("thead", Dt, [
871
+ B("tr", Wt, [
872
+ t.store.zeroColumn ? (E(), k("th", {
868
873
  key: 0,
869
874
  id: "header-index",
870
- class: B([[
875
+ class: z([[
871
876
  t.store.hasPinnedColumns ? "sticky-index" : "",
872
877
  t.store.config.view === "tree" ? "tree-index" : "",
873
878
  t.store.config.view === "list-expansion" ? "list-expansion-index" : ""
874
879
  ], "list-index"])
875
- }, null, 2)) : F("", !0),
876
- (x(!0), k(Z, null, ne(t.columns, (o, r) => (x(), k("th", {
880
+ }, null, 2)) : U("", !0),
881
+ (E(!0), k(_, null, le(t.columns, (o, r) => (E(), k("th", {
877
882
  key: o.name,
878
883
  tabindex: "-1",
879
- style: H(t.store.getHeaderCellStyle(o)),
880
- class: B(o.pinned ? "sticky-column" : "")
884
+ style: j(t.store.getHeaderCellStyle(o)),
885
+ class: z(o.pinned ? "sticky-column" : "")
881
886
  }, [
882
- T(t.$slots, "default", {}, () => [
883
- Ze(z(o.label || String.fromCharCode(r + 97).toUpperCase()), 1)
887
+ R(t.$slots, "default", {}, () => [
888
+ Je(F(o.label || String.fromCharCode(r + 97).toUpperCase()), 1)
884
889
  ])
885
890
  ], 6))), 128))
886
891
  ])
887
- ])) : F("", !0);
892
+ ])) : U("", !0);
888
893
  }
889
- }), Ge = /* @__PURE__ */ D({
894
+ }), Fe = /* @__PURE__ */ W({
890
895
  __name: "ATableModal",
891
896
  props: {
892
897
  colIndex: {},
@@ -897,92 +902,92 @@ const Lt = (e) => {
897
902
  const t = (n) => {
898
903
  n.stopPropagation();
899
904
  };
900
- return (n, o) => (x(), k("div", {
905
+ return (n, o) => (E(), k("div", {
901
906
  class: "amodal",
902
907
  tabindex: "-1",
903
908
  onClick: t,
904
909
  onInput: t
905
910
  }, [
906
- T(n.$slots, "default")
911
+ R(n.$slots, "default")
907
912
  ], 32));
908
913
  }
909
- }), Ut = (e) => {
914
+ }), Ht = (e) => {
910
915
  const t = e.id || crypto.randomUUID();
911
- return Ke(`table-${t}`, () => {
916
+ return Qe(`table-${t}`, () => {
912
917
  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] = {
918
+ const h = {};
919
+ for (const [b, I] of a.value.entries())
920
+ for (const [S, A] of l.value.entries())
921
+ h[`${b}:${S}`] = A[I.name];
922
+ return h;
923
+ }, r = (h) => {
924
+ const b = [Object.assign({}, { rowModified: !1 })];
925
+ if (h && "0:0" in h)
926
+ return h;
927
+ const I = /* @__PURE__ */ new Set();
928
+ for (let S = l.value.length - 1; S >= 0; S--) {
929
+ const A = l.value[S];
930
+ A.parent && I.add(A.parent), b[S] = {
926
931
  childrenOpen: !1,
927
932
  expanded: !1,
928
933
  indent: A.indent || null,
929
- isParent: C.has(I),
934
+ isParent: I.has(S),
930
935
  isRoot: A.parent === null || A.parent === void 0,
931
936
  rowModified: !1,
932
937
  open: A.parent === null || A.parent === void 0,
933
938
  parent: A.parent
934
939
  };
935
940
  }
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;
941
+ return b;
942
+ }, 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, I) => {
943
+ const S = `${h}:${b}`, A = a.value[h];
944
+ s.value[S] !== I && (c.value[b].rowModified = !0), s.value[S] = I, l.value[b][A.name] = I;
945
+ }, w = (h) => ({
946
+ minWidth: h.width || "40ch",
947
+ textAlign: h.align || "center",
948
+ width: i.value.fullWidth ? "auto" : null
949
+ }), 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) => {
950
+ if (i.value.view === "tree") {
951
+ c.value[h].childrenOpen = !c.value[h].childrenOpen;
952
+ for (let b = l.value.length - 1; b >= 0; b--)
953
+ c.value[b].parent === h && (c.value[b].open = !c.value[b].open, c.value[b].childrenOpen && H(b));
954
+ } else i.value.view === "list-expansion" && (c.value[h].expanded = !c.value[h].expanded);
955
+ }, Ue = (h, b) => {
956
+ const I = y(h, b);
957
+ return he(h, b, I);
958
+ }, he = (h, b, I) => {
959
+ const S = a.value[h], A = l.value[b], N = S.format;
960
+ return N ? typeof N == "function" ? N(I, { table: s.value, row: A, column: S }) : typeof N == "string" ? Function(`"use strict";return (${N})`)()(I, { table: s.value, row: A, column: S }) : I : I;
956
961
  };
957
962
  return {
958
963
  // state
959
- columns: i,
964
+ columns: a,
960
965
  rows: l,
961
- config: c,
966
+ config: i,
962
967
  table: s,
963
- display: u,
964
- modal: d,
968
+ display: c,
969
+ modal: u,
965
970
  // getters
966
- hasPinnedColumns: m,
967
- numberedRowWidth: a,
968
- zeroColumn: f,
971
+ hasPinnedColumns: f,
972
+ numberedRowWidth: d,
973
+ zeroColumn: v,
969
974
  // 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);
975
+ closeModal: (h) => {
976
+ var b;
977
+ h.target instanceof Node && (b = u.value.parent) != null && b.contains(h.target) || u.value.visible && (u.value.visible = !1);
973
978
  },
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
979
+ getCellData: y,
980
+ getCellDisplayValue: Ue,
981
+ getFormattedValue: he,
982
+ getHeaderCellStyle: w,
983
+ getIndent: (h, b) => b && h === 0 && b > 0 ? `${b}ch` : "inherit",
984
+ getRowExpandSymbol: C,
985
+ isRowVisible: m,
986
+ setCellData: p,
987
+ toggleRowExpand: H
983
988
  };
984
989
  })();
985
- }, Gt = /* @__PURE__ */ D({
990
+ }, Nt = /* @__PURE__ */ W({
986
991
  __name: "ATable",
987
992
  props: {
988
993
  id: {},
@@ -993,76 +998,76 @@ const Lt = (e) => {
993
998
  },
994
999
  emits: ["update:modelValue", "cellUpdate"],
995
1000
  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 }) => {
1001
+ 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 });
1002
+ l.$onAction(({ name: s, store: c, args: u }) => {
998
1003
  if (s === "setCellData") {
999
- const [m, a, f] = d, v = u.getCellData(m, a);
1000
- o("cellUpdate", [m, a, f, v]);
1004
+ const [f, d, v] = u, y = c.getCellData(f, d);
1005
+ o("cellUpdate", [f, d, v, y]);
1001
1006
  }
1002
- }), $(
1007
+ }), T(
1003
1008
  () => l.rows,
1004
1009
  (s) => {
1005
1010
  o("update:modelValue", s);
1006
1011
  },
1007
1012
  { deep: !0 }
1008
- ), q(() => {
1009
- e.columns.some((s) => s.pinned) && (c(), l.config.view === "tree" && Be(r, c, { childList: !0, subtree: !0 }));
1013
+ ), Y(() => {
1014
+ e.columns.some((s) => s.pinned) && (i(), l.config.view === "tree" && He(r, i, { childList: !0, subtree: !0 }));
1010
1015
  });
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`);
1016
+ const i = () => {
1017
+ const s = r.value, c = s.rows[0], u = s.rows[1], f = c ? Array.from(c.cells) : [];
1018
+ for (const [d, v] of f.entries()) {
1019
+ const y = u == null ? void 0 : u.cells[d];
1020
+ y && (v.style.width = `${y.offsetWidth}px`);
1016
1021
  }
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");
1022
+ for (const d of s.rows) {
1023
+ let v = 0;
1024
+ const y = [];
1025
+ for (const p of d.cells)
1026
+ (p.classList.contains("sticky-column") || p.classList.contains("sticky-index")) && (p.style.left = `${v}px`, v += p.offsetWidth, y.push(p));
1027
+ y.length > 0 && y[y.length - 1].classList.add("sticky-column-edge");
1023
1028
  }
1024
1029
  };
1025
1030
  return window.addEventListener("keydown", (s) => {
1026
1031
  if (s.key === "Escape" && l.modal.visible) {
1027
1032
  l.modal.visible = !1;
1028
- const u = l.modal.parent;
1029
- u && Re().then(() => {
1030
- u.focus();
1033
+ const c = l.modal.parent;
1034
+ c && Re().then(() => {
1035
+ c.focus();
1031
1036
  });
1032
1037
  }
1033
- }), t({ store: l }), (s, u) => (x(), k("table", {
1038
+ }), t({ store: l }), (s, c) => oe((E(), k("table", {
1034
1039
  ref: "table",
1035
1040
  class: "atable",
1036
- style: H({ width: w(l).config.fullWidth ? "100%" : "auto" })
1041
+ style: j({ width: g(l).config.fullWidth ? "100%" : "auto" })
1037
1042
  }, [
1038
- T(s.$slots, "header", { data: w(l) }, () => [
1039
- be(Ue, {
1040
- columns: w(l).columns,
1041
- store: w(l)
1043
+ R(s.$slots, "header", { data: g(l) }, () => [
1044
+ ge(ze, {
1045
+ columns: g(l).columns,
1046
+ store: g(l)
1042
1047
  }, null, 8, ["columns", "store"])
1043
1048
  ], !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)
1049
+ B("tbody", null, [
1050
+ R(s.$slots, "body", { data: g(l) }, () => [
1051
+ (E(!0), k(_, null, le(g(l).rows, (u, f) => (E(), Z(Ve, {
1052
+ key: u.id,
1053
+ row: u,
1054
+ rowIndex: f,
1055
+ store: g(l)
1051
1056
  }, {
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,
1057
+ default: ye(() => [
1058
+ (E(!0), k(_, null, le(g(l).columns, (d, v) => (E(), Z(Ne, {
1059
+ key: d.name,
1060
+ store: g(l),
1061
+ col: d,
1057
1062
  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
1063
+ pinned: d.pinned,
1064
+ rowIndex: f,
1065
+ colIndex: v,
1066
+ component: d.cellComponent,
1067
+ style: j({
1068
+ textAlign: (d == null ? void 0 : d.align) || "center",
1069
+ minWidth: (d == null ? void 0 : d.width) || "40ch",
1070
+ width: g(l).config.fullWidth ? "auto" : null
1066
1071
  })
1067
1072
  }, null, 8, ["store", "col", "pinned", "rowIndex", "colIndex", "component", "style"]))), 128))
1068
1073
  ]),
@@ -1070,50 +1075,52 @@ const Lt = (e) => {
1070
1075
  }, 1032, ["row", "rowIndex", "store"]))), 128))
1071
1076
  ], !0)
1072
1077
  ]),
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"
1078
+ R(s.$slots, "footer", { data: g(l) }, void 0, !0),
1079
+ R(s.$slots, "modal", { data: g(l) }, () => [
1080
+ oe(ge(Fe, {
1081
+ colIndex: g(l).modal.colIndex,
1082
+ rowIndex: g(l).modal.rowIndex,
1083
+ store: g(l),
1084
+ style: j({
1085
+ left: g(l).modal.left + "px",
1086
+ top: g(l).modal.top + "px",
1087
+ maxWidth: g(l).modal.width + "px"
1083
1088
  })
1084
1089
  }, {
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"]))
1090
+ default: ye(() => [
1091
+ (E(), Z(Oe(g(l).modal.component), ae({
1092
+ key: `${g(l).modal.rowIndex}:${g(l).modal.colIndex}`,
1093
+ colIndex: g(l).modal.colIndex,
1094
+ rowIndex: g(l).modal.rowIndex,
1095
+ store: g(l)
1096
+ }, g(l).modal.componentProps), null, 16, ["colIndex", "rowIndex", "store"]))
1092
1097
  ]),
1093
1098
  _: 1
1094
1099
  }, 8, ["colIndex", "rowIndex", "store", "style"]), [
1095
- [De, w(l).modal.visible]
1100
+ [Le, g(l).modal.visible]
1096
1101
  ])
1097
1102
  ], !0)
1098
- ], 4));
1103
+ ], 4)), [
1104
+ [g(Rt), g(l).closeModal]
1105
+ ]);
1099
1106
  }
1100
- }), qt = (e, t) => {
1107
+ }), Vt = (e, t) => {
1101
1108
  const n = e.__vccOpts || e;
1102
1109
  for (const [o, r] of t)
1103
1110
  n[o] = r;
1104
1111
  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);
1112
+ }, jt = /* @__PURE__ */ Vt(Nt, [["__scopeId", "data-v-a7848db7"]]);
1113
+ function Gt(e) {
1114
+ 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
1115
  }
1109
1116
  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
1117
+ Ne as ACell,
1118
+ Tt as AExpansionRow,
1119
+ Ve as ARow,
1120
+ jt as ATable,
1121
+ ze as ATableHeader,
1122
+ Fe as ATableModal,
1123
+ Ht as createTableStore,
1124
+ Gt as install
1118
1125
  };
1119
1126
  //# sourceMappingURL=atable.js.map