@oc-digital/react-component-library 8.17.4 → 8.17.5
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/Button/Button.types.d.ts +1 -1
- package/build/DatePicker/DatePicker.types.d.ts +2 -2
- package/build/EditableTable/EditableTable.types.d.ts +67 -54
- package/build/KeyboardDatePicker/KeyboardDatePicker.types.d.ts +2 -2
- package/build/MobileDatePicker/MobileDatePicker.types.d.ts +2 -2
- package/build/index.d.ts +4 -3
- package/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/build/styles/font.d.ts +1 -1
- package/build/styles/layout.d.ts +1 -1
- package/build/styles/spacing.d.ts +1 -1
- package/build/styles/themes.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { IAuthoriserProp } from "../globals";
|
|
3
|
-
import type { ButtonProps } from "@mui/material
|
|
3
|
+
import type { ButtonProps } from "@mui/material";
|
|
4
4
|
export type IButtonProps<C extends React.ElementType = React.ElementType> = ButtonProps<C, {
|
|
5
5
|
component?: C;
|
|
6
6
|
}> & IAuthoriserProp & {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DatePickerProps } from "@mui/x-date-pickers
|
|
2
|
-
import { IAuthoriserProp } from "../globals";
|
|
1
|
+
import type { DatePickerProps } from "@mui/x-date-pickers";
|
|
2
|
+
import type { IAuthoriserProp } from "../globals";
|
|
3
3
|
export type IDatePickerProps = DatePickerProps<Date> & IAuthoriserProp & {
|
|
4
4
|
styling?: string;
|
|
5
5
|
};
|
|
@@ -5,51 +5,56 @@ export type IAlignment = "left" | "right" | "inherit" | "center" | "justify";
|
|
|
5
5
|
export type RowData = {
|
|
6
6
|
[key: string]: any;
|
|
7
7
|
};
|
|
8
|
-
|
|
8
|
+
/** @deprecated old legacy type - doesn't support recursive nested columns */
|
|
9
|
+
type IBaseTableHeader = {
|
|
9
10
|
Header: string | JSX.Element;
|
|
10
|
-
|
|
11
|
+
stickyColumn?: boolean;
|
|
11
12
|
textAlign?: IAlignment;
|
|
12
|
-
|
|
13
|
+
};
|
|
14
|
+
/** @deprecated old legacy type - doesn't support recursive nested columns */
|
|
15
|
+
export type ITableHeader = IBaseTableHeader & {
|
|
16
|
+
accessor: string;
|
|
13
17
|
shadedHeader?: boolean;
|
|
14
18
|
linkedStatusColumn?: string;
|
|
15
19
|
};
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
/** @deprecated old legacy type - doesn't support recursive nested columns */
|
|
21
|
+
export type ITableHeaderComplexAccessor = IBaseTableHeader & {
|
|
18
22
|
id: string;
|
|
19
23
|
accessor: (originalRow: any, rowIndex: any) => any;
|
|
20
|
-
textAlign?: IAlignment;
|
|
21
|
-
stickyCell?: boolean;
|
|
22
24
|
shadedHeader?: boolean;
|
|
23
25
|
};
|
|
24
|
-
|
|
26
|
+
type SharedHeaderStructure = {
|
|
25
27
|
Header: string | JSX.Element;
|
|
26
28
|
textAlign?: IAlignment;
|
|
27
|
-
stickyCell?: boolean;
|
|
28
29
|
shadedHeaderGroup?: boolean;
|
|
29
|
-
accessor?: any;
|
|
30
|
-
columns: {
|
|
31
|
-
Header: string | JSX.Element;
|
|
32
|
-
shadedHeaderGroup?: boolean;
|
|
33
|
-
accessor: string;
|
|
34
|
-
textAlign?: IAlignment;
|
|
35
|
-
linkedStatusColumn?: string;
|
|
36
|
-
}[];
|
|
37
30
|
};
|
|
38
|
-
|
|
39
|
-
Header: string | JSX.Element;
|
|
40
|
-
textAlign?: IAlignment;
|
|
41
|
-
stickyCell?: boolean;
|
|
42
|
-
shadedHeaderGroup?: boolean;
|
|
31
|
+
type TopLevelOnlyFields = {
|
|
43
32
|
accessor?: any;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
id: string;
|
|
47
|
-
shadedHeaderGroup?: boolean;
|
|
48
|
-
accessor: (originalRow: any, rowIndex: any) => any;
|
|
49
|
-
textAlign?: IAlignment;
|
|
50
|
-
linkedStatusColumn?: string;
|
|
51
|
-
}[];
|
|
33
|
+
stickyColumn?: boolean;
|
|
34
|
+
shadedHeader?: boolean;
|
|
52
35
|
};
|
|
36
|
+
type LowerLevelOnlyFields = {
|
|
37
|
+
linkedStatusColumn?: string;
|
|
38
|
+
} & ({
|
|
39
|
+
id: string;
|
|
40
|
+
accessor: (originalRow: any, rowIndex: any) => any;
|
|
41
|
+
} | {
|
|
42
|
+
accessor?: string;
|
|
43
|
+
});
|
|
44
|
+
type TableHeaderWithSubColumns = LowerLevelOnlyFields & {
|
|
45
|
+
id?: string;
|
|
46
|
+
accessor?: never;
|
|
47
|
+
columns: (RecursiveTableHeader & LowerLevelOnlyFields)[];
|
|
48
|
+
};
|
|
49
|
+
type TableHeaderWithAccessor = LowerLevelOnlyFields & {
|
|
50
|
+
accessor: LowerLevelOnlyFields["accessor"];
|
|
51
|
+
columns?: never;
|
|
52
|
+
};
|
|
53
|
+
type RecursiveTableHeader = SharedHeaderStructure & (TableHeaderWithSubColumns | TableHeaderWithAccessor);
|
|
54
|
+
export type IColumnsTableHeader = RecursiveTableHeader & TopLevelOnlyFields;
|
|
55
|
+
/** @deprecated old legacy type - doesn't support recursive nested columns */
|
|
56
|
+
export type IColumnsTableHeaderComplexAccessor = IColumnsTableHeader;
|
|
57
|
+
/** @deprecated old legacy type - use IColumnsTableHeader directly */
|
|
53
58
|
export type ITableHeaders = ITableHeader | ITableHeaderComplexAccessor | IColumnsTableHeader | IColumnsTableHeaderComplexAccessor;
|
|
54
59
|
export type TableCellValues = null | undefined | string | number | Date | boolean | string[];
|
|
55
60
|
export type SynchCellWithStateFn = (rowIndex: number, columnId: string, value: TableCellValues, errorStatus: boolean, forceUpdate?: boolean, original?: RowData) => void;
|
|
@@ -57,31 +62,35 @@ export type SortMeta = {
|
|
|
57
62
|
sortingColumnId: string;
|
|
58
63
|
asc: boolean;
|
|
59
64
|
};
|
|
65
|
+
type EditableTableFieldConfiguration = {
|
|
66
|
+
validationRule?: SchemaOf<any>;
|
|
67
|
+
dependentValidationRule?: (values: {
|
|
68
|
+
[key: string]: any;
|
|
69
|
+
}) => SchemaOf<any>;
|
|
70
|
+
customRenderFn?: (args: ICustomRenderFnProps) => JSX.Element;
|
|
71
|
+
prefix?: React.ReactNode | React.JSXElementConstructor<any>;
|
|
72
|
+
suffix?: React.ReactNode | React.JSXElementConstructor<any>;
|
|
73
|
+
textAlign?: IAlignment;
|
|
74
|
+
onBlur?: (args: {
|
|
75
|
+
rowIndex: number;
|
|
76
|
+
value: string;
|
|
77
|
+
setRows: React.Dispatch<React.SetStateAction<RowData[] | null>>;
|
|
78
|
+
values: RowData;
|
|
79
|
+
}) => Promise<void>;
|
|
80
|
+
isCheckbox?: boolean;
|
|
81
|
+
isDateField?: boolean;
|
|
82
|
+
onChangeValueModifier?: (value: string) => TableCellValues;
|
|
83
|
+
getCalculatedValue?: (values: RowData) => TableCellValues;
|
|
84
|
+
isReadOnly?: boolean;
|
|
85
|
+
total?: boolean;
|
|
86
|
+
canUserSort?: boolean;
|
|
87
|
+
sortCompareFn?: (a: any, b: any) => number;
|
|
88
|
+
};
|
|
60
89
|
export type FieldConfig = {
|
|
61
|
-
[key: string]:
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}) => SchemaOf<any>;
|
|
66
|
-
customRenderFn?: (args: ICustomRenderFnProps) => JSX.Element;
|
|
67
|
-
prefix?: React.ReactNode | React.JSXElementConstructor<any>;
|
|
68
|
-
suffix?: React.ReactNode | React.JSXElementConstructor<any>;
|
|
69
|
-
textAlign?: IAlignment;
|
|
70
|
-
onBlur?: (args: {
|
|
71
|
-
rowIndex: number;
|
|
72
|
-
value: string;
|
|
73
|
-
setRows: React.Dispatch<React.SetStateAction<RowData[] | null>>;
|
|
74
|
-
values: RowData;
|
|
75
|
-
}) => Promise<void>;
|
|
76
|
-
isCheckbox?: boolean;
|
|
77
|
-
isDateField?: boolean;
|
|
78
|
-
onChangeValueModifier?: (value: string) => TableCellValues;
|
|
79
|
-
getCalculatedValue?: (values: RowData) => TableCellValues;
|
|
80
|
-
isReadOnly?: boolean;
|
|
81
|
-
total?: boolean;
|
|
82
|
-
canUserSort?: boolean;
|
|
83
|
-
sortCompareFn?: (a: any, b: any) => number;
|
|
84
|
-
};
|
|
90
|
+
[key: string]: EditableTableFieldConfiguration;
|
|
91
|
+
};
|
|
92
|
+
export type TypedFieldConfiguration<T> = {
|
|
93
|
+
[key in keyof T]?: EditableTableFieldConfiguration;
|
|
85
94
|
};
|
|
86
95
|
export interface IEditableTableProps {
|
|
87
96
|
tableRows: RowData[] | null;
|
|
@@ -109,6 +118,8 @@ export interface IEditableTableProps {
|
|
|
109
118
|
includeGlobalSearch?: boolean;
|
|
110
119
|
disableHeaderSelect?: boolean;
|
|
111
120
|
defaultSortMeta?: SortMeta | null;
|
|
121
|
+
shadedHeaderLeadingColumns?: 1 | 2;
|
|
122
|
+
freezeHeader?: boolean;
|
|
112
123
|
}
|
|
113
124
|
export interface IEditableTableRef {
|
|
114
125
|
setValue: (rowIndex: number, columnId: string, value: TableCellValues) => void;
|
|
@@ -153,6 +164,8 @@ export interface ITableContentProps extends Pick<IEditableTableProps, "disabled"
|
|
|
153
164
|
sortMeta: SortMeta | null;
|
|
154
165
|
setSortMeta: React.Dispatch<React.SetStateAction<SortMeta | null>>;
|
|
155
166
|
allColumns: ColumnInstance<RowData>[];
|
|
167
|
+
shadedHeaderLeadingColumns?: 1 | 2;
|
|
168
|
+
freezeHeader: boolean;
|
|
156
169
|
}
|
|
157
170
|
export interface IGlobalFilterProps {
|
|
158
171
|
preGlobalFilteredRows: RowData[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DatePickerProps } from "@mui/x-date-pickers
|
|
2
|
-
import { IAuthoriserProp } from "../globals";
|
|
1
|
+
import type { DatePickerProps } from "@mui/x-date-pickers";
|
|
2
|
+
import type { IAuthoriserProp } from "../globals";
|
|
3
3
|
export interface IDatePickerProps extends IAuthoriserProp, DatePickerProps<Date> {
|
|
4
4
|
styling?: string;
|
|
5
5
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { MobileDatePickerProps } from "@mui/x-date-pickers
|
|
2
|
-
import { IAuthoriserProp } from "../globals";
|
|
1
|
+
import type { MobileDatePickerProps } from "@mui/x-date-pickers";
|
|
2
|
+
import type { IAuthoriserProp } from "../globals";
|
|
3
3
|
export type IMobileDatePickerProps = MobileDatePickerProps<Date> & IAuthoriserProp & {
|
|
4
4
|
styling?: string;
|
|
5
5
|
};
|
package/build/index.d.ts
CHANGED
|
@@ -17,7 +17,8 @@ import DatePicker from "./DatePicker/DatePicker";
|
|
|
17
17
|
import KeyboardDatePicker from "./KeyboardDatePicker/KeyboardDatePicker";
|
|
18
18
|
import ButtonWithConfirm from "./ButtonWithConfirm/ButtonWithConfirm";
|
|
19
19
|
import EditableTable from "./EditableTable/EditableTable";
|
|
20
|
-
import {
|
|
20
|
+
import { useElementDimensions } from "./hooks/useElementDimensions";
|
|
21
|
+
import { FieldConfig, TypedFieldConfiguration, RowData, ITableHeader, ITableHeaderComplexAccessor, IColumnsTableHeader, IColumnsTableHeaderComplexAccessor, ITableHeaders, TableCellValues, SynchCellWithStateFn, ICustomRenderFnProps, IEssentialRenderFnProps, SortMeta, IEditableTableRef } from "./EditableTable/EditableTable.types";
|
|
21
22
|
import { tableNumericStringField, tableNumericStringFixedDecimalField, tableDateField, tableCheckbox, TableSelect, TableMultipleSelect, NonEditableField } from "./EditableTable/defaultCells";
|
|
22
23
|
import { useDebounceEffect, useInterval, useWhyDidYouUpdate } from "./hooks";
|
|
23
24
|
import { didCellValueChange } from "./utils";
|
|
@@ -36,5 +37,5 @@ import { TableDateInput } from "./EditableTable/components/TableDateInput";
|
|
|
36
37
|
import { TableTextInput } from "./EditableTable/components/TableTextInput";
|
|
37
38
|
import type { ITableTextInputProps } from "./EditableTable/components/TableTextInput";
|
|
38
39
|
import type { ISideNavConfig, ISecondaryNavigationElement, ISecondaryNavigationElements } from "./LeftNavigation/LeftNavigation.types";
|
|
39
|
-
export { ImageDisplayAndUpload, Alert, Button, ContentLabel, ContentBox, StaticTable, LoadingSpinner, Breadcrumbs, EntityList, ErrorIndicator, LeftNavigation, MainLayout, SearchBar, TextField, Select, DatePicker, AutoSaveTextField, AutoSaveSelectField, KeyboardDatePicker, MobileDatePicker, ButtonWithConfirm, EditableTable, TableSelect, TableMultipleSelect, NonEditableField, TableDateInput as TableDatePicker, TableTextInput as TableTextField, tableNumericStringField, tableNumericStringFixedDecimalField, tableDateField, tableCheckbox, didCellValueChange, useDebounceEffect, useInterval, useWhyDidYouUpdate, AlphabeticalList, NumberFormatField, NavbarLayout, OptionalTooltip, FORM_SUCCESS, FORM_ERROR, FORM_LOADING, FORM_ENABLED, FORM_WARNING, FORM_INFO, FORM_DELETING, };
|
|
40
|
-
export type { FieldConfig, RowData, ITableHeader, TableCellValues, SynchCellWithStateFn, ICustomRenderFnProps, IEssentialRenderFnProps, ISelectProps, IEntity, INavigationLink, ISecondaryNavigationItem, ISecondaryNavigationSubItem, NavbarLayoutTabs, FormStatuses, ITableTextInputProps, ISideNavConfig, ITableHeaderComplexAccessor, IColumnsTableHeader, IColumnsTableHeaderComplexAccessor, ITableHeaders, SortMeta, IEditableTableRef, IAlertProps, ISecondaryNavigationElement, ISecondaryNavigationElements, };
|
|
40
|
+
export { ImageDisplayAndUpload, Alert, Button, ContentLabel, ContentBox, StaticTable, LoadingSpinner, Breadcrumbs, EntityList, ErrorIndicator, LeftNavigation, MainLayout, SearchBar, TextField, Select, DatePicker, AutoSaveTextField, AutoSaveSelectField, KeyboardDatePicker, MobileDatePicker, ButtonWithConfirm, EditableTable, TableSelect, TableMultipleSelect, NonEditableField, TableDateInput as TableDatePicker, TableTextInput as TableTextField, tableNumericStringField, tableNumericStringFixedDecimalField, tableDateField, tableCheckbox, didCellValueChange, useDebounceEffect, useInterval, useWhyDidYouUpdate, useElementDimensions, AlphabeticalList, NumberFormatField, NavbarLayout, OptionalTooltip, FORM_SUCCESS, FORM_ERROR, FORM_LOADING, FORM_ENABLED, FORM_WARNING, FORM_INFO, FORM_DELETING, };
|
|
41
|
+
export type { FieldConfig, TypedFieldConfiguration, RowData, ITableHeader, TableCellValues, SynchCellWithStateFn, ICustomRenderFnProps, IEssentialRenderFnProps, ISelectProps, IEntity, INavigationLink, ISecondaryNavigationItem, ISecondaryNavigationSubItem, NavbarLayoutTabs, FormStatuses, ITableTextInputProps, ISideNavConfig, ITableHeaderComplexAccessor, IColumnsTableHeader, IColumnsTableHeaderComplexAccessor, ITableHeaders, SortMeta, IEditableTableRef, IAlertProps, ISecondaryNavigationElement, ISecondaryNavigationElements, };
|