@stonecrop/atable 0.5.0 → 0.6.1

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,727 +1,727 @@
1
- import { onMounted as de, ref as W, watch as j, onBeforeUnmount as Ct, computed as D, shallowRef as V, toValue as T, watchEffect as Et, getCurrentScope as ft, onScopeDispose as vt, unref as $, getCurrentInstance as Ne, nextTick as Ge, isRef as It, toRefs as kt, customRef as mt, toRef as $t, readonly as Rt, defineComponent as ne, useTemplateRef as U, createElementBlock as P, openBlock as M, normalizeClass as q, normalizeStyle as ee, createBlock as ie, resolveDynamicComponent as Ee, mergeProps as Xe, toDisplayString as ce, Fragment as se, createElementVNode as N, createCommentVNode as J, renderSlot as Y, useCssVars as St, onUnmounted as Mt, withModifiers as $e, withDirectives as Re, vShow as gt, renderList as me, createTextVNode as At, mergeModels as tt, useModel as nt, createVNode as ot, withCtx as lt } from "vue";
2
- import { defineStore as Tt } from "pinia";
3
- import './assets/index.css';function Ve(e, t) {
4
- return ft() ? (vt(e, t), !0) : !1;
1
+ import { onMounted as pe, ref as B, watch as ne, onBeforeUnmount as Ot, computed as A, shallowRef as Z, toValue as P, watchEffect as Pt, getCurrentScope as It, onScopeDispose as kt, unref as R, getCurrentInstance as et, nextTick as tt, isRef as Ht, toRefs as Lt, customRef as Et, toRef as Vt, readonly as Nt, defineComponent as ue, useTemplateRef as le, createElementBlock as k, openBlock as C, normalizeClass as ee, normalizeStyle as re, createBlock as ve, resolveDynamicComponent as Ee, mergeProps as nt, toDisplayString as ge, Fragment as ie, createElementVNode as z, createCommentVNode as q, renderSlot as te, useCssVars as Bt, onUnmounted as zt, withModifiers as Be, withDirectives as oe, vShow as $t, renderList as ye, reactive as Ft, vModelText as ke, vModelCheckbox as Wt, vModelSelect as Xt, createTextVNode as Gt, mergeModels as ft, useModel as vt, createVNode as mt, withCtx as gt } from "vue";
2
+ import { defineStore as Yt } from "pinia";
3
+ import './assets/index.css';function ot(e, t) {
4
+ return It() ? (kt(e, t), !0) : !1;
5
5
  }
6
- const Dt = typeof window < "u" && typeof document < "u";
6
+ const Ut = typeof window < "u" && typeof document < "u";
7
7
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
8
- const Ot = (e) => e != null, Ht = Object.prototype.toString, Pt = (e) => Ht.call(e) === "[object Object]", Lt = () => {
8
+ const jt = (e) => e != null, qt = Object.prototype.toString, Jt = (e) => qt.call(e) === "[object Object]", Zt = () => {
9
9
  };
10
- function Ie(e) {
10
+ function Ve(e) {
11
11
  return Array.isArray(e) ? e : [e];
12
12
  }
13
- function Bt(e, t, s) {
14
- return j(e, t, {
15
- ...s,
13
+ function Qt(e, t, a) {
14
+ return ne(e, t, {
15
+ ...a,
16
16
  immediate: !0
17
17
  });
18
18
  }
19
- const fe = Dt ? window : void 0;
20
- function ue(e) {
19
+ const Ce = Ut ? window : void 0;
20
+ function be(e) {
21
21
  var t;
22
- const s = T(e);
23
- return (t = s?.$el) !== null && t !== void 0 ? t : s;
22
+ const a = P(e);
23
+ return (t = a?.$el) !== null && t !== void 0 ? t : a;
24
24
  }
25
- function ge(...e) {
26
- const t = [], s = () => {
25
+ function $e(...e) {
26
+ const t = [], a = () => {
27
27
  t.forEach((n) => n()), t.length = 0;
28
- }, c = (n, a, d, v) => (n.addEventListener(a, d, v), () => n.removeEventListener(a, d, v)), u = D(() => {
29
- const n = Ie(T(e[0])).filter((a) => a != null);
30
- return n.every((a) => typeof a != "string") ? n : void 0;
31
- }), r = Bt(() => {
32
- var n, a;
28
+ }, d = (n, l, s, u) => (n.addEventListener(l, s, u), () => n.removeEventListener(l, s, u)), c = A(() => {
29
+ const n = Ve(P(e[0])).filter((l) => l != null);
30
+ return n.every((l) => typeof l != "string") ? n : void 0;
31
+ }), i = Qt(() => {
32
+ var n, l;
33
33
  return [
34
- (n = (a = u.value) === null || a === void 0 ? void 0 : a.map((d) => ue(d))) !== null && n !== void 0 ? n : [fe].filter((d) => d != null),
35
- Ie(T(u.value ? e[1] : e[0])),
36
- Ie($(u.value ? e[2] : e[1])),
37
- T(u.value ? e[3] : e[2])
34
+ (n = (l = c.value) === null || l === void 0 ? void 0 : l.map((s) => be(s))) !== null && n !== void 0 ? n : [Ce].filter((s) => s != null),
35
+ Ve(P(c.value ? e[1] : e[0])),
36
+ Ve(R(c.value ? e[2] : e[1])),
37
+ P(c.value ? e[3] : e[2])
38
38
  ];
39
- }, ([n, a, d, v]) => {
40
- if (s(), !n?.length || !a?.length || !d?.length) return;
41
- const p = Pt(v) ? { ...v } : v;
42
- t.push(...n.flatMap((E) => a.flatMap((h) => d.map((b) => c(E, h, b, p)))));
43
- }, { flush: "post" }), l = () => {
44
- r(), s();
39
+ }, ([n, l, s, u]) => {
40
+ if (a(), !n?.length || !l?.length || !s?.length) return;
41
+ const h = Jt(u) ? { ...u } : u;
42
+ t.push(...n.flatMap(($) => l.flatMap((g) => s.map((I) => d($, g, I, h)))));
43
+ }, { flush: "post" }), o = () => {
44
+ i(), a();
45
45
  };
46
- return Ve(s), l;
46
+ return ot(a), o;
47
47
  }
48
48
  // @__NO_SIDE_EFFECTS__
49
- function zt() {
50
- const e = V(!1), t = Ne();
51
- return t && de(() => {
49
+ function Kt() {
50
+ const e = Z(!1), t = et();
51
+ return t && pe(() => {
52
52
  e.value = !0;
53
53
  }, t), e;
54
54
  }
55
55
  // @__NO_SIDE_EFFECTS__
56
- function Wt(e) {
57
- const t = /* @__PURE__ */ zt();
58
- return D(() => (t.value, !!e()));
56
+ function _t(e) {
57
+ const t = /* @__PURE__ */ Kt();
58
+ return A(() => (t.value, !!e()));
59
59
  }
60
- function Nt(e, t, s = {}) {
61
- const { window: c = fe, ...u } = s;
62
- let r;
63
- const l = /* @__PURE__ */ Wt(() => c && "MutationObserver" in c), n = () => {
64
- r && (r.disconnect(), r = void 0);
65
- }, a = j(D(() => {
66
- const p = Ie(T(e)).map(ue).filter(Ot);
67
- return new Set(p);
68
- }), (p) => {
69
- n(), l.value && p.size && (r = new MutationObserver(t), p.forEach((E) => r.observe(E, u)));
60
+ function en(e, t, a = {}) {
61
+ const { window: d = Ce, ...c } = a;
62
+ let i;
63
+ const o = /* @__PURE__ */ _t(() => d && "MutationObserver" in d), n = () => {
64
+ i && (i.disconnect(), i = void 0);
65
+ }, l = ne(A(() => {
66
+ const h = Ve(P(e)).map(be).filter(jt);
67
+ return new Set(h);
68
+ }), (h) => {
69
+ n(), o.value && h.size && (i = new MutationObserver(t), h.forEach(($) => i.observe($, c)));
70
70
  }, {
71
71
  immediate: !0,
72
72
  flush: "post"
73
- }), d = () => r?.takeRecords(), v = () => {
74
- a(), n();
73
+ }), s = () => i?.takeRecords(), u = () => {
74
+ l(), n();
75
75
  };
76
- return Ve(v), {
77
- isSupported: l,
78
- stop: v,
79
- takeRecords: d
76
+ return ot(u), {
77
+ isSupported: o,
78
+ stop: u,
79
+ takeRecords: s
80
80
  };
81
81
  }
82
- function Gt(e, t, s = {}) {
83
- const { window: c = fe, document: u = c?.document, flush: r = "sync" } = s;
84
- if (!c || !u) return Lt;
85
- let l;
86
- const n = (v) => {
87
- l?.(), l = v;
88
- }, a = Et(() => {
89
- const v = ue(e);
90
- if (v) {
91
- const { stop: p } = Nt(u, (E) => {
92
- E.map((h) => [...h.removedNodes]).flat().some((h) => h === v || h.contains(v)) && t(E);
82
+ function tn(e, t, a = {}) {
83
+ const { window: d = Ce, document: c = d?.document, flush: i = "sync" } = a;
84
+ if (!d || !c) return Zt;
85
+ let o;
86
+ const n = (u) => {
87
+ o?.(), o = u;
88
+ }, l = Pt(() => {
89
+ const u = be(e);
90
+ if (u) {
91
+ const { stop: h } = en(c, ($) => {
92
+ $.map((g) => [...g.removedNodes]).flat().some((g) => g === u || g.contains(u)) && t($);
93
93
  }, {
94
- window: c,
94
+ window: d,
95
95
  childList: !0,
96
96
  subtree: !0
97
97
  });
98
- n(p);
98
+ n(h);
99
99
  }
100
- }, { flush: r }), d = () => {
101
- a(), n();
100
+ }, { flush: i }), s = () => {
101
+ l(), n();
102
102
  };
103
- return Ve(d), d;
103
+ return ot(s), s;
104
104
  }
105
105
  // @__NO_SIDE_EFFECTS__
106
- function Xt(e = {}) {
106
+ function nn(e = {}) {
107
107
  var t;
108
- const { window: s = fe, deep: c = !0, triggerOnRemoval: u = !1 } = e, r = (t = e.document) !== null && t !== void 0 ? t : s?.document, l = () => {
109
- let d = r?.activeElement;
110
- if (c)
111
- for (var v; d?.shadowRoot; ) d = d == null || (v = d.shadowRoot) === null || v === void 0 ? void 0 : v.activeElement;
112
- return d;
113
- }, n = V(), a = () => {
114
- n.value = l();
108
+ const { window: a = Ce, deep: d = !0, triggerOnRemoval: c = !1 } = e, i = (t = e.document) !== null && t !== void 0 ? t : a?.document, o = () => {
109
+ let s = i?.activeElement;
110
+ if (d)
111
+ for (var u; s?.shadowRoot; ) s = s == null || (u = s.shadowRoot) === null || u === void 0 ? void 0 : u.activeElement;
112
+ return s;
113
+ }, n = Z(), l = () => {
114
+ n.value = o();
115
115
  };
116
- if (s) {
117
- const d = {
116
+ if (a) {
117
+ const s = {
118
118
  capture: !0,
119
119
  passive: !0
120
120
  };
121
- ge(s, "blur", (v) => {
122
- v.relatedTarget === null && a();
123
- }, d), ge(s, "focus", a, d);
121
+ $e(a, "blur", (u) => {
122
+ u.relatedTarget === null && l();
123
+ }, s), $e(a, "focus", l, s);
124
124
  }
125
- return u && Gt(n, a, { document: r }), a(), n;
125
+ return c && tn(n, l, { document: i }), l(), n;
126
126
  }
127
- const Vt = "focusin", Ft = "focusout", Yt = ":focus-within";
128
- function jt(e, t = {}) {
129
- const { window: s = fe } = t, c = D(() => ue(e)), u = V(!1), r = D(() => u.value);
130
- if (!s || !(/* @__PURE__ */ Xt(t)).value) return { focused: r };
131
- const l = { passive: !0 };
132
- return ge(c, Vt, () => u.value = !0, l), ge(c, Ft, () => {
133
- var n, a, d;
134
- return u.value = (n = (a = c.value) === null || a === void 0 || (d = a.matches) === null || d === void 0 ? void 0 : d.call(a, Yt)) !== null && n !== void 0 ? n : !1;
135
- }, l), { focused: r };
127
+ const on = "focusin", ln = "focusout", an = ":focus-within";
128
+ function sn(e, t = {}) {
129
+ const { window: a = Ce } = t, d = A(() => be(e)), c = Z(!1), i = A(() => c.value);
130
+ if (!a || !(/* @__PURE__ */ nn(t)).value) return { focused: i };
131
+ const o = { passive: !0 };
132
+ return $e(d, on, () => c.value = !0, o), $e(d, ln, () => {
133
+ var n, l, s;
134
+ return c.value = (n = (l = d.value) === null || l === void 0 || (s = l.matches) === null || s === void 0 ? void 0 : s.call(l, an)) !== null && n !== void 0 ? n : !1;
135
+ }, o), { focused: i };
136
136
  }
137
- function Ut(e, { window: t = fe, scrollTarget: s } = {}) {
138
- const c = W(!1), u = () => {
137
+ function rn(e, { window: t = Ce, scrollTarget: a } = {}) {
138
+ const d = B(!1), c = () => {
139
139
  if (!t) return;
140
- const r = t.document, l = ue(e);
141
- if (!l)
142
- c.value = !1;
140
+ const i = t.document, o = be(e);
141
+ if (!o)
142
+ d.value = !1;
143
143
  else {
144
- const n = l.getBoundingClientRect();
145
- c.value = n.top <= (t.innerHeight || r.documentElement.clientHeight) && n.left <= (t.innerWidth || r.documentElement.clientWidth) && n.bottom >= 0 && n.right >= 0;
144
+ const n = o.getBoundingClientRect();
145
+ d.value = n.top <= (t.innerHeight || i.documentElement.clientHeight) && n.left <= (t.innerWidth || i.documentElement.clientWidth) && n.bottom >= 0 && n.right >= 0;
146
146
  }
147
147
  };
148
- return j(
149
- () => ue(e),
150
- () => u(),
148
+ return ne(
149
+ () => be(e),
150
+ () => c(),
151
151
  { immediate: !0, flush: "post" }
152
- ), t && ge(s || t, "scroll", u, {
152
+ ), t && $e(a || t, "scroll", c, {
153
153
  capture: !1,
154
154
  passive: !0
155
- }), c;
155
+ }), d;
156
156
  }
157
- const Q = (e) => {
158
- let t = Ut(e).value;
157
+ const ce = (e) => {
158
+ let t = rn(e).value;
159
159
  return t = t && e.offsetHeight > 0, t;
160
- }, K = (e) => e.tabIndex >= 0, at = (e) => {
160
+ }, de = (e) => e.tabIndex >= 0, ht = (e) => {
161
161
  const t = e.target;
162
- return Fe(t);
163
- }, Fe = (e) => {
162
+ return lt(t);
163
+ }, lt = (e) => {
164
164
  let t;
165
165
  if (e instanceof HTMLTableCellElement) {
166
- const s = e.parentElement?.previousElementSibling;
167
- if (s) {
168
- const c = Array.from(s.children)[e.cellIndex];
169
- c && (t = c);
166
+ const a = e.parentElement?.previousElementSibling;
167
+ if (a) {
168
+ const d = Array.from(a.children)[e.cellIndex];
169
+ d && (t = d);
170
170
  }
171
171
  } else if (e instanceof HTMLTableRowElement) {
172
- const s = e.previousElementSibling;
173
- s && (t = s);
172
+ const a = e.previousElementSibling;
173
+ a && (t = a);
174
174
  }
175
- return t && (!K(t) || !Q(t)) ? Fe(t) : t;
176
- }, qt = (e) => {
175
+ return t && (!de(t) || !ce(t)) ? lt(t) : t;
176
+ }, un = (e) => {
177
177
  const t = e.target;
178
- let s;
178
+ let a;
179
179
  if (t instanceof HTMLTableCellElement) {
180
- const c = t.parentElement?.parentElement;
181
- if (c) {
182
- const u = c.firstElementChild?.children[t.cellIndex];
183
- u && (s = u);
180
+ const d = t.parentElement?.parentElement;
181
+ if (d) {
182
+ const c = d.firstElementChild?.children[t.cellIndex];
183
+ c && (a = c);
184
184
  }
185
185
  } else if (t instanceof HTMLTableRowElement) {
186
- const c = t.parentElement;
187
- if (c) {
188
- const u = c.firstElementChild;
189
- u && (s = u);
186
+ const d = t.parentElement;
187
+ if (d) {
188
+ const c = d.firstElementChild;
189
+ c && (a = c);
190
190
  }
191
191
  }
192
- return s && (!K(s) || !Q(s)) ? Ye(s) : s;
193
- }, st = (e) => {
192
+ return a && (!de(a) || !ce(a)) ? at(a) : a;
193
+ }, xt = (e) => {
194
194
  const t = e.target;
195
- return Ye(t);
196
- }, Ye = (e) => {
195
+ return at(t);
196
+ }, at = (e) => {
197
197
  let t;
198
198
  if (e instanceof HTMLTableCellElement) {
199
- const s = e.parentElement?.nextElementSibling;
200
- if (s) {
201
- const c = Array.from(s.children)[e.cellIndex];
202
- c && (t = c);
199
+ const a = e.parentElement?.nextElementSibling;
200
+ if (a) {
201
+ const d = Array.from(a.children)[e.cellIndex];
202
+ d && (t = d);
203
203
  }
204
204
  } else if (e instanceof HTMLTableRowElement) {
205
- const s = e.nextElementSibling;
206
- s && (t = s);
205
+ const a = e.nextElementSibling;
206
+ a && (t = a);
207
207
  }
208
- return t && (!K(t) || !Q(t)) ? Ye(t) : t;
209
- }, Jt = (e) => {
208
+ return t && (!de(t) || !ce(t)) ? at(t) : t;
209
+ }, cn = (e) => {
210
210
  const t = e.target;
211
- let s;
211
+ let a;
212
212
  if (t instanceof HTMLTableCellElement) {
213
- const c = t.parentElement?.parentElement;
214
- if (c) {
215
- const u = c.lastElementChild?.children[t.cellIndex];
216
- u && (s = u);
213
+ const d = t.parentElement?.parentElement;
214
+ if (d) {
215
+ const c = d.lastElementChild?.children[t.cellIndex];
216
+ c && (a = c);
217
217
  }
218
218
  } else if (t instanceof HTMLTableRowElement) {
219
- const c = t.parentElement;
220
- if (c) {
221
- const u = c.lastElementChild;
222
- u && (s = u);
219
+ const d = t.parentElement;
220
+ if (d) {
221
+ const c = d.lastElementChild;
222
+ c && (a = c);
223
223
  }
224
224
  }
225
- return s && (!K(s) || !Q(s)) ? Fe(s) : s;
226
- }, rt = (e) => {
225
+ return a && (!de(a) || !ce(a)) ? lt(a) : a;
226
+ }, wt = (e) => {
227
227
  const t = e.target;
228
- return je(t);
229
- }, je = (e) => {
228
+ return st(t);
229
+ }, st = (e) => {
230
230
  let t;
231
- return e.previousElementSibling ? t = e.previousElementSibling : t = e.parentElement?.previousElementSibling?.lastElementChild, t && (!K(t) || !Q(t)) ? je(t) : t;
232
- }, it = (e) => {
231
+ return e.previousElementSibling ? t = e.previousElementSibling : t = e.parentElement?.previousElementSibling?.lastElementChild, t && (!de(t) || !ce(t)) ? st(t) : t;
232
+ }, yt = (e) => {
233
233
  const t = e.target;
234
- return Ue(t);
235
- }, Ue = (e) => {
234
+ return rt(t);
235
+ }, rt = (e) => {
236
236
  let t;
237
- return e.nextElementSibling ? t = e.nextElementSibling : t = e.parentElement?.nextElementSibling?.firstElementChild, t && (!K(t) || !Q(t)) ? Ue(t) : t;
238
- }, ct = (e) => {
237
+ return e.nextElementSibling ? t = e.nextElementSibling : t = e.parentElement?.nextElementSibling?.firstElementChild, t && (!de(t) || !ce(t)) ? rt(t) : t;
238
+ }, bt = (e) => {
239
239
  const t = e.target.parentElement?.firstElementChild;
240
- return t && (!K(t) || !Q(t)) ? Ue(t) : t;
241
- }, ut = (e) => {
240
+ return t && (!de(t) || !ce(t)) ? rt(t) : t;
241
+ }, pt = (e) => {
242
242
  const t = e.target.parentElement?.lastElementChild;
243
- return t && (!K(t) || !Q(t)) ? je(t) : t;
244
- }, be = ["alt", "control", "shift", "meta"], Zt = {
243
+ return t && (!de(t) || !ce(t)) ? st(t) : t;
244
+ }, He = ["alt", "control", "shift", "meta"], dn = {
245
245
  ArrowUp: "up",
246
246
  ArrowDown: "down",
247
247
  ArrowLeft: "left",
248
248
  ArrowRight: "right"
249
- }, Se = {
249
+ }, ze = {
250
250
  "keydown.up": (e) => {
251
- const t = at(e);
251
+ const t = ht(e);
252
252
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
253
253
  },
254
254
  "keydown.down": (e) => {
255
- const t = st(e);
255
+ const t = xt(e);
256
256
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
257
257
  },
258
258
  "keydown.left": (e) => {
259
- const t = rt(e);
259
+ const t = wt(e);
260
260
  e.preventDefault(), e.stopPropagation(), t && t.focus();
261
261
  },
262
262
  "keydown.right": (e) => {
263
- const t = it(e);
263
+ const t = yt(e);
264
264
  e.preventDefault(), e.stopPropagation(), t && t.focus();
265
265
  },
266
266
  "keydown.control.up": (e) => {
267
- const t = qt(e);
267
+ const t = un(e);
268
268
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
269
269
  },
270
270
  "keydown.control.down": (e) => {
271
- const t = Jt(e);
271
+ const t = cn(e);
272
272
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
273
273
  },
274
274
  "keydown.control.left": (e) => {
275
- const t = ct(e);
275
+ const t = bt(e);
276
276
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
277
277
  },
278
278
  "keydown.control.right": (e) => {
279
- const t = ut(e);
279
+ const t = pt(e);
280
280
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
281
281
  },
282
282
  "keydown.end": (e) => {
283
- const t = ut(e);
283
+ const t = pt(e);
284
284
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
285
285
  },
286
286
  "keydown.enter": (e) => {
287
287
  if (e.target instanceof HTMLTableCellElement) {
288
288
  e.preventDefault(), e.stopPropagation();
289
- const t = st(e);
289
+ const t = xt(e);
290
290
  t && t.focus();
291
291
  }
292
292
  },
293
293
  "keydown.shift.enter": (e) => {
294
294
  if (e.target instanceof HTMLTableCellElement) {
295
295
  e.preventDefault(), e.stopPropagation();
296
- const t = at(e);
296
+ const t = ht(e);
297
297
  t && t.focus();
298
298
  }
299
299
  },
300
300
  "keydown.home": (e) => {
301
- const t = ct(e);
301
+ const t = bt(e);
302
302
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
303
303
  },
304
304
  "keydown.tab": (e) => {
305
- const t = it(e);
305
+ const t = yt(e);
306
306
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
307
307
  },
308
308
  "keydown.shift.tab": (e) => {
309
- const t = rt(e);
309
+ const t = wt(e);
310
310
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
311
311
  }
312
312
  };
313
- function qe(e) {
314
- const t = (l) => {
313
+ function it(e) {
314
+ const t = (o) => {
315
315
  let n = null;
316
- return l.parent && (typeof l.parent == "string" ? n = document.querySelector(l.parent) : l.parent instanceof HTMLElement ? n = l.parent : n = l.parent.value), n;
317
- }, s = (l) => {
318
- const n = t(l);
319
- let a = [];
320
- if (typeof l.selectors == "string")
321
- a = n ? Array.from(n.querySelectorAll(l.selectors)) : Array.from(document.querySelectorAll(l.selectors));
322
- else if (Array.isArray(l.selectors))
323
- for (const d of l.selectors)
324
- d instanceof HTMLElement ? a.push(d) : a.push(d.$el);
325
- else if (l.selectors instanceof HTMLElement)
326
- a.push(l.selectors);
327
- else if (l.selectors?.value)
328
- if (Array.isArray(l.selectors.value))
329
- for (const d of l.selectors.value)
330
- d instanceof HTMLElement ? a.push(d) : a.push(d.$el);
316
+ return o.parent && (typeof o.parent == "string" ? n = document.querySelector(o.parent) : o.parent instanceof HTMLElement ? n = o.parent : n = o.parent.value), n;
317
+ }, a = (o) => {
318
+ const n = t(o);
319
+ let l = [];
320
+ if (typeof o.selectors == "string")
321
+ l = n ? Array.from(n.querySelectorAll(o.selectors)) : Array.from(document.querySelectorAll(o.selectors));
322
+ else if (Array.isArray(o.selectors))
323
+ for (const s of o.selectors)
324
+ s instanceof HTMLElement ? l.push(s) : l.push(s.$el);
325
+ else if (o.selectors instanceof HTMLElement)
326
+ l.push(o.selectors);
327
+ else if (o.selectors?.value)
328
+ if (Array.isArray(o.selectors.value))
329
+ for (const s of o.selectors.value)
330
+ s instanceof HTMLElement ? l.push(s) : l.push(s.$el);
331
331
  else
332
- a.push(l.selectors.value);
333
- return a;
334
- }, c = (l) => {
335
- const n = t(l);
336
- let a = [];
337
- return l.selectors ? a = s(l) : n && (a = Array.from(n.children).filter((d) => K(d) && Q(d))), a;
338
- }, u = (l) => (n) => {
339
- const a = Zt[n.key] || n.key.toLowerCase();
340
- if (be.includes(a)) return;
341
- const d = l.handlers || Se;
342
- for (const v of Object.keys(d)) {
343
- const [p, ...E] = v.split(".");
344
- if (p === "keydown" && E.includes(a)) {
345
- const h = d[v], b = E.filter((f) => be.includes(f)), w = be.some((f) => {
346
- const m = f.charAt(0).toUpperCase() + f.slice(1);
332
+ l.push(o.selectors.value);
333
+ return l;
334
+ }, d = (o) => {
335
+ const n = t(o);
336
+ let l = [];
337
+ return o.selectors ? l = a(o) : n && (l = Array.from(n.children).filter((s) => de(s) && ce(s))), l;
338
+ }, c = (o) => (n) => {
339
+ const l = dn[n.key] || n.key.toLowerCase();
340
+ if (He.includes(l)) return;
341
+ const s = o.handlers || ze;
342
+ for (const u of Object.keys(s)) {
343
+ const [h, ...$] = u.split(".");
344
+ if (h === "keydown" && $.includes(l)) {
345
+ const g = s[u], I = $.filter((v) => He.includes(v)), x = He.some((v) => {
346
+ const m = v.charAt(0).toUpperCase() + v.slice(1);
347
347
  return n.getModifierState(m);
348
348
  });
349
- if (b.length > 0) {
350
- if (w) {
351
- for (const f of be)
352
- if (E.includes(f)) {
353
- const m = f.charAt(0).toUpperCase() + f.slice(1);
354
- n.getModifierState(m) && h(n);
349
+ if (I.length > 0) {
350
+ if (x) {
351
+ for (const v of He)
352
+ if ($.includes(v)) {
353
+ const m = v.charAt(0).toUpperCase() + v.slice(1);
354
+ n.getModifierState(m) && g(n);
355
355
  }
356
356
  }
357
357
  } else
358
- w || h(n);
358
+ x || g(n);
359
359
  }
360
360
  }
361
- }, r = [];
362
- de(() => {
363
- for (const l of e) {
364
- const n = t(l), a = c(l), d = u(l), v = n ? [n] : a;
365
- for (const p of v) {
366
- const { focused: E } = jt(W(p)), h = j(E, (b) => {
367
- b ? p.addEventListener("keydown", d) : p.removeEventListener("keydown", d);
361
+ }, i = [];
362
+ pe(() => {
363
+ for (const o of e) {
364
+ const n = t(o), l = d(o), s = c(o), u = n ? [n] : l;
365
+ for (const h of u) {
366
+ const { focused: $ } = sn(B(h)), g = ne($, (I) => {
367
+ I ? h.addEventListener("keydown", s) : h.removeEventListener("keydown", s);
368
368
  });
369
- r.push(h);
369
+ i.push(g);
370
370
  }
371
371
  }
372
- }), Ct(() => {
373
- for (const l of r)
374
- l();
372
+ }), Ot(() => {
373
+ for (const o of i)
374
+ o();
375
375
  });
376
376
  }
377
- function Me(e, t) {
378
- return ft() ? (vt(e, t), !0) : !1;
377
+ function Fe(e, t) {
378
+ return It() ? (kt(e, t), !0) : !1;
379
379
  }
380
- const ht = typeof window < "u" && typeof document < "u";
380
+ const St = typeof window < "u" && typeof document < "u";
381
381
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
382
- const Qt = (e) => e != null, Kt = Object.prototype.toString, _t = (e) => Kt.call(e) === "[object Object]", ae = () => {
382
+ const fn = (e) => e != null, vn = Object.prototype.toString, mn = (e) => vn.call(e) === "[object Object]", we = () => {
383
383
  };
384
- function en(...e) {
385
- if (e.length !== 1) return $t(...e);
384
+ function gn(...e) {
385
+ if (e.length !== 1) return Vt(...e);
386
386
  const t = e[0];
387
- return typeof t == "function" ? Rt(mt(() => ({
387
+ return typeof t == "function" ? Nt(Et(() => ({
388
388
  get: t,
389
- set: ae
390
- }))) : W(t);
389
+ set: we
390
+ }))) : B(t);
391
391
  }
392
- function tn(e, t) {
393
- function s(...c) {
394
- return new Promise((u, r) => {
395
- Promise.resolve(e(() => t.apply(this, c), {
392
+ function hn(e, t) {
393
+ function a(...d) {
394
+ return new Promise((c, i) => {
395
+ Promise.resolve(e(() => t.apply(this, d), {
396
396
  fn: t,
397
397
  thisArg: this,
398
- args: c
399
- })).then(u).catch(r);
398
+ args: d
399
+ })).then(c).catch(i);
400
400
  });
401
401
  }
402
- return s;
402
+ return a;
403
403
  }
404
- function nn(e, t = {}) {
405
- let s, c, u = ae;
406
- const r = (a) => {
407
- clearTimeout(a), u(), u = ae;
404
+ function xn(e, t = {}) {
405
+ let a, d, c = we;
406
+ const i = (l) => {
407
+ clearTimeout(l), c(), c = we;
408
408
  };
409
- let l;
410
- return (a) => {
411
- const d = T(e), v = T(t.maxWait);
412
- return s && r(s), d <= 0 || v !== void 0 && v <= 0 ? (c && (r(c), c = void 0), Promise.resolve(a())) : new Promise((p, E) => {
413
- u = t.rejectOnCancel ? E : p, l = a, v && !c && (c = setTimeout(() => {
414
- s && r(s), c = void 0, p(l());
415
- }, v)), s = setTimeout(() => {
416
- c && r(c), c = void 0, p(a());
417
- }, d);
409
+ let o;
410
+ return (l) => {
411
+ const s = P(e), u = P(t.maxWait);
412
+ return a && i(a), s <= 0 || u !== void 0 && u <= 0 ? (d && (i(d), d = void 0), Promise.resolve(l())) : new Promise((h, $) => {
413
+ c = t.rejectOnCancel ? $ : h, o = l, u && !d && (d = setTimeout(() => {
414
+ a && i(a), d = void 0, h(o());
415
+ }, u)), a = setTimeout(() => {
416
+ d && i(d), d = void 0, h(l());
417
+ }, s);
418
418
  });
419
419
  };
420
420
  }
421
- function ke(e) {
421
+ function Ne(e) {
422
422
  return Array.isArray(e) ? e : [e];
423
423
  }
424
- function on(e) {
425
- return Ne();
424
+ function wn(e) {
425
+ return et();
426
426
  }
427
427
  // @__NO_SIDE_EFFECTS__
428
- function ln(e, t = 200, s = {}) {
429
- return tn(nn(t, s), e);
428
+ function yn(e, t = 200, a = {}) {
429
+ return hn(xn(t, a), e);
430
430
  }
431
- function an(e, t = {}) {
432
- if (!It(e)) return kt(e);
433
- const s = Array.isArray(e.value) ? Array.from({ length: e.value.length }) : {};
434
- for (const c in e.value) s[c] = mt(() => ({
431
+ function bn(e, t = {}) {
432
+ if (!Ht(e)) return Lt(e);
433
+ const a = Array.isArray(e.value) ? Array.from({ length: e.value.length }) : {};
434
+ for (const d in e.value) a[d] = Et(() => ({
435
435
  get() {
436
- return e.value[c];
436
+ return e.value[d];
437
437
  },
438
- set(u) {
439
- var r;
440
- if (!((r = T(t.replaceRef)) !== null && r !== void 0) || r) if (Array.isArray(e.value)) {
441
- const l = [...e.value];
442
- l[c] = u, e.value = l;
438
+ set(c) {
439
+ var i;
440
+ if (!((i = P(t.replaceRef)) !== null && i !== void 0) || i) if (Array.isArray(e.value)) {
441
+ const o = [...e.value];
442
+ o[d] = c, e.value = o;
443
443
  } else {
444
- const l = {
444
+ const o = {
445
445
  ...e.value,
446
- [c]: u
446
+ [d]: c
447
447
  };
448
- Object.setPrototypeOf(l, Object.getPrototypeOf(e.value)), e.value = l;
448
+ Object.setPrototypeOf(o, Object.getPrototypeOf(e.value)), e.value = o;
449
449
  }
450
- else e.value[c] = u;
450
+ else e.value[d] = c;
451
451
  }
452
452
  }));
453
- return s;
453
+ return a;
454
454
  }
455
- function sn(e, t = !0, s) {
456
- on() ? de(e, s) : t ? e() : Ge(e);
455
+ function pn(e, t = !0, a) {
456
+ wn() ? pe(e, a) : t ? e() : tt(e);
457
457
  }
458
- function rn(e, t, s) {
459
- return j(e, t, {
460
- ...s,
458
+ function Cn(e, t, a) {
459
+ return ne(e, t, {
460
+ ...a,
461
461
  immediate: !0
462
462
  });
463
463
  }
464
- const he = ht ? window : void 0;
465
- function Z(e) {
464
+ const Se = St ? window : void 0;
465
+ function se(e) {
466
466
  var t;
467
- const s = T(e);
468
- return (t = s?.$el) !== null && t !== void 0 ? t : s;
467
+ const a = P(e);
468
+ return (t = a?.$el) !== null && t !== void 0 ? t : a;
469
469
  }
470
- function te(...e) {
471
- const t = [], s = () => {
470
+ function me(...e) {
471
+ const t = [], a = () => {
472
472
  t.forEach((n) => n()), t.length = 0;
473
- }, c = (n, a, d, v) => (n.addEventListener(a, d, v), () => n.removeEventListener(a, d, v)), u = D(() => {
474
- const n = ke(T(e[0])).filter((a) => a != null);
475
- return n.every((a) => typeof a != "string") ? n : void 0;
476
- }), r = rn(() => {
477
- var n, a;
473
+ }, d = (n, l, s, u) => (n.addEventListener(l, s, u), () => n.removeEventListener(l, s, u)), c = A(() => {
474
+ const n = Ne(P(e[0])).filter((l) => l != null);
475
+ return n.every((l) => typeof l != "string") ? n : void 0;
476
+ }), i = Cn(() => {
477
+ var n, l;
478
478
  return [
479
- (n = (a = u.value) === null || a === void 0 ? void 0 : a.map((d) => Z(d))) !== null && n !== void 0 ? n : [he].filter((d) => d != null),
480
- ke(T(u.value ? e[1] : e[0])),
481
- ke($(u.value ? e[2] : e[1])),
482
- T(u.value ? e[3] : e[2])
479
+ (n = (l = c.value) === null || l === void 0 ? void 0 : l.map((s) => se(s))) !== null && n !== void 0 ? n : [Se].filter((s) => s != null),
480
+ Ne(P(c.value ? e[1] : e[0])),
481
+ Ne(R(c.value ? e[2] : e[1])),
482
+ P(c.value ? e[3] : e[2])
483
483
  ];
484
- }, ([n, a, d, v]) => {
485
- if (s(), !n?.length || !a?.length || !d?.length) return;
486
- const p = _t(v) ? { ...v } : v;
487
- t.push(...n.flatMap((E) => a.flatMap((h) => d.map((b) => c(E, h, b, p)))));
488
- }, { flush: "post" }), l = () => {
489
- r(), s();
484
+ }, ([n, l, s, u]) => {
485
+ if (a(), !n?.length || !l?.length || !s?.length) return;
486
+ const h = mn(u) ? { ...u } : u;
487
+ t.push(...n.flatMap(($) => l.flatMap((g) => s.map((I) => d($, g, I, h)))));
488
+ }, { flush: "post" }), o = () => {
489
+ i(), a();
490
490
  };
491
- return Me(s), l;
491
+ return Fe(a), o;
492
492
  }
493
- function dt(e, t, s = {}) {
494
- const { window: c = he, ignore: u = [], capture: r = !0, detectIframe: l = !1, controls: n = !1 } = s;
495
- if (!c) return n ? {
496
- stop: ae,
497
- cancel: ae,
498
- trigger: ae
499
- } : ae;
500
- let a = !0;
501
- const d = (f) => T(u).some((m) => {
502
- if (typeof m == "string") return Array.from(c.document.querySelectorAll(m)).some((y) => y === f.target || f.composedPath().includes(y));
493
+ function Ct(e, t, a = {}) {
494
+ const { window: d = Se, ignore: c = [], capture: i = !0, detectIframe: o = !1, controls: n = !1 } = a;
495
+ if (!d) return n ? {
496
+ stop: we,
497
+ cancel: we,
498
+ trigger: we
499
+ } : we;
500
+ let l = !0;
501
+ const s = (v) => P(c).some((m) => {
502
+ if (typeof m == "string") return Array.from(d.document.querySelectorAll(m)).some((b) => b === v.target || v.composedPath().includes(b));
503
503
  {
504
- const y = Z(m);
505
- return y && (f.target === y || f.composedPath().includes(y));
504
+ const b = se(m);
505
+ return b && (v.target === b || v.composedPath().includes(b));
506
506
  }
507
507
  });
508
- function v(f) {
509
- const m = T(f);
508
+ function u(v) {
509
+ const m = P(v);
510
510
  return m && m.$.subTree.shapeFlag === 16;
511
511
  }
512
- function p(f, m) {
513
- const y = T(f), L = y.$.subTree && y.$.subTree.children;
514
- return L == null || !Array.isArray(L) ? !1 : L.some((B) => B.el === m.target || m.composedPath().includes(B.el));
512
+ function h(v, m) {
513
+ const b = P(v), V = b.$.subTree && b.$.subTree.children;
514
+ return V == null || !Array.isArray(V) ? !1 : V.some((L) => L.el === m.target || m.composedPath().includes(L.el));
515
515
  }
516
- const E = (f) => {
517
- const m = Z(e);
518
- if (f.target != null && !(!(m instanceof Element) && v(e) && p(e, f)) && !(!m || m === f.target || f.composedPath().includes(m))) {
519
- if ("detail" in f && f.detail === 0 && (a = !d(f)), !a) {
520
- a = !0;
516
+ const $ = (v) => {
517
+ const m = se(e);
518
+ if (v.target != null && !(!(m instanceof Element) && u(e) && h(e, v)) && !(!m || m === v.target || v.composedPath().includes(m))) {
519
+ if ("detail" in v && v.detail === 0 && (l = !s(v)), !l) {
520
+ l = !0;
521
521
  return;
522
522
  }
523
- t(f);
523
+ t(v);
524
524
  }
525
525
  };
526
- let h = !1;
527
- const b = [
528
- te(c, "click", (f) => {
529
- h || (h = !0, setTimeout(() => {
530
- h = !1;
531
- }, 0), E(f));
526
+ let g = !1;
527
+ const I = [
528
+ me(d, "click", (v) => {
529
+ g || (g = !0, setTimeout(() => {
530
+ g = !1;
531
+ }, 0), $(v));
532
532
  }, {
533
533
  passive: !0,
534
- capture: r
534
+ capture: i
535
535
  }),
536
- te(c, "pointerdown", (f) => {
537
- const m = Z(e);
538
- a = !d(f) && !!(m && !f.composedPath().includes(m));
536
+ me(d, "pointerdown", (v) => {
537
+ const m = se(e);
538
+ l = !s(v) && !!(m && !v.composedPath().includes(m));
539
539
  }, { passive: !0 }),
540
- l && te(c, "blur", (f) => {
540
+ o && me(d, "blur", (v) => {
541
541
  setTimeout(() => {
542
542
  var m;
543
- const y = Z(e);
544
- ((m = c.document.activeElement) === null || m === void 0 ? void 0 : m.tagName) === "IFRAME" && !y?.contains(c.document.activeElement) && t(f);
543
+ const b = se(e);
544
+ ((m = d.document.activeElement) === null || m === void 0 ? void 0 : m.tagName) === "IFRAME" && !b?.contains(d.document.activeElement) && t(v);
545
545
  }, 0);
546
546
  }, { passive: !0 })
547
- ].filter(Boolean), w = () => b.forEach((f) => f());
547
+ ].filter(Boolean), x = () => I.forEach((v) => v());
548
548
  return n ? {
549
- stop: w,
549
+ stop: x,
550
550
  cancel: () => {
551
- a = !1;
551
+ l = !1;
552
552
  },
553
- trigger: (f) => {
554
- a = !0, E(f), a = !1;
553
+ trigger: (v) => {
554
+ l = !0, $(v), l = !1;
555
555
  }
556
- } : w;
556
+ } : x;
557
557
  }
558
558
  // @__NO_SIDE_EFFECTS__
559
- function cn() {
560
- const e = V(!1), t = Ne();
561
- return t && de(() => {
559
+ function In() {
560
+ const e = Z(!1), t = et();
561
+ return t && pe(() => {
562
562
  e.value = !0;
563
563
  }, t), e;
564
564
  }
565
565
  // @__NO_SIDE_EFFECTS__
566
- function wt(e) {
567
- const t = /* @__PURE__ */ cn();
568
- return D(() => (t.value, !!e()));
566
+ function Rt(e) {
567
+ const t = /* @__PURE__ */ In();
568
+ return A(() => (t.value, !!e()));
569
569
  }
570
- function xt(e, t, s = {}) {
571
- const { window: c = he, ...u } = s;
572
- let r;
573
- const l = /* @__PURE__ */ wt(() => c && "MutationObserver" in c), n = () => {
574
- r && (r.disconnect(), r = void 0);
575
- }, a = j(D(() => {
576
- const p = ke(T(e)).map(Z).filter(Qt);
577
- return new Set(p);
578
- }), (p) => {
579
- n(), l.value && p.size && (r = new MutationObserver(t), p.forEach((E) => r.observe(E, u)));
570
+ function Dt(e, t, a = {}) {
571
+ const { window: d = Se, ...c } = a;
572
+ let i;
573
+ const o = /* @__PURE__ */ Rt(() => d && "MutationObserver" in d), n = () => {
574
+ i && (i.disconnect(), i = void 0);
575
+ }, l = ne(A(() => {
576
+ const h = Ne(P(e)).map(se).filter(fn);
577
+ return new Set(h);
578
+ }), (h) => {
579
+ n(), o.value && h.size && (i = new MutationObserver(t), h.forEach(($) => i.observe($, c)));
580
580
  }, {
581
581
  immediate: !0,
582
582
  flush: "post"
583
- }), d = () => r?.takeRecords(), v = () => {
584
- a(), n();
583
+ }), s = () => i?.takeRecords(), u = () => {
584
+ l(), n();
585
585
  };
586
- return Me(v), {
587
- isSupported: l,
588
- stop: v,
589
- takeRecords: d
586
+ return Fe(u), {
587
+ isSupported: o,
588
+ stop: u,
589
+ takeRecords: s
590
590
  };
591
591
  }
592
- function Pe(e, t = {}) {
593
- var s;
594
- const { pointerTypes: c, preventDefault: u, stopPropagation: r, exact: l, onMove: n, onEnd: a, onStart: d, initialValue: v, axis: p = "both", draggingElement: E = he, containerElement: h, handle: b = e, buttons: w = [0] } = t, f = W((s = T(v)) !== null && s !== void 0 ? s : {
592
+ function Je(e, t = {}) {
593
+ var a;
594
+ const { pointerTypes: d, preventDefault: c, stopPropagation: i, exact: o, onMove: n, onEnd: l, onStart: s, initialValue: u, axis: h = "both", draggingElement: $ = Se, containerElement: g, handle: I = e, buttons: x = [0] } = t, v = B((a = P(u)) !== null && a !== void 0 ? a : {
595
595
  x: 0,
596
596
  y: 0
597
- }), m = W(), y = (x) => c ? c.includes(x.pointerType) : !0, L = (x) => {
598
- T(u) && x.preventDefault(), T(r) && x.stopPropagation();
599
- }, B = (x) => {
600
- var R;
601
- if (!T(w).includes(x.button) || T(t.disabled) || !y(x) || T(l) && x.target !== T(e)) return;
602
- const G = T(h), z = G == null || (R = G.getBoundingClientRect) === null || R === void 0 ? void 0 : R.call(G), O = T(e).getBoundingClientRect(), F = {
603
- x: x.clientX - (G ? O.left - z.left + G.scrollLeft : O.left),
604
- y: x.clientY - (G ? O.top - z.top + G.scrollTop : O.top)
597
+ }), m = B(), b = (y) => d ? d.includes(y.pointerType) : !0, V = (y) => {
598
+ P(c) && y.preventDefault(), P(i) && y.stopPropagation();
599
+ }, L = (y) => {
600
+ var D;
601
+ if (!P(x).includes(y.button) || P(t.disabled) || !b(y) || P(o) && y.target !== P(e)) return;
602
+ const G = P(g), W = G == null || (D = G.getBoundingClientRect) === null || D === void 0 ? void 0 : D.call(G), H = P(e).getBoundingClientRect(), _ = {
603
+ x: y.clientX - (G ? H.left - W.left + G.scrollLeft : H.left),
604
+ y: y.clientY - (G ? H.top - W.top + G.scrollTop : H.top)
605
605
  };
606
- d?.(F, x) !== !1 && (m.value = F, L(x));
607
- }, X = (x) => {
608
- if (T(t.disabled) || !y(x) || !m.value) return;
609
- const R = T(h), G = T(e).getBoundingClientRect();
610
- let { x: z, y: O } = f.value;
611
- (p === "x" || p === "both") && (z = x.clientX - m.value.x, R && (z = Math.min(Math.max(0, z), R.scrollWidth - G.width))), (p === "y" || p === "both") && (O = x.clientY - m.value.y, R && (O = Math.min(Math.max(0, O), R.scrollHeight - G.height))), f.value = {
612
- x: z,
613
- y: O
614
- }, n?.(f.value, x), L(x);
615
- }, A = (x) => {
616
- T(t.disabled) || !y(x) || m.value && (m.value = void 0, a?.(f.value, x), L(x));
606
+ s?.(_, y) !== !1 && (m.value = _, V(y));
607
+ }, J = (y) => {
608
+ if (P(t.disabled) || !b(y) || !m.value) return;
609
+ const D = P(g), G = P(e).getBoundingClientRect();
610
+ let { x: W, y: H } = v.value;
611
+ (h === "x" || h === "both") && (W = y.clientX - m.value.x, D && (W = Math.min(Math.max(0, W), D.scrollWidth - G.width))), (h === "y" || h === "both") && (H = y.clientY - m.value.y, D && (H = Math.min(Math.max(0, H), D.scrollHeight - G.height))), v.value = {
612
+ x: W,
613
+ y: H
614
+ }, n?.(v.value, y), V(y);
615
+ }, O = (y) => {
616
+ P(t.disabled) || !b(y) || m.value && (m.value = void 0, l?.(v.value, y), V(y));
617
617
  };
618
- if (ht) {
619
- const x = () => {
620
- var R;
618
+ if (St) {
619
+ const y = () => {
620
+ var D;
621
621
  return {
622
- capture: (R = t.capture) !== null && R !== void 0 ? R : !0,
623
- passive: !T(u)
622
+ capture: (D = t.capture) !== null && D !== void 0 ? D : !0,
623
+ passive: !P(c)
624
624
  };
625
625
  };
626
- te(b, "pointerdown", B, x), te(E, "pointermove", X, x), te(E, "pointerup", A, x);
626
+ me(I, "pointerdown", L, y), me($, "pointermove", J, y), me($, "pointerup", O, y);
627
627
  }
628
628
  return {
629
- ...an(f),
630
- position: f,
631
- isDragging: D(() => !!m.value),
632
- style: D(() => `left:${f.value.x}px;top:${f.value.y}px;`)
629
+ ...bn(v),
630
+ position: v,
631
+ isDragging: A(() => !!m.value),
632
+ style: A(() => `left:${v.value.x}px;top:${v.value.y}px;`)
633
633
  };
634
634
  }
635
- function We(e, t, s = {}) {
636
- const { window: c = he, ...u } = s;
637
- let r;
638
- const l = /* @__PURE__ */ wt(() => c && "ResizeObserver" in c), n = () => {
639
- r && (r.disconnect(), r = void 0);
640
- }, a = j(D(() => {
641
- const v = T(e);
642
- return Array.isArray(v) ? v.map((p) => Z(p)) : [Z(v)];
643
- }), (v) => {
644
- if (n(), l.value && c) {
645
- r = new ResizeObserver(t);
646
- for (const p of v) p && r.observe(p, u);
635
+ function _e(e, t, a = {}) {
636
+ const { window: d = Se, ...c } = a;
637
+ let i;
638
+ const o = /* @__PURE__ */ Rt(() => d && "ResizeObserver" in d), n = () => {
639
+ i && (i.disconnect(), i = void 0);
640
+ }, l = ne(A(() => {
641
+ const u = P(e);
642
+ return Array.isArray(u) ? u.map((h) => se(h)) : [se(u)];
643
+ }), (u) => {
644
+ if (n(), o.value && d) {
645
+ i = new ResizeObserver(t);
646
+ for (const h of u) h && i.observe(h, c);
647
647
  }
648
648
  }, {
649
649
  immediate: !0,
650
650
  flush: "post"
651
- }), d = () => {
652
- n(), a();
651
+ }), s = () => {
652
+ n(), l();
653
653
  };
654
- return Me(d), {
655
- isSupported: l,
656
- stop: d
654
+ return Fe(s), {
655
+ isSupported: o,
656
+ stop: s
657
657
  };
658
658
  }
659
- function le(e, t = {}) {
660
- const { reset: s = !0, windowResize: c = !0, windowScroll: u = !0, immediate: r = !0, updateTiming: l = "sync" } = t, n = V(0), a = V(0), d = V(0), v = V(0), p = V(0), E = V(0), h = V(0), b = V(0);
661
- function w() {
662
- const m = Z(e);
659
+ function xe(e, t = {}) {
660
+ const { reset: a = !0, windowResize: d = !0, windowScroll: c = !0, immediate: i = !0, updateTiming: o = "sync" } = t, n = Z(0), l = Z(0), s = Z(0), u = Z(0), h = Z(0), $ = Z(0), g = Z(0), I = Z(0);
661
+ function x() {
662
+ const m = se(e);
663
663
  if (!m) {
664
- s && (n.value = 0, a.value = 0, d.value = 0, v.value = 0, p.value = 0, E.value = 0, h.value = 0, b.value = 0);
664
+ a && (n.value = 0, l.value = 0, s.value = 0, u.value = 0, h.value = 0, $.value = 0, g.value = 0, I.value = 0);
665
665
  return;
666
666
  }
667
- const y = m.getBoundingClientRect();
668
- n.value = y.height, a.value = y.bottom, d.value = y.left, v.value = y.right, p.value = y.top, E.value = y.width, h.value = y.x, b.value = y.y;
667
+ const b = m.getBoundingClientRect();
668
+ n.value = b.height, l.value = b.bottom, s.value = b.left, u.value = b.right, h.value = b.top, $.value = b.width, g.value = b.x, I.value = b.y;
669
669
  }
670
- function f() {
671
- l === "sync" ? w() : l === "next-frame" && requestAnimationFrame(() => w());
670
+ function v() {
671
+ o === "sync" ? x() : o === "next-frame" && requestAnimationFrame(() => x());
672
672
  }
673
- return We(e, f), j(() => Z(e), (m) => !m && f()), xt(e, f, { attributeFilter: ["style", "class"] }), u && te("scroll", f, {
673
+ return _e(e, v), ne(() => se(e), (m) => !m && v()), Dt(e, v, { attributeFilter: ["style", "class"] }), c && me("scroll", v, {
674
674
  capture: !0,
675
675
  passive: !0
676
- }), c && te("resize", f, { passive: !0 }), sn(() => {
677
- r && f();
676
+ }), d && me("resize", v, { passive: !0 }), pn(() => {
677
+ i && v();
678
678
  }), {
679
679
  height: n,
680
- bottom: a,
681
- left: d,
682
- right: v,
683
- top: p,
684
- width: E,
685
- x: h,
686
- y: b,
687
- update: f
680
+ bottom: l,
681
+ left: s,
682
+ right: u,
683
+ top: h,
684
+ width: $,
685
+ x: g,
686
+ y: I,
687
+ update: v
688
688
  };
689
689
  }
690
- function Le(e) {
690
+ function Ze(e) {
691
691
  return typeof Window < "u" && e instanceof Window ? e.document.documentElement : typeof Document < "u" && e instanceof Document ? e.documentElement : e;
692
692
  }
693
- const Be = /* @__PURE__ */ new WeakMap();
694
- function un(e, t = !1) {
695
- const s = V(t);
696
- let c = "";
697
- j(en(e), (l) => {
698
- const n = Le(T(l));
693
+ const Qe = /* @__PURE__ */ new WeakMap();
694
+ function kn(e, t = !1) {
695
+ const a = Z(t);
696
+ let d = "";
697
+ ne(gn(e), (o) => {
698
+ const n = Ze(P(o));
699
699
  if (n) {
700
- const a = n;
701
- if (Be.get(a) || Be.set(a, a.style.overflow), a.style.overflow !== "hidden" && (c = a.style.overflow), a.style.overflow === "hidden") return s.value = !0;
702
- if (s.value) return a.style.overflow = "hidden";
700
+ const l = n;
701
+ if (Qe.get(l) || Qe.set(l, l.style.overflow), l.style.overflow !== "hidden" && (d = l.style.overflow), l.style.overflow === "hidden") return a.value = !0;
702
+ if (a.value) return l.style.overflow = "hidden";
703
703
  }
704
704
  }, { immediate: !0 });
705
- const u = () => {
706
- const l = Le(T(e));
707
- !l || s.value || (l.style.overflow = "hidden", s.value = !0);
708
- }, r = () => {
709
- const l = Le(T(e));
710
- !l || !s.value || (l.style.overflow = c, Be.delete(l), s.value = !1);
705
+ const c = () => {
706
+ const o = Ze(P(e));
707
+ !o || a.value || (o.style.overflow = "hidden", a.value = !0);
708
+ }, i = () => {
709
+ const o = Ze(P(e));
710
+ !o || !a.value || (o.style.overflow = d, Qe.delete(o), a.value = !1);
711
711
  };
712
- return Me(r), D({
712
+ return Fe(i), A({
713
713
  get() {
714
- return s.value;
714
+ return a.value;
715
715
  },
716
- set(l) {
717
- l ? u() : r();
716
+ set(o) {
717
+ o ? c() : i();
718
718
  }
719
719
  });
720
720
  }
721
- const dn = (e) => {
721
+ const En = (e) => {
722
722
  const t = new DOMParser().parseFromString(e, "text/html");
723
- return Array.from(t.body.childNodes).some((s) => s.nodeType === 1);
724
- }, fn = (e = 8) => Array.from({ length: e }, () => Math.floor(Math.random() * 16).toString(16)).join(""), vn = ["data-colindex", "data-rowindex", "data-editable", "contenteditable", "tabindex"], mn = ["innerHTML"], gn = { key: 2 }, hn = /* @__PURE__ */ ne({
723
+ return Array.from(t.body.childNodes).some((a) => a.nodeType === 1);
724
+ }, $n = (e = 8) => Array.from({ length: e }, () => Math.floor(Math.random() * 16).toString(16)).join(""), Sn = ["data-colindex", "data-rowindex", "data-editable", "contenteditable", "tabindex"], Rn = ["innerHTML"], Dn = { key: 2 }, Mn = /* @__PURE__ */ ue({
725
725
  __name: "ACell",
726
726
  props: {
727
727
  colIndex: {},
@@ -733,185 +733,185 @@ const dn = (e) => {
733
733
  debounce: { default: 300 }
734
734
  },
735
735
  setup(e, { expose: t }) {
736
- const s = U("cell"), c = e.store.getCellData(e.colIndex, e.rowIndex), u = W(""), r = W(!1), l = e.store.columns[e.colIndex], n = e.store.rows[e.rowIndex], a = l.align || "center", d = l.width || "40ch", v = D(() => e.store.getCellDisplayValue(e.colIndex, e.rowIndex)), p = D(() => typeof v.value == "string" ? dn(v.value) : !1), E = D(() => ({
737
- textAlign: a,
738
- width: d,
739
- fontWeight: r.value ? "bold" : "inherit",
736
+ const a = le("cell"), d = e.store.getCellData(e.colIndex, e.rowIndex), c = B(""), i = B(!1), o = e.store.columns[e.colIndex], n = e.store.rows[e.rowIndex], l = o.align || "center", s = o.width || "40ch", u = A(() => e.store.getCellDisplayValue(e.colIndex, e.rowIndex)), h = A(() => typeof u.value == "string" ? En(u.value) : !1), $ = A(() => ({
737
+ textAlign: l,
738
+ width: s,
739
+ fontWeight: i.value ? "bold" : "inherit",
740
740
  paddingLeft: e.store.getIndent(e.colIndex, e.store.display[e.rowIndex]?.indent)
741
- })), h = D(() => ({
741
+ })), g = A(() => ({
742
742
  "sticky-column": e.pinned,
743
- "cell-modified": r.value
744
- })), b = () => {
745
- f(), w();
746
- }, w = () => {
747
- const { left: A, bottom: x, width: R, height: G } = le(s);
748
- l.mask, l.modalComponent && e.store.$patch((z) => {
749
- z.modal.visible = !0, z.modal.colIndex = e.colIndex, z.modal.rowIndex = e.rowIndex, z.modal.left = A, z.modal.bottom = x, z.modal.width = R, z.modal.height = G, z.modal.cell = s.value, typeof l.modalComponent == "function" ? z.modal.component = l.modalComponent({ table: z.table, row: n, column: l }) : z.modal.component = l.modalComponent, z.modal.componentProps = l.modalComponentExtraProps;
743
+ "cell-modified": i.value
744
+ })), I = () => {
745
+ v(), x();
746
+ }, x = () => {
747
+ const { left: O, bottom: y, width: D, height: G } = xe(a);
748
+ o.mask, o.modalComponent && e.store.$patch((W) => {
749
+ W.modal.visible = !0, W.modal.colIndex = e.colIndex, W.modal.rowIndex = e.rowIndex, W.modal.left = O, W.modal.bottom = y, W.modal.width = D, W.modal.height = G, W.modal.cell = a.value, typeof o.modalComponent == "function" ? W.modal.component = o.modalComponent({ table: W.table, row: n, column: o }) : W.modal.component = o.modalComponent, W.modal.componentProps = o.modalComponentExtraProps;
750
750
  });
751
751
  };
752
752
  if (e.addNavigation) {
753
- let A = {
754
- ...Se,
755
- "keydown.f2": w,
756
- "keydown.alt.up": w,
757
- "keydown.alt.down": w,
758
- "keydown.alt.left": w,
759
- "keydown.alt.right": w
753
+ let O = {
754
+ ...ze,
755
+ "keydown.f2": x,
756
+ "keydown.alt.up": x,
757
+ "keydown.alt.down": x,
758
+ "keydown.alt.left": x,
759
+ "keydown.alt.right": x
760
760
  };
761
- typeof e.addNavigation == "object" && (A = {
762
- ...A,
761
+ typeof e.addNavigation == "object" && (O = {
762
+ ...O,
763
763
  ...e.addNavigation
764
- }), qe([
764
+ }), it([
765
765
  {
766
- selectors: s,
767
- handlers: A
766
+ selectors: a,
767
+ handlers: O
768
768
  }
769
769
  ]);
770
770
  }
771
- const f = () => {
772
- if (s.value && l.edit) {
773
- const A = window.getSelection();
774
- if (A)
771
+ const v = () => {
772
+ if (a.value && o.edit) {
773
+ const O = window.getSelection();
774
+ if (O)
775
775
  try {
776
- const x = document.createRange();
777
- x.selectNodeContents && (x.selectNodeContents(s.value), A.removeAllRanges(), A.addRange(x));
776
+ const y = document.createRange();
777
+ y.selectNodeContents && (y.selectNodeContents(a.value), O.removeAllRanges(), O.addRange(y));
778
778
  } catch {
779
779
  }
780
780
  }
781
781
  }, m = () => {
782
- s.value && (u.value = s.value.textContent, f());
783
- }, y = () => {
782
+ a.value && (c.value = a.value.textContent, v());
783
+ }, b = () => {
784
784
  try {
785
- const A = window.getSelection();
786
- if (A && A.rangeCount > 0 && s.value) {
787
- const x = A.getRangeAt(0), R = x.cloneRange();
788
- if (R.selectNodeContents && R.setEnd)
789
- return R.selectNodeContents(s.value), R.setEnd(x.endContainer, x.endOffset), R.toString().length;
785
+ const O = window.getSelection();
786
+ if (O && O.rangeCount > 0 && a.value) {
787
+ const y = O.getRangeAt(0), D = y.cloneRange();
788
+ if (D.selectNodeContents && D.setEnd)
789
+ return D.selectNodeContents(a.value), D.setEnd(y.endContainer, y.endOffset), D.toString().length;
790
790
  }
791
791
  } catch {
792
792
  }
793
793
  return 0;
794
- }, L = (A) => {
795
- if (s.value)
794
+ }, V = (O) => {
795
+ if (a.value)
796
796
  try {
797
- const x = window.getSelection();
798
- if (!x) return;
799
- let R = 0;
800
- const G = document.createTreeWalker ? document.createTreeWalker(s.value, NodeFilter.SHOW_TEXT, null) : null;
797
+ const y = window.getSelection();
798
+ if (!y) return;
799
+ let D = 0;
800
+ const G = document.createTreeWalker ? document.createTreeWalker(a.value, NodeFilter.SHOW_TEXT, null) : null;
801
801
  if (!G) return;
802
- let z, O = null;
803
- for (; z = G.nextNode(); ) {
804
- const F = z, _ = R + F.textContent.length;
805
- if (A <= _ && (O = document.createRange(), O.setStart && O.setEnd)) {
806
- O.setStart(F, A - R), O.setEnd(F, A - R);
802
+ let W, H = null;
803
+ for (; W = G.nextNode(); ) {
804
+ const _ = W, fe = D + _.textContent.length;
805
+ if (O <= fe && (H = document.createRange(), H.setStart && H.setEnd)) {
806
+ H.setStart(_, O - D), H.setEnd(_, O - D);
807
807
  break;
808
808
  }
809
- R = _;
809
+ D = fe;
810
810
  }
811
- O && x.removeAllRanges && x.addRange && (x.removeAllRanges(), x.addRange(O));
811
+ H && y.removeAllRanges && y.addRange && (y.removeAllRanges(), y.addRange(H));
812
812
  } catch {
813
813
  }
814
- }, B = (A) => {
815
- if (!l.edit) return;
816
- const x = A.target;
817
- if (x.textContent === u.value)
814
+ }, L = (O) => {
815
+ if (!o.edit) return;
816
+ const y = O.target;
817
+ if (y.textContent === c.value)
818
818
  return;
819
- const R = y();
820
- u.value = x.textContent, l.format ? (r.value = x.textContent !== e.store.getFormattedValue(e.colIndex, e.rowIndex, c), e.store.setCellText(e.colIndex, e.rowIndex, x.textContent)) : (r.value = x.textContent !== c, e.store.setCellData(e.colIndex, e.rowIndex, x.textContent)), Ge().then(() => {
821
- L(R);
819
+ const D = b();
820
+ c.value = y.textContent, o.format ? (i.value = y.textContent !== e.store.getFormattedValue(e.colIndex, e.rowIndex, d), e.store.setCellText(e.colIndex, e.rowIndex, y.textContent)) : (i.value = y.textContent !== d, e.store.setCellData(e.colIndex, e.rowIndex, y.textContent)), tt().then(() => {
821
+ V(D);
822
822
  });
823
- }, X = /* @__PURE__ */ ln(B, e.debounce);
823
+ }, J = /* @__PURE__ */ yn(L, e.debounce);
824
824
  return t({
825
- currentData: u
826
- }), (A, x) => (M(), P("td", {
825
+ currentData: c
826
+ }), (O, y) => (C(), k("td", {
827
827
  ref: "cell",
828
828
  "data-colindex": e.colIndex,
829
829
  "data-rowindex": e.rowIndex,
830
- "data-editable": $(l).edit,
831
- contenteditable: $(l).edit,
830
+ "data-editable": R(o).edit,
831
+ contenteditable: R(o).edit,
832
832
  tabindex: e.tabIndex,
833
833
  spellcheck: !1,
834
- style: ee(E.value),
835
- class: q(["atable-cell", h.value]),
834
+ style: re($.value),
835
+ class: ee(["atable-cell", g.value]),
836
836
  onFocus: m,
837
- onPaste: B,
838
- onInput: x[0] || (x[0] = //@ts-ignore
839
- (...R) => $(X) && $(X)(...R)),
840
- onClick: b
837
+ onPaste: L,
838
+ onInput: y[0] || (y[0] = //@ts-ignore
839
+ (...D) => R(J) && R(J)(...D)),
840
+ onClick: I
841
841
  }, [
842
- $(l).cellComponent ? (M(), ie(Ee($(l).cellComponent), Xe({
842
+ R(o).cellComponent ? (C(), ve(Ee(R(o).cellComponent), nt({
843
843
  key: 0,
844
- value: v.value
845
- }, $(l).cellComponentProps), null, 16, ["value"])) : p.value ? (M(), P("span", {
844
+ value: u.value
845
+ }, R(o).cellComponentProps), null, 16, ["value"])) : h.value ? (C(), k("span", {
846
846
  key: 1,
847
- innerHTML: v.value
848
- }, null, 8, mn)) : (M(), P("span", gn, ce(v.value), 1))
849
- ], 46, vn));
847
+ innerHTML: u.value
848
+ }, null, 8, Rn)) : (C(), k("span", Dn, ge(u.value), 1))
849
+ ], 46, Sn));
850
850
  }
851
- }), wn = ["tabindex"], xn = ["tabindex"], pn = ["colspan"], yn = /* @__PURE__ */ ne({
851
+ }), Tn = ["tabindex"], An = ["tabindex"], On = ["colspan"], Pn = /* @__PURE__ */ ue({
852
852
  __name: "AExpansionRow",
853
853
  props: {
854
854
  rowIndex: {},
855
855
  store: {},
856
856
  tabIndex: { default: () => -1 },
857
- addNavigation: { type: [Boolean, Object], default: () => Se }
857
+ addNavigation: { type: [Boolean, Object], default: () => ze }
858
858
  },
859
859
  setup(e) {
860
- const t = U("rowEl"), s = D(() => e.store.display[e.rowIndex].expanded ? "▼" : "►");
860
+ const t = le("rowEl"), a = A(() => e.store.display[e.rowIndex].expanded ? "▼" : "►");
861
861
  if (e.addNavigation) {
862
- const c = {
863
- "keydown.control.g": (u) => {
864
- u.stopPropagation(), u.preventDefault(), e.store.toggleRowExpand(e.rowIndex);
862
+ const d = {
863
+ "keydown.control.g": (c) => {
864
+ c.stopPropagation(), c.preventDefault(), e.store.toggleRowExpand(e.rowIndex);
865
865
  }
866
866
  };
867
- typeof e.addNavigation == "object" && Object.assign(c, e.addNavigation), qe([
867
+ typeof e.addNavigation == "object" && Object.assign(d, e.addNavigation), it([
868
868
  {
869
869
  selectors: t,
870
- handlers: c
870
+ handlers: d
871
871
  }
872
872
  ]);
873
873
  }
874
- return (c, u) => (M(), P(se, null, [
875
- N("tr", Xe(c.$attrs, {
874
+ return (d, c) => (C(), k(ie, null, [
875
+ z("tr", nt(d.$attrs, {
876
876
  ref: "rowEl",
877
877
  tabindex: e.tabIndex,
878
878
  class: "expandable-row"
879
879
  }), [
880
- N("td", {
880
+ z("td", {
881
881
  tabIndex: -1,
882
882
  class: "row-index",
883
- onClick: u[0] || (u[0] = (r) => e.store.toggleRowExpand(e.rowIndex))
884
- }, ce(s.value), 1),
885
- Y(c.$slots, "row", {}, void 0, !0)
886
- ], 16, wn),
887
- e.store.display[e.rowIndex].expanded ? (M(), P("tr", {
883
+ onClick: c[0] || (c[0] = (i) => e.store.toggleRowExpand(e.rowIndex))
884
+ }, ge(a.value), 1),
885
+ te(d.$slots, "row", {}, void 0, !0)
886
+ ], 16, Tn),
887
+ e.store.display[e.rowIndex].expanded ? (C(), k("tr", {
888
888
  key: 0,
889
889
  ref: "rowExpanded",
890
890
  tabindex: e.tabIndex,
891
891
  class: "expanded-row"
892
892
  }, [
893
- N("td", {
893
+ z("td", {
894
894
  tabIndex: -1,
895
895
  colspan: e.store.columns.length + 1,
896
896
  class: "expanded-row-content"
897
897
  }, [
898
- Y(c.$slots, "content", {}, void 0, !0)
899
- ], 8, pn)
900
- ], 8, xn)) : J("", !0)
898
+ te(d.$slots, "content", {}, void 0, !0)
899
+ ], 8, On)
900
+ ], 8, An)) : q("", !0)
901
901
  ], 64));
902
902
  }
903
- }), re = (e, t) => {
904
- const s = e.__vccOpts || e;
905
- for (const [c, u] of t)
906
- s[c] = u;
907
- return s;
908
- }, bn = /* @__PURE__ */ re(yn, [["__scopeId", "data-v-a42297c7"]]), Cn = ["colspan"], En = {
903
+ }), he = (e, t) => {
904
+ const a = e.__vccOpts || e;
905
+ for (const [d, c] of t)
906
+ a[d] = c;
907
+ return a;
908
+ }, Hn = /* @__PURE__ */ he(Pn, [["__scopeId", "data-v-a42297c7"]]), Ln = ["colspan"], Vn = {
909
909
  ref: "container",
910
910
  class: "gantt-container"
911
- }, In = ["data-rowindex", "data-colindex"], kn = {
911
+ }, Nn = ["data-rowindex", "data-colindex"], Bn = {
912
912
  key: 2,
913
913
  class: "gantt-label"
914
- }, $n = ["x1", "y1", "x2", "y2"], Rn = /* @__PURE__ */ ne({
914
+ }, zn = ["x1", "y1", "x2", "y2"], Fn = /* @__PURE__ */ ue({
915
915
  __name: "AGanttCell",
916
916
  props: {
917
917
  store: {},
@@ -925,19 +925,19 @@ const dn = (e) => {
925
925
  color: { default: "#cccccc" }
926
926
  },
927
927
  emits: ["connection:create"],
928
- setup(e, { expose: t, emit: s }) {
929
- St((I) => ({
930
- v6d722296: u.value,
931
- v260b36f8: I.colspan
928
+ setup(e, { expose: t, emit: a }) {
929
+ Bt((E) => ({
930
+ v6d722296: c.value,
931
+ v260b36f8: E.colspan
932
932
  }));
933
- const c = s, u = W(e.color.length >= 6 ? e.color : "#cccccc"), r = `gantt-bar-row-${e.rowIndex}-col-${e.colIndex}`, l = U("container"), n = U("bar"), a = U("leftResizeHandle"), d = U("rightResizeHandle"), v = U("leftConnectionHandle"), p = U("rightConnectionHandle"), { width: E } = le(l), { left: h, right: b } = le(n), w = W(e.start), f = W(e.end || w.value + e.colspan), m = W(!1), y = W(!1), L = W(!1), B = W(!1), X = W(!1), A = W({ startX: 0, startY: 0, endX: 0, endY: 0 }), x = D(() => we.value || F.value || _.value), R = D(() => e.colspan > 0 ? E.value / e.colspan : 0), G = D(() => {
934
- const I = w.value / e.colspan * 100, o = f.value / e.colspan * 100;
933
+ const d = a, c = B(e.color.length >= 6 ? e.color : "#cccccc"), i = `gantt-bar-row-${e.rowIndex}-col-${e.colIndex}`, o = le("container"), n = le("bar"), l = le("leftResizeHandle"), s = le("rightResizeHandle"), u = le("leftConnectionHandle"), h = le("rightConnectionHandle"), { width: $ } = xe(o), { left: g, right: I } = xe(n), x = B(e.start), v = B(e.end || x.value + e.colspan), m = B(!1), b = B(!1), V = B(!1), L = B(!1), J = B(!1), O = B({ startX: 0, startY: 0, endX: 0, endY: 0 }), y = A(() => Re.value || _.value || fe.value), D = A(() => e.colspan > 0 ? $.value / e.colspan : 0), G = A(() => {
934
+ const E = x.value / e.colspan * 100, M = v.value / e.colspan * 100;
935
935
  return {
936
- left: `${I}%`,
937
- width: `${o - I}%`,
938
- backgroundColor: u.value
936
+ left: `${E}%`,
937
+ width: `${M - E}%`,
938
+ backgroundColor: c.value
939
939
  };
940
- }), z = D(
940
+ }), W = A(
941
941
  () => ({
942
942
  position: "fixed",
943
943
  top: 0,
@@ -947,236 +947,236 @@ const dn = (e) => {
947
947
  pointerEvents: "none",
948
948
  zIndex: 1e3
949
949
  })
950
- ), O = W({ startX: 0, startPos: 0 }), { isDragging: F } = Pe(a, {
950
+ ), H = B({ startX: 0, startPos: 0 }), { isDragging: _ } = Je(l, {
951
951
  axis: "x",
952
- onStart: () => ve(h.value, w.value),
953
- onMove: ({ x: I }) => xe(I),
954
- onEnd: ({ x: I }) => Ae(I)
955
- }), { isDragging: _ } = Pe(d, {
952
+ onStart: () => Ie(g.value, x.value),
953
+ onMove: ({ x: E }) => We(E),
954
+ onEnd: ({ x: E }) => Xe(E)
955
+ }), { isDragging: fe } = Je(s, {
956
956
  axis: "x",
957
- onStart: () => ve(b.value, f.value),
958
- onMove: ({ x: I }) => pe(I),
959
- onEnd: ({ x: I }) => Je(I)
960
- }), { isDragging: we } = Pe(n, {
957
+ onStart: () => Ie(I.value, v.value),
958
+ onMove: ({ x: E }) => Ge(E),
959
+ onEnd: ({ x: E }) => De(E)
960
+ }), { isDragging: Re } = Je(n, {
961
961
  exact: !0,
962
962
  axis: "x",
963
- onStart: () => ve(h.value, w.value),
964
- onMove: ({ x: I }) => Ze(I),
965
- onEnd: ({ x: I }) => Qe(I)
963
+ onStart: () => Ie(g.value, x.value),
964
+ onMove: ({ x: E }) => Ye(E),
965
+ onEnd: ({ x: E }) => Me(E)
966
966
  });
967
- de(() => {
968
- Ke();
969
- }), Mt(() => {
970
- _e();
967
+ pe(() => {
968
+ Ue();
969
+ }), zt(() => {
970
+ je();
971
971
  });
972
- function ve(I, o) {
973
- n.value && (n.value.style.transition = "none"), O.value = { startX: I, startPos: o };
972
+ function Ie(E, M) {
973
+ n.value && (n.value.style.transition = "none"), H.value = { startX: E, startPos: M };
974
974
  }
975
- function xe(I) {
976
- if (!F.value || !n.value) return;
977
- const i = (I - O.value.startX) / R.value, g = Math.max(0, Math.min(f.value - 1, O.value.startPos + i));
978
- n.value.style.left = `${g / e.colspan * 100}%`, n.value.style.width = `${(f.value - g) / e.colspan * 100}%`;
975
+ function We(E) {
976
+ if (!_.value || !n.value) return;
977
+ const X = (E - H.value.startX) / D.value, F = Math.max(0, Math.min(v.value - 1, H.value.startPos + X));
978
+ n.value.style.left = `${F / e.colspan * 100}%`, n.value.style.width = `${(v.value - F) / e.colspan * 100}%`;
979
979
  }
980
- function Ae(I) {
980
+ function Xe(E) {
981
981
  if (!n.value) return;
982
- const o = I - O.value.startX, i = Math.round(o / R.value), g = w.value, C = Math.max(0, Math.min(f.value - 1, O.value.startPos + i));
983
- w.value = C, e.store.updateGanttBar({
982
+ const M = E - H.value.startX, X = Math.round(M / D.value), F = x.value, Y = Math.max(0, Math.min(v.value - 1, H.value.startPos + X));
983
+ x.value = Y, e.store.updateGanttBar({
984
984
  rowIndex: e.rowIndex,
985
985
  colIndex: e.colIndex,
986
986
  type: "resize",
987
987
  edge: "start",
988
- oldStart: g,
989
- newStart: C,
990
- end: f.value,
991
- delta: i,
992
- oldColspan: f.value - g,
993
- newColspan: f.value - C
988
+ oldStart: F,
989
+ newStart: Y,
990
+ end: v.value,
991
+ delta: X,
992
+ oldColspan: v.value - F,
993
+ newColspan: v.value - Y
994
994
  });
995
995
  }
996
- function pe(I) {
997
- if (!_.value || !n.value) return;
998
- const i = (I - O.value.startX) / R.value, g = Math.max(w.value + 1, Math.min(e.columnsCount, O.value.startPos + i));
999
- n.value.style.width = `${(g - w.value) / e.colspan * 100}%`;
996
+ function Ge(E) {
997
+ if (!fe.value || !n.value) return;
998
+ const X = (E - H.value.startX) / D.value, F = Math.max(x.value + 1, Math.min(e.columnsCount, H.value.startPos + X));
999
+ n.value.style.width = `${(F - x.value) / e.colspan * 100}%`;
1000
1000
  }
1001
- function Je(I) {
1001
+ function De(E) {
1002
1002
  if (!n.value) return;
1003
- const o = I - O.value.startX, i = Math.round(o / R.value), g = f.value, C = Math.max(w.value + 1, Math.min(e.columnsCount, O.value.startPos + i));
1004
- f.value = C, e.store.updateGanttBar({
1003
+ const M = E - H.value.startX, X = Math.round(M / D.value), F = v.value, Y = Math.max(x.value + 1, Math.min(e.columnsCount, H.value.startPos + X));
1004
+ v.value = Y, e.store.updateGanttBar({
1005
1005
  rowIndex: e.rowIndex,
1006
1006
  colIndex: e.colIndex,
1007
1007
  type: "resize",
1008
1008
  edge: "end",
1009
- oldEnd: g,
1010
- newEnd: C,
1011
- start: w.value,
1012
- delta: i,
1013
- oldColspan: g - w.value,
1014
- newColspan: C - w.value
1009
+ oldEnd: F,
1010
+ newEnd: Y,
1011
+ start: x.value,
1012
+ delta: X,
1013
+ oldColspan: F - x.value,
1014
+ newColspan: Y - x.value
1015
1015
  });
1016
1016
  }
1017
- function Ze(I) {
1018
- if (!we.value || !n.value) return;
1019
- const i = (I - O.value.startX) / R.value, g = f.value - w.value, C = Math.max(0, Math.min(O.value.startPos + i, e.columnsCount - g));
1020
- n.value.style.left = `${C / e.colspan * 100}%`;
1017
+ function Ye(E) {
1018
+ if (!Re.value || !n.value) return;
1019
+ const X = (E - H.value.startX) / D.value, F = v.value - x.value, Y = Math.max(0, Math.min(H.value.startPos + X, e.columnsCount - F));
1020
+ n.value.style.left = `${Y / e.colspan * 100}%`;
1021
1021
  }
1022
- function Qe(I) {
1022
+ function Me(E) {
1023
1023
  if (!n.value) return;
1024
- const o = I - O.value.startX, i = Math.round(o / R.value), g = f.value - w.value, C = w.value, H = f.value;
1025
- let k = O.value.startPos + i, S = k + g;
1026
- k < 0 ? (k = 0, S = g) : S > e.columnsCount && (S = e.columnsCount, k = S - g), w.value = k, f.value = S, e.store.updateGanttBar({
1024
+ const M = E - H.value.startX, X = Math.round(M / D.value), F = v.value - x.value, Y = x.value, j = v.value;
1025
+ let Q = H.value.startPos + X, K = Q + F;
1026
+ Q < 0 ? (Q = 0, K = F) : K > e.columnsCount && (K = e.columnsCount, Q = K - F), x.value = Q, v.value = K, e.store.updateGanttBar({
1027
1027
  rowIndex: e.rowIndex,
1028
1028
  colIndex: e.colIndex,
1029
1029
  type: "bar",
1030
- oldStart: C,
1031
- oldEnd: H,
1032
- newStart: k,
1033
- newEnd: S,
1034
- delta: i,
1035
- colspan: S - k
1030
+ oldStart: Y,
1031
+ oldEnd: j,
1032
+ newStart: Q,
1033
+ newEnd: K,
1034
+ delta: X,
1035
+ colspan: K - Q
1036
1036
  });
1037
1037
  }
1038
- function Ke() {
1039
- const { x: I, y: o } = le(n), { x: i, y: g } = le(v), { x: C, y: H } = le(p);
1038
+ function Ue() {
1039
+ const { x: E, y: M } = xe(n), { x: X, y: F } = xe(u), { x: Y, y: j } = xe(h);
1040
1040
  e.store.registerGanttBar({
1041
- id: r,
1041
+ id: i,
1042
1042
  rowIndex: e.rowIndex,
1043
1043
  colIndex: e.colIndex,
1044
- startIndex: w,
1045
- endIndex: f,
1046
- color: u,
1044
+ startIndex: x,
1045
+ endIndex: v,
1046
+ color: c,
1047
1047
  label: e.label,
1048
- position: { x: I, y: o }
1048
+ position: { x: E, y: M }
1049
1049
  }), e.store.isDependencyGraphEnabled && (e.store.registerConnectionHandle({
1050
- id: `${r}-connection-left`,
1050
+ id: `${i}-connection-left`,
1051
1051
  rowIndex: e.rowIndex,
1052
1052
  colIndex: e.colIndex,
1053
1053
  side: "left",
1054
- position: { x: i, y: g },
1054
+ position: { x: X, y: F },
1055
1055
  visible: m,
1056
- barId: r
1056
+ barId: i
1057
1057
  }), e.store.registerConnectionHandle({
1058
- id: `${r}-connection-right`,
1058
+ id: `${i}-connection-right`,
1059
1059
  rowIndex: e.rowIndex,
1060
1060
  colIndex: e.colIndex,
1061
1061
  side: "right",
1062
- position: { x: C, y: H },
1063
- visible: y,
1064
- barId: r
1062
+ position: { x: Y, y: j },
1063
+ visible: b,
1064
+ barId: i
1065
1065
  }));
1066
1066
  }
1067
- function _e() {
1068
- e.store.unregisterGanttBar(r), e.store.isDependencyGraphEnabled && (e.store.unregisterConnectionHandle(`${r}-connection-left`), e.store.unregisterConnectionHandle(`${r}-connection-right`));
1067
+ function je() {
1068
+ e.store.unregisterGanttBar(i), e.store.isDependencyGraphEnabled && (e.store.unregisterConnectionHandle(`${i}-connection-left`), e.store.unregisterConnectionHandle(`${i}-connection-right`));
1069
1069
  }
1070
- function et() {
1071
- e.store.isDependencyGraphEnabled && (m.value = !0, y.value = !0);
1070
+ function qe() {
1071
+ e.store.isDependencyGraphEnabled && (m.value = !0, b.value = !0);
1072
1072
  }
1073
1073
  function Te() {
1074
- !L.value && !B.value && (m.value = !1, y.value = !1);
1074
+ !V.value && !L.value && (m.value = !1, b.value = !1);
1075
1075
  }
1076
- function De(I, o) {
1077
- o.preventDefault(), o.stopPropagation(), X.value = !0, I === "left" ? L.value = !0 : B.value = !0;
1078
- const i = I === "left" ? v.value : p.value;
1079
- if (i) {
1080
- const H = i.getBoundingClientRect(), k = H.left + H.width / 2, S = H.top + H.height / 2;
1081
- A.value = { startX: k, startY: S, endX: k, endY: S };
1076
+ function Ae(E, M) {
1077
+ M.preventDefault(), M.stopPropagation(), J.value = !0, E === "left" ? V.value = !0 : L.value = !0;
1078
+ const X = E === "left" ? u.value : h.value;
1079
+ if (X) {
1080
+ const j = X.getBoundingClientRect(), Q = j.left + j.width / 2, K = j.top + j.height / 2;
1081
+ O.value = { startX: Q, startY: K, endX: Q, endY: K };
1082
1082
  }
1083
- const g = (H) => {
1084
- A.value.endX = H.clientX, A.value.endY = H.clientY;
1085
- }, C = (H) => {
1086
- Oe(H, I), He(g, C);
1083
+ const F = (j) => {
1084
+ O.value.endX = j.clientX, O.value.endY = j.clientY;
1085
+ }, Y = (j) => {
1086
+ Oe(j, E), Pe(F, Y);
1087
1087
  };
1088
- document.addEventListener("mousemove", g), document.addEventListener("mouseup", C);
1088
+ document.addEventListener("mousemove", F), document.addEventListener("mouseup", Y);
1089
1089
  }
1090
- function Oe(I, o) {
1091
- const g = document.elementFromPoint(I.clientX, I.clientY)?.closest(".connection-handle");
1092
- if (g && g !== (o === "left" ? v.value : p.value)) {
1093
- const C = g.closest(".gantt-bar");
1094
- if (C) {
1095
- const H = parseInt(C.getAttribute("data-rowindex") || "0"), k = parseInt(C.getAttribute("data-colindex") || "0"), S = g.classList.contains("left-connection-handle") ? "left" : "right", oe = `gantt-bar-row-${H}-col-${k}`, ye = e.store.createConnection(
1096
- `${r}-connection-${o}`,
1097
- `${oe}-connection-${S}`
1090
+ function Oe(E, M) {
1091
+ const F = document.elementFromPoint(E.clientX, E.clientY)?.closest(".connection-handle");
1092
+ if (F && F !== (M === "left" ? u.value : h.value)) {
1093
+ const Y = F.closest(".gantt-bar");
1094
+ if (Y) {
1095
+ const j = parseInt(Y.getAttribute("data-rowindex") || "0"), Q = parseInt(Y.getAttribute("data-colindex") || "0"), K = F.classList.contains("left-connection-handle") ? "left" : "right", r = `gantt-bar-row-${j}-col-${Q}`, f = e.store.createConnection(
1096
+ `${i}-connection-${M}`,
1097
+ `${r}-connection-${K}`
1098
1098
  );
1099
- ye && c("connection:create", ye);
1099
+ f && d("connection:create", f);
1100
1100
  }
1101
1101
  }
1102
1102
  }
1103
- function He(I, o) {
1104
- X.value = !1, L.value = !1, B.value = !1, document.removeEventListener("mousemove", I), document.removeEventListener("mouseup", o), n.value?.matches(":hover") || Te();
1103
+ function Pe(E, M) {
1104
+ J.value = !1, V.value = !1, L.value = !1, document.removeEventListener("mousemove", E), document.removeEventListener("mouseup", M), n.value?.matches(":hover") || Te();
1105
1105
  }
1106
1106
  return t({
1107
1107
  barStyle: G,
1108
- cleanupConnectionDrag: He,
1109
- currentEnd: f,
1108
+ cleanupConnectionDrag: Pe,
1109
+ currentEnd: v,
1110
1110
  handleConnectionDrop: Oe,
1111
- isLeftConnectionDragging: L,
1111
+ isLeftConnectionDragging: V,
1112
1112
  isLeftConnectionVisible: m,
1113
- isRightConnectionDragging: B,
1114
- isRightConnectionVisible: y,
1115
- showDragPreview: X
1116
- }), (I, o) => (M(), P("td", {
1113
+ isRightConnectionDragging: L,
1114
+ isRightConnectionVisible: b,
1115
+ showDragPreview: J
1116
+ }), (E, M) => (C(), k("td", {
1117
1117
  class: "aganttcell",
1118
1118
  colspan: e.colspan
1119
1119
  }, [
1120
- N("div", En, [
1121
- N("div", {
1120
+ z("div", Vn, [
1121
+ z("div", {
1122
1122
  ref: "bar",
1123
1123
  "data-rowindex": e.rowIndex,
1124
1124
  "data-colindex": e.colIndex,
1125
- class: q(["gantt-bar", { "is-dragging": x.value }]),
1126
- style: ee(G.value),
1127
- onMouseenter: et,
1125
+ class: ee(["gantt-bar", { "is-dragging": y.value }]),
1126
+ style: re(G.value),
1127
+ onMouseenter: qe,
1128
1128
  onMouseleave: Te
1129
1129
  }, [
1130
- e.store.isDependencyGraphEnabled ? (M(), P("div", {
1130
+ e.store.isDependencyGraphEnabled ? (C(), k("div", {
1131
1131
  key: 0,
1132
1132
  ref: "leftConnectionHandle",
1133
- class: q(["connection-handle left-connection-handle", { visible: m.value, "is-dragging": L.value }]),
1134
- onMousedown: o[0] || (o[0] = $e((i) => De("left", i), ["stop"]))
1135
- }, [...o[2] || (o[2] = [
1136
- N("div", { class: "connection-dot" }, null, -1)
1137
- ])], 34)) : J("", !0),
1138
- e.store.isDependencyGraphEnabled ? (M(), P("div", {
1133
+ class: ee(["connection-handle left-connection-handle", { visible: m.value, "is-dragging": V.value }]),
1134
+ onMousedown: M[0] || (M[0] = Be((X) => Ae("left", X), ["stop"]))
1135
+ }, [...M[2] || (M[2] = [
1136
+ z("div", { class: "connection-dot" }, null, -1)
1137
+ ])], 34)) : q("", !0),
1138
+ e.store.isDependencyGraphEnabled ? (C(), k("div", {
1139
1139
  key: 1,
1140
1140
  ref: "rightConnectionHandle",
1141
- class: q(["connection-handle right-connection-handle", { visible: y.value, "is-dragging": B.value }]),
1142
- onMousedown: o[1] || (o[1] = $e((i) => De("right", i), ["stop"]))
1143
- }, [...o[3] || (o[3] = [
1144
- N("div", { class: "connection-dot" }, null, -1)
1145
- ])], 34)) : J("", !0),
1146
- N("div", {
1141
+ class: ee(["connection-handle right-connection-handle", { visible: b.value, "is-dragging": L.value }]),
1142
+ onMousedown: M[1] || (M[1] = Be((X) => Ae("right", X), ["stop"]))
1143
+ }, [...M[3] || (M[3] = [
1144
+ z("div", { class: "connection-dot" }, null, -1)
1145
+ ])], 34)) : q("", !0),
1146
+ z("div", {
1147
1147
  ref: "leftResizeHandle",
1148
- class: q(["resize-handle left-resize-handle", { "is-dragging": $(F) }])
1149
- }, [...o[4] || (o[4] = [
1150
- N("div", { class: "handle-grip" }, null, -1),
1151
- N("div", { class: "vertical-indicator left-indicator" }, null, -1)
1148
+ class: ee(["resize-handle left-resize-handle", { "is-dragging": R(_) }])
1149
+ }, [...M[4] || (M[4] = [
1150
+ z("div", { class: "handle-grip" }, null, -1),
1151
+ z("div", { class: "vertical-indicator left-indicator" }, null, -1)
1152
1152
  ])], 2),
1153
- e.label ? (M(), P("label", kn, ce(e.label), 1)) : J("", !0),
1154
- N("div", {
1153
+ e.label ? (C(), k("label", Bn, ge(e.label), 1)) : q("", !0),
1154
+ z("div", {
1155
1155
  ref: "rightResizeHandle",
1156
- class: q(["resize-handle right-resize-handle", { "is-dragging": $(_) }])
1157
- }, [...o[5] || (o[5] = [
1158
- N("div", { class: "handle-grip" }, null, -1),
1159
- N("div", { class: "vertical-indicator right-indicator" }, null, -1)
1156
+ class: ee(["resize-handle right-resize-handle", { "is-dragging": R(fe) }])
1157
+ }, [...M[5] || (M[5] = [
1158
+ z("div", { class: "handle-grip" }, null, -1),
1159
+ z("div", { class: "vertical-indicator right-indicator" }, null, -1)
1160
1160
  ])], 2)
1161
- ], 46, In)
1161
+ ], 46, Nn)
1162
1162
  ], 512),
1163
- e.store.isDependencyGraphEnabled && X.value ? (M(), P("svg", {
1163
+ e.store.isDependencyGraphEnabled && J.value ? (C(), k("svg", {
1164
1164
  key: 0,
1165
- style: ee(z.value)
1165
+ style: re(W.value)
1166
1166
  }, [
1167
- N("line", {
1168
- x1: A.value.startX,
1169
- y1: A.value.startY,
1170
- x2: A.value.endX,
1171
- y2: A.value.endY,
1167
+ z("line", {
1168
+ x1: O.value.startX,
1169
+ y1: O.value.startY,
1170
+ x2: O.value.endX,
1171
+ y2: O.value.endY,
1172
1172
  stroke: "#2196f3",
1173
1173
  "stroke-width": "2",
1174
1174
  "stroke-dasharray": "5,5"
1175
- }, null, 8, $n)
1176
- ], 4)) : J("", !0)
1177
- ], 8, Cn));
1175
+ }, null, 8, zn)
1176
+ ], 4)) : q("", !0)
1177
+ ], 8, Ln));
1178
1178
  }
1179
- }), Sn = /* @__PURE__ */ re(Rn, [["__scopeId", "data-v-8917a8a3"]]), Mn = ["tabindex"], An = /* @__PURE__ */ ne({
1179
+ }), Wn = /* @__PURE__ */ he(Fn, [["__scopeId", "data-v-8917a8a3"]]), Xn = ["tabindex"], Gn = /* @__PURE__ */ ue({
1180
1180
  __name: "ARow",
1181
1181
  props: {
1182
1182
  rowIndex: {},
@@ -1185,71 +1185,71 @@ const dn = (e) => {
1185
1185
  addNavigation: { type: [Boolean, Object], default: !1 }
1186
1186
  },
1187
1187
  setup(e) {
1188
- const t = U("rowEl"), s = D(() => e.store.isRowVisible(e.rowIndex)), c = D(() => e.store.getRowExpandSymbol(e.rowIndex));
1188
+ const t = le("rowEl"), a = A(() => e.store.isRowVisible(e.rowIndex)), d = A(() => e.store.getRowExpandSymbol(e.rowIndex));
1189
1189
  if (e.addNavigation) {
1190
- let u = Se;
1191
- typeof e.addNavigation == "object" && (u = {
1192
- ...u,
1190
+ let c = ze;
1191
+ typeof e.addNavigation == "object" && (c = {
1192
+ ...c,
1193
1193
  ...e.addNavigation
1194
- }), qe([
1194
+ }), it([
1195
1195
  {
1196
1196
  selectors: t,
1197
- handlers: u
1197
+ handlers: c
1198
1198
  }
1199
1199
  ]);
1200
1200
  }
1201
- return (u, r) => Re((M(), P("tr", {
1201
+ return (c, i) => oe((C(), k("tr", {
1202
1202
  ref: "rowEl",
1203
1203
  tabindex: e.tabIndex,
1204
1204
  class: "atable-row"
1205
1205
  }, [
1206
- e.store.config.view !== "uncounted" ? Y(u.$slots, "index", { key: 0 }, () => [
1207
- e.store.config.view === "list" ? (M(), P("td", {
1206
+ e.store.config.view !== "uncounted" ? te(c.$slots, "index", { key: 0 }, () => [
1207
+ e.store.config.view === "list" ? (C(), k("td", {
1208
1208
  key: 0,
1209
1209
  tabIndex: -1,
1210
- class: q(["list-index", e.store.hasPinnedColumns ? "sticky-index" : ""])
1211
- }, ce(e.rowIndex + 1), 3)) : e.store.isTreeView ? (M(), P("td", {
1210
+ class: ee(["list-index", e.store.hasPinnedColumns ? "sticky-index" : ""])
1211
+ }, ge(e.rowIndex + 1), 3)) : e.store.isTreeView ? (C(), k("td", {
1212
1212
  key: 1,
1213
1213
  tabIndex: -1,
1214
- class: q(["tree-index", e.store.hasPinnedColumns ? "sticky-index" : ""]),
1215
- onClick: r[0] || (r[0] = (l) => e.store.toggleRowExpand(e.rowIndex))
1216
- }, ce(c.value), 3)) : J("", !0)
1217
- ], !0) : J("", !0),
1218
- Y(u.$slots, "default", {}, void 0, !0)
1219
- ], 8, Mn)), [
1220
- [gt, s.value]
1214
+ class: ee(["tree-index", e.store.hasPinnedColumns ? "sticky-index" : ""]),
1215
+ onClick: i[0] || (i[0] = (o) => e.store.toggleRowExpand(e.rowIndex))
1216
+ }, ge(d.value), 3)) : q("", !0)
1217
+ ], !0) : q("", !0),
1218
+ te(c.$slots, "default", {}, void 0, !0)
1219
+ ], 8, Xn)), [
1220
+ [$t, a.value]
1221
1221
  ]);
1222
1222
  }
1223
- }), pt = /* @__PURE__ */ re(An, [["__scopeId", "data-v-0fa91f83"]]), ze = /* @__PURE__ */ new WeakMap(), Tn = {
1223
+ }), Mt = /* @__PURE__ */ he(Gn, [["__scopeId", "data-v-0fa91f83"]]), Ke = /* @__PURE__ */ new WeakMap(), Yn = {
1224
1224
  mounted(e, t) {
1225
- const s = !t.modifiers.bubble;
1226
- let c;
1227
- if (typeof t.value == "function") c = dt(e, t.value, { capture: s });
1225
+ const a = !t.modifiers.bubble;
1226
+ let d;
1227
+ if (typeof t.value == "function") d = Ct(e, t.value, { capture: a });
1228
1228
  else {
1229
- const [u, r] = t.value;
1230
- c = dt(e, u, Object.assign({ capture: s }, r));
1229
+ const [c, i] = t.value;
1230
+ d = Ct(e, c, Object.assign({ capture: a }, i));
1231
1231
  }
1232
- ze.set(e, c);
1232
+ Ke.set(e, d);
1233
1233
  },
1234
1234
  unmounted(e) {
1235
- const t = ze.get(e);
1236
- t && typeof t == "function" ? t() : t?.stop(), ze.delete(e);
1235
+ const t = Ke.get(e);
1236
+ t && typeof t == "function" ? t() : t?.stop(), Ke.delete(e);
1237
1237
  }
1238
- }, Dn = { mounted(e, t) {
1239
- typeof t.value == "function" ? We(e, t.value) : We(e, ...t.value);
1238
+ }, Un = { mounted(e, t) {
1239
+ typeof t.value == "function" ? _e(e, t.value) : _e(e, ...t.value);
1240
1240
  } };
1241
- function On() {
1241
+ function jn() {
1242
1242
  let e = !1;
1243
- const t = V(!1);
1244
- return (s, c) => {
1245
- if (t.value = c.value, e) return;
1243
+ const t = Z(!1);
1244
+ return (a, d) => {
1245
+ if (t.value = d.value, e) return;
1246
1246
  e = !0;
1247
- const u = un(s, c.value);
1248
- j(t, (r) => u.value = r);
1247
+ const c = kn(a, d.value);
1248
+ ne(t, (i) => c.value = i);
1249
1249
  };
1250
1250
  }
1251
- On();
1252
- const Hn = { class: "gantt-connection-overlay" }, Pn = {
1251
+ jn();
1252
+ const qn = { class: "gantt-connection-overlay" }, Jn = {
1253
1253
  class: "connection-svg",
1254
1254
  style: {
1255
1255
  position: "absolute",
@@ -1260,39 +1260,39 @@ const Hn = { class: "gantt-connection-overlay" }, Pn = {
1260
1260
  pointerEvents: "none",
1261
1261
  zIndex: 1
1262
1262
  }
1263
- }, Ln = ["d", "stroke-width", "onDblclick"], Bn = ["id", "d", "stroke", "stroke-width", "onDblclick"], zn = 0.25, Ce = 16, Wn = /* @__PURE__ */ ne({
1263
+ }, Zn = ["d", "stroke-width", "onDblclick"], Qn = ["id", "d", "stroke", "stroke-width", "onDblclick"], Kn = 0.25, Le = 16, _n = /* @__PURE__ */ ue({
1264
1264
  __name: "AGanttConnection",
1265
1265
  props: {
1266
1266
  store: {}
1267
1267
  },
1268
1268
  emits: ["connection:delete"],
1269
1269
  setup(e, { emit: t }) {
1270
- const s = t, c = D(() => e.store.connectionPaths.filter((l) => {
1271
- const n = e.store.ganttBars.find((d) => d.id === l.from.barId), a = e.store.ganttBars.find((d) => d.id === l.to.barId);
1272
- return n && a;
1273
- })), u = (l) => {
1270
+ const a = t, d = A(() => e.store.connectionPaths.filter((o) => {
1271
+ const n = e.store.ganttBars.find((s) => s.id === o.from.barId), l = e.store.ganttBars.find((s) => s.id === o.to.barId);
1272
+ return n && l;
1273
+ })), c = (o) => {
1274
1274
  const n = e.store.connectionHandles.find(
1275
- (x) => x.barId === l.from.barId && x.side === l.from.side
1276
- ), a = e.store.connectionHandles.find(
1277
- (x) => x.barId === l.to.barId && x.side === l.to.side
1275
+ (y) => y.barId === o.from.barId && y.side === o.from.side
1276
+ ), l = e.store.connectionHandles.find(
1277
+ (y) => y.barId === o.to.barId && y.side === o.to.side
1278
1278
  );
1279
- if (!n || !a) return "";
1280
- const d = n.position.x + Ce / 2, v = n.position.y + Ce / 2, p = a.position.x + Ce / 2, E = a.position.y + Ce / 2, h = Math.abs(p - d), b = Math.max(h * zn, 50), w = d + (l.from.side === "left" ? -b : b), f = p + (l.to.side === "left" ? -b : b), m = { x: 0.5 * d + 0.5 * w, y: 0.5 * v + 0.5 * v }, y = { x: 0.5 * w + 0.5 * f, y: 0.5 * v + 0.5 * E }, L = { x: 0.5 * f + 0.5 * p, y: 0.5 * E + 0.5 * E }, B = { x: 0.5 * m.x + 0.5 * y.x, y: 0.5 * m.y + 0.5 * y.y }, X = { x: 0.5 * y.x + 0.5 * L.x, y: 0.5 * y.y + 0.5 * L.y }, A = { x: 0.5 * B.x + 0.5 * X.x, y: 0.5 * B.y + 0.5 * X.y };
1281
- return `M ${d} ${v} Q ${w} ${v}, ${A.x} ${A.y} Q ${f} ${E}, ${p} ${E}`;
1282
- }, r = (l) => {
1283
- e.store.deleteConnection(l.id) && s("connection:delete", l);
1279
+ if (!n || !l) return "";
1280
+ const s = n.position.x + Le / 2, u = n.position.y + Le / 2, h = l.position.x + Le / 2, $ = l.position.y + Le / 2, g = Math.abs(h - s), I = Math.max(g * Kn, 50), x = s + (o.from.side === "left" ? -I : I), v = h + (o.to.side === "left" ? -I : I), m = { x: 0.5 * s + 0.5 * x, y: 0.5 * u + 0.5 * u }, b = { x: 0.5 * x + 0.5 * v, y: 0.5 * u + 0.5 * $ }, V = { x: 0.5 * v + 0.5 * h, y: 0.5 * $ + 0.5 * $ }, L = { x: 0.5 * m.x + 0.5 * b.x, y: 0.5 * m.y + 0.5 * b.y }, J = { x: 0.5 * b.x + 0.5 * V.x, y: 0.5 * b.y + 0.5 * V.y }, O = { x: 0.5 * L.x + 0.5 * J.x, y: 0.5 * L.y + 0.5 * J.y };
1281
+ return `M ${s} ${u} Q ${x} ${u}, ${O.x} ${O.y} Q ${v} ${$}, ${h} ${$}`;
1282
+ }, i = (o) => {
1283
+ e.store.deleteConnection(o.id) && a("connection:delete", o);
1284
1284
  };
1285
- return (l, n) => (M(), P("div", Hn, [
1286
- (M(), P("svg", Pn, [
1287
- n[0] || (n[0] = N("defs", null, [
1288
- N("path", {
1285
+ return (o, n) => (C(), k("div", qn, [
1286
+ (C(), k("svg", Jn, [
1287
+ n[0] || (n[0] = z("defs", null, [
1288
+ z("path", {
1289
1289
  id: "arrowhead",
1290
1290
  d: "M 0 -7 L 20 0 L 0 7Z",
1291
1291
  stroke: "black",
1292
1292
  "stroke-width": "1",
1293
1293
  fill: "currentColor"
1294
1294
  }),
1295
- N("marker", {
1295
+ z("marker", {
1296
1296
  id: "arrowhead-marker",
1297
1297
  markerWidth: "10",
1298
1298
  markerHeight: "7",
@@ -1301,135 +1301,281 @@ const Hn = { class: "gantt-connection-overlay" }, Pn = {
1301
1301
  orient: "auto",
1302
1302
  markerUnits: "strokeWidth"
1303
1303
  }, [
1304
- N("polygon", {
1304
+ z("polygon", {
1305
1305
  points: "0 0, 10 3.5, 0 7",
1306
1306
  fill: "currentColor"
1307
1307
  })
1308
1308
  ])
1309
1309
  ], -1)),
1310
- (M(!0), P(se, null, me(c.value, (a) => (M(), P("path", {
1311
- key: `${a.id}-hitbox`,
1312
- d: u(a),
1310
+ (C(!0), k(ie, null, ye(d.value, (l) => (C(), k("path", {
1311
+ key: `${l.id}-hitbox`,
1312
+ d: c(l),
1313
1313
  stroke: "transparent",
1314
- "stroke-width": (a.style?.width || 2) + 10,
1314
+ "stroke-width": (l.style?.width || 2) + 10,
1315
1315
  fill: "none",
1316
1316
  class: "connection-hitbox",
1317
- onDblclick: (d) => r(a)
1318
- }, null, 40, Ln))), 128)),
1319
- (M(!0), P(se, null, me(c.value, (a) => (M(), P("path", {
1320
- id: a.id,
1321
- key: a.id,
1322
- d: u(a),
1323
- stroke: a.style?.color || "#666",
1324
- "stroke-width": a.style?.width || 2,
1317
+ onDblclick: (s) => i(l)
1318
+ }, null, 40, Zn))), 128)),
1319
+ (C(!0), k(ie, null, ye(d.value, (l) => (C(), k("path", {
1320
+ id: l.id,
1321
+ key: l.id,
1322
+ d: c(l),
1323
+ stroke: l.style?.color || "#666",
1324
+ "stroke-width": l.style?.width || 2,
1325
1325
  fill: "none",
1326
1326
  "marker-mid": "url(#arrowhead-marker)",
1327
1327
  class: "connection-path animated-path",
1328
- onDblclick: (d) => r(a)
1329
- }, null, 40, Bn))), 128))
1328
+ onDblclick: (s) => i(l)
1329
+ }, null, 40, Qn))), 128))
1330
1330
  ]))
1331
1331
  ]));
1332
1332
  }
1333
- }), Nn = /* @__PURE__ */ re(Wn, [["__scopeId", "data-v-71911260"]]), Gn = { key: 0 }, Xn = {
1333
+ }), eo = /* @__PURE__ */ he(_n, [["__scopeId", "data-v-71911260"]]), to = { class: "column-filter" }, no = {
1334
+ key: 2,
1335
+ class: "checkbox-filter"
1336
+ }, oo = ["value"], lo = {
1337
+ key: 5,
1338
+ class: "date-range-filter"
1339
+ }, ao = /* @__PURE__ */ ue({
1340
+ __name: "ATableColumnFilter",
1341
+ props: {
1342
+ column: {},
1343
+ colIndex: {},
1344
+ store: {}
1345
+ },
1346
+ setup(e) {
1347
+ const t = B(""), a = Ft({
1348
+ startValue: "",
1349
+ endValue: ""
1350
+ }), d = (l) => {
1351
+ if (l.filterOptions) return l.filterOptions;
1352
+ const s = /* @__PURE__ */ new Set();
1353
+ return e.store.rows.forEach((u) => {
1354
+ const h = u[l.name];
1355
+ h != null && h !== "" && s.add(h);
1356
+ }), Array.from(s).map((u) => ({
1357
+ value: u,
1358
+ label: String(u)
1359
+ }));
1360
+ }, c = A(() => !!(t.value || a.startValue || a.endValue)), i = (l) => {
1361
+ !l && e.column.filterType !== "checkbox" ? (e.store.clearFilter(e.colIndex), t.value = "") : (t.value = l, e.store.setFilter(e.colIndex, { value: l }));
1362
+ }, o = (l, s) => {
1363
+ l === "start" ? a.startValue = s : a.endValue = s, !a.startValue && !a.endValue ? e.store.clearFilter(e.colIndex) : e.store.setFilter(e.colIndex, {
1364
+ value: null,
1365
+ startValue: a.startValue,
1366
+ endValue: a.endValue
1367
+ });
1368
+ }, n = () => {
1369
+ t.value = "", a.startValue = "", a.endValue = "", e.store.clearFilter(e.colIndex);
1370
+ };
1371
+ return (l, s) => (C(), k("div", to, [
1372
+ (e.column.filterType || "text") === "text" ? oe((C(), k("input", {
1373
+ key: 0,
1374
+ "onUpdate:modelValue": s[0] || (s[0] = (u) => t.value = u),
1375
+ type: "text",
1376
+ class: "filter-input",
1377
+ onInput: s[1] || (s[1] = (u) => i(t.value))
1378
+ }, null, 544)), [
1379
+ [ke, t.value]
1380
+ ]) : e.column.filterType === "number" ? oe((C(), k("input", {
1381
+ key: 1,
1382
+ "onUpdate:modelValue": s[2] || (s[2] = (u) => t.value = u),
1383
+ type: "number",
1384
+ class: "filter-input",
1385
+ onInput: s[3] || (s[3] = (u) => i(t.value))
1386
+ }, null, 544)), [
1387
+ [ke, t.value]
1388
+ ]) : e.column.filterType === "checkbox" ? (C(), k("label", no, [
1389
+ oe(z("input", {
1390
+ "onUpdate:modelValue": s[4] || (s[4] = (u) => t.value = u),
1391
+ type: "checkbox",
1392
+ class: "filter-checkbox",
1393
+ onChange: s[5] || (s[5] = (u) => i(t.value))
1394
+ }, null, 544), [
1395
+ [Wt, t.value]
1396
+ ]),
1397
+ z("span", null, ge(e.column.label), 1)
1398
+ ])) : e.column.filterType === "select" ? oe((C(), k("select", {
1399
+ key: 3,
1400
+ "onUpdate:modelValue": s[6] || (s[6] = (u) => t.value = u),
1401
+ class: "filter-select",
1402
+ onChange: s[7] || (s[7] = (u) => i(t.value))
1403
+ }, [
1404
+ s[15] || (s[15] = z("option", { value: "" }, "All", -1)),
1405
+ (C(!0), k(ie, null, ye(d(e.column), (u) => (C(), k("option", {
1406
+ key: u.value || u,
1407
+ value: u.value || u
1408
+ }, ge(u.label || u), 9, oo))), 128))
1409
+ ], 544)), [
1410
+ [Xt, t.value]
1411
+ ]) : e.column.filterType === "date" ? oe((C(), k("input", {
1412
+ key: 4,
1413
+ "onUpdate:modelValue": s[8] || (s[8] = (u) => t.value = u),
1414
+ type: "date",
1415
+ class: "filter-input",
1416
+ onChange: s[9] || (s[9] = (u) => i(t.value))
1417
+ }, null, 544)), [
1418
+ [ke, t.value]
1419
+ ]) : e.column.filterType === "dateRange" ? (C(), k("div", lo, [
1420
+ oe(z("input", {
1421
+ "onUpdate:modelValue": s[10] || (s[10] = (u) => a.startValue = u),
1422
+ type: "date",
1423
+ class: "filter-input",
1424
+ onChange: s[11] || (s[11] = (u) => o("start", a.startValue))
1425
+ }, null, 544), [
1426
+ [ke, a.startValue]
1427
+ ]),
1428
+ s[16] || (s[16] = z("span", { class: "date-separator" }, "-", -1)),
1429
+ oe(z("input", {
1430
+ "onUpdate:modelValue": s[12] || (s[12] = (u) => a.endValue = u),
1431
+ type: "date",
1432
+ class: "filter-input",
1433
+ onChange: s[13] || (s[13] = (u) => o("end", a.endValue))
1434
+ }, null, 544), [
1435
+ [ke, a.endValue]
1436
+ ])
1437
+ ])) : e.column.filterType === "component" && e.column.filterComponent ? (C(), ve(Ee(e.column.filterComponent), {
1438
+ key: 6,
1439
+ value: t.value,
1440
+ column: e.column,
1441
+ colIndex: e.colIndex,
1442
+ store: e.store,
1443
+ "onUpdate:value": s[14] || (s[14] = (u) => i(u))
1444
+ }, null, 40, ["value", "column", "colIndex", "store"])) : q("", !0),
1445
+ c.value ? (C(), k("button", {
1446
+ key: 7,
1447
+ onClick: n,
1448
+ class: "clear-btn",
1449
+ title: "Clear"
1450
+ }, "×")) : q("", !0)
1451
+ ]));
1452
+ }
1453
+ }), so = /* @__PURE__ */ he(ao, [["__scopeId", "data-v-8487462d"]]), ro = { key: 0 }, io = {
1334
1454
  class: "atable-header-row",
1335
1455
  tabindex: "-1"
1336
- }, Vn = ["data-colindex"], yt = /* @__PURE__ */ ne({
1456
+ }, uo = ["data-colindex", "onClick"], co = {
1457
+ key: 0,
1458
+ class: "atable-filters-row"
1459
+ }, Tt = /* @__PURE__ */ ue({
1337
1460
  __name: "ATableHeader",
1338
1461
  props: {
1339
1462
  columns: {},
1340
1463
  store: {}
1341
1464
  },
1342
1465
  setup(e) {
1343
- const t = (s) => {
1344
- for (const c of s) {
1345
- if (c.borderBoxSize.length === 0) continue;
1346
- const r = c.borderBoxSize[0].inlineSize, l = Number(c.target.dataset.colindex), n = e.store.columns[l]?.width;
1347
- typeof n == "number" && n !== r && e.store.resizeColumn(l, r);
1466
+ const t = A(() => e.columns.filter((c) => c.filterable)), a = (c) => e.store.sortByColumn(c), d = (c) => {
1467
+ for (const i of c) {
1468
+ if (i.borderBoxSize.length === 0) continue;
1469
+ const n = i.borderBoxSize[0].inlineSize, l = Number(i.target.dataset.colindex), s = e.store.columns[l]?.width;
1470
+ typeof s == "number" && s !== n && e.store.resizeColumn(l, n);
1348
1471
  }
1349
1472
  };
1350
- return (s, c) => e.columns.length ? (M(), P("thead", Gn, [
1351
- N("tr", Xn, [
1352
- e.store.zeroColumn ? (M(), P("th", {
1473
+ return (c, i) => e.columns.length ? (C(), k("thead", ro, [
1474
+ z("tr", io, [
1475
+ e.store.zeroColumn ? (C(), k("th", {
1353
1476
  key: 0,
1354
1477
  id: "header-index",
1355
- class: q([[
1478
+ class: ee([[
1356
1479
  e.store.hasPinnedColumns ? "sticky-index" : "",
1357
1480
  e.store.isTreeView ? "tree-index" : "",
1358
1481
  e.store.config.view === "list-expansion" ? "list-expansion-index" : ""
1359
1482
  ], "list-index"])
1360
- }, null, 2)) : J("", !0),
1361
- (M(!0), P(se, null, me(e.columns, (u, r) => Re((M(), P("th", {
1362
- key: u.name,
1363
- "data-colindex": r,
1483
+ }, null, 2)) : q("", !0),
1484
+ (C(!0), k(ie, null, ye(e.columns, (o, n) => oe((C(), k("th", {
1485
+ key: o.name,
1486
+ "data-colindex": n,
1364
1487
  tabindex: "-1",
1365
- style: ee(e.store.getHeaderCellStyle(u)),
1366
- class: q(u.pinned ? "sticky-column" : "")
1488
+ style: re(e.store.getHeaderCellStyle(o)),
1489
+ class: ee(`${o.pinned ? "sticky-column" : ""} ${o.sortable === !1 ? "" : "cursor-pointer"}`),
1490
+ onClick: (l) => o.sortable !== !1 ? a(n) : void 0
1367
1491
  }, [
1368
- Y(s.$slots, "default", {}, () => [
1369
- At(ce(u.label || String.fromCharCode(r + 97).toUpperCase()), 1)
1492
+ te(c.$slots, "default", {}, () => [
1493
+ Gt(ge(o.label || String.fromCharCode(n + 97).toUpperCase()), 1)
1370
1494
  ])
1371
- ], 14, Vn)), [
1372
- [$(Dn), t]
1495
+ ], 14, uo)), [
1496
+ [R(Un), d]
1373
1497
  ])), 128))
1374
- ])
1375
- ])) : J("", !0);
1498
+ ]),
1499
+ t.value.length > 0 ? (C(), k("tr", co, [
1500
+ e.store.zeroColumn ? (C(), k("th", {
1501
+ key: 0,
1502
+ class: ee([[
1503
+ e.store.hasPinnedColumns ? "sticky-index" : "",
1504
+ e.store.isTreeView ? "tree-index" : "",
1505
+ e.store.config.view === "list-expansion" ? "list-expansion-index" : ""
1506
+ ], "list-index"])
1507
+ }, null, 2)) : q("", !0),
1508
+ (C(!0), k(ie, null, ye(e.columns, (o, n) => (C(), k("th", {
1509
+ key: `filter-${o.name}`,
1510
+ class: ee(`${o.pinned ? "sticky-column" : ""}`),
1511
+ style: re(e.store.getHeaderCellStyle(o))
1512
+ }, [
1513
+ o.filterable ? (C(), ve(so, {
1514
+ key: 0,
1515
+ column: o,
1516
+ "col-index": n,
1517
+ store: e.store
1518
+ }, null, 8, ["column", "col-index", "store"])) : q("", !0)
1519
+ ], 6))), 128))
1520
+ ])) : q("", !0)
1521
+ ])) : q("", !0);
1376
1522
  }
1377
- }), bt = /* @__PURE__ */ ne({
1523
+ }), At = /* @__PURE__ */ ue({
1378
1524
  __name: "ATableModal",
1379
1525
  props: {
1380
1526
  store: {}
1381
1527
  },
1382
1528
  setup(e) {
1383
- const t = U("amodal"), { width: s, height: c } = le(t), u = D(() => {
1529
+ const t = le("amodal"), { width: a, height: d } = xe(t), c = A(() => {
1384
1530
  if (!(e.store.modal.height && e.store.modal.width && e.store.modal.left && e.store.modal.bottom)) return;
1385
- const r = e.store.modal.cell?.closest("table");
1386
- if (!r) return {};
1387
- const l = r.offsetHeight || 0, n = r.offsetWidth || 0;
1388
- let a = e.store.modal.cell?.offsetTop || 0;
1389
- const d = r.querySelector("thead")?.offsetHeight || 0;
1390
- a += d, a = a + c.value < l ? a : a - (c.value + e.store.modal.height);
1391
- let v = e.store.modal.cell?.offsetLeft || 0;
1392
- return v = v + s.value <= n ? v : v - (s.value - e.store.modal.width), {
1393
- left: `${v}px`,
1394
- top: `${a}px`
1531
+ const i = e.store.modal.cell?.closest("table");
1532
+ if (!i) return {};
1533
+ const o = i.offsetHeight || 0, n = i.offsetWidth || 0;
1534
+ let l = e.store.modal.cell?.offsetTop || 0;
1535
+ const s = i.querySelector("thead")?.offsetHeight || 0;
1536
+ l += s, l = l + d.value < o ? l : l - (d.value + e.store.modal.height);
1537
+ let u = e.store.modal.cell?.offsetLeft || 0;
1538
+ return u = u + a.value <= n ? u : u - (a.value - e.store.modal.width), {
1539
+ left: `${u}px`,
1540
+ top: `${l}px`
1395
1541
  };
1396
1542
  });
1397
- return (r, l) => (M(), P("div", {
1543
+ return (i, o) => (C(), k("div", {
1398
1544
  ref: "amodal",
1399
1545
  class: "amodal",
1400
1546
  tabindex: "-1",
1401
- style: ee(u.value),
1402
- onClick: l[0] || (l[0] = $e(() => {
1547
+ style: re(c.value),
1548
+ onClick: o[0] || (o[0] = Be(() => {
1403
1549
  }, ["stop"])),
1404
- onInput: l[1] || (l[1] = $e(() => {
1550
+ onInput: o[1] || (o[1] = Be(() => {
1405
1551
  }, ["stop"]))
1406
1552
  }, [
1407
- Y(r.$slots, "default")
1553
+ te(i.$slots, "default")
1408
1554
  ], 36));
1409
1555
  }
1410
- }), Fn = (e) => {
1411
- const t = e.id || fn();
1412
- return Tt(`table-${t}`, () => {
1413
- const c = () => {
1414
- const o = [Object.assign({}, { rowModified: !1 })], i = /* @__PURE__ */ new Set();
1415
- for (let k = 0; k < r.value.length; k++) {
1416
- const S = r.value[k];
1417
- S.parent !== null && S.parent !== void 0 && i.add(S.parent);
1556
+ }), fo = (e) => {
1557
+ const t = e.id || $n();
1558
+ return Yt(`table-${t}`, () => {
1559
+ const d = () => {
1560
+ const r = [Object.assign({}, { rowModified: !1 })], f = /* @__PURE__ */ new Set();
1561
+ for (let p = 0; p < i.value.length; p++) {
1562
+ const S = i.value[p];
1563
+ S.parent !== null && S.parent !== void 0 && f.add(S.parent);
1418
1564
  }
1419
- const g = (k) => r.value[k]?.gantt !== void 0, C = (k) => {
1420
- for (let S = 0; S < r.value.length; S++)
1421
- if (r.value[S].parent === k && (g(S) || C(S)))
1565
+ const w = (p) => i.value[p]?.gantt !== void 0, T = (p) => {
1566
+ for (let S = 0; S < i.value.length; S++)
1567
+ if (i.value[S].parent === p && (w(S) || T(S)))
1422
1568
  return !0;
1423
1569
  return !1;
1424
- }, H = (k) => {
1425
- const S = l.value, oe = S.view === "tree" || S.view === "tree-gantt" ? S.defaultTreeExpansion : void 0;
1426
- if (!oe) return !0;
1427
- switch (oe) {
1570
+ }, N = (p) => {
1571
+ const S = o.value, U = S.view === "tree" || S.view === "tree-gantt" ? S.defaultTreeExpansion : void 0;
1572
+ if (!U) return !0;
1573
+ switch (U) {
1428
1574
  case "root":
1429
1575
  return !1;
1430
1576
  // Only root nodes are visible, all children start collapsed
1431
1577
  case "branch":
1432
- return C(k);
1578
+ return T(p);
1433
1579
  case "leaf":
1434
1580
  return !0;
1435
1581
  // All nodes should be expanded
@@ -1437,204 +1583,287 @@ const Hn = { class: "gantt-connection-overlay" }, Pn = {
1437
1583
  return !0;
1438
1584
  }
1439
1585
  };
1440
- for (let k = 0; k < r.value.length; k++) {
1441
- const S = r.value[k], oe = S.parent === null || S.parent === void 0, ye = i.has(k);
1442
- o[k] = {
1443
- childrenOpen: H(k),
1586
+ for (let p = 0; p < i.value.length; p++) {
1587
+ const S = i.value[p], U = S.parent === null || S.parent === void 0, ae = f.has(p);
1588
+ r[p] = {
1589
+ childrenOpen: N(p),
1444
1590
  expanded: !1,
1445
1591
  indent: S.indent || 0,
1446
- isParent: ye,
1447
- isRoot: oe,
1592
+ isParent: ae,
1593
+ isRoot: U,
1448
1594
  rowModified: !1,
1449
- open: oe,
1595
+ open: U,
1450
1596
  // This will be recalculated later for non-root nodes
1451
1597
  parent: S.parent
1452
1598
  };
1453
1599
  }
1454
- return o;
1455
- }, u = W(e.columns), r = W(e.rows), l = W(e.config || {}), n = W({}), a = W({}), d = D(() => {
1456
- const o = {};
1457
- for (const [i, g] of u.value.entries())
1458
- for (const [C, H] of r.value.entries())
1459
- o[`${i}:${C}`] = H[g.name];
1460
- return o;
1461
- }), v = D({
1600
+ return r;
1601
+ }, c = B(e.columns), i = B(e.rows), o = B(e.config || {}), n = B({}), l = B({}), s = A(() => {
1602
+ const r = {};
1603
+ for (const [f, w] of c.value.entries())
1604
+ for (const [T, N] of i.value.entries())
1605
+ r[`${f}:${T}`] = N[w.name];
1606
+ return r;
1607
+ }), u = A({
1462
1608
  get: () => {
1463
- const o = c();
1464
- for (let i = 0; i < o.length; i++)
1465
- n.value[i] && (o[i].rowModified = n.value[i]), a.value[i] && (a.value[i].childrenOpen !== void 0 && (o[i].childrenOpen = a.value[i].childrenOpen), a.value[i].expanded !== void 0 && (o[i].expanded = a.value[i].expanded));
1466
- if (y.value) {
1467
- const i = (g, C) => {
1468
- const H = C[g];
1469
- if (H.isRoot || H.parent === null || H.parent === void 0)
1609
+ const r = d();
1610
+ for (let f = 0; f < r.length; f++)
1611
+ n.value[f] && (r[f].rowModified = n.value[f]), l.value[f] && (l.value[f].childrenOpen !== void 0 && (r[f].childrenOpen = l.value[f].childrenOpen), l.value[f].expanded !== void 0 && (r[f].expanded = l.value[f].expanded));
1612
+ if (L.value) {
1613
+ const f = (w, T) => {
1614
+ const N = T[w];
1615
+ if (N.isRoot || N.parent === null || N.parent === void 0)
1470
1616
  return !0;
1471
- const k = H.parent;
1472
- return k < 0 || k >= C.length ? !1 : (C[k].childrenOpen || !1) && i(k, C);
1617
+ const p = N.parent;
1618
+ return p < 0 || p >= T.length ? !1 : (T[p].childrenOpen || !1) && f(p, T);
1473
1619
  };
1474
- for (let g = 0; g < o.length; g++)
1475
- o[g].isRoot || (o[g].open = i(g, o));
1620
+ for (let w = 0; w < r.length; w++)
1621
+ r[w].isRoot || (r[w].open = f(w, r));
1476
1622
  }
1477
- return o;
1623
+ return r;
1478
1624
  },
1479
- set: (o) => {
1480
- JSON.stringify(o) !== JSON.stringify(v.value) && (v.value = o);
1625
+ set: (r) => {
1626
+ JSON.stringify(r) !== JSON.stringify(u.value) && (u.value = r);
1627
+ }
1628
+ }), h = B(e.modal || { visible: !1 }), $ = B({}), g = B([]), I = B([]), x = B([]), v = B({
1629
+ column: null,
1630
+ direction: null
1631
+ }), m = B({}), b = A(() => c.value.some((r) => r.pinned)), V = A(() => o.value.view === "gantt" || o.value.view === "tree-gantt"), L = A(() => o.value.view === "tree" || o.value.view === "tree-gantt"), J = A(() => {
1632
+ const r = o.value;
1633
+ return r.view === "gantt" || r.view === "tree-gantt" ? r.dependencyGraph !== !1 : !0;
1634
+ }), O = A(() => `${Math.ceil(i.value.length / 100 + 1)}ch`), y = A(
1635
+ () => o.value.view ? ["list", "tree", "tree-gantt", "list-expansion"].includes(o.value.view) : !1
1636
+ ), D = A(() => {
1637
+ let r = i.value.map((f, w) => ({
1638
+ ...f,
1639
+ originalIndex: w
1640
+ }));
1641
+ if (Object.entries(m.value).forEach(([f, w]) => {
1642
+ const T = parseInt(f), N = c.value[T];
1643
+ !N || !(w.value || w.startValue || w.endValue || N.filterType === "checkbox" && w.value !== void 0) || (r = r.filter((S) => {
1644
+ const U = S[N.name];
1645
+ return j(U, w, N);
1646
+ }));
1647
+ }), v.value.column !== null && v.value.direction) {
1648
+ const f = c.value[v.value.column], w = v.value.direction;
1649
+ r.sort((T, N) => {
1650
+ let p = T[f.name], S = N[f.name];
1651
+ p == null && (p = ""), S == null && (S = "");
1652
+ const U = Number(p), ae = Number(S);
1653
+ if (!isNaN(U) && !isNaN(ae) && p !== "" && S !== "")
1654
+ return w === "asc" ? U - ae : ae - U;
1655
+ {
1656
+ const ct = String(p).toLowerCase(), dt = String(S).toLowerCase();
1657
+ return w === "asc" ? ct.localeCompare(dt) : dt.localeCompare(ct);
1658
+ }
1659
+ });
1481
1660
  }
1482
- }), p = W(e.modal || { visible: !1 }), E = W({}), h = W([]), b = W([]), w = W([]), f = D(() => u.value.some((o) => o.pinned)), m = D(() => l.value.view === "gantt" || l.value.view === "tree-gantt"), y = D(() => l.value.view === "tree" || l.value.view === "tree-gantt"), L = D(() => {
1483
- const o = l.value;
1484
- return o.view === "gantt" || o.view === "tree-gantt" ? o.dependencyGraph !== !1 : !0;
1485
- }), B = D(() => `${Math.ceil(r.value.length / 100 + 1)}ch`), X = D(
1486
- () => l.value.view ? ["list", "tree", "tree-gantt", "list-expansion"].includes(l.value.view) : !1
1487
- ), A = (o, i) => d.value[`${o}:${i}`], x = (o, i, g) => {
1488
- const C = `${o}:${i}`, H = u.value[o];
1489
- d.value[C] !== g && (n.value[i] = !0), d.value[C] = g, r.value[i] = {
1490
- ...r.value[i],
1491
- [H.name]: g
1661
+ return r;
1662
+ }), G = (r, f) => s.value[`${r}:${f}`], W = (r, f, w) => {
1663
+ const T = `${r}:${f}`, N = c.value[r];
1664
+ s.value[T] !== w && (n.value[f] = !0), s.value[T] = w, i.value[f] = {
1665
+ ...i.value[f],
1666
+ [N.name]: w
1492
1667
  };
1493
- }, R = (o) => {
1494
- r.value = o;
1495
- }, G = (o, i, g) => {
1496
- const C = `${o}:${i}`;
1497
- d.value[C] !== g && (n.value[i] = !0, E.value[C] = g);
1498
- }, z = (o) => {
1499
- const i = u.value.indexOf(o) === u.value.length - 1, g = l.value.fullWidth ? o.resizable && !i : o.resizable;
1668
+ }, H = (r) => {
1669
+ i.value = r;
1670
+ }, _ = (r, f, w) => {
1671
+ const T = `${r}:${f}`;
1672
+ s.value[T] !== w && (n.value[f] = !0, $.value[T] = w);
1673
+ }, fe = (r) => {
1674
+ const f = c.value.indexOf(r) === c.value.length - 1, w = o.value.fullWidth ? r.resizable && !f : r.resizable;
1500
1675
  return {
1501
- width: o.width || "40ch",
1502
- textAlign: o.align || "center",
1503
- ...g && {
1676
+ width: r.width || "40ch",
1677
+ textAlign: r.align || "center",
1678
+ ...w && {
1504
1679
  resize: "horizontal",
1505
1680
  overflow: "hidden",
1506
1681
  whiteSpace: "nowrap"
1507
1682
  }
1508
1683
  };
1509
- }, O = (o, i) => {
1510
- if (o < 0 || o >= u.value.length) return;
1511
- const C = Math.max(i, 40);
1512
- u.value[o] = {
1513
- ...u.value[o],
1514
- width: `${C}px`
1684
+ }, Re = (r, f) => {
1685
+ if (r < 0 || r >= c.value.length) return;
1686
+ const T = Math.max(f, 40);
1687
+ c.value[r] = {
1688
+ ...c.value[r],
1689
+ width: `${T}px`
1515
1690
  };
1516
- }, F = (o) => {
1517
- const i = r.value[o];
1518
- return m.value && i.gantt !== void 0;
1519
- }, _ = (o) => !y.value || v.value[o].isRoot || v.value[o].open, we = (o) => !y.value && l.value.view !== "list-expansion" ? "" : y.value && (v.value[o].isRoot || v.value[o].isParent) ? v.value[o].childrenOpen ? "▼" : "►" : l.value.view === "list-expansion" ? v.value[o].expanded ? "▼" : "►" : "", ve = (o) => {
1520
- if (y.value) {
1521
- const i = a.value[o] || {}, C = !(i.childrenOpen ?? v.value[o].childrenOpen);
1522
- a.value[o] = {
1523
- ...i,
1524
- childrenOpen: C
1525
- }, C || xe(o);
1526
- } else if (l.value.view === "list-expansion") {
1527
- const i = a.value[o] || {}, g = i.expanded ?? v.value[o].expanded;
1528
- a.value[o] = {
1529
- ...i,
1530
- expanded: !g
1691
+ }, Ie = (r) => {
1692
+ const f = i.value[r];
1693
+ return V.value && f.gantt !== void 0;
1694
+ }, We = (r) => !L.value || u.value[r].isRoot || u.value[r].open, Xe = (r) => !L.value && o.value.view !== "list-expansion" ? "" : L.value && (u.value[r].isRoot || u.value[r].isParent) ? u.value[r].childrenOpen ? "▼" : "►" : o.value.view === "list-expansion" ? u.value[r].expanded ? "▼" : "►" : "", Ge = (r) => {
1695
+ if (L.value) {
1696
+ const f = l.value[r] || {}, T = !(f.childrenOpen ?? u.value[r].childrenOpen);
1697
+ l.value[r] = {
1698
+ ...f,
1699
+ childrenOpen: T
1700
+ }, T || De(r);
1701
+ } else if (o.value.view === "list-expansion") {
1702
+ const f = l.value[r] || {}, w = f.expanded ?? u.value[r].expanded;
1703
+ l.value[r] = {
1704
+ ...f,
1705
+ expanded: !w
1531
1706
  };
1532
1707
  }
1533
- }, xe = (o) => {
1534
- for (let i = 0; i < r.value.length; i++)
1535
- if (v.value[i].parent === o) {
1536
- const g = a.value[i] || {};
1537
- a.value[i] = {
1538
- ...g,
1708
+ }, De = (r) => {
1709
+ for (let f = 0; f < i.value.length; f++)
1710
+ if (u.value[f].parent === r) {
1711
+ const w = l.value[f] || {};
1712
+ l.value[f] = {
1713
+ ...w,
1539
1714
  childrenOpen: !1
1540
- }, xe(i);
1715
+ }, De(f);
1541
1716
  }
1542
- }, Ae = (o, i) => {
1543
- const g = A(o, i);
1544
- return pe(o, i, g);
1545
- }, pe = (o, i, g) => {
1546
- const C = u.value[o], H = r.value[i], k = C.format;
1547
- return k ? typeof k == "function" ? k(g, { table: d.value, row: H, column: C }) : typeof k == "string" ? Function(`"use strict";return (${k})`)()(g, { table: d.value, row: H, column: C }) : g : g;
1717
+ }, Ye = (r, f) => {
1718
+ const w = G(r, f);
1719
+ return Me(r, f, w);
1720
+ }, Me = (r, f, w) => {
1721
+ const T = c.value[r], N = i.value[f], p = T.format;
1722
+ return p ? typeof p == "function" ? p(w, { table: s.value, row: N, column: T }) : typeof p == "string" ? Function(`"use strict";return (${p})`)()(w, { table: s.value, row: N, column: T }) : w : w;
1723
+ }, Ue = (r) => {
1724
+ r.target instanceof Node && h.value.parent?.contains(r.target) || h.value.visible && (h.value.visible = !1);
1725
+ }, je = (r, f) => f && r === 0 && f > 0 ? `${f}ch` : "inherit", qe = (r) => {
1726
+ const f = i.value[r.rowIndex]?.gantt;
1727
+ f && (r.type === "resize" ? r.edge === "start" ? (f.startIndex = r.newStart, f.endIndex = r.end, f.colspan = f.endIndex - f.startIndex) : r.edge === "end" && (f.startIndex = r.start, f.endIndex = r.newEnd, f.colspan = f.endIndex - f.startIndex) : r.type === "bar" && (f.startIndex = r.newStart, f.endIndex = r.newEnd, f.colspan = f.endIndex - f.startIndex));
1728
+ }, Te = (r) => {
1729
+ const f = g.value.findIndex((w) => w.id === r.id);
1730
+ f >= 0 ? g.value[f] = r : g.value.push(r);
1731
+ }, Ae = (r) => {
1732
+ const f = g.value.findIndex((w) => w.id === r);
1733
+ f >= 0 && g.value.splice(f, 1);
1734
+ }, Oe = (r) => {
1735
+ const f = I.value.findIndex((w) => w.id === r.id);
1736
+ f >= 0 ? I.value[f] = r : I.value.push(r);
1737
+ }, Pe = (r) => {
1738
+ const f = I.value.findIndex((w) => w.id === r);
1739
+ f >= 0 && I.value.splice(f, 1);
1740
+ }, E = (r, f, w) => {
1741
+ const T = I.value.find((S) => S.id === r), N = I.value.find((S) => S.id === f);
1742
+ if (!T || !N)
1743
+ return console.warn("Cannot create connection: handle not found"), null;
1744
+ const p = {
1745
+ id: `connection-${r}-${f}`,
1746
+ from: {
1747
+ barId: T.barId,
1748
+ side: T.side
1749
+ },
1750
+ to: {
1751
+ barId: N.barId,
1752
+ side: N.side
1753
+ },
1754
+ style: w?.style,
1755
+ label: w?.label
1756
+ };
1757
+ return x.value.push(p), p;
1758
+ }, M = (r) => {
1759
+ const f = x.value.findIndex((w) => w.id === r);
1760
+ return f >= 0 ? (x.value.splice(f, 1), !0) : !1;
1761
+ }, X = (r) => x.value.filter((f) => f.from.barId === r || f.to.barId === r), F = (r) => I.value.filter((f) => f.barId === r), Y = (r) => {
1762
+ if (c.value[r].sortable === !1) return;
1763
+ let w;
1764
+ v.value.column === r && v.value.direction === "asc" ? w = "desc" : w = "asc", v.value.column = r, v.value.direction = w;
1765
+ }, j = (r, f, w) => {
1766
+ const T = w.filterType || "text", N = f.value;
1767
+ if (!N && T !== "dateRange" && T !== "checkbox") return !0;
1768
+ switch (T) {
1769
+ case "text": {
1770
+ let p = "";
1771
+ return typeof r == "object" && r !== null ? p = Object.values(r).join(" ") : p = String(r || ""), p.toLowerCase().includes(String(N).toLowerCase());
1772
+ }
1773
+ case "number": {
1774
+ const p = Number(r), S = Number(N);
1775
+ return !isNaN(p) && !isNaN(S) && p === S;
1776
+ }
1777
+ case "select":
1778
+ return r === N;
1779
+ case "checkbox":
1780
+ return N === !0 ? !!r : !0;
1781
+ case "date": {
1782
+ let p;
1783
+ if (typeof r == "number") {
1784
+ const U = new Date(r), ae = (/* @__PURE__ */ new Date()).getFullYear();
1785
+ p = new Date(ae, U.getMonth(), U.getDate());
1786
+ } else
1787
+ p = new Date(String(r));
1788
+ const S = new Date(String(N));
1789
+ return p.toDateString() === S.toDateString();
1790
+ }
1791
+ case "dateRange": {
1792
+ const p = f.startValue, S = f.endValue;
1793
+ if (!p && !S) return !0;
1794
+ let U;
1795
+ if (typeof r == "number") {
1796
+ const ae = new Date(r), ut = (/* @__PURE__ */ new Date()).getFullYear();
1797
+ U = new Date(ut, ae.getMonth(), ae.getDate());
1798
+ } else
1799
+ U = new Date(String(r));
1800
+ return !(p && U < new Date(String(p)) || S && U > new Date(String(S)));
1801
+ }
1802
+ default:
1803
+ return !0;
1804
+ }
1548
1805
  };
1549
1806
  return {
1550
1807
  // state
1551
- columns: u,
1552
- config: l,
1553
- connectionHandles: b,
1554
- connectionPaths: w,
1555
- display: v,
1556
- ganttBars: h,
1557
- modal: p,
1558
- rows: r,
1559
- table: d,
1560
- updates: E,
1808
+ columns: c,
1809
+ config: o,
1810
+ connectionHandles: I,
1811
+ connectionPaths: x,
1812
+ display: u,
1813
+ filterState: m,
1814
+ ganttBars: g,
1815
+ modal: h,
1816
+ rows: i,
1817
+ sortState: v,
1818
+ table: s,
1819
+ updates: $,
1561
1820
  // getters
1562
- hasPinnedColumns: f,
1563
- isGanttView: m,
1564
- isTreeView: y,
1565
- isDependencyGraphEnabled: L,
1566
- numberedRowWidth: B,
1567
- zeroColumn: X,
1821
+ filteredRows: D,
1822
+ hasPinnedColumns: b,
1823
+ isGanttView: V,
1824
+ isTreeView: L,
1825
+ isDependencyGraphEnabled: J,
1826
+ numberedRowWidth: O,
1827
+ zeroColumn: y,
1568
1828
  // actions
1569
- closeModal: (o) => {
1570
- o.target instanceof Node && p.value.parent?.contains(o.target) || p.value.visible && (p.value.visible = !1);
1571
- },
1572
- createConnection: (o, i, g) => {
1573
- const C = b.value.find((S) => S.id === o), H = b.value.find((S) => S.id === i);
1574
- if (!C || !H)
1575
- return console.warn("Cannot create connection: handle not found"), null;
1576
- const k = {
1577
- id: `connection-${o}-${i}`,
1578
- from: {
1579
- barId: C.barId,
1580
- side: C.side
1581
- },
1582
- to: {
1583
- barId: H.barId,
1584
- side: H.side
1585
- },
1586
- style: g?.style,
1587
- label: g?.label
1588
- };
1589
- return w.value.push(k), k;
1590
- },
1591
- deleteConnection: (o) => {
1592
- const i = w.value.findIndex((g) => g.id === o);
1593
- return i >= 0 ? (w.value.splice(i, 1), !0) : !1;
1594
- },
1595
- getCellData: A,
1596
- getCellDisplayValue: Ae,
1597
- getConnectionsForBar: (o) => w.value.filter((i) => i.from.barId === o || i.to.barId === o),
1598
- getFormattedValue: pe,
1599
- getHandlesForBar: (o) => b.value.filter((i) => i.barId === o),
1600
- getHeaderCellStyle: z,
1601
- getIndent: (o, i) => i && o === 0 && i > 0 ? `${i}ch` : "inherit",
1602
- getRowExpandSymbol: we,
1603
- isRowGantt: F,
1604
- isRowVisible: _,
1605
- registerConnectionHandle: (o) => {
1606
- const i = b.value.findIndex((g) => g.id === o.id);
1607
- i >= 0 ? b.value[i] = o : b.value.push(o);
1608
- },
1609
- registerGanttBar: (o) => {
1610
- const i = h.value.findIndex((g) => g.id === o.id);
1611
- i >= 0 ? h.value[i] = o : h.value.push(o);
1612
- },
1613
- resizeColumn: O,
1614
- setCellData: x,
1615
- setCellText: G,
1616
- toggleRowExpand: ve,
1617
- unregisterConnectionHandle: (o) => {
1618
- const i = b.value.findIndex((g) => g.id === o);
1619
- i >= 0 && b.value.splice(i, 1);
1620
- },
1621
- unregisterGanttBar: (o) => {
1622
- const i = h.value.findIndex((g) => g.id === o);
1623
- i >= 0 && h.value.splice(i, 1);
1829
+ clearFilter: (r) => {
1830
+ delete m.value[r];
1624
1831
  },
1625
- updateGanttBar: (o) => {
1626
- const i = r.value[o.rowIndex]?.gantt;
1627
- i && (o.type === "resize" ? o.edge === "start" ? (i.startIndex = o.newStart, i.endIndex = o.end, i.colspan = i.endIndex - i.startIndex) : o.edge === "end" && (i.startIndex = o.start, i.endIndex = o.newEnd, i.colspan = i.endIndex - i.startIndex) : o.type === "bar" && (i.startIndex = o.newStart, i.endIndex = o.newEnd, i.colspan = i.endIndex - i.startIndex));
1832
+ closeModal: Ue,
1833
+ createConnection: E,
1834
+ deleteConnection: M,
1835
+ getCellData: G,
1836
+ getCellDisplayValue: Ye,
1837
+ getConnectionsForBar: X,
1838
+ getFormattedValue: Me,
1839
+ getHandlesForBar: F,
1840
+ getHeaderCellStyle: fe,
1841
+ getIndent: je,
1842
+ getRowExpandSymbol: Xe,
1843
+ isRowGantt: Ie,
1844
+ isRowVisible: We,
1845
+ registerConnectionHandle: Oe,
1846
+ registerGanttBar: Te,
1847
+ resizeColumn: Re,
1848
+ setCellData: W,
1849
+ setCellText: _,
1850
+ setFilter: (r, f) => {
1851
+ !f.value && !f.startValue && !f.endValue ? delete m.value[r] : m.value[r] = f;
1628
1852
  },
1629
- updateRows: R
1853
+ sortByColumn: Y,
1854
+ toggleRowExpand: Ge,
1855
+ unregisterConnectionHandle: Pe,
1856
+ unregisterGanttBar: Ae,
1857
+ updateGanttBar: qe,
1858
+ updateRows: H
1630
1859
  };
1631
1860
  })();
1632
- }, Yn = {
1861
+ }, vo = {
1633
1862
  class: "atable-container",
1634
1863
  style: { position: "relative" }
1635
- }, jn = /* @__PURE__ */ ne({
1864
+ }, mo = /* @__PURE__ */ ue({
1636
1865
  __name: "ATable",
1637
- props: /* @__PURE__ */ tt({
1866
+ props: /* @__PURE__ */ ft({
1638
1867
  id: { default: "" },
1639
1868
  config: { default: () => new Object() }
1640
1869
  }, {
@@ -1643,82 +1872,82 @@ const Hn = { class: "gantt-connection-overlay" }, Pn = {
1643
1872
  columns: { required: !0 },
1644
1873
  columnsModifiers: {}
1645
1874
  }),
1646
- emits: /* @__PURE__ */ tt(["cellUpdate", "gantt:drag", "connection:event", "columns:update"], ["update:rows", "update:columns"]),
1647
- setup(e, { expose: t, emit: s }) {
1648
- const c = nt(e, "rows"), u = nt(e, "columns"), r = s, l = U("table"), n = Fn({ columns: u.value, rows: c.value, id: e.id, config: e.config });
1649
- n.$onAction(({ name: h, store: b, args: w, after: f }) => {
1650
- if (h === "setCellData" || h === "setCellText") {
1651
- const [m, y, L] = w, B = b.getCellData(m, y);
1652
- f(() => {
1653
- c.value = [...b.rows], r("cellUpdate", { colIndex: m, rowIndex: y, newValue: L, oldValue: B });
1875
+ emits: /* @__PURE__ */ ft(["cellUpdate", "gantt:drag", "connection:event", "columns:update"], ["update:rows", "update:columns"]),
1876
+ setup(e, { expose: t, emit: a }) {
1877
+ const d = vt(e, "rows"), c = vt(e, "columns"), i = a, o = le("table"), n = fo({ columns: c.value, rows: d.value, id: e.id, config: e.config });
1878
+ n.$onAction(({ name: g, store: I, args: x, after: v }) => {
1879
+ if (g === "setCellData" || g === "setCellText") {
1880
+ const [m, b, V] = x, L = I.getCellData(m, b);
1881
+ v(() => {
1882
+ d.value = [...I.rows], i("cellUpdate", { colIndex: m, rowIndex: b, newValue: V, oldValue: L });
1654
1883
  });
1655
- } else if (h === "updateGanttBar") {
1656
- const [m] = w;
1657
- let y = !1;
1658
- m.type === "resize" ? y = m.oldColspan !== m.newColspan : m.type === "bar" && (y = m.oldStart !== m.newStart || m.oldEnd !== m.newEnd), y && f(() => {
1659
- r("gantt:drag", m);
1884
+ } else if (g === "updateGanttBar") {
1885
+ const [m] = x;
1886
+ let b = !1;
1887
+ m.type === "resize" ? b = m.oldColspan !== m.newColspan : m.type === "bar" && (b = m.oldStart !== m.newStart || m.oldEnd !== m.newEnd), b && v(() => {
1888
+ i("gantt:drag", m);
1660
1889
  });
1661
- } else h === "resizeColumn" && f(() => {
1662
- u.value = [...b.columns], r("columns:update", [...b.columns]);
1890
+ } else g === "resizeColumn" && v(() => {
1891
+ c.value = [...I.columns], i("columns:update", [...I.columns]);
1663
1892
  });
1664
- }), j(
1665
- () => c.value,
1666
- (h) => {
1667
- JSON.stringify(h) !== JSON.stringify(n.rows) && (n.rows = [...h]);
1893
+ }), ne(
1894
+ () => d.value,
1895
+ (g) => {
1896
+ JSON.stringify(g) !== JSON.stringify(n.rows) && (n.rows = [...g]);
1668
1897
  },
1669
1898
  { deep: !0 }
1670
- ), j(
1671
- u,
1672
- (h) => {
1673
- JSON.stringify(h) !== JSON.stringify(n.columns) && (n.columns = [...h], r("columns:update", [...h]));
1899
+ ), ne(
1900
+ c,
1901
+ (g) => {
1902
+ JSON.stringify(g) !== JSON.stringify(n.columns) && (n.columns = [...g], i("columns:update", [...g]));
1674
1903
  },
1675
1904
  { deep: !0 }
1676
- ), de(() => {
1677
- u.value.some((h) => h.pinned) && (d(), n.isTreeView && xt(l, d, { childList: !0, subtree: !0 }));
1905
+ ), pe(() => {
1906
+ c.value.some((g) => g.pinned) && (s(), n.isTreeView && Dt(o, s, { childList: !0, subtree: !0 }));
1678
1907
  });
1679
- const a = D(() => n.columns.filter((h) => h.pinned).length), d = () => {
1680
- const h = l.value, b = h?.rows[0], w = h?.rows[1], f = b ? Array.from(b.cells) : [];
1681
- for (const [m, y] of f.entries()) {
1682
- const L = w?.cells[m];
1683
- L && (y.style.width = `${L.offsetWidth}px`);
1908
+ const l = A(() => n.columns.filter((g) => g.pinned).length), s = () => {
1909
+ const g = o.value, I = g?.rows[0], x = g?.rows[1], v = I ? Array.from(I.cells) : [];
1910
+ for (const [m, b] of v.entries()) {
1911
+ const V = x?.cells[m];
1912
+ V && (b.style.width = `${V.offsetWidth}px`);
1684
1913
  }
1685
- for (const m of h?.rows || []) {
1686
- let y = 0;
1687
- const L = [];
1688
- for (const B of m.cells)
1689
- (B.classList.contains("sticky-column") || B.classList.contains("sticky-index")) && (B.style.left = `${y}px`, y += B.offsetWidth, L.push(B));
1690
- L.length > 0 && L[L.length - 1].classList.add("sticky-column-edge");
1914
+ for (const m of g?.rows || []) {
1915
+ let b = 0;
1916
+ const V = [];
1917
+ for (const L of m.cells)
1918
+ (L.classList.contains("sticky-column") || L.classList.contains("sticky-index")) && (L.style.left = `${b}px`, b += L.offsetWidth, V.push(L));
1919
+ V.length > 0 && V[V.length - 1].classList.add("sticky-column-edge");
1691
1920
  }
1692
1921
  };
1693
- window.addEventListener("keydown", (h) => {
1694
- if (h.key === "Escape" && n.modal.visible) {
1922
+ window.addEventListener("keydown", (g) => {
1923
+ if (g.key === "Escape" && n.modal.visible) {
1695
1924
  n.modal.visible = !1;
1696
- const b = n.modal.parent;
1697
- b && Ge().then(() => {
1698
- b.focus();
1925
+ const I = n.modal.parent;
1926
+ I && tt().then(() => {
1927
+ I.focus();
1699
1928
  });
1700
1929
  }
1701
1930
  });
1702
- const v = (h) => {
1703
- if (!h.gantt || a.value === 0)
1931
+ const u = (g) => {
1932
+ if (!g.gantt || l.value === 0)
1704
1933
  return n.columns;
1705
- const b = [];
1706
- for (let w = 0; w < a.value; w++) {
1707
- const f = { ...n.columns[w] };
1708
- f.originalIndex = w, b.push(f);
1934
+ const I = [];
1935
+ for (let x = 0; x < l.value; x++) {
1936
+ const v = { ...n.columns[x] };
1937
+ v.originalIndex = x, I.push(v);
1709
1938
  }
1710
- return b.push({
1711
- ...n.columns[a.value],
1939
+ return I.push({
1940
+ ...n.columns[l.value],
1712
1941
  isGantt: !0,
1713
- colspan: h.gantt?.colspan || n.columns.length - a.value,
1714
- originalIndex: a.value,
1942
+ colspan: g.gantt?.colspan || n.columns.length - l.value,
1943
+ originalIndex: l.value,
1715
1944
  width: "auto"
1716
1945
  // TODO: refactor to API that can detect when data exists in a cell. Might have be custom and not generalizable
1717
- }), b;
1718
- }, p = (h) => {
1719
- r("connection:event", { type: "create", connection: h });
1720
- }, E = (h) => {
1721
- r("connection:event", { type: "delete", connection: h });
1946
+ }), I;
1947
+ }, h = (g) => {
1948
+ i("connection:event", { type: "create", connection: g });
1949
+ }, $ = (g) => {
1950
+ i("connection:event", { type: "delete", connection: g });
1722
1951
  };
1723
1952
  return t({
1724
1953
  store: n,
@@ -1726,126 +1955,126 @@ const Hn = { class: "gantt-connection-overlay" }, Pn = {
1726
1955
  deleteConnection: n.deleteConnection,
1727
1956
  getConnectionsForBar: n.getConnectionsForBar,
1728
1957
  getHandlesForBar: n.getHandlesForBar
1729
- }), (h, b) => (M(), P("div", Yn, [
1730
- Re((M(), P("table", {
1958
+ }), (g, I) => (C(), k("div", vo, [
1959
+ oe((C(), k("table", {
1731
1960
  ref: "table",
1732
1961
  class: "atable",
1733
- style: ee({
1734
- width: $(n).config.fullWidth ? "100%" : "auto"
1962
+ style: re({
1963
+ width: R(n).config.fullWidth ? "100%" : "auto"
1735
1964
  })
1736
1965
  }, [
1737
- Y(h.$slots, "header", { data: $(n) }, () => [
1738
- ot(yt, {
1739
- columns: $(n).columns,
1740
- store: $(n)
1966
+ te(g.$slots, "header", { data: R(n) }, () => [
1967
+ mt(Tt, {
1968
+ columns: R(n).columns,
1969
+ store: R(n)
1741
1970
  }, null, 8, ["columns", "store"])
1742
1971
  ], !0),
1743
- N("tbody", null, [
1744
- Y(h.$slots, "body", { data: $(n) }, () => [
1745
- (M(!0), P(se, null, me($(n).rows, (w, f) => (M(), ie(pt, {
1746
- key: w.id,
1747
- row: w,
1748
- "row-index": f,
1749
- store: $(n)
1972
+ z("tbody", null, [
1973
+ te(g.$slots, "body", { data: R(n) }, () => [
1974
+ (C(!0), k(ie, null, ye(R(n).filteredRows, (x, v) => (C(), ve(Mt, {
1975
+ key: `${x.originalIndex}-${v}`,
1976
+ row: x,
1977
+ rowIndex: x.originalIndex,
1978
+ store: R(n)
1750
1979
  }, {
1751
- default: lt(() => [
1752
- (M(!0), P(se, null, me(v(w), (m, y) => (M(), P(se, {
1980
+ default: gt(() => [
1981
+ (C(!0), k(ie, null, ye(u(x), (m, b) => (C(), k(ie, {
1753
1982
  key: m.name
1754
1983
  }, [
1755
- m.isGantt ? (M(), ie(Ee(m.ganttComponent || "AGanttCell"), {
1984
+ m.isGantt ? (C(), ve(Ee(m.ganttComponent || "AGanttCell"), {
1756
1985
  key: 0,
1757
- store: $(n),
1758
- "columns-count": $(n).columns.length - a.value,
1759
- color: w.gantt?.color,
1760
- start: w.gantt?.startIndex,
1761
- end: w.gantt?.endIndex,
1986
+ store: R(n),
1987
+ "columns-count": R(n).columns.length - l.value,
1988
+ color: x.gantt?.color,
1989
+ start: x.gantt?.startIndex,
1990
+ end: x.gantt?.endIndex,
1762
1991
  colspan: m.colspan,
1763
1992
  pinned: m.pinned,
1764
- "row-index": f,
1765
- "col-index": m.originalIndex ?? y,
1766
- style: ee({
1993
+ rowIndex: x.originalIndex,
1994
+ colIndex: m.originalIndex ?? b,
1995
+ style: re({
1767
1996
  textAlign: m?.align || "center",
1768
1997
  minWidth: m?.width || "40ch",
1769
- width: $(n).config.fullWidth ? "auto" : null
1998
+ width: R(n).config.fullWidth ? "auto" : null
1770
1999
  }),
1771
- "onConnection:create": p
1772
- }, null, 40, ["store", "columns-count", "color", "start", "end", "colspan", "pinned", "row-index", "col-index", "style"])) : (M(), ie(Ee(m.cellComponent || "ACell"), {
2000
+ "onConnection:create": h
2001
+ }, null, 40, ["store", "columns-count", "color", "start", "end", "colspan", "pinned", "rowIndex", "colIndex", "style"])) : (C(), ve(Ee(m.cellComponent || "ACell"), {
1773
2002
  key: 1,
1774
- store: $(n),
2003
+ store: R(n),
1775
2004
  pinned: m.pinned,
1776
- "row-index": f,
1777
- "col-index": y,
1778
- style: ee({
2005
+ rowIndex: x.originalIndex,
2006
+ colIndex: b,
2007
+ style: re({
1779
2008
  textAlign: m?.align || "center",
1780
- width: $(n).config.fullWidth ? "auto" : null
2009
+ width: R(n).config.fullWidth ? "auto" : null
1781
2010
  }),
1782
2011
  spellcheck: "false"
1783
- }, null, 8, ["store", "pinned", "row-index", "col-index", "style"]))
2012
+ }, null, 8, ["store", "pinned", "rowIndex", "colIndex", "style"]))
1784
2013
  ], 64))), 128))
1785
2014
  ]),
1786
2015
  _: 2
1787
- }, 1032, ["row", "row-index", "store"]))), 128))
2016
+ }, 1032, ["row", "rowIndex", "store"]))), 128))
1788
2017
  ], !0)
1789
2018
  ]),
1790
- Y(h.$slots, "footer", { data: $(n) }, void 0, !0),
1791
- Y(h.$slots, "modal", { data: $(n) }, () => [
1792
- Re(ot(bt, { store: $(n) }, {
1793
- default: lt(() => [
1794
- (M(), ie(Ee($(n).modal.component), Xe({
1795
- key: `${$(n).modal.rowIndex}:${$(n).modal.colIndex}`,
1796
- "col-index": $(n).modal.colIndex,
1797
- "row-index": $(n).modal.rowIndex,
1798
- store: $(n)
1799
- }, $(n).modal.componentProps), null, 16, ["col-index", "row-index", "store"]))
2019
+ te(g.$slots, "footer", { data: R(n) }, void 0, !0),
2020
+ te(g.$slots, "modal", { data: R(n) }, () => [
2021
+ oe(mt(At, { store: R(n) }, {
2022
+ default: gt(() => [
2023
+ (C(), ve(Ee(R(n).modal.component), nt({
2024
+ key: `${R(n).modal.rowIndex}:${R(n).modal.colIndex}`,
2025
+ "col-index": R(n).modal.colIndex,
2026
+ "row-index": R(n).modal.rowIndex,
2027
+ store: R(n)
2028
+ }, R(n).modal.componentProps), null, 16, ["col-index", "row-index", "store"]))
1800
2029
  ]),
1801
2030
  _: 1
1802
2031
  }, 8, ["store"]), [
1803
- [gt, $(n).modal.visible]
2032
+ [$t, R(n).modal.visible]
1804
2033
  ])
1805
2034
  ], !0)
1806
2035
  ], 4)), [
1807
- [$(Tn), $(n).closeModal]
2036
+ [R(Yn), R(n).closeModal]
1808
2037
  ]),
1809
- $(n).isGanttView && $(n).isDependencyGraphEnabled ? (M(), ie(Nn, {
2038
+ R(n).isGanttView && R(n).isDependencyGraphEnabled ? (C(), ve(eo, {
1810
2039
  key: 0,
1811
- store: $(n),
1812
- "onConnection:delete": E
1813
- }, null, 8, ["store"])) : J("", !0)
2040
+ store: R(n),
2041
+ "onConnection:delete": $
2042
+ }, null, 8, ["store"])) : q("", !0)
1814
2043
  ]));
1815
2044
  }
1816
- }), Un = /* @__PURE__ */ re(jn, [["__scopeId", "data-v-50e8e2bf"]]), qn = {}, Jn = { class: "aloading" }, Zn = { class: "aloading-header" };
1817
- function Qn(e, t) {
1818
- return M(), P("div", Jn, [
1819
- N("h2", Zn, [
1820
- Y(e.$slots, "default", {}, void 0, !0)
2045
+ }), go = /* @__PURE__ */ he(mo, [["__scopeId", "data-v-c0a0032f"]]), ho = {}, xo = { class: "aloading" }, wo = { class: "aloading-header" };
2046
+ function yo(e, t) {
2047
+ return C(), k("div", xo, [
2048
+ z("h2", wo, [
2049
+ te(e.$slots, "default", {}, void 0, !0)
1821
2050
  ]),
1822
- t[0] || (t[0] = N("div", { class: "aloading-bar" }, null, -1))
2051
+ t[0] || (t[0] = z("div", { class: "aloading-bar" }, null, -1))
1823
2052
  ]);
1824
2053
  }
1825
- const Kn = /* @__PURE__ */ re(qn, [["render", Qn], ["__scopeId", "data-v-a930a25b"]]), _n = {}, eo = { class: "aloading" }, to = { class: "aloading-header" };
1826
- function no(e, t) {
1827
- return M(), P("div", eo, [
1828
- N("h2", to, [
1829
- Y(e.$slots, "default", {}, void 0, !0)
2054
+ const bo = /* @__PURE__ */ he(ho, [["render", yo], ["__scopeId", "data-v-a930a25b"]]), po = {}, Co = { class: "aloading" }, Io = { class: "aloading-header" };
2055
+ function ko(e, t) {
2056
+ return C(), k("div", Co, [
2057
+ z("h2", Io, [
2058
+ te(e.$slots, "default", {}, void 0, !0)
1830
2059
  ]),
1831
- t[0] || (t[0] = N("div", { class: "aloading-bar" }, null, -1))
2060
+ t[0] || (t[0] = z("div", { class: "aloading-bar" }, null, -1))
1832
2061
  ]);
1833
2062
  }
1834
- const oo = /* @__PURE__ */ re(_n, [["render", no], ["__scopeId", "data-v-e1165876"]]);
1835
- function so(e) {
1836
- e.component("ACell", hn), e.component("AExpansionRow", bn), e.component("AGanttCell", Sn), e.component("ARow", pt), e.component("ATable", Un), e.component("ATableHeader", yt), e.component("ATableLoading", Kn), e.component("ATableLoadingBar", oo), e.component("ATableModal", bt);
2063
+ const Eo = /* @__PURE__ */ he(po, [["render", ko], ["__scopeId", "data-v-e1165876"]]);
2064
+ function Ro(e) {
2065
+ e.component("ACell", Mn), e.component("AExpansionRow", Hn), e.component("AGanttCell", Wn), e.component("ARow", Mt), e.component("ATable", go), e.component("ATableHeader", Tt), e.component("ATableLoading", bo), e.component("ATableLoadingBar", Eo), e.component("ATableModal", At);
1837
2066
  }
1838
2067
  export {
1839
- hn as ACell,
1840
- bn as AExpansionRow,
1841
- Sn as AGanttCell,
1842
- pt as ARow,
1843
- Un as ATable,
1844
- yt as ATableHeader,
1845
- Kn as ATableLoading,
1846
- oo as ATableLoadingBar,
1847
- bt as ATableModal,
1848
- Fn as createTableStore,
1849
- so as install
2068
+ Mn as ACell,
2069
+ Hn as AExpansionRow,
2070
+ Wn as AGanttCell,
2071
+ Mt as ARow,
2072
+ go as ATable,
2073
+ Tt as ATableHeader,
2074
+ bo as ATableLoading,
2075
+ Eo as ATableLoadingBar,
2076
+ At as ATableModal,
2077
+ fo as createTableStore,
2078
+ Ro as install
1850
2079
  };
1851
2080
  //# sourceMappingURL=atable.js.map