@digital-ai/dot-components 2.18.7 → 2.19.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/index.d.ts +1 -0
- package/index.esm.js +1174 -558
- package/index.umd.js +1450 -795
- package/lib/components/carousel/Carousel.d.ts +31 -0
- package/lib/components/carousel/Carousel.styles.d.ts +6 -0
- package/lib/components/index.d.ts +6 -2
- package/lib/components/list/utils/models.d.ts +1 -0
- package/lib/components/table/Table.d.ts +2 -68
- package/lib/components/table/TableBody.d.ts +4 -4
- package/lib/components/table/TableHeader.d.ts +1 -23
- package/lib/components/table/TableHeaderCell.d.ts +1 -1
- package/lib/components/table/TableRow.d.ts +4 -10
- package/lib/components/table/TableRowEmpty.d.ts +7 -0
- package/lib/components/table/collapsible-table/CollapsibleTable.d.ts +2 -0
- package/lib/components/table/{TableBodyCollapsibleTable.styles.d.ts → collapsible-table/CollapsibleTable.styles.d.ts} +1 -1
- package/lib/components/table/collapsible-table/CollapsibleTableBody.d.ts +2 -0
- package/lib/components/table/collapsible-table/ExpandCollapseCell.d.ts +3 -0
- package/lib/components/table/{TableBodyExpandCollapseCell.styles.d.ts → collapsible-table/ExpandCollapseCell.styles.d.ts} +1 -1
- package/lib/components/table/collapsible-table/index.d.ts +4 -0
- package/lib/components/table/collapsible-table/interfaces.d.ts +43 -0
- package/lib/components/table/index.d.ts +2 -3
- package/lib/components/table/utils/helpers.d.ts +2 -1
- package/lib/components/table/utils/interfaces.d.ts +87 -0
- package/lib/components/table/utils/models.d.ts +5 -21
- package/lib/theme-provider/ThemeProvider.d.ts +2 -1
- package/lib/theme-provider/colors/figma-colors.d.ts +3 -0
- package/lib/theme-provider/interfaces.d.ts +142 -0
- package/package.json +1 -1
- package/lib/components/table/TableBodyCollapsibleTable.d.ts +0 -8
- package/lib/components/table/TableBodyExpandCollapseCell.d.ts +0 -8
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { CommonProps } from '../CommonProps';
|
|
3
|
+
export declare type CarouselAnimationVariant = 'fade' | 'slide';
|
|
4
|
+
export declare type CarouselNavigationButtonDisplayOption = 'none' | 'top' | 'bottom' | 'center';
|
|
5
|
+
export interface CarouselProps extends CommonProps {
|
|
6
|
+
/** The animation shown when the carousel pages are changing. Default is `fade`. */
|
|
7
|
+
animation?: CarouselAnimationVariant;
|
|
8
|
+
/** If true, the pages of the carousel are changed automatically. */
|
|
9
|
+
autoPlay?: boolean;
|
|
10
|
+
/** Background color for the carousel. */
|
|
11
|
+
backgroundColor?: string;
|
|
12
|
+
/** The index of currently selected page. Use in controlled mode. */
|
|
13
|
+
currentPage?: number;
|
|
14
|
+
/** The option for displaying the arrow buttons. Default is `center`. */
|
|
15
|
+
displayNavigationButtons?: CarouselNavigationButtonDisplayOption;
|
|
16
|
+
/** Used with `autoPlay`. Duration in seconds for auto changing the carousel pages. Default is 3 s. */
|
|
17
|
+
duration?: number;
|
|
18
|
+
/** The index of initial selected page. Default is 0 (the first page). */
|
|
19
|
+
initialPage?: number;
|
|
20
|
+
/** Callback fired when the carousel page changes. Use in controlled mode (see `currentPage`). */
|
|
21
|
+
onPageChange?: (page: number) => void;
|
|
22
|
+
/** The array of pages to display in carousel. */
|
|
23
|
+
pagesContent: Array<ReactNode>;
|
|
24
|
+
/** Used with `autoPlay`. If true, the auto changing pages is paused when mouse is hovering the component. */
|
|
25
|
+
pauseAutoPlayOnHover?: boolean;
|
|
26
|
+
/** Used with `autoPlay`. If true, the linear progress bar is displayed on the bottom of carousel. */
|
|
27
|
+
progressIndicator?: boolean;
|
|
28
|
+
/** Determines whether you can see the pages buttons on bottom. True by default. */
|
|
29
|
+
showPagesButtons?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export declare const DotCarousel: ({ animation, ariaLabel, autoPlay, backgroundColor, className, currentPage, "data-testid": dataTestId, displayNavigationButtons, duration, initialPage, onPageChange, pagesContent, pauseAutoPlayOnHover, progressIndicator, showPagesButtons, }: CarouselProps) => JSX.Element;
|
|
@@ -19,7 +19,8 @@ export type { RadioButtonProps } from './radio/RadioButton';
|
|
|
19
19
|
export type { RadioGroupProps } from './radio/RadioGroup';
|
|
20
20
|
export type { BackItemProps, SidebarProps } from './sidebar/Sidebar';
|
|
21
21
|
export type { SwitchProps, SwitchColor, SwitchSize, SwitchLabelPlacement, } from './switch';
|
|
22
|
-
export type { CollapsibleTableOptions
|
|
22
|
+
export type { CollapsibleTableOptions } from './table/collapsible-table';
|
|
23
|
+
export type { DotColumnHeader, MultiSelect, Order, RowSelectionChangeHandler, RowsPerPageOption, TableActionProps, TableActionsProps, TableDataWithPagination, TableRowProps, TableRowSelectChangeHandler, TextAlignment, SortDirection, } from './table';
|
|
23
24
|
export type { TabProps } from './tabs/Tabs';
|
|
24
25
|
export type { TypographyVariant } from './typography/Typography';
|
|
25
26
|
export type { ProgressButtonProps } from './progress-button/ProgressButton';
|
|
@@ -36,6 +37,8 @@ export type { LinearProgressColor, LinearProgressProps, LinearProgressVariant, }
|
|
|
36
37
|
export type { DatePickerLocale, DatePickerProps, FieldChangeHandlerContext, } from './date-picker';
|
|
37
38
|
export type { TimePickerProps } from './time-picker';
|
|
38
39
|
export type { ClickAwayListenerProps } from './click-away-listener';
|
|
40
|
+
export type { StepProps } from './stepper/Stepper';
|
|
41
|
+
export type { CarouselAnimationVariant, CarouselNavigationButtonDisplayOption, CarouselProps, } from './carousel/Carousel';
|
|
39
42
|
export { DotAccordion } from './accordion/Accordion';
|
|
40
43
|
export { DotActionToolbar } from './action-toolbar/ActionToolbar';
|
|
41
44
|
export { DotAlertBanner } from './alert-banner/AlertBanner';
|
|
@@ -83,7 +86,7 @@ export { DotSidebar } from './sidebar/Sidebar';
|
|
|
83
86
|
export { DotSkeleton } from './skeleton/Skeleton';
|
|
84
87
|
export { DotSnackbar, DotSnackbarContainer, DotSnackbarProvider, useDotSnackbarContext, } from './snackbar';
|
|
85
88
|
export { DotSplitButton } from './split-button/SplitButton';
|
|
86
|
-
export { DotStepper
|
|
89
|
+
export { DotStepper } from './stepper/Stepper';
|
|
87
90
|
export { DotProgressButton } from './progress-button/ProgressButton';
|
|
88
91
|
export { DotSwitch } from './switch';
|
|
89
92
|
export { DotHeaderRow, DotTable, DotTablePagination, DotTableActions, DotTableAction, } from './table';
|
|
@@ -99,4 +102,5 @@ export { DotLinearProgress } from './linear-progress';
|
|
|
99
102
|
export { DatePickerKeydownContext, DotDatePicker, checkIfValidDate, } from './date-picker';
|
|
100
103
|
export { Daytime, DotTimePicker, mockScrollIntoView } from './time-picker';
|
|
101
104
|
export { DotClickAwayListener } from './click-away-listener';
|
|
105
|
+
export { DotCarousel } from './carousel/Carousel';
|
|
102
106
|
export { CreateUUID } from './createUUID';
|
|
@@ -36,6 +36,7 @@ export interface ListItemProps extends CommonProps {
|
|
|
36
36
|
endIcon?: ReactNode;
|
|
37
37
|
/** If provided, the list item will be rendered as a link */
|
|
38
38
|
href?: string;
|
|
39
|
+
id?: string;
|
|
39
40
|
isOpened?: boolean;
|
|
40
41
|
/** If provided, the menu item will display a nested list */
|
|
41
42
|
items?: Array<ListItemProps>;
|
|
@@ -1,71 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { DotColumnHeader, Order } from './TableHeader';
|
|
4
|
-
import { RowsPerPageOption } from './TablePagination';
|
|
5
|
-
import { TypographyVariant } from '../typography/Typography';
|
|
6
|
-
import { CollapsibleTableOptions, MultiSelect } from './utils/models';
|
|
7
|
-
import { PopperPlacement } from '../menu/Menu';
|
|
8
|
-
export declare const TABLE_TYPOGRAPHY_VARIANT = "body1";
|
|
9
|
-
export interface TableRowProps extends CommonProps {
|
|
10
|
-
/** row identifier that will be passed to onRowClick callback */
|
|
11
|
-
id?: string;
|
|
12
|
-
/** row data where keys map to column ids and values to cell values */
|
|
13
|
-
rowData: any;
|
|
14
|
-
/** if the row is selected */
|
|
15
|
-
selected?: boolean;
|
|
16
|
-
}
|
|
17
|
-
export interface TableProps extends CommonProps {
|
|
18
|
-
/** The popper placement for the actions menu **/
|
|
19
|
-
actionsMenuPlacement?: PopperPlacement;
|
|
20
|
-
/** Typography variant which will be used for table body cell values **/
|
|
21
|
-
bodyTypography?: TypographyVariant;
|
|
22
|
-
/** Optional collapsible-table object **/
|
|
23
|
-
collapsibleTableOptions?: CollapsibleTableOptions;
|
|
24
|
-
/** The table header columns */
|
|
25
|
-
columns: Array<DotColumnHeader>;
|
|
26
|
-
/** Total number of items for paginated table.
|
|
27
|
-
Prop is ignored for non-paginated tables (no rowsPerPage)
|
|
28
|
-
and for tables with internally managed sorting (no onUpdateData). */
|
|
29
|
-
count?: number;
|
|
30
|
-
/** The table body row data.
|
|
31
|
-
If paging/sorting are managed by consumer (onUpdateData callback provided) this is the data for the current page.
|
|
32
|
-
If paging/sorting are managed internally (no onUpdateData callback) this is all the data. */
|
|
33
|
-
data: Array<TableRowProps>;
|
|
34
|
-
/** Message that is shown if data is empty */
|
|
35
|
-
emptyMessage?: string;
|
|
36
|
-
/** Typography variant which will be used for table pagination **/
|
|
37
|
-
footerTypography?: TypographyVariant;
|
|
38
|
-
/** Typography variant which will be used for table header cell values **/
|
|
39
|
-
headerTypography?: TypographyVariant;
|
|
40
|
-
/** Customize the rows per page label. Default is 'Rows per page:' */
|
|
41
|
-
labelRowsPerPage?: ReactNode;
|
|
42
|
-
/** Table is loading */
|
|
43
|
-
loading?: boolean;
|
|
44
|
-
/** Maximum height of table container */
|
|
45
|
-
maxHeight?: string;
|
|
46
|
-
/** Optional multi-select checkbox object **/
|
|
47
|
-
multiSelect?: MultiSelect;
|
|
48
|
-
/** Row click event callback */
|
|
49
|
-
onRowClick?: (event: MouseEvent, id: string) => void;
|
|
50
|
-
/** Update data callback if data is managed by consumer */
|
|
51
|
-
onUpdateData?: (order: Order, orderBy: string, page: number, rowsPerPage: number) => void;
|
|
52
|
-
/** The sort order of table data 'asc', 'desc' */
|
|
53
|
-
order?: Order;
|
|
54
|
-
/** The ID of the column that you are sorting by */
|
|
55
|
-
orderBy?: string;
|
|
56
|
-
/** The zero-based index of the current page for paginated table */
|
|
57
|
-
page?: number;
|
|
58
|
-
/** Rows per page for paginated table */
|
|
59
|
-
rowsPerPage?: RowsPerPageOption;
|
|
60
|
-
/** Customizes the options of the rows per page select field. Default: [10, 25, 50, 100, 150, 200] */
|
|
61
|
-
rowsPerPageOptions?: number[];
|
|
62
|
-
/** Table is sortable */
|
|
63
|
-
sortable?: boolean;
|
|
64
|
-
/** Table header is sticky */
|
|
65
|
-
stickyHeader?: boolean;
|
|
66
|
-
/** Toolbar displayed above column headers */
|
|
67
|
-
toolbar?: ReactNode;
|
|
68
|
-
}
|
|
1
|
+
import { Order } from './utils/models';
|
|
2
|
+
import { TableProps, TableRowProps } from './utils/interfaces';
|
|
69
3
|
export declare const sortComparator: (a: TableRowProps, b: TableRowProps, orderBy: string) => 0 | 1 | -1;
|
|
70
4
|
export declare const getComparator: (order: Order, orderBy: string) => (a: TableRowProps, b: TableRowProps) => number;
|
|
71
5
|
export declare function stableSort<T>(array: T[], comparator: (order: T, orderBy: T) => number): T[];
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { MouseEvent } from 'react';
|
|
2
|
-
import { DotColumnHeader } from './TableHeader';
|
|
3
|
-
import { TableRowProps } from './Table';
|
|
4
2
|
import { CommonProps } from '../CommonProps';
|
|
5
3
|
import { TypographyVariant } from '../typography/Typography';
|
|
6
|
-
import { CollapsibleTableBody, MultiSelectBody } from './utils/models';
|
|
7
4
|
import { PopperPlacement } from '../menu/Menu';
|
|
5
|
+
import { CollapsibleTableBodyProps } from './collapsible-table';
|
|
6
|
+
import { DotColumnHeader, TableRowProps } from './utils/interfaces';
|
|
7
|
+
import { MultiSelectBody } from './utils/models';
|
|
8
8
|
export interface TableBodyProps extends CommonProps {
|
|
9
9
|
/** The popper placement for the actions menu **/
|
|
10
10
|
actionsMenuPlacement?: PopperPlacement;
|
|
11
|
-
collapsibleTableBody?:
|
|
11
|
+
collapsibleTableBody?: CollapsibleTableBodyProps;
|
|
12
12
|
/** The table column headers **/
|
|
13
13
|
columns: Array<DotColumnHeader>;
|
|
14
14
|
/** The table body row data **/
|
|
@@ -1,26 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { TypographyVariant } from '../typography/Typography';
|
|
3
|
-
import { CollapsibleTableOptions, MultiSelectHeader } from './utils/models';
|
|
4
|
-
export interface DotColumnHeader {
|
|
5
|
-
align?: TextAlignment;
|
|
6
|
-
id: string;
|
|
7
|
-
label?: string;
|
|
8
|
-
sortable?: boolean;
|
|
9
|
-
truncate?: boolean;
|
|
10
|
-
width?: string;
|
|
11
|
-
}
|
|
12
|
-
export declare type Order = 'asc' | 'desc';
|
|
13
|
-
export interface HeaderProps {
|
|
14
|
-
collapsibleTableOptions?: CollapsibleTableOptions;
|
|
15
|
-
columns: Array<DotColumnHeader>;
|
|
16
|
-
multiSelectHeader?: MultiSelectHeader;
|
|
17
|
-
onRequestSort: (property: string) => void;
|
|
18
|
-
order?: Order;
|
|
19
|
-
/** The ID of the column that you are sorting by */
|
|
20
|
-
orderBy?: string;
|
|
21
|
-
sortable: boolean;
|
|
22
|
-
typography: TypographyVariant;
|
|
23
|
-
}
|
|
1
|
+
import { HeaderProps } from './utils/interfaces';
|
|
24
2
|
/**
|
|
25
3
|
* A wrapper component around the TableHead component from @material-ui. This component can be used
|
|
26
4
|
* to determine the functionality of the table header.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MouseEvent, ReactNode } from 'react';
|
|
2
2
|
import { TextAlignment } from './TableCell';
|
|
3
|
-
import { Order } from './TableHeader';
|
|
4
3
|
import { TypographyVariant } from '../typography/Typography';
|
|
4
|
+
import { Order } from './utils/models';
|
|
5
5
|
export declare type SortDirection = 'asc' | 'desc';
|
|
6
6
|
export interface HeaderCellProps {
|
|
7
7
|
/** Allows cell text alignment: left, right, center */
|
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
import { MouseEvent, ReactNode } from 'react';
|
|
2
|
-
import { DotColumnHeader } from './TableHeader';
|
|
3
2
|
import { CommonProps } from '../CommonProps';
|
|
4
|
-
import { TableRowProps } from './Table';
|
|
5
3
|
import { TypographyVariant } from '../typography/Typography';
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
message?: string;
|
|
10
|
-
typography: TypographyVariant;
|
|
11
|
-
}
|
|
4
|
+
import { CollapsibleTableBodyProps } from './collapsible-table';
|
|
5
|
+
import { DotColumnHeader, TableRowProps } from './utils/interfaces';
|
|
6
|
+
import { MultiSelectBody } from './utils/models';
|
|
12
7
|
export interface RowProps extends CommonProps {
|
|
13
|
-
collapsibleTableBody:
|
|
8
|
+
collapsibleTableBody: CollapsibleTableBodyProps;
|
|
14
9
|
/** The table column headers */
|
|
15
10
|
columns: Array<DotColumnHeader>;
|
|
16
11
|
/** The table body row data */
|
|
@@ -33,4 +28,3 @@ export interface RowProps extends CommonProps {
|
|
|
33
28
|
* for manipulating data prior to displaying the data inside the table
|
|
34
29
|
*/
|
|
35
30
|
export declare const DotTableRow: ({ collapsibleTableBody, columns, className, data, multiSelectBody, onActionMenuTrigger, onClick, rowKey, selected, typography, }: RowProps) => JSX.Element;
|
|
36
|
-
export declare const EmptyDotRow: ({ cols, message, typography, }: EmptyRowProps) => JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TypographyVariant } from '../typography/Typography';
|
|
2
|
+
export interface EmptyRowProps {
|
|
3
|
+
cols: number;
|
|
4
|
+
message?: string;
|
|
5
|
+
typography: TypographyVariant;
|
|
6
|
+
}
|
|
7
|
+
export declare const EmptyDotRow: ({ cols, message, typography, }: EmptyRowProps) => JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const CollapsibleTableClassName = "dot-collapsible-table-container";
|
|
2
2
|
export declare const StyledCollapsibleTableWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { TableCell } from '@mui/material';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const ExpandCollapseCellClassName = "dot-td-expand-collapse";
|
|
3
3
|
export declare const StyledTableBodyExpandCollapseCell: import("styled-components").StyledComponent<typeof TableCell, any, {}, never>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { DotCollapsibleTable } from './CollapsibleTable';
|
|
2
|
+
export { CollapsibleTableBody } from './CollapsibleTableBody';
|
|
3
|
+
export { ExpandCollapseCell } from './ExpandCollapseCell';
|
|
4
|
+
export type { AnotherCollapsibleTableBodyProps, CollapsibleTableBodyProps, CollapsibleTableOptions, ExpandCollapseCellProps, } from './interfaces';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { DotColumnHeader } from '../utils/interfaces';
|
|
2
|
+
import { CommonProps } from '../../CommonProps';
|
|
3
|
+
import { TypographyVariant } from '../../typography/Typography';
|
|
4
|
+
interface CollapsibleTableBaseProps {
|
|
5
|
+
/** Typography variant which will be used for nested-table body cell values **/
|
|
6
|
+
nestedTableBodyTypography?: TypographyVariant;
|
|
7
|
+
/** The nested-table header columns */
|
|
8
|
+
nestedTableColumns: Array<DotColumnHeader>;
|
|
9
|
+
/** Optional, message that is shown if nested-table data is empty */
|
|
10
|
+
nestedTableEmptyMessage?: string;
|
|
11
|
+
/** Typography variant which will be used for nested-table header cell values **/
|
|
12
|
+
nestedTableHeaderTypography?: TypographyVariant;
|
|
13
|
+
/** Optional, title for nested-table */
|
|
14
|
+
nestedTableTitle?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface CollapsibleTableOptions extends CollapsibleTableBaseProps {
|
|
17
|
+
/** Name of the property which will have the nested-table data in rowData object */
|
|
18
|
+
nestedTableDataPropName: string;
|
|
19
|
+
/** Row click (expand) event callback for async loading of nested-table data */
|
|
20
|
+
onRowExpand?: (rowId: string, setLoading: (loading: boolean) => void) => void;
|
|
21
|
+
}
|
|
22
|
+
export interface ExpandCollapseCellProps extends CommonProps {
|
|
23
|
+
isExpanded: boolean;
|
|
24
|
+
onRowExpandCollapse: (isExpanded: boolean, rowId: string) => void;
|
|
25
|
+
rowId: string;
|
|
26
|
+
}
|
|
27
|
+
export interface AnotherCollapsibleTableBodyProps extends CollapsibleTableBaseProps {
|
|
28
|
+
nestedTableRowData: Array<unknown>;
|
|
29
|
+
parentRowKey: string;
|
|
30
|
+
}
|
|
31
|
+
export interface CollapsibleTableProps {
|
|
32
|
+
collapsibleTableBody: CollapsibleTableBodyProps;
|
|
33
|
+
loading?: boolean;
|
|
34
|
+
parentRowKey: string;
|
|
35
|
+
rowData: unknown;
|
|
36
|
+
}
|
|
37
|
+
export interface CollapsibleTableBodyProps extends CollapsibleTableBaseProps {
|
|
38
|
+
expandedTableRowIds: string[];
|
|
39
|
+
/** Name of the property which will have the nested-table data in rowData object */
|
|
40
|
+
nestedTableDataPropName: string;
|
|
41
|
+
onRowExpandCollapseTable?: (isExpanded: boolean, rowId: string, setLoading: (loading: boolean) => void) => void;
|
|
42
|
+
}
|
|
43
|
+
export {};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
export type { TableRowProps } from './
|
|
1
|
+
export type { DotColumnHeader, TableRowProps } from './utils/interfaces';
|
|
2
2
|
export type { TableActionProps } from './TableAction';
|
|
3
3
|
export type { TableActionsProps } from './TableActions';
|
|
4
4
|
export type { TextAlignment } from './TableCell';
|
|
5
5
|
export type { TableDataWithPagination } from './TableDataWithPagination';
|
|
6
|
-
export type { DotColumnHeader, Order } from './TableHeader';
|
|
7
6
|
export type { SortDirection } from './TableHeaderCell';
|
|
8
7
|
export type { RowsPerPageOption } from './TablePagination';
|
|
9
|
-
export type {
|
|
8
|
+
export type { MultiSelect, TableRowSelectChangeHandler, RowSelectionChangeHandler, Order, } from './utils/models';
|
|
10
9
|
export { DotTablePagination } from './TablePagination';
|
|
11
10
|
export { DotTable } from './Table';
|
|
12
11
|
export { DotHeaderRow } from './TableHeader';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { TypographyVariant } from '../../typography/Typography';
|
|
3
|
-
import { TableRowProps } from '
|
|
3
|
+
import { TableRowProps } from './interfaces';
|
|
4
4
|
export declare const getFormattedTableCellValue: (value: any, typographyVariant: TypographyVariant) => ReactNode;
|
|
5
5
|
export declare const getContainerMaxHeightStyle: (stickyHeader?: boolean, maxHeight?: string) => string;
|
|
6
6
|
export declare const getSelectedRowIds: (id: string, isChecked: boolean, selectedIds: string[]) => string[];
|
|
7
7
|
export declare const getBulkSelectedRowIds: (isChecked: boolean, selectedIds: string[], pageData: TableRowProps[]) => string[];
|
|
8
8
|
export declare const getExpandedRowIds: (expandedIds: string[], id: string, isExpand: boolean) => string[];
|
|
9
|
+
export declare const parseCellMaxWidth: (width: string) => string;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { MouseEvent, ReactNode } from 'react';
|
|
2
|
+
import { CommonProps } from '../../CommonProps';
|
|
3
|
+
import { TypographyVariant } from '../../typography/Typography';
|
|
4
|
+
import { PopperPlacement } from '../../menu/Menu';
|
|
5
|
+
import { CollapsibleTableOptions } from '../collapsible-table/interfaces';
|
|
6
|
+
import { MultiSelect, MultiSelectHeader, Order } from './models';
|
|
7
|
+
import { TextAlignment } from '../TableCell';
|
|
8
|
+
import { RowsPerPageOption } from '../TablePagination';
|
|
9
|
+
export interface TableRowProps extends CommonProps {
|
|
10
|
+
/** row identifier that will be passed to onRowClick callback */
|
|
11
|
+
id?: string;
|
|
12
|
+
/** row data where keys map to column ids and values to cell values */
|
|
13
|
+
rowData: any;
|
|
14
|
+
/** if the row is selected */
|
|
15
|
+
selected?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface TableProps extends CommonProps {
|
|
18
|
+
/** The popper placement for the actions menu **/
|
|
19
|
+
actionsMenuPlacement?: PopperPlacement;
|
|
20
|
+
/** Typography variant which will be used for table body cell values **/
|
|
21
|
+
bodyTypography?: TypographyVariant;
|
|
22
|
+
/** Optional collapsible-table object **/
|
|
23
|
+
collapsibleTableOptions?: CollapsibleTableOptions;
|
|
24
|
+
/** The table header columns */
|
|
25
|
+
columns: Array<DotColumnHeader>;
|
|
26
|
+
/** Total number of items for paginated table.
|
|
27
|
+
Prop is ignored for non-paginated tables (no rowsPerPage)
|
|
28
|
+
and for tables with internally managed sorting (no onUpdateData). */
|
|
29
|
+
count?: number;
|
|
30
|
+
/** The table body row data.
|
|
31
|
+
If paging/sorting are managed by consumer (onUpdateData callback provided) this is the data for the current page.
|
|
32
|
+
If paging/sorting are managed internally (no onUpdateData callback) this is all the data. */
|
|
33
|
+
data: Array<TableRowProps>;
|
|
34
|
+
/** Message that is shown if data is empty */
|
|
35
|
+
emptyMessage?: string;
|
|
36
|
+
/** Typography variant which will be used for table pagination **/
|
|
37
|
+
footerTypography?: TypographyVariant;
|
|
38
|
+
/** Typography variant which will be used for table header cell values **/
|
|
39
|
+
headerTypography?: TypographyVariant;
|
|
40
|
+
/** Customize the rows per page label. Default is 'Rows per page:' */
|
|
41
|
+
labelRowsPerPage?: ReactNode;
|
|
42
|
+
/** Table is loading */
|
|
43
|
+
loading?: boolean;
|
|
44
|
+
/** Maximum height of table container */
|
|
45
|
+
maxHeight?: string;
|
|
46
|
+
/** Optional multi-select checkbox object **/
|
|
47
|
+
multiSelect?: MultiSelect;
|
|
48
|
+
/** Row click event callback */
|
|
49
|
+
onRowClick?: (event: MouseEvent, id: string) => void;
|
|
50
|
+
/** Update data callback if data is managed by consumer */
|
|
51
|
+
onUpdateData?: (order: Order, orderBy: string, page: number, rowsPerPage: number) => void;
|
|
52
|
+
/** The sort order of table data 'asc', 'desc' */
|
|
53
|
+
order?: Order;
|
|
54
|
+
/** The ID of the column that you are sorting by */
|
|
55
|
+
orderBy?: string;
|
|
56
|
+
/** The zero-based index of the current page for paginated table */
|
|
57
|
+
page?: number;
|
|
58
|
+
/** Rows per page for paginated table */
|
|
59
|
+
rowsPerPage?: RowsPerPageOption;
|
|
60
|
+
/** Customizes the options of the rows per page select field. Default: [10, 25, 50, 100, 150, 200] */
|
|
61
|
+
rowsPerPageOptions?: number[];
|
|
62
|
+
/** Table is sortable */
|
|
63
|
+
sortable?: boolean;
|
|
64
|
+
/** Table header is sticky */
|
|
65
|
+
stickyHeader?: boolean;
|
|
66
|
+
/** Toolbar displayed above column headers */
|
|
67
|
+
toolbar?: ReactNode;
|
|
68
|
+
}
|
|
69
|
+
export interface DotColumnHeader {
|
|
70
|
+
align?: TextAlignment;
|
|
71
|
+
id: string;
|
|
72
|
+
label?: string;
|
|
73
|
+
sortable?: boolean;
|
|
74
|
+
truncate?: boolean;
|
|
75
|
+
width?: string;
|
|
76
|
+
}
|
|
77
|
+
export interface HeaderProps {
|
|
78
|
+
collapsibleTableOptions?: CollapsibleTableOptions;
|
|
79
|
+
columns: Array<DotColumnHeader>;
|
|
80
|
+
multiSelectHeader?: MultiSelectHeader;
|
|
81
|
+
onRequestSort: (property: string) => void;
|
|
82
|
+
order?: Order;
|
|
83
|
+
/** The ID of the column that you are sorting by */
|
|
84
|
+
orderBy?: string;
|
|
85
|
+
sortable: boolean;
|
|
86
|
+
typography: TypographyVariant;
|
|
87
|
+
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { TableRowProps } from '
|
|
3
|
-
|
|
4
|
-
export declare
|
|
2
|
+
import { TableRowProps } from './interfaces';
|
|
3
|
+
export declare const TABLE_TYPOGRAPHY_VARIANT = "body1";
|
|
4
|
+
export declare const TABLE_DEFAULT_SKELETON_ROWS = 4;
|
|
5
|
+
export declare type Order = 'asc' | 'desc';
|
|
5
6
|
export declare type MultiSelectState = 'unchecked' | 'checked' | 'indeterminate';
|
|
7
|
+
export declare type RowSelectionChangeHandler = (isChecked: boolean, rowId: string) => void;
|
|
6
8
|
export declare type TableRowSelectChangeHandler = (isChecked: boolean, selectedTableRowIds: string[]) => void;
|
|
7
9
|
export interface MultiSelect {
|
|
8
10
|
bulkActions?: ReactNode;
|
|
@@ -20,22 +22,4 @@ export interface MultiSelectHeader extends MultiSelectTableBase {
|
|
|
20
22
|
export interface MultiSelectBody extends MultiSelectTableBase {
|
|
21
23
|
onCheckIndividualChange?: RowSelectionChangeHandler;
|
|
22
24
|
}
|
|
23
|
-
interface CollapsibleTableBase {
|
|
24
|
-
/** The nested-table header columns */
|
|
25
|
-
nestedTableColumns: Array<DotColumnHeader>;
|
|
26
|
-
/** Name of the property which has nested table data in rowData object */
|
|
27
|
-
nestedTableDataPropName: string;
|
|
28
|
-
/** Optional message that is shown if nested-table data is empty */
|
|
29
|
-
nestedTableEmptyMessage?: string;
|
|
30
|
-
/** Optional heading for nested-table */
|
|
31
|
-
nestedTableTitle?: string;
|
|
32
|
-
}
|
|
33
|
-
export interface CollapsibleTableOptions extends CollapsibleTableBase {
|
|
34
|
-
/** Row click (expand) event callback for async loading of nested-table data */
|
|
35
|
-
onRowExpand?: (rowId: string, setLoading: (loading: boolean) => void) => void;
|
|
36
|
-
}
|
|
37
|
-
export interface CollapsibleTableBody extends CollapsibleTableBase {
|
|
38
|
-
expandedTableRowIds: string[];
|
|
39
|
-
onRowExpandCollapseTable?: (isExpanded: boolean, rowId: string, setLoading: (loading: boolean) => void) => void;
|
|
40
|
-
}
|
|
41
25
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { Theme } from '@mui/material';
|
|
3
3
|
import { TypographyOptions } from '@mui/material/styles/createTypography';
|
|
4
|
-
import { AvatarPaletteColorOptions, IconPaletteColorOptions, LayerPaletteColorOptions } from './interfaces';
|
|
4
|
+
import { AvatarPaletteColorOptions, FigmaTheme, IconPaletteColorOptions, LayerPaletteColorOptions } from './interfaces';
|
|
5
5
|
declare module '@mui/material/styles/createPalette' {
|
|
6
6
|
interface Palette {
|
|
7
7
|
layer: LayerPaletteColorOptions;
|
|
@@ -9,6 +9,7 @@ declare module '@mui/material/styles/createPalette' {
|
|
|
9
9
|
}
|
|
10
10
|
interface PaletteOptions {
|
|
11
11
|
avatarColors: AvatarPaletteColorOptions;
|
|
12
|
+
figma: FigmaTheme;
|
|
12
13
|
icon: IconPaletteColorOptions;
|
|
13
14
|
layer: LayerPaletteColorOptions;
|
|
14
15
|
purple?: PaletteColorOptions;
|
|
@@ -25,6 +25,148 @@ export interface BreakpointOptions {
|
|
|
25
25
|
xs: number;
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
+
export interface FigmaTheme {
|
|
29
|
+
background: {
|
|
30
|
+
level0: {
|
|
31
|
+
bckgGray: string;
|
|
32
|
+
bckgWhite: string;
|
|
33
|
+
bckgWhiteBlack: string;
|
|
34
|
+
componentsBackground: string;
|
|
35
|
+
};
|
|
36
|
+
level1: {
|
|
37
|
+
deep: string;
|
|
38
|
+
gray: string;
|
|
39
|
+
white: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
border: {
|
|
43
|
+
avatar: string;
|
|
44
|
+
darker: string;
|
|
45
|
+
default: string;
|
|
46
|
+
defaultButton: string;
|
|
47
|
+
inputActive: string;
|
|
48
|
+
};
|
|
49
|
+
destructive: {
|
|
50
|
+
active: string;
|
|
51
|
+
elevated: string;
|
|
52
|
+
light: string;
|
|
53
|
+
normal: string;
|
|
54
|
+
ripple: string;
|
|
55
|
+
rippleLight: string;
|
|
56
|
+
};
|
|
57
|
+
disabled: {
|
|
58
|
+
normal: string;
|
|
59
|
+
};
|
|
60
|
+
graph: {
|
|
61
|
+
alert: {
|
|
62
|
+
error: string;
|
|
63
|
+
success: string;
|
|
64
|
+
warning: string;
|
|
65
|
+
};
|
|
66
|
+
token: {
|
|
67
|
+
blue: string;
|
|
68
|
+
darkPurple: string;
|
|
69
|
+
error: string;
|
|
70
|
+
neutral: string;
|
|
71
|
+
orange: string;
|
|
72
|
+
pink: string;
|
|
73
|
+
violet: string;
|
|
74
|
+
yellow: string;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
icon: {
|
|
78
|
+
black: string;
|
|
79
|
+
disabled: string;
|
|
80
|
+
white: string;
|
|
81
|
+
};
|
|
82
|
+
illustrations: {
|
|
83
|
+
bckgBloob: string;
|
|
84
|
+
bckgColor: string;
|
|
85
|
+
bckgElements: string;
|
|
86
|
+
shadows: string;
|
|
87
|
+
};
|
|
88
|
+
inProgress: {
|
|
89
|
+
error: string;
|
|
90
|
+
light: string;
|
|
91
|
+
normal: string;
|
|
92
|
+
purple: string;
|
|
93
|
+
secondary: string;
|
|
94
|
+
warning: string;
|
|
95
|
+
};
|
|
96
|
+
neutral: {
|
|
97
|
+
active: string;
|
|
98
|
+
darkGray: string;
|
|
99
|
+
darkerGrayFocus: string;
|
|
100
|
+
elevated: string;
|
|
101
|
+
light: string;
|
|
102
|
+
lightGray: string;
|
|
103
|
+
normal: string;
|
|
104
|
+
ripple: string;
|
|
105
|
+
};
|
|
106
|
+
overlay: {
|
|
107
|
+
alerts: {
|
|
108
|
+
custom: {
|
|
109
|
+
background: string;
|
|
110
|
+
icon: string;
|
|
111
|
+
};
|
|
112
|
+
error: {
|
|
113
|
+
background: string;
|
|
114
|
+
icon: string;
|
|
115
|
+
};
|
|
116
|
+
info: {
|
|
117
|
+
background: string;
|
|
118
|
+
icon: string;
|
|
119
|
+
};
|
|
120
|
+
success: {
|
|
121
|
+
background: string;
|
|
122
|
+
icon: string;
|
|
123
|
+
};
|
|
124
|
+
text: {
|
|
125
|
+
black: string;
|
|
126
|
+
white: string;
|
|
127
|
+
};
|
|
128
|
+
warning: {
|
|
129
|
+
background: string;
|
|
130
|
+
icon: string;
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
default: string;
|
|
134
|
+
table: {
|
|
135
|
+
highlights: string;
|
|
136
|
+
hoverRow: string;
|
|
137
|
+
row: string;
|
|
138
|
+
text: string;
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
primary: {
|
|
142
|
+
active: string;
|
|
143
|
+
elevated: string;
|
|
144
|
+
light: string;
|
|
145
|
+
normal: string;
|
|
146
|
+
ripple: string;
|
|
147
|
+
rippleLight: string;
|
|
148
|
+
};
|
|
149
|
+
success: {
|
|
150
|
+
light: string;
|
|
151
|
+
normal: string;
|
|
152
|
+
};
|
|
153
|
+
toggleTabs: {
|
|
154
|
+
bckg: string;
|
|
155
|
+
ripple: string;
|
|
156
|
+
text: string;
|
|
157
|
+
};
|
|
158
|
+
typography: {
|
|
159
|
+
black: string;
|
|
160
|
+
disabled: string;
|
|
161
|
+
gray: string;
|
|
162
|
+
link: string;
|
|
163
|
+
white: string;
|
|
164
|
+
};
|
|
165
|
+
warning: {
|
|
166
|
+
light: string;
|
|
167
|
+
normal: string;
|
|
168
|
+
};
|
|
169
|
+
}
|
|
28
170
|
export interface AvatarPaletteColorOption {
|
|
29
171
|
backgroundColor: string;
|
|
30
172
|
color: string;
|