@dfds-ui/react-select 2.2.1 → 3.0.0-alpha.24ead756

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,19 +1,20 @@
1
1
  import React from 'react';
2
2
  import Select, { createFilter, GroupBase, OptionsOrGroups, SingleValue } from 'react-select';
3
3
  import { BaseFieldProps } from '@dfds-ui/forms/types';
4
- export declare type BaseReactSelectProps = Omit<React.PropsWithRef<Select>, 'size' | 'css'>;
5
- export declare type Size = 'small' | 'medium' | 'large';
4
+ export type BaseReactSelectProps = Omit<React.PropsWithRef<Select>, 'size' | 'css'>;
5
+ export type Size = 'small' | 'medium' | 'large';
6
6
  export declare const ReactSelectWrapper: import("@emotion/styled").StyledComponent<{
7
- theme?: import("@emotion/react").Theme | undefined;
8
- as?: React.ElementType<any> | undefined;
7
+ theme?: import("@emotion/react").Theme;
8
+ as?: React.ElementType;
9
9
  } & {
10
- error?: boolean | undefined;
11
- size?: string | undefined;
12
- arrow?: boolean | undefined;
13
- selected?: boolean | undefined;
10
+ error?: boolean;
11
+ size?: string;
12
+ arrow?: boolean;
13
+ selected?: boolean;
14
14
  }, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
15
- export declare const Menu: (props: any) => JSX.Element;
16
- export declare type SelectFieldProps<T> = BaseFieldProps & {
15
+ export declare const Menu: (props: any) => React.JSX.Element;
16
+ export type SelectFieldProps<T> = BaseFieldProps & {
17
+ ref?: React.Ref<any>;
17
18
  defaultValue?: SingleValue<T>;
18
19
  className?: string;
19
20
  components?: any;
@@ -39,32 +40,8 @@ export declare type SelectFieldProps<T> = BaseFieldProps & {
39
40
  */
40
41
  filterConfig?: Parameters<typeof createFilter>[0];
41
42
  };
43
+ declare function ReactSelectInner<T>({ name, label, defaultValue, value, placeholder, onSelect, onChange, isSearchable, onBlur, assistiveText, options, errorMessage, disabled, visualSize, filterConfig, ...rest }: SelectFieldProps<T>): React.JSX.Element;
42
44
  /** @deprecated Use dfds-ui/forms */
43
- export declare const ReactSelect: React.ForwardRefExoticComponent<BaseFieldProps & {
44
- defaultValue?: unknown;
45
- className?: string | undefined;
46
- components?: any;
47
- value?: unknown;
48
- visualSize?: Size | undefined;
49
- options?: OptionsOrGroups<unknown, GroupBase<unknown>> | undefined;
50
- isSearchable?: boolean | undefined;
51
- onSelect?: ((value: unknown) => void) | undefined;
52
- onChange?: ((value: unknown) => void) | undefined;
53
- onBlur?: ((value: any) => void) | undefined;
54
- menuIsOpen?: boolean | undefined;
55
- placeholder?: string | undefined;
56
- assistiveText?: string | undefined;
57
- errorMessage?: string | undefined;
58
- /**
59
- * Configuration object passed to react-select createFilter function to create [custom filter
60
- * logic](https://react-select.com/advanced#custom-filter-logic)
61
- * @param ignoreCase - boolean (optional)
62
- * @param ignoreAccents - boolean (optional)
63
- * @param stringify (obj: any) => string (optional)
64
- * @param trim - boolean (optional)
65
- * @param matchForm - 'any' | 'start'
66
- */
67
- filterConfig?: Parameters<typeof createFilter>[0];
68
- } & React.RefAttributes<any>>;
45
+ export declare const ReactSelect: typeof ReactSelectInner;
69
46
  /** @deprecated Use dfds-ui/forms */
70
47
  export default ReactSelect;