@digital-ai/dot-components 2.17.3 → 2.18.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.
@@ -1,4 +1,2 @@
1
- import { ListItemProps, ListProps, NestedListProps } from './utils/models';
1
+ import { ListProps } from './utils/models';
2
2
  export declare const DotList: ({ ariaLabel, ariaRole, children, className, component, "data-testid": dataTestId, dense, disablePadding, items, menuPlacement, nestedDrawerLeftSpacing, nestedListType, width, }: ListProps) => JSX.Element;
3
- export declare const DotListItem: ({ ariaLabel, ariaRole, className, component, "data-testid": dataTestId, divider, endIcon, href, isOpened, onClick, onMenuLeave, items, menuPlacement, nestedDrawerLeftSpacing, nestedListType, primaryText, secondaryText, selected, startIcon, target, text, tooltip, tooltipPlacement, }: ListItemProps) => JSX.Element;
4
- export declare const NestedList: ({ ariaLabel, anchorEl, "data-testid": dataTestId, items, menuPlacement, nestedDrawerLeftSpacing, onMenuLeave, open, parentItemIndex, type, }: NestedListProps) => JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { ListItemProps } from './utils/models';
2
+ interface DividerProps {
3
+ index: number;
4
+ item: ListItemProps;
5
+ }
6
+ export declare const DotListDivider: ({ item, index }: DividerProps) => JSX.Element;
7
+ export {};
@@ -0,0 +1,2 @@
1
+ import { ListItemProps } from './utils/models';
2
+ export declare const DotListItem: ({ ariaLabel, ariaRole, className, component, "data-testid": dataTestId, divider, endIcon, href, isOpened, onClick, onMenuLeave, items, menuPlacement, nestedDrawerLeftSpacing, nestedListType, primaryText, secondaryText, selected, startIcon, target, text, tooltip, tooltipPlacement, }: ListItemProps) => JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { NestedListProps } from './utils/models';
2
+ export declare const NestedList: ({ ariaLabel, anchorEl, "data-testid": dataTestId, items, menuPlacement, nestedDrawerLeftSpacing, onMenuLeave, open, parentItemIndex, type, }: NestedListProps) => JSX.Element;
@@ -1,2 +1,3 @@
1
1
  import { NestedListType } from './models';
2
2
  export declare const getChevronIcon: (nestedListType: NestedListType, isOpened: boolean) => "chevron-right" | "chevron-up" | "chevron-down";
3
+ export declare const shouldToggleOpen: (classNames: string) => boolean;
@@ -3,6 +3,7 @@ import { CommonProps } from '../../CommonProps';
3
3
  import { PopperPlacement } from '../../menu/Menu';
4
4
  import { LinkTarget } from '../../link/Link';
5
5
  import { tooltipPlacement } from '../../tooltip/Tooltip';
6
+ export declare const DEFAULT_TOOLTIP_PLACEMENT = "top-start";
6
7
  export declare type NestedListType = 'drawer' | 'expandable' | 'menu';
7
8
  export interface ListProps extends CommonProps {
8
9
  /** string or JSX element that is displayed inside the list */
@@ -80,6 +81,7 @@ export interface NestedListProps extends CommonProps {
80
81
  open: boolean;
81
82
  /** Index of the parent list item */
82
83
  parentItemIndex?: number;
84
+ toggleOpen?: (event: MouseEvent) => void;
83
85
  /** If 'menu' the nested list will be displayed as a flyout nav, else it will be an expand/collapse toggle list */
84
86
  type?: NestedListType;
85
87
  }
@@ -1,6 +1,7 @@
1
1
  import { MouseEvent } from 'react';
2
2
  import { ListItemProps } from '../list/utils/models';
3
3
  export declare const childElement: JSX.Element;
4
+ export declare const childSearchElement: JSX.Element;
4
5
  export declare const getNavigationItems: (isSelected: (key: number) => boolean, handleClick: (key: number) => void) => ({
5
6
  startIcon: JSX.Element;
6
7
  onClick: import("@storybook/addon-actions").HandlerFunction;
@@ -9,19 +10,29 @@ export declare const getNavigationItems: (isSelected: (key: number) => boolean,
9
10
  divider: boolean;
10
11
  onClick?: undefined;
11
12
  selected?: undefined;
13
+ href?: undefined;
12
14
  child?: undefined;
13
15
  } | {
14
16
  onClick: (_event: MouseEvent) => void;
15
17
  selected: boolean;
16
18
  text: string;
17
19
  divider?: undefined;
20
+ href?: undefined;
21
+ child?: undefined;
22
+ } | {
23
+ href: string;
24
+ text: string;
25
+ divider?: undefined;
26
+ onClick?: undefined;
27
+ selected?: undefined;
18
28
  child?: undefined;
19
29
  } | {
20
30
  child: JSX.Element;
31
+ onClick: (event: MouseEvent) => void;
21
32
  text?: undefined;
22
33
  divider?: undefined;
23
- onClick?: undefined;
24
34
  selected?: undefined;
35
+ href?: undefined;
25
36
  })[];
26
37
  text: string;
27
38
  endIconId?: undefined;
@@ -4,6 +4,7 @@ import { DotColumnHeader, Order } from './TableHeader';
4
4
  import { RowsPerPageOption } from './TablePagination';
5
5
  import { TypographyVariant } from '../typography/Typography';
6
6
  import { CollapsibleTableOptions, MultiSelect } from './utils/models';
7
+ import { PopperPlacement } from '../menu/Menu';
7
8
  export declare const TABLE_TYPOGRAPHY_VARIANT = "body1";
8
9
  export interface TableRowProps extends CommonProps {
9
10
  /** row identifier that will be passed to onRowClick callback */
@@ -14,6 +15,8 @@ export interface TableRowProps extends CommonProps {
14
15
  selected?: boolean;
15
16
  }
16
17
  export interface TableProps extends CommonProps {
18
+ /** The popper placement for the actions menu **/
19
+ actionsMenuPlacement?: PopperPlacement;
17
20
  /** Typography variant which will be used for table body cell values **/
18
21
  bodyTypography?: TypographyVariant;
19
22
  /** Optional collapsible-table object **/
@@ -70,4 +73,4 @@ export declare function stableSort<T>(array: T[], comparator: (order: T, orderBy
70
73
  * A wrapper component around the Table component from @material-ui. This component can be used for
71
74
  * creating a common structure for tables in the system.
72
75
  */
73
- export declare const DotTable: ({ 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) => JSX.Element;
76
+ 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) => JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { Story, ComponentMeta } from '@storybook/react';
2
2
  import { TableProps } from './Table';
3
- declare const _default: ComponentMeta<({ 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) => JSX.Element>;
3
+ declare const _default: ComponentMeta<({ 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) => JSX.Element>;
4
4
  export default _default;
5
5
  export declare const Default: Story;
6
6
  export declare const LocallyPaginatedTable: Story;
@@ -4,17 +4,20 @@ import { TableRowProps } from './Table';
4
4
  import { CommonProps } from '../CommonProps';
5
5
  import { TypographyVariant } from '../typography/Typography';
6
6
  import { CollapsibleTableBody, MultiSelectBody } from './utils/models';
7
+ import { PopperPlacement } from '../menu/Menu';
7
8
  export interface TableBodyProps extends CommonProps {
9
+ /** The popper placement for the actions menu **/
10
+ actionsMenuPlacement?: PopperPlacement;
8
11
  collapsibleTableBody?: CollapsibleTableBody;
9
- /** The table column headers */
12
+ /** The table column headers **/
10
13
  columns: Array<DotColumnHeader>;
11
- /** The table body row data */
14
+ /** The table body row data **/
12
15
  data: Array<TableRowProps>;
13
- /** Message to show if no data */
16
+ /** Message to show if no data **/
14
17
  emptyMessage?: string;
15
18
  /** Optional multi-select checkbox body object **/
16
19
  multiSelectBody?: MultiSelectBody;
17
- /** Row click event callback */
20
+ /** Row click event callback **/
18
21
  onRowClick?: (event: MouseEvent, id: string) => void;
19
22
  /** Typography variant which will be used for body cell values **/
20
23
  typography: TypographyVariant;
@@ -23,4 +26,4 @@ export interface TableBodyProps extends CommonProps {
23
26
  * A wrapper component around the TableBody component from @material-ui. This component can be used
24
27
  * to determine the functionality of the table.
25
28
  */
26
- export declare const DotTableBody: ({ collapsibleTableBody, columns, data, emptyMessage, multiSelectBody, onRowClick, typography, }: TableBodyProps) => JSX.Element;
29
+ export declare const DotTableBody: ({ actionsMenuPlacement, collapsibleTableBody, columns, data, emptyMessage, multiSelectBody, onRowClick, typography, }: TableBodyProps) => JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digital-ai/dot-components",
3
- "version": "2.17.3",
3
+ "version": "2.18.1",
4
4
  "private": false,
5
5
  "license": "SEE LICENSE IN <LICENSE.md>",
6
6
  "contributors": [