@zohodesk/components 1.3.0 → 1.3.2

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 (37) hide show
  1. package/.cli/config/variables/variableMapping.json +1 -2
  2. package/.cli/propValidation_report.html +1 -1
  3. package/README.md +16 -33
  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/Popup/Popup.js +16 -10
  17. package/es/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +40 -3
  18. package/es/VelocityAnimation/VelocityAnimationGroup/props/propTypes.js +4 -1
  19. package/es/utils/dropDownUtils.js +13 -5
  20. package/lib/ListItem/ListItem.module.css +2 -1
  21. package/lib/ListItem/ListItemWithAvatar.js +1 -1
  22. package/lib/ListItem/ListItemWithCheckBox.js +1 -1
  23. package/lib/ListItem/ListItemWithIcon.js +1 -1
  24. package/lib/ListItem/ListItemWithRadio.js +1 -1
  25. package/lib/ListItem/__tests__/__snapshots__/ListItemWithAvatar.spec.js.snap +4 -4
  26. package/lib/ListItem/__tests__/__snapshots__/ListItemWithCheckBox.spec.js.snap +4 -4
  27. package/lib/ListItem/__tests__/__snapshots__/ListItemWithIcon.spec.js.snap +4 -4
  28. package/lib/ListItem/__tests__/__snapshots__/ListItemWithRadio.spec.js.snap +4 -4
  29. package/lib/MultiSelect/Suggestions.js +4 -2
  30. package/lib/MultiSelect/props/defaultProps.js +2 -1
  31. package/lib/MultiSelect/props/propTypes.js +1 -0
  32. package/lib/Popup/Popup.js +16 -11
  33. package/lib/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +80 -26
  34. package/lib/VelocityAnimation/VelocityAnimationGroup/props/propTypes.js +4 -1
  35. package/lib/utils/dropDownUtils.js +13 -5
  36. package/package.json +4 -4
  37. package/result.json +1 -1
package/README.md CHANGED
@@ -1,38 +1,21 @@
1
1
  # DOT Style Guide
2
2
 
3
- In this Package, we Provide Some Basic Components to Build Web App
4
-
5
- - Avatar
6
- - AvatarTeam
7
- - Accordion
8
- - Animation
9
- - Button
10
- - Buttongroup
11
- - Card
12
- - CheckBox
13
- - DateTime
14
- - DropBox
15
- - Icon
16
- - Label
17
- - Layout
18
- - ListItem
19
- - MultiSelect
20
- - Popup
21
- - Radio
22
- - Responsive
23
- - Ribbon
24
- - Select
25
- - GroupSelect
26
- - Stencils
27
- - Switch
28
- - Tab
29
- - Tag
30
- - Textarea
31
- - TextBox
32
- - TextBoxIcon
33
- - Tooltip
34
-
35
- # 1.2.64
3
+ Dot UI is a customizable React component library built to deliver a clean, accessible, and developer-friendly UI experience. It offers a growing set of reusable components designed to align with modern design systems and streamline application development across projects.
4
+
5
+ # 1.3.2
6
+
7
+ - **Popup**
8
+ - Added `scrollDebounceTime` prop to support debounce control for fixed popup scroll behavior.
9
+ - **VelocityAnimationGroup** - Added support for the following props:
10
+ - `onEnterComplete` - Callback triggered after enter animation completes.
11
+ - `onExitComplete` - Callback triggered after exit animation completes.
12
+ - `postEnterStyles` - Inline styles applied to the element once the enter animation has finished.
13
+
14
+ # 1.3.1
15
+
16
+ - **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.
17
+
18
+ # 1.3.0
36
19
 
37
20
  - **AdvancedMultiSelect, MultiSelect, MultiSelectWithAvatar** - searchFields prop supported
38
21
  - **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]),
package/es/Popup/Popup.js CHANGED
@@ -89,8 +89,8 @@ const Popup = function (Component) {
89
89
  this.getIsOutsideScrollBlocked = this.getIsOutsideScrollBlocked.bind(this);
90
90
  this.getNeedArrow = this.getNeedArrow.bind(this);
91
91
  this.getCustomPositionOrder = this.getCustomPositionOrder.bind(this);
92
- this.handleOpenPopupPositionChange = this.handleOpenPopupPositionChange.bind(this); // this.getScrollDebounceTime = this.getScrollDebounceTime.bind(this);
93
-
92
+ this.handleOpenPopupPositionChange = this.handleOpenPopupPositionChange.bind(this);
93
+ this.getScrollDebounceTime = this.getScrollDebounceTime.bind(this);
94
94
  this.getCloseOnScrollPopup = this.getCloseOnScrollPopup.bind(this);
95
95
  this.handleCloseLastOpenedGroup = this.handleCloseLastOpenedGroup.bind(this);
96
96
  this.handleDocumentMouseDown = this.handleDocumentMouseDown.bind(this);
@@ -107,7 +107,6 @@ const Popup = function (Component) {
107
107
  this.updateVisibilityOnIntersection = this.updateVisibilityOnIntersection.bind(this);
108
108
  this.handleAddingScrollToUpdatePosition = this.handleAddingScrollToUpdatePosition.bind(this);
109
109
  this.handleRemovingScrollToUpdatePosition = this.handleRemovingScrollToUpdatePosition.bind(this);
110
- this.updatePositionOnScroll = this.updatePositionOnScroll.bind(this);
111
110
  this.setContainerDynamicPositioning = this.setContainerDynamicPositioning.bind(this);
112
111
  this.updatePopupState = this.updatePopupState.bind(this);
113
112
  this.handleScrollAndBlockEvents = this.handleScrollAndBlockEvents.bind(this);
@@ -122,8 +121,9 @@ const Popup = function (Component) {
122
121
  this.customPositionOrder = customPositionOrder;
123
122
  this.scrollDebounceTime = popupScrollDebounceTime;
124
123
  this.closeOnScroll = closeOnScrollPopup;
125
- this.isOutsideScrollBlock = isOutsideScrollBlock; // const { scrollDebounceTime } = this.getScrollDebounceTime(this);
126
- // this.handleScroll = debounce(this.handleScroll.bind(this), scrollDebounceTime);
124
+ this.isOutsideScrollBlock = isOutsideScrollBlock;
125
+ const scrollDebounceTime = this.getScrollDebounceTime(this);
126
+ this.updatePositionOnScroll = scrollDebounceTime > 0 ? debounce(this.updatePositionOnScroll.bind(this), scrollDebounceTime) : this.updatePositionOnScroll.bind(this); // this.handleScroll = debounce(this.handleScroll.bind(this), scrollDebounceTime);
127
127
  }
128
128
 
129
129
  componentDidMount() {
@@ -426,6 +426,7 @@ const Popup = function (Component) {
426
426
  const {
427
427
  dropElement
428
428
  } = this;
429
+ if (!dropElement) return;
429
430
 
430
431
  if (entry.isIntersecting === true) {
431
432
  this.isTargetElementVisible = true;
@@ -451,12 +452,17 @@ const Popup = function (Component) {
451
452
  needPopupArrow
452
453
  } = popup;
453
454
  return isArrow !== undefined ? isArrow : needPopupArrow;
454
- } // getScrollDebounceTime(popup) {
455
- // const { scrollDebounceTime } = popup.props;
456
- // const { scrollDebounceTime: popupScrollDebounceTime } = popup;
457
- // return scrollDebounceTime !== undefined ? scrollDebounceTime : popupScrollDebounceTime;
458
- // }
455
+ }
459
456
 
457
+ getScrollDebounceTime(popup) {
458
+ const {
459
+ scrollDebounceTime
460
+ } = popup.props;
461
+ const {
462
+ scrollDebounceTime: popupScrollDebounceTime
463
+ } = popup;
464
+ return scrollDebounceTime !== undefined ? scrollDebounceTime : popupScrollDebounceTime;
465
+ }
460
466
 
461
467
  getCloseOnScrollPopup(popup) {
462
468
  const {
@@ -16,6 +16,38 @@ function clearProps(props) {
16
16
  export default class VelocityAnimationGroup extends React.Component {
17
17
  constructor(props) {
18
18
  super(props);
19
+ this.handleEnterComplete = this.handleEnterComplete.bind(this);
20
+ this.handleExitComplete = this.handleExitComplete.bind(this);
21
+ }
22
+
23
+ handleEnterComplete(elements) {
24
+ const {
25
+ onEnterComplete,
26
+ postEnterStyles
27
+ } = this.props;
28
+
29
+ if (typeof onEnterComplete === 'function') {
30
+ onEnterComplete(elements);
31
+ }
32
+
33
+ if (postEnterStyles && typeof postEnterStyles === 'object') {
34
+ elements.forEach(rootElement => {
35
+ Object.entries(postEnterStyles).forEach(_ref => {
36
+ let [cssProperty, cssValue] = _ref;
37
+ rootElement.style[cssProperty] = cssValue;
38
+ });
39
+ });
40
+ }
41
+ }
42
+
43
+ handleExitComplete(elements) {
44
+ const {
45
+ onExitComplete
46
+ } = this.props;
47
+
48
+ if (typeof onExitComplete === 'function') {
49
+ onExitComplete(elements);
50
+ }
19
51
  }
20
52
 
21
53
  render() {
@@ -35,7 +67,10 @@ export default class VelocityAnimationGroup extends React.Component {
35
67
  enterDelay,
36
68
  isCustomized,
37
69
  name,
38
- needUIPack
70
+ needUIPack,
71
+ onEnterComplete,
72
+ onExitComplete,
73
+ postEnterStyles
39
74
  } = this.props;
40
75
  let {
41
76
  direction,
@@ -76,13 +111,15 @@ export default class VelocityAnimationGroup extends React.Component {
76
111
  animation: isCustomized ? enterAnimationObj[name] : needUIPack ? `transition.${enterName}In` : enterName,
77
112
  duration: !isReducedMotion ? enterDuration : 0,
78
113
  delay: enterDelay ? enterDelay : 0,
79
- display: isFlex ? 'flex' : ''
114
+ display: isFlex ? 'flex' : '',
115
+ complete: onEnterComplete || postEnterStyles ? this.handleEnterComplete : undefined
80
116
  };
81
117
  let exitAnimation = {
82
118
  animation: isCustomized ? exitAnimationObj[name] : needUIPack ? `transition.${exitName ? exitName : enterName}Out` : exitName ? exitName : enterName,
83
119
  duration: !isReducedMotion ? exitDuration : 0,
84
120
  delay: exitDelay ? exitDelay : 0,
85
- display: 'none'
121
+ display: 'none',
122
+ complete: onExitComplete ? this.handleExitComplete : undefined
86
123
  };
87
124
  return /*#__PURE__*/React.createElement(VelocityTransitionGroup, {
88
125
  enter: enterAnimation,
@@ -15,5 +15,8 @@ export const propTypes = {
15
15
  isFlex: PropTypes.bool,
16
16
  name: PropTypes.oneOf(['fade', 'slideDown', 'flyDown', 'slideRight', 'shrink', 'expand', 'slideLeft']),
17
17
  needUIPack: PropTypes.bool,
18
- runOnMount: PropTypes.bool
18
+ runOnMount: PropTypes.bool,
19
+ onEnterComplete: PropTypes.func,
20
+ onExitComplete: PropTypes.func,
21
+ postEnterStyles: PropTypes.object
19
22
  };
@@ -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"