intelicoreact 1.3.38 → 1.3.39

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