intelicoreact 0.3.24 → 0.3.25

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.
@@ -66,7 +66,11 @@ var TagsDropdown = function TagsDropdown(_ref) {
66
66
  _ref$unselectAllButto = _ref.unselectAllButtonRef,
67
67
  unselectAllButtonRef = _ref$unselectAllButto === void 0 ? null : _ref$unselectAllButto,
68
68
  _ref$closeOnSelect = _ref.closeOnSelect,
69
- closeOnSelect = _ref$closeOnSelect === void 0 ? true : _ref$closeOnSelect;
69
+ closeOnSelect = _ref$closeOnSelect === void 0 ? true : _ref$closeOnSelect,
70
+ _ref$closeOnRemove = _ref.closeOnRemove,
71
+ closeOnRemove = _ref$closeOnRemove === void 0 ? false : _ref$closeOnRemove,
72
+ _ref$noOptionsText = _ref.noOptionsText,
73
+ noOptionsText = _ref$noOptionsText === void 0 ? 'No options available' : _ref$noOptionsText;
70
74
 
71
75
  var _useState = (0, _react.useState)(false),
72
76
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
@@ -91,6 +95,7 @@ var TagsDropdown = function TagsDropdown(_ref) {
91
95
  };
92
96
 
93
97
  var deleteChosen = function deleteChosen(value) {
98
+ if (closeOnRemove) setIsOpen(false);
94
99
  onChange(chosenOptions.filter(function (item) {
95
100
  return item !== value;
96
101
  }), 'chosenOptions');
@@ -239,7 +244,7 @@ var TagsDropdown = function TagsDropdown(_ref) {
239
244
  className: "".concat(RC, "__header")
240
245
  }, headerContent) : '', /*#__PURE__*/_react.default.createElement("div", {
241
246
  className: "".concat(RC, "__list ").concat(headerContent ? "".concat(RC, "__list--with-header") : '', " ").concat(footerContent ? "".concat(RC, "__list--with-footer") : '')
242
- }, options === null || options === void 0 ? void 0 : options.map(function (option) {
247
+ }, (options === null || options === void 0 ? void 0 : options.length) > 0 ? options === null || options === void 0 ? void 0 : options.map(function (option) {
243
248
  var _option$list;
244
249
 
245
250
  return option.groupName ? /*#__PURE__*/_react.default.createElement("div", {
@@ -250,7 +255,9 @@ var TagsDropdown = function TagsDropdown(_ref) {
250
255
  }, option.groupName), (_option$list = option.list) === null || _option$list === void 0 ? void 0 : _option$list.map(function (item) {
251
256
  return getMarkupForElement(item);
252
257
  })) : getMarkupForElement(option);
253
- })), footerContent ? /*#__PURE__*/_react.default.createElement("div", {
258
+ }) : /*#__PURE__*/_react.default.createElement("div", {
259
+ className: "".concat(RC, "__no-options")
260
+ }, noOptionsText)), footerContent ? /*#__PURE__*/_react.default.createElement("div", {
254
261
  className: "".concat(RC, "__footer")
255
262
  }, footerContent) : ''));
256
263
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intelicoreact",
3
- "version": "0.3.24",
3
+ "version": "0.3.25",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [