@commercetools-uikit/creatable-select-input 19.9.0 → 19.10.0

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.
@@ -244,7 +244,7 @@ CreatableSelectInput.ValueContainer = reactSelect.components.ValueContainer;
244
244
  var CreatableSelectInput$1 = CreatableSelectInput;
245
245
 
246
246
  // NOTE: This string will be replaced on build time with the package version.
247
- var version = "19.9.0";
247
+ var version = "19.10.0";
248
248
 
249
249
  exports["default"] = CreatableSelectInput$1;
250
250
  exports.version = version;
@@ -220,7 +220,7 @@ CreatableSelectInput.ValueContainer = reactSelect.components.ValueContainer;
220
220
  var CreatableSelectInput$1 = CreatableSelectInput;
221
221
 
222
222
  // NOTE: This string will be replaced on build time with the package version.
223
- var version = "19.9.0";
223
+ var version = "19.10.0";
224
224
 
225
225
  exports["default"] = CreatableSelectInput$1;
226
226
  exports.version = version;
@@ -225,6 +225,6 @@ CreatableSelectInput.ValueContainer = components.ValueContainer;
225
225
  var CreatableSelectInput$1 = CreatableSelectInput;
226
226
 
227
227
  // NOTE: This string will be replaced on build time with the package version.
228
- var version = "19.9.0";
228
+ var version = "19.10.0";
229
229
 
230
230
  export { CreatableSelectInput$1 as default, version };
@@ -18,57 +18,266 @@ type TCustomEvent = {
18
18
  };
19
19
  type ReactSelectCreatableProps = CreatableProps<unknown, boolean, GroupBase<unknown>>;
20
20
  export type TCreatableSelectInputProps = {
21
+ /**
22
+ * Horizontal size limit of the input fields.
23
+ */
21
24
  horizontalConstraint?: 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 'scale' | 'auto';
25
+ /**
26
+ * Indicates the input field has an error
27
+ */
22
28
  hasError?: boolean;
29
+ /**
30
+ * Indicates the input field has a warning
31
+ */
23
32
  hasWarning?: boolean;
33
+ /**
34
+ * Disables the select input as it is read-only
35
+ */
24
36
  isReadOnly?: boolean;
37
+ /**
38
+ * Icon to display on the left of the placeholder text and selected value. Has no effect when `isMulti` is enabled.
39
+ */
25
40
  iconLeft?: ReactNode;
41
+ /**
42
+ * Aria label (for assistive tech)
43
+ * <br>
44
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
45
+ */
26
46
  'aria-label'?: ReactSelectCreatableProps['aria-label'];
47
+ /**
48
+ * HTML ID of an element that should be used as the label (for assistive tech)
49
+ * <br>
50
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
51
+ */
27
52
  'aria-labelledby'?: ReactSelectCreatableProps['aria-labelledby'];
53
+ /**
54
+ * Indicate if the value entered in the input is invalid.
55
+ * <br>
56
+ * [Props from React select was used](https://react-select.com/props)
57
+ */
28
58
  'aria-invalid'?: ReactSelectCreatableProps['aria-invalid'];
59
+ /**
60
+ * HTML ID of an element containing an error message related to the input.
61
+ * <br>
62
+ * [Props from React select was used](https://react-select.com/props)
63
+ */
29
64
  'aria-errormessage'?: ReactSelectCreatableProps['aria-errormessage'];
65
+ /**
66
+ * Focus the control when it is mounted
67
+ */
30
68
  isAutofocussed?: boolean;
69
+ /**
70
+ * Remove the currently focused option when the user presses backspace
71
+ * <br>
72
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
73
+ */
31
74
  backspaceRemovesValue?: ReactSelectCreatableProps['backspaceRemovesValue'];
75
+ /**
76
+ * Map of components to overwrite the default ones, see [what components you can override](https://react-select.com/components)
77
+ * <br>
78
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
79
+ */
32
80
  components?: ReactSelectCreatableProps['components'];
81
+ /**
82
+ * Custom method to filter whether an option should be displayed in the menu
83
+ * <br>
84
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
85
+ */
33
86
  filterOption?: ReactSelectCreatableProps['filterOption'];
87
+ /**
88
+ * The id of the search input
89
+ * <br>
90
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
91
+ */
34
92
  id?: ReactSelectCreatableProps['inputId'];
93
+ /**
94
+ * The value of the search input
95
+ * <br>
96
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
97
+ */
35
98
  inputValue?: ReactSelectCreatableProps['inputValue'];
99
+ /**
100
+ * The id to set on the SelectContainer component
101
+ * <br>
102
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
103
+ */
36
104
  containerId?: ReactSelectCreatableProps['id'];
105
+ /**
106
+ * Is the select value clearable
107
+ * <br>
108
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
109
+ */
37
110
  isClearable?: ReactSelectCreatableProps['isClearable'];
111
+ /**
112
+ * Is the select disabled
113
+ * <br>
114
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
115
+ */
38
116
  isDisabled?: ReactSelectCreatableProps['isDisabled'];
117
+ /**
118
+ * Override the built-in logic to detect whether an option is disabled
119
+ * <br>
120
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
121
+ */
39
122
  isOptionDisabled?: ReactSelectCreatableProps['isOptionDisabled'];
123
+ /**
124
+ * Support multiple selected options
125
+ * <br>
126
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
127
+ */
40
128
  isMulti?: ReactSelectCreatableProps['isMulti'];
129
+ /**
130
+ * Whether to enable search functionality
131
+ * <br>
132
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
133
+ */
41
134
  isSearchable?: ReactSelectCreatableProps['isSearchable'];
135
+ /**
136
+ * Maximum height of the menu before scrolling
137
+ * <br>
138
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
139
+ */
42
140
  maxMenuHeight?: ReactSelectCreatableProps['maxMenuHeight'];
141
+ /**
142
+ * Dom element to portal the select menu to
143
+ * <br>
144
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
145
+ */
43
146
  menuPortalTarget?: ReactSelectCreatableProps['menuPortalTarget'];
147
+ /**
148
+ * z-index value for the menu portal
149
+ * <br>
150
+ * Use in conjunction with `menuPortalTarget`
151
+ */
44
152
  menuPortalZIndex: number;
153
+ /**
154
+ * whether the menu should block scroll while open
155
+ * <br>
156
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
157
+ */
45
158
  menuShouldBlockScroll?: ReactSelectCreatableProps['menuShouldBlockScroll'];
159
+ /**
160
+ * Whether the menu should close after a value is selected. Defaults to `true`.
161
+ * <br>
162
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
163
+ */
46
164
  closeMenuOnSelect?: ReactSelectCreatableProps['closeMenuOnSelect'];
165
+ /**
166
+ * Name of the HTML Input (optional - without this, no input will be rendered)
167
+ * <br>
168
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
169
+ */
47
170
  name?: ReactSelectCreatableProps['name'];
171
+ /**
172
+ * Can be used to render a custom value when there are no options (either because of no search results, or all options have been used, or there were none in the first place). Gets called with `{ inputValue: String }`. `inputValue` will be an empty string when no search text is present.
173
+ * <br>
174
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
175
+ */
48
176
  noOptionsMessage?: ReactSelectCreatableProps['noOptionsMessage'];
177
+ /**
178
+ * Handle blur events on the control
179
+ */
49
180
  onBlur?: (event: TCustomEvent) => void;
181
+ /**
182
+ * Called with a fake event when value changes. The event's `target.name` will be the `name` supplied in props. The event's `target.value` will hold the value. The value will be the selected option, or an array of options in case `isMulti` is `true`.
183
+ */
50
184
  onChange?: (event: TCustomEvent, info: ActionMeta<unknown>) => void;
185
+ /**
186
+ * Handle focus events on the control
187
+ * <br>
188
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
189
+ */
51
190
  onFocus?: ReactSelectCreatableProps['onFocus'];
191
+ /**
192
+ * Handle change events on the input
193
+ * <br>
194
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
195
+ */
52
196
  onInputChange?: ReactSelectCreatableProps['onInputChange'];
197
+ /**
198
+ * Array of options that populate the select menu
199
+ */
53
200
  options?: TOptions;
201
+ /**
202
+ * Determines if option groups will be separated by a divider
203
+ */
54
204
  showOptionGroupDivider?: boolean;
205
+ /**
206
+ * Placeholder text for the select value
207
+ * <br>
208
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
209
+ */
55
210
  placeholder?: ReactSelectCreatableProps['placeholder'];
211
+ /**
212
+ * Use this property to reduce the paddings of the component for a ui compact variant
213
+ */
56
214
  isCondensed?: boolean;
215
+ /**
216
+ * Sets the tabIndex attribute on the input
217
+ * <br>
218
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
219
+ */
57
220
  tabIndex?: ReactSelectCreatableProps['tabIndex'];
221
+ /**
222
+ * Select the currently focused option when the user presses tab
223
+ * <br>
224
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
225
+ */
58
226
  tabSelectsValue?: ReactSelectCreatableProps['tabSelectsValue'];
227
+ /**
228
+ * The value of the select; reflected by the selected option
229
+ * <br>
230
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
231
+ */
59
232
  value?: ReactSelectCreatableProps['value'];
233
+ /**
234
+ * Allow options to be created while the isLoading prop is true. Useful to prevent the "create new ..." option being displayed while async results are still being loaded.
235
+ * <br>
236
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
237
+ */
60
238
  allowCreateWhileLoading?: ReactSelectCreatableProps['allowCreateWhileLoading'];
239
+ /**
240
+ * Gets the label for the "create new ..." option in the menu. Is given the current input value.
241
+ * <br>
242
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
243
+ */
61
244
  formatCreateLabel?: ReactSelectCreatableProps['formatCreateLabel'];
245
+ /**
246
+ * Determines whether the "create new ..." option should be displayed based on the current input value, select value and options array.
247
+ * <br>
248
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
249
+ */
62
250
  isValidNewOption?: ReactSelectCreatableProps['isValidNewOption'];
251
+ /**
252
+ * Returns the data for the new option when it is created. Used to display the value, and is passed to onChange.
253
+ * <br>
254
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
255
+ */
63
256
  getNewOptionData?: ReactSelectCreatableProps['getNewOptionData'];
257
+ /**
258
+ * If provided, this will be called with the input value when a new option is created, and onChange will not be called. Use this when you need more control over what happens when new options are created.
259
+ * <br>
260
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
261
+ */
64
262
  onCreateOption?: ReactSelectCreatableProps['onCreateOption'];
263
+ /**
264
+ * Sets the position of the createOption element in your options list.
265
+ * <br>
266
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
267
+ */
65
268
  createOptionPosition?: ReactSelectCreatableProps['createOptionPosition'];
66
269
  };
67
270
  declare const CreatableSelectInput: {
68
271
  (props: TCreatableSelectInputProps): import("@emotion/react/jsx-runtime").JSX.Element;
69
272
  displayName: string;
70
273
  defaultProps: Pick<TCreatableSelectInputProps, "value" | "isSearchable" | "menuPortalZIndex">;
274
+ /**
275
+ * Expose static helper methods.
276
+ */
71
277
  isTouched(touched: unknown): boolean;
278
+ /**
279
+ * Expose react-select components for customization purposes.
280
+ */
72
281
  ClearIndicator: {
73
282
  (props: import("@commercetools-uikit/select-utils").TClearIndicatorProps): import("@emotion/react/jsx-runtime").JSX.Element;
74
283
  displayName: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@commercetools-uikit/creatable-select-input",
3
3
  "description": "An input component getting a selection from the user, and where options can also be created by the user.",
4
- "version": "19.9.0",
4
+ "version": "19.10.0",
5
5
  "bugs": "https://github.com/commercetools/ui-kit/issues",
6
6
  "repository": {
7
7
  "type": "git",
@@ -21,13 +21,13 @@
21
21
  "dependencies": {
22
22
  "@babel/runtime": "^7.20.13",
23
23
  "@babel/runtime-corejs3": "^7.20.13",
24
- "@commercetools-uikit/constraints": "19.9.0",
25
- "@commercetools-uikit/design-system": "19.9.0",
26
- "@commercetools-uikit/icons": "19.9.0",
27
- "@commercetools-uikit/select-utils": "19.9.0",
28
- "@commercetools-uikit/spacings": "19.9.0",
29
- "@commercetools-uikit/text": "19.9.0",
30
- "@commercetools-uikit/utils": "19.9.0",
24
+ "@commercetools-uikit/constraints": "19.10.0",
25
+ "@commercetools-uikit/design-system": "19.10.0",
26
+ "@commercetools-uikit/icons": "19.10.0",
27
+ "@commercetools-uikit/select-utils": "19.10.0",
28
+ "@commercetools-uikit/spacings": "19.10.0",
29
+ "@commercetools-uikit/text": "19.10.0",
30
+ "@commercetools-uikit/utils": "19.10.0",
31
31
  "@emotion/react": "^11.10.5",
32
32
  "@emotion/styled": "^11.10.5",
33
33
  "lodash": "4.17.21",