@stonecrop/atable 0.2.21 → 0.2.23

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,94 +1,94 @@
1
- import { onMounted as Re, ref as x, watch as C, onBeforeUnmount as Oe, computed as _, unref as d, getCurrentScope as we, onScopeDispose as ge, defineComponent as A, inject as P, openBlock as g, createElementBlock as y, createBlock as N, resolveDynamicComponent as be, mergeProps as Q, toDisplayString as L, Fragment as B, createElementVNode as $, renderSlot as E, createCommentVNode as F, useCssVars as ye, withDirectives as G, vShow as xe, toRef as Le, readonly as Pe, customRef as Me, reactive as D, renderList as Y, normalizeStyle as V, createTextVNode as We, provide as He, nextTick as je, createVNode as re, withCtx as se } from "vue";
2
- function Ne(t) {
3
- return we() ? (ge(t), !0) : !1;
1
+ import { onMounted as Te, ref as x, watch as A, onBeforeUnmount as $e, computed as C, unref as d, getCurrentScope as we, onScopeDispose as ve, defineComponent as _, inject as L, openBlock as g, createElementBlock as b, createBlock as j, resolveDynamicComponent as ge, mergeProps as J, toDisplayString as O, Fragment as V, createElementVNode as T, renderSlot as E, createCommentVNode as B, withDirectives as q, vShow as ye, toRef as Re, readonly as Oe, customRef as Le, reactive as S, renderList as G, normalizeStyle as N, createTextVNode as Pe, provide as Me, nextTick as He, createVNode as le, withCtx as re } from "vue";
2
+ function We(t) {
3
+ return we() ? (ve(t), !0) : !1;
4
4
  }
5
- function Ee(t) {
5
+ function be(t) {
6
6
  return typeof t == "function" ? t() : d(t);
7
7
  }
8
- const Ve = typeof window < "u" && typeof document < "u";
8
+ const je = typeof window < "u" && typeof document < "u";
9
9
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
10
- const Ue = Object.prototype.toString, Be = (t) => Ue.call(t) === "[object Object]", Fe = () => {
10
+ const Ne = Object.prototype.toString, Ue = (t) => Ne.call(t) === "[object Object]", Ve = () => {
11
11
  };
12
- function z(t) {
12
+ function F(t) {
13
13
  var e;
14
- const n = Ee(t);
14
+ const n = be(t);
15
15
  return (e = n == null ? void 0 : n.$el) != null ? e : n;
16
16
  }
17
- const Z = Ve ? window : void 0;
18
- function X(...t) {
17
+ const Q = je ? window : void 0;
18
+ function Y(...t) {
19
19
  let e, n, o, a;
20
- if (typeof t[0] == "string" || Array.isArray(t[0]) ? ([n, o, a] = t, e = Z) : [e, n, o, a] = t, !e)
21
- return Fe;
20
+ if (typeof t[0] == "string" || Array.isArray(t[0]) ? ([n, o, a] = t, e = Q) : [e, n, o, a] = t, !e)
21
+ return Ve;
22
22
  Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
23
- const l = [], s = () => {
23
+ const l = [], i = () => {
24
24
  l.forEach((m) => m()), l.length = 0;
25
- }, r = (m, f, c, p) => (m.addEventListener(f, c, p), () => m.removeEventListener(f, c, p)), i = C(
26
- () => [z(e), Ee(a)],
25
+ }, r = (m, f, c, p) => (m.addEventListener(f, c, p), () => m.removeEventListener(f, c, p)), s = A(
26
+ () => [F(e), be(a)],
27
27
  ([m, f]) => {
28
- if (s(), !m)
28
+ if (i(), !m)
29
29
  return;
30
- const c = Be(f) ? { ...f } : f;
30
+ const c = Ue(f) ? { ...f } : f;
31
31
  l.push(
32
- ...n.flatMap((p) => o.map((w) => r(m, p, w, c)))
32
+ ...n.flatMap((p) => o.map((v) => r(m, p, v, c)))
33
33
  );
34
34
  },
35
35
  { immediate: !0, flush: "post" }
36
36
  ), u = () => {
37
- i(), s();
37
+ s(), i();
38
38
  };
39
- return Ne(u), u;
39
+ return We(u), u;
40
40
  }
41
- function ze(t = {}) {
41
+ function Be(t = {}) {
42
42
  var e;
43
43
  const {
44
- window: n = Z,
44
+ window: n = Q,
45
45
  deep: o = !0
46
46
  } = t, a = (e = t.document) != null ? e : n == null ? void 0 : n.document, l = () => {
47
- var i;
47
+ var s;
48
48
  let u = a == null ? void 0 : a.activeElement;
49
49
  if (o)
50
50
  for (; u != null && u.shadowRoot; )
51
- u = (i = u == null ? void 0 : u.shadowRoot) == null ? void 0 : i.activeElement;
51
+ u = (s = u == null ? void 0 : u.shadowRoot) == null ? void 0 : s.activeElement;
52
52
  return u;
53
- }, s = x(), r = () => {
54
- s.value = l();
53
+ }, i = x(), r = () => {
54
+ i.value = l();
55
55
  };
56
- return n && (X(n, "blur", (i) => {
57
- i.relatedTarget === null && r();
58
- }, !0), X(n, "focus", r, !0)), r(), s;
56
+ return n && (Y(n, "blur", (s) => {
57
+ s.relatedTarget === null && r();
58
+ }, !0), Y(n, "focus", r, !0)), r(), i;
59
59
  }
60
- function qe(t, e = {}) {
61
- const n = ze(e), o = _(() => z(t));
62
- return { focused: _(() => o.value && n.value ? o.value.contains(n.value) : !1) };
60
+ function Fe(t, e = {}) {
61
+ const n = Be(e), o = C(() => F(t));
62
+ return { focused: C(() => o.value && n.value ? o.value.contains(n.value) : !1) };
63
63
  }
64
- function Ge(t, { window: e = Z, scrollTarget: n } = {}) {
64
+ function ze(t, { window: e = Q, scrollTarget: n } = {}) {
65
65
  const o = x(!1), a = () => {
66
66
  if (!e)
67
67
  return;
68
- const l = e.document, s = z(t);
69
- if (!s)
68
+ const l = e.document, i = F(t);
69
+ if (!i)
70
70
  o.value = !1;
71
71
  else {
72
- const r = s.getBoundingClientRect();
72
+ const r = i.getBoundingClientRect();
73
73
  o.value = r.top <= (e.innerHeight || l.documentElement.clientHeight) && r.left <= (e.innerWidth || l.documentElement.clientWidth) && r.bottom >= 0 && r.right >= 0;
74
74
  }
75
75
  };
76
- return C(
77
- () => z(t),
76
+ return A(
77
+ () => F(t),
78
78
  () => a(),
79
79
  { immediate: !0, flush: "post" }
80
- ), e && X(n || e, "scroll", a, {
80
+ ), e && Y(n || e, "scroll", a, {
81
81
  capture: !1,
82
82
  passive: !0
83
83
  }), o;
84
84
  }
85
85
  const I = (t) => {
86
- let e = Ge(t).value;
86
+ let e = ze(t).value;
87
87
  return e = e && t.offsetHeight > 0, e;
88
88
  }, k = (t) => t.tabIndex >= 0, ae = (t) => {
89
89
  const e = t.target;
90
- return K(e);
91
- }, K = (t) => {
90
+ return Z(e);
91
+ }, Z = (t) => {
92
92
  var e;
93
93
  let n;
94
94
  if (t instanceof HTMLTableCellElement) {
@@ -101,8 +101,8 @@ const I = (t) => {
101
101
  const o = t.previousElementSibling;
102
102
  o && (n = o);
103
103
  }
104
- return n && (!k(n) || !I(n)) ? K(n) : n;
105
- }, Ye = (t) => {
104
+ return n && (!k(n) || !I(n)) ? Z(n) : n;
105
+ }, qe = (t) => {
106
106
  var e;
107
107
  const n = t.target;
108
108
  let o;
@@ -119,11 +119,11 @@ const I = (t) => {
119
119
  l && (o = l);
120
120
  }
121
121
  }
122
- return o && (!k(o) || !I(o)) ? ee(o) : o;
122
+ return o && (!k(o) || !I(o)) ? K(o) : o;
123
123
  }, ie = (t) => {
124
124
  const e = t.target;
125
- return ee(e);
126
- }, ee = (t) => {
125
+ return K(e);
126
+ }, K = (t) => {
127
127
  var e;
128
128
  let n;
129
129
  if (t instanceof HTMLTableCellElement) {
@@ -136,8 +136,8 @@ const I = (t) => {
136
136
  const o = t.nextElementSibling;
137
137
  o && (n = o);
138
138
  }
139
- return n && (!k(n) || !I(n)) ? ee(n) : n;
140
- }, Xe = (t) => {
139
+ return n && (!k(n) || !I(n)) ? K(n) : n;
140
+ }, Ge = (t) => {
141
141
  var e;
142
142
  const n = t.target;
143
143
  let o;
@@ -154,11 +154,11 @@ const I = (t) => {
154
154
  l && (o = l);
155
155
  }
156
156
  }
157
- return o && (!k(o) || !I(o)) ? K(o) : o;
158
- }, de = (t) => {
157
+ return o && (!k(o) || !I(o)) ? Z(o) : o;
158
+ }, se = (t) => {
159
159
  const e = t.target;
160
- return te(e);
161
- }, te = (t) => {
160
+ return ee(e);
161
+ }, ee = (t) => {
162
162
  var e;
163
163
  let n;
164
164
  if (t.previousElementSibling)
@@ -167,11 +167,11 @@ const I = (t) => {
167
167
  const o = (e = t.parentElement) == null ? void 0 : e.previousElementSibling;
168
168
  n = o == null ? void 0 : o.lastElementChild;
169
169
  }
170
- return n && (!k(n) || !I(n)) ? te(n) : n;
171
- }, ce = (t) => {
170
+ return n && (!k(n) || !I(n)) ? ee(n) : n;
171
+ }, de = (t) => {
172
172
  const e = t.target;
173
- return ne(e);
174
- }, ne = (t) => {
173
+ return te(e);
174
+ }, te = (t) => {
175
175
  var e;
176
176
  let n;
177
177
  if (t.nextElementSibling)
@@ -180,19 +180,19 @@ const I = (t) => {
180
180
  const o = (e = t.parentElement) == null ? void 0 : e.nextElementSibling;
181
181
  n = o == null ? void 0 : o.firstElementChild;
182
182
  }
183
- return n && (!k(n) || !I(n)) ? ne(n) : n;
184
- }, ue = (t) => {
183
+ return n && (!k(n) || !I(n)) ? te(n) : n;
184
+ }, ce = (t) => {
185
185
  const e = t.target.parentElement.firstElementChild;
186
- return e && (!k(e) || !I(e)) ? ne(e) : e;
187
- }, fe = (t) => {
188
- const e = t.target.parentElement.lastElementChild;
189
186
  return e && (!k(e) || !I(e)) ? te(e) : e;
190
- }, W = ["alt", "control", "shift", "meta"], Je = {
187
+ }, ue = (t) => {
188
+ const e = t.target.parentElement.lastElementChild;
189
+ return e && (!k(e) || !I(e)) ? ee(e) : e;
190
+ }, M = ["alt", "control", "shift", "meta"], Ye = {
191
191
  ArrowUp: "up",
192
192
  ArrowDown: "down",
193
193
  ArrowLeft: "left",
194
194
  ArrowRight: "right"
195
- }, oe = {
195
+ }, ne = {
196
196
  "keydown.up": (t) => {
197
197
  const e = ae(t);
198
198
  e && (t.preventDefault(), t.stopPropagation(), e.focus());
@@ -202,31 +202,31 @@ const I = (t) => {
202
202
  e && (t.preventDefault(), t.stopPropagation(), e.focus());
203
203
  },
204
204
  "keydown.left": (t) => {
205
- const e = de(t);
205
+ const e = se(t);
206
206
  t.preventDefault(), t.stopPropagation(), e && e.focus();
207
207
  },
208
208
  "keydown.right": (t) => {
209
- const e = ce(t);
209
+ const e = de(t);
210
210
  t.preventDefault(), t.stopPropagation(), e && e.focus();
211
211
  },
212
212
  "keydown.control.up": (t) => {
213
- const e = Ye(t);
213
+ const e = qe(t);
214
214
  e && (t.preventDefault(), t.stopPropagation(), e.focus());
215
215
  },
216
216
  "keydown.control.down": (t) => {
217
- const e = Xe(t);
217
+ const e = Ge(t);
218
218
  e && (t.preventDefault(), t.stopPropagation(), e.focus());
219
219
  },
220
220
  "keydown.control.left": (t) => {
221
- const e = ue(t);
221
+ const e = ce(t);
222
222
  e && (t.preventDefault(), t.stopPropagation(), e.focus());
223
223
  },
224
224
  "keydown.control.right": (t) => {
225
- const e = fe(t);
225
+ const e = ue(t);
226
226
  e && (t.preventDefault(), t.stopPropagation(), e.focus());
227
227
  },
228
228
  "keydown.end": (t) => {
229
- const e = fe(t);
229
+ const e = ue(t);
230
230
  e && (t.preventDefault(), t.stopPropagation(), e.focus());
231
231
  },
232
232
  "keydown.enter": (t) => {
@@ -244,83 +244,83 @@ const I = (t) => {
244
244
  }
245
245
  },
246
246
  "keydown.home": (t) => {
247
- const e = ue(t);
247
+ const e = ce(t);
248
248
  e && (t.preventDefault(), t.stopPropagation(), e.focus());
249
249
  },
250
250
  "keydown.tab": (t) => {
251
- const e = ce(t);
251
+ const e = de(t);
252
252
  e && (t.preventDefault(), t.stopPropagation(), e.focus());
253
253
  },
254
254
  "keydown.shift.tab": (t) => {
255
- const e = de(t);
255
+ const e = se(t);
256
256
  e && (t.preventDefault(), t.stopPropagation(), e.focus());
257
257
  }
258
258
  };
259
- function le(t) {
260
- const e = (s) => {
259
+ function oe(t) {
260
+ const e = (i) => {
261
261
  let r = null;
262
- return s.parent && (typeof s.parent == "string" ? r = document.querySelector(s.parent) : s.parent instanceof HTMLElement ? r = s.parent : r = s.parent.value), r;
263
- }, n = (s) => {
264
- const r = e(s);
265
- let i = [];
266
- if (typeof s.selectors == "string")
267
- i = r ? Array.from(r.querySelectorAll(s.selectors)) : Array.from(document.querySelectorAll(s.selectors));
268
- else if (Array.isArray(s.selectors))
269
- for (const u of s.selectors)
270
- u instanceof HTMLElement ? i.push(u) : i.push(u.$el);
271
- else if (s.selectors instanceof HTMLElement)
272
- i.push(s.selectors);
273
- else if (Array.isArray(s.selectors.value))
274
- for (const u of s.selectors.value)
275
- u instanceof HTMLElement ? i.push(u) : i.push(u.$el);
262
+ return i.parent && (typeof i.parent == "string" ? r = document.querySelector(i.parent) : i.parent instanceof HTMLElement ? r = i.parent : r = i.parent.value), r;
263
+ }, n = (i) => {
264
+ const r = e(i);
265
+ let s = [];
266
+ if (typeof i.selectors == "string")
267
+ s = r ? Array.from(r.querySelectorAll(i.selectors)) : Array.from(document.querySelectorAll(i.selectors));
268
+ else if (Array.isArray(i.selectors))
269
+ for (const u of i.selectors)
270
+ u instanceof HTMLElement ? s.push(u) : s.push(u.$el);
271
+ else if (i.selectors instanceof HTMLElement)
272
+ s.push(i.selectors);
273
+ else if (Array.isArray(i.selectors.value))
274
+ for (const u of i.selectors.value)
275
+ u instanceof HTMLElement ? s.push(u) : s.push(u.$el);
276
276
  else
277
- i.push(s.selectors.value);
278
- return i;
279
- }, o = (s) => {
280
- const r = e(s);
281
- let i = [];
282
- return s.selectors ? i = n(s) : r && (i = Array.from(r.children).filter((u) => k(u) && I(u))), i;
283
- }, a = (s) => (r) => {
284
- const i = Je[r.key] || r.key.toLowerCase();
285
- if (W.includes(i))
277
+ s.push(i.selectors.value);
278
+ return s;
279
+ }, o = (i) => {
280
+ const r = e(i);
281
+ let s = [];
282
+ return i.selectors ? s = n(i) : r && (s = Array.from(r.children).filter((u) => k(u) && I(u))), s;
283
+ }, a = (i) => (r) => {
284
+ const s = Ye[r.key] || r.key.toLowerCase();
285
+ if (M.includes(s))
286
286
  return;
287
- const u = s.handlers || oe;
287
+ const u = i.handlers || ne;
288
288
  for (const m of Object.keys(u)) {
289
289
  const [f, ...c] = m.split(".");
290
- if (f === "keydown" && c.includes(i)) {
291
- const p = u[m], w = c.filter((h) => W.includes(h)), v = W.some((h) => {
292
- const M = h.charAt(0).toUpperCase() + h.slice(1);
293
- return r.getModifierState(M);
290
+ if (f === "keydown" && c.includes(s)) {
291
+ const p = u[m], v = c.filter((w) => M.includes(w)), h = M.some((w) => {
292
+ const P = w.charAt(0).toUpperCase() + w.slice(1);
293
+ return r.getModifierState(P);
294
294
  });
295
- if (w.length > 0) {
296
- if (v) {
297
- for (const h of W)
298
- if (c.includes(h)) {
299
- const M = h.charAt(0).toUpperCase() + h.slice(1);
300
- r.getModifierState(M) && p(r);
295
+ if (v.length > 0) {
296
+ if (h) {
297
+ for (const w of M)
298
+ if (c.includes(w)) {
299
+ const P = w.charAt(0).toUpperCase() + w.slice(1);
300
+ r.getModifierState(P) && p(r);
301
301
  }
302
302
  }
303
303
  } else
304
- v || p(r);
304
+ h || p(r);
305
305
  }
306
306
  }
307
307
  }, l = [];
308
- Re(() => {
309
- for (const s of t) {
310
- const r = e(s), i = o(s), u = a(s), m = r ? [r] : i;
308
+ Te(() => {
309
+ for (const i of t) {
310
+ const r = e(i), s = o(i), u = a(i), m = r ? [r] : s;
311
311
  for (const f of m) {
312
- const { focused: c } = qe(x(f)), p = C(c, (w) => {
313
- w ? f.addEventListener("keydown", u) : f.removeEventListener("keydown", u);
312
+ const { focused: c } = Fe(x(f)), p = A(c, (v) => {
313
+ v ? f.addEventListener("keydown", u) : f.removeEventListener("keydown", u);
314
314
  });
315
315
  l.push(p);
316
316
  }
317
317
  }
318
- }), Oe(() => {
319
- for (const s of l)
320
- s();
318
+ }), $e(() => {
319
+ for (const i of l)
320
+ i();
321
321
  });
322
322
  }
323
- const Qe = ["data-colindex", "data-rowindex", "data-editable", "contenteditable", "tabindex"], Ze = { key: 1 }, Ke = /* @__PURE__ */ A({
323
+ const Xe = ["data-colindex", "data-rowindex", "data-editable", "contenteditable", "tabindex"], Je = { key: 1 }, xe = /* @__PURE__ */ _({
324
324
  __name: "ACell",
325
325
  props: {
326
326
  colIndex: {},
@@ -330,58 +330,58 @@ const Qe = ["data-colindex", "data-rowindex", "data-editable", "contenteditable"
330
330
  tabIndex: { default: 0 }
331
331
  },
332
332
  setup(t) {
333
- var w;
334
- const e = t, n = P(e.tableid), o = x(null), a = x(""), l = x(!1), s = _(() => {
335
- const v = n.cellData(e.colIndex, e.rowIndex);
333
+ var v;
334
+ const e = t, n = L(e.tableid), o = x(null), a = x(""), l = x(!1), i = C(() => {
335
+ const h = n.cellData(e.colIndex, e.rowIndex);
336
336
  if (n.columns[e.colIndex].format) {
337
- const h = n.columns[e.colIndex].format;
338
- return typeof h == "function" ? h(v) : typeof h == "string" ? Function(`"use strict";return (${h})`)()(v) : v;
337
+ const w = n.columns[e.colIndex].format;
338
+ return typeof w == "function" ? w(h) : typeof w == "string" ? Function(`"use strict";return (${w})`)()(h) : h;
339
339
  } else
340
- return v;
341
- }), r = (v) => {
340
+ return h;
341
+ }), r = (h) => {
342
342
  if (n.columns[e.colIndex].mask, n.columns[e.colIndex].modalComponent) {
343
- const h = o.value.getBoundingClientRect();
344
- n.modal.visible = !0, n.modal.colIndex = e.colIndex, n.modal.rowIndex = e.rowIndex, n.modal.parent = o.value, n.modal.top = h.top + h.height, n.modal.left = h.left, n.modal.width = u.value, n.modal.component = n.columns[e.colIndex].modalComponent, n.modal.componentProps = n.columns[e.colIndex].modalComponentProps;
343
+ const w = o.value.getBoundingClientRect();
344
+ n.modal.visible = !0, n.modal.colIndex = e.colIndex, n.modal.rowIndex = e.rowIndex, n.modal.parent = o.value, n.modal.top = w.top + w.height, n.modal.left = w.left, n.modal.width = u.value, n.modal.component = n.columns[e.colIndex].modalComponent, n.modal.componentProps = n.columns[e.colIndex].modalComponentProps;
345
345
  }
346
346
  };
347
347
  if (e.addNavigation) {
348
- let v = {
349
- ...oe,
348
+ let h = {
349
+ ...ne,
350
350
  "keydown.f2": r,
351
351
  "keydown.alt.up": r,
352
352
  "keydown.alt.down": r,
353
353
  "keydown.alt.left": r,
354
354
  "keydown.alt.right": r
355
355
  };
356
- typeof e.addNavigation == "object" && (v = {
357
- ...v,
356
+ typeof e.addNavigation == "object" && (h = {
357
+ ...h,
358
358
  ...e.addNavigation
359
- }), le([
359
+ }), oe([
360
360
  {
361
361
  selectors: o,
362
- handlers: v
362
+ handlers: h
363
363
  }
364
364
  ]);
365
365
  }
366
- const i = _(() => n.columns[e.colIndex].align || "center"), u = _(() => n.columns[e.colIndex].width || "40ch"), m = () => {
366
+ const s = C(() => n.columns[e.colIndex].align || "center"), u = C(() => n.columns[e.colIndex].width || "40ch"), m = () => {
367
367
  o.value && (a.value = o.value.textContent);
368
368
  }, f = () => {
369
369
  o.value && o.value.textContent !== a.value && (a.value = o.value.textContent, o.value.dispatchEvent(new Event("change")), l.value = !0, n.columns[e.colIndex].format || n.setCellData(e.rowIndex, e.colIndex, a.value));
370
- }, c = (v, h) => h && v === 0 && h > 0 ? `${h}ch` : "inherit", p = {
371
- textAlign: i.value,
370
+ }, c = (h, w) => w && h === 0 && w > 0 ? `${w}ch` : "inherit", p = {
371
+ textAlign: s.value,
372
372
  width: u.value,
373
373
  backgroundColor: l.value ? "var(--cell-modified-color)" : "inherit",
374
374
  fontWeight: l.value ? "bold" : "inherit",
375
- paddingLeft: c(e.colIndex, (w = n.display[e.rowIndex]) == null ? void 0 : w.indent)
375
+ paddingLeft: c(e.colIndex, (v = n.display[e.rowIndex]) == null ? void 0 : v.indent)
376
376
  };
377
- return (v, h) => (g(), y("td", {
377
+ return (h, w) => (g(), b("td", {
378
378
  ref_key: "cell",
379
379
  ref: o,
380
- "data-colindex": v.colIndex,
381
- "data-rowindex": v.rowIndex,
382
- "data-editable": d(n).columns[v.colIndex].edit,
383
- contenteditable: d(n).columns[v.colIndex].edit,
384
- tabindex: v.tabIndex,
380
+ "data-colindex": h.colIndex,
381
+ "data-rowindex": h.rowIndex,
382
+ "data-editable": d(n).columns[h.colIndex].edit,
383
+ contenteditable: d(n).columns[h.colIndex].edit,
384
+ tabindex: h.tabIndex,
385
385
  spellcheck: !1,
386
386
  style: p,
387
387
  onFocus: m,
@@ -389,20 +389,16 @@ const Qe = ["data-colindex", "data-rowindex", "data-editable", "contenteditable"
389
389
  onBlur: f,
390
390
  onInput: f,
391
391
  onClick: r,
392
- onMousedown: r
392
+ onMousedown: r,
393
+ class: "atable__cell"
393
394
  }, [
394
- d(n).columns[v.colIndex].cellComponent ? (g(), N(be(d(n).columns[v.colIndex].cellComponent), Q({
395
+ d(n).columns[h.colIndex].cellComponent ? (g(), j(ge(d(n).columns[h.colIndex].cellComponent), J({
395
396
  key: 0,
396
- value: s.value
397
- }, d(n).columns[v.colIndex].cellComponentProps), null, 16, ["value"])) : (g(), y("span", Ze, L(s.value), 1))
398
- ], 40, Qe));
397
+ value: i.value
398
+ }, d(n).columns[h.colIndex].cellComponentProps), null, 16, ["value"])) : (g(), b("span", Je, O(i.value), 1))
399
+ ], 40, Xe));
399
400
  }
400
- }), S = (t, e) => {
401
- const n = t.__vccOpts || t;
402
- for (const [o, a] of e)
403
- n[o] = a;
404
- return n;
405
- }, Ie = /* @__PURE__ */ S(Ke, [["__scopeId", "data-v-f3597719"]]), et = ["tabindex"], tt = ["tabindex"], nt = ["colspan"], ot = /* @__PURE__ */ A({
401
+ }), Qe = ["tabindex"], Ze = ["tabindex"], Ke = ["colspan"], et = /* @__PURE__ */ _({
406
402
  __name: "AExpansionRow",
407
403
  props: {
408
404
  row: {},
@@ -412,56 +408,56 @@ const Qe = ["data-colindex", "data-rowindex", "data-editable", "contenteditable"
412
408
  addNavigation: { type: [Boolean, Object] }
413
409
  },
414
410
  setup(t) {
415
- const e = t, n = P(e.tableid), o = x(null), a = x(null), l = () => n.display[e.rowIndex].expanded ? "▼" : "►";
411
+ const e = t, n = L(e.tableid), o = x(null), a = x(null), l = () => n.display[e.rowIndex].expanded ? "▼" : "►";
416
412
  if (e.addNavigation) {
417
- const s = {
413
+ const i = {
418
414
  "keydown.control.g": (r) => {
419
415
  r.stopPropagation(), r.preventDefault(), n.toggleRowExpand(e.rowIndex);
420
416
  }
421
417
  };
422
- typeof e.addNavigation == "object" && Object.assign(s, e.addNavigation), le([
418
+ typeof e.addNavigation == "object" && Object.assign(i, e.addNavigation), oe([
423
419
  {
424
420
  selectors: o,
425
- handlers: s
421
+ handlers: i
426
422
  }
427
423
  ]);
428
424
  }
429
- return (s, r) => (g(), y(B, null, [
430
- $("tr", Q(s.$attrs, {
425
+ return (i, r) => (g(), b(V, null, [
426
+ T("tr", J(i.$attrs, {
431
427
  ref_key: "rowEl",
432
428
  ref: o,
433
- tabindex: s.tabIndex,
429
+ tabindex: i.tabIndex,
434
430
  class: "expandable-row"
435
431
  }), [
436
- $("td", {
432
+ T("td", {
437
433
  tabIndex: -1,
438
- onClick: r[0] || (r[0] = (i) => d(n).toggleRowExpand(s.rowIndex)),
434
+ onClick: r[0] || (r[0] = (s) => d(n).toggleRowExpand(i.rowIndex)),
439
435
  class: "row-index"
440
- }, L(l()), 1),
441
- E(s.$slots, "row", {}, void 0, !0)
442
- ], 16, et),
443
- d(n).display[e.rowIndex].expanded ? (g(), y("tr", {
436
+ }, O(l()), 1),
437
+ E(i.$slots, "row")
438
+ ], 16, Qe),
439
+ d(n).display[e.rowIndex].expanded ? (g(), b("tr", {
444
440
  key: 0,
445
441
  ref_key: "rowExpanded",
446
442
  ref: a,
447
- tabindex: s.tabIndex,
443
+ tabindex: i.tabIndex,
448
444
  class: "expanded-row"
449
445
  }, [
450
- $("td", {
446
+ T("td", {
451
447
  tabIndex: -1,
452
448
  colspan: d(n).columns.length + 1,
453
449
  class: "expanded-row-content"
454
450
  }, [
455
- E(s.$slots, "content", {}, void 0, !0)
456
- ], 8, nt)
457
- ], 8, tt)) : F("", !0)
451
+ E(i.$slots, "content")
452
+ ], 8, Ke)
453
+ ], 8, Ze)) : B("", !0)
458
454
  ], 64));
459
455
  }
460
- }), lt = /* @__PURE__ */ S(ot, [["__scopeId", "data-v-62bfcc94"]]), rt = ["tabindex"], st = {
456
+ }), tt = ["tabindex"], nt = {
461
457
  key: 0,
462
458
  tabIndex: -1,
463
459
  class: "list-index"
464
- }, at = /* @__PURE__ */ A({
460
+ }, Ee = /* @__PURE__ */ _({
465
461
  __name: "ARow",
466
462
  props: {
467
463
  row: {},
@@ -471,146 +467,145 @@ const Qe = ["data-colindex", "data-rowindex", "data-editable", "contenteditable"
471
467
  addNavigation: { type: [Boolean, Object], default: !1 }
472
468
  },
473
469
  setup(t) {
474
- ye((i) => ({
475
- "30f057ab": d(a)
476
- }));
477
- const e = t, n = P(e.tableid), o = x(null), a = n.numberedRowWidth.value, l = () => n.config.view !== "tree" ? "" : n.display[e.rowIndex].isRoot || n.display[e.rowIndex].isParent ? n.display[e.rowIndex].childrenOpen ? "-" : "+" : "", s = _(() => n.config.view !== "tree" || n.display[e.rowIndex].isRoot || n.display[e.rowIndex].open), r = (i) => {
478
- n.toggleRowExpand(i);
470
+ const e = t, n = L(e.tableid), o = x(null);
471
+ n.numberedRowWidth.value;
472
+ const a = () => n.config.view !== "tree" ? "" : n.display[e.rowIndex].isRoot || n.display[e.rowIndex].isParent ? n.display[e.rowIndex].childrenOpen ? "-" : "+" : "", l = C(() => n.config.view !== "tree" || n.display[e.rowIndex].isRoot || n.display[e.rowIndex].open), i = (r) => {
473
+ n.toggleRowExpand(r);
479
474
  };
480
475
  if (e.addNavigation) {
481
- let i = oe;
482
- typeof e.addNavigation == "object" && (i = {
483
- ...i,
476
+ let r = ne;
477
+ typeof e.addNavigation == "object" && (r = {
478
+ ...r,
484
479
  ...e.addNavigation
485
- }), le([
480
+ }), oe([
486
481
  {
487
482
  selectors: o,
488
- handlers: i
483
+ handlers: r
489
484
  }
490
485
  ]);
491
486
  }
492
- return (i, u) => G((g(), y("tr", {
487
+ return (r, s) => q((g(), b("tr", {
493
488
  ref_key: "rowEl",
494
489
  ref: o,
495
- tabindex: i.tabIndex,
490
+ tabindex: r.tabIndex,
496
491
  class: "table-row"
497
492
  }, [
498
- E(i.$slots, "index", {}, () => [
499
- d(n).config.view === "list" ? (g(), y("td", st, L(i.rowIndex + 1), 1)) : d(n).config.view === "tree" ? (g(), y("td", {
493
+ E(r.$slots, "index", {}, () => [
494
+ d(n).config.view === "list" ? (g(), b("td", nt, O(r.rowIndex + 1), 1)) : d(n).config.view === "tree" ? (g(), b("td", {
500
495
  key: 1,
501
496
  tabIndex: -1,
502
497
  class: "tree-index",
503
- onClick: u[0] || (u[0] = (m) => r(i.rowIndex))
504
- }, L(l()), 1)) : F("", !0)
505
- ], !0),
506
- E(i.$slots, "default", {}, void 0, !0)
507
- ], 8, rt)), [
508
- [xe, s.value]
498
+ onClick: s[0] || (s[0] = (u) => i(r.rowIndex))
499
+ }, O(a()), 1)) : B("", !0)
500
+ ]),
501
+ E(r.$slots, "default")
502
+ ], 8, tt)), [
503
+ [ye, l.value]
509
504
  ]);
510
505
  }
511
- }), ke = /* @__PURE__ */ S(at, [["__scopeId", "data-v-762810eb"]]);
506
+ });
512
507
  let H;
513
- const it = new Uint8Array(16);
514
- function dt() {
508
+ const ot = new Uint8Array(16);
509
+ function lt() {
515
510
  if (!H && (H = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !H))
516
511
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
517
- return H(it);
512
+ return H(ot);
518
513
  }
519
- const b = [];
514
+ const y = [];
520
515
  for (let t = 0; t < 256; ++t)
521
- b.push((t + 256).toString(16).slice(1));
522
- function ct(t, e = 0) {
523
- return b[t[e + 0]] + b[t[e + 1]] + b[t[e + 2]] + b[t[e + 3]] + "-" + b[t[e + 4]] + b[t[e + 5]] + "-" + b[t[e + 6]] + b[t[e + 7]] + "-" + b[t[e + 8]] + b[t[e + 9]] + "-" + b[t[e + 10]] + b[t[e + 11]] + b[t[e + 12]] + b[t[e + 13]] + b[t[e + 14]] + b[t[e + 15]];
516
+ y.push((t + 256).toString(16).slice(1));
517
+ function rt(t, e = 0) {
518
+ return y[t[e + 0]] + y[t[e + 1]] + y[t[e + 2]] + y[t[e + 3]] + "-" + y[t[e + 4]] + y[t[e + 5]] + "-" + y[t[e + 6]] + y[t[e + 7]] + "-" + y[t[e + 8]] + y[t[e + 9]] + "-" + y[t[e + 10]] + y[t[e + 11]] + y[t[e + 12]] + y[t[e + 13]] + y[t[e + 14]] + y[t[e + 15]];
524
519
  }
525
- const ut = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), pe = {
526
- randomUUID: ut
520
+ const at = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), fe = {
521
+ randomUUID: at
527
522
  };
528
- function _e(t, e, n) {
529
- if (pe.randomUUID && !e && !t)
530
- return pe.randomUUID();
523
+ function Ie(t, e, n) {
524
+ if (fe.randomUUID && !e && !t)
525
+ return fe.randomUUID();
531
526
  t = t || {};
532
- const o = t.random || (t.rng || dt)();
527
+ const o = t.random || (t.rng || lt)();
533
528
  if (o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, e) {
534
529
  n = n || 0;
535
530
  for (let a = 0; a < 16; ++a)
536
531
  e[n + a] = o[a];
537
532
  return e;
538
533
  }
539
- return ct(o);
534
+ return rt(o);
540
535
  }
541
- function Ce(t) {
542
- return we() ? (ge(t), !0) : !1;
536
+ function ke(t) {
537
+ return we() ? (ve(t), !0) : !1;
543
538
  }
544
- function R(t) {
539
+ function $(t) {
545
540
  return typeof t == "function" ? t() : d(t);
546
541
  }
547
- const Ae = typeof window < "u" && typeof document < "u";
542
+ const Ce = typeof window < "u" && typeof document < "u";
548
543
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
549
- const ft = Object.prototype.toString, pt = (t) => ft.call(t) === "[object Object]", O = () => {
550
- }, J = /* @__PURE__ */ mt();
551
- function mt() {
544
+ const it = Object.prototype.toString, st = (t) => it.call(t) === "[object Object]", R = () => {
545
+ }, X = /* @__PURE__ */ dt();
546
+ function dt() {
552
547
  var t, e;
553
- return Ae && ((t = window == null ? void 0 : window.navigator) == null ? void 0 : t.userAgent) && (/iP(ad|hone|od)/.test(window.navigator.userAgent) || ((e = window == null ? void 0 : window.navigator) == null ? void 0 : e.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent));
548
+ return Ce && ((t = window == null ? void 0 : window.navigator) == null ? void 0 : t.userAgent) && (/iP(ad|hone|od)/.test(window.navigator.userAgent) || ((e = window == null ? void 0 : window.navigator) == null ? void 0 : e.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent));
554
549
  }
555
- const me = {
550
+ const pe = {
556
551
  mounted: "mounted",
557
552
  updated: "updated",
558
553
  unmounted: "unmounted"
559
554
  };
560
- function vt(...t) {
555
+ function ct(...t) {
561
556
  if (t.length !== 1)
562
- return Le(...t);
557
+ return Re(...t);
563
558
  const e = t[0];
564
- return typeof e == "function" ? Pe(Me(() => ({ get: e, set: O }))) : x(e);
559
+ return typeof e == "function" ? Oe(Le(() => ({ get: e, set: R }))) : x(e);
565
560
  }
566
- function T(t) {
561
+ function D(t) {
567
562
  var e;
568
- const n = R(t);
563
+ const n = $(t);
569
564
  return (e = n == null ? void 0 : n.$el) != null ? e : n;
570
565
  }
571
- const Se = Ae ? window : void 0;
566
+ const Ae = Ce ? window : void 0;
572
567
  function U(...t) {
573
568
  let e, n, o, a;
574
- if (typeof t[0] == "string" || Array.isArray(t[0]) ? ([n, o, a] = t, e = Se) : [e, n, o, a] = t, !e)
575
- return O;
569
+ if (typeof t[0] == "string" || Array.isArray(t[0]) ? ([n, o, a] = t, e = Ae) : [e, n, o, a] = t, !e)
570
+ return R;
576
571
  Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
577
- const l = [], s = () => {
572
+ const l = [], i = () => {
578
573
  l.forEach((m) => m()), l.length = 0;
579
- }, r = (m, f, c, p) => (m.addEventListener(f, c, p), () => m.removeEventListener(f, c, p)), i = C(
580
- () => [T(e), R(a)],
574
+ }, r = (m, f, c, p) => (m.addEventListener(f, c, p), () => m.removeEventListener(f, c, p)), s = A(
575
+ () => [D(e), $(a)],
581
576
  ([m, f]) => {
582
- if (s(), !m)
577
+ if (i(), !m)
583
578
  return;
584
- const c = pt(f) ? { ...f } : f;
579
+ const c = st(f) ? { ...f } : f;
585
580
  l.push(
586
- ...n.flatMap((p) => o.map((w) => r(m, p, w, c)))
581
+ ...n.flatMap((p) => o.map((v) => r(m, p, v, c)))
587
582
  );
588
583
  },
589
584
  { immediate: !0, flush: "post" }
590
585
  ), u = () => {
591
- i(), s();
586
+ s(), i();
592
587
  };
593
- return Ce(u), u;
588
+ return ke(u), u;
594
589
  }
595
- let ve = !1;
590
+ let me = !1;
596
591
  function he(t, e, n = {}) {
597
- const { window: o = Se, ignore: a = [], capture: l = !0, detectIframe: s = !1 } = n;
592
+ const { window: o = Ae, ignore: a = [], capture: l = !0, detectIframe: i = !1 } = n;
598
593
  if (!o)
599
- return O;
600
- J && !ve && (ve = !0, Array.from(o.document.body.children).forEach((c) => c.addEventListener("click", O)), o.document.documentElement.addEventListener("click", O));
594
+ return R;
595
+ X && !me && (me = !0, Array.from(o.document.body.children).forEach((c) => c.addEventListener("click", R)), o.document.documentElement.addEventListener("click", R));
601
596
  let r = !0;
602
- const i = (c) => a.some((p) => {
597
+ const s = (c) => a.some((p) => {
603
598
  if (typeof p == "string")
604
- return Array.from(o.document.querySelectorAll(p)).some((w) => w === c.target || c.composedPath().includes(w));
599
+ return Array.from(o.document.querySelectorAll(p)).some((v) => v === c.target || c.composedPath().includes(v));
605
600
  {
606
- const w = T(p);
607
- return w && (c.target === w || c.composedPath().includes(w));
601
+ const v = D(p);
602
+ return v && (c.target === v || c.composedPath().includes(v));
608
603
  }
609
604
  }), m = [
610
605
  U(o, "click", (c) => {
611
- const p = T(t);
606
+ const p = D(t);
612
607
  if (!(!p || p === c.target || c.composedPath().includes(p))) {
613
- if (c.detail === 0 && (r = !i(c)), !r) {
608
+ if (c.detail === 0 && (r = !s(c)), !r) {
614
609
  r = !0;
615
610
  return;
616
611
  }
@@ -618,21 +613,21 @@ function he(t, e, n = {}) {
618
613
  }
619
614
  }, { passive: !0, capture: l }),
620
615
  U(o, "pointerdown", (c) => {
621
- const p = T(t);
622
- r = !i(c) && !!(p && !c.composedPath().includes(p));
616
+ const p = D(t);
617
+ r = !s(c) && !!(p && !c.composedPath().includes(p));
623
618
  }, { passive: !0 }),
624
- s && U(o, "blur", (c) => {
619
+ i && U(o, "blur", (c) => {
625
620
  setTimeout(() => {
626
621
  var p;
627
- const w = T(t);
628
- ((p = o.document.activeElement) == null ? void 0 : p.tagName) === "IFRAME" && !(w != null && w.contains(o.document.activeElement)) && e(c);
622
+ const v = D(t);
623
+ ((p = o.document.activeElement) == null ? void 0 : p.tagName) === "IFRAME" && !(v != null && v.contains(o.document.activeElement)) && e(c);
629
624
  }, 0);
630
625
  })
631
626
  ].filter(Boolean);
632
627
  return () => m.forEach((c) => c());
633
628
  }
634
- const ht = {
635
- [me.mounted](t, e) {
629
+ const ut = {
630
+ [pe.mounted](t, e) {
636
631
  const n = !e.modifiers.bubble;
637
632
  if (typeof e.value == "function")
638
633
  t.__onClickOutside_stop = he(t, e.value, { capture: n });
@@ -641,78 +636,78 @@ const ht = {
641
636
  t.__onClickOutside_stop = he(t, o, Object.assign({ capture: n }, a));
642
637
  }
643
638
  },
644
- [me.unmounted](t) {
639
+ [pe.unmounted](t) {
645
640
  t.__onClickOutside_stop();
646
641
  }
647
642
  };
648
- function q(t) {
643
+ function z(t) {
649
644
  return typeof Window < "u" && t instanceof Window ? t.document.documentElement : typeof Document < "u" && t instanceof Document ? t.documentElement : t;
650
645
  }
651
- function De(t) {
646
+ function _e(t) {
652
647
  const e = window.getComputedStyle(t);
653
648
  if (e.overflowX === "scroll" || e.overflowY === "scroll" || e.overflowX === "auto" && t.clientWidth < t.scrollWidth || e.overflowY === "auto" && t.clientHeight < t.scrollHeight)
654
649
  return !0;
655
650
  {
656
651
  const n = t.parentNode;
657
- return !n || n.tagName === "BODY" ? !1 : De(n);
652
+ return !n || n.tagName === "BODY" ? !1 : _e(n);
658
653
  }
659
654
  }
660
- function wt(t) {
655
+ function ft(t) {
661
656
  const e = t || window.event, n = e.target;
662
- return De(n) ? !1 : e.touches.length > 1 ? !0 : (e.preventDefault && e.preventDefault(), !1);
657
+ return _e(n) ? !1 : e.touches.length > 1 ? !0 : (e.preventDefault && e.preventDefault(), !1);
663
658
  }
664
- const j = /* @__PURE__ */ new WeakMap();
665
- function gt(t, e = !1) {
659
+ const W = /* @__PURE__ */ new WeakMap();
660
+ function pt(t, e = !1) {
666
661
  const n = x(e);
667
662
  let o = null;
668
- C(vt(t), (s) => {
669
- const r = q(R(s));
663
+ A(ct(t), (i) => {
664
+ const r = z($(i));
670
665
  if (r) {
671
- const i = r;
672
- j.get(i) || j.set(i, i.style.overflow), n.value && (i.style.overflow = "hidden");
666
+ const s = r;
667
+ W.get(s) || W.set(s, s.style.overflow), n.value && (s.style.overflow = "hidden");
673
668
  }
674
669
  }, {
675
670
  immediate: !0
676
671
  });
677
672
  const a = () => {
678
- const s = q(R(t));
679
- !s || n.value || (J && (o = U(
680
- s,
673
+ const i = z($(t));
674
+ !i || n.value || (X && (o = U(
675
+ i,
681
676
  "touchmove",
682
677
  (r) => {
683
- wt(r);
678
+ ft(r);
684
679
  },
685
680
  { passive: !1 }
686
- )), s.style.overflow = "hidden", n.value = !0);
681
+ )), i.style.overflow = "hidden", n.value = !0);
687
682
  }, l = () => {
688
- var s;
689
- const r = q(R(t));
690
- !r || !n.value || (J && (o == null || o()), r.style.overflow = (s = j.get(r)) != null ? s : "", j.delete(r), n.value = !1);
683
+ var i;
684
+ const r = z($(t));
685
+ !r || !n.value || (X && (o == null || o()), r.style.overflow = (i = W.get(r)) != null ? i : "", W.delete(r), n.value = !1);
691
686
  };
692
- return Ce(l), _({
687
+ return ke(l), C({
693
688
  get() {
694
689
  return n.value;
695
690
  },
696
- set(s) {
697
- s ? a() : l();
691
+ set(i) {
692
+ i ? a() : l();
698
693
  }
699
694
  });
700
695
  }
701
- function bt() {
696
+ function mt() {
702
697
  let t = !1;
703
698
  const e = x(!1);
704
699
  return (n, o) => {
705
700
  if (e.value = o.value, t)
706
701
  return;
707
702
  t = !0;
708
- const a = gt(n, o.value);
709
- C(e, (l) => a.value = l);
703
+ const a = pt(n, o.value);
704
+ A(e, (l) => a.value = l);
710
705
  };
711
706
  }
712
- bt();
713
- class yt {
714
- constructor(e, n, o, a, l, s) {
715
- this.id = e || _e(), this.rows = o, this.columns = D(n), this.config = D(a), this.table = l || D(this.createTableObject()), this.display = this.createDisplayObject(s), this.modal = D({ visible: !1 });
707
+ mt();
708
+ class ht {
709
+ constructor(e, n, o, a, l, i) {
710
+ this.id = e || Ie(), this.rows = o, this.columns = S(n), this.config = S(a), this.table = l || S(this.createTableObject()), this.display = this.createDisplayObject(i), this.modal = S({ visible: !1 });
716
711
  }
717
712
  createTableObject() {
718
713
  const e = {};
@@ -739,13 +734,13 @@ class yt {
739
734
  parent: l.parent
740
735
  };
741
736
  }
742
- return D(n);
737
+ return S(n);
743
738
  }
744
739
  get zeroColumn() {
745
740
  return ["list", "tree", "list-expansion"].includes(this.config.view);
746
741
  }
747
742
  get numberedRowWidth() {
748
- return _(() => String(Math.ceil(this.rows.length / 100) + 1) + "ch");
743
+ return C(() => String(Math.ceil(this.rows.length / 100) + 1) + "ch");
749
744
  }
750
745
  cellData(e, n) {
751
746
  return this.table[`${e}:${n}`];
@@ -764,16 +759,16 @@ class yt {
764
759
  this.config.view === "list-expansion" && (this.display[e].expanded = !this.display[e].expanded);
765
760
  }
766
761
  }
767
- const xt = {
762
+ const wt = {
768
763
  key: 0,
769
764
  id: "resizable"
770
- }, Et = {
765
+ }, vt = {
771
766
  class: "atable-header-row",
772
767
  tabindex: "-1"
773
- }, It = {
768
+ }, gt = {
774
769
  key: 0,
775
770
  id: "header-index"
776
- }, kt = /* @__PURE__ */ A({
771
+ }, Se = /* @__PURE__ */ _({
777
772
  __name: "ATableHeader",
778
773
  props: {
779
774
  columns: {},
@@ -781,30 +776,29 @@ const xt = {
781
776
  tableid: {}
782
777
  },
783
778
  setup(t) {
784
- ye((l) => ({
785
- "0c61081d": d(o)
786
- }));
787
- const n = P(t.tableid), o = n.numberedRowWidth.value, a = (l) => ({
788
- minWidth: l.width || "40ch",
789
- textAlign: l.align || "center",
779
+ const n = L(t.tableid);
780
+ n.numberedRowWidth.value;
781
+ const o = (a) => ({
782
+ minWidth: a.width || "40ch",
783
+ textAlign: a.align || "center",
790
784
  width: n.config.fullWidth ? "auto" : null
791
785
  });
792
- return (l, s) => l.columns.length ? (g(), y("thead", xt, [
793
- $("tr", Et, [
794
- d(n).zeroColumn ? (g(), y("th", It)) : F("", !0),
795
- (g(!0), y(B, null, Y(l.columns, (r, i) => (g(), y("th", {
796
- key: i,
786
+ return (a, l) => a.columns.length ? (g(), b("thead", wt, [
787
+ T("tr", vt, [
788
+ d(n).zeroColumn ? (g(), b("th", gt)) : B("", !0),
789
+ (g(!0), b(V, null, G(a.columns, (i, r) => (g(), b("th", {
790
+ key: r,
797
791
  tabindex: "-1",
798
- style: V(a(r))
792
+ style: N(o(i))
799
793
  }, [
800
- E(l.$slots, "default", {}, () => [
801
- We(L(r.label || String.fromCharCode(i + 97).toUpperCase()), 1)
802
- ], !0)
794
+ E(a.$slots, "default", {}, () => [
795
+ Pe(O(i.label || String.fromCharCode(r + 97).toUpperCase()), 1)
796
+ ])
803
797
  ], 4))), 128))
804
798
  ])
805
- ])) : F("", !0);
799
+ ])) : B("", !0);
806
800
  }
807
- }), Te = /* @__PURE__ */ S(kt, [["__scopeId", "data-v-b0bfa37f"]]), _t = /* @__PURE__ */ A({
801
+ }), De = /* @__PURE__ */ _({
808
802
  __name: "ATableModal",
809
803
  props: {
810
804
  colIndex: {},
@@ -812,21 +806,21 @@ const xt = {
812
806
  tableid: {}
813
807
  },
814
808
  setup(t) {
815
- P(t.tableid);
809
+ L(t.tableid);
816
810
  const n = (o) => {
817
811
  o.stopPropagation();
818
812
  };
819
- return (o, a) => (g(), y("div", {
813
+ return (o, a) => (g(), b("div", {
820
814
  ref: "amodal",
821
815
  class: "amodal",
822
816
  tabindex: "-1",
823
817
  onClick: n,
824
818
  onInput: n
825
819
  }, [
826
- E(o.$slots, "default", {}, void 0, !0)
820
+ E(o.$slots, "default")
827
821
  ], 544));
828
822
  }
829
- }), $e = /* @__PURE__ */ S(_t, [["__scopeId", "data-v-10a48b2a"]]), Ct = /* @__PURE__ */ A({
823
+ }), yt = /* @__PURE__ */ _({
830
824
  __name: "ATable",
831
825
  props: {
832
826
  id: {},
@@ -839,45 +833,45 @@ const xt = {
839
833
  emits: ["update:modelValue"],
840
834
  setup(t, { emit: e }) {
841
835
  const n = t, o = e;
842
- let a = n.modelValue ? n.modelValue : n.rows, l = new yt(n.id, n.columns, a, n.config);
843
- He(l.id, l), C(
836
+ let a = n.modelValue ? n.modelValue : n.rows, l = new ht(n.id, n.columns, a, n.config);
837
+ Me(l.id, l), A(
844
838
  () => l.rows,
845
839
  (r) => {
846
840
  o("update:modelValue", r);
847
841
  },
848
842
  { deep: !0 }
849
843
  );
850
- const s = (r) => {
851
- var i;
852
- r.target instanceof Node && (i = l.modal.parent) != null && i.contains(r.target) || l.modal.visible && (l.modal.visible = !1);
844
+ const i = (r) => {
845
+ var s;
846
+ r.target instanceof Node && (s = l.modal.parent) != null && s.contains(r.target) || l.modal.visible && (l.modal.visible = !1);
853
847
  };
854
848
  return window.addEventListener("keydown", async (r) => {
855
849
  if (r.key === "Escape" && l.modal.visible) {
856
850
  l.modal.visible = !1;
857
- const i = l.modal.parent;
858
- i && (await je(), i.focus());
851
+ const s = l.modal.parent;
852
+ s && (await He(), s.focus());
859
853
  }
860
- }), (r, i) => G((g(), y("table", {
854
+ }), (r, s) => q((g(), b("table", {
861
855
  class: "atable",
862
- style: V({ width: d(l).config.fullWidth ? "100%" : "auto" })
856
+ style: N({ width: d(l).config.fullWidth ? "100%" : "auto" })
863
857
  }, [
864
858
  E(r.$slots, "header", { data: d(l) }, () => [
865
- re(Te, {
859
+ le(Se, {
866
860
  columns: d(l).columns,
867
861
  config: d(l).config,
868
862
  tableid: d(l).id
869
863
  }, null, 8, ["columns", "config", "tableid"])
870
- ], !0),
871
- $("tbody", null, [
864
+ ]),
865
+ T("tbody", null, [
872
866
  E(r.$slots, "body", { data: d(l) }, () => [
873
- (g(!0), y(B, null, Y(d(l).rows, (u, m) => (g(), N(ke, {
874
- key: u.id || d(_e)(),
867
+ (g(!0), b(V, null, G(d(l).rows, (u, m) => (g(), j(Ee, {
868
+ key: u.id || d(Ie)(),
875
869
  row: u,
876
870
  rowIndex: m,
877
871
  tableid: d(l).id
878
872
  }, {
879
- default: se(() => [
880
- (g(!0), y(B, null, Y(d(l).columns, (f, c) => (g(), N(Ie, {
873
+ default: re(() => [
874
+ (g(!0), b(V, null, G(d(l).columns, (f, c) => (g(), j(xe, {
881
875
  key: `${c}:${m}`,
882
876
  tableid: d(l).id,
883
877
  col: f,
@@ -885,7 +879,7 @@ const xt = {
885
879
  rowIndex: m,
886
880
  colIndex: c + (d(l).zeroColumn ? 0 : -1),
887
881
  component: f.cellComponent,
888
- style: V({
882
+ style: N({
889
883
  textAlign: (f == null ? void 0 : f.align) || "center",
890
884
  minWidth: (f == null ? void 0 : f.width) || "40ch",
891
885
  width: d(l).config.fullWidth ? "auto" : null
@@ -894,22 +888,22 @@ const xt = {
894
888
  ]),
895
889
  _: 2
896
890
  }, 1032, ["row", "rowIndex", "tableid"]))), 128))
897
- ], !0)
891
+ ])
898
892
  ]),
899
- E(r.$slots, "footer", { data: d(l) }, void 0, !0),
893
+ E(r.$slots, "footer", { data: d(l) }),
900
894
  E(r.$slots, "modal", { data: d(l) }, () => [
901
- G(re($e, {
895
+ q(le(De, {
902
896
  colIndex: d(l).modal.colIndex,
903
897
  rowIndex: d(l).modal.rowIndex,
904
898
  tableid: d(l).id,
905
- style: V({
899
+ style: N({
906
900
  left: d(l).modal.left + "px",
907
901
  top: d(l).modal.top + "px",
908
902
  maxWidth: d(l).modal.width + "px"
909
903
  })
910
904
  }, {
911
- default: se(() => [
912
- (g(), N(be(d(l).modal.component), Q({
905
+ default: re(() => [
906
+ (g(), j(ge(d(l).modal.component), J({
913
907
  key: `${d(l).modal.rowIndex}:${d(l).modal.colIndex}`,
914
908
  colIndex: d(l).modal.colIndex,
915
909
  rowIndex: d(l).modal.rowIndex,
@@ -918,25 +912,25 @@ const xt = {
918
912
  ]),
919
913
  _: 1
920
914
  }, 8, ["colIndex", "rowIndex", "tableid", "style"]), [
921
- [xe, d(l).modal.visible]
915
+ [ye, d(l).modal.visible]
922
916
  ])
923
- ], !0)
917
+ ])
924
918
  ], 4)), [
925
- [d(ht), s]
919
+ [d(ut), i]
926
920
  ]);
927
921
  }
928
- }), At = /* @__PURE__ */ S(Ct, [["__scopeId", "data-v-f0f87ebf"]]);
929
- function Dt(t) {
930
- t.component("ACell", Ie), t.component("AExpansionRow", lt), t.component("ARow", ke), t.component("ATable", At), t.component("ATableHeader", Te), t.component("ATableModal", $e);
922
+ });
923
+ function xt(t) {
924
+ t.component("ACell", xe), t.component("AExpansionRow", et), t.component("ARow", Ee), t.component("ATable", yt), t.component("ATableHeader", Se), t.component("ATableModal", De);
931
925
  }
932
926
  export {
933
- Ie as ACell,
934
- lt as AExpansionRow,
935
- ke as ARow,
936
- At as ATable,
937
- Te as ATableHeader,
938
- $e as ATableModal,
939
- yt as TableDataStore,
940
- Dt as install
927
+ xe as ACell,
928
+ et as AExpansionRow,
929
+ Ee as ARow,
930
+ yt as ATable,
931
+ Se as ATableHeader,
932
+ De as ATableModal,
933
+ ht as TableDataStore,
934
+ xt as install
941
935
  };
942
936
  //# sourceMappingURL=atable.js.map