gantri-components 2.119.0-beta.1 → 2.119.0-beta.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/components/button-menu/button-menu.d.ts +1 -1
- package/dist/components/button-menu/button-menu.types.d.ts +1 -1
- package/dist/components/dropdown/dropdown.types.d.ts +1 -1
- package/dist/components/dropdown-menu/dropdown-menu.presets.d.ts +1 -1
- package/dist/components/dropdown-menu/dropdown-menu.types.d.ts +18 -9
- package/dist/components/dropdown-menu/index.d.ts +1 -0
- package/dist/components/radio/radio.types.d.ts +1 -0
- package/dist/components/radio-list/radio-list.d.ts +1 -2
- package/dist/components/radio-list/radio-list.styles.d.ts +5 -2
- package/dist/components/radio-list/radio-list.types.d.ts +4 -6
- package/dist/components/search-field/search-field.types.d.ts +6 -6
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
|
@@ -2,5 +2,5 @@ import React from 'react';
|
|
|
2
2
|
import { ButtonMenuProps } from './button-menu.types';
|
|
3
3
|
export declare const ButtonMenu: {
|
|
4
4
|
<T extends Record<any, any>>(props: ButtonMenuProps<T>): React.JSX.Element;
|
|
5
|
-
defaultProps:
|
|
5
|
+
defaultProps: any;
|
|
6
6
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DropdownMenuProps } from '../dropdown-menu/dropdown-menu.types';
|
|
2
2
|
import { ButtonVariant } from '../button/button.types';
|
|
3
|
-
export interface ButtonMenuProps<T
|
|
3
|
+
export interface ButtonMenuProps<T extends Record<string, unknown>> extends DropdownMenuProps<T> {
|
|
4
4
|
active?: boolean;
|
|
5
5
|
buttonClassName?: string;
|
|
6
6
|
buttonVariant?: ButtonVariant;
|
|
@@ -6,7 +6,7 @@ import { Maybe } from '../../global';
|
|
|
6
6
|
import { ResolutionAwareProp } from '../../types/resolution-aware-prop.type';
|
|
7
7
|
import { TextVariant } from '../typography';
|
|
8
8
|
export type DropdownVariant = 'inline' | 'external';
|
|
9
|
-
export interface DropdownProps<T
|
|
9
|
+
export interface DropdownProps<T extends Record<string, unknown>> extends Omit<DropdownMenuProps<T>, 'items'> {
|
|
10
10
|
borderless?: boolean;
|
|
11
11
|
className?: string;
|
|
12
12
|
disabled?: boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { DropdownMenuProps } from './dropdown-menu.types';
|
|
2
|
-
export declare const DropdownMenuPresets: Partial<DropdownMenuProps
|
|
2
|
+
export declare const DropdownMenuPresets: Partial<DropdownMenuProps<Record<string, unknown>>>;
|
|
@@ -2,32 +2,41 @@ import { Property } from 'csstype';
|
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { Maybe } from '../../global';
|
|
4
4
|
import { Color } from '../../styles';
|
|
5
|
-
|
|
5
|
+
import { TooltipProps } from '../tooltip/tooltip.types';
|
|
6
|
+
export interface DropdownMenuProps<T extends DropdownMenuItem<Record<string, unknown>>> {
|
|
6
7
|
autoSelectFirst?: boolean;
|
|
7
8
|
borderColor?: Color;
|
|
8
9
|
className?: string;
|
|
9
10
|
header?: ReactNode;
|
|
10
|
-
idProperty?: keyof T
|
|
11
|
+
idProperty?: keyof DropdownMenuItem<T>;
|
|
11
12
|
/** Can optionally include `disabled: true` to any index to disable that item. */
|
|
12
|
-
items: T[];
|
|
13
|
+
items: DropdownMenuItem<T>[];
|
|
13
14
|
/** Sets the alignment of the dropdown items. */
|
|
14
15
|
justifyContent?: Property.JustifyContent;
|
|
15
16
|
keepOpenAfterSelection?: boolean;
|
|
16
|
-
keyProperty?: (item?: T) => string;
|
|
17
|
-
labelProperty?: keyof T | ((item?: T) => string);
|
|
18
|
-
labelPropertyTx?: (item?: T) => string;
|
|
17
|
+
keyProperty?: (item?: DropdownMenuItem<T>) => string;
|
|
18
|
+
labelProperty?: keyof T | ((item?: DropdownMenuItem<T>) => string);
|
|
19
|
+
labelPropertyTx?: (item?: DropdownMenuItem<T>) => string;
|
|
19
20
|
maxHeight?: Property.MaxHeight<string | number>;
|
|
20
21
|
noShadow?: boolean;
|
|
21
22
|
onKeyDown?: (event: KeyboardEvent) => void;
|
|
22
23
|
onPreselectedIndexChange?: (index: number) => void;
|
|
23
24
|
onSelect?: (item: T | null) => void;
|
|
24
25
|
/** `item` should contain `isHeading: true` */
|
|
25
|
-
renderHeading?: (item: T
|
|
26
|
-
renderItem?: (item: T) => Maybe<ReactNode>;
|
|
26
|
+
renderHeading?: (item: DropdownMenuItem<T>, index: number) => Maybe<ReactNode>;
|
|
27
|
+
renderItem?: (item: DropdownMenuItem<T>) => Maybe<ReactNode>;
|
|
27
28
|
searchType?: 'startsWith' | 'contains' | 'endsWith';
|
|
28
29
|
searchable?: boolean;
|
|
29
30
|
/** Optionally provide to highlight multiple items as selected. */
|
|
30
|
-
selectedItems?: T[];
|
|
31
|
+
selectedItems?: DropdownMenuItem<T>[];
|
|
31
32
|
value?: string | number;
|
|
32
33
|
width?: Property.Width<string | number>;
|
|
33
34
|
}
|
|
35
|
+
export type DropdownMenuItem<T extends Record<string, unknown>> = T & {
|
|
36
|
+
disabled?: boolean;
|
|
37
|
+
disabledTooltipProps?: Partial<TooltipProps>;
|
|
38
|
+
};
|
|
39
|
+
export type DefaultMenuItemKeys = {
|
|
40
|
+
label: string;
|
|
41
|
+
value: number | string;
|
|
42
|
+
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { RadioListProps
|
|
2
|
+
import { RadioListProps } from './radio-list.types';
|
|
3
3
|
export declare const RadioList: {
|
|
4
4
|
<Value extends string>(props: RadioListProps<Value>): React.JSX.Element;
|
|
5
5
|
defaultProps: import("./radio-list.types").RadioListDefaultProps<string | Record<any, any>>;
|
|
6
6
|
};
|
|
7
|
-
export declare const RadioTile: RadioWrapperComponent;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
export declare const
|
|
2
|
+
import { RadioTileProps } from './radio-list.types';
|
|
3
|
+
export declare const StyledRadioTile: import("styled-components").StyledComponent<{
|
|
4
|
+
(props: import("../radio/radio.types").RadioProps): import("react").JSX.Element;
|
|
5
|
+
defaultProps: import("../radio/radio.types").RadioProps;
|
|
6
|
+
}, import("styled-components").DefaultTheme, RadioTileProps, never>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { JSXElementConstructor, PropsWithChildren } from 'react';
|
|
2
1
|
import { ResolutionAwareProp } from '../../types/resolution-aware-prop.type';
|
|
3
2
|
import { CellProps } from '../cell/cell.types';
|
|
4
3
|
import { GridProps } from '../grid/grid.types';
|
|
@@ -11,18 +10,17 @@ export interface RadioListProps<Value extends string> extends Partial<RadioListD
|
|
|
11
10
|
};
|
|
12
11
|
items: (Value | RadioItem)[];
|
|
13
12
|
onSelected: (value: Value) => void | Promise<void>;
|
|
13
|
+
showAsTiles?: boolean;
|
|
14
14
|
value: Value;
|
|
15
15
|
}
|
|
16
16
|
export interface RadioListDefaultProps<Value extends string | Record<any, any>> {
|
|
17
|
-
Component: RadioWrapperComponent;
|
|
18
17
|
idProperty: Value extends string ? string : keyof Value;
|
|
19
18
|
labelProperty: Value extends string ? string : keyof Value;
|
|
20
19
|
}
|
|
21
20
|
export type RadioItem = {
|
|
22
21
|
disabled?: boolean;
|
|
23
22
|
} & Record<any, any>;
|
|
24
|
-
export
|
|
25
|
-
export type RadioWrapperComponentProps = {
|
|
23
|
+
export interface RadioTileProps extends RadioProps {
|
|
26
24
|
isChecked: boolean | undefined;
|
|
27
|
-
|
|
28
|
-
}
|
|
25
|
+
showAsTiles: boolean | undefined;
|
|
26
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { CSSProperties, FocusEvent, ReactElement } from 'react';
|
|
2
2
|
import { Property } from 'csstype';
|
|
3
|
-
import { DropdownMenuProps } from '../dropdown-menu/dropdown-menu.types';
|
|
3
|
+
import { DropdownMenuItem, DropdownMenuProps } from '../dropdown-menu/dropdown-menu.types';
|
|
4
4
|
import { ErrorMessageType, TextFieldSize } from '../text-field';
|
|
5
5
|
import { BlurChangeEvent, DropdownChangeEvent } from '../dropdown';
|
|
6
6
|
import { Maybe } from '../../global';
|
|
7
7
|
import { ResolutionAwareProp } from '../../types/resolution-aware-prop.type';
|
|
8
8
|
import { TextVariant } from '../typography';
|
|
9
|
-
export interface SearchFieldProps<T
|
|
9
|
+
export interface SearchFieldProps<T extends DropdownMenuItem<Record<string, unknown>>> extends Omit<DropdownMenuProps<T>, 'items'> {
|
|
10
10
|
borderless?: boolean;
|
|
11
11
|
className?: string;
|
|
12
12
|
clearButtonText?: string;
|
|
@@ -18,8 +18,8 @@ export interface SearchFieldProps<T = Record<string, unknown>> extends Omit<Drop
|
|
|
18
18
|
hideErrors?: boolean;
|
|
19
19
|
icon?: ReactElement;
|
|
20
20
|
/** Can optionally include `disabled: true` to any index to disable that item. */
|
|
21
|
-
items?: T[];
|
|
22
|
-
keyProperty?: (option?: T) => string;
|
|
21
|
+
items?: DropdownMenuItem<T>[];
|
|
22
|
+
keyProperty?: (option?: DropdownMenuItem<T>) => string;
|
|
23
23
|
labelPosition?: 'top' | 'left';
|
|
24
24
|
labelText?: string;
|
|
25
25
|
labelTx?: string;
|
|
@@ -31,7 +31,7 @@ export interface SearchFieldProps<T = Record<string, unknown>> extends Omit<Drop
|
|
|
31
31
|
minSearchLength?: number;
|
|
32
32
|
name?: string;
|
|
33
33
|
onBlur?: (event: BlurChangeEvent) => void;
|
|
34
|
-
onChange?: (event: DropdownChangeEvent<T
|
|
34
|
+
onChange?: (event: DropdownChangeEvent<DropdownMenuItem<T>> | DropdownChangeEvent<T[keyof T][]>) => void;
|
|
35
35
|
onFocus?: (event: FocusEvent<HTMLDivElement>) => void;
|
|
36
36
|
onOpen?: () => void;
|
|
37
37
|
onTextChange?: (value: string) => void;
|
|
@@ -43,7 +43,7 @@ export interface SearchFieldProps<T = Record<string, unknown>> extends Omit<Drop
|
|
|
43
43
|
processing?: boolean;
|
|
44
44
|
processingText?: string;
|
|
45
45
|
processingTx?: string;
|
|
46
|
-
renderPlaceholder?: (option?: T) => Maybe<JSX.Element>;
|
|
46
|
+
renderPlaceholder?: (option?: DropdownMenuItem<T>) => Maybe<JSX.Element>;
|
|
47
47
|
required?: boolean;
|
|
48
48
|
resetSelectionOnDisabled?: boolean;
|
|
49
49
|
/**
|