@zohodesk/components 1.0.0-temp-230.1 → 1.0.0-temp-234
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/propValidation_report.html +1 -1
- package/README.md +41 -11
- package/assets/Appearance/dark/mode/Component_DarkMode.module.css +0 -8
- package/assets/Appearance/light/mode/Component_LightMode.module.css +0 -8
- package/assets/Appearance/pureDark/mode/Component_PureDarkMode.module.css +0 -8
- package/es/DateTime/__tests__/__snapshots__/DateTime.spec.js.snap +18 -9
- package/es/DateTime/__tests__/__snapshots__/DateWidget.spec.js.snap +6 -3
- package/es/DateTime/__tests__/__snapshots__/Time.spec.js.snap +18 -9
- package/es/ListItem/ListItem.js +7 -8
- package/es/ListItem/ListItem.module.css +0 -6
- package/es/ListItem/ListItemWithAvatar.js +12 -6
- package/es/ListItem/ListItemWithCheckBox.js +12 -6
- package/es/ListItem/ListItemWithIcon.js +11 -5
- package/es/ListItem/ListItemWithRadio.js +12 -6
- package/es/ListItem/__tests__/ListItem.spec.js +14 -3
- package/es/ListItem/__tests__/ListItemWithAvatar.spec.js +19 -0
- package/es/ListItem/__tests__/ListItemWithCheckBox.spec.js +19 -0
- package/es/ListItem/__tests__/ListItemWithIcon.spec.js +17 -0
- package/es/ListItem/__tests__/ListItemWithRadio.spec.js +19 -0
- package/es/ListItem/__tests__/__snapshots__/ListItem.spec.js.snap +38 -7
- package/es/ListItem/__tests__/__snapshots__/ListItemWithAvatar.spec.js.snap +140 -46
- package/es/ListItem/__tests__/__snapshots__/ListItemWithCheckBox.spec.js.snap +251 -49
- package/es/ListItem/__tests__/__snapshots__/ListItemWithIcon.spec.js.snap +144 -50
- package/es/ListItem/__tests__/__snapshots__/ListItemWithRadio.spec.js.snap +252 -52
- package/es/ListItem/props/propTypes.js +14 -5
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +16 -8
- package/es/MultiSelect/AdvancedMultiSelect.js +13 -6
- package/es/MultiSelect/EmptyState.js +2 -1
- package/es/MultiSelect/MultiSelect.js +67 -35
- package/es/MultiSelect/MultiSelectWithAvatar.js +9 -2
- package/es/MultiSelect/SelectedOptions.js +3 -24
- package/es/MultiSelect/Suggestions.js +175 -98
- package/es/MultiSelect/__tests__/MultiSelect.spec.js +19 -32
- package/es/MultiSelect/__tests__/SelectedOptions.spec.js +0 -13
- package/es/MultiSelect/__tests__/Suggestions.spec.js +52 -6
- package/es/MultiSelect/__tests__/__snapshots__/AdvancedGroupMultiSelect.spec.js.snap +3 -3
- package/es/MultiSelect/__tests__/__snapshots__/AdvancedMultiSelect.spec.js.snap +9 -9
- package/es/MultiSelect/__tests__/__snapshots__/MultiSelect.spec.js.snap +178 -10
- package/es/MultiSelect/__tests__/__snapshots__/MultiSelectWithAvatar.spec.js.snap +3 -3
- package/es/MultiSelect/__tests__/__snapshots__/SelectedOptions.spec.js.snap +0 -15
- package/es/MultiSelect/__tests__/__snapshots__/Suggestions.spec.js.snap +308 -31
- package/es/MultiSelect/constants.js +6 -0
- package/es/MultiSelect/props/defaultProps.js +2 -0
- package/es/MultiSelect/props/propTypes.js +16 -58
- package/es/Select/GroupSelect.js +4 -2
- package/es/Select/Select.js +50 -44
- package/es/Select/SelectWithAvatar.js +14 -3
- package/es/Select/SelectWithIcon.js +7 -3
- package/es/Select/__tests__/Select.spec.js +0 -10
- package/es/Select/__tests__/__snapshots__/GroupSelect.spec.js.snap +6 -3
- package/es/Select/__tests__/__snapshots__/Select.spec.js.snap +429 -245
- package/es/Select/__tests__/__snapshots__/SelectWithIcon.spec.js.snap +6 -3
- package/es/Select/props/defaultProps.js +2 -0
- package/es/Select/props/propTypes.js +7 -2
- package/es/TextBoxIcon/TextBoxIcon.js +12 -17
- package/es/TextBoxIcon/TextBoxIcon.module.css +38 -3
- package/es/TextBoxIcon/__tests__/TextBoxIcon.spec.js +2 -1
- package/es/TextBoxIcon/__tests__/__snapshots__/TextBoxIcon.spec.js.snap +225 -116
- package/es/TextBoxIcon/props/propTypes.js +2 -1
- package/es/utils/Common.js +3 -4
- package/es/utils/dropDownUtils.js +40 -16
- package/lib/DateTime/__tests__/__snapshots__/DateTime.spec.js.snap +18 -9
- package/lib/DateTime/__tests__/__snapshots__/DateWidget.spec.js.snap +6 -3
- package/lib/DateTime/__tests__/__snapshots__/Time.spec.js.snap +18 -9
- package/lib/ListItem/ListItem.js +8 -8
- package/lib/ListItem/ListItem.module.css +0 -6
- package/lib/ListItem/ListItemWithAvatar.js +13 -6
- package/lib/ListItem/ListItemWithCheckBox.js +13 -6
- package/lib/ListItem/ListItemWithIcon.js +11 -5
- package/lib/ListItem/ListItemWithRadio.js +13 -6
- package/lib/ListItem/__tests__/ListItem.spec.js +18 -3
- package/lib/ListItem/__tests__/ListItemWithAvatar.spec.js +23 -0
- package/lib/ListItem/__tests__/ListItemWithCheckBox.spec.js +23 -0
- package/lib/ListItem/__tests__/ListItemWithIcon.spec.js +21 -0
- package/lib/ListItem/__tests__/ListItemWithRadio.spec.js +23 -0
- package/lib/ListItem/__tests__/__snapshots__/ListItem.spec.js.snap +38 -7
- package/lib/ListItem/__tests__/__snapshots__/ListItemWithAvatar.spec.js.snap +140 -46
- package/lib/ListItem/__tests__/__snapshots__/ListItemWithCheckBox.spec.js.snap +251 -49
- package/lib/ListItem/__tests__/__snapshots__/ListItemWithIcon.spec.js.snap +144 -50
- package/lib/ListItem/__tests__/__snapshots__/ListItemWithRadio.spec.js.snap +252 -52
- package/lib/ListItem/props/propTypes.js +14 -6
- package/lib/MultiSelect/AdvancedGroupMultiSelect.js +94 -83
- package/lib/MultiSelect/AdvancedMultiSelect.js +16 -7
- package/lib/MultiSelect/EmptyState.js +3 -1
- package/lib/MultiSelect/MultiSelect.js +68 -33
- package/lib/MultiSelect/MultiSelectWithAvatar.js +11 -3
- package/lib/MultiSelect/SelectedOptions.js +3 -24
- package/lib/MultiSelect/Suggestions.js +177 -101
- package/lib/MultiSelect/__tests__/MultiSelect.spec.js +19 -34
- package/lib/MultiSelect/__tests__/SelectedOptions.spec.js +0 -15
- package/lib/MultiSelect/__tests__/Suggestions.spec.js +52 -8
- package/lib/MultiSelect/__tests__/__snapshots__/AdvancedGroupMultiSelect.spec.js.snap +3 -3
- package/lib/MultiSelect/__tests__/__snapshots__/AdvancedMultiSelect.spec.js.snap +9 -9
- package/lib/MultiSelect/__tests__/__snapshots__/MultiSelect.spec.js.snap +178 -10
- package/lib/MultiSelect/__tests__/__snapshots__/MultiSelectWithAvatar.spec.js.snap +3 -3
- package/lib/MultiSelect/__tests__/__snapshots__/SelectedOptions.spec.js.snap +0 -15
- package/lib/MultiSelect/__tests__/__snapshots__/Suggestions.spec.js.snap +308 -31
- package/lib/MultiSelect/constants.js +13 -0
- package/lib/MultiSelect/props/defaultProps.js +2 -0
- package/lib/MultiSelect/props/propTypes.js +15 -58
- package/lib/Select/GroupSelect.js +4 -3
- package/lib/Select/Select.js +48 -41
- package/lib/Select/SelectWithAvatar.js +14 -6
- package/lib/Select/SelectWithIcon.js +7 -4
- package/lib/Select/__tests__/Select.spec.js +0 -12
- package/lib/Select/__tests__/__snapshots__/GroupSelect.spec.js.snap +6 -3
- package/lib/Select/__tests__/__snapshots__/Select.spec.js.snap +429 -245
- package/lib/Select/__tests__/__snapshots__/SelectWithIcon.spec.js.snap +6 -3
- package/lib/Select/props/defaultProps.js +2 -0
- package/lib/Select/props/propTypes.js +7 -2
- package/lib/TextBoxIcon/TextBoxIcon.js +13 -18
- package/lib/TextBoxIcon/TextBoxIcon.module.css +38 -3
- package/lib/TextBoxIcon/__tests__/TextBoxIcon.spec.js +2 -1
- package/lib/TextBoxIcon/__tests__/__snapshots__/TextBoxIcon.spec.js.snap +225 -116
- package/lib/TextBoxIcon/props/propTypes.js +2 -1
- package/lib/utils/Common.js +5 -9
- package/lib/utils/dropDownUtils.js +40 -15
- package/package.json +10 -10
- package/es/ColorSelect/ColorMultiSelect.js +0 -36
- package/es/ColorSelect/ColorSingleSelect.js +0 -50
- package/es/ColorSelect/__tests__/ColorMultiSelect.spec.js +0 -59
- package/es/ColorSelect/__tests__/ColorSingleSelect.spec.js +0 -59
- package/es/ColorSelect/__tests__/__snapshots__/ColorMultiSelect.spec.js.snap +0 -547
- package/es/ColorSelect/__tests__/__snapshots__/ColorSingleSelect.spec.js.snap +0 -178
- package/es/ColorSelect/common/ColorIndicator/ColorIndicator.js +0 -27
- package/es/ColorSelect/common/ColorIndicator/ColorIndicator.module.css +0 -18
- package/es/ColorSelect/common/ColorIndicator/__tests__/ColorSingleSelect.spec.js +0 -60
- package/es/ColorSelect/common/ColorIndicator/__tests__/__snapshots__/ColorSingleSelect.spec.js.snap +0 -95
- package/es/ColorSelect/common/ColorIndicator/props/defaultProps.js +0 -7
- package/es/ColorSelect/common/ColorIndicator/props/propTypes.js +0 -9
- package/es/ColorSelect/common/ColoredTag/ColoredTag.js +0 -33
- package/es/ColorSelect/common/ColoredTag/__tests__/ColoredTag.spec.js +0 -50
- package/es/ColorSelect/common/ColoredTag/__tests__/__snapshots__/ColoredTag.spec.js.snap +0 -101
- package/es/ColorSelect/common/ColoredTag/props/propTypes.js +0 -9
- package/es/ColorSelect/common/helpers.js +0 -35
- package/es/ColorSelect/props/defaultProps.js +0 -13
- package/es/ColorSelect/props/propTypes.js +0 -14
- package/es/shared/ArrowIcon/ArrowIcon.js +0 -36
- package/es/shared/ArrowIcon/ArrowIcon.module.css +0 -22
- package/es/shared/ArrowIcon/props/defaultProps.js +0 -6
- package/es/shared/ArrowIcon/props/propTypes.js +0 -10
- package/es/shared/InputFieldLine/InputFieldLine.js +0 -39
- package/es/shared/InputFieldLine/InputFieldLine.module.css +0 -90
- package/es/shared/InputFieldLine/__tests__/InputFieldLine.spec.js +0 -114
- package/es/shared/InputFieldLine/__tests__/__snapshots__/InputFieldLine.spec.js.snap +0 -194
- package/es/shared/InputFieldLine/props/defaultProps.js +0 -14
- package/es/shared/InputFieldLine/props/propTypes.js +0 -19
- package/lib/ColorSelect/ColorMultiSelect.js +0 -65
- package/lib/ColorSelect/ColorSingleSelect.js +0 -78
- package/lib/ColorSelect/__tests__/ColorMultiSelect.spec.js +0 -70
- package/lib/ColorSelect/__tests__/ColorSingleSelect.spec.js +0 -70
- package/lib/ColorSelect/__tests__/__snapshots__/ColorMultiSelect.spec.js.snap +0 -547
- package/lib/ColorSelect/__tests__/__snapshots__/ColorSingleSelect.spec.js.snap +0 -178
- package/lib/ColorSelect/common/ColorIndicator/ColorIndicator.js +0 -40
- package/lib/ColorSelect/common/ColorIndicator/ColorIndicator.module.css +0 -18
- package/lib/ColorSelect/common/ColorIndicator/__tests__/ColorSingleSelect.spec.js +0 -67
- package/lib/ColorSelect/common/ColorIndicator/__tests__/__snapshots__/ColorSingleSelect.spec.js.snap +0 -95
- package/lib/ColorSelect/common/ColorIndicator/props/defaultProps.js +0 -14
- package/lib/ColorSelect/common/ColorIndicator/props/propTypes.js +0 -20
- package/lib/ColorSelect/common/ColoredTag/ColoredTag.js +0 -61
- package/lib/ColorSelect/common/ColoredTag/__tests__/ColoredTag.spec.js +0 -58
- package/lib/ColorSelect/common/ColoredTag/__tests__/__snapshots__/ColoredTag.spec.js.snap +0 -101
- package/lib/ColorSelect/common/ColoredTag/props/propTypes.js +0 -28
- package/lib/ColorSelect/common/helpers.js +0 -53
- package/lib/ColorSelect/props/defaultProps.js +0 -31
- package/lib/ColorSelect/props/propTypes.js +0 -35
- package/lib/shared/ArrowIcon/ArrowIcon.js +0 -51
- package/lib/shared/ArrowIcon/ArrowIcon.module.css +0 -22
- package/lib/shared/ArrowIcon/props/defaultProps.js +0 -13
- package/lib/shared/ArrowIcon/props/propTypes.js +0 -21
- package/lib/shared/InputFieldLine/InputFieldLine.js +0 -53
- package/lib/shared/InputFieldLine/InputFieldLine.module.css +0 -90
- package/lib/shared/InputFieldLine/__tests__/InputFieldLine.spec.js +0 -122
- package/lib/shared/InputFieldLine/__tests__/__snapshots__/InputFieldLine.spec.js.snap +0 -194
- package/lib/shared/InputFieldLine/props/defaultProps.js +0 -21
- package/lib/shared/InputFieldLine/props/propTypes.js +0 -36
|
@@ -31,17 +31,20 @@ export const MultiSelect_propTypes = {
|
|
|
31
31
|
disableAction: PropTypes.bool,
|
|
32
32
|
dropBoxSize: PropTypes.oneOf(['small', 'medium', 'large']),
|
|
33
33
|
emptyMessage: PropTypes.string.isRequired,
|
|
34
|
+
isVirtualizerEnabled: PropTypes.bool,
|
|
34
35
|
getContainerRef: PropTypes.func,
|
|
35
36
|
getNextOptions: PropTypes.func,
|
|
36
37
|
getPublicMethods: PropTypes.func,
|
|
37
38
|
getRef: PropTypes.func,
|
|
38
39
|
getTargetRef: PropTypes.func,
|
|
39
40
|
i18nKeys: PropTypes.shape({
|
|
41
|
+
searchText: PropTypes.string,
|
|
40
42
|
clearText: PropTypes.string,
|
|
41
43
|
loadingText: PropTypes.string,
|
|
42
44
|
emptyText: PropTypes.string,
|
|
43
45
|
noMoreText: PropTypes.string,
|
|
44
|
-
searchEmptyText: PropTypes.string
|
|
46
|
+
searchEmptyText: PropTypes.string,
|
|
47
|
+
limitReachedMessage: PropTypes.string
|
|
45
48
|
}),
|
|
46
49
|
a11y: PropTypes.shape({
|
|
47
50
|
clearLabel: PropTypes.string
|
|
@@ -117,7 +120,7 @@ export const MultiSelect_propTypes = {
|
|
|
117
120
|
allowValueFallback: PropTypes.bool,
|
|
118
121
|
renderCustomClearComponent: PropTypes.func,
|
|
119
122
|
renderCustomToggleIndicator: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
|
|
120
|
-
|
|
123
|
+
limit: PropTypes.number
|
|
121
124
|
};
|
|
122
125
|
export const MultiSelectHeader_propTypes = {
|
|
123
126
|
dataId: PropTypes.string,
|
|
@@ -155,10 +158,7 @@ export const SelectedOptions_propTypes = {
|
|
|
155
158
|
size: PropTypes.oneOf(['medium', 'xmedium']),
|
|
156
159
|
palette: PropTypes.string,
|
|
157
160
|
dataId: PropTypes.string,
|
|
158
|
-
|
|
159
|
-
isPopupReady: PropTypes.bool,
|
|
160
|
-
isPopupOpen: PropTypes.bool,
|
|
161
|
-
renderCustomSelectedValue: PropTypes.oneOfType([PropTypes.func, PropTypes.node])
|
|
161
|
+
limit: PropTypes.number
|
|
162
162
|
};
|
|
163
163
|
export const Suggestions_propTypes = {
|
|
164
164
|
a11y: PropTypes.shape({
|
|
@@ -169,6 +169,9 @@ export const Suggestions_propTypes = {
|
|
|
169
169
|
avatarPalette: PropTypes.string,
|
|
170
170
|
className: PropTypes.string,
|
|
171
171
|
dataId: PropTypes.string,
|
|
172
|
+
isVirtualizerEnabled: PropTypes.bool,
|
|
173
|
+
setVirtualizerContainerRefFunction: PropTypes.func,
|
|
174
|
+
getVirtualizerPublicMethods: PropTypes.func,
|
|
172
175
|
getRef: PropTypes.func,
|
|
173
176
|
hoverId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
174
177
|
hoverOption: PropTypes.number,
|
|
@@ -189,7 +192,8 @@ export const Suggestions_propTypes = {
|
|
|
189
192
|
optionType: PropTypes.string,
|
|
190
193
|
listItemProps: PropTypes.object
|
|
191
194
|
})),
|
|
192
|
-
|
|
195
|
+
limit: PropTypes.number,
|
|
196
|
+
limitReachedMessage: PropTypes.string
|
|
193
197
|
};
|
|
194
198
|
export const AdvancedGroupMultiSelect_propTypes = {
|
|
195
199
|
animationStyle: PropTypes.string,
|
|
@@ -207,7 +211,8 @@ export const AdvancedGroupMultiSelect_propTypes = {
|
|
|
207
211
|
loadingText: PropTypes.string,
|
|
208
212
|
emptyText: PropTypes.string,
|
|
209
213
|
noMoreText: PropTypes.string,
|
|
210
|
-
searchEmptyText: PropTypes.string
|
|
214
|
+
searchEmptyText: PropTypes.string,
|
|
215
|
+
limitReachedMessage: PropTypes.string
|
|
211
216
|
}),
|
|
212
217
|
a11y: PropTypes.shape({
|
|
213
218
|
clearLabel: PropTypes.string
|
|
@@ -261,7 +266,8 @@ export const AdvancedGroupMultiSelect_propTypes = {
|
|
|
261
266
|
children: PropTypes.node,
|
|
262
267
|
dataSelectorId: PropTypes.string,
|
|
263
268
|
isFocus: PropTypes.bool,
|
|
264
|
-
allowValueFallback: PropTypes.bool
|
|
269
|
+
allowValueFallback: PropTypes.bool,
|
|
270
|
+
limit: PropTypes.number
|
|
265
271
|
};
|
|
266
272
|
export const AdvancedMultiSelect_propTypes = { ...MultiSelect_propTypes,
|
|
267
273
|
selectedOptionDetails: PropTypes.string,
|
|
@@ -275,68 +281,20 @@ export const AdvancedMultiSelect_propTypes = { ...MultiSelect_propTypes,
|
|
|
275
281
|
selectedOptions: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])).isRequired,
|
|
276
282
|
selectedOptionsLimit: PropTypes.number,
|
|
277
283
|
getSelectedOptionDetails: PropTypes.func,
|
|
278
|
-
emptyMessage: PropTypes.string.isRequired,
|
|
279
|
-
isDisabled: PropTypes.bool,
|
|
280
|
-
isReadOnly: PropTypes.bool,
|
|
281
|
-
needLocalSearch: PropTypes.bool,
|
|
282
|
-
needSelectAll: PropTypes.bool,
|
|
283
|
-
onChange: PropTypes.func.isRequired,
|
|
284
|
-
searchEmptyMessage: PropTypes.string,
|
|
285
|
-
placeHolder: PropTypes.string,
|
|
286
|
-
selectAllText: PropTypes.string,
|
|
287
|
-
textField: PropTypes.string,
|
|
288
|
-
valueField: PropTypes.string,
|
|
289
284
|
imageField: PropTypes.string,
|
|
290
285
|
iconName: PropTypes.string,
|
|
291
286
|
prefixText: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
292
287
|
//For grouping multiSelect
|
|
293
288
|
optionType: PropTypes.oneOf(['default', 'avatar', 'icon']),
|
|
294
|
-
needEffect: PropTypes.bool,
|
|
295
289
|
secondaryField: PropTypes.string,
|
|
296
|
-
animationStyle: PropTypes.string,
|
|
297
|
-
defaultDropBoxPosition: PropTypes.oneOf(['bottom', 'top', 'left', 'right']),
|
|
298
|
-
dropBoxSize: PropTypes.oneOf(['small', 'medium', 'large']),
|
|
299
|
-
isAnimate: PropTypes.bool,
|
|
300
|
-
size: PropTypes.oneOf(['medium', 'xmedium']),
|
|
301
|
-
textBoxSize: PropTypes.oneOf(['small', 'medium', 'xmedium']),
|
|
302
|
-
title: PropTypes.string,
|
|
303
|
-
variant: PropTypes.string,
|
|
304
290
|
dataIdClearIcon: PropTypes.string,
|
|
305
291
|
dataIdLoading: PropTypes.string,
|
|
306
292
|
dataIdMultiSelectComp: PropTypes.string,
|
|
307
293
|
dataIdSelectAllEle: PropTypes.string,
|
|
308
|
-
|
|
309
|
-
/**** Popup Props ****/
|
|
310
|
-
isPopupOpen: PropTypes.bool,
|
|
311
|
-
isPopupReady: PropTypes.bool,
|
|
312
|
-
togglePopup: PropTypes.func,
|
|
313
|
-
getContainerRef: PropTypes.func,
|
|
314
|
-
position: PropTypes.string,
|
|
315
|
-
removeClose: PropTypes.func,
|
|
316
294
|
listItemSize: PropTypes.oneOf(['small', 'medium', 'large']),
|
|
317
|
-
needBorder: PropTypes.bool,
|
|
318
|
-
htmlId: PropTypes.string,
|
|
319
|
-
i18nKeys: PropTypes.shape({
|
|
320
|
-
clearText: PropTypes.string,
|
|
321
|
-
loadingText: PropTypes.string,
|
|
322
|
-
emptyText: PropTypes.string,
|
|
323
|
-
noMoreText: PropTypes.string,
|
|
324
|
-
searchEmptyText: PropTypes.string
|
|
325
|
-
}),
|
|
326
|
-
a11y: PropTypes.shape({
|
|
327
|
-
clearLabel: PropTypes.string
|
|
328
|
-
}),
|
|
329
|
-
borderColor: PropTypes.oneOf(['transparent', 'default', 'dark']),
|
|
330
|
-
isBoxPaddingNeed: PropTypes.bool,
|
|
331
|
-
isSearchClearOnSelect: PropTypes.bool,
|
|
332
|
-
disabledOptions: PropTypes.arrayOf(PropTypes.string),
|
|
333
|
-
getFooter: PropTypes.func,
|
|
334
295
|
customProps: PropTypes.shape({
|
|
335
296
|
SuggestionsProps: PropTypes.object,
|
|
336
297
|
DropBoxProps: PropTypes.object
|
|
337
298
|
}),
|
|
338
|
-
|
|
339
|
-
dataSelectorId: PropTypes.string,
|
|
340
|
-
customClass: PropTypes.object,
|
|
341
|
-
isFocus: PropTypes.bool
|
|
299
|
+
customClass: PropTypes.object
|
|
342
300
|
};
|
package/es/Select/GroupSelect.js
CHANGED
|
@@ -622,7 +622,8 @@ export class GroupSelectComponent extends PureComponent {
|
|
|
622
622
|
let ariaErrorId = this.getNextAriaId();
|
|
623
623
|
let {
|
|
624
624
|
TextBoxIconProps = {},
|
|
625
|
-
TextBoxProps = {}
|
|
625
|
+
TextBoxProps = {},
|
|
626
|
+
SuggestionsProps
|
|
626
627
|
} = customProps;
|
|
627
628
|
return /*#__PURE__*/React.createElement("div", {
|
|
628
629
|
className: `${style.container} ${style[`box_${size}`]} ${isReadOnly ? style.readonly : ''} ${borderColor === 'transparent' ? style.transparentContainer : ''} ${iconOnHover && (isReadOnly || isDisabled) ? style.iconOnHoverReadonly : iconOnHover && !(isReadOnly || isDisabled) ? style.iconOnHoverStyle : ''}`,
|
|
@@ -791,7 +792,8 @@ export class GroupSelectComponent extends PureComponent {
|
|
|
791
792
|
ariaParentRole: 'listbox',
|
|
792
793
|
role: 'option'
|
|
793
794
|
},
|
|
794
|
-
dataId: `${dataId}_Options
|
|
795
|
+
dataId: `${dataId}_Options`,
|
|
796
|
+
...SuggestionsProps
|
|
795
797
|
}));
|
|
796
798
|
}) : /*#__PURE__*/React.createElement(EmptyState, {
|
|
797
799
|
options: revampedGroups,
|
package/es/Select/Select.js
CHANGED
|
@@ -16,11 +16,10 @@ import { Icon } from '@zohodesk/icons';
|
|
|
16
16
|
import ResponsiveDropBox from "../ResponsiveDropBox/ResponsiveDropBox";
|
|
17
17
|
import { ResponsiveReceiver } from "../Responsive/CustomResponsive";
|
|
18
18
|
import Loader from '@zohodesk/svg/lib/Loader/Loader';
|
|
19
|
-
import InputFieldLine from "../shared/InputFieldLine/InputFieldLine.js";
|
|
20
19
|
/**** Methods ****/
|
|
21
20
|
|
|
22
|
-
import { makeFormatOptions, makeGetMultiSelectFilterSuggestions as makeGetFilterSuggestions, makeGetSelectedValueText as makeGetSelectedValue } from "../utils/dropDownUtils";
|
|
23
|
-
import { debounce, scrollTo, getIsEmptyValue, getSearchString, findScrollEnd, getKeyValue
|
|
21
|
+
import { dummyObj, makeFormatOptions, makeGetMultiSelectFilterSuggestions as makeGetFilterSuggestions, makeGetSelectedValueText as makeGetSelectedValue } from "../utils/dropDownUtils";
|
|
22
|
+
import { debounce, scrollTo, getIsEmptyValue, getSearchString, findScrollEnd, getKeyValue } from "../utils/Common.js";
|
|
24
23
|
/**** CSS ****/
|
|
25
24
|
|
|
26
25
|
import style from "./Select.module.css";
|
|
@@ -72,7 +71,6 @@ export class SelectComponent extends Component {
|
|
|
72
71
|
|
|
73
72
|
this.state = {
|
|
74
73
|
selected,
|
|
75
|
-
selectedValueDetails,
|
|
76
74
|
options: allOptions,
|
|
77
75
|
optionsNormalize: normalizedAllOptions,
|
|
78
76
|
hoverIndex,
|
|
@@ -108,6 +106,8 @@ export class SelectComponent extends Component {
|
|
|
108
106
|
this.handleAddNewOption = this.handleAddNewOption.bind(this);
|
|
109
107
|
this.handleExposePopupHandlers = this.handleExposePopupHandlers.bind(this);
|
|
110
108
|
this.handleGetAddNewOptionText = this.handleGetAddNewOptionText.bind(this);
|
|
109
|
+
this.getVirtualizerPublicMethods = this.getVirtualizerPublicMethods.bind(this);
|
|
110
|
+
this.setSuggestionsVirtualizerContainerRefFunction = this.setSuggestionsVirtualizerContainerRefFunction.bind(this);
|
|
111
111
|
this.valueInputTypeString = '';
|
|
112
112
|
this.valueInputSearchString = '';
|
|
113
113
|
this.autoSelectSuggestions = [];
|
|
@@ -169,18 +169,13 @@ export class SelectComponent extends Component {
|
|
|
169
169
|
options: allOptions,
|
|
170
170
|
optionsNormalize: normalizedAllOptions,
|
|
171
171
|
selected,
|
|
172
|
-
selectedValueDetails,
|
|
173
172
|
hoverIndex: oldHoverIndex ? oldHoverIndex : hoverIndex,
|
|
174
173
|
selectedId,
|
|
175
174
|
selectedValueIndex: hoverIndex
|
|
176
175
|
});
|
|
177
176
|
}
|
|
178
177
|
|
|
179
|
-
componentDidUpdate(prevProps) {
|
|
180
|
-
let {
|
|
181
|
-
suggestionContainer,
|
|
182
|
-
optionsOrder
|
|
183
|
-
} = this;
|
|
178
|
+
componentDidUpdate(prevProps, prevState) {
|
|
184
179
|
let {
|
|
185
180
|
hoverIndex,
|
|
186
181
|
searchStr,
|
|
@@ -193,15 +188,31 @@ export class SelectComponent extends Component {
|
|
|
193
188
|
needSearch,
|
|
194
189
|
onSearch,
|
|
195
190
|
isPopupOpen,
|
|
196
|
-
isSearchClearOnClose
|
|
191
|
+
isSearchClearOnClose,
|
|
192
|
+
isVirtualizerEnabled
|
|
197
193
|
} = this.props;
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
194
|
+
|
|
195
|
+
if (isVirtualizerEnabled && !!this.virtualizerMethods) {
|
|
196
|
+
let position = prevState.hoverIndex > hoverIndex ? 'top' : 'bottom';
|
|
197
|
+
this.virtualizerMethods.getElementVisiblePercentage(hoverIndex) < 50 && this.virtualizerMethods.scrollToIndex(hoverIndex, position);
|
|
198
|
+
} else {
|
|
199
|
+
let {
|
|
200
|
+
suggestionContainer,
|
|
201
|
+
optionsOrder
|
|
202
|
+
} = this;
|
|
203
|
+
let hoverId = getIsEmptyValue(optionsOrder[hoverIndex]) ? '' : optionsOrder[hoverIndex];
|
|
204
|
+
let selSuggestion = this[`suggestion_${hoverId}`];
|
|
205
|
+
isPopupOpen && scrollTo(suggestionContainer, selSuggestion);
|
|
206
|
+
}
|
|
201
207
|
|
|
202
208
|
if (prevProps.isPopupOpen !== isPopupOpen) {
|
|
203
209
|
if (isPopupOpen) {
|
|
204
210
|
onDropBoxOpen && this.handleFetchOptions(onDropBoxOpen, searchStr);
|
|
211
|
+
|
|
212
|
+
if (isVirtualizerEnabled && !!this.virtualizerMethods) {
|
|
213
|
+
this.virtualizerMethods.getElementVisiblePercentage(hoverIndex) < 50 && this.virtualizerMethods.scrollToIndex(hoverIndex);
|
|
214
|
+
}
|
|
215
|
+
|
|
205
216
|
setTimeout(() => {
|
|
206
217
|
this.searchInput && this.searchInput.focus({
|
|
207
218
|
preventScroll: true
|
|
@@ -254,15 +265,19 @@ export class SelectComponent extends Component {
|
|
|
254
265
|
valueField,
|
|
255
266
|
textField,
|
|
256
267
|
allowValueFallback,
|
|
257
|
-
customProps =
|
|
268
|
+
customProps = dummyObj,
|
|
269
|
+
searchFields,
|
|
270
|
+
secondaryField
|
|
258
271
|
} = props;
|
|
259
272
|
let {
|
|
260
|
-
listItemProps =
|
|
273
|
+
listItemProps = dummyObj
|
|
261
274
|
} = customProps;
|
|
262
275
|
return this.formatOptions({
|
|
263
276
|
options,
|
|
264
277
|
valueField,
|
|
265
278
|
textField,
|
|
279
|
+
secondaryField,
|
|
280
|
+
searchFields,
|
|
266
281
|
listItemProps,
|
|
267
282
|
allowValueFallback
|
|
268
283
|
});
|
|
@@ -432,6 +447,7 @@ export class SelectComponent extends Component {
|
|
|
432
447
|
handleFilterSuggestions() {
|
|
433
448
|
let {
|
|
434
449
|
needLocalSearch,
|
|
450
|
+
searchFields,
|
|
435
451
|
excludeOptions = dummyArray // needSearch
|
|
436
452
|
|
|
437
453
|
} = this.props;
|
|
@@ -451,6 +467,7 @@ export class SelectComponent extends Component {
|
|
|
451
467
|
options,
|
|
452
468
|
selectedOptions: excludeOptions,
|
|
453
469
|
searchStr,
|
|
470
|
+
searchFields,
|
|
454
471
|
needSearch: needLocalSearch
|
|
455
472
|
});
|
|
456
473
|
this.optionsOrder = suggestionIds;
|
|
@@ -532,6 +549,7 @@ export class SelectComponent extends Component {
|
|
|
532
549
|
|
|
533
550
|
suggestionContainerRef(el) {
|
|
534
551
|
this.suggestionContainer = el;
|
|
552
|
+
typeof this.setSuggestionsVirtualizerRef === 'function' && this.setSuggestionsVirtualizerRef(el);
|
|
535
553
|
}
|
|
536
554
|
|
|
537
555
|
suggestionItemRef(el, index, id) {
|
|
@@ -679,6 +697,15 @@ export class SelectComponent extends Component {
|
|
|
679
697
|
});
|
|
680
698
|
}
|
|
681
699
|
|
|
700
|
+
getVirtualizerPublicMethods(methods) {
|
|
701
|
+
this.virtualizerMethods = methods;
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
setSuggestionsVirtualizerContainerRefFunction(refFunc) {
|
|
705
|
+
this.setSuggestionsVirtualizerRef = refFunc;
|
|
706
|
+
this.suggestionContainer && refFunc(this.suggestionContainer);
|
|
707
|
+
}
|
|
708
|
+
|
|
682
709
|
render() {
|
|
683
710
|
let {
|
|
684
711
|
needSearch,
|
|
@@ -731,9 +758,9 @@ export class SelectComponent extends Component {
|
|
|
731
758
|
targetOffset,
|
|
732
759
|
isRestrictScroll,
|
|
733
760
|
dropBoxPortalId,
|
|
761
|
+
isVirtualizerEnabled,
|
|
734
762
|
renderCustomToggleIndicator,
|
|
735
|
-
renderCustomSearchClearComponent
|
|
736
|
-
renderCustomSelectedValue
|
|
763
|
+
renderCustomSearchClearComponent
|
|
737
764
|
} = this.props;
|
|
738
765
|
let {
|
|
739
766
|
TextBoxIcon_i18n,
|
|
@@ -746,7 +773,6 @@ export class SelectComponent extends Component {
|
|
|
746
773
|
let {
|
|
747
774
|
hoverIndex,
|
|
748
775
|
selected,
|
|
749
|
-
selectedValueDetails,
|
|
750
776
|
searchStr,
|
|
751
777
|
isFetchingOptions,
|
|
752
778
|
selectedId,
|
|
@@ -771,31 +797,7 @@ export class SelectComponent extends Component {
|
|
|
771
797
|
ref: getTargetRef,
|
|
772
798
|
"data-id": `${isDisabled ? `${dataId}_disabled` : isReadOnly ? `${dataId}_readOnly` : dataId}`,
|
|
773
799
|
"data-test-id": `${isDisabled ? `${dataId}_disabled` : isReadOnly ? `${dataId}_readOnly` : dataId}`
|
|
774
|
-
},
|
|
775
|
-
isActive: isPopupReady,
|
|
776
|
-
border: needBorder ? 'bottom' : 'none',
|
|
777
|
-
size: size,
|
|
778
|
-
borderColor: borderColor,
|
|
779
|
-
isDisabled: isDisabled,
|
|
780
|
-
isReadOnly: isReadOnly,
|
|
781
|
-
hasPadding: true
|
|
782
|
-
}, typeof renderCustomSelectedValue == 'function' ? renderCustomSelectedValue({
|
|
783
|
-
isDisabled,
|
|
784
|
-
isPopupOpen,
|
|
785
|
-
isReadOnly,
|
|
786
|
-
isActive: isPopupReady,
|
|
787
|
-
size,
|
|
788
|
-
option: selectedValueDetails[selectedId] || {},
|
|
789
|
-
selectedId,
|
|
790
|
-
placeHolder,
|
|
791
|
-
htmlId,
|
|
792
|
-
maxLength,
|
|
793
|
-
ref: this.valueInputRef,
|
|
794
|
-
onFocus: this.handleSelectFocus,
|
|
795
|
-
onKeyDown: this.handleKeyDown,
|
|
796
|
-
onKeyPress: this.handleValueInputChange,
|
|
797
|
-
ariaControlsId: setAriaId
|
|
798
|
-
}) : renderCustomSelectedValue) : needSelectDownIcon ? /*#__PURE__*/React.createElement(TextBoxIcon, {
|
|
800
|
+
}, needSelectDownIcon ? /*#__PURE__*/React.createElement(TextBoxIcon, {
|
|
799
801
|
a11y: {
|
|
800
802
|
role: 'Menuitem',
|
|
801
803
|
ariaLabel: TextBox_ally_label,
|
|
@@ -960,7 +962,11 @@ export class SelectComponent extends Component {
|
|
|
960
962
|
customClass: !tabletMode && dropBoxSize ? style[dropBoxSize] : '',
|
|
961
963
|
eleRef: this.suggestionContainerRef
|
|
962
964
|
}, suggestions.length ? /*#__PURE__*/React.createElement(Suggestions, {
|
|
965
|
+
key: searchStr.trim(),
|
|
963
966
|
activeId: selectedId,
|
|
967
|
+
isVirtualizerEnabled: isVirtualizerEnabled,
|
|
968
|
+
getVirtualizerPublicMethods: this.getVirtualizerPublicMethods,
|
|
969
|
+
setVirtualizerContainerRefFunction: this.setSuggestionsVirtualizerContainerRefFunction,
|
|
964
970
|
suggestions: suggestions,
|
|
965
971
|
getRef: this.suggestionItemRef,
|
|
966
972
|
hoverOption: hoverIndex,
|
|
@@ -41,6 +41,7 @@ class SelectWithAvatarComponent extends SelectComponent {
|
|
|
41
41
|
valueField,
|
|
42
42
|
textField,
|
|
43
43
|
imageField,
|
|
44
|
+
secondaryField,
|
|
44
45
|
allowValueFallback
|
|
45
46
|
} = props;
|
|
46
47
|
return this.formatOptions({
|
|
@@ -48,6 +49,7 @@ class SelectWithAvatarComponent extends SelectComponent {
|
|
|
48
49
|
valueField,
|
|
49
50
|
textField,
|
|
50
51
|
imageField,
|
|
52
|
+
secondaryField,
|
|
51
53
|
optionType: 'avatar',
|
|
52
54
|
allowValueFallback
|
|
53
55
|
});
|
|
@@ -165,6 +167,7 @@ class SelectWithAvatarComponent extends SelectComponent {
|
|
|
165
167
|
needEffect,
|
|
166
168
|
isLoading,
|
|
167
169
|
dataSelectorId,
|
|
170
|
+
customProps,
|
|
168
171
|
getTargetRef
|
|
169
172
|
} = this.props;
|
|
170
173
|
i18nKeys = Object.assign({}, i18nKeys, {
|
|
@@ -187,6 +190,11 @@ class SelectWithAvatarComponent extends SelectComponent {
|
|
|
187
190
|
} = this.normalizedFormatOptions[selectedId] || {};
|
|
188
191
|
let setAriaId = this.getNextAriaId();
|
|
189
192
|
let ariaErrorId = this.getNextAriaId();
|
|
193
|
+
let {
|
|
194
|
+
TextBoxProps,
|
|
195
|
+
DropdownSearchTextBoxProps,
|
|
196
|
+
SuggestionsProps
|
|
197
|
+
} = customProps;
|
|
190
198
|
return /*#__PURE__*/React.createElement("div", {
|
|
191
199
|
className: `${style.wrapper} ${isDisabled ? style.disabled : ''} ${isReadOnly ? style.readOnly : ''} ${needEffect && !(isDisabled || isReadOnly) ? style.effect : ''} ${className ? className : ''}`,
|
|
192
200
|
"data-id": `${isDisabled ? `${dataId}_disabled` : isReadOnly ? `${dataId}_readOnly` : dataId}`,
|
|
@@ -246,7 +254,8 @@ class SelectWithAvatarComponent extends SelectComponent {
|
|
|
246
254
|
isClickable: isReadOnly || isDisabled ? false : true,
|
|
247
255
|
borderColor: borderColor,
|
|
248
256
|
htmlId: htmlId,
|
|
249
|
-
autoComplete: false
|
|
257
|
+
autoComplete: false,
|
|
258
|
+
...TextBoxProps
|
|
250
259
|
}))), !isReadOnly && !isDisabled && isPopupOpen ? /*#__PURE__*/React.createElement(ResponsiveReceiver, {
|
|
251
260
|
query: this.responsiveFunc,
|
|
252
261
|
responsiveId: "Helmet"
|
|
@@ -295,7 +304,8 @@ class SelectWithAvatarComponent extends SelectComponent {
|
|
|
295
304
|
ariaControls: setAriaId,
|
|
296
305
|
ariaDescribedby: ariaErrorId
|
|
297
306
|
},
|
|
298
|
-
autoComplete: false
|
|
307
|
+
autoComplete: false,
|
|
308
|
+
...DropdownSearchTextBoxProps
|
|
299
309
|
}))) : null, /*#__PURE__*/React.createElement(CardContent, {
|
|
300
310
|
shrink: true,
|
|
301
311
|
customClass: !tabletMode && dropBoxSize ? style[dropBoxSize] : '',
|
|
@@ -323,7 +333,8 @@ class SelectWithAvatarComponent extends SelectComponent {
|
|
|
323
333
|
a11y: {
|
|
324
334
|
ariaParentRole: 'listbox',
|
|
325
335
|
role: 'option'
|
|
326
|
-
}
|
|
336
|
+
},
|
|
337
|
+
...SuggestionsProps
|
|
327
338
|
}) : /*#__PURE__*/React.createElement(EmptyState, {
|
|
328
339
|
isLoading: isFetchingOptions,
|
|
329
340
|
options: options,
|
|
@@ -193,7 +193,7 @@ class SelectWithIcon extends Component {
|
|
|
193
193
|
} = this.props;
|
|
194
194
|
|
|
195
195
|
if (options.length) {
|
|
196
|
-
datas = options.filter(obj => obj[valueKey].toLowerCase().includes(searchValue.toLowerCase()));
|
|
196
|
+
datas = options.filter(obj => obj[valueKey].toLowerCase().includes(searchValue.toLowerCase().trim()));
|
|
197
197
|
}
|
|
198
198
|
|
|
199
199
|
return datas;
|
|
@@ -328,6 +328,7 @@ class SelectWithIcon extends Component {
|
|
|
328
328
|
targetOffset,
|
|
329
329
|
isRestrictScroll,
|
|
330
330
|
valueKey,
|
|
331
|
+
secondaryValueKey,
|
|
331
332
|
idKey,
|
|
332
333
|
needListBorder,
|
|
333
334
|
needTick,
|
|
@@ -367,7 +368,8 @@ class SelectWithIcon extends Component {
|
|
|
367
368
|
let {
|
|
368
369
|
TextBoxProps = {},
|
|
369
370
|
DropdownSearchTextBoxProps = {},
|
|
370
|
-
TextBoxIconProps = {}
|
|
371
|
+
TextBoxIconProps = {},
|
|
372
|
+
ListItemProps
|
|
371
373
|
} = customProps;
|
|
372
374
|
return /*#__PURE__*/React.createElement("div", {
|
|
373
375
|
className: `${style.container} ${style[`box_${size}`]} ${isReadOnly ? style.readonly : ''} ${borderColor === 'transparent' ? style.transparentContainer : ''}`,
|
|
@@ -510,6 +512,7 @@ class SelectWithIcon extends Component {
|
|
|
510
512
|
return /*#__PURE__*/React.createElement(ListItemWithIcon, {
|
|
511
513
|
key: options[idKey],
|
|
512
514
|
value: options[valueKey],
|
|
515
|
+
secondaryValue: options[secondaryValueKey],
|
|
513
516
|
size: "medium",
|
|
514
517
|
onClick: this.handleChange,
|
|
515
518
|
id: options[idKey],
|
|
@@ -530,7 +533,8 @@ class SelectWithIcon extends Component {
|
|
|
530
533
|
role: 'option',
|
|
531
534
|
ariaSelected: selectedId === options[idKey],
|
|
532
535
|
ariaLabel: options[valueKey]
|
|
533
|
-
}
|
|
536
|
+
},
|
|
537
|
+
...ListItemProps
|
|
534
538
|
});
|
|
535
539
|
})) : /*#__PURE__*/React.createElement(EmptyState, {
|
|
536
540
|
isLoading: isFetchingOptions,
|
|
@@ -1150,14 +1150,4 @@ describe('Select dataId snapshot - ', () => {
|
|
|
1150
1150
|
userEvent.click(getByRole(selectInputRole));
|
|
1151
1151
|
expect(asFragment()).toMatchSnapshot();
|
|
1152
1152
|
});
|
|
1153
|
-
test('Should render with renderCustomSelectedValue', () => {
|
|
1154
|
-
const {
|
|
1155
|
-
asFragment
|
|
1156
|
-
} = render( /*#__PURE__*/React.createElement(Select, {
|
|
1157
|
-
options: options,
|
|
1158
|
-
selectedValue: "Option 2",
|
|
1159
|
-
renderCustomSelectedValue: () => /*#__PURE__*/React.createElement("div", null, " Select Custom Option 2")
|
|
1160
|
-
}));
|
|
1161
|
-
expect(asFragment()).toMatchSnapshot();
|
|
1162
|
-
});
|
|
1163
1153
|
});
|
|
@@ -14,10 +14,10 @@ exports[`GroupSelect rendering the defult props 1`] = `
|
|
|
14
14
|
data-test-id="GroupSelect"
|
|
15
15
|
>
|
|
16
16
|
<div
|
|
17
|
-
class="
|
|
18
|
-
data-id="
|
|
17
|
+
class="container effect flex rowdir"
|
|
18
|
+
data-id="containerComponent"
|
|
19
19
|
data-selector-id="textBoxIcon"
|
|
20
|
-
data-test-id="
|
|
20
|
+
data-test-id="containerComponent"
|
|
21
21
|
>
|
|
22
22
|
<div
|
|
23
23
|
class="grow basis shrinkOff"
|
|
@@ -80,6 +80,9 @@ exports[`GroupSelect rendering the defult props 1`] = `
|
|
|
80
80
|
</div>
|
|
81
81
|
</div>
|
|
82
82
|
</div>
|
|
83
|
+
<div
|
|
84
|
+
class="line borderColor_default "
|
|
85
|
+
/>
|
|
83
86
|
</div>
|
|
84
87
|
</div>
|
|
85
88
|
</div>
|