@oc-digital/react-component-library 7.2.3-beta.0 → 7.2.3-beta.10
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/build/Alert/Alert.d.ts +5 -0
- package/build/Alert/Alert.types.d.ts +14 -0
- package/build/AlphabeticalList/AlphabeticalList.d.ts +5 -0
- package/build/AlphabeticalList/AlphabeticalList.types.d.ts +22 -0
- package/build/AutoSave/Select/AutoSave.types.d.ts +11 -0
- package/build/AutoSave/Select/index.d.ts +4 -0
- package/build/AutoSave/Text/AutoSave.types.d.ts +17 -0
- package/build/AutoSave/Text/index.d.ts +4 -0
- package/build/Breadcrumbs/Breadcrumbs.d.ts +5 -0
- package/build/Breadcrumbs/Breadcrumbs.types.d.ts +24 -0
- package/build/Button/Button.d.ts +4 -0
- package/build/Button/Button.types.d.ts +10 -0
- package/build/ButtonWithConfirm/ButtonWithConfirm.d.ts +5 -0
- package/build/ButtonWithConfirm/ButtonWithConfirm.types.d.ts +9 -0
- package/build/ContentBox/ContentBox.d.ts +5 -0
- package/build/ContentBox/ContentBox.types.d.ts +7 -0
- package/build/ContentLabel/ContentLabel.d.ts +5 -0
- package/build/ContentLabel/ContentLabel.types.d.ts +5 -0
- package/build/DatePicker/DatePicker.d.ts +5 -0
- package/build/DatePicker/DatePicker.types.d.ts +6 -0
- package/build/EditableTable/EditableTable.d.ts +5 -0
- package/build/EditableTable/EditableTable.types.d.ts +107 -0
- package/build/EditableTable/components/TableCheckbox.d.ts +8 -0
- package/build/EditableTable/components/TableDateInput.d.ts +8 -0
- package/build/EditableTable/components/TableTextInput.d.ts +21 -0
- package/build/EditableTable/components/utils/getTextWidth.d.ts +13 -0
- package/build/EditableTable/defaultCells.d.ts +31 -0
- package/build/EntityList/EntityList.d.ts +5 -0
- package/build/EntityList/EntityList.types.d.ts +15 -0
- package/build/ErrorIndicator/ErrorIndicator.d.ts +5 -0
- package/build/ErrorIndicator/ErrorIndicator.types.d.ts +5 -0
- package/build/ImageDisplayAndUpload/ImageDisplayAndUpload.d.ts +5 -0
- package/build/ImageDisplayAndUpload/ImageDisplayAndUpload.types.d.ts +9 -0
- package/build/KeyboardDatePicker/KeyboardDatePicker.d.ts +5 -0
- package/build/KeyboardDatePicker/KeyboardDatePicker.types.d.ts +6 -0
- package/build/LeftNavigation/LeftNavigation.d.ts +5 -0
- package/build/LeftNavigation/LeftNavigation.types.d.ts +97 -0
- package/build/LeftNavigation/NavListItem.d.ts +5 -0
- package/build/LeftNavigation/PrimaryLeftNavigation.d.ts +5 -0
- package/build/LeftNavigation/SecondaryLeftNavigation.d.ts +5 -0
- package/build/LoadingSpinner/LoadingSpinner.d.ts +5 -0
- package/build/LoadingSpinner/LoadingSpinner.types.d.ts +6 -0
- package/build/MainLayout/MainLayout.d.ts +5 -0
- package/build/MainLayout/MainLayout.types.d.ts +11 -0
- package/build/MobileDatePicker/MobileDatePicker.d.ts +5 -0
- package/build/MobileDatePicker/MobileDatePicker.types.d.ts +6 -0
- package/build/NavbarLayout/Navbar.d.ts +13 -0
- package/build/NavbarLayout/NavbarLayout.d.ts +17 -0
- package/build/NavbarLayout/index.d.ts +2 -0
- package/build/SearchBar/SearchBar.d.ts +5 -0
- package/build/SearchBar/SearchBar.types.d.ts +33 -0
- package/build/Select/Select.d.ts +5 -0
- package/build/Select/Select.types.d.ts +16 -0
- package/build/StaticTable/StaticTable.d.ts +5 -0
- package/build/StaticTable/StaticTable.types.d.ts +21 -0
- package/build/SvgComponents/ContainedPartnersLogo.d.ts +5 -0
- package/build/SvgComponents/HomeSvg.d.ts +5 -0
- package/build/SvgComponents/NovelLogoSvg.d.ts +5 -0
- package/build/SvgComponents/OrganisationList.d.ts +5 -0
- package/build/SvgComponents/ProjectsSvg.d.ts +5 -0
- package/build/SvgComponents/index.d.ts +5 -0
- package/build/SvgComponents/types.d.ts +6 -0
- package/build/TextField/TextField.d.ts +16 -0
- package/build/TextField/TextField.types.d.ts +8 -0
- package/build/Tooltip/OptionalTooltip.d.ts +9 -0
- package/build/Tooltip/index.d.ts +1 -0
- package/build/globals/index.d.ts +26 -0
- package/build/hooks/index.d.ts +3 -0
- package/build/hooks/useDebounceEffect.d.ts +2 -0
- package/build/hooks/useInterval.d.ts +2 -0
- package/build/hooks/useWhyDidYouUpdate.d.ts +1 -0
- package/build/index.d.ts +38 -0
- package/build/index.js +413 -62833
- package/build/index.js.map +1 -1
- package/build/stories/Button.d.ts +28 -0
- package/build/stories/Button.stories.d.ts +10 -0
- package/build/stories/Header.d.ts +12 -0
- package/build/stories/Header.stories.d.ts +8 -0
- package/build/stories/Page.d.ts +3 -0
- package/build/stories/Page.stories.d.ts +8 -0
- package/build/styles/colours.d.ts +3 -0
- package/build/styles/font.d.ts +1 -0
- package/build/styles/index.d.ts +3 -0
- package/build/styles/layout.d.ts +1 -0
- package/build/styles/spacing.d.ts +1 -0
- package/build/styles/themes.d.ts +2 -0
- package/build/utils/index.d.ts +6 -0
- package/package.json +6 -7
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactChild } from 'react';
|
|
2
|
+
import { FormStatuses } from '../globals';
|
|
3
|
+
|
|
4
|
+
export interface IAlertProps {
|
|
5
|
+
alertActionHandler?: () => void;
|
|
6
|
+
formStatus: FormStatuses;
|
|
7
|
+
actionButton?: {
|
|
8
|
+
handler: () => void;
|
|
9
|
+
text: string;
|
|
10
|
+
};
|
|
11
|
+
alertMessage: ReactChild;
|
|
12
|
+
addBreak?: boolean;
|
|
13
|
+
styling?: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface IAlphabeticalListProps {
|
|
3
|
+
array: any[] | undefined | null;
|
|
4
|
+
sortFn?: (arg1: any, arg2: any) => number;
|
|
5
|
+
sortKey?: string;
|
|
6
|
+
loading?: boolean;
|
|
7
|
+
buttonClick?: (item?: any) => void;
|
|
8
|
+
linkTo?: (item?: any) => string;
|
|
9
|
+
ItemTemplate: React.FC<{
|
|
10
|
+
item: any;
|
|
11
|
+
}>;
|
|
12
|
+
arrayKey?: string;
|
|
13
|
+
loadingMessage?: string;
|
|
14
|
+
emptyMessage?: string | JSX.Element;
|
|
15
|
+
alphabetisedHeader?: boolean;
|
|
16
|
+
isItemDisabled?: (item: any) => {
|
|
17
|
+
disabled: true;
|
|
18
|
+
reason: string;
|
|
19
|
+
} | {
|
|
20
|
+
disabled: false;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FocusEvent } from 'react';
|
|
2
|
+
import { AccessLevels } from '../../globals';
|
|
3
|
+
|
|
4
|
+
export interface AutoSaveTextFieldProps {
|
|
5
|
+
autoSave: (value: string) => void;
|
|
6
|
+
value: string;
|
|
7
|
+
className: string;
|
|
8
|
+
label: string;
|
|
9
|
+
onBlur?: {
|
|
10
|
+
(e: FocusEvent<any, Element>): void;
|
|
11
|
+
<T = any>(fieldOrEvent: T): T extends string ? (e: any) => void : void;
|
|
12
|
+
};
|
|
13
|
+
disabled: boolean;
|
|
14
|
+
accessLevel: AccessLevels | undefined;
|
|
15
|
+
error: boolean;
|
|
16
|
+
helperText: string | false | undefined;
|
|
17
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
type BreadcrumbSlot = {
|
|
4
|
+
name: string;
|
|
5
|
+
link: string;
|
|
6
|
+
};
|
|
7
|
+
type BreadCrumbKeys = "first" | "second" | "third";
|
|
8
|
+
type IBreadcrumbs = {
|
|
9
|
+
[K in BreadCrumbKeys]?: BreadcrumbSlot;
|
|
10
|
+
};
|
|
11
|
+
type colorOptions = {
|
|
12
|
+
background?: string;
|
|
13
|
+
color?: string;
|
|
14
|
+
};
|
|
15
|
+
type ColorKeys = "primary" | "secondary" | "tertiary";
|
|
16
|
+
export type IBreadcrumbColors = {
|
|
17
|
+
[K in ColorKeys]?: colorOptions;
|
|
18
|
+
};
|
|
19
|
+
export interface IBreadcrumbsProps {
|
|
20
|
+
logo: ReactNode;
|
|
21
|
+
content: IBreadcrumbs;
|
|
22
|
+
colors?: IBreadcrumbColors;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IAuthoriserProp } from '../globals';
|
|
2
|
+
import { ButtonProps } from '@mui/material/Button';
|
|
3
|
+
|
|
4
|
+
export type IButtonProps<C extends React.ElementType = React.ElementType> = ButtonProps<C, {
|
|
5
|
+
component?: C;
|
|
6
|
+
}> & IAuthoriserProp & {
|
|
7
|
+
loading?: boolean;
|
|
8
|
+
errors?: boolean;
|
|
9
|
+
styling?: string;
|
|
10
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IAuthoriserProp } from '../globals';
|
|
2
|
+
import { ButtonProps } from '@mui/material';
|
|
3
|
+
|
|
4
|
+
export interface IButtonWithConfirmProps extends ButtonProps, IAuthoriserProp {
|
|
5
|
+
onClick: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
6
|
+
loading: boolean;
|
|
7
|
+
styling?: string;
|
|
8
|
+
confirmButtonLabel?: string;
|
|
9
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { CellProps, HeaderGroup, Row, TableBodyPropGetter, TableBodyProps, TablePropGetter, TableProps } from 'react-table';
|
|
2
|
+
import { SchemaOf } from 'yup';
|
|
3
|
+
import { default as React } from 'react';
|
|
4
|
+
|
|
5
|
+
export type IAlignment = "left" | "right" | "inherit" | "center" | "justify";
|
|
6
|
+
export type RowData = {
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
};
|
|
9
|
+
export type ITableHeader = {
|
|
10
|
+
Header: string | JSX.Element;
|
|
11
|
+
accessor: string;
|
|
12
|
+
textAlign?: IAlignment;
|
|
13
|
+
};
|
|
14
|
+
export type TableCellValues = null | undefined | string | number | Date | boolean | string[];
|
|
15
|
+
export type SynchCellWithStateFn = (rowIndex: number, columnId: string, value: TableCellValues, errorStatus: boolean, forceUpdate?: boolean) => void;
|
|
16
|
+
export type FieldConfig = {
|
|
17
|
+
[key: string]: {
|
|
18
|
+
validationRule?: SchemaOf<any>;
|
|
19
|
+
dependentValidationRule?: (values: {
|
|
20
|
+
[key: string]: any;
|
|
21
|
+
}) => SchemaOf<any>;
|
|
22
|
+
customRenderFn?: (args: ICustomRenderFnProps) => JSX.Element;
|
|
23
|
+
prefix?: React.ReactNode | React.JSXElementConstructor<any>;
|
|
24
|
+
suffix?: React.ReactNode | React.JSXElementConstructor<any>;
|
|
25
|
+
textAlign?: IAlignment;
|
|
26
|
+
onBlur?: (args: {
|
|
27
|
+
rowIndex: number;
|
|
28
|
+
value: string;
|
|
29
|
+
setRows: React.Dispatch<React.SetStateAction<RowData[] | null>>;
|
|
30
|
+
values: RowData;
|
|
31
|
+
}) => Promise<void>;
|
|
32
|
+
isCheckbox?: boolean;
|
|
33
|
+
isDateField?: boolean;
|
|
34
|
+
onChangeValueModifier?: (value: string) => TableCellValues;
|
|
35
|
+
getCalculatedValue?: (values: RowData) => TableCellValues;
|
|
36
|
+
total?: boolean;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export interface IEditableTableProps {
|
|
40
|
+
tableRows: RowData[] | null;
|
|
41
|
+
tableHeaders: ITableHeader[];
|
|
42
|
+
syncCellWithState: SynchCellWithStateFn;
|
|
43
|
+
setRows?: React.Dispatch<React.SetStateAction<RowData[] | null>> | undefined;
|
|
44
|
+
skipPageReset?: boolean;
|
|
45
|
+
fieldConfig: FieldConfig;
|
|
46
|
+
disabled?: boolean;
|
|
47
|
+
setSelectedRows?: React.Dispatch<React.SetStateAction<number[]>>;
|
|
48
|
+
includeRowSelect?: boolean;
|
|
49
|
+
filterTypes?: {
|
|
50
|
+
[key: string]: (rows: any, id: any, filterValue: any) => any;
|
|
51
|
+
};
|
|
52
|
+
filterData?: {
|
|
53
|
+
filterRow: string;
|
|
54
|
+
filterValues: RowData[];
|
|
55
|
+
};
|
|
56
|
+
emptyTableText?: string;
|
|
57
|
+
paginate?: boolean;
|
|
58
|
+
defaultPageSize?: number;
|
|
59
|
+
virtContainerStyling?: string;
|
|
60
|
+
overscan?: number;
|
|
61
|
+
rowHeight?: number;
|
|
62
|
+
includeGlobalSearch?: boolean;
|
|
63
|
+
disableHeaderSelect?: boolean;
|
|
64
|
+
}
|
|
65
|
+
type AdditionalCellProps = Pick<IEditableTableProps, "fieldConfig" | "syncCellWithState" | "setRows">;
|
|
66
|
+
export interface ExtendedCellProps extends AdditionalCellProps, CellProps<RowData> {
|
|
67
|
+
disabled: boolean;
|
|
68
|
+
}
|
|
69
|
+
export interface IEssentialRenderFnProps {
|
|
70
|
+
error: string | false;
|
|
71
|
+
disabled: boolean;
|
|
72
|
+
value: TableCellValues;
|
|
73
|
+
onChange: (e: any) => void;
|
|
74
|
+
onBlur: any;
|
|
75
|
+
prefix?: React.ReactNode | React.JSXElementConstructor<any> | Element;
|
|
76
|
+
suffix?: React.ReactNode | React.JSXElementConstructor<any> | Element;
|
|
77
|
+
numberField?: boolean;
|
|
78
|
+
textAlign?: IAlignment;
|
|
79
|
+
fixedDecimalScale?: boolean;
|
|
80
|
+
}
|
|
81
|
+
export interface ICustomRenderFnProps extends IEssentialRenderFnProps {
|
|
82
|
+
values: {
|
|
83
|
+
[key: string]: any;
|
|
84
|
+
};
|
|
85
|
+
originalValues: {
|
|
86
|
+
[key: string]: any;
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
export interface ITableContentProps extends Pick<IEditableTableProps, "disabled" | "includeRowSelect"> {
|
|
90
|
+
getTableProps: (propGetter?: TablePropGetter<RowData> | undefined) => TableProps;
|
|
91
|
+
headerGroups: HeaderGroup<RowData>[];
|
|
92
|
+
getTableBodyProps: (propGetter?: TableBodyPropGetter<RowData> | undefined) => TableBodyProps;
|
|
93
|
+
prepareRow: (row: Row<RowData>) => void;
|
|
94
|
+
rowsToRender: Row<RowData>[];
|
|
95
|
+
disabled: boolean;
|
|
96
|
+
includeRowSelect: boolean;
|
|
97
|
+
isAllRowsSelected: boolean;
|
|
98
|
+
selectedFlatRows: Row<RowData>[];
|
|
99
|
+
fieldConfig: FieldConfig;
|
|
100
|
+
tableHeaders: ITableHeader[];
|
|
101
|
+
}
|
|
102
|
+
export interface IGlobalFilterProps {
|
|
103
|
+
preGlobalFilteredRows: RowData[];
|
|
104
|
+
globalFilter: string | undefined;
|
|
105
|
+
setGlobalFilter: (val: string | undefined) => void;
|
|
106
|
+
}
|
|
107
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface ITableCheckboxProps {
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
value: boolean | null | undefined;
|
|
5
|
+
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const TableCheckbox: ({ disabled, value, onChange }: ITableCheckboxProps) => JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface ITableDateInputProps {
|
|
2
|
+
disabled: boolean;
|
|
3
|
+
value: Date | string | null | undefined;
|
|
4
|
+
error: string | false;
|
|
5
|
+
onChange: (value: Date | string) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const TableDateInput: ({ disabled, value, error, onChange, }: ITableDateInputProps) => JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { PureComponent } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface ITableTextInputProps {
|
|
4
|
+
name?: string;
|
|
5
|
+
value: string | number | null | undefined;
|
|
6
|
+
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
7
|
+
onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
8
|
+
prefix?: string | React.ReactElement | JSX.Element | null;
|
|
9
|
+
suffix?: string | React.ReactElement | JSX.Element | null;
|
|
10
|
+
textAlign?: "start" | "end" | "left" | "right" | "center" | "justify" | "match-parent" | "inherit";
|
|
11
|
+
numberField?: boolean;
|
|
12
|
+
fixedDecimalScale?: boolean;
|
|
13
|
+
error?: string | false;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
fullWidth?: boolean;
|
|
16
|
+
wrapperStyling?: string;
|
|
17
|
+
styling?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare class TableTextInput extends PureComponent<ITableTextInputProps> {
|
|
20
|
+
render(): JSX.Element;
|
|
21
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Optimised for TableTextField.
|
|
3
|
+
*
|
|
4
|
+
* Instead of accepting a HTMLElement, which would require a re-render to get the correct width,
|
|
5
|
+
* this function is oprimised to accept only the text and max width.
|
|
6
|
+
*/
|
|
7
|
+
export declare function getTableTextInputTextWidth(text: string, minWidth?: number, maxWidth?: number): string;
|
|
8
|
+
/**
|
|
9
|
+
* Calculates the width of a given string in pixels (perfect result)
|
|
10
|
+
*
|
|
11
|
+
* When using this to size inputs, the input must have CSS box-sizing: content-box
|
|
12
|
+
*/
|
|
13
|
+
export declare function getTextWidth(text: string, element: HTMLElement, minWidth?: number, maxWidth?: number): string;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { default as React, ReactChild, ReactNode } from 'react';
|
|
2
|
+
import { ICustomRenderFnProps, IEssentialRenderFnProps } from './EditableTable.types';
|
|
3
|
+
|
|
4
|
+
export declare const tableTextField: (tableProps: ICustomRenderFnProps) => JSX.Element;
|
|
5
|
+
export declare const tableNumericStringField: (tableProps: ICustomRenderFnProps) => JSX.Element;
|
|
6
|
+
export declare const tableNumericStringFixedDecimalField: (tableProps: ICustomRenderFnProps) => JSX.Element;
|
|
7
|
+
export declare const tableDateField: ({ value, onChange, disabled, error, }: ICustomRenderFnProps) => JSX.Element;
|
|
8
|
+
export declare const tableCheckbox: (tableProps: ICustomRenderFnProps) => JSX.Element;
|
|
9
|
+
interface INonEditableField extends Pick<IEssentialRenderFnProps, "numberField" | "prefix" | "suffix" | "textAlign" | "fixedDecimalScale"> {
|
|
10
|
+
text: React.ReactText;
|
|
11
|
+
styling?: string;
|
|
12
|
+
inputStyling?: string;
|
|
13
|
+
widthOverride?: string | undefined;
|
|
14
|
+
fullWidth?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare const NonEditableField: React.FC<INonEditableField>;
|
|
17
|
+
interface ITableSelect extends IEssentialRenderFnProps {
|
|
18
|
+
selectOptions: {
|
|
19
|
+
[key: string]: ReactChild;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export declare const TableSelect: React.FC<ITableSelect>;
|
|
23
|
+
interface IMultipleTableSelect extends Omit<IEssentialRenderFnProps, "value"> {
|
|
24
|
+
selectOptions: {
|
|
25
|
+
[key: string]: ReactChild;
|
|
26
|
+
};
|
|
27
|
+
value: string[];
|
|
28
|
+
renderValue?: (value: any) => ReactNode;
|
|
29
|
+
}
|
|
30
|
+
export declare const TableMultipleSelect: React.FC<IMultipleTableSelect>;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface IEntity {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
link: string;
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
}
|
|
9
|
+
export interface IEntityListProps {
|
|
10
|
+
entities: IEntity[] | undefined;
|
|
11
|
+
icon: (entity?: IEntity) => ReactNode;
|
|
12
|
+
loadingMessage?: string;
|
|
13
|
+
emptyMessage?: string;
|
|
14
|
+
onClick?: (org: IEntity) => void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IAuthoriserProp } from '../globals';
|
|
2
|
+
|
|
3
|
+
export interface IImageDisplayAndUploadProps extends IAuthoriserProp {
|
|
4
|
+
id?: string;
|
|
5
|
+
url: string | null;
|
|
6
|
+
handleSaveImage: (format: string, buffer: ArrayBuffer, file: File) => Promise<void>;
|
|
7
|
+
roundedAvatar?: boolean;
|
|
8
|
+
alt?: string;
|
|
9
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { default as React, ReactNode, ReactChild } from 'react';
|
|
2
|
+
import { ISvgComponentProps } from '../SvgComponents/types';
|
|
3
|
+
|
|
4
|
+
export interface INavigationLink {
|
|
5
|
+
field: string;
|
|
6
|
+
path: string;
|
|
7
|
+
Icon: React.FC<ISvgComponentProps>;
|
|
8
|
+
hasSecondary?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export type IExpandedOptions = {
|
|
11
|
+
view: string;
|
|
12
|
+
expanded: boolean;
|
|
13
|
+
};
|
|
14
|
+
export interface IMainNavigationItem {
|
|
15
|
+
id: string;
|
|
16
|
+
name: ReactChild;
|
|
17
|
+
route: string;
|
|
18
|
+
archived?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface ISecondaryNavigationSubItem {
|
|
21
|
+
id: string;
|
|
22
|
+
name: ReactChild;
|
|
23
|
+
route: string;
|
|
24
|
+
}
|
|
25
|
+
export interface ISecondaryNavigationItem {
|
|
26
|
+
mainItem: IMainNavigationItem;
|
|
27
|
+
subItems?: ISecondaryNavigationSubItem[];
|
|
28
|
+
startDate: string;
|
|
29
|
+
}
|
|
30
|
+
export interface ISecondaryNavigationElement {
|
|
31
|
+
items: ISecondaryNavigationItem[];
|
|
32
|
+
archivedItems?: ISecondaryNavigationItem[];
|
|
33
|
+
button?: {
|
|
34
|
+
url: string;
|
|
35
|
+
text: string;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export interface ISecondaryNavigationElements {
|
|
39
|
+
[key: string]: ISecondaryNavigationElement;
|
|
40
|
+
}
|
|
41
|
+
export interface IPrimaryConfig {
|
|
42
|
+
background?: string;
|
|
43
|
+
text?: string;
|
|
44
|
+
activeText?: string;
|
|
45
|
+
moveLastItemToBottom?: boolean;
|
|
46
|
+
activeBorderColor?: string;
|
|
47
|
+
}
|
|
48
|
+
export interface ISecondaryMainConfig {
|
|
49
|
+
mainBackground?: string;
|
|
50
|
+
mainText?: string;
|
|
51
|
+
mainHover?: string;
|
|
52
|
+
mainIcon?: string;
|
|
53
|
+
mainActiveText?: string;
|
|
54
|
+
}
|
|
55
|
+
export interface ISecondarySubConfig {
|
|
56
|
+
subItemBackground?: string;
|
|
57
|
+
subItemText?: string;
|
|
58
|
+
subItemHover?: string;
|
|
59
|
+
subItemActiveBackground?: string;
|
|
60
|
+
subItemActiveHover?: string;
|
|
61
|
+
subItemActiveText?: string;
|
|
62
|
+
}
|
|
63
|
+
export interface ISideNavConfig {
|
|
64
|
+
rootRouteName: string;
|
|
65
|
+
primary?: IPrimaryConfig;
|
|
66
|
+
secondary?: {
|
|
67
|
+
mainItemColors?: ISecondaryMainConfig;
|
|
68
|
+
subItemColors?: ISecondarySubConfig;
|
|
69
|
+
closeButtonSvg?: ReactNode;
|
|
70
|
+
titleColor?: string;
|
|
71
|
+
titleIconColor?: string;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
export interface ILeftNavigationProps {
|
|
75
|
+
primaryNavItems: INavigationLink[];
|
|
76
|
+
secondaryNavItems: ISecondaryNavigationElements;
|
|
77
|
+
config: ISideNavConfig;
|
|
78
|
+
}
|
|
79
|
+
export interface IListItemProps extends ISecondaryNavigationItem {
|
|
80
|
+
config: ISideNavConfig;
|
|
81
|
+
Icon: React.FC<ISvgComponentProps>;
|
|
82
|
+
}
|
|
83
|
+
export interface INavListItemStyleProps extends ISecondaryMainConfig, ISecondarySubConfig {
|
|
84
|
+
}
|
|
85
|
+
export interface IPrimaryLeftNavContainerProps {
|
|
86
|
+
expandedOptions: IExpandedOptions;
|
|
87
|
+
navigationLinks: INavigationLink[];
|
|
88
|
+
setExpandedOptions: React.Dispatch<React.SetStateAction<IExpandedOptions>>;
|
|
89
|
+
config: ISideNavConfig;
|
|
90
|
+
}
|
|
91
|
+
export interface ISecondaryLeftNavContainerProps {
|
|
92
|
+
secondaryNavItems: ISecondaryNavigationElements;
|
|
93
|
+
primaryNavItems: INavigationLink[];
|
|
94
|
+
expandedOptions: IExpandedOptions;
|
|
95
|
+
setExpandedOptions: React.Dispatch<React.SetStateAction<IExpandedOptions>>;
|
|
96
|
+
config: ISideNavConfig;
|
|
97
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface IMainLayoutProps {
|
|
4
|
+
id?: string;
|
|
5
|
+
sideNavigation?: ReactElement;
|
|
6
|
+
desktopWidth?: boolean | string;
|
|
7
|
+
children: ReactElement;
|
|
8
|
+
topOffset?: number | string;
|
|
9
|
+
}
|
|
10
|
+
export interface IMainLayoutStyleProps extends Pick<IMainLayoutProps, "topOffset"> {
|
|
11
|
+
}
|