@pautena/react-design-system 0.18.0 → 0.19.0
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/action/action.d.ts +42 -0
- package/dist/autocomplete/autocomplete.d.ts +28 -0
- package/dist/board/board.d.ts +17 -0
- package/dist/bootstrap-dialog/bootstrap-dialog.d.ts +3 -0
- package/dist/center-container/center-container.d.ts +20 -4
- package/dist/confirm-dialog/confirm-dialog.d.ts +21 -1
- package/dist/content/content.d.ts +3 -0
- package/dist/content-placeholder/content-placeholder.d.ts +12 -0
- package/dist/date-range-calendar/date-range-calendar.d.ts +15 -0
- package/dist/date-range-picker/date-range-picker.d.ts +28 -0
- package/dist/dialog/dialog.types.d.ts +70 -0
- package/dist/drawerx/drawer/drawer.d.ts +3 -0
- package/dist/drawerx/drawer-app-bar/drawer-app-bar.d.ts +6 -0
- package/dist/drawerx/drawer-item/drawer-item.d.ts +3 -0
- package/dist/drawerx/drawer-layout/drawer-layout.d.ts +50 -3
- package/dist/drawerx/drawer-subheader/drawer-subheader.d.ts +3 -0
- package/dist/drawerx/drawer.types.d.ts +4 -6
- package/dist/enhanced-remote-table/enhanced-remote-table.d.ts +34 -0
- package/dist/enhanced-table/enhanced-table.d.ts +40 -2
- package/dist/form-dialog/form-dialog.d.ts +23 -1
- package/dist/group-value-card/group-value-card.d.ts +22 -0
- package/dist/header/header.d.ts +2 -2
- package/dist/header/header.types.d.ts +1 -3
- package/dist/header-layout/header-layout.d.ts +74 -6
- package/dist/index.cjs.js +103 -103
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.es.js +4581 -4803
- package/dist/index.es.js.map +1 -1
- package/dist/list-panel/list-panel.d.ts +18 -0
- package/dist/model-form/model-form.d.ts +5 -0
- package/dist/object-details/object-details.d.ts +4 -0
- package/dist/search-input/search-input.d.ts +41 -0
- package/dist/select/select.d.ts +42 -0
- package/dist/skeleton-card/skeleton-card.d.ts +12 -0
- package/dist/skeleton-grid/skeleton-grid.d.ts +12 -0
- package/dist/table-list/table-list.d.ts +3 -0
- package/dist/text-field/text-field.d.ts +18 -0
- package/dist/value-item/value-item.d.ts +3 -0
- package/package.json +15 -16
- package/dist/sign-in/index.d.ts +0 -1
- package/dist/sign-in/sign-in.d.ts +0 -8
package/dist/action/action.d.ts
CHANGED
|
@@ -2,18 +2,60 @@ import { Variant } from '@mui/material/styles/createTypography';
|
|
|
2
2
|
import { ReactElement } from 'react';
|
|
3
3
|
export type ActionVariant = "primary" | "error" | "warning" | "success";
|
|
4
4
|
export interface ActionProps {
|
|
5
|
+
/**
|
|
6
|
+
* The variant of the action.
|
|
7
|
+
*/
|
|
5
8
|
variant: ActionVariant;
|
|
9
|
+
/**
|
|
10
|
+
* The title of the action.
|
|
11
|
+
*/
|
|
6
12
|
title: string;
|
|
13
|
+
/**
|
|
14
|
+
* The variant of the title.
|
|
15
|
+
*/
|
|
7
16
|
titleVariant?: Extract<Variant, "h4" | "h5" | "h6">;
|
|
17
|
+
/**
|
|
18
|
+
* The description of the action.
|
|
19
|
+
*/
|
|
8
20
|
description?: string | ReactElement;
|
|
21
|
+
/**
|
|
22
|
+
* The variant of the description.
|
|
23
|
+
*/
|
|
9
24
|
descriptionVariant?: Variant;
|
|
25
|
+
/**
|
|
26
|
+
* The helper text for the action.
|
|
27
|
+
*/
|
|
10
28
|
helperText?: string;
|
|
29
|
+
/**
|
|
30
|
+
* The variant of the helper text.
|
|
31
|
+
*/
|
|
11
32
|
helperTextVariant?: Variant;
|
|
33
|
+
/**
|
|
34
|
+
* The text for the action button.
|
|
35
|
+
*/
|
|
12
36
|
buttonText: string;
|
|
37
|
+
/**
|
|
38
|
+
* Indicates if the action requires confirmation.
|
|
39
|
+
*/
|
|
13
40
|
confirmable?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* The title for the confirmation dialog.
|
|
43
|
+
*/
|
|
14
44
|
confirmTitle?: string;
|
|
45
|
+
/**
|
|
46
|
+
* The description for the confirmation dialog.
|
|
47
|
+
*/
|
|
15
48
|
confirmDescription?: string;
|
|
49
|
+
/**
|
|
50
|
+
* The passphrase required to perform action.
|
|
51
|
+
*/
|
|
16
52
|
passphrase?: string;
|
|
53
|
+
/**
|
|
54
|
+
* The callback function to be executed when the action is triggered.
|
|
55
|
+
*/
|
|
17
56
|
onAction: () => void;
|
|
18
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Renders an action button with a text that explains what it does.
|
|
60
|
+
*/
|
|
19
61
|
export declare const Action: ({ variant, title, titleVariant, description, descriptionVariant, buttonText, helperText, helperTextVariant, confirmable, passphrase, confirmTitle, confirmDescription, onAction, }: ActionProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,11 +1,39 @@
|
|
|
1
1
|
import { AutocompleteProps as MuiAutocompleteProps } from '@mui/material/Autocomplete';
|
|
2
2
|
import { default as React } from 'react';
|
|
3
3
|
import { ChipTypeMap } from '@mui/material/Chip';
|
|
4
|
+
/**
|
|
5
|
+
* Props for the Autocomplete component.
|
|
6
|
+
*/
|
|
4
7
|
export interface AutocompleteProps<T, Multiple extends boolean | undefined, DisableClearable extends boolean | undefined, FreeSolo extends boolean | undefined, ChipComponent extends React.ElementType = ChipTypeMap["defaultComponent"]> extends Omit<MuiAutocompleteProps<T, Multiple, DisableClearable, FreeSolo, ChipComponent>, "renderInput" | "onChange" | "color"> {
|
|
8
|
+
/**
|
|
9
|
+
* The label for the autocomplete input.
|
|
10
|
+
*/
|
|
5
11
|
label: string;
|
|
12
|
+
/**
|
|
13
|
+
* Optional helper text to display below the input.
|
|
14
|
+
*/
|
|
6
15
|
helperText?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Optional color for the autocomplete component.
|
|
18
|
+
*/
|
|
7
19
|
color?: string;
|
|
20
|
+
/**
|
|
21
|
+
* If `true`, indicates that data is being fetched.
|
|
22
|
+
*/
|
|
8
23
|
fetching?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Optional callback function that is called when the value changes.
|
|
26
|
+
*/
|
|
9
27
|
onChangeValue?: (value: T) => void;
|
|
10
28
|
}
|
|
29
|
+
export interface AutocompleteProps<T, Multiple extends boolean | undefined, DisableClearable extends boolean | undefined, FreeSolo extends boolean | undefined, ChipComponent extends React.ElementType = ChipTypeMap["defaultComponent"]> extends Omit<MuiAutocompleteProps<T, Multiple, DisableClearable, FreeSolo, ChipComponent>, "renderInput" | "onChange" | "color"> {
|
|
30
|
+
label: string;
|
|
31
|
+
helperText?: string;
|
|
32
|
+
color?: string;
|
|
33
|
+
fetching?: boolean;
|
|
34
|
+
onChangeValue?: (value: T) => void;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Autocomplete component that wraps the MUI Autocomplete component with additional props.
|
|
38
|
+
*/
|
|
11
39
|
export declare const Autocomplete: <T, Multiple extends boolean | undefined, DisableClearable extends boolean | undefined, FreeSolo extends boolean | undefined, ChipComponent extends React.ElementType = "div">(props: AutocompleteProps<T, Multiple, DisableClearable, FreeSolo, ChipComponent>) => import("react/jsx-runtime").JSX.Element;
|
package/dist/board/board.d.ts
CHANGED
|
@@ -1,8 +1,25 @@
|
|
|
1
1
|
import { SxProps, Theme } from '@mui/material/styles';
|
|
2
2
|
import { PropsWithChildren } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the Board component.
|
|
5
|
+
*/
|
|
3
6
|
export type BoardProps = PropsWithChildren<{
|
|
7
|
+
/**
|
|
8
|
+
* The content to be displayed on the board. It can be a single string or an array of strings.
|
|
9
|
+
*/
|
|
4
10
|
content: string | string[];
|
|
11
|
+
/**
|
|
12
|
+
* Optional spacing value for the board. It can be one of the values: 0, 1, 2, 3, 4, or 5.
|
|
13
|
+
*/
|
|
5
14
|
spacing?: 0 | 1 | 2 | 3 | 4 | 5;
|
|
15
|
+
/**
|
|
16
|
+
* Optional styling properties for the board, using the theme's styling system.
|
|
17
|
+
*/
|
|
6
18
|
sx?: SxProps<Theme>;
|
|
7
19
|
}>;
|
|
20
|
+
/**
|
|
21
|
+
* Board component that displays content within a styled Paper component.
|
|
22
|
+
* It supports rendering an array of content lines or a single content string.
|
|
23
|
+
* Additionally, it provides a button to copy the content to the clipboard.
|
|
24
|
+
*/
|
|
8
25
|
export declare const Board: ({ content: contentProp, spacing, children, sx }: BoardProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
import { BootstrapDialogDialogProps } from '../dialog/dialog.types';
|
|
2
|
+
/**
|
|
3
|
+
* A customizable dialog component. Use it as a base to create more dialogs
|
|
4
|
+
*/
|
|
2
5
|
export declare const BootstrapDialog: ({ open, title, component, componentProps, disabled, disableAccept, disableCancel, actions, children, loading, cancelable, callCloseWhenCancel, acceptable, acceptText, cancelText, onAccept, onCancel, onClose, acceptType, }: BootstrapDialogDialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +1,25 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
2
|
import { SxProps, Theme } from '@mui/material/styles';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Props for the CenterContainer component.
|
|
5
|
+
*/
|
|
6
|
+
export type CenterContainerProps = PropsWithChildren<{
|
|
7
|
+
/**
|
|
8
|
+
* If true, centers the content vertically.
|
|
9
|
+
* @default false
|
|
10
|
+
*/
|
|
5
11
|
centerVertical?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* If true, centers the content horizontally.
|
|
14
|
+
* @default false
|
|
15
|
+
*/
|
|
6
16
|
centerHorizontal?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Custom styles to be applied to the container.
|
|
19
|
+
*/
|
|
7
20
|
sx?: SxProps<Theme>;
|
|
8
|
-
}
|
|
21
|
+
}>;
|
|
22
|
+
/**
|
|
23
|
+
* A container component that centers its children both vertically and horizontally by default.
|
|
24
|
+
*/
|
|
9
25
|
export declare function CenterContainer({ children, centerVertical, centerHorizontal, sx, }: CenterContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,11 +1,31 @@
|
|
|
1
1
|
import { BootstrapDialogDialogProps } from '../dialog/dialog.types';
|
|
2
2
|
type OmitBaseDialogProps = "cancelable" | "acceptable" | "onAccept" | "onCancel" | "onClose" | "actions" | "callCloseWhenCancel" | "component" | "acceptType";
|
|
3
3
|
export interface ConfirmDialogProps extends Omit<BootstrapDialogDialogProps, OmitBaseDialogProps> {
|
|
4
|
+
/**
|
|
5
|
+
* Text to display on the confirm button.
|
|
6
|
+
*/
|
|
4
7
|
confirmText?: string;
|
|
5
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Text to display on the cancel button.
|
|
10
|
+
*/
|
|
11
|
+
cancelText?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Optional passphrase for additional confirmation.
|
|
14
|
+
*/
|
|
6
15
|
passphrase?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Callback function to handle cancel action.
|
|
18
|
+
*/
|
|
7
19
|
onCancel: () => void;
|
|
20
|
+
/**
|
|
21
|
+
* Callback function to handle confirm action.
|
|
22
|
+
*/
|
|
8
23
|
onConfirm: () => void;
|
|
9
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* ConfirmDialog component renders a dialog to ask a user to confirm an action
|
|
27
|
+
* with customizable title, confirmation and cancellation actions.
|
|
28
|
+
* It optionally requires a passphrase to enable the confirmation action.
|
|
29
|
+
*/
|
|
10
30
|
export declare const ConfirmDialog: ({ open, title, loading, disabled, confirmText, cancelText, passphrase, children, onConfirm, onCancel, }: ConfirmDialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
31
|
export {};
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Props for the ContentPlaceholder component.
|
|
4
|
+
*/
|
|
2
5
|
export type ContentPlaceholderProps = PropsWithChildren<{
|
|
6
|
+
/**
|
|
7
|
+
* Optional size of the placeholder.
|
|
8
|
+
*/
|
|
3
9
|
size?: number;
|
|
10
|
+
/**
|
|
11
|
+
* Optional padding for the placeholder.
|
|
12
|
+
*/
|
|
4
13
|
p?: number;
|
|
5
14
|
}>;
|
|
15
|
+
/**
|
|
16
|
+
* A component that serves as a placeholder for content, displaying a skeleton grid.
|
|
17
|
+
*/
|
|
6
18
|
export declare const ContentPlaceholder: ({ size, children, p }: ContentPlaceholderProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
type DateRange = [Date, Date | undefined];
|
|
2
|
+
/**
|
|
3
|
+
* Props for the DateRangeCalendar component.
|
|
4
|
+
*/
|
|
2
5
|
export interface DateRangeCalendarProps {
|
|
6
|
+
/**
|
|
7
|
+
* The default date range value.
|
|
8
|
+
*/
|
|
3
9
|
defaultValue: DateRange;
|
|
10
|
+
/**
|
|
11
|
+
* Callback function that is called when the date range value changes.
|
|
12
|
+
*
|
|
13
|
+
* @param value - The new date range value.
|
|
14
|
+
* @param updatedIndex - The index of the updated date range.
|
|
15
|
+
*/
|
|
4
16
|
onValueChange: (value: DateRange, updatedIndex: number) => void;
|
|
5
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* A Date Range Calendar component that allows users to select a range of dates.
|
|
20
|
+
*/
|
|
6
21
|
export declare const DateRangeCalendar: ({ defaultValue, onValueChange }: DateRangeCalendarProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
22
|
export {};
|
|
@@ -1,11 +1,39 @@
|
|
|
1
1
|
type DateRange = [Date, Date | undefined];
|
|
2
|
+
/**
|
|
3
|
+
* Props for the DateRangePicker component.
|
|
4
|
+
*/
|
|
2
5
|
export interface DateRangePickerProps {
|
|
6
|
+
/**
|
|
7
|
+
* The label for the date range picker.
|
|
8
|
+
*/
|
|
3
9
|
label: string;
|
|
10
|
+
/**
|
|
11
|
+
* The default value for the date range picker.
|
|
12
|
+
*/
|
|
4
13
|
defaultValue: DateRange;
|
|
14
|
+
/**
|
|
15
|
+
* The format in which the date range should be displayed.
|
|
16
|
+
*/
|
|
5
17
|
format: string;
|
|
18
|
+
/**
|
|
19
|
+
* If true, the date range picker will take up the full width of its container.
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
6
22
|
fullWidth?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* The size of the date range picker.
|
|
25
|
+
* @default "medium"
|
|
26
|
+
*/
|
|
7
27
|
size?: "small" | "medium";
|
|
28
|
+
/**
|
|
29
|
+
* Callback function that is called when the value of the date range picker changes.
|
|
30
|
+
* @param value - The new date range value.
|
|
31
|
+
* @param index - The index of the date range picker.
|
|
32
|
+
*/
|
|
8
33
|
onValueChange: (value: DateRange, index: number) => void;
|
|
9
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* DateRangePicker component allows users to select a date range.
|
|
37
|
+
*/
|
|
10
38
|
export declare const DateRangePicker: ({ defaultValue, format: fmt, label, fullWidth, onValueChange, size, }: DateRangePickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
39
|
export {};
|
|
@@ -6,24 +6,94 @@ export interface DialogAction {
|
|
|
6
6
|
color?: "inherit" | "primary" | "secondary" | "success" | "error" | "info" | "warning";
|
|
7
7
|
onClick?: () => void;
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* Props for the BootstrapDialog component.
|
|
11
|
+
*/
|
|
9
12
|
export type BootstrapDialogDialogProps = {
|
|
13
|
+
/**
|
|
14
|
+
* Whether the dialog is open.
|
|
15
|
+
*/
|
|
10
16
|
open: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* The title of the dialog.
|
|
19
|
+
*/
|
|
11
20
|
title: string;
|
|
21
|
+
/**
|
|
22
|
+
* Whether the dialog is in a loading state.
|
|
23
|
+
* @default false
|
|
24
|
+
*/
|
|
12
25
|
loading?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Whether the dialog is disabled.
|
|
28
|
+
* @default false
|
|
29
|
+
*/
|
|
13
30
|
disabled?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Whether the accept button is disabled.
|
|
33
|
+
* @default false
|
|
34
|
+
*/
|
|
14
35
|
disableAccept?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Whether the cancel button is disabled.
|
|
38
|
+
* @default false
|
|
39
|
+
*/
|
|
15
40
|
disableCancel?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Whether the dialog is cancelable.
|
|
43
|
+
* @default true
|
|
44
|
+
*/
|
|
16
45
|
cancelable?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Whether the dialog is acceptable.
|
|
48
|
+
* @default true
|
|
49
|
+
*/
|
|
17
50
|
acceptable?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Whether to call the onClose function when the cancel button is clicked.
|
|
53
|
+
* @default true
|
|
54
|
+
*/
|
|
18
55
|
callCloseWhenCancel?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Actions to be displayed in the dialog.
|
|
58
|
+
*/
|
|
19
59
|
actions?: DialogAction[];
|
|
60
|
+
/**
|
|
61
|
+
* Text for the cancel button.
|
|
62
|
+
* @default "Cancel"
|
|
63
|
+
*/
|
|
20
64
|
cancelText?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Text for the accept button.
|
|
67
|
+
* @default "Accept"
|
|
68
|
+
*/
|
|
21
69
|
acceptText?: string;
|
|
70
|
+
/**
|
|
71
|
+
* Type of the accept button.
|
|
72
|
+
* @default "button"
|
|
73
|
+
*/
|
|
22
74
|
acceptType?: "button" | "submit";
|
|
75
|
+
/**
|
|
76
|
+
* Function to call when the dialog is closed.
|
|
77
|
+
*/
|
|
23
78
|
onClose: () => void;
|
|
79
|
+
/**
|
|
80
|
+
* Function to call when the cancel button is clicked.
|
|
81
|
+
*/
|
|
24
82
|
onCancel?: () => void;
|
|
83
|
+
/**
|
|
84
|
+
* Function to call when the accept button is clicked.
|
|
85
|
+
*/
|
|
25
86
|
onAccept?: () => void;
|
|
87
|
+
/**
|
|
88
|
+
* Component to be rendered inside the dialog.
|
|
89
|
+
*/
|
|
26
90
|
component?: React.ElementType;
|
|
91
|
+
/**
|
|
92
|
+
* Props to be passed to the component.
|
|
93
|
+
*/
|
|
27
94
|
componentProps?: any;
|
|
95
|
+
/**
|
|
96
|
+
* Children to be rendered inside the dialog.
|
|
97
|
+
*/
|
|
28
98
|
children?: ReactNode | undefined;
|
|
29
99
|
};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { Theme } from '@mui/material/styles';
|
|
2
2
|
import { DrawerComponent } from '../drawer.types';
|
|
3
3
|
export declare const DrawerHeader: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<Theme>, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
4
|
+
/**
|
|
5
|
+
* Drawer component that provides a customizable drawer interface.
|
|
6
|
+
*/
|
|
4
7
|
export declare const Drawer: DrawerComponent;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { AppBarProps as MuiAppBarProps } from '@mui/material';
|
|
2
2
|
export interface DrawerAppBarProps extends MuiAppBarProps {
|
|
3
|
+
/**
|
|
4
|
+
* Title to display in the AppBar.
|
|
5
|
+
*/
|
|
3
6
|
title?: string;
|
|
4
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* DrawerAppBar component that renders an AppBar adapted to work inside a Drawer context.
|
|
10
|
+
*/
|
|
5
11
|
export declare const DrawerAppBar: ({ title, sx, children, ...rest }: DrawerAppBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -9,4 +9,7 @@ export interface DrawerItemProps {
|
|
|
9
9
|
*/
|
|
10
10
|
level?: number;
|
|
11
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Component representing a drawer item in the navigation drawer.
|
|
14
|
+
*/
|
|
12
15
|
export declare const DrawerItem: ({ item, level }: DrawerItemProps) => false | import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,20 +1,67 @@
|
|
|
1
1
|
import { DrawerProviderProps } from '../drawer-context';
|
|
2
2
|
import { DrawerAppBarProps } from '../drawer-app-bar';
|
|
3
3
|
import { DrawerContentProps, DrawerNavigation, DrawerProps } from '../drawer.types';
|
|
4
|
+
import { JSXElementConstructor } from 'react';
|
|
5
|
+
/**
|
|
6
|
+
* Interface representing the slots for the DrawerLayout component.
|
|
7
|
+
*/
|
|
4
8
|
export interface DrawerLayoutSlots {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Slot for the DrawerAppBar component.
|
|
11
|
+
* This component is responsible for rendering the app bar within the drawer layout.
|
|
12
|
+
*/
|
|
13
|
+
drawerAppBar?: JSXElementConstructor<DrawerAppBarProps>;
|
|
14
|
+
/**
|
|
15
|
+
* Slot for the Drawer component.
|
|
16
|
+
* This component is responsible for rendering the drawer within the drawer layout.
|
|
17
|
+
*/
|
|
18
|
+
drawer?: JSXElementConstructor<DrawerProps>;
|
|
19
|
+
/**
|
|
20
|
+
* Slot for the DrawerContent component.
|
|
21
|
+
* This component is responsible for rendering the content within the drawer layout.
|
|
22
|
+
*/
|
|
23
|
+
drawerContent?: JSXElementConstructor<DrawerContentProps>;
|
|
8
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Interface representing the slot properties for the DrawerLayout component.
|
|
27
|
+
*/
|
|
9
28
|
export interface DrawerLayoutSlotProps {
|
|
29
|
+
/**
|
|
30
|
+
* Properties for the DrawerAppBar component.
|
|
31
|
+
*/
|
|
10
32
|
drawerAppBar?: DrawerAppBarProps;
|
|
33
|
+
/**
|
|
34
|
+
* Properties for the Drawer component.
|
|
35
|
+
*/
|
|
11
36
|
drawer?: DrawerProps;
|
|
37
|
+
/**
|
|
38
|
+
* Properties for the DrawerContent component.
|
|
39
|
+
*/
|
|
12
40
|
drawerContent?: DrawerContentProps;
|
|
13
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* Props for the DrawerLayout component.
|
|
44
|
+
*/
|
|
14
45
|
export interface DrawerLayoutProps extends DrawerProviderProps {
|
|
46
|
+
/**
|
|
47
|
+
* The title of the drawer layout.
|
|
48
|
+
*/
|
|
15
49
|
title: string;
|
|
50
|
+
/**
|
|
51
|
+
* The navigation configuration for the drawer.
|
|
52
|
+
*/
|
|
16
53
|
navigation: DrawerNavigation;
|
|
54
|
+
/**
|
|
55
|
+
* Optional slots for custom rendering within the drawer layout.
|
|
56
|
+
*/
|
|
17
57
|
slots?: DrawerLayoutSlots;
|
|
58
|
+
/**
|
|
59
|
+
* Optional props for the slots.
|
|
60
|
+
*/
|
|
18
61
|
slotsProps?: DrawerLayoutSlotProps;
|
|
19
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* DrawerLayout component provides a layout structure with a drawer and an app bar.
|
|
65
|
+
* It allows customization of the drawer, app bar, and drawer content through slots and slot properties.
|
|
66
|
+
*/
|
|
20
67
|
export declare const DrawerLayout: ({ children, navigation, title, slots, slotsProps, ...rest }: DrawerLayoutProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import { ListSubheaderProps } from '@mui/material/ListSubheader';
|
|
2
2
|
export type DrawerSubheaderProps = ListSubheaderProps;
|
|
3
|
+
/**
|
|
4
|
+
* A functional component that renders a `ListSubheader` with custom styles.
|
|
5
|
+
*/
|
|
3
6
|
export declare const DrawerSubheader: ({ sx, ...rest }: DrawerSubheaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FunctionComponent, ReactElement } from 'react';
|
|
1
|
+
import { CSSProperties, FunctionComponent, PropsWithChildren, ReactElement } from 'react';
|
|
2
2
|
import { BulletVariant } from '../bullet';
|
|
3
3
|
import { LabelVariant } from '../label';
|
|
4
4
|
import { DrawerProps as MuiDrawerProps } from '@mui/material/Drawer';
|
|
@@ -47,14 +47,12 @@ export interface DrawerContentProps {
|
|
|
47
47
|
}
|
|
48
48
|
export type DrawerContentComponent = FunctionComponent<DrawerContentProps>;
|
|
49
49
|
export type DrawerContentElement = ReactElement<DrawerContentProps, DrawerContentComponent>;
|
|
50
|
-
export
|
|
51
|
-
children: DrawerContentElement;
|
|
52
|
-
}
|
|
50
|
+
export type DrawerProps = PropsWithChildren<MuiDrawerProps>;
|
|
53
51
|
export type DrawerComponent = FunctionComponent<DrawerProps>;
|
|
54
52
|
export type DrawerElement = ReactElement<DrawerProps, DrawerComponent>;
|
|
55
53
|
export declare const getDrawerItemColors: (theme: Theme, selected: boolean | undefined) => {
|
|
56
|
-
color
|
|
57
|
-
fontWeight:
|
|
54
|
+
color?: string;
|
|
55
|
+
fontWeight: CSSProperties["fontWeight"];
|
|
58
56
|
};
|
|
59
57
|
export type DrawerAppBarComponent = FunctionComponent<DrawerAppBarProps>;
|
|
60
58
|
export type DrawerAppBarElement = ReactElement<DrawerAppBarProps, DrawerAppBarComponent>;
|
|
@@ -1,12 +1,46 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { HeadCell, Order } from '../enhanced-table';
|
|
3
3
|
export interface EnhancedRemoteTableProps<T> {
|
|
4
|
+
/**
|
|
5
|
+
* The array of data to be displayed in the table.
|
|
6
|
+
*/
|
|
4
7
|
data: T[];
|
|
8
|
+
/**
|
|
9
|
+
* Indicates whether the table is in a loading state.
|
|
10
|
+
*/
|
|
5
11
|
loading: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* The default column to sort by.
|
|
14
|
+
*/
|
|
6
15
|
defaultSort: keyof T;
|
|
16
|
+
/**
|
|
17
|
+
* The default order of sorting (ascending or descending).
|
|
18
|
+
*/
|
|
7
19
|
defaultOrder?: Order;
|
|
20
|
+
/**
|
|
21
|
+
* The columns configuration for the table.
|
|
22
|
+
*/
|
|
8
23
|
columns: HeadCell<T>[];
|
|
24
|
+
/**
|
|
25
|
+
* A render function for each row of data.
|
|
26
|
+
*/
|
|
9
27
|
children: (data: T, index: number) => ReactNode;
|
|
28
|
+
/**
|
|
29
|
+
* Callback function to handle sorting requests.
|
|
30
|
+
*/
|
|
10
31
|
onRequestSort: (col: keyof T, orderBy: "asc" | "desc") => void;
|
|
11
32
|
}
|
|
33
|
+
export interface EnhancedRemoteTableProps<T> {
|
|
34
|
+
data: T[];
|
|
35
|
+
loading: boolean;
|
|
36
|
+
defaultSort: keyof T;
|
|
37
|
+
defaultOrder?: Order;
|
|
38
|
+
columns: HeadCell<T>[];
|
|
39
|
+
children: (data: T, index: number) => ReactNode;
|
|
40
|
+
onRequestSort: (col: keyof T, orderBy: "asc" | "desc") => void;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* EnhancedRemoteTable component provides a table with remote data handling capabilities.
|
|
44
|
+
* It supports sorting and displays a loading indicator while data is being fetched.
|
|
45
|
+
*/
|
|
12
46
|
export declare const EnhancedRemoteTable: <T>({ children, data, loading, columns, defaultSort, defaultOrder, onRequestSort, }: EnhancedRemoteTableProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,16 +1,54 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { HeadCell, Order } from './enhanced-table-head';
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Props for the EnhancedTable component.
|
|
5
|
+
*
|
|
6
|
+
* @template T - The type of data being displayed in the table.
|
|
7
|
+
*/
|
|
8
|
+
interface EnhancedTableProps<T> {
|
|
9
|
+
/**
|
|
10
|
+
* The array of data to be displayed in the table.
|
|
11
|
+
*/
|
|
4
12
|
readonly data: T[];
|
|
13
|
+
/**
|
|
14
|
+
* Optional. If true, enables the search functionality.
|
|
15
|
+
*/
|
|
5
16
|
search?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* The key of the data to sort by default.
|
|
19
|
+
*/
|
|
6
20
|
defaultSort: keyof T;
|
|
21
|
+
/**
|
|
22
|
+
* Optional. The default order of sorting (ascending or descending).
|
|
23
|
+
*/
|
|
7
24
|
defaultOrder?: Order;
|
|
25
|
+
/**
|
|
26
|
+
* Optional. If true, displays a loading indicator.
|
|
27
|
+
*/
|
|
8
28
|
loading?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* The columns configuration for the table.
|
|
31
|
+
*/
|
|
9
32
|
columns: HeadCell<T>[];
|
|
33
|
+
/**
|
|
34
|
+
* A render prop function that takes the sorted and filtered data and returns a ReactNode.
|
|
35
|
+
*/
|
|
10
36
|
children: (data: T[]) => ReactNode;
|
|
11
37
|
}
|
|
38
|
+
interface EnhancedTableProps<T> {
|
|
39
|
+
readonly data: T[];
|
|
40
|
+
search?: boolean;
|
|
41
|
+
defaultSort: keyof T;
|
|
42
|
+
defaultOrder?: Order;
|
|
43
|
+
loading?: boolean;
|
|
44
|
+
columns: HeadCell<T>[];
|
|
45
|
+
children: (data: T[]) => ReactNode;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* EnhancedTable component provides a table with sorting, filtering, and loading states.
|
|
49
|
+
*/
|
|
12
50
|
export declare const EnhancedTable: {
|
|
13
|
-
<T>({ children, data, search, columns, defaultSort, defaultOrder, loading, }:
|
|
51
|
+
<T>({ children, data, search, columns, defaultSort, defaultOrder, loading, }: EnhancedTableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
14
52
|
defaultProps: {
|
|
15
53
|
defaultOrder: string;
|
|
16
54
|
};
|
|
@@ -1,10 +1,32 @@
|
|
|
1
1
|
import { BootstrapDialogDialogProps } from '../dialog';
|
|
2
2
|
type OmitBaseDialogProps = "cancelable" | "acceptable" | "onAccept" | "onCancel" | "onClose" | "actions" | "callCloseWhenCancel" | "component" | "acceptType";
|
|
3
|
+
/**
|
|
4
|
+
* Props for the FormDialog component.
|
|
5
|
+
*/
|
|
3
6
|
export interface FormDialogProps<T> extends Omit<BootstrapDialogDialogProps, OmitBaseDialogProps> {
|
|
7
|
+
/**
|
|
8
|
+
* The text to display on the submit button.
|
|
9
|
+
* @default "Submit"
|
|
10
|
+
*/
|
|
4
11
|
submitText?: string;
|
|
5
|
-
|
|
12
|
+
/**
|
|
13
|
+
* The text to display on the cancel button.
|
|
14
|
+
* @default "Cancel"
|
|
15
|
+
*/
|
|
16
|
+
cancelText?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Callback function to be called when the cancel button is clicked.
|
|
19
|
+
*/
|
|
6
20
|
onCancel: () => void;
|
|
21
|
+
/**
|
|
22
|
+
* Callback function to be called when the submit button is clicked.
|
|
23
|
+
* @param data - The data to be submitted.
|
|
24
|
+
*/
|
|
7
25
|
onSubmit: (data: T) => void;
|
|
8
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* A generic form dialog component that wraps a BootstrapDialog and handles form submission.
|
|
29
|
+
* Put your form inside and receive the data validated using the input name field.
|
|
30
|
+
*/
|
|
9
31
|
export declare const FormDialog: <T>({ open, title, loading, disabled, submitText, cancelText, children, onSubmit, onCancel, }: FormDialogProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
10
32
|
export {};
|