@stonecrop/atable 0.2.22 → 0.2.24

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,164 +1,164 @@
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 De, ref as x, watch as A, onBeforeUnmount as Te, computed as I, unref as d, getCurrentScope as we, onScopeDispose as ve, defineComponent as _, inject as F, openBlock as g, createElementBlock as b, createBlock as W, resolveDynamicComponent as ge, mergeProps as J, toDisplayString as L, Fragment as U, createElementVNode as T, renderSlot as E, createCommentVNode as V, withDirectives as q, vShow as ye, toRef as $e, readonly as Re, customRef as Le, reactive as S, renderList as G, normalizeStyle as j, createTextVNode as Oe, provide as Pe, nextTick as Me, createVNode as le, withCtx as re } from "vue";
2
+ function He(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 We = 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 je = Object.prototype.toString, Ne = (t) => je.call(t) === "[object Object]", Ue = () => {
11
11
  };
12
- function z(t) {
12
+ function B(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) {
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;
17
+ const K = We ? window : void 0;
18
+ function Y(...t) {
19
+ let e, n, o, i;
20
+ if (typeof t[0] == "string" || Array.isArray(t[0]) ? ([n, o, i] = t, e = K) : [e, n, o, i] = t, !e)
21
+ return Ue;
22
22
  Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
23
- const l = [], s = () => {
23
+ const l = [], a = () => {
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
+ () => [B(e), be(i)],
27
27
  ([m, f]) => {
28
- if (s(), !m)
28
+ if (a(), !m)
29
29
  return;
30
- const c = Be(f) ? { ...f } : f;
30
+ const c = Ne(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(), a();
38
38
  };
39
- return Ne(u), u;
39
+ return He(u), u;
40
40
  }
41
- function ze(t = {}) {
41
+ function Ve(t = {}) {
42
42
  var e;
43
43
  const {
44
- window: n = Z,
44
+ window: n = K,
45
45
  deep: o = !0
46
- } = t, a = (e = t.document) != null ? e : n == null ? void 0 : n.document, l = () => {
47
- var i;
48
- let u = a == null ? void 0 : a.activeElement;
46
+ } = t, i = (e = t.document) != null ? e : n == null ? void 0 : n.document, l = () => {
47
+ var s;
48
+ let u = i == null ? void 0 : i.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
+ }, a = x(), r = () => {
54
+ a.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(), a;
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 Be(t, e = {}) {
61
+ const n = Ve(e), o = I(() => B(t));
62
+ return { focused: I(() => o.value && n.value ? o.value.contains(n.value) : !1) };
63
63
  }
64
- function Ge(t, { window: e = Z, scrollTarget: n } = {}) {
65
- const o = x(!1), a = () => {
64
+ function Fe(t, { window: e = K, scrollTarget: n } = {}) {
65
+ const o = x(!1), i = () => {
66
66
  if (!e)
67
67
  return;
68
- const l = e.document, s = z(t);
69
- if (!s)
68
+ const l = e.document, a = B(t);
69
+ if (!a)
70
70
  o.value = !1;
71
71
  else {
72
- const r = s.getBoundingClientRect();
72
+ const r = a.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),
78
- () => a(),
76
+ return A(
77
+ () => B(t),
78
+ () => i(),
79
79
  { immediate: !0, flush: "post" }
80
- ), e && X(n || e, "scroll", a, {
80
+ ), e && Y(n || e, "scroll", i, {
81
81
  capture: !1,
82
82
  passive: !0
83
83
  }), o;
84
84
  }
85
- const I = (t) => {
86
- let e = Ge(t).value;
85
+ const k = (t) => {
86
+ let e = Fe(t).value;
87
87
  return e = e && t.offsetHeight > 0, e;
88
- }, k = (t) => t.tabIndex >= 0, ae = (t) => {
88
+ }, C = (t) => t.tabIndex >= 0, ae = (t) => {
89
89
  const e = t.target;
90
- return K(e);
91
- }, K = (t) => {
90
+ return Q(e);
91
+ }, Q = (t) => {
92
92
  var e;
93
93
  let n;
94
94
  if (t instanceof HTMLTableCellElement) {
95
95
  const o = (e = t.parentElement) == null ? void 0 : e.previousElementSibling;
96
96
  if (o) {
97
- const a = Array.from(o.children)[t.cellIndex];
98
- a && (n = a);
97
+ const i = Array.from(o.children)[t.cellIndex];
98
+ i && (n = i);
99
99
  }
100
100
  } else if (t instanceof HTMLTableRowElement) {
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 && (!C(n) || !k(n)) ? Q(n) : n;
105
+ }, ze = (t) => {
106
106
  var e;
107
107
  const n = t.target;
108
108
  let o;
109
109
  if (n instanceof HTMLTableCellElement) {
110
- const a = (e = n.parentElement) == null ? void 0 : e.parentElement;
111
- if (a) {
112
- const l = a.firstElementChild.children[n.cellIndex];
110
+ const i = (e = n.parentElement) == null ? void 0 : e.parentElement;
111
+ if (i) {
112
+ const l = i.firstElementChild.children[n.cellIndex];
113
113
  l && (o = l);
114
114
  }
115
115
  } else if (n instanceof HTMLTableRowElement) {
116
- const a = n.parentElement;
117
- if (a) {
118
- const l = a.firstElementChild;
116
+ const i = n.parentElement;
117
+ if (i) {
118
+ const l = i.firstElementChild;
119
119
  l && (o = l);
120
120
  }
121
121
  }
122
- return o && (!k(o) || !I(o)) ? ee(o) : o;
122
+ return o && (!C(o) || !k(o)) ? Z(o) : o;
123
123
  }, ie = (t) => {
124
124
  const e = t.target;
125
- return ee(e);
126
- }, ee = (t) => {
125
+ return Z(e);
126
+ }, Z = (t) => {
127
127
  var e;
128
128
  let n;
129
129
  if (t instanceof HTMLTableCellElement) {
130
130
  const o = (e = t.parentElement) == null ? void 0 : e.nextElementSibling;
131
131
  if (o) {
132
- const a = Array.from(o.children)[t.cellIndex];
133
- a && (n = a);
132
+ const i = Array.from(o.children)[t.cellIndex];
133
+ i && (n = i);
134
134
  }
135
135
  } else if (t instanceof HTMLTableRowElement) {
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 && (!C(n) || !k(n)) ? Z(n) : n;
140
+ }, qe = (t) => {
141
141
  var e;
142
142
  const n = t.target;
143
143
  let o;
144
144
  if (n instanceof HTMLTableCellElement) {
145
- const a = (e = n.parentElement) == null ? void 0 : e.parentElement;
146
- if (a) {
147
- const l = a.lastElementChild.children[n.cellIndex];
145
+ const i = (e = n.parentElement) == null ? void 0 : e.parentElement;
146
+ if (i) {
147
+ const l = i.lastElementChild.children[n.cellIndex];
148
148
  l && (o = l);
149
149
  }
150
150
  } else if (n instanceof HTMLTableRowElement) {
151
- const a = n.parentElement;
152
- if (a) {
153
- const l = a.lastElementChild;
151
+ const i = n.parentElement;
152
+ if (i) {
153
+ const l = i.lastElementChild;
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 && (!C(o) || !k(o)) ? Q(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 && (!C(n) || !k(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 && (!C(n) || !k(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) => {
186
+ return e && (!C(e) || !k(e)) ? te(e) : e;
187
+ }, ue = (t) => {
188
188
  const e = t.target.parentElement.lastElementChild;
189
- return e && (!k(e) || !I(e)) ? te(e) : e;
190
- }, W = ["alt", "control", "shift", "meta"], Je = {
189
+ return e && (!C(e) || !k(e)) ? ee(e) : e;
190
+ }, P = ["alt", "control", "shift", "meta"], Ge = {
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 = ze(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 = qe(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 = (a) => {
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 a.parent && (typeof a.parent == "string" ? r = document.querySelector(a.parent) : a.parent instanceof HTMLElement ? r = a.parent : r = a.parent.value), r;
263
+ }, n = (a) => {
264
+ const r = e(a);
265
+ let s = [];
266
+ if (typeof a.selectors == "string")
267
+ s = r ? Array.from(r.querySelectorAll(a.selectors)) : Array.from(document.querySelectorAll(a.selectors));
268
+ else if (Array.isArray(a.selectors))
269
+ for (const u of a.selectors)
270
+ u instanceof HTMLElement ? s.push(u) : s.push(u.$el);
271
+ else if (a.selectors instanceof HTMLElement)
272
+ s.push(a.selectors);
273
+ else if (Array.isArray(a.selectors.value))
274
+ for (const u of a.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(a.selectors.value);
278
+ return s;
279
+ }, o = (a) => {
280
+ const r = e(a);
281
+ let s = [];
282
+ return a.selectors ? s = n(a) : r && (s = Array.from(r.children).filter((u) => C(u) && k(u))), s;
283
+ }, i = (a) => (r) => {
284
+ const s = Ge[r.key] || r.key.toLowerCase();
285
+ if (P.includes(s))
286
286
  return;
287
- const u = s.handlers || oe;
287
+ const u = a.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) => P.includes(w)), h = P.some((w) => {
292
+ const O = w.charAt(0).toUpperCase() + w.slice(1);
293
+ return r.getModifierState(O);
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 P)
298
+ if (c.includes(w)) {
299
+ const O = w.charAt(0).toUpperCase() + w.slice(1);
300
+ r.getModifierState(O) && 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
+ De(() => {
309
+ for (const a of t) {
310
+ const r = e(a), s = o(a), u = i(a), 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 } = Be(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
+ }), Te(() => {
319
+ for (const a of l)
320
+ a();
321
321
  });
322
322
  }
323
- const Qe = ["data-colindex", "data-rowindex", "data-editable", "contenteditable", "tabindex"], Ze = { key: 1 }, Ke = /* @__PURE__ */ A({
323
+ const Ye = ["data-colindex", "data-rowindex", "data-editable", "contenteditable", "tabindex"], Xe = { 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 = F(e.tableid), o = x(null), i = x(""), l = x(!1), a = I(() => {
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 = () => {
367
- o.value && (a.value = o.value.textContent);
366
+ const s = I(() => n.columns[e.colIndex].align || "center"), u = I(() => n.columns[e.colIndex].width || "40ch"), m = () => {
367
+ o.value && (i.value = o.value.textContent);
368
368
  }, f = () => {
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,
369
+ o.value && o.value.textContent !== i.value && (i.value = o.value.textContent, o.value.dispatchEvent(new Event("change")), l.value = !0, n.columns[e.colIndex].format || n.setCellData(e.rowIndex, e.colIndex, 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(), W(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: a.value
398
+ }, d(n).columns[h.colIndex].cellComponentProps), null, 16, ["value"])) : (g(), b("span", Xe, L(a.value), 1))
399
+ ], 40, Ye));
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
+ }), Je = ["tabindex"], Ke = ["tabindex"], Qe = ["colspan"], Ze = /* @__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 = F(e.tableid), o = x(null), i = x(null), l = I(() => n.display[e.rowIndex].expanded ? "▼" : "►");
416
412
  if (e.addNavigation) {
417
- const s = {
413
+ const a = {
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(a, e.addNavigation), oe([
423
419
  {
424
420
  selectors: o,
425
- handlers: s
421
+ handlers: a
426
422
  }
427
423
  ]);
428
424
  }
429
- return (s, r) => (g(), y(B, null, [
430
- $("tr", Q(s.$attrs, {
425
+ return (a, r) => (g(), b(U, null, [
426
+ T("tr", J(a.$attrs, {
431
427
  ref_key: "rowEl",
432
428
  ref: o,
433
- tabindex: s.tabIndex,
429
+ tabindex: a.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(a.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
+ }, L(l.value), 1),
437
+ E(a.$slots, "row")
438
+ ], 16, Je),
439
+ d(n).display[e.rowIndex].expanded ? (g(), b("tr", {
444
440
  key: 0,
445
441
  ref_key: "rowExpanded",
446
- ref: a,
447
- tabindex: s.tabIndex,
442
+ ref: i,
443
+ tabindex: a.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(a.$slots, "content")
452
+ ], 8, Qe)
453
+ ], 8, Ke)) : V("", !0)
458
454
  ], 64));
459
455
  }
460
- }), lt = /* @__PURE__ */ S(ot, [["__scopeId", "data-v-62bfcc94"]]), rt = ["tabindex"], st = {
456
+ }), et = ["tabindex"], tt = {
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,254 +467,253 @@ 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 = F(e.tableid), o = x(null);
471
+ n.numberedRowWidth.value;
472
+ const i = I(() => n.config.view !== "tree" || n.display[e.rowIndex].isRoot || n.display[e.rowIndex].open), l = I(() => n.config.view !== "tree" ? "" : n.display[e.rowIndex].isRoot || n.display[e.rowIndex].isParent ? n.display[e.rowIndex].childrenOpen ? "-" : "+" : ""), a = (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", tt, L(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) => a(r.rowIndex))
499
+ }, L(l.value), 1)) : V("", !0)
500
+ ]),
501
+ E(r.$slots, "default")
502
+ ], 8, et)), [
503
+ [ye, i.value]
509
504
  ]);
510
505
  }
511
- }), ke = /* @__PURE__ */ S(at, [["__scopeId", "data-v-762810eb"]]);
512
- let H;
513
- const it = new Uint8Array(16);
514
- function dt() {
515
- if (!H && (H = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !H))
516
- throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
517
- return H(it);
518
- }
519
- const b = [];
520
- 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]];
524
- }
525
- const ut = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), pe = {
526
- randomUUID: ut
527
- };
528
- function _e(t, e, n) {
529
- if (pe.randomUUID && !e && !t)
530
- return pe.randomUUID();
531
- t = t || {};
532
- const o = t.random || (t.rng || dt)();
533
- if (o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, e) {
534
- n = n || 0;
535
- for (let a = 0; a < 16; ++a)
536
- e[n + a] = o[a];
537
- return e;
538
- }
539
- return ct(o);
540
- }
541
- function Ce(t) {
542
- return we() ? (ge(t), !0) : !1;
506
+ });
507
+ function Ie(t) {
508
+ return we() ? (ve(t), !0) : !1;
543
509
  }
544
- function R(t) {
510
+ function $(t) {
545
511
  return typeof t == "function" ? t() : d(t);
546
512
  }
547
- const Ae = typeof window < "u" && typeof document < "u";
513
+ const ke = typeof window < "u" && typeof document < "u";
548
514
  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() {
515
+ const nt = Object.prototype.toString, ot = (t) => nt.call(t) === "[object Object]", R = () => {
516
+ }, X = /* @__PURE__ */ lt();
517
+ function lt() {
552
518
  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));
519
+ return ke && ((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
520
  }
555
- const me = {
521
+ const fe = {
556
522
  mounted: "mounted",
557
523
  updated: "updated",
558
524
  unmounted: "unmounted"
559
525
  };
560
- function vt(...t) {
526
+ function rt(...t) {
561
527
  if (t.length !== 1)
562
- return Le(...t);
528
+ return $e(...t);
563
529
  const e = t[0];
564
- return typeof e == "function" ? Pe(Me(() => ({ get: e, set: O }))) : x(e);
530
+ return typeof e == "function" ? Re(Le(() => ({ get: e, set: R }))) : x(e);
565
531
  }
566
- function T(t) {
532
+ function D(t) {
567
533
  var e;
568
- const n = R(t);
534
+ const n = $(t);
569
535
  return (e = n == null ? void 0 : n.$el) != null ? e : n;
570
536
  }
571
- const Se = Ae ? window : void 0;
572
- function U(...t) {
573
- 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;
537
+ const Ce = ke ? window : void 0;
538
+ function N(...t) {
539
+ let e, n, o, i;
540
+ if (typeof t[0] == "string" || Array.isArray(t[0]) ? ([n, o, i] = t, e = Ce) : [e, n, o, i] = t, !e)
541
+ return R;
576
542
  Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
577
- const l = [], s = () => {
543
+ const l = [], a = () => {
578
544
  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)],
545
+ }, r = (m, f, c, p) => (m.addEventListener(f, c, p), () => m.removeEventListener(f, c, p)), s = A(
546
+ () => [D(e), $(i)],
581
547
  ([m, f]) => {
582
- if (s(), !m)
548
+ if (a(), !m)
583
549
  return;
584
- const c = pt(f) ? { ...f } : f;
550
+ const c = ot(f) ? { ...f } : f;
585
551
  l.push(
586
- ...n.flatMap((p) => o.map((w) => r(m, p, w, c)))
552
+ ...n.flatMap((p) => o.map((v) => r(m, p, v, c)))
587
553
  );
588
554
  },
589
555
  { immediate: !0, flush: "post" }
590
556
  ), u = () => {
591
- i(), s();
557
+ s(), a();
592
558
  };
593
- return Ce(u), u;
559
+ return Ie(u), u;
594
560
  }
595
- let ve = !1;
596
- function he(t, e, n = {}) {
597
- const { window: o = Se, ignore: a = [], capture: l = !0, detectIframe: s = !1 } = n;
561
+ let pe = !1;
562
+ function me(t, e, n = {}) {
563
+ const { window: o = Ce, ignore: i = [], capture: l = !0, detectIframe: a = !1 } = n;
598
564
  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));
565
+ return R;
566
+ X && !pe && (pe = !0, Array.from(o.document.body.children).forEach((c) => c.addEventListener("click", R)), o.document.documentElement.addEventListener("click", R));
601
567
  let r = !0;
602
- const i = (c) => a.some((p) => {
568
+ const s = (c) => i.some((p) => {
603
569
  if (typeof p == "string")
604
- return Array.from(o.document.querySelectorAll(p)).some((w) => w === c.target || c.composedPath().includes(w));
570
+ return Array.from(o.document.querySelectorAll(p)).some((v) => v === c.target || c.composedPath().includes(v));
605
571
  {
606
- const w = T(p);
607
- return w && (c.target === w || c.composedPath().includes(w));
572
+ const v = D(p);
573
+ return v && (c.target === v || c.composedPath().includes(v));
608
574
  }
609
575
  }), m = [
610
- U(o, "click", (c) => {
611
- const p = T(t);
576
+ N(o, "click", (c) => {
577
+ const p = D(t);
612
578
  if (!(!p || p === c.target || c.composedPath().includes(p))) {
613
- if (c.detail === 0 && (r = !i(c)), !r) {
579
+ if (c.detail === 0 && (r = !s(c)), !r) {
614
580
  r = !0;
615
581
  return;
616
582
  }
617
583
  e(c);
618
584
  }
619
585
  }, { passive: !0, capture: l }),
620
- U(o, "pointerdown", (c) => {
621
- const p = T(t);
622
- r = !i(c) && !!(p && !c.composedPath().includes(p));
586
+ N(o, "pointerdown", (c) => {
587
+ const p = D(t);
588
+ r = !s(c) && !!(p && !c.composedPath().includes(p));
623
589
  }, { passive: !0 }),
624
- s && U(o, "blur", (c) => {
590
+ a && N(o, "blur", (c) => {
625
591
  setTimeout(() => {
626
592
  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);
593
+ const v = D(t);
594
+ ((p = o.document.activeElement) == null ? void 0 : p.tagName) === "IFRAME" && !(v != null && v.contains(o.document.activeElement)) && e(c);
629
595
  }, 0);
630
596
  })
631
597
  ].filter(Boolean);
632
598
  return () => m.forEach((c) => c());
633
599
  }
634
- const ht = {
635
- [me.mounted](t, e) {
600
+ const at = {
601
+ [fe.mounted](t, e) {
636
602
  const n = !e.modifiers.bubble;
637
603
  if (typeof e.value == "function")
638
- t.__onClickOutside_stop = he(t, e.value, { capture: n });
604
+ t.__onClickOutside_stop = me(t, e.value, { capture: n });
639
605
  else {
640
- const [o, a] = e.value;
641
- t.__onClickOutside_stop = he(t, o, Object.assign({ capture: n }, a));
606
+ const [o, i] = e.value;
607
+ t.__onClickOutside_stop = me(t, o, Object.assign({ capture: n }, i));
642
608
  }
643
609
  },
644
- [me.unmounted](t) {
610
+ [fe.unmounted](t) {
645
611
  t.__onClickOutside_stop();
646
612
  }
647
613
  };
648
- function q(t) {
614
+ function z(t) {
649
615
  return typeof Window < "u" && t instanceof Window ? t.document.documentElement : typeof Document < "u" && t instanceof Document ? t.documentElement : t;
650
616
  }
651
- function De(t) {
617
+ function Ae(t) {
652
618
  const e = window.getComputedStyle(t);
653
619
  if (e.overflowX === "scroll" || e.overflowY === "scroll" || e.overflowX === "auto" && t.clientWidth < t.scrollWidth || e.overflowY === "auto" && t.clientHeight < t.scrollHeight)
654
620
  return !0;
655
621
  {
656
622
  const n = t.parentNode;
657
- return !n || n.tagName === "BODY" ? !1 : De(n);
623
+ return !n || n.tagName === "BODY" ? !1 : Ae(n);
658
624
  }
659
625
  }
660
- function wt(t) {
626
+ function it(t) {
661
627
  const e = t || window.event, n = e.target;
662
- return De(n) ? !1 : e.touches.length > 1 ? !0 : (e.preventDefault && e.preventDefault(), !1);
628
+ return Ae(n) ? !1 : e.touches.length > 1 ? !0 : (e.preventDefault && e.preventDefault(), !1);
663
629
  }
664
- const j = /* @__PURE__ */ new WeakMap();
665
- function gt(t, e = !1) {
630
+ const M = /* @__PURE__ */ new WeakMap();
631
+ function st(t, e = !1) {
666
632
  const n = x(e);
667
633
  let o = null;
668
- C(vt(t), (s) => {
669
- const r = q(R(s));
634
+ A(rt(t), (a) => {
635
+ const r = z($(a));
670
636
  if (r) {
671
- const i = r;
672
- j.get(i) || j.set(i, i.style.overflow), n.value && (i.style.overflow = "hidden");
637
+ const s = r;
638
+ M.get(s) || M.set(s, s.style.overflow), n.value && (s.style.overflow = "hidden");
673
639
  }
674
640
  }, {
675
641
  immediate: !0
676
642
  });
677
- const a = () => {
678
- const s = q(R(t));
679
- !s || n.value || (J && (o = U(
680
- s,
643
+ const i = () => {
644
+ const a = z($(t));
645
+ !a || n.value || (X && (o = N(
646
+ a,
681
647
  "touchmove",
682
648
  (r) => {
683
- wt(r);
649
+ it(r);
684
650
  },
685
651
  { passive: !1 }
686
- )), s.style.overflow = "hidden", n.value = !0);
652
+ )), a.style.overflow = "hidden", n.value = !0);
687
653
  }, 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);
654
+ var a;
655
+ const r = z($(t));
656
+ !r || !n.value || (X && (o == null || o()), r.style.overflow = (a = M.get(r)) != null ? a : "", M.delete(r), n.value = !1);
691
657
  };
692
- return Ce(l), _({
658
+ return Ie(l), I({
693
659
  get() {
694
660
  return n.value;
695
661
  },
696
- set(s) {
697
- s ? a() : l();
662
+ set(a) {
663
+ a ? i() : l();
698
664
  }
699
665
  });
700
666
  }
701
- function bt() {
667
+ function dt() {
702
668
  let t = !1;
703
669
  const e = x(!1);
704
670
  return (n, o) => {
705
671
  if (e.value = o.value, t)
706
672
  return;
707
673
  t = !0;
708
- const a = gt(n, o.value);
709
- C(e, (l) => a.value = l);
674
+ const i = st(n, o.value);
675
+ A(e, (l) => i.value = l);
710
676
  };
711
677
  }
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 });
678
+ dt();
679
+ let H;
680
+ const ct = new Uint8Array(16);
681
+ function ut() {
682
+ if (!H && (H = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !H))
683
+ throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
684
+ return H(ct);
685
+ }
686
+ const y = [];
687
+ for (let t = 0; t < 256; ++t)
688
+ y.push((t + 256).toString(16).slice(1));
689
+ function ft(t, e = 0) {
690
+ 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]];
691
+ }
692
+ const pt = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), he = {
693
+ randomUUID: pt
694
+ };
695
+ function mt(t, e, n) {
696
+ if (he.randomUUID && !e && !t)
697
+ return he.randomUUID();
698
+ t = t || {};
699
+ const o = t.random || (t.rng || ut)();
700
+ if (o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, e) {
701
+ n = n || 0;
702
+ for (let i = 0; i < 16; ++i)
703
+ e[n + i] = o[i];
704
+ return e;
705
+ }
706
+ return ft(o);
707
+ }
708
+ class ht {
709
+ constructor(e, n, o, i, l, a) {
710
+ this.id = e || mt(), this.rows = o, this.columns = S(n), this.config = S(i), this.table = l || S(this.createTableObject()), this.display = this.createDisplayObject(a), this.modal = S({ visible: !1 });
716
711
  }
717
712
  createTableObject() {
718
713
  const e = {};
719
714
  for (const [n, o] of this.columns.entries())
720
- for (const [a, l] of this.rows.entries())
721
- e[`${n}:${a}`] = l[o.name];
715
+ for (const [i, l] of this.rows.entries())
716
+ e[`${n}:${i}`] = l[o.name];
722
717
  return e;
723
718
  }
724
719
  createDisplayObject(e) {
@@ -726,34 +721,34 @@ class yt {
726
721
  if (e && "0:0" in e)
727
722
  return e;
728
723
  const o = /* @__PURE__ */ new Set();
729
- for (let a = this.rows.length - 1; a >= 0; a--) {
730
- const l = this.rows[a];
731
- l.parent && o.add(l.parent), n[a] = {
724
+ for (let i = this.rows.length - 1; i >= 0; i--) {
725
+ const l = this.rows[i];
726
+ l.parent && o.add(l.parent), n[i] = {
732
727
  childrenOpen: !1,
733
728
  expanded: !1,
734
729
  indent: l.indent || null,
735
- isParent: o.has(a),
730
+ isParent: o.has(i),
736
731
  isRoot: l.parent === null || l.parent === void 0,
737
732
  modified: !1,
738
733
  open: l.parent === null || l.parent === void 0,
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 I(() => String(Math.ceil(this.rows.length / 100) + 1) + "ch");
749
744
  }
750
745
  cellData(e, n) {
751
746
  return this.table[`${e}:${n}`];
752
747
  }
753
748
  setCellData(e, n, o) {
754
749
  this.table[`${n}:${e}`] !== o && (this.display[e].modified = !0), this.table[`${n}:${e}`] = o;
755
- const a = this.columns[n];
756
- return this.rows[e][a.name] = o, this.table[`${n}:${e}`];
750
+ const i = this.columns[n];
751
+ return this.rows[e][i.name] = o, this.table[`${n}:${e}`];
757
752
  }
758
753
  toggleRowExpand(e) {
759
754
  if (this.config.view === "tree") {
@@ -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
+ }, _e = /* @__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 = F(t.tableid);
780
+ n.numberedRowWidth.value;
781
+ const o = (i) => ({
782
+ minWidth: i.width || "40ch",
783
+ textAlign: i.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 (i, l) => i.columns.length ? (g(), b("thead", wt, [
787
+ T("tr", vt, [
788
+ d(n).zeroColumn ? (g(), b("th", gt)) : V("", !0),
789
+ (g(!0), b(U, null, G(i.columns, (a, r) => (g(), b("th", {
790
+ key: a.name,
797
791
  tabindex: "-1",
798
- style: V(a(r))
792
+ style: j(o(a))
799
793
  }, [
800
- E(l.$slots, "default", {}, () => [
801
- We(L(r.label || String.fromCharCode(i + 97).toUpperCase()), 1)
802
- ], !0)
794
+ E(i.$slots, "default", {}, () => [
795
+ Oe(L(a.label || String.fromCharCode(r + 97).toUpperCase()), 1)
796
+ ])
803
797
  ], 4))), 128))
804
798
  ])
805
- ])) : F("", !0);
799
+ ])) : V("", !0);
806
800
  }
807
- }), Te = /* @__PURE__ */ S(kt, [["__scopeId", "data-v-b0bfa37f"]]), _t = /* @__PURE__ */ A({
801
+ }), Se = /* @__PURE__ */ _({
808
802
  __name: "ATableModal",
809
803
  props: {
810
804
  colIndex: {},
@@ -812,21 +806,20 @@ const xt = {
812
806
  tableid: {}
813
807
  },
814
808
  setup(t) {
815
- P(t.tableid);
816
- const n = (o) => {
817
- o.stopPropagation();
809
+ const e = (n) => {
810
+ n.stopPropagation();
818
811
  };
819
- return (o, a) => (g(), y("div", {
812
+ return (n, o) => (g(), b("div", {
820
813
  ref: "amodal",
821
814
  class: "amodal",
822
815
  tabindex: "-1",
823
- onClick: n,
824
- onInput: n
816
+ onClick: e,
817
+ onInput: e
825
818
  }, [
826
- E(o.$slots, "default", {}, void 0, !0)
819
+ E(n.$slots, "default")
827
820
  ], 544));
828
821
  }
829
- }), $e = /* @__PURE__ */ S(_t, [["__scopeId", "data-v-10a48b2a"]]), Ct = /* @__PURE__ */ A({
822
+ }), yt = /* @__PURE__ */ _({
830
823
  __name: "ATable",
831
824
  props: {
832
825
  id: {},
@@ -839,53 +832,53 @@ const xt = {
839
832
  emits: ["update:modelValue"],
840
833
  setup(t, { emit: e }) {
841
834
  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(
835
+ let i = n.modelValue ? n.modelValue : n.rows, l = new ht(n.id, n.columns, i, n.config);
836
+ Pe(l.id, l), A(
844
837
  () => l.rows,
845
838
  (r) => {
846
839
  o("update:modelValue", r);
847
840
  },
848
841
  { deep: !0 }
849
842
  );
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);
843
+ const a = (r) => {
844
+ var s;
845
+ r.target instanceof Node && (s = l.modal.parent) != null && s.contains(r.target) || l.modal.visible && (l.modal.visible = !1);
853
846
  };
854
847
  return window.addEventListener("keydown", async (r) => {
855
848
  if (r.key === "Escape" && l.modal.visible) {
856
849
  l.modal.visible = !1;
857
- const i = l.modal.parent;
858
- i && (await je(), i.focus());
850
+ const s = l.modal.parent;
851
+ s && (await Me(), s.focus());
859
852
  }
860
- }), (r, i) => G((g(), y("table", {
853
+ }), (r, s) => q((g(), b("table", {
861
854
  class: "atable",
862
- style: V({ width: d(l).config.fullWidth ? "100%" : "auto" })
855
+ style: j({ width: d(l).config.fullWidth ? "100%" : "auto" })
863
856
  }, [
864
857
  E(r.$slots, "header", { data: d(l) }, () => [
865
- re(Te, {
858
+ le(_e, {
866
859
  columns: d(l).columns,
867
860
  config: d(l).config,
868
861
  tableid: d(l).id
869
862
  }, null, 8, ["columns", "config", "tableid"])
870
- ], !0),
871
- $("tbody", null, [
863
+ ]),
864
+ T("tbody", null, [
872
865
  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)(),
866
+ (g(!0), b(U, null, G(d(l).rows, (u, m) => (g(), W(Ee, {
867
+ key: u.id,
875
868
  row: u,
876
869
  rowIndex: m,
877
870
  tableid: d(l).id
878
871
  }, {
879
- default: se(() => [
880
- (g(!0), y(B, null, Y(d(l).columns, (f, c) => (g(), N(Ie, {
881
- key: `${c}:${m}`,
872
+ default: re(() => [
873
+ (g(!0), b(U, null, G(d(l).columns, (f, c) => (g(), W(xe, {
874
+ key: f.name,
882
875
  tableid: d(l).id,
883
876
  col: f,
884
877
  spellcheck: "false",
885
878
  rowIndex: m,
886
879
  colIndex: c + (d(l).zeroColumn ? 0 : -1),
887
880
  component: f.cellComponent,
888
- style: V({
881
+ style: j({
889
882
  textAlign: (f == null ? void 0 : f.align) || "center",
890
883
  minWidth: (f == null ? void 0 : f.width) || "40ch",
891
884
  width: d(l).config.fullWidth ? "auto" : null
@@ -894,22 +887,22 @@ const xt = {
894
887
  ]),
895
888
  _: 2
896
889
  }, 1032, ["row", "rowIndex", "tableid"]))), 128))
897
- ], !0)
890
+ ])
898
891
  ]),
899
- E(r.$slots, "footer", { data: d(l) }, void 0, !0),
892
+ E(r.$slots, "footer", { data: d(l) }),
900
893
  E(r.$slots, "modal", { data: d(l) }, () => [
901
- G(re($e, {
894
+ q(le(Se, {
902
895
  colIndex: d(l).modal.colIndex,
903
896
  rowIndex: d(l).modal.rowIndex,
904
897
  tableid: d(l).id,
905
- style: V({
898
+ style: j({
906
899
  left: d(l).modal.left + "px",
907
900
  top: d(l).modal.top + "px",
908
901
  maxWidth: d(l).modal.width + "px"
909
902
  })
910
903
  }, {
911
- default: se(() => [
912
- (g(), N(be(d(l).modal.component), Q({
904
+ default: re(() => [
905
+ (g(), W(ge(d(l).modal.component), J({
913
906
  key: `${d(l).modal.rowIndex}:${d(l).modal.colIndex}`,
914
907
  colIndex: d(l).modal.colIndex,
915
908
  rowIndex: d(l).modal.rowIndex,
@@ -918,25 +911,25 @@ const xt = {
918
911
  ]),
919
912
  _: 1
920
913
  }, 8, ["colIndex", "rowIndex", "tableid", "style"]), [
921
- [xe, d(l).modal.visible]
914
+ [ye, d(l).modal.visible]
922
915
  ])
923
- ], !0)
916
+ ])
924
917
  ], 4)), [
925
- [d(ht), s]
918
+ [d(at), a]
926
919
  ]);
927
920
  }
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);
921
+ });
922
+ function xt(t) {
923
+ t.component("ACell", xe), t.component("AExpansionRow", Ze), t.component("ARow", Ee), t.component("ATable", yt), t.component("ATableHeader", _e), t.component("ATableModal", Se);
931
924
  }
932
925
  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
926
+ xe as ACell,
927
+ Ze as AExpansionRow,
928
+ Ee as ARow,
929
+ yt as ATable,
930
+ _e as ATableHeader,
931
+ Se as ATableModal,
932
+ ht as TableDataStore,
933
+ xt as install
941
934
  };
942
935
  //# sourceMappingURL=atable.js.map