karsten-design-system 1.2.41 → 1.2.42

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
@@ -4473,7 +4473,7 @@ function parseDateRange(value) {
4473
4473
  return [null, null];
4474
4474
  }
4475
4475
  }
4476
- function Table({ columns, data, totalRecords, actions = [], isOrdered = true, actionsHeaderClassName = '', actionsColumnsClassName = '', rowsPerPage = 10, onPageChange, isPaginated = true, isLoading = false, onFilterChange, onSortChange, }) {
4476
+ function Table({ columns, data, totalRecords, actions = [], isOrdered = true, actionsHeaderClassName = '', actionsColumnsClassName = '', rowsPerPage = 10, onPageChange, isPaginated = true, isLoading = false, onFilterChange, onSortChange, actionLabel = 'AÇÕES', }) {
4477
4477
  const [sortDirection, setSortDirection] = useState({});
4478
4478
  const [sortedData, setSortedData] = useState(data);
4479
4479
  const [currentPage, setCurrentPage] = useState(1);
@@ -4624,7 +4624,11 @@ function Table({ columns, data, totalRecords, actions = [], isOrdered = true, ac
4624
4624
  ? JSON.stringify(range)
4625
4625
  : '',
4626
4626
  }));
4627
- }, ariaLabel: `Filtrar por ${column.label}` }))] })] }), jsxs("div", { className: "flex justify-between mt-4", children: [jsx(Button, { variant: "outline", onClick: () => {
4627
+ }, ariaLabel: `Filtrar por ${column.label}`, minDate: column?.minDate
4628
+ ? new Date(column?.minDate)
4629
+ : undefined, maxDate: column?.maxDate
4630
+ ? new Date(column?.maxDate)
4631
+ : undefined }))] })] }), jsxs("div", { className: "flex justify-between mt-4", children: [jsx(Button, { variant: "outline", onClick: () => {
4628
4632
  setFilters((prev) => ({
4629
4633
  ...prev,
4630
4634
  [column.dataIndex]: '',
@@ -4639,7 +4643,7 @@ function Table({ columns, data, totalRecords, actions = [], isOrdered = true, ac
4639
4643
  ? null
4640
4644
  : column.dataIndex), "aria-label": `Filtrar por ${column.label}`, children: jsx("i", { className: clsx('pl-2 text-xs cursor-pointer', filterStatus[column.dataIndex] === 'applied'
4641
4645
  ? 'pi pi-filter-slash'
4642
- : '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 text-right pr-4', actionsHeaderClassName), children: "A\u00C7\u00D5ES" }))] }) }), jsx("tbody", { children: isLoading ? (jsx("tr", { children: jsx("td", { colSpan: columns.length + (actions.length > 0 ? 1 : 0), className: "p-6 text-center bg-gray-50 dark:bg-dark-200", children: jsx("div", { className: "py-2 px-4 flex justify-center items-center gap-2", children: jsx(Spinner, { size: "lg" }) }) }) })) : sortedData.length > 0 ? (sortedData.map((row, index) => (jsxs("tr", { className: clsx(index % 2 === 0
4646
+ : '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 text-right pr-4', actionsHeaderClassName), children: actionLabel }))] }) }), jsx("tbody", { children: isLoading ? (jsx("tr", { children: jsx("td", { colSpan: columns.length + (actions.length > 0 ? 1 : 0), className: "p-6 text-center bg-gray-50 dark:bg-dark-200", children: jsx("div", { className: "py-2 px-4 flex justify-center items-center gap-2", children: jsx(Spinner, { size: "lg" }) }) }) })) : sortedData.length > 0 ? (sortedData.map((row, index) => (jsxs("tr", { className: clsx(index % 2 === 0
4643
4647
  ? 'bg-light-300 dark:bg-dark-500'
4644
4648
  : 'bg-light-500 dark:bg-dark-100', 'text-primary text-base dark:text-light-500'), children: [columns.map((column) => {
4645
4649
  const value = getNestedValue(row, column.dataIndex);