@oc-digital/react-component-library 2.0.6 → 2.0.7-beta.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.
- package/README.md +14 -4
- package/build/Alert/Alert.d.ts +4 -4
- package/build/AlphabeticalList/AlphabeticalList.d.ts +4 -4
- package/build/AlphabeticalList/AlphabeticalList.types.d.ts +16 -16
- package/build/Breadcrumbs/Breadcrumbs.d.ts +4 -4
- package/build/Breadcrumbs/Breadcrumbs.types.d.ts +23 -23
- package/build/Button/Button.d.ts +4 -4
- package/build/Button/Button.types.d.ts +14 -14
- package/build/ButtonWithConfirm/ButtonWithConfirm.d.ts +4 -4
- package/build/ButtonWithConfirm/ButtonWithConfirm.types.d.ts +12 -12
- package/build/ContentBox/ContentBox.d.ts +4 -4
- package/build/ContentBox/ContentBox.types.d.ts +6 -6
- package/build/ContentLabel/ContentLabel.d.ts +4 -4
- package/build/ContentLabel/ContentLabel.types.d.ts +5 -5
- package/build/DatePicker/DatePicker.d.ts +4 -4
- package/build/DatePicker/DatePicker.types.d.ts +5 -5
- package/build/EditableTable/EditableTable.d.ts +4 -4
- package/build/EditableTable/EditableTable.types.d.ts +105 -105
- package/build/EditableTable/defaultCells.d.ts +33 -33
- package/build/EntityList/EntityList.d.ts +4 -4
- package/build/EntityList/EntityList.types.d.ts +14 -14
- package/build/ErrorIndicator/ErrorIndicator.d.ts +4 -4
- package/build/ErrorIndicator/ErrorIndicator.types.d.ts +4 -4
- package/build/ImageDisplayAndUpload/ImageDisplayAndUpload.d.ts +4 -4
- package/build/ImageDisplayAndUpload/ImageDisplayAndUpload.types.d.ts +8 -8
- package/build/KeyboardDatePicker/KeyboardDatePicker.d.ts +4 -4
- package/build/KeyboardDatePicker/KeyboardDatePicker.types.d.ts +5 -5
- package/build/LeftNavigation/LeftNavigation.d.ts +4 -4
- package/build/LeftNavigation/LeftNavigation.types.d.ts +96 -96
- package/build/LeftNavigation/NavListItem.d.ts +4 -4
- package/build/LeftNavigation/PrimaryLeftNavigation.d.ts +4 -4
- package/build/LeftNavigation/SecondaryLeftNavigation.d.ts +4 -4
- package/build/LoadingSpinner/LoadingSpinner.d.ts +4 -4
- package/build/LoadingSpinner/LoadingSpinner.types.d.ts +5 -5
- package/build/MainLayout/MainLayout.d.ts +4 -4
- package/build/MainLayout/MainLayout.types.d.ts +9 -9
- package/build/SearchBar/SearchBar.d.ts +4 -4
- package/build/SearchBar/SearchBar.types.d.ts +23 -23
- package/build/Select/Select.d.ts +4 -4
- package/build/Select/Select.types.d.ts +14 -14
- package/build/StaticTable/StaticTable.d.ts +4 -4
- package/build/StaticTable/StaticTable.types.d.ts +21 -21
- package/build/SvgComponents/ContainedPartnersLogo.d.ts +4 -4
- package/build/SvgComponents/HomeSvg.d.ts +4 -4
- package/build/SvgComponents/NovelLogoSvg.d.ts +4 -4
- package/build/SvgComponents/OrganisationList.d.ts +4 -4
- package/build/SvgComponents/ProjectsSvg.d.ts +4 -4
- package/build/SvgComponents/index.d.ts +5 -5
- package/build/SvgComponents/types.d.ts +6 -6
- package/build/TextField/TextField.d.ts +16 -15
- package/build/TextField/TextField.types.d.ts +7 -7
- package/build/globals/index.d.ts +24 -24
- package/build/hooks/index.d.ts +3 -3
- package/build/hooks/useDebounceEffect.d.ts +2 -2
- package/build/hooks/useInterval.d.ts +2 -2
- package/build/hooks/useWhyDidYouUpdate.d.ts +1 -1
- package/build/index.d.ts +29 -29
- package/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/build/styles/font.d.ts +1 -1
- package/build/styles/index.d.ts +3 -3
- package/build/styles/layout.d.ts +1 -1
- package/build/styles/spacing.d.ts +1 -1
- package/build/utils/index.d.ts +5 -5
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -47,6 +47,20 @@ const ReactComponent = () => (
|
|
|
47
47
|
|
|
48
48
|
## Local Usage
|
|
49
49
|
|
|
50
|
+
1. increment the package version and add -beta.0 (e.g. 2.0.6 => 2.0.7-beta.0) and run npm install
|
|
51
|
+
1a. if you need to further increment and publish use -beta.1, -beta.2 and so on
|
|
52
|
+
1b. you can use this all in one command for the above - npm version 2.0.7-beta.0
|
|
53
|
+
2. publish the component library with command - npm publish --tag beta
|
|
54
|
+
3. pin the version in the receiving library to "=2.0.7-beta.0" and run npm install
|
|
55
|
+
4. once happy with the changes remove -beta.0 part and part and publish component library
|
|
56
|
+
4a. update the version in the receiving library to "^2.0.7"
|
|
57
|
+
|
|
58
|
+
## Building and publishing
|
|
59
|
+
|
|
60
|
+
To publish new version login using `npm login`, increment version in `package.json` and run `npm publish`. Subsequently it will build the library to `build` folder and push it's contents to the npm.
|
|
61
|
+
|
|
62
|
+
## Local Usage(OLD DEPRECATED)
|
|
63
|
+
|
|
50
64
|
You can use this library locally, however few steps are required:
|
|
51
65
|
|
|
52
66
|
In the root of component library:
|
|
@@ -78,7 +92,3 @@ Use storybook to explore components
|
|
|
78
92
|
```bash
|
|
79
93
|
npm run storybook
|
|
80
94
|
```
|
|
81
|
-
|
|
82
|
-
## Building and publishing
|
|
83
|
-
|
|
84
|
-
To publish new version login using `npm login`, increment version in `package.json` and run `npm publish`. Subsequently it will build the library to `build` folder and push it's contents to the npm.
|
package/build/Alert/Alert.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { IAlertProps } from "./Alert.types";
|
|
3
|
-
declare const Alert: React.FC<IAlertProps>;
|
|
4
|
-
export default Alert;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IAlertProps } from "./Alert.types";
|
|
3
|
+
declare const Alert: React.FC<IAlertProps>;
|
|
4
|
+
export default Alert;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { IAlphabeticalListProps } from "./AlphabeticalList.types";
|
|
3
|
-
declare const AlphabeticalList: React.FC<IAlphabeticalListProps>;
|
|
4
|
-
export default AlphabeticalList;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IAlphabeticalListProps } from "./AlphabeticalList.types";
|
|
3
|
+
declare const AlphabeticalList: React.FC<IAlphabeticalListProps>;
|
|
4
|
+
export default AlphabeticalList;
|
|
@@ -1,16 +1,16 @@
|
|
|
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;
|
|
15
|
-
alphabetisedHeader?: boolean;
|
|
16
|
-
}
|
|
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;
|
|
15
|
+
alphabetisedHeader?: boolean;
|
|
16
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { IBreadcrumbsProps } from "./Breadcrumbs.types";
|
|
3
|
-
declare const Breadcrumbs: React.FC<IBreadcrumbsProps>;
|
|
4
|
-
export default Breadcrumbs;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IBreadcrumbsProps } from "./Breadcrumbs.types";
|
|
3
|
+
declare const Breadcrumbs: React.FC<IBreadcrumbsProps>;
|
|
4
|
+
export default Breadcrumbs;
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
|
-
type BreadcrumbSlot = {
|
|
3
|
-
name: string;
|
|
4
|
-
link: string;
|
|
5
|
-
};
|
|
6
|
-
type BreadCrumbKeys = "first" | "second" | "third";
|
|
7
|
-
type IBreadcrumbs = {
|
|
8
|
-
[K in BreadCrumbKeys]?: BreadcrumbSlot;
|
|
9
|
-
};
|
|
10
|
-
type colorOptions = {
|
|
11
|
-
background?: string;
|
|
12
|
-
color?: string;
|
|
13
|
-
};
|
|
14
|
-
type ColorKeys = "primary" | "secondary" | "tertiary";
|
|
15
|
-
export type IBreadcrumbColors = {
|
|
16
|
-
[K in ColorKeys]?: colorOptions;
|
|
17
|
-
};
|
|
18
|
-
export interface IBreadcrumbsProps {
|
|
19
|
-
logo: ReactNode;
|
|
20
|
-
content: IBreadcrumbs;
|
|
21
|
-
colors?: IBreadcrumbColors;
|
|
22
|
-
}
|
|
23
|
-
export {};
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
declare type BreadcrumbSlot = {
|
|
3
|
+
name: string;
|
|
4
|
+
link: string;
|
|
5
|
+
};
|
|
6
|
+
declare type BreadCrumbKeys = "first" | "second" | "third";
|
|
7
|
+
declare type IBreadcrumbs = {
|
|
8
|
+
[K in BreadCrumbKeys]?: BreadcrumbSlot;
|
|
9
|
+
};
|
|
10
|
+
declare type colorOptions = {
|
|
11
|
+
background?: string;
|
|
12
|
+
color?: string;
|
|
13
|
+
};
|
|
14
|
+
declare type ColorKeys = "primary" | "secondary" | "tertiary";
|
|
15
|
+
export declare type IBreadcrumbColors = {
|
|
16
|
+
[K in ColorKeys]?: colorOptions;
|
|
17
|
+
};
|
|
18
|
+
export interface IBreadcrumbsProps {
|
|
19
|
+
logo: ReactNode;
|
|
20
|
+
content: IBreadcrumbs;
|
|
21
|
+
colors?: IBreadcrumbColors;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
package/build/Button/Button.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { IButtonProps } from "./Button.types";
|
|
3
|
-
declare const Button: React.FC<IButtonProps>;
|
|
4
|
-
export default Button;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IButtonProps } from "./Button.types";
|
|
3
|
+
declare const Button: React.FC<IButtonProps>;
|
|
4
|
+
export default Button;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { IAuthoriserProp } from "../globals";
|
|
3
|
-
export interface IButtonProps extends IAuthoriserProp {
|
|
4
|
-
[key: string]: any;
|
|
5
|
-
loading?: boolean;
|
|
6
|
-
children: React.ReactNode;
|
|
7
|
-
errors?: boolean;
|
|
8
|
-
type?: "submit" | "button";
|
|
9
|
-
onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
10
|
-
disabled?: boolean;
|
|
11
|
-
variant?: "outlined" | "contained" | "text";
|
|
12
|
-
styling?: string;
|
|
13
|
-
color?: "default" | "primary" | "secondary" | "inherit";
|
|
14
|
-
}
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IAuthoriserProp } from "../globals";
|
|
3
|
+
export interface IButtonProps extends IAuthoriserProp {
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
loading?: boolean;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
errors?: boolean;
|
|
8
|
+
type?: "submit" | "button";
|
|
9
|
+
onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
variant?: "outlined" | "contained" | "text";
|
|
12
|
+
styling?: string;
|
|
13
|
+
color?: "default" | "primary" | "secondary" | "inherit";
|
|
14
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { IButtonWithConfirmProps } from "./ButtonWithConfirm.types";
|
|
3
|
-
declare const ButtonWithConfirm: React.FC<IButtonWithConfirmProps>;
|
|
4
|
-
export default ButtonWithConfirm;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IButtonWithConfirmProps } from "./ButtonWithConfirm.types";
|
|
3
|
+
declare const ButtonWithConfirm: React.FC<IButtonWithConfirmProps>;
|
|
4
|
+
export default ButtonWithConfirm;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { IAuthoriserProp } from "../globals";
|
|
3
|
-
export interface IButtonWithConfirmProps extends IAuthoriserProp {
|
|
4
|
-
children: React.ReactNode;
|
|
5
|
-
onClick: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
6
|
-
loading: boolean;
|
|
7
|
-
type?: "submit" | "button";
|
|
8
|
-
styling?: string;
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
variant?: "outlined" | "contained" | "text";
|
|
11
|
-
color?: "secondary" | "default" | "primary" | "inherit";
|
|
12
|
-
}
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IAuthoriserProp } from "../globals";
|
|
3
|
+
export interface IButtonWithConfirmProps extends IAuthoriserProp {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
onClick: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
6
|
+
loading: boolean;
|
|
7
|
+
type?: "submit" | "button";
|
|
8
|
+
styling?: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
variant?: "outlined" | "contained" | "text";
|
|
11
|
+
color?: "secondary" | "default" | "primary" | "inherit";
|
|
12
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { IContentBoxProps } from "./ContentBox.types";
|
|
3
|
-
declare const ContentBox: React.FC<IContentBoxProps>;
|
|
4
|
-
export default ContentBox;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IContentBoxProps } from "./ContentBox.types";
|
|
3
|
+
declare const ContentBox: React.FC<IContentBoxProps>;
|
|
4
|
+
export default ContentBox;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export interface IContentBoxProps {
|
|
3
|
-
children: React.ReactNode;
|
|
4
|
-
limitWidth?: boolean;
|
|
5
|
-
styling?: string;
|
|
6
|
-
}
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface IContentBoxProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
limitWidth?: boolean;
|
|
5
|
+
styling?: string;
|
|
6
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { IContentLabelProps } from "./ContentLabel.types";
|
|
3
|
-
declare const ContentLabel: React.FC<IContentLabelProps>;
|
|
4
|
-
export default ContentLabel;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IContentLabelProps } from "./ContentLabel.types";
|
|
3
|
+
declare const ContentLabel: React.FC<IContentLabelProps>;
|
|
4
|
+
export default ContentLabel;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export interface IContentLabelProps {
|
|
3
|
-
children: React.ReactNode;
|
|
4
|
-
styling?: null | string;
|
|
5
|
-
}
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface IContentLabelProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
styling?: null | string;
|
|
5
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { IDatePickerProps } from "./DatePicker.types";
|
|
3
|
-
declare const DatePicker: React.FC<IDatePickerProps>;
|
|
4
|
-
export default DatePicker;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IDatePickerProps } from "./DatePicker.types";
|
|
3
|
+
declare const DatePicker: React.FC<IDatePickerProps>;
|
|
4
|
+
export default DatePicker;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DatePickerProps } from "@material-ui/pickers";
|
|
2
|
-
import { IAuthoriserProp } from "../globals";
|
|
3
|
-
export interface IDatePickerProps extends IAuthoriserProp, DatePickerProps {
|
|
4
|
-
styling?: string;
|
|
5
|
-
}
|
|
1
|
+
import { DatePickerProps } from "@material-ui/pickers";
|
|
2
|
+
import { IAuthoriserProp } from "../globals";
|
|
3
|
+
export interface IDatePickerProps extends IAuthoriserProp, DatePickerProps {
|
|
4
|
+
styling?: string;
|
|
5
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { IEditableTableProps } from "./EditableTable.types";
|
|
3
|
-
declare const EditableTable: React.FC<IEditableTableProps>;
|
|
4
|
-
export default EditableTable;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IEditableTableProps } from "./EditableTable.types";
|
|
3
|
+
declare const EditableTable: React.FC<IEditableTableProps>;
|
|
4
|
+
export default EditableTable;
|
|
@@ -1,105 +1,105 @@
|
|
|
1
|
-
import { CellProps, HeaderGroup, Row, TableBodyPropGetter, TableBodyProps, TablePropGetter, TableProps } from "react-table";
|
|
2
|
-
import { SchemaOf } from "yup";
|
|
3
|
-
import React from "react";
|
|
4
|
-
import { VirtualItem } from "react-virtual/types";
|
|
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
|
-
};
|
|
36
|
-
};
|
|
37
|
-
export interface IEditableTableProps {
|
|
38
|
-
tableRows: RowData[] | null;
|
|
39
|
-
tableHeaders: ITableHeader[];
|
|
40
|
-
syncCellWithState: SynchCellWithStateFn;
|
|
41
|
-
setRows?: React.Dispatch<React.SetStateAction<RowData[] | null>> | undefined;
|
|
42
|
-
skipPageReset?: boolean;
|
|
43
|
-
fieldConfig: FieldConfig;
|
|
44
|
-
disabled?: boolean;
|
|
45
|
-
setSelectedRows?: React.Dispatch<React.SetStateAction<number[]>>;
|
|
46
|
-
includeRowSelect?: boolean;
|
|
47
|
-
filterTypes?: {
|
|
48
|
-
[key: string]: (rows: any, id: any, filterValue: any) => any;
|
|
49
|
-
};
|
|
50
|
-
filterData?: {
|
|
51
|
-
filterRow: string;
|
|
52
|
-
filterValues: RowData[];
|
|
53
|
-
};
|
|
54
|
-
emptyTableText?: string;
|
|
55
|
-
paginate?: boolean;
|
|
56
|
-
defaultPageSize?: number;
|
|
57
|
-
virtContainerStyling?: string;
|
|
58
|
-
overscan?: number;
|
|
59
|
-
rowHeight?: number;
|
|
60
|
-
includeGlobalSearch?: boolean;
|
|
61
|
-
}
|
|
62
|
-
type AdditionalCellProps = Pick<IEditableTableProps, "fieldConfig" | "syncCellWithState" | "setRows">;
|
|
63
|
-
export interface ExtendedCellProps extends AdditionalCellProps, CellProps<RowData> {
|
|
64
|
-
disabled: boolean;
|
|
65
|
-
}
|
|
66
|
-
export interface IEssentialRenderFnProps {
|
|
67
|
-
error: string | false;
|
|
68
|
-
disabled: boolean;
|
|
69
|
-
value: TableCellValues;
|
|
70
|
-
onChange: (e: any) => void;
|
|
71
|
-
onBlur: any;
|
|
72
|
-
prefix?: React.ReactNode | React.JSXElementConstructor<any>;
|
|
73
|
-
suffix?: React.ReactNode | React.JSXElementConstructor<any>;
|
|
74
|
-
numberField?: boolean;
|
|
75
|
-
textAlign?: IAlignment;
|
|
76
|
-
fixedDecimalScale?: boolean;
|
|
77
|
-
}
|
|
78
|
-
export interface ICustomRenderFnProps extends IEssentialRenderFnProps {
|
|
79
|
-
values: {
|
|
80
|
-
[key: string]: any;
|
|
81
|
-
};
|
|
82
|
-
originalValues: {
|
|
83
|
-
[key: string]: any;
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
export interface ITableContentProps extends Pick<IEditableTableProps, "disabled" | "includeRowSelect"> {
|
|
87
|
-
getTableProps: (propGetter?: TablePropGetter<RowData> | undefined) => TableProps;
|
|
88
|
-
headerGroups: HeaderGroup<RowData>[];
|
|
89
|
-
getTableBodyProps: (propGetter?: TableBodyPropGetter<RowData> | undefined) => TableBodyProps;
|
|
90
|
-
prepareRow: (row: Row<RowData>) => void;
|
|
91
|
-
rowsToRender: Row<RowData>[];
|
|
92
|
-
disabled: boolean;
|
|
93
|
-
includeRowSelect: boolean;
|
|
94
|
-
paddingTop: number;
|
|
95
|
-
paddingBottom: number;
|
|
96
|
-
virtualRows: VirtualItem[];
|
|
97
|
-
isAllRowsSelected: boolean;
|
|
98
|
-
selectedFlatRows: Row<RowData>[];
|
|
99
|
-
}
|
|
100
|
-
export interface IGlobalFilterProps {
|
|
101
|
-
preGlobalFilteredRows: RowData[];
|
|
102
|
-
globalFilter: string | undefined;
|
|
103
|
-
setGlobalFilter: (val: string | undefined) => void;
|
|
104
|
-
}
|
|
105
|
-
export {};
|
|
1
|
+
import { CellProps, HeaderGroup, Row, TableBodyPropGetter, TableBodyProps, TablePropGetter, TableProps } from "react-table";
|
|
2
|
+
import { SchemaOf } from "yup";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { VirtualItem } from "react-virtual/types";
|
|
5
|
+
export declare type IAlignment = "left" | "right" | "inherit" | "center" | "justify";
|
|
6
|
+
export declare type RowData = {
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
};
|
|
9
|
+
export declare type ITableHeader = {
|
|
10
|
+
Header: string | JSX.Element;
|
|
11
|
+
accessor: string;
|
|
12
|
+
textAlign?: IAlignment;
|
|
13
|
+
};
|
|
14
|
+
export declare type TableCellValues = null | undefined | string | number | Date | boolean | string[];
|
|
15
|
+
export declare type SynchCellWithStateFn = (rowIndex: number, columnId: string, value: TableCellValues, errorStatus: boolean, forceUpdate?: boolean) => void;
|
|
16
|
+
export declare 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
|
+
};
|
|
36
|
+
};
|
|
37
|
+
export interface IEditableTableProps {
|
|
38
|
+
tableRows: RowData[] | null;
|
|
39
|
+
tableHeaders: ITableHeader[];
|
|
40
|
+
syncCellWithState: SynchCellWithStateFn;
|
|
41
|
+
setRows?: React.Dispatch<React.SetStateAction<RowData[] | null>> | undefined;
|
|
42
|
+
skipPageReset?: boolean;
|
|
43
|
+
fieldConfig: FieldConfig;
|
|
44
|
+
disabled?: boolean;
|
|
45
|
+
setSelectedRows?: React.Dispatch<React.SetStateAction<number[]>>;
|
|
46
|
+
includeRowSelect?: boolean;
|
|
47
|
+
filterTypes?: {
|
|
48
|
+
[key: string]: (rows: any, id: any, filterValue: any) => any;
|
|
49
|
+
};
|
|
50
|
+
filterData?: {
|
|
51
|
+
filterRow: string;
|
|
52
|
+
filterValues: RowData[];
|
|
53
|
+
};
|
|
54
|
+
emptyTableText?: string;
|
|
55
|
+
paginate?: boolean;
|
|
56
|
+
defaultPageSize?: number;
|
|
57
|
+
virtContainerStyling?: string;
|
|
58
|
+
overscan?: number;
|
|
59
|
+
rowHeight?: number;
|
|
60
|
+
includeGlobalSearch?: boolean;
|
|
61
|
+
}
|
|
62
|
+
declare type AdditionalCellProps = Pick<IEditableTableProps, "fieldConfig" | "syncCellWithState" | "setRows">;
|
|
63
|
+
export interface ExtendedCellProps extends AdditionalCellProps, CellProps<RowData> {
|
|
64
|
+
disabled: boolean;
|
|
65
|
+
}
|
|
66
|
+
export interface IEssentialRenderFnProps {
|
|
67
|
+
error: string | false;
|
|
68
|
+
disabled: boolean;
|
|
69
|
+
value: TableCellValues;
|
|
70
|
+
onChange: (e: any) => void;
|
|
71
|
+
onBlur: any;
|
|
72
|
+
prefix?: React.ReactNode | React.JSXElementConstructor<any>;
|
|
73
|
+
suffix?: React.ReactNode | React.JSXElementConstructor<any>;
|
|
74
|
+
numberField?: boolean;
|
|
75
|
+
textAlign?: IAlignment;
|
|
76
|
+
fixedDecimalScale?: boolean;
|
|
77
|
+
}
|
|
78
|
+
export interface ICustomRenderFnProps extends IEssentialRenderFnProps {
|
|
79
|
+
values: {
|
|
80
|
+
[key: string]: any;
|
|
81
|
+
};
|
|
82
|
+
originalValues: {
|
|
83
|
+
[key: string]: any;
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
export interface ITableContentProps extends Pick<IEditableTableProps, "disabled" | "includeRowSelect"> {
|
|
87
|
+
getTableProps: (propGetter?: TablePropGetter<RowData> | undefined) => TableProps;
|
|
88
|
+
headerGroups: HeaderGroup<RowData>[];
|
|
89
|
+
getTableBodyProps: (propGetter?: TableBodyPropGetter<RowData> | undefined) => TableBodyProps;
|
|
90
|
+
prepareRow: (row: Row<RowData>) => void;
|
|
91
|
+
rowsToRender: Row<RowData>[];
|
|
92
|
+
disabled: boolean;
|
|
93
|
+
includeRowSelect: boolean;
|
|
94
|
+
paddingTop: number;
|
|
95
|
+
paddingBottom: number;
|
|
96
|
+
virtualRows: VirtualItem[];
|
|
97
|
+
isAllRowsSelected: boolean;
|
|
98
|
+
selectedFlatRows: Row<RowData>[];
|
|
99
|
+
}
|
|
100
|
+
export interface IGlobalFilterProps {
|
|
101
|
+
preGlobalFilteredRows: RowData[];
|
|
102
|
+
globalFilter: string | undefined;
|
|
103
|
+
setGlobalFilter: (val: string | undefined) => void;
|
|
104
|
+
}
|
|
105
|
+
export {};
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import React, { ReactChild, ReactNode } from "react";
|
|
2
|
-
import { ICustomRenderFnProps, IEssentialRenderFnProps } from "./EditableTable.types";
|
|
3
|
-
export declare const TableTextField: React.FC<IEssentialRenderFnProps>;
|
|
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 SelectionCheckbox: React.ComponentType<Pick<import("@material-ui/core").CheckboxProps, "
|
|
8
|
-
interface ITableDatePicker extends IEssentialRenderFnProps {
|
|
9
|
-
fullDate?: boolean;
|
|
10
|
-
}
|
|
11
|
-
export declare const TableDatePicker: React.FC<ITableDatePicker>;
|
|
12
|
-
export declare const tableDateField: (tableProps: ICustomRenderFnProps) => JSX.Element;
|
|
13
|
-
export declare const tableInvoiceDateField: (tableProps: ICustomRenderFnProps) => JSX.Element;
|
|
14
|
-
export declare const tableCheckbox: (tableProps: ICustomRenderFnProps) => JSX.Element;
|
|
15
|
-
interface INonEditableField extends Pick<IEssentialRenderFnProps, "numberField" | "prefix" | "suffix" | "textAlign" | "fixedDecimalScale"> {
|
|
16
|
-
text: React.ReactText;
|
|
17
|
-
}
|
|
18
|
-
export declare const NonEditableField: React.FC<INonEditableField>;
|
|
19
|
-
interface ITableSelect extends IEssentialRenderFnProps {
|
|
20
|
-
selectOptions: {
|
|
21
|
-
[key: string]: ReactChild;
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
export declare const TableSelect: React.FC<ITableSelect>;
|
|
25
|
-
interface IMultipleTableSelect extends Omit<IEssentialRenderFnProps, "value"> {
|
|
26
|
-
selectOptions: {
|
|
27
|
-
[key: string]: ReactChild;
|
|
28
|
-
};
|
|
29
|
-
value: string[];
|
|
30
|
-
renderValue?: (value: any) => ReactNode;
|
|
31
|
-
}
|
|
32
|
-
export declare const TableMultipleSelect: React.FC<IMultipleTableSelect>;
|
|
33
|
-
export {};
|
|
1
|
+
import React, { ReactChild, ReactNode } from "react";
|
|
2
|
+
import { ICustomRenderFnProps, IEssentialRenderFnProps } from "./EditableTable.types";
|
|
3
|
+
export declare const TableTextField: React.FC<IEssentialRenderFnProps>;
|
|
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 SelectionCheckbox: React.ComponentType<Pick<import("@material-ui/core").CheckboxProps, "color" | "translate" | "hidden" | "size" | "style" | "icon" | "disabled" | "value" | "onBlur" | "onChange" | "prefix" | "checked" | "indeterminate" | "checkedIcon" | "className" | "innerRef" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "tabIndex" | "title" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "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" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlurCapture" | "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" | "ref" | "form" | "key" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "disableFocusRipple" | "edge" | "action" | "buttonRef" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "onFocusVisible" | "TouchRippleProps" | "inputProps" | "inputRef" | "readOnly" | "required" | "indeterminateIcon"> & import("@material-ui/core").StyledComponentProps<"root">>;
|
|
8
|
+
interface ITableDatePicker extends IEssentialRenderFnProps {
|
|
9
|
+
fullDate?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const TableDatePicker: React.FC<ITableDatePicker>;
|
|
12
|
+
export declare const tableDateField: (tableProps: ICustomRenderFnProps) => JSX.Element;
|
|
13
|
+
export declare const tableInvoiceDateField: (tableProps: ICustomRenderFnProps) => JSX.Element;
|
|
14
|
+
export declare const tableCheckbox: (tableProps: ICustomRenderFnProps) => JSX.Element;
|
|
15
|
+
interface INonEditableField extends Pick<IEssentialRenderFnProps, "numberField" | "prefix" | "suffix" | "textAlign" | "fixedDecimalScale"> {
|
|
16
|
+
text: React.ReactText;
|
|
17
|
+
}
|
|
18
|
+
export declare const NonEditableField: React.FC<INonEditableField>;
|
|
19
|
+
interface ITableSelect extends IEssentialRenderFnProps {
|
|
20
|
+
selectOptions: {
|
|
21
|
+
[key: string]: ReactChild;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export declare const TableSelect: React.FC<ITableSelect>;
|
|
25
|
+
interface IMultipleTableSelect extends Omit<IEssentialRenderFnProps, "value"> {
|
|
26
|
+
selectOptions: {
|
|
27
|
+
[key: string]: ReactChild;
|
|
28
|
+
};
|
|
29
|
+
value: string[];
|
|
30
|
+
renderValue?: (value: any) => ReactNode;
|
|
31
|
+
}
|
|
32
|
+
export declare const TableMultipleSelect: React.FC<IMultipleTableSelect>;
|
|
33
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { IEntityListProps } from "./EntityList.types";
|
|
3
|
-
declare const EntityList: React.FC<IEntityListProps>;
|
|
4
|
-
export default EntityList;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IEntityListProps } from "./EntityList.types";
|
|
3
|
+
declare const EntityList: React.FC<IEntityListProps>;
|
|
4
|
+
export default EntityList;
|