@zohodesk/components 1.0.0-temp-220.7 → 1.0.0-temp-223
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 +6 -0
- package/.cli/propValidation_report.html +1 -1
- package/README.md +8 -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/AdvancedMultiSelect.js +10 -4
- package/es/MultiSelect/MultiSelect.js +8 -4
- package/es/MultiSelect/MultiSelect.module.css +9 -1
- package/es/MultiSelect/MultiSelectWithAvatar.js +6 -2
- package/es/MultiSelect/Suggestions.js +5 -2
- package/es/MultiSelect/__tests__/__snapshots__/MultiSelectHeader.spec.js.snap +34 -13
- package/es/MultiSelect/props/propTypes.js +3 -0
- package/es/Popup/Popup.js +22 -56
- package/es/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +21 -2
- package/es/VelocityAnimation/VelocityAnimationGroup/props/defaultProps.js +2 -1
- package/es/VelocityAnimation/VelocityAnimationGroup/props/propTypes.js +2 -1
- package/es/common/common.module.css +10 -0
- package/es/utils/dropDownUtils.js +33 -8
- 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/AdvancedMultiSelect.js +76 -69
- package/lib/MultiSelect/MultiSelect.js +8 -4
- package/lib/MultiSelect/MultiSelect.module.css +9 -1
- package/lib/MultiSelect/MultiSelectWithAvatar.js +6 -2
- package/lib/MultiSelect/Suggestions.js +5 -2
- package/lib/MultiSelect/__tests__/__snapshots__/MultiSelectHeader.spec.js.snap +34 -13
- package/lib/MultiSelect/props/propTypes.js +4 -1
- package/lib/Popup/Popup.js +60 -96
- package/lib/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +49 -9
- package/lib/VelocityAnimation/VelocityAnimationGroup/props/defaultProps.js +2 -1
- package/lib/VelocityAnimation/VelocityAnimationGroup/props/propTypes.js +2 -1
- package/lib/common/common.module.css +10 -0
- package/lib/utils/dropDownUtils.js +41 -11
- package/package.json +3 -3
- package/result.json +0 -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,
|
|
@@ -219,7 +222,9 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
219
222
|
prefixText = props.prefixText,
|
|
220
223
|
optionType = props.optionType,
|
|
221
224
|
disabledOptions = props.disabledOptions,
|
|
222
|
-
allowValueFallback = props.allowValueFallback
|
|
225
|
+
allowValueFallback = props.allowValueFallback,
|
|
226
|
+
searchFields = props.searchFields,
|
|
227
|
+
secondaryField = props.secondaryField;
|
|
223
228
|
return this.formatOptions({
|
|
224
229
|
options: options,
|
|
225
230
|
valueField: valueField,
|
|
@@ -230,7 +235,9 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
230
235
|
optionType: optionType,
|
|
231
236
|
iconSize: iconSize,
|
|
232
237
|
disabledOptions: disabledOptions,
|
|
233
|
-
allowValueFallback: allowValueFallback
|
|
238
|
+
allowValueFallback: allowValueFallback,
|
|
239
|
+
searchFields: searchFields,
|
|
240
|
+
secondaryField: secondaryField
|
|
234
241
|
});
|
|
235
242
|
}
|
|
236
243
|
}, {
|
|
@@ -288,11 +295,11 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
288
295
|
var _this2 = this;
|
|
289
296
|
|
|
290
297
|
var oldAllSelectedOptionsDetails = this.allSelectedOptionsDetails;
|
|
291
|
-
var _this$
|
|
292
|
-
selectedOptions = _this$
|
|
293
|
-
selectedOptionsLimit = _this$
|
|
294
|
-
id = _this$
|
|
295
|
-
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;
|
|
296
303
|
var oldSelectedOptions = prevProps.selectedOptions,
|
|
297
304
|
oldSelectedOptionsLimit = prevProps.selectedOptionsLimit;
|
|
298
305
|
var oldCount = this.state.showedSelectedOptionsCount;
|
|
@@ -360,11 +367,11 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
360
367
|
var _this3 = this;
|
|
361
368
|
|
|
362
369
|
var showedSelectedOptionsCount = this.state.showedSelectedOptionsCount;
|
|
363
|
-
var _this$
|
|
364
|
-
selectedOptionsLimit = _this$
|
|
365
|
-
selectedOptions = _this$
|
|
366
|
-
getSelectedOptionDetails = _this$
|
|
367
|
-
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;
|
|
368
375
|
removeClose(e);
|
|
369
376
|
var selectedOptionsLen = selectedOptions.length;
|
|
370
377
|
|
|
@@ -401,53 +408,53 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
401
408
|
value: function render() {
|
|
402
409
|
var _this4 = this;
|
|
403
410
|
|
|
404
|
-
var _this$
|
|
405
|
-
isReadOnly = _this$
|
|
406
|
-
needSelectAll = _this$
|
|
407
|
-
searchEmptyMessage = _this$
|
|
408
|
-
emptyMessage = _this$
|
|
409
|
-
noMoreOptionsMessage = _this$
|
|
410
|
-
dropBoxSize = _this$
|
|
411
|
-
placeHolder = _this$
|
|
412
|
-
isPopupOpen = _this$
|
|
413
|
-
isPopupReady = _this$
|
|
414
|
-
position = _this$
|
|
415
|
-
defaultDropBoxPosition = _this$
|
|
416
|
-
selectAllText = _this$
|
|
417
|
-
getContainerRef = _this$
|
|
418
|
-
removeClose = _this$
|
|
419
|
-
isAnimate = _this$
|
|
420
|
-
animationStyle = _this$
|
|
421
|
-
textBoxSize = _this$
|
|
422
|
-
variant = _this$
|
|
423
|
-
size = _this$
|
|
424
|
-
isDisabled = _this$
|
|
425
|
-
title = _this$
|
|
426
|
-
dataIdMultiSelectComp = _this$
|
|
427
|
-
dataIdClearIcon = _this$
|
|
428
|
-
dataIdSelectAllEle = _this$
|
|
429
|
-
dataIdLoading = _this$
|
|
430
|
-
_this$
|
|
431
|
-
allselectedOptionIds = _this$
|
|
432
|
-
listItemSize = _this$
|
|
433
|
-
needBorder = _this$
|
|
434
|
-
i18nKeys = _this$
|
|
435
|
-
htmlId = _this$
|
|
436
|
-
a11y = _this$
|
|
437
|
-
borderColor = _this$
|
|
438
|
-
isBoxPaddingNeed = _this$
|
|
439
|
-
getFooter = _this$
|
|
440
|
-
customProps = _this$
|
|
441
|
-
needEffect = _this$
|
|
442
|
-
disabledOptions = _this$
|
|
443
|
-
isLoading = _this$
|
|
444
|
-
dataSelectorId = _this$
|
|
445
|
-
customClass = _this$
|
|
446
|
-
isAbsolutePositioningNeeded = _this$
|
|
447
|
-
positionsOffset = _this$
|
|
448
|
-
targetOffset = _this$
|
|
449
|
-
isRestrictScroll = _this$
|
|
450
|
-
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;
|
|
451
458
|
var _customProps$Suggesti = customProps.SuggestionsProps,
|
|
452
459
|
SuggestionsProps = _customProps$Suggesti === void 0 ? {} : _customProps$Suggesti,
|
|
453
460
|
_customProps$DropBoxP = customProps.DropBoxProps,
|
|
@@ -300,7 +300,8 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
300
300
|
textField = props.textField,
|
|
301
301
|
prefixText = props.prefixText,
|
|
302
302
|
disabledOptions = props.disabledOptions,
|
|
303
|
-
allowValueFallback = props.allowValueFallback
|
|
303
|
+
allowValueFallback = props.allowValueFallback,
|
|
304
|
+
searchFields = props.searchFields;
|
|
304
305
|
return this.formatOptions({
|
|
305
306
|
options: options,
|
|
306
307
|
valueField: valueField,
|
|
@@ -308,7 +309,8 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
308
309
|
prefixText: prefixText,
|
|
309
310
|
optionType: 'default',
|
|
310
311
|
disabledOptions: disabledOptions,
|
|
311
|
-
allowValueFallback: allowValueFallback
|
|
312
|
+
allowValueFallback: allowValueFallback,
|
|
313
|
+
searchFields: searchFields
|
|
312
314
|
});
|
|
313
315
|
}
|
|
314
316
|
}, {
|
|
@@ -354,14 +356,16 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
354
356
|
var _this$props4 = this.props,
|
|
355
357
|
selectedOptions = _this$props4.selectedOptions,
|
|
356
358
|
needLocalSearch = _this$props4.needLocalSearch,
|
|
357
|
-
keepSelectedOptions = _this$props4.keepSelectedOptions
|
|
359
|
+
keepSelectedOptions = _this$props4.keepSelectedOptions,
|
|
360
|
+
searchFields = _this$props4.searchFields;
|
|
358
361
|
|
|
359
362
|
var _this$getFilterSugges = this.getFilterSuggestions({
|
|
360
363
|
options: options,
|
|
361
364
|
selectedOptions: selectedOptions,
|
|
362
365
|
searchStr: (0, _Common.getSearchString)(searchStr),
|
|
363
366
|
needSearch: needLocalSearch,
|
|
364
|
-
keepSelectedOptions: keepSelectedOptions
|
|
367
|
+
keepSelectedOptions: keepSelectedOptions,
|
|
368
|
+
searchFields: searchFields
|
|
365
369
|
}),
|
|
366
370
|
suggestions = _this$getFilterSugges.suggestions,
|
|
367
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{
|
|
@@ -100,7 +100,9 @@ var MultiSelectWithAvatarComponent = /*#__PURE__*/function (_MultiSelectComponen
|
|
|
100
100
|
textField = props.textField,
|
|
101
101
|
imageField = props.imageField,
|
|
102
102
|
disabledOptions = props.disabledOptions,
|
|
103
|
-
allowValueFallback = props.allowValueFallback
|
|
103
|
+
allowValueFallback = props.allowValueFallback,
|
|
104
|
+
searchFields = props.searchFields,
|
|
105
|
+
secondaryField = props.secondaryField;
|
|
104
106
|
return this.formatOptions({
|
|
105
107
|
options: options,
|
|
106
108
|
valueField: valueField,
|
|
@@ -108,7 +110,9 @@ var MultiSelectWithAvatarComponent = /*#__PURE__*/function (_MultiSelectComponen
|
|
|
108
110
|
imageField: imageField,
|
|
109
111
|
optionType: 'avatar',
|
|
110
112
|
disabledOptions: disabledOptions,
|
|
111
|
-
allowValueFallback: allowValueFallback
|
|
113
|
+
allowValueFallback: allowValueFallback,
|
|
114
|
+
searchFields: searchFields,
|
|
115
|
+
secondaryField: secondaryField
|
|
112
116
|
});
|
|
113
117
|
}
|
|
114
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
|
|
|
@@ -13,27 +13,48 @@ exports[`MultiSelectHeader rendering the basic value 1`] = `
|
|
|
13
13
|
>
|
|
14
14
|
<div
|
|
15
15
|
aria-hidden="true"
|
|
16
|
-
class="iconBox shrinkOff"
|
|
16
|
+
class="iconBox lhsBox lhsJustifyContent_center shrinkOff selfStart"
|
|
17
17
|
data-id="MultiSelectHeader_selectAll_Icon"
|
|
18
18
|
data-selector-id="box"
|
|
19
19
|
data-test-id="MultiSelectHeader_selectAll_Icon"
|
|
20
20
|
>
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
data-id="
|
|
25
|
-
data-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
<div
|
|
22
|
+
class="lhsBox_medium shrinkOff selfStart"
|
|
23
|
+
data-id="boxComponent"
|
|
24
|
+
data-selector-id="box"
|
|
25
|
+
data-test-id="boxComponent"
|
|
26
|
+
>
|
|
27
|
+
<i
|
|
28
|
+
aria-hidden="true"
|
|
29
|
+
class="zd_font_icons basic icon-androidd "
|
|
30
|
+
data-id="fontIcon"
|
|
31
|
+
data-selector-id="fontIcon"
|
|
32
|
+
data-test-id="fontIcon"
|
|
33
|
+
style="--zd-iconfont-size: var(--zd_font_size15);"
|
|
34
|
+
/>
|
|
35
|
+
</div>
|
|
29
36
|
</div>
|
|
30
37
|
<div
|
|
31
|
-
class="
|
|
32
|
-
data-id="
|
|
38
|
+
class="grow basis shrinkOn"
|
|
39
|
+
data-id="boxComponent"
|
|
33
40
|
data-selector-id="box"
|
|
34
|
-
data-test-id="
|
|
41
|
+
data-test-id="boxComponent"
|
|
35
42
|
>
|
|
36
|
-
|
|
43
|
+
<div
|
|
44
|
+
class="flex cover coldir"
|
|
45
|
+
data-id="containerComponent"
|
|
46
|
+
data-selector-id="container"
|
|
47
|
+
data-test-id="containerComponent"
|
|
48
|
+
>
|
|
49
|
+
<div
|
|
50
|
+
class="value shrinkOff"
|
|
51
|
+
data-id="MultiSelectHeader_selectAll_Text"
|
|
52
|
+
data-selector-id="box"
|
|
53
|
+
data-test-id="MultiSelectHeader_selectAll_Text"
|
|
54
|
+
>
|
|
55
|
+
List
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
37
58
|
</div>
|
|
38
59
|
</li>
|
|
39
60
|
</DocumentFragment>
|
|
@@ -65,6 +65,7 @@ var MultiSelect_propTypes = {
|
|
|
65
65
|
a11y: _propTypes["default"].shape({
|
|
66
66
|
clearLabel: _propTypes["default"].string
|
|
67
67
|
}),
|
|
68
|
+
searchFields: _propTypes["default"].arrayOf(_propTypes["default"].string),
|
|
68
69
|
isAnimate: _propTypes["default"].bool,
|
|
69
70
|
isBoxPaddingNeed: _propTypes["default"].bool,
|
|
70
71
|
isDisabled: _propTypes["default"].bool,
|
|
@@ -153,7 +154,8 @@ var MultiSelectWithAvatar_propTypes = _objectSpread({
|
|
|
153
154
|
customProps: _propTypes["default"].shape({
|
|
154
155
|
SuggestionsProps: _propTypes["default"].object,
|
|
155
156
|
DropBoxProps: _propTypes["default"].object
|
|
156
|
-
})
|
|
157
|
+
}),
|
|
158
|
+
secondaryField: _propTypes["default"].string
|
|
157
159
|
}, MultiSelect_propTypes);
|
|
158
160
|
|
|
159
161
|
exports.MultiSelectWithAvatar_propTypes = MultiSelectWithAvatar_propTypes;
|
|
@@ -305,6 +307,7 @@ var AdvancedMultiSelect_propTypes = _objectSpread(_objectSpread({}, MultiSelect_
|
|
|
305
307
|
//For grouping multiSelect
|
|
306
308
|
optionType: _propTypes["default"].oneOf(['default', 'avatar', 'icon']),
|
|
307
309
|
needEffect: _propTypes["default"].bool,
|
|
310
|
+
secondaryField: _propTypes["default"].string,
|
|
308
311
|
animationStyle: _propTypes["default"].string,
|
|
309
312
|
defaultDropBoxPosition: _propTypes["default"].oneOf(['bottom', 'top', 'left', 'right']),
|
|
310
313
|
dropBoxSize: _propTypes["default"].oneOf(['small', 'medium', 'large']),
|
package/lib/Popup/Popup.js
CHANGED
|
@@ -147,9 +147,8 @@ var Popup = function Popup(Component) {
|
|
|
147
147
|
isMobile: false
|
|
148
148
|
};
|
|
149
149
|
_this.togglePopup = _this.togglePopup.bind(_assertThisInitialized(_this));
|
|
150
|
-
_this.closePopups = _this.closePopups.bind(_assertThisInitialized(_this));
|
|
151
|
-
_this.handleDocumentInteraction = _this.handleDocumentInteraction.bind(_assertThisInitialized(_this));
|
|
152
150
|
_this.documentClickHandler = _this.documentClickHandler.bind(_assertThisInitialized(_this));
|
|
151
|
+
_this.documentClickHandler1 = _this.documentClickHandler1.bind(_assertThisInitialized(_this));
|
|
153
152
|
_this.removeClose = _this.removeClose.bind(_assertThisInitialized(_this));
|
|
154
153
|
_this.documentKeyupHandler = _this.documentKeyupHandler.bind(_assertThisInitialized(_this));
|
|
155
154
|
_this.openPopupOnly = _this.openPopupOnly.bind(_assertThisInitialized(_this));
|
|
@@ -211,11 +210,11 @@ var Popup = function Popup(Component) {
|
|
|
211
210
|
popups[group] = groupPopups;
|
|
212
211
|
|
|
213
212
|
if (Object.keys(popups).length === 1 && groupPopups.length === 1) {
|
|
214
|
-
document.addEventListener('click', this.handleDocumentInteraction, true);
|
|
215
213
|
document.addEventListener('click', this.documentClickHandler, false);
|
|
216
214
|
document.addEventListener('keyup', this.documentKeyupHandler, false); // document.addEventListener('scroll', this.handleScroll, true);
|
|
217
215
|
|
|
218
216
|
window.addEventListener('resize', this.handleResize);
|
|
217
|
+
document.addEventListener('click', this.documentClickHandler1, true);
|
|
219
218
|
document.addEventListener('mousedown', this.handleDocumentMouseDown, true);
|
|
220
219
|
document.addEventListener('focus', this.handleDocumentFocus, true);
|
|
221
220
|
}
|
|
@@ -305,11 +304,11 @@ var Popup = function Popup(Component) {
|
|
|
305
304
|
}
|
|
306
305
|
|
|
307
306
|
if (noPopups) {
|
|
308
|
-
document.removeEventListener('click', this.
|
|
309
|
-
document.removeEventListener('click', this.documentClickHandler, false);
|
|
307
|
+
document.removeEventListener('click', this.documentClickHandler);
|
|
310
308
|
document.removeEventListener('keyup', this.documentKeyupHandler); // document.removeEventListener('scroll', this.handleScroll);
|
|
311
309
|
|
|
312
310
|
window.removeEventListener('resize', this.handleResize);
|
|
311
|
+
document.removeEventListener('click', this.documentClickHandler1, true);
|
|
313
312
|
document.removeEventListener('mousedown', this.handleDocumentMouseDown, true);
|
|
314
313
|
document.removeEventListener('focus', this.handleDocumentFocus, true);
|
|
315
314
|
}
|
|
@@ -690,66 +689,31 @@ var Popup = function Popup(Component) {
|
|
|
690
689
|
return needPrevent;
|
|
691
690
|
}
|
|
692
691
|
}, {
|
|
693
|
-
key: "
|
|
694
|
-
value: function
|
|
695
|
-
var checkTarget = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
696
|
-
|
|
697
|
-
try {
|
|
698
|
-
Object.keys(popups).forEach(function (groupName) {
|
|
699
|
-
var openGroupPopups = (popups[groupName] || []).filter(function (popup) {
|
|
700
|
-
return popup.state.isPopupOpen;
|
|
701
|
-
});
|
|
702
|
-
openGroupPopups.forEach(function (popup) {
|
|
703
|
-
var dropElement = popup.dropElement,
|
|
704
|
-
placeHolderElement = popup.placeHolderElement;
|
|
705
|
-
|
|
706
|
-
var _ref5 = e || {},
|
|
707
|
-
target = _ref5.target;
|
|
708
|
-
|
|
709
|
-
var canClosePopup = !popup.props.checkBeforeClose || popup.props.checkBeforeClose && popup.props.checkBeforeClose() && !(0, _Common.isTextSelected)();
|
|
710
|
-
var isOutsideClick = checkTarget && placeHolderElement && dropElement && placeHolderElement !== target && !placeHolderElement.contains(target) && dropElement !== target && !dropElement.contains(target);
|
|
711
|
-
|
|
712
|
-
if (canClosePopup && (!checkTarget || isOutsideClick)) {
|
|
713
|
-
popup.setState({
|
|
714
|
-
isPopupOpen: false,
|
|
715
|
-
isPopupReady: false
|
|
716
|
-
});
|
|
717
|
-
}
|
|
718
|
-
});
|
|
719
|
-
});
|
|
720
|
-
|
|
721
|
-
if (!checkTarget) {
|
|
722
|
-
lastOpenedGroup = [];
|
|
723
|
-
}
|
|
724
|
-
} catch (error) {// eslint-disable-next-line no-console
|
|
725
|
-
//console.error('popup component not unmounted properly', error);
|
|
726
|
-
}
|
|
727
|
-
}
|
|
728
|
-
}, {
|
|
729
|
-
key: "documentClickHandler",
|
|
730
|
-
value: function documentClickHandler(e) {
|
|
731
|
-
// Handles document click events to close all popups.
|
|
732
|
-
// This function closes all popups without checking if the click occurred outside the popup.
|
|
733
|
-
this.closePopups(e, false);
|
|
734
|
-
}
|
|
735
|
-
}, {
|
|
736
|
-
key: "handleDocumentInteraction",
|
|
737
|
-
value: function handleDocumentInteraction(e) {
|
|
738
|
-
// Handles interactions with the document to determine whether to close the popup.
|
|
739
|
-
// This function is specifically designed to close the popup when clicking outside of it.
|
|
740
|
-
// Check if the click event should prevent popup closure.
|
|
692
|
+
key: "documentClickHandler1",
|
|
693
|
+
value: function documentClickHandler1(e) {
|
|
741
694
|
var needPrevent = this.handleGetNeedPrevent(e);
|
|
742
695
|
|
|
743
696
|
if (needPrevent) {
|
|
744
|
-
// If the click event should prevent popup closure:
|
|
745
|
-
// - Stop the event propagation.
|
|
746
|
-
// - Close the last opened group of popups.
|
|
747
697
|
this.removeClose(e);
|
|
748
698
|
this.handleCloseLastOpenedGroup();
|
|
749
|
-
}
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
}, {
|
|
702
|
+
key: "documentClickHandler",
|
|
703
|
+
value: function documentClickHandler() {
|
|
704
|
+
try {
|
|
705
|
+
Object.keys(popups).forEach(function (groupName) {
|
|
706
|
+
var groupPopups = popups[groupName] || [];
|
|
707
|
+
groupPopups.forEach(function (popup) {
|
|
708
|
+
popup.state.isPopupOpen && (!popup.props.checkBeforeClose || popup.props.checkBeforeClose && popup.props.checkBeforeClose()) && !(0, _Common.isTextSelected)() && popup.setState({
|
|
709
|
+
isPopupOpen: false,
|
|
710
|
+
isPopupReady: false
|
|
711
|
+
});
|
|
712
|
+
});
|
|
713
|
+
});
|
|
714
|
+
lastOpenedGroup = [];
|
|
715
|
+
} catch (e) {// eslint-disable-next-line no-console
|
|
716
|
+
//console.error('popup component not unmounted properly', e);
|
|
753
717
|
}
|
|
754
718
|
}
|
|
755
719
|
}, {
|
|
@@ -793,8 +757,8 @@ var Popup = function Popup(Component) {
|
|
|
793
757
|
var isUpdatePosition = arguments.length > 1 ? arguments[1] : undefined;
|
|
794
758
|
|
|
795
759
|
// isUpdatePosition --->>> Window resize and dropBox resize and to update the position
|
|
796
|
-
var
|
|
797
|
-
direction =
|
|
760
|
+
var _ref5 = this.context || {},
|
|
761
|
+
direction = _ref5.direction;
|
|
798
762
|
|
|
799
763
|
var placeHolderElement = this.placeHolderElement,
|
|
800
764
|
dropElement = this.dropElement;
|
|
@@ -833,12 +797,12 @@ var Popup = function Popup(Component) {
|
|
|
833
797
|
customOrder: customOrder
|
|
834
798
|
});
|
|
835
799
|
|
|
836
|
-
var
|
|
837
|
-
view =
|
|
838
|
-
views =
|
|
839
|
-
viewsOffset =
|
|
840
|
-
targetOffset =
|
|
841
|
-
popupOffset =
|
|
800
|
+
var _ref6 = betterPosition || _Common.DUMMY_OBJECT,
|
|
801
|
+
view = _ref6.view,
|
|
802
|
+
views = _ref6.views,
|
|
803
|
+
viewsOffset = _ref6.viewsOffset,
|
|
804
|
+
targetOffset = _ref6.targetOffset,
|
|
805
|
+
popupOffset = _ref6.popupOffset;
|
|
842
806
|
|
|
843
807
|
if (!isAbsolute) {
|
|
844
808
|
if (!isPopupReady) {
|
|
@@ -902,33 +866,33 @@ var Popup = function Popup(Component) {
|
|
|
902
866
|
customOrder: customOrder
|
|
903
867
|
});
|
|
904
868
|
|
|
905
|
-
var
|
|
906
|
-
view =
|
|
907
|
-
views =
|
|
908
|
-
|
|
909
|
-
viewsOffset =
|
|
910
|
-
targetOffset =
|
|
911
|
-
popupOffset =
|
|
912
|
-
|
|
913
|
-
var
|
|
869
|
+
var _ref7 = betterPosition || {},
|
|
870
|
+
view = _ref7.view,
|
|
871
|
+
views = _ref7.views,
|
|
872
|
+
_ref7$viewsOffset = _ref7.viewsOffset,
|
|
873
|
+
viewsOffset = _ref7$viewsOffset === void 0 ? {} : _ref7$viewsOffset,
|
|
874
|
+
targetOffset = _ref7.targetOffset,
|
|
875
|
+
popupOffset = _ref7.popupOffset;
|
|
876
|
+
|
|
877
|
+
var _ref8 = positionsOffset[position] || {},
|
|
878
|
+
_ref8$left = _ref8.left,
|
|
879
|
+
oldLeft = _ref8$left === void 0 ? '' : _ref8$left,
|
|
880
|
+
_ref8$top = _ref8.top,
|
|
881
|
+
oldTop = _ref8$top === void 0 ? '' : _ref8$top,
|
|
882
|
+
_ref8$bottom = _ref8.bottom,
|
|
883
|
+
oldBottom = _ref8$bottom === void 0 ? '' : _ref8$bottom,
|
|
884
|
+
_ref8$right = _ref8.right,
|
|
885
|
+
oldRight = _ref8$right === void 0 ? '' : _ref8$right;
|
|
886
|
+
|
|
887
|
+
var _ref9 = viewsOffset[view] || {},
|
|
914
888
|
_ref9$left = _ref9.left,
|
|
915
|
-
|
|
889
|
+
left = _ref9$left === void 0 ? '' : _ref9$left,
|
|
916
890
|
_ref9$top = _ref9.top,
|
|
917
|
-
|
|
891
|
+
top = _ref9$top === void 0 ? '' : _ref9$top,
|
|
918
892
|
_ref9$bottom = _ref9.bottom,
|
|
919
|
-
|
|
893
|
+
bottom = _ref9$bottom === void 0 ? '' : _ref9$bottom,
|
|
920
894
|
_ref9$right = _ref9.right,
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
var _ref10 = viewsOffset[view] || {},
|
|
924
|
-
_ref10$left = _ref10.left,
|
|
925
|
-
left = _ref10$left === void 0 ? '' : _ref10$left,
|
|
926
|
-
_ref10$top = _ref10.top,
|
|
927
|
-
top = _ref10$top === void 0 ? '' : _ref10$top,
|
|
928
|
-
_ref10$bottom = _ref10.bottom,
|
|
929
|
-
bottom = _ref10$bottom === void 0 ? '' : _ref10$bottom,
|
|
930
|
-
_ref10$right = _ref10.right,
|
|
931
|
-
right = _ref10$right === void 0 ? '' : _ref10$right;
|
|
895
|
+
right = _ref9$right === void 0 ? '' : _ref9$right;
|
|
932
896
|
|
|
933
897
|
var changeState = isAbsolute ? position !== view : oldLeft !== left || oldTop !== top || oldBottom !== bottom || oldRight !== right; // let isInViewPort = viewPort.isInViewPort(
|
|
934
898
|
// placeHolderElement,
|
|
@@ -987,11 +951,11 @@ var Popup = function Popup(Component) {
|
|
|
987
951
|
var height = popupSize.height,
|
|
988
952
|
width = popupSize.width;
|
|
989
953
|
|
|
990
|
-
var
|
|
991
|
-
|
|
992
|
-
oldHeight =
|
|
993
|
-
|
|
994
|
-
oldWidth =
|
|
954
|
+
var _ref10 = this.size || {},
|
|
955
|
+
_ref10$height = _ref10.height,
|
|
956
|
+
oldHeight = _ref10$height === void 0 ? 0 : _ref10$height,
|
|
957
|
+
_ref10$width = _ref10.width,
|
|
958
|
+
oldWidth = _ref10$width === void 0 ? 0 : _ref10$width;
|
|
995
959
|
|
|
996
960
|
var _this$state2 = this.state,
|
|
997
961
|
isPopupReady = _this$state2.isPopupReady,
|