@stonecrop/atable 0.4.13 → 0.4.15

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,4 +1,4 @@
1
- import { onMounted as ne, ref as R, watch as V, onBeforeUnmount as lt, computed as I, shallowRef as H, toValue as C, watchEffect as at, getCurrentScope as Fe, onScopeDispose as je, unref as x, getCurrentInstance as Ie, nextTick as Ue, isRef as st, toRefs as rt, customRef as Ye, toRef as it, readonly as ut, defineComponent as Q, useTemplateRef as G, createElementBlock as T, openBlock as k, normalizeClass as U, normalizeStyle as q, createBlock as se, resolveDynamicComponent as ve, mergeProps as ke, toDisplayString as K, Fragment as ie, createElementVNode as O, createCommentVNode as _, renderSlot as W, useCssVars as ct, withDirectives as xe, vShow as qe, renderList as Ce, createTextVNode as dt, withModifiers as Oe, createVNode as Le, withCtx as De } from "vue";
1
+ import { onMounted as ne, ref as P, watch as X, onBeforeUnmount as lt, computed as k, shallowRef as H, toValue as E, watchEffect as at, getCurrentScope as Fe, onScopeDispose as je, unref as b, getCurrentInstance as Ie, nextTick as Ue, isRef as st, toRefs as rt, customRef as Ye, toRef as it, readonly as ut, defineComponent as J, useTemplateRef as N, createElementBlock as R, openBlock as S, normalizeClass as j, normalizeStyle as Y, createBlock as se, resolveDynamicComponent as ve, mergeProps as ke, toDisplayString as K, Fragment as ie, createElementVNode as L, createCommentVNode as _, renderSlot as W, useCssVars as ct, withDirectives as xe, vShow as qe, renderList as Ce, createTextVNode as dt, withModifiers as Oe, createVNode as Le, withCtx as De } from "vue";
2
2
  import { defineStore as ft } from "pinia";
3
3
  import './assets/index.css';function Me(e) {
4
4
  return Fe() ? (je(e), !0) : !1;
@@ -11,7 +11,7 @@ function me(e) {
11
11
  return Array.isArray(e) ? e : [e];
12
12
  }
13
13
  function wt(e, t, n) {
14
- return V(
14
+ return X(
15
15
  e,
16
16
  t,
17
17
  {
@@ -23,41 +23,41 @@ function wt(e, t, n) {
23
23
  const oe = vt ? window : void 0;
24
24
  function ee(e) {
25
25
  var t;
26
- const n = C(e);
26
+ const n = E(e);
27
27
  return (t = n == null ? void 0 : n.$el) != null ? t : n;
28
28
  }
29
29
  function ce(...e) {
30
30
  const t = [], n = () => {
31
31
  t.forEach((a) => a()), t.length = 0;
32
- }, o = (a, i, r, s) => (a.addEventListener(i, r, s), () => a.removeEventListener(i, r, s)), u = I(() => {
33
- const a = me(C(e[0])).filter((i) => i != null);
32
+ }, o = (a, i, r, s) => (a.addEventListener(i, r, s), () => a.removeEventListener(i, r, s)), u = k(() => {
33
+ const a = me(E(e[0])).filter((i) => i != null);
34
34
  return a.every((i) => typeof i != "string") ? a : void 0;
35
- }), d = wt(
35
+ }), c = wt(
36
36
  () => {
37
37
  var a, i;
38
38
  return [
39
39
  (i = (a = u.value) == null ? void 0 : a.map((r) => ee(r))) != null ? i : [oe].filter((r) => r != null),
40
- me(C(u.value ? e[1] : e[0])),
41
- me(x(u.value ? e[2] : e[1])),
40
+ me(E(u.value ? e[1] : e[0])),
41
+ me(b(u.value ? e[2] : e[1])),
42
42
  // @ts-expect-error - TypeScript gets the correct types, but somehow still complains
43
- C(u.value ? e[3] : e[2])
43
+ E(u.value ? e[3] : e[2])
44
44
  ];
45
45
  },
46
46
  ([a, i, r, s]) => {
47
47
  if (n(), !(a != null && a.length) || !(i != null && i.length) || !(r != null && r.length))
48
48
  return;
49
- const v = ht(s) ? { ...s } : s;
49
+ const g = ht(s) ? { ...s } : s;
50
50
  t.push(
51
51
  ...a.flatMap(
52
52
  (m) => i.flatMap(
53
- (w) => r.map((g) => o(m, w, g, v))
53
+ (w) => r.map((v) => o(m, w, v, g))
54
54
  )
55
55
  )
56
56
  );
57
57
  },
58
58
  { flush: "post" }
59
59
  ), l = () => {
60
- d(), n();
60
+ c(), n();
61
61
  };
62
62
  return Me(n), l;
63
63
  }
@@ -69,28 +69,28 @@ function yt() {
69
69
  }
70
70
  function bt(e) {
71
71
  const t = yt();
72
- return I(() => (t.value, !!e()));
72
+ return k(() => (t.value, !!e()));
73
73
  }
74
74
  function xt(e, t, n = {}) {
75
75
  const { window: o = oe, ...u } = n;
76
- let d;
76
+ let c;
77
77
  const l = bt(() => o && "MutationObserver" in o), a = () => {
78
- d && (d.disconnect(), d = void 0);
79
- }, i = I(() => {
80
- const m = C(e), w = me(m).map(ee).filter(mt);
78
+ c && (c.disconnect(), c = void 0);
79
+ }, i = k(() => {
80
+ const m = E(e), w = me(m).map(ee).filter(mt);
81
81
  return new Set(w);
82
- }), r = V(
82
+ }), r = X(
83
83
  () => i.value,
84
84
  (m) => {
85
- a(), l.value && m.size && (d = new MutationObserver(t), m.forEach((w) => d.observe(w, u)));
85
+ a(), l.value && m.size && (c = new MutationObserver(t), m.forEach((w) => c.observe(w, u)));
86
86
  },
87
87
  { immediate: !0, flush: "post" }
88
- ), s = () => d == null ? void 0 : d.takeRecords(), v = () => {
88
+ ), s = () => c == null ? void 0 : c.takeRecords(), g = () => {
89
89
  r(), a();
90
90
  };
91
- return Me(v), {
91
+ return Me(g), {
92
92
  isSupported: l,
93
- stop: v,
93
+ stop: g,
94
94
  takeRecords: s
95
95
  };
96
96
  }
@@ -98,7 +98,7 @@ function Ct(e, t, n = {}) {
98
98
  const {
99
99
  window: o = oe,
100
100
  document: u = o == null ? void 0 : o.document,
101
- flush: d = "sync"
101
+ flush: c = "sync"
102
102
  } = n;
103
103
  if (!o || !u)
104
104
  return pt;
@@ -108,7 +108,7 @@ function Ct(e, t, n = {}) {
108
108
  }, i = at(() => {
109
109
  const s = ee(e);
110
110
  if (s) {
111
- const { stop: v } = xt(
111
+ const { stop: g } = xt(
112
112
  u,
113
113
  (m) => {
114
114
  m.map((w) => [...w.removedNodes]).flat().some((w) => w === s || w.contains(s)) && t(m);
@@ -119,9 +119,9 @@ function Ct(e, t, n = {}) {
119
119
  subtree: !0
120
120
  }
121
121
  );
122
- a(v);
122
+ a(g);
123
123
  }
124
- }, { flush: d }), r = () => {
124
+ }, { flush: c }), r = () => {
125
125
  i(), a();
126
126
  };
127
127
  return Me(r), r;
@@ -132,14 +132,14 @@ function Et(e = {}) {
132
132
  window: n = oe,
133
133
  deep: o = !0,
134
134
  triggerOnRemoval: u = !1
135
- } = e, d = (t = e.document) != null ? t : n == null ? void 0 : n.document, l = () => {
135
+ } = e, c = (t = e.document) != null ? t : n == null ? void 0 : n.document, l = () => {
136
136
  var r;
137
- let s = d == null ? void 0 : d.activeElement;
137
+ let s = c == null ? void 0 : c.activeElement;
138
138
  if (o)
139
139
  for (; s != null && s.shadowRoot; )
140
140
  s = (r = s == null ? void 0 : s.shadowRoot) == null ? void 0 : r.activeElement;
141
141
  return s;
142
- }, a = R(), i = () => {
142
+ }, a = P(), i = () => {
143
143
  a.value = l();
144
144
  };
145
145
  if (n) {
@@ -161,31 +161,31 @@ function Et(e = {}) {
161
161
  r
162
162
  );
163
163
  }
164
- return u && Ct(a, i, { document: d }), i(), a;
164
+ return u && Ct(a, i, { document: c }), i(), a;
165
165
  }
166
166
  const It = "focusin", kt = "focusout", Mt = ":focus-within";
167
- function $t(e, t = {}) {
168
- const { window: n = oe } = t, o = I(() => ee(e)), u = H(!1), d = I(() => u.value), l = Et(t);
167
+ function St(e, t = {}) {
168
+ const { window: n = oe } = t, o = k(() => ee(e)), u = H(!1), c = k(() => u.value), l = Et(t);
169
169
  if (!n || !l.value)
170
- return { focused: d };
170
+ return { focused: c };
171
171
  const a = { passive: !0 };
172
172
  return ce(o, It, () => u.value = !0, a), ce(o, kt, () => {
173
173
  var i, r, s;
174
174
  return u.value = (s = (r = (i = o.value) == null ? void 0 : i.matches) == null ? void 0 : r.call(i, Mt)) != null ? s : !1;
175
- }, a), { focused: d };
175
+ }, a), { focused: c };
176
176
  }
177
- function At(e, { window: t = oe, scrollTarget: n } = {}) {
178
- const o = R(!1), u = () => {
177
+ function $t(e, { window: t = oe, scrollTarget: n } = {}) {
178
+ const o = P(!1), u = () => {
179
179
  if (!t) return;
180
- const d = t.document, l = ee(e);
180
+ const c = t.document, l = ee(e);
181
181
  if (!l)
182
182
  o.value = !1;
183
183
  else {
184
184
  const a = l.getBoundingClientRect();
185
- o.value = a.top <= (t.innerHeight || d.documentElement.clientHeight) && a.left <= (t.innerWidth || d.documentElement.clientWidth) && a.bottom >= 0 && a.right >= 0;
185
+ o.value = a.top <= (t.innerHeight || c.documentElement.clientHeight) && a.left <= (t.innerWidth || c.documentElement.clientWidth) && a.bottom >= 0 && a.right >= 0;
186
186
  }
187
187
  };
188
- return V(
188
+ return X(
189
189
  () => ee(e),
190
190
  () => u(),
191
191
  { immediate: !0, flush: "post" }
@@ -194,13 +194,13 @@ function At(e, { window: t = oe, scrollTarget: n } = {}) {
194
194
  passive: !0
195
195
  }), o;
196
196
  }
197
- const z = (e) => {
198
- let t = At(e).value;
197
+ const G = (e) => {
198
+ let t = $t(e).value;
199
199
  return t = t && e.offsetHeight > 0, t;
200
- }, F = (e) => e.tabIndex >= 0, He = (e) => {
200
+ }, z = (e) => e.tabIndex >= 0, He = (e) => {
201
201
  const t = e.target;
202
- return $e(t);
203
- }, $e = (e) => {
202
+ return Se(t);
203
+ }, Se = (e) => {
204
204
  var t;
205
205
  let n;
206
206
  if (e instanceof HTMLTableCellElement) {
@@ -213,29 +213,29 @@ const z = (e) => {
213
213
  const o = e.previousElementSibling;
214
214
  o && (n = o);
215
215
  }
216
- return n && (!F(n) || !z(n)) ? $e(n) : n;
217
- }, St = (e) => {
216
+ return n && (!z(n) || !G(n)) ? Se(n) : n;
217
+ }, At = (e) => {
218
218
  var t;
219
219
  const n = e.target;
220
220
  let o;
221
221
  if (n instanceof HTMLTableCellElement) {
222
222
  const u = (t = n.parentElement) == null ? void 0 : t.parentElement;
223
223
  if (u) {
224
- const d = u.firstElementChild, l = d == null ? void 0 : d.children[n.cellIndex];
224
+ const c = u.firstElementChild, l = c == null ? void 0 : c.children[n.cellIndex];
225
225
  l && (o = l);
226
226
  }
227
227
  } else if (n instanceof HTMLTableRowElement) {
228
228
  const u = n.parentElement;
229
229
  if (u) {
230
- const d = u.firstElementChild;
231
- d && (o = d);
230
+ const c = u.firstElementChild;
231
+ c && (o = c);
232
232
  }
233
233
  }
234
- return o && (!F(o) || !z(o)) ? Ae(o) : o;
234
+ return o && (!z(o) || !G(o)) ? $e(o) : o;
235
235
  }, We = (e) => {
236
236
  const t = e.target;
237
- return Ae(t);
238
- }, Ae = (e) => {
237
+ return $e(t);
238
+ }, $e = (e) => {
239
239
  var t;
240
240
  let n;
241
241
  if (e instanceof HTMLTableCellElement) {
@@ -248,7 +248,7 @@ const z = (e) => {
248
248
  const o = e.nextElementSibling;
249
249
  o && (n = o);
250
250
  }
251
- return n && (!F(n) || !z(n)) ? Ae(n) : n;
251
+ return n && (!z(n) || !G(n)) ? $e(n) : n;
252
252
  }, Tt = (e) => {
253
253
  var t;
254
254
  const n = e.target;
@@ -256,21 +256,21 @@ const z = (e) => {
256
256
  if (n instanceof HTMLTableCellElement) {
257
257
  const u = (t = n.parentElement) == null ? void 0 : t.parentElement;
258
258
  if (u) {
259
- const d = u.lastElementChild, l = d == null ? void 0 : d.children[n.cellIndex];
259
+ const c = u.lastElementChild, l = c == null ? void 0 : c.children[n.cellIndex];
260
260
  l && (o = l);
261
261
  }
262
262
  } else if (n instanceof HTMLTableRowElement) {
263
263
  const u = n.parentElement;
264
264
  if (u) {
265
- const d = u.lastElementChild;
266
- d && (o = d);
265
+ const c = u.lastElementChild;
266
+ c && (o = c);
267
267
  }
268
268
  }
269
- return o && (!F(o) || !z(o)) ? $e(o) : o;
269
+ return o && (!z(o) || !G(o)) ? Se(o) : o;
270
270
  }, Be = (e) => {
271
271
  const t = e.target;
272
- return Se(t);
273
- }, Se = (e) => {
272
+ return Ae(t);
273
+ }, Ae = (e) => {
274
274
  var t;
275
275
  let n;
276
276
  if (e.previousElementSibling)
@@ -279,7 +279,7 @@ const z = (e) => {
279
279
  const o = (t = e.parentElement) == null ? void 0 : t.previousElementSibling;
280
280
  n = o == null ? void 0 : o.lastElementChild;
281
281
  }
282
- return n && (!F(n) || !z(n)) ? Se(n) : n;
282
+ return n && (!z(n) || !G(n)) ? Ae(n) : n;
283
283
  }, Xe = (e) => {
284
284
  const t = e.target;
285
285
  return Te(t);
@@ -292,13 +292,13 @@ const z = (e) => {
292
292
  const o = (t = e.parentElement) == null ? void 0 : t.nextElementSibling;
293
293
  n = o == null ? void 0 : o.firstElementChild;
294
294
  }
295
- return n && (!F(n) || !z(n)) ? Te(n) : n;
295
+ return n && (!z(n) || !G(n)) ? Te(n) : n;
296
296
  }, Ve = (e) => {
297
297
  const t = e.target.parentElement, n = t == null ? void 0 : t.firstElementChild;
298
- return n && (!F(n) || !z(n)) ? Te(n) : n;
298
+ return n && (!z(n) || !G(n)) ? Te(n) : n;
299
299
  }, Ne = (e) => {
300
300
  const t = e.target.parentElement, n = t == null ? void 0 : t.lastElementChild;
301
- return n && (!F(n) || !z(n)) ? Se(n) : n;
301
+ return n && (!z(n) || !G(n)) ? Ae(n) : n;
302
302
  }, fe = ["alt", "control", "shift", "meta"], Rt = {
303
303
  ArrowUp: "up",
304
304
  ArrowDown: "down",
@@ -322,7 +322,7 @@ const z = (e) => {
322
322
  e.preventDefault(), e.stopPropagation(), t && t.focus();
323
323
  },
324
324
  "keydown.control.up": (e) => {
325
- const t = St(e);
325
+ const t = At(e);
326
326
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
327
327
  },
328
328
  "keydown.control.down": (e) => {
@@ -393,43 +393,43 @@ function Pe(e) {
393
393
  }, o = (l) => {
394
394
  const a = t(l);
395
395
  let i = [];
396
- return l.selectors ? i = n(l) : a && (i = Array.from(a.children).filter((r) => F(r) && z(r))), i;
396
+ return l.selectors ? i = n(l) : a && (i = Array.from(a.children).filter((r) => z(r) && G(r))), i;
397
397
  }, u = (l) => (a) => {
398
398
  const i = Rt[a.key] || a.key.toLowerCase();
399
399
  if (fe.includes(i)) return;
400
400
  const r = l.handlers || Re;
401
401
  for (const s of Object.keys(r)) {
402
- const [v, ...m] = s.split(".");
403
- if (v === "keydown" && m.includes(i)) {
404
- const w = r[s], g = m.filter((f) => fe.includes(f)), y = fe.some((f) => {
405
- const c = f.charAt(0).toUpperCase() + f.slice(1);
406
- return a.getModifierState(c);
402
+ const [g, ...m] = s.split(".");
403
+ if (g === "keydown" && m.includes(i)) {
404
+ const w = r[s], v = m.filter((f) => fe.includes(f)), x = fe.some((f) => {
405
+ const d = f.charAt(0).toUpperCase() + f.slice(1);
406
+ return a.getModifierState(d);
407
407
  });
408
- if (g.length > 0) {
409
- if (y) {
408
+ if (v.length > 0) {
409
+ if (x) {
410
410
  for (const f of fe)
411
411
  if (m.includes(f)) {
412
- const c = f.charAt(0).toUpperCase() + f.slice(1);
413
- a.getModifierState(c) && w(a);
412
+ const d = f.charAt(0).toUpperCase() + f.slice(1);
413
+ a.getModifierState(d) && w(a);
414
414
  }
415
415
  }
416
416
  } else
417
- y || w(a);
417
+ x || w(a);
418
418
  }
419
419
  }
420
- }, d = [];
420
+ }, c = [];
421
421
  ne(() => {
422
422
  for (const l of e) {
423
423
  const a = t(l), i = o(l), r = u(l), s = a ? [a] : i;
424
- for (const v of s) {
425
- const { focused: m } = $t(R(v)), w = V(m, (g) => {
426
- g ? v.addEventListener("keydown", r) : v.removeEventListener("keydown", r);
424
+ for (const g of s) {
425
+ const { focused: m } = St(P(g)), w = X(m, (v) => {
426
+ v ? g.addEventListener("keydown", r) : g.removeEventListener("keydown", r);
427
427
  });
428
- d.push(w);
428
+ c.push(w);
429
429
  }
430
430
  }
431
431
  }), lt(() => {
432
- for (const l of d)
432
+ for (const l of c)
433
433
  l();
434
434
  });
435
435
  }
@@ -438,7 +438,7 @@ function de(e) {
438
438
  }
439
439
  const he = typeof window < "u" && typeof document < "u";
440
440
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
441
- const Pt = (e) => e != null, Ot = Object.prototype.toString, Je = (e) => Ot.call(e) === "[object Object]", Y = () => {
441
+ const Pt = (e) => e != null, Ot = Object.prototype.toString, Je = (e) => Ot.call(e) === "[object Object]", U = () => {
442
442
  }, Ee = /* @__PURE__ */ Lt();
443
443
  function Lt() {
444
444
  var e, t;
@@ -447,14 +447,14 @@ function Lt() {
447
447
  function Dt(e) {
448
448
  return Ie();
449
449
  }
450
- function J(e) {
450
+ function q(e) {
451
451
  return Array.isArray(e) ? e : [e];
452
452
  }
453
453
  function Ht(...e) {
454
454
  if (e.length !== 1)
455
455
  return it(...e);
456
456
  const t = e[0];
457
- return typeof t == "function" ? ut(Ye(() => ({ get: t, set: Y }))) : R(t);
457
+ return typeof t == "function" ? ut(Ye(() => ({ get: t, set: U }))) : P(t);
458
458
  }
459
459
  function Wt(e, t = {}) {
460
460
  if (!st(e))
@@ -466,8 +466,8 @@ function Wt(e, t = {}) {
466
466
  return e.value[o];
467
467
  },
468
468
  set(u) {
469
- var d;
470
- if ((d = C(t.replaceRef)) != null ? d : !0)
469
+ var c;
470
+ if ((c = E(t.replaceRef)) != null ? c : !0)
471
471
  if (Array.isArray(e.value)) {
472
472
  const a = [...e.value];
473
473
  a[o] = u, e.value = a;
@@ -485,7 +485,7 @@ function Bt(e, t = !0, n) {
485
485
  Dt() ? ne(e, n) : t ? e() : Ue(e);
486
486
  }
487
487
  function Qe(e, t, n) {
488
- return V(
488
+ return X(
489
489
  e,
490
490
  t,
491
491
  {
@@ -497,41 +497,41 @@ function Qe(e, t, n) {
497
497
  const pe = he ? window : void 0;
498
498
  function te(e) {
499
499
  var t;
500
- const n = C(e);
500
+ const n = E(e);
501
501
  return (t = n == null ? void 0 : n.$el) != null ? t : n;
502
502
  }
503
503
  function ue(...e) {
504
504
  const t = [], n = () => {
505
505
  t.forEach((a) => a()), t.length = 0;
506
- }, o = (a, i, r, s) => (a.addEventListener(i, r, s), () => a.removeEventListener(i, r, s)), u = I(() => {
507
- const a = J(C(e[0])).filter((i) => i != null);
506
+ }, o = (a, i, r, s) => (a.addEventListener(i, r, s), () => a.removeEventListener(i, r, s)), u = k(() => {
507
+ const a = q(E(e[0])).filter((i) => i != null);
508
508
  return a.every((i) => typeof i != "string") ? a : void 0;
509
- }), d = Qe(
509
+ }), c = Qe(
510
510
  () => {
511
511
  var a, i;
512
512
  return [
513
513
  (i = (a = u.value) == null ? void 0 : a.map((r) => te(r))) != null ? i : [pe].filter((r) => r != null),
514
- J(C(u.value ? e[1] : e[0])),
515
- J(x(u.value ? e[2] : e[1])),
514
+ q(E(u.value ? e[1] : e[0])),
515
+ q(b(u.value ? e[2] : e[1])),
516
516
  // @ts-expect-error - TypeScript gets the correct types, but somehow still complains
517
- C(u.value ? e[3] : e[2])
517
+ E(u.value ? e[3] : e[2])
518
518
  ];
519
519
  },
520
520
  ([a, i, r, s]) => {
521
521
  if (n(), !(a != null && a.length) || !(i != null && i.length) || !(r != null && r.length))
522
522
  return;
523
- const v = Je(s) ? { ...s } : s;
523
+ const g = Je(s) ? { ...s } : s;
524
524
  t.push(
525
525
  ...a.flatMap(
526
526
  (m) => i.flatMap(
527
- (w) => r.map((g) => o(m, w, g, v))
527
+ (w) => r.map((v) => o(m, w, v, g))
528
528
  )
529
529
  )
530
530
  );
531
531
  },
532
532
  { flush: "post" }
533
533
  ), l = () => {
534
- d(), n();
534
+ c(), n();
535
535
  };
536
536
  return de(n), l;
537
537
  }
@@ -543,28 +543,28 @@ function Xt() {
543
543
  }
544
544
  function Ze(e) {
545
545
  const t = Xt();
546
- return I(() => (t.value, !!e()));
546
+ return k(() => (t.value, !!e()));
547
547
  }
548
548
  function Ke(e, t, n = {}) {
549
549
  const { window: o = pe, ...u } = n;
550
- let d;
550
+ let c;
551
551
  const l = Ze(() => o && "MutationObserver" in o), a = () => {
552
- d && (d.disconnect(), d = void 0);
553
- }, i = I(() => {
554
- const m = C(e), w = J(m).map(te).filter(Pt);
552
+ c && (c.disconnect(), c = void 0);
553
+ }, i = k(() => {
554
+ const m = E(e), w = q(m).map(te).filter(Pt);
555
555
  return new Set(w);
556
- }), r = V(
556
+ }), r = X(
557
557
  () => i.value,
558
558
  (m) => {
559
- a(), l.value && m.size && (d = new MutationObserver(t), m.forEach((w) => d.observe(w, u)));
559
+ a(), l.value && m.size && (c = new MutationObserver(t), m.forEach((w) => c.observe(w, u)));
560
560
  },
561
561
  { immediate: !0, flush: "post" }
562
- ), s = () => d == null ? void 0 : d.takeRecords(), v = () => {
562
+ ), s = () => c == null ? void 0 : c.takeRecords(), g = () => {
563
563
  r(), a();
564
564
  };
565
- return de(v), {
565
+ return de(g), {
566
566
  isSupported: l,
567
- stop: v,
567
+ stop: g,
568
568
  takeRecords: s
569
569
  };
570
570
  }
@@ -573,76 +573,76 @@ function we(e, t = {}) {
573
573
  const {
574
574
  pointerTypes: o,
575
575
  preventDefault: u,
576
- stopPropagation: d,
576
+ stopPropagation: c,
577
577
  exact: l,
578
578
  onMove: a,
579
579
  onEnd: i,
580
580
  onStart: r,
581
581
  initialValue: s,
582
- axis: v = "both",
582
+ axis: g = "both",
583
583
  draggingElement: m = pe,
584
584
  containerElement: w,
585
- handle: g = e,
586
- buttons: y = [0]
587
- } = t, f = R(
588
- (n = C(s)) != null ? n : { x: 0, y: 0 }
589
- ), c = R(), h = (E) => o ? o.includes(E.pointerType) : !0, A = (E) => {
590
- C(u) && E.preventDefault(), C(d) && E.stopPropagation();
591
- }, M = (E) => {
592
- var D;
593
- if (!C(y).includes(E.button) || C(t.disabled) || !h(E) || C(l) && E.target !== C(e))
585
+ handle: v = e,
586
+ buttons: x = [0]
587
+ } = t, f = P(
588
+ (n = E(s)) != null ? n : { x: 0, y: 0 }
589
+ ), d = P(), p = (C) => o ? o.includes(C.pointerType) : !0, M = (C) => {
590
+ E(u) && C.preventDefault(), E(c) && C.stopPropagation();
591
+ }, $ = (C) => {
592
+ var A;
593
+ if (!E(x).includes(C.button) || E(t.disabled) || !p(C) || E(l) && C.target !== E(e))
594
594
  return;
595
- const X = C(w), j = (D = X == null ? void 0 : X.getBoundingClientRect) == null ? void 0 : D.call(X), N = C(e).getBoundingClientRect(), p = {
596
- x: E.clientX - (X ? N.left - j.left + X.scrollLeft : N.left),
597
- y: E.clientY - (X ? N.top - j.top + X.scrollTop : N.top)
595
+ const B = E(w), F = (A = B == null ? void 0 : B.getBoundingClientRect) == null ? void 0 : A.call(B), V = E(e).getBoundingClientRect(), h = {
596
+ x: C.clientX - (B ? V.left - F.left + B.scrollLeft : V.left),
597
+ y: C.clientY - (B ? V.top - F.top + B.scrollTop : V.top)
598
598
  };
599
- (r == null ? void 0 : r(p, E)) !== !1 && (c.value = p, A(E));
600
- }, $ = (E) => {
601
- if (C(t.disabled) || !h(E) || !c.value)
599
+ (r == null ? void 0 : r(h, C)) !== !1 && (d.value = h, M(C));
600
+ }, I = (C) => {
601
+ if (E(t.disabled) || !p(C) || !d.value)
602
602
  return;
603
- const D = C(w), X = C(e).getBoundingClientRect();
604
- let { x: j, y: N } = f.value;
605
- (v === "x" || v === "both") && (j = E.clientX - c.value.x, D && (j = Math.min(Math.max(0, j), D.scrollWidth - X.width))), (v === "y" || v === "both") && (N = E.clientY - c.value.y, D && (N = Math.min(Math.max(0, N), D.scrollHeight - X.height))), f.value = {
606
- x: j,
607
- y: N
608
- }, a == null || a(f.value, E), A(E);
609
- }, B = (E) => {
610
- C(t.disabled) || !h(E) || c.value && (c.value = void 0, i == null || i(f.value, E), A(E));
603
+ const A = E(w), B = E(e).getBoundingClientRect();
604
+ let { x: F, y: V } = f.value;
605
+ (g === "x" || g === "both") && (F = C.clientX - d.value.x, A && (F = Math.min(Math.max(0, F), A.scrollWidth - B.width))), (g === "y" || g === "both") && (V = C.clientY - d.value.y, A && (V = Math.min(Math.max(0, V), A.scrollHeight - B.height))), f.value = {
606
+ x: F,
607
+ y: V
608
+ }, a == null || a(f.value, C), M(C);
609
+ }, Q = (C) => {
610
+ E(t.disabled) || !p(C) || d.value && (d.value = void 0, i == null || i(f.value, C), M(C));
611
611
  };
612
612
  if (he) {
613
- const E = () => {
614
- var D;
613
+ const C = () => {
614
+ var A;
615
615
  return {
616
- capture: (D = t.capture) != null ? D : !0,
617
- passive: !C(u)
616
+ capture: (A = t.capture) != null ? A : !0,
617
+ passive: !E(u)
618
618
  };
619
619
  };
620
- ue(g, "pointerdown", M, E), ue(m, "pointermove", $, E), ue(m, "pointerup", B, E);
620
+ ue(v, "pointerdown", $, C), ue(m, "pointermove", I, C), ue(m, "pointerup", Q, C);
621
621
  }
622
622
  return {
623
623
  ...Wt(f),
624
624
  position: f,
625
- isDragging: I(() => !!c.value),
626
- style: I(
625
+ isDragging: k(() => !!d.value),
626
+ style: k(
627
627
  () => `left:${f.value.x}px;top:${f.value.y}px;`
628
628
  )
629
629
  };
630
630
  }
631
631
  function Vt(e, t, n = {}) {
632
632
  const { window: o = pe, ...u } = n;
633
- let d;
633
+ let c;
634
634
  const l = Ze(() => o && "ResizeObserver" in o), a = () => {
635
- d && (d.disconnect(), d = void 0);
636
- }, i = I(() => {
637
- const v = C(e);
638
- return Array.isArray(v) ? v.map((m) => te(m)) : [te(v)];
639
- }), r = V(
635
+ c && (c.disconnect(), c = void 0);
636
+ }, i = k(() => {
637
+ const g = E(e);
638
+ return Array.isArray(g) ? g.map((m) => te(m)) : [te(g)];
639
+ }), r = X(
640
640
  i,
641
- (v) => {
641
+ (g) => {
642
642
  if (a(), l.value && o) {
643
- d = new ResizeObserver(t);
644
- for (const m of v)
645
- m && d.observe(m, u);
643
+ c = new ResizeObserver(t);
644
+ for (const m of g)
645
+ m && c.observe(m, u);
646
646
  }
647
647
  },
648
648
  { immediate: !0, flush: "post" }
@@ -659,41 +659,41 @@ function ge(e, t = {}) {
659
659
  reset: n = !0,
660
660
  windowResize: o = !0,
661
661
  windowScroll: u = !0,
662
- immediate: d = !0,
662
+ immediate: c = !0,
663
663
  updateTiming: l = "sync"
664
- } = t, a = H(0), i = H(0), r = H(0), s = H(0), v = H(0), m = H(0), w = H(0), g = H(0);
665
- function y() {
666
- const c = te(e);
667
- if (!c) {
668
- n && (a.value = 0, i.value = 0, r.value = 0, s.value = 0, v.value = 0, m.value = 0, w.value = 0, g.value = 0);
664
+ } = t, a = H(0), i = H(0), r = H(0), s = H(0), g = H(0), m = H(0), w = H(0), v = H(0);
665
+ function x() {
666
+ const d = te(e);
667
+ if (!d) {
668
+ n && (a.value = 0, i.value = 0, r.value = 0, s.value = 0, g.value = 0, m.value = 0, w.value = 0, v.value = 0);
669
669
  return;
670
670
  }
671
- const h = c.getBoundingClientRect();
672
- a.value = h.height, i.value = h.bottom, r.value = h.left, s.value = h.right, v.value = h.top, m.value = h.width, w.value = h.x, g.value = h.y;
671
+ const p = d.getBoundingClientRect();
672
+ a.value = p.height, i.value = p.bottom, r.value = p.left, s.value = p.right, g.value = p.top, m.value = p.width, w.value = p.x, v.value = p.y;
673
673
  }
674
674
  function f() {
675
- l === "sync" ? y() : l === "next-frame" && requestAnimationFrame(() => y());
675
+ l === "sync" ? x() : l === "next-frame" && requestAnimationFrame(() => x());
676
676
  }
677
- return Vt(e, f), V(() => te(e), (c) => !c && f()), Ke(e, f, {
677
+ return Vt(e, f), X(() => te(e), (d) => !d && f()), Ke(e, f, {
678
678
  attributeFilter: ["style", "class"]
679
679
  }), u && ue("scroll", f, { capture: !0, passive: !0 }), o && ue("resize", f, { passive: !0 }), Bt(() => {
680
- d && f();
680
+ c && f();
681
681
  }), {
682
682
  height: a,
683
683
  bottom: i,
684
684
  left: r,
685
685
  right: s,
686
- top: v,
686
+ top: g,
687
687
  width: m,
688
688
  x: w,
689
- y: g,
689
+ y: v,
690
690
  update: f
691
691
  };
692
692
  }
693
693
  const Nt = (e) => {
694
694
  const t = new DOMParser().parseFromString(e, "text/html");
695
695
  return Array.from(t.body.childNodes).some((n) => n.nodeType === 1);
696
- }, Gt = (e = 8) => Array.from({ length: e }, () => Math.floor(Math.random() * 16).toString(16)).join(""), zt = ["data-colindex", "data-rowindex", "data-editable", "contenteditable", "tabindex"], Ft = ["innerHTML"], jt = { key: 2 }, Ut = /* @__PURE__ */ Q({
696
+ }, Gt = (e = 8) => Array.from({ length: e }, () => Math.floor(Math.random() * 16).toString(16)).join(""), zt = ["data-colindex", "data-rowindex", "data-editable", "contenteditable", "tabindex"], Ft = ["innerHTML"], jt = { key: 2 }, Ut = /* @__PURE__ */ J({
697
697
  __name: "ACell",
698
698
  props: {
699
699
  colIndex: {},
@@ -704,75 +704,75 @@ const Nt = (e) => {
704
704
  pinned: { type: Boolean, default: !1 }
705
705
  },
706
706
  setup(e, { expose: t }) {
707
- const n = G("cell"), o = e.store.getCellData(e.colIndex, e.rowIndex), u = R(""), d = R(!1), l = e.store.columns[e.colIndex], a = e.store.rows[e.rowIndex], i = l.align || "center", r = l.width || "40ch", s = I(() => e.store.getCellDisplayValue(e.colIndex, e.rowIndex)), v = I(() => typeof s.value == "string" ? Nt(s.value) : !1), m = I(() => {
708
- var c;
707
+ const n = N("cell"), o = e.store.getCellData(e.colIndex, e.rowIndex), u = P(""), c = P(!1), l = e.store.columns[e.colIndex], a = e.store.rows[e.rowIndex], i = l.align || "center", r = l.width || "40ch", s = k(() => e.store.getCellDisplayValue(e.colIndex, e.rowIndex)), g = k(() => typeof s.value == "string" ? Nt(s.value) : !1), m = k(() => {
708
+ var d;
709
709
  return {
710
710
  textAlign: i,
711
711
  width: r,
712
- fontWeight: d.value ? "bold" : "inherit",
713
- paddingLeft: e.store.getIndent(e.colIndex, (c = e.store.display[e.rowIndex]) == null ? void 0 : c.indent)
712
+ fontWeight: c.value ? "bold" : "inherit",
713
+ paddingLeft: e.store.getIndent(e.colIndex, (d = e.store.display[e.rowIndex]) == null ? void 0 : d.indent)
714
714
  };
715
- }), w = I(() => ({
715
+ }), w = k(() => ({
716
716
  "sticky-column": e.pinned,
717
- "cell-modified": d.value
718
- })), g = () => {
719
- const { left: c, bottom: h, width: A, height: M } = ge(n);
720
- l.mask, l.modalComponent && e.store.$patch(($) => {
721
- $.modal.visible = !0, $.modal.colIndex = e.colIndex, $.modal.rowIndex = e.rowIndex, $.modal.left = c, $.modal.bottom = h, $.modal.width = A, $.modal.height = M, $.modal.cell = n.value, typeof l.modalComponent == "function" ? $.modal.component = l.modalComponent({ table: $.table, row: a, column: l }) : $.modal.component = l.modalComponent, $.modal.componentProps = l.modalComponentExtraProps;
717
+ "cell-modified": c.value
718
+ })), v = () => {
719
+ const { left: d, bottom: p, width: M, height: $ } = ge(n);
720
+ l.mask, l.modalComponent && e.store.$patch((I) => {
721
+ I.modal.visible = !0, I.modal.colIndex = e.colIndex, I.modal.rowIndex = e.rowIndex, I.modal.left = d, I.modal.bottom = p, I.modal.width = M, I.modal.height = $, I.modal.cell = n.value, typeof l.modalComponent == "function" ? I.modal.component = l.modalComponent({ table: I.table, row: a, column: l }) : I.modal.component = l.modalComponent, I.modal.componentProps = l.modalComponentExtraProps;
722
722
  });
723
723
  };
724
724
  if (e.addNavigation) {
725
- let c = {
725
+ let d = {
726
726
  ...Re,
727
- "keydown.f2": g,
728
- "keydown.alt.up": g,
729
- "keydown.alt.down": g,
730
- "keydown.alt.left": g,
731
- "keydown.alt.right": g
727
+ "keydown.f2": v,
728
+ "keydown.alt.up": v,
729
+ "keydown.alt.down": v,
730
+ "keydown.alt.left": v,
731
+ "keydown.alt.right": v
732
732
  };
733
- typeof e.addNavigation == "object" && (c = {
734
- ...c,
733
+ typeof e.addNavigation == "object" && (d = {
734
+ ...d,
735
735
  ...e.addNavigation
736
736
  }), Pe([
737
737
  {
738
738
  selectors: n,
739
- handlers: c
739
+ handlers: d
740
740
  }
741
741
  ]);
742
742
  }
743
- const y = () => {
743
+ const x = () => {
744
744
  n.value && (u.value = n.value.textContent);
745
- }, f = (c) => {
746
- const h = c.target;
747
- h.textContent !== u.value && (u.value = h.textContent, l.format ? (d.value = h.textContent !== e.store.getFormattedValue(e.colIndex, e.rowIndex, o), e.store.setCellText(e.colIndex, e.rowIndex, h.textContent)) : (d.value = h.textContent !== o, e.store.setCellData(e.colIndex, e.rowIndex, h.textContent)));
745
+ }, f = (d) => {
746
+ const p = d.target;
747
+ p.textContent !== u.value && (u.value = p.textContent, l.format ? (c.value = p.textContent !== e.store.getFormattedValue(e.colIndex, e.rowIndex, o), e.store.setCellText(e.colIndex, e.rowIndex, p.textContent)) : (c.value = p.textContent !== o, e.store.setCellData(e.colIndex, e.rowIndex, p.textContent)));
748
748
  };
749
749
  return t({
750
750
  currentData: u
751
- }), (c, h) => (k(), T("td", {
751
+ }), (d, p) => (S(), R("td", {
752
752
  ref: "cell",
753
- "data-colindex": c.colIndex,
754
- "data-rowindex": c.rowIndex,
755
- "data-editable": x(l).edit,
756
- contenteditable: x(l).edit,
757
- tabindex: c.tabIndex,
753
+ "data-colindex": d.colIndex,
754
+ "data-rowindex": d.rowIndex,
755
+ "data-editable": b(l).edit,
756
+ contenteditable: b(l).edit,
757
+ tabindex: d.tabIndex,
758
758
  spellcheck: !1,
759
- style: q(m.value),
760
- onFocus: y,
759
+ style: Y(m.value),
760
+ onFocus: x,
761
761
  onPaste: f,
762
762
  onInput: f,
763
- onClick: g,
764
- class: U(["atable-cell", w.value])
763
+ onClick: v,
764
+ class: j(["atable-cell", w.value])
765
765
  }, [
766
- x(l).cellComponent ? (k(), se(ve(x(l).cellComponent), ke({
766
+ b(l).cellComponent ? (S(), se(ve(b(l).cellComponent), ke({
767
767
  key: 0,
768
768
  value: s.value
769
- }, x(l).cellComponentProps), null, 16, ["value"])) : v.value ? (k(), T("span", {
769
+ }, b(l).cellComponentProps), null, 16, ["value"])) : g.value ? (S(), R("span", {
770
770
  key: 1,
771
771
  innerHTML: s.value
772
- }, null, 8, Ft)) : (k(), T("span", jt, K(s.value), 1))
772
+ }, null, 8, Ft)) : (S(), R("span", jt, K(s.value), 1))
773
773
  ], 46, zt));
774
774
  }
775
- }), Yt = ["tabindex"], qt = ["tabindex"], Jt = ["colspan"], Qt = /* @__PURE__ */ Q({
775
+ }), Yt = ["tabindex"], qt = ["tabindex"], Jt = ["colspan"], Qt = /* @__PURE__ */ J({
776
776
  __name: "AExpansionRow",
777
777
  props: {
778
778
  rowIndex: {},
@@ -781,7 +781,7 @@ const Nt = (e) => {
781
781
  addNavigation: { type: [Boolean, Object] }
782
782
  },
783
783
  setup(e) {
784
- const t = G("rowEl"), n = I(() => e.store.display[e.rowIndex].expanded ? "▼" : "►");
784
+ const t = N("rowEl"), n = k(() => e.store.display[e.rowIndex].expanded ? "▼" : "►");
785
785
  if (e.addNavigation) {
786
786
  const o = {
787
787
  "keydown.control.g": (u) => {
@@ -795,26 +795,26 @@ const Nt = (e) => {
795
795
  }
796
796
  ]);
797
797
  }
798
- return (o, u) => (k(), T(ie, null, [
799
- O("tr", ke(o.$attrs, {
798
+ return (o, u) => (S(), R(ie, null, [
799
+ L("tr", ke(o.$attrs, {
800
800
  ref: "rowEl",
801
801
  tabindex: o.tabIndex,
802
802
  class: "expandable-row"
803
803
  }), [
804
- O("td", {
804
+ L("td", {
805
805
  tabIndex: -1,
806
- onClick: u[0] || (u[0] = (d) => o.store.toggleRowExpand(o.rowIndex)),
806
+ onClick: u[0] || (u[0] = (c) => o.store.toggleRowExpand(o.rowIndex)),
807
807
  class: "row-index"
808
808
  }, K(n.value), 1),
809
809
  W(o.$slots, "row", {}, void 0, !0)
810
810
  ], 16, Yt),
811
- o.store.display[o.rowIndex].expanded ? (k(), T("tr", {
811
+ o.store.display[o.rowIndex].expanded ? (S(), R("tr", {
812
812
  key: 0,
813
813
  ref: "rowExpanded",
814
814
  tabindex: o.tabIndex,
815
815
  class: "expanded-row"
816
816
  }, [
817
- O("td", {
817
+ L("td", {
818
818
  tabIndex: -1,
819
819
  colspan: o.store.columns.length + 1,
820
820
  class: "expanded-row-content"
@@ -835,7 +835,7 @@ const Nt = (e) => {
835
835
  }, en = {
836
836
  key: 0,
837
837
  class: "gantt-label"
838
- }, tn = /* @__PURE__ */ Q({
838
+ }, tn = /* @__PURE__ */ J({
839
839
  __name: "AGanttCell",
840
840
  props: {
841
841
  store: {},
@@ -849,65 +849,87 @@ const Nt = (e) => {
849
849
  color: {}
850
850
  },
851
851
  setup(e) {
852
- ct((c) => ({
853
- e3124eea: t.value,
854
- "58306efa": c.colspan
852
+ ct((d) => ({
853
+ "78862e08": t.value,
854
+ "18ad7d98": d.colspan
855
855
  }));
856
- const t = R();
856
+ const t = P();
857
857
  ne(() => {
858
858
  !e.color || e.color == "" || e.color.length < 6 ? t.value = "#cccccc" : t.value = e.color;
859
859
  });
860
- const n = G("container"), o = G("bar"), u = G("leftHandle"), d = G("rightHandle"), { width: l } = ge(n), { left: a, right: i } = ge(o), r = R(e.start || 0), s = R(e.end || r.value + e.colspan), v = R({ startX: 0, startPos: 0 }), m = I(() => e.colspan > 0 ? l.value / e.colspan : 0), w = I(() => {
861
- const c = r.value / e.colspan * 100, h = s.value / e.colspan * 100;
860
+ const n = N("container"), o = N("bar"), u = N("leftHandle"), c = N("rightHandle"), { width: l } = ge(n), { left: a, right: i } = ge(o), r = P(e.start || 0), s = P(e.end || r.value + e.colspan), g = P({ startX: 0, startPos: 0 }), m = k(() => e.colspan > 0 ? l.value / e.colspan : 0), w = k(() => {
861
+ const d = r.value / e.colspan * 100, p = s.value / e.colspan * 100;
862
862
  return {
863
- left: `${c}%`,
864
- width: `${h - c}%`,
863
+ left: `${d}%`,
864
+ width: `${p - d}%`,
865
865
  backgroundColor: t.value
866
866
  };
867
- }), { isDragging: g } = we(u, {
867
+ }), { isDragging: v } = we(u, {
868
868
  axis: "x",
869
869
  onStart: () => {
870
- o.value && (o.value.style.transition = "none"), v.value = {
870
+ o.value && (o.value.style.transition = "none"), g.value = {
871
871
  startX: a.value,
872
872
  startPos: r.value
873
873
  };
874
874
  },
875
- onMove: ({ x: c }) => {
876
- if (g.value && o.value) {
877
- const A = (c - v.value.startX) / m.value, M = Math.max(0, Math.min(s.value - 1, v.value.startPos + A));
878
- o.value.style.left = `${M / e.colspan * 100}%`, o.value.style.width = `${(s.value - M) / e.colspan * 100}%`;
875
+ onMove: ({ x: d }) => {
876
+ if (v.value && o.value) {
877
+ const M = (d - g.value.startX) / m.value, $ = Math.max(0, Math.min(s.value - 1, g.value.startPos + M));
878
+ o.value.style.left = `${$ / e.colspan * 100}%`, o.value.style.width = `${(s.value - $) / e.colspan * 100}%`;
879
879
  }
880
880
  },
881
- onEnd: ({ x: c }) => {
881
+ onEnd: ({ x: d }) => {
882
882
  if (o.value) {
883
- const h = c - v.value.startX, A = Math.round(h / m.value), M = Math.max(0, Math.min(s.value - 1, v.value.startPos + A));
884
- r.value = M, e.store.updateGanttBar({ rowIndex: e.rowIndex, colIndex: e.colIndex, type: "resize", edge: "start", value: M });
883
+ const p = d - g.value.startX, M = Math.round(p / m.value), $ = r.value, I = Math.max(0, Math.min(s.value - 1, g.value.startPos + M));
884
+ r.value = I, e.store.updateGanttBar({
885
+ rowIndex: e.rowIndex,
886
+ colIndex: e.colIndex,
887
+ type: "resize",
888
+ edge: "start",
889
+ oldStart: $,
890
+ newStart: I,
891
+ end: s.value,
892
+ delta: M,
893
+ oldColspan: s.value - $,
894
+ newColspan: s.value - I
895
+ });
885
896
  }
886
897
  }
887
- }), { isDragging: y } = we(d, {
898
+ }), { isDragging: x } = we(c, {
888
899
  axis: "x",
889
900
  onStart: () => {
890
- o.value && (o.value.style.transition = "none"), v.value = {
901
+ o.value && (o.value.style.transition = "none"), g.value = {
891
902
  startX: i.value,
892
903
  startPos: s.value
893
904
  };
894
905
  },
895
- onMove: ({ x: c }) => {
896
- if (y.value && o.value) {
897
- const A = (c - v.value.startX) / m.value, M = Math.max(
906
+ onMove: ({ x: d }) => {
907
+ if (x.value && o.value) {
908
+ const M = (d - g.value.startX) / m.value, $ = Math.max(
898
909
  r.value + 1,
899
- Math.min(e.columnsCount, v.value.startPos + A)
910
+ Math.min(e.columnsCount, g.value.startPos + M)
900
911
  );
901
- o.value.style.width = `${(M - r.value) / e.colspan * 100}%`;
912
+ o.value.style.width = `${($ - r.value) / e.colspan * 100}%`;
902
913
  }
903
914
  },
904
- onEnd: ({ x: c }) => {
915
+ onEnd: ({ x: d }) => {
905
916
  if (o.value) {
906
- const h = c - v.value.startX, A = Math.round(h / m.value), M = Math.max(
917
+ const p = d - g.value.startX, M = Math.round(p / m.value), $ = s.value, I = Math.max(
907
918
  r.value + 1,
908
- Math.min(e.columnsCount, v.value.startPos + A)
919
+ Math.min(e.columnsCount, g.value.startPos + M)
909
920
  );
910
- s.value = M, e.store.updateGanttBar({ rowIndex: e.rowIndex, colIndex: e.colIndex, type: "resize", edge: "end", value: M });
921
+ s.value = I, e.store.updateGanttBar({
922
+ rowIndex: e.rowIndex,
923
+ colIndex: e.colIndex,
924
+ type: "resize",
925
+ edge: "end",
926
+ oldEnd: $,
927
+ newEnd: I,
928
+ start: r.value,
929
+ delta: M,
930
+ oldColspan: $ - r.value,
931
+ newColspan: I - r.value
932
+ });
911
933
  }
912
934
  }
913
935
  }), { isDragging: f } = we(o, {
@@ -915,55 +937,65 @@ const Nt = (e) => {
915
937
  // to avoid triggering when the left and right handles are being used
916
938
  axis: "x",
917
939
  onStart: () => {
918
- o.value && (o.value.style.transition = "none"), v.value = {
940
+ o.value && (o.value.style.transition = "none"), g.value = {
919
941
  startX: a.value,
920
942
  startPos: r.value
921
943
  };
922
944
  },
923
- onMove: ({ x: c }) => {
945
+ onMove: ({ x: d }) => {
924
946
  if (f.value && o.value) {
925
- const A = (c - v.value.startX) / m.value, M = s.value - r.value, $ = Math.max(0, Math.min(v.value.startPos + A, e.columnsCount - M));
926
- o.value.style.left = `${$ / e.colspan * 100}%`;
947
+ const M = (d - g.value.startX) / m.value, $ = s.value - r.value, I = Math.max(0, Math.min(g.value.startPos + M, e.columnsCount - $));
948
+ o.value.style.left = `${I / e.colspan * 100}%`;
927
949
  }
928
950
  },
929
- onEnd: ({ x: c }) => {
951
+ onEnd: ({ x: d }) => {
930
952
  if (o.value) {
931
- const h = c - v.value.startX, A = Math.round(h / m.value), M = s.value - r.value;
932
- let $ = v.value.startPos + A, B = $ + M;
933
- $ < 0 ? ($ = 0, B = M) : B > e.columnsCount && (B = e.columnsCount, $ = B - M), r.value = $, s.value = B, e.store.updateGanttBar({ rowIndex: e.rowIndex, colIndex: e.colIndex, type: "bar", start: $, end: B });
953
+ const p = d - g.value.startX, M = Math.round(p / m.value), $ = s.value - r.value, I = r.value, Q = s.value;
954
+ let C = g.value.startPos + M, A = C + $;
955
+ C < 0 ? (C = 0, A = $) : A > e.columnsCount && (A = e.columnsCount, C = A - $), r.value = C, s.value = A, e.store.updateGanttBar({
956
+ rowIndex: e.rowIndex,
957
+ colIndex: e.colIndex,
958
+ type: "bar",
959
+ oldStart: I,
960
+ oldEnd: Q,
961
+ newStart: C,
962
+ newEnd: A,
963
+ delta: M,
964
+ colspan: A - C
965
+ });
934
966
  }
935
967
  }
936
968
  });
937
- return (c, h) => (k(), T("td", {
969
+ return (d, p) => (S(), R("td", {
938
970
  class: "aganttcell",
939
- colspan: c.colspan
971
+ colspan: d.colspan
940
972
  }, [
941
- O("div", _t, [
942
- O("div", {
973
+ L("div", _t, [
974
+ L("div", {
943
975
  ref: "bar",
944
- class: U(["gantt-bar", { "is-dragging": x(f) || x(g) || x(y) }]),
945
- style: q(w.value)
976
+ class: j(["gantt-bar", { "is-dragging": b(f) || b(v) || b(x) }]),
977
+ style: Y(w.value)
946
978
  }, [
947
- O("div", {
979
+ L("div", {
948
980
  ref: "leftHandle",
949
- class: U(["gantt-handle left-handle", { "is-dragging": x(g) }])
950
- }, h[0] || (h[0] = [
951
- O("div", { class: "handle-grip" }, null, -1),
952
- O("div", { class: "vertical-indicator left-indicator" }, null, -1)
981
+ class: j(["gantt-handle left-handle", { "is-dragging": b(v) }])
982
+ }, p[0] || (p[0] = [
983
+ L("div", { class: "handle-grip" }, null, -1),
984
+ L("div", { class: "vertical-indicator left-indicator" }, null, -1)
953
985
  ]), 2),
954
- c.label ? (k(), T("label", en, K(c.label), 1)) : _("", !0),
955
- O("div", {
986
+ d.label ? (S(), R("label", en, K(d.label), 1)) : _("", !0),
987
+ L("div", {
956
988
  ref: "rightHandle",
957
- class: U(["gantt-handle right-handle", { "is-dragging": x(y) }])
958
- }, h[1] || (h[1] = [
959
- O("div", { class: "handle-grip" }, null, -1),
960
- O("div", { class: "vertical-indicator right-indicator" }, null, -1)
989
+ class: j(["gantt-handle right-handle", { "is-dragging": b(x) }])
990
+ }, p[1] || (p[1] = [
991
+ L("div", { class: "handle-grip" }, null, -1),
992
+ L("div", { class: "vertical-indicator right-indicator" }, null, -1)
961
993
  ]), 2)
962
994
  ], 6)
963
995
  ], 512)
964
996
  ], 8, Kt));
965
997
  }
966
- }), nn = /* @__PURE__ */ le(tn, [["__scopeId", "data-v-133983c1"]]), on = ["tabindex"], ln = /* @__PURE__ */ Q({
998
+ }), nn = /* @__PURE__ */ le(tn, [["__scopeId", "data-v-a929e8e3"]]), on = ["tabindex"], ln = /* @__PURE__ */ J({
967
999
  __name: "ARow",
968
1000
  props: {
969
1001
  rowIndex: {},
@@ -972,7 +1004,7 @@ const Nt = (e) => {
972
1004
  addNavigation: { type: [Boolean, Object], default: !1 }
973
1005
  },
974
1006
  setup(e) {
975
- const t = G("rowEl"), n = I(() => e.store.isRowVisible(e.rowIndex)), o = I(() => e.store.getRowExpandSymbol(e.rowIndex));
1007
+ const t = N("rowEl"), n = k(() => e.store.isRowVisible(e.rowIndex)), o = k(() => e.store.getRowExpandSymbol(e.rowIndex));
976
1008
  if (e.addNavigation) {
977
1009
  let u = Re;
978
1010
  typeof e.addNavigation == "object" && (u = {
@@ -985,21 +1017,21 @@ const Nt = (e) => {
985
1017
  }
986
1018
  ]);
987
1019
  }
988
- return (u, d) => xe((k(), T("tr", {
1020
+ return (u, c) => xe((S(), R("tr", {
989
1021
  ref: "rowEl",
990
1022
  tabindex: u.tabIndex,
991
1023
  class: "atable-row"
992
1024
  }, [
993
1025
  u.store.config.view !== "uncounted" ? W(u.$slots, "index", { key: 0 }, () => [
994
- u.store.config.view === "list" ? (k(), T("td", {
1026
+ u.store.config.view === "list" ? (S(), R("td", {
995
1027
  key: 0,
996
1028
  tabIndex: -1,
997
- class: U(["list-index", u.store.hasPinnedColumns ? "sticky-index" : ""])
998
- }, K(u.rowIndex + 1), 3)) : u.store.config.view === "tree" ? (k(), T("td", {
1029
+ class: j(["list-index", u.store.hasPinnedColumns ? "sticky-index" : ""])
1030
+ }, K(u.rowIndex + 1), 3)) : u.store.config.view === "tree" ? (S(), R("td", {
999
1031
  key: 1,
1000
1032
  tabIndex: -1,
1001
- class: U(["tree-index", u.store.hasPinnedColumns ? "sticky-index" : ""]),
1002
- onClick: d[0] || (d[0] = (l) => u.store.toggleRowExpand(u.rowIndex))
1033
+ class: j(["tree-index", u.store.hasPinnedColumns ? "sticky-index" : ""]),
1034
+ onClick: c[0] || (c[0] = (l) => u.store.toggleRowExpand(u.rowIndex))
1003
1035
  }, K(o.value), 3)) : _("", !0)
1004
1036
  ], !0) : _("", !0),
1005
1037
  W(u.$slots, "default", {}, void 0, !0)
@@ -1010,74 +1042,74 @@ const Nt = (e) => {
1010
1042
  }), _e = /* @__PURE__ */ le(ln, [["__scopeId", "data-v-4cb4f254"]]), et = he ? window : void 0;
1011
1043
  function re(e) {
1012
1044
  var t;
1013
- const n = C(e);
1045
+ const n = E(e);
1014
1046
  return (t = n == null ? void 0 : n.$el) != null ? t : n;
1015
1047
  }
1016
1048
  function Z(...e) {
1017
1049
  const t = [], n = () => {
1018
1050
  t.forEach((a) => a()), t.length = 0;
1019
- }, o = (a, i, r, s) => (a.addEventListener(i, r, s), () => a.removeEventListener(i, r, s)), u = I(() => {
1020
- const a = J(C(e[0])).filter((i) => i != null);
1051
+ }, o = (a, i, r, s) => (a.addEventListener(i, r, s), () => a.removeEventListener(i, r, s)), u = k(() => {
1052
+ const a = q(E(e[0])).filter((i) => i != null);
1021
1053
  return a.every((i) => typeof i != "string") ? a : void 0;
1022
- }), d = Qe(
1054
+ }), c = Qe(
1023
1055
  () => {
1024
1056
  var a, i;
1025
1057
  return [
1026
1058
  (i = (a = u.value) == null ? void 0 : a.map((r) => re(r))) != null ? i : [et].filter((r) => r != null),
1027
- J(C(u.value ? e[1] : e[0])),
1028
- J(x(u.value ? e[2] : e[1])),
1059
+ q(E(u.value ? e[1] : e[0])),
1060
+ q(b(u.value ? e[2] : e[1])),
1029
1061
  // @ts-expect-error - TypeScript gets the correct types, but somehow still complains
1030
- C(u.value ? e[3] : e[2])
1062
+ E(u.value ? e[3] : e[2])
1031
1063
  ];
1032
1064
  },
1033
1065
  ([a, i, r, s]) => {
1034
1066
  if (n(), !(a != null && a.length) || !(i != null && i.length) || !(r != null && r.length))
1035
1067
  return;
1036
- const v = Je(s) ? { ...s } : s;
1068
+ const g = Je(s) ? { ...s } : s;
1037
1069
  t.push(
1038
1070
  ...a.flatMap(
1039
1071
  (m) => i.flatMap(
1040
- (w) => r.map((g) => o(m, w, g, v))
1072
+ (w) => r.map((v) => o(m, w, v, g))
1041
1073
  )
1042
1074
  )
1043
1075
  );
1044
1076
  },
1045
1077
  { flush: "post" }
1046
1078
  ), l = () => {
1047
- d(), n();
1079
+ c(), n();
1048
1080
  };
1049
1081
  return de(n), l;
1050
1082
  }
1051
1083
  let Ge = !1;
1052
1084
  function ze(e, t, n = {}) {
1053
- const { window: o = et, ignore: u = [], capture: d = !0, detectIframe: l = !1, controls: a = !1 } = n;
1085
+ const { window: o = et, ignore: u = [], capture: c = !0, detectIframe: l = !1, controls: a = !1 } = n;
1054
1086
  if (!o)
1055
- return a ? { stop: Y, cancel: Y, trigger: Y } : Y;
1087
+ return a ? { stop: U, cancel: U, trigger: U } : U;
1056
1088
  if (Ee && !Ge) {
1057
1089
  Ge = !0;
1058
1090
  const f = { passive: !0 };
1059
- Array.from(o.document.body.children).forEach((c) => Z(c, "click", Y, f)), Z(o.document.documentElement, "click", Y, f);
1091
+ Array.from(o.document.body.children).forEach((d) => Z(d, "click", U, f)), Z(o.document.documentElement, "click", U, f);
1060
1092
  }
1061
1093
  let i = !0;
1062
- const r = (f) => C(u).some((c) => {
1063
- if (typeof c == "string")
1064
- return Array.from(o.document.querySelectorAll(c)).some((h) => h === f.target || f.composedPath().includes(h));
1094
+ const r = (f) => E(u).some((d) => {
1095
+ if (typeof d == "string")
1096
+ return Array.from(o.document.querySelectorAll(d)).some((p) => p === f.target || f.composedPath().includes(p));
1065
1097
  {
1066
- const h = re(c);
1067
- return h && (f.target === h || f.composedPath().includes(h));
1098
+ const p = re(d);
1099
+ return p && (f.target === p || f.composedPath().includes(p));
1068
1100
  }
1069
1101
  });
1070
1102
  function s(f) {
1071
- const c = C(f);
1072
- return c && c.$.subTree.shapeFlag === 16;
1103
+ const d = E(f);
1104
+ return d && d.$.subTree.shapeFlag === 16;
1073
1105
  }
1074
- function v(f, c) {
1075
- const h = C(f), A = h.$.subTree && h.$.subTree.children;
1076
- return A == null || !Array.isArray(A) ? !1 : A.some((M) => M.el === c.target || c.composedPath().includes(M.el));
1106
+ function g(f, d) {
1107
+ const p = E(f), M = p.$.subTree && p.$.subTree.children;
1108
+ return M == null || !Array.isArray(M) ? !1 : M.some(($) => $.el === d.target || d.composedPath().includes($.el));
1077
1109
  }
1078
1110
  const m = (f) => {
1079
- const c = re(e);
1080
- if (f.target != null && !(!(c instanceof Element) && s(e) && v(e, f)) && !(!c || c === f.target || f.composedPath().includes(c))) {
1111
+ const d = re(e);
1112
+ if (f.target != null && !(!(d instanceof Element) && s(e) && g(e, f)) && !(!d || d === f.target || f.composedPath().includes(d))) {
1081
1113
  if ("detail" in f && f.detail === 0 && (i = !r(f)), !i) {
1082
1114
  i = !0;
1083
1115
  return;
@@ -1086,33 +1118,33 @@ function ze(e, t, n = {}) {
1086
1118
  }
1087
1119
  };
1088
1120
  let w = !1;
1089
- const g = [
1121
+ const v = [
1090
1122
  Z(o, "click", (f) => {
1091
1123
  w || (w = !0, setTimeout(() => {
1092
1124
  w = !1;
1093
1125
  }, 0), m(f));
1094
- }, { passive: !0, capture: d }),
1126
+ }, { passive: !0, capture: c }),
1095
1127
  Z(o, "pointerdown", (f) => {
1096
- const c = re(e);
1097
- i = !r(f) && !!(c && !f.composedPath().includes(c));
1128
+ const d = re(e);
1129
+ i = !r(f) && !!(d && !f.composedPath().includes(d));
1098
1130
  }, { passive: !0 }),
1099
1131
  l && Z(o, "blur", (f) => {
1100
1132
  setTimeout(() => {
1101
- var c;
1102
- const h = re(e);
1103
- ((c = o.document.activeElement) == null ? void 0 : c.tagName) === "IFRAME" && !(h != null && h.contains(o.document.activeElement)) && t(f);
1133
+ var d;
1134
+ const p = re(e);
1135
+ ((d = o.document.activeElement) == null ? void 0 : d.tagName) === "IFRAME" && !(p != null && p.contains(o.document.activeElement)) && t(f);
1104
1136
  }, 0);
1105
1137
  }, { passive: !0 })
1106
- ].filter(Boolean), y = () => g.forEach((f) => f());
1138
+ ].filter(Boolean), x = () => v.forEach((f) => f());
1107
1139
  return a ? {
1108
- stop: y,
1140
+ stop: x,
1109
1141
  cancel: () => {
1110
1142
  i = !1;
1111
1143
  },
1112
1144
  trigger: (f) => {
1113
1145
  i = !0, m(f), i = !1;
1114
1146
  }
1115
- } : y;
1147
+ } : x;
1116
1148
  }
1117
1149
  const an = {
1118
1150
  mounted(e, t) {
@@ -1146,10 +1178,10 @@ function sn(e) {
1146
1178
  }
1147
1179
  const be = /* @__PURE__ */ new WeakMap();
1148
1180
  function rn(e, t = !1) {
1149
- const n = R(t);
1181
+ const n = P(t);
1150
1182
  let o = null, u = "";
1151
- V(Ht(e), (a) => {
1152
- const i = ye(C(a));
1183
+ X(Ht(e), (a) => {
1184
+ const i = ye(E(a));
1153
1185
  if (i) {
1154
1186
  const r = i;
1155
1187
  if (be.get(r) || be.set(r, r.style.overflow), r.style.overflow !== "hidden" && (u = r.style.overflow), r.style.overflow === "hidden")
@@ -1160,8 +1192,8 @@ function rn(e, t = !1) {
1160
1192
  }, {
1161
1193
  immediate: !0
1162
1194
  });
1163
- const d = () => {
1164
- const a = ye(C(e));
1195
+ const c = () => {
1196
+ const a = ye(E(e));
1165
1197
  !a || n.value || (Ee && (o = Z(
1166
1198
  a,
1167
1199
  "touchmove",
@@ -1171,15 +1203,15 @@ function rn(e, t = !1) {
1171
1203
  { passive: !1 }
1172
1204
  )), a.style.overflow = "hidden", n.value = !0);
1173
1205
  }, l = () => {
1174
- const a = ye(C(e));
1206
+ const a = ye(E(e));
1175
1207
  !a || !n.value || (Ee && (o == null || o()), a.style.overflow = u, be.delete(a), n.value = !1);
1176
1208
  };
1177
- return de(l), I({
1209
+ return de(l), k({
1178
1210
  get() {
1179
1211
  return n.value;
1180
1212
  },
1181
1213
  set(a) {
1182
- a ? d() : l();
1214
+ a ? c() : l();
1183
1215
  }
1184
1216
  });
1185
1217
  }
@@ -1191,7 +1223,7 @@ function un() {
1191
1223
  return;
1192
1224
  e = !0;
1193
1225
  const u = rn(n, o.value);
1194
- V(t, (d) => u.value = d);
1226
+ X(t, (c) => u.value = c);
1195
1227
  };
1196
1228
  }
1197
1229
  un();
@@ -1201,29 +1233,29 @@ const cn = {
1201
1233
  }, dn = {
1202
1234
  class: "atable-header-row",
1203
1235
  tabindex: "-1"
1204
- }, nt = /* @__PURE__ */ Q({
1236
+ }, nt = /* @__PURE__ */ J({
1205
1237
  __name: "ATableHeader",
1206
1238
  props: {
1207
1239
  columns: {},
1208
1240
  store: {}
1209
1241
  },
1210
1242
  setup(e) {
1211
- return (t, n) => t.columns.length ? (k(), T("thead", cn, [
1212
- O("tr", dn, [
1213
- t.store.zeroColumn ? (k(), T("th", {
1243
+ return (t, n) => t.columns.length ? (S(), R("thead", cn, [
1244
+ L("tr", dn, [
1245
+ t.store.zeroColumn ? (S(), R("th", {
1214
1246
  key: 0,
1215
1247
  id: "header-index",
1216
- class: U([[
1248
+ class: j([[
1217
1249
  t.store.hasPinnedColumns ? "sticky-index" : "",
1218
1250
  t.store.config.view === "tree" ? "tree-index" : "",
1219
1251
  t.store.config.view === "list-expansion" ? "list-expansion-index" : ""
1220
1252
  ], "list-index"])
1221
1253
  }, null, 2)) : _("", !0),
1222
- (k(!0), T(ie, null, Ce(t.columns, (o, u) => (k(), T("th", {
1254
+ (S(!0), R(ie, null, Ce(t.columns, (o, u) => (S(), R("th", {
1223
1255
  key: o.name,
1224
1256
  tabindex: "-1",
1225
- style: q(t.store.getHeaderCellStyle(o)),
1226
- class: U(o.pinned ? "sticky-column" : "")
1257
+ style: Y(t.store.getHeaderCellStyle(o)),
1258
+ class: j(o.pinned ? "sticky-column" : "")
1227
1259
  }, [
1228
1260
  W(t.$slots, "default", {}, () => [
1229
1261
  dt(K(o.label || String.fromCharCode(u + 97).toUpperCase()), 1)
@@ -1232,26 +1264,26 @@ const cn = {
1232
1264
  ])
1233
1265
  ])) : _("", !0);
1234
1266
  }
1235
- }), ot = /* @__PURE__ */ Q({
1267
+ }), ot = /* @__PURE__ */ J({
1236
1268
  __name: "ATableModal",
1237
1269
  props: {
1238
1270
  store: {}
1239
1271
  },
1240
1272
  setup(e) {
1241
- const t = G("amodal"), { width: n, height: o } = ge(t), u = I(() => {
1242
- var v, m, w, g;
1273
+ const t = N("amodal"), { width: n, height: o } = ge(t), u = k(() => {
1274
+ var g, m, w, v;
1243
1275
  if (!(e.store.modal.height && e.store.modal.width && e.store.modal.left && e.store.modal.bottom)) return;
1244
- const d = (v = e.store.modal.cell) == null ? void 0 : v.closest("table"), l = d.offsetHeight || 0, a = d.offsetWidth || 0;
1276
+ const c = (g = e.store.modal.cell) == null ? void 0 : g.closest("table"), l = c.offsetHeight || 0, a = c.offsetWidth || 0;
1245
1277
  let i = ((m = e.store.modal.cell) == null ? void 0 : m.offsetTop) || 0;
1246
- const r = ((w = d.querySelector("thead")) == null ? void 0 : w.offsetHeight) || 0;
1278
+ const r = ((w = c.querySelector("thead")) == null ? void 0 : w.offsetHeight) || 0;
1247
1279
  i += r, i = i + o.value < l ? i : i - (o.value + e.store.modal.height);
1248
- let s = ((g = e.store.modal.cell) == null ? void 0 : g.offsetLeft) || 0;
1280
+ let s = ((v = e.store.modal.cell) == null ? void 0 : v.offsetLeft) || 0;
1249
1281
  return s = s + n.value <= a ? s : s - (n.value - e.store.modal.width), {
1250
1282
  left: `${s}px`,
1251
1283
  top: `${i}px`
1252
1284
  };
1253
1285
  });
1254
- return (d, l) => (k(), T("div", {
1286
+ return (c, l) => (S(), R("div", {
1255
1287
  class: "amodal",
1256
1288
  ref: "amodal",
1257
1289
  tabindex: "-1",
@@ -1259,104 +1291,104 @@ const cn = {
1259
1291
  }, ["stop"])),
1260
1292
  onInput: l[1] || (l[1] = Oe(() => {
1261
1293
  }, ["stop"])),
1262
- style: q(u.value)
1294
+ style: Y(u.value)
1263
1295
  }, [
1264
- W(d.$slots, "default")
1296
+ W(c.$slots, "default")
1265
1297
  ], 36));
1266
1298
  }
1267
1299
  }), fn = (e) => {
1268
1300
  const t = e.id || Gt();
1269
1301
  return ft(`table-${t}`, () => {
1270
1302
  const o = () => {
1271
- const p = {};
1272
- for (const [b, S] of d.value.entries())
1273
- for (const [P, L] of l.value.entries())
1274
- p[`${b}:${P}`] = L[S.name];
1275
- return p;
1276
- }, u = (p) => {
1277
- const b = [Object.assign({}, { rowModified: !1 })];
1278
- if (p && "0:0" in p)
1279
- return p;
1280
- const S = /* @__PURE__ */ new Set();
1281
- for (let P = l.value.length - 1; P >= 0; P--) {
1282
- const L = l.value[P];
1283
- L.parent && S.add(L.parent), b[P] = {
1303
+ const h = {};
1304
+ for (const [y, T] of c.value.entries())
1305
+ for (const [O, D] of l.value.entries())
1306
+ h[`${y}:${O}`] = D[T.name];
1307
+ return h;
1308
+ }, u = (h) => {
1309
+ const y = [Object.assign({}, { rowModified: !1 })];
1310
+ if (h && "0:0" in h)
1311
+ return h;
1312
+ const T = /* @__PURE__ */ new Set();
1313
+ for (let O = l.value.length - 1; O >= 0; O--) {
1314
+ const D = l.value[O];
1315
+ D.parent && T.add(D.parent), y[O] = {
1284
1316
  childrenOpen: !1,
1285
1317
  expanded: !1,
1286
- indent: L.indent || 0,
1287
- isParent: S.has(P),
1288
- isRoot: L.parent === null || L.parent === void 0,
1318
+ indent: D.indent || 0,
1319
+ isParent: T.has(O),
1320
+ isRoot: D.parent === null || D.parent === void 0,
1289
1321
  rowModified: !1,
1290
- open: L.parent === null || L.parent === void 0,
1291
- parent: L.parent
1322
+ open: D.parent === null || D.parent === void 0,
1323
+ parent: D.parent
1292
1324
  };
1293
1325
  }
1294
- return b;
1295
- }, d = R(e.columns), l = R(e.rows), a = R(e.config || {}), i = R(e.table || o()), r = R(u(e.display)), s = R(e.modal || { visible: !1 }), v = R({}), m = I(() => d.value.some((p) => p.pinned)), w = I(() => `${Math.ceil(l.value.length / 100 + 1)}ch`), g = I(
1326
+ return y;
1327
+ }, c = P(e.columns), l = P(e.rows), a = P(e.config || {}), i = P(e.table || o()), r = P(u(e.display)), s = P(e.modal || { visible: !1 }), g = P({}), m = k(() => c.value.some((h) => h.pinned)), w = k(() => `${Math.ceil(l.value.length / 100 + 1)}ch`), v = k(
1296
1328
  () => a.value.view ? ["list", "tree", "list-expansion"].includes(a.value.view) : !1
1297
- ), y = (p, b) => i.value[`${p}:${b}`], f = (p, b, S) => {
1298
- const P = `${p}:${b}`, L = d.value[p];
1299
- i.value[P] !== S && (r.value[b].rowModified = !0), i.value[P] = S, l.value[b][L.name] = S;
1300
- }, c = (p, b, S) => {
1301
- const P = `${p}:${b}`;
1302
- i.value[P] !== S && (r.value[b].rowModified = !0, v.value[P] = S);
1303
- }, h = (p) => ({
1304
- minWidth: p.width || "40ch",
1305
- textAlign: p.align || "center",
1329
+ ), x = (h, y) => i.value[`${h}:${y}`], f = (h, y, T) => {
1330
+ const O = `${h}:${y}`, D = c.value[h];
1331
+ i.value[O] !== T && (r.value[y].rowModified = !0), i.value[O] = T, l.value[y][D.name] = T;
1332
+ }, d = (h, y, T) => {
1333
+ const O = `${h}:${y}`;
1334
+ i.value[O] !== T && (r.value[y].rowModified = !0, g.value[O] = T);
1335
+ }, p = (h) => ({
1336
+ minWidth: h.width || "40ch",
1337
+ textAlign: h.align || "center",
1306
1338
  width: a.value.fullWidth ? "auto" : void 0
1307
- }), A = (p) => {
1308
- const b = l.value[p];
1309
- return a.value.view === "gantt" && b.indent === 0;
1310
- }, M = (p) => a.value.view !== "tree" || r.value[p].isRoot || r.value[p].open, $ = (p) => a.value.view !== "tree" ? "" : r.value[p].isRoot || r.value[p].isParent ? r.value[p].childrenOpen ? "-" : "+" : "", B = (p) => {
1339
+ }), M = (h) => {
1340
+ const y = l.value[h];
1341
+ return a.value.view === "gantt" && y.indent === 0;
1342
+ }, $ = (h) => a.value.view !== "tree" || r.value[h].isRoot || r.value[h].open, I = (h) => a.value.view !== "tree" ? "" : r.value[h].isRoot || r.value[h].isParent ? r.value[h].childrenOpen ? "-" : "+" : "", Q = (h) => {
1311
1343
  if (a.value.view === "tree") {
1312
- r.value[p].childrenOpen = !r.value[p].childrenOpen;
1313
- for (let b = l.value.length - 1; b >= 0; b--)
1314
- r.value[b].parent === p && (r.value[b].open = !r.value[b].open, r.value[b].childrenOpen && B(b));
1315
- } else a.value.view === "list-expansion" && (r.value[p].expanded = !r.value[p].expanded);
1316
- }, E = (p, b) => {
1317
- const S = y(p, b);
1318
- return D(p, b, S);
1319
- }, D = (p, b, S) => {
1320
- const P = d.value[p], L = l.value[b], ae = P.format;
1321
- return ae ? typeof ae == "function" ? ae(S, { table: i.value, row: L, column: P }) : typeof ae == "string" ? Function(`"use strict";return (${ae})`)()(S, { table: i.value, row: L, column: P }) : S : S;
1344
+ r.value[h].childrenOpen = !r.value[h].childrenOpen;
1345
+ for (let y = l.value.length - 1; y >= 0; y--)
1346
+ r.value[y].parent === h && (r.value[y].open = !r.value[y].open, r.value[y].childrenOpen && Q(y));
1347
+ } else a.value.view === "list-expansion" && (r.value[h].expanded = !r.value[h].expanded);
1348
+ }, C = (h, y) => {
1349
+ const T = x(h, y);
1350
+ return A(h, y, T);
1351
+ }, A = (h, y, T) => {
1352
+ const O = c.value[h], D = l.value[y], ae = O.format;
1353
+ return ae ? typeof ae == "function" ? ae(T, { table: i.value, row: D, column: O }) : typeof ae == "string" ? Function(`"use strict";return (${ae})`)()(T, { table: i.value, row: D, column: O }) : T : T;
1322
1354
  };
1323
1355
  return {
1324
1356
  // state
1325
- columns: d,
1357
+ columns: c,
1326
1358
  config: a,
1327
1359
  display: r,
1328
1360
  modal: s,
1329
1361
  rows: l,
1330
1362
  table: i,
1331
- updates: v,
1363
+ updates: g,
1332
1364
  // getters
1333
1365
  hasPinnedColumns: m,
1334
1366
  numberedRowWidth: w,
1335
- zeroColumn: g,
1367
+ zeroColumn: v,
1336
1368
  // actions
1337
- closeModal: (p) => {
1338
- var b;
1339
- p.target instanceof Node && (b = s.value.parent) != null && b.contains(p.target) || s.value.visible && (s.value.visible = !1);
1369
+ closeModal: (h) => {
1370
+ var y;
1371
+ h.target instanceof Node && (y = s.value.parent) != null && y.contains(h.target) || s.value.visible && (s.value.visible = !1);
1340
1372
  },
1341
- getCellData: y,
1342
- getCellDisplayValue: E,
1343
- getFormattedValue: D,
1344
- getHeaderCellStyle: h,
1345
- getIndent: (p, b) => b && p === 0 && b > 0 ? `${b}ch` : "inherit",
1346
- getRowExpandSymbol: $,
1347
- isRowGantt: A,
1348
- isRowVisible: M,
1373
+ getCellData: x,
1374
+ getCellDisplayValue: C,
1375
+ getFormattedValue: A,
1376
+ getHeaderCellStyle: p,
1377
+ getIndent: (h, y) => y && h === 0 && y > 0 ? `${y}ch` : "inherit",
1378
+ getRowExpandSymbol: I,
1379
+ isRowGantt: M,
1380
+ isRowVisible: $,
1349
1381
  setCellData: f,
1350
- setCellText: c,
1351
- toggleRowExpand: B,
1352
- updateGanttBar: (p) => {
1353
- var S;
1354
- const b = (S = l.value[p.rowIndex]) == null ? void 0 : S.gantt;
1355
- b && (p.type === "resize" ? p.edge === "start" ? b.startIndex = p.value : p.edge === "end" && (b.endIndex = p.value) : p.type === "bar" && (b.startIndex = p.start, b.endIndex = p.end));
1382
+ setCellText: d,
1383
+ toggleRowExpand: Q,
1384
+ updateGanttBar: (h) => {
1385
+ var T;
1386
+ const y = (T = l.value[h.rowIndex]) == null ? void 0 : T.gantt;
1387
+ y && (h.type === "resize" ? h.edge === "start" ? (y.startIndex = h.newStart, y.endIndex = h.end, y.colspan = y.endIndex - y.startIndex) : h.edge === "end" && (y.startIndex = h.start, y.endIndex = h.newEnd, y.colspan = y.endIndex - y.startIndex) : h.type === "bar" && (y.startIndex = h.newStart, y.endIndex = h.newEnd, y.colspan = y.endIndex - y.startIndex));
1356
1388
  }
1357
1389
  };
1358
1390
  })();
1359
- }, vn = /* @__PURE__ */ Q({
1391
+ }, vn = /* @__PURE__ */ J({
1360
1392
  __name: "ATable",
1361
1393
  props: {
1362
1394
  id: {},
@@ -1367,24 +1399,21 @@ const cn = {
1367
1399
  },
1368
1400
  emits: ["update:modelValue", "cellUpdate", "gantt:drag"],
1369
1401
  setup(e, { expose: t, emit: n }) {
1370
- const o = n, u = G("table"), d = e.modelValue ? e.modelValue : e.rows, l = fn({ columns: e.columns, rows: d, id: e.id, config: e.config });
1371
- l.$onAction(({ name: s, store: v, args: m, after: w }) => {
1372
- var g;
1402
+ const o = n, u = N("table"), c = e.modelValue ? e.modelValue : e.rows, l = fn({ columns: e.columns, rows: c, id: e.id, config: e.config });
1403
+ l.$onAction(({ name: s, store: g, args: m, after: w }) => {
1373
1404
  if (s === "setCellData" || s === "setCellText") {
1374
- const [y, f, c] = m, h = v.getCellData(y, f);
1405
+ const [v, x, f] = m, d = g.getCellData(v, x);
1375
1406
  w(() => {
1376
- o("cellUpdate", { colIndex: y, rowIndex: f, newValue: c, oldValue: h });
1407
+ o("cellUpdate", { colIndex: v, rowIndex: x, newValue: f, oldValue: d });
1377
1408
  });
1378
1409
  } else if (s === "updateGanttBar") {
1379
- const [y] = m, f = (g = v.rows[y.rowIndex]) == null ? void 0 : g.gantt;
1380
- if (f) {
1381
- let c = !1;
1382
- y.type === "resize" ? y.edge === "start" ? c = f.startIndex !== y.value : y.edge === "end" && (c = f.endIndex !== y.value) : y.type === "bar" && (c = f.startIndex !== y.start || f.endIndex !== y.end), c && w(() => {
1383
- o("gantt:drag", y);
1384
- });
1385
- }
1410
+ const [v] = m;
1411
+ let x = !1;
1412
+ v.type === "resize" ? x = v.oldColspan !== v.newColspan : v.type === "bar" && (x = v.oldStart !== v.newStart || v.oldEnd !== v.newEnd), x && w(() => {
1413
+ o("gantt:drag", v);
1414
+ });
1386
1415
  }
1387
- }), V(
1416
+ }), X(
1388
1417
  () => l.rows,
1389
1418
  (s) => {
1390
1419
  o("update:modelValue", s);
@@ -1393,26 +1422,26 @@ const cn = {
1393
1422
  ), ne(() => {
1394
1423
  e.columns.some((s) => s.pinned) && (i(), l.config.view === "tree" && Ke(u, i, { childList: !0, subtree: !0 }));
1395
1424
  });
1396
- const a = I(() => l.columns.filter((s) => s.pinned).length), i = () => {
1397
- const s = u.value, v = s == null ? void 0 : s.rows[0], m = s == null ? void 0 : s.rows[1], w = v ? Array.from(v.cells) : [];
1398
- for (const [g, y] of w.entries()) {
1399
- const f = m == null ? void 0 : m.cells[g];
1400
- f && (y.style.width = `${f.offsetWidth}px`);
1425
+ const a = k(() => l.columns.filter((s) => s.pinned).length), i = () => {
1426
+ const s = u.value, g = s == null ? void 0 : s.rows[0], m = s == null ? void 0 : s.rows[1], w = g ? Array.from(g.cells) : [];
1427
+ for (const [v, x] of w.entries()) {
1428
+ const f = m == null ? void 0 : m.cells[v];
1429
+ f && (x.style.width = `${f.offsetWidth}px`);
1401
1430
  }
1402
- for (const g of (s == null ? void 0 : s.rows) || []) {
1403
- let y = 0;
1431
+ for (const v of (s == null ? void 0 : s.rows) || []) {
1432
+ let x = 0;
1404
1433
  const f = [];
1405
- for (const c of g.cells)
1406
- (c.classList.contains("sticky-column") || c.classList.contains("sticky-index")) && (c.style.left = `${y}px`, y += c.offsetWidth, f.push(c));
1434
+ for (const d of v.cells)
1435
+ (d.classList.contains("sticky-column") || d.classList.contains("sticky-index")) && (d.style.left = `${x}px`, x += d.offsetWidth, f.push(d));
1407
1436
  f.length > 0 && f[f.length - 1].classList.add("sticky-column-edge");
1408
1437
  }
1409
1438
  };
1410
1439
  window.addEventListener("keydown", (s) => {
1411
1440
  if (s.key === "Escape" && l.modal.visible) {
1412
1441
  l.modal.visible = !1;
1413
- const v = l.modal.parent;
1414
- v && Ue().then(() => {
1415
- v.focus();
1442
+ const g = l.modal.parent;
1443
+ g && Ue().then(() => {
1444
+ g.focus();
1416
1445
  });
1417
1446
  }
1418
1447
  });
@@ -1421,9 +1450,9 @@ const cn = {
1421
1450
  if (!(s.indent === 0) || a.value === 0)
1422
1451
  return l.columns;
1423
1452
  const m = [];
1424
- for (let g = 0; g < a.value; g++) {
1425
- const y = { ...l.columns[g] };
1426
- y.originalIndex = g, m.push(y);
1453
+ for (let v = 0; v < a.value; v++) {
1454
+ const x = { ...l.columns[v] };
1455
+ x.originalIndex = v, m.push(x);
1427
1456
  }
1428
1457
  return m.push({
1429
1458
  ...l.columns[a.value],
@@ -1434,59 +1463,59 @@ const cn = {
1434
1463
  // TODO: refactor to API that can detect when data exists in a cell. Might have be custom and not generalizable
1435
1464
  }), m;
1436
1465
  };
1437
- return t({ store: l }), (s, v) => xe((k(), T("table", {
1466
+ return t({ store: l }), (s, g) => xe((S(), R("table", {
1438
1467
  ref: "table",
1439
1468
  class: "atable",
1440
- style: q({
1441
- width: x(l).config.fullWidth ? "100%" : "auto"
1469
+ style: Y({
1470
+ width: b(l).config.fullWidth ? "100%" : "auto"
1442
1471
  })
1443
1472
  }, [
1444
- W(s.$slots, "header", { data: x(l) }, () => [
1473
+ W(s.$slots, "header", { data: b(l) }, () => [
1445
1474
  Le(nt, {
1446
- columns: x(l).columns,
1447
- store: x(l)
1475
+ columns: b(l).columns,
1476
+ store: b(l)
1448
1477
  }, null, 8, ["columns", "store"])
1449
1478
  ], !0),
1450
- O("tbody", null, [
1451
- W(s.$slots, "body", { data: x(l) }, () => [
1452
- (k(!0), T(ie, null, Ce(x(l).rows, (m, w) => (k(), se(_e, {
1479
+ L("tbody", null, [
1480
+ W(s.$slots, "body", { data: b(l) }, () => [
1481
+ (S(!0), R(ie, null, Ce(b(l).rows, (m, w) => (S(), se(_e, {
1453
1482
  key: m.id,
1454
1483
  row: m,
1455
1484
  rowIndex: w,
1456
- store: x(l)
1485
+ store: b(l)
1457
1486
  }, {
1458
1487
  default: De(() => [
1459
- (k(!0), T(ie, null, Ce(r(m), (g, y) => {
1460
- var f, c, h;
1461
- return k(), T(ie, {
1462
- key: g.name
1488
+ (S(!0), R(ie, null, Ce(r(m), (v, x) => {
1489
+ var f, d, p;
1490
+ return S(), R(ie, {
1491
+ key: v.name
1463
1492
  }, [
1464
- g.isGantt ? (k(), se(ve(g.ganttComponent || "AGanttCell"), {
1493
+ v.isGantt ? (S(), se(ve(v.ganttComponent || "AGanttCell"), {
1465
1494
  key: 0,
1466
- store: x(l),
1467
- columnsCount: x(l).columns.length - a.value,
1495
+ store: b(l),
1496
+ columnsCount: b(l).columns.length - a.value,
1468
1497
  color: (f = m.gantt) == null ? void 0 : f.color,
1469
- start: (c = m.gantt) == null ? void 0 : c.startIndex,
1470
- end: (h = m.gantt) == null ? void 0 : h.endIndex,
1471
- colspan: g.colspan,
1472
- pinned: g.pinned,
1498
+ start: (d = m.gantt) == null ? void 0 : d.startIndex,
1499
+ end: (p = m.gantt) == null ? void 0 : p.endIndex,
1500
+ colspan: v.colspan,
1501
+ pinned: v.pinned,
1473
1502
  rowIndex: w,
1474
- colIndex: g.originalIndex ?? y,
1475
- style: q({
1476
- textAlign: (g == null ? void 0 : g.align) || "center",
1477
- minWidth: (g == null ? void 0 : g.width) || "40ch",
1478
- width: x(l).config.fullWidth ? "auto" : null
1503
+ colIndex: v.originalIndex ?? x,
1504
+ style: Y({
1505
+ textAlign: (v == null ? void 0 : v.align) || "center",
1506
+ minWidth: (v == null ? void 0 : v.width) || "40ch",
1507
+ width: b(l).config.fullWidth ? "auto" : null
1479
1508
  })
1480
- }, null, 8, ["store", "columnsCount", "color", "start", "end", "colspan", "pinned", "rowIndex", "colIndex", "style"])) : (k(), se(ve(g.cellComponent || "ACell"), {
1509
+ }, null, 8, ["store", "columnsCount", "color", "start", "end", "colspan", "pinned", "rowIndex", "colIndex", "style"])) : (S(), se(ve(v.cellComponent || "ACell"), {
1481
1510
  key: 1,
1482
- store: x(l),
1483
- pinned: g.pinned,
1511
+ store: b(l),
1512
+ pinned: v.pinned,
1484
1513
  rowIndex: w,
1485
- colIndex: y,
1486
- style: q({
1487
- textAlign: (g == null ? void 0 : g.align) || "center",
1488
- minWidth: (g == null ? void 0 : g.width) || "40ch",
1489
- width: x(l).config.fullWidth ? "auto" : null
1514
+ colIndex: x,
1515
+ style: Y({
1516
+ textAlign: (v == null ? void 0 : v.align) || "center",
1517
+ minWidth: (v == null ? void 0 : v.width) || "40ch",
1518
+ width: b(l).config.fullWidth ? "auto" : null
1490
1519
  }),
1491
1520
  spellcheck: "false"
1492
1521
  }, null, 8, ["store", "pinned", "rowIndex", "colIndex", "style"]))
@@ -1497,46 +1526,46 @@ const cn = {
1497
1526
  }, 1032, ["row", "rowIndex", "store"]))), 128))
1498
1527
  ], !0)
1499
1528
  ]),
1500
- W(s.$slots, "footer", { data: x(l) }, void 0, !0),
1501
- W(s.$slots, "modal", { data: x(l) }, () => [
1502
- xe(Le(ot, { store: x(l) }, {
1529
+ W(s.$slots, "footer", { data: b(l) }, void 0, !0),
1530
+ W(s.$slots, "modal", { data: b(l) }, () => [
1531
+ xe(Le(ot, { store: b(l) }, {
1503
1532
  default: De(() => [
1504
- (k(), se(ve(x(l).modal.component), ke({
1505
- key: `${x(l).modal.rowIndex}:${x(l).modal.colIndex}`,
1506
- colIndex: x(l).modal.colIndex,
1507
- rowIndex: x(l).modal.rowIndex,
1508
- store: x(l)
1509
- }, x(l).modal.componentProps), null, 16, ["colIndex", "rowIndex", "store"]))
1533
+ (S(), se(ve(b(l).modal.component), ke({
1534
+ key: `${b(l).modal.rowIndex}:${b(l).modal.colIndex}`,
1535
+ colIndex: b(l).modal.colIndex,
1536
+ rowIndex: b(l).modal.rowIndex,
1537
+ store: b(l)
1538
+ }, b(l).modal.componentProps), null, 16, ["colIndex", "rowIndex", "store"]))
1510
1539
  ]),
1511
1540
  _: 1
1512
1541
  }, 8, ["store"]), [
1513
- [qe, x(l).modal.visible]
1542
+ [qe, b(l).modal.visible]
1514
1543
  ])
1515
1544
  ], !0)
1516
1545
  ], 4)), [
1517
- [x(an), x(l).closeModal]
1546
+ [b(an), b(l).closeModal]
1518
1547
  ]);
1519
1548
  }
1520
- }), mn = /* @__PURE__ */ le(vn, [["__scopeId", "data-v-40408c70"]]), gn = {}, hn = { class: "aloading" }, pn = { class: "aloading-header" };
1549
+ }), mn = /* @__PURE__ */ le(vn, [["__scopeId", "data-v-fcb81c06"]]), gn = {}, hn = { class: "aloading" }, pn = { class: "aloading-header" };
1521
1550
  function wn(e, t) {
1522
- return k(), T("div", hn, [
1523
- O("h2", pn, [
1551
+ return S(), R("div", hn, [
1552
+ L("h2", pn, [
1524
1553
  W(e.$slots, "default", {}, void 0, !0)
1525
1554
  ]),
1526
- t[0] || (t[0] = O("div", { class: "aloading-bar" }, null, -1))
1555
+ t[0] || (t[0] = L("div", { class: "aloading-bar" }, null, -1))
1527
1556
  ]);
1528
1557
  }
1529
1558
  const yn = /* @__PURE__ */ le(gn, [["render", wn], ["__scopeId", "data-v-a930a25b"]]), bn = {}, xn = { class: "aloading" }, Cn = { class: "aloading-header" };
1530
1559
  function En(e, t) {
1531
- return k(), T("div", xn, [
1532
- O("h2", Cn, [
1560
+ return S(), R("div", xn, [
1561
+ L("h2", Cn, [
1533
1562
  W(e.$slots, "default", {}, void 0, !0)
1534
1563
  ]),
1535
- t[0] || (t[0] = O("div", { class: "aloading-bar" }, null, -1))
1564
+ t[0] || (t[0] = L("div", { class: "aloading-bar" }, null, -1))
1536
1565
  ]);
1537
1566
  }
1538
1567
  const In = /* @__PURE__ */ le(bn, [["render", En], ["__scopeId", "data-v-e1165876"]]);
1539
- function An(e) {
1568
+ function $n(e) {
1540
1569
  e.component("ACell", Ut), e.component("AExpansionRow", Zt), e.component("AGanttCell", nn), e.component("ARow", _e), e.component("ATable", mn), e.component("ATableHeader", nt), e.component("ATableLoading", yn), e.component("ATableLoadingBar", In), e.component("ATableModal", ot);
1541
1570
  }
1542
1571
  export {
@@ -1550,6 +1579,6 @@ export {
1550
1579
  In as ATableLoadingBar,
1551
1580
  ot as ATableModal,
1552
1581
  fn as createTableStore,
1553
- An as install
1582
+ $n as install
1554
1583
  };
1555
1584
  //# sourceMappingURL=atable.js.map