@grafosoft/excel-validator 1.1.5 → 1.1.7
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.
|
@@ -61,8 +61,8 @@ const ExcelPreview = ({ initData, fileContent, matrix, error, validationErrors,
|
|
|
61
61
|
targetCell.focus();
|
|
62
62
|
});
|
|
63
63
|
}, [focusTarget, effectivePage]);
|
|
64
|
-
return ((0, jsx_runtime_1.jsxs)("section", { className: "h-full border-none md:border-r border-
|
|
65
|
-
`Columna ${columnIndex + 1}` }, `header-${columnIndex}`))) }) }), (0, jsx_runtime_1.jsx)("tbody", { className: "bg-
|
|
64
|
+
return ((0, jsx_runtime_1.jsxs)("section", { className: "h-full border-none bg-white px-4 py-2 text-gray-800 md:border-r md:border-gray-200 dark:bg-zinc-950 dark:text-zinc-100 dark:md:border-zinc-800 flex flex-col overflow-hidden", children: [!fileContent ? ((0, jsx_runtime_1.jsx)(react_1.Alert, { color: "primary", title: `Al importar ${initData.title} verás una previsualización de su contenido.`, className: "my-3 max-h-[70px]", radius: "sm", hideIconWrapper: true, variant: "faded" })) : null, fileContent && matrix.length === 0 && !error ? ((0, jsx_runtime_1.jsx)(react_1.Alert, { color: "danger", title: `No se encontraron datos en el archivo seleccionado.`, className: "my-3", radius: "sm", hideIconWrapper: true, variant: "faded" })) : null, fileContent && matrix.length > 0 ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "mt-4 min-h-0 flex-1 max-w-full border-r border-b border-gray-200 dark:border-zinc-700 overflow-x-auto overflow-y-auto", children: (0, jsx_runtime_1.jsxs)("table", { className: "min-w-max w-full text-sm", children: [(0, jsx_runtime_1.jsx)("thead", { className: "sticky top-0 z-10 bg-gray-100 dark:bg-zinc-900", children: (0, jsx_runtime_1.jsx)("tr", { children: Array.from({ length: maxColumns }).map((_, columnIndex) => ((0, jsx_runtime_1.jsx)("th", { className: "border-x border-t border-gray-200 p-3 font-semibold text-gray-700 dark:border-zinc-700 dark:text-zinc-100", children: tableHeaders[columnIndex] ||
|
|
65
|
+
`Columna ${columnIndex + 1}` }, `header-${columnIndex}`))) }) }), (0, jsx_runtime_1.jsx)("tbody", { className: "bg-white dark:bg-zinc-950", children: dataRows.map((row, rowIndex) => ((0, jsx_runtime_1.jsx)("tr", { children: Array.from({ length: maxColumns }).map((_, columnIndex) => (() => {
|
|
66
66
|
var _a, _b;
|
|
67
67
|
const originalFilteredRowIndex = row.originalFilteredRowIndex;
|
|
68
68
|
const key = `${originalFilteredRowIndex}-${columnIndex}`;
|
|
@@ -77,11 +77,11 @@ const ExcelPreview = ({ initData, fileContent, matrix, error, validationErrors,
|
|
|
77
77
|
cellRefs.current[key] = element;
|
|
78
78
|
}, tabIndex: -1, onClick: () => {
|
|
79
79
|
setSelectedErrorCellKey(hasError ? key : null);
|
|
80
|
-
}, className: `border border-
|
|
81
|
-
${isFocusedTarget || isSelectedErrorCell ? "ring-[1.7px] ring-danger ring-inset" : ""}`, children: cellError ? ((0, jsx_runtime_1.jsx)(react_1.Tooltip, { content: cellError.message, isOpen: isSelectedErrorCell, placement: tooltipPlacement, color: "danger", radius: "sm", showArrow: true, children: (0, jsx_runtime_1.jsxs)("button", { type: "button", className: "flex w-full min-w-0 items-center justify-between gap-3 text-left text-
|
|
80
|
+
}, className: `border border-gray-200 bg-white p-3 align-top whitespace-nowrap text-gray-700 outline-none transition-all duration-200 ease-in-out dark:border-zinc-700 dark:bg-zinc-950 dark:text-zinc-200
|
|
81
|
+
${isFocusedTarget || isSelectedErrorCell ? "ring-[1.7px] ring-danger ring-inset" : ""}`, children: cellError ? ((0, jsx_runtime_1.jsx)(react_1.Tooltip, { content: cellError.message, isOpen: isSelectedErrorCell, placement: tooltipPlacement, color: "danger", radius: "sm", showArrow: true, children: (0, jsx_runtime_1.jsxs)("button", { type: "button", className: "flex w-full min-w-0 items-center justify-between gap-3 text-left text-gray-700 outline-none dark:text-zinc-200", onClick: (event) => {
|
|
82
82
|
event.stopPropagation();
|
|
83
83
|
setSelectedErrorCellKey(key);
|
|
84
84
|
}, children: [(0, jsx_runtime_1.jsx)("span", { children: (_a = row.row[columnIndex]) !== null && _a !== void 0 ? _a : "" }), (0, jsx_runtime_1.jsx)(tb_1.TbAlertCircle, { className: "shrink-0 text-danger", size: 20 })] }) })) : ((0, jsx_runtime_1.jsx)("p", { children: (_b = row.row[columnIndex]) !== null && _b !== void 0 ? _b : "" })) }, `cell-${rowIndex}-${columnIndex}`));
|
|
85
|
-
})()) }, `row-${rowIndex}`))) })] }) }), totalRecords > rowsPerPage ? ((0, jsx_runtime_1.jsxs)("div", { className: "mt-4 flex items-center justify-between gap-3", children: [(0, jsx_runtime_1.jsxs)("p", { className: "text-sm text-
|
|
85
|
+
})()) }, `row-${rowIndex}`))) })] }) }), totalRecords > rowsPerPage ? ((0, jsx_runtime_1.jsxs)("div", { className: "mt-4 flex items-center justify-between gap-3", children: [(0, jsx_runtime_1.jsxs)("p", { className: "text-sm text-gray-600 dark:text-zinc-400", children: ["Mostrando ", startIndex + 1, "-", Math.min(endIndex, totalRecords), " de", " ", totalRecords, " registros"] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)(react_1.Button, { size: "sm", className: "border border-gray-300 text-sm text-gray-700 disabled:border-gray-200 disabled:bg-gray-100 disabled:text-gray-400 dark:border-zinc-600 dark:text-zinc-200 dark:disabled:border-zinc-800 dark:disabled:bg-zinc-900 dark:disabled:text-zinc-600", variant: "bordered", disabled: effectivePage === 1, onPress: () => onPageChange(Math.max(1, effectivePage - 1)), isIconOnly: true, children: (0, jsx_runtime_1.jsx)(pi_1.PiCaretLeftBold, { size: 16 }) }), (0, jsx_runtime_1.jsxs)("span", { className: "mx-1 text-sm text-gray-700 dark:text-zinc-200", children: ["Pagina ", effectivePage, " de ", totalPages] }), (0, jsx_runtime_1.jsx)(react_1.Button, { size: "sm", className: "border border-gray-300 text-sm text-gray-700 disabled:border-gray-200 disabled:bg-gray-100 disabled:text-gray-400 dark:border-zinc-600 dark:text-zinc-200 dark:disabled:border-zinc-800 dark:disabled:bg-zinc-900 dark:disabled:text-zinc-600", variant: "bordered", disabled: effectivePage === totalPages, onPress: () => onPageChange(Math.min(totalPages, effectivePage + 1)), isIconOnly: true, children: (0, jsx_runtime_1.jsx)(pi_1.PiCaretRightBold, { size: 16 }) })] })] })) : null, isBalances ? ((0, jsx_runtime_1.jsx)(BalanceTotals_1.BalanceTotals, { headers: tableHeaders, rows: allDataRows.map((entry) => entry.row) })) : null] })) : null] }));
|
|
86
86
|
};
|
|
87
87
|
exports.ExcelPreview = ExcelPreview;
|