@opengis/table 0.0.20 → 0.0.22

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.
Files changed (36) hide show
  1. package/dist/components/CodeTabs.vue.d.ts +14 -0
  2. package/dist/components/CodeTabs.vue.d.ts.map +1 -0
  3. package/dist/components/Column.vue.d.ts +16 -0
  4. package/dist/components/Column.vue.d.ts.map +1 -0
  5. package/dist/components/DataTable.vue.d.ts +73 -0
  6. package/dist/components/DataTable.vue.d.ts.map +1 -0
  7. package/dist/components/Pagination.vue.d.ts +18 -0
  8. package/dist/components/Pagination.vue.d.ts.map +1 -0
  9. package/dist/components/SelectionInfo.vue.d.ts +7 -0
  10. package/dist/components/SelectionInfo.vue.d.ts.map +1 -0
  11. package/dist/components/index.d.ts +6 -0
  12. package/dist/components/index.d.ts.map +1 -0
  13. package/dist/formats/ArrayFormat.vue.d.ts +4 -0
  14. package/dist/formats/ArrayFormat.vue.d.ts.map +1 -0
  15. package/dist/formats/BadgeFormat.vue.d.ts +4 -0
  16. package/dist/formats/BadgeFormat.vue.d.ts.map +1 -0
  17. package/dist/formats/DateFormat.vue.d.ts +4 -0
  18. package/dist/formats/DateFormat.vue.d.ts.map +1 -0
  19. package/dist/formats/LinkFormat.vue.d.ts +13 -0
  20. package/dist/formats/LinkFormat.vue.d.ts.map +1 -0
  21. package/dist/formats/NumberFormat.vue.d.ts +4 -0
  22. package/dist/formats/NumberFormat.vue.d.ts.map +1 -0
  23. package/dist/formats/SelectFormat.vue.d.ts +4 -0
  24. package/dist/formats/SelectFormat.vue.d.ts.map +1 -0
  25. package/dist/formats/TextFormat.vue.d.ts +4 -0
  26. package/dist/formats/TextFormat.vue.d.ts.map +1 -0
  27. package/dist/formats/index.d.ts +16 -0
  28. package/dist/formats/index.d.ts.map +1 -0
  29. package/dist/index.css +1 -1
  30. package/dist/index.d.ts +12 -0
  31. package/dist/index.d.ts.map +1 -0
  32. package/dist/index.mjs +351 -377
  33. package/dist/index.umd.js +1 -1
  34. package/dist/types/index.d.ts +143 -0
  35. package/dist/types/index.d.ts.map +1 -0
  36. package/package.json +7 -9
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { defineComponent as S, computed as f, createElementBlock as u, openBlock as o, toDisplayString as h, normalizeStyle as ge, normalizeClass as m, Fragment as B, renderList as z, createElementVNode as v, createTextVNode as N, ref as w, useSlots as pe, watch as L, onMounted as fe, provide as $e, createCommentVNode as j, createBlock as J, renderSlot as P, resolveDynamicComponent as te, unref as ae, inject as Te, withDirectives as Fe, vShow as Se } from "vue";
2
- const De = /* @__PURE__ */ S({
1
+ import { defineComponent as F, computed as m, createElementBlock as i, openBlock as o, toDisplayString as x, normalizeStyle as ve, normalizeClass as f, Fragment as R, renderList as z, createElementVNode as d, createTextVNode as M, ref as _, useSlots as pe, watch as L, onMounted as fe, provide as $e, createCommentVNode as B, createBlock as ee, renderSlot as j, unref as te, resolveDynamicComponent as ce, inject as Te, withDirectives as Se, vShow as Fe } from "vue";
2
+ const De = /* @__PURE__ */ F({
3
3
  name: "NumberFormat",
4
4
  __name: "NumberFormat",
5
5
  props: {
@@ -8,12 +8,12 @@ const De = /* @__PURE__ */ S({
8
8
  column: {}
9
9
  },
10
10
  setup(b) {
11
- const a = b, e = f(() => a.value === null || a.value === void 0 ? "" : typeof a.value == "number" ? a.value.toFixed(2) : Intl.NumberFormat("uk-UA", {
11
+ const n = b, e = m(() => n.value === null || n.value === void 0 ? "" : typeof n.value == "number" ? n.value.toFixed(2) : Intl.NumberFormat("uk-UA", {
12
12
  maximumFractionDigits: 2
13
- }).format(Number(a.value)));
14
- return (c, l) => (o(), u("span", null, h(e.value), 1));
13
+ }).format(Number(n.value)));
14
+ return (v, s) => (o(), i("span", null, x(e.value || "-"), 1));
15
15
  }
16
- }), Ae = /* @__PURE__ */ S({
16
+ }), Ae = /* @__PURE__ */ F({
17
17
  name: "DateFormat",
18
18
  __name: "DateFormat",
19
19
  props: {
@@ -22,17 +22,17 @@ const De = /* @__PURE__ */ S({
22
22
  column: {}
23
23
  },
24
24
  setup(b) {
25
- const a = b, e = f(() => {
26
- if (!a.value) return "";
25
+ const n = b, e = m(() => {
26
+ if (!n.value) return "";
27
27
  try {
28
- return new Date(a.value).toLocaleDateString();
28
+ return new Date(n.value).toLocaleDateString();
29
29
  } catch {
30
- return a.value;
30
+ return n.value;
31
31
  }
32
32
  });
33
- return (c, l) => (o(), u("span", null, h(e.value), 1));
33
+ return (v, s) => (o(), i("span", null, x(e.value || "-"), 1));
34
34
  }
35
- }), Ie = /* @__PURE__ */ S({
35
+ }), Ie = /* @__PURE__ */ F({
36
36
  name: "TextFormat",
37
37
  __name: "TextFormat",
38
38
  props: {
@@ -41,10 +41,10 @@ const De = /* @__PURE__ */ S({
41
41
  column: {}
42
42
  },
43
43
  setup(b) {
44
- const a = b, { value: e } = a, c = f(() => Array.isArray(e) ? e.map((l) => l.text || l).join(",") : e?.text || e);
45
- return (l, n) => (o(), u("span", null, h(c.value), 1));
44
+ const n = b, { value: e } = n, v = m(() => Array.isArray(e) ? e.map((s) => s.text || s).join(",") : e?.text || e);
45
+ return (s, l) => (o(), i("span", null, x(v.value || "-"), 1));
46
46
  }
47
- }), je = /* @__PURE__ */ S({
47
+ }), Be = /* @__PURE__ */ F({
48
48
  name: "BadgeFormat",
49
49
  __name: "BadgeFormat",
50
50
  props: {
@@ -53,37 +53,37 @@ const De = /* @__PURE__ */ S({
53
53
  column: {}
54
54
  },
55
55
  setup(b) {
56
- const a = b, e = f(() => {
57
- const n = String(a.value || "").toLowerCase(), i = "inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium";
58
- return n.includes("success") || n.includes("active") || n.includes("completed") ? `${i} bg-green-100 text-green-800` : n.includes("error") || n.includes("failed") || n.includes("inactive") ? `${i} bg-red-100 text-red-800` : n.includes("warning") || n.includes("pending") ? `${i} bg-yellow-100 text-yellow-800` : n.includes("info") || n.includes("processing") ? `${i} bg-blue-100 text-blue-800` : a.value?.color && !/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(a.value.color) ? `${i} bg-${a.value.color}-100 text-${a.value.color}-800` : `${i} bg-gray-100 text-gray-800`;
56
+ const n = b, e = m(() => {
57
+ const l = String(n.value || "").toLowerCase(), u = "inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium";
58
+ return l.includes("success") || l.includes("active") || l.includes("completed") ? `${u} bg-green-100 text-green-800` : l.includes("error") || l.includes("failed") || l.includes("inactive") ? `${u} bg-red-100 text-red-800` : l.includes("warning") || l.includes("pending") ? `${u} bg-yellow-100 text-yellow-800` : l.includes("info") || l.includes("processing") ? `${u} bg-blue-100 text-blue-800` : n.value?.color && !/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(n.value.color) ? `${u} bg-${n.value.color}-100 text-${n.value.color}-800` : `${u} bg-gray-100 text-gray-800`;
59
59
  });
60
- function c(n, i = 1) {
61
- const _ = parseInt(n.slice(1, 3), 16), $ = parseInt(n.slice(3, 5), 16), T = parseInt(n.slice(5, 7), 16);
62
- return `rgba(${_}, ${$}, ${T}, ${i})`;
60
+ function v(l, u = 1) {
61
+ const C = parseInt(l.slice(1, 3), 16), S = parseInt(l.slice(3, 5), 16), $ = parseInt(l.slice(5, 7), 16);
62
+ return `rgba(${C}, ${S}, ${$}, ${u})`;
63
63
  }
64
- const l = f(() => {
65
- const n = {
64
+ const s = m(() => {
65
+ const l = {
66
66
  minWidth: "60px",
67
67
  textAlign: "center",
68
68
  display: "inline-block"
69
69
  };
70
- return /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(a.value?.color) ? {
71
- ...n,
72
- backgroundColor: c(a.value.color, 0.1),
73
- color: c(a.value.color, 0.8)
74
- } : n;
70
+ return /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(n.value?.color) ? {
71
+ ...l,
72
+ backgroundColor: v(n.value.color, 0.1),
73
+ color: v(n.value.color, 0.8)
74
+ } : l;
75
75
  });
76
- return (n, i) => (o(), u("span", {
77
- class: m(["badge", e.value]),
78
- style: ge(l.value)
79
- }, h(n.value?.text || n.value), 7));
76
+ return (l, u) => (o(), i("span", {
77
+ class: f(["badge", e.value]),
78
+ style: ve(s.value)
79
+ }, x(l.value?.text || l.value || "-"), 7));
80
80
  }
81
- }), Be = (b, a) => {
81
+ }), Re = (b, n) => {
82
82
  const e = b.__vccOpts || b;
83
- for (const [c, l] of a)
84
- e[c] = l;
83
+ for (const [v, s] of n)
84
+ e[v] = s;
85
85
  return e;
86
- }, Re = /* @__PURE__ */ Be(je, [["__scopeId", "data-v-28700c64"]]), ze = { class: "flex flex-wrap gap-1" }, Pe = /* @__PURE__ */ S({
86
+ }, je = /* @__PURE__ */ Re(Be, [["__scopeId", "data-v-f4b15092"]]), ze = { class: "flex flex-wrap gap-1" }, Pe = /* @__PURE__ */ F({
87
87
  name: "ArrayFormat",
88
88
  __name: "ArrayFormat",
89
89
  props: {
@@ -92,42 +92,15 @@ const De = /* @__PURE__ */ S({
92
92
  column: {}
93
93
  },
94
94
  setup(b) {
95
- const a = b, e = f(() => a.value ? Array.isArray(a.value) ? a.value : [a.value] : []), c = (l) => l ? typeof l == "object" && l.name ? l.name : typeof l == "string" || typeof l == "number" ? String(l) : JSON.stringify(l) : "";
96
- return (l, n) => (o(), u("div", ze, [
97
- (o(!0), u(B, null, z(e.value, (i, _) => (o(), u("span", {
98
- key: _,
95
+ const n = b, e = m(() => n.value ? Array.isArray(n.value) ? n.value : [n.value] : []), v = (s) => s ? typeof s == "object" && s.name ? s.name : typeof s == "string" || typeof s == "number" ? String(s) : JSON.stringify(s) : "";
96
+ return (s, l) => (o(), i("div", ze, [
97
+ (o(!0), i(R, null, z(e.value, (u, C) => (o(), i("span", {
98
+ key: C,
99
99
  class: "inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800 hover:bg-blue-200 transition-colors"
100
- }, h(c(i)), 1))), 128))
100
+ }, x(v(u)), 1))), 128))
101
101
  ]));
102
102
  }
103
- }), Le = ["href", "target"], Ne = /* @__PURE__ */ S({
104
- __name: "LinkFormat",
105
- props: {
106
- href: { default: "" },
107
- target: { default: "_self" },
108
- onClick: { type: Function, default: void 0 },
109
- value: {},
110
- row: {},
111
- column: {}
112
- },
113
- setup(b) {
114
- const a = b, e = f(() => typeof a.value == "string" || typeof a.value == "number" ? a.value : a.value?.text || a.value?.label || "Link"), c = f(() => a.href ? a.href : typeof a.value == "object" && a.value?.href ? a.value.href : ""), l = f(() => a.target ? a.target : typeof a.value == "object" && a.value?.target ? a.value.target : "_self"), n = f(() => "text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300 underline cursor-pointer"), i = (_) => {
115
- a.onClick && a.row && (_.preventDefault(), a.onClick(a.row, a.value));
116
- };
117
- return (_, $) => c.value ? (o(), u("a", {
118
- key: 0,
119
- href: c.value,
120
- target: l.value,
121
- class: m(n.value),
122
- onClick: i
123
- }, h(e.value), 11, Le)) : (o(), u("button", {
124
- key: 1,
125
- type: "button",
126
- class: m(n.value),
127
- onClick: i
128
- }, h(e.value), 3));
129
- }
130
- }), Ve = /* @__PURE__ */ S({
103
+ }), Ne = /* @__PURE__ */ F({
131
104
  name: "TextFormat",
132
105
  __name: "SelectFormat",
133
106
  props: {
@@ -136,18 +109,17 @@ const De = /* @__PURE__ */ S({
136
109
  column: {}
137
110
  },
138
111
  setup(b) {
139
- const a = b, { value: e } = a, c = f(() => Array.isArray(e) ? e.map((l) => l.text || l).filter((l, n) => n < 2).join(", ") + (e.length > 2 ? ` +${e.length - 2}` : "") : e?.text || e);
140
- return (l, n) => (o(), u("span", null, h(c.value), 1));
112
+ const n = b, { value: e } = n, v = m(() => Array.isArray(e) ? e.map((s) => s.text || s).filter((s, l) => l < 2).join(", ") + (e.length > 2 ? ` +${e.length - 2}` : "") : e?.text || e);
113
+ return (s, l) => (o(), i("span", null, x(v.value || "-"), 1));
141
114
  }
142
115
  }), de = {
143
116
  number: De,
144
117
  date: Ae,
145
118
  text: Ie,
146
- badge: Re,
119
+ badge: je,
147
120
  array: Pe,
148
- select: Ve,
149
- link: Ne
150
- }, Me = { class: "flex items-center space-x-4" }, Ee = { class: "font-medium" }, He = { class: "font-medium" }, We = { class: "font-medium" }, Ue = { class: "flex items-center space-x-2" }, Oe = ["disabled"], Je = { class: "flex items-center space-x-1" }, qe = ["onClick"], Ge = ["disabled"], me = /* @__PURE__ */ S({
121
+ select: Ne
122
+ }, Le = { class: "flex items-center space-x-4" }, Me = { class: "font-medium" }, Ve = { class: "font-medium" }, Ee = { class: "font-medium" }, He = { class: "flex items-center space-x-2" }, We = ["disabled"], Ue = { class: "flex items-center space-x-1" }, Oe = ["onClick"], Je = ["disabled"], me = /* @__PURE__ */ F({
151
123
  name: "Pagination",
152
124
  __name: "Pagination",
153
125
  props: {
@@ -158,8 +130,8 @@ const De = /* @__PURE__ */ S({
158
130
  size: { default: "medium" }
159
131
  },
160
132
  emits: ["update:page"],
161
- setup(b, { emit: a }) {
162
- const e = b, c = f(() => ({
133
+ setup(b, { emit: n }) {
134
+ const e = b, v = m(() => ({
163
135
  small: {
164
136
  text: "text-xs",
165
137
  button: "px-2 h-7 text-xs min-w-[28px] flex items-center justify-center",
@@ -175,7 +147,7 @@ const De = /* @__PURE__ */ S({
175
147
  button: "px-4 h-11 text-base min-w-[44px] flex items-center justify-center",
176
148
  icon: "w-5 h-5"
177
149
  }
178
- })[e.size]), l = f(() => {
150
+ })[e.size]), s = m(() => {
179
151
  const { theme: p } = e;
180
152
  return p === "dark" ? {
181
153
  container: "bg-gray-900 border-gray-700",
@@ -199,122 +171,119 @@ const De = /* @__PURE__ */ S({
199
171
  buttonActive: "bg-blue-600 text-white",
200
172
  ellipsis: "text-gray-500 dark:text-gray-400"
201
173
  };
202
- }), n = a, i = f(() => Math.ceil(e.total / e.limit)), _ = f(() => e.total === 0 ? 0 : (e.page - 1) * e.limit + 1), $ = f(() => Math.min(e.page * e.limit, e.total)), T = f(() => {
174
+ }), l = n, u = m(() => Math.ceil(e.total / e.limit)), C = m(() => e.total === 0 ? 0 : (e.page - 1) * e.limit + 1), S = m(() => Math.min(e.page * e.limit, e.total)), $ = m(() => {
203
175
  const p = [];
204
- if (i.value <= 7)
205
- for (let k = 1; k <= i.value; k += 1)
176
+ if (u.value <= 7)
177
+ for (let k = 1; k <= u.value; k += 1)
206
178
  p.push(k);
207
179
  else {
208
180
  p.push(1), e.page > 4 && p.push("...");
209
- const k = Math.max(2, e.page - 1), F = Math.min(i.value - 1, e.page + 1);
210
- for (let A = k; A <= F; A += 1)
211
- A !== 1 && A !== i.value && p.push(A);
212
- e.page < i.value - 3 && p.push("..."), i.value > 1 && p.push(i.value);
181
+ const k = Math.max(2, e.page - 1), T = Math.min(u.value - 1, e.page + 1);
182
+ for (let A = k; A <= T; A += 1)
183
+ A !== 1 && A !== u.value && p.push(A);
184
+ e.page < u.value - 3 && p.push("..."), u.value > 1 && p.push(u.value);
213
185
  }
214
186
  return p;
215
187
  }), D = (p) => {
216
- p >= 1 && p <= i.value && p !== e.page && n("update:page", p);
188
+ p >= 1 && p <= u.value && p !== e.page && l("update:page", p);
217
189
  };
218
- return (p, y) => (o(), u("div", {
219
- class: m(["flex items-center justify-between py-3 border-t", l.value.container])
190
+ return (p, y) => (o(), i("div", {
191
+ class: f(["flex items-center justify-between py-3 border-t", s.value.container])
220
192
  }, [
221
- v("div", Me, [
222
- v("div", {
223
- class: m(["flex items-center text-sm", l.value.text, c.value.text])
193
+ d("div", Le, [
194
+ d("div", {
195
+ class: f(["flex items-center text-sm", s.value.text, v.value.text])
224
196
  }, [
225
- v("span", null, [
226
- y[2] || (y[2] = N(" Показано ", -1)),
227
- v("span", Ee, h(_.value), 1),
228
- y[3] || (y[3] = N(" до ", -1)),
229
- v("span", He, h($.value), 1),
230
- y[4] || (y[4] = N(" з ", -1)),
231
- v("span", We, h(p.total), 1),
232
- y[5] || (y[5] = N(" результатів ", -1))
197
+ d("span", null, [
198
+ y[2] || (y[2] = M(" Показано ", -1)),
199
+ d("span", Me, x(C.value), 1),
200
+ y[3] || (y[3] = M(" до ", -1)),
201
+ d("span", Ve, x(S.value), 1),
202
+ y[4] || (y[4] = M(" з ", -1)),
203
+ d("span", Ee, x(p.total), 1),
204
+ y[5] || (y[5] = M(" результатів ", -1))
233
205
  ])
234
206
  ], 2)
235
207
  ]),
236
- v("div", Ue, [
237
- v("button", {
208
+ d("div", He, [
209
+ d("button", {
238
210
  onClick: y[0] || (y[0] = (k) => D(p.page - 1)),
239
211
  disabled: p.page <= 1,
240
- class: m([
212
+ class: f([
241
213
  "relative font-medium rounded-md",
242
- c.value.button,
243
- p.page <= 1 ? l.value.buttonDisabled : l.value.button
214
+ v.value.button,
215
+ p.page <= 1 ? s.value.buttonDisabled : s.value.button
244
216
  ])
245
217
  }, [
246
- (o(), u("svg", {
247
- class: m(c.value.icon),
218
+ (o(), i("svg", {
219
+ class: f(v.value.icon),
248
220
  fill: "none",
249
221
  stroke: "currentColor",
250
222
  viewBox: "0 0 24 24"
251
223
  }, y[6] || (y[6] = [
252
- v("path", {
224
+ d("path", {
253
225
  "stroke-linecap": "round",
254
226
  "stroke-linejoin": "round",
255
227
  "stroke-width": "2",
256
228
  d: "M15 19l-7-7 7-7"
257
229
  }, null, -1)
258
230
  ]), 2))
259
- ], 10, Oe),
260
- v("div", Je, [
261
- (o(!0), u(B, null, z(T.value, (k) => (o(), u(B, { key: k }, [
262
- k === "..." ? (o(), u("span", {
231
+ ], 10, We),
232
+ d("div", Ue, [
233
+ (o(!0), i(R, null, z($.value, (k) => (o(), i(R, { key: k }, [
234
+ k === "..." ? (o(), i("span", {
263
235
  key: 0,
264
- class: m(["font-medium", c.value.button, l.value.ellipsis])
265
- }, " ... ", 2)) : (o(), u("button", {
236
+ class: f(["font-medium", v.value.button, s.value.ellipsis])
237
+ }, " ... ", 2)) : (o(), i("button", {
266
238
  key: 1,
267
- onClick: (F) => D(k),
268
- class: m([
239
+ onClick: (T) => D(k),
240
+ class: f([
269
241
  "relative font-medium rounded-md",
270
- c.value.button,
271
- k === p.page ? l.value.buttonActive : l.value.button
242
+ v.value.button,
243
+ k === p.page ? s.value.buttonActive : s.value.button
272
244
  ])
273
- }, h(k), 11, qe))
245
+ }, x(k), 11, Oe))
274
246
  ], 64))), 128))
275
247
  ]),
276
- v("button", {
248
+ d("button", {
277
249
  onClick: y[1] || (y[1] = (k) => D(p.page + 1)),
278
- disabled: p.page >= i.value,
279
- class: m([
250
+ disabled: p.page >= u.value,
251
+ class: f([
280
252
  "relative font-medium rounded-md",
281
- c.value.button,
282
- p.page >= i.value ? l.value.buttonDisabled : l.value.button
253
+ v.value.button,
254
+ p.page >= u.value ? s.value.buttonDisabled : s.value.button
283
255
  ])
284
256
  }, [
285
- (o(), u("svg", {
286
- class: m(c.value.icon),
257
+ (o(), i("svg", {
258
+ class: f(v.value.icon),
287
259
  fill: "none",
288
260
  stroke: "currentColor",
289
261
  viewBox: "0 0 24 24"
290
262
  }, y[7] || (y[7] = [
291
- v("path", {
263
+ d("path", {
292
264
  "stroke-linecap": "round",
293
265
  "stroke-linejoin": "round",
294
266
  "stroke-width": "2",
295
267
  d: "M9 5l7 7-7 7"
296
268
  }, null, -1)
297
269
  ]), 2))
298
- ], 10, Ge)
270
+ ], 10, Je)
299
271
  ])
300
272
  ], 2));
301
273
  }
302
- }), Ke = {
274
+ }), qe = {
303
275
  key: 0,
304
276
  class: "text-center py-8"
305
- }, Qe = { class: "inline-flex items-center space-x-2" }, Xe = {
277
+ }, Ge = { class: "inline-flex items-center space-x-2" }, Ke = {
306
278
  key: 2,
307
279
  class: "overflow-x-auto"
308
- }, Ye = ["checked", "indeterminate"], Ze = ["onClick"], et = { class: "flex items-center justify-between" }, tt = {
280
+ }, Qe = ["checked", "indeterminate"], Xe = ["onClick"], Ye = { class: "flex items-center justify-between" }, Ze = {
309
281
  key: 0,
310
282
  class: "ml-1 text-xs"
311
- }, at = {
312
- key: 1,
313
- class: "w-[100px]"
314
- }, rt = ["onClick"], lt = ["checked", "onChange"], st = ["onClick"], nt = {
283
+ }, et = ["onClick"], tt = ["checked", "onChange"], at = ["onClick"], rt = {
315
284
  key: 1,
316
285
  class: "text-center"
317
- }, ve = /* @__PURE__ */ S({
286
+ }, ge = /* @__PURE__ */ F({
318
287
  name: "DataTable",
319
288
  __name: "DataTable",
320
289
  props: {
@@ -345,8 +314,8 @@ const De = /* @__PURE__ */ S({
345
314
  getCellData: { type: Function, default: void 0 }
346
315
  },
347
316
  emits: ["update:page", "update:selectedRows", "row-click", "sort"],
348
- setup(b, { emit: a }) {
349
- const e = b, c = a, l = w(e.selectedRows || []), n = w([]), i = w([]), _ = w([]), $ = w(!1), T = w(null), D = w(e.router), p = pe(), y = f(() => p.action);
317
+ setup(b, { emit: n }) {
318
+ const e = b, v = n, s = _(e.selectedRows || []), l = _([]), u = _([]), C = _([]), S = _(!1), $ = _(null), D = _(e.router), p = pe(), y = m(() => p.action);
350
319
  function k(t) {
351
320
  if (D.value) {
352
321
  D.value.push(t);
@@ -354,20 +323,20 @@ const De = /* @__PURE__ */ S({
354
323
  }
355
324
  location.href = t;
356
325
  }
357
- const F = f(() => {
326
+ const T = m(() => {
358
327
  if (e.api)
359
- return i.value;
360
- if (e.sortable && n.value.length > 0) {
328
+ return u.value;
329
+ if (e.sortable && l.value.length > 0) {
361
330
  const t = [...e.rows];
362
- return t.sort((d, r) => {
363
- for (const g of n.value) {
331
+ return t.sort((c, a) => {
332
+ for (const g of l.value) {
364
333
  if (!g.direction)
365
334
  return 0;
366
- const s = d[g.field], x = r[g.field];
367
- if (s == null) return 1;
368
- if (x == null) return -1;
335
+ const r = c[g.field], h = a[g.field];
336
+ if (r == null) return 1;
337
+ if (h == null) return -1;
369
338
  let I = 0;
370
- typeof s == "string" && typeof x == "string" ? I = s.localeCompare(x) : s < x ? I = -1 : s > x ? I = 1 : I = 0;
339
+ typeof r == "string" && typeof h == "string" ? I = r.localeCompare(h) : r < h ? I = -1 : r > h ? I = 1 : I = 0;
371
340
  const O = g.direction === "desc" ? -I : I;
372
341
  if (O !== 0) return O;
373
342
  }
@@ -377,34 +346,34 @@ const De = /* @__PURE__ */ S({
377
346
  return e.rows;
378
347
  });
379
348
  L(() => e.selectedRows, (t) => {
380
- l.value = t || [];
349
+ s.value = t || [];
381
350
  });
382
- const A = (t) => l.value.some((d) => d === t), re = (t) => {
383
- const d = l.value.findIndex((r) => r === t);
384
- d > -1 ? l.value.splice(d, 1) : l.value.push(t), c("update:selectedRows", [...l.value]);
385
- }, q = f(() => F.value.length > 0 && l.value.length === F.value.length), V = f(() => l.value.length > 0 && l.value.length < F.value.length), G = () => {
386
- q.value ? l.value = [] : l.value = [...F.value], c("update:selectedRows", [...l.value]);
351
+ const A = (t) => s.value.some((c) => c === t), ae = (t) => {
352
+ const c = s.value.findIndex((a) => a === t);
353
+ c > -1 ? s.value.splice(c, 1) : s.value.push(t), v("update:selectedRows", [...s.value]);
354
+ }, J = m(() => T.value.length > 0 && s.value.length === T.value.length), V = m(() => s.value.length > 0 && s.value.length < T.value.length), q = () => {
355
+ J.value ? s.value = [] : s.value = [...T.value], v("update:selectedRows", [...s.value]);
387
356
  }, be = (t) => {
388
357
  if (!e.sortable) return;
389
- const d = n.value.findIndex((g) => g.field === t);
390
- if (d >= 0) {
391
- const g = n.value[d];
392
- g.direction === "asc" ? g.direction = "desc" : g.direction === "desc" && n.value.splice(d, 1);
358
+ const c = l.value.findIndex((g) => g.field === t);
359
+ if (c >= 0) {
360
+ const g = l.value[c];
361
+ g.direction === "asc" ? g.direction = "desc" : g.direction === "desc" && l.value.splice(c, 1);
393
362
  } else
394
- n.value.unshift({
363
+ l.value.unshift({
395
364
  field: t,
396
365
  direction: "asc"
397
366
  });
398
- const r = n.value.filter((g) => g.direction).map((g) => ({
367
+ const a = l.value.filter((g) => g.direction).map((g) => ({
399
368
  name: g.field,
400
369
  asc: g.direction === "asc"
401
370
  }));
402
- c("sort", r), e.api && H();
403
- }, ye = (t) => n.value.find((r) => r.field === t)?.direction === "asc", he = (t) => {
404
- const d = n.value.find((r) => r.field === t);
405
- if (!d)
371
+ v("sort", a), e.api && W();
372
+ }, ye = (t) => l.value.find((a) => a.field === t)?.direction === "asc", he = (t) => {
373
+ const c = l.value.find((a) => a.field === t);
374
+ if (!c)
406
375
  return "↑↓";
407
- switch (d.direction) {
376
+ switch (c.direction) {
408
377
  case "asc":
409
378
  return "↑";
410
379
  // Up arrow for ascending
@@ -414,26 +383,26 @@ const De = /* @__PURE__ */ S({
414
383
  default:
415
384
  return "↕️";
416
385
  }
417
- }, K = (t) => e.sortable && t.sortable !== !1, xe = (t) => {
418
- e.clickable && c("row-click", t);
419
- }, R = (t, d) => {
420
- const r = d[t.name];
386
+ }, G = (t) => e.sortable && t.sortable !== !1, xe = (t) => {
387
+ e.clickable && v("row-click", t);
388
+ }, P = (t, c) => {
389
+ const a = c[t.name];
421
390
  if (e.getCellData || t.getCellData) {
422
391
  const g = t.getCellData || e.getCellData;
423
392
  if (g) {
424
- const s = {
393
+ const r = {
425
394
  name: t.name,
426
- row: d,
427
- value: r
395
+ row: c,
396
+ value: a
428
397
  };
429
- return g(s);
398
+ return g(r);
430
399
  }
431
400
  }
432
401
  return ["_data", "_text"].map((g) => {
433
- const s = `${t.name}${g}`;
434
- return d[s] ? d[s] : null;
435
- }).find((g) => g) || r;
436
- }, le = (t) => t.width ? t.width === "w-full" ? "w-full" : typeof t.width == "string" ? `w-[${t.width}px]` : typeof t.width == "number" ? `w-[${t.width}px]` : "" : "", Q = w(e.page), se = w(e.limit), X = w(e.total), M = w(1), Y = w(10), E = w(0), ne = f(() => e.api ? M.value : Q.value), oe = f(() => e.api ? Y.value : se.value), ie = f(() => e.api ? E.value : X.value), C = f(() => {
402
+ const r = `${t.name}${g}`;
403
+ return c[r] ? c[r] : null;
404
+ }).find((g) => g) || a;
405
+ }, re = (t) => t.width ? t.width === "w-full" ? "w-full" : typeof t.width == "string" ? `w-[${t.width}px]` : typeof t.width == "number" ? `w-[${t.width}px]` : "" : "", K = _(e.page), se = _(e.limit), Q = _(e.total), E = _(1), X = _(10), H = _(0), le = m(() => e.api ? E.value : K.value), ne = m(() => e.api ? X.value : se.value), oe = m(() => e.api ? H.value : Q.value), w = m(() => {
437
406
  const { theme: t } = e;
438
407
  return t === "dark" ? {
439
408
  container: "dark",
@@ -474,36 +443,36 @@ const De = /* @__PURE__ */ S({
474
443
  };
475
444
  });
476
445
  L(() => e.page, (t) => {
477
- Q.value = t;
446
+ K.value = t;
478
447
  }), L(() => e.limit, (t) => {
479
448
  se.value = t;
480
449
  }), L(() => e.total, (t) => {
481
- X.value = t;
450
+ Q.value = t;
482
451
  });
483
- async function H() {
452
+ async function W() {
484
453
  if (e.api) {
485
- $.value = !0, T.value = null;
454
+ S.value = !0, $.value = null;
486
455
  try {
487
456
  const t = new URL(e.api, window.location.origin);
488
- if (t.searchParams.set("page", ne.value.toString()), t.searchParams.set("limit", oe.value.toString()), n.value.length > 0) {
489
- const g = n.value.filter((s) => s.direction).map((s) => `${s.field}:${s.direction}`).join(",");
457
+ if (t.searchParams.set("page", le.value.toString()), t.searchParams.set("limit", ne.value.toString()), l.value.length > 0) {
458
+ const g = l.value.filter((r) => r.direction).map((r) => `${r.field}:${r.direction}`).join(",");
490
459
  g && t.searchParams.set("sort", g);
491
460
  }
492
- const d = await fetch(t.toString());
493
- if (!d.ok)
494
- throw new Error(`HTTP error! status: ${d.status}`);
495
- const r = await d.json();
496
- r.rows && Array.isArray(r.rows) && (i.value = r.rows), r.columns && Array.isArray(r.columns) && (_.value = r.columns), r.total !== void 0 && (e.api ? E.value = r.total : X.value = r.total);
461
+ const c = await fetch(t.toString());
462
+ if (!c.ok)
463
+ throw new Error(`HTTP error! status: ${c.status}`);
464
+ const a = await c.json();
465
+ a.rows && Array.isArray(a.rows) && (u.value = a.rows), a.columns && Array.isArray(a.columns) && (C.value = a.columns), a.total !== void 0 && (e.api ? H.value = a.total : Q.value = a.total);
497
466
  } catch (t) {
498
- T.value = t instanceof Error ? t.message : "Failed to fetch data", console.error("Error fetching data:", t);
467
+ $.value = t instanceof Error ? t.message : "Failed to fetch data", console.error("Error fetching data:", t);
499
468
  } finally {
500
- $.value = !1;
469
+ S.value = !1;
501
470
  }
502
471
  }
503
472
  }
504
473
  const ke = (t) => {
505
- e.api ? M.value = t : (Q.value = t, c("update:page", t)), e.api && H();
506
- }, _e = f(() => e.showPagination && ie.value > 0), W = f(() => ({
474
+ e.api ? E.value = t : (K.value = t, v("update:page", t)), e.api && W();
475
+ }, _e = m(() => e.showPagination && oe.value > 0), N = m(() => ({
507
476
  small: {
508
477
  header: "px-3 py-2 text-xs",
509
478
  cell: "px-3 py-2 text-xs"
@@ -518,199 +487,205 @@ const De = /* @__PURE__ */ S({
518
487
  }
519
488
  })[e.size]);
520
489
  fe(() => {
521
- e.api && (e.page && (M.value = e.page), e.limit && (Y.value = e.limit), e.total && (E.value = e.total), H());
490
+ e.api && (e.page && (E.value = e.page), e.limit && (X.value = e.limit), e.total && (H.value = e.total), W());
522
491
  }), L(() => e.api, (t) => {
523
- t && (M.value = e.page || 1, Y.value = e.limit || 10, E.value = e.total || 0, H());
492
+ t && (E.value = e.page || 1, X.value = e.limit || 10, H.value = e.total || 0, W());
524
493
  });
525
- const we = f(() => e.api ? _.value : e.columns), Z = w([]), U = w({});
526
- $e("registerColumn", (t, d) => {
527
- Z.value.push(t), d && t.slotName && (U.value[t.name] = d);
494
+ const we = m(() => e.api ? C.value : e.columns), Y = _([]), U = _({});
495
+ $e("registerColumn", (t, c) => {
496
+ Y.value.push(t), c && t.slotName && (U.value[t.name] = c);
528
497
  });
529
- const ue = f(() => {
530
- const t = we.value || [], d = [], r = p.default?.();
531
- if (r) {
532
- const g = r.filter((s) => s.type?.name === "Column" || s.type === "Column" || s.type && typeof s.type == "object" && s.type.name === "Column").map((s) => {
533
- const x = s.props || s.componentProps || {}, I = x.field || x.name || "", O = x.header || x.label || "", ce = s.children && s.children.body, ee = {
498
+ const ie = m(() => {
499
+ const t = we.value || [], c = [], a = p.default?.();
500
+ if (a) {
501
+ const g = a.filter((r) => r.type?.name === "Column" || r.type === "Column" || r.type && typeof r.type == "object" && r.type.name === "Column").map((r) => {
502
+ const h = r.props || r.componentProps || {}, I = h.field || h.name || "", O = h.header || h.label || "", ue = r.children && r.children.body, Z = {
534
503
  name: I,
535
504
  // Use field as the name for data access
536
505
  ua: O,
537
506
  // Use header as the display name
538
- format: x.format || "text",
539
- slotName: ce ? "body" : void 0,
540
- ...x
507
+ format: h.format || "text",
508
+ slotName: ue ? "body" : void 0,
509
+ ...h
541
510
  };
542
- return ce && ee.name && (U.value[ee.name] = s.children.body), ee;
511
+ return ue && Z.name && (U.value[Z.name] = r.children.body), Z;
543
512
  });
544
- d.push(...g);
513
+ c.push(...g);
545
514
  }
546
- if (Z.value.length > 0 && d.push(...Z.value), d.length > 0) {
547
- const g = [], s = new Set(d.map((x) => x.name));
548
- return t.forEach((x) => {
549
- s.has(x.name) || g.push(x);
550
- }), g.push(...d), console.log("Combined columns:", {
515
+ if (Y.value.length > 0 && c.push(...Y.value), c.length > 0) {
516
+ const g = [], r = new Set(c.map((h) => h.name));
517
+ return t.forEach((h) => {
518
+ r.has(h.name) || g.push(h);
519
+ }), g.push(...c), console.log("Combined columns:", {
551
520
  default: t.length,
552
- custom: d.length,
521
+ custom: c.length,
553
522
  combined: g.length
554
523
  }), g;
555
524
  }
556
525
  return t.length > 0 ? (console.log("Using default columns:", t.length), t) : [];
557
526
  }), Ce = (t = "text") => de[t.toLowerCase()] || de.text;
558
- return (t, d) => (o(), u("div", {
559
- class: m(["w-full", C.value.container])
527
+ return (t, c) => (o(), i("div", {
528
+ class: f(["w-full", w.value.container])
560
529
  }, [
561
- $.value || e.loading ? (o(), u("div", Ke, [
562
- v("div", Qe, [
563
- d[0] || (d[0] = v("div", { class: "animate-spin rounded-full h-6 w-6 border-b-2 border-blue-600" }, null, -1)),
564
- v("span", {
565
- class: m(C.value.loading)
530
+ S.value || e.loading ? (o(), i("div", qe, [
531
+ d("div", Ge, [
532
+ c[0] || (c[0] = d("div", { class: "animate-spin rounded-full h-6 w-6 border-b-2 border-blue-600" }, null, -1)),
533
+ d("span", {
534
+ class: f(w.value.loading)
566
535
  }, "Loading...", 2)
567
536
  ])
568
- ])) : T.value ? (o(), u("div", {
537
+ ])) : $.value ? (o(), i("div", {
569
538
  key: 1,
570
- class: m(["text-center py-8", C.value.error])
571
- }, h(T.value), 3)) : !e.loading && F.value.length > 0 ? (o(), u("div", Xe, [
572
- v("div", {
573
- class: m(t.classWrapper ? t.classWrapper : "relative w-full overflow-auto")
539
+ class: f(["text-center py-8", w.value.error])
540
+ }, x($.value), 3)) : !e.loading && T.value.length > 0 ? (o(), i("div", Ke, [
541
+ d("div", {
542
+ class: f(t.classWrapper ? t.classWrapper : "relative w-full overflow-auto")
574
543
  }, [
575
- v("table", {
576
- class: m(t.classTable),
577
- style: ge(t.tableStyle)
544
+ d("table", {
545
+ class: f(t.classTable),
546
+ style: ve(t.tableStyle)
578
547
  }, [
579
- v("thead", {
580
- class: m(t.classThead || C.value.thead)
548
+ d("thead", {
549
+ class: f(t.classThead || w.value.thead)
581
550
  }, [
582
- v("tr", null, [
583
- t.selectable ? (o(), u("th", {
551
+ d("tr", null, [
552
+ t.selectable ? (o(), i("th", {
584
553
  key: 0,
585
- class: m(["text-left font-medium uppercase tracking-wider", C.value.th, W.value.header, e.classTh, "w-12"])
554
+ class: f(["text-left font-medium uppercase tracking-wider", w.value.th, N.value.header, e.classTh, "w-12"])
586
555
  }, [
587
- v("input", {
556
+ d("input", {
588
557
  type: "checkbox",
589
- checked: q.value,
558
+ checked: J.value,
590
559
  indeterminate: V.value,
591
- onChange: G,
592
- class: m(["h-4 w-4 focus:ring-blue-500 rounded", C.value.checkbox])
593
- }, null, 42, Ye)
594
- ], 2)) : j("", !0),
595
- (o(!0), u(B, null, z(ue.value.filter((r) => !r.hidden), (r) => (o(), u("th", {
596
- key: r.name,
597
- class: m([
598
- r.align ? `text-${r.align}` : "",
599
- K(r) ? ["cursor-pointer", C.value.thHover] : "",
600
- le(r)
560
+ onChange: q,
561
+ class: f(["h-4 w-4 focus:ring-blue-500 rounded", w.value.checkbox])
562
+ }, null, 42, Qe)
563
+ ], 2)) : B("", !0),
564
+ (o(!0), i(R, null, z(ie.value.filter((a) => !a.hidden), (a) => (o(), i("th", {
565
+ key: a.name,
566
+ class: f([
567
+ a.align ? `text-${a.align}` : "",
568
+ G(a) ? ["cursor-pointer", w.value.thHover] : "",
569
+ re(a)
601
570
  ].concat(
602
571
  e.classTh || [
603
572
  "text-left font-medium uppercase tracking-wider",
604
- C.value.th,
605
- W.value.header
573
+ w.value.th,
574
+ N.value.header
606
575
  ]
607
576
  )),
608
- onClick: (g) => K(r) ? be(r.name) : void 0
577
+ onClick: (g) => G(a) ? be(a.name) : void 0
609
578
  }, [
610
- v("div", et, [
611
- v("span", null, h(r.ua || r.header || r.name), 1),
612
- K(r) ? (o(), u("span", tt, [
613
- P(t.$slots, "sort", {
614
- asc: ye(r.name)
579
+ d("div", Ye, [
580
+ d("span", null, x(a.ua || a.header || a.name), 1),
581
+ G(a) ? (o(), i("span", Ze, [
582
+ j(t.$slots, "sort", {
583
+ asc: ye(a.name)
615
584
  }, () => [
616
- N(h(he(r.name)), 1)
585
+ M(x(he(a.name)), 1)
617
586
  ])
618
- ])) : j("", !0)
587
+ ])) : B("", !0)
619
588
  ])
620
- ], 10, Ze))), 128)),
621
- y.value ? (o(), u("th", at, "Дії")) : j("", !0)
589
+ ], 10, Xe))), 128)),
590
+ y.value ? (o(), i("th", {
591
+ key: 1,
592
+ class: f(["w-[100px]", e.classTh || [
593
+ "text-left font-medium uppercase tracking-wider",
594
+ w.value.th,
595
+ N.value.header
596
+ ]])
597
+ }, "Дії", 2)) : B("", !0)
622
598
  ])
623
599
  ], 2),
624
- v("tbody", {
625
- class: m(t.classTbody || C.value.tbody)
600
+ d("tbody", {
601
+ class: f(t.classTbody || w.value.tbody)
626
602
  }, [
627
- (o(!0), u(B, null, z(F.value, (r, g) => (o(), u("tr", {
603
+ (o(!0), i(R, null, z(T.value, (a, g) => (o(), i("tr", {
628
604
  key: g,
629
- class: m(e.classTr || [
630
- C.value.tr,
605
+ class: f(e.classTr || [
606
+ w.value.tr,
631
607
  e.clickable ? "cursor-pointer" : ""
632
608
  ]),
633
- onClick: (s) => e.clickable ? xe(r) : void 0
609
+ onClick: (r) => e.clickable ? xe(a) : void 0
634
610
  }, [
635
- t.selectable ? (o(), u("td", {
611
+ t.selectable ? (o(), i("td", {
636
612
  key: 0,
637
- class: m(["whitespace-nowrap", C.value.td, W.value.cell, e.classTd, "w-12"])
613
+ class: f(["whitespace-nowrap", w.value.td, N.value.cell, e.classTd, "w-12"])
638
614
  }, [
639
- v("input", {
615
+ d("input", {
640
616
  type: "checkbox",
641
- checked: A(r),
642
- onChange: (s) => re(r),
643
- class: m(["h-4 w-4 focus:ring-blue-500 rounded", C.value.checkbox])
644
- }, null, 42, lt)
645
- ], 2)) : j("", !0),
646
- (o(!0), u(B, null, z(ue.value.filter((s) => !s.hidden), (s) => (o(), u("td", {
647
- key: s.name,
648
- class: m(e.classTd || [
617
+ checked: A(a),
618
+ onChange: (r) => ae(a),
619
+ class: f(["h-4 w-4 focus:ring-blue-500 rounded", w.value.checkbox])
620
+ }, null, 42, tt)
621
+ ], 2)) : B("", !0),
622
+ (o(!0), i(R, null, z(ie.value.filter((r) => !r.hidden), (r) => (o(), i("td", {
623
+ key: r.name,
624
+ class: f(e.classTd || [
649
625
  "whitespace-nowrap",
650
- C.value.td,
651
- W.value.cell,
652
- s.align ? `text-${s.align}` : "",
653
- le(s)
626
+ w.value.td,
627
+ N.value.cell,
628
+ r.align ? `text-${r.align}` : "",
629
+ re(r)
654
630
  ])
655
631
  }, [
656
- s.action && y.value ? (o(), J(te(y.value), {
632
+ r.action && y.value ? j(t.$slots, "action", {
657
633
  key: 0,
658
- row: r,
659
- value: R(s, r)
660
- }, null, 8, ["row", "value"])) : ae(p).number && s.format === "number" ? P(t.$slots, "number", {
634
+ row: a
635
+ }) : te(p).number && r.format === "number" ? j(t.$slots, "number", {
661
636
  key: 1,
662
- row: r,
663
- value: R(s, r)
664
- }) : ae(p).badge && s.format === "badge" ? P(t.$slots, "badge", {
637
+ row: a,
638
+ value: P(r, a)
639
+ }) : te(p).badge && r.format === "badge" ? j(t.$slots, "badge", {
665
640
  key: 2,
666
- row: r,
667
- value: R(s, r)
668
- }) : ae(p).array && s.format === "array" ? P(t.$slots, "array", {
641
+ row: a,
642
+ value: P(r, a)
643
+ }) : te(p).array && r.format === "array" ? j(t.$slots, "array", {
669
644
  key: 3,
670
- row: r,
671
- value: R(s, r)
672
- }) : s.slotName && U.value[s.name] ? (o(), J(te(U.value[s.name]), {
645
+ row: a,
646
+ value: P(r, a)
647
+ }) : r.slotName && U.value[r.name] ? (o(), ee(ce(U.value[r.name]), {
673
648
  key: 4,
674
- data: r,
675
- value: R(s, r),
676
- row: r,
677
- column: s
678
- }, null, 8, ["data", "value", "row", "column"])) : s.link ? (o(), u("a", {
649
+ data: a,
650
+ value: P(r, a),
651
+ row: a,
652
+ column: r
653
+ }, null, 8, ["data", "value", "row", "column"])) : r.link ? (o(), i("a", {
679
654
  key: 5,
680
- class: m(t.classLink || "hover:text-blue-900 cursor-pointer text-blue-700 hover:underline"),
681
- onClick: (x) => k(s.link.replace("{id}", r.id))
682
- }, h(R(s, r)), 11, st)) : (o(), J(te(Ce(s.format)), {
655
+ class: f(t.classLink || "hover:text-blue-900 cursor-pointer text-blue-700 hover:underline"),
656
+ onClick: (h) => k(r.link.replace("{id}", a.id))
657
+ }, x(P(r, a)), 11, at)) : (o(), ee(ce(Ce(r.format)), {
683
658
  key: 6,
684
- value: R(s, r),
685
- row: r,
686
- column: s,
687
- href: s.link
659
+ value: P(r, a),
660
+ row: a,
661
+ column: r,
662
+ href: r.link
688
663
  }, null, 8, ["value", "row", "column", "href"]))
689
664
  ], 2))), 128)),
690
- y.value ? (o(), u("td", nt, [
691
- P(t.$slots, "action", { row: r })
692
- ])) : j("", !0)
693
- ], 10, rt))), 128))
665
+ y.value ? (o(), i("td", rt, [
666
+ j(t.$slots, "action", { row: a })
667
+ ])) : B("", !0)
668
+ ], 10, et))), 128))
694
669
  ], 2)
695
670
  ], 6)
696
671
  ], 2)
697
- ])) : j("", !0),
698
- _e.value && !$.value && !e.loading && !T.value ? (o(), J(me, {
672
+ ])) : B("", !0),
673
+ _e.value && !S.value && !e.loading && !$.value ? (o(), ee(me, {
699
674
  key: 3,
700
- page: ne.value,
701
- limit: oe.value,
702
- total: ie.value,
675
+ page: le.value,
676
+ limit: ne.value,
677
+ total: oe.value,
703
678
  theme: e.theme,
704
679
  size: e.size,
705
680
  "onUpdate:page": ke
706
- }, null, 8, ["page", "limit", "total", "theme", "size"])) : j("", !0),
707
- !$.value && !e.loading && !T.value && F.value.length === 0 ? (o(), u("div", {
681
+ }, null, 8, ["page", "limit", "total", "theme", "size"])) : B("", !0),
682
+ !S.value && !e.loading && !$.value && T.value.length === 0 ? (o(), i("div", {
708
683
  key: 4,
709
- class: m(["text-center py-8", C.value.empty])
710
- }, " Дані відсутні ", 2)) : j("", !0)
684
+ class: f(["text-center py-8", w.value.empty])
685
+ }, " Дані відсутні ", 2)) : B("", !0)
711
686
  ], 2));
712
687
  }
713
- }), ot = { style: { display: "none" } }, it = /* @__PURE__ */ S({
688
+ }), st = { style: { display: "none" } }, lt = /* @__PURE__ */ F({
714
689
  name: "Column",
715
690
  __name: "Column",
716
691
  props: {
@@ -731,134 +706,133 @@ const De = /* @__PURE__ */ S({
731
706
  suffix: {}
732
707
  },
733
708
  setup(b) {
734
- const a = b, e = pe(), c = Te("registerColumn");
709
+ const n = b, e = pe(), v = Te("registerColumn");
735
710
  return fe(() => {
736
- if (c) {
711
+ if (v) {
737
712
  const {
738
- field: l,
739
- name: n,
740
- header: i,
741
- label: _,
742
- format: $,
743
- slotName: T,
713
+ field: s,
714
+ name: l,
715
+ header: u,
716
+ label: C,
717
+ format: S,
718
+ slotName: $,
744
719
  link: D,
745
720
  action: p,
746
721
  getCellData: y,
747
722
  suffix: k,
748
- ...F
749
- } = a, V = {
750
- name: l || n || "",
751
- ua: i || _ || "",
752
- format: $ || "text",
753
- slotName: T || (e.body ? "body" : void 0),
723
+ ...T
724
+ } = n, V = {
725
+ name: s || l || "",
726
+ ua: u || C || "",
727
+ format: S || "text",
728
+ slotName: $ || (e.body ? "body" : void 0),
754
729
  // Use 'body' slot if it exists
755
730
  link: D,
756
731
  action: p,
757
732
  getCellData: y,
758
733
  suffix: k,
759
- ...F
734
+ ...T
760
735
  };
761
736
  console.log("Registering column:", V);
762
- const G = e.body;
763
- c(V, G);
737
+ const q = e.body;
738
+ v(V, q);
764
739
  }
765
- }), (l, n) => (o(), u("div", ot, [
766
- P(l.$slots, "body", { data: {} })
740
+ }), (s, l) => (o(), i("div", st, [
741
+ j(s.$slots, "body", { data: {} })
767
742
  ]));
768
743
  }
769
- }), ut = { class: "mt-4" }, ct = { class: "text-sm text-gray-600 dark:text-gray-300" }, dt = /* @__PURE__ */ S({
744
+ }), nt = { class: "mt-4" }, ot = { class: "text-sm text-gray-600 dark:text-gray-300" }, it = /* @__PURE__ */ F({
770
745
  __name: "SelectionInfo",
771
746
  props: {
772
747
  selectedRows: {},
773
748
  totalCount: {}
774
749
  },
775
750
  setup(b) {
776
- const a = b, e = f(() => a.selectedRows.length);
777
- return (c, l) => (o(), u("div", ut, [
778
- v("div", ct, " Обрано: " + h(e.value) + " з " + h(c.totalCount) + " записів ", 1)
751
+ const n = b, e = m(() => n.selectedRows.length);
752
+ return (v, s) => (o(), i("div", nt, [
753
+ d("div", ot, " Обрано: " + x(e.value) + " з " + x(v.totalCount) + " записів ", 1)
779
754
  ]));
780
755
  }
781
- }), vt = { class: "mt-4" }, gt = { class: "border-b border-gray-200 dark:border-gray-700" }, pt = { class: "-mb-px flex space-x-8" }, ft = ["onClick"], mt = { class: "mt-4" }, bt = { class: "bg-gray-900 rounded-lg overflow-hidden" }, yt = { class: "flex items-center justify-between px-4 py-2 bg-gray-800 border-b border-gray-700" }, ht = { class: "text-sm text-gray-300" }, xt = ["onClick"], kt = { class: "p-4 text-sm text-gray-100 overflow-x-auto" }, _t = /* @__PURE__ */ S({
756
+ }), ut = { class: "mt-4" }, ct = { class: "border-b border-gray-200 dark:border-gray-700" }, dt = { class: "-mb-px flex space-x-8" }, gt = ["onClick"], vt = { class: "mt-4" }, pt = { class: "bg-gray-900 rounded-lg overflow-hidden" }, ft = { class: "flex items-center justify-between px-4 py-2 bg-gray-800 border-b border-gray-700" }, mt = { class: "text-sm text-gray-300" }, bt = ["onClick"], yt = { class: "p-4 text-sm text-gray-100 overflow-x-auto" }, ht = /* @__PURE__ */ F({
782
757
  __name: "CodeTabs",
783
758
  props: {
784
759
  tabs: {},
785
760
  defaultTab: { default: void 0 }
786
761
  },
787
762
  setup(b) {
788
- const a = b, e = w(a.defaultTab || a.tabs[0]?.id || ""), c = async (l) => {
763
+ const n = b, e = _(n.defaultTab || n.tabs[0]?.id || ""), v = async (s) => {
789
764
  try {
790
- await navigator.clipboard.writeText(l), console.log("Код скопійовано!");
791
- } catch (n) {
792
- console.error("Помилка копіювання:", n);
765
+ await navigator.clipboard.writeText(s), console.log("Код скопійовано!");
766
+ } catch (l) {
767
+ console.error("Помилка копіювання:", l);
793
768
  }
794
769
  };
795
- return (l, n) => (o(), u("div", vt, [
796
- v("div", gt, [
797
- v("nav", pt, [
798
- (o(!0), u(B, null, z(l.tabs, (i) => (o(), u("button", {
799
- key: i.id,
800
- onClick: (_) => e.value = i.id,
801
- class: m([
770
+ return (s, l) => (o(), i("div", ut, [
771
+ d("div", ct, [
772
+ d("nav", dt, [
773
+ (o(!0), i(R, null, z(s.tabs, (u) => (o(), i("button", {
774
+ key: u.id,
775
+ onClick: (C) => e.value = u.id,
776
+ class: f([
802
777
  "py-2 px-1 border-b-2 font-medium text-sm transition-colors",
803
- e.value === i.id ? "border-blue-500 text-blue-600 dark:text-blue-400" : "border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300"
778
+ e.value === u.id ? "border-blue-500 text-blue-600 dark:text-blue-400" : "border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300"
804
779
  ])
805
- }, h(i.label), 11, ft))), 128))
780
+ }, x(u.label), 11, gt))), 128))
806
781
  ])
807
782
  ]),
808
- v("div", mt, [
809
- (o(!0), u(B, null, z(l.tabs, (i) => Fe((o(), u("div", {
810
- key: i.id
783
+ d("div", vt, [
784
+ (o(!0), i(R, null, z(s.tabs, (u) => Se((o(), i("div", {
785
+ key: u.id
811
786
  }, [
812
- v("div", bt, [
813
- v("div", yt, [
814
- v("span", ht, h(i.label), 1),
815
- v("button", {
816
- onClick: (_) => c(i.content),
787
+ d("div", pt, [
788
+ d("div", ft, [
789
+ d("span", mt, x(u.label), 1),
790
+ d("button", {
791
+ onClick: (C) => v(u.content),
817
792
  class: "text-gray-400 hover:text-white transition-colors",
818
793
  title: "Копіювати код"
819
- }, n[0] || (n[0] = [
820
- v("svg", {
794
+ }, l[0] || (l[0] = [
795
+ d("svg", {
821
796
  class: "w-4 h-4",
822
797
  fill: "none",
823
798
  stroke: "currentColor",
824
799
  viewBox: "0 0 24 24"
825
800
  }, [
826
- v("path", {
801
+ d("path", {
827
802
  "stroke-linecap": "round",
828
803
  "stroke-linejoin": "round",
829
804
  "stroke-width": "2",
830
805
  d: "M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"
831
806
  })
832
807
  ], -1)
833
- ]), 8, xt)
808
+ ]), 8, bt)
834
809
  ]),
835
- v("pre", kt, [
836
- v("code", null, h(i.content), 1)
810
+ d("pre", yt, [
811
+ d("code", null, x(u.content), 1)
837
812
  ])
838
813
  ])
839
814
  ])), [
840
- [Se, e.value === i.id]
815
+ [Fe, e.value === u.id]
841
816
  ])), 128))
842
817
  ])
843
818
  ]));
844
819
  }
845
820
  });
846
- ve.install = function(a) {
847
- a.component("DataTable", ve), a.component("Column", it), a.component("Pagination", me), a.component("SelectionInfo", dt), a.component("CodeTabs", _t);
821
+ ge.install = function(n) {
822
+ n.component("DataTable", ge), n.component("Column", lt), n.component("Pagination", me), n.component("SelectionInfo", it), n.component("CodeTabs", ht);
848
823
  };
849
824
  export {
850
825
  Pe as ArrayFormat,
851
- Re as BadgeFormat,
852
- _t as CodeTabs,
853
- it as Column,
854
- ve as DataTable,
826
+ je as BadgeFormat,
827
+ ht as CodeTabs,
828
+ lt as Column,
829
+ ge as DataTable,
855
830
  Ae as DateFormat,
856
- Ne as LinkFormat,
857
831
  De as NumberFormat,
858
832
  me as Pagination,
859
- Ve as SelectFormat,
860
- dt as SelectionInfo,
833
+ Ne as SelectFormat,
834
+ it as SelectionInfo,
861
835
  Ie as TextFormat,
862
- ve as default,
836
+ ge as default,
863
837
  de as formatComponents
864
838
  };