@stonecrop/atable 0.4.12 → 0.4.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/atable.js CHANGED
@@ -1,17 +1,17 @@
1
- import { onMounted as te, ref as P, watch as N, onBeforeUnmount as ot, computed as A, shallowRef as W, toValue as C, watchEffect as lt, getCurrentScope as Fe, onScopeDispose as je, unref as x, getCurrentInstance as Ee, nextTick as Ge, isRef as at, toRefs as st, customRef as Ue, toRef as rt, readonly as it, defineComponent as J, useTemplateRef as B, createElementBlock as R, openBlock as $, normalizeClass as G, normalizeStyle as Y, createBlock as ae, resolveDynamicComponent as fe, mergeProps as ke, toDisplayString as Z, Fragment as re, createElementVNode as D, createCommentVNode as K, renderSlot as X, useCssVars as ut, withDirectives as be, vShow as Ye, renderList as xe, createTextVNode as ct, withModifiers as Pe, createVNode as Oe, withCtx as Le } from "vue";
2
- import { defineStore as dt } from "pinia";
1
+ import { onMounted as ne, ref as R, watch as V, onBeforeUnmount as lt, computed as I, shallowRef as H, toValue as C, watchEffect as at, getCurrentScope as Fe, onScopeDispose as je, unref as x, getCurrentInstance as Ie, nextTick as Ue, isRef as st, toRefs as rt, customRef as Ye, toRef as it, readonly as ut, defineComponent as Q, useTemplateRef as G, createElementBlock as T, openBlock as k, normalizeClass as U, normalizeStyle as q, createBlock as se, resolveDynamicComponent as ve, mergeProps as ke, toDisplayString as K, Fragment as ie, createElementVNode as O, createCommentVNode as _, renderSlot as W, useCssVars as ct, withDirectives as xe, vShow as qe, renderList as Ce, createTextVNode as dt, withModifiers as Oe, createVNode as Le, withCtx as De } from "vue";
2
+ import { defineStore as ft } from "pinia";
3
3
  import './assets/index.css';function Me(e) {
4
4
  return Fe() ? (je(e), !0) : !1;
5
5
  }
6
- const ft = typeof window < "u" && typeof document < "u";
6
+ const vt = typeof window < "u" && typeof document < "u";
7
7
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
8
- const vt = (e) => e != null, mt = Object.prototype.toString, pt = (e) => mt.call(e) === "[object Object]", ht = () => {
8
+ const mt = (e) => e != null, gt = Object.prototype.toString, ht = (e) => gt.call(e) === "[object Object]", pt = () => {
9
9
  };
10
- function ve(e) {
10
+ function me(e) {
11
11
  return Array.isArray(e) ? e : [e];
12
12
  }
13
- function gt(e, t, n) {
14
- return N(
13
+ function wt(e, t, n) {
14
+ return V(
15
15
  e,
16
16
  t,
17
17
  {
@@ -20,301 +20,301 @@ function gt(e, t, n) {
20
20
  }
21
21
  );
22
22
  }
23
- const ne = ft ? window : void 0;
24
- function _(e) {
23
+ const oe = vt ? window : void 0;
24
+ function ee(e) {
25
25
  var t;
26
26
  const n = C(e);
27
27
  return (t = n == null ? void 0 : n.$el) != null ? t : n;
28
28
  }
29
- function ue(...e) {
29
+ function ce(...e) {
30
30
  const t = [], n = () => {
31
31
  t.forEach((a) => a()), t.length = 0;
32
- }, l = (a, r, s, c) => (a.addEventListener(r, s, c), () => a.removeEventListener(r, s, c)), i = A(() => {
33
- const a = ve(C(e[0])).filter((r) => r != null);
34
- return a.every((r) => typeof r != "string") ? a : void 0;
35
- }), u = gt(
32
+ }, o = (a, i, r, s) => (a.addEventListener(i, r, s), () => a.removeEventListener(i, r, s)), u = I(() => {
33
+ const a = me(C(e[0])).filter((i) => i != null);
34
+ return a.every((i) => typeof i != "string") ? a : void 0;
35
+ }), d = wt(
36
36
  () => {
37
- var a, r;
37
+ var a, i;
38
38
  return [
39
- (r = (a = i.value) == null ? void 0 : a.map((s) => _(s))) != null ? r : [ne].filter((s) => s != null),
40
- ve(C(i.value ? e[1] : e[0])),
41
- ve(x(i.value ? e[2] : e[1])),
39
+ (i = (a = u.value) == null ? void 0 : a.map((r) => ee(r))) != null ? i : [oe].filter((r) => r != null),
40
+ me(C(u.value ? e[1] : e[0])),
41
+ me(x(u.value ? e[2] : e[1])),
42
42
  // @ts-expect-error - TypeScript gets the correct types, but somehow still complains
43
- C(i.value ? e[3] : e[2])
43
+ C(u.value ? e[3] : e[2])
44
44
  ];
45
45
  },
46
- ([a, r, s, c]) => {
47
- if (n(), !(a != null && a.length) || !(r != null && r.length) || !(s != null && s.length))
46
+ ([a, i, r, s]) => {
47
+ if (n(), !(a != null && a.length) || !(i != null && i.length) || !(r != null && r.length))
48
48
  return;
49
- const v = pt(c) ? { ...c } : c;
49
+ const v = ht(s) ? { ...s } : s;
50
50
  t.push(
51
51
  ...a.flatMap(
52
- (m) => r.flatMap(
53
- (d) => s.map((g) => l(m, d, g, v))
52
+ (m) => i.flatMap(
53
+ (w) => r.map((g) => o(m, w, g, v))
54
54
  )
55
55
  )
56
56
  );
57
57
  },
58
58
  { flush: "post" }
59
- ), o = () => {
60
- u(), n();
59
+ ), l = () => {
60
+ d(), n();
61
61
  };
62
- return Me(n), o;
62
+ return Me(n), l;
63
63
  }
64
- function wt() {
65
- const e = W(!1), t = Ee();
66
- return t && te(() => {
64
+ function yt() {
65
+ const e = H(!1), t = Ie();
66
+ return t && ne(() => {
67
67
  e.value = !0;
68
68
  }, t), e;
69
69
  }
70
- function yt(e) {
71
- const t = wt();
72
- return A(() => (t.value, !!e()));
70
+ function bt(e) {
71
+ const t = yt();
72
+ return I(() => (t.value, !!e()));
73
73
  }
74
- function bt(e, t, n = {}) {
75
- const { window: l = ne, ...i } = n;
76
- let u;
77
- const o = yt(() => l && "MutationObserver" in l), a = () => {
78
- u && (u.disconnect(), u = void 0);
79
- }, r = A(() => {
80
- const m = C(e), d = ve(m).map(_).filter(vt);
81
- return new Set(d);
82
- }), s = N(
83
- () => r.value,
74
+ function xt(e, t, n = {}) {
75
+ const { window: o = oe, ...u } = n;
76
+ let d;
77
+ const l = bt(() => o && "MutationObserver" in o), a = () => {
78
+ d && (d.disconnect(), d = void 0);
79
+ }, i = I(() => {
80
+ const m = C(e), w = me(m).map(ee).filter(mt);
81
+ return new Set(w);
82
+ }), r = V(
83
+ () => i.value,
84
84
  (m) => {
85
- a(), o.value && m.size && (u = new MutationObserver(t), m.forEach((d) => u.observe(d, i)));
85
+ a(), l.value && m.size && (d = new MutationObserver(t), m.forEach((w) => d.observe(w, u)));
86
86
  },
87
87
  { immediate: !0, flush: "post" }
88
- ), c = () => u == null ? void 0 : u.takeRecords(), v = () => {
89
- s(), a();
88
+ ), s = () => d == null ? void 0 : d.takeRecords(), v = () => {
89
+ r(), a();
90
90
  };
91
91
  return Me(v), {
92
- isSupported: o,
92
+ isSupported: l,
93
93
  stop: v,
94
- takeRecords: c
94
+ takeRecords: s
95
95
  };
96
96
  }
97
- function xt(e, t, n = {}) {
97
+ function Ct(e, t, n = {}) {
98
98
  const {
99
- window: l = ne,
100
- document: i = l == null ? void 0 : l.document,
101
- flush: u = "sync"
99
+ window: o = oe,
100
+ document: u = o == null ? void 0 : o.document,
101
+ flush: d = "sync"
102
102
  } = n;
103
- if (!l || !i)
104
- return ht;
105
- let o;
106
- const a = (c) => {
107
- o == null || o(), o = c;
108
- }, r = lt(() => {
109
- const c = _(e);
110
- if (c) {
111
- const { stop: v } = bt(
112
- i,
103
+ if (!o || !u)
104
+ return pt;
105
+ let l;
106
+ const a = (s) => {
107
+ l == null || l(), l = s;
108
+ }, i = at(() => {
109
+ const s = ee(e);
110
+ if (s) {
111
+ const { stop: v } = xt(
112
+ u,
113
113
  (m) => {
114
- m.map((d) => [...d.removedNodes]).flat().some((d) => d === c || d.contains(c)) && t(m);
114
+ m.map((w) => [...w.removedNodes]).flat().some((w) => w === s || w.contains(s)) && t(m);
115
115
  },
116
116
  {
117
- window: l,
117
+ window: o,
118
118
  childList: !0,
119
119
  subtree: !0
120
120
  }
121
121
  );
122
122
  a(v);
123
123
  }
124
- }, { flush: u }), s = () => {
125
- r(), a();
124
+ }, { flush: d }), r = () => {
125
+ i(), a();
126
126
  };
127
- return Me(s), s;
127
+ return Me(r), r;
128
128
  }
129
- function Ct(e = {}) {
129
+ function Et(e = {}) {
130
130
  var t;
131
131
  const {
132
- window: n = ne,
133
- deep: l = !0,
134
- triggerOnRemoval: i = !1
135
- } = e, u = (t = e.document) != null ? t : n == null ? void 0 : n.document, o = () => {
136
- var s;
137
- let c = u == null ? void 0 : u.activeElement;
138
- if (l)
139
- for (; c != null && c.shadowRoot; )
140
- c = (s = c == null ? void 0 : c.shadowRoot) == null ? void 0 : s.activeElement;
141
- return c;
142
- }, a = P(), r = () => {
143
- a.value = o();
132
+ window: n = oe,
133
+ deep: o = !0,
134
+ triggerOnRemoval: u = !1
135
+ } = e, d = (t = e.document) != null ? t : n == null ? void 0 : n.document, l = () => {
136
+ var r;
137
+ let s = d == null ? void 0 : d.activeElement;
138
+ if (o)
139
+ for (; s != null && s.shadowRoot; )
140
+ s = (r = s == null ? void 0 : s.shadowRoot) == null ? void 0 : r.activeElement;
141
+ return s;
142
+ }, a = R(), i = () => {
143
+ a.value = l();
144
144
  };
145
145
  if (n) {
146
- const s = {
146
+ const r = {
147
147
  capture: !0,
148
148
  passive: !0
149
149
  };
150
- ue(
150
+ ce(
151
151
  n,
152
152
  "blur",
153
- (c) => {
154
- c.relatedTarget === null && r();
153
+ (s) => {
154
+ s.relatedTarget === null && i();
155
155
  },
156
- s
157
- ), ue(
156
+ r
157
+ ), ce(
158
158
  n,
159
159
  "focus",
160
- r,
161
- s
160
+ i,
161
+ r
162
162
  );
163
163
  }
164
- return i && xt(a, r, { document: u }), r(), a;
164
+ return u && Ct(a, i, { document: d }), i(), a;
165
165
  }
166
- const Et = "focusin", kt = "focusout", Mt = ":focus-within";
166
+ const It = "focusin", kt = "focusout", Mt = ":focus-within";
167
167
  function $t(e, t = {}) {
168
- const { window: n = ne } = t, l = A(() => _(e)), i = W(!1), u = A(() => i.value), o = Ct(t);
169
- if (!n || !o.value)
170
- return { focused: u };
168
+ const { window: n = oe } = t, o = I(() => ee(e)), u = H(!1), d = I(() => u.value), l = Et(t);
169
+ if (!n || !l.value)
170
+ return { focused: d };
171
171
  const a = { passive: !0 };
172
- return ue(l, Et, () => i.value = !0, a), ue(l, kt, () => {
173
- var r, s, c;
174
- return i.value = (c = (s = (r = l.value) == null ? void 0 : r.matches) == null ? void 0 : s.call(r, Mt)) != null ? c : !1;
175
- }, a), { focused: u };
172
+ return ce(o, It, () => u.value = !0, a), ce(o, kt, () => {
173
+ var i, r, s;
174
+ return u.value = (s = (r = (i = o.value) == null ? void 0 : i.matches) == null ? void 0 : r.call(i, Mt)) != null ? s : !1;
175
+ }, a), { focused: d };
176
176
  }
177
- function At(e, { window: t = ne, scrollTarget: n } = {}) {
178
- const l = P(!1), i = () => {
177
+ function At(e, { window: t = oe, scrollTarget: n } = {}) {
178
+ const o = R(!1), u = () => {
179
179
  if (!t) return;
180
- const u = t.document, o = _(e);
181
- if (!o)
182
- l.value = !1;
180
+ const d = t.document, l = ee(e);
181
+ if (!l)
182
+ o.value = !1;
183
183
  else {
184
- const a = o.getBoundingClientRect();
185
- l.value = a.top <= (t.innerHeight || u.documentElement.clientHeight) && a.left <= (t.innerWidth || u.documentElement.clientWidth) && a.bottom >= 0 && a.right >= 0;
184
+ const a = l.getBoundingClientRect();
185
+ o.value = a.top <= (t.innerHeight || d.documentElement.clientHeight) && a.left <= (t.innerWidth || d.documentElement.clientWidth) && a.bottom >= 0 && a.right >= 0;
186
186
  }
187
187
  };
188
- return N(
189
- () => _(e),
190
- () => i(),
188
+ return V(
189
+ () => ee(e),
190
+ () => u(),
191
191
  { immediate: !0, flush: "post" }
192
- ), t && ue(n || t, "scroll", i, {
192
+ ), t && ce(n || t, "scroll", u, {
193
193
  capture: !1,
194
194
  passive: !0
195
- }), l;
195
+ }), o;
196
196
  }
197
197
  const z = (e) => {
198
198
  let t = At(e).value;
199
199
  return t = t && e.offsetHeight > 0, t;
200
- }, F = (e) => e.tabIndex >= 0, De = (e) => {
200
+ }, F = (e) => e.tabIndex >= 0, He = (e) => {
201
201
  const t = e.target;
202
202
  return $e(t);
203
203
  }, $e = (e) => {
204
204
  var t;
205
205
  let n;
206
206
  if (e instanceof HTMLTableCellElement) {
207
- const l = (t = e.parentElement) == null ? void 0 : t.previousElementSibling;
208
- if (l) {
209
- const i = Array.from(l.children)[e.cellIndex];
210
- i && (n = i);
207
+ const o = (t = e.parentElement) == null ? void 0 : t.previousElementSibling;
208
+ if (o) {
209
+ const u = Array.from(o.children)[e.cellIndex];
210
+ u && (n = u);
211
211
  }
212
212
  } else if (e instanceof HTMLTableRowElement) {
213
- const l = e.previousElementSibling;
214
- l && (n = l);
213
+ const o = e.previousElementSibling;
214
+ o && (n = o);
215
215
  }
216
216
  return n && (!F(n) || !z(n)) ? $e(n) : n;
217
- }, It = (e) => {
217
+ }, St = (e) => {
218
218
  var t;
219
219
  const n = e.target;
220
- let l;
220
+ let o;
221
221
  if (n instanceof HTMLTableCellElement) {
222
- const i = (t = n.parentElement) == null ? void 0 : t.parentElement;
223
- if (i) {
224
- const u = i.firstElementChild, o = u == null ? void 0 : u.children[n.cellIndex];
225
- o && (l = o);
222
+ const u = (t = n.parentElement) == null ? void 0 : t.parentElement;
223
+ if (u) {
224
+ const d = u.firstElementChild, l = d == null ? void 0 : d.children[n.cellIndex];
225
+ l && (o = l);
226
226
  }
227
227
  } else if (n instanceof HTMLTableRowElement) {
228
- const i = n.parentElement;
229
- if (i) {
230
- const u = i.firstElementChild;
231
- u && (l = u);
228
+ const u = n.parentElement;
229
+ if (u) {
230
+ const d = u.firstElementChild;
231
+ d && (o = d);
232
232
  }
233
233
  }
234
- return l && (!F(l) || !z(l)) ? Ae(l) : l;
235
- }, He = (e) => {
234
+ return o && (!F(o) || !z(o)) ? Ae(o) : o;
235
+ }, We = (e) => {
236
236
  const t = e.target;
237
237
  return Ae(t);
238
238
  }, Ae = (e) => {
239
239
  var t;
240
240
  let n;
241
241
  if (e instanceof HTMLTableCellElement) {
242
- const l = (t = e.parentElement) == null ? void 0 : t.nextElementSibling;
243
- if (l) {
244
- const i = Array.from(l.children)[e.cellIndex];
245
- i && (n = i);
242
+ const o = (t = e.parentElement) == null ? void 0 : t.nextElementSibling;
243
+ if (o) {
244
+ const u = Array.from(o.children)[e.cellIndex];
245
+ u && (n = u);
246
246
  }
247
247
  } else if (e instanceof HTMLTableRowElement) {
248
- const l = e.nextElementSibling;
249
- l && (n = l);
248
+ const o = e.nextElementSibling;
249
+ o && (n = o);
250
250
  }
251
251
  return n && (!F(n) || !z(n)) ? Ae(n) : n;
252
- }, St = (e) => {
252
+ }, Tt = (e) => {
253
253
  var t;
254
254
  const n = e.target;
255
- let l;
255
+ let o;
256
256
  if (n instanceof HTMLTableCellElement) {
257
- const i = (t = n.parentElement) == null ? void 0 : t.parentElement;
258
- if (i) {
259
- const u = i.lastElementChild, o = u == null ? void 0 : u.children[n.cellIndex];
260
- o && (l = o);
257
+ const u = (t = n.parentElement) == null ? void 0 : t.parentElement;
258
+ if (u) {
259
+ const d = u.lastElementChild, l = d == null ? void 0 : d.children[n.cellIndex];
260
+ l && (o = l);
261
261
  }
262
262
  } else if (n instanceof HTMLTableRowElement) {
263
- const i = n.parentElement;
264
- if (i) {
265
- const u = i.lastElementChild;
266
- u && (l = u);
263
+ const u = n.parentElement;
264
+ if (u) {
265
+ const d = u.lastElementChild;
266
+ d && (o = d);
267
267
  }
268
268
  }
269
- return l && (!F(l) || !z(l)) ? $e(l) : l;
270
- }, We = (e) => {
269
+ return o && (!F(o) || !z(o)) ? $e(o) : o;
270
+ }, Be = (e) => {
271
271
  const t = e.target;
272
- return Ie(t);
273
- }, Ie = (e) => {
272
+ return Se(t);
273
+ }, Se = (e) => {
274
274
  var t;
275
275
  let n;
276
276
  if (e.previousElementSibling)
277
277
  n = e.previousElementSibling;
278
278
  else {
279
- const l = (t = e.parentElement) == null ? void 0 : t.previousElementSibling;
280
- n = l == null ? void 0 : l.lastElementChild;
279
+ const o = (t = e.parentElement) == null ? void 0 : t.previousElementSibling;
280
+ n = o == null ? void 0 : o.lastElementChild;
281
281
  }
282
- return n && (!F(n) || !z(n)) ? Ie(n) : n;
282
+ return n && (!F(n) || !z(n)) ? Se(n) : n;
283
283
  }, Xe = (e) => {
284
284
  const t = e.target;
285
- return Se(t);
286
- }, Se = (e) => {
285
+ return Te(t);
286
+ }, Te = (e) => {
287
287
  var t;
288
288
  let n;
289
289
  if (e.nextElementSibling)
290
290
  n = e.nextElementSibling;
291
291
  else {
292
- const l = (t = e.parentElement) == null ? void 0 : t.nextElementSibling;
293
- n = l == null ? void 0 : l.firstElementChild;
292
+ const o = (t = e.parentElement) == null ? void 0 : t.nextElementSibling;
293
+ n = o == null ? void 0 : o.firstElementChild;
294
294
  }
295
- return n && (!F(n) || !z(n)) ? Se(n) : n;
295
+ return n && (!F(n) || !z(n)) ? Te(n) : n;
296
296
  }, Ve = (e) => {
297
297
  const t = e.target.parentElement, n = t == null ? void 0 : t.firstElementChild;
298
- return n && (!F(n) || !z(n)) ? Se(n) : n;
298
+ return n && (!F(n) || !z(n)) ? Te(n) : n;
299
299
  }, Ne = (e) => {
300
300
  const t = e.target.parentElement, n = t == null ? void 0 : t.lastElementChild;
301
- return n && (!F(n) || !z(n)) ? Ie(n) : n;
302
- }, de = ["alt", "control", "shift", "meta"], Tt = {
301
+ return n && (!F(n) || !z(n)) ? Se(n) : n;
302
+ }, fe = ["alt", "control", "shift", "meta"], Rt = {
303
303
  ArrowUp: "up",
304
304
  ArrowDown: "down",
305
305
  ArrowLeft: "left",
306
306
  ArrowRight: "right"
307
- }, Te = {
307
+ }, Re = {
308
308
  "keydown.up": (e) => {
309
- const t = De(e);
309
+ const t = He(e);
310
310
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
311
311
  },
312
312
  "keydown.down": (e) => {
313
- const t = He(e);
313
+ const t = We(e);
314
314
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
315
315
  },
316
316
  "keydown.left": (e) => {
317
- const t = We(e);
317
+ const t = Be(e);
318
318
  e.preventDefault(), e.stopPropagation(), t && t.focus();
319
319
  },
320
320
  "keydown.right": (e) => {
@@ -322,11 +322,11 @@ const z = (e) => {
322
322
  e.preventDefault(), e.stopPropagation(), t && t.focus();
323
323
  },
324
324
  "keydown.control.up": (e) => {
325
- const t = It(e);
325
+ const t = St(e);
326
326
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
327
327
  },
328
328
  "keydown.control.down": (e) => {
329
- const t = St(e);
329
+ const t = Tt(e);
330
330
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
331
331
  },
332
332
  "keydown.control.left": (e) => {
@@ -344,14 +344,14 @@ const z = (e) => {
344
344
  "keydown.enter": (e) => {
345
345
  if (e.target instanceof HTMLTableCellElement) {
346
346
  e.preventDefault(), e.stopPropagation();
347
- const t = He(e);
347
+ const t = We(e);
348
348
  t && t.focus();
349
349
  }
350
350
  },
351
351
  "keydown.shift.enter": (e) => {
352
352
  if (e.target instanceof HTMLTableCellElement) {
353
353
  e.preventDefault(), e.stopPropagation();
354
- const t = De(e);
354
+ const t = He(e);
355
355
  t && t.focus();
356
356
  }
357
357
  },
@@ -364,128 +364,128 @@ const z = (e) => {
364
364
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
365
365
  },
366
366
  "keydown.shift.tab": (e) => {
367
- const t = We(e);
367
+ const t = Be(e);
368
368
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
369
369
  }
370
370
  };
371
- function Re(e) {
372
- const t = (o) => {
371
+ function Pe(e) {
372
+ const t = (l) => {
373
373
  let a = null;
374
- return o.parent && (typeof o.parent == "string" ? a = document.querySelector(o.parent) : o.parent instanceof HTMLElement ? a = o.parent : a = o.parent.value), a;
375
- }, n = (o) => {
374
+ return l.parent && (typeof l.parent == "string" ? a = document.querySelector(l.parent) : l.parent instanceof HTMLElement ? a = l.parent : a = l.parent.value), a;
375
+ }, n = (l) => {
376
376
  var a;
377
- const r = t(o);
378
- let s = [];
379
- if (typeof o.selectors == "string")
380
- s = r ? Array.from(r.querySelectorAll(o.selectors)) : Array.from(document.querySelectorAll(o.selectors));
381
- else if (Array.isArray(o.selectors))
382
- for (const c of o.selectors)
383
- c instanceof HTMLElement ? s.push(c) : s.push(c.$el);
384
- else if (o.selectors instanceof HTMLElement)
385
- s.push(o.selectors);
386
- else if ((a = o.selectors) != null && a.value)
387
- if (Array.isArray(o.selectors.value))
388
- for (const c of o.selectors.value)
389
- c instanceof HTMLElement ? s.push(c) : s.push(c.$el);
390
- else
391
- s.push(o.selectors.value);
392
- return s;
393
- }, l = (o) => {
394
- const a = t(o);
377
+ const i = t(l);
395
378
  let r = [];
396
- return o.selectors ? r = n(o) : a && (r = Array.from(a.children).filter((s) => F(s) && z(s))), r;
397
- }, i = (o) => (a) => {
398
- const r = Tt[a.key] || a.key.toLowerCase();
399
- if (de.includes(r)) return;
400
- const s = o.handlers || Te;
401
- for (const c of Object.keys(s)) {
402
- const [v, ...m] = c.split(".");
403
- if (v === "keydown" && m.includes(r)) {
404
- const d = s[c], g = m.filter((f) => de.includes(f)), M = de.some((f) => {
405
- const p = f.charAt(0).toUpperCase() + f.slice(1);
406
- return a.getModifierState(p);
379
+ if (typeof l.selectors == "string")
380
+ r = i ? Array.from(i.querySelectorAll(l.selectors)) : Array.from(document.querySelectorAll(l.selectors));
381
+ else if (Array.isArray(l.selectors))
382
+ for (const s of l.selectors)
383
+ s instanceof HTMLElement ? r.push(s) : r.push(s.$el);
384
+ else if (l.selectors instanceof HTMLElement)
385
+ r.push(l.selectors);
386
+ else if ((a = l.selectors) != null && a.value)
387
+ if (Array.isArray(l.selectors.value))
388
+ for (const s of l.selectors.value)
389
+ s instanceof HTMLElement ? r.push(s) : r.push(s.$el);
390
+ else
391
+ r.push(l.selectors.value);
392
+ return r;
393
+ }, o = (l) => {
394
+ const a = t(l);
395
+ let i = [];
396
+ return l.selectors ? i = n(l) : a && (i = Array.from(a.children).filter((r) => F(r) && z(r))), i;
397
+ }, u = (l) => (a) => {
398
+ const i = Rt[a.key] || a.key.toLowerCase();
399
+ if (fe.includes(i)) return;
400
+ const r = l.handlers || Re;
401
+ for (const s of Object.keys(r)) {
402
+ const [v, ...m] = s.split(".");
403
+ if (v === "keydown" && m.includes(i)) {
404
+ const w = r[s], g = m.filter((f) => fe.includes(f)), y = fe.some((f) => {
405
+ const c = f.charAt(0).toUpperCase() + f.slice(1);
406
+ return a.getModifierState(c);
407
407
  });
408
408
  if (g.length > 0) {
409
- if (M) {
410
- for (const f of de)
409
+ if (y) {
410
+ for (const f of fe)
411
411
  if (m.includes(f)) {
412
- const p = f.charAt(0).toUpperCase() + f.slice(1);
413
- a.getModifierState(p) && d(a);
412
+ const c = f.charAt(0).toUpperCase() + f.slice(1);
413
+ a.getModifierState(c) && w(a);
414
414
  }
415
415
  }
416
416
  } else
417
- M || d(a);
417
+ y || w(a);
418
418
  }
419
419
  }
420
- }, u = [];
421
- te(() => {
422
- for (const o of e) {
423
- const a = t(o), r = l(o), s = i(o), c = a ? [a] : r;
424
- for (const v of c) {
425
- const { focused: m } = $t(P(v)), d = N(m, (g) => {
426
- g ? v.addEventListener("keydown", s) : v.removeEventListener("keydown", s);
420
+ }, d = [];
421
+ ne(() => {
422
+ for (const l of e) {
423
+ const a = t(l), i = o(l), r = u(l), s = a ? [a] : i;
424
+ for (const v of s) {
425
+ const { focused: m } = $t(R(v)), w = V(m, (g) => {
426
+ g ? v.addEventListener("keydown", r) : v.removeEventListener("keydown", r);
427
427
  });
428
- u.push(d);
428
+ d.push(w);
429
429
  }
430
430
  }
431
- }), ot(() => {
432
- for (const o of u)
433
- o();
431
+ }), lt(() => {
432
+ for (const l of d)
433
+ l();
434
434
  });
435
435
  }
436
- function ce(e) {
436
+ function de(e) {
437
437
  return Fe() ? (je(e), !0) : !1;
438
438
  }
439
- const pe = typeof window < "u" && typeof document < "u";
439
+ const he = typeof window < "u" && typeof document < "u";
440
440
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
441
- const Rt = (e) => e != null, Pt = Object.prototype.toString, qe = (e) => Pt.call(e) === "[object Object]", U = () => {
442
- }, Ce = /* @__PURE__ */ Ot();
443
- function Ot() {
441
+ const Pt = (e) => e != null, Ot = Object.prototype.toString, Je = (e) => Ot.call(e) === "[object Object]", Y = () => {
442
+ }, Ee = /* @__PURE__ */ Lt();
443
+ function Lt() {
444
444
  var e, t;
445
- return pe && ((e = window == null ? void 0 : window.navigator) == null ? void 0 : e.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((t = window == null ? void 0 : window.navigator) == null ? void 0 : t.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent));
445
+ return he && ((e = window == null ? void 0 : window.navigator) == null ? void 0 : e.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((t = window == null ? void 0 : window.navigator) == null ? void 0 : t.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent));
446
446
  }
447
- function Lt(e) {
448
- return Ee();
447
+ function Dt(e) {
448
+ return Ie();
449
449
  }
450
- function q(e) {
450
+ function J(e) {
451
451
  return Array.isArray(e) ? e : [e];
452
452
  }
453
- function Dt(...e) {
453
+ function Ht(...e) {
454
454
  if (e.length !== 1)
455
- return rt(...e);
455
+ return it(...e);
456
456
  const t = e[0];
457
- return typeof t == "function" ? it(Ue(() => ({ get: t, set: U }))) : P(t);
457
+ return typeof t == "function" ? ut(Ye(() => ({ get: t, set: Y }))) : R(t);
458
458
  }
459
- function Ht(e, t = {}) {
460
- if (!at(e))
461
- return st(e);
459
+ function Wt(e, t = {}) {
460
+ if (!st(e))
461
+ return rt(e);
462
462
  const n = Array.isArray(e.value) ? Array.from({ length: e.value.length }) : {};
463
- for (const l in e.value)
464
- n[l] = Ue(() => ({
463
+ for (const o in e.value)
464
+ n[o] = Ye(() => ({
465
465
  get() {
466
- return e.value[l];
466
+ return e.value[o];
467
467
  },
468
- set(i) {
469
- var u;
470
- if ((u = C(t.replaceRef)) != null ? u : !0)
468
+ set(u) {
469
+ var d;
470
+ if ((d = C(t.replaceRef)) != null ? d : !0)
471
471
  if (Array.isArray(e.value)) {
472
472
  const a = [...e.value];
473
- a[l] = i, e.value = a;
473
+ a[o] = u, e.value = a;
474
474
  } else {
475
- const a = { ...e.value, [l]: i };
475
+ const a = { ...e.value, [o]: u };
476
476
  Object.setPrototypeOf(a, Object.getPrototypeOf(e.value)), e.value = a;
477
477
  }
478
478
  else
479
- e.value[l] = i;
479
+ e.value[o] = u;
480
480
  }
481
481
  }));
482
482
  return n;
483
483
  }
484
- function Wt(e, t = !0, n) {
485
- Lt() ? te(e, n) : t ? e() : Ge(e);
484
+ function Bt(e, t = !0, n) {
485
+ Dt() ? ne(e, n) : t ? e() : Ue(e);
486
486
  }
487
- function Je(e, t, n) {
488
- return N(
487
+ function Qe(e, t, n) {
488
+ return V(
489
489
  e,
490
490
  t,
491
491
  {
@@ -494,198 +494,198 @@ function Je(e, t, n) {
494
494
  }
495
495
  );
496
496
  }
497
- const he = pe ? window : void 0;
498
- function ee(e) {
497
+ const pe = he ? window : void 0;
498
+ function te(e) {
499
499
  var t;
500
500
  const n = C(e);
501
501
  return (t = n == null ? void 0 : n.$el) != null ? t : n;
502
502
  }
503
- function ie(...e) {
503
+ function ue(...e) {
504
504
  const t = [], n = () => {
505
505
  t.forEach((a) => a()), t.length = 0;
506
- }, l = (a, r, s, c) => (a.addEventListener(r, s, c), () => a.removeEventListener(r, s, c)), i = A(() => {
507
- const a = q(C(e[0])).filter((r) => r != null);
508
- return a.every((r) => typeof r != "string") ? a : void 0;
509
- }), u = Je(
506
+ }, o = (a, i, r, s) => (a.addEventListener(i, r, s), () => a.removeEventListener(i, r, s)), u = I(() => {
507
+ const a = J(C(e[0])).filter((i) => i != null);
508
+ return a.every((i) => typeof i != "string") ? a : void 0;
509
+ }), d = Qe(
510
510
  () => {
511
- var a, r;
511
+ var a, i;
512
512
  return [
513
- (r = (a = i.value) == null ? void 0 : a.map((s) => ee(s))) != null ? r : [he].filter((s) => s != null),
514
- q(C(i.value ? e[1] : e[0])),
515
- q(x(i.value ? e[2] : e[1])),
513
+ (i = (a = u.value) == null ? void 0 : a.map((r) => te(r))) != null ? i : [pe].filter((r) => r != null),
514
+ J(C(u.value ? e[1] : e[0])),
515
+ J(x(u.value ? e[2] : e[1])),
516
516
  // @ts-expect-error - TypeScript gets the correct types, but somehow still complains
517
- C(i.value ? e[3] : e[2])
517
+ C(u.value ? e[3] : e[2])
518
518
  ];
519
519
  },
520
- ([a, r, s, c]) => {
521
- if (n(), !(a != null && a.length) || !(r != null && r.length) || !(s != null && s.length))
520
+ ([a, i, r, s]) => {
521
+ if (n(), !(a != null && a.length) || !(i != null && i.length) || !(r != null && r.length))
522
522
  return;
523
- const v = qe(c) ? { ...c } : c;
523
+ const v = Je(s) ? { ...s } : s;
524
524
  t.push(
525
525
  ...a.flatMap(
526
- (m) => r.flatMap(
527
- (d) => s.map((g) => l(m, d, g, v))
526
+ (m) => i.flatMap(
527
+ (w) => r.map((g) => o(m, w, g, v))
528
528
  )
529
529
  )
530
530
  );
531
531
  },
532
532
  { flush: "post" }
533
- ), o = () => {
534
- u(), n();
533
+ ), l = () => {
534
+ d(), n();
535
535
  };
536
- return ce(n), o;
536
+ return de(n), l;
537
537
  }
538
538
  function Xt() {
539
- const e = W(!1), t = Ee();
540
- return t && te(() => {
539
+ const e = H(!1), t = Ie();
540
+ return t && ne(() => {
541
541
  e.value = !0;
542
542
  }, t), e;
543
543
  }
544
- function Qe(e) {
544
+ function Ze(e) {
545
545
  const t = Xt();
546
- return A(() => (t.value, !!e()));
546
+ return I(() => (t.value, !!e()));
547
547
  }
548
- function Ze(e, t, n = {}) {
549
- const { window: l = he, ...i } = n;
550
- let u;
551
- const o = Qe(() => l && "MutationObserver" in l), a = () => {
552
- u && (u.disconnect(), u = void 0);
553
- }, r = A(() => {
554
- const m = C(e), d = q(m).map(ee).filter(Rt);
555
- return new Set(d);
556
- }), s = N(
557
- () => r.value,
548
+ function Ke(e, t, n = {}) {
549
+ const { window: o = pe, ...u } = n;
550
+ let d;
551
+ const l = Ze(() => o && "MutationObserver" in o), a = () => {
552
+ d && (d.disconnect(), d = void 0);
553
+ }, i = I(() => {
554
+ const m = C(e), w = J(m).map(te).filter(Pt);
555
+ return new Set(w);
556
+ }), r = V(
557
+ () => i.value,
558
558
  (m) => {
559
- a(), o.value && m.size && (u = new MutationObserver(t), m.forEach((d) => u.observe(d, i)));
559
+ a(), l.value && m.size && (d = new MutationObserver(t), m.forEach((w) => d.observe(w, u)));
560
560
  },
561
561
  { immediate: !0, flush: "post" }
562
- ), c = () => u == null ? void 0 : u.takeRecords(), v = () => {
563
- s(), a();
562
+ ), s = () => d == null ? void 0 : d.takeRecords(), v = () => {
563
+ r(), a();
564
564
  };
565
- return ce(v), {
566
- isSupported: o,
565
+ return de(v), {
566
+ isSupported: l,
567
567
  stop: v,
568
- takeRecords: c
568
+ takeRecords: s
569
569
  };
570
570
  }
571
- function ge(e, t = {}) {
571
+ function we(e, t = {}) {
572
572
  var n;
573
573
  const {
574
- pointerTypes: l,
575
- preventDefault: i,
576
- stopPropagation: u,
577
- exact: o,
574
+ pointerTypes: o,
575
+ preventDefault: u,
576
+ stopPropagation: d,
577
+ exact: l,
578
578
  onMove: a,
579
- onEnd: r,
580
- onStart: s,
581
- initialValue: c,
579
+ onEnd: i,
580
+ onStart: r,
581
+ initialValue: s,
582
582
  axis: v = "both",
583
- draggingElement: m = he,
584
- containerElement: d,
583
+ draggingElement: m = pe,
584
+ containerElement: w,
585
585
  handle: g = e,
586
- buttons: M = [0]
587
- } = t, f = P(
588
- (n = C(c)) != null ? n : { x: 0, y: 0 }
589
- ), p = P(), w = (b) => l ? l.includes(b.pointerType) : !0, E = (b) => {
590
- C(i) && b.preventDefault(), C(u) && b.stopPropagation();
591
- }, I = (b) => {
592
- var T;
593
- if (!C(M).includes(b.button) || C(t.disabled) || !w(b) || C(o) && b.target !== C(e))
586
+ buttons: y = [0]
587
+ } = t, f = R(
588
+ (n = C(s)) != null ? n : { x: 0, y: 0 }
589
+ ), c = R(), h = (E) => o ? o.includes(E.pointerType) : !0, A = (E) => {
590
+ C(u) && E.preventDefault(), C(d) && E.stopPropagation();
591
+ }, M = (E) => {
592
+ var D;
593
+ if (!C(y).includes(E.button) || C(t.disabled) || !h(E) || C(l) && E.target !== C(e))
594
594
  return;
595
- const V = C(d), j = (T = V == null ? void 0 : V.getBoundingClientRect) == null ? void 0 : T.call(V), h = C(e).getBoundingClientRect(), y = {
596
- x: b.clientX - (V ? h.left - j.left + V.scrollLeft : h.left),
597
- y: b.clientY - (V ? h.top - j.top + V.scrollTop : h.top)
595
+ const X = C(w), j = (D = X == null ? void 0 : X.getBoundingClientRect) == null ? void 0 : D.call(X), N = C(e).getBoundingClientRect(), p = {
596
+ x: E.clientX - (X ? N.left - j.left + X.scrollLeft : N.left),
597
+ y: E.clientY - (X ? N.top - j.top + X.scrollTop : N.top)
598
598
  };
599
- (s == null ? void 0 : s(y, b)) !== !1 && (p.value = y, E(b));
600
- }, k = (b) => {
601
- if (C(t.disabled) || !w(b) || !p.value)
599
+ (r == null ? void 0 : r(p, E)) !== !1 && (c.value = p, A(E));
600
+ }, $ = (E) => {
601
+ if (C(t.disabled) || !h(E) || !c.value)
602
602
  return;
603
- const T = C(d), V = C(e).getBoundingClientRect();
604
- let { x: j, y: h } = f.value;
605
- (v === "x" || v === "both") && (j = b.clientX - p.value.x, T && (j = Math.min(Math.max(0, j), T.scrollWidth - V.width))), (v === "y" || v === "both") && (h = b.clientY - p.value.y, T && (h = Math.min(Math.max(0, h), T.scrollHeight - V.height))), f.value = {
603
+ const D = C(w), X = C(e).getBoundingClientRect();
604
+ let { x: j, y: N } = f.value;
605
+ (v === "x" || v === "both") && (j = E.clientX - c.value.x, D && (j = Math.min(Math.max(0, j), D.scrollWidth - X.width))), (v === "y" || v === "both") && (N = E.clientY - c.value.y, D && (N = Math.min(Math.max(0, N), D.scrollHeight - X.height))), f.value = {
606
606
  x: j,
607
- y: h
608
- }, a == null || a(f.value, b), E(b);
609
- }, S = (b) => {
610
- C(t.disabled) || !w(b) || p.value && (p.value = void 0, r == null || r(f.value, b), E(b));
607
+ y: N
608
+ }, a == null || a(f.value, E), A(E);
609
+ }, B = (E) => {
610
+ C(t.disabled) || !h(E) || c.value && (c.value = void 0, i == null || i(f.value, E), A(E));
611
611
  };
612
- if (pe) {
613
- const b = () => {
614
- var T;
612
+ if (he) {
613
+ const E = () => {
614
+ var D;
615
615
  return {
616
- capture: (T = t.capture) != null ? T : !0,
617
- passive: !C(i)
616
+ capture: (D = t.capture) != null ? D : !0,
617
+ passive: !C(u)
618
618
  };
619
619
  };
620
- ie(g, "pointerdown", I, b), ie(m, "pointermove", k, b), ie(m, "pointerup", S, b);
620
+ ue(g, "pointerdown", M, E), ue(m, "pointermove", $, E), ue(m, "pointerup", B, E);
621
621
  }
622
622
  return {
623
- ...Ht(f),
623
+ ...Wt(f),
624
624
  position: f,
625
- isDragging: A(() => !!p.value),
626
- style: A(
625
+ isDragging: I(() => !!c.value),
626
+ style: I(
627
627
  () => `left:${f.value.x}px;top:${f.value.y}px;`
628
628
  )
629
629
  };
630
630
  }
631
631
  function Vt(e, t, n = {}) {
632
- const { window: l = he, ...i } = n;
633
- let u;
634
- const o = Qe(() => l && "ResizeObserver" in l), a = () => {
635
- u && (u.disconnect(), u = void 0);
636
- }, r = A(() => {
632
+ const { window: o = pe, ...u } = n;
633
+ let d;
634
+ const l = Ze(() => o && "ResizeObserver" in o), a = () => {
635
+ d && (d.disconnect(), d = void 0);
636
+ }, i = I(() => {
637
637
  const v = C(e);
638
- return Array.isArray(v) ? v.map((m) => ee(m)) : [ee(v)];
639
- }), s = N(
640
- r,
638
+ return Array.isArray(v) ? v.map((m) => te(m)) : [te(v)];
639
+ }), r = V(
640
+ i,
641
641
  (v) => {
642
- if (a(), o.value && l) {
643
- u = new ResizeObserver(t);
642
+ if (a(), l.value && o) {
643
+ d = new ResizeObserver(t);
644
644
  for (const m of v)
645
- m && u.observe(m, i);
645
+ m && d.observe(m, u);
646
646
  }
647
647
  },
648
648
  { immediate: !0, flush: "post" }
649
- ), c = () => {
650
- a(), s();
649
+ ), s = () => {
650
+ a(), r();
651
651
  };
652
- return ce(c), {
653
- isSupported: o,
654
- stop: c
652
+ return de(s), {
653
+ isSupported: l,
654
+ stop: s
655
655
  };
656
656
  }
657
- function me(e, t = {}) {
657
+ function ge(e, t = {}) {
658
658
  const {
659
659
  reset: n = !0,
660
- windowResize: l = !0,
661
- windowScroll: i = !0,
662
- immediate: u = !0,
663
- updateTiming: o = "sync"
664
- } = t, a = W(0), r = W(0), s = W(0), c = W(0), v = W(0), m = W(0), d = W(0), g = W(0);
665
- function M() {
666
- const p = ee(e);
667
- if (!p) {
668
- n && (a.value = 0, r.value = 0, s.value = 0, c.value = 0, v.value = 0, m.value = 0, d.value = 0, g.value = 0);
660
+ windowResize: o = !0,
661
+ windowScroll: u = !0,
662
+ immediate: d = !0,
663
+ updateTiming: l = "sync"
664
+ } = t, a = H(0), i = H(0), r = H(0), s = H(0), v = H(0), m = H(0), w = H(0), g = H(0);
665
+ function y() {
666
+ const c = te(e);
667
+ if (!c) {
668
+ n && (a.value = 0, i.value = 0, r.value = 0, s.value = 0, v.value = 0, m.value = 0, w.value = 0, g.value = 0);
669
669
  return;
670
670
  }
671
- const w = p.getBoundingClientRect();
672
- a.value = w.height, r.value = w.bottom, s.value = w.left, c.value = w.right, v.value = w.top, m.value = w.width, d.value = w.x, g.value = w.y;
671
+ const h = c.getBoundingClientRect();
672
+ a.value = h.height, i.value = h.bottom, r.value = h.left, s.value = h.right, v.value = h.top, m.value = h.width, w.value = h.x, g.value = h.y;
673
673
  }
674
674
  function f() {
675
- o === "sync" ? M() : o === "next-frame" && requestAnimationFrame(() => M());
675
+ l === "sync" ? y() : l === "next-frame" && requestAnimationFrame(() => y());
676
676
  }
677
- return Vt(e, f), N(() => ee(e), (p) => !p && f()), Ze(e, f, {
677
+ return Vt(e, f), V(() => te(e), (c) => !c && f()), Ke(e, f, {
678
678
  attributeFilter: ["style", "class"]
679
- }), i && ie("scroll", f, { capture: !0, passive: !0 }), l && ie("resize", f, { passive: !0 }), Wt(() => {
680
- u && f();
679
+ }), u && ue("scroll", f, { capture: !0, passive: !0 }), o && ue("resize", f, { passive: !0 }), Bt(() => {
680
+ d && f();
681
681
  }), {
682
682
  height: a,
683
- bottom: r,
684
- left: s,
685
- right: c,
683
+ bottom: i,
684
+ left: r,
685
+ right: s,
686
686
  top: v,
687
687
  width: m,
688
- x: d,
688
+ x: w,
689
689
  y: g,
690
690
  update: f
691
691
  };
@@ -693,7 +693,7 @@ function me(e, t = {}) {
693
693
  const Nt = (e) => {
694
694
  const t = new DOMParser().parseFromString(e, "text/html");
695
695
  return Array.from(t.body.childNodes).some((n) => n.nodeType === 1);
696
- }, Bt = (e = 8) => Array.from({ length: e }, () => Math.floor(Math.random() * 16).toString(16)).join(""), zt = ["data-colindex", "data-rowindex", "data-editable", "contenteditable", "tabindex"], Ft = ["innerHTML"], jt = { key: 2 }, Gt = /* @__PURE__ */ J({
696
+ }, Gt = (e = 8) => Array.from({ length: e }, () => Math.floor(Math.random() * 16).toString(16)).join(""), zt = ["data-colindex", "data-rowindex", "data-editable", "contenteditable", "tabindex"], Ft = ["innerHTML"], jt = { key: 2 }, Ut = /* @__PURE__ */ Q({
697
697
  __name: "ACell",
698
698
  props: {
699
699
  colIndex: {},
@@ -704,75 +704,75 @@ const Nt = (e) => {
704
704
  pinned: { type: Boolean, default: !1 }
705
705
  },
706
706
  setup(e, { expose: t }) {
707
- const n = B("cell"), l = e.store.getCellData(e.colIndex, e.rowIndex), i = P(""), u = P(!1), o = e.store.columns[e.colIndex], a = e.store.rows[e.rowIndex], r = o.align || "center", s = o.width || "40ch", c = A(() => e.store.getCellDisplayValue(e.colIndex, e.rowIndex)), v = A(() => typeof c.value == "string" ? Nt(c.value) : !1), m = A(() => {
708
- var p;
707
+ const n = G("cell"), o = e.store.getCellData(e.colIndex, e.rowIndex), u = R(""), d = R(!1), l = e.store.columns[e.colIndex], a = e.store.rows[e.rowIndex], i = l.align || "center", r = l.width || "40ch", s = I(() => e.store.getCellDisplayValue(e.colIndex, e.rowIndex)), v = I(() => typeof s.value == "string" ? Nt(s.value) : !1), m = I(() => {
708
+ var c;
709
709
  return {
710
- textAlign: r,
711
- width: s,
712
- fontWeight: u.value ? "bold" : "inherit",
713
- paddingLeft: e.store.getIndent(e.colIndex, (p = e.store.display[e.rowIndex]) == null ? void 0 : p.indent)
710
+ textAlign: i,
711
+ width: r,
712
+ fontWeight: d.value ? "bold" : "inherit",
713
+ paddingLeft: e.store.getIndent(e.colIndex, (c = e.store.display[e.rowIndex]) == null ? void 0 : c.indent)
714
714
  };
715
- }), d = A(() => ({
715
+ }), w = I(() => ({
716
716
  "sticky-column": e.pinned,
717
- "cell-modified": u.value
717
+ "cell-modified": d.value
718
718
  })), g = () => {
719
- const { left: p, bottom: w, width: E, height: I } = me(n);
720
- o.mask, o.modalComponent && e.store.$patch((k) => {
721
- k.modal.visible = !0, k.modal.colIndex = e.colIndex, k.modal.rowIndex = e.rowIndex, k.modal.left = p, k.modal.bottom = w, k.modal.width = E, k.modal.height = I, k.modal.cell = n.value, typeof o.modalComponent == "function" ? k.modal.component = o.modalComponent({ table: k.table, row: a, column: o }) : k.modal.component = o.modalComponent, k.modal.componentProps = o.modalComponentExtraProps;
719
+ const { left: c, bottom: h, width: A, height: M } = ge(n);
720
+ l.mask, l.modalComponent && e.store.$patch(($) => {
721
+ $.modal.visible = !0, $.modal.colIndex = e.colIndex, $.modal.rowIndex = e.rowIndex, $.modal.left = c, $.modal.bottom = h, $.modal.width = A, $.modal.height = M, $.modal.cell = n.value, typeof l.modalComponent == "function" ? $.modal.component = l.modalComponent({ table: $.table, row: a, column: l }) : $.modal.component = l.modalComponent, $.modal.componentProps = l.modalComponentExtraProps;
722
722
  });
723
723
  };
724
724
  if (e.addNavigation) {
725
- let p = {
726
- ...Te,
725
+ let c = {
726
+ ...Re,
727
727
  "keydown.f2": g,
728
728
  "keydown.alt.up": g,
729
729
  "keydown.alt.down": g,
730
730
  "keydown.alt.left": g,
731
731
  "keydown.alt.right": g
732
732
  };
733
- typeof e.addNavigation == "object" && (p = {
734
- ...p,
733
+ typeof e.addNavigation == "object" && (c = {
734
+ ...c,
735
735
  ...e.addNavigation
736
- }), Re([
736
+ }), Pe([
737
737
  {
738
738
  selectors: n,
739
- handlers: p
739
+ handlers: c
740
740
  }
741
741
  ]);
742
742
  }
743
- const M = () => {
744
- n.value && (i.value = n.value.textContent);
745
- }, f = (p) => {
746
- const w = p.target;
747
- w.textContent !== i.value && (i.value = w.textContent, o.format ? (u.value = w.textContent !== e.store.getFormattedValue(e.colIndex, e.rowIndex, l), e.store.setCellText(e.colIndex, e.rowIndex, w.textContent)) : (u.value = w.textContent !== l, e.store.setCellData(e.colIndex, e.rowIndex, w.textContent)));
743
+ const y = () => {
744
+ n.value && (u.value = n.value.textContent);
745
+ }, f = (c) => {
746
+ const h = c.target;
747
+ h.textContent !== u.value && (u.value = h.textContent, l.format ? (d.value = h.textContent !== e.store.getFormattedValue(e.colIndex, e.rowIndex, o), e.store.setCellText(e.colIndex, e.rowIndex, h.textContent)) : (d.value = h.textContent !== o, e.store.setCellData(e.colIndex, e.rowIndex, h.textContent)));
748
748
  };
749
749
  return t({
750
- currentData: i
751
- }), (p, w) => ($(), R("td", {
750
+ currentData: u
751
+ }), (c, h) => (k(), T("td", {
752
752
  ref: "cell",
753
- "data-colindex": p.colIndex,
754
- "data-rowindex": p.rowIndex,
755
- "data-editable": x(o).edit,
756
- contenteditable: x(o).edit,
757
- tabindex: p.tabIndex,
753
+ "data-colindex": c.colIndex,
754
+ "data-rowindex": c.rowIndex,
755
+ "data-editable": x(l).edit,
756
+ contenteditable: x(l).edit,
757
+ tabindex: c.tabIndex,
758
758
  spellcheck: !1,
759
- style: Y(m.value),
760
- onFocus: M,
759
+ style: q(m.value),
760
+ onFocus: y,
761
761
  onPaste: f,
762
762
  onInput: f,
763
763
  onClick: g,
764
- class: G(["atable-cell", d.value])
764
+ class: U(["atable-cell", w.value])
765
765
  }, [
766
- x(o).cellComponent ? ($(), ae(fe(x(o).cellComponent), ke({
766
+ x(l).cellComponent ? (k(), se(ve(x(l).cellComponent), ke({
767
767
  key: 0,
768
- value: c.value
769
- }, x(o).cellComponentProps), null, 16, ["value"])) : v.value ? ($(), R("span", {
768
+ value: s.value
769
+ }, x(l).cellComponentProps), null, 16, ["value"])) : v.value ? (k(), T("span", {
770
770
  key: 1,
771
- innerHTML: c.value
772
- }, null, 8, Ft)) : ($(), R("span", jt, Z(c.value), 1))
771
+ innerHTML: s.value
772
+ }, null, 8, Ft)) : (k(), T("span", jt, K(s.value), 1))
773
773
  ], 46, zt));
774
774
  }
775
- }), Ut = ["tabindex"], Yt = ["tabindex"], qt = ["colspan"], Jt = /* @__PURE__ */ J({
775
+ }), Yt = ["tabindex"], qt = ["tabindex"], Jt = ["colspan"], Qt = /* @__PURE__ */ Q({
776
776
  __name: "AExpansionRow",
777
777
  props: {
778
778
  rowIndex: {},
@@ -781,180 +781,189 @@ const Nt = (e) => {
781
781
  addNavigation: { type: [Boolean, Object] }
782
782
  },
783
783
  setup(e) {
784
- const t = B("rowEl"), n = A(() => e.store.display[e.rowIndex].expanded ? "▼" : "►");
784
+ const t = G("rowEl"), n = I(() => e.store.display[e.rowIndex].expanded ? "▼" : "►");
785
785
  if (e.addNavigation) {
786
- const l = {
787
- "keydown.control.g": (i) => {
788
- i.stopPropagation(), i.preventDefault(), e.store.toggleRowExpand(e.rowIndex);
786
+ const o = {
787
+ "keydown.control.g": (u) => {
788
+ u.stopPropagation(), u.preventDefault(), e.store.toggleRowExpand(e.rowIndex);
789
789
  }
790
790
  };
791
- typeof e.addNavigation == "object" && Object.assign(l, e.addNavigation), Re([
791
+ typeof e.addNavigation == "object" && Object.assign(o, e.addNavigation), Pe([
792
792
  {
793
793
  selectors: t,
794
- handlers: l
794
+ handlers: o
795
795
  }
796
796
  ]);
797
797
  }
798
- return (l, i) => ($(), R(re, null, [
799
- D("tr", ke(l.$attrs, {
798
+ return (o, u) => (k(), T(ie, null, [
799
+ O("tr", ke(o.$attrs, {
800
800
  ref: "rowEl",
801
- tabindex: l.tabIndex,
801
+ tabindex: o.tabIndex,
802
802
  class: "expandable-row"
803
803
  }), [
804
- D("td", {
804
+ O("td", {
805
805
  tabIndex: -1,
806
- onClick: i[0] || (i[0] = (u) => l.store.toggleRowExpand(l.rowIndex)),
806
+ onClick: u[0] || (u[0] = (d) => o.store.toggleRowExpand(o.rowIndex)),
807
807
  class: "row-index"
808
- }, Z(n.value), 1),
809
- X(l.$slots, "row", {}, void 0, !0)
810
- ], 16, Ut),
811
- l.store.display[l.rowIndex].expanded ? ($(), R("tr", {
808
+ }, K(n.value), 1),
809
+ W(o.$slots, "row", {}, void 0, !0)
810
+ ], 16, Yt),
811
+ o.store.display[o.rowIndex].expanded ? (k(), T("tr", {
812
812
  key: 0,
813
813
  ref: "rowExpanded",
814
- tabindex: l.tabIndex,
814
+ tabindex: o.tabIndex,
815
815
  class: "expanded-row"
816
816
  }, [
817
- D("td", {
817
+ O("td", {
818
818
  tabIndex: -1,
819
- colspan: l.store.columns.length + 1,
819
+ colspan: o.store.columns.length + 1,
820
820
  class: "expanded-row-content"
821
821
  }, [
822
- X(l.$slots, "content", {}, void 0, !0)
823
- ], 8, qt)
824
- ], 8, Yt)) : K("", !0)
822
+ W(o.$slots, "content", {}, void 0, !0)
823
+ ], 8, Jt)
824
+ ], 8, qt)) : _("", !0)
825
825
  ], 64));
826
826
  }
827
- }), oe = (e, t) => {
827
+ }), le = (e, t) => {
828
828
  const n = e.__vccOpts || e;
829
- for (const [l, i] of t)
830
- n[l] = i;
829
+ for (const [o, u] of t)
830
+ n[o] = u;
831
831
  return n;
832
- }, Qt = /* @__PURE__ */ oe(Jt, [["__scopeId", "data-v-5ad4bb41"]]), Zt = ["colspan"], Kt = {
832
+ }, Zt = /* @__PURE__ */ le(Qt, [["__scopeId", "data-v-5ad4bb41"]]), Kt = ["colspan"], _t = {
833
833
  ref: "container",
834
834
  class: "gantt-handler"
835
- }, _t = {
835
+ }, en = {
836
836
  key: 0,
837
837
  class: "gantt-label"
838
- }, en = /* @__PURE__ */ J({
838
+ }, tn = /* @__PURE__ */ Q({
839
839
  __name: "AGanttCell",
840
840
  props: {
841
+ store: {},
842
+ columnsCount: {},
843
+ rowIndex: {},
844
+ colIndex: {},
841
845
  start: {},
842
846
  end: {},
843
847
  colspan: { default: 1 },
844
848
  label: {},
845
849
  color: {}
846
850
  },
847
- emits: ["update:start", "update:end", "drag"],
848
- setup(e, { emit: t }) {
849
- ut((E) => ({
850
- "00252b09": n.value,
851
- "9d36bafe": E.colspan
851
+ setup(e) {
852
+ ct((c) => ({
853
+ e3124eea: t.value,
854
+ "58306efa": c.colspan
852
855
  }));
853
- const n = P();
854
- te(() => {
855
- !e.color || e.color == "" || e.color.length < 6 ? n.value = "#cccccc" : n.value = e.color;
856
+ const t = R();
857
+ ne(() => {
858
+ !e.color || e.color == "" || e.color.length < 6 ? t.value = "#cccccc" : t.value = e.color;
856
859
  });
857
- const l = t, i = B("container"), u = B("bar"), o = B("leftHandle"), a = B("rightHandle"), { width: r } = me(i), { left: s, right: c } = me(u), v = P(e.start || 0), m = P(e.end || e.colspan), d = P({ startX: 0, startPos: 0 }), g = A(() => e.colspan > 0 ? r.value / e.colspan : 0), M = A(() => {
858
- const E = v.value / e.colspan * 100, I = m.value / e.colspan * 100;
860
+ const n = G("container"), o = G("bar"), u = G("leftHandle"), d = G("rightHandle"), { width: l } = ge(n), { left: a, right: i } = ge(o), r = R(e.start || 0), s = R(e.end || r.value + e.colspan), v = R({ startX: 0, startPos: 0 }), m = I(() => e.colspan > 0 ? l.value / e.colspan : 0), w = I(() => {
861
+ const c = r.value / e.colspan * 100, h = s.value / e.colspan * 100;
859
862
  return {
860
- left: `${E}%`,
861
- width: `${I - E}%`,
862
- backgroundColor: n.value
863
+ left: `${c}%`,
864
+ width: `${h - c}%`,
865
+ backgroundColor: t.value
863
866
  };
864
- }), { isDragging: f } = ge(o, {
867
+ }), { isDragging: g } = we(u, {
865
868
  axis: "x",
866
869
  onStart: () => {
867
- u.value && (u.value.style.transition = "none"), d.value = {
868
- startX: s.value,
869
- startPos: v.value
870
+ o.value && (o.value.style.transition = "none"), v.value = {
871
+ startX: a.value,
872
+ startPos: r.value
870
873
  };
871
874
  },
872
- onMove: ({ x: E }) => {
873
- if (f.value && u.value) {
874
- const k = (E - d.value.startX) / g.value, S = Math.max(0, Math.min(m.value - 1, d.value.startPos + k));
875
- u.value.style.left = `${S / e.colspan * 100}%`, u.value.style.width = `${(m.value - S) / e.colspan * 100}%`;
875
+ onMove: ({ x: c }) => {
876
+ if (g.value && o.value) {
877
+ const A = (c - v.value.startX) / m.value, M = Math.max(0, Math.min(s.value - 1, v.value.startPos + A));
878
+ o.value.style.left = `${M / e.colspan * 100}%`, o.value.style.width = `${(s.value - M) / e.colspan * 100}%`;
876
879
  }
877
880
  },
878
- onEnd: ({ x: E }) => {
879
- if (u.value) {
880
- const I = E - d.value.startX, k = Math.round(I / g.value), S = Math.max(0, Math.min(m.value - 1, d.value.startPos + k));
881
- v.value = S, l("update:start", S), l("drag", { type: "resize", edge: "start", value: S });
881
+ onEnd: ({ x: c }) => {
882
+ if (o.value) {
883
+ const h = c - v.value.startX, A = Math.round(h / m.value), M = Math.max(0, Math.min(s.value - 1, v.value.startPos + A));
884
+ r.value = M, e.store.updateGanttBar({ rowIndex: e.rowIndex, colIndex: e.colIndex, type: "resize", edge: "start", value: M });
882
885
  }
883
886
  }
884
- }), { isDragging: p } = ge(a, {
887
+ }), { isDragging: y } = we(d, {
885
888
  axis: "x",
886
889
  onStart: () => {
887
- u.value && (u.value.style.transition = "none"), d.value = {
888
- startX: c.value,
889
- startPos: m.value
890
+ o.value && (o.value.style.transition = "none"), v.value = {
891
+ startX: i.value,
892
+ startPos: s.value
890
893
  };
891
894
  },
892
- onMove: ({ x: E }) => {
893
- if (p.value && u.value) {
894
- const k = (E - d.value.startX) / g.value, S = Math.max(v.value + 1, Math.min(e.colspan, d.value.startPos + k));
895
- u.value.style.width = `${(S - v.value) / e.colspan * 100}%`;
895
+ onMove: ({ x: c }) => {
896
+ if (y.value && o.value) {
897
+ const A = (c - v.value.startX) / m.value, M = Math.max(
898
+ r.value + 1,
899
+ Math.min(e.columnsCount, v.value.startPos + A)
900
+ );
901
+ o.value.style.width = `${(M - r.value) / e.colspan * 100}%`;
896
902
  }
897
903
  },
898
- onEnd: ({ x: E }) => {
899
- if (u.value) {
900
- const I = E - d.value.startX, k = Math.round(I / g.value), S = Math.max(v.value + 1, Math.min(e.colspan, d.value.startPos + k));
901
- m.value = S, l("update:end", S), l("drag", { type: "resize", edge: "end", value: S });
904
+ onEnd: ({ x: c }) => {
905
+ if (o.value) {
906
+ const h = c - v.value.startX, A = Math.round(h / m.value), M = Math.max(
907
+ r.value + 1,
908
+ Math.min(e.columnsCount, v.value.startPos + A)
909
+ );
910
+ s.value = M, e.store.updateGanttBar({ rowIndex: e.rowIndex, colIndex: e.colIndex, type: "resize", edge: "end", value: M });
902
911
  }
903
912
  }
904
- }), { isDragging: w } = ge(u, {
913
+ }), { isDragging: f } = we(o, {
905
914
  exact: !0,
906
915
  // to avoid triggering when the left and right handles are being used
907
916
  axis: "x",
908
917
  onStart: () => {
909
- u.value && (u.value.style.transition = "none"), d.value = {
910
- startX: s.value,
911
- startPos: v.value
918
+ o.value && (o.value.style.transition = "none"), v.value = {
919
+ startX: a.value,
920
+ startPos: r.value
912
921
  };
913
922
  },
914
- onMove: ({ x: E }) => {
915
- if (w.value && u.value) {
916
- const k = (E - d.value.startX) / g.value, S = m.value - v.value, b = Math.max(0, Math.min(d.value.startPos + k, e.colspan - S));
917
- u.value.style.left = `${b / e.colspan * 100}%`;
923
+ onMove: ({ x: c }) => {
924
+ if (f.value && o.value) {
925
+ const A = (c - v.value.startX) / m.value, M = s.value - r.value, $ = Math.max(0, Math.min(v.value.startPos + A, e.columnsCount - M));
926
+ o.value.style.left = `${$ / e.colspan * 100}%`;
918
927
  }
919
928
  },
920
- onEnd: ({ x: E }) => {
921
- if (u.value) {
922
- const I = E - d.value.startX, k = Math.round(I / g.value), S = m.value - v.value;
923
- let b = d.value.startPos + k, T = b + S;
924
- b < 0 ? (b = 0, T = S) : T > e.colspan && (T = e.colspan, b = T - S), v.value = b, m.value = T, l("update:start", b), l("update:end", T), l("drag", { type: "bar", start: b, end: T });
929
+ onEnd: ({ x: c }) => {
930
+ if (o.value) {
931
+ const h = c - v.value.startX, A = Math.round(h / m.value), M = s.value - r.value;
932
+ let $ = v.value.startPos + A, B = $ + M;
933
+ $ < 0 ? ($ = 0, B = M) : B > e.columnsCount && (B = e.columnsCount, $ = B - M), r.value = $, s.value = B, e.store.updateGanttBar({ rowIndex: e.rowIndex, colIndex: e.colIndex, type: "bar", start: $, end: B });
925
934
  }
926
935
  }
927
936
  });
928
- return (E, I) => ($(), R("td", {
937
+ return (c, h) => (k(), T("td", {
929
938
  class: "aganttcell",
930
- colspan: E.colspan
939
+ colspan: c.colspan
931
940
  }, [
932
- D("div", Kt, [
933
- D("div", {
941
+ O("div", _t, [
942
+ O("div", {
934
943
  ref: "bar",
935
- class: G(["gantt-bar", { "is-dragging": x(w) || x(f) || x(p) }]),
936
- style: Y(M.value)
944
+ class: U(["gantt-bar", { "is-dragging": x(f) || x(g) || x(y) }]),
945
+ style: q(w.value)
937
946
  }, [
938
- D("div", {
947
+ O("div", {
939
948
  ref: "leftHandle",
940
- class: G(["gantt-handle left-handle", { "is-dragging": x(f) }])
941
- }, I[0] || (I[0] = [
942
- D("div", { class: "handle-grip" }, null, -1),
943
- D("div", { class: "vertical-indicator left-indicator" }, null, -1)
949
+ class: U(["gantt-handle left-handle", { "is-dragging": x(g) }])
950
+ }, h[0] || (h[0] = [
951
+ O("div", { class: "handle-grip" }, null, -1),
952
+ O("div", { class: "vertical-indicator left-indicator" }, null, -1)
944
953
  ]), 2),
945
- E.label ? ($(), R("label", _t, Z(E.label), 1)) : K("", !0),
946
- D("div", {
954
+ c.label ? (k(), T("label", en, K(c.label), 1)) : _("", !0),
955
+ O("div", {
947
956
  ref: "rightHandle",
948
- class: G(["gantt-handle right-handle", { "is-dragging": x(p) }])
949
- }, I[1] || (I[1] = [
950
- D("div", { class: "handle-grip" }, null, -1),
951
- D("div", { class: "vertical-indicator right-indicator" }, null, -1)
957
+ class: U(["gantt-handle right-handle", { "is-dragging": x(y) }])
958
+ }, h[1] || (h[1] = [
959
+ O("div", { class: "handle-grip" }, null, -1),
960
+ O("div", { class: "vertical-indicator right-indicator" }, null, -1)
952
961
  ]), 2)
953
962
  ], 6)
954
963
  ], 512)
955
- ], 8, Zt));
964
+ ], 8, Kt));
956
965
  }
957
- }), tn = /* @__PURE__ */ oe(en, [["__scopeId", "data-v-630a49bb"]]), nn = ["tabindex"], on = /* @__PURE__ */ J({
966
+ }), nn = /* @__PURE__ */ le(tn, [["__scopeId", "data-v-133983c1"]]), on = ["tabindex"], ln = /* @__PURE__ */ Q({
958
967
  __name: "ARow",
959
968
  props: {
960
969
  rowIndex: {},
@@ -963,386 +972,391 @@ const Nt = (e) => {
963
972
  addNavigation: { type: [Boolean, Object], default: !1 }
964
973
  },
965
974
  setup(e) {
966
- const t = B("rowEl"), n = A(() => e.store.isRowVisible(e.rowIndex)), l = A(() => e.store.getRowExpandSymbol(e.rowIndex));
975
+ const t = G("rowEl"), n = I(() => e.store.isRowVisible(e.rowIndex)), o = I(() => e.store.getRowExpandSymbol(e.rowIndex));
967
976
  if (e.addNavigation) {
968
- let i = Te;
969
- typeof e.addNavigation == "object" && (i = {
970
- ...i,
977
+ let u = Re;
978
+ typeof e.addNavigation == "object" && (u = {
979
+ ...u,
971
980
  ...e.addNavigation
972
- }), Re([
981
+ }), Pe([
973
982
  {
974
983
  selectors: t,
975
- handlers: i
984
+ handlers: u
976
985
  }
977
986
  ]);
978
987
  }
979
- return (i, u) => be(($(), R("tr", {
988
+ return (u, d) => xe((k(), T("tr", {
980
989
  ref: "rowEl",
981
- tabindex: i.tabIndex,
990
+ tabindex: u.tabIndex,
982
991
  class: "atable-row"
983
992
  }, [
984
- i.store.config.view !== "uncounted" ? X(i.$slots, "index", { key: 0 }, () => [
985
- i.store.config.view === "list" ? ($(), R("td", {
993
+ u.store.config.view !== "uncounted" ? W(u.$slots, "index", { key: 0 }, () => [
994
+ u.store.config.view === "list" ? (k(), T("td", {
986
995
  key: 0,
987
996
  tabIndex: -1,
988
- class: G(["list-index", i.store.hasPinnedColumns ? "sticky-index" : ""])
989
- }, Z(i.rowIndex + 1), 3)) : i.store.config.view === "tree" ? ($(), R("td", {
997
+ class: U(["list-index", u.store.hasPinnedColumns ? "sticky-index" : ""])
998
+ }, K(u.rowIndex + 1), 3)) : u.store.config.view === "tree" ? (k(), T("td", {
990
999
  key: 1,
991
1000
  tabIndex: -1,
992
- class: G(["tree-index", i.store.hasPinnedColumns ? "sticky-index" : ""]),
993
- onClick: u[0] || (u[0] = (o) => i.store.toggleRowExpand(i.rowIndex))
994
- }, Z(l.value), 3)) : K("", !0)
995
- ], !0) : K("", !0),
996
- X(i.$slots, "default", {}, void 0, !0)
997
- ], 8, nn)), [
998
- [Ye, n.value]
1001
+ class: U(["tree-index", u.store.hasPinnedColumns ? "sticky-index" : ""]),
1002
+ onClick: d[0] || (d[0] = (l) => u.store.toggleRowExpand(u.rowIndex))
1003
+ }, K(o.value), 3)) : _("", !0)
1004
+ ], !0) : _("", !0),
1005
+ W(u.$slots, "default", {}, void 0, !0)
1006
+ ], 8, on)), [
1007
+ [qe, n.value]
999
1008
  ]);
1000
1009
  }
1001
- }), Ke = /* @__PURE__ */ oe(on, [["__scopeId", "data-v-4cb4f254"]]), _e = pe ? window : void 0;
1002
- function se(e) {
1010
+ }), _e = /* @__PURE__ */ le(ln, [["__scopeId", "data-v-4cb4f254"]]), et = he ? window : void 0;
1011
+ function re(e) {
1003
1012
  var t;
1004
1013
  const n = C(e);
1005
1014
  return (t = n == null ? void 0 : n.$el) != null ? t : n;
1006
1015
  }
1007
- function Q(...e) {
1016
+ function Z(...e) {
1008
1017
  const t = [], n = () => {
1009
1018
  t.forEach((a) => a()), t.length = 0;
1010
- }, l = (a, r, s, c) => (a.addEventListener(r, s, c), () => a.removeEventListener(r, s, c)), i = A(() => {
1011
- const a = q(C(e[0])).filter((r) => r != null);
1012
- return a.every((r) => typeof r != "string") ? a : void 0;
1013
- }), u = Je(
1019
+ }, o = (a, i, r, s) => (a.addEventListener(i, r, s), () => a.removeEventListener(i, r, s)), u = I(() => {
1020
+ const a = J(C(e[0])).filter((i) => i != null);
1021
+ return a.every((i) => typeof i != "string") ? a : void 0;
1022
+ }), d = Qe(
1014
1023
  () => {
1015
- var a, r;
1024
+ var a, i;
1016
1025
  return [
1017
- (r = (a = i.value) == null ? void 0 : a.map((s) => se(s))) != null ? r : [_e].filter((s) => s != null),
1018
- q(C(i.value ? e[1] : e[0])),
1019
- q(x(i.value ? e[2] : e[1])),
1026
+ (i = (a = u.value) == null ? void 0 : a.map((r) => re(r))) != null ? i : [et].filter((r) => r != null),
1027
+ J(C(u.value ? e[1] : e[0])),
1028
+ J(x(u.value ? e[2] : e[1])),
1020
1029
  // @ts-expect-error - TypeScript gets the correct types, but somehow still complains
1021
- C(i.value ? e[3] : e[2])
1030
+ C(u.value ? e[3] : e[2])
1022
1031
  ];
1023
1032
  },
1024
- ([a, r, s, c]) => {
1025
- if (n(), !(a != null && a.length) || !(r != null && r.length) || !(s != null && s.length))
1033
+ ([a, i, r, s]) => {
1034
+ if (n(), !(a != null && a.length) || !(i != null && i.length) || !(r != null && r.length))
1026
1035
  return;
1027
- const v = qe(c) ? { ...c } : c;
1036
+ const v = Je(s) ? { ...s } : s;
1028
1037
  t.push(
1029
1038
  ...a.flatMap(
1030
- (m) => r.flatMap(
1031
- (d) => s.map((g) => l(m, d, g, v))
1039
+ (m) => i.flatMap(
1040
+ (w) => r.map((g) => o(m, w, g, v))
1032
1041
  )
1033
1042
  )
1034
1043
  );
1035
1044
  },
1036
1045
  { flush: "post" }
1037
- ), o = () => {
1038
- u(), n();
1046
+ ), l = () => {
1047
+ d(), n();
1039
1048
  };
1040
- return ce(n), o;
1049
+ return de(n), l;
1041
1050
  }
1042
- let Be = !1;
1051
+ let Ge = !1;
1043
1052
  function ze(e, t, n = {}) {
1044
- const { window: l = _e, ignore: i = [], capture: u = !0, detectIframe: o = !1, controls: a = !1 } = n;
1045
- if (!l)
1046
- return a ? { stop: U, cancel: U, trigger: U } : U;
1047
- if (Ce && !Be) {
1048
- Be = !0;
1053
+ const { window: o = et, ignore: u = [], capture: d = !0, detectIframe: l = !1, controls: a = !1 } = n;
1054
+ if (!o)
1055
+ return a ? { stop: Y, cancel: Y, trigger: Y } : Y;
1056
+ if (Ee && !Ge) {
1057
+ Ge = !0;
1049
1058
  const f = { passive: !0 };
1050
- Array.from(l.document.body.children).forEach((p) => Q(p, "click", U, f)), Q(l.document.documentElement, "click", U, f);
1059
+ Array.from(o.document.body.children).forEach((c) => Z(c, "click", Y, f)), Z(o.document.documentElement, "click", Y, f);
1051
1060
  }
1052
- let r = !0;
1053
- const s = (f) => C(i).some((p) => {
1054
- if (typeof p == "string")
1055
- return Array.from(l.document.querySelectorAll(p)).some((w) => w === f.target || f.composedPath().includes(w));
1061
+ let i = !0;
1062
+ const r = (f) => C(u).some((c) => {
1063
+ if (typeof c == "string")
1064
+ return Array.from(o.document.querySelectorAll(c)).some((h) => h === f.target || f.composedPath().includes(h));
1056
1065
  {
1057
- const w = se(p);
1058
- return w && (f.target === w || f.composedPath().includes(w));
1066
+ const h = re(c);
1067
+ return h && (f.target === h || f.composedPath().includes(h));
1059
1068
  }
1060
1069
  });
1061
- function c(f) {
1062
- const p = C(f);
1063
- return p && p.$.subTree.shapeFlag === 16;
1070
+ function s(f) {
1071
+ const c = C(f);
1072
+ return c && c.$.subTree.shapeFlag === 16;
1064
1073
  }
1065
- function v(f, p) {
1066
- const w = C(f), E = w.$.subTree && w.$.subTree.children;
1067
- return E == null || !Array.isArray(E) ? !1 : E.some((I) => I.el === p.target || p.composedPath().includes(I.el));
1074
+ function v(f, c) {
1075
+ const h = C(f), A = h.$.subTree && h.$.subTree.children;
1076
+ return A == null || !Array.isArray(A) ? !1 : A.some((M) => M.el === c.target || c.composedPath().includes(M.el));
1068
1077
  }
1069
1078
  const m = (f) => {
1070
- const p = se(e);
1071
- if (f.target != null && !(!(p instanceof Element) && c(e) && v(e, f)) && !(!p || p === f.target || f.composedPath().includes(p))) {
1072
- if ("detail" in f && f.detail === 0 && (r = !s(f)), !r) {
1073
- r = !0;
1079
+ const c = re(e);
1080
+ if (f.target != null && !(!(c instanceof Element) && s(e) && v(e, f)) && !(!c || c === f.target || f.composedPath().includes(c))) {
1081
+ if ("detail" in f && f.detail === 0 && (i = !r(f)), !i) {
1082
+ i = !0;
1074
1083
  return;
1075
1084
  }
1076
1085
  t(f);
1077
1086
  }
1078
1087
  };
1079
- let d = !1;
1088
+ let w = !1;
1080
1089
  const g = [
1081
- Q(l, "click", (f) => {
1082
- d || (d = !0, setTimeout(() => {
1083
- d = !1;
1090
+ Z(o, "click", (f) => {
1091
+ w || (w = !0, setTimeout(() => {
1092
+ w = !1;
1084
1093
  }, 0), m(f));
1085
- }, { passive: !0, capture: u }),
1086
- Q(l, "pointerdown", (f) => {
1087
- const p = se(e);
1088
- r = !s(f) && !!(p && !f.composedPath().includes(p));
1094
+ }, { passive: !0, capture: d }),
1095
+ Z(o, "pointerdown", (f) => {
1096
+ const c = re(e);
1097
+ i = !r(f) && !!(c && !f.composedPath().includes(c));
1089
1098
  }, { passive: !0 }),
1090
- o && Q(l, "blur", (f) => {
1099
+ l && Z(o, "blur", (f) => {
1091
1100
  setTimeout(() => {
1092
- var p;
1093
- const w = se(e);
1094
- ((p = l.document.activeElement) == null ? void 0 : p.tagName) === "IFRAME" && !(w != null && w.contains(l.document.activeElement)) && t(f);
1101
+ var c;
1102
+ const h = re(e);
1103
+ ((c = o.document.activeElement) == null ? void 0 : c.tagName) === "IFRAME" && !(h != null && h.contains(o.document.activeElement)) && t(f);
1095
1104
  }, 0);
1096
1105
  }, { passive: !0 })
1097
- ].filter(Boolean), M = () => g.forEach((f) => f());
1106
+ ].filter(Boolean), y = () => g.forEach((f) => f());
1098
1107
  return a ? {
1099
- stop: M,
1108
+ stop: y,
1100
1109
  cancel: () => {
1101
- r = !1;
1110
+ i = !1;
1102
1111
  },
1103
1112
  trigger: (f) => {
1104
- r = !0, m(f), r = !1;
1113
+ i = !0, m(f), i = !1;
1105
1114
  }
1106
- } : M;
1115
+ } : y;
1107
1116
  }
1108
- const ln = {
1117
+ const an = {
1109
1118
  mounted(e, t) {
1110
1119
  const n = !t.modifiers.bubble;
1111
1120
  if (typeof t.value == "function")
1112
1121
  e.__onClickOutside_stop = ze(e, t.value, { capture: n });
1113
1122
  else {
1114
- const [l, i] = t.value;
1115
- e.__onClickOutside_stop = ze(e, l, Object.assign({ capture: n }, i));
1123
+ const [o, u] = t.value;
1124
+ e.__onClickOutside_stop = ze(e, o, Object.assign({ capture: n }, u));
1116
1125
  }
1117
1126
  },
1118
1127
  unmounted(e) {
1119
1128
  e.__onClickOutside_stop();
1120
1129
  }
1121
1130
  };
1122
- function we(e) {
1131
+ function ye(e) {
1123
1132
  return typeof Window < "u" && e instanceof Window ? e.document.documentElement : typeof Document < "u" && e instanceof Document ? e.documentElement : e;
1124
1133
  }
1125
- function et(e) {
1134
+ function tt(e) {
1126
1135
  const t = window.getComputedStyle(e);
1127
1136
  if (t.overflowX === "scroll" || t.overflowY === "scroll" || t.overflowX === "auto" && e.clientWidth < e.scrollWidth || t.overflowY === "auto" && e.clientHeight < e.scrollHeight)
1128
1137
  return !0;
1129
1138
  {
1130
1139
  const n = e.parentNode;
1131
- return !n || n.tagName === "BODY" ? !1 : et(n);
1140
+ return !n || n.tagName === "BODY" ? !1 : tt(n);
1132
1141
  }
1133
1142
  }
1134
- function an(e) {
1143
+ function sn(e) {
1135
1144
  const t = e || window.event, n = t.target;
1136
- return et(n) ? !1 : t.touches.length > 1 ? !0 : (t.preventDefault && t.preventDefault(), !1);
1145
+ return tt(n) ? !1 : t.touches.length > 1 ? !0 : (t.preventDefault && t.preventDefault(), !1);
1137
1146
  }
1138
- const ye = /* @__PURE__ */ new WeakMap();
1139
- function sn(e, t = !1) {
1140
- const n = P(t);
1141
- let l = null, i = "";
1142
- N(Dt(e), (a) => {
1143
- const r = we(C(a));
1144
- if (r) {
1145
- const s = r;
1146
- if (ye.get(s) || ye.set(s, s.style.overflow), s.style.overflow !== "hidden" && (i = s.style.overflow), s.style.overflow === "hidden")
1147
+ const be = /* @__PURE__ */ new WeakMap();
1148
+ function rn(e, t = !1) {
1149
+ const n = R(t);
1150
+ let o = null, u = "";
1151
+ V(Ht(e), (a) => {
1152
+ const i = ye(C(a));
1153
+ if (i) {
1154
+ const r = i;
1155
+ if (be.get(r) || be.set(r, r.style.overflow), r.style.overflow !== "hidden" && (u = r.style.overflow), r.style.overflow === "hidden")
1147
1156
  return n.value = !0;
1148
1157
  if (n.value)
1149
- return s.style.overflow = "hidden";
1158
+ return r.style.overflow = "hidden";
1150
1159
  }
1151
1160
  }, {
1152
1161
  immediate: !0
1153
1162
  });
1154
- const u = () => {
1155
- const a = we(C(e));
1156
- !a || n.value || (Ce && (l = Q(
1163
+ const d = () => {
1164
+ const a = ye(C(e));
1165
+ !a || n.value || (Ee && (o = Z(
1157
1166
  a,
1158
1167
  "touchmove",
1159
- (r) => {
1160
- an(r);
1168
+ (i) => {
1169
+ sn(i);
1161
1170
  },
1162
1171
  { passive: !1 }
1163
1172
  )), a.style.overflow = "hidden", n.value = !0);
1164
- }, o = () => {
1165
- const a = we(C(e));
1166
- !a || !n.value || (Ce && (l == null || l()), a.style.overflow = i, ye.delete(a), n.value = !1);
1173
+ }, l = () => {
1174
+ const a = ye(C(e));
1175
+ !a || !n.value || (Ee && (o == null || o()), a.style.overflow = u, be.delete(a), n.value = !1);
1167
1176
  };
1168
- return ce(o), A({
1177
+ return de(l), I({
1169
1178
  get() {
1170
1179
  return n.value;
1171
1180
  },
1172
1181
  set(a) {
1173
- a ? u() : o();
1182
+ a ? d() : l();
1174
1183
  }
1175
1184
  });
1176
1185
  }
1177
- function rn() {
1186
+ function un() {
1178
1187
  let e = !1;
1179
- const t = W(!1);
1180
- return (n, l) => {
1181
- if (t.value = l.value, e)
1188
+ const t = H(!1);
1189
+ return (n, o) => {
1190
+ if (t.value = o.value, e)
1182
1191
  return;
1183
1192
  e = !0;
1184
- const i = sn(n, l.value);
1185
- N(t, (u) => i.value = u);
1193
+ const u = rn(n, o.value);
1194
+ V(t, (d) => u.value = d);
1186
1195
  };
1187
1196
  }
1188
- rn();
1189
- const un = {
1197
+ un();
1198
+ const cn = {
1190
1199
  key: 0,
1191
1200
  id: "resizable"
1192
- }, cn = {
1201
+ }, dn = {
1193
1202
  class: "atable-header-row",
1194
1203
  tabindex: "-1"
1195
- }, tt = /* @__PURE__ */ J({
1204
+ }, nt = /* @__PURE__ */ Q({
1196
1205
  __name: "ATableHeader",
1197
1206
  props: {
1198
1207
  columns: {},
1199
1208
  store: {}
1200
1209
  },
1201
1210
  setup(e) {
1202
- return (t, n) => t.columns.length ? ($(), R("thead", un, [
1203
- D("tr", cn, [
1204
- t.store.zeroColumn ? ($(), R("th", {
1211
+ return (t, n) => t.columns.length ? (k(), T("thead", cn, [
1212
+ O("tr", dn, [
1213
+ t.store.zeroColumn ? (k(), T("th", {
1205
1214
  key: 0,
1206
1215
  id: "header-index",
1207
- class: G([[
1216
+ class: U([[
1208
1217
  t.store.hasPinnedColumns ? "sticky-index" : "",
1209
1218
  t.store.config.view === "tree" ? "tree-index" : "",
1210
1219
  t.store.config.view === "list-expansion" ? "list-expansion-index" : ""
1211
1220
  ], "list-index"])
1212
- }, null, 2)) : K("", !0),
1213
- ($(!0), R(re, null, xe(t.columns, (l, i) => ($(), R("th", {
1214
- key: l.name,
1221
+ }, null, 2)) : _("", !0),
1222
+ (k(!0), T(ie, null, Ce(t.columns, (o, u) => (k(), T("th", {
1223
+ key: o.name,
1215
1224
  tabindex: "-1",
1216
- style: Y(t.store.getHeaderCellStyle(l)),
1217
- class: G(l.pinned ? "sticky-column" : "")
1225
+ style: q(t.store.getHeaderCellStyle(o)),
1226
+ class: U(o.pinned ? "sticky-column" : "")
1218
1227
  }, [
1219
- X(t.$slots, "default", {}, () => [
1220
- ct(Z(l.label || String.fromCharCode(i + 97).toUpperCase()), 1)
1228
+ W(t.$slots, "default", {}, () => [
1229
+ dt(K(o.label || String.fromCharCode(u + 97).toUpperCase()), 1)
1221
1230
  ])
1222
1231
  ], 6))), 128))
1223
1232
  ])
1224
- ])) : K("", !0);
1233
+ ])) : _("", !0);
1225
1234
  }
1226
- }), nt = /* @__PURE__ */ J({
1235
+ }), ot = /* @__PURE__ */ Q({
1227
1236
  __name: "ATableModal",
1228
1237
  props: {
1229
1238
  store: {}
1230
1239
  },
1231
1240
  setup(e) {
1232
- const t = B("amodal"), { width: n, height: l } = me(t), i = A(() => {
1233
- var v, m, d, g;
1241
+ const t = G("amodal"), { width: n, height: o } = ge(t), u = I(() => {
1242
+ var v, m, w, g;
1234
1243
  if (!(e.store.modal.height && e.store.modal.width && e.store.modal.left && e.store.modal.bottom)) return;
1235
- const u = (v = e.store.modal.cell) == null ? void 0 : v.closest("table"), o = u.offsetHeight || 0, a = u.offsetWidth || 0;
1236
- let r = ((m = e.store.modal.cell) == null ? void 0 : m.offsetTop) || 0;
1237
- const s = ((d = u.querySelector("thead")) == null ? void 0 : d.offsetHeight) || 0;
1238
- r += s, r = r + l.value < o ? r : r - (l.value + e.store.modal.height);
1239
- let c = ((g = e.store.modal.cell) == null ? void 0 : g.offsetLeft) || 0;
1240
- return c = c + n.value <= a ? c : c - (n.value - e.store.modal.width), {
1241
- left: `${c}px`,
1242
- top: `${r}px`
1244
+ const d = (v = e.store.modal.cell) == null ? void 0 : v.closest("table"), l = d.offsetHeight || 0, a = d.offsetWidth || 0;
1245
+ let i = ((m = e.store.modal.cell) == null ? void 0 : m.offsetTop) || 0;
1246
+ const r = ((w = d.querySelector("thead")) == null ? void 0 : w.offsetHeight) || 0;
1247
+ i += r, i = i + o.value < l ? i : i - (o.value + e.store.modal.height);
1248
+ let s = ((g = e.store.modal.cell) == null ? void 0 : g.offsetLeft) || 0;
1249
+ return s = s + n.value <= a ? s : s - (n.value - e.store.modal.width), {
1250
+ left: `${s}px`,
1251
+ top: `${i}px`
1243
1252
  };
1244
1253
  });
1245
- return (u, o) => ($(), R("div", {
1254
+ return (d, l) => (k(), T("div", {
1246
1255
  class: "amodal",
1247
1256
  ref: "amodal",
1248
1257
  tabindex: "-1",
1249
- onClick: o[0] || (o[0] = Pe(() => {
1258
+ onClick: l[0] || (l[0] = Oe(() => {
1250
1259
  }, ["stop"])),
1251
- onInput: o[1] || (o[1] = Pe(() => {
1260
+ onInput: l[1] || (l[1] = Oe(() => {
1252
1261
  }, ["stop"])),
1253
- style: Y(i.value)
1262
+ style: q(u.value)
1254
1263
  }, [
1255
- X(u.$slots, "default")
1264
+ W(d.$slots, "default")
1256
1265
  ], 36));
1257
1266
  }
1258
- }), dn = (e) => {
1259
- const t = e.id || Bt();
1260
- return dt(`table-${t}`, () => {
1261
- const l = () => {
1262
- const h = {};
1263
- for (const [y, O] of u.value.entries())
1264
- for (const [L, H] of o.value.entries())
1265
- h[`${y}:${L}`] = H[O.name];
1266
- return h;
1267
- }, i = (h) => {
1268
- const y = [Object.assign({}, { rowModified: !1 })];
1269
- if (h && "0:0" in h)
1270
- return h;
1271
- const O = /* @__PURE__ */ new Set();
1272
- for (let L = o.value.length - 1; L >= 0; L--) {
1273
- const H = o.value[L];
1274
- H.parent && O.add(H.parent), y[L] = {
1267
+ }), fn = (e) => {
1268
+ const t = e.id || Gt();
1269
+ return ft(`table-${t}`, () => {
1270
+ const o = () => {
1271
+ const p = {};
1272
+ for (const [b, S] of d.value.entries())
1273
+ for (const [P, L] of l.value.entries())
1274
+ p[`${b}:${P}`] = L[S.name];
1275
+ return p;
1276
+ }, u = (p) => {
1277
+ const b = [Object.assign({}, { rowModified: !1 })];
1278
+ if (p && "0:0" in p)
1279
+ return p;
1280
+ const S = /* @__PURE__ */ new Set();
1281
+ for (let P = l.value.length - 1; P >= 0; P--) {
1282
+ const L = l.value[P];
1283
+ L.parent && S.add(L.parent), b[P] = {
1275
1284
  childrenOpen: !1,
1276
1285
  expanded: !1,
1277
- indent: H.indent || 0,
1278
- isParent: O.has(L),
1279
- isRoot: H.parent === null || H.parent === void 0,
1286
+ indent: L.indent || 0,
1287
+ isParent: S.has(P),
1288
+ isRoot: L.parent === null || L.parent === void 0,
1280
1289
  rowModified: !1,
1281
- open: H.parent === null || H.parent === void 0,
1282
- parent: H.parent
1290
+ open: L.parent === null || L.parent === void 0,
1291
+ parent: L.parent
1283
1292
  };
1284
1293
  }
1285
- return y;
1286
- }, u = P(e.columns), o = P(e.rows), a = P(e.config || {}), r = P(e.table || l()), s = P(i(e.display)), c = P(e.modal || { visible: !1 }), v = P({}), m = A(() => u.value.some((h) => h.pinned)), d = A(() => `${Math.ceil(o.value.length / 100 + 1)}ch`), g = A(
1294
+ return b;
1295
+ }, d = R(e.columns), l = R(e.rows), a = R(e.config || {}), i = R(e.table || o()), r = R(u(e.display)), s = R(e.modal || { visible: !1 }), v = R({}), m = I(() => d.value.some((p) => p.pinned)), w = I(() => `${Math.ceil(l.value.length / 100 + 1)}ch`), g = I(
1287
1296
  () => a.value.view ? ["list", "tree", "list-expansion"].includes(a.value.view) : !1
1288
- ), M = (h, y) => r.value[`${h}:${y}`], f = (h, y, O) => {
1289
- const L = `${h}:${y}`, H = u.value[h];
1290
- r.value[L] !== O && (s.value[y].rowModified = !0), r.value[L] = O, o.value[y][H.name] = O;
1291
- }, p = (h, y, O) => {
1292
- const L = `${h}:${y}`;
1293
- r.value[L] !== O && (s.value[y].rowModified = !0, v.value[L] = O);
1294
- }, w = (h) => ({
1295
- minWidth: h.width || "40ch",
1296
- textAlign: h.align || "center",
1297
+ ), y = (p, b) => i.value[`${p}:${b}`], f = (p, b, S) => {
1298
+ const P = `${p}:${b}`, L = d.value[p];
1299
+ i.value[P] !== S && (r.value[b].rowModified = !0), i.value[P] = S, l.value[b][L.name] = S;
1300
+ }, c = (p, b, S) => {
1301
+ const P = `${p}:${b}`;
1302
+ i.value[P] !== S && (r.value[b].rowModified = !0, v.value[P] = S);
1303
+ }, h = (p) => ({
1304
+ minWidth: p.width || "40ch",
1305
+ textAlign: p.align || "center",
1297
1306
  width: a.value.fullWidth ? "auto" : void 0
1298
- }), E = (h) => {
1299
- const y = o.value[h];
1300
- return console.log(a.value.view, y.indent), a.value.view === "gantt" && y.indent === 0;
1301
- }, I = (h) => a.value.view !== "tree" || s.value[h].isRoot || s.value[h].open, k = (h) => a.value.view !== "tree" ? "" : s.value[h].isRoot || s.value[h].isParent ? s.value[h].childrenOpen ? "-" : "+" : "", S = (h) => {
1307
+ }), A = (p) => {
1308
+ const b = l.value[p];
1309
+ return a.value.view === "gantt" && b.indent === 0;
1310
+ }, M = (p) => a.value.view !== "tree" || r.value[p].isRoot || r.value[p].open, $ = (p) => a.value.view !== "tree" ? "" : r.value[p].isRoot || r.value[p].isParent ? r.value[p].childrenOpen ? "-" : "+" : "", B = (p) => {
1302
1311
  if (a.value.view === "tree") {
1303
- s.value[h].childrenOpen = !s.value[h].childrenOpen;
1304
- for (let y = o.value.length - 1; y >= 0; y--)
1305
- s.value[y].parent === h && (s.value[y].open = !s.value[y].open, s.value[y].childrenOpen && S(y));
1306
- } else a.value.view === "list-expansion" && (s.value[h].expanded = !s.value[h].expanded);
1307
- }, b = (h, y) => {
1308
- const O = M(h, y);
1309
- return T(h, y, O);
1310
- }, T = (h, y, O) => {
1311
- const L = u.value[h], H = o.value[y], le = L.format;
1312
- return le ? typeof le == "function" ? le(O, { table: r.value, row: H, column: L }) : typeof le == "string" ? Function(`"use strict";return (${le})`)()(O, { table: r.value, row: H, column: L }) : O : O;
1312
+ r.value[p].childrenOpen = !r.value[p].childrenOpen;
1313
+ for (let b = l.value.length - 1; b >= 0; b--)
1314
+ r.value[b].parent === p && (r.value[b].open = !r.value[b].open, r.value[b].childrenOpen && B(b));
1315
+ } else a.value.view === "list-expansion" && (r.value[p].expanded = !r.value[p].expanded);
1316
+ }, E = (p, b) => {
1317
+ const S = y(p, b);
1318
+ return D(p, b, S);
1319
+ }, D = (p, b, S) => {
1320
+ const P = d.value[p], L = l.value[b], ae = P.format;
1321
+ return ae ? typeof ae == "function" ? ae(S, { table: i.value, row: L, column: P }) : typeof ae == "string" ? Function(`"use strict";return (${ae})`)()(S, { table: i.value, row: L, column: P }) : S : S;
1313
1322
  };
1314
1323
  return {
1315
1324
  // state
1316
- columns: u,
1325
+ columns: d,
1317
1326
  config: a,
1318
- display: s,
1319
- modal: c,
1320
- rows: o,
1321
- table: r,
1327
+ display: r,
1328
+ modal: s,
1329
+ rows: l,
1330
+ table: i,
1322
1331
  updates: v,
1323
1332
  // getters
1324
1333
  hasPinnedColumns: m,
1325
- numberedRowWidth: d,
1334
+ numberedRowWidth: w,
1326
1335
  zeroColumn: g,
1327
1336
  // actions
1328
- closeModal: (h) => {
1329
- var y;
1330
- h.target instanceof Node && (y = c.value.parent) != null && y.contains(h.target) || c.value.visible && (c.value.visible = !1);
1337
+ closeModal: (p) => {
1338
+ var b;
1339
+ p.target instanceof Node && (b = s.value.parent) != null && b.contains(p.target) || s.value.visible && (s.value.visible = !1);
1331
1340
  },
1332
- getCellData: M,
1333
- getCellDisplayValue: b,
1334
- getFormattedValue: T,
1335
- getHeaderCellStyle: w,
1336
- getIndent: (h, y) => y && h === 0 && y > 0 ? `${y}ch` : "inherit",
1337
- getRowExpandSymbol: k,
1338
- isRowGantt: E,
1339
- isRowVisible: I,
1341
+ getCellData: y,
1342
+ getCellDisplayValue: E,
1343
+ getFormattedValue: D,
1344
+ getHeaderCellStyle: h,
1345
+ getIndent: (p, b) => b && p === 0 && b > 0 ? `${b}ch` : "inherit",
1346
+ getRowExpandSymbol: $,
1347
+ isRowGantt: A,
1348
+ isRowVisible: M,
1340
1349
  setCellData: f,
1341
- setCellText: p,
1342
- toggleRowExpand: S
1350
+ setCellText: c,
1351
+ toggleRowExpand: B,
1352
+ updateGanttBar: (p) => {
1353
+ var S;
1354
+ const b = (S = l.value[p.rowIndex]) == null ? void 0 : S.gantt;
1355
+ b && (p.type === "resize" ? p.edge === "start" ? b.startIndex = p.value : p.edge === "end" && (b.endIndex = p.value) : p.type === "bar" && (b.startIndex = p.start, b.endIndex = p.end));
1356
+ }
1343
1357
  };
1344
1358
  })();
1345
- }, fn = /* @__PURE__ */ J({
1359
+ }, vn = /* @__PURE__ */ Q({
1346
1360
  __name: "ATable",
1347
1361
  props: {
1348
1362
  id: {},
@@ -1351,176 +1365,191 @@ const un = {
1351
1365
  rows: { default: () => [] },
1352
1366
  config: { default: () => new Object() }
1353
1367
  },
1354
- emits: ["update:modelValue", "cellUpdate"],
1368
+ emits: ["update:modelValue", "cellUpdate", "gantt:drag"],
1355
1369
  setup(e, { expose: t, emit: n }) {
1356
- const l = n, i = B("table"), u = e.modelValue ? e.modelValue : e.rows, o = dn({ columns: e.columns, rows: u, id: e.id, config: e.config });
1357
- o.$onAction(({ name: s, store: c, args: v, after: m }) => {
1370
+ const o = n, u = G("table"), d = e.modelValue ? e.modelValue : e.rows, l = fn({ columns: e.columns, rows: d, id: e.id, config: e.config });
1371
+ l.$onAction(({ name: s, store: v, args: m, after: w }) => {
1372
+ var g;
1358
1373
  if (s === "setCellData" || s === "setCellText") {
1359
- const [d, g, M] = v, f = c.getCellData(d, g);
1360
- m(() => {
1361
- l("cellUpdate", { colIndex: d, rowIndex: g, newValue: M, oldValue: f });
1374
+ const [y, f, c] = m, h = v.getCellData(y, f);
1375
+ w(() => {
1376
+ o("cellUpdate", { colIndex: y, rowIndex: f, newValue: c, oldValue: h });
1362
1377
  });
1378
+ } else if (s === "updateGanttBar") {
1379
+ const [y] = m, f = (g = v.rows[y.rowIndex]) == null ? void 0 : g.gantt;
1380
+ if (f) {
1381
+ let c = !1;
1382
+ y.type === "resize" ? y.edge === "start" ? c = f.startIndex !== y.value : y.edge === "end" && (c = f.endIndex !== y.value) : y.type === "bar" && (c = f.startIndex !== y.start || f.endIndex !== y.end), c && w(() => {
1383
+ o("gantt:drag", y);
1384
+ });
1385
+ }
1363
1386
  }
1364
- }), N(
1365
- () => o.rows,
1387
+ }), V(
1388
+ () => l.rows,
1366
1389
  (s) => {
1367
- l("update:modelValue", s);
1390
+ o("update:modelValue", s);
1368
1391
  },
1369
1392
  { deep: !0 }
1370
- ), te(() => {
1371
- e.columns.some((s) => s.pinned) && (a(), o.config.view === "tree" && Ze(i, a, { childList: !0, subtree: !0 }));
1393
+ ), ne(() => {
1394
+ e.columns.some((s) => s.pinned) && (i(), l.config.view === "tree" && Ke(u, i, { childList: !0, subtree: !0 }));
1372
1395
  });
1373
- const a = () => {
1374
- const s = i.value, c = s == null ? void 0 : s.rows[0], v = s == null ? void 0 : s.rows[1], m = c ? Array.from(c.cells) : [];
1375
- for (const [d, g] of m.entries()) {
1376
- const M = v == null ? void 0 : v.cells[d];
1377
- M && (g.style.width = `${M.offsetWidth}px`);
1396
+ const a = I(() => l.columns.filter((s) => s.pinned).length), i = () => {
1397
+ const s = u.value, v = s == null ? void 0 : s.rows[0], m = s == null ? void 0 : s.rows[1], w = v ? Array.from(v.cells) : [];
1398
+ for (const [g, y] of w.entries()) {
1399
+ const f = m == null ? void 0 : m.cells[g];
1400
+ f && (y.style.width = `${f.offsetWidth}px`);
1378
1401
  }
1379
- for (const d of (s == null ? void 0 : s.rows) || []) {
1380
- let g = 0;
1381
- const M = [];
1382
- for (const f of d.cells)
1383
- (f.classList.contains("sticky-column") || f.classList.contains("sticky-index")) && (f.style.left = `${g}px`, g += f.offsetWidth, M.push(f));
1384
- M.length > 0 && M[M.length - 1].classList.add("sticky-column-edge");
1402
+ for (const g of (s == null ? void 0 : s.rows) || []) {
1403
+ let y = 0;
1404
+ const f = [];
1405
+ for (const c of g.cells)
1406
+ (c.classList.contains("sticky-column") || c.classList.contains("sticky-index")) && (c.style.left = `${y}px`, y += c.offsetWidth, f.push(c));
1407
+ f.length > 0 && f[f.length - 1].classList.add("sticky-column-edge");
1385
1408
  }
1386
1409
  };
1387
1410
  window.addEventListener("keydown", (s) => {
1388
- if (s.key === "Escape" && o.modal.visible) {
1389
- o.modal.visible = !1;
1390
- const c = o.modal.parent;
1391
- c && Ge().then(() => {
1392
- c.focus();
1411
+ if (s.key === "Escape" && l.modal.visible) {
1412
+ l.modal.visible = !1;
1413
+ const v = l.modal.parent;
1414
+ v && Ue().then(() => {
1415
+ v.focus();
1393
1416
  });
1394
1417
  }
1395
1418
  });
1396
1419
  const r = (s) => {
1397
- const c = s.indent === 0, v = o.columns.filter((d) => d.pinned).length;
1398
- if (!c || v === 0)
1399
- return o.columns;
1420
+ var w;
1421
+ if (!(s.indent === 0) || a.value === 0)
1422
+ return l.columns;
1400
1423
  const m = [];
1401
- for (let d = 0; d < v; d++) {
1402
- const g = { ...o.columns[d] };
1403
- g.originalIndex = d, m.push(g);
1424
+ for (let g = 0; g < a.value; g++) {
1425
+ const y = { ...l.columns[g] };
1426
+ y.originalIndex = g, m.push(y);
1404
1427
  }
1405
1428
  return m.push({
1406
- ...o.columns[v],
1429
+ ...l.columns[a.value],
1407
1430
  isGantt: !0,
1408
- colspan: o.columns.length - v,
1409
- originalIndex: v,
1431
+ colspan: ((w = s.gantt) == null ? void 0 : w.colspan) || l.columns.length - a.value,
1432
+ originalIndex: a.value,
1410
1433
  width: "auto"
1411
1434
  // TODO: refactor to API that can detect when data exists in a cell. Might have be custom and not generalizable
1412
1435
  }), m;
1413
1436
  };
1414
- return t({ store: o }), (s, c) => be(($(), R("table", {
1437
+ return t({ store: l }), (s, v) => xe((k(), T("table", {
1415
1438
  ref: "table",
1416
1439
  class: "atable",
1417
- style: Y({
1418
- width: x(o).config.fullWidth ? "100%" : "auto"
1440
+ style: q({
1441
+ width: x(l).config.fullWidth ? "100%" : "auto"
1419
1442
  })
1420
1443
  }, [
1421
- X(s.$slots, "header", { data: x(o) }, () => [
1422
- Oe(tt, {
1423
- columns: x(o).columns,
1424
- store: x(o)
1444
+ W(s.$slots, "header", { data: x(l) }, () => [
1445
+ Le(nt, {
1446
+ columns: x(l).columns,
1447
+ store: x(l)
1425
1448
  }, null, 8, ["columns", "store"])
1426
1449
  ], !0),
1427
- D("tbody", null, [
1428
- X(s.$slots, "body", { data: x(o) }, () => [
1429
- ($(!0), R(re, null, xe(x(o).rows, (v, m) => ($(), ae(Ke, {
1430
- key: v.id,
1431
- row: v,
1432
- rowIndex: m,
1433
- store: x(o)
1450
+ O("tbody", null, [
1451
+ W(s.$slots, "body", { data: x(l) }, () => [
1452
+ (k(!0), T(ie, null, Ce(x(l).rows, (m, w) => (k(), se(_e, {
1453
+ key: m.id,
1454
+ row: m,
1455
+ rowIndex: w,
1456
+ store: x(l)
1434
1457
  }, {
1435
- default: Le(() => [
1436
- ($(!0), R(re, null, xe(r(v), (d, g) => ($(), R(re, {
1437
- key: d.name
1438
- }, [
1439
- d.isGantt ? ($(), ae(fe(d.ganttComponent || "AGanttCell"), {
1440
- key: 0,
1441
- store: x(o),
1442
- color: v.gantt_color,
1443
- colspan: d.colspan,
1444
- pinned: d.pinned,
1445
- rowIndex: m,
1446
- colIndex: d.originalIndex ?? g,
1447
- style: Y({
1448
- textAlign: (d == null ? void 0 : d.align) || "center",
1449
- minWidth: (d == null ? void 0 : d.width) || "40ch",
1450
- width: x(o).config.fullWidth ? "auto" : null
1451
- })
1452
- }, null, 8, ["store", "color", "colspan", "pinned", "rowIndex", "colIndex", "style"])) : ($(), ae(fe(d.cellComponent || "ACell"), {
1453
- key: 1,
1454
- store: x(o),
1455
- pinned: d.pinned,
1456
- rowIndex: m,
1457
- colIndex: g,
1458
- style: Y({
1459
- textAlign: (d == null ? void 0 : d.align) || "center",
1460
- minWidth: (d == null ? void 0 : d.width) || "40ch",
1461
- width: x(o).config.fullWidth ? "auto" : null
1462
- }),
1463
- spellcheck: "false"
1464
- }, null, 8, ["store", "pinned", "rowIndex", "colIndex", "style"]))
1465
- ], 64))), 128))
1458
+ default: De(() => [
1459
+ (k(!0), T(ie, null, Ce(r(m), (g, y) => {
1460
+ var f, c, h;
1461
+ return k(), T(ie, {
1462
+ key: g.name
1463
+ }, [
1464
+ g.isGantt ? (k(), se(ve(g.ganttComponent || "AGanttCell"), {
1465
+ key: 0,
1466
+ store: x(l),
1467
+ columnsCount: x(l).columns.length - a.value,
1468
+ color: (f = m.gantt) == null ? void 0 : f.color,
1469
+ start: (c = m.gantt) == null ? void 0 : c.startIndex,
1470
+ end: (h = m.gantt) == null ? void 0 : h.endIndex,
1471
+ colspan: g.colspan,
1472
+ pinned: g.pinned,
1473
+ rowIndex: w,
1474
+ colIndex: g.originalIndex ?? y,
1475
+ style: q({
1476
+ textAlign: (g == null ? void 0 : g.align) || "center",
1477
+ minWidth: (g == null ? void 0 : g.width) || "40ch",
1478
+ width: x(l).config.fullWidth ? "auto" : null
1479
+ })
1480
+ }, null, 8, ["store", "columnsCount", "color", "start", "end", "colspan", "pinned", "rowIndex", "colIndex", "style"])) : (k(), se(ve(g.cellComponent || "ACell"), {
1481
+ key: 1,
1482
+ store: x(l),
1483
+ pinned: g.pinned,
1484
+ rowIndex: w,
1485
+ colIndex: y,
1486
+ style: q({
1487
+ textAlign: (g == null ? void 0 : g.align) || "center",
1488
+ minWidth: (g == null ? void 0 : g.width) || "40ch",
1489
+ width: x(l).config.fullWidth ? "auto" : null
1490
+ }),
1491
+ spellcheck: "false"
1492
+ }, null, 8, ["store", "pinned", "rowIndex", "colIndex", "style"]))
1493
+ ], 64);
1494
+ }), 128))
1466
1495
  ]),
1467
1496
  _: 2
1468
1497
  }, 1032, ["row", "rowIndex", "store"]))), 128))
1469
1498
  ], !0)
1470
1499
  ]),
1471
- X(s.$slots, "footer", { data: x(o) }, void 0, !0),
1472
- X(s.$slots, "modal", { data: x(o) }, () => [
1473
- be(Oe(nt, { store: x(o) }, {
1474
- default: Le(() => [
1475
- ($(), ae(fe(x(o).modal.component), ke({
1476
- key: `${x(o).modal.rowIndex}:${x(o).modal.colIndex}`,
1477
- colIndex: x(o).modal.colIndex,
1478
- rowIndex: x(o).modal.rowIndex,
1479
- store: x(o)
1480
- }, x(o).modal.componentProps), null, 16, ["colIndex", "rowIndex", "store"]))
1500
+ W(s.$slots, "footer", { data: x(l) }, void 0, !0),
1501
+ W(s.$slots, "modal", { data: x(l) }, () => [
1502
+ xe(Le(ot, { store: x(l) }, {
1503
+ default: De(() => [
1504
+ (k(), se(ve(x(l).modal.component), ke({
1505
+ key: `${x(l).modal.rowIndex}:${x(l).modal.colIndex}`,
1506
+ colIndex: x(l).modal.colIndex,
1507
+ rowIndex: x(l).modal.rowIndex,
1508
+ store: x(l)
1509
+ }, x(l).modal.componentProps), null, 16, ["colIndex", "rowIndex", "store"]))
1481
1510
  ]),
1482
1511
  _: 1
1483
1512
  }, 8, ["store"]), [
1484
- [Ye, x(o).modal.visible]
1513
+ [qe, x(l).modal.visible]
1485
1514
  ])
1486
1515
  ], !0)
1487
1516
  ], 4)), [
1488
- [x(ln), x(o).closeModal]
1517
+ [x(an), x(l).closeModal]
1489
1518
  ]);
1490
1519
  }
1491
- }), vn = /* @__PURE__ */ oe(fn, [["__scopeId", "data-v-8ce56718"]]), mn = {}, pn = { class: "aloading" }, hn = { class: "aloading-header" };
1492
- function gn(e, t) {
1493
- return $(), R("div", pn, [
1494
- D("h2", hn, [
1495
- X(e.$slots, "default", {}, void 0, !0)
1520
+ }), mn = /* @__PURE__ */ le(vn, [["__scopeId", "data-v-40408c70"]]), gn = {}, hn = { class: "aloading" }, pn = { class: "aloading-header" };
1521
+ function wn(e, t) {
1522
+ return k(), T("div", hn, [
1523
+ O("h2", pn, [
1524
+ W(e.$slots, "default", {}, void 0, !0)
1496
1525
  ]),
1497
- t[0] || (t[0] = D("div", { class: "aloading-bar" }, null, -1))
1526
+ t[0] || (t[0] = O("div", { class: "aloading-bar" }, null, -1))
1498
1527
  ]);
1499
1528
  }
1500
- const wn = /* @__PURE__ */ oe(mn, [["render", gn], ["__scopeId", "data-v-a930a25b"]]), yn = {}, bn = { class: "aloading" }, xn = { class: "aloading-header" };
1501
- function Cn(e, t) {
1502
- return $(), R("div", bn, [
1503
- D("h2", xn, [
1504
- X(e.$slots, "default", {}, void 0, !0)
1529
+ const yn = /* @__PURE__ */ le(gn, [["render", wn], ["__scopeId", "data-v-a930a25b"]]), bn = {}, xn = { class: "aloading" }, Cn = { class: "aloading-header" };
1530
+ function En(e, t) {
1531
+ return k(), T("div", xn, [
1532
+ O("h2", Cn, [
1533
+ W(e.$slots, "default", {}, void 0, !0)
1505
1534
  ]),
1506
- t[0] || (t[0] = D("div", { class: "aloading-bar" }, null, -1))
1535
+ t[0] || (t[0] = O("div", { class: "aloading-bar" }, null, -1))
1507
1536
  ]);
1508
1537
  }
1509
- const En = /* @__PURE__ */ oe(yn, [["render", Cn], ["__scopeId", "data-v-e1165876"]]);
1538
+ const In = /* @__PURE__ */ le(bn, [["render", En], ["__scopeId", "data-v-e1165876"]]);
1510
1539
  function An(e) {
1511
- e.component("ACell", Gt), e.component("AExpansionRow", Qt), e.component("AGanttCell", tn), e.component("ARow", Ke), e.component("ATable", vn), e.component("ATableHeader", tt), e.component("ATableLoading", wn), e.component("ATableLoadingBar", En), e.component("ATableModal", nt);
1540
+ e.component("ACell", Ut), e.component("AExpansionRow", Zt), e.component("AGanttCell", nn), e.component("ARow", _e), e.component("ATable", mn), e.component("ATableHeader", nt), e.component("ATableLoading", yn), e.component("ATableLoadingBar", In), e.component("ATableModal", ot);
1512
1541
  }
1513
1542
  export {
1514
- Gt as ACell,
1515
- Qt as AExpansionRow,
1516
- tn as AGanttCell,
1517
- Ke as ARow,
1518
- vn as ATable,
1519
- tt as ATableHeader,
1520
- wn as ATableLoading,
1521
- En as ATableLoadingBar,
1522
- nt as ATableModal,
1523
- dn as createTableStore,
1543
+ Ut as ACell,
1544
+ Zt as AExpansionRow,
1545
+ nn as AGanttCell,
1546
+ _e as ARow,
1547
+ mn as ATable,
1548
+ nt as ATableHeader,
1549
+ yn as ATableLoading,
1550
+ In as ATableLoadingBar,
1551
+ ot as ATableModal,
1552
+ fn as createTableStore,
1524
1553
  An as install
1525
1554
  };
1526
1555
  //# sourceMappingURL=atable.js.map