@equinor/apollo-components 3.1.1 → 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 +17 -31
- package/dist/index.js +248 -5658
- package/dist/index.mjs +229 -5654
- package/package.json +3 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,41 +1,13 @@
|
|
|
1
|
-
export * from 'apollo-common';
|
|
2
1
|
import { IconData } from '@equinor/eds-icons';
|
|
3
2
|
import * as react from 'react';
|
|
4
|
-
import { ReactNode, ReactElement, HTMLProps, MutableRefObject, Dispatch, SetStateAction } from 'react';
|
|
3
|
+
import { ReactNode, ReactElement, HTMLProps, MutableRefObject, Dispatch, SetStateAction, SyntheticEvent } from 'react';
|
|
5
4
|
import * as styled_components from 'styled-components';
|
|
6
5
|
import * as _equinor_eds_core_react from '@equinor/eds-core-react';
|
|
7
|
-
import { CellProps } from '@equinor/eds-core-react';
|
|
6
|
+
import { CellProps, TypographyProps as TypographyProps$1 } from '@equinor/eds-core-react';
|
|
8
7
|
import { Cell, Header, CellContext, Table, Row, SortingState, OnChangeFn, ColumnDef, RowSelectionState, ExpandedState, VisibilityState, HeaderContext } from '@tanstack/react-table';
|
|
9
8
|
import { ColumnDef as ColumnDef$1 } from '@tanstack/table-core';
|
|
10
9
|
import { SetRequired } from 'type-fest';
|
|
11
10
|
|
|
12
|
-
declare type FormMeta = {
|
|
13
|
-
_isNew?: boolean;
|
|
14
|
-
_editMode?: boolean;
|
|
15
|
-
_hasRemoteChange?: boolean;
|
|
16
|
-
};
|
|
17
|
-
declare type WithoutFormMeta<T extends FormMeta> = Omit<T, keyof FormMeta>;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Subscribes to the `_editMode` field in a `react-hook-form` context.
|
|
21
|
-
*
|
|
22
|
-
* @returns edit mode value
|
|
23
|
-
*/
|
|
24
|
-
declare function useEditMode(): boolean;
|
|
25
|
-
/**
|
|
26
|
-
* Subscribes to the `_hasRemoteChange` field in a `react-hook-form` context.
|
|
27
|
-
*
|
|
28
|
-
* @returns edit mode value
|
|
29
|
-
*/
|
|
30
|
-
declare function useHasRemoteChange(): boolean;
|
|
31
|
-
/**
|
|
32
|
-
* @returns function getting is new meta
|
|
33
|
-
*/
|
|
34
|
-
declare function useGetIsNew(): () => boolean;
|
|
35
|
-
declare function useSetFormMeta<T extends FormMeta>(): (newValues: Partial<T>) => void;
|
|
36
|
-
declare function removeFormMeta<T extends FormMeta>(withFormMeta: T): Omit<T, keyof FormMeta>;
|
|
37
|
-
declare function addFormMeta<T>(withoutFormMeta: T): T & FormMeta;
|
|
38
|
-
|
|
39
11
|
interface AppShellProps {
|
|
40
12
|
children?: ReactNode;
|
|
41
13
|
sidebar?: ReactNode;
|
|
@@ -73,6 +45,13 @@ declare type HierarchyCellOptions = {
|
|
|
73
45
|
};
|
|
74
46
|
declare function HierarchyCell<T>(cell: CellContext<T, any>, options?: HierarchyCellOptions): JSX.Element;
|
|
75
47
|
|
|
48
|
+
interface PopoverCellProps {
|
|
49
|
+
id: string;
|
|
50
|
+
value: string;
|
|
51
|
+
title?: string | JSX.Element | ReactNode;
|
|
52
|
+
}
|
|
53
|
+
declare const PopoverCell: (props: PopoverCellProps) => JSX.Element;
|
|
54
|
+
|
|
76
55
|
interface ColumnSelectProps<T> {
|
|
77
56
|
table: Table<T>;
|
|
78
57
|
}
|
|
@@ -211,6 +190,11 @@ declare const leftCellShadow: styled_components.FlattenSimpleInterpolation;
|
|
|
211
190
|
declare const StickyCell: styled_components.StyledComponent<react.ForwardRefExoticComponent<CellProps & react.RefAttributes<HTMLTableCellElement>>, any, {} & CellProps, never>;
|
|
212
191
|
declare const StickyHeaderCell: styled_components.StyledComponent<react.ForwardRefExoticComponent<CellProps & react.RefAttributes<HTMLTableCellElement>>, any, ({} & CellProps) & CellProps, never>;
|
|
213
192
|
|
|
193
|
+
declare type TypographyProps = {
|
|
194
|
+
truncate?: boolean;
|
|
195
|
+
} & TypographyProps$1;
|
|
196
|
+
declare const TypographyCustom: (props: TypographyProps) => JSX.Element;
|
|
197
|
+
|
|
214
198
|
/**
|
|
215
199
|
* Generate a HSL color based on a given string.
|
|
216
200
|
*
|
|
@@ -218,5 +202,7 @@ declare const StickyHeaderCell: styled_components.StyledComponent<react.ForwardR
|
|
|
218
202
|
* @returns A valid hsl color
|
|
219
203
|
*/
|
|
220
204
|
declare function stringToHslColor(str: string, s?: number, l?: number): string;
|
|
205
|
+
/** Wrap an event handler and stop event propagation */
|
|
206
|
+
declare function stopPropagation<T extends HTMLElement>(handler: (e: SyntheticEvent<T>) => void): (e: SyntheticEvent<T>) => void;
|
|
221
207
|
|
|
222
|
-
export { AppShell, AppSidebar, CellConfig, ChipsCell, ColumnSelect, DataTable, DataTableProps, DynamicCell,
|
|
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 };
|