@dfds-ui/forms 2.2.0-alpha.98e68873 → 2.2.0-alpha.9bb1ab0f
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.
- package/assistive-text/AssistiveText.d.ts +1 -1
- package/asterisk/Asterisk.d.ts +1 -1
- package/checkbox/Checkbox.d.ts +4 -4
- package/checkbox/Checkbox.js +7 -7
- package/checkbox/CheckboxContext.d.ts +3 -3
- package/checkbox/CheckboxGroup.d.ts +1 -1
- package/cjs/assistive-text/AssistiveText.d.ts +1 -1
- package/cjs/asterisk/Asterisk.d.ts +1 -1
- package/cjs/checkbox/Checkbox.d.ts +4 -4
- package/cjs/checkbox/Checkbox.js +7 -7
- package/cjs/checkbox/CheckboxContext.d.ts +3 -3
- package/cjs/checkbox/CheckboxGroup.d.ts +1 -1
- package/cjs/counter/Counter.d.ts +2 -2
- package/cjs/enhanced/EnhancedField.d.ts +3 -3
- package/cjs/error-text/ErrorText.d.ts +1 -1
- package/cjs/field-wrap/FieldWrap.d.ts +1 -1
- package/cjs/help-icon/HelpIcon.d.ts +1 -1
- package/cjs/label/Label.d.ts +1 -1
- package/cjs/password-field/PasswordField.d.ts +1 -1
- package/cjs/radio/Radio.d.ts +4 -4
- package/cjs/radio/Radio.js +7 -7
- package/cjs/radio/RadioContext.d.ts +3 -3
- package/cjs/radio/RadioGroup.d.ts +1 -1
- package/cjs/rating/Rating.d.ts +3 -3
- package/cjs/select-field/AsyncSelectField.d.ts +4 -100
- package/cjs/select-field/CreatableSelectField.d.ts +4 -133
- package/cjs/select-field/NativeSelectField.d.ts +1 -1
- package/cjs/select-field/SelectField.d.ts +11 -48
- package/cjs/switch/Switch.d.ts +2 -2
- package/cjs/switch/Switch.js +12 -12
- package/cjs/switch/SwitchContext.d.ts +3 -3
- package/cjs/switch/SwitchGroup.d.ts +1 -1
- package/cjs/tel-field/TelField.d.ts +9 -9
- package/cjs/text-field/TextField.d.ts +18 -18
- package/cjs/textarea-field/TextareaField.d.ts +10 -10
- package/cjs/types/field.d.ts +1 -1
- package/cjs/types/size.d.ts +1 -1
- package/counter/Counter.d.ts +2 -2
- package/enhanced/EnhancedField.d.ts +3 -3
- package/error-text/ErrorText.d.ts +1 -1
- package/field-wrap/FieldWrap.d.ts +1 -1
- package/help-icon/HelpIcon.d.ts +1 -1
- package/label/Label.d.ts +1 -1
- package/package.json +8 -8
- package/password-field/PasswordField.d.ts +1 -1
- package/radio/Radio.d.ts +4 -4
- package/radio/Radio.js +7 -7
- package/radio/RadioContext.d.ts +3 -3
- package/radio/RadioGroup.d.ts +1 -1
- package/rating/Rating.d.ts +3 -3
- package/select-field/AsyncSelectField.d.ts +4 -100
- package/select-field/CreatableSelectField.d.ts +4 -133
- package/select-field/NativeSelectField.d.ts +1 -1
- package/select-field/SelectField.d.ts +11 -48
- package/switch/Switch.d.ts +2 -2
- package/switch/Switch.js +16 -16
- package/switch/SwitchContext.d.ts +3 -3
- package/switch/SwitchGroup.d.ts +1 -1
- package/tel-field/TelField.d.ts +9 -9
- package/text-field/TextField.d.ts +18 -18
- package/textarea-field/TextareaField.d.ts +10 -10
- package/types/field.d.ts +1 -1
- package/types/size.d.ts +1 -1
|
@@ -2,110 +2,14 @@ import React from 'react';
|
|
|
2
2
|
import { GroupBase } from 'react-select';
|
|
3
3
|
import { AsyncProps } from 'react-select/async';
|
|
4
4
|
import { BaseFieldProps } from '../types';
|
|
5
|
-
|
|
6
|
-
export
|
|
5
|
+
type Size = 'small' | 'medium' | 'large';
|
|
6
|
+
export type AsyncSelectFieldProps<Option, IsMulti extends boolean, Group extends GroupBase<Option>> = BaseFieldProps & AsyncProps<Option, IsMulti, Group> & {
|
|
7
7
|
isClearable?: boolean;
|
|
8
8
|
value?: any;
|
|
9
9
|
visualSize?: Size;
|
|
10
10
|
};
|
|
11
11
|
declare const AsyncSelectFieldInner: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>({ assistiveText, components, disabled, errorMessage, help, helpPlacement, hideAsterisk, isClearable, label, name, onBlur, onChange, required, visualSize, ...rest }: AsyncSelectFieldProps<Option, IsMulti, Group>, ref: React.ForwardedRef<any>) => React.JSX.Element;
|
|
12
|
-
export declare const AsyncSelectField: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>(props:
|
|
13
|
-
|
|
14
|
-
'aria-live'?: "off" | "assertive" | "polite" | undefined;
|
|
15
|
-
placeholder?: React.ReactNode;
|
|
16
|
-
backspaceRemovesValue?: boolean | undefined;
|
|
17
|
-
blurInputOnSelect?: boolean | undefined;
|
|
18
|
-
captureMenuScroll?: boolean | undefined;
|
|
19
|
-
classNames?: import("react-select").ClassNamesConfig<Option, IsMulti, Group> | undefined;
|
|
20
|
-
closeMenuOnSelect?: boolean | undefined;
|
|
21
|
-
closeMenuOnScroll?: boolean | ((event: Event) => boolean) | undefined;
|
|
22
|
-
components?: Partial<import("react-select/dist/declarations/src/components").SelectComponents<Option, IsMulti, Group>> | undefined;
|
|
23
|
-
controlShouldRenderValue?: boolean | undefined;
|
|
24
|
-
escapeClearsValue?: boolean | undefined;
|
|
25
|
-
filterOption?: ((option: import("react-select").FilterOptionOption<Option>, inputValue: string) => boolean) | null | undefined;
|
|
26
|
-
formatGroupLabel?: ((group: Group) => React.ReactNode) | undefined;
|
|
27
|
-
getOptionLabel?: import("react-select").GetOptionLabel<Option> | undefined;
|
|
28
|
-
getOptionValue?: import("react-select").GetOptionValue<Option> | undefined;
|
|
29
|
-
isDisabled?: boolean | undefined;
|
|
30
|
-
isLoading?: boolean | undefined;
|
|
31
|
-
isOptionDisabled?: ((option: Option, selectValue: import("react-select").Options<Option>) => boolean) | undefined;
|
|
32
|
-
isMulti?: IsMulti | undefined;
|
|
33
|
-
isRtl?: boolean | undefined;
|
|
34
|
-
isSearchable?: boolean | undefined;
|
|
35
|
-
loadingMessage?: ((obj: {
|
|
36
|
-
inputValue: string;
|
|
37
|
-
}) => React.ReactNode) | undefined;
|
|
38
|
-
minMenuHeight?: number | undefined;
|
|
39
|
-
maxMenuHeight?: number | undefined;
|
|
40
|
-
menuIsOpen?: boolean | undefined;
|
|
41
|
-
menuPlacement?: import("react-select").MenuPlacement | undefined;
|
|
42
|
-
menuPosition?: import("react-select").MenuPosition | undefined;
|
|
43
|
-
menuShouldBlockScroll?: boolean | undefined;
|
|
44
|
-
menuShouldScrollIntoView?: boolean | undefined;
|
|
45
|
-
noOptionsMessage?: ((obj: {
|
|
46
|
-
inputValue: string;
|
|
47
|
-
}) => React.ReactNode) | undefined;
|
|
48
|
-
openMenuOnFocus?: boolean | undefined;
|
|
49
|
-
openMenuOnClick?: boolean | undefined;
|
|
50
|
-
options?: import("react-select").OptionsOrGroups<Option, Group> | undefined;
|
|
51
|
-
pageSize?: number | undefined;
|
|
52
|
-
screenReaderStatus?: ((obj: {
|
|
53
|
-
count: number;
|
|
54
|
-
}) => string) | undefined;
|
|
55
|
-
styles?: import("react-select").StylesConfig<Option, IsMulti, Group> | undefined;
|
|
56
|
-
tabSelectsValue?: boolean | undefined;
|
|
57
|
-
unstyled?: boolean | undefined;
|
|
58
|
-
} & {}, "value" | "onChange" | "inputValue" | "menuIsOpen" | "onInputChange" | "onMenuOpen" | "onMenuClose"> & Partial<Pick<import("react-select/dist/declarations/src/Select").Props<Option, IsMulti, Group>, "id" | "className" | "value" | "form" | "required" | "autoFocus" | "aria-errormessage" | "aria-invalid" | "aria-label" | "aria-labelledby" | "onFocus" | "onBlur" | "onChange" | "onKeyDown" | "theme" | "name" | "ariaLiveMessages" | "classNamePrefix" | "delimiter" | "formatOptionLabel" | "hideSelectedOptions" | "inputValue" | "inputId" | "instanceId" | "isClearable" | "isOptionSelected" | "menuPortalTarget" | "onInputChange" | "onMenuOpen" | "onMenuClose" | "onMenuScrollToTop" | "onMenuScrollToBottom"> & {
|
|
59
|
-
tabIndex?: number | undefined;
|
|
60
|
-
'aria-live'?: "off" | "assertive" | "polite" | undefined;
|
|
61
|
-
placeholder?: React.ReactNode;
|
|
62
|
-
backspaceRemovesValue?: boolean | undefined;
|
|
63
|
-
blurInputOnSelect?: boolean | undefined;
|
|
64
|
-
captureMenuScroll?: boolean | undefined;
|
|
65
|
-
classNames?: import("react-select").ClassNamesConfig<Option, IsMulti, Group> | undefined;
|
|
66
|
-
closeMenuOnSelect?: boolean | undefined;
|
|
67
|
-
closeMenuOnScroll?: boolean | ((event: Event) => boolean) | undefined;
|
|
68
|
-
components?: Partial<import("react-select/dist/declarations/src/components").SelectComponents<Option, IsMulti, Group>> | undefined;
|
|
69
|
-
controlShouldRenderValue?: boolean | undefined;
|
|
70
|
-
escapeClearsValue?: boolean | undefined;
|
|
71
|
-
filterOption?: ((option: import("react-select").FilterOptionOption<Option>, inputValue: string) => boolean) | null | undefined;
|
|
72
|
-
formatGroupLabel?: ((group: Group) => React.ReactNode) | undefined;
|
|
73
|
-
getOptionLabel?: import("react-select").GetOptionLabel<Option> | undefined;
|
|
74
|
-
getOptionValue?: import("react-select").GetOptionValue<Option> | undefined;
|
|
75
|
-
isDisabled?: boolean | undefined;
|
|
76
|
-
isLoading?: boolean | undefined;
|
|
77
|
-
isOptionDisabled?: ((option: Option, selectValue: import("react-select").Options<Option>) => boolean) | undefined;
|
|
78
|
-
isMulti?: IsMulti | undefined;
|
|
79
|
-
isRtl?: boolean | undefined;
|
|
80
|
-
isSearchable?: boolean | undefined;
|
|
81
|
-
loadingMessage?: ((obj: {
|
|
82
|
-
inputValue: string;
|
|
83
|
-
}) => React.ReactNode) | undefined;
|
|
84
|
-
minMenuHeight?: number | undefined;
|
|
85
|
-
maxMenuHeight?: number | undefined;
|
|
86
|
-
menuIsOpen?: boolean | undefined;
|
|
87
|
-
menuPlacement?: import("react-select").MenuPlacement | undefined;
|
|
88
|
-
menuPosition?: import("react-select").MenuPosition | undefined;
|
|
89
|
-
menuShouldBlockScroll?: boolean | undefined;
|
|
90
|
-
menuShouldScrollIntoView?: boolean | undefined;
|
|
91
|
-
noOptionsMessage?: ((obj: {
|
|
92
|
-
inputValue: string;
|
|
93
|
-
}) => React.ReactNode) | undefined;
|
|
94
|
-
openMenuOnFocus?: boolean | undefined;
|
|
95
|
-
openMenuOnClick?: boolean | undefined;
|
|
96
|
-
options?: import("react-select").OptionsOrGroups<Option, Group> | undefined;
|
|
97
|
-
pageSize?: number | undefined;
|
|
98
|
-
screenReaderStatus?: ((obj: {
|
|
99
|
-
count: number;
|
|
100
|
-
}) => string) | undefined;
|
|
101
|
-
styles?: import("react-select").StylesConfig<Option, IsMulti, Group> | undefined;
|
|
102
|
-
tabSelectsValue?: boolean | undefined;
|
|
103
|
-
unstyled?: boolean | undefined;
|
|
104
|
-
} & {}> & import("react-select/dist/declarations/src/useStateManager").StateManagerAdditionalProps<Option> & import("react-select/dist/declarations/src/useAsync").AsyncAdditionalProps<Option, Group> & {
|
|
105
|
-
isClearable?: boolean | undefined;
|
|
106
|
-
value?: any;
|
|
107
|
-
visualSize?: Size | undefined;
|
|
108
|
-
} & {
|
|
109
|
-
ref?: React.ForwardedRef<any> | undefined;
|
|
12
|
+
export declare const AsyncSelectField: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>(props: AsyncSelectFieldProps<Option, IsMulti, Group> & {
|
|
13
|
+
ref?: React.ForwardedRef<any>;
|
|
110
14
|
}) => ReturnType<typeof AsyncSelectFieldInner>;
|
|
111
15
|
export default AsyncSelectField;
|
|
@@ -2,8 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import { CreatableProps } from 'react-select/creatable';
|
|
3
3
|
import { ActionMeta, createFilter, GroupBase, MultiValue, OptionsOrGroups, SingleValue } from 'react-select';
|
|
4
4
|
import { BaseFieldProps } from '../types';
|
|
5
|
-
|
|
6
|
-
export
|
|
5
|
+
type Size = 'small' | 'medium' | 'large';
|
|
6
|
+
export type CreatableSelectFieldProps<Option, IsMulti extends boolean, Group extends GroupBase<Option>> = BaseFieldProps & CreatableProps<Option, IsMulti, Group> & {
|
|
7
7
|
assistiveText?: string;
|
|
8
8
|
autoFocus?: boolean;
|
|
9
9
|
className?: string;
|
|
@@ -42,136 +42,7 @@ export declare type CreatableSelectFieldProps<Option, IsMulti extends boolean, G
|
|
|
42
42
|
visualSize?: Size;
|
|
43
43
|
};
|
|
44
44
|
declare const CreatableSelectFieldInner: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>({ assistiveText, components, defaultValue, disabled, errorMessage, filterConfig, help, helpPlacement, hideAsterisk, isClearable, isMulti, isSearchable, label, name, onBlur, onChange, onSelect, options, placeholder, required, styles, value, visualSize, ...rest }: CreatableSelectFieldProps<Option, IsMulti, Group>, ref: React.ForwardedRef<any>) => React.JSX.Element;
|
|
45
|
-
export declare const CreatableSelectField: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>(props:
|
|
46
|
-
|
|
47
|
-
'aria-live'?: "off" | "assertive" | "polite" | undefined;
|
|
48
|
-
placeholder?: React.ReactNode;
|
|
49
|
-
backspaceRemovesValue?: boolean | undefined;
|
|
50
|
-
blurInputOnSelect?: boolean | undefined;
|
|
51
|
-
captureMenuScroll?: boolean | undefined;
|
|
52
|
-
classNames?: import("react-select").ClassNamesConfig<Option, IsMulti, Group> | undefined;
|
|
53
|
-
closeMenuOnSelect?: boolean | undefined;
|
|
54
|
-
closeMenuOnScroll?: boolean | ((event: Event) => boolean) | undefined;
|
|
55
|
-
components?: Partial<import("react-select/dist/declarations/src/components").SelectComponents<Option, IsMulti, Group>> | undefined;
|
|
56
|
-
controlShouldRenderValue?: boolean | undefined;
|
|
57
|
-
escapeClearsValue?: boolean | undefined;
|
|
58
|
-
filterOption?: ((option: import("react-select").FilterOptionOption<Option>, inputValue: string) => boolean) | null | undefined;
|
|
59
|
-
formatGroupLabel?: ((group: Group) => React.ReactNode) | undefined;
|
|
60
|
-
getOptionLabel?: import("react-select").GetOptionLabel<Option> | undefined;
|
|
61
|
-
getOptionValue?: import("react-select").GetOptionValue<Option> | undefined;
|
|
62
|
-
isDisabled?: boolean | undefined;
|
|
63
|
-
isLoading?: boolean | undefined;
|
|
64
|
-
isOptionDisabled?: ((option: Option, selectValue: import("react-select").Options<Option>) => boolean) | undefined;
|
|
65
|
-
isMulti?: IsMulti | undefined;
|
|
66
|
-
isRtl?: boolean | undefined;
|
|
67
|
-
isSearchable?: boolean | undefined;
|
|
68
|
-
loadingMessage?: ((obj: {
|
|
69
|
-
inputValue: string;
|
|
70
|
-
}) => React.ReactNode) | undefined;
|
|
71
|
-
minMenuHeight?: number | undefined;
|
|
72
|
-
maxMenuHeight?: number | undefined;
|
|
73
|
-
menuIsOpen?: boolean | undefined;
|
|
74
|
-
menuPlacement?: import("react-select").MenuPlacement | undefined;
|
|
75
|
-
menuPosition?: import("react-select").MenuPosition | undefined;
|
|
76
|
-
menuShouldBlockScroll?: boolean | undefined;
|
|
77
|
-
menuShouldScrollIntoView?: boolean | undefined;
|
|
78
|
-
noOptionsMessage?: ((obj: {
|
|
79
|
-
inputValue: string;
|
|
80
|
-
}) => React.ReactNode) | undefined;
|
|
81
|
-
openMenuOnFocus?: boolean | undefined;
|
|
82
|
-
openMenuOnClick?: boolean | undefined;
|
|
83
|
-
options?: OptionsOrGroups<Option, Group> | undefined;
|
|
84
|
-
pageSize?: number | undefined;
|
|
85
|
-
screenReaderStatus?: ((obj: {
|
|
86
|
-
count: number;
|
|
87
|
-
}) => string) | undefined;
|
|
88
|
-
styles?: import("react-select").StylesConfig<Option, IsMulti, Group> | undefined;
|
|
89
|
-
tabSelectsValue?: boolean | undefined;
|
|
90
|
-
unstyled?: boolean | undefined;
|
|
91
|
-
} & {}, "value" | "onChange" | "inputValue" | "menuIsOpen" | "onInputChange" | "onMenuOpen" | "onMenuClose"> & Partial<Pick<import("react-select/dist/declarations/src/Select").Props<Option, IsMulti, Group>, "id" | "className" | "value" | "form" | "required" | "autoFocus" | "aria-errormessage" | "aria-invalid" | "aria-label" | "aria-labelledby" | "onFocus" | "onBlur" | "onChange" | "onKeyDown" | "theme" | "name" | "ariaLiveMessages" | "classNamePrefix" | "delimiter" | "formatOptionLabel" | "hideSelectedOptions" | "inputValue" | "inputId" | "instanceId" | "isClearable" | "isOptionSelected" | "menuPortalTarget" | "onInputChange" | "onMenuOpen" | "onMenuClose" | "onMenuScrollToTop" | "onMenuScrollToBottom"> & {
|
|
92
|
-
tabIndex?: number | undefined;
|
|
93
|
-
'aria-live'?: "off" | "assertive" | "polite" | undefined;
|
|
94
|
-
placeholder?: React.ReactNode;
|
|
95
|
-
backspaceRemovesValue?: boolean | undefined;
|
|
96
|
-
blurInputOnSelect?: boolean | undefined;
|
|
97
|
-
captureMenuScroll?: boolean | undefined;
|
|
98
|
-
classNames?: import("react-select").ClassNamesConfig<Option, IsMulti, Group> | undefined;
|
|
99
|
-
closeMenuOnSelect?: boolean | undefined;
|
|
100
|
-
closeMenuOnScroll?: boolean | ((event: Event) => boolean) | undefined;
|
|
101
|
-
components?: Partial<import("react-select/dist/declarations/src/components").SelectComponents<Option, IsMulti, Group>> | undefined;
|
|
102
|
-
controlShouldRenderValue?: boolean | undefined;
|
|
103
|
-
escapeClearsValue?: boolean | undefined;
|
|
104
|
-
filterOption?: ((option: import("react-select").FilterOptionOption<Option>, inputValue: string) => boolean) | null | undefined;
|
|
105
|
-
formatGroupLabel?: ((group: Group) => React.ReactNode) | undefined;
|
|
106
|
-
getOptionLabel?: import("react-select").GetOptionLabel<Option> | undefined;
|
|
107
|
-
getOptionValue?: import("react-select").GetOptionValue<Option> | undefined;
|
|
108
|
-
isDisabled?: boolean | undefined;
|
|
109
|
-
isLoading?: boolean | undefined;
|
|
110
|
-
isOptionDisabled?: ((option: Option, selectValue: import("react-select").Options<Option>) => boolean) | undefined;
|
|
111
|
-
isMulti?: IsMulti | undefined;
|
|
112
|
-
isRtl?: boolean | undefined;
|
|
113
|
-
isSearchable?: boolean | undefined;
|
|
114
|
-
loadingMessage?: ((obj: {
|
|
115
|
-
inputValue: string;
|
|
116
|
-
}) => React.ReactNode) | undefined;
|
|
117
|
-
minMenuHeight?: number | undefined;
|
|
118
|
-
maxMenuHeight?: number | undefined;
|
|
119
|
-
menuIsOpen?: boolean | undefined;
|
|
120
|
-
menuPlacement?: import("react-select").MenuPlacement | undefined;
|
|
121
|
-
menuPosition?: import("react-select").MenuPosition | undefined;
|
|
122
|
-
menuShouldBlockScroll?: boolean | undefined;
|
|
123
|
-
menuShouldScrollIntoView?: boolean | undefined;
|
|
124
|
-
noOptionsMessage?: ((obj: {
|
|
125
|
-
inputValue: string;
|
|
126
|
-
}) => React.ReactNode) | undefined;
|
|
127
|
-
openMenuOnFocus?: boolean | undefined;
|
|
128
|
-
openMenuOnClick?: boolean | undefined;
|
|
129
|
-
options?: OptionsOrGroups<Option, Group> | undefined;
|
|
130
|
-
pageSize?: number | undefined;
|
|
131
|
-
screenReaderStatus?: ((obj: {
|
|
132
|
-
count: number;
|
|
133
|
-
}) => string) | undefined;
|
|
134
|
-
styles?: import("react-select").StylesConfig<Option, IsMulti, Group> | undefined;
|
|
135
|
-
tabSelectsValue?: boolean | undefined;
|
|
136
|
-
unstyled?: boolean | undefined;
|
|
137
|
-
} & {}> & import("react-select/dist/declarations/src/useStateManager").StateManagerAdditionalProps<Option> & import("react-select/dist/declarations/src/useCreatable").CreatableAdditionalProps<Option, Group> & {
|
|
138
|
-
assistiveText?: string | undefined;
|
|
139
|
-
autoFocus?: boolean | undefined;
|
|
140
|
-
className?: string | undefined;
|
|
141
|
-
components?: any;
|
|
142
|
-
defaultValue?: SingleValue<Option> | undefined;
|
|
143
|
-
errorMessage?: string | undefined;
|
|
144
|
-
/**
|
|
145
|
-
* Configuration object passed to react-select createFilter function to create [custom filter
|
|
146
|
-
* logic](https://react-select.com/advanced#custom-filter-logic)
|
|
147
|
-
* @param ignoreCase - boolean (optional)
|
|
148
|
-
* @param ignoreAccents - boolean (optional)
|
|
149
|
-
* @param stringify (obj: any) => string (optional)
|
|
150
|
-
* @param trim - boolean (optional)
|
|
151
|
-
* @param matchForm - 'any' | 'start'
|
|
152
|
-
*/
|
|
153
|
-
filterConfig?: Parameters<typeof createFilter>[0];
|
|
154
|
-
/**
|
|
155
|
-
* Indicates that the Select can be cleared after selecting an Option.
|
|
156
|
-
*
|
|
157
|
-
* Setting this to true will display a small dismiss cross when a value is selected
|
|
158
|
-
*/
|
|
159
|
-
isClearable?: boolean | undefined;
|
|
160
|
-
isMulti?: boolean | undefined;
|
|
161
|
-
isSearchable?: boolean | undefined;
|
|
162
|
-
menuIsOpen?: boolean | undefined;
|
|
163
|
-
menuPlacement?: "top" | "bottom" | "auto" | undefined;
|
|
164
|
-
onBlur?: ((value: any) => void) | undefined;
|
|
165
|
-
onChange?: ((newValue: MultiValue<Option> | SingleValue<Option>, actionMeta: ActionMeta<Option>) => void) | undefined;
|
|
166
|
-
onSelect?: ((value: MultiValue<Option> | SingleValue<Option>) => void) | undefined;
|
|
167
|
-
options?: OptionsOrGroups<Option, GroupBase<Option>> | undefined;
|
|
168
|
-
placeholder?: string | undefined;
|
|
169
|
-
prefix?: React.ReactNode;
|
|
170
|
-
styles?: any;
|
|
171
|
-
suffix?: React.ReactNode;
|
|
172
|
-
value?: MultiValue<Option> | SingleValue<Option> | undefined;
|
|
173
|
-
visualSize?: Size | undefined;
|
|
174
|
-
} & {
|
|
175
|
-
ref?: React.ForwardedRef<any> | undefined;
|
|
45
|
+
export declare const CreatableSelectField: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>(props: CreatableSelectFieldProps<Option, IsMulti, Group> & {
|
|
46
|
+
ref?: React.ForwardedRef<any>;
|
|
176
47
|
}) => ReturnType<typeof CreatableSelectFieldInner>;
|
|
177
48
|
export default CreatableSelectField;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BaseFieldProps, Size } from '../types';
|
|
3
|
-
export
|
|
3
|
+
export type NativeSelectFieldProps = BaseFieldProps & React.ComponentPropsWithRef<'select'> & {
|
|
4
4
|
className?: string;
|
|
5
5
|
visualSize?: Size;
|
|
6
6
|
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Select, { ActionMeta, createFilter, GroupBase, MultiValue, OptionsOrGroups, SingleValue } from 'react-select';
|
|
3
3
|
import { BaseFieldProps } from '../types';
|
|
4
|
-
export
|
|
5
|
-
export
|
|
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
|
|
8
|
-
as?: React.ElementType
|
|
7
|
+
theme?: import("@emotion/react").Theme;
|
|
8
|
+
as?: React.ElementType;
|
|
9
9
|
} & {
|
|
10
|
-
error?: boolean
|
|
11
|
-
size?: string
|
|
12
|
-
arrow?: boolean
|
|
13
|
-
selected?: boolean
|
|
10
|
+
error?: boolean;
|
|
11
|
+
size?: string;
|
|
12
|
+
arrow?: boolean;
|
|
13
|
+
selected?: boolean;
|
|
14
14
|
}, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
15
15
|
export declare const Menu: (props: any) => React.JSX.Element;
|
|
16
|
-
export
|
|
16
|
+
export type SelectFieldProps<T = string> = BaseFieldProps & {
|
|
17
17
|
assistiveText?: string;
|
|
18
18
|
autoFocus?: boolean;
|
|
19
19
|
className?: string;
|
|
@@ -52,44 +52,7 @@ export declare type SelectFieldProps<T = string> = BaseFieldProps & {
|
|
|
52
52
|
visualSize?: Size;
|
|
53
53
|
};
|
|
54
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>): React.JSX.Element;
|
|
55
|
-
export declare const SelectField: <T>(props:
|
|
56
|
-
|
|
57
|
-
autoFocus?: boolean | undefined;
|
|
58
|
-
className?: string | undefined;
|
|
59
|
-
components?: any;
|
|
60
|
-
defaultValue?: SingleValue<T> | undefined;
|
|
61
|
-
errorMessage?: string | undefined;
|
|
62
|
-
/**
|
|
63
|
-
* Configuration object passed to react-select createFilter function to create [custom filter
|
|
64
|
-
* logic](https://react-select.com/advanced#custom-filter-logic)
|
|
65
|
-
* @param ignoreCase - boolean (optional)
|
|
66
|
-
* @param ignoreAccents - boolean (optional)
|
|
67
|
-
* @param stringify (obj: any) => string (optional)
|
|
68
|
-
* @param trim - boolean (optional)
|
|
69
|
-
* @param matchForm - 'any' | 'start'
|
|
70
|
-
*/
|
|
71
|
-
filterConfig?: Parameters<typeof createFilter>[0];
|
|
72
|
-
/**
|
|
73
|
-
* Indicates that the Select can be cleared after selecting an Option.
|
|
74
|
-
*
|
|
75
|
-
* Setting this to true will display a small dismiss cross when a value is selected
|
|
76
|
-
*/
|
|
77
|
-
isClearable?: boolean | undefined;
|
|
78
|
-
isMulti?: boolean | undefined;
|
|
79
|
-
isSearchable?: boolean | undefined;
|
|
80
|
-
menuIsOpen?: boolean | undefined;
|
|
81
|
-
menuPlacement?: "top" | "bottom" | "auto" | undefined;
|
|
82
|
-
onBlur?: ((value: any) => void) | undefined;
|
|
83
|
-
onChange?: ((newValue: SingleValue<T> | MultiValue<T>, actionMeta: ActionMeta<T>) => void) | undefined;
|
|
84
|
-
onSelect?: ((value: SingleValue<T> | MultiValue<T>) => void) | undefined;
|
|
85
|
-
options?: OptionsOrGroups<T, GroupBase<T>> | undefined;
|
|
86
|
-
placeholder?: string | undefined;
|
|
87
|
-
prefix?: React.ReactNode;
|
|
88
|
-
styles?: any;
|
|
89
|
-
suffix?: React.ReactNode;
|
|
90
|
-
value?: SingleValue<T> | MultiValue<T> | undefined;
|
|
91
|
-
visualSize?: Size | undefined;
|
|
92
|
-
} & {
|
|
93
|
-
ref?: React.ForwardedRef<any> | undefined;
|
|
55
|
+
export declare const SelectField: <T>(props: SelectFieldProps<T> & {
|
|
56
|
+
ref?: React.ForwardedRef<any>;
|
|
94
57
|
}) => ReturnType<typeof SelectFieldInner>;
|
|
95
58
|
export default SelectField;
|
package/switch/Switch.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ChangeEvent } from 'react';
|
|
2
|
-
|
|
3
|
-
export
|
|
2
|
+
type Size = 'small' | 'medium';
|
|
3
|
+
export type SwitchProps = React.PropsWithRef<React.JSX.IntrinsicElements['label']> & {
|
|
4
4
|
/**
|
|
5
5
|
* Name of the input element
|
|
6
6
|
*/
|