@digital-ai/dot-components 1.6.0 → 1.8.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/CHANGE_LOG.md +100 -1
- package/dot-components.esm.js +3398 -3315
- package/dot-components.umd.js +1137 -536
- package/lib/components/accordion/Accordion.styles.d.ts +0 -1
- package/lib/components/app-toolbar/AppToolbar.d.ts +4 -2
- package/lib/components/app-toolbar/AppToolbar.stories.data.d.ts +15 -0
- package/lib/components/app-toolbar/AppToolbar.stories.styles.d.ts +2 -0
- package/lib/components/auto-complete/AutoComplete.d.ts +23 -8
- package/lib/components/auto-complete/AutoComplete.styles.d.ts +2 -0
- package/lib/components/auto-complete/Autocomplete.stories.data.d.ts +21 -0
- package/lib/components/auto-complete/utils/helpers.d.ts +7 -0
- package/lib/components/breadcrumbs/Breadcrumbs.d.ts +3 -1
- package/lib/components/breadcrumbs/Breadcrumbs.data.d.ts +1 -0
- package/lib/components/drawer/Drawer.d.ts +4 -4
- package/lib/components/index.d.ts +5 -11
- package/lib/components/input-form-fields/Input.stories.data.d.ts +13 -0
- package/lib/components/input-form-fields/InputFormFields.propTypes.d.ts +1 -1
- package/lib/components/input-form-fields/InputSelect.d.ts +8 -1
- package/lib/components/list/List.stories.data.d.ts +1 -1
- package/lib/components/list/ListItem.styles.d.ts +1 -1
- package/lib/components/sidebar/Sidebar.stories.data.d.ts +91 -0
- package/lib/components/table/Table.d.ts +4 -1
- package/lib/components/table/Table.stories.data.d.ts +2 -0
- package/lib/components/table/TableBody.d.ts +4 -1
- package/lib/components/table/TableBodyCheckboxCell.d.ts +8 -0
- package/lib/components/table/TableBodyCheckboxCell.styles.d.ts +3 -0
- package/lib/components/table/TableHeader.d.ts +3 -1
- package/lib/components/table/TableHeaderCheckboxCell.d.ts +8 -0
- package/lib/components/table/TableHeaderCheckboxCell.styles.d.ts +3 -0
- package/lib/components/table/TableRow.d.ts +4 -1
- package/lib/components/table/TableRow.styles.d.ts +2 -0
- package/lib/components/table/TableSelectionToolbar.d.ts +7 -0
- package/lib/components/table/TableSelectionToolbar.styles.d.ts +3 -0
- package/lib/components/table/index.d.ts +10 -0
- package/lib/components/table/utils/helpers.d.ts +2 -0
- package/lib/components/table/utils/models.d.ts +21 -0
- package/package.json +3 -2
|
@@ -2,5 +2,4 @@ import { Accordion } from '@material-ui/core';
|
|
|
2
2
|
export declare const rootClassName = "dot-accordion";
|
|
3
3
|
export declare const summaryClassName = "dot-accordion-summary";
|
|
4
4
|
export declare const detailClassName = "dot-accordion-details";
|
|
5
|
-
export declare const actionsClassName = "dot-accordion-actions";
|
|
6
5
|
export declare const StyledAccordion: import("styled-components").StyledComponent<typeof Accordion, any, {}, never>;
|
|
@@ -15,7 +15,9 @@ export interface AppToolbarProps extends CommonProps {
|
|
|
15
15
|
borderColor?: string;
|
|
16
16
|
/** JSX Element that is displayed between the logo and right nav */
|
|
17
17
|
children?: ReactNode;
|
|
18
|
-
/**
|
|
18
|
+
/** If true, main menu will close when item is clicked, if false it will prevent menu closing */
|
|
19
|
+
closeMenuOnItemClick?: boolean;
|
|
20
|
+
/** Allow displaying custom logo */
|
|
19
21
|
customLogo?: ReactNode;
|
|
20
22
|
/** If true, the spacing and height will be shorter */
|
|
21
23
|
dense?: boolean;
|
|
@@ -30,4 +32,4 @@ export interface AppToolbarProps extends CommonProps {
|
|
|
30
32
|
/** URL of the page the primary logo link will go to */
|
|
31
33
|
primaryLogoHref?: string;
|
|
32
34
|
}
|
|
33
|
-
export declare const DotAppToolbar: ({ appName, appLogo, appLogoSmall, ariaLabel, avatar, borderColor, children, className, customLogo, "data-testid": dataTestId, dense, navItems, mainMenu, mainMenuItems, mainMenuWidth, primaryLogoHref, }: AppToolbarProps) => JSX.Element;
|
|
35
|
+
export declare const DotAppToolbar: ({ appName, appLogo, appLogoSmall, ariaLabel, avatar, borderColor, children, className, closeMenuOnItemClick, customLogo, "data-testid": dataTestId, dense, navItems, mainMenu, mainMenuItems, mainMenuWidth, primaryLogoHref, }: AppToolbarProps) => JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { History } from 'history';
|
|
3
|
+
import { ListItemProps } from '../list';
|
|
4
|
+
export declare const defaultMainMenuItems: Array<ListItemProps>;
|
|
5
|
+
export declare const defaultNavItems: ({
|
|
6
|
+
iconId: string;
|
|
7
|
+
tooltip: string;
|
|
8
|
+
onClick?: undefined;
|
|
9
|
+
} | {
|
|
10
|
+
iconId: string;
|
|
11
|
+
onClick: () => void;
|
|
12
|
+
tooltip: string;
|
|
13
|
+
})[];
|
|
14
|
+
export declare const getMenuNavigationItems: (history: History) => Array<ListItemProps>;
|
|
15
|
+
export declare const MenuNavigationRoutes: () => JSX.Element;
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import { ChangeEvent, Ref } from 'react';
|
|
1
|
+
import { ChangeEvent, ReactNode, Ref } from 'react';
|
|
2
|
+
import { AutocompleteCloseReason } from '@material-ui/lab';
|
|
2
3
|
import { CommonProps } from '../CommonProps';
|
|
4
|
+
export declare const DEFAULT_ACTION_ITEM_TEXT = "Add new item";
|
|
3
5
|
export interface ActionItem {
|
|
4
6
|
/** The icon to display on the button */
|
|
5
|
-
iconId
|
|
7
|
+
iconId?: string;
|
|
6
8
|
/** Event callback */
|
|
7
|
-
onClick: () => void;
|
|
8
|
-
/**
|
|
9
|
-
|
|
9
|
+
onClick: (inputText?: string) => void;
|
|
10
|
+
/** If set to true, it will prevent duplicate item insertion */
|
|
11
|
+
preventDuplicateInsertion?: boolean;
|
|
12
|
+
/** Text/Node displayed */
|
|
13
|
+
text?: string | ReactNode;
|
|
10
14
|
}
|
|
11
15
|
export declare type autoCompleteSize = 'medium' | 'small';
|
|
12
16
|
export declare type AutoCompleteValue = string | string[] | AutoCompleteOption | AutoCompleteOption[];
|
|
@@ -15,7 +19,6 @@ export interface AutoCompleteOption {
|
|
|
15
19
|
group?: string;
|
|
16
20
|
title: string;
|
|
17
21
|
}
|
|
18
|
-
export declare const parseAutoCompleteValue: (value: AutoCompleteValue) => string;
|
|
19
22
|
export interface AutoCompleteProps extends CommonProps {
|
|
20
23
|
/** Action button as the last element on the menu **/
|
|
21
24
|
actionItem?: ActionItem;
|
|
@@ -23,6 +26,8 @@ export interface AutoCompleteProps extends CommonProps {
|
|
|
23
26
|
autoFocus?: boolean;
|
|
24
27
|
/** default option that is selected */
|
|
25
28
|
defaultValue?: AutoCompleteValue;
|
|
29
|
+
/** When `true` input textbox will be small size, when `false` it will be medium size. Default value is `true`. **/
|
|
30
|
+
dense?: boolean;
|
|
26
31
|
/** Disable the portal behavior. If true, children stay within parent DOM hierarchy. */
|
|
27
32
|
disablePortal?: boolean;
|
|
28
33
|
/** If true, the input will be disabled. */
|
|
@@ -41,10 +46,20 @@ export interface AutoCompleteProps extends CommonProps {
|
|
|
41
46
|
inputRef?: Ref<HTMLInputElement>;
|
|
42
47
|
/** Label displayed above the input field */
|
|
43
48
|
label?: string;
|
|
49
|
+
/** If true, the component will be in a loading state. */
|
|
50
|
+
loading?: boolean;
|
|
44
51
|
/** If true, will allow the user to select multiple options */
|
|
45
52
|
multiple?: boolean;
|
|
46
|
-
/** A function that should be executed when the value
|
|
53
|
+
/** A function that should be executed when the autocomplete value changes */
|
|
47
54
|
onChange?: (event: ChangeEvent<unknown>, value: AutoCompleteValue, reason: string) => void;
|
|
55
|
+
/** Callback fired when the popup requests to be closed. Use in controlled mode. */
|
|
56
|
+
onClose?: (event: ChangeEvent, reason: AutocompleteCloseReason) => void;
|
|
57
|
+
/** A function that should be executed each time when the input value changes */
|
|
58
|
+
onInputChange?: (event: ChangeEvent<unknown>, value: string, reason: string) => void;
|
|
59
|
+
/** Callback fired when the popup requests to be opened. Use in controlled mode. */
|
|
60
|
+
onOpen?: (event: ChangeEvent) => void;
|
|
61
|
+
/** Controls the popup's open state. */
|
|
62
|
+
open?: boolean;
|
|
48
63
|
/** pre-defined options available to the user */
|
|
49
64
|
options?: Array<AutoCompleteOption>;
|
|
50
65
|
/** Placeholder text always displayed inside the input field */
|
|
@@ -56,4 +71,4 @@ export interface AutoCompleteProps extends CommonProps {
|
|
|
56
71
|
/** value if this is a controlled component */
|
|
57
72
|
value?: AutoCompleteValue;
|
|
58
73
|
}
|
|
59
|
-
export declare const DotAutoComplete: ({ actionItem, ariaLabel, autoFocus, className, "data-testid": dataTestId, defaultValue, disabled, disablePortal, error, freesolo, group, helperText, inputId, inputRef, label, multiple, onChange, options, placeholder, required, size, value, }: AutoCompleteProps) => JSX.Element;
|
|
74
|
+
export declare const DotAutoComplete: ({ actionItem, ariaLabel, autoFocus, className, "data-testid": dataTestId, defaultValue, dense, disabled, disablePortal, error, freesolo, group, helperText, inputId, inputRef, label, loading, multiple, onChange, onClose, onInputChange, onOpen, open, options, placeholder, required, size, value, }: AutoCompleteProps) => JSX.Element;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { Autocomplete } from '@material-ui/lab';
|
|
2
2
|
export declare const rootClassName = "dot-autocomplete";
|
|
3
|
+
export declare const inputRootClassName = "dot-input-root";
|
|
4
|
+
export declare const inputMediumClassName = "dot-input-medium";
|
|
3
5
|
export declare const StyledAutocomplete: import("styled-components").StyledComponent<typeof Autocomplete, any, {}, never>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ActionItem } from './AutoComplete';
|
|
2
|
+
export declare const movies: {
|
|
3
|
+
group: string;
|
|
4
|
+
title: string;
|
|
5
|
+
error: boolean;
|
|
6
|
+
}[];
|
|
7
|
+
export declare const handleActionItemClick: (newItem?: string) => void;
|
|
8
|
+
export declare const actionItemOptions: ActionItem[];
|
|
9
|
+
export declare const actionItemArgType: {
|
|
10
|
+
options: string[];
|
|
11
|
+
mapping: ActionItem[];
|
|
12
|
+
control: {
|
|
13
|
+
type: string;
|
|
14
|
+
labels: {
|
|
15
|
+
0: string;
|
|
16
|
+
1: string;
|
|
17
|
+
2: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
defaultValue: string;
|
|
21
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { AutocompleteGetTagProps } from '@material-ui/lab';
|
|
3
|
+
import { ChipSize } from '../../chip/Chip';
|
|
4
|
+
import { AutoCompleteOption, AutoCompleteValue } from '../AutoComplete';
|
|
5
|
+
export declare const parseAutoCompleteValue: (value: AutoCompleteValue) => string;
|
|
6
|
+
export declare const getChipsFromAutocomplete: (values: Array<AutoCompleteOption | string>, getTagProps: AutocompleteGetTagProps, chipSize?: ChipSize) => JSX.Element[];
|
|
7
|
+
export declare const checkIfDuplicateItem: (itemText: string, autocompleteOptions: AutoCompleteOption[]) => boolean;
|
|
@@ -4,6 +4,8 @@ import { LinkUnderline } from '../link/Link';
|
|
|
4
4
|
export declare type BreadcrumbItem = {
|
|
5
5
|
/** Defines a string value that labels the current element **/
|
|
6
6
|
ariaLabel?: string;
|
|
7
|
+
/** If the number of characters is exceeded then an ellipsis should be used to truncate the text */
|
|
8
|
+
characterLimit?: number;
|
|
7
9
|
/** link the breadcrumb goes to */
|
|
8
10
|
href?: string;
|
|
9
11
|
onClick?: (event: React.MouseEvent<HTMLAnchorElement>) => void;
|
|
@@ -19,7 +21,7 @@ export interface BreadcrumbProps extends CommonProps {
|
|
|
19
21
|
items: Array<BreadcrumbItem>;
|
|
20
22
|
/** determines the maximum number of items to display */
|
|
21
23
|
maxItems?: number;
|
|
22
|
-
/**
|
|
24
|
+
/** DEPRECATED, DO NOT USE */
|
|
23
25
|
minWidth?: number;
|
|
24
26
|
}
|
|
25
27
|
export declare const DotBreadcrumbs: ({ className, "data-testid": dataTestId, expansionMenu, items, maxItems, minWidth, }: BreadcrumbProps) => JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BreadcrumbItem } from '../breadcrumbs/Breadcrumbs';
|
|
2
2
|
export declare const defaultStorybookItems: BreadcrumbItem[];
|
|
3
|
+
export declare const characterLimitBreadcrumbItems: BreadcrumbItem[];
|
|
3
4
|
export declare const mockBreadcrumbItems: BreadcrumbItem[];
|
|
4
5
|
export declare const mockLongBreadcrumbItems: BreadcrumbItem[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MouseEvent, ReactNode
|
|
1
|
+
import { CSSProperties, MouseEvent, ReactNode } from 'react';
|
|
2
2
|
import { CommonProps } from '../CommonProps';
|
|
3
3
|
export declare type DrawerAnchor = 'bottom' | 'left' | 'right' | 'top';
|
|
4
4
|
export declare type DrawerVariant = 'permanent' | 'persistent' | 'temporary';
|
|
@@ -23,11 +23,11 @@ export interface DrawerProps extends CommonProps {
|
|
|
23
23
|
/** string or JSX element that is displayed inside the drawer */
|
|
24
24
|
children?: ReactNode;
|
|
25
25
|
/** Props applied to drawer body */
|
|
26
|
-
drawerBodyProps?: DrawerSection
|
|
26
|
+
drawerBodyProps?: Omit<DrawerSection, 'ariaLabel'>;
|
|
27
27
|
/** Props applied to drawer footer */
|
|
28
|
-
drawerFooterProps?: DrawerSection
|
|
28
|
+
drawerFooterProps?: Omit<DrawerSection, 'ariaLabel'>;
|
|
29
29
|
/** Props applied to drawer header */
|
|
30
|
-
drawerHeaderProps?: DrawerSection
|
|
30
|
+
drawerHeaderProps?: Omit<DrawerSection, 'ariaLabel'>;
|
|
31
31
|
/** The height of the drawer when anchor is 'top' or 'bottom' */
|
|
32
32
|
height?: string;
|
|
33
33
|
/** Callback fired when the component requests to be closed. */
|
|
@@ -10,7 +10,7 @@ export type { DynamicFormProps } from './dynamic-form/DynamicForm';
|
|
|
10
10
|
export type { ConditionFunction, ControlClickHandler, DisabledConditionFunction, DisabledControlCondition, DynamicFormConfig, DynamicFormControl, DynamicFormControlProps, DynamicFormControlType, DynamicFormOutputData, DynamicFormSectionProps, DynamicFormState, DynamicFormStateItem, FieldValidation, } from './dynamic-form/models';
|
|
11
11
|
export type { IconButtonProps } from './button/IconButton';
|
|
12
12
|
export type { InputTextProps } from './input-form-fields/InputText';
|
|
13
|
-
export type { InputSelectProps } from './input-form-fields/InputSelect';
|
|
13
|
+
export type { InputSelectProps, InputSelectOption } from './input-form-fields/InputSelect';
|
|
14
14
|
export type { LinkUnderline } from './link/Link';
|
|
15
15
|
export type { ListItemProps } from './list';
|
|
16
16
|
export type { MenuItemProps } from './menu/Menu';
|
|
@@ -19,12 +19,7 @@ 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 } from './switch/Switch';
|
|
22
|
-
export type { TableRowProps } from './table
|
|
23
|
-
export type { TextAlignment } from './table/TableCell';
|
|
24
|
-
export type { DotColumnHeader, Order } from './table/TableHeader';
|
|
25
|
-
export type { SortDirection } from './table/TableHeaderCell';
|
|
26
|
-
export type { TableDataWithPagination } from './table/TableDataWithPagination';
|
|
27
|
-
export type { RowsPerPageOption } from './table/TablePagination';
|
|
22
|
+
export type { DotColumnHeader, MultiSelect, Order, RowSelectionChangeHandler, RowsPerPageOption, TableDataWithPagination, TableRowProps, TableRowSelectChangeHandler, TextAlignment, SortDirection, } from './table';
|
|
28
23
|
export type { TabProps } from './tabs/Tabs';
|
|
29
24
|
export type { TypographyVariant } from './typography/Typography';
|
|
30
25
|
export type { ProgressButtonProps } from './progress-button/ProgressButton';
|
|
@@ -33,7 +28,7 @@ export { DotActionToolbar } from './action-toolbar/ActionToolbar';
|
|
|
33
28
|
export { DotAlertBanner } from './alert-banner/AlertBanner';
|
|
34
29
|
export { DotAppLogo } from './app-logo/AppLogo';
|
|
35
30
|
export { DotAppToolbar } from './app-toolbar/AppToolbar';
|
|
36
|
-
export { DotAutoComplete
|
|
31
|
+
export { DotAutoComplete } from './auto-complete/AutoComplete';
|
|
37
32
|
export { DotAvatar } from './avatar/Avatar';
|
|
38
33
|
export { DotAvatarGroup } from './avatar-group/AvatarGroup';
|
|
39
34
|
export { DotBadge } from './badge/Badge';
|
|
@@ -77,10 +72,9 @@ export { DotSnackbarContainer, DotSnackbarProvider, useDotSnackbarContext, } fro
|
|
|
77
72
|
export { DotSplitButton } from './split-button/SplitButton';
|
|
78
73
|
export { DotProgressButton } from './progress-button/ProgressButton';
|
|
79
74
|
export { DotSwitch } from './switch/Switch';
|
|
80
|
-
export { DotTable } from './table
|
|
75
|
+
export { DotHeaderRow, DotTable, DotTablePagination } from './table';
|
|
81
76
|
export { DotTooltip } from './tooltip/Tooltip';
|
|
82
|
-
export { DotHeaderRow } from './table/TableHeader';
|
|
83
|
-
export { DotTablePagination } from './table/TablePagination';
|
|
84
77
|
export { DotTabs } from './tabs/Tabs';
|
|
85
78
|
export { DotTypography } from './typography/Typography';
|
|
86
79
|
export { DotFileUpload } from './file-upload/FileUpload';
|
|
80
|
+
export { parseAutoCompleteValue } from './auto-complete/utils/helpers';
|
|
@@ -15,7 +15,7 @@ export interface InputProps extends CommonProps {
|
|
|
15
15
|
/** If true, the input will take up the full width of its container */
|
|
16
16
|
fullWidth?: boolean;
|
|
17
17
|
/** The helper text content. */
|
|
18
|
-
helperText?:
|
|
18
|
+
helperText?: ReactNode;
|
|
19
19
|
/**
|
|
20
20
|
* id to identify the element, also used to create label "for" and helper text id attribute
|
|
21
21
|
* values while it's optional, it is considered required for accessiblity best practice.
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { InputProps } from './InputFormFields.propTypes';
|
|
3
|
+
export declare type OptionType = string | InputSelectOption;
|
|
4
|
+
export interface InputSelectOption {
|
|
5
|
+
/** options that appears in dropdown */
|
|
6
|
+
option: string;
|
|
7
|
+
/** value of input field when option is selected */
|
|
8
|
+
value?: string;
|
|
9
|
+
}
|
|
3
10
|
export interface InputSelectProps extends InputProps {
|
|
4
11
|
/** default value of select field */
|
|
5
12
|
defaultValue?: string;
|
|
6
13
|
/** options of select dropdown */
|
|
7
|
-
options: Array<
|
|
14
|
+
options: Array<OptionType>;
|
|
8
15
|
/** value of input field */
|
|
9
16
|
value?: string;
|
|
10
17
|
}
|
|
@@ -37,6 +37,6 @@ export declare const StyledListItem: import("@material-ui/core/OverridableCompon
|
|
|
37
37
|
button: true;
|
|
38
38
|
}, "div">>> & Pick<Pick<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "key" | keyof import("react").AnchorHTMLAttributes<HTMLAnchorElement>> & {
|
|
39
39
|
ref?: import("react").Ref<HTMLAnchorElement>;
|
|
40
|
-
}, "slot" | "title" | "type" | "ref" | "
|
|
40
|
+
}, "slot" | "title" | "type" | "ref" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "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" | "download" | "href" | "hrefLang" | "media" | "ping" | "rel" | "target" | "referrerPolicy">) => JSX.Element) & import("@material-ui/core/OverridableComponent").OverridableComponent<import("@material-ui/core").ExtendButtonBaseTypeMap<import("@material-ui/core").ListItemTypeMap<{
|
|
41
41
|
button: true;
|
|
42
42
|
}, "div">>>;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { MouseEvent } from 'react';
|
|
2
|
+
import { ListItemProps } from '../list/utils/models';
|
|
3
|
+
export declare const childElement: JSX.Element;
|
|
4
|
+
export declare const getNavigationItems: (isSelected: (key: number) => boolean, handleClick: (key: number) => void) => ({
|
|
5
|
+
startIconId: string;
|
|
6
|
+
onClick: import("@storybook/addon-actions").HandlerFunction;
|
|
7
|
+
items: ({
|
|
8
|
+
text: string;
|
|
9
|
+
divider: boolean;
|
|
10
|
+
onClick?: undefined;
|
|
11
|
+
selected?: undefined;
|
|
12
|
+
child?: undefined;
|
|
13
|
+
} | {
|
|
14
|
+
onClick: (_event: MouseEvent) => void;
|
|
15
|
+
selected: boolean;
|
|
16
|
+
text: string;
|
|
17
|
+
divider?: undefined;
|
|
18
|
+
child?: undefined;
|
|
19
|
+
} | {
|
|
20
|
+
child: JSX.Element;
|
|
21
|
+
text?: undefined;
|
|
22
|
+
divider?: undefined;
|
|
23
|
+
onClick?: undefined;
|
|
24
|
+
selected?: undefined;
|
|
25
|
+
})[];
|
|
26
|
+
text: string;
|
|
27
|
+
endIconId?: undefined;
|
|
28
|
+
selected?: undefined;
|
|
29
|
+
divider?: undefined;
|
|
30
|
+
} | {
|
|
31
|
+
items: ({
|
|
32
|
+
text: string;
|
|
33
|
+
divider: boolean;
|
|
34
|
+
startIconId?: undefined;
|
|
35
|
+
onClick?: undefined;
|
|
36
|
+
selected?: undefined;
|
|
37
|
+
} | {
|
|
38
|
+
startIconId: string;
|
|
39
|
+
onClick: (_event: MouseEvent) => void;
|
|
40
|
+
selected: boolean;
|
|
41
|
+
text: string;
|
|
42
|
+
divider?: undefined;
|
|
43
|
+
})[];
|
|
44
|
+
text: string;
|
|
45
|
+
startIconId?: undefined;
|
|
46
|
+
onClick?: undefined;
|
|
47
|
+
endIconId?: undefined;
|
|
48
|
+
selected?: undefined;
|
|
49
|
+
divider?: undefined;
|
|
50
|
+
} | {
|
|
51
|
+
endIconId: string;
|
|
52
|
+
startIconId: string;
|
|
53
|
+
onClick: (_event: MouseEvent) => void;
|
|
54
|
+
selected: boolean;
|
|
55
|
+
text: string;
|
|
56
|
+
items?: undefined;
|
|
57
|
+
divider?: undefined;
|
|
58
|
+
} | {
|
|
59
|
+
text: string;
|
|
60
|
+
divider: boolean;
|
|
61
|
+
startIconId?: undefined;
|
|
62
|
+
onClick?: undefined;
|
|
63
|
+
items?: undefined;
|
|
64
|
+
endIconId?: undefined;
|
|
65
|
+
selected?: undefined;
|
|
66
|
+
} | {
|
|
67
|
+
startIconId: string;
|
|
68
|
+
onClick: (_event: MouseEvent) => void;
|
|
69
|
+
selected: boolean;
|
|
70
|
+
text: string;
|
|
71
|
+
items?: undefined;
|
|
72
|
+
endIconId?: undefined;
|
|
73
|
+
divider?: undefined;
|
|
74
|
+
} | {
|
|
75
|
+
divider: boolean;
|
|
76
|
+
startIconId?: undefined;
|
|
77
|
+
onClick?: undefined;
|
|
78
|
+
items?: undefined;
|
|
79
|
+
text?: undefined;
|
|
80
|
+
endIconId?: undefined;
|
|
81
|
+
selected?: undefined;
|
|
82
|
+
})[];
|
|
83
|
+
export declare const routerNavigationItems: Array<ListItemProps>;
|
|
84
|
+
interface SidebarPageTitleProps {
|
|
85
|
+
description?: string;
|
|
86
|
+
iconId: string;
|
|
87
|
+
title: string;
|
|
88
|
+
}
|
|
89
|
+
export declare const SidebarPageTitle: ({ description, title, iconId, }: SidebarPageTitleProps) => JSX.Element;
|
|
90
|
+
export declare const SidebarStoryRoutes: () => JSX.Element;
|
|
91
|
+
export {};
|
|
@@ -3,6 +3,7 @@ import { CommonProps } from '../CommonProps';
|
|
|
3
3
|
import { DotColumnHeader, Order } from './TableHeader';
|
|
4
4
|
import { RowsPerPageOption } from './TablePagination';
|
|
5
5
|
import { TypographyVariant } from '../typography/Typography';
|
|
6
|
+
import { MultiSelect } from './utils/models';
|
|
6
7
|
export declare const TABLE_TYPOGRAPHY_VARIANT = "body1";
|
|
7
8
|
export interface TableRowProps extends CommonProps {
|
|
8
9
|
/** row identifier that will be passed to onRowClick callback */
|
|
@@ -35,6 +36,8 @@ export interface TableProps extends CommonProps {
|
|
|
35
36
|
loading?: boolean;
|
|
36
37
|
/** Maximum height of table container */
|
|
37
38
|
maxHeight?: string;
|
|
39
|
+
/** Optional multi-select checkbox object **/
|
|
40
|
+
multiSelect?: MultiSelect;
|
|
38
41
|
/** Row click event callback */
|
|
39
42
|
onRowClick?: (event: MouseEvent, id: string) => void;
|
|
40
43
|
/** Update data callback if data is managed by consumer */
|
|
@@ -61,4 +64,4 @@ export declare function stableSort<T>(array: T[], comparator: (order: T, orderBy
|
|
|
61
64
|
* A wrapper component around the Table component from @material-ui. This component can be used for
|
|
62
65
|
* creating a common structure for tables in the system.
|
|
63
66
|
*/
|
|
64
|
-
export declare const DotTable: ({ ariaLabel, bodyTypography, className, columns, count, data, "data-testid": dataTestId, emptyMessage, footerTypography, headerTypography, 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,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { TextAlignment } from './TableCell';
|
|
3
|
+
import { TableProps } from './Table';
|
|
3
4
|
export declare const actionMenuColumns: ({
|
|
4
5
|
id: string;
|
|
5
6
|
label: string;
|
|
@@ -119,3 +120,4 @@ export declare const paginatedData: {
|
|
|
119
120
|
hit: string;
|
|
120
121
|
};
|
|
121
122
|
}[];
|
|
123
|
+
export declare const MultiSelectTable: (props: TableProps) => JSX.Element;
|
|
@@ -3,6 +3,7 @@ import { DotColumnHeader } from './TableHeader';
|
|
|
3
3
|
import { TableRowProps } from './Table';
|
|
4
4
|
import { CommonProps } from '../CommonProps';
|
|
5
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,6 +11,8 @@ 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;
|
|
15
18
|
/** Typography variant which will be used for body cell values **/
|
|
@@ -19,4 +22,4 @@ export interface TableBodyProps extends CommonProps {
|
|
|
19
22
|
* A wrapper component around the TableBody component from @material-ui. This component can be used
|
|
20
23
|
* to determine the functionality of the table.
|
|
21
24
|
*/
|
|
22
|
-
export declare const DotTableBody: ({ columns, data, emptyMessage, onRowClick, typography, }: TableBodyProps) => JSX.Element;
|
|
25
|
+
export declare const DotTableBody: ({ columns, data, emptyMessage, multiSelectBody, onRowClick, typography, }: TableBodyProps) => JSX.Element;
|
|
@@ -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;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { TextAlignment } from './TableCell';
|
|
3
3
|
import { TypographyVariant } from '../typography/Typography';
|
|
4
|
+
import { MultiSelectHeader } from './utils/models';
|
|
4
5
|
export interface DotColumnHeader {
|
|
5
6
|
align?: TextAlignment;
|
|
6
7
|
id: string;
|
|
@@ -13,6 +14,7 @@ export declare type Order = 'asc' | 'desc';
|
|
|
13
14
|
export interface HeaderProps {
|
|
14
15
|
columns: Array<DotColumnHeader>;
|
|
15
16
|
hasActionColumn: boolean;
|
|
17
|
+
multiSelectHeader?: MultiSelectHeader;
|
|
16
18
|
onRequestSort: (property: string) => void;
|
|
17
19
|
order?: Order;
|
|
18
20
|
/** The ID of the column that you are sorting by */
|
|
@@ -24,4 +26,4 @@ export interface HeaderProps {
|
|
|
24
26
|
* A wrapper component around the TableHead component from @material-ui. This component can be used
|
|
25
27
|
* to determine the functionality of the table header.
|
|
26
28
|
*/
|
|
27
|
-
export declare const DotHeaderRow: ({ columns, hasActionColumn, onRequestSort, order, orderBy, sortable, typography, }: HeaderProps) => JSX.Element;
|
|
29
|
+
export declare const DotHeaderRow: ({ columns, hasActionColumn, multiSelectHeader, onRequestSort, order, orderBy, sortable, typography, }: HeaderProps) => JSX.Element;
|
|
@@ -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;
|
|
@@ -3,6 +3,7 @@ import { DotColumnHeader } from './TableHeader';
|
|
|
3
3
|
import { CommonProps } from '../CommonProps';
|
|
4
4
|
import { TableRowProps } from './Table';
|
|
5
5
|
import { TypographyVariant } from '../typography/Typography';
|
|
6
|
+
import { MultiSelectBody } from './utils/models';
|
|
6
7
|
export interface EmptyRowProps {
|
|
7
8
|
cols: number;
|
|
8
9
|
message?: string;
|
|
@@ -13,6 +14,8 @@ export interface RowProps extends CommonProps {
|
|
|
13
14
|
columns: Array<DotColumnHeader>;
|
|
14
15
|
/** The table body row data */
|
|
15
16
|
data: TableRowProps;
|
|
17
|
+
/** Optional multi-select checkbox body object **/
|
|
18
|
+
multiSelectBody?: MultiSelectBody;
|
|
16
19
|
/** Event callback of action button of menu */
|
|
17
20
|
onActionMenuTrigger: (el: HTMLElement, menuItem: Array<ReactNode>) => void;
|
|
18
21
|
/** Event callback */
|
|
@@ -28,5 +31,5 @@ export interface RowProps extends CommonProps {
|
|
|
28
31
|
* A wrapper component around the TableRow component from @material-ui. This component can be used
|
|
29
32
|
* for manipulating data prior to displaying the data inside the table
|
|
30
33
|
*/
|
|
31
|
-
export declare const DotTableRow: ({ columns, className, data, onActionMenuTrigger, onClick, rowKey, selected, typography, }: RowProps) => JSX.Element;
|
|
34
|
+
export declare const DotTableRow: ({ columns, className, data, multiSelectBody, onActionMenuTrigger, onClick, rowKey, selected, typography, }: RowProps) => JSX.Element;
|
|
32
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';
|
|
@@ -5,3 +5,5 @@ import { DotColumnHeader } from '../TableHeader';
|
|
|
5
5
|
export declare const getFormattedTableCellValue: (value: unknown, typographyVariant: TypographyVariant) => ReactNode;
|
|
6
6
|
export declare const getContainerMaxHeightStyle: (stickyHeader?: boolean, maxHeight?: string) => string;
|
|
7
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 {};
|