intelicoreact 1.3.21 → 1.3.22

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.
Files changed (252) hide show
  1. package/dist/Atomic/FormElements/ActionAlert/ActionAlert.js +15 -23
  2. package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.js +15 -23
  3. package/dist/Atomic/FormElements/Calendar/Calendar.js +69 -124
  4. package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.js +27 -36
  5. package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.js +23 -39
  6. package/dist/Atomic/FormElements/Datepicker/Datepicker.js +110 -246
  7. package/dist/Atomic/FormElements/Datepicker/components/Calendar.js +44 -85
  8. package/dist/Atomic/FormElements/Dropdown/Dropdown.js +246 -414
  9. package/dist/Atomic/FormElements/Dropdown/components/DropdownLoader.js +5 -9
  10. package/dist/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.js +93 -165
  11. package/dist/Atomic/FormElements/FileLoader/FileLoader.js +39 -64
  12. package/dist/Atomic/FormElements/FileLoader/partial/LoadZone.js +51 -132
  13. package/dist/Atomic/FormElements/FileLoader/partial/LoadedContent.js +34 -73
  14. package/dist/Atomic/FormElements/FileLoaderLocal/FileLoaderLocal.js +54 -75
  15. package/dist/Atomic/FormElements/FileLoaderLocalGroup/FileLoaderLocalGroup.js +67 -110
  16. package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN.js +33 -83
  17. package/dist/Atomic/FormElements/Input/Input.js +161 -253
  18. package/dist/Atomic/FormElements/InputCalendar/InputCalendar.js +48 -102
  19. package/dist/Atomic/FormElements/InputColor/InputColor.js +27 -40
  20. package/dist/Atomic/FormElements/InputCurrency/InputCurrency.js +28 -58
  21. package/dist/Atomic/FormElements/InputDateRange/InputDateRange.js +108 -176
  22. package/dist/Atomic/FormElements/InputDateRange/components/DateInput.js +32 -57
  23. package/dist/Atomic/FormElements/InputDateRange/components/Datepicker.js +184 -302
  24. package/dist/Atomic/FormElements/InputDateRange/components/OpenedPart.js +85 -157
  25. package/dist/Atomic/FormElements/InputDateRange/components/SelectItem.js +11 -16
  26. package/dist/Atomic/FormElements/InputDateRange/dependencies.js +76 -193
  27. package/dist/Atomic/FormElements/InputLink/InputLink.js +34 -58
  28. package/dist/Atomic/FormElements/InputMask/InputCarretPosition.js +8 -12
  29. package/dist/Atomic/FormElements/InputMask/InputMask.js +554 -964
  30. package/dist/Atomic/FormElements/InputMask/config.js +1 -1
  31. package/dist/Atomic/FormElements/InputMask/functions.js +17 -43
  32. package/dist/Atomic/FormElements/InputMask2/InputMask2.js +268 -404
  33. package/dist/Atomic/FormElements/InputMask2/config.js +1 -1
  34. package/dist/Atomic/FormElements/InputMask2/functions.js +17 -43
  35. package/dist/Atomic/FormElements/InputMask3/InputMask3.js +300 -460
  36. package/dist/Atomic/FormElements/InputMask3/config.js +1 -1
  37. package/dist/Atomic/FormElements/InputMask3/functions.js +17 -43
  38. package/dist/Atomic/FormElements/InputWithAction/InputWithAction.js +53 -113
  39. package/dist/Atomic/FormElements/InputsRow/InputsRow.js +64 -118
  40. package/dist/Atomic/FormElements/Label/Label.js +13 -23
  41. package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.js +217 -349
  42. package/dist/Atomic/FormElements/MultiSelect/MultiSelect.js +25 -47
  43. package/dist/Atomic/FormElements/NumericInput/NumericInput.js +133 -207
  44. package/dist/Atomic/FormElements/RadioGroup/RadioGroup.js +29 -61
  45. package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.js +20 -42
  46. package/dist/Atomic/FormElements/RadioInput/RadioInput.js +22 -33
  47. package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.js +20 -43
  48. package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.js +54 -101
  49. package/dist/Atomic/FormElements/RangeInputs/RangeInputs.js +59 -102
  50. package/dist/Atomic/FormElements/RangeList/RangeList.js +89 -150
  51. package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.js +23 -29
  52. package/dist/Atomic/FormElements/RangeSlider/RangeSlider.js +135 -300
  53. package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.js +381 -571
  54. package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.js +14 -24
  55. package/dist/Atomic/FormElements/Switcher/Switcher.js +24 -29
  56. package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.js +25 -47
  57. package/dist/Atomic/FormElements/SwitcherHide/SwitcherHide.js +20 -32
  58. package/dist/Atomic/FormElements/SwitcherRadio/SwitcherRadio.js +32 -55
  59. package/dist/Atomic/FormElements/SwitcherRange/SwitcherRange.js +22 -42
  60. package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.js +23 -33
  61. package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.js +51 -120
  62. package/dist/Atomic/FormElements/SwitcherTagsDropdown/partial/States.js +2 -3
  63. package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.js +23 -46
  64. package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js +260 -413
  65. package/dist/Atomic/FormElements/Text/Text.js +47 -53
  66. package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.js +21 -31
  67. package/dist/Atomic/FormElements/Textarea/Textarea.js +16 -27
  68. package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.js +68 -128
  69. package/dist/Atomic/FormElements/TieredCheckboxes/partial/AccordionWithCheckbox.js +25 -36
  70. package/dist/Atomic/FormElements/TimeRange/TimeRange.js +33 -70
  71. package/dist/Atomic/FormElements/UserContacts/UserContacts.js +58 -124
  72. package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.js +48 -80
  73. package/dist/Atomic/FormElements/VariantsListRadio/partials/VariantsListRadioItem.js +32 -42
  74. package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.js +40 -60
  75. package/dist/Atomic/FormElements/WidgetPseudoTable/partial/constructor.js +2 -3
  76. package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.js +50 -69
  77. package/dist/Atomic/FormElements/WidgetWithSwitchableRows/partial/constructor.js +3 -3
  78. package/dist/Atomic/Layout/Header/Header.js +21 -48
  79. package/dist/Atomic/Layout/MainMenu/MainMenu.js +36 -79
  80. package/dist/Atomic/Layout/Spinner/Spinner.js +8 -14
  81. package/dist/Atomic/UI/Accordion/Accordion.js +18 -48
  82. package/dist/Atomic/UI/Accordion/AccordionItem.js +35 -60
  83. package/dist/Atomic/UI/AccordionTable/AccordionTable.js +49 -106
  84. package/dist/Atomic/UI/AccordionText/AccordionText.js +13 -37
  85. package/dist/Atomic/UI/AdvancedTag/AdvTag.js +48 -94
  86. package/dist/Atomic/UI/AdvancedTag/AdvancedTags.js +22 -50
  87. package/dist/Atomic/UI/Alert/Alert.js +20 -44
  88. package/dist/Atomic/UI/Arrow/Arrow.js +15 -35
  89. package/dist/Atomic/UI/Box/Box.js +14 -21
  90. package/dist/Atomic/UI/Button/Button.js +26 -35
  91. package/dist/Atomic/UI/ButtonsBar/ButtonsBar.js +22 -31
  92. package/dist/Atomic/UI/Chart/Chart.js +45 -86
  93. package/dist/Atomic/UI/Chart/partial/Chart.constants.js +14 -24
  94. package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.js +13 -22
  95. package/dist/Atomic/UI/Chart/partial/datasetSetters.js +68 -113
  96. package/dist/Atomic/UI/Chart/partial/optionsConstructor.js +158 -140
  97. package/dist/Atomic/UI/Chart/partial/optionsSetters.js +26 -42
  98. package/dist/Atomic/UI/Chart/partial/utils.js +20 -48
  99. package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.js +22 -42
  100. package/dist/Atomic/UI/DateTime/DateTime.js +23 -38
  101. package/dist/Atomic/UI/DebugContainer/DebugContainer.js +12 -36
  102. package/dist/Atomic/UI/DebugContainer/useDebugContainer.js +5 -21
  103. package/dist/Atomic/UI/DoubleString/DoubleString.js +27 -50
  104. package/dist/Atomic/UI/DynamicIcon/DynamicIcon.js +15 -63
  105. package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.js +62 -157
  106. package/dist/Atomic/UI/ExampleChartIntegration/partial/utils.js +47 -110
  107. package/dist/Atomic/UI/Hint/Hint.js +49 -94
  108. package/dist/Atomic/UI/Modal/Modal.js +149 -179
  109. package/dist/Atomic/UI/Modal/ModalHOC.js +12 -21
  110. package/dist/Atomic/UI/Modal/partials/ModalFooter.js +7 -12
  111. package/dist/Atomic/UI/Modal/partials/ModalTitle.js +17 -21
  112. package/dist/Atomic/UI/Modal/partials/useMobileModal.js +98 -160
  113. package/dist/Atomic/UI/ModalBackup/Modal.js +65 -90
  114. package/dist/Atomic/UI/ModalBackup/ModalHOC.js +12 -21
  115. package/dist/Atomic/UI/ModalBackup/partials/ModalFooter.js +6 -11
  116. package/dist/Atomic/UI/ModalBackup/partials/ModalTitle.js +15 -19
  117. package/dist/Atomic/UI/MonoAccordion/MonoAccordion.js +32 -62
  118. package/dist/Atomic/UI/NavLine/NavLine.js +120 -211
  119. package/dist/Atomic/UI/NavLine/Tabs.js +2 -3
  120. package/dist/Atomic/UI/PageTitle/PageTitle.js +13 -17
  121. package/dist/Atomic/UI/PieChart/PieChart.js +11 -21
  122. package/dist/Atomic/UI/Price/Price.js +10 -13
  123. package/dist/Atomic/UI/PriceRange/PriceRange.js +7 -11
  124. package/dist/Atomic/UI/ProgressLine/ProgressLine.js +27 -56
  125. package/dist/Atomic/UI/Status/Status.js +19 -30
  126. package/dist/Atomic/UI/Table/Partials/TdCell.js +28 -71
  127. package/dist/Atomic/UI/Table/Partials/TdHeader.js +7 -16
  128. package/dist/Atomic/UI/Table/Partials/TdRow.js +29 -65
  129. package/dist/Atomic/UI/Table/Partials/TdTitle.js +16 -40
  130. package/dist/Atomic/UI/Table/Table.js +27 -47
  131. package/dist/Atomic/UI/Table/TdTypes/TdActions.js +18 -48
  132. package/dist/Atomic/UI/Table/TdTypes/TdPriority.js +9 -19
  133. package/dist/Atomic/UI/Table/TdTypes/TdRange.js +5 -8
  134. package/dist/Atomic/UI/Table/TdTypes/TdWeight.js +25 -47
  135. package/dist/Atomic/UI/Tag/Tag.js +20 -48
  136. package/dist/Atomic/UI/TagList/TagList.js +80 -150
  137. package/dist/Atomic/UI/UserBox/UserBox.js +14 -26
  138. package/dist/Classes/AbortableFetch.js +283 -422
  139. package/dist/Classes/AnimatedHandler.js +44 -56
  140. package/dist/Classes/RESTAPI/index.js +154 -433
  141. package/dist/Classes/RESTAPI/partials/AbortableFetch.js +290 -428
  142. package/dist/Classes/RESTAPI/partials/ApiBase.js +24 -67
  143. package/dist/Classes/RESTAPI/partials/ApiRequestCreators.js +57 -275
  144. package/dist/Classes/RESTAPI/partials/ApiUtils.js +146 -377
  145. package/dist/Classes/RESTAPI/partials/CredentialsProcessing.js +155 -403
  146. package/dist/Classes/RESTAPI/partials/Utils.js +81 -135
  147. package/dist/Classes/RESTAPI/partials/_outerDependencies.js +2 -6
  148. package/dist/Classes/RESTAPI/partials/_utils.js +101 -395
  149. package/dist/Constants/index.constants.js +8 -15
  150. package/dist/Functions/Portal.js +14 -33
  151. package/dist/Functions/customEventListener.js +5 -20
  152. package/dist/Functions/fieldValueFormatters.js +148 -211
  153. package/dist/Functions/hooks/useFormFieldsChangesManager.js +75 -137
  154. package/dist/Functions/locale/createTranslator.js +13 -27
  155. package/dist/Functions/operations.js +35 -49
  156. package/dist/Functions/presets/inputMaskPresets.js +25 -27
  157. package/dist/Functions/presets/inputPresets.js +19 -22
  158. package/dist/Functions/presets/mobileKeyboardTypesPresets.js +7 -9
  159. package/dist/Functions/schemas.js +6 -15
  160. package/dist/Functions/useClickOutside.js +3 -7
  161. package/dist/Functions/useDebounce.js +11 -25
  162. package/dist/Functions/useFieldFocus.js +42 -67
  163. package/dist/Functions/useFormTools/form-drivers/ArrayWithObjects.js +35 -54
  164. package/dist/Functions/useFormTools/form-drivers/ObjectWithIterableObjects.js +74 -95
  165. package/dist/Functions/useFormTools/form-drivers/ObjectWithNamedKeyObjects.js +55 -91
  166. package/dist/Functions/useFormTools/functions/General.js +80 -99
  167. package/dist/Functions/useFormTools/functions/RenderFields.js +45 -72
  168. package/dist/Functions/useFormTools/functions/usePrevious.js +3 -7
  169. package/dist/Functions/useFormTools/index.js +382 -598
  170. package/dist/Functions/useInputHighlightError.js +27 -52
  171. package/dist/Functions/useIsMobile.js +13 -36
  172. package/dist/Functions/useLocalStorage.js +7 -22
  173. package/dist/Functions/useLocationParams.js +16 -27
  174. package/dist/Functions/useMetaInfo.js +19 -50
  175. package/dist/Functions/useMouseUpOutside.js +2 -5
  176. package/dist/Functions/useOnlineStatus.js +7 -26
  177. package/dist/Functions/usePasswordChecker.js +42 -77
  178. package/dist/Functions/usePrevious.js +3 -7
  179. package/dist/Functions/useResize.js +12 -32
  180. package/dist/Functions/useScrollTo.js +6 -20
  181. package/dist/Functions/useToggle.js +10 -30
  182. package/dist/Functions/utils.js +186 -366
  183. package/dist/Molecular/CustomIcons/components/AffiliateNetworks.js +21 -32
  184. package/dist/Molecular/CustomIcons/components/AlertCircle.js +21 -32
  185. package/dist/Molecular/CustomIcons/components/AppStore.js +25 -36
  186. package/dist/Molecular/CustomIcons/components/Arrow.js +31 -42
  187. package/dist/Molecular/CustomIcons/components/ArrowDown.js +13 -24
  188. package/dist/Molecular/CustomIcons/components/ArrowLeft.js +16 -27
  189. package/dist/Molecular/CustomIcons/components/ArrowRight.js +16 -27
  190. package/dist/Molecular/CustomIcons/components/ArrowUp.js +13 -24
  191. package/dist/Molecular/CustomIcons/components/Bell.js +11 -22
  192. package/dist/Molecular/CustomIcons/components/Button.js +11 -22
  193. package/dist/Molecular/CustomIcons/components/Campaigns.js +12 -23
  194. package/dist/Molecular/CustomIcons/components/Check.js +12 -23
  195. package/dist/Molecular/CustomIcons/components/Check2.js +11 -22
  196. package/dist/Molecular/CustomIcons/components/ChevronDown.js +11 -22
  197. package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.js +11 -22
  198. package/dist/Molecular/CustomIcons/components/ChevronLeft.js +11 -22
  199. package/dist/Molecular/CustomIcons/components/ChevronRight.js +11 -22
  200. package/dist/Molecular/CustomIcons/components/ChevronUp.js +11 -22
  201. package/dist/Molecular/CustomIcons/components/ChevronUpDown.js +26 -37
  202. package/dist/Molecular/CustomIcons/components/Close.js +13 -24
  203. package/dist/Molecular/CustomIcons/components/ColumnsOrder.js +38 -49
  204. package/dist/Molecular/CustomIcons/components/Delete.js +12 -23
  205. package/dist/Molecular/CustomIcons/components/Edit.js +11 -22
  206. package/dist/Molecular/CustomIcons/components/Email.js +29 -40
  207. package/dist/Molecular/CustomIcons/components/FinturfLogo.js +19 -30
  208. package/dist/Molecular/CustomIcons/components/FinturfLogo2.js +27 -38
  209. package/dist/Molecular/CustomIcons/components/Flows.js +11 -22
  210. package/dist/Molecular/CustomIcons/components/Gift.js +16 -27
  211. package/dist/Molecular/CustomIcons/components/GoogleAuth.js +25 -36
  212. package/dist/Molecular/CustomIcons/components/GooglePlay.js +25 -36
  213. package/dist/Molecular/CustomIcons/components/HelpCircle.js +14 -25
  214. package/dist/Molecular/CustomIcons/components/HelpCircle2.js +15 -26
  215. package/dist/Molecular/CustomIcons/components/HelpCircleFilled.js +14 -25
  216. package/dist/Molecular/CustomIcons/components/Home.js +14 -25
  217. package/dist/Molecular/CustomIcons/components/Home2.js +17 -28
  218. package/dist/Molecular/CustomIcons/components/Key.js +19 -30
  219. package/dist/Molecular/CustomIcons/components/Landers.js +15 -26
  220. package/dist/Molecular/CustomIcons/components/Lock.js +11 -22
  221. package/dist/Molecular/CustomIcons/components/Mail.js +19 -30
  222. package/dist/Molecular/CustomIcons/components/Mastercard.js +61 -72
  223. package/dist/Molecular/CustomIcons/components/Minus.js +24 -35
  224. package/dist/Molecular/CustomIcons/components/Offers.js +12 -23
  225. package/dist/Molecular/CustomIcons/components/Pause.js +24 -35
  226. package/dist/Molecular/CustomIcons/components/PayPal.js +38 -49
  227. package/dist/Molecular/CustomIcons/components/PayPalLightLarge.js +25 -36
  228. package/dist/Molecular/CustomIcons/components/Phone.js +26 -37
  229. package/dist/Molecular/CustomIcons/components/Play.js +24 -35
  230. package/dist/Molecular/CustomIcons/components/Plus.js +24 -35
  231. package/dist/Molecular/CustomIcons/components/Profile.js +16 -27
  232. package/dist/Molecular/CustomIcons/components/QRCode.js +26 -37
  233. package/dist/Molecular/CustomIcons/components/Rectangle.js +11 -22
  234. package/dist/Molecular/CustomIcons/components/Revert.js +14 -25
  235. package/dist/Molecular/CustomIcons/components/Star.js +10 -21
  236. package/dist/Molecular/CustomIcons/components/Star2.js +12 -23
  237. package/dist/Molecular/CustomIcons/components/TrafficSources.js +14 -25
  238. package/dist/Molecular/CustomIcons/components/Trash.js +11 -22
  239. package/dist/Molecular/CustomIcons/components/TrashRed.js +11 -22
  240. package/dist/Molecular/CustomIcons/components/Triggers.js +11 -22
  241. package/dist/Molecular/CustomIcons/components/User.js +16 -27
  242. package/dist/Molecular/CustomIcons/components/Visa.js +27 -38
  243. package/dist/Molecular/CustomIcons/components/X.js +11 -22
  244. package/dist/Molecular/CustomIcons/index.js +61 -183
  245. package/dist/Molecular/FormElement/FormElement.js +18 -27
  246. package/dist/Molecular/FormWithDependOn/FormWithDependOn.js +95 -112
  247. package/dist/Molecular/FormWithDependOn/partials/_utils.js +35 -34
  248. package/dist/Molecular/InputAddress/InputAddress.js +176 -312
  249. package/dist/Molecular/InputPassword/InputPassword.js +15 -39
  250. package/dist/index.js +1 -3
  251. package/package.json +1 -1
  252. package/dist/Atomic/FormElements/UserContacts/partial/defaultIcons.js +0 -91
@@ -1,284 +1,180 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- var _typeof3 = require("@babel/runtime/helpers/typeof");
6
-
7
4
  Object.defineProperty(exports, "__esModule", {
8
5
  value: true
9
6
  });
10
7
  exports.default = void 0;
11
-
12
- var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
13
-
14
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
15
-
16
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
17
-
18
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
19
-
20
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
21
-
22
9
  var _react = _interopRequireWildcard(require("react"));
23
-
24
10
  var _reactDom = require("react-dom");
25
-
26
11
  var _classnames = _interopRequireDefault(require("classnames"));
27
-
28
12
  var _reactFeather = require("react-feather");
29
-
30
13
  var _fieldValueFormatters = require("../../../Functions/fieldValueFormatters");
31
-
32
14
  var _utils = require("../../../Functions/utils");
33
-
34
- var _useIsMobile2 = _interopRequireDefault(require("../../../Functions/useIsMobile"));
35
-
15
+ var _useIsMobile = _interopRequireDefault(require("../../../Functions/useIsMobile"));
36
16
  var _Input = _interopRequireDefault(require("../../../Atomic/FormElements/Input/Input"));
37
-
38
17
  var _RadioInput = _interopRequireDefault(require("../../../Atomic/FormElements/RadioInput/RadioInput"));
39
-
40
18
  var _DropdownLoader = _interopRequireDefault(require("./components/DropdownLoader"));
41
-
42
19
  require("./Dropdown.scss");
43
-
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); }
45
-
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; }
47
-
48
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
49
-
50
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
51
-
52
- var RC = 'dropdown';
53
- var MIN_ITEMS_FOR_SHOW_MOBILE_SEARCH = 10;
54
-
55
- var Dropdown = function Dropdown(_ref) {
56
- var _options$find, _dropdownListWrapperR4, _dropdownListWrapperR5, _dropdownListRef$curr5, _dropdownListRef$curr6, _filteredOptions$find, _tabIndex$toString;
57
-
58
- var label = _ref.label,
59
- _ref$options = _ref.options,
60
- options = _ref$options === void 0 ? [] : _ref$options,
61
- value = _ref.value,
62
- error = _ref.error,
63
- disabled = _ref.disabled,
64
- onChange = _ref.onChange,
65
- placeholder = _ref.placeholder,
66
- className = _ref.className,
67
- isSearchable = _ref.isSearchable,
68
- entity = _ref.entity,
69
- scrollReactionObj = _ref.scrollReactionObj,
70
- isListTop = _ref.isListTop,
71
- _ref$isNotValidateASC = _ref.isNotValidateASCII,
72
- isNotValidateASCII = _ref$isNotValidateASC === void 0 ? false : _ref$isNotValidateASC,
73
- testId = _ref.testId,
74
- _ref$sortAlphabetical = _ref.sortAlphabetical,
75
- sortAlphabetical = _ref$sortAlphabetical === void 0 ? true : _ref$sortAlphabetical,
76
- fieldKey = _ref.fieldKey,
77
- id = _ref.id,
78
- _ref$noOptionsText = _ref.noOptionsText,
79
- noOptionsText = _ref$noOptionsText === void 0 ? 'No options available' : _ref$noOptionsText,
80
- _ref$attributesOfNati = _ref.attributesOfNativeInput,
81
- attributesOfNativeInput = _ref$attributesOfNati === void 0 ? {} : _ref$attributesOfNati,
82
- isDoNotPullOutListOfMainContainer = _ref.isDoNotPullOutListOfMainContainer,
83
- withMobileLogic = _ref.withMobileLogic,
84
- _ref$minItemsForShowM = _ref.minItemsForShowMobileSearch,
85
- minItemsForShowMobileSearch = _ref$minItemsForShowM === void 0 ? MIN_ITEMS_FOR_SHOW_MOBILE_SEARCH : _ref$minItemsForShowM,
86
- customTrigger = _ref.customTrigger,
87
- tabIndex = _ref.tabIndex;
88
-
89
- var _useIsMobile = (0, _useIsMobile2.default)(),
90
- isMobileProp = _useIsMobile.isMobile;
91
-
92
- var isMobile = isMobileProp && withMobileLogic;
93
-
94
- var _useState = (0, _react.useState)(id || fieldKey || Math.random().toString(16).slice(2)),
95
- _useState2 = (0, _slicedToArray2.default)(_useState, 2),
96
- dropdownId = _useState2[0],
97
- setDropdownId = _useState2[1];
98
-
99
- var _useState3 = (0, _react.useState)(false),
100
- _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
101
- isOpen = _useState4[0],
102
- setIsOpen = _useState4[1];
103
-
104
- var _useState5 = (0, _react.useState)(),
105
- _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
106
- searchValue = _useState6[0],
107
- setSearchValue = _useState6[1];
108
-
109
- var dropdownRef = (0, _react.useRef)(null);
110
- var dropdownListRef = (0, _react.useRef)(null);
111
- var dropdownListWrapperRef = (0, _react.useRef)(null);
112
- var searchInputRef = (0, _react.useRef)(null);
113
- var wrapperRef = (0, _react.useRef)(null);
114
-
115
- var _useState7 = (0, _react.useState)(null),
116
- _useState8 = (0, _slicedToArray2.default)(_useState7, 2),
117
- initListHeight = _useState8[0],
118
- setInitListHeight = _useState8[1];
119
-
120
- var _useState9 = (0, _react.useState)(false),
121
- _useState10 = (0, _slicedToArray2.default)(_useState9, 2),
122
- isSearchChanged = _useState10[0],
123
- setIsSearchChanged = _useState10[1];
124
-
125
- var _useState11 = (0, _react.useState)(false),
126
- _useState12 = (0, _slicedToArray2.default)(_useState11, 2),
127
- isSearchInputFocused = _useState12[0],
128
- setIsSearchInputFocused = _useState12[1];
129
-
130
- var _useState13 = (0, _react.useState)(null),
131
- _useState14 = (0, _slicedToArray2.default)(_useState13, 2),
132
- isScrollableList = _useState14[0],
133
- setIsScrollableList = _useState14[1];
134
-
135
- var _useState15 = (0, _react.useState)(false),
136
- _useState16 = (0, _slicedToArray2.default)(_useState15, 2),
137
- isFixedMaxHeight = _useState16[0],
138
- setIsFixedMaxHeight = _useState16[1];
139
-
140
- var _useState17 = (0, _react.useState)(0),
141
- _useState18 = (0, _slicedToArray2.default)(_useState17, 2),
142
- scrollTop = _useState18[0],
143
- setScrollTop = _useState18[1];
144
-
145
- var _useState19 = (0, _react.useState)(1),
146
- _useState20 = (0, _slicedToArray2.default)(_useState19, 2),
147
- scrollHeight = _useState20[0],
148
- setScrollHeight = _useState20[1];
149
-
20
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
21
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
22
+ const RC = 'dropdown';
23
+ const MIN_ITEMS_FOR_SHOW_MOBILE_SEARCH = 10;
24
+ const Dropdown = _ref => {
25
+ var _options$find, _dropdownListWrapperR3, _dropdownListRef$curr5, _dropdownListRef$curr6, _filteredOptions$find, _tabIndex$toString;
26
+ let {
27
+ label,
28
+ options = [],
29
+ value,
30
+ error,
31
+ disabled,
32
+ onChange,
33
+ placeholder,
34
+ className,
35
+ isSearchable,
36
+ entity,
37
+ scrollReactionObj,
38
+ isListTop,
39
+ isNotValidateASCII = false,
40
+ testId,
41
+ sortAlphabetical = true,
42
+ fieldKey,
43
+ id,
44
+ noOptionsText = 'No options available',
45
+ attributesOfNativeInput = {},
46
+ isDoNotPullOutListOfMainContainer,
47
+ withMobileLogic,
48
+ minItemsForShowMobileSearch = MIN_ITEMS_FOR_SHOW_MOBILE_SEARCH,
49
+ customTrigger,
50
+ tabIndex
51
+ } = _ref;
52
+ const {
53
+ isMobile: isMobileProp
54
+ } = (0, _useIsMobile.default)();
55
+ const isMobile = isMobileProp && withMobileLogic;
56
+ const [dropdownId, setDropdownId] = (0, _react.useState)(id || fieldKey || Math.random().toString(16).slice(2));
57
+ const [isOpen, setIsOpen] = (0, _react.useState)(false);
58
+ const [searchValue, setSearchValue] = (0, _react.useState)();
59
+ const dropdownRef = (0, _react.useRef)(null);
60
+ const dropdownListRef = (0, _react.useRef)(null);
61
+ const dropdownListWrapperRef = (0, _react.useRef)(null);
62
+ const searchInputRef = (0, _react.useRef)(null);
63
+ const wrapperRef = (0, _react.useRef)(null);
64
+ const [initListHeight, setInitListHeight] = (0, _react.useState)(null);
65
+ const [isSearchChanged, setIsSearchChanged] = (0, _react.useState)(false);
66
+ const [isSearchInputFocused, setIsSearchInputFocused] = (0, _react.useState)(false);
67
+ const [isScrollableList, setIsScrollableList] = (0, _react.useState)(null);
68
+ const [isFixedMaxHeight, setIsFixedMaxHeight] = (0, _react.useState)(false);
69
+ const [scrollTop, setScrollTop] = (0, _react.useState)(0);
70
+ const [scrollHeight, setScrollHeight] = (0, _react.useState)(1);
150
71
  if (!options) return null;
151
- var getTotalOptions = (0, _react.useCallback)(function () {
152
- return options === null || options === void 0 ? void 0 : options.reduce(function (result, item) {
72
+ const getTotalOptions = (0, _react.useCallback)(() => {
73
+ return options === null || options === void 0 ? void 0 : options.reduce((result, item) => {
153
74
  if (item !== null && item !== void 0 && item.list || item !== null && item !== void 0 && item.items) {
154
75
  var _item$list, _item$items;
155
-
156
- result += (item === null || item === void 0 ? void 0 : (_item$list = item.list) === null || _item$list === void 0 ? void 0 : _item$list.length) || (item === null || item === void 0 ? void 0 : (_item$items = item.items) === null || _item$items === void 0 ? void 0 : _item$items.length) || 0;
76
+ result += (item === null || item === void 0 || (_item$list = item.list) === null || _item$list === void 0 ? void 0 : _item$list.length) || (item === null || item === void 0 || (_item$items = item.items) === null || _item$items === void 0 ? void 0 : _item$items.length) || 0;
157
77
  } else {
158
78
  ++result;
159
79
  }
160
-
161
80
  return result;
162
81
  }, 0);
163
82
  }, [options]);
164
83
  if (isMobile) isSearchable = getTotalOptions() > (minItemsForShowMobileSearch || MIN_ITEMS_FOR_SHOW_MOBILE_SEARCH);
165
-
166
- var moveOtherToEnd = function moveOtherToEnd(options) {
167
- var otherIndex = options === null || options === void 0 ? void 0 : options.findIndex(function (option) {
168
- return (option === null || option === void 0 ? void 0 : option.value) === 'other';
169
- });
170
-
84
+ const moveOtherToEnd = options => {
85
+ const otherIndex = options === null || options === void 0 ? void 0 : options.findIndex(option => (option === null || option === void 0 ? void 0 : option.value) === 'other');
171
86
  if (otherIndex > -1) {
172
- var other = options === null || options === void 0 ? void 0 : options.splice(otherIndex, 1);
173
- options.push.apply(options, (0, _toConsumableArray2.default)(other));
87
+ const other = options === null || options === void 0 ? void 0 : options.splice(otherIndex, 1);
88
+ options.push(...other);
174
89
  }
175
-
176
90
  return options;
177
91
  };
178
-
179
- var optionsWithOtherAtTheEnd = moveOtherToEnd(options);
180
- options.map(function (option) {
92
+ const optionsWithOtherAtTheEnd = moveOtherToEnd(options);
93
+ options.map(option => {
181
94
  if (option.items) {
182
95
  return option.items = moveOtherToEnd(option.items);
183
96
  } else return option;
184
97
  });
185
- var filteredGroups = optionsWithOtherAtTheEnd.map(function (item) {
98
+ const filteredGroups = optionsWithOtherAtTheEnd.map(item => {
186
99
  var _item$items2;
187
-
188
- return _objectSpread(_objectSpread({}, item), {}, {
189
- items: !isSearchable || !isSearchChanged ? item === null || item === void 0 ? void 0 : item.items : (_item$items2 = item.items) === null || _item$items2 === void 0 ? void 0 : _item$items2.slice().filter(function (el) {
100
+ return {
101
+ ...item,
102
+ items: !isSearchable || !isSearchChanged ? item === null || item === void 0 ? void 0 : item.items : (_item$items2 = item.items) === null || _item$items2 === void 0 ? void 0 : _item$items2.slice().filter(el => {
190
103
  var _el$label;
191
-
192
- return (el === null || el === void 0 ? void 0 : (_el$label = el.label) === null || _el$label === void 0 ? void 0 : _el$label.toLowerCase().includes((searchValue === null || searchValue === void 0 ? void 0 : searchValue.toLowerCase()) || '')) || !(el !== null && el !== void 0 && el.value) || (el === null || el === void 0 ? void 0 : el.value) === '';
104
+ return (el === null || el === void 0 || (_el$label = el.label) === null || _el$label === void 0 ? void 0 : _el$label.toLowerCase().includes((searchValue === null || searchValue === void 0 ? void 0 : searchValue.toLowerCase()) || '')) || !(el !== null && el !== void 0 && el.value) || (el === null || el === void 0 ? void 0 : el.value) === '';
193
105
  })
194
- });
195
- }).filter(function (item) {
106
+ };
107
+ }).filter(item => {
196
108
  var _item$items3;
197
-
198
109
  return ((_item$items3 = item.items) === null || _item$items3 === void 0 ? void 0 : _item$items3.length) > 0;
199
110
  });
200
- var filteredItems = optionsWithOtherAtTheEnd.filter(function (item) {
111
+ const filteredItems = optionsWithOtherAtTheEnd.filter(item => {
201
112
  var _item$items4;
202
-
203
113
  return !((_item$items4 = item.items) !== null && _item$items4 !== void 0 && _item$items4.length);
204
- }).filter(function (item) {
114
+ }).filter(item => {
205
115
  var _item$label;
206
-
207
116
  if (!isSearchable || !isSearchChanged) return true;
208
- return (item === null || item === void 0 ? void 0 : (_item$label = item.label) === null || _item$label === void 0 ? void 0 : _item$label.toLowerCase().includes((searchValue === null || searchValue === void 0 ? void 0 : searchValue.toLowerCase()) || '')) || !(item !== null && item !== void 0 && item.value) || (item === null || item === void 0 ? void 0 : item.value) === '';
117
+ return (item === null || item === void 0 || (_item$label = item.label) === null || _item$label === void 0 ? void 0 : _item$label.toLowerCase().includes((searchValue === null || searchValue === void 0 ? void 0 : searchValue.toLowerCase()) || '')) || !(item !== null && item !== void 0 && item.value) || (item === null || item === void 0 ? void 0 : item.value) === '';
209
118
  });
210
- var filteredOptions = [].concat((0, _toConsumableArray2.default)(filteredItems), (0, _toConsumableArray2.default)(filteredGroups));
211
- var modalBtnTrigger = entity && entity !== '' && typeof entity === 'string';
212
-
213
- var onChangeHandler = function onChangeHandler(item) {
119
+ const filteredOptions = [...filteredItems, ...filteredGroups];
120
+ const modalBtnTrigger = entity && entity !== '' && typeof entity === 'string';
121
+ const onChangeHandler = item => {
214
122
  setIsOpen(false);
215
123
  onChange(item.value);
216
124
  };
217
-
218
- var onKeyDown = function onKeyDown(e) {
125
+ const onKeyDown = e => {
219
126
  if (![9, 13].includes(e.keyCode)) return false;
220
127
  setIsOpen(false);
221
128
  };
222
-
223
- var onKeyUp = function onKeyUp(e) {
129
+ const onKeyUp = e => {
224
130
  if (![9, 13].includes(e.keyCode)) return false;
225
131
  setIsOpen(true);
226
- }; // decorator
227
-
228
-
229
- var getDepends = function getDepends(getDependsTrigger) {
230
- var newOnChange = function newOnChange(e) {
132
+ };
133
+ // decorator
134
+ const getDepends = getDependsTrigger => {
135
+ const newOnChange = e => {
231
136
  if (e.value === 'open_modal') {
232
137
  onChange('open_modal');
233
138
  } else {
234
139
  onChangeHandler(e);
235
140
  }
236
- }; // add pseudo option
237
-
141
+ };
238
142
 
239
- var newOptions = [{
143
+ // add pseudo option
144
+ const newOptions = [{
240
145
  label: "New ".concat(entity),
241
146
  value: 'open_modal',
242
147
  className: 'dropdown__list-item--modal'
243
- }].concat((0, _toConsumableArray2.default)(filteredOptions));
148
+ }, ...filteredOptions];
244
149
  return {
245
- onChange: function onChange(changeItem) {
150
+ onChange: changeItem => {
246
151
  return getDependsTrigger ? newOnChange(changeItem) : onChangeHandler(changeItem);
247
152
  },
248
153
  options: getDependsTrigger ? newOptions : options
249
154
  };
250
155
  };
251
-
252
- var handleClickOutside = function handleClickOutside(event) {
156
+ const handleClickOutside = event => {
253
157
  var _getListContainer;
254
-
255
158
  if (!((_getListContainer = getListContainer()) !== null && _getListContainer !== void 0 && _getListContainer.contains(event === null || event === void 0 ? void 0 : event.target))) {
256
159
  setIsOpen(false);
257
160
  }
258
161
  };
259
-
260
- var onSearchHandler = function onSearchHandler(name) {
261
- var inputValue = name;
162
+ const onSearchHandler = name => {
163
+ let inputValue = name;
262
164
  if (!isNotValidateASCII) inputValue = (0, _fieldValueFormatters.formatToOnlyASCIICodeText)(inputValue);
263
165
  setIsSearchChanged(true);
264
166
  setSearchValue(inputValue);
265
167
  };
266
-
267
- var onWrapperClick = function onWrapperClick(e) {
168
+ const onWrapperClick = e => {
268
169
  if (e.target === (wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current)) {
269
170
  e.stopPropagation();
270
171
  e.preventDefault();
271
172
  setIsOpen(false);
272
173
  }
273
174
  };
274
-
275
- var hightlightedText = function hightlightedText(text, postfix, description) {
175
+ const hightlightedText = (text, postfix, description) => {
276
176
  var _text;
277
-
278
- var prepare = function prepare(text) {
279
- return text === null || text === void 0 ? void 0 : text.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&');
280
- };
281
-
177
+ const prepare = text => text === null || text === void 0 ? void 0 : text.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&');
282
178
  text = text.replace(/["&<>]/g, function (a) {
283
179
  return {
284
180
  '"': '&quot;',
@@ -287,28 +183,26 @@ var Dropdown = function Dropdown(_ref) {
287
183
  '>': '&gt;'
288
184
  }[a];
289
185
  });
290
- var main = isSearchable && searchValue ? (_text = text) === null || _text === void 0 ? void 0 : _text.replace(new RegExp(prepare(searchValue), 'i'), function (match) {
291
- return "<span class=\"bg--yellow\">".concat(match, "</span>");
292
- }) : text;
293
- var postfixPart = postfix ? "<span class=\"dropdown__list-item-postfix\">".concat(postfix, "</span>") : '';
294
- var descriptionPart = description ? "<span class=\"dropdown__list-item-description\">".concat(description, "</span>") : '';
186
+ const main = isSearchable && searchValue ? (_text = text) === null || _text === void 0 ? void 0 : _text.replace(new RegExp(prepare(searchValue), 'i'), match => "<span class=\"bg--yellow\">".concat(match, "</span>")) : text;
187
+ const postfixPart = postfix ? "<span class=\"dropdown__list-item-postfix\">".concat(postfix, "</span>") : '';
188
+ const descriptionPart = description ? "<span class=\"dropdown__list-item-description\">".concat(description, "</span>") : '';
295
189
  return main + postfixPart + descriptionPart;
296
190
  };
297
-
298
- var depend = getDepends(modalBtnTrigger);
299
-
300
- var getMarkupForElement = function getMarkupForElement(item, index, optTestId) {
301
- var _item$value, _item$value$toString, _item$value2, _item$value2$toString, _cn, _item$customMobileIco;
302
-
191
+ const depend = getDepends(modalBtnTrigger);
192
+ const getMarkupForElement = (item, index, optTestId) => {
193
+ var _item$value, _item$value2, _item$customMobileIco;
303
194
  return /*#__PURE__*/_react.default.createElement("button", {
304
- "data-testid": "dropdown--button--key-".concat(optTestId || (item === null || item === void 0 ? void 0 : (_item$value = item.value) === null || _item$value === void 0 ? void 0 : (_item$value$toString = _item$value.toString()) === null || _item$value$toString === void 0 ? void 0 : _item$value$toString.replace(/\s/, '-')) || (item === null || item === void 0 ? void 0 : item.key) || 'item', "--option"),
305
- key: (_item$value2 = item.value) === null || _item$value2 === void 0 ? void 0 : (_item$value2$toString = _item$value2.toString()) === null || _item$value2$toString === void 0 ? void 0 : _item$value2$toString.replace(/ /g, '_'),
306
- onMouseDown: function onMouseDown() {
307
- return depend.onChange(item);
308
- },
309
- 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)
195
+ "data-testid": "dropdown--button--key-".concat(optTestId || (item === null || item === void 0 || (_item$value = item.value) === null || _item$value === void 0 || (_item$value = _item$value.toString()) === null || _item$value === void 0 ? void 0 : _item$value.replace(/\s/, '-')) || (item === null || item === void 0 ? void 0 : item.key) || 'item', "--option"),
196
+ key: (_item$value2 = item.value) === null || _item$value2 === void 0 || (_item$value2 = _item$value2.toString()) === null || _item$value2 === void 0 ? void 0 : _item$value2.replace(/ /g, '_'),
197
+ onMouseDown: () => depend.onChange(item),
198
+ className: (0, _classnames.default)("".concat(RC, "__list-item"), {
199
+ ["".concat(RC, "__list-item_active")]: item.value === value,
200
+ ["".concat(RC, "__list-item_disabled")]: item.disabled
201
+ }, item.className)
310
202
  }, !isMobile && /*#__PURE__*/_react.default.createElement("span", {
311
- className: (0, _classnames.default)("".concat(RC, "__active-icon"), (0, _defineProperty2.default)({}, "".concat(RC, "__active-icon_active"), item.value === value))
203
+ className: (0, _classnames.default)("".concat(RC, "__active-icon"), {
204
+ ["".concat(RC, "__active-icon_active")]: item.value === value
205
+ })
312
206
  }, /*#__PURE__*/_react.default.createElement(_reactFeather.Check, null)), /*#__PURE__*/_react.default.createElement("div", {
313
207
  className: (0, _classnames.default)("".concat(RC, "__list-item-label"), item.labelClassName || ''),
314
208
  dangerouslySetInnerHTML: {
@@ -319,73 +213,54 @@ var Dropdown = function Dropdown(_ref) {
319
213
  checked: value
320
214
  }) : '');
321
215
  };
322
-
323
- var filteredOptionList = function filteredOptionList(filteredOption) {
324
- var _filteredOption$items, _filteredOption$label, _filteredOption$label2;
325
-
216
+ const filteredOptionList = filteredOption => {
217
+ var _filteredOption$items, _filteredOption$label;
326
218
  return ((_filteredOption$items = filteredOption.items) === null || _filteredOption$items === void 0 ? void 0 : _filteredOption$items.length) > 0 ? /*#__PURE__*/_react.default.createElement("div", {
327
- key: (_filteredOption$label = filteredOption.label) === null || _filteredOption$label === void 0 ? void 0 : (_filteredOption$label2 = _filteredOption$label.toString()) === null || _filteredOption$label2 === void 0 ? void 0 : _filteredOption$label2.replace(/ /g, '_').concat(Date.now()),
219
+ key: (_filteredOption$label = filteredOption.label) === null || _filteredOption$label === void 0 || (_filteredOption$label = _filteredOption$label.toString()) === null || _filteredOption$label === void 0 ? void 0 : _filteredOption$label.replace(/ /g, '_').concat(Date.now()),
328
220
  className: (0, _classnames.default)("".concat(RC, "-group"), filteredOption.className)
329
221
  }, /*#__PURE__*/_react.default.createElement("div", {
330
222
  className: "".concat(RC, "-group__name")
331
- }, filteredOption.label), filteredOption.items.map(function (el, index) {
332
- return getMarkupForElement(el, index, el === null || el === void 0 ? void 0 : el.testId);
333
- })) : null;
223
+ }, filteredOption.label), filteredOption.items.map((el, index) => getMarkupForElement(el, index, el === null || el === void 0 ? void 0 : el.testId))) : null;
334
224
  };
335
-
336
- var selectedLabel = ((_options$find = options.find(function (el) {
337
- return el.value === value;
338
- })) === null || _options$find === void 0 ? void 0 : _options$find.label) || options.reduce(function (acc, item) {
339
- var _item$items5, _item$items5$find;
340
-
341
- return acc || ((_item$items5 = item.items) === null || _item$items5 === void 0 ? void 0 : (_item$items5$find = _item$items5.find(function (el) {
342
- return el.value === value;
343
- })) === null || _item$items5$find === void 0 ? void 0 : _item$items5$find.label);
225
+ const selectedLabel = ((_options$find = options.find(el => el.value === value)) === null || _options$find === void 0 ? void 0 : _options$find.label) || options.reduce((acc, item) => {
226
+ var _item$items5;
227
+ return acc || ((_item$items5 = item.items) === null || _item$items5 === void 0 || (_item$items5 = _item$items5.find(el => el.value === value)) === null || _item$items5 === void 0 ? void 0 : _item$items5.label);
344
228
  }, null);
345
- var doScrollCallback = (0, _react.useCallback)(function (e) {
346
- var _ref2 = scrollReactionObj || {},
347
- callback = _ref2.callback,
348
- isWithAnyScrolling = _ref2.isWithAnyScrolling,
349
- _ref2$scrollingInaccu = _ref2.scrollingInaccuracy,
350
- scrollingInaccuracy = _ref2$scrollingInaccu === void 0 ? 0 : _ref2$scrollingInaccu;
351
-
229
+ const doScrollCallback = (0, _react.useCallback)(e => {
230
+ const {
231
+ callback,
232
+ isWithAnyScrolling,
233
+ scrollingInaccuracy = 0
234
+ } = scrollReactionObj || {};
352
235
  if (callback && typeof callback === 'function') {
353
236
  if (isWithAnyScrolling) callback(e);else if (Math.round(e.target.clientHeight + e.target.scrollTop + scrollingInaccuracy) >= e.target.scrollHeight) callback(e);
354
237
  }
355
238
  }, [filteredOptions]);
356
-
357
- var getParentNode = function getParentNode() {
239
+ const getParentNode = () => {
358
240
  var _document$querySelect;
359
-
360
241
  if (isDoNotPullOutListOfMainContainer) return dropdownRef.current;
361
242
  return (_document$querySelect = document.querySelector('div#root')) !== null && _document$querySelect !== void 0 ? _document$querySelect : document.querySelector('div#app');
362
243
  };
363
-
364
- var initListContainer = function initListContainer() {
365
- var dropdownList = document.createElement('div');
244
+ const initListContainer = () => {
245
+ const dropdownList = document.createElement('div');
366
246
  dropdownList.setAttribute('id', dropdownId);
367
247
  dropdownList.classList.add('dropdown__container');
368
-
369
248
  if (isMobile) {
370
- dropdownList.addEventListener('click', function (e) {
249
+ dropdownList.addEventListener('click', e => {
371
250
  if (e.target.id === dropdownId) setIsOpen(false);
372
251
  });
373
252
  }
374
-
375
253
  try {
376
254
  var _getListContainer2;
377
-
378
- (_getListContainer2 = getListContainer()) === null || _getListContainer2 === void 0 ? void 0 : _getListContainer2.remove();
255
+ (_getListContainer2 = getListContainer()) === null || _getListContainer2 === void 0 || _getListContainer2.remove();
379
256
  } finally {
380
257
  if (isMobile) {
381
258
  try {
382
259
  var _document$getElementB;
383
-
384
- (_document$getElementB = document.getElementById("mlw-".concat(dropdownId))) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.remove();
260
+ (_document$getElementB = document.getElementById("mlw-".concat(dropdownId))) === null || _document$getElementB === void 0 || _document$getElementB.remove();
385
261
  } catch (e) {}
386
-
387
262
  ;
388
- var dropdownMobileListWrapper = document.createElement('div');
263
+ const dropdownMobileListWrapper = document.createElement('div');
389
264
  dropdownMobileListWrapper.classList.add('dropdown-mobile');
390
265
  dropdownMobileListWrapper.setAttribute('id', "mlw-".concat(dropdownId));
391
266
  dropdownMobileListWrapper.append(dropdownList);
@@ -395,151 +270,141 @@ var Dropdown = function Dropdown(_ref) {
395
270
  }
396
271
  }
397
272
  };
398
-
399
- var getListContainer = function getListContainer() {
273
+ const getListContainer = () => {
400
274
  return document.getElementById(dropdownId);
401
275
  };
402
-
403
- var getListContainerWrapper = function getListContainerWrapper() {
276
+ const getListContainerWrapper = () => {
404
277
  return document.getElementById("mlw-".concat(dropdownId));
405
278
  };
406
-
407
- var setListContainerStyles = function setListContainerStyles() {
408
- var _dropdownRef$current$, _dropdownListWrapperR, _getComputedStyle$mar, _getComputedStyle, _getComputedStyle$mar2, _getComputedStyle$max, _getComputedStyle2, _getComputedStyle2$ma, _sw$getBoundingClient, _dropdownListWrapperR2, _dropdownListWrapperR3, _lh$getBoundingClient;
409
-
410
- var lc = getListContainer();
279
+ const setListContainerStyles = () => {
280
+ var _dropdownRef$current$, _dropdownListWrapperR, _getComputedStyle$mar, _getComputedStyle, _getComputedStyle$max, _getComputedStyle2, _sw$getBoundingClient, _dropdownListWrapperR2, _lh$getBoundingClient;
281
+ const lc = getListContainer();
411
282
  if (!lc || !isOpen) return false;
412
- var windowHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
413
-
414
- var _ref3 = (_dropdownRef$current$ = dropdownRef === null || dropdownRef === void 0 ? void 0 : dropdownRef.current.getBoundingClientRect()) !== null && _dropdownRef$current$ !== void 0 ? _dropdownRef$current$ : {},
415
- width = _ref3.width,
416
- height = _ref3.height,
417
- left = _ref3.left,
418
- top = _ref3.top;
419
-
420
- var sw = lc.getElementsByClassName('dropdown__list')[0];
421
- var lh = dropdownListWrapperRef === null || dropdownListWrapperRef === void 0 ? void 0 : (_dropdownListWrapperR = dropdownListWrapperRef.current) === null || _dropdownListWrapperR === void 0 ? void 0 : _dropdownListWrapperR.getElementsByClassName('dropdown__list-header')[0];
422
- 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);
423
- 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);
283
+ const windowHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
284
+ const {
285
+ width,
286
+ height,
287
+ left,
288
+ top
289
+ } = (_dropdownRef$current$ = dropdownRef === null || dropdownRef === void 0 ? void 0 : dropdownRef.current.getBoundingClientRect()) !== null && _dropdownRef$current$ !== void 0 ? _dropdownRef$current$ : {};
290
+ const sw = lc.getElementsByClassName('dropdown__list')[0];
291
+ const lh = dropdownListWrapperRef === null || dropdownListWrapperRef === void 0 || (_dropdownListWrapperR = dropdownListWrapperRef.current) === null || _dropdownListWrapperR === void 0 ? void 0 : _dropdownListWrapperR.getElementsByClassName('dropdown__list-header')[0];
292
+ const margin = parseInt((_getComputedStyle$mar = (_getComputedStyle = getComputedStyle(sw)) === null || _getComputedStyle === void 0 || (_getComputedStyle = _getComputedStyle.marginTop) === null || _getComputedStyle === void 0 ? void 0 : _getComputedStyle.replace('px', '')) !== null && _getComputedStyle$mar !== void 0 ? _getComputedStyle$mar : 0);
293
+ const maxHeight = initListHeight !== null && initListHeight !== void 0 ? initListHeight : parseInt((_getComputedStyle$max = (_getComputedStyle2 = getComputedStyle(sw)) === null || _getComputedStyle2 === void 0 || (_getComputedStyle2 = _getComputedStyle2.maxHeight) === null || _getComputedStyle2 === void 0 ? void 0 : _getComputedStyle2.replace('px', '')) !== null && _getComputedStyle$max !== void 0 ? _getComputedStyle$max : 0);
424
294
  if (initListHeight === null) setInitListHeight(maxHeight);
425
- var toTop = top - margin;
426
- var toBottom = windowHeight - top - height - margin * 2;
427
- var swHeight = sw === null || sw === void 0 ? void 0 : (_sw$getBoundingClient = sw.getBoundingClientRect()) === null || _sw$getBoundingClient === void 0 ? void 0 : _sw$getBoundingClient.height;
428
- 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;
429
- var listPos = toTop < toBottom || toBottom >= swHeight ? 'bottom' : 'top';
295
+ const toTop = top - margin;
296
+ const toBottom = windowHeight - top - height - margin * 2;
297
+ const swHeight = sw === null || sw === void 0 || (_sw$getBoundingClient = sw.getBoundingClientRect()) === null || _sw$getBoundingClient === void 0 ? void 0 : _sw$getBoundingClient.height;
298
+ const maxSwHeight = isMobile ? (dropdownListWrapperRef === null || dropdownListWrapperRef === void 0 || (_dropdownListWrapperR2 = dropdownListWrapperRef.current) === null || _dropdownListWrapperR2 === void 0 || (_dropdownListWrapperR2 = _dropdownListWrapperR2.getBoundingClientRect()) === null || _dropdownListWrapperR2 === void 0 ? void 0 : _dropdownListWrapperR2.height) - (lh === null || lh === 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;
299
+ const listPos = toTop < toBottom || toBottom >= swHeight ? 'bottom' : 'top';
430
300
  lc.style.minWidth = "".concat(width, "px");
431
301
  lc.style.left = "".concat(left, "px");
432
302
  lc.style.top = "".concat(listPos === 'bottom' ? top + height : top - swHeight - 3 * margin, "px");
433
303
  sw.style.maxHeight = "".concat(maxSwHeight, "px");
434
304
  };
435
-
436
- var renderListContainer = function renderListContainer() {
437
- var lc = getListContainer();
305
+ const renderListContainer = () => {
306
+ const lc = getListContainer();
438
307
  if (!lc) return null;
439
308
  return /*#__PURE__*/(0, _reactDom.createPortal)(getListMarkUp(), lc);
440
309
  };
441
-
442
- var getSortedOptions = function getSortedOptions(data) {
443
- var newData = (0, _toConsumableArray2.default)(data);
444
-
310
+ const getSortedOptions = data => {
311
+ let newData = [...data];
445
312
  if (sortAlphabetical) {
446
- var openModalOption = newData.filter(function (_ref4) {
447
- var value = _ref4.value;
313
+ const openModalOption = newData.filter(_ref2 => {
314
+ let {
315
+ value
316
+ } = _ref2;
448
317
  return value === 'open_modal';
449
318
  });
450
- var emptyOption = newData.filter(function (_ref5) {
451
- var value = _ref5.value;
319
+ const emptyOption = newData.filter(_ref3 => {
320
+ let {
321
+ value
322
+ } = _ref3;
452
323
  return value === '';
453
324
  });
454
- var restOfOptions = newData.filter(function (_ref6) {
455
- var value = _ref6.value;
325
+ const restOfOptions = newData.filter(_ref4 => {
326
+ let {
327
+ value
328
+ } = _ref4;
456
329
  return value !== 'open_modal' && value !== '';
457
330
  }).sort(_utils.compareAlphabetical);
458
- newData = [].concat((0, _toConsumableArray2.default)(openModalOption), (0, _toConsumableArray2.default)(emptyOption), (0, _toConsumableArray2.default)(restOfOptions)).map(function (item) {
331
+ newData = [...openModalOption, ...emptyOption, ...restOfOptions].map(item => {
459
332
  if (item !== null && item !== void 0 && item.items) {
460
- item.items = (0, _toConsumableArray2.default)(item.items).sort(_utils.compareAlphabetical);
333
+ item.items = [...item.items].sort(_utils.compareAlphabetical);
461
334
  }
462
-
463
335
  return item;
464
336
  });
465
337
  }
466
-
467
338
  return newData;
468
339
  };
469
-
470
- var getListMarkUp = function getListMarkUp() {
471
- var _cn3, _cn4, _getSortedOptions;
472
-
340
+ const getListMarkUp = () => {
341
+ var _getSortedOptions;
473
342
  return /*#__PURE__*/_react.default.createElement("div", {
474
343
  className: (0, _classnames.default)("".concat(RC, "__container-wrapper")),
475
344
  ref: wrapperRef,
476
- onClick: isMobile ? onWrapperClick : function () {}
345
+ onClick: isMobile ? onWrapperClick : () => {}
477
346
  }, /*#__PURE__*/_react.default.createElement("div", {
478
- className: (0, _classnames.default)("".concat(RC, "__list-wrapper"), (_cn3 = {}, (0, _defineProperty2.default)(_cn3, "".concat(RC, "__list-wrapper--fixed-height"), isFixedMaxHeight), (0, _defineProperty2.default)(_cn3, "".concat(RC, "__list-wrapper--with-bottom-shadow"), isScrollableList && isMobile), (0, _defineProperty2.default)(_cn3, "".concat(RC, "__list-wrapper--with-bottom-shadow-hidden"), scrollTop === scrollHeight), _cn3)),
347
+ className: (0, _classnames.default)("".concat(RC, "__list-wrapper"), {
348
+ ["".concat(RC, "__list-wrapper--fixed-height")]: isFixedMaxHeight,
349
+ ["".concat(RC, "__list-wrapper--with-bottom-shadow")]: isScrollableList && isMobile,
350
+ ["".concat(RC, "__list-wrapper--with-bottom-shadow-hidden")]: scrollTop === scrollHeight
351
+ }),
479
352
  ref: dropdownListWrapperRef
480
353
  }, isMobile && /*#__PURE__*/_react.default.createElement("div", {
481
- className: (0, _classnames.default)("".concat(RC, "__list-header"), (_cn4 = {}, (0, _defineProperty2.default)(_cn4, "".concat(RC, "__list-header-with-shadow"), isScrollableList && isMobile), (0, _defineProperty2.default)(_cn4, "".concat(RC, "__list-header-with-shadow-hidden"), scrollTop === 0), _cn4))
354
+ className: (0, _classnames.default)("".concat(RC, "__list-header"), {
355
+ ["".concat(RC, "__list-header-with-shadow")]: isScrollableList && isMobile,
356
+ ["".concat(RC, "__list-header-with-shadow-hidden")]: scrollTop === 0
357
+ })
482
358
  }, /*#__PURE__*/_react.default.createElement("div", {
483
359
  className: (0, _classnames.default)("".concat(RC, "__list-header-row"))
484
360
  }, /*#__PURE__*/_react.default.createElement("div", {
485
361
  className: (0, _classnames.default)("".concat(RC, "__list-label"))
486
362
  }, label), /*#__PURE__*/_react.default.createElement("div", {
487
363
  className: (0, _classnames.default)("".concat(RC, "__list-close-icon")),
488
- onClick: function onClick() {
489
- return setIsOpen(false);
490
- }
364
+ onClick: () => setIsOpen(false)
491
365
  }, /*#__PURE__*/_react.default.createElement(_reactFeather.X, {
492
- onClick: function onClick() {
493
- return setIsOpen(false);
494
- }
366
+ onClick: () => setIsOpen(false)
495
367
  }))), isSearchable && /*#__PURE__*/_react.default.createElement("div", {
496
368
  className: (0, _classnames.default)("".concat(RC, "__list-header-row"))
497
369
  }, /*#__PURE__*/_react.default.createElement(_Input.default, (0, _extends2.default)({
498
370
  ref: searchInputRef,
499
371
  className: "".concat(RC, "__input"),
500
372
  value: searchValue !== null && searchValue !== void 0 ? searchValue : selectedLabel,
501
- onChange: function onChange(v) {
502
- return onSearchHandler(v);
503
- },
373
+ onChange: v => onSearchHandler(v),
504
374
  placeholder: placeholder || 'Search',
505
375
  withDelete: true,
506
- onFocus: function onFocus() {
507
- return setIsSearchInputFocused(true);
508
- },
509
- onBlur: function onBlur() {
510
- return setIsSearchInputFocused(false);
511
- },
512
- onMouseDown: function onMouseDown() {
376
+ onFocus: () => setIsSearchInputFocused(true),
377
+ onBlur: () => setIsSearchInputFocused(false),
378
+ onMouseDown: () => {
513
379
  if (!isOpen) {
514
380
  setIsSearchInputFocused(true);
515
381
  setIsOpen(true);
516
382
  }
517
383
  }
518
384
  }, attributesOfNativeInput)))), /*#__PURE__*/_react.default.createElement("div", {
519
- className: (0, _classnames.default)("".concat(RC, "__list"), (0, _defineProperty2.default)({}, "".concat(RC, "__list-top"), isListTop)),
385
+ className: (0, _classnames.default)("".concat(RC, "__list"), {
386
+ ["".concat(RC, "__list-top")]: isListTop
387
+ }),
520
388
  ref: dropdownListRef
521
- }, (_getSortedOptions = getSortedOptions(depend.options)) === null || _getSortedOptions === void 0 ? void 0 : _getSortedOptions.map(function (option) {
389
+ }, (_getSortedOptions = getSortedOptions(depend.options)) === null || _getSortedOptions === void 0 ? void 0 : _getSortedOptions.map(option => {
522
390
  var _option$items;
523
-
524
391
  if (option !== null && option !== void 0 && (_option$items = option.items) !== null && _option$items !== void 0 && _option$items.length) {
525
392
  if (!isSearchable || !isSearchChanged) {
526
393
  return filteredOptionList(option);
527
394
  } else {
528
395
  var _option$items2;
529
-
530
- var items = (_option$items2 = option.items) === null || _option$items2 === void 0 ? void 0 : _option$items2.slice().filter(function (el) {
396
+ const items = (_option$items2 = option.items) === null || _option$items2 === void 0 ? void 0 : _option$items2.slice().filter(el => {
531
397
  var _el$label2;
532
-
533
- return (el === null || el === void 0 ? void 0 : (_el$label2 = el.label) === null || _el$label2 === void 0 ? void 0 : _el$label2.toLowerCase().includes((searchValue === null || searchValue === void 0 ? void 0 : searchValue.toLowerCase()) || '')) || !(el !== null && el !== void 0 && el.value) || (el === null || el === void 0 ? void 0 : el.value) === '';
398
+ return (el === null || el === void 0 || (_el$label2 = el.label) === null || _el$label2 === void 0 ? void 0 : _el$label2.toLowerCase().includes((searchValue === null || searchValue === void 0 ? void 0 : searchValue.toLowerCase()) || '')) || !(el !== null && el !== void 0 && el.value) || (el === null || el === void 0 ? void 0 : el.value) === '';
399
+ });
400
+ if (items !== null && items !== void 0 && items.length) return filteredOptionList({
401
+ ...option,
402
+ items
534
403
  });
535
- if (items !== null && items !== void 0 && items.length) return filteredOptionList(_objectSpread(_objectSpread({}, option), {}, {
536
- items: items
537
- }));
538
404
  return null;
539
405
  }
540
406
  } else {
541
407
  var _option$label;
542
-
543
408
  if (!isSearchable || !isSearchChanged || option !== null && option !== void 0 && (_option$label = option.label) !== null && _option$label !== void 0 && _option$label.toLowerCase().includes((searchValue === null || searchValue === void 0 ? void 0 : searchValue.toLowerCase()) || '') || !(option !== null && option !== void 0 && option.value) || (option === null || option === void 0 ? void 0 : option.value) === '') {
544
409
  return getMarkupForElement(option);
545
410
  }
@@ -548,23 +413,18 @@ var Dropdown = function Dropdown(_ref) {
548
413
  className: "".concat(RC, "__list-item ").concat(RC, "__list-item--no-options")
549
414
  }, noOptionsText), disabled && isOpen && /*#__PURE__*/_react.default.createElement(_DropdownLoader.default, null))));
550
415
  };
551
-
552
- var toggleList = function toggleList(e) {
553
- e === null || e === void 0 ? void 0 : e.stopPropagation();
554
- setIsOpen(function (isOpen) {
555
- return !isOpen;
556
- });
416
+ const toggleList = e => {
417
+ e === null || e === void 0 || e.stopPropagation();
418
+ setIsOpen(isOpen => !isOpen);
557
419
  };
558
-
559
- var closeList = isOpen ? handleClickOutside : function () {};
560
- (0, _react.useEffect)(function () {
420
+ const closeList = isOpen ? handleClickOutside : () => {};
421
+ (0, _react.useEffect)(() => {
561
422
  if (!isDoNotPullOutListOfMainContainer || dropdownRef.current) {
562
423
  initListContainer();
563
424
  }
564
425
  }, [isDoNotPullOutListOfMainContainer, dropdownRef.current]);
565
- (0, _react.useLayoutEffect)(function () {
426
+ (0, _react.useLayoutEffect)(() => {
566
427
  var _getListContainer3;
567
-
568
428
  if (!isMobile) {
569
429
  window.addEventListener('resize', setListContainerStyles);
570
430
  window.addEventListener('mousewheel', closeList);
@@ -576,118 +436,96 @@ var Dropdown = function Dropdown(_ref) {
576
436
  window.removeEventListener('scroll', closeList);
577
437
  window.removeEventListener('touchmove', closeList);
578
438
  }
579
-
580
- (_getListContainer3 = getListContainer()) === null || _getListContainer3 === void 0 ? void 0 : _getListContainer3.addEventListener('click', closeList);
581
- return function () {
439
+ (_getListContainer3 = getListContainer()) === null || _getListContainer3 === void 0 || _getListContainer3.addEventListener('click', closeList);
440
+ return () => {
582
441
  var _getListContainer4;
583
-
584
442
  window.removeEventListener('resize', setListContainerStyles);
585
443
  window.removeEventListener('mousewheel', closeList);
586
444
  window.removeEventListener('scroll', closeList);
587
445
  window.removeEventListener('touchmove', closeList);
588
- (_getListContainer4 = getListContainer()) === null || _getListContainer4 === void 0 ? void 0 : _getListContainer4.removeEventListener('click', closeList);
446
+ (_getListContainer4 = getListContainer()) === null || _getListContainer4 === void 0 || _getListContainer4.removeEventListener('click', closeList);
589
447
  };
590
448
  }, [getListContainer]);
591
- (0, _react.useLayoutEffect)(function () {
449
+ (0, _react.useLayoutEffect)(() => {
592
450
  setListContainerStyles();
593
- }, [isOpen, searchValue, isMobile, options, dropdownListWrapperRef === null || dropdownListWrapperRef === void 0 ? void 0 : (_dropdownListWrapperR4 = dropdownListWrapperRef.current) === null || _dropdownListWrapperR4 === void 0 ? void 0 : (_dropdownListWrapperR5 = _dropdownListWrapperR4.getBoundingClientRect()) === null || _dropdownListWrapperR5 === void 0 ? void 0 : _dropdownListWrapperR5.height]);
594
- (0, _react.useEffect)(function () {
451
+ }, [isOpen, searchValue, isMobile, options, dropdownListWrapperRef === null || dropdownListWrapperRef === void 0 || (_dropdownListWrapperR3 = dropdownListWrapperRef.current) === null || _dropdownListWrapperR3 === void 0 || (_dropdownListWrapperR3 = _dropdownListWrapperR3.getBoundingClientRect()) === null || _dropdownListWrapperR3 === void 0 ? void 0 : _dropdownListWrapperR3.height]);
452
+ (0, _react.useEffect)(() => {
595
453
  document.addEventListener('click', handleClickOutside, true);
596
- return function () {
597
- return document.removeEventListener('click', handleClickOutside, true);
598
- };
454
+ return () => document.removeEventListener('click', handleClickOutside, true);
599
455
  }, [value]);
600
- (0, _react.useEffect)(function () {
456
+ (0, _react.useEffect)(() => {
601
457
  if (!isOpen) {
602
458
  setIsSearchChanged(false);
603
459
  }
604
-
605
- if (scrollReactionObj && (0, _typeof2.default)(scrollReactionObj) === 'object' && isOpen && dropdownListRef && dropdownListRef.current) {
460
+ if (scrollReactionObj && typeof scrollReactionObj === 'object' && isOpen && dropdownListRef && dropdownListRef.current) {
606
461
  dropdownListRef.current.addEventListener('scroll', doScrollCallback);
607
462
  }
608
-
609
- return function () {
610
- if (scrollReactionObj && (0, _typeof2.default)(scrollReactionObj) === 'object') removeEventListener('scroll', doScrollCallback);
463
+ return () => {
464
+ if (scrollReactionObj && typeof scrollReactionObj === 'object') removeEventListener('scroll', doScrollCallback);
611
465
  };
612
466
  }, [isOpen, dropdownListRef]);
613
- (0, _react.useEffect)(function () {
467
+ (0, _react.useEffect)(() => {
614
468
  if (!searchValue && isSearchInputFocused) {
615
469
  setSearchValue(selectedLabel);
616
- setTimeout(function () {
617
- return searchInputRef.current.select();
618
- }, 1);
470
+ setTimeout(() => searchInputRef.current.select(), 1);
619
471
  }
620
-
621
472
  if (!isSearchInputFocused && !isOpen) {
622
473
  setSearchValue(null);
623
474
  }
624
475
  }, [isSearchInputFocused]);
625
- (0, _react.useEffect)(function () {
476
+ (0, _react.useEffect)(() => {
626
477
  var _searchInputRef$curre;
627
-
628
- if (isOpen && !isSearchInputFocused && searchInputRef !== null && searchInputRef !== void 0 && searchInputRef.current && !isMobile) searchInputRef === null || searchInputRef === void 0 ? void 0 : (_searchInputRef$curre = searchInputRef.current) === null || _searchInputRef$curre === void 0 ? void 0 : _searchInputRef$curre.focus();
629
-
478
+ if (isOpen && !isSearchInputFocused && searchInputRef !== null && searchInputRef !== void 0 && searchInputRef.current && !isMobile) searchInputRef === null || searchInputRef === void 0 || (_searchInputRef$curre = searchInputRef.current) === null || _searchInputRef$curre === void 0 || _searchInputRef$curre.focus();
630
479
  if (isOpen) {
631
480
  var _getListContainer5;
632
-
633
- (_getListContainer5 = getListContainer()) === null || _getListContainer5 === void 0 ? void 0 : _getListContainer5.classList.add('dropdown__container--opened');
481
+ (_getListContainer5 = getListContainer()) === null || _getListContainer5 === void 0 || _getListContainer5.classList.add('dropdown__container--opened');
634
482
  } else {
635
483
  var _getListContainer6;
636
-
637
- (_getListContainer6 = getListContainer()) === null || _getListContainer6 === void 0 ? void 0 : _getListContainer6.classList.remove('dropdown__container--opened');
484
+ (_getListContainer6 = getListContainer()) === null || _getListContainer6 === void 0 || _getListContainer6.classList.remove('dropdown__container--opened');
638
485
  }
639
-
640
486
  if (!isOpen && isMobile) {
641
487
  setSearchValue(null);
642
488
  }
643
489
  }, [isOpen]);
644
- (0, _react.useEffect)(function () {
490
+ (0, _react.useEffect)(() => {
645
491
  if (isOpen && isMobile && dropdownListRef !== null && dropdownListRef !== void 0 && dropdownListRef.current && !searchValue) {
646
492
  var _dropdownListRef$curr, _dropdownListRef$curr2, _dropdownListRef$curr3, _dropdownListRef$curr4;
647
-
648
- 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));
649
- setIsFixedMaxHeight(isScrollableList || (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));
493
+ setIsScrollableList((dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr = dropdownListRef.current) === null || _dropdownListRef$curr === void 0 ? void 0 : _dropdownListRef$curr.scrollHeight) > (dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr2 = dropdownListRef.current) === null || _dropdownListRef$curr2 === void 0 ? void 0 : _dropdownListRef$curr2.clientHeight));
494
+ setIsFixedMaxHeight(isScrollableList || (dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr3 = dropdownListRef.current) === null || _dropdownListRef$curr3 === void 0 ? void 0 : _dropdownListRef$curr3.scrollHeight) > (dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr4 = dropdownListRef.current) === null || _dropdownListRef$curr4 === void 0 ? void 0 : _dropdownListRef$curr4.clientHeight));
650
495
  }
651
- }, [isOpen, isMobile, isScrollableList, dropdownListRef === null || dropdownListRef === void 0 ? void 0 : dropdownListRef.current, 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]);
652
- (0, _react.useEffect)(function () {
653
- var setScrollTopValue = function setScrollTopValue(e) {
496
+ }, [isOpen, isMobile, isScrollableList, dropdownListRef === null || dropdownListRef === void 0 ? void 0 : dropdownListRef.current, dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr5 = dropdownListRef.current) === null || _dropdownListRef$curr5 === void 0 ? void 0 : _dropdownListRef$curr5.scrollHeight, dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr6 = dropdownListRef.current) === null || _dropdownListRef$curr6 === void 0 ? void 0 : _dropdownListRef$curr6.clientHeight]);
497
+ (0, _react.useEffect)(() => {
498
+ const setScrollTopValue = e => {
654
499
  setScrollTop(parseInt(e.target.scrollTop));
655
500
  };
656
-
657
501
  if (isOpen && isMobile && dropdownListRef !== null && dropdownListRef !== void 0 && dropdownListRef.current) {
658
502
  var _dropdownListRef$curr7;
659
-
660
- dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr7 = dropdownListRef.current) === null || _dropdownListRef$curr7 === void 0 ? void 0 : _dropdownListRef$curr7.addEventListener('scroll', setScrollTopValue);
503
+ dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr7 = dropdownListRef.current) === null || _dropdownListRef$curr7 === void 0 || _dropdownListRef$curr7.addEventListener('scroll', setScrollTopValue);
661
504
  }
662
-
663
- return function () {
505
+ return () => {
664
506
  var _dropdownListRef$curr8;
665
-
666
- dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr8 = dropdownListRef.current) === null || _dropdownListRef$curr8 === void 0 ? void 0 : _dropdownListRef$curr8.removeEventListener('scroll', setScrollTopValue);
507
+ dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr8 = dropdownListRef.current) === null || _dropdownListRef$curr8 === void 0 || _dropdownListRef$curr8.removeEventListener('scroll', setScrollTopValue);
667
508
  };
668
509
  }, [isOpen, isMobile, dropdownListRef === null || dropdownListRef === void 0 ? void 0 : dropdownListRef.current]);
669
- (0, _react.useEffect)(function () {
510
+ (0, _react.useEffect)(() => {
670
511
  if (dropdownListRef !== null && dropdownListRef !== void 0 && dropdownListRef.current) {
671
512
  var _dropdownListRef$curr9, _dropdownListRef$curr10;
672
-
673
- setScrollHeight(parseInt((dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr9 = dropdownListRef.current) === null || _dropdownListRef$curr9 === void 0 ? void 0 : _dropdownListRef$curr9.scrollHeight) - (dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr10 = dropdownListRef.current) === null || _dropdownListRef$curr10 === void 0 ? void 0 : _dropdownListRef$curr10.clientHeight)));
513
+ setScrollHeight(parseInt((dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr9 = dropdownListRef.current) === null || _dropdownListRef$curr9 === void 0 ? void 0 : _dropdownListRef$curr9.scrollHeight) - (dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr10 = dropdownListRef.current) === null || _dropdownListRef$curr10 === void 0 ? void 0 : _dropdownListRef$curr10.clientHeight)));
674
514
  }
675
515
  }, [scrollTop, dropdownListRef === null || dropdownListRef === void 0 ? void 0 : dropdownListRef.current]);
676
- (0, _react.useEffect)(function () {
677
- return function () {
516
+ (0, _react.useEffect)(() => {
517
+ return () => {
678
518
  var _getListContainer7, _getListContainerWrap;
679
-
680
- (_getListContainer7 = getListContainer()) === null || _getListContainer7 === void 0 ? void 0 : _getListContainer7.remove();
681
- (_getListContainerWrap = getListContainerWrapper()) === null || _getListContainerWrap === void 0 ? void 0 : _getListContainerWrap.remove();
519
+ (_getListContainer7 = getListContainer()) === null || _getListContainer7 === void 0 || _getListContainer7.remove();
520
+ (_getListContainerWrap = getListContainerWrapper()) === null || _getListContainerWrap === void 0 || _getListContainerWrap.remove();
682
521
  };
683
522
  }, []);
684
- var postfixText = selectedLabel && ((_filteredOptions$find = filteredOptions.find(function (option) {
685
- return option.value === value;
686
- })) === null || _filteredOptions$find === void 0 ? void 0 : _filteredOptions$find.postfix) || null;
523
+ const postfixText = selectedLabel && ((_filteredOptions$find = filteredOptions.find(option => option.value === value)) === null || _filteredOptions$find === void 0 ? void 0 : _filteredOptions$find.postfix) || null;
687
524
  return /*#__PURE__*/_react.default.createElement("div", {
688
- className: (0, _classnames.default)(RC, className, (0, _defineProperty2.default)({
689
- disabled: disabled
690
- }, "".concat(RC, "-mobile"), isMobile)),
525
+ className: (0, _classnames.default)(RC, className, {
526
+ disabled,
527
+ ["".concat(RC, "-mobile")]: isMobile
528
+ }),
691
529
  ref: dropdownRef,
692
530
  onKeyDown: onKeyDown,
693
531
  onKeyUp: onKeyUp
@@ -697,22 +535,16 @@ var Dropdown = function Dropdown(_ref) {
697
535
  onClick: toggleList,
698
536
  onKeyDown: onKeyDown,
699
537
  onKeyUp: onKeyUp,
700
- tabIndex: tabIndex === null || tabIndex === void 0 ? void 0 : (_tabIndex$toString = tabIndex.toString) === null || _tabIndex$toString === void 0 ? void 0 : _tabIndex$toString.call(tabIndex)
538
+ tabIndex: tabIndex === null || tabIndex === void 0 || (_tabIndex$toString = tabIndex.toString) === null || _tabIndex$toString === void 0 ? void 0 : _tabIndex$toString.call(tabIndex)
701
539
  }, customTrigger || /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, isSearchable && !isMobile ? /*#__PURE__*/_react.default.createElement("input", (0, _extends2.default)({
702
540
  ref: searchInputRef,
703
541
  className: "".concat(RC, "__input"),
704
542
  value: isOpen ? searchValue !== null && searchValue !== void 0 ? searchValue : '' : selectedLabel || '',
705
- onChange: function onChange(e) {
706
- return onSearchHandler(e.target.value);
707
- },
543
+ onChange: e => onSearchHandler(e.target.value),
708
544
  placeholder: placeholder,
709
- onFocus: function onFocus() {
710
- return setIsSearchInputFocused(true);
711
- },
712
- onBlur: function onBlur() {
713
- return setIsSearchInputFocused(false);
714
- },
715
- onMouseDown: function onMouseDown() {
545
+ onFocus: () => setIsSearchInputFocused(true),
546
+ onBlur: () => setIsSearchInputFocused(false),
547
+ onMouseDown: () => {
716
548
  if (!isOpen) {
717
549
  setIsSearchInputFocused(true);
718
550
  setIsOpen(true);
@@ -725,12 +557,12 @@ var Dropdown = function Dropdown(_ref) {
725
557
  }, selectedLabel || placeholder), postfixText && /*#__PURE__*/_react.default.createElement("span", {
726
558
  className: "dropdown__list-item-postfix"
727
559
  }, postfixText)), /*#__PURE__*/_react.default.createElement("span", {
728
- className: (0, _classnames.default)("".concat(RC, "__arrow"), (0, _defineProperty2.default)({}, "".concat(RC, "__arrow_active"), isOpen)),
560
+ className: (0, _classnames.default)("".concat(RC, "__arrow"), {
561
+ ["".concat(RC, "__arrow_active")]: isOpen
562
+ }),
729
563
  onClick: toggleList
730
564
  }, isMobile ? /*#__PURE__*/_react.default.createElement(_reactFeather.Code, {
731
565
  className: "mobile-icon"
732
566
  }) : isOpen ? /*#__PURE__*/_react.default.createElement(_reactFeather.ChevronUp, null) : /*#__PURE__*/_react.default.createElement(_reactFeather.ChevronDown, null)))), isOpen && renderListContainer());
733
567
  };
734
-
735
- var _default = Dropdown;
736
- exports.default = _default;
568
+ var _default = exports.default = Dropdown;