v-sistec-features 1.2.1 → 1.2.3

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