v-sistec-features 1.1.1 → 1.2.1
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-d20778cd]{overflow-x:auto}.state-feedback[data-v-d20778cd]{padding:1rem;text-align:center}.state-feedback.error[data-v-d20778cd]{color:red}.pagination-controls[data-v-d20778cd]{margin-top:1rem;display:flex;justify-content:space-between}.placeholder-img[data-v-d20778cd]{width:40px;height:40px;border-radius:4px}.container-img[data-v-d20778cd]{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-d20778cd]{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-d20778cd]{object-fit:contain;width:100%;height:100%;z-index:2}.container-img.container-img-preview[data-v-d20778cd]{cursor:pointer}.container-img.container-img-preview[data-v-d20778cd]: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-d20778cd]{opacity:.3}.erro-custom-container[data-v-d20778cd]{display:inline-block;padding:.2em .6em;border-radius:4px;background-color:#fff;font-weight:700;text-transform:uppercase}.erro-custom-text[data-v-d20778cd]{font-size:.8em;text-transform:uppercase;font-weight:700}.bg-img[data-v-d20778cd]{background-color:#0000004d;position:absolute;top:0;width:100%;height:100%;z-index:1}.image-preview-container[data-v-d20778cd]{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-d20778cd]{display:block;max-width:250px;max-height:250px;border-radius:4px}.form-check-input[data-v-d20778cd]{border-width:1px!important;border-color:#00000064!important;width:17px;height:17px}[data-bs-theme=dark] .form-check-input[data-v-d20778cd]{border-color:#ffffff5f!important}
|
package/dist/vDataTable.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const se = Symbol("v-datatable-key"),
|
|
1
|
+
import { defineComponent as F, useSlots as fe, inject as ge, onMounted as te, computed as T, createElementBlock as a, createCommentVNode as b, openBlock as n, createElementVNode as s, toDisplayString as g, withModifiers as j, Fragment as M, renderList as z, normalizeClass as _, watch as q, resolveComponent as ve, withDirectives as ne, withKeys as he, vModelText as ae, createBlock as X, withCtx as ye, createTextVNode as N, ref as P, provide as ke, nextTick as be, renderSlot as O, createVNode as Q, resolveDynamicComponent as Z, unref as w, mergeProps as xe, normalizeStyle as we } from "vue";
|
|
2
|
+
const se = Symbol("v-datatable-key"), Nt = /* @__PURE__ */ F({
|
|
3
3
|
__name: "VColumn",
|
|
4
4
|
props: {
|
|
5
5
|
field: { default: null },
|
|
@@ -11,7 +11,8 @@ const se = Symbol("v-datatable-key"), zt = /* @__PURE__ */ K({
|
|
|
11
11
|
format: { default: "complete" },
|
|
12
12
|
deactivate_img_preview: { type: Boolean, default: !1 },
|
|
13
13
|
limite_text: { default: null },
|
|
14
|
-
transform_function: { type: [Function, null], default: null }
|
|
14
|
+
transform_function: { type: [Function, null], default: null },
|
|
15
|
+
click: { type: [Function, null], default: null }
|
|
15
16
|
},
|
|
16
17
|
setup(y) {
|
|
17
18
|
const u = y, o = fe(), f = ge(se);
|
|
@@ -40,6 +41,7 @@ const se = Symbol("v-datatable-key"), zt = /* @__PURE__ */ K({
|
|
|
40
41
|
class_column: u.class_column,
|
|
41
42
|
class_row: u.class_row,
|
|
42
43
|
class_item: u.class_item,
|
|
44
|
+
click: u.click,
|
|
43
45
|
transform_function: u.transform_function,
|
|
44
46
|
bodySlot: o.body,
|
|
45
47
|
...u.type === "text" && { limite_text: Number(u.limite_text) },
|
|
@@ -51,10 +53,10 @@ const se = Symbol("v-datatable-key"), zt = /* @__PURE__ */ K({
|
|
|
51
53
|
}), Ce = {
|
|
52
54
|
key: 0,
|
|
53
55
|
class: "d-flex align-items-center justify-content-between w-100"
|
|
54
|
-
},
|
|
56
|
+
}, $e = {
|
|
55
57
|
key: 0,
|
|
56
58
|
class: "d-flex align-items-center p-2 gap-2"
|
|
57
|
-
},
|
|
59
|
+
}, Se = { class: "d-flex" }, Me = ["disabled"], Pe = ["disabled"], ze = { class: "d-flex gap-2" }, Te = ["onClick", "disabled"], Ne = {
|
|
58
60
|
key: 1,
|
|
59
61
|
class: "m-0 p-0"
|
|
60
62
|
}, Ae = { class: "d-flex" }, De = ["disabled"], Ee = ["disabled"], R = `
|
|
@@ -72,7 +74,7 @@ const se = Symbol("v-datatable-key"), zt = /* @__PURE__ */ K({
|
|
|
72
74
|
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
|
73
75
|
<path d="M15 6l-6 6l6 6" />
|
|
74
76
|
</svg>
|
|
75
|
-
`, He = /* @__PURE__ */
|
|
77
|
+
`, He = /* @__PURE__ */ F({
|
|
76
78
|
__name: "PaginationDatatable",
|
|
77
79
|
props: {
|
|
78
80
|
pagination: {},
|
|
@@ -80,26 +82,26 @@ const se = Symbol("v-datatable-key"), zt = /* @__PURE__ */ K({
|
|
|
80
82
|
},
|
|
81
83
|
emits: ["tradePage"],
|
|
82
84
|
setup(y, { emit: u }) {
|
|
83
|
-
const o = y, f = u, v =
|
|
85
|
+
const o = y, f = u, v = T(() => o.pagination.limit_per_page ? Math.ceil(o.pagination.count / o.pagination.limit_per_page) : 0), C = T(() => o.pagination.current_page + 1 < v.value ? o.pagination.current_page + 1 : null), A = () => {
|
|
84
86
|
o.pagination.current_page++, f("tradePage");
|
|
85
|
-
}, E = (
|
|
86
|
-
o.pagination.current_page =
|
|
87
|
+
}, E = ($) => {
|
|
88
|
+
o.pagination.current_page = $ - 1, f("tradePage");
|
|
87
89
|
}, l = () => {
|
|
88
90
|
o.pagination.current_page = v.value - 1, f("tradePage");
|
|
89
91
|
}, d = () => {
|
|
90
92
|
o.pagination.current_page = 0, f("tradePage");
|
|
91
93
|
}, k = () => {
|
|
92
94
|
o.pagination.current_page > 0 && (o.pagination.current_page--, f("tradePage"));
|
|
93
|
-
}, c =
|
|
95
|
+
}, c = T(() => {
|
|
94
96
|
if (v.value <= 7)
|
|
95
97
|
return Array.from({ length: v.value }, (p, B) => B + 1);
|
|
96
|
-
const
|
|
98
|
+
const $ = o.pagination.current_page + 1, m = v.value, h = /* @__PURE__ */ new Set([
|
|
97
99
|
1,
|
|
98
100
|
2,
|
|
99
101
|
// Sempre mostra as 2 primeiras
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
102
|
+
$ - 1,
|
|
103
|
+
$,
|
|
104
|
+
$ + 1,
|
|
103
105
|
// Mostra a atual e vizinhas
|
|
104
106
|
m - 1,
|
|
105
107
|
m
|
|
@@ -110,41 +112,41 @@ const se = Symbol("v-datatable-key"), zt = /* @__PURE__ */ K({
|
|
|
110
112
|
p < 1 || p > m || (p > H + 1 && x.push("..."), x.push(p), H = p);
|
|
111
113
|
}), x;
|
|
112
114
|
});
|
|
113
|
-
return (
|
|
114
|
-
|
|
115
|
-
v.value > 0 ? (
|
|
116
|
-
|
|
117
|
-
|
|
115
|
+
return ($, m) => o.pagination.count > 0 ? (n(), a("div", Ce, [
|
|
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", $e, [
|
|
118
|
+
s("div", Se, [
|
|
119
|
+
s("button", {
|
|
118
120
|
class: "btn btn-estilo",
|
|
119
121
|
onClick: j(d, ["prevent"]),
|
|
120
122
|
disabled: o.pagination.current_page === 0,
|
|
121
123
|
innerHTML: R
|
|
122
|
-
}, null, 8,
|
|
123
|
-
|
|
124
|
+
}, null, 8, Me),
|
|
125
|
+
s("button", {
|
|
124
126
|
class: "btn btn-estilo",
|
|
125
127
|
onClick: j(k, ["prevent"]),
|
|
126
128
|
disabled: o.pagination.current_page === 0,
|
|
127
129
|
innerHTML: ee
|
|
128
130
|
}, null, 8, Pe)
|
|
129
131
|
]),
|
|
130
|
-
|
|
131
|
-
(
|
|
132
|
-
typeof h == "number" ? (
|
|
132
|
+
s("div", ze, [
|
|
133
|
+
(n(!0), a(M, null, z(c.value, (h, x) => (n(), a(M, { key: x }, [
|
|
134
|
+
typeof h == "number" ? (n(), a("button", {
|
|
133
135
|
key: 0,
|
|
134
136
|
class: _([o.pagination.current_page + 1 == h ? "page-select" : "", "page-estilo"]),
|
|
135
137
|
onClick: j((H) => E(h), ["prevent"]),
|
|
136
138
|
disabled: o.pagination.current_page + 1 == h
|
|
137
|
-
}, g(h), 11, Te)) : (
|
|
139
|
+
}, g(h), 11, Te)) : (n(), a("span", Ne, "..."))
|
|
138
140
|
], 64))), 128))
|
|
139
141
|
]),
|
|
140
|
-
|
|
141
|
-
|
|
142
|
+
s("div", Ae, [
|
|
143
|
+
s("button", {
|
|
142
144
|
onClick: j(A, ["prevent"]),
|
|
143
145
|
class: "btn btn-estilo rotate-180",
|
|
144
146
|
disabled: !C.value,
|
|
145
147
|
innerHTML: ee
|
|
146
148
|
}, null, 8, De),
|
|
147
|
-
|
|
149
|
+
s("button", {
|
|
148
150
|
onClick: j(l, ["prevent"]),
|
|
149
151
|
class: "btn btn-estilo rotate-180",
|
|
150
152
|
disabled: !C.value,
|
|
@@ -171,7 +173,7 @@ const se = Symbol("v-datatable-key"), zt = /* @__PURE__ */ K({
|
|
|
171
173
|
}, Oe = {
|
|
172
174
|
key: 1,
|
|
173
175
|
class: "dropdown-menu"
|
|
174
|
-
}, qe = ["onClick"],
|
|
176
|
+
}, qe = ["onClick"], Fe = /* @__PURE__ */ F({
|
|
175
177
|
__name: "SearchDatatable",
|
|
176
178
|
props: {
|
|
177
179
|
search: {},
|
|
@@ -181,10 +183,10 @@ const se = Symbol("v-datatable-key"), zt = /* @__PURE__ */ K({
|
|
|
181
183
|
},
|
|
182
184
|
emits: ["update:search", "update:filter", "search"],
|
|
183
185
|
setup(y, { emit: u }) {
|
|
184
|
-
const o = y, f = u, v =
|
|
186
|
+
const o = y, f = u, v = T({
|
|
185
187
|
get: () => o.search,
|
|
186
188
|
set: (l) => f("update:search", l)
|
|
187
|
-
}), C =
|
|
189
|
+
}), C = T({
|
|
188
190
|
get: () => o.filter,
|
|
189
191
|
set: (l) => f("update:filter", l)
|
|
190
192
|
});
|
|
@@ -207,9 +209,9 @@ const se = Symbol("v-datatable-key"), zt = /* @__PURE__ */ K({
|
|
|
207
209
|
}
|
|
208
210
|
return (l, d) => {
|
|
209
211
|
const k = ve("router-link");
|
|
210
|
-
return
|
|
211
|
-
y.item_use.includes(2) ? (
|
|
212
|
-
|
|
212
|
+
return n(), a("div", Ve, [
|
|
213
|
+
y.item_use.includes(2) ? (n(), a("a", je, [...d[3] || (d[3] = [
|
|
214
|
+
s("svg", {
|
|
213
215
|
xmlns: "http://www.w3.org/2000/svg",
|
|
214
216
|
class: "icon icon-tabler icon-tabler-filter",
|
|
215
217
|
width: "24",
|
|
@@ -221,16 +223,16 @@ const se = Symbol("v-datatable-key"), zt = /* @__PURE__ */ K({
|
|
|
221
223
|
"stroke-linecap": "round",
|
|
222
224
|
"stroke-linejoin": "round"
|
|
223
225
|
}, [
|
|
224
|
-
|
|
226
|
+
s("path", {
|
|
225
227
|
stroke: "none",
|
|
226
228
|
d: "M0 0h24v24H0z",
|
|
227
229
|
fill: "none"
|
|
228
230
|
}),
|
|
229
|
-
|
|
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" })
|
|
230
232
|
], -1)
|
|
231
233
|
])])) : b("", !0),
|
|
232
|
-
|
|
233
|
-
|
|
234
|
+
s("div", Be, [
|
|
235
|
+
ne(s("input", {
|
|
234
236
|
type: "text",
|
|
235
237
|
class: "form-control ms-1",
|
|
236
238
|
id: "inputSearchLaudos",
|
|
@@ -238,15 +240,15 @@ const se = Symbol("v-datatable-key"), zt = /* @__PURE__ */ K({
|
|
|
238
240
|
onKeyup: d[1] || (d[1] = he((c) => l.$emit("search"), ["enter"])),
|
|
239
241
|
placeholder: "Buscar..."
|
|
240
242
|
}, null, 544), [
|
|
241
|
-
[
|
|
243
|
+
[ae, v.value]
|
|
242
244
|
]),
|
|
243
|
-
v.value ? (
|
|
245
|
+
v.value ? (n(), a("span", {
|
|
244
246
|
key: 0,
|
|
245
247
|
onClick: d[2] || (d[2] = (c) => E()),
|
|
246
248
|
class: "inputClose",
|
|
247
249
|
title: "Limpar pesquisa"
|
|
248
250
|
}, [...d[4] || (d[4] = [
|
|
249
|
-
|
|
251
|
+
s("svg", {
|
|
250
252
|
xmlns: "http://www.w3.org/2000/svg",
|
|
251
253
|
width: "24",
|
|
252
254
|
height: "24",
|
|
@@ -258,16 +260,16 @@ const se = Symbol("v-datatable-key"), zt = /* @__PURE__ */ K({
|
|
|
258
260
|
"stroke-linejoin": "round",
|
|
259
261
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-x"
|
|
260
262
|
}, [
|
|
261
|
-
|
|
263
|
+
s("path", {
|
|
262
264
|
stroke: "none",
|
|
263
265
|
d: "M0 0h24v24H0z",
|
|
264
266
|
fill: "none"
|
|
265
267
|
}),
|
|
266
|
-
|
|
267
|
-
|
|
268
|
+
s("path", { d: "M18 6l-12 12" }),
|
|
269
|
+
s("path", { d: "M6 6l12 12" })
|
|
268
270
|
], -1)
|
|
269
|
-
])])) : (
|
|
270
|
-
|
|
271
|
+
])])) : (n(), a("span", Ie, [...d[5] || (d[5] = [
|
|
272
|
+
s("svg", {
|
|
271
273
|
xmlns: "http://www.w3.org/2000/svg",
|
|
272
274
|
width: "24",
|
|
273
275
|
height: "24",
|
|
@@ -279,19 +281,19 @@ const se = Symbol("v-datatable-key"), zt = /* @__PURE__ */ K({
|
|
|
279
281
|
"stroke-linejoin": "round",
|
|
280
282
|
class: "icon"
|
|
281
283
|
}, [
|
|
282
|
-
|
|
284
|
+
s("path", {
|
|
283
285
|
stroke: "none",
|
|
284
286
|
d: "M0 0h24v24H0z",
|
|
285
287
|
fill: "none"
|
|
286
288
|
}),
|
|
287
|
-
|
|
288
|
-
|
|
289
|
+
s("path", { d: "M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0" }),
|
|
290
|
+
s("path", { d: "M21 21l-6 -6" })
|
|
289
291
|
], -1)
|
|
290
292
|
])]))
|
|
291
293
|
]),
|
|
292
|
-
y.item_use.includes(2) ? (
|
|
293
|
-
(
|
|
294
|
-
"type" in c && c.type === 1 ? (
|
|
294
|
+
y.item_use.includes(2) ? (n(), a("div", Oe, [
|
|
295
|
+
(n(!0), a(M, null, z(o.list_filter, (c, $) => (n(), a(M, { key: $ }, [
|
|
296
|
+
"type" in c && c.type === 1 ? (n(), X(k, {
|
|
295
297
|
key: 0,
|
|
296
298
|
to: c?.to,
|
|
297
299
|
class: "dropdown-item cursor-pointer"
|
|
@@ -300,7 +302,7 @@ const se = Symbol("v-datatable-key"), zt = /* @__PURE__ */ K({
|
|
|
300
302
|
N(g(c.text), 1)
|
|
301
303
|
]),
|
|
302
304
|
_: 2
|
|
303
|
-
}, 1032, ["to"])) : !("type" in c) || c.type === 2 ? (
|
|
305
|
+
}, 1032, ["to"])) : !("type" in c) || c.type === 2 ? (n(), a("a", {
|
|
304
306
|
key: 1,
|
|
305
307
|
onClick: j((m) => A(String(c.value)), ["prevent"]),
|
|
306
308
|
class: _(["dropdown-item cursor-pointer", C.value === c?.value ? "bg-info text-dark selected" : ""])
|
|
@@ -310,9 +312,9 @@ const se = Symbol("v-datatable-key"), zt = /* @__PURE__ */ K({
|
|
|
310
312
|
]);
|
|
311
313
|
};
|
|
312
314
|
}
|
|
313
|
-
}),
|
|
314
|
-
function
|
|
315
|
-
const y =
|
|
315
|
+
}), Ke = /* @__PURE__ */ W(Fe, [["__scopeId", "data-v-1b6ff54b"]]);
|
|
316
|
+
function Ue() {
|
|
317
|
+
const y = P(!1), u = P(""), o = P(0), f = P(0), v = T(() => ({
|
|
316
318
|
position: "fixed",
|
|
317
319
|
zIndex: 9999,
|
|
318
320
|
pointerEvents: "none",
|
|
@@ -320,9 +322,9 @@ function Ye() {
|
|
|
320
322
|
left: `${o.value + 15}px`
|
|
321
323
|
}));
|
|
322
324
|
function C(d) {
|
|
323
|
-
const k = d.clientX, c = d.clientY,
|
|
325
|
+
const k = d.clientX, c = d.clientY, $ = window.innerHeight, m = 15, h = 300;
|
|
324
326
|
let x = c + m;
|
|
325
|
-
x + h >
|
|
327
|
+
x + h > $ && (x = c - h - m, x < 0 && (x = 0)), o.value = k, f.value = x;
|
|
326
328
|
}
|
|
327
329
|
function A(d, k) {
|
|
328
330
|
y.value = !0, u.value = k, C(d);
|
|
@@ -342,14 +344,14 @@ function Ye() {
|
|
|
342
344
|
handleMouseLeave: l
|
|
343
345
|
};
|
|
344
346
|
}
|
|
345
|
-
const
|
|
347
|
+
const Ye = { class: "d-flex justify-content-between align-items-start mb-2" }, Xe = { class: "text-secondary" }, We = { class: "mx-2 d-inline-block" }, Ge = {
|
|
346
348
|
key: 0,
|
|
347
349
|
class: "alert alert-cyan d-flex justify-content-center align-items-center py-3",
|
|
348
350
|
role: "alert"
|
|
349
351
|
}, Je = { class: "alert-title m-0" }, Qe = { key: 0 }, Ze = { key: 2 }, Re = {
|
|
350
352
|
key: 5,
|
|
351
353
|
class: "text-danger erro-custom-container"
|
|
352
|
-
}, et = { class: "badge bg-orange text-white erro-custom-text" }, tt = { key: 0 },
|
|
354
|
+
}, et = { class: "badge bg-orange text-white erro-custom-text" }, tt = { key: 0 }, nt = { key: 2 }, at = {
|
|
353
355
|
key: 5,
|
|
354
356
|
class: "text-danger erro-custom-container"
|
|
355
357
|
}, st = { class: "badge bg-orange text-white erro-custom-text" }, lt = ["colspan"], rt = {
|
|
@@ -374,19 +376,19 @@ const Fe = { class: "d-flex justify-content-between align-items-start mb-2" }, X
|
|
|
374
376
|
}, pt = {
|
|
375
377
|
key: 3,
|
|
376
378
|
class: "table-responsive"
|
|
377
|
-
},
|
|
379
|
+
}, _t = { key: 0 }, mt = {
|
|
378
380
|
key: 0,
|
|
379
381
|
class: "w-1"
|
|
380
382
|
}, ft = {
|
|
381
383
|
key: 0,
|
|
382
384
|
class: "w-1"
|
|
383
|
-
}, gt = ["checked", "onChange"], vt =
|
|
385
|
+
}, gt = ["checked", "onChange"], vt = ["onClick"], ht = ["onClick"], yt = { key: 0 }, kt = { key: 1 }, bt = ["onClick", "innerHTML"], xt = ["onClick"], wt = ["src"], Ct = ["src"], $t = {
|
|
384
386
|
key: 5,
|
|
385
387
|
class: "text-danger erro-custom-container"
|
|
386
|
-
},
|
|
388
|
+
}, St = { class: "badge bg-orange text-white erro-custom-text" }, Mt = {
|
|
387
389
|
key: 1,
|
|
388
390
|
class: "text-center p-4 text-secondary"
|
|
389
|
-
},
|
|
391
|
+
}, Pt = ["src"], zt = /* @__PURE__ */ F({
|
|
390
392
|
__name: "VDataTable",
|
|
391
393
|
props: {
|
|
392
394
|
fetch: {},
|
|
@@ -413,7 +415,8 @@ const Fe = { class: "d-flex justify-content-between align-items-start mb-2" }, X
|
|
|
413
415
|
retry_attempts: { default: 3 },
|
|
414
416
|
retry_delay: { default: 2e3 },
|
|
415
417
|
use_checkbox: { type: Boolean, default: !1 },
|
|
416
|
-
item_key: { default: "id" }
|
|
418
|
+
item_key: { default: "id" },
|
|
419
|
+
limit_per_page: { default: 5 }
|
|
417
420
|
},
|
|
418
421
|
setup(y, { expose: u }) {
|
|
419
422
|
const {
|
|
@@ -423,63 +426,63 @@ const Fe = { class: "d-flex justify-content-between align-items-start mb-2" }, X
|
|
|
423
426
|
handleMouseOver: C,
|
|
424
427
|
handleMouseMove: A,
|
|
425
428
|
handleMouseLeave: E
|
|
426
|
-
} =
|
|
429
|
+
} = Ue(), l = y, d = P(5), k = P([]), c = P([]), $ = P(0), m = P([]), h = P(null), x = P(!1), H = P(null), p = P({
|
|
427
430
|
current_page: 0,
|
|
428
431
|
// pagina atual
|
|
429
432
|
count: 0,
|
|
430
433
|
// total de itens
|
|
431
|
-
limit_per_page:
|
|
434
|
+
limit_per_page: l.limit_per_page,
|
|
432
435
|
// limite de itens por página
|
|
433
436
|
search: "",
|
|
434
437
|
// termo de busca
|
|
435
438
|
filter: ""
|
|
436
439
|
// filtro selecionado
|
|
437
|
-
}), { data: B, pending: le, error:
|
|
440
|
+
}), { data: B, pending: le, error: K, execute: re, attempt: V } = l.fetch(l.endpoint, {
|
|
438
441
|
params: () => l.deactivate_default_params ? l.add_params && typeof l.add_params == "function" ? l.add_params() : {
|
|
439
442
|
...l.add_params
|
|
440
443
|
} : l.add_params && typeof l.add_params == "function" ? {
|
|
441
|
-
...
|
|
444
|
+
...U.value,
|
|
442
445
|
...l.add_params()
|
|
443
446
|
} : {
|
|
444
|
-
...
|
|
447
|
+
...U.value,
|
|
445
448
|
...l.add_params
|
|
446
449
|
},
|
|
447
450
|
retry: l.retry_attempts,
|
|
448
451
|
retryDelay: l.retry_delay,
|
|
449
452
|
paramsReactives: !1,
|
|
450
453
|
immediate: !1
|
|
451
|
-
}, l.fetch_name), oe =
|
|
454
|
+
}, l.fetch_name), oe = T(() => {
|
|
452
455
|
let i = [1];
|
|
453
456
|
return l.list_filter.length > 0 && i.push(2), i;
|
|
454
|
-
}),
|
|
457
|
+
}), U = T(() => ({
|
|
455
458
|
[l.page_param_name]: p.value.current_page + 1,
|
|
456
459
|
[l.page_size_param_name]: p.value.limit_per_page,
|
|
457
460
|
[l.search_param_name]: p.value.search || "",
|
|
458
461
|
[l.filter_param_name]: p.value.filter || ""
|
|
459
|
-
})), ie =
|
|
460
|
-
const
|
|
461
|
-
return m.value.some((r) => r[
|
|
462
|
-
}, G =
|
|
462
|
+
})), ie = T(() => le.value || x.value), I = (i) => {
|
|
463
|
+
const t = l.item_key;
|
|
464
|
+
return m.value.some((r) => r[t] === i[t]);
|
|
465
|
+
}, G = T(() => {
|
|
463
466
|
if (!c.value.length) return !1;
|
|
464
|
-
const i = c.value.filter((
|
|
467
|
+
const i = c.value.filter((t) => I(t)).length;
|
|
465
468
|
return i === 0 ? !1 : i === c.value.length ? !0 : "indeterminate";
|
|
466
|
-
}), ue =
|
|
469
|
+
}), ue = T(() => m.value.length > 0);
|
|
467
470
|
q([G, h], ([i]) => {
|
|
468
471
|
h.value && (i === "indeterminate" ? (console.log("entrei no indeterminate"), h.value.checked = !1, h.value.indeterminate = !0) : (h.value.checked = i, h.value.indeterminate = !1));
|
|
469
472
|
}, {
|
|
470
473
|
immediate: !0,
|
|
471
474
|
flush: "post"
|
|
472
475
|
}), q(B, (i) => {
|
|
473
|
-
i ? (c.value = i[l.data_key] || [],
|
|
476
|
+
i ? (c.value = i[l.data_key] || [], $.value = i[l.total_key] || 0, p.value.count = $.value) : (c.value = [], $.value = 0);
|
|
474
477
|
}, { immediate: !0 });
|
|
475
478
|
function de() {
|
|
476
479
|
const i = c.value;
|
|
477
480
|
if (!i.length) return;
|
|
478
|
-
const
|
|
479
|
-
if (
|
|
480
|
-
const r = i.map((
|
|
481
|
+
const t = G.value;
|
|
482
|
+
if (t === !0 || t === "indeterminate") {
|
|
483
|
+
const r = i.map((e) => e[l.item_key]);
|
|
481
484
|
m.value = m.value.filter(
|
|
482
|
-
(
|
|
485
|
+
(e) => !r.includes(e[l.item_key])
|
|
483
486
|
);
|
|
484
487
|
} else
|
|
485
488
|
i.forEach((r) => {
|
|
@@ -487,7 +490,7 @@ const Fe = { class: "d-flex justify-content-between align-items-start mb-2" }, X
|
|
|
487
490
|
});
|
|
488
491
|
}
|
|
489
492
|
function ce(i) {
|
|
490
|
-
const
|
|
493
|
+
const t = l.item_key, r = m.value.findIndex((e) => e[t] === i[t]);
|
|
491
494
|
r > -1 ? m.value.splice(r, 1) : m.value.push(i);
|
|
492
495
|
}
|
|
493
496
|
function pe(i) {
|
|
@@ -499,221 +502,221 @@ const Fe = { class: "d-flex justify-content-between align-items-start mb-2" }, X
|
|
|
499
502
|
x.value = !1;
|
|
500
503
|
}, l.min_loading_delay), re();
|
|
501
504
|
}
|
|
502
|
-
function
|
|
505
|
+
function _e() {
|
|
503
506
|
p.value.current_page = 0, L();
|
|
504
507
|
}
|
|
505
508
|
const J = (i) => {
|
|
506
|
-
const
|
|
509
|
+
const t = i.target, r = parseInt(t.value, 10);
|
|
507
510
|
r > 0 ? (d.value = r, p.value.limit_per_page = r, p.value.current_page = 0, L()) : d.value = p.value.limit_per_page;
|
|
508
511
|
};
|
|
509
|
-
function D(i,
|
|
510
|
-
if (!i) return
|
|
511
|
-
const
|
|
512
|
-
let
|
|
513
|
-
for (const
|
|
514
|
-
|
|
515
|
-
return r && (
|
|
512
|
+
function D(i, t, r = null) {
|
|
513
|
+
if (!i) return t;
|
|
514
|
+
const e = i.split(".");
|
|
515
|
+
let S = t;
|
|
516
|
+
for (const Y of e)
|
|
517
|
+
S && typeof S == "object" && Y in S ? S = S[Y] : console.error(`Caminho inválido ou valor nulo em: ${i} na parte ${Y}`);
|
|
518
|
+
return r && (S = r(S)), S;
|
|
516
519
|
}
|
|
517
|
-
function
|
|
518
|
-
return
|
|
520
|
+
function me(i, t) {
|
|
521
|
+
return t && typeof t == "number" && t > 0 && typeof i == "string" && i.length > t ? i.substring(0, t) + "..." : i;
|
|
519
522
|
}
|
|
520
523
|
return u({
|
|
521
524
|
execute: L,
|
|
522
525
|
pagination: p,
|
|
523
|
-
default_params:
|
|
526
|
+
default_params: U,
|
|
524
527
|
selected_items: m,
|
|
525
528
|
atLeastOneSelected: ue
|
|
526
529
|
}), te(() => {
|
|
527
530
|
be(() => {
|
|
528
531
|
L();
|
|
529
532
|
});
|
|
530
|
-
}), (i,
|
|
531
|
-
|
|
533
|
+
}), (i, t) => (n(), a("div", null, [
|
|
534
|
+
s("div", {
|
|
532
535
|
class: _(["", l.class_container])
|
|
533
536
|
}, [
|
|
534
537
|
O(i.$slots, "default", {}, void 0, !0),
|
|
535
|
-
|
|
538
|
+
s("div", {
|
|
536
539
|
class: _(["", l.class_content])
|
|
537
540
|
}, [
|
|
538
|
-
|
|
541
|
+
s("div", Ye, [
|
|
539
542
|
O(i.$slots, "pageSize", {
|
|
540
543
|
changePageSize: J,
|
|
541
544
|
page_size: d.value
|
|
542
545
|
}, () => [
|
|
543
|
-
|
|
546
|
+
s("div", Xe, [
|
|
544
547
|
N(g(l.first_text_page_size) + " ", 1),
|
|
545
|
-
|
|
546
|
-
|
|
548
|
+
s("div", We, [
|
|
549
|
+
ne(s("input", {
|
|
547
550
|
class: "form-control form-control-sm",
|
|
548
551
|
onChange: J,
|
|
549
|
-
"onUpdate:modelValue":
|
|
552
|
+
"onUpdate:modelValue": t[0] || (t[0] = (r) => d.value = r),
|
|
550
553
|
min: "1",
|
|
551
554
|
size: "3",
|
|
552
555
|
"aria-label": "Número de nóticias por página"
|
|
553
556
|
}, null, 544), [
|
|
554
|
-
[
|
|
557
|
+
[ae, d.value]
|
|
555
558
|
])
|
|
556
559
|
]),
|
|
557
560
|
N(" " + g(l.second_text_page_size), 1)
|
|
558
561
|
])
|
|
559
562
|
], !0),
|
|
560
563
|
O(i.$slots, "fieldMiddle", {}, void 0, !0),
|
|
561
|
-
Q(
|
|
564
|
+
Q(Ke, {
|
|
562
565
|
search: p.value.search,
|
|
563
|
-
"onUpdate:search":
|
|
566
|
+
"onUpdate:search": t[1] || (t[1] = (r) => p.value.search = r),
|
|
564
567
|
filter: p.value.filter,
|
|
565
|
-
"onUpdate:filter":
|
|
568
|
+
"onUpdate:filter": t[2] || (t[2] = (r) => p.value.filter = r),
|
|
566
569
|
list_filter: l.list_filter,
|
|
567
570
|
item_use: oe.value,
|
|
568
|
-
onSearch:
|
|
571
|
+
onSearch: _e
|
|
569
572
|
}, null, 8, ["search", "filter", "list_filter", "item_use"])
|
|
570
573
|
]),
|
|
571
|
-
l.use_checkbox && m.value.length > 0 ? (
|
|
572
|
-
|
|
573
|
-
|
|
574
|
+
l.use_checkbox && m.value.length > 0 ? (n(), a("div", Ge, [
|
|
575
|
+
s("h4", Je, [
|
|
576
|
+
t[4] || (t[4] = s("strong", null, "Itens Selecionados:", -1)),
|
|
574
577
|
N(" " + g(m.value.length), 1)
|
|
575
578
|
]),
|
|
576
|
-
|
|
579
|
+
s("button", {
|
|
577
580
|
class: "btn btn-outline-danger ms-3 bold",
|
|
578
|
-
onClick:
|
|
581
|
+
onClick: t[3] || (t[3] = (r) => m.value = [])
|
|
579
582
|
}, "Limpar Seleção")
|
|
580
583
|
])) : b("", !0),
|
|
581
|
-
ie.value ? (
|
|
582
|
-
l.custom_loading ? (
|
|
584
|
+
ie.value ? (n(), a(M, { key: 1 }, [
|
|
585
|
+
l.custom_loading ? (n(), X(Z(l.custom_loading), { key: 0 })) : (n(), a("table", {
|
|
583
586
|
key: 1,
|
|
584
587
|
class: _(["table table-vcenter table-selectable", l.class_table])
|
|
585
588
|
}, [
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
(
|
|
589
|
+
s("thead", null, [
|
|
590
|
+
s("tr", null, [
|
|
591
|
+
(n(!0), a(M, null, z(k.value, (r) => (n(), a("th", {
|
|
589
592
|
key: r.field || r.header,
|
|
590
593
|
class: _(r.class_column)
|
|
591
594
|
}, g(r.header), 3))), 128))
|
|
592
595
|
])
|
|
593
596
|
]),
|
|
594
|
-
|
|
595
|
-
l.type_loading === "placeholder" ? (
|
|
597
|
+
s("tbody", null, [
|
|
598
|
+
l.type_loading === "placeholder" ? (n(!0), a(M, { key: 0 }, z(d.value, (r) => (n(), a("tr", {
|
|
596
599
|
key: "placeholder-" + r,
|
|
597
600
|
class: "placeholder-glow"
|
|
598
601
|
}, [
|
|
599
|
-
(
|
|
600
|
-
key:
|
|
601
|
-
class: _(
|
|
602
|
+
(n(!0), a(M, null, z(k.value, (e) => (n(), a("td", {
|
|
603
|
+
key: e.field || e.header,
|
|
604
|
+
class: _(e.class_row)
|
|
602
605
|
}, [
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
])])) :
|
|
606
|
+
e.bodySlot ? (n(), a("span", Qe, [...t[5] || (t[5] = [
|
|
607
|
+
s("span", { class: "placeholder col-8" }, null, -1)
|
|
608
|
+
])])) : e.type === "text" ? (n(), a("span", {
|
|
606
609
|
key: 1,
|
|
607
|
-
class: _(
|
|
608
|
-
}, [...
|
|
609
|
-
|
|
610
|
-
])], 2)) :
|
|
611
|
-
|
|
612
|
-
])])) :
|
|
610
|
+
class: _(e.class_item)
|
|
611
|
+
}, [...t[6] || (t[6] = [
|
|
612
|
+
s("span", { class: "placeholder col-8" }, null, -1)
|
|
613
|
+
])], 2)) : e.type === "date" ? (n(), a("span", Ze, [...t[7] || (t[7] = [
|
|
614
|
+
s("span", { class: "placeholder col-9" }, null, -1)
|
|
615
|
+
])])) : e.type === "html" ? (n(), a("div", {
|
|
613
616
|
key: 3,
|
|
614
|
-
class: _(
|
|
615
|
-
}, [...
|
|
616
|
-
|
|
617
|
-
])], 2)) :
|
|
617
|
+
class: _(e.class_item)
|
|
618
|
+
}, [...t[8] || (t[8] = [
|
|
619
|
+
s("div", { class: "placeholder col-12" }, null, -1)
|
|
620
|
+
])], 2)) : e.type === "img" ? (n(), a("div", {
|
|
618
621
|
key: 4,
|
|
619
|
-
class: _(
|
|
620
|
-
}, [...
|
|
621
|
-
|
|
622
|
-
])], 2)) : (
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
622
|
+
class: _(e.class_item)
|
|
623
|
+
}, [...t[9] || (t[9] = [
|
|
624
|
+
s("div", { class: "placeholder placeholder-img" }, null, -1)
|
|
625
|
+
])], 2)) : (n(), a("span", Re, [
|
|
626
|
+
t[10] || (t[10] = N("tipo ", -1)),
|
|
627
|
+
s("span", et, g(e.type), 1),
|
|
628
|
+
t[11] || (t[11] = N(" não suportado ", -1))
|
|
626
629
|
]))
|
|
627
630
|
], 2))), 128))
|
|
628
|
-
]))), 128)) : l.type_loading === "spiner-table" ? (
|
|
631
|
+
]))), 128)) : l.type_loading === "spiner-table" ? (n(!0), a(M, { key: 1 }, z(d.value, (r) => (n(), a("tr", {
|
|
629
632
|
key: "placeholder-" + r
|
|
630
633
|
}, [
|
|
631
|
-
(
|
|
632
|
-
key:
|
|
633
|
-
class: _(
|
|
634
|
+
(n(!0), a(M, null, z(k.value, (e) => (n(), a("td", {
|
|
635
|
+
key: e.field || e.header,
|
|
636
|
+
class: _(e.class_row)
|
|
634
637
|
}, [
|
|
635
|
-
|
|
636
|
-
|
|
638
|
+
e.bodySlot ? (n(), a("span", tt, [...t[12] || (t[12] = [
|
|
639
|
+
s("span", {
|
|
637
640
|
class: "spinner-border spinner-border-sm",
|
|
638
641
|
role: "status",
|
|
639
642
|
"aria-hidden": "true"
|
|
640
643
|
}, null, -1)
|
|
641
|
-
])])) :
|
|
644
|
+
])])) : e.type === "text" ? (n(), a("span", {
|
|
642
645
|
key: 1,
|
|
643
|
-
class: _(
|
|
644
|
-
}, [...
|
|
645
|
-
|
|
646
|
+
class: _(e.class_item)
|
|
647
|
+
}, [...t[13] || (t[13] = [
|
|
648
|
+
s("span", {
|
|
646
649
|
class: "spinner-border spinner-border-sm",
|
|
647
650
|
role: "status",
|
|
648
651
|
"aria-hidden": "true"
|
|
649
652
|
}, null, -1)
|
|
650
|
-
])], 2)) :
|
|
651
|
-
|
|
653
|
+
])], 2)) : e.type === "date" ? (n(), a("span", nt, [...t[14] || (t[14] = [
|
|
654
|
+
s("span", {
|
|
652
655
|
class: "spinner-border spinner-border-sm",
|
|
653
656
|
role: "status",
|
|
654
657
|
"aria-hidden": "true"
|
|
655
658
|
}, null, -1)
|
|
656
|
-
])])) :
|
|
659
|
+
])])) : e.type === "html" ? (n(), a("div", {
|
|
657
660
|
key: 3,
|
|
658
|
-
class: _(
|
|
659
|
-
}, [...
|
|
660
|
-
|
|
661
|
+
class: _(e.class_item)
|
|
662
|
+
}, [...t[15] || (t[15] = [
|
|
663
|
+
s("span", {
|
|
661
664
|
class: "spinner-border spinner-border-sm",
|
|
662
665
|
role: "status",
|
|
663
666
|
"aria-hidden": "true"
|
|
664
667
|
}, null, -1)
|
|
665
|
-
])], 2)) :
|
|
668
|
+
])], 2)) : e.type === "img" ? (n(), a("div", {
|
|
666
669
|
key: 4,
|
|
667
|
-
class: _(["",
|
|
668
|
-
}, [...
|
|
669
|
-
|
|
670
|
-
|
|
670
|
+
class: _(["", e.class_item])
|
|
671
|
+
}, [...t[16] || (t[16] = [
|
|
672
|
+
s("span", { class: "placeholder-img d-flex justify-content-center align-items-center" }, [
|
|
673
|
+
s("span", {
|
|
671
674
|
class: "spinner-border spinner-border-sm",
|
|
672
675
|
role: "status",
|
|
673
676
|
"aria-hidden": "true"
|
|
674
677
|
})
|
|
675
678
|
], -1)
|
|
676
|
-
])], 2)) : (
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
679
|
+
])], 2)) : (n(), a("span", at, [
|
|
680
|
+
t[17] || (t[17] = N("tipo ", -1)),
|
|
681
|
+
s("span", st, g(e.type), 1),
|
|
682
|
+
t[18] || (t[18] = N(" não suportado ", -1))
|
|
680
683
|
]))
|
|
681
684
|
], 2))), 128))
|
|
682
|
-
]))), 128)) : l.type_loading === "spiner" ? (
|
|
683
|
-
|
|
685
|
+
]))), 128)) : l.type_loading === "spiner" ? (n(!0), a(M, { key: 2 }, z(d.value, (r) => (n(), a("tr", { key: r }, [
|
|
686
|
+
s("td", {
|
|
684
687
|
colspan: k.value.length,
|
|
685
688
|
class: "text-center p-0",
|
|
686
689
|
style: { "border-bottom": "none" }
|
|
687
690
|
}, [
|
|
688
|
-
r === Math.floor(d.value / 2) + 1 ? (
|
|
689
|
-
|
|
691
|
+
r === Math.floor(d.value / 2) + 1 ? (n(), a("div", rt, [...t[19] || (t[19] = [
|
|
692
|
+
s("div", {
|
|
690
693
|
class: "spinner-border",
|
|
691
694
|
style: { width: "3rem", height: "3rem" },
|
|
692
695
|
role: "status"
|
|
693
696
|
}, null, -1),
|
|
694
|
-
|
|
695
|
-
])])) : (
|
|
697
|
+
s("span", { class: "mt-2" }, "Carregando...", -1)
|
|
698
|
+
])])) : (n(), a("div", ot))
|
|
696
699
|
], 8, lt)
|
|
697
700
|
]))), 128)) : b("", !0)
|
|
698
701
|
])
|
|
699
702
|
], 2)),
|
|
700
|
-
w(V) && w(V).current > 1 ? (
|
|
701
|
-
], 64)) : w(
|
|
702
|
-
|
|
703
|
-
w(V) ? (
|
|
704
|
-
|
|
703
|
+
w(V) && w(V).current > 1 ? (n(), a("div", it, " 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", ut, [
|
|
705
|
+
t[20] || (t[20] = s("h4", { class: "text-danger" }, "Ocorreu um Erro", -1)),
|
|
706
|
+
w(V) ? (n(), a("p", dt, " Não foi possível carregar os dados após " + g(w(V).total) + " tentativa(s). ", 1)) : (n(), a("p", ct, " Não foi possível carregar os dados. Verifique sua conexão. ")),
|
|
707
|
+
s("button", {
|
|
705
708
|
class: "btn btn-primary mt-2",
|
|
706
709
|
onClick: L
|
|
707
710
|
}, " Tentar Novamente ")
|
|
708
|
-
])) : c.value ? (
|
|
709
|
-
c.value.length > 0 ? (
|
|
710
|
-
|
|
711
|
+
])) : c.value ? (n(), a("div", pt, [
|
|
712
|
+
c.value.length > 0 ? (n(), a("div", _t, [
|
|
713
|
+
s("table", {
|
|
711
714
|
class: _(["table table-vcenter table-selectable", l.class_table])
|
|
712
715
|
}, [
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
l.use_checkbox ? (
|
|
716
|
-
|
|
716
|
+
s("thead", null, [
|
|
717
|
+
s("tr", null, [
|
|
718
|
+
l.use_checkbox ? (n(), a("th", mt, [
|
|
719
|
+
s("input", {
|
|
717
720
|
class: "form-check-input m-0",
|
|
718
721
|
type: "checkbox",
|
|
719
722
|
ref_key: "selectAllCheckbox",
|
|
@@ -722,82 +725,89 @@ const Fe = { class: "d-flex justify-content-between align-items-start mb-2" }, X
|
|
|
722
725
|
"aria-label": "Selecionar todos os itens na página"
|
|
723
726
|
}, null, 544)
|
|
724
727
|
])) : b("", !0),
|
|
725
|
-
(
|
|
728
|
+
(n(!0), a(M, null, z(k.value, (r) => (n(), a("th", {
|
|
726
729
|
key: r.field || r.header,
|
|
727
730
|
class: _(r.class_column)
|
|
728
731
|
}, g(r.header), 3))), 128))
|
|
729
732
|
])
|
|
730
733
|
]),
|
|
731
|
-
|
|
732
|
-
(
|
|
734
|
+
s("tbody", null, [
|
|
735
|
+
(n(!0), a(M, null, z(c.value, (r) => (n(), a("tr", {
|
|
733
736
|
key: r[l.item_key]
|
|
734
737
|
}, [
|
|
735
|
-
l.use_checkbox ? (
|
|
736
|
-
|
|
738
|
+
l.use_checkbox ? (n(), a("td", ft, [
|
|
739
|
+
s("input", {
|
|
737
740
|
class: "form-check-input m-0",
|
|
738
741
|
type: "checkbox",
|
|
739
742
|
checked: I(r),
|
|
740
|
-
onChange: (
|
|
743
|
+
onChange: (e) => ce(r),
|
|
741
744
|
"aria-label": "Selecionar este item"
|
|
742
745
|
}, null, 40, gt)
|
|
743
746
|
])) : b("", !0),
|
|
744
|
-
(
|
|
745
|
-
key:
|
|
746
|
-
class: _(
|
|
747
|
+
(n(!0), a(M, null, z(k.value, (e) => (n(), a("td", {
|
|
748
|
+
key: e.field || e.header,
|
|
749
|
+
class: _(e.class_row)
|
|
747
750
|
}, [
|
|
748
|
-
|
|
751
|
+
e.bodySlot ? (n(), X(Z(e.bodySlot), {
|
|
749
752
|
key: 0,
|
|
750
753
|
item: r,
|
|
751
754
|
"is-selected": I(r)
|
|
752
|
-
}, null, 8, ["item", "is-selected"])) :
|
|
755
|
+
}, null, 8, ["item", "is-selected"])) : e.type === "text" ? (n(), a("span", {
|
|
753
756
|
key: 1,
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
757
|
+
onClick: (S) => e.click ? e.click(r) : null,
|
|
758
|
+
class: _(e.class_item + (e.click ? " cursor-pointer" : ""))
|
|
759
|
+
}, g(me(D(e.field, r, e.transform_function), e.limite_text ?? null)), 11, vt)) : e.type === "date" ? (n(), a("span", {
|
|
760
|
+
key: 2,
|
|
761
|
+
onClick: (S) => e.click ? e.click(r) : null,
|
|
762
|
+
class: _(e.class_item + (e.click ? " cursor-pointer" : ""))
|
|
763
|
+
}, [
|
|
764
|
+
e.format === "complete" ? (n(), a("span", yt, g(new Date(D(e.field, r)).toLocaleString()), 1)) : b("", !0),
|
|
765
|
+
e.format === "simple" ? (n(), a("span", kt, g(new Date(D(
|
|
766
|
+
e.field,
|
|
759
767
|
r
|
|
760
768
|
)).toLocaleDateString()), 1)) : b("", !0)
|
|
761
|
-
])) :
|
|
769
|
+
], 10, ht)) : e.type === "html" ? (n(), a("div", {
|
|
762
770
|
key: 3,
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
771
|
+
onClick: (S) => e.click ? e.click(r) : null,
|
|
772
|
+
class: _(e.class_item + (e.click ? " cursor-pointer" : "")),
|
|
773
|
+
innerHTML: D(e.field, r)
|
|
774
|
+
}, null, 10, bt)) : e.type === "img" ? (n(), a("div", {
|
|
766
775
|
key: 4,
|
|
767
|
-
|
|
776
|
+
onClick: (S) => e.click ? e.click(r) : null,
|
|
777
|
+
class: _(e.class_item + (e.click ? " cursor-pointer" : ""))
|
|
768
778
|
}, [
|
|
769
|
-
D(
|
|
779
|
+
D(e.field, r) ? (n(), a("div", xe({
|
|
770
780
|
key: 0,
|
|
771
781
|
ref_for: !0
|
|
772
|
-
},
|
|
782
|
+
}, e.deactivate_img_preview ? {
|
|
773
783
|
class: "container-img"
|
|
774
784
|
} : {
|
|
775
|
-
onMouseover: (
|
|
785
|
+
onMouseover: (S) => w(C)(S, D(e.field, r)),
|
|
776
786
|
onMousemove: w(A),
|
|
777
787
|
onMouseleave: w(E),
|
|
778
788
|
class: "container-img container-img-preview"
|
|
779
789
|
}), [
|
|
780
|
-
|
|
790
|
+
s("img", {
|
|
781
791
|
class: "img-tamanho",
|
|
782
|
-
src: D(
|
|
783
|
-
}, null, 8,
|
|
784
|
-
|
|
792
|
+
src: D(e.field, r)
|
|
793
|
+
}, null, 8, wt),
|
|
794
|
+
s("img", {
|
|
785
795
|
class: "img-tamanho-cover",
|
|
786
|
-
src: D(
|
|
787
|
-
}, null, 8,
|
|
788
|
-
|
|
796
|
+
src: D(e.field, r)
|
|
797
|
+
}, null, 8, Ct),
|
|
798
|
+
t[21] || (t[21] = s("div", { class: "bg-img" }, null, -1))
|
|
789
799
|
], 16)) : b("", !0)
|
|
790
|
-
],
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
800
|
+
], 10, xt)) : (n(), a("span", $t, [
|
|
801
|
+
t[22] || (t[22] = N("tipo ", -1)),
|
|
802
|
+
s("span", St, g(e.type), 1),
|
|
803
|
+
t[23] || (t[23] = N(" não suportado", -1))
|
|
794
804
|
]))
|
|
795
805
|
], 2))), 128))
|
|
796
806
|
]))), 128))
|
|
797
807
|
])
|
|
798
808
|
], 2)
|
|
799
|
-
])) : (
|
|
800
|
-
|
|
809
|
+
])) : (n(), a("div", Mt, [...t[24] || (t[24] = [
|
|
810
|
+
s("p", { class: "m-0" }, "Nenhum item encontrado.", -1)
|
|
801
811
|
])]))
|
|
802
812
|
])) : b("", !0)
|
|
803
813
|
], 2)
|
|
@@ -805,9 +815,9 @@ const Fe = { class: "d-flex justify-content-between align-items-start mb-2" }, X
|
|
|
805
815
|
O(i.$slots, "pagination", {
|
|
806
816
|
pagination: p.value,
|
|
807
817
|
tradePage: L,
|
|
808
|
-
error: w(
|
|
818
|
+
error: w(K)
|
|
809
819
|
}, () => [
|
|
810
|
-
!w(
|
|
820
|
+
!w(K) && p.value.count > 0 ? (n(), a("div", {
|
|
811
821
|
key: 0,
|
|
812
822
|
class: _(["mt-3 px-3", l.class_pagination])
|
|
813
823
|
}, [
|
|
@@ -818,21 +828,21 @@ const Fe = { class: "d-flex justify-content-between align-items-start mb-2" }, X
|
|
|
818
828
|
}, null, 8, ["pagination"])
|
|
819
829
|
], 2)) : b("", !0)
|
|
820
830
|
], !0),
|
|
821
|
-
w(o) ? (
|
|
831
|
+
w(o) ? (n(), a("div", {
|
|
822
832
|
key: 0,
|
|
823
833
|
class: "image-preview-container",
|
|
824
834
|
style: we(w(v))
|
|
825
835
|
}, [
|
|
826
|
-
|
|
836
|
+
s("img", {
|
|
827
837
|
src: w(f),
|
|
828
838
|
alt: "Preview",
|
|
829
839
|
class: "image-preview-large"
|
|
830
|
-
}, null, 8,
|
|
840
|
+
}, null, 8, Pt)
|
|
831
841
|
], 4)) : b("", !0)
|
|
832
842
|
]));
|
|
833
843
|
}
|
|
834
|
-
}),
|
|
844
|
+
}), At = /* @__PURE__ */ W(zt, [["__scopeId", "data-v-d20778cd"]]);
|
|
835
845
|
export {
|
|
836
|
-
|
|
837
|
-
|
|
846
|
+
Nt as VColumn,
|
|
847
|
+
At as VDataTable
|
|
838
848
|
};
|
package/package.json
CHANGED
|
@@ -17,6 +17,7 @@ interface VColumnProps {
|
|
|
17
17
|
deactivate_img_preview?: boolean;
|
|
18
18
|
limite_text?: number | string | null;
|
|
19
19
|
transform_function?: ((value: any) => any) | null;
|
|
20
|
+
click?: Function | null;
|
|
20
21
|
}
|
|
21
22
|
const props = withDefaults(defineProps<VColumnProps>(), {
|
|
22
23
|
field: null,
|
|
@@ -41,6 +42,7 @@ const props = withDefaults(defineProps<VColumnProps>(), {
|
|
|
41
42
|
|
|
42
43
|
/* recebe função para alterar o que é mostrado */
|
|
43
44
|
transform_function: null ,
|
|
45
|
+
click: null,
|
|
44
46
|
});
|
|
45
47
|
|
|
46
48
|
const slots = useSlots();
|
|
@@ -83,6 +85,7 @@ onMounted(() => {
|
|
|
83
85
|
class_column: props.class_column,
|
|
84
86
|
class_row: props.class_row,
|
|
85
87
|
class_item: props.class_item,
|
|
88
|
+
click: props.click,
|
|
86
89
|
transform_function: props.transform_function,
|
|
87
90
|
|
|
88
91
|
bodySlot: slots.body,
|
|
@@ -8,8 +8,8 @@
|
|
|
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="page_size" min="1"
|
|
12
|
-
aria-label="Número de nóticias por página" />
|
|
11
|
+
<input class="form-control form-control-sm" @change="changePageSize" v-model="page_size" min="1"
|
|
12
|
+
size="3" aria-label="Número de nóticias por página" />
|
|
13
13
|
</div>
|
|
14
14
|
{{ props.second_text_page_size }}
|
|
15
15
|
</div>
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
<template v-if="props.type_loading === 'placeholder'">
|
|
46
46
|
<tr v-for="n in page_size" :key="'placeholder-' + n" class="placeholder-glow">
|
|
47
47
|
<td v-for="col in columns" :key="col.field || col.header" :class="col.class_row">
|
|
48
|
-
<span v-if="col.bodySlot"
|
|
48
|
+
<span v-if="col.bodySlot">
|
|
49
49
|
<span class="placeholder col-8"></span>
|
|
50
50
|
</span>
|
|
51
51
|
<span :class="col.class_item" v-else-if="col.type === 'text'">
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
<template v-else-if="props.type_loading === 'spiner-table'">
|
|
72
72
|
<tr v-for="n in page_size" :key="'placeholder-' + n">
|
|
73
73
|
<td v-for="col in columns" :key="col.field || col.header" :class="col.class_row">
|
|
74
|
-
<span v-if="col.bodySlot"
|
|
74
|
+
<span v-if="col.bodySlot">
|
|
75
75
|
<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
|
|
76
76
|
</span>
|
|
77
77
|
<span :class="col.class_item" v-else-if="col.type === 'text'">
|
|
@@ -153,22 +153,25 @@
|
|
|
153
153
|
</td>
|
|
154
154
|
<td v-for="col in columns" :key="col.field || col.header" :class="col.class_row">
|
|
155
155
|
<component v-if="col.bodySlot" :is="col.bodySlot" :item="item" :is-selected="isSelected(item)" />
|
|
156
|
-
<span
|
|
156
|
+
<span @click="col.click ? col.click(item) : null"
|
|
157
|
+
:class="col.class_item + (col.click ? ' cursor-pointer' : '') " v-else-if="col.type === 'text'">
|
|
157
158
|
{{
|
|
158
159
|
limiteText(getSubItem(col.field, item, col.transform_function), col.limite_text ?? null)
|
|
159
160
|
}}</span>
|
|
160
161
|
|
|
161
|
-
<span v-else-if="col.type === 'date'"
|
|
162
|
+
<span @click="col.click ? col.click(item) : null" v-else-if="col.type === 'date'"
|
|
163
|
+
:class="col.class_item + (col.click ? ' cursor-pointer' : '') "
|
|
164
|
+
>
|
|
162
165
|
<span v-if="col.format === 'complete'">{{ new Date(getSubItem(col.field, item)).toLocaleString()
|
|
163
|
-
|
|
166
|
+
}}</span>
|
|
164
167
|
<span v-if="col.format === 'simple'"> {{ new Date(getSubItem(col.field,
|
|
165
168
|
item)).toLocaleDateString()
|
|
166
|
-
|
|
169
|
+
}} </span>
|
|
167
170
|
</span>
|
|
168
|
-
<div :class="col.class_item" v-else-if="col.type === 'html'" v-html="getSubItem(col.field, item)">
|
|
171
|
+
<div @click="col.click ? col.click(item) : null" :class="col.class_item + (col.click ? ' cursor-pointer' : '') " v-else-if="col.type === 'html'" v-html="getSubItem(col.field, item)">
|
|
169
172
|
</div>
|
|
170
173
|
|
|
171
|
-
<div :class="col.class_item" v-else-if="col.type === 'img'">
|
|
174
|
+
<div @click="col.click ? col.click(item) : null" :class="col.class_item + (col.click ? ' cursor-pointer' : '') " v-else-if="col.type === 'img'">
|
|
172
175
|
|
|
173
176
|
<div v-if="getSubItem(col.field, item)" v-bind="col.deactivate_img_preview ? {
|
|
174
177
|
class: 'container-img'
|
|
@@ -193,9 +196,9 @@
|
|
|
193
196
|
</tbody>
|
|
194
197
|
</table>
|
|
195
198
|
</div>
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
+
<div v-else class="text-center p-4 text-secondary">
|
|
200
|
+
<p class="m-0">Nenhum item encontrado.</p>
|
|
201
|
+
</div>
|
|
199
202
|
</div>
|
|
200
203
|
|
|
201
204
|
</div>
|
|
@@ -215,7 +218,7 @@
|
|
|
215
218
|
|
|
216
219
|
</template>
|
|
217
220
|
|
|
218
|
-
<script setup lang="ts" generic="T extends Record<string, any>"
|
|
221
|
+
<script setup lang="ts" generic="T extends Record<string, any>">
|
|
219
222
|
import { ref, provide, computed, watch, onMounted, nextTick, type Component, type Ref, type ComputedRef } from 'vue';
|
|
220
223
|
|
|
221
224
|
import PaginationDatatable from './PaginationDatatable.vue';
|
|
@@ -223,13 +226,13 @@ import Search from './SearchDatatable.vue';
|
|
|
223
226
|
import { useImagePreview } from '../composables/useImagePreview';
|
|
224
227
|
import { dataTableApiKey, type ColumnConfiguration, type PaginationObject } from '../keys';
|
|
225
228
|
|
|
226
|
-
const {
|
|
227
|
-
isHovering,
|
|
228
|
-
previewSrc,
|
|
229
|
-
previewStyle,
|
|
230
|
-
handleMouseOver,
|
|
231
|
-
handleMouseMove,
|
|
232
|
-
handleMouseLeave
|
|
229
|
+
const {
|
|
230
|
+
isHovering,
|
|
231
|
+
previewSrc,
|
|
232
|
+
previewStyle,
|
|
233
|
+
handleMouseOver,
|
|
234
|
+
handleMouseMove,
|
|
235
|
+
handleMouseLeave
|
|
233
236
|
} = useImagePreview();
|
|
234
237
|
|
|
235
238
|
interface VDataTableProps {
|
|
@@ -284,6 +287,8 @@ interface VDataTableProps {
|
|
|
284
287
|
use_checkbox?: boolean;
|
|
285
288
|
// Define qual propriedade do item será usada como chave única para a seleção.
|
|
286
289
|
item_key?: string;
|
|
290
|
+
|
|
291
|
+
limit_per_page?: number;
|
|
287
292
|
}
|
|
288
293
|
|
|
289
294
|
interface ExposedFunctions {
|
|
@@ -321,6 +326,7 @@ const props = withDefaults(defineProps<VDataTableProps>(), {
|
|
|
321
326
|
item_key: 'id',
|
|
322
327
|
first_text_page_size: 'Mostrar',
|
|
323
328
|
second_text_page_size: 'registros',
|
|
329
|
+
limit_per_page: 5,
|
|
324
330
|
});
|
|
325
331
|
|
|
326
332
|
|
|
@@ -342,7 +348,7 @@ const delayTimer = ref<ReturnType<typeof setTimeout> | null>(null);
|
|
|
342
348
|
const pagination = ref<PaginationObject>({
|
|
343
349
|
current_page: 0, // pagina atual
|
|
344
350
|
count: 0, // total de itens
|
|
345
|
-
limit_per_page:
|
|
351
|
+
limit_per_page: props.limit_per_page, // limite de itens por página
|
|
346
352
|
search: '', // termo de busca
|
|
347
353
|
filter: '', // filtro selecionado
|
|
348
354
|
})
|
|
@@ -504,7 +510,7 @@ provide(dataTableApiKey, { addColumn });
|
|
|
504
510
|
// Função que gerencia o delay e a chamada da API
|
|
505
511
|
function fetchDataWithDelay(): void {
|
|
506
512
|
// Limpa timer anterior, se houver
|
|
507
|
-
if (delayTimer.value) clearTimeout(delayTimer.value);
|
|
513
|
+
if (delayTimer.value) clearTimeout(delayTimer.value);
|
|
508
514
|
|
|
509
515
|
isDelaying.value = true;
|
|
510
516
|
|
|
@@ -516,7 +522,7 @@ function fetchDataWithDelay(): void {
|
|
|
516
522
|
}
|
|
517
523
|
|
|
518
524
|
function reSearch(): void {
|
|
519
|
-
pagination.value.current_page = 0;
|
|
525
|
+
pagination.value.current_page = 0;
|
|
520
526
|
fetchDataWithDelay();
|
|
521
527
|
}
|
|
522
528
|
|
|
@@ -526,7 +532,7 @@ const changePageSize = (event: Event): void => {
|
|
|
526
532
|
if (newSize > 0) {
|
|
527
533
|
page_size.value = newSize;
|
|
528
534
|
pagination.value.limit_per_page = newSize; // Atualiza o limite de itens por página
|
|
529
|
-
pagination.value.current_page = 0;
|
|
535
|
+
pagination.value.current_page = 0;
|
|
530
536
|
fetchDataWithDelay();
|
|
531
537
|
} else {
|
|
532
538
|
// toast.showToast("Erro", "Tamanho da página deve ser maior que 0", 2);
|
|
@@ -539,15 +545,15 @@ function getSubItem(field: string | null, item: T, transform_function: ((value:
|
|
|
539
545
|
const parts = field.split('.');
|
|
540
546
|
let value_item = item;
|
|
541
547
|
|
|
542
|
-
for(const part of parts){
|
|
543
|
-
if (value_item && typeof value_item === 'object' && part in value_item){
|
|
548
|
+
for (const part of parts) {
|
|
549
|
+
if (value_item && typeof value_item === 'object' && part in value_item) {
|
|
544
550
|
value_item = value_item[part];
|
|
545
551
|
}
|
|
546
|
-
else{
|
|
552
|
+
else {
|
|
547
553
|
console.error(`Caminho inválido ou valor nulo em: ${field} na parte ${part}`);
|
|
548
554
|
}
|
|
549
555
|
}
|
|
550
|
-
|
|
556
|
+
|
|
551
557
|
if (transform_function) {
|
|
552
558
|
value_item = transform_function(value_item);
|
|
553
559
|
}
|
|
@@ -568,7 +574,7 @@ function limiteText(text: string | null, limite: number | null): string | null {
|
|
|
568
574
|
// =======================================================
|
|
569
575
|
|
|
570
576
|
defineExpose<
|
|
571
|
-
ExposedFunctions
|
|
577
|
+
ExposedFunctions
|
|
572
578
|
>({
|
|
573
579
|
execute: fetchDataWithDelay,
|
|
574
580
|
pagination,
|
package/src/DatatableVue/keys.ts
CHANGED