karsten-design-system 1.2.80 → 1.2.81
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
|
@@ -4679,7 +4679,7 @@ const getFromLocalStorage = (localStorageKey, key) => {
|
|
|
4679
4679
|
return {};
|
|
4680
4680
|
}
|
|
4681
4681
|
};
|
|
4682
|
-
function Table({ columns, data, totalRecords, actions = [],
|
|
4682
|
+
function Table({ columns, data, totalRecords, actions = [], actionsHeaderClassName = '', actionsColumnsClassName = '', rowsPerPage = 10, onPageChange, isPaginated = true, isLoading = false, onFilterChange, onSortChange, actionLabel = 'AÇÕES', systemLanguage = 'pt', isShowCustomizeColumns = false, onApplyColumns, isPermanentFilterEnabled = false, localStorageKey, }) {
|
|
4683
4683
|
const [sortDirection, setSortDirection] = useState({});
|
|
4684
4684
|
const [sortedData, setSortedData] = useState(data);
|
|
4685
4685
|
const [currentPage, setCurrentPage] = useState(1);
|
|
@@ -4993,15 +4993,15 @@ function Table({ columns, data, totalRecords, actions = [], isOrdered = true, ac
|
|
|
4993
4993
|
: undefined, showTime: column.isShowTimeInDateMode ? true : false }))] })] }), jsxs("div", { className: "flex justify-between mt-4", children: [jsx(Button, { variant: "outline", onClick: () => {
|
|
4994
4994
|
setOpenFilter(null);
|
|
4995
4995
|
setFilterModalPosition(null);
|
|
4996
|
-
}, label: lang.buttonCloseMessage, width: "10", size: "small", "aria-label": "Fechar filtro" }), jsx(Button, { variant: "secondary", onClick: () => handleClearFilter(column), label: lang.buttonClearFilterMessage, width: "10", size: "small", "aria-label": "Limpar filtro" }), jsx(Button, { variant: "primary", onClick: () => handleFilter(column), label: lang.buttonApplyFilterMessage, width: "10", size: "small", "aria-label": "Aplicar filtro" })] })] })) }), jsxs("div", { className: "flex flex-col items-start", children: [column.label,
|
|
4996
|
+
}, label: lang.buttonCloseMessage, width: "10", size: "small", "aria-label": "Fechar filtro" }), jsx(Button, { variant: "secondary", onClick: () => handleClearFilter(column), label: lang.buttonClearFilterMessage, width: "10", size: "small", "aria-label": "Limpar filtro" }), jsx(Button, { variant: "primary", onClick: () => handleFilter(column), label: lang.buttonApplyFilterMessage, width: "10", size: "small", "aria-label": "Aplicar filtro" })] })] })) }), jsxs("div", { className: "flex flex-col items-start", children: [column.label, jsxs("div", { className: "flex flex-row", children: [column.isOrdered ? (jsx("button", { onClick: () => handleSort(column.dataIndex), "aria-label": `Ordenar por ${column.label}`, children: jsx("i", { className: clsx('text-xs cursor-pointer pi', sortDirection[column.dataIndex] === 'ASC' &&
|
|
4997
4997
|
'pi-sort-amount-up-alt', sortDirection[column.dataIndex] === 'DESC' &&
|
|
4998
|
-
'pi-sort-amount-down', !sortDirection[column.dataIndex] && 'pi-sort-alt') }) }), column.filterable && (jsx(Fragment, { children: jsx("button", { ref: (el) => {
|
|
4998
|
+
'pi-sort-amount-down', !sortDirection[column.dataIndex] && 'pi-sort-alt') }) })) : (jsx("div", { className: "text-xs w-4 h-5" })), column.filterable && (jsx(Fragment, { children: jsx("button", { ref: (el) => {
|
|
4999
4999
|
filterButtonRefs.current[column.dataIndex] = el;
|
|
5000
5000
|
}, onClick: () => setOpenFilter((prev) => prev === column.dataIndex
|
|
5001
5001
|
? null
|
|
5002
5002
|
: column.dataIndex), "aria-label": `Filtrar por ${column.label}`, children: jsx("i", { className: clsx('pl-2 text-xs cursor-pointer', filterStatus[column.dataIndex] === 'applied'
|
|
5003
5003
|
? 'pi pi-filter-slash text-accent'
|
|
5004
|
-
: 'pi pi-filter') }) }) }))] })
|
|
5004
|
+
: '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: {
|
|
5005
5005
|
position: 'absolute',
|
|
5006
5006
|
top: '100%',
|
|
5007
5007
|
right: 0,
|