@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: PropsValue<Option["value"]>) => void;
26
+ onChange?: (newValue: CustomOnChangeValue<IsMulti>) => void;
26
27
  windowThreshold?: number;
27
28
  styles?: (selectStyles: StylesConfig<Option, IsMulti, Group>) => StylesConfig<Option, IsMulti, Group>;
28
29
  }
@@ -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 declare function extractValue(options: Options<NDSOption> | NDSOption, isMulti: boolean): NDSOptionValue[] | NDSOptionValue;
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>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nulogy/components",
3
- "version": "13.1.1",
3
+ "version": "13.1.2",
4
4
  "description": "Component library for the Nulogy Design System - http://nulogy.design",
5
5
  "private": false,
6
6
  "publishConfig": {