intelicoreact 1.0.92 → 1.0.94

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.
@@ -2,15 +2,13 @@
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
4
 
5
- var _typeof3 = require("@babel/runtime/helpers/typeof");
5
+ var _typeof = require("@babel/runtime/helpers/typeof");
6
6
 
7
7
  Object.defineProperty(exports, "__esModule", {
8
8
  value: true
9
9
  });
10
10
  exports.default = void 0;
11
11
 
12
- var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
13
-
14
12
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
13
 
16
14
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
@@ -31,7 +29,7 @@ require("./DropdownLiveSearch.scss");
31
29
 
32
30
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
33
31
 
34
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
32
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
35
33
 
36
34
  var RC = 'dropdown-live-search';
37
35
 
@@ -43,7 +41,6 @@ var DropdownLiveSearch = function DropdownLiveSearch(_ref) {
43
41
  placeholder = _ref.placeholder,
44
42
  className = _ref.className,
45
43
  isSearchable = _ref.isSearchable,
46
- scrollReactionObj = _ref.scrollReactionObj,
47
44
  testId = _ref.testId,
48
45
  doRequest = _ref.doRequest,
49
46
  isLoading = _ref.isLoading,
@@ -101,25 +98,27 @@ var DropdownLiveSearch = function DropdownLiveSearch(_ref) {
101
98
  };
102
99
 
103
100
  var highlightedText = function highlightedText(text, postfix) {
104
- var _text;
105
-
106
- var prepare = function prepare(text) {
107
- return text === null || text === void 0 ? void 0 : text.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&');
108
- };
109
-
110
- text = text.replace(/["&<>]/g, function (a) {
111
- return {
112
- '"': '&quot;',
113
- '&': '&amp;',
114
- '<': '&lt;',
115
- '>': '&gt;'
116
- }[a];
117
- });
118
- var main = searchValue ? (_text = text) === null || _text === void 0 ? void 0 : _text.replace(new RegExp(prepare(searchValue), 'i'), function (match) {
119
- return "<span class=\"bg--yellow\">".concat(match, "</span>");
120
- }) : text;
121
- var postfixPart = postfix ? "<span class=\"dropdown__list-item-postfix\">".concat(postfix, "</span>") : '';
122
- return main + postfixPart;
101
+ if (!isSearchable) return text;else {
102
+ var _text;
103
+
104
+ var prepare = function prepare(text) {
105
+ return text === null || text === void 0 ? void 0 : text.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&');
106
+ };
107
+
108
+ text = text.replace(/["&<>]/g, function (a) {
109
+ return {
110
+ '"': '&quot;',
111
+ '&': '&amp;',
112
+ '<': '&lt;',
113
+ '>': '&gt;'
114
+ }[a];
115
+ });
116
+ var main = searchValue ? (_text = text) === null || _text === void 0 ? void 0 : _text.replace(new RegExp(prepare(searchValue), 'i'), function (match) {
117
+ return "<span class=\"bg--yellow\">".concat(match, "</span>");
118
+ }) : text;
119
+ var postfixPart = postfix ? "<span class=\"dropdown__list-item-postfix\">".concat(postfix, "</span>") : '';
120
+ return main + postfixPart;
121
+ }
123
122
  };
124
123
 
125
124
  var getMarkupForElement = function getMarkupForElement(item, index, optTestId) {
@@ -138,7 +137,8 @@ var DropdownLiveSearch = function DropdownLiveSearch(_ref) {
138
137
  className: (0, _classnames.default)("".concat(RC, "__list-item"), (_cn = {}, (0, _defineProperty2.default)(_cn, "".concat(RC, "__list-item_active"), item.value === value), (0, _defineProperty2.default)(_cn, "".concat(RC, "__list-item_disabled"), item.disabled), _cn), item.className)
139
138
  }, /*#__PURE__*/_react.default.createElement("span", {
140
139
  className: (0, _classnames.default)("".concat(RC, "__active-icon"), (0, _defineProperty2.default)({}, "".concat(RC, "__active-icon_active"), lowerLabel === lowerSearchValue))
141
- }, /*#__PURE__*/_react.default.createElement(_reactFeather.Check, null)), /*#__PURE__*/_react.default.createElement("div", {
140
+ }, /*#__PURE__*/_react.default.createElement(_reactFeather.Check, null)), /*#__PURE__*/_react.default.createElement("p", {
141
+ title: item.label,
142
142
  className: item.labelClassName || '',
143
143
  dangerouslySetInnerHTML: {
144
144
  __html: highlightedText(item.label, item.postfix)
@@ -232,12 +232,12 @@ var DropdownLiveSearch = function DropdownLiveSearch(_ref) {
232
232
  (0, _react.useEffect)(function () {
233
233
  if (!isOpen) setIsFocusedByClick(false);
234
234
 
235
- if (scrollReactionObj && (0, _typeof2.default)(scrollReactionObj) === 'object' && isOpen && dropdownListRef && dropdownListRef.current) {
235
+ if (isOpen && dropdownListRef && dropdownListRef.current) {
236
236
  dropdownListRef.current.addEventListener('scroll', doScrollCallback);
237
237
  }
238
238
 
239
239
  return function () {
240
- if (scrollReactionObj && (0, _typeof2.default)(scrollReactionObj) === 'object') removeEventListener('scroll', doScrollCallback);
240
+ removeEventListener('scroll', doScrollCallback);
241
241
  };
242
242
  }, [isOpen, dropdownListRef]);
243
243
  return /*#__PURE__*/_react.default.createElement("div", {
@@ -22,6 +22,7 @@
22
22
  font-weight: 400;
23
23
 
24
24
  .text {
25
+ display: block;
25
26
  overflow: hidden;
26
27
  max-width: calc(100% - 5px);
27
28
  padding: 0 16px 0 8px;
@@ -136,6 +137,12 @@
136
137
  &-postfix {
137
138
  margin-left: 5px;
138
139
  }
140
+
141
+ p {
142
+ text-overflow: ellipsis;
143
+ white-space: nowrap;
144
+ overflow: hidden;
145
+ }
139
146
  }
140
147
 
141
148
  &--with-label {
@@ -179,11 +186,11 @@
179
186
  }
180
187
 
181
188
  &__container {
182
- position: fixed;
189
+ position: absolute;
183
190
  z-index: 99999;
184
191
  display: block;
185
192
  box-sizing: border-box;
186
- top: 43px;
193
+ top: 26px;
187
194
  }
188
195
 
189
196
  &.disabled {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intelicoreact",
3
- "version": "1.0.92",
3
+ "version": "1.0.94",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [