@zohodesk/components 1.3.0 → 1.3.1

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.
Files changed (31) hide show
  1. package/.cli/config/variables/variableMapping.json +1 -2
  2. package/.cli/propValidation_report.html +1 -1
  3. package/README.md +5 -1
  4. package/es/ListItem/ListItem.module.css +2 -1
  5. package/es/ListItem/ListItemWithAvatar.js +1 -1
  6. package/es/ListItem/ListItemWithCheckBox.js +1 -1
  7. package/es/ListItem/ListItemWithIcon.js +1 -1
  8. package/es/ListItem/ListItemWithRadio.js +1 -1
  9. package/es/ListItem/__tests__/__snapshots__/ListItemWithAvatar.spec.js.snap +4 -4
  10. package/es/ListItem/__tests__/__snapshots__/ListItemWithCheckBox.spec.js.snap +4 -4
  11. package/es/ListItem/__tests__/__snapshots__/ListItemWithIcon.spec.js.snap +4 -4
  12. package/es/ListItem/__tests__/__snapshots__/ListItemWithRadio.spec.js.snap +4 -4
  13. package/es/MultiSelect/Suggestions.js +3 -1
  14. package/es/MultiSelect/props/defaultProps.js +2 -1
  15. package/es/MultiSelect/props/propTypes.js +1 -0
  16. package/es/utils/dropDownUtils.js +13 -5
  17. package/lib/ListItem/ListItem.module.css +2 -1
  18. package/lib/ListItem/ListItemWithAvatar.js +1 -1
  19. package/lib/ListItem/ListItemWithCheckBox.js +1 -1
  20. package/lib/ListItem/ListItemWithIcon.js +1 -1
  21. package/lib/ListItem/ListItemWithRadio.js +1 -1
  22. package/lib/ListItem/__tests__/__snapshots__/ListItemWithAvatar.spec.js.snap +4 -4
  23. package/lib/ListItem/__tests__/__snapshots__/ListItemWithCheckBox.spec.js.snap +4 -4
  24. package/lib/ListItem/__tests__/__snapshots__/ListItemWithIcon.spec.js.snap +4 -4
  25. package/lib/ListItem/__tests__/__snapshots__/ListItemWithRadio.spec.js.snap +4 -4
  26. package/lib/MultiSelect/Suggestions.js +4 -2
  27. package/lib/MultiSelect/props/defaultProps.js +2 -1
  28. package/lib/MultiSelect/props/propTypes.js +1 -0
  29. package/lib/utils/dropDownUtils.js +13 -5
  30. package/package.json +2 -2
  31. package/result.json +1 -1
package/README.md CHANGED
@@ -32,7 +32,11 @@ In this Package, we Provide Some Basic Components to Build Web App
32
32
  - TextBoxIcon
33
33
  - Tooltip
34
34
 
35
- # 1.2.64
35
+ # 1.3.1
36
+
37
+ - **dropDownUtils** - The isObjectContainsSearchString function logic has been updated to use some instead of filter, and additional conditions have been added to prevent potential runtime issues.
38
+
39
+ # 1.3.0
36
40
 
37
41
  - **AdvancedMultiSelect, MultiSelect, MultiSelectWithAvatar** - searchFields prop supported
38
42
  - **AdvancedMultiSelect, MultiSelectWithAvatar** - secondaryField prop supported
@@ -67,7 +67,7 @@
67
67
  --listitem_padding: var(--zd_size10) var(--zd_size25) var(--zd_size10) var(--zd_size3);
68
68
  }
69
69
  .value,
70
- .children {
70
+ .children,.secondaryValue {
71
71
  composes: dotted from '../common/common.module.css';
72
72
  }
73
73
  .value, .multiLineValue {
@@ -203,6 +203,7 @@
203
203
  position: absolute;
204
204
  color: var(--listitem_tickicon_color);
205
205
  top:50% ;
206
+ font-size: 0 ;
206
207
  }
207
208
 
208
209
  .tickIcon, .defaultTick, .darkTick {
@@ -156,7 +156,7 @@ export default class ListItemWithAvatar extends React.PureComponent {
156
156
  className: needMultiLineText ? style.multiLineValue : style.value
157
157
  }, value) : null, secondaryValue ? /*#__PURE__*/React.createElement(Box, {
158
158
  "data-title": isDisabled ? null : secondaryValue,
159
- className: `${style.secondaryField} ${needMultiLineText ? style.multiLine : ''}`
159
+ className: `${style.secondaryField} ${needMultiLineText ? style.multiLine : style.secondaryValue}`
160
160
  }, secondaryValue) : null)), needTick && active ? /*#__PURE__*/React.createElement(Box, {
161
161
  className: style.tickIcon,
162
162
  "aria-hidden": ariaHidden,
@@ -120,7 +120,7 @@ export default class ListItemWithCheckBox extends React.Component {
120
120
  className: needMultiLineText ? style.multiLineValue : style.value
121
121
  }, value) : null, secondaryValue ? /*#__PURE__*/React.createElement(Box, {
122
122
  "data-title": isDisabled ? null : secondaryValue,
123
- className: `${style.secondaryField} ${needMultiLineText ? style.multiLine : ''}`
123
+ className: `${style.secondaryField} ${needMultiLineText ? style.multiLine : style.secondaryValue}`
124
124
  }, secondaryValue) : null)));
125
125
  }
126
126
 
@@ -136,7 +136,7 @@ export default class ListItemWithIcon extends React.Component {
136
136
  dataId: `${dataIdString}_Text`
137
137
  }, value) : null, secondaryValue ? /*#__PURE__*/React.createElement(Box, {
138
138
  "data-title": isDisabled ? null : secondaryValue,
139
- className: `${style.secondaryField} ${needMultiLineText ? style.multiLine : ''}`
139
+ className: `${style.secondaryField} ${needMultiLineText ? style.multiLine : style.secondaryValue}`
140
140
  }, secondaryValue) : null)), needTick && active ? /*#__PURE__*/React.createElement(Box, {
141
141
  className: style.tickIcon,
142
142
  "aria-hidden": ariaHidden,
@@ -123,7 +123,7 @@ export default class ListItemWithRadio extends React.Component {
123
123
  className: needMultiLineText ? style.multiLineValue : style.value
124
124
  }, value) : null, secondaryValue ? /*#__PURE__*/React.createElement(Box, {
125
125
  "data-title": isDisabled ? null : secondaryValue,
126
- className: `${style.secondaryField} ${needMultiLineText ? style.multiLine : ''}`
126
+ className: `${style.secondaryField} ${needMultiLineText ? style.multiLine : style.secondaryValue}`
127
127
  }, secondaryValue) : null)));
128
128
  }
129
129
 
@@ -32,7 +32,7 @@ exports[`ListItemWithAvatar ListItemWithAvatar with secondaryValue text and LHS
32
32
  List
33
33
  </div>
34
34
  <div
35
- class="secondaryField shrinkOff"
35
+ class="secondaryField secondaryValue shrinkOff"
36
36
  data-id="boxComponent"
37
37
  data-selector-id="box"
38
38
  data-test-id="boxComponent"
@@ -78,7 +78,7 @@ exports[`ListItemWithAvatar ListItemWithAvatar with secondaryValue text and LHS
78
78
  List
79
79
  </div>
80
80
  <div
81
- class="secondaryField shrinkOff"
81
+ class="secondaryField secondaryValue shrinkOff"
82
82
  data-id="boxComponent"
83
83
  data-selector-id="box"
84
84
  data-test-id="boxComponent"
@@ -124,7 +124,7 @@ exports[`ListItemWithAvatar ListItemWithAvatar with secondaryValue 1`] = `
124
124
  List
125
125
  </div>
126
126
  <div
127
- class="secondaryField shrinkOff"
127
+ class="secondaryField secondaryValue shrinkOff"
128
128
  data-id="boxComponent"
129
129
  data-selector-id="box"
130
130
  data-test-id="boxComponent"
@@ -170,7 +170,7 @@ exports[`ListItemWithAvatar ListItemWithAvatar with secondaryValue text and LHS
170
170
  List
171
171
  </div>
172
172
  <div
173
- class="secondaryField shrinkOff"
173
+ class="secondaryField secondaryValue shrinkOff"
174
174
  data-id="boxComponent"
175
175
  data-selector-id="box"
176
176
  data-test-id="boxComponent"
@@ -86,7 +86,7 @@ exports[`ListItemWithCheckBox ListItemWithCheckBox with secondaryValue text and
86
86
  List
87
87
  </div>
88
88
  <div
89
- class="secondaryField shrinkOff"
89
+ class="secondaryField secondaryValue shrinkOff"
90
90
  data-id="boxComponent"
91
91
  data-selector-id="box"
92
92
  data-test-id="boxComponent"
@@ -186,7 +186,7 @@ exports[`ListItemWithCheckBox ListItemWithCheckBox with secondaryValue text and
186
186
  List
187
187
  </div>
188
188
  <div
189
- class="secondaryField shrinkOff"
189
+ class="secondaryField secondaryValue shrinkOff"
190
190
  data-id="boxComponent"
191
191
  data-selector-id="box"
192
192
  data-test-id="boxComponent"
@@ -286,7 +286,7 @@ exports[`ListItemWithCheckBox ListItemWithCheckBox with secondaryValue 1`] = `
286
286
  List
287
287
  </div>
288
288
  <div
289
- class="secondaryField shrinkOff"
289
+ class="secondaryField secondaryValue shrinkOff"
290
290
  data-id="boxComponent"
291
291
  data-selector-id="box"
292
292
  data-test-id="boxComponent"
@@ -386,7 +386,7 @@ exports[`ListItemWithCheckBox ListItemWithCheckBox with secondaryValue text and
386
386
  List
387
387
  </div>
388
388
  <div
389
- class="secondaryField shrinkOff"
389
+ class="secondaryField secondaryValue shrinkOff"
390
390
  data-id="boxComponent"
391
391
  data-selector-id="box"
392
392
  data-test-id="boxComponent"
@@ -32,7 +32,7 @@ exports[`ListItemWithIcon ListItemWithIcon with secondaryValue text and LHS ali
32
32
  List
33
33
  </div>
34
34
  <div
35
- class="secondaryField shrinkOff"
35
+ class="secondaryField secondaryValue shrinkOff"
36
36
  data-id="boxComponent"
37
37
  data-selector-id="box"
38
38
  data-test-id="boxComponent"
@@ -78,7 +78,7 @@ exports[`ListItemWithIcon ListItemWithIcon with secondaryValue text and LHS ali
78
78
  List
79
79
  </div>
80
80
  <div
81
- class="secondaryField shrinkOff"
81
+ class="secondaryField secondaryValue shrinkOff"
82
82
  data-id="boxComponent"
83
83
  data-selector-id="box"
84
84
  data-test-id="boxComponent"
@@ -124,7 +124,7 @@ exports[`ListItemWithIcon ListItemWithIcon with secondaryValue 1`] = `
124
124
  List
125
125
  </div>
126
126
  <div
127
- class="secondaryField shrinkOff"
127
+ class="secondaryField secondaryValue shrinkOff"
128
128
  data-id="boxComponent"
129
129
  data-selector-id="box"
130
130
  data-test-id="boxComponent"
@@ -170,7 +170,7 @@ exports[`ListItemWithIcon ListItemWithIcon with secondaryValue text and LHS alig
170
170
  List
171
171
  </div>
172
172
  <div
173
- class="secondaryField shrinkOff"
173
+ class="secondaryField secondaryValue shrinkOff"
174
174
  data-id="boxComponent"
175
175
  data-selector-id="box"
176
176
  data-test-id="boxComponent"
@@ -85,7 +85,7 @@ exports[`ListItemWithRadio ListItemWithRadio with secondaryValue text and LHS a
85
85
  List
86
86
  </div>
87
87
  <div
88
- class="secondaryField shrinkOff"
88
+ class="secondaryField secondaryValue shrinkOff"
89
89
  data-id="boxComponent"
90
90
  data-selector-id="box"
91
91
  data-test-id="boxComponent"
@@ -184,7 +184,7 @@ exports[`ListItemWithRadio ListItemWithRadio with secondaryValue text and LHS a
184
184
  List
185
185
  </div>
186
186
  <div
187
- class="secondaryField shrinkOff"
187
+ class="secondaryField secondaryValue shrinkOff"
188
188
  data-id="boxComponent"
189
189
  data-selector-id="box"
190
190
  data-test-id="boxComponent"
@@ -283,7 +283,7 @@ exports[`ListItemWithRadio ListItemWithRadio with secondaryValue 1`] = `
283
283
  List
284
284
  </div>
285
285
  <div
286
- class="secondaryField shrinkOff"
286
+ class="secondaryField secondaryValue shrinkOff"
287
287
  data-id="boxComponent"
288
288
  data-selector-id="box"
289
289
  data-test-id="boxComponent"
@@ -382,7 +382,7 @@ exports[`ListItemWithRadio ListItemWithRadio with secondaryValue text and LHS al
382
382
  List
383
383
  </div>
384
384
  <div
385
- class="secondaryField shrinkOff"
385
+ class="secondaryField secondaryValue shrinkOff"
386
386
  data-id="boxComponent"
387
387
  data-selector-id="box"
388
388
  data-test-id="boxComponent"
@@ -27,7 +27,8 @@ export default class Suggestions extends React.PureComponent {
27
27
  avatarPalette,
28
28
  palette,
29
29
  htmlId,
30
- a11y
30
+ a11y,
31
+ needMultiLineText
31
32
  } = this.props;
32
33
  const {
33
34
  ariaParentRole,
@@ -64,6 +65,7 @@ export default class Suggestions extends React.PureComponent {
64
65
  });
65
66
  const commonProps = {
66
67
  isDisabled,
68
+ needMultiLineText,
67
69
  ...listItemCustomProps
68
70
  };
69
71
 
@@ -166,5 +166,6 @@ export const SelectedOptions_defaultProps = {
166
166
  dataId: 'selectedOptions'
167
167
  };
168
168
  export const Suggestions_defaultProps = {
169
- a11y: {}
169
+ a11y: {},
170
+ needMultiLineText: false
170
171
  };
@@ -173,6 +173,7 @@ export const Suggestions_propTypes = {
173
173
  palette: PropTypes.string,
174
174
  selectedOptions: PropTypes.array,
175
175
  htmlId: PropTypes.string,
176
+ needMultiLineText: PropTypes.bool,
176
177
  suggestions: PropTypes.arrayOf(PropTypes.shape({
177
178
  id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
178
179
  value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
@@ -43,16 +43,24 @@ const getListItemProps = props => props.listItemProps || '';
43
43
 
44
44
  const getSearchFields = props => {
45
45
  return props.searchFields || ['value'];
46
- };
46
+ }; // const isObjectContainsSearchString = (searchFields = [], searchStr = '', obj) => {
47
+ // const matchedFields = searchFields.filter(element => {
48
+ // return getSearchString(obj[element]).indexOf(searchStr) !== -1
49
+ // });
50
+ // return matchedFields.length !== 0;
51
+ // }
52
+
47
53
 
48
54
  const isObjectContainsSearchString = function () {
49
55
  let searchFields = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
50
56
  let searchStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
51
- let obj = arguments.length > 2 ? arguments[2] : undefined;
52
- const matchedFields = searchFields.filter(element => {
53
- return getSearchString(obj[element]).indexOf(searchStr) !== -1;
57
+ let obj = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
58
+ return searchFields.some(field => {
59
+ const val = obj[field];
60
+ if (val === null || val === undefined) return false;
61
+ const str = getSearchString(val);
62
+ return str && str.indexOf(searchStr) !== -1;
54
63
  });
55
- return matchedFields.length !== 0;
56
64
  };
57
65
 
58
66
  const getAllowValueFallback = props => props.allowValueFallback !== false;
@@ -67,7 +67,7 @@
67
67
  --listitem_padding: var(--zd_size10) var(--zd_size25) var(--zd_size10) var(--zd_size3);
68
68
  }
69
69
  .value,
70
- .children {
70
+ .children,.secondaryValue {
71
71
  composes: dotted from '../common/common.module.css';
72
72
  }
73
73
  .value, .multiLineValue {
@@ -203,6 +203,7 @@
203
203
  position: absolute;
204
204
  color: var(--listitem_tickicon_color);
205
205
  top:50% ;
206
+ font-size: 0 ;
206
207
  }
207
208
 
208
209
  .tickIcon, .defaultTick, .darkTick {
@@ -208,7 +208,7 @@ var ListItemWithAvatar = /*#__PURE__*/function (_React$PureComponent) {
208
208
  className: needMultiLineText ? _ListItemModule["default"].multiLineValue : _ListItemModule["default"].value
209
209
  }, value) : null, secondaryValue ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
210
210
  "data-title": isDisabled ? null : secondaryValue,
211
- className: "".concat(_ListItemModule["default"].secondaryField, " ").concat(needMultiLineText ? _ListItemModule["default"].multiLine : '')
211
+ className: "".concat(_ListItemModule["default"].secondaryField, " ").concat(needMultiLineText ? _ListItemModule["default"].multiLine : _ListItemModule["default"].secondaryValue)
212
212
  }, secondaryValue) : null)), needTick && active ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
213
213
  className: _ListItemModule["default"].tickIcon,
214
214
  "aria-hidden": ariaHidden,
@@ -177,7 +177,7 @@ var ListItemWithCheckBox = /*#__PURE__*/function (_React$Component) {
177
177
  className: needMultiLineText ? _ListItemModule["default"].multiLineValue : _ListItemModule["default"].value
178
178
  }, value) : null, secondaryValue ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
179
179
  "data-title": isDisabled ? null : secondaryValue,
180
- className: "".concat(_ListItemModule["default"].secondaryField, " ").concat(needMultiLineText ? _ListItemModule["default"].multiLine : '')
180
+ className: "".concat(_ListItemModule["default"].secondaryField, " ").concat(needMultiLineText ? _ListItemModule["default"].multiLine : _ListItemModule["default"].secondaryValue)
181
181
  }, secondaryValue) : null)));
182
182
  }
183
183
  }]);
@@ -187,7 +187,7 @@ var ListItemWithIcon = /*#__PURE__*/function (_React$Component) {
187
187
  dataId: "".concat(dataIdString, "_Text")
188
188
  }, value) : null, secondaryValue ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
189
189
  "data-title": isDisabled ? null : secondaryValue,
190
- className: "".concat(_ListItemModule["default"].secondaryField, " ").concat(needMultiLineText ? _ListItemModule["default"].multiLine : '')
190
+ className: "".concat(_ListItemModule["default"].secondaryField, " ").concat(needMultiLineText ? _ListItemModule["default"].multiLine : _ListItemModule["default"].secondaryValue)
191
191
  }, secondaryValue) : null)), needTick && active ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
192
192
  className: _ListItemModule["default"].tickIcon,
193
193
  "aria-hidden": ariaHidden,
@@ -180,7 +180,7 @@ var ListItemWithRadio = /*#__PURE__*/function (_React$Component) {
180
180
  className: needMultiLineText ? _ListItemModule["default"].multiLineValue : _ListItemModule["default"].value
181
181
  }, value) : null, secondaryValue ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
182
182
  "data-title": isDisabled ? null : secondaryValue,
183
- className: "".concat(_ListItemModule["default"].secondaryField, " ").concat(needMultiLineText ? _ListItemModule["default"].multiLine : '')
183
+ className: "".concat(_ListItemModule["default"].secondaryField, " ").concat(needMultiLineText ? _ListItemModule["default"].multiLine : _ListItemModule["default"].secondaryValue)
184
184
  }, secondaryValue) : null)));
185
185
  }
186
186
  }]);
@@ -32,7 +32,7 @@ exports[`ListItemWithAvatar ListItemWithAvatar with secondaryValue text and LHS
32
32
  List
33
33
  </div>
34
34
  <div
35
- class="secondaryField shrinkOff"
35
+ class="secondaryField secondaryValue shrinkOff"
36
36
  data-id="boxComponent"
37
37
  data-selector-id="box"
38
38
  data-test-id="boxComponent"
@@ -78,7 +78,7 @@ exports[`ListItemWithAvatar ListItemWithAvatar with secondaryValue text and LHS
78
78
  List
79
79
  </div>
80
80
  <div
81
- class="secondaryField shrinkOff"
81
+ class="secondaryField secondaryValue shrinkOff"
82
82
  data-id="boxComponent"
83
83
  data-selector-id="box"
84
84
  data-test-id="boxComponent"
@@ -124,7 +124,7 @@ exports[`ListItemWithAvatar ListItemWithAvatar with secondaryValue 1`] = `
124
124
  List
125
125
  </div>
126
126
  <div
127
- class="secondaryField shrinkOff"
127
+ class="secondaryField secondaryValue shrinkOff"
128
128
  data-id="boxComponent"
129
129
  data-selector-id="box"
130
130
  data-test-id="boxComponent"
@@ -170,7 +170,7 @@ exports[`ListItemWithAvatar ListItemWithAvatar with secondaryValue text and LHS
170
170
  List
171
171
  </div>
172
172
  <div
173
- class="secondaryField shrinkOff"
173
+ class="secondaryField secondaryValue shrinkOff"
174
174
  data-id="boxComponent"
175
175
  data-selector-id="box"
176
176
  data-test-id="boxComponent"
@@ -86,7 +86,7 @@ exports[`ListItemWithCheckBox ListItemWithCheckBox with secondaryValue text and
86
86
  List
87
87
  </div>
88
88
  <div
89
- class="secondaryField shrinkOff"
89
+ class="secondaryField secondaryValue shrinkOff"
90
90
  data-id="boxComponent"
91
91
  data-selector-id="box"
92
92
  data-test-id="boxComponent"
@@ -186,7 +186,7 @@ exports[`ListItemWithCheckBox ListItemWithCheckBox with secondaryValue text and
186
186
  List
187
187
  </div>
188
188
  <div
189
- class="secondaryField shrinkOff"
189
+ class="secondaryField secondaryValue shrinkOff"
190
190
  data-id="boxComponent"
191
191
  data-selector-id="box"
192
192
  data-test-id="boxComponent"
@@ -286,7 +286,7 @@ exports[`ListItemWithCheckBox ListItemWithCheckBox with secondaryValue 1`] = `
286
286
  List
287
287
  </div>
288
288
  <div
289
- class="secondaryField shrinkOff"
289
+ class="secondaryField secondaryValue shrinkOff"
290
290
  data-id="boxComponent"
291
291
  data-selector-id="box"
292
292
  data-test-id="boxComponent"
@@ -386,7 +386,7 @@ exports[`ListItemWithCheckBox ListItemWithCheckBox with secondaryValue text and
386
386
  List
387
387
  </div>
388
388
  <div
389
- class="secondaryField shrinkOff"
389
+ class="secondaryField secondaryValue shrinkOff"
390
390
  data-id="boxComponent"
391
391
  data-selector-id="box"
392
392
  data-test-id="boxComponent"
@@ -32,7 +32,7 @@ exports[`ListItemWithIcon ListItemWithIcon with secondaryValue text and LHS ali
32
32
  List
33
33
  </div>
34
34
  <div
35
- class="secondaryField shrinkOff"
35
+ class="secondaryField secondaryValue shrinkOff"
36
36
  data-id="boxComponent"
37
37
  data-selector-id="box"
38
38
  data-test-id="boxComponent"
@@ -78,7 +78,7 @@ exports[`ListItemWithIcon ListItemWithIcon with secondaryValue text and LHS ali
78
78
  List
79
79
  </div>
80
80
  <div
81
- class="secondaryField shrinkOff"
81
+ class="secondaryField secondaryValue shrinkOff"
82
82
  data-id="boxComponent"
83
83
  data-selector-id="box"
84
84
  data-test-id="boxComponent"
@@ -124,7 +124,7 @@ exports[`ListItemWithIcon ListItemWithIcon with secondaryValue 1`] = `
124
124
  List
125
125
  </div>
126
126
  <div
127
- class="secondaryField shrinkOff"
127
+ class="secondaryField secondaryValue shrinkOff"
128
128
  data-id="boxComponent"
129
129
  data-selector-id="box"
130
130
  data-test-id="boxComponent"
@@ -170,7 +170,7 @@ exports[`ListItemWithIcon ListItemWithIcon with secondaryValue text and LHS alig
170
170
  List
171
171
  </div>
172
172
  <div
173
- class="secondaryField shrinkOff"
173
+ class="secondaryField secondaryValue shrinkOff"
174
174
  data-id="boxComponent"
175
175
  data-selector-id="box"
176
176
  data-test-id="boxComponent"
@@ -85,7 +85,7 @@ exports[`ListItemWithRadio ListItemWithRadio with secondaryValue text and LHS a
85
85
  List
86
86
  </div>
87
87
  <div
88
- class="secondaryField shrinkOff"
88
+ class="secondaryField secondaryValue shrinkOff"
89
89
  data-id="boxComponent"
90
90
  data-selector-id="box"
91
91
  data-test-id="boxComponent"
@@ -184,7 +184,7 @@ exports[`ListItemWithRadio ListItemWithRadio with secondaryValue text and LHS a
184
184
  List
185
185
  </div>
186
186
  <div
187
- class="secondaryField shrinkOff"
187
+ class="secondaryField secondaryValue shrinkOff"
188
188
  data-id="boxComponent"
189
189
  data-selector-id="box"
190
190
  data-test-id="boxComponent"
@@ -283,7 +283,7 @@ exports[`ListItemWithRadio ListItemWithRadio with secondaryValue 1`] = `
283
283
  List
284
284
  </div>
285
285
  <div
286
- class="secondaryField shrinkOff"
286
+ class="secondaryField secondaryValue shrinkOff"
287
287
  data-id="boxComponent"
288
288
  data-selector-id="box"
289
289
  data-test-id="boxComponent"
@@ -382,7 +382,7 @@ exports[`ListItemWithRadio ListItemWithRadio with secondaryValue text and LHS al
382
382
  List
383
383
  </div>
384
384
  <div
385
- class="secondaryField shrinkOff"
385
+ class="secondaryField secondaryValue shrinkOff"
386
386
  data-id="boxComponent"
387
387
  data-selector-id="box"
388
388
  data-test-id="boxComponent"
@@ -83,7 +83,8 @@ var Suggestions = /*#__PURE__*/function (_React$PureComponent) {
83
83
  avatarPalette = _this$props.avatarPalette,
84
84
  palette = _this$props.palette,
85
85
  htmlId = _this$props.htmlId,
86
- a11y = _this$props.a11y;
86
+ a11y = _this$props.a11y,
87
+ needMultiLineText = _this$props.needMultiLineText;
87
88
  var ariaParentRole = a11y.ariaParentRole,
88
89
  ariaMultiselectable = a11y.ariaMultiselectable;
89
90
  return /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
@@ -116,7 +117,8 @@ var Suggestions = /*#__PURE__*/function (_React$PureComponent) {
116
117
  });
117
118
 
118
119
  var commonProps = _objectSpread({
119
- isDisabled: isDisabled
120
+ isDisabled: isDisabled,
121
+ needMultiLineText: needMultiLineText
120
122
  }, listItemCustomProps);
121
123
 
122
124
  if (listItemProps) {
@@ -181,6 +181,7 @@ var SelectedOptions_defaultProps = {
181
181
  };
182
182
  exports.SelectedOptions_defaultProps = SelectedOptions_defaultProps;
183
183
  var Suggestions_defaultProps = {
184
- a11y: {}
184
+ a11y: {},
185
+ needMultiLineText: false
185
186
  };
186
187
  exports.Suggestions_defaultProps = Suggestions_defaultProps;
@@ -197,6 +197,7 @@ var Suggestions_propTypes = {
197
197
  palette: _propTypes["default"].string,
198
198
  selectedOptions: _propTypes["default"].array,
199
199
  htmlId: _propTypes["default"].string,
200
+ needMultiLineText: _propTypes["default"].bool,
200
201
  suggestions: _propTypes["default"].arrayOf(_propTypes["default"].shape({
201
202
  id: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]),
202
203
  value: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]),
@@ -150,16 +150,24 @@ var getListItemProps = function getListItemProps(props) {
150
150
 
151
151
  var getSearchFields = function getSearchFields(props) {
152
152
  return props.searchFields || ['value'];
153
- };
153
+ }; // const isObjectContainsSearchString = (searchFields = [], searchStr = '', obj) => {
154
+ // const matchedFields = searchFields.filter(element => {
155
+ // return getSearchString(obj[element]).indexOf(searchStr) !== -1
156
+ // });
157
+ // return matchedFields.length !== 0;
158
+ // }
159
+
154
160
 
155
161
  var isObjectContainsSearchString = function isObjectContainsSearchString() {
156
162
  var searchFields = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
157
163
  var searchStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
158
- var obj = arguments.length > 2 ? arguments[2] : undefined;
159
- var matchedFields = searchFields.filter(function (element) {
160
- return (0, _Common.getSearchString)(obj[element]).indexOf(searchStr) !== -1;
164
+ var obj = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
165
+ return searchFields.some(function (field) {
166
+ var val = obj[field];
167
+ if (val === null || val === undefined) return false;
168
+ var str = (0, _Common.getSearchString)(val);
169
+ return str && str.indexOf(searchStr) !== -1;
161
170
  });
162
- return matchedFields.length !== 0;
163
171
  };
164
172
 
165
173
  var getAllowValueFallback = function getAllowValueFallback(props) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/components",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "main": "es/index.js",
5
5
  "module": "es/index.js",
6
6
  "private": false,
@@ -65,7 +65,7 @@
65
65
  "@testing-library/react-hooks": "^7.0.2",
66
66
  "@testing-library/user-event": "^13.0.10",
67
67
  "@zohodesk-private/color-variable-preprocessor": "1.2.0",
68
- "@zohodesk-private/css-variable-migrator": "^1.0.7",
68
+ "@zohodesk-private/css-variable-migrator": "^1.0.8",
69
69
  "@zohodesk-private/node-plugins": "1.1.8",
70
70
  "@zohodesk-private/react-prop-validator": "1.2.3",
71
71
  "@zohodesk/a11y": "2.3.4",