v-sistec-features 1.18.0-beta.1 → 1.18.0-beta.2
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/Pagination.d.ts +1 -1
- package/dist/core.d.ts +55 -1
- package/dist/core.js +1 -1
- package/dist/datatableConfig-BMFlKtgh.js +4 -0
- package/dist/index.d.ts +55 -1
- package/dist/index.js +1 -1
- package/dist/{plugin-C0f4EPnK.js → plugin-BwqrOSD_.js} +235 -230
- package/dist/v-sistec-features.css +1 -1
- package/dist/vDataTable.js +597 -567
- package/package.json +1 -1
- package/src/DatatableVue/components/VDataTable.vue +81 -61
- package/src/config/datatableConfig.ts +8 -0
- package/src/core/plugin.ts +18 -4
package/dist/vDataTable.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { defineComponent as J, useSlots as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import { defineComponent as J, useSlots as De, inject as ue, onMounted as Ee, computed as z, watch as X, resolveComponent as je, createElementBlock as l, openBlock as t, createCommentVNode as x, createElementVNode as e, withDirectives as ce, withKeys as Ie, vModelText as pe, Fragment as T, renderList as j, createBlock as W, withCtx as H, createTextVNode as I, toDisplayString as k, normalizeClass as g, withModifiers as de, ref as C, nextTick as _e, resolveDynamicComponent as me, provide as Ne, readonly as Ae, renderSlot as P, createVNode as Y, unref as h, createStaticVNode as Pe, TransitionGroup as qe, mergeProps as Le, Transition as Oe, normalizeStyle as He } from "vue";
|
|
2
|
+
import { D as Fe } from "./datatableConfig-BMFlKtgh.js";
|
|
3
|
+
import { _ as ae, P as Ue } from "./Pagination-DtVDFQ07.js";
|
|
4
|
+
import Ke from "vuedraggable";
|
|
5
|
+
const ve = Symbol("v-datatable-key"), ma = /* @__PURE__ */ J({
|
|
5
6
|
__name: "VColumn",
|
|
6
7
|
props: {
|
|
7
8
|
field: { default: null },
|
|
@@ -22,61 +23,61 @@ const me = Symbol("v-datatable-key"), ua = /* @__PURE__ */ J({
|
|
|
22
23
|
increasing_value: { default: "" },
|
|
23
24
|
class_rules: { default: () => ({}) }
|
|
24
25
|
},
|
|
25
|
-
setup(
|
|
26
|
-
const
|
|
27
|
-
if (!
|
|
26
|
+
setup(u) {
|
|
27
|
+
const i = u, f = De(), n = ue(ve);
|
|
28
|
+
if (!n)
|
|
28
29
|
throw new Error("VColumn deve ser usado dentro de um VDataTable.");
|
|
29
|
-
const
|
|
30
|
-
return
|
|
31
|
-
if (
|
|
30
|
+
const m = ["text", "img", "date", "html"];
|
|
31
|
+
return Ee(() => {
|
|
32
|
+
if (i.field !== null && !i.field)
|
|
32
33
|
throw new Error('A propriedade "field" é obrigatória em VColumn.');
|
|
33
|
-
if (!
|
|
34
|
+
if (!i.header)
|
|
34
35
|
throw new Error('A propriedade "header" é obrigatória em VColumn.');
|
|
35
|
-
if (
|
|
36
|
-
throw new Error(`O tipo "${
|
|
37
|
-
if (
|
|
38
|
-
if (
|
|
36
|
+
if (i.field !== null && !m.includes(i.type))
|
|
37
|
+
throw new Error(`O tipo "${i.type}" não é suportado em VColumn. Tipos suportados: text, img, date, html.`);
|
|
38
|
+
if (i.limite_text) {
|
|
39
|
+
if (i.type !== "text")
|
|
39
40
|
throw new Error('A propriedade "limite_text" só pode ser usada quando o tipo for "text".');
|
|
40
|
-
if (typeof
|
|
41
|
+
if (typeof i.limite_text == "string" && isNaN(Number(i.limite_text)))
|
|
41
42
|
throw new Error('A propriedade "limite_text" deve ser um número quando for uma string.');
|
|
42
|
-
if (isNaN(Number(
|
|
43
|
+
if (isNaN(Number(i.limite_text)) || Number(i.limite_text) <= 0)
|
|
43
44
|
throw new Error('A propriedade "limite_text" deve ser um número maior que 0.');
|
|
44
45
|
}
|
|
45
|
-
|
|
46
|
-
field:
|
|
47
|
-
header:
|
|
48
|
-
type:
|
|
49
|
-
class_column:
|
|
50
|
-
class_row:
|
|
51
|
-
class_item:
|
|
52
|
-
click:
|
|
53
|
-
transform_function:
|
|
54
|
-
locked:
|
|
55
|
-
use_ordering:
|
|
56
|
-
param_ordering:
|
|
57
|
-
decreasing_value:
|
|
58
|
-
increasing_value:
|
|
59
|
-
class_rules:
|
|
60
|
-
bodySlot:
|
|
61
|
-
...
|
|
62
|
-
...
|
|
63
|
-
...
|
|
46
|
+
n.addColumn({
|
|
47
|
+
field: i.field,
|
|
48
|
+
header: i.header,
|
|
49
|
+
type: i.type,
|
|
50
|
+
class_column: i.class_column,
|
|
51
|
+
class_row: i.class_row,
|
|
52
|
+
class_item: i.class_item,
|
|
53
|
+
click: i.click,
|
|
54
|
+
transform_function: i.transform_function,
|
|
55
|
+
locked: i.locked,
|
|
56
|
+
use_ordering: i.use_ordering,
|
|
57
|
+
param_ordering: i.param_ordering,
|
|
58
|
+
decreasing_value: i.decreasing_value,
|
|
59
|
+
increasing_value: i.increasing_value,
|
|
60
|
+
class_rules: i.class_rules,
|
|
61
|
+
bodySlot: f.body,
|
|
62
|
+
...i.type === "text" && { limite_text: Number(i.limite_text) },
|
|
63
|
+
...i.type === "img" && { deactivate_img_preview: i.deactivate_img_preview },
|
|
64
|
+
...i.type === "date" && { format: i.format }
|
|
64
65
|
});
|
|
65
|
-
}), (p,
|
|
66
|
+
}), (p, V) => null;
|
|
66
67
|
}
|
|
67
|
-
}),
|
|
68
|
+
}), Ye = { class: "dropdown d-flex" }, Xe = {
|
|
68
69
|
key: 0,
|
|
69
70
|
href: "#",
|
|
70
71
|
class: "btn dropdown-toggle",
|
|
71
72
|
"data-bs-toggle": "dropdown",
|
|
72
73
|
title: "Pesquisas Prédefinidas"
|
|
73
|
-
},
|
|
74
|
+
}, Ge = { class: "input-icon" }, We = ["placeholder"], Je = {
|
|
74
75
|
key: 1,
|
|
75
76
|
class: "input-icon-addon"
|
|
76
|
-
},
|
|
77
|
+
}, Qe = {
|
|
77
78
|
key: 1,
|
|
78
79
|
class: "dropdown-menu"
|
|
79
|
-
},
|
|
80
|
+
}, Re = ["onClick"], Ze = ["onClick"], et = /* @__PURE__ */ J({
|
|
80
81
|
__name: "SearchDatatable",
|
|
81
82
|
props: {
|
|
82
83
|
search: {},
|
|
@@ -88,41 +89,41 @@ const me = Symbol("v-datatable-key"), ua = /* @__PURE__ */ J({
|
|
|
88
89
|
deactivate_search_empty: { type: Boolean, default: !1 }
|
|
89
90
|
},
|
|
90
91
|
emits: ["update:search", "update:filter", "search", "clickedClearSearch"],
|
|
91
|
-
setup(
|
|
92
|
-
const
|
|
93
|
-
get: () =>
|
|
94
|
-
set: (
|
|
95
|
-
}), p =
|
|
96
|
-
get: () =>
|
|
97
|
-
set: (
|
|
92
|
+
setup(u, { emit: i }) {
|
|
93
|
+
const f = u, n = i, m = z({
|
|
94
|
+
get: () => f.search,
|
|
95
|
+
set: (o) => n("update:search", o)
|
|
96
|
+
}), p = z({
|
|
97
|
+
get: () => f.filter,
|
|
98
|
+
set: (o) => n("update:filter", o)
|
|
98
99
|
});
|
|
99
100
|
X(p, () => {
|
|
100
|
-
|
|
101
|
+
n("search");
|
|
101
102
|
}), X(
|
|
102
|
-
() =>
|
|
103
|
-
(
|
|
104
|
-
Array.isArray(
|
|
105
|
-
|
|
106
|
-
}),
|
|
103
|
+
() => f.list_filter,
|
|
104
|
+
(o) => {
|
|
105
|
+
Array.isArray(o) ? (o.forEach((s, w) => {
|
|
106
|
+
s?.type === 1 && !s.to && console.error(`Filtro na posição ${w} é do tipo 'router-link' mas não possui a propriedade 'to'.`);
|
|
107
|
+
}), f.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.");
|
|
107
108
|
},
|
|
108
109
|
{ immediate: !0, deep: !0 }
|
|
109
110
|
);
|
|
110
|
-
function
|
|
111
|
-
p.value ===
|
|
111
|
+
function V(o) {
|
|
112
|
+
p.value === o ? p.value = "" : p.value = o;
|
|
112
113
|
}
|
|
113
|
-
function
|
|
114
|
-
|
|
114
|
+
function E() {
|
|
115
|
+
m.value = "", f.deactivate_search_on_clear || n("search"), n("clickedClearSearch");
|
|
115
116
|
}
|
|
116
|
-
function
|
|
117
|
-
|
|
117
|
+
function B(o) {
|
|
118
|
+
o.click && typeof o.click == "function" ? o.click() : console.error("O filtro selecionado não possui uma função de clique válida.");
|
|
118
119
|
}
|
|
119
|
-
function
|
|
120
|
-
|
|
120
|
+
function v() {
|
|
121
|
+
f.deactivate_search_empty && m.value.trim() === "" || n("search");
|
|
121
122
|
}
|
|
122
|
-
return (
|
|
123
|
-
const
|
|
124
|
-
return t(),
|
|
125
|
-
|
|
123
|
+
return (o, s) => {
|
|
124
|
+
const w = je("router-link");
|
|
125
|
+
return t(), l("div", Ye, [
|
|
126
|
+
u.item_use.includes(2) ? (t(), l("a", Xe, [...s[2] || (s[2] = [
|
|
126
127
|
e("svg", {
|
|
127
128
|
xmlns: "http://www.w3.org/2000/svg",
|
|
128
129
|
class: "icon icon-tabler icon-tabler-filter",
|
|
@@ -143,23 +144,23 @@ const me = Symbol("v-datatable-key"), ua = /* @__PURE__ */ J({
|
|
|
143
144
|
e("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" })
|
|
144
145
|
], -1)
|
|
145
146
|
])])) : x("", !0),
|
|
146
|
-
e("div",
|
|
147
|
-
|
|
147
|
+
e("div", Ge, [
|
|
148
|
+
ce(e("input", {
|
|
148
149
|
type: "text",
|
|
149
150
|
class: "form-control ms-1",
|
|
150
151
|
id: "inputSearchVDataTable",
|
|
151
|
-
"onUpdate:modelValue":
|
|
152
|
-
onKeyup:
|
|
153
|
-
placeholder:
|
|
154
|
-
}, null, 40,
|
|
155
|
-
[
|
|
152
|
+
"onUpdate:modelValue": s[0] || (s[0] = (c) => m.value = c),
|
|
153
|
+
onKeyup: Ie(v, ["enter"]),
|
|
154
|
+
placeholder: u.placeholder_search
|
|
155
|
+
}, null, 40, We), [
|
|
156
|
+
[pe, m.value]
|
|
156
157
|
]),
|
|
157
|
-
|
|
158
|
+
m.value ? (t(), l("span", {
|
|
158
159
|
key: 0,
|
|
159
|
-
onClick:
|
|
160
|
+
onClick: s[1] || (s[1] = (c) => E()),
|
|
160
161
|
class: "inputClose",
|
|
161
162
|
title: "Limpar pesquisa"
|
|
162
|
-
}, [...
|
|
163
|
+
}, [...s[3] || (s[3] = [
|
|
163
164
|
e("svg", {
|
|
164
165
|
xmlns: "http://www.w3.org/2000/svg",
|
|
165
166
|
width: "24",
|
|
@@ -180,7 +181,7 @@ const me = Symbol("v-datatable-key"), ua = /* @__PURE__ */ J({
|
|
|
180
181
|
e("path", { d: "M18 6l-12 12" }),
|
|
181
182
|
e("path", { d: "M6 6l12 12" })
|
|
182
183
|
], -1)
|
|
183
|
-
])])) : (t(),
|
|
184
|
+
])])) : (t(), l("span", Je, [...s[4] || (s[4] = [
|
|
184
185
|
e("svg", {
|
|
185
186
|
xmlns: "http://www.w3.org/2000/svg",
|
|
186
187
|
width: "24",
|
|
@@ -203,213 +204,213 @@ const me = Symbol("v-datatable-key"), ua = /* @__PURE__ */ J({
|
|
|
203
204
|
], -1)
|
|
204
205
|
])]))
|
|
205
206
|
]),
|
|
206
|
-
|
|
207
|
-
(t(!0),
|
|
208
|
-
"type" in
|
|
207
|
+
u.item_use.includes(2) ? (t(), l("div", Qe, [
|
|
208
|
+
(t(!0), l(T, null, j(f.list_filter, (c, $) => (t(), l(T, { key: $ }, [
|
|
209
|
+
"type" in c && c.type === 1 && (!("visible" in c) || c.visible) ? (t(), W(w, {
|
|
209
210
|
key: 0,
|
|
210
|
-
to:
|
|
211
|
+
to: c?.to,
|
|
211
212
|
class: "dropdown-item cursor-pointer"
|
|
212
213
|
}, {
|
|
213
|
-
default:
|
|
214
|
-
|
|
214
|
+
default: H(() => [
|
|
215
|
+
I(k(c.text), 1)
|
|
215
216
|
]),
|
|
216
217
|
_: 2
|
|
217
|
-
}, 1032, ["to"])) : (!("type" in
|
|
218
|
+
}, 1032, ["to"])) : (!("type" in c) || c.type === 2) && (!("visible" in c) || c.visible) ? (t(), l("a", {
|
|
218
219
|
key: 1,
|
|
219
|
-
onClick:
|
|
220
|
-
class: g(["dropdown-item cursor-pointer", p.value ===
|
|
221
|
-
},
|
|
220
|
+
onClick: de((M) => V(String(c.value)), ["prevent"]),
|
|
221
|
+
class: g(["dropdown-item cursor-pointer", p.value === c?.value ? "bg-info text-dark selected" : ""])
|
|
222
|
+
}, k(c.text), 11, Re)) : (!("type" in c) || c.type === 3) && (!("visible" in c) || c.visible) ? (t(), l("a", {
|
|
222
223
|
key: 2,
|
|
223
|
-
onClick:
|
|
224
|
-
class: g(["dropdown-item cursor-pointer",
|
|
225
|
-
},
|
|
224
|
+
onClick: de((M) => B(c), ["prevent"]),
|
|
225
|
+
class: g(["dropdown-item cursor-pointer", c?.active ? "bg-info text-dark selected" : ""])
|
|
226
|
+
}, k(c.text), 11, Ze)) : x("", !0)
|
|
226
227
|
], 64))), 128))
|
|
227
228
|
])) : x("", !0)
|
|
228
229
|
]);
|
|
229
230
|
};
|
|
230
231
|
}
|
|
231
|
-
}),
|
|
232
|
-
function
|
|
233
|
-
const
|
|
232
|
+
}), tt = /* @__PURE__ */ ae(et, [["__scopeId", "data-v-ed591287"]]);
|
|
233
|
+
function at() {
|
|
234
|
+
const u = C(!1), i = C(""), f = C(0), n = C(0), m = z(() => ({
|
|
234
235
|
position: "fixed",
|
|
235
236
|
zIndex: 9999,
|
|
236
237
|
pointerEvents: "none",
|
|
237
|
-
top: `${
|
|
238
|
-
left: `${
|
|
238
|
+
top: `${n.value + 15}px`,
|
|
239
|
+
left: `${f.value + 15}px`
|
|
239
240
|
}));
|
|
240
|
-
function p(
|
|
241
|
-
const
|
|
242
|
-
let
|
|
243
|
-
|
|
241
|
+
function p(v) {
|
|
242
|
+
const o = v.clientX, s = v.clientY, w = window.innerHeight, c = 15, $ = 300;
|
|
243
|
+
let M = s + c;
|
|
244
|
+
M + $ > w && (M = s - $ - c, M < 0 && (M = 0)), f.value = o, n.value = M;
|
|
244
245
|
}
|
|
245
|
-
function
|
|
246
|
-
|
|
246
|
+
function V(v, o) {
|
|
247
|
+
u.value = !0, i.value = o, p(v);
|
|
247
248
|
}
|
|
248
|
-
function
|
|
249
|
-
|
|
249
|
+
function E(v) {
|
|
250
|
+
u.value && p(v);
|
|
250
251
|
}
|
|
251
|
-
function
|
|
252
|
-
|
|
252
|
+
function B() {
|
|
253
|
+
u.value = !1;
|
|
253
254
|
}
|
|
254
255
|
return {
|
|
255
|
-
isHovering:
|
|
256
|
-
previewSrc:
|
|
257
|
-
previewStyle:
|
|
258
|
-
handleMouseOver:
|
|
259
|
-
handleMouseMove:
|
|
260
|
-
handleMouseLeave:
|
|
256
|
+
isHovering: u,
|
|
257
|
+
previewSrc: i,
|
|
258
|
+
previewStyle: m,
|
|
259
|
+
handleMouseOver: V,
|
|
260
|
+
handleMouseMove: E,
|
|
261
|
+
handleMouseLeave: B
|
|
261
262
|
};
|
|
262
263
|
}
|
|
263
|
-
function
|
|
264
|
-
const
|
|
264
|
+
function nt(u, i, f, n) {
|
|
265
|
+
const m = C([]);
|
|
265
266
|
function p() {
|
|
266
|
-
|
|
267
|
+
m.value = [];
|
|
267
268
|
}
|
|
268
|
-
function
|
|
269
|
-
const
|
|
270
|
-
return
|
|
269
|
+
function V(v) {
|
|
270
|
+
const o = v[i];
|
|
271
|
+
return m.value.some((s) => s === o);
|
|
271
272
|
}
|
|
272
|
-
function
|
|
273
|
-
const
|
|
274
|
-
|
|
273
|
+
function E(v) {
|
|
274
|
+
const o = v[i], s = m.value.findIndex((c) => c === o), w = s > -1;
|
|
275
|
+
u ? (p(), w || (m.value.push(o), n && B(o))) : w ? m.value.splice(s, 1) : (m.value.push(o), n && B(o));
|
|
275
276
|
}
|
|
276
|
-
function
|
|
277
|
-
|
|
278
|
-
if (
|
|
279
|
-
const
|
|
280
|
-
|
|
277
|
+
function B(v) {
|
|
278
|
+
_e(() => {
|
|
279
|
+
if (f) {
|
|
280
|
+
const o = document.querySelector("#expand-item-" + v);
|
|
281
|
+
o && o.scrollIntoView({ behavior: "smooth", block: "center" });
|
|
281
282
|
return;
|
|
282
283
|
} else
|
|
283
284
|
setTimeout(() => {
|
|
284
|
-
const
|
|
285
|
-
|
|
285
|
+
const o = document.querySelector("#expand-item-" + v);
|
|
286
|
+
o && o.scrollIntoView({ behavior: "smooth", block: "center" });
|
|
286
287
|
}, 600);
|
|
287
288
|
});
|
|
288
289
|
}
|
|
289
290
|
return {
|
|
290
|
-
expanded_items:
|
|
291
|
-
is_item_expanded:
|
|
292
|
-
expand_item_toggle:
|
|
291
|
+
expanded_items: m,
|
|
292
|
+
is_item_expanded: V,
|
|
293
|
+
expand_item_toggle: E,
|
|
293
294
|
close_all_expanded_items: p
|
|
294
295
|
};
|
|
295
296
|
}
|
|
296
|
-
function
|
|
297
|
-
const
|
|
298
|
-
[
|
|
299
|
-
[
|
|
300
|
-
[
|
|
301
|
-
[
|
|
302
|
-
})),
|
|
303
|
-
const
|
|
304
|
-
for (const
|
|
305
|
-
|
|
306
|
-
return
|
|
307
|
-
}), { data:
|
|
308
|
-
disable_request: () =>
|
|
297
|
+
function lt(u, i, f, n, m, p) {
|
|
298
|
+
const V = C([]), E = z(() => (i.value.current_page = u.page_starts_at, u.endpoint)), B = z(() => ({
|
|
299
|
+
[u.page_param_name]: i.value.current_page + 1,
|
|
300
|
+
[u.page_size_param_name]: i.value.limit_per_page,
|
|
301
|
+
[u.search_param_name]: i.value.search || "",
|
|
302
|
+
[u.filter_param_name]: i.value.filter || ""
|
|
303
|
+
})), v = z(() => {
|
|
304
|
+
const D = {};
|
|
305
|
+
for (const S of f.value)
|
|
306
|
+
S.use_ordering && (n.value[S.header] === "increasing" ? D[S.param_ordering] = S.increasing_value || "increasing" : n.value[S.header] === "decreasing" && (D[S.param_ordering] = S.decreasing_value || "decreasing"));
|
|
307
|
+
return D;
|
|
308
|
+
}), { data: o, pending: s, error: w, execute: c, attempt: $ } = u.fetch(E, {
|
|
309
|
+
disable_request: () => u.disable_request,
|
|
309
310
|
params: () => {
|
|
310
|
-
const
|
|
311
|
-
let
|
|
312
|
-
if (
|
|
313
|
-
const Q =
|
|
314
|
-
|
|
311
|
+
const D = typeof u.add_params == "function";
|
|
312
|
+
let S = {};
|
|
313
|
+
if (D) {
|
|
314
|
+
const Q = u.add_params;
|
|
315
|
+
S = Q();
|
|
315
316
|
} else
|
|
316
|
-
|
|
317
|
-
return
|
|
318
|
-
...
|
|
319
|
-
...
|
|
317
|
+
S = u.add_params || {};
|
|
318
|
+
return u.deactivate_default_params ? {
|
|
319
|
+
...S,
|
|
320
|
+
...v.value
|
|
320
321
|
} : {
|
|
321
|
-
...
|
|
322
|
-
...
|
|
323
|
-
...
|
|
322
|
+
...B.value,
|
|
323
|
+
...u.add_params,
|
|
324
|
+
...v.value
|
|
324
325
|
};
|
|
325
326
|
},
|
|
326
|
-
retry:
|
|
327
|
-
retryDelay:
|
|
327
|
+
retry: u.retry_attempts,
|
|
328
|
+
retryDelay: u.retry_delay,
|
|
328
329
|
paramsReactives: !1,
|
|
329
330
|
immediate: !1
|
|
330
|
-
},
|
|
331
|
-
async function
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
},
|
|
331
|
+
}, u.fetch_name), M = C(!1), q = C(null), y = C(!1), F = z(() => s.value || M.value);
|
|
332
|
+
async function U() {
|
|
333
|
+
y.value || (y.value = !0), q.value && clearTimeout(q.value), M.value = !0, q.value = setTimeout(() => {
|
|
334
|
+
M.value = !1;
|
|
335
|
+
}, u.min_loading_delay), p(), m("beforeFetch"), await c(), m("afterFetch");
|
|
335
336
|
}
|
|
336
337
|
function K() {
|
|
337
|
-
|
|
338
|
+
i.value.current_page = u.page_starts_at, U();
|
|
338
339
|
}
|
|
339
340
|
return {
|
|
340
|
-
items:
|
|
341
|
-
pending:
|
|
342
|
-
error:
|
|
343
|
-
execute:
|
|
344
|
-
response:
|
|
345
|
-
attempt:
|
|
346
|
-
default_params:
|
|
347
|
-
fetchDataWithDelay:
|
|
341
|
+
items: V,
|
|
342
|
+
pending: s,
|
|
343
|
+
error: w,
|
|
344
|
+
execute: c,
|
|
345
|
+
response: o,
|
|
346
|
+
attempt: $,
|
|
347
|
+
default_params: B,
|
|
348
|
+
fetchDataWithDelay: U,
|
|
348
349
|
reSearch: K,
|
|
349
|
-
showLoadingState:
|
|
350
|
-
first_fetch:
|
|
350
|
+
showLoadingState: F,
|
|
351
|
+
first_fetch: y
|
|
351
352
|
};
|
|
352
353
|
}
|
|
353
|
-
function
|
|
354
|
-
const
|
|
355
|
-
const
|
|
356
|
-
return
|
|
357
|
-
}, p =
|
|
358
|
-
if (!
|
|
359
|
-
const
|
|
360
|
-
return
|
|
361
|
-
}),
|
|
362
|
-
X([p,
|
|
363
|
-
|
|
354
|
+
function st(u, i) {
|
|
355
|
+
const f = C(null), n = C([]), m = (v) => {
|
|
356
|
+
const o = u.item_key;
|
|
357
|
+
return n.value.some((s) => s[o] === v[o]);
|
|
358
|
+
}, p = z(() => {
|
|
359
|
+
if (!i.value.length) return !1;
|
|
360
|
+
const v = i.value.filter((o) => m(o)).length;
|
|
361
|
+
return v === 0 ? !1 : v === i.value.length ? !0 : "indeterminate";
|
|
362
|
+
}), V = z(() => n.value.length > 0);
|
|
363
|
+
X([p, f], ([v]) => {
|
|
364
|
+
f.value && (v === "indeterminate" ? (f.value.checked = !1, f.value.indeterminate = !0) : (f.value.checked = v, f.value.indeterminate = !1));
|
|
364
365
|
}, {
|
|
365
366
|
immediate: !0,
|
|
366
367
|
flush: "post"
|
|
367
368
|
});
|
|
368
|
-
function
|
|
369
|
-
const
|
|
370
|
-
if (!
|
|
371
|
-
const
|
|
372
|
-
if (
|
|
373
|
-
const
|
|
374
|
-
|
|
375
|
-
(
|
|
369
|
+
function E() {
|
|
370
|
+
const v = i.value;
|
|
371
|
+
if (!v.length) return;
|
|
372
|
+
const o = p.value;
|
|
373
|
+
if (o === !0 || o === "indeterminate") {
|
|
374
|
+
const s = v.map((w) => w[u.item_key]);
|
|
375
|
+
n.value = n.value.filter(
|
|
376
|
+
(w) => !s.includes(w[u.item_key])
|
|
376
377
|
);
|
|
377
378
|
} else
|
|
378
|
-
|
|
379
|
-
|
|
379
|
+
v.forEach((s) => {
|
|
380
|
+
m(s) || n.value.push(s);
|
|
380
381
|
});
|
|
381
382
|
}
|
|
382
|
-
function
|
|
383
|
-
const
|
|
384
|
-
|
|
383
|
+
function B(v) {
|
|
384
|
+
const o = u.item_key, s = n.value.findIndex((w) => w[o] === v[o]);
|
|
385
|
+
s > -1 ? n.value.splice(s, 1) : n.value.push(v);
|
|
385
386
|
}
|
|
386
387
|
return {
|
|
387
|
-
selectAllCheckbox:
|
|
388
|
-
selected_items:
|
|
389
|
-
isSelected:
|
|
388
|
+
selectAllCheckbox: f,
|
|
389
|
+
selected_items: n,
|
|
390
|
+
isSelected: m,
|
|
390
391
|
selectAllState: p,
|
|
391
|
-
atLeastOneSelected:
|
|
392
|
-
toggleSelectAll:
|
|
393
|
-
toggleItemSelection:
|
|
392
|
+
atLeastOneSelected: V,
|
|
393
|
+
toggleSelectAll: E,
|
|
394
|
+
toggleItemSelection: B
|
|
394
395
|
};
|
|
395
396
|
}
|
|
396
|
-
const
|
|
397
|
+
const rt = { class: "loading-container" }, ot = { key: 0 }, it = { key: 2 }, dt = {
|
|
397
398
|
key: 5,
|
|
398
399
|
class: "text-danger erro-custom-container"
|
|
399
|
-
},
|
|
400
|
+
}, ut = { class: "badge bg-orange text-white erro-custom-text" }, ct = { key: 0 }, pt = { key: 2 }, _t = {
|
|
400
401
|
key: 5,
|
|
401
402
|
class: "text-danger erro-custom-container"
|
|
402
|
-
},
|
|
403
|
+
}, mt = { class: "badge bg-orange text-white erro-custom-text" }, vt = ["colspan"], ht = {
|
|
403
404
|
key: 0,
|
|
404
405
|
class: "d-flex flex-column justify-content-center align-items-center",
|
|
405
406
|
style: { height: "6rem" }
|
|
406
|
-
},
|
|
407
|
+
}, gt = {
|
|
407
408
|
key: 1,
|
|
408
409
|
style: { height: "3rem" }
|
|
409
410
|
}, ft = {
|
|
410
411
|
key: 2,
|
|
411
412
|
class: "p-3 text-center text-secondary"
|
|
412
|
-
},
|
|
413
|
+
}, yt = /* @__PURE__ */ J({
|
|
413
414
|
__name: "VDataTableLoading",
|
|
414
415
|
props: {
|
|
415
416
|
columns: {},
|
|
@@ -420,96 +421,96 @@ const nt = { class: "loading-container" }, lt = { key: 0 }, st = { key: 2 }, ot
|
|
|
420
421
|
attempt: {},
|
|
421
422
|
pagination: {}
|
|
422
423
|
},
|
|
423
|
-
setup(
|
|
424
|
-
const
|
|
425
|
-
return (
|
|
426
|
-
|
|
424
|
+
setup(u) {
|
|
425
|
+
const i = u;
|
|
426
|
+
return (f, n) => (t(), l("div", rt, [
|
|
427
|
+
i.custom_loading ? (t(), W(me(i.custom_loading), { key: 0 })) : (t(), l("table", {
|
|
427
428
|
key: 1,
|
|
428
|
-
class: g(["table table-vcenter table-selectable",
|
|
429
|
+
class: g(["table table-vcenter table-selectable", i.class_table])
|
|
429
430
|
}, [
|
|
430
431
|
e("thead", null, [
|
|
431
432
|
e("tr", null, [
|
|
432
|
-
(t(!0),
|
|
433
|
-
key:
|
|
434
|
-
class: g(
|
|
435
|
-
},
|
|
433
|
+
(t(!0), l(T, null, j(u.columns, (m) => (t(), l("th", {
|
|
434
|
+
key: m.field || m.header,
|
|
435
|
+
class: g(m.class_column)
|
|
436
|
+
}, k(m.header), 3))), 128))
|
|
436
437
|
])
|
|
437
438
|
]),
|
|
438
439
|
e("tbody", null, [
|
|
439
|
-
|
|
440
|
-
key: "placeholder-" +
|
|
440
|
+
i.type_loading === "placeholder" ? (t(!0), l(T, { key: 0 }, j(u.pagination.limit_per_page, (m) => (t(), l("tr", {
|
|
441
|
+
key: "placeholder-" + m,
|
|
441
442
|
class: "placeholder-glow"
|
|
442
443
|
}, [
|
|
443
|
-
(t(!0),
|
|
444
|
+
(t(!0), l(T, null, j(u.columns, (p) => (t(), l("td", {
|
|
444
445
|
key: p.field || p.header,
|
|
445
446
|
class: g(p.class_row)
|
|
446
447
|
}, [
|
|
447
|
-
p.bodySlot ? (t(),
|
|
448
|
+
p.bodySlot ? (t(), l("span", ot, [...n[0] || (n[0] = [
|
|
448
449
|
e("span", { class: "placeholder col-8" }, null, -1)
|
|
449
|
-
])])) : p.type === "text" ? (t(),
|
|
450
|
+
])])) : p.type === "text" ? (t(), l("span", {
|
|
450
451
|
key: 1,
|
|
451
452
|
class: g(p.class_item)
|
|
452
|
-
}, [...
|
|
453
|
+
}, [...n[1] || (n[1] = [
|
|
453
454
|
e("span", { class: "placeholder col-8" }, null, -1)
|
|
454
|
-
])], 2)) : p.type === "date" ? (t(),
|
|
455
|
+
])], 2)) : p.type === "date" ? (t(), l("span", it, [...n[2] || (n[2] = [
|
|
455
456
|
e("span", { class: "placeholder col-9" }, null, -1)
|
|
456
|
-
])])) : p.type === "html" ? (t(),
|
|
457
|
+
])])) : p.type === "html" ? (t(), l("div", {
|
|
457
458
|
key: 3,
|
|
458
459
|
class: g(p.class_item)
|
|
459
|
-
}, [...
|
|
460
|
+
}, [...n[3] || (n[3] = [
|
|
460
461
|
e("div", { class: "placeholder col-12" }, null, -1)
|
|
461
|
-
])], 2)) : p.type === "img" ? (t(),
|
|
462
|
+
])], 2)) : p.type === "img" ? (t(), l("div", {
|
|
462
463
|
key: 4,
|
|
463
464
|
class: g(p.class_item)
|
|
464
|
-
}, [...
|
|
465
|
+
}, [...n[4] || (n[4] = [
|
|
465
466
|
e("div", { class: "placeholder placeholder-img" }, null, -1)
|
|
466
|
-
])], 2)) : (t(),
|
|
467
|
-
|
|
468
|
-
e("span",
|
|
469
|
-
|
|
467
|
+
])], 2)) : (t(), l("span", dt, [
|
|
468
|
+
n[5] || (n[5] = I("tipo ", -1)),
|
|
469
|
+
e("span", ut, k(p.type), 1),
|
|
470
|
+
n[6] || (n[6] = I(" não suportado ", -1))
|
|
470
471
|
]))
|
|
471
472
|
], 2))), 128))
|
|
472
|
-
]))), 128)) :
|
|
473
|
-
key: "placeholder-" +
|
|
473
|
+
]))), 128)) : i.type_loading === "spiner-table" ? (t(!0), l(T, { key: 1 }, j(u.pagination.limit_per_page, (m) => (t(), l("tr", {
|
|
474
|
+
key: "placeholder-" + m
|
|
474
475
|
}, [
|
|
475
|
-
(t(!0),
|
|
476
|
+
(t(!0), l(T, null, j(u.columns, (p) => (t(), l("td", {
|
|
476
477
|
key: p.field || p.header,
|
|
477
478
|
class: g(p.class_row)
|
|
478
479
|
}, [
|
|
479
|
-
p.bodySlot ? (t(),
|
|
480
|
+
p.bodySlot ? (t(), l("span", ct, [...n[7] || (n[7] = [
|
|
480
481
|
e("span", {
|
|
481
482
|
class: "spinner-border spinner-border-sm",
|
|
482
483
|
role: "status",
|
|
483
484
|
"aria-hidden": "true"
|
|
484
485
|
}, null, -1)
|
|
485
|
-
])])) : p.type === "text" ? (t(),
|
|
486
|
+
])])) : p.type === "text" ? (t(), l("span", {
|
|
486
487
|
key: 1,
|
|
487
488
|
class: g(p.class_item)
|
|
488
|
-
}, [...
|
|
489
|
+
}, [...n[8] || (n[8] = [
|
|
489
490
|
e("span", {
|
|
490
491
|
class: "spinner-border spinner-border-sm",
|
|
491
492
|
role: "status",
|
|
492
493
|
"aria-hidden": "true"
|
|
493
494
|
}, null, -1)
|
|
494
|
-
])], 2)) : p.type === "date" ? (t(),
|
|
495
|
+
])], 2)) : p.type === "date" ? (t(), l("span", pt, [...n[9] || (n[9] = [
|
|
495
496
|
e("span", {
|
|
496
497
|
class: "spinner-border spinner-border-sm",
|
|
497
498
|
role: "status",
|
|
498
499
|
"aria-hidden": "true"
|
|
499
500
|
}, null, -1)
|
|
500
|
-
])])) : p.type === "html" ? (t(),
|
|
501
|
+
])])) : p.type === "html" ? (t(), l("div", {
|
|
501
502
|
key: 3,
|
|
502
503
|
class: g(p.class_item)
|
|
503
|
-
}, [...
|
|
504
|
+
}, [...n[10] || (n[10] = [
|
|
504
505
|
e("span", {
|
|
505
506
|
class: "spinner-border spinner-border-sm",
|
|
506
507
|
role: "status",
|
|
507
508
|
"aria-hidden": "true"
|
|
508
509
|
}, null, -1)
|
|
509
|
-
])], 2)) : p.type === "img" ? (t(),
|
|
510
|
+
])], 2)) : p.type === "img" ? (t(), l("div", {
|
|
510
511
|
key: 4,
|
|
511
512
|
class: g(["", p.class_item])
|
|
512
|
-
}, [...
|
|
513
|
+
}, [...n[11] || (n[11] = [
|
|
513
514
|
e("span", { class: "placeholder-img d-flex justify-content-center align-items-center" }, [
|
|
514
515
|
e("span", {
|
|
515
516
|
class: "spinner-border spinner-border-sm",
|
|
@@ -517,53 +518,53 @@ const nt = { class: "loading-container" }, lt = { key: 0 }, st = { key: 2 }, ot
|
|
|
517
518
|
"aria-hidden": "true"
|
|
518
519
|
})
|
|
519
520
|
], -1)
|
|
520
|
-
])], 2)) : (t(),
|
|
521
|
-
|
|
522
|
-
e("span",
|
|
523
|
-
|
|
521
|
+
])], 2)) : (t(), l("span", _t, [
|
|
522
|
+
n[12] || (n[12] = I("tipo ", -1)),
|
|
523
|
+
e("span", mt, k(p.type), 1),
|
|
524
|
+
n[13] || (n[13] = I(" não suportado ", -1))
|
|
524
525
|
]))
|
|
525
526
|
], 2))), 128))
|
|
526
|
-
]))), 128)) :
|
|
527
|
+
]))), 128)) : i.type_loading === "spiner" ? (t(!0), l(T, { key: 2 }, j(u.pagination.limit_per_page, (m) => (t(), l("tr", { key: m }, [
|
|
527
528
|
e("td", {
|
|
528
|
-
colspan:
|
|
529
|
+
colspan: u.columns.length,
|
|
529
530
|
class: "text-center p-0",
|
|
530
531
|
style: { "border-bottom": "none" }
|
|
531
532
|
}, [
|
|
532
|
-
|
|
533
|
+
m === Math.floor(u.pagination.limit_per_page / 2) + 1 ? (t(), l("div", ht, [...n[14] || (n[14] = [
|
|
533
534
|
e("div", {
|
|
534
535
|
class: "spinner-border",
|
|
535
536
|
style: { width: "3rem", height: "3rem" },
|
|
536
537
|
role: "status"
|
|
537
538
|
}, null, -1),
|
|
538
539
|
e("span", { class: "mt-2" }, "Carregando...", -1)
|
|
539
|
-
])])) : (t(),
|
|
540
|
-
], 8,
|
|
540
|
+
])])) : (t(), l("div", gt))
|
|
541
|
+
], 8, vt)
|
|
541
542
|
]))), 128)) : x("", !0)
|
|
542
543
|
])
|
|
543
544
|
], 2)),
|
|
544
|
-
|
|
545
|
+
u.attempt && u.attempt.current > 1 ? (t(), l("div", ft, " A conexão falhou. Tentando novamente... (Tentativa " + k(u.attempt.current) + " de " + k(u.attempt.total) + ") ", 1)) : x("", !0)
|
|
545
546
|
]));
|
|
546
547
|
}
|
|
547
|
-
}),
|
|
548
|
+
}), kt = /* @__PURE__ */ ae(yt, [["__scopeId", "data-v-3b019685"]]), wt = { class: "mx-2 d-inline-block" }, xt = {
|
|
548
549
|
key: 0,
|
|
549
550
|
class: "alert alert-cyan d-flex justify-content-center align-items-center py-2",
|
|
550
551
|
role: "alert"
|
|
551
|
-
},
|
|
552
|
+
}, bt = { class: "alert-title m-0" }, Ct = { class: "badge bg-azure text-azure-fg" }, Mt = {
|
|
552
553
|
key: 1,
|
|
553
554
|
class: "feedback-container text-center"
|
|
554
|
-
},
|
|
555
|
+
}, St = {
|
|
555
556
|
key: 0,
|
|
556
557
|
class: "text-secondary"
|
|
557
|
-
},
|
|
558
|
+
}, $t = {
|
|
558
559
|
key: 1,
|
|
559
560
|
class: "text-secondary"
|
|
560
|
-
},
|
|
561
|
+
}, zt = {
|
|
561
562
|
key: 2,
|
|
562
563
|
class: "table-responsive"
|
|
563
|
-
},
|
|
564
|
+
}, Bt = { key: 0 }, Tt = { key: 0 }, Vt = {
|
|
564
565
|
key: 1,
|
|
565
566
|
class: "w-1"
|
|
566
|
-
},
|
|
567
|
+
}, Dt = { class: "header-ordering" }, Et = ["onClick"], jt = {
|
|
567
568
|
key: 0,
|
|
568
569
|
xmlns: "http://www.w3.org/2000/svg",
|
|
569
570
|
width: "16",
|
|
@@ -574,7 +575,7 @@ const nt = { class: "loading-container" }, lt = { key: 0 }, st = { key: 2 }, ot
|
|
|
574
575
|
"stroke-width": "2",
|
|
575
576
|
"stroke-linecap": "round",
|
|
576
577
|
"stroke-linejoin": "round"
|
|
577
|
-
},
|
|
578
|
+
}, It = {
|
|
578
579
|
key: 1,
|
|
579
580
|
xmlns: "http://www.w3.org/2000/svg",
|
|
580
581
|
width: "16",
|
|
@@ -585,7 +586,7 @@ const nt = { class: "loading-container" }, lt = { key: 0 }, st = { key: 2 }, ot
|
|
|
585
586
|
"stroke-width": "2",
|
|
586
587
|
"stroke-linecap": "round",
|
|
587
588
|
"stroke-linejoin": "round"
|
|
588
|
-
},
|
|
589
|
+
}, Nt = {
|
|
589
590
|
key: 2,
|
|
590
591
|
xmlns: "http://www.w3.org/2000/svg",
|
|
591
592
|
width: "16",
|
|
@@ -596,7 +597,7 @@ const nt = { class: "loading-container" }, lt = { key: 0 }, st = { key: 2 }, ot
|
|
|
596
597
|
"stroke-width": "2",
|
|
597
598
|
"stroke-linecap": "round",
|
|
598
599
|
"stroke-linejoin": "round"
|
|
599
|
-
},
|
|
600
|
+
}, At = { class: "header-ordering" }, Pt = ["onClick"], qt = {
|
|
600
601
|
key: 0,
|
|
601
602
|
xmlns: "http://www.w3.org/2000/svg",
|
|
602
603
|
width: "16",
|
|
@@ -607,7 +608,7 @@ const nt = { class: "loading-container" }, lt = { key: 0 }, st = { key: 2 }, ot
|
|
|
607
608
|
"stroke-width": "2",
|
|
608
609
|
"stroke-linecap": "round",
|
|
609
610
|
"stroke-linejoin": "round"
|
|
610
|
-
},
|
|
611
|
+
}, Lt = {
|
|
611
612
|
key: 1,
|
|
612
613
|
xmlns: "http://www.w3.org/2000/svg",
|
|
613
614
|
width: "16",
|
|
@@ -618,7 +619,7 @@ const nt = { class: "loading-container" }, lt = { key: 0 }, st = { key: 2 }, ot
|
|
|
618
619
|
"stroke-width": "2",
|
|
619
620
|
"stroke-linecap": "round",
|
|
620
621
|
"stroke-linejoin": "round"
|
|
621
|
-
},
|
|
622
|
+
}, Ot = {
|
|
622
623
|
key: 2,
|
|
623
624
|
xmlns: "http://www.w3.org/2000/svg",
|
|
624
625
|
width: "16",
|
|
@@ -629,10 +630,10 @@ const nt = { class: "loading-container" }, lt = { key: 0 }, st = { key: 2 }, ot
|
|
|
629
630
|
"stroke-width": "2",
|
|
630
631
|
"stroke-linecap": "round",
|
|
631
632
|
"stroke-linejoin": "round"
|
|
632
|
-
},
|
|
633
|
+
}, Ht = {
|
|
633
634
|
key: 0,
|
|
634
635
|
class: "w-1"
|
|
635
|
-
},
|
|
636
|
+
}, Ft = ["onClick"], Ut = {
|
|
636
637
|
key: 0,
|
|
637
638
|
xmlns: "http://www.w3.org/2000/svg",
|
|
638
639
|
width: "24",
|
|
@@ -644,7 +645,7 @@ const nt = { class: "loading-container" }, lt = { key: 0 }, st = { key: 2 }, ot
|
|
|
644
645
|
"stroke-linecap": "round",
|
|
645
646
|
"stroke-linejoin": "round",
|
|
646
647
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-right icon-transition-arrow"
|
|
647
|
-
},
|
|
648
|
+
}, Kt = {
|
|
648
649
|
key: 1,
|
|
649
650
|
xmlns: "http://www.w3.org/2000/svg",
|
|
650
651
|
width: "20",
|
|
@@ -656,43 +657,43 @@ const nt = { class: "loading-container" }, lt = { key: 0 }, st = { key: 2 }, ot
|
|
|
656
657
|
"stroke-linecap": "round",
|
|
657
658
|
"stroke-linejoin": "round",
|
|
658
659
|
class: "icon icon-transition-plus"
|
|
659
|
-
},
|
|
660
|
+
}, Yt = {
|
|
660
661
|
key: 1,
|
|
661
662
|
class: "w-1"
|
|
662
|
-
},
|
|
663
|
+
}, Xt = ["checked", "onChange"], Gt = ["onClick"], Wt = ["onClick"], Jt = { key: 0 }, Qt = { key: 1 }, Rt = ["onClick", "innerHTML"], Zt = ["onClick"], ea = ["src"], ta = ["src"], aa = {
|
|
663
664
|
key: 5,
|
|
664
665
|
class: "text-danger erro-custom-container"
|
|
665
|
-
},
|
|
666
|
+
}, na = { class: "badge bg-orange text-white erro-custom-text" }, la = ["id"], sa = ["colspan"], ra = { key: 1 }, oa = {
|
|
666
667
|
key: 2,
|
|
667
668
|
class: "text-center p-4 text-secondary"
|
|
668
|
-
},
|
|
669
|
+
}, ia = ["src"], da = /* @__PURE__ */ J({
|
|
669
670
|
__name: "VDataTable",
|
|
670
671
|
props: {
|
|
671
672
|
fetch: {},
|
|
672
673
|
fetch_name: { default: "" },
|
|
673
674
|
endpoint: {},
|
|
674
|
-
type_loading: {
|
|
675
|
+
type_loading: {},
|
|
675
676
|
custom_loading: { default: null },
|
|
676
677
|
deactivate_default_params: { type: Boolean, default: !1 },
|
|
677
|
-
filter_param_name: {
|
|
678
|
-
search_param_name: {
|
|
679
|
-
page_param_name: {
|
|
680
|
-
page_size_param_name: {
|
|
678
|
+
filter_param_name: {},
|
|
679
|
+
search_param_name: {},
|
|
680
|
+
page_param_name: {},
|
|
681
|
+
page_size_param_name: {},
|
|
681
682
|
add_params: { type: [Object, Function], default: () => ({}) },
|
|
682
683
|
data_key: { default: "results" },
|
|
683
684
|
total_key: { default: "count" },
|
|
684
685
|
list_filter: { default: () => [] },
|
|
685
|
-
first_text_page_size: {
|
|
686
|
-
second_text_page_size: {
|
|
687
|
-
class_table: {
|
|
688
|
-
class_content: {
|
|
689
|
-
class_container: {
|
|
690
|
-
class_pagination: {
|
|
691
|
-
class_filters: {
|
|
692
|
-
class_page_size: {
|
|
693
|
-
min_loading_delay: {
|
|
694
|
-
retry_attempts: {
|
|
695
|
-
retry_delay: {
|
|
686
|
+
first_text_page_size: {},
|
|
687
|
+
second_text_page_size: {},
|
|
688
|
+
class_table: {},
|
|
689
|
+
class_content: {},
|
|
690
|
+
class_container: {},
|
|
691
|
+
class_pagination: {},
|
|
692
|
+
class_filters: {},
|
|
693
|
+
class_page_size: {},
|
|
694
|
+
min_loading_delay: {},
|
|
695
|
+
retry_attempts: {},
|
|
696
|
+
retry_delay: {},
|
|
696
697
|
use_checkbox: { type: Boolean, default: !1 },
|
|
697
698
|
use_expandable_items: { type: Boolean, default: !1 },
|
|
698
699
|
close_expanded_item_on_expand_new: { type: Boolean, default: !1 },
|
|
@@ -701,390 +702,419 @@ const nt = { class: "loading-container" }, lt = { key: 0 }, st = { key: 2 }, ot
|
|
|
701
702
|
deactivate_animation_expand: { type: Boolean, default: !1 },
|
|
702
703
|
type_button_expand: { default: "arrow" },
|
|
703
704
|
deactivate_search_empty: { type: Boolean, default: !1 },
|
|
704
|
-
item_key: {
|
|
705
|
-
limit_per_page: {
|
|
706
|
-
page_starts_at: {
|
|
705
|
+
item_key: {},
|
|
706
|
+
limit_per_page: {},
|
|
707
|
+
page_starts_at: {},
|
|
707
708
|
deactivate_selected_info: { type: Boolean, default: !1 },
|
|
708
709
|
immediate: { type: Boolean, default: !0 },
|
|
709
|
-
placeholder_search: {
|
|
710
|
+
placeholder_search: {},
|
|
710
711
|
deactivate_search_on_clear: { type: Boolean, default: !1 },
|
|
711
712
|
disable_request: { default: !1 }
|
|
712
713
|
},
|
|
713
714
|
emits: ["tradePage", "beforeFetch", "afterFetch", "clickedClearSearch"],
|
|
714
|
-
setup(
|
|
715
|
-
const {
|
|
716
|
-
isHovering:
|
|
717
|
-
previewSrc:
|
|
718
|
-
previewStyle:
|
|
719
|
-
handleMouseOver:
|
|
720
|
-
handleMouseMove:
|
|
721
|
-
handleMouseLeave:
|
|
722
|
-
} =
|
|
723
|
-
|
|
715
|
+
setup(u, { expose: i, emit: f }) {
|
|
716
|
+
const n = ue(Fe, {}), {
|
|
717
|
+
isHovering: m,
|
|
718
|
+
previewSrc: p,
|
|
719
|
+
previewStyle: V,
|
|
720
|
+
handleMouseOver: E,
|
|
721
|
+
handleMouseMove: B,
|
|
722
|
+
handleMouseLeave: v
|
|
723
|
+
} = at(), o = u, s = z(() => ({
|
|
724
|
+
// Primeiro, espelha todas as props originais.
|
|
725
|
+
...o,
|
|
726
|
+
// Agora SOBRESCREVEMOS as propriedades que precisam de lógica Global/Default
|
|
727
|
+
// (Prioridade para Prop, mas aceita Global)
|
|
728
|
+
// === TEXTOS ===
|
|
729
|
+
first_text_page_size: o.first_text_page_size ?? n.first_text_page_size ?? "Mostrar",
|
|
730
|
+
second_text_page_size: o.second_text_page_size ?? n.second_text_page_size ?? "registros",
|
|
731
|
+
placeholder_search: o.placeholder_search ?? n.placeholder_search ?? "Buscar...",
|
|
732
|
+
// === CLASSES ===
|
|
733
|
+
class_table: o.class_table || n.class_table || "",
|
|
734
|
+
class_pagination: o.class_pagination || n.class_pagination || "",
|
|
735
|
+
class_container: o.class_container || n.class_container || "",
|
|
736
|
+
class_content: o.class_content || n.class_content || "",
|
|
737
|
+
class_filters: o.class_filters || n.class_filters || "",
|
|
738
|
+
class_page_size: o.class_page_size || n.class_page_size || "",
|
|
739
|
+
// === CONFIGURAÇÃO DE API ===
|
|
740
|
+
filter_param_name: o.filter_param_name ?? n.filter_param_name ?? "filter",
|
|
741
|
+
search_param_name: o.search_param_name ?? n.search_param_name ?? "search",
|
|
742
|
+
page_param_name: o.page_param_name ?? n.page_param_name ?? "page",
|
|
743
|
+
page_size_param_name: o.page_size_param_name ?? n.page_size_param_name ?? "page_size",
|
|
744
|
+
page_starts_at: o.page_starts_at ?? n.page_starts_at ?? 0,
|
|
745
|
+
item_key: o.item_key ?? n.item_key ?? "id",
|
|
746
|
+
// === COMPORTAMENTO ===
|
|
747
|
+
limit_per_page: o.limit_per_page ?? n.limit_per_page ?? 5,
|
|
748
|
+
type_loading: o.type_loading ?? n.type_loading ?? "placeholder",
|
|
749
|
+
min_loading_delay: o.min_loading_delay ?? n.min_loading_delay ?? 600,
|
|
750
|
+
retry_attempts: o.retry_attempts ?? n.retry_attempts ?? 3,
|
|
751
|
+
retry_delay: o.retry_delay ?? n.retry_delay ?? 2e3
|
|
752
|
+
})), w = f, c = C({}), $ = C([]), M = C(0), q = C(!1), y = C({
|
|
753
|
+
current_page: s.value.page_starts_at,
|
|
724
754
|
// pagina atual
|
|
725
755
|
count: 0,
|
|
726
756
|
// total de itens
|
|
727
|
-
limit_per_page:
|
|
757
|
+
limit_per_page: s.value.limit_per_page,
|
|
728
758
|
// limite de itens por página
|
|
729
759
|
search: "",
|
|
730
760
|
// termo de busca
|
|
731
761
|
filter: ""
|
|
732
762
|
// filtro selecionado
|
|
733
763
|
}), {
|
|
734
|
-
expand_item_toggle:
|
|
735
|
-
close_all_expanded_items:
|
|
736
|
-
is_item_expanded:
|
|
737
|
-
} =
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
764
|
+
expand_item_toggle: F,
|
|
765
|
+
close_all_expanded_items: U,
|
|
766
|
+
is_item_expanded: K
|
|
767
|
+
} = nt(
|
|
768
|
+
s.value.close_expanded_item_on_expand_new,
|
|
769
|
+
s.value.item_key,
|
|
770
|
+
s.value.deactivate_animation_expand,
|
|
771
|
+
s.value.scroll_to_expanded_item
|
|
742
772
|
), {
|
|
743
773
|
items: D,
|
|
744
|
-
error:
|
|
745
|
-
response:
|
|
746
|
-
attempt:
|
|
747
|
-
default_params:
|
|
748
|
-
fetchDataWithDelay:
|
|
749
|
-
reSearch:
|
|
750
|
-
showLoadingState:
|
|
774
|
+
error: S,
|
|
775
|
+
response: Q,
|
|
776
|
+
attempt: R,
|
|
777
|
+
default_params: he,
|
|
778
|
+
fetchDataWithDelay: L,
|
|
779
|
+
reSearch: N,
|
|
780
|
+
showLoadingState: ge,
|
|
751
781
|
first_fetch: fe
|
|
752
|
-
} =
|
|
753
|
-
selectAllCheckbox:
|
|
754
|
-
selected_items:
|
|
755
|
-
isSelected:
|
|
756
|
-
atLeastOneSelected:
|
|
757
|
-
toggleSelectAll:
|
|
758
|
-
toggleItemSelection:
|
|
759
|
-
} =
|
|
760
|
-
() =>
|
|
761
|
-
),
|
|
782
|
+
} = lt(s.value, y, $, c, w, U), {
|
|
783
|
+
selectAllCheckbox: ne,
|
|
784
|
+
selected_items: O,
|
|
785
|
+
isSelected: le,
|
|
786
|
+
atLeastOneSelected: ye,
|
|
787
|
+
toggleSelectAll: se,
|
|
788
|
+
toggleItemSelection: ke
|
|
789
|
+
} = st(s.value, D), Z = z(
|
|
790
|
+
() => $.value.filter((d) => d.locked)
|
|
791
|
+
), ee = z({
|
|
762
792
|
get() {
|
|
763
|
-
return
|
|
793
|
+
return $.value.filter((d) => !d.locked);
|
|
764
794
|
},
|
|
765
|
-
set(
|
|
766
|
-
const
|
|
767
|
-
|
|
795
|
+
set(d) {
|
|
796
|
+
const r = Z.value;
|
|
797
|
+
$.value = [...d, ...r];
|
|
768
798
|
}
|
|
769
|
-
}),
|
|
770
|
-
let
|
|
771
|
-
return
|
|
799
|
+
}), we = z(() => [...ee.value, ...Z.value]), xe = z(() => {
|
|
800
|
+
let d = [1];
|
|
801
|
+
return s.value.list_filter.length > 0 && d.push(2), d;
|
|
772
802
|
});
|
|
773
|
-
X(
|
|
774
|
-
|
|
803
|
+
X(Q, (d) => {
|
|
804
|
+
d ? (D.value = d[s.value.data_key] || [], M.value = d[s.value.total_key] || 0, y.value.count = M.value) : (D.value = [], M.value = 0);
|
|
775
805
|
}, { immediate: !0 });
|
|
776
|
-
function
|
|
806
|
+
function be() {
|
|
777
807
|
setTimeout(() => {
|
|
778
|
-
|
|
808
|
+
q.value = !1;
|
|
779
809
|
}, 500);
|
|
780
810
|
}
|
|
781
|
-
function
|
|
782
|
-
|
|
811
|
+
function Ce(d) {
|
|
812
|
+
$.value.push(d);
|
|
783
813
|
}
|
|
784
|
-
|
|
785
|
-
const
|
|
786
|
-
const
|
|
787
|
-
a > 0 && (
|
|
814
|
+
Ne(ve, { addColumn: Ce });
|
|
815
|
+
const re = (d) => {
|
|
816
|
+
const r = d.target, a = parseInt(r.value, 10);
|
|
817
|
+
a > 0 && (y.value.limit_per_page = a, y.value.limit_per_page = a, N());
|
|
788
818
|
};
|
|
789
|
-
function
|
|
790
|
-
if (!
|
|
791
|
-
const
|
|
792
|
-
let b =
|
|
793
|
-
for (const
|
|
794
|
-
b && typeof b == "object" &&
|
|
819
|
+
function A(d, r, a = null) {
|
|
820
|
+
if (!d) return r;
|
|
821
|
+
const _ = d.split(".");
|
|
822
|
+
let b = r;
|
|
823
|
+
for (const te of _)
|
|
824
|
+
b && typeof b == "object" && te in b ? b = b[te] : console.error(`Caminho inválido ou valor nulo em: ${d} na parte ${te}`);
|
|
795
825
|
return a && (b = a(b)), b;
|
|
796
826
|
}
|
|
797
|
-
function
|
|
798
|
-
return
|
|
827
|
+
function Me(d, r) {
|
|
828
|
+
return r && typeof r == "number" && r > 0 && typeof d == "string" && d.length > r ? d.substring(0, r) + "..." : d;
|
|
799
829
|
}
|
|
800
|
-
function oe(
|
|
801
|
-
for (const a in
|
|
802
|
-
a !==
|
|
803
|
-
const
|
|
804
|
-
|
|
830
|
+
function oe(d) {
|
|
831
|
+
for (const a in c.value)
|
|
832
|
+
a !== d && (c.value[a] = "none");
|
|
833
|
+
const r = c.value[d] || "none";
|
|
834
|
+
r === "none" ? c.value[d] = "increasing" : r === "increasing" ? c.value[d] = "decreasing" : c.value[d] = "none", N();
|
|
805
835
|
}
|
|
806
|
-
function
|
|
807
|
-
|
|
836
|
+
function Se(d) {
|
|
837
|
+
d > 0 ? (y.value.limit_per_page = d, N()) : console.warn("O limite deve ser um número maior que zero.");
|
|
808
838
|
}
|
|
809
|
-
function
|
|
810
|
-
|
|
839
|
+
function $e(d) {
|
|
840
|
+
y.value.search = d, N();
|
|
811
841
|
}
|
|
812
|
-
function
|
|
813
|
-
|
|
842
|
+
function ze(d) {
|
|
843
|
+
y.value.filter = d, N();
|
|
814
844
|
}
|
|
815
|
-
function
|
|
816
|
-
|
|
845
|
+
function Be(d) {
|
|
846
|
+
d >= 0 && d <= Math.ceil(y.value.count / y.value.limit_per_page) ? (y.value.current_page = d, L()) : console.warn("Número de página inválido.");
|
|
817
847
|
}
|
|
818
|
-
function
|
|
819
|
-
let
|
|
820
|
-
return
|
|
848
|
+
function Te() {
|
|
849
|
+
let d = $.value.length;
|
|
850
|
+
return s.value.use_checkbox && (d += 1), s.value.use_expandable_items && (d += 1), d;
|
|
821
851
|
}
|
|
822
|
-
function
|
|
823
|
-
|
|
852
|
+
function Ve() {
|
|
853
|
+
w("tradePage"), L();
|
|
824
854
|
}
|
|
825
|
-
const
|
|
826
|
-
const a = [
|
|
827
|
-
if (
|
|
828
|
-
for (const [
|
|
829
|
-
typeof b == "function" && b(
|
|
855
|
+
const G = (d, r) => {
|
|
856
|
+
const a = [d.class_item || ""];
|
|
857
|
+
if (d.click && a.push("cursor-pointer"), d.class_rules)
|
|
858
|
+
for (const [_, b] of Object.entries(d.class_rules))
|
|
859
|
+
typeof b == "function" && b(r) && a.push(_);
|
|
830
860
|
return a.join(" ").trim();
|
|
831
861
|
};
|
|
832
|
-
|
|
833
|
-
execute:
|
|
834
|
-
reSearch:
|
|
835
|
-
pagination:
|
|
836
|
-
set_limit_per_page:
|
|
837
|
-
set_search:
|
|
838
|
-
set_filter:
|
|
839
|
-
set_page:
|
|
840
|
-
default_params:
|
|
841
|
-
selected_items:
|
|
842
|
-
atLeastOneSelected:
|
|
843
|
-
expand_item_toggle:
|
|
844
|
-
close_all_expanded_items:
|
|
845
|
-
selectAllCheckbox:
|
|
862
|
+
i({
|
|
863
|
+
execute: L,
|
|
864
|
+
reSearch: N,
|
|
865
|
+
pagination: Ae(y),
|
|
866
|
+
set_limit_per_page: Se,
|
|
867
|
+
set_search: $e,
|
|
868
|
+
set_filter: ze,
|
|
869
|
+
set_page: Be,
|
|
870
|
+
default_params: he,
|
|
871
|
+
selected_items: O,
|
|
872
|
+
atLeastOneSelected: ye,
|
|
873
|
+
expand_item_toggle: F,
|
|
874
|
+
close_all_expanded_items: U,
|
|
875
|
+
selectAllCheckbox: ne
|
|
846
876
|
});
|
|
847
|
-
const
|
|
877
|
+
const ie = C(!1);
|
|
848
878
|
return X(
|
|
849
|
-
() =>
|
|
879
|
+
() => s.value.add_params,
|
|
850
880
|
() => {
|
|
851
|
-
|
|
852
|
-
|
|
881
|
+
ie.value ? N() : (ie.value = !0, _e(() => {
|
|
882
|
+
N();
|
|
853
883
|
}));
|
|
854
884
|
},
|
|
855
|
-
{ deep: !0, immediate:
|
|
856
|
-
), (
|
|
885
|
+
{ deep: !0, immediate: s.value.immediate }
|
|
886
|
+
), (d, r) => (t(), l("div", null, [
|
|
857
887
|
e("div", {
|
|
858
|
-
class: g(["",
|
|
888
|
+
class: g(["", s.value.class_container])
|
|
859
889
|
}, [
|
|
860
|
-
|
|
890
|
+
P(d.$slots, "default", {}, void 0, !0),
|
|
861
891
|
e("div", {
|
|
862
|
-
class: g(["",
|
|
892
|
+
class: g(["", s.value.class_content])
|
|
863
893
|
}, [
|
|
864
894
|
e("div", {
|
|
865
|
-
class: g([
|
|
895
|
+
class: g([s.value.class_filters, "d-flex justify-content-between align-items-start"])
|
|
866
896
|
}, [
|
|
867
|
-
|
|
868
|
-
changePageSize:
|
|
869
|
-
limit_per_page:
|
|
897
|
+
P(d.$slots, "pageSize", {
|
|
898
|
+
changePageSize: re,
|
|
899
|
+
limit_per_page: y.value.limit_per_page
|
|
870
900
|
}, () => [
|
|
871
901
|
e("div", {
|
|
872
|
-
class: g(["text-secondary",
|
|
902
|
+
class: g(["text-secondary", s.value.class_page_size])
|
|
873
903
|
}, [
|
|
874
|
-
|
|
875
|
-
e("div",
|
|
876
|
-
|
|
904
|
+
I(k(s.value.first_text_page_size) + " ", 1),
|
|
905
|
+
e("div", wt, [
|
|
906
|
+
ce(e("input", {
|
|
877
907
|
class: "form-control form-control-sm",
|
|
878
|
-
onChange:
|
|
879
|
-
"onUpdate:modelValue":
|
|
908
|
+
onChange: re,
|
|
909
|
+
"onUpdate:modelValue": r[0] || (r[0] = (a) => y.value.limit_per_page = a),
|
|
880
910
|
min: "1",
|
|
881
911
|
size: "3",
|
|
882
912
|
"aria-label": "Número de registros por página",
|
|
883
913
|
type: "number"
|
|
884
914
|
}, null, 544), [
|
|
885
915
|
[
|
|
886
|
-
|
|
887
|
-
|
|
916
|
+
pe,
|
|
917
|
+
y.value.limit_per_page,
|
|
888
918
|
void 0,
|
|
889
919
|
{ lazy: !0 }
|
|
890
920
|
]
|
|
891
921
|
])
|
|
892
922
|
]),
|
|
893
|
-
|
|
923
|
+
I(" " + k(s.value.second_text_page_size), 1)
|
|
894
924
|
], 2)
|
|
895
925
|
], !0),
|
|
896
|
-
|
|
897
|
-
Y(
|
|
898
|
-
search:
|
|
899
|
-
"onUpdate:search":
|
|
900
|
-
filter:
|
|
901
|
-
"onUpdate:filter":
|
|
902
|
-
list_filter:
|
|
903
|
-
item_use:
|
|
904
|
-
onSearch:
|
|
905
|
-
deactivate_search_on_clear:
|
|
906
|
-
placeholder_search:
|
|
907
|
-
deactivate_search_empty:
|
|
908
|
-
onClickedClearSearch:
|
|
926
|
+
P(d.$slots, "fieldMiddle", {}, void 0, !0),
|
|
927
|
+
Y(tt, {
|
|
928
|
+
search: y.value.search,
|
|
929
|
+
"onUpdate:search": r[1] || (r[1] = (a) => y.value.search = a),
|
|
930
|
+
filter: y.value.filter,
|
|
931
|
+
"onUpdate:filter": r[2] || (r[2] = (a) => y.value.filter = a),
|
|
932
|
+
list_filter: s.value.list_filter,
|
|
933
|
+
item_use: xe.value,
|
|
934
|
+
onSearch: h(N),
|
|
935
|
+
deactivate_search_on_clear: s.value.deactivate_search_on_clear,
|
|
936
|
+
placeholder_search: s.value.placeholder_search,
|
|
937
|
+
deactivate_search_empty: s.value.deactivate_search_empty,
|
|
938
|
+
onClickedClearSearch: r[3] || (r[3] = (a) => d.$emit("clickedClearSearch"))
|
|
909
939
|
}, null, 8, ["search", "filter", "list_filter", "item_use", "onSearch", "deactivate_search_on_clear", "placeholder_search", "deactivate_search_empty"])
|
|
910
940
|
], 2),
|
|
911
|
-
|
|
912
|
-
selected_items:
|
|
913
|
-
clearSelection: () =>
|
|
941
|
+
P(d.$slots, "item-selected-info", {
|
|
942
|
+
selected_items: h(O),
|
|
943
|
+
clearSelection: () => O.value = []
|
|
914
944
|
}, () => [
|
|
915
|
-
|
|
916
|
-
e("h4",
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
e("span",
|
|
945
|
+
s.value.use_checkbox && h(O).length > 0 && !s.value.deactivate_selected_info ? (t(), l("div", xt, [
|
|
946
|
+
e("h4", bt, [
|
|
947
|
+
r[10] || (r[10] = e("strong", null, "oi Itens Selecionados:", -1)),
|
|
948
|
+
r[11] || (r[11] = I()),
|
|
949
|
+
e("span", Ct, k(h(O).length), 1)
|
|
920
950
|
]),
|
|
921
951
|
e("a", {
|
|
922
952
|
class: "cursor-pointer",
|
|
923
|
-
onClick:
|
|
924
|
-
}, [...
|
|
925
|
-
|
|
953
|
+
onClick: r[4] || (r[4] = (a) => O.value = [])
|
|
954
|
+
}, [...r[12] || (r[12] = [
|
|
955
|
+
Pe('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-trash" data-v-98ed0eed><path stroke="none" d="M0 0h24v24H0z" fill="none" data-v-98ed0eed></path><path d="M4 7l16 0" data-v-98ed0eed></path><path d="M10 11l0 6" data-v-98ed0eed></path><path d="M14 11l0 6" data-v-98ed0eed></path><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12" data-v-98ed0eed></path><path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3" data-v-98ed0eed></path></svg> Limpar Seleção', 2)
|
|
926
956
|
])])
|
|
927
957
|
])) : x("", !0)
|
|
928
958
|
], !0),
|
|
929
|
-
|
|
959
|
+
h(ge) ? (t(), W(kt, {
|
|
930
960
|
key: 0,
|
|
931
|
-
columns:
|
|
932
|
-
limit:
|
|
933
|
-
type_loading:
|
|
934
|
-
custom_loading:
|
|
935
|
-
class_table:
|
|
936
|
-
attempt:
|
|
937
|
-
pagination:
|
|
938
|
-
}, null, 8, ["columns", "limit", "type_loading", "custom_loading", "class_table", "attempt", "pagination"])) :
|
|
939
|
-
|
|
940
|
-
|
|
961
|
+
columns: $.value,
|
|
962
|
+
limit: y.value.limit_per_page,
|
|
963
|
+
type_loading: s.value.type_loading,
|
|
964
|
+
custom_loading: s.value.custom_loading,
|
|
965
|
+
class_table: s.value.class_table,
|
|
966
|
+
attempt: h(R),
|
|
967
|
+
pagination: y.value
|
|
968
|
+
}, null, 8, ["columns", "limit", "type_loading", "custom_loading", "class_table", "attempt", "pagination"])) : h(S) ? (t(), l("div", Mt, [
|
|
969
|
+
r[13] || (r[13] = e("h4", { class: "text-danger" }, "Ocorreu um Erro", -1)),
|
|
970
|
+
h(R) ? (t(), l("p", St, " Não foi possível carregar os dados após " + k(h(R).total) + " tentativa(s). ", 1)) : (t(), l("p", $t, " Não foi possível carregar os dados. Verifique sua conexão. ")),
|
|
941
971
|
e("button", {
|
|
942
972
|
class: "btn btn-primary mt-2",
|
|
943
|
-
onClick:
|
|
944
|
-
(...a) =>
|
|
973
|
+
onClick: r[5] || (r[5] = //@ts-ignore
|
|
974
|
+
(...a) => h(L) && h(L)(...a))
|
|
945
975
|
}, " Tentar Novamente ")
|
|
946
|
-
])) :
|
|
947
|
-
|
|
976
|
+
])) : h(D) ? (t(), l("div", zt, [
|
|
977
|
+
h(D).length > 0 ? (t(), l("div", Bt, [
|
|
948
978
|
e("table", {
|
|
949
|
-
class: g(["table table-vcenter table-selectable",
|
|
979
|
+
class: g(["table table-vcenter table-selectable", s.value.class_table])
|
|
950
980
|
}, [
|
|
951
981
|
e("thead", null, [
|
|
952
|
-
Y(
|
|
953
|
-
modelValue:
|
|
954
|
-
"onUpdate:modelValue":
|
|
982
|
+
Y(h(Ke), {
|
|
983
|
+
modelValue: ee.value,
|
|
984
|
+
"onUpdate:modelValue": r[7] || (r[7] = (a) => ee.value = a),
|
|
955
985
|
tag: "tr",
|
|
956
986
|
"item-key": "header",
|
|
957
987
|
animation: 400,
|
|
958
988
|
"ghost-class": "ghost-item",
|
|
959
989
|
"drag-class": "dragging-item",
|
|
960
|
-
onStart:
|
|
961
|
-
onEnd:
|
|
990
|
+
onStart: r[8] || (r[8] = (a) => q.value = !0),
|
|
991
|
+
onEnd: r[9] || (r[9] = () => be())
|
|
962
992
|
}, {
|
|
963
|
-
header:
|
|
964
|
-
|
|
965
|
-
|
|
993
|
+
header: H(() => [
|
|
994
|
+
s.value.use_expandable_items ? (t(), l("th", Tt)) : x("", !0),
|
|
995
|
+
s.value.use_checkbox ? (t(), l("th", Vt, [
|
|
966
996
|
e("input", {
|
|
967
997
|
class: "form-check-input m-0",
|
|
968
998
|
type: "checkbox",
|
|
969
999
|
ref_key: "selectAllCheckbox",
|
|
970
|
-
ref:
|
|
971
|
-
onChange:
|
|
972
|
-
(...a) =>
|
|
1000
|
+
ref: ne,
|
|
1001
|
+
onChange: r[6] || (r[6] = //@ts-ignore
|
|
1002
|
+
(...a) => h(se) && h(se)(...a)),
|
|
973
1003
|
"aria-label": "Selecionar todos os itens na página"
|
|
974
1004
|
}, null, 544)
|
|
975
1005
|
])) : x("", !0)
|
|
976
1006
|
]),
|
|
977
|
-
item:
|
|
978
|
-
a.use_ordering ? (t(),
|
|
1007
|
+
item: H(({ element: a }) => [
|
|
1008
|
+
a.use_ordering ? (t(), l("th", {
|
|
979
1009
|
key: 0,
|
|
980
1010
|
class: g(["header-draggable", a.class_column])
|
|
981
1011
|
}, [
|
|
982
|
-
e("div",
|
|
983
|
-
e("span", null,
|
|
1012
|
+
e("div", Dt, [
|
|
1013
|
+
e("span", null, k(a.header), 1),
|
|
984
1014
|
e("span", {
|
|
985
1015
|
onClick: () => oe(a.header),
|
|
986
1016
|
class: "ms-2 cursor-pointer"
|
|
987
1017
|
}, [
|
|
988
|
-
!
|
|
1018
|
+
!c.value[a.header] || c.value[a.header] === "none" ? (t(), l("svg", jt, [...r[14] || (r[14] = [
|
|
989
1019
|
e("path", { d: "m3 8 4-4 4 4" }, null, -1),
|
|
990
1020
|
e("path", { d: "m11 16-4 4-4-4" }, null, -1),
|
|
991
1021
|
e("path", { d: "M7 4v16" }, null, -1),
|
|
992
1022
|
e("path", { d: "M15 8h6" }, null, -1),
|
|
993
1023
|
e("path", { d: "M15 16h6" }, null, -1),
|
|
994
1024
|
e("path", { d: "M13 12h8" }, null, -1)
|
|
995
|
-
])])) :
|
|
1025
|
+
])])) : c.value[a.header] === "decreasing" ? (t(), l("svg", It, [...r[15] || (r[15] = [
|
|
996
1026
|
e("path", { d: "m3 16 4 4 4-4" }, null, -1),
|
|
997
1027
|
e("path", { d: "M7 20V4" }, null, -1),
|
|
998
1028
|
e("path", { d: "M11 4h10" }, null, -1),
|
|
999
1029
|
e("path", { d: "M11 8h7" }, null, -1),
|
|
1000
1030
|
e("path", { d: "M11 12h4" }, null, -1)
|
|
1001
|
-
])])) :
|
|
1031
|
+
])])) : c.value[a.header] === "increasing" ? (t(), l("svg", Nt, [...r[16] || (r[16] = [
|
|
1002
1032
|
e("path", { d: "m3 8 4-4 4 4" }, null, -1),
|
|
1003
1033
|
e("path", { d: "M7 4v16" }, null, -1),
|
|
1004
1034
|
e("path", { d: "M11 12h4" }, null, -1),
|
|
1005
1035
|
e("path", { d: "M11 16h7" }, null, -1),
|
|
1006
1036
|
e("path", { d: "M11 20h10" }, null, -1)
|
|
1007
1037
|
])])) : x("", !0)
|
|
1008
|
-
], 8,
|
|
1038
|
+
], 8, Et)
|
|
1009
1039
|
])
|
|
1010
|
-
], 2)) : (t(),
|
|
1040
|
+
], 2)) : (t(), l("th", {
|
|
1011
1041
|
key: 1,
|
|
1012
1042
|
class: g(["header-draggable", a.class_column])
|
|
1013
|
-
},
|
|
1043
|
+
}, k(a.header), 3))
|
|
1014
1044
|
]),
|
|
1015
|
-
footer:
|
|
1016
|
-
(t(!0),
|
|
1045
|
+
footer: H(() => [
|
|
1046
|
+
(t(!0), l(T, null, j(Z.value, (a) => (t(), l(T, {
|
|
1017
1047
|
key: a.field || a.header
|
|
1018
1048
|
}, [
|
|
1019
|
-
a.use_ordering ? (t(),
|
|
1049
|
+
a.use_ordering ? (t(), l("th", {
|
|
1020
1050
|
key: 0,
|
|
1021
1051
|
class: g(["header-locked header-ordering", a.class_column])
|
|
1022
1052
|
}, [
|
|
1023
|
-
e("div",
|
|
1024
|
-
e("span", null,
|
|
1053
|
+
e("div", At, [
|
|
1054
|
+
e("span", null, k(a.header), 1),
|
|
1025
1055
|
e("span", {
|
|
1026
1056
|
onClick: () => oe(a.header),
|
|
1027
1057
|
class: "ms-2 cursor-pointer"
|
|
1028
1058
|
}, [
|
|
1029
|
-
!
|
|
1059
|
+
!c.value[a.header] || c.value[a.header] === "none" ? (t(), l("svg", qt, [...r[17] || (r[17] = [
|
|
1030
1060
|
e("path", { d: "m3 8 4-4 4 4" }, null, -1),
|
|
1031
1061
|
e("path", { d: "m11 16-4 4-4-4" }, null, -1),
|
|
1032
1062
|
e("path", { d: "M7 4v16" }, null, -1),
|
|
1033
1063
|
e("path", { d: "M15 8h6" }, null, -1),
|
|
1034
1064
|
e("path", { d: "M15 16h6" }, null, -1),
|
|
1035
1065
|
e("path", { d: "M13 12h8" }, null, -1)
|
|
1036
|
-
])])) :
|
|
1066
|
+
])])) : c.value[a.header] === "decreasing" ? (t(), l("svg", Lt, [...r[18] || (r[18] = [
|
|
1037
1067
|
e("path", { d: "m3 16 4 4 4-4" }, null, -1),
|
|
1038
1068
|
e("path", { d: "M7 20V4" }, null, -1),
|
|
1039
1069
|
e("path", { d: "M11 4h10" }, null, -1),
|
|
1040
1070
|
e("path", { d: "M11 8h7" }, null, -1),
|
|
1041
1071
|
e("path", { d: "M11 12h4" }, null, -1)
|
|
1042
|
-
])])) :
|
|
1072
|
+
])])) : c.value[a.header] === "increasing" ? (t(), l("svg", Ot, [...r[19] || (r[19] = [
|
|
1043
1073
|
e("path", { d: "m3 8 4-4 4 4" }, null, -1),
|
|
1044
1074
|
e("path", { d: "M7 4v16" }, null, -1),
|
|
1045
1075
|
e("path", { d: "M11 12h4" }, null, -1),
|
|
1046
1076
|
e("path", { d: "M11 16h7" }, null, -1),
|
|
1047
1077
|
e("path", { d: "M11 20h10" }, null, -1)
|
|
1048
1078
|
])])) : x("", !0)
|
|
1049
|
-
], 8,
|
|
1079
|
+
], 8, Pt)
|
|
1050
1080
|
])
|
|
1051
|
-
], 2)) : (t(),
|
|
1081
|
+
], 2)) : (t(), l("th", {
|
|
1052
1082
|
key: 1,
|
|
1053
1083
|
class: g(["header-locked", a.class_column])
|
|
1054
|
-
},
|
|
1084
|
+
}, k(a.header), 3))
|
|
1055
1085
|
], 64))), 128))
|
|
1056
1086
|
]),
|
|
1057
1087
|
_: 1
|
|
1058
1088
|
}, 8, ["modelValue"])
|
|
1059
1089
|
]),
|
|
1060
1090
|
e("tbody", null, [
|
|
1061
|
-
(t(!0),
|
|
1062
|
-
key: a[
|
|
1091
|
+
(t(!0), l(T, null, j(h(D), (a) => (t(), l(T, {
|
|
1092
|
+
key: a[s.value.item_key]
|
|
1063
1093
|
}, [
|
|
1064
|
-
Y(
|
|
1094
|
+
Y(qe, {
|
|
1065
1095
|
tag: "tr",
|
|
1066
|
-
name:
|
|
1096
|
+
name: q.value ? "column-move" : ""
|
|
1067
1097
|
}, {
|
|
1068
|
-
default:
|
|
1069
|
-
|
|
1070
|
-
|
|
1098
|
+
default: H(() => [
|
|
1099
|
+
s.value.use_expandable_items ? (t(), l("td", Ht, [
|
|
1100
|
+
P(d.$slots, "expand-button", {
|
|
1071
1101
|
item: a,
|
|
1072
|
-
isExpanded:
|
|
1073
|
-
expand_item_toggle:
|
|
1102
|
+
isExpanded: h(K)(a),
|
|
1103
|
+
expand_item_toggle: h(F)
|
|
1074
1104
|
}, () => [
|
|
1075
1105
|
e("button", {
|
|
1076
1106
|
type: "button",
|
|
1077
|
-
class: g(["btn-clean btn-icon-anim", { "is-expanded":
|
|
1078
|
-
onClick: (
|
|
1107
|
+
class: g(["btn-clean btn-icon-anim", { "is-expanded": h(K)(a) }]),
|
|
1108
|
+
onClick: (_) => h(F)(a)
|
|
1079
1109
|
}, [
|
|
1080
|
-
|
|
1110
|
+
s.value.type_button_expand === "arrow" ? (t(), l("svg", Ut, [...r[20] || (r[20] = [
|
|
1081
1111
|
e("path", {
|
|
1082
1112
|
stroke: "none",
|
|
1083
1113
|
d: "M0 0h24v24H0z",
|
|
1084
1114
|
fill: "none"
|
|
1085
1115
|
}, null, -1),
|
|
1086
1116
|
e("path", { d: "M9 6l6 6l-6 6" }, null, -1)
|
|
1087
|
-
])])) : (t(),
|
|
1117
|
+
])])) : (t(), l("svg", Kt, [...r[21] || (r[21] = [
|
|
1088
1118
|
e("path", {
|
|
1089
1119
|
stroke: "none",
|
|
1090
1120
|
d: "M0 0h24v24H0z",
|
|
@@ -1096,142 +1126,142 @@ const nt = { class: "loading-container" }, lt = { key: 0 }, st = { key: 2 }, ot
|
|
|
1096
1126
|
}, null, -1),
|
|
1097
1127
|
e("path", { d: "M5 12l14 0" }, null, -1)
|
|
1098
1128
|
])]))
|
|
1099
|
-
], 10,
|
|
1129
|
+
], 10, Ft)
|
|
1100
1130
|
], !0)
|
|
1101
1131
|
])) : x("", !0),
|
|
1102
|
-
|
|
1132
|
+
s.value.use_checkbox ? (t(), l("td", Yt, [
|
|
1103
1133
|
e("input", {
|
|
1104
1134
|
class: "form-check-input m-0",
|
|
1105
1135
|
type: "checkbox",
|
|
1106
|
-
checked:
|
|
1107
|
-
onChange: (
|
|
1136
|
+
checked: h(le)(a),
|
|
1137
|
+
onChange: (_) => h(ke)(a),
|
|
1108
1138
|
"aria-label": "Selecionar este item"
|
|
1109
|
-
}, null, 40,
|
|
1139
|
+
}, null, 40, Xt)
|
|
1110
1140
|
])) : x("", !0),
|
|
1111
|
-
(t(!0),
|
|
1112
|
-
key:
|
|
1113
|
-
class: g(
|
|
1141
|
+
(t(!0), l(T, null, j(we.value, (_) => (t(), l("td", {
|
|
1142
|
+
key: _.field || _.header,
|
|
1143
|
+
class: g(_.class_row)
|
|
1114
1144
|
}, [
|
|
1115
|
-
|
|
1145
|
+
_.bodySlot ? (t(), W(me(_.bodySlot), {
|
|
1116
1146
|
key: 0,
|
|
1117
1147
|
item: a,
|
|
1118
|
-
"is-selected":
|
|
1119
|
-
}, null, 8, ["item", "is-selected"])) :
|
|
1148
|
+
"is-selected": h(le)(a)
|
|
1149
|
+
}, null, 8, ["item", "is-selected"])) : _.type === "text" ? (t(), l("span", {
|
|
1120
1150
|
key: 1,
|
|
1121
|
-
onClick: (b) =>
|
|
1122
|
-
class: g(
|
|
1123
|
-
},
|
|
1151
|
+
onClick: (b) => _.click ? _.click(a) : null,
|
|
1152
|
+
class: g(G(_, a))
|
|
1153
|
+
}, k(Me(A(_.field, a, _.transform_function), _.limite_text ?? null)), 11, Gt)) : _.type === "date" ? (t(), l("span", {
|
|
1124
1154
|
key: 2,
|
|
1125
|
-
onClick: (b) =>
|
|
1126
|
-
class: g(
|
|
1155
|
+
onClick: (b) => _.click ? _.click(a) : null,
|
|
1156
|
+
class: g(G(_, a))
|
|
1127
1157
|
}, [
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1158
|
+
_.format === "complete" ? (t(), l("span", Jt, k(new Date(A(_.field, a)).toLocaleString()), 1)) : x("", !0),
|
|
1159
|
+
_.format === "simple" ? (t(), l("span", Qt, k(new Date(A(
|
|
1160
|
+
_.field,
|
|
1131
1161
|
a
|
|
1132
1162
|
)).toLocaleDateString()), 1)) : x("", !0)
|
|
1133
|
-
], 10,
|
|
1163
|
+
], 10, Wt)) : _.type === "html" ? (t(), l("div", {
|
|
1134
1164
|
key: 3,
|
|
1135
|
-
onClick: (b) =>
|
|
1136
|
-
class: g(
|
|
1137
|
-
innerHTML:
|
|
1138
|
-
}, null, 10,
|
|
1165
|
+
onClick: (b) => _.click ? _.click(a) : null,
|
|
1166
|
+
class: g(G(_, a)),
|
|
1167
|
+
innerHTML: A(_.field, a)
|
|
1168
|
+
}, null, 10, Rt)) : _.type === "img" ? (t(), l("div", {
|
|
1139
1169
|
key: 4,
|
|
1140
|
-
onClick: (b) =>
|
|
1141
|
-
class: g(
|
|
1170
|
+
onClick: (b) => _.click ? _.click(a) : null,
|
|
1171
|
+
class: g(G(_, a))
|
|
1142
1172
|
}, [
|
|
1143
|
-
|
|
1173
|
+
A(_.field, a) ? (t(), l("div", Le({
|
|
1144
1174
|
key: 0,
|
|
1145
1175
|
ref_for: !0
|
|
1146
|
-
},
|
|
1176
|
+
}, _.deactivate_img_preview ? {
|
|
1147
1177
|
class: "container-img"
|
|
1148
1178
|
} : {
|
|
1149
|
-
onMouseover: (b) =>
|
|
1150
|
-
onMousemove:
|
|
1151
|
-
onMouseleave: v
|
|
1179
|
+
onMouseover: (b) => h(E)(b, A(_.field, a)),
|
|
1180
|
+
onMousemove: h(B),
|
|
1181
|
+
onMouseleave: h(v),
|
|
1152
1182
|
class: "container-img container-img-preview"
|
|
1153
1183
|
}), [
|
|
1154
1184
|
e("img", {
|
|
1155
1185
|
class: "img-tamanho",
|
|
1156
|
-
src:
|
|
1157
|
-
}, null, 8,
|
|
1186
|
+
src: A(_.field, a)
|
|
1187
|
+
}, null, 8, ea),
|
|
1158
1188
|
e("img", {
|
|
1159
1189
|
class: "img-tamanho-cover",
|
|
1160
|
-
src:
|
|
1161
|
-
}, null, 8,
|
|
1162
|
-
|
|
1190
|
+
src: A(_.field, a)
|
|
1191
|
+
}, null, 8, ta),
|
|
1192
|
+
r[22] || (r[22] = e("div", { class: "bg-img" }, null, -1))
|
|
1163
1193
|
], 16)) : x("", !0)
|
|
1164
|
-
], 10,
|
|
1165
|
-
|
|
1166
|
-
e("span",
|
|
1167
|
-
|
|
1194
|
+
], 10, Zt)) : (t(), l("span", aa, [
|
|
1195
|
+
r[23] || (r[23] = I("tipo ", -1)),
|
|
1196
|
+
e("span", na, k(_.type), 1),
|
|
1197
|
+
r[24] || (r[24] = I(" não suportado", -1))
|
|
1168
1198
|
]))
|
|
1169
1199
|
], 2))), 128))
|
|
1170
1200
|
]),
|
|
1171
1201
|
_: 2
|
|
1172
1202
|
}, 1032, ["name"]),
|
|
1173
|
-
Y(
|
|
1174
|
-
name: "expand-item-" +
|
|
1175
|
-
css: !
|
|
1203
|
+
Y(Oe, {
|
|
1204
|
+
name: "expand-item-" + s.value.type_animation_expand,
|
|
1205
|
+
css: !s.value.deactivate_animation_expand
|
|
1176
1206
|
}, {
|
|
1177
|
-
default:
|
|
1178
|
-
|
|
1207
|
+
default: H(() => [
|
|
1208
|
+
h(K)(a) ? (t(), l("tr", {
|
|
1179
1209
|
key: 0,
|
|
1180
|
-
id: "expand-item-" + a[
|
|
1210
|
+
id: "expand-item-" + a[s.value.item_key],
|
|
1181
1211
|
class: "expanded-item-row"
|
|
1182
1212
|
}, [
|
|
1183
1213
|
e("td", {
|
|
1184
|
-
colspan:
|
|
1214
|
+
colspan: Te()
|
|
1185
1215
|
}, [
|
|
1186
|
-
|
|
1187
|
-
], 8,
|
|
1188
|
-
], 8,
|
|
1216
|
+
P(d.$slots, "after-row", { item: a }, void 0, !0)
|
|
1217
|
+
], 8, sa)
|
|
1218
|
+
], 8, la)) : x("", !0)
|
|
1189
1219
|
]),
|
|
1190
1220
|
_: 2
|
|
1191
1221
|
}, 1032, ["name", "css"])
|
|
1192
1222
|
], 64))), 128))
|
|
1193
1223
|
])
|
|
1194
1224
|
], 2)
|
|
1195
|
-
])) :
|
|
1196
|
-
|
|
1197
|
-
])) : (t(),
|
|
1225
|
+
])) : h(fe) === !1 ? (t(), l("div", ra, [
|
|
1226
|
+
P(d.$slots, "idle-state", {}, void 0, !0)
|
|
1227
|
+
])) : (t(), l("div", oa, [...r[25] || (r[25] = [
|
|
1198
1228
|
e("p", { class: "m-0" }, "Nenhum item encontrado.", -1)
|
|
1199
1229
|
])]))
|
|
1200
1230
|
])) : x("", !0)
|
|
1201
1231
|
], 2)
|
|
1202
1232
|
], 2),
|
|
1203
|
-
|
|
1204
|
-
pagination:
|
|
1205
|
-
tradePage:
|
|
1206
|
-
error:
|
|
1233
|
+
P(d.$slots, "pagination", {
|
|
1234
|
+
pagination: y.value,
|
|
1235
|
+
tradePage: h(L),
|
|
1236
|
+
error: h(S)
|
|
1207
1237
|
}, () => [
|
|
1208
|
-
!
|
|
1238
|
+
!h(S) && y.value.count > 0 ? (t(), l("div", {
|
|
1209
1239
|
key: 0,
|
|
1210
|
-
class: g(["px-3",
|
|
1240
|
+
class: g(["px-3", s.value.class_pagination])
|
|
1211
1241
|
}, [
|
|
1212
|
-
Y(
|
|
1213
|
-
page_starts_at:
|
|
1242
|
+
Y(Ue, {
|
|
1243
|
+
page_starts_at: s.value.page_starts_at,
|
|
1214
1244
|
filtering: !0,
|
|
1215
|
-
pagination:
|
|
1216
|
-
onTradePage:
|
|
1245
|
+
pagination: y.value,
|
|
1246
|
+
onTradePage: Ve
|
|
1217
1247
|
}, null, 8, ["page_starts_at", "pagination"])
|
|
1218
1248
|
], 2)) : x("", !0)
|
|
1219
1249
|
], !0),
|
|
1220
|
-
|
|
1250
|
+
h(m) ? (t(), l("div", {
|
|
1221
1251
|
key: 0,
|
|
1222
1252
|
class: "image-preview-container",
|
|
1223
|
-
style:
|
|
1253
|
+
style: He(h(V))
|
|
1224
1254
|
}, [
|
|
1225
1255
|
e("img", {
|
|
1226
|
-
src:
|
|
1256
|
+
src: h(p),
|
|
1227
1257
|
alt: "Preview",
|
|
1228
1258
|
class: "image-preview-large"
|
|
1229
|
-
}, null, 8,
|
|
1259
|
+
}, null, 8, ia)
|
|
1230
1260
|
], 4)) : x("", !0)
|
|
1231
1261
|
]));
|
|
1232
1262
|
}
|
|
1233
|
-
}),
|
|
1263
|
+
}), va = /* @__PURE__ */ ae(da, [["__scopeId", "data-v-98ed0eed"]]);
|
|
1234
1264
|
export {
|
|
1235
|
-
|
|
1236
|
-
|
|
1265
|
+
ma as VColumn,
|
|
1266
|
+
va as VDataTable
|
|
1237
1267
|
};
|