@stonecrop/atable 0.16.1 → 0.16.3

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