@equinor/apollo-components 3.1.0 → 3.1.2

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 CHANGED
@@ -4,11 +4,9 @@ import { ReactNode, ReactElement, HTMLProps, MutableRefObject, Dispatch, SetStat
4
4
  import * as styled_components from 'styled-components';
5
5
  import * as _equinor_eds_core_react from '@equinor/eds-core-react';
6
6
  import { CellProps, TypographyProps as TypographyProps$1 } from '@equinor/eds-core-react';
7
- import { Cell, CellContext, Header, Table, Row, SortingState, OnChangeFn, ColumnDef, RowSelectionState, ExpandedState, VisibilityState, HeaderContext } from '@tanstack/react-table';
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 { Variants } from '@equinor/eds-core-react/dist/types/components/types';
11
- import { FieldError } from 'react-hook-form';
12
10
 
13
11
  interface AppShellProps {
14
12
  children?: ReactNode;
@@ -36,83 +34,6 @@ declare type StyledStickyCellProps = {
36
34
  declare const StyledStickyCell: styled_components.StyledComponent<react.ForwardRefExoticComponent<_equinor_eds_core_react.CellProps & react.RefAttributes<HTMLTableCellElement>>, any, ({} & _equinor_eds_core_react.CellProps) & StyledStickyCellProps, never>;
37
35
  declare function DynamicCell<T>({ cell, highlight, getStickyCellColor }: TableCellProps<T>): JSX.Element;
38
36
 
39
- declare type FormMeta = {
40
- _isNew?: boolean;
41
- _editMode?: boolean;
42
- _hasRemoteChange?: boolean;
43
- };
44
- declare type WithoutFormMeta<T extends FormMeta> = Omit<T, keyof FormMeta>;
45
-
46
- /**
47
- * Subscribes to the `_editMode` field in a `react-hook-form` context.
48
- *
49
- * @returns edit mode value
50
- */
51
- declare function useEditMode(): boolean;
52
- /**
53
- * Subscribes to the `_hasRemoteChange` field in a `react-hook-form` context.
54
- *
55
- * @returns edit mode value
56
- */
57
- declare function useHasRemoteChange(): boolean;
58
- /**
59
- * @returns function getting is new meta
60
- */
61
- declare function useGetIsNew(): () => boolean;
62
- declare function useSetFormMeta<T extends FormMeta>(): (newValues: Partial<T>) => void;
63
- declare function removeFormMeta<T extends FormMeta>(withFormMeta: T): Omit<T, keyof FormMeta>;
64
- declare function addFormMeta<T>(withoutFormMeta: T): T & FormMeta;
65
-
66
- declare function EditableCheckboxCell<T extends FormMeta>(context: CellContext<T, boolean>): JSX.Element;
67
-
68
- interface EditableDateCellProps<T extends FormMeta> extends CellContext<T, unknown> {
69
- dateStringFormatter?: (date: string) => string;
70
- }
71
- declare function EditableDateCell<T extends FormMeta>(props: EditableDateCellProps<T>): JSX.Element;
72
-
73
- interface Option {
74
- label: string;
75
- value: string;
76
- }
77
- interface EditableDropdownCellProps<T extends FormMeta> extends CellContext<T, unknown> {
78
- /**
79
- * `Option.value` is used internally to get and update selection state. `Option.label` is *only* for visual purposes.
80
- */
81
- options: Option[];
82
- }
83
- declare function EditableDropdownCell<T extends FormMeta>(props: EditableDropdownCellProps<T>): JSX.Element;
84
- declare const AutocompleteCustom: styled_components.StyledComponent<(<T>(props: {
85
- options: T[];
86
- label: string;
87
- initialSelectedOptions?: T[] | undefined;
88
- meta?: string | undefined;
89
- disabled?: boolean | undefined;
90
- readOnly?: boolean | undefined;
91
- hideClearButton?: boolean | undefined;
92
- selectedOptions?: T[] | undefined;
93
- onOptionsChange?: ((changes: _equinor_eds_core_react.AutocompleteChanges<T>) => void) | undefined;
94
- multiple?: boolean | undefined;
95
- optionLabel?: ((option: T) => string) | undefined;
96
- disablePortal?: boolean | undefined;
97
- optionDisabled?: ((option: T) => boolean) | undefined;
98
- optionsFilter?: ((option: T, inputValue: string) => boolean) | undefined;
99
- autoWidth?: boolean | undefined;
100
- placeholder?: string | undefined;
101
- clearSearchOnChange?: boolean | undefined;
102
- } & react.HTMLAttributes<HTMLDivElement> & {
103
- ref?: react.ForwardedRef<HTMLDivElement> | undefined;
104
- displayName?: string | undefined;
105
- }) => JSX.Element), any, {}, never>;
106
-
107
- declare function EditableNumberCell<T extends FormMeta>(context: CellContext<T, number>): JSX.Element;
108
-
109
- interface EdtiableTextAreaProps<T extends FormMeta> extends CellContext<T, string> {
110
- dialogTitle: string;
111
- }
112
- declare function EditableTextAreaCell<T extends FormMeta>(props: EdtiableTextAreaProps<T>): JSX.Element;
113
-
114
- declare function EditableTextFieldCell<T extends FormMeta>(context: CellContext<T, unknown>): JSX.Element;
115
-
116
37
  interface HeaderCellProps<TData, TValue> {
117
38
  header: Header<TData, TValue>;
118
39
  }
@@ -283,18 +204,5 @@ declare const TypographyCustom: (props: TypographyProps) => JSX.Element;
283
204
  declare function stringToHslColor(str: string, s?: number, l?: number): string;
284
205
  /** Wrap an event handler and stop event propagation */
285
206
  declare function stopPropagation<T extends HTMLElement>(handler: (e: SyntheticEvent<T>) => void): (e: SyntheticEvent<T>) => void;
286
- interface GetHelperTextPropsProps {
287
- error?: FieldError;
288
- warning?: {
289
- message: string;
290
- };
291
- helperText?: string;
292
- }
293
- interface GetHelperTextProps {
294
- variant?: Variants;
295
- helperText?: string;
296
- helperIcon: JSX.Element | null;
297
- }
298
- declare function getHelperTextProps({ error, warning, helperText, }: GetHelperTextPropsProps): GetHelperTextProps;
299
207
 
300
- export { AppShell, AppSidebar, AutocompleteCustom, CellConfig, ChipsCell, ColumnSelect, DataTable, DataTableProps, DynamicCell, EditableCheckboxCell, EditableDateCell, EditableDateCellProps, EditableDropdownCell, EditableDropdownCellProps, 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, getHelperTextProps, leftCellShadow, prependSelectColumn, removeFormMeta, stopPropagation, stringToHslColor, useEditMode, useGetIsNew, useHasRemoteChange, useSetFormMeta };
208
+ export { AppShell, AppSidebar, CellConfig, ChipsCell, ColumnSelect, DataTable, DataTableProps, DynamicCell, HTMLPropsRef, HeaderCell, HierarchyCell, InfiniteScrollConfig, PopoverCell, RowConfig, RowSelectionMode, SelectColumnDef, SortConfig, StickyCell, StickyHeaderCell, StyledStickyCell, TableHeader, TableLayout, TableRowWrapper, TableRowWrapperProps, TruncateMode, TypographyCustom, TypographyProps, capitalizeHeader, leftCellShadow, prependSelectColumn, stopPropagation, stringToHslColor };