karsten-design-system 1.2.64 → 1.2.66
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",
|
|
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 +
|
|
@@ -5005,13 +5014,13 @@ function TransferList({ allItems, associated, onChange, className, titleAvailabl
|
|
|
5005
5014
|
setSelectedAssociated([]);
|
|
5006
5015
|
onChange(allItems.filter((item) => !newAssociated.some((a) => a.key === item.key)), newAssociated);
|
|
5007
5016
|
};
|
|
5008
|
-
return (jsxs("div", { className: clsx('flex flex-col sm:flex-row gap-6 w-full h-full', className), children: [jsxs("div", { className: "flex-1 flex flex-col min-w-0 min-h-0 shadow-container rounded-md text-primary bg-light-500 dark:text-light-500 dark:bg-dark-100 dark:border dark:border-dark-500 dark:shadow-dark-400", children: [jsx("div", { className: "bg-primary rounded-t-lg w-full", children: jsx("span", { className: "block w-full font-bold text-light-500 text-sm uppercase text-center py-3", children: titleAvailable }) }), jsx("div", { className: "mt-2 px-4", children: jsx(Input, { placeholder: searchPlaceholder, value: searchAvailable, onChange: (e) => setSearchAvailable(e), "aria-label": `Filtrar por disponiveis`, maxLength: 50 }) }), jsxs("ul", { className: "overflow-auto mt-2 px-4 flex-1 min-h-0", style: { maxHeight: '420px', minHeight: '220px' }, children: [isLoading && (jsx("div", { className: "flex justify-center items-center h-full mt-8", children: jsx(Spinner, { size: "lg" }) })), !isLoading &&
|
|
5017
|
+
return (jsxs("div", { className: clsx('flex flex-col sm:flex-row gap-6 w-full h-full', className), children: [jsxs("div", { className: "flex-1 flex flex-col min-w-0 min-h-0 shadow-container rounded-md text-primary bg-light-500 dark:text-light-500 dark:bg-dark-100 dark:border dark:border-dark-500 dark:shadow-dark-400", children: [jsx("div", { className: "bg-primary rounded-t-lg w-full", children: jsx("span", { className: "block w-full font-bold text-light-500 text-sm uppercase text-center py-3", children: titleAvailable }) }), jsx("div", { className: "mt-2 px-4", children: jsx(Input, { placeholder: searchPlaceholder, value: searchAvailable, onChange: (e) => setSearchAvailable(e), "aria-label": `Filtrar por disponiveis`, maxLength: 50, disabled: isLoading }) }), jsxs("ul", { className: "overflow-auto mt-2 px-4 flex-1 min-h-0 mb-4", style: { maxHeight: '420px', minHeight: '220px' }, children: [isLoading && (jsx("div", { className: "flex justify-center items-center h-full mt-8", children: jsx(Spinner, { size: "lg" }) })), !isLoading &&
|
|
5009
5018
|
filteredAvailable.length > 0 &&
|
|
5010
5019
|
filteredAvailable?.map((item) => (jsx("li", { children: jsxs("label", { className: "flex items-center gap-2 cursor-pointer py-1 px-2 rounded hover:bg-light-300 dark:hover:bg-dark-400 min-w-0", children: [jsx("input", { type: 'checkbox', checked: selectedAvailable.includes(item.key), onChange: (e) => {
|
|
5011
5020
|
setSelectedAvailable((prev) => e.target.checked
|
|
5012
5021
|
? [...prev, item.key]
|
|
5013
5022
|
: prev.filter((k) => k !== item.key));
|
|
5014
|
-
}, className: clsx('appearance-none w-3 h-3 shrink-0 align-middle 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'), disabled: isDisabled }), jsx("span", { className: clsx('font-roboto text-primary dark:text-light-500 break-words min-w-0', isDisabled && 'text-light-700 dark:text-dark-400'), style: { wordBreak: 'break-word', minWidth: 0 }, children: item.label })] }) }, item.key)))] })] }), jsxs("div", { className: "flex flex-row justify-center items-center gap-4 md:flex-col md:justify-center md:items-center", children: [jsx(Button, { icon: "pi pi-angle-right", variant: "primary", onClick: moveToAssociated, disabled: selectedAvailable.length === 0, type: "button" }), jsx(Button, { icon: "pi pi-angle-left", variant: "primary", onClick: moveToAvailable, disabled: selectedAssociated.length === 0, type: "button" })] }), jsxs("div", { className: "flex-1 flex flex-col min-w-0 min-h-0 shadow-container rounded-md text-primary bg-light-500 dark:text-light-500 dark:bg-dark-100 dark:border dark:border-dark-500 dark:shadow-dark-400", children: [jsx("div", { className: "bg-primary rounded-t-lg w-full", children: jsx("span", { className: "block w-full font-bold text-light-500 text-sm uppercase text-center py-3", children: titleAssociated }) }), jsx("div", { className: "mt-2 px-4", children: jsx(Input, { placeholder: searchPlaceholder, value: searchAssociated, onChange: (e) => setSearchAssociated(e), "aria-label": `Filtrar por associados`, maxLength: 50 }) }), jsxs("ul", { className: "overflow-auto mt-2 px-4 flex-1 min-h-0", style: { maxHeight: '420px', minHeight: '220px' }, children: [isLoading && (jsx("div", { className: "flex justify-center items-center h-full mt-8", children: jsx(Spinner, { size: "lg" }) })), !isLoading &&
|
|
5023
|
+
}, className: clsx('appearance-none w-3 h-3 shrink-0 align-middle 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'), disabled: isDisabled }), jsx("span", { className: clsx('font-roboto text-primary dark:text-light-500 break-words min-w-0', isDisabled && 'text-light-700 dark:text-dark-400'), style: { wordBreak: 'break-word', minWidth: 0 }, children: item.label })] }) }, item.key)))] })] }), jsxs("div", { className: "flex flex-row justify-center items-center gap-4 md:flex-col md:justify-center md:items-center", children: [jsx(Button, { icon: "pi pi-angle-right", variant: "primary", onClick: moveToAssociated, disabled: selectedAvailable.length === 0, type: "button" }), jsx(Button, { icon: "pi pi-angle-left", variant: "primary", onClick: moveToAvailable, disabled: selectedAssociated.length === 0, type: "button" })] }), jsxs("div", { className: "flex-1 flex flex-col min-w-0 min-h-0 shadow-container rounded-md text-primary bg-light-500 dark:text-light-500 dark:bg-dark-100 dark:border dark:border-dark-500 dark:shadow-dark-400", children: [jsx("div", { className: "bg-primary rounded-t-lg w-full", children: jsx("span", { className: "block w-full font-bold text-light-500 text-sm uppercase text-center py-3", children: titleAssociated }) }), jsx("div", { className: "mt-2 px-4", children: jsx(Input, { placeholder: searchPlaceholder, value: searchAssociated, onChange: (e) => setSearchAssociated(e), "aria-label": `Filtrar por associados`, maxLength: 50, disabled: isLoading }) }), jsxs("ul", { className: "overflow-auto mt-2 px-4 flex-1 min-h-0 mb-4", style: { maxHeight: '420px', minHeight: '220px' }, children: [isLoading && (jsx("div", { className: "flex justify-center items-center h-full mt-8", children: jsx(Spinner, { size: "lg" }) })), !isLoading &&
|
|
5015
5024
|
filteredAssociated.length > 0 &&
|
|
5016
5025
|
filteredAssociated?.map((item) => (jsx("li", { children: jsxs("label", { className: "flex items-center gap-2 cursor-pointer py-1 px-2 rounded hover:bg-light-300 dark:hover:bg-dark-400 min-w-0", children: [jsx("input", { type: 'checkbox', checked: selectedAssociated.includes(item.key), onChange: (e) => {
|
|
5017
5026
|
setSelectedAssociated((prev) => e.target.checked
|