@ceed/cds 1.2.0-next.3 → 1.2.0-next.4

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.
@@ -17,18 +17,18 @@ type OptionType = {
17
17
  label: string;
18
18
  value: string | number;
19
19
  } | string | number;
20
- interface CeedSelectProps<OptionValue extends OptionType, Multiple extends boolean = false, InferredValue = OptionValue extends {
20
+ type InferOptionValue<OptionValue> = OptionValue extends {
21
21
  value: infer V;
22
- } ? V : OptionValue> extends Omit<ComponentProps<typeof JoySelect<OptionValue, any, Multiple>>, "value"> {
22
+ } ? V : OptionValue;
23
+ interface CeedSelectProps<OptionValue extends OptionType, Multiple extends boolean = false> extends Omit<ComponentProps<typeof JoySelect<OptionValue, any, Multiple>>, "value" | "onChange"> {
23
24
  options: OptionValue[];
24
25
  label?: string;
25
26
  helperText?: string;
26
27
  error?: boolean;
27
- value?: SelectValue<InferredValue, Multiple>;
28
+ value?: SelectValue<InferOptionValue<OptionValue>, Multiple>;
29
+ onChange?: (event: React.MouseEvent | React.KeyboardEvent | React.FocusEvent | null, newValue: InferOptionValue<OptionValue>) => void;
28
30
  }
29
- declare function Select<OptionValue extends OptionType, Multiple extends boolean = false, InferredValue = OptionValue extends {
30
- value: infer V;
31
- } ? V : OptionValue>(props: CeedSelectProps<OptionValue, Multiple>): React.JSX.Element;
31
+ declare function Select<OptionValue extends OptionType, Multiple extends boolean = false>(props: CeedSelectProps<OptionValue, Multiple>): React.JSX.Element;
32
32
  declare namespace Select {
33
33
  var displayName: string;
34
34
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ceed/cds",
3
- "version": "1.2.0-next.3",
3
+ "version": "1.2.0-next.4",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",