forlogic-core 1.15.2 → 1.15.4
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/assets/index.d.ts +6 -0
- package/dist/auth/components/ProtectedRoute.d.ts +6 -0
- package/dist/auth/components/UserInfo.d.ts +10 -0
- package/dist/auth/contexts/AuthContext.d.ts +84 -0
- package/dist/auth/pages/CallbackPage.d.ts +1 -0
- package/dist/auth/pages/LoginPage.d.ts +2 -0
- package/dist/auth/services/AuthService.d.ts +40 -0
- package/dist/auth/services/SupabaseTokenService.d.ts +3 -0
- package/dist/auth/services/TokenManager.d.ts +51 -0
- package/dist/auth/services/TokenRegenerationService.d.ts +12 -0
- package/dist/auth/services/TokenService.d.ts +42 -0
- package/dist/auth/utils/AuthUtils.d.ts +4 -0
- package/dist/auth/utils/ErrorInterceptor.d.ts +15 -0
- package/dist/components/ErrorBoundary.d.ts +19 -0
- package/dist/components/layout/AppHeader.d.ts +63 -0
- package/dist/components/layout/AppLayout.d.ts +10 -0
- package/dist/components/layout/AppSidebar.d.ts +10 -0
- package/dist/components/layout/BodyContent.d.ts +60 -0
- package/dist/components/layout/SidebarActionTrigger.d.ts +34 -0
- package/dist/components/layout/SidebarHeader.d.ts +5 -0
- package/dist/components/layout/sidebar-utils.d.ts +12 -0
- package/dist/components/modules/ModuleGrid.d.ts +9 -0
- package/dist/components/modules/ModulesDialog.d.ts +3 -0
- package/dist/components/modules/icons/ModulesCardIcons.d.ts +19 -0
- package/dist/components/modules/index.d.ts +4 -0
- package/dist/components/modules/modulesData.d.ts +6 -0
- package/dist/components/modules/types.d.ts +35 -0
- package/dist/components/ui/accordion.d.ts +7 -0
- package/dist/components/ui/action-button.d.ts +43 -0
- package/dist/components/ui/alert-dialog.d.ts +20 -0
- package/dist/components/ui/alert.d.ts +12 -0
- package/dist/components/ui/avatar.d.ts +6 -0
- package/dist/components/ui/badge.d.ts +9 -0
- package/dist/components/ui/breadcrumb.d.ts +19 -0
- package/dist/components/ui/button-group.d.ts +9 -0
- package/dist/components/ui/button.d.ts +11 -0
- package/dist/components/ui/calendar.d.ts +8 -0
- package/dist/components/ui/card.d.ts +8 -0
- package/dist/components/ui/chart.d.ts +62 -0
- package/dist/components/ui/checkbox.d.ts +4 -0
- package/dist/components/ui/collapsible.d.ts +5 -0
- package/dist/components/ui/color-picker.d.ts +8 -0
- package/dist/components/ui/combobox.d.ts +33 -0
- package/dist/components/ui/command.d.ts +23 -0
- package/dist/components/ui/context-menu.d.ts +27 -0
- package/dist/components/ui/data-list.d.ts +86 -0
- package/dist/components/ui/date-picker.d.ts +9 -0
- package/dist/components/ui/dialog.d.ts +36 -0
- package/dist/components/ui/disabled-menu-item.d.ts +25 -0
- package/dist/components/ui/drawer.d.ts +22 -0
- package/dist/components/ui/dropdown-menu.d.ts +27 -0
- package/dist/components/ui/empty-state.d.ts +79 -0
- package/dist/components/ui/form.d.ts +23 -0
- package/dist/components/ui/grid.d.ts +53 -0
- package/dist/components/ui/hover-card.d.ts +6 -0
- package/dist/components/ui/icon-picker.d.ts +8 -0
- package/dist/components/ui/input-group.d.ts +97 -0
- package/dist/components/ui/input.d.ts +37 -0
- package/dist/components/ui/label.d.ts +23 -0
- package/dist/components/ui/loading-state.d.ts +52 -0
- package/dist/components/ui/menubar.d.ts +33 -0
- package/dist/components/ui/navigation-menu.d.ts +12 -0
- package/dist/components/ui/onboarding-dialog.d.ts +43 -0
- package/dist/components/ui/page-breadcrumb.d.ts +77 -0
- package/dist/components/ui/pagination.d.ts +28 -0
- package/dist/components/ui/popover.d.ts +49 -0
- package/dist/components/ui/progress.d.ts +22 -0
- package/dist/components/ui/radio-group.d.ts +63 -0
- package/dist/components/ui/resizable.d.ts +23 -0
- package/dist/components/ui/rich-text-editor.d.ts +45 -0
- package/dist/components/ui/scroll-area.d.ts +37 -0
- package/dist/components/ui/select.d.ts +16 -0
- package/dist/components/ui/separator.d.ts +4 -0
- package/dist/components/ui/sheet.d.ts +32 -0
- package/dist/components/ui/sidebar.d.ts +66 -0
- package/dist/components/ui/skeleton-variants.d.ts +16 -0
- package/dist/components/ui/skeleton.d.ts +2 -0
- package/dist/components/ui/slider.d.ts +4 -0
- package/dist/components/ui/sonner.d.ts +3 -0
- package/dist/components/ui/spinner.d.ts +6 -0
- package/dist/components/ui/split-button.d.ts +70 -0
- package/dist/components/ui/stack.d.ts +12 -0
- package/dist/components/ui/step-selector.d.ts +39 -0
- package/dist/components/ui/switch.d.ts +4 -0
- package/dist/components/ui/tab-page-layout.d.ts +19 -0
- package/dist/components/ui/table-resize-handle.d.ts +15 -0
- package/dist/components/ui/table.d.ts +10 -0
- package/dist/components/ui/tabs.d.ts +7 -0
- package/dist/components/ui/textarea.d.ts +5 -0
- package/dist/components/ui/toggle-group.d.ts +12 -0
- package/dist/components/ui/toggle.d.ts +12 -0
- package/dist/components/ui/tooltip.d.ts +7 -0
- package/dist/components/ui/truncated-cell.d.ts +7 -0
- package/dist/components/ui/typography.d.ts +16 -0
- package/dist/config/index.d.ts +53 -0
- package/dist/contexts/LocaleContext.d.ts +15 -0
- package/dist/contexts/ModalStateContext.d.ts +57 -0
- package/dist/contexts/NavigationContext.d.ts +13 -0
- package/dist/contexts/PageMetadataContext.d.ts +43 -0
- package/dist/crud/components/ActionMenuItems.d.ts +17 -0
- package/dist/crud/components/BaseForm.d.ts +6 -0
- package/dist/crud/components/ContextMenu.d.ts +21 -0
- package/dist/crud/components/CrudActionBar.d.ts +38 -0
- package/dist/crud/components/CrudGrid.d.ts +43 -0
- package/dist/crud/components/CrudPagination.d.ts +12 -0
- package/dist/crud/components/CrudTable.d.ts +41 -0
- package/dist/crud/components/FilterBar.d.ts +136 -0
- package/dist/crud/components/TableFooter.d.ts +14 -0
- package/dist/crud/components/TableRowActions.d.ts +14 -0
- package/dist/crud/createCrudPage.d.ts +99 -0
- package/dist/crud/createSimpleService.d.ts +85 -0
- package/dist/crud/generateCrudConfig.d.ts +73 -0
- package/dist/crud/hooks/useBaseForm.d.ts +8 -0
- package/dist/crud/hooks/useCrud.d.ts +117 -0
- package/dist/crud/primitives/ActionMenu.d.ts +28 -0
- package/dist/crud/primitives/FilterBar.d.ts +24 -0
- package/dist/crud/primitives/Pagination.d.ts +24 -0
- package/dist/crud/primitives/Table.d.ts +26 -0
- package/dist/crud/primitives/index.d.ts +11 -0
- package/dist/crud/primitives/types.d.ts +76 -0
- package/dist/crud/utils/routingHelpers.d.ts +30 -0
- package/dist/exports/crud.d.ts +21 -0
- package/dist/exports/integrations.d.ts +13 -0
- package/dist/exports/ui.d.ts +73 -0
- package/dist/hooks/useActiveModules.d.ts +45 -0
- package/dist/hooks/useColumnResize.d.ts +21 -0
- package/dist/hooks/useDebounce.d.ts +56 -0
- package/dist/hooks/useI18nFormatters.d.ts +40 -0
- package/dist/hooks/usePageTitle.d.ts +4 -0
- package/dist/hooks/usePermissionQuery.d.ts +49 -0
- package/dist/hooks/useRowResize.d.ts +19 -0
- package/dist/hooks/useSidebarResize.d.ts +19 -0
- package/dist/hooks/useWizard.d.ts +40 -0
- package/dist/i18n/DatabaseBackend.d.ts +9 -0
- package/dist/i18n/components/TranslationLoader.d.ts +10 -0
- package/dist/i18n/config.d.ts +2 -0
- package/dist/i18n/constants.d.ts +126 -0
- package/dist/i18n/index.d.ts +21 -0
- package/dist/index.d.ts +83 -0
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/leadership/components/LeaderRow.d.ts +9 -0
- package/dist/leadership/components/LeadershipDialog.d.ts +10 -0
- package/dist/leadership/components/LeadershipForm.d.ts +8 -0
- package/dist/leadership/components/LeadershipPage.d.ts +1 -0
- package/dist/leadership/hooks/useLeadershipApi.d.ts +2 -0
- package/dist/leadership/hooks/useLeadershipMutations.d.ts +30 -0
- package/dist/leadership/index.d.ts +14 -0
- package/dist/leadership/types.d.ts +17 -0
- package/dist/leadership/utils/leadershipUtils.d.ts +8 -0
- package/dist/media/components/ImageEditor.d.ts +22 -0
- package/dist/media/components/ImageRenderer.d.ts +23 -0
- package/dist/media/components/VideoEditor.d.ts +22 -0
- package/dist/media/components/VideoRenderer.d.ts +8 -0
- package/dist/media/hooks/useMediaUpload.d.ts +20 -0
- package/dist/media/index.d.ts +49 -0
- package/dist/media/types.d.ts +66 -0
- package/dist/media/utils/imageHelpers.d.ts +28 -0
- package/dist/media/utils/videoHelpers.d.ts +35 -0
- package/dist/places/components/ManageAccessModal.d.ts +11 -0
- package/dist/places/components/PlaceCard.d.ts +12 -0
- package/dist/places/components/PlacesList.d.ts +12 -0
- package/dist/places/index.d.ts +8 -0
- package/dist/places/services/PlaceService.d.ts +9 -0
- package/dist/places/types.d.ts +10 -0
- package/dist/providers/CoreProviders.d.ts +66 -0
- package/dist/providers/index.d.ts +2 -0
- package/dist/qualiex/components/QualiexUserField.d.ts +125 -0
- package/dist/qualiex/hooks/useQualiexUsers.d.ts +51 -0
- package/dist/qualiex/services/qualiexApi.d.ts +21 -0
- package/dist/qualiex/utils/QualiexErrorInterceptor.d.ts +15 -0
- package/dist/qualiex/utils/userPlaceUtils.d.ts +16 -0
- package/dist/services/BaseService.d.ts +51 -0
- package/dist/services/EmailService.d.ts +110 -0
- package/dist/services/ErrorService.d.ts +19 -0
- package/dist/services/QualiexEnrichmentService.d.ts +65 -0
- package/dist/services/QualiexFieldHelpers.d.ts +17 -0
- package/dist/services/TranslationService.d.ts +20 -0
- package/dist/setup.d.ts +14 -0
- package/dist/sign/components/D4SignWidget.d.ts +2 -0
- package/dist/sign/components/DocumentSigner.d.ts +2 -0
- package/dist/sign/components/SignConfigForm.d.ts +2 -0
- package/dist/sign/components/SignWidget.d.ts +21 -0
- package/dist/sign/hooks/useSignConfig.d.ts +6 -0
- package/dist/sign/index.d.ts +7 -0
- package/dist/sign/services/signService.d.ts +23 -0
- package/dist/sign/types.d.ts +53 -0
- package/dist/supabase/SupabaseSingleton.d.ts +3 -0
- package/dist/supabase/client.d.ts +2 -0
- package/dist/supabase/publicClient.d.ts +2 -0
- package/dist/supabase/types.d.ts +377 -0
- package/dist/types/sidebar.d.ts +49 -0
- package/dist/types.d.ts +499 -0
- package/dist/utils/formatters/currencyFormatters.d.ts +1 -0
- package/dist/utils/formatters/dateFormatters.d.ts +52 -0
- package/dist/utils/index.d.ts +8 -0
- package/dist/utils/linkHelpers.d.ts +4 -0
- package/package.json +1 -1
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface ModalStateContextValue {
|
|
3
|
+
/** IDs dos modais atualmente abertos */
|
|
4
|
+
openModals: Set<string>;
|
|
5
|
+
/** Indica se há pelo menos um modal aberto */
|
|
6
|
+
hasOpenModal: boolean;
|
|
7
|
+
/** Registra um modal como aberto */
|
|
8
|
+
registerModal: (id: string) => void;
|
|
9
|
+
/** Remove um modal do registro */
|
|
10
|
+
unregisterModal: (id: string) => void;
|
|
11
|
+
/** Define diretamente se há modal aberto (uso simplificado) */
|
|
12
|
+
setHasOpenModal: (value: boolean) => void;
|
|
13
|
+
}
|
|
14
|
+
declare const ModalStateContext: React.Context<ModalStateContextValue>;
|
|
15
|
+
export interface ModalStateProviderProps {
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* ModalStateProvider - Gerencia o estado global de modais abertos
|
|
20
|
+
*
|
|
21
|
+
* Permite que componentes como o SidebarActionTrigger saibam quando
|
|
22
|
+
* há modais abertos e se desabilitem para evitar conflitos.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* // No App.tsx ou provider root
|
|
27
|
+
* <ModalStateProvider>
|
|
28
|
+
* <AppLayout />
|
|
29
|
+
* </ModalStateProvider>
|
|
30
|
+
*
|
|
31
|
+
* // Em um componente com modal
|
|
32
|
+
* const { registerModal, unregisterModal } = useModalState();
|
|
33
|
+
*
|
|
34
|
+
* useEffect(() => {
|
|
35
|
+
* if (isOpen) {
|
|
36
|
+
* registerModal('my-dialog');
|
|
37
|
+
* } else {
|
|
38
|
+
* unregisterModal('my-dialog');
|
|
39
|
+
* }
|
|
40
|
+
* }, [isOpen]);
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export declare function ModalStateProvider({ children }: ModalStateProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
/**
|
|
45
|
+
* Hook para acessar o estado global de modais
|
|
46
|
+
*
|
|
47
|
+
* @returns Estado e funções para gerenciar modais
|
|
48
|
+
* @throws Error se usado fora do ModalStateProvider
|
|
49
|
+
*/
|
|
50
|
+
export declare function useModalState(): ModalStateContextValue;
|
|
51
|
+
/**
|
|
52
|
+
* Hook simplificado que retorna apenas se há modal aberto
|
|
53
|
+
*
|
|
54
|
+
* @returns boolean indicando se há modal aberto
|
|
55
|
+
*/
|
|
56
|
+
export declare function useHasOpenModal(): boolean;
|
|
57
|
+
export default ModalStateContext;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { SidebarConfig } from '../types/sidebar';
|
|
3
|
+
interface NavigationContextType {
|
|
4
|
+
navigation?: SidebarConfig['navigation'];
|
|
5
|
+
appName?: string;
|
|
6
|
+
}
|
|
7
|
+
interface NavigationProviderProps {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
config?: SidebarConfig;
|
|
10
|
+
}
|
|
11
|
+
export declare function NavigationProvider({ children, config }: NavigationProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function useNavigation(): NavigationContextType;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface PageMetadata {
|
|
3
|
+
title?: string;
|
|
4
|
+
subtitle?: string;
|
|
5
|
+
}
|
|
6
|
+
interface PageMetadataContextType {
|
|
7
|
+
metadata: PageMetadata;
|
|
8
|
+
setMetadata: (metadata: PageMetadata) => void;
|
|
9
|
+
clearMetadata: () => void;
|
|
10
|
+
headerActions?: React.ReactNode;
|
|
11
|
+
setHeaderActions: (actions: React.ReactNode) => void;
|
|
12
|
+
}
|
|
13
|
+
interface PageMetadataProviderProps {
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
actions?: React.ReactNode;
|
|
16
|
+
}
|
|
17
|
+
export declare function PageMetadataProvider({ children, actions }: PageMetadataProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare function usePageMetadataContext(): PageMetadataContextType;
|
|
19
|
+
/**
|
|
20
|
+
* Hook para definir metadados customizados da página (título e subtítulo)
|
|
21
|
+
*
|
|
22
|
+
* Permite que páginas definam informações no header:
|
|
23
|
+
* - title: Título principal (grande, bold)
|
|
24
|
+
* - subtitle: Informações adicionais abaixo do título (médio, cinza)
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```typescript
|
|
28
|
+
* import { usePageMetadata } from 'forlogic-core/modular';
|
|
29
|
+
*
|
|
30
|
+
* function ImportFlowsPage() {
|
|
31
|
+
* usePageMetadata({
|
|
32
|
+
* title: 'Fluxos de Importação',
|
|
33
|
+
* subtitle: 'Gerencie seus fluxos de importação'
|
|
34
|
+
* });
|
|
35
|
+
*
|
|
36
|
+
* return <div>...</div>;
|
|
37
|
+
* }
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* @param metadata - Objeto com title e/ou subtitle customizados
|
|
41
|
+
*/
|
|
42
|
+
export declare function usePageMetadata(metadata: PageMetadata): void;
|
|
43
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface ActionMenuItemsProps {
|
|
3
|
+
onEdit?: () => void;
|
|
4
|
+
onDelete?: () => void;
|
|
5
|
+
onToggleStatus?: () => void;
|
|
6
|
+
isActive?: boolean;
|
|
7
|
+
canDelete?: boolean;
|
|
8
|
+
customActions?: Array<{
|
|
9
|
+
icon: any;
|
|
10
|
+
label: string;
|
|
11
|
+
onClick: () => void;
|
|
12
|
+
destructive?: boolean;
|
|
13
|
+
}>;
|
|
14
|
+
renderAs: 'dropdown' | 'context';
|
|
15
|
+
}
|
|
16
|
+
export declare const ActionMenuItems: React.FC<ActionMenuItemsProps>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { BaseFormProps } from '../../types';
|
|
2
|
+
declare function BaseForm<T extends Record<string, any>>({ title, sections, initialData, onSubmit, onCancel, open, submitButtonText, isLoading, usersData }: BaseFormProps<T> & {
|
|
3
|
+
usersData?: any[];
|
|
4
|
+
isLoading?: boolean;
|
|
5
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export default BaseForm;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { BaseEntity } from '../../types';
|
|
2
|
+
interface ContextMenuProps<T extends BaseEntity> {
|
|
3
|
+
contextMenu: {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
item: T;
|
|
7
|
+
} | null;
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
onEdit?: (item: T) => void;
|
|
10
|
+
onDelete?: (item: T) => void;
|
|
11
|
+
onToggleStatus?: (item: T) => void;
|
|
12
|
+
customActions?: (item: T) => Array<{
|
|
13
|
+
icon: any;
|
|
14
|
+
label: string;
|
|
15
|
+
onClick: () => void;
|
|
16
|
+
}>;
|
|
17
|
+
}
|
|
18
|
+
export declare const ContextMenu: <T extends BaseEntity & {
|
|
19
|
+
is_actived?: boolean;
|
|
20
|
+
}>({ contextMenu, onClose, onEdit, onDelete, onToggleStatus, customActions, }: ContextMenuProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { BaseEntity, BulkAction } from '../../types';
|
|
3
|
+
export interface CustomAction {
|
|
4
|
+
label: string;
|
|
5
|
+
icon?: React.ComponentType<{
|
|
6
|
+
size?: number;
|
|
7
|
+
className?: string;
|
|
8
|
+
}>;
|
|
9
|
+
action: () => void;
|
|
10
|
+
variant?: 'default' | 'outline' | 'ghost';
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
disabledReason?: string;
|
|
13
|
+
}
|
|
14
|
+
export type ViewMode = 'table' | 'list' | 'grid';
|
|
15
|
+
export interface CrudActionBarProps<T extends BaseEntity = BaseEntity> {
|
|
16
|
+
onNew?: () => void;
|
|
17
|
+
newButtonLabel?: string;
|
|
18
|
+
showNewButton?: boolean;
|
|
19
|
+
showSearch?: boolean;
|
|
20
|
+
searchValue?: string;
|
|
21
|
+
onSearchChange?: (value: string) => void;
|
|
22
|
+
searchPlaceholder?: string;
|
|
23
|
+
showBulkActions?: boolean;
|
|
24
|
+
selectedCount?: number;
|
|
25
|
+
bulkActions?: BulkAction<T>[];
|
|
26
|
+
onBulkDelete?: () => void;
|
|
27
|
+
onClearSelection?: () => void;
|
|
28
|
+
customActions?: CustomAction[];
|
|
29
|
+
filters?: React.ReactNode;
|
|
30
|
+
viewMode?: ViewMode;
|
|
31
|
+
onViewModeChange?: (mode: ViewMode) => void;
|
|
32
|
+
showViewToggle?: boolean;
|
|
33
|
+
availableViewModes?: ViewMode[];
|
|
34
|
+
className?: string;
|
|
35
|
+
}
|
|
36
|
+
declare function CrudActionBarComponent<T extends BaseEntity = BaseEntity>({ onNew, newButtonLabel, showNewButton, showSearch, searchValue, onSearchChange, searchPlaceholder, showBulkActions, selectedCount, bulkActions, onBulkDelete, onClearSelection, customActions, filters, viewMode, onViewModeChange, showViewToggle, availableViewModes, className, }: CrudActionBarProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export declare const CrudActionBar: typeof CrudActionBarComponent;
|
|
38
|
+
export default CrudActionBar;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CrudColumn, CrudManager, BaseEntity, BulkAction } from '../../types';
|
|
3
|
+
import { type CustomAction, type ViewMode } from './CrudActionBar';
|
|
4
|
+
export interface CrudGridProps<T extends BaseEntity & {
|
|
5
|
+
is_actived?: boolean;
|
|
6
|
+
}> {
|
|
7
|
+
manager: CrudManager<T>;
|
|
8
|
+
columns: CrudColumn<T>[];
|
|
9
|
+
onEdit?: (item: T) => void;
|
|
10
|
+
onView?: (item: T) => void;
|
|
11
|
+
onToggleStatus?: (item: T) => void;
|
|
12
|
+
onDelete?: (item: T) => void;
|
|
13
|
+
renderActions?: (item: T) => React.ReactNode;
|
|
14
|
+
customRowActions?: (item: T) => Array<{
|
|
15
|
+
icon: any;
|
|
16
|
+
label: string;
|
|
17
|
+
onClick: () => void;
|
|
18
|
+
}>;
|
|
19
|
+
enableBulkActions?: boolean;
|
|
20
|
+
onNew?: () => void;
|
|
21
|
+
newButtonLabel?: string;
|
|
22
|
+
showNewButton?: boolean;
|
|
23
|
+
customActions?: CustomAction[];
|
|
24
|
+
/** @deprecated Use showActionBar={false} instead */
|
|
25
|
+
hideActionBar?: boolean;
|
|
26
|
+
showActionBar?: boolean;
|
|
27
|
+
showSearch?: boolean;
|
|
28
|
+
searchValue?: string;
|
|
29
|
+
onSearchChange?: (value: string) => void;
|
|
30
|
+
searchPlaceholder?: string;
|
|
31
|
+
bulkActions?: BulkAction<T>[];
|
|
32
|
+
onBulkDelete?: () => void;
|
|
33
|
+
filters?: React.ReactNode;
|
|
34
|
+
gridColumns?: 1 | 2 | 3 | 4;
|
|
35
|
+
renderCard?: (item: T) => React.ReactNode;
|
|
36
|
+
viewMode?: ViewMode;
|
|
37
|
+
onViewModeChange?: (mode: ViewMode) => void;
|
|
38
|
+
listCardRenderer?: (item: T) => React.ReactNode;
|
|
39
|
+
gridCardRenderer?: (item: T) => React.ReactNode;
|
|
40
|
+
showViewToggle?: boolean;
|
|
41
|
+
}
|
|
42
|
+
export declare const CrudGrid: <T extends BaseEntity>({ manager, columns, onEdit, onView, onToggleStatus, onDelete, renderActions, customRowActions, enableBulkActions, onNew, newButtonLabel, showNewButton, customActions, hideActionBar, showActionBar, showSearch, searchValue, onSearchChange, searchPlaceholder, bulkActions, onBulkDelete, filters, gridColumns, renderCard, viewMode, onViewModeChange, listCardRenderer, gridCardRenderer, showViewToggle }: CrudGridProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
export default CrudGrid;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CrudPagination - Paginação CRUD com integração ao CrudManager
|
|
3
|
+
*
|
|
4
|
+
* Usa o primitivo Pagination com lógica de CRUD injetada.
|
|
5
|
+
* Antigo nome: TableFooter
|
|
6
|
+
*/
|
|
7
|
+
import type { CrudManager, BaseEntity } from '../../types';
|
|
8
|
+
interface CrudPaginationProps<T extends BaseEntity> {
|
|
9
|
+
manager: Pick<CrudManager<T>, 'pagination' | 'handlePageChange' | 'handleItemsPerPageChange'>;
|
|
10
|
+
}
|
|
11
|
+
export declare function CrudPagination<T extends BaseEntity>({ manager }: CrudPaginationProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export { CrudPagination as TableFooter };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CrudColumn, CrudManager, BaseEntity, BulkAction } from '../../types';
|
|
3
|
+
import { type CustomAction, type ViewMode } from './CrudActionBar';
|
|
4
|
+
export interface CrudTableProps<T extends BaseEntity & {
|
|
5
|
+
is_actived?: boolean;
|
|
6
|
+
}> {
|
|
7
|
+
manager: CrudManager<T>;
|
|
8
|
+
columns: CrudColumn<T>[];
|
|
9
|
+
onEdit?: (item: T) => void;
|
|
10
|
+
onView?: (item: T) => void;
|
|
11
|
+
onToggleStatus?: (item: T) => void;
|
|
12
|
+
onDelete?: (item: T) => void;
|
|
13
|
+
renderActions?: (item: T) => React.ReactNode;
|
|
14
|
+
customRowActions?: (item: T) => Array<{
|
|
15
|
+
icon: any;
|
|
16
|
+
label: string;
|
|
17
|
+
onClick: () => void;
|
|
18
|
+
}>;
|
|
19
|
+
enableBulkActions?: boolean;
|
|
20
|
+
onNew?: () => void;
|
|
21
|
+
newButtonLabel?: string;
|
|
22
|
+
showNewButton?: boolean;
|
|
23
|
+
customActions?: CustomAction[];
|
|
24
|
+
/** @deprecated Use showActionBar={false} instead */
|
|
25
|
+
hideActionBar?: boolean;
|
|
26
|
+
showActionBar?: boolean;
|
|
27
|
+
showSearch?: boolean;
|
|
28
|
+
searchValue?: string;
|
|
29
|
+
onSearchChange?: (value: string) => void;
|
|
30
|
+
searchPlaceholder?: string;
|
|
31
|
+
bulkActions?: BulkAction<T>[];
|
|
32
|
+
onBulkDelete?: () => void;
|
|
33
|
+
filters?: React.ReactNode;
|
|
34
|
+
viewMode?: ViewMode;
|
|
35
|
+
onViewModeChange?: (mode: ViewMode) => void;
|
|
36
|
+
showViewToggle?: boolean;
|
|
37
|
+
enableColumnResize?: boolean;
|
|
38
|
+
resizeStorageKey?: string;
|
|
39
|
+
}
|
|
40
|
+
export declare const CrudTable: <T extends BaseEntity>({ manager, columns, onEdit, onView, onToggleStatus, onDelete, renderActions, customRowActions, enableBulkActions, onNew, newButtonLabel, showNewButton, customActions, hideActionBar, showActionBar, showSearch, searchValue, onSearchChange, searchPlaceholder, bulkActions, onBulkDelete, filters, viewMode, onViewModeChange, showViewToggle, enableColumnResize, resizeStorageKey }: CrudTableProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
export default CrudTable;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import type { CrudManager, CrudFilter, CrudEntity } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Props do FilterBar
|
|
4
|
+
*/
|
|
5
|
+
interface FilterBarProps<T extends CrudEntity> {
|
|
6
|
+
/** Manager de CRUD com métodos de busca e limpeza de filtros */
|
|
7
|
+
manager: Pick<CrudManager<T>, 'searchTerm' | 'handleSearch' | 'clearFilters'>;
|
|
8
|
+
/** Array de filtros (busca e customizados) */
|
|
9
|
+
filters: CrudFilter[];
|
|
10
|
+
/**
|
|
11
|
+
* Se true, renderiza filtros inline (sem wrapper Stack).
|
|
12
|
+
* Usado na Action Bar para alinhar filtros horizontalmente com botões.
|
|
13
|
+
* @default false
|
|
14
|
+
*/
|
|
15
|
+
inline?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Barra de filtros para páginas CRUD
|
|
19
|
+
*
|
|
20
|
+
* Renderiza filtros de busca e customizados (Select, Checkbox, etc) para
|
|
21
|
+
* filtrar dados em páginas CRUD. Suporta dois modos de renderização:
|
|
22
|
+
* - **Standalone** (inline=false): Filtros em Stack vertical/horizontal
|
|
23
|
+
* - **Inline** (inline=true): Filtros sem wrapper, usados na Action Bar
|
|
24
|
+
*
|
|
25
|
+
* **Tipos de filtro suportados:**
|
|
26
|
+
* - `type: 'search'`: Campo de busca integrado com `manager.searchTerm`
|
|
27
|
+
* - `type: 'custom'`: Componente React customizado (Select, Checkbox, etc)
|
|
28
|
+
*
|
|
29
|
+
* **Botão "Limpar Filtros":**
|
|
30
|
+
* - Aparece quando `manager.searchTerm` tem valor
|
|
31
|
+
* - Chama `manager.clearFilters()` ao clicar
|
|
32
|
+
* - Para limpar filtros customizados, sobrescreva `clearFilters` no manager
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```typescript
|
|
36
|
+
* // Filtro de busca simples
|
|
37
|
+
* <FilterBar
|
|
38
|
+
* manager={manager}
|
|
39
|
+
* filters={[{ type: 'search' }]}
|
|
40
|
+
* />
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```typescript
|
|
45
|
+
* // Filtros customizados com Select
|
|
46
|
+
* import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from 'forlogic-core';
|
|
47
|
+
*
|
|
48
|
+
* function ProcessesPage() {
|
|
49
|
+
* const manager = useProcessCrud();
|
|
50
|
+
* const [statusFilter, setStatusFilter] = useState('all');
|
|
51
|
+
* const [departmentFilter, setDepartmentFilter] = useState('all');
|
|
52
|
+
*
|
|
53
|
+
* const filters: CrudFilter[] = [
|
|
54
|
+
* { type: 'search' },
|
|
55
|
+
* {
|
|
56
|
+
* type: 'custom',
|
|
57
|
+
* component: ({ value, onChange }) => (
|
|
58
|
+
* <Select value={value} onValueChange={onChange}>
|
|
59
|
+
* <SelectTrigger className="w-[180px]">
|
|
60
|
+
* <SelectValue placeholder="Status" />
|
|
61
|
+
* </SelectTrigger>
|
|
62
|
+
* <SelectContent>
|
|
63
|
+
* <SelectItem value="all">Todos</SelectItem>
|
|
64
|
+
* <SelectItem value="active">Ativos</SelectItem>
|
|
65
|
+
* <SelectItem value="inactive">Inativos</SelectItem>
|
|
66
|
+
* </SelectContent>
|
|
67
|
+
* </Select>
|
|
68
|
+
* ),
|
|
69
|
+
* props: { value: statusFilter, onChange: setStatusFilter }
|
|
70
|
+
* }
|
|
71
|
+
* ];
|
|
72
|
+
*
|
|
73
|
+
* return <FilterBar manager={manager} filters={filters} />;
|
|
74
|
+
* }
|
|
75
|
+
* ```
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```typescript
|
|
79
|
+
* // Filtrar dados com useMemo
|
|
80
|
+
* function ProcessesPage() {
|
|
81
|
+
* const manager = useProcessCrud();
|
|
82
|
+
* const [statusFilter, setStatusFilter] = useState('all');
|
|
83
|
+
*
|
|
84
|
+
* // Aplicar filtro customizado aos dados
|
|
85
|
+
* const filteredData = useMemo(() => {
|
|
86
|
+
* if (statusFilter === 'all') return manager.entities;
|
|
87
|
+
* return manager.entities.filter(item => item.status === statusFilter);
|
|
88
|
+
* }, [manager.entities, statusFilter]);
|
|
89
|
+
*
|
|
90
|
+
* // Passar dados filtrados para a tabela
|
|
91
|
+
* return <CrudTable manager={{ ...manager, entities: filteredData }} />;
|
|
92
|
+
* }
|
|
93
|
+
* ```
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* ```typescript
|
|
97
|
+
* // Implementar "Limpar Filtros" customizado
|
|
98
|
+
* function ProcessesPage() {
|
|
99
|
+
* const baseManager = useProcessCrud();
|
|
100
|
+
* const [statusFilter, setStatusFilter] = useState('all');
|
|
101
|
+
*
|
|
102
|
+
* // Sobrescrever clearFilters para resetar filtros customizados
|
|
103
|
+
* const manager = {
|
|
104
|
+
* ...baseManager,
|
|
105
|
+
* clearFilters: () => {
|
|
106
|
+
* baseManager.clearFilters(); // Limpa busca padrão
|
|
107
|
+
* setStatusFilter('all'); // Reseta filtro customizado
|
|
108
|
+
* }
|
|
109
|
+
* };
|
|
110
|
+
*
|
|
111
|
+
* return <FilterBar manager={manager} filters={[...]} />;
|
|
112
|
+
* }
|
|
113
|
+
* ```
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* ```typescript
|
|
117
|
+
* // Modo inline (usado na Action Bar)
|
|
118
|
+
* <div className="flex items-center gap-4">
|
|
119
|
+
* <Button>Novo</Button>
|
|
120
|
+
* <FilterBar
|
|
121
|
+
* manager={manager}
|
|
122
|
+
* filters={filters}
|
|
123
|
+
* inline={true} // Sem wrapper Stack
|
|
124
|
+
* />
|
|
125
|
+
* </div>
|
|
126
|
+
* ```
|
|
127
|
+
*
|
|
128
|
+
* @param props.manager Manager de CRUD com searchTerm, handleSearch, clearFilters
|
|
129
|
+
* @param props.filters Array de filtros (busca e customizados)
|
|
130
|
+
* @param props.inline Se true, renderiza sem wrapper Stack (para Action Bar)
|
|
131
|
+
*
|
|
132
|
+
* @see {@link CrudFilter} - Interface de configuração de filtros
|
|
133
|
+
* @see {@link createCrudPage} - Gerador de página CRUD que usa FilterBar
|
|
134
|
+
*/
|
|
135
|
+
export declare function FilterBar<T extends CrudEntity>({ manager, filters, inline, }: FilterBarProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
136
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface TableFooterProps {
|
|
2
|
+
manager: {
|
|
3
|
+
pagination?: {
|
|
4
|
+
totalItems?: number;
|
|
5
|
+
totalPages?: number;
|
|
6
|
+
};
|
|
7
|
+
currentPage?: number;
|
|
8
|
+
itemsPerPage?: number;
|
|
9
|
+
handlePageChange?: (page: number) => void;
|
|
10
|
+
handleItemsPerPageChange?: (itemsPerPage: number) => void;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export declare const TableFooter: ({ manager }: TableFooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export default TableFooter;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface TableRowActionsProps {
|
|
2
|
+
onEdit?: () => void;
|
|
3
|
+
onDelete?: () => void;
|
|
4
|
+
canDelete?: boolean;
|
|
5
|
+
onToggleStatus?: () => void;
|
|
6
|
+
isActive?: boolean;
|
|
7
|
+
customActions?: Array<{
|
|
8
|
+
icon: any;
|
|
9
|
+
label: string;
|
|
10
|
+
onClick: () => void;
|
|
11
|
+
}>;
|
|
12
|
+
}
|
|
13
|
+
export declare const TableRowActions: React.FC<TableRowActionsProps>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { CrudPageConfig, CrudEntity, FormSection, CrudFilter, BulkAction } from "../types";
|
|
3
|
+
interface SimpleCrudPageConfig<T extends CrudEntity> {
|
|
4
|
+
entityName: string;
|
|
5
|
+
entityNamePlural: string;
|
|
6
|
+
columns: any[];
|
|
7
|
+
formSections: FormSection[];
|
|
8
|
+
cardFields?: any[];
|
|
9
|
+
filters?: CrudFilter[];
|
|
10
|
+
defaultSort?: {
|
|
11
|
+
column: string;
|
|
12
|
+
direction: "asc" | "desc";
|
|
13
|
+
};
|
|
14
|
+
enableBulkActions?: boolean;
|
|
15
|
+
bulkActions?: BulkAction<T>[];
|
|
16
|
+
customActions?: Array<{
|
|
17
|
+
label: string;
|
|
18
|
+
icon?: React.ComponentType<{
|
|
19
|
+
size?: number;
|
|
20
|
+
className?: string;
|
|
21
|
+
}>;
|
|
22
|
+
variant?: "default" | "destructive" | "outline" | "ghost";
|
|
23
|
+
action: () => void;
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
disabledReason?: string;
|
|
26
|
+
}>;
|
|
27
|
+
customRowActions?: (item: T) => Array<{
|
|
28
|
+
icon: any;
|
|
29
|
+
label: string;
|
|
30
|
+
onClick: () => void;
|
|
31
|
+
}>;
|
|
32
|
+
customListView?: (items: T[], manager?: any) => React.ReactNode;
|
|
33
|
+
onEdit?: (entity: T) => T | void;
|
|
34
|
+
/** Handler customizado para o botão "Novo" (abre wizard/modal customizado) */
|
|
35
|
+
onNew?: () => void;
|
|
36
|
+
/** Usar roteamento customizado (desabilita BaseForm padrão) */
|
|
37
|
+
useCustomRouting?: boolean;
|
|
38
|
+
/** @deprecated Use showNewButton={false} instead */
|
|
39
|
+
hideNewButton?: boolean;
|
|
40
|
+
/** Exibir botão "Novo" (default: true) */
|
|
41
|
+
showNewButton?: boolean;
|
|
42
|
+
/** Texto customizado para o botão "Novo" */
|
|
43
|
+
newButtonLabel?: string;
|
|
44
|
+
/** Exibir busca integrada na Action Bar (default: false - usa busca global) */
|
|
45
|
+
showSearch?: boolean;
|
|
46
|
+
/** Placeholder para busca integrada */
|
|
47
|
+
searchPlaceholder?: string;
|
|
48
|
+
/** Exibir Action Bar (default: true) */
|
|
49
|
+
showActionBar?: boolean;
|
|
50
|
+
}
|
|
51
|
+
interface CrudPageGeneratorConfig<T extends CrudEntity> {
|
|
52
|
+
manager: any;
|
|
53
|
+
config: SimpleCrudPageConfig<T>;
|
|
54
|
+
onSave: (data: any) => void;
|
|
55
|
+
onEdit?: (entity: T) => T | void | Promise<T | void>;
|
|
56
|
+
onToggleStatus?: (item: T) => void;
|
|
57
|
+
}
|
|
58
|
+
declare function CrudPageInternal<T extends CrudEntity>({ manager, config, formSections, onSave, onToggleStatus, defaultSort, }: {
|
|
59
|
+
manager: any;
|
|
60
|
+
config: CrudPageConfig<T>;
|
|
61
|
+
formSections: FormSection[];
|
|
62
|
+
onSave: (data: any) => void;
|
|
63
|
+
onToggleStatus?: (item: T) => void;
|
|
64
|
+
defaultSort?: {
|
|
65
|
+
column: string;
|
|
66
|
+
direction: "asc" | "desc";
|
|
67
|
+
};
|
|
68
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
69
|
+
/**
|
|
70
|
+
* Gera uma página CRUD completa
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```typescript
|
|
74
|
+
* const CrudPage = createCrudPage({
|
|
75
|
+
* manager,
|
|
76
|
+
* config: { entityName: 'Funcionário', ... },
|
|
77
|
+
* onSave: handleSave
|
|
78
|
+
* });
|
|
79
|
+
* ```
|
|
80
|
+
*
|
|
81
|
+
* Ver README para exemplos completos
|
|
82
|
+
*/
|
|
83
|
+
export declare function createCrudPage<T extends CrudEntity>(generatorConfig: CrudPageGeneratorConfig<T>): React.FC<{
|
|
84
|
+
manager?: any;
|
|
85
|
+
}>;
|
|
86
|
+
export { CrudPageInternal };
|
|
87
|
+
/**
|
|
88
|
+
* Helper para criar handler de save (create ou update)
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```typescript
|
|
92
|
+
* const handleSave = createSimpleSaveHandler(
|
|
93
|
+
* manager,
|
|
94
|
+
* (data) => ({ ...data, alias }),
|
|
95
|
+
* (data) => ({ ...data })
|
|
96
|
+
* );
|
|
97
|
+
* ```
|
|
98
|
+
*/
|
|
99
|
+
export declare function createSimpleSaveHandler<T extends CrudEntity, TCreate, TUpdate>(manager: any, createTransform: (data: any) => TCreate, updateTransform: (data: any) => TUpdate): (data: any) => void;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { QualiexUserFieldMapping } from '../types';
|
|
2
|
+
interface SimpleServiceConfig {
|
|
3
|
+
tableName: string;
|
|
4
|
+
entityName: string;
|
|
5
|
+
schemaName?: string;
|
|
6
|
+
searchFields?: string[];
|
|
7
|
+
selectFields?: string;
|
|
8
|
+
enableQualiexEnrichment?: boolean;
|
|
9
|
+
/** Lista simples de campos de ID (ex: ['target_user_id', 'evaluator_user_id']) */
|
|
10
|
+
userIdFields?: string[];
|
|
11
|
+
/** Mapeamento granular de campos (sobrescreve userIdFields se presente) */
|
|
12
|
+
userFieldsMapping?: QualiexUserFieldMapping[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Cria um serviço CRUD completo com hook React Query
|
|
16
|
+
*
|
|
17
|
+
* Gera automaticamente service + hook integrado com cache, soft delete e RLS.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* const { service, useCrudHook } = createSimpleService<Example>({
|
|
22
|
+
* tableName: 'examples',
|
|
23
|
+
* entityName: 'exemplo',
|
|
24
|
+
* searchFields: ['title', 'description'],
|
|
25
|
+
* enableQualiexEnrichment: true
|
|
26
|
+
* });
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* Ver README para documentação completa sobre RLS policies e estrutura de tabela
|
|
30
|
+
*/
|
|
31
|
+
export declare function createSimpleService<T extends {
|
|
32
|
+
id: string;
|
|
33
|
+
id_user?: string | null;
|
|
34
|
+
}, TInsert = any, TUpdate = any>(config: SimpleServiceConfig): {
|
|
35
|
+
service: {
|
|
36
|
+
getAll(params?: import("..").QueryParams): Promise<import("..").PaginatedResponse<T & {
|
|
37
|
+
responsible_name?: string;
|
|
38
|
+
}>>;
|
|
39
|
+
getById(id: string): Promise<T>;
|
|
40
|
+
create(payload: TInsert): Promise<T>;
|
|
41
|
+
update(id: string, payload: TUpdate): Promise<T>;
|
|
42
|
+
delete(id: string): Promise<void>;
|
|
43
|
+
};
|
|
44
|
+
useCrudHook: (additionalFilters?: Record<string, any>, onSuccess?: () => void) => {
|
|
45
|
+
entities: any;
|
|
46
|
+
pagination: {
|
|
47
|
+
data: any;
|
|
48
|
+
currentPage: any;
|
|
49
|
+
totalPages: any;
|
|
50
|
+
totalItems: any;
|
|
51
|
+
itemsPerPage: any;
|
|
52
|
+
hasNextPage: any;
|
|
53
|
+
hasPreviousPage: any;
|
|
54
|
+
};
|
|
55
|
+
isLoading: boolean;
|
|
56
|
+
isCreating: boolean;
|
|
57
|
+
isUpdating: boolean;
|
|
58
|
+
isDeleting: boolean;
|
|
59
|
+
error: Error;
|
|
60
|
+
searchTerm: string;
|
|
61
|
+
sortField: string;
|
|
62
|
+
sortDirection: "desc" | "asc";
|
|
63
|
+
currentPage: number;
|
|
64
|
+
itemsPerPage: number;
|
|
65
|
+
queryKey: string;
|
|
66
|
+
createEntity: import("@tanstack/react-query").UseMutateFunction<T, any, TInsert, unknown>;
|
|
67
|
+
updateEntity: (id: string, data: TUpdate) => void;
|
|
68
|
+
deleteEntity: import("@tanstack/react-query").UseMutateFunction<void, any, string, unknown>;
|
|
69
|
+
save: (data: any, transform?: (data: any) => any) => void;
|
|
70
|
+
handleSearch: (search: string) => void;
|
|
71
|
+
handleSort: (field: string) => void;
|
|
72
|
+
handlePageChange: (newPage: number) => void;
|
|
73
|
+
handleItemsPerPageChange: (newLimit: number) => void;
|
|
74
|
+
clearFilters: () => void;
|
|
75
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<any, Error>>;
|
|
76
|
+
selectedIds: string[];
|
|
77
|
+
selectItem: (id: string) => void;
|
|
78
|
+
selectAll: () => void;
|
|
79
|
+
clearSelection: () => void;
|
|
80
|
+
isAllSelected: boolean;
|
|
81
|
+
bulkDelete: (ids: string[]) => Promise<void>;
|
|
82
|
+
isBulkDeleting: boolean;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
export {};
|