@oc-digital/react-component-library 8.14.0 → 8.15.0-beta.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/build/EditableTable/EditableTable.types.d.ts +28 -24
- package/build/index.d.ts +2 -2
- package/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -57,31 +57,35 @@ export type SortMeta = {
|
|
|
57
57
|
sortingColumnId: string;
|
|
58
58
|
asc: boolean;
|
|
59
59
|
};
|
|
60
|
+
type EditableTableFieldConfiguration = {
|
|
61
|
+
validationRule?: SchemaOf<any>;
|
|
62
|
+
dependentValidationRule?: (values: {
|
|
63
|
+
[key: string]: any;
|
|
64
|
+
}) => SchemaOf<any>;
|
|
65
|
+
customRenderFn?: (args: ICustomRenderFnProps) => JSX.Element;
|
|
66
|
+
prefix?: React.ReactNode | React.JSXElementConstructor<any>;
|
|
67
|
+
suffix?: React.ReactNode | React.JSXElementConstructor<any>;
|
|
68
|
+
textAlign?: IAlignment;
|
|
69
|
+
onBlur?: (args: {
|
|
70
|
+
rowIndex: number;
|
|
71
|
+
value: string;
|
|
72
|
+
setRows: React.Dispatch<React.SetStateAction<RowData[] | null>>;
|
|
73
|
+
values: RowData;
|
|
74
|
+
}) => Promise<void>;
|
|
75
|
+
isCheckbox?: boolean;
|
|
76
|
+
isDateField?: boolean;
|
|
77
|
+
onChangeValueModifier?: (value: string) => TableCellValues;
|
|
78
|
+
getCalculatedValue?: (values: RowData) => TableCellValues;
|
|
79
|
+
isReadOnly?: boolean;
|
|
80
|
+
total?: boolean;
|
|
81
|
+
canUserSort?: boolean;
|
|
82
|
+
sortCompareFn?: (a: any, b: any) => number;
|
|
83
|
+
};
|
|
60
84
|
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
|
-
};
|
|
85
|
+
[key: string]: EditableTableFieldConfiguration;
|
|
86
|
+
};
|
|
87
|
+
export type TypedFieldConfiguration<T> = {
|
|
88
|
+
[key in keyof T]?: EditableTableFieldConfiguration;
|
|
85
89
|
};
|
|
86
90
|
export interface IEditableTableProps {
|
|
87
91
|
tableRows: RowData[] | null;
|
package/build/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ 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 { FieldConfig, RowData, ITableHeader, ITableHeaderComplexAccessor, IColumnsTableHeader, IColumnsTableHeaderComplexAccessor, ITableHeaders, TableCellValues, SynchCellWithStateFn, ICustomRenderFnProps, IEssentialRenderFnProps, SortMeta, IEditableTableRef } from "./EditableTable/EditableTable.types";
|
|
20
|
+
import { FieldConfig, TypedFieldConfiguration, RowData, ITableHeader, ITableHeaderComplexAccessor, IColumnsTableHeader, IColumnsTableHeaderComplexAccessor, ITableHeaders, TableCellValues, SynchCellWithStateFn, ICustomRenderFnProps, IEssentialRenderFnProps, SortMeta, IEditableTableRef } from "./EditableTable/EditableTable.types";
|
|
21
21
|
import { tableNumericStringField, tableNumericStringFixedDecimalField, tableDateField, tableCheckbox, TableSelect, TableMultipleSelect, NonEditableField } from "./EditableTable/defaultCells";
|
|
22
22
|
import { useDebounceEffect, useInterval, useWhyDidYouUpdate } from "./hooks";
|
|
23
23
|
import { didCellValueChange } from "./utils";
|
|
@@ -37,4 +37,4 @@ import { TableTextInput } from "./EditableTable/components/TableTextInput";
|
|
|
37
37
|
import type { ITableTextInputProps } from "./EditableTable/components/TableTextInput";
|
|
38
38
|
import type { ISideNavConfig, ISecondaryNavigationElement, ISecondaryNavigationElements } from "./LeftNavigation/LeftNavigation.types";
|
|
39
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 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, };
|