@stonecrop/atable 0.2.38 → 0.2.39

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,12 +1,12 @@
1
1
  var Pe = Object.defineProperty;
2
2
  var He = (e, t, n) => t in e ? Pe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var C = (e, t, n) => He(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { onMounted as xe, ref as I, watch as S, onBeforeUnmount as je, computed as b, unref as m, getCurrentScope as Ee, onScopeDispose as Ie, getCurrentInstance as Ne, defineComponent as T, inject as Y, useTemplateRef as ee, openBlock as w, createElementBlock as g, createBlock as B, resolveDynamicComponent as ke, mergeProps as te, toDisplayString as P, Fragment as q, createElementVNode as O, renderSlot as E, createCommentVNode as G, withDirectives as Z, vShow as Ae, toRef as We, readonly as Ve, customRef as Ue, reactive as $, renderList as K, normalizeStyle as z, createTextVNode as Be, provide as ze, nextTick as Fe, createVNode as de, withCtx as ce } from "vue";
5
- function Ce(e) {
3
+ var S = (e, t, n) => He(e, typeof t != "symbol" ? t + "" : t, n);
4
+ import { onMounted as xe, ref as k, watch as D, onBeforeUnmount as je, computed as y, unref as f, getCurrentScope as Ee, onScopeDispose as Ie, getCurrentInstance as Ne, defineComponent as T, inject as Y, useTemplateRef as ee, openBlock as h, createElementBlock as b, createBlock as B, resolveDynamicComponent as ke, mergeProps as te, toDisplayString as P, Fragment as q, createElementVNode as O, renderSlot as I, createCommentVNode as G, withDirectives as Z, vShow as Ce, toRef as We, readonly as Ve, customRef as Ue, reactive as $, renderList as K, normalizeStyle as z, createTextVNode as Be, provide as ze, nextTick as Fe, createVNode as de, withCtx as ce } from "vue";
5
+ function Ae(e) {
6
6
  return Ee() ? (Ie(e), !0) : !1;
7
7
  }
8
8
  function ne(e) {
9
- return typeof e == "function" ? e() : m(e);
9
+ return typeof e == "function" ? e() : f(e);
10
10
  }
11
11
  const qe = typeof window < "u" && typeof document < "u";
12
12
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
@@ -23,54 +23,54 @@ function j(...e) {
23
23
  return Je;
24
24
  Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
25
25
  const i = [], a = () => {
26
- i.forEach((s) => s()), i.length = 0;
27
- }, r = (s, v, c, p) => (s.addEventListener(v, c, p), () => s.removeEventListener(v, c, p)), u = S(
26
+ i.forEach((d) => d()), i.length = 0;
27
+ }, r = (d, p, c, m) => (d.addEventListener(p, c, m), () => d.removeEventListener(p, c, m)), u = D(
28
28
  () => [H(t), ne(l)],
29
- ([s, v]) => {
30
- if (a(), !s)
29
+ ([d, p]) => {
30
+ if (a(), !d)
31
31
  return;
32
- const c = Xe(v) ? { ...v } : v;
32
+ const c = Xe(p) ? { ...p } : p;
33
33
  i.push(
34
- ...n.flatMap((p) => o.map((f) => r(s, p, f, c)))
34
+ ...n.flatMap((m) => o.map((w) => r(d, m, w, c)))
35
35
  );
36
36
  },
37
37
  { immediate: !0, flush: "post" }
38
- ), d = () => {
38
+ ), s = () => {
39
39
  u(), a();
40
40
  };
41
- return Ce(d), d;
41
+ return Ae(s), s;
42
42
  }
43
43
  function Qe() {
44
- const e = I(!1), t = Ne();
44
+ const e = k(!1), t = Ne();
45
45
  return t && xe(() => {
46
46
  e.value = !0;
47
47
  }, t), e;
48
48
  }
49
49
  function Ze(e) {
50
50
  const t = Qe();
51
- return b(() => (t.value, !!e()));
51
+ return y(() => (t.value, !!e()));
52
52
  }
53
53
  function Ke(e, t, n = {}) {
54
54
  const { window: o = N, ...l } = n;
55
55
  let i;
56
56
  const a = Ze(() => o && "MutationObserver" in o), r = () => {
57
57
  i && (i.disconnect(), i = void 0);
58
- }, u = b(() => {
59
- const c = ne(e), p = (Array.isArray(c) ? c : [c]).map(H).filter(Ge);
60
- return new Set(p);
61
- }), d = S(
58
+ }, u = y(() => {
59
+ const c = ne(e), m = (Array.isArray(c) ? c : [c]).map(H).filter(Ge);
60
+ return new Set(m);
61
+ }), s = D(
62
62
  () => u.value,
63
63
  (c) => {
64
- r(), a.value && c.size && (i = new MutationObserver(t), c.forEach((p) => i.observe(p, l)));
64
+ r(), a.value && c.size && (i = new MutationObserver(t), c.forEach((m) => i.observe(m, l)));
65
65
  },
66
66
  { immediate: !0, flush: "post" }
67
- ), s = () => i == null ? void 0 : i.takeRecords(), v = () => {
68
- d(), r();
67
+ ), d = () => i == null ? void 0 : i.takeRecords(), p = () => {
68
+ s(), r();
69
69
  };
70
- return Ce(v), {
70
+ return Ae(p), {
71
71
  isSupported: a,
72
- stop: v,
73
- takeRecords: s
72
+ stop: p,
73
+ takeRecords: d
74
74
  };
75
75
  }
76
76
  function _e(e = {}) {
@@ -80,20 +80,20 @@ function _e(e = {}) {
80
80
  deep: o = !0,
81
81
  triggerOnRemoval: l = !1
82
82
  } = e, i = (t = e.document) != null ? t : n == null ? void 0 : n.document, a = () => {
83
- var d;
84
- let s = i == null ? void 0 : i.activeElement;
83
+ var s;
84
+ let d = i == null ? void 0 : i.activeElement;
85
85
  if (o)
86
- for (; s != null && s.shadowRoot; )
87
- s = (d = s == null ? void 0 : s.shadowRoot) == null ? void 0 : d.activeElement;
88
- return s;
89
- }, r = I(), u = () => {
86
+ for (; d != null && d.shadowRoot; )
87
+ d = (s = d == null ? void 0 : d.shadowRoot) == null ? void 0 : s.activeElement;
88
+ return d;
89
+ }, r = k(), u = () => {
90
90
  r.value = a();
91
91
  };
92
- return n && (j(n, "blur", (d) => {
93
- d.relatedTarget === null && u();
94
- }, !0), j(n, "focus", u, !0)), l && Ke(i, (d) => {
95
- d.filter((s) => s.removedNodes.length).map((s) => Array.from(s.removedNodes)).flat().forEach((s) => {
96
- s === r.value && u();
92
+ return n && (j(n, "blur", (s) => {
93
+ s.relatedTarget === null && u();
94
+ }, !0), j(n, "focus", u, !0)), l && Ke(i, (s) => {
95
+ s.filter((d) => d.removedNodes.length).map((d) => Array.from(d.removedNodes)).flat().forEach((d) => {
96
+ d === r.value && u();
97
97
  });
98
98
  }, {
99
99
  childList: !0,
@@ -102,11 +102,11 @@ function _e(e = {}) {
102
102
  }
103
103
  const et = "focusin", tt = "focusout";
104
104
  function nt(e, t = {}) {
105
- const { window: n = N } = t, o = b(() => H(e)), l = I(!1), i = b(() => l.value), a = _e(t);
105
+ const { window: n = N } = t, o = y(() => H(e)), l = k(!1), i = y(() => l.value), a = _e(t);
106
106
  return !n || !a.value ? { focused: i } : (j(o, et, () => l.value = !0), j(o, tt, () => l.value = !1), { focused: i });
107
107
  }
108
108
  function ot(e, { window: t = N, scrollTarget: n } = {}) {
109
- const o = I(!1), l = () => {
109
+ const o = k(!1), l = () => {
110
110
  if (!t) return;
111
111
  const i = t.document, a = H(e);
112
112
  if (!a)
@@ -116,7 +116,7 @@ function ot(e, { window: t = N, scrollTarget: n } = {}) {
116
116
  o.value = r.top <= (t.innerHeight || i.documentElement.clientHeight) && r.left <= (t.innerWidth || i.documentElement.clientWidth) && r.bottom >= 0 && r.right >= 0;
117
117
  }
118
118
  };
119
- return S(
119
+ return D(
120
120
  () => H(e),
121
121
  () => l(),
122
122
  { immediate: !0, flush: "post" }
@@ -125,7 +125,7 @@ function ot(e, { window: t = N, scrollTarget: n } = {}) {
125
125
  passive: !0
126
126
  }), o;
127
127
  }
128
- const k = (e) => {
128
+ const C = (e) => {
129
129
  let t = ot(e).value;
130
130
  return t = t && e.offsetHeight > 0, t;
131
131
  }, A = (e) => e.tabIndex >= 0, ue = (e) => {
@@ -144,7 +144,7 @@ const k = (e) => {
144
144
  const o = e.previousElementSibling;
145
145
  o && (n = o);
146
146
  }
147
- return n && (!A(n) || !k(n)) ? oe(n) : n;
147
+ return n && (!A(n) || !C(n)) ? oe(n) : n;
148
148
  }, lt = (e) => {
149
149
  var t;
150
150
  const n = e.target;
@@ -162,7 +162,7 @@ const k = (e) => {
162
162
  i && (o = i);
163
163
  }
164
164
  }
165
- return o && (!A(o) || !k(o)) ? le(o) : o;
165
+ return o && (!A(o) || !C(o)) ? le(o) : o;
166
166
  }, fe = (e) => {
167
167
  const t = e.target;
168
168
  return le(t);
@@ -179,7 +179,7 @@ const k = (e) => {
179
179
  const o = e.nextElementSibling;
180
180
  o && (n = o);
181
181
  }
182
- return n && (!A(n) || !k(n)) ? le(n) : n;
182
+ return n && (!A(n) || !C(n)) ? le(n) : n;
183
183
  }, at = (e) => {
184
184
  var t;
185
185
  const n = e.target;
@@ -197,7 +197,7 @@ const k = (e) => {
197
197
  i && (o = i);
198
198
  }
199
199
  }
200
- return o && (!A(o) || !k(o)) ? oe(o) : o;
200
+ return o && (!A(o) || !C(o)) ? oe(o) : o;
201
201
  }, me = (e) => {
202
202
  const t = e.target;
203
203
  return ae(t);
@@ -210,7 +210,7 @@ const k = (e) => {
210
210
  const o = (t = e.parentElement) == null ? void 0 : t.previousElementSibling;
211
211
  n = o == null ? void 0 : o.lastElementChild;
212
212
  }
213
- return n && (!A(n) || !k(n)) ? ae(n) : n;
213
+ return n && (!A(n) || !C(n)) ? ae(n) : n;
214
214
  }, pe = (e) => {
215
215
  const t = e.target;
216
216
  return ie(t);
@@ -223,13 +223,13 @@ const k = (e) => {
223
223
  const o = (t = e.parentElement) == null ? void 0 : t.nextElementSibling;
224
224
  n = o == null ? void 0 : o.firstElementChild;
225
225
  }
226
- return n && (!A(n) || !k(n)) ? ie(n) : n;
226
+ return n && (!A(n) || !C(n)) ? ie(n) : n;
227
227
  }, ve = (e) => {
228
228
  const t = e.target.parentElement.firstElementChild;
229
- return t && (!A(t) || !k(t)) ? ie(t) : t;
229
+ return t && (!A(t) || !C(t)) ? ie(t) : t;
230
230
  }, we = (e) => {
231
231
  const t = e.target.parentElement.lastElementChild;
232
- return t && (!A(t) || !k(t)) ? ae(t) : t;
232
+ return t && (!A(t) || !C(t)) ? ae(t) : t;
233
233
  }, V = ["alt", "control", "shift", "meta"], it = {
234
234
  ArrowUp: "up",
235
235
  ArrowDown: "down",
@@ -309,52 +309,52 @@ function se(e) {
309
309
  if (typeof a.selectors == "string")
310
310
  u = r ? Array.from(r.querySelectorAll(a.selectors)) : Array.from(document.querySelectorAll(a.selectors));
311
311
  else if (Array.isArray(a.selectors))
312
- for (const d of a.selectors)
313
- d instanceof HTMLElement ? u.push(d) : u.push(d.$el);
312
+ for (const s of a.selectors)
313
+ s instanceof HTMLElement ? u.push(s) : u.push(s.$el);
314
314
  else if (a.selectors instanceof HTMLElement)
315
315
  u.push(a.selectors);
316
316
  else if (Array.isArray(a.selectors.value))
317
- for (const d of a.selectors.value)
318
- d instanceof HTMLElement ? u.push(d) : u.push(d.$el);
317
+ for (const s of a.selectors.value)
318
+ s instanceof HTMLElement ? u.push(s) : u.push(s.$el);
319
319
  else
320
320
  u.push(a.selectors.value);
321
321
  return u;
322
322
  }, o = (a) => {
323
323
  const r = t(a);
324
324
  let u = [];
325
- return a.selectors ? u = n(a) : r && (u = Array.from(r.children).filter((d) => A(d) && k(d))), u;
325
+ return a.selectors ? u = n(a) : r && (u = Array.from(r.children).filter((s) => A(s) && C(s))), u;
326
326
  }, l = (a) => (r) => {
327
327
  const u = it[r.key] || r.key.toLowerCase();
328
328
  if (V.includes(u)) return;
329
- const d = a.handlers || re;
330
- for (const s of Object.keys(d)) {
331
- const [v, ...c] = s.split(".");
332
- if (v === "keydown" && c.includes(u)) {
333
- const p = d[s], f = c.filter((y) => V.includes(y)), x = V.some((y) => {
334
- const D = y.charAt(0).toUpperCase() + y.slice(1);
335
- return r.getModifierState(D);
329
+ const s = a.handlers || re;
330
+ for (const d of Object.keys(s)) {
331
+ const [p, ...c] = d.split(".");
332
+ if (p === "keydown" && c.includes(u)) {
333
+ const m = s[d], w = c.filter((x) => V.includes(x)), W = V.some((x) => {
334
+ const v = x.charAt(0).toUpperCase() + x.slice(1);
335
+ return r.getModifierState(v);
336
336
  });
337
- if (f.length > 0) {
338
- if (x) {
339
- for (const y of V)
340
- if (c.includes(y)) {
341
- const D = y.charAt(0).toUpperCase() + y.slice(1);
342
- r.getModifierState(D) && p(r);
337
+ if (w.length > 0) {
338
+ if (W) {
339
+ for (const x of V)
340
+ if (c.includes(x)) {
341
+ const v = x.charAt(0).toUpperCase() + x.slice(1);
342
+ r.getModifierState(v) && m(r);
343
343
  }
344
344
  }
345
345
  } else
346
- x || p(r);
346
+ W || m(r);
347
347
  }
348
348
  }
349
349
  }, i = [];
350
350
  xe(() => {
351
351
  for (const a of e) {
352
- const r = t(a), u = o(a), d = l(a), s = r ? [r] : u;
353
- for (const v of s) {
354
- const { focused: c } = nt(I(v)), p = S(c, (f) => {
355
- f ? v.addEventListener("keydown", d) : v.removeEventListener("keydown", d);
352
+ const r = t(a), u = o(a), s = l(a), d = r ? [r] : u;
353
+ for (const p of d) {
354
+ const { focused: c } = nt(k(p)), m = D(c, (w) => {
355
+ w ? p.addEventListener("keydown", s) : p.removeEventListener("keydown", s);
356
356
  });
357
- i.push(p);
357
+ i.push(m);
358
358
  }
359
359
  }
360
360
  }), je(() => {
@@ -372,71 +372,67 @@ const rt = ["data-colindex", "data-rowindex", "data-editable", "contenteditable"
372
372
  tabIndex: { default: 0 }
373
373
  },
374
374
  setup(e) {
375
- var p;
376
- const t = Y(e.tableid), n = ee("cell"), o = I(""), l = I(!1), i = b(() => {
377
- const f = t.cellData(e.colIndex, e.rowIndex);
378
- if (t.columns[e.colIndex].format) {
379
- const x = t.table, y = t.rows[e.rowIndex], D = t.columns[e.colIndex], W = D.format;
380
- return typeof W == "function" ? W(f, { table: x, row: y, column: D }) : typeof W == "string" ? Function(`"use strict";return (${W})`)()(f, { table: x, row: y, column: D }) : f;
381
- } else
382
- return f;
383
- }), a = () => {
384
- if (t.columns[e.colIndex].mask, t.columns[e.colIndex].modalComponent) {
385
- const f = n.value.getBoundingClientRect();
386
- t.modal.visible = !0, t.modal.colIndex = e.colIndex, t.modal.rowIndex = e.rowIndex, t.modal.parent = n.value, t.modal.top = f.top + f.height, t.modal.left = f.left, t.modal.width = u.value, t.modal.component = t.columns[e.colIndex].modalComponent, t.modal.componentProps = t.columns[e.colIndex].modalComponentProps;
375
+ var x;
376
+ const t = Y(e.tableid), n = ee("cell"), o = k(""), l = k(!1), i = t.table, a = t.columns[e.colIndex], r = t.rows[e.rowIndex], u = y(() => {
377
+ const v = t.cellData(e.colIndex, e.rowIndex), E = a.format;
378
+ return E ? typeof E == "function" ? E(v, { table: i, row: r, column: a }) : typeof E == "string" ? Function(`"use strict";return (${E})`)()(v, { table: i, row: r, column: a }) : v : v;
379
+ }), s = () => {
380
+ if (a.mask, a.modalComponent) {
381
+ const v = n.value.getBoundingClientRect();
382
+ t.modal.visible = !0, t.modal.colIndex = e.colIndex, t.modal.rowIndex = e.rowIndex, t.modal.parent = n.value, t.modal.top = v.top + v.height, t.modal.left = v.left, t.modal.width = p.value, typeof a.modalComponent == "function" ? t.modal.component = a.modalComponent({ table: i, row: r, column: a }) : t.modal.component = a.modalComponent, t.modal.componentProps = a.modalComponentExtraProps;
387
383
  }
388
384
  };
389
385
  if (e.addNavigation) {
390
- let f = {
386
+ let v = {
391
387
  ...re,
392
- "keydown.f2": a,
393
- "keydown.alt.up": a,
394
- "keydown.alt.down": a,
395
- "keydown.alt.left": a,
396
- "keydown.alt.right": a
388
+ "keydown.f2": s,
389
+ "keydown.alt.up": s,
390
+ "keydown.alt.down": s,
391
+ "keydown.alt.left": s,
392
+ "keydown.alt.right": s
397
393
  };
398
- typeof e.addNavigation == "object" && (f = {
399
- ...f,
394
+ typeof e.addNavigation == "object" && (v = {
395
+ ...v,
400
396
  ...e.addNavigation
401
397
  }), se([
402
398
  {
403
399
  selectors: n,
404
- handlers: f
400
+ handlers: v
405
401
  }
406
402
  ]);
407
403
  }
408
- const r = b(() => t.columns[e.colIndex].align || "center"), u = b(() => t.columns[e.colIndex].width || "40ch"), d = () => {
404
+ const d = y(() => a.align || "center"), p = y(() => a.width || "40ch"), c = () => {
409
405
  n.value && (o.value = n.value.textContent);
410
- }, s = () => {
411
- n.value && n.value.textContent !== o.value && (o.value = n.value.textContent, n.value.dispatchEvent(new Event("change")), l.value = !0, t.columns[e.colIndex].format || t.setCellData(e.rowIndex, e.colIndex, o.value));
412
- }, v = (f, x) => x && f === 0 && x > 0 ? `${x}ch` : "inherit", c = {
413
- textAlign: r.value,
414
- width: u.value,
406
+ }, m = () => {
407
+ n.value && n.value.textContent !== o.value && (o.value = n.value.textContent, n.value.dispatchEvent(new Event("change")), l.value = !0, a.format || t.setCellData(e.rowIndex, e.colIndex, o.value));
408
+ }, w = (v, E) => E && v === 0 && E > 0 ? `${E}ch` : "inherit", W = {
409
+ textAlign: d.value,
410
+ width: p.value,
415
411
  backgroundColor: l.value ? "var(--cell-modified-color)" : "inherit",
416
412
  fontWeight: l.value ? "bold" : "inherit",
417
- paddingLeft: v(e.colIndex, (p = t.display[e.rowIndex]) == null ? void 0 : p.indent)
413
+ paddingLeft: w(e.colIndex, (x = t.display[e.rowIndex]) == null ? void 0 : x.indent)
418
414
  };
419
- return (f, x) => (w(), g("td", {
415
+ return (v, E) => (h(), b("td", {
420
416
  ref: "cell",
421
- "data-colindex": f.colIndex,
422
- "data-rowindex": f.rowIndex,
423
- "data-editable": m(t).columns[f.colIndex].edit,
424
- contenteditable: m(t).columns[f.colIndex].edit,
425
- tabindex: f.tabIndex,
417
+ "data-colindex": v.colIndex,
418
+ "data-rowindex": v.rowIndex,
419
+ "data-editable": f(t).columns[v.colIndex].edit,
420
+ contenteditable: f(t).columns[v.colIndex].edit,
421
+ tabindex: v.tabIndex,
426
422
  spellcheck: !1,
427
- style: c,
428
- onFocus: d,
429
- onPaste: s,
430
- onBlur: s,
431
- onInput: s,
432
- onClick: a,
433
- onMousedown: a,
423
+ style: W,
424
+ onFocus: c,
425
+ onPaste: m,
426
+ onBlur: m,
427
+ onInput: m,
428
+ onClick: s,
429
+ onMousedown: s,
434
430
  class: "atable__cell"
435
431
  }, [
436
- m(t).columns[f.colIndex].cellComponent ? (w(), B(ke(m(t).columns[f.colIndex].cellComponent), te({
432
+ f(t).columns[v.colIndex].cellComponent ? (h(), B(ke(f(t).columns[v.colIndex].cellComponent), te({
437
433
  key: 0,
438
- value: i.value
439
- }, m(t).columns[f.colIndex].cellComponentProps), null, 16, ["value"])) : (w(), g("span", st, P(i.value), 1))
434
+ value: u.value
435
+ }, f(t).columns[v.colIndex].cellComponentProps), null, 16, ["value"])) : (h(), b("span", st, P(u.value), 1))
440
436
  ], 40, rt));
441
437
  }
442
438
  }), dt = ["tabindex"], ct = ["tabindex"], ut = ["colspan"], ft = /* @__PURE__ */ T({
@@ -449,7 +445,7 @@ const rt = ["data-colindex", "data-rowindex", "data-editable", "contenteditable"
449
445
  addNavigation: { type: [Boolean, Object] }
450
446
  },
451
447
  setup(e) {
452
- const t = Y(e.tableid), n = ee("rowEl"), o = b(() => t.display[e.rowIndex].expanded ? "▼" : "►");
448
+ const t = Y(e.tableid), n = ee("rowEl"), o = y(() => t.display[e.rowIndex].expanded ? "▼" : "►");
453
449
  if (e.addNavigation) {
454
450
  const l = {
455
451
  "keydown.control.g": (i) => {
@@ -463,7 +459,7 @@ const rt = ["data-colindex", "data-rowindex", "data-editable", "contenteditable"
463
459
  }
464
460
  ]);
465
461
  }
466
- return (l, i) => (w(), g(q, null, [
462
+ return (l, i) => (h(), b(q, null, [
467
463
  O("tr", te(l.$attrs, {
468
464
  ref: "rowEl",
469
465
  tabindex: l.tabIndex,
@@ -471,12 +467,12 @@ const rt = ["data-colindex", "data-rowindex", "data-editable", "contenteditable"
471
467
  }), [
472
468
  O("td", {
473
469
  tabIndex: -1,
474
- onClick: i[0] || (i[0] = (a) => m(t).toggleRowExpand(l.rowIndex)),
470
+ onClick: i[0] || (i[0] = (a) => f(t).toggleRowExpand(l.rowIndex)),
475
471
  class: "row-index"
476
472
  }, P(o.value), 1),
477
- E(l.$slots, "row")
473
+ I(l.$slots, "row")
478
474
  ], 16, dt),
479
- m(t).display[l.rowIndex].expanded ? (w(), g("tr", {
475
+ f(t).display[l.rowIndex].expanded ? (h(), b("tr", {
480
476
  key: 0,
481
477
  ref: "rowExpanded",
482
478
  tabindex: l.tabIndex,
@@ -484,10 +480,10 @@ const rt = ["data-colindex", "data-rowindex", "data-editable", "contenteditable"
484
480
  }, [
485
481
  O("td", {
486
482
  tabIndex: -1,
487
- colspan: m(t).columns.length + 1,
483
+ colspan: f(t).columns.length + 1,
488
484
  class: "expanded-row-content"
489
485
  }, [
490
- E(l.$slots, "content")
486
+ I(l.$slots, "content")
491
487
  ], 8, ut)
492
488
  ], 8, ct)) : G("", !0)
493
489
  ], 64));
@@ -506,7 +502,7 @@ const rt = ["data-colindex", "data-rowindex", "data-editable", "contenteditable"
506
502
  addNavigation: { type: [Boolean, Object], default: !1 }
507
503
  },
508
504
  setup(e) {
509
- const t = Y(e.tableid), n = ee("rowEl"), o = b(() => t.config.view !== "tree" || t.display[e.rowIndex].isRoot || t.display[e.rowIndex].open), l = b(() => t.config.view !== "tree" ? "" : t.display[e.rowIndex].isRoot || t.display[e.rowIndex].isParent ? t.display[e.rowIndex].childrenOpen ? "-" : "+" : ""), i = (a) => {
505
+ const t = Y(e.tableid), n = ee("rowEl"), o = y(() => t.config.view !== "tree" || t.display[e.rowIndex].isRoot || t.display[e.rowIndex].open), l = y(() => t.config.view !== "tree" ? "" : t.display[e.rowIndex].isRoot || t.display[e.rowIndex].isParent ? t.display[e.rowIndex].childrenOpen ? "-" : "+" : ""), i = (a) => {
510
506
  t.toggleRowExpand(a);
511
507
  };
512
508
  if (e.addNavigation) {
@@ -521,22 +517,22 @@ const rt = ["data-colindex", "data-rowindex", "data-editable", "contenteditable"
521
517
  }
522
518
  ]);
523
519
  }
524
- return (a, r) => Z((w(), g("tr", {
520
+ return (a, r) => Z((h(), b("tr", {
525
521
  ref: "rowEl",
526
522
  tabindex: a.tabIndex,
527
523
  class: "table-row"
528
524
  }, [
529
- E(a.$slots, "index", {}, () => [
530
- m(t).config.view === "list" ? (w(), g("td", pt, P(a.rowIndex + 1), 1)) : m(t).config.view === "tree" ? (w(), g("td", {
525
+ I(a.$slots, "index", {}, () => [
526
+ f(t).config.view === "list" ? (h(), b("td", pt, P(a.rowIndex + 1), 1)) : f(t).config.view === "tree" ? (h(), b("td", {
531
527
  key: 1,
532
528
  tabIndex: -1,
533
529
  class: "tree-index",
534
530
  onClick: r[0] || (r[0] = (u) => i(a.rowIndex))
535
531
  }, P(l.value), 1)) : G("", !0)
536
532
  ]),
537
- E(a.$slots, "default")
533
+ I(a.$slots, "default")
538
534
  ], 8, mt)), [
539
- [Ae, o.value]
535
+ [Ce, o.value]
540
536
  ]);
541
537
  }
542
538
  });
@@ -544,7 +540,7 @@ function Te(e) {
544
540
  return Ee() ? (Ie(e), !0) : !1;
545
541
  }
546
542
  function L(e) {
547
- return typeof e == "function" ? e() : m(e);
543
+ return typeof e == "function" ? e() : f(e);
548
544
  }
549
545
  const $e = typeof window < "u" && typeof document < "u";
550
546
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
@@ -563,7 +559,7 @@ function gt(...e) {
563
559
  if (e.length !== 1)
564
560
  return We(...e);
565
561
  const t = e[0];
566
- return typeof t == "function" ? Ve(Ue(() => ({ get: t, set: M }))) : I(t);
562
+ return typeof t == "function" ? Ve(Ue(() => ({ get: t, set: M }))) : k(t);
567
563
  }
568
564
  function R(e) {
569
565
  var t;
@@ -577,22 +573,22 @@ function F(...e) {
577
573
  return M;
578
574
  Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
579
575
  const i = [], a = () => {
580
- i.forEach((s) => s()), i.length = 0;
581
- }, r = (s, v, c, p) => (s.addEventListener(v, c, p), () => s.removeEventListener(v, c, p)), u = S(
576
+ i.forEach((d) => d()), i.length = 0;
577
+ }, r = (d, p, c, m) => (d.addEventListener(p, c, m), () => d.removeEventListener(p, c, m)), u = D(
582
578
  () => [R(t), L(l)],
583
- ([s, v]) => {
584
- if (a(), !s)
579
+ ([d, p]) => {
580
+ if (a(), !d)
585
581
  return;
586
- const c = wt(v) ? { ...v } : v;
582
+ const c = wt(p) ? { ...p } : p;
587
583
  i.push(
588
- ...n.flatMap((p) => o.map((f) => r(s, p, f, c)))
584
+ ...n.flatMap((m) => o.map((w) => r(d, m, w, c)))
589
585
  );
590
586
  },
591
587
  { immediate: !0, flush: "post" }
592
- ), d = () => {
588
+ ), s = () => {
593
589
  u(), a();
594
590
  };
595
- return Te(d), d;
591
+ return Te(s), s;
596
592
  }
597
593
  let ge = !1;
598
594
  function be(e, t, n = {}) {
@@ -601,17 +597,17 @@ function be(e, t, n = {}) {
601
597
  return M;
602
598
  _ && !ge && (ge = !0, Array.from(o.document.body.children).forEach((c) => c.addEventListener("click", M)), o.document.documentElement.addEventListener("click", M));
603
599
  let r = !0;
604
- const u = (c) => l.some((p) => {
605
- if (typeof p == "string")
606
- return Array.from(o.document.querySelectorAll(p)).some((f) => f === c.target || c.composedPath().includes(f));
600
+ const u = (c) => l.some((m) => {
601
+ if (typeof m == "string")
602
+ return Array.from(o.document.querySelectorAll(m)).some((w) => w === c.target || c.composedPath().includes(w));
607
603
  {
608
- const f = R(p);
609
- return f && (c.target === f || c.composedPath().includes(f));
604
+ const w = R(m);
605
+ return w && (c.target === w || c.composedPath().includes(w));
610
606
  }
611
- }), s = [
607
+ }), d = [
612
608
  F(o, "click", (c) => {
613
- const p = R(e);
614
- if (!(!p || p === c.target || c.composedPath().includes(p))) {
609
+ const m = R(e);
610
+ if (!(!m || m === c.target || c.composedPath().includes(m))) {
615
611
  if (c.detail === 0 && (r = !u(c)), !r) {
616
612
  r = !0;
617
613
  return;
@@ -620,18 +616,18 @@ function be(e, t, n = {}) {
620
616
  }
621
617
  }, { passive: !0, capture: i }),
622
618
  F(o, "pointerdown", (c) => {
623
- const p = R(e);
624
- r = !u(c) && !!(p && !c.composedPath().includes(p));
619
+ const m = R(e);
620
+ r = !u(c) && !!(m && !c.composedPath().includes(m));
625
621
  }, { passive: !0 }),
626
622
  a && F(o, "blur", (c) => {
627
623
  setTimeout(() => {
628
- var p;
629
- const f = R(e);
630
- ((p = o.document.activeElement) == null ? void 0 : p.tagName) === "IFRAME" && !(f != null && f.contains(o.document.activeElement)) && t(c);
624
+ var m;
625
+ const w = R(e);
626
+ ((m = o.document.activeElement) == null ? void 0 : m.tagName) === "IFRAME" && !(w != null && w.contains(o.document.activeElement)) && t(c);
631
627
  }, 0);
632
628
  })
633
629
  ].filter(Boolean);
634
- return () => s.forEach((c) => c());
630
+ return () => d.forEach((c) => c());
635
631
  }
636
632
  const bt = {
637
633
  [he.mounted](e, t) {
@@ -665,16 +661,16 @@ function yt(e) {
665
661
  }
666
662
  const J = /* @__PURE__ */ new WeakMap();
667
663
  function xt(e, t = !1) {
668
- const n = I(t);
664
+ const n = k(t);
669
665
  let o = null, l = "";
670
- S(gt(e), (r) => {
666
+ D(gt(e), (r) => {
671
667
  const u = X(L(r));
672
668
  if (u) {
673
- const d = u;
674
- if (J.get(d) || J.set(d, d.style.overflow), d.style.overflow !== "hidden" && (l = d.style.overflow), d.style.overflow === "hidden")
669
+ const s = u;
670
+ if (J.get(s) || J.set(s, s.style.overflow), s.style.overflow !== "hidden" && (l = s.style.overflow), s.style.overflow === "hidden")
675
671
  return n.value = !0;
676
672
  if (n.value)
677
- return d.style.overflow = "hidden";
673
+ return s.style.overflow = "hidden";
678
674
  }
679
675
  }, {
680
676
  immediate: !0
@@ -693,7 +689,7 @@ function xt(e, t = !1) {
693
689
  const r = X(L(e));
694
690
  !r || !n.value || (_ && (o == null || o()), r.style.overflow = l, J.delete(r), n.value = !1);
695
691
  };
696
- return Te(a), b({
692
+ return Te(a), y({
697
693
  get() {
698
694
  return n.value;
699
695
  },
@@ -704,48 +700,48 @@ function xt(e, t = !1) {
704
700
  }
705
701
  function Et() {
706
702
  let e = !1;
707
- const t = I(!1);
703
+ const t = k(!1);
708
704
  return (n, o) => {
709
705
  if (t.value = o.value, e)
710
706
  return;
711
707
  e = !0;
712
708
  const l = xt(n, o.value);
713
- S(t, (i) => l.value = i);
709
+ D(t, (i) => l.value = i);
714
710
  };
715
711
  }
716
712
  Et();
717
- var h = [];
713
+ var g = [];
718
714
  for (var Q = 0; Q < 256; ++Q)
719
- h.push((Q + 256).toString(16).slice(1));
715
+ g.push((Q + 256).toString(16).slice(1));
720
716
  function It(e, t = 0) {
721
- return (h[e[t + 0]] + h[e[t + 1]] + h[e[t + 2]] + h[e[t + 3]] + "-" + h[e[t + 4]] + h[e[t + 5]] + "-" + h[e[t + 6]] + h[e[t + 7]] + "-" + h[e[t + 8]] + h[e[t + 9]] + "-" + h[e[t + 10]] + h[e[t + 11]] + h[e[t + 12]] + h[e[t + 13]] + h[e[t + 14]] + h[e[t + 15]]).toLowerCase();
717
+ return (g[e[t + 0]] + g[e[t + 1]] + g[e[t + 2]] + g[e[t + 3]] + "-" + g[e[t + 4]] + g[e[t + 5]] + "-" + g[e[t + 6]] + g[e[t + 7]] + "-" + g[e[t + 8]] + g[e[t + 9]] + "-" + g[e[t + 10]] + g[e[t + 11]] + g[e[t + 12]] + g[e[t + 13]] + g[e[t + 14]] + g[e[t + 15]]).toLowerCase();
722
718
  }
723
719
  var U, kt = new Uint8Array(16);
724
- function At() {
720
+ function Ct() {
725
721
  if (!U && (U = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !U))
726
722
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
727
723
  return U(kt);
728
724
  }
729
- var Ct = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
725
+ var At = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
730
726
  const ye = {
731
- randomUUID: Ct
727
+ randomUUID: At
732
728
  };
733
729
  function St(e, t, n) {
734
730
  if (ye.randomUUID && !t && !e)
735
731
  return ye.randomUUID();
736
732
  e = e || {};
737
- var o = e.random || (e.rng || At)();
733
+ var o = e.random || (e.rng || Ct)();
738
734
  return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, It(o);
739
735
  }
740
736
  class Dt {
741
737
  constructor(t, n, o, l, i, a) {
742
- C(this, "id");
743
- C(this, "rows");
744
- C(this, "columns");
745
- C(this, "config");
746
- C(this, "table");
747
- C(this, "display");
748
- C(this, "modal");
738
+ S(this, "id");
739
+ S(this, "rows");
740
+ S(this, "columns");
741
+ S(this, "config");
742
+ S(this, "table");
743
+ S(this, "display");
744
+ S(this, "modal");
749
745
  this.id = t || St(), this.rows = o, this.columns = $(n), this.config = $(l), this.table = i || $(this.createTableObject()), this.display = this.createDisplayObject(a), this.modal = $({ visible: !1 });
750
746
  }
751
747
  createTableObject() {
@@ -779,7 +775,7 @@ class Dt {
779
775
  return ["list", "tree", "list-expansion"].includes(this.config.view);
780
776
  }
781
777
  get numberedRowWidth() {
782
- return b(() => String(Math.ceil(this.rows.length / 100) + 1) + "ch");
778
+ return y(() => String(Math.ceil(this.rows.length / 100) + 1) + "ch");
783
779
  }
784
780
  cellData(t, n) {
785
781
  return this.table[`${t}:${n}`];
@@ -818,15 +814,15 @@ const Tt = {
818
814
  textAlign: o.align || "center",
819
815
  width: t.config.fullWidth ? "auto" : null
820
816
  });
821
- return (o, l) => o.columns.length ? (w(), g("thead", Tt, [
817
+ return (o, l) => o.columns.length ? (h(), b("thead", Tt, [
822
818
  O("tr", $t, [
823
- m(t).zeroColumn ? (w(), g("th", Rt)) : G("", !0),
824
- (w(!0), g(q, null, K(o.columns, (i, a) => (w(), g("th", {
819
+ f(t).zeroColumn ? (h(), b("th", Rt)) : G("", !0),
820
+ (h(!0), b(q, null, K(o.columns, (i, a) => (h(), b("th", {
825
821
  key: i.name,
826
822
  tabindex: "-1",
827
823
  style: z(n(i))
828
824
  }, [
829
- E(o.$slots, "default", {}, () => [
825
+ I(o.$slots, "default", {}, () => [
830
826
  Be(P(i.label || String.fromCharCode(a + 97).toUpperCase()), 1)
831
827
  ])
832
828
  ], 4))), 128))
@@ -844,13 +840,13 @@ const Tt = {
844
840
  const t = (n) => {
845
841
  n.stopPropagation();
846
842
  };
847
- return (n, o) => (w(), g("div", {
843
+ return (n, o) => (h(), b("div", {
848
844
  class: "amodal",
849
845
  tabindex: "-1",
850
846
  onClick: t,
851
847
  onInput: t
852
848
  }, [
853
- E(n.$slots, "default")
849
+ I(n.$slots, "default")
854
850
  ], 32));
855
851
  }
856
852
  }), Ot = /* @__PURE__ */ T({
@@ -866,7 +862,7 @@ const Tt = {
866
862
  emits: ["update:modelValue"],
867
863
  setup(e, { emit: t }) {
868
864
  const n = t, o = e.modelValue ? e.modelValue : e.rows, l = new Dt(e.id, e.columns, o, e.config);
869
- ze(l.id, l), S(
865
+ ze(l.id, l), D(
870
866
  () => l.rows,
871
867
  (a) => {
872
868
  n("update:modelValue", a);
@@ -885,37 +881,37 @@ const Tt = {
885
881
  r.focus();
886
882
  });
887
883
  }
888
- }), (a, r) => Z((w(), g("table", {
884
+ }), (a, r) => Z((h(), b("table", {
889
885
  class: "atable",
890
- style: z({ width: m(l).config.fullWidth ? "100%" : "auto" })
886
+ style: z({ width: f(l).config.fullWidth ? "100%" : "auto" })
891
887
  }, [
892
- E(a.$slots, "header", { data: m(l) }, () => [
888
+ I(a.$slots, "header", { data: f(l) }, () => [
893
889
  de(Le, {
894
- columns: m(l).columns,
895
- tableid: m(l).id
890
+ columns: f(l).columns,
891
+ tableid: f(l).id
896
892
  }, null, 8, ["columns", "tableid"])
897
893
  ]),
898
894
  O("tbody", null, [
899
- E(a.$slots, "body", { data: m(l) }, () => [
900
- (w(!0), g(q, null, K(m(l).rows, (u, d) => (w(), B(De, {
895
+ I(a.$slots, "body", { data: f(l) }, () => [
896
+ (h(!0), b(q, null, K(f(l).rows, (u, s) => (h(), B(De, {
901
897
  key: u.id,
902
898
  row: u,
903
- rowIndex: d,
904
- tableid: m(l).id
899
+ rowIndex: s,
900
+ tableid: f(l).id
905
901
  }, {
906
902
  default: ce(() => [
907
- (w(!0), g(q, null, K(m(l).columns, (s, v) => (w(), B(Se, {
908
- key: s.name,
909
- tableid: m(l).id,
910
- col: s,
903
+ (h(!0), b(q, null, K(f(l).columns, (d, p) => (h(), B(Se, {
904
+ key: d.name,
905
+ tableid: f(l).id,
906
+ col: d,
911
907
  spellcheck: "false",
912
- rowIndex: d,
913
- colIndex: v + (m(l).zeroColumn ? 0 : -1),
914
- component: s.cellComponent,
908
+ rowIndex: s,
909
+ colIndex: p + (f(l).zeroColumn ? 0 : -1),
910
+ component: d.cellComponent,
915
911
  style: z({
916
- textAlign: (s == null ? void 0 : s.align) || "center",
917
- minWidth: (s == null ? void 0 : s.width) || "40ch",
918
- width: m(l).config.fullWidth ? "auto" : null
912
+ textAlign: (d == null ? void 0 : d.align) || "center",
913
+ minWidth: (d == null ? void 0 : d.width) || "40ch",
914
+ width: f(l).config.fullWidth ? "auto" : null
919
915
  })
920
916
  }, null, 8, ["tableid", "col", "rowIndex", "colIndex", "component", "style"]))), 128))
921
917
  ]),
@@ -923,33 +919,33 @@ const Tt = {
923
919
  }, 1032, ["row", "rowIndex", "tableid"]))), 128))
924
920
  ])
925
921
  ]),
926
- E(a.$slots, "footer", { data: m(l) }),
927
- E(a.$slots, "modal", { data: m(l) }, () => [
922
+ I(a.$slots, "footer", { data: f(l) }),
923
+ I(a.$slots, "modal", { data: f(l) }, () => [
928
924
  Z(de(Me, {
929
- colIndex: m(l).modal.colIndex,
930
- rowIndex: m(l).modal.rowIndex,
931
- tableid: m(l).id,
925
+ colIndex: f(l).modal.colIndex,
926
+ rowIndex: f(l).modal.rowIndex,
927
+ tableid: f(l).id,
932
928
  style: z({
933
- left: m(l).modal.left + "px",
934
- top: m(l).modal.top + "px",
935
- maxWidth: m(l).modal.width + "px"
929
+ left: f(l).modal.left + "px",
930
+ top: f(l).modal.top + "px",
931
+ maxWidth: f(l).modal.width + "px"
936
932
  })
937
933
  }, {
938
934
  default: ce(() => [
939
- (w(), B(ke(m(l).modal.component), te({
940
- key: `${m(l).modal.rowIndex}:${m(l).modal.colIndex}`,
941
- colIndex: m(l).modal.colIndex,
942
- rowIndex: m(l).modal.rowIndex,
943
- tableid: m(l).id
944
- }, m(l).modal.componentProps), null, 16, ["colIndex", "rowIndex", "tableid"]))
935
+ (h(), B(ke(f(l).modal.component), te({
936
+ key: `${f(l).modal.rowIndex}:${f(l).modal.colIndex}`,
937
+ colIndex: f(l).modal.colIndex,
938
+ rowIndex: f(l).modal.rowIndex,
939
+ tableid: f(l).id
940
+ }, f(l).modal.componentProps), null, 16, ["colIndex", "rowIndex", "tableid"]))
945
941
  ]),
946
942
  _: 1
947
943
  }, 8, ["colIndex", "rowIndex", "tableid", "style"]), [
948
- [Ae, m(l).modal.visible]
944
+ [Ce, f(l).modal.visible]
949
945
  ])
950
946
  ])
951
947
  ], 4)), [
952
- [m(bt), i]
948
+ [f(bt), i]
953
949
  ]);
954
950
  }
955
951
  });