@stonecrop/atable 0.4.13 → 0.4.14

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 B, onBeforeUnmount as lt, computed as I, shallowRef as H, toValue as C, 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 T, 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 B(
15
15
  e,
16
16
  t,
17
17
  {
@@ -32,13 +32,13 @@ function ce(...e) {
32
32
  }, o = (a, i, r, s) => (a.addEventListener(i, r, s), () => a.removeEventListener(i, r, s)), u = I(() => {
33
33
  const a = me(C(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
40
  me(C(u.value ? e[1] : e[0])),
41
- me(x(u.value ? e[2] : e[1])),
41
+ me(b(u.value ? e[2] : e[1])),
42
42
  // @ts-expect-error - TypeScript gets the correct types, but somehow still complains
43
43
  C(u.value ? e[3] : e[2])
44
44
  ];
@@ -46,18 +46,18 @@ function ce(...e) {
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
  }
@@ -73,24 +73,24 @@ function bt(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);
78
+ c && (c.disconnect(), c = void 0);
79
79
  }, i = I(() => {
80
80
  const m = C(e), w = me(m).map(ee).filter(mt);
81
81
  return new Set(w);
82
- }), r = V(
82
+ }), r = B(
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 = I(() => ee(e)), u = H(!1), c = I(() => 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 B(
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;
270
- }, Be = (e) => {
269
+ return o && (!z(o) || !G(o)) ? Se(o) : o;
270
+ }, Ve = (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,8 +279,8 @@ 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;
283
- }, Xe = (e) => {
282
+ return n && (!z(n) || !G(n)) ? Ae(n) : n;
283
+ }, Be = (e) => {
284
284
  const t = e.target;
285
285
  return Te(t);
286
286
  }, Te = (e) => {
@@ -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;
296
- }, Ve = (e) => {
295
+ return n && (!z(n) || !G(n)) ? Te(n) : n;
296
+ }, Xe = (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",
@@ -314,15 +314,15 @@ const z = (e) => {
314
314
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
315
315
  },
316
316
  "keydown.left": (e) => {
317
- const t = Be(e);
317
+ const t = Ve(e);
318
318
  e.preventDefault(), e.stopPropagation(), t && t.focus();
319
319
  },
320
320
  "keydown.right": (e) => {
321
- const t = Xe(e);
321
+ const t = Be(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) => {
@@ -330,7 +330,7 @@ const z = (e) => {
330
330
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
331
331
  },
332
332
  "keydown.control.left": (e) => {
333
- const t = Ve(e);
333
+ const t = Xe(e);
334
334
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
335
335
  },
336
336
  "keydown.control.right": (e) => {
@@ -356,15 +356,15 @@ const z = (e) => {
356
356
  }
357
357
  },
358
358
  "keydown.home": (e) => {
359
- const t = Ve(e);
359
+ const t = Xe(e);
360
360
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
361
361
  },
362
362
  "keydown.tab": (e) => {
363
- const t = Xe(e);
363
+ const t = Be(e);
364
364
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
365
365
  },
366
366
  "keydown.shift.tab": (e) => {
367
- const t = Be(e);
367
+ const t = Ve(e);
368
368
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
369
369
  }
370
370
  };
@@ -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 = B(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 = C(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;
@@ -481,11 +481,11 @@ function Wt(e, t = {}) {
481
481
  }));
482
482
  return n;
483
483
  }
484
- function Bt(e, t = !0, n) {
484
+ function Vt(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 B(
489
489
  e,
490
490
  t,
491
491
  {
@@ -504,15 +504,15 @@ function ue(...e) {
504
504
  const t = [], n = () => {
505
505
  t.forEach((a) => a()), t.length = 0;
506
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);
507
+ const a = q(C(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(C(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
517
  C(u.value ? e[3] : e[2])
518
518
  ];
@@ -520,51 +520,51 @@ function ue(...e) {
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
  }
538
- function Xt() {
538
+ function Bt() {
539
539
  const e = H(!1), t = Ie();
540
540
  return t && ne(() => {
541
541
  e.value = !0;
542
542
  }, t), e;
543
543
  }
544
544
  function Ze(e) {
545
- const t = Xt();
545
+ const t = Bt();
546
546
  return I(() => (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);
552
+ c && (c.disconnect(), c = void 0);
553
553
  }, i = I(() => {
554
- const m = C(e), w = J(m).map(te).filter(Pt);
554
+ const m = C(e), w = q(m).map(te).filter(Pt);
555
555
  return new Set(w);
556
- }), r = V(
556
+ }), r = B(
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(
585
+ handle: v = e,
586
+ buttons: x = [0]
587
+ } = t, f = P(
588
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))
589
+ ), d = P(), p = (E) => o ? o.includes(E.pointerType) : !0, k = (E) => {
590
+ C(u) && E.preventDefault(), C(c) && E.stopPropagation();
591
+ }, $ = (E) => {
592
+ var R;
593
+ if (!C(x).includes(E.button) || C(t.disabled) || !p(E) || C(l) && E.target !== C(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 V = C(w), F = (R = V == null ? void 0 : V.getBoundingClientRect) == null ? void 0 : R.call(V), X = C(e).getBoundingClientRect(), h = {
596
+ x: E.clientX - (V ? X.left - F.left + V.scrollLeft : X.left),
597
+ y: E.clientY - (V ? X.top - F.top + V.scrollTop : X.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, E)) !== !1 && (d.value = h, k(E));
600
+ }, M = (E) => {
601
+ if (C(t.disabled) || !p(E) || !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 R = C(w), V = C(e).getBoundingClientRect();
604
+ let { x: F, y: X } = f.value;
605
+ (g === "x" || g === "both") && (F = E.clientX - d.value.x, R && (F = Math.min(Math.max(0, F), R.scrollWidth - V.width))), (g === "y" || g === "both") && (X = E.clientY - d.value.y, R && (X = Math.min(Math.max(0, X), R.scrollHeight - V.height))), f.value = {
606
+ x: F,
607
+ y: X
608
+ }, a == null || a(f.value, E), k(E);
609
+ }, Q = (E) => {
610
+ C(t.disabled) || !p(E) || d.value && (d.value = void 0, i == null || i(f.value, E), k(E));
611
611
  };
612
612
  if (he) {
613
613
  const E = () => {
614
- var D;
614
+ var R;
615
615
  return {
616
- capture: (D = t.capture) != null ? D : !0,
616
+ capture: (R = t.capture) != null ? R : !0,
617
617
  passive: !C(u)
618
618
  };
619
619
  };
620
- ue(g, "pointerdown", M, E), ue(m, "pointermove", $, E), ue(m, "pointerup", B, E);
620
+ ue(v, "pointerdown", $, E), ue(m, "pointermove", M, E), ue(m, "pointerup", Q, E);
621
621
  }
622
622
  return {
623
623
  ...Wt(f),
624
624
  position: f,
625
- isDragging: I(() => !!c.value),
625
+ isDragging: I(() => !!d.value),
626
626
  style: I(
627
627
  () => `left:${f.value.x}px;top:${f.value.y}px;`
628
628
  )
629
629
  };
630
630
  }
631
- function Vt(e, t, n = {}) {
631
+ function Xt(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);
635
+ c && (c.disconnect(), c = void 0);
636
636
  }, i = I(() => {
637
- const v = C(e);
638
- return Array.isArray(v) ? v.map((m) => te(m)) : [te(v)];
639
- }), r = V(
637
+ const g = C(e);
638
+ return Array.isArray(g) ? g.map((m) => te(m)) : [te(g)];
639
+ }), r = B(
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 Xt(e, f), B(() => te(e), (d) => !d && f()), Ke(e, f, {
678
678
  attributeFilter: ["style", "class"]
679
- }), u && ue("scroll", f, { capture: !0, passive: !0 }), o && ue("resize", f, { passive: !0 }), Bt(() => {
680
- d && f();
679
+ }), u && ue("scroll", f, { capture: !0, passive: !0 }), o && ue("resize", f, { passive: !0 }), Vt(() => {
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 = I(() => e.store.getCellDisplayValue(e.colIndex, e.rowIndex)), g = I(() => typeof s.value == "string" ? Nt(s.value) : !1), m = I(() => {
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
715
  }), w = I(() => ({
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: k, height: $ } = ge(n);
720
+ l.mask, l.modalComponent && e.store.$patch((M) => {
721
+ M.modal.visible = !0, M.modal.colIndex = e.colIndex, M.modal.rowIndex = e.rowIndex, M.modal.left = d, M.modal.bottom = p, M.modal.width = k, M.modal.height = $, M.modal.cell = n.value, typeof l.modalComponent == "function" ? M.modal.component = l.modalComponent({ table: M.table, row: a, column: l }) : M.modal.component = l.modalComponent, M.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(), T("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(), T("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(), T("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 = I(() => 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(), T(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(), T("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,81 @@ 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
+ "40a169f6": t.value,
854
+ "08a2dd06": 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 = I(() => e.colspan > 0 ? l.value / e.colspan : 0), w = I(() => {
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 k = (d - g.value.startX) / m.value, $ = Math.max(0, Math.min(s.value - 1, g.value.startPos + k));
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, k = Math.round(p / m.value), $ = r.value, M = Math.max(0, Math.min(s.value - 1, g.value.startPos + k));
884
+ r.value = M, e.store.updateGanttBar({
885
+ rowIndex: e.rowIndex,
886
+ colIndex: e.colIndex,
887
+ type: "resize",
888
+ edge: "start",
889
+ oldValue: $,
890
+ newValue: M,
891
+ delta: k
892
+ });
885
893
  }
886
894
  }
887
- }), { isDragging: y } = we(d, {
895
+ }), { isDragging: x } = we(c, {
888
896
  axis: "x",
889
897
  onStart: () => {
890
- o.value && (o.value.style.transition = "none"), v.value = {
898
+ o.value && (o.value.style.transition = "none"), g.value = {
891
899
  startX: i.value,
892
900
  startPos: s.value
893
901
  };
894
902
  },
895
- onMove: ({ x: c }) => {
896
- if (y.value && o.value) {
897
- const A = (c - v.value.startX) / m.value, M = Math.max(
903
+ onMove: ({ x: d }) => {
904
+ if (x.value && o.value) {
905
+ const k = (d - g.value.startX) / m.value, $ = Math.max(
898
906
  r.value + 1,
899
- Math.min(e.columnsCount, v.value.startPos + A)
907
+ Math.min(e.columnsCount, g.value.startPos + k)
900
908
  );
901
- o.value.style.width = `${(M - r.value) / e.colspan * 100}%`;
909
+ o.value.style.width = `${($ - r.value) / e.colspan * 100}%`;
902
910
  }
903
911
  },
904
- onEnd: ({ x: c }) => {
912
+ onEnd: ({ x: d }) => {
905
913
  if (o.value) {
906
- const h = c - v.value.startX, A = Math.round(h / m.value), M = Math.max(
914
+ const p = d - g.value.startX, k = Math.round(p / m.value), $ = s.value, M = Math.max(
907
915
  r.value + 1,
908
- Math.min(e.columnsCount, v.value.startPos + A)
916
+ Math.min(e.columnsCount, g.value.startPos + k)
909
917
  );
910
- s.value = M, e.store.updateGanttBar({ rowIndex: e.rowIndex, colIndex: e.colIndex, type: "resize", edge: "end", value: M });
918
+ s.value = M, e.store.updateGanttBar({
919
+ rowIndex: e.rowIndex,
920
+ colIndex: e.colIndex,
921
+ type: "resize",
922
+ edge: "end",
923
+ oldValue: $,
924
+ newValue: M,
925
+ delta: k
926
+ });
911
927
  }
912
928
  }
913
929
  }), { isDragging: f } = we(o, {
@@ -915,55 +931,55 @@ const Nt = (e) => {
915
931
  // to avoid triggering when the left and right handles are being used
916
932
  axis: "x",
917
933
  onStart: () => {
918
- o.value && (o.value.style.transition = "none"), v.value = {
934
+ o.value && (o.value.style.transition = "none"), g.value = {
919
935
  startX: a.value,
920
936
  startPos: r.value
921
937
  };
922
938
  },
923
- onMove: ({ x: c }) => {
939
+ onMove: ({ x: d }) => {
924
940
  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}%`;
941
+ const k = (d - g.value.startX) / m.value, $ = s.value - r.value, M = Math.max(0, Math.min(g.value.startPos + k, e.columnsCount - $));
942
+ o.value.style.left = `${M / e.colspan * 100}%`;
927
943
  }
928
944
  },
929
- onEnd: ({ x: c }) => {
945
+ onEnd: ({ x: d }) => {
930
946
  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 });
947
+ const p = d - g.value.startX, k = Math.round(p / m.value), $ = s.value - r.value, M = r.value, Q = s.value;
948
+ let E = g.value.startPos + k, R = E + $;
949
+ E < 0 ? (E = 0, R = $) : R > e.columnsCount && (R = e.columnsCount, E = R - $), r.value = E, s.value = R, e.store.updateGanttBar({ rowIndex: e.rowIndex, colIndex: e.colIndex, type: "bar", oldStart: M, oldEnd: Q, newStart: E, newEnd: R, delta: k });
934
950
  }
935
951
  }
936
952
  });
937
- return (c, h) => (k(), T("td", {
953
+ return (d, p) => (S(), T("td", {
938
954
  class: "aganttcell",
939
- colspan: c.colspan
955
+ colspan: d.colspan
940
956
  }, [
941
- O("div", _t, [
942
- O("div", {
957
+ L("div", _t, [
958
+ L("div", {
943
959
  ref: "bar",
944
- class: U(["gantt-bar", { "is-dragging": x(f) || x(g) || x(y) }]),
945
- style: q(w.value)
960
+ class: j(["gantt-bar", { "is-dragging": b(f) || b(v) || b(x) }]),
961
+ style: Y(w.value)
946
962
  }, [
947
- O("div", {
963
+ L("div", {
948
964
  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)
965
+ class: j(["gantt-handle left-handle", { "is-dragging": b(v) }])
966
+ }, p[0] || (p[0] = [
967
+ L("div", { class: "handle-grip" }, null, -1),
968
+ L("div", { class: "vertical-indicator left-indicator" }, null, -1)
953
969
  ]), 2),
954
- c.label ? (k(), T("label", en, K(c.label), 1)) : _("", !0),
955
- O("div", {
970
+ d.label ? (S(), T("label", en, K(d.label), 1)) : _("", !0),
971
+ L("div", {
956
972
  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)
973
+ class: j(["gantt-handle right-handle", { "is-dragging": b(x) }])
974
+ }, p[1] || (p[1] = [
975
+ L("div", { class: "handle-grip" }, null, -1),
976
+ L("div", { class: "vertical-indicator right-indicator" }, null, -1)
961
977
  ]), 2)
962
978
  ], 6)
963
979
  ], 512)
964
980
  ], 8, Kt));
965
981
  }
966
- }), nn = /* @__PURE__ */ le(tn, [["__scopeId", "data-v-133983c1"]]), on = ["tabindex"], ln = /* @__PURE__ */ Q({
982
+ }), nn = /* @__PURE__ */ le(tn, [["__scopeId", "data-v-90b147f4"]]), on = ["tabindex"], ln = /* @__PURE__ */ J({
967
983
  __name: "ARow",
968
984
  props: {
969
985
  rowIndex: {},
@@ -972,7 +988,7 @@ const Nt = (e) => {
972
988
  addNavigation: { type: [Boolean, Object], default: !1 }
973
989
  },
974
990
  setup(e) {
975
- const t = G("rowEl"), n = I(() => e.store.isRowVisible(e.rowIndex)), o = I(() => e.store.getRowExpandSymbol(e.rowIndex));
991
+ const t = N("rowEl"), n = I(() => e.store.isRowVisible(e.rowIndex)), o = I(() => e.store.getRowExpandSymbol(e.rowIndex));
976
992
  if (e.addNavigation) {
977
993
  let u = Re;
978
994
  typeof e.addNavigation == "object" && (u = {
@@ -985,21 +1001,21 @@ const Nt = (e) => {
985
1001
  }
986
1002
  ]);
987
1003
  }
988
- return (u, d) => xe((k(), T("tr", {
1004
+ return (u, c) => xe((S(), T("tr", {
989
1005
  ref: "rowEl",
990
1006
  tabindex: u.tabIndex,
991
1007
  class: "atable-row"
992
1008
  }, [
993
1009
  u.store.config.view !== "uncounted" ? W(u.$slots, "index", { key: 0 }, () => [
994
- u.store.config.view === "list" ? (k(), T("td", {
1010
+ u.store.config.view === "list" ? (S(), T("td", {
995
1011
  key: 0,
996
1012
  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", {
1013
+ class: j(["list-index", u.store.hasPinnedColumns ? "sticky-index" : ""])
1014
+ }, K(u.rowIndex + 1), 3)) : u.store.config.view === "tree" ? (S(), T("td", {
999
1015
  key: 1,
1000
1016
  tabIndex: -1,
1001
- class: U(["tree-index", u.store.hasPinnedColumns ? "sticky-index" : ""]),
1002
- onClick: d[0] || (d[0] = (l) => u.store.toggleRowExpand(u.rowIndex))
1017
+ class: j(["tree-index", u.store.hasPinnedColumns ? "sticky-index" : ""]),
1018
+ onClick: c[0] || (c[0] = (l) => u.store.toggleRowExpand(u.rowIndex))
1003
1019
  }, K(o.value), 3)) : _("", !0)
1004
1020
  ], !0) : _("", !0),
1005
1021
  W(u.$slots, "default", {}, void 0, !0)
@@ -1017,15 +1033,15 @@ function Z(...e) {
1017
1033
  const t = [], n = () => {
1018
1034
  t.forEach((a) => a()), t.length = 0;
1019
1035
  }, 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);
1036
+ const a = q(C(e[0])).filter((i) => i != null);
1021
1037
  return a.every((i) => typeof i != "string") ? a : void 0;
1022
- }), d = Qe(
1038
+ }), c = Qe(
1023
1039
  () => {
1024
1040
  var a, i;
1025
1041
  return [
1026
1042
  (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])),
1043
+ q(C(u.value ? e[1] : e[0])),
1044
+ q(b(u.value ? e[2] : e[1])),
1029
1045
  // @ts-expect-error - TypeScript gets the correct types, but somehow still complains
1030
1046
  C(u.value ? e[3] : e[2])
1031
1047
  ];
@@ -1033,51 +1049,51 @@ function Z(...e) {
1033
1049
  ([a, i, r, s]) => {
1034
1050
  if (n(), !(a != null && a.length) || !(i != null && i.length) || !(r != null && r.length))
1035
1051
  return;
1036
- const v = Je(s) ? { ...s } : s;
1052
+ const g = Je(s) ? { ...s } : s;
1037
1053
  t.push(
1038
1054
  ...a.flatMap(
1039
1055
  (m) => i.flatMap(
1040
- (w) => r.map((g) => o(m, w, g, v))
1056
+ (w) => r.map((v) => o(m, w, v, g))
1041
1057
  )
1042
1058
  )
1043
1059
  );
1044
1060
  },
1045
1061
  { flush: "post" }
1046
1062
  ), l = () => {
1047
- d(), n();
1063
+ c(), n();
1048
1064
  };
1049
1065
  return de(n), l;
1050
1066
  }
1051
1067
  let Ge = !1;
1052
1068
  function ze(e, t, n = {}) {
1053
- const { window: o = et, ignore: u = [], capture: d = !0, detectIframe: l = !1, controls: a = !1 } = n;
1069
+ const { window: o = et, ignore: u = [], capture: c = !0, detectIframe: l = !1, controls: a = !1 } = n;
1054
1070
  if (!o)
1055
- return a ? { stop: Y, cancel: Y, trigger: Y } : Y;
1071
+ return a ? { stop: U, cancel: U, trigger: U } : U;
1056
1072
  if (Ee && !Ge) {
1057
1073
  Ge = !0;
1058
1074
  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);
1075
+ Array.from(o.document.body.children).forEach((d) => Z(d, "click", U, f)), Z(o.document.documentElement, "click", U, f);
1060
1076
  }
1061
1077
  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));
1078
+ const r = (f) => C(u).some((d) => {
1079
+ if (typeof d == "string")
1080
+ return Array.from(o.document.querySelectorAll(d)).some((p) => p === f.target || f.composedPath().includes(p));
1065
1081
  {
1066
- const h = re(c);
1067
- return h && (f.target === h || f.composedPath().includes(h));
1082
+ const p = re(d);
1083
+ return p && (f.target === p || f.composedPath().includes(p));
1068
1084
  }
1069
1085
  });
1070
1086
  function s(f) {
1071
- const c = C(f);
1072
- return c && c.$.subTree.shapeFlag === 16;
1087
+ const d = C(f);
1088
+ return d && d.$.subTree.shapeFlag === 16;
1073
1089
  }
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));
1090
+ function g(f, d) {
1091
+ const p = C(f), k = p.$.subTree && p.$.subTree.children;
1092
+ return k == null || !Array.isArray(k) ? !1 : k.some(($) => $.el === d.target || d.composedPath().includes($.el));
1077
1093
  }
1078
1094
  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))) {
1095
+ const d = re(e);
1096
+ if (f.target != null && !(!(d instanceof Element) && s(e) && g(e, f)) && !(!d || d === f.target || f.composedPath().includes(d))) {
1081
1097
  if ("detail" in f && f.detail === 0 && (i = !r(f)), !i) {
1082
1098
  i = !0;
1083
1099
  return;
@@ -1086,33 +1102,33 @@ function ze(e, t, n = {}) {
1086
1102
  }
1087
1103
  };
1088
1104
  let w = !1;
1089
- const g = [
1105
+ const v = [
1090
1106
  Z(o, "click", (f) => {
1091
1107
  w || (w = !0, setTimeout(() => {
1092
1108
  w = !1;
1093
1109
  }, 0), m(f));
1094
- }, { passive: !0, capture: d }),
1110
+ }, { passive: !0, capture: c }),
1095
1111
  Z(o, "pointerdown", (f) => {
1096
- const c = re(e);
1097
- i = !r(f) && !!(c && !f.composedPath().includes(c));
1112
+ const d = re(e);
1113
+ i = !r(f) && !!(d && !f.composedPath().includes(d));
1098
1114
  }, { passive: !0 }),
1099
1115
  l && Z(o, "blur", (f) => {
1100
1116
  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);
1117
+ var d;
1118
+ const p = re(e);
1119
+ ((d = o.document.activeElement) == null ? void 0 : d.tagName) === "IFRAME" && !(p != null && p.contains(o.document.activeElement)) && t(f);
1104
1120
  }, 0);
1105
1121
  }, { passive: !0 })
1106
- ].filter(Boolean), y = () => g.forEach((f) => f());
1122
+ ].filter(Boolean), x = () => v.forEach((f) => f());
1107
1123
  return a ? {
1108
- stop: y,
1124
+ stop: x,
1109
1125
  cancel: () => {
1110
1126
  i = !1;
1111
1127
  },
1112
1128
  trigger: (f) => {
1113
1129
  i = !0, m(f), i = !1;
1114
1130
  }
1115
- } : y;
1131
+ } : x;
1116
1132
  }
1117
1133
  const an = {
1118
1134
  mounted(e, t) {
@@ -1146,9 +1162,9 @@ function sn(e) {
1146
1162
  }
1147
1163
  const be = /* @__PURE__ */ new WeakMap();
1148
1164
  function rn(e, t = !1) {
1149
- const n = R(t);
1165
+ const n = P(t);
1150
1166
  let o = null, u = "";
1151
- V(Ht(e), (a) => {
1167
+ B(Ht(e), (a) => {
1152
1168
  const i = ye(C(a));
1153
1169
  if (i) {
1154
1170
  const r = i;
@@ -1160,7 +1176,7 @@ function rn(e, t = !1) {
1160
1176
  }, {
1161
1177
  immediate: !0
1162
1178
  });
1163
- const d = () => {
1179
+ const c = () => {
1164
1180
  const a = ye(C(e));
1165
1181
  !a || n.value || (Ee && (o = Z(
1166
1182
  a,
@@ -1179,7 +1195,7 @@ function rn(e, t = !1) {
1179
1195
  return n.value;
1180
1196
  },
1181
1197
  set(a) {
1182
- a ? d() : l();
1198
+ a ? c() : l();
1183
1199
  }
1184
1200
  });
1185
1201
  }
@@ -1191,7 +1207,7 @@ function un() {
1191
1207
  return;
1192
1208
  e = !0;
1193
1209
  const u = rn(n, o.value);
1194
- V(t, (d) => u.value = d);
1210
+ B(t, (c) => u.value = c);
1195
1211
  };
1196
1212
  }
1197
1213
  un();
@@ -1201,29 +1217,29 @@ const cn = {
1201
1217
  }, dn = {
1202
1218
  class: "atable-header-row",
1203
1219
  tabindex: "-1"
1204
- }, nt = /* @__PURE__ */ Q({
1220
+ }, nt = /* @__PURE__ */ J({
1205
1221
  __name: "ATableHeader",
1206
1222
  props: {
1207
1223
  columns: {},
1208
1224
  store: {}
1209
1225
  },
1210
1226
  setup(e) {
1211
- return (t, n) => t.columns.length ? (k(), T("thead", cn, [
1212
- O("tr", dn, [
1213
- t.store.zeroColumn ? (k(), T("th", {
1227
+ return (t, n) => t.columns.length ? (S(), T("thead", cn, [
1228
+ L("tr", dn, [
1229
+ t.store.zeroColumn ? (S(), T("th", {
1214
1230
  key: 0,
1215
1231
  id: "header-index",
1216
- class: U([[
1232
+ class: j([[
1217
1233
  t.store.hasPinnedColumns ? "sticky-index" : "",
1218
1234
  t.store.config.view === "tree" ? "tree-index" : "",
1219
1235
  t.store.config.view === "list-expansion" ? "list-expansion-index" : ""
1220
1236
  ], "list-index"])
1221
1237
  }, null, 2)) : _("", !0),
1222
- (k(!0), T(ie, null, Ce(t.columns, (o, u) => (k(), T("th", {
1238
+ (S(!0), T(ie, null, Ce(t.columns, (o, u) => (S(), T("th", {
1223
1239
  key: o.name,
1224
1240
  tabindex: "-1",
1225
- style: q(t.store.getHeaderCellStyle(o)),
1226
- class: U(o.pinned ? "sticky-column" : "")
1241
+ style: Y(t.store.getHeaderCellStyle(o)),
1242
+ class: j(o.pinned ? "sticky-column" : "")
1227
1243
  }, [
1228
1244
  W(t.$slots, "default", {}, () => [
1229
1245
  dt(K(o.label || String.fromCharCode(u + 97).toUpperCase()), 1)
@@ -1232,26 +1248,26 @@ const cn = {
1232
1248
  ])
1233
1249
  ])) : _("", !0);
1234
1250
  }
1235
- }), ot = /* @__PURE__ */ Q({
1251
+ }), ot = /* @__PURE__ */ J({
1236
1252
  __name: "ATableModal",
1237
1253
  props: {
1238
1254
  store: {}
1239
1255
  },
1240
1256
  setup(e) {
1241
- const t = G("amodal"), { width: n, height: o } = ge(t), u = I(() => {
1242
- var v, m, w, g;
1257
+ const t = N("amodal"), { width: n, height: o } = ge(t), u = I(() => {
1258
+ var g, m, w, v;
1243
1259
  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;
1260
+ const c = (g = e.store.modal.cell) == null ? void 0 : g.closest("table"), l = c.offsetHeight || 0, a = c.offsetWidth || 0;
1245
1261
  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;
1262
+ const r = ((w = c.querySelector("thead")) == null ? void 0 : w.offsetHeight) || 0;
1247
1263
  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;
1264
+ let s = ((v = e.store.modal.cell) == null ? void 0 : v.offsetLeft) || 0;
1249
1265
  return s = s + n.value <= a ? s : s - (n.value - e.store.modal.width), {
1250
1266
  left: `${s}px`,
1251
1267
  top: `${i}px`
1252
1268
  };
1253
1269
  });
1254
- return (d, l) => (k(), T("div", {
1270
+ return (c, l) => (S(), T("div", {
1255
1271
  class: "amodal",
1256
1272
  ref: "amodal",
1257
1273
  tabindex: "-1",
@@ -1259,104 +1275,104 @@ const cn = {
1259
1275
  }, ["stop"])),
1260
1276
  onInput: l[1] || (l[1] = Oe(() => {
1261
1277
  }, ["stop"])),
1262
- style: q(u.value)
1278
+ style: Y(u.value)
1263
1279
  }, [
1264
- W(d.$slots, "default")
1280
+ W(c.$slots, "default")
1265
1281
  ], 36));
1266
1282
  }
1267
1283
  }), fn = (e) => {
1268
1284
  const t = e.id || Gt();
1269
1285
  return ft(`table-${t}`, () => {
1270
1286
  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] = {
1287
+ const h = {};
1288
+ for (const [y, A] of c.value.entries())
1289
+ for (const [O, D] of l.value.entries())
1290
+ h[`${y}:${O}`] = D[A.name];
1291
+ return h;
1292
+ }, u = (h) => {
1293
+ const y = [Object.assign({}, { rowModified: !1 })];
1294
+ if (h && "0:0" in h)
1295
+ return h;
1296
+ const A = /* @__PURE__ */ new Set();
1297
+ for (let O = l.value.length - 1; O >= 0; O--) {
1298
+ const D = l.value[O];
1299
+ D.parent && A.add(D.parent), y[O] = {
1284
1300
  childrenOpen: !1,
1285
1301
  expanded: !1,
1286
- indent: L.indent || 0,
1287
- isParent: S.has(P),
1288
- isRoot: L.parent === null || L.parent === void 0,
1302
+ indent: D.indent || 0,
1303
+ isParent: A.has(O),
1304
+ isRoot: D.parent === null || D.parent === void 0,
1289
1305
  rowModified: !1,
1290
- open: L.parent === null || L.parent === void 0,
1291
- parent: L.parent
1306
+ open: D.parent === null || D.parent === void 0,
1307
+ parent: D.parent
1292
1308
  };
1293
1309
  }
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(
1310
+ return y;
1311
+ }, 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 = I(() => c.value.some((h) => h.pinned)), w = I(() => `${Math.ceil(l.value.length / 100 + 1)}ch`), v = I(
1296
1312
  () => 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",
1313
+ ), x = (h, y) => i.value[`${h}:${y}`], f = (h, y, A) => {
1314
+ const O = `${h}:${y}`, D = c.value[h];
1315
+ i.value[O] !== A && (r.value[y].rowModified = !0), i.value[O] = A, l.value[y][D.name] = A;
1316
+ }, d = (h, y, A) => {
1317
+ const O = `${h}:${y}`;
1318
+ i.value[O] !== A && (r.value[y].rowModified = !0, g.value[O] = A);
1319
+ }, p = (h) => ({
1320
+ minWidth: h.width || "40ch",
1321
+ textAlign: h.align || "center",
1306
1322
  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) => {
1323
+ }), k = (h) => {
1324
+ const y = l.value[h];
1325
+ return a.value.view === "gantt" && y.indent === 0;
1326
+ }, $ = (h) => a.value.view !== "tree" || r.value[h].isRoot || r.value[h].open, M = (h) => a.value.view !== "tree" ? "" : r.value[h].isRoot || r.value[h].isParent ? r.value[h].childrenOpen ? "-" : "+" : "", Q = (h) => {
1311
1327
  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;
1328
+ r.value[h].childrenOpen = !r.value[h].childrenOpen;
1329
+ for (let y = l.value.length - 1; y >= 0; y--)
1330
+ r.value[y].parent === h && (r.value[y].open = !r.value[y].open, r.value[y].childrenOpen && Q(y));
1331
+ } else a.value.view === "list-expansion" && (r.value[h].expanded = !r.value[h].expanded);
1332
+ }, E = (h, y) => {
1333
+ const A = x(h, y);
1334
+ return R(h, y, A);
1335
+ }, R = (h, y, A) => {
1336
+ const O = c.value[h], D = l.value[y], ae = O.format;
1337
+ return ae ? typeof ae == "function" ? ae(A, { table: i.value, row: D, column: O }) : typeof ae == "string" ? Function(`"use strict";return (${ae})`)()(A, { table: i.value, row: D, column: O }) : A : A;
1322
1338
  };
1323
1339
  return {
1324
1340
  // state
1325
- columns: d,
1341
+ columns: c,
1326
1342
  config: a,
1327
1343
  display: r,
1328
1344
  modal: s,
1329
1345
  rows: l,
1330
1346
  table: i,
1331
- updates: v,
1347
+ updates: g,
1332
1348
  // getters
1333
1349
  hasPinnedColumns: m,
1334
1350
  numberedRowWidth: w,
1335
- zeroColumn: g,
1351
+ zeroColumn: v,
1336
1352
  // 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);
1353
+ closeModal: (h) => {
1354
+ var y;
1355
+ h.target instanceof Node && (y = s.value.parent) != null && y.contains(h.target) || s.value.visible && (s.value.visible = !1);
1340
1356
  },
1341
- getCellData: y,
1357
+ getCellData: x,
1342
1358
  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,
1359
+ getFormattedValue: R,
1360
+ getHeaderCellStyle: p,
1361
+ getIndent: (h, y) => y && h === 0 && y > 0 ? `${y}ch` : "inherit",
1362
+ getRowExpandSymbol: M,
1363
+ isRowGantt: k,
1364
+ isRowVisible: $,
1349
1365
  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));
1366
+ setCellText: d,
1367
+ toggleRowExpand: Q,
1368
+ updateGanttBar: (h) => {
1369
+ var A;
1370
+ const y = (A = l.value[h.rowIndex]) == null ? void 0 : A.gantt;
1371
+ y && (h.type === "resize" ? h.edge === "start" ? y.startIndex = h.newValue : h.edge === "end" && (y.endIndex = h.newValue) : h.type === "bar" && (y.startIndex = h.newStart, y.endIndex = h.newEnd));
1356
1372
  }
1357
1373
  };
1358
1374
  })();
1359
- }, vn = /* @__PURE__ */ Q({
1375
+ }, vn = /* @__PURE__ */ J({
1360
1376
  __name: "ATable",
1361
1377
  props: {
1362
1378
  id: {},
@@ -1367,24 +1383,21 @@ const cn = {
1367
1383
  },
1368
1384
  emits: ["update:modelValue", "cellUpdate", "gantt:drag"],
1369
1385
  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;
1386
+ 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 });
1387
+ l.$onAction(({ name: s, store: g, args: m, after: w }) => {
1373
1388
  if (s === "setCellData" || s === "setCellText") {
1374
- const [y, f, c] = m, h = v.getCellData(y, f);
1389
+ const [v, x, f] = m, d = g.getCellData(v, x);
1375
1390
  w(() => {
1376
- o("cellUpdate", { colIndex: y, rowIndex: f, newValue: c, oldValue: h });
1391
+ o("cellUpdate", { colIndex: v, rowIndex: x, newValue: f, oldValue: d });
1377
1392
  });
1378
1393
  } 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
- }
1394
+ const [v] = m;
1395
+ let x = !1;
1396
+ v.type === "resize" ? x = v.oldValue !== v.newValue : v.type === "bar" && (x = v.oldStart !== v.newStart || v.oldEnd !== v.newEnd), x && w(() => {
1397
+ o("gantt:drag", v);
1398
+ });
1386
1399
  }
1387
- }), V(
1400
+ }), B(
1388
1401
  () => l.rows,
1389
1402
  (s) => {
1390
1403
  o("update:modelValue", s);
@@ -1394,25 +1407,25 @@ const cn = {
1394
1407
  e.columns.some((s) => s.pinned) && (i(), l.config.view === "tree" && Ke(u, i, { childList: !0, subtree: !0 }));
1395
1408
  });
1396
1409
  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`);
1410
+ 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) : [];
1411
+ for (const [v, x] of w.entries()) {
1412
+ const f = m == null ? void 0 : m.cells[v];
1413
+ f && (x.style.width = `${f.offsetWidth}px`);
1401
1414
  }
1402
- for (const g of (s == null ? void 0 : s.rows) || []) {
1403
- let y = 0;
1415
+ for (const v of (s == null ? void 0 : s.rows) || []) {
1416
+ let x = 0;
1404
1417
  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));
1418
+ for (const d of v.cells)
1419
+ (d.classList.contains("sticky-column") || d.classList.contains("sticky-index")) && (d.style.left = `${x}px`, x += d.offsetWidth, f.push(d));
1407
1420
  f.length > 0 && f[f.length - 1].classList.add("sticky-column-edge");
1408
1421
  }
1409
1422
  };
1410
1423
  window.addEventListener("keydown", (s) => {
1411
1424
  if (s.key === "Escape" && l.modal.visible) {
1412
1425
  l.modal.visible = !1;
1413
- const v = l.modal.parent;
1414
- v && Ue().then(() => {
1415
- v.focus();
1426
+ const g = l.modal.parent;
1427
+ g && Ue().then(() => {
1428
+ g.focus();
1416
1429
  });
1417
1430
  }
1418
1431
  });
@@ -1421,9 +1434,9 @@ const cn = {
1421
1434
  if (!(s.indent === 0) || a.value === 0)
1422
1435
  return l.columns;
1423
1436
  const m = [];
1424
- for (let g = 0; g < a.value; g++) {
1425
- const y = { ...l.columns[g] };
1426
- y.originalIndex = g, m.push(y);
1437
+ for (let v = 0; v < a.value; v++) {
1438
+ const x = { ...l.columns[v] };
1439
+ x.originalIndex = v, m.push(x);
1427
1440
  }
1428
1441
  return m.push({
1429
1442
  ...l.columns[a.value],
@@ -1434,59 +1447,59 @@ const cn = {
1434
1447
  // TODO: refactor to API that can detect when data exists in a cell. Might have be custom and not generalizable
1435
1448
  }), m;
1436
1449
  };
1437
- return t({ store: l }), (s, v) => xe((k(), T("table", {
1450
+ return t({ store: l }), (s, g) => xe((S(), T("table", {
1438
1451
  ref: "table",
1439
1452
  class: "atable",
1440
- style: q({
1441
- width: x(l).config.fullWidth ? "100%" : "auto"
1453
+ style: Y({
1454
+ width: b(l).config.fullWidth ? "100%" : "auto"
1442
1455
  })
1443
1456
  }, [
1444
- W(s.$slots, "header", { data: x(l) }, () => [
1457
+ W(s.$slots, "header", { data: b(l) }, () => [
1445
1458
  Le(nt, {
1446
- columns: x(l).columns,
1447
- store: x(l)
1459
+ columns: b(l).columns,
1460
+ store: b(l)
1448
1461
  }, null, 8, ["columns", "store"])
1449
1462
  ], !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, {
1463
+ L("tbody", null, [
1464
+ W(s.$slots, "body", { data: b(l) }, () => [
1465
+ (S(!0), T(ie, null, Ce(b(l).rows, (m, w) => (S(), se(_e, {
1453
1466
  key: m.id,
1454
1467
  row: m,
1455
1468
  rowIndex: w,
1456
- store: x(l)
1469
+ store: b(l)
1457
1470
  }, {
1458
1471
  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
1472
+ (S(!0), T(ie, null, Ce(r(m), (v, x) => {
1473
+ var f, d, p;
1474
+ return S(), T(ie, {
1475
+ key: v.name
1463
1476
  }, [
1464
- g.isGantt ? (k(), se(ve(g.ganttComponent || "AGanttCell"), {
1477
+ v.isGantt ? (S(), se(ve(v.ganttComponent || "AGanttCell"), {
1465
1478
  key: 0,
1466
- store: x(l),
1467
- columnsCount: x(l).columns.length - a.value,
1479
+ store: b(l),
1480
+ columnsCount: b(l).columns.length - a.value,
1468
1481
  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,
1482
+ start: (d = m.gantt) == null ? void 0 : d.startIndex,
1483
+ end: (p = m.gantt) == null ? void 0 : p.endIndex,
1484
+ colspan: v.colspan,
1485
+ pinned: v.pinned,
1473
1486
  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
1487
+ colIndex: v.originalIndex ?? x,
1488
+ style: Y({
1489
+ textAlign: (v == null ? void 0 : v.align) || "center",
1490
+ minWidth: (v == null ? void 0 : v.width) || "40ch",
1491
+ width: b(l).config.fullWidth ? "auto" : null
1479
1492
  })
1480
- }, null, 8, ["store", "columnsCount", "color", "start", "end", "colspan", "pinned", "rowIndex", "colIndex", "style"])) : (k(), se(ve(g.cellComponent || "ACell"), {
1493
+ }, null, 8, ["store", "columnsCount", "color", "start", "end", "colspan", "pinned", "rowIndex", "colIndex", "style"])) : (S(), se(ve(v.cellComponent || "ACell"), {
1481
1494
  key: 1,
1482
- store: x(l),
1483
- pinned: g.pinned,
1495
+ store: b(l),
1496
+ pinned: v.pinned,
1484
1497
  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
1498
+ colIndex: x,
1499
+ style: Y({
1500
+ textAlign: (v == null ? void 0 : v.align) || "center",
1501
+ minWidth: (v == null ? void 0 : v.width) || "40ch",
1502
+ width: b(l).config.fullWidth ? "auto" : null
1490
1503
  }),
1491
1504
  spellcheck: "false"
1492
1505
  }, null, 8, ["store", "pinned", "rowIndex", "colIndex", "style"]))
@@ -1497,46 +1510,46 @@ const cn = {
1497
1510
  }, 1032, ["row", "rowIndex", "store"]))), 128))
1498
1511
  ], !0)
1499
1512
  ]),
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) }, {
1513
+ W(s.$slots, "footer", { data: b(l) }, void 0, !0),
1514
+ W(s.$slots, "modal", { data: b(l) }, () => [
1515
+ xe(Le(ot, { store: b(l) }, {
1503
1516
  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"]))
1517
+ (S(), se(ve(b(l).modal.component), ke({
1518
+ key: `${b(l).modal.rowIndex}:${b(l).modal.colIndex}`,
1519
+ colIndex: b(l).modal.colIndex,
1520
+ rowIndex: b(l).modal.rowIndex,
1521
+ store: b(l)
1522
+ }, b(l).modal.componentProps), null, 16, ["colIndex", "rowIndex", "store"]))
1510
1523
  ]),
1511
1524
  _: 1
1512
1525
  }, 8, ["store"]), [
1513
- [qe, x(l).modal.visible]
1526
+ [qe, b(l).modal.visible]
1514
1527
  ])
1515
1528
  ], !0)
1516
1529
  ], 4)), [
1517
- [x(an), x(l).closeModal]
1530
+ [b(an), b(l).closeModal]
1518
1531
  ]);
1519
1532
  }
1520
- }), mn = /* @__PURE__ */ le(vn, [["__scopeId", "data-v-40408c70"]]), gn = {}, hn = { class: "aloading" }, pn = { class: "aloading-header" };
1533
+ }), mn = /* @__PURE__ */ le(vn, [["__scopeId", "data-v-7d899652"]]), gn = {}, hn = { class: "aloading" }, pn = { class: "aloading-header" };
1521
1534
  function wn(e, t) {
1522
- return k(), T("div", hn, [
1523
- O("h2", pn, [
1535
+ return S(), T("div", hn, [
1536
+ L("h2", pn, [
1524
1537
  W(e.$slots, "default", {}, void 0, !0)
1525
1538
  ]),
1526
- t[0] || (t[0] = O("div", { class: "aloading-bar" }, null, -1))
1539
+ t[0] || (t[0] = L("div", { class: "aloading-bar" }, null, -1))
1527
1540
  ]);
1528
1541
  }
1529
1542
  const yn = /* @__PURE__ */ le(gn, [["render", wn], ["__scopeId", "data-v-a930a25b"]]), bn = {}, xn = { class: "aloading" }, Cn = { class: "aloading-header" };
1530
1543
  function En(e, t) {
1531
- return k(), T("div", xn, [
1532
- O("h2", Cn, [
1544
+ return S(), T("div", xn, [
1545
+ L("h2", Cn, [
1533
1546
  W(e.$slots, "default", {}, void 0, !0)
1534
1547
  ]),
1535
- t[0] || (t[0] = O("div", { class: "aloading-bar" }, null, -1))
1548
+ t[0] || (t[0] = L("div", { class: "aloading-bar" }, null, -1))
1536
1549
  ]);
1537
1550
  }
1538
1551
  const In = /* @__PURE__ */ le(bn, [["render", En], ["__scopeId", "data-v-e1165876"]]);
1539
- function An(e) {
1552
+ function $n(e) {
1540
1553
  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
1554
  }
1542
1555
  export {
@@ -1550,6 +1563,6 @@ export {
1550
1563
  In as ATableLoadingBar,
1551
1564
  ot as ATableModal,
1552
1565
  fn as createTableStore,
1553
- An as install
1566
+ $n as install
1554
1567
  };
1555
1568
  //# sourceMappingURL=atable.js.map