@digital-ai/dot-components 1.5.3 → 1.6.2

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.
Files changed (56) hide show
  1. package/CHANGE_LOG.md +151 -73
  2. package/dot-components.esm.js +1217 -655
  3. package/dot-components.umd.js +1219 -660
  4. package/lib/components/app-toolbar/AppToolbar.d.ts +1 -1
  5. package/lib/components/app-toolbar/AppToolbar.styles.d.ts +1 -1
  6. package/lib/components/auto-complete/AutoComplete.d.ts +3 -1
  7. package/lib/components/breadcrumbs/Breadcrumbs.d.ts +2 -0
  8. package/lib/components/breadcrumbs/Breadcrumbs.data.d.ts +3 -0
  9. package/lib/components/breadcrumbs/utils/helpers.d.ts +8 -2
  10. package/lib/components/drawer/Drawer.d.ts +11 -1
  11. package/lib/components/drawer/DrawerBody.d.ts +9 -0
  12. package/lib/components/drawer/DrawerBody.styles.d.ts +2 -0
  13. package/lib/components/drawer/DrawerFooter.d.ts +6 -0
  14. package/lib/components/drawer/DrawerFooter.styles.d.ts +2 -0
  15. package/lib/components/drawer/DrawerHeader.d.ts +8 -0
  16. package/lib/components/drawer/DrawerHeader.styles.d.ts +2 -0
  17. package/lib/components/helpers.d.ts +1 -0
  18. package/lib/components/index.d.ts +5 -11
  19. package/lib/components/list/List.d.ts +3 -86
  20. package/lib/components/list/List.stories.data.d.ts +1 -1
  21. package/lib/components/list/List.styles.d.ts +0 -42
  22. package/lib/components/list/ListItem.styles.d.ts +42 -0
  23. package/lib/components/list/NestedList.styles.d.ts +2 -0
  24. package/lib/components/list/index.d.ts +2 -0
  25. package/lib/components/list/utils/helpers.d.ts +2 -0
  26. package/lib/components/list/utils/models.d.ts +86 -0
  27. package/lib/components/menu/Menu.d.ts +2 -0
  28. package/lib/components/menu/Menu.stories.data.d.ts +23 -0
  29. package/lib/components/menu/Menu.stories.styles.d.ts +2 -0
  30. package/lib/components/menu/utils/constants.d.ts +3 -0
  31. package/lib/components/menu/utils/helpers.d.ts +12 -0
  32. package/lib/components/sidebar/Sidebar.d.ts +1 -1
  33. package/lib/components/sidebar/Sidebar.stories.data.d.ts +83 -0
  34. package/lib/components/table/Table.d.ts +13 -3
  35. package/lib/components/table/Table.stories.data.d.ts +34 -2
  36. package/lib/components/table/TableBody.d.ts +7 -2
  37. package/lib/components/table/TableBody.styles.d.ts +2 -0
  38. package/lib/components/table/TableBodyCheckboxCell.d.ts +8 -0
  39. package/lib/components/table/TableBodyCheckboxCell.styles.d.ts +3 -0
  40. package/lib/components/table/TableCell.d.ts +6 -4
  41. package/lib/components/table/TableCell.styles.d.ts +3 -0
  42. package/lib/components/table/TableHeader.d.ts +10 -35
  43. package/lib/components/table/TableHeaderCell.d.ts +38 -0
  44. package/lib/components/table/TableHeaderCell.styles.d.ts +3 -0
  45. package/lib/components/table/TableHeaderCheckboxCell.d.ts +8 -0
  46. package/lib/components/table/TableHeaderCheckboxCell.styles.d.ts +3 -0
  47. package/lib/components/table/TablePagination.d.ts +6 -4
  48. package/lib/components/table/TablePagination.styles.d.ts +5 -2
  49. package/lib/components/table/TableRow.d.ts +9 -2
  50. package/lib/components/table/TableRow.styles.d.ts +2 -0
  51. package/lib/components/table/TableSelectionToolbar.d.ts +7 -0
  52. package/lib/components/table/TableSelectionToolbar.styles.d.ts +3 -0
  53. package/lib/components/table/index.d.ts +10 -0
  54. package/lib/components/table/utils/helpers.d.ts +9 -0
  55. package/lib/components/table/utils/models.d.ts +21 -0
  56. package/package.json +3 -2
@@ -0,0 +1,83 @@
1
+ import { MouseEvent } from 'react';
2
+ import { ListItemProps } from '../list/utils/models';
3
+ export declare const getNavigationItems: (isSelected: (key: number) => boolean, handleClick: (key: number) => void) => ({
4
+ startIconId: string;
5
+ onClick: import("@storybook/addon-actions").HandlerFunction;
6
+ items: ({
7
+ text: string;
8
+ divider: boolean;
9
+ onClick?: undefined;
10
+ selected?: undefined;
11
+ child?: undefined;
12
+ } | {
13
+ onClick: (_event: MouseEvent) => void;
14
+ selected: boolean;
15
+ text: string;
16
+ divider?: undefined;
17
+ child?: undefined;
18
+ } | {
19
+ child: JSX.Element;
20
+ text?: undefined;
21
+ divider?: undefined;
22
+ onClick?: undefined;
23
+ selected?: undefined;
24
+ })[];
25
+ text: string;
26
+ endIconId?: undefined;
27
+ selected?: undefined;
28
+ divider?: undefined;
29
+ } | {
30
+ items: ({
31
+ text: string;
32
+ divider: boolean;
33
+ startIconId?: undefined;
34
+ onClick?: undefined;
35
+ selected?: undefined;
36
+ } | {
37
+ startIconId: string;
38
+ onClick: (_event: MouseEvent) => void;
39
+ selected: boolean;
40
+ text: string;
41
+ divider?: undefined;
42
+ })[];
43
+ text: string;
44
+ startIconId?: undefined;
45
+ onClick?: undefined;
46
+ endIconId?: undefined;
47
+ selected?: undefined;
48
+ divider?: undefined;
49
+ } | {
50
+ endIconId: string;
51
+ startIconId: string;
52
+ onClick: (_event: MouseEvent) => void;
53
+ selected: boolean;
54
+ text: string;
55
+ items?: undefined;
56
+ divider?: undefined;
57
+ } | {
58
+ text: string;
59
+ divider: boolean;
60
+ startIconId?: undefined;
61
+ onClick?: undefined;
62
+ items?: undefined;
63
+ endIconId?: undefined;
64
+ selected?: undefined;
65
+ } | {
66
+ startIconId: string;
67
+ onClick: (_event: MouseEvent) => void;
68
+ selected: boolean;
69
+ text: string;
70
+ items?: undefined;
71
+ endIconId?: undefined;
72
+ divider?: undefined;
73
+ } | {
74
+ divider: boolean;
75
+ startIconId?: undefined;
76
+ onClick?: undefined;
77
+ items?: undefined;
78
+ text?: undefined;
79
+ endIconId?: undefined;
80
+ selected?: undefined;
81
+ })[];
82
+ export declare const routerNavigationItems: Array<ListItemProps>;
83
+ export declare const SidebarStoryRoutes: () => JSX.Element;
@@ -1,8 +1,10 @@
1
1
  import { MouseEvent, ReactNode } from 'react';
2
2
  import { CommonProps } from '../CommonProps';
3
- import { Order } from './TableBody';
4
- import { DotColumnHeader } from './TableHeader';
3
+ import { DotColumnHeader, Order } from './TableHeader';
5
4
  import { RowsPerPageOption } from './TablePagination';
5
+ import { TypographyVariant } from '../typography/Typography';
6
+ import { MultiSelect } from './utils/models';
7
+ export declare const TABLE_TYPOGRAPHY_VARIANT = "body1";
6
8
  export interface TableRowProps extends CommonProps {
7
9
  /** row identifier that will be passed to onRowClick callback */
8
10
  id?: string;
@@ -12,6 +14,8 @@ export interface TableRowProps extends CommonProps {
12
14
  selected?: boolean;
13
15
  }
14
16
  export interface TableProps extends CommonProps {
17
+ /** Typography variant which will be used for table body cell values **/
18
+ bodyTypography?: TypographyVariant;
15
19
  /** The table header columns */
16
20
  columns: Array<DotColumnHeader>;
17
21
  /** Total number of items for paginated table.
@@ -24,10 +28,16 @@ export interface TableProps extends CommonProps {
24
28
  data: Array<TableRowProps>;
25
29
  /** Message that is shown if data is empty */
26
30
  emptyMessage?: string;
31
+ /** Typography variant which will be used for table pagination **/
32
+ footerTypography?: TypographyVariant;
33
+ /** Typography variant which will be used for table header cell values **/
34
+ headerTypography?: TypographyVariant;
27
35
  /** Table is loading */
28
36
  loading?: boolean;
29
37
  /** Maximum height of table container */
30
38
  maxHeight?: string;
39
+ /** Optional multi-select checkbox object **/
40
+ multiSelect?: MultiSelect;
31
41
  /** Row click event callback */
32
42
  onRowClick?: (event: MouseEvent, id: string) => void;
33
43
  /** Update data callback if data is managed by consumer */
@@ -54,4 +64,4 @@ export declare function stableSort<T>(array: T[], comparator: (order: T, orderBy
54
64
  * A wrapper component around the Table component from @material-ui. This component can be used for
55
65
  * creating a common structure for tables in the system.
56
66
  */
57
- export declare const DotTable: ({ ariaLabel, className, columns, count, data, "data-testid": dataTestId, emptyMessage, loading, maxHeight, order, orderBy, onRowClick, onUpdateData, page, rowsPerPage, stickyHeader, sortable, toolbar, }: TableProps) => JSX.Element;
67
+ export declare const DotTable: ({ ariaLabel, bodyTypography, className, columns, count, data, "data-testid": dataTestId, emptyMessage, footerTypography, headerTypography, loading, maxHeight, multiSelect, order, orderBy, onRowClick, onUpdateData, page, rowsPerPage, stickyHeader, sortable, toolbar, }: TableProps) => JSX.Element;
@@ -1,4 +1,36 @@
1
1
  /// <reference types="react" />
2
+ import { TextAlignment } from './TableCell';
3
+ export declare const actionMenuColumns: ({
4
+ id: string;
5
+ label: string;
6
+ width: string;
7
+ truncate: boolean;
8
+ sortable?: undefined;
9
+ } | {
10
+ id: string;
11
+ label: string;
12
+ width: string;
13
+ truncate?: undefined;
14
+ sortable?: undefined;
15
+ } | {
16
+ id: string;
17
+ label: string;
18
+ sortable: boolean;
19
+ width?: undefined;
20
+ truncate?: undefined;
21
+ })[];
22
+ export declare const dataWithActionMenu: {
23
+ id: string;
24
+ rowData: {
25
+ title: string;
26
+ hometown: string;
27
+ action: {
28
+ children: JSX.Element;
29
+ iconId: string;
30
+ key: string;
31
+ }[];
32
+ };
33
+ }[];
2
34
  export declare const defaultColumns: ({
3
35
  id: string;
4
36
  label: string;
@@ -16,7 +48,7 @@ export declare const defaultColumns: ({
16
48
  } | {
17
49
  id: string;
18
50
  label: string;
19
- align: string;
51
+ align: TextAlignment;
20
52
  width: string;
21
53
  truncate?: undefined;
22
54
  sortable?: undefined;
@@ -77,7 +109,7 @@ export declare const paginatedColumns: ({
77
109
  id: string;
78
110
  label: string;
79
111
  width: string;
80
- align: string;
112
+ align: TextAlignment;
81
113
  truncate?: undefined;
82
114
  })[];
83
115
  export declare const paginatedData: {
@@ -2,7 +2,8 @@ import { MouseEvent } from 'react';
2
2
  import { DotColumnHeader } from './TableHeader';
3
3
  import { TableRowProps } from './Table';
4
4
  import { CommonProps } from '../CommonProps';
5
- export declare type Order = 'asc' | 'desc';
5
+ import { TypographyVariant } from '../typography/Typography';
6
+ import { MultiSelectBody } from './utils/models';
6
7
  export interface TableBodyProps extends CommonProps {
7
8
  /** The table column headers */
8
9
  columns: Array<DotColumnHeader>;
@@ -10,11 +11,15 @@ export interface TableBodyProps extends CommonProps {
10
11
  data: Array<TableRowProps>;
11
12
  /** Message to show if no data */
12
13
  emptyMessage?: string;
14
+ /** Optional multi-select checkbox body object **/
15
+ multiSelectBody?: MultiSelectBody;
13
16
  /** Row click event callback */
14
17
  onRowClick?: (event: MouseEvent, id: string) => void;
18
+ /** Typography variant which will be used for body cell values **/
19
+ typography: TypographyVariant;
15
20
  }
16
21
  /**
17
22
  * A wrapper component around the TableBody component from @material-ui. This component can be used
18
23
  * to determine the functionality of the table.
19
24
  */
20
- export declare const DotTableBody: ({ columns, data, emptyMessage, onRowClick, }: TableBodyProps) => JSX.Element;
25
+ export declare const DotTableBody: ({ columns, data, emptyMessage, multiSelectBody, onRowClick, typography, }: TableBodyProps) => JSX.Element;
@@ -0,0 +1,2 @@
1
+ export declare const rootClassName = "dot-tbody";
2
+ export declare const StyledTableBody: import("styled-components").StyledComponent<import("@material-ui/core/OverridableComponent").OverridableComponent<import("@material-ui/core").TableBodyTypeMap<{}, "tbody">>, any, {}, never>;
@@ -0,0 +1,8 @@
1
+ import { ReactElement } from 'react';
2
+ import { CommonProps } from '../CommonProps';
3
+ export interface DotBodyCheckboxCellProps extends CommonProps {
4
+ isChecked: boolean;
5
+ onChange: (isChecked: boolean, rowId: string) => void;
6
+ rowId: string;
7
+ }
8
+ export declare const DotBodyCheckboxCell: ({ ariaLabel, className, "data-testid": dataTestId, isChecked, onChange, rowId, }: DotBodyCheckboxCellProps) => ReactElement;
@@ -0,0 +1,3 @@
1
+ import { TableCell } from '@material-ui/core';
2
+ export declare const rootClassName = "dot-td-checkbox";
3
+ export declare const StyledTableBodyCheckboxCell: import("styled-components").StyledComponent<typeof TableCell, any, {}, never>;
@@ -1,16 +1,18 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { CommonProps } from '../CommonProps';
3
- export declare type textAlignment = 'center' | 'inherit' | 'justify' | 'left' | 'right';
3
+ import { TypographyVariant } from '../typography/Typography';
4
+ export declare type TextAlignment = 'center' | 'inherit' | 'justify' | 'left' | 'right';
4
5
  export interface CellProps extends CommonProps {
5
- align?: textAlignment;
6
+ align?: TextAlignment;
6
7
  cellKey?: string;
7
8
  colspan?: number;
8
9
  id?: string;
9
10
  noWrap?: boolean;
10
11
  onActionMenuTrigger?: (el: HTMLElement, menuItem: Array<ReactNode>) => void;
11
- value?: any;
12
+ typography: TypographyVariant;
13
+ value?: unknown;
12
14
  }
13
15
  /**
14
16
  * A wrapper component around the TableCell component from @material-ui.
15
17
  */
16
- export declare const DotBodyCell: ({ ariaLabel, align, cellKey, className, colspan, "data-testid": dataTestId, noWrap, value, onActionMenuTrigger, }: CellProps) => JSX.Element;
18
+ export declare const DotBodyCell: ({ ariaLabel, align, cellKey, className, colspan, "data-testid": dataTestId, noWrap, onActionMenuTrigger, typography, value, }: CellProps) => JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { TableCell } from '@material-ui/core';
2
+ export declare const rootClassName = "dot-td";
3
+ export declare const StyledTableCell: import("styled-components").StyledComponent<typeof TableCell, any, {}, never>;
@@ -1,54 +1,29 @@
1
- import { MouseEvent, ReactNode } from 'react';
2
- import { Order } from './TableBody';
3
- import { textAlignment } from './TableCell';
1
+ /// <reference types="react" />
2
+ import { TextAlignment } from './TableCell';
3
+ import { TypographyVariant } from '../typography/Typography';
4
+ import { MultiSelectHeader } from './utils/models';
4
5
  export interface DotColumnHeader {
5
- align?: textAlignment;
6
+ align?: TextAlignment;
6
7
  id: string;
7
8
  label?: string;
8
9
  sortable?: boolean;
9
10
  truncate?: boolean;
10
11
  width?: string;
11
12
  }
13
+ export declare type Order = 'asc' | 'desc';
12
14
  export interface HeaderProps {
13
15
  columns: Array<DotColumnHeader>;
16
+ hasActionColumn: boolean;
17
+ multiSelectHeader?: MultiSelectHeader;
14
18
  onRequestSort: (property: string) => void;
15
19
  order?: Order;
16
20
  /** The ID of the column that you are sorting by */
17
21
  orderBy?: string;
18
22
  sortable: boolean;
19
- }
20
- export interface HeaderCellProps {
21
- /** Allows to align cell text left, right, center */
22
- align?: textAlignment;
23
- /** Click event function to handle sorting */
24
- createSortHandler?: (property: string) => (event: MouseEvent<unknown>) => void;
25
- /** The Id of table cell */
26
- id?: string;
27
- /** The order of data which is being sorted by */
28
- order?: Order;
29
- /** The ID of the column that you are sorting by */
30
- orderBy?: string;
31
- /** Determines sorting order of ascending or desceding */
32
- sortDirection?: 'desc' | 'asc' | undefined;
33
- /** Determines if sorting is enabled */
34
- sortable?: boolean;
35
- /**Allows table cell text truncated and displays in only one line */
36
- truncate?: boolean;
37
- /** The UID of the cell, if not provided then a randomly generated hash will be created using
38
- * CreateUUID() */
39
- uid: string;
40
- /** The value of header cell*/
41
- value?: ReactNode;
42
- /** The width of the column */
43
- width?: string;
23
+ typography: TypographyVariant;
44
24
  }
45
25
  /**
46
26
  * A wrapper component around the TableHead component from @material-ui. This component can be used
47
27
  * to determine the functionality of the table header.
48
28
  */
49
- export declare const DotHeaderRow: ({ columns, onRequestSort, order, orderBy, sortable, }: HeaderProps) => JSX.Element;
50
- /**
51
- * A wrapper component around the TableCell component from @material-ui. This component should only
52
- * be used inside of DotHeaderRow.
53
- */
54
- export declare const DotHeaderCell: ({ align, createSortHandler, id, order, orderBy, sortable, sortDirection, uid, value, width, }: HeaderCellProps) => JSX.Element;
29
+ export declare const DotHeaderRow: ({ columns, hasActionColumn, multiSelectHeader, onRequestSort, order, orderBy, sortable, typography, }: HeaderProps) => JSX.Element;
@@ -0,0 +1,38 @@
1
+ import { MouseEvent, ReactNode } from 'react';
2
+ import { TextAlignment } from './TableCell';
3
+ import { Order } from './TableHeader';
4
+ import { TypographyVariant } from '../typography/Typography';
5
+ export declare type SortDirection = 'asc' | 'desc';
6
+ export interface HeaderCellProps {
7
+ /** Allows cell text alignment: left, right, center */
8
+ align?: TextAlignment;
9
+ /** Click event function to handle sorting */
10
+ createSortHandler?: (property: string) => (event: MouseEvent<unknown>) => void;
11
+ /** The Id of table cell */
12
+ id?: string;
13
+ /** If true, specific alignment will be applicable for this cell */
14
+ isInActionColumn: boolean;
15
+ /** The order of data which is being sorted by */
16
+ order?: Order;
17
+ /** The ID of the column that you are sorting by */
18
+ orderBy?: string;
19
+ /** Determines sorting order of ascending or descending */
20
+ sortDirection?: SortDirection;
21
+ /** Determines if sorting is enabled */
22
+ sortable?: boolean;
23
+ /**Allows table cell text truncated and displays in only one line */
24
+ truncate?: boolean;
25
+ /** Typography variant which will be used for header cell values **/
26
+ typography: TypographyVariant;
27
+ /** The UID of the cell */
28
+ uid: string;
29
+ /** The value of header cell*/
30
+ value?: ReactNode;
31
+ /** The width of the column */
32
+ width?: string;
33
+ }
34
+ /**
35
+ * A wrapper component around the TableCell component from @material-ui. This component should only
36
+ * be used inside DotHeaderRow.
37
+ */
38
+ export declare const DotHeaderCell: ({ align, typography, createSortHandler, id, isInActionColumn, order, orderBy, sortable, sortDirection, uid, value, width, }: HeaderCellProps) => JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { TableCell } from '@material-ui/core';
2
+ export declare const rootClassName = "dot-th";
3
+ export declare const StyledTableHeaderCell: import("styled-components").StyledComponent<typeof TableCell, any, {}, never>;
@@ -0,0 +1,8 @@
1
+ import { ReactElement } from 'react';
2
+ import { CommonProps } from '../CommonProps';
3
+ import { MultiSelectState, TableRowSelectChangeHandler } from './utils/models';
4
+ export interface DotHeaderCheckboxCellProps extends CommonProps {
5
+ multiSelectState: MultiSelectState;
6
+ onCheckAllChange: TableRowSelectChangeHandler;
7
+ }
8
+ export declare const DotHeaderCheckboxCell: ({ ariaLabel, className, "data-testid": dataTestId, multiSelectState, onCheckAllChange, }: DotHeaderCheckboxCellProps) => ReactElement;
@@ -0,0 +1,3 @@
1
+ import { TableCell } from '@material-ui/core';
2
+ export declare const rootClassName = "dot-th-checkbox";
3
+ export declare const StyledTableHeaderCheckboxCell: import("styled-components").StyledComponent<typeof TableCell, any, {}, never>;
@@ -1,7 +1,8 @@
1
1
  import { ChangeEvent } from 'react';
2
2
  import { CommonProps } from '../CommonProps';
3
- declare const rowsPerPageOptions: readonly [10, 25, 50, 100, 150, 200];
4
- export declare type RowsPerPageOption = typeof rowsPerPageOptions[number];
3
+ import { TypographyVariant } from '../typography/Typography';
4
+ export declare const ROWS_PER_PAGE_OPTIONS: readonly [10, 25, 50, 100, 150, 200];
5
+ export declare type RowsPerPageOption = typeof ROWS_PER_PAGE_OPTIONS[number];
5
6
  export interface TablePaginationProps extends CommonProps {
6
7
  /** Total number of rows (-1 if unknown) */
7
8
  count: number;
@@ -13,7 +14,8 @@ export interface TablePaginationProps extends CommonProps {
13
14
  page?: number;
14
15
  /** The number of rows per page */
15
16
  rowsPerPage?: RowsPerPageOption;
17
+ /** Typography variant which will be used for pagination text */
18
+ typography: TypographyVariant;
16
19
  }
17
20
  /** This component wraps the TablePagination component from @material-ui. */
18
- export declare const DotTablePagination: ({ ariaLabel, className, count, "data-testid": dataTestId, onChangePage, onChangeRowsPerPage, page, rowsPerPage, }: TablePaginationProps) => JSX.Element;
19
- export {};
21
+ export declare const DotTablePagination: ({ ariaLabel, className, count, "data-testid": dataTestId, onChangePage, onChangeRowsPerPage, page, rowsPerPage, typography, }: TablePaginationProps) => JSX.Element;
@@ -1,3 +1,6 @@
1
- /// <reference types="react" />
1
+ import { TypographyVariant } from '../typography/Typography';
2
2
  export declare const rootClassName = "dot-table-pagination";
3
- export declare const StyledTablePagination: import("@material-ui/core/OverridableComponent").OverridableComponent<import("@material-ui/core").TablePaginationTypeMap<{}, import("react").ComponentType<Pick<import("@material-ui/core").TableCellProps, "align" | "colSpan" | "headers" | "rowSpan" | "scope" | "abbr" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "height" | "width" | "valign" | "padding" | "size" | "sortDirection" | "variant" | "innerRef" | "ref">>>>;
3
+ export interface StyledTablePaginationProps {
4
+ typography: TypographyVariant;
5
+ }
6
+ export declare const StyledTablePagination: import("styled-components").StyledComponent<"div", any, StyledTablePaginationProps, never>;
@@ -2,15 +2,20 @@ import { MouseEvent, ReactNode } from 'react';
2
2
  import { DotColumnHeader } from './TableHeader';
3
3
  import { CommonProps } from '../CommonProps';
4
4
  import { TableRowProps } from './Table';
5
+ import { TypographyVariant } from '../typography/Typography';
6
+ import { MultiSelectBody } from './utils/models';
5
7
  export interface EmptyRowProps {
6
8
  cols: number;
7
9
  message?: string;
10
+ typography: TypographyVariant;
8
11
  }
9
12
  export interface RowProps extends CommonProps {
10
13
  /** The table column headers */
11
14
  columns: Array<DotColumnHeader>;
12
15
  /** The table body row data */
13
16
  data: TableRowProps;
17
+ /** Optional multi-select checkbox body object **/
18
+ multiSelectBody?: MultiSelectBody;
14
19
  /** Event callback of action button of menu */
15
20
  onActionMenuTrigger: (el: HTMLElement, menuItem: Array<ReactNode>) => void;
16
21
  /** Event callback */
@@ -19,10 +24,12 @@ export interface RowProps extends CommonProps {
19
24
  rowKey: string;
20
25
  /** if the row is selected */
21
26
  selected?: boolean;
27
+ /** Typography variant which will be used for body cell values **/
28
+ typography: TypographyVariant;
22
29
  }
23
30
  /**
24
31
  * A wrapper component around the TableRow component from @material-ui. This component can be used
25
32
  * for manipulating data prior to displaying the data inside the table
26
33
  */
27
- export declare const DotTableRow: ({ columns, className, data, onActionMenuTrigger, onClick, rowKey, selected, }: RowProps) => JSX.Element;
28
- export declare const EmptyDotRow: ({ cols, message, }: EmptyRowProps) => JSX.Element;
34
+ export declare const DotTableRow: ({ columns, className, data, multiSelectBody, onActionMenuTrigger, onClick, rowKey, selected, typography, }: RowProps) => JSX.Element;
35
+ export declare const EmptyDotRow: ({ cols, message, typography, }: EmptyRowProps) => JSX.Element;
@@ -0,0 +1,2 @@
1
+ export declare const rootClassName = "dot-tr";
2
+ export declare const StyledTableRowStyles: import("styled-components").StyledComponent<import("@material-ui/core/OverridableComponent").OverridableComponent<import("@material-ui/core").TableRowTypeMap<{}, "tr">>, any, {}, never>;
@@ -0,0 +1,7 @@
1
+ import { ReactNode } from 'react';
2
+ import { CommonProps } from '../CommonProps';
3
+ export interface TableSelectionToolbarProps extends CommonProps {
4
+ bulkActions?: ReactNode;
5
+ selectedRowsNumber: number;
6
+ }
7
+ export declare const DotTableSelectionToolbar: ({ ariaLabel, bulkActions, className, "data-testid": dataTestId, selectedRowsNumber, }: TableSelectionToolbarProps) => JSX.Element;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ export declare const rootClassName = "dot-table-selection-toolbar";
3
+ export declare const StyledTableSelectionToolbar: import("styled-components").StyledComponent<({ ariaLabel, children, className, "data-testid": dataTestId, variant, }: import("../action-toolbar/ActionToolbar").DotActionBarProps) => JSX.Element, any, {}, never>;
@@ -0,0 +1,10 @@
1
+ export type { TableRowProps } from './Table';
2
+ export type { TextAlignment } from './TableCell';
3
+ export type { TableDataWithPagination } from './TableDataWithPagination';
4
+ export type { DotColumnHeader, Order } from './TableHeader';
5
+ export type { SortDirection } from './TableHeaderCell';
6
+ export type { RowsPerPageOption } from './TablePagination';
7
+ export type { MultiSelect, TableRowSelectChangeHandler, RowSelectionChangeHandler, } from './utils/models';
8
+ export { DotTablePagination } from './TablePagination';
9
+ export { DotTable } from './Table';
10
+ export { DotHeaderRow } from './TableHeader';
@@ -0,0 +1,9 @@
1
+ import { ReactNode } from 'react';
2
+ import { TypographyVariant } from '../../typography/Typography';
3
+ import { TableRowProps } from '../Table';
4
+ import { DotColumnHeader } from '../TableHeader';
5
+ export declare const getFormattedTableCellValue: (value: unknown, typographyVariant: TypographyVariant) => ReactNode;
6
+ export declare const getContainerMaxHeightStyle: (stickyHeader?: boolean, maxHeight?: string) => string;
7
+ export declare const checkIfActionColumnExist: (columns: DotColumnHeader[], tableData: TableRowProps[]) => boolean;
8
+ export declare const getSelectedRowIds: (id: string, isChecked: boolean, selectedIds: string[]) => string[];
9
+ export declare const getBulkSelectedRowIds: (isChecked: boolean, selectedIds: string[], pageData: TableRowProps[]) => string[];
@@ -0,0 +1,21 @@
1
+ import { TableRowProps } from '../Table';
2
+ import { ReactNode } from 'react';
3
+ export declare type RowSelectionChangeHandler = (isChecked: boolean, rowId: string) => void;
4
+ export declare type MultiSelectState = 'unchecked' | 'checked' | 'indeterminate';
5
+ export declare type TableRowSelectChangeHandler = (isChecked: boolean, selectedTableRowIds: string[]) => void;
6
+ export interface MultiSelect {
7
+ bulkActions?: ReactNode;
8
+ onCheckAllChange?: TableRowSelectChangeHandler;
9
+ onCheckRowChange?: TableRowSelectChangeHandler;
10
+ }
11
+ interface MultiSelectTableBase {
12
+ selectedTableRowIds: string[];
13
+ }
14
+ export interface MultiSelectHeader extends MultiSelectTableBase {
15
+ onCheckAllChange: TableRowSelectChangeHandler;
16
+ pageData: TableRowProps[];
17
+ }
18
+ export interface MultiSelectBody extends MultiSelectTableBase {
19
+ onCheckIndividualChange?: RowSelectionChangeHandler;
20
+ }
21
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digital-ai/dot-components",
3
- "version": "1.5.3",
3
+ "version": "1.6.2",
4
4
  "private": false,
5
5
  "license": "SEE LICENSE IN <LICENSE.md>",
6
6
  "contributors": [
@@ -32,6 +32,7 @@
32
32
  "styled-components": "^5.2.1"
33
33
  },
34
34
  "peerDependencies": {
35
- "react": "^16.8.0 || ^17.0.0"
35
+ "react": "^16.8.0 || ^17.0.0",
36
+ "react-router-dom": "^5.2.0"
36
37
  }
37
38
  }