@opengis/table 0.0.21 → 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 (35) 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.d.ts +12 -0
  30. package/dist/index.d.ts.map +1 -0
  31. package/dist/index.mjs +348 -377
  32. package/dist/index.umd.js +1 -1
  33. package/dist/types/index.d.ts +143 -0
  34. package/dist/types/index.d.ts.map +1 -0
  35. package/package.json +57 -59
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 V, ref as w, useSlots as pe, watch as N, onMounted as fe, provide as $e, createCommentVNode as j, createBlock as ee, renderSlot as R, unref as te, resolveDynamicComponent as ce, 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-f4b15092"]]), 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,119 +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] = V(" Показано ", -1)),
227
- v("span", Ee, h(_.value), 1),
228
- y[3] || (y[3] = V(" до ", -1)),
229
- v("span", He, h($.value), 1),
230
- y[4] || (y[4] = V(" з ", -1)),
231
- v("span", We, h(p.total), 1),
232
- y[5] || (y[5] = V(" результатів ", -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
- }, [...y[6] || (y[6] = [
252
- v("path", {
223
+ }, y[6] || (y[6] = [
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
- ])], 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", {
230
+ ]), 2))
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
- }, [...y[7] || (y[7] = [
291
- v("path", {
262
+ }, y[7] || (y[7] = [
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
- ])], 2))
298
- ], 10, Ge)
269
+ ]), 2))
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 = ["onClick"], rt = ["checked", "onChange"], lt = ["onClick"], st = {
283
+ }, et = ["onClick"], tt = ["checked", "onChange"], at = ["onClick"], rt = {
312
284
  key: 1,
313
285
  class: "text-center"
314
- }, ve = /* @__PURE__ */ S({
286
+ }, ge = /* @__PURE__ */ F({
315
287
  name: "DataTable",
316
288
  __name: "DataTable",
317
289
  props: {
@@ -342,8 +314,8 @@ const De = /* @__PURE__ */ S({
342
314
  getCellData: { type: Function, default: void 0 }
343
315
  },
344
316
  emits: ["update:page", "update:selectedRows", "row-click", "sort"],
345
- setup(b, { emit: a }) {
346
- 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);
347
319
  function k(t) {
348
320
  if (D.value) {
349
321
  D.value.push(t);
@@ -351,20 +323,20 @@ const De = /* @__PURE__ */ S({
351
323
  }
352
324
  location.href = t;
353
325
  }
354
- const F = f(() => {
326
+ const T = m(() => {
355
327
  if (e.api)
356
- return i.value;
357
- if (e.sortable && n.value.length > 0) {
328
+ return u.value;
329
+ if (e.sortable && l.value.length > 0) {
358
330
  const t = [...e.rows];
359
- return t.sort((d, r) => {
360
- for (const g of n.value) {
331
+ return t.sort((c, a) => {
332
+ for (const g of l.value) {
361
333
  if (!g.direction)
362
334
  return 0;
363
- const s = d[g.field], x = r[g.field];
364
- if (s == null) return 1;
365
- 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;
366
338
  let I = 0;
367
- 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;
368
340
  const O = g.direction === "desc" ? -I : I;
369
341
  if (O !== 0) return O;
370
342
  }
@@ -373,35 +345,35 @@ const De = /* @__PURE__ */ S({
373
345
  }
374
346
  return e.rows;
375
347
  });
376
- N(() => e.selectedRows, (t) => {
377
- l.value = t || [];
348
+ L(() => e.selectedRows, (t) => {
349
+ s.value = t || [];
378
350
  });
379
- const A = (t) => l.value.some((d) => d === t), ae = (t) => {
380
- const d = l.value.findIndex((r) => r === t);
381
- d > -1 ? l.value.splice(d, 1) : l.value.push(t), c("update:selectedRows", [...l.value]);
382
- }, J = f(() => F.value.length > 0 && l.value.length === F.value.length), M = f(() => l.value.length > 0 && l.value.length < F.value.length), q = () => {
383
- J.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]);
384
356
  }, be = (t) => {
385
357
  if (!e.sortable) return;
386
- const d = n.value.findIndex((g) => g.field === t);
387
- if (d >= 0) {
388
- const g = n.value[d];
389
- 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);
390
362
  } else
391
- n.value.unshift({
363
+ l.value.unshift({
392
364
  field: t,
393
365
  direction: "asc"
394
366
  });
395
- const r = n.value.filter((g) => g.direction).map((g) => ({
367
+ const a = l.value.filter((g) => g.direction).map((g) => ({
396
368
  name: g.field,
397
369
  asc: g.direction === "asc"
398
370
  }));
399
- c("sort", r), e.api && W();
400
- }, ye = (t) => n.value.find((r) => r.field === t)?.direction === "asc", he = (t) => {
401
- const d = n.value.find((r) => r.field === t);
402
- 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)
403
375
  return "↑↓";
404
- switch (d.direction) {
376
+ switch (c.direction) {
405
377
  case "asc":
406
378
  return "↑";
407
379
  // Up arrow for ascending
@@ -412,25 +384,25 @@ const De = /* @__PURE__ */ S({
412
384
  return "↕️";
413
385
  }
414
386
  }, G = (t) => e.sortable && t.sortable !== !1, xe = (t) => {
415
- e.clickable && c("row-click", t);
416
- }, P = (t, d) => {
417
- const r = d[t.name];
387
+ e.clickable && v("row-click", t);
388
+ }, P = (t, c) => {
389
+ const a = c[t.name];
418
390
  if (e.getCellData || t.getCellData) {
419
391
  const g = t.getCellData || e.getCellData;
420
392
  if (g) {
421
- const s = {
393
+ const r = {
422
394
  name: t.name,
423
- row: d,
424
- value: r
395
+ row: c,
396
+ value: a
425
397
  };
426
- return g(s);
398
+ return g(r);
427
399
  }
428
400
  }
429
401
  return ["_data", "_text"].map((g) => {
430
- const s = `${t.name}${g}`;
431
- return d[s] ? d[s] : null;
432
- }).find((g) => g) || r;
433
- }, 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 = w(e.page), le = w(e.limit), Q = w(e.total), E = w(1), X = w(10), H = w(0), se = f(() => e.api ? E.value : K.value), ne = f(() => e.api ? X.value : le.value), oe = f(() => e.api ? H.value : Q.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(() => {
434
406
  const { theme: t } = e;
435
407
  return t === "dark" ? {
436
408
  container: "dark",
@@ -470,37 +442,37 @@ const De = /* @__PURE__ */ S({
470
442
  checkbox: "border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-blue-600 dark:text-blue-400"
471
443
  };
472
444
  });
473
- N(() => e.page, (t) => {
445
+ L(() => e.page, (t) => {
474
446
  K.value = t;
475
- }), N(() => e.limit, (t) => {
476
- le.value = t;
477
- }), N(() => e.total, (t) => {
447
+ }), L(() => e.limit, (t) => {
448
+ se.value = t;
449
+ }), L(() => e.total, (t) => {
478
450
  Q.value = t;
479
451
  });
480
452
  async function W() {
481
453
  if (e.api) {
482
- $.value = !0, T.value = null;
454
+ S.value = !0, $.value = null;
483
455
  try {
484
456
  const t = new URL(e.api, window.location.origin);
485
- if (t.searchParams.set("page", se.value.toString()), t.searchParams.set("limit", ne.value.toString()), n.value.length > 0) {
486
- 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(",");
487
459
  g && t.searchParams.set("sort", g);
488
460
  }
489
- const d = await fetch(t.toString());
490
- if (!d.ok)
491
- throw new Error(`HTTP error! status: ${d.status}`);
492
- const r = await d.json();
493
- 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 ? H.value = r.total : Q.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);
494
466
  } catch (t) {
495
- 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);
496
468
  } finally {
497
- $.value = !1;
469
+ S.value = !1;
498
470
  }
499
471
  }
500
472
  }
501
473
  const ke = (t) => {
502
- e.api ? E.value = t : (K.value = t, c("update:page", t)), e.api && W();
503
- }, _e = f(() => e.showPagination && oe.value > 0), L = 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(() => ({
504
476
  small: {
505
477
  header: "px-3 py-2 text-xs",
506
478
  cell: "px-3 py-2 text-xs"
@@ -516,204 +488,204 @@ const De = /* @__PURE__ */ S({
516
488
  })[e.size]);
517
489
  fe(() => {
518
490
  e.api && (e.page && (E.value = e.page), e.limit && (X.value = e.limit), e.total && (H.value = e.total), W());
519
- }), N(() => e.api, (t) => {
491
+ }), L(() => e.api, (t) => {
520
492
  t && (E.value = e.page || 1, X.value = e.limit || 10, H.value = e.total || 0, W());
521
493
  });
522
- const we = f(() => e.api ? _.value : e.columns), Y = w([]), U = w({});
523
- $e("registerColumn", (t, d) => {
524
- Y.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);
525
497
  });
526
- const ie = f(() => {
527
- const t = we.value || [], d = [], r = p.default?.();
528
- if (r) {
529
- const g = r.filter((s) => s.type?.name === "Column" || s.type === "Column" || s.type && typeof s.type == "object" && s.type.name === "Column").map((s) => {
530
- const x = s.props || s.componentProps || {}, I = x.field || x.name || "", O = x.header || x.label || "", ue = s.children && s.children.body, Z = {
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 = {
531
503
  name: I,
532
504
  // Use field as the name for data access
533
505
  ua: O,
534
506
  // Use header as the display name
535
- format: x.format || "text",
507
+ format: h.format || "text",
536
508
  slotName: ue ? "body" : void 0,
537
- ...x
509
+ ...h
538
510
  };
539
- return ue && Z.name && (U.value[Z.name] = s.children.body), Z;
511
+ return ue && Z.name && (U.value[Z.name] = r.children.body), Z;
540
512
  });
541
- d.push(...g);
513
+ c.push(...g);
542
514
  }
543
- if (Y.value.length > 0 && d.push(...Y.value), d.length > 0) {
544
- const g = [], s = new Set(d.map((x) => x.name));
545
- return t.forEach((x) => {
546
- s.has(x.name) || g.push(x);
547
- }), 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:", {
548
520
  default: t.length,
549
- custom: d.length,
521
+ custom: c.length,
550
522
  combined: g.length
551
523
  }), g;
552
524
  }
553
525
  return t.length > 0 ? (console.log("Using default columns:", t.length), t) : [];
554
526
  }), Ce = (t = "text") => de[t.toLowerCase()] || de.text;
555
- return (t, d) => (o(), u("div", {
556
- class: m(["w-full", C.value.container])
527
+ return (t, c) => (o(), i("div", {
528
+ class: f(["w-full", w.value.container])
557
529
  }, [
558
- $.value || e.loading ? (o(), u("div", Ke, [
559
- v("div", Qe, [
560
- d[0] || (d[0] = v("div", { class: "animate-spin rounded-full h-6 w-6 border-b-2 border-blue-600" }, null, -1)),
561
- v("span", {
562
- 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)
563
535
  }, "Loading...", 2)
564
536
  ])
565
- ])) : T.value ? (o(), u("div", {
537
+ ])) : $.value ? (o(), i("div", {
566
538
  key: 1,
567
- class: m(["text-center py-8", C.value.error])
568
- }, h(T.value), 3)) : !e.loading && F.value.length > 0 ? (o(), u("div", Xe, [
569
- v("div", {
570
- 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")
571
543
  }, [
572
- v("table", {
573
- class: m(t.classTable),
574
- style: ge(t.tableStyle)
544
+ d("table", {
545
+ class: f(t.classTable),
546
+ style: ve(t.tableStyle)
575
547
  }, [
576
- v("thead", {
577
- class: m(t.classThead || C.value.thead)
548
+ d("thead", {
549
+ class: f(t.classThead || w.value.thead)
578
550
  }, [
579
- v("tr", null, [
580
- t.selectable ? (o(), u("th", {
551
+ d("tr", null, [
552
+ t.selectable ? (o(), i("th", {
581
553
  key: 0,
582
- class: m(["text-left font-medium uppercase tracking-wider", C.value.th, L.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"])
583
555
  }, [
584
- v("input", {
556
+ d("input", {
585
557
  type: "checkbox",
586
558
  checked: J.value,
587
- indeterminate: M.value,
559
+ indeterminate: V.value,
588
560
  onChange: q,
589
- class: m(["h-4 w-4 focus:ring-blue-500 rounded", C.value.checkbox])
590
- }, null, 42, Ye)
591
- ], 2)) : j("", !0),
592
- (o(!0), u(B, null, z(ie.value.filter((r) => !r.hidden), (r) => (o(), u("th", {
593
- key: r.name,
594
- class: m([
595
- r.align ? `text-${r.align}` : "",
596
- G(r) ? ["cursor-pointer", C.value.thHover] : "",
597
- re(r)
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)
598
570
  ].concat(
599
571
  e.classTh || [
600
572
  "text-left font-medium uppercase tracking-wider",
601
- C.value.th,
602
- L.value.header
573
+ w.value.th,
574
+ N.value.header
603
575
  ]
604
576
  )),
605
- onClick: (g) => G(r) ? be(r.name) : void 0
577
+ onClick: (g) => G(a) ? be(a.name) : void 0
606
578
  }, [
607
- v("div", et, [
608
- v("span", null, h(r.ua || r.header || r.name), 1),
609
- G(r) ? (o(), u("span", tt, [
610
- R(t.$slots, "sort", {
611
- 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)
612
584
  }, () => [
613
- V(h(he(r.name)), 1)
585
+ M(x(he(a.name)), 1)
614
586
  ])
615
- ])) : j("", !0)
587
+ ])) : B("", !0)
616
588
  ])
617
- ], 10, Ze))), 128)),
618
- y.value ? (o(), u("th", {
589
+ ], 10, Xe))), 128)),
590
+ y.value ? (o(), i("th", {
619
591
  key: 1,
620
- class: m(["w-[100px]", e.classTh || [
592
+ class: f(["w-[100px]", e.classTh || [
621
593
  "text-left font-medium uppercase tracking-wider",
622
- C.value.th,
623
- L.value.header
594
+ w.value.th,
595
+ N.value.header
624
596
  ]])
625
- }, "Дії", 2)) : j("", !0)
597
+ }, "Дії", 2)) : B("", !0)
626
598
  ])
627
599
  ], 2),
628
- v("tbody", {
629
- class: m(t.classTbody || C.value.tbody)
600
+ d("tbody", {
601
+ class: f(t.classTbody || w.value.tbody)
630
602
  }, [
631
- (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", {
632
604
  key: g,
633
- class: m(e.classTr || [
634
- C.value.tr,
605
+ class: f(e.classTr || [
606
+ w.value.tr,
635
607
  e.clickable ? "cursor-pointer" : ""
636
608
  ]),
637
- onClick: (s) => e.clickable ? xe(r) : void 0
609
+ onClick: (r) => e.clickable ? xe(a) : void 0
638
610
  }, [
639
- t.selectable ? (o(), u("td", {
611
+ t.selectable ? (o(), i("td", {
640
612
  key: 0,
641
- class: m(["whitespace-nowrap", C.value.td, L.value.cell, e.classTd, "w-12"])
613
+ class: f(["whitespace-nowrap", w.value.td, N.value.cell, e.classTd, "w-12"])
642
614
  }, [
643
- v("input", {
615
+ d("input", {
644
616
  type: "checkbox",
645
- checked: A(r),
646
- onChange: (s) => ae(r),
647
- class: m(["h-4 w-4 focus:ring-blue-500 rounded", C.value.checkbox])
648
- }, null, 42, rt)
649
- ], 2)) : j("", !0),
650
- (o(!0), u(B, null, z(ie.value.filter((s) => !s.hidden), (s) => (o(), u("td", {
651
- key: s.name,
652
- 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 || [
653
625
  "whitespace-nowrap",
654
- C.value.td,
655
- L.value.cell,
656
- s.align ? `text-${s.align}` : "",
657
- re(s)
626
+ w.value.td,
627
+ N.value.cell,
628
+ r.align ? `text-${r.align}` : "",
629
+ re(r)
658
630
  ])
659
631
  }, [
660
- s.action && y.value ? R(t.$slots, "action", {
632
+ r.action && y.value ? j(t.$slots, "action", {
661
633
  key: 0,
662
- row: r
663
- }) : te(p).number && s.format === "number" ? R(t.$slots, "number", {
634
+ row: a
635
+ }) : te(p).number && r.format === "number" ? j(t.$slots, "number", {
664
636
  key: 1,
665
- row: r,
666
- value: P(s, r)
667
- }) : te(p).badge && s.format === "badge" ? R(t.$slots, "badge", {
637
+ row: a,
638
+ value: P(r, a)
639
+ }) : te(p).badge && r.format === "badge" ? j(t.$slots, "badge", {
668
640
  key: 2,
669
- row: r,
670
- value: P(s, r)
671
- }) : te(p).array && s.format === "array" ? R(t.$slots, "array", {
641
+ row: a,
642
+ value: P(r, a)
643
+ }) : te(p).array && r.format === "array" ? j(t.$slots, "array", {
672
644
  key: 3,
673
- row: r,
674
- value: P(s, r)
675
- }) : s.slotName && U.value[s.name] ? (o(), ee(ce(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]), {
676
648
  key: 4,
677
- data: r,
678
- value: P(s, r),
679
- row: r,
680
- column: s
681
- }, 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", {
682
654
  key: 5,
683
- class: m(t.classLink || "hover:text-blue-900 cursor-pointer text-blue-700 hover:underline"),
684
- onClick: (x) => k(s.link.replace("{id}", r.id))
685
- }, h(P(s, r)), 11, lt)) : (o(), ee(ce(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)), {
686
658
  key: 6,
687
- value: P(s, r),
688
- row: r,
689
- column: s,
690
- href: s.link
659
+ value: P(r, a),
660
+ row: a,
661
+ column: r,
662
+ href: r.link
691
663
  }, null, 8, ["value", "row", "column", "href"]))
692
664
  ], 2))), 128)),
693
- y.value ? (o(), u("td", st, [
694
- R(t.$slots, "action", { row: r })
695
- ])) : j("", !0)
696
- ], 10, at))), 128))
665
+ y.value ? (o(), i("td", rt, [
666
+ j(t.$slots, "action", { row: a })
667
+ ])) : B("", !0)
668
+ ], 10, et))), 128))
697
669
  ], 2)
698
670
  ], 6)
699
671
  ], 2)
700
- ])) : j("", !0),
701
- _e.value && !$.value && !e.loading && !T.value ? (o(), ee(me, {
672
+ ])) : B("", !0),
673
+ _e.value && !S.value && !e.loading && !$.value ? (o(), ee(me, {
702
674
  key: 3,
703
- page: se.value,
675
+ page: le.value,
704
676
  limit: ne.value,
705
677
  total: oe.value,
706
678
  theme: e.theme,
707
679
  size: e.size,
708
680
  "onUpdate:page": ke
709
- }, null, 8, ["page", "limit", "total", "theme", "size"])) : j("", !0),
710
- !$.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", {
711
683
  key: 4,
712
- class: m(["text-center py-8", C.value.empty])
713
- }, " Дані відсутні ", 2)) : j("", !0)
684
+ class: f(["text-center py-8", w.value.empty])
685
+ }, " Дані відсутні ", 2)) : B("", !0)
714
686
  ], 2));
715
687
  }
716
- }), nt = { style: { display: "none" } }, ot = /* @__PURE__ */ S({
688
+ }), st = { style: { display: "none" } }, lt = /* @__PURE__ */ F({
717
689
  name: "Column",
718
690
  __name: "Column",
719
691
  props: {
@@ -734,134 +706,133 @@ const De = /* @__PURE__ */ S({
734
706
  suffix: {}
735
707
  },
736
708
  setup(b) {
737
- const a = b, e = pe(), c = Te("registerColumn");
709
+ const n = b, e = pe(), v = Te("registerColumn");
738
710
  return fe(() => {
739
- if (c) {
711
+ if (v) {
740
712
  const {
741
- field: l,
742
- name: n,
743
- header: i,
744
- label: _,
745
- format: $,
746
- slotName: T,
713
+ field: s,
714
+ name: l,
715
+ header: u,
716
+ label: C,
717
+ format: S,
718
+ slotName: $,
747
719
  link: D,
748
720
  action: p,
749
721
  getCellData: y,
750
722
  suffix: k,
751
- ...F
752
- } = a, M = {
753
- name: l || n || "",
754
- ua: i || _ || "",
755
- format: $ || "text",
756
- 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),
757
729
  // Use 'body' slot if it exists
758
730
  link: D,
759
731
  action: p,
760
732
  getCellData: y,
761
733
  suffix: k,
762
- ...F
734
+ ...T
763
735
  };
764
- console.log("Registering column:", M);
736
+ console.log("Registering column:", V);
765
737
  const q = e.body;
766
- c(M, q);
738
+ v(V, q);
767
739
  }
768
- }), (l, n) => (o(), u("div", nt, [
769
- R(l.$slots, "body", { data: {} })
740
+ }), (s, l) => (o(), i("div", st, [
741
+ j(s.$slots, "body", { data: {} })
770
742
  ]));
771
743
  }
772
- }), it = { class: "mt-4" }, ut = { class: "text-sm text-gray-600 dark:text-gray-300" }, ct = /* @__PURE__ */ S({
744
+ }), nt = { class: "mt-4" }, ot = { class: "text-sm text-gray-600 dark:text-gray-300" }, it = /* @__PURE__ */ F({
773
745
  __name: "SelectionInfo",
774
746
  props: {
775
747
  selectedRows: {},
776
748
  totalCount: {}
777
749
  },
778
750
  setup(b) {
779
- const a = b, e = f(() => a.selectedRows.length);
780
- return (c, l) => (o(), u("div", it, [
781
- v("div", ut, " Обрано: " + 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)
782
754
  ]));
783
755
  }
784
- }), dt = { class: "mt-4" }, vt = { class: "border-b border-gray-200 dark:border-gray-700" }, gt = { class: "-mb-px flex space-x-8" }, pt = ["onClick"], ft = { class: "mt-4" }, mt = { class: "bg-gray-900 rounded-lg overflow-hidden" }, bt = { class: "flex items-center justify-between px-4 py-2 bg-gray-800 border-b border-gray-700" }, yt = { class: "text-sm text-gray-300" }, ht = ["onClick"], xt = { class: "p-4 text-sm text-gray-100 overflow-x-auto" }, kt = /* @__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({
785
757
  __name: "CodeTabs",
786
758
  props: {
787
759
  tabs: {},
788
760
  defaultTab: { default: void 0 }
789
761
  },
790
762
  setup(b) {
791
- 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) => {
792
764
  try {
793
- await navigator.clipboard.writeText(l), console.log("Код скопійовано!");
794
- } catch (n) {
795
- console.error("Помилка копіювання:", n);
765
+ await navigator.clipboard.writeText(s), console.log("Код скопійовано!");
766
+ } catch (l) {
767
+ console.error("Помилка копіювання:", l);
796
768
  }
797
769
  };
798
- return (l, n) => (o(), u("div", dt, [
799
- v("div", vt, [
800
- v("nav", gt, [
801
- (o(!0), u(B, null, z(l.tabs, (i) => (o(), u("button", {
802
- key: i.id,
803
- onClick: (_) => e.value = i.id,
804
- 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([
805
777
  "py-2 px-1 border-b-2 font-medium text-sm transition-colors",
806
- 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"
807
779
  ])
808
- }, h(i.label), 11, pt))), 128))
780
+ }, x(u.label), 11, gt))), 128))
809
781
  ])
810
782
  ]),
811
- v("div", ft, [
812
- (o(!0), u(B, null, z(l.tabs, (i) => Fe((o(), u("div", {
813
- 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
814
786
  }, [
815
- v("div", mt, [
816
- v("div", bt, [
817
- v("span", yt, h(i.label), 1),
818
- v("button", {
819
- 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),
820
792
  class: "text-gray-400 hover:text-white transition-colors",
821
793
  title: "Копіювати код"
822
- }, [...n[0] || (n[0] = [
823
- v("svg", {
794
+ }, l[0] || (l[0] = [
795
+ d("svg", {
824
796
  class: "w-4 h-4",
825
797
  fill: "none",
826
798
  stroke: "currentColor",
827
799
  viewBox: "0 0 24 24"
828
800
  }, [
829
- v("path", {
801
+ d("path", {
830
802
  "stroke-linecap": "round",
831
803
  "stroke-linejoin": "round",
832
804
  "stroke-width": "2",
833
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"
834
806
  })
835
807
  ], -1)
836
- ])], 8, ht)
808
+ ]), 8, bt)
837
809
  ]),
838
- v("pre", xt, [
839
- v("code", null, h(i.content), 1)
810
+ d("pre", yt, [
811
+ d("code", null, x(u.content), 1)
840
812
  ])
841
813
  ])
842
814
  ])), [
843
- [Se, e.value === i.id]
815
+ [Fe, e.value === u.id]
844
816
  ])), 128))
845
817
  ])
846
818
  ]));
847
819
  }
848
820
  });
849
- ve.install = function(a) {
850
- a.component("DataTable", ve), a.component("Column", ot), a.component("Pagination", me), a.component("SelectionInfo", ct), a.component("CodeTabs", kt);
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);
851
823
  };
852
824
  export {
853
825
  Pe as ArrayFormat,
854
- Re as BadgeFormat,
855
- kt as CodeTabs,
856
- ot as Column,
857
- ve as DataTable,
826
+ je as BadgeFormat,
827
+ ht as CodeTabs,
828
+ lt as Column,
829
+ ge as DataTable,
858
830
  Ae as DateFormat,
859
- Ne as LinkFormat,
860
831
  De as NumberFormat,
861
832
  me as Pagination,
862
- Ve as SelectFormat,
863
- ct as SelectionInfo,
833
+ Ne as SelectFormat,
834
+ it as SelectionInfo,
864
835
  Ie as TextFormat,
865
- ve as default,
836
+ ge as default,
866
837
  de as formatComponents
867
838
  };