intelicoreact 1.2.46 → 1.2.48

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.
@@ -27,14 +27,20 @@ var _classnames = _interopRequireDefault(require("classnames"));
27
27
 
28
28
  var _reactFeather = require("react-feather");
29
29
 
30
- var _DropdownLoader = _interopRequireDefault(require("./components/DropdownLoader"));
31
-
32
- require("./Dropdown.scss");
33
-
34
30
  var _fieldValueFormatters = require("../../../Functions/fieldValueFormatters");
35
31
 
36
32
  var _utils = require("../../../Functions/utils");
37
33
 
34
+ var _useIsMobile2 = _interopRequireDefault(require("../../../Functions/useIsMobile"));
35
+
36
+ var _Input = _interopRequireDefault(require("../../../Atomic/FormElements/Input/Input"));
37
+
38
+ var _RadioInput = _interopRequireDefault(require("../../../Atomic/FormElements/RadioInput/RadioInput"));
39
+
40
+ var _DropdownLoader = _interopRequireDefault(require("./components/DropdownLoader"));
41
+
42
+ require("./Dropdown.scss");
43
+
38
44
  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); }
39
45
 
40
46
  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; }
@@ -46,9 +52,10 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
46
52
  var RC = 'dropdown';
47
53
 
48
54
  var Dropdown = function Dropdown(_ref) {
49
- var _options$find, _filteredOptions$find;
55
+ var _options$find, _dropdownListRef$curr5, _dropdownListRef$curr6, _filteredOptions$find;
50
56
 
51
- var _ref$options = _ref.options,
57
+ var label = _ref.label,
58
+ _ref$options = _ref.options,
52
59
  options = _ref$options === void 0 ? [] : _ref$options,
53
60
  value = _ref.value,
54
61
  error = _ref.error,
@@ -71,6 +78,10 @@ var Dropdown = function Dropdown(_ref) {
71
78
  noOptionsText = _ref$noOptionsText === void 0 ? 'No options available' : _ref$noOptionsText,
72
79
  _ref$attributesOfNati = _ref.attributesOfNativeInput,
73
80
  attributesOfNativeInput = _ref$attributesOfNati === void 0 ? {} : _ref$attributesOfNati;
81
+
82
+ var _useIsMobile = (0, _useIsMobile2.default)(),
83
+ isMobile = _useIsMobile.isMobile;
84
+
74
85
  var dropdownId = fieldKey || id;
75
86
 
76
87
  var _useState = (0, _react.useState)(false),
@@ -85,6 +96,7 @@ var Dropdown = function Dropdown(_ref) {
85
96
 
86
97
  var dropdownRef = (0, _react.useRef)(null);
87
98
  var dropdownListRef = (0, _react.useRef)(null);
99
+ var dropdownListWrapperRef = (0, _react.useRef)(null);
88
100
  var searchInputRef = (0, _react.useRef)(null);
89
101
 
90
102
  var _useState5 = (0, _react.useState)(null),
@@ -107,6 +119,16 @@ var Dropdown = function Dropdown(_ref) {
107
119
  isSearchInputFocused = _useState12[0],
108
120
  setIsSearchInputFocused = _useState12[1];
109
121
 
122
+ var _useState13 = (0, _react.useState)(null),
123
+ _useState14 = (0, _slicedToArray2.default)(_useState13, 2),
124
+ isScrollableList = _useState14[0],
125
+ setIsScrollableList = _useState14[1];
126
+
127
+ var _useState15 = (0, _react.useState)(false),
128
+ _useState16 = (0, _slicedToArray2.default)(_useState15, 2),
129
+ isFixedMaxHeight = _useState16[0],
130
+ setIsFixedMaxHeight = _useState16[1];
131
+
110
132
  if (!options) return null;
111
133
 
112
134
  var moveOtherToEnd = function moveOtherToEnd(options) {
@@ -200,7 +222,7 @@ var Dropdown = function Dropdown(_ref) {
200
222
  setSearchValue(inputValue);
201
223
  };
202
224
 
203
- var hightlightedText = function hightlightedText(text, postfix) {
225
+ var hightlightedText = function hightlightedText(text, postfix, description) {
204
226
  var _text;
205
227
 
206
228
  var prepare = function prepare(text) {
@@ -219,7 +241,8 @@ var Dropdown = function Dropdown(_ref) {
219
241
  return "<span class=\"bg--yellow\">".concat(match, "</span>");
220
242
  }) : text;
221
243
  var postfixPart = postfix ? "<span class=\"dropdown__list-item-postfix\">".concat(postfix, "</span>") : '';
222
- return main + postfixPart;
244
+ var descriptionPart = description ? "<span class=\"dropdown__list-item-description\">".concat(description, "</span>") : '';
245
+ return main + postfixPart + descriptionPart;
223
246
  };
224
247
 
225
248
  var depend = getDepends(modalBtnTrigger);
@@ -234,13 +257,16 @@ var Dropdown = function Dropdown(_ref) {
234
257
  return depend.onChange(item);
235
258
  },
236
259
  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)
237
- }, /*#__PURE__*/_react.default.createElement("span", {
260
+ }, !isMobile && /*#__PURE__*/_react.default.createElement("span", {
238
261
  className: (0, _classnames.default)("".concat(RC, "__active-icon"), (0, _defineProperty2.default)({}, "".concat(RC, "__active-icon_active"), item.value === value))
239
262
  }, /*#__PURE__*/_react.default.createElement(_reactFeather.Check, null)), /*#__PURE__*/_react.default.createElement("div", {
240
- className: item.labelClassName || '',
263
+ className: (0, _classnames.default)("".concat(RC, "__list-item-label"), item.labelClassName || ''),
241
264
  dangerouslySetInnerHTML: {
242
- __html: hightlightedText(item.label, item.postfix)
265
+ __html: hightlightedText(item.label, item.postfix, item.description)
243
266
  }
267
+ }), isMobile && /*#__PURE__*/_react.default.createElement(_RadioInput.default, {
268
+ value: item.value,
269
+ checked: value
244
270
  }));
245
271
  };
246
272
 
@@ -296,7 +322,7 @@ var Dropdown = function Dropdown(_ref) {
296
322
  };
297
323
 
298
324
  var setListContainerStyles = function setListContainerStyles() {
299
- var _dropdownRef$current$, _getComputedStyle$mar, _getComputedStyle, _getComputedStyle$mar2, _getComputedStyle$max, _getComputedStyle2, _getComputedStyle2$ma, _sw$getBoundingClient;
325
+ var _dropdownRef$current$, _dropdownListWrapperR, _getComputedStyle$mar, _getComputedStyle, _getComputedStyle$mar2, _getComputedStyle$max, _getComputedStyle2, _getComputedStyle2$ma, _sw$getBoundingClient, _dropdownListWrapperR2, _dropdownListWrapperR3, _lh$getBoundingClient;
300
326
 
301
327
  var lc = getListContainer();
302
328
  if (!lc || !isOpen) return false;
@@ -309,13 +335,14 @@ var Dropdown = function Dropdown(_ref) {
309
335
  top = _ref3.top;
310
336
 
311
337
  var sw = lc.getElementsByClassName('dropdown__list')[0];
338
+ var lh = dropdownListWrapperRef === null || dropdownListWrapperRef === void 0 ? void 0 : (_dropdownListWrapperR = dropdownListWrapperRef.current) === null || _dropdownListWrapperR === void 0 ? void 0 : _dropdownListWrapperR.getElementsByClassName('dropdown__list-header')[0];
312
339
  var margin = parseInt((_getComputedStyle$mar = (_getComputedStyle = getComputedStyle(sw)) === null || _getComputedStyle === void 0 ? void 0 : (_getComputedStyle$mar2 = _getComputedStyle.marginTop) === null || _getComputedStyle$mar2 === void 0 ? void 0 : _getComputedStyle$mar2.replace('px', '')) !== null && _getComputedStyle$mar !== void 0 ? _getComputedStyle$mar : 0);
313
340
  var maxHeight = initListHeight !== null && initListHeight !== void 0 ? initListHeight : parseInt((_getComputedStyle$max = (_getComputedStyle2 = getComputedStyle(sw)) === null || _getComputedStyle2 === void 0 ? void 0 : (_getComputedStyle2$ma = _getComputedStyle2.maxHeight) === null || _getComputedStyle2$ma === void 0 ? void 0 : _getComputedStyle2$ma.replace('px', '')) !== null && _getComputedStyle$max !== void 0 ? _getComputedStyle$max : 0);
314
341
  if (initListHeight === null) setInitListHeight(maxHeight);
315
342
  var toTop = top - margin;
316
343
  var toBottom = windowHeight - top - height - margin * 2;
317
344
  var swHeight = sw === null || sw === void 0 ? void 0 : (_sw$getBoundingClient = sw.getBoundingClientRect()) === null || _sw$getBoundingClient === void 0 ? void 0 : _sw$getBoundingClient.height;
318
- var maxSwHeight = toTop >= maxHeight || toBottom >= maxHeight ? maxHeight - 3 * margin : toTop > toBottom ? toTop - 3 * margin : toBottom - 4 * margin;
345
+ var maxSwHeight = isMobile ? (dropdownListWrapperRef === null || dropdownListWrapperRef === void 0 ? void 0 : (_dropdownListWrapperR2 = dropdownListWrapperRef.current) === null || _dropdownListWrapperR2 === void 0 ? void 0 : (_dropdownListWrapperR3 = _dropdownListWrapperR2.getBoundingClientRect()) === null || _dropdownListWrapperR3 === void 0 ? void 0 : _dropdownListWrapperR3.height) - (lh === null || lh === void 0 ? void 0 : (_lh$getBoundingClient = lh.getBoundingClientRect()) === null || _lh$getBoundingClient === void 0 ? void 0 : _lh$getBoundingClient.height) : toTop >= maxHeight || toBottom >= maxHeight ? maxHeight - 3 * margin : toTop > toBottom ? toTop - 3 * margin : toBottom - 4 * margin;
319
346
  var listPos = toTop < toBottom || toBottom >= swHeight ? 'bottom' : 'top';
320
347
  lc.style.minWidth = "".concat(width, "px");
321
348
  lc.style.left = "".concat(left, "px");
@@ -360,6 +387,42 @@ var Dropdown = function Dropdown(_ref) {
360
387
  var _getSortedOptions;
361
388
 
362
389
  return /*#__PURE__*/_react.default.createElement("div", {
390
+ className: (0, _classnames.default)("".concat(RC, "__list-wrapper"), (0, _defineProperty2.default)({}, "".concat(RC, "__list-wrapper--fixed-height"), isFixedMaxHeight)),
391
+ ref: dropdownListWrapperRef
392
+ }, /*#__PURE__*/_react.default.createElement("div", {
393
+ className: (0, _classnames.default)("".concat(RC, "__list-header"), (0, _defineProperty2.default)({}, "".concat(RC, "__list-header-with-shadow"), isScrollableList))
394
+ }, /*#__PURE__*/_react.default.createElement("div", {
395
+ className: (0, _classnames.default)("".concat(RC, "__list-header-row"))
396
+ }, /*#__PURE__*/_react.default.createElement("div", {
397
+ className: (0, _classnames.default)("".concat(RC, "__list-label"))
398
+ }, label), /*#__PURE__*/_react.default.createElement("div", {
399
+ className: (0, _classnames.default)("".concat(RC, "__list-close-icon")),
400
+ onClick: function onClick() {
401
+ return setIsOpen(false);
402
+ }
403
+ }, /*#__PURE__*/_react.default.createElement(_reactFeather.X, null))), isSearchable && /*#__PURE__*/_react.default.createElement("div", {
404
+ className: (0, _classnames.default)("".concat(RC, "__list-header-row"))
405
+ }, /*#__PURE__*/_react.default.createElement(_Input.default, {
406
+ ref: searchInputRef,
407
+ className: "".concat(RC, "__input"),
408
+ value: searchValue !== null && searchValue !== void 0 ? searchValue : selectedLabel,
409
+ onChange: function onChange(v) {
410
+ return onSearchHandler(v);
411
+ },
412
+ placeholder: placeholder || 'Search',
413
+ onFocus: function onFocus() {
414
+ return setIsSearchInputFocused(true);
415
+ },
416
+ onBlur: function onBlur() {
417
+ return setIsSearchInputFocused(false);
418
+ },
419
+ onMouseDown: function onMouseDown() {
420
+ if (!isOpen) {
421
+ setIsSearchInputFocused(true);
422
+ setIsOpen(true);
423
+ }
424
+ }
425
+ }))), /*#__PURE__*/_react.default.createElement("div", {
363
426
  className: (0, _classnames.default)("".concat(RC, "__list"), (0, _defineProperty2.default)({}, "".concat(RC, "__list-top"), isListTop)),
364
427
  ref: dropdownListRef
365
428
  }, (_getSortedOptions = getSortedOptions(depend.options)) === null || _getSortedOptions === void 0 ? void 0 : _getSortedOptions.map(function (option) {
@@ -390,7 +453,7 @@ var Dropdown = function Dropdown(_ref) {
390
453
  }
391
454
  }), !filteredItems.length && !filteredGroups.length && /*#__PURE__*/_react.default.createElement("div", {
392
455
  className: "".concat(RC, "__list-item ").concat(RC, "__list-item--no-options")
393
- }, noOptionsText), disabled && isOpen && /*#__PURE__*/_react.default.createElement(_DropdownLoader.default, null));
456
+ }, noOptionsText), disabled && isOpen && /*#__PURE__*/_react.default.createElement(_DropdownLoader.default, null)));
394
457
  };
395
458
 
396
459
  var toggleList = function toggleList(e) {
@@ -405,15 +468,29 @@ var Dropdown = function Dropdown(_ref) {
405
468
  initListContainer();
406
469
  }, []);
407
470
  (0, _react.useLayoutEffect)(function () {
408
- window.addEventListener('resize', setListContainerStyles);
409
- window.addEventListener('mousewheel', closeList);
410
- window.addEventListener('scroll', closeList);
411
- window.addEventListener('touchmove', closeList);
471
+ var _getListContainer2;
472
+
473
+ if (!isMobile) {
474
+ window.addEventListener('resize', setListContainerStyles);
475
+ window.addEventListener('mousewheel', closeList);
476
+ window.addEventListener('scroll', closeList);
477
+ window.addEventListener('touchmove', closeList);
478
+ } else {
479
+ window.removeEventListener('resize', setListContainerStyles);
480
+ window.removeEventListener('mousewheel', closeList);
481
+ window.removeEventListener('scroll', closeList);
482
+ window.removeEventListener('touchmove', closeList);
483
+ }
484
+
485
+ (_getListContainer2 = getListContainer()) === null || _getListContainer2 === void 0 ? void 0 : _getListContainer2.addEventListener('click', closeList);
412
486
  return function () {
487
+ var _getListContainer3;
488
+
413
489
  window.removeEventListener('resize', setListContainerStyles);
414
490
  window.removeEventListener('mousewheel', closeList);
415
491
  window.removeEventListener('scroll', closeList);
416
492
  window.removeEventListener('touchmove', closeList);
493
+ (_getListContainer3 = getListContainer()) === null || _getListContainer3 === void 0 ? void 0 : _getListContainer3.removeEventListener('click', closeList);
417
494
  };
418
495
  }, [getListContainer]);
419
496
  (0, _react.useEffect)(function () {
@@ -466,7 +543,34 @@ var Dropdown = function Dropdown(_ref) {
466
543
  var _searchInputRef$curre;
467
544
 
468
545
  if (isOpen && !isSearchInputFocused && searchInputRef !== null && searchInputRef !== void 0 && searchInputRef.current) searchInputRef === null || searchInputRef === void 0 ? void 0 : (_searchInputRef$curre = searchInputRef.current) === null || _searchInputRef$curre === void 0 ? void 0 : _searchInputRef$curre.focus();
546
+
547
+ if (isOpen) {
548
+ var _getListContainer4;
549
+
550
+ (_getListContainer4 = getListContainer()) === null || _getListContainer4 === void 0 ? void 0 : _getListContainer4.classList.add('dropdown__container--opened');
551
+ } else {
552
+ var _getListContainer5;
553
+
554
+ (_getListContainer5 = getListContainer()) === null || _getListContainer5 === void 0 ? void 0 : _getListContainer5.classList.remove('dropdown__container--opened');
555
+ }
556
+
557
+ if (!isOpen && isMobile) {
558
+ setSearchValue(null);
559
+ }
469
560
  }, [isOpen]);
561
+ (0, _react.useEffect)(function () {
562
+ if (isOpen && isMobile) {
563
+ var _dropdownListRef$curr, _dropdownListRef$curr2;
564
+
565
+ setIsScrollableList((dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr = dropdownListRef.current) === null || _dropdownListRef$curr === void 0 ? void 0 : _dropdownListRef$curr.scrollHeight) > (dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr2 = dropdownListRef.current) === null || _dropdownListRef$curr2 === void 0 ? void 0 : _dropdownListRef$curr2.clientHeight));
566
+
567
+ if (isScrollableList === null) {
568
+ var _dropdownListRef$curr3, _dropdownListRef$curr4;
569
+
570
+ setIsFixedMaxHeight((dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr3 = dropdownListRef.current) === null || _dropdownListRef$curr3 === void 0 ? void 0 : _dropdownListRef$curr3.scrollHeight) > (dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr4 = dropdownListRef.current) === null || _dropdownListRef$curr4 === void 0 ? void 0 : _dropdownListRef$curr4.clientHeight));
571
+ }
572
+ }
573
+ }, [isOpen, isMobile, dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr5 = dropdownListRef.current) === null || _dropdownListRef$curr5 === void 0 ? void 0 : _dropdownListRef$curr5.scrollHeight, dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr6 = dropdownListRef.current) === null || _dropdownListRef$curr6 === void 0 ? void 0 : _dropdownListRef$curr6.clientHeight]);
470
574
  var postfixText = selectedLabel && ((_filteredOptions$find = filteredOptions.find(function (option) {
471
575
  return option.value === value;
472
576
  })) === null || _filteredOptions$find === void 0 ? void 0 : _filteredOptions$find.postfix) || null;
@@ -483,7 +587,7 @@ var Dropdown = function Dropdown(_ref) {
483
587
  onClick: toggleList,
484
588
  onKeyDown: onKeyDown,
485
589
  onKeyUp: onKeyUp
486
- }, isSearchable ? /*#__PURE__*/_react.default.createElement("input", (0, _extends2.default)({
590
+ }, isSearchable && !isMobile ? /*#__PURE__*/_react.default.createElement("input", (0, _extends2.default)({
487
591
  ref: searchInputRef,
488
592
  className: "".concat(RC, "__input"),
489
593
  value: isOpen ? searchValue !== null && searchValue !== void 0 ? searchValue : '' : selectedLabel || '',
@@ -510,7 +614,41 @@ var Dropdown = function Dropdown(_ref) {
510
614
  }, postfixText)), /*#__PURE__*/_react.default.createElement("span", {
511
615
  className: (0, _classnames.default)("".concat(RC, "__arrow"), (0, _defineProperty2.default)({}, "".concat(RC, "__arrow_active"), isOpen)),
512
616
  onClick: toggleList
513
- }, isOpen ? /*#__PURE__*/_react.default.createElement(_reactFeather.ChevronUp, null) : /*#__PURE__*/_react.default.createElement(_reactFeather.ChevronDown, null))), isOpen && renderListContainer());
617
+ }, isMobile ? /*#__PURE__*/_react.default.createElement("svg", {
618
+ width: "16",
619
+ height: "16",
620
+ viewBox: "0 0 16 16",
621
+ fill: "none",
622
+ xmlns: "http://www.w3.org/2000/svg"
623
+ }, /*#__PURE__*/_react.default.createElement("mask", {
624
+ id: "mask0_38955_3473",
625
+ style: {
626
+ maskType: 'alpha'
627
+ },
628
+ maskUnits: "userSpaceOnUse",
629
+ x: "0",
630
+ y: "0",
631
+ width: "16",
632
+ height: "16"
633
+ }, /*#__PURE__*/_react.default.createElement("path", {
634
+ d: "M5 10L8 13L11 10",
635
+ stroke: "#171D33",
636
+ strokeWidth: "1.00032",
637
+ strokeLinecap: "round",
638
+ strokeLinejoin: "round"
639
+ }), /*#__PURE__*/_react.default.createElement("path", {
640
+ d: "M5 6L8 3L11 6",
641
+ stroke: "#171D33",
642
+ strokeWidth: "1.00032",
643
+ strokeLinecap: "round",
644
+ strokeLinejoin: "round"
645
+ })), /*#__PURE__*/_react.default.createElement("g", {
646
+ mask: "url(#mask0_38955_3473)"
647
+ }, /*#__PURE__*/_react.default.createElement("rect", {
648
+ width: "16",
649
+ height: "16",
650
+ fill: "#171D33"
651
+ }))) : isOpen ? /*#__PURE__*/_react.default.createElement(_reactFeather.ChevronUp, null) : /*#__PURE__*/_react.default.createElement(_reactFeather.ChevronDown, null))), isOpen && renderListContainer());
514
652
  };
515
653
 
516
654
  var _default = Dropdown;
@@ -8,7 +8,7 @@
8
8
 
9
9
  width: 100%;
10
10
 
11
- border-radius: 7px;
11
+ border-radius: $radii-s;
12
12
 
13
13
  &__container {
14
14
  position: fixed;
@@ -32,9 +32,9 @@
32
32
  cursor: pointer;
33
33
  text-align: left;
34
34
 
35
- border: 1px solid #E2E5EC;
36
- border-radius: 3px;
37
- background: #FFF;
35
+ border: 1px solid $color--gray--light;
36
+ border-radius: $radii-xs;
37
+ background: $color--light;
38
38
 
39
39
  font-weight: 400;
40
40
 
@@ -42,7 +42,7 @@
42
42
  overflow: hidden;
43
43
 
44
44
  max-width: calc(100% - 5px);
45
- padding: 0 16px 0 8px;
45
+ padding: 0 $spacing-m 0 $spacing-s;
46
46
 
47
47
  white-space: nowrap;
48
48
  text-overflow: ellipsis;
@@ -60,7 +60,7 @@
60
60
  &__input {
61
61
  width: 100%;
62
62
  height: 16px;
63
- padding: 0 16px 0 8px;
63
+ padding: 0 $spacing-m 0 $spacing-s;
64
64
 
65
65
  text-overflow: ellipsis;
66
66
 
@@ -80,12 +80,24 @@
80
80
  box-sizing: border-box;
81
81
  min-width: 100%;
82
82
  max-height: 320px;
83
- margin-top: 4px;
84
- padding: 5px 0;
83
+ padding: $spacing-xs 0;
85
84
 
86
- border: 1px solid #E2E5EC;
87
- background: #FFF;
88
- box-shadow: 0 5px 20px rgb(0 0 0 / 15%);
85
+ &-wrapper {
86
+ position: relative;
87
+ z-index: 6;
88
+ top: 100%;
89
+
90
+ box-sizing: border-box;
91
+ margin-top: $spacing-xs;
92
+
93
+ border: 1px solid $color--gray--light;
94
+ background: $color--light;
95
+ box-shadow: 0 5px 20px rgb(0 0 0 / 15%);
96
+ }
97
+
98
+ &-header {
99
+ display: none;
100
+ }
89
101
 
90
102
  &::-webkit-scrollbar {
91
103
  width: 4px;
@@ -129,6 +141,16 @@
129
141
  font-weight: 400;
130
142
  line-height: 24px;
131
143
 
144
+ &-label {
145
+ white-space: wrap;
146
+ text-align: left;
147
+ }
148
+
149
+ &-description {
150
+ margin-left: $spacing-xs;
151
+ color: #757F8C;
152
+ }
153
+
132
154
  &--modal {
133
155
  position: relative;
134
156
 
@@ -172,7 +194,7 @@
172
194
  }
173
195
 
174
196
  &-postfix {
175
- margin-left: 5px;
197
+ margin-left: $spacing-xs;
176
198
  }
177
199
  }
178
200
 
@@ -184,7 +206,7 @@
184
206
  &__arrow {
185
207
  position: absolute;
186
208
  top: 50%;
187
- right: 4px;
209
+ right: $spacing-xs;
188
210
 
189
211
  display: flex;
190
212
  align-items: center;
@@ -237,7 +259,7 @@
237
259
  }
238
260
 
239
261
  &-label {
240
- margin-bottom: 5px;
262
+ margin-bottom: $spacing-xs;
241
263
  }
242
264
 
243
265
  &__error {
@@ -258,3 +280,124 @@
258
280
  opacity: 0.5;
259
281
  }
260
282
  }
283
+
284
+ @media (max-width: 767px) {
285
+ .dropdown {
286
+ &__container {
287
+ overflow: hidden!important;
288
+
289
+ &--opened {
290
+ width: 100dvw;
291
+ height: 100dvh;
292
+ max-height: 100dvh;
293
+ position: fixed;
294
+ left: 0!important;
295
+ top: 0!important;
296
+ background: rgba(23, 29, 51, 0.50);
297
+ padding: $spacing-s;
298
+ }
299
+ }
300
+
301
+ &__container &__list {
302
+ top: 0;
303
+ padding: 0 $spacing-m!important;
304
+
305
+ &-wrapper {
306
+ box-sizing: border-box;
307
+ position: sticky;
308
+ bottom: 0;
309
+ max-height: 500px;
310
+ border-radius: $spacing-l!important;
311
+ overflow: hidden;
312
+
313
+ &--fixed-height {
314
+ height: 500px!important;
315
+ }
316
+ }
317
+
318
+ &-header {
319
+ position: relative;
320
+ display: flex;
321
+ flex-direction: column;
322
+ justify-content: space-between;
323
+ padding: $spacing-m;
324
+ color: #3B414B;
325
+ font-size: 16px;
326
+ font-weight: 600;
327
+ line-height: 24px;
328
+ letter-spacing: 0.1px;
329
+ gap: $spacing-m;
330
+
331
+ &-row {
332
+ display: flex;
333
+ flex-direction: row;
334
+ align-items: center;
335
+ min-height: 24px;
336
+
337
+ .input__wrap {
338
+ width: 100%;
339
+ }
340
+ }
341
+
342
+ &-with-shadow {
343
+ &::after {
344
+ content: "";
345
+ position: absolute;
346
+ left: 0;
347
+ bottom: -15px;
348
+ width: 100%;
349
+ height: 15px;
350
+ background: linear-gradient(180deg, rgba(212, 218, 230, 0.50) 0%, rgba(212, 218, 230, 0.30) 21.35%, rgba(247, 248, 250, 0.00) 100%);
351
+ }
352
+ }
353
+ }
354
+
355
+ &-close-icon {
356
+ display: flex;
357
+ align-items: center;
358
+ position: absolute;
359
+ top: 0;
360
+ right: 0;
361
+ height: 100%;
362
+ padding: $spacing-m;
363
+ width: 16px;
364
+ height: 24px;
365
+
366
+ svg {
367
+ width: 16px;
368
+ height: 16px;
369
+ color: #A0A4B0;
370
+ }
371
+ }
372
+ }
373
+
374
+ &-group {
375
+ margin: 0;
376
+
377
+ &:last-child {
378
+ margin-bottom: $spacing-m;
379
+ }
380
+
381
+ &__name {
382
+ margin: 0;
383
+ margin-bottom: $spacing-s;
384
+ font-size: 11px;
385
+ padding: 10px 0px 6px 0px;
386
+ border-bottom: 1px solid var(--black-gray-light-divider, rgba(58, 72, 122, 0.15));
387
+ }
388
+ }
389
+
390
+ &__list-item {
391
+ display: flex;
392
+ justify-content: space-between;
393
+ height: auto!important;
394
+ padding: 10px $spacing-s!important;
395
+ line-height: 24px;
396
+
397
+ &_active {
398
+ border-radius: 6px;
399
+ background: var(--bg-gray-box, #F0F1F4)!important;
400
+ }
401
+ }
402
+ }
403
+ }
@@ -9,6 +9,8 @@ Object.defineProperty(exports, "__esModule", {
9
9
  });
10
10
  exports.default = void 0;
11
11
 
12
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
+
12
14
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
13
15
 
14
16
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
@@ -21,6 +23,8 @@ var _classnames = _interopRequireDefault(require("classnames"));
21
23
 
22
24
  var _dependencies = require("../dependencies");
23
25
 
26
+ var _mobileKeyboardTypesPresets = require("../../../../Functions/presets/mobileKeyboardTypesPresets");
27
+
24
28
  var _Dropdown = _interopRequireDefault(require("../../Dropdown/Dropdown"));
25
29
 
26
30
  var _Input = _interopRequireDefault(require("../../Input/Input"));
@@ -404,7 +408,7 @@ var Datepicker = function Datepicker(props) {
404
408
  className: "date-picker__header"
405
409
  }, /*#__PURE__*/_react.default.createElement("div", {
406
410
  className: "date-picker__inputs-block"
407
- }, /*#__PURE__*/_react.default.createElement(_Input.default, {
411
+ }, /*#__PURE__*/_react.default.createElement(_Input.default, (0, _extends2.default)({
408
412
  dataTest: "datepicker_start-date-input",
409
413
  className: (0, _classnames.default)({
410
414
  'date-picker__date-input_active': hoverStatus === 'start'
@@ -419,10 +423,8 @@ var Datepicker = function Datepicker(props) {
419
423
  onKeyUp: function onKeyUp(code, e) {
420
424
  return handleKeyPressed(code, e, 'start');
421
425
  },
422
- "data-testid": "datePicker--input-".concat(testId, "--startDate") //ref={startDateInputRef}
423
- // mask={moment(startDate).format('L').replace(/[0-9]/g, '9')}
424
-
425
- }), /*#__PURE__*/_react.default.createElement(_Dropdown.default, {
426
+ "data-testid": "datePicker--input-".concat(testId, "--startDate")
427
+ }, _mobileKeyboardTypesPresets.NUMERIC_KEYBOARD)), /*#__PURE__*/_react.default.createElement(_Dropdown.default, {
426
428
  testId: testId,
427
429
  dataTest: "datepicker_start-hour-select-input",
428
430
  className: (0, _classnames.default)('date-picker__hour-select-input'),
@@ -435,7 +437,7 @@ var Datepicker = function Datepicker(props) {
435
437
  short: true
436
438
  }), /*#__PURE__*/_react.default.createElement("div", {
437
439
  className: "date-picker__inputs-separator date-picker__header--gray"
438
- }, "\u2014"), /*#__PURE__*/_react.default.createElement(_Input.default, {
440
+ }, "\u2014"), /*#__PURE__*/_react.default.createElement(_Input.default, (0, _extends2.default)({
439
441
  dataTest: "datepicker_end-date-input",
440
442
  className: (0, _classnames.default)({
441
443
  'date-picker__date-input_active': hoverStatus === 'end'
@@ -450,9 +452,8 @@ var Datepicker = function Datepicker(props) {
450
452
  onKeyUp: function onKeyUp(code, e) {
451
453
  return handleKeyPressed(code, e, 'end');
452
454
  },
453
- "data-testid": "datePicker--input-".concat(testId, "--endDate") //ref={endDateInputRef}
454
-
455
- }), /*#__PURE__*/_react.default.createElement(_Dropdown.default, {
455
+ "data-testid": "datePicker--input-".concat(testId, "--endDate")
456
+ }, _mobileKeyboardTypesPresets.NUMERIC_KEYBOARD)), /*#__PURE__*/_react.default.createElement(_Dropdown.default, {
456
457
  testId: testId,
457
458
  dataTest: "datepicker_end-hour-select-input",
458
459
  className: (0, _classnames.default)('date-picker__hour-select-input'),
@@ -48,8 +48,6 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
48
48
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
49
49
 
50
50
  function InputMask3() {
51
- var _getClearInnerValueAs;
52
-
53
51
  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
54
52
  _ref$autocomplete = _ref.autocomplete,
55
53
  autocomplete = _ref$autocomplete === void 0 ? 'off' : _ref$autocomplete,
@@ -337,6 +335,8 @@ function InputMask3() {
337
335
  };
338
336
 
339
337
  var getInputValue = function getInputValue() {
338
+ var _getClearInnerValueAs;
339
+
340
340
  var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
341
341
  noLastTyppedCharIndexCheck = _ref4.noLastTyppedCharIndexCheck,
342
342
  _ref4$noHide = _ref4.noHide,
@@ -364,11 +364,12 @@ function InputMask3() {
364
364
 
365
365
  return result;
366
366
  }, '');
367
+ if (((_getClearInnerValueAs = getClearInnerValueAsString(value)) === null || _getClearInnerValueAs === void 0 ? void 0 : _getClearInnerValueAs.length) === 0) return '';
367
368
  return value;
368
369
  };
369
370
 
370
- var getClearInnerValueAsString = function getClearInnerValueAsString() {
371
- var _getInputValue, _getInputValue$split;
371
+ var getClearInnerValueAsString = function getClearInnerValueAsString(valueProp) {
372
+ var _ref8, _ref8$split;
372
373
 
373
374
  var symbolsInfo = innerValue === null || innerValue === void 0 ? void 0 : innerValue.map(function (_ref7) {
374
375
  var isSpecialSymbol = _ref7.isSpecialSymbol,
@@ -378,26 +379,24 @@ function InputMask3() {
378
379
  isCharSymbol: isCharSymbol
379
380
  };
380
381
  });
381
- var clearValue = (_getInputValue = getInputValue({
382
+ var clearValue = (_ref8 = valueProp !== null && valueProp !== void 0 ? valueProp : getInputValue({
382
383
  noLastTyppedCharIndexCheck: true,
383
384
  noHide: true
384
- })) === null || _getInputValue === void 0 ? void 0 : (_getInputValue$split = _getInputValue.split('')) === null || _getInputValue$split === void 0 ? void 0 : _getInputValue$split.reduce(function (resultStr, symbol, i) {
385
+ })) === null || _ref8 === void 0 ? void 0 : (_ref8$split = _ref8.split('')) === null || _ref8$split === void 0 ? void 0 : _ref8$split.reduce(function (resultStr, symbol, i) {
385
386
  if (!symbolsInfo[i].isSpecialSymbol || symbolsInfo[i].isCharSymbol) resultStr += symbol;
386
387
  return resultStr;
387
388
  }, '');
388
389
  return clearValue;
389
390
  };
390
391
 
391
- var inputValue = (0, _react.useMemo)(((_getClearInnerValueAs = getClearInnerValueAsString()) === null || _getClearInnerValueAs === void 0 ? void 0 : _getClearInnerValueAs.length) !== 0 ? getInputValue : function () {
392
- return '';
393
- }, [innerValue, isValueHidden]); // GETTERS | END //
392
+ var inputValue = (0, _react.useMemo)(getInputValue, [innerValue, isValueHidden]); // GETTERS | END //
394
393
  // CHECKERS | START //
395
394
 
396
- var isValidChar = function isValidChar(_ref8) {
397
- var key = _ref8.char,
398
- i = _ref8.i,
399
- _ref8$disableErrors = _ref8.disableErrors,
400
- disableErrors = _ref8$disableErrors === void 0 ? false : _ref8$disableErrors;
395
+ var isValidChar = function isValidChar(_ref9) {
396
+ var key = _ref9.char,
397
+ i = _ref9.i,
398
+ _ref9$disableErrors = _ref9.disableErrors,
399
+ disableErrors = _ref9$disableErrors === void 0 ? false : _ref9$disableErrors;
401
400
  var maskChar = getMaskCharByIndex(i);
402
401
 
403
402
  switch (maskChar) {
@@ -449,13 +448,13 @@ function InputMask3() {
449
448
  return true;
450
449
  };
451
450
 
452
- var isSpecialSymbolMaskChar = function isSpecialSymbolMaskChar(_ref9) {
453
- var char = _ref9.char;
451
+ var isSpecialSymbolMaskChar = function isSpecialSymbolMaskChar(_ref10) {
452
+ var char = _ref10.char;
454
453
  return !(0, _functions.isDigitMaskChar)(char) && !(0, _functions.isLetterMaskChar)(char);
455
454
  };
456
455
 
457
- var isSpecialSymbolChar = function isSpecialSymbolChar(_ref10) {
458
- var char = _ref10.char;
456
+ var isSpecialSymbolChar = function isSpecialSymbolChar(_ref11) {
457
+ var char = _ref11.char;
459
458
  return !(0, _functions.isDigit)(char) && !(0, _functions.isLetter)(char);
460
459
  };
461
460
 
@@ -627,13 +626,13 @@ function InputMask3() {
627
626
  };
628
627
 
629
628
  var onSelect = function onSelect(e) {
630
- var _e$target2, _ref12;
629
+ var _e$target2, _ref13;
631
630
 
632
- var _ref11 = (_e$target2 = e.target) !== null && _e$target2 !== void 0 ? _e$target2 : {},
633
- selectionStart = _ref11.selectionStart,
634
- selectionEnd = _ref11.selectionEnd;
631
+ var _ref12 = (_e$target2 = e.target) !== null && _e$target2 !== void 0 ? _e$target2 : {},
632
+ selectionStart = _ref12.selectionStart,
633
+ selectionEnd = _ref12.selectionEnd;
635
634
 
636
- setSelectedLength((_ref12 = selectionEnd - selectionStart) !== null && _ref12 !== void 0 ? _ref12 : 0);
635
+ setSelectedLength((_ref13 = selectionEnd - selectionStart) !== null && _ref13 !== void 0 ? _ref13 : 0);
637
636
  if (selectionStart >= maxEditableIndex) setCaret(maxEditableIndex);
638
637
  }; // GENERAL EVENT HANDLERS | END //
639
638
  /// --- OBSERVERS ---///
@@ -9,6 +9,8 @@ Object.defineProperty(exports, "__esModule", {
9
9
  });
10
10
  exports.default = RangeSlider;
11
11
 
12
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
+
12
14
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
13
15
 
14
16
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
@@ -19,6 +21,8 @@ var _reactFeather = require("react-feather");
19
21
 
20
22
  var _classnames = _interopRequireDefault(require("classnames"));
21
23
 
24
+ var _mobileKeyboardTypesPresets = require("../../../Functions/presets/mobileKeyboardTypesPresets");
25
+
22
26
  var _fieldValueFormatters = require("../../../Functions/fieldValueFormatters");
23
27
 
24
28
  var _Input = _interopRequireDefault(require("../Input/Input"));
@@ -378,7 +382,7 @@ function RangeSlider(_ref) {
378
382
  className: "range-slider__inputs"
379
383
  }, /*#__PURE__*/_react.default.createElement("div", {
380
384
  className: "range-slider__inputs--from"
381
- }, /*#__PURE__*/_react.default.createElement(_Input.default, {
385
+ }, /*#__PURE__*/_react.default.createElement(_Input.default, (0, _extends2.default)({
382
386
  "data-testid": "rangeSlider--input--".concat(testId, "--type-from"),
383
387
  value: from.toString(),
384
388
  onFocus: function onFocus(e) {
@@ -397,9 +401,9 @@ function RangeSlider(_ref) {
397
401
  max: max
398
402
  },
399
403
  isPriceInput: isUseBitPoints
400
- })), /*#__PURE__*/_react.default.createElement("div", {
404
+ }, _mobileKeyboardTypesPresets.NUMERIC_KEYBOARD))), /*#__PURE__*/_react.default.createElement("div", {
401
405
  className: "range-slider__inputs__input"
402
- }, /*#__PURE__*/_react.default.createElement(_Input.default, {
406
+ }, /*#__PURE__*/_react.default.createElement(_Input.default, (0, _extends2.default)({
403
407
  "data-testid": "rangeSlider--input--".concat(testId, "--type-to"),
404
408
  value: to.toString(),
405
409
  onFocus: function onFocus(e) {
@@ -418,7 +422,7 @@ function RangeSlider(_ref) {
418
422
  max: max
419
423
  },
420
424
  isPriceInput: isUseBitPoints
421
- })));
425
+ }, _mobileKeyboardTypesPresets.NUMERIC_KEYBOARD))));
422
426
  };
423
427
 
424
428
  var renderTrackRange = function renderTrackRange() {
@@ -26,6 +26,8 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
26
26
  var AccordionText = function AccordionText(_ref) {
27
27
  var _ref$isDefaultOpen = _ref.isDefaultOpen,
28
28
  isDefaultOpen = _ref$isDefaultOpen === void 0 ? false : _ref$isDefaultOpen,
29
+ _ref$isOuterOpen = _ref.isOuterOpen,
30
+ isOuterOpen = _ref$isOuterOpen === void 0 ? false : _ref$isOuterOpen,
29
31
  className = _ref.className,
30
32
  _ref$text = _ref.text,
31
33
  text = _ref$text === void 0 ? 'Default Accordion Text. Lorem ipsum dolor sit amettttttttttttttt, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.' : _ref$text;
@@ -35,6 +37,9 @@ var AccordionText = function AccordionText(_ref) {
35
37
  isOpen = _useState2[0],
36
38
  setIsOpen = _useState2[1];
37
39
 
40
+ (0, _react.useEffect)(function () {
41
+ setIsOpen(isOuterOpen);
42
+ }, [isOuterOpen]);
38
43
  return /*#__PURE__*/_react.default.createElement("div", {
39
44
  className: (0, _classnames.default)('accordion-text', className, {
40
45
  'accordion-text--open': isOpen
@@ -91,7 +91,7 @@ var Modal = function Modal(_ref2) {
91
91
  testId = _ref2.testId,
92
92
  noHeaderCloseBtn = _ref2.noHeaderCloseBtn,
93
93
  _ref2$noMobileModalLo = _ref2.noMobileModalLogic,
94
- noMobileModalLogic = _ref2$noMobileModalLo === void 0 ? false : _ref2$noMobileModalLo;
94
+ noMobileModalLogic = _ref2$noMobileModalLo === void 0 ? true : _ref2$noMobileModalLo;
95
95
  var modalRef = (0, _react.useRef)(null);
96
96
 
97
97
  var _useMobileModal = (0, _useMobileModal2.default)({
@@ -144,9 +144,6 @@ function useMobileModal(_ref) {
144
144
  footerHeight = modalsLogicProps.footerHeight,
145
145
  headerTop = modalsLogicProps.headerTop,
146
146
  bodyTop = modalsLogicProps.bodyTop;
147
- console.log({
148
- footerBottom: footerBottom
149
- });
150
147
  setModalsLogic({
151
148
  IS_HEADER_HIDDEN: footerBottom * -1 <= footerHeight || scrollDirection === SCROLL_DIRECTION.DOWN,
152
149
  IS_HEADER_STICKY: headerTop <= 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intelicoreact",
3
- "version": "1.2.46",
3
+ "version": "1.2.48",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [