@oc-digital/react-component-library 8.19.0-beta.0 → 8.19.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.
@@ -5,7 +5,7 @@ export type headerColours = {
5
5
  border?: string;
6
6
  text?: string;
7
7
  };
8
- export interface IStaticRow {
8
+ interface IStaticRow {
9
9
  onClick?: () => void;
10
10
  row: React.ReactNode[];
11
11
  subRows?: React.ReactNode[][];
@@ -23,16 +23,17 @@ export interface IBaseStaticTableProps {
23
23
  freezeFirstColumn?: boolean;
24
24
  customEmptyText?: string;
25
25
  }
26
- export interface IStaticTableProps extends IBaseStaticTableProps {
27
- sortableHeaders: boolean[];
28
- onSort: (column: React.ReactNode, direction: "asc" | "desc") => void;
26
+ interface ICommonSortableProps {
29
27
  sortColumn: React.ReactNode;
30
28
  sortDirection: "asc" | "desc";
29
+ }
30
+ export interface IStaticTableProps extends IBaseStaticTableProps, ICommonSortableProps {
31
+ sortableHeaders: boolean[];
32
+ onSort: (column: React.ReactNode, direction: "asc" | "desc") => void;
31
33
  sortType: "external";
32
34
  }
33
- export interface IStaticTablePropsInternalSort extends IBaseStaticTableProps {
34
- sortFunctions: (((a: string, b: string) => number) | null)[];
35
+ export interface IStaticTablePropsInternalSort extends IBaseStaticTableProps, ICommonSortableProps {
36
+ sortFunctions: (((a: any, b: any) => number) | null)[];
35
37
  sortType: "internal";
36
- sortColumn: React.ReactNode;
37
- sortDirection: "asc" | "desc";
38
38
  }
39
+ export {};
@@ -1,17 +1,17 @@
1
1
  import React from "react";
2
- import { IStaticTableProps, IStaticTablePropsInternalSort, IBaseStaticTableProps } from "./StaticTable.types";
2
+ import { IStaticTableProps, IBaseStaticTableProps } from "./StaticTable.types";
3
3
  type CommonSortProps = {
4
4
  sortColumn: number | undefined;
5
5
  sortDirectionAsc: boolean;
6
6
  sortType: "external" | "internal";
7
7
  setSortColumn: React.Dispatch<React.SetStateAction<number | undefined>>;
8
8
  setSortDirectionAsc: React.Dispatch<React.SetStateAction<boolean>>;
9
+ setExpandedRows: React.Dispatch<React.SetStateAction<number[]>>;
9
10
  };
10
11
  type CommonHeaderProps = Pick<IBaseStaticTableProps, "headers" | "headerCellAlignment" | "headerColours" | "freezeFirstColumn"> & {
11
12
  hasSubRows: Boolean;
12
13
  };
13
14
  type StaticTableHeadersPropsExternalSortable = CommonHeaderProps & CommonSortProps & Pick<IStaticTableProps, "sortableHeaders" | "onSort">;
14
- type StaticTableHeadersPropsInternalSortable = CommonHeaderProps & CommonSortProps & Pick<IStaticTablePropsInternalSort, "sortFunctions">;
15
15
  type StaticTableHeadersPropsNotSortable = CommonHeaderProps;
16
- export declare const StaticTableHeaders: React.FC<StaticTableHeadersPropsExternalSortable | StaticTableHeadersPropsInternalSortable | StaticTableHeadersPropsNotSortable>;
16
+ export declare const StaticTableHeaders: React.FC<StaticTableHeadersPropsExternalSortable | StaticTableHeadersPropsNotSortable>;
17
17
  export {};