v-sistec-features 1.2.0 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/v-sistec-features.css +1 -1
- package/dist/vDataTable.js +259 -258
- package/package.json +1 -1
- package/src/DatatableVue/components/VDataTable.vue +13 -13
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
* Copyright 2018-2025 The Tabler Authors
|
|
9
9
|
* Copyright 2018-2025 codecalm.net Paweł Kuna
|
|
10
10
|
* Licensed under MIT (https://github.com/tabler/tabler/blob/master/LICENSE)
|
|
11
|
-
*/[data-bs-theme-base=slate]{--tblr-gray-50:#f8fafc;--tblr-gray-100:#f1f5f9;--tblr-gray-200:#e2e8f0;--tblr-gray-300:#cbd5e1;--tblr-gray-400:#94a3b8;--tblr-gray-500:#64748b;--tblr-gray-600:#475569;--tblr-gray-700:#334155;--tblr-gray-800:#1e293b;--tblr-gray-900:#0f172a;--tblr-gray-950:#020617}[data-bs-theme-base=gray]{--tblr-gray-50:#f9fafb;--tblr-gray-100:#f3f4f6;--tblr-gray-200:#e5e7eb;--tblr-gray-300:#d1d5db;--tblr-gray-400:#9ca3af;--tblr-gray-500:#6b7280;--tblr-gray-600:#4b5563;--tblr-gray-700:#374151;--tblr-gray-800:#1f2937;--tblr-gray-900:#111827;--tblr-gray-950:#030712}[data-bs-theme-base=zinc]{--tblr-gray-50:#fafafa;--tblr-gray-100:#f4f4f5;--tblr-gray-200:#e4e4e7;--tblr-gray-300:#d4d4d8;--tblr-gray-400:#a1a1aa;--tblr-gray-500:#71717a;--tblr-gray-600:#52525b;--tblr-gray-700:#3f3f46;--tblr-gray-800:#27272a;--tblr-gray-900:#18181b;--tblr-gray-950:#09090b}[data-bs-theme-base=neutral]{--tblr-gray-50:#fafafa;--tblr-gray-100:#f5f5f5;--tblr-gray-200:#e5e5e5;--tblr-gray-300:#d4d4d4;--tblr-gray-400:#a3a3a3;--tblr-gray-500:#737373;--tblr-gray-600:#525252;--tblr-gray-700:#404040;--tblr-gray-800:#262626;--tblr-gray-900:#171717;--tblr-gray-950:#0a0a0a}[data-bs-theme-base=stone]{--tblr-gray-50:#fafaf9;--tblr-gray-100:#f5f5f4;--tblr-gray-200:#e7e5e4;--tblr-gray-300:#d6d3d1;--tblr-gray-400:#a8a29e;--tblr-gray-500:#78716c;--tblr-gray-600:#57534e;--tblr-gray-700:#44403c;--tblr-gray-800:#292524;--tblr-gray-900:#1c1917;--tblr-gray-950:#0c0a09}[data-bs-theme-base=pink]{--tblr-gray-50:#fdf2f8;--tblr-gray-100:#fce7f3;--tblr-gray-200:#fbcfe8;--tblr-gray-300:#f9a8d4;--tblr-gray-400:#f472b6;--tblr-gray-500:#ec4899;--tblr-gray-600:#db2777;--tblr-gray-700:#be185d;--tblr-gray-800:#9d174d;--tblr-gray-900:#831843;--tblr-gray-950:#500724}[data-bs-theme-primary=blue]{--tblr-primary:#066fd1;--tblr-primary-rgb:6,111,209}[data-bs-theme-primary=azure]{--tblr-primary:#4299e1;--tblr-primary-rgb:66,153,225}[data-bs-theme-primary=indigo]{--tblr-primary:#4263eb;--tblr-primary-rgb:66,99,235}[data-bs-theme-primary=purple]{--tblr-primary:#ae3ec9;--tblr-primary-rgb:174,62,201}[data-bs-theme-primary=pink]{--tblr-primary:#d6336c;--tblr-primary-rgb:214,51,108}[data-bs-theme-primary=red]{--tblr-primary:#d63939;--tblr-primary-rgb:214,57,57}[data-bs-theme-primary=orange]{--tblr-primary:#f76707;--tblr-primary-rgb:247,103,7}[data-bs-theme-primary=yellow]{--tblr-primary:#f59f00;--tblr-primary-rgb:245,159,0}[data-bs-theme-primary=lime]{--tblr-primary:#74b816;--tblr-primary-rgb:116,184,22}[data-bs-theme-primary=green]{--tblr-primary:#2fb344;--tblr-primary-rgb:47,179,68}[data-bs-theme-primary=teal]{--tblr-primary:#0ca678;--tblr-primary-rgb:12,166,120}[data-bs-theme-primary=cyan]{--tblr-primary:#17a2b8;--tblr-primary-rgb:23,162,184}[data-bs-theme-radius="0"]{--tblr-border-radius-scale:0}[data-bs-theme-radius="0.5"]{--tblr-border-radius-scale:.5}[data-bs-theme-radius="1"]{--tblr-border-radius-scale:1}[data-bs-theme-radius="1.5"]{--tblr-border-radius-scale:1.5}[data-bs-theme-radius="2"]{--tblr-border-radius-scale:2}[data-bs-theme-primary=inverted]{--tblr-primary:var(--tblr-gray-800);--tblr-primary-fg:var(--tblr-light);--tblr-primary-rgb:31,41,55}[data-bs-theme-primary=inverted] [data-bs-theme=dark],[data-bs-theme-primary=inverted][data-bs-theme=dark]{--tblr-primary:#f9fafb;--tblr-primary-fg:var(--tblr-dark);--tblr-primary-rgb:249,250,251}[data-bs-theme-font=monospace]{--tblr-body-font-family:var(--tblr-font-monospace);--tblr-body-font-size:80%}[data-bs-theme-font=sans-serif]{--tblr-body-font-family:var(--tblr-font-sans-serif)}[data-bs-theme-font=serif]{--tblr-body-font-family:var(--tblr-font-serif)}[data-bs-theme-font=comic]{--tblr-body-font-family:var(--tblr-font-comic)}.rotate-180[data-v-c189f089] svg{transform:rotate(180deg)}.page-select[data-v-c189f089]{background-color:var(--tblr-primary)!important;color:#fff!important;border:none!important}.page-estilo[data-v-c189f089]{border:none;--cor-escurecida: color-mix(in srgb, var(--tblr-primary), #000 25%);background:transparent;padding:1px 10px;border-radius:7px;margin:0!important;transition:color .15s ease-in-out,background-color .15s ease-in-out}.page-estilo[data-v-c189f089]:hover{background:var(--cor-escurecida);color:#fff}.btn[data-v-c189f089]{padding:0!important;margin:0!important;background:transparent!important;border:none!important;box-shadow:none!important}[data-v-c189f089] .btn-estilo svg{padding:0!important;margin:0!important}[data-v-c189f089] .btn-estilo:hover svg{stroke:var(--tblr-primary)}.icon-tabler[data-v-c189f089]{margin:0!important;padding:0!important}.inputClose[data-v-1b6ff54b]{color:var(--tblr-icon-color);z-index:10;position:absolute;top:50%;right:0;transform:translateY(-50%);font-size:1.2em;min-width:2.5rem;display:flex;justify-content:center}.inputClose[data-v-1b6ff54b]:hover{cursor:pointer}.selected[data-v-1b6ff54b]:hover{background-color:#b02a2a!important;color:#fff!important}.table-responsive[data-v-
|
|
11
|
+
*/[data-bs-theme-base=slate]{--tblr-gray-50:#f8fafc;--tblr-gray-100:#f1f5f9;--tblr-gray-200:#e2e8f0;--tblr-gray-300:#cbd5e1;--tblr-gray-400:#94a3b8;--tblr-gray-500:#64748b;--tblr-gray-600:#475569;--tblr-gray-700:#334155;--tblr-gray-800:#1e293b;--tblr-gray-900:#0f172a;--tblr-gray-950:#020617}[data-bs-theme-base=gray]{--tblr-gray-50:#f9fafb;--tblr-gray-100:#f3f4f6;--tblr-gray-200:#e5e7eb;--tblr-gray-300:#d1d5db;--tblr-gray-400:#9ca3af;--tblr-gray-500:#6b7280;--tblr-gray-600:#4b5563;--tblr-gray-700:#374151;--tblr-gray-800:#1f2937;--tblr-gray-900:#111827;--tblr-gray-950:#030712}[data-bs-theme-base=zinc]{--tblr-gray-50:#fafafa;--tblr-gray-100:#f4f4f5;--tblr-gray-200:#e4e4e7;--tblr-gray-300:#d4d4d8;--tblr-gray-400:#a1a1aa;--tblr-gray-500:#71717a;--tblr-gray-600:#52525b;--tblr-gray-700:#3f3f46;--tblr-gray-800:#27272a;--tblr-gray-900:#18181b;--tblr-gray-950:#09090b}[data-bs-theme-base=neutral]{--tblr-gray-50:#fafafa;--tblr-gray-100:#f5f5f5;--tblr-gray-200:#e5e5e5;--tblr-gray-300:#d4d4d4;--tblr-gray-400:#a3a3a3;--tblr-gray-500:#737373;--tblr-gray-600:#525252;--tblr-gray-700:#404040;--tblr-gray-800:#262626;--tblr-gray-900:#171717;--tblr-gray-950:#0a0a0a}[data-bs-theme-base=stone]{--tblr-gray-50:#fafaf9;--tblr-gray-100:#f5f5f4;--tblr-gray-200:#e7e5e4;--tblr-gray-300:#d6d3d1;--tblr-gray-400:#a8a29e;--tblr-gray-500:#78716c;--tblr-gray-600:#57534e;--tblr-gray-700:#44403c;--tblr-gray-800:#292524;--tblr-gray-900:#1c1917;--tblr-gray-950:#0c0a09}[data-bs-theme-base=pink]{--tblr-gray-50:#fdf2f8;--tblr-gray-100:#fce7f3;--tblr-gray-200:#fbcfe8;--tblr-gray-300:#f9a8d4;--tblr-gray-400:#f472b6;--tblr-gray-500:#ec4899;--tblr-gray-600:#db2777;--tblr-gray-700:#be185d;--tblr-gray-800:#9d174d;--tblr-gray-900:#831843;--tblr-gray-950:#500724}[data-bs-theme-primary=blue]{--tblr-primary:#066fd1;--tblr-primary-rgb:6,111,209}[data-bs-theme-primary=azure]{--tblr-primary:#4299e1;--tblr-primary-rgb:66,153,225}[data-bs-theme-primary=indigo]{--tblr-primary:#4263eb;--tblr-primary-rgb:66,99,235}[data-bs-theme-primary=purple]{--tblr-primary:#ae3ec9;--tblr-primary-rgb:174,62,201}[data-bs-theme-primary=pink]{--tblr-primary:#d6336c;--tblr-primary-rgb:214,51,108}[data-bs-theme-primary=red]{--tblr-primary:#d63939;--tblr-primary-rgb:214,57,57}[data-bs-theme-primary=orange]{--tblr-primary:#f76707;--tblr-primary-rgb:247,103,7}[data-bs-theme-primary=yellow]{--tblr-primary:#f59f00;--tblr-primary-rgb:245,159,0}[data-bs-theme-primary=lime]{--tblr-primary:#74b816;--tblr-primary-rgb:116,184,22}[data-bs-theme-primary=green]{--tblr-primary:#2fb344;--tblr-primary-rgb:47,179,68}[data-bs-theme-primary=teal]{--tblr-primary:#0ca678;--tblr-primary-rgb:12,166,120}[data-bs-theme-primary=cyan]{--tblr-primary:#17a2b8;--tblr-primary-rgb:23,162,184}[data-bs-theme-radius="0"]{--tblr-border-radius-scale:0}[data-bs-theme-radius="0.5"]{--tblr-border-radius-scale:.5}[data-bs-theme-radius="1"]{--tblr-border-radius-scale:1}[data-bs-theme-radius="1.5"]{--tblr-border-radius-scale:1.5}[data-bs-theme-radius="2"]{--tblr-border-radius-scale:2}[data-bs-theme-primary=inverted]{--tblr-primary:var(--tblr-gray-800);--tblr-primary-fg:var(--tblr-light);--tblr-primary-rgb:31,41,55}[data-bs-theme-primary=inverted] [data-bs-theme=dark],[data-bs-theme-primary=inverted][data-bs-theme=dark]{--tblr-primary:#f9fafb;--tblr-primary-fg:var(--tblr-dark);--tblr-primary-rgb:249,250,251}[data-bs-theme-font=monospace]{--tblr-body-font-family:var(--tblr-font-monospace);--tblr-body-font-size:80%}[data-bs-theme-font=sans-serif]{--tblr-body-font-family:var(--tblr-font-sans-serif)}[data-bs-theme-font=serif]{--tblr-body-font-family:var(--tblr-font-serif)}[data-bs-theme-font=comic]{--tblr-body-font-family:var(--tblr-font-comic)}.rotate-180[data-v-c189f089] svg{transform:rotate(180deg)}.page-select[data-v-c189f089]{background-color:var(--tblr-primary)!important;color:#fff!important;border:none!important}.page-estilo[data-v-c189f089]{border:none;--cor-escurecida: color-mix(in srgb, var(--tblr-primary), #000 25%);background:transparent;padding:1px 10px;border-radius:7px;margin:0!important;transition:color .15s ease-in-out,background-color .15s ease-in-out}.page-estilo[data-v-c189f089]:hover{background:var(--cor-escurecida);color:#fff}.btn[data-v-c189f089]{padding:0!important;margin:0!important;background:transparent!important;border:none!important;box-shadow:none!important}[data-v-c189f089] .btn-estilo svg{padding:0!important;margin:0!important}[data-v-c189f089] .btn-estilo:hover svg{stroke:var(--tblr-primary)}.icon-tabler[data-v-c189f089]{margin:0!important;padding:0!important}.inputClose[data-v-1b6ff54b]{color:var(--tblr-icon-color);z-index:10;position:absolute;top:50%;right:0;transform:translateY(-50%);font-size:1.2em;min-width:2.5rem;display:flex;justify-content:center}.inputClose[data-v-1b6ff54b]:hover{cursor:pointer}.selected[data-v-1b6ff54b]:hover{background-color:#b02a2a!important;color:#fff!important}.table-responsive[data-v-4000deb4]{overflow-x:auto}.state-feedback[data-v-4000deb4]{padding:1rem;text-align:center}.state-feedback.error[data-v-4000deb4]{color:red}.pagination-controls[data-v-4000deb4]{margin-top:1rem;display:flex;justify-content:space-between}.placeholder-img[data-v-4000deb4]{width:40px;height:40px;border-radius:4px}.container-img[data-v-4000deb4]{aspect-ratio:1;display:flex;justify-content:center;overflow:hidden;position:relative;max-width:40px;min-width:40px}.container-img .img-tamanho-cover[data-v-4000deb4]{position:absolute;top:0;width:100%;height:100%;object-fit:cover;z-index:0;opacity:.5;filter:blur(4px)}.container-img .img-tamanho[data-v-4000deb4]{object-fit:contain;width:100%;height:100%;z-index:2}.container-img.container-img-preview[data-v-4000deb4]{cursor:pointer}.container-img.container-img-preview[data-v-4000deb4]:hover{border-style:dashed;border-color:var(--tblr-primary);border-width:2px;transition:border-width .15s ease-in-out}.container-img.container-img-preview:hover .img-tamanho[data-v-4000deb4]{opacity:.3}.erro-custom-container[data-v-4000deb4]{display:inline-block;padding:.2em .6em;border-radius:4px;background-color:#fff;font-weight:700;text-transform:uppercase}.erro-custom-text[data-v-4000deb4]{font-size:.8em;text-transform:uppercase;font-weight:700}.bg-img[data-v-4000deb4]{background-color:#0000004d;position:absolute;top:0;width:100%;height:100%;z-index:1}.image-preview-container[data-v-4000deb4]{position:fixed;z-index:9999;background-color:#fff;border-radius:8px;box-shadow:0 4px 12px #0003;padding:5px;pointer-events:none;transition:opacity .2s ease-in-out}.image-preview-container .image-preview-large[data-v-4000deb4]{display:block;max-width:250px;max-height:250px;border-radius:4px}.form-check-input[data-v-4000deb4]{border-width:1px!important;border-color:#00000064!important;width:17px;height:17px}[data-bs-theme=dark] .form-check-input[data-v-4000deb4]{border-color:#ffffff5f!important}
|
package/dist/vDataTable.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as F, useSlots as
|
|
2
|
-
const se = Symbol("v-datatable-key"),
|
|
1
|
+
import { defineComponent as F, useSlots as me, inject as fe, onMounted as te, computed as z, createElementBlock as a, createCommentVNode as b, openBlock as n, createElementVNode as s, toDisplayString as g, withModifiers as j, Fragment as M, renderList as T, normalizeClass as m, watch as q, resolveComponent as ge, withDirectives as ne, withKeys as ve, vModelText as ae, createBlock as X, withCtx as he, createTextVNode as A, ref as P, provide as ye, nextTick as ke, renderSlot as O, createVNode as Q, resolveDynamicComponent as Z, unref as w, mergeProps as be, normalizeStyle as xe } from "vue";
|
|
2
|
+
const se = Symbol("v-datatable-key"), zt = /* @__PURE__ */ F({
|
|
3
3
|
__name: "VColumn",
|
|
4
4
|
props: {
|
|
5
5
|
field: { default: null },
|
|
@@ -15,16 +15,16 @@ const se = Symbol("v-datatable-key"), Nt = /* @__PURE__ */ F({
|
|
|
15
15
|
click: { type: [Function, null], default: null }
|
|
16
16
|
},
|
|
17
17
|
setup(y) {
|
|
18
|
-
const u = y, o =
|
|
18
|
+
const u = y, o = me(), f = fe(se);
|
|
19
19
|
if (!f)
|
|
20
20
|
throw new Error("VColumn deve ser usado dentro de um VDataTable.");
|
|
21
|
-
const
|
|
21
|
+
const v = ["text", "img", "date", "html"];
|
|
22
22
|
return te(() => {
|
|
23
23
|
if (u.field !== null && !u.field)
|
|
24
24
|
throw new Error('A propriedade "field" é obrigatória em VColumn.');
|
|
25
25
|
if (!u.header)
|
|
26
26
|
throw new Error('A propriedade "header" é obrigatória em VColumn.');
|
|
27
|
-
if (u.field !== null && !
|
|
27
|
+
if (u.field !== null && !v.includes(u.type))
|
|
28
28
|
throw new Error(`O tipo "${u.type}" não é suportado em VColumn. Tipos suportados: text, img, date, html.`);
|
|
29
29
|
if (u.limite_text) {
|
|
30
30
|
if (u.type !== "text")
|
|
@@ -48,18 +48,18 @@ const se = Symbol("v-datatable-key"), Nt = /* @__PURE__ */ F({
|
|
|
48
48
|
...u.type === "img" && { deactivate_img_preview: u.deactivate_img_preview },
|
|
49
49
|
...u.type === "date" && { format: u.format }
|
|
50
50
|
});
|
|
51
|
-
}), (C,
|
|
51
|
+
}), (C, D) => null;
|
|
52
52
|
}
|
|
53
|
-
}),
|
|
53
|
+
}), we = {
|
|
54
54
|
key: 0,
|
|
55
55
|
class: "d-flex align-items-center justify-content-between w-100"
|
|
56
|
-
},
|
|
56
|
+
}, Ce = {
|
|
57
57
|
key: 0,
|
|
58
58
|
class: "d-flex align-items-center p-2 gap-2"
|
|
59
|
-
},
|
|
59
|
+
}, $e = { class: "d-flex" }, Se = ["disabled"], Me = ["disabled"], Pe = { class: "d-flex gap-2" }, Te = ["onClick", "disabled"], ze = {
|
|
60
60
|
key: 1,
|
|
61
61
|
class: "m-0 p-0"
|
|
62
|
-
},
|
|
62
|
+
}, Ne = { class: "d-flex" }, Ae = ["disabled"], De = ["disabled"], R = `
|
|
63
63
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
|
|
64
64
|
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
|
|
65
65
|
class="icon icon-tabler icons-tabler-outline icon-tabler-chevrons-left">
|
|
@@ -74,7 +74,7 @@ const se = Symbol("v-datatable-key"), Nt = /* @__PURE__ */ F({
|
|
|
74
74
|
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
|
75
75
|
<path d="M15 6l-6 6l6 6" />
|
|
76
76
|
</svg>
|
|
77
|
-
`,
|
|
77
|
+
`, Ee = /* @__PURE__ */ F({
|
|
78
78
|
__name: "PaginationDatatable",
|
|
79
79
|
props: {
|
|
80
80
|
pagination: {},
|
|
@@ -82,98 +82,98 @@ const se = Symbol("v-datatable-key"), Nt = /* @__PURE__ */ F({
|
|
|
82
82
|
},
|
|
83
83
|
emits: ["tradePage"],
|
|
84
84
|
setup(y, { emit: u }) {
|
|
85
|
-
const o = y, f = u,
|
|
85
|
+
const o = y, f = u, v = z(() => o.pagination.limit_per_page ? Math.ceil(o.pagination.count / o.pagination.limit_per_page) : 0), C = z(() => o.pagination.current_page + 1 < v.value ? o.pagination.current_page + 1 : null), D = () => {
|
|
86
86
|
o.pagination.current_page++, f("tradePage");
|
|
87
|
-
},
|
|
88
|
-
o.pagination.current_page =
|
|
87
|
+
}, H = (p) => {
|
|
88
|
+
o.pagination.current_page = p - 1, f("tradePage");
|
|
89
89
|
}, l = () => {
|
|
90
|
-
o.pagination.current_page =
|
|
90
|
+
o.pagination.current_page = v.value - 1, f("tradePage");
|
|
91
91
|
}, d = () => {
|
|
92
92
|
o.pagination.current_page = 0, f("tradePage");
|
|
93
|
-
},
|
|
93
|
+
}, h = () => {
|
|
94
94
|
o.pagination.current_page > 0 && (o.pagination.current_page--, f("tradePage"));
|
|
95
|
-
},
|
|
96
|
-
if (
|
|
97
|
-
return Array.from({ length:
|
|
98
|
-
const
|
|
95
|
+
}, _ = z(() => {
|
|
96
|
+
if (v.value <= 7)
|
|
97
|
+
return Array.from({ length: v.value }, (N, B) => B + 1);
|
|
98
|
+
const p = o.pagination.current_page + 1, k = v.value, $ = /* @__PURE__ */ new Set([
|
|
99
99
|
1,
|
|
100
100
|
2,
|
|
101
101
|
// Sempre mostra as 2 primeiras
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
102
|
+
p - 1,
|
|
103
|
+
p,
|
|
104
|
+
p + 1,
|
|
105
105
|
// Mostra a atual e vizinhas
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
k - 1,
|
|
107
|
+
k
|
|
108
108
|
// Sempre mostra as 2 últimas
|
|
109
109
|
]), x = [];
|
|
110
|
-
let
|
|
111
|
-
return Array.from(
|
|
112
|
-
|
|
110
|
+
let c = 0;
|
|
111
|
+
return Array.from($).sort((N, B) => N - B).forEach((N) => {
|
|
112
|
+
N < 1 || N > k || (N > c + 1 && x.push("..."), x.push(N), c = N);
|
|
113
113
|
}), x;
|
|
114
114
|
});
|
|
115
|
-
return (
|
|
116
|
-
s("span", null, " Mostrando de " +
|
|
117
|
-
|
|
118
|
-
s("div",
|
|
115
|
+
return (p, k) => o.pagination.count > 0 ? (n(), a("div", we, [
|
|
116
|
+
s("span", null, " Mostrando de " + g(o.pagination.count !== 0 ? o.pagination.limit_per_page * o.pagination.current_page + 1 : 0) + " até " + g(o.pagination.limit_per_page * (o.pagination.current_page + 1) < o.pagination.count ? o.pagination.limit_per_page * (o.pagination.current_page + 1) : o.pagination.count) + " de " + g(o.pagination.count) + " registros ", 1),
|
|
117
|
+
v.value > 0 ? (n(), a("div", Ce, [
|
|
118
|
+
s("div", $e, [
|
|
119
119
|
s("button", {
|
|
120
120
|
class: "btn btn-estilo",
|
|
121
121
|
onClick: j(d, ["prevent"]),
|
|
122
122
|
disabled: o.pagination.current_page === 0,
|
|
123
123
|
innerHTML: R
|
|
124
|
-
}, null, 8,
|
|
124
|
+
}, null, 8, Se),
|
|
125
125
|
s("button", {
|
|
126
126
|
class: "btn btn-estilo",
|
|
127
|
-
onClick: j(
|
|
127
|
+
onClick: j(h, ["prevent"]),
|
|
128
128
|
disabled: o.pagination.current_page === 0,
|
|
129
129
|
innerHTML: ee
|
|
130
|
-
}, null, 8,
|
|
130
|
+
}, null, 8, Me)
|
|
131
131
|
]),
|
|
132
|
-
s("div",
|
|
133
|
-
(n(!0), a(M, null,
|
|
134
|
-
typeof
|
|
132
|
+
s("div", Pe, [
|
|
133
|
+
(n(!0), a(M, null, T(_.value, ($, x) => (n(), a(M, { key: x }, [
|
|
134
|
+
typeof $ == "number" ? (n(), a("button", {
|
|
135
135
|
key: 0,
|
|
136
|
-
class:
|
|
137
|
-
onClick: j((
|
|
138
|
-
disabled: o.pagination.current_page + 1 ==
|
|
139
|
-
},
|
|
136
|
+
class: m([o.pagination.current_page + 1 == $ ? "page-select" : "", "page-estilo"]),
|
|
137
|
+
onClick: j((c) => H($), ["prevent"]),
|
|
138
|
+
disabled: o.pagination.current_page + 1 == $
|
|
139
|
+
}, g($), 11, Te)) : (n(), a("span", ze, "..."))
|
|
140
140
|
], 64))), 128))
|
|
141
141
|
]),
|
|
142
|
-
s("div",
|
|
142
|
+
s("div", Ne, [
|
|
143
143
|
s("button", {
|
|
144
|
-
onClick: j(
|
|
144
|
+
onClick: j(D, ["prevent"]),
|
|
145
145
|
class: "btn btn-estilo rotate-180",
|
|
146
146
|
disabled: !C.value,
|
|
147
147
|
innerHTML: ee
|
|
148
|
-
}, null, 8,
|
|
148
|
+
}, null, 8, Ae),
|
|
149
149
|
s("button", {
|
|
150
150
|
onClick: j(l, ["prevent"]),
|
|
151
151
|
class: "btn btn-estilo rotate-180",
|
|
152
152
|
disabled: !C.value,
|
|
153
153
|
innerHTML: R
|
|
154
|
-
}, null, 8,
|
|
154
|
+
}, null, 8, De)
|
|
155
155
|
])
|
|
156
156
|
])) : b("", !0)
|
|
157
157
|
])) : b("", !0);
|
|
158
158
|
}
|
|
159
159
|
}), W = (y, u) => {
|
|
160
160
|
const o = y.__vccOpts || y;
|
|
161
|
-
for (const [f,
|
|
162
|
-
o[f] =
|
|
161
|
+
for (const [f, v] of u)
|
|
162
|
+
o[f] = v;
|
|
163
163
|
return o;
|
|
164
|
-
},
|
|
164
|
+
}, He = /* @__PURE__ */ W(Ee, [["__scopeId", "data-v-c189f089"]]), Le = { class: "dropdown d-flex" }, Ve = {
|
|
165
165
|
key: 0,
|
|
166
166
|
href: "#",
|
|
167
167
|
class: "btn dropdown-toggle",
|
|
168
168
|
"data-bs-toggle": "dropdown",
|
|
169
169
|
title: "Pesquisas Prédefinidas"
|
|
170
|
-
},
|
|
170
|
+
}, je = { class: "input-icon" }, Be = {
|
|
171
171
|
key: 1,
|
|
172
172
|
class: "input-icon-addon"
|
|
173
|
-
},
|
|
173
|
+
}, Ie = {
|
|
174
174
|
key: 1,
|
|
175
175
|
class: "dropdown-menu"
|
|
176
|
-
},
|
|
176
|
+
}, Oe = ["onClick"], qe = /* @__PURE__ */ F({
|
|
177
177
|
__name: "SearchDatatable",
|
|
178
178
|
props: {
|
|
179
179
|
search: {},
|
|
@@ -183,10 +183,10 @@ const se = Symbol("v-datatable-key"), Nt = /* @__PURE__ */ F({
|
|
|
183
183
|
},
|
|
184
184
|
emits: ["update:search", "update:filter", "search"],
|
|
185
185
|
setup(y, { emit: u }) {
|
|
186
|
-
const o = y, f = u,
|
|
186
|
+
const o = y, f = u, v = z({
|
|
187
187
|
get: () => o.search,
|
|
188
188
|
set: (l) => f("update:search", l)
|
|
189
|
-
}), C =
|
|
189
|
+
}), C = z({
|
|
190
190
|
get: () => o.filter,
|
|
191
191
|
set: (l) => f("update:filter", l)
|
|
192
192
|
});
|
|
@@ -195,22 +195,22 @@ const se = Symbol("v-datatable-key"), Nt = /* @__PURE__ */ F({
|
|
|
195
195
|
}), q(
|
|
196
196
|
() => o.list_filter,
|
|
197
197
|
(l) => {
|
|
198
|
-
Array.isArray(l) ? (l.forEach((d,
|
|
199
|
-
d?.type === 1 && !d.to && console.error(`Filtro na posição ${
|
|
198
|
+
Array.isArray(l) ? (l.forEach((d, h) => {
|
|
199
|
+
d?.type === 1 && !d.to && console.error(`Filtro na posição ${h} é do tipo 'router-link' mas não possui a propriedade 'to'.`);
|
|
200
200
|
}), o.item_use.includes(2) && l.length === 0 && console.error("Nenhum filtro foi passado. Certifique-se de que o array de filtros não está vazio.")) : console.error("list_filter deve ser um array.");
|
|
201
201
|
},
|
|
202
202
|
{ immediate: !0, deep: !0 }
|
|
203
203
|
);
|
|
204
|
-
function
|
|
204
|
+
function D(l) {
|
|
205
205
|
C.value === l ? C.value = "" : C.value = l;
|
|
206
206
|
}
|
|
207
|
-
function
|
|
208
|
-
|
|
207
|
+
function H() {
|
|
208
|
+
v.value = "", f("search");
|
|
209
209
|
}
|
|
210
210
|
return (l, d) => {
|
|
211
|
-
const
|
|
212
|
-
return n(), a("div",
|
|
213
|
-
y.item_use.includes(2) ? (n(), a("a",
|
|
211
|
+
const h = ge("router-link");
|
|
212
|
+
return n(), a("div", Le, [
|
|
213
|
+
y.item_use.includes(2) ? (n(), a("a", Ve, [...d[3] || (d[3] = [
|
|
214
214
|
s("svg", {
|
|
215
215
|
xmlns: "http://www.w3.org/2000/svg",
|
|
216
216
|
class: "icon icon-tabler icon-tabler-filter",
|
|
@@ -231,20 +231,20 @@ const se = Symbol("v-datatable-key"), Nt = /* @__PURE__ */ F({
|
|
|
231
231
|
s("path", { d: "M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z" })
|
|
232
232
|
], -1)
|
|
233
233
|
])])) : b("", !0),
|
|
234
|
-
s("div",
|
|
234
|
+
s("div", je, [
|
|
235
235
|
ne(s("input", {
|
|
236
236
|
type: "text",
|
|
237
237
|
class: "form-control ms-1",
|
|
238
238
|
id: "inputSearchLaudos",
|
|
239
|
-
"onUpdate:modelValue": d[0] || (d[0] = (
|
|
240
|
-
onKeyup: d[1] || (d[1] =
|
|
239
|
+
"onUpdate:modelValue": d[0] || (d[0] = (_) => v.value = _),
|
|
240
|
+
onKeyup: d[1] || (d[1] = ve((_) => l.$emit("search"), ["enter"])),
|
|
241
241
|
placeholder: "Buscar..."
|
|
242
242
|
}, null, 544), [
|
|
243
|
-
[ae,
|
|
243
|
+
[ae, v.value]
|
|
244
244
|
]),
|
|
245
|
-
|
|
245
|
+
v.value ? (n(), a("span", {
|
|
246
246
|
key: 0,
|
|
247
|
-
onClick: d[2] || (d[2] = (
|
|
247
|
+
onClick: d[2] || (d[2] = (_) => H()),
|
|
248
248
|
class: "inputClose",
|
|
249
249
|
title: "Limpar pesquisa"
|
|
250
250
|
}, [...d[4] || (d[4] = [
|
|
@@ -268,7 +268,7 @@ const se = Symbol("v-datatable-key"), Nt = /* @__PURE__ */ F({
|
|
|
268
268
|
s("path", { d: "M18 6l-12 12" }),
|
|
269
269
|
s("path", { d: "M6 6l12 12" })
|
|
270
270
|
], -1)
|
|
271
|
-
])])) : (n(), a("span",
|
|
271
|
+
])])) : (n(), a("span", Be, [...d[5] || (d[5] = [
|
|
272
272
|
s("svg", {
|
|
273
273
|
xmlns: "http://www.w3.org/2000/svg",
|
|
274
274
|
width: "24",
|
|
@@ -291,30 +291,30 @@ const se = Symbol("v-datatable-key"), Nt = /* @__PURE__ */ F({
|
|
|
291
291
|
], -1)
|
|
292
292
|
])]))
|
|
293
293
|
]),
|
|
294
|
-
y.item_use.includes(2) ? (n(), a("div",
|
|
295
|
-
(n(!0), a(M, null,
|
|
296
|
-
"type" in
|
|
294
|
+
y.item_use.includes(2) ? (n(), a("div", Ie, [
|
|
295
|
+
(n(!0), a(M, null, T(o.list_filter, (_, p) => (n(), a(M, { key: p }, [
|
|
296
|
+
"type" in _ && _.type === 1 ? (n(), X(h, {
|
|
297
297
|
key: 0,
|
|
298
|
-
to:
|
|
298
|
+
to: _?.to,
|
|
299
299
|
class: "dropdown-item cursor-pointer"
|
|
300
300
|
}, {
|
|
301
|
-
default:
|
|
302
|
-
|
|
301
|
+
default: he(() => [
|
|
302
|
+
A(g(_.text), 1)
|
|
303
303
|
]),
|
|
304
304
|
_: 2
|
|
305
|
-
}, 1032, ["to"])) : !("type" in
|
|
305
|
+
}, 1032, ["to"])) : !("type" in _) || _.type === 2 ? (n(), a("a", {
|
|
306
306
|
key: 1,
|
|
307
|
-
onClick: j((
|
|
308
|
-
class:
|
|
309
|
-
},
|
|
307
|
+
onClick: j((k) => D(String(_.value)), ["prevent"]),
|
|
308
|
+
class: m(["dropdown-item cursor-pointer", C.value === _?.value ? "bg-info text-dark selected" : ""])
|
|
309
|
+
}, g(_.text), 11, Oe)) : b("", !0)
|
|
310
310
|
], 64))), 128))
|
|
311
311
|
])) : b("", !0)
|
|
312
312
|
]);
|
|
313
313
|
};
|
|
314
314
|
}
|
|
315
|
-
}),
|
|
316
|
-
function
|
|
317
|
-
const y = P(!1), u = P(""), o = P(0), f = P(0),
|
|
315
|
+
}), Fe = /* @__PURE__ */ W(qe, [["__scopeId", "data-v-1b6ff54b"]]);
|
|
316
|
+
function Ke() {
|
|
317
|
+
const y = P(!1), u = P(""), o = P(0), f = P(0), v = z(() => ({
|
|
318
318
|
position: "fixed",
|
|
319
319
|
zIndex: 9999,
|
|
320
320
|
pointerEvents: "none",
|
|
@@ -322,14 +322,14 @@ function Ue() {
|
|
|
322
322
|
left: `${o.value + 15}px`
|
|
323
323
|
}));
|
|
324
324
|
function C(d) {
|
|
325
|
-
const
|
|
326
|
-
let x =
|
|
327
|
-
x +
|
|
325
|
+
const h = d.clientX, _ = d.clientY, p = window.innerHeight, k = 15, $ = 300;
|
|
326
|
+
let x = _ + k;
|
|
327
|
+
x + $ > p && (x = _ - $ - k, x < 0 && (x = 0)), o.value = h, f.value = x;
|
|
328
328
|
}
|
|
329
|
-
function
|
|
330
|
-
y.value = !0, u.value =
|
|
329
|
+
function D(d, h) {
|
|
330
|
+
y.value = !0, u.value = h, C(d);
|
|
331
331
|
}
|
|
332
|
-
function
|
|
332
|
+
function H(d) {
|
|
333
333
|
y.value && C(d);
|
|
334
334
|
}
|
|
335
335
|
function l() {
|
|
@@ -338,57 +338,57 @@ function Ue() {
|
|
|
338
338
|
return {
|
|
339
339
|
isHovering: y,
|
|
340
340
|
previewSrc: u,
|
|
341
|
-
previewStyle:
|
|
342
|
-
handleMouseOver:
|
|
343
|
-
handleMouseMove:
|
|
341
|
+
previewStyle: v,
|
|
342
|
+
handleMouseOver: D,
|
|
343
|
+
handleMouseMove: H,
|
|
344
344
|
handleMouseLeave: l
|
|
345
345
|
};
|
|
346
346
|
}
|
|
347
|
-
const
|
|
347
|
+
const Ue = { class: "d-flex justify-content-between align-items-start mb-2" }, Ye = { class: "text-secondary" }, Xe = { class: "mx-2 d-inline-block" }, We = {
|
|
348
348
|
key: 0,
|
|
349
349
|
class: "alert alert-cyan d-flex justify-content-center align-items-center py-3",
|
|
350
350
|
role: "alert"
|
|
351
|
-
},
|
|
351
|
+
}, Ge = { class: "alert-title m-0" }, Je = { key: 0 }, Qe = { key: 2 }, Ze = {
|
|
352
352
|
key: 5,
|
|
353
353
|
class: "text-danger erro-custom-container"
|
|
354
|
-
},
|
|
354
|
+
}, Re = { class: "badge bg-orange text-white erro-custom-text" }, et = { key: 0 }, tt = { key: 2 }, nt = {
|
|
355
355
|
key: 5,
|
|
356
356
|
class: "text-danger erro-custom-container"
|
|
357
|
-
},
|
|
357
|
+
}, at = { class: "badge bg-orange text-white erro-custom-text" }, st = ["colspan"], lt = {
|
|
358
358
|
key: 0,
|
|
359
359
|
class: "d-flex flex-column justify-content-center align-items-center",
|
|
360
360
|
style: { height: "6rem" }
|
|
361
|
-
},
|
|
361
|
+
}, rt = {
|
|
362
362
|
key: 1,
|
|
363
363
|
style: { height: "3rem" }
|
|
364
|
-
},
|
|
364
|
+
}, ot = {
|
|
365
365
|
key: 2,
|
|
366
366
|
class: "p-3 text-center text-secondary"
|
|
367
|
-
},
|
|
367
|
+
}, it = {
|
|
368
368
|
key: 2,
|
|
369
369
|
class: "feedback-container text-center"
|
|
370
|
-
},
|
|
370
|
+
}, ut = {
|
|
371
371
|
key: 0,
|
|
372
372
|
class: "text-secondary"
|
|
373
|
-
},
|
|
373
|
+
}, dt = {
|
|
374
374
|
key: 1,
|
|
375
375
|
class: "text-secondary"
|
|
376
|
-
},
|
|
376
|
+
}, ct = {
|
|
377
377
|
key: 3,
|
|
378
378
|
class: "table-responsive"
|
|
379
|
-
},
|
|
379
|
+
}, pt = { key: 0 }, _t = {
|
|
380
380
|
key: 0,
|
|
381
381
|
class: "w-1"
|
|
382
|
-
},
|
|
382
|
+
}, mt = {
|
|
383
383
|
key: 0,
|
|
384
384
|
class: "w-1"
|
|
385
|
-
},
|
|
385
|
+
}, ft = ["checked", "onChange"], gt = ["onClick"], vt = ["onClick"], ht = { key: 0 }, yt = { key: 1 }, kt = ["onClick", "innerHTML"], bt = ["onClick"], xt = ["src"], wt = ["src"], Ct = {
|
|
386
386
|
key: 5,
|
|
387
387
|
class: "text-danger erro-custom-container"
|
|
388
|
-
},
|
|
388
|
+
}, $t = { class: "badge bg-orange text-white erro-custom-text" }, St = {
|
|
389
389
|
key: 1,
|
|
390
390
|
class: "text-center p-4 text-secondary"
|
|
391
|
-
},
|
|
391
|
+
}, Mt = ["src"], Pt = /* @__PURE__ */ F({
|
|
392
392
|
__name: "VDataTable",
|
|
393
393
|
props: {
|
|
394
394
|
fetch: {},
|
|
@@ -415,28 +415,29 @@ const Ye = { class: "d-flex justify-content-between align-items-start mb-2" }, X
|
|
|
415
415
|
retry_attempts: { default: 3 },
|
|
416
416
|
retry_delay: { default: 2e3 },
|
|
417
417
|
use_checkbox: { type: Boolean, default: !1 },
|
|
418
|
-
item_key: { default: "id" }
|
|
418
|
+
item_key: { default: "id" },
|
|
419
|
+
limit_per_page: { default: 5 }
|
|
419
420
|
},
|
|
420
421
|
setup(y, { expose: u }) {
|
|
421
422
|
const {
|
|
422
423
|
isHovering: o,
|
|
423
424
|
previewSrc: f,
|
|
424
|
-
previewStyle:
|
|
425
|
+
previewStyle: v,
|
|
425
426
|
handleMouseOver: C,
|
|
426
|
-
handleMouseMove:
|
|
427
|
-
handleMouseLeave:
|
|
428
|
-
} =
|
|
427
|
+
handleMouseMove: D,
|
|
428
|
+
handleMouseLeave: H
|
|
429
|
+
} = Ke(), l = y, d = P([]), h = P([]), _ = P(0), p = P([]), k = P(null), $ = P(!1), x = P(null), c = P({
|
|
429
430
|
current_page: 0,
|
|
430
431
|
// pagina atual
|
|
431
432
|
count: 0,
|
|
432
433
|
// total de itens
|
|
433
|
-
limit_per_page:
|
|
434
|
+
limit_per_page: l.limit_per_page,
|
|
434
435
|
// limite de itens por página
|
|
435
436
|
search: "",
|
|
436
437
|
// termo de busca
|
|
437
438
|
filter: ""
|
|
438
439
|
// filtro selecionado
|
|
439
|
-
}), { data:
|
|
440
|
+
}), { data: N, pending: B, error: K, execute: le, attempt: V } = l.fetch(l.endpoint, {
|
|
440
441
|
params: () => l.deactivate_default_params ? l.add_params && typeof l.add_params == "function" ? l.add_params() : {
|
|
441
442
|
...l.add_params
|
|
442
443
|
} : l.add_params && typeof l.add_params == "function" ? {
|
|
@@ -450,65 +451,65 @@ const Ye = { class: "d-flex justify-content-between align-items-start mb-2" }, X
|
|
|
450
451
|
retryDelay: l.retry_delay,
|
|
451
452
|
paramsReactives: !1,
|
|
452
453
|
immediate: !1
|
|
453
|
-
}, l.fetch_name),
|
|
454
|
+
}, l.fetch_name), re = z(() => {
|
|
454
455
|
let i = [1];
|
|
455
456
|
return l.list_filter.length > 0 && i.push(2), i;
|
|
456
|
-
}), U =
|
|
457
|
-
[l.page_param_name]:
|
|
458
|
-
[l.page_size_param_name]:
|
|
459
|
-
[l.search_param_name]:
|
|
460
|
-
[l.filter_param_name]:
|
|
461
|
-
})),
|
|
457
|
+
}), U = z(() => ({
|
|
458
|
+
[l.page_param_name]: c.value.current_page + 1,
|
|
459
|
+
[l.page_size_param_name]: c.value.limit_per_page,
|
|
460
|
+
[l.search_param_name]: c.value.search || "",
|
|
461
|
+
[l.filter_param_name]: c.value.filter || ""
|
|
462
|
+
})), oe = z(() => B.value || $.value), I = (i) => {
|
|
462
463
|
const t = l.item_key;
|
|
463
|
-
return
|
|
464
|
-
}, G =
|
|
465
|
-
if (!
|
|
466
|
-
const i =
|
|
467
|
-
return i === 0 ? !1 : i ===
|
|
468
|
-
}),
|
|
469
|
-
q([G,
|
|
470
|
-
|
|
464
|
+
return p.value.some((r) => r[t] === i[t]);
|
|
465
|
+
}, G = z(() => {
|
|
466
|
+
if (!h.value.length) return !1;
|
|
467
|
+
const i = h.value.filter((t) => I(t)).length;
|
|
468
|
+
return i === 0 ? !1 : i === h.value.length ? !0 : "indeterminate";
|
|
469
|
+
}), ie = z(() => p.value.length > 0);
|
|
470
|
+
q([G, k], ([i]) => {
|
|
471
|
+
k.value && (i === "indeterminate" ? (console.log("entrei no indeterminate"), k.value.checked = !1, k.value.indeterminate = !0) : (k.value.checked = i, k.value.indeterminate = !1));
|
|
471
472
|
}, {
|
|
472
473
|
immediate: !0,
|
|
473
474
|
flush: "post"
|
|
474
|
-
}), q(
|
|
475
|
-
i ? (
|
|
475
|
+
}), q(N, (i) => {
|
|
476
|
+
i ? (h.value = i[l.data_key] || [], _.value = i[l.total_key] || 0, c.value.count = _.value) : (h.value = [], _.value = 0);
|
|
476
477
|
}, { immediate: !0 });
|
|
477
|
-
function
|
|
478
|
-
const i =
|
|
478
|
+
function ue() {
|
|
479
|
+
const i = h.value;
|
|
479
480
|
if (!i.length) return;
|
|
480
481
|
const t = G.value;
|
|
481
482
|
if (t === !0 || t === "indeterminate") {
|
|
482
483
|
const r = i.map((e) => e[l.item_key]);
|
|
483
|
-
|
|
484
|
+
p.value = p.value.filter(
|
|
484
485
|
(e) => !r.includes(e[l.item_key])
|
|
485
486
|
);
|
|
486
487
|
} else
|
|
487
488
|
i.forEach((r) => {
|
|
488
|
-
I(r) ||
|
|
489
|
+
I(r) || p.value.push(r);
|
|
489
490
|
});
|
|
490
491
|
}
|
|
491
|
-
function
|
|
492
|
-
const t = l.item_key, r =
|
|
493
|
-
r > -1 ?
|
|
492
|
+
function de(i) {
|
|
493
|
+
const t = l.item_key, r = p.value.findIndex((e) => e[t] === i[t]);
|
|
494
|
+
r > -1 ? p.value.splice(r, 1) : p.value.push(i);
|
|
494
495
|
}
|
|
495
|
-
function
|
|
496
|
-
|
|
496
|
+
function ce(i) {
|
|
497
|
+
d.value.push(i);
|
|
497
498
|
}
|
|
498
|
-
|
|
499
|
+
ye(se, { addColumn: ce });
|
|
499
500
|
function L() {
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
}, l.min_loading_delay),
|
|
501
|
+
x.value && clearTimeout(x.value), $.value = !0, x.value = setTimeout(() => {
|
|
502
|
+
$.value = !1;
|
|
503
|
+
}, l.min_loading_delay), le();
|
|
503
504
|
}
|
|
504
|
-
function
|
|
505
|
-
|
|
505
|
+
function pe() {
|
|
506
|
+
c.value.current_page = 0, L();
|
|
506
507
|
}
|
|
507
508
|
const J = (i) => {
|
|
508
509
|
const t = i.target, r = parseInt(t.value, 10);
|
|
509
|
-
r > 0
|
|
510
|
+
r > 0 && (c.value.limit_per_page = r, c.value.limit_per_page = r, c.value.current_page = 0, L());
|
|
510
511
|
};
|
|
511
|
-
function
|
|
512
|
+
function E(i, t, r = null) {
|
|
512
513
|
if (!i) return t;
|
|
513
514
|
const e = i.split(".");
|
|
514
515
|
let S = t;
|
|
@@ -516,125 +517,125 @@ const Ye = { class: "d-flex justify-content-between align-items-start mb-2" }, X
|
|
|
516
517
|
S && typeof S == "object" && Y in S ? S = S[Y] : console.error(`Caminho inválido ou valor nulo em: ${i} na parte ${Y}`);
|
|
517
518
|
return r && (S = r(S)), S;
|
|
518
519
|
}
|
|
519
|
-
function
|
|
520
|
+
function _e(i, t) {
|
|
520
521
|
return t && typeof t == "number" && t > 0 && typeof i == "string" && i.length > t ? i.substring(0, t) + "..." : i;
|
|
521
522
|
}
|
|
522
523
|
return u({
|
|
523
524
|
execute: L,
|
|
524
|
-
pagination:
|
|
525
|
+
pagination: c,
|
|
525
526
|
default_params: U,
|
|
526
|
-
selected_items:
|
|
527
|
-
atLeastOneSelected:
|
|
527
|
+
selected_items: p,
|
|
528
|
+
atLeastOneSelected: ie
|
|
528
529
|
}), te(() => {
|
|
529
|
-
|
|
530
|
+
ke(() => {
|
|
530
531
|
L();
|
|
531
532
|
});
|
|
532
533
|
}), (i, t) => (n(), a("div", null, [
|
|
533
534
|
s("div", {
|
|
534
|
-
class:
|
|
535
|
+
class: m(["", l.class_container])
|
|
535
536
|
}, [
|
|
536
537
|
O(i.$slots, "default", {}, void 0, !0),
|
|
537
538
|
s("div", {
|
|
538
|
-
class:
|
|
539
|
+
class: m(["", l.class_content])
|
|
539
540
|
}, [
|
|
540
|
-
s("div",
|
|
541
|
+
s("div", Ue, [
|
|
541
542
|
O(i.$slots, "pageSize", {
|
|
542
543
|
changePageSize: J,
|
|
543
|
-
|
|
544
|
+
limit_per_page: c.value.limit_per_page
|
|
544
545
|
}, () => [
|
|
545
|
-
s("div",
|
|
546
|
-
|
|
547
|
-
s("div",
|
|
546
|
+
s("div", Ye, [
|
|
547
|
+
A(g(l.first_text_page_size) + " ", 1),
|
|
548
|
+
s("div", Xe, [
|
|
548
549
|
ne(s("input", {
|
|
549
550
|
class: "form-control form-control-sm",
|
|
550
551
|
onChange: J,
|
|
551
|
-
"onUpdate:modelValue": t[0] || (t[0] = (r) =>
|
|
552
|
+
"onUpdate:modelValue": t[0] || (t[0] = (r) => c.value.limit_per_page = r),
|
|
552
553
|
min: "1",
|
|
553
554
|
size: "3",
|
|
554
555
|
"aria-label": "Número de nóticias por página"
|
|
555
556
|
}, null, 544), [
|
|
556
|
-
[ae,
|
|
557
|
+
[ae, c.value.limit_per_page]
|
|
557
558
|
])
|
|
558
559
|
]),
|
|
559
|
-
|
|
560
|
+
A(" " + g(l.second_text_page_size), 1)
|
|
560
561
|
])
|
|
561
562
|
], !0),
|
|
562
563
|
O(i.$slots, "fieldMiddle", {}, void 0, !0),
|
|
563
|
-
Q(
|
|
564
|
-
search:
|
|
565
|
-
"onUpdate:search": t[1] || (t[1] = (r) =>
|
|
566
|
-
filter:
|
|
567
|
-
"onUpdate:filter": t[2] || (t[2] = (r) =>
|
|
564
|
+
Q(Fe, {
|
|
565
|
+
search: c.value.search,
|
|
566
|
+
"onUpdate:search": t[1] || (t[1] = (r) => c.value.search = r),
|
|
567
|
+
filter: c.value.filter,
|
|
568
|
+
"onUpdate:filter": t[2] || (t[2] = (r) => c.value.filter = r),
|
|
568
569
|
list_filter: l.list_filter,
|
|
569
|
-
item_use:
|
|
570
|
-
onSearch:
|
|
570
|
+
item_use: re.value,
|
|
571
|
+
onSearch: pe
|
|
571
572
|
}, null, 8, ["search", "filter", "list_filter", "item_use"])
|
|
572
573
|
]),
|
|
573
|
-
l.use_checkbox &&
|
|
574
|
-
s("h4",
|
|
574
|
+
l.use_checkbox && p.value.length > 0 ? (n(), a("div", We, [
|
|
575
|
+
s("h4", Ge, [
|
|
575
576
|
t[4] || (t[4] = s("strong", null, "Itens Selecionados:", -1)),
|
|
576
|
-
|
|
577
|
+
A(" " + g(p.value.length), 1)
|
|
577
578
|
]),
|
|
578
579
|
s("button", {
|
|
579
580
|
class: "btn btn-outline-danger ms-3 bold",
|
|
580
|
-
onClick: t[3] || (t[3] = (r) =>
|
|
581
|
+
onClick: t[3] || (t[3] = (r) => p.value = [])
|
|
581
582
|
}, "Limpar Seleção")
|
|
582
583
|
])) : b("", !0),
|
|
583
|
-
|
|
584
|
+
oe.value ? (n(), a(M, { key: 1 }, [
|
|
584
585
|
l.custom_loading ? (n(), X(Z(l.custom_loading), { key: 0 })) : (n(), a("table", {
|
|
585
586
|
key: 1,
|
|
586
|
-
class:
|
|
587
|
+
class: m(["table table-vcenter table-selectable", l.class_table])
|
|
587
588
|
}, [
|
|
588
589
|
s("thead", null, [
|
|
589
590
|
s("tr", null, [
|
|
590
|
-
(n(!0), a(M, null,
|
|
591
|
+
(n(!0), a(M, null, T(d.value, (r) => (n(), a("th", {
|
|
591
592
|
key: r.field || r.header,
|
|
592
|
-
class:
|
|
593
|
-
},
|
|
593
|
+
class: m(r.class_column)
|
|
594
|
+
}, g(r.header), 3))), 128))
|
|
594
595
|
])
|
|
595
596
|
]),
|
|
596
597
|
s("tbody", null, [
|
|
597
|
-
l.type_loading === "placeholder" ? (n(!0), a(M, { key: 0 },
|
|
598
|
+
l.type_loading === "placeholder" ? (n(!0), a(M, { key: 0 }, T(c.value.limit_per_page, (r) => (n(), a("tr", {
|
|
598
599
|
key: "placeholder-" + r,
|
|
599
600
|
class: "placeholder-glow"
|
|
600
601
|
}, [
|
|
601
|
-
(n(!0), a(M, null,
|
|
602
|
+
(n(!0), a(M, null, T(d.value, (e) => (n(), a("td", {
|
|
602
603
|
key: e.field || e.header,
|
|
603
|
-
class:
|
|
604
|
+
class: m(e.class_row)
|
|
604
605
|
}, [
|
|
605
|
-
e.bodySlot ? (n(), a("span",
|
|
606
|
+
e.bodySlot ? (n(), a("span", Je, [...t[5] || (t[5] = [
|
|
606
607
|
s("span", { class: "placeholder col-8" }, null, -1)
|
|
607
608
|
])])) : e.type === "text" ? (n(), a("span", {
|
|
608
609
|
key: 1,
|
|
609
|
-
class:
|
|
610
|
+
class: m(e.class_item)
|
|
610
611
|
}, [...t[6] || (t[6] = [
|
|
611
612
|
s("span", { class: "placeholder col-8" }, null, -1)
|
|
612
|
-
])], 2)) : e.type === "date" ? (n(), a("span",
|
|
613
|
+
])], 2)) : e.type === "date" ? (n(), a("span", Qe, [...t[7] || (t[7] = [
|
|
613
614
|
s("span", { class: "placeholder col-9" }, null, -1)
|
|
614
615
|
])])) : e.type === "html" ? (n(), a("div", {
|
|
615
616
|
key: 3,
|
|
616
|
-
class:
|
|
617
|
+
class: m(e.class_item)
|
|
617
618
|
}, [...t[8] || (t[8] = [
|
|
618
619
|
s("div", { class: "placeholder col-12" }, null, -1)
|
|
619
620
|
])], 2)) : e.type === "img" ? (n(), a("div", {
|
|
620
621
|
key: 4,
|
|
621
|
-
class:
|
|
622
|
+
class: m(e.class_item)
|
|
622
623
|
}, [...t[9] || (t[9] = [
|
|
623
624
|
s("div", { class: "placeholder placeholder-img" }, null, -1)
|
|
624
|
-
])], 2)) : (n(), a("span",
|
|
625
|
-
t[10] || (t[10] =
|
|
626
|
-
s("span",
|
|
627
|
-
t[11] || (t[11] =
|
|
625
|
+
])], 2)) : (n(), a("span", Ze, [
|
|
626
|
+
t[10] || (t[10] = A("tipo ", -1)),
|
|
627
|
+
s("span", Re, g(e.type), 1),
|
|
628
|
+
t[11] || (t[11] = A(" não suportado ", -1))
|
|
628
629
|
]))
|
|
629
630
|
], 2))), 128))
|
|
630
|
-
]))), 128)) : l.type_loading === "spiner-table" ? (n(!0), a(M, { key: 1 },
|
|
631
|
+
]))), 128)) : l.type_loading === "spiner-table" ? (n(!0), a(M, { key: 1 }, T(c.value.limit_per_page, (r) => (n(), a("tr", {
|
|
631
632
|
key: "placeholder-" + r
|
|
632
633
|
}, [
|
|
633
|
-
(n(!0), a(M, null,
|
|
634
|
+
(n(!0), a(M, null, T(d.value, (e) => (n(), a("td", {
|
|
634
635
|
key: e.field || e.header,
|
|
635
|
-
class:
|
|
636
|
+
class: m(e.class_row)
|
|
636
637
|
}, [
|
|
637
|
-
e.bodySlot ? (n(), a("span",
|
|
638
|
+
e.bodySlot ? (n(), a("span", et, [...t[12] || (t[12] = [
|
|
638
639
|
s("span", {
|
|
639
640
|
class: "spinner-border spinner-border-sm",
|
|
640
641
|
role: "status",
|
|
@@ -642,14 +643,14 @@ const Ye = { class: "d-flex justify-content-between align-items-start mb-2" }, X
|
|
|
642
643
|
}, null, -1)
|
|
643
644
|
])])) : e.type === "text" ? (n(), a("span", {
|
|
644
645
|
key: 1,
|
|
645
|
-
class:
|
|
646
|
+
class: m(e.class_item)
|
|
646
647
|
}, [...t[13] || (t[13] = [
|
|
647
648
|
s("span", {
|
|
648
649
|
class: "spinner-border spinner-border-sm",
|
|
649
650
|
role: "status",
|
|
650
651
|
"aria-hidden": "true"
|
|
651
652
|
}, null, -1)
|
|
652
|
-
])], 2)) : e.type === "date" ? (n(), a("span",
|
|
653
|
+
])], 2)) : e.type === "date" ? (n(), a("span", tt, [...t[14] || (t[14] = [
|
|
653
654
|
s("span", {
|
|
654
655
|
class: "spinner-border spinner-border-sm",
|
|
655
656
|
role: "status",
|
|
@@ -657,7 +658,7 @@ const Ye = { class: "d-flex justify-content-between align-items-start mb-2" }, X
|
|
|
657
658
|
}, null, -1)
|
|
658
659
|
])])) : e.type === "html" ? (n(), a("div", {
|
|
659
660
|
key: 3,
|
|
660
|
-
class:
|
|
661
|
+
class: m(e.class_item)
|
|
661
662
|
}, [...t[15] || (t[15] = [
|
|
662
663
|
s("span", {
|
|
663
664
|
class: "spinner-border spinner-border-sm",
|
|
@@ -666,7 +667,7 @@ const Ye = { class: "d-flex justify-content-between align-items-start mb-2" }, X
|
|
|
666
667
|
}, null, -1)
|
|
667
668
|
])], 2)) : e.type === "img" ? (n(), a("div", {
|
|
668
669
|
key: 4,
|
|
669
|
-
class:
|
|
670
|
+
class: m(["", e.class_item])
|
|
670
671
|
}, [...t[16] || (t[16] = [
|
|
671
672
|
s("span", { class: "placeholder-img d-flex justify-content-center align-items-center" }, [
|
|
672
673
|
s("span", {
|
|
@@ -675,77 +676,77 @@ const Ye = { class: "d-flex justify-content-between align-items-start mb-2" }, X
|
|
|
675
676
|
"aria-hidden": "true"
|
|
676
677
|
})
|
|
677
678
|
], -1)
|
|
678
|
-
])], 2)) : (n(), a("span",
|
|
679
|
-
t[17] || (t[17] =
|
|
680
|
-
s("span",
|
|
681
|
-
t[18] || (t[18] =
|
|
679
|
+
])], 2)) : (n(), a("span", nt, [
|
|
680
|
+
t[17] || (t[17] = A("tipo ", -1)),
|
|
681
|
+
s("span", at, g(e.type), 1),
|
|
682
|
+
t[18] || (t[18] = A(" não suportado ", -1))
|
|
682
683
|
]))
|
|
683
684
|
], 2))), 128))
|
|
684
|
-
]))), 128)) : l.type_loading === "spiner" ? (n(!0), a(M, { key: 2 },
|
|
685
|
+
]))), 128)) : l.type_loading === "spiner" ? (n(!0), a(M, { key: 2 }, T(c.value.limit_per_page, (r) => (n(), a("tr", { key: r }, [
|
|
685
686
|
s("td", {
|
|
686
|
-
colspan:
|
|
687
|
+
colspan: d.value.length,
|
|
687
688
|
class: "text-center p-0",
|
|
688
689
|
style: { "border-bottom": "none" }
|
|
689
690
|
}, [
|
|
690
|
-
r === Math.floor(
|
|
691
|
+
r === Math.floor(c.value.limit_per_page / 2) + 1 ? (n(), a("div", lt, [...t[19] || (t[19] = [
|
|
691
692
|
s("div", {
|
|
692
693
|
class: "spinner-border",
|
|
693
694
|
style: { width: "3rem", height: "3rem" },
|
|
694
695
|
role: "status"
|
|
695
696
|
}, null, -1),
|
|
696
697
|
s("span", { class: "mt-2" }, "Carregando...", -1)
|
|
697
|
-
])])) : (n(), a("div",
|
|
698
|
-
], 8,
|
|
698
|
+
])])) : (n(), a("div", rt))
|
|
699
|
+
], 8, st)
|
|
699
700
|
]))), 128)) : b("", !0)
|
|
700
701
|
])
|
|
701
702
|
], 2)),
|
|
702
|
-
w(V) && w(V).current > 1 ? (n(), a("div",
|
|
703
|
-
], 64)) : w(K) ? (n(), a("div",
|
|
703
|
+
w(V) && w(V).current > 1 ? (n(), a("div", ot, " A conexão falhou. Tentando novamente... (Tentativa " + g(w(V).current) + " de " + g(w(V).total) + ") ", 1)) : b("", !0)
|
|
704
|
+
], 64)) : w(K) ? (n(), a("div", it, [
|
|
704
705
|
t[20] || (t[20] = s("h4", { class: "text-danger" }, "Ocorreu um Erro", -1)),
|
|
705
|
-
w(V) ? (n(), a("p",
|
|
706
|
+
w(V) ? (n(), a("p", ut, " Não foi possível carregar os dados após " + g(w(V).total) + " tentativa(s). ", 1)) : (n(), a("p", dt, " Não foi possível carregar os dados. Verifique sua conexão. ")),
|
|
706
707
|
s("button", {
|
|
707
708
|
class: "btn btn-primary mt-2",
|
|
708
709
|
onClick: L
|
|
709
710
|
}, " Tentar Novamente ")
|
|
710
|
-
])) :
|
|
711
|
-
|
|
711
|
+
])) : h.value ? (n(), a("div", ct, [
|
|
712
|
+
h.value.length > 0 ? (n(), a("div", pt, [
|
|
712
713
|
s("table", {
|
|
713
|
-
class:
|
|
714
|
+
class: m(["table table-vcenter table-selectable", l.class_table])
|
|
714
715
|
}, [
|
|
715
716
|
s("thead", null, [
|
|
716
717
|
s("tr", null, [
|
|
717
|
-
l.use_checkbox ? (n(), a("th",
|
|
718
|
+
l.use_checkbox ? (n(), a("th", _t, [
|
|
718
719
|
s("input", {
|
|
719
720
|
class: "form-check-input m-0",
|
|
720
721
|
type: "checkbox",
|
|
721
722
|
ref_key: "selectAllCheckbox",
|
|
722
|
-
ref:
|
|
723
|
-
onChange:
|
|
723
|
+
ref: k,
|
|
724
|
+
onChange: ue,
|
|
724
725
|
"aria-label": "Selecionar todos os itens na página"
|
|
725
726
|
}, null, 544)
|
|
726
727
|
])) : b("", !0),
|
|
727
|
-
(n(!0), a(M, null,
|
|
728
|
+
(n(!0), a(M, null, T(d.value, (r) => (n(), a("th", {
|
|
728
729
|
key: r.field || r.header,
|
|
729
|
-
class:
|
|
730
|
-
},
|
|
730
|
+
class: m(r.class_column)
|
|
731
|
+
}, g(r.header), 3))), 128))
|
|
731
732
|
])
|
|
732
733
|
]),
|
|
733
734
|
s("tbody", null, [
|
|
734
|
-
(n(!0), a(M, null,
|
|
735
|
+
(n(!0), a(M, null, T(h.value, (r) => (n(), a("tr", {
|
|
735
736
|
key: r[l.item_key]
|
|
736
737
|
}, [
|
|
737
|
-
l.use_checkbox ? (n(), a("td",
|
|
738
|
+
l.use_checkbox ? (n(), a("td", mt, [
|
|
738
739
|
s("input", {
|
|
739
740
|
class: "form-check-input m-0",
|
|
740
741
|
type: "checkbox",
|
|
741
742
|
checked: I(r),
|
|
742
|
-
onChange: (e) =>
|
|
743
|
+
onChange: (e) => de(r),
|
|
743
744
|
"aria-label": "Selecionar este item"
|
|
744
|
-
}, null, 40,
|
|
745
|
+
}, null, 40, ft)
|
|
745
746
|
])) : b("", !0),
|
|
746
|
-
(n(!0), a(M, null,
|
|
747
|
+
(n(!0), a(M, null, T(d.value, (e) => (n(), a("td", {
|
|
747
748
|
key: e.field || e.header,
|
|
748
|
-
class:
|
|
749
|
+
class: m(e.class_row)
|
|
749
750
|
}, [
|
|
750
751
|
e.bodySlot ? (n(), X(Z(e.bodySlot), {
|
|
751
752
|
key: 0,
|
|
@@ -754,75 +755,75 @@ const Ye = { class: "d-flex justify-content-between align-items-start mb-2" }, X
|
|
|
754
755
|
}, null, 8, ["item", "is-selected"])) : e.type === "text" ? (n(), a("span", {
|
|
755
756
|
key: 1,
|
|
756
757
|
onClick: (S) => e.click ? e.click(r) : null,
|
|
757
|
-
class:
|
|
758
|
-
},
|
|
758
|
+
class: m(e.class_item + (e.click ? " cursor-pointer" : ""))
|
|
759
|
+
}, g(_e(E(e.field, r, e.transform_function), e.limite_text ?? null)), 11, gt)) : e.type === "date" ? (n(), a("span", {
|
|
759
760
|
key: 2,
|
|
760
761
|
onClick: (S) => e.click ? e.click(r) : null,
|
|
761
|
-
class:
|
|
762
|
+
class: m(e.class_item + (e.click ? " cursor-pointer" : ""))
|
|
762
763
|
}, [
|
|
763
|
-
e.format === "complete" ? (n(), a("span",
|
|
764
|
-
e.format === "simple" ? (n(), a("span",
|
|
764
|
+
e.format === "complete" ? (n(), a("span", ht, g(new Date(E(e.field, r)).toLocaleString()), 1)) : b("", !0),
|
|
765
|
+
e.format === "simple" ? (n(), a("span", yt, g(new Date(E(
|
|
765
766
|
e.field,
|
|
766
767
|
r
|
|
767
768
|
)).toLocaleDateString()), 1)) : b("", !0)
|
|
768
|
-
], 10,
|
|
769
|
+
], 10, vt)) : e.type === "html" ? (n(), a("div", {
|
|
769
770
|
key: 3,
|
|
770
771
|
onClick: (S) => e.click ? e.click(r) : null,
|
|
771
|
-
class:
|
|
772
|
-
innerHTML:
|
|
773
|
-
}, null, 10,
|
|
772
|
+
class: m(e.class_item + (e.click ? " cursor-pointer" : "")),
|
|
773
|
+
innerHTML: E(e.field, r)
|
|
774
|
+
}, null, 10, kt)) : e.type === "img" ? (n(), a("div", {
|
|
774
775
|
key: 4,
|
|
775
776
|
onClick: (S) => e.click ? e.click(r) : null,
|
|
776
|
-
class:
|
|
777
|
+
class: m(e.class_item + (e.click ? " cursor-pointer" : ""))
|
|
777
778
|
}, [
|
|
778
|
-
|
|
779
|
+
E(e.field, r) ? (n(), a("div", be({
|
|
779
780
|
key: 0,
|
|
780
781
|
ref_for: !0
|
|
781
782
|
}, e.deactivate_img_preview ? {
|
|
782
783
|
class: "container-img"
|
|
783
784
|
} : {
|
|
784
|
-
onMouseover: (S) => w(C)(S,
|
|
785
|
-
onMousemove: w(
|
|
786
|
-
onMouseleave: w(
|
|
785
|
+
onMouseover: (S) => w(C)(S, E(e.field, r)),
|
|
786
|
+
onMousemove: w(D),
|
|
787
|
+
onMouseleave: w(H),
|
|
787
788
|
class: "container-img container-img-preview"
|
|
788
789
|
}), [
|
|
789
790
|
s("img", {
|
|
790
791
|
class: "img-tamanho",
|
|
791
|
-
src:
|
|
792
|
-
}, null, 8,
|
|
792
|
+
src: E(e.field, r)
|
|
793
|
+
}, null, 8, xt),
|
|
793
794
|
s("img", {
|
|
794
795
|
class: "img-tamanho-cover",
|
|
795
|
-
src:
|
|
796
|
-
}, null, 8,
|
|
796
|
+
src: E(e.field, r)
|
|
797
|
+
}, null, 8, wt),
|
|
797
798
|
t[21] || (t[21] = s("div", { class: "bg-img" }, null, -1))
|
|
798
799
|
], 16)) : b("", !0)
|
|
799
|
-
], 10,
|
|
800
|
-
t[22] || (t[22] =
|
|
801
|
-
s("span",
|
|
802
|
-
t[23] || (t[23] =
|
|
800
|
+
], 10, bt)) : (n(), a("span", Ct, [
|
|
801
|
+
t[22] || (t[22] = A("tipo ", -1)),
|
|
802
|
+
s("span", $t, g(e.type), 1),
|
|
803
|
+
t[23] || (t[23] = A(" não suportado", -1))
|
|
803
804
|
]))
|
|
804
805
|
], 2))), 128))
|
|
805
806
|
]))), 128))
|
|
806
807
|
])
|
|
807
808
|
], 2)
|
|
808
|
-
])) : (n(), a("div",
|
|
809
|
+
])) : (n(), a("div", St, [...t[24] || (t[24] = [
|
|
809
810
|
s("p", { class: "m-0" }, "Nenhum item encontrado.", -1)
|
|
810
811
|
])]))
|
|
811
812
|
])) : b("", !0)
|
|
812
813
|
], 2)
|
|
813
814
|
], 2),
|
|
814
815
|
O(i.$slots, "pagination", {
|
|
815
|
-
pagination:
|
|
816
|
+
pagination: c.value,
|
|
816
817
|
tradePage: L,
|
|
817
818
|
error: w(K)
|
|
818
819
|
}, () => [
|
|
819
|
-
!w(K) &&
|
|
820
|
+
!w(K) && c.value.count > 0 ? (n(), a("div", {
|
|
820
821
|
key: 0,
|
|
821
|
-
class:
|
|
822
|
+
class: m(["mt-3 px-3", l.class_pagination])
|
|
822
823
|
}, [
|
|
823
|
-
Q(
|
|
824
|
+
Q(He, {
|
|
824
825
|
filtering: !0,
|
|
825
|
-
pagination:
|
|
826
|
+
pagination: c.value,
|
|
826
827
|
onTradePage: L
|
|
827
828
|
}, null, 8, ["pagination"])
|
|
828
829
|
], 2)) : b("", !0)
|
|
@@ -830,18 +831,18 @@ const Ye = { class: "d-flex justify-content-between align-items-start mb-2" }, X
|
|
|
830
831
|
w(o) ? (n(), a("div", {
|
|
831
832
|
key: 0,
|
|
832
833
|
class: "image-preview-container",
|
|
833
|
-
style:
|
|
834
|
+
style: xe(w(v))
|
|
834
835
|
}, [
|
|
835
836
|
s("img", {
|
|
836
837
|
src: w(f),
|
|
837
838
|
alt: "Preview",
|
|
838
839
|
class: "image-preview-large"
|
|
839
|
-
}, null, 8,
|
|
840
|
+
}, null, 8, Mt)
|
|
840
841
|
], 4)) : b("", !0)
|
|
841
842
|
]));
|
|
842
843
|
}
|
|
843
|
-
}),
|
|
844
|
+
}), Nt = /* @__PURE__ */ W(Pt, [["__scopeId", "data-v-4000deb4"]]);
|
|
844
845
|
export {
|
|
845
|
-
|
|
846
|
-
|
|
846
|
+
zt as VColumn,
|
|
847
|
+
Nt as VDataTable
|
|
847
848
|
};
|
package/package.json
CHANGED
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
<slot></slot>
|
|
5
5
|
<div class="" :class="props.class_content">
|
|
6
6
|
<div class="d-flex justify-content-between align-items-start mb-2">
|
|
7
|
-
<slot name="pageSize" :changePageSize="changePageSize" :
|
|
7
|
+
<slot name="pageSize" :changePageSize="changePageSize" :limit_per_page="pagination.limit_per_page">
|
|
8
8
|
<div class="text-secondary">
|
|
9
9
|
{{ props.first_text_page_size }}
|
|
10
10
|
<div class="mx-2 d-inline-block">
|
|
11
|
-
<input class="form-control form-control-sm" @change="changePageSize" v-model="
|
|
11
|
+
<input class="form-control form-control-sm" @change="changePageSize" v-model="pagination.limit_per_page" min="1"
|
|
12
12
|
size="3" aria-label="Número de nóticias por página" />
|
|
13
13
|
</div>
|
|
14
14
|
{{ props.second_text_page_size }}
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
</thead>
|
|
44
44
|
<tbody>
|
|
45
45
|
<template v-if="props.type_loading === 'placeholder'">
|
|
46
|
-
<tr v-for="n in
|
|
46
|
+
<tr v-for="n in pagination.limit_per_page" :key="'placeholder-' + n" class="placeholder-glow">
|
|
47
47
|
<td v-for="col in columns" :key="col.field || col.header" :class="col.class_row">
|
|
48
48
|
<span v-if="col.bodySlot">
|
|
49
49
|
<span class="placeholder col-8"></span>
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
</tr>
|
|
70
70
|
</template>
|
|
71
71
|
<template v-else-if="props.type_loading === 'spiner-table'">
|
|
72
|
-
<tr v-for="n in
|
|
72
|
+
<tr v-for="n in pagination.limit_per_page" :key="'placeholder-' + n">
|
|
73
73
|
<td v-for="col in columns" :key="col.field || col.header" :class="col.class_row">
|
|
74
74
|
<span v-if="col.bodySlot">
|
|
75
75
|
<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
|
|
@@ -98,9 +98,9 @@
|
|
|
98
98
|
|
|
99
99
|
</template>
|
|
100
100
|
<template v-else-if="props.type_loading === 'spiner'">
|
|
101
|
-
<tr v-for="n in
|
|
101
|
+
<tr v-for="n in pagination.limit_per_page" :key="n">
|
|
102
102
|
<td :colspan="columns.length" class="text-center p-0" style="border-bottom: none;">
|
|
103
|
-
<div v-if="n === Math.floor(
|
|
103
|
+
<div v-if="n === Math.floor(pagination.limit_per_page / 2) + 1"
|
|
104
104
|
class="d-flex flex-column justify-content-center align-items-center" style="height: 6rem;">
|
|
105
105
|
<div class="spinner-border" style="width: 3rem; height: 3rem;" role="status">
|
|
106
106
|
</div>
|
|
@@ -287,6 +287,8 @@ interface VDataTableProps {
|
|
|
287
287
|
use_checkbox?: boolean;
|
|
288
288
|
// Define qual propriedade do item será usada como chave única para a seleção.
|
|
289
289
|
item_key?: string;
|
|
290
|
+
|
|
291
|
+
limit_per_page?: number;
|
|
290
292
|
}
|
|
291
293
|
|
|
292
294
|
interface ExposedFunctions {
|
|
@@ -324,6 +326,7 @@ const props = withDefaults(defineProps<VDataTableProps>(), {
|
|
|
324
326
|
item_key: 'id',
|
|
325
327
|
first_text_page_size: 'Mostrar',
|
|
326
328
|
second_text_page_size: 'registros',
|
|
329
|
+
limit_per_page: 5,
|
|
327
330
|
});
|
|
328
331
|
|
|
329
332
|
|
|
@@ -331,7 +334,7 @@ const props = withDefaults(defineProps<VDataTableProps>(), {
|
|
|
331
334
|
// 2. ESTADO REATIVO PRINCIPAL
|
|
332
335
|
// =======================================================
|
|
333
336
|
|
|
334
|
-
|
|
337
|
+
|
|
335
338
|
const columns = ref<ColumnConfiguration[]>([]);
|
|
336
339
|
const items = ref<T[]>([]) as Ref<T[]>;
|
|
337
340
|
const totalItems = ref<number>(0);
|
|
@@ -345,7 +348,7 @@ const delayTimer = ref<ReturnType<typeof setTimeout> | null>(null);
|
|
|
345
348
|
const pagination = ref<PaginationObject>({
|
|
346
349
|
current_page: 0, // pagina atual
|
|
347
350
|
count: 0, // total de itens
|
|
348
|
-
limit_per_page:
|
|
351
|
+
limit_per_page: props.limit_per_page, // limite de itens por página
|
|
349
352
|
search: '', // termo de busca
|
|
350
353
|
filter: '', // filtro selecionado
|
|
351
354
|
})
|
|
@@ -527,14 +530,11 @@ const changePageSize = (event: Event): void => {
|
|
|
527
530
|
const target = event.target as HTMLInputElement;
|
|
528
531
|
const newSize = parseInt(target.value, 10);
|
|
529
532
|
if (newSize > 0) {
|
|
530
|
-
|
|
533
|
+
pagination.value.limit_per_page = newSize;
|
|
531
534
|
pagination.value.limit_per_page = newSize; // Atualiza o limite de itens por página
|
|
532
535
|
pagination.value.current_page = 0;
|
|
533
536
|
fetchDataWithDelay();
|
|
534
|
-
}
|
|
535
|
-
// toast.showToast("Erro", "Tamanho da página deve ser maior que 0", 2);
|
|
536
|
-
page_size.value = pagination.value.limit_per_page; // Reseta para o valor anterior
|
|
537
|
-
}
|
|
537
|
+
}
|
|
538
538
|
};
|
|
539
539
|
|
|
540
540
|
function getSubItem(field: string | null, item: T, transform_function: ((value: any) => any) | null = null): any {
|