@free-dom/react-components 2.0.0 → 2.0.1
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/README.md +126 -126
- package/dist/cjs/index.js +462 -1206
- package/dist/esm/index.js +417 -1166
- package/dist/types/components/AdvancedSelect/AdvancedSelect.d.ts +1 -1
- package/dist/types/components/Alert/Alert.helpers.d.ts +1 -1
- package/dist/types/components/Badge/Badge.d.ts +1 -1
- package/dist/types/components/Banner/Banner.d.ts +1 -1
- package/dist/types/components/Button/Button.d.ts +1 -1
- package/dist/types/components/Chip/Chip.d.ts +1 -1
- package/dist/types/components/DataGrid/DataGrid.d.ts +2 -0
- package/dist/types/components/DataGrid/DataGrid.types.d.ts +117 -0
- package/dist/types/components/DataGrid/index.d.ts +2 -0
- package/dist/types/components/DropdownMenu/DropdownMenu.d.ts +1 -1
- package/dist/types/components/DropdownMenu/DropdownMenuIcon.d.ts +1 -1
- package/dist/types/components/FileUpload/FileUpload.constants.d.ts +1 -1
- package/dist/types/components/FooterFallback/FooterFallback.d.ts +1 -0
- package/dist/types/components/FooterFallback/index.d.ts +1 -0
- package/dist/types/components/HeaderFallback/HeaderFallback.d.ts +42 -0
- package/dist/types/components/HeaderFallback/HeaderFallback.helpers.d.ts +1 -0
- package/dist/types/components/HeaderFallback/index.d.ts +1 -0
- package/dist/types/components/IconButton/IconButton.d.ts +1 -1
- package/dist/types/components/ImageCarousel/ImageCarouselItem.d.ts +1 -1
- package/dist/types/components/Link/Link.d.ts +1 -1
- package/dist/types/components/Select/Select.d.ts +1 -1
- package/dist/types/components/Select/StartAdornment.d.ts +1 -1
- package/dist/types/components/SidebarFallback/SidebarFallback.d.ts +19 -0
- package/dist/types/components/SidebarFallback/index.d.ts +1 -0
- package/dist/types/components/Spinner/Spinner.d.ts +11 -0
- package/dist/types/components/Spinner/index.d.ts +2 -0
- package/dist/types/components/Switch/Switch.d.ts +1 -1
- package/dist/types/components/Tabs/TabsItem.d.ts +1 -1
- package/dist/types/components/TextInput/StartAdornment.d.ts +1 -1
- package/dist/types/components/TextInput/TextInput.d.ts +1 -1
- package/dist/types/components/TextToolbar/BubbleDropdown/BubbleDropdown.d.ts +1 -1
- package/dist/types/components/TextToolbar/TextToolbar.constants.d.ts +1 -1
- package/dist/types/components/Timeline/TimelineDot.d.ts +1 -1
- package/dist/types/components/TotalCard/TotalCard.d.ts +1 -1
- package/dist/types/components/TotalCard/TotalCardActions.d.ts +1 -1
- package/dist/types/components/TotalCard/TotalCardContent.d.ts +1 -1
- package/dist/types/index.d.ts +197 -5
- package/package.json +128 -128
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import type { DataGridProps } from './DataGrid.types';
|
|
2
|
+
export declare function DataGrid<T extends Record<string, unknown>>({ columns, rows, title, subtitle, loading, fetched, getRowId, enableSelection, columnFormatters, separatorX, separatorY, striped, currentPage, pageSize, onCurrentPageChange, onPageSizeChange, sorting, onSortingChange, rowActions, rowPrimaryActions, actions, onRowsSelectionChange, pageSizes, totalCount, expandedRowComponent, expandedRowIds: ctrlExpIds, onExpandedRowIdsChange, getRowStyles, selectedRowIds: ctrlSelIds, lineDensity, }: DataGridProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { IconName, IconColor } from '@free-dom/react-icons';
|
|
3
|
+
export type Sorting = {
|
|
4
|
+
columnName: string;
|
|
5
|
+
direction: 'asc' | 'desc';
|
|
6
|
+
};
|
|
7
|
+
export type SummaryType = 'sum' | 'count' | 'max' | 'min' | 'avg';
|
|
8
|
+
export type SummaryItem<T> = {
|
|
9
|
+
columnName: keyof T;
|
|
10
|
+
type: SummaryType;
|
|
11
|
+
};
|
|
12
|
+
export type SummaryCalculator<T> = {
|
|
13
|
+
[key in SummaryType]?: (rows: T[], columnName: keyof T) => string | number;
|
|
14
|
+
};
|
|
15
|
+
export type DataGridColumn<T> = {
|
|
16
|
+
name: keyof T;
|
|
17
|
+
title?: string;
|
|
18
|
+
getCellValue?: (row: T, columnName: keyof T) => any;
|
|
19
|
+
align?: 'left' | 'center' | 'right';
|
|
20
|
+
width?: number | string;
|
|
21
|
+
wordWrapEnabled?: boolean;
|
|
22
|
+
style?: React.CSSProperties;
|
|
23
|
+
};
|
|
24
|
+
export type ColumnFormatterComponentProps<T, V = any> = {
|
|
25
|
+
column: DataGridColumn<T>;
|
|
26
|
+
value: V;
|
|
27
|
+
row?: T;
|
|
28
|
+
};
|
|
29
|
+
export type GetCellValueProps<T = any> = (row: T, columnName: keyof T) => any;
|
|
30
|
+
export type AddAndEditModalProps<T> = {
|
|
31
|
+
row: T;
|
|
32
|
+
onChange: (columnName: keyof T, value: unknown) => void;
|
|
33
|
+
onCancelChanges?: () => void;
|
|
34
|
+
type: 'add' | 'edit';
|
|
35
|
+
setFormIsValid?: (isValid: boolean) => void;
|
|
36
|
+
};
|
|
37
|
+
export type DeleteModalProps<T> = {
|
|
38
|
+
row: T;
|
|
39
|
+
};
|
|
40
|
+
export type ExpandedRowProps<T> = {
|
|
41
|
+
row: T;
|
|
42
|
+
};
|
|
43
|
+
export type ColumnInlineEditInputComponentProps<T, V = any> = {
|
|
44
|
+
column: DataGridColumn<T>;
|
|
45
|
+
value: V;
|
|
46
|
+
row?: T;
|
|
47
|
+
onChange: (newValue: V) => void;
|
|
48
|
+
setInvalid: (columnName: keyof T, invalid: boolean) => void;
|
|
49
|
+
};
|
|
50
|
+
export type Action = {
|
|
51
|
+
label: string;
|
|
52
|
+
disabled?: boolean;
|
|
53
|
+
hasPermission?: boolean;
|
|
54
|
+
onClick: (rowsId: (number | string)[] | undefined) => void | Promise<void>;
|
|
55
|
+
isPrimary?: boolean;
|
|
56
|
+
icon?: IconName;
|
|
57
|
+
iconPosition?: 'left' | 'right';
|
|
58
|
+
variant?: 'text' | 'primary' | 'danger' | 'secondary';
|
|
59
|
+
className?: string;
|
|
60
|
+
};
|
|
61
|
+
export type RowPrimaryActionsProps<T> = {
|
|
62
|
+
onClick: (row: T) => void;
|
|
63
|
+
description: string;
|
|
64
|
+
icon?: IconName;
|
|
65
|
+
iconColor?: IconColor;
|
|
66
|
+
renderIcon?: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
|
|
67
|
+
};
|
|
68
|
+
export type DataGridProps<T extends Record<string, unknown>> = {
|
|
69
|
+
columns: DataGridColumn<T>[];
|
|
70
|
+
rows: T[];
|
|
71
|
+
title?: string;
|
|
72
|
+
subtitle?: string;
|
|
73
|
+
loading?: boolean;
|
|
74
|
+
fetched?: boolean;
|
|
75
|
+
getRowId: (row: T) => string | number;
|
|
76
|
+
enableSelection?: boolean;
|
|
77
|
+
columnFormatters?: {
|
|
78
|
+
columns: (keyof T)[];
|
|
79
|
+
component: React.FunctionComponent<ColumnFormatterComponentProps<T>>;
|
|
80
|
+
}[];
|
|
81
|
+
separatorX?: boolean;
|
|
82
|
+
separatorY?: boolean;
|
|
83
|
+
striped?: boolean;
|
|
84
|
+
onAddRow?: (row: T) => void | Promise<void>;
|
|
85
|
+
onUpdateRow?: (params: {
|
|
86
|
+
oldRow: T;
|
|
87
|
+
newRow: T;
|
|
88
|
+
}) => void | Promise<void>;
|
|
89
|
+
onDeleteRow?: (row: T) => void | Promise<void>;
|
|
90
|
+
currentPage?: number;
|
|
91
|
+
pageSize?: number;
|
|
92
|
+
onCurrentPageChange?: (page: number) => void;
|
|
93
|
+
onPageSizeChange?: (pageSize: number) => void;
|
|
94
|
+
sorting?: Sorting[];
|
|
95
|
+
onSortingChange?: (sorting: Sorting[]) => void;
|
|
96
|
+
rowActions?: (row: T) => JSX.Element[];
|
|
97
|
+
hasDeletePermission?: boolean;
|
|
98
|
+
hasEditPermission?: boolean;
|
|
99
|
+
hasAddPermission?: boolean;
|
|
100
|
+
addRowLoading?: boolean;
|
|
101
|
+
actions?: Action[];
|
|
102
|
+
onRowsSelectionChange?: (rowsId: Array<number | string>) => void;
|
|
103
|
+
pageSizes?: number[];
|
|
104
|
+
totalPages?: number;
|
|
105
|
+
totalCount?: number;
|
|
106
|
+
rowPrimaryActions?: RowPrimaryActionsProps<T>[];
|
|
107
|
+
expandedRowComponent?: (props: ExpandedRowProps<T>) => JSX.Element;
|
|
108
|
+
expandedRowIds?: (string | number)[];
|
|
109
|
+
onExpandedRowIdsChange?: (rowsId: Array<number | string>) => void;
|
|
110
|
+
summaryItems?: SummaryItem<T>[];
|
|
111
|
+
getRowStyles?: (row: T) => React.CSSProperties | undefined;
|
|
112
|
+
selectedRowIds?: Array<number | string>;
|
|
113
|
+
addAndEditModalContent?: (props: AddAndEditModalProps<T>) => JSX.Element;
|
|
114
|
+
deleteModalContent?: (props: DeleteModalProps<T>) => JSX.Element;
|
|
115
|
+
showSearch?: boolean;
|
|
116
|
+
lineDensity?: 'compact' | 'comfortable' | 'default';
|
|
117
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { DataGrid } from './DataGrid';
|
|
2
|
+
export type { Action, AddAndEditModalProps, DeleteModalProps, DataGridColumn, ColumnFormatterComponentProps, GetCellValueProps, DataGridProps, ExpandedRowProps, ColumnInlineEditInputComponentProps, Sorting, SummaryItem, SummaryType, SummaryCalculator, } from './DataGrid.types';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as Menu from '@radix-ui/react-dropdown-menu';
|
|
2
|
-
import { IconName } from '@
|
|
2
|
+
import { IconName } from '@free-dom/react-icons';
|
|
3
3
|
import { DropdownMenuGroup } from './DropdownMenuGroup';
|
|
4
4
|
import { DropdownMenuIcon } from './DropdownMenuIcon';
|
|
5
5
|
import { DropdownMenuItem } from './DropdownMenuItem';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function FooterFallback(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FooterFallback } from './FooterFallback';
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
type MenuItem = {
|
|
2
|
+
id: string | number;
|
|
3
|
+
label: string;
|
|
4
|
+
icon?: string;
|
|
5
|
+
href?: string;
|
|
6
|
+
children?: MenuItem[];
|
|
7
|
+
};
|
|
8
|
+
type HeaderFallbackProps = {
|
|
9
|
+
/**
|
|
10
|
+
* Renderiza o nome do sistema
|
|
11
|
+
*/
|
|
12
|
+
systemName?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Objeto utilizado para renderizar informações sobre o usuário logado.
|
|
15
|
+
*/
|
|
16
|
+
user?: {
|
|
17
|
+
name: string;
|
|
18
|
+
registrationCode: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Função responsável por fazer o logout do usuário do sistema
|
|
22
|
+
*/
|
|
23
|
+
onLogout?: () => void | Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* Responsável por renderizar os componentes que formam os Breadcrumbs.
|
|
26
|
+
*/
|
|
27
|
+
crumbs?: React.ReactNode[];
|
|
28
|
+
/**
|
|
29
|
+
* Callback para voltar a rota anterior
|
|
30
|
+
*/
|
|
31
|
+
onGoBack?: () => void;
|
|
32
|
+
/**
|
|
33
|
+
* Itens do menu lateral (Sidebar). A sidebar é integrada ao header.
|
|
34
|
+
*/
|
|
35
|
+
menuItems?: MenuItem[];
|
|
36
|
+
/**
|
|
37
|
+
* Callback quando um item do menu lateral é clicado
|
|
38
|
+
*/
|
|
39
|
+
onMenuItemClick?: (item: MenuItem) => void;
|
|
40
|
+
};
|
|
41
|
+
export declare function HeaderFallback({ systemName, user, onLogout, crumbs, onGoBack, menuItems, onMenuItemClick, }: HeaderFallbackProps): import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getUserInitialsToAvatar(name: string | undefined): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { HeaderFallback } from './HeaderFallback';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IconName, IconProps } from '@
|
|
1
|
+
import { IconName, IconProps } from '@free-dom/react-icons';
|
|
2
2
|
import { ButtonHTMLAttributes, DetailedHTMLProps, ForwardRefExoticComponent, FunctionComponent, PropsWithoutRef, SVGProps } from 'react';
|
|
3
3
|
import { Combine } from '../../utils';
|
|
4
4
|
type IconButtonOwnProps = {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
type MenuItem = {
|
|
2
|
+
id: string | number;
|
|
3
|
+
label: string;
|
|
4
|
+
icon?: string;
|
|
5
|
+
href?: string;
|
|
6
|
+
children?: MenuItem[];
|
|
7
|
+
};
|
|
8
|
+
type SidebarFallbackProps = {
|
|
9
|
+
/**
|
|
10
|
+
* Itens do menu de navegação
|
|
11
|
+
*/
|
|
12
|
+
menuItems?: MenuItem[];
|
|
13
|
+
/**
|
|
14
|
+
* Callback quando um item do menu é clicado
|
|
15
|
+
*/
|
|
16
|
+
onMenuItemClick?: (item: MenuItem) => void;
|
|
17
|
+
};
|
|
18
|
+
export declare function SidebarFallback({ menuItems, onMenuItemClick, }: SidebarFallbackProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SidebarFallback } from './SidebarFallback';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type SpinnerProps = {
|
|
2
|
+
/**
|
|
3
|
+
* Texto que será exibido abaixo do spinner
|
|
4
|
+
*/
|
|
5
|
+
description?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Texto que será exibido caso o spinner permaneça por mais de 20 segundos na tela
|
|
8
|
+
*/
|
|
9
|
+
delayMessage?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare function Spinner({ description, delayMessage }: SpinnerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IconName } from '@
|
|
1
|
+
import { IconName } from '@free-dom/react-icons';
|
|
2
2
|
import { VariantColors } from '../../types';
|
|
3
3
|
import { ActionOption, TotalCardActionsProps } from './TotalCardActions';
|
|
4
4
|
import { TotalCardMetricsProps } from './TotalCardMetrics';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React$1 from 'react';
|
|
3
3
|
import React__default, { ForwardRefExoticComponent, PropsWithoutRef, DetailedHTMLProps, ButtonHTMLAttributes, FunctionComponent, SVGProps, PropsWithChildren, ReactNode, CSSProperties } from 'react';
|
|
4
|
-
import { IconName, IconProps } from '@
|
|
4
|
+
import { IconName, IconProps, IconColor } from '@free-dom/react-icons';
|
|
5
5
|
import { ReactDatePickerProps } from 'react-datepicker';
|
|
6
6
|
import * as Menu from '@radix-ui/react-dropdown-menu';
|
|
7
7
|
import { SelectInstance } from 'react-select';
|
|
@@ -1759,15 +1759,15 @@ declare namespace Stepper {
|
|
|
1759
1759
|
var Step: typeof StepComponent;
|
|
1760
1760
|
}
|
|
1761
1761
|
|
|
1762
|
-
type Action = {
|
|
1762
|
+
type Action$1 = {
|
|
1763
1763
|
/**
|
|
1764
1764
|
* Texto do botão de ação
|
|
1765
1765
|
*/
|
|
1766
1766
|
label: string;
|
|
1767
1767
|
} & Pick<ButtonProps, 'variant' | 'onClick'>;
|
|
1768
1768
|
type CardActionsProps = {
|
|
1769
|
-
primaryAction?: Action;
|
|
1770
|
-
secondaryAction?: Action;
|
|
1769
|
+
primaryAction?: Action$1;
|
|
1770
|
+
secondaryAction?: Action$1;
|
|
1771
1771
|
};
|
|
1772
1772
|
|
|
1773
1773
|
type CardContentProps = {
|
|
@@ -2803,4 +2803,196 @@ type DrawerProps = {
|
|
|
2803
2803
|
};
|
|
2804
2804
|
declare function Drawer({ open, onClose, children, maskClosable, title, destroyOnClose, forceRender, afterOpenChange, width: widthProp, placement, size, }: PropsWithChildren<DrawerProps>): react_jsx_runtime.JSX.Element;
|
|
2805
2805
|
|
|
2806
|
-
|
|
2806
|
+
type MenuItem$1 = {
|
|
2807
|
+
id: string | number;
|
|
2808
|
+
label: string;
|
|
2809
|
+
icon?: string;
|
|
2810
|
+
href?: string;
|
|
2811
|
+
children?: MenuItem$1[];
|
|
2812
|
+
};
|
|
2813
|
+
type HeaderFallbackProps = {
|
|
2814
|
+
/**
|
|
2815
|
+
* Renderiza o nome do sistema
|
|
2816
|
+
*/
|
|
2817
|
+
systemName?: string;
|
|
2818
|
+
/**
|
|
2819
|
+
* Objeto utilizado para renderizar informações sobre o usuário logado.
|
|
2820
|
+
*/
|
|
2821
|
+
user?: {
|
|
2822
|
+
name: string;
|
|
2823
|
+
registrationCode: string;
|
|
2824
|
+
};
|
|
2825
|
+
/**
|
|
2826
|
+
* Função responsável por fazer o logout do usuário do sistema
|
|
2827
|
+
*/
|
|
2828
|
+
onLogout?: () => void | Promise<void>;
|
|
2829
|
+
/**
|
|
2830
|
+
* Responsável por renderizar os componentes que formam os Breadcrumbs.
|
|
2831
|
+
*/
|
|
2832
|
+
crumbs?: React.ReactNode[];
|
|
2833
|
+
/**
|
|
2834
|
+
* Callback para voltar a rota anterior
|
|
2835
|
+
*/
|
|
2836
|
+
onGoBack?: () => void;
|
|
2837
|
+
/**
|
|
2838
|
+
* Itens do menu lateral (Sidebar). A sidebar é integrada ao header.
|
|
2839
|
+
*/
|
|
2840
|
+
menuItems?: MenuItem$1[];
|
|
2841
|
+
/**
|
|
2842
|
+
* Callback quando um item do menu lateral é clicado
|
|
2843
|
+
*/
|
|
2844
|
+
onMenuItemClick?: (item: MenuItem$1) => void;
|
|
2845
|
+
};
|
|
2846
|
+
declare function HeaderFallback({ systemName, user, onLogout, crumbs, onGoBack, menuItems, onMenuItemClick, }: HeaderFallbackProps): react_jsx_runtime.JSX.Element;
|
|
2847
|
+
|
|
2848
|
+
type Sorting = {
|
|
2849
|
+
columnName: string;
|
|
2850
|
+
direction: 'asc' | 'desc';
|
|
2851
|
+
};
|
|
2852
|
+
type SummaryType = 'sum' | 'count' | 'max' | 'min' | 'avg';
|
|
2853
|
+
type SummaryItem<T> = {
|
|
2854
|
+
columnName: keyof T;
|
|
2855
|
+
type: SummaryType;
|
|
2856
|
+
};
|
|
2857
|
+
type SummaryCalculator<T> = {
|
|
2858
|
+
[key in SummaryType]?: (rows: T[], columnName: keyof T) => string | number;
|
|
2859
|
+
};
|
|
2860
|
+
type DataGridColumn<T> = {
|
|
2861
|
+
name: keyof T;
|
|
2862
|
+
title?: string;
|
|
2863
|
+
getCellValue?: (row: T, columnName: keyof T) => any;
|
|
2864
|
+
align?: 'left' | 'center' | 'right';
|
|
2865
|
+
width?: number | string;
|
|
2866
|
+
wordWrapEnabled?: boolean;
|
|
2867
|
+
style?: React__default.CSSProperties;
|
|
2868
|
+
};
|
|
2869
|
+
type ColumnFormatterComponentProps<T, V = any> = {
|
|
2870
|
+
column: DataGridColumn<T>;
|
|
2871
|
+
value: V;
|
|
2872
|
+
row?: T;
|
|
2873
|
+
};
|
|
2874
|
+
type AddAndEditModalProps<T> = {
|
|
2875
|
+
row: T;
|
|
2876
|
+
onChange: (columnName: keyof T, value: unknown) => void;
|
|
2877
|
+
onCancelChanges?: () => void;
|
|
2878
|
+
type: 'add' | 'edit';
|
|
2879
|
+
setFormIsValid?: (isValid: boolean) => void;
|
|
2880
|
+
};
|
|
2881
|
+
type DeleteModalProps<T> = {
|
|
2882
|
+
row: T;
|
|
2883
|
+
};
|
|
2884
|
+
type ExpandedRowProps<T> = {
|
|
2885
|
+
row: T;
|
|
2886
|
+
};
|
|
2887
|
+
type ColumnInlineEditInputComponentProps<T, V = any> = {
|
|
2888
|
+
column: DataGridColumn<T>;
|
|
2889
|
+
value: V;
|
|
2890
|
+
row?: T;
|
|
2891
|
+
onChange: (newValue: V) => void;
|
|
2892
|
+
setInvalid: (columnName: keyof T, invalid: boolean) => void;
|
|
2893
|
+
};
|
|
2894
|
+
type Action = {
|
|
2895
|
+
label: string;
|
|
2896
|
+
disabled?: boolean;
|
|
2897
|
+
hasPermission?: boolean;
|
|
2898
|
+
onClick: (rowsId: (number | string)[] | undefined) => void | Promise<void>;
|
|
2899
|
+
isPrimary?: boolean;
|
|
2900
|
+
icon?: IconName;
|
|
2901
|
+
iconPosition?: 'left' | 'right';
|
|
2902
|
+
variant?: 'text' | 'primary' | 'danger' | 'secondary';
|
|
2903
|
+
className?: string;
|
|
2904
|
+
};
|
|
2905
|
+
type RowPrimaryActionsProps<T> = {
|
|
2906
|
+
onClick: (row: T) => void;
|
|
2907
|
+
description: string;
|
|
2908
|
+
icon?: IconName;
|
|
2909
|
+
iconColor?: IconColor;
|
|
2910
|
+
renderIcon?: React__default.FunctionComponent<React__default.SVGProps<SVGSVGElement>>;
|
|
2911
|
+
};
|
|
2912
|
+
type DataGridProps<T extends Record<string, unknown>> = {
|
|
2913
|
+
columns: DataGridColumn<T>[];
|
|
2914
|
+
rows: T[];
|
|
2915
|
+
title?: string;
|
|
2916
|
+
subtitle?: string;
|
|
2917
|
+
loading?: boolean;
|
|
2918
|
+
fetched?: boolean;
|
|
2919
|
+
getRowId: (row: T) => string | number;
|
|
2920
|
+
enableSelection?: boolean;
|
|
2921
|
+
columnFormatters?: {
|
|
2922
|
+
columns: (keyof T)[];
|
|
2923
|
+
component: React__default.FunctionComponent<ColumnFormatterComponentProps<T>>;
|
|
2924
|
+
}[];
|
|
2925
|
+
separatorX?: boolean;
|
|
2926
|
+
separatorY?: boolean;
|
|
2927
|
+
striped?: boolean;
|
|
2928
|
+
onAddRow?: (row: T) => void | Promise<void>;
|
|
2929
|
+
onUpdateRow?: (params: {
|
|
2930
|
+
oldRow: T;
|
|
2931
|
+
newRow: T;
|
|
2932
|
+
}) => void | Promise<void>;
|
|
2933
|
+
onDeleteRow?: (row: T) => void | Promise<void>;
|
|
2934
|
+
currentPage?: number;
|
|
2935
|
+
pageSize?: number;
|
|
2936
|
+
onCurrentPageChange?: (page: number) => void;
|
|
2937
|
+
onPageSizeChange?: (pageSize: number) => void;
|
|
2938
|
+
sorting?: Sorting[];
|
|
2939
|
+
onSortingChange?: (sorting: Sorting[]) => void;
|
|
2940
|
+
rowActions?: (row: T) => JSX.Element[];
|
|
2941
|
+
hasDeletePermission?: boolean;
|
|
2942
|
+
hasEditPermission?: boolean;
|
|
2943
|
+
hasAddPermission?: boolean;
|
|
2944
|
+
addRowLoading?: boolean;
|
|
2945
|
+
actions?: Action[];
|
|
2946
|
+
onRowsSelectionChange?: (rowsId: Array<number | string>) => void;
|
|
2947
|
+
pageSizes?: number[];
|
|
2948
|
+
totalPages?: number;
|
|
2949
|
+
totalCount?: number;
|
|
2950
|
+
rowPrimaryActions?: RowPrimaryActionsProps<T>[];
|
|
2951
|
+
expandedRowComponent?: (props: ExpandedRowProps<T>) => JSX.Element;
|
|
2952
|
+
expandedRowIds?: (string | number)[];
|
|
2953
|
+
onExpandedRowIdsChange?: (rowsId: Array<number | string>) => void;
|
|
2954
|
+
summaryItems?: SummaryItem<T>[];
|
|
2955
|
+
getRowStyles?: (row: T) => React__default.CSSProperties | undefined;
|
|
2956
|
+
selectedRowIds?: Array<number | string>;
|
|
2957
|
+
addAndEditModalContent?: (props: AddAndEditModalProps<T>) => JSX.Element;
|
|
2958
|
+
deleteModalContent?: (props: DeleteModalProps<T>) => JSX.Element;
|
|
2959
|
+
showSearch?: boolean;
|
|
2960
|
+
lineDensity?: 'compact' | 'comfortable' | 'default';
|
|
2961
|
+
};
|
|
2962
|
+
|
|
2963
|
+
declare function DataGrid<T extends Record<string, unknown>>({ columns, rows, title, subtitle, loading, fetched, getRowId, enableSelection, columnFormatters, separatorX, separatorY, striped, currentPage, pageSize, onCurrentPageChange, onPageSizeChange, sorting, onSortingChange, rowActions, rowPrimaryActions, actions, onRowsSelectionChange, pageSizes, totalCount, expandedRowComponent, expandedRowIds: ctrlExpIds, onExpandedRowIdsChange, getRowStyles, selectedRowIds: ctrlSelIds, lineDensity, }: DataGridProps<T>): react_jsx_runtime.JSX.Element;
|
|
2964
|
+
|
|
2965
|
+
declare function FooterFallback(): react_jsx_runtime.JSX.Element;
|
|
2966
|
+
|
|
2967
|
+
type MenuItem = {
|
|
2968
|
+
id: string | number;
|
|
2969
|
+
label: string;
|
|
2970
|
+
icon?: string;
|
|
2971
|
+
href?: string;
|
|
2972
|
+
children?: MenuItem[];
|
|
2973
|
+
};
|
|
2974
|
+
type SidebarFallbackProps = {
|
|
2975
|
+
/**
|
|
2976
|
+
* Itens do menu de navegação
|
|
2977
|
+
*/
|
|
2978
|
+
menuItems?: MenuItem[];
|
|
2979
|
+
/**
|
|
2980
|
+
* Callback quando um item do menu é clicado
|
|
2981
|
+
*/
|
|
2982
|
+
onMenuItemClick?: (item: MenuItem) => void;
|
|
2983
|
+
};
|
|
2984
|
+
declare function SidebarFallback({ menuItems, onMenuItemClick, }: SidebarFallbackProps): react_jsx_runtime.JSX.Element;
|
|
2985
|
+
|
|
2986
|
+
type SpinnerProps = {
|
|
2987
|
+
/**
|
|
2988
|
+
* Texto que será exibido abaixo do spinner
|
|
2989
|
+
*/
|
|
2990
|
+
description?: string;
|
|
2991
|
+
/**
|
|
2992
|
+
* Texto que será exibido caso o spinner permaneça por mais de 20 segundos na tela
|
|
2993
|
+
*/
|
|
2994
|
+
delayMessage?: string;
|
|
2995
|
+
};
|
|
2996
|
+
declare function Spinner({ description, delayMessage }: SpinnerProps): react_jsx_runtime.JSX.Element;
|
|
2997
|
+
|
|
2998
|
+
export { Action, AddAndEditModalProps, AdvancedSelect, AdvancedSelectOption, Alert, Avatar, BackToTop, Badge, Banner, BarChart, Breadcrumbs, Button, Card, Checkbox, Chip, ColumnFormatterComponentProps, ColumnInlineEditInputComponentProps, DataGrid, DataGridColumn, DataGridProps, DatePicker, DeleteModalProps, Dialog, Divider, Drawer, DropdownMenu, ErrorBoundary, ExpandedRowProps, FileItemProp, FileUpload, FileUploadProps, Filter, FilterHandle, FooterFallback, HeaderFallback, IconButton, ImageCarousel, LineChart, Link, LinkProps, LinkRenderComponentProps, Mask, Modal, ModalAction, MultilineTextInput, NavigationMenu, NeedPermission, PasswordInput, PieChart, ProgressBar, RadioGroup, Rating, Select, SelectOption, SidebarFallback, Skeleton, Sorting, Spinner, SpinnerProps, Stepper, SummaryCalculator, SummaryItem, SummaryType, Switch, Tabs, Tag, TextInput, TextToolbar, Timeline, Toasts, Tooltip, TotalCard, Typography, UploadedFile, toast };
|