@zohodesk/components 1.0.0-temp-199.14 → 1.0.0-temp-222
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/assets/Appearance/dark/mode/Component_DarkMode.module.css +1 -0
- package/assets/Appearance/light/mode/Component_LightMode.module.css +1 -0
- package/assets/Appearance/pureDark/mode/Component_PureDarkMode.module.css +1 -0
- package/es/ListItem/ListItem.js +3 -5
- package/es/ListItem/ListItem.module.css +46 -23
- package/es/ListItem/ListItemWithAvatar.js +16 -13
- package/es/ListItem/ListItemWithCheckBox.js +16 -12
- package/es/ListItem/ListItemWithIcon.js +17 -14
- package/es/ListItem/ListItemWithRadio.js +16 -12
- package/es/ListItem/props/defaultProps.js +8 -6
- package/es/ListItem/props/propTypes.js +11 -5
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +2 -7
- package/es/MultiSelect/AdvancedMultiSelect.js +7 -3
- package/es/MultiSelect/MultiSelect.js +7 -8
- package/es/MultiSelect/MultiSelectWithAvatar.js +3 -1
- package/es/MultiSelect/Suggestions.js +34 -11
- package/es/MultiSelect/props/defaultProps.js +1 -4
- package/es/MultiSelect/props/propTypes.js +8 -11
- package/es/Select/GroupSelect.js +1 -5
- package/es/Select/SelectWithAvatar.js +2 -7
- package/es/Select/SelectWithIcon.js +2 -4
- package/es/Select/props/defaultProps.js +1 -2
- package/es/Select/props/propTypes.js +3 -8
- package/es/common/common.module.css +6 -1
- package/es/utils/dropDownUtils.js +19 -10
- package/lib/ListItem/ListItem.js +3 -5
- package/lib/ListItem/ListItem.module.css +46 -23
- package/lib/ListItem/ListItemWithAvatar.js +15 -12
- package/lib/ListItem/ListItemWithCheckBox.js +15 -11
- package/lib/ListItem/ListItemWithIcon.js +16 -13
- package/lib/ListItem/ListItemWithRadio.js +15 -11
- package/lib/ListItem/props/defaultProps.js +8 -6
- package/lib/ListItem/props/propTypes.js +11 -6
- package/lib/MultiSelect/AdvancedGroupMultiSelect.js +3 -8
- package/lib/MultiSelect/AdvancedMultiSelect.js +72 -67
- package/lib/MultiSelect/MultiSelect.js +8 -7
- package/lib/MultiSelect/MultiSelectWithAvatar.js +3 -1
- package/lib/MultiSelect/Suggestions.js +36 -11
- package/lib/MultiSelect/props/defaultProps.js +1 -4
- package/lib/MultiSelect/props/propTypes.js +8 -10
- package/lib/Select/GroupSelect.js +2 -4
- package/lib/Select/SelectWithAvatar.js +3 -8
- package/lib/Select/SelectWithIcon.js +3 -5
- package/lib/Select/props/defaultProps.js +1 -2
- package/lib/Select/props/propTypes.js +3 -8
- package/lib/common/common.module.css +6 -1
- package/lib/utils/dropDownUtils.js +21 -10
- package/package.json +4 -4
- package/result.json +1 -1
|
@@ -21,6 +21,8 @@ var _ListItemWithIcon = _interopRequireDefault(require("../ListItem/ListItemWith
|
|
|
21
21
|
|
|
22
22
|
var _Layout = require("../Layout");
|
|
23
23
|
|
|
24
|
+
var _ListContainer = _interopRequireDefault(require("../ListItem/ListContainer"));
|
|
25
|
+
|
|
24
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
25
27
|
|
|
26
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); }
|
|
@@ -84,19 +86,15 @@ var Suggestions = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
84
86
|
palette = _this$props.palette,
|
|
85
87
|
htmlId = _this$props.htmlId,
|
|
86
88
|
a11y = _this$props.a11y,
|
|
87
|
-
|
|
88
|
-
needMultiLineText = _this$props.needMultiLineText;
|
|
89
|
+
secondaryField = _this$props.secondaryField;
|
|
89
90
|
var ariaParentRole = a11y.ariaParentRole,
|
|
90
91
|
ariaMultiselectable = a11y.ariaMultiselectable;
|
|
91
|
-
var _customClass$containe = customClass.containerClass,
|
|
92
|
-
containerClass = _customClass$containe === void 0 ? '' : _customClass$containe;
|
|
93
92
|
return /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
94
93
|
isCover: false,
|
|
95
94
|
role: ariaParentRole,
|
|
96
95
|
id: htmlId,
|
|
97
96
|
tabindex: "0",
|
|
98
|
-
"aria-multiselectable": ariaMultiselectable
|
|
99
|
-
className: containerClass
|
|
97
|
+
"aria-multiselectable": ariaMultiselectable
|
|
100
98
|
}, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
101
99
|
dataId: "".concat(dataId),
|
|
102
100
|
className: className ? className : ''
|
|
@@ -120,15 +118,40 @@ var Suggestions = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
120
118
|
});
|
|
121
119
|
|
|
122
120
|
var commonProps = _objectSpread({
|
|
123
|
-
isDisabled: isDisabled
|
|
124
|
-
needMultiLineText: needMultiLineText
|
|
121
|
+
isDisabled: isDisabled
|
|
125
122
|
}, listItemCustomProps);
|
|
126
123
|
|
|
127
124
|
if (listItemProps) {
|
|
128
125
|
commonProps.customProps = {
|
|
129
126
|
ListItemProps: _objectSpread({}, listItemProps)
|
|
130
127
|
};
|
|
131
|
-
}
|
|
128
|
+
} // if(secondaryField) {
|
|
129
|
+
// return (
|
|
130
|
+
// <ListContainer
|
|
131
|
+
// active={isActive}
|
|
132
|
+
// iconSize={iconSize}
|
|
133
|
+
// size={listItemSize}
|
|
134
|
+
// palette={palette}
|
|
135
|
+
// a11y={list_a11y}
|
|
136
|
+
// highlight={isHighlight}
|
|
137
|
+
// isDisabled={isDisabled}
|
|
138
|
+
// autoHover
|
|
139
|
+
// needTick={needTick}
|
|
140
|
+
// needBorder={needBorder}
|
|
141
|
+
// onClick={onClick}
|
|
142
|
+
// onMouseEnter={onMouseEnter}
|
|
143
|
+
// eleRef={getRef}
|
|
144
|
+
// key={`${id}avatarListItem`}
|
|
145
|
+
// >
|
|
146
|
+
// <Box flexible>
|
|
147
|
+
// <div>{value}</div>
|
|
148
|
+
// <div>{suggestion[secondaryField]}</div>
|
|
149
|
+
// </Box>
|
|
150
|
+
// </ListContainer>
|
|
151
|
+
// )
|
|
152
|
+
// }
|
|
153
|
+
// else
|
|
154
|
+
|
|
132
155
|
|
|
133
156
|
if (optionType === 'avatar') {
|
|
134
157
|
return /*#__PURE__*/_react["default"].createElement(_ListItemWithAvatar["default"], _extends({}, commonProps, {
|
|
@@ -149,7 +172,8 @@ var Suggestions = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
149
172
|
size: listItemSize,
|
|
150
173
|
avatarPalette: avatarPalette,
|
|
151
174
|
palette: palette,
|
|
152
|
-
a11y: list_a11y
|
|
175
|
+
a11y: list_a11y,
|
|
176
|
+
secondaryValue: suggestion[secondaryField] || undefined
|
|
153
177
|
}));
|
|
154
178
|
} else if (optionType === 'icon') {
|
|
155
179
|
return /*#__PURE__*/_react["default"].createElement(_ListItemWithIcon["default"], _extends({}, commonProps, {
|
|
@@ -169,7 +193,8 @@ var Suggestions = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
169
193
|
iconSize: iconSize,
|
|
170
194
|
size: listItemSize,
|
|
171
195
|
palette: palette,
|
|
172
|
-
a11y: list_a11y
|
|
196
|
+
a11y: list_a11y,
|
|
197
|
+
secondaryValue: suggestion[secondaryField] || undefined
|
|
173
198
|
}));
|
|
174
199
|
}
|
|
175
200
|
|
|
@@ -46,7 +46,6 @@ var AdvancedGroupMultiSelect_defaultProps = {
|
|
|
46
46
|
palette: 'default',
|
|
47
47
|
isLoading: false,
|
|
48
48
|
dataSelectorId: 'advancedGroupMultiSelect',
|
|
49
|
-
customProps: {},
|
|
50
49
|
allowValueFallback: true
|
|
51
50
|
};
|
|
52
51
|
exports.AdvancedGroupMultiSelect_defaultProps = AdvancedGroupMultiSelect_defaultProps;
|
|
@@ -182,8 +181,6 @@ var SelectedOptions_defaultProps = {
|
|
|
182
181
|
};
|
|
183
182
|
exports.SelectedOptions_defaultProps = SelectedOptions_defaultProps;
|
|
184
183
|
var Suggestions_defaultProps = {
|
|
185
|
-
a11y: {}
|
|
186
|
-
customClass: {},
|
|
187
|
-
needMultiLineText: false
|
|
184
|
+
a11y: {}
|
|
188
185
|
};
|
|
189
186
|
exports.Suggestions_defaultProps = Suggestions_defaultProps;
|
|
@@ -65,6 +65,8 @@ var MultiSelect_propTypes = {
|
|
|
65
65
|
a11y: _propTypes["default"].shape({
|
|
66
66
|
clearLabel: _propTypes["default"].string
|
|
67
67
|
}),
|
|
68
|
+
secondaryField: _propTypes["default"].string,
|
|
69
|
+
searchFields: _propTypes["default"].arrayOf(_propTypes["default"].string),
|
|
68
70
|
isAnimate: _propTypes["default"].bool,
|
|
69
71
|
isBoxPaddingNeed: _propTypes["default"].bool,
|
|
70
72
|
isDisabled: _propTypes["default"].bool,
|
|
@@ -129,8 +131,7 @@ var MultiSelect_propTypes = {
|
|
|
129
131
|
setAriaId: _propTypes["default"].string,
|
|
130
132
|
ariaErrorId: _propTypes["default"].string,
|
|
131
133
|
customProps: _propTypes["default"].shape({
|
|
132
|
-
TextBoxIconProps: _propTypes["default"].object
|
|
133
|
-
SuggestionsProps: _propTypes["default"].object
|
|
134
|
+
TextBoxIconProps: _propTypes["default"].object
|
|
134
135
|
}),
|
|
135
136
|
isFocus: _propTypes["default"].bool,
|
|
136
137
|
allowValueFallback: _propTypes["default"].bool
|
|
@@ -196,6 +197,7 @@ var Suggestions_propTypes = {
|
|
|
196
197
|
palette: _propTypes["default"].string,
|
|
197
198
|
selectedOptions: _propTypes["default"].array,
|
|
198
199
|
htmlId: _propTypes["default"].string,
|
|
200
|
+
secondaryField: _propTypes["default"].string,
|
|
199
201
|
suggestions: _propTypes["default"].arrayOf(_propTypes["default"].shape({
|
|
200
202
|
id: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]),
|
|
201
203
|
value: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]),
|
|
@@ -203,11 +205,7 @@ var Suggestions_propTypes = {
|
|
|
203
205
|
logo: _propTypes["default"].string,
|
|
204
206
|
optionType: _propTypes["default"].string,
|
|
205
207
|
listItemProps: _propTypes["default"].object
|
|
206
|
-
}))
|
|
207
|
-
customClass: _propTypes["default"].shape({
|
|
208
|
-
containerClass: _propTypes["default"].string
|
|
209
|
-
}),
|
|
210
|
-
needMultiLineText: _propTypes["default"].bool
|
|
208
|
+
}))
|
|
211
209
|
};
|
|
212
210
|
exports.Suggestions_propTypes = Suggestions_propTypes;
|
|
213
211
|
var AdvancedGroupMultiSelect_propTypes = (_AdvancedGroupMultiSe = {
|
|
@@ -278,9 +276,7 @@ var AdvancedGroupMultiSelect_propTypes = (_AdvancedGroupMultiSe = {
|
|
|
278
276
|
needToCloseOnSelect: _propTypes["default"].func,
|
|
279
277
|
searchStr: _propTypes["default"].string,
|
|
280
278
|
children: _propTypes["default"].node
|
|
281
|
-
}, _defineProperty(_AdvancedGroupMultiSe, "dataSelectorId", _propTypes["default"].string), _defineProperty(_AdvancedGroupMultiSe, "isFocus", _propTypes["default"].bool), _defineProperty(_AdvancedGroupMultiSe, "allowValueFallback", _propTypes["default"].bool),
|
|
282
|
-
SuggestionsProps: _propTypes["default"].object
|
|
283
|
-
})), _AdvancedGroupMultiSe);
|
|
279
|
+
}, _defineProperty(_AdvancedGroupMultiSe, "dataSelectorId", _propTypes["default"].string), _defineProperty(_AdvancedGroupMultiSe, "isFocus", _propTypes["default"].bool), _defineProperty(_AdvancedGroupMultiSe, "allowValueFallback", _propTypes["default"].bool), _AdvancedGroupMultiSe);
|
|
284
280
|
exports.AdvancedGroupMultiSelect_propTypes = AdvancedGroupMultiSelect_propTypes;
|
|
285
281
|
|
|
286
282
|
var AdvancedMultiSelect_propTypes = _objectSpread(_objectSpread({}, MultiSelect_propTypes), {}, {
|
|
@@ -312,6 +308,8 @@ var AdvancedMultiSelect_propTypes = _objectSpread(_objectSpread({}, MultiSelect_
|
|
|
312
308
|
//For grouping multiSelect
|
|
313
309
|
optionType: _propTypes["default"].oneOf(['default', 'avatar', 'icon']),
|
|
314
310
|
needEffect: _propTypes["default"].bool,
|
|
311
|
+
secondaryField: _propTypes["default"].string,
|
|
312
|
+
searchFields: _propTypes["default"].arrayOf(_propTypes["default"].string),
|
|
315
313
|
animationStyle: _propTypes["default"].string,
|
|
316
314
|
defaultDropBoxPosition: _propTypes["default"].oneOf(['bottom', 'top', 'left', 'right']),
|
|
317
315
|
dropBoxSize: _propTypes["default"].oneOf(['small', 'medium', 'large']),
|
|
@@ -670,8 +670,6 @@ var GroupSelectComponent = /*#__PURE__*/function (_PureComponent) {
|
|
|
670
670
|
isLoading = _this$props9.isLoading,
|
|
671
671
|
dataSelectorId = _this$props9.dataSelectorId,
|
|
672
672
|
customProps = _this$props9.customProps;
|
|
673
|
-
var _customProps$Suggesti = customProps.SuggestionsProps,
|
|
674
|
-
SuggestionsProps = _customProps$Suggesti === void 0 ? {} : _customProps$Suggesti;
|
|
675
673
|
i18nKeys = Object.assign({}, i18nKeys, {
|
|
676
674
|
emptyText: i18nKeys.emptyText || emptyMessage,
|
|
677
675
|
searchEmptyText: i18nKeys.searchEmptyText || searchEmptyMessage
|
|
@@ -848,7 +846,7 @@ var GroupSelectComponent = /*#__PURE__*/function (_PureComponent) {
|
|
|
848
846
|
a11y: {
|
|
849
847
|
role: 'heading'
|
|
850
848
|
}
|
|
851
|
-
})), /*#__PURE__*/_react["default"].createElement(_Suggestions["default"],
|
|
849
|
+
})), /*#__PURE__*/_react["default"].createElement(_Suggestions["default"], {
|
|
852
850
|
activeId: selectedId,
|
|
853
851
|
suggestions: options,
|
|
854
852
|
getRef: _this7.suggestionItemRef,
|
|
@@ -864,7 +862,7 @@ var GroupSelectComponent = /*#__PURE__*/function (_PureComponent) {
|
|
|
864
862
|
role: 'option'
|
|
865
863
|
},
|
|
866
864
|
dataId: "".concat(dataId, "_Options")
|
|
867
|
-
}
|
|
865
|
+
}));
|
|
868
866
|
}) : /*#__PURE__*/_react["default"].createElement(_EmptyState["default"], {
|
|
869
867
|
options: revampedGroups,
|
|
870
868
|
searchString: searchStr,
|
|
@@ -51,8 +51,6 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
51
51
|
|
|
52
52
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
53
53
|
|
|
54
|
-
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); }
|
|
55
|
-
|
|
56
54
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
57
55
|
|
|
58
56
|
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); } }
|
|
@@ -217,10 +215,7 @@ var SelectWithAvatarComponent = /*#__PURE__*/function (_SelectComponent) {
|
|
|
217
215
|
needEffect = _this$props.needEffect,
|
|
218
216
|
isLoading = _this$props.isLoading,
|
|
219
217
|
dataSelectorId = _this$props.dataSelectorId,
|
|
220
|
-
getTargetRef = _this$props.getTargetRef
|
|
221
|
-
customProps = _this$props.customProps;
|
|
222
|
-
var _customProps$Suggesti = customProps.SuggestionsProps,
|
|
223
|
-
SuggestionsProps = _customProps$Suggesti === void 0 ? {} : _customProps$Suggesti;
|
|
218
|
+
getTargetRef = _this$props.getTargetRef;
|
|
224
219
|
i18nKeys = Object.assign({}, i18nKeys, {
|
|
225
220
|
emptyText: i18nKeys.emptyText || emptyMessage,
|
|
226
221
|
searchEmptyText: i18nKeys.searchEmptyText || searchEmptyMessage
|
|
@@ -359,7 +354,7 @@ var SelectWithAvatarComponent = /*#__PURE__*/function (_SelectComponent) {
|
|
|
359
354
|
a11y: {
|
|
360
355
|
role: 'heading'
|
|
361
356
|
}
|
|
362
|
-
})) : null, suggestions.length ? /*#__PURE__*/_react["default"].createElement(_Suggestions["default"],
|
|
357
|
+
})) : null, suggestions.length ? /*#__PURE__*/_react["default"].createElement(_Suggestions["default"], {
|
|
363
358
|
dataId: "".concat(dataId, "_Options"),
|
|
364
359
|
activeId: selectedId,
|
|
365
360
|
suggestions: suggestions,
|
|
@@ -376,7 +371,7 @@ var SelectWithAvatarComponent = /*#__PURE__*/function (_SelectComponent) {
|
|
|
376
371
|
ariaParentRole: 'listbox',
|
|
377
372
|
role: 'option'
|
|
378
373
|
}
|
|
379
|
-
}
|
|
374
|
+
}) : /*#__PURE__*/_react["default"].createElement(_EmptyState["default"], {
|
|
380
375
|
isLoading: isFetchingOptions,
|
|
381
376
|
options: options,
|
|
382
377
|
searchString: searchStr,
|
|
@@ -440,9 +440,7 @@ var SelectWithIcon = /*#__PURE__*/function (_Component) {
|
|
|
440
440
|
_customProps$Dropdown = customProps.DropdownSearchTextBoxProps,
|
|
441
441
|
DropdownSearchTextBoxProps = _customProps$Dropdown === void 0 ? {} : _customProps$Dropdown,
|
|
442
442
|
_customProps$TextBoxI = customProps.TextBoxIconProps,
|
|
443
|
-
TextBoxIconProps = _customProps$TextBoxI === void 0 ? {} : _customProps$TextBoxI
|
|
444
|
-
_customProps$ListItem = customProps.ListItemProps,
|
|
445
|
-
ListItemProps = _customProps$ListItem === void 0 ? {} : _customProps$ListItem;
|
|
443
|
+
TextBoxIconProps = _customProps$TextBoxI === void 0 ? {} : _customProps$TextBoxI;
|
|
446
444
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
447
445
|
className: "".concat(_SelectModule["default"].container, " ").concat(_SelectModule["default"]["box_".concat(size)], " ").concat(isReadOnly ? _SelectModule["default"].readonly : '', " ").concat(borderColor === 'transparent' ? _SelectModule["default"].transparentContainer : ''),
|
|
448
446
|
"data-title": isDisabled ? title : null,
|
|
@@ -575,7 +573,7 @@ var SelectWithIcon = /*#__PURE__*/function (_Component) {
|
|
|
575
573
|
var iconName = options.iconName,
|
|
576
574
|
iconSize = options.iconSize,
|
|
577
575
|
iconColor = options.iconColor;
|
|
578
|
-
return /*#__PURE__*/_react["default"].createElement(_ListItemWithIcon["default"],
|
|
576
|
+
return /*#__PURE__*/_react["default"].createElement(_ListItemWithIcon["default"], {
|
|
579
577
|
key: options[idKey],
|
|
580
578
|
value: options[valueKey],
|
|
581
579
|
size: "medium",
|
|
@@ -599,7 +597,7 @@ var SelectWithIcon = /*#__PURE__*/function (_Component) {
|
|
|
599
597
|
ariaSelected: selectedId === options[idKey],
|
|
600
598
|
ariaLabel: options[valueKey]
|
|
601
599
|
}
|
|
602
|
-
}
|
|
600
|
+
});
|
|
603
601
|
})) : /*#__PURE__*/_react["default"].createElement(_EmptyState["default"], {
|
|
604
602
|
isLoading: isFetchingOptions,
|
|
605
603
|
options: options,
|
|
@@ -112,8 +112,7 @@ var SelectWithAvatar_defaultProps = {
|
|
|
112
112
|
isRestrictScroll: false,
|
|
113
113
|
i18nKeys: {},
|
|
114
114
|
needEffect: true,
|
|
115
|
-
isLoading: false
|
|
116
|
-
customProps: {}
|
|
115
|
+
isLoading: false
|
|
117
116
|
};
|
|
118
117
|
exports.SelectWithAvatar_defaultProps = SelectWithAvatar_defaultProps;
|
|
119
118
|
var SelectWithIcon_defaultProps = (_SelectWithIcon_defau = {
|
|
@@ -195,8 +195,7 @@ var GroupSelect_propTypes = {
|
|
|
195
195
|
isDefaultSelectValue: _propTypes["default"].bool,
|
|
196
196
|
customProps: _propTypes["default"].shape({
|
|
197
197
|
TextBoxProps: _propTypes["default"].object,
|
|
198
|
-
TextBoxIconProps: _propTypes["default"].object
|
|
199
|
-
SuggestionsProps: _propTypes["default"].object
|
|
198
|
+
TextBoxIconProps: _propTypes["default"].object
|
|
200
199
|
}),
|
|
201
200
|
allowValueFallback: _propTypes["default"].bool
|
|
202
201
|
};
|
|
@@ -261,10 +260,7 @@ var SelectWithAvatar_propTypes = _objectSpread(_objectSpread({}, Select_propType
|
|
|
261
260
|
htmlId: _propTypes["default"].string,
|
|
262
261
|
needEffect: _propTypes["default"].bool,
|
|
263
262
|
isLoading: _propTypes["default"].bool,
|
|
264
|
-
dataSelectorId: _propTypes["default"].string
|
|
265
|
-
customProps: _propTypes["default"].shape({
|
|
266
|
-
SuggestionsProps: _propTypes["default"].object
|
|
267
|
-
})
|
|
263
|
+
dataSelectorId: _propTypes["default"].string
|
|
268
264
|
});
|
|
269
265
|
|
|
270
266
|
exports.SelectWithAvatar_propTypes = SelectWithAvatar_propTypes;
|
|
@@ -328,8 +324,7 @@ var SelectWithIcon_propTypes = {
|
|
|
328
324
|
customProps: _propTypes["default"].shape({
|
|
329
325
|
TextBoxProps: _propTypes["default"].object,
|
|
330
326
|
DropdownSearchTextBoxProps: _propTypes["default"].object,
|
|
331
|
-
TextBoxIconProps: _propTypes["default"].object
|
|
332
|
-
ListItemProps: _propTypes["default"].object
|
|
327
|
+
TextBoxIconProps: _propTypes["default"].object
|
|
333
328
|
})
|
|
334
329
|
};
|
|
335
330
|
exports.SelectWithIcon_propTypes = SelectWithIcon_propTypes;
|
|
@@ -260,6 +260,12 @@
|
|
|
260
260
|
justify-content: space-between;
|
|
261
261
|
}
|
|
262
262
|
|
|
263
|
+
.justifyFStart {
|
|
264
|
+
-webkit-box-pack: flex-start;
|
|
265
|
+
-ms-flex-pack: flex-start;
|
|
266
|
+
justify-content: flex-start;
|
|
267
|
+
}
|
|
268
|
+
|
|
263
269
|
.justifyFend {
|
|
264
270
|
-webkit-box-pack: flex-end;
|
|
265
271
|
-ms-flex-pack: flex-end;
|
|
@@ -493,7 +499,6 @@
|
|
|
493
499
|
display: -webkit-box;
|
|
494
500
|
overflow: hidden;
|
|
495
501
|
}
|
|
496
|
-
|
|
497
502
|
.lineClamp {
|
|
498
503
|
composes: wbreak clamp;
|
|
499
504
|
-webkit-line-clamp: var(--line-clamp,3);
|
|
@@ -142,25 +142,35 @@ var getListItemProps = function getListItemProps(props) {
|
|
|
142
142
|
return props.listItemProps || '';
|
|
143
143
|
};
|
|
144
144
|
|
|
145
|
+
var getSearchFields = function getSearchFields(props) {
|
|
146
|
+
return props.searchFields || ['value'];
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
var isExistInSearch = function isExistInSearch() {
|
|
150
|
+
var searchFields = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
151
|
+
var searchStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
152
|
+
var option = arguments.length > 2 ? arguments[2] : undefined;
|
|
153
|
+
var matchedFields = searchFields.filter(function (element) {
|
|
154
|
+
return (0, _Common.getSearchString)(option[element]).indexOf(searchStr) !== -1;
|
|
155
|
+
});
|
|
156
|
+
return matchedFields.length !== 0;
|
|
157
|
+
};
|
|
158
|
+
|
|
145
159
|
var getAllowValueFallback = function getAllowValueFallback(props) {
|
|
146
160
|
return props.allowValueFallback !== false;
|
|
147
161
|
};
|
|
148
162
|
|
|
149
163
|
var makeGetMultiSelectFilterSuggestions = function makeGetMultiSelectFilterSuggestions() {
|
|
150
|
-
return (0, _reselect.createSelector)([getOptions, getSelectedOptionsSel, getSearchStr, getNeedSearch, getIsStartWithSearch, getKeepSelectedOptions], function (options, selectedOptions, searchStr, needSearch, isStartsWithSearch, keepSelectedOptions) {
|
|
164
|
+
return (0, _reselect.createSelector)([getOptions, getSelectedOptionsSel, getSearchStr, getNeedSearch, getIsStartWithSearch, getKeepSelectedOptions, getSearchFields], function (options, selectedOptions, searchStr, needSearch, isStartsWithSearch, keepSelectedOptions, searchFields) {
|
|
151
165
|
var suggestions = [];
|
|
152
166
|
var suggestionIds = [];
|
|
153
167
|
options.forEach(function (option) {
|
|
154
|
-
var id = option.id,
|
|
155
|
-
_option$value = option.value,
|
|
156
|
-
value = _option$value === void 0 ? '' : _option$value;
|
|
157
|
-
var valueString = (0, _Common.getSearchString)(value);
|
|
158
168
|
var searchString = (0, _Common.getSearchString)(searchStr);
|
|
159
|
-
var isMatch = needSearch ? isStartsWithSearch ? valueString.startsWith(searchString) :
|
|
169
|
+
var isMatch = needSearch ? isStartsWithSearch ? valueString.startsWith(searchString) : isExistInSearch(searchFields, searchString, option) : true;
|
|
160
170
|
|
|
161
|
-
if (selectedOptions.indexOf(id) === -1 && isMatch || keepSelectedOptions) {
|
|
171
|
+
if (selectedOptions.indexOf(option.id) === -1 && isMatch || keepSelectedOptions) {
|
|
162
172
|
suggestions.push(option);
|
|
163
|
-
suggestionIds.push(id);
|
|
173
|
+
suggestionIds.push(option.id);
|
|
164
174
|
}
|
|
165
175
|
});
|
|
166
176
|
return {
|
|
@@ -255,11 +265,12 @@ var makeFormatOptions = function makeFormatOptions() {
|
|
|
255
265
|
|
|
256
266
|
if (remvampOptionIds.indexOf(id) === -1 && !(0, _Common.getIsEmptyValue)(id) && !(0, _Common.getIsEmptyValue)(value)) {
|
|
257
267
|
remvampOptionIds.push(id);
|
|
258
|
-
|
|
268
|
+
|
|
269
|
+
var optionDetails = _objectSpread(_objectSpread({}, option), {}, {
|
|
259
270
|
id: id,
|
|
260
271
|
value: value,
|
|
261
272
|
optionType: impOptionType || optionType
|
|
262
|
-
};
|
|
273
|
+
});
|
|
263
274
|
|
|
264
275
|
if (imageField) {
|
|
265
276
|
optionDetails.photoURL = photoURL;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zohodesk/components",
|
|
3
|
-
"version": "1.0.0-temp-
|
|
3
|
+
"version": "1.0.0-temp-222",
|
|
4
4
|
"main": "es/index.js",
|
|
5
5
|
"module": "es/index.js",
|
|
6
6
|
"private": false,
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"build:css:umd": "npm run clean && npm run init && react-cli build:css:umd",
|
|
39
39
|
"coverage": "react-cli coverage",
|
|
40
40
|
"prepare": "npm run init && npm run build && npm run rtl && npm run cssVariableConvert ",
|
|
41
|
-
"prepublishOnly": "node prePublish.js && npm run download && npm run css:review",
|
|
41
|
+
"prepublishOnly": "node prePublish.js && npm run download && npm run css:review && npm run review:props ",
|
|
42
42
|
"postpublish": "node postPublish.js",
|
|
43
43
|
"report": "react-cli publish:report",
|
|
44
44
|
"test": "react-cli test",
|
|
@@ -71,7 +71,7 @@
|
|
|
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.73",
|
|
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.73",
|
|
90
90
|
"@zohodesk/variables": "1.0.0",
|
|
91
91
|
"@zohodesk/svg": "1.1.22",
|
|
92
92
|
"@zohodesk/virtualizer": "1.0.3",
|