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