@stonecrop/atable 0.3.8 → 0.3.10

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