@equinor/apollo-components 3.2.0 → 3.3.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 +28 -9
- package/dist/index.js +737 -694
- package/dist/index.mjs +730 -687
- package/package.json +7 -7
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { CellProps, TypographyProps as TypographyProps$1 } from '@equinor/eds-co
|
|
|
8
8
|
import { ColumnDef as ColumnDef$1 } from '@tanstack/table-core';
|
|
9
9
|
import { SetRequired } from 'type-fest';
|
|
10
10
|
import { TableOptions } from '@tanstack/table-core/build/lib/types';
|
|
11
|
+
import { FieldError } from 'react-hook-form';
|
|
11
12
|
|
|
12
13
|
interface AppShellProps {
|
|
13
14
|
children?: ReactNode;
|
|
@@ -161,7 +162,12 @@ interface DataTableProps<T> {
|
|
|
161
162
|
enableGlobalFilterInput?: boolean;
|
|
162
163
|
globalFilterPlaceholder?: string;
|
|
163
164
|
filterFromLeafRows?: boolean;
|
|
165
|
+
/**
|
|
166
|
+
* @deprecated Use `customActionsLeft` instead
|
|
167
|
+
*/
|
|
164
168
|
customActions?: <T>(table: Table<T>) => ReactNode;
|
|
169
|
+
customActionsLeft?: <T>(table: Table<T>) => ReactNode;
|
|
170
|
+
customActionsRight?: <T>(table: Table<T>) => ReactNode;
|
|
165
171
|
/**
|
|
166
172
|
* Default 1rem
|
|
167
173
|
* Accepts any CSS padding value
|
|
@@ -239,32 +245,45 @@ declare function useSetFormMeta<T extends FormMeta>(): (newValues: Partial<T>) =
|
|
|
239
245
|
declare function removeFormMeta<T extends FormMeta>(withFormMeta: T): Omit<T, keyof FormMeta>;
|
|
240
246
|
declare function addFormMeta<T>(withoutFormMeta: T): T & FormMeta;
|
|
241
247
|
|
|
242
|
-
|
|
248
|
+
interface EditableCellBaseProps<T extends FormMeta, Value> extends CellContext<T, Value> {
|
|
249
|
+
/**
|
|
250
|
+
* FieldError object used to overwrite react-hook-form validation result. It is prioritized over
|
|
251
|
+
* react-hook-form's validation.
|
|
252
|
+
*/
|
|
253
|
+
error?: FieldError;
|
|
254
|
+
/**
|
|
255
|
+
* Custom `onChange` called on input change after react-hook-form's `onChange`. E.g. used to trigger actions on change.
|
|
256
|
+
*/
|
|
257
|
+
onChange?: (value: Value) => void;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
declare function EditableCheckboxCell<T extends FormMeta>({ onChange: onChangeFromProps, ...context }: EditableCellBaseProps<T, boolean>): JSX.Element;
|
|
243
261
|
|
|
244
|
-
interface EditableDateCellProps<T extends FormMeta> extends
|
|
262
|
+
interface EditableDateCellProps<T extends FormMeta> extends EditableCellBaseProps<T, string> {
|
|
245
263
|
dateStringFormatter?: (date: string) => string;
|
|
246
264
|
}
|
|
247
|
-
declare function EditableDateCell<T extends FormMeta>(
|
|
265
|
+
declare function EditableDateCell<T extends FormMeta>({ dateStringFormatter, error: errorFromProps, onChange: onChangeFromProps, ...context }: EditableDateCellProps<T>): JSX.Element;
|
|
248
266
|
|
|
249
267
|
interface Option {
|
|
250
268
|
label: string;
|
|
251
269
|
value: string;
|
|
252
270
|
}
|
|
253
|
-
interface EditableDropdownSingleCellProps<T extends FormMeta> extends
|
|
271
|
+
interface EditableDropdownSingleCellProps<T extends FormMeta> extends Omit<EditableCellBaseProps<T, unknown>, 'onChange'> {
|
|
254
272
|
/**
|
|
255
273
|
* `Option.value` is used internally to get and update selection state. `Option.label` is *only* for visual purposes.
|
|
256
274
|
*/
|
|
257
275
|
options: Option[];
|
|
276
|
+
onChange?: (value: Option) => void;
|
|
258
277
|
}
|
|
259
|
-
declare function EditableDropdownSingleCell<T extends FormMeta>(
|
|
278
|
+
declare function EditableDropdownSingleCell<T extends FormMeta>({ options, error: errorFromProps, onChange: onChangeFromProps, ...context }: EditableDropdownSingleCellProps<T>): JSX.Element;
|
|
260
279
|
|
|
261
|
-
declare function EditableNumberCell<T extends FormMeta>(context:
|
|
280
|
+
declare function EditableNumberCell<T extends FormMeta>({ error: errorFromProps, ...context }: EditableCellBaseProps<T, number>): JSX.Element;
|
|
262
281
|
|
|
263
|
-
interface EdtiableTextAreaProps<T extends FormMeta> extends
|
|
282
|
+
interface EdtiableTextAreaProps<T extends FormMeta> extends EditableCellBaseProps<T, string> {
|
|
264
283
|
title: string;
|
|
265
284
|
}
|
|
266
|
-
declare function EditableTextAreaCell<T extends FormMeta>(
|
|
285
|
+
declare function EditableTextAreaCell<T extends FormMeta>({ title, error: errorFromProps, onChange: onChangeFromProps, ...context }: EdtiableTextAreaProps<T>): JSX.Element;
|
|
267
286
|
|
|
268
|
-
declare function EditableTextFieldCell<T extends FormMeta>(context:
|
|
287
|
+
declare function EditableTextFieldCell<T extends FormMeta>({ error: errorFromProps, ...context }: EditableCellBaseProps<T, string>): JSX.Element;
|
|
269
288
|
|
|
270
289
|
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 };
|