@stonecrop/atable 0.4.10 → 0.4.12

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