@true-engineering/true-react-common-ui-kit 1.0.1 → 1.1.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/LICENSE +1 -1
- package/dist/components/Modal/Modal.d.ts +1 -1
- package/dist/components/MoreMenu/MoreMenu.d.ts +2 -2
- package/dist/components/MoreMenu/MoreMenu.styles.d.ts +1 -0
- package/dist/components/Select/Select.d.ts +8 -7
- package/dist/components/Select/SelectList/SelectList.d.ts +3 -3
- package/dist/components/Select/helpers.d.ts +2 -2
- package/dist/true-react-common-ui-kit.js +315 -224
- package/dist/true-react-common-ui-kit.js.map +1 -1
- package/dist/true-react-common-ui-kit.umd.cjs +318 -227
- package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/List/List.tsx +9 -2
- package/src/components/Modal/Modal.tsx +1 -1
- package/src/components/MoreMenu/MoreMenu.styles.ts +2 -0
- package/src/components/MoreMenu/MoreMenu.tsx +35 -24
- package/src/components/Select/Select.tsx +21 -13
- package/src/components/Select/SelectList/SelectList.tsx +8 -6
- package/src/components/Select/helpers.ts +9 -6
- package/src/components/SmartInput/SmartInput.tsx +130 -127
- package/src/types.ts +1 -1
package/LICENSE
CHANGED
|
@@ -186,7 +186,7 @@ APPENDIX: How to apply the Apache License to your work.
|
|
|
186
186
|
same "printed page" as the copyright notice for easier
|
|
187
187
|
identification within third-party archives.
|
|
188
188
|
|
|
189
|
-
Copyright
|
|
189
|
+
Copyright 2023 ООО «Тру Инжиниринг»
|
|
190
190
|
|
|
191
191
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
192
|
you may not use this file except in compliance with the License.
|
|
@@ -4,7 +4,7 @@ import { ModalStyles } from './Modal.styles';
|
|
|
4
4
|
export declare type IModalPosition = 'center' | 'left' | 'right' | 'static';
|
|
5
5
|
export interface IModalProps extends ICommonProps {
|
|
6
6
|
tweakStyles?: ModalStyles;
|
|
7
|
-
title?:
|
|
7
|
+
title?: ReactNode;
|
|
8
8
|
size?: 'l' | 'm' | 's';
|
|
9
9
|
isFooterSticky?: boolean;
|
|
10
10
|
buttons?: ReactNode[];
|
|
@@ -6,9 +6,9 @@ export interface IMoreMenuProps extends ICommonProps {
|
|
|
6
6
|
tweakStyles?: MoreMenuStyles;
|
|
7
7
|
items: IListItem[];
|
|
8
8
|
isDisabled?: boolean;
|
|
9
|
-
onMenuOpen?: () => void;
|
|
10
|
-
onMenuClose?: () => void;
|
|
11
9
|
hasDefaultStateBackground?: boolean;
|
|
12
10
|
testId?: string;
|
|
11
|
+
onMenuOpen?(): void;
|
|
12
|
+
onMenuClose?(): void;
|
|
13
13
|
}
|
|
14
14
|
export declare const MoreMenu: FC<IMoreMenuProps>;
|
|
@@ -17,11 +17,12 @@ export interface ISelectProps<Value> extends Omit<IInputProps, 'value' | 'onChan
|
|
|
17
17
|
onOpen?: () => void;
|
|
18
18
|
optionsFilter?: (options: Value[], query: string) => Value[];
|
|
19
19
|
options: Value[];
|
|
20
|
-
value
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
value: Value | undefined;
|
|
21
|
+
shouldScrollToList?: boolean;
|
|
22
|
+
onChange(value: Value | undefined): void;
|
|
23
|
+
compareValuesOnChange?(v1: Value | undefined, v2: Value | undefined): boolean;
|
|
24
|
+
convertValueToString?(value: Value): string | undefined;
|
|
25
|
+
convertValueToReactNode?(value: Value): ReactNode;
|
|
26
|
+
convertValueToId?(value: Value): string | undefined;
|
|
26
27
|
}
|
|
27
|
-
export declare function Select<Value>({ options, value, onChange, compareValuesOnChange, convertValueToString, convertValueToId, convertValueToReactNode, defaultOptionLabel, onFocus, onBlur, onType, onOpen, debounceTime, optionsMode, optionsFilter, noMatchesLabel, loadingLabel, tweakStyles, testId, isDisabled, dropdownOptions, minSymbolsCountToOpenList, dropdownIcon, ...inputProps }: ISelectProps<Value>): JSX.Element;
|
|
28
|
+
export declare function Select<Value>({ options, value, onChange, compareValuesOnChange, convertValueToString, convertValueToId, convertValueToReactNode, defaultOptionLabel, onFocus, onBlur, onType, onOpen, debounceTime, optionsMode, optionsFilter, noMatchesLabel, loadingLabel, tweakStyles, testId, isDisabled, dropdownOptions, minSymbolsCountToOpenList, dropdownIcon, shouldScrollToList, ...inputProps }: ISelectProps<Value>): JSX.Element;
|
|
@@ -13,9 +13,9 @@ export interface ISelectListProps<Value> extends ICommonProps {
|
|
|
13
13
|
onOptionClick: (index: number) => void;
|
|
14
14
|
testId?: string;
|
|
15
15
|
shouldScrollToList?: boolean;
|
|
16
|
-
convertValueToString: (value
|
|
17
|
-
convertValueToReactNode?: (value
|
|
18
|
-
convertValueToId?: (value
|
|
16
|
+
convertValueToString: (value: Value) => string | undefined;
|
|
17
|
+
convertValueToReactNode?: (value: Value) => ReactNode;
|
|
18
|
+
convertValueToId?: (value: Value) => string | undefined;
|
|
19
19
|
}
|
|
20
20
|
export declare function isOptionDisabled<Value>(option: Value): boolean;
|
|
21
21
|
export declare function SelectList<Value>({ options, onOptionClick, focusedIndex, activeValue, defaultOptionLabel, noMatchesLabel, isLoading, loadingLabel, convertValueToString, convertValueToReactNode, convertValueToId, tweakStyles, testId, shouldScrollToList, }: ISelectListProps<Value>): JSX.Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const defaultConvertFunction: (v: unknown) => string | undefined;
|
|
2
|
-
export declare const defaultCompareFunction: <Value>(v1: Value
|
|
3
|
-
export declare const getActiveValueIndex: <Value>(options: Value[], value: Value | undefined, convertFunc: (v
|
|
2
|
+
export declare const defaultCompareFunction: <Value>(v1: Value, v2: Value) => boolean;
|
|
3
|
+
export declare const getActiveValueIndex: <Value>(options: Value[], value: Value | undefined, convertFunc: (v: Value) => string | undefined) => number;
|