intelicoreact 1.3.21 → 1.3.23

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