v-sistec-features 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- import { defineComponent as O, useSlots as ge, inject as me, onMounted as Q, computed as V, createElementBlock as n, createCommentVNode as k, openBlock as e, createElementVNode as t, toDisplayString as v, withModifiers as T, Fragment as b, renderList as P, normalizeClass as m, watch as L, resolveComponent as fe, withDirectives as Z, withKeys as _e, vModelText as R, createBlock as F, withCtx as ve, createTextVNode as D, ref as S, provide as he, nextTick as ye, renderSlot as Y, createVNode as G, resolveDynamicComponent as J, unref as $, mergeProps as ke, normalizeStyle as be } from "vue";
2
- const ee = Symbol("v-datatable-key"), Dt = /* @__PURE__ */ O({
1
+ import { defineComponent as F, useSlots as fe, inject as ve, onMounted as te, computed as T, createElementBlock as a, createCommentVNode as b, openBlock as n, createElementVNode as s, toDisplayString as v, withModifiers as j, Fragment as M, renderList as z, normalizeClass as _, watch as q, resolveComponent as ge, withDirectives as ne, withKeys as he, vModelText as ae, createBlock as X, withCtx as ye, createTextVNode as N, ref as P, provide as ke, nextTick as be, renderSlot as O, createVNode as Q, resolveDynamicComponent as Z, unref as w, mergeProps as xe, normalizeStyle as we } from "vue";
2
+ const se = Symbol("v-datatable-key"), Nt = /* @__PURE__ */ F({
3
3
  __name: "VColumn",
4
4
  props: {
5
5
  field: { default: null },
@@ -11,276 +11,169 @@ const ee = Symbol("v-datatable-key"), Dt = /* @__PURE__ */ O({
11
11
  format: { default: "complete" },
12
12
  deactivate_img_preview: { type: Boolean, default: !1 },
13
13
  limite_text: { default: null },
14
- transform_function: { type: [Function, null], default: null }
14
+ transform_function: { type: [Function, null], default: null },
15
+ click: { type: [Function, null], default: null }
15
16
  },
16
- setup(x) {
17
- const d = x, r = ge(), y = me(ee);
18
- if (!y)
17
+ setup(y) {
18
+ const u = y, o = fe(), f = ve(se);
19
+ if (!f)
19
20
  throw new Error("VColumn deve ser usado dentro de um VDataTable.");
20
- const h = ["text", "img", "date", "html"];
21
- return Q(() => {
22
- if (d.field !== null && !d.field)
21
+ const g = ["text", "img", "date", "html"];
22
+ return te(() => {
23
+ if (u.field !== null && !u.field)
23
24
  throw new Error('A propriedade "field" é obrigatória em VColumn.');
24
- if (!d.header)
25
+ if (!u.header)
25
26
  throw new Error('A propriedade "header" é obrigatória em VColumn.');
26
- if (d.field !== null && !h.includes(d.type))
27
- throw new Error(`O tipo "${d.type}" não é suportado em VColumn. Tipos suportados: text, img, date, html.`);
28
- if (d.limite_text) {
29
- if (d.type !== "text")
27
+ if (u.field !== null && !g.includes(u.type))
28
+ throw new Error(`O tipo "${u.type}" não é suportado em VColumn. Tipos suportados: text, img, date, html.`);
29
+ if (u.limite_text) {
30
+ if (u.type !== "text")
30
31
  throw new Error('A propriedade "limite_text" só pode ser usada quando o tipo for "text".');
31
- if (typeof d.limite_text == "string" && isNaN(Number(d.limite_text)))
32
+ if (typeof u.limite_text == "string" && isNaN(Number(u.limite_text)))
32
33
  throw new Error('A propriedade "limite_text" deve ser um número quando for uma string.');
33
- if (isNaN(Number(d.limite_text)) || Number(d.limite_text) <= 0)
34
+ if (isNaN(Number(u.limite_text)) || Number(u.limite_text) <= 0)
34
35
  throw new Error('A propriedade "limite_text" deve ser um número maior que 0.');
35
36
  }
36
- y.addColumn({
37
- field: d.field,
38
- header: d.header,
39
- type: d.type,
40
- class_column: d.class_column,
41
- class_row: d.class_row,
42
- class_item: d.class_item,
43
- transform_function: d.transform_function,
44
- bodySlot: r.body,
45
- ...d.type === "text" && { limite_text: Number(d.limite_text) },
46
- ...d.type === "img" && { deactivate_img_preview: d.deactivate_img_preview },
47
- ...d.type === "date" && { format: d.format }
37
+ f.addColumn({
38
+ field: u.field,
39
+ header: u.header,
40
+ type: u.type,
41
+ class_column: u.class_column,
42
+ class_row: u.class_row,
43
+ class_item: u.class_item,
44
+ click: u.click,
45
+ transform_function: u.transform_function,
46
+ bodySlot: o.body,
47
+ ...u.type === "text" && { limite_text: Number(u.limite_text) },
48
+ ...u.type === "img" && { deactivate_img_preview: u.deactivate_img_preview },
49
+ ...u.type === "date" && { format: u.format }
48
50
  });
49
- }), (M, B) => null;
51
+ }), (C, A) => null;
50
52
  }
51
- }), we = {
53
+ }), Ce = {
52
54
  key: 0,
53
55
  class: "d-flex align-items-center justify-content-between w-100"
54
- }, xe = {
56
+ }, $e = {
55
57
  key: 0,
56
58
  class: "d-flex align-items-center p-2 gap-2"
57
- }, Ce = { class: "d-flex" }, $e = ["disabled"], Me = ["disabled"], Se = { class: "d-flex gap-2" }, Pe = ["onClick", "disabled"], ze = ["onClick", "disabled"], Ne = {
58
- key: 0,
59
- class: "m-0 p-0"
60
- }, Te = ["onClick", "disabled"], De = ["onClick", "disabled"], Ve = {
61
- key: 0,
59
+ }, Se = { class: "d-flex" }, Me = ["disabled"], Pe = ["disabled"], ze = { class: "d-flex gap-2" }, Te = ["onClick", "disabled"], Ne = {
60
+ key: 1,
62
61
  class: "m-0 p-0"
63
- }, je = ["onClick", "disabled"], Be = { class: "d-flex" }, Ae = ["disabled"], Ee = ["disabled"], He = /* @__PURE__ */ O({
62
+ }, Ae = { class: "d-flex" }, De = ["disabled"], Ee = ["disabled"], R = `
63
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
64
+ stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
65
+ class="icon icon-tabler icons-tabler-outline icon-tabler-chevrons-left">
66
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
67
+ <path d="M11 7l-5 5l5 5" />
68
+ <path d="M17 7l-5 5l5 5" />
69
+ </svg>
70
+ `, ee = `
71
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
72
+ stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
73
+ class="icon icon-tabler icons-tabler-outline icon-tabler-chevron-left">
74
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
75
+ <path d="M15 6l-6 6l6 6" />
76
+ </svg>
77
+ `, He = /* @__PURE__ */ F({
64
78
  __name: "PaginationDatatable",
65
79
  props: {
66
80
  pagination: {},
67
81
  filtering: { type: Boolean, default: !1 }
68
82
  },
69
83
  emits: ["tradePage"],
70
- setup(x, { emit: d }) {
71
- const r = x, y = d, h = V(() => r.pagination.limit_per_page ? Math.ceil(r.pagination.count / r.pagination.limit_per_page) : 0), M = V(() => r.pagination.current_page + 1 < Math.ceil(r.pagination.count / r.pagination.limit_per_page) ? r.pagination.current_page + 1 : null), B = () => {
72
- r.pagination.current_page++, y("tradePage");
73
- }, z = (f) => {
74
- r.pagination.current_page = f, y("tradePage");
75
- }, o = () => {
76
- r.pagination.current_page = h.value - 1, y("tradePage");
77
- }, p = () => {
78
- r.pagination.current_page = 0, y("tradePage");
79
- }, C = () => {
80
- r.pagination.current_page > 0 && (r.pagination.current_page--, y("tradePage"));
81
- };
82
- function g(f, c, i) {
83
- return f === c || c === f - 1 && f != 3 || c === f + 1 ? !0 : f > i - 2;
84
- }
85
- function j(f, c, i) {
86
- return f == i - 2 && c > 2 && c != i;
87
- }
88
- function w(f, c, i) {
89
- return c != i - 1 && c != i - 2 ? f > i - 2 : !1;
90
- }
91
- return (f, c) => r.pagination.count > 0 ? (e(), n("div", we, [
92
- t("span", null, " Mostrando de " + v(r.pagination.count !== 0 ? r.pagination.limit_per_page * r.pagination.current_page + 1 : 0) + " até " + v(r.pagination.limit_per_page * (r.pagination.current_page + 1) < r.pagination.count ? r.pagination.limit_per_page * (r.pagination.current_page + 1) : r.pagination.count) + " de " + v(r.pagination.count) + " registros ", 1),
93
- h.value > 0 ? (e(), n("div", xe, [
94
- t("div", Ce, [
95
- t("button", {
84
+ setup(y, { emit: u }) {
85
+ const o = y, f = u, g = T(() => o.pagination.limit_per_page ? Math.ceil(o.pagination.count / o.pagination.limit_per_page) : 0), C = T(() => o.pagination.current_page + 1 < g.value ? o.pagination.current_page + 1 : null), A = () => {
86
+ o.pagination.current_page++, f("tradePage");
87
+ }, E = ($) => {
88
+ o.pagination.current_page = $ - 1, f("tradePage");
89
+ }, l = () => {
90
+ o.pagination.current_page = g.value - 1, f("tradePage");
91
+ }, d = () => {
92
+ o.pagination.current_page = 0, f("tradePage");
93
+ }, k = () => {
94
+ o.pagination.current_page > 0 && (o.pagination.current_page--, f("tradePage"));
95
+ }, c = T(() => {
96
+ if (g.value <= 7)
97
+ return Array.from({ length: g.value }, (p, B) => B + 1);
98
+ const $ = o.pagination.current_page + 1, m = g.value, h = /* @__PURE__ */ new Set([
99
+ 1,
100
+ 2,
101
+ // Sempre mostra as 2 primeiras
102
+ $ - 1,
103
+ $,
104
+ $ + 1,
105
+ // Mostra a atual e vizinhas
106
+ m - 1,
107
+ m
108
+ // Sempre mostra as 2 últimas
109
+ ]), x = [];
110
+ let H = 0;
111
+ return Array.from(h).sort((p, B) => p - B).forEach((p) => {
112
+ p < 1 || p > m || (p > H + 1 && x.push("..."), x.push(p), H = p);
113
+ }), x;
114
+ });
115
+ return ($, m) => o.pagination.count > 0 ? (n(), a("div", Ce, [
116
+ s("span", null, " Mostrando de " + v(o.pagination.count !== 0 ? o.pagination.limit_per_page * o.pagination.current_page + 1 : 0) + " até " + v(o.pagination.limit_per_page * (o.pagination.current_page + 1) < o.pagination.count ? o.pagination.limit_per_page * (o.pagination.current_page + 1) : o.pagination.count) + " de " + v(o.pagination.count) + " registros ", 1),
117
+ g.value > 0 ? (n(), a("div", $e, [
118
+ s("div", Se, [
119
+ s("button", {
96
120
  class: "btn btn-estilo",
97
- onClick: T(p, ["prevent"]),
98
- disabled: r.pagination.current_page === 0
99
- }, [...c[0] || (c[0] = [
100
- t("svg", {
101
- xmlns: "http://www.w3.org/2000/svg",
102
- width: "24",
103
- height: "24",
104
- viewBox: "0 0 24 24",
105
- fill: "none",
106
- stroke: "currentColor",
107
- "stroke-width": "2",
108
- "stroke-linecap": "round",
109
- "stroke-linejoin": "round",
110
- class: "icon icon-tabler icons-tabler-outline icon-tabler-chevrons-left"
111
- }, [
112
- t("path", {
113
- stroke: "none",
114
- d: "M0 0h24v24H0z",
115
- fill: "none"
116
- }),
117
- t("path", { d: "M11 7l-5 5l5 5" }),
118
- t("path", { d: "M17 7l-5 5l5 5" })
119
- ], -1)
120
- ])], 8, $e),
121
- t("button", {
121
+ onClick: j(d, ["prevent"]),
122
+ disabled: o.pagination.current_page === 0,
123
+ innerHTML: R
124
+ }, null, 8, Me),
125
+ s("button", {
122
126
  class: "btn btn-estilo",
123
- onClick: T(C, ["prevent"]),
124
- disabled: r.pagination.current_page === 0
125
- }, [...c[1] || (c[1] = [
126
- t("svg", {
127
- xmlns: "http://www.w3.org/2000/svg",
128
- width: "24",
129
- height: "24",
130
- viewBox: "0 0 24 24",
131
- fill: "none",
132
- stroke: "currentColor",
133
- "stroke-width": "2",
134
- "stroke-linecap": "round",
135
- "stroke-linejoin": "round",
136
- class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-left"
137
- }, [
138
- t("path", {
139
- stroke: "none",
140
- d: "M0 0h24v24H0z",
141
- fill: "none"
142
- }),
143
- t("path", { d: "M15 6l-6 6l6 6" })
144
- ], -1)
145
- ])], 8, Me)
127
+ onClick: j(k, ["prevent"]),
128
+ disabled: o.pagination.current_page === 0,
129
+ innerHTML: ee
130
+ }, null, 8, Pe)
146
131
  ]),
147
- t("div", Se, [
148
- h.value < 7 ? (e(!0), n(b, { key: 0 }, P(h.value, (i) => (e(), n("button", {
149
- key: i,
150
- class: m([r.pagination.current_page + 1 == i ? "page-select" : "", "page-estilo"]),
151
- onClick: T((_) => z(i - 1), ["prevent"]),
152
- disabled: r.pagination.current_page + 1 == i
153
- }, v(i), 11, Pe))), 128)) : (e(!0), n(b, { key: 1 }, P(h.value, (i) => (e(), n(b, { key: i }, [
154
- i < 3 ? (e(), n(b, { key: 0 }, [
155
- t("button", {
156
- class: m([
157
- r.pagination.current_page + 1 == i ? "page-select" : "",
158
- "page-estilo"
159
- ]),
160
- onClick: T((_) => z(i - 1), ["prevent"]),
161
- disabled: r.pagination.current_page + 1 == i
162
- }, v(i), 11, ze),
163
- i === 2 && r.pagination.current_page + 1 !== 2 && r.pagination.current_page + 1 !== 3 && r.pagination.current_page + 1 !== 4 ? (e(), n("p", Ne, " ... ")) : k("", !0)
164
- ], 64)) : i === 3 && r.pagination.current_page + 1 === 2 ? (e(), n(b, { key: 1 }, [
165
- t("button", {
166
- class: m([
167
- r.pagination.current_page + 1 == i ? "page-select" : "",
168
- "page-estilo"
169
- ]),
170
- onClick: T((_) => z(i - 1), ["prevent"]),
171
- disabled: r.pagination.current_page + 1 == i
172
- }, v(i), 11, Te),
173
- c[2] || (c[2] = t("p", { class: "m-0 p-0" }, "...", -1))
174
- ], 64)) : (e(), n(b, { key: 2 }, [
175
- g(
176
- i,
177
- r.pagination.current_page + 1,
178
- h.value
179
- ) ? (e(), n("button", {
180
- key: 0,
181
- class: m([
182
- r.pagination.current_page + 1 == i ? "page-select" : "",
183
- "page-estilo"
184
- ]),
185
- onClick: T((_) => z(i - 1), ["prevent"]),
186
- disabled: r.pagination.current_page + 1 == i
187
- }, v(i), 11, De)) : (e(), n(b, { key: 1 }, [
188
- j(
189
- i,
190
- r.pagination.current_page + 1,
191
- h.value
192
- ) ? (e(), n("p", Ve, " ... ")) : k("", !0),
193
- w(
194
- i,
195
- r.pagination.current_page + 1,
196
- h.value
197
- ) ? (e(), n("button", {
198
- key: 1,
199
- class: m([
200
- r.pagination.current_page + 1 == i ? "page-select" : "",
201
- "page-estilo"
202
- ]),
203
- onClick: T((_) => z(i - 1), ["prevent"]),
204
- disabled: r.pagination.current_page + 1 == i
205
- }, v(i), 11, je)) : k("", !0)
206
- ], 64))
207
- ], 64))
132
+ s("div", ze, [
133
+ (n(!0), a(M, null, z(c.value, (h, x) => (n(), a(M, { key: x }, [
134
+ typeof h == "number" ? (n(), a("button", {
135
+ key: 0,
136
+ class: _([o.pagination.current_page + 1 == h ? "page-select" : "", "page-estilo"]),
137
+ onClick: j((H) => E(h), ["prevent"]),
138
+ disabled: o.pagination.current_page + 1 == h
139
+ }, v(h), 11, Te)) : (n(), a("span", Ne, "..."))
208
140
  ], 64))), 128))
209
141
  ]),
210
- t("div", Be, [
211
- t("button", {
212
- onClick: T(B, ["prevent"]),
213
- class: "btn btn-estilo",
214
- disabled: !M.value
215
- }, [...c[3] || (c[3] = [
216
- t("svg", {
217
- xmlns: "http://www.w3.org/2000/svg",
218
- width: "24",
219
- height: "24",
220
- viewBox: "0 0 24 24",
221
- fill: "none",
222
- stroke: "currentColor",
223
- "stroke-width": "2",
224
- "stroke-linecap": "round",
225
- "stroke-linejoin": "round",
226
- class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-right"
227
- }, [
228
- t("path", {
229
- stroke: "none",
230
- d: "M0 0h24v24H0z",
231
- fill: "none"
232
- }),
233
- t("path", { d: "M9 6l6 6l-6 6" })
234
- ], -1)
235
- ])], 8, Ae),
236
- t("button", {
237
- onClick: T(o, ["prevent"]),
238
- class: "btn btn-estilo",
239
- disabled: !M.value
240
- }, [...c[4] || (c[4] = [
241
- t("svg", {
242
- xmlns: "http://www.w3.org/2000/svg",
243
- width: "24",
244
- height: "24",
245
- viewBox: "0 0 24 24",
246
- fill: "none",
247
- stroke: "currentColor",
248
- "stroke-width": "2",
249
- "stroke-linecap": "round",
250
- "stroke-linejoin": "round",
251
- class: "icon icon-tabler icons-tabler-outline icon-tabler-chevrons-right"
252
- }, [
253
- t("path", {
254
- stroke: "none",
255
- d: "M0 0h24v24H0z",
256
- fill: "none"
257
- }),
258
- t("path", { d: "M7 7l5 5l-5 5" }),
259
- t("path", { d: "M13 7l5 5l-5 5" })
260
- ], -1)
261
- ])], 8, Ee)
142
+ s("div", Ae, [
143
+ s("button", {
144
+ onClick: j(A, ["prevent"]),
145
+ class: "btn btn-estilo rotate-180",
146
+ disabled: !C.value,
147
+ innerHTML: ee
148
+ }, null, 8, De),
149
+ s("button", {
150
+ onClick: j(l, ["prevent"]),
151
+ class: "btn btn-estilo rotate-180",
152
+ disabled: !C.value,
153
+ innerHTML: R
154
+ }, null, 8, Ee)
262
155
  ])
263
- ])) : k("", !0)
264
- ])) : k("", !0);
156
+ ])) : b("", !0)
157
+ ])) : b("", !0);
265
158
  }
266
- }), X = (x, d) => {
267
- const r = x.__vccOpts || x;
268
- for (const [y, h] of d)
269
- r[y] = h;
270
- return r;
271
- }, Ie = /* @__PURE__ */ X(He, [["__scopeId", "data-v-30294527"]]), Le = { class: "dropdown d-flex" }, Oe = {
159
+ }), W = (y, u) => {
160
+ const o = y.__vccOpts || y;
161
+ for (const [f, g] of u)
162
+ o[f] = g;
163
+ return o;
164
+ }, Le = /* @__PURE__ */ W(He, [["__scopeId", "data-v-c189f089"]]), Ve = { class: "dropdown d-flex" }, je = {
272
165
  key: 0,
273
166
  href: "#",
274
167
  class: "btn dropdown-toggle",
275
168
  "data-bs-toggle": "dropdown",
276
169
  title: "Pesquisas Prédefinidas"
277
- }, qe = { class: "input-icon" }, Ke = {
170
+ }, Be = { class: "input-icon" }, Ie = {
278
171
  key: 1,
279
172
  class: "input-icon-addon"
280
- }, Ue = {
173
+ }, Oe = {
281
174
  key: 1,
282
175
  class: "dropdown-menu"
283
- }, Ye = ["onClick"], Fe = /* @__PURE__ */ O({
176
+ }, qe = ["onClick"], Fe = /* @__PURE__ */ F({
284
177
  __name: "SearchDatatable",
285
178
  props: {
286
179
  search: {},
@@ -289,36 +182,36 @@ const ee = Symbol("v-datatable-key"), Dt = /* @__PURE__ */ O({
289
182
  item_use: { default: () => [1, 2] }
290
183
  },
291
184
  emits: ["update:search", "update:filter", "search"],
292
- setup(x, { emit: d }) {
293
- const r = x, y = d, h = V({
294
- get: () => r.search,
295
- set: (o) => y("update:search", o)
296
- }), M = V({
297
- get: () => r.filter,
298
- set: (o) => y("update:filter", o)
185
+ setup(y, { emit: u }) {
186
+ const o = y, f = u, g = T({
187
+ get: () => o.search,
188
+ set: (l) => f("update:search", l)
189
+ }), C = T({
190
+ get: () => o.filter,
191
+ set: (l) => f("update:filter", l)
299
192
  });
300
- L(M, () => {
301
- y("search");
302
- }), L(
303
- () => r.list_filter,
304
- (o) => {
305
- Array.isArray(o) ? (o.forEach((p, C) => {
306
- p?.type === 1 && !p.to && console.error(`Filtro na posição ${C} é do tipo 'router-link' mas não possui a propriedade 'to'.`);
307
- }), r.item_use.includes(2) && o.length === 0 && console.error("Nenhum filtro foi passado. Certifique-se de que o array de filtros não está vazio.")) : console.error("list_filter deve ser um array.");
193
+ q(C, () => {
194
+ f("search");
195
+ }), q(
196
+ () => o.list_filter,
197
+ (l) => {
198
+ Array.isArray(l) ? (l.forEach((d, k) => {
199
+ d?.type === 1 && !d.to && console.error(`Filtro na posição ${k} é do tipo 'router-link' mas não possui a propriedade 'to'.`);
200
+ }), o.item_use.includes(2) && l.length === 0 && console.error("Nenhum filtro foi passado. Certifique-se de que o array de filtros não está vazio.")) : console.error("list_filter deve ser um array.");
308
201
  },
309
202
  { immediate: !0, deep: !0 }
310
203
  );
311
- function B(o) {
312
- M.value === o ? M.value = "" : M.value = o;
204
+ function A(l) {
205
+ C.value === l ? C.value = "" : C.value = l;
313
206
  }
314
- function z() {
315
- h.value = "", y("search");
207
+ function E() {
208
+ g.value = "", f("search");
316
209
  }
317
- return (o, p) => {
318
- const C = fe("router-link");
319
- return e(), n("div", Le, [
320
- x.item_use.includes(2) ? (e(), n("a", Oe, [...p[3] || (p[3] = [
321
- t("svg", {
210
+ return (l, d) => {
211
+ const k = ge("router-link");
212
+ return n(), a("div", Ve, [
213
+ y.item_use.includes(2) ? (n(), a("a", je, [...d[3] || (d[3] = [
214
+ s("svg", {
322
215
  xmlns: "http://www.w3.org/2000/svg",
323
216
  class: "icon icon-tabler icon-tabler-filter",
324
217
  width: "24",
@@ -330,32 +223,32 @@ const ee = Symbol("v-datatable-key"), Dt = /* @__PURE__ */ O({
330
223
  "stroke-linecap": "round",
331
224
  "stroke-linejoin": "round"
332
225
  }, [
333
- t("path", {
226
+ s("path", {
334
227
  stroke: "none",
335
228
  d: "M0 0h24v24H0z",
336
229
  fill: "none"
337
230
  }),
338
- t("path", { d: "M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z" })
231
+ s("path", { d: "M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z" })
339
232
  ], -1)
340
- ])])) : k("", !0),
341
- t("div", qe, [
342
- Z(t("input", {
233
+ ])])) : b("", !0),
234
+ s("div", Be, [
235
+ ne(s("input", {
343
236
  type: "text",
344
237
  class: "form-control ms-1",
345
238
  id: "inputSearchLaudos",
346
- "onUpdate:modelValue": p[0] || (p[0] = (g) => h.value = g),
347
- onKeyup: p[1] || (p[1] = _e((g) => o.$emit("search"), ["enter"])),
239
+ "onUpdate:modelValue": d[0] || (d[0] = (c) => g.value = c),
240
+ onKeyup: d[1] || (d[1] = he((c) => l.$emit("search"), ["enter"])),
348
241
  placeholder: "Buscar..."
349
242
  }, null, 544), [
350
- [R, h.value]
243
+ [ae, g.value]
351
244
  ]),
352
- h.value ? (e(), n("span", {
245
+ g.value ? (n(), a("span", {
353
246
  key: 0,
354
- onClick: p[2] || (p[2] = (g) => z()),
247
+ onClick: d[2] || (d[2] = (c) => E()),
355
248
  class: "inputClose",
356
249
  title: "Limpar pesquisa"
357
- }, [...p[4] || (p[4] = [
358
- t("svg", {
250
+ }, [...d[4] || (d[4] = [
251
+ s("svg", {
359
252
  xmlns: "http://www.w3.org/2000/svg",
360
253
  width: "24",
361
254
  height: "24",
@@ -367,16 +260,16 @@ const ee = Symbol("v-datatable-key"), Dt = /* @__PURE__ */ O({
367
260
  "stroke-linejoin": "round",
368
261
  class: "icon icon-tabler icons-tabler-outline icon-tabler-x"
369
262
  }, [
370
- t("path", {
263
+ s("path", {
371
264
  stroke: "none",
372
265
  d: "M0 0h24v24H0z",
373
266
  fill: "none"
374
267
  }),
375
- t("path", { d: "M18 6l-12 12" }),
376
- t("path", { d: "M6 6l12 12" })
268
+ s("path", { d: "M18 6l-12 12" }),
269
+ s("path", { d: "M6 6l12 12" })
377
270
  ], -1)
378
- ])])) : (e(), n("span", Ke, [...p[5] || (p[5] = [
379
- t("svg", {
271
+ ])])) : (n(), a("span", Ie, [...d[5] || (d[5] = [
272
+ s("svg", {
380
273
  xmlns: "http://www.w3.org/2000/svg",
381
274
  width: "24",
382
275
  height: "24",
@@ -388,114 +281,114 @@ const ee = Symbol("v-datatable-key"), Dt = /* @__PURE__ */ O({
388
281
  "stroke-linejoin": "round",
389
282
  class: "icon"
390
283
  }, [
391
- t("path", {
284
+ s("path", {
392
285
  stroke: "none",
393
286
  d: "M0 0h24v24H0z",
394
287
  fill: "none"
395
288
  }),
396
- t("path", { d: "M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0" }),
397
- t("path", { d: "M21 21l-6 -6" })
289
+ s("path", { d: "M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0" }),
290
+ s("path", { d: "M21 21l-6 -6" })
398
291
  ], -1)
399
292
  ])]))
400
293
  ]),
401
- x.item_use.includes(2) ? (e(), n("div", Ue, [
402
- (e(!0), n(b, null, P(r.list_filter, (g, j) => (e(), n(b, { key: j }, [
403
- "type" in g && g.type === 1 ? (e(), F(C, {
294
+ y.item_use.includes(2) ? (n(), a("div", Oe, [
295
+ (n(!0), a(M, null, z(o.list_filter, (c, $) => (n(), a(M, { key: $ }, [
296
+ "type" in c && c.type === 1 ? (n(), X(k, {
404
297
  key: 0,
405
- to: g?.to,
298
+ to: c?.to,
406
299
  class: "dropdown-item cursor-pointer"
407
300
  }, {
408
- default: ve(() => [
409
- D(v(g.text), 1)
301
+ default: ye(() => [
302
+ N(v(c.text), 1)
410
303
  ]),
411
304
  _: 2
412
- }, 1032, ["to"])) : !("type" in g) || g.type === 2 ? (e(), n("a", {
305
+ }, 1032, ["to"])) : !("type" in c) || c.type === 2 ? (n(), a("a", {
413
306
  key: 1,
414
- onClick: T((w) => B(String(g.value)), ["prevent"]),
415
- class: m(["dropdown-item cursor-pointer", M.value === g?.value ? "bg-info text-dark selected" : ""])
416
- }, v(g.text), 11, Ye)) : k("", !0)
307
+ onClick: j((m) => A(String(c.value)), ["prevent"]),
308
+ class: _(["dropdown-item cursor-pointer", C.value === c?.value ? "bg-info text-dark selected" : ""])
309
+ }, v(c.text), 11, qe)) : b("", !0)
417
310
  ], 64))), 128))
418
- ])) : k("", !0)
311
+ ])) : b("", !0)
419
312
  ]);
420
313
  };
421
314
  }
422
- }), Xe = /* @__PURE__ */ X(Fe, [["__scopeId", "data-v-1b6ff54b"]]);
423
- function We() {
424
- const x = S(!1), d = S(""), r = S(0), y = S(0), h = V(() => ({
315
+ }), Ke = /* @__PURE__ */ W(Fe, [["__scopeId", "data-v-1b6ff54b"]]);
316
+ function Ue() {
317
+ const y = P(!1), u = P(""), o = P(0), f = P(0), g = T(() => ({
425
318
  position: "fixed",
426
319
  zIndex: 9999,
427
320
  pointerEvents: "none",
428
- top: `${y.value + 15}px`,
429
- left: `${r.value + 15}px`
321
+ top: `${f.value + 15}px`,
322
+ left: `${o.value + 15}px`
430
323
  }));
431
- function M(p) {
432
- const C = p.clientX, g = p.clientY, j = window.innerHeight, w = 15, f = 300;
433
- let c = g + w;
434
- c + f > j && (c = g - f - w, c < 0 && (c = 0)), r.value = C, y.value = c;
324
+ function C(d) {
325
+ const k = d.clientX, c = d.clientY, $ = window.innerHeight, m = 15, h = 300;
326
+ let x = c + m;
327
+ x + h > $ && (x = c - h - m, x < 0 && (x = 0)), o.value = k, f.value = x;
435
328
  }
436
- function B(p, C) {
437
- x.value = !0, d.value = C, M(p);
329
+ function A(d, k) {
330
+ y.value = !0, u.value = k, C(d);
438
331
  }
439
- function z(p) {
440
- x.value && M(p);
332
+ function E(d) {
333
+ y.value && C(d);
441
334
  }
442
- function o() {
443
- x.value = !1;
335
+ function l() {
336
+ y.value = !1;
444
337
  }
445
338
  return {
446
- isHovering: x,
447
- previewSrc: d,
448
- previewStyle: h,
449
- handleMouseOver: B,
450
- handleMouseMove: z,
451
- handleMouseLeave: o
339
+ isHovering: y,
340
+ previewSrc: u,
341
+ previewStyle: g,
342
+ handleMouseOver: A,
343
+ handleMouseMove: E,
344
+ handleMouseLeave: l
452
345
  };
453
346
  }
454
- const Ge = { class: "d-flex justify-content-between align-items-start mb-2" }, Je = { class: "text-secondary" }, Qe = { class: "mx-2 d-inline-block" }, Ze = {
347
+ const Ye = { class: "d-flex justify-content-between align-items-start mb-2" }, Xe = { class: "text-secondary" }, We = { class: "mx-2 d-inline-block" }, Ge = {
455
348
  key: 0,
456
349
  class: "alert alert-cyan d-flex justify-content-center align-items-center py-3",
457
350
  role: "alert"
458
- }, Re = { class: "alert-title m-0" }, et = { key: 0 }, tt = { key: 2 }, nt = {
351
+ }, Je = { class: "alert-title m-0" }, Qe = { key: 0 }, Ze = { key: 2 }, Re = {
459
352
  key: 5,
460
353
  class: "text-danger erro-custom-container"
461
- }, at = { class: "badge bg-orange text-white erro-custom-text" }, st = { key: 0 }, rt = { key: 2 }, ot = {
354
+ }, et = { class: "badge bg-orange text-white erro-custom-text" }, tt = { key: 0 }, nt = { key: 2 }, at = {
462
355
  key: 5,
463
356
  class: "text-danger erro-custom-container"
464
- }, lt = { class: "badge bg-orange text-white erro-custom-text" }, it = ["colspan"], ut = {
357
+ }, st = { class: "badge bg-orange text-white erro-custom-text" }, lt = ["colspan"], rt = {
465
358
  key: 0,
466
359
  class: "d-flex flex-column justify-content-center align-items-center",
467
360
  style: { height: "6rem" }
468
- }, dt = {
361
+ }, ot = {
469
362
  key: 1,
470
363
  style: { height: "3rem" }
471
- }, pt = {
364
+ }, it = {
472
365
  key: 2,
473
366
  class: "p-3 text-center text-secondary"
474
- }, ct = {
367
+ }, ut = {
475
368
  key: 2,
476
369
  class: "feedback-container text-center"
477
- }, gt = {
370
+ }, dt = {
478
371
  key: 0,
479
372
  class: "text-secondary"
480
- }, mt = {
373
+ }, ct = {
481
374
  key: 1,
482
375
  class: "text-secondary"
483
- }, ft = {
376
+ }, pt = {
484
377
  key: 3,
485
378
  class: "table-responsive"
486
- }, _t = { key: 0 }, vt = {
379
+ }, _t = { key: 0 }, mt = {
487
380
  key: 0,
488
381
  class: "w-1"
489
- }, ht = {
382
+ }, ft = {
490
383
  key: 0,
491
384
  class: "w-1"
492
- }, yt = ["checked", "onChange"], kt = { key: 2 }, bt = { key: 0 }, wt = { key: 1 }, xt = ["innerHTML"], Ct = ["src"], $t = ["src"], Mt = {
385
+ }, vt = ["checked", "onChange"], gt = ["onClick"], ht = ["onClick"], yt = { key: 0 }, kt = { key: 1 }, bt = ["onClick", "innerHTML"], xt = ["onClick"], wt = ["src"], Ct = ["src"], $t = {
493
386
  key: 5,
494
387
  class: "text-danger erro-custom-container"
495
- }, St = { class: "badge bg-orange text-white erro-custom-text" }, Pt = {
388
+ }, St = { class: "badge bg-orange text-white erro-custom-text" }, Mt = {
496
389
  key: 1,
497
390
  class: "text-center p-4 text-secondary"
498
- }, zt = ["src"], Nt = /* @__PURE__ */ O({
391
+ }, Pt = ["src"], zt = /* @__PURE__ */ F({
499
392
  __name: "VDataTable",
500
393
  props: {
501
394
  fetch: {},
@@ -512,6 +405,8 @@ const Ge = { class: "d-flex justify-content-between align-items-start mb-2" }, J
512
405
  data_key: { default: "results" },
513
406
  total_key: { default: "count" },
514
407
  list_filter: { default: () => [] },
408
+ first_text_page_size: { default: "Mostrar" },
409
+ second_text_page_size: { default: "registros" },
515
410
  class_table: { default: "" },
516
411
  class_content: { default: "" },
517
412
  class_container: { default: "" },
@@ -522,15 +417,15 @@ const Ge = { class: "d-flex justify-content-between align-items-start mb-2" }, J
522
417
  use_checkbox: { type: Boolean, default: !1 },
523
418
  item_key: { default: "id" }
524
419
  },
525
- setup(x, { expose: d }) {
420
+ setup(y, { expose: u }) {
526
421
  const {
527
- isHovering: r,
528
- previewSrc: y,
529
- previewStyle: h,
530
- handleMouseOver: M,
531
- handleMouseMove: B,
532
- handleMouseLeave: z
533
- } = We(), o = x, p = S(5), C = S([]), g = S([]), j = S(0), w = S([]), f = S(null), c = S(!1), i = S(null), _ = S({
422
+ isHovering: o,
423
+ previewSrc: f,
424
+ previewStyle: g,
425
+ handleMouseOver: C,
426
+ handleMouseMove: A,
427
+ handleMouseLeave: E
428
+ } = Ue(), l = y, d = P(5), k = P([]), c = P([]), $ = P(0), m = P([]), h = P(null), x = P(!1), H = P(null), p = P({
534
429
  current_page: 0,
535
430
  // pagina atual
536
431
  count: 0,
@@ -541,403 +436,412 @@ const Ge = { class: "d-flex justify-content-between align-items-start mb-2" }, J
541
436
  // termo de busca
542
437
  filter: ""
543
438
  // filtro selecionado
544
- }), { data: te, pending: ne, error: q, execute: ae, attempt: H } = o.fetch(o.endpoint, {
545
- params: () => o.deactivate_default_params ? o.add_params && typeof o.add_params == "function" ? o.add_params() : {
546
- ...o.add_params
547
- } : o.add_params && typeof o.add_params == "function" ? {
548
- ...K.value,
549
- ...o.add_params()
439
+ }), { data: B, pending: le, error: K, execute: re, attempt: V } = l.fetch(l.endpoint, {
440
+ params: () => l.deactivate_default_params ? l.add_params && typeof l.add_params == "function" ? l.add_params() : {
441
+ ...l.add_params
442
+ } : l.add_params && typeof l.add_params == "function" ? {
443
+ ...U.value,
444
+ ...l.add_params()
550
445
  } : {
551
- ...K.value,
552
- ...o.add_params
446
+ ...U.value,
447
+ ...l.add_params
553
448
  },
554
- retry: o.retry_attempts,
555
- retryDelay: o.retry_delay,
449
+ retry: l.retry_attempts,
450
+ retryDelay: l.retry_delay,
556
451
  paramsReactives: !1,
557
452
  immediate: !1
558
- }, o.fetch_name), se = V(() => {
559
- let u = [1];
560
- return o.list_filter.length > 0 && u.push(2), u;
561
- }), K = V(() => ({
562
- [o.page_param_name]: _.value.current_page + 1,
563
- [o.page_size_param_name]: _.value.limit_per_page,
564
- [o.search_param_name]: _.value.search || "",
565
- [o.filter_param_name]: _.value.filter || ""
566
- })), re = V(() => ne.value || c.value), I = (u) => {
567
- const a = o.item_key;
568
- return w.value.some((l) => l[a] === u[a]);
569
- }, W = V(() => {
570
- if (!g.value.length) return !1;
571
- const u = g.value.filter((a) => I(a)).length;
572
- return u === 0 ? !1 : u === g.value.length ? !0 : "indeterminate";
573
- }), oe = V(() => w.value.length > 0);
574
- L([W, f], ([u]) => {
575
- f.value && (u === "indeterminate" ? (console.log("entrei no indeterminate"), f.value.checked = !1, f.value.indeterminate = !0) : (f.value.checked = u, f.value.indeterminate = !1));
453
+ }, l.fetch_name), oe = T(() => {
454
+ let i = [1];
455
+ return l.list_filter.length > 0 && i.push(2), i;
456
+ }), U = T(() => ({
457
+ [l.page_param_name]: p.value.current_page + 1,
458
+ [l.page_size_param_name]: p.value.limit_per_page,
459
+ [l.search_param_name]: p.value.search || "",
460
+ [l.filter_param_name]: p.value.filter || ""
461
+ })), ie = T(() => le.value || x.value), I = (i) => {
462
+ const t = l.item_key;
463
+ return m.value.some((r) => r[t] === i[t]);
464
+ }, G = T(() => {
465
+ if (!c.value.length) return !1;
466
+ const i = c.value.filter((t) => I(t)).length;
467
+ return i === 0 ? !1 : i === c.value.length ? !0 : "indeterminate";
468
+ }), ue = T(() => m.value.length > 0);
469
+ q([G, h], ([i]) => {
470
+ h.value && (i === "indeterminate" ? (console.log("entrei no indeterminate"), h.value.checked = !1, h.value.indeterminate = !0) : (h.value.checked = i, h.value.indeterminate = !1));
576
471
  }, {
577
472
  immediate: !0,
578
473
  flush: "post"
579
- }), L(te, (u) => {
580
- u ? (g.value = u[o.data_key] || [], j.value = u[o.total_key] || 0, _.value.count = j.value) : (g.value = [], j.value = 0);
474
+ }), q(B, (i) => {
475
+ i ? (c.value = i[l.data_key] || [], $.value = i[l.total_key] || 0, p.value.count = $.value) : (c.value = [], $.value = 0);
581
476
  }, { immediate: !0 });
582
- function le() {
583
- const u = g.value;
584
- if (!u.length) return;
585
- const a = W.value;
586
- if (a === !0 || a === "indeterminate") {
587
- const l = u.map((s) => s[o.item_key]);
588
- w.value = w.value.filter(
589
- (s) => !l.includes(s[o.item_key])
477
+ function de() {
478
+ const i = c.value;
479
+ if (!i.length) return;
480
+ const t = G.value;
481
+ if (t === !0 || t === "indeterminate") {
482
+ const r = i.map((e) => e[l.item_key]);
483
+ m.value = m.value.filter(
484
+ (e) => !r.includes(e[l.item_key])
590
485
  );
591
486
  } else
592
- u.forEach((l) => {
593
- I(l) || w.value.push(l);
487
+ i.forEach((r) => {
488
+ I(r) || m.value.push(r);
594
489
  });
595
490
  }
596
- function ie(u) {
597
- const a = o.item_key, l = w.value.findIndex((s) => s[a] === u[a]);
598
- l > -1 ? w.value.splice(l, 1) : w.value.push(u);
491
+ function ce(i) {
492
+ const t = l.item_key, r = m.value.findIndex((e) => e[t] === i[t]);
493
+ r > -1 ? m.value.splice(r, 1) : m.value.push(i);
599
494
  }
600
- function ue(u) {
601
- C.value.push(u);
495
+ function pe(i) {
496
+ k.value.push(i);
602
497
  }
603
- he(ee, { addColumn: ue });
604
- function E() {
605
- i.value && clearTimeout(i.value), c.value = !0, i.value = setTimeout(() => {
606
- c.value = !1;
607
- }, o.min_loading_delay), ae();
498
+ ke(se, { addColumn: pe });
499
+ function L() {
500
+ H.value && clearTimeout(H.value), x.value = !0, H.value = setTimeout(() => {
501
+ x.value = !1;
502
+ }, l.min_loading_delay), re();
608
503
  }
609
- function de() {
610
- _.value.current_page = 0, E();
504
+ function _e() {
505
+ p.value.current_page = 0, L();
611
506
  }
612
- const pe = (u) => {
613
- const a = u.target, l = parseInt(a.value, 10);
614
- l > 0 ? (p.value = l, _.value.limit_per_page = l, _.value.current_page = 0, E()) : p.value = _.value.limit_per_page;
507
+ const J = (i) => {
508
+ const t = i.target, r = parseInt(t.value, 10);
509
+ r > 0 ? (d.value = r, p.value.limit_per_page = r, p.value.current_page = 0, L()) : d.value = p.value.limit_per_page;
615
510
  };
616
- function A(u, a, l = null) {
617
- if (!u) return a;
618
- const s = u.split(".");
619
- let N = a;
620
- for (const U of s)
621
- if (N && typeof N == "object" && U in N)
622
- N = N[U];
623
- else
624
- throw new Error(`Caminho inválido ou valor nulo em: ${u} na parte ${U}`);
625
- return l && (N = l(N)), N;
511
+ function D(i, t, r = null) {
512
+ if (!i) return t;
513
+ const e = i.split(".");
514
+ let S = t;
515
+ for (const Y of e)
516
+ S && typeof S == "object" && Y in S ? S = S[Y] : console.error(`Caminho inválido ou valor nulo em: ${i} na parte ${Y}`);
517
+ return r && (S = r(S)), S;
626
518
  }
627
- function ce(u, a) {
628
- return a && typeof a == "number" && a > 0 && typeof u == "string" && u.length > a ? u.substring(0, a) + "..." : u;
519
+ function me(i, t) {
520
+ return t && typeof t == "number" && t > 0 && typeof i == "string" && i.length > t ? i.substring(0, t) + "..." : i;
629
521
  }
630
- return d({
631
- execute: E,
632
- pagination: _,
633
- default_params: K,
634
- selected_items: w,
635
- atLeastOneSelected: oe
636
- }), Q(() => {
637
- ye(() => {
638
- E();
522
+ return u({
523
+ execute: L,
524
+ pagination: p,
525
+ default_params: U,
526
+ selected_items: m,
527
+ atLeastOneSelected: ue
528
+ }), te(() => {
529
+ be(() => {
530
+ L();
639
531
  });
640
- }), (u, a) => (e(), n("div", null, [
641
- t("div", {
642
- class: m(["", o.class_container])
532
+ }), (i, t) => (n(), a("div", null, [
533
+ s("div", {
534
+ class: _(["", l.class_container])
643
535
  }, [
644
- Y(u.$slots, "default", {}, void 0, !0),
645
- t("div", {
646
- class: m(["", o.class_content])
536
+ O(i.$slots, "default", {}, void 0, !0),
537
+ s("div", {
538
+ class: _(["", l.class_content])
647
539
  }, [
648
- t("div", Ge, [
649
- t("div", Je, [
650
- a[4] || (a[4] = D(" Mostrar ", -1)),
651
- t("div", Qe, [
652
- Z(t("input", {
653
- class: "form-control form-control-sm",
654
- onChange: pe,
655
- "onUpdate:modelValue": a[0] || (a[0] = (l) => p.value = l),
656
- min: "1",
657
- size: "3",
658
- "aria-label": "Número de nóticias por página"
659
- }, null, 544), [
660
- [R, p.value]
661
- ])
662
- ]),
663
- a[5] || (a[5] = D(" notícias ", -1))
664
- ]),
665
- Y(u.$slots, "fieldMiddle", {}, void 0, !0),
666
- G(Xe, {
667
- search: _.value.search,
668
- "onUpdate:search": a[1] || (a[1] = (l) => _.value.search = l),
669
- filter: _.value.filter,
670
- "onUpdate:filter": a[2] || (a[2] = (l) => _.value.filter = l),
671
- list_filter: o.list_filter,
672
- item_use: se.value,
673
- onSearch: de
540
+ s("div", Ye, [
541
+ O(i.$slots, "pageSize", {
542
+ changePageSize: J,
543
+ page_size: d.value
544
+ }, () => [
545
+ s("div", Xe, [
546
+ N(v(l.first_text_page_size) + " ", 1),
547
+ s("div", We, [
548
+ ne(s("input", {
549
+ class: "form-control form-control-sm",
550
+ onChange: J,
551
+ "onUpdate:modelValue": t[0] || (t[0] = (r) => d.value = r),
552
+ min: "1",
553
+ size: "3",
554
+ "aria-label": "Número de nóticias por página"
555
+ }, null, 544), [
556
+ [ae, d.value]
557
+ ])
558
+ ]),
559
+ N(" " + v(l.second_text_page_size), 1)
560
+ ])
561
+ ], !0),
562
+ O(i.$slots, "fieldMiddle", {}, void 0, !0),
563
+ Q(Ke, {
564
+ search: p.value.search,
565
+ "onUpdate:search": t[1] || (t[1] = (r) => p.value.search = r),
566
+ filter: p.value.filter,
567
+ "onUpdate:filter": t[2] || (t[2] = (r) => p.value.filter = r),
568
+ list_filter: l.list_filter,
569
+ item_use: oe.value,
570
+ onSearch: _e
674
571
  }, null, 8, ["search", "filter", "list_filter", "item_use"])
675
572
  ]),
676
- o.use_checkbox && w.value.length > 0 ? (e(), n("div", Ze, [
677
- t("h4", Re, [
678
- a[6] || (a[6] = t("strong", null, "Itens Selecionados:", -1)),
679
- D(" " + v(w.value.length), 1)
573
+ l.use_checkbox && m.value.length > 0 ? (n(), a("div", Ge, [
574
+ s("h4", Je, [
575
+ t[4] || (t[4] = s("strong", null, "Itens Selecionados:", -1)),
576
+ N(" " + v(m.value.length), 1)
680
577
  ]),
681
- t("button", {
578
+ s("button", {
682
579
  class: "btn btn-outline-danger ms-3 bold",
683
- onClick: a[3] || (a[3] = (l) => w.value = [])
580
+ onClick: t[3] || (t[3] = (r) => m.value = [])
684
581
  }, "Limpar Seleção")
685
- ])) : k("", !0),
686
- re.value ? (e(), n(b, { key: 1 }, [
687
- o.custom_loading ? (e(), F(J(o.custom_loading), { key: 0 })) : (e(), n("table", {
582
+ ])) : b("", !0),
583
+ ie.value ? (n(), a(M, { key: 1 }, [
584
+ l.custom_loading ? (n(), X(Z(l.custom_loading), { key: 0 })) : (n(), a("table", {
688
585
  key: 1,
689
- class: m(["table table-vcenter table-selectable", o.class_table])
586
+ class: _(["table table-vcenter table-selectable", l.class_table])
690
587
  }, [
691
- t("thead", null, [
692
- t("tr", null, [
693
- (e(!0), n(b, null, P(C.value, (l) => (e(), n("th", {
694
- key: l.field || l.header,
695
- class: m(l.class_column)
696
- }, v(l.header), 3))), 128))
588
+ s("thead", null, [
589
+ s("tr", null, [
590
+ (n(!0), a(M, null, z(k.value, (r) => (n(), a("th", {
591
+ key: r.field || r.header,
592
+ class: _(r.class_column)
593
+ }, v(r.header), 3))), 128))
697
594
  ])
698
595
  ]),
699
- t("tbody", null, [
700
- o.type_loading === "placeholder" ? (e(!0), n(b, { key: 0 }, P(p.value, (l) => (e(), n("tr", {
701
- key: "placeholder-" + l,
596
+ s("tbody", null, [
597
+ l.type_loading === "placeholder" ? (n(!0), a(M, { key: 0 }, z(d.value, (r) => (n(), a("tr", {
598
+ key: "placeholder-" + r,
702
599
  class: "placeholder-glow"
703
600
  }, [
704
- (e(!0), n(b, null, P(C.value, (s) => (e(), n("td", {
705
- key: s.field || s.header,
706
- class: m(s.class_row)
601
+ (n(!0), a(M, null, z(k.value, (e) => (n(), a("td", {
602
+ key: e.field || e.header,
603
+ class: _(e.class_row)
707
604
  }, [
708
- s.bodySlot ? (e(), n("span", et, [...a[7] || (a[7] = [
709
- t("span", { class: "placeholder col-8" }, null, -1)
710
- ])])) : s.type === "text" ? (e(), n("span", {
605
+ e.bodySlot ? (n(), a("span", Qe, [...t[5] || (t[5] = [
606
+ s("span", { class: "placeholder col-8" }, null, -1)
607
+ ])])) : e.type === "text" ? (n(), a("span", {
711
608
  key: 1,
712
- class: m(s.class_item)
713
- }, [...a[8] || (a[8] = [
714
- t("span", { class: "placeholder col-8" }, null, -1)
715
- ])], 2)) : s.type === "date" ? (e(), n("span", tt, [...a[9] || (a[9] = [
716
- t("span", { class: "placeholder col-9" }, null, -1)
717
- ])])) : s.type === "html" ? (e(), n("div", {
609
+ class: _(e.class_item)
610
+ }, [...t[6] || (t[6] = [
611
+ s("span", { class: "placeholder col-8" }, null, -1)
612
+ ])], 2)) : e.type === "date" ? (n(), a("span", Ze, [...t[7] || (t[7] = [
613
+ s("span", { class: "placeholder col-9" }, null, -1)
614
+ ])])) : e.type === "html" ? (n(), a("div", {
718
615
  key: 3,
719
- class: m(s.class_item)
720
- }, [...a[10] || (a[10] = [
721
- t("div", { class: "placeholder col-12" }, null, -1)
722
- ])], 2)) : s.type === "img" ? (e(), n("div", {
616
+ class: _(e.class_item)
617
+ }, [...t[8] || (t[8] = [
618
+ s("div", { class: "placeholder col-12" }, null, -1)
619
+ ])], 2)) : e.type === "img" ? (n(), a("div", {
723
620
  key: 4,
724
- class: m(s.class_item)
725
- }, [...a[11] || (a[11] = [
726
- t("div", { class: "placeholder placeholder-img" }, null, -1)
727
- ])], 2)) : (e(), n("span", nt, [
728
- a[12] || (a[12] = D("tipo ", -1)),
729
- t("span", at, v(s.type), 1),
730
- a[13] || (a[13] = D(" não suportado ", -1))
621
+ class: _(e.class_item)
622
+ }, [...t[9] || (t[9] = [
623
+ s("div", { class: "placeholder placeholder-img" }, null, -1)
624
+ ])], 2)) : (n(), a("span", Re, [
625
+ t[10] || (t[10] = N("tipo ", -1)),
626
+ s("span", et, v(e.type), 1),
627
+ t[11] || (t[11] = N(" não suportado ", -1))
731
628
  ]))
732
629
  ], 2))), 128))
733
- ]))), 128)) : o.type_loading === "spiner-table" ? (e(!0), n(b, { key: 1 }, P(p.value, (l) => (e(), n("tr", {
734
- key: "placeholder-" + l
630
+ ]))), 128)) : l.type_loading === "spiner-table" ? (n(!0), a(M, { key: 1 }, z(d.value, (r) => (n(), a("tr", {
631
+ key: "placeholder-" + r
735
632
  }, [
736
- (e(!0), n(b, null, P(C.value, (s) => (e(), n("td", {
737
- key: s.field || s.header,
738
- class: m(s.class_row)
633
+ (n(!0), a(M, null, z(k.value, (e) => (n(), a("td", {
634
+ key: e.field || e.header,
635
+ class: _(e.class_row)
739
636
  }, [
740
- s.bodySlot ? (e(), n("span", st, [...a[14] || (a[14] = [
741
- t("span", {
637
+ e.bodySlot ? (n(), a("span", tt, [...t[12] || (t[12] = [
638
+ s("span", {
742
639
  class: "spinner-border spinner-border-sm",
743
640
  role: "status",
744
641
  "aria-hidden": "true"
745
642
  }, null, -1)
746
- ])])) : s.type === "text" ? (e(), n("span", {
643
+ ])])) : e.type === "text" ? (n(), a("span", {
747
644
  key: 1,
748
- class: m(s.class_item)
749
- }, [...a[15] || (a[15] = [
750
- t("span", {
645
+ class: _(e.class_item)
646
+ }, [...t[13] || (t[13] = [
647
+ s("span", {
751
648
  class: "spinner-border spinner-border-sm",
752
649
  role: "status",
753
650
  "aria-hidden": "true"
754
651
  }, null, -1)
755
- ])], 2)) : s.type === "date" ? (e(), n("span", rt, [...a[16] || (a[16] = [
756
- t("span", {
652
+ ])], 2)) : e.type === "date" ? (n(), a("span", nt, [...t[14] || (t[14] = [
653
+ s("span", {
757
654
  class: "spinner-border spinner-border-sm",
758
655
  role: "status",
759
656
  "aria-hidden": "true"
760
657
  }, null, -1)
761
- ])])) : s.type === "html" ? (e(), n("div", {
658
+ ])])) : e.type === "html" ? (n(), a("div", {
762
659
  key: 3,
763
- class: m(s.class_item)
764
- }, [...a[17] || (a[17] = [
765
- t("span", {
660
+ class: _(e.class_item)
661
+ }, [...t[15] || (t[15] = [
662
+ s("span", {
766
663
  class: "spinner-border spinner-border-sm",
767
664
  role: "status",
768
665
  "aria-hidden": "true"
769
666
  }, null, -1)
770
- ])], 2)) : s.type === "img" ? (e(), n("div", {
667
+ ])], 2)) : e.type === "img" ? (n(), a("div", {
771
668
  key: 4,
772
- class: m(["", s.class_item])
773
- }, [...a[18] || (a[18] = [
774
- t("span", { class: "placeholder-img d-flex justify-content-center align-items-center" }, [
775
- t("span", {
669
+ class: _(["", e.class_item])
670
+ }, [...t[16] || (t[16] = [
671
+ s("span", { class: "placeholder-img d-flex justify-content-center align-items-center" }, [
672
+ s("span", {
776
673
  class: "spinner-border spinner-border-sm",
777
674
  role: "status",
778
675
  "aria-hidden": "true"
779
676
  })
780
677
  ], -1)
781
- ])], 2)) : (e(), n("span", ot, [
782
- a[19] || (a[19] = D("tipo ", -1)),
783
- t("span", lt, v(s.type), 1),
784
- a[20] || (a[20] = D(" não suportado ", -1))
678
+ ])], 2)) : (n(), a("span", at, [
679
+ t[17] || (t[17] = N("tipo ", -1)),
680
+ s("span", st, v(e.type), 1),
681
+ t[18] || (t[18] = N(" não suportado ", -1))
785
682
  ]))
786
683
  ], 2))), 128))
787
- ]))), 128)) : o.type_loading === "spiner" ? (e(!0), n(b, { key: 2 }, P(p.value, (l) => (e(), n("tr", { key: l }, [
788
- t("td", {
789
- colspan: C.value.length,
684
+ ]))), 128)) : l.type_loading === "spiner" ? (n(!0), a(M, { key: 2 }, z(d.value, (r) => (n(), a("tr", { key: r }, [
685
+ s("td", {
686
+ colspan: k.value.length,
790
687
  class: "text-center p-0",
791
688
  style: { "border-bottom": "none" }
792
689
  }, [
793
- l === Math.floor(p.value / 2) + 1 ? (e(), n("div", ut, [...a[21] || (a[21] = [
794
- t("div", {
690
+ r === Math.floor(d.value / 2) + 1 ? (n(), a("div", rt, [...t[19] || (t[19] = [
691
+ s("div", {
795
692
  class: "spinner-border",
796
693
  style: { width: "3rem", height: "3rem" },
797
694
  role: "status"
798
695
  }, null, -1),
799
- t("span", { class: "mt-2" }, "Carregando...", -1)
800
- ])])) : (e(), n("div", dt))
801
- ], 8, it)
802
- ]))), 128)) : k("", !0)
696
+ s("span", { class: "mt-2" }, "Carregando...", -1)
697
+ ])])) : (n(), a("div", ot))
698
+ ], 8, lt)
699
+ ]))), 128)) : b("", !0)
803
700
  ])
804
701
  ], 2)),
805
- $(H) && $(H).current > 1 ? (e(), n("div", pt, " A conexão falhou. Tentando novamente... (Tentativa " + v($(H).current) + " de " + v($(H).total) + ") ", 1)) : k("", !0)
806
- ], 64)) : $(q) ? (e(), n("div", ct, [
807
- a[22] || (a[22] = t("h4", { class: "text-danger" }, "Ocorreu um Erro", -1)),
808
- $(H) ? (e(), n("p", gt, " Não foi possível carregar os dados após " + v($(H).total) + " tentativa(s). ", 1)) : (e(), n("p", mt, " Não foi possível carregar os dados. Verifique sua conexão. ")),
809
- t("button", {
702
+ w(V) && w(V).current > 1 ? (n(), a("div", it, " A conexão falhou. Tentando novamente... (Tentativa " + v(w(V).current) + " de " + v(w(V).total) + ") ", 1)) : b("", !0)
703
+ ], 64)) : w(K) ? (n(), a("div", ut, [
704
+ t[20] || (t[20] = s("h4", { class: "text-danger" }, "Ocorreu um Erro", -1)),
705
+ w(V) ? (n(), a("p", dt, " Não foi possível carregar os dados após " + v(w(V).total) + " tentativa(s). ", 1)) : (n(), a("p", ct, " Não foi possível carregar os dados. Verifique sua conexão. ")),
706
+ s("button", {
810
707
  class: "btn btn-primary mt-2",
811
- onClick: E
708
+ onClick: L
812
709
  }, " Tentar Novamente ")
813
- ])) : g.value ? (e(), n("div", ft, [
814
- g.value.length > 0 ? (e(), n("div", _t, [
815
- t("table", {
816
- class: m(["table table-vcenter table-selectable", o.class_table])
710
+ ])) : c.value ? (n(), a("div", pt, [
711
+ c.value.length > 0 ? (n(), a("div", _t, [
712
+ s("table", {
713
+ class: _(["table table-vcenter table-selectable", l.class_table])
817
714
  }, [
818
- t("thead", null, [
819
- t("tr", null, [
820
- o.use_checkbox ? (e(), n("th", vt, [
821
- t("input", {
715
+ s("thead", null, [
716
+ s("tr", null, [
717
+ l.use_checkbox ? (n(), a("th", mt, [
718
+ s("input", {
822
719
  class: "form-check-input m-0",
823
720
  type: "checkbox",
824
721
  ref_key: "selectAllCheckbox",
825
- ref: f,
826
- onChange: le,
722
+ ref: h,
723
+ onChange: de,
827
724
  "aria-label": "Selecionar todos os itens na página"
828
725
  }, null, 544)
829
- ])) : k("", !0),
830
- (e(!0), n(b, null, P(C.value, (l) => (e(), n("th", {
831
- key: l.field || l.header,
832
- class: m(l.class_column)
833
- }, v(l.header), 3))), 128))
726
+ ])) : b("", !0),
727
+ (n(!0), a(M, null, z(k.value, (r) => (n(), a("th", {
728
+ key: r.field || r.header,
729
+ class: _(r.class_column)
730
+ }, v(r.header), 3))), 128))
834
731
  ])
835
732
  ]),
836
- t("tbody", null, [
837
- (e(!0), n(b, null, P(g.value, (l) => (e(), n("tr", {
838
- key: l[o.item_key]
733
+ s("tbody", null, [
734
+ (n(!0), a(M, null, z(c.value, (r) => (n(), a("tr", {
735
+ key: r[l.item_key]
839
736
  }, [
840
- o.use_checkbox ? (e(), n("td", ht, [
841
- t("input", {
737
+ l.use_checkbox ? (n(), a("td", ft, [
738
+ s("input", {
842
739
  class: "form-check-input m-0",
843
740
  type: "checkbox",
844
- checked: I(l),
845
- onChange: (s) => ie(l),
741
+ checked: I(r),
742
+ onChange: (e) => ce(r),
846
743
  "aria-label": "Selecionar este item"
847
- }, null, 40, yt)
848
- ])) : k("", !0),
849
- (e(!0), n(b, null, P(C.value, (s) => (e(), n("td", {
850
- key: s.field || s.header,
851
- class: m(s.class_row)
744
+ }, null, 40, vt)
745
+ ])) : b("", !0),
746
+ (n(!0), a(M, null, z(k.value, (e) => (n(), a("td", {
747
+ key: e.field || e.header,
748
+ class: _(e.class_row)
852
749
  }, [
853
- s.bodySlot ? (e(), F(J(s.bodySlot), {
750
+ e.bodySlot ? (n(), X(Z(e.bodySlot), {
854
751
  key: 0,
855
- item: l,
856
- "is-selected": I(l)
857
- }, null, 8, ["item", "is-selected"])) : s.type === "text" ? (e(), n("span", {
752
+ item: r,
753
+ "is-selected": I(r)
754
+ }, null, 8, ["item", "is-selected"])) : e.type === "text" ? (n(), a("span", {
858
755
  key: 1,
859
- class: m(s.class_item)
860
- }, v(ce(A(s.field, l, s.transform_function), s.limite_text ?? null)), 3)) : s.type === "date" ? (e(), n("span", kt, [
861
- s.format === "complete" ? (e(), n("span", bt, v(new Date(A(s.field, l)).toLocaleString()), 1)) : k("", !0),
862
- s.format === "simple" ? (e(), n("span", wt, v(new Date(A(
863
- s.field,
864
- l
865
- )).toLocaleDateString()), 1)) : k("", !0)
866
- ])) : s.type === "html" ? (e(), n("div", {
756
+ onClick: (S) => e.click ? e.click(r) : null,
757
+ class: _(e.class_item + (e.click ? " cursor-pointer" : ""))
758
+ }, v(me(D(e.field, r, e.transform_function), e.limite_text ?? null)), 11, gt)) : e.type === "date" ? (n(), a("span", {
759
+ key: 2,
760
+ onClick: (S) => e.click ? e.click(r) : null,
761
+ class: _(e.class_item + (e.click ? " cursor-pointer" : ""))
762
+ }, [
763
+ e.format === "complete" ? (n(), a("span", yt, v(new Date(D(e.field, r)).toLocaleString()), 1)) : b("", !0),
764
+ e.format === "simple" ? (n(), a("span", kt, v(new Date(D(
765
+ e.field,
766
+ r
767
+ )).toLocaleDateString()), 1)) : b("", !0)
768
+ ], 10, ht)) : e.type === "html" ? (n(), a("div", {
867
769
  key: 3,
868
- class: m(s.class_item),
869
- innerHTML: A(s.field, l)
870
- }, null, 10, xt)) : s.type === "img" ? (e(), n("div", {
770
+ onClick: (S) => e.click ? e.click(r) : null,
771
+ class: _(e.class_item + (e.click ? " cursor-pointer" : "")),
772
+ innerHTML: D(e.field, r)
773
+ }, null, 10, bt)) : e.type === "img" ? (n(), a("div", {
871
774
  key: 4,
872
- class: m(s.class_item)
775
+ onClick: (S) => e.click ? e.click(r) : null,
776
+ class: _(e.class_item + (e.click ? " cursor-pointer" : ""))
873
777
  }, [
874
- A(s.field, l) ? (e(), n("div", ke({
778
+ D(e.field, r) ? (n(), a("div", xe({
875
779
  key: 0,
876
780
  ref_for: !0
877
- }, s.deactivate_img_preview ? {
781
+ }, e.deactivate_img_preview ? {
878
782
  class: "container-img"
879
783
  } : {
880
- onMouseover: (N) => $(M)(N, A(s.field, l)),
881
- onMousemove: $(B),
882
- onMouseleave: $(z),
784
+ onMouseover: (S) => w(C)(S, D(e.field, r)),
785
+ onMousemove: w(A),
786
+ onMouseleave: w(E),
883
787
  class: "container-img container-img-preview"
884
788
  }), [
885
- t("img", {
789
+ s("img", {
886
790
  class: "img-tamanho",
887
- src: A(s.field, l)
888
- }, null, 8, Ct),
889
- t("img", {
791
+ src: D(e.field, r)
792
+ }, null, 8, wt),
793
+ s("img", {
890
794
  class: "img-tamanho-cover",
891
- src: A(s.field, l)
892
- }, null, 8, $t),
893
- a[23] || (a[23] = t("div", { class: "bg-img" }, null, -1))
894
- ], 16)) : k("", !0)
895
- ], 2)) : (e(), n("span", Mt, [
896
- a[24] || (a[24] = D("tipo ", -1)),
897
- t("span", St, v(s.type), 1),
898
- a[25] || (a[25] = D(" não suportado", -1))
795
+ src: D(e.field, r)
796
+ }, null, 8, Ct),
797
+ t[21] || (t[21] = s("div", { class: "bg-img" }, null, -1))
798
+ ], 16)) : b("", !0)
799
+ ], 10, xt)) : (n(), a("span", $t, [
800
+ t[22] || (t[22] = N("tipo ", -1)),
801
+ s("span", St, v(e.type), 1),
802
+ t[23] || (t[23] = N(" não suportado", -1))
899
803
  ]))
900
804
  ], 2))), 128))
901
805
  ]))), 128))
902
806
  ])
903
807
  ], 2)
904
- ])) : (e(), n("div", Pt, [...a[26] || (a[26] = [
905
- t("p", { class: "m-0" }, "Nenhum item encontrado.", -1)
808
+ ])) : (n(), a("div", Mt, [...t[24] || (t[24] = [
809
+ s("p", { class: "m-0" }, "Nenhum item encontrado.", -1)
906
810
  ])]))
907
- ])) : k("", !0)
811
+ ])) : b("", !0)
908
812
  ], 2)
909
813
  ], 2),
910
- Y(u.$slots, "pagination", {
911
- pagination: _.value,
912
- tradePage: E,
913
- error: $(q)
814
+ O(i.$slots, "pagination", {
815
+ pagination: p.value,
816
+ tradePage: L,
817
+ error: w(K)
914
818
  }, () => [
915
- !$(q) && _.value.count > 0 ? (e(), n("div", {
819
+ !w(K) && p.value.count > 0 ? (n(), a("div", {
916
820
  key: 0,
917
- class: m(["mt-3 px-3", o.class_pagination])
821
+ class: _(["mt-3 px-3", l.class_pagination])
918
822
  }, [
919
- G(Ie, {
823
+ Q(Le, {
920
824
  filtering: !0,
921
- pagination: _.value,
922
- onTradePage: E
825
+ pagination: p.value,
826
+ onTradePage: L
923
827
  }, null, 8, ["pagination"])
924
- ], 2)) : k("", !0)
828
+ ], 2)) : b("", !0)
925
829
  ], !0),
926
- $(r) ? (e(), n("div", {
830
+ w(o) ? (n(), a("div", {
927
831
  key: 0,
928
832
  class: "image-preview-container",
929
- style: be($(h))
833
+ style: we(w(g))
930
834
  }, [
931
- t("img", {
932
- src: $(y),
835
+ s("img", {
836
+ src: w(f),
933
837
  alt: "Preview",
934
838
  class: "image-preview-large"
935
- }, null, 8, zt)
936
- ], 4)) : k("", !0)
839
+ }, null, 8, Pt)
840
+ ], 4)) : b("", !0)
937
841
  ]));
938
842
  }
939
- }), Vt = /* @__PURE__ */ X(Nt, [["__scopeId", "data-v-5c5c2fc5"]]);
843
+ }), At = /* @__PURE__ */ W(zt, [["__scopeId", "data-v-693cabb6"]]);
940
844
  export {
941
- Dt as VColumn,
942
- Vt as VDataTable
845
+ Nt as VColumn,
846
+ At as VDataTable
943
847
  };