@equinor/apollo-components 3.1.8 → 3.2.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 +9 -3
- package/dist/index.js +259 -200
- package/dist/index.mjs +213 -155
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { IconData } from '@equinor/eds-icons';
|
|
2
2
|
import * as react from 'react';
|
|
3
3
|
import { ReactNode, ReactElement, HTMLProps, MutableRefObject, Dispatch, SetStateAction, SyntheticEvent } from 'react';
|
|
4
|
+
import { CellContext, Cell, Header, Table, Row, SortingState, OnChangeFn, ColumnDef, RowSelectionState, ExpandedState, VisibilityState, HeaderContext } from '@tanstack/react-table';
|
|
4
5
|
import * as styled_components from 'styled-components';
|
|
5
6
|
import * as _equinor_eds_core_react from '@equinor/eds-core-react';
|
|
6
7
|
import { CellProps, TypographyProps as TypographyProps$1 } from '@equinor/eds-core-react';
|
|
7
|
-
import { Cell, Header, CellContext, Table, Row, SortingState, OnChangeFn, ColumnDef, RowSelectionState, ExpandedState, VisibilityState, HeaderContext } from '@tanstack/react-table';
|
|
8
8
|
import { ColumnDef as ColumnDef$1 } from '@tanstack/table-core';
|
|
9
9
|
import { SetRequired } from 'type-fest';
|
|
10
|
+
import { TableOptions } from '@tanstack/table-core/build/lib/types';
|
|
10
11
|
|
|
11
12
|
interface AppShellProps {
|
|
12
13
|
children?: ReactNode;
|
|
@@ -18,6 +19,8 @@ declare const AppShell: ({ children, icon, title, sidebar }: AppShellProps) => J
|
|
|
18
19
|
|
|
19
20
|
declare function AppSidebar(): JSX.Element;
|
|
20
21
|
|
|
22
|
+
declare function CheckboxCell<T>(context: CellContext<T, boolean>): JSX.Element;
|
|
23
|
+
|
|
21
24
|
declare const ChipsCell: (props: {
|
|
22
25
|
values?: string[];
|
|
23
26
|
}) => JSX.Element;
|
|
@@ -36,8 +39,10 @@ declare function DynamicCell<T>({ cell, highlight, getStickyCellColor }: TableCe
|
|
|
36
39
|
|
|
37
40
|
interface HeaderCellProps<TData, TValue> {
|
|
38
41
|
header: Header<TData, TValue>;
|
|
42
|
+
/** Needed for column resizing */
|
|
43
|
+
table: Table<TData>;
|
|
39
44
|
}
|
|
40
|
-
declare const HeaderCell: <TData, TValue>({ header }: HeaderCellProps<TData, TValue>) => JSX.Element;
|
|
45
|
+
declare const HeaderCell: <TData, TValue>({ header, table }: HeaderCellProps<TData, TValue>) => JSX.Element;
|
|
41
46
|
|
|
42
47
|
declare type HierarchyCellOptions = {
|
|
43
48
|
getRowDepth?: () => number;
|
|
@@ -131,6 +136,7 @@ interface DataTableProps<T> {
|
|
|
131
136
|
virtual?: boolean;
|
|
132
137
|
getRowId?: (originalRow: T, index: number, parent: Row<T> | undefined) => string;
|
|
133
138
|
getSubRows?: (originalRow: T) => T[] | undefined;
|
|
139
|
+
columnResizing?: boolean | TableOptions<T>['columnResizeMode'];
|
|
134
140
|
rowSelection?: Partial<ControlledState<RowSelectionState>> & {
|
|
135
141
|
mode?: RowSelectionMode;
|
|
136
142
|
selectColumn?: 'default' | ((options?: Record<string, any>) => ColumnDef<T, any>);
|
|
@@ -261,4 +267,4 @@ declare function EditableTextAreaCell<T extends FormMeta>(props: EdtiableTextAre
|
|
|
261
267
|
|
|
262
268
|
declare function EditableTextFieldCell<T extends FormMeta>(context: CellContext<T, unknown>): JSX.Element;
|
|
263
269
|
|
|
264
|
-
export { AppShell, AppSidebar, CellConfig, ChipsCell, ColumnSelect, DataTable, DataTableProps, DynamicCell, EditableCheckboxCell, EditableDateCell, EditableDateCellProps, EditableDropdownSingleCell, EditableDropdownSingleCellProps, EditableNumberCell, EditableTextAreaCell, EditableTextFieldCell, FormMeta, HTMLPropsRef, HeaderCell, HierarchyCell, InfiniteScrollConfig, Option, PopoverCell, RowConfig, RowSelectionMode, SelectColumnDef, SortConfig, StickyCell, StickyHeaderCell, StyledStickyCell, TableHeader, TableLayout, TableRowWrapper, TableRowWrapperProps, TruncateMode, TypographyCustom, TypographyProps, WithoutFormMeta, addFormMeta, capitalizeHeader, leftCellShadow, prependSelectColumn, removeFormMeta, stopPropagation, stringToHslColor, useEditMode, useGetIsNew, useHasRemoteChange, useSetFormMeta };
|
|
270
|
+
export { AppShell, AppSidebar, CellConfig, CheckboxCell, ChipsCell, ColumnSelect, DataTable, DataTableProps, DynamicCell, EditableCheckboxCell, EditableDateCell, EditableDateCellProps, EditableDropdownSingleCell, EditableDropdownSingleCellProps, EditableNumberCell, EditableTextAreaCell, EditableTextFieldCell, FormMeta, HTMLPropsRef, HeaderCell, HierarchyCell, InfiniteScrollConfig, Option, PopoverCell, RowConfig, RowSelectionMode, SelectColumnDef, SortConfig, StickyCell, StickyHeaderCell, StyledStickyCell, TableHeader, TableLayout, TableRowWrapper, TableRowWrapperProps, TruncateMode, TypographyCustom, TypographyProps, WithoutFormMeta, addFormMeta, capitalizeHeader, leftCellShadow, prependSelectColumn, removeFormMeta, stopPropagation, stringToHslColor, useEditMode, useGetIsNew, useHasRemoteChange, useSetFormMeta };
|