@digital-ai/dot-components 4.18.0 → 4.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/index.esm.js +597 -412
- package/package.json +1 -1
- package/src/lib/components/index.d.ts +2 -0
- package/src/lib/components/search/Search.d.ts +12 -0
- package/src/lib/components/search/Search.styles.d.ts +2 -0
- package/src/lib/components/search/index.d.ts +2 -0
- package/src/lib/components/table/Table.d.ts +2 -6
- package/src/lib/components/table/TableBody.d.ts +3 -1
- package/src/lib/components/table/TableHeader.d.ts +1 -1
- package/src/lib/components/table/TableHeaderCell.d.ts +5 -1
- package/src/lib/components/table/TableRow.d.ts +3 -1
- package/src/lib/components/table/utils/helpers.d.ts +8 -2
- package/src/lib/components/table/utils/interfaces.d.ts +13 -2
- package/src/lib/theme-provider/interfaces.d.ts +1 -0
package/package.json
CHANGED
|
@@ -50,6 +50,7 @@ export type { StickyWithBorderProps } from './sticky-with-border';
|
|
|
50
50
|
export type { SlotProps, TooltipProps, TooltipHoverVisibility, TooltipPlacement, } from './tooltip';
|
|
51
51
|
export type { DashboardHeaderProps } from './analytics/dashboard-header/DashboardHeader';
|
|
52
52
|
export type { ChipTooltipProps, ChipProps, ChipSize } from './chip/Chip';
|
|
53
|
+
export type { SearchProps } from './search';
|
|
53
54
|
export { DotAccordion } from './accordion/Accordion';
|
|
54
55
|
export { DotActionToolbar } from './action-toolbar/ActionToolbar';
|
|
55
56
|
export { DotAlertBanner } from './alert-banner/AlertBanner';
|
|
@@ -135,4 +136,5 @@ export { DotCarousel } from './carousel/Carousel';
|
|
|
135
136
|
export { DotStickyWithBorder } from './sticky-with-border';
|
|
136
137
|
export { CreateUUID } from './createUUID';
|
|
137
138
|
export { BoardStatusProvider, ColumnStatusProvider, DotBoard, DotBoardColumn, DotBoardColumnActionBar, DotBoardColumnCollapse, DotBoardColumnExpand, DotBoardColumnHeader, DotBoardColumnItems, DotBoardColumnSummary, useBoardStatus, useColumnStatus, } from './board';
|
|
139
|
+
export { DotSearch } from './search';
|
|
138
140
|
export { useKeyPress } from '../hooks/useKeyPress';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { InputTextProps } from '../input-form-fields/InputText';
|
|
2
|
+
export interface SearchProps extends Omit<InputTextProps, 'autoComplete' | 'hasResizer' | 'maxRows' | 'minRows' | 'multiline' | 'endIcon' | 'error' | 'onChange' | 'startIcon' | 'success' | 'type' | 'warning' | 'id' | 'name'> {
|
|
3
|
+
/** Input's ID attribute */
|
|
4
|
+
id?: string;
|
|
5
|
+
/** Input's name attribute */
|
|
6
|
+
name?: string;
|
|
7
|
+
/** Called when a search is performed with the current input value */
|
|
8
|
+
onSearch: (searchValue: string) => void;
|
|
9
|
+
/** The current value of the input */
|
|
10
|
+
value: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const DotSearch: ({ ariaLabel, className, "data-testid": dataTestId, disabled, hasDebounce, id, name, onSearch, onClear, placeholder, value, ...rest }: SearchProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const rootClassName = "dot-search";
|
|
2
|
+
export declare const StyledSearch: import("styled-components").StyledComponent<({ autoComplete, autoFocus, className, defaultValue, "data-pendoid": dataPendoId, "data-testid": dataTestId, disabled, error, endAdornmentTooltip, fullWidth, hasDebounce, hasResizer, helperText, endIcon, endText, id, informationToolTip, inputRef, label, max, maxLength, maxRows, min, minLength, minRows, multiline, name, onBlur, onChange, onClear, onFocus, onKeyDown, onMouseUp, persistentLabel, placeholder, readOnly, required, shrink, startIcon, size, success, type, value, warning, }: import("../input-form-fields/InputText").InputTextProps) => import("react/jsx-runtime").JSX.Element, any, {}, never>;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { TableProps, TableRowProps } from './utils/interfaces';
|
|
3
|
-
export declare const sortComparator: (a: TableRowProps, b: TableRowProps, orderBy: string) => 0 | 1 | -1;
|
|
4
|
-
export declare const getComparator: (order: Order, orderBy: string) => (a: TableRowProps, b: TableRowProps) => number;
|
|
5
|
-
export declare function stableSort<T>(array: T[], comparator: (order: T, orderBy: T) => number): T[];
|
|
1
|
+
import { TableProps } from './utils/interfaces';
|
|
6
2
|
/**
|
|
7
3
|
* A wrapper component around the Table component from @material-ui. This component can be used for
|
|
8
4
|
* creating a common structure for tables in the system.
|
|
9
5
|
*/
|
|
10
|
-
export declare const DotTable: ({ actionsMenuPlacement, ariaLabel, bodyTypography, className, collapsibleTableOptions, columns, count, data, "data-testid": dataTestId, emptyMessage, footerTypography, headerTypography, labelRowsPerPage, loading, maxHeight, multiSelect, order, orderBy, onRowClick, onUpdateData, page, rowsPerPage, rowsPerPageOptions, stickyHeader, sortable, toolbar, }: TableProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const DotTable: ({ actionsMenuPlacement, ariaLabel, bodyTypography, className, collapsibleTableOptions, columns, count, data, "data-testid": dataTestId, emptyMessage, footerTypography, headerTypography, labelRowsPerPage, loading, maxHeight, multiSelect, order, orderBy, onRowClick, onUpdateData, page, pinnedFirstColumn, rowsPerPage, rowsPerPageOptions, stickyHeader, sortable, toolbar, }: TableProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -19,6 +19,8 @@ export interface TableBodyProps extends CommonProps {
|
|
|
19
19
|
multiSelectBody?: MultiSelectBody;
|
|
20
20
|
/** Row click event callback **/
|
|
21
21
|
onRowClick?: (event: MouseEvent, id: string) => void;
|
|
22
|
+
/** When true, the first column is visible all the time when scrolling horizontally */
|
|
23
|
+
pinnedFirstColumn?: boolean;
|
|
22
24
|
/** Typography variant which will be used for body cell values **/
|
|
23
25
|
typography: TypographyVariant;
|
|
24
26
|
}
|
|
@@ -26,4 +28,4 @@ export interface TableBodyProps extends CommonProps {
|
|
|
26
28
|
* A wrapper component around the TableBody component from @material-ui. This component can be used
|
|
27
29
|
* to determine the functionality of the table.
|
|
28
30
|
*/
|
|
29
|
-
export declare const DotTableBody: ({ actionsMenuPlacement, collapsibleTableBody, columns, data, emptyMessage, multiSelectBody, onRowClick, typography, }: TableBodyProps) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export declare const DotTableBody: ({ actionsMenuPlacement, collapsibleTableBody, columns, data, emptyMessage, multiSelectBody, onRowClick, pinnedFirstColumn, typography, }: TableBodyProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,4 +3,4 @@ import { HeaderProps } from './utils/interfaces';
|
|
|
3
3
|
* A wrapper component around the TableHead component from @material-ui. This component can be used
|
|
4
4
|
* to determine the functionality of the table header.
|
|
5
5
|
*/
|
|
6
|
-
export declare const DotHeaderRow: ({ collapsibleTableOptions, columns, multiSelectHeader, onRequestSort, order, orderBy, sortable, typography, }: HeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const DotHeaderRow: ({ collapsibleTableOptions, columns, multiSelectHeader, onRequestSort, order, orderBy, pinnedFirstColumn, sortable, typography, }: HeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -6,6 +6,8 @@ export type SortDirection = 'asc' | 'desc';
|
|
|
6
6
|
export interface HeaderCellProps {
|
|
7
7
|
/** Allows cell text alignment: left, right, center */
|
|
8
8
|
align?: TextAlignment;
|
|
9
|
+
/** Optional prop used to add additional class on the component */
|
|
10
|
+
className?: string;
|
|
9
11
|
/** Click event function to handle sorting */
|
|
10
12
|
createSortHandler?: (property: string) => (event: MouseEvent<unknown>) => void;
|
|
11
13
|
/** The Id of table cell */
|
|
@@ -14,6 +16,8 @@ export interface HeaderCellProps {
|
|
|
14
16
|
order?: Order;
|
|
15
17
|
/** The ID of the column that you are sorting by */
|
|
16
18
|
orderBy?: string;
|
|
19
|
+
/** When true, column is visible all the time when scrolling horizontally */
|
|
20
|
+
pinned?: boolean;
|
|
17
21
|
/** Determines sorting order of ascending or descending */
|
|
18
22
|
sortDirection?: SortDirection;
|
|
19
23
|
/** Determines if sorting is enabled */
|
|
@@ -33,4 +37,4 @@ export interface HeaderCellProps {
|
|
|
33
37
|
* A wrapper component around the TableCell component from @material-ui. This component should only
|
|
34
38
|
* be used inside DotHeaderRow.
|
|
35
39
|
*/
|
|
36
|
-
export declare const DotHeaderCell: ({ align, typography, createSortHandler, id, order, orderBy, sortable, sortDirection, uid, value, width, }: HeaderCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
export declare const DotHeaderCell: ({ align, className, typography, createSortHandler, id, order, orderBy, pinned, sortable, sortDirection, uid, value, width, }: HeaderCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -16,6 +16,8 @@ export interface RowProps extends CommonProps {
|
|
|
16
16
|
onActionMenuTrigger: (el: HTMLElement, menuItem: Array<ReactNode>) => void;
|
|
17
17
|
/** Event callback */
|
|
18
18
|
onClick?: (event: MouseEvent, id: string) => void;
|
|
19
|
+
/** When true, first column is visible all the time when scrolling horizontally */
|
|
20
|
+
pinnedFirstColumn?: boolean;
|
|
19
21
|
/** uniques key of table cell */
|
|
20
22
|
rowKey: string;
|
|
21
23
|
/** if the row is selected */
|
|
@@ -27,4 +29,4 @@ export interface RowProps extends CommonProps {
|
|
|
27
29
|
* A wrapper component around the TableRow component from @material-ui. This component can be used
|
|
28
30
|
* for manipulating data prior to displaying the data inside the table
|
|
29
31
|
*/
|
|
30
|
-
export declare const DotTableRow: ({ collapsibleTableBody, columns, className, data, multiSelectBody, onActionMenuTrigger, onClick, rowKey, selected, typography, }: RowProps) => import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
export declare const DotTableRow: ({ collapsibleTableBody, columns, className, data, multiSelectBody, onActionMenuTrigger, onClick, pinnedFirstColumn, rowKey, selected, typography, }: RowProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { TypographyVariant } from '../../typography/Typography';
|
|
3
|
-
import { TableRowProps } from './interfaces';
|
|
4
|
-
import { MultiSelect } from './models';
|
|
3
|
+
import { GetSortedPageDataProps, OnUpdateDataCallback, TableRowProps } from './interfaces';
|
|
4
|
+
import { MultiSelect, Order } from './models';
|
|
5
5
|
import { AvatarWithTextCell } from '../TableCell';
|
|
6
6
|
import { InlineEditProps } from '../../inline-edit';
|
|
7
|
+
import { RowsPerPageOption } from '../TablePagination';
|
|
7
8
|
export declare const getFormattedTableCellValue: (value: any, typographyVariant: TypographyVariant) => ReactNode;
|
|
8
9
|
export declare const renderAvatarWithTextCell: (avatarWithText: AvatarWithTextCell) => import("react/jsx-runtime").JSX.Element;
|
|
9
10
|
export declare const renderInlineEditCell: (inlineEdit: InlineEditProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -17,3 +18,8 @@ export declare const getBulkSelectedRowIds: (isChecked: boolean, selectedIds: st
|
|
|
17
18
|
export declare const getExpandedRowIds: (expandedIds: string[], id: string, isExpand: boolean) => string[];
|
|
18
19
|
export declare const parseCellMaxWidth: (width: string) => string;
|
|
19
20
|
export declare const checkIsMultiselectOverTableHeaderRow: (multiSelect: MultiSelect | undefined, hasToolbar: boolean) => boolean;
|
|
21
|
+
export declare const getSortedPageData: ({ data, onUpdateData, order, orderBy, rowsPerPage, }: GetSortedPageDataProps) => TableRowProps[];
|
|
22
|
+
export declare const warnIfCountIgnored: (count: number, onUpdateData: OnUpdateDataCallback, rowsPerPage?: RowsPerPageOption) => void;
|
|
23
|
+
export declare const sortComparator: (a: TableRowProps, b: TableRowProps, orderBy: string) => 0 | 1 | -1;
|
|
24
|
+
export declare const getComparator: (order: Order, orderBy: string) => (a: TableRowProps, b: TableRowProps) => number;
|
|
25
|
+
export declare function stableSort<T>(array: T[], comparator: (order: T, orderBy: T) => number): T[];
|
|
@@ -2,7 +2,7 @@ import { MouseEvent, ReactNode } from 'react';
|
|
|
2
2
|
import { CommonProps } from '../../CommonProps';
|
|
3
3
|
import { TypographyVariant } from '../../typography/Typography';
|
|
4
4
|
import { PopperPlacement } from '../../menu/Menu';
|
|
5
|
-
import { CollapsibleTableOptions } from '../collapsible-table
|
|
5
|
+
import { CollapsibleTableOptions } from '../collapsible-table';
|
|
6
6
|
import { MultiSelect, MultiSelectHeader, Order } from './models';
|
|
7
7
|
import { TextAlignment } from '../TableCell';
|
|
8
8
|
import { RowsPerPageOption } from '../TablePagination';
|
|
@@ -14,6 +14,7 @@ export interface TableRowProps extends CommonProps {
|
|
|
14
14
|
/** if the row is selected */
|
|
15
15
|
selected?: boolean;
|
|
16
16
|
}
|
|
17
|
+
export type OnUpdateDataCallback = (order: Order, orderBy: string, page: number, rowsPerPage: number) => void;
|
|
17
18
|
export interface TableProps extends CommonProps {
|
|
18
19
|
/** The popper placement for the actions menu **/
|
|
19
20
|
actionsMenuPlacement?: PopperPlacement;
|
|
@@ -48,13 +49,15 @@ export interface TableProps extends CommonProps {
|
|
|
48
49
|
/** Row click event callback */
|
|
49
50
|
onRowClick?: (event: MouseEvent, id: string) => void;
|
|
50
51
|
/** Update data callback if data is managed by consumer */
|
|
51
|
-
onUpdateData?:
|
|
52
|
+
onUpdateData?: OnUpdateDataCallback;
|
|
52
53
|
/** The sort order of table data 'asc', 'desc' */
|
|
53
54
|
order?: Order;
|
|
54
55
|
/** The ID of the column that you are sorting by */
|
|
55
56
|
orderBy?: string;
|
|
56
57
|
/** The zero-based index of the current page for paginated table */
|
|
57
58
|
page?: number;
|
|
59
|
+
/** When true, first column is visible all the time when scrolling horizontally */
|
|
60
|
+
pinnedFirstColumn?: boolean;
|
|
58
61
|
/** Rows per page for paginated table */
|
|
59
62
|
rowsPerPage?: RowsPerPageOption;
|
|
60
63
|
/** Customizes the options of the rows per page select field. Default: [10, 25, 50, 100, 150, 200] */
|
|
@@ -83,6 +86,14 @@ export interface HeaderProps {
|
|
|
83
86
|
order?: Order;
|
|
84
87
|
/** The ID of the column that you are sorting by */
|
|
85
88
|
orderBy?: string;
|
|
89
|
+
pinnedFirstColumn?: boolean;
|
|
86
90
|
sortable: boolean;
|
|
87
91
|
typography: TypographyVariant;
|
|
88
92
|
}
|
|
93
|
+
export interface GetSortedPageDataProps {
|
|
94
|
+
data: TableRowProps[];
|
|
95
|
+
onUpdateData?: OnUpdateDataCallback;
|
|
96
|
+
order: Order;
|
|
97
|
+
orderBy: string;
|
|
98
|
+
rowsPerPage: number;
|
|
99
|
+
}
|