@stonecrop/atable 0.4.22 → 0.4.24

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