@dfds-ui/forms 2.0.22 → 2.0.23

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.
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import Select, { ActionMeta, createFilter, GroupBase, OptionsOrGroups, SingleValue } from 'react-select';
2
+ import Select, { ActionMeta, createFilter, GroupBase, MultiValue, OptionsOrGroups, SingleValue } from 'react-select';
3
3
  import { BaseFieldProps } from '../types';
4
4
  export declare type BaseReactSelectProps = Omit<React.PropsWithRef<Select>, 'size' | 'css'>;
5
5
  export declare type Size = 'small' | 'medium' | 'large';
@@ -36,21 +36,22 @@ export declare type SelectFieldProps<T = string> = BaseFieldProps & {
36
36
  * Setting this to true will display a small dismiss cross when a value is selected
37
37
  */
38
38
  isClearable?: boolean;
39
+ isMulti?: boolean;
39
40
  isSearchable?: boolean;
40
41
  menuIsOpen?: boolean;
41
42
  menuPlacement?: 'bottom' | 'auto' | 'top';
42
43
  onBlur?: (value: any) => void;
43
- onChange?: (newValue: SingleValue<T>, actionMeta: ActionMeta<T>) => void;
44
- onSelect?: (value: SingleValue<T>) => void;
44
+ onChange?: (newValue: SingleValue<T> | MultiValue<T>, actionMeta: ActionMeta<T>) => void;
45
+ onSelect?: (value: SingleValue<T> | MultiValue<T>) => void;
45
46
  options?: OptionsOrGroups<T, GroupBase<T>>;
46
47
  placeholder?: string;
47
48
  prefix?: React.ReactNode;
48
49
  styles?: any;
49
50
  suffix?: React.ReactNode;
50
- value?: SingleValue<T>;
51
+ value?: SingleValue<T> | MultiValue<T>;
51
52
  visualSize?: Size;
52
53
  };
53
- declare function SelectFieldInner<T>({ assistiveText, components, defaultValue, disabled, errorMessage, filterConfig, help, helpPlacement, hideAsterisk, isClearable, isSearchable, label, name, onBlur, onChange, onSelect, options, placeholder, required, styles, value, visualSize, ...rest }: SelectFieldProps<T>, ref: React.ForwardedRef<any>): JSX.Element;
54
+ declare function SelectFieldInner<T>({ assistiveText, components, defaultValue, disabled, errorMessage, filterConfig, help, helpPlacement, hideAsterisk, isClearable, isMulti, isSearchable, label, name, onBlur, onChange, onSelect, options, placeholder, required, styles, value, visualSize, ...rest }: SelectFieldProps<T>, ref: React.ForwardedRef<any>): JSX.Element;
54
55
  export declare const SelectField: <T>(props: BaseFieldProps & {
55
56
  assistiveText?: string | undefined;
56
57
  autoFocus?: boolean | undefined;
@@ -74,18 +75,19 @@ export declare const SelectField: <T>(props: BaseFieldProps & {
74
75
  * Setting this to true will display a small dismiss cross when a value is selected
75
76
  */
76
77
  isClearable?: boolean | undefined;
78
+ isMulti?: boolean | undefined;
77
79
  isSearchable?: boolean | undefined;
78
80
  menuIsOpen?: boolean | undefined;
79
81
  menuPlacement?: "auto" | "top" | "bottom" | undefined;
80
82
  onBlur?: ((value: any) => void) | undefined;
81
- onChange?: ((newValue: SingleValue<T>, actionMeta: ActionMeta<T>) => void) | undefined;
82
- onSelect?: ((value: SingleValue<T>) => void) | undefined;
83
+ onChange?: ((newValue: SingleValue<T> | MultiValue<T>, actionMeta: ActionMeta<T>) => void) | undefined;
84
+ onSelect?: ((value: SingleValue<T> | MultiValue<T>) => void) | undefined;
83
85
  options?: OptionsOrGroups<T, GroupBase<T>> | undefined;
84
86
  placeholder?: string | undefined;
85
87
  prefix?: React.ReactNode;
86
88
  styles?: any;
87
89
  suffix?: React.ReactNode;
88
- value?: SingleValue<T> | undefined;
90
+ value?: SingleValue<T> | MultiValue<T> | undefined;
89
91
  visualSize?: Size | undefined;
90
92
  } & {
91
93
  ref?: React.ForwardedRef<any> | undefined;