@opengis/table 0.0.11 → 0.0.13

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