ab-ui-library 1.39.0-alpha.5 → 1.39.0-alpha.7
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.
|
@@ -107,8 +107,6 @@ var MultiTextareaWithChips = function MultiTextareaWithChips(_ref) {
|
|
|
107
107
|
formProps.setFieldValue(fieldName, localChips);
|
|
108
108
|
}
|
|
109
109
|
}, [localChips, fieldName]);
|
|
110
|
-
|
|
111
|
-
// Helper function to filter options
|
|
112
110
|
var filterOptions = useCallback(function (value) {
|
|
113
111
|
if (availableOptions.length > 0) {
|
|
114
112
|
var currentChipTexts = localChips.map(function (chip) {
|
|
@@ -120,8 +118,6 @@ var MultiTextareaWithChips = function MultiTextareaWithChips(_ref) {
|
|
|
120
118
|
setFilteredOptions(filtered);
|
|
121
119
|
}
|
|
122
120
|
}, [availableOptions, localChips]);
|
|
123
|
-
|
|
124
|
-
// Handle click outside to close dropdown
|
|
125
121
|
useEffect(function () {
|
|
126
122
|
var handleClickOutside = function handleClickOutside(event) {
|
|
127
123
|
if (containerRef.current && !containerRef.current.contains(event.target)) {
|
|
@@ -185,8 +181,6 @@ var MultiTextareaWithChips = function MultiTextareaWithChips(_ref) {
|
|
|
185
181
|
var value = e.target.value;
|
|
186
182
|
setInputValue(value);
|
|
187
183
|
setSelectedOption('');
|
|
188
|
-
|
|
189
|
-
// Filter available options based on input
|
|
190
184
|
filterOptions(value);
|
|
191
185
|
setShowDropdown(availableOptions.length > 0 && value.trim().length > 0);
|
|
192
186
|
};
|
|
@@ -195,7 +189,6 @@ var MultiTextareaWithChips = function MultiTextareaWithChips(_ref) {
|
|
|
195
189
|
if (inputValue.trim()) {
|
|
196
190
|
setShowDropdown(true);
|
|
197
191
|
} else {
|
|
198
|
-
// Show all available options when focusing without input
|
|
199
192
|
filterOptions('');
|
|
200
193
|
setShowDropdown(true);
|
|
201
194
|
}
|
|
@@ -210,8 +203,6 @@ var MultiTextareaWithChips = function MultiTextareaWithChips(_ref) {
|
|
|
210
203
|
});
|
|
211
204
|
setLocalChips(newChips);
|
|
212
205
|
onRemoveChip === null || onRemoveChip === void 0 || onRemoveChip(chipToRemove);
|
|
213
|
-
|
|
214
|
-
// Update form values consistently
|
|
215
206
|
if (formProps !== null && formProps !== void 0 && formProps.setFieldValue) {
|
|
216
207
|
formProps.setFieldValue(fieldName, newChips);
|
|
217
208
|
}
|
|
@@ -219,8 +210,6 @@ var MultiTextareaWithChips = function MultiTextareaWithChips(_ref) {
|
|
|
219
210
|
setValue(fieldName, newChips);
|
|
220
211
|
}
|
|
221
212
|
setChipError('');
|
|
222
|
-
|
|
223
|
-
// Refresh filtered options when chip is removed
|
|
224
213
|
if (showDropdown) {
|
|
225
214
|
filterOptions(inputValue);
|
|
226
215
|
}
|
|
@@ -241,8 +230,6 @@ var MultiTextareaWithChips = function MultiTextareaWithChips(_ref) {
|
|
|
241
230
|
};
|
|
242
231
|
var _newChips = [].concat(_toConsumableArray(localChips), [_item]);
|
|
243
232
|
setLocalChips(_newChips);
|
|
244
|
-
|
|
245
|
-
// Update form values consistently
|
|
246
233
|
if (formProps !== null && formProps !== void 0 && formProps.setFieldValue) {
|
|
247
234
|
formProps.setFieldValue(fieldName, _newChips);
|
|
248
235
|
}
|
|
@@ -260,8 +247,6 @@ var MultiTextareaWithChips = function MultiTextareaWithChips(_ref) {
|
|
|
260
247
|
}
|
|
261
248
|
}
|
|
262
249
|
onAddChip === null || onAddChip === void 0 || onAddChip(option);
|
|
263
|
-
|
|
264
|
-
// Create consistent chip item structure
|
|
265
250
|
var item = {
|
|
266
251
|
text: option,
|
|
267
252
|
hasError: false,
|
|
@@ -269,8 +254,6 @@ var MultiTextareaWithChips = function MultiTextareaWithChips(_ref) {
|
|
|
269
254
|
};
|
|
270
255
|
var newChips = [].concat(_toConsumableArray(localChips), [item]);
|
|
271
256
|
setLocalChips(newChips);
|
|
272
|
-
|
|
273
|
-
// Update form values consistently
|
|
274
257
|
if (formProps !== null && formProps !== void 0 && formProps.setFieldValue) {
|
|
275
258
|
formProps.setFieldValue(fieldName, newChips);
|
|
276
259
|
}
|
|
@@ -299,8 +282,6 @@ var MultiTextareaWithChips = function MultiTextareaWithChips(_ref) {
|
|
|
299
282
|
};
|
|
300
283
|
var newChips = [].concat(_toConsumableArray(localChips), [item]);
|
|
301
284
|
setLocalChips(newChips);
|
|
302
|
-
|
|
303
|
-
// Update form values consistently
|
|
304
285
|
if (formProps !== null && formProps !== void 0 && formProps.setFieldValue) {
|
|
305
286
|
formProps.setFieldValue(fieldName, newChips);
|
|
306
287
|
}
|
|
@@ -331,8 +312,6 @@ var MultiTextareaWithChips = function MultiTextareaWithChips(_ref) {
|
|
|
331
312
|
} else {
|
|
332
313
|
var _newChips3 = [].concat(_toConsumableArray(localChips), [value]);
|
|
333
314
|
setLocalChips(_newChips3);
|
|
334
|
-
|
|
335
|
-
// Update form values consistently
|
|
336
315
|
if (formProps !== null && formProps !== void 0 && formProps.setFieldValue) {
|
|
337
316
|
formProps.setFieldValue(fieldName, _newChips3);
|
|
338
317
|
}
|