@nulogy/components 13.1.1 → 13.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.
|
@@ -3,6 +3,7 @@ import Select from "react-select/base";
|
|
|
3
3
|
import { PropsValue } from "react-select";
|
|
4
4
|
import type { GroupBase, Props, StylesConfig } from "react-select";
|
|
5
5
|
import { StyledProps } from "../StyledProps";
|
|
6
|
+
import { CustomOnChangeValue } from "./lib";
|
|
6
7
|
export type NDSOptionValue = string | number | boolean | null;
|
|
7
8
|
export interface NDSOption {
|
|
8
9
|
label: ReactNode;
|
|
@@ -22,7 +23,7 @@ interface CustomProps<Option extends NDSOption, IsMulti extends boolean, Group e
|
|
|
22
23
|
defaultValue?: PropsValue<Option["value"]>;
|
|
23
24
|
value?: PropsValue<Option["value"]>;
|
|
24
25
|
options: readonly Option[];
|
|
25
|
-
onChange?: (newValue:
|
|
26
|
+
onChange?: (newValue: CustomOnChangeValue<IsMulti>) => void;
|
|
26
27
|
windowThreshold?: number;
|
|
27
28
|
styles?: (selectStyles: StylesConfig<Option, IsMulti, Group>) => StylesConfig<Option, IsMulti, Group>;
|
|
28
29
|
}
|
package/dist/src/Select/lib.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Options, PropsValue } from "react-select";
|
|
1
|
+
import { OnChangeValue, Options, PropsValue } from "react-select";
|
|
2
2
|
import { NDSOption, NDSOptionValue } from "./Select";
|
|
3
3
|
export declare function calcOptionsLength(options: any): any;
|
|
4
4
|
export declare function flattenGroupedChildren(children: any): any;
|
|
@@ -17,4 +17,5 @@ export declare function createGetHeight({ groupHeadingStyles, noOptionsMsgStyles
|
|
|
17
17
|
export declare function checkOptionsAreValid(options: Options<NDSOption>): void;
|
|
18
18
|
export declare function getOption(options: Options<NDSOption>, value: PropsValue<NDSOptionValue>): any;
|
|
19
19
|
export declare function getReactSelectValue(options: Options<NDSOption>, input: PropsValue<NDSOptionValue>): any;
|
|
20
|
-
export
|
|
20
|
+
export type CustomOnChangeValue<IsMulti extends boolean> = IsMulti extends true ? NDSOptionValue[] : NDSOptionValue;
|
|
21
|
+
export declare function extractValue<IsMulti extends boolean>(options: OnChangeValue<NDSOption, IsMulti>, isMulti: IsMulti): CustomOnChangeValue<IsMulti>;
|