@stonecrop/atable 0.2.41 → 0.2.42

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