@equinor/apollo-components 1.3.1 → 1.4.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/dist/index.d.ts +42 -5
- package/dist/index.js +394 -154
- package/dist/index.mjs +380 -143
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { IconData } from '@equinor/eds-icons';
|
|
2
|
+
import * as react from 'react';
|
|
2
3
|
import { ReactNode, ComponentProps } from 'react';
|
|
3
|
-
import { ColumnDef, RowSelectionState, SortingState } from '@tanstack/react-table';
|
|
4
|
+
import { Cell, CellContext, ColumnDef, RowSelectionState, SortingState } from '@tanstack/react-table';
|
|
5
|
+
import { ColumnDef as ColumnDef$1 } from '@tanstack/table-core';
|
|
6
|
+
import * as styled_components from 'styled-components';
|
|
7
|
+
import { CellProps, TypographyProps as TypographyProps$1 } from '@equinor/eds-core-react';
|
|
4
8
|
import * as jotai from 'jotai';
|
|
5
9
|
import { Provider } from 'jotai';
|
|
6
10
|
|
|
@@ -18,6 +22,14 @@ declare const ChipsCell: (props: {
|
|
|
18
22
|
values?: string[];
|
|
19
23
|
}) => JSX.Element;
|
|
20
24
|
|
|
25
|
+
declare type TableCellProps<T> = {
|
|
26
|
+
cell: Cell<T, unknown>;
|
|
27
|
+
highlight?: boolean;
|
|
28
|
+
};
|
|
29
|
+
declare function DynamicCell<T>({ cell, highlight }: TableCellProps<T>): JSX.Element;
|
|
30
|
+
|
|
31
|
+
declare function HierarchyCell<T>(cell: CellContext<T, any>): JSX.Element;
|
|
32
|
+
|
|
21
33
|
interface HeaderConfig {
|
|
22
34
|
captionPadding?: string;
|
|
23
35
|
stickyHeader?: boolean;
|
|
@@ -27,12 +39,19 @@ interface FilterConfig {
|
|
|
27
39
|
globalFilter?: boolean;
|
|
28
40
|
globalFilterPlaceholder?: string;
|
|
29
41
|
}
|
|
30
|
-
|
|
42
|
+
declare type RowSelectionMode = 'single' | 'multiple';
|
|
43
|
+
declare type DataTableConfig<T> = {
|
|
31
44
|
height?: string;
|
|
32
45
|
sortable?: boolean;
|
|
33
46
|
virtual?: boolean;
|
|
34
|
-
|
|
47
|
+
rowSelectionMode?: RowSelectionMode;
|
|
35
48
|
width?: string;
|
|
49
|
+
selectColumn?: 'default' | ((options?: Record<string, any>) => ColumnDef<T, any>);
|
|
50
|
+
getSubRows?: (originalRow: T) => T[] | undefined;
|
|
51
|
+
} & ExpansionConfig;
|
|
52
|
+
interface ExpansionConfig {
|
|
53
|
+
expandAllByDefault?: boolean;
|
|
54
|
+
hideExpandControls?: boolean;
|
|
36
55
|
}
|
|
37
56
|
|
|
38
57
|
interface DataTableProps<T> {
|
|
@@ -40,7 +59,7 @@ interface DataTableProps<T> {
|
|
|
40
59
|
columns: ColumnDef<T, any>[];
|
|
41
60
|
isLoading?: boolean;
|
|
42
61
|
className?: string;
|
|
43
|
-
config?: DataTableConfig
|
|
62
|
+
config?: DataTableConfig<T>;
|
|
44
63
|
filters?: FilterConfig;
|
|
45
64
|
header?: HeaderConfig;
|
|
46
65
|
}
|
|
@@ -59,9 +78,27 @@ declare const tableSortingAtom: jotai.PrimitiveAtom<SortingState> & {
|
|
|
59
78
|
init: SortingState;
|
|
60
79
|
};
|
|
61
80
|
|
|
81
|
+
/** Prepend a column definition array with a select column. */
|
|
82
|
+
declare function prependSelectColumn<T>(columns: ColumnDef<T>[], config?: DataTableConfig<T>): ColumnDef<T, unknown>[];
|
|
83
|
+
|
|
62
84
|
declare type DataTableCompoundProps = typeof DataTable$1 & {
|
|
63
85
|
Provider: typeof DataTableProvider;
|
|
64
86
|
};
|
|
65
87
|
declare const DataTable: DataTableCompoundProps;
|
|
66
88
|
|
|
67
|
-
|
|
89
|
+
declare function SelectColumnDef<T>(selectionMode?: RowSelectionMode): ColumnDef$1<T, any>;
|
|
90
|
+
|
|
91
|
+
declare const StickyCell: styled_components.StyledComponent<react.ForwardRefExoticComponent<CellProps & react.RefAttributes<HTMLTableCellElement>>, any, {} & CellProps, never>;
|
|
92
|
+
|
|
93
|
+
declare type TypographyProps = {
|
|
94
|
+
noWrap?: boolean;
|
|
95
|
+
/** Requires noWrap prop in order to function */
|
|
96
|
+
showAllOnHover?: boolean;
|
|
97
|
+
} & TypographyProps$1;
|
|
98
|
+
/** A cell used to wrap text in EDS Typography
|
|
99
|
+
*
|
|
100
|
+
* Developed for Plant Tracker.
|
|
101
|
+
*/
|
|
102
|
+
declare const TypographyCustom: (props: TypographyProps) => JSX.Element;
|
|
103
|
+
|
|
104
|
+
export { AppShell, AppSidebar, ChipsCell, DataTable, DataTableConfig, DynamicCell, FilterConfig, HeaderConfig, HierarchyCell, RowSelectionMode, SelectColumnDef, StickyCell, TypographyCustom, globalFilterAtom, prependSelectColumn, rowSelectionAtom, tableSortingAtom };
|