v-sistec-features 1.23.2 → 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/core.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/v-sistec-features.css +1 -1
- package/dist/vDataTable.d.ts +12 -0
- package/dist/vDataTable.js +617 -590
- package/package.json +1 -1
- package/src/DatatableVue/components/VColumn.vue +8 -2
- package/src/DatatableVue/components/VDataTable.vue +153 -367
- package/src/DatatableVue/composables/useDataTableFetch.ts +2 -2
- package/src/DatatableVue/keys.ts +4 -0
- package/src/DatatableVue/style/scss/VDataTable.scss +177 -0
- package/src/DatatableVue/style/scss/_image-preview.scss +84 -0
- package/src/DatatableVue/types/v-data-table.ts +10 -0
package/dist/vDataTable.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as Q, useSlots as
|
|
2
|
-
import { D as
|
|
3
|
-
import { _ as re, P as
|
|
4
|
-
import
|
|
5
|
-
const
|
|
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 xe = Symbol("v-datatable-key"), pa = /* @__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
|
-
return
|
|
32
|
-
if (
|
|
31
|
+
const c = ["text", "img", "date", "html"];
|
|
32
|
+
return ye(() => {
|
|
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 xe = Symbol("v-datatable-key"), pa = /* @__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 h(
|
|
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
130
|
function v() {
|
|
125
|
-
|
|
131
|
+
l.deactivate_search_empty && _.value.trim() === "" || e("search");
|
|
126
132
|
}
|
|
127
|
-
return (
|
|
128
|
-
const
|
|
129
|
-
return
|
|
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 xe = Symbol("v-datatable-key"), pa = /* @__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
|
-
|
|
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
|
-
[
|
|
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 xe = Symbol("v-datatable-key"), pa = /* @__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
|
-
])])) : (
|
|
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 xe = Symbol("v-datatable-key"), pa = /* @__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
|
-
(
|
|
213
|
-
"type" in m && m.type === 1 && (!("visible" in m) || m.visible) ? (
|
|
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) ? (
|
|
228
|
+
}, 1032, ["to"])) : (!("type" in m) || m.type === 2) && (!("visible" in m) || m.visible) ? (t(), n("a", {
|
|
223
229
|
key: 1,
|
|
224
|
-
onClick:
|
|
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:
|
|
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
|
-
top: `${
|
|
243
|
-
left: `${
|
|
248
|
+
top: `${e.value + 15}px`,
|
|
249
|
+
left: `${l.value + 15}px`
|
|
244
250
|
}));
|
|
245
251
|
function c(v) {
|
|
246
|
-
const
|
|
247
|
-
let
|
|
248
|
-
|
|
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
262
|
function h() {
|
|
257
|
-
|
|
263
|
+
u.value = !1;
|
|
258
264
|
}
|
|
259
265
|
return {
|
|
260
|
-
isHovering:
|
|
261
|
-
previewSrc:
|
|
262
|
-
previewStyle:
|
|
263
|
-
handleMouseOver:
|
|
264
|
-
handleMouseMove:
|
|
266
|
+
isHovering: u,
|
|
267
|
+
previewSrc: f,
|
|
268
|
+
previewStyle: _,
|
|
269
|
+
handleMouseOver: B,
|
|
270
|
+
handleMouseMove: x,
|
|
265
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
287
|
function h(v) {
|
|
282
|
-
|
|
283
|
-
if (
|
|
284
|
-
const
|
|
285
|
-
|
|
288
|
+
xe(() => {
|
|
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
|
+
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 || ""
|
|
307
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
|
-
...
|
|
327
|
+
T = u.add_params || {};
|
|
328
|
+
return u.deactivate_default_params ? {
|
|
329
|
+
...T,
|
|
324
330
|
...v.value
|
|
325
331
|
} : {
|
|
326
332
|
...h.value,
|
|
327
|
-
...
|
|
333
|
+
...u.add_params,
|
|
328
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:
|
|
355
|
+
response: o,
|
|
356
|
+
attempt: S,
|
|
351
357
|
default_params: h,
|
|
352
|
-
fetchDataWithDelay:
|
|
353
|
-
reSearch:
|
|
354
|
-
showLoadingState:
|
|
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
|
|
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 v =
|
|
365
|
-
return v === 0 ? !1 : v ===
|
|
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 v =
|
|
379
|
+
function x() {
|
|
380
|
+
const v = f.value;
|
|
375
381
|
if (!v.length) return;
|
|
376
|
-
const
|
|
377
|
-
if (
|
|
378
|
-
const a = v.map((
|
|
379
|
-
|
|
380
|
-
(
|
|
382
|
+
const o = c.value;
|
|
383
|
+
if (o === !0 || o === "indeterminate") {
|
|
384
|
+
const a = v.map((w) => w[u.item_key]);
|
|
385
|
+
e.value = e.value.filter(
|
|
386
|
+
(w) => !a.includes(w[u.item_key])
|
|
381
387
|
);
|
|
382
388
|
} else
|
|
383
389
|
v.forEach((a) => {
|
|
384
|
-
|
|
390
|
+
_(a) || e.value.push(a);
|
|
385
391
|
});
|
|
386
392
|
}
|
|
387
393
|
function h(v) {
|
|
388
|
-
const
|
|
389
|
-
a > -1 ?
|
|
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:
|
|
393
|
-
selected_items:
|
|
394
|
-
isSelected:
|
|
398
|
+
selectAllCheckbox: l,
|
|
399
|
+
selected_items: e,
|
|
400
|
+
isSelected: _,
|
|
395
401
|
selectAllState: c,
|
|
396
|
-
atLeastOneSelected:
|
|
397
|
-
toggleSelectAll:
|
|
402
|
+
atLeastOneSelected: B,
|
|
403
|
+
toggleSelectAll: x,
|
|
398
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 ct = { class: "loading-container" }, pt = { key: 0 }, _t = { key: 2 }, mt
|
|
|
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
|
-
(
|
|
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
|
-
(
|
|
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 ? (
|
|
453
|
-
|
|
454
|
-
])])) : c.type === "text" ? (
|
|
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
|
-
}, [...
|
|
458
|
-
|
|
459
|
-
])], 2)) : c.type === "date" ? (
|
|
460
|
-
|
|
461
|
-
])])) : c.type === "html" ? (
|
|
463
|
+
}, [...e[1] || (e[1] = [
|
|
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
|
-
}, [...
|
|
465
|
-
|
|
466
|
-
])], 2)) : c.type === "img" ? (
|
|
470
|
+
}, [...e[3] || (e[3] = [
|
|
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
|
-
}, [...
|
|
470
|
-
|
|
471
|
-
])], 2)) : (
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
+
}, [...e[4] || (e[4] = [
|
|
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
|
-
(
|
|
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 ? (
|
|
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" ? (
|
|
496
|
+
])])) : c.type === "text" ? (t(), n("span", {
|
|
491
497
|
key: 1,
|
|
492
498
|
class: k(c.class_item)
|
|
493
|
-
}, [...
|
|
494
|
-
|
|
499
|
+
}, [...e[8] || (e[8] = [
|
|
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" ? (
|
|
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" ? (
|
|
511
|
+
])])) : c.type === "html" ? (t(), n("div", {
|
|
506
512
|
key: 3,
|
|
507
513
|
class: k(c.class_item)
|
|
508
|
-
}, [...
|
|
509
|
-
|
|
514
|
+
}, [...e[10] || (e[10] = [
|
|
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" ? (
|
|
520
|
+
])], 2)) : c.type === "img" ? (t(), n("div", {
|
|
515
521
|
key: 4,
|
|
516
522
|
class: k(["", c.class_item])
|
|
517
|
-
}, [...
|
|
518
|
-
|
|
519
|
-
|
|
523
|
+
}, [...e[11] || (e[11] = [
|
|
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)) : (
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
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
|
-
])])) : (
|
|
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 ct = { class: "loading-container" }, pt = { key: 0 }, _t = { key: 2 }, mt
|
|
|
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 ct = { class: "loading-container" }, pt = { key: 0 }, _t = { key: 2 }, mt
|
|
|
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 ct = { class: "loading-container" }, pt = { key: 0 }, _t = { key: 2 }, mt
|
|
|
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 ct = { class: "loading-container" }, pt = { key: 0 }, _t = { key: 2 }, mt
|
|
|
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 (
|
|
607
|
-
class: k(
|
|
612
|
+
return (x, h) => (t(), n("th", {
|
|
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: h[0] || (h[0] = (v) =>
|
|
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 ct = { class: "loading-container" }, pt = { key: 0 }, _t = { key: 2 }, mt
|
|
|
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 ct = { class: "loading-container" }, pt = { key: 0 }, _t = { key: 2 }, mt
|
|
|
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: {},
|
|
@@ -730,49 +736,51 @@ const ct = { class: "loading-container" }, pt = { key: 0 }, _t = { key: 2 }, mt
|
|
|
730
736
|
disable_search: { type: Boolean, default: !1 },
|
|
731
737
|
disable_request: { default: !1 },
|
|
732
738
|
pagination_teleport: { default: null },
|
|
733
|
-
search_teleport: { default: null }
|
|
739
|
+
search_teleport: { default: null },
|
|
740
|
+
show_header_when_empty: { type: Boolean, default: !1 }
|
|
734
741
|
},
|
|
735
742
|
emits: ["tradePage", "beforeFetch", "afterFetch", "clickedClearSearch"],
|
|
736
|
-
setup(
|
|
737
|
-
const
|
|
738
|
-
isHovering:
|
|
743
|
+
setup(u, { expose: f, emit: l }) {
|
|
744
|
+
const e = he(Qe, {}), {
|
|
745
|
+
isHovering: _,
|
|
739
746
|
previewSrc: c,
|
|
740
|
-
previewStyle:
|
|
741
|
-
handleMouseOver:
|
|
747
|
+
previewStyle: B,
|
|
748
|
+
handleMouseOver: x,
|
|
742
749
|
handleMouseMove: h,
|
|
743
750
|
handleMouseLeave: v
|
|
744
|
-
} =
|
|
751
|
+
} = ut(), o = u, a = C(() => ({
|
|
745
752
|
// Primeiro, espelha todas as props originais.
|
|
746
|
-
...
|
|
753
|
+
...o,
|
|
747
754
|
// Agora SOBRESCREVEMOS as propriedades que precisam de lógica Global/Default
|
|
748
755
|
// (Prioridade para Prop, mas aceita Global)
|
|
749
756
|
// === TEXTOS ===
|
|
750
|
-
first_text_page_size:
|
|
751
|
-
second_text_page_size:
|
|
752
|
-
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...",
|
|
753
760
|
// === CLASSES ===
|
|
754
|
-
class_table:
|
|
755
|
-
class_pagination:
|
|
756
|
-
class_container:
|
|
757
|
-
class_content:
|
|
758
|
-
class_filters:
|
|
759
|
-
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 || "",
|
|
760
767
|
// === CONFIGURAÇÃO DE API ===
|
|
761
|
-
filter_param_name:
|
|
762
|
-
search_param_name:
|
|
763
|
-
page_param_name:
|
|
764
|
-
page_size_param_name:
|
|
765
|
-
page_starts_at:
|
|
766
|
-
item_key:
|
|
767
|
-
data_key:
|
|
768
|
-
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",
|
|
769
776
|
// === COMPORTAMENTO ===
|
|
770
|
-
limit_per_page:
|
|
771
|
-
type_loading:
|
|
772
|
-
min_loading_delay:
|
|
773
|
-
retry_attempts:
|
|
774
|
-
retry_delay:
|
|
775
|
-
|
|
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({
|
|
776
784
|
current_page: a.value.page_starts_at,
|
|
777
785
|
// pagina atual
|
|
778
786
|
count: 0,
|
|
@@ -784,120 +792,135 @@ const ct = { class: "loading-container" }, pt = { key: 0 }, _t = { key: 2 }, mt
|
|
|
784
792
|
filter: ""
|
|
785
793
|
// filtro selecionado
|
|
786
794
|
}), {
|
|
787
|
-
expand_item_toggle:
|
|
788
|
-
close_all_expanded_items:
|
|
789
|
-
is_item_expanded:
|
|
790
|
-
} =
|
|
795
|
+
expand_item_toggle: U,
|
|
796
|
+
close_all_expanded_items: K,
|
|
797
|
+
is_item_expanded: Y
|
|
798
|
+
} = ct(
|
|
791
799
|
a.value.close_expanded_item_on_expand_new,
|
|
792
800
|
a.value.item_key,
|
|
793
801
|
a.value.deactivate_animation_expand,
|
|
794
802
|
a.value.scroll_to_expanded_item
|
|
795
803
|
), {
|
|
796
804
|
items: D,
|
|
797
|
-
error:
|
|
798
|
-
response:
|
|
799
|
-
attempt:
|
|
800
|
-
default_params:
|
|
801
|
-
fetchDataWithDelay:
|
|
805
|
+
error: T,
|
|
806
|
+
response: ae,
|
|
807
|
+
attempt: le,
|
|
808
|
+
default_params: Se,
|
|
809
|
+
fetchDataWithDelay: q,
|
|
802
810
|
reSearch: E,
|
|
803
|
-
showLoadingState:
|
|
804
|
-
first_fetch:
|
|
805
|
-
} =
|
|
811
|
+
showLoadingState: Ce,
|
|
812
|
+
first_fetch: $e
|
|
813
|
+
} = pt(a.value, y, S, m, w, K), {
|
|
806
814
|
selectAllCheckbox: oe,
|
|
807
|
-
selected_items:
|
|
815
|
+
selected_items: L,
|
|
808
816
|
isSelected: ie,
|
|
809
|
-
atLeastOneSelected:
|
|
817
|
+
atLeastOneSelected: Me,
|
|
810
818
|
toggleSelectAll: de,
|
|
811
|
-
toggleItemSelection:
|
|
812
|
-
} =
|
|
813
|
-
() =>
|
|
814
|
-
),
|
|
819
|
+
toggleItemSelection: ze
|
|
820
|
+
} = _t(a.value, D), ue = C(
|
|
821
|
+
() => S.value.filter((r) => r.locked && r.visible !== !1)
|
|
822
|
+
), se = C({
|
|
815
823
|
get() {
|
|
816
|
-
return
|
|
824
|
+
return S.value.filter((r) => !r.locked && r.visible !== !1);
|
|
817
825
|
},
|
|
818
|
-
set(
|
|
819
|
-
const
|
|
820
|
-
|
|
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];
|
|
821
829
|
}
|
|
822
|
-
}),
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
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);
|
|
828
849
|
}, { immediate: !0 });
|
|
829
|
-
function
|
|
850
|
+
function De() {
|
|
830
851
|
setTimeout(() => {
|
|
831
|
-
|
|
852
|
+
P.value = !1;
|
|
832
853
|
}, 500);
|
|
833
854
|
}
|
|
834
|
-
function
|
|
835
|
-
|
|
855
|
+
function Ee(r) {
|
|
856
|
+
S.value.push(r);
|
|
836
857
|
}
|
|
837
|
-
|
|
838
|
-
const
|
|
839
|
-
const
|
|
840
|
-
|
|
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());
|
|
841
862
|
};
|
|
842
|
-
function
|
|
843
|
-
if (!
|
|
844
|
-
const
|
|
845
|
-
let p =
|
|
846
|
-
for (const X of
|
|
847
|
-
p && typeof p == "object" && X in p ? p = p[X] : console.error(`Caminho inválido ou valor nulo em: ${
|
|
848
|
-
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;
|
|
849
870
|
}
|
|
850
|
-
function
|
|
851
|
-
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;
|
|
852
873
|
}
|
|
853
|
-
function
|
|
854
|
-
for (const
|
|
855
|
-
|
|
856
|
-
const
|
|
857
|
-
|
|
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();
|
|
858
879
|
}
|
|
859
|
-
function
|
|
860
|
-
|
|
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.");
|
|
861
882
|
}
|
|
862
|
-
function
|
|
863
|
-
y.value.search =
|
|
883
|
+
function He(r) {
|
|
884
|
+
y.value.search = r, E();
|
|
864
885
|
}
|
|
865
|
-
function
|
|
866
|
-
y.value.filter =
|
|
886
|
+
function Oe(r) {
|
|
887
|
+
y.value.filter = r, E();
|
|
867
888
|
}
|
|
868
|
-
function
|
|
869
|
-
|
|
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.");
|
|
870
891
|
}
|
|
871
|
-
function
|
|
872
|
-
let
|
|
873
|
-
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;
|
|
874
895
|
}
|
|
875
|
-
function
|
|
876
|
-
|
|
896
|
+
function Pe() {
|
|
897
|
+
w("tradePage"), q();
|
|
877
898
|
}
|
|
878
|
-
const
|
|
879
|
-
const
|
|
880
|
-
if (
|
|
881
|
-
for (const [
|
|
882
|
-
typeof p == "function" && p(
|
|
883
|
-
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();
|
|
884
905
|
};
|
|
885
|
-
return
|
|
886
|
-
execute:
|
|
906
|
+
return f({
|
|
907
|
+
execute: q,
|
|
887
908
|
reSearch: E,
|
|
888
|
-
pagination:
|
|
889
|
-
set_limit_per_page:
|
|
890
|
-
set_search:
|
|
891
|
-
set_filter:
|
|
892
|
-
set_page:
|
|
893
|
-
default_params:
|
|
894
|
-
selected_items:
|
|
895
|
-
atLeastOneSelected:
|
|
896
|
-
expand_item_toggle:
|
|
897
|
-
close_all_expanded_items:
|
|
898
|
-
selectAllCheckbox: oe
|
|
899
|
-
|
|
900
|
-
|
|
909
|
+
pagination: Xe(y),
|
|
910
|
+
set_limit_per_page: Ne,
|
|
911
|
+
set_search: He,
|
|
912
|
+
set_filter: Oe,
|
|
913
|
+
set_page: je,
|
|
914
|
+
default_params: Se,
|
|
915
|
+
selected_items: L,
|
|
916
|
+
atLeastOneSelected: Me,
|
|
917
|
+
expand_item_toggle: U,
|
|
918
|
+
close_all_expanded_items: K,
|
|
919
|
+
selectAllCheckbox: oe,
|
|
920
|
+
toggleColumnVisibility: Ve,
|
|
921
|
+
columns_list: Be
|
|
922
|
+
}), ye(() => {
|
|
923
|
+
a.value.immediate && xe(() => {
|
|
901
924
|
E();
|
|
902
925
|
});
|
|
903
926
|
}), J(
|
|
@@ -906,349 +929,353 @@ const ct = { class: "loading-container" }, pt = { key: 0 }, _t = { key: 2 }, mt
|
|
|
906
929
|
E();
|
|
907
930
|
},
|
|
908
931
|
{ deep: !0 }
|
|
909
|
-
), (
|
|
910
|
-
|
|
932
|
+
), (r, d) => (t(), n("div", null, [
|
|
933
|
+
i("div", {
|
|
911
934
|
class: k(["", a.value.class_container])
|
|
912
935
|
}, [
|
|
913
|
-
|
|
914
|
-
|
|
936
|
+
j(r.$slots, "default", {}, void 0, !0),
|
|
937
|
+
i("div", {
|
|
915
938
|
class: k(["", a.value.class_content])
|
|
916
939
|
}, [
|
|
917
|
-
|
|
940
|
+
i("div", {
|
|
918
941
|
class: k([a.value.class_filters, "d-flex justify-content-between align-items-start"])
|
|
919
942
|
}, [
|
|
920
|
-
|
|
921
|
-
changePageSize:
|
|
943
|
+
j(r.$slots, "pageSize", {
|
|
944
|
+
changePageSize: pe,
|
|
922
945
|
limit_per_page: y.value.limit_per_page
|
|
923
946
|
}, () => [
|
|
924
|
-
|
|
947
|
+
i("div", {
|
|
925
948
|
class: k(["text-secondary", a.value.class_page_size])
|
|
926
949
|
}, [
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
950
|
+
O($(a.value.first_text_page_size) + " ", 1),
|
|
951
|
+
i("div", Dt, [
|
|
952
|
+
ke(i("input", {
|
|
930
953
|
class: "form-control form-control-sm",
|
|
931
|
-
onChange:
|
|
932
|
-
"onUpdate:modelValue":
|
|
954
|
+
onChange: pe,
|
|
955
|
+
"onUpdate:modelValue": d[0] || (d[0] = (s) => y.value.limit_per_page = s),
|
|
933
956
|
min: "1",
|
|
934
957
|
size: "3",
|
|
935
958
|
"aria-label": "Número de registros por página",
|
|
936
959
|
type: "number"
|
|
937
960
|
}, null, 544), [
|
|
938
961
|
[
|
|
939
|
-
|
|
962
|
+
be,
|
|
940
963
|
y.value.limit_per_page,
|
|
941
964
|
void 0,
|
|
942
965
|
{ lazy: !0 }
|
|
943
966
|
]
|
|
944
967
|
])
|
|
945
968
|
]),
|
|
946
|
-
|
|
969
|
+
O(" " + $(a.value.second_text_page_size), 1)
|
|
947
970
|
], 2)
|
|
948
971
|
], !0),
|
|
949
|
-
|
|
950
|
-
(
|
|
972
|
+
j(r.$slots, "fieldMiddle", {}, void 0, !0),
|
|
973
|
+
(t(), H(ge, {
|
|
951
974
|
to: a.value.search_teleport || "body",
|
|
952
975
|
disabled: !a.value.search_teleport
|
|
953
976
|
}, [
|
|
954
|
-
|
|
977
|
+
j(r.$slots, "search-field", {
|
|
955
978
|
search: y.value.search,
|
|
956
979
|
filter: y.value.filter,
|
|
957
|
-
reSearch:
|
|
980
|
+
reSearch: g(E),
|
|
958
981
|
list_filter: a.value.list_filter,
|
|
959
|
-
item_use:
|
|
982
|
+
item_use: ce.value
|
|
960
983
|
}, () => [
|
|
961
|
-
a.value.disable_search ? b("", !0) : (
|
|
984
|
+
a.value.disable_search ? b("", !0) : (t(), H(dt, {
|
|
962
985
|
key: 0,
|
|
963
986
|
search: y.value.search,
|
|
964
|
-
"onUpdate:search":
|
|
987
|
+
"onUpdate:search": d[1] || (d[1] = (s) => y.value.search = s),
|
|
965
988
|
filter: y.value.filter,
|
|
966
|
-
"onUpdate:filter":
|
|
989
|
+
"onUpdate:filter": d[2] || (d[2] = (s) => y.value.filter = s),
|
|
967
990
|
list_filter: a.value.list_filter,
|
|
968
|
-
item_use:
|
|
969
|
-
onSearch:
|
|
991
|
+
item_use: ce.value,
|
|
992
|
+
onSearch: g(E),
|
|
970
993
|
deactivate_search_on_clear: a.value.deactivate_search_on_clear,
|
|
971
994
|
placeholder_search: a.value.placeholder_search,
|
|
972
995
|
deactivate_search_empty: a.value.deactivate_search_empty,
|
|
973
|
-
onClickedClearSearch:
|
|
996
|
+
onClickedClearSearch: d[3] || (d[3] = (s) => r.$emit("clickedClearSearch"))
|
|
974
997
|
}, null, 8, ["search", "filter", "list_filter", "item_use", "onSearch", "deactivate_search_on_clear", "placeholder_search", "deactivate_search_empty"]))
|
|
975
998
|
], !0)
|
|
976
999
|
], 8, ["to", "disabled"]))
|
|
977
1000
|
], 2),
|
|
978
|
-
|
|
979
|
-
selected_items:
|
|
980
|
-
clearSelection: () =>
|
|
1001
|
+
j(r.$slots, "item-selected-info", {
|
|
1002
|
+
selected_items: g(L),
|
|
1003
|
+
clearSelection: () => L.value = []
|
|
981
1004
|
}, () => [
|
|
982
|
-
a.value.use_checkbox &&
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
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)
|
|
987
1010
|
]),
|
|
988
|
-
|
|
1011
|
+
i("a", {
|
|
989
1012
|
class: "cursor-pointer",
|
|
990
|
-
onClick:
|
|
991
|
-
}, [...
|
|
992
|
-
|
|
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)
|
|
993
1016
|
])])
|
|
994
1017
|
])) : b("", !0)
|
|
995
1018
|
], !0),
|
|
996
|
-
|
|
1019
|
+
g(Ce) ? (t(), H(zt, {
|
|
997
1020
|
key: 0,
|
|
998
|
-
columns:
|
|
1021
|
+
columns: S.value,
|
|
999
1022
|
limit: y.value.limit_per_page,
|
|
1000
1023
|
type_loading: a.value.type_loading,
|
|
1001
1024
|
custom_loading: a.value.custom_loading,
|
|
1002
1025
|
class_table: a.value.class_table,
|
|
1003
|
-
attempt:
|
|
1026
|
+
attempt: g(le),
|
|
1004
1027
|
pagination: y.value
|
|
1005
|
-
}, null, 8, ["columns", "limit", "type_loading", "custom_loading", "class_table", "attempt", "pagination"])) :
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
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", {
|
|
1009
1032
|
class: "btn btn-primary mt-2",
|
|
1010
|
-
onClick:
|
|
1011
|
-
(...
|
|
1033
|
+
onClick: d[5] || (d[5] = //@ts-ignore
|
|
1034
|
+
(...s) => g(q) && g(q)(...s))
|
|
1012
1035
|
}, " Tentar Novamente ")
|
|
1013
|
-
])) :
|
|
1014
|
-
|
|
1015
|
-
|
|
1036
|
+
])) : g(D) ? (t(), n("div", At, [
|
|
1037
|
+
R.value || a.value.show_header_when_empty ? (t(), n("div", Pt, [
|
|
1038
|
+
i("table", {
|
|
1016
1039
|
class: k(["table table-vcenter table-selectable", a.value.class_table])
|
|
1017
1040
|
}, [
|
|
1018
|
-
|
|
1019
|
-
W(
|
|
1020
|
-
modelValue:
|
|
1021
|
-
"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),
|
|
1022
1045
|
tag: "tr",
|
|
1023
|
-
"item-key": "
|
|
1046
|
+
"item-key": "id",
|
|
1024
1047
|
animation: 400,
|
|
1025
1048
|
"ghost-class": "ghost-item",
|
|
1026
1049
|
"drag-class": "dragging-item",
|
|
1027
|
-
onStart:
|
|
1028
|
-
onEnd:
|
|
1050
|
+
onStart: d[8] || (d[8] = (s) => P.value = !0),
|
|
1051
|
+
onEnd: d[9] || (d[9] = () => De())
|
|
1029
1052
|
}, {
|
|
1030
|
-
header:
|
|
1031
|
-
a.value.use_expandable_items ? (
|
|
1032
|
-
a.value.use_checkbox ? (
|
|
1033
|
-
|
|
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", {
|
|
1034
1057
|
class: "form-check-input m-0",
|
|
1035
1058
|
type: "checkbox",
|
|
1036
1059
|
ref_key: "selectAllCheckbox",
|
|
1037
1060
|
ref: oe,
|
|
1038
|
-
onChange:
|
|
1039
|
-
(...
|
|
1061
|
+
onChange: d[6] || (d[6] = //@ts-ignore
|
|
1062
|
+
(...s) => g(de) && g(de)(...s)),
|
|
1040
1063
|
"aria-label": "Selecionar todos os itens na página"
|
|
1041
1064
|
}, null, 544)
|
|
1042
1065
|
])) : b("", !0)
|
|
1043
1066
|
]),
|
|
1044
|
-
item:
|
|
1045
|
-
W(
|
|
1046
|
-
header:
|
|
1047
|
-
class_column:
|
|
1048
|
-
use_ordering:
|
|
1049
|
-
orderings_state: m.value[
|
|
1050
|
-
onToggleOrderingState: () =>
|
|
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),
|
|
1051
1074
|
locked: !1,
|
|
1052
|
-
col:
|
|
1075
|
+
col: s
|
|
1053
1076
|
}, null, 8, ["header", "class_column", "use_ordering", "orderings_state", "onToggleOrderingState", "col"])
|
|
1054
1077
|
]),
|
|
1055
|
-
footer:
|
|
1056
|
-
(
|
|
1057
|
-
key:
|
|
1058
|
-
header:
|
|
1059
|
-
class_column:
|
|
1060
|
-
use_ordering:
|
|
1061
|
-
orderings_state: m.value[
|
|
1062
|
-
onToggleOrderingState: () =>
|
|
1063
|
-
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,
|
|
1064
1087
|
locked: ""
|
|
1065
1088
|
}, null, 8, ["header", "class_column", "use_ordering", "orderings_state", "onToggleOrderingState", "col"]))), 128))
|
|
1066
1089
|
]),
|
|
1067
1090
|
_: 1
|
|
1068
1091
|
}, 8, ["modelValue"])
|
|
1069
1092
|
]),
|
|
1070
|
-
|
|
1071
|
-
(
|
|
1072
|
-
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]
|
|
1073
1096
|
}, [
|
|
1074
|
-
W(
|
|
1097
|
+
W(Ge, {
|
|
1075
1098
|
tag: "tr",
|
|
1076
|
-
name:
|
|
1099
|
+
name: P.value ? "column-move" : ""
|
|
1077
1100
|
}, {
|
|
1078
|
-
default:
|
|
1079
|
-
a.value.use_expandable_items ? (
|
|
1080
|
-
|
|
1081
|
-
item:
|
|
1082
|
-
index:
|
|
1083
|
-
isExpanded:
|
|
1084
|
-
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)
|
|
1085
1108
|
}, () => [
|
|
1086
|
-
|
|
1109
|
+
i("button", {
|
|
1087
1110
|
type: "button",
|
|
1088
|
-
class: k(["btn-clean btn-icon-anim", { "is-expanded":
|
|
1089
|
-
onClick: (p) =>
|
|
1111
|
+
class: k(["btn-clean btn-icon-anim", { "is-expanded": g(Y)(s) }]),
|
|
1112
|
+
onClick: (p) => g(U)(s)
|
|
1090
1113
|
}, [
|
|
1091
|
-
a.value.type_button_expand === "arrow" ? (
|
|
1092
|
-
|
|
1114
|
+
a.value.type_button_expand === "arrow" ? (t(), n("svg", Kt, [...d[14] || (d[14] = [
|
|
1115
|
+
i("path", {
|
|
1093
1116
|
stroke: "none",
|
|
1094
1117
|
d: "M0 0h24v24H0z",
|
|
1095
1118
|
fill: "none"
|
|
1096
1119
|
}, null, -1),
|
|
1097
|
-
|
|
1098
|
-
])])) : (
|
|
1099
|
-
|
|
1120
|
+
i("path", { d: "M9 6l6 6l-6 6" }, null, -1)
|
|
1121
|
+
])])) : (t(), n("svg", Yt, [...d[15] || (d[15] = [
|
|
1122
|
+
i("path", {
|
|
1100
1123
|
stroke: "none",
|
|
1101
1124
|
d: "M0 0h24v24H0z",
|
|
1102
1125
|
fill: "none"
|
|
1103
1126
|
}, null, -1),
|
|
1104
|
-
|
|
1127
|
+
i("path", {
|
|
1105
1128
|
d: "M12 5l0 14",
|
|
1106
1129
|
class: "vertical-line"
|
|
1107
1130
|
}, null, -1),
|
|
1108
|
-
|
|
1131
|
+
i("path", { d: "M5 12l14 0" }, null, -1)
|
|
1109
1132
|
])]))
|
|
1110
|
-
], 10,
|
|
1133
|
+
], 10, Ut)
|
|
1111
1134
|
], !0)
|
|
1112
1135
|
])) : b("", !0),
|
|
1113
|
-
a.value.use_checkbox ? (
|
|
1114
|
-
|
|
1136
|
+
a.value.use_checkbox ? (t(), n("td", Xt, [
|
|
1137
|
+
i("input", {
|
|
1115
1138
|
class: "form-check-input m-0",
|
|
1116
1139
|
type: "checkbox",
|
|
1117
|
-
checked:
|
|
1118
|
-
onChange: (p) =>
|
|
1140
|
+
checked: g(ie)(s),
|
|
1141
|
+
onChange: (p) => g(ze)(s),
|
|
1119
1142
|
"aria-label": "Selecionar este item"
|
|
1120
|
-
}, null, 40,
|
|
1143
|
+
}, null, 40, Gt)
|
|
1121
1144
|
])) : b("", !0),
|
|
1122
|
-
(
|
|
1145
|
+
(t(!0), n(V, null, N(Te.value, (p, X) => (t(), n("td", {
|
|
1123
1146
|
key: p.field || p.header,
|
|
1124
1147
|
class: k(p.class_row)
|
|
1125
1148
|
}, [
|
|
1126
|
-
p.bodySlot ? (
|
|
1149
|
+
p.bodySlot ? (t(), H(te(p.bodySlot), {
|
|
1127
1150
|
key: 0,
|
|
1128
|
-
item:
|
|
1151
|
+
item: s,
|
|
1129
1152
|
index: X,
|
|
1130
|
-
"is-selected":
|
|
1131
|
-
}, null, 8, ["item", "index", "is-selected"])) : p.type === "text" ? (
|
|
1153
|
+
"is-selected": g(ie)(s)
|
|
1154
|
+
}, null, 8, ["item", "index", "is-selected"])) : p.type === "text" ? (t(), n("span", {
|
|
1132
1155
|
key: 1,
|
|
1133
|
-
onClick: (G) => p.click ? p.click(
|
|
1134
|
-
class: k(
|
|
1135
|
-
},
|
|
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", {
|
|
1136
1159
|
key: 2,
|
|
1137
|
-
onClick: (G) => p.click ? p.click(
|
|
1138
|
-
class: k(
|
|
1160
|
+
onClick: (G) => p.click ? p.click(s) : null,
|
|
1161
|
+
class: k(Z(p, s))
|
|
1139
1162
|
}, [
|
|
1140
|
-
p.format === "complete" ? (
|
|
1141
|
-
|
|
1163
|
+
p.format === "complete" ? (t(), n("span", Qt, $(new Date(A(
|
|
1164
|
+
p.field,
|
|
1165
|
+
s
|
|
1166
|
+
)).toLocaleString()), 1)) : b("", !0),
|
|
1167
|
+
p.format === "simple" ? (t(), n("span", Rt, $(new Date(A(
|
|
1142
1168
|
p.field,
|
|
1143
|
-
|
|
1169
|
+
s
|
|
1144
1170
|
)).toLocaleDateString()), 1)) : b("", !0)
|
|
1145
|
-
], 10,
|
|
1171
|
+
], 10, Jt)) : p.type === "html" ? (t(), n("div", {
|
|
1146
1172
|
key: 3,
|
|
1147
|
-
onClick: (G) => p.click ? p.click(
|
|
1148
|
-
class: k(
|
|
1149
|
-
innerHTML:
|
|
1150
|
-
}, 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", {
|
|
1151
1177
|
key: 4,
|
|
1152
|
-
onClick: (G) => p.click ? p.click(
|
|
1153
|
-
class: k(
|
|
1178
|
+
onClick: (G) => p.click ? p.click(s) : null,
|
|
1179
|
+
class: k(Z(p, s))
|
|
1154
1180
|
}, [
|
|
1155
|
-
|
|
1181
|
+
A(p.field, s) ? (t(), n("div", ne({
|
|
1156
1182
|
key: 0,
|
|
1157
1183
|
ref_for: !0
|
|
1158
1184
|
}, p.deactivate_img_preview ? {
|
|
1159
1185
|
class: "container-img"
|
|
1160
1186
|
} : {
|
|
1161
|
-
onMouseover: (G) =>
|
|
1162
|
-
onMousemove:
|
|
1163
|
-
onMouseleave:
|
|
1187
|
+
onMouseover: (G) => g(x)(G, A(p.field, s)),
|
|
1188
|
+
onMousemove: g(h),
|
|
1189
|
+
onMouseleave: g(v),
|
|
1164
1190
|
class: "container-img container-img-preview"
|
|
1165
1191
|
}), [
|
|
1166
|
-
|
|
1192
|
+
i("img", {
|
|
1167
1193
|
class: "img-tamanho",
|
|
1168
|
-
src:
|
|
1169
|
-
}, null, 8,
|
|
1170
|
-
|
|
1194
|
+
src: A(p.field, s)
|
|
1195
|
+
}, null, 8, ta),
|
|
1196
|
+
i("img", {
|
|
1171
1197
|
class: "img-tamanho-cover",
|
|
1172
|
-
src:
|
|
1173
|
-
}, null, 8,
|
|
1174
|
-
|
|
1198
|
+
src: A(p.field, s)
|
|
1199
|
+
}, null, 8, aa),
|
|
1200
|
+
d[16] || (d[16] = i("div", { class: "bg-img" }, null, -1))
|
|
1175
1201
|
], 16)) : b("", !0)
|
|
1176
|
-
], 10,
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
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))
|
|
1180
1206
|
]))
|
|
1181
1207
|
], 2))), 128))
|
|
1182
1208
|
]),
|
|
1183
1209
|
_: 2
|
|
1184
1210
|
}, 1032, ["name"]),
|
|
1185
|
-
W(
|
|
1211
|
+
W(We, {
|
|
1186
1212
|
name: "expand-item-" + a.value.type_animation_expand,
|
|
1187
1213
|
css: !a.value.deactivate_animation_expand
|
|
1188
1214
|
}, {
|
|
1189
|
-
default:
|
|
1190
|
-
|
|
1215
|
+
default: F(() => [
|
|
1216
|
+
g(Y)(s) ? (t(), n("tr", {
|
|
1191
1217
|
key: 0,
|
|
1192
|
-
id: "expand-item-" +
|
|
1218
|
+
id: "expand-item-" + s[a.value.item_key],
|
|
1193
1219
|
class: "expanded-item-row"
|
|
1194
1220
|
}, [
|
|
1195
|
-
|
|
1196
|
-
colspan:
|
|
1221
|
+
i("td", {
|
|
1222
|
+
colspan: Ae()
|
|
1197
1223
|
}, [
|
|
1198
|
-
|
|
1199
|
-
], 8,
|
|
1200
|
-
], 8,
|
|
1224
|
+
j(r.$slots, "after-row", { item: s }, void 0, !0)
|
|
1225
|
+
], 8, ra)
|
|
1226
|
+
], 8, na)) : b("", !0)
|
|
1201
1227
|
]),
|
|
1202
1228
|
_: 2
|
|
1203
1229
|
}, 1032, ["name", "css"])
|
|
1204
|
-
], 64))), 128))
|
|
1230
|
+
], 64))), 128)) : b("", !0)
|
|
1205
1231
|
])
|
|
1206
1232
|
], 2)
|
|
1207
|
-
])) :
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1233
|
+
])) : b("", !0),
|
|
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)
|
|
1211
1238
|
])]))
|
|
1212
1239
|
])) : b("", !0)
|
|
1213
1240
|
], 2)
|
|
1214
1241
|
], 2),
|
|
1215
|
-
(
|
|
1242
|
+
(t(), H(ge, {
|
|
1216
1243
|
to: a.value.pagination_teleport || "body",
|
|
1217
1244
|
disabled: !a.value.pagination_teleport
|
|
1218
1245
|
}, [
|
|
1219
|
-
|
|
1246
|
+
j(r.$slots, "pagination", {
|
|
1220
1247
|
pagination: y.value,
|
|
1221
|
-
tradePage:
|
|
1222
|
-
error:
|
|
1248
|
+
tradePage: g(q),
|
|
1249
|
+
error: g(T)
|
|
1223
1250
|
}, () => [
|
|
1224
|
-
!
|
|
1251
|
+
!g(T) && y.value.count > 0 ? (t(), n("div", {
|
|
1225
1252
|
key: 0,
|
|
1226
1253
|
class: k(["px-3", a.value.class_pagination])
|
|
1227
1254
|
}, [
|
|
1228
|
-
W(
|
|
1255
|
+
W(Re, {
|
|
1229
1256
|
page_starts_at: a.value.page_starts_at,
|
|
1230
1257
|
filtering: !0,
|
|
1231
1258
|
pagination: y.value,
|
|
1232
|
-
onTradePage:
|
|
1259
|
+
onTradePage: Pe
|
|
1233
1260
|
}, null, 8, ["page_starts_at", "pagination"])
|
|
1234
1261
|
], 2)) : b("", !0)
|
|
1235
1262
|
], !0)
|
|
1236
1263
|
], 8, ["to", "disabled"])),
|
|
1237
|
-
|
|
1264
|
+
g(_) ? (t(), n("div", {
|
|
1238
1265
|
key: 0,
|
|
1239
1266
|
class: "image-preview-container",
|
|
1240
|
-
style:
|
|
1267
|
+
style: Je(g(B))
|
|
1241
1268
|
}, [
|
|
1242
|
-
|
|
1243
|
-
src:
|
|
1269
|
+
i("img", {
|
|
1270
|
+
src: g(c),
|
|
1244
1271
|
alt: "Preview",
|
|
1245
1272
|
class: "image-preview-large"
|
|
1246
|
-
}, null, 8,
|
|
1273
|
+
}, null, 8, da)
|
|
1247
1274
|
], 4)) : b("", !0)
|
|
1248
1275
|
]));
|
|
1249
1276
|
}
|
|
1250
|
-
}),
|
|
1277
|
+
}), ga = /* @__PURE__ */ re(ua, [["__scopeId", "data-v-ea8e198a"]]);
|
|
1251
1278
|
export {
|
|
1252
|
-
|
|
1253
|
-
|
|
1279
|
+
va as VColumn,
|
|
1280
|
+
ga as VDataTable
|
|
1254
1281
|
};
|