@stonecrop/atable 0.3.2 → 0.3.4

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