v-sistec-features 1.2.2 → 1.2.4
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.
|
@@ -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-236ffe1c]{overflow-x:auto}.state-feedback[data-v-236ffe1c]{padding:1rem;text-align:center}.state-feedback.error[data-v-236ffe1c]{color:red}.pagination-controls[data-v-236ffe1c]{margin-top:1rem;display:flex;justify-content:space-between}.placeholder-img[data-v-236ffe1c]{width:40px;height:40px;border-radius:4px}.container-img[data-v-236ffe1c]{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-236ffe1c]{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-236ffe1c]{object-fit:contain;width:100%;height:100%;z-index:2}.container-img.container-img-preview[data-v-236ffe1c]{cursor:pointer}.container-img.container-img-preview[data-v-236ffe1c]: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-236ffe1c]{opacity:.3}.erro-custom-container[data-v-236ffe1c]{display:inline-block;padding:.2em .6em;border-radius:4px;background-color:#fff;font-weight:700;text-transform:uppercase}.erro-custom-text[data-v-236ffe1c]{font-size:.8em;text-transform:uppercase;font-weight:700}.bg-img[data-v-236ffe1c]{background-color:#0000004d;position:absolute;top:0;width:100%;height:100%;z-index:1}.image-preview-container[data-v-236ffe1c]{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-236ffe1c]{display:block;max-width:250px;max-height:250px;border-radius:4px}.form-check-input[data-v-236ffe1c]{border-width:1px!important;border-color:#00000064!important;width:17px;height:17px}[data-bs-theme=dark] .form-check-input[data-v-236ffe1c]{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 he, inject as ye, onMounted as te, computed as N, createElementBlock as n, createCommentVNode as b, openBlock as a, createElementVNode as s, toDisplayString as g, withModifiers as j, Fragment as S, renderList as T, normalizeClass as _, watch as q, resolveComponent as ke, withDirectives as ae, withKeys as be, vModelText as ne, createBlock as X, withCtx as xe, createTextVNode as D, ref as z, provide as we, readonly as Ce, nextTick as $e, renderSlot as O, createVNode as Q, resolveDynamicComponent as Z, unref as w, mergeProps as Me, normalizeStyle as Se } from "vue";
|
|
2
|
+
const se = Symbol("v-datatable-key"), Et = /* @__PURE__ */ F({
|
|
3
3
|
__name: "VColumn",
|
|
4
4
|
props: {
|
|
5
5
|
field: { default: null },
|
|
@@ -15,7 +15,7 @@ const se = Symbol("v-datatable-key"), zt = /* @__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 = he(), f = ye(se);
|
|
19
19
|
if (!f)
|
|
20
20
|
throw new Error("VColumn deve ser usado dentro de um VDataTable.");
|
|
21
21
|
const v = ["text", "img", "date", "html"];
|
|
@@ -48,18 +48,18 @@ const se = Symbol("v-datatable-key"), zt = /* @__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, E) => null;
|
|
52
52
|
}
|
|
53
|
-
}),
|
|
53
|
+
}), ze = {
|
|
54
54
|
key: 0,
|
|
55
55
|
class: "d-flex align-items-center justify-content-between w-100"
|
|
56
|
-
},
|
|
56
|
+
}, Pe = {
|
|
57
57
|
key: 0,
|
|
58
58
|
class: "d-flex align-items-center p-2 gap-2"
|
|
59
|
-
},
|
|
59
|
+
}, Te = { class: "d-flex" }, Ne = ["disabled"], Ae = ["disabled"], De = { class: "d-flex gap-2" }, Ee = ["onClick", "disabled"], He = {
|
|
60
60
|
key: 1,
|
|
61
61
|
class: "m-0 p-0"
|
|
62
|
-
},
|
|
62
|
+
}, Ve = { class: "d-flex" }, Le = ["disabled"], je = ["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"), zt = /* @__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
|
+
`, Be = /* @__PURE__ */ F({
|
|
78
78
|
__name: "PaginationDatatable",
|
|
79
79
|
props: {
|
|
80
80
|
pagination: {},
|
|
@@ -82,19 +82,19 @@ const se = Symbol("v-datatable-key"), zt = /* @__PURE__ */ F({
|
|
|
82
82
|
},
|
|
83
83
|
emits: ["tradePage"],
|
|
84
84
|
setup(y, { emit: u }) {
|
|
85
|
-
const o = y, f = u, v =
|
|
85
|
+
const o = y, f = u, v = N(() => o.pagination.limit_per_page ? Math.ceil(o.pagination.count / o.pagination.limit_per_page) : 0), C = N(() => o.pagination.current_page + 1 < v.value ? o.pagination.current_page + 1 : null), E = () => {
|
|
86
86
|
o.pagination.current_page++, f("tradePage");
|
|
87
|
-
},
|
|
87
|
+
}, V = (p) => {
|
|
88
88
|
o.pagination.current_page = p - 1, f("tradePage");
|
|
89
89
|
}, l = () => {
|
|
90
90
|
o.pagination.current_page = v.value - 1, f("tradePage");
|
|
91
|
-
},
|
|
91
|
+
}, c = () => {
|
|
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
|
-
},
|
|
95
|
+
}, m = N(() => {
|
|
96
96
|
if (v.value <= 7)
|
|
97
|
-
return Array.from({ length: v.value }, (
|
|
97
|
+
return Array.from({ length: v.value }, (A, B) => B + 1);
|
|
98
98
|
const p = o.pagination.current_page + 1, k = v.value, $ = /* @__PURE__ */ new Set([
|
|
99
99
|
1,
|
|
100
100
|
2,
|
|
@@ -107,51 +107,51 @@ const se = Symbol("v-datatable-key"), zt = /* @__PURE__ */ F({
|
|
|
107
107
|
k
|
|
108
108
|
// Sempre mostra as 2 últimas
|
|
109
109
|
]), x = [];
|
|
110
|
-
let
|
|
111
|
-
return Array.from($).sort((
|
|
112
|
-
|
|
110
|
+
let d = 0;
|
|
111
|
+
return Array.from($).sort((A, B) => A - B).forEach((A) => {
|
|
112
|
+
A < 1 || A > k || (A > d + 1 && x.push("..."), x.push(A), d = A);
|
|
113
113
|
}), x;
|
|
114
114
|
});
|
|
115
|
-
return (p, k) => o.pagination.count > 0 ? (
|
|
115
|
+
return (p, k) => o.pagination.count > 0 ? (a(), n("div", ze, [
|
|
116
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 ? (
|
|
118
|
-
s("div",
|
|
117
|
+
v.value > 0 ? (a(), n("div", Pe, [
|
|
118
|
+
s("div", Te, [
|
|
119
119
|
s("button", {
|
|
120
120
|
class: "btn btn-estilo",
|
|
121
|
-
onClick: j(
|
|
121
|
+
onClick: j(c, ["prevent"]),
|
|
122
122
|
disabled: o.pagination.current_page === 0,
|
|
123
123
|
innerHTML: R
|
|
124
|
-
}, null, 8,
|
|
124
|
+
}, null, 8, Ne),
|
|
125
125
|
s("button", {
|
|
126
126
|
class: "btn btn-estilo",
|
|
127
127
|
onClick: j(h, ["prevent"]),
|
|
128
128
|
disabled: o.pagination.current_page === 0,
|
|
129
129
|
innerHTML: ee
|
|
130
|
-
}, null, 8,
|
|
130
|
+
}, null, 8, Ae)
|
|
131
131
|
]),
|
|
132
|
-
s("div",
|
|
133
|
-
(
|
|
134
|
-
typeof $ == "number" ? (
|
|
132
|
+
s("div", De, [
|
|
133
|
+
(a(!0), n(S, null, T(m.value, ($, x) => (a(), n(S, { key: x }, [
|
|
134
|
+
typeof $ == "number" ? (a(), n("button", {
|
|
135
135
|
key: 0,
|
|
136
|
-
class:
|
|
137
|
-
onClick: j((
|
|
136
|
+
class: _([o.pagination.current_page + 1 == $ ? "page-select" : "", "page-estilo"]),
|
|
137
|
+
onClick: j((d) => V($), ["prevent"]),
|
|
138
138
|
disabled: o.pagination.current_page + 1 == $
|
|
139
|
-
}, g($), 11,
|
|
139
|
+
}, g($), 11, Ee)) : (a(), n("span", He, "..."))
|
|
140
140
|
], 64))), 128))
|
|
141
141
|
]),
|
|
142
|
-
s("div",
|
|
142
|
+
s("div", Ve, [
|
|
143
143
|
s("button", {
|
|
144
|
-
onClick: j(
|
|
144
|
+
onClick: j(E, ["prevent"]),
|
|
145
145
|
class: "btn btn-estilo rotate-180",
|
|
146
146
|
disabled: !C.value,
|
|
147
147
|
innerHTML: ee
|
|
148
|
-
}, null, 8,
|
|
148
|
+
}, null, 8, Le),
|
|
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, je)
|
|
155
155
|
])
|
|
156
156
|
])) : b("", !0)
|
|
157
157
|
])) : b("", !0);
|
|
@@ -161,19 +161,19 @@ const se = Symbol("v-datatable-key"), zt = /* @__PURE__ */ F({
|
|
|
161
161
|
for (const [f, v] of u)
|
|
162
162
|
o[f] = v;
|
|
163
163
|
return o;
|
|
164
|
-
},
|
|
164
|
+
}, Ie = /* @__PURE__ */ W(Be, [["__scopeId", "data-v-c189f089"]]), Oe = { class: "dropdown d-flex" }, qe = {
|
|
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
|
+
}, Fe = { class: "input-icon" }, Ke = {
|
|
171
171
|
key: 1,
|
|
172
172
|
class: "input-icon-addon"
|
|
173
|
-
},
|
|
173
|
+
}, Ue = {
|
|
174
174
|
key: 1,
|
|
175
175
|
class: "dropdown-menu"
|
|
176
|
-
},
|
|
176
|
+
}, Ye = ["onClick"], Xe = /* @__PURE__ */ F({
|
|
177
177
|
__name: "SearchDatatable",
|
|
178
178
|
props: {
|
|
179
179
|
search: {},
|
|
@@ -183,10 +183,10 @@ const se = Symbol("v-datatable-key"), zt = /* @__PURE__ */ F({
|
|
|
183
183
|
},
|
|
184
184
|
emits: ["update:search", "update:filter", "search"],
|
|
185
185
|
setup(y, { emit: u }) {
|
|
186
|
-
const o = y, f = u, v =
|
|
186
|
+
const o = y, f = u, v = N({
|
|
187
187
|
get: () => o.search,
|
|
188
188
|
set: (l) => f("update:search", l)
|
|
189
|
-
}), C =
|
|
189
|
+
}), C = N({
|
|
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"), zt = /* @__PURE__ */ F({
|
|
|
195
195
|
}), q(
|
|
196
196
|
() => o.list_filter,
|
|
197
197
|
(l) => {
|
|
198
|
-
Array.isArray(l) ? (l.forEach((
|
|
199
|
-
|
|
198
|
+
Array.isArray(l) ? (l.forEach((c, h) => {
|
|
199
|
+
c?.type === 1 && !c.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 E(l) {
|
|
205
205
|
C.value === l ? C.value = "" : C.value = l;
|
|
206
206
|
}
|
|
207
|
-
function
|
|
207
|
+
function V() {
|
|
208
208
|
v.value = "", f("search");
|
|
209
209
|
}
|
|
210
|
-
return (l,
|
|
211
|
-
const h =
|
|
212
|
-
return
|
|
213
|
-
y.item_use.includes(2) ? (
|
|
210
|
+
return (l, c) => {
|
|
211
|
+
const h = ke("router-link");
|
|
212
|
+
return a(), n("div", Oe, [
|
|
213
|
+
y.item_use.includes(2) ? (a(), n("a", qe, [...c[3] || (c[3] = [
|
|
214
214
|
s("svg", {
|
|
215
215
|
xmlns: "http://www.w3.org/2000/svg",
|
|
216
216
|
class: "icon icon-tabler icon-tabler-filter",
|
|
@@ -231,23 +231,23 @@ const se = Symbol("v-datatable-key"), zt = /* @__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",
|
|
235
|
-
|
|
234
|
+
s("div", Fe, [
|
|
235
|
+
ae(s("input", {
|
|
236
236
|
type: "text",
|
|
237
237
|
class: "form-control ms-1",
|
|
238
238
|
id: "inputSearchLaudos",
|
|
239
|
-
"onUpdate:modelValue":
|
|
240
|
-
onKeyup:
|
|
239
|
+
"onUpdate:modelValue": c[0] || (c[0] = (m) => v.value = m),
|
|
240
|
+
onKeyup: c[1] || (c[1] = be((m) => l.$emit("search"), ["enter"])),
|
|
241
241
|
placeholder: "Buscar..."
|
|
242
242
|
}, null, 544), [
|
|
243
|
-
[
|
|
243
|
+
[ne, v.value]
|
|
244
244
|
]),
|
|
245
|
-
v.value ? (
|
|
245
|
+
v.value ? (a(), n("span", {
|
|
246
246
|
key: 0,
|
|
247
|
-
onClick:
|
|
247
|
+
onClick: c[2] || (c[2] = (m) => V()),
|
|
248
248
|
class: "inputClose",
|
|
249
249
|
title: "Limpar pesquisa"
|
|
250
|
-
}, [...
|
|
250
|
+
}, [...c[4] || (c[4] = [
|
|
251
251
|
s("svg", {
|
|
252
252
|
xmlns: "http://www.w3.org/2000/svg",
|
|
253
253
|
width: "24",
|
|
@@ -268,7 +268,7 @@ const se = Symbol("v-datatable-key"), zt = /* @__PURE__ */ F({
|
|
|
268
268
|
s("path", { d: "M18 6l-12 12" }),
|
|
269
269
|
s("path", { d: "M6 6l12 12" })
|
|
270
270
|
], -1)
|
|
271
|
-
])])) : (
|
|
271
|
+
])])) : (a(), n("span", Ke, [...c[5] || (c[5] = [
|
|
272
272
|
s("svg", {
|
|
273
273
|
xmlns: "http://www.w3.org/2000/svg",
|
|
274
274
|
width: "24",
|
|
@@ -291,46 +291,46 @@ const se = Symbol("v-datatable-key"), zt = /* @__PURE__ */ F({
|
|
|
291
291
|
], -1)
|
|
292
292
|
])]))
|
|
293
293
|
]),
|
|
294
|
-
y.item_use.includes(2) ? (
|
|
295
|
-
(
|
|
296
|
-
"type" in
|
|
294
|
+
y.item_use.includes(2) ? (a(), n("div", Ue, [
|
|
295
|
+
(a(!0), n(S, null, T(o.list_filter, (m, p) => (a(), n(S, { key: p }, [
|
|
296
|
+
"type" in m && m.type === 1 ? (a(), X(h, {
|
|
297
297
|
key: 0,
|
|
298
|
-
to:
|
|
298
|
+
to: m?.to,
|
|
299
299
|
class: "dropdown-item cursor-pointer"
|
|
300
300
|
}, {
|
|
301
|
-
default:
|
|
302
|
-
|
|
301
|
+
default: xe(() => [
|
|
302
|
+
D(g(m.text), 1)
|
|
303
303
|
]),
|
|
304
304
|
_: 2
|
|
305
|
-
}, 1032, ["to"])) : !("type" in
|
|
305
|
+
}, 1032, ["to"])) : !("type" in m) || m.type === 2 ? (a(), n("a", {
|
|
306
306
|
key: 1,
|
|
307
|
-
onClick: j((k) =>
|
|
308
|
-
class:
|
|
309
|
-
}, g(
|
|
307
|
+
onClick: j((k) => E(String(m.value)), ["prevent"]),
|
|
308
|
+
class: _(["dropdown-item cursor-pointer", C.value === m?.value ? "bg-info text-dark selected" : ""])
|
|
309
|
+
}, g(m.text), 11, Ye)) : b("", !0)
|
|
310
310
|
], 64))), 128))
|
|
311
311
|
])) : b("", !0)
|
|
312
312
|
]);
|
|
313
313
|
};
|
|
314
314
|
}
|
|
315
|
-
}),
|
|
316
|
-
function
|
|
317
|
-
const y =
|
|
315
|
+
}), We = /* @__PURE__ */ W(Xe, [["__scopeId", "data-v-1b6ff54b"]]);
|
|
316
|
+
function Ge() {
|
|
317
|
+
const y = z(!1), u = z(""), o = z(0), f = z(0), v = N(() => ({
|
|
318
318
|
position: "fixed",
|
|
319
319
|
zIndex: 9999,
|
|
320
320
|
pointerEvents: "none",
|
|
321
321
|
top: `${f.value + 15}px`,
|
|
322
322
|
left: `${o.value + 15}px`
|
|
323
323
|
}));
|
|
324
|
-
function C(
|
|
325
|
-
const h =
|
|
326
|
-
let x =
|
|
327
|
-
x + $ > p && (x =
|
|
324
|
+
function C(c) {
|
|
325
|
+
const h = c.clientX, m = c.clientY, p = window.innerHeight, k = 15, $ = 300;
|
|
326
|
+
let x = m + k;
|
|
327
|
+
x + $ > p && (x = m - $ - k, x < 0 && (x = 0)), o.value = h, f.value = x;
|
|
328
328
|
}
|
|
329
|
-
function
|
|
330
|
-
y.value = !0, u.value = h, C(
|
|
329
|
+
function E(c, h) {
|
|
330
|
+
y.value = !0, u.value = h, C(c);
|
|
331
331
|
}
|
|
332
|
-
function
|
|
333
|
-
y.value && C(
|
|
332
|
+
function V(c) {
|
|
333
|
+
y.value && C(c);
|
|
334
334
|
}
|
|
335
335
|
function l() {
|
|
336
336
|
y.value = !1;
|
|
@@ -339,56 +339,56 @@ function Ke() {
|
|
|
339
339
|
isHovering: y,
|
|
340
340
|
previewSrc: u,
|
|
341
341
|
previewStyle: v,
|
|
342
|
-
handleMouseOver:
|
|
343
|
-
handleMouseMove:
|
|
342
|
+
handleMouseOver: E,
|
|
343
|
+
handleMouseMove: V,
|
|
344
344
|
handleMouseLeave: l
|
|
345
345
|
};
|
|
346
346
|
}
|
|
347
|
-
const
|
|
347
|
+
const Je = { class: "text-secondary" }, Qe = { class: "mx-2 d-inline-block" }, Ze = {
|
|
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
|
+
}, Re = { class: "alert-title m-0" }, et = { key: 0 }, tt = { key: 2 }, at = {
|
|
352
352
|
key: 5,
|
|
353
353
|
class: "text-danger erro-custom-container"
|
|
354
|
-
},
|
|
354
|
+
}, nt = { class: "badge bg-orange text-white erro-custom-text" }, st = { key: 0 }, lt = { key: 2 }, rt = {
|
|
355
355
|
key: 5,
|
|
356
356
|
class: "text-danger erro-custom-container"
|
|
357
|
-
},
|
|
357
|
+
}, it = { class: "badge bg-orange text-white erro-custom-text" }, ot = ["colspan"], ut = {
|
|
358
358
|
key: 0,
|
|
359
359
|
class: "d-flex flex-column justify-content-center align-items-center",
|
|
360
360
|
style: { height: "6rem" }
|
|
361
|
-
},
|
|
361
|
+
}, dt = {
|
|
362
362
|
key: 1,
|
|
363
363
|
style: { height: "3rem" }
|
|
364
|
-
},
|
|
364
|
+
}, ct = {
|
|
365
365
|
key: 2,
|
|
366
366
|
class: "p-3 text-center text-secondary"
|
|
367
|
-
},
|
|
367
|
+
}, pt = {
|
|
368
368
|
key: 2,
|
|
369
369
|
class: "feedback-container text-center"
|
|
370
|
-
},
|
|
370
|
+
}, _t = {
|
|
371
371
|
key: 0,
|
|
372
372
|
class: "text-secondary"
|
|
373
|
-
},
|
|
373
|
+
}, mt = {
|
|
374
374
|
key: 1,
|
|
375
375
|
class: "text-secondary"
|
|
376
|
-
},
|
|
376
|
+
}, ft = {
|
|
377
377
|
key: 3,
|
|
378
378
|
class: "table-responsive"
|
|
379
|
-
},
|
|
379
|
+
}, gt = { key: 0 }, vt = {
|
|
380
380
|
key: 0,
|
|
381
381
|
class: "w-1"
|
|
382
|
-
},
|
|
382
|
+
}, ht = {
|
|
383
383
|
key: 0,
|
|
384
384
|
class: "w-1"
|
|
385
|
-
},
|
|
385
|
+
}, yt = ["checked", "onChange"], kt = ["onClick"], bt = ["onClick"], xt = { key: 0 }, wt = { key: 1 }, Ct = ["onClick", "innerHTML"], $t = ["onClick"], Mt = ["src"], St = ["src"], zt = {
|
|
386
386
|
key: 5,
|
|
387
387
|
class: "text-danger erro-custom-container"
|
|
388
|
-
},
|
|
388
|
+
}, Pt = { class: "badge bg-orange text-white erro-custom-text" }, Tt = {
|
|
389
389
|
key: 1,
|
|
390
390
|
class: "text-center p-4 text-secondary"
|
|
391
|
-
},
|
|
391
|
+
}, Nt = ["src"], At = /* @__PURE__ */ F({
|
|
392
392
|
__name: "VDataTable",
|
|
393
393
|
props: {
|
|
394
394
|
fetch: {},
|
|
@@ -411,6 +411,7 @@ const Ue = { class: "d-flex justify-content-between align-items-start mb-2" }, Y
|
|
|
411
411
|
class_content: { default: "" },
|
|
412
412
|
class_container: { default: "" },
|
|
413
413
|
class_pagination: { default: "" },
|
|
414
|
+
class_filters: { default: "" },
|
|
414
415
|
min_loading_delay: { default: 600 },
|
|
415
416
|
retry_attempts: { default: 3 },
|
|
416
417
|
retry_delay: { default: 2e3 },
|
|
@@ -424,9 +425,9 @@ const Ue = { class: "d-flex justify-content-between align-items-start mb-2" }, Y
|
|
|
424
425
|
previewSrc: f,
|
|
425
426
|
previewStyle: v,
|
|
426
427
|
handleMouseOver: C,
|
|
427
|
-
handleMouseMove:
|
|
428
|
-
handleMouseLeave:
|
|
429
|
-
} =
|
|
428
|
+
handleMouseMove: E,
|
|
429
|
+
handleMouseLeave: V
|
|
430
|
+
} = Ge(), l = y, c = z([]), h = z([]), m = z(0), p = z([]), k = z(null), $ = z(!1), x = z(null), d = z({
|
|
430
431
|
current_page: 0,
|
|
431
432
|
// pagina atual
|
|
432
433
|
count: 0,
|
|
@@ -437,7 +438,7 @@ const Ue = { class: "d-flex justify-content-between align-items-start mb-2" }, Y
|
|
|
437
438
|
// termo de busca
|
|
438
439
|
filter: ""
|
|
439
440
|
// filtro selecionado
|
|
440
|
-
}), { data:
|
|
441
|
+
}), { data: A, pending: B, error: K, execute: le, attempt: L } = l.fetch(l.endpoint, {
|
|
441
442
|
params: () => l.deactivate_default_params ? l.add_params && typeof l.add_params == "function" ? l.add_params() : {
|
|
442
443
|
...l.add_params
|
|
443
444
|
} : l.add_params && typeof l.add_params == "function" ? {
|
|
@@ -451,29 +452,29 @@ const Ue = { class: "d-flex justify-content-between align-items-start mb-2" }, Y
|
|
|
451
452
|
retryDelay: l.retry_delay,
|
|
452
453
|
paramsReactives: !1,
|
|
453
454
|
immediate: !1
|
|
454
|
-
}, l.fetch_name), re =
|
|
455
|
+
}, l.fetch_name), re = N(() => {
|
|
455
456
|
let i = [1];
|
|
456
457
|
return l.list_filter.length > 0 && i.push(2), i;
|
|
457
|
-
}), U =
|
|
458
|
-
[l.page_param_name]:
|
|
459
|
-
[l.page_size_param_name]:
|
|
460
|
-
[l.search_param_name]:
|
|
461
|
-
[l.filter_param_name]:
|
|
462
|
-
})),
|
|
458
|
+
}), U = N(() => ({
|
|
459
|
+
[l.page_param_name]: d.value.current_page + 1,
|
|
460
|
+
[l.page_size_param_name]: d.value.limit_per_page,
|
|
461
|
+
[l.search_param_name]: d.value.search || "",
|
|
462
|
+
[l.filter_param_name]: d.value.filter || ""
|
|
463
|
+
})), ie = N(() => B.value || $.value), I = (i) => {
|
|
463
464
|
const t = l.item_key;
|
|
464
465
|
return p.value.some((r) => r[t] === i[t]);
|
|
465
|
-
}, G =
|
|
466
|
+
}, G = N(() => {
|
|
466
467
|
if (!h.value.length) return !1;
|
|
467
468
|
const i = h.value.filter((t) => I(t)).length;
|
|
468
469
|
return i === 0 ? !1 : i === h.value.length ? !0 : "indeterminate";
|
|
469
|
-
}),
|
|
470
|
+
}), oe = N(() => p.value.length > 0);
|
|
470
471
|
q([G, k], ([i]) => {
|
|
471
472
|
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));
|
|
472
473
|
}, {
|
|
473
474
|
immediate: !0,
|
|
474
475
|
flush: "post"
|
|
475
|
-
}), q(
|
|
476
|
-
i ? (h.value = i[l.data_key] || [],
|
|
476
|
+
}), q(A, (i) => {
|
|
477
|
+
i ? (h.value = i[l.data_key] || [], m.value = i[l.total_key] || 0, d.value.count = m.value) : (h.value = [], m.value = 0);
|
|
477
478
|
}, { immediate: !0 });
|
|
478
479
|
function ue() {
|
|
479
480
|
const i = h.value;
|
|
@@ -494,180 +495,204 @@ const Ue = { class: "d-flex justify-content-between align-items-start mb-2" }, Y
|
|
|
494
495
|
r > -1 ? p.value.splice(r, 1) : p.value.push(i);
|
|
495
496
|
}
|
|
496
497
|
function ce(i) {
|
|
497
|
-
|
|
498
|
+
c.value.push(i);
|
|
498
499
|
}
|
|
499
|
-
|
|
500
|
-
function
|
|
500
|
+
we(se, { addColumn: ce });
|
|
501
|
+
function P() {
|
|
501
502
|
x.value && clearTimeout(x.value), $.value = !0, x.value = setTimeout(() => {
|
|
502
503
|
$.value = !1;
|
|
503
504
|
}, l.min_loading_delay), le();
|
|
504
505
|
}
|
|
505
506
|
function pe() {
|
|
506
|
-
|
|
507
|
+
d.value.current_page = 0, P();
|
|
507
508
|
}
|
|
508
509
|
const J = (i) => {
|
|
509
510
|
const t = i.target, r = parseInt(t.value, 10);
|
|
510
|
-
r > 0 && (
|
|
511
|
+
r > 0 && (d.value.limit_per_page = r, d.value.limit_per_page = r, d.value.current_page = 0, P());
|
|
511
512
|
};
|
|
512
|
-
function
|
|
513
|
+
function H(i, t, r = null) {
|
|
513
514
|
if (!i) return t;
|
|
514
515
|
const e = i.split(".");
|
|
515
|
-
let
|
|
516
|
+
let M = t;
|
|
516
517
|
for (const Y of e)
|
|
517
|
-
|
|
518
|
-
return r && (
|
|
518
|
+
M && typeof M == "object" && Y in M ? M = M[Y] : console.error(`Caminho inválido ou valor nulo em: ${i} na parte ${Y}`);
|
|
519
|
+
return r && (M = r(M)), M;
|
|
519
520
|
}
|
|
520
521
|
function _e(i, t) {
|
|
521
522
|
return t && typeof t == "number" && t > 0 && typeof i == "string" && i.length > t ? i.substring(0, t) + "..." : i;
|
|
522
523
|
}
|
|
524
|
+
function me(i) {
|
|
525
|
+
i > 0 ? (d.value.limit_per_page = i, d.value.current_page = 0, P()) : console.warn("O limite deve ser um número maior que zero.");
|
|
526
|
+
}
|
|
527
|
+
function fe(i) {
|
|
528
|
+
d.value.search = i, d.value.current_page = 0, P();
|
|
529
|
+
}
|
|
530
|
+
function ge(i) {
|
|
531
|
+
d.value.filter = i, d.value.current_page = 0, P();
|
|
532
|
+
}
|
|
533
|
+
function ve(i) {
|
|
534
|
+
i >= 1 && i <= Math.ceil(d.value.count / d.value.limit_per_page) ? (d.value.current_page = i - 1, P()) : console.warn("Número de página inválido.");
|
|
535
|
+
}
|
|
523
536
|
return u({
|
|
524
|
-
execute:
|
|
525
|
-
pagination:
|
|
537
|
+
execute: P,
|
|
538
|
+
pagination: Ce(d),
|
|
539
|
+
set_limit_per_page: me,
|
|
540
|
+
set_search: fe,
|
|
541
|
+
set_filter: ge,
|
|
542
|
+
set_page: ve,
|
|
526
543
|
default_params: U,
|
|
527
544
|
selected_items: p,
|
|
528
|
-
atLeastOneSelected:
|
|
545
|
+
atLeastOneSelected: oe
|
|
529
546
|
}), te(() => {
|
|
530
|
-
|
|
531
|
-
|
|
547
|
+
$e(() => {
|
|
548
|
+
P();
|
|
532
549
|
});
|
|
533
|
-
}), (i, t) => (
|
|
550
|
+
}), (i, t) => (a(), n("div", null, [
|
|
534
551
|
s("div", {
|
|
535
|
-
class:
|
|
552
|
+
class: _(["", l.class_container])
|
|
536
553
|
}, [
|
|
537
554
|
O(i.$slots, "default", {}, void 0, !0),
|
|
538
555
|
s("div", {
|
|
539
|
-
class:
|
|
556
|
+
class: _(["", l.class_content])
|
|
540
557
|
}, [
|
|
541
|
-
s("div",
|
|
558
|
+
s("div", {
|
|
559
|
+
class: _([l.class_filters, "d-flex justify-content-between align-items-start mb-2"])
|
|
560
|
+
}, [
|
|
542
561
|
O(i.$slots, "pageSize", {
|
|
543
562
|
changePageSize: J,
|
|
544
|
-
limit_per_page:
|
|
563
|
+
limit_per_page: d.value.limit_per_page
|
|
545
564
|
}, () => [
|
|
546
|
-
s("div",
|
|
547
|
-
|
|
548
|
-
s("div",
|
|
549
|
-
|
|
565
|
+
s("div", Je, [
|
|
566
|
+
D(g(l.first_text_page_size) + " ", 1),
|
|
567
|
+
s("div", Qe, [
|
|
568
|
+
ae(s("input", {
|
|
550
569
|
class: "form-control form-control-sm",
|
|
551
570
|
onChange: J,
|
|
552
|
-
"onUpdate:modelValue": t[0] || (t[0] = (r) =>
|
|
571
|
+
"onUpdate:modelValue": t[0] || (t[0] = (r) => d.value.limit_per_page = r),
|
|
553
572
|
min: "1",
|
|
554
573
|
size: "3",
|
|
555
|
-
"aria-label": "Número de
|
|
574
|
+
"aria-label": "Número de registros por página",
|
|
575
|
+
type: "number"
|
|
556
576
|
}, null, 544), [
|
|
557
|
-
[
|
|
577
|
+
[
|
|
578
|
+
ne,
|
|
579
|
+
d.value.limit_per_page,
|
|
580
|
+
void 0,
|
|
581
|
+
{ lazy: !0 }
|
|
582
|
+
]
|
|
558
583
|
])
|
|
559
584
|
]),
|
|
560
|
-
|
|
585
|
+
D(" " + g(l.second_text_page_size), 1)
|
|
561
586
|
])
|
|
562
587
|
], !0),
|
|
563
588
|
O(i.$slots, "fieldMiddle", {}, void 0, !0),
|
|
564
|
-
Q(
|
|
565
|
-
search:
|
|
566
|
-
"onUpdate:search": t[1] || (t[1] = (r) =>
|
|
567
|
-
filter:
|
|
568
|
-
"onUpdate:filter": t[2] || (t[2] = (r) =>
|
|
589
|
+
Q(We, {
|
|
590
|
+
search: d.value.search,
|
|
591
|
+
"onUpdate:search": t[1] || (t[1] = (r) => d.value.search = r),
|
|
592
|
+
filter: d.value.filter,
|
|
593
|
+
"onUpdate:filter": t[2] || (t[2] = (r) => d.value.filter = r),
|
|
569
594
|
list_filter: l.list_filter,
|
|
570
595
|
item_use: re.value,
|
|
571
596
|
onSearch: pe
|
|
572
597
|
}, null, 8, ["search", "filter", "list_filter", "item_use"])
|
|
573
|
-
]),
|
|
574
|
-
l.use_checkbox && p.value.length > 0 ? (
|
|
575
|
-
s("h4",
|
|
598
|
+
], 2),
|
|
599
|
+
l.use_checkbox && p.value.length > 0 ? (a(), n("div", Ze, [
|
|
600
|
+
s("h4", Re, [
|
|
576
601
|
t[4] || (t[4] = s("strong", null, "Itens Selecionados:", -1)),
|
|
577
|
-
|
|
602
|
+
D(" " + g(p.value.length), 1)
|
|
578
603
|
]),
|
|
579
604
|
s("button", {
|
|
580
605
|
class: "btn btn-outline-danger ms-3 bold",
|
|
581
606
|
onClick: t[3] || (t[3] = (r) => p.value = [])
|
|
582
607
|
}, "Limpar Seleção")
|
|
583
608
|
])) : b("", !0),
|
|
584
|
-
|
|
585
|
-
l.custom_loading ? (
|
|
609
|
+
ie.value ? (a(), n(S, { key: 1 }, [
|
|
610
|
+
l.custom_loading ? (a(), X(Z(l.custom_loading), { key: 0 })) : (a(), n("table", {
|
|
586
611
|
key: 1,
|
|
587
|
-
class:
|
|
612
|
+
class: _(["table table-vcenter table-selectable", l.class_table])
|
|
588
613
|
}, [
|
|
589
614
|
s("thead", null, [
|
|
590
615
|
s("tr", null, [
|
|
591
|
-
(
|
|
616
|
+
(a(!0), n(S, null, T(c.value, (r) => (a(), n("th", {
|
|
592
617
|
key: r.field || r.header,
|
|
593
|
-
class:
|
|
618
|
+
class: _(r.class_column)
|
|
594
619
|
}, g(r.header), 3))), 128))
|
|
595
620
|
])
|
|
596
621
|
]),
|
|
597
622
|
s("tbody", null, [
|
|
598
|
-
l.type_loading === "placeholder" ? (
|
|
623
|
+
l.type_loading === "placeholder" ? (a(!0), n(S, { key: 0 }, T(d.value.limit_per_page, (r) => (a(), n("tr", {
|
|
599
624
|
key: "placeholder-" + r,
|
|
600
625
|
class: "placeholder-glow"
|
|
601
626
|
}, [
|
|
602
|
-
(
|
|
627
|
+
(a(!0), n(S, null, T(c.value, (e) => (a(), n("td", {
|
|
603
628
|
key: e.field || e.header,
|
|
604
|
-
class:
|
|
629
|
+
class: _(e.class_row)
|
|
605
630
|
}, [
|
|
606
|
-
e.bodySlot ? (
|
|
631
|
+
e.bodySlot ? (a(), n("span", et, [...t[5] || (t[5] = [
|
|
607
632
|
s("span", { class: "placeholder col-8" }, null, -1)
|
|
608
|
-
])])) : e.type === "text" ? (
|
|
633
|
+
])])) : e.type === "text" ? (a(), n("span", {
|
|
609
634
|
key: 1,
|
|
610
|
-
class:
|
|
635
|
+
class: _(e.class_item)
|
|
611
636
|
}, [...t[6] || (t[6] = [
|
|
612
637
|
s("span", { class: "placeholder col-8" }, null, -1)
|
|
613
|
-
])], 2)) : e.type === "date" ? (
|
|
638
|
+
])], 2)) : e.type === "date" ? (a(), n("span", tt, [...t[7] || (t[7] = [
|
|
614
639
|
s("span", { class: "placeholder col-9" }, null, -1)
|
|
615
|
-
])])) : e.type === "html" ? (
|
|
640
|
+
])])) : e.type === "html" ? (a(), n("div", {
|
|
616
641
|
key: 3,
|
|
617
|
-
class:
|
|
642
|
+
class: _(e.class_item)
|
|
618
643
|
}, [...t[8] || (t[8] = [
|
|
619
644
|
s("div", { class: "placeholder col-12" }, null, -1)
|
|
620
|
-
])], 2)) : e.type === "img" ? (
|
|
645
|
+
])], 2)) : e.type === "img" ? (a(), n("div", {
|
|
621
646
|
key: 4,
|
|
622
|
-
class:
|
|
647
|
+
class: _(e.class_item)
|
|
623
648
|
}, [...t[9] || (t[9] = [
|
|
624
649
|
s("div", { class: "placeholder placeholder-img" }, null, -1)
|
|
625
|
-
])], 2)) : (
|
|
626
|
-
t[10] || (t[10] =
|
|
627
|
-
s("span",
|
|
628
|
-
t[11] || (t[11] =
|
|
650
|
+
])], 2)) : (a(), n("span", at, [
|
|
651
|
+
t[10] || (t[10] = D("tipo ", -1)),
|
|
652
|
+
s("span", nt, g(e.type), 1),
|
|
653
|
+
t[11] || (t[11] = D(" não suportado ", -1))
|
|
629
654
|
]))
|
|
630
655
|
], 2))), 128))
|
|
631
|
-
]))), 128)) : l.type_loading === "spiner-table" ? (
|
|
656
|
+
]))), 128)) : l.type_loading === "spiner-table" ? (a(!0), n(S, { key: 1 }, T(d.value.limit_per_page, (r) => (a(), n("tr", {
|
|
632
657
|
key: "placeholder-" + r
|
|
633
658
|
}, [
|
|
634
|
-
(
|
|
659
|
+
(a(!0), n(S, null, T(c.value, (e) => (a(), n("td", {
|
|
635
660
|
key: e.field || e.header,
|
|
636
|
-
class:
|
|
661
|
+
class: _(e.class_row)
|
|
637
662
|
}, [
|
|
638
|
-
e.bodySlot ? (
|
|
663
|
+
e.bodySlot ? (a(), n("span", st, [...t[12] || (t[12] = [
|
|
639
664
|
s("span", {
|
|
640
665
|
class: "spinner-border spinner-border-sm",
|
|
641
666
|
role: "status",
|
|
642
667
|
"aria-hidden": "true"
|
|
643
668
|
}, null, -1)
|
|
644
|
-
])])) : e.type === "text" ? (
|
|
669
|
+
])])) : e.type === "text" ? (a(), n("span", {
|
|
645
670
|
key: 1,
|
|
646
|
-
class:
|
|
671
|
+
class: _(e.class_item)
|
|
647
672
|
}, [...t[13] || (t[13] = [
|
|
648
673
|
s("span", {
|
|
649
674
|
class: "spinner-border spinner-border-sm",
|
|
650
675
|
role: "status",
|
|
651
676
|
"aria-hidden": "true"
|
|
652
677
|
}, null, -1)
|
|
653
|
-
])], 2)) : e.type === "date" ? (
|
|
678
|
+
])], 2)) : e.type === "date" ? (a(), n("span", lt, [...t[14] || (t[14] = [
|
|
654
679
|
s("span", {
|
|
655
680
|
class: "spinner-border spinner-border-sm",
|
|
656
681
|
role: "status",
|
|
657
682
|
"aria-hidden": "true"
|
|
658
683
|
}, null, -1)
|
|
659
|
-
])])) : e.type === "html" ? (
|
|
684
|
+
])])) : e.type === "html" ? (a(), n("div", {
|
|
660
685
|
key: 3,
|
|
661
|
-
class:
|
|
686
|
+
class: _(e.class_item)
|
|
662
687
|
}, [...t[15] || (t[15] = [
|
|
663
688
|
s("span", {
|
|
664
689
|
class: "spinner-border spinner-border-sm",
|
|
665
690
|
role: "status",
|
|
666
691
|
"aria-hidden": "true"
|
|
667
692
|
}, null, -1)
|
|
668
|
-
])], 2)) : e.type === "img" ? (
|
|
693
|
+
])], 2)) : e.type === "img" ? (a(), n("div", {
|
|
669
694
|
key: 4,
|
|
670
|
-
class:
|
|
695
|
+
class: _(["", e.class_item])
|
|
671
696
|
}, [...t[16] || (t[16] = [
|
|
672
697
|
s("span", { class: "placeholder-img d-flex justify-content-center align-items-center" }, [
|
|
673
698
|
s("span", {
|
|
@@ -676,46 +701,46 @@ const Ue = { class: "d-flex justify-content-between align-items-start mb-2" }, Y
|
|
|
676
701
|
"aria-hidden": "true"
|
|
677
702
|
})
|
|
678
703
|
], -1)
|
|
679
|
-
])], 2)) : (
|
|
680
|
-
t[17] || (t[17] =
|
|
681
|
-
s("span",
|
|
682
|
-
t[18] || (t[18] =
|
|
704
|
+
])], 2)) : (a(), n("span", rt, [
|
|
705
|
+
t[17] || (t[17] = D("tipo ", -1)),
|
|
706
|
+
s("span", it, g(e.type), 1),
|
|
707
|
+
t[18] || (t[18] = D(" não suportado ", -1))
|
|
683
708
|
]))
|
|
684
709
|
], 2))), 128))
|
|
685
|
-
]))), 128)) : l.type_loading === "spiner" ? (
|
|
710
|
+
]))), 128)) : l.type_loading === "spiner" ? (a(!0), n(S, { key: 2 }, T(d.value.limit_per_page, (r) => (a(), n("tr", { key: r }, [
|
|
686
711
|
s("td", {
|
|
687
|
-
colspan:
|
|
712
|
+
colspan: c.value.length,
|
|
688
713
|
class: "text-center p-0",
|
|
689
714
|
style: { "border-bottom": "none" }
|
|
690
715
|
}, [
|
|
691
|
-
r === Math.floor(
|
|
716
|
+
r === Math.floor(d.value.limit_per_page / 2) + 1 ? (a(), n("div", ut, [...t[19] || (t[19] = [
|
|
692
717
|
s("div", {
|
|
693
718
|
class: "spinner-border",
|
|
694
719
|
style: { width: "3rem", height: "3rem" },
|
|
695
720
|
role: "status"
|
|
696
721
|
}, null, -1),
|
|
697
722
|
s("span", { class: "mt-2" }, "Carregando...", -1)
|
|
698
|
-
])])) : (
|
|
699
|
-
], 8,
|
|
723
|
+
])])) : (a(), n("div", dt))
|
|
724
|
+
], 8, ot)
|
|
700
725
|
]))), 128)) : b("", !0)
|
|
701
726
|
])
|
|
702
727
|
], 2)),
|
|
703
|
-
w(
|
|
704
|
-
], 64)) : w(K) ? (
|
|
728
|
+
w(L) && w(L).current > 1 ? (a(), n("div", ct, " A conexão falhou. Tentando novamente... (Tentativa " + g(w(L).current) + " de " + g(w(L).total) + ") ", 1)) : b("", !0)
|
|
729
|
+
], 64)) : w(K) ? (a(), n("div", pt, [
|
|
705
730
|
t[20] || (t[20] = s("h4", { class: "text-danger" }, "Ocorreu um Erro", -1)),
|
|
706
|
-
w(
|
|
731
|
+
w(L) ? (a(), n("p", _t, " Não foi possível carregar os dados após " + g(w(L).total) + " tentativa(s). ", 1)) : (a(), n("p", mt, " Não foi possível carregar os dados. Verifique sua conexão. ")),
|
|
707
732
|
s("button", {
|
|
708
733
|
class: "btn btn-primary mt-2",
|
|
709
|
-
onClick:
|
|
734
|
+
onClick: P
|
|
710
735
|
}, " Tentar Novamente ")
|
|
711
|
-
])) : h.value ? (
|
|
712
|
-
h.value.length > 0 ? (
|
|
736
|
+
])) : h.value ? (a(), n("div", ft, [
|
|
737
|
+
h.value.length > 0 ? (a(), n("div", gt, [
|
|
713
738
|
s("table", {
|
|
714
|
-
class:
|
|
739
|
+
class: _(["table table-vcenter table-selectable", l.class_table])
|
|
715
740
|
}, [
|
|
716
741
|
s("thead", null, [
|
|
717
742
|
s("tr", null, [
|
|
718
|
-
l.use_checkbox ? (
|
|
743
|
+
l.use_checkbox ? (a(), n("th", vt, [
|
|
719
744
|
s("input", {
|
|
720
745
|
class: "form-check-input m-0",
|
|
721
746
|
type: "checkbox",
|
|
@@ -725,124 +750,124 @@ const Ue = { class: "d-flex justify-content-between align-items-start mb-2" }, Y
|
|
|
725
750
|
"aria-label": "Selecionar todos os itens na página"
|
|
726
751
|
}, null, 544)
|
|
727
752
|
])) : b("", !0),
|
|
728
|
-
(
|
|
753
|
+
(a(!0), n(S, null, T(c.value, (r) => (a(), n("th", {
|
|
729
754
|
key: r.field || r.header,
|
|
730
|
-
class:
|
|
755
|
+
class: _(r.class_column)
|
|
731
756
|
}, g(r.header), 3))), 128))
|
|
732
757
|
])
|
|
733
758
|
]),
|
|
734
759
|
s("tbody", null, [
|
|
735
|
-
(
|
|
760
|
+
(a(!0), n(S, null, T(h.value, (r) => (a(), n("tr", {
|
|
736
761
|
key: r[l.item_key]
|
|
737
762
|
}, [
|
|
738
|
-
l.use_checkbox ? (
|
|
763
|
+
l.use_checkbox ? (a(), n("td", ht, [
|
|
739
764
|
s("input", {
|
|
740
765
|
class: "form-check-input m-0",
|
|
741
766
|
type: "checkbox",
|
|
742
767
|
checked: I(r),
|
|
743
768
|
onChange: (e) => de(r),
|
|
744
769
|
"aria-label": "Selecionar este item"
|
|
745
|
-
}, null, 40,
|
|
770
|
+
}, null, 40, yt)
|
|
746
771
|
])) : b("", !0),
|
|
747
|
-
(
|
|
772
|
+
(a(!0), n(S, null, T(c.value, (e) => (a(), n("td", {
|
|
748
773
|
key: e.field || e.header,
|
|
749
|
-
class:
|
|
774
|
+
class: _(e.class_row)
|
|
750
775
|
}, [
|
|
751
|
-
e.bodySlot ? (
|
|
776
|
+
e.bodySlot ? (a(), X(Z(e.bodySlot), {
|
|
752
777
|
key: 0,
|
|
753
778
|
item: r,
|
|
754
779
|
"is-selected": I(r)
|
|
755
|
-
}, null, 8, ["item", "is-selected"])) : e.type === "text" ? (
|
|
780
|
+
}, null, 8, ["item", "is-selected"])) : e.type === "text" ? (a(), n("span", {
|
|
756
781
|
key: 1,
|
|
757
|
-
onClick: (
|
|
758
|
-
class:
|
|
759
|
-
}, g(_e(
|
|
782
|
+
onClick: (M) => e.click ? e.click(r) : null,
|
|
783
|
+
class: _(e.class_item + (e.click ? " cursor-pointer" : ""))
|
|
784
|
+
}, g(_e(H(e.field, r, e.transform_function), e.limite_text ?? null)), 11, kt)) : e.type === "date" ? (a(), n("span", {
|
|
760
785
|
key: 2,
|
|
761
|
-
onClick: (
|
|
762
|
-
class:
|
|
786
|
+
onClick: (M) => e.click ? e.click(r) : null,
|
|
787
|
+
class: _(e.class_item + (e.click ? " cursor-pointer" : ""))
|
|
763
788
|
}, [
|
|
764
|
-
e.format === "complete" ? (
|
|
765
|
-
e.format === "simple" ? (
|
|
789
|
+
e.format === "complete" ? (a(), n("span", xt, g(new Date(H(e.field, r)).toLocaleString()), 1)) : b("", !0),
|
|
790
|
+
e.format === "simple" ? (a(), n("span", wt, g(new Date(H(
|
|
766
791
|
e.field,
|
|
767
792
|
r
|
|
768
793
|
)).toLocaleDateString()), 1)) : b("", !0)
|
|
769
|
-
], 10,
|
|
794
|
+
], 10, bt)) : e.type === "html" ? (a(), n("div", {
|
|
770
795
|
key: 3,
|
|
771
|
-
onClick: (
|
|
772
|
-
class:
|
|
773
|
-
innerHTML:
|
|
774
|
-
}, null, 10,
|
|
796
|
+
onClick: (M) => e.click ? e.click(r) : null,
|
|
797
|
+
class: _(e.class_item + (e.click ? " cursor-pointer" : "")),
|
|
798
|
+
innerHTML: H(e.field, r)
|
|
799
|
+
}, null, 10, Ct)) : e.type === "img" ? (a(), n("div", {
|
|
775
800
|
key: 4,
|
|
776
|
-
onClick: (
|
|
777
|
-
class:
|
|
801
|
+
onClick: (M) => e.click ? e.click(r) : null,
|
|
802
|
+
class: _(e.class_item + (e.click ? " cursor-pointer" : ""))
|
|
778
803
|
}, [
|
|
779
|
-
|
|
804
|
+
H(e.field, r) ? (a(), n("div", Me({
|
|
780
805
|
key: 0,
|
|
781
806
|
ref_for: !0
|
|
782
807
|
}, e.deactivate_img_preview ? {
|
|
783
808
|
class: "container-img"
|
|
784
809
|
} : {
|
|
785
|
-
onMouseover: (
|
|
786
|
-
onMousemove: w(
|
|
787
|
-
onMouseleave: w(
|
|
810
|
+
onMouseover: (M) => w(C)(M, H(e.field, r)),
|
|
811
|
+
onMousemove: w(E),
|
|
812
|
+
onMouseleave: w(V),
|
|
788
813
|
class: "container-img container-img-preview"
|
|
789
814
|
}), [
|
|
790
815
|
s("img", {
|
|
791
816
|
class: "img-tamanho",
|
|
792
|
-
src:
|
|
793
|
-
}, null, 8,
|
|
817
|
+
src: H(e.field, r)
|
|
818
|
+
}, null, 8, Mt),
|
|
794
819
|
s("img", {
|
|
795
820
|
class: "img-tamanho-cover",
|
|
796
|
-
src:
|
|
797
|
-
}, null, 8,
|
|
821
|
+
src: H(e.field, r)
|
|
822
|
+
}, null, 8, St),
|
|
798
823
|
t[21] || (t[21] = s("div", { class: "bg-img" }, null, -1))
|
|
799
824
|
], 16)) : b("", !0)
|
|
800
|
-
], 10,
|
|
801
|
-
t[22] || (t[22] =
|
|
802
|
-
s("span",
|
|
803
|
-
t[23] || (t[23] =
|
|
825
|
+
], 10, $t)) : (a(), n("span", zt, [
|
|
826
|
+
t[22] || (t[22] = D("tipo ", -1)),
|
|
827
|
+
s("span", Pt, g(e.type), 1),
|
|
828
|
+
t[23] || (t[23] = D(" não suportado", -1))
|
|
804
829
|
]))
|
|
805
830
|
], 2))), 128))
|
|
806
831
|
]))), 128))
|
|
807
832
|
])
|
|
808
833
|
], 2)
|
|
809
|
-
])) : (
|
|
834
|
+
])) : (a(), n("div", Tt, [...t[24] || (t[24] = [
|
|
810
835
|
s("p", { class: "m-0" }, "Nenhum item encontrado.", -1)
|
|
811
836
|
])]))
|
|
812
837
|
])) : b("", !0)
|
|
813
838
|
], 2)
|
|
814
839
|
], 2),
|
|
815
840
|
O(i.$slots, "pagination", {
|
|
816
|
-
pagination:
|
|
817
|
-
tradePage:
|
|
841
|
+
pagination: d.value,
|
|
842
|
+
tradePage: P,
|
|
818
843
|
error: w(K)
|
|
819
844
|
}, () => [
|
|
820
|
-
!w(K) &&
|
|
845
|
+
!w(K) && d.value.count > 0 ? (a(), n("div", {
|
|
821
846
|
key: 0,
|
|
822
|
-
class:
|
|
847
|
+
class: _(["mt-3 px-3", l.class_pagination])
|
|
823
848
|
}, [
|
|
824
|
-
Q(
|
|
849
|
+
Q(Ie, {
|
|
825
850
|
filtering: !0,
|
|
826
|
-
pagination:
|
|
827
|
-
onTradePage:
|
|
851
|
+
pagination: d.value,
|
|
852
|
+
onTradePage: P
|
|
828
853
|
}, null, 8, ["pagination"])
|
|
829
854
|
], 2)) : b("", !0)
|
|
830
855
|
], !0),
|
|
831
|
-
w(o) ? (
|
|
856
|
+
w(o) ? (a(), n("div", {
|
|
832
857
|
key: 0,
|
|
833
858
|
class: "image-preview-container",
|
|
834
|
-
style:
|
|
859
|
+
style: Se(w(v))
|
|
835
860
|
}, [
|
|
836
861
|
s("img", {
|
|
837
862
|
src: w(f),
|
|
838
863
|
alt: "Preview",
|
|
839
864
|
class: "image-preview-large"
|
|
840
|
-
}, null, 8,
|
|
865
|
+
}, null, 8, Nt)
|
|
841
866
|
], 4)) : b("", !0)
|
|
842
867
|
]));
|
|
843
868
|
}
|
|
844
|
-
}),
|
|
869
|
+
}), Ht = /* @__PURE__ */ W(At, [["__scopeId", "data-v-236ffe1c"]]);
|
|
845
870
|
export {
|
|
846
|
-
|
|
847
|
-
|
|
871
|
+
Et as VColumn,
|
|
872
|
+
Ht as VDataTable
|
|
848
873
|
};
|
package/package.json
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
<div class="" :class="props.class_container">
|
|
4
4
|
<slot></slot>
|
|
5
5
|
<div class="" :class="props.class_content">
|
|
6
|
-
<div class="d-flex justify-content-between align-items-start mb-2">
|
|
6
|
+
<div :class="props.class_filters" class="d-flex justify-content-between align-items-start mb-2">
|
|
7
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="pagination.limit_per_page" min="1"
|
|
12
|
-
size="3" aria-label="Número de
|
|
11
|
+
<input class="form-control form-control-sm" @change="changePageSize" v-model.lazy="pagination.limit_per_page" min="1"
|
|
12
|
+
size="3" aria-label="Número de registros por página" type="number" />
|
|
13
13
|
</div>
|
|
14
14
|
{{ props.second_text_page_size }}
|
|
15
15
|
</div>
|
|
@@ -219,7 +219,7 @@
|
|
|
219
219
|
</template>
|
|
220
220
|
|
|
221
221
|
<script setup lang="ts" generic="T extends Record<string, any>">
|
|
222
|
-
import { ref, provide, computed, watch, onMounted, nextTick, type Component, type Ref, type ComputedRef } from 'vue';
|
|
222
|
+
import { readonly,ref, provide, computed, watch, onMounted, nextTick, type Component, type Ref, type ComputedRef } from 'vue';
|
|
223
223
|
|
|
224
224
|
import PaginationDatatable from './PaginationDatatable.vue';
|
|
225
225
|
import Search from './SearchDatatable.vue';
|
|
@@ -269,6 +269,7 @@ interface VDataTableProps {
|
|
|
269
269
|
class_content?: string;
|
|
270
270
|
class_container?: string;
|
|
271
271
|
class_pagination?: string;
|
|
272
|
+
class_filters?: string;
|
|
272
273
|
|
|
273
274
|
/*
|
|
274
275
|
* tempo mínimo em ms para mostrar o loading para evitar telas piscando
|
|
@@ -297,6 +298,10 @@ interface ExposedFunctions {
|
|
|
297
298
|
default_params: Record<string, any>;
|
|
298
299
|
selected_items: Ref<T[]>;
|
|
299
300
|
atLeastOneSelected: ComputedRef<boolean>;
|
|
301
|
+
set_limit_per_page: (newLimit: number) => void;
|
|
302
|
+
set_search: (newSearch: string) => void;
|
|
303
|
+
set_filter: (newFilter: string) => void;
|
|
304
|
+
set_page: (newPage: number) => void;
|
|
300
305
|
}
|
|
301
306
|
|
|
302
307
|
// =======================================================
|
|
@@ -319,6 +324,7 @@ const props = withDefaults(defineProps<VDataTableProps>(), {
|
|
|
319
324
|
class_content: '',
|
|
320
325
|
class_container: '',
|
|
321
326
|
class_pagination: '',
|
|
327
|
+
class_filters: '',
|
|
322
328
|
min_loading_delay: 600,
|
|
323
329
|
retry_attempts: 3,
|
|
324
330
|
retry_delay: 2000,
|
|
@@ -569,12 +575,43 @@ function limiteText(text: string | null, limite: number | null): string | null {
|
|
|
569
575
|
// =======================================================
|
|
570
576
|
// 7. EXPOSE E CICLO DE VIDA
|
|
571
577
|
// =======================================================
|
|
578
|
+
function set_limit_per_page(newLimit: number): void {
|
|
579
|
+
if (newLimit > 0) {
|
|
580
|
+
pagination.value.limit_per_page = newLimit;
|
|
581
|
+
pagination.value.current_page = 0;
|
|
582
|
+
fetchDataWithDelay();
|
|
583
|
+
}else {
|
|
584
|
+
console.warn("O limite deve ser um número maior que zero.");
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
function set_search(newSearch: string): void {
|
|
588
|
+
pagination.value.search = newSearch;
|
|
589
|
+
pagination.value.current_page = 0;
|
|
590
|
+
fetchDataWithDelay();
|
|
591
|
+
}
|
|
592
|
+
function set_filter(newFilter: string): void {
|
|
593
|
+
pagination.value.filter = newFilter;
|
|
594
|
+
pagination.value.current_page = 0;
|
|
595
|
+
fetchDataWithDelay();
|
|
596
|
+
}
|
|
597
|
+
function set_page(newPage: number): void {
|
|
598
|
+
if (newPage >= 1 && newPage <= Math.ceil(pagination.value.count / pagination.value.limit_per_page)) {
|
|
599
|
+
pagination.value.current_page = newPage - 1;
|
|
600
|
+
fetchDataWithDelay();
|
|
601
|
+
} else {
|
|
602
|
+
console.warn("Número de página inválido.");
|
|
603
|
+
}
|
|
604
|
+
}
|
|
572
605
|
|
|
573
606
|
defineExpose<
|
|
574
607
|
ExposedFunctions
|
|
575
608
|
>({
|
|
576
609
|
execute: fetchDataWithDelay,
|
|
577
|
-
pagination,
|
|
610
|
+
pagination: readonly(pagination),
|
|
611
|
+
set_limit_per_page: set_limit_per_page,
|
|
612
|
+
set_search: set_search,
|
|
613
|
+
set_filter: set_filter,
|
|
614
|
+
set_page: set_page,
|
|
578
615
|
default_params,
|
|
579
616
|
selected_items,
|
|
580
617
|
atLeastOneSelected,
|