@oc-digital/react-component-library 8.1.0 → 8.2.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.
@@ -1,3 +1,7 @@
1
+ /**
2
+ * V7 docs are not officially hosted anywhere anymore for react table v7
3
+ * it took a while but found someone self hosting them https://react-table-v7-docs.netlify.app/docs/api/useTable#column-options
4
+ */
1
5
  import React from "react";
2
6
  import { IEditableTableProps } from "./EditableTable.types";
3
7
  declare const EditableTable: React.FC<IEditableTableProps>;
@@ -9,7 +9,45 @@ export type ITableHeader = {
9
9
  Header: string | JSX.Element;
10
10
  accessor: string;
11
11
  textAlign?: IAlignment;
12
+ stickyCell?: boolean;
13
+ shadedHeader?: boolean;
12
14
  };
15
+ export type ITableHeaderComplexAccessor = {
16
+ Header: string | JSX.Element;
17
+ id: string;
18
+ accessor: (originalRow: any, rowIndex: any) => any;
19
+ textAlign?: IAlignment;
20
+ stickyCell?: boolean;
21
+ shadedHeader?: boolean;
22
+ };
23
+ export type IColumnsTableHeader = {
24
+ Header: string | JSX.Element;
25
+ textAlign?: IAlignment;
26
+ stickyCell?: boolean;
27
+ shadedHeaderGroup?: boolean;
28
+ accessor?: any;
29
+ columns: {
30
+ Header: string | JSX.Element;
31
+ shadedHeaderGroup?: boolean;
32
+ accessor: string;
33
+ textAlign?: IAlignment;
34
+ }[];
35
+ };
36
+ export type IColumnsTableHeaderComplexAccessor = {
37
+ Header: string | JSX.Element;
38
+ textAlign?: IAlignment;
39
+ stickyCell?: boolean;
40
+ shadedHeaderGroup?: boolean;
41
+ accessor?: any;
42
+ columns: {
43
+ Header: string | JSX.Element;
44
+ id: string;
45
+ shadedHeaderGroup?: boolean;
46
+ accessor: (originalRow: any, rowIndex: any) => any;
47
+ textAlign?: IAlignment;
48
+ }[];
49
+ };
50
+ export type ITableHeaders = ITableHeader | ITableHeaderComplexAccessor | IColumnsTableHeader | IColumnsTableHeaderComplexAccessor;
13
51
  export type TableCellValues = null | undefined | string | number | Date | boolean | string[];
14
52
  export type SynchCellWithStateFn = (rowIndex: number, columnId: string, value: TableCellValues, errorStatus: boolean, forceUpdate?: boolean, original?: RowData) => void;
15
53
  export type SortMeta = {
@@ -43,7 +81,7 @@ export type FieldConfig = {
43
81
  };
44
82
  export interface IEditableTableProps {
45
83
  tableRows: RowData[] | null;
46
- tableHeaders: ITableHeader[];
84
+ tableHeaders: ITableHeaders[];
47
85
  syncCellWithState: SynchCellWithStateFn;
48
86
  setRows?: React.Dispatch<React.SetStateAction<RowData[] | null>> | undefined;
49
87
  skipPageReset?: boolean;
@@ -103,7 +141,7 @@ export interface ITableContentProps extends Pick<IEditableTableProps, "disabled"
103
141
  isAllRowsSelected: boolean;
104
142
  selectedFlatRows: Row<RowData>[];
105
143
  fieldConfig: FieldConfig;
106
- tableHeaders: ITableHeader[];
144
+ tableHeaders: ITableHeaders[];
107
145
  sortMeta: SortMeta | null;
108
146
  setSortMeta: React.Dispatch<React.SetStateAction<SortMeta | null>>;
109
147
  }
@@ -0,0 +1,5 @@
1
+ import { ReactNode } from "react";
2
+ declare const Theme: ({ children }: {
3
+ children: ReactNode;
4
+ }) => JSX.Element;
5
+ export default Theme;
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, ITableHeaderComplexAccessor, IColumnsTableHeader, IColumnsTableHeaderComplexAccessor, 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";
@@ -36,4 +36,4 @@ import { TableTextInput } from "./EditableTable/components/TableTextInput";
36
36
  import type { ITableTextInputProps } from "./EditableTable/components/TableTextInput";
37
37
  import type { ISideNavConfig } from "./LeftNavigation/LeftNavigation.types";
38
38
  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, };
39
- export type { FieldConfig, RowData, ITableHeader, TableCellValues, SynchCellWithStateFn, ICustomRenderFnProps, IEssentialRenderFnProps, ISelectProps, IEntity, INavigationLink, ISecondaryNavigationItem, ISecondaryNavigationSubItem, NavbarLayoutTabs, FormStatuses, ITableTextInputProps, ISideNavConfig, };
39
+ export type { FieldConfig, RowData, ITableHeader, TableCellValues, SynchCellWithStateFn, ICustomRenderFnProps, IEssentialRenderFnProps, ISelectProps, IEntity, INavigationLink, ISecondaryNavigationItem, ISecondaryNavigationSubItem, NavbarLayoutTabs, FormStatuses, ITableTextInputProps, ISideNavConfig, ITableHeaderComplexAccessor, IColumnsTableHeader, IColumnsTableHeaderComplexAccessor, ITableHeaders, };