@stonecrop/atable 0.3.3 → 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 Ge, computed as S, unref as g, getCurrentScope as Te, onScopeDispose as Me, getCurrentInstance as se, nextTick as Re, toRef as Ye, readonly as Xe, customRef as Je, defineComponent as H, useTemplateRef as X, openBlock as E, createElementBlock as k, normalizeStyle as B, normalizeClass as z, createBlock as K, resolveDynamicComponent as Oe, mergeProps as ae, toDisplayString as F, Fragment as ee, createElementVNode as j, renderSlot as R, createCommentVNode as U, withDirectives as oe, vShow as Le, renderList as le, createTextVNode as Qe, createVNode as ge, withCtx as ye } from "vue";
2
- import { defineStore as Ze } 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 Ke = 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 _e = (e) => e != null, et = Object.prototype.toString, tt = (e) => et.call(e) === "[object Object]", nt = () => {
12
- }, J = Ke ? 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 = J) : [t, n, o, r] = e, !t)
21
- return nt;
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 = tt(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 ot() {
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 lt(e) {
48
- const t = ot();
49
- return S(() => (t.value, !!e()));
47
+ function st(e) {
48
+ const t = rt();
49
+ return $(() => (t.value, !!e()));
50
50
  }
51
- function rt(e, t, n = {}) {
52
- const { window: o = J, ...r } = n;
51
+ function at(e, t, o = {}) {
52
+ const { window: n = Q, ...s } = o;
53
53
  let a;
54
- const l = lt(() => o && "MutationObserver" in o), i = () => {
54
+ const l = st(() => n && "MutationObserver" in n), i = () => {
55
55
  a && (a.disconnect(), a = void 0);
56
- }, s = S(() => {
57
- const d = ie(e), v = (Array.isArray(d) ? d : [d]).map(q).filter(_e);
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 st(e = {}) {
74
+ function it(e = {}) {
75
75
  var t;
76
76
  const {
77
- window: n = J,
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 && rt(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 at = "focusin", it = "focusout";
102
- function ct(e, t = {}) {
103
- const { window: n = J } = t, o = S(() => q(e)), r = x(!1), a = S(() => r.value), l = st(t);
104
- return !n || !l.value ? { focused: a } : (G(o, at, () => r.value = !0), G(o, it, () => 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 ut(e, { window: t = J, 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 = ut(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
- }, dt = (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
- }, ft = (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
- }, Z = ["alt", "control", "shift", "meta"], mt = {
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 = dt(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 = ft(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 = mt[i.key] || i.key.toLowerCase();
326
- if (Z.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) => Z.includes(w)), p = Z.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 Z)
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 } = ct(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
- }), Ge(() => {
358
+ }), Xe(() => {
359
359
  for (const l of a)
360
360
  l();
361
361
  });
362
362
  }
363
- function Q(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 vt = (e) => e != null, pt = Object.prototype.toString, De = (e) => pt.call(e) === "[object Object]", P = () => {
372
- }, re = /* @__PURE__ */ wt();
373
- function wt() {
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 ht(e) {
378
- return se();
377
+ function yt(e) {
378
+ return ae();
379
379
  }
380
- function gt(...e) {
380
+ function bt(...e) {
381
381
  if (e.length !== 1)
382
- return Ye(...e);
382
+ return Je(...e);
383
383
  const t = e[0];
384
- return typeof t == "function" ? Xe(Je(() => ({ get: t, set: P }))) : x(t);
384
+ return typeof t == "function" ? Qe(Ze(() => ({ get: t, set: H }))) : x(t);
385
385
  }
386
- function yt(e, t = !0, n) {
387
- ht() ? 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 Q(c), c;
416
+ return Z(r), r;
417
417
  }
418
- function bt() {
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 He(e) {
425
- const t = bt();
426
- return S(() => (t.value, !!e()));
424
+ function Ne(e) {
425
+ const t = Et();
426
+ return $(() => (t.value, !!e()));
427
427
  }
428
- function We(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 = He(() => o && "MutationObserver" in o), i = () => {
431
+ const l = Ne(() => n && "MutationObserver" in n), i = () => {
432
432
  a && (a.disconnect(), a = void 0);
433
- }, s = S(() => {
434
- const d = M(e), v = (Array.isArray(d) ? d : [d]).map(D).filter(vt);
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 Q(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 xt(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 = He(() => o && "ResizeObserver" in o), i = () => {
454
+ const l = Ne(() => n && "ResizeObserver" in n), i = () => {
455
455
  a && (a.disconnect(), a = void 0);
456
- }, s = 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 Q(u), {
472
+ return Z(c), {
473
473
  isSupported: l,
474
- stop: u
474
+ stop: c
475
475
  };
476
476
  }
477
- function Ne(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 xt(e, w), T(() => D(e), (m) => !m && w()), We(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 }), yt(() => {
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 }, Ve = /* @__PURE__ */ H({
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 = X("cell"), { width: n, height: o } = Ne(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 = S(() => typeof a.value == "string" ? Et(a.value) : !1), v = S(() => {
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 = t.value.offsetTop + t.value.offsetHeight, m.modal.left = t.value.offsetLeft, m.modal.width = n.value, m.modal.height = o.value, 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: B(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(), K(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__ */ H({
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 = X("rowEl"), n = S(() => 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(ee, null, [
621
- j("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
- j("td", {
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
- j("td", {
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"], je = /* @__PURE__ */ H({
643
+ }), Ot = ["tabindex"], ze = /* @__PURE__ */ N({
650
644
  __name: "ARow",
651
645
  props: {
652
646
  rowIndex: {},
@@ -655,243 +649,243 @@ const Et = (e) => {
655
649
  addNavigation: { type: [Boolean, Object], default: !1 }
656
650
  },
657
651
  setup(e) {
658
- const t = X("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
- }), Be = 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 _(...e) {
700
- let t, n, o, r;
701
- if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, o, r] = e, t = Be) : [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 Q(c), c;
714
+ return Z(r), r;
721
715
  }
722
- let Se = !1;
723
- function $e(e, t, n = {}) {
724
- const { window: o = Be, 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((W) => W.el === w.target || w.composedPath().includes(W.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
- _(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
- _(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 && _(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 ze(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 : ze(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 ze(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(gt(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 = _(
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 Q(l), S({
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
- }, Ht = {
854
+ }, Nt = {
861
855
  class: "atable-header-row",
862
856
  tabindex: "-1"
863
- }, Fe = /* @__PURE__ */ H({
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
- j("tr", Ht, [
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(ee, 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: B(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
- Qe(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
- }), Ue = /* @__PURE__ */ H({
888
+ }), Ge = /* @__PURE__ */ N({
895
889
  __name: "ATableModal",
896
890
  props: {
897
891
  colIndex: {},
@@ -900,104 +894,109 @@ const Dt = {
900
894
  container: {}
901
895
  },
902
896
  setup(e) {
903
- const t = X("amodal"), { width: n, height: o } = Ne(t), r = S(() => {
904
- var u, f;
905
- const l = ((u = e.container) == null ? void 0 : u.offsetWidth) || 0, i = ((f = e.container) == null ? void 0 : f.offsetHeight) || 0, s = e.store.modal.left + n.value > l ? e.store.modal.left - (n.value - e.store.modal.width) : e.store.modal.left, c = e.store.modal.top + o.value > i ? e.store.modal.top - o.value - e.store.modal.height : e.store.modal.top;
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;
906
900
  return {
907
- left: `${s}px`,
908
- top: `${c}px`
901
+ left: `${u}px`,
902
+ top: `${r}px`
909
903
  };
910
904
  }), a = (l) => {
911
905
  l.stopPropagation();
912
906
  };
913
- return (l, i) => (E(), k("div", {
907
+ return (l, i) => (C(), S("div", {
914
908
  class: "amodal",
915
909
  ref: "amodal",
916
910
  tabindex: "-1",
917
911
  onClick: a,
918
912
  onInput: a,
919
- style: B(r.value)
913
+ style: z(s.value)
920
914
  }, [
921
- R(l.$slots, "default")
915
+ L(l.$slots, "default")
922
916
  ], 36));
923
917
  }
924
- }), Wt = (e) => {
918
+ }), Vt = (e) => {
925
919
  const t = e.id || crypto.randomUUID();
926
- return Ze(`table-${t}`, () => {
927
- const o = () => {
928
- const h = {};
929
- for (const [b, I] of a.value.entries())
930
- for (const [$, A] of l.value.entries())
931
- h[`${b}:${$}`] = A[I.name];
932
- return h;
933
- }, r = (h) => {
934
- const b = [Object.assign({}, { rowModified: !1 })];
935
- if (h && "0:0" in h)
936
- return h;
937
- const I = /* @__PURE__ */ new Set();
938
- for (let $ = l.value.length - 1; $ >= 0; $--) {
939
- const A = l.value[$];
940
- A.parent && I.add(A.parent), b[$] = {
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] = {
941
935
  childrenOpen: !1,
942
936
  expanded: !1,
943
- indent: A.indent || null,
944
- isParent: I.has($),
945
- 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,
946
940
  rowModified: !1,
947
- open: A.parent === null || A.parent === void 0,
948
- parent: A.parent
941
+ open: T.parent === null || T.parent === void 0,
942
+ parent: T.parent
949
943
  };
950
944
  }
951
- return b;
952
- }, 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 = S(() => a.value.some((h) => h.pinned)), d = S(() => `${Math.ceil(l.value.length / 100 + 1)}ch`), v = S(() => ["list", "tree", "list-expansion"].includes(i.value.view)), y = (h, b) => s.value[`${h}:${b}`], p = (h, b, I) => {
953
- const $ = `${h}:${b}`, A = a.value[h];
954
- s.value[$] !== I && (c.value[b].rowModified = !0), s.value[$] = I, l.value[b][A.name] = I;
955
- }, w = (h) => ({
956
- minWidth: h.width || "40ch",
957
- 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",
958
955
  width: i.value.fullWidth ? "auto" : null
959
- }), 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 ? "-" : "+" : "", W = (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) => {
960
957
  if (i.value.view === "tree") {
961
- c.value[h].childrenOpen = !c.value[h].childrenOpen;
962
- for (let b = l.value.length - 1; b >= 0; b--)
963
- c.value[b].parent === h && (c.value[b].open = !c.value[b].open, c.value[b].childrenOpen && W(b));
964
- } else i.value.view === "list-expansion" && (c.value[h].expanded = !c.value[h].expanded);
965
- }, qe = (h, b) => {
966
- const I = y(h, b);
967
- return he(h, b, I);
968
- }, he = (h, b, I) => {
969
- const $ = a.value[h], A = l.value[b], N = $.format;
970
- return N ? typeof N == "function" ? N(I, { table: s.value, row: A, column: $ }) : typeof N == "string" ? Function(`"use strict";return (${N})`)()(I, { table: s.value, row: A, column: $ }) : 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;
971
968
  };
972
969
  return {
973
970
  // state
974
971
  columns: a,
975
- rows: l,
976
972
  config: i,
977
- table: s,
978
- display: c,
979
- modal: u,
973
+ display: r,
974
+ modal: c,
975
+ rows: l,
976
+ table: u,
977
+ updates: d,
980
978
  // getters
981
979
  hasPinnedColumns: f,
982
- numberedRowWidth: d,
983
- zeroColumn: v,
980
+ numberedRowWidth: m,
981
+ zeroColumn: b,
984
982
  // actions
985
- closeModal: (h) => {
986
- var b;
987
- 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);
988
986
  },
989
- getCellData: y,
990
- getCellDisplayValue: qe,
991
- getFormattedValue: he,
992
- getHeaderCellStyle: w,
993
- getIndent: (h, b) => b && h === 0 && b > 0 ? `${b}ch` : "inherit",
994
- getRowExpandSymbol: C,
995
- isRowVisible: m,
996
- setCellData: p,
997
- toggleRowExpand: W
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
998
997
  };
999
998
  })();
1000
- }, Nt = /* @__PURE__ */ H({
999
+ }, jt = /* @__PURE__ */ N({
1001
1000
  __name: "ATable",
1002
1001
  props: {
1003
1002
  id: {},
@@ -1007,126 +1006,131 @@ const Dt = {
1007
1006
  config: { default: () => new Object() }
1008
1007
  },
1009
1008
  emits: ["update:modelValue", "cellUpdate"],
1010
- setup(e, { expose: t, emit: n }) {
1011
- const o = n, r = X("table"), a = e.modelValue ? e.modelValue : e.rows, l = Wt({ columns: e.columns, rows: a, id: e.id, config: e.config });
1012
- l.$onAction(({ name: s, store: c, args: u }) => {
1013
- if (s === "setCellData") {
1014
- const [f, d, v] = u, y = c.getCellData(f, d);
1015
- 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
+ });
1016
1017
  }
1017
- }), T(
1018
+ }), R(
1018
1019
  () => l.rows,
1019
- (s) => {
1020
- o("update:modelValue", s);
1020
+ (r) => {
1021
+ n("update:modelValue", r);
1021
1022
  },
1022
1023
  { deep: !0 }
1023
- ), Y(() => {
1024
- e.columns.some((s) => s.pinned) && (i(), l.config.view === "tree" && We(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 }));
1025
1026
  });
1026
- const i = () => {
1027
- const s = r.value, c = s.rows[0], u = s.rows[1], f = c ? Array.from(c.cells) : [];
1028
- for (const [d, v] of f.entries()) {
1029
- const y = u == null ? void 0 : u.cells[d];
1030
- 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`);
1031
1034
  }
1032
- for (const d of s.rows) {
1033
- let v = 0;
1034
- const y = [];
1035
- for (const p of d.cells)
1036
- (p.classList.contains("sticky-column") || p.classList.contains("sticky-index")) && (p.style.left = `${v}px`, v += p.offsetWidth, y.push(p));
1037
- 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");
1038
1041
  }
1039
1042
  };
1040
- return window.addEventListener("keydown", (s) => {
1041
- if (s.key === "Escape" && l.modal.visible) {
1043
+ return window.addEventListener("keydown", (r) => {
1044
+ if (r.key === "Escape" && l.modal.visible) {
1042
1045
  l.modal.visible = !1;
1043
1046
  const c = l.modal.parent;
1044
- c && Re().then(() => {
1047
+ c && Le().then(() => {
1045
1048
  c.focus();
1046
1049
  });
1047
1050
  }
1048
- }), t({ store: l }), (s, c) => oe((E(), k("table", {
1051
+ }), t({ store: l }), (r, c) => le((C(), S("table", {
1049
1052
  ref: "table",
1050
1053
  class: "atable",
1051
- style: B({ width: g(l).config.fullWidth ? "100%" : "auto" })
1054
+ style: z({ width: h(l).config.fullWidth ? "100%" : "auto" })
1052
1055
  }, [
1053
- R(s.$slots, "header", { data: g(l) }, () => [
1054
- ge(Fe, {
1055
- columns: g(l).columns,
1056
- store: g(l)
1056
+ L(r.$slots, "header", { data: h(l) }, () => [
1057
+ be(qe, {
1058
+ columns: h(l).columns,
1059
+ store: h(l)
1057
1060
  }, null, 8, ["columns", "store"])
1058
1061
  ], !0),
1059
- j("tbody", null, [
1060
- R(s.$slots, "body", { data: g(l) }, () => [
1061
- (E(!0), k(ee, null, le(g(l).rows, (u, f) => (E(), K(je, {
1062
- key: u.id,
1063
- row: u,
1062
+ B("tbody", null, [
1063
+ L(r.$slots, "body", { data: h(l) }, () => [
1064
+ (C(!0), S(te, null, re(h(l).rows, (d, f) => (C(), _(ze, {
1065
+ key: d.id,
1066
+ row: d,
1064
1067
  rowIndex: f,
1065
- store: g(l)
1068
+ store: h(l)
1066
1069
  }, {
1067
- default: ye(() => [
1068
- (E(!0), k(ee, null, le(g(l).columns, (d, v) => (E(), K(Ve, {
1069
- key: d.name,
1070
- store: g(l),
1071
- 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,
1072
1075
  spellcheck: "false",
1073
- pinned: d.pinned,
1076
+ pinned: m.pinned,
1074
1077
  rowIndex: f,
1075
- colIndex: v,
1076
- component: d.cellComponent,
1077
- style: B({
1078
- textAlign: (d == null ? void 0 : d.align) || "center",
1079
- minWidth: (d == null ? void 0 : d.width) || "40ch",
1080
- width: g(l).config.fullWidth ? "auto" : null
1081
- })
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
1082
1086
  }, null, 8, ["store", "col", "pinned", "rowIndex", "colIndex", "component", "style"]))), 128))
1083
1087
  ]),
1084
1088
  _: 2
1085
1089
  }, 1032, ["row", "rowIndex", "store"]))), 128))
1086
1090
  ], !0)
1087
1091
  ]),
1088
- R(s.$slots, "footer", { data: g(l) }, void 0, !0),
1089
- R(s.$slots, "modal", { data: g(l) }, () => [
1090
- oe(ge(Ue, {
1091
- colIndex: g(l).modal.colIndex,
1092
- rowIndex: g(l).modal.rowIndex,
1093
- store: g(l),
1094
- container: g(r)
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)
1095
1099
  }, {
1096
- default: ye(() => [
1097
- (E(), K(Oe(g(l).modal.component), ae({
1098
- key: `${g(l).modal.rowIndex}:${g(l).modal.colIndex}`,
1099
- colIndex: g(l).modal.colIndex,
1100
- rowIndex: g(l).modal.rowIndex,
1101
- store: g(l)
1102
- }, 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"]))
1103
1107
  ]),
1104
1108
  _: 1
1105
1109
  }, 8, ["colIndex", "rowIndex", "store", "container"]), [
1106
- [Le, g(l).modal.visible]
1110
+ [De, h(l).modal.visible]
1107
1111
  ])
1108
1112
  ], !0)
1109
1113
  ], 4)), [
1110
- [g(Rt), g(l).closeModal]
1114
+ [h(Lt), h(l).closeModal]
1111
1115
  ]);
1112
1116
  }
1113
- }), Vt = (e, t) => {
1114
- const n = e.__vccOpts || e;
1115
- for (const [o, r] of t)
1116
- n[o] = r;
1117
- return n;
1118
- }, jt = /* @__PURE__ */ Vt(Nt, [["__scopeId", "data-v-7a1c014a"]]);
1119
- function Gt(e) {
1120
- e.component("ACell", Ve), e.component("AExpansionRow", Tt), e.component("ARow", je), e.component("ATable", jt), e.component("ATableHeader", Fe), e.component("ATableModal", Ue);
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);
1121
1125
  }
1122
1126
  export {
1123
- Ve as ACell,
1124
- Tt as AExpansionRow,
1125
- je as ARow,
1126
- jt as ATable,
1127
- Fe as ATableHeader,
1128
- Ue as ATableModal,
1129
- Wt as createTableStore,
1130
- 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
1131
1135
  };
1132
1136
  //# sourceMappingURL=atable.js.map