karsten-design-system 1.2.63 → 1.2.65
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/index.js
CHANGED
|
@@ -4582,7 +4582,7 @@ function parseDateRange(value) {
|
|
|
4582
4582
|
return [null, null];
|
|
4583
4583
|
}
|
|
4584
4584
|
}
|
|
4585
|
-
function Table({ columns, data, totalRecords, actions = [], isOrdered = true, actionsHeaderClassName = '', actionsColumnsClassName = '', rowsPerPage = 10, onPageChange, isPaginated = true, isLoading = false, onFilterChange, onSortChange, actionLabel = 'AÇÕES', systemLanguage = 'pt', isShowCustomizeColumns = false, }) {
|
|
4585
|
+
function Table({ columns, data, totalRecords, actions = [], isOrdered = true, actionsHeaderClassName = '', actionsColumnsClassName = '', rowsPerPage = 10, onPageChange, isPaginated = true, isLoading = false, onFilterChange, onSortChange, actionLabel = 'AÇÕES', systemLanguage = 'pt', isShowCustomizeColumns = false, onApplyColumns, }) {
|
|
4586
4586
|
const [sortDirection, setSortDirection] = useState({});
|
|
4587
4587
|
const [sortedData, setSortedData] = useState(data);
|
|
4588
4588
|
const [currentPage, setCurrentPage] = useState(1);
|
|
@@ -4805,7 +4805,7 @@ function Table({ columns, data, totalRecords, actions = [], isOrdered = true, ac
|
|
|
4805
4805
|
: 'pi pi-filter') }) }) }))] }))] })] }, String(column.dataIndex)))), actions.length > 0 && (jsx("th", { scope: "col", className: clsx('bg-primary rounded-se-lg font-bold text-light-500 text-sm uppercase p-3 pb-1 text-left pr-4', actionsHeaderClassName), style: { verticalAlign: 'top', position: 'relative' }, children: jsxs("div", { className: "flex flex-col items-center w-full", children: [jsx("span", { children: actionLabel }), isShowCustomizeColumns && (jsx("button", { ref: columnButtonRef, onClick: handleOpenColumnModal, "aria-label": "Abrir modal de colunas", children: jsx("i", { className: "pi pi-plus-circle text-sm cursor-pointer" }) })), showColumnModal && (jsxs("div", { style: {
|
|
4806
4806
|
position: 'absolute',
|
|
4807
4807
|
top: '100%',
|
|
4808
|
-
|
|
4808
|
+
right: 0,
|
|
4809
4809
|
zIndex: 20,
|
|
4810
4810
|
width: 276,
|
|
4811
4811
|
borderRadius: 8,
|
|
@@ -4826,11 +4826,20 @@ function Table({ columns, data, totalRecords, actions = [], isOrdered = true, ac
|
|
|
4826
4826
|
[col.dataIndex]: !prev[col.dataIndex],
|
|
4827
4827
|
}));
|
|
4828
4828
|
}, disabled: isLastActive, className: clsx('appearance-none w-2 h-2 ring-1 ring-offset-2 ring-offset-light-500 ring-light-700 checked:bg-primary cursor-pointer rounded-md dark:bg-dark-100 dark:checked:bg-light-500 dark:checked:border-light-500 dark:ring-offset-dark-100 dark:ring-offset-2') }), jsx("span", { children: col.label })] }, col.dataIndex || idx));
|
|
4829
|
-
}) }), jsxs("div", { className: "flex justify-between mt-4", children: [jsx(Button, { variant: "outline", onClick: () => setShowColumnModal(false), label: lang.buttonCloseMessage || 'Fechar', width: "10", size: "small", "aria-label": "Fechar modal" }), jsx(Button, { variant: "primary",
|
|
4829
|
+
}) }), jsxs("div", { className: "flex justify-between mt-4", children: [jsx(Button, { variant: "outline", onClick: () => setShowColumnModal(false), label: lang.buttonCloseMessage || 'Fechar', width: "10", size: "small", "aria-label": "Fechar modal" }), jsx(Button, { variant: "primary",
|
|
4830
|
+
// onClick={() => {
|
|
4831
|
+
// if (pendingColumns) {
|
|
4832
|
+
// columns.forEach((col) => {
|
|
4833
|
+
// col.active = pendingColumns[col.dataIndex]
|
|
4834
|
+
// })
|
|
4835
|
+
// }
|
|
4836
|
+
// setShowColumnModal(false)
|
|
4837
|
+
// }}
|
|
4838
|
+
onClick: () => {
|
|
4830
4839
|
if (pendingColumns) {
|
|
4831
|
-
columns.
|
|
4832
|
-
|
|
4833
|
-
|
|
4840
|
+
const selected = columns.filter((col) => pendingColumns[col.dataIndex]);
|
|
4841
|
+
if (onApplyColumns)
|
|
4842
|
+
onApplyColumns(selected);
|
|
4834
4843
|
}
|
|
4835
4844
|
setShowColumnModal(false);
|
|
4836
4845
|
}, label: lang.buttonApplyFilterMessage || 'Aplicar', width: "10", size: "small", "aria-label": "Aplicar sele\u00E7\u00E3o de colunas" })] })] })] }))] }) }))] }) }), jsx("tbody", { children: isLoading ? (jsx("tr", { children: jsx("td", { colSpan: columns.filter((col) => col.active).length +
|