karsten-design-system 1.2.64 → 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);
@@ -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", onClick: () => {
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.forEach((col) => {
4832
- col.active = pendingColumns[col.dataIndex];
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 +