@stonecrop/atable 0.13.3 → 0.13.5

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