@oc-digital/react-component-library 8.0.0-beta.0 → 8.1.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.
@@ -0,0 +1,4 @@
1
+ export declare function Caret({ reverse, muted }: {
2
+ reverse?: boolean;
3
+ muted?: boolean;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -12,6 +12,10 @@ export type ITableHeader = {
12
12
  };
13
13
  export type TableCellValues = null | undefined | string | number | Date | boolean | string[];
14
14
  export type SynchCellWithStateFn = (rowIndex: number, columnId: string, value: TableCellValues, errorStatus: boolean, forceUpdate?: boolean, original?: RowData) => void;
15
+ export type SortMeta = {
16
+ sortingColumnId: string;
17
+ asc: boolean;
18
+ };
15
19
  export type FieldConfig = {
16
20
  [key: string]: {
17
21
  validationRule?: SchemaOf<any>;
@@ -33,6 +37,8 @@ export type FieldConfig = {
33
37
  onChangeValueModifier?: (value: string) => TableCellValues;
34
38
  getCalculatedValue?: (values: RowData) => TableCellValues;
35
39
  total?: boolean;
40
+ canUserSort?: boolean;
41
+ sortCompareFn?: (a: any, b: any) => number;
36
42
  };
37
43
  };
38
44
  export interface IEditableTableProps {
@@ -60,6 +66,7 @@ export interface IEditableTableProps {
60
66
  rowHeight?: number;
61
67
  includeGlobalSearch?: boolean;
62
68
  disableHeaderSelect?: boolean;
69
+ defaultSortMeta?: SortMeta | null;
63
70
  }
64
71
  type AdditionalCellProps = Pick<IEditableTableProps, "fieldConfig" | "syncCellWithState" | "setRows">;
65
72
  export interface ExtendedCellProps extends AdditionalCellProps, CellProps<RowData> {
@@ -97,6 +104,8 @@ export interface ITableContentProps extends Pick<IEditableTableProps, "disabled"
97
104
  selectedFlatRows: Row<RowData>[];
98
105
  fieldConfig: FieldConfig;
99
106
  tableHeaders: ITableHeader[];
107
+ sortMeta: SortMeta | null;
108
+ setSortMeta: React.Dispatch<React.SetStateAction<SortMeta | null>>;
100
109
  }
101
110
  export interface IGlobalFilterProps {
102
111
  preGlobalFilteredRows: RowData[];
@@ -0,0 +1 @@
1
+ export declare const defaultCompare: (x: any, y: any) => 0 | 1 | -1;