karsten-design-system 1.2.40 → 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
@@ -733,7 +733,7 @@ function MegaMenu({ items }) {
733
733
  }) }));
734
734
  }
735
735
 
736
- function Modal({ isOpen, title, size = 'md', onClose, onConfirm, labelCloseButton = 'Fechar', labelConfirmButton = 'Confirmar', isExpanded = false, ariaLabel = 'Modal de informçoes', children, }) {
736
+ function Modal({ isOpen, title, size = 'md', onClose, onConfirm, labelCloseButton = 'Fechar', labelConfirmButton = 'Confirmar', isExpanded = false, ariaLabel = 'Modal de informçoes', children, isLoading = false, }) {
737
737
  const [isFullScreen, setIsFullScreen] = useState(false);
738
738
  const toggleFullScreen = () => {
739
739
  setIsFullScreen(!isFullScreen);
@@ -763,7 +763,7 @@ function Modal({ isOpen, title, size = 'md', onClose, onConfirm, labelCloseButto
763
763
  width: '24px',
764
764
  height: '24px',
765
765
  cursor: 'pointer',
766
- }, children: jsx("i", { className: "pi pi-times cursor-pointer dark:text-light-500" }) })] })] }), jsx("div", { className: `flex-1 overflow-y-auto text-primary dark:text-light-500 dark:bg-dark-100 ${isFullScreen ? 'h-full' : 'max-h-[70vh]'} p-6`, children: children }), jsxs("div", { className: "w-full flex flex-col sm:flex-row sm:justify-end pt-10 gap-4 px-6 dark:bg-dark-100", children: [onClose && (jsx(Button, { label: labelCloseButton, variant: "outline", onClick: onClose, className: "w-full sm:w-auto lg:min-w-[110px] md:min-w-[110px] px-4", "aria-label": "Fechar modal" })), onConfirm && (jsx(Button, { label: labelConfirmButton, variant: "primary", onClick: onConfirm, className: "w-full sm:w-auto lg:min-w-[110px] md:min-w-[110px] px-4", "aria-label": "Confirmar modal", type: "button" }))] })] }) }));
766
+ }, children: jsx("i", { className: "pi pi-times cursor-pointer dark:text-light-500" }) })] })] }), jsx("div", { className: `flex-1 overflow-y-auto text-primary dark:text-light-500 dark:bg-dark-100 ${isFullScreen ? 'h-full' : 'max-h-[70vh]'} p-6`, children: children }), jsxs("div", { className: "w-full flex flex-col sm:flex-row sm:justify-end pt-10 gap-4 px-6 dark:bg-dark-100", children: [onClose && (jsx(Button, { label: labelCloseButton, variant: "outline", onClick: onClose, className: "w-full sm:w-auto lg:min-w-[110px] md:min-w-[110px] px-4", "aria-label": "Fechar modal" })), onConfirm && (jsx(Button, { label: labelConfirmButton, variant: "primary", onClick: onConfirm, className: "w-full sm:w-auto lg:min-w-[110px] md:min-w-[110px] px-4", "aria-label": "Confirmar modal", type: "button", disabled: isLoading }))] })] }) }));
767
767
  }
768
768
 
769
769
  function ModalForm({ isOpen, title, description, onClose, children, }) {
@@ -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);