v-sistec-features 1.7.0 → 1.8.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/Pagination-DtVDFQ07.js +118 -0
- package/dist/Pagination.d.ts +27 -0
- package/dist/Pagination.js +4 -0
- package/dist/{core/plugin.d.ts → core.d.ts} +7 -5
- package/dist/{iframeCommunicator/useIframeCommunicator.d.ts → iframeCommunicator.d.ts} +18 -8
- package/dist/index.d.ts +26 -3
- package/dist/toast.d.ts +19 -0
- package/dist/v-sistec-features.css +1 -1
- package/dist/vDataPage.d.ts +109 -0
- package/dist/vDataPage.js +262 -360
- package/dist/vDataTable.d.ts +161 -0
- package/dist/vDataTable.js +381 -488
- package/package.json +6 -2
- package/src/DataPageVue/components/VDataPage.vue +17 -16
- package/src/DataPageVue/types/v-data-page.ts +1 -0
- package/src/DatatableVue/components/VDataTable.vue +3 -2
- package/src/Pagination/index.ts +4 -0
- package/dist/DataPageVue/components/PaginationDatatable.vue.d.ts +0 -17
- package/dist/DataPageVue/components/VDataPage.vue.d.ts +0 -45
- package/dist/DataPageVue/index.d.ts +0 -2
- package/dist/DataPageVue/types/v-data-page.d.ts +0 -50
- package/dist/DatatableVue/components/PaginationDatatable.vue.d.ts +0 -19
- package/dist/DatatableVue/components/SearchDatatable.vue.d.ts +0 -20
- package/dist/DatatableVue/components/VColumn.vue.d.ts +0 -53
- package/dist/DatatableVue/components/VDataTable.vue.d.ts +0 -36
- package/dist/DatatableVue/composables/useImagePreview.d.ts +0 -9
- package/dist/DatatableVue/index.d.ts +0 -3
- package/dist/DatatableVue/keys.d.ts +0 -31
- package/dist/DatatableVue/types/v-data-table.d.ts +0 -46
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
- package/dist/core/index.d.ts +0 -1
- package/dist/iframeCommunicator/index.d.ts +0 -2
- package/dist/iframeCommunicator/useThemeFromParent.d.ts +0 -5
- package/dist/toast/components/ToastComponent.vue.d.ts +0 -6
- package/dist/toast/index.d.ts +0 -1
- package/dist/toast/useToastStore.d.ts +0 -15
- package/src/DataPageVue/components/PaginationDatatable.vue +0 -222
- /package/src/{DatatableVue/components/PaginationDatatable.vue → Pagination/Pagination.vue} +0 -0
package/dist/vDataPage.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { _ as
|
|
3
|
-
function ye(
|
|
4
|
-
if (!
|
|
1
|
+
import { defineComponent as Q, ref as _, toRefs as oe, createElementBlock as g, watch as P, onMounted as ue, onUnmounted as se, openBlock as m, withDirectives as de, renderSlot as k, createCommentVNode as U, createElementVNode as v, createVNode as q, vShow as ce, toDisplayString as A, nextTick as B, pushScopeId as fe, popScopeId as pe, computed as W, readonly as _e, isRef as ge, Fragment as D, createTextVNode as me, normalizeClass as M, renderList as $, unref as T, withCtx as j } from "vue";
|
|
2
|
+
import { P as ve, _ as he } from "./Pagination-DtVDFQ07.js";
|
|
3
|
+
function ye(a, d = null) {
|
|
4
|
+
if (!a)
|
|
5
5
|
return !1;
|
|
6
|
-
const
|
|
7
|
-
return
|
|
6
|
+
const u = a.getBoundingClientRect(), i = d ? d.getBoundingClientRect() : { top: 0, left: 0, bottom: window.innerHeight, right: window.innerWidth };
|
|
7
|
+
return u.bottom >= i.top && u.top <= i.bottom && u.right >= i.left && u.left <= i.right;
|
|
8
8
|
}
|
|
9
|
-
async function ke(
|
|
10
|
-
return
|
|
9
|
+
async function ke(a) {
|
|
10
|
+
return a ? (await B(), a.value instanceof HTMLElement ? a.value : a.value ? document.querySelector(a.value) : null) : null;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
let
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
(
|
|
17
|
-
|
|
12
|
+
function Ie(a) {
|
|
13
|
+
let d = `0px 0px ${a.distance}px 0px`;
|
|
14
|
+
a.top && (d = `${a.distance}px 0px 0px 0px`);
|
|
15
|
+
const u = new IntersectionObserver(
|
|
16
|
+
(i) => {
|
|
17
|
+
i[0].isIntersecting && (a.firstload && a.emit(), a.firstload = !0);
|
|
18
18
|
},
|
|
19
|
-
{ root:
|
|
19
|
+
{ root: a.parentEl, rootMargin: d }
|
|
20
20
|
);
|
|
21
|
-
return
|
|
21
|
+
return a.infiniteLoading.value && u.observe(a.infiniteLoading.value), u;
|
|
22
22
|
}
|
|
23
|
-
async function
|
|
24
|
-
if (await
|
|
23
|
+
async function J(a, d) {
|
|
24
|
+
if (await B(), !a.top)
|
|
25
25
|
return;
|
|
26
|
-
const
|
|
27
|
-
|
|
26
|
+
const u = a.parentEl || document.documentElement;
|
|
27
|
+
u.scrollTop = u.scrollHeight - d;
|
|
28
28
|
}
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
for (const [
|
|
32
|
-
|
|
33
|
-
return
|
|
34
|
-
}, we = {},
|
|
35
|
-
|
|
29
|
+
const Y = (a, d) => {
|
|
30
|
+
const u = a.__vccOpts || a;
|
|
31
|
+
for (const [i, e] of d)
|
|
32
|
+
u[i] = e;
|
|
33
|
+
return u;
|
|
34
|
+
}, we = {}, Le = (a) => (fe("data-v-d3e37633"), a = a(), pe(), a), Ee = { class: "container" }, be = /* @__PURE__ */ Le(() => /* @__PURE__ */ v("div", { class: "spinner" }, null, -1)), xe = [
|
|
35
|
+
be
|
|
36
36
|
];
|
|
37
|
-
function
|
|
38
|
-
return
|
|
37
|
+
function De(a, d) {
|
|
38
|
+
return m(), g("div", Ee, xe);
|
|
39
39
|
}
|
|
40
|
-
const
|
|
40
|
+
const Te = /* @__PURE__ */ Y(we, [["render", De], ["__scopeId", "data-v-d3e37633"]]), Pe = { class: "state-error" }, Be = /* @__PURE__ */ Q({
|
|
41
41
|
__name: "InfiniteLoading",
|
|
42
42
|
props: {
|
|
43
43
|
top: { type: Boolean, default: !1 },
|
|
@@ -48,180 +48,74 @@ const Me = /* @__PURE__ */ ee(we, [["render", Pe], ["__scopeId", "data-v-d3e3763
|
|
|
48
48
|
slots: {}
|
|
49
49
|
},
|
|
50
50
|
emits: ["infinite"],
|
|
51
|
-
setup(
|
|
52
|
-
const
|
|
53
|
-
let
|
|
54
|
-
const
|
|
55
|
-
infiniteLoading:
|
|
56
|
-
top:
|
|
57
|
-
firstload:
|
|
51
|
+
setup(a, { emit: d }) {
|
|
52
|
+
const u = a;
|
|
53
|
+
let i = null, e = 0;
|
|
54
|
+
const I = _(null), h = _(""), { top: F, firstload: s, distance: o } = u, { identifier: S, target: z } = oe(u), c = {
|
|
55
|
+
infiniteLoading: I,
|
|
56
|
+
top: F,
|
|
57
|
+
firstload: s,
|
|
58
58
|
distance: o,
|
|
59
59
|
parentEl: null,
|
|
60
60
|
emit() {
|
|
61
|
-
e = (
|
|
61
|
+
e = (c.parentEl || document.documentElement).scrollHeight, w.loading(), d("infinite", w);
|
|
62
62
|
}
|
|
63
|
-
},
|
|
63
|
+
}, w = {
|
|
64
64
|
loading() {
|
|
65
|
-
|
|
65
|
+
h.value = "loading";
|
|
66
66
|
},
|
|
67
67
|
async loaded() {
|
|
68
|
-
|
|
68
|
+
h.value = "loaded", await J(c, e), ye(I.value, c.parentEl) && c.emit();
|
|
69
69
|
},
|
|
70
70
|
async complete() {
|
|
71
|
-
|
|
71
|
+
h.value = "complete", await J(c, e), i?.disconnect();
|
|
72
72
|
},
|
|
73
73
|
error() {
|
|
74
|
-
|
|
74
|
+
h.value = "error";
|
|
75
75
|
}
|
|
76
76
|
};
|
|
77
77
|
function n() {
|
|
78
|
-
|
|
78
|
+
i?.disconnect(), i = Ie(c);
|
|
79
79
|
}
|
|
80
|
-
return
|
|
81
|
-
|
|
82
|
-
}),
|
|
80
|
+
return P(S, n), ue(async () => {
|
|
81
|
+
c.parentEl = await ke(z), n();
|
|
82
|
+
}), se(() => i?.disconnect()), (L, C) => (m(), g("div", {
|
|
83
83
|
ref_key: "infiniteLoading",
|
|
84
|
-
ref:
|
|
84
|
+
ref: I,
|
|
85
85
|
class: "v3-infinite-loading"
|
|
86
86
|
}, [
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
de(v("div", null, [
|
|
88
|
+
k(L.$slots, "spinner", {}, () => [
|
|
89
|
+
q(Te)
|
|
90
90
|
], !0)
|
|
91
91
|
], 512), [
|
|
92
|
-
[
|
|
92
|
+
[ce, h.value == "loading"]
|
|
93
93
|
]),
|
|
94
|
-
|
|
95
|
-
var
|
|
94
|
+
h.value == "complete" ? k(L.$slots, "complete", { key: 0 }, () => {
|
|
95
|
+
var f;
|
|
96
96
|
return [
|
|
97
|
-
|
|
97
|
+
v("span", null, A(((f = L.slots) == null ? void 0 : f.complete) || "No more results!"), 1)
|
|
98
98
|
];
|
|
99
|
-
}, !0) :
|
|
100
|
-
|
|
99
|
+
}, !0) : U("", !0),
|
|
100
|
+
h.value == "error" ? k(L.$slots, "error", {
|
|
101
101
|
key: 1,
|
|
102
|
-
retry:
|
|
102
|
+
retry: c.emit
|
|
103
103
|
}, () => {
|
|
104
|
-
var
|
|
104
|
+
var f;
|
|
105
105
|
return [
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
v("span", Pe, [
|
|
107
|
+
v("span", null, A(((f = L.slots) == null ? void 0 : f.error) || "Oops something went wrong!"), 1),
|
|
108
|
+
v("button", {
|
|
109
109
|
class: "retry",
|
|
110
|
-
onClick:
|
|
111
|
-
(...
|
|
110
|
+
onClick: C[0] || (C[0] = //@ts-ignore
|
|
111
|
+
(...b) => c.emit && c.emit(...b))
|
|
112
112
|
}, "retry")
|
|
113
113
|
])
|
|
114
114
|
];
|
|
115
|
-
}, !0) :
|
|
115
|
+
}, !0) : U("", !0)
|
|
116
116
|
], 512));
|
|
117
117
|
}
|
|
118
|
-
}),
|
|
119
|
-
key: 0,
|
|
120
|
-
class: "d-flex align-items-center justify-content-between w-100"
|
|
121
|
-
}, Be = {
|
|
122
|
-
key: 0,
|
|
123
|
-
class: "d-flex align-items-center gap-2"
|
|
124
|
-
}, ze = { class: "d-flex" }, Fe = ["disabled"], He = ["disabled"], Se = { class: "d-flex gap-2" }, Ae = ["onClick", "disabled"], Ue = {
|
|
125
|
-
key: 1,
|
|
126
|
-
class: "m-0 p-0"
|
|
127
|
-
}, Ne = { class: "d-flex" }, Oe = ["disabled"], Ve = ["disabled"], Y = `
|
|
128
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
|
|
129
|
-
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
|
|
130
|
-
class="icon icon-tabler icons-tabler-outline icon-tabler-chevrons-left">
|
|
131
|
-
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
|
132
|
-
<path d="M11 7l-5 5l5 5" />
|
|
133
|
-
<path d="M17 7l-5 5l5 5" />
|
|
134
|
-
</svg>
|
|
135
|
-
`, X = `
|
|
136
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
|
|
137
|
-
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
|
|
138
|
-
class="icon icon-tabler icons-tabler-outline icon-tabler-chevron-left">
|
|
139
|
-
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
|
140
|
-
<path d="M15 6l-6 6l6 6" />
|
|
141
|
-
</svg>
|
|
142
|
-
`, je = /* @__PURE__ */ G({
|
|
143
|
-
__name: "PaginationDatatable",
|
|
144
|
-
props: {
|
|
145
|
-
pagination: {},
|
|
146
|
-
filtering: { type: Boolean, default: !1 }
|
|
147
|
-
},
|
|
148
|
-
emits: ["tradePage"],
|
|
149
|
-
setup(i, { emit: _ }) {
|
|
150
|
-
const t = i, l = _, e = S(() => t.pagination.limit_per_page ? Math.ceil(t.pagination.count / t.pagination.limit_per_page) : 0), y = S(() => t.pagination.current_page + 1 < e.value ? t.pagination.current_page + 1 : null), m = () => {
|
|
151
|
-
t.pagination.current_page++, l("tradePage");
|
|
152
|
-
}, P = (s) => {
|
|
153
|
-
t.pagination.current_page = s - 1, l("tradePage");
|
|
154
|
-
}, p = () => {
|
|
155
|
-
t.pagination.current_page = e.value - 1, l("tradePage");
|
|
156
|
-
}, o = () => {
|
|
157
|
-
t.pagination.current_page = 0, l("tradePage");
|
|
158
|
-
}, M = () => {
|
|
159
|
-
t.pagination.current_page > 0 && (t.pagination.current_page--, l("tradePage"));
|
|
160
|
-
}, D = S(() => {
|
|
161
|
-
if (e.value <= 7)
|
|
162
|
-
return Array.from({ length: e.value }, (u, L) => L + 1);
|
|
163
|
-
const s = t.pagination.current_page + 1, h = e.value, n = /* @__PURE__ */ new Set([
|
|
164
|
-
1,
|
|
165
|
-
2,
|
|
166
|
-
// Sempre mostra as 2 primeiras
|
|
167
|
-
s - 1,
|
|
168
|
-
s,
|
|
169
|
-
s + 1,
|
|
170
|
-
// Mostra a atual e vizinhas
|
|
171
|
-
h - 1,
|
|
172
|
-
h
|
|
173
|
-
// Sempre mostra as 2 últimas
|
|
174
|
-
]), v = [];
|
|
175
|
-
let E = 0;
|
|
176
|
-
return Array.from(n).sort((u, L) => u - L).forEach((u) => {
|
|
177
|
-
u < 1 || u > h || (u > E + 1 && v.push("..."), v.push(u), E = u);
|
|
178
|
-
}), v;
|
|
179
|
-
});
|
|
180
|
-
return (s, h) => t.pagination.count > 0 ? (g(), f("div", Te, [
|
|
181
|
-
c("span", null, " Mostrando de " + F(t.pagination.count !== 0 ? t.pagination.limit_per_page * t.pagination.current_page + 1 : 0) + " até " + F(t.pagination.limit_per_page * (t.pagination.current_page + 1) < t.pagination.count ? t.pagination.limit_per_page * (t.pagination.current_page + 1) : t.pagination.count) + " de " + F(t.pagination.count) + " registros ", 1),
|
|
182
|
-
e.value > 0 ? (g(), f("div", Be, [
|
|
183
|
-
c("div", ze, [
|
|
184
|
-
c("button", {
|
|
185
|
-
class: "btn btn-estilo",
|
|
186
|
-
onClick: A(o, ["prevent"]),
|
|
187
|
-
disabled: t.pagination.current_page === 0,
|
|
188
|
-
innerHTML: Y
|
|
189
|
-
}, null, 8, Fe),
|
|
190
|
-
c("button", {
|
|
191
|
-
class: "btn btn-estilo",
|
|
192
|
-
onClick: A(M, ["prevent"]),
|
|
193
|
-
disabled: t.pagination.current_page === 0,
|
|
194
|
-
innerHTML: X
|
|
195
|
-
}, null, 8, He)
|
|
196
|
-
]),
|
|
197
|
-
c("div", Se, [
|
|
198
|
-
(g(!0), f(C, null, $(D.value, (n, v) => (g(), f(C, { key: v }, [
|
|
199
|
-
typeof n == "number" ? (g(), f("button", {
|
|
200
|
-
key: 0,
|
|
201
|
-
class: U([t.pagination.current_page + 1 == n ? "page-select" : "", "page-estilo"]),
|
|
202
|
-
onClick: A((E) => P(n), ["prevent"]),
|
|
203
|
-
disabled: t.pagination.current_page + 1 == n
|
|
204
|
-
}, F(n), 11, Ae)) : (g(), f("span", Ue, "..."))
|
|
205
|
-
], 64))), 128))
|
|
206
|
-
]),
|
|
207
|
-
c("div", Ne, [
|
|
208
|
-
c("button", {
|
|
209
|
-
onClick: A(m, ["prevent"]),
|
|
210
|
-
class: "btn btn-estilo rotate-180",
|
|
211
|
-
disabled: !y.value,
|
|
212
|
-
innerHTML: X
|
|
213
|
-
}, null, 8, Oe),
|
|
214
|
-
c("button", {
|
|
215
|
-
onClick: A(p, ["prevent"]),
|
|
216
|
-
class: "btn btn-estilo rotate-180",
|
|
217
|
-
disabled: !y.value,
|
|
218
|
-
innerHTML: Y
|
|
219
|
-
}, null, 8, Ve)
|
|
220
|
-
])
|
|
221
|
-
])) : T("", !0)
|
|
222
|
-
])) : T("", !0);
|
|
223
|
-
}
|
|
224
|
-
}), $e = /* @__PURE__ */ Z(je, [["__scopeId", "data-v-df81be49"]]), qe = /* @__PURE__ */ G({
|
|
118
|
+
}), K = /* @__PURE__ */ Y(Be, [["__scopeId", "data-v-4bdee133"]]), Fe = /* @__PURE__ */ Q({
|
|
225
119
|
__name: "VDataPage",
|
|
226
120
|
props: {
|
|
227
121
|
fetch: {},
|
|
@@ -257,8 +151,8 @@ const Me = /* @__PURE__ */ ee(we, [["render", Pe], ["__scopeId", "data-v-d3e3763
|
|
|
257
151
|
watch: { default: () => [] }
|
|
258
152
|
},
|
|
259
153
|
emits: ["tradePage", "beforeFetch", "afterFetch"],
|
|
260
|
-
setup(
|
|
261
|
-
const
|
|
154
|
+
setup(a, { expose: d, emit: u }) {
|
|
155
|
+
const i = u, e = a, I = _(!0), h = _(Date.now()), F = _(Date.now()), s = _([]), o = _([]), S = _(0), z = _(!1), c = _(null), w = _(!1), n = _({
|
|
262
156
|
current_page: e.page_starts_at,
|
|
263
157
|
// pagina atual
|
|
264
158
|
count: 0,
|
|
@@ -269,258 +163,266 @@ const Me = /* @__PURE__ */ ee(we, [["render", Pe], ["__scopeId", "data-v-d3e3763
|
|
|
269
163
|
// termo de busca
|
|
270
164
|
filter: ""
|
|
271
165
|
// filtro selecionado
|
|
272
|
-
}), { data:
|
|
166
|
+
}), { data: L, pending: C, error: f, execute: b, attempt: Se } = e.fetch(e.endpoint, {
|
|
273
167
|
params: () => e.deactivate_default_params ? e.add_params && typeof e.add_params == "function" ? e.add_params() : {
|
|
274
168
|
...e.add_params
|
|
275
169
|
} : e.add_params && typeof e.add_params == "function" ? {
|
|
276
|
-
...
|
|
170
|
+
...H.value,
|
|
277
171
|
...e.add_params()
|
|
278
172
|
} : {
|
|
279
|
-
...
|
|
173
|
+
...H.value,
|
|
280
174
|
...e.add_params
|
|
281
175
|
},
|
|
282
176
|
retry: e.retry_attempts,
|
|
283
177
|
retryDelay: e.retry_delay,
|
|
284
178
|
paramsReactives: !1,
|
|
285
179
|
immediate: !1
|
|
286
|
-
}, e.fetch_name),
|
|
180
|
+
}, e.fetch_name), H = W(() => ({
|
|
287
181
|
[e.page_param_name]: n.value.current_page + 1,
|
|
288
182
|
[e.page_size_param_name]: n.value.limit_per_page,
|
|
289
183
|
[e.search_param_name]: n.value.search || "",
|
|
290
184
|
[e.filter_param_name]: n.value.filter || ""
|
|
291
|
-
})),
|
|
292
|
-
|
|
293
|
-
|
|
185
|
+
})), X = W(() => C.value || z.value);
|
|
186
|
+
P(L, (t) => {
|
|
187
|
+
t ? (s.value = t[e.data_key] || [], S.value = t[e.total_key] || 0, n.value.count = S.value) : (s.value = [], S.value = 0);
|
|
294
188
|
}, { immediate: !0 });
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
189
|
+
function x() {
|
|
190
|
+
n.value.current_page = e.page_starts_at, E();
|
|
191
|
+
}
|
|
192
|
+
async function E() {
|
|
193
|
+
if (c.value && clearTimeout(c.value), z.value = !0, c.value = setTimeout(() => {
|
|
194
|
+
z.value = !1;
|
|
298
195
|
}, e.min_loading_delay), e.type_fetch === "infinite-scroll")
|
|
299
|
-
return
|
|
300
|
-
e.type_fetch === "pagination" && (
|
|
196
|
+
return b();
|
|
197
|
+
e.type_fetch === "pagination" && (i("beforeFetch"), await b(), i("afterFetch"));
|
|
301
198
|
}
|
|
302
199
|
let N = 0;
|
|
303
200
|
async function R() {
|
|
304
201
|
N++;
|
|
305
|
-
const
|
|
306
|
-
|
|
307
|
-
if (
|
|
202
|
+
const t = N;
|
|
203
|
+
s.value = [], o.value = [], n.value.current_page = e.page_starts_at, i("beforeFetch"), await E(), i("afterFetch"), t === N && B(() => {
|
|
204
|
+
if (t !== N)
|
|
308
205
|
return;
|
|
309
|
-
let
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
}), o.value.push(...
|
|
313
|
-
o.value.forEach((
|
|
314
|
-
|
|
206
|
+
let r = crypto.randomUUID();
|
|
207
|
+
s.value.forEach((l) => {
|
|
208
|
+
l.loading = !0, l.idhashInfiniteLoading = r;
|
|
209
|
+
}), o.value.push(...s.value), setTimeout(() => {
|
|
210
|
+
o.value.forEach((l) => {
|
|
211
|
+
l.idhashInfiniteLoading === r && (l.loading = !1, delete l.idhashInfiniteLoading);
|
|
315
212
|
});
|
|
316
|
-
}, e.min_loading_delay),
|
|
213
|
+
}, e.min_loading_delay), w.value = !0, h.value++, F.value++;
|
|
317
214
|
});
|
|
318
215
|
}
|
|
319
|
-
function
|
|
320
|
-
|
|
216
|
+
function Z(t) {
|
|
217
|
+
t > 0 ? (n.value.limit_per_page = t, x()) : console.warn("O limite deve ser um número maior que zero.");
|
|
321
218
|
}
|
|
322
|
-
function
|
|
323
|
-
n.value.search =
|
|
219
|
+
function ee(t) {
|
|
220
|
+
n.value.search = t, x();
|
|
324
221
|
}
|
|
325
|
-
function
|
|
326
|
-
n.value.filter =
|
|
222
|
+
function te(t) {
|
|
223
|
+
n.value.filter = t, x();
|
|
327
224
|
}
|
|
328
|
-
function
|
|
329
|
-
|
|
225
|
+
function ae(t) {
|
|
226
|
+
t >= 0 && t <= Math.ceil(n.value.count / n.value.limit_per_page) ? (n.value.current_page = t, E()) : console.warn("Número de página inválido.");
|
|
330
227
|
}
|
|
331
|
-
|
|
332
|
-
execute:
|
|
333
|
-
pagination:
|
|
334
|
-
set_limit_per_page:
|
|
335
|
-
set_search:
|
|
336
|
-
set_filter:
|
|
337
|
-
set_page:
|
|
338
|
-
|
|
228
|
+
d({
|
|
229
|
+
execute: E,
|
|
230
|
+
pagination: _e(n),
|
|
231
|
+
set_limit_per_page: Z,
|
|
232
|
+
set_search: ee,
|
|
233
|
+
set_filter: te,
|
|
234
|
+
set_page: ae,
|
|
235
|
+
reSearch: x,
|
|
236
|
+
default_params: H
|
|
339
237
|
});
|
|
340
|
-
const
|
|
341
|
-
async function
|
|
342
|
-
if (!
|
|
343
|
-
if (!
|
|
344
|
-
|
|
238
|
+
const G = W(() => L.value?.[e.next_page_response_name] || null);
|
|
239
|
+
async function ne(t) {
|
|
240
|
+
if (!w.value) return;
|
|
241
|
+
if (!G.value) {
|
|
242
|
+
t.complete();
|
|
345
243
|
return;
|
|
346
244
|
}
|
|
347
|
-
if (n.value.current_page += 1, await
|
|
348
|
-
|
|
245
|
+
if (n.value.current_page += 1, await b(), f.value) {
|
|
246
|
+
t.error();
|
|
349
247
|
return;
|
|
350
248
|
}
|
|
351
|
-
if (!
|
|
352
|
-
|
|
249
|
+
if (!s.value || s.value.length === 0) {
|
|
250
|
+
t.complete();
|
|
353
251
|
return;
|
|
354
252
|
}
|
|
355
|
-
const
|
|
356
|
-
(
|
|
253
|
+
const r = s.value.filter(
|
|
254
|
+
(p) => !o.value.some((O) => O[e.item_key] === p[e.item_key])
|
|
357
255
|
);
|
|
358
|
-
if (
|
|
359
|
-
|
|
256
|
+
if (r.length === 0 && s.value.length > 0) {
|
|
257
|
+
t.loaded();
|
|
360
258
|
return;
|
|
361
259
|
}
|
|
362
|
-
const
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
}), o.value.push(...
|
|
366
|
-
o.value.forEach((
|
|
367
|
-
|
|
260
|
+
const l = crypto.randomUUID();
|
|
261
|
+
r.forEach((p) => {
|
|
262
|
+
p.loading = !0, p.idhashInfiniteLoading = l;
|
|
263
|
+
}), o.value.push(...r), setTimeout(() => {
|
|
264
|
+
o.value.forEach((p) => {
|
|
265
|
+
p.idhashInfiniteLoading === l && (p.loading = !1, delete p.idhashInfiniteLoading);
|
|
368
266
|
});
|
|
369
|
-
}, e.min_loading_delay),
|
|
370
|
-
o.value && o.value.length > n.value.limit_per_page * 2 && o.value.splice(0, n.value.limit_per_page),
|
|
267
|
+
}, e.min_loading_delay), B(() => {
|
|
268
|
+
o.value && o.value.length > n.value.limit_per_page * 2 && o.value.splice(0, n.value.limit_per_page), G.value ? t.loaded() : t.complete(), F.value++;
|
|
371
269
|
});
|
|
372
270
|
}
|
|
373
|
-
async function
|
|
374
|
-
if (!
|
|
271
|
+
async function ie(t) {
|
|
272
|
+
if (!w.value) return;
|
|
375
273
|
if (n.value.current_page <= e.page_starts_at) {
|
|
376
|
-
|
|
274
|
+
t.complete();
|
|
377
275
|
return;
|
|
378
276
|
}
|
|
379
|
-
const
|
|
380
|
-
if (!
|
|
381
|
-
const
|
|
382
|
-
if (!
|
|
383
|
-
|
|
277
|
+
const r = o.value[0];
|
|
278
|
+
if (!r) return;
|
|
279
|
+
const l = r[e.item_key];
|
|
280
|
+
if (!l) {
|
|
281
|
+
t.error();
|
|
384
282
|
return;
|
|
385
283
|
}
|
|
386
|
-
if (n.value.current_page -= 1, await
|
|
387
|
-
|
|
284
|
+
if (n.value.current_page -= 1, await b(), f.value) {
|
|
285
|
+
t.error();
|
|
388
286
|
return;
|
|
389
287
|
}
|
|
390
|
-
if (!
|
|
391
|
-
|
|
288
|
+
if (!s.value || s.value.length === 0) {
|
|
289
|
+
t.loaded();
|
|
392
290
|
return;
|
|
393
291
|
}
|
|
394
|
-
const
|
|
395
|
-
(
|
|
396
|
-
),
|
|
397
|
-
if (
|
|
398
|
-
|
|
399
|
-
}),
|
|
400
|
-
|
|
292
|
+
const p = s.value.filter(
|
|
293
|
+
(y) => !o.value.some((re) => re[e.item_key] === y[e.item_key])
|
|
294
|
+
), O = crypto.randomUUID();
|
|
295
|
+
if (p.forEach((y) => {
|
|
296
|
+
y.loading = !0, y.idhashInfiniteLoading = O;
|
|
297
|
+
}), p.length === 0 && s.value.length > 0) {
|
|
298
|
+
t.loaded();
|
|
401
299
|
return;
|
|
402
300
|
}
|
|
403
|
-
o.value.unshift(...
|
|
404
|
-
o.value.forEach((
|
|
405
|
-
|
|
301
|
+
o.value.unshift(...p), o.value && o.value.length > n.value.limit_per_page * 2 && o.value.splice(-n.value.limit_per_page, n.value.limit_per_page), setTimeout(() => {
|
|
302
|
+
o.value.forEach((y) => {
|
|
303
|
+
y.idhashInfiniteLoading === O && (y.loading = !1, delete y.idhashInfiniteLoading);
|
|
406
304
|
});
|
|
407
|
-
}, e.min_loading_delay),
|
|
408
|
-
const
|
|
409
|
-
|
|
305
|
+
}, e.min_loading_delay), B(() => {
|
|
306
|
+
const y = document.getElementById(e.element_id + l);
|
|
307
|
+
y ? y.scrollIntoView({ behavior: "auto", block: "start" }) : console.warn(`
|
|
410
308
|
Elemento não encontrado para scroll verifique se a propriedade 'element_id' está correta ou não foi definida.
|
|
411
|
-
`),
|
|
309
|
+
`), h.value++, t.loaded();
|
|
412
310
|
});
|
|
413
311
|
}
|
|
414
|
-
const
|
|
415
|
-
e.watch && Array.isArray(e.watch) && e.watch.forEach((
|
|
416
|
-
(
|
|
417
|
-
}),
|
|
418
|
-
|
|
419
|
-
}),
|
|
420
|
-
|
|
421
|
-
}, { deep: !0 }) : e.type_fetch === "infinite-scroll" &&
|
|
422
|
-
|
|
312
|
+
const V = [];
|
|
313
|
+
e.watch && Array.isArray(e.watch) && e.watch.forEach((t) => {
|
|
314
|
+
(ge(t) || typeof t == "function") && V.push(t);
|
|
315
|
+
}), P(() => n.value.current_page, () => {
|
|
316
|
+
i("tradePage");
|
|
317
|
+
}), V.length > 0 && (e.type_fetch === "pagination" ? P(V, () => {
|
|
318
|
+
x();
|
|
319
|
+
}, { deep: !0 }) : e.type_fetch === "infinite-scroll" && P(V, () => {
|
|
320
|
+
w.value = !1, R();
|
|
423
321
|
}, { deep: !0 }));
|
|
424
|
-
function
|
|
425
|
-
|
|
322
|
+
function le() {
|
|
323
|
+
i("tradePage"), E();
|
|
426
324
|
}
|
|
427
|
-
return
|
|
325
|
+
return P(
|
|
428
326
|
() => e.add_params,
|
|
429
327
|
() => {
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
}) : e.type_fetch === "pagination" ? (
|
|
328
|
+
I.value ? B(() => {
|
|
329
|
+
I.value && e.type_fetch === "infinite-scroll" ? (R(), I.value = !1) : I.value && e.type_fetch === "pagination" && (E(), I.value = !1);
|
|
330
|
+
}) : e.type_fetch === "pagination" ? x() : e.type_fetch === "infinite-scroll" && (w.value = !1, R());
|
|
433
331
|
},
|
|
434
332
|
{ deep: !0, immediate: !0 }
|
|
435
|
-
), (
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
n
|
|
444
|
-
|
|
445
|
-
|
|
333
|
+
), (t, r) => (m(), g(D, null, [
|
|
334
|
+
me(A(e.limit_per_page) + " " + A(n.value.limit_per_page) + " ", 1),
|
|
335
|
+
v("div", null, [
|
|
336
|
+
a.type_fetch === "pagination" ? (m(), g(D, { key: 0 }, [
|
|
337
|
+
X.value ? (m(), g("div", {
|
|
338
|
+
key: 0,
|
|
339
|
+
class: M(e.class_loading_container)
|
|
340
|
+
}, [
|
|
341
|
+
(m(!0), g(D, null, $(n.value.limit_per_page, (l) => k(t.$slots, "loading", {
|
|
342
|
+
key: "placeholder-" + l,
|
|
343
|
+
n: l
|
|
344
|
+
}, void 0, !0)), 128))
|
|
345
|
+
], 2)) : T(f) ? k(t.$slots, "error", {
|
|
346
|
+
key: 1,
|
|
347
|
+
error: T(f)
|
|
348
|
+
}, () => [
|
|
349
|
+
r[0] || (r[0] = v("div", {
|
|
350
|
+
class: "alert alert-danger",
|
|
351
|
+
role: "alert"
|
|
352
|
+
}, " Ocorreu um erro ao carregar os dados. ", -1))
|
|
353
|
+
], !0) : n.value.count === 0 ? k(t.$slots, "empty", { key: 2 }, () => [
|
|
354
|
+
r[1] || (r[1] = v("div", {
|
|
355
|
+
class: "alert alert-info",
|
|
356
|
+
role: "alert"
|
|
357
|
+
}, " Nenhum registro encontrado. ", -1))
|
|
358
|
+
], !0) : (m(), g("div", {
|
|
359
|
+
key: 3,
|
|
360
|
+
class: M(e.class_container)
|
|
361
|
+
}, [
|
|
362
|
+
(m(!0), g(D, null, $(s.value, (l) => k(t.$slots, "body", {
|
|
363
|
+
key: l[e.item_key],
|
|
364
|
+
item: l
|
|
365
|
+
}, void 0, !0)), 128))
|
|
366
|
+
], 2))
|
|
367
|
+
], 64)) : a.type_fetch === "infinite-scroll" ? (m(), g("div", {
|
|
446
368
|
key: 1,
|
|
447
|
-
|
|
448
|
-
}, () => [
|
|
449
|
-
d[0] || (d[0] = c("div", {
|
|
450
|
-
class: "alert alert-danger",
|
|
451
|
-
role: "alert"
|
|
452
|
-
}, " Ocorreu um erro ao carregar os dados. ", -1))
|
|
453
|
-
], !0) : n.value.count === 0 ? x(a.$slots, "empty", { key: 2 }, () => [
|
|
454
|
-
d[1] || (d[1] = c("div", {
|
|
455
|
-
class: "alert alert-info",
|
|
456
|
-
role: "alert"
|
|
457
|
-
}, " Nenhum registro encontrado. ", -1))
|
|
458
|
-
], !0) : (g(), f("div", {
|
|
459
|
-
key: 3,
|
|
460
|
-
class: U(e.class_container)
|
|
461
|
-
}, [
|
|
462
|
-
(g(!0), f(C, null, $(p.value, (r) => x(a.$slots, "body", {
|
|
463
|
-
key: r[e.item_key],
|
|
464
|
-
item: r
|
|
465
|
-
}, void 0, !0)), 128))
|
|
466
|
-
], 2))
|
|
467
|
-
], 64)) : i.type_fetch === "infinite-scroll" ? (g(), f("div", {
|
|
468
|
-
key: 1,
|
|
469
|
-
class: U(e.class_container)
|
|
470
|
-
}, [
|
|
471
|
-
j(B(Q), {
|
|
472
|
-
identifier: P.value,
|
|
473
|
-
direction: "top",
|
|
474
|
-
onInfinite: oe
|
|
475
|
-
}, {
|
|
476
|
-
complete: W(() => [...d[2] || (d[2] = [
|
|
477
|
-
c("span", null, null, -1)
|
|
478
|
-
])]),
|
|
479
|
-
spinner: W(() => [...d[3] || (d[3] = [
|
|
480
|
-
c("span", null, null, -1)
|
|
481
|
-
])]),
|
|
482
|
-
_: 1
|
|
483
|
-
}, 8, ["identifier"]),
|
|
484
|
-
(g(!0), f(C, null, $(o.value, (r) => (g(), f(C, {
|
|
485
|
-
key: r[e.item_key]
|
|
369
|
+
class: M(e.class_container)
|
|
486
370
|
}, [
|
|
487
|
-
|
|
371
|
+
q(T(K), {
|
|
372
|
+
identifier: F.value,
|
|
373
|
+
direction: "top",
|
|
374
|
+
onInfinite: ie
|
|
375
|
+
}, {
|
|
376
|
+
complete: j(() => [...r[2] || (r[2] = [
|
|
377
|
+
v("span", null, null, -1)
|
|
378
|
+
])]),
|
|
379
|
+
spinner: j(() => [...r[3] || (r[3] = [
|
|
380
|
+
v("span", null, null, -1)
|
|
381
|
+
])]),
|
|
382
|
+
_: 1
|
|
383
|
+
}, 8, ["identifier"]),
|
|
384
|
+
(m(!0), g(D, null, $(o.value, (l) => (m(), g(D, {
|
|
385
|
+
key: l[e.item_key]
|
|
386
|
+
}, [
|
|
387
|
+
l.loading ? k(t.$slots, "loading", { key: 1 }, void 0, !0) : k(t.$slots, "body", {
|
|
388
|
+
key: 0,
|
|
389
|
+
item: l
|
|
390
|
+
}, void 0, !0)
|
|
391
|
+
], 64))), 128)),
|
|
392
|
+
q(T(K), {
|
|
393
|
+
identifier: h.value,
|
|
394
|
+
onInfinite: ne
|
|
395
|
+
}, {
|
|
396
|
+
complete: j(() => [
|
|
397
|
+
k(t.$slots, "scroll-finish", {}, () => [
|
|
398
|
+
r[4] || (r[4] = v("span", { class: "scroll-finish-style" }, " Fim dos registros", -1))
|
|
399
|
+
], !0)
|
|
400
|
+
]),
|
|
401
|
+
_: 3
|
|
402
|
+
}, 8, ["identifier"])
|
|
403
|
+
], 2)) : U("", !0),
|
|
404
|
+
a.type_fetch === "pagination" ? k(t.$slots, "pagination", {
|
|
405
|
+
key: 2,
|
|
406
|
+
pagination: n.value,
|
|
407
|
+
tradePage: E,
|
|
408
|
+
error: T(f)
|
|
409
|
+
}, () => [
|
|
410
|
+
!T(f) && n.value.count > 0 ? (m(), g("div", {
|
|
488
411
|
key: 0,
|
|
489
|
-
|
|
490
|
-
},
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
_: 3
|
|
502
|
-
}, 8, ["identifier"])
|
|
503
|
-
], 2)) : T("", !0),
|
|
504
|
-
i.type_fetch === "pagination" ? x(a.$slots, "pagination", {
|
|
505
|
-
key: 2,
|
|
506
|
-
pagination: n.value,
|
|
507
|
-
tradePage: w,
|
|
508
|
-
error: B(u)
|
|
509
|
-
}, () => [
|
|
510
|
-
!B(u) && n.value.count > 0 ? (g(), f("div", {
|
|
511
|
-
key: 0,
|
|
512
|
-
class: U(["px-3", e.class_pagination])
|
|
513
|
-
}, [
|
|
514
|
-
j($e, {
|
|
515
|
-
filtering: !0,
|
|
516
|
-
pagination: n.value,
|
|
517
|
-
onTradePage: se
|
|
518
|
-
}, null, 8, ["pagination"])
|
|
519
|
-
], 2)) : T("", !0)
|
|
520
|
-
], !0) : T("", !0)
|
|
521
|
-
]));
|
|
412
|
+
class: M(["px-3", e.class_pagination])
|
|
413
|
+
}, [
|
|
414
|
+
q(ve, {
|
|
415
|
+
filtering: !0,
|
|
416
|
+
page_starts_at: e.page_starts_at,
|
|
417
|
+
pagination: n.value,
|
|
418
|
+
onTradePage: le
|
|
419
|
+
}, null, 8, ["page_starts_at", "pagination"])
|
|
420
|
+
], 2)) : U("", !0)
|
|
421
|
+
], !0) : U("", !0)
|
|
422
|
+
])
|
|
423
|
+
], 64));
|
|
522
424
|
}
|
|
523
|
-
}),
|
|
425
|
+
}), Ce = /* @__PURE__ */ he(Fe, [["__scopeId", "data-v-48421ad6"]]);
|
|
524
426
|
export {
|
|
525
|
-
|
|
427
|
+
Ce as VDataPage
|
|
526
428
|
};
|