@stonecrop/atable 0.2.23 → 0.2.25

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