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