@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.
- package/.cli/config/variables/variableMapping.json +1 -2
- package/.cli/propValidation_report.html +1 -1
- package/README.md +16 -33
- package/es/ListItem/ListItem.module.css +2 -1
- package/es/ListItem/ListItemWithAvatar.js +1 -1
- package/es/ListItem/ListItemWithCheckBox.js +1 -1
- package/es/ListItem/ListItemWithIcon.js +1 -1
- package/es/ListItem/ListItemWithRadio.js +1 -1
- package/es/ListItem/__tests__/__snapshots__/ListItemWithAvatar.spec.js.snap +4 -4
- package/es/ListItem/__tests__/__snapshots__/ListItemWithCheckBox.spec.js.snap +4 -4
- package/es/ListItem/__tests__/__snapshots__/ListItemWithIcon.spec.js.snap +4 -4
- package/es/ListItem/__tests__/__snapshots__/ListItemWithRadio.spec.js.snap +4 -4
- package/es/MultiSelect/Suggestions.js +3 -1
- package/es/MultiSelect/props/defaultProps.js +2 -1
- package/es/MultiSelect/props/propTypes.js +1 -0
- package/es/Popup/Popup.js +16 -10
- package/es/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +40 -3
- package/es/VelocityAnimation/VelocityAnimationGroup/props/propTypes.js +4 -1
- package/es/utils/dropDownUtils.js +13 -5
- package/lib/ListItem/ListItem.module.css +2 -1
- package/lib/ListItem/ListItemWithAvatar.js +1 -1
- package/lib/ListItem/ListItemWithCheckBox.js +1 -1
- package/lib/ListItem/ListItemWithIcon.js +1 -1
- package/lib/ListItem/ListItemWithRadio.js +1 -1
- package/lib/ListItem/__tests__/__snapshots__/ListItemWithAvatar.spec.js.snap +4 -4
- package/lib/ListItem/__tests__/__snapshots__/ListItemWithCheckBox.spec.js.snap +4 -4
- package/lib/ListItem/__tests__/__snapshots__/ListItemWithIcon.spec.js.snap +4 -4
- package/lib/ListItem/__tests__/__snapshots__/ListItemWithRadio.spec.js.snap +4 -4
- package/lib/MultiSelect/Suggestions.js +4 -2
- package/lib/MultiSelect/props/defaultProps.js +2 -1
- package/lib/MultiSelect/props/propTypes.js +1 -0
- package/lib/Popup/Popup.js +16 -11
- package/lib/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +80 -26
- package/lib/VelocityAnimation/VelocityAnimationGroup/props/propTypes.js +4 -1
- package/lib/utils/dropDownUtils.js +13 -5
- package/package.json +4 -4
- package/result.json +1 -1
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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]),
|
package/lib/Popup/Popup.js
CHANGED
|
@@ -162,8 +162,8 @@ var Popup = function Popup(Component) {
|
|
|
162
162
|
_this.getIsOutsideScrollBlocked = _this.getIsOutsideScrollBlocked.bind(_assertThisInitialized(_this));
|
|
163
163
|
_this.getNeedArrow = _this.getNeedArrow.bind(_assertThisInitialized(_this));
|
|
164
164
|
_this.getCustomPositionOrder = _this.getCustomPositionOrder.bind(_assertThisInitialized(_this));
|
|
165
|
-
_this.handleOpenPopupPositionChange = _this.handleOpenPopupPositionChange.bind(_assertThisInitialized(_this));
|
|
166
|
-
|
|
165
|
+
_this.handleOpenPopupPositionChange = _this.handleOpenPopupPositionChange.bind(_assertThisInitialized(_this));
|
|
166
|
+
_this.getScrollDebounceTime = _this.getScrollDebounceTime.bind(_assertThisInitialized(_this));
|
|
167
167
|
_this.getCloseOnScrollPopup = _this.getCloseOnScrollPopup.bind(_assertThisInitialized(_this));
|
|
168
168
|
_this.handleCloseLastOpenedGroup = _this.handleCloseLastOpenedGroup.bind(_assertThisInitialized(_this));
|
|
169
169
|
_this.handleDocumentMouseDown = _this.handleDocumentMouseDown.bind(_assertThisInitialized(_this));
|
|
@@ -180,7 +180,6 @@ var Popup = function Popup(Component) {
|
|
|
180
180
|
_this.updateVisibilityOnIntersection = _this.updateVisibilityOnIntersection.bind(_assertThisInitialized(_this));
|
|
181
181
|
_this.handleAddingScrollToUpdatePosition = _this.handleAddingScrollToUpdatePosition.bind(_assertThisInitialized(_this));
|
|
182
182
|
_this.handleRemovingScrollToUpdatePosition = _this.handleRemovingScrollToUpdatePosition.bind(_assertThisInitialized(_this));
|
|
183
|
-
_this.updatePositionOnScroll = _this.updatePositionOnScroll.bind(_assertThisInitialized(_this));
|
|
184
183
|
_this.setContainerDynamicPositioning = _this.setContainerDynamicPositioning.bind(_assertThisInitialized(_this));
|
|
185
184
|
_this.updatePopupState = _this.updatePopupState.bind(_assertThisInitialized(_this));
|
|
186
185
|
_this.handleScrollAndBlockEvents = _this.handleScrollAndBlockEvents.bind(_assertThisInitialized(_this));
|
|
@@ -195,8 +194,11 @@ var Popup = function Popup(Component) {
|
|
|
195
194
|
_this.customPositionOrder = customPositionOrder;
|
|
196
195
|
_this.scrollDebounceTime = popupScrollDebounceTime;
|
|
197
196
|
_this.closeOnScroll = closeOnScrollPopup;
|
|
198
|
-
_this.isOutsideScrollBlock = isOutsideScrollBlock;
|
|
199
|
-
|
|
197
|
+
_this.isOutsideScrollBlock = isOutsideScrollBlock;
|
|
198
|
+
|
|
199
|
+
var scrollDebounceTime = _this.getScrollDebounceTime(_assertThisInitialized(_this));
|
|
200
|
+
|
|
201
|
+
_this.updatePositionOnScroll = scrollDebounceTime > 0 ? (0, _Common.debounce)(_this.updatePositionOnScroll.bind(_assertThisInitialized(_this)), scrollDebounceTime) : _this.updatePositionOnScroll.bind(_assertThisInitialized(_this)); // this.handleScroll = debounce(this.handleScroll.bind(this), scrollDebounceTime);
|
|
200
202
|
|
|
201
203
|
return _this;
|
|
202
204
|
}
|
|
@@ -513,6 +515,7 @@ var Popup = function Popup(Component) {
|
|
|
513
515
|
key: "updateVisibilityOnIntersection",
|
|
514
516
|
value: function updateVisibilityOnIntersection(entry) {
|
|
515
517
|
var dropElement = this.dropElement;
|
|
518
|
+
if (!dropElement) return;
|
|
516
519
|
|
|
517
520
|
if (entry.isIntersecting === true) {
|
|
518
521
|
this.isTargetElementVisible = true;
|
|
@@ -534,12 +537,14 @@ var Popup = function Popup(Component) {
|
|
|
534
537
|
var isArrow = popup.props.isArrow;
|
|
535
538
|
var needPopupArrow = popup.needPopupArrow;
|
|
536
539
|
return isArrow !== undefined ? isArrow : needPopupArrow;
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
540
|
+
}
|
|
541
|
+
}, {
|
|
542
|
+
key: "getScrollDebounceTime",
|
|
543
|
+
value: function getScrollDebounceTime(popup) {
|
|
544
|
+
var scrollDebounceTime = popup.props.scrollDebounceTime;
|
|
545
|
+
var popupScrollDebounceTime = popup.scrollDebounceTime;
|
|
546
|
+
return scrollDebounceTime !== undefined ? scrollDebounceTime : popupScrollDebounceTime;
|
|
547
|
+
}
|
|
543
548
|
}, {
|
|
544
549
|
key: "getCloseOnScrollPopup",
|
|
545
550
|
value: function getCloseOnScrollPopup(popup) {
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
@@ -29,6 +27,20 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
29
27
|
|
|
30
28
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
31
29
|
|
|
30
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
31
|
+
|
|
32
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
33
|
+
|
|
34
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
35
|
+
|
|
36
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
37
|
+
|
|
38
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
39
|
+
|
|
40
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
41
|
+
|
|
42
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
43
|
+
|
|
32
44
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
33
45
|
|
|
34
46
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
@@ -63,35 +75,75 @@ var VelocityAnimationGroup = /*#__PURE__*/function (_React$Component) {
|
|
|
63
75
|
var _super = _createSuper(VelocityAnimationGroup);
|
|
64
76
|
|
|
65
77
|
function VelocityAnimationGroup(props) {
|
|
78
|
+
var _this;
|
|
79
|
+
|
|
66
80
|
_classCallCheck(this, VelocityAnimationGroup);
|
|
67
81
|
|
|
68
|
-
|
|
82
|
+
_this = _super.call(this, props);
|
|
83
|
+
_this.handleEnterComplete = _this.handleEnterComplete.bind(_assertThisInitialized(_this));
|
|
84
|
+
_this.handleExitComplete = _this.handleExitComplete.bind(_assertThisInitialized(_this));
|
|
85
|
+
return _this;
|
|
69
86
|
}
|
|
70
87
|
|
|
71
88
|
_createClass(VelocityAnimationGroup, [{
|
|
89
|
+
key: "handleEnterComplete",
|
|
90
|
+
value: function handleEnterComplete(elements) {
|
|
91
|
+
var _this$props = this.props,
|
|
92
|
+
onEnterComplete = _this$props.onEnterComplete,
|
|
93
|
+
postEnterStyles = _this$props.postEnterStyles;
|
|
94
|
+
|
|
95
|
+
if (typeof onEnterComplete === 'function') {
|
|
96
|
+
onEnterComplete(elements);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (postEnterStyles && _typeof(postEnterStyles) === 'object') {
|
|
100
|
+
elements.forEach(function (rootElement) {
|
|
101
|
+
Object.entries(postEnterStyles).forEach(function (_ref) {
|
|
102
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
103
|
+
cssProperty = _ref2[0],
|
|
104
|
+
cssValue = _ref2[1];
|
|
105
|
+
|
|
106
|
+
rootElement.style[cssProperty] = cssValue;
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}, {
|
|
112
|
+
key: "handleExitComplete",
|
|
113
|
+
value: function handleExitComplete(elements) {
|
|
114
|
+
var onExitComplete = this.props.onExitComplete;
|
|
115
|
+
|
|
116
|
+
if (typeof onExitComplete === 'function') {
|
|
117
|
+
onExitComplete(elements);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}, {
|
|
72
121
|
key: "render",
|
|
73
122
|
value: function render() {
|
|
74
|
-
var _this$
|
|
75
|
-
children = _this$
|
|
76
|
-
enterName = _this$
|
|
77
|
-
exitName = _this$
|
|
78
|
-
enterDuration = _this$
|
|
79
|
-
exitDuration = _this$
|
|
80
|
-
isActive = _this$
|
|
81
|
-
component = _this$
|
|
82
|
-
runOnMount = _this$
|
|
83
|
-
enterShowStyle = _this$
|
|
84
|
-
enterHideStyle = _this$
|
|
85
|
-
exitDelay = _this$
|
|
86
|
-
isFlex = _this$
|
|
87
|
-
enterDelay = _this$
|
|
88
|
-
isCustomized = _this$
|
|
89
|
-
name = _this$
|
|
90
|
-
needUIPack = _this$
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
123
|
+
var _this$props2 = this.props,
|
|
124
|
+
children = _this$props2.children,
|
|
125
|
+
enterName = _this$props2.enterName,
|
|
126
|
+
exitName = _this$props2.exitName,
|
|
127
|
+
enterDuration = _this$props2.enterDuration,
|
|
128
|
+
exitDuration = _this$props2.exitDuration,
|
|
129
|
+
isActive = _this$props2.isActive,
|
|
130
|
+
component = _this$props2.component,
|
|
131
|
+
runOnMount = _this$props2.runOnMount,
|
|
132
|
+
enterShowStyle = _this$props2.enterShowStyle,
|
|
133
|
+
enterHideStyle = _this$props2.enterHideStyle,
|
|
134
|
+
exitDelay = _this$props2.exitDelay,
|
|
135
|
+
isFlex = _this$props2.isFlex,
|
|
136
|
+
enterDelay = _this$props2.enterDelay,
|
|
137
|
+
isCustomized = _this$props2.isCustomized,
|
|
138
|
+
name = _this$props2.name,
|
|
139
|
+
needUIPack = _this$props2.needUIPack,
|
|
140
|
+
onEnterComplete = _this$props2.onEnterComplete,
|
|
141
|
+
onExitComplete = _this$props2.onExitComplete,
|
|
142
|
+
postEnterStyles = _this$props2.postEnterStyles;
|
|
143
|
+
|
|
144
|
+
var _ref3 = this.context || {},
|
|
145
|
+
direction = _ref3.direction,
|
|
146
|
+
isReducedMotion = _ref3.isReducedMotion;
|
|
95
147
|
|
|
96
148
|
var childProps = clearProps(this.props);
|
|
97
149
|
var enterAnimationObj = {
|
|
@@ -128,13 +180,15 @@ var VelocityAnimationGroup = /*#__PURE__*/function (_React$Component) {
|
|
|
128
180
|
animation: isCustomized ? enterAnimationObj[name] : needUIPack ? "transition.".concat(enterName, "In") : enterName,
|
|
129
181
|
duration: !isReducedMotion ? enterDuration : 0,
|
|
130
182
|
delay: enterDelay ? enterDelay : 0,
|
|
131
|
-
display: isFlex ? 'flex' : ''
|
|
183
|
+
display: isFlex ? 'flex' : '',
|
|
184
|
+
complete: onEnterComplete || postEnterStyles ? this.handleEnterComplete : undefined
|
|
132
185
|
};
|
|
133
186
|
var exitAnimation = {
|
|
134
187
|
animation: isCustomized ? exitAnimationObj[name] : needUIPack ? "transition.".concat(exitName ? exitName : enterName, "Out") : exitName ? exitName : enterName,
|
|
135
188
|
duration: !isReducedMotion ? exitDuration : 0,
|
|
136
189
|
delay: exitDelay ? exitDelay : 0,
|
|
137
|
-
display: 'none'
|
|
190
|
+
display: 'none',
|
|
191
|
+
complete: onExitComplete ? this.handleExitComplete : undefined
|
|
138
192
|
};
|
|
139
193
|
return /*#__PURE__*/_react["default"].createElement(_velocityReact.VelocityTransitionGroup, _extends({
|
|
140
194
|
enter: enterAnimation,
|
|
@@ -25,6 +25,9 @@ var propTypes = {
|
|
|
25
25
|
isFlex: _propTypes["default"].bool,
|
|
26
26
|
name: _propTypes["default"].oneOf(['fade', 'slideDown', 'flyDown', 'slideRight', 'shrink', 'expand', 'slideLeft']),
|
|
27
27
|
needUIPack: _propTypes["default"].bool,
|
|
28
|
-
runOnMount: _propTypes["default"].bool
|
|
28
|
+
runOnMount: _propTypes["default"].bool,
|
|
29
|
+
onEnterComplete: _propTypes["default"].func,
|
|
30
|
+
onExitComplete: _propTypes["default"].func,
|
|
31
|
+
postEnterStyles: _propTypes["default"].object
|
|
29
32
|
};
|
|
30
33
|
exports.propTypes = propTypes;
|
|
@@ -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] :
|
|
159
|
-
|
|
160
|
-
|
|
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.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"main": "es/index.js",
|
|
5
5
|
"module": "es/index.js",
|
|
6
6
|
"private": false,
|
|
@@ -65,13 +65,13 @@
|
|
|
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.
|
|
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",
|
|
72
72
|
"@zohodesk/docstool": "1.0.0-alpha-2",
|
|
73
73
|
"@zohodesk/hooks": "2.0.5",
|
|
74
|
-
"@zohodesk/icons": "1.0.
|
|
74
|
+
"@zohodesk/icons": "1.0.78",
|
|
75
75
|
"@zohodesk/svg": "1.1.22",
|
|
76
76
|
"@zohodesk/utils": "1.3.14",
|
|
77
77
|
"@zohodesk/variables": "1.0.0",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"selectn": "1.1.2"
|
|
87
87
|
},
|
|
88
88
|
"peerDependencies": {
|
|
89
|
-
"@zohodesk/icons": "1.0.
|
|
89
|
+
"@zohodesk/icons": "1.0.78",
|
|
90
90
|
"@zohodesk/variables": "1.0.0",
|
|
91
91
|
"@zohodesk/svg": "1.1.22",
|
|
92
92
|
"@zohodesk/virtualizer": "1.0.3",
|