v-sistec-features 1.2.5 → 1.3.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/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/v-sistec-features.css +1 -1
- package/dist/vDataPage.js +460 -0
- package/dist/vDataTable.js +170 -174
- package/package.json +8 -3
- package/src/DataPageVue/components/PaginationDatatable.vue +222 -0
- package/src/DataPageVue/components/VDataPage.vue +519 -0
- package/src/DataPageVue/index.ts +4 -0
- package/src/DatatableVue/components/VDataTable.vue +1 -1
package/dist/vDataTable.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { defineComponent as F, useSlots as he, inject as ye, onMounted as te, computed as N, createElementBlock as n, createCommentVNode as
|
|
2
|
-
|
|
1
|
+
import { defineComponent as F, useSlots as he, inject as ye, onMounted as te, computed as N, createElementBlock as n, createCommentVNode as k, openBlock as a, createElementVNode as s, toDisplayString as f, withModifiers as j, Fragment as S, renderList as T, normalizeClass as _, watch as O, resolveComponent as ke, withDirectives as ae, withKeys as be, vModelText as ne, createBlock as X, withCtx as xe, createTextVNode as D, ref as z, provide as we, readonly as Ce, nextTick as $e, renderSlot as q, createVNode as Q, resolveDynamicComponent as Z, unref as x, mergeProps as Me, normalizeStyle as Se } from "vue";
|
|
2
|
+
import { _ as W } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
3
|
+
const se = Symbol("v-datatable-key"), Ht = /* @__PURE__ */ F({
|
|
3
4
|
__name: "VColumn",
|
|
4
5
|
props: {
|
|
5
6
|
field: { default: null },
|
|
@@ -14,39 +15,39 @@ const se = Symbol("v-datatable-key"), Et = /* @__PURE__ */ F({
|
|
|
14
15
|
transform_function: { type: [Function, null], default: null },
|
|
15
16
|
click: { type: [Function, null], default: null }
|
|
16
17
|
},
|
|
17
|
-
setup(
|
|
18
|
-
const
|
|
19
|
-
if (!
|
|
18
|
+
setup(w) {
|
|
19
|
+
const d = w, o = he(), v = ye(se);
|
|
20
|
+
if (!v)
|
|
20
21
|
throw new Error("VColumn deve ser usado dentro de um VDataTable.");
|
|
21
|
-
const
|
|
22
|
+
const h = ["text", "img", "date", "html"];
|
|
22
23
|
return te(() => {
|
|
23
|
-
if (
|
|
24
|
+
if (d.field !== null && !d.field)
|
|
24
25
|
throw new Error('A propriedade "field" é obrigatória em VColumn.');
|
|
25
|
-
if (!
|
|
26
|
+
if (!d.header)
|
|
26
27
|
throw new Error('A propriedade "header" é obrigatória em VColumn.');
|
|
27
|
-
if (
|
|
28
|
-
throw new Error(`O tipo "${
|
|
29
|
-
if (
|
|
30
|
-
if (
|
|
28
|
+
if (d.field !== null && !h.includes(d.type))
|
|
29
|
+
throw new Error(`O tipo "${d.type}" não é suportado em VColumn. Tipos suportados: text, img, date, html.`);
|
|
30
|
+
if (d.limite_text) {
|
|
31
|
+
if (d.type !== "text")
|
|
31
32
|
throw new Error('A propriedade "limite_text" só pode ser usada quando o tipo for "text".');
|
|
32
|
-
if (typeof
|
|
33
|
+
if (typeof d.limite_text == "string" && isNaN(Number(d.limite_text)))
|
|
33
34
|
throw new Error('A propriedade "limite_text" deve ser um número quando for uma string.');
|
|
34
|
-
if (isNaN(Number(
|
|
35
|
+
if (isNaN(Number(d.limite_text)) || Number(d.limite_text) <= 0)
|
|
35
36
|
throw new Error('A propriedade "limite_text" deve ser um número maior que 0.');
|
|
36
37
|
}
|
|
37
|
-
|
|
38
|
-
field:
|
|
39
|
-
header:
|
|
40
|
-
type:
|
|
41
|
-
class_column:
|
|
42
|
-
class_row:
|
|
43
|
-
class_item:
|
|
44
|
-
click:
|
|
45
|
-
transform_function:
|
|
38
|
+
v.addColumn({
|
|
39
|
+
field: d.field,
|
|
40
|
+
header: d.header,
|
|
41
|
+
type: d.type,
|
|
42
|
+
class_column: d.class_column,
|
|
43
|
+
class_row: d.class_row,
|
|
44
|
+
class_item: d.class_item,
|
|
45
|
+
click: d.click,
|
|
46
|
+
transform_function: d.transform_function,
|
|
46
47
|
bodySlot: o.body,
|
|
47
|
-
...
|
|
48
|
-
...
|
|
49
|
-
...
|
|
48
|
+
...d.type === "text" && { limite_text: Number(d.limite_text) },
|
|
49
|
+
...d.type === "img" && { deactivate_img_preview: d.deactivate_img_preview },
|
|
50
|
+
...d.type === "date" && { format: d.format }
|
|
50
51
|
});
|
|
51
52
|
}), (C, E) => null;
|
|
52
53
|
}
|
|
@@ -81,21 +82,21 @@ const se = Symbol("v-datatable-key"), Et = /* @__PURE__ */ F({
|
|
|
81
82
|
filtering: { type: Boolean, default: !1 }
|
|
82
83
|
},
|
|
83
84
|
emits: ["tradePage"],
|
|
84
|
-
setup(
|
|
85
|
-
const o =
|
|
86
|
-
o.pagination.current_page++,
|
|
85
|
+
setup(w, { emit: d }) {
|
|
86
|
+
const o = w, v = d, h = N(() => o.pagination.limit_per_page ? Math.ceil(o.pagination.count / o.pagination.limit_per_page) : 0), C = N(() => o.pagination.current_page + 1 < h.value ? o.pagination.current_page + 1 : null), E = () => {
|
|
87
|
+
o.pagination.current_page++, v("tradePage");
|
|
87
88
|
}, V = (p) => {
|
|
88
|
-
o.pagination.current_page = p - 1,
|
|
89
|
+
o.pagination.current_page = p - 1, v("tradePage");
|
|
89
90
|
}, l = () => {
|
|
90
|
-
o.pagination.current_page =
|
|
91
|
+
o.pagination.current_page = h.value - 1, v("tradePage");
|
|
91
92
|
}, c = () => {
|
|
92
|
-
o.pagination.current_page = 0,
|
|
93
|
-
},
|
|
94
|
-
o.pagination.current_page > 0 && (o.pagination.current_page--,
|
|
93
|
+
o.pagination.current_page = 0, v("tradePage");
|
|
94
|
+
}, g = () => {
|
|
95
|
+
o.pagination.current_page > 0 && (o.pagination.current_page--, v("tradePage"));
|
|
95
96
|
}, m = N(() => {
|
|
96
|
-
if (
|
|
97
|
-
return Array.from({ length:
|
|
98
|
-
const p = o.pagination.current_page + 1,
|
|
97
|
+
if (h.value <= 7)
|
|
98
|
+
return Array.from({ length: h.value }, (A, B) => B + 1);
|
|
99
|
+
const p = o.pagination.current_page + 1, y = h.value, $ = /* @__PURE__ */ new Set([
|
|
99
100
|
1,
|
|
100
101
|
2,
|
|
101
102
|
// Sempre mostra as 2 primeiras
|
|
@@ -103,18 +104,18 @@ const se = Symbol("v-datatable-key"), Et = /* @__PURE__ */ F({
|
|
|
103
104
|
p,
|
|
104
105
|
p + 1,
|
|
105
106
|
// Mostra a atual e vizinhas
|
|
106
|
-
|
|
107
|
-
|
|
107
|
+
y - 1,
|
|
108
|
+
y
|
|
108
109
|
// Sempre mostra as 2 últimas
|
|
109
|
-
]),
|
|
110
|
-
let
|
|
110
|
+
]), b = [];
|
|
111
|
+
let u = 0;
|
|
111
112
|
return Array.from($).sort((A, B) => A - B).forEach((A) => {
|
|
112
|
-
A < 1 || A >
|
|
113
|
-
}),
|
|
113
|
+
A < 1 || A > y || (A > u + 1 && b.push("..."), b.push(A), u = A);
|
|
114
|
+
}), b;
|
|
114
115
|
});
|
|
115
|
-
return (p,
|
|
116
|
-
s("span", null, " Mostrando de " +
|
|
117
|
-
|
|
116
|
+
return (p, y) => o.pagination.count > 0 ? (a(), n("div", ze, [
|
|
117
|
+
s("span", null, " Mostrando de " + f(o.pagination.count !== 0 ? o.pagination.limit_per_page * o.pagination.current_page + 1 : 0) + " até " + f(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 " + f(o.pagination.count) + " registros ", 1),
|
|
118
|
+
h.value > 0 ? (a(), n("div", Pe, [
|
|
118
119
|
s("div", Te, [
|
|
119
120
|
s("button", {
|
|
120
121
|
class: "btn btn-estilo",
|
|
@@ -124,19 +125,19 @@ const se = Symbol("v-datatable-key"), Et = /* @__PURE__ */ F({
|
|
|
124
125
|
}, null, 8, Ne),
|
|
125
126
|
s("button", {
|
|
126
127
|
class: "btn btn-estilo",
|
|
127
|
-
onClick: j(
|
|
128
|
+
onClick: j(g, ["prevent"]),
|
|
128
129
|
disabled: o.pagination.current_page === 0,
|
|
129
130
|
innerHTML: ee
|
|
130
131
|
}, null, 8, Ae)
|
|
131
132
|
]),
|
|
132
133
|
s("div", De, [
|
|
133
|
-
(a(!0), n(S, null, T(m.value, ($,
|
|
134
|
+
(a(!0), n(S, null, T(m.value, ($, b) => (a(), n(S, { key: b }, [
|
|
134
135
|
typeof $ == "number" ? (a(), n("button", {
|
|
135
136
|
key: 0,
|
|
136
137
|
class: _([o.pagination.current_page + 1 == $ ? "page-select" : "", "page-estilo"]),
|
|
137
|
-
onClick: j((
|
|
138
|
+
onClick: j((u) => V($), ["prevent"]),
|
|
138
139
|
disabled: o.pagination.current_page + 1 == $
|
|
139
|
-
},
|
|
140
|
+
}, f($), 11, Ee)) : (a(), n("span", He, "..."))
|
|
140
141
|
], 64))), 128))
|
|
141
142
|
]),
|
|
142
143
|
s("div", Ve, [
|
|
@@ -153,15 +154,10 @@ const se = Symbol("v-datatable-key"), Et = /* @__PURE__ */ F({
|
|
|
153
154
|
innerHTML: R
|
|
154
155
|
}, null, 8, je)
|
|
155
156
|
])
|
|
156
|
-
])) :
|
|
157
|
-
])) :
|
|
157
|
+
])) : k("", !0)
|
|
158
|
+
])) : k("", !0);
|
|
158
159
|
}
|
|
159
|
-
}),
|
|
160
|
-
const o = y.__vccOpts || y;
|
|
161
|
-
for (const [f, v] of u)
|
|
162
|
-
o[f] = v;
|
|
163
|
-
return o;
|
|
164
|
-
}, Ie = /* @__PURE__ */ W(Be, [["__scopeId", "data-v-b9735591"]]), Oe = { class: "dropdown d-flex" }, qe = {
|
|
160
|
+
}), Ie = /* @__PURE__ */ W(Be, [["__scopeId", "data-v-b9735591"]]), qe = { class: "dropdown d-flex" }, Oe = {
|
|
165
161
|
key: 0,
|
|
166
162
|
href: "#",
|
|
167
163
|
class: "btn dropdown-toggle",
|
|
@@ -182,21 +178,21 @@ const se = Symbol("v-datatable-key"), Et = /* @__PURE__ */ F({
|
|
|
182
178
|
item_use: { default: () => [1, 2] }
|
|
183
179
|
},
|
|
184
180
|
emits: ["update:search", "update:filter", "search"],
|
|
185
|
-
setup(
|
|
186
|
-
const o =
|
|
181
|
+
setup(w, { emit: d }) {
|
|
182
|
+
const o = w, v = d, h = N({
|
|
187
183
|
get: () => o.search,
|
|
188
|
-
set: (l) =>
|
|
184
|
+
set: (l) => v("update:search", l)
|
|
189
185
|
}), C = N({
|
|
190
186
|
get: () => o.filter,
|
|
191
|
-
set: (l) =>
|
|
187
|
+
set: (l) => v("update:filter", l)
|
|
192
188
|
});
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
}),
|
|
189
|
+
O(C, () => {
|
|
190
|
+
v("search");
|
|
191
|
+
}), O(
|
|
196
192
|
() => o.list_filter,
|
|
197
193
|
(l) => {
|
|
198
|
-
Array.isArray(l) ? (l.forEach((c,
|
|
199
|
-
c?.type === 1 && !c.to && console.error(`Filtro na posição ${
|
|
194
|
+
Array.isArray(l) ? (l.forEach((c, g) => {
|
|
195
|
+
c?.type === 1 && !c.to && console.error(`Filtro na posição ${g} é do tipo 'router-link' mas não possui a propriedade 'to'.`);
|
|
200
196
|
}), 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.");
|
|
201
197
|
},
|
|
202
198
|
{ immediate: !0, deep: !0 }
|
|
@@ -205,12 +201,12 @@ const se = Symbol("v-datatable-key"), Et = /* @__PURE__ */ F({
|
|
|
205
201
|
C.value === l ? C.value = "" : C.value = l;
|
|
206
202
|
}
|
|
207
203
|
function V() {
|
|
208
|
-
|
|
204
|
+
h.value = "", v("search");
|
|
209
205
|
}
|
|
210
206
|
return (l, c) => {
|
|
211
|
-
const
|
|
212
|
-
return a(), n("div",
|
|
213
|
-
|
|
207
|
+
const g = ke("router-link");
|
|
208
|
+
return a(), n("div", qe, [
|
|
209
|
+
w.item_use.includes(2) ? (a(), n("a", Oe, [...c[3] || (c[3] = [
|
|
214
210
|
s("svg", {
|
|
215
211
|
xmlns: "http://www.w3.org/2000/svg",
|
|
216
212
|
class: "icon icon-tabler icon-tabler-filter",
|
|
@@ -230,19 +226,19 @@ const se = Symbol("v-datatable-key"), Et = /* @__PURE__ */ F({
|
|
|
230
226
|
}),
|
|
231
227
|
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" })
|
|
232
228
|
], -1)
|
|
233
|
-
])])) :
|
|
229
|
+
])])) : k("", !0),
|
|
234
230
|
s("div", Fe, [
|
|
235
231
|
ae(s("input", {
|
|
236
232
|
type: "text",
|
|
237
233
|
class: "form-control ms-1",
|
|
238
234
|
id: "inputSearchLaudos",
|
|
239
|
-
"onUpdate:modelValue": c[0] || (c[0] = (m) =>
|
|
235
|
+
"onUpdate:modelValue": c[0] || (c[0] = (m) => h.value = m),
|
|
240
236
|
onKeyup: c[1] || (c[1] = be((m) => l.$emit("search"), ["enter"])),
|
|
241
237
|
placeholder: "Buscar..."
|
|
242
238
|
}, null, 544), [
|
|
243
|
-
[ne,
|
|
239
|
+
[ne, h.value]
|
|
244
240
|
]),
|
|
245
|
-
|
|
241
|
+
h.value ? (a(), n("span", {
|
|
246
242
|
key: 0,
|
|
247
243
|
onClick: c[2] || (c[2] = (m) => V()),
|
|
248
244
|
class: "inputClose",
|
|
@@ -291,54 +287,54 @@ const se = Symbol("v-datatable-key"), Et = /* @__PURE__ */ F({
|
|
|
291
287
|
], -1)
|
|
292
288
|
])]))
|
|
293
289
|
]),
|
|
294
|
-
|
|
290
|
+
w.item_use.includes(2) ? (a(), n("div", Ue, [
|
|
295
291
|
(a(!0), n(S, null, T(o.list_filter, (m, p) => (a(), n(S, { key: p }, [
|
|
296
|
-
"type" in m && m.type === 1 ? (a(), X(
|
|
292
|
+
"type" in m && m.type === 1 ? (a(), X(g, {
|
|
297
293
|
key: 0,
|
|
298
294
|
to: m?.to,
|
|
299
295
|
class: "dropdown-item cursor-pointer"
|
|
300
296
|
}, {
|
|
301
297
|
default: xe(() => [
|
|
302
|
-
D(
|
|
298
|
+
D(f(m.text), 1)
|
|
303
299
|
]),
|
|
304
300
|
_: 2
|
|
305
301
|
}, 1032, ["to"])) : !("type" in m) || m.type === 2 ? (a(), n("a", {
|
|
306
302
|
key: 1,
|
|
307
|
-
onClick: j((
|
|
303
|
+
onClick: j((y) => E(String(m.value)), ["prevent"]),
|
|
308
304
|
class: _(["dropdown-item cursor-pointer", C.value === m?.value ? "bg-info text-dark selected" : ""])
|
|
309
|
-
},
|
|
305
|
+
}, f(m.text), 11, Ye)) : k("", !0)
|
|
310
306
|
], 64))), 128))
|
|
311
|
-
])) :
|
|
307
|
+
])) : k("", !0)
|
|
312
308
|
]);
|
|
313
309
|
};
|
|
314
310
|
}
|
|
315
311
|
}), We = /* @__PURE__ */ W(Xe, [["__scopeId", "data-v-1b6ff54b"]]);
|
|
316
312
|
function Ge() {
|
|
317
|
-
const
|
|
313
|
+
const w = z(!1), d = z(""), o = z(0), v = z(0), h = N(() => ({
|
|
318
314
|
position: "fixed",
|
|
319
315
|
zIndex: 9999,
|
|
320
316
|
pointerEvents: "none",
|
|
321
|
-
top: `${
|
|
317
|
+
top: `${v.value + 15}px`,
|
|
322
318
|
left: `${o.value + 15}px`
|
|
323
319
|
}));
|
|
324
320
|
function C(c) {
|
|
325
|
-
const
|
|
326
|
-
let
|
|
327
|
-
|
|
321
|
+
const g = c.clientX, m = c.clientY, p = window.innerHeight, y = 15, $ = 300;
|
|
322
|
+
let b = m + y;
|
|
323
|
+
b + $ > p && (b = m - $ - y, b < 0 && (b = 0)), o.value = g, v.value = b;
|
|
328
324
|
}
|
|
329
|
-
function E(c,
|
|
330
|
-
|
|
325
|
+
function E(c, g) {
|
|
326
|
+
w.value = !0, d.value = g, C(c);
|
|
331
327
|
}
|
|
332
328
|
function V(c) {
|
|
333
|
-
|
|
329
|
+
w.value && C(c);
|
|
334
330
|
}
|
|
335
331
|
function l() {
|
|
336
|
-
|
|
332
|
+
w.value = !1;
|
|
337
333
|
}
|
|
338
334
|
return {
|
|
339
|
-
isHovering:
|
|
340
|
-
previewSrc:
|
|
341
|
-
previewStyle:
|
|
335
|
+
isHovering: w,
|
|
336
|
+
previewSrc: d,
|
|
337
|
+
previewStyle: h,
|
|
342
338
|
handleMouseOver: E,
|
|
343
339
|
handleMouseMove: V,
|
|
344
340
|
handleMouseLeave: l
|
|
@@ -419,15 +415,15 @@ const Je = { class: "text-secondary" }, Qe = { class: "mx-2 d-inline-block" }, Z
|
|
|
419
415
|
item_key: { default: "id" },
|
|
420
416
|
limit_per_page: { default: 5 }
|
|
421
417
|
},
|
|
422
|
-
setup(
|
|
418
|
+
setup(w, { expose: d }) {
|
|
423
419
|
const {
|
|
424
420
|
isHovering: o,
|
|
425
|
-
previewSrc:
|
|
426
|
-
previewStyle:
|
|
421
|
+
previewSrc: v,
|
|
422
|
+
previewStyle: h,
|
|
427
423
|
handleMouseOver: C,
|
|
428
424
|
handleMouseMove: E,
|
|
429
425
|
handleMouseLeave: V
|
|
430
|
-
} = Ge(), l =
|
|
426
|
+
} = Ge(), l = w, c = z([]), g = z([]), m = z(0), p = z([]), y = z(null), $ = z(!1), b = z(null), u = z({
|
|
431
427
|
current_page: 0,
|
|
432
428
|
// pagina atual
|
|
433
429
|
count: 0,
|
|
@@ -456,28 +452,28 @@ const Je = { class: "text-secondary" }, Qe = { class: "mx-2 d-inline-block" }, Z
|
|
|
456
452
|
let i = [1];
|
|
457
453
|
return l.list_filter.length > 0 && i.push(2), i;
|
|
458
454
|
}), U = N(() => ({
|
|
459
|
-
[l.page_param_name]:
|
|
460
|
-
[l.page_size_param_name]:
|
|
461
|
-
[l.search_param_name]:
|
|
462
|
-
[l.filter_param_name]:
|
|
455
|
+
[l.page_param_name]: u.value.current_page + 1,
|
|
456
|
+
[l.page_size_param_name]: u.value.limit_per_page,
|
|
457
|
+
[l.search_param_name]: u.value.search || "",
|
|
458
|
+
[l.filter_param_name]: u.value.filter || ""
|
|
463
459
|
})), ie = N(() => B.value || $.value), I = (i) => {
|
|
464
460
|
const t = l.item_key;
|
|
465
461
|
return p.value.some((r) => r[t] === i[t]);
|
|
466
462
|
}, G = N(() => {
|
|
467
|
-
if (!
|
|
468
|
-
const i =
|
|
469
|
-
return i === 0 ? !1 : i ===
|
|
463
|
+
if (!g.value.length) return !1;
|
|
464
|
+
const i = g.value.filter((t) => I(t)).length;
|
|
465
|
+
return i === 0 ? !1 : i === g.value.length ? !0 : "indeterminate";
|
|
470
466
|
}), oe = N(() => p.value.length > 0);
|
|
471
|
-
|
|
472
|
-
|
|
467
|
+
O([G, y], ([i]) => {
|
|
468
|
+
y.value && (i === "indeterminate" ? (console.log("entrei no indeterminate"), y.value.checked = !1, y.value.indeterminate = !0) : (y.value.checked = i, y.value.indeterminate = !1));
|
|
473
469
|
}, {
|
|
474
470
|
immediate: !0,
|
|
475
471
|
flush: "post"
|
|
476
|
-
}),
|
|
477
|
-
i ? (
|
|
472
|
+
}), O(A, (i) => {
|
|
473
|
+
i ? (g.value = i[l.data_key] || [], m.value = i[l.total_key] || 0, u.value.count = m.value) : (g.value = [], m.value = 0);
|
|
478
474
|
}, { immediate: !0 });
|
|
479
475
|
function ue() {
|
|
480
|
-
const i =
|
|
476
|
+
const i = g.value;
|
|
481
477
|
if (!i.length) return;
|
|
482
478
|
const t = G.value;
|
|
483
479
|
if (t === !0 || t === "indeterminate") {
|
|
@@ -499,16 +495,16 @@ const Je = { class: "text-secondary" }, Qe = { class: "mx-2 d-inline-block" }, Z
|
|
|
499
495
|
}
|
|
500
496
|
we(se, { addColumn: ce });
|
|
501
497
|
function P() {
|
|
502
|
-
|
|
498
|
+
b.value && clearTimeout(b.value), $.value = !0, b.value = setTimeout(() => {
|
|
503
499
|
$.value = !1;
|
|
504
500
|
}, l.min_loading_delay), le();
|
|
505
501
|
}
|
|
506
502
|
function pe() {
|
|
507
|
-
|
|
503
|
+
u.value.current_page = 0, P();
|
|
508
504
|
}
|
|
509
505
|
const J = (i) => {
|
|
510
506
|
const t = i.target, r = parseInt(t.value, 10);
|
|
511
|
-
r > 0 && (
|
|
507
|
+
r > 0 && (u.value.limit_per_page = r, u.value.limit_per_page = r, u.value.current_page = 0, P());
|
|
512
508
|
};
|
|
513
509
|
function H(i, t, r = null) {
|
|
514
510
|
if (!i) return t;
|
|
@@ -522,20 +518,20 @@ const Je = { class: "text-secondary" }, Qe = { class: "mx-2 d-inline-block" }, Z
|
|
|
522
518
|
return t && typeof t == "number" && t > 0 && typeof i == "string" && i.length > t ? i.substring(0, t) + "..." : i;
|
|
523
519
|
}
|
|
524
520
|
function me(i) {
|
|
525
|
-
i > 0 ? (
|
|
521
|
+
i > 0 ? (u.value.limit_per_page = i, u.value.current_page = 0, P()) : console.warn("O limite deve ser um número maior que zero.");
|
|
526
522
|
}
|
|
527
523
|
function fe(i) {
|
|
528
|
-
|
|
524
|
+
u.value.search = i, u.value.current_page = 0, P();
|
|
529
525
|
}
|
|
530
526
|
function ge(i) {
|
|
531
|
-
|
|
527
|
+
u.value.filter = i, u.value.current_page = 0, P();
|
|
532
528
|
}
|
|
533
529
|
function ve(i) {
|
|
534
|
-
i >= 1 && i <= Math.ceil(
|
|
530
|
+
i >= 1 && i <= Math.ceil(u.value.count / u.value.limit_per_page) ? (u.value.current_page = i - 1, P()) : console.warn("Número de página inválido.");
|
|
535
531
|
}
|
|
536
|
-
return
|
|
532
|
+
return d({
|
|
537
533
|
execute: P,
|
|
538
|
-
pagination: Ce(
|
|
534
|
+
pagination: Ce(u),
|
|
539
535
|
set_limit_per_page: me,
|
|
540
536
|
set_search: fe,
|
|
541
537
|
set_filter: ge,
|
|
@@ -551,24 +547,24 @@ const Je = { class: "text-secondary" }, Qe = { class: "mx-2 d-inline-block" }, Z
|
|
|
551
547
|
s("div", {
|
|
552
548
|
class: _(["", l.class_container])
|
|
553
549
|
}, [
|
|
554
|
-
|
|
550
|
+
q(i.$slots, "default", {}, void 0, !0),
|
|
555
551
|
s("div", {
|
|
556
552
|
class: _(["", l.class_content])
|
|
557
553
|
}, [
|
|
558
554
|
s("div", {
|
|
559
|
-
class: _([l.class_filters, "d-flex justify-content-between align-items-start
|
|
555
|
+
class: _([l.class_filters, "d-flex justify-content-between align-items-start"])
|
|
560
556
|
}, [
|
|
561
|
-
|
|
557
|
+
q(i.$slots, "pageSize", {
|
|
562
558
|
changePageSize: J,
|
|
563
|
-
limit_per_page:
|
|
559
|
+
limit_per_page: u.value.limit_per_page
|
|
564
560
|
}, () => [
|
|
565
561
|
s("div", Je, [
|
|
566
|
-
D(
|
|
562
|
+
D(f(l.first_text_page_size) + " ", 1),
|
|
567
563
|
s("div", Qe, [
|
|
568
564
|
ae(s("input", {
|
|
569
565
|
class: "form-control form-control-sm",
|
|
570
566
|
onChange: J,
|
|
571
|
-
"onUpdate:modelValue": t[0] || (t[0] = (r) =>
|
|
567
|
+
"onUpdate:modelValue": t[0] || (t[0] = (r) => u.value.limit_per_page = r),
|
|
572
568
|
min: "1",
|
|
573
569
|
size: "3",
|
|
574
570
|
"aria-label": "Número de registros por página",
|
|
@@ -576,21 +572,21 @@ const Je = { class: "text-secondary" }, Qe = { class: "mx-2 d-inline-block" }, Z
|
|
|
576
572
|
}, null, 544), [
|
|
577
573
|
[
|
|
578
574
|
ne,
|
|
579
|
-
|
|
575
|
+
u.value.limit_per_page,
|
|
580
576
|
void 0,
|
|
581
577
|
{ lazy: !0 }
|
|
582
578
|
]
|
|
583
579
|
])
|
|
584
580
|
]),
|
|
585
|
-
D(" " +
|
|
581
|
+
D(" " + f(l.second_text_page_size), 1)
|
|
586
582
|
])
|
|
587
583
|
], !0),
|
|
588
|
-
|
|
584
|
+
q(i.$slots, "fieldMiddle", {}, void 0, !0),
|
|
589
585
|
Q(We, {
|
|
590
|
-
search:
|
|
591
|
-
"onUpdate:search": t[1] || (t[1] = (r) =>
|
|
592
|
-
filter:
|
|
593
|
-
"onUpdate:filter": t[2] || (t[2] = (r) =>
|
|
586
|
+
search: u.value.search,
|
|
587
|
+
"onUpdate:search": t[1] || (t[1] = (r) => u.value.search = r),
|
|
588
|
+
filter: u.value.filter,
|
|
589
|
+
"onUpdate:filter": t[2] || (t[2] = (r) => u.value.filter = r),
|
|
594
590
|
list_filter: l.list_filter,
|
|
595
591
|
item_use: re.value,
|
|
596
592
|
onSearch: pe
|
|
@@ -599,13 +595,13 @@ const Je = { class: "text-secondary" }, Qe = { class: "mx-2 d-inline-block" }, Z
|
|
|
599
595
|
l.use_checkbox && p.value.length > 0 ? (a(), n("div", Ze, [
|
|
600
596
|
s("h4", Re, [
|
|
601
597
|
t[4] || (t[4] = s("strong", null, "Itens Selecionados:", -1)),
|
|
602
|
-
D(" " +
|
|
598
|
+
D(" " + f(p.value.length), 1)
|
|
603
599
|
]),
|
|
604
600
|
s("button", {
|
|
605
601
|
class: "btn btn-outline-danger ms-3 bold",
|
|
606
602
|
onClick: t[3] || (t[3] = (r) => p.value = [])
|
|
607
603
|
}, "Limpar Seleção")
|
|
608
|
-
])) :
|
|
604
|
+
])) : k("", !0),
|
|
609
605
|
ie.value ? (a(), n(S, { key: 1 }, [
|
|
610
606
|
l.custom_loading ? (a(), X(Z(l.custom_loading), { key: 0 })) : (a(), n("table", {
|
|
611
607
|
key: 1,
|
|
@@ -616,11 +612,11 @@ const Je = { class: "text-secondary" }, Qe = { class: "mx-2 d-inline-block" }, Z
|
|
|
616
612
|
(a(!0), n(S, null, T(c.value, (r) => (a(), n("th", {
|
|
617
613
|
key: r.field || r.header,
|
|
618
614
|
class: _(r.class_column)
|
|
619
|
-
},
|
|
615
|
+
}, f(r.header), 3))), 128))
|
|
620
616
|
])
|
|
621
617
|
]),
|
|
622
618
|
s("tbody", null, [
|
|
623
|
-
l.type_loading === "placeholder" ? (a(!0), n(S, { key: 0 }, T(
|
|
619
|
+
l.type_loading === "placeholder" ? (a(!0), n(S, { key: 0 }, T(u.value.limit_per_page, (r) => (a(), n("tr", {
|
|
624
620
|
key: "placeholder-" + r,
|
|
625
621
|
class: "placeholder-glow"
|
|
626
622
|
}, [
|
|
@@ -649,11 +645,11 @@ const Je = { class: "text-secondary" }, Qe = { class: "mx-2 d-inline-block" }, Z
|
|
|
649
645
|
s("div", { class: "placeholder placeholder-img" }, null, -1)
|
|
650
646
|
])], 2)) : (a(), n("span", at, [
|
|
651
647
|
t[10] || (t[10] = D("tipo ", -1)),
|
|
652
|
-
s("span", nt,
|
|
648
|
+
s("span", nt, f(e.type), 1),
|
|
653
649
|
t[11] || (t[11] = D(" não suportado ", -1))
|
|
654
650
|
]))
|
|
655
651
|
], 2))), 128))
|
|
656
|
-
]))), 128)) : l.type_loading === "spiner-table" ? (a(!0), n(S, { key: 1 }, T(
|
|
652
|
+
]))), 128)) : l.type_loading === "spiner-table" ? (a(!0), n(S, { key: 1 }, T(u.value.limit_per_page, (r) => (a(), n("tr", {
|
|
657
653
|
key: "placeholder-" + r
|
|
658
654
|
}, [
|
|
659
655
|
(a(!0), n(S, null, T(c.value, (e) => (a(), n("td", {
|
|
@@ -703,17 +699,17 @@ const Je = { class: "text-secondary" }, Qe = { class: "mx-2 d-inline-block" }, Z
|
|
|
703
699
|
], -1)
|
|
704
700
|
])], 2)) : (a(), n("span", rt, [
|
|
705
701
|
t[17] || (t[17] = D("tipo ", -1)),
|
|
706
|
-
s("span", it,
|
|
702
|
+
s("span", it, f(e.type), 1),
|
|
707
703
|
t[18] || (t[18] = D(" não suportado ", -1))
|
|
708
704
|
]))
|
|
709
705
|
], 2))), 128))
|
|
710
|
-
]))), 128)) : l.type_loading === "spiner" ? (a(!0), n(S, { key: 2 }, T(
|
|
706
|
+
]))), 128)) : l.type_loading === "spiner" ? (a(!0), n(S, { key: 2 }, T(u.value.limit_per_page, (r) => (a(), n("tr", { key: r }, [
|
|
711
707
|
s("td", {
|
|
712
708
|
colspan: c.value.length,
|
|
713
709
|
class: "text-center p-0",
|
|
714
710
|
style: { "border-bottom": "none" }
|
|
715
711
|
}, [
|
|
716
|
-
r === Math.floor(
|
|
712
|
+
r === Math.floor(u.value.limit_per_page / 2) + 1 ? (a(), n("div", ut, [...t[19] || (t[19] = [
|
|
717
713
|
s("div", {
|
|
718
714
|
class: "spinner-border",
|
|
719
715
|
style: { width: "3rem", height: "3rem" },
|
|
@@ -722,19 +718,19 @@ const Je = { class: "text-secondary" }, Qe = { class: "mx-2 d-inline-block" }, Z
|
|
|
722
718
|
s("span", { class: "mt-2" }, "Carregando...", -1)
|
|
723
719
|
])])) : (a(), n("div", dt))
|
|
724
720
|
], 8, ot)
|
|
725
|
-
]))), 128)) :
|
|
721
|
+
]))), 128)) : k("", !0)
|
|
726
722
|
])
|
|
727
723
|
], 2)),
|
|
728
|
-
|
|
729
|
-
], 64)) :
|
|
724
|
+
x(L) && x(L).current > 1 ? (a(), n("div", ct, " A conexão falhou. Tentando novamente... (Tentativa " + f(x(L).current) + " de " + f(x(L).total) + ") ", 1)) : k("", !0)
|
|
725
|
+
], 64)) : x(K) ? (a(), n("div", pt, [
|
|
730
726
|
t[20] || (t[20] = s("h4", { class: "text-danger" }, "Ocorreu um Erro", -1)),
|
|
731
|
-
|
|
727
|
+
x(L) ? (a(), n("p", _t, " Não foi possível carregar os dados após " + f(x(L).total) + " tentativa(s). ", 1)) : (a(), n("p", mt, " Não foi possível carregar os dados. Verifique sua conexão. ")),
|
|
732
728
|
s("button", {
|
|
733
729
|
class: "btn btn-primary mt-2",
|
|
734
730
|
onClick: P
|
|
735
731
|
}, " Tentar Novamente ")
|
|
736
|
-
])) :
|
|
737
|
-
|
|
732
|
+
])) : g.value ? (a(), n("div", ft, [
|
|
733
|
+
g.value.length > 0 ? (a(), n("div", gt, [
|
|
738
734
|
s("table", {
|
|
739
735
|
class: _(["table table-vcenter table-selectable", l.class_table])
|
|
740
736
|
}, [
|
|
@@ -745,19 +741,19 @@ const Je = { class: "text-secondary" }, Qe = { class: "mx-2 d-inline-block" }, Z
|
|
|
745
741
|
class: "form-check-input m-0",
|
|
746
742
|
type: "checkbox",
|
|
747
743
|
ref_key: "selectAllCheckbox",
|
|
748
|
-
ref:
|
|
744
|
+
ref: y,
|
|
749
745
|
onChange: ue,
|
|
750
746
|
"aria-label": "Selecionar todos os itens na página"
|
|
751
747
|
}, null, 544)
|
|
752
|
-
])) :
|
|
748
|
+
])) : k("", !0),
|
|
753
749
|
(a(!0), n(S, null, T(c.value, (r) => (a(), n("th", {
|
|
754
750
|
key: r.field || r.header,
|
|
755
751
|
class: _(r.class_column)
|
|
756
|
-
},
|
|
752
|
+
}, f(r.header), 3))), 128))
|
|
757
753
|
])
|
|
758
754
|
]),
|
|
759
755
|
s("tbody", null, [
|
|
760
|
-
(a(!0), n(S, null, T(
|
|
756
|
+
(a(!0), n(S, null, T(g.value, (r) => (a(), n("tr", {
|
|
761
757
|
key: r[l.item_key]
|
|
762
758
|
}, [
|
|
763
759
|
l.use_checkbox ? (a(), n("td", ht, [
|
|
@@ -768,7 +764,7 @@ const Je = { class: "text-secondary" }, Qe = { class: "mx-2 d-inline-block" }, Z
|
|
|
768
764
|
onChange: (e) => de(r),
|
|
769
765
|
"aria-label": "Selecionar este item"
|
|
770
766
|
}, null, 40, yt)
|
|
771
|
-
])) :
|
|
767
|
+
])) : k("", !0),
|
|
772
768
|
(a(!0), n(S, null, T(c.value, (e) => (a(), n("td", {
|
|
773
769
|
key: e.field || e.header,
|
|
774
770
|
class: _(e.class_row)
|
|
@@ -781,16 +777,16 @@ const Je = { class: "text-secondary" }, Qe = { class: "mx-2 d-inline-block" }, Z
|
|
|
781
777
|
key: 1,
|
|
782
778
|
onClick: (M) => e.click ? e.click(r) : null,
|
|
783
779
|
class: _(e.class_item + (e.click ? " cursor-pointer" : ""))
|
|
784
|
-
},
|
|
780
|
+
}, f(_e(H(e.field, r, e.transform_function), e.limite_text ?? null)), 11, kt)) : e.type === "date" ? (a(), n("span", {
|
|
785
781
|
key: 2,
|
|
786
782
|
onClick: (M) => e.click ? e.click(r) : null,
|
|
787
783
|
class: _(e.class_item + (e.click ? " cursor-pointer" : ""))
|
|
788
784
|
}, [
|
|
789
|
-
e.format === "complete" ? (a(), n("span", xt,
|
|
790
|
-
e.format === "simple" ? (a(), n("span", wt,
|
|
785
|
+
e.format === "complete" ? (a(), n("span", xt, f(new Date(H(e.field, r)).toLocaleString()), 1)) : k("", !0),
|
|
786
|
+
e.format === "simple" ? (a(), n("span", wt, f(new Date(H(
|
|
791
787
|
e.field,
|
|
792
788
|
r
|
|
793
|
-
)).toLocaleDateString()), 1)) :
|
|
789
|
+
)).toLocaleDateString()), 1)) : k("", !0)
|
|
794
790
|
], 10, bt)) : e.type === "html" ? (a(), n("div", {
|
|
795
791
|
key: 3,
|
|
796
792
|
onClick: (M) => e.click ? e.click(r) : null,
|
|
@@ -807,9 +803,9 @@ const Je = { class: "text-secondary" }, Qe = { class: "mx-2 d-inline-block" }, Z
|
|
|
807
803
|
}, e.deactivate_img_preview ? {
|
|
808
804
|
class: "container-img"
|
|
809
805
|
} : {
|
|
810
|
-
onMouseover: (M) =>
|
|
811
|
-
onMousemove:
|
|
812
|
-
onMouseleave:
|
|
806
|
+
onMouseover: (M) => x(C)(M, H(e.field, r)),
|
|
807
|
+
onMousemove: x(E),
|
|
808
|
+
onMouseleave: x(V),
|
|
813
809
|
class: "container-img container-img-preview"
|
|
814
810
|
}), [
|
|
815
811
|
s("img", {
|
|
@@ -821,10 +817,10 @@ const Je = { class: "text-secondary" }, Qe = { class: "mx-2 d-inline-block" }, Z
|
|
|
821
817
|
src: H(e.field, r)
|
|
822
818
|
}, null, 8, St),
|
|
823
819
|
t[21] || (t[21] = s("div", { class: "bg-img" }, null, -1))
|
|
824
|
-
], 16)) :
|
|
820
|
+
], 16)) : k("", !0)
|
|
825
821
|
], 10, $t)) : (a(), n("span", zt, [
|
|
826
822
|
t[22] || (t[22] = D("tipo ", -1)),
|
|
827
|
-
s("span", Pt,
|
|
823
|
+
s("span", Pt, f(e.type), 1),
|
|
828
824
|
t[23] || (t[23] = D(" não suportado", -1))
|
|
829
825
|
]))
|
|
830
826
|
], 2))), 128))
|
|
@@ -834,40 +830,40 @@ const Je = { class: "text-secondary" }, Qe = { class: "mx-2 d-inline-block" }, Z
|
|
|
834
830
|
])) : (a(), n("div", Tt, [...t[24] || (t[24] = [
|
|
835
831
|
s("p", { class: "m-0" }, "Nenhum item encontrado.", -1)
|
|
836
832
|
])]))
|
|
837
|
-
])) :
|
|
833
|
+
])) : k("", !0)
|
|
838
834
|
], 2)
|
|
839
835
|
], 2),
|
|
840
|
-
|
|
841
|
-
pagination:
|
|
836
|
+
q(i.$slots, "pagination", {
|
|
837
|
+
pagination: u.value,
|
|
842
838
|
tradePage: P,
|
|
843
|
-
error:
|
|
839
|
+
error: x(K)
|
|
844
840
|
}, () => [
|
|
845
|
-
!
|
|
841
|
+
!x(K) && u.value.count > 0 ? (a(), n("div", {
|
|
846
842
|
key: 0,
|
|
847
843
|
class: _(["px-3", l.class_pagination])
|
|
848
844
|
}, [
|
|
849
845
|
Q(Ie, {
|
|
850
846
|
filtering: !0,
|
|
851
|
-
pagination:
|
|
847
|
+
pagination: u.value,
|
|
852
848
|
onTradePage: P
|
|
853
849
|
}, null, 8, ["pagination"])
|
|
854
|
-
], 2)) :
|
|
850
|
+
], 2)) : k("", !0)
|
|
855
851
|
], !0),
|
|
856
|
-
|
|
852
|
+
x(o) ? (a(), n("div", {
|
|
857
853
|
key: 0,
|
|
858
854
|
class: "image-preview-container",
|
|
859
|
-
style: Se(
|
|
855
|
+
style: Se(x(h))
|
|
860
856
|
}, [
|
|
861
857
|
s("img", {
|
|
862
|
-
src:
|
|
858
|
+
src: x(v),
|
|
863
859
|
alt: "Preview",
|
|
864
860
|
class: "image-preview-large"
|
|
865
861
|
}, null, 8, Nt)
|
|
866
|
-
], 4)) :
|
|
862
|
+
], 4)) : k("", !0)
|
|
867
863
|
]));
|
|
868
864
|
}
|
|
869
|
-
}),
|
|
865
|
+
}), Vt = /* @__PURE__ */ W(At, [["__scopeId", "data-v-5a415ab2"]]);
|
|
870
866
|
export {
|
|
871
|
-
|
|
872
|
-
|
|
867
|
+
Ht as VColumn,
|
|
868
|
+
Vt as VDataTable
|
|
873
869
|
};
|