@zohodesk/components 1.2.62 → 1.3.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.
- package/.cli/config/variables/variableMapping.json +7 -0
- package/.cli/propValidation_report.html +1 -1
- package/README.md +13 -0
- package/assets/Appearance/dark/mode/Component_DarkMode.module.css +1 -0
- package/assets/Appearance/light/mode/Component_LightMode.module.css +1 -0
- package/assets/Appearance/pureDark/mode/Component_PureDarkMode.module.css +1 -0
- package/es/ListItem/ListContainer.js +3 -2
- package/es/ListItem/ListItem.module.css +52 -6
- package/es/ListItem/ListItemWithAvatar.js +17 -6
- package/es/ListItem/ListItemWithCheckBox.js +18 -6
- package/es/ListItem/ListItemWithIcon.js +20 -7
- package/es/ListItem/ListItemWithRadio.js +19 -6
- package/es/ListItem/__tests__/ListContainer.spec.js +8 -0
- package/es/ListItem/__tests__/ListItemWithAvatar.spec.js +35 -0
- package/es/ListItem/__tests__/ListItemWithCheckBox.spec.js +35 -0
- package/es/ListItem/__tests__/ListItemWithIcon.spec.js +35 -0
- package/es/ListItem/__tests__/ListItemWithRadio.spec.js +35 -0
- package/es/ListItem/__tests__/__snapshots__/ListContainer.spec.js.snap +13 -0
- package/es/ListItem/__tests__/__snapshots__/ListItemWithAvatar.spec.js.snap +200 -2
- package/es/ListItem/__tests__/__snapshots__/ListItemWithCheckBox.spec.js.snap +451 -30
- package/es/ListItem/__tests__/__snapshots__/ListItemWithIcon.spec.js.snap +202 -4
- package/es/ListItem/__tests__/__snapshots__/ListItemWithRadio.spec.js.snap +447 -30
- package/es/ListItem/props/defaultProps.js +13 -5
- package/es/ListItem/props/propTypes.js +13 -1
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +12 -4
- package/es/MultiSelect/AdvancedMultiSelect.js +20 -8
- package/es/MultiSelect/MultiSelect.js +16 -6
- package/es/MultiSelect/MultiSelect.module.css +9 -1
- package/es/MultiSelect/MultiSelectWithAvatar.js +8 -2
- package/es/MultiSelect/Suggestions.js +5 -2
- package/es/MultiSelect/__tests__/AdvancedMultiSelect.spec.js +28 -0
- package/es/MultiSelect/__tests__/__snapshots__/AdvancedMultiSelect.spec.js.snap +390 -0
- package/es/MultiSelect/__tests__/__snapshots__/MultiSelectHeader.spec.js.snap +34 -13
- package/es/MultiSelect/props/defaultProps.js +8 -4
- package/es/MultiSelect/props/propTypes.js +7 -2
- package/es/Radio/props/propTypes.js +1 -1
- package/es/Select/GroupSelect.js +4 -2
- package/es/Select/Select.js +3 -1
- package/es/Select/SelectWithAvatar.js +4 -2
- package/es/Select/props/defaultProps.js +4 -2
- package/es/Select/props/propTypes.js +4 -2
- package/es/common/common.module.css +10 -0
- package/es/utils/dropDownUtils.js +42 -13
- package/es/v1/Radio/props/propTypes.js +1 -1
- package/lib/ListItem/ListContainer.js +3 -2
- package/lib/ListItem/ListItem.module.css +52 -6
- package/lib/ListItem/ListItemWithAvatar.js +16 -5
- package/lib/ListItem/ListItemWithCheckBox.js +17 -5
- package/lib/ListItem/ListItemWithIcon.js +19 -6
- package/lib/ListItem/ListItemWithRadio.js +18 -5
- package/lib/ListItem/__tests__/ListContainer.spec.js +8 -0
- package/lib/ListItem/__tests__/ListItemWithAvatar.spec.js +35 -0
- package/lib/ListItem/__tests__/ListItemWithCheckBox.spec.js +35 -0
- package/lib/ListItem/__tests__/ListItemWithIcon.spec.js +35 -0
- package/lib/ListItem/__tests__/ListItemWithRadio.spec.js +35 -0
- package/lib/ListItem/__tests__/__snapshots__/ListContainer.spec.js.snap +13 -0
- package/lib/ListItem/__tests__/__snapshots__/ListItemWithAvatar.spec.js.snap +200 -2
- package/lib/ListItem/__tests__/__snapshots__/ListItemWithCheckBox.spec.js.snap +451 -30
- package/lib/ListItem/__tests__/__snapshots__/ListItemWithIcon.spec.js.snap +202 -4
- package/lib/ListItem/__tests__/__snapshots__/ListItemWithRadio.spec.js.snap +447 -30
- package/lib/ListItem/props/defaultProps.js +13 -5
- package/lib/ListItem/props/propTypes.js +12 -2
- package/lib/MultiSelect/AdvancedGroupMultiSelect.js +11 -5
- package/lib/MultiSelect/AdvancedMultiSelect.js +86 -73
- package/lib/MultiSelect/MultiSelect.js +14 -6
- package/lib/MultiSelect/MultiSelect.module.css +9 -1
- package/lib/MultiSelect/MultiSelectWithAvatar.js +8 -2
- package/lib/MultiSelect/Suggestions.js +5 -2
- package/lib/MultiSelect/__tests__/AdvancedMultiSelect.spec.js +28 -0
- package/lib/MultiSelect/__tests__/__snapshots__/AdvancedMultiSelect.spec.js.snap +390 -0
- package/lib/MultiSelect/__tests__/__snapshots__/MultiSelectHeader.spec.js.snap +34 -13
- package/lib/MultiSelect/props/defaultProps.js +8 -4
- package/lib/MultiSelect/props/propTypes.js +7 -3
- package/lib/Radio/props/propTypes.js +1 -1
- package/lib/Select/GroupSelect.js +4 -2
- package/lib/Select/Select.js +3 -1
- package/lib/Select/SelectWithAvatar.js +4 -2
- package/lib/Select/props/defaultProps.js +4 -2
- package/lib/Select/props/propTypes.js +4 -2
- package/lib/common/common.module.css +10 -0
- package/lib/utils/dropDownUtils.js +52 -16
- package/lib/v1/Radio/props/propTypes.js +1 -1
- package/package.json +6 -6
- package/result.json +1 -1
|
@@ -135,13 +135,16 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
135
135
|
_this$state$options = _this$state.options,
|
|
136
136
|
options = _this$state$options === void 0 ? dummyArray : _this$state$options,
|
|
137
137
|
searchStr = _this$state.searchStr;
|
|
138
|
-
var
|
|
138
|
+
var _this$props2 = this.props,
|
|
139
|
+
needLocalSearch = _this$props2.needLocalSearch,
|
|
140
|
+
searchFields = _this$props2.searchFields;
|
|
139
141
|
|
|
140
142
|
var _this$getFilterSugges = this.getFilterSuggestions({
|
|
141
143
|
options: options,
|
|
142
144
|
selectedOptions: dummyArray,
|
|
143
145
|
searchStr: (0, _Common.getSearchString)(searchStr),
|
|
144
|
-
needSearch: needLocalSearch
|
|
146
|
+
needSearch: needLocalSearch,
|
|
147
|
+
searchFields: searchFields
|
|
145
148
|
}),
|
|
146
149
|
suggestions = _this$getFilterSugges.suggestions,
|
|
147
150
|
suggestionIds = _this$getFilterSugges.suggestionIds;
|
|
@@ -157,14 +160,14 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
157
160
|
var _this$state2 = this.state,
|
|
158
161
|
optionsNormalize = _this$state2.optionsNormalize,
|
|
159
162
|
searchStr = _this$state2.searchStr;
|
|
160
|
-
var _this$
|
|
161
|
-
onChange = _this$
|
|
162
|
-
_this$
|
|
163
|
-
needToCloseOnSelect = _this$
|
|
164
|
-
togglePopup = _this$
|
|
165
|
-
isSearchClearOnSelect = _this$
|
|
166
|
-
propSelectedOptions = _this$
|
|
167
|
-
disabledOptions = _this$
|
|
163
|
+
var _this$props3 = this.props,
|
|
164
|
+
onChange = _this$props3.onChange,
|
|
165
|
+
_this$props3$needToCl = _this$props3.needToCloseOnSelect,
|
|
166
|
+
needToCloseOnSelect = _this$props3$needToCl === void 0 ? false : _this$props3$needToCl,
|
|
167
|
+
togglePopup = _this$props3.togglePopup,
|
|
168
|
+
isSearchClearOnSelect = _this$props3.isSearchClearOnSelect,
|
|
169
|
+
propSelectedOptions = _this$props3.selectedOptions,
|
|
170
|
+
disabledOptions = _this$props3.disabledOptions;
|
|
168
171
|
|
|
169
172
|
var _filterSelectedOption = (0, _dropDownUtils.filterSelectedOptions)({
|
|
170
173
|
selectedOptions: selectedOptions,
|
|
@@ -218,7 +221,10 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
218
221
|
iconSize = props.iconSize,
|
|
219
222
|
prefixText = props.prefixText,
|
|
220
223
|
optionType = props.optionType,
|
|
221
|
-
disabledOptions = props.disabledOptions
|
|
224
|
+
disabledOptions = props.disabledOptions,
|
|
225
|
+
allowValueFallback = props.allowValueFallback,
|
|
226
|
+
searchFields = props.searchFields,
|
|
227
|
+
secondaryField = props.secondaryField;
|
|
222
228
|
return this.formatOptions({
|
|
223
229
|
options: options,
|
|
224
230
|
valueField: valueField,
|
|
@@ -228,7 +234,10 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
228
234
|
prefixText: prefixText,
|
|
229
235
|
optionType: optionType,
|
|
230
236
|
iconSize: iconSize,
|
|
231
|
-
disabledOptions: disabledOptions
|
|
237
|
+
disabledOptions: disabledOptions,
|
|
238
|
+
allowValueFallback: allowValueFallback,
|
|
239
|
+
searchFields: searchFields,
|
|
240
|
+
secondaryField: secondaryField
|
|
232
241
|
});
|
|
233
242
|
}
|
|
234
243
|
}, {
|
|
@@ -239,7 +248,8 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
239
248
|
showedSelectedOptionsCount = _ref.showedSelectedOptionsCount;
|
|
240
249
|
|
|
241
250
|
var selectedOptionsLimit = props.selectedOptionsLimit,
|
|
242
|
-
selectedOptionDetails = props.selectedOptionDetails
|
|
251
|
+
selectedOptionDetails = props.selectedOptionDetails,
|
|
252
|
+
allowValueFallback = props.allowValueFallback;
|
|
243
253
|
showedSelectedOptionsCount = (0, _Common.getIsEmptyValue)(showedSelectedOptionsCount) ? selectedOptionsLimit : showedSelectedOptionsCount;
|
|
244
254
|
|
|
245
255
|
var _this$handleFormatSel = this.handleFormatSelectedOptions(selectedOptionDetails, props),
|
|
@@ -252,7 +262,8 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
252
262
|
return this.getSelectedOptions({
|
|
253
263
|
selectedOptions: selectedOptions,
|
|
254
264
|
normalizedFormatOptions: formatOptions,
|
|
255
|
-
selectedOptionsLength: showedSelectedOptionsCount
|
|
265
|
+
selectedOptionsLength: showedSelectedOptionsCount,
|
|
266
|
+
allowValueFallback: allowValueFallback
|
|
256
267
|
});
|
|
257
268
|
}
|
|
258
269
|
}, {
|
|
@@ -264,7 +275,8 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
264
275
|
optionType = props.optionType,
|
|
265
276
|
iconName = props.iconName,
|
|
266
277
|
iconSize = props.iconSize,
|
|
267
|
-
disabledOptions = props.disabledOptions
|
|
278
|
+
disabledOptions = props.disabledOptions,
|
|
279
|
+
allowValueFallback = props.allowValueFallback;
|
|
268
280
|
return this.formatSelectedOptions({
|
|
269
281
|
options: selectedOptionDetails,
|
|
270
282
|
valueField: valueField,
|
|
@@ -273,7 +285,8 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
273
285
|
optionType: optionType,
|
|
274
286
|
iconName: iconName,
|
|
275
287
|
iconSize: iconSize,
|
|
276
|
-
disabledOptions: disabledOptions
|
|
288
|
+
disabledOptions: disabledOptions,
|
|
289
|
+
allowValueFallback: allowValueFallback
|
|
277
290
|
});
|
|
278
291
|
}
|
|
279
292
|
}, {
|
|
@@ -282,11 +295,11 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
282
295
|
var _this2 = this;
|
|
283
296
|
|
|
284
297
|
var oldAllSelectedOptionsDetails = this.allSelectedOptionsDetails;
|
|
285
|
-
var _this$
|
|
286
|
-
selectedOptions = _this$
|
|
287
|
-
selectedOptionsLimit = _this$
|
|
288
|
-
id = _this$
|
|
289
|
-
selectedOptionDetails = _this$
|
|
298
|
+
var _this$props4 = this.props,
|
|
299
|
+
selectedOptions = _this$props4.selectedOptions,
|
|
300
|
+
selectedOptionsLimit = _this$props4.selectedOptionsLimit,
|
|
301
|
+
id = _this$props4.id,
|
|
302
|
+
selectedOptionDetails = _this$props4.selectedOptionDetails;
|
|
290
303
|
var oldSelectedOptions = prevProps.selectedOptions,
|
|
291
304
|
oldSelectedOptionsLimit = prevProps.selectedOptionsLimit;
|
|
292
305
|
var oldCount = this.state.showedSelectedOptionsCount;
|
|
@@ -354,11 +367,11 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
354
367
|
var _this3 = this;
|
|
355
368
|
|
|
356
369
|
var showedSelectedOptionsCount = this.state.showedSelectedOptionsCount;
|
|
357
|
-
var _this$
|
|
358
|
-
selectedOptionsLimit = _this$
|
|
359
|
-
selectedOptions = _this$
|
|
360
|
-
getSelectedOptionDetails = _this$
|
|
361
|
-
removeClose = _this$
|
|
370
|
+
var _this$props5 = this.props,
|
|
371
|
+
selectedOptionsLimit = _this$props5.selectedOptionsLimit,
|
|
372
|
+
selectedOptions = _this$props5.selectedOptions,
|
|
373
|
+
getSelectedOptionDetails = _this$props5.getSelectedOptionDetails,
|
|
374
|
+
removeClose = _this$props5.removeClose;
|
|
362
375
|
removeClose(e);
|
|
363
376
|
var selectedOptionsLen = selectedOptions.length;
|
|
364
377
|
|
|
@@ -395,53 +408,53 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
395
408
|
value: function render() {
|
|
396
409
|
var _this4 = this;
|
|
397
410
|
|
|
398
|
-
var _this$
|
|
399
|
-
isReadOnly = _this$
|
|
400
|
-
needSelectAll = _this$
|
|
401
|
-
searchEmptyMessage = _this$
|
|
402
|
-
emptyMessage = _this$
|
|
403
|
-
noMoreOptionsMessage = _this$
|
|
404
|
-
dropBoxSize = _this$
|
|
405
|
-
placeHolder = _this$
|
|
406
|
-
isPopupOpen = _this$
|
|
407
|
-
isPopupReady = _this$
|
|
408
|
-
position = _this$
|
|
409
|
-
defaultDropBoxPosition = _this$
|
|
410
|
-
selectAllText = _this$
|
|
411
|
-
getContainerRef = _this$
|
|
412
|
-
removeClose = _this$
|
|
413
|
-
isAnimate = _this$
|
|
414
|
-
animationStyle = _this$
|
|
415
|
-
textBoxSize = _this$
|
|
416
|
-
variant = _this$
|
|
417
|
-
size = _this$
|
|
418
|
-
isDisabled = _this$
|
|
419
|
-
title = _this$
|
|
420
|
-
dataIdMultiSelectComp = _this$
|
|
421
|
-
dataIdClearIcon = _this$
|
|
422
|
-
dataIdSelectAllEle = _this$
|
|
423
|
-
dataIdLoading = _this$
|
|
424
|
-
_this$
|
|
425
|
-
allselectedOptionIds = _this$
|
|
426
|
-
listItemSize = _this$
|
|
427
|
-
needBorder = _this$
|
|
428
|
-
i18nKeys = _this$
|
|
429
|
-
htmlId = _this$
|
|
430
|
-
a11y = _this$
|
|
431
|
-
borderColor = _this$
|
|
432
|
-
isBoxPaddingNeed = _this$
|
|
433
|
-
getFooter = _this$
|
|
434
|
-
customProps = _this$
|
|
435
|
-
needEffect = _this$
|
|
436
|
-
disabledOptions = _this$
|
|
437
|
-
isLoading = _this$
|
|
438
|
-
dataSelectorId = _this$
|
|
439
|
-
customClass = _this$
|
|
440
|
-
isAbsolutePositioningNeeded = _this$
|
|
441
|
-
positionsOffset = _this$
|
|
442
|
-
targetOffset = _this$
|
|
443
|
-
isRestrictScroll = _this$
|
|
444
|
-
isFocus = _this$
|
|
411
|
+
var _this$props6 = this.props,
|
|
412
|
+
isReadOnly = _this$props6.isReadOnly,
|
|
413
|
+
needSelectAll = _this$props6.needSelectAll,
|
|
414
|
+
searchEmptyMessage = _this$props6.searchEmptyMessage,
|
|
415
|
+
emptyMessage = _this$props6.emptyMessage,
|
|
416
|
+
noMoreOptionsMessage = _this$props6.noMoreOptionsMessage,
|
|
417
|
+
dropBoxSize = _this$props6.dropBoxSize,
|
|
418
|
+
placeHolder = _this$props6.placeHolder,
|
|
419
|
+
isPopupOpen = _this$props6.isPopupOpen,
|
|
420
|
+
isPopupReady = _this$props6.isPopupReady,
|
|
421
|
+
position = _this$props6.position,
|
|
422
|
+
defaultDropBoxPosition = _this$props6.defaultDropBoxPosition,
|
|
423
|
+
selectAllText = _this$props6.selectAllText,
|
|
424
|
+
getContainerRef = _this$props6.getContainerRef,
|
|
425
|
+
removeClose = _this$props6.removeClose,
|
|
426
|
+
isAnimate = _this$props6.isAnimate,
|
|
427
|
+
animationStyle = _this$props6.animationStyle,
|
|
428
|
+
textBoxSize = _this$props6.textBoxSize,
|
|
429
|
+
variant = _this$props6.variant,
|
|
430
|
+
size = _this$props6.size,
|
|
431
|
+
isDisabled = _this$props6.isDisabled,
|
|
432
|
+
title = _this$props6.title,
|
|
433
|
+
dataIdMultiSelectComp = _this$props6.dataIdMultiSelectComp,
|
|
434
|
+
dataIdClearIcon = _this$props6.dataIdClearIcon,
|
|
435
|
+
dataIdSelectAllEle = _this$props6.dataIdSelectAllEle,
|
|
436
|
+
dataIdLoading = _this$props6.dataIdLoading,
|
|
437
|
+
_this$props6$selected = _this$props6.selectedOptions,
|
|
438
|
+
allselectedOptionIds = _this$props6$selected === void 0 ? [] : _this$props6$selected,
|
|
439
|
+
listItemSize = _this$props6.listItemSize,
|
|
440
|
+
needBorder = _this$props6.needBorder,
|
|
441
|
+
i18nKeys = _this$props6.i18nKeys,
|
|
442
|
+
htmlId = _this$props6.htmlId,
|
|
443
|
+
a11y = _this$props6.a11y,
|
|
444
|
+
borderColor = _this$props6.borderColor,
|
|
445
|
+
isBoxPaddingNeed = _this$props6.isBoxPaddingNeed,
|
|
446
|
+
getFooter = _this$props6.getFooter,
|
|
447
|
+
customProps = _this$props6.customProps,
|
|
448
|
+
needEffect = _this$props6.needEffect,
|
|
449
|
+
disabledOptions = _this$props6.disabledOptions,
|
|
450
|
+
isLoading = _this$props6.isLoading,
|
|
451
|
+
dataSelectorId = _this$props6.dataSelectorId,
|
|
452
|
+
customClass = _this$props6.customClass,
|
|
453
|
+
isAbsolutePositioningNeeded = _this$props6.isAbsolutePositioningNeeded,
|
|
454
|
+
positionsOffset = _this$props6.positionsOffset,
|
|
455
|
+
targetOffset = _this$props6.targetOffset,
|
|
456
|
+
isRestrictScroll = _this$props6.isRestrictScroll,
|
|
457
|
+
isFocus = _this$props6.isFocus;
|
|
445
458
|
var _customProps$Suggesti = customProps.SuggestionsProps,
|
|
446
459
|
SuggestionsProps = _customProps$Suggesti === void 0 ? {} : _customProps$Suggesti,
|
|
447
460
|
_customProps$DropBoxP = customProps.DropBoxProps,
|
|
@@ -299,22 +299,28 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
299
299
|
valueField = props.valueField,
|
|
300
300
|
textField = props.textField,
|
|
301
301
|
prefixText = props.prefixText,
|
|
302
|
-
disabledOptions = props.disabledOptions
|
|
302
|
+
disabledOptions = props.disabledOptions,
|
|
303
|
+
allowValueFallback = props.allowValueFallback,
|
|
304
|
+
searchFields = props.searchFields;
|
|
303
305
|
return this.formatOptions({
|
|
304
306
|
options: options,
|
|
305
307
|
valueField: valueField,
|
|
306
308
|
textField: textField,
|
|
307
309
|
prefixText: prefixText,
|
|
308
310
|
optionType: 'default',
|
|
309
|
-
disabledOptions: disabledOptions
|
|
311
|
+
disabledOptions: disabledOptions,
|
|
312
|
+
allowValueFallback: allowValueFallback,
|
|
313
|
+
searchFields: searchFields
|
|
310
314
|
});
|
|
311
315
|
}
|
|
312
316
|
}, {
|
|
313
317
|
key: "handleGetSelectedOptions",
|
|
314
|
-
value: function handleGetSelectedOptions(selectedOptions, normalizedFormatOptions) {
|
|
318
|
+
value: function handleGetSelectedOptions(selectedOptions, normalizedFormatOptions, props) {
|
|
319
|
+
var allowValueFallback = props.allowValueFallback;
|
|
315
320
|
return this.getSelectedOptions({
|
|
316
321
|
selectedOptions: selectedOptions,
|
|
317
|
-
normalizedFormatOptions: normalizedFormatOptions
|
|
322
|
+
normalizedFormatOptions: normalizedFormatOptions,
|
|
323
|
+
allowValueFallback: allowValueFallback
|
|
318
324
|
});
|
|
319
325
|
}
|
|
320
326
|
}, {
|
|
@@ -350,14 +356,16 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
350
356
|
var _this$props4 = this.props,
|
|
351
357
|
selectedOptions = _this$props4.selectedOptions,
|
|
352
358
|
needLocalSearch = _this$props4.needLocalSearch,
|
|
353
|
-
keepSelectedOptions = _this$props4.keepSelectedOptions
|
|
359
|
+
keepSelectedOptions = _this$props4.keepSelectedOptions,
|
|
360
|
+
searchFields = _this$props4.searchFields;
|
|
354
361
|
|
|
355
362
|
var _this$getFilterSugges = this.getFilterSuggestions({
|
|
356
363
|
options: options,
|
|
357
364
|
selectedOptions: selectedOptions,
|
|
358
365
|
searchStr: (0, _Common.getSearchString)(searchStr),
|
|
359
366
|
needSearch: needLocalSearch,
|
|
360
|
-
keepSelectedOptions: keepSelectedOptions
|
|
367
|
+
keepSelectedOptions: keepSelectedOptions,
|
|
368
|
+
searchFields: searchFields
|
|
361
369
|
}),
|
|
362
370
|
suggestions = _this$getFilterSugges.suggestions,
|
|
363
371
|
suggestionIds = _this$getFilterSugges.suggestionIds;
|
|
@@ -200,7 +200,15 @@
|
|
|
200
200
|
cursor: pointer;
|
|
201
201
|
margin-top: var(--zd_size5) ;
|
|
202
202
|
background-color: var(--zdt_multiselect_delete_bg);
|
|
203
|
-
border: 0
|
|
203
|
+
border: 0
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
[dir=ltr] .more {
|
|
207
|
+
margin-right:var(--zd_size3)
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
[dir=rtl] .more {
|
|
211
|
+
margin-left:var(--zd_size3)
|
|
204
212
|
}
|
|
205
213
|
|
|
206
214
|
.rightPlaceholder{
|
|
@@ -99,14 +99,20 @@ var MultiSelectWithAvatarComponent = /*#__PURE__*/function (_MultiSelectComponen
|
|
|
99
99
|
valueField = props.valueField,
|
|
100
100
|
textField = props.textField,
|
|
101
101
|
imageField = props.imageField,
|
|
102
|
-
disabledOptions = props.disabledOptions
|
|
102
|
+
disabledOptions = props.disabledOptions,
|
|
103
|
+
allowValueFallback = props.allowValueFallback,
|
|
104
|
+
searchFields = props.searchFields,
|
|
105
|
+
secondaryField = props.secondaryField;
|
|
103
106
|
return this.formatOptions({
|
|
104
107
|
options: options,
|
|
105
108
|
valueField: valueField,
|
|
106
109
|
textField: textField,
|
|
107
110
|
imageField: imageField,
|
|
108
111
|
optionType: 'avatar',
|
|
109
|
-
disabledOptions: disabledOptions
|
|
112
|
+
disabledOptions: disabledOptions,
|
|
113
|
+
allowValueFallback: allowValueFallback,
|
|
114
|
+
searchFields: searchFields,
|
|
115
|
+
secondaryField: secondaryField
|
|
110
116
|
});
|
|
111
117
|
}
|
|
112
118
|
}, {
|
|
@@ -98,6 +98,7 @@ var Suggestions = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
98
98
|
}, suggestions.map(function (suggestion, index) {
|
|
99
99
|
var id = suggestion.id,
|
|
100
100
|
value = suggestion.value,
|
|
101
|
+
secondaryValue = suggestion.secondaryValue,
|
|
101
102
|
photoURL = suggestion.photoURL,
|
|
102
103
|
icon = suggestion.icon,
|
|
103
104
|
optionType = suggestion.optionType,
|
|
@@ -143,7 +144,8 @@ var Suggestions = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
143
144
|
size: listItemSize,
|
|
144
145
|
avatarPalette: avatarPalette,
|
|
145
146
|
palette: palette,
|
|
146
|
-
a11y: list_a11y
|
|
147
|
+
a11y: list_a11y,
|
|
148
|
+
secondaryValue: secondaryValue
|
|
147
149
|
}));
|
|
148
150
|
} else if (optionType === 'icon') {
|
|
149
151
|
return /*#__PURE__*/_react["default"].createElement(_ListItemWithIcon["default"], _extends({}, commonProps, {
|
|
@@ -163,7 +165,8 @@ var Suggestions = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
163
165
|
iconSize: iconSize,
|
|
164
166
|
size: listItemSize,
|
|
165
167
|
palette: palette,
|
|
166
|
-
a11y: list_a11y
|
|
168
|
+
a11y: list_a11y,
|
|
169
|
+
secondaryValue: secondaryValue
|
|
167
170
|
}));
|
|
168
171
|
}
|
|
169
172
|
|
|
@@ -17,4 +17,32 @@ describe('AdvancedMultiSelect', function () {
|
|
|
17
17
|
|
|
18
18
|
expect(asFragment()).toMatchSnapshot();
|
|
19
19
|
});
|
|
20
|
+
var options = [{
|
|
21
|
+
id: 1,
|
|
22
|
+
text: 'Apple'
|
|
23
|
+
}, {
|
|
24
|
+
id: 2,
|
|
25
|
+
text: 'Orange'
|
|
26
|
+
}, 'string test'];
|
|
27
|
+
test('rendering the options array with objects and string', function () {
|
|
28
|
+
var _render2 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_AdvancedMultiSelect["default"], {
|
|
29
|
+
isPopupOpen: true,
|
|
30
|
+
isPopupReady: true,
|
|
31
|
+
options: options
|
|
32
|
+
})),
|
|
33
|
+
asFragment = _render2.asFragment;
|
|
34
|
+
|
|
35
|
+
expect(asFragment()).toMatchSnapshot();
|
|
36
|
+
});
|
|
37
|
+
test('rendering the options array with only objects using allowValueFallback', function () {
|
|
38
|
+
var _render3 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_AdvancedMultiSelect["default"], {
|
|
39
|
+
isPopupOpen: true,
|
|
40
|
+
isPopupReady: true,
|
|
41
|
+
options: options,
|
|
42
|
+
allowValueFallback: false
|
|
43
|
+
})),
|
|
44
|
+
asFragment = _render3.asFragment;
|
|
45
|
+
|
|
46
|
+
expect(asFragment()).toMatchSnapshot();
|
|
47
|
+
});
|
|
20
48
|
});
|