@stonecrop/atable 0.24.0 → 0.25.0

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