@oc-digital/react-component-library 8.0.0 → 9.0.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.
@@ -6,10 +6,28 @@ export type RowData = {
6
6
  [key: string]: any;
7
7
  };
8
8
  export type ITableHeader = {
9
- Header: string | JSX.Element;
9
+ Header: string | React.ReactElement;
10
+ id: string;
10
11
  accessor: string;
11
12
  textAlign?: IAlignment;
13
+ stickyCell?: boolean;
12
14
  };
15
+ export type IComplexTableHeader = {
16
+ Header: string | React.ReactElement;
17
+ textAlign?: IAlignment;
18
+ stickyCell?: boolean;
19
+ shadedHeaderGroup?: boolean;
20
+ id: string;
21
+ accessor?: any;
22
+ columns: {
23
+ Header: string | React.ReactElement;
24
+ id?: string;
25
+ shadedHeaderGroup?: boolean;
26
+ accessor: string;
27
+ textAlign?: IAlignment;
28
+ }[];
29
+ };
30
+ export type ITableHeaders = ITableHeader | IComplexTableHeader;
13
31
  export type TableCellValues = null | undefined | string | number | Date | boolean | string[];
14
32
  export type SynchCellWithStateFn = (rowIndex: number, columnId: string, value: TableCellValues, errorStatus: boolean, forceUpdate?: boolean, original?: RowData) => void;
15
33
  export type FieldConfig = {
@@ -37,7 +55,7 @@ export type FieldConfig = {
37
55
  };
38
56
  export interface IEditableTableProps {
39
57
  tableRows: RowData[] | null;
40
- tableHeaders: ITableHeader[];
58
+ tableHeaders: ITableHeaders[];
41
59
  syncCellWithState: SynchCellWithStateFn;
42
60
  setRows?: React.Dispatch<React.SetStateAction<RowData[] | null>> | undefined;
43
61
  skipPageReset?: boolean;
@@ -96,7 +114,7 @@ export interface ITableContentProps extends Pick<IEditableTableProps, "disabled"
96
114
  isAllRowsSelected: boolean;
97
115
  selectedFlatRows: Row<RowData>[];
98
116
  fieldConfig: FieldConfig;
99
- tableHeaders: ITableHeader[];
117
+ tableHeaders: ITableHeaders[];
100
118
  }
101
119
  export interface IGlobalFilterProps {
102
120
  preGlobalFilteredRows: RowData[];
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, TableCellValues, SynchCellWithStateFn, ICustomRenderFnProps, IEssentialRenderFnProps } from "./EditableTable/EditableTable.types";
20
+ import { FieldConfig, RowData, ITableHeader, IComplexTableHeader, ITableHeaders, TableCellValues, SynchCellWithStateFn, ICustomRenderFnProps, IEssentialRenderFnProps } 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";
@@ -35,4 +35,4 @@ import { TableDateInput } from "./EditableTable/components/TableDateInput";
35
35
  import { TableTextInput } from "./EditableTable/components/TableTextInput";
36
36
  import type { ITableTextInputProps } from "./EditableTable/components/TableTextInput";
37
37
  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_DELETING, };
38
- export type { FieldConfig, RowData, ITableHeader, TableCellValues, SynchCellWithStateFn, ICustomRenderFnProps, IEssentialRenderFnProps, ISelectProps, IEntity, INavigationLink, ISecondaryNavigationItem, ISecondaryNavigationSubItem, NavbarLayoutTabs, FormStatuses, ITableTextInputProps, };
38
+ export type { FieldConfig, RowData, ITableHeader, TableCellValues, SynchCellWithStateFn, ICustomRenderFnProps, IEssentialRenderFnProps, ISelectProps, IEntity, INavigationLink, ISecondaryNavigationItem, ISecondaryNavigationSubItem, NavbarLayoutTabs, FormStatuses, ITableTextInputProps, IComplexTableHeader, ITableHeaders, };