@stonecrop/atable 0.13.14 → 0.14.0

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,149 +1,149 @@
1
- import { onMounted as Ae, ref as z, watch as ue, onBeforeUnmount as Pt, computed as $, shallowRef as re, toValue as H, watchEffect as Zt, getCurrentScope as $t, onScopeDispose as Tt, getCurrentInstance as lt, unref as B, nextTick as at, isRef as Nt, toRefs as Ft, customRef as It, toRef as Wt, readonly as zt, defineComponent as xe, useTemplateRef as ce, openBlock as y, createElementBlock as k, normalizeClass as ae, normalizeStyle as pe, createBlock as he, resolveDynamicComponent as Ne, mergeProps as st, toDisplayString as be, Fragment as me, createElementVNode as F, renderSlot as fe, createCommentVNode as ee, useCssVars as Xt, onUnmounted as Gt, withModifiers as Se, withDirectives as de, renderList as Ce, vShow as it, reactive as jt, vModelText as Ze, vModelCheckbox as Yt, vModelSelect as Ut, createTextVNode as Jt, useModel as wt, inject as qt, createVNode as pt, withCtx as xt, mergeModels as yt } from "vue";
2
- import { defineStore as Qt } from "pinia";
3
- import './assets/index.css';function St(e, t) {
4
- return $t() ? (Tt(e, t), !0) : !1;
1
+ import { onMounted as Ie, ref as W, watch as ce, onBeforeUnmount as Nt, computed as T, shallowRef as re, toValue as H, watchEffect as Ft, getCurrentScope as Et, onScopeDispose as Tt, getCurrentInstance as lt, unref as P, nextTick as at, isRef as Wt, toRefs as zt, customRef as St, toRef as Xt, readonly as Gt, defineComponent as Ce, useTemplateRef as de, openBlock as b, createElementBlock as R, normalizeClass as ae, normalizeStyle as pe, createBlock as ve, resolveDynamicComponent as Ne, mergeProps as st, toDisplayString as ye, useCssVars as Ut, onUnmounted as jt, createElementVNode as z, withModifiers as $e, createCommentVNode as _, withDirectives as ue, Fragment as me, renderList as be, vShow as it, renderSlot as he, reactive as Yt, vModelText as Ze, vModelCheckbox as Jt, vModelSelect as qt, createTextVNode as Qt, useModel as gt, inject as Kt, createVNode as wt, withCtx as pt, mergeModels as xt } from "vue";
2
+ import { defineStore as _t } from "pinia";
3
+ import './assets/index.css';function $t(e, t) {
4
+ return Et() ? (Tt(e, t), !0) : !1;
5
5
  }
6
- const Kt = typeof window < "u" && typeof document < "u";
6
+ const en = typeof window < "u" && typeof document < "u";
7
7
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
8
- const _t = (e) => e != null, en = Object.prototype.toString, tn = (e) => en.call(e) === "[object Object]", nn = () => {
8
+ const tn = (e) => e != null, nn = Object.prototype.toString, on = (e) => nn.call(e) === "[object Object]", ln = () => {
9
9
  };
10
- function je(e) {
10
+ function Ue(e) {
11
11
  return Array.isArray(e) ? e : [e];
12
12
  }
13
- function on(e, t, n) {
14
- return ue(e, t, {
13
+ function an(e, t, n) {
14
+ return ce(e, t, {
15
15
  ...n,
16
16
  immediate: !0
17
17
  });
18
18
  }
19
- const De = Kt ? window : void 0;
19
+ const De = en ? window : void 0;
20
20
  function Le(e) {
21
21
  var t;
22
22
  const n = H(e);
23
23
  return (t = n?.$el) !== null && t !== void 0 ? t : n;
24
24
  }
25
25
  function Fe(...e) {
26
- const t = (l, u, a, o) => (l.addEventListener(u, a, o), () => l.removeEventListener(u, a, o)), n = $(() => {
27
- const l = je(H(e[0])).filter((u) => u != null);
26
+ const t = (l, u, o, a) => (l.addEventListener(u, o, a), () => l.removeEventListener(u, o, a)), n = T(() => {
27
+ const l = Ue(H(e[0])).filter((u) => u != null);
28
28
  return l.every((u) => typeof u != "string") ? l : void 0;
29
29
  });
30
- return on(() => {
30
+ return an(() => {
31
31
  var l, u;
32
32
  return [
33
- (l = (u = n.value) === null || u === void 0 ? void 0 : u.map((a) => Le(a))) !== null && l !== void 0 ? l : [De].filter((a) => a != null),
34
- je(H(n.value ? e[1] : e[0])),
35
- je(B(n.value ? e[2] : e[1])),
33
+ (l = (u = n.value) === null || u === void 0 ? void 0 : u.map((o) => Le(o))) !== null && l !== void 0 ? l : [De].filter((o) => o != null),
34
+ Ue(H(n.value ? e[1] : e[0])),
35
+ Ue(P(n.value ? e[2] : e[1])),
36
36
  H(n.value ? e[3] : e[2])
37
37
  ];
38
- }, ([l, u, a, o], r, c) => {
39
- if (!l?.length || !u?.length || !a?.length) return;
40
- const s = tn(o) ? { ...o } : o, f = l.flatMap((v) => u.flatMap((x) => a.map((I) => t(v, x, I, s))));
41
- c(() => {
42
- f.forEach((v) => v());
38
+ }, ([l, u, o, a], c, r) => {
39
+ if (!l?.length || !u?.length || !o?.length) return;
40
+ const s = on(a) ? { ...a } : a, h = l.flatMap((f) => u.flatMap((w) => o.map((L) => t(f, w, L, s))));
41
+ r(() => {
42
+ h.forEach((f) => f());
43
43
  });
44
44
  }, { flush: "post" });
45
45
  }
46
46
  // @__NO_SIDE_EFFECTS__
47
- function ln() {
47
+ function sn() {
48
48
  const e = re(!1), t = lt();
49
- return t && Ae(() => {
49
+ return t && Ie(() => {
50
50
  e.value = !0;
51
51
  }, t), e;
52
52
  }
53
53
  // @__NO_SIDE_EFFECTS__
54
- function an(e) {
55
- const t = /* @__PURE__ */ ln();
56
- return $(() => (t.value, !!e()));
54
+ function rn(e) {
55
+ const t = /* @__PURE__ */ sn();
56
+ return T(() => (t.value, !!e()));
57
57
  }
58
- function sn(e, t, n = {}) {
58
+ function cn(e, t, n = {}) {
59
59
  const { window: l = De, ...u } = n;
60
- let a;
61
- const o = /* @__PURE__ */ an(() => l && "MutationObserver" in l), r = () => {
62
- a && (a.disconnect(), a = void 0);
63
- }, c = ue($(() => {
64
- const v = je(H(e)).map(Le).filter(_t);
65
- return new Set(v);
66
- }), (v) => {
67
- r(), o.value && v.size && (a = new MutationObserver(t), v.forEach((x) => a.observe(x, u)));
60
+ let o;
61
+ const a = /* @__PURE__ */ rn(() => l && "MutationObserver" in l), c = () => {
62
+ o && (o.disconnect(), o = void 0);
63
+ }, r = ce(T(() => {
64
+ const f = Ue(H(e)).map(Le).filter(tn);
65
+ return new Set(f);
66
+ }), (f) => {
67
+ c(), a.value && f.size && (o = new MutationObserver(t), f.forEach((w) => o.observe(w, u)));
68
68
  }, {
69
69
  immediate: !0,
70
70
  flush: "post"
71
- }), s = () => a?.takeRecords(), f = () => {
72
- c(), r();
71
+ }), s = () => o?.takeRecords(), h = () => {
72
+ r(), c();
73
73
  };
74
- return St(f), {
75
- isSupported: o,
76
- stop: f,
74
+ return $t(h), {
75
+ isSupported: a,
76
+ stop: h,
77
77
  takeRecords: s
78
78
  };
79
79
  }
80
- function rn(e, t, n = {}) {
81
- const { window: l = De, document: u = l?.document, flush: a = "sync" } = n;
82
- if (!l || !u) return nn;
83
- let o;
84
- const r = (f) => {
85
- o?.(), o = f;
86
- }, c = Zt(() => {
87
- const f = Le(e);
88
- if (f) {
89
- const { stop: v } = sn(u, (x) => {
90
- x.map((I) => [...I.removedNodes]).flat().some((I) => I === f || I.contains(f)) && t(x);
80
+ function un(e, t, n = {}) {
81
+ const { window: l = De, document: u = l?.document, flush: o = "sync" } = n;
82
+ if (!l || !u) return ln;
83
+ let a;
84
+ const c = (h) => {
85
+ a?.(), a = h;
86
+ }, r = Ft(() => {
87
+ const h = Le(e);
88
+ if (h) {
89
+ const { stop: f } = cn(u, (w) => {
90
+ w.map((L) => [...L.removedNodes]).flat().some((L) => L === h || L.contains(h)) && t(w);
91
91
  }, {
92
92
  window: l,
93
93
  childList: !0,
94
94
  subtree: !0
95
95
  });
96
- r(v);
96
+ c(f);
97
97
  }
98
- }, { flush: a }), s = () => {
99
- c(), r();
98
+ }, { flush: o }), s = () => {
99
+ r(), c();
100
100
  };
101
- return St(s), s;
101
+ return $t(s), s;
102
102
  }
103
103
  // @__NO_SIDE_EFFECTS__
104
- function cn(e = {}) {
104
+ function dn(e = {}) {
105
105
  var t;
106
- const { window: n = De, deep: l = !0, triggerOnRemoval: u = !1 } = e, a = (t = e.document) !== null && t !== void 0 ? t : n?.document, o = () => {
107
- let s = a?.activeElement;
106
+ const { window: n = De, deep: l = !0, triggerOnRemoval: u = !1 } = e, o = (t = e.document) !== null && t !== void 0 ? t : n?.document, a = () => {
107
+ let s = o?.activeElement;
108
108
  if (l)
109
- for (var f; s?.shadowRoot; ) s = s == null || (f = s.shadowRoot) === null || f === void 0 ? void 0 : f.activeElement;
109
+ for (var h; s?.shadowRoot; ) s = s == null || (h = s.shadowRoot) === null || h === void 0 ? void 0 : h.activeElement;
110
110
  return s;
111
- }, r = re(), c = () => {
112
- r.value = o();
111
+ }, c = re(), r = () => {
112
+ c.value = a();
113
113
  };
114
114
  if (n) {
115
115
  const s = {
116
116
  capture: !0,
117
117
  passive: !0
118
118
  };
119
- Fe(n, "blur", (f) => {
120
- f.relatedTarget === null && c();
121
- }, s), Fe(n, "focus", c, s);
119
+ Fe(n, "blur", (h) => {
120
+ h.relatedTarget === null && r();
121
+ }, s), Fe(n, "focus", r, s);
122
122
  }
123
- return u && rn(r, c, { document: a }), c(), r;
123
+ return u && un(c, r, { document: o }), r(), c;
124
124
  }
125
- const un = "focusin", dn = "focusout", fn = ":focus-within";
126
- function vn(e, t = {}) {
127
- const { window: n = De } = t, l = $(() => Le(e)), u = re(!1), a = $(() => u.value);
128
- if (!n || !(/* @__PURE__ */ cn(t)).value) return { focused: a };
129
- const o = { passive: !0 };
130
- return Fe(l, un, () => u.value = !0, o), Fe(l, dn, () => {
131
- var r, c, s;
132
- return u.value = (r = (c = l.value) === null || c === void 0 || (s = c.matches) === null || s === void 0 ? void 0 : s.call(c, fn)) !== null && r !== void 0 ? r : !1;
133
- }, o), { focused: a };
125
+ const fn = "focusin", vn = "focusout", hn = ":focus-within";
126
+ function mn(e, t = {}) {
127
+ const { window: n = De } = t, l = T(() => Le(e)), u = re(!1), o = T(() => u.value);
128
+ if (!n || !(/* @__PURE__ */ dn(t)).value) return { focused: o };
129
+ const a = { passive: !0 };
130
+ return Fe(l, fn, () => u.value = !0, a), Fe(l, vn, () => {
131
+ var c, r, s;
132
+ return u.value = (c = (r = l.value) === null || r === void 0 || (s = r.matches) === null || s === void 0 ? void 0 : s.call(r, hn)) !== null && c !== void 0 ? c : !1;
133
+ }, a), { focused: o };
134
134
  }
135
- function hn(e, { window: t = De, scrollTarget: n } = {}) {
136
- const l = z(!1), u = () => {
135
+ function gn(e, { window: t = De, scrollTarget: n } = {}) {
136
+ const l = W(!1), u = () => {
137
137
  if (!t) return;
138
- const a = t.document, o = Le(e);
139
- if (!o)
138
+ const o = t.document, a = Le(e);
139
+ if (!a)
140
140
  l.value = !1;
141
141
  else {
142
- const r = o.getBoundingClientRect();
143
- l.value = r.top <= (t.innerHeight || a.documentElement.clientHeight) && r.left <= (t.innerWidth || a.documentElement.clientWidth) && r.bottom >= 0 && r.right >= 0;
142
+ const c = a.getBoundingClientRect();
143
+ l.value = c.top <= (t.innerHeight || o.documentElement.clientHeight) && c.left <= (t.innerWidth || o.documentElement.clientWidth) && c.bottom >= 0 && c.right >= 0;
144
144
  }
145
145
  };
146
- return ue(
146
+ return ce(
147
147
  () => Le(e),
148
148
  () => u(),
149
149
  { immediate: !0, flush: "post" }
@@ -153,9 +153,9 @@ function hn(e, { window: t = De, scrollTarget: n } = {}) {
153
153
  }), l;
154
154
  }
155
155
  const ke = (e) => {
156
- let t = hn(e).value;
156
+ let t = gn(e).value;
157
157
  return t = t && e.offsetHeight > 0, t;
158
- }, Me = (e) => e.tabIndex >= 0, bt = (e) => {
158
+ }, Me = (e) => e.tabIndex >= 0, yt = (e) => {
159
159
  if (e.target instanceof HTMLElement)
160
160
  return rt(e.target);
161
161
  }, rt = (e) => {
@@ -171,7 +171,7 @@ const ke = (e) => {
171
171
  n instanceof HTMLTableRowElement && (t = n);
172
172
  }
173
173
  return t && (!Me(t) || !ke(t)) ? rt(t) : t;
174
- }, mn = (e) => {
174
+ }, wn = (e) => {
175
175
  if (!(e.target instanceof HTMLElement)) return;
176
176
  const t = e.target;
177
177
  let n;
@@ -189,7 +189,7 @@ const ke = (e) => {
189
189
  }
190
190
  }
191
191
  return n && (!Me(n) || !ke(n)) ? ct(n) : n;
192
- }, Ct = (e) => {
192
+ }, bt = (e) => {
193
193
  if (e.target instanceof HTMLElement)
194
194
  return ct(e.target);
195
195
  }, ct = (e) => {
@@ -205,7 +205,7 @@ const ke = (e) => {
205
205
  n instanceof HTMLTableRowElement && (t = n);
206
206
  }
207
207
  return t && (!Me(t) || !ke(t)) ? ct(t) : t;
208
- }, gn = (e) => {
208
+ }, pn = (e) => {
209
209
  if (!(e.target instanceof HTMLElement)) return;
210
210
  const t = e.target;
211
211
  let n;
@@ -223,7 +223,7 @@ const ke = (e) => {
223
223
  }
224
224
  }
225
225
  return n && (!Me(n) || !ke(n)) ? rt(n) : n;
226
- }, kt = (e) => {
226
+ }, Ct = (e) => {
227
227
  if (e.target instanceof HTMLElement)
228
228
  return ut(e.target);
229
229
  }, ut = (e) => {
@@ -236,7 +236,7 @@ const ke = (e) => {
236
236
  l instanceof HTMLElement && (t = l);
237
237
  }
238
238
  return t && (!Me(t) || !ke(t)) ? ut(t) : t;
239
- }, Mt = (e) => {
239
+ }, kt = (e) => {
240
240
  if (e.target instanceof HTMLElement)
241
241
  return dt(e.target);
242
242
  }, dt = (e) => {
@@ -249,80 +249,80 @@ const ke = (e) => {
249
249
  l instanceof HTMLElement && (t = l);
250
250
  }
251
251
  return t && (!Me(t) || !ke(t)) ? dt(t) : t;
252
- }, Rt = (e) => {
252
+ }, Mt = (e) => {
253
253
  if (!(e.target instanceof HTMLElement)) return;
254
254
  const t = e.target.parentElement?.firstElementChild, n = t instanceof HTMLElement ? t : null;
255
255
  return n && (!Me(n) || !ke(n)) ? dt(n) : n;
256
- }, Et = (e) => {
256
+ }, Rt = (e) => {
257
257
  if (!(e.target instanceof HTMLElement)) return;
258
258
  const t = e.target.parentElement?.lastElementChild, n = t instanceof HTMLElement ? t : null;
259
259
  return n && (!Me(n) || !ke(n)) ? ut(n) : n;
260
- }, ze = ["alt", "control", "shift", "meta"], wn = {
260
+ }, ze = ["alt", "control", "shift", "meta"], xn = {
261
261
  ArrowUp: "up",
262
262
  ArrowDown: "down",
263
263
  ArrowLeft: "left",
264
264
  ArrowRight: "right"
265
- }, qe = {
265
+ }, Je = {
266
266
  "keydown.up": (e) => {
267
- const t = bt(e);
267
+ const t = yt(e);
268
268
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
269
269
  },
270
270
  "keydown.down": (e) => {
271
- const t = Ct(e);
271
+ const t = bt(e);
272
272
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
273
273
  },
274
274
  "keydown.left": (e) => {
275
- const t = kt(e);
275
+ const t = Ct(e);
276
276
  e.preventDefault(), e.stopPropagation(), t && t.focus();
277
277
  },
278
278
  "keydown.right": (e) => {
279
- const t = Mt(e);
279
+ const t = kt(e);
280
280
  e.preventDefault(), e.stopPropagation(), t && t.focus();
281
281
  },
282
282
  "keydown.control.up": (e) => {
283
- const t = mn(e);
283
+ const t = wn(e);
284
284
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
285
285
  },
286
286
  "keydown.control.down": (e) => {
287
- const t = gn(e);
287
+ const t = pn(e);
288
288
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
289
289
  },
290
290
  "keydown.control.left": (e) => {
291
- const t = Rt(e);
291
+ const t = Mt(e);
292
292
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
293
293
  },
294
294
  "keydown.control.right": (e) => {
295
- const t = Et(e);
295
+ const t = Rt(e);
296
296
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
297
297
  },
298
298
  "keydown.end": (e) => {
299
- const t = Et(e);
299
+ const t = Rt(e);
300
300
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
301
301
  },
302
302
  "keydown.enter": (e) => {
303
303
  if (e.target instanceof HTMLElement && e.target instanceof HTMLTableCellElement) {
304
304
  e.preventDefault(), e.stopPropagation();
305
- const t = Ct(e);
305
+ const t = bt(e);
306
306
  t && t.focus();
307
307
  }
308
308
  },
309
309
  "keydown.shift.enter": (e) => {
310
310
  if (e.target instanceof HTMLElement && e.target instanceof HTMLTableCellElement) {
311
311
  e.preventDefault(), e.stopPropagation();
312
- const t = bt(e);
312
+ const t = yt(e);
313
313
  t && t.focus();
314
314
  }
315
315
  },
316
316
  "keydown.home": (e) => {
317
- const t = Rt(e);
317
+ const t = Mt(e);
318
318
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
319
319
  },
320
320
  "keydown.tab": (e) => {
321
- const t = Mt(e);
321
+ const t = kt(e);
322
322
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
323
323
  },
324
324
  "keydown.shift.tab": (e) => {
325
- const t = kt(e);
325
+ const t = Ct(e);
326
326
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
327
327
  }
328
328
  };
@@ -330,139 +330,139 @@ function Ke(e) {
330
330
  let t = null;
331
331
  return e.parent && (typeof e.parent == "string" ? t = document.querySelector(e.parent) : e.parent instanceof HTMLElement ? t = e.parent : t = e.parent.value), t;
332
332
  }
333
- function ft(e) {
334
- const t = (a) => {
335
- const o = Ke(a);
336
- let r = [];
337
- if (typeof a.selectors == "string")
338
- r = Array.from(o ? o.querySelectorAll(a.selectors) : document.querySelectorAll(a.selectors));
339
- else if (Array.isArray(a.selectors))
340
- for (const c of a.selectors)
341
- c instanceof HTMLElement ? r.push(c) : r.push(c.$el);
342
- else if (a.selectors instanceof HTMLElement)
343
- r.push(a.selectors);
344
- else if (a.selectors?.value)
345
- if (Array.isArray(a.selectors.value))
346
- for (const c of a.selectors.value)
347
- c instanceof HTMLElement ? r.push(c) : r.push(c.$el);
333
+ function It(e) {
334
+ const t = (o) => {
335
+ const a = Ke(o);
336
+ let c = [];
337
+ if (typeof o.selectors == "string")
338
+ c = Array.from(a ? a.querySelectorAll(o.selectors) : document.querySelectorAll(o.selectors));
339
+ else if (Array.isArray(o.selectors))
340
+ for (const r of o.selectors)
341
+ r instanceof HTMLElement ? c.push(r) : c.push(r.$el);
342
+ else if (o.selectors instanceof HTMLElement)
343
+ c.push(o.selectors);
344
+ else if (o.selectors?.value)
345
+ if (Array.isArray(o.selectors.value))
346
+ for (const r of o.selectors.value)
347
+ r instanceof HTMLElement ? c.push(r) : c.push(r.$el);
348
348
  else
349
- r.push(a.selectors.value);
350
- return r;
351
- }, n = (a) => {
352
- const o = Ke(a);
353
- let r = [];
354
- return a.selectors ? r = t(a) : o && (r = Array.from(o.children).filter((c) => c instanceof HTMLElement).filter((c) => Me(c) && ke(c))), r;
355
- }, l = (a) => (o) => {
356
- const r = wn[o.key] || o.key.toLowerCase();
357
- if (ze.includes(r)) return;
358
- const c = a.handlers || qe;
359
- for (const s of Object.keys(c)) {
360
- const [f, ...v] = s.split(".");
361
- if (f === "keydown" && v.includes(r)) {
362
- const x = c[s], I = v.filter((R) => ze.includes(R)), P = ze.some((R) => {
363
- const w = R.charAt(0).toUpperCase() + R.slice(1);
364
- return o.getModifierState(w);
349
+ c.push(o.selectors.value);
350
+ return c;
351
+ }, n = (o) => {
352
+ const a = Ke(o);
353
+ let c = [];
354
+ return o.selectors ? c = t(o) : a && (c = Array.from(a.children).filter((r) => r instanceof HTMLElement).filter((r) => Me(r) && ke(r))), c;
355
+ }, l = (o) => (a) => {
356
+ const c = xn[a.key] || a.key.toLowerCase();
357
+ if (ze.includes(c)) return;
358
+ const r = o.handlers || Je;
359
+ for (const s of Object.keys(r)) {
360
+ const [h, ...f] = s.split(".");
361
+ if (h === "keydown" && f.includes(c)) {
362
+ const w = r[s], L = f.filter((y) => ze.includes(y)), Z = ze.some((y) => {
363
+ const m = y.charAt(0).toUpperCase() + y.slice(1);
364
+ return a.getModifierState(m);
365
365
  });
366
- if (I.length > 0) {
367
- if (P) {
368
- for (const R of ze)
369
- if (v.includes(R)) {
370
- const w = R.charAt(0).toUpperCase() + R.slice(1);
371
- o.getModifierState(w) && x(o);
366
+ if (L.length > 0) {
367
+ if (Z) {
368
+ for (const y of ze)
369
+ if (f.includes(y)) {
370
+ const m = y.charAt(0).toUpperCase() + y.slice(1);
371
+ a.getModifierState(m) && w(a);
372
372
  }
373
373
  }
374
374
  } else
375
- P || x(o);
375
+ Z || w(a);
376
376
  }
377
377
  }
378
378
  }, u = [];
379
- Ae(() => {
380
- for (const a of e) {
381
- const o = Ke(a), r = n(a), c = l(a), s = o ? [o] : r;
382
- for (const f of s) {
383
- const { focused: v } = vn(z(f)), x = ue(v, (I) => {
384
- I ? f.addEventListener("keydown", c) : f.removeEventListener("keydown", c);
379
+ Ie(() => {
380
+ for (const o of e) {
381
+ const a = Ke(o), c = n(o), r = l(o), s = a ? [a] : c;
382
+ for (const h of s) {
383
+ const { focused: f } = mn(W(h)), w = ce(f, (L) => {
384
+ L ? h.addEventListener("keydown", r) : h.removeEventListener("keydown", r);
385
385
  });
386
- u.push(x);
386
+ u.push(w);
387
387
  }
388
388
  }
389
- }), Pt(() => {
390
- for (const a of u)
391
- a();
389
+ }), Nt(() => {
390
+ for (const o of u)
391
+ o();
392
392
  });
393
393
  }
394
- function vt(e, t) {
395
- return $t() ? (Tt(e, t), !0) : !1;
394
+ function ft(e, t) {
395
+ return Et() ? (Tt(e, t), !0) : !1;
396
396
  }
397
397
  const At = typeof window < "u" && typeof document < "u";
398
398
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
399
- const pn = (e) => e != null, xn = Object.prototype.toString, yn = (e) => xn.call(e) === "[object Object]", Ie = () => {
399
+ const yn = (e) => e != null, bn = Object.prototype.toString, Cn = (e) => bn.call(e) === "[object Object]", Se = () => {
400
400
  };
401
- function bn(...e) {
402
- if (e.length !== 1) return Wt(...e);
401
+ function kn(...e) {
402
+ if (e.length !== 1) return Xt(...e);
403
403
  const t = e[0];
404
- return typeof t == "function" ? zt(It(() => ({
404
+ return typeof t == "function" ? Gt(St(() => ({
405
405
  get: t,
406
- set: Ie
407
- }))) : z(t);
406
+ set: Se
407
+ }))) : W(t);
408
408
  }
409
- function Cn(e, t) {
409
+ function Mn(e, t) {
410
410
  function n(...l) {
411
- return new Promise((u, a) => {
411
+ return new Promise((u, o) => {
412
412
  Promise.resolve(e(() => t.apply(this, l), {
413
413
  fn: t,
414
414
  thisArg: this,
415
415
  args: l
416
- })).then(u).catch(a);
416
+ })).then(u).catch(o);
417
417
  });
418
418
  }
419
419
  return n;
420
420
  }
421
- function kn(e, t = {}) {
422
- let n, l, u = Ie;
423
- const a = (c) => {
424
- clearTimeout(c), u(), u = Ie;
421
+ function Rn(e, t = {}) {
422
+ let n, l, u = Se;
423
+ const o = (r) => {
424
+ clearTimeout(r), u(), u = Se;
425
425
  };
426
- let o;
427
- return (c) => {
428
- const s = H(e), f = H(t.maxWait);
429
- return n && a(n), s <= 0 || f !== void 0 && f <= 0 ? (l && (a(l), l = void 0), Promise.resolve(c())) : new Promise((v, x) => {
430
- u = t.rejectOnCancel ? x : v, o = c, f && !l && (l = setTimeout(() => {
431
- n && a(n), l = void 0, v(o());
432
- }, f)), n = setTimeout(() => {
433
- l && a(l), l = void 0, v(c());
426
+ let a;
427
+ return (r) => {
428
+ const s = H(e), h = H(t.maxWait);
429
+ return n && o(n), s <= 0 || h !== void 0 && h <= 0 ? (l && (o(l), l = void 0), Promise.resolve(r())) : new Promise((f, w) => {
430
+ u = t.rejectOnCancel ? w : f, a = r, h && !l && (l = setTimeout(() => {
431
+ n && o(n), l = void 0, f(a());
432
+ }, h)), n = setTimeout(() => {
433
+ l && o(l), l = void 0, f(r());
434
434
  }, s);
435
435
  });
436
436
  };
437
437
  }
438
- function Ye(e) {
438
+ function je(e) {
439
439
  return Array.isArray(e) ? e : [e];
440
440
  }
441
- function Mn(e) {
441
+ function En(e) {
442
442
  return lt();
443
443
  }
444
444
  // @__NO_SIDE_EFFECTS__
445
- function Rn(e, t = 200, n = {}) {
446
- return Cn(kn(t, n), e);
445
+ function Tn(e, t = 200, n = {}) {
446
+ return Mn(Rn(t, n), e);
447
447
  }
448
- function En(e, t = {}) {
449
- if (!Nt(e)) return Ft(e);
448
+ function Sn(e, t = {}) {
449
+ if (!Wt(e)) return zt(e);
450
450
  const n = Array.isArray(e.value) ? Array.from({ length: e.value.length }) : {};
451
- for (const l in e.value) n[l] = It(() => ({
451
+ for (const l in e.value) n[l] = St(() => ({
452
452
  get() {
453
453
  return e.value[l];
454
454
  },
455
455
  set(u) {
456
- var a;
457
- if (!((a = H(t.replaceRef)) !== null && a !== void 0) || a) if (Array.isArray(e.value)) {
458
- const o = [...e.value];
459
- o[l] = u, e.value = o;
456
+ var o;
457
+ if (!((o = H(t.replaceRef)) !== null && o !== void 0) || o) if (Array.isArray(e.value)) {
458
+ const a = [...e.value];
459
+ a[l] = u, e.value = a;
460
460
  } else {
461
- const o = {
461
+ const a = {
462
462
  ...e.value,
463
463
  [l]: u
464
464
  };
465
- Object.setPrototypeOf(o, Object.getPrototypeOf(e.value)), e.value = o;
465
+ Object.setPrototypeOf(a, Object.getPrototypeOf(e.value)), e.value = a;
466
466
  }
467
467
  else e.value[l] = u;
468
468
  }
@@ -470,10 +470,10 @@ function En(e, t = {}) {
470
470
  return n;
471
471
  }
472
472
  function $n(e, t = !0, n) {
473
- Mn() ? Ae(e, n) : t ? e() : at(e);
473
+ En() ? Ie(e, n) : t ? e() : at(e);
474
474
  }
475
- function Tn(e, t, n) {
476
- return ue(e, t, {
475
+ function In(e, t, n) {
476
+ return ce(e, t, {
477
477
  ...n,
478
478
  immediate: !0
479
479
  });
@@ -485,122 +485,122 @@ function we(e) {
485
485
  return (t = n?.$el) !== null && t !== void 0 ? t : n;
486
486
  }
487
487
  function Ee(...e) {
488
- const t = (l, u, a, o) => (l.addEventListener(u, a, o), () => l.removeEventListener(u, a, o)), n = $(() => {
489
- const l = Ye(H(e[0])).filter((u) => u != null);
488
+ const t = (l, u, o, a) => (l.addEventListener(u, o, a), () => l.removeEventListener(u, o, a)), n = T(() => {
489
+ const l = je(H(e[0])).filter((u) => u != null);
490
490
  return l.every((u) => typeof u != "string") ? l : void 0;
491
491
  });
492
- return Tn(() => {
492
+ return In(() => {
493
493
  var l, u;
494
494
  return [
495
- (l = (u = n.value) === null || u === void 0 ? void 0 : u.map((a) => we(a))) !== null && l !== void 0 ? l : [We].filter((a) => a != null),
496
- Ye(H(n.value ? e[1] : e[0])),
497
- Ye(B(n.value ? e[2] : e[1])),
495
+ (l = (u = n.value) === null || u === void 0 ? void 0 : u.map((o) => we(o))) !== null && l !== void 0 ? l : [We].filter((o) => o != null),
496
+ je(H(n.value ? e[1] : e[0])),
497
+ je(P(n.value ? e[2] : e[1])),
498
498
  H(n.value ? e[3] : e[2])
499
499
  ];
500
- }, ([l, u, a, o], r, c) => {
501
- if (!l?.length || !u?.length || !a?.length) return;
502
- const s = yn(o) ? { ...o } : o, f = l.flatMap((v) => u.flatMap((x) => a.map((I) => t(v, x, I, s))));
503
- c(() => {
504
- f.forEach((v) => v());
500
+ }, ([l, u, o, a], c, r) => {
501
+ if (!l?.length || !u?.length || !o?.length) return;
502
+ const s = Cn(a) ? { ...a } : a, h = l.flatMap((f) => u.flatMap((w) => o.map((L) => t(f, w, L, s))));
503
+ r(() => {
504
+ h.forEach((f) => f());
505
505
  });
506
506
  }, { flush: "post" });
507
507
  }
508
508
  function ot(e, t, n = {}) {
509
- const { window: l = We, ignore: u = [], capture: a = !0, detectIframe: o = !1, controls: r = !1 } = n;
510
- if (!l) return r ? {
511
- stop: Ie,
512
- cancel: Ie,
513
- trigger: Ie
514
- } : Ie;
515
- let c = !0;
516
- const s = (w) => H(u).some((h) => {
517
- if (typeof h == "string") return Array.from(l.document.querySelectorAll(h)).some((m) => m === w.target || w.composedPath().includes(m));
509
+ const { window: l = We, ignore: u = [], capture: o = !0, detectIframe: a = !1, controls: c = !1 } = n;
510
+ if (!l) return c ? {
511
+ stop: Se,
512
+ cancel: Se,
513
+ trigger: Se
514
+ } : Se;
515
+ let r = !0;
516
+ const s = (m) => H(u).some((v) => {
517
+ if (typeof v == "string") return Array.from(l.document.querySelectorAll(v)).some((g) => g === m.target || m.composedPath().includes(g));
518
518
  {
519
- const m = we(h);
520
- return m && (w.target === m || w.composedPath().includes(m));
519
+ const g = we(v);
520
+ return g && (m.target === g || m.composedPath().includes(g));
521
521
  }
522
522
  });
523
- function f(w) {
524
- const h = H(w);
525
- return h && h.$.subTree.shapeFlag === 16;
523
+ function h(m) {
524
+ const v = H(m);
525
+ return v && v.$.subTree.shapeFlag === 16;
526
526
  }
527
- function v(w, h) {
528
- const m = H(w), C = m.$.subTree && m.$.subTree.children;
529
- return C == null || !Array.isArray(C) ? !1 : C.some((b) => b.el === h.target || h.composedPath().includes(b.el));
527
+ function f(m, v) {
528
+ const g = H(m), k = g.$.subTree && g.$.subTree.children;
529
+ return k == null || !Array.isArray(k) ? !1 : k.some((C) => C.el === v.target || v.composedPath().includes(C.el));
530
530
  }
531
- const x = (w) => {
532
- const h = we(e);
533
- if (w.target != null && !(!(h instanceof Element) && f(e) && v(e, w)) && !(!h || h === w.target || w.composedPath().includes(h))) {
534
- if ("detail" in w && w.detail === 0 && (c = !s(w)), !c) {
535
- c = !0;
531
+ const w = (m) => {
532
+ const v = we(e);
533
+ if (m.target != null && !(!(v instanceof Element) && h(e) && f(e, m)) && !(!v || v === m.target || m.composedPath().includes(v))) {
534
+ if ("detail" in m && m.detail === 0 && (r = !s(m)), !r) {
535
+ r = !0;
536
536
  return;
537
537
  }
538
- t(w);
538
+ t(m);
539
539
  }
540
540
  };
541
- let I = !1;
542
- const P = [
543
- Ee(l, "click", (w) => {
544
- I || (I = !0, setTimeout(() => {
545
- I = !1;
546
- }, 0), x(w));
541
+ let L = !1;
542
+ const Z = [
543
+ Ee(l, "click", (m) => {
544
+ L || (L = !0, setTimeout(() => {
545
+ L = !1;
546
+ }, 0), w(m));
547
547
  }, {
548
548
  passive: !0,
549
- capture: a
549
+ capture: o
550
550
  }),
551
- Ee(l, "pointerdown", (w) => {
552
- const h = we(e);
553
- c = !s(w) && !!(h && !w.composedPath().includes(h));
551
+ Ee(l, "pointerdown", (m) => {
552
+ const v = we(e);
553
+ r = !s(m) && !!(v && !m.composedPath().includes(v));
554
554
  }, { passive: !0 }),
555
- o && Ee(l, "blur", (w) => {
555
+ a && Ee(l, "blur", (m) => {
556
556
  setTimeout(() => {
557
- var h;
558
- const m = we(e);
559
- ((h = l.document.activeElement) === null || h === void 0 ? void 0 : h.tagName) === "IFRAME" && !m?.contains(l.document.activeElement) && t(w);
557
+ var v;
558
+ const g = we(e);
559
+ ((v = l.document.activeElement) === null || v === void 0 ? void 0 : v.tagName) === "IFRAME" && !g?.contains(l.document.activeElement) && t(m);
560
560
  }, 0);
561
561
  }, { passive: !0 })
562
- ].filter(Boolean), R = () => P.forEach((w) => w());
563
- return r ? {
564
- stop: R,
562
+ ].filter(Boolean), y = () => Z.forEach((m) => m());
563
+ return c ? {
564
+ stop: y,
565
565
  cancel: () => {
566
- c = !1;
566
+ r = !1;
567
567
  },
568
- trigger: (w) => {
569
- c = !0, x(w), c = !1;
568
+ trigger: (m) => {
569
+ r = !0, w(m), r = !1;
570
570
  }
571
- } : R;
571
+ } : y;
572
572
  }
573
573
  // @__NO_SIDE_EFFECTS__
574
- function In() {
574
+ function An() {
575
575
  const e = re(!1), t = lt();
576
- return t && Ae(() => {
576
+ return t && Ie(() => {
577
577
  e.value = !0;
578
578
  }, t), e;
579
579
  }
580
580
  // @__NO_SIDE_EFFECTS__
581
581
  function Ht(e) {
582
- const t = /* @__PURE__ */ In();
583
- return $(() => (t.value, !!e()));
582
+ const t = /* @__PURE__ */ An();
583
+ return T(() => (t.value, !!e()));
584
584
  }
585
585
  function Lt(e, t, n = {}) {
586
586
  const { window: l = We, ...u } = n;
587
- let a;
588
- const o = /* @__PURE__ */ Ht(() => l && "MutationObserver" in l), r = () => {
589
- a && (a.disconnect(), a = void 0);
590
- }, c = ue($(() => {
591
- const v = Ye(H(e)).map(we).filter(pn);
592
- return new Set(v);
593
- }), (v) => {
594
- r(), o.value && v.size && (a = new MutationObserver(t), v.forEach((x) => a.observe(x, u)));
587
+ let o;
588
+ const a = /* @__PURE__ */ Ht(() => l && "MutationObserver" in l), c = () => {
589
+ o && (o.disconnect(), o = void 0);
590
+ }, r = ce(T(() => {
591
+ const f = je(H(e)).map(we).filter(yn);
592
+ return new Set(f);
593
+ }), (f) => {
594
+ c(), a.value && f.size && (o = new MutationObserver(t), f.forEach((w) => o.observe(w, u)));
595
595
  }, {
596
596
  immediate: !0,
597
597
  flush: "post"
598
- }), s = () => a?.takeRecords(), f = () => {
599
- c(), r();
598
+ }), s = () => o?.takeRecords(), h = () => {
599
+ r(), c();
600
600
  };
601
- return vt(f), {
602
- isSupported: o,
603
- stop: f,
601
+ return ft(h), {
602
+ isSupported: a,
603
+ stop: h,
604
604
  takeRecords: s
605
605
  };
606
606
  }
@@ -609,24 +609,24 @@ const Xe = {
609
609
  margin: 30,
610
610
  direction: "both"
611
611
  };
612
- function Sn(e) {
612
+ function Hn(e) {
613
613
  e.scrollLeft > e.scrollWidth - e.clientWidth && (e.scrollLeft = Math.max(0, e.scrollWidth - e.clientWidth)), e.scrollTop > e.scrollHeight - e.clientHeight && (e.scrollTop = Math.max(0, e.scrollHeight - e.clientHeight));
614
614
  }
615
615
  function _e(e, t = {}) {
616
- var n, l, u, a;
617
- const { pointerTypes: o, preventDefault: r, stopPropagation: c, exact: s, onMove: f, onEnd: v, onStart: x, initialValue: I, axis: P = "both", draggingElement: R = We, containerElement: w, handle: h = e, buttons: m = [0], restrictInView: C, autoScroll: b = !1 } = t, p = z((n = H(I)) !== null && n !== void 0 ? n : {
616
+ var n, l, u, o;
617
+ const { pointerTypes: a, preventDefault: c, stopPropagation: r, exact: s, onMove: h, onEnd: f, onStart: w, initialValue: L, axis: Z = "both", draggingElement: y = We, containerElement: m, handle: v = e, buttons: g = [0], restrictInView: k, autoScroll: C = !1 } = t, x = W((n = H(L)) !== null && n !== void 0 ? n : {
618
618
  x: 0,
619
619
  y: 0
620
- }), O = z(), j = (M) => o ? o.includes(M.pointerType) : !0, E = (M) => {
621
- H(r) && M.preventDefault(), H(c) && M.stopPropagation();
622
- }, Z = H(b), N = typeof Z == "object" ? {
623
- speed: (l = H(Z.speed)) !== null && l !== void 0 ? l : Xe.speed,
624
- margin: (u = H(Z.margin)) !== null && u !== void 0 ? u : Xe.margin,
625
- direction: (a = Z.direction) !== null && a !== void 0 ? a : Xe.direction
626
- } : Xe, q = (M) => typeof M == "number" ? [M, M] : [M.x, M.y], _ = (M, L, W) => {
627
- const { clientWidth: Q, clientHeight: X, scrollLeft: oe, scrollTop: ye, scrollWidth: Re, scrollHeight: T } = M, [V, Y] = q(N.margin), [G, K] = q(N.speed);
620
+ }), I = W(), X = (E) => a ? a.includes(E.pointerType) : !0, M = (E) => {
621
+ H(c) && E.preventDefault(), H(r) && E.stopPropagation();
622
+ }, V = H(C), N = typeof V == "object" ? {
623
+ speed: (l = H(V.speed)) !== null && l !== void 0 ? l : Xe.speed,
624
+ margin: (u = H(V.margin)) !== null && u !== void 0 ? u : Xe.margin,
625
+ direction: (o = V.direction) !== null && o !== void 0 ? o : Xe.direction
626
+ } : Xe, q = (E) => typeof E == "number" ? [E, E] : [E.x, E.y], ee = (E, D, F) => {
627
+ const { clientWidth: Q, clientHeight: G, scrollLeft: oe, scrollTop: xe, scrollWidth: Re, scrollHeight: $ } = E, [B, j] = q(N.margin), [U, K] = q(N.speed);
628
628
  let te = 0, le = 0;
629
- (N.direction === "x" || N.direction === "both") && (W.x < V && oe > 0 ? te = -G : W.x + L.width > Q - V && oe < Re - Q && (te = G)), (N.direction === "y" || N.direction === "both") && (W.y < Y && ye > 0 ? le = -K : W.y + L.height > X - Y && ye < T - X && (le = K)), (te || le) && M.scrollBy({
629
+ (N.direction === "x" || N.direction === "both") && (F.x < B && oe > 0 ? te = -U : F.x + D.width > Q - B && oe < Re - Q && (te = U)), (N.direction === "y" || N.direction === "both") && (F.y < j && xe > 0 ? le = -K : F.y + D.height > G - j && xe < $ - G && (le = K)), (te || le) && E.scrollBy({
630
630
  left: te,
631
631
  top: le,
632
632
  behavior: "auto"
@@ -634,175 +634,570 @@ function _e(e, t = {}) {
634
634
  };
635
635
  let ne = null;
636
636
  const ge = () => {
637
- const M = H(w);
638
- M && !ne && (ne = setInterval(() => {
639
- const L = H(e).getBoundingClientRect(), { x: W, y: Q } = p.value, X = {
640
- x: W - M.scrollLeft,
641
- y: Q - M.scrollTop
637
+ const E = H(m);
638
+ E && !ne && (ne = setInterval(() => {
639
+ const D = H(e).getBoundingClientRect(), { x: F, y: Q } = x.value, G = {
640
+ x: F - E.scrollLeft,
641
+ y: Q - E.scrollTop
642
642
  };
643
- X.x >= 0 && X.y >= 0 && (_(M, L, X), X.x += M.scrollLeft, X.y += M.scrollTop, p.value = X);
643
+ G.x >= 0 && G.y >= 0 && (ee(E, D, G), G.x += E.scrollLeft, G.y += E.scrollTop, x.value = G);
644
644
  }, 1e3 / 60));
645
- }, ve = () => {
645
+ }, fe = () => {
646
646
  ne && (clearInterval(ne), ne = null);
647
- }, Oe = (M, L, W, Q) => {
648
- const [X, oe] = typeof W == "number" ? [W, W] : [W.x, W.y], { clientWidth: ye, clientHeight: Re } = L;
649
- return M.x < X || M.x + Q.width > ye - X || M.y < oe || M.y + Q.height > Re - oe;
647
+ }, Oe = (E, D, F, Q) => {
648
+ const [G, oe] = typeof F == "number" ? [F, F] : [F.x, F.y], { clientWidth: xe, clientHeight: Re } = D;
649
+ return E.x < G || E.x + Q.width > xe - G || E.y < oe || E.y + Q.height > Re - oe;
650
650
  }, Ve = () => {
651
- if (H(t.disabled) || !O.value) return;
652
- const M = H(w);
653
- if (!M) return;
654
- const L = H(e).getBoundingClientRect(), { x: W, y: Q } = p.value;
651
+ if (H(t.disabled) || !I.value) return;
652
+ const E = H(m);
653
+ if (!E) return;
654
+ const D = H(e).getBoundingClientRect(), { x: F, y: Q } = x.value;
655
655
  Oe({
656
- x: W - M.scrollLeft,
657
- y: Q - M.scrollTop
658
- }, M, N.margin, L) ? ge() : ve();
656
+ x: F - E.scrollLeft,
657
+ y: Q - E.scrollTop
658
+ }, E, N.margin, D) ? ge() : fe();
659
659
  };
660
- H(b) && ue(p, Ve);
661
- const Be = (M) => {
662
- var L;
663
- if (!H(m).includes(M.button) || H(t.disabled) || !j(M) || H(s) && M.target !== H(e)) return;
664
- const W = H(w), Q = W == null || (L = W.getBoundingClientRect) === null || L === void 0 ? void 0 : L.call(W), X = H(e).getBoundingClientRect(), oe = {
665
- x: M.clientX - (W ? X.left - Q.left + (b ? 0 : W.scrollLeft) : X.left),
666
- y: M.clientY - (W ? X.top - Q.top + (b ? 0 : W.scrollTop) : X.top)
660
+ H(C) && ce(x, Ve);
661
+ const Be = (E) => {
662
+ var D;
663
+ if (!H(g).includes(E.button) || H(t.disabled) || !X(E) || H(s) && E.target !== H(e)) return;
664
+ const F = H(m), Q = F == null || (D = F.getBoundingClientRect) === null || D === void 0 ? void 0 : D.call(F), G = H(e).getBoundingClientRect(), oe = {
665
+ x: E.clientX - (F ? G.left - Q.left + (C ? 0 : F.scrollLeft) : G.left),
666
+ y: E.clientY - (F ? G.top - Q.top + (C ? 0 : F.scrollTop) : G.top)
667
667
  };
668
- x?.(oe, M) !== !1 && (O.value = oe, E(M));
669
- }, Pe = (M) => {
670
- if (H(t.disabled) || !j(M) || !O.value) return;
671
- const L = H(w);
672
- L instanceof HTMLElement && Sn(L);
673
- const W = H(e).getBoundingClientRect();
674
- let { x: Q, y: X } = p.value;
675
- if ((P === "x" || P === "both") && (Q = M.clientX - O.value.x, L && (Q = Math.min(Math.max(0, Q), L.scrollWidth - W.width))), (P === "y" || P === "both") && (X = M.clientY - O.value.y, L && (X = Math.min(Math.max(0, X), L.scrollHeight - W.height))), H(b) && L && (ne === null && _(L, W, {
668
+ w?.(oe, E) !== !1 && (I.value = oe, M(E));
669
+ }, Pe = (E) => {
670
+ if (H(t.disabled) || !X(E) || !I.value) return;
671
+ const D = H(m);
672
+ D instanceof HTMLElement && Hn(D);
673
+ const F = H(e).getBoundingClientRect();
674
+ let { x: Q, y: G } = x.value;
675
+ if ((Z === "x" || Z === "both") && (Q = E.clientX - I.value.x, D && (Q = Math.min(Math.max(0, Q), D.scrollWidth - F.width))), (Z === "y" || Z === "both") && (G = E.clientY - I.value.y, D && (G = Math.min(Math.max(0, G), D.scrollHeight - F.height))), H(C) && D && (ne === null && ee(D, F, {
676
676
  x: Q,
677
- y: X
678
- }), Q += L.scrollLeft, X += L.scrollTop), L && (C || b)) {
679
- if (P !== "y") {
680
- const oe = Q - L.scrollLeft;
681
- oe < 0 ? Q = L.scrollLeft : oe > L.clientWidth - W.width && (Q = L.clientWidth - W.width + L.scrollLeft);
677
+ y: G
678
+ }), Q += D.scrollLeft, G += D.scrollTop), D && (k || C)) {
679
+ if (Z !== "y") {
680
+ const oe = Q - D.scrollLeft;
681
+ oe < 0 ? Q = D.scrollLeft : oe > D.clientWidth - F.width && (Q = D.clientWidth - F.width + D.scrollLeft);
682
682
  }
683
- if (P !== "x") {
684
- const oe = X - L.scrollTop;
685
- oe < 0 ? X = L.scrollTop : oe > L.clientHeight - W.height && (X = L.clientHeight - W.height + L.scrollTop);
683
+ if (Z !== "x") {
684
+ const oe = G - D.scrollTop;
685
+ oe < 0 ? G = D.scrollTop : oe > D.clientHeight - F.height && (G = D.clientHeight - F.height + D.scrollTop);
686
686
  }
687
687
  }
688
- p.value = {
688
+ x.value = {
689
689
  x: Q,
690
- y: X
691
- }, f?.(p.value, M), E(M);
692
- }, He = (M) => {
693
- H(t.disabled) || !j(M) || O.value && (O.value = void 0, b && ve(), v?.(p.value, M), E(M));
690
+ y: G
691
+ }, h?.(x.value, E), M(E);
692
+ }, He = (E) => {
693
+ H(t.disabled) || !X(E) || I.value && (I.value = void 0, C && fe(), f?.(x.value, E), M(E));
694
694
  };
695
695
  if (At) {
696
- const M = () => {
697
- var L;
696
+ const E = () => {
697
+ var D;
698
698
  return {
699
- capture: (L = t.capture) !== null && L !== void 0 ? L : !0,
700
- passive: !H(r)
699
+ capture: (D = t.capture) !== null && D !== void 0 ? D : !0,
700
+ passive: !H(c)
701
701
  };
702
702
  };
703
- Ee(h, "pointerdown", Be, M), Ee(R, "pointermove", Pe, M), Ee(R, "pointerup", He, M);
703
+ Ee(v, "pointerdown", Be, E), Ee(y, "pointermove", Pe, E), Ee(y, "pointerup", He, E);
704
704
  }
705
705
  return {
706
- ...En(p),
707
- position: p,
708
- isDragging: $(() => !!O.value),
709
- style: $(() => `
710
- left: ${p.value.x}px;
711
- top: ${p.value.y}px;
712
- ${b ? "text-wrap: nowrap;" : ""}
706
+ ...Sn(x),
707
+ position: x,
708
+ isDragging: T(() => !!I.value),
709
+ style: T(() => `
710
+ left: ${x.value.x}px;
711
+ top: ${x.value.y}px;
712
+ ${C ? "text-wrap: nowrap;" : ""}
713
713
  `)
714
714
  };
715
715
  }
716
- function Je(e, t, n = {}) {
716
+ function qe(e, t, n = {}) {
717
717
  const { window: l = We, ...u } = n;
718
- let a;
719
- const o = /* @__PURE__ */ Ht(() => l && "ResizeObserver" in l), r = () => {
720
- a && (a.disconnect(), a = void 0);
721
- }, c = ue($(() => {
722
- const f = H(e);
723
- return Array.isArray(f) ? f.map((v) => we(v)) : [we(f)];
724
- }), (f) => {
725
- if (r(), o.value && l) {
726
- a = new ResizeObserver(t);
727
- for (const v of f) v && a.observe(v, u);
718
+ let o;
719
+ const a = /* @__PURE__ */ Ht(() => l && "ResizeObserver" in l), c = () => {
720
+ o && (o.disconnect(), o = void 0);
721
+ }, r = ce(T(() => {
722
+ const h = H(e);
723
+ return Array.isArray(h) ? h.map((f) => we(f)) : [we(h)];
724
+ }), (h) => {
725
+ if (c(), a.value && l) {
726
+ o = new ResizeObserver(t);
727
+ for (const f of h) f && o.observe(f, u);
728
728
  }
729
729
  }, {
730
730
  immediate: !0,
731
731
  flush: "post"
732
732
  }), s = () => {
733
- r(), c();
733
+ c(), r();
734
734
  };
735
- return vt(s), {
736
- isSupported: o,
735
+ return ft(s), {
736
+ isSupported: a,
737
737
  stop: s
738
738
  };
739
739
  }
740
740
  function Te(e, t = {}) {
741
- const { reset: n = !0, windowResize: l = !0, windowScroll: u = !0, immediate: a = !0, updateTiming: o = "sync" } = t, r = re(0), c = re(0), s = re(0), f = re(0), v = re(0), x = re(0), I = re(0), P = re(0);
742
- function R() {
743
- const h = we(e);
744
- if (!h) {
745
- n && (r.value = 0, c.value = 0, s.value = 0, f.value = 0, v.value = 0, x.value = 0, I.value = 0, P.value = 0);
741
+ const { reset: n = !0, windowResize: l = !0, windowScroll: u = !0, immediate: o = !0, updateTiming: a = "sync" } = t, c = re(0), r = re(0), s = re(0), h = re(0), f = re(0), w = re(0), L = re(0), Z = re(0);
742
+ function y() {
743
+ const v = we(e);
744
+ if (!v) {
745
+ n && (c.value = 0, r.value = 0, s.value = 0, h.value = 0, f.value = 0, w.value = 0, L.value = 0, Z.value = 0);
746
746
  return;
747
747
  }
748
- const m = h.getBoundingClientRect();
749
- r.value = m.height, c.value = m.bottom, s.value = m.left, f.value = m.right, v.value = m.top, x.value = m.width, I.value = m.x, P.value = m.y;
748
+ const g = v.getBoundingClientRect();
749
+ c.value = g.height, r.value = g.bottom, s.value = g.left, h.value = g.right, f.value = g.top, w.value = g.width, L.value = g.x, Z.value = g.y;
750
750
  }
751
- function w() {
752
- o === "sync" ? R() : o === "next-frame" && requestAnimationFrame(() => R());
751
+ function m() {
752
+ a === "sync" ? y() : a === "next-frame" && requestAnimationFrame(() => y());
753
753
  }
754
- return Je(e, w), ue(() => we(e), (h) => !h && w()), Lt(e, w, { attributeFilter: ["style", "class"] }), u && Ee("scroll", w, {
754
+ return qe(e, m), ce(() => we(e), (v) => !v && m()), Lt(e, m, { attributeFilter: ["style", "class"] }), u && Ee("scroll", m, {
755
755
  capture: !0,
756
756
  passive: !0
757
- }), l && Ee("resize", w, { passive: !0 }), $n(() => {
758
- a && w();
757
+ }), l && Ee("resize", m, { passive: !0 }), $n(() => {
758
+ o && m();
759
759
  }), {
760
- height: r,
761
- bottom: c,
760
+ height: c,
761
+ bottom: r,
762
762
  left: s,
763
- right: f,
764
- top: v,
765
- width: x,
766
- x: I,
767
- y: P,
768
- update: w
763
+ right: h,
764
+ top: f,
765
+ width: w,
766
+ x: L,
767
+ y: Z,
768
+ update: m
769
769
  };
770
770
  }
771
771
  function et(e) {
772
772
  return typeof Window < "u" && e instanceof Window ? e.document.documentElement : typeof Document < "u" && e instanceof Document ? e.documentElement : e;
773
773
  }
774
774
  const tt = /* @__PURE__ */ new WeakMap();
775
- function An(e, t = !1) {
775
+ function Ln(e, t = !1) {
776
776
  const n = re(t);
777
777
  let l = "";
778
- ue(bn(e), (o) => {
779
- const r = et(H(o));
780
- if (r) {
781
- const c = r;
782
- if (tt.get(c) || tt.set(c, c.style.overflow), c.style.overflow !== "hidden" && (l = c.style.overflow), c.style.overflow === "hidden") return n.value = !0;
783
- if (n.value) return c.style.overflow = "hidden";
778
+ ce(kn(e), (a) => {
779
+ const c = et(H(a));
780
+ if (c) {
781
+ const r = c;
782
+ if (tt.get(r) || tt.set(r, r.style.overflow), r.style.overflow !== "hidden" && (l = r.style.overflow), r.style.overflow === "hidden") return n.value = !0;
783
+ if (n.value) return r.style.overflow = "hidden";
784
784
  }
785
785
  }, { immediate: !0 });
786
786
  const u = () => {
787
- const o = et(H(e));
788
- !o || n.value || (o.style.overflow = "hidden", n.value = !0);
789
- }, a = () => {
790
- const o = et(H(e));
791
- !o || !n.value || (o.style.overflow = l, tt.delete(o), n.value = !1);
787
+ const a = et(H(e));
788
+ !a || n.value || (a.style.overflow = "hidden", n.value = !0);
789
+ }, o = () => {
790
+ const a = et(H(e));
791
+ !a || !n.value || (a.style.overflow = l, tt.delete(a), n.value = !1);
792
792
  };
793
- return vt(a), $({
793
+ return ft(o), T({
794
794
  get() {
795
795
  return n.value;
796
796
  },
797
- set(o) {
798
- o ? u() : a();
797
+ set(a) {
798
+ a ? u() : o();
799
799
  }
800
800
  });
801
801
  }
802
- const Hn = (e) => {
802
+ const Dt = {
803
+ ATextInput: "text",
804
+ ATextarea: "text",
805
+ ANumericInput: "number",
806
+ ACheckbox: "boolean",
807
+ ADate: "date",
808
+ ADatePicker: "date",
809
+ ADateSelection: "date",
810
+ ADateTime: "datetime",
811
+ ADuration: "text",
812
+ ADateRange: "date",
813
+ ADropdown: "select",
814
+ ACodeEditor: "code",
815
+ AFormLink: "link",
816
+ AFileAttach: "attach"
817
+ };
818
+ function Ot(e) {
819
+ return e ? Dt[e] : void 0;
820
+ }
821
+ const Dn = {
822
+ AFormLink: "inline",
823
+ AForm: "expand",
824
+ ATable: "expand"
825
+ };
826
+ [
827
+ .../* @__PURE__ */ new Set([...Object.keys(Dt), ...Object.keys(Dn)])
828
+ ].toSorted();
829
+ const On = (e) => {
803
830
  const t = new DOMParser().parseFromString(e, "text/html");
804
831
  return Array.from(t.body.childNodes).some((n) => n.nodeType === 1);
805
- }, Ln = (e = 8) => Array.from({ length: e }, () => Math.floor(Math.random() * 16).toString(16)).join(""), Dn = ["data-colindex", "data-rowindex", "data-editable", "contenteditable", "tabindex"], On = ["innerHTML"], Vn = { key: 2 }, Bn = /* @__PURE__ */ xe({
832
+ }, Vn = (e = 8) => Array.from({ length: e }, () => Math.floor(Math.random() * 16).toString(16)).join("");
833
+ function Vt(e, t) {
834
+ const n = t[e];
835
+ if (n.isRoot || n.parent === null || n.parent === void 0)
836
+ return !0;
837
+ const l = n.parent;
838
+ return l < 0 || l >= t.length ? !1 : (t[l].childrenOpen || !1) && Vt(l, t);
839
+ }
840
+ function Bn(e, t, n) {
841
+ const l = n.filterType || "text", u = t.value;
842
+ if (!u && l !== "dateRange" && l !== "checkbox") return !0;
843
+ switch (l) {
844
+ case "text":
845
+ return (typeof e == "object" && e !== null ? Object.values(e).join(" ") : String(e || "")).toLowerCase().includes(String(u).toLowerCase());
846
+ case "number": {
847
+ const o = Number(e), a = Number(u);
848
+ return !isNaN(o) && !isNaN(a) && o === a;
849
+ }
850
+ case "select":
851
+ return e === u;
852
+ case "checkbox":
853
+ return u === !0 ? !!e : !0;
854
+ case "date": {
855
+ let o;
856
+ if (typeof e == "number") {
857
+ const c = new Date(e), r = (/* @__PURE__ */ new Date()).getFullYear();
858
+ o = new Date(r, c.getMonth(), c.getDate());
859
+ } else
860
+ o = new Date(String(e));
861
+ const a = new Date(String(u));
862
+ return o.toDateString() === a.toDateString();
863
+ }
864
+ case "dateRange": {
865
+ const o = t.startValue, a = t.endValue;
866
+ if (!o && !a) return !0;
867
+ let c;
868
+ if (typeof e == "number") {
869
+ const r = new Date(e), s = (/* @__PURE__ */ new Date()).getFullYear();
870
+ c = new Date(s, r.getMonth(), r.getDate());
871
+ } else
872
+ c = new Date(String(e));
873
+ return !(o && c < new Date(String(o)) || a && c > new Date(String(a)));
874
+ }
875
+ default:
876
+ return !0;
877
+ }
878
+ }
879
+ function Pn(e, t) {
880
+ return t && e === 0 && t > 0 ? `${t}ch` : "inherit";
881
+ }
882
+ const Zn = (e) => {
883
+ const t = e.id || Vn(), n = e.linkResolver ?? null;
884
+ return _t(`table-${t}`, () => {
885
+ const u = () => {
886
+ const i = [Object.assign({}, { rowModified: !1 })], d = /* @__PURE__ */ new Set();
887
+ for (let O = 0; O < a.value.length; O++) {
888
+ const S = a.value[O];
889
+ S.parent !== null && S.parent !== void 0 && d.add(S.parent);
890
+ }
891
+ const p = (O) => a.value[O]?.gantt !== void 0, A = (O) => {
892
+ for (let S = 0; S < a.value.length; S++)
893
+ if (a.value[S].parent === O && (p(S) || A(S)))
894
+ return !0;
895
+ return !1;
896
+ }, J = (O) => {
897
+ const S = c.value, Y = S.view === "tree" || S.view === "tree-gantt" ? S.defaultTreeExpansion : void 0;
898
+ if (!Y) return !0;
899
+ switch (Y) {
900
+ case "root":
901
+ return !1;
902
+ // Only root nodes are visible, all children start collapsed
903
+ case "branch":
904
+ return A(O);
905
+ case "leaf":
906
+ return !0;
907
+ // All nodes should be expanded
908
+ default:
909
+ return !0;
910
+ }
911
+ };
912
+ for (let O = 0; O < a.value.length; O++) {
913
+ const S = a.value[O], Y = S.parent === null || S.parent === void 0, ie = d.has(O);
914
+ i[O] = {
915
+ childrenOpen: J(O),
916
+ expanded: !1,
917
+ indent: S.indent || 0,
918
+ isParent: ie,
919
+ isRoot: Y,
920
+ rowModified: !1,
921
+ open: Y,
922
+ // This will be recalculated later for non-root nodes
923
+ parent: S.parent
924
+ };
925
+ }
926
+ return i;
927
+ }, o = W(e.columns), a = W(e.rows), c = W(e.config || {}), r = W({}), s = W({}), h = T(() => {
928
+ const i = {};
929
+ for (const [d, p] of o.value.entries())
930
+ for (const [A, J] of a.value.entries())
931
+ i[`${d}:${A}`] = J[p.name];
932
+ return i;
933
+ }), f = T({
934
+ get: () => {
935
+ const i = u();
936
+ for (let d = 0; d < i.length; d++)
937
+ r.value[d] && (i[d].rowModified = r.value[d]), s.value[d] && (s.value[d].childrenOpen !== void 0 && (i[d].childrenOpen = s.value[d].childrenOpen), s.value[d].expanded !== void 0 && (i[d].expanded = s.value[d].expanded));
938
+ if (x.value)
939
+ for (let d = 0; d < i.length; d++)
940
+ i[d].isRoot || (i[d].open = Vt(d, i));
941
+ return i;
942
+ },
943
+ set: (i) => {
944
+ JSON.stringify(i) !== JSON.stringify(f.value) && (f.value = i);
945
+ }
946
+ }), w = W(e.modal || { visible: !1 }), L = W({}), Z = W([]), y = W([]), m = W([]), v = W({
947
+ column: null,
948
+ direction: null
949
+ }), g = W({}), k = T(() => o.value.some((i) => i.pinned)), C = T(() => c.value.view === "gantt" || c.value.view === "tree-gantt"), x = T(() => c.value.view === "tree" || c.value.view === "tree-gantt"), I = T(() => {
950
+ const i = c.value;
951
+ return i.view === "gantt" || i.view === "tree-gantt" ? i.dependencyGraph !== !1 : !0;
952
+ }), X = T(() => `${Math.ceil(a.value.length / 100 + 1)}ch`), M = T(
953
+ () => c.value.view ? ["list", "tree", "tree-gantt", "list-expansion"].includes(c.value.view) : !1
954
+ ), V = T(() => {
955
+ let i = a.value.map((d, p) => ({
956
+ ...d,
957
+ originalIndex: p
958
+ }));
959
+ if (Object.entries(g.value).forEach(([d, p]) => {
960
+ const A = parseInt(d), J = o.value[A];
961
+ !J || !(p.value || p.startValue || p.endValue || J.filterType === "checkbox" && p.value !== void 0) || (i = i.filter((S) => {
962
+ const Y = S[J.name];
963
+ return Bn(Y, p, J);
964
+ }));
965
+ }), v.value.column !== null && v.value.direction) {
966
+ const d = o.value[v.value.column], p = v.value.direction;
967
+ i.sort((A, J) => {
968
+ let O = A[d.name], S = J[d.name];
969
+ O == null && (O = ""), S == null && (S = "");
970
+ const Y = Number(O), ie = Number(S);
971
+ if (!isNaN(Y) && !isNaN(ie) && O !== "" && S !== "")
972
+ return p === "asc" ? Y - ie : ie - Y;
973
+ {
974
+ const ht = String(O).toLowerCase(), mt = String(S).toLowerCase();
975
+ return p === "asc" ? ht.localeCompare(mt) : mt.localeCompare(ht);
976
+ }
977
+ });
978
+ }
979
+ return i;
980
+ }), N = (i, d) => h.value[`${i}:${d}`], q = (i, d, p) => {
981
+ const A = `${i}:${d}`, J = o.value[i];
982
+ h.value[A] !== p && (r.value[d] = !0), h.value[A] = p, a.value[d] = {
983
+ ...a.value[d],
984
+ [J.name]: p
985
+ };
986
+ }, ee = (i) => {
987
+ a.value = i;
988
+ }, ne = (i, d, p) => {
989
+ const A = `${i}:${d}`;
990
+ h.value[A] !== p && (r.value[d] = !0, L.value[A] = p);
991
+ }, ge = (i) => {
992
+ const d = o.value.indexOf(i) === o.value.length - 1, p = c.value.fullWidth ? i.resizable && !d : i.resizable;
993
+ return {
994
+ width: i.width || "40ch",
995
+ textAlign: i.align || "center",
996
+ ...p && {
997
+ resize: "horizontal",
998
+ overflow: "hidden",
999
+ whiteSpace: "nowrap"
1000
+ }
1001
+ };
1002
+ }, fe = (i, d) => {
1003
+ if (i < 0 || i >= o.value.length) return;
1004
+ const A = Math.max(d, 40);
1005
+ o.value[i] = {
1006
+ ...o.value[i],
1007
+ width: `${A}px`
1008
+ };
1009
+ }, Oe = (i) => {
1010
+ const d = a.value[i];
1011
+ return C.value && d.gantt !== void 0;
1012
+ }, Ve = (i) => !x.value || f.value[i].isRoot || f.value[i].open, Be = (i) => !x.value && c.value.view !== "list-expansion" ? "" : x.value && (f.value[i].isRoot || f.value[i].isParent) ? f.value[i].childrenOpen ? "▼" : "►" : c.value.view === "list-expansion" ? f.value[i].expanded ? "▼" : "►" : "", Pe = (i) => {
1013
+ if (x.value) {
1014
+ const d = s.value[i] || {}, A = !(d.childrenOpen ?? f.value[i].childrenOpen);
1015
+ s.value[i] = {
1016
+ ...d,
1017
+ childrenOpen: A
1018
+ }, A || He(i);
1019
+ } else if (c.value.view === "list-expansion") {
1020
+ const d = s.value[i] || {}, p = d.expanded ?? f.value[i].expanded;
1021
+ s.value[i] = {
1022
+ ...d,
1023
+ expanded: !p
1024
+ };
1025
+ }
1026
+ }, He = (i) => {
1027
+ for (let d = 0; d < a.value.length; d++)
1028
+ if (f.value[d].parent === i) {
1029
+ const p = s.value[d] || {};
1030
+ s.value[d] = {
1031
+ ...p,
1032
+ childrenOpen: !1
1033
+ }, He(d);
1034
+ }
1035
+ }, E = (i, d) => {
1036
+ const p = N(i, d);
1037
+ return D(i, d, p);
1038
+ }, D = (i, d, p) => {
1039
+ const A = o.value[i], J = a.value[d], O = A.format;
1040
+ if (!O) {
1041
+ const S = Ot(A.component);
1042
+ return S === "boolean" ? p ? "✓" : "✗" : S === "date" ? p != null ? new Date(String(p)).toLocaleDateString() : p : S === "datetime" && p != null ? new Date(String(p)).toLocaleString() : p;
1043
+ }
1044
+ return typeof O == "function" ? O(p, { table: h.value, row: J, column: A }) : typeof O == "string" ? Function(`"use strict";return (${O})`)()(p, { table: h.value, row: J, column: A }) : p;
1045
+ }, F = (i) => {
1046
+ i.target instanceof Node && w.value.parent?.contains(i.target) || w.value.visible && (w.value.visible = !1);
1047
+ }, Q = (i) => {
1048
+ const d = a.value[i.rowIndex]?.gantt;
1049
+ d && (i.type === "resize" ? i.edge === "start" ? (d.startIndex = i.newStart, d.endIndex = i.end, d.colspan = d.endIndex - d.startIndex) : i.edge === "end" && (d.startIndex = i.start, d.endIndex = i.newEnd, d.colspan = d.endIndex - d.startIndex) : i.type === "bar" && (d.startIndex = i.newStart, d.endIndex = i.newEnd, d.colspan = d.endIndex - d.startIndex));
1050
+ }, G = (i) => {
1051
+ const d = Z.value.findIndex((p) => p.id === i.id);
1052
+ d >= 0 ? Z.value[d] = i : Z.value.push(i);
1053
+ }, oe = (i) => {
1054
+ const d = Z.value.findIndex((p) => p.id === i);
1055
+ d >= 0 && Z.value.splice(d, 1);
1056
+ }, xe = (i) => {
1057
+ const d = y.value.findIndex((p) => p.id === i.id);
1058
+ d >= 0 ? y.value[d] = i : y.value.push(i);
1059
+ }, Re = (i) => {
1060
+ const d = y.value.findIndex((p) => p.id === i);
1061
+ d >= 0 && y.value.splice(d, 1);
1062
+ }, $ = (i, d, p) => {
1063
+ const A = y.value.find((S) => S.id === i), J = y.value.find((S) => S.id === d);
1064
+ if (!A || !J)
1065
+ return console.warn("Cannot create connection: handle not found"), null;
1066
+ const O = {
1067
+ id: `connection-${i}-${d}`,
1068
+ from: {
1069
+ barId: A.barId,
1070
+ side: A.side
1071
+ },
1072
+ to: {
1073
+ barId: J.barId,
1074
+ side: J.side
1075
+ },
1076
+ style: p?.style,
1077
+ label: p?.label
1078
+ };
1079
+ return m.value.push(O), O;
1080
+ }, B = (i) => {
1081
+ const d = m.value.findIndex((p) => p.id === i);
1082
+ return d >= 0 ? (m.value.splice(d, 1), !0) : !1;
1083
+ }, j = (i) => m.value.filter((d) => d.from.barId === i || d.to.barId === i), U = (i) => y.value.filter((d) => d.barId === i), K = (i) => {
1084
+ if (o.value[i].sortable === !1) return;
1085
+ let p;
1086
+ v.value.column === i && v.value.direction === "asc" ? p = "desc" : p = "asc", v.value.column = i, v.value.direction = p;
1087
+ }, te = (i, d) => {
1088
+ !d.value && !d.startValue && !d.endValue ? delete g.value[i] : g.value[i] = d;
1089
+ }, le = (i) => {
1090
+ delete g.value[i];
1091
+ }, se = (i, d = "end") => {
1092
+ const p = {};
1093
+ for (const J of o.value)
1094
+ p[J.name] = "";
1095
+ i && Object.assign(p, i);
1096
+ let A;
1097
+ return d === "start" ? (A = 0, a.value.unshift(p)) : d === "end" ? (A = a.value.length, a.value.push(p)) : (A = Math.max(0, Math.min(d, a.value.length)), a.value.splice(A, 0, p)), A;
1098
+ };
1099
+ return {
1100
+ // state
1101
+ columns: o,
1102
+ config: c,
1103
+ connectionHandles: y,
1104
+ connectionPaths: m,
1105
+ display: f,
1106
+ filterState: g,
1107
+ ganttBars: Z,
1108
+ modal: w,
1109
+ rows: a,
1110
+ sortState: v,
1111
+ table: h,
1112
+ updates: L,
1113
+ // getters
1114
+ filteredRows: V,
1115
+ hasPinnedColumns: k,
1116
+ isGanttView: C,
1117
+ isTreeView: x,
1118
+ isDependencyGraphEnabled: I,
1119
+ numberedRowWidth: X,
1120
+ zeroColumn: M,
1121
+ // resolver
1122
+ linkResolver: n,
1123
+ // actions
1124
+ addRow: se,
1125
+ clearFilter: le,
1126
+ closeModal: F,
1127
+ createConnection: $,
1128
+ deleteConnection: B,
1129
+ deleteRow: (i) => {
1130
+ if (i < 0 || i >= a.value.length)
1131
+ return null;
1132
+ const [d] = a.value.splice(i, 1);
1133
+ delete r.value[i], delete s.value[i];
1134
+ const p = {}, A = {};
1135
+ for (const [J, O] of Object.entries(r.value)) {
1136
+ const S = parseInt(J);
1137
+ S > i ? p[S - 1] = O : p[S] = O;
1138
+ }
1139
+ for (const [J, O] of Object.entries(s.value)) {
1140
+ const S = parseInt(J);
1141
+ S > i ? A[S - 1] = O : A[S] = O;
1142
+ }
1143
+ return r.value = p, s.value = A, d;
1144
+ },
1145
+ duplicateRow: (i) => {
1146
+ if (i < 0 || i >= a.value.length)
1147
+ return -1;
1148
+ const d = a.value[i], p = JSON.parse(JSON.stringify(d)), A = i + 1;
1149
+ return a.value.splice(A, 0, p), A;
1150
+ },
1151
+ getCellData: N,
1152
+ getCellDisplayValue: E,
1153
+ getConnectionsForBar: j,
1154
+ getFormattedValue: D,
1155
+ getHandlesForBar: U,
1156
+ getHeaderCellStyle: ge,
1157
+ getRowExpandSymbol: Be,
1158
+ insertRowAbove: (i, d) => {
1159
+ const p = Math.max(0, i);
1160
+ return se(d, p);
1161
+ },
1162
+ insertRowBelow: (i, d) => {
1163
+ const p = Math.min(i + 1, a.value.length);
1164
+ return se(d, p);
1165
+ },
1166
+ isRowGantt: Oe,
1167
+ isRowVisible: Ve,
1168
+ moveRow: (i, d) => {
1169
+ if (i < 0 || i >= a.value.length || d < 0 || d >= a.value.length || i === d)
1170
+ return !1;
1171
+ const [p] = a.value.splice(i, 1);
1172
+ a.value.splice(d, 0, p);
1173
+ const A = {}, J = {};
1174
+ for (const [O, S] of Object.entries(r.value)) {
1175
+ const Y = parseInt(O);
1176
+ let ie = Y;
1177
+ Y === i ? ie = d : i < d ? Y > i && Y <= d && (ie = Y - 1) : Y >= d && Y < i && (ie = Y + 1), A[ie] = S;
1178
+ }
1179
+ for (const [O, S] of Object.entries(s.value)) {
1180
+ const Y = parseInt(O);
1181
+ let ie = Y;
1182
+ Y === i ? ie = d : i < d ? Y > i && Y <= d && (ie = Y - 1) : Y >= d && Y < i && (ie = Y + 1), J[ie] = S;
1183
+ }
1184
+ return r.value = A, s.value = J, !0;
1185
+ },
1186
+ registerConnectionHandle: xe,
1187
+ registerGanttBar: G,
1188
+ resizeColumn: fe,
1189
+ setCellData: q,
1190
+ setCellText: ne,
1191
+ setFilter: te,
1192
+ sortByColumn: K,
1193
+ toggleRowExpand: Pe,
1194
+ unregisterConnectionHandle: Re,
1195
+ unregisterGanttBar: oe,
1196
+ updateGanttBar: Q,
1197
+ updateRows: ee
1198
+ };
1199
+ })();
1200
+ }, Nn = ["data-colindex", "data-rowindex", "data-editable", "contenteditable", "tabindex"], Fn = ["innerHTML"], Wn = { key: 2 }, zn = /* @__PURE__ */ Ce({
806
1201
  __name: "ACell",
807
1202
  props: {
808
1203
  colIndex: {},
@@ -814,195 +1209,138 @@ const Hn = (e) => {
814
1209
  debounce: { default: 300 }
815
1210
  },
816
1211
  setup(e, { expose: t }) {
817
- const n = ce("cell"), l = e.store.getCellData(e.colIndex, e.rowIndex), u = z(""), a = z(!1), o = e.store.columns[e.colIndex], r = e.store.rows[e.rowIndex], c = o.align || "center", s = o.width || "40ch", f = $(() => e.store.getCellDisplayValue(e.colIndex, e.rowIndex)), v = z(null);
818
- Ae(() => {
819
- if (!o.linkDoctype) return;
820
- const E = e.store.getCellData(e.colIndex, e.rowIndex);
821
- if (E != null && typeof E == "object") {
822
- const N = E, q = N.displayText ?? N.id;
823
- (typeof q == "string" || typeof q == "number") && (v.value = String(q));
1212
+ const n = de("cell"), l = e.store.getCellData(e.colIndex, e.rowIndex), u = W(""), o = W(!1), a = e.store.columns[e.colIndex], c = e.store.rows[e.rowIndex], r = a.align || "center", s = a.width || "40ch", h = T(() => e.store.getCellDisplayValue(e.colIndex, e.rowIndex)), f = W(null);
1213
+ Ie(() => {
1214
+ if (!a.linkDoctype) return;
1215
+ const M = e.store.getCellData(e.colIndex, e.rowIndex);
1216
+ if (M != null && typeof M == "object") {
1217
+ const N = M, q = N.displayText ?? N.id;
1218
+ (typeof q == "string" || typeof q == "number") && (f.value = String(q));
824
1219
  return;
825
1220
  }
826
- const Z = e.store.linkResolver;
827
- !Z || typeof E != "string" || E === "" || Z(o.linkDoctype, E).then((N) => (N != null && (v.value = N), N));
1221
+ const V = e.store.linkResolver;
1222
+ !V || typeof M != "string" || M === "" || V(a.linkDoctype, M).then((N) => (N != null && (f.value = N), N));
828
1223
  });
829
- const x = $(() => v.value ?? f.value), I = $(() => typeof x.value == "string" ? Hn(x.value) : !1), P = $(() => ({
830
- textAlign: c,
1224
+ const w = T(() => f.value ?? h.value), L = T(() => typeof w.value == "string" ? On(w.value) : !1), Z = T(() => ({
1225
+ textAlign: r,
831
1226
  width: s,
832
- fontWeight: a.value ? "bold" : "inherit",
833
- paddingLeft: e.store.getIndent(e.colIndex, e.store.display[e.rowIndex]?.indent)
834
- })), R = $(() => ({
1227
+ fontWeight: o.value ? "bold" : "inherit",
1228
+ paddingLeft: Pn(e.colIndex, e.store.display[e.rowIndex]?.indent)
1229
+ })), y = T(() => ({
835
1230
  "sticky-column": e.pinned,
836
- "cell-modified": a.value
837
- })), w = () => {
838
- m(), h();
839
- }, h = () => {
840
- const { left: E, bottom: Z, width: N, height: q } = Te(n);
841
- o.mask, o.modalComponent && e.store.$patch((_) => {
842
- _.modal.visible = !0, _.modal.colIndex = e.colIndex, _.modal.rowIndex = e.rowIndex, _.modal.left = E, _.modal.bottom = Z, _.modal.width = N, _.modal.height = q, _.modal.cell = n.value, typeof o.modalComponent == "function" ? _.modal.component = o.modalComponent({ table: _.table, row: r, column: o }) : _.modal.component = o.modalComponent, _.modal.componentProps = o.modalComponentExtraProps;
1231
+ "cell-modified": o.value
1232
+ })), m = () => {
1233
+ g(), v();
1234
+ }, v = () => {
1235
+ const { left: M, bottom: V, width: N, height: q } = Te(n);
1236
+ a.mask, a.modalComponent && e.store.$patch((ee) => {
1237
+ ee.modal.visible = !0, ee.modal.colIndex = e.colIndex, ee.modal.rowIndex = e.rowIndex, ee.modal.left = M.value, ee.modal.bottom = V.value, ee.modal.width = N.value, ee.modal.height = q.value, ee.modal.cell = n.value, typeof a.modalComponent == "function" ? ee.modal.component = a.modalComponent({ table: e.store.table, row: c, column: a }) : ee.modal.component = a.modalComponent, ee.modal.componentProps = a.modalComponentExtraProps;
843
1238
  });
844
1239
  };
845
1240
  if (e.addNavigation) {
846
- let E = {
847
- ...qe,
848
- "keydown.f2": h,
849
- "keydown.alt.up": h,
850
- "keydown.alt.down": h,
851
- "keydown.alt.left": h,
852
- "keydown.alt.right": h
1241
+ let M = {
1242
+ ...Je,
1243
+ "keydown.f2": v,
1244
+ "keydown.alt.up": v,
1245
+ "keydown.alt.down": v,
1246
+ "keydown.alt.left": v,
1247
+ "keydown.alt.right": v
853
1248
  };
854
- typeof e.addNavigation == "object" && (E = {
855
- ...E,
1249
+ typeof e.addNavigation == "object" && (M = {
1250
+ ...M,
856
1251
  ...e.addNavigation
857
- }), ft([
1252
+ }), It([
858
1253
  {
859
1254
  selectors: n,
860
- handlers: E
1255
+ handlers: M
861
1256
  }
862
1257
  ]);
863
1258
  }
864
- const m = () => {
865
- if (n.value && o.edit) {
866
- const E = window.getSelection();
867
- if (E)
1259
+ const g = () => {
1260
+ if (n.value && a.edit) {
1261
+ const M = window.getSelection();
1262
+ if (M)
868
1263
  try {
869
- const Z = document.createRange();
870
- Z.selectNodeContents && (Z.selectNodeContents(n.value), E.removeAllRanges(), E.addRange(Z));
1264
+ const V = document.createRange();
1265
+ V.selectNodeContents && (V.selectNodeContents(n.value), M.removeAllRanges(), M.addRange(V));
871
1266
  } catch {
872
1267
  }
873
1268
  }
1269
+ }, k = () => {
1270
+ n.value && (u.value = n.value.textContent, g());
874
1271
  }, C = () => {
875
- n.value && (u.value = n.value.textContent, m());
876
- }, b = () => {
877
1272
  try {
878
- const E = window.getSelection();
879
- if (E && E.rangeCount > 0 && n.value) {
880
- const Z = E.getRangeAt(0), N = Z.cloneRange();
1273
+ const M = window.getSelection();
1274
+ if (M && M.rangeCount > 0 && n.value) {
1275
+ const V = M.getRangeAt(0), N = V.cloneRange();
881
1276
  if (N.selectNodeContents && N.setEnd)
882
- return N.selectNodeContents(n.value), N.setEnd(Z.endContainer, Z.endOffset), N.toString().length;
1277
+ return N.selectNodeContents(n.value), N.setEnd(V.endContainer, V.endOffset), N.toString().length;
883
1278
  }
884
1279
  } catch {
885
1280
  }
886
1281
  return 0;
887
- }, p = (E) => {
1282
+ }, x = (M) => {
888
1283
  if (n.value)
889
1284
  try {
890
- const Z = window.getSelection();
891
- if (!Z) return;
1285
+ const V = window.getSelection();
1286
+ if (!V) return;
892
1287
  let N = 0;
893
1288
  const q = document.createTreeWalker ? document.createTreeWalker(n.value, NodeFilter.SHOW_TEXT, null) : null;
894
1289
  if (!q) return;
895
- let _, ne = null;
896
- for (; _ = q.nextNode(); ) {
897
- const ge = _, ve = N + ge.textContent.length;
898
- if (E <= ve && (ne = document.createRange(), ne.setStart && ne.setEnd)) {
899
- ne.setStart(ge, E - N), ne.setEnd(ge, E - N);
1290
+ let ee, ne = null;
1291
+ for (; ee = q.nextNode(); ) {
1292
+ const ge = ee, fe = N + ge.textContent.length;
1293
+ if (M <= fe && (ne = document.createRange(), ne.setStart && ne.setEnd)) {
1294
+ ne.setStart(ge, M - N), ne.setEnd(ge, M - N);
900
1295
  break;
901
1296
  }
902
- N = ve;
1297
+ N = fe;
903
1298
  }
904
- ne && Z.removeAllRanges && Z.addRange && (Z.removeAllRanges(), Z.addRange(ne));
1299
+ ne && V.removeAllRanges && V.addRange && (V.removeAllRanges(), V.addRange(ne));
905
1300
  } catch {
906
1301
  }
907
- }, O = (E) => {
908
- if (!o.edit) return;
909
- const Z = E.target;
910
- if (Z.textContent === u.value)
1302
+ }, I = (M) => {
1303
+ if (!a.edit) return;
1304
+ const V = M.target;
1305
+ if (V.textContent === u.value)
911
1306
  return;
912
- const N = b();
913
- u.value = Z.textContent, o.format ? (a.value = Z.textContent !== e.store.getFormattedValue(e.colIndex, e.rowIndex, l), e.store.setCellText(e.colIndex, e.rowIndex, Z.textContent)) : (a.value = Z.textContent !== l, e.store.setCellData(e.colIndex, e.rowIndex, Z.textContent)), at().then(() => p(N));
914
- }, j = /* @__PURE__ */ Rn(O, e.debounce);
1307
+ const N = C();
1308
+ u.value = V.textContent, a.format ? (o.value = V.textContent !== e.store.getFormattedValue(e.colIndex, e.rowIndex, l), e.store.setCellText(e.colIndex, e.rowIndex, V.textContent)) : (o.value = V.textContent !== l, e.store.setCellData(e.colIndex, e.rowIndex, V.textContent)), at().then(() => x(N));
1309
+ }, X = /* @__PURE__ */ Tn(I, e.debounce);
915
1310
  return t({
916
1311
  currentData: u
917
- }), (E, Z) => (y(), k("td", {
1312
+ }), (M, V) => (b(), R("td", {
918
1313
  ref: "cell",
919
1314
  "data-colindex": e.colIndex,
920
1315
  "data-rowindex": e.rowIndex,
921
- "data-editable": B(o).edit,
922
- contenteditable: B(o).edit,
1316
+ "data-editable": P(a).edit,
1317
+ contenteditable: P(a).edit,
923
1318
  tabindex: e.tabIndex,
924
1319
  spellcheck: !1,
925
- style: pe(P.value),
926
- class: ae(["atable-cell", R.value]),
927
- onFocus: C,
928
- onPaste: O,
929
- onInput: Z[0] || (Z[0] = //@ts-ignore
930
- (...N) => B(j) && B(j)(...N)),
931
- onClick: w
1320
+ style: pe(Z.value),
1321
+ class: ae(["atable-cell", y.value]),
1322
+ onFocus: k,
1323
+ onPaste: I,
1324
+ onInput: V[0] || (V[0] = //@ts-ignore
1325
+ (...N) => P(X) && P(X)(...N)),
1326
+ onClick: m
932
1327
  }, [
933
- B(o).cellComponent ? (y(), he(Ne(B(o).cellComponent), st({
1328
+ P(a).cellComponent ? (b(), ve(Ne(P(a).cellComponent), st({
934
1329
  key: 0,
935
- value: x.value
936
- }, B(o).cellComponentProps), null, 16, ["value"])) : I.value ? (y(), k("span", {
1330
+ value: w.value
1331
+ }, P(a).cellComponentProps), null, 16, ["value"])) : L.value ? (b(), R("span", {
937
1332
  key: 1,
938
- innerHTML: x.value
939
- }, null, 8, On)) : (y(), k("span", Vn, be(x.value), 1))
940
- ], 46, Dn));
941
- }
942
- }), Pn = ["tabindex"], Zn = ["tabindex"], Nn = ["colspan"], Fn = /* @__PURE__ */ xe({
943
- __name: "AExpansionRow",
944
- props: {
945
- rowIndex: {},
946
- store: {},
947
- tabIndex: { default: () => -1 },
948
- addNavigation: { type: [Boolean, Object], default: () => qe }
949
- },
950
- setup(e) {
951
- const t = ce("rowEl"), n = $(() => e.store.display[e.rowIndex].expanded ? "▼" : "►");
952
- if (e.addNavigation) {
953
- const l = {
954
- "keydown.control.g": (u) => {
955
- u.stopPropagation(), u.preventDefault(), e.store.toggleRowExpand(e.rowIndex);
956
- }
957
- };
958
- typeof e.addNavigation == "object" && Object.assign(l, e.addNavigation), ft([
959
- {
960
- selectors: t,
961
- handlers: l
962
- }
963
- ]);
964
- }
965
- return (l, u) => (y(), k(me, null, [
966
- F("tr", st(l.$attrs, {
967
- ref: "rowEl",
968
- tabindex: e.tabIndex,
969
- class: "expandable-row"
970
- }), [
971
- F("td", {
972
- tabIndex: -1,
973
- class: "row-index",
974
- onClick: u[0] || (u[0] = (a) => e.store.toggleRowExpand(e.rowIndex))
975
- }, be(n.value), 1),
976
- fe(l.$slots, "row", {}, void 0, !0)
977
- ], 16, Pn),
978
- e.store.display[e.rowIndex].expanded ? (y(), k("tr", {
979
- key: 0,
980
- ref: "rowExpanded",
981
- tabindex: e.tabIndex,
982
- class: "expanded-row"
983
- }, [
984
- F("td", {
985
- tabIndex: -1,
986
- colspan: e.store.columns.length + 1,
987
- class: "expanded-row-content"
988
- }, [
989
- fe(l.$slots, "content", {}, void 0, !0)
990
- ], 8, Nn)
991
- ], 8, Zn)) : ee("", !0)
992
- ], 64));
1333
+ innerHTML: w.value
1334
+ }, null, 8, Fn)) : (b(), R("span", Wn, ye(w.value), 1))
1335
+ ], 46, Nn));
993
1336
  }
994
- }), $e = (e, t) => {
995
- const n = e.__vccOpts || e;
996
- for (const [l, u] of t)
997
- n[l] = u;
998
- return n;
999
- }, Wn = /* @__PURE__ */ $e(Fn, [["__scopeId", "data-v-a42297c7"]]), zn = ["colspan"], Xn = {
1337
+ }), Xn = ["colspan"], Gn = {
1000
1338
  ref: "container",
1001
1339
  class: "gantt-container"
1002
- }, Gn = ["data-rowindex", "data-colindex"], jn = {
1340
+ }, Un = ["data-rowindex", "data-colindex"], jn = {
1003
1341
  key: 2,
1004
1342
  class: "gantt-label"
1005
- }, Yn = ["x1", "y1", "x2", "y2"], Un = /* @__PURE__ */ xe({
1343
+ }, Yn = ["x1", "y1", "x2", "y2"], Jn = /* @__PURE__ */ Ce({
1006
1344
  __name: "AGanttCell",
1007
1345
  props: {
1008
1346
  store: {},
@@ -1017,18 +1355,18 @@ const Hn = (e) => {
1017
1355
  },
1018
1356
  emits: ["connection:create"],
1019
1357
  setup(e, { expose: t, emit: n }) {
1020
- Xt((T) => ({
1358
+ Ut(($) => ({
1021
1359
  v564d6da1: u.value,
1022
- v4f540c19: T.colspan
1360
+ v4f540c19: $.colspan
1023
1361
  }));
1024
- const l = n, u = z(e.color.length >= 6 ? e.color : "#cccccc"), a = `gantt-bar-row-${e.rowIndex}-col-${e.colIndex}`, o = ce("container"), r = ce("bar"), c = ce("leftResizeHandle"), s = ce("rightResizeHandle"), f = ce("leftConnectionHandle"), v = ce("rightConnectionHandle"), { width: x } = Te(o), { left: I, right: P } = Te(r), R = z(e.start), w = z(e.end || R.value + e.colspan), h = z(!1), m = z(!1), C = z(!1), b = z(!1), p = z(!1), O = z({ startX: 0, startY: 0, endX: 0, endY: 0 }), j = $(() => ge.value || _.value || ne.value), E = $(() => e.colspan > 0 ? x.value / e.colspan : 0), Z = $(() => {
1025
- const T = R.value / e.colspan * 100, V = w.value / e.colspan * 100;
1362
+ const l = n, u = W(e.color.length >= 6 ? e.color : "#cccccc"), o = `gantt-bar-row-${e.rowIndex}-col-${e.colIndex}`, a = de("container"), c = de("bar"), r = de("leftResizeHandle"), s = de("rightResizeHandle"), h = de("leftConnectionHandle"), f = de("rightConnectionHandle"), { width: w } = Te(a), { left: L, right: Z } = Te(c), y = W(e.start), m = W(e.end || y.value + e.colspan), v = W(!1), g = W(!1), k = W(!1), C = W(!1), x = W(!1), I = W({ startX: 0, startY: 0, endX: 0, endY: 0 }), X = T(() => ge.value || ee.value || ne.value), M = T(() => e.colspan > 0 ? w.value / e.colspan : 0), V = T(() => {
1363
+ const $ = y.value / e.colspan * 100, B = m.value / e.colspan * 100;
1026
1364
  return {
1027
- left: `${T}%`,
1028
- width: `${V - T}%`,
1365
+ left: `${$}%`,
1366
+ width: `${B - $}%`,
1029
1367
  backgroundColor: u.value
1030
1368
  };
1031
- }), N = $(() => ({
1369
+ }), N = T(() => ({
1032
1370
  position: "fixed",
1033
1371
  top: 0,
1034
1372
  left: 0,
@@ -1036,83 +1374,83 @@ const Hn = (e) => {
1036
1374
  height: "100vh",
1037
1375
  pointerEvents: "none",
1038
1376
  zIndex: 1e3
1039
- })), q = z({ startX: 0, startPos: 0 }), { isDragging: _ } = _e(c, {
1377
+ })), q = W({ startX: 0, startPos: 0 }), { isDragging: ee } = _e(r, {
1040
1378
  axis: "x",
1041
- onStart: () => ve(I.value, R.value),
1042
- onMove: ({ x: T }) => Oe(T),
1043
- onEnd: ({ x: T }) => Ve(T)
1379
+ onStart: () => fe(L.value, y.value),
1380
+ onMove: ({ x: $ }) => Oe($),
1381
+ onEnd: ({ x: $ }) => Ve($)
1044
1382
  }), { isDragging: ne } = _e(s, {
1045
1383
  axis: "x",
1046
- onStart: () => ve(P.value, w.value),
1047
- onMove: ({ x: T }) => Be(T),
1048
- onEnd: ({ x: T }) => Pe(T)
1049
- }), { isDragging: ge } = _e(r, {
1384
+ onStart: () => fe(Z.value, m.value),
1385
+ onMove: ({ x: $ }) => Be($),
1386
+ onEnd: ({ x: $ }) => Pe($)
1387
+ }), { isDragging: ge } = _e(c, {
1050
1388
  exact: !0,
1051
1389
  axis: "x",
1052
- onStart: () => ve(I.value, R.value),
1053
- onMove: ({ x: T }) => He(T),
1054
- onEnd: ({ x: T }) => M(T)
1390
+ onStart: () => fe(L.value, y.value),
1391
+ onMove: ({ x: $ }) => He($),
1392
+ onEnd: ({ x: $ }) => E($)
1055
1393
  });
1056
- Ae(() => {
1057
- L();
1058
- }), Gt(() => {
1059
- W();
1394
+ Ie(() => {
1395
+ D();
1396
+ }), jt(() => {
1397
+ F();
1060
1398
  });
1061
- function ve(T, V) {
1062
- r.value && (r.value.style.transition = "none"), q.value = { startX: T, startPos: V };
1399
+ function fe($, B) {
1400
+ c.value && (c.value.style.transition = "none"), q.value = { startX: $, startPos: B };
1063
1401
  }
1064
- function Oe(T) {
1065
- if (!_.value || !r.value) return;
1066
- const Y = (T - q.value.startX) / E.value, G = Math.max(0, Math.min(w.value - 1, q.value.startPos + Y));
1067
- r.value.style.left = `${G / e.colspan * 100}%`, r.value.style.width = `${(w.value - G) / e.colspan * 100}%`;
1402
+ function Oe($) {
1403
+ if (!ee.value || !c.value) return;
1404
+ const j = ($ - q.value.startX) / M.value, U = Math.max(0, Math.min(m.value - 1, q.value.startPos + j));
1405
+ c.value.style.left = `${U / e.colspan * 100}%`, c.value.style.width = `${(m.value - U) / e.colspan * 100}%`;
1068
1406
  }
1069
- function Ve(T) {
1070
- if (!r.value) return;
1071
- const V = T - q.value.startX, Y = Math.round(V / E.value), G = R.value, K = Math.max(0, Math.min(w.value - 1, q.value.startPos + Y));
1072
- R.value = K, e.store.updateGanttBar({
1407
+ function Ve($) {
1408
+ if (!c.value) return;
1409
+ const B = $ - q.value.startX, j = Math.round(B / M.value), U = y.value, K = Math.max(0, Math.min(m.value - 1, q.value.startPos + j));
1410
+ y.value = K, e.store.updateGanttBar({
1073
1411
  rowIndex: e.rowIndex,
1074
1412
  colIndex: e.colIndex,
1075
1413
  type: "resize",
1076
1414
  edge: "start",
1077
- oldStart: G,
1415
+ oldStart: U,
1078
1416
  newStart: K,
1079
- end: w.value,
1080
- delta: Y,
1081
- oldColspan: w.value - G,
1082
- newColspan: w.value - K
1417
+ end: m.value,
1418
+ delta: j,
1419
+ oldColspan: m.value - U,
1420
+ newColspan: m.value - K
1083
1421
  });
1084
1422
  }
1085
- function Be(T) {
1086
- if (!ne.value || !r.value) return;
1087
- const Y = (T - q.value.startX) / E.value, G = Math.max(R.value + 1, Math.min(e.columnsCount, q.value.startPos + Y));
1088
- r.value.style.width = `${(G - R.value) / e.colspan * 100}%`;
1423
+ function Be($) {
1424
+ if (!ne.value || !c.value) return;
1425
+ const j = ($ - q.value.startX) / M.value, U = Math.max(y.value + 1, Math.min(e.columnsCount, q.value.startPos + j));
1426
+ c.value.style.width = `${(U - y.value) / e.colspan * 100}%`;
1089
1427
  }
1090
- function Pe(T) {
1091
- if (!r.value) return;
1092
- const V = T - q.value.startX, Y = Math.round(V / E.value), G = w.value, K = Math.max(R.value + 1, Math.min(e.columnsCount, q.value.startPos + Y));
1093
- w.value = K, e.store.updateGanttBar({
1428
+ function Pe($) {
1429
+ if (!c.value) return;
1430
+ const B = $ - q.value.startX, j = Math.round(B / M.value), U = m.value, K = Math.max(y.value + 1, Math.min(e.columnsCount, q.value.startPos + j));
1431
+ m.value = K, e.store.updateGanttBar({
1094
1432
  rowIndex: e.rowIndex,
1095
1433
  colIndex: e.colIndex,
1096
1434
  type: "resize",
1097
1435
  edge: "end",
1098
- oldEnd: G,
1436
+ oldEnd: U,
1099
1437
  newEnd: K,
1100
- start: R.value,
1101
- delta: Y,
1102
- oldColspan: G - R.value,
1103
- newColspan: K - R.value
1438
+ start: y.value,
1439
+ delta: j,
1440
+ oldColspan: U - y.value,
1441
+ newColspan: K - y.value
1104
1442
  });
1105
1443
  }
1106
- function He(T) {
1107
- if (!ge.value || !r.value) return;
1108
- const Y = (T - q.value.startX) / E.value, G = w.value - R.value, K = Math.max(0, Math.min(q.value.startPos + Y, e.columnsCount - G));
1109
- r.value.style.left = `${K / e.colspan * 100}%`;
1444
+ function He($) {
1445
+ if (!ge.value || !c.value) return;
1446
+ const j = ($ - q.value.startX) / M.value, U = m.value - y.value, K = Math.max(0, Math.min(q.value.startPos + j, e.columnsCount - U));
1447
+ c.value.style.left = `${K / e.colspan * 100}%`;
1110
1448
  }
1111
- function M(T) {
1112
- if (!r.value) return;
1113
- const V = T - q.value.startX, Y = Math.round(V / E.value), G = w.value - R.value, K = R.value, te = w.value;
1114
- let le = q.value.startPos + Y, se = le + G;
1115
- le < 0 ? (le = 0, se = G) : se > e.columnsCount && (se = e.columnsCount, le = se - G), R.value = le, w.value = se, e.store.updateGanttBar({
1449
+ function E($) {
1450
+ if (!c.value) return;
1451
+ const B = $ - q.value.startX, j = Math.round(B / M.value), U = m.value - y.value, K = y.value, te = m.value;
1452
+ let le = q.value.startPos + j, se = le + U;
1453
+ le < 0 ? (le = 0, se = U) : se > e.columnsCount && (se = e.columnsCount, le = se - U), y.value = le, m.value = se, e.store.updateGanttBar({
1116
1454
  rowIndex: e.rowIndex,
1117
1455
  colIndex: e.colIndex,
1118
1456
  type: "bar",
@@ -1120,165 +1458,170 @@ const Hn = (e) => {
1120
1458
  oldEnd: te,
1121
1459
  newStart: le,
1122
1460
  newEnd: se,
1123
- delta: Y,
1461
+ delta: j,
1124
1462
  colspan: se - le
1125
1463
  });
1126
1464
  }
1127
- function L() {
1128
- const { x: T, y: V } = Te(r), { x: Y, y: G } = Te(f), { x: K, y: te } = Te(v);
1465
+ function D() {
1466
+ const { x: $, y: B } = Te(c), { x: j, y: U } = Te(h), { x: K, y: te } = Te(f);
1129
1467
  e.store.registerGanttBar({
1130
- id: a,
1468
+ id: o,
1131
1469
  rowIndex: e.rowIndex,
1132
1470
  colIndex: e.colIndex,
1133
- startIndex: R,
1134
- endIndex: w,
1471
+ startIndex: y,
1472
+ endIndex: m,
1135
1473
  color: u,
1136
1474
  label: e.label,
1137
- position: { x: T, y: V }
1475
+ position: { x: $, y: B }
1138
1476
  }), e.store.isDependencyGraphEnabled && (e.store.registerConnectionHandle({
1139
- id: `${a}-connection-left`,
1477
+ id: `${o}-connection-left`,
1140
1478
  rowIndex: e.rowIndex,
1141
1479
  colIndex: e.colIndex,
1142
1480
  side: "left",
1143
- position: { x: Y, y: G },
1144
- visible: h,
1145
- barId: a
1481
+ position: { x: j, y: U },
1482
+ visible: v,
1483
+ barId: o
1146
1484
  }), e.store.registerConnectionHandle({
1147
- id: `${a}-connection-right`,
1485
+ id: `${o}-connection-right`,
1148
1486
  rowIndex: e.rowIndex,
1149
1487
  colIndex: e.colIndex,
1150
1488
  side: "right",
1151
1489
  position: { x: K, y: te },
1152
- visible: m,
1153
- barId: a
1490
+ visible: g,
1491
+ barId: o
1154
1492
  }));
1155
1493
  }
1156
- function W() {
1157
- e.store.unregisterGanttBar(a), e.store.isDependencyGraphEnabled && (e.store.unregisterConnectionHandle(`${a}-connection-left`), e.store.unregisterConnectionHandle(`${a}-connection-right`));
1494
+ function F() {
1495
+ e.store.unregisterGanttBar(o), e.store.isDependencyGraphEnabled && (e.store.unregisterConnectionHandle(`${o}-connection-left`), e.store.unregisterConnectionHandle(`${o}-connection-right`));
1158
1496
  }
1159
1497
  function Q() {
1160
- e.store.isDependencyGraphEnabled && (h.value = !0, m.value = !0);
1498
+ e.store.isDependencyGraphEnabled && (v.value = !0, g.value = !0);
1161
1499
  }
1162
- function X() {
1163
- !C.value && !b.value && (h.value = !1, m.value = !1);
1500
+ function G() {
1501
+ !k.value && !C.value && (v.value = !1, g.value = !1);
1164
1502
  }
1165
- function oe(T, V) {
1166
- V.preventDefault(), V.stopPropagation(), p.value = !0, T === "left" ? C.value = !0 : b.value = !0;
1167
- const Y = T === "left" ? f.value : v.value;
1168
- if (Y) {
1169
- const te = Y.getBoundingClientRect(), le = te.left + te.width / 2, se = te.top + te.height / 2;
1170
- O.value = { startX: le, startY: se, endX: le, endY: se };
1503
+ function oe($, B) {
1504
+ B.preventDefault(), B.stopPropagation(), x.value = !0, $ === "left" ? k.value = !0 : C.value = !0;
1505
+ const j = $ === "left" ? h.value : f.value;
1506
+ if (j) {
1507
+ const te = j.getBoundingClientRect(), le = te.left + te.width / 2, se = te.top + te.height / 2;
1508
+ I.value = { startX: le, startY: se, endX: le, endY: se };
1171
1509
  }
1172
- const G = (te) => {
1173
- O.value.endX = te.clientX, O.value.endY = te.clientY;
1510
+ const U = (te) => {
1511
+ I.value.endX = te.clientX, I.value.endY = te.clientY;
1174
1512
  }, K = (te) => {
1175
- ye(te, T), Re(G, K);
1513
+ xe(te, $), Re(U, K);
1176
1514
  };
1177
- document.addEventListener("mousemove", G), document.addEventListener("mouseup", K);
1515
+ document.addEventListener("mousemove", U), document.addEventListener("mouseup", K);
1178
1516
  }
1179
- function ye(T, V) {
1180
- const G = document.elementFromPoint(T.clientX, T.clientY)?.closest(".connection-handle");
1181
- if (G && G !== (V === "left" ? f.value : v.value)) {
1182
- const K = G.closest(".gantt-bar");
1517
+ function xe($, B) {
1518
+ const U = document.elementFromPoint($.clientX, $.clientY)?.closest(".connection-handle");
1519
+ if (U && U !== (B === "left" ? h.value : f.value)) {
1520
+ const K = U.closest(".gantt-bar");
1183
1521
  if (K) {
1184
- const te = parseInt(K.getAttribute("data-rowindex") || "0"), le = parseInt(K.getAttribute("data-colindex") || "0"), se = G.classList.contains("left-connection-handle") ? "left" : "right", ht = `gantt-bar-row-${te}-col-${le}`, Qe = e.store.createConnection(
1185
- `${a}-connection-${V}`,
1186
- `${ht}-connection-${se}`
1522
+ const te = parseInt(K.getAttribute("data-rowindex") || "0"), le = parseInt(K.getAttribute("data-colindex") || "0"), se = U.classList.contains("left-connection-handle") ? "left" : "right", vt = `gantt-bar-row-${te}-col-${le}`, Qe = e.store.createConnection(
1523
+ `${o}-connection-${B}`,
1524
+ `${vt}-connection-${se}`
1187
1525
  );
1188
1526
  Qe && l("connection:create", Qe);
1189
1527
  }
1190
1528
  }
1191
1529
  }
1192
- function Re(T, V) {
1193
- p.value = !1, C.value = !1, b.value = !1, document.removeEventListener("mousemove", T), document.removeEventListener("mouseup", V), r.value?.matches(":hover") || X();
1530
+ function Re($, B) {
1531
+ x.value = !1, k.value = !1, C.value = !1, document.removeEventListener("mousemove", $), document.removeEventListener("mouseup", B), c.value?.matches(":hover") || G();
1194
1532
  }
1195
1533
  return t({
1196
- barStyle: Z,
1534
+ barStyle: V,
1197
1535
  cleanupConnectionDrag: Re,
1198
- currentEnd: w,
1199
- handleConnectionDrop: ye,
1200
- isLeftConnectionDragging: C,
1201
- isLeftConnectionVisible: h,
1202
- isRightConnectionDragging: b,
1203
- isRightConnectionVisible: m,
1204
- showDragPreview: p
1205
- }), (T, V) => (y(), k("td", {
1536
+ currentEnd: m,
1537
+ handleConnectionDrop: xe,
1538
+ isLeftConnectionDragging: k,
1539
+ isLeftConnectionVisible: v,
1540
+ isRightConnectionDragging: C,
1541
+ isRightConnectionVisible: g,
1542
+ showDragPreview: x
1543
+ }), ($, B) => (b(), R("td", {
1206
1544
  class: "aganttcell",
1207
1545
  colspan: e.colspan
1208
1546
  }, [
1209
- F("div", Xn, [
1210
- F("div", {
1547
+ z("div", Gn, [
1548
+ z("div", {
1211
1549
  ref: "bar",
1212
1550
  "data-rowindex": e.rowIndex,
1213
1551
  "data-colindex": e.colIndex,
1214
- class: ae(["gantt-bar", { "is-dragging": j.value }]),
1215
- style: pe(Z.value),
1552
+ class: ae(["gantt-bar", { "is-dragging": X.value }]),
1553
+ style: pe(V.value),
1216
1554
  onMouseenter: Q,
1217
- onMouseleave: X
1555
+ onMouseleave: G
1218
1556
  }, [
1219
- e.store.isDependencyGraphEnabled ? (y(), k("div", {
1557
+ e.store.isDependencyGraphEnabled ? (b(), R("div", {
1220
1558
  key: 0,
1221
1559
  ref: "leftConnectionHandle",
1222
- class: ae(["connection-handle left-connection-handle", { visible: h.value, "is-dragging": C.value }]),
1223
- onMousedown: V[0] || (V[0] = Se((Y) => oe("left", Y), ["stop"]))
1224
- }, [...V[2] || (V[2] = [
1225
- F("div", { class: "connection-dot" }, null, -1)
1226
- ])], 34)) : ee("", !0),
1227
- e.store.isDependencyGraphEnabled ? (y(), k("div", {
1560
+ class: ae(["connection-handle left-connection-handle", { visible: v.value, "is-dragging": k.value }]),
1561
+ onMousedown: B[0] || (B[0] = $e((j) => oe("left", j), ["stop"]))
1562
+ }, [...B[2] || (B[2] = [
1563
+ z("div", { class: "connection-dot" }, null, -1)
1564
+ ])], 34)) : _("", !0),
1565
+ e.store.isDependencyGraphEnabled ? (b(), R("div", {
1228
1566
  key: 1,
1229
1567
  ref: "rightConnectionHandle",
1230
- class: ae(["connection-handle right-connection-handle", { visible: m.value, "is-dragging": b.value }]),
1231
- onMousedown: V[1] || (V[1] = Se((Y) => oe("right", Y), ["stop"]))
1232
- }, [...V[3] || (V[3] = [
1233
- F("div", { class: "connection-dot" }, null, -1)
1234
- ])], 34)) : ee("", !0),
1235
- F("div", {
1568
+ class: ae(["connection-handle right-connection-handle", { visible: g.value, "is-dragging": C.value }]),
1569
+ onMousedown: B[1] || (B[1] = $e((j) => oe("right", j), ["stop"]))
1570
+ }, [...B[3] || (B[3] = [
1571
+ z("div", { class: "connection-dot" }, null, -1)
1572
+ ])], 34)) : _("", !0),
1573
+ z("div", {
1236
1574
  ref: "leftResizeHandle",
1237
- class: ae(["resize-handle left-resize-handle", { "is-dragging": B(_) }])
1238
- }, [...V[4] || (V[4] = [
1239
- F("div", { class: "handle-grip" }, null, -1),
1240
- F("div", { class: "vertical-indicator left-indicator" }, null, -1)
1575
+ class: ae(["resize-handle left-resize-handle", { "is-dragging": P(ee) }])
1576
+ }, [...B[4] || (B[4] = [
1577
+ z("div", { class: "handle-grip" }, null, -1),
1578
+ z("div", { class: "vertical-indicator left-indicator" }, null, -1)
1241
1579
  ])], 2),
1242
- e.label ? (y(), k("label", jn, be(e.label), 1)) : ee("", !0),
1243
- F("div", {
1580
+ e.label ? (b(), R("label", jn, ye(e.label), 1)) : _("", !0),
1581
+ z("div", {
1244
1582
  ref: "rightResizeHandle",
1245
- class: ae(["resize-handle right-resize-handle", { "is-dragging": B(ne) }])
1246
- }, [...V[5] || (V[5] = [
1247
- F("div", { class: "handle-grip" }, null, -1),
1248
- F("div", { class: "vertical-indicator right-indicator" }, null, -1)
1583
+ class: ae(["resize-handle right-resize-handle", { "is-dragging": P(ne) }])
1584
+ }, [...B[5] || (B[5] = [
1585
+ z("div", { class: "handle-grip" }, null, -1),
1586
+ z("div", { class: "vertical-indicator right-indicator" }, null, -1)
1249
1587
  ])], 2)
1250
- ], 46, Gn)
1588
+ ], 46, Un)
1251
1589
  ], 512),
1252
- e.store.isDependencyGraphEnabled && p.value ? (y(), k("svg", {
1590
+ e.store.isDependencyGraphEnabled && x.value ? (b(), R("svg", {
1253
1591
  key: 0,
1254
1592
  style: pe(N.value)
1255
1593
  }, [
1256
- F("line", {
1257
- x1: O.value.startX,
1258
- y1: O.value.startY,
1259
- x2: O.value.endX,
1260
- y2: O.value.endY,
1594
+ z("line", {
1595
+ x1: I.value.startX,
1596
+ y1: I.value.startY,
1597
+ x2: I.value.endX,
1598
+ y2: I.value.endY,
1261
1599
  stroke: "#2196f3",
1262
1600
  "stroke-width": "2",
1263
1601
  "stroke-dasharray": "5,5"
1264
1602
  }, null, 8, Yn)
1265
- ], 4)) : ee("", !0)
1266
- ], 8, zn));
1603
+ ], 4)) : _("", !0)
1604
+ ], 8, Xn));
1267
1605
  }
1268
- }), Jn = /* @__PURE__ */ $e(Un, [["__scopeId", "data-v-032ef6d9"]]), qn = `<?xml version="1.0" encoding="UTF-8"?>
1606
+ }), Ae = (e, t) => {
1607
+ const n = e.__vccOpts || e;
1608
+ for (const [l, u] of t)
1609
+ n[l] = u;
1610
+ return n;
1611
+ }, qn = /* @__PURE__ */ Ae(Jn, [["__scopeId", "data-v-032ef6d9"]]), Qn = `<?xml version="1.0" encoding="UTF-8"?>
1269
1612
  <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
1270
1613
  <path d="M32,64C14.35,64,0,49.65,0,32S14.35,0,32,0s32,14.35,32,32-14.35,32-32,32ZM32,4c-15.44,0-28,12.56-28,28s12.56,28,28,28,28-12.56,28-28S47.44,4,32,4Z" style="fill: #000; stroke-width: 0px;"/>
1271
1614
  <polygon points="34 18 30 18 30 30 18 30 18 34 30 34 30 46 34 46 34 34 46 34 46 30 34 30 34 18" style="fill: #000; stroke-width: 0px;"/>
1272
1615
  </svg>
1273
- `, Qn = `<?xml version="1.0" encoding="UTF-8"?>
1616
+ `, Kn = `<?xml version="1.0" encoding="UTF-8"?>
1274
1617
  <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
1275
1618
  <path d="M32,64C14.35,64,0,49.65,0,32S14.35,0,32,0s32,14.35,32,32-14.35,32-32,32ZM32,4c-15.44,0-28,12.56-28,28s12.56,28,28,28,28-12.56,28-28S47.44,4,32,4Z" style="fill: #000; stroke-width: 0px;"/>
1276
1619
  <polygon points="46.84 19.99 44.01 17.16 32 29.17 19.99 17.16 17.16 19.99 29.17 32 17.16 44.01 19.99 46.84 32 34.83 44.01 46.84 46.84 44.01 34.83 32 46.84 19.99" style="fill: #000; stroke-width: 0px;"/>
1277
- </svg>`, Kn = `<?xml version="1.0" encoding="UTF-8"?>
1620
+ </svg>`, _n = `<?xml version="1.0" encoding="UTF-8"?>
1278
1621
  <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 70.67 70.67">
1279
1622
  <path d="M68.67,16.67h-14.67V2c0-1.1-.9-2-2-2H2C.9,0,0,.9,0,2v50c0,1.1.9,2,2,2h14.67v14.67c0,1.1.9,2,2,2h50c1.1,0,2-.9,2-2V18.67c0-1.1-.9-2-2-2ZM4,4h46v46H4V4ZM66.67,66.67H20.67v-12.67h31.33c1.1,0,2-.9,2-2v-31.33h12.67v46Z" style="fill: #000; stroke-width: 0px;"/>
1280
1623
  <polygon points="41 25 29 25 29 13 25 13 25 25 13 25 13 29 25 29 25 41 29 41 29 29 41 29 41 25" style="fill: #000; stroke-width: 0px;"/>
1281
- </svg>`, _n = `<?xml version="1.0" encoding="UTF-8"?>
1624
+ </svg>`, eo = `<?xml version="1.0" encoding="UTF-8"?>
1282
1625
  <svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 70.6 61.5">
1283
1626
  <path d="M68.6,45.8v13.7H2v-13.7h66.6M70.6,43.8H0v17.7h70.6v-17.7h0Z"/>
1284
1627
  <path d="M68.6,24.2v13.7H2v-13.7h66.6M70.6,22.2H0v17.7h70.6v-17.7h0Z"/>
@@ -1292,7 +1635,7 @@ const Hn = (e) => {
1292
1635
  <polygon points="70.6 18.7 68.1 18.7 68.1 16.7 68.6 16.7 68.6 16.2 70.6 16.2 70.6 18.7"/>
1293
1636
  <path d="M70.6,13.4h-2v-2.7h2v2.7ZM70.6,8h-2v-2.7h2v2.7Z"/>
1294
1637
  </g>
1295
- </svg>`, eo = `<?xml version="1.0" encoding="UTF-8"?>
1638
+ </svg>`, to = `<?xml version="1.0" encoding="UTF-8"?>
1296
1639
  <svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 70.6 61.5">
1297
1640
  <g>
1298
1641
  <polygon points="70.6 45.3 68.6 45.3 68.6 44.8 68.1 44.8 68.1 42.8 70.6 42.8 70.6 45.3"/>
@@ -1306,29 +1649,31 @@ const Hn = (e) => {
1306
1649
  </g>
1307
1650
  <path d="M68.6,23.7v13.7H2v-13.7h66.6M70.6,21.7H0v17.7h70.6v-17.7h0Z"/>
1308
1651
  <path d="M68.6,2v13.7H2V2h66.6M70.6,0H0v17.7h70.6V0h0Z"/>
1309
- </svg>`, to = `<?xml version="1.0" encoding="UTF-8"?>
1652
+ </svg>`, no = `<?xml version="1.0" encoding="UTF-8"?>
1310
1653
  <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 70.67 70.64">
1311
1654
  <path d="M70.08,33.9l-9.75-9.75-2.83,2.83,6.33,6.33h-26.51V6.81l6.33,6.33,2.83-2.83L36.75.56c-.75-.75-2.08-.75-2.83,0l-9.75,9.75,2.83,2.83,6.33-6.33v26.5H6.83l6.33-6.33-2.83-2.83L.59,33.9c-.38.38-.59.88-.59,1.41s.21,1.04.59,1.41l9.75,9.75,2.83-2.83-6.33-6.33h26.5v26.51l-6.33-6.33-2.83,2.83,9.75,9.75c.38.38.88.59,1.41.59s1.04-.21,1.41-.59l9.75-9.75-2.83-2.83-6.33,6.33v-26.51h26.51l-6.33,6.33,2.83,2.83,9.75-9.75c.38-.38.59-.88.59-1.41s-.21-1.04-.59-1.41Z" style="fill: #000; stroke-width: 0px;"/>
1312
- </svg>`, no = `<?xml version="1.0" encoding="UTF-8"?>
1655
+ </svg>`, oo = `<?xml version="1.0" encoding="UTF-8"?>
1313
1656
  <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
1314
1657
  <path d="M32,64C14.35,64,0,49.65,0,32S14.35,0,32,0s32,14.35,32,32-14.35,32-32,32ZM32,4c-15.44,0-28,12.56-28,28s12.56,28,28,28,28-12.56,28-28S47.44,4,32,4Z" style="fill: #000; stroke-width: 0px;"/>
1315
1658
  <polygon points="18,20 18,44 46,32" style="fill: #000; stroke-width: 0px;"/>
1316
1659
  </svg>
1317
- `, oo = {
1318
- add: qn,
1319
- delete: Qn,
1320
- duplicate: Kn,
1321
- insertAbove: _n,
1322
- insertBelow: eo,
1323
- move: to,
1324
- open: no
1325
- }, lo = {
1660
+ `, lo = '<svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M8 13V3.5M4.5 7 8 3.5 11.5 7" stroke-linecap="round" stroke-linejoin="round"/></svg>', ao = '<svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M8 3v9.5M4.5 9 8 12.5 11.5 9" stroke-linecap="round" stroke-linejoin="round"/></svg>', so = {
1661
+ add: Qn,
1662
+ delete: Kn,
1663
+ duplicate: _n,
1664
+ insertAbove: eo,
1665
+ insertBelow: to,
1666
+ move: no,
1667
+ moveUp: lo,
1668
+ moveDown: ao,
1669
+ open: oo
1670
+ }, io = {
1326
1671
  key: 0,
1327
1672
  class: "row-actions-dropdown"
1328
- }, ao = ["aria-expanded"], so = ["onClick"], io = ["innerHTML"], ro = { class: "action-label" }, co = {
1673
+ }, ro = ["aria-expanded"], co = ["disabled", "onClick"], uo = ["innerHTML"], fo = { class: "action-label" }, vo = {
1329
1674
  key: 1,
1330
1675
  class: "row-actions-icons"
1331
- }, uo = ["title", "aria-label", "onClick"], fo = ["innerHTML"], Ue = /* @__PURE__ */ xe({
1676
+ }, ho = ["title", "aria-label", "disabled", "onClick"], mo = ["innerHTML"], Ye = /* @__PURE__ */ Ce({
1332
1677
  __name: "ARowActions",
1333
1678
  props: {
1334
1679
  rowIndex: {},
@@ -1338,28 +1683,40 @@ const Hn = (e) => {
1338
1683
  },
1339
1684
  emits: ["action"],
1340
1685
  setup(e, { emit: t }) {
1341
- const n = e, l = t, u = ce("actionsCell"), a = ce("toggleButton"), o = z(0), r = z(!1), c = z(!1), s = z({ top: 0, left: 0 }), f = {
1686
+ const n = e, l = t, u = de("actionsCell"), o = de("toggleButton"), a = W(0), c = W(!1), r = W(!1), s = W({ top: 0, left: 0 }), h = {
1342
1687
  add: "Add Record",
1343
1688
  delete: "Delete Record",
1344
1689
  duplicate: "Duplicate Record",
1345
1690
  insertAbove: "Insert Above",
1346
1691
  insertBelow: "Insert Below",
1347
1692
  move: "Move Record",
1693
+ moveUp: "Move Up",
1694
+ moveDown: "Move Down",
1348
1695
  open: "Open Record"
1349
- }, v = $(() => {
1350
- const h = [], m = n.config.actions || {}, C = ["open", "add", "delete", "duplicate", "insertAbove", "insertBelow", "move"];
1351
- for (const b of C) {
1352
- const p = m[b];
1353
- if (p === !1 || p === void 0) continue;
1354
- let O = !0, j = f[b], E = oo[b];
1355
- typeof p == "object" && (O = p.enabled !== !1, j = p.label || j, E = p.icon || E), O && h.push({ type: b, label: j, icon: E });
1696
+ }, f = T(() => {
1697
+ const v = [], g = n.config.actions || {}, k = [
1698
+ "open",
1699
+ "moveUp",
1700
+ "moveDown",
1701
+ "duplicate",
1702
+ "insertAbove",
1703
+ "insertBelow",
1704
+ "add",
1705
+ "delete",
1706
+ "move"
1707
+ ];
1708
+ for (const C of k) {
1709
+ const x = g[C];
1710
+ if (x === !1 || x === void 0) continue;
1711
+ let I = !0, X = h[C], M = so[C], V = !1;
1712
+ typeof x == "object" && (I = x.enabled !== !1, X = x.label || X, M = x.icon || M, x.disabled && (V = x.disabled(n.rowIndex, n.store))), I && v.push({ type: C, label: X, icon: M, disabled: V });
1356
1713
  }
1357
- return h;
1358
- }), x = $(() => {
1714
+ return v;
1715
+ }), w = T(() => {
1359
1716
  if (n.config.forceDropdown) return !0;
1360
- const h = n.config.dropdownThreshold ?? 150;
1361
- return h === 0 ? !1 : o.value > 0 && o.value < h;
1362
- }), I = $(() => r.value ? c.value ? {
1717
+ const v = n.config.dropdownThreshold ?? 150;
1718
+ return v === 0 ? !1 : a.value > 0 && a.value < v;
1719
+ }), L = T(() => c.value ? r.value ? {
1363
1720
  position: "fixed",
1364
1721
  bottom: `${window.innerHeight - s.value.top}px`,
1365
1722
  left: `${s.value.left}px`,
@@ -1369,85 +1726,86 @@ const Hn = (e) => {
1369
1726
  top: `${s.value.top}px`,
1370
1727
  left: `${s.value.left}px`
1371
1728
  } : {});
1372
- Je(u, (h) => {
1373
- const m = h[0];
1374
- m && (o.value = m.contentRect.width);
1729
+ qe(u, (v) => {
1730
+ const g = v[0];
1731
+ g && (a.value = g.contentRect.width);
1375
1732
  });
1376
- const P = () => {
1377
- r.value || R(), r.value = !r.value;
1378
- }, R = () => {
1379
- if (!a.value) return;
1380
- const h = a.value.getBoundingClientRect(), m = window.innerHeight, C = v.value.length * 40 + 16, b = m - h.bottom, p = h.top;
1381
- c.value = b < C && p > C, c.value ? s.value = {
1382
- top: h.top,
1383
- left: h.left
1384
- } : s.value = {
1385
- top: h.bottom,
1386
- left: h.left
1733
+ const Z = () => {
1734
+ c.value || y(), c.value = !c.value;
1735
+ }, y = () => {
1736
+ if (!o.value) return;
1737
+ const v = o.value.getBoundingClientRect(), g = window.innerHeight, k = window.innerWidth, C = f.value.length * 40 + 16, x = 160, I = g - v.bottom, X = v.top;
1738
+ r.value = I < C && X > C;
1739
+ let M = v.left;
1740
+ M + x > k && (M = Math.max(0, v.right - x)), s.value = {
1741
+ top: r.value ? v.top : v.bottom,
1742
+ left: M
1387
1743
  };
1388
1744
  };
1389
1745
  ot(u, () => {
1390
- r.value = !1;
1746
+ c.value = !1;
1391
1747
  });
1392
- const w = (h, m) => {
1393
- r.value = !1;
1394
- const C = n.config.actions?.[h];
1395
- typeof C == "object" && C.handler && C.handler(n.rowIndex, n.store) === !1 || l("action", h, n.rowIndex, m);
1748
+ const m = (v, g) => {
1749
+ c.value = !1;
1750
+ const k = n.config.actions?.[v];
1751
+ typeof k == "object" && k.handler && k.handler(n.rowIndex, n.store) === !1 || l("action", v, n.rowIndex, g);
1396
1752
  };
1397
- return (h, m) => (y(), k("td", {
1753
+ return (v, g) => (b(), R("td", {
1398
1754
  ref: "actionsCell",
1399
- class: ae(["atable-row-actions", { "sticky-column": e.position === "before-index", "dropdown-active": r.value }])
1755
+ class: ae(["atable-row-actions", { "sticky-column": e.position === "before-index", "dropdown-active": c.value }])
1400
1756
  }, [
1401
- x.value ? (y(), k("div", lo, [
1402
- F("button", {
1757
+ w.value ? (b(), R("div", io, [
1758
+ z("button", {
1403
1759
  ref: "toggleButton",
1404
1760
  type: "button",
1405
1761
  class: "row-actions-toggle",
1406
- "aria-expanded": r.value,
1762
+ "aria-expanded": c.value,
1407
1763
  "aria-haspopup": "true",
1408
- onClick: Se(P, ["stop"])
1409
- }, [...m[0] || (m[0] = [
1410
- F("span", { class: "dropdown-icon" }, "⋮", -1)
1411
- ])], 8, ao),
1412
- de(F("div", {
1413
- class: ae(["row-actions-menu", { "menu-flipped": c.value }]),
1414
- style: pe(I.value),
1764
+ onClick: $e(Z, ["stop"])
1765
+ }, [...g[0] || (g[0] = [
1766
+ z("span", { class: "dropdown-icon" }, "⋮", -1)
1767
+ ])], 8, ro),
1768
+ ue(z("div", {
1769
+ class: ae(["row-actions-menu", { "menu-flipped": r.value }]),
1770
+ style: pe(L.value),
1415
1771
  role: "menu"
1416
1772
  }, [
1417
- (y(!0), k(me, null, Ce(v.value, (C) => (y(), k("button", {
1418
- key: C.type,
1773
+ (b(!0), R(me, null, be(f.value, (k) => (b(), R("button", {
1774
+ key: k.type,
1419
1775
  type: "button",
1420
1776
  class: "row-action-menu-item",
1421
1777
  role: "menuitem",
1422
- onClick: Se((b) => w(C.type, b), ["stop"])
1778
+ disabled: k.disabled,
1779
+ onClick: $e((C) => m(k.type, C), ["stop"])
1423
1780
  }, [
1424
- F("span", {
1781
+ z("span", {
1425
1782
  class: "action-icon",
1426
- innerHTML: C.icon
1427
- }, null, 8, io),
1428
- F("span", ro, be(C.label), 1)
1429
- ], 8, so))), 128))
1783
+ innerHTML: k.icon
1784
+ }, null, 8, uo),
1785
+ z("span", fo, ye(k.label), 1)
1786
+ ], 8, co))), 128))
1430
1787
  ], 6), [
1431
- [it, r.value]
1788
+ [it, c.value]
1432
1789
  ])
1433
- ])) : (y(), k("div", co, [
1434
- (y(!0), k(me, null, Ce(v.value, (C) => (y(), k("button", {
1435
- key: C.type,
1790
+ ])) : (b(), R("div", vo, [
1791
+ (b(!0), R(me, null, be(f.value, (k) => (b(), R("button", {
1792
+ key: k.type,
1436
1793
  type: "button",
1437
1794
  class: "row-action-btn",
1438
- title: C.label,
1439
- "aria-label": C.label,
1440
- onClick: Se((b) => w(C.type, b), ["stop"])
1795
+ title: k.label,
1796
+ "aria-label": k.label,
1797
+ disabled: k.disabled,
1798
+ onClick: $e((C) => m(k.type, C), ["stop"])
1441
1799
  }, [
1442
- F("span", {
1800
+ z("span", {
1443
1801
  class: "action-icon",
1444
- innerHTML: C.icon
1445
- }, null, 8, fo)
1446
- ], 8, uo))), 128))
1802
+ innerHTML: k.icon
1803
+ }, null, 8, mo)
1804
+ ], 8, ho))), 128))
1447
1805
  ]))
1448
1806
  ], 2));
1449
1807
  }
1450
- }), vo = ["tabindex"], ho = /* @__PURE__ */ xe({
1808
+ }), go = ["tabindex"], wo = ["tabindex"], po = ["colspan"], xo = /* @__PURE__ */ Ce({
1451
1809
  __name: "ARow",
1452
1810
  props: {
1453
1811
  rowIndex: {},
@@ -1457,79 +1815,105 @@ const Hn = (e) => {
1457
1815
  },
1458
1816
  emits: ["row:action", "row:click"],
1459
1817
  setup(e, { emit: t }) {
1460
- const n = t, l = ce("rowEl"), u = $(() => e.store.isRowVisible(e.rowIndex)), a = $(() => e.store.getRowExpandSymbol(e.rowIndex)), o = $(() => e.store.config.clickable ?? !1), r = $(() => e.store.config.rowActions || { enabled: !1 }), c = $(() => r.value.enabled), s = $(() => r.value.position || "before-index"), f = (x, I, P) => {
1461
- n("row:action", x, I, P);
1462
- }, v = (x) => {
1463
- const I = x.target;
1464
- I.closest(".atable-row-actions") || I.closest(".tree-index") || n("row:click", e.rowIndex, x);
1465
- };
1466
- if (e.addNavigation) {
1467
- let x = qe;
1468
- typeof e.addNavigation == "object" && (x = {
1469
- ...x,
1470
- ...e.addNavigation
1471
- }), ft([
1818
+ const n = t, l = de("rowEl"), u = T(() => e.store.isRowVisible(e.rowIndex)), o = T(() => e.store.getRowExpandSymbol(e.rowIndex)), a = T(() => e.store.config.clickable ?? !1), c = T(() => e.store.config.rowActions || { enabled: !1 }), r = T(() => c.value.enabled), s = T(() => c.value.position || "before-index"), h = T(() => e.store.config.view === "list-expansion" && !!e.store.display[e.rowIndex]?.expanded), f = T(() => {
1819
+ const y = e.store.config.view === "uncounted" ? 0 : 1, m = r.value ? 1 : 0;
1820
+ return e.store.columns.length + y + m;
1821
+ }), w = (y, m, v) => {
1822
+ n("row:action", y, m, v);
1823
+ }, L = (y) => {
1824
+ const m = y.target;
1825
+ m.closest(".atable-row-actions") || m.closest(".tree-index") || m.closest(".expansion-index") || n("row:click", e.rowIndex, y);
1826
+ }, Z = e.store.config.view === "list-expansion";
1827
+ if (e.addNavigation || Z) {
1828
+ let y = {};
1829
+ e.addNavigation === !0 ? y = { ...Je } : typeof e.addNavigation == "object" && (y = { ...Je, ...e.addNavigation }), Z && !y["keydown.control.g"] && (y["keydown.control.g"] = (m) => {
1830
+ m.stopPropagation(), m.preventDefault(), e.store.toggleRowExpand(e.rowIndex);
1831
+ }), It([
1472
1832
  {
1473
1833
  selectors: l,
1474
- handlers: x
1834
+ handlers: y
1475
1835
  }
1476
1836
  ]);
1477
1837
  }
1478
- return (x, I) => de((y(), k("tr", {
1479
- ref: "rowEl",
1480
- tabindex: e.tabIndex,
1481
- class: ae(["atable-row", { "atable-row-clickable": o.value }]),
1482
- onClick: v
1483
- }, [
1484
- c.value && s.value === "before-index" ? (y(), he(Ue, {
1485
- key: 0,
1486
- "row-index": e.rowIndex,
1487
- store: e.store,
1488
- config: r.value,
1489
- position: s.value,
1490
- onAction: f
1491
- }, null, 8, ["row-index", "store", "config", "position"])) : ee("", !0),
1492
- e.store.config.view !== "uncounted" ? fe(x.$slots, "index", { key: 1 }, () => [
1493
- e.store.config.view === "list" ? (y(), k("td", {
1838
+ return (y, m) => (b(), R(me, null, [
1839
+ ue(z("tr", st(y.$attrs, {
1840
+ ref: "rowEl",
1841
+ tabindex: e.tabIndex,
1842
+ class: ["atable-row", { "atable-row-clickable": a.value }],
1843
+ onClick: L
1844
+ }), [
1845
+ r.value && s.value === "before-index" ? (b(), ve(Ye, {
1494
1846
  key: 0,
1847
+ "row-index": e.rowIndex,
1848
+ store: e.store,
1849
+ config: c.value,
1850
+ position: s.value,
1851
+ onAction: w
1852
+ }, null, 8, ["row-index", "store", "config", "position"])) : _("", !0),
1853
+ e.store.config.view !== "uncounted" ? he(y.$slots, "index", { key: 1 }, () => [
1854
+ e.store.config.view === "list" ? (b(), R("td", {
1855
+ key: 0,
1856
+ tabIndex: -1,
1857
+ class: ae(["list-index", e.store.hasPinnedColumns ? "sticky-index" : ""])
1858
+ }, ye(e.rowIndex + 1), 3)) : e.store.isTreeView ? (b(), R("td", {
1859
+ key: 1,
1860
+ tabIndex: -1,
1861
+ class: ae(["tree-index", e.store.hasPinnedColumns ? "sticky-index" : ""]),
1862
+ onClick: m[0] || (m[0] = (v) => e.store.toggleRowExpand(e.rowIndex))
1863
+ }, ye(o.value), 3)) : e.store.config.view === "list-expansion" ? (b(), R("td", {
1864
+ key: 2,
1865
+ tabIndex: -1,
1866
+ class: ae(["expansion-index", e.store.hasPinnedColumns ? "sticky-index" : ""]),
1867
+ onClick: m[1] || (m[1] = (v) => e.store.toggleRowExpand(e.rowIndex))
1868
+ }, ye(o.value), 3)) : _("", !0)
1869
+ ], !0) : _("", !0),
1870
+ r.value && s.value === "after-index" ? (b(), ve(Ye, {
1871
+ key: 2,
1872
+ "row-index": e.rowIndex,
1873
+ store: e.store,
1874
+ config: c.value,
1875
+ position: s.value,
1876
+ onAction: w
1877
+ }, null, 8, ["row-index", "store", "config", "position"])) : _("", !0),
1878
+ he(y.$slots, "default", {}, void 0, !0),
1879
+ r.value && s.value === "end" ? (b(), ve(Ye, {
1880
+ key: 3,
1881
+ "row-index": e.rowIndex,
1882
+ store: e.store,
1883
+ config: c.value,
1884
+ position: s.value,
1885
+ onAction: w
1886
+ }, null, 8, ["row-index", "store", "config", "position"])) : _("", !0)
1887
+ ], 16, go), [
1888
+ [it, u.value]
1889
+ ]),
1890
+ h.value ? (b(), R("tr", {
1891
+ key: 0,
1892
+ tabindex: e.tabIndex,
1893
+ class: "atable-expanded-row"
1894
+ }, [
1895
+ z("td", {
1495
1896
  tabIndex: -1,
1496
- class: ae(["list-index", e.store.hasPinnedColumns ? "sticky-index" : ""])
1497
- }, be(e.rowIndex + 1), 3)) : e.store.isTreeView ? (y(), k("td", {
1498
- key: 1,
1499
- tabIndex: -1,
1500
- class: ae(["tree-index", e.store.hasPinnedColumns ? "sticky-index" : ""]),
1501
- onClick: I[0] || (I[0] = (P) => e.store.toggleRowExpand(e.rowIndex))
1502
- }, be(a.value), 3)) : ee("", !0)
1503
- ], !0) : ee("", !0),
1504
- c.value && s.value === "after-index" ? (y(), he(Ue, {
1505
- key: 2,
1506
- "row-index": e.rowIndex,
1507
- store: e.store,
1508
- config: r.value,
1509
- position: s.value,
1510
- onAction: f
1511
- }, null, 8, ["row-index", "store", "config", "position"])) : ee("", !0),
1512
- fe(x.$slots, "default", {}, void 0, !0),
1513
- c.value && s.value === "end" ? (y(), he(Ue, {
1514
- key: 3,
1515
- "row-index": e.rowIndex,
1516
- store: e.store,
1517
- config: r.value,
1518
- position: s.value,
1519
- onAction: f
1520
- }, null, 8, ["row-index", "store", "config", "position"])) : ee("", !0)
1521
- ], 10, vo)), [
1522
- [it, u.value]
1523
- ]);
1897
+ colspan: f.value,
1898
+ class: "atable-expanded-content"
1899
+ }, [
1900
+ he(y.$slots, "content", {
1901
+ row: e.store.rows[e.rowIndex],
1902
+ rowIndex: e.rowIndex,
1903
+ store: e.store
1904
+ }, void 0, !0)
1905
+ ], 8, po)
1906
+ ], 8, wo)) : _("", !0)
1907
+ ], 64));
1524
1908
  }
1525
- }), Dt = /* @__PURE__ */ $e(ho, [["__scopeId", "data-v-533161af"]]), nt = /* @__PURE__ */ new WeakMap(), mo = {
1909
+ }), Bt = /* @__PURE__ */ Ae(xo, [["__scopeId", "data-v-4dd47763"]]), nt = /* @__PURE__ */ new WeakMap(), yo = {
1526
1910
  mounted(e, t) {
1527
1911
  const n = !t.modifiers.bubble;
1528
1912
  let l;
1529
1913
  if (typeof t.value == "function") l = ot(e, t.value, { capture: n });
1530
1914
  else {
1531
- const [u, a] = t.value;
1532
- l = ot(e, u, Object.assign({ capture: n }, a));
1915
+ const [u, o] = t.value;
1916
+ l = ot(e, u, Object.assign({ capture: n }, o));
1533
1917
  }
1534
1918
  nt.set(e, l);
1535
1919
  },
@@ -1537,21 +1921,21 @@ const Hn = (e) => {
1537
1921
  const t = nt.get(e);
1538
1922
  t && typeof t == "function" ? t() : t?.stop(), nt.delete(e);
1539
1923
  }
1540
- }, go = { mounted(e, t) {
1541
- typeof t.value == "function" ? Je(e, t.value) : Je(e, ...t.value);
1924
+ }, bo = { mounted(e, t) {
1925
+ typeof t.value == "function" ? qe(e, t.value) : qe(e, ...t.value);
1542
1926
  } };
1543
- function wo() {
1927
+ function Co() {
1544
1928
  let e = !1;
1545
1929
  const t = re(!1);
1546
1930
  return (n, l) => {
1547
1931
  if (t.value = l.value, e) return;
1548
1932
  e = !0;
1549
- const u = An(n, l.value);
1550
- ue(t, (a) => u.value = a);
1933
+ const u = Ln(n, l.value);
1934
+ ce(t, (o) => u.value = o);
1551
1935
  };
1552
1936
  }
1553
- wo();
1554
- const po = { class: "gantt-connection-overlay" }, xo = {
1937
+ Co();
1938
+ const ko = { class: "gantt-connection-overlay" }, Mo = {
1555
1939
  class: "connection-svg",
1556
1940
  style: {
1557
1941
  position: "absolute",
@@ -1562,39 +1946,39 @@ const po = { class: "gantt-connection-overlay" }, xo = {
1562
1946
  pointerEvents: "none",
1563
1947
  zIndex: 1
1564
1948
  }
1565
- }, yo = ["d", "stroke-width", "onDblclick"], bo = ["id", "d", "stroke", "stroke-width", "onDblclick"], Co = 0.25, Ge = 16, ko = /* @__PURE__ */ xe({
1949
+ }, Ro = ["d", "stroke-width", "onDblclick"], Eo = ["id", "d", "stroke", "stroke-width", "onDblclick"], To = 0.25, Ge = 16, So = /* @__PURE__ */ Ce({
1566
1950
  __name: "AGanttConnection",
1567
1951
  props: {
1568
1952
  store: {}
1569
1953
  },
1570
1954
  emits: ["connection:delete"],
1571
1955
  setup(e, { emit: t }) {
1572
- const n = t, l = $(() => e.store.connectionPaths.filter((o) => {
1573
- const r = e.store.ganttBars.find((s) => s.id === o.from.barId), c = e.store.ganttBars.find((s) => s.id === o.to.barId);
1574
- return r && c;
1575
- })), u = (o) => {
1576
- const r = e.store.connectionHandles.find(
1577
- (j) => j.barId === o.from.barId && j.side === o.from.side
1578
- ), c = e.store.connectionHandles.find(
1579
- (j) => j.barId === o.to.barId && j.side === o.to.side
1956
+ const n = t, l = T(() => e.store.connectionPaths.filter((a) => {
1957
+ const c = e.store.ganttBars.find((s) => s.id === a.from.barId), r = e.store.ganttBars.find((s) => s.id === a.to.barId);
1958
+ return c && r;
1959
+ })), u = (a) => {
1960
+ const c = e.store.connectionHandles.find(
1961
+ (X) => X.barId === a.from.barId && X.side === a.from.side
1962
+ ), r = e.store.connectionHandles.find(
1963
+ (X) => X.barId === a.to.barId && X.side === a.to.side
1580
1964
  );
1581
- if (!r || !c) return "";
1582
- const s = r.position.x + Ge / 2, f = r.position.y + Ge / 2, v = c.position.x + Ge / 2, x = c.position.y + Ge / 2, I = Math.abs(v - s), P = Math.max(I * Co, 50), R = s + (o.from.side === "left" ? -P : P), w = v + (o.to.side === "left" ? -P : P), h = { x: 0.5 * s + 0.5 * R, y: 0.5 * f + 0.5 * f }, m = { x: 0.5 * R + 0.5 * w, y: 0.5 * f + 0.5 * x }, C = { x: 0.5 * w + 0.5 * v, y: 0.5 * x + 0.5 * x }, b = { x: 0.5 * h.x + 0.5 * m.x, y: 0.5 * h.y + 0.5 * m.y }, p = { x: 0.5 * m.x + 0.5 * C.x, y: 0.5 * m.y + 0.5 * C.y }, O = { x: 0.5 * b.x + 0.5 * p.x, y: 0.5 * b.y + 0.5 * p.y };
1583
- return `M ${s} ${f} Q ${R} ${f}, ${O.x} ${O.y} Q ${w} ${x}, ${v} ${x}`;
1584
- }, a = (o) => {
1585
- e.store.deleteConnection(o.id) && n("connection:delete", o);
1965
+ if (!c || !r) return "";
1966
+ const s = c.position.x + Ge / 2, h = c.position.y + Ge / 2, f = r.position.x + Ge / 2, w = r.position.y + Ge / 2, L = Math.abs(f - s), Z = Math.max(L * To, 50), y = s + (a.from.side === "left" ? -Z : Z), m = f + (a.to.side === "left" ? -Z : Z), v = { x: 0.5 * s + 0.5 * y, y: 0.5 * h + 0.5 * h }, g = { x: 0.5 * y + 0.5 * m, y: 0.5 * h + 0.5 * w }, k = { x: 0.5 * m + 0.5 * f, y: 0.5 * w + 0.5 * w }, C = { x: 0.5 * v.x + 0.5 * g.x, y: 0.5 * v.y + 0.5 * g.y }, x = { x: 0.5 * g.x + 0.5 * k.x, y: 0.5 * g.y + 0.5 * k.y }, I = { x: 0.5 * C.x + 0.5 * x.x, y: 0.5 * C.y + 0.5 * x.y };
1967
+ return `M ${s} ${h} Q ${y} ${h}, ${I.x} ${I.y} Q ${m} ${w}, ${f} ${w}`;
1968
+ }, o = (a) => {
1969
+ e.store.deleteConnection(a.id) && n("connection:delete", a);
1586
1970
  };
1587
- return (o, r) => (y(), k("div", po, [
1588
- (y(), k("svg", xo, [
1589
- r[0] || (r[0] = F("defs", null, [
1590
- F("path", {
1971
+ return (a, c) => (b(), R("div", ko, [
1972
+ (b(), R("svg", Mo, [
1973
+ c[0] || (c[0] = z("defs", null, [
1974
+ z("path", {
1591
1975
  id: "arrowhead",
1592
1976
  d: "M 0 -7 L 20 0 L 0 7Z",
1593
1977
  stroke: "black",
1594
1978
  "stroke-width": "1",
1595
1979
  fill: "currentColor"
1596
1980
  }),
1597
- F("marker", {
1981
+ z("marker", {
1598
1982
  id: "arrowhead-marker",
1599
1983
  markerWidth: "10",
1600
1984
  markerHeight: "7",
@@ -1603,42 +1987,42 @@ const po = { class: "gantt-connection-overlay" }, xo = {
1603
1987
  orient: "auto",
1604
1988
  markerUnits: "strokeWidth"
1605
1989
  }, [
1606
- F("polygon", {
1990
+ z("polygon", {
1607
1991
  points: "0 0, 10 3.5, 0 7",
1608
1992
  fill: "currentColor"
1609
1993
  })
1610
1994
  ])
1611
1995
  ], -1)),
1612
- (y(!0), k(me, null, Ce(l.value, (c) => (y(), k("path", {
1613
- key: `${c.id}-hitbox`,
1614
- d: u(c),
1996
+ (b(!0), R(me, null, be(l.value, (r) => (b(), R("path", {
1997
+ key: `${r.id}-hitbox`,
1998
+ d: u(r),
1615
1999
  stroke: "transparent",
1616
- "stroke-width": (c.style?.width || 2) + 10,
2000
+ "stroke-width": (r.style?.width || 2) + 10,
1617
2001
  fill: "none",
1618
2002
  class: "connection-hitbox",
1619
- onDblclick: (s) => a(c)
1620
- }, null, 40, yo))), 128)),
1621
- (y(!0), k(me, null, Ce(l.value, (c) => (y(), k("path", {
1622
- id: c.id,
1623
- key: c.id,
1624
- d: u(c),
1625
- stroke: c.style?.color || "#666",
1626
- "stroke-width": c.style?.width || 2,
2003
+ onDblclick: (s) => o(r)
2004
+ }, null, 40, Ro))), 128)),
2005
+ (b(!0), R(me, null, be(l.value, (r) => (b(), R("path", {
2006
+ id: r.id,
2007
+ key: r.id,
2008
+ d: u(r),
2009
+ stroke: r.style?.color || "#666",
2010
+ "stroke-width": r.style?.width || 2,
1627
2011
  fill: "none",
1628
2012
  "marker-mid": "url(#arrowhead-marker)",
1629
2013
  class: "connection-path animated-path",
1630
- onDblclick: (s) => a(c)
1631
- }, null, 40, bo))), 128))
2014
+ onDblclick: (s) => o(r)
2015
+ }, null, 40, Eo))), 128))
1632
2016
  ]))
1633
2017
  ]));
1634
2018
  }
1635
- }), Mo = /* @__PURE__ */ $e(ko, [["__scopeId", "data-v-d5929c98"]]), Ro = { class: "column-filter" }, Eo = {
2019
+ }), $o = /* @__PURE__ */ Ae(So, [["__scopeId", "data-v-d5929c98"]]), Io = { class: "column-filter" }, Ao = {
1636
2020
  key: 2,
1637
2021
  class: "checkbox-filter"
1638
- }, $o = ["value"], To = {
2022
+ }, Ho = ["value"], Lo = {
1639
2023
  key: 5,
1640
2024
  class: "date-range-filter"
1641
- }, Io = /* @__PURE__ */ xe({
2025
+ }, Do = /* @__PURE__ */ Ce({
1642
2026
  __name: "ATableColumnFilter",
1643
2027
  props: {
1644
2028
  column: {},
@@ -1646,171 +2030,165 @@ const po = { class: "gantt-connection-overlay" }, xo = {
1646
2030
  store: {}
1647
2031
  },
1648
2032
  setup(e) {
1649
- const t = z(""), n = jt({
2033
+ const t = {
2034
+ text: "text",
2035
+ number: "number",
2036
+ boolean: "checkbox",
2037
+ date: "date",
2038
+ datetime: "dateRange",
2039
+ select: "select",
2040
+ code: "text",
2041
+ link: "text",
2042
+ attach: "text"
2043
+ }, n = W(""), l = Yt({
1650
2044
  startValue: "",
1651
2045
  endValue: ""
1652
- }), l = $(() => {
2046
+ }), u = T(() => {
1653
2047
  if (e.column.filterType) return e.column.filterType;
1654
- switch (e.column.fieldtype) {
1655
- case "Check":
1656
- return "checkbox";
1657
- case "Date":
1658
- return "date";
1659
- case "Datetime":
1660
- return "dateRange";
1661
- case "Select":
1662
- return "select";
1663
- case "Int":
1664
- case "Float":
1665
- case "Currency":
1666
- case "Decimal":
1667
- case "Quantity":
1668
- return "number";
1669
- default:
1670
- return "text";
1671
- }
1672
- }), u = (s) => {
1673
- if (s.filterOptions) return s.filterOptions;
2048
+ const h = Ot(e.column.component);
2049
+ return h ? t[h] : "text";
2050
+ }), o = (h) => {
2051
+ if (h.filterOptions) return h.filterOptions;
1674
2052
  const f = /* @__PURE__ */ new Set();
1675
- return e.store.rows.forEach((v) => {
1676
- const x = v[s.name];
1677
- x != null && x !== "" && f.add(x);
1678
- }), Array.from(f).map((v) => ({
1679
- value: v,
1680
- label: String(v)
2053
+ return e.store.rows.forEach((w) => {
2054
+ const L = w[h.name];
2055
+ L != null && L !== "" && f.add(L);
2056
+ }), Array.from(f).map((w) => ({
2057
+ value: w,
2058
+ label: String(w)
1681
2059
  }));
1682
- }, a = $(() => !!(t.value || n.startValue || n.endValue)), o = (s) => {
1683
- !s && l.value !== "checkbox" ? (e.store.clearFilter(e.colIndex), t.value = "") : (t.value = s, e.store.setFilter(e.colIndex, { value: s }));
1684
- }, r = (s, f) => {
1685
- s === "start" ? n.startValue = f : n.endValue = f, !n.startValue && !n.endValue ? e.store.clearFilter(e.colIndex) : e.store.setFilter(e.colIndex, {
2060
+ }, a = T(() => !!(n.value || l.startValue || l.endValue)), c = (h) => {
2061
+ !h && u.value !== "checkbox" ? (e.store.clearFilter(e.colIndex), n.value = "") : (n.value = h, e.store.setFilter(e.colIndex, { value: h }));
2062
+ }, r = (h, f) => {
2063
+ h === "start" ? l.startValue = f : l.endValue = f, !l.startValue && !l.endValue ? e.store.clearFilter(e.colIndex) : e.store.setFilter(e.colIndex, {
1686
2064
  value: null,
1687
- startValue: n.startValue,
1688
- endValue: n.endValue
2065
+ startValue: l.startValue,
2066
+ endValue: l.endValue
1689
2067
  });
1690
- }, c = () => {
1691
- t.value = "", n.startValue = "", n.endValue = "", e.store.clearFilter(e.colIndex);
2068
+ }, s = () => {
2069
+ n.value = "", l.startValue = "", l.endValue = "", e.store.clearFilter(e.colIndex);
1692
2070
  };
1693
- return (s, f) => (y(), k("div", Ro, [
1694
- l.value === "text" ? de((y(), k("input", {
2071
+ return (h, f) => (b(), R("div", Io, [
2072
+ u.value === "text" ? ue((b(), R("input", {
1695
2073
  key: 0,
1696
- "onUpdate:modelValue": f[0] || (f[0] = (v) => t.value = v),
2074
+ "onUpdate:modelValue": f[0] || (f[0] = (w) => n.value = w),
1697
2075
  type: "text",
1698
2076
  class: "filter-input",
1699
- onInput: f[1] || (f[1] = (v) => o(t.value))
2077
+ onInput: f[1] || (f[1] = (w) => c(n.value))
1700
2078
  }, null, 544)), [
1701
- [Ze, t.value]
1702
- ]) : l.value === "number" ? de((y(), k("input", {
2079
+ [Ze, n.value]
2080
+ ]) : u.value === "number" ? ue((b(), R("input", {
1703
2081
  key: 1,
1704
- "onUpdate:modelValue": f[2] || (f[2] = (v) => t.value = v),
2082
+ "onUpdate:modelValue": f[2] || (f[2] = (w) => n.value = w),
1705
2083
  type: "number",
1706
2084
  class: "filter-input",
1707
- onInput: f[3] || (f[3] = (v) => o(t.value))
2085
+ onInput: f[3] || (f[3] = (w) => c(n.value))
1708
2086
  }, null, 544)), [
1709
- [Ze, t.value]
1710
- ]) : l.value === "checkbox" ? (y(), k("label", Eo, [
1711
- de(F("input", {
1712
- "onUpdate:modelValue": f[4] || (f[4] = (v) => t.value = v),
2087
+ [Ze, n.value]
2088
+ ]) : u.value === "checkbox" ? (b(), R("label", Ao, [
2089
+ ue(z("input", {
2090
+ "onUpdate:modelValue": f[4] || (f[4] = (w) => n.value = w),
1713
2091
  type: "checkbox",
1714
2092
  class: "filter-checkbox",
1715
- onChange: f[5] || (f[5] = (v) => o(t.value))
2093
+ onChange: f[5] || (f[5] = (w) => c(n.value))
1716
2094
  }, null, 544), [
1717
- [Yt, t.value]
2095
+ [Jt, n.value]
1718
2096
  ]),
1719
- F("span", null, be(e.column.label), 1)
1720
- ])) : l.value === "select" ? de((y(), k("select", {
2097
+ z("span", null, ye(e.column.label), 1)
2098
+ ])) : u.value === "select" ? ue((b(), R("select", {
1721
2099
  key: 3,
1722
- "onUpdate:modelValue": f[6] || (f[6] = (v) => t.value = v),
2100
+ "onUpdate:modelValue": f[6] || (f[6] = (w) => n.value = w),
1723
2101
  class: "filter-select",
1724
- onChange: f[7] || (f[7] = (v) => o(t.value))
2102
+ onChange: f[7] || (f[7] = (w) => c(n.value))
1725
2103
  }, [
1726
- f[15] || (f[15] = F("option", { value: "" }, "All", -1)),
1727
- (y(!0), k(me, null, Ce(u(e.column), (v) => (y(), k("option", {
1728
- key: v.value || v,
1729
- value: v.value || v
1730
- }, be(v.label || v), 9, $o))), 128))
2104
+ f[15] || (f[15] = z("option", { value: "" }, "All", -1)),
2105
+ (b(!0), R(me, null, be(o(e.column), (w) => (b(), R("option", {
2106
+ key: w.value || w,
2107
+ value: w.value || w
2108
+ }, ye(w.label || w), 9, Ho))), 128))
1731
2109
  ], 544)), [
1732
- [Ut, t.value]
1733
- ]) : l.value === "date" ? de((y(), k("input", {
2110
+ [qt, n.value]
2111
+ ]) : u.value === "date" ? ue((b(), R("input", {
1734
2112
  key: 4,
1735
- "onUpdate:modelValue": f[8] || (f[8] = (v) => t.value = v),
2113
+ "onUpdate:modelValue": f[8] || (f[8] = (w) => n.value = w),
1736
2114
  type: "date",
1737
2115
  class: "filter-input",
1738
- onChange: f[9] || (f[9] = (v) => o(t.value))
2116
+ onChange: f[9] || (f[9] = (w) => c(n.value))
1739
2117
  }, null, 544)), [
1740
- [Ze, t.value]
1741
- ]) : l.value === "dateRange" ? (y(), k("div", To, [
1742
- de(F("input", {
1743
- "onUpdate:modelValue": f[10] || (f[10] = (v) => n.startValue = v),
2118
+ [Ze, n.value]
2119
+ ]) : u.value === "dateRange" ? (b(), R("div", Lo, [
2120
+ ue(z("input", {
2121
+ "onUpdate:modelValue": f[10] || (f[10] = (w) => l.startValue = w),
1744
2122
  type: "date",
1745
2123
  class: "filter-input",
1746
- onChange: f[11] || (f[11] = (v) => r("start", n.startValue))
2124
+ onChange: f[11] || (f[11] = (w) => r("start", l.startValue))
1747
2125
  }, null, 544), [
1748
- [Ze, n.startValue]
2126
+ [Ze, l.startValue]
1749
2127
  ]),
1750
- f[16] || (f[16] = F("span", { class: "date-separator" }, "-", -1)),
1751
- de(F("input", {
1752
- "onUpdate:modelValue": f[12] || (f[12] = (v) => n.endValue = v),
2128
+ f[16] || (f[16] = z("span", { class: "date-separator" }, "-", -1)),
2129
+ ue(z("input", {
2130
+ "onUpdate:modelValue": f[12] || (f[12] = (w) => l.endValue = w),
1753
2131
  type: "date",
1754
2132
  class: "filter-input",
1755
- onChange: f[13] || (f[13] = (v) => r("end", n.endValue))
2133
+ onChange: f[13] || (f[13] = (w) => r("end", l.endValue))
1756
2134
  }, null, 544), [
1757
- [Ze, n.endValue]
2135
+ [Ze, l.endValue]
1758
2136
  ])
1759
- ])) : l.value === "component" && e.column.filterComponent ? (y(), he(Ne(e.column.filterComponent), {
2137
+ ])) : u.value === "component" && e.column.filterComponent ? (b(), ve(Ne(e.column.filterComponent), {
1760
2138
  key: 6,
1761
- value: t.value,
2139
+ value: n.value,
1762
2140
  column: e.column,
1763
2141
  "col-index": e.colIndex,
1764
2142
  store: e.store,
1765
- "onUpdate:value": f[14] || (f[14] = (v) => o(v))
1766
- }, null, 40, ["value", "column", "col-index", "store"])) : ee("", !0),
1767
- a.value ? (y(), k("button", {
2143
+ "onUpdate:value": f[14] || (f[14] = (w) => c(w))
2144
+ }, null, 40, ["value", "column", "col-index", "store"])) : _("", !0),
2145
+ a.value ? (b(), R("button", {
1768
2146
  key: 7,
1769
2147
  class: "clear-btn",
1770
2148
  title: "Clear",
1771
- onClick: c
1772
- }, "×")) : ee("", !0)
2149
+ onClick: s
2150
+ }, "×")) : _("", !0)
1773
2151
  ]));
1774
2152
  }
1775
- }), So = /* @__PURE__ */ $e(Io, [["__scopeId", "data-v-e0efa4a9"]]), Ao = { key: 0 }, Ho = {
2153
+ }), Oo = /* @__PURE__ */ Ae(Do, [["__scopeId", "data-v-b57e3235"]]), Vo = { key: 0 }, Bo = {
1776
2154
  class: "atable-header-row",
1777
2155
  tabindex: "-1"
1778
- }, Lo = {
2156
+ }, Po = {
1779
2157
  key: 2,
1780
2158
  class: "row-actions-header"
1781
- }, Do = ["data-colindex", "onClick"], Oo = {
2159
+ }, Zo = ["data-colindex", "onClick"], No = {
1782
2160
  key: 3,
1783
2161
  class: "row-actions-header"
1784
- }, Vo = {
2162
+ }, Fo = {
1785
2163
  key: 0,
1786
2164
  class: "atable-filters-row"
1787
- }, Bo = {
2165
+ }, Wo = {
1788
2166
  key: 2,
1789
2167
  class: "row-actions-header"
1790
- }, Po = {
2168
+ }, zo = {
1791
2169
  key: 3,
1792
2170
  class: "row-actions-header"
1793
- }, Ot = /* @__PURE__ */ xe({
2171
+ }, Pt = /* @__PURE__ */ Ce({
1794
2172
  __name: "ATableHeader",
1795
2173
  props: {
1796
2174
  columns: {},
1797
2175
  store: {}
1798
2176
  },
1799
2177
  setup(e) {
1800
- const t = $(() => e.columns.filter((o) => o.filterable)), n = $(() => e.store.config.rowActions?.enabled ?? !1), l = $(() => e.store.config.rowActions?.position ?? "before-index"), u = (o) => e.store.sortByColumn(o), a = (o) => {
1801
- for (const r of o) {
1802
- if (r.borderBoxSize.length === 0) continue;
1803
- const s = r.borderBoxSize[0].inlineSize, f = Number(r.target.dataset.colindex), v = e.store.columns[f]?.width;
1804
- typeof v == "number" && v !== s && e.store.resizeColumn(f, s);
2178
+ const t = T(() => e.columns.filter((a) => a.filterable)), n = T(() => e.store.config.rowActions?.enabled ?? !1), l = T(() => e.store.config.rowActions?.position ?? "before-index"), u = (a) => e.store.sortByColumn(a), o = (a) => {
2179
+ for (const c of a) {
2180
+ if (c.borderBoxSize.length === 0) continue;
2181
+ const s = c.borderBoxSize[0].inlineSize, h = Number(c.target.dataset.colindex), f = e.store.columns[h]?.width;
2182
+ typeof f == "number" && f !== s && e.store.resizeColumn(h, s);
1805
2183
  }
1806
2184
  };
1807
- return (o, r) => e.columns.length ? (y(), k("thead", Ao, [
1808
- F("tr", Ho, [
1809
- n.value && l.value === "before-index" ? (y(), k("th", {
2185
+ return (a, c) => e.columns.length ? (b(), R("thead", Vo, [
2186
+ z("tr", Bo, [
2187
+ n.value && l.value === "before-index" ? (b(), R("th", {
1810
2188
  key: 0,
1811
2189
  class: ae(["row-actions-header", { "sticky-column": l.value === "before-index" }])
1812
- }, null, 2)) : ee("", !0),
1813
- e.store.zeroColumn ? (y(), k("th", {
2190
+ }, null, 2)) : _("", !0),
2191
+ e.store.zeroColumn ? (b(), R("th", {
1814
2192
  key: 1,
1815
2193
  id: "header-index",
1816
2194
  class: ae([[
@@ -1818,487 +2196,107 @@ const po = { class: "gantt-connection-overlay" }, xo = {
1818
2196
  e.store.isTreeView ? "tree-index" : "",
1819
2197
  e.store.config.view === "list-expansion" ? "list-expansion-index" : ""
1820
2198
  ], "list-index"])
1821
- }, null, 2)) : ee("", !0),
1822
- n.value && l.value === "after-index" ? (y(), k("th", Lo)) : ee("", !0),
1823
- (y(!0), k(me, null, Ce(e.columns, (c, s) => de((y(), k("th", {
1824
- key: c.name,
2199
+ }, null, 2)) : _("", !0),
2200
+ n.value && l.value === "after-index" ? (b(), R("th", Po)) : _("", !0),
2201
+ (b(!0), R(me, null, be(e.columns, (r, s) => ue((b(), R("th", {
2202
+ key: r.name,
1825
2203
  "data-colindex": s,
1826
2204
  tabindex: "-1",
1827
- style: pe(e.store.getHeaderCellStyle(c)),
1828
- class: ae(`${c.pinned ? "sticky-column" : ""} ${c.sortable === !1 ? "" : "cursor-pointer"}`),
1829
- onClick: (f) => c.sortable !== !1 ? u(s) : void 0
2205
+ style: pe(e.store.getHeaderCellStyle(r)),
2206
+ class: ae(`${r.pinned ? "sticky-column" : ""} ${r.sortable === !1 ? "" : "cursor-pointer"}`),
2207
+ onClick: (h) => r.sortable !== !1 ? u(s) : void 0
1830
2208
  }, [
1831
- fe(o.$slots, "default", {}, () => [
1832
- Jt(be(c.label || String.fromCharCode(s + 97).toUpperCase()), 1)
2209
+ he(a.$slots, "default", {}, () => [
2210
+ Qt(ye(r.label || String.fromCharCode(s + 97).toUpperCase()), 1)
1833
2211
  ])
1834
- ], 14, Do)), [
1835
- [B(go), a]
2212
+ ], 14, Zo)), [
2213
+ [P(bo), o]
1836
2214
  ])), 128)),
1837
- n.value && l.value === "end" ? (y(), k("th", Oo)) : ee("", !0)
2215
+ n.value && l.value === "end" ? (b(), R("th", No)) : _("", !0)
1838
2216
  ]),
1839
- t.value.length > 0 ? (y(), k("tr", Vo, [
1840
- n.value && l.value === "before-index" ? (y(), k("th", {
2217
+ t.value.length > 0 ? (b(), R("tr", Fo, [
2218
+ n.value && l.value === "before-index" ? (b(), R("th", {
1841
2219
  key: 0,
1842
2220
  class: ae(["row-actions-header", { "sticky-column": l.value === "before-index" }])
1843
- }, null, 2)) : ee("", !0),
1844
- e.store.zeroColumn ? (y(), k("th", {
2221
+ }, null, 2)) : _("", !0),
2222
+ e.store.zeroColumn ? (b(), R("th", {
1845
2223
  key: 1,
1846
2224
  class: ae([[
1847
2225
  e.store.hasPinnedColumns ? "sticky-index" : "",
1848
2226
  e.store.isTreeView ? "tree-index" : "",
1849
2227
  e.store.config.view === "list-expansion" ? "list-expansion-index" : ""
1850
2228
  ], "list-index"])
1851
- }, null, 2)) : ee("", !0),
1852
- n.value && l.value === "after-index" ? (y(), k("th", Bo)) : ee("", !0),
1853
- (y(!0), k(me, null, Ce(e.columns, (c, s) => (y(), k("th", {
1854
- key: `filter-${c.name}`,
1855
- class: ae(`${c.pinned ? "sticky-column" : ""}`),
1856
- style: pe(e.store.getHeaderCellStyle(c))
2229
+ }, null, 2)) : _("", !0),
2230
+ n.value && l.value === "after-index" ? (b(), R("th", Wo)) : _("", !0),
2231
+ (b(!0), R(me, null, be(e.columns, (r, s) => (b(), R("th", {
2232
+ key: `filter-${r.name}`,
2233
+ class: ae(`${r.pinned ? "sticky-column" : ""}`),
2234
+ style: pe(e.store.getHeaderCellStyle(r))
1857
2235
  }, [
1858
- c.filterable ? (y(), he(So, {
2236
+ r.filterable ? (b(), ve(Oo, {
1859
2237
  key: 0,
1860
- column: c,
2238
+ column: r,
1861
2239
  "col-index": s,
1862
2240
  store: e.store
1863
- }, null, 8, ["column", "col-index", "store"])) : ee("", !0)
2241
+ }, null, 8, ["column", "col-index", "store"])) : _("", !0)
1864
2242
  ], 6))), 128)),
1865
- n.value && l.value === "end" ? (y(), k("th", Po)) : ee("", !0)
1866
- ])) : ee("", !0)
1867
- ])) : ee("", !0);
2243
+ n.value && l.value === "end" ? (b(), R("th", zo)) : _("", !0)
2244
+ ])) : _("", !0)
2245
+ ])) : _("", !0);
1868
2246
  }
1869
- }), Vt = /* @__PURE__ */ xe({
2247
+ }), Zt = /* @__PURE__ */ Ce({
1870
2248
  __name: "ATableModal",
1871
2249
  props: {
1872
2250
  store: {}
1873
2251
  },
1874
2252
  setup(e) {
1875
- const t = ce("amodal"), { width: n, height: l } = Te(t), u = $(() => {
2253
+ const t = de("amodal"), { width: n, height: l } = Te(t), u = T(() => {
1876
2254
  if (!(e.store.modal.height && e.store.modal.width && e.store.modal.left && e.store.modal.bottom)) return {};
1877
- const a = e.store.modal.cell?.closest("table");
1878
- if (!a) return {};
1879
- const o = a.offsetHeight || 0, r = a.offsetWidth || 0;
1880
- let c = e.store.modal.cell?.offsetTop || 0;
1881
- const s = a.querySelector("thead")?.offsetHeight || 0;
1882
- c += s, c = c + l.value < o ? c : c - (l.value + e.store.modal.height);
1883
- let f = e.store.modal.cell?.offsetLeft || 0;
1884
- return f = f + n.value <= r ? f : f - (n.value - e.store.modal.width), {
1885
- left: `${f}px`,
1886
- top: `${c}px`
2255
+ const o = e.store.modal.cell?.closest("table");
2256
+ if (!o) return {};
2257
+ const a = o.offsetHeight || 0, c = o.offsetWidth || 0;
2258
+ let r = e.store.modal.cell?.offsetTop || 0;
2259
+ const s = o.querySelector("thead")?.offsetHeight || 0;
2260
+ r += s, r = r + l.value < a ? r : r - (l.value + e.store.modal.height);
2261
+ let h = e.store.modal.cell?.offsetLeft || 0;
2262
+ return h = h + n.value <= c ? h : h - (n.value - e.store.modal.width), {
2263
+ left: `${h}px`,
2264
+ top: `${r}px`
1887
2265
  };
1888
2266
  });
1889
- return (a, o) => (y(), k("div", {
2267
+ return (o, a) => (b(), R("div", {
1890
2268
  ref: "amodal",
1891
2269
  class: "amodal",
1892
2270
  tabindex: "-1",
1893
2271
  style: pe(u.value),
1894
- onClick: o[0] || (o[0] = Se(() => {
2272
+ onClick: a[0] || (a[0] = $e(() => {
1895
2273
  }, ["stop"])),
1896
- onInput: o[1] || (o[1] = Se(() => {
2274
+ onInput: a[1] || (a[1] = $e(() => {
1897
2275
  }, ["stop"]))
1898
2276
  }, [
1899
- fe(a.$slots, "default")
2277
+ he(o.$slots, "default")
1900
2278
  ], 36));
1901
2279
  }
1902
2280
  });
1903
- function Bt(e, t) {
1904
- const n = t[e];
1905
- if (n.isRoot || n.parent === null || n.parent === void 0)
1906
- return !0;
1907
- const l = n.parent;
1908
- return l < 0 || l >= t.length ? !1 : (t[l].childrenOpen || !1) && Bt(l, t);
1909
- }
1910
- function Zo(e, t, n) {
1911
- const l = n.filterType || "text", u = t.value;
1912
- if (!u && l !== "dateRange" && l !== "checkbox") return !0;
1913
- switch (l) {
1914
- case "text":
1915
- return (typeof e == "object" && e !== null ? Object.values(e).join(" ") : String(e || "")).toLowerCase().includes(String(u).toLowerCase());
1916
- case "number": {
1917
- const a = Number(e), o = Number(u);
1918
- return !isNaN(a) && !isNaN(o) && a === o;
1919
- }
1920
- case "select":
1921
- return e === u;
1922
- case "checkbox":
1923
- return u === !0 ? !!e : !0;
1924
- case "date": {
1925
- let a;
1926
- if (typeof e == "number") {
1927
- const r = new Date(e), c = (/* @__PURE__ */ new Date()).getFullYear();
1928
- a = new Date(c, r.getMonth(), r.getDate());
1929
- } else
1930
- a = new Date(String(e));
1931
- const o = new Date(String(u));
1932
- return a.toDateString() === o.toDateString();
1933
- }
1934
- case "dateRange": {
1935
- const a = t.startValue, o = t.endValue;
1936
- if (!a && !o) return !0;
1937
- let r;
1938
- if (typeof e == "number") {
1939
- const c = new Date(e), s = (/* @__PURE__ */ new Date()).getFullYear();
1940
- r = new Date(s, c.getMonth(), c.getDate());
1941
- } else
1942
- r = new Date(String(e));
1943
- return !(a && r < new Date(String(a)) || o && r > new Date(String(o)));
1944
- }
1945
- default:
1946
- return !0;
1947
- }
1948
- }
1949
- function No(e, t) {
1950
- return t && e === 0 && t > 0 ? `${t}ch` : "inherit";
1951
- }
1952
- const Fo = (e) => {
1953
- const t = e.id || Ln(), n = e.linkResolver ?? null;
1954
- return Qt(`table-${t}`, () => {
1955
- const u = () => {
1956
- const i = [Object.assign({}, { rowModified: !1 })], d = /* @__PURE__ */ new Set();
1957
- for (let D = 0; D < o.value.length; D++) {
1958
- const A = o.value[D];
1959
- A.parent !== null && A.parent !== void 0 && d.add(A.parent);
1960
- }
1961
- const g = (D) => o.value[D]?.gantt !== void 0, S = (D) => {
1962
- for (let A = 0; A < o.value.length; A++)
1963
- if (o.value[A].parent === D && (g(A) || S(A)))
1964
- return !0;
1965
- return !1;
1966
- }, J = (D) => {
1967
- const A = r.value, U = A.view === "tree" || A.view === "tree-gantt" ? A.defaultTreeExpansion : void 0;
1968
- if (!U) return !0;
1969
- switch (U) {
1970
- case "root":
1971
- return !1;
1972
- // Only root nodes are visible, all children start collapsed
1973
- case "branch":
1974
- return S(D);
1975
- case "leaf":
1976
- return !0;
1977
- // All nodes should be expanded
1978
- default:
1979
- return !0;
1980
- }
1981
- };
1982
- for (let D = 0; D < o.value.length; D++) {
1983
- const A = o.value[D], U = A.parent === null || A.parent === void 0, ie = d.has(D);
1984
- i[D] = {
1985
- childrenOpen: J(D),
1986
- expanded: !1,
1987
- indent: A.indent || 0,
1988
- isParent: ie,
1989
- isRoot: U,
1990
- rowModified: !1,
1991
- open: U,
1992
- // This will be recalculated later for non-root nodes
1993
- parent: A.parent
1994
- };
1995
- }
1996
- return i;
1997
- }, a = z(e.columns), o = z(e.rows), r = z(e.config || {}), c = z({}), s = z({}), f = $(() => {
1998
- const i = {};
1999
- for (const [d, g] of a.value.entries())
2000
- for (const [S, J] of o.value.entries())
2001
- i[`${d}:${S}`] = J[g.name];
2002
- return i;
2003
- }), v = $({
2004
- get: () => {
2005
- const i = u();
2006
- for (let d = 0; d < i.length; d++)
2007
- c.value[d] && (i[d].rowModified = c.value[d]), s.value[d] && (s.value[d].childrenOpen !== void 0 && (i[d].childrenOpen = s.value[d].childrenOpen), s.value[d].expanded !== void 0 && (i[d].expanded = s.value[d].expanded));
2008
- if (p.value)
2009
- for (let d = 0; d < i.length; d++)
2010
- i[d].isRoot || (i[d].open = Bt(d, i));
2011
- return i;
2012
- },
2013
- set: (i) => {
2014
- JSON.stringify(i) !== JSON.stringify(v.value) && (v.value = i);
2015
- }
2016
- }), x = z(e.modal || { visible: !1 }), I = z({}), P = z([]), R = z([]), w = z([]), h = z({
2017
- column: null,
2018
- direction: null
2019
- }), m = z({}), C = $(() => a.value.some((i) => i.pinned)), b = $(() => r.value.view === "gantt" || r.value.view === "tree-gantt"), p = $(() => r.value.view === "tree" || r.value.view === "tree-gantt"), O = $(() => {
2020
- const i = r.value;
2021
- return i.view === "gantt" || i.view === "tree-gantt" ? i.dependencyGraph !== !1 : !0;
2022
- }), j = $(() => `${Math.ceil(o.value.length / 100 + 1)}ch`), E = $(
2023
- () => r.value.view ? ["list", "tree", "tree-gantt", "list-expansion"].includes(r.value.view) : !1
2024
- ), Z = $(() => {
2025
- let i = o.value.map((d, g) => ({
2026
- ...d,
2027
- originalIndex: g
2028
- }));
2029
- if (Object.entries(m.value).forEach(([d, g]) => {
2030
- const S = parseInt(d), J = a.value[S];
2031
- !J || !(g.value || g.startValue || g.endValue || J.filterType === "checkbox" && g.value !== void 0) || (i = i.filter((A) => {
2032
- const U = A[J.name];
2033
- return Zo(U, g, J);
2034
- }));
2035
- }), h.value.column !== null && h.value.direction) {
2036
- const d = a.value[h.value.column], g = h.value.direction;
2037
- i.sort((S, J) => {
2038
- let D = S[d.name], A = J[d.name];
2039
- D == null && (D = ""), A == null && (A = "");
2040
- const U = Number(D), ie = Number(A);
2041
- if (!isNaN(U) && !isNaN(ie) && D !== "" && A !== "")
2042
- return g === "asc" ? U - ie : ie - U;
2043
- {
2044
- const mt = String(D).toLowerCase(), gt = String(A).toLowerCase();
2045
- return g === "asc" ? mt.localeCompare(gt) : gt.localeCompare(mt);
2046
- }
2047
- });
2048
- }
2049
- return i;
2050
- }), N = (i, d) => f.value[`${i}:${d}`], q = (i, d, g) => {
2051
- const S = `${i}:${d}`, J = a.value[i];
2052
- f.value[S] !== g && (c.value[d] = !0), f.value[S] = g, o.value[d] = {
2053
- ...o.value[d],
2054
- [J.name]: g
2055
- };
2056
- }, _ = (i) => {
2057
- o.value = i;
2058
- }, ne = (i, d, g) => {
2059
- const S = `${i}:${d}`;
2060
- f.value[S] !== g && (c.value[d] = !0, I.value[S] = g);
2061
- }, ge = (i) => {
2062
- const d = a.value.indexOf(i) === a.value.length - 1, g = r.value.fullWidth ? i.resizable && !d : i.resizable;
2063
- return {
2064
- width: i.width || "40ch",
2065
- textAlign: i.align || "center",
2066
- ...g && {
2067
- resize: "horizontal",
2068
- overflow: "hidden",
2069
- whiteSpace: "nowrap"
2070
- }
2071
- };
2072
- }, ve = (i, d) => {
2073
- if (i < 0 || i >= a.value.length) return;
2074
- const S = Math.max(d, 40);
2075
- a.value[i] = {
2076
- ...a.value[i],
2077
- width: `${S}px`
2078
- };
2079
- }, Oe = (i) => {
2080
- const d = o.value[i];
2081
- return b.value && d.gantt !== void 0;
2082
- }, Ve = (i) => !p.value || v.value[i].isRoot || v.value[i].open, Be = (i) => !p.value && r.value.view !== "list-expansion" ? "" : p.value && (v.value[i].isRoot || v.value[i].isParent) ? v.value[i].childrenOpen ? "▼" : "►" : r.value.view === "list-expansion" ? v.value[i].expanded ? "▼" : "►" : "", Pe = (i) => {
2083
- if (p.value) {
2084
- const d = s.value[i] || {}, S = !(d.childrenOpen ?? v.value[i].childrenOpen);
2085
- s.value[i] = {
2086
- ...d,
2087
- childrenOpen: S
2088
- }, S || He(i);
2089
- } else if (r.value.view === "list-expansion") {
2090
- const d = s.value[i] || {}, g = d.expanded ?? v.value[i].expanded;
2091
- s.value[i] = {
2092
- ...d,
2093
- expanded: !g
2094
- };
2095
- }
2096
- }, He = (i) => {
2097
- for (let d = 0; d < o.value.length; d++)
2098
- if (v.value[d].parent === i) {
2099
- const g = s.value[d] || {};
2100
- s.value[d] = {
2101
- ...g,
2102
- childrenOpen: !1
2103
- }, He(d);
2104
- }
2105
- }, M = (i, d) => {
2106
- const g = N(i, d);
2107
- return L(i, d, g);
2108
- }, L = (i, d, g) => {
2109
- const S = a.value[i], J = o.value[d], D = S.format;
2110
- if (!D)
2111
- switch (S.fieldtype) {
2112
- case "Check":
2113
- return g ? "✓" : "✗";
2114
- case "Date":
2115
- return g != null ? new Date(String(g)).toLocaleDateString() : g;
2116
- case "Datetime":
2117
- return g != null ? new Date(String(g)).toLocaleString() : g;
2118
- default:
2119
- return g;
2120
- }
2121
- return typeof D == "function" ? D(g, { table: f.value, row: J, column: S }) : typeof D == "string" ? Function(`"use strict";return (${D})`)()(g, { table: f.value, row: J, column: S }) : g;
2122
- }, W = (i) => {
2123
- i.target instanceof Node && x.value.parent?.contains(i.target) || x.value.visible && (x.value.visible = !1);
2124
- }, Q = (i) => {
2125
- const d = o.value[i.rowIndex]?.gantt;
2126
- d && (i.type === "resize" ? i.edge === "start" ? (d.startIndex = i.newStart, d.endIndex = i.end, d.colspan = d.endIndex - d.startIndex) : i.edge === "end" && (d.startIndex = i.start, d.endIndex = i.newEnd, d.colspan = d.endIndex - d.startIndex) : i.type === "bar" && (d.startIndex = i.newStart, d.endIndex = i.newEnd, d.colspan = d.endIndex - d.startIndex));
2127
- }, X = (i) => {
2128
- const d = P.value.findIndex((g) => g.id === i.id);
2129
- d >= 0 ? P.value[d] = i : P.value.push(i);
2130
- }, oe = (i) => {
2131
- const d = P.value.findIndex((g) => g.id === i);
2132
- d >= 0 && P.value.splice(d, 1);
2133
- }, ye = (i) => {
2134
- const d = R.value.findIndex((g) => g.id === i.id);
2135
- d >= 0 ? R.value[d] = i : R.value.push(i);
2136
- }, Re = (i) => {
2137
- const d = R.value.findIndex((g) => g.id === i);
2138
- d >= 0 && R.value.splice(d, 1);
2139
- }, T = (i, d, g) => {
2140
- const S = R.value.find((A) => A.id === i), J = R.value.find((A) => A.id === d);
2141
- if (!S || !J)
2142
- return console.warn("Cannot create connection: handle not found"), null;
2143
- const D = {
2144
- id: `connection-${i}-${d}`,
2145
- from: {
2146
- barId: S.barId,
2147
- side: S.side
2148
- },
2149
- to: {
2150
- barId: J.barId,
2151
- side: J.side
2152
- },
2153
- style: g?.style,
2154
- label: g?.label
2155
- };
2156
- return w.value.push(D), D;
2157
- }, V = (i) => {
2158
- const d = w.value.findIndex((g) => g.id === i);
2159
- return d >= 0 ? (w.value.splice(d, 1), !0) : !1;
2160
- }, Y = (i) => w.value.filter((d) => d.from.barId === i || d.to.barId === i), G = (i) => R.value.filter((d) => d.barId === i), K = (i) => {
2161
- if (a.value[i].sortable === !1) return;
2162
- let g;
2163
- h.value.column === i && h.value.direction === "asc" ? g = "desc" : g = "asc", h.value.column = i, h.value.direction = g;
2164
- }, te = (i, d) => {
2165
- !d.value && !d.startValue && !d.endValue ? delete m.value[i] : m.value[i] = d;
2166
- }, le = (i) => {
2167
- delete m.value[i];
2168
- }, se = (i, d = "end") => {
2169
- const g = {};
2170
- for (const J of a.value)
2171
- g[J.name] = "";
2172
- i && Object.assign(g, i);
2173
- let S;
2174
- return d === "start" ? (S = 0, o.value.unshift(g)) : d === "end" ? (S = o.value.length, o.value.push(g)) : (S = Math.max(0, Math.min(d, o.value.length)), o.value.splice(S, 0, g)), S;
2175
- };
2176
- return {
2177
- // state
2178
- columns: a,
2179
- config: r,
2180
- connectionHandles: R,
2181
- connectionPaths: w,
2182
- display: v,
2183
- filterState: m,
2184
- ganttBars: P,
2185
- modal: x,
2186
- rows: o,
2187
- sortState: h,
2188
- table: f,
2189
- updates: I,
2190
- // getters
2191
- filteredRows: Z,
2192
- hasPinnedColumns: C,
2193
- isGanttView: b,
2194
- isTreeView: p,
2195
- isDependencyGraphEnabled: O,
2196
- numberedRowWidth: j,
2197
- zeroColumn: E,
2198
- // resolver
2199
- linkResolver: n,
2200
- // actions
2201
- addRow: se,
2202
- clearFilter: le,
2203
- closeModal: W,
2204
- createConnection: T,
2205
- deleteConnection: V,
2206
- deleteRow: (i) => {
2207
- if (i < 0 || i >= o.value.length)
2208
- return null;
2209
- const [d] = o.value.splice(i, 1);
2210
- delete c.value[i], delete s.value[i];
2211
- const g = {}, S = {};
2212
- for (const [J, D] of Object.entries(c.value)) {
2213
- const A = parseInt(J);
2214
- A > i ? g[A - 1] = D : g[A] = D;
2215
- }
2216
- for (const [J, D] of Object.entries(s.value)) {
2217
- const A = parseInt(J);
2218
- A > i ? S[A - 1] = D : S[A] = D;
2219
- }
2220
- return c.value = g, s.value = S, d;
2221
- },
2222
- duplicateRow: (i) => {
2223
- if (i < 0 || i >= o.value.length)
2224
- return -1;
2225
- const d = o.value[i], g = JSON.parse(JSON.stringify(d)), S = i + 1;
2226
- return o.value.splice(S, 0, g), S;
2227
- },
2228
- getCellData: N,
2229
- getCellDisplayValue: M,
2230
- getConnectionsForBar: Y,
2231
- getFormattedValue: L,
2232
- getHandlesForBar: G,
2233
- getHeaderCellStyle: ge,
2234
- getIndent: No,
2235
- getRowExpandSymbol: Be,
2236
- insertRowAbove: (i, d) => {
2237
- const g = Math.max(0, i);
2238
- return se(d, g);
2239
- },
2240
- insertRowBelow: (i, d) => {
2241
- const g = Math.min(i + 1, o.value.length);
2242
- return se(d, g);
2243
- },
2244
- isRowGantt: Oe,
2245
- isRowVisible: Ve,
2246
- moveRow: (i, d) => {
2247
- if (i < 0 || i >= o.value.length || d < 0 || d >= o.value.length || i === d)
2248
- return !1;
2249
- const [g] = o.value.splice(i, 1);
2250
- o.value.splice(d, 0, g);
2251
- const S = {}, J = {};
2252
- for (const [D, A] of Object.entries(c.value)) {
2253
- const U = parseInt(D);
2254
- let ie = U;
2255
- U === i ? ie = d : i < d ? U > i && U <= d && (ie = U - 1) : U >= d && U < i && (ie = U + 1), S[ie] = A;
2256
- }
2257
- for (const [D, A] of Object.entries(s.value)) {
2258
- const U = parseInt(D);
2259
- let ie = U;
2260
- U === i ? ie = d : i < d ? U > i && U <= d && (ie = U - 1) : U >= d && U < i && (ie = U + 1), J[ie] = A;
2261
- }
2262
- return c.value = S, s.value = J, !0;
2263
- },
2264
- registerConnectionHandle: ye,
2265
- registerGanttBar: X,
2266
- resizeColumn: ve,
2267
- setCellData: q,
2268
- setCellText: ne,
2269
- setFilter: te,
2270
- sortByColumn: K,
2271
- toggleRowExpand: Pe,
2272
- unregisterConnectionHandle: Re,
2273
- unregisterGanttBar: oe,
2274
- updateGanttBar: Q,
2275
- updateRows: _
2276
- };
2277
- })();
2278
- };
2279
- function Wo(e) {
2280
- return e.filter((t) => !t.hidden && t.fieldtype).map(({ fieldname: t, hidden: n, ...l }) => {
2281
+ function Xo(e) {
2282
+ return e.filter((t) => !t.hidden && t.component).map(({ fieldname: t, hidden: n, ...l }) => {
2281
2283
  const u = Object.assign({ name: t }, l);
2282
- if (l.fieldtype === "Link" && !l.cellComponent) {
2283
- const a = l, o = typeof a.doctype == "string" ? a.doctype : void 0;
2284
- o && (u.linkDoctype = o), l.format || (u.format = (r) => {
2285
- if (r == null) return "";
2286
- if (typeof r == "object") {
2287
- const c = r.displayText ?? r.id ?? "";
2288
- return typeof c == "string" || typeof c == "number" ? String(c) : "";
2289
- }
2290
- return String(r);
2291
- });
2292
- }
2293
- return u;
2284
+ return l.doctype && !l.cellComponent && (u.linkDoctype = l.doctype, l.format || (u.format = (o) => {
2285
+ if (o == null) return "";
2286
+ if (typeof o == "object") {
2287
+ const a = o.displayText ?? o.id ?? "";
2288
+ return typeof a == "string" || typeof a == "number" ? String(a) : "";
2289
+ }
2290
+ return String(o);
2291
+ })), u;
2294
2292
  });
2295
2293
  }
2296
- const zo = {
2294
+ const Go = {
2297
2295
  class: "atable-container",
2298
2296
  style: { position: "relative" }
2299
- }, Xo = /* @__PURE__ */ xe({
2297
+ }, Uo = /* @__PURE__ */ Ce({
2300
2298
  __name: "ATable",
2301
- props: /* @__PURE__ */ yt({
2299
+ props: /* @__PURE__ */ xt({
2302
2300
  id: { default: "" },
2303
2301
  config: { default: () => new Object() },
2304
2302
  schema: { default: () => [] },
@@ -2309,126 +2307,134 @@ const zo = {
2309
2307
  columns: {},
2310
2308
  columnsModifiers: {}
2311
2309
  }),
2312
- emits: /* @__PURE__ */ yt(["cellUpdate", "gantt:drag", "connection:event", "columns:update", "row:add", "row:click", "row:delete", "row:duplicate", "row:insert-above", "row:insert-below", "row:move", "row:open"], ["update:rows", "update:columns"]),
2310
+ emits: /* @__PURE__ */ xt(["cellUpdate", "gantt:drag", "connection:event", "columns:update", "row:add", "row:click", "row:delete", "row:duplicate", "row:insert-above", "row:insert-below", "row:move", "row:open"], ["update:rows", "update:columns"]),
2313
2311
  setup(e, { expose: t, emit: n }) {
2314
- const l = wt(e, "rows"), u = wt(e, "columns"), a = n, o = ce("table"), r = u.value?.length ? u.value : Wo(e.schema ?? []), c = qt("aformLinkResolver", null), s = Fo({
2315
- columns: r,
2312
+ const l = gt(e, "rows"), u = gt(e, "columns"), o = n, a = de("table"), c = u.value?.length ? u.value : Xo(e.schema ?? []), r = Kt("aformLinkResolver", null), s = Zn({
2313
+ columns: c,
2316
2314
  rows: l.value,
2317
2315
  id: e.id,
2318
2316
  config: e.config,
2319
- linkResolver: e.linkResolver ?? c
2317
+ linkResolver: e.linkResolver ?? r
2320
2318
  });
2321
- s.$onAction(({ name: h, store: m, args: C, after: b }) => {
2322
- if (h === "setCellData" || h === "setCellText") {
2323
- const [p, O, j] = C, E = m.getCellData(p, O);
2324
- b(() => {
2325
- l.value = [...s.rows], a("cellUpdate", { colIndex: p, rowIndex: O, newValue: j, oldValue: E });
2319
+ s.$onAction(({ name: v, store: g, args: k, after: C }) => {
2320
+ if (v === "setCellData" || v === "setCellText") {
2321
+ const [x, I, X] = k, M = g.getCellData(x, I);
2322
+ C(() => {
2323
+ l.value = [...s.rows], o("cellUpdate", { colIndex: x, rowIndex: I, newValue: X, oldValue: M });
2326
2324
  });
2327
- } else if (h === "updateGanttBar") {
2328
- const [p] = C;
2329
- let O = !1;
2330
- p.type === "resize" ? O = p.oldColspan !== p.newColspan : p.type === "bar" && (O = p.oldStart !== p.newStart || p.oldEnd !== p.newEnd), O && b(() => {
2331
- a("gantt:drag", p);
2325
+ } else if (v === "updateGanttBar") {
2326
+ const [x] = k;
2327
+ let I = !1;
2328
+ x.type === "resize" ? I = x.oldColspan !== x.newColspan : x.type === "bar" && (I = x.oldStart !== x.newStart || x.oldEnd !== x.newEnd), I && C(() => {
2329
+ o("gantt:drag", x);
2332
2330
  });
2333
- } else h === "resizeColumn" && b(() => {
2334
- u.value = [...s.columns], a("columns:update", [...s.columns]);
2331
+ } else v === "resizeColumn" && C(() => {
2332
+ u.value = [...s.columns], o("columns:update", [...s.columns]);
2335
2333
  });
2336
- }), ue(
2334
+ }), ce(
2337
2335
  () => l.value,
2338
- (h) => {
2339
- JSON.stringify(h) !== JSON.stringify(s.rows) && (s.rows = [...h]);
2336
+ (v) => {
2337
+ JSON.stringify(v) !== JSON.stringify(s.rows) && (s.rows = [...v]);
2340
2338
  },
2341
2339
  { deep: !0 }
2342
- ), ue(
2340
+ ), ce(
2343
2341
  u,
2344
- (h) => {
2345
- JSON.stringify(h) !== JSON.stringify(s.columns) && (s.columns = [...h], a("columns:update", [...h]));
2342
+ (v) => {
2343
+ v && JSON.stringify(v) !== JSON.stringify(s.columns) && (s.columns = [...v], o("columns:update", [...v]));
2346
2344
  },
2347
2345
  { deep: !0 }
2348
- ), Ae(() => {
2349
- u.value?.some((h) => h.pinned) && (v(), s.isTreeView && Lt(o, v, { childList: !0, subtree: !0 }));
2346
+ ), Ie(() => {
2347
+ u.value?.some((v) => v.pinned) && (f(), s.isTreeView && Lt(a, f, { childList: !0, subtree: !0 }));
2350
2348
  });
2351
- const f = $(() => s.columns.filter((h) => h.pinned).length), v = () => {
2352
- const h = o.value, m = h?.rows[0], C = h?.rows[1], b = m ? Array.from(m.cells) : [];
2353
- for (const [p, O] of b.entries()) {
2354
- const j = C?.cells[p];
2355
- j && (O.style.width = `${j.offsetWidth}px`);
2349
+ const h = T(() => s.columns.filter((v) => v.pinned).length), f = () => {
2350
+ const v = a.value, g = v?.rows[0], k = v?.rows[1], C = g ? Array.from(g.cells) : [];
2351
+ for (const [x, I] of C.entries()) {
2352
+ const X = k?.cells[x];
2353
+ X && (I.style.width = `${X.offsetWidth}px`);
2356
2354
  }
2357
- for (const p of h?.rows || []) {
2358
- let O = 0;
2359
- const j = [];
2360
- for (const E of p.cells)
2361
- (E.classList.contains("sticky-column") || E.classList.contains("sticky-index")) && (E.style.left = `${O}px`, O += E.offsetWidth, j.push(E));
2362
- j.length > 0 && j[j.length - 1].classList.add("sticky-column-edge");
2355
+ for (const x of v?.rows || []) {
2356
+ let I = 0;
2357
+ const X = [];
2358
+ for (const M of x.cells)
2359
+ (M.classList.contains("sticky-column") || M.classList.contains("sticky-index")) && (M.style.left = `${I}px`, I += M.offsetWidth, X.push(M));
2360
+ X.length > 0 && X[X.length - 1].classList.add("sticky-column-edge");
2363
2361
  }
2364
2362
  };
2365
- window.addEventListener("keydown", (h) => {
2366
- if (h.key === "Escape" && s.modal.visible) {
2363
+ window.addEventListener("keydown", (v) => {
2364
+ if (v.key === "Escape" && s.modal.visible) {
2367
2365
  s.modal.visible = !1;
2368
- const m = s.modal.parent;
2369
- m && at().then(() => m.focus());
2366
+ const g = s.modal.parent;
2367
+ g && at().then(() => g.focus());
2370
2368
  }
2371
2369
  });
2372
- const x = (h) => {
2373
- if (!h.gantt || f.value === 0)
2370
+ const w = (v) => {
2371
+ if (!v.gantt || h.value === 0)
2374
2372
  return s.columns;
2375
- const m = [];
2376
- for (let C = 0; C < f.value; C++) {
2377
- const b = { ...s.columns[C] };
2378
- b.originalIndex = C, m.push(b);
2373
+ const g = [];
2374
+ for (let k = 0; k < h.value; k++) {
2375
+ const C = { ...s.columns[k] };
2376
+ C.originalIndex = k, g.push(C);
2379
2377
  }
2380
- return m.push({
2381
- ...s.columns[f.value],
2378
+ return g.push({
2379
+ ...s.columns[h.value],
2382
2380
  isGantt: !0,
2383
- colspan: h.gantt?.colspan || s.columns.length - f.value,
2384
- originalIndex: f.value,
2381
+ colspan: v.gantt?.colspan || s.columns.length - h.value,
2382
+ originalIndex: h.value,
2385
2383
  width: "auto"
2386
2384
  // TODO: refactor to API that can detect when data exists in a cell. Might have be custom and not generalizable
2387
- }), m;
2388
- }, I = (h) => {
2389
- a("connection:event", { type: "create", connection: h });
2390
- }, P = (h) => {
2391
- a("connection:event", { type: "delete", connection: h });
2392
- }, R = (h, m) => {
2393
- const C = s.rows[h];
2394
- a("row:click", { row: C, rowIndex: h, event: m });
2395
- }, w = (h, m, C) => {
2396
- switch (h) {
2385
+ }), g;
2386
+ }, L = (v) => {
2387
+ o("connection:event", { type: "create", connection: v });
2388
+ }, Z = (v) => {
2389
+ o("connection:event", { type: "delete", connection: v });
2390
+ }, y = (v, g) => {
2391
+ const k = s.rows[v];
2392
+ o("row:click", { row: k, rowIndex: v, event: g });
2393
+ }, m = (v, g, k) => {
2394
+ switch (v) {
2397
2395
  case "add": {
2398
- const b = s.addRow({}, m + 1), p = s.rows[b];
2399
- l.value = [...s.rows], a("row:add", { rowIndex: b, row: p });
2396
+ const C = s.addRow({}, g + 1), x = s.rows[C];
2397
+ l.value = [...s.rows], o("row:add", { rowIndex: C, row: x });
2400
2398
  break;
2401
2399
  }
2402
2400
  case "delete": {
2403
- const b = s.deleteRow(m);
2404
- b && (l.value = [...s.rows], a("row:delete", { rowIndex: m, row: b }));
2401
+ const C = s.deleteRow(g);
2402
+ C && (l.value = [...s.rows], o("row:delete", { rowIndex: g, row: C }));
2405
2403
  break;
2406
2404
  }
2407
2405
  case "duplicate": {
2408
- const b = s.duplicateRow(m);
2409
- if (b >= 0) {
2410
- const p = s.rows[b];
2411
- l.value = [...s.rows], a("row:duplicate", { sourceIndex: m, newIndex: b, row: p });
2406
+ const C = s.duplicateRow(g);
2407
+ if (C >= 0) {
2408
+ const x = s.rows[C];
2409
+ l.value = [...s.rows], o("row:duplicate", { sourceIndex: g, newIndex: C, row: x });
2412
2410
  }
2413
2411
  break;
2414
2412
  }
2415
2413
  case "insertAbove": {
2416
- const b = s.insertRowAbove(m), p = s.rows[b];
2417
- l.value = [...s.rows], a("row:insert-above", { targetIndex: m, newIndex: b, row: p });
2414
+ const C = s.insertRowAbove(g), x = s.rows[C];
2415
+ l.value = [...s.rows], o("row:insert-above", { targetIndex: g, newIndex: C, row: x });
2418
2416
  break;
2419
2417
  }
2420
2418
  case "insertBelow": {
2421
- const b = s.insertRowBelow(m), p = s.rows[b];
2422
- l.value = [...s.rows], a("row:insert-below", { targetIndex: m, newIndex: b, row: p });
2419
+ const C = s.insertRowBelow(g), x = s.rows[C];
2420
+ l.value = [...s.rows], o("row:insert-below", { targetIndex: g, newIndex: C, row: x });
2423
2421
  break;
2424
2422
  }
2425
2423
  case "move": {
2426
- a("row:move", { fromIndex: m, toIndex: -1 });
2424
+ o("row:move", { fromIndex: g, toIndex: -1 });
2425
+ break;
2426
+ }
2427
+ case "moveUp": {
2428
+ g > 0 && s.moveRow(g, g - 1) && (l.value = [...s.rows], o("row:move", { fromIndex: g, toIndex: g - 1 }));
2429
+ break;
2430
+ }
2431
+ case "moveDown": {
2432
+ g < s.rows.length - 1 && s.moveRow(g, g + 1) && (l.value = [...s.rows], o("row:move", { fromIndex: g, toIndex: g + 1 }));
2427
2433
  break;
2428
2434
  }
2429
2435
  case "open": {
2430
- const b = s.rows[m];
2431
- a("row:open", { row: b, rowIndex: m, event: C });
2436
+ const C = s.rows[g];
2437
+ o("row:open", { row: C, rowIndex: g, event: k });
2432
2438
  break;
2433
2439
  }
2434
2440
  }
@@ -2446,60 +2452,60 @@ const zo = {
2446
2452
  insertRowAbove: s.insertRowAbove,
2447
2453
  insertRowBelow: s.insertRowBelow,
2448
2454
  moveRow: s.moveRow
2449
- }), (h, m) => (y(), k("div", zo, [
2450
- de((y(), k("table", {
2455
+ }), (v, g) => (b(), R("div", Go, [
2456
+ ue((b(), R("table", {
2451
2457
  ref: "table",
2452
2458
  class: "atable",
2453
2459
  style: pe({
2454
- width: B(s).config.fullWidth ? "100%" : "auto"
2460
+ width: P(s).config.fullWidth ? "100%" : "auto"
2455
2461
  })
2456
2462
  }, [
2457
- fe(h.$slots, "header", { data: B(s) }, () => [
2458
- pt(Ot, {
2459
- columns: B(s).columns,
2460
- store: B(s)
2463
+ he(v.$slots, "header", { data: P(s) }, () => [
2464
+ wt(Pt, {
2465
+ columns: P(s).columns,
2466
+ store: P(s)
2461
2467
  }, null, 8, ["columns", "store"])
2462
2468
  ], !0),
2463
- F("tbody", null, [
2464
- fe(h.$slots, "body", { data: B(s) }, () => [
2465
- (y(!0), k(me, null, Ce(B(s).filteredRows, (C, b) => (y(), he(Dt, {
2466
- key: `${C.originalIndex}-${b}`,
2467
- row: C,
2468
- "row-index": C.originalIndex,
2469
- store: B(s),
2470
- "onRow:action": w,
2471
- "onRow:click": R
2469
+ z("tbody", null, [
2470
+ he(v.$slots, "body", { data: P(s) }, () => [
2471
+ (b(!0), R(me, null, be(P(s).filteredRows, (k, C) => (b(), ve(Bt, {
2472
+ key: `${k.originalIndex}-${C}`,
2473
+ row: k,
2474
+ "row-index": k.originalIndex,
2475
+ store: P(s),
2476
+ "onRow:action": m,
2477
+ "onRow:click": y
2472
2478
  }, {
2473
- default: xt(() => [
2474
- (y(!0), k(me, null, Ce(x(C), (p, O) => (y(), k(me, {
2475
- key: p.name
2479
+ default: pt(() => [
2480
+ (b(!0), R(me, null, be(w(k), (x, I) => (b(), R(me, {
2481
+ key: x.name
2476
2482
  }, [
2477
- p.isGantt ? (y(), he(Ne(p.ganttComponent || "AGanttCell"), {
2483
+ x.isGantt ? (b(), ve(Ne(x.ganttComponent || "AGanttCell"), {
2478
2484
  key: 0,
2479
- store: B(s),
2480
- "columns-count": B(s).columns.length - f.value,
2481
- color: C.gantt?.color,
2482
- start: C.gantt?.startIndex,
2483
- end: C.gantt?.endIndex,
2484
- colspan: p.colspan,
2485
- pinned: p.pinned,
2486
- "row-index": C.originalIndex,
2487
- "col-index": p.originalIndex ?? O,
2485
+ store: P(s),
2486
+ "columns-count": P(s).columns.length - h.value,
2487
+ color: k.gantt?.color,
2488
+ start: k.gantt?.startIndex,
2489
+ end: k.gantt?.endIndex,
2490
+ colspan: x.colspan,
2491
+ pinned: x.pinned,
2492
+ "row-index": k.originalIndex,
2493
+ "col-index": x.originalIndex ?? I,
2488
2494
  style: pe({
2489
- textAlign: p?.align || "center",
2490
- minWidth: p?.width || "40ch",
2491
- width: B(s).config.fullWidth ? "auto" : null
2495
+ textAlign: x?.align || "center",
2496
+ minWidth: x?.width || "40ch",
2497
+ width: P(s).config.fullWidth ? "auto" : null
2492
2498
  }),
2493
- "onConnection:create": I
2494
- }, null, 40, ["store", "columns-count", "color", "start", "end", "colspan", "pinned", "row-index", "col-index", "style"])) : (y(), he(Ne(p.cellComponent || "ACell"), {
2499
+ "onConnection:create": L
2500
+ }, null, 40, ["store", "columns-count", "color", "start", "end", "colspan", "pinned", "row-index", "col-index", "style"])) : (b(), ve(Ne(x.cellComponent || "ACell"), {
2495
2501
  key: 1,
2496
- store: B(s),
2497
- pinned: p.pinned,
2498
- "row-index": C.originalIndex,
2499
- "col-index": O,
2502
+ store: P(s),
2503
+ pinned: x.pinned,
2504
+ "row-index": k.originalIndex,
2505
+ "col-index": I,
2500
2506
  style: pe({
2501
- textAlign: p?.align || "center",
2502
- width: B(s).config.fullWidth ? "auto" : null
2507
+ textAlign: x?.align || "center",
2508
+ width: P(s).config.fullWidth ? "auto" : null
2503
2509
  }),
2504
2510
  spellcheck: "false"
2505
2511
  }, null, 8, ["store", "pinned", "row-index", "col-index", "style"]))
@@ -2509,75 +2515,74 @@ const zo = {
2509
2515
  }, 1032, ["row", "row-index", "store"]))), 128))
2510
2516
  ], !0)
2511
2517
  ]),
2512
- fe(h.$slots, "footer", { data: B(s) }, void 0, !0),
2513
- fe(h.$slots, "modal", { data: B(s) }, () => [
2514
- de(pt(Vt, { store: B(s) }, {
2515
- default: xt(() => [
2516
- (y(), he(Ne(B(s).modal.component), st({
2517
- key: `${B(s).modal.rowIndex}:${B(s).modal.colIndex}`,
2518
- "col-index": B(s).modal.colIndex,
2519
- "row-index": B(s).modal.rowIndex,
2520
- store: B(s)
2521
- }, B(s).modal.componentProps), null, 16, ["col-index", "row-index", "store"]))
2518
+ he(v.$slots, "footer", { data: P(s) }, void 0, !0),
2519
+ he(v.$slots, "modal", { data: P(s) }, () => [
2520
+ ue(wt(Zt, { store: P(s) }, {
2521
+ default: pt(() => [
2522
+ (b(), ve(Ne(P(s).modal.component), st({
2523
+ key: `${P(s).modal.rowIndex}:${P(s).modal.colIndex}`,
2524
+ "col-index": P(s).modal.colIndex,
2525
+ "row-index": P(s).modal.rowIndex,
2526
+ store: P(s)
2527
+ }, P(s).modal.componentProps), null, 16, ["col-index", "row-index", "store"]))
2522
2528
  ]),
2523
2529
  _: 1
2524
2530
  }, 8, ["store"]), [
2525
- [it, B(s).modal.visible]
2531
+ [it, P(s).modal.visible]
2526
2532
  ])
2527
2533
  ], !0)
2528
2534
  ], 4)), [
2529
- [B(mo), B(s).closeModal]
2535
+ [P(yo), P(s).closeModal]
2530
2536
  ]),
2531
- B(s).isGanttView && B(s).isDependencyGraphEnabled ? (y(), he(Mo, {
2537
+ P(s).isGanttView && P(s).isDependencyGraphEnabled ? (b(), ve($o, {
2532
2538
  key: 0,
2533
- store: B(s),
2534
- "onConnection:delete": P
2535
- }, null, 8, ["store"])) : ee("", !0)
2539
+ store: P(s),
2540
+ "onConnection:delete": Z
2541
+ }, null, 8, ["store"])) : _("", !0)
2536
2542
  ]));
2537
2543
  }
2538
- }), Go = /* @__PURE__ */ $e(Xo, [["__scopeId", "data-v-ffa2a0fc"]]), jo = {}, Yo = { class: "aloading" }, Uo = { class: "aloading-header" };
2539
- function Jo(e, t) {
2540
- return y(), k("div", Yo, [
2541
- F("h2", Uo, [
2542
- fe(e.$slots, "default", {}, void 0, !0)
2544
+ }), jo = /* @__PURE__ */ Ae(Uo, [["__scopeId", "data-v-4bfbbeab"]]), Yo = {}, Jo = { class: "aloading" }, qo = { class: "aloading-header" };
2545
+ function Qo(e, t) {
2546
+ return b(), R("div", Jo, [
2547
+ z("h2", qo, [
2548
+ he(e.$slots, "default", {}, void 0, !0)
2543
2549
  ]),
2544
- t[0] || (t[0] = F("div", { class: "aloading-bar" }, null, -1))
2550
+ t[0] || (t[0] = z("div", { class: "aloading-bar" }, null, -1))
2545
2551
  ]);
2546
2552
  }
2547
- const qo = /* @__PURE__ */ $e(jo, [["render", Jo], ["__scopeId", "data-v-a930a25b"]]), Qo = {}, Ko = { class: "aloading" }, _o = { class: "aloading-header" };
2548
- function el(e, t) {
2549
- return y(), k("div", Ko, [
2550
- F("h2", _o, [
2551
- fe(e.$slots, "default", {}, void 0, !0)
2553
+ const Ko = /* @__PURE__ */ Ae(Yo, [["render", Qo], ["__scopeId", "data-v-a930a25b"]]), _o = {}, el = { class: "aloading" }, tl = { class: "aloading-header" };
2554
+ function nl(e, t) {
2555
+ return b(), R("div", el, [
2556
+ z("h2", tl, [
2557
+ he(e.$slots, "default", {}, void 0, !0)
2552
2558
  ]),
2553
- t[0] || (t[0] = F("div", { class: "aloading-bar" }, null, -1))
2559
+ t[0] || (t[0] = z("div", { class: "aloading-bar" }, null, -1))
2554
2560
  ]);
2555
2561
  }
2556
- const tl = /* @__PURE__ */ $e(Qo, [["render", el], ["__scopeId", "data-v-e1165876"]]);
2557
- function rl(e) {
2558
- e.component("ACell", Bn), e.component("AExpansionRow", Wn), e.component("AGanttCell", Jn), e.component("ARow", Dt), e.component("ARowActions", Ue), e.component("ATable", Go), e.component("ATableHeader", Ot), e.component("ATableLoading", qo), e.component("ATableLoadingBar", tl), e.component("ATableModal", Vt);
2562
+ const ol = /* @__PURE__ */ Ae(_o, [["render", nl], ["__scopeId", "data-v-e1165876"]]);
2563
+ function ul(e) {
2564
+ e.component("ACell", zn), e.component("AGanttCell", qn), e.component("ARow", Bt), e.component("ARowActions", Ye), e.component("ATable", jo), e.component("ATableHeader", Pt), e.component("ATableLoading", Ko), e.component("ATableLoadingBar", ol), e.component("ATableModal", Zt);
2559
2565
  }
2560
2566
  export {
2561
- Bn as ACell,
2562
- Wn as AExpansionRow,
2563
- Jn as AGanttCell,
2564
- Dt as ARow,
2565
- Ue as ARowActions,
2566
- Go as ATable,
2567
- Ot as ATableHeader,
2568
- qo as ATableLoading,
2569
- tl as ATableLoadingBar,
2570
- Vt as ATableModal,
2571
- qn as AddIcon,
2572
- Qn as DeleteIcon,
2573
- Kn as DuplicateIcon,
2574
- _n as InsertAboveIcon,
2575
- eo as InsertBelowIcon,
2576
- to as MoveIcon,
2577
- no as OpenIcon,
2578
- oo as actionIcons,
2579
- Fo as createTableStore,
2580
- rl as install,
2581
- Wo as schemaToColumns
2567
+ zn as ACell,
2568
+ qn as AGanttCell,
2569
+ Bt as ARow,
2570
+ Ye as ARowActions,
2571
+ jo as ATable,
2572
+ Pt as ATableHeader,
2573
+ Ko as ATableLoading,
2574
+ ol as ATableLoadingBar,
2575
+ Zt as ATableModal,
2576
+ Qn as AddIcon,
2577
+ Kn as DeleteIcon,
2578
+ _n as DuplicateIcon,
2579
+ eo as InsertAboveIcon,
2580
+ to as InsertBelowIcon,
2581
+ no as MoveIcon,
2582
+ oo as OpenIcon,
2583
+ so as actionIcons,
2584
+ Zn as createTableStore,
2585
+ ul as install,
2586
+ Xo as schemaToColumns
2582
2587
  };
2583
2588
  //# sourceMappingURL=atable.js.map