@stonecrop/atable 0.4.11 → 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 ee, ref as P, watch as N, onBeforeUnmount as nt, computed as I, shallowRef as W, toValue as C, watchEffect as ot, getCurrentScope as ze, onScopeDispose as Fe, unref as x, getCurrentInstance as Ce, nextTick as je, isRef as lt, toRefs as at, customRef as Ge, toRef as st, readonly as rt, defineComponent as q, useTemplateRef as B, createElementBlock as R, openBlock as $, normalizeClass as j, normalizeStyle as U, createBlock as le, resolveDynamicComponent as de, mergeProps as Ee, toDisplayString as Q, Fragment as se, createElementVNode as D, createCommentVNode as Z, renderSlot as X, useCssVars as it, withDirectives as ye, vShow as Ue, renderList as be, createTextVNode as ut, withModifiers as Re, createVNode as Pe, withCtx as Oe } from "vue";
2
- import { defineStore as ct } from "pinia";
3
- import './assets/index.css';function ke(e) {
4
- return ze() ? (Fe(e), !0) : !1;
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
+ import './assets/index.css';function Me(e) {
4
+ return Fe() ? (je(e), !0) : !1;
5
5
  }
6
- const dt = 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 ft = (e) => e != null, vt = Object.prototype.toString, mt = (e) => vt.call(e) === "[object Object]", pt = () => {
8
+ const mt = (e) => e != null, gt = Object.prototype.toString, ht = (e) => gt.call(e) === "[object Object]", pt = () => {
9
9
  };
10
- function fe(e) {
10
+ function me(e) {
11
11
  return Array.isArray(e) ? e : [e];
12
12
  }
13
- function ht(e, t, n) {
14
- return N(
13
+ function wt(e, t, n) {
14
+ return V(
15
15
  e,
16
16
  t,
17
17
  {
@@ -20,472 +20,472 @@ function ht(e, t, n) {
20
20
  }
21
21
  );
22
22
  }
23
- const te = dt ? window : void 0;
24
- function K(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 ie(...e) {
29
+ function ce(...e) {
30
30
  const t = [], n = () => {
31
- t.forEach((s) => s()), t.length = 0;
32
- }, l = (s, r, a, c) => (s.addEventListener(r, a, c), () => s.removeEventListener(r, a, c)), i = I(() => {
33
- const s = fe(C(e[0])).filter((r) => r != null);
34
- return s.every((r) => typeof r != "string") ? s : void 0;
35
- }), u = ht(
31
+ t.forEach((a) => a()), t.length = 0;
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 s, r;
37
+ var a, i;
38
38
  return [
39
- (r = (s = i.value) == null ? void 0 : s.map((a) => K(a))) != null ? r : [te].filter((a) => a != null),
40
- fe(C(i.value ? e[1] : e[0])),
41
- fe(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
- ([s, r, a, c]) => {
47
- if (n(), !(s != null && s.length) || !(r != null && r.length) || !(a != null && a.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 = mt(c) ? { ...c } : c;
49
+ const v = ht(s) ? { ...s } : s;
50
50
  t.push(
51
- ...s.flatMap(
52
- (m) => r.flatMap(
53
- (d) => a.map((h) => l(m, d, h, v))
51
+ ...a.flatMap(
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 ke(n), o;
62
+ return Me(n), l;
63
63
  }
64
- function gt() {
65
- const e = W(!1), t = Ce();
66
- return t && ee(() => {
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 wt(e) {
71
- const t = gt();
70
+ function bt(e) {
71
+ const t = yt();
72
72
  return I(() => (t.value, !!e()));
73
73
  }
74
- function yt(e, t, n = {}) {
75
- const { window: l = te, ...i } = n;
76
- let u;
77
- const o = wt(() => l && "MutationObserver" in l), s = () => {
78
- u && (u.disconnect(), u = void 0);
79
- }, r = I(() => {
80
- const m = C(e), d = fe(m).map(K).filter(ft);
81
- return new Set(d);
82
- }), a = 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
- s(), 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
- a(), s();
88
+ ), s = () => d == null ? void 0 : d.takeRecords(), v = () => {
89
+ r(), a();
90
90
  };
91
- return ke(v), {
92
- isSupported: o,
91
+ return Me(v), {
92
+ isSupported: l,
93
93
  stop: v,
94
- takeRecords: c
94
+ takeRecords: s
95
95
  };
96
96
  }
97
- function bt(e, t, n = {}) {
97
+ function Ct(e, t, n = {}) {
98
98
  const {
99
- window: l = te,
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)
103
+ if (!o || !u)
104
104
  return pt;
105
- let o;
106
- const s = (c) => {
107
- o == null || o(), o = c;
108
- }, r = ot(() => {
109
- const c = K(e);
110
- if (c) {
111
- const { stop: v } = yt(
112
- i,
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
- s(v);
122
+ a(v);
123
123
  }
124
- }, { flush: u }), a = () => {
125
- r(), s();
124
+ }, { flush: d }), r = () => {
125
+ i(), a();
126
126
  };
127
- return ke(a), a;
127
+ return Me(r), r;
128
128
  }
129
- function xt(e = {}) {
129
+ function Et(e = {}) {
130
130
  var t;
131
131
  const {
132
- window: n = te,
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 a;
137
- let c = u == null ? void 0 : u.activeElement;
138
- if (l)
139
- for (; c != null && c.shadowRoot; )
140
- c = (a = c == null ? void 0 : c.shadowRoot) == null ? void 0 : a.activeElement;
141
- return c;
142
- }, s = P(), r = () => {
143
- s.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 a = {
146
+ const r = {
147
147
  capture: !0,
148
148
  passive: !0
149
149
  };
150
- ie(
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
- a
157
- ), ie(
156
+ r
157
+ ), ce(
158
158
  n,
159
159
  "focus",
160
- r,
161
- a
160
+ i,
161
+ r
162
162
  );
163
163
  }
164
- return i && bt(s, r, { document: u }), r(), s;
164
+ return u && Ct(a, i, { document: d }), i(), a;
165
165
  }
166
- const Ct = "focusin", Et = "focusout", kt = ":focus-within";
167
- function Mt(e, t = {}) {
168
- const { window: n = te } = t, l = I(() => K(e)), i = W(!1), u = I(() => i.value), o = xt(t);
169
- if (!n || !o.value)
170
- return { focused: u };
171
- const s = { passive: !0 };
172
- return ie(l, Ct, () => i.value = !0, s), ie(l, Et, () => {
173
- var r, a, c;
174
- return i.value = (c = (a = (r = l.value) == null ? void 0 : r.matches) == null ? void 0 : a.call(r, kt)) != null ? c : !1;
175
- }, s), { focused: u };
166
+ const It = "focusin", kt = "focusout", Mt = ":focus-within";
167
+ function $t(e, t = {}) {
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
+ const a = { passive: !0 };
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 $t(e, { window: t = te, 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 = K(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 s = o.getBoundingClientRect();
185
- l.value = s.top <= (t.innerHeight || u.documentElement.clientHeight) && s.left <= (t.innerWidth || u.documentElement.clientWidth) && s.bottom >= 0 && s.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
- () => K(e),
190
- () => i(),
188
+ return V(
189
+ () => ee(e),
190
+ () => u(),
191
191
  { immediate: !0, flush: "post" }
192
- ), t && ie(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
- let t = $t(e).value;
198
+ let t = At(e).value;
199
199
  return t = t && e.offsetHeight > 0, t;
200
- }, F = (e) => e.tabIndex >= 0, Le = (e) => {
200
+ }, F = (e) => e.tabIndex >= 0, He = (e) => {
201
201
  const t = e.target;
202
- return Me(t);
203
- }, Me = (e) => {
202
+ return $e(t);
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
- return n && (!F(n) || !z(n)) ? Me(n) : n;
217
- }, It = (e) => {
216
+ return n && (!F(n) || !z(n)) ? $e(n) : n;
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)) ? $e(l) : l;
235
- }, De = (e) => {
234
+ return o && (!F(o) || !z(o)) ? Ae(o) : o;
235
+ }, We = (e) => {
236
236
  const t = e.target;
237
- return $e(t);
238
- }, $e = (e) => {
237
+ return Ae(t);
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
- return n && (!F(n) || !z(n)) ? $e(n) : n;
252
- }, At = (e) => {
251
+ return n && (!F(n) || !z(n)) ? Ae(n) : n;
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)) ? Me(l) : l;
270
- }, He = (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;
283
- }, We = (e) => {
282
+ return n && (!F(n) || !z(n)) ? Se(n) : n;
283
+ }, Xe = (e) => {
284
284
  const t = e.target;
285
- return Ae(t);
286
- }, Ae = (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)) ? Ae(n) : n;
296
- }, Xe = (e) => {
297
- const t = e.target.parentElement, n = t == null ? void 0 : t.firstElementChild;
298
- return n && (!F(n) || !z(n)) ? Ae(n) : n;
295
+ return n && (!F(n) || !z(n)) ? Te(n) : n;
299
296
  }, Ve = (e) => {
297
+ const t = e.target.parentElement, n = t == null ? void 0 : t.firstElementChild;
298
+ return n && (!F(n) || !z(n)) ? Te(n) : n;
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
- }, ce = ["alt", "control", "shift", "meta"], St = {
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
- }, Se = {
307
+ }, Re = {
308
308
  "keydown.up": (e) => {
309
- const t = Le(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 = De(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 = He(e);
317
+ const t = Be(e);
318
318
  e.preventDefault(), e.stopPropagation(), t && t.focus();
319
319
  },
320
320
  "keydown.right": (e) => {
321
- const t = We(e);
321
+ const t = Xe(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 = At(e);
329
+ const t = Tt(e);
330
330
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
331
331
  },
332
332
  "keydown.control.left": (e) => {
333
- const t = Xe(e);
333
+ const t = Ve(e);
334
334
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
335
335
  },
336
336
  "keydown.control.right": (e) => {
337
- const t = Ve(e);
337
+ const t = Ne(e);
338
338
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
339
339
  },
340
340
  "keydown.end": (e) => {
341
- const t = Ve(e);
341
+ const t = Ne(e);
342
342
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
343
343
  },
344
344
  "keydown.enter": (e) => {
345
345
  if (e.target instanceof HTMLTableCellElement) {
346
346
  e.preventDefault(), e.stopPropagation();
347
- const t = De(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 = Le(e);
354
+ const t = He(e);
355
355
  t && t.focus();
356
356
  }
357
357
  },
358
358
  "keydown.home": (e) => {
359
- const t = Xe(e);
359
+ const t = Ve(e);
360
360
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
361
361
  },
362
362
  "keydown.tab": (e) => {
363
- const t = We(e);
363
+ const t = Xe(e);
364
364
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
365
365
  },
366
366
  "keydown.shift.tab": (e) => {
367
- const t = He(e);
367
+ const t = Be(e);
368
368
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
369
369
  }
370
370
  };
371
- function Te(e) {
372
- const t = (o) => {
373
- let s = null;
374
- return o.parent && (typeof o.parent == "string" ? s = document.querySelector(o.parent) : o.parent instanceof HTMLElement ? s = o.parent : s = o.parent.value), s;
375
- }, n = (o) => {
376
- var s;
377
- const r = t(o);
378
- let a = [];
379
- if (typeof o.selectors == "string")
380
- a = 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 ? a.push(c) : a.push(c.$el);
384
- else if (o.selectors instanceof HTMLElement)
385
- a.push(o.selectors);
386
- else if ((s = o.selectors) != null && s.value)
387
- if (Array.isArray(o.selectors.value))
388
- for (const c of o.selectors.value)
389
- c instanceof HTMLElement ? a.push(c) : a.push(c.$el);
390
- else
391
- a.push(o.selectors.value);
392
- return a;
393
- }, l = (o) => {
394
- const s = t(o);
371
+ function Pe(e) {
372
+ const t = (l) => {
373
+ let a = null;
374
+ return l.parent && (typeof l.parent == "string" ? a = document.querySelector(l.parent) : l.parent instanceof HTMLElement ? a = l.parent : a = l.parent.value), a;
375
+ }, n = (l) => {
376
+ var a;
377
+ const i = t(l);
395
378
  let r = [];
396
- return o.selectors ? r = n(o) : s && (r = Array.from(s.children).filter((a) => F(a) && z(a))), r;
397
- }, i = (o) => (s) => {
398
- const r = St[s.key] || s.key.toLowerCase();
399
- if (ce.includes(r)) return;
400
- const a = o.handlers || Se;
401
- for (const c of Object.keys(a)) {
402
- const [v, ...m] = c.split(".");
403
- if (v === "keydown" && m.includes(r)) {
404
- const d = a[c], h = m.filter((f) => ce.includes(f)), M = ce.some((f) => {
405
- const p = f.charAt(0).toUpperCase() + f.slice(1);
406
- return s.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
- if (h.length > 0) {
409
- if (M) {
410
- for (const f of ce)
408
+ if (g.length > 0) {
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
- s.getModifierState(p) && d(s);
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(s);
417
+ y || w(a);
418
418
  }
419
419
  }
420
- }, u = [];
421
- ee(() => {
422
- for (const o of e) {
423
- const s = t(o), r = l(o), a = i(o), c = s ? [s] : r;
424
- for (const v of c) {
425
- const { focused: m } = Mt(P(v)), d = N(m, (h) => {
426
- h ? v.addEventListener("keydown", a) : v.removeEventListener("keydown", a);
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
- }), nt(() => {
432
- for (const o of u)
433
- o();
431
+ }), lt(() => {
432
+ for (const l of d)
433
+ l();
434
434
  });
435
435
  }
436
- function ue(e) {
437
- return ze() ? (Fe(e), !0) : !1;
436
+ function de(e) {
437
+ return Fe() ? (je(e), !0) : !1;
438
438
  }
439
- const me = 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 Tt = (e) => e != null, Rt = Object.prototype.toString, Ye = (e) => Rt.call(e) === "[object Object]", G = () => {
442
- }, xe = /* @__PURE__ */ Pt();
443
- function Pt() {
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 me && ((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 Ot(e) {
448
- return Ce();
447
+ function Dt(e) {
448
+ return Ie();
449
449
  }
450
- function Y(e) {
450
+ function J(e) {
451
451
  return Array.isArray(e) ? e : [e];
452
452
  }
453
- function Lt(...e) {
453
+ function Ht(...e) {
454
454
  if (e.length !== 1)
455
- return st(...e);
455
+ return it(...e);
456
456
  const t = e[0];
457
- return typeof t == "function" ? rt(Ge(() => ({ get: t, set: G }))) : P(t);
457
+ return typeof t == "function" ? ut(Ye(() => ({ get: t, set: Y }))) : R(t);
458
458
  }
459
- function Dt(e, t = {}) {
460
- if (!lt(e))
461
- return at(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] = Ge(() => ({
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
- const s = [...e.value];
473
- s[l] = i, e.value = s;
472
+ const a = [...e.value];
473
+ a[o] = u, e.value = a;
474
474
  } else {
475
- const s = { ...e.value, [l]: i };
476
- Object.setPrototypeOf(s, Object.getPrototypeOf(e.value)), e.value = s;
475
+ const a = { ...e.value, [o]: u };
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 Ht(e, t = !0, n) {
485
- Ot() ? ee(e, n) : t ? e() : je(e);
484
+ function Bt(e, t = !0, n) {
485
+ Dt() ? ne(e, n) : t ? e() : Ue(e);
486
486
  }
487
- function qe(e, t, n) {
488
- return N(
487
+ function Qe(e, t, n) {
488
+ return V(
489
489
  e,
490
490
  t,
491
491
  {
@@ -494,206 +494,206 @@ function qe(e, t, n) {
494
494
  }
495
495
  );
496
496
  }
497
- const pe = me ? window : void 0;
498
- function _(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 re(...e) {
503
+ function ue(...e) {
504
504
  const t = [], n = () => {
505
- t.forEach((s) => s()), t.length = 0;
506
- }, l = (s, r, a, c) => (s.addEventListener(r, a, c), () => s.removeEventListener(r, a, c)), i = I(() => {
507
- const s = Y(C(e[0])).filter((r) => r != null);
508
- return s.every((r) => typeof r != "string") ? s : void 0;
509
- }), u = qe(
505
+ t.forEach((a) => a()), t.length = 0;
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 s, r;
511
+ var a, i;
512
512
  return [
513
- (r = (s = i.value) == null ? void 0 : s.map((a) => _(a))) != null ? r : [pe].filter((a) => a != null),
514
- Y(C(i.value ? e[1] : e[0])),
515
- Y(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
- ([s, r, a, c]) => {
521
- if (n(), !(s != null && s.length) || !(r != null && r.length) || !(a != null && a.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 = Ye(c) ? { ...c } : c;
523
+ const v = Je(s) ? { ...s } : s;
524
524
  t.push(
525
- ...s.flatMap(
526
- (m) => r.flatMap(
527
- (d) => a.map((h) => l(m, d, h, v))
525
+ ...a.flatMap(
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 ue(n), o;
536
+ return de(n), l;
537
537
  }
538
- function Wt() {
539
- const e = W(!1), t = Ce();
540
- return t && ee(() => {
538
+ function Xt() {
539
+ const e = H(!1), t = Ie();
540
+ return t && ne(() => {
541
541
  e.value = !0;
542
542
  }, t), e;
543
543
  }
544
- function Je(e) {
545
- const t = Wt();
544
+ function Ze(e) {
545
+ const t = Xt();
546
546
  return I(() => (t.value, !!e()));
547
547
  }
548
- function Qe(e, t, n = {}) {
549
- const { window: l = pe, ...i } = n;
550
- let u;
551
- const o = Je(() => l && "MutationObserver" in l), s = () => {
552
- u && (u.disconnect(), u = void 0);
553
- }, r = I(() => {
554
- const m = C(e), d = Y(m).map(_).filter(Tt);
555
- return new Set(d);
556
- }), a = 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
- s(), 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
- a(), s();
562
+ ), s = () => d == null ? void 0 : d.takeRecords(), v = () => {
563
+ r(), a();
564
564
  };
565
- return ue(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 he(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,
578
- onMove: s,
579
- onEnd: r,
580
- onStart: a,
581
- initialValue: c,
574
+ pointerTypes: o,
575
+ preventDefault: u,
576
+ stopPropagation: d,
577
+ exact: l,
578
+ onMove: a,
579
+ onEnd: i,
580
+ onStart: r,
581
+ initialValue: s,
582
582
  axis: v = "both",
583
583
  draggingElement: m = pe,
584
- containerElement: d,
585
- handle: h = e,
586
- buttons: M = [0]
587
- } = t, f = P(
588
- (n = C(c)) != null ? n : { x: 0, y: 0 }
589
- ), p = P(), y = (b) => l ? l.includes(b.pointerType) : !0, E = (b) => {
590
- C(i) && b.preventDefault(), C(u) && b.stopPropagation();
591
- }, A = (b) => {
592
- var O;
593
- if (!C(M).includes(b.button) || C(t.disabled) || !y(b) || C(o) && b.target !== C(e))
584
+ containerElement: w,
585
+ handle: g = 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), g = (O = V == null ? void 0 : V.getBoundingClientRect) == null ? void 0 : O.call(V), w = C(e).getBoundingClientRect(), T = {
596
- x: b.clientX - (V ? w.left - g.left + V.scrollLeft : w.left),
597
- y: b.clientY - (V ? w.top - g.top + V.scrollTop : w.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
- (a == null ? void 0 : a(T, b)) !== !1 && (p.value = T, E(b));
600
- }, k = (b) => {
601
- if (C(t.disabled) || !y(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 O = C(d), V = C(e).getBoundingClientRect();
604
- let { x: g, y: w } = f.value;
605
- (v === "x" || v === "both") && (g = b.clientX - p.value.x, O && (g = Math.min(Math.max(0, g), O.scrollWidth - V.width))), (v === "y" || v === "both") && (w = b.clientY - p.value.y, O && (w = Math.min(Math.max(0, w), O.scrollHeight - V.height))), f.value = {
606
- x: g,
607
- y: w
608
- }, s == null || s(f.value, b), E(b);
609
- }, S = (b) => {
610
- C(t.disabled) || !y(b) || p.value && (p.value = void 0, r == null || r(f.value, b), E(b));
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
+ x: j,
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 (me) {
613
- const b = () => {
614
- var O;
612
+ if (he) {
613
+ const E = () => {
614
+ var D;
615
615
  return {
616
- capture: (O = t.capture) != null ? O : !0,
617
- passive: !C(i)
616
+ capture: (D = t.capture) != null ? D : !0,
617
+ passive: !C(u)
618
618
  };
619
619
  };
620
- re(h, "pointerdown", A, b), re(m, "pointermove", k, b), re(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
- ...Dt(f),
623
+ ...Wt(f),
624
624
  position: f,
625
- isDragging: I(() => !!p.value),
625
+ isDragging: I(() => !!c.value),
626
626
  style: I(
627
627
  () => `left:${f.value.x}px;top:${f.value.y}px;`
628
628
  )
629
629
  };
630
630
  }
631
- function Xt(e, t, n = {}) {
632
- const { window: l = pe, ...i } = n;
633
- let u;
634
- const o = Je(() => l && "ResizeObserver" in l), s = () => {
635
- u && (u.disconnect(), u = void 0);
636
- }, r = I(() => {
631
+ function Vt(e, t, n = {}) {
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) => _(m)) : [_(v)];
639
- }), a = 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 (s(), 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
- s(), a();
649
+ ), s = () => {
650
+ a(), r();
651
651
  };
652
- return ue(c), {
653
- isSupported: o,
654
- stop: c
652
+ return de(s), {
653
+ isSupported: l,
654
+ stop: s
655
655
  };
656
656
  }
657
- function ve(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, s = W(0), r = W(0), a = W(0), c = W(0), v = W(0), m = W(0), d = W(0), h = W(0);
665
- function M() {
666
- const p = _(e);
667
- if (!p) {
668
- n && (s.value = 0, r.value = 0, a.value = 0, c.value = 0, v.value = 0, m.value = 0, d.value = 0, h.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 y = p.getBoundingClientRect();
672
- s.value = y.height, r.value = y.bottom, a.value = y.left, c.value = y.right, v.value = y.top, m.value = y.width, d.value = y.x, h.value = y.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 Xt(e, f), N(() => _(e), (p) => !p && f()), Qe(e, f, {
677
+ return Vt(e, f), V(() => te(e), (c) => !c && f()), Ke(e, f, {
678
678
  attributeFilter: ["style", "class"]
679
- }), i && re("scroll", f, { capture: !0, passive: !0 }), l && re("resize", f, { passive: !0 }), Ht(() => {
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
- height: s,
683
- bottom: r,
684
- left: a,
685
- right: c,
682
+ height: a,
683
+ bottom: i,
684
+ left: r,
685
+ right: s,
686
686
  top: v,
687
687
  width: m,
688
- x: d,
689
- y: h,
688
+ x: w,
689
+ y: g,
690
690
  update: f
691
691
  };
692
692
  }
693
- const Vt = (e) => {
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
- }, Nt = (e = 8) => Array.from({ length: e }, () => Math.floor(Math.random() * 16).toString(16)).join(""), Bt = ["data-colindex", "data-rowindex", "data-editable", "contenteditable", "tabindex"], zt = ["innerHTML"], Ft = { key: 2 }, jt = /* @__PURE__ */ q({
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 Vt = (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], s = e.store.rows[e.rowIndex], r = o.align || "center", a = o.width || "40ch", c = I(() => e.store.getCellDisplayValue(e.colIndex, e.rowIndex)), v = I(() => typeof c.value == "string" ? Vt(c.value) : !1), m = I(() => {
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: a,
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 = I(() => ({
715
+ }), w = I(() => ({
716
716
  "sticky-column": e.pinned,
717
- "cell-modified": u.value
718
- })), h = () => {
719
- const { left: p, bottom: y, width: E, height: A } = ve(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 = y, k.modal.width = E, k.modal.height = A, k.modal.cell = n.value, typeof o.modalComponent == "function" ? k.modal.component = o.modalComponent({ table: k.table, row: s, column: o }) : k.modal.component = o.modalComponent, k.modal.componentProps = o.modalComponentExtraProps;
717
+ "cell-modified": d.value
718
+ })), g = () => {
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
- ...Se,
727
- "keydown.f2": h,
728
- "keydown.alt.up": h,
729
- "keydown.alt.down": h,
730
- "keydown.alt.left": h,
731
- "keydown.alt.right": h
725
+ let c = {
726
+ ...Re,
727
+ "keydown.f2": g,
728
+ "keydown.alt.up": g,
729
+ "keydown.alt.down": g,
730
+ "keydown.alt.left": g,
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
- }), Te([
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 y = p.target;
747
- y.textContent !== i.value && (i.value = y.textContent, o.format ? (u.value = y.textContent !== e.store.getFormattedValue(e.colIndex, e.rowIndex, l), e.store.setCellText(e.colIndex, e.rowIndex, y.textContent)) : (u.value = y.textContent !== l, e.store.setCellData(e.colIndex, e.rowIndex, y.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, y) => ($(), 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: U(m.value),
760
- onFocus: M,
759
+ style: q(m.value),
760
+ onFocus: y,
761
761
  onPaste: f,
762
762
  onInput: f,
763
- onClick: h,
764
- class: j(["atable-cell", d.value])
763
+ onClick: g,
764
+ class: U(["atable-cell", w.value])
765
765
  }, [
766
- x(o).cellComponent ? ($(), le(de(x(o).cellComponent), Ee({
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, zt)) : ($(), R("span", Ft, Q(c.value), 1))
773
- ], 46, Bt));
771
+ innerHTML: s.value
772
+ }, null, 8, Ft)) : (k(), T("span", jt, K(s.value), 1))
773
+ ], 46, zt));
774
774
  }
775
- }), Gt = ["tabindex"], Ut = ["tabindex"], Yt = ["colspan"], qt = /* @__PURE__ */ q({
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 Vt = (e) => {
781
781
  addNavigation: { type: [Boolean, Object] }
782
782
  },
783
783
  setup(e) {
784
- const t = B("rowEl"), n = I(() => 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), Te([
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(se, null, [
799
- D("tr", Ee(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
- }, Q(n.value), 1),
809
- X(l.$slots, "row", {}, void 0, !0)
810
- ], 16, Gt),
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, Yt)
824
- ], 8, Ut)) : Z("", !0)
822
+ W(o.$slots, "content", {}, void 0, !0)
823
+ ], 8, Jt)
824
+ ], 8, qt)) : _("", !0)
825
825
  ], 64));
826
826
  }
827
- }), ne = (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
- }, Jt = /* @__PURE__ */ ne(qt, [["__scopeId", "data-v-5ad4bb41"]]), Qt = ["colspan"], Zt = {
832
+ }, Zt = /* @__PURE__ */ le(Qt, [["__scopeId", "data-v-5ad4bb41"]]), Kt = ["colspan"], _t = {
833
833
  ref: "container",
834
834
  class: "gantt-handler"
835
- }, Kt = {
835
+ }, en = {
836
836
  key: 0,
837
837
  class: "gantt-label"
838
- }, _t = /* @__PURE__ */ q({
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
- it((E) => ({
850
- eda8e56e: n.value,
851
- "411e94c1": E.colspan
851
+ setup(e) {
852
+ ct((c) => ({
853
+ e3124eea: t.value,
854
+ "58306efa": c.colspan
852
855
  }));
853
- const n = P();
854
- ee(() => {
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"), s = B("rightHandle"), { width: r } = ve(i), { left: a, right: c } = ve(u), v = P(e.start || 1), m = P(e.end || 4), d = P({ startX: 0, startPos: 0 }), h = I(() => e.colspan > 0 ? r.value / e.colspan : 0), M = I(() => {
858
- const E = v.value / e.colspan * 100, A = 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: `${A - E}%`,
862
- backgroundColor: n.value
863
+ left: `${c}%`,
864
+ width: `${h - c}%`,
865
+ backgroundColor: t.value
863
866
  };
864
- }), { isDragging: f } = he(o, {
867
+ }), { isDragging: g } = we(u, {
865
868
  axis: "x",
866
869
  onStart: () => {
867
- u.value && (u.value.style.transition = "none"), d.value = {
870
+ o.value && (o.value.style.transition = "none"), v.value = {
868
871
  startX: a.value,
869
- startPos: v.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) / h.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 A = E - d.value.startX, k = Math.round(A / h.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 } = he(s, {
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) / h.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 A = E - d.value.startX, k = Math.round(A / h.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: y } = he(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 = {
918
+ o.value && (o.value.style.transition = "none"), v.value = {
910
919
  startX: a.value,
911
- startPos: v.value
920
+ startPos: r.value
912
921
  };
913
922
  },
914
- onMove: ({ x: E }) => {
915
- if (y.value && u.value) {
916
- const k = (E - d.value.startX) / h.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 A = E - d.value.startX, k = Math.round(A / h.value), S = m.value - v.value;
923
- let b = d.value.startPos + k, O = b + S;
924
- b < 0 ? (b = 0, O = S) : O > e.colspan && (O = e.colspan, b = O - S), v.value = b, m.value = O, l("update:start", b), l("update:end", O), l("drag", { type: "bar", start: b, end: O });
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, A) => ($(), 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", Zt, [
933
- D("div", {
941
+ O("div", _t, [
942
+ O("div", {
934
943
  ref: "bar",
935
- class: j(["gantt-bar", { "is-dragging": x(y) || x(f) || x(p) }]),
936
- style: U(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: j(["gantt-handle left-handle", { "is-dragging": x(f) }])
941
- }, A[0] || (A[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", Kt, Q(E.label), 1)) : Z("", !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: j(["gantt-handle right-handle", { "is-dragging": x(p) }])
949
- }, A[1] || (A[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, Qt));
964
+ ], 8, Kt));
956
965
  }
957
- }), en = /* @__PURE__ */ ne(_t, [["__scopeId", "data-v-4fb5a483"]]), tn = ["tabindex"], nn = /* @__PURE__ */ q({
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,382 +972,391 @@ const Vt = (e) => {
963
972
  addNavigation: { type: [Boolean, Object], default: !1 }
964
973
  },
965
974
  setup(e) {
966
- const t = B("rowEl"), n = I(() => e.store.isRowVisible(e.rowIndex)), l = I(() => 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 = Se;
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
- }), Te([
981
+ }), Pe([
973
982
  {
974
983
  selectors: t,
975
- handlers: i
984
+ handlers: u
976
985
  }
977
986
  ]);
978
987
  }
979
- return (i, u) => ye(($(), 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: j(["list-index", i.store.hasPinnedColumns ? "sticky-index" : ""])
989
- }, Q(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: j(["tree-index", i.store.hasPinnedColumns ? "sticky-index" : ""]),
993
- onClick: u[0] || (u[0] = (o) => i.store.toggleRowExpand(i.rowIndex))
994
- }, Q(l.value), 3)) : Z("", !0)
995
- ], !0) : Z("", !0),
996
- X(i.$slots, "default", {}, void 0, !0)
997
- ], 8, tn)), [
998
- [Ue, 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
- }), Ze = /* @__PURE__ */ ne(nn, [["__scopeId", "data-v-4cb4f254"]]), Ke = me ? window : void 0;
1002
- function ae(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 J(...e) {
1016
+ function Z(...e) {
1008
1017
  const t = [], n = () => {
1009
- t.forEach((s) => s()), t.length = 0;
1010
- }, l = (s, r, a, c) => (s.addEventListener(r, a, c), () => s.removeEventListener(r, a, c)), i = I(() => {
1011
- const s = Y(C(e[0])).filter((r) => r != null);
1012
- return s.every((r) => typeof r != "string") ? s : void 0;
1013
- }), u = qe(
1018
+ t.forEach((a) => a()), t.length = 0;
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 s, r;
1024
+ var a, i;
1016
1025
  return [
1017
- (r = (s = i.value) == null ? void 0 : s.map((a) => ae(a))) != null ? r : [Ke].filter((a) => a != null),
1018
- Y(C(i.value ? e[1] : e[0])),
1019
- Y(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
- ([s, r, a, c]) => {
1025
- if (n(), !(s != null && s.length) || !(r != null && r.length) || !(a != null && a.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 = Ye(c) ? { ...c } : c;
1036
+ const v = Je(s) ? { ...s } : s;
1028
1037
  t.push(
1029
- ...s.flatMap(
1030
- (m) => r.flatMap(
1031
- (d) => a.map((h) => l(m, d, h, v))
1038
+ ...a.flatMap(
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 ue(n), o;
1049
+ return de(n), l;
1041
1050
  }
1042
- let Ne = !1;
1043
- function Be(e, t, n = {}) {
1044
- const { window: l = Ke, ignore: i = [], capture: u = !0, detectIframe: o = !1, controls: s = !1 } = n;
1045
- if (!l)
1046
- return s ? { stop: G, cancel: G, trigger: G } : G;
1047
- if (xe && !Ne) {
1048
- Ne = !0;
1051
+ let Ge = !1;
1052
+ function ze(e, t, n = {}) {
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) => J(p, "click", G, f)), J(l.document.documentElement, "click", G, 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 a = (f) => C(i).some((p) => {
1054
- if (typeof p == "string")
1055
- return Array.from(l.document.querySelectorAll(p)).some((y) => y === f.target || f.composedPath().includes(y));
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 y = ae(p);
1058
- return y && (f.target === y || f.composedPath().includes(y));
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 y = C(f), E = y.$.subTree && y.$.subTree.children;
1067
- return E == null || !Array.isArray(E) ? !1 : E.some((A) => A.el === p.target || p.composedPath().includes(A.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 = ae(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 = !a(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;
1080
- const h = [
1081
- J(l, "click", (f) => {
1082
- d || (d = !0, setTimeout(() => {
1083
- d = !1;
1088
+ let w = !1;
1089
+ const g = [
1090
+ Z(o, "click", (f) => {
1091
+ w || (w = !0, setTimeout(() => {
1092
+ w = !1;
1084
1093
  }, 0), m(f));
1085
- }, { passive: !0, capture: u }),
1086
- J(l, "pointerdown", (f) => {
1087
- const p = ae(e);
1088
- r = !a(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 && J(l, "blur", (f) => {
1099
+ l && Z(o, "blur", (f) => {
1091
1100
  setTimeout(() => {
1092
- var p;
1093
- const y = ae(e);
1094
- ((p = l.document.activeElement) == null ? void 0 : p.tagName) === "IFRAME" && !(y != null && y.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 = () => h.forEach((f) => f());
1098
- return s ? {
1099
- stop: M,
1106
+ ].filter(Boolean), y = () => g.forEach((f) => f());
1107
+ return a ? {
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 on = {
1117
+ const an = {
1109
1118
  mounted(e, t) {
1110
1119
  const n = !t.modifiers.bubble;
1111
1120
  if (typeof t.value == "function")
1112
- e.__onClickOutside_stop = Be(e, t.value, { capture: n });
1121
+ e.__onClickOutside_stop = ze(e, t.value, { capture: n });
1113
1122
  else {
1114
- const [l, i] = t.value;
1115
- e.__onClickOutside_stop = Be(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 ge(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 _e(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 : _e(n);
1140
+ return !n || n.tagName === "BODY" ? !1 : tt(n);
1132
1141
  }
1133
1142
  }
1134
- function ln(e) {
1143
+ function sn(e) {
1135
1144
  const t = e || window.event, n = t.target;
1136
- return _e(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 we = /* @__PURE__ */ new WeakMap();
1139
- function an(e, t = !1) {
1140
- const n = P(t);
1141
- let l = null, i = "";
1142
- N(Lt(e), (s) => {
1143
- const r = ge(C(s));
1144
- if (r) {
1145
- const a = r;
1146
- if (we.get(a) || we.set(a, a.style.overflow), a.style.overflow !== "hidden" && (i = a.style.overflow), a.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 a.style.overflow = "hidden";
1158
+ return r.style.overflow = "hidden";
1150
1159
  }
1151
1160
  }, {
1152
1161
  immediate: !0
1153
1162
  });
1154
- const u = () => {
1155
- const s = ge(C(e));
1156
- !s || n.value || (xe && (l = J(
1157
- s,
1163
+ const d = () => {
1164
+ const a = ye(C(e));
1165
+ !a || n.value || (Ee && (o = Z(
1166
+ a,
1158
1167
  "touchmove",
1159
- (r) => {
1160
- ln(r);
1168
+ (i) => {
1169
+ sn(i);
1161
1170
  },
1162
1171
  { passive: !1 }
1163
- )), s.style.overflow = "hidden", n.value = !0);
1164
- }, o = () => {
1165
- const s = ge(C(e));
1166
- !s || !n.value || (xe && (l == null || l()), s.style.overflow = i, we.delete(s), n.value = !1);
1172
+ )), a.style.overflow = "hidden", n.value = !0);
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 ue(o), I({
1177
+ return de(l), I({
1169
1178
  get() {
1170
1179
  return n.value;
1171
1180
  },
1172
- set(s) {
1173
- s ? u() : o();
1181
+ set(a) {
1182
+ a ? d() : l();
1174
1183
  }
1175
1184
  });
1176
1185
  }
1177
- function sn() {
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 = an(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
- sn();
1189
- const rn = {
1197
+ un();
1198
+ const cn = {
1190
1199
  key: 0,
1191
1200
  id: "resizable"
1192
- }, un = {
1201
+ }, dn = {
1193
1202
  class: "atable-header-row",
1194
1203
  tabindex: "-1"
1195
- }, et = /* @__PURE__ */ q({
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", rn, [
1203
- D("tr", un, [
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: j([[
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)) : Z("", !0),
1213
- ($(!0), R(se, null, be(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: U(t.store.getHeaderCellStyle(l)),
1217
- class: j(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
- ut(Q(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
- ])) : Z("", !0);
1233
+ ])) : _("", !0);
1225
1234
  }
1226
- }), tt = /* @__PURE__ */ q({
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 } = ve(t), i = I(() => {
1233
- var v, m, d, h;
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, s = u.offsetWidth || 0;
1236
- let r = ((m = e.store.modal.cell) == null ? void 0 : m.offsetTop) || 0;
1237
- const a = ((d = u.querySelector("thead")) == null ? void 0 : d.offsetHeight) || 0;
1238
- r += a, r = r + l.value < o ? r : r - (l.value + e.store.modal.height);
1239
- let c = ((h = e.store.modal.cell) == null ? void 0 : h.offsetLeft) || 0;
1240
- return c = c + n.value <= s ? 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] = Re(() => {
1258
+ onClick: l[0] || (l[0] = Oe(() => {
1250
1259
  }, ["stop"])),
1251
- onInput: o[1] || (o[1] = Re(() => {
1260
+ onInput: l[1] || (l[1] = Oe(() => {
1252
1261
  }, ["stop"])),
1253
- style: U(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
- }), cn = (e) => {
1259
- const t = e.id || Nt();
1260
- return ct(`table-${t}`, () => {
1261
- const l = () => {
1262
- const g = {};
1263
- for (const [w, T] of u.value.entries())
1264
- for (const [L, H] of o.value.entries())
1265
- g[`${w}:${L}`] = H[T.name];
1266
- return g;
1267
- }, i = (g) => {
1268
- const w = [Object.assign({}, { rowModified: !1 })];
1269
- if (g && "0:0" in g)
1270
- return g;
1271
- const T = /* @__PURE__ */ new Set();
1272
- for (let L = o.value.length - 1; L >= 0; L--) {
1273
- const H = o.value[L];
1274
- H.parent && T.add(H.parent), w[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: T.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 w;
1286
- }, u = P(e.columns), o = P(e.rows), s = P(e.config || {}), r = P(e.table || l()), a = P(i(e.display)), c = P(e.modal || { visible: !1 }), v = P({}), m = I(() => u.value.some((g) => g.pinned)), d = I(() => `${Math.ceil(o.value.length / 100 + 1)}ch`), h = I(
1287
- () => s.value.view ? ["list", "tree", "list-expansion"].includes(s.value.view) : !1
1288
- ), M = (g, w) => r.value[`${g}:${w}`], f = (g, w, T) => {
1289
- const L = `${g}:${w}`, H = u.value[g];
1290
- r.value[L] !== T && (a.value[w].rowModified = !0), r.value[L] = T, o.value[w][H.name] = T;
1291
- }, p = (g, w, T) => {
1292
- const L = `${g}:${w}`;
1293
- r.value[L] !== T && (a.value[w].rowModified = !0, v.value[L] = T);
1294
- }, y = (g) => ({
1295
- minWidth: g.width || "40ch",
1296
- textAlign: g.align || "center",
1297
- width: s.value.fullWidth ? "auto" : void 0
1298
- }), E = (g) => s.value.view !== "tree" || a.value[g].isRoot || a.value[g].open, A = (g) => s.value.view !== "tree" ? "" : a.value[g].isRoot || a.value[g].isParent ? a.value[g].childrenOpen ? "-" : "+" : "", k = (g) => {
1299
- if (s.value.view === "tree") {
1300
- a.value[g].childrenOpen = !a.value[g].childrenOpen;
1301
- for (let w = o.value.length - 1; w >= 0; w--)
1302
- a.value[w].parent === g && (a.value[w].open = !a.value[w].open, a.value[w].childrenOpen && k(w));
1303
- } else s.value.view === "list-expansion" && (a.value[g].expanded = !a.value[g].expanded);
1304
- }, S = (g, w) => {
1305
- const T = M(g, w);
1306
- return b(g, w, T);
1307
- }, b = (g, w, T) => {
1308
- const L = u.value[g], H = o.value[w], oe = L.format;
1309
- return oe ? typeof oe == "function" ? oe(T, { table: r.value, row: H, column: L }) : typeof oe == "string" ? Function(`"use strict";return (${oe})`)()(T, { table: r.value, row: H, column: L }) : T : T;
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(
1296
+ () => a.value.view ? ["list", "tree", "list-expansion"].includes(a.value.view) : !1
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",
1306
+ width: a.value.fullWidth ? "auto" : void 0
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) => {
1311
+ if (a.value.view === "tree") {
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;
1310
1322
  };
1311
1323
  return {
1312
1324
  // state
1313
- columns: u,
1314
- config: s,
1315
- display: a,
1316
- modal: c,
1317
- rows: o,
1318
- table: r,
1325
+ columns: d,
1326
+ config: a,
1327
+ display: r,
1328
+ modal: s,
1329
+ rows: l,
1330
+ table: i,
1319
1331
  updates: v,
1320
1332
  // getters
1321
1333
  hasPinnedColumns: m,
1322
- numberedRowWidth: d,
1323
- zeroColumn: h,
1334
+ numberedRowWidth: w,
1335
+ zeroColumn: g,
1324
1336
  // actions
1325
- closeModal: (g) => {
1326
- var w;
1327
- g.target instanceof Node && (w = c.value.parent) != null && w.contains(g.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);
1328
1340
  },
1329
- getCellData: M,
1330
- getCellDisplayValue: S,
1331
- getFormattedValue: b,
1332
- getHeaderCellStyle: y,
1333
- getIndent: (g, w) => w && g === 0 && w > 0 ? `${w}ch` : "inherit",
1334
- getRowExpandSymbol: A,
1335
- isRowVisible: E,
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,
1336
1349
  setCellData: f,
1337
- setCellText: p,
1338
- toggleRowExpand: k
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
+ }
1339
1357
  };
1340
1358
  })();
1341
- }, dn = /* @__PURE__ */ q({
1359
+ }, vn = /* @__PURE__ */ Q({
1342
1360
  __name: "ATable",
1343
1361
  props: {
1344
1362
  id: {},
@@ -1347,179 +1365,191 @@ const rn = {
1347
1365
  rows: { default: () => [] },
1348
1366
  config: { default: () => new Object() }
1349
1367
  },
1350
- emits: ["update:modelValue", "cellUpdate"],
1368
+ emits: ["update:modelValue", "cellUpdate", "gantt:drag"],
1351
1369
  setup(e, { expose: t, emit: n }) {
1352
- const l = n, i = B("table"), u = e.modelValue ? e.modelValue : e.rows, o = cn({ columns: e.columns, rows: u, id: e.id, config: e.config });
1353
- o.$onAction(({ name: a, store: c, args: v, after: m }) => {
1354
- if (a === "setCellData" || a === "setCellText") {
1355
- const [d, h, M] = v, f = c.getCellData(d, h);
1356
- m(() => {
1357
- l("cellUpdate", { colIndex: d, rowIndex: h, newValue: M, oldValue: f });
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;
1373
+ if (s === "setCellData" || s === "setCellText") {
1374
+ const [y, f, c] = m, h = v.getCellData(y, f);
1375
+ w(() => {
1376
+ o("cellUpdate", { colIndex: y, rowIndex: f, newValue: c, oldValue: h });
1358
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
+ }
1359
1386
  }
1360
- }), N(
1361
- () => o.rows,
1362
- (a) => {
1363
- l("update:modelValue", a);
1387
+ }), V(
1388
+ () => l.rows,
1389
+ (s) => {
1390
+ o("update:modelValue", s);
1364
1391
  },
1365
1392
  { deep: !0 }
1366
- ), ee(() => {
1367
- e.columns.some((a) => a.pinned) && (s(), o.config.view === "tree" && Qe(i, s, { 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 }));
1368
1395
  });
1369
- const s = () => {
1370
- const a = i.value, c = a == null ? void 0 : a.rows[0], v = a == null ? void 0 : a.rows[1], m = c ? Array.from(c.cells) : [];
1371
- for (const [d, h] of m.entries()) {
1372
- const M = v == null ? void 0 : v.cells[d];
1373
- M && (h.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`);
1374
1401
  }
1375
- for (const d of (a == null ? void 0 : a.rows) || []) {
1376
- let h = 0;
1377
- const M = [];
1378
- for (const f of d.cells)
1379
- (f.classList.contains("sticky-column") || f.classList.contains("sticky-index")) && (f.style.left = `${h}px`, h += f.offsetWidth, M.push(f));
1380
- 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");
1381
1408
  }
1382
1409
  };
1383
- window.addEventListener("keydown", (a) => {
1384
- if (a.key === "Escape" && o.modal.visible) {
1385
- o.modal.visible = !1;
1386
- const c = o.modal.parent;
1387
- c && je().then(() => {
1388
- c.focus();
1410
+ window.addEventListener("keydown", (s) => {
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();
1389
1416
  });
1390
1417
  }
1391
1418
  });
1392
- const r = (a) => {
1393
- const c = a.indent === 0, v = o.columns.filter((d) => d.pinned).length;
1394
- if (!c || v === 0)
1395
- return o.columns;
1419
+ const r = (s) => {
1420
+ var w;
1421
+ if (!(s.indent === 0) || a.value === 0)
1422
+ return l.columns;
1396
1423
  const m = [];
1397
- for (let d = 0; d < v; d++) {
1398
- const h = { ...o.columns[d] };
1399
- h.originalIndex = d, m.push(h);
1424
+ for (let g = 0; g < a.value; g++) {
1425
+ const y = { ...l.columns[g] };
1426
+ y.originalIndex = g, m.push(y);
1400
1427
  }
1401
1428
  return m.push({
1402
- ...o.columns[v],
1403
- colspan: o.columns.length - v,
1429
+ ...l.columns[a.value],
1404
1430
  isGantt: !0,
1405
- originalIndex: v,
1406
- color: c ? a.resource_name.color : "",
1431
+ colspan: ((w = s.gantt) == null ? void 0 : w.colspan) || l.columns.length - a.value,
1432
+ originalIndex: a.value,
1407
1433
  width: "auto"
1408
1434
  // TODO: refactor to API that can detect when data exists in a cell. Might have be custom and not generalizable
1409
1435
  }), m;
1410
1436
  };
1411
- return t({ store: o }), (a, c) => ye(($(), R("table", {
1437
+ return t({ store: l }), (s, v) => xe((k(), T("table", {
1412
1438
  ref: "table",
1413
1439
  class: "atable",
1414
- style: U({
1415
- width: x(o).config.fullWidth ? "100%" : "auto"
1440
+ style: q({
1441
+ width: x(l).config.fullWidth ? "100%" : "auto"
1416
1442
  })
1417
1443
  }, [
1418
- X(a.$slots, "header", { data: x(o) }, () => [
1419
- Pe(et, {
1420
- columns: x(o).columns,
1421
- store: x(o)
1444
+ W(s.$slots, "header", { data: x(l) }, () => [
1445
+ Le(nt, {
1446
+ columns: x(l).columns,
1447
+ store: x(l)
1422
1448
  }, null, 8, ["columns", "store"])
1423
1449
  ], !0),
1424
- D("tbody", null, [
1425
- X(a.$slots, "body", { data: x(o) }, () => [
1426
- ($(!0), R(se, null, be(x(o).rows, (v, m) => ($(), le(Ze, {
1427
- key: v.id,
1428
- row: v,
1429
- rowIndex: m,
1430
- 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)
1431
1457
  }, {
1432
- default: Oe(() => [
1433
- ($(!0), R(se, null, be(r(v), (d, h) => ($(), R(se, {
1434
- key: d.name
1435
- }, [
1436
- d.isGantt ? ($(), le(de(d.ganttComponent || "AGanttCell"), {
1437
- key: 0,
1438
- store: x(o),
1439
- color: d.color,
1440
- colspan: d.colspan,
1441
- pinned: d.pinned,
1442
- rowIndex: m,
1443
- colIndex: d.originalIndex !== void 0 ? d.originalIndex : h,
1444
- style: U({
1445
- textAlign: (d == null ? void 0 : d.align) || "center",
1446
- minWidth: (d == null ? void 0 : d.width) || "40ch",
1447
- width: x(o).config.fullWidth ? "auto" : null
1448
- // tabIndex: column.isGantt ? '-1' : '0',
1449
- }),
1450
- spellcheck: "false"
1451
- }, null, 8, ["store", "color", "colspan", "pinned", "rowIndex", "colIndex", "style"])) : ($(), le(de(d.cellComponent || "ACell"), {
1452
- key: 1,
1453
- store: x(o),
1454
- pinned: d.pinned,
1455
- rowIndex: m,
1456
- colIndex: h,
1457
- style: U({
1458
- textAlign: (d == null ? void 0 : d.align) || "center",
1459
- minWidth: (d == null ? void 0 : d.width) || "40ch",
1460
- width: x(o).config.fullWidth ? "auto" : null
1461
- }),
1462
- spellcheck: "false"
1463
- }, null, 8, ["store", "pinned", "rowIndex", "colIndex", "style"]))
1464
- ], 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))
1465
1495
  ]),
1466
1496
  _: 2
1467
1497
  }, 1032, ["row", "rowIndex", "store"]))), 128))
1468
1498
  ], !0)
1469
1499
  ]),
1470
- X(a.$slots, "footer", { data: x(o) }, void 0, !0),
1471
- X(a.$slots, "modal", { data: x(o) }, () => [
1472
- ye(Pe(tt, { store: x(o) }, {
1473
- default: Oe(() => [
1474
- ($(), le(de(x(o).modal.component), Ee({
1475
- key: `${x(o).modal.rowIndex}:${x(o).modal.colIndex}`,
1476
- colIndex: x(o).modal.colIndex,
1477
- rowIndex: x(o).modal.rowIndex,
1478
- store: x(o)
1479
- }, 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"]))
1480
1510
  ]),
1481
1511
  _: 1
1482
1512
  }, 8, ["store"]), [
1483
- [Ue, x(o).modal.visible]
1513
+ [qe, x(l).modal.visible]
1484
1514
  ])
1485
1515
  ], !0)
1486
1516
  ], 4)), [
1487
- [x(on), x(o).closeModal]
1517
+ [x(an), x(l).closeModal]
1488
1518
  ]);
1489
1519
  }
1490
- }), fn = /* @__PURE__ */ ne(dn, [["__scopeId", "data-v-7af486de"]]), vn = {}, mn = { class: "aloading" }, pn = { class: "aloading-header" };
1491
- function hn(e, t) {
1492
- return $(), R("div", mn, [
1493
- D("h2", pn, [
1494
- 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)
1495
1525
  ]),
1496
- t[0] || (t[0] = D("div", { class: "aloading-bar" }, null, -1))
1526
+ t[0] || (t[0] = O("div", { class: "aloading-bar" }, null, -1))
1497
1527
  ]);
1498
1528
  }
1499
- const gn = /* @__PURE__ */ ne(vn, [["render", hn], ["__scopeId", "data-v-a930a25b"]]), wn = {}, yn = { class: "aloading" }, bn = { class: "aloading-header" };
1500
- function xn(e, t) {
1501
- return $(), R("div", yn, [
1502
- D("h2", bn, [
1503
- 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)
1504
1534
  ]),
1505
- t[0] || (t[0] = D("div", { class: "aloading-bar" }, null, -1))
1535
+ t[0] || (t[0] = O("div", { class: "aloading-bar" }, null, -1))
1506
1536
  ]);
1507
1537
  }
1508
- const Cn = /* @__PURE__ */ ne(wn, [["render", xn], ["__scopeId", "data-v-e1165876"]]);
1509
- function $n(e) {
1510
- e.component("ACell", jt), e.component("AExpansionRow", Jt), e.component("AGanttCell", en), e.component("ARow", Ze), e.component("ATable", fn), e.component("ATableHeader", et), e.component("ATableLoading", gn), e.component("ATableLoadingBar", Cn), e.component("ATableModal", tt);
1538
+ const In = /* @__PURE__ */ le(bn, [["render", En], ["__scopeId", "data-v-e1165876"]]);
1539
+ function An(e) {
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);
1511
1541
  }
1512
1542
  export {
1513
- jt as ACell,
1514
- Jt as AExpansionRow,
1515
- en as AGanttCell,
1516
- Ze as ARow,
1517
- fn as ATable,
1518
- et as ATableHeader,
1519
- gn as ATableLoading,
1520
- Cn as ATableLoadingBar,
1521
- tt as ATableModal,
1522
- cn as createTableStore,
1523
- $n as install
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,
1553
+ An as install
1524
1554
  };
1525
1555
  //# sourceMappingURL=atable.js.map