@stonecrop/atable 0.16.2 → 0.16.4

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