@stonecrop/atable 0.13.12 → 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 E, shallowRef as re, toValue as A, watchEffect as Zt, getCurrentScope as $t, onScopeDispose as It, getCurrentInstance as lt, unref as O, nextTick as at, isRef as Nt, toRefs as Ft, customRef as Tt, toRef as Wt, readonly as zt, defineComponent as xe, useTemplateRef as ce, openBlock as p, createElementBlock as b, normalizeClass as se, normalizeStyle as pe, createBlock as he, resolveDynamicComponent as Ne, mergeProps as st, toDisplayString as be, Fragment as me, createElementVNode as N, 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() ? (It(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
- const n = A(e);
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 = E(() => {
27
- const l = je(A(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(A(n.value ? e[1] : e[0])),
35
- je(O(n.value ? e[2] : e[1])),
36
- A(n.value ? e[3] : e[2])
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
+ H(n.value ? e[3] : e[2])
37
37
  ];
38
- }, ([l, u, a, o], c, r) => {
39
- if (!l?.length || !u?.length || !a?.length) return;
40
- const s = tn(o) ? { ...o } : o, d = l.flatMap((v) => u.flatMap((y) => a.map((P) => t(v, y, P, s))));
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
41
  r(() => {
42
- d.forEach((v) => v());
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 E(() => (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), c = () => {
62
- a && (a.disconnect(), a = void 0);
63
- }, r = ue(E(() => {
64
- const v = je(A(e)).map(Le).filter(_t);
65
- return new Set(v);
66
- }), (v) => {
67
- c(), o.value && v.size && (a = new MutationObserver(t), v.forEach((y) => a.observe(y, 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(), d = () => {
71
+ }), s = () => o?.takeRecords(), h = () => {
72
72
  r(), c();
73
73
  };
74
- return St(d), {
75
- isSupported: o,
76
- stop: d,
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 c = (d) => {
85
- o?.(), o = d;
86
- }, r = Zt(() => {
87
- const d = Le(e);
88
- if (d) {
89
- const { stop: v } = sn(u, (y) => {
90
- y.map((P) => [...P.removedNodes]).flat().some((P) => P === d || P.contains(d)) && t(y);
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
- c(v);
96
+ c(f);
97
97
  }
98
- }, { flush: a }), s = () => {
98
+ }, { flush: o }), s = () => {
99
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 d; s?.shadowRoot; ) s = s == null || (d = s.shadowRoot) === null || d === void 0 ? void 0 : d.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
111
  }, c = re(), r = () => {
112
- c.value = o();
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", (d) => {
120
- d.relatedTarget === null && r();
119
+ Fe(n, "blur", (h) => {
120
+ h.relatedTarget === null && r();
121
121
  }, s), Fe(n, "focus", r, s);
122
122
  }
123
- return u && rn(c, r, { document: a }), r(), c;
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 = E(() => Le(e)), u = re(!1), a = E(() => 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, () => {
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
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, fn)) !== null && c !== void 0 ? c : !1;
133
- }, o), { focused: a };
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 c = o.getBoundingClientRect();
143
- l.value = c.top <= (t.innerHeight || a.documentElement.clientHeight) && c.left <= (t.innerWidth || a.documentElement.clientWidth) && c.bottom >= 0 && c.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" }
@@ -152,10 +152,10 @@ function hn(e, { window: t = De, scrollTarget: n } = {}) {
152
152
  passive: !0
153
153
  }), l;
154
154
  }
155
- const Me = (e) => {
156
- let t = hn(e).value;
155
+ const ke = (e) => {
156
+ let t = gn(e).value;
157
157
  return t = t && e.offsetHeight > 0, t;
158
- }, ke = (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) => {
@@ -170,8 +170,8 @@ const Me = (e) => {
170
170
  const n = e.previousElementSibling;
171
171
  n instanceof HTMLTableRowElement && (t = n);
172
172
  }
173
- return t && (!ke(t) || !Me(t)) ? rt(t) : t;
174
- }, mn = (e) => {
173
+ return t && (!Me(t) || !ke(t)) ? rt(t) : t;
174
+ }, wn = (e) => {
175
175
  if (!(e.target instanceof HTMLElement)) return;
176
176
  const t = e.target;
177
177
  let n;
@@ -188,8 +188,8 @@ const Me = (e) => {
188
188
  u instanceof HTMLTableRowElement && (n = u);
189
189
  }
190
190
  }
191
- return n && (!ke(n) || !Me(n)) ? ct(n) : n;
192
- }, Ct = (e) => {
191
+ return n && (!Me(n) || !ke(n)) ? ct(n) : n;
192
+ }, bt = (e) => {
193
193
  if (e.target instanceof HTMLElement)
194
194
  return ct(e.target);
195
195
  }, ct = (e) => {
@@ -204,8 +204,8 @@ const Me = (e) => {
204
204
  const n = e.nextElementSibling;
205
205
  n instanceof HTMLTableRowElement && (t = n);
206
206
  }
207
- return t && (!ke(t) || !Me(t)) ? ct(t) : t;
208
- }, gn = (e) => {
207
+ return t && (!Me(t) || !ke(t)) ? ct(t) : t;
208
+ }, pn = (e) => {
209
209
  if (!(e.target instanceof HTMLElement)) return;
210
210
  const t = e.target;
211
211
  let n;
@@ -222,8 +222,8 @@ const Me = (e) => {
222
222
  u instanceof HTMLTableRowElement && (n = u);
223
223
  }
224
224
  }
225
- return n && (!ke(n) || !Me(n)) ? rt(n) : n;
226
- }, Mt = (e) => {
225
+ return n && (!Me(n) || !ke(n)) ? rt(n) : n;
226
+ }, Ct = (e) => {
227
227
  if (e.target instanceof HTMLElement)
228
228
  return ut(e.target);
229
229
  }, ut = (e) => {
@@ -235,7 +235,7 @@ const Me = (e) => {
235
235
  const l = e.parentElement?.previousElementSibling?.lastElementChild;
236
236
  l instanceof HTMLElement && (t = l);
237
237
  }
238
- return t && (!ke(t) || !Me(t)) ? ut(t) : t;
238
+ return t && (!Me(t) || !ke(t)) ? ut(t) : t;
239
239
  }, kt = (e) => {
240
240
  if (e.target instanceof HTMLElement)
241
241
  return dt(e.target);
@@ -248,31 +248,31 @@ const Me = (e) => {
248
248
  const l = e.parentElement?.nextElementSibling?.firstElementChild;
249
249
  l instanceof HTMLElement && (t = l);
250
250
  }
251
- return t && (!ke(t) || !Me(t)) ? dt(t) : t;
252
- }, Rt = (e) => {
251
+ return t && (!Me(t) || !ke(t)) ? dt(t) : t;
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
- return n && (!ke(n) || !Me(n)) ? dt(n) : n;
256
- }, Et = (e) => {
255
+ return n && (!Me(n) || !ke(n)) ? dt(n) : n;
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
- return n && (!ke(n) || !Me(n)) ? ut(n) : n;
260
- }, ze = ["alt", "control", "shift", "meta"], wn = {
259
+ return n && (!Me(n) || !ke(n)) ? ut(n) : n;
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 = Mt(e);
275
+ const t = Ct(e);
276
276
  e.preventDefault(), e.stopPropagation(), t && t.focus();
277
277
  },
278
278
  "keydown.right": (e) => {
@@ -280,41 +280,41 @@ const Me = (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) => {
@@ -322,7 +322,7 @@ const Me = (e) => {
322
322
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
323
323
  },
324
324
  "keydown.shift.tab": (e) => {
325
- const t = Mt(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);
333
+ function It(e) {
334
+ const t = (o) => {
335
+ const a = Ke(o);
336
336
  let c = [];
337
- if (typeof a.selectors == "string")
338
- c = Array.from(o ? o.querySelectorAll(a.selectors) : document.querySelectorAll(a.selectors));
339
- else if (Array.isArray(a.selectors))
340
- for (const r of a.selectors)
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
341
  r instanceof HTMLElement ? c.push(r) : c.push(r.$el);
342
- else if (a.selectors instanceof HTMLElement)
343
- c.push(a.selectors);
344
- else if (a.selectors?.value)
345
- if (Array.isArray(a.selectors.value))
346
- for (const r of a.selectors.value)
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
347
  r instanceof HTMLElement ? c.push(r) : c.push(r.$el);
348
348
  else
349
- c.push(a.selectors.value);
349
+ c.push(o.selectors.value);
350
350
  return c;
351
- }, n = (a) => {
352
- const o = Ke(a);
351
+ }, n = (o) => {
352
+ const a = Ke(o);
353
353
  let c = [];
354
- return a.selectors ? c = t(a) : o && (c = Array.from(o.children).filter((r) => r instanceof HTMLElement).filter((r) => ke(r) && Me(r))), c;
355
- }, l = (a) => (o) => {
356
- const c = wn[o.key] || o.key.toLowerCase();
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
357
  if (ze.includes(c)) return;
358
- const r = a.handlers || qe;
358
+ const r = o.handlers || Je;
359
359
  for (const s of Object.keys(r)) {
360
- const [d, ...v] = s.split(".");
361
- if (d === "keydown" && v.includes(c)) {
362
- const y = r[s], P = v.filter((M) => ze.includes(M)), F = ze.some((M) => {
363
- const h = M.charAt(0).toUpperCase() + M.slice(1);
364
- return o.getModifierState(h);
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 (P.length > 0) {
367
- if (F) {
368
- for (const M of ze)
369
- if (v.includes(M)) {
370
- const h = M.charAt(0).toUpperCase() + M.slice(1);
371
- o.getModifierState(h) && y(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
- F || y(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), c = n(a), r = l(a), s = o ? [o] : c;
382
- for (const d of s) {
383
- const { focused: v } = vn(z(d)), y = ue(v, (P) => {
384
- P ? d.addEventListener("keydown", r) : d.removeEventListener("keydown", r);
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(y);
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() ? (It(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]", Te = () => {
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(Tt(() => ({
404
+ return typeof t == "function" ? Gt(St(() => ({
405
405
  get: t,
406
- set: Te
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 Mn(e, t = {}) {
422
- let n, l, u = Te;
423
- const a = (r) => {
424
- clearTimeout(r), u(), u = Te;
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;
426
+ let a;
427
427
  return (r) => {
428
- const s = A(e), d = A(t.maxWait);
429
- return n && a(n), s <= 0 || d !== void 0 && d <= 0 ? (l && (a(l), l = void 0), Promise.resolve(r())) : new Promise((v, y) => {
430
- u = t.rejectOnCancel ? y : v, o = r, d && !l && (l = setTimeout(() => {
431
- n && a(n), l = void 0, v(o());
432
- }, d)), n = setTimeout(() => {
433
- l && a(l), l = void 0, v(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 kn(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(Mn(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] = Tt(() => ({
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 = A(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
- kn() ? Ae(e, n) : t ? e() : at(e);
473
+ En() ? Ie(e, n) : t ? e() : at(e);
474
474
  }
475
475
  function In(e, t, n) {
476
- return ue(e, t, {
476
+ return ce(e, t, {
477
477
  ...n,
478
478
  immediate: !0
479
479
  });
@@ -481,126 +481,126 @@ function In(e, t, n) {
481
481
  const We = At ? window : void 0;
482
482
  function we(e) {
483
483
  var t;
484
- const n = A(e);
484
+ const n = H(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 = E(() => {
489
- const l = Ye(A(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
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(A(n.value ? e[1] : e[0])),
497
- Ye(O(n.value ? e[2] : e[1])),
498
- A(n.value ? e[3] : e[2])
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
+ H(n.value ? e[3] : e[2])
499
499
  ];
500
- }, ([l, u, a, o], c, r) => {
501
- if (!l?.length || !u?.length || !a?.length) return;
502
- const s = yn(o) ? { ...o } : o, d = l.flatMap((v) => u.flatMap((y) => a.map((P) => t(v, y, P, s))));
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
503
  r(() => {
504
- d.forEach((v) => v());
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: c = !1 } = n;
509
+ const { window: l = We, ignore: u = [], capture: o = !0, detectIframe: a = !1, controls: c = !1 } = n;
510
510
  if (!l) return c ? {
511
- stop: Te,
512
- cancel: Te,
513
- trigger: Te
514
- } : Te;
511
+ stop: Se,
512
+ cancel: Se,
513
+ trigger: Se
514
+ } : Se;
515
515
  let r = !0;
516
- const s = (h) => A(u).some((m) => {
517
- if (typeof m == "string") return Array.from(l.document.querySelectorAll(m)).some((g) => g === h.target || h.composedPath().includes(g));
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 g = we(m);
520
- return g && (h.target === g || h.composedPath().includes(g));
519
+ const g = we(v);
520
+ return g && (m.target === g || m.composedPath().includes(g));
521
521
  }
522
522
  });
523
- function d(h) {
524
- const m = A(h);
525
- return m && m.$.subTree.shapeFlag === 16;
523
+ function h(m) {
524
+ const v = H(m);
525
+ return v && v.$.subTree.shapeFlag === 16;
526
526
  }
527
- function v(h, m) {
528
- const g = A(h), k = g.$.subTree && g.$.subTree.children;
529
- return k == null || !Array.isArray(k) ? !1 : k.some((x) => x.el === m.target || m.composedPath().includes(x.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 y = (h) => {
532
- const m = we(e);
533
- if (h.target != null && !(!(m instanceof Element) && d(e) && v(e, h)) && !(!m || m === h.target || h.composedPath().includes(m))) {
534
- if ("detail" in h && h.detail === 0 && (r = !s(h)), !r) {
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
535
  r = !0;
536
536
  return;
537
537
  }
538
- t(h);
538
+ t(m);
539
539
  }
540
540
  };
541
- let P = !1;
542
- const F = [
543
- Ee(l, "click", (h) => {
544
- P || (P = !0, setTimeout(() => {
545
- P = !1;
546
- }, 0), y(h));
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", (h) => {
552
- const m = we(e);
553
- r = !s(h) && !!(m && !h.composedPath().includes(m));
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", (h) => {
555
+ a && Ee(l, "blur", (m) => {
556
556
  setTimeout(() => {
557
- var m;
557
+ var v;
558
558
  const g = we(e);
559
- ((m = l.document.activeElement) === null || m === void 0 ? void 0 : m.tagName) === "IFRAME" && !g?.contains(l.document.activeElement) && t(h);
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), M = () => F.forEach((h) => h());
562
+ ].filter(Boolean), y = () => Z.forEach((m) => m());
563
563
  return c ? {
564
- stop: M,
564
+ stop: y,
565
565
  cancel: () => {
566
566
  r = !1;
567
567
  },
568
- trigger: (h) => {
569
- r = !0, y(h), r = !1;
568
+ trigger: (m) => {
569
+ r = !0, w(m), r = !1;
570
570
  }
571
- } : M;
571
+ } : y;
572
572
  }
573
573
  // @__NO_SIDE_EFFECTS__
574
- function Tn() {
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__ */ Tn();
583
- return E(() => (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), c = () => {
589
- a && (a.disconnect(), a = void 0);
590
- }, r = ue(E(() => {
591
- const v = Ye(A(e)).map(we).filter(pn);
592
- return new Set(v);
593
- }), (v) => {
594
- c(), o.value && v.size && (a = new MutationObserver(t), v.forEach((y) => a.observe(y, 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(), d = () => {
598
+ }), s = () => o?.takeRecords(), h = () => {
599
599
  r(), c();
600
600
  };
601
- return vt(d), {
602
- isSupported: o,
603
- stop: d,
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: c, stopPropagation: r, exact: s, onMove: d, onEnd: v, onStart: y, initialValue: P, axis: F = "both", draggingElement: M = We, containerElement: h, handle: m = e, buttons: g = [0], restrictInView: k, autoScroll: x = !1 } = t, R = z((n = A(P)) !== 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
- }), B = z(), j = (C) => o ? o.includes(C.pointerType) : !0, I = (C) => {
621
- A(c) && C.preventDefault(), A(r) && C.stopPropagation();
622
- }, V = A(x), Z = typeof V == "object" ? {
623
- speed: (l = A(V.speed)) !== null && l !== void 0 ? l : Xe.speed,
624
- margin: (u = A(V.margin)) !== null && u !== void 0 ? u : Xe.margin,
625
- direction: (a = V.direction) !== null && a !== void 0 ? a : Xe.direction
626
- } : Xe, q = (C) => typeof C == "number" ? [C, C] : [C.x, C.y], _ = (C, H, W) => {
627
- const { clientWidth: Q, clientHeight: X, scrollLeft: oe, scrollTop: ye, scrollWidth: Re, scrollHeight: $ } = C, [D, Y] = q(Z.margin), [G, K] = q(Z.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
- (Z.direction === "x" || Z.direction === "both") && (W.x < D && oe > 0 ? te = -G : W.x + H.width > Q - D && oe < Re - Q && (te = G)), (Z.direction === "y" || Z.direction === "both") && (W.y < Y && ye > 0 ? le = -K : W.y + H.height > X - Y && ye < $ - X && (le = K)), (te || le) && C.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,97 +634,97 @@ function _e(e, t = {}) {
634
634
  };
635
635
  let ne = null;
636
636
  const ge = () => {
637
- const C = A(h);
638
- C && !ne && (ne = setInterval(() => {
639
- const H = A(e).getBoundingClientRect(), { x: W, y: Q } = R.value, X = {
640
- x: W - C.scrollLeft,
641
- y: Q - C.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 && (_(C, H, X), X.x += C.scrollLeft, X.y += C.scrollTop, R.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 = (C, H, W, Q) => {
648
- const [X, oe] = typeof W == "number" ? [W, W] : [W.x, W.y], { clientWidth: ye, clientHeight: Re } = H;
649
- return C.x < X || C.x + Q.width > ye - X || C.y < oe || C.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 (A(t.disabled) || !B.value) return;
652
- const C = A(h);
653
- if (!C) return;
654
- const H = A(e).getBoundingClientRect(), { x: W, y: Q } = R.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 - C.scrollLeft,
657
- y: Q - C.scrollTop
658
- }, C, Z.margin, H) ? ge() : ve();
656
+ x: F - E.scrollLeft,
657
+ y: Q - E.scrollTop
658
+ }, E, N.margin, D) ? ge() : fe();
659
659
  };
660
- A(x) && ue(R, Ve);
661
- const Be = (C) => {
662
- var H;
663
- if (!A(g).includes(C.button) || A(t.disabled) || !j(C) || A(s) && C.target !== A(e)) return;
664
- const W = A(h), Q = W == null || (H = W.getBoundingClientRect) === null || H === void 0 ? void 0 : H.call(W), X = A(e).getBoundingClientRect(), oe = {
665
- x: C.clientX - (W ? X.left - Q.left + (x ? 0 : W.scrollLeft) : X.left),
666
- y: C.clientY - (W ? X.top - Q.top + (x ? 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
- y?.(oe, C) !== !1 && (B.value = oe, I(C));
669
- }, Pe = (C) => {
670
- if (A(t.disabled) || !j(C) || !B.value) return;
671
- const H = A(h);
672
- H instanceof HTMLElement && Sn(H);
673
- const W = A(e).getBoundingClientRect();
674
- let { x: Q, y: X } = R.value;
675
- if ((F === "x" || F === "both") && (Q = C.clientX - B.value.x, H && (Q = Math.min(Math.max(0, Q), H.scrollWidth - W.width))), (F === "y" || F === "both") && (X = C.clientY - B.value.y, H && (X = Math.min(Math.max(0, X), H.scrollHeight - W.height))), A(x) && H && (ne === null && _(H, 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 += H.scrollLeft, X += H.scrollTop), H && (k || x)) {
679
- if (F !== "y") {
680
- const oe = Q - H.scrollLeft;
681
- oe < 0 ? Q = H.scrollLeft : oe > H.clientWidth - W.width && (Q = H.clientWidth - W.width + H.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 (F !== "x") {
684
- const oe = X - H.scrollTop;
685
- oe < 0 ? X = H.scrollTop : oe > H.clientHeight - W.height && (X = H.clientHeight - W.height + H.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
- R.value = {
688
+ x.value = {
689
689
  x: Q,
690
- y: X
691
- }, d?.(R.value, C), I(C);
692
- }, He = (C) => {
693
- A(t.disabled) || !j(C) || B.value && (B.value = void 0, x && ve(), v?.(R.value, C), I(C));
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 C = () => {
697
- var H;
696
+ const E = () => {
697
+ var D;
698
698
  return {
699
- capture: (H = t.capture) !== null && H !== void 0 ? H : !0,
700
- passive: !A(c)
699
+ capture: (D = t.capture) !== null && D !== void 0 ? D : !0,
700
+ passive: !H(c)
701
701
  };
702
702
  };
703
- Ee(m, "pointerdown", Be, C), Ee(M, "pointermove", Pe, C), Ee(M, "pointerup", He, C);
703
+ Ee(v, "pointerdown", Be, E), Ee(y, "pointermove", Pe, E), Ee(y, "pointerup", He, E);
704
704
  }
705
705
  return {
706
- ...En(R),
707
- position: R,
708
- isDragging: E(() => !!B.value),
709
- style: E(() => `
710
- left: ${R.value.x}px;
711
- top: ${R.value.y}px;
712
- ${x ? "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), c = () => {
720
- a && (a.disconnect(), a = void 0);
721
- }, r = ue(E(() => {
722
- const d = A(e);
723
- return Array.isArray(d) ? d.map((v) => we(v)) : [we(d)];
724
- }), (d) => {
725
- if (c(), o.value && l) {
726
- a = new ResizeObserver(t);
727
- for (const v of d) 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,
@@ -732,51 +732,51 @@ function Je(e, t, n = {}) {
732
732
  }), s = () => {
733
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
- function Ie(e, t = {}) {
741
- const { reset: n = !0, windowResize: l = !0, windowScroll: u = !0, immediate: a = !0, updateTiming: o = "sync" } = t, c = re(0), r = re(0), s = re(0), d = re(0), v = re(0), y = re(0), P = re(0), F = re(0);
742
- function M() {
743
- const m = we(e);
744
- if (!m) {
745
- n && (c.value = 0, r.value = 0, s.value = 0, d.value = 0, v.value = 0, y.value = 0, P.value = 0, F.value = 0);
740
+ function Te(e, t = {}) {
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 g = m.getBoundingClientRect();
749
- c.value = g.height, r.value = g.bottom, s.value = g.left, d.value = g.right, v.value = g.top, y.value = g.width, P.value = g.x, F.value = g.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 h() {
752
- o === "sync" ? M() : o === "next-frame" && requestAnimationFrame(() => M());
751
+ function m() {
752
+ a === "sync" ? y() : a === "next-frame" && requestAnimationFrame(() => y());
753
753
  }
754
- return Je(e, h), ue(() => we(e), (m) => !m && h()), Lt(e, h, { attributeFilter: ["style", "class"] }), u && Ee("scroll", h, {
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", h, { passive: !0 }), $n(() => {
758
- a && h();
757
+ }), l && Ee("resize", m, { passive: !0 }), $n(() => {
758
+ o && m();
759
759
  }), {
760
760
  height: c,
761
761
  bottom: r,
762
762
  left: s,
763
- right: d,
764
- top: v,
765
- width: y,
766
- x: P,
767
- y: F,
768
- update: h
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 c = et(A(o));
778
+ ce(kn(e), (a) => {
779
+ const c = et(H(a));
780
780
  if (c) {
781
781
  const r = c;
782
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;
@@ -784,25 +784,420 @@ function An(e, t = !1) {
784
784
  }
785
785
  }, { immediate: !0 });
786
786
  const u = () => {
787
- const o = et(A(e));
788
- !o || n.value || (o.style.overflow = "hidden", n.value = !0);
789
- }, a = () => {
790
- const o = et(A(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), E({
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], c = e.store.rows[e.rowIndex], r = o.align || "center", s = o.width || "40ch", d = E(() => e.store.getCellDisplayValue(e.colIndex, e.rowIndex)), v = z(null);
818
- Ae(() => {
819
- if (!o.linkDoctype) return;
820
- const I = e.store.getCellData(e.colIndex, e.rowIndex);
821
- if (I != null && typeof I == "object") {
822
- const Z = I, q = Z.displayText ?? Z.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
1221
  const V = e.store.linkResolver;
827
- !V || typeof I != "string" || I === "" || V(o.linkDoctype, I).then((Z) => (Z != null && (v.value = Z), Z));
1222
+ !V || typeof M != "string" || M === "" || V(a.linkDoctype, M).then((N) => (N != null && (f.value = N), N));
828
1223
  });
829
- const y = E(() => v.value ?? d.value), P = E(() => typeof y.value == "string" ? Hn(y.value) : !1), F = E(() => ({
1224
+ const w = T(() => f.value ?? h.value), L = T(() => typeof w.value == "string" ? On(w.value) : !1), Z = T(() => ({
830
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
- })), M = E(() => ({
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
- })), h = () => {
838
- g(), m();
839
- }, m = () => {
840
- const { left: I, bottom: V, width: Z, height: q } = Ie(n);
841
- o.mask, o.modalComponent && e.store.$patch((_) => {
842
- _.modal.visible = !0, _.modal.colIndex = e.colIndex, _.modal.rowIndex = e.rowIndex, _.modal.left = I, _.modal.bottom = V, _.modal.width = Z, _.modal.height = q, _.modal.cell = n.value, typeof o.modalComponent == "function" ? _.modal.component = o.modalComponent({ table: _.table, row: c, 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 I = {
847
- ...qe,
848
- "keydown.f2": m,
849
- "keydown.alt.up": m,
850
- "keydown.alt.down": m,
851
- "keydown.alt.left": m,
852
- "keydown.alt.right": m
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" && (I = {
855
- ...I,
1249
+ typeof e.addNavigation == "object" && (M = {
1250
+ ...M,
856
1251
  ...e.addNavigation
857
- }), ft([
1252
+ }), It([
858
1253
  {
859
1254
  selectors: n,
860
- handlers: I
1255
+ handlers: M
861
1256
  }
862
1257
  ]);
863
1258
  }
864
1259
  const g = () => {
865
- if (n.value && o.edit) {
866
- const I = window.getSelection();
867
- if (I)
1260
+ if (n.value && a.edit) {
1261
+ const M = window.getSelection();
1262
+ if (M)
868
1263
  try {
869
1264
  const V = document.createRange();
870
- V.selectNodeContents && (V.selectNodeContents(n.value), I.removeAllRanges(), I.addRange(V));
1265
+ V.selectNodeContents && (V.selectNodeContents(n.value), M.removeAllRanges(), M.addRange(V));
871
1266
  } catch {
872
1267
  }
873
1268
  }
874
1269
  }, k = () => {
875
1270
  n.value && (u.value = n.value.textContent, g());
876
- }, x = () => {
1271
+ }, C = () => {
877
1272
  try {
878
- const I = window.getSelection();
879
- if (I && I.rangeCount > 0 && n.value) {
880
- const V = I.getRangeAt(0), Z = V.cloneRange();
881
- if (Z.selectNodeContents && Z.setEnd)
882
- return Z.selectNodeContents(n.value), Z.setEnd(V.endContainer, V.endOffset), Z.toString().length;
1273
+ const M = window.getSelection();
1274
+ if (M && M.rangeCount > 0 && n.value) {
1275
+ const V = M.getRangeAt(0), N = V.cloneRange();
1276
+ if (N.selectNodeContents && N.setEnd)
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
- }, R = (I) => {
1282
+ }, x = (M) => {
888
1283
  if (n.value)
889
1284
  try {
890
1285
  const V = window.getSelection();
891
1286
  if (!V) return;
892
- let Z = 0;
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 = Z + ge.textContent.length;
898
- if (I <= ve && (ne = document.createRange(), ne.setStart && ne.setEnd)) {
899
- ne.setStart(ge, I - Z), ne.setEnd(ge, I - Z);
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
- Z = ve;
1297
+ N = fe;
903
1298
  }
904
1299
  ne && V.removeAllRanges && V.addRange && (V.removeAllRanges(), V.addRange(ne));
905
1300
  } catch {
906
1301
  }
907
- }, B = (I) => {
908
- if (!o.edit) return;
909
- const V = I.target;
1302
+ }, I = (M) => {
1303
+ if (!a.edit) return;
1304
+ const V = M.target;
910
1305
  if (V.textContent === u.value)
911
1306
  return;
912
- const Z = x();
913
- u.value = V.textContent, o.format ? (a.value = V.textContent !== e.store.getFormattedValue(e.colIndex, e.rowIndex, l), e.store.setCellText(e.colIndex, e.rowIndex, V.textContent)) : (a.value = V.textContent !== l, e.store.setCellData(e.colIndex, e.rowIndex, V.textContent)), at().then(() => R(Z));
914
- }, j = /* @__PURE__ */ Rn(B, 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
- }), (I, V) => (p(), b("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": O(o).edit,
922
- contenteditable: O(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(F.value),
926
- class: se(["atable-cell", M.value]),
1320
+ style: pe(Z.value),
1321
+ class: ae(["atable-cell", y.value]),
927
1322
  onFocus: k,
928
- onPaste: B,
1323
+ onPaste: I,
929
1324
  onInput: V[0] || (V[0] = //@ts-ignore
930
- (...Z) => O(j) && O(j)(...Z)),
931
- onClick: h
1325
+ (...N) => P(X) && P(X)(...N)),
1326
+ onClick: m
932
1327
  }, [
933
- O(o).cellComponent ? (p(), he(Ne(O(o).cellComponent), st({
1328
+ P(a).cellComponent ? (b(), ve(Ne(P(a).cellComponent), st({
934
1329
  key: 0,
935
- value: y.value
936
- }, O(o).cellComponentProps), null, 16, ["value"])) : P.value ? (p(), b("span", {
1330
+ value: w.value
1331
+ }, P(a).cellComponentProps), null, 16, ["value"])) : L.value ? (b(), R("span", {
937
1332
  key: 1,
938
- innerHTML: y.value
939
- }, null, 8, On)) : (p(), b("span", Vn, be(y.value), 1))
940
- ], 46, Dn));
1333
+ innerHTML: w.value
1334
+ }, null, 8, Fn)) : (b(), R("span", Wn, ye(w.value), 1))
1335
+ ], 46, Nn));
941
1336
  }
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(() => 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) => (p(), b(me, null, [
966
- N("tr", st(l.$attrs, {
967
- ref: "rowEl",
968
- tabindex: e.tabIndex,
969
- class: "expandable-row"
970
- }), [
971
- N("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 ? (p(), b("tr", {
979
- key: 0,
980
- ref: "rowExpanded",
981
- tabindex: e.tabIndex,
982
- class: "expanded-row"
983
- }, [
984
- N("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));
993
- }
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,270 +1355,273 @@ const Hn = (e) => {
1017
1355
  },
1018
1356
  emits: ["connection:create"],
1019
1357
  setup(e, { expose: t, emit: n }) {
1020
- Xt(($) => ({
1021
- v1b78cb3b: u.value,
1022
- v0a4cd982: $.colspan
1358
+ Ut(($) => ({
1359
+ v564d6da1: u.value,
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"), c = ce("bar"), r = ce("leftResizeHandle"), s = ce("rightResizeHandle"), d = ce("leftConnectionHandle"), v = ce("rightConnectionHandle"), { width: y } = Ie(o), { left: P, right: F } = Ie(c), M = z(e.start), h = z(e.end || M.value + e.colspan), m = z(!1), g = z(!1), k = z(!1), x = z(!1), R = z(!1), B = z({ startX: 0, startY: 0, endX: 0, endY: 0 }), j = E(() => ge.value || _.value || ne.value), I = E(() => e.colspan > 0 ? y.value / e.colspan : 0), V = E(() => {
1025
- const $ = M.value / e.colspan * 100, D = h.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
1365
  left: `${$}%`,
1028
- width: `${D - $}%`,
1366
+ width: `${B - $}%`,
1029
1367
  backgroundColor: u.value
1030
1368
  };
1031
- }), Z = E(
1032
- () => ({
1033
- position: "fixed",
1034
- top: 0,
1035
- left: 0,
1036
- width: "100vw",
1037
- height: "100vh",
1038
- pointerEvents: "none",
1039
- zIndex: 1e3
1040
- })
1041
- ), q = z({ startX: 0, startPos: 0 }), { isDragging: _ } = _e(r, {
1369
+ }), N = T(() => ({
1370
+ position: "fixed",
1371
+ top: 0,
1372
+ left: 0,
1373
+ width: "100vw",
1374
+ height: "100vh",
1375
+ pointerEvents: "none",
1376
+ zIndex: 1e3
1377
+ })), q = W({ startX: 0, startPos: 0 }), { isDragging: ee } = _e(r, {
1042
1378
  axis: "x",
1043
- onStart: () => ve(P.value, M.value),
1379
+ onStart: () => fe(L.value, y.value),
1044
1380
  onMove: ({ x: $ }) => Oe($),
1045
1381
  onEnd: ({ x: $ }) => Ve($)
1046
1382
  }), { isDragging: ne } = _e(s, {
1047
1383
  axis: "x",
1048
- onStart: () => ve(F.value, h.value),
1384
+ onStart: () => fe(Z.value, m.value),
1049
1385
  onMove: ({ x: $ }) => Be($),
1050
1386
  onEnd: ({ x: $ }) => Pe($)
1051
1387
  }), { isDragging: ge } = _e(c, {
1052
1388
  exact: !0,
1053
1389
  axis: "x",
1054
- onStart: () => ve(P.value, M.value),
1390
+ onStart: () => fe(L.value, y.value),
1055
1391
  onMove: ({ x: $ }) => He($),
1056
- onEnd: ({ x: $ }) => C($)
1392
+ onEnd: ({ x: $ }) => E($)
1057
1393
  });
1058
- Ae(() => {
1059
- H();
1060
- }), Gt(() => {
1061
- W();
1394
+ Ie(() => {
1395
+ D();
1396
+ }), jt(() => {
1397
+ F();
1062
1398
  });
1063
- function ve($, D) {
1064
- c.value && (c.value.style.transition = "none"), q.value = { startX: $, startPos: D };
1399
+ function fe($, B) {
1400
+ c.value && (c.value.style.transition = "none"), q.value = { startX: $, startPos: B };
1065
1401
  }
1066
1402
  function Oe($) {
1067
- if (!_.value || !c.value) return;
1068
- const Y = ($ - q.value.startX) / I.value, G = Math.max(0, Math.min(h.value - 1, q.value.startPos + Y));
1069
- c.value.style.left = `${G / e.colspan * 100}%`, c.value.style.width = `${(h.value - G) / e.colspan * 100}%`;
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}%`;
1070
1406
  }
1071
1407
  function Ve($) {
1072
1408
  if (!c.value) return;
1073
- const D = $ - q.value.startX, Y = Math.round(D / I.value), G = M.value, K = Math.max(0, Math.min(h.value - 1, q.value.startPos + Y));
1074
- M.value = K, e.store.updateGanttBar({
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({
1075
1411
  rowIndex: e.rowIndex,
1076
1412
  colIndex: e.colIndex,
1077
1413
  type: "resize",
1078
1414
  edge: "start",
1079
- oldStart: G,
1415
+ oldStart: U,
1080
1416
  newStart: K,
1081
- end: h.value,
1082
- delta: Y,
1083
- oldColspan: h.value - G,
1084
- newColspan: h.value - K
1417
+ end: m.value,
1418
+ delta: j,
1419
+ oldColspan: m.value - U,
1420
+ newColspan: m.value - K
1085
1421
  });
1086
1422
  }
1087
1423
  function Be($) {
1088
1424
  if (!ne.value || !c.value) return;
1089
- const Y = ($ - q.value.startX) / I.value, G = Math.max(M.value + 1, Math.min(e.columnsCount, q.value.startPos + Y));
1090
- c.value.style.width = `${(G - M.value) / e.colspan * 100}%`;
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}%`;
1091
1427
  }
1092
1428
  function Pe($) {
1093
1429
  if (!c.value) return;
1094
- const D = $ - q.value.startX, Y = Math.round(D / I.value), G = h.value, K = Math.max(M.value + 1, Math.min(e.columnsCount, q.value.startPos + Y));
1095
- h.value = K, e.store.updateGanttBar({
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({
1096
1432
  rowIndex: e.rowIndex,
1097
1433
  colIndex: e.colIndex,
1098
1434
  type: "resize",
1099
1435
  edge: "end",
1100
- oldEnd: G,
1436
+ oldEnd: U,
1101
1437
  newEnd: K,
1102
- start: M.value,
1103
- delta: Y,
1104
- oldColspan: G - M.value,
1105
- newColspan: K - M.value
1438
+ start: y.value,
1439
+ delta: j,
1440
+ oldColspan: U - y.value,
1441
+ newColspan: K - y.value
1106
1442
  });
1107
1443
  }
1108
1444
  function He($) {
1109
1445
  if (!ge.value || !c.value) return;
1110
- const Y = ($ - q.value.startX) / I.value, G = h.value - M.value, K = Math.max(0, Math.min(q.value.startPos + Y, e.columnsCount - G));
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));
1111
1447
  c.value.style.left = `${K / e.colspan * 100}%`;
1112
1448
  }
1113
- function C($) {
1449
+ function E($) {
1114
1450
  if (!c.value) return;
1115
- const D = $ - q.value.startX, Y = Math.round(D / I.value), G = h.value - M.value, K = M.value, te = h.value;
1116
- let le = q.value.startPos + Y, ae = le + G;
1117
- le < 0 ? (le = 0, ae = G) : ae > e.columnsCount && (ae = e.columnsCount, le = ae - G), M.value = le, h.value = ae, e.store.updateGanttBar({
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({
1118
1454
  rowIndex: e.rowIndex,
1119
1455
  colIndex: e.colIndex,
1120
1456
  type: "bar",
1121
1457
  oldStart: K,
1122
1458
  oldEnd: te,
1123
1459
  newStart: le,
1124
- newEnd: ae,
1125
- delta: Y,
1126
- colspan: ae - le
1460
+ newEnd: se,
1461
+ delta: j,
1462
+ colspan: se - le
1127
1463
  });
1128
1464
  }
1129
- function H() {
1130
- const { x: $, y: D } = Ie(c), { x: Y, y: G } = Ie(d), { x: K, y: te } = Ie(v);
1465
+ function D() {
1466
+ const { x: $, y: B } = Te(c), { x: j, y: U } = Te(h), { x: K, y: te } = Te(f);
1131
1467
  e.store.registerGanttBar({
1132
- id: a,
1468
+ id: o,
1133
1469
  rowIndex: e.rowIndex,
1134
1470
  colIndex: e.colIndex,
1135
- startIndex: M,
1136
- endIndex: h,
1471
+ startIndex: y,
1472
+ endIndex: m,
1137
1473
  color: u,
1138
1474
  label: e.label,
1139
- position: { x: $, y: D }
1475
+ position: { x: $, y: B }
1140
1476
  }), e.store.isDependencyGraphEnabled && (e.store.registerConnectionHandle({
1141
- id: `${a}-connection-left`,
1477
+ id: `${o}-connection-left`,
1142
1478
  rowIndex: e.rowIndex,
1143
1479
  colIndex: e.colIndex,
1144
1480
  side: "left",
1145
- position: { x: Y, y: G },
1146
- visible: m,
1147
- barId: a
1481
+ position: { x: j, y: U },
1482
+ visible: v,
1483
+ barId: o
1148
1484
  }), e.store.registerConnectionHandle({
1149
- id: `${a}-connection-right`,
1485
+ id: `${o}-connection-right`,
1150
1486
  rowIndex: e.rowIndex,
1151
1487
  colIndex: e.colIndex,
1152
1488
  side: "right",
1153
1489
  position: { x: K, y: te },
1154
1490
  visible: g,
1155
- barId: a
1491
+ barId: o
1156
1492
  }));
1157
1493
  }
1158
- function W() {
1159
- 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`));
1160
1496
  }
1161
1497
  function Q() {
1162
- e.store.isDependencyGraphEnabled && (m.value = !0, g.value = !0);
1498
+ e.store.isDependencyGraphEnabled && (v.value = !0, g.value = !0);
1163
1499
  }
1164
- function X() {
1165
- !k.value && !x.value && (m.value = !1, g.value = !1);
1500
+ function G() {
1501
+ !k.value && !C.value && (v.value = !1, g.value = !1);
1166
1502
  }
1167
- function oe($, D) {
1168
- D.preventDefault(), D.stopPropagation(), R.value = !0, $ === "left" ? k.value = !0 : x.value = !0;
1169
- const Y = $ === "left" ? d.value : v.value;
1170
- if (Y) {
1171
- const te = Y.getBoundingClientRect(), le = te.left + te.width / 2, ae = te.top + te.height / 2;
1172
- B.value = { startX: le, startY: ae, endX: le, endY: ae };
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 };
1173
1509
  }
1174
- const G = (te) => {
1175
- B.value.endX = te.clientX, B.value.endY = te.clientY;
1510
+ const U = (te) => {
1511
+ I.value.endX = te.clientX, I.value.endY = te.clientY;
1176
1512
  }, K = (te) => {
1177
- ye(te, $), Re(G, K);
1513
+ xe(te, $), Re(U, K);
1178
1514
  };
1179
- document.addEventListener("mousemove", G), document.addEventListener("mouseup", K);
1515
+ document.addEventListener("mousemove", U), document.addEventListener("mouseup", K);
1180
1516
  }
1181
- function ye($, D) {
1182
- const G = document.elementFromPoint($.clientX, $.clientY)?.closest(".connection-handle");
1183
- if (G && G !== (D === "left" ? d.value : v.value)) {
1184
- 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");
1185
1521
  if (K) {
1186
- const te = parseInt(K.getAttribute("data-rowindex") || "0"), le = parseInt(K.getAttribute("data-colindex") || "0"), ae = G.classList.contains("left-connection-handle") ? "left" : "right", ht = `gantt-bar-row-${te}-col-${le}`, Qe = e.store.createConnection(
1187
- `${a}-connection-${D}`,
1188
- `${ht}-connection-${ae}`
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}`
1189
1525
  );
1190
1526
  Qe && l("connection:create", Qe);
1191
1527
  }
1192
1528
  }
1193
1529
  }
1194
- function Re($, D) {
1195
- R.value = !1, k.value = !1, x.value = !1, document.removeEventListener("mousemove", $), document.removeEventListener("mouseup", D), c.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();
1196
1532
  }
1197
1533
  return t({
1198
1534
  barStyle: V,
1199
1535
  cleanupConnectionDrag: Re,
1200
- currentEnd: h,
1201
- handleConnectionDrop: ye,
1536
+ currentEnd: m,
1537
+ handleConnectionDrop: xe,
1202
1538
  isLeftConnectionDragging: k,
1203
- isLeftConnectionVisible: m,
1204
- isRightConnectionDragging: x,
1539
+ isLeftConnectionVisible: v,
1540
+ isRightConnectionDragging: C,
1205
1541
  isRightConnectionVisible: g,
1206
- showDragPreview: R
1207
- }), ($, D) => (p(), b("td", {
1542
+ showDragPreview: x
1543
+ }), ($, B) => (b(), R("td", {
1208
1544
  class: "aganttcell",
1209
1545
  colspan: e.colspan
1210
1546
  }, [
1211
- N("div", Xn, [
1212
- N("div", {
1547
+ z("div", Gn, [
1548
+ z("div", {
1213
1549
  ref: "bar",
1214
1550
  "data-rowindex": e.rowIndex,
1215
1551
  "data-colindex": e.colIndex,
1216
- class: se(["gantt-bar", { "is-dragging": j.value }]),
1552
+ class: ae(["gantt-bar", { "is-dragging": X.value }]),
1217
1553
  style: pe(V.value),
1218
1554
  onMouseenter: Q,
1219
- onMouseleave: X
1555
+ onMouseleave: G
1220
1556
  }, [
1221
- e.store.isDependencyGraphEnabled ? (p(), b("div", {
1557
+ e.store.isDependencyGraphEnabled ? (b(), R("div", {
1222
1558
  key: 0,
1223
1559
  ref: "leftConnectionHandle",
1224
- class: se(["connection-handle left-connection-handle", { visible: m.value, "is-dragging": k.value }]),
1225
- onMousedown: D[0] || (D[0] = Se((Y) => oe("left", Y), ["stop"]))
1226
- }, [...D[2] || (D[2] = [
1227
- N("div", { class: "connection-dot" }, null, -1)
1228
- ])], 34)) : ee("", !0),
1229
- e.store.isDependencyGraphEnabled ? (p(), b("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", {
1230
1566
  key: 1,
1231
1567
  ref: "rightConnectionHandle",
1232
- class: se(["connection-handle right-connection-handle", { visible: g.value, "is-dragging": x.value }]),
1233
- onMousedown: D[1] || (D[1] = Se((Y) => oe("right", Y), ["stop"]))
1234
- }, [...D[3] || (D[3] = [
1235
- N("div", { class: "connection-dot" }, null, -1)
1236
- ])], 34)) : ee("", !0),
1237
- N("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", {
1238
1574
  ref: "leftResizeHandle",
1239
- class: se(["resize-handle left-resize-handle", { "is-dragging": O(_) }])
1240
- }, [...D[4] || (D[4] = [
1241
- N("div", { class: "handle-grip" }, null, -1),
1242
- N("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)
1243
1579
  ])], 2),
1244
- e.label ? (p(), b("label", jn, be(e.label), 1)) : ee("", !0),
1245
- N("div", {
1580
+ e.label ? (b(), R("label", jn, ye(e.label), 1)) : _("", !0),
1581
+ z("div", {
1246
1582
  ref: "rightResizeHandle",
1247
- class: se(["resize-handle right-resize-handle", { "is-dragging": O(ne) }])
1248
- }, [...D[5] || (D[5] = [
1249
- N("div", { class: "handle-grip" }, null, -1),
1250
- N("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)
1251
1587
  ])], 2)
1252
- ], 46, Gn)
1588
+ ], 46, Un)
1253
1589
  ], 512),
1254
- e.store.isDependencyGraphEnabled && R.value ? (p(), b("svg", {
1590
+ e.store.isDependencyGraphEnabled && x.value ? (b(), R("svg", {
1255
1591
  key: 0,
1256
- style: pe(Z.value)
1592
+ style: pe(N.value)
1257
1593
  }, [
1258
- N("line", {
1259
- x1: B.value.startX,
1260
- y1: B.value.startY,
1261
- x2: B.value.endX,
1262
- y2: B.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,
1263
1599
  stroke: "#2196f3",
1264
1600
  "stroke-width": "2",
1265
1601
  "stroke-dasharray": "5,5"
1266
1602
  }, null, 8, Yn)
1267
- ], 4)) : ee("", !0)
1268
- ], 8, zn));
1603
+ ], 4)) : _("", !0)
1604
+ ], 8, Xn));
1269
1605
  }
1270
- }), Jn = /* @__PURE__ */ $e(Un, [["__scopeId", "data-v-c3173189"]]), 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"?>
1271
1612
  <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
1272
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;"/>
1273
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;"/>
1274
1615
  </svg>
1275
- `, Qn = `<?xml version="1.0" encoding="UTF-8"?>
1616
+ `, Kn = `<?xml version="1.0" encoding="UTF-8"?>
1276
1617
  <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
1277
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;"/>
1278
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;"/>
1279
- </svg>`, Kn = `<?xml version="1.0" encoding="UTF-8"?>
1620
+ </svg>`, _n = `<?xml version="1.0" encoding="UTF-8"?>
1280
1621
  <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 70.67 70.67">
1281
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;"/>
1282
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;"/>
1283
- </svg>`, _n = `<?xml version="1.0" encoding="UTF-8"?>
1624
+ </svg>`, eo = `<?xml version="1.0" encoding="UTF-8"?>
1284
1625
  <svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 70.6 61.5">
1285
1626
  <path d="M68.6,45.8v13.7H2v-13.7h66.6M70.6,43.8H0v17.7h70.6v-17.7h0Z"/>
1286
1627
  <path d="M68.6,24.2v13.7H2v-13.7h66.6M70.6,22.2H0v17.7h70.6v-17.7h0Z"/>
@@ -1294,7 +1635,7 @@ const Hn = (e) => {
1294
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"/>
1295
1636
  <path d="M70.6,13.4h-2v-2.7h2v2.7ZM70.6,8h-2v-2.7h2v2.7Z"/>
1296
1637
  </g>
1297
- </svg>`, eo = `<?xml version="1.0" encoding="UTF-8"?>
1638
+ </svg>`, to = `<?xml version="1.0" encoding="UTF-8"?>
1298
1639
  <svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 70.6 61.5">
1299
1640
  <g>
1300
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"/>
@@ -1308,23 +1649,31 @@ const Hn = (e) => {
1308
1649
  </g>
1309
1650
  <path d="M68.6,23.7v13.7H2v-13.7h66.6M70.6,21.7H0v17.7h70.6v-17.7h0Z"/>
1310
1651
  <path d="M68.6,2v13.7H2V2h66.6M70.6,0H0v17.7h70.6V0h0Z"/>
1311
- </svg>`, to = `<?xml version="1.0" encoding="UTF-8"?>
1652
+ </svg>`, no = `<?xml version="1.0" encoding="UTF-8"?>
1312
1653
  <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 70.67 70.64">
1313
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;"/>
1314
- </svg>`, no = {
1315
- add: qn,
1316
- delete: Qn,
1317
- duplicate: Kn,
1318
- insertAbove: _n,
1319
- insertBelow: eo,
1320
- move: to
1321
- }, oo = {
1655
+ </svg>`, oo = `<?xml version="1.0" encoding="UTF-8"?>
1656
+ <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
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;"/>
1658
+ <polygon points="18,20 18,44 46,32" style="fill: #000; stroke-width: 0px;"/>
1659
+ </svg>
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 = {
1322
1671
  key: 0,
1323
1672
  class: "row-actions-dropdown"
1324
- }, lo = ["aria-expanded"], ao = ["onClick"], so = ["innerHTML"], io = { class: "action-label" }, ro = {
1673
+ }, ro = ["aria-expanded"], co = ["disabled", "onClick"], uo = ["innerHTML"], fo = { class: "action-label" }, vo = {
1325
1674
  key: 1,
1326
1675
  class: "row-actions-icons"
1327
- }, co = ["title", "aria-label", "onClick"], uo = ["innerHTML"], Ue = /* @__PURE__ */ xe({
1676
+ }, ho = ["title", "aria-label", "disabled", "onClick"], mo = ["innerHTML"], Ye = /* @__PURE__ */ Ce({
1328
1677
  __name: "ARowActions",
1329
1678
  props: {
1330
1679
  rowIndex: {},
@@ -1334,27 +1683,40 @@ const Hn = (e) => {
1334
1683
  },
1335
1684
  emits: ["action"],
1336
1685
  setup(e, { emit: t }) {
1337
- const n = e, l = t, u = ce("actionsCell"), a = ce("toggleButton"), o = z(0), c = z(!1), r = z(!1), s = z({ top: 0, left: 0 }), d = {
1338
- add: "Add Row",
1339
- delete: "Delete Row",
1340
- duplicate: "Duplicate Row",
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 = {
1687
+ add: "Add Record",
1688
+ delete: "Delete Record",
1689
+ duplicate: "Duplicate Record",
1341
1690
  insertAbove: "Insert Above",
1342
1691
  insertBelow: "Insert Below",
1343
- move: "Move Row"
1344
- }, v = E(() => {
1345
- const m = [], g = n.config.actions || {}, k = ["add", "delete", "duplicate", "insertAbove", "insertBelow", "move"];
1346
- for (const x of k) {
1347
- const R = g[x];
1348
- if (R === !1 || R === void 0) continue;
1349
- let B = !0, j = d[x], I = no[x];
1350
- typeof R == "object" && (B = R.enabled !== !1, j = R.label || j, I = R.icon || I), B && m.push({ type: x, label: j, icon: I });
1692
+ move: "Move Record",
1693
+ moveUp: "Move Up",
1694
+ moveDown: "Move Down",
1695
+ open: "Open Record"
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 });
1351
1713
  }
1352
- return m;
1353
- }), y = E(() => {
1714
+ return v;
1715
+ }), w = T(() => {
1354
1716
  if (n.config.forceDropdown) return !0;
1355
- const m = n.config.dropdownThreshold ?? 150;
1356
- return m === 0 ? !1 : o.value > 0 && o.value < m;
1357
- }), P = E(() => c.value ? r.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 ? {
1358
1720
  position: "fixed",
1359
1721
  bottom: `${window.innerHeight - s.value.top}px`,
1360
1722
  left: `${s.value.left}px`,
@@ -1364,85 +1726,86 @@ const Hn = (e) => {
1364
1726
  top: `${s.value.top}px`,
1365
1727
  left: `${s.value.left}px`
1366
1728
  } : {});
1367
- Je(u, (m) => {
1368
- const g = m[0];
1369
- g && (o.value = g.contentRect.width);
1729
+ qe(u, (v) => {
1730
+ const g = v[0];
1731
+ g && (a.value = g.contentRect.width);
1370
1732
  });
1371
- const F = () => {
1372
- c.value || M(), c.value = !c.value;
1373
- }, M = () => {
1374
- if (!a.value) return;
1375
- const m = a.value.getBoundingClientRect(), g = window.innerHeight, k = v.value.length * 40 + 16, x = g - m.bottom, R = m.top;
1376
- r.value = x < k && R > k, r.value ? s.value = {
1377
- top: m.top,
1378
- left: m.left
1379
- } : s.value = {
1380
- top: m.bottom,
1381
- left: m.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
1382
1743
  };
1383
1744
  };
1384
1745
  ot(u, () => {
1385
1746
  c.value = !1;
1386
1747
  });
1387
- const h = (m) => {
1748
+ const m = (v, g) => {
1388
1749
  c.value = !1;
1389
- const g = n.config.actions?.[m];
1390
- typeof g == "object" && g.handler && g.handler(n.rowIndex, n.store) === !1 || l("action", m, n.rowIndex);
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);
1391
1752
  };
1392
- return (m, g) => (p(), b("td", {
1753
+ return (v, g) => (b(), R("td", {
1393
1754
  ref: "actionsCell",
1394
- class: se(["atable-row-actions", { "sticky-column": e.position === "before-index", "dropdown-active": c.value }])
1755
+ class: ae(["atable-row-actions", { "sticky-column": e.position === "before-index", "dropdown-active": c.value }])
1395
1756
  }, [
1396
- y.value ? (p(), b("div", oo, [
1397
- N("button", {
1757
+ w.value ? (b(), R("div", io, [
1758
+ z("button", {
1398
1759
  ref: "toggleButton",
1399
1760
  type: "button",
1400
1761
  class: "row-actions-toggle",
1401
1762
  "aria-expanded": c.value,
1402
1763
  "aria-haspopup": "true",
1403
- onClick: Se(F, ["stop"])
1764
+ onClick: $e(Z, ["stop"])
1404
1765
  }, [...g[0] || (g[0] = [
1405
- N("span", { class: "dropdown-icon" }, "⋮", -1)
1406
- ])], 8, lo),
1407
- de(N("div", {
1408
- class: se(["row-actions-menu", { "menu-flipped": r.value }]),
1409
- style: pe(P.value),
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),
1410
1771
  role: "menu"
1411
1772
  }, [
1412
- (p(!0), b(me, null, Ce(v.value, (k) => (p(), b("button", {
1773
+ (b(!0), R(me, null, be(f.value, (k) => (b(), R("button", {
1413
1774
  key: k.type,
1414
1775
  type: "button",
1415
1776
  class: "row-action-menu-item",
1416
1777
  role: "menuitem",
1417
- onClick: Se((x) => h(k.type), ["stop"])
1778
+ disabled: k.disabled,
1779
+ onClick: $e((C) => m(k.type, C), ["stop"])
1418
1780
  }, [
1419
- N("span", {
1781
+ z("span", {
1420
1782
  class: "action-icon",
1421
1783
  innerHTML: k.icon
1422
- }, null, 8, so),
1423
- N("span", io, be(k.label), 1)
1424
- ], 8, ao))), 128))
1784
+ }, null, 8, uo),
1785
+ z("span", fo, ye(k.label), 1)
1786
+ ], 8, co))), 128))
1425
1787
  ], 6), [
1426
1788
  [it, c.value]
1427
1789
  ])
1428
- ])) : (p(), b("div", ro, [
1429
- (p(!0), b(me, null, Ce(v.value, (k) => (p(), b("button", {
1790
+ ])) : (b(), R("div", vo, [
1791
+ (b(!0), R(me, null, be(f.value, (k) => (b(), R("button", {
1430
1792
  key: k.type,
1431
1793
  type: "button",
1432
1794
  class: "row-action-btn",
1433
1795
  title: k.label,
1434
1796
  "aria-label": k.label,
1435
- onClick: Se((x) => h(k.type), ["stop"])
1797
+ disabled: k.disabled,
1798
+ onClick: $e((C) => m(k.type, C), ["stop"])
1436
1799
  }, [
1437
- N("span", {
1800
+ z("span", {
1438
1801
  class: "action-icon",
1439
1802
  innerHTML: k.icon
1440
- }, null, 8, uo)
1441
- ], 8, co))), 128))
1803
+ }, null, 8, mo)
1804
+ ], 8, ho))), 128))
1442
1805
  ]))
1443
1806
  ], 2));
1444
1807
  }
1445
- }), fo = ["tabindex"], vo = /* @__PURE__ */ xe({
1808
+ }), go = ["tabindex"], wo = ["tabindex"], po = ["colspan"], xo = /* @__PURE__ */ Ce({
1446
1809
  __name: "ARow",
1447
1810
  props: {
1448
1811
  rowIndex: {},
@@ -1450,77 +1813,107 @@ const Hn = (e) => {
1450
1813
  tabIndex: { default: () => -1 },
1451
1814
  addNavigation: { type: [Boolean, Object], default: !1 }
1452
1815
  },
1453
- emits: ["row:action"],
1816
+ emits: ["row:action", "row:click"],
1454
1817
  setup(e, { emit: t }) {
1455
- const n = t, l = ce("rowEl"), u = E(() => e.store.isRowVisible(e.rowIndex)), a = E(() => e.store.getRowExpandSymbol(e.rowIndex)), o = E(() => e.store.config.rowActions || { enabled: !1 }), c = E(() => o.value.enabled), r = E(() => o.value.position || "before-index"), s = (d, v) => {
1456
- n("row:action", d, v);
1457
- };
1458
- if (e.addNavigation) {
1459
- let d = qe;
1460
- typeof e.addNavigation == "object" && (d = {
1461
- ...d,
1462
- ...e.addNavigation
1463
- }), 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([
1464
1832
  {
1465
1833
  selectors: l,
1466
- handlers: d
1834
+ handlers: y
1467
1835
  }
1468
1836
  ]);
1469
1837
  }
1470
- return (d, v) => de((p(), b("tr", {
1471
- ref: "rowEl",
1472
- tabindex: e.tabIndex,
1473
- class: "atable-row"
1474
- }, [
1475
- c.value && r.value === "before-index" ? (p(), he(Ue, {
1476
- key: 0,
1477
- "row-index": e.rowIndex,
1478
- store: e.store,
1479
- config: o.value,
1480
- position: r.value,
1481
- onAction: s
1482
- }, null, 8, ["row-index", "store", "config", "position"])) : ee("", !0),
1483
- e.store.config.view !== "uncounted" ? fe(d.$slots, "index", { key: 1 }, () => [
1484
- e.store.config.view === "list" ? (p(), b("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, {
1485
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", {
1486
1896
  tabIndex: -1,
1487
- class: se(["list-index", e.store.hasPinnedColumns ? "sticky-index" : ""])
1488
- }, be(e.rowIndex + 1), 3)) : e.store.isTreeView ? (p(), b("td", {
1489
- key: 1,
1490
- tabIndex: -1,
1491
- class: se(["tree-index", e.store.hasPinnedColumns ? "sticky-index" : ""]),
1492
- onClick: v[0] || (v[0] = (y) => e.store.toggleRowExpand(e.rowIndex))
1493
- }, be(a.value), 3)) : ee("", !0)
1494
- ], !0) : ee("", !0),
1495
- c.value && r.value === "after-index" ? (p(), he(Ue, {
1496
- key: 2,
1497
- "row-index": e.rowIndex,
1498
- store: e.store,
1499
- config: o.value,
1500
- position: r.value,
1501
- onAction: s
1502
- }, null, 8, ["row-index", "store", "config", "position"])) : ee("", !0),
1503
- fe(d.$slots, "default", {}, void 0, !0),
1504
- c.value && r.value === "end" ? (p(), he(Ue, {
1505
- key: 3,
1506
- "row-index": e.rowIndex,
1507
- store: e.store,
1508
- config: o.value,
1509
- position: r.value,
1510
- onAction: s
1511
- }, null, 8, ["row-index", "store", "config", "position"])) : ee("", !0)
1512
- ], 8, fo)), [
1513
- [it, u.value]
1514
- ]);
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));
1515
1908
  }
1516
- }), Dt = /* @__PURE__ */ $e(vo, [["__scopeId", "data-v-e7ca13d1"]]), nt = /* @__PURE__ */ new WeakMap(), ho = {
1909
+ }), Bt = /* @__PURE__ */ Ae(xo, [["__scopeId", "data-v-4dd47763"]]), nt = /* @__PURE__ */ new WeakMap(), yo = {
1517
1910
  mounted(e, t) {
1518
1911
  const n = !t.modifiers.bubble;
1519
1912
  let l;
1520
1913
  if (typeof t.value == "function") l = ot(e, t.value, { capture: n });
1521
1914
  else {
1522
- const [u, a] = t.value;
1523
- 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));
1524
1917
  }
1525
1918
  nt.set(e, l);
1526
1919
  },
@@ -1528,21 +1921,21 @@ const Hn = (e) => {
1528
1921
  const t = nt.get(e);
1529
1922
  t && typeof t == "function" ? t() : t?.stop(), nt.delete(e);
1530
1923
  }
1531
- }, mo = { mounted(e, t) {
1532
- 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);
1533
1926
  } };
1534
- function go() {
1927
+ function Co() {
1535
1928
  let e = !1;
1536
1929
  const t = re(!1);
1537
1930
  return (n, l) => {
1538
1931
  if (t.value = l.value, e) return;
1539
1932
  e = !0;
1540
- const u = An(n, l.value);
1541
- ue(t, (a) => u.value = a);
1933
+ const u = Ln(n, l.value);
1934
+ ce(t, (o) => u.value = o);
1542
1935
  };
1543
1936
  }
1544
- go();
1545
- const wo = { class: "gantt-connection-overlay" }, po = {
1937
+ Co();
1938
+ const ko = { class: "gantt-connection-overlay" }, Mo = {
1546
1939
  class: "connection-svg",
1547
1940
  style: {
1548
1941
  position: "absolute",
@@ -1553,39 +1946,39 @@ const wo = { class: "gantt-connection-overlay" }, po = {
1553
1946
  pointerEvents: "none",
1554
1947
  zIndex: 1
1555
1948
  }
1556
- }, xo = ["d", "stroke-width", "onDblclick"], yo = ["id", "d", "stroke", "stroke-width", "onDblclick"], bo = 0.25, Ge = 16, Co = /* @__PURE__ */ xe({
1949
+ }, Ro = ["d", "stroke-width", "onDblclick"], Eo = ["id", "d", "stroke", "stroke-width", "onDblclick"], To = 0.25, Ge = 16, So = /* @__PURE__ */ Ce({
1557
1950
  __name: "AGanttConnection",
1558
1951
  props: {
1559
1952
  store: {}
1560
1953
  },
1561
1954
  emits: ["connection:delete"],
1562
1955
  setup(e, { emit: t }) {
1563
- const n = t, l = E(() => e.store.connectionPaths.filter((o) => {
1564
- const c = e.store.ganttBars.find((s) => s.id === o.from.barId), r = e.store.ganttBars.find((s) => s.id === o.to.barId);
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);
1565
1958
  return c && r;
1566
- })), u = (o) => {
1959
+ })), u = (a) => {
1567
1960
  const c = e.store.connectionHandles.find(
1568
- (j) => j.barId === o.from.barId && j.side === o.from.side
1961
+ (X) => X.barId === a.from.barId && X.side === a.from.side
1569
1962
  ), r = e.store.connectionHandles.find(
1570
- (j) => j.barId === o.to.barId && j.side === o.to.side
1963
+ (X) => X.barId === a.to.barId && X.side === a.to.side
1571
1964
  );
1572
1965
  if (!c || !r) return "";
1573
- const s = c.position.x + Ge / 2, d = c.position.y + Ge / 2, v = r.position.x + Ge / 2, y = r.position.y + Ge / 2, P = Math.abs(v - s), F = Math.max(P * bo, 50), M = s + (o.from.side === "left" ? -F : F), h = v + (o.to.side === "left" ? -F : F), m = { x: 0.5 * s + 0.5 * M, y: 0.5 * d + 0.5 * d }, g = { x: 0.5 * M + 0.5 * h, y: 0.5 * d + 0.5 * y }, k = { x: 0.5 * h + 0.5 * v, y: 0.5 * y + 0.5 * y }, x = { x: 0.5 * m.x + 0.5 * g.x, y: 0.5 * m.y + 0.5 * g.y }, R = { x: 0.5 * g.x + 0.5 * k.x, y: 0.5 * g.y + 0.5 * k.y }, B = { x: 0.5 * x.x + 0.5 * R.x, y: 0.5 * x.y + 0.5 * R.y };
1574
- return `M ${s} ${d} Q ${M} ${d}, ${B.x} ${B.y} Q ${h} ${y}, ${v} ${y}`;
1575
- }, a = (o) => {
1576
- e.store.deleteConnection(o.id) && n("connection:delete", o);
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);
1577
1970
  };
1578
- return (o, c) => (p(), b("div", wo, [
1579
- (p(), b("svg", po, [
1580
- c[0] || (c[0] = N("defs", null, [
1581
- N("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", {
1582
1975
  id: "arrowhead",
1583
1976
  d: "M 0 -7 L 20 0 L 0 7Z",
1584
1977
  stroke: "black",
1585
1978
  "stroke-width": "1",
1586
1979
  fill: "currentColor"
1587
1980
  }),
1588
- N("marker", {
1981
+ z("marker", {
1589
1982
  id: "arrowhead-marker",
1590
1983
  markerWidth: "10",
1591
1984
  markerHeight: "7",
@@ -1594,22 +1987,22 @@ const wo = { class: "gantt-connection-overlay" }, po = {
1594
1987
  orient: "auto",
1595
1988
  markerUnits: "strokeWidth"
1596
1989
  }, [
1597
- N("polygon", {
1990
+ z("polygon", {
1598
1991
  points: "0 0, 10 3.5, 0 7",
1599
1992
  fill: "currentColor"
1600
1993
  })
1601
1994
  ])
1602
1995
  ], -1)),
1603
- (p(!0), b(me, null, Ce(l.value, (r) => (p(), b("path", {
1996
+ (b(!0), R(me, null, be(l.value, (r) => (b(), R("path", {
1604
1997
  key: `${r.id}-hitbox`,
1605
1998
  d: u(r),
1606
1999
  stroke: "transparent",
1607
2000
  "stroke-width": (r.style?.width || 2) + 10,
1608
2001
  fill: "none",
1609
2002
  class: "connection-hitbox",
1610
- onDblclick: (s) => a(r)
1611
- }, null, 40, xo))), 128)),
1612
- (p(!0), b(me, null, Ce(l.value, (r) => (p(), b("path", {
2003
+ onDblclick: (s) => o(r)
2004
+ }, null, 40, Ro))), 128)),
2005
+ (b(!0), R(me, null, be(l.value, (r) => (b(), R("path", {
1613
2006
  id: r.id,
1614
2007
  key: r.id,
1615
2008
  d: u(r),
@@ -1618,18 +2011,18 @@ const wo = { class: "gantt-connection-overlay" }, po = {
1618
2011
  fill: "none",
1619
2012
  "marker-mid": "url(#arrowhead-marker)",
1620
2013
  class: "connection-path animated-path",
1621
- onDblclick: (s) => a(r)
1622
- }, null, 40, yo))), 128))
2014
+ onDblclick: (s) => o(r)
2015
+ }, null, 40, Eo))), 128))
1623
2016
  ]))
1624
2017
  ]));
1625
2018
  }
1626
- }), Mo = /* @__PURE__ */ $e(Co, [["__scopeId", "data-v-d5929c98"]]), ko = { class: "column-filter" }, Ro = {
2019
+ }), $o = /* @__PURE__ */ Ae(So, [["__scopeId", "data-v-d5929c98"]]), Io = { class: "column-filter" }, Ao = {
1627
2020
  key: 2,
1628
2021
  class: "checkbox-filter"
1629
- }, Eo = ["value"], $o = {
2022
+ }, Ho = ["value"], Lo = {
1630
2023
  key: 5,
1631
2024
  class: "date-range-filter"
1632
- }, Io = /* @__PURE__ */ xe({
2025
+ }, Do = /* @__PURE__ */ Ce({
1633
2026
  __name: "ATableColumnFilter",
1634
2027
  props: {
1635
2028
  column: {},
@@ -1637,659 +2030,273 @@ const wo = { class: "gantt-connection-overlay" }, po = {
1637
2030
  store: {}
1638
2031
  },
1639
2032
  setup(e) {
1640
- 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({
1641
2044
  startValue: "",
1642
2045
  endValue: ""
1643
- }), l = E(() => {
2046
+ }), u = T(() => {
1644
2047
  if (e.column.filterType) return e.column.filterType;
1645
- switch (e.column.fieldtype) {
1646
- case "Check":
1647
- return "checkbox";
1648
- case "Date":
1649
- return "date";
1650
- case "Datetime":
1651
- return "dateRange";
1652
- case "Select":
1653
- return "select";
1654
- case "Int":
1655
- case "Float":
1656
- case "Currency":
1657
- case "Decimal":
1658
- case "Quantity":
1659
- return "number";
1660
- default:
1661
- return "text";
1662
- }
1663
- }), u = (s) => {
1664
- if (s.filterOptions) return s.filterOptions;
1665
- const d = /* @__PURE__ */ new Set();
1666
- return e.store.rows.forEach((v) => {
1667
- const y = v[s.name];
1668
- y != null && y !== "" && d.add(y);
1669
- }), Array.from(d).map((v) => ({
1670
- value: v,
1671
- label: String(v)
2048
+ const h = Ot(e.column.component);
2049
+ return h ? t[h] : "text";
2050
+ }), o = (h) => {
2051
+ if (h.filterOptions) return h.filterOptions;
2052
+ const f = /* @__PURE__ */ new Set();
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)
1672
2059
  }));
1673
- }, a = E(() => !!(t.value || n.startValue || n.endValue)), o = (s) => {
1674
- !s && l.value !== "checkbox" ? (e.store.clearFilter(e.colIndex), t.value = "") : (t.value = s, e.store.setFilter(e.colIndex, { value: s }));
1675
- }, c = (s, d) => {
1676
- s === "start" ? n.startValue = d : n.endValue = d, !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, {
1677
2064
  value: null,
1678
- startValue: n.startValue,
1679
- endValue: n.endValue
2065
+ startValue: l.startValue,
2066
+ endValue: l.endValue
1680
2067
  });
1681
- }, r = () => {
1682
- 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);
1683
2070
  };
1684
- return (s, d) => (p(), b("div", ko, [
1685
- l.value === "text" ? de((p(), b("input", {
2071
+ return (h, f) => (b(), R("div", Io, [
2072
+ u.value === "text" ? ue((b(), R("input", {
1686
2073
  key: 0,
1687
- "onUpdate:modelValue": d[0] || (d[0] = (v) => t.value = v),
2074
+ "onUpdate:modelValue": f[0] || (f[0] = (w) => n.value = w),
1688
2075
  type: "text",
1689
2076
  class: "filter-input",
1690
- onInput: d[1] || (d[1] = (v) => o(t.value))
2077
+ onInput: f[1] || (f[1] = (w) => c(n.value))
1691
2078
  }, null, 544)), [
1692
- [Ze, t.value]
1693
- ]) : l.value === "number" ? de((p(), b("input", {
2079
+ [Ze, n.value]
2080
+ ]) : u.value === "number" ? ue((b(), R("input", {
1694
2081
  key: 1,
1695
- "onUpdate:modelValue": d[2] || (d[2] = (v) => t.value = v),
2082
+ "onUpdate:modelValue": f[2] || (f[2] = (w) => n.value = w),
1696
2083
  type: "number",
1697
2084
  class: "filter-input",
1698
- onInput: d[3] || (d[3] = (v) => o(t.value))
2085
+ onInput: f[3] || (f[3] = (w) => c(n.value))
1699
2086
  }, null, 544)), [
1700
- [Ze, t.value]
1701
- ]) : l.value === "checkbox" ? (p(), b("label", Ro, [
1702
- de(N("input", {
1703
- "onUpdate:modelValue": d[4] || (d[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),
1704
2091
  type: "checkbox",
1705
2092
  class: "filter-checkbox",
1706
- onChange: d[5] || (d[5] = (v) => o(t.value))
2093
+ onChange: f[5] || (f[5] = (w) => c(n.value))
1707
2094
  }, null, 544), [
1708
- [Yt, t.value]
2095
+ [Jt, n.value]
1709
2096
  ]),
1710
- N("span", null, be(e.column.label), 1)
1711
- ])) : l.value === "select" ? de((p(), b("select", {
2097
+ z("span", null, ye(e.column.label), 1)
2098
+ ])) : u.value === "select" ? ue((b(), R("select", {
1712
2099
  key: 3,
1713
- "onUpdate:modelValue": d[6] || (d[6] = (v) => t.value = v),
2100
+ "onUpdate:modelValue": f[6] || (f[6] = (w) => n.value = w),
1714
2101
  class: "filter-select",
1715
- onChange: d[7] || (d[7] = (v) => o(t.value))
2102
+ onChange: f[7] || (f[7] = (w) => c(n.value))
1716
2103
  }, [
1717
- d[15] || (d[15] = N("option", { value: "" }, "All", -1)),
1718
- (p(!0), b(me, null, Ce(u(e.column), (v) => (p(), b("option", {
1719
- key: v.value || v,
1720
- value: v.value || v
1721
- }, be(v.label || v), 9, Eo))), 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))
1722
2109
  ], 544)), [
1723
- [Ut, t.value]
1724
- ]) : l.value === "date" ? de((p(), b("input", {
2110
+ [qt, n.value]
2111
+ ]) : u.value === "date" ? ue((b(), R("input", {
1725
2112
  key: 4,
1726
- "onUpdate:modelValue": d[8] || (d[8] = (v) => t.value = v),
2113
+ "onUpdate:modelValue": f[8] || (f[8] = (w) => n.value = w),
1727
2114
  type: "date",
1728
2115
  class: "filter-input",
1729
- onChange: d[9] || (d[9] = (v) => o(t.value))
2116
+ onChange: f[9] || (f[9] = (w) => c(n.value))
1730
2117
  }, null, 544)), [
1731
- [Ze, t.value]
1732
- ]) : l.value === "dateRange" ? (p(), b("div", $o, [
1733
- de(N("input", {
1734
- "onUpdate:modelValue": d[10] || (d[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),
1735
2122
  type: "date",
1736
2123
  class: "filter-input",
1737
- onChange: d[11] || (d[11] = (v) => c("start", n.startValue))
2124
+ onChange: f[11] || (f[11] = (w) => r("start", l.startValue))
1738
2125
  }, null, 544), [
1739
- [Ze, n.startValue]
2126
+ [Ze, l.startValue]
1740
2127
  ]),
1741
- d[16] || (d[16] = N("span", { class: "date-separator" }, "-", -1)),
1742
- de(N("input", {
1743
- "onUpdate:modelValue": d[12] || (d[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),
1744
2131
  type: "date",
1745
2132
  class: "filter-input",
1746
- onChange: d[13] || (d[13] = (v) => c("end", n.endValue))
2133
+ onChange: f[13] || (f[13] = (w) => r("end", l.endValue))
1747
2134
  }, null, 544), [
1748
- [Ze, n.endValue]
2135
+ [Ze, l.endValue]
1749
2136
  ])
1750
- ])) : l.value === "component" && e.column.filterComponent ? (p(), he(Ne(e.column.filterComponent), {
2137
+ ])) : u.value === "component" && e.column.filterComponent ? (b(), ve(Ne(e.column.filterComponent), {
1751
2138
  key: 6,
1752
- value: t.value,
2139
+ value: n.value,
1753
2140
  column: e.column,
1754
2141
  "col-index": e.colIndex,
1755
2142
  store: e.store,
1756
- "onUpdate:value": d[14] || (d[14] = (v) => o(v))
1757
- }, null, 40, ["value", "column", "col-index", "store"])) : ee("", !0),
1758
- a.value ? (p(), b("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", {
1759
2146
  key: 7,
1760
2147
  class: "clear-btn",
1761
2148
  title: "Clear",
1762
- onClick: r
1763
- }, "×")) : ee("", !0)
2149
+ onClick: s
2150
+ }, "×")) : _("", !0)
1764
2151
  ]));
1765
2152
  }
1766
- }), To = /* @__PURE__ */ $e(Io, [["__scopeId", "data-v-e0efa4a9"]]), So = { key: 0 }, Ao = {
2153
+ }), Oo = /* @__PURE__ */ Ae(Do, [["__scopeId", "data-v-b57e3235"]]), Vo = { key: 0 }, Bo = {
1767
2154
  class: "atable-header-row",
1768
2155
  tabindex: "-1"
1769
- }, Ho = {
2156
+ }, Po = {
1770
2157
  key: 2,
1771
2158
  class: "row-actions-header"
1772
- }, Lo = ["data-colindex", "onClick"], Do = {
2159
+ }, Zo = ["data-colindex", "onClick"], No = {
1773
2160
  key: 3,
1774
2161
  class: "row-actions-header"
1775
- }, Oo = {
2162
+ }, Fo = {
1776
2163
  key: 0,
1777
2164
  class: "atable-filters-row"
1778
- }, Vo = {
2165
+ }, Wo = {
1779
2166
  key: 2,
1780
2167
  class: "row-actions-header"
1781
- }, Bo = {
2168
+ }, zo = {
1782
2169
  key: 3,
1783
2170
  class: "row-actions-header"
1784
- }, Ot = /* @__PURE__ */ xe({
2171
+ }, Pt = /* @__PURE__ */ Ce({
1785
2172
  __name: "ATableHeader",
1786
2173
  props: {
1787
2174
  columns: {},
1788
2175
  store: {}
1789
2176
  },
1790
2177
  setup(e) {
1791
- const t = E(() => e.columns.filter((o) => o.filterable)), n = E(() => e.store.config.rowActions?.enabled ?? !1), l = E(() => e.store.config.rowActions?.position ?? "before-index"), u = (o) => e.store.sortByColumn(o), a = (o) => {
1792
- for (const c of o) {
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) {
1793
2180
  if (c.borderBoxSize.length === 0) continue;
1794
- const s = c.borderBoxSize[0].inlineSize, d = Number(c.target.dataset.colindex), v = e.store.columns[d]?.width;
1795
- typeof v == "number" && v !== s && e.store.resizeColumn(d, s);
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);
1796
2183
  }
1797
2184
  };
1798
- return (o, c) => e.columns.length ? (p(), b("thead", So, [
1799
- N("tr", Ao, [
1800
- n.value && l.value === "before-index" ? (p(), b("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", {
1801
2188
  key: 0,
1802
- class: se(["row-actions-header", { "sticky-column": l.value === "before-index" }])
1803
- }, null, 2)) : ee("", !0),
1804
- e.store.zeroColumn ? (p(), b("th", {
2189
+ class: ae(["row-actions-header", { "sticky-column": l.value === "before-index" }])
2190
+ }, null, 2)) : _("", !0),
2191
+ e.store.zeroColumn ? (b(), R("th", {
1805
2192
  key: 1,
1806
2193
  id: "header-index",
1807
- class: se([[
2194
+ class: ae([[
1808
2195
  e.store.hasPinnedColumns ? "sticky-index" : "",
1809
2196
  e.store.isTreeView ? "tree-index" : "",
1810
2197
  e.store.config.view === "list-expansion" ? "list-expansion-index" : ""
1811
2198
  ], "list-index"])
1812
- }, null, 2)) : ee("", !0),
1813
- n.value && l.value === "after-index" ? (p(), b("th", Ho)) : ee("", !0),
1814
- (p(!0), b(me, null, Ce(e.columns, (r, s) => de((p(), b("th", {
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", {
1815
2202
  key: r.name,
1816
2203
  "data-colindex": s,
1817
2204
  tabindex: "-1",
1818
2205
  style: pe(e.store.getHeaderCellStyle(r)),
1819
- class: se(`${r.pinned ? "sticky-column" : ""} ${r.sortable === !1 ? "" : "cursor-pointer"}`),
1820
- onClick: (d) => r.sortable !== !1 ? u(s) : void 0
2206
+ class: ae(`${r.pinned ? "sticky-column" : ""} ${r.sortable === !1 ? "" : "cursor-pointer"}`),
2207
+ onClick: (h) => r.sortable !== !1 ? u(s) : void 0
1821
2208
  }, [
1822
- fe(o.$slots, "default", {}, () => [
1823
- Jt(be(r.label || String.fromCharCode(s + 97).toUpperCase()), 1)
2209
+ he(a.$slots, "default", {}, () => [
2210
+ Qt(ye(r.label || String.fromCharCode(s + 97).toUpperCase()), 1)
1824
2211
  ])
1825
- ], 14, Lo)), [
1826
- [O(mo), a]
2212
+ ], 14, Zo)), [
2213
+ [P(bo), o]
1827
2214
  ])), 128)),
1828
- n.value && l.value === "end" ? (p(), b("th", Do)) : ee("", !0)
2215
+ n.value && l.value === "end" ? (b(), R("th", No)) : _("", !0)
1829
2216
  ]),
1830
- t.value.length > 0 ? (p(), b("tr", Oo, [
1831
- n.value && l.value === "before-index" ? (p(), b("th", {
2217
+ t.value.length > 0 ? (b(), R("tr", Fo, [
2218
+ n.value && l.value === "before-index" ? (b(), R("th", {
1832
2219
  key: 0,
1833
- class: se(["row-actions-header", { "sticky-column": l.value === "before-index" }])
1834
- }, null, 2)) : ee("", !0),
1835
- e.store.zeroColumn ? (p(), b("th", {
2220
+ class: ae(["row-actions-header", { "sticky-column": l.value === "before-index" }])
2221
+ }, null, 2)) : _("", !0),
2222
+ e.store.zeroColumn ? (b(), R("th", {
1836
2223
  key: 1,
1837
- class: se([[
2224
+ class: ae([[
1838
2225
  e.store.hasPinnedColumns ? "sticky-index" : "",
1839
2226
  e.store.isTreeView ? "tree-index" : "",
1840
2227
  e.store.config.view === "list-expansion" ? "list-expansion-index" : ""
1841
2228
  ], "list-index"])
1842
- }, null, 2)) : ee("", !0),
1843
- n.value && l.value === "after-index" ? (p(), b("th", Vo)) : ee("", !0),
1844
- (p(!0), b(me, null, Ce(e.columns, (r, s) => (p(), b("th", {
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", {
1845
2232
  key: `filter-${r.name}`,
1846
- class: se(`${r.pinned ? "sticky-column" : ""}`),
2233
+ class: ae(`${r.pinned ? "sticky-column" : ""}`),
1847
2234
  style: pe(e.store.getHeaderCellStyle(r))
1848
2235
  }, [
1849
- r.filterable ? (p(), he(To, {
2236
+ r.filterable ? (b(), ve(Oo, {
1850
2237
  key: 0,
1851
2238
  column: r,
1852
2239
  "col-index": s,
1853
2240
  store: e.store
1854
- }, null, 8, ["column", "col-index", "store"])) : ee("", !0)
2241
+ }, null, 8, ["column", "col-index", "store"])) : _("", !0)
1855
2242
  ], 6))), 128)),
1856
- n.value && l.value === "end" ? (p(), b("th", Bo)) : ee("", !0)
1857
- ])) : ee("", !0)
1858
- ])) : ee("", !0);
2243
+ n.value && l.value === "end" ? (b(), R("th", zo)) : _("", !0)
2244
+ ])) : _("", !0)
2245
+ ])) : _("", !0);
1859
2246
  }
1860
- }), Vt = /* @__PURE__ */ xe({
2247
+ }), Zt = /* @__PURE__ */ Ce({
1861
2248
  __name: "ATableModal",
1862
2249
  props: {
1863
2250
  store: {}
1864
2251
  },
1865
2252
  setup(e) {
1866
- const t = ce("amodal"), { width: n, height: l } = Ie(t), u = E(() => {
2253
+ const t = de("amodal"), { width: n, height: l } = Te(t), u = T(() => {
1867
2254
  if (!(e.store.modal.height && e.store.modal.width && e.store.modal.left && e.store.modal.bottom)) return {};
1868
- const a = e.store.modal.cell?.closest("table");
1869
- if (!a) return {};
1870
- const o = a.offsetHeight || 0, c = a.offsetWidth || 0;
2255
+ const o = e.store.modal.cell?.closest("table");
2256
+ if (!o) return {};
2257
+ const a = o.offsetHeight || 0, c = o.offsetWidth || 0;
1871
2258
  let r = e.store.modal.cell?.offsetTop || 0;
1872
- const s = a.querySelector("thead")?.offsetHeight || 0;
1873
- r += s, r = r + l.value < o ? r : r - (l.value + e.store.modal.height);
1874
- let d = e.store.modal.cell?.offsetLeft || 0;
1875
- return d = d + n.value <= c ? d : d - (n.value - e.store.modal.width), {
1876
- left: `${d}px`,
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`,
1877
2264
  top: `${r}px`
1878
2265
  };
1879
2266
  });
1880
- return (a, o) => (p(), b("div", {
2267
+ return (o, a) => (b(), R("div", {
1881
2268
  ref: "amodal",
1882
2269
  class: "amodal",
1883
2270
  tabindex: "-1",
1884
2271
  style: pe(u.value),
1885
- onClick: o[0] || (o[0] = Se(() => {
2272
+ onClick: a[0] || (a[0] = $e(() => {
1886
2273
  }, ["stop"])),
1887
- onInput: o[1] || (o[1] = Se(() => {
2274
+ onInput: a[1] || (a[1] = $e(() => {
1888
2275
  }, ["stop"]))
1889
2276
  }, [
1890
- fe(a.$slots, "default")
2277
+ he(o.$slots, "default")
1891
2278
  ], 36));
1892
2279
  }
1893
2280
  });
1894
- function Bt(e, t) {
1895
- const n = t[e];
1896
- if (n.isRoot || n.parent === null || n.parent === void 0)
1897
- return !0;
1898
- const l = n.parent;
1899
- return l < 0 || l >= t.length ? !1 : (t[l].childrenOpen || !1) && Bt(l, t);
1900
- }
1901
- function Po(e, t, n) {
1902
- const l = n.filterType || "text", u = t.value;
1903
- if (!u && l !== "dateRange" && l !== "checkbox") return !0;
1904
- switch (l) {
1905
- case "text":
1906
- return (typeof e == "object" && e !== null ? Object.values(e).join(" ") : String(e || "")).toLowerCase().includes(String(u).toLowerCase());
1907
- case "number": {
1908
- const a = Number(e), o = Number(u);
1909
- return !isNaN(a) && !isNaN(o) && a === o;
1910
- }
1911
- case "select":
1912
- return e === u;
1913
- case "checkbox":
1914
- return u === !0 ? !!e : !0;
1915
- case "date": {
1916
- let a;
1917
- if (typeof e == "number") {
1918
- const c = new Date(e), r = (/* @__PURE__ */ new Date()).getFullYear();
1919
- a = new Date(r, c.getMonth(), c.getDate());
1920
- } else
1921
- a = new Date(String(e));
1922
- const o = new Date(String(u));
1923
- return a.toDateString() === o.toDateString();
1924
- }
1925
- case "dateRange": {
1926
- const a = t.startValue, o = t.endValue;
1927
- if (!a && !o) return !0;
1928
- let c;
1929
- if (typeof e == "number") {
1930
- const r = new Date(e), s = (/* @__PURE__ */ new Date()).getFullYear();
1931
- c = new Date(s, r.getMonth(), r.getDate());
1932
- } else
1933
- c = new Date(String(e));
1934
- return !(a && c < new Date(String(a)) || o && c > new Date(String(o)));
1935
- }
1936
- default:
1937
- return !0;
1938
- }
1939
- }
1940
- function Zo(e, t) {
1941
- return t && e === 0 && t > 0 ? `${t}ch` : "inherit";
1942
- }
1943
- const No = (e) => {
1944
- const t = e.id || Ln(), n = e.linkResolver ?? null;
1945
- return Qt(`table-${t}`, () => {
1946
- const u = () => {
1947
- const i = [Object.assign({}, { rowModified: !1 })], f = /* @__PURE__ */ new Set();
1948
- for (let L = 0; L < o.value.length; L++) {
1949
- const S = o.value[L];
1950
- S.parent !== null && S.parent !== void 0 && f.add(S.parent);
1951
- }
1952
- const w = (L) => o.value[L]?.gantt !== void 0, T = (L) => {
1953
- for (let S = 0; S < o.value.length; S++)
1954
- if (o.value[S].parent === L && (w(S) || T(S)))
1955
- return !0;
1956
- return !1;
1957
- }, J = (L) => {
1958
- const S = c.value, U = S.view === "tree" || S.view === "tree-gantt" ? S.defaultTreeExpansion : void 0;
1959
- if (!U) return !0;
1960
- switch (U) {
1961
- case "root":
1962
- return !1;
1963
- // Only root nodes are visible, all children start collapsed
1964
- case "branch":
1965
- return T(L);
1966
- case "leaf":
1967
- return !0;
1968
- // All nodes should be expanded
1969
- default:
1970
- return !0;
1971
- }
1972
- };
1973
- for (let L = 0; L < o.value.length; L++) {
1974
- const S = o.value[L], U = S.parent === null || S.parent === void 0, ie = f.has(L);
1975
- i[L] = {
1976
- childrenOpen: J(L),
1977
- expanded: !1,
1978
- indent: S.indent || 0,
1979
- isParent: ie,
1980
- isRoot: U,
1981
- rowModified: !1,
1982
- open: U,
1983
- // This will be recalculated later for non-root nodes
1984
- parent: S.parent
1985
- };
1986
- }
1987
- return i;
1988
- }, a = z(e.columns), o = z(e.rows), c = z(e.config || {}), r = z({}), s = z({}), d = E(() => {
1989
- const i = {};
1990
- for (const [f, w] of a.value.entries())
1991
- for (const [T, J] of o.value.entries())
1992
- i[`${f}:${T}`] = J[w.name];
1993
- return i;
1994
- }), v = E({
1995
- get: () => {
1996
- const i = u();
1997
- for (let f = 0; f < i.length; f++)
1998
- r.value[f] && (i[f].rowModified = r.value[f]), s.value[f] && (s.value[f].childrenOpen !== void 0 && (i[f].childrenOpen = s.value[f].childrenOpen), s.value[f].expanded !== void 0 && (i[f].expanded = s.value[f].expanded));
1999
- if (R.value)
2000
- for (let f = 0; f < i.length; f++)
2001
- i[f].isRoot || (i[f].open = Bt(f, i));
2002
- return i;
2003
- },
2004
- set: (i) => {
2005
- JSON.stringify(i) !== JSON.stringify(v.value) && (v.value = i);
2006
- }
2007
- }), y = z(e.modal || { visible: !1 }), P = z({}), F = z([]), M = z([]), h = z([]), m = z({
2008
- column: null,
2009
- direction: null
2010
- }), g = z({}), k = E(() => a.value.some((i) => i.pinned)), x = E(() => c.value.view === "gantt" || c.value.view === "tree-gantt"), R = E(() => c.value.view === "tree" || c.value.view === "tree-gantt"), B = E(() => {
2011
- const i = c.value;
2012
- return i.view === "gantt" || i.view === "tree-gantt" ? i.dependencyGraph !== !1 : !0;
2013
- }), j = E(() => `${Math.ceil(o.value.length / 100 + 1)}ch`), I = E(
2014
- () => c.value.view ? ["list", "tree", "tree-gantt", "list-expansion"].includes(c.value.view) : !1
2015
- ), V = E(() => {
2016
- let i = o.value.map((f, w) => ({
2017
- ...f,
2018
- originalIndex: w
2019
- }));
2020
- if (Object.entries(g.value).forEach(([f, w]) => {
2021
- const T = parseInt(f), J = a.value[T];
2022
- !J || !(w.value || w.startValue || w.endValue || J.filterType === "checkbox" && w.value !== void 0) || (i = i.filter((S) => {
2023
- const U = S[J.name];
2024
- return Po(U, w, J);
2025
- }));
2026
- }), m.value.column !== null && m.value.direction) {
2027
- const f = a.value[m.value.column], w = m.value.direction;
2028
- i.sort((T, J) => {
2029
- let L = T[f.name], S = J[f.name];
2030
- L == null && (L = ""), S == null && (S = "");
2031
- const U = Number(L), ie = Number(S);
2032
- if (!isNaN(U) && !isNaN(ie) && L !== "" && S !== "")
2033
- return w === "asc" ? U - ie : ie - U;
2034
- {
2035
- const mt = String(L).toLowerCase(), gt = String(S).toLowerCase();
2036
- return w === "asc" ? mt.localeCompare(gt) : gt.localeCompare(mt);
2037
- }
2038
- });
2039
- }
2040
- return i;
2041
- }), Z = (i, f) => d.value[`${i}:${f}`], q = (i, f, w) => {
2042
- const T = `${i}:${f}`, J = a.value[i];
2043
- d.value[T] !== w && (r.value[f] = !0), d.value[T] = w, o.value[f] = {
2044
- ...o.value[f],
2045
- [J.name]: w
2046
- };
2047
- }, _ = (i) => {
2048
- o.value = i;
2049
- }, ne = (i, f, w) => {
2050
- const T = `${i}:${f}`;
2051
- d.value[T] !== w && (r.value[f] = !0, P.value[T] = w);
2052
- }, ge = (i) => {
2053
- const f = a.value.indexOf(i) === a.value.length - 1, w = c.value.fullWidth ? i.resizable && !f : i.resizable;
2054
- return {
2055
- width: i.width || "40ch",
2056
- textAlign: i.align || "center",
2057
- ...w && {
2058
- resize: "horizontal",
2059
- overflow: "hidden",
2060
- whiteSpace: "nowrap"
2061
- }
2062
- };
2063
- }, ve = (i, f) => {
2064
- if (i < 0 || i >= a.value.length) return;
2065
- const T = Math.max(f, 40);
2066
- a.value[i] = {
2067
- ...a.value[i],
2068
- width: `${T}px`
2069
- };
2070
- }, Oe = (i) => {
2071
- const f = o.value[i];
2072
- return x.value && f.gantt !== void 0;
2073
- }, Ve = (i) => !R.value || v.value[i].isRoot || v.value[i].open, Be = (i) => !R.value && c.value.view !== "list-expansion" ? "" : R.value && (v.value[i].isRoot || v.value[i].isParent) ? v.value[i].childrenOpen ? "▼" : "►" : c.value.view === "list-expansion" ? v.value[i].expanded ? "▼" : "►" : "", Pe = (i) => {
2074
- if (R.value) {
2075
- const f = s.value[i] || {}, T = !(f.childrenOpen ?? v.value[i].childrenOpen);
2076
- s.value[i] = {
2077
- ...f,
2078
- childrenOpen: T
2079
- }, T || He(i);
2080
- } else if (c.value.view === "list-expansion") {
2081
- const f = s.value[i] || {}, w = f.expanded ?? v.value[i].expanded;
2082
- s.value[i] = {
2083
- ...f,
2084
- expanded: !w
2085
- };
2086
- }
2087
- }, He = (i) => {
2088
- for (let f = 0; f < o.value.length; f++)
2089
- if (v.value[f].parent === i) {
2090
- const w = s.value[f] || {};
2091
- s.value[f] = {
2092
- ...w,
2093
- childrenOpen: !1
2094
- }, He(f);
2095
- }
2096
- }, C = (i, f) => {
2097
- const w = Z(i, f);
2098
- return H(i, f, w);
2099
- }, H = (i, f, w) => {
2100
- const T = a.value[i], J = o.value[f], L = T.format;
2101
- if (!L)
2102
- switch (T.fieldtype) {
2103
- case "Check":
2104
- return w ? "✓" : "✗";
2105
- case "Date":
2106
- return w != null ? new Date(String(w)).toLocaleDateString() : w;
2107
- case "Datetime":
2108
- return w != null ? new Date(String(w)).toLocaleString() : w;
2109
- default:
2110
- return w;
2111
- }
2112
- return typeof L == "function" ? L(w, { table: d.value, row: J, column: T }) : typeof L == "string" ? Function(`"use strict";return (${L})`)()(w, { table: d.value, row: J, column: T }) : w;
2113
- }, W = (i) => {
2114
- i.target instanceof Node && y.value.parent?.contains(i.target) || y.value.visible && (y.value.visible = !1);
2115
- }, Q = (i) => {
2116
- const f = o.value[i.rowIndex]?.gantt;
2117
- f && (i.type === "resize" ? i.edge === "start" ? (f.startIndex = i.newStart, f.endIndex = i.end, f.colspan = f.endIndex - f.startIndex) : i.edge === "end" && (f.startIndex = i.start, f.endIndex = i.newEnd, f.colspan = f.endIndex - f.startIndex) : i.type === "bar" && (f.startIndex = i.newStart, f.endIndex = i.newEnd, f.colspan = f.endIndex - f.startIndex));
2118
- }, X = (i) => {
2119
- const f = F.value.findIndex((w) => w.id === i.id);
2120
- f >= 0 ? F.value[f] = i : F.value.push(i);
2121
- }, oe = (i) => {
2122
- const f = F.value.findIndex((w) => w.id === i);
2123
- f >= 0 && F.value.splice(f, 1);
2124
- }, ye = (i) => {
2125
- const f = M.value.findIndex((w) => w.id === i.id);
2126
- f >= 0 ? M.value[f] = i : M.value.push(i);
2127
- }, Re = (i) => {
2128
- const f = M.value.findIndex((w) => w.id === i);
2129
- f >= 0 && M.value.splice(f, 1);
2130
- }, $ = (i, f, w) => {
2131
- const T = M.value.find((S) => S.id === i), J = M.value.find((S) => S.id === f);
2132
- if (!T || !J)
2133
- return console.warn("Cannot create connection: handle not found"), null;
2134
- const L = {
2135
- id: `connection-${i}-${f}`,
2136
- from: {
2137
- barId: T.barId,
2138
- side: T.side
2139
- },
2140
- to: {
2141
- barId: J.barId,
2142
- side: J.side
2143
- },
2144
- style: w?.style,
2145
- label: w?.label
2146
- };
2147
- return h.value.push(L), L;
2148
- }, D = (i) => {
2149
- const f = h.value.findIndex((w) => w.id === i);
2150
- return f >= 0 ? (h.value.splice(f, 1), !0) : !1;
2151
- }, Y = (i) => h.value.filter((f) => f.from.barId === i || f.to.barId === i), G = (i) => M.value.filter((f) => f.barId === i), K = (i) => {
2152
- if (a.value[i].sortable === !1) return;
2153
- let w;
2154
- m.value.column === i && m.value.direction === "asc" ? w = "desc" : w = "asc", m.value.column = i, m.value.direction = w;
2155
- }, te = (i, f) => {
2156
- !f.value && !f.startValue && !f.endValue ? delete g.value[i] : g.value[i] = f;
2157
- }, le = (i) => {
2158
- delete g.value[i];
2159
- }, ae = (i, f = "end") => {
2160
- const w = {};
2161
- for (const J of a.value)
2162
- w[J.name] = "";
2163
- i && Object.assign(w, i);
2164
- let T;
2165
- return f === "start" ? (T = 0, o.value.unshift(w)) : f === "end" ? (T = o.value.length, o.value.push(w)) : (T = Math.max(0, Math.min(f, o.value.length)), o.value.splice(T, 0, w)), T;
2166
- };
2167
- return {
2168
- // state
2169
- columns: a,
2170
- config: c,
2171
- connectionHandles: M,
2172
- connectionPaths: h,
2173
- display: v,
2174
- filterState: g,
2175
- ganttBars: F,
2176
- modal: y,
2177
- rows: o,
2178
- sortState: m,
2179
- table: d,
2180
- updates: P,
2181
- // getters
2182
- filteredRows: V,
2183
- hasPinnedColumns: k,
2184
- isGanttView: x,
2185
- isTreeView: R,
2186
- isDependencyGraphEnabled: B,
2187
- numberedRowWidth: j,
2188
- zeroColumn: I,
2189
- // resolver
2190
- linkResolver: n,
2191
- // actions
2192
- addRow: ae,
2193
- clearFilter: le,
2194
- closeModal: W,
2195
- createConnection: $,
2196
- deleteConnection: D,
2197
- deleteRow: (i) => {
2198
- if (i < 0 || i >= o.value.length)
2199
- return null;
2200
- const [f] = o.value.splice(i, 1);
2201
- delete r.value[i], delete s.value[i];
2202
- const w = {}, T = {};
2203
- for (const [J, L] of Object.entries(r.value)) {
2204
- const S = parseInt(J);
2205
- S > i ? w[S - 1] = L : w[S] = L;
2206
- }
2207
- for (const [J, L] of Object.entries(s.value)) {
2208
- const S = parseInt(J);
2209
- S > i ? T[S - 1] = L : T[S] = L;
2210
- }
2211
- return r.value = w, s.value = T, f;
2212
- },
2213
- duplicateRow: (i) => {
2214
- if (i < 0 || i >= o.value.length)
2215
- return -1;
2216
- const f = o.value[i], w = JSON.parse(JSON.stringify(f)), T = i + 1;
2217
- return o.value.splice(T, 0, w), T;
2218
- },
2219
- getCellData: Z,
2220
- getCellDisplayValue: C,
2221
- getConnectionsForBar: Y,
2222
- getFormattedValue: H,
2223
- getHandlesForBar: G,
2224
- getHeaderCellStyle: ge,
2225
- getIndent: Zo,
2226
- getRowExpandSymbol: Be,
2227
- insertRowAbove: (i, f) => {
2228
- const w = Math.max(0, i);
2229
- return ae(f, w);
2230
- },
2231
- insertRowBelow: (i, f) => {
2232
- const w = Math.min(i + 1, o.value.length);
2233
- return ae(f, w);
2234
- },
2235
- isRowGantt: Oe,
2236
- isRowVisible: Ve,
2237
- moveRow: (i, f) => {
2238
- if (i < 0 || i >= o.value.length || f < 0 || f >= o.value.length || i === f)
2239
- return !1;
2240
- const [w] = o.value.splice(i, 1);
2241
- o.value.splice(f, 0, w);
2242
- const T = {}, J = {};
2243
- for (const [L, S] of Object.entries(r.value)) {
2244
- const U = parseInt(L);
2245
- let ie = U;
2246
- U === i ? ie = f : i < f ? U > i && U <= f && (ie = U - 1) : U >= f && U < i && (ie = U + 1), T[ie] = S;
2247
- }
2248
- for (const [L, S] of Object.entries(s.value)) {
2249
- const U = parseInt(L);
2250
- let ie = U;
2251
- U === i ? ie = f : i < f ? U > i && U <= f && (ie = U - 1) : U >= f && U < i && (ie = U + 1), J[ie] = S;
2252
- }
2253
- return r.value = T, s.value = J, !0;
2254
- },
2255
- registerConnectionHandle: ye,
2256
- registerGanttBar: X,
2257
- resizeColumn: ve,
2258
- setCellData: q,
2259
- setCellText: ne,
2260
- setFilter: te,
2261
- sortByColumn: K,
2262
- toggleRowExpand: Pe,
2263
- unregisterConnectionHandle: Re,
2264
- unregisterGanttBar: oe,
2265
- updateGanttBar: Q,
2266
- updateRows: _
2267
- };
2268
- })();
2269
- };
2270
- function Fo(e) {
2271
- 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 }) => {
2272
2283
  const u = Object.assign({ name: t }, l);
2273
- if (l.fieldtype === "Link" && !l.cellComponent) {
2274
- const a = l, o = typeof a.doctype == "string" ? a.doctype : void 0;
2275
- o && (u.linkDoctype = o), l.format || (u.format = (c) => {
2276
- if (c == null) return "";
2277
- if (typeof c == "object") {
2278
- const r = c.displayText ?? c.id ?? "";
2279
- return typeof r == "string" || typeof r == "number" ? String(r) : "";
2280
- }
2281
- return String(c);
2282
- });
2283
- }
2284
- 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;
2285
2292
  });
2286
2293
  }
2287
- const Wo = {
2294
+ const Go = {
2288
2295
  class: "atable-container",
2289
2296
  style: { position: "relative" }
2290
- }, zo = /* @__PURE__ */ xe({
2297
+ }, Uo = /* @__PURE__ */ Ce({
2291
2298
  __name: "ATable",
2292
- props: /* @__PURE__ */ yt({
2299
+ props: /* @__PURE__ */ xt({
2293
2300
  id: { default: "" },
2294
2301
  config: { default: () => new Object() },
2295
2302
  schema: { default: () => [] },
@@ -2300,118 +2307,134 @@ const Wo = {
2300
2307
  columns: {},
2301
2308
  columnsModifiers: {}
2302
2309
  }),
2303
- emits: /* @__PURE__ */ yt(["cellUpdate", "gantt:drag", "connection:event", "columns:update", "row:add", "row:delete", "row:duplicate", "row:insert-above", "row:insert-below", "row:move"], ["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"]),
2304
2311
  setup(e, { expose: t, emit: n }) {
2305
- const l = wt(e, "rows"), u = wt(e, "columns"), a = n, o = ce("table"), c = u.value?.length ? u.value : Fo(e.schema ?? []), r = qt("aformLinkResolver", null), s = No({
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({
2306
2313
  columns: c,
2307
2314
  rows: l.value,
2308
2315
  id: e.id,
2309
2316
  config: e.config,
2310
2317
  linkResolver: e.linkResolver ?? r
2311
2318
  });
2312
- s.$onAction(({ name: h, store: m, args: g, after: k }) => {
2313
- if (h === "setCellData" || h === "setCellText") {
2314
- const [x, R, B] = g, j = m.getCellData(x, R);
2315
- k(() => {
2316
- l.value = [...s.rows], a("cellUpdate", { colIndex: x, rowIndex: R, newValue: B, oldValue: j });
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 });
2317
2324
  });
2318
- } else if (h === "updateGanttBar") {
2319
- const [x] = g;
2320
- let R = !1;
2321
- x.type === "resize" ? R = x.oldColspan !== x.newColspan : x.type === "bar" && (R = x.oldStart !== x.newStart || x.oldEnd !== x.newEnd), R && k(() => {
2322
- a("gantt:drag", x);
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);
2323
2330
  });
2324
- } else h === "resizeColumn" && k(() => {
2325
- u.value = [...s.columns], a("columns:update", [...s.columns]);
2331
+ } else v === "resizeColumn" && C(() => {
2332
+ u.value = [...s.columns], o("columns:update", [...s.columns]);
2326
2333
  });
2327
- }), ue(
2334
+ }), ce(
2328
2335
  () => l.value,
2329
- (h) => {
2330
- JSON.stringify(h) !== JSON.stringify(s.rows) && (s.rows = [...h]);
2336
+ (v) => {
2337
+ JSON.stringify(v) !== JSON.stringify(s.rows) && (s.rows = [...v]);
2331
2338
  },
2332
2339
  { deep: !0 }
2333
- ), ue(
2340
+ ), ce(
2334
2341
  u,
2335
- (h) => {
2336
- 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]));
2337
2344
  },
2338
2345
  { deep: !0 }
2339
- ), Ae(() => {
2340
- 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 }));
2341
2348
  });
2342
- const d = E(() => s.columns.filter((h) => h.pinned).length), v = () => {
2343
- const h = o.value, m = h?.rows[0], g = h?.rows[1], k = m ? Array.from(m.cells) : [];
2344
- for (const [x, R] of k.entries()) {
2345
- const B = g?.cells[x];
2346
- B && (R.style.width = `${B.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`);
2347
2354
  }
2348
- for (const x of h?.rows || []) {
2349
- let R = 0;
2350
- const B = [];
2351
- for (const j of x.cells)
2352
- (j.classList.contains("sticky-column") || j.classList.contains("sticky-index")) && (j.style.left = `${R}px`, R += j.offsetWidth, B.push(j));
2353
- B.length > 0 && B[B.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");
2354
2361
  }
2355
2362
  };
2356
- window.addEventListener("keydown", (h) => {
2357
- if (h.key === "Escape" && s.modal.visible) {
2363
+ window.addEventListener("keydown", (v) => {
2364
+ if (v.key === "Escape" && s.modal.visible) {
2358
2365
  s.modal.visible = !1;
2359
- const m = s.modal.parent;
2360
- m && at().then(() => m.focus());
2366
+ const g = s.modal.parent;
2367
+ g && at().then(() => g.focus());
2361
2368
  }
2362
2369
  });
2363
- const y = (h) => {
2364
- if (!h.gantt || d.value === 0)
2370
+ const w = (v) => {
2371
+ if (!v.gantt || h.value === 0)
2365
2372
  return s.columns;
2366
- const m = [];
2367
- for (let g = 0; g < d.value; g++) {
2368
- const k = { ...s.columns[g] };
2369
- k.originalIndex = g, m.push(k);
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);
2370
2377
  }
2371
- return m.push({
2372
- ...s.columns[d.value],
2378
+ return g.push({
2379
+ ...s.columns[h.value],
2373
2380
  isGantt: !0,
2374
- colspan: h.gantt?.colspan || s.columns.length - d.value,
2375
- originalIndex: d.value,
2381
+ colspan: v.gantt?.colspan || s.columns.length - h.value,
2382
+ originalIndex: h.value,
2376
2383
  width: "auto"
2377
2384
  // TODO: refactor to API that can detect when data exists in a cell. Might have be custom and not generalizable
2378
- }), m;
2379
- }, P = (h) => {
2380
- a("connection:event", { type: "create", connection: h });
2381
- }, F = (h) => {
2382
- a("connection:event", { type: "delete", connection: h });
2383
- }, M = (h, m) => {
2384
- 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) {
2385
2395
  case "add": {
2386
- const g = s.addRow({}, m + 1), k = s.rows[g];
2387
- l.value = [...s.rows], a("row:add", { rowIndex: g, row: k });
2396
+ const C = s.addRow({}, g + 1), x = s.rows[C];
2397
+ l.value = [...s.rows], o("row:add", { rowIndex: C, row: x });
2388
2398
  break;
2389
2399
  }
2390
2400
  case "delete": {
2391
- const g = s.deleteRow(m);
2392
- g && (l.value = [...s.rows], a("row:delete", { rowIndex: m, row: g }));
2401
+ const C = s.deleteRow(g);
2402
+ C && (l.value = [...s.rows], o("row:delete", { rowIndex: g, row: C }));
2393
2403
  break;
2394
2404
  }
2395
2405
  case "duplicate": {
2396
- const g = s.duplicateRow(m);
2397
- if (g >= 0) {
2398
- const k = s.rows[g];
2399
- l.value = [...s.rows], a("row:duplicate", { sourceIndex: m, newIndex: g, row: k });
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 });
2400
2410
  }
2401
2411
  break;
2402
2412
  }
2403
2413
  case "insertAbove": {
2404
- const g = s.insertRowAbove(m), k = s.rows[g];
2405
- l.value = [...s.rows], a("row:insert-above", { targetIndex: m, newIndex: g, row: k });
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 });
2406
2416
  break;
2407
2417
  }
2408
2418
  case "insertBelow": {
2409
- const g = s.insertRowBelow(m), k = s.rows[g];
2410
- l.value = [...s.rows], a("row:insert-below", { targetIndex: m, newIndex: g, row: k });
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 });
2411
2421
  break;
2412
2422
  }
2413
2423
  case "move": {
2414
- 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 }));
2433
+ break;
2434
+ }
2435
+ case "open": {
2436
+ const C = s.rows[g];
2437
+ o("row:open", { row: C, rowIndex: g, event: k });
2415
2438
  break;
2416
2439
  }
2417
2440
  }
@@ -2429,59 +2452,60 @@ const Wo = {
2429
2452
  insertRowAbove: s.insertRowAbove,
2430
2453
  insertRowBelow: s.insertRowBelow,
2431
2454
  moveRow: s.moveRow
2432
- }), (h, m) => (p(), b("div", Wo, [
2433
- de((p(), b("table", {
2455
+ }), (v, g) => (b(), R("div", Go, [
2456
+ ue((b(), R("table", {
2434
2457
  ref: "table",
2435
2458
  class: "atable",
2436
2459
  style: pe({
2437
- width: O(s).config.fullWidth ? "100%" : "auto"
2460
+ width: P(s).config.fullWidth ? "100%" : "auto"
2438
2461
  })
2439
2462
  }, [
2440
- fe(h.$slots, "header", { data: O(s) }, () => [
2441
- pt(Ot, {
2442
- columns: O(s).columns,
2443
- store: O(s)
2463
+ he(v.$slots, "header", { data: P(s) }, () => [
2464
+ wt(Pt, {
2465
+ columns: P(s).columns,
2466
+ store: P(s)
2444
2467
  }, null, 8, ["columns", "store"])
2445
2468
  ], !0),
2446
- N("tbody", null, [
2447
- fe(h.$slots, "body", { data: O(s) }, () => [
2448
- (p(!0), b(me, null, Ce(O(s).filteredRows, (g, k) => (p(), he(Dt, {
2449
- key: `${g.originalIndex}-${k}`,
2450
- row: g,
2451
- "row-index": g.originalIndex,
2452
- store: O(s),
2453
- "onRow:action": M
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
2454
2478
  }, {
2455
- default: xt(() => [
2456
- (p(!0), b(me, null, Ce(y(g), (x, R) => (p(), b(me, {
2479
+ default: pt(() => [
2480
+ (b(!0), R(me, null, be(w(k), (x, I) => (b(), R(me, {
2457
2481
  key: x.name
2458
2482
  }, [
2459
- x.isGantt ? (p(), he(Ne(x.ganttComponent || "AGanttCell"), {
2483
+ x.isGantt ? (b(), ve(Ne(x.ganttComponent || "AGanttCell"), {
2460
2484
  key: 0,
2461
- store: O(s),
2462
- "columns-count": O(s).columns.length - d.value,
2463
- color: g.gantt?.color,
2464
- start: g.gantt?.startIndex,
2465
- end: g.gantt?.endIndex,
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,
2466
2490
  colspan: x.colspan,
2467
2491
  pinned: x.pinned,
2468
- "row-index": g.originalIndex,
2469
- "col-index": x.originalIndex ?? R,
2492
+ "row-index": k.originalIndex,
2493
+ "col-index": x.originalIndex ?? I,
2470
2494
  style: pe({
2471
2495
  textAlign: x?.align || "center",
2472
2496
  minWidth: x?.width || "40ch",
2473
- width: O(s).config.fullWidth ? "auto" : null
2497
+ width: P(s).config.fullWidth ? "auto" : null
2474
2498
  }),
2475
- "onConnection:create": P
2476
- }, null, 40, ["store", "columns-count", "color", "start", "end", "colspan", "pinned", "row-index", "col-index", "style"])) : (p(), he(Ne(x.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"), {
2477
2501
  key: 1,
2478
- store: O(s),
2502
+ store: P(s),
2479
2503
  pinned: x.pinned,
2480
- "row-index": g.originalIndex,
2481
- "col-index": R,
2504
+ "row-index": k.originalIndex,
2505
+ "col-index": I,
2482
2506
  style: pe({
2483
2507
  textAlign: x?.align || "center",
2484
- width: O(s).config.fullWidth ? "auto" : null
2508
+ width: P(s).config.fullWidth ? "auto" : null
2485
2509
  }),
2486
2510
  spellcheck: "false"
2487
2511
  }, null, 8, ["store", "pinned", "row-index", "col-index", "style"]))
@@ -2491,74 +2515,74 @@ const Wo = {
2491
2515
  }, 1032, ["row", "row-index", "store"]))), 128))
2492
2516
  ], !0)
2493
2517
  ]),
2494
- fe(h.$slots, "footer", { data: O(s) }, void 0, !0),
2495
- fe(h.$slots, "modal", { data: O(s) }, () => [
2496
- de(pt(Vt, { store: O(s) }, {
2497
- default: xt(() => [
2498
- (p(), he(Ne(O(s).modal.component), st({
2499
- key: `${O(s).modal.rowIndex}:${O(s).modal.colIndex}`,
2500
- "col-index": O(s).modal.colIndex,
2501
- "row-index": O(s).modal.rowIndex,
2502
- store: O(s)
2503
- }, O(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"]))
2504
2528
  ]),
2505
2529
  _: 1
2506
2530
  }, 8, ["store"]), [
2507
- [it, O(s).modal.visible]
2531
+ [it, P(s).modal.visible]
2508
2532
  ])
2509
2533
  ], !0)
2510
2534
  ], 4)), [
2511
- [O(ho), O(s).closeModal]
2535
+ [P(yo), P(s).closeModal]
2512
2536
  ]),
2513
- O(s).isGanttView && O(s).isDependencyGraphEnabled ? (p(), he(Mo, {
2537
+ P(s).isGanttView && P(s).isDependencyGraphEnabled ? (b(), ve($o, {
2514
2538
  key: 0,
2515
- store: O(s),
2516
- "onConnection:delete": F
2517
- }, null, 8, ["store"])) : ee("", !0)
2539
+ store: P(s),
2540
+ "onConnection:delete": Z
2541
+ }, null, 8, ["store"])) : _("", !0)
2518
2542
  ]));
2519
2543
  }
2520
- }), Xo = /* @__PURE__ */ $e(zo, [["__scopeId", "data-v-402a86ad"]]), Go = {}, jo = { class: "aloading" }, Yo = { class: "aloading-header" };
2521
- function Uo(e, t) {
2522
- return p(), b("div", jo, [
2523
- N("h2", Yo, [
2524
- 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)
2525
2549
  ]),
2526
- t[0] || (t[0] = N("div", { class: "aloading-bar" }, null, -1))
2550
+ t[0] || (t[0] = z("div", { class: "aloading-bar" }, null, -1))
2527
2551
  ]);
2528
2552
  }
2529
- const Jo = /* @__PURE__ */ $e(Go, [["render", Uo], ["__scopeId", "data-v-a930a25b"]]), qo = {}, Qo = { class: "aloading" }, Ko = { class: "aloading-header" };
2530
- function _o(e, t) {
2531
- return p(), b("div", Qo, [
2532
- N("h2", Ko, [
2533
- 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)
2534
2558
  ]),
2535
- t[0] || (t[0] = N("div", { class: "aloading-bar" }, null, -1))
2559
+ t[0] || (t[0] = z("div", { class: "aloading-bar" }, null, -1))
2536
2560
  ]);
2537
2561
  }
2538
- const el = /* @__PURE__ */ $e(qo, [["render", _o], ["__scopeId", "data-v-e1165876"]]);
2539
- function il(e) {
2540
- e.component("ACell", Bn), e.component("AExpansionRow", Wn), e.component("AGanttCell", Jn), e.component("ARow", Dt), e.component("ARowActions", Ue), e.component("ATable", Xo), e.component("ATableHeader", Ot), e.component("ATableLoading", Jo), e.component("ATableLoadingBar", el), 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);
2541
2565
  }
2542
2566
  export {
2543
- Bn as ACell,
2544
- Wn as AExpansionRow,
2545
- Jn as AGanttCell,
2546
- Dt as ARow,
2547
- Ue as ARowActions,
2548
- Xo as ATable,
2549
- Ot as ATableHeader,
2550
- Jo as ATableLoading,
2551
- el as ATableLoadingBar,
2552
- Vt as ATableModal,
2553
- qn as AddIcon,
2554
- Qn as DeleteIcon,
2555
- Kn as DuplicateIcon,
2556
- _n as InsertAboveIcon,
2557
- eo as InsertBelowIcon,
2558
- to as MoveIcon,
2559
- no as actionIcons,
2560
- No as createTableStore,
2561
- il as install,
2562
- Fo 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
2563
2587
  };
2564
2588
  //# sourceMappingURL=atable.js.map