@zohodesk/components 1.0.0-alpha-214 → 1.0.0-alpha-218
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/README.md +21 -1
- package/es/Appearance/dark/mode/darkMode.module.css +3 -5
- package/es/Appearance/dark/themes/blue/blueDarkComponentTheme.module.css +5 -0
- package/es/Appearance/dark/themes/green/greenDarkCTATheme.module.css +1 -1
- package/es/Appearance/dark/themes/green/greenDarkComponentTheme.module.css +5 -0
- package/es/Appearance/dark/themes/orange/orangeDarkComponentTheme.module.css +5 -0
- package/es/Appearance/dark/themes/red/redDarkCTATheme.module.css +1 -1
- package/es/Appearance/dark/themes/red/redDarkComponentTheme.module.css +5 -0
- package/es/Appearance/dark/themes/yellow/yellowDarkComponentTheme.module.css +5 -0
- package/es/Appearance/default/mode/defaultMode.module.css +11 -11
- package/es/Appearance/default/themes/blue/blueDefaultComponentTheme.module.css +5 -0
- package/es/Appearance/default/themes/green/greenDefaultCTATheme.module.css +1 -1
- package/es/Appearance/default/themes/green/greenDefaultComponentTheme.module.css +5 -0
- package/es/Appearance/default/themes/orange/orangeDefaultCTATheme.module.css +1 -1
- package/es/Appearance/default/themes/orange/orangeDefaultComponentTheme.module.css +5 -0
- package/es/Appearance/default/themes/red/redDefaultCTATheme.module.css +1 -1
- package/es/Appearance/default/themes/red/redDefaultComponentTheme.module.css +5 -0
- package/es/Appearance/default/themes/yellow/yellowDefaultComponentTheme.module.css +5 -0
- package/es/ListItem/ListItemWithAvatar.js +11 -3
- package/es/ListItem/ListItemWithIcon.js +12 -4
- package/es/MultiSelect/AdvancedMultiSelect.js +21 -9
- package/es/MultiSelect/MultiSelect.js +1 -1
- package/es/MultiSelect/Suggestions.js +11 -2
- package/es/MultiSelect/docs/AdvancedMultiSelect__default.docs.js +18 -3
- package/es/Select/GroupSelect.js +4 -4
- package/es/Select/Select.js +37 -10
- package/es/Select/docs/Select__default.docs.js +79 -0
- package/es/Tag/Tag.module.css +1 -0
- package/es/TextBox/TextBox.js +7 -4
- package/es/TextBoxIcon/TextBoxIcon.js +13 -4
- package/es/utils/Common.js +1 -1
- package/es/utils/dropDownUtils.js +12 -5
- package/lib/Appearance/dark/mode/darkMode.module.css +3 -5
- package/lib/Appearance/dark/themes/blue/blueDarkComponentTheme.module.css +5 -0
- package/lib/Appearance/dark/themes/green/greenDarkCTATheme.module.css +1 -1
- package/lib/Appearance/dark/themes/green/greenDarkComponentTheme.module.css +5 -0
- package/lib/Appearance/dark/themes/orange/orangeDarkComponentTheme.module.css +5 -0
- package/lib/Appearance/dark/themes/red/redDarkCTATheme.module.css +1 -1
- package/lib/Appearance/dark/themes/red/redDarkComponentTheme.module.css +5 -0
- package/lib/Appearance/dark/themes/yellow/yellowDarkComponentTheme.module.css +5 -0
- package/lib/Appearance/default/mode/defaultMode.module.css +11 -11
- package/lib/Appearance/default/themes/blue/blueDefaultComponentTheme.module.css +5 -0
- package/lib/Appearance/default/themes/green/greenDefaultCTATheme.module.css +1 -1
- package/lib/Appearance/default/themes/green/greenDefaultComponentTheme.module.css +5 -0
- package/lib/Appearance/default/themes/orange/orangeDefaultCTATheme.module.css +1 -1
- package/lib/Appearance/default/themes/orange/orangeDefaultComponentTheme.module.css +5 -0
- package/lib/Appearance/default/themes/red/redDefaultCTATheme.module.css +1 -1
- package/lib/Appearance/default/themes/red/redDefaultComponentTheme.module.css +5 -0
- package/lib/Appearance/default/themes/yellow/yellowDefaultComponentTheme.module.css +5 -0
- package/lib/ListItem/ListItemWithAvatar.js +9 -3
- package/lib/ListItem/ListItemWithIcon.js +11 -4
- package/lib/MultiSelect/AdvancedMultiSelect.js +20 -8
- package/lib/MultiSelect/MultiSelect.js +1 -1
- package/lib/MultiSelect/Suggestions.js +16 -2
- package/lib/MultiSelect/docs/AdvancedMultiSelect__default.docs.js +18 -3
- package/lib/Select/GroupSelect.js +3 -3
- package/lib/Select/Select.js +38 -10
- package/lib/Select/docs/Select__default.docs.js +79 -0
- package/lib/Tag/Tag.module.css +1 -0
- package/lib/TextBox/TextBox.js +6 -4
- package/lib/TextBoxIcon/TextBoxIcon.js +12 -4
- package/lib/utils/Common.js +1 -1
- package/lib/utils/dropDownUtils.js +13 -4
- package/package.json +1 -1
package/lib/Tag/Tag.module.css
CHANGED
package/lib/TextBox/TextBox.js
CHANGED
|
@@ -137,7 +137,8 @@ var Textbox = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
137
137
|
htmlId = _this$props4.htmlId,
|
|
138
138
|
a11y = _this$props4.a11y,
|
|
139
139
|
customClass = _this$props4.customClass,
|
|
140
|
-
isFocus = _this$props4.isFocus
|
|
140
|
+
isFocus = _this$props4.isFocus,
|
|
141
|
+
customProps = _this$props4.customProps;
|
|
141
142
|
var ariaLabel = a11y.ariaLabel,
|
|
142
143
|
ariaAutocomplete = a11y.ariaAutocomplete,
|
|
143
144
|
ariaControls = a11y.ariaControls,
|
|
@@ -204,7 +205,7 @@ var Textbox = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
204
205
|
value: value,
|
|
205
206
|
onKeyPress: onKeyPress,
|
|
206
207
|
onMouseDown: onMouseDown
|
|
207
|
-
}, options));
|
|
208
|
+
}, options, customProps));
|
|
208
209
|
}
|
|
209
210
|
}]);
|
|
210
211
|
|
|
@@ -228,7 +229,8 @@ Textbox.defaultProps = {
|
|
|
228
229
|
autoComplete: true,
|
|
229
230
|
borderColor: 'default',
|
|
230
231
|
a11y: {},
|
|
231
|
-
isFocus: false
|
|
232
|
+
isFocus: false,
|
|
233
|
+
customProps: {}
|
|
232
234
|
};
|
|
233
235
|
Textbox.propTypes = (_Textbox$propTypes = {
|
|
234
236
|
autofocus: _propTypes["default"].bool,
|
|
@@ -275,7 +277,7 @@ Textbox.propTypes = (_Textbox$propTypes = {
|
|
|
275
277
|
ariaActivedescendant: _propTypes["default"].string,
|
|
276
278
|
ariaReadonly: _propTypes["default"].bool,
|
|
277
279
|
ariaMultiselectable: _propTypes["default"].bool
|
|
278
|
-
})), _defineProperty(_Textbox$propTypes, "isFocus", _propTypes["default"].bool), _Textbox$propTypes);
|
|
280
|
+
})), _defineProperty(_Textbox$propTypes, "isFocus", _propTypes["default"].bool), _defineProperty(_Textbox$propTypes, "customProps", _propTypes["default"].object), _Textbox$propTypes);
|
|
279
281
|
|
|
280
282
|
if (false) {
|
|
281
283
|
Textbox.docs = {
|
|
@@ -126,7 +126,8 @@ var TextBoxIcon = /*#__PURE__*/function (_React$Component) {
|
|
|
126
126
|
customClass = _this$props2.customClass,
|
|
127
127
|
iconOnHover = _this$props2.iconOnHover,
|
|
128
128
|
isFocus = _this$props2.isFocus,
|
|
129
|
-
onClearMouseDown = _this$props2.onClearMouseDown
|
|
129
|
+
onClearMouseDown = _this$props2.onClearMouseDown,
|
|
130
|
+
customProps = _this$props2.customProps;
|
|
130
131
|
var isActive = this.state.isActive;
|
|
131
132
|
var _customClass$customTB = customClass.customTBoxWrap,
|
|
132
133
|
customTBoxWrap = _customClass$customTB === void 0 ? '' : _customClass$customTB,
|
|
@@ -138,6 +139,8 @@ var TextBoxIcon = /*#__PURE__*/function (_React$Component) {
|
|
|
138
139
|
customTBoxLine = _customClass$customTB3 === void 0 ? '' : _customClass$customTB3;
|
|
139
140
|
var _i18nKeys$clearText = i18nKeys.clearText,
|
|
140
141
|
clearText = _i18nKeys$clearText === void 0 ? 'Clear' : _i18nKeys$clearText;
|
|
142
|
+
var _customProps$TextBoxP = customProps.TextBoxProps,
|
|
143
|
+
TextBoxProps = _customProps$TextBoxP === void 0 ? {} : _customProps$TextBoxP;
|
|
141
144
|
return /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
142
145
|
alignBox: "row",
|
|
143
146
|
isCover: false,
|
|
@@ -170,7 +173,8 @@ var TextBoxIcon = /*#__PURE__*/function (_React$Component) {
|
|
|
170
173
|
onKeyPress: onKeyPress,
|
|
171
174
|
onMouseDown: onMouseDown,
|
|
172
175
|
needBorder: false,
|
|
173
|
-
customClass: customTextBox
|
|
176
|
+
customClass: customTextBox,
|
|
177
|
+
customProps: TextBoxProps
|
|
174
178
|
}))), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
175
179
|
className: "".concat(_TextBoxIconModule["default"].iconContainer, " ").concat(customTBoxIcon)
|
|
176
180
|
}, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
@@ -218,7 +222,8 @@ TextBoxIcon.defaultProps = {
|
|
|
218
222
|
i18nKeys: {},
|
|
219
223
|
customClass: {},
|
|
220
224
|
iconOnHover: false,
|
|
221
|
-
isFocus: false
|
|
225
|
+
isFocus: false,
|
|
226
|
+
customProps: {}
|
|
222
227
|
};
|
|
223
228
|
TextBoxIcon.propTypes = {
|
|
224
229
|
borderColor: _propTypes["default"].oneOf(['transparent', 'default', 'error']),
|
|
@@ -263,7 +268,10 @@ TextBoxIcon.propTypes = {
|
|
|
263
268
|
}),
|
|
264
269
|
iconOnHover: _propTypes["default"].bool,
|
|
265
270
|
isFocus: _propTypes["default"].bool,
|
|
266
|
-
onClearMouseDown: _propTypes["default"].func
|
|
271
|
+
onClearMouseDown: _propTypes["default"].func,
|
|
272
|
+
customProps: _propTypes["default"].shape({
|
|
273
|
+
TextBoxProps: _propTypes["default"].object
|
|
274
|
+
})
|
|
267
275
|
};
|
|
268
276
|
|
|
269
277
|
if (false) {
|
package/lib/utils/Common.js
CHANGED
|
@@ -453,5 +453,5 @@ function getElementSpace(elementRef) {
|
|
|
453
453
|
|
|
454
454
|
function getSearchString() {
|
|
455
455
|
var charachers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
456
|
-
return charachers.toLowerCase(); //.replace(/\s+/g, '');
|
|
456
|
+
return (charachers || '').toString().toLowerCase(); //.replace(/\s+/g, '');
|
|
457
457
|
}
|
|
@@ -130,6 +130,10 @@ var getDisabledOptions = function getDisabledOptions(props) {
|
|
|
130
130
|
return props.disabledOptions || dummyArray;
|
|
131
131
|
};
|
|
132
132
|
|
|
133
|
+
var getListItemProps = function getListItemProps(props) {
|
|
134
|
+
return props.listItemProps || '';
|
|
135
|
+
};
|
|
136
|
+
|
|
133
137
|
var makeGetMultiSelectFilterSuggestions = function makeGetMultiSelectFilterSuggestions() {
|
|
134
138
|
return (0, _reselect.createSelector)([getOptions, getSelectedOptionsSel, getSearchStr, getNeedSearch, getIsStartWithSearch], function (options, selectedOptions, searchStr, needSearch, isStartsWithSearch) {
|
|
135
139
|
var suggestions = [];
|
|
@@ -138,8 +142,8 @@ var makeGetMultiSelectFilterSuggestions = function makeGetMultiSelectFilterSugge
|
|
|
138
142
|
var id = option.id,
|
|
139
143
|
_option$value = option.value,
|
|
140
144
|
value = _option$value === void 0 ? '' : _option$value;
|
|
141
|
-
var valueString =
|
|
142
|
-
var searchString =
|
|
145
|
+
var valueString = (0, _Common.getSearchString)(value);
|
|
146
|
+
var searchString = (0, _Common.getSearchString)(searchStr);
|
|
143
147
|
var isMatch = needSearch ? isStartsWithSearch ? valueString.startsWith(searchString) : valueString.indexOf(searchString) !== -1 : true;
|
|
144
148
|
|
|
145
149
|
if (selectedOptions.indexOf(id) === -1 && isMatch) {
|
|
@@ -210,7 +214,7 @@ var extractOptionId = function extractOptionId(id) {
|
|
|
210
214
|
exports.extractOptionId = extractOptionId;
|
|
211
215
|
|
|
212
216
|
var makeFormatOptions = function makeFormatOptions() {
|
|
213
|
-
return (0, _reselect.createSelector)([getOptions, getValueField, getTextField, getImageField, getPrefixText, getIconName, getIconSize, getOptionType, getDisabledOptions], function (options, valueField, textField, imageField, prefixText, iconName, iconSize, optionType, disabledOptions) {
|
|
217
|
+
return (0, _reselect.createSelector)([getOptions, getValueField, getTextField, getImageField, getPrefixText, getIconName, getIconSize, getOptionType, getDisabledOptions, getListItemProps], function (options, valueField, textField, imageField, prefixText, iconName, iconSize, optionType, disabledOptions, listItemProps) {
|
|
214
218
|
var revampOptions = [];
|
|
215
219
|
var remvampOptionIds = [];
|
|
216
220
|
var normalizedAllOptions = {};
|
|
@@ -223,7 +227,8 @@ var makeFormatOptions = function makeFormatOptions() {
|
|
|
223
227
|
impImageField = option.imageField,
|
|
224
228
|
impOptionType = option.optionType,
|
|
225
229
|
impIconName = option.iconName,
|
|
226
|
-
impIconSize = option.iconSize
|
|
230
|
+
impIconSize = option.iconSize,
|
|
231
|
+
listStyle = option.listItemProps;
|
|
227
232
|
var id = _typeof(option) === 'object' ? option[impValueField || valueField] : option;
|
|
228
233
|
var value = _typeof(option) === 'object' ? option[impTextField || textField] : option;
|
|
229
234
|
var photoURL = _typeof(option) === 'object' ? option[impImageField || imageField] : ''; // grouping options (group select/MultiSelect)
|
|
@@ -254,6 +259,10 @@ var makeFormatOptions = function makeFormatOptions() {
|
|
|
254
259
|
optionDetails.isDisabled = disabledOptions.indexOf(id) >= 0;
|
|
255
260
|
}
|
|
256
261
|
|
|
262
|
+
if (listStyle || listItemProps) {
|
|
263
|
+
optionDetails.listItemProps = listStyle || listItemProps;
|
|
264
|
+
}
|
|
265
|
+
|
|
257
266
|
normalizedFormatOptions[id] = optionDetails;
|
|
258
267
|
normalizedAllOptions[id] = option;
|
|
259
268
|
revampOptions.push(optionDetails);
|