@equinor/apollo-components 3.7.1 → 3.7.3
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.mts +62 -23
- package/dist/index.d.ts +62 -23
- package/dist/index.js +22 -44
- package/dist/index.mjs +22 -44
- package/package.json +31 -25
package/dist/index.d.mts
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
1
2
|
import { IconData } from '@equinor/eds-icons';
|
|
2
3
|
import * as react from 'react';
|
|
3
4
|
import { ReactNode, ReactElement, HTMLProps, MutableRefObject, Dispatch, SetStateAction, SyntheticEvent } from 'react';
|
|
4
5
|
import { CellContext, Table, Row, SortingState, OnChangeFn, Cell, ColumnDef, ColumnResizeMode, RowSelectionState, ExpandedState, ColumnPinningState, VisibilityState, HeaderContext, Column, Header } from '@tanstack/react-table';
|
|
5
6
|
export { Cell, CellContext, ColumnDef, ColumnPinningState, ColumnResizeMode, ColumnSort, ExpandedState, HeaderContext, OnChangeFn, Row, RowSelectionState, SortingState, Table, VisibilityState, createColumnHelper } from '@tanstack/react-table';
|
|
6
|
-
import * as
|
|
7
|
+
import * as styled_components_dist_types from 'styled-components/dist/types';
|
|
7
8
|
import * as _equinor_eds_core_react from '@equinor/eds-core-react';
|
|
8
9
|
import { CellProps, TypographyProps as TypographyProps$1 } from '@equinor/eds-core-react';
|
|
10
|
+
import * as _equinor_eds_core_react_dist_types_components_Table_Table_types from '@equinor/eds-core-react/dist/types/components/Table/Table.types';
|
|
9
11
|
import { ColumnDef as ColumnDef$1 } from '@tanstack/table-core';
|
|
10
12
|
import { SetRequired } from 'type-fest';
|
|
13
|
+
import * as styled_components from 'styled-components';
|
|
11
14
|
import { Variants } from '@equinor/eds-core-react/dist/types/components/types';
|
|
12
15
|
import { FieldError } from 'react-hook-form';
|
|
13
16
|
|
|
@@ -17,27 +20,27 @@ interface AppShellProps {
|
|
|
17
20
|
icon?: IconData;
|
|
18
21
|
title?: string;
|
|
19
22
|
}
|
|
20
|
-
declare const AppShell: ({ children, icon, title, sidebar }: AppShellProps) => JSX.Element;
|
|
23
|
+
declare const AppShell: ({ children, icon, title, sidebar }: AppShellProps) => react_jsx_runtime.JSX.Element;
|
|
21
24
|
|
|
22
|
-
declare function AppSidebar(): JSX.Element;
|
|
25
|
+
declare function AppSidebar(): react_jsx_runtime.JSX.Element;
|
|
23
26
|
|
|
24
|
-
declare function CheckboxCell<T>(context: CellContext<T, boolean>): JSX.Element;
|
|
27
|
+
declare function CheckboxCell<T>(context: CellContext<T, boolean>): react_jsx_runtime.JSX.Element;
|
|
25
28
|
|
|
26
29
|
declare const ChipsCell: (props: {
|
|
27
30
|
values?: string[];
|
|
28
|
-
}) => JSX.Element;
|
|
31
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
29
32
|
|
|
30
33
|
interface ColumnSelectProps<T> {
|
|
31
34
|
table: Table<T>;
|
|
32
35
|
columnSelectPlaceholder?: string;
|
|
33
36
|
}
|
|
34
|
-
declare function ColumnSelect<T>({ table, columnSelectPlaceholder }: ColumnSelectProps<T>): JSX.Element;
|
|
37
|
+
declare function ColumnSelect<T>({ table, columnSelectPlaceholder }: ColumnSelectProps<T>): react_jsx_runtime.JSX.Element;
|
|
35
38
|
|
|
36
39
|
interface TableHeaderProps<T> {
|
|
37
40
|
table: Table<T>;
|
|
38
41
|
sticky?: boolean;
|
|
39
42
|
}
|
|
40
|
-
declare function TableHeader<T>({ table, sticky }: TableHeaderProps<T>): JSX.Element;
|
|
43
|
+
declare function TableHeader<T>({ table, sticky }: TableHeaderProps<T>): react_jsx_runtime.JSX.Element;
|
|
41
44
|
|
|
42
45
|
interface TableRowWrapper<T> {
|
|
43
46
|
(props: TableRowWrapperProps<T>): ReactElement;
|
|
@@ -168,7 +171,7 @@ type ControlledState<T> = {
|
|
|
168
171
|
onChange?: Dispatch<SetStateAction<T>>;
|
|
169
172
|
};
|
|
170
173
|
|
|
171
|
-
declare function DataTable<T>(props: DataTableProps<T>): JSX.Element;
|
|
174
|
+
declare function DataTable<T>(props: DataTableProps<T>): react_jsx_runtime.JSX.Element;
|
|
172
175
|
|
|
173
176
|
/**
|
|
174
177
|
* Capitalize the table header.
|
|
@@ -206,40 +209,76 @@ type TableCellProps<T> = {
|
|
|
206
209
|
type StyledStickyCellProps = {
|
|
207
210
|
backgroundColor?: string;
|
|
208
211
|
};
|
|
209
|
-
declare const StyledStickyCell:
|
|
210
|
-
|
|
212
|
+
declare const StyledStickyCell: styled_components_dist_types.IStyledComponentBase<"web", styled_components_dist_types.Substitute<styled_components_dist_types.Substitute<(Omit<{
|
|
213
|
+
variant?: _equinor_eds_core_react_dist_types_components_Table_Table_types.Variants;
|
|
214
|
+
color?: _equinor_eds_core_react_dist_types_components_Table_Table_types.Colors;
|
|
215
|
+
sort?: React.AriaAttributes["aria-sort"];
|
|
216
|
+
} & react.TdHTMLAttributes<HTMLTableCellElement> & react.RefAttributes<HTMLTableCellElement>, "ref"> & {
|
|
217
|
+
ref?: ((instance: HTMLTableCellElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLTableCellElement> | null | undefined;
|
|
218
|
+
}) | (Omit<{
|
|
219
|
+
variant?: _equinor_eds_core_react_dist_types_components_Table_Table_types.Variants;
|
|
220
|
+
color?: _equinor_eds_core_react_dist_types_components_Table_Table_types.Colors;
|
|
221
|
+
sort?: React.AriaAttributes["aria-sort"];
|
|
222
|
+
} & react.ThHTMLAttributes<HTMLTableCellElement> & react.RefAttributes<HTMLTableCellElement>, "ref"> & {
|
|
223
|
+
ref?: ((instance: HTMLTableCellElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLTableCellElement> | null | undefined;
|
|
224
|
+
}), _equinor_eds_core_react.CellProps> & styled_components_dist_types.BaseObject, StyledStickyCellProps>> & string;
|
|
225
|
+
declare function DynamicCell<T>({ cell, cellConfig }: TableCellProps<T>): react_jsx_runtime.JSX.Element;
|
|
211
226
|
|
|
212
227
|
interface HeaderCellProps<TData, TValue> {
|
|
213
228
|
header: Header<TData, TValue>;
|
|
214
229
|
/** Needed for column resizing */
|
|
215
230
|
table: Table<TData>;
|
|
216
231
|
}
|
|
217
|
-
declare const HeaderCell: <TData, TValue>({ header, table }: HeaderCellProps<TData, TValue>) => JSX.Element;
|
|
232
|
+
declare const HeaderCell: <TData, TValue>({ header, table }: HeaderCellProps<TData, TValue>) => react_jsx_runtime.JSX.Element;
|
|
218
233
|
|
|
219
234
|
type HierarchyCellOptions = {
|
|
220
235
|
getRowDepth?: () => number;
|
|
221
236
|
getDisplayName?: () => string;
|
|
222
237
|
};
|
|
223
|
-
declare function HierarchyCell<T>(cell: CellContext<T, any>, options?: HierarchyCellOptions): JSX.Element;
|
|
238
|
+
declare function HierarchyCell<T>(cell: CellContext<T, any>, options?: HierarchyCellOptions): react_jsx_runtime.JSX.Element;
|
|
224
239
|
|
|
225
240
|
interface PopoverCellProps {
|
|
226
241
|
id: string;
|
|
227
242
|
value: string;
|
|
228
243
|
title?: string | JSX.Element | ReactNode;
|
|
229
244
|
}
|
|
230
|
-
declare function PopoverCell(props: PopoverCellProps): JSX.Element;
|
|
245
|
+
declare function PopoverCell(props: PopoverCellProps): react_jsx_runtime.JSX.Element;
|
|
231
246
|
|
|
232
247
|
declare function SelectColumnDef<T>(props: SetRequired<DataTableProps<T>, 'rowSelection'>['rowSelection']): ColumnDef$1<T, any>;
|
|
233
248
|
|
|
234
|
-
declare const leftCellShadow: styled_components.
|
|
235
|
-
declare const StickyCell:
|
|
236
|
-
|
|
249
|
+
declare const leftCellShadow: styled_components.RuleSet<object>;
|
|
250
|
+
declare const StickyCell: styled_components_dist_types.IStyledComponentBase<"web", styled_components_dist_types.Substitute<(Omit<{
|
|
251
|
+
variant?: _equinor_eds_core_react_dist_types_components_Table_Table_types.Variants;
|
|
252
|
+
color?: _equinor_eds_core_react_dist_types_components_Table_Table_types.Colors;
|
|
253
|
+
sort?: React.AriaAttributes["aria-sort"];
|
|
254
|
+
} & react.TdHTMLAttributes<HTMLTableCellElement> & react.RefAttributes<HTMLTableCellElement>, "ref"> & {
|
|
255
|
+
ref?: ((instance: HTMLTableCellElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLTableCellElement> | null | undefined;
|
|
256
|
+
}) | (Omit<{
|
|
257
|
+
variant?: _equinor_eds_core_react_dist_types_components_Table_Table_types.Variants;
|
|
258
|
+
color?: _equinor_eds_core_react_dist_types_components_Table_Table_types.Colors;
|
|
259
|
+
sort?: React.AriaAttributes["aria-sort"];
|
|
260
|
+
} & react.ThHTMLAttributes<HTMLTableCellElement> & react.RefAttributes<HTMLTableCellElement>, "ref"> & {
|
|
261
|
+
ref?: ((instance: HTMLTableCellElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLTableCellElement> | null | undefined;
|
|
262
|
+
}), CellProps>> & string & Omit<react.ForwardRefExoticComponent<CellProps & react.RefAttributes<HTMLTableCellElement>>, keyof react.Component<any, {}, any>>;
|
|
263
|
+
declare const StickyHeaderCell: styled_components_dist_types.IStyledComponentBase<"web", styled_components_dist_types.Substitute<styled_components_dist_types.Substitute<(Omit<{
|
|
264
|
+
variant?: _equinor_eds_core_react_dist_types_components_Table_Table_types.Variants;
|
|
265
|
+
color?: _equinor_eds_core_react_dist_types_components_Table_Table_types.Colors;
|
|
266
|
+
sort?: React.AriaAttributes["aria-sort"];
|
|
267
|
+
} & react.TdHTMLAttributes<HTMLTableCellElement> & react.RefAttributes<HTMLTableCellElement>, "ref"> & {
|
|
268
|
+
ref?: ((instance: HTMLTableCellElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLTableCellElement> | null | undefined;
|
|
269
|
+
}) | (Omit<{
|
|
270
|
+
variant?: _equinor_eds_core_react_dist_types_components_Table_Table_types.Variants;
|
|
271
|
+
color?: _equinor_eds_core_react_dist_types_components_Table_Table_types.Colors;
|
|
272
|
+
sort?: React.AriaAttributes["aria-sort"];
|
|
273
|
+
} & react.ThHTMLAttributes<HTMLTableCellElement> & react.RefAttributes<HTMLTableCellElement>, "ref"> & {
|
|
274
|
+
ref?: ((instance: HTMLTableCellElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLTableCellElement> | null | undefined;
|
|
275
|
+
}), CellProps> & styled_components_dist_types.BaseObject, CellProps>> & string;
|
|
237
276
|
|
|
238
277
|
type TypographyProps = {
|
|
239
278
|
truncate?: boolean;
|
|
240
279
|
enableShowAllOnHover?: boolean;
|
|
241
280
|
} & TypographyProps$1;
|
|
242
|
-
declare const TypographyCustom: (props: TypographyProps) => JSX.Element;
|
|
281
|
+
declare const TypographyCustom: (props: TypographyProps) => react_jsx_runtime.JSX.Element;
|
|
243
282
|
|
|
244
283
|
/**
|
|
245
284
|
* Generate a HSL color based on a given string.
|
|
@@ -307,12 +346,12 @@ interface EditableCellBaseProps<T extends FormMeta, Value> extends CellContext<T
|
|
|
307
346
|
onChange?: (value: Value) => void;
|
|
308
347
|
}
|
|
309
348
|
|
|
310
|
-
declare function EditableCheckboxCell<T extends FormMeta>({ onChange: onChangeFromProps, ...context }: EditableCellBaseProps<T, boolean>): JSX.Element;
|
|
349
|
+
declare function EditableCheckboxCell<T extends FormMeta>({ onChange: onChangeFromProps, ...context }: EditableCellBaseProps<T, boolean>): react_jsx_runtime.JSX.Element;
|
|
311
350
|
|
|
312
351
|
interface EditableDateCellProps<T extends FormMeta> extends EditableCellBaseProps<T, string> {
|
|
313
352
|
dateStringFormatter?: (date: string) => string;
|
|
314
353
|
}
|
|
315
|
-
declare function EditableDateCell<T extends FormMeta>({ dateStringFormatter, error: errorFromProps, onChange: onChangeFromProps, ...context }: EditableDateCellProps<T>): JSX.Element;
|
|
354
|
+
declare function EditableDateCell<T extends FormMeta>({ dateStringFormatter, error: errorFromProps, onChange: onChangeFromProps, ...context }: EditableDateCellProps<T>): react_jsx_runtime.JSX.Element;
|
|
316
355
|
|
|
317
356
|
interface Option {
|
|
318
357
|
label: string;
|
|
@@ -325,16 +364,16 @@ interface EditableDropdownSingleCellProps<T extends FormMeta> extends Omit<Edita
|
|
|
325
364
|
options: Option[];
|
|
326
365
|
onChange?: (value: Option) => void;
|
|
327
366
|
}
|
|
328
|
-
declare function EditableDropdownSingleCell<T extends FormMeta>({ options, error: errorFromProps, onChange: onChangeFromProps, ...context }: EditableDropdownSingleCellProps<T>): JSX.Element;
|
|
367
|
+
declare function EditableDropdownSingleCell<T extends FormMeta>({ options, error: errorFromProps, onChange: onChangeFromProps, ...context }: EditableDropdownSingleCellProps<T>): react_jsx_runtime.JSX.Element;
|
|
329
368
|
|
|
330
|
-
declare function EditableNumberCell<T extends FormMeta>({ error: errorFromProps, ...context }: EditableCellBaseProps<T, number>): JSX.Element;
|
|
369
|
+
declare function EditableNumberCell<T extends FormMeta>({ error: errorFromProps, ...context }: EditableCellBaseProps<T, number>): react_jsx_runtime.JSX.Element;
|
|
331
370
|
|
|
332
371
|
interface EdtiableTextAreaProps<T extends FormMeta> extends EditableCellBaseProps<T, string> {
|
|
333
372
|
title: string;
|
|
334
373
|
}
|
|
335
|
-
declare function EditableTextAreaCell<T extends FormMeta>({ title, error: errorFromProps, onChange: onChangeFromProps, ...context }: EdtiableTextAreaProps<T>): JSX.Element;
|
|
374
|
+
declare function EditableTextAreaCell<T extends FormMeta>({ title, error: errorFromProps, onChange: onChangeFromProps, ...context }: EdtiableTextAreaProps<T>): react_jsx_runtime.JSX.Element;
|
|
336
375
|
|
|
337
|
-
declare function EditableTextFieldCell<T extends FormMeta>({ error: errorFromProps, ...context }: EditableCellBaseProps<T, string>): JSX.Element;
|
|
376
|
+
declare function EditableTextFieldCell<T extends FormMeta>({ error: errorFromProps, ...context }: EditableCellBaseProps<T, string>): react_jsx_runtime.JSX.Element;
|
|
338
377
|
|
|
339
378
|
declare const WARNING_PREFIX = "WARNING";
|
|
340
379
|
declare function getHelperTextProps({ error, warning, helperText, }: GetHelperTextPropsProps): GetHelperTextProps;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
1
2
|
import { IconData } from '@equinor/eds-icons';
|
|
2
3
|
import * as react from 'react';
|
|
3
4
|
import { ReactNode, ReactElement, HTMLProps, MutableRefObject, Dispatch, SetStateAction, SyntheticEvent } from 'react';
|
|
4
5
|
import { CellContext, Table, Row, SortingState, OnChangeFn, Cell, ColumnDef, ColumnResizeMode, RowSelectionState, ExpandedState, ColumnPinningState, VisibilityState, HeaderContext, Column, Header } from '@tanstack/react-table';
|
|
5
6
|
export { Cell, CellContext, ColumnDef, ColumnPinningState, ColumnResizeMode, ColumnSort, ExpandedState, HeaderContext, OnChangeFn, Row, RowSelectionState, SortingState, Table, VisibilityState, createColumnHelper } from '@tanstack/react-table';
|
|
6
|
-
import * as
|
|
7
|
+
import * as styled_components_dist_types from 'styled-components/dist/types';
|
|
7
8
|
import * as _equinor_eds_core_react from '@equinor/eds-core-react';
|
|
8
9
|
import { CellProps, TypographyProps as TypographyProps$1 } from '@equinor/eds-core-react';
|
|
10
|
+
import * as _equinor_eds_core_react_dist_types_components_Table_Table_types from '@equinor/eds-core-react/dist/types/components/Table/Table.types';
|
|
9
11
|
import { ColumnDef as ColumnDef$1 } from '@tanstack/table-core';
|
|
10
12
|
import { SetRequired } from 'type-fest';
|
|
13
|
+
import * as styled_components from 'styled-components';
|
|
11
14
|
import { Variants } from '@equinor/eds-core-react/dist/types/components/types';
|
|
12
15
|
import { FieldError } from 'react-hook-form';
|
|
13
16
|
|
|
@@ -17,27 +20,27 @@ interface AppShellProps {
|
|
|
17
20
|
icon?: IconData;
|
|
18
21
|
title?: string;
|
|
19
22
|
}
|
|
20
|
-
declare const AppShell: ({ children, icon, title, sidebar }: AppShellProps) => JSX.Element;
|
|
23
|
+
declare const AppShell: ({ children, icon, title, sidebar }: AppShellProps) => react_jsx_runtime.JSX.Element;
|
|
21
24
|
|
|
22
|
-
declare function AppSidebar(): JSX.Element;
|
|
25
|
+
declare function AppSidebar(): react_jsx_runtime.JSX.Element;
|
|
23
26
|
|
|
24
|
-
declare function CheckboxCell<T>(context: CellContext<T, boolean>): JSX.Element;
|
|
27
|
+
declare function CheckboxCell<T>(context: CellContext<T, boolean>): react_jsx_runtime.JSX.Element;
|
|
25
28
|
|
|
26
29
|
declare const ChipsCell: (props: {
|
|
27
30
|
values?: string[];
|
|
28
|
-
}) => JSX.Element;
|
|
31
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
29
32
|
|
|
30
33
|
interface ColumnSelectProps<T> {
|
|
31
34
|
table: Table<T>;
|
|
32
35
|
columnSelectPlaceholder?: string;
|
|
33
36
|
}
|
|
34
|
-
declare function ColumnSelect<T>({ table, columnSelectPlaceholder }: ColumnSelectProps<T>): JSX.Element;
|
|
37
|
+
declare function ColumnSelect<T>({ table, columnSelectPlaceholder }: ColumnSelectProps<T>): react_jsx_runtime.JSX.Element;
|
|
35
38
|
|
|
36
39
|
interface TableHeaderProps<T> {
|
|
37
40
|
table: Table<T>;
|
|
38
41
|
sticky?: boolean;
|
|
39
42
|
}
|
|
40
|
-
declare function TableHeader<T>({ table, sticky }: TableHeaderProps<T>): JSX.Element;
|
|
43
|
+
declare function TableHeader<T>({ table, sticky }: TableHeaderProps<T>): react_jsx_runtime.JSX.Element;
|
|
41
44
|
|
|
42
45
|
interface TableRowWrapper<T> {
|
|
43
46
|
(props: TableRowWrapperProps<T>): ReactElement;
|
|
@@ -168,7 +171,7 @@ type ControlledState<T> = {
|
|
|
168
171
|
onChange?: Dispatch<SetStateAction<T>>;
|
|
169
172
|
};
|
|
170
173
|
|
|
171
|
-
declare function DataTable<T>(props: DataTableProps<T>): JSX.Element;
|
|
174
|
+
declare function DataTable<T>(props: DataTableProps<T>): react_jsx_runtime.JSX.Element;
|
|
172
175
|
|
|
173
176
|
/**
|
|
174
177
|
* Capitalize the table header.
|
|
@@ -206,40 +209,76 @@ type TableCellProps<T> = {
|
|
|
206
209
|
type StyledStickyCellProps = {
|
|
207
210
|
backgroundColor?: string;
|
|
208
211
|
};
|
|
209
|
-
declare const StyledStickyCell:
|
|
210
|
-
|
|
212
|
+
declare const StyledStickyCell: styled_components_dist_types.IStyledComponentBase<"web", styled_components_dist_types.Substitute<styled_components_dist_types.Substitute<(Omit<{
|
|
213
|
+
variant?: _equinor_eds_core_react_dist_types_components_Table_Table_types.Variants;
|
|
214
|
+
color?: _equinor_eds_core_react_dist_types_components_Table_Table_types.Colors;
|
|
215
|
+
sort?: React.AriaAttributes["aria-sort"];
|
|
216
|
+
} & react.TdHTMLAttributes<HTMLTableCellElement> & react.RefAttributes<HTMLTableCellElement>, "ref"> & {
|
|
217
|
+
ref?: ((instance: HTMLTableCellElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLTableCellElement> | null | undefined;
|
|
218
|
+
}) | (Omit<{
|
|
219
|
+
variant?: _equinor_eds_core_react_dist_types_components_Table_Table_types.Variants;
|
|
220
|
+
color?: _equinor_eds_core_react_dist_types_components_Table_Table_types.Colors;
|
|
221
|
+
sort?: React.AriaAttributes["aria-sort"];
|
|
222
|
+
} & react.ThHTMLAttributes<HTMLTableCellElement> & react.RefAttributes<HTMLTableCellElement>, "ref"> & {
|
|
223
|
+
ref?: ((instance: HTMLTableCellElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLTableCellElement> | null | undefined;
|
|
224
|
+
}), _equinor_eds_core_react.CellProps> & styled_components_dist_types.BaseObject, StyledStickyCellProps>> & string;
|
|
225
|
+
declare function DynamicCell<T>({ cell, cellConfig }: TableCellProps<T>): react_jsx_runtime.JSX.Element;
|
|
211
226
|
|
|
212
227
|
interface HeaderCellProps<TData, TValue> {
|
|
213
228
|
header: Header<TData, TValue>;
|
|
214
229
|
/** Needed for column resizing */
|
|
215
230
|
table: Table<TData>;
|
|
216
231
|
}
|
|
217
|
-
declare const HeaderCell: <TData, TValue>({ header, table }: HeaderCellProps<TData, TValue>) => JSX.Element;
|
|
232
|
+
declare const HeaderCell: <TData, TValue>({ header, table }: HeaderCellProps<TData, TValue>) => react_jsx_runtime.JSX.Element;
|
|
218
233
|
|
|
219
234
|
type HierarchyCellOptions = {
|
|
220
235
|
getRowDepth?: () => number;
|
|
221
236
|
getDisplayName?: () => string;
|
|
222
237
|
};
|
|
223
|
-
declare function HierarchyCell<T>(cell: CellContext<T, any>, options?: HierarchyCellOptions): JSX.Element;
|
|
238
|
+
declare function HierarchyCell<T>(cell: CellContext<T, any>, options?: HierarchyCellOptions): react_jsx_runtime.JSX.Element;
|
|
224
239
|
|
|
225
240
|
interface PopoverCellProps {
|
|
226
241
|
id: string;
|
|
227
242
|
value: string;
|
|
228
243
|
title?: string | JSX.Element | ReactNode;
|
|
229
244
|
}
|
|
230
|
-
declare function PopoverCell(props: PopoverCellProps): JSX.Element;
|
|
245
|
+
declare function PopoverCell(props: PopoverCellProps): react_jsx_runtime.JSX.Element;
|
|
231
246
|
|
|
232
247
|
declare function SelectColumnDef<T>(props: SetRequired<DataTableProps<T>, 'rowSelection'>['rowSelection']): ColumnDef$1<T, any>;
|
|
233
248
|
|
|
234
|
-
declare const leftCellShadow: styled_components.
|
|
235
|
-
declare const StickyCell:
|
|
236
|
-
|
|
249
|
+
declare const leftCellShadow: styled_components.RuleSet<object>;
|
|
250
|
+
declare const StickyCell: styled_components_dist_types.IStyledComponentBase<"web", styled_components_dist_types.Substitute<(Omit<{
|
|
251
|
+
variant?: _equinor_eds_core_react_dist_types_components_Table_Table_types.Variants;
|
|
252
|
+
color?: _equinor_eds_core_react_dist_types_components_Table_Table_types.Colors;
|
|
253
|
+
sort?: React.AriaAttributes["aria-sort"];
|
|
254
|
+
} & react.TdHTMLAttributes<HTMLTableCellElement> & react.RefAttributes<HTMLTableCellElement>, "ref"> & {
|
|
255
|
+
ref?: ((instance: HTMLTableCellElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLTableCellElement> | null | undefined;
|
|
256
|
+
}) | (Omit<{
|
|
257
|
+
variant?: _equinor_eds_core_react_dist_types_components_Table_Table_types.Variants;
|
|
258
|
+
color?: _equinor_eds_core_react_dist_types_components_Table_Table_types.Colors;
|
|
259
|
+
sort?: React.AriaAttributes["aria-sort"];
|
|
260
|
+
} & react.ThHTMLAttributes<HTMLTableCellElement> & react.RefAttributes<HTMLTableCellElement>, "ref"> & {
|
|
261
|
+
ref?: ((instance: HTMLTableCellElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLTableCellElement> | null | undefined;
|
|
262
|
+
}), CellProps>> & string & Omit<react.ForwardRefExoticComponent<CellProps & react.RefAttributes<HTMLTableCellElement>>, keyof react.Component<any, {}, any>>;
|
|
263
|
+
declare const StickyHeaderCell: styled_components_dist_types.IStyledComponentBase<"web", styled_components_dist_types.Substitute<styled_components_dist_types.Substitute<(Omit<{
|
|
264
|
+
variant?: _equinor_eds_core_react_dist_types_components_Table_Table_types.Variants;
|
|
265
|
+
color?: _equinor_eds_core_react_dist_types_components_Table_Table_types.Colors;
|
|
266
|
+
sort?: React.AriaAttributes["aria-sort"];
|
|
267
|
+
} & react.TdHTMLAttributes<HTMLTableCellElement> & react.RefAttributes<HTMLTableCellElement>, "ref"> & {
|
|
268
|
+
ref?: ((instance: HTMLTableCellElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLTableCellElement> | null | undefined;
|
|
269
|
+
}) | (Omit<{
|
|
270
|
+
variant?: _equinor_eds_core_react_dist_types_components_Table_Table_types.Variants;
|
|
271
|
+
color?: _equinor_eds_core_react_dist_types_components_Table_Table_types.Colors;
|
|
272
|
+
sort?: React.AriaAttributes["aria-sort"];
|
|
273
|
+
} & react.ThHTMLAttributes<HTMLTableCellElement> & react.RefAttributes<HTMLTableCellElement>, "ref"> & {
|
|
274
|
+
ref?: ((instance: HTMLTableCellElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLTableCellElement> | null | undefined;
|
|
275
|
+
}), CellProps> & styled_components_dist_types.BaseObject, CellProps>> & string;
|
|
237
276
|
|
|
238
277
|
type TypographyProps = {
|
|
239
278
|
truncate?: boolean;
|
|
240
279
|
enableShowAllOnHover?: boolean;
|
|
241
280
|
} & TypographyProps$1;
|
|
242
|
-
declare const TypographyCustom: (props: TypographyProps) => JSX.Element;
|
|
281
|
+
declare const TypographyCustom: (props: TypographyProps) => react_jsx_runtime.JSX.Element;
|
|
243
282
|
|
|
244
283
|
/**
|
|
245
284
|
* Generate a HSL color based on a given string.
|
|
@@ -307,12 +346,12 @@ interface EditableCellBaseProps<T extends FormMeta, Value> extends CellContext<T
|
|
|
307
346
|
onChange?: (value: Value) => void;
|
|
308
347
|
}
|
|
309
348
|
|
|
310
|
-
declare function EditableCheckboxCell<T extends FormMeta>({ onChange: onChangeFromProps, ...context }: EditableCellBaseProps<T, boolean>): JSX.Element;
|
|
349
|
+
declare function EditableCheckboxCell<T extends FormMeta>({ onChange: onChangeFromProps, ...context }: EditableCellBaseProps<T, boolean>): react_jsx_runtime.JSX.Element;
|
|
311
350
|
|
|
312
351
|
interface EditableDateCellProps<T extends FormMeta> extends EditableCellBaseProps<T, string> {
|
|
313
352
|
dateStringFormatter?: (date: string) => string;
|
|
314
353
|
}
|
|
315
|
-
declare function EditableDateCell<T extends FormMeta>({ dateStringFormatter, error: errorFromProps, onChange: onChangeFromProps, ...context }: EditableDateCellProps<T>): JSX.Element;
|
|
354
|
+
declare function EditableDateCell<T extends FormMeta>({ dateStringFormatter, error: errorFromProps, onChange: onChangeFromProps, ...context }: EditableDateCellProps<T>): react_jsx_runtime.JSX.Element;
|
|
316
355
|
|
|
317
356
|
interface Option {
|
|
318
357
|
label: string;
|
|
@@ -325,16 +364,16 @@ interface EditableDropdownSingleCellProps<T extends FormMeta> extends Omit<Edita
|
|
|
325
364
|
options: Option[];
|
|
326
365
|
onChange?: (value: Option) => void;
|
|
327
366
|
}
|
|
328
|
-
declare function EditableDropdownSingleCell<T extends FormMeta>({ options, error: errorFromProps, onChange: onChangeFromProps, ...context }: EditableDropdownSingleCellProps<T>): JSX.Element;
|
|
367
|
+
declare function EditableDropdownSingleCell<T extends FormMeta>({ options, error: errorFromProps, onChange: onChangeFromProps, ...context }: EditableDropdownSingleCellProps<T>): react_jsx_runtime.JSX.Element;
|
|
329
368
|
|
|
330
|
-
declare function EditableNumberCell<T extends FormMeta>({ error: errorFromProps, ...context }: EditableCellBaseProps<T, number>): JSX.Element;
|
|
369
|
+
declare function EditableNumberCell<T extends FormMeta>({ error: errorFromProps, ...context }: EditableCellBaseProps<T, number>): react_jsx_runtime.JSX.Element;
|
|
331
370
|
|
|
332
371
|
interface EdtiableTextAreaProps<T extends FormMeta> extends EditableCellBaseProps<T, string> {
|
|
333
372
|
title: string;
|
|
334
373
|
}
|
|
335
|
-
declare function EditableTextAreaCell<T extends FormMeta>({ title, error: errorFromProps, onChange: onChangeFromProps, ...context }: EdtiableTextAreaProps<T>): JSX.Element;
|
|
374
|
+
declare function EditableTextAreaCell<T extends FormMeta>({ title, error: errorFromProps, onChange: onChangeFromProps, ...context }: EdtiableTextAreaProps<T>): react_jsx_runtime.JSX.Element;
|
|
336
375
|
|
|
337
|
-
declare function EditableTextFieldCell<T extends FormMeta>({ error: errorFromProps, ...context }: EditableCellBaseProps<T, string>): JSX.Element;
|
|
376
|
+
declare function EditableTextFieldCell<T extends FormMeta>({ error: errorFromProps, ...context }: EditableCellBaseProps<T, string>): react_jsx_runtime.JSX.Element;
|
|
338
377
|
|
|
339
378
|
declare const WARNING_PREFIX = "WARNING";
|
|
340
379
|
declare function getHelperTextProps({ error, warning, helperText, }: GetHelperTextPropsProps): GetHelperTextProps;
|
package/dist/index.js
CHANGED
|
@@ -2862,8 +2862,7 @@ var HeaderDiv = import_styled_components6.default.div`
|
|
|
2862
2862
|
`;
|
|
2863
2863
|
function HeaderContent({ header, table }) {
|
|
2864
2864
|
var _a;
|
|
2865
|
-
if (header.isPlaceholder)
|
|
2866
|
-
return null;
|
|
2865
|
+
if (header.isPlaceholder) return null;
|
|
2867
2866
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(HeaderDiv, { children: [
|
|
2868
2867
|
(0, import_react_table2.flexRender)(header.column.columnDef.header, header.getContext()),
|
|
2869
2868
|
(_a = {
|
|
@@ -2886,8 +2885,7 @@ function HeaderContent({ header, table }) {
|
|
|
2886
2885
|
] });
|
|
2887
2886
|
}
|
|
2888
2887
|
function getSort({ column }) {
|
|
2889
|
-
if (!column.getCanSort())
|
|
2890
|
-
return void 0;
|
|
2888
|
+
if (!column.getCanSort()) return void 0;
|
|
2891
2889
|
switch (column.getIsSorted()) {
|
|
2892
2890
|
case "asc":
|
|
2893
2891
|
return "ascending";
|
|
@@ -3113,29 +3111,22 @@ function enableOrUndefined(enabled, value) {
|
|
|
3113
3111
|
}
|
|
3114
3112
|
function getColumnHeader(column) {
|
|
3115
3113
|
const columnHeader = column.columnDef.header;
|
|
3116
|
-
if (!columnHeader)
|
|
3117
|
-
return column.id;
|
|
3114
|
+
if (!columnHeader) return column.id;
|
|
3118
3115
|
return typeof columnHeader === "string" ? columnHeader : column.id;
|
|
3119
3116
|
}
|
|
3120
3117
|
function prependSelectColumnIfEnabled(columns, config) {
|
|
3121
|
-
if (!config)
|
|
3122
|
-
|
|
3123
|
-
if (!Boolean(config == null ? void 0 : config.mode))
|
|
3124
|
-
return columns;
|
|
3118
|
+
if (!config) return columns;
|
|
3119
|
+
if (!Boolean(config == null ? void 0 : config.mode)) return columns;
|
|
3125
3120
|
return prependSelectColumn(columns, config);
|
|
3126
3121
|
}
|
|
3127
3122
|
function prependSelectColumn(columns, config) {
|
|
3128
|
-
if (!(config == null ? void 0 : config.selectColumn))
|
|
3129
|
-
|
|
3130
|
-
if (config.selectColumn === "default")
|
|
3131
|
-
return [SelectColumnDef(config), ...columns];
|
|
3123
|
+
if (!(config == null ? void 0 : config.selectColumn)) return columns;
|
|
3124
|
+
if (config.selectColumn === "default") return [SelectColumnDef(config), ...columns];
|
|
3132
3125
|
return [config.selectColumn(), ...columns];
|
|
3133
3126
|
}
|
|
3134
3127
|
function getFunctionValueOrDefault(valueOrFn, fnProps, defaultValue) {
|
|
3135
|
-
if (valueOrFn === void 0)
|
|
3136
|
-
|
|
3137
|
-
if (typeof valueOrFn === "function")
|
|
3138
|
-
return valueOrFn(fnProps);
|
|
3128
|
+
if (valueOrFn === void 0) return defaultValue;
|
|
3129
|
+
if (typeof valueOrFn === "function") return valueOrFn(fnProps);
|
|
3139
3130
|
return valueOrFn;
|
|
3140
3131
|
}
|
|
3141
3132
|
|
|
@@ -3308,8 +3299,7 @@ var StyledTableRow = (0, import_styled_components13.default)(import_eds_core_rea
|
|
|
3308
3299
|
${({ active }) => active ? "" : "background-color: inherit;"}
|
|
3309
3300
|
`;
|
|
3310
3301
|
function handleRowEvent(row, handler) {
|
|
3311
|
-
if (!handler)
|
|
3312
|
-
return void 0;
|
|
3302
|
+
if (!handler) return void 0;
|
|
3313
3303
|
return () => {
|
|
3314
3304
|
handler(row);
|
|
3315
3305
|
};
|
|
@@ -3452,8 +3442,7 @@ var import_react_virtual = require("@tanstack/react-virtual");
|
|
|
3452
3442
|
var import_eds_core_react18 = require("@equinor/eds-core-react");
|
|
3453
3443
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
3454
3444
|
var PaddingRow = (props) => {
|
|
3455
|
-
if (!props.height)
|
|
3456
|
-
return null;
|
|
3445
|
+
if (!props.height) return null;
|
|
3457
3446
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_eds_core_react18.Table.Row, { style: { pointerEvents: "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_eds_core_react18.Table.Cell, { style: { height: `${props.height}px` } }) });
|
|
3458
3447
|
};
|
|
3459
3448
|
|
|
@@ -3512,10 +3501,8 @@ var import_react5 = require("react");
|
|
|
3512
3501
|
function useFetchMoreOnBottomReached(tableContainerRef, infiniteScrollConfig) {
|
|
3513
3502
|
const fetchMoreOnBottomReached = (0, import_react5.useCallback)(
|
|
3514
3503
|
(tableContainer) => {
|
|
3515
|
-
if (!infiniteScrollConfig)
|
|
3516
|
-
|
|
3517
|
-
if (!tableContainer)
|
|
3518
|
-
return;
|
|
3504
|
+
if (!infiniteScrollConfig) return;
|
|
3505
|
+
if (!tableContainer) return;
|
|
3519
3506
|
const { onBottomScroll, offset = 300 } = infiniteScrollConfig;
|
|
3520
3507
|
const { scrollHeight, scrollTop, clientHeight } = tableContainer;
|
|
3521
3508
|
if (scrollHeight - scrollTop - clientHeight < offset) {
|
|
@@ -3529,8 +3516,7 @@ function useFetchMoreOnBottomReached(tableContainerRef, infiniteScrollConfig) {
|
|
|
3529
3516
|
[fetchMoreOnBottomReached]
|
|
3530
3517
|
);
|
|
3531
3518
|
(0, import_react5.useEffect)(() => {
|
|
3532
|
-
if (!infiniteScrollConfig)
|
|
3533
|
-
return;
|
|
3519
|
+
if (!infiniteScrollConfig) return;
|
|
3534
3520
|
fetchMoreOnBottomReached(tableContainerRef.current);
|
|
3535
3521
|
}, [fetchMoreOnBottomReached]);
|
|
3536
3522
|
return onTableContainerScroll;
|
|
@@ -3546,14 +3532,11 @@ function useForceRerender() {
|
|
|
3546
3532
|
// src/DataTable/DataTable.tsx
|
|
3547
3533
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
3548
3534
|
function canUseContainStrict(height) {
|
|
3549
|
-
if (!height)
|
|
3550
|
-
return false;
|
|
3535
|
+
if (!height) return false;
|
|
3551
3536
|
const heightIsANumber = !isNaN(Number(height)) && !isNaN(parseFloat(height));
|
|
3552
|
-
if (heightIsANumber)
|
|
3553
|
-
return false;
|
|
3537
|
+
if (heightIsANumber) return false;
|
|
3554
3538
|
const heightIsPercentage = height.endsWith("%");
|
|
3555
|
-
if (heightIsPercentage)
|
|
3556
|
-
return false;
|
|
3539
|
+
if (heightIsPercentage) return false;
|
|
3557
3540
|
return true;
|
|
3558
3541
|
}
|
|
3559
3542
|
var DataTableWrapper = import_styled_components16.default.div`
|
|
@@ -3674,8 +3657,7 @@ function DataTable(props) {
|
|
|
3674
3657
|
);
|
|
3675
3658
|
const forceRerender = useForceRerender();
|
|
3676
3659
|
(0, import_react7.useEffect)(() => {
|
|
3677
|
-
if (Boolean(tableContainerRef.current))
|
|
3678
|
-
forceRerender();
|
|
3660
|
+
if (Boolean(tableContainerRef.current)) forceRerender();
|
|
3679
3661
|
}, [tableContainerRef.current === null]);
|
|
3680
3662
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(DataTableWrapper, { height: props == null ? void 0 : props.height, width: props == null ? void 0 : props.width, tableLayout: props == null ? void 0 : props.tableLayout, children: [
|
|
3681
3663
|
props.bannerConfig && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
@@ -3879,8 +3861,7 @@ function EditableDateCell(_a) {
|
|
|
3879
3861
|
},
|
|
3880
3862
|
[rawValue, dateStringFormatter]
|
|
3881
3863
|
);
|
|
3882
|
-
if (!editMode)
|
|
3883
|
-
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TypographyCustom, { truncate: true, children: formattedValue });
|
|
3864
|
+
if (!editMode) return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TypographyCustom, { truncate: true, children: formattedValue });
|
|
3884
3865
|
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3885
3866
|
import_react_hook_form3.Controller,
|
|
3886
3867
|
{
|
|
@@ -3995,8 +3976,7 @@ function EditableDropdownSingleCell(_a) {
|
|
|
3995
3976
|
"onChange"
|
|
3996
3977
|
]);
|
|
3997
3978
|
const editMode = useEditMode();
|
|
3998
|
-
if (!editMode)
|
|
3999
|
-
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TypographyCustom, { truncate: true, children: context.getValue() });
|
|
3979
|
+
if (!editMode) return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TypographyCustom, { truncate: true, children: context.getValue() });
|
|
4000
3980
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4001
3981
|
import_react_hook_form4.Controller,
|
|
4002
3982
|
{
|
|
@@ -4045,8 +4025,7 @@ function EditableNumberCell(_a) {
|
|
|
4045
4025
|
"error"
|
|
4046
4026
|
]);
|
|
4047
4027
|
const editMode = useEditMode();
|
|
4048
|
-
if (!editMode)
|
|
4049
|
-
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TypographyCustom, { truncate: true, children: context.getValue() });
|
|
4028
|
+
if (!editMode) return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TypographyCustom, { truncate: true, children: context.getValue() });
|
|
4050
4029
|
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4051
4030
|
import_react_hook_form5.Controller,
|
|
4052
4031
|
{
|
|
@@ -4232,8 +4211,7 @@ function EditableTextFieldCell(_a) {
|
|
|
4232
4211
|
"error"
|
|
4233
4212
|
]);
|
|
4234
4213
|
const editMode = useEditMode();
|
|
4235
|
-
if (!editMode)
|
|
4236
|
-
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TypographyCustom, { truncate: true, children: context.getValue() });
|
|
4214
|
+
if (!editMode) return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TypographyCustom, { truncate: true, children: context.getValue() });
|
|
4237
4215
|
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
4238
4216
|
import_react_hook_form7.Controller,
|
|
4239
4217
|
{
|
package/dist/index.mjs
CHANGED
|
@@ -2807,8 +2807,7 @@ var HeaderDiv = styled6.div`
|
|
|
2807
2807
|
`;
|
|
2808
2808
|
function HeaderContent({ header, table }) {
|
|
2809
2809
|
var _a;
|
|
2810
|
-
if (header.isPlaceholder)
|
|
2811
|
-
return null;
|
|
2810
|
+
if (header.isPlaceholder) return null;
|
|
2812
2811
|
return /* @__PURE__ */ jsxs3(HeaderDiv, { children: [
|
|
2813
2812
|
flexRender2(header.column.columnDef.header, header.getContext()),
|
|
2814
2813
|
(_a = {
|
|
@@ -2831,8 +2830,7 @@ function HeaderContent({ header, table }) {
|
|
|
2831
2830
|
] });
|
|
2832
2831
|
}
|
|
2833
2832
|
function getSort({ column }) {
|
|
2834
|
-
if (!column.getCanSort())
|
|
2835
|
-
return void 0;
|
|
2833
|
+
if (!column.getCanSort()) return void 0;
|
|
2836
2834
|
switch (column.getIsSorted()) {
|
|
2837
2835
|
case "asc":
|
|
2838
2836
|
return "ascending";
|
|
@@ -3060,29 +3058,22 @@ function enableOrUndefined(enabled, value) {
|
|
|
3060
3058
|
}
|
|
3061
3059
|
function getColumnHeader(column) {
|
|
3062
3060
|
const columnHeader = column.columnDef.header;
|
|
3063
|
-
if (!columnHeader)
|
|
3064
|
-
return column.id;
|
|
3061
|
+
if (!columnHeader) return column.id;
|
|
3065
3062
|
return typeof columnHeader === "string" ? columnHeader : column.id;
|
|
3066
3063
|
}
|
|
3067
3064
|
function prependSelectColumnIfEnabled(columns, config) {
|
|
3068
|
-
if (!config)
|
|
3069
|
-
|
|
3070
|
-
if (!Boolean(config == null ? void 0 : config.mode))
|
|
3071
|
-
return columns;
|
|
3065
|
+
if (!config) return columns;
|
|
3066
|
+
if (!Boolean(config == null ? void 0 : config.mode)) return columns;
|
|
3072
3067
|
return prependSelectColumn(columns, config);
|
|
3073
3068
|
}
|
|
3074
3069
|
function prependSelectColumn(columns, config) {
|
|
3075
|
-
if (!(config == null ? void 0 : config.selectColumn))
|
|
3076
|
-
|
|
3077
|
-
if (config.selectColumn === "default")
|
|
3078
|
-
return [SelectColumnDef(config), ...columns];
|
|
3070
|
+
if (!(config == null ? void 0 : config.selectColumn)) return columns;
|
|
3071
|
+
if (config.selectColumn === "default") return [SelectColumnDef(config), ...columns];
|
|
3079
3072
|
return [config.selectColumn(), ...columns];
|
|
3080
3073
|
}
|
|
3081
3074
|
function getFunctionValueOrDefault(valueOrFn, fnProps, defaultValue) {
|
|
3082
|
-
if (valueOrFn === void 0)
|
|
3083
|
-
|
|
3084
|
-
if (typeof valueOrFn === "function")
|
|
3085
|
-
return valueOrFn(fnProps);
|
|
3075
|
+
if (valueOrFn === void 0) return defaultValue;
|
|
3076
|
+
if (typeof valueOrFn === "function") return valueOrFn(fnProps);
|
|
3086
3077
|
return valueOrFn;
|
|
3087
3078
|
}
|
|
3088
3079
|
|
|
@@ -3261,8 +3252,7 @@ var StyledTableRow = styled13(Table6.Row)`
|
|
|
3261
3252
|
${({ active }) => active ? "" : "background-color: inherit;"}
|
|
3262
3253
|
`;
|
|
3263
3254
|
function handleRowEvent(row, handler) {
|
|
3264
|
-
if (!handler)
|
|
3265
|
-
return void 0;
|
|
3255
|
+
if (!handler) return void 0;
|
|
3266
3256
|
return () => {
|
|
3267
3257
|
handler(row);
|
|
3268
3258
|
};
|
|
@@ -3405,8 +3395,7 @@ import { useVirtualizer } from "@tanstack/react-virtual";
|
|
|
3405
3395
|
import { Table as Table7 } from "@equinor/eds-core-react";
|
|
3406
3396
|
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
3407
3397
|
var PaddingRow = (props) => {
|
|
3408
|
-
if (!props.height)
|
|
3409
|
-
return null;
|
|
3398
|
+
if (!props.height) return null;
|
|
3410
3399
|
return /* @__PURE__ */ jsx18(Table7.Row, { style: { pointerEvents: "none" }, children: /* @__PURE__ */ jsx18(Table7.Cell, { style: { height: `${props.height}px` } }) });
|
|
3411
3400
|
};
|
|
3412
3401
|
|
|
@@ -3465,10 +3454,8 @@ import { useCallback, useEffect as useEffect2 } from "react";
|
|
|
3465
3454
|
function useFetchMoreOnBottomReached(tableContainerRef, infiniteScrollConfig) {
|
|
3466
3455
|
const fetchMoreOnBottomReached = useCallback(
|
|
3467
3456
|
(tableContainer) => {
|
|
3468
|
-
if (!infiniteScrollConfig)
|
|
3469
|
-
|
|
3470
|
-
if (!tableContainer)
|
|
3471
|
-
return;
|
|
3457
|
+
if (!infiniteScrollConfig) return;
|
|
3458
|
+
if (!tableContainer) return;
|
|
3472
3459
|
const { onBottomScroll, offset = 300 } = infiniteScrollConfig;
|
|
3473
3460
|
const { scrollHeight, scrollTop, clientHeight } = tableContainer;
|
|
3474
3461
|
if (scrollHeight - scrollTop - clientHeight < offset) {
|
|
@@ -3482,8 +3469,7 @@ function useFetchMoreOnBottomReached(tableContainerRef, infiniteScrollConfig) {
|
|
|
3482
3469
|
[fetchMoreOnBottomReached]
|
|
3483
3470
|
);
|
|
3484
3471
|
useEffect2(() => {
|
|
3485
|
-
if (!infiniteScrollConfig)
|
|
3486
|
-
return;
|
|
3472
|
+
if (!infiniteScrollConfig) return;
|
|
3487
3473
|
fetchMoreOnBottomReached(tableContainerRef.current);
|
|
3488
3474
|
}, [fetchMoreOnBottomReached]);
|
|
3489
3475
|
return onTableContainerScroll;
|
|
@@ -3499,14 +3485,11 @@ function useForceRerender() {
|
|
|
3499
3485
|
// src/DataTable/DataTable.tsx
|
|
3500
3486
|
import { jsx as jsx20, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
3501
3487
|
function canUseContainStrict(height) {
|
|
3502
|
-
if (!height)
|
|
3503
|
-
return false;
|
|
3488
|
+
if (!height) return false;
|
|
3504
3489
|
const heightIsANumber = !isNaN(Number(height)) && !isNaN(parseFloat(height));
|
|
3505
|
-
if (heightIsANumber)
|
|
3506
|
-
return false;
|
|
3490
|
+
if (heightIsANumber) return false;
|
|
3507
3491
|
const heightIsPercentage = height.endsWith("%");
|
|
3508
|
-
if (heightIsPercentage)
|
|
3509
|
-
return false;
|
|
3492
|
+
if (heightIsPercentage) return false;
|
|
3510
3493
|
return true;
|
|
3511
3494
|
}
|
|
3512
3495
|
var DataTableWrapper = styled16.div`
|
|
@@ -3627,8 +3610,7 @@ function DataTable(props) {
|
|
|
3627
3610
|
);
|
|
3628
3611
|
const forceRerender = useForceRerender();
|
|
3629
3612
|
useEffect3(() => {
|
|
3630
|
-
if (Boolean(tableContainerRef.current))
|
|
3631
|
-
forceRerender();
|
|
3613
|
+
if (Boolean(tableContainerRef.current)) forceRerender();
|
|
3632
3614
|
}, [tableContainerRef.current === null]);
|
|
3633
3615
|
return /* @__PURE__ */ jsxs11(DataTableWrapper, { height: props == null ? void 0 : props.height, width: props == null ? void 0 : props.width, tableLayout: props == null ? void 0 : props.tableLayout, children: [
|
|
3634
3616
|
props.bannerConfig && /* @__PURE__ */ jsx20(
|
|
@@ -3832,8 +3814,7 @@ function EditableDateCell(_a) {
|
|
|
3832
3814
|
},
|
|
3833
3815
|
[rawValue, dateStringFormatter]
|
|
3834
3816
|
);
|
|
3835
|
-
if (!editMode)
|
|
3836
|
-
return /* @__PURE__ */ jsx23(TypographyCustom, { truncate: true, children: formattedValue });
|
|
3817
|
+
if (!editMode) return /* @__PURE__ */ jsx23(TypographyCustom, { truncate: true, children: formattedValue });
|
|
3837
3818
|
return /* @__PURE__ */ jsx23(
|
|
3838
3819
|
Controller2,
|
|
3839
3820
|
{
|
|
@@ -3948,8 +3929,7 @@ function EditableDropdownSingleCell(_a) {
|
|
|
3948
3929
|
"onChange"
|
|
3949
3930
|
]);
|
|
3950
3931
|
const editMode = useEditMode();
|
|
3951
|
-
if (!editMode)
|
|
3952
|
-
return /* @__PURE__ */ jsx25(TypographyCustom, { truncate: true, children: context.getValue() });
|
|
3932
|
+
if (!editMode) return /* @__PURE__ */ jsx25(TypographyCustom, { truncate: true, children: context.getValue() });
|
|
3953
3933
|
return /* @__PURE__ */ jsx25(
|
|
3954
3934
|
Controller3,
|
|
3955
3935
|
{
|
|
@@ -3998,8 +3978,7 @@ function EditableNumberCell(_a) {
|
|
|
3998
3978
|
"error"
|
|
3999
3979
|
]);
|
|
4000
3980
|
const editMode = useEditMode();
|
|
4001
|
-
if (!editMode)
|
|
4002
|
-
return /* @__PURE__ */ jsx26(TypographyCustom, { truncate: true, children: context.getValue() });
|
|
3981
|
+
if (!editMode) return /* @__PURE__ */ jsx26(TypographyCustom, { truncate: true, children: context.getValue() });
|
|
4003
3982
|
return /* @__PURE__ */ jsx26(
|
|
4004
3983
|
Controller4,
|
|
4005
3984
|
{
|
|
@@ -4185,8 +4164,7 @@ function EditableTextFieldCell(_a) {
|
|
|
4185
4164
|
"error"
|
|
4186
4165
|
]);
|
|
4187
4166
|
const editMode = useEditMode();
|
|
4188
|
-
if (!editMode)
|
|
4189
|
-
return /* @__PURE__ */ jsx28(TypographyCustom, { truncate: true, children: context.getValue() });
|
|
4167
|
+
if (!editMode) return /* @__PURE__ */ jsx28(TypographyCustom, { truncate: true, children: context.getValue() });
|
|
4190
4168
|
return /* @__PURE__ */ jsx28(
|
|
4191
4169
|
Controller6,
|
|
4192
4170
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/apollo-components",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -17,36 +17,42 @@
|
|
|
17
17
|
"storybook": "storybook dev"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@equinor/eds-icons": "^0.
|
|
21
|
-
"@equinor/eds-tokens": "^0.9.
|
|
22
|
-
"@tanstack/match-sorter-utils": "^8.
|
|
23
|
-
"@tanstack/react-table": "^8.
|
|
24
|
-
"@tanstack/react-virtual": "^3.
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
"@equinor/eds-icons": "^0.21.0",
|
|
21
|
+
"@equinor/eds-tokens": "^0.9.2",
|
|
22
|
+
"@tanstack/match-sorter-utils": "^8.15.1",
|
|
23
|
+
"@tanstack/react-table": "^8.17.3",
|
|
24
|
+
"@tanstack/react-virtual": "^3.7.0"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@equinor/eds-core-react": "^0.40.0",
|
|
28
|
+
"@storybook/addon-essentials": "^8.1.11",
|
|
29
|
+
"@storybook/addon-interactions": "^8.1.11",
|
|
30
|
+
"@storybook/addon-links": "^8.1.11",
|
|
31
|
+
"@storybook/react": "^8.1.11",
|
|
32
|
+
"@storybook/react-vite": "^8.1.11",
|
|
33
|
+
"@storybook/testing-library": "^0.2.2",
|
|
34
|
+
"@types/react": "^18.3.3",
|
|
35
|
+
"@types/react-dom": "^18.3.0",
|
|
36
|
+
"@types/styled-components": "^5.1.34",
|
|
37
|
+
"eslint": "^8.56.0",
|
|
38
|
+
"eslint-config-custom": "*",
|
|
39
|
+
"react": "^18.2.0",
|
|
40
|
+
"react-dom": "^18.2.0",
|
|
41
|
+
"react-hook-form": "^7.43.8",
|
|
42
|
+
"storybook": "^8.1.11",
|
|
43
|
+
"styled-components": "^6.1.11",
|
|
44
|
+
"tsconfig": "*",
|
|
45
|
+
"tsup": "^8.1.0",
|
|
46
|
+
"type-fest": "^4.20.1",
|
|
47
|
+
"typescript": "^5.5.2"
|
|
27
48
|
},
|
|
28
49
|
"peerDependencies": {
|
|
29
50
|
"@equinor/eds-core-react": "^0.35.1",
|
|
30
51
|
"react": "^18.2.0",
|
|
31
52
|
"react-dom": "^18.2.0",
|
|
32
53
|
"react-hook-form": "^7.43.8",
|
|
33
|
-
"styled-components": "^5.3.11"
|
|
34
|
-
|
|
35
|
-
"devDependencies": {
|
|
36
|
-
"@storybook/addon-essentials": "^7.0.0-alpha.38",
|
|
37
|
-
"@storybook/addon-interactions": "^7.0.0-alpha.38",
|
|
38
|
-
"@storybook/addon-links": "^7.0.0-alpha.38",
|
|
39
|
-
"@storybook/react": "^7.0.0-alpha.38",
|
|
40
|
-
"@storybook/react-vite": "^7.0.0-alpha.38",
|
|
41
|
-
"@storybook/testing-library": "^0.0.13",
|
|
42
|
-
"@types/react": "^18.0.1",
|
|
43
|
-
"@types/react-dom": "^18.0.1",
|
|
44
|
-
"@types/styled-components": "^5.1.26",
|
|
45
|
-
"eslint": "^8.56.0",
|
|
46
|
-
"eslint-config-custom": "*",
|
|
47
|
-
"storybook": "^7.0.0-alpha.38",
|
|
48
|
-
"tsconfig": "*",
|
|
49
|
-
"typescript": "^5.2.2"
|
|
54
|
+
"styled-components": "^5.3.11",
|
|
55
|
+
"type-fest": "^3.11.0"
|
|
50
56
|
},
|
|
51
57
|
"publishConfig": {
|
|
52
58
|
"access": "public"
|