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.
- package/dist/v-sistec-features.css +1 -1
- package/dist/vDataTable.js +511 -607
- package/package.json +1 -1
- package/src/DatatableVue/components/PaginationDatatable.vue +157 -268
- package/src/DatatableVue/components/VColumn.vue +3 -0
- package/src/DatatableVue/components/VDataTable.vue +47 -35
- package/src/DatatableVue/keys.ts +1 -0
package/dist/vDataTable.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const
|
|
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(
|
|
17
|
-
const
|
|
18
|
-
if (!
|
|
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
|
|
21
|
-
return
|
|
22
|
-
if (
|
|
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 (!
|
|
25
|
+
if (!u.header)
|
|
25
26
|
throw new Error('A propriedade "header" é obrigatória em VColumn.');
|
|
26
|
-
if (
|
|
27
|
-
throw new Error(`O tipo "${
|
|
28
|
-
if (
|
|
29
|
-
if (
|
|
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
|
|
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(
|
|
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
|
-
|
|
37
|
-
field:
|
|
38
|
-
header:
|
|
39
|
-
type:
|
|
40
|
-
class_column:
|
|
41
|
-
class_row:
|
|
42
|
-
class_item:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
...
|
|
47
|
-
...
|
|
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
|
-
}), (
|
|
51
|
+
}), (C, A) => null;
|
|
50
52
|
}
|
|
51
|
-
}),
|
|
53
|
+
}), Ce = {
|
|
52
54
|
key: 0,
|
|
53
55
|
class: "d-flex align-items-center justify-content-between w-100"
|
|
54
|
-
},
|
|
56
|
+
}, $e = {
|
|
55
57
|
key: 0,
|
|
56
58
|
class: "d-flex align-items-center p-2 gap-2"
|
|
57
|
-
},
|
|
58
|
-
key:
|
|
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
|
-
},
|
|
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(
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
},
|
|
74
|
-
|
|
75
|
-
},
|
|
76
|
-
|
|
77
|
-
},
|
|
78
|
-
|
|
79
|
-
},
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
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:
|
|
98
|
-
disabled:
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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:
|
|
124
|
-
disabled:
|
|
125
|
-
|
|
126
|
-
|
|
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
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
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
|
-
|
|
211
|
-
|
|
212
|
-
onClick:
|
|
213
|
-
class: "btn btn-estilo",
|
|
214
|
-
disabled: !
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
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
|
-
])) :
|
|
264
|
-
])) :
|
|
156
|
+
])) : b("", !0)
|
|
157
|
+
])) : b("", !0);
|
|
265
158
|
}
|
|
266
|
-
}),
|
|
267
|
-
const
|
|
268
|
-
for (const [
|
|
269
|
-
|
|
270
|
-
return
|
|
271
|
-
},
|
|
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
|
-
},
|
|
170
|
+
}, Be = { class: "input-icon" }, Ie = {
|
|
278
171
|
key: 1,
|
|
279
172
|
class: "input-icon-addon"
|
|
280
|
-
},
|
|
173
|
+
}, Oe = {
|
|
281
174
|
key: 1,
|
|
282
175
|
class: "dropdown-menu"
|
|
283
|
-
},
|
|
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(
|
|
293
|
-
const
|
|
294
|
-
get: () =>
|
|
295
|
-
set: (
|
|
296
|
-
}),
|
|
297
|
-
get: () =>
|
|
298
|
-
set: (
|
|
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
|
-
|
|
301
|
-
|
|
302
|
-
}),
|
|
303
|
-
() =>
|
|
304
|
-
(
|
|
305
|
-
Array.isArray(
|
|
306
|
-
|
|
307
|
-
}),
|
|
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
|
|
312
|
-
|
|
204
|
+
function A(l) {
|
|
205
|
+
C.value === l ? C.value = "" : C.value = l;
|
|
313
206
|
}
|
|
314
|
-
function
|
|
315
|
-
|
|
207
|
+
function E() {
|
|
208
|
+
g.value = "", f("search");
|
|
316
209
|
}
|
|
317
|
-
return (
|
|
318
|
-
const
|
|
319
|
-
return
|
|
320
|
-
|
|
321
|
-
|
|
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
|
-
|
|
226
|
+
s("path", {
|
|
334
227
|
stroke: "none",
|
|
335
228
|
d: "M0 0h24v24H0z",
|
|
336
229
|
fill: "none"
|
|
337
230
|
}),
|
|
338
|
-
|
|
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
|
-
])])) :
|
|
341
|
-
|
|
342
|
-
|
|
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":
|
|
347
|
-
onKeyup:
|
|
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
|
-
[
|
|
243
|
+
[ae, g.value]
|
|
351
244
|
]),
|
|
352
|
-
|
|
245
|
+
g.value ? (n(), a("span", {
|
|
353
246
|
key: 0,
|
|
354
|
-
onClick:
|
|
247
|
+
onClick: d[2] || (d[2] = (c) => E()),
|
|
355
248
|
class: "inputClose",
|
|
356
249
|
title: "Limpar pesquisa"
|
|
357
|
-
}, [...
|
|
358
|
-
|
|
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
|
-
|
|
263
|
+
s("path", {
|
|
371
264
|
stroke: "none",
|
|
372
265
|
d: "M0 0h24v24H0z",
|
|
373
266
|
fill: "none"
|
|
374
267
|
}),
|
|
375
|
-
|
|
376
|
-
|
|
268
|
+
s("path", { d: "M18 6l-12 12" }),
|
|
269
|
+
s("path", { d: "M6 6l12 12" })
|
|
377
270
|
], -1)
|
|
378
|
-
])])) : (
|
|
379
|
-
|
|
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
|
-
|
|
284
|
+
s("path", {
|
|
392
285
|
stroke: "none",
|
|
393
286
|
d: "M0 0h24v24H0z",
|
|
394
287
|
fill: "none"
|
|
395
288
|
}),
|
|
396
|
-
|
|
397
|
-
|
|
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
|
-
|
|
402
|
-
(
|
|
403
|
-
"type" in
|
|
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:
|
|
298
|
+
to: c?.to,
|
|
406
299
|
class: "dropdown-item cursor-pointer"
|
|
407
300
|
}, {
|
|
408
|
-
default:
|
|
409
|
-
|
|
301
|
+
default: ye(() => [
|
|
302
|
+
N(v(c.text), 1)
|
|
410
303
|
]),
|
|
411
304
|
_: 2
|
|
412
|
-
}, 1032, ["to"])) : !("type" in
|
|
305
|
+
}, 1032, ["to"])) : !("type" in c) || c.type === 2 ? (n(), a("a", {
|
|
413
306
|
key: 1,
|
|
414
|
-
onClick:
|
|
415
|
-
class:
|
|
416
|
-
}, v(
|
|
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
|
-
])) :
|
|
311
|
+
])) : b("", !0)
|
|
419
312
|
]);
|
|
420
313
|
};
|
|
421
314
|
}
|
|
422
|
-
}),
|
|
423
|
-
function
|
|
424
|
-
const
|
|
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: `${
|
|
429
|
-
left: `${
|
|
321
|
+
top: `${f.value + 15}px`,
|
|
322
|
+
left: `${o.value + 15}px`
|
|
430
323
|
}));
|
|
431
|
-
function
|
|
432
|
-
const
|
|
433
|
-
let
|
|
434
|
-
|
|
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
|
|
437
|
-
|
|
329
|
+
function A(d, k) {
|
|
330
|
+
y.value = !0, u.value = k, C(d);
|
|
438
331
|
}
|
|
439
|
-
function
|
|
440
|
-
|
|
332
|
+
function E(d) {
|
|
333
|
+
y.value && C(d);
|
|
441
334
|
}
|
|
442
|
-
function
|
|
443
|
-
|
|
335
|
+
function l() {
|
|
336
|
+
y.value = !1;
|
|
444
337
|
}
|
|
445
338
|
return {
|
|
446
|
-
isHovering:
|
|
447
|
-
previewSrc:
|
|
448
|
-
previewStyle:
|
|
449
|
-
handleMouseOver:
|
|
450
|
-
handleMouseMove:
|
|
451
|
-
handleMouseLeave:
|
|
339
|
+
isHovering: y,
|
|
340
|
+
previewSrc: u,
|
|
341
|
+
previewStyle: g,
|
|
342
|
+
handleMouseOver: A,
|
|
343
|
+
handleMouseMove: E,
|
|
344
|
+
handleMouseLeave: l
|
|
452
345
|
};
|
|
453
346
|
}
|
|
454
|
-
const
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
361
|
+
}, ot = {
|
|
469
362
|
key: 1,
|
|
470
363
|
style: { height: "3rem" }
|
|
471
|
-
},
|
|
364
|
+
}, it = {
|
|
472
365
|
key: 2,
|
|
473
366
|
class: "p-3 text-center text-secondary"
|
|
474
|
-
},
|
|
367
|
+
}, ut = {
|
|
475
368
|
key: 2,
|
|
476
369
|
class: "feedback-container text-center"
|
|
477
|
-
},
|
|
370
|
+
}, dt = {
|
|
478
371
|
key: 0,
|
|
479
372
|
class: "text-secondary"
|
|
480
|
-
},
|
|
373
|
+
}, ct = {
|
|
481
374
|
key: 1,
|
|
482
375
|
class: "text-secondary"
|
|
483
|
-
},
|
|
376
|
+
}, pt = {
|
|
484
377
|
key: 3,
|
|
485
378
|
class: "table-responsive"
|
|
486
|
-
}, _t = { key: 0 },
|
|
379
|
+
}, _t = { key: 0 }, mt = {
|
|
487
380
|
key: 0,
|
|
488
381
|
class: "w-1"
|
|
489
|
-
},
|
|
382
|
+
}, ft = {
|
|
490
383
|
key: 0,
|
|
491
384
|
class: "w-1"
|
|
492
|
-
},
|
|
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" },
|
|
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
|
-
},
|
|
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(
|
|
420
|
+
setup(y, { expose: u }) {
|
|
526
421
|
const {
|
|
527
|
-
isHovering:
|
|
528
|
-
previewSrc:
|
|
529
|
-
previewStyle:
|
|
530
|
-
handleMouseOver:
|
|
531
|
-
handleMouseMove:
|
|
532
|
-
handleMouseLeave:
|
|
533
|
-
} =
|
|
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:
|
|
545
|
-
params: () =>
|
|
546
|
-
...
|
|
547
|
-
} :
|
|
548
|
-
...
|
|
549
|
-
...
|
|
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
|
-
...
|
|
552
|
-
...
|
|
446
|
+
...U.value,
|
|
447
|
+
...l.add_params
|
|
553
448
|
},
|
|
554
|
-
retry:
|
|
555
|
-
retryDelay:
|
|
449
|
+
retry: l.retry_attempts,
|
|
450
|
+
retryDelay: l.retry_delay,
|
|
556
451
|
paramsReactives: !1,
|
|
557
452
|
immediate: !1
|
|
558
|
-
},
|
|
559
|
-
let
|
|
560
|
-
return
|
|
561
|
-
}),
|
|
562
|
-
[
|
|
563
|
-
[
|
|
564
|
-
[
|
|
565
|
-
[
|
|
566
|
-
})),
|
|
567
|
-
const
|
|
568
|
-
return
|
|
569
|
-
},
|
|
570
|
-
if (!
|
|
571
|
-
const
|
|
572
|
-
return
|
|
573
|
-
}),
|
|
574
|
-
|
|
575
|
-
|
|
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
|
-
}),
|
|
580
|
-
|
|
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
|
|
583
|
-
const
|
|
584
|
-
if (!
|
|
585
|
-
const
|
|
586
|
-
if (
|
|
587
|
-
const
|
|
588
|
-
|
|
589
|
-
(
|
|
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
|
-
|
|
593
|
-
I(
|
|
487
|
+
i.forEach((r) => {
|
|
488
|
+
I(r) || m.value.push(r);
|
|
594
489
|
});
|
|
595
490
|
}
|
|
596
|
-
function
|
|
597
|
-
const
|
|
598
|
-
|
|
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
|
|
601
|
-
|
|
495
|
+
function pe(i) {
|
|
496
|
+
k.value.push(i);
|
|
602
497
|
}
|
|
603
|
-
|
|
604
|
-
function
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
},
|
|
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
|
|
610
|
-
|
|
504
|
+
function _e() {
|
|
505
|
+
p.value.current_page = 0, L();
|
|
611
506
|
}
|
|
612
|
-
const
|
|
613
|
-
const
|
|
614
|
-
|
|
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
|
|
617
|
-
if (!
|
|
618
|
-
const
|
|
619
|
-
let
|
|
620
|
-
for (const
|
|
621
|
-
|
|
622
|
-
|
|
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
|
|
628
|
-
return
|
|
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
|
|
631
|
-
execute:
|
|
632
|
-
pagination:
|
|
633
|
-
default_params:
|
|
634
|
-
selected_items:
|
|
635
|
-
atLeastOneSelected:
|
|
636
|
-
}),
|
|
637
|
-
|
|
638
|
-
|
|
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
|
-
}), (
|
|
641
|
-
|
|
642
|
-
class:
|
|
532
|
+
}), (i, t) => (n(), a("div", null, [
|
|
533
|
+
s("div", {
|
|
534
|
+
class: _(["", l.class_container])
|
|
643
535
|
}, [
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
class:
|
|
536
|
+
O(i.$slots, "default", {}, void 0, !0),
|
|
537
|
+
s("div", {
|
|
538
|
+
class: _(["", l.class_content])
|
|
647
539
|
}, [
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
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
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
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
|
-
|
|
578
|
+
s("button", {
|
|
682
579
|
class: "btn btn-outline-danger ms-3 bold",
|
|
683
|
-
onClick:
|
|
580
|
+
onClick: t[3] || (t[3] = (r) => m.value = [])
|
|
684
581
|
}, "Limpar Seleção")
|
|
685
|
-
])) :
|
|
686
|
-
|
|
687
|
-
|
|
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:
|
|
586
|
+
class: _(["table table-vcenter table-selectable", l.class_table])
|
|
690
587
|
}, [
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
(
|
|
694
|
-
key:
|
|
695
|
-
class:
|
|
696
|
-
}, v(
|
|
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
|
-
|
|
700
|
-
|
|
701
|
-
key: "placeholder-" +
|
|
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
|
-
(
|
|
705
|
-
key:
|
|
706
|
-
class:
|
|
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
|
-
|
|
709
|
-
|
|
710
|
-
])])) :
|
|
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:
|
|
713
|
-
}, [...
|
|
714
|
-
|
|
715
|
-
])], 2)) :
|
|
716
|
-
|
|
717
|
-
])])) :
|
|
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:
|
|
720
|
-
}, [...
|
|
721
|
-
|
|
722
|
-
])], 2)) :
|
|
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:
|
|
725
|
-
}, [...
|
|
726
|
-
|
|
727
|
-
])], 2)) : (
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
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)) :
|
|
734
|
-
key: "placeholder-" +
|
|
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
|
-
(
|
|
737
|
-
key:
|
|
738
|
-
class:
|
|
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
|
-
|
|
741
|
-
|
|
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
|
-
])])) :
|
|
643
|
+
])])) : e.type === "text" ? (n(), a("span", {
|
|
747
644
|
key: 1,
|
|
748
|
-
class:
|
|
749
|
-
}, [...
|
|
750
|
-
|
|
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)) :
|
|
756
|
-
|
|
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
|
-
])])) :
|
|
658
|
+
])])) : e.type === "html" ? (n(), a("div", {
|
|
762
659
|
key: 3,
|
|
763
|
-
class:
|
|
764
|
-
}, [...
|
|
765
|
-
|
|
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)) :
|
|
667
|
+
])], 2)) : e.type === "img" ? (n(), a("div", {
|
|
771
668
|
key: 4,
|
|
772
|
-
class:
|
|
773
|
-
}, [...
|
|
774
|
-
|
|
775
|
-
|
|
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)) : (
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
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)) :
|
|
788
|
-
|
|
789
|
-
colspan:
|
|
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
|
-
|
|
794
|
-
|
|
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
|
-
|
|
800
|
-
])])) : (
|
|
801
|
-
], 8,
|
|
802
|
-
]))), 128)) :
|
|
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
|
-
|
|
806
|
-
], 64)) :
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
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:
|
|
708
|
+
onClick: L
|
|
812
709
|
}, " Tentar Novamente ")
|
|
813
|
-
])) :
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
class:
|
|
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
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
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:
|
|
826
|
-
onChange:
|
|
722
|
+
ref: h,
|
|
723
|
+
onChange: de,
|
|
827
724
|
"aria-label": "Selecionar todos os itens na página"
|
|
828
725
|
}, null, 544)
|
|
829
|
-
])) :
|
|
830
|
-
(
|
|
831
|
-
key:
|
|
832
|
-
class:
|
|
833
|
-
}, v(
|
|
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
|
-
|
|
837
|
-
(
|
|
838
|
-
key: l
|
|
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
|
-
|
|
841
|
-
|
|
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(
|
|
845
|
-
onChange: (
|
|
741
|
+
checked: I(r),
|
|
742
|
+
onChange: (e) => ce(r),
|
|
846
743
|
"aria-label": "Selecionar este item"
|
|
847
|
-
}, null, 40,
|
|
848
|
-
])) :
|
|
849
|
-
(
|
|
850
|
-
key:
|
|
851
|
-
class:
|
|
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
|
-
|
|
750
|
+
e.bodySlot ? (n(), X(Z(e.bodySlot), {
|
|
854
751
|
key: 0,
|
|
855
|
-
item:
|
|
856
|
-
"is-selected": I(
|
|
857
|
-
}, null, 8, ["item", "is-selected"])) :
|
|
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
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
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
|
-
|
|
869
|
-
|
|
870
|
-
|
|
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
|
-
|
|
775
|
+
onClick: (S) => e.click ? e.click(r) : null,
|
|
776
|
+
class: _(e.class_item + (e.click ? " cursor-pointer" : ""))
|
|
873
777
|
}, [
|
|
874
|
-
|
|
778
|
+
D(e.field, r) ? (n(), a("div", xe({
|
|
875
779
|
key: 0,
|
|
876
780
|
ref_for: !0
|
|
877
|
-
},
|
|
781
|
+
}, e.deactivate_img_preview ? {
|
|
878
782
|
class: "container-img"
|
|
879
783
|
} : {
|
|
880
|
-
onMouseover: (
|
|
881
|
-
onMousemove:
|
|
882
|
-
onMouseleave:
|
|
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
|
-
|
|
789
|
+
s("img", {
|
|
886
790
|
class: "img-tamanho",
|
|
887
|
-
src:
|
|
888
|
-
}, null, 8,
|
|
889
|
-
|
|
791
|
+
src: D(e.field, r)
|
|
792
|
+
}, null, 8, wt),
|
|
793
|
+
s("img", {
|
|
890
794
|
class: "img-tamanho-cover",
|
|
891
|
-
src:
|
|
892
|
-
}, null, 8,
|
|
893
|
-
|
|
894
|
-
], 16)) :
|
|
895
|
-
],
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
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
|
-
])) : (
|
|
905
|
-
|
|
808
|
+
])) : (n(), a("div", Mt, [...t[24] || (t[24] = [
|
|
809
|
+
s("p", { class: "m-0" }, "Nenhum item encontrado.", -1)
|
|
906
810
|
])]))
|
|
907
|
-
])) :
|
|
811
|
+
])) : b("", !0)
|
|
908
812
|
], 2)
|
|
909
813
|
], 2),
|
|
910
|
-
|
|
911
|
-
pagination:
|
|
912
|
-
tradePage:
|
|
913
|
-
error:
|
|
814
|
+
O(i.$slots, "pagination", {
|
|
815
|
+
pagination: p.value,
|
|
816
|
+
tradePage: L,
|
|
817
|
+
error: w(K)
|
|
914
818
|
}, () => [
|
|
915
|
-
|
|
819
|
+
!w(K) && p.value.count > 0 ? (n(), a("div", {
|
|
916
820
|
key: 0,
|
|
917
|
-
class:
|
|
821
|
+
class: _(["mt-3 px-3", l.class_pagination])
|
|
918
822
|
}, [
|
|
919
|
-
|
|
823
|
+
Q(Le, {
|
|
920
824
|
filtering: !0,
|
|
921
|
-
pagination:
|
|
922
|
-
onTradePage:
|
|
825
|
+
pagination: p.value,
|
|
826
|
+
onTradePage: L
|
|
923
827
|
}, null, 8, ["pagination"])
|
|
924
|
-
], 2)) :
|
|
828
|
+
], 2)) : b("", !0)
|
|
925
829
|
], !0),
|
|
926
|
-
|
|
830
|
+
w(o) ? (n(), a("div", {
|
|
927
831
|
key: 0,
|
|
928
832
|
class: "image-preview-container",
|
|
929
|
-
style:
|
|
833
|
+
style: we(w(g))
|
|
930
834
|
}, [
|
|
931
|
-
|
|
932
|
-
src:
|
|
835
|
+
s("img", {
|
|
836
|
+
src: w(f),
|
|
933
837
|
alt: "Preview",
|
|
934
838
|
class: "image-preview-large"
|
|
935
|
-
}, null, 8,
|
|
936
|
-
], 4)) :
|
|
839
|
+
}, null, 8, Pt)
|
|
840
|
+
], 4)) : b("", !0)
|
|
937
841
|
]));
|
|
938
842
|
}
|
|
939
|
-
}),
|
|
843
|
+
}), At = /* @__PURE__ */ W(zt, [["__scopeId", "data-v-693cabb6"]]);
|
|
940
844
|
export {
|
|
941
|
-
|
|
942
|
-
|
|
845
|
+
Nt as VColumn,
|
|
846
|
+
At as VDataTable
|
|
943
847
|
};
|