react-ecosistema-unp 2.0.0-pre.1 → 2.0.0-pre.5
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/assets/EcoDataTable.css +1 -1
- package/dist/lib/tables/eco-data-table/types.d.ts +5 -0
- package/dist/lib/tables/eco-data-table/utils/resultadoPaginaCursor.d.ts +7 -2
- package/dist/tables/eco-data-table/components/EcoDataTable/EcoDataTable.js +155 -134
- package/dist/tables/eco-data-table/utils/resultadoPaginaCursor.js +18 -8
- package/dist/utils/modal-radicados/AuxRadicadosComponents/fetchDocumentosProtecdoc.js +2 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
.eco-data-table{--eco-table-bg: #f9fafa;--eco-table-surface: #ffffff;--eco-table-text: #303d50;--eco-table-text-muted: #5a6c7d;--eco-table-border: rgba(48, 61, 80, .12);--eco-table-header-bg: #ffffff;--eco-table-header-border: #c9daf0;--eco-table-accent: #0a4b93;--eco-table-accent-deep: #003066;--eco-table-accent-soft: #e8f2fc;--eco-table-accent-selected: #dceaf8;--eco-table-row-hover: #f2f7fd;--eco-table-row-border: #edf2f7;--eco-table-scrollbar: #003066;--eco-table-scrollbar-hover: #0a4b93;display:flex;flex-direction:column;flex:1 1 auto;min-height:0;background:var(--eco-table-surface);border:1px solid var(--eco-table-border);border-radius:0;overflow:hidden}.eco-data-table--sticky{height:100%}.eco-data-table-selection-toolbar{display:flex;justify-content:flex-end;align-items:center;flex-shrink:0;padding:.65rem 1rem;background:var(--eco-table-surface);border-bottom:1px solid var(--eco-table-border)}.eco-data-table-selection-toolbar__actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:.5rem}.eco-data-table-body-wrap{flex:1 1 auto;min-height:0;overflow:auto;scrollbar-width:thin;scrollbar-color:var(--eco-table-scrollbar) transparent}.eco-data-table-body-content{position:relative;min-height:100%}.eco-data-table-body-wrap .table-responsive{overflow-x:visible;-webkit-overflow-scrolling:auto}.eco-data-table-body-wrap--sticky thead th{position:sticky;top:0;z-index:2}.eco-data-table-fetching-overlay{position:absolute;top:0;right:0;bottom:0;left:0;z-index:3;background:#f9fafac7;-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px);pointer-events:auto}.eco-data-table-fetching-overlay__message{position:absolute;left:0;right:0;top:0;display:flex;align-items:center;justify-content:center;width:100%;z-index:4;pointer-events:none}.eco-data-table-loading{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.75rem;min-height:220px;padding:2rem;color:var(--eco-table-text-muted);font-size:.9rem;font-weight:500;background:var(--eco-table-surface);border:1px solid var(--eco-table-border)}.eco-data-table-loading--compact{min-height:120px;padding:1rem}.eco-data-table-loading--overlay{min-height:0;padding:0;background:transparent;border:none;gap:.5rem;font-size:.875rem}.eco-data-table-loading__spinner{color:var(--eco-table-accent)!important}.eco-data-table-grid{width:100%;margin-bottom:0;border-collapse:separate;border-spacing:0}.eco-data-table-grid thead th{background:var(--eco-table-header-bg);color:var(--eco-table-text);font-weight:600;font-size:.82rem;text-transform:uppercase;letter-spacing:.04em;padding:12px 16px;border-bottom:1px solid var(--eco-table-header-border);white-space:nowrap;text-align:center;box-shadow:0 1px 0 var(--eco-table-row-border)}.eco-data-table-grid tbody td{padding:10px 16px;color:var(--eco-table-text);font-size:.92rem;border-bottom:1px solid var(--eco-table-row-border);vertical-align:middle;white-space:nowrap;text-align:center}.eco-data-table-grid tbody tr{transition:background-color .18s ease,box-shadow .18s ease}.eco-data-table-grid tbody tr:hover{background:var(--eco-table-row-hover)!important}.eco-data-table-grid tbody tr.eco-data-table-row--selected{background:var(--eco-table-accent-soft)!important;box-shadow:inset 4px 0 0 0 var(--eco-table-accent-deep)}.eco-data-table-grid tbody tr.eco-data-table-row--selected:hover{background:var(--eco-table-accent-selected)!important}.eco-data-table-grid tbody tr.eco-data-table-row--clickable{cursor:pointer}.eco-data-table-cell--no-padding{padding:0!important}.eco-data-table-cell--link{cursor:pointer;color:var(--eco-table-accent);font-weight:600}.eco-data-table-cell--link:hover{
|
|
1
|
+
.eco-data-table{--eco-table-bg: #f9fafa;--eco-table-surface: #ffffff;--eco-table-text: #303d50;--eco-table-text-muted: #5a6c7d;--eco-table-border: rgba(48, 61, 80, .12);--eco-table-header-bg: #ffffff;--eco-table-header-border: #c9daf0;--eco-table-accent: #0a4b93;--eco-table-accent-deep: #003066;--eco-table-accent-soft: #e8f2fc;--eco-table-accent-selected: #dceaf8;--eco-table-cell-interactive-hover: #c5dcf5;--eco-table-row-hover: #f2f7fd;--eco-table-row-border: #edf2f7;--eco-table-scrollbar: #003066;--eco-table-scrollbar-hover: #0a4b93;display:flex;flex-direction:column;flex:1 1 auto;min-height:0;background:var(--eco-table-surface);border:1px solid var(--eco-table-border);border-radius:0;overflow:hidden}.eco-data-table--sticky{height:100%}.eco-data-table-selection-toolbar{display:flex;justify-content:flex-end;align-items:center;flex-shrink:0;padding:.65rem 1rem;background:var(--eco-table-surface);border-bottom:1px solid var(--eco-table-border)}.eco-data-table-selection-toolbar__actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:.5rem}.eco-data-table-body-wrap{flex:1 1 auto;min-height:0;overflow:auto;scrollbar-width:thin;scrollbar-color:var(--eco-table-scrollbar) transparent}.eco-data-table-body-content{position:relative;min-height:100%}.eco-data-table-body-wrap .table-responsive{overflow-x:visible;-webkit-overflow-scrolling:auto}.eco-data-table-body-wrap--sticky thead th{position:sticky;top:0;z-index:2}.eco-data-table-fetching-overlay{position:absolute;top:0;right:0;bottom:0;left:0;z-index:3;background:#f9fafac7;-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px);pointer-events:auto}.eco-data-table-fetching-overlay__message{position:absolute;left:0;right:0;top:0;display:flex;align-items:center;justify-content:center;width:100%;z-index:4;pointer-events:none}.eco-data-table-loading{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.75rem;min-height:220px;padding:2rem;color:var(--eco-table-text-muted);font-size:.9rem;font-weight:500;background:var(--eco-table-surface);border:1px solid var(--eco-table-border)}.eco-data-table-loading--compact{min-height:120px;padding:1rem}.eco-data-table-loading--overlay{min-height:0;padding:0;background:transparent;border:none;gap:.5rem;font-size:.875rem}.eco-data-table-loading__spinner{color:var(--eco-table-accent)!important}.eco-data-table-grid{width:100%;margin-bottom:0;border-collapse:separate;border-spacing:0}.eco-data-table-grid thead th{background:var(--eco-table-header-bg);color:var(--eco-table-text);font-weight:600;font-size:.82rem;text-transform:uppercase;letter-spacing:.04em;padding:12px 16px;border-bottom:1px solid var(--eco-table-header-border);white-space:nowrap;text-align:center;box-shadow:0 1px 0 var(--eco-table-row-border)}.eco-data-table-grid tbody td{padding:10px 16px;color:var(--eco-table-text);font-size:.92rem;border-bottom:1px solid var(--eco-table-row-border);vertical-align:middle;white-space:nowrap;text-align:center}.eco-data-table-grid tbody tr{transition:background-color .18s ease,box-shadow .18s ease}.eco-data-table-grid tbody tr:hover>td{background:var(--eco-table-row-hover)!important;--bs-table-bg-state: var(--eco-table-row-hover);--bs-table-hover-bg: var(--eco-table-row-hover)}.eco-data-table-grid tbody tr.eco-data-table-row--selected>td{background:var(--eco-table-accent-soft)!important;--bs-table-bg-state: var(--eco-table-accent-soft);--bs-table-hover-bg: var(--eco-table-accent-selected);box-shadow:none}.eco-data-table-grid tbody tr.eco-data-table-row--selected>td:first-child{box-shadow:inset 4px 0 0 0 var(--eco-table-accent-deep)}.eco-data-table-grid tbody tr.eco-data-table-row--selected:hover>td{background:var(--eco-table-accent-selected)!important;--bs-table-bg-state: var(--eco-table-accent-selected);--bs-table-hover-bg: var(--eco-table-accent-selected)}.eco-data-table-grid tbody tr.eco-data-table-row--clickable{cursor:pointer}.eco-data-table-cell--no-padding{padding:0!important}.eco-data-table-cell--interactive,.eco-data-table-cell--link{cursor:pointer;transition:background-color .15s ease}.eco-data-table-cell--interactive .eco-data-table-cell__link-text,.eco-data-table-cell--link .eco-data-table-cell__link-text,.eco-data-table-cell--link{color:var(--eco-table-accent);font-weight:600;text-decoration:none}.eco-data-table-grid tbody tr:hover>td.eco-data-table-cell--interactive:hover,.eco-data-table-grid tbody tr:hover>td.eco-data-table-cell--link:hover,.eco-data-table-cell--interactive:hover,.eco-data-table-cell--link:hover{background:var(--eco-table-cell-interactive-hover)!important;--bs-table-bg-state: var(--eco-table-cell-interactive-hover);--bs-table-hover-bg: var(--eco-table-cell-interactive-hover)}.eco-data-table-grid tbody tr.eco-data-table-row--selected>td.eco-data-table-cell--interactive:hover,.eco-data-table-grid tbody tr.eco-data-table-row--selected>td.eco-data-table-cell--link:hover{background:#a8c8eb!important;--bs-table-bg-state: #a8c8eb;--bs-table-hover-bg: #a8c8eb}.eco-data-table-cell--bold{font-weight:600}.eco-data-table-select-cell{width:3.5rem;min-width:3.5rem;max-width:3.5rem;padding-left:14px!important;padding-right:14px!important;text-align:center;vertical-align:middle;cursor:pointer}.eco-data-table-select-cell:hover{background:var(--eco-table-accent-soft)!important}.eco-data-table-grid tbody tr.eco-data-table-row--selected>td.eco-data-table-select-cell:hover{background:var(--eco-table-accent-selected)!important}.eco-data-table-select-btn{display:inline-flex;align-items:center;justify-content:center;width:100%;min-height:1.5rem;padding:0;border:none;background:transparent;color:var(--eco-table-text-muted);cursor:pointer;font-size:1.1rem;line-height:1}.eco-data-table-select-btn:hover,.eco-data-table-select-btn.is-selected{color:var(--eco-table-accent)}.eco-data-table-priority-cell{width:5.5rem;white-space:nowrap}.eco-data-table-priority-actions{display:inline-flex;align-items:center;gap:.35rem}.eco-data-table-priority-btn{display:inline-flex;align-items:center;justify-content:center;width:1.65rem;height:1.65rem;padding:0;border:1px solid var(--eco-table-border);border-radius:6px;background:#fff;color:var(--eco-table-text);cursor:pointer}.eco-data-table-priority-btn:hover:not(:disabled){background:var(--eco-table-accent-soft);border-color:#7aa3d4}.eco-data-table-priority-btn:disabled{opacity:.4;cursor:not-allowed}.eco-data-table-empty{padding:2.5rem 1rem!important;color:var(--eco-table-text-muted);text-align:center}.eco-data-table-end-row:hover{background:transparent!important}.eco-data-table-end-row__cell{padding:.85rem 1rem!important;font-size:.8rem;font-weight:500;color:var(--eco-table-text-muted);text-align:center;background:var(--eco-table-bg);border-bottom:none!important}.eco-data-table-bandeja-footer{margin-top:auto}.eco-data-table-body-wrap::-webkit-scrollbar{width:4px;height:4px;-webkit-appearance:none;-moz-appearance:none;appearance:none}.eco-data-table-body-wrap::-webkit-scrollbar-track{background:transparent}.eco-data-table-body-wrap::-webkit-scrollbar-thumb{background-color:var(--eco-table-scrollbar);border-radius:999px;border:none;min-height:24px}.eco-data-table-body-wrap::-webkit-scrollbar-thumb:hover{background-color:var(--eco-table-scrollbar-hover)}.eco-data-table-body-wrap::-webkit-scrollbar-corner{background:transparent}.eco-data-table-body-wrap::-webkit-scrollbar-button,.eco-data-table-body-wrap::-webkit-scrollbar-button:single-button,.eco-data-table-body-wrap::-webkit-scrollbar-button:vertical:start:decrement,.eco-data-table-body-wrap::-webkit-scrollbar-button:vertical:end:increment,.eco-data-table-body-wrap::-webkit-scrollbar-button:horizontal:start:decrement,.eco-data-table-body-wrap::-webkit-scrollbar-button:horizontal:end:increment{display:none!important;width:0!important;height:0!important;background:transparent!important;border:none!important}
|
|
@@ -9,6 +9,11 @@ export interface EcoColumn<T extends object = Record<string, unknown>> {
|
|
|
9
9
|
pathname: string;
|
|
10
10
|
state?: unknown;
|
|
11
11
|
});
|
|
12
|
+
/**
|
|
13
|
+
* Click en toda la celda (p. ej. abrir modal).
|
|
14
|
+
* Aplica el mismo tratamiento visual que `redirectTo`: texto azul + hover de casilla.
|
|
15
|
+
*/
|
|
16
|
+
onCellClick?: (row: T) => void;
|
|
12
17
|
}
|
|
13
18
|
export type EcoSelectionMode = "single" | "multi";
|
|
14
19
|
export interface EcoRowSelectionConfig<T extends object> {
|
|
@@ -4,5 +4,10 @@ export interface ResultadoPaginaCursor<T> {
|
|
|
4
4
|
totalCount?: number;
|
|
5
5
|
nextCursor: string | null;
|
|
6
6
|
}
|
|
7
|
-
/**
|
|
8
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Paginación por número de página (`cursor` = `"2"`, `"3"`, …).
|
|
9
|
+
*
|
|
10
|
+
* - Respuesta DRF (`results` / `next` / `count`): respeta la página del servidor.
|
|
11
|
+
* - Arreglo plano (API sin paginar): reparte en cliente con `pageSize`.
|
|
12
|
+
*/
|
|
13
|
+
export declare function paginaDesdeNumero<T>(body: unknown, mapItem: (item: unknown) => T, paginaActual: number, pageSize?: number): ResultadoPaginaCursor<T>;
|
|
@@ -1,150 +1,161 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { j as
|
|
4
|
-
import { T as
|
|
5
|
-
import { useNavigate as
|
|
6
|
-
import { useEcoTablePagination as
|
|
7
|
-
import { useEcoTableReorder as
|
|
8
|
-
import { useEcoTableSelection as
|
|
9
|
-
import { defaultRowKey as
|
|
10
|
-
import { formatCellValue as
|
|
11
|
-
import { formatEcoDate as
|
|
12
|
-
import { EcoDataTableBandejaFooter as
|
|
13
|
-
import { EcoDataTableLoading as
|
|
14
|
-
import { EcoDataTableSelectionToolbar as
|
|
15
|
-
import { T as
|
|
16
|
-
import '../../../../assets/EcoDataTable.css';function
|
|
17
|
-
const
|
|
18
|
-
return
|
|
1
|
+
import { jsx as e, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as de, useState as M, useLayoutEffect as be, useMemo as me, useCallback as he } from "react";
|
|
3
|
+
import { j as pe, k as fe, l as ue } from "../../../../index-C4MBu_wk.js";
|
|
4
|
+
import { T as ye } from "../../../../index-BX37Bvqw.js";
|
|
5
|
+
import { useNavigate as ve } from "react-router-dom";
|
|
6
|
+
import { useEcoTablePagination as ge } from "../../hooks/useEcoTablePagination.js";
|
|
7
|
+
import { useEcoTableReorder as Ce } from "../../hooks/useEcoTableReorder.js";
|
|
8
|
+
import { useEcoTableSelection as Ne } from "../../hooks/useEcoTableSelection.js";
|
|
9
|
+
import { defaultRowKey as Te, resolveSelectionKey as ke } from "../../utils/defaultRowKey.js";
|
|
10
|
+
import { formatCellValue as Se } from "../../utils/formatCellValue.js";
|
|
11
|
+
import { formatEcoDate as Pe } from "../../utils/formatEcoDate.js";
|
|
12
|
+
import { EcoDataTableBandejaFooter as Ee } from "../EcoDataTableBandejaFooter.js";
|
|
13
|
+
import { EcoDataTableLoading as H } from "../EcoDataTableLoading.js";
|
|
14
|
+
import { EcoDataTableSelectionToolbar as De } from "../EcoDataTableSelectionToolbar.js";
|
|
15
|
+
import { T as we } from "../../../../Table-cUZFLrPi.js";
|
|
16
|
+
import '../../../../assets/EcoDataTable.css';function I(b, s) {
|
|
17
|
+
const h = b[s.key];
|
|
18
|
+
return s.renderComponent ? s.renderComponent(b) : s.isDate ? Pe(h) : Se(h);
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
columns:
|
|
22
|
-
data:
|
|
23
|
-
isLoading:
|
|
24
|
-
isFetching:
|
|
20
|
+
function Ae({
|
|
21
|
+
columns: b,
|
|
22
|
+
data: s,
|
|
23
|
+
isLoading: h = !1,
|
|
24
|
+
isFetching: k = !1,
|
|
25
25
|
stickyHeader: S = !0,
|
|
26
|
-
className:
|
|
27
|
-
pageSize:
|
|
28
|
-
getRowStyle:
|
|
29
|
-
getRowKey:
|
|
30
|
-
pagination:
|
|
31
|
-
selection:
|
|
32
|
-
reorder:
|
|
33
|
-
selectionActions:
|
|
26
|
+
className: O = "",
|
|
27
|
+
pageSize: V = 10,
|
|
28
|
+
getRowStyle: P,
|
|
29
|
+
getRowKey: $ = Te,
|
|
30
|
+
pagination: c,
|
|
31
|
+
selection: A,
|
|
32
|
+
reorder: U,
|
|
33
|
+
selectionActions: E,
|
|
34
34
|
onRowClick: f
|
|
35
35
|
}) {
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
const t =
|
|
36
|
+
const v = ve(), D = (c == null ? void 0 : c.pageSize) ?? V, w = de(null), [B, W] = M(0), [q, G] = M(0);
|
|
37
|
+
be(() => {
|
|
38
|
+
const t = w.current;
|
|
39
39
|
if (!t) return;
|
|
40
|
-
const
|
|
41
|
-
|
|
40
|
+
const o = () => {
|
|
41
|
+
W(t.clientHeight), G(t.scrollTop);
|
|
42
42
|
};
|
|
43
|
-
|
|
44
|
-
const
|
|
45
|
-
return
|
|
46
|
-
|
|
43
|
+
o();
|
|
44
|
+
const r = new ResizeObserver(o);
|
|
45
|
+
return r.observe(t), t.addEventListener("scroll", o, { passive: !0 }), () => {
|
|
46
|
+
r.disconnect(), t.removeEventListener("scroll", o);
|
|
47
47
|
};
|
|
48
|
-
}, [
|
|
48
|
+
}, [h, k]);
|
|
49
49
|
const {
|
|
50
|
-
selectionKey:
|
|
51
|
-
selectedKeys:
|
|
52
|
-
toggleKey:
|
|
53
|
-
isSelected:
|
|
50
|
+
selectionKey: K,
|
|
51
|
+
selectedKeys: J,
|
|
52
|
+
toggleKey: j,
|
|
53
|
+
isSelected: Q,
|
|
54
54
|
hasSelection: u
|
|
55
|
-
} =
|
|
56
|
-
data:
|
|
57
|
-
reorder:
|
|
58
|
-
selectionKey:
|
|
59
|
-
selectedKeys:
|
|
60
|
-
}),
|
|
61
|
-
currentPage:
|
|
62
|
-
totalPages:
|
|
63
|
-
effectiveTotal:
|
|
64
|
-
isLastPage:
|
|
65
|
-
paginatedData:
|
|
66
|
-
handlePageChange:
|
|
67
|
-
serverMode:
|
|
68
|
-
} =
|
|
69
|
-
dataLength:
|
|
70
|
-
pageSize:
|
|
71
|
-
pagination:
|
|
72
|
-
}),
|
|
73
|
-
(t,
|
|
74
|
-
if (!
|
|
75
|
-
const
|
|
76
|
-
typeof
|
|
55
|
+
} = Ne({ data: s, selection: A }), { enabled: R, priorityKey: X, orderedData: Y, moveSelected: _ } = Ce({
|
|
56
|
+
data: s,
|
|
57
|
+
reorder: U,
|
|
58
|
+
selectionKey: K,
|
|
59
|
+
selectedKeys: J
|
|
60
|
+
}), p = R ? Y : s, {
|
|
61
|
+
currentPage: Z,
|
|
62
|
+
totalPages: ee,
|
|
63
|
+
effectiveTotal: te,
|
|
64
|
+
isLastPage: ae,
|
|
65
|
+
paginatedData: n,
|
|
66
|
+
handlePageChange: re,
|
|
67
|
+
serverMode: g
|
|
68
|
+
} = ge({
|
|
69
|
+
dataLength: p.length,
|
|
70
|
+
pageSize: D,
|
|
71
|
+
pagination: c
|
|
72
|
+
}), C = me(() => g || !n ? p : p.slice(n.start, n.end), [p, n, g]), oe = u && !!E, N = R, x = b.length + (u ? 1 : 0) + (N ? 1 : 0), le = ae && C.length > 0, se = he(
|
|
73
|
+
(t, o) => {
|
|
74
|
+
if (!o.redirectTo) return;
|
|
75
|
+
const r = o.redirectTo(t);
|
|
76
|
+
typeof r == "string" ? v(r) : v(r.pathname, { state: r.state });
|
|
77
77
|
},
|
|
78
|
-
[
|
|
78
|
+
[v]
|
|
79
79
|
);
|
|
80
|
-
if (
|
|
81
|
-
return /* @__PURE__ */ e(
|
|
82
|
-
const
|
|
80
|
+
if (h)
|
|
81
|
+
return /* @__PURE__ */ e(H, {});
|
|
82
|
+
const ce = [
|
|
83
83
|
"eco-data-table",
|
|
84
84
|
S ? "eco-data-table--sticky" : "",
|
|
85
|
-
|
|
85
|
+
O
|
|
86
86
|
].filter(Boolean).join(" ");
|
|
87
|
-
return /* @__PURE__ */
|
|
88
|
-
|
|
87
|
+
return /* @__PURE__ */ d("div", { className: ce, children: [
|
|
88
|
+
oe && /* @__PURE__ */ e(De, { children: E }),
|
|
89
89
|
/* @__PURE__ */ e(
|
|
90
90
|
"div",
|
|
91
91
|
{
|
|
92
|
-
ref:
|
|
92
|
+
ref: w,
|
|
93
93
|
className: `eco-data-table-body-wrap${S ? " eco-data-table-body-wrap--sticky" : ""}`,
|
|
94
|
-
children: /* @__PURE__ */
|
|
95
|
-
|
|
94
|
+
children: /* @__PURE__ */ d("div", { className: "eco-data-table-body-content", children: [
|
|
95
|
+
k && /* @__PURE__ */ e("div", { className: "eco-data-table-fetching-overlay", "aria-hidden": "true", children: /* @__PURE__ */ e(
|
|
96
96
|
"div",
|
|
97
97
|
{
|
|
98
98
|
className: "eco-data-table-fetching-overlay__message",
|
|
99
|
-
style:
|
|
100
|
-
children: /* @__PURE__ */ e(
|
|
99
|
+
style: B > 0 ? { top: q, height: B } : void 0,
|
|
100
|
+
children: /* @__PURE__ */ e(H, { label: "Cargando registros…", overlay: !0 })
|
|
101
101
|
}
|
|
102
102
|
) }),
|
|
103
|
-
/* @__PURE__ */
|
|
104
|
-
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */
|
|
103
|
+
/* @__PURE__ */ d(we, { className: "eco-data-table-grid", borderless: !0, hover: !0, children: [
|
|
104
|
+
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ d("tr", { children: [
|
|
105
105
|
u && /* @__PURE__ */ e("th", { className: "eco-data-table-select-cell", "aria-label": "Selección" }),
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
N && /* @__PURE__ */ e("th", { className: "eco-data-table-priority-cell", children: "Prioridad" }),
|
|
107
|
+
b.map((t) => /* @__PURE__ */ e("th", { children: t.label }, t.key))
|
|
108
108
|
] }) }),
|
|
109
|
-
/* @__PURE__ */
|
|
110
|
-
|
|
111
|
-
const
|
|
112
|
-
...
|
|
113
|
-
},
|
|
114
|
-
return /* @__PURE__ */
|
|
109
|
+
/* @__PURE__ */ d("tbody", { children: [
|
|
110
|
+
C.length > 0 ? C.map((t, o) => {
|
|
111
|
+
const r = g ? o : ((n == null ? void 0 : n.start) ?? 0) + o, ne = $(t, r), T = ke(t, r, K), i = Q(T), ie = {
|
|
112
|
+
...P ? P(t) : {}
|
|
113
|
+
}, z = !!f;
|
|
114
|
+
return /* @__PURE__ */ d(
|
|
115
115
|
"tr",
|
|
116
116
|
{
|
|
117
117
|
className: [
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
i ? "eco-data-table-row--selected" : "",
|
|
119
|
+
z ? "eco-data-table-row--clickable" : ""
|
|
120
120
|
].filter(Boolean).join(" ") || void 0,
|
|
121
|
-
style:
|
|
122
|
-
onClick:
|
|
123
|
-
|
|
121
|
+
style: ie,
|
|
122
|
+
onClick: z ? (a) => {
|
|
123
|
+
a.target.closest("button, a, [role='link']") || f == null || f(t);
|
|
124
124
|
} : void 0,
|
|
125
125
|
children: [
|
|
126
|
-
u && /* @__PURE__ */ e(
|
|
127
|
-
"
|
|
126
|
+
u && /* @__PURE__ */ e(
|
|
127
|
+
"td",
|
|
128
128
|
{
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
129
|
+
className: "eco-data-table-select-cell",
|
|
130
|
+
onClick: (a) => {
|
|
131
|
+
a.stopPropagation(), j(T);
|
|
132
|
+
},
|
|
133
|
+
children: /* @__PURE__ */ e(
|
|
134
|
+
"button",
|
|
135
|
+
{
|
|
136
|
+
type: "button",
|
|
137
|
+
className: `eco-data-table-select-btn${i ? " is-selected" : ""}`,
|
|
138
|
+
onClick: (a) => {
|
|
139
|
+
a.stopPropagation(), j(T);
|
|
140
|
+
},
|
|
141
|
+
"aria-pressed": i,
|
|
142
|
+
"aria-label": i ? "Deseleccionar fila" : "Seleccionar fila",
|
|
143
|
+
children: i ? /* @__PURE__ */ e(pe, {}) : /* @__PURE__ */ e(ye, {})
|
|
144
|
+
}
|
|
145
|
+
)
|
|
135
146
|
}
|
|
136
|
-
)
|
|
137
|
-
|
|
138
|
-
/* @__PURE__ */ e("span", { children: String(t[
|
|
147
|
+
),
|
|
148
|
+
N && /* @__PURE__ */ e("td", { className: "eco-data-table-priority-cell", children: /* @__PURE__ */ d("div", { className: "eco-data-table-priority-actions", children: [
|
|
149
|
+
/* @__PURE__ */ e("span", { children: String(t[X] ?? r + 1) }),
|
|
139
150
|
/* @__PURE__ */ e(
|
|
140
151
|
"button",
|
|
141
152
|
{
|
|
142
153
|
type: "button",
|
|
143
154
|
className: "eco-data-table-priority-btn",
|
|
144
|
-
disabled: !
|
|
145
|
-
onClick: () =>
|
|
155
|
+
disabled: !i,
|
|
156
|
+
onClick: () => _("up"),
|
|
146
157
|
"aria-label": "Subir prioridad",
|
|
147
|
-
children: /* @__PURE__ */ e(
|
|
158
|
+
children: /* @__PURE__ */ e(fe, {})
|
|
148
159
|
}
|
|
149
160
|
),
|
|
150
161
|
/* @__PURE__ */ e(
|
|
@@ -152,58 +163,68 @@ function Ve({
|
|
|
152
163
|
{
|
|
153
164
|
type: "button",
|
|
154
165
|
className: "eco-data-table-priority-btn",
|
|
155
|
-
disabled: !
|
|
156
|
-
onClick: () =>
|
|
166
|
+
disabled: !i,
|
|
167
|
+
onClick: () => _("down"),
|
|
157
168
|
"aria-label": "Bajar prioridad",
|
|
158
|
-
children: /* @__PURE__ */ e(
|
|
169
|
+
children: /* @__PURE__ */ e(ue, {})
|
|
159
170
|
}
|
|
160
171
|
)
|
|
161
172
|
] }) }),
|
|
162
|
-
|
|
163
|
-
const
|
|
173
|
+
b.map((a) => {
|
|
174
|
+
const y = !!a.redirectTo, L = !!a.onCellClick, m = y || L, F = () => {
|
|
175
|
+
var l;
|
|
176
|
+
if (L) {
|
|
177
|
+
(l = a.onCellClick) == null || l.call(a, t);
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
y && se(t, a);
|
|
181
|
+
};
|
|
164
182
|
return /* @__PURE__ */ e(
|
|
165
183
|
"td",
|
|
166
184
|
{
|
|
167
185
|
className: [
|
|
168
|
-
|
|
169
|
-
|
|
186
|
+
a.noPadding ? "eco-data-table-cell--no-padding" : "",
|
|
187
|
+
m ? "eco-data-table-cell--interactive" : "",
|
|
188
|
+
y ? "eco-data-table-cell--link" : ""
|
|
170
189
|
].filter(Boolean).join(" "),
|
|
171
|
-
onClick:
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
190
|
+
onClick: m ? (l) => {
|
|
191
|
+
l.stopPropagation(), F();
|
|
192
|
+
} : void 0,
|
|
193
|
+
role: m ? "link" : void 0,
|
|
194
|
+
tabIndex: m ? 0 : void 0,
|
|
195
|
+
onKeyDown: m ? (l) => {
|
|
196
|
+
(l.key === "Enter" || l.key === " ") && (l.preventDefault(), l.stopPropagation(), F());
|
|
176
197
|
} : void 0,
|
|
177
|
-
children:
|
|
198
|
+
children: m ? /* @__PURE__ */ e("span", { className: "eco-data-table-cell__link-text", children: I(t, a) }) : I(t, a)
|
|
178
199
|
},
|
|
179
|
-
|
|
200
|
+
a.key
|
|
180
201
|
);
|
|
181
202
|
})
|
|
182
203
|
]
|
|
183
204
|
},
|
|
184
|
-
|
|
205
|
+
ne
|
|
185
206
|
);
|
|
186
|
-
}) : /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan:
|
|
187
|
-
|
|
207
|
+
}) : /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: x, className: "eco-data-table-empty", children: "No se encontraron registros para mostrar." }) }),
|
|
208
|
+
le ? /* @__PURE__ */ e("tr", { className: "eco-data-table-end-row", children: /* @__PURE__ */ e("td", { colSpan: x, className: "eco-data-table-end-row__cell", role: "status", children: "No hay más registros" }) }) : null
|
|
188
209
|
] })
|
|
189
210
|
] })
|
|
190
211
|
] })
|
|
191
212
|
}
|
|
192
213
|
),
|
|
193
214
|
/* @__PURE__ */ e(
|
|
194
|
-
|
|
215
|
+
Ee,
|
|
195
216
|
{
|
|
196
|
-
currentPage:
|
|
197
|
-
totalPages:
|
|
198
|
-
onPageChange:
|
|
199
|
-
totalRecords:
|
|
200
|
-
pageSize:
|
|
201
|
-
hasMore:
|
|
202
|
-
showPagination: !!
|
|
217
|
+
currentPage: Z,
|
|
218
|
+
totalPages: ee,
|
|
219
|
+
onPageChange: re,
|
|
220
|
+
totalRecords: te,
|
|
221
|
+
pageSize: D,
|
|
222
|
+
hasMore: c == null ? void 0 : c.hasMore,
|
|
223
|
+
showPagination: !!c
|
|
203
224
|
}
|
|
204
225
|
)
|
|
205
226
|
] });
|
|
206
227
|
}
|
|
207
228
|
export {
|
|
208
|
-
|
|
229
|
+
Ae as EcoDataTable
|
|
209
230
|
};
|
|
@@ -1,11 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
function A(
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { TAMANIO_PAGINA_ESTIMADO as c, extraerResultadoPaginado as M } from "./respuestaPaginadaApi.js";
|
|
2
|
+
function A(t, a, n, u = c) {
|
|
3
|
+
const r = Math.max(1, u);
|
|
4
|
+
if (Array.isArray(t)) {
|
|
5
|
+
const e = t.map(a), o = (Math.max(1, n) - 1) * r, h = e.slice(o, o + r), i = o + r < e.length;
|
|
6
|
+
return {
|
|
7
|
+
items: h,
|
|
8
|
+
hasMore: i,
|
|
9
|
+
totalCount: e.length,
|
|
10
|
+
nextCursor: i ? String(n + 1) : null
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
const l = M(t, a);
|
|
14
|
+
let s = l.hasMore;
|
|
15
|
+
return !s && t && typeof t == "object" && Array.isArray(t.results) && !("next" in t) && (s = t.results.length >= r), {
|
|
16
|
+
...l,
|
|
17
|
+
hasMore: s,
|
|
18
|
+
nextCursor: s ? String(n + 1) : null
|
|
9
19
|
};
|
|
10
20
|
}
|
|
11
21
|
export {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getUserToken as c } from "../../../auth/services/User.js";
|
|
2
2
|
const n = () => `${window.location.protocol}//${window.location.host}/api-gateway/`, d = async (e, t = "v1") => {
|
|
3
|
-
t = "
|
|
3
|
+
t = "v2";
|
|
4
4
|
const r = `${n()}protecdoc/${t}/documentos/?nro_radicado=${encodeURIComponent(e)}`, o = await fetch(r, {
|
|
5
5
|
headers: { Authorization: `Bearer ${c()}` }
|
|
6
6
|
});
|
|
@@ -8,7 +8,7 @@ const n = () => `${window.location.protocol}//${window.location.host}/api-gatewa
|
|
|
8
8
|
const a = await o.json();
|
|
9
9
|
return Array.isArray(a.documentos) ? a.documentos : [];
|
|
10
10
|
}, i = async (e, t = "v1") => {
|
|
11
|
-
t = "
|
|
11
|
+
t = "v2";
|
|
12
12
|
const r = `${n()}protecdoc/${t}/documentos/descargar/?id_documento=${encodeURIComponent(e)}`, o = await fetch(r, {
|
|
13
13
|
headers: { Authorization: `Bearer ${c()}` }
|
|
14
14
|
});
|