intelicoreact 1.4.83 → 1.4.84

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 (272) hide show
  1. package/dist/Atomic/FormElements/ActionAlert/ActionAlert.js +14 -22
  2. package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.js +14 -22
  3. package/dist/Atomic/FormElements/Calendar/Calendar.js +67 -122
  4. package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.js +27 -36
  5. package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.js +23 -39
  6. package/dist/Atomic/FormElements/Datepicker/Datepicker.js +110 -246
  7. package/dist/Atomic/FormElements/Datepicker/components/Calendar.js +44 -85
  8. package/dist/Atomic/FormElements/Dropdown/Dropdown.js +266 -430
  9. package/dist/Atomic/FormElements/Dropdown/components/DropdownLoader.js +5 -9
  10. package/dist/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.js +161 -283
  11. package/dist/Atomic/FormElements/FileLoader/FileLoader.js +39 -64
  12. package/dist/Atomic/FormElements/FileLoader/partial/LoadZone.js +51 -132
  13. package/dist/Atomic/FormElements/FileLoader/partial/LoadedContent.js +34 -73
  14. package/dist/Atomic/FormElements/FileLoaderDescription/FileLoaderDescription.js +79 -138
  15. package/dist/Atomic/FormElements/FileLoaderLocal/FileLoaderLocal.js +55 -77
  16. package/dist/Atomic/FormElements/FileLoaderLocalGroup/FileLoaderLocalGroup.js +75 -126
  17. package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN.js +33 -83
  18. package/dist/Atomic/FormElements/Input/Input.js +160 -256
  19. package/dist/Atomic/FormElements/InputCalendar/InputCalendar.js +48 -102
  20. package/dist/Atomic/FormElements/InputColor/InputColor.js +26 -41
  21. package/dist/Atomic/FormElements/InputCurrency/InputCurrency.js +38 -76
  22. package/dist/Atomic/FormElements/InputDateRange/InputDateRange.js +109 -177
  23. package/dist/Atomic/FormElements/InputDateRange/components/DateInput.js +32 -57
  24. package/dist/Atomic/FormElements/InputDateRange/components/Datepicker.js +184 -302
  25. package/dist/Atomic/FormElements/InputDateRange/components/OpenedPart.js +85 -157
  26. package/dist/Atomic/FormElements/InputDateRange/components/SelectItem.js +11 -16
  27. package/dist/Atomic/FormElements/InputDateRange/dependencies.js +77 -194
  28. package/dist/Atomic/FormElements/InputLink/InputLink.js +32 -58
  29. package/dist/Atomic/FormElements/InputMask/InputCarretPosition.js +8 -12
  30. package/dist/Atomic/FormElements/InputMask/InputMask.js +554 -964
  31. package/dist/Atomic/FormElements/InputMask/config.js +1 -1
  32. package/dist/Atomic/FormElements/InputMask/functions.js +17 -43
  33. package/dist/Atomic/FormElements/InputMask2/InputMask2.js +268 -404
  34. package/dist/Atomic/FormElements/InputMask2/config.js +1 -1
  35. package/dist/Atomic/FormElements/InputMask2/functions.js +17 -43
  36. package/dist/Atomic/FormElements/InputMask3/InputMask3.js +299 -459
  37. package/dist/Atomic/FormElements/InputMask3/config.js +1 -1
  38. package/dist/Atomic/FormElements/InputMask3/functions.js +17 -43
  39. package/dist/Atomic/FormElements/InputWithAction/InputWithAction.js +51 -113
  40. package/dist/Atomic/FormElements/InputsRow/InputsRow.js +64 -118
  41. package/dist/Atomic/FormElements/Label/Label.js +14 -24
  42. package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.js +217 -349
  43. package/dist/Atomic/FormElements/MultiSelect/MultiSelect.js +25 -47
  44. package/dist/Atomic/FormElements/NumericInput/NumericInput.js +133 -207
  45. package/dist/Atomic/FormElements/RadioGroup/RadioGroup.js +29 -61
  46. package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.js +20 -42
  47. package/dist/Atomic/FormElements/RadioInput/RadioInput.js +22 -33
  48. package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.js +20 -43
  49. package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.js +54 -101
  50. package/dist/Atomic/FormElements/RangeInputs/RangeInputs.js +59 -102
  51. package/dist/Atomic/FormElements/RangeList/RangeList.js +89 -150
  52. package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.js +23 -29
  53. package/dist/Atomic/FormElements/RangeSlider/RangeSlider.js +148 -326
  54. package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.js +389 -588
  55. package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.js +14 -24
  56. package/dist/Atomic/FormElements/Switcher/Switcher.js +24 -29
  57. package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.js +23 -41
  58. package/dist/Atomic/FormElements/SwitcherHide/SwitcherHide.js +20 -32
  59. package/dist/Atomic/FormElements/SwitcherRadio/SwitcherRadio.js +32 -55
  60. package/dist/Atomic/FormElements/SwitcherRange/SwitcherRange.js +22 -42
  61. package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.js +23 -33
  62. package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.js +51 -120
  63. package/dist/Atomic/FormElements/SwitcherTagsDropdown/partial/States.js +2 -3
  64. package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.js +23 -46
  65. package/dist/Atomic/FormElements/TagListToDropdown/TagListToDropdown.js +47 -98
  66. package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js +485 -713
  67. package/dist/Atomic/FormElements/Text/Text.js +47 -53
  68. package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.js +21 -31
  69. package/dist/Atomic/FormElements/Textarea/Textarea.js +31 -47
  70. package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.js +68 -128
  71. package/dist/Atomic/FormElements/TieredCheckboxes/partial/AccordionWithCheckbox.js +25 -36
  72. package/dist/Atomic/FormElements/TimeRange/TimeRange.js +33 -70
  73. package/dist/Atomic/FormElements/UserContacts/UserContacts.js +58 -123
  74. package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.js +48 -80
  75. package/dist/Atomic/FormElements/VariantsListRadio/partials/VariantsListRadioItem.js +32 -42
  76. package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.js +40 -60
  77. package/dist/Atomic/FormElements/WidgetPseudoTable/partial/constructor.js +2 -3
  78. package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.js +50 -69
  79. package/dist/Atomic/FormElements/WidgetWithSwitchableRows/partial/constructor.js +3 -3
  80. package/dist/Atomic/Layout/Header/Header.js +21 -48
  81. package/dist/Atomic/Layout/MainMenu/MainMenu.js +35 -77
  82. package/dist/Atomic/Layout/Spinner/Spinner.js +8 -14
  83. package/dist/Atomic/UI/Accordion/Accordion.js +18 -48
  84. package/dist/Atomic/UI/Accordion/AccordionItem.js +35 -60
  85. package/dist/Atomic/UI/AccordionTable/AccordionTable.js +48 -104
  86. package/dist/Atomic/UI/AccordionText/AccordionText.js +21 -54
  87. package/dist/Atomic/UI/AdvancedTag/AdvTag.js +47 -92
  88. package/dist/Atomic/UI/AdvancedTag/AdvancedTags.js +22 -50
  89. package/dist/Atomic/UI/Alert/Alert.js +22 -51
  90. package/dist/Atomic/UI/Arrow/Arrow.js +15 -35
  91. package/dist/Atomic/UI/Box/Box.js +14 -21
  92. package/dist/Atomic/UI/Button/Button.js +26 -35
  93. package/dist/Atomic/UI/ButtonsBar/ButtonsBar.js +22 -31
  94. package/dist/Atomic/UI/Chart/Chart.js +45 -86
  95. package/dist/Atomic/UI/Chart/partial/Chart.constants.js +14 -24
  96. package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.js +13 -22
  97. package/dist/Atomic/UI/Chart/partial/datasetSetters.js +68 -113
  98. package/dist/Atomic/UI/Chart/partial/optionsConstructor.js +158 -140
  99. package/dist/Atomic/UI/Chart/partial/optionsSetters.js +26 -42
  100. package/dist/Atomic/UI/Chart/partial/utils.js +20 -48
  101. package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.js +22 -42
  102. package/dist/Atomic/UI/DateTime/DateTime.js +23 -38
  103. package/dist/Atomic/UI/DebugContainer/DebugContainer.js +13 -37
  104. package/dist/Atomic/UI/DebugContainer/useDebugContainer.js +5 -21
  105. package/dist/Atomic/UI/DoubleString/DoubleString.js +34 -63
  106. package/dist/Atomic/UI/DynamicIcon/DynamicIcon.js +15 -63
  107. package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.js +62 -157
  108. package/dist/Atomic/UI/ExampleChartIntegration/partial/utils.js +47 -110
  109. package/dist/Atomic/UI/Hint/Hint.js +67 -122
  110. package/dist/Atomic/UI/Hint/partial/_utils.js +52 -0
  111. package/dist/Atomic/UI/Hint/partials/_utils.js +14 -29
  112. package/dist/Atomic/UI/Modal/Modal.js +147 -184
  113. package/dist/Atomic/UI/Modal/ModalHOC.js +15 -26
  114. package/dist/Atomic/UI/Modal/partials/ModalFooter.js +7 -12
  115. package/dist/Atomic/UI/Modal/partials/ModalTitle.js +17 -21
  116. package/dist/Atomic/UI/Modal/partials/useMobileModal.js +99 -161
  117. package/dist/Atomic/UI/MonoAccordion/MonoAccordion.js +32 -62
  118. package/dist/Atomic/UI/NavLine/NavLine.js +120 -211
  119. package/dist/Atomic/UI/NavLine/Tabs.js +2 -3
  120. package/dist/Atomic/UI/PageTitle/PageTitle.js +13 -17
  121. package/dist/Atomic/UI/PieChart/PieChart.js +11 -21
  122. package/dist/Atomic/UI/Price/Price.js +10 -13
  123. package/dist/Atomic/UI/PriceRange/PriceRange.js +7 -11
  124. package/dist/Atomic/UI/ProgressLine/ProgressLine.js +28 -58
  125. package/dist/Atomic/UI/Status/Status.js +19 -30
  126. package/dist/Atomic/UI/Table/Partials/TdCell.js +28 -71
  127. package/dist/Atomic/UI/Table/Partials/TdHeader.js +7 -16
  128. package/dist/Atomic/UI/Table/Partials/TdRow.js +29 -65
  129. package/dist/Atomic/UI/Table/Partials/TdTitle.js +16 -40
  130. package/dist/Atomic/UI/Table/Table.js +27 -47
  131. package/dist/Atomic/UI/Table/TdTypes/TdActions.js +18 -48
  132. package/dist/Atomic/UI/Table/TdTypes/TdPriority.js +9 -19
  133. package/dist/Atomic/UI/Table/TdTypes/TdRange.js +5 -6
  134. package/dist/Atomic/UI/Table/TdTypes/TdWeight.js +22 -39
  135. package/dist/Atomic/UI/Tag/Tag.js +59 -94
  136. package/dist/Atomic/UI/TagList/TagList.js +81 -144
  137. package/dist/Atomic/UI/UserBox/UserBox.js +14 -26
  138. package/dist/Atomic/UI/WizardStepper/constructor.js +7 -15
  139. package/dist/Atomic/UI/WizardStepper/index.js +1 -5
  140. package/dist/Atomic/UI/WizardStepper/ui/StateIcon/StateIcon.js +20 -26
  141. package/dist/Atomic/UI/WizardStepper/ui/StateIcon/index.js +1 -4
  142. package/dist/Atomic/UI/WizardStepper/ui/StepRow/StepRow.js +26 -39
  143. package/dist/Atomic/UI/WizardStepper/ui/StepRow/index.js +1 -5
  144. package/dist/Atomic/UI/WizardStepper/ui/StepWrapper/StepWrapper.js +23 -42
  145. package/dist/Atomic/UI/WizardStepper/ui/StepWrapper/index.js +1 -5
  146. package/dist/Atomic/UI/WizardStepper/ui/icons.js +40 -49
  147. package/dist/Atomic/UI/WizardStepper/ui/index.js +1 -5
  148. package/dist/Classes/AbortableFetch.js +283 -422
  149. package/dist/Classes/AnimatedHandler.js +44 -56
  150. package/dist/Classes/RESTAPI/index.js +158 -441
  151. package/dist/Classes/RESTAPI/partials/AbortableFetch.js +290 -428
  152. package/dist/Classes/RESTAPI/partials/ApiBase.js +24 -67
  153. package/dist/Classes/RESTAPI/partials/ApiRequestCreators.js +83 -353
  154. package/dist/Classes/RESTAPI/partials/ApiUtils.js +161 -403
  155. package/dist/Classes/RESTAPI/partials/CredentialsProcessing.js +159 -400
  156. package/dist/Classes/RESTAPI/partials/Utils.js +81 -135
  157. package/dist/Classes/RESTAPI/partials/_outerDependencies.js +2 -6
  158. package/dist/Classes/RESTAPI/partials/_utils.js +103 -398
  159. package/dist/Constants/index.constants.js +8 -15
  160. package/dist/Functions/Portal.js +14 -33
  161. package/dist/Functions/customEventListener.js +9 -24
  162. package/dist/Functions/fieldValueFormatters.js +147 -209
  163. package/dist/Functions/hooks/useFormFieldsChangesManager.js +75 -137
  164. package/dist/Functions/locale/createTranslator.js +13 -28
  165. package/dist/Functions/operations.js +35 -49
  166. package/dist/Functions/presets/inputMaskPresets.js +25 -27
  167. package/dist/Functions/presets/inputPresets.js +19 -22
  168. package/dist/Functions/presets/mobileKeyboardTypesPresets.js +7 -9
  169. package/dist/Functions/schemas.js +6 -15
  170. package/dist/Functions/useBodyScrollLock.js +4 -9
  171. package/dist/Functions/useClickOutside.js +3 -7
  172. package/dist/Functions/useDebounce.js +11 -25
  173. package/dist/Functions/useFieldFocus.js +42 -67
  174. package/dist/Functions/useFormTools/form-drivers/ArrayWithObjects.js +35 -54
  175. package/dist/Functions/useFormTools/form-drivers/ObjectWithIterableObjects.js +74 -95
  176. package/dist/Functions/useFormTools/form-drivers/ObjectWithNamedKeyObjects.js +55 -91
  177. package/dist/Functions/useFormTools/functions/General.js +80 -99
  178. package/dist/Functions/useFormTools/functions/RenderFields.js +45 -72
  179. package/dist/Functions/useFormTools/functions/usePrevious.js +3 -7
  180. package/dist/Functions/useFormTools/index.js +380 -592
  181. package/dist/Functions/useInputHighlightError.js +27 -52
  182. package/dist/Functions/useIsMobile.js +15 -39
  183. package/dist/Functions/useKeyPress/useHandleKeyPress.js +10 -15
  184. package/dist/Functions/useKeyPress/useKeyPress.js +18 -35
  185. package/dist/Functions/useLocalStorage.js +7 -22
  186. package/dist/Functions/useLocationParams.js +16 -27
  187. package/dist/Functions/useMediaQuery.js +10 -27
  188. package/dist/Functions/useMetaInfo.js +19 -50
  189. package/dist/Functions/useMouseUpOutside.js +2 -5
  190. package/dist/Functions/useOnlineStatus.js +7 -26
  191. package/dist/Functions/usePasswordChecker.js +42 -77
  192. package/dist/Functions/usePrevious.js +3 -7
  193. package/dist/Functions/useResize.js +12 -32
  194. package/dist/Functions/useScrollTo.js +6 -20
  195. package/dist/Functions/useToggle.js +10 -30
  196. package/dist/Functions/utils.js +188 -386
  197. package/dist/Molecular/CustomIcons/components/AffiliateNetworks.js +21 -32
  198. package/dist/Molecular/CustomIcons/components/AlertCircle.js +21 -32
  199. package/dist/Molecular/CustomIcons/components/AppStore.js +25 -36
  200. package/dist/Molecular/CustomIcons/components/Arrow.js +31 -42
  201. package/dist/Molecular/CustomIcons/components/ArrowDown.js +13 -24
  202. package/dist/Molecular/CustomIcons/components/ArrowLeft.js +16 -27
  203. package/dist/Molecular/CustomIcons/components/ArrowRight.js +16 -27
  204. package/dist/Molecular/CustomIcons/components/ArrowUp.js +13 -24
  205. package/dist/Molecular/CustomIcons/components/Bell.js +11 -22
  206. package/dist/Molecular/CustomIcons/components/Button.js +11 -22
  207. package/dist/Molecular/CustomIcons/components/Campaigns.js +12 -23
  208. package/dist/Molecular/CustomIcons/components/Check.js +12 -23
  209. package/dist/Molecular/CustomIcons/components/Check2.js +11 -22
  210. package/dist/Molecular/CustomIcons/components/ChevronDown.js +11 -22
  211. package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.js +11 -22
  212. package/dist/Molecular/CustomIcons/components/ChevronLeft.js +11 -22
  213. package/dist/Molecular/CustomIcons/components/ChevronRight.js +11 -22
  214. package/dist/Molecular/CustomIcons/components/ChevronUp.js +11 -22
  215. package/dist/Molecular/CustomIcons/components/ChevronUpDown.js +26 -37
  216. package/dist/Molecular/CustomIcons/components/Close.js +13 -24
  217. package/dist/Molecular/CustomIcons/components/ColumnsOrder.js +38 -49
  218. package/dist/Molecular/CustomIcons/components/Delete.js +12 -23
  219. package/dist/Molecular/CustomIcons/components/Edit.js +11 -22
  220. package/dist/Molecular/CustomIcons/components/Email.js +29 -40
  221. package/dist/Molecular/CustomIcons/components/FinturfLogo.js +19 -30
  222. package/dist/Molecular/CustomIcons/components/FinturfLogo2.js +27 -38
  223. package/dist/Molecular/CustomIcons/components/Flows.js +11 -22
  224. package/dist/Molecular/CustomIcons/components/Gift.js +16 -27
  225. package/dist/Molecular/CustomIcons/components/GoogleAuth.js +25 -36
  226. package/dist/Molecular/CustomIcons/components/GooglePlay.js +25 -36
  227. package/dist/Molecular/CustomIcons/components/HelpCircle.js +14 -25
  228. package/dist/Molecular/CustomIcons/components/HelpCircle2.js +15 -26
  229. package/dist/Molecular/CustomIcons/components/HelpCircleFilled.js +14 -25
  230. package/dist/Molecular/CustomIcons/components/Home.js +14 -25
  231. package/dist/Molecular/CustomIcons/components/Home2.js +17 -28
  232. package/dist/Molecular/CustomIcons/components/Key.js +19 -30
  233. package/dist/Molecular/CustomIcons/components/Landers.js +15 -26
  234. package/dist/Molecular/CustomIcons/components/Lock.js +11 -22
  235. package/dist/Molecular/CustomIcons/components/Mail.js +19 -30
  236. package/dist/Molecular/CustomIcons/components/Mastercard.js +61 -72
  237. package/dist/Molecular/CustomIcons/components/Minus.js +24 -35
  238. package/dist/Molecular/CustomIcons/components/Offers.js +12 -23
  239. package/dist/Molecular/CustomIcons/components/Pause.js +24 -35
  240. package/dist/Molecular/CustomIcons/components/PayPal.js +38 -49
  241. package/dist/Molecular/CustomIcons/components/PayPalLightLarge.js +25 -36
  242. package/dist/Molecular/CustomIcons/components/Phone.js +26 -37
  243. package/dist/Molecular/CustomIcons/components/Play.js +24 -35
  244. package/dist/Molecular/CustomIcons/components/Plus.js +24 -35
  245. package/dist/Molecular/CustomIcons/components/Profile.js +16 -27
  246. package/dist/Molecular/CustomIcons/components/QRCode.js +26 -37
  247. package/dist/Molecular/CustomIcons/components/Rectangle.js +11 -22
  248. package/dist/Molecular/CustomIcons/components/Revert.js +14 -25
  249. package/dist/Molecular/CustomIcons/components/Star.js +10 -21
  250. package/dist/Molecular/CustomIcons/components/Star2.js +12 -23
  251. package/dist/Molecular/CustomIcons/components/TrafficSources.js +14 -25
  252. package/dist/Molecular/CustomIcons/components/Trash.js +11 -22
  253. package/dist/Molecular/CustomIcons/components/TrashRed.js +11 -22
  254. package/dist/Molecular/CustomIcons/components/Triggers.js +11 -22
  255. package/dist/Molecular/CustomIcons/components/User.js +16 -27
  256. package/dist/Molecular/CustomIcons/components/Visa.js +27 -38
  257. package/dist/Molecular/CustomIcons/components/X.js +11 -22
  258. package/dist/Molecular/CustomIcons/index.js +61 -183
  259. package/dist/Molecular/FormElement/FormElement.js +19 -28
  260. package/dist/Molecular/FormWithDependOn/FormWithDependOn.js +91 -112
  261. package/dist/Molecular/FormWithDependOn/partials/_utils.js +35 -37
  262. package/dist/Molecular/InputAddress/InputAddress.js +176 -312
  263. package/dist/Molecular/InputPassword/InputPassword.js +15 -39
  264. package/dist/index.js +1 -3
  265. package/package.json +1 -1
  266. package/dist/Atomic/FormElements/UserContacts/partial/defaultIcons.js +0 -119
  267. package/dist/Atomic/UI/ModalBackup/Modal.js +0 -174
  268. package/dist/Atomic/UI/ModalBackup/Modal.scss +0 -333
  269. package/dist/Atomic/UI/ModalBackup/ModalHOC.js +0 -51
  270. package/dist/Atomic/UI/ModalBackup/partials/ModalFooter.js +0 -24
  271. package/dist/Atomic/UI/ModalBackup/partials/ModalTitle.js +0 -41
  272. package/dist/Functions/presets/inputMaskPreset.js +0 -176
@@ -1,209 +1,127 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- var _typeof = 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
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
-
14
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
-
16
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
17
-
18
9
  var _react = _interopRequireWildcard(require("react"));
19
-
20
10
  var _classnames = _interopRequireDefault(require("classnames"));
21
-
22
11
  var _reactDom = require("react-dom");
23
-
24
12
  var _reactFeather = require("react-feather");
25
-
26
13
  var _fieldValueFormatters = require("../../../Functions/fieldValueFormatters");
27
-
28
14
  var _useDebounce = require("../../../Functions/useDebounce");
29
-
30
- var _useIsMobile2 = _interopRequireDefault(require("../../../Functions/useIsMobile"));
31
-
15
+ var _useIsMobile = _interopRequireDefault(require("../../../Functions/useIsMobile"));
32
16
  var _Spinner = _interopRequireDefault(require("../../Layout/Spinner/Spinner"));
33
-
34
17
  var _RadioInput = _interopRequireDefault(require("../RadioInput/RadioInput"));
35
-
36
18
  require("./DropdownLiveSearch.scss");
37
-
38
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
39
-
40
- 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; }
41
-
42
- var RC = "dropdown-live-search";
43
-
44
- var DropdownLiveSearch = function DropdownLiveSearch(_ref) {
45
- var _dropdownListRef$curr5, _dropdownListRef$curr6, _cn6, _tabIndex$toString;
46
-
47
- var label = _ref.label,
48
- value = _ref.value,
49
- error = _ref.error,
50
- disabled = _ref.disabled,
51
- onChange = _ref.onChange,
52
- placeholder = _ref.placeholder,
53
- className = _ref.className,
54
- isSearchable = _ref.isSearchable,
55
- testId = _ref.testId,
56
- doRequest = _ref.doRequest,
57
- isLoading = _ref.isLoading,
58
- _ref$options = _ref.options,
59
- options = _ref$options === void 0 ? [] : _ref$options,
60
- fieldKey = _ref.fieldKey,
61
- id = _ref.id,
62
- isListTop = _ref.isListTop,
63
- _ref$isNotValidateASC = _ref.isNotValidateASCII,
64
- isNotValidateASCII = _ref$isNotValidateASC === void 0 ? false : _ref$isNotValidateASC,
65
- _ref$noOptionsText = _ref.noOptionsText,
66
- noOptionsText = _ref$noOptionsText === void 0 ? "No options available" : _ref$noOptionsText,
67
- _ref$attributesOfNati = _ref.attributesOfNativeInput,
68
- attributesOfNativeInput = _ref$attributesOfNati === void 0 ? {} : _ref$attributesOfNati,
69
- withMobileLogic = _ref.withMobileLogic,
70
- tabIndex = _ref.tabIndex;
71
-
72
- var _useState = (0, _react.useState)(id || fieldKey || Math.random().toString(16).slice(2)),
73
- _useState2 = (0, _slicedToArray2.default)(_useState, 1),
74
- dropdownId = _useState2[0];
75
-
76
- var _useState3 = (0, _react.useState)(false),
77
- _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
78
- isOpen = _useState4[0],
79
- setIsOpenState = _useState4[1];
80
-
81
- var _useState5 = (0, _react.useState)(false),
82
- _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
83
- isValueDeleted = _useState6[0],
84
- setIsValueDeleted = _useState6[1];
85
-
86
- var _useIsMobile = (0, _useIsMobile2.default)(),
87
- isMobileProp = _useIsMobile.isMobile;
88
-
89
- var isMobile = isMobileProp && withMobileLogic && window.screen.width <= 768;
90
- var labelByValue = (0, _react.useMemo)(function () {
19
+ 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); }
20
+ 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; }
21
+ const RC = "dropdown-live-search";
22
+ const DropdownLiveSearch = _ref => {
23
+ var _dropdownListRef$curr5, _dropdownListRef$curr6, _tabIndex$toString;
24
+ let {
25
+ label,
26
+ value,
27
+ error,
28
+ disabled,
29
+ onChange,
30
+ placeholder,
31
+ className,
32
+ isSearchable,
33
+ testId,
34
+ doRequest,
35
+ isLoading,
36
+ options = [],
37
+ fieldKey,
38
+ id,
39
+ isListTop,
40
+ isNotValidateASCII = false,
41
+ noOptionsText = "No options available",
42
+ attributesOfNativeInput = {},
43
+ withMobileLogic,
44
+ tabIndex
45
+ } = _ref;
46
+ const [dropdownId] = (0, _react.useState)(id || fieldKey || Math.random().toString(16).slice(2));
47
+ const [isOpen, setIsOpenState] = (0, _react.useState)(false);
48
+ const [isValueDeleted, setIsValueDeleted] = (0, _react.useState)(false);
49
+ const {
50
+ isMobile: isMobileProp
51
+ } = (0, _useIsMobile.default)();
52
+ const isMobile = isMobileProp && withMobileLogic && window.screen.width <= 768;
53
+ const labelByValue = (0, _react.useMemo)(() => {
91
54
  var _options$find$label, _options$find;
92
-
93
- return (_options$find$label = options === null || options === void 0 ? void 0 : (_options$find = options.find(function (item) {
94
- return item.value === value;
95
- })) === null || _options$find === void 0 ? void 0 : _options$find.label) !== null && _options$find$label !== void 0 ? _options$find$label : "";
55
+ return (_options$find$label = options === null || options === void 0 || (_options$find = options.find(item => item.value === value)) === null || _options$find === void 0 ? void 0 : _options$find.label) !== null && _options$find$label !== void 0 ? _options$find$label : "";
96
56
  }, [value]);
97
-
98
- var _useState7 = (0, _react.useState)(""),
99
- _useState8 = (0, _slicedToArray2.default)(_useState7, 2),
100
- searchValue = _useState8[0],
101
- setSV = _useState8[1];
102
-
103
- var _useState9 = (0, _react.useState)(false),
104
- _useState10 = (0, _slicedToArray2.default)(_useState9, 2),
105
- isSearchValueChangedAfterOpen = _useState10[0],
106
- setIsSearchValueChangedAfterOpen = _useState10[1];
107
-
108
- var dropdownLiveSearchRef = (0, _react.useRef)(null);
109
- var dropdownListBoxRef = (0, _react.useRef)(null);
110
- var dropdownListRef = (0, _react.useRef)(null);
111
- var dropdownListHeaderRef = (0, _react.useRef)(null);
112
- var searchInputRef = (0, _react.useRef)(null);
113
- var searchInputModalRef = (0, _react.useRef)(null);
114
- var searchValueRef = (0, _react.useRef)(null);
115
- var wrapperRef = (0, _react.useRef)(null);
116
-
117
- var _useState11 = (0, _react.useState)(false),
118
- _useState12 = (0, _slicedToArray2.default)(_useState11, 2),
119
- isFocusedByClick = _useState12[0],
120
- setIsFocusedByClick = _useState12[1];
121
-
122
- var _useState13 = (0, _react.useState)(null),
123
- _useState14 = (0, _slicedToArray2.default)(_useState13, 2),
124
- isScrollableList = _useState14[0],
125
- setIsScrollableList = _useState14[1];
126
-
127
- var _useState15 = (0, _react.useState)(false),
128
- _useState16 = (0, _slicedToArray2.default)(_useState15, 2),
129
- isFixedMaxHeight = _useState16[0],
130
- setIsFixedMaxHeight = _useState16[1];
131
-
132
- var _useState17 = (0, _react.useState)(0),
133
- _useState18 = (0, _slicedToArray2.default)(_useState17, 2),
134
- scrollTop = _useState18[0],
135
- setScrollTop = _useState18[1];
136
-
137
- var _useState19 = (0, _react.useState)(1),
138
- _useState20 = (0, _slicedToArray2.default)(_useState19, 2),
139
- scrollHeight = _useState20[0],
140
- setScrollHeight = _useState20[1];
141
-
142
- var debouncedSearchTerm = (0, _useDebounce.useDebounce)({
143
- searchValue: searchValue,
57
+ const [searchValue, setSV] = (0, _react.useState)("");
58
+ const [isSearchValueChangedAfterOpen, setIsSearchValueChangedAfterOpen] = (0, _react.useState)(false);
59
+ const dropdownLiveSearchRef = (0, _react.useRef)(null);
60
+ const dropdownListBoxRef = (0, _react.useRef)(null);
61
+ const dropdownListRef = (0, _react.useRef)(null);
62
+ const dropdownListHeaderRef = (0, _react.useRef)(null);
63
+ const searchInputRef = (0, _react.useRef)(null);
64
+ const searchInputModalRef = (0, _react.useRef)(null);
65
+ const searchValueRef = (0, _react.useRef)(null);
66
+ const wrapperRef = (0, _react.useRef)(null);
67
+ const [isFocusedByClick, setIsFocusedByClick] = (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
+ const debouncedSearchTerm = (0, _useDebounce.useDebounce)({
73
+ searchValue,
144
74
  delay: 600
145
75
  });
146
- var doScrollCallback = (0, _react.useCallback)(function (e) {
76
+ const doScrollCallback = (0, _react.useCallback)(e => {
147
77
  if (doRequest && typeof doRequest === "function") {
148
78
  if (Math.round(e.target.clientHeight + e.target.scrollTop) == e.target.scrollHeight) {
149
79
  doRequest(searchValueRef.current, true);
150
80
  }
151
81
  }
152
82
  }, [options]);
153
-
154
- var setSearchValue = function setSearchValue(val) {
155
- var isChanged = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
83
+ const setSearchValue = function (val) {
84
+ let isChanged = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
156
85
  if (isChanged) setIsSearchValueChangedAfterOpen(true);
157
86
  setSV(val);
158
87
  searchValueRef.current = val;
159
88
  };
160
-
161
- var setIsOpen = function setIsOpen(v) {
89
+ const setIsOpen = v => {
162
90
  setIsOpenState(v);
163
91
  setSearchValue("", false);
164
92
  if (!v) setIsSearchValueChangedAfterOpen(false);
165
93
  };
166
-
167
- var getParentNode = function getParentNode() {
94
+ const getParentNode = () => {
168
95
  var _ref2, _document$querySelect;
169
-
170
96
  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");
171
97
  };
172
-
173
- var getListContainer = function getListContainer() {
98
+ const getListContainer = () => {
174
99
  return document.getElementById(dropdownId);
175
100
  };
176
-
177
- var onWrapperClick = function onWrapperClick(e) {
101
+ const onWrapperClick = e => {
178
102
  if (e.target === (wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current)) {
179
103
  e.stopPropagation();
180
104
  e.preventDefault();
181
105
  setIsOpen(false);
182
106
  }
183
107
  };
184
-
185
- var onSearchableInputFocus = function onSearchableInputFocus(e) {
108
+ const onSearchableInputFocus = e => {
186
109
  if (!isOpen) {
187
110
  e.preventDefault();
188
111
  e.stopPropagation();
189
112
  }
190
113
  };
191
-
192
- var handleClickOutside = function handleClickOutside(event) {
114
+ const handleClickOutside = event => {
193
115
  var _getListContainer;
194
-
195
116
  if (!dropdownLiveSearchRef.current.contains(event.target) && (!getListContainer() || !((_getListContainer = getListContainer()) !== null && _getListContainer !== void 0 && _getListContainer.contains(event.target)))) setIsOpen(false);
196
117
  };
197
-
198
- var closeListViaEsc = function closeListViaEsc(e) {
118
+ const closeListViaEsc = e => {
199
119
  if ([27].includes(e.keyCode)) setIsOpen(false);
200
120
  };
201
-
202
- var closeList = isOpen ? handleClickOutside : function () {};
203
- var handle = {
204
- onInputClick: function onInputClick(e) {
121
+ const closeList = isOpen ? handleClickOutside : () => {};
122
+ const handle = {
123
+ onInputClick: e => {
205
124
  if (!isOpen) setIsOpen(true);
206
-
207
125
  if (isMobile && withMobileLogic) {
208
126
  e.preventDefault();
209
127
  e.stopPropagation();
@@ -212,11 +130,10 @@ var DropdownLiveSearch = function DropdownLiveSearch(_ref) {
212
130
  e.target.select();
213
131
  }
214
132
  },
215
- onInputChange: function onInputChange(e) {
216
- var inputValue = e.target.value;
133
+ onInputChange: e => {
134
+ let inputValue = e.target.value;
217
135
  if (!isNotValidateASCII) inputValue = (0, _fieldValueFormatters.formatToOnlyASCIICodeText)(inputValue);
218
136
  setSearchValue(inputValue);
219
-
220
137
  if ((searchValue || !isSearchValueChangedAfterOpen) && !e.target.value) {
221
138
  onChange("");
222
139
  setSearchValue("");
@@ -224,18 +141,12 @@ var DropdownLiveSearch = function DropdownLiveSearch(_ref) {
224
141
  } else setIsValueDeleted(false);
225
142
  }
226
143
  };
227
-
228
- var highlightedText = function highlightedText(text, postfix) {
144
+ const highlightedText = (text, postfix) => {
229
145
  if (!isSearchable) return text;else {
230
146
  var _text;
231
-
232
- var preparedSearchValue = isSearchValueChangedAfterOpen || isMobile && withMobileLogic ? searchValue : labelByValue;
233
-
234
- var prepare = function prepare(text) {
235
- return text === null || text === void 0 ? void 0 : text.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&");
236
- };
237
-
238
- text = text.replace(/["&<>]/g, function (a) {
147
+ const preparedSearchValue = isSearchValueChangedAfterOpen || isMobile && withMobileLogic ? searchValue : labelByValue;
148
+ const prepare = text => text === null || text === void 0 ? void 0 : text.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&");
149
+ text = text.replace(/["&<>]/g, a => {
239
150
  return {
240
151
  '"': "&quot;",
241
152
  "&": "&amp;",
@@ -243,29 +154,30 @@ var DropdownLiveSearch = function DropdownLiveSearch(_ref) {
243
154
  ">": "&gt;"
244
155
  }[a];
245
156
  });
246
- var main = preparedSearchValue ? (_text = text) === null || _text === void 0 ? void 0 : _text.replace(new RegExp(prepare(preparedSearchValue), "i"), function (match) {
247
- return "<span class=\"bg--yellow\">".concat(match, "</span>");
248
- }) : text;
249
- var postfixPart = postfix ? "<span class=\"dropdown__list-item-postfix\">".concat(postfix, "</span>") : "";
157
+ const main = preparedSearchValue ? (_text = text) === null || _text === void 0 ? void 0 : _text.replace(new RegExp(prepare(preparedSearchValue), "i"), match => "<span class=\"bg--yellow\">".concat(match, "</span>")) : text;
158
+ const postfixPart = postfix ? "<span class=\"dropdown__list-item-postfix\">".concat(postfix, "</span>") : "";
250
159
  return main + postfixPart;
251
160
  }
252
161
  };
253
-
254
- var getMarkupForElement = function getMarkupForElement(item, index, optTestId) {
255
- var _item$value, _item$value$toString, _item$value2, _item$value2$toString, _cn, _item$customMobileIco;
256
-
257
- var lowerLabel = item.label.toLowerCase();
258
- var lowerSearchValue = searchValue === null || searchValue === void 0 ? void 0 : searchValue.toLowerCase();
162
+ const getMarkupForElement = (item, index, optTestId) => {
163
+ var _item$value, _item$value2, _item$customMobileIco;
164
+ const lowerLabel = item.label.toLowerCase();
165
+ const lowerSearchValue = searchValue === null || searchValue === void 0 ? void 0 : searchValue.toLowerCase();
259
166
  return /*#__PURE__*/_react.default.createElement("button", {
260
- "data-testid": "dropdown-live-search--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"),
261
- 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, "_"),
262
- onClick: function onClick() {
167
+ "data-testid": "dropdown-live-search--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"),
168
+ 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, "_"),
169
+ onClick: () => {
263
170
  onChange(item.value);
264
171
  setIsOpen(false);
265
172
  },
266
- 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)
173
+ className: (0, _classnames.default)("".concat(RC, "__list-item"), {
174
+ ["".concat(RC, "__list-item_active")]: item.value === value,
175
+ ["".concat(RC, "__list-item_disabled")]: item.disabled
176
+ }, item.className)
267
177
  }, !isMobile || isMobile && !withMobileLogic && /*#__PURE__*/_react.default.createElement("span", {
268
- className: (0, _classnames.default)("".concat(RC, "__active-icon"), (0, _defineProperty2.default)({}, "".concat(RC, "__active-icon_active"), lowerLabel === lowerSearchValue))
178
+ className: (0, _classnames.default)("".concat(RC, "__active-icon"), {
179
+ ["".concat(RC, "__active-icon_active")]: lowerLabel === lowerSearchValue
180
+ })
269
181
  }, /*#__PURE__*/_react.default.createElement(_reactFeather.Check, null)), /*#__PURE__*/_react.default.createElement("p", {
270
182
  title: item.label,
271
183
  className: item.labelClassName || "",
@@ -277,36 +189,38 @@ var DropdownLiveSearch = function DropdownLiveSearch(_ref) {
277
189
  checked: value
278
190
  }) : "");
279
191
  };
280
-
281
- var getListMarkUp = function getListMarkUp() {
282
- var _cn3, _cn5;
283
-
192
+ const getListMarkUp = () => {
284
193
  return /*#__PURE__*/_react.default.createElement("div", {
285
194
  className: (0, _classnames.default)("".concat(RC, "__container-wrapper")),
286
195
  ref: wrapperRef,
287
- onClick: isMobile ? onWrapperClick : function () {}
196
+ onClick: isMobile ? onWrapperClick : () => {}
288
197
  }, /*#__PURE__*/_react.default.createElement("div", {
289
- 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))
198
+ className: (0, _classnames.default)("".concat(RC, "__list-wrapper"), {
199
+ ["".concat(RC, "__list-wrapper--fixed-height")]: isFixedMaxHeight,
200
+ ["".concat(RC, "__list-wrapper--with-bottom-shadow")]: isScrollableList && isMobile,
201
+ ["".concat(RC, "__list-wrapper--with-bottom-shadow-hidden")]: scrollTop === scrollHeight
202
+ })
290
203
  }, /*#__PURE__*/_react.default.createElement("div", {
291
204
  id: "dropdown-live-search-list",
292
- className: (0, _classnames.default)("".concat(RC, "__container"), (0, _defineProperty2.default)({}, "".concat(RC, "__list-top"), isListTop)),
205
+ className: (0, _classnames.default)("".concat(RC, "__container"), {
206
+ ["".concat(RC, "__list-top")]: isListTop
207
+ }),
293
208
  ref: dropdownListBoxRef
294
209
  }, isMobile && /*#__PURE__*/_react.default.createElement("div", {
295
210
  ref: dropdownListHeaderRef,
296
- className: (0, _classnames.default)("".concat(RC, "__list-header"), (_cn5 = {}, (0, _defineProperty2.default)(_cn5, "".concat(RC, "__list-header-with-shadow"), isScrollableList && isMobile), (0, _defineProperty2.default)(_cn5, "".concat(RC, "__list-header-with-shadow-hidden"), scrollTop === 0), _cn5))
211
+ className: (0, _classnames.default)("".concat(RC, "__list-header"), {
212
+ ["".concat(RC, "__list-header-with-shadow")]: isScrollableList && isMobile,
213
+ ["".concat(RC, "__list-header-with-shadow-hidden")]: scrollTop === 0
214
+ })
297
215
  }, /*#__PURE__*/_react.default.createElement("div", {
298
216
  className: (0, _classnames.default)("".concat(RC, "__list-header-row"))
299
217
  }, /*#__PURE__*/_react.default.createElement("div", {
300
218
  className: (0, _classnames.default)("".concat(RC, "__list-label"))
301
219
  }, label), /*#__PURE__*/_react.default.createElement("div", {
302
220
  className: (0, _classnames.default)("".concat(RC, "__list-close-icon")),
303
- onClick: function onClick() {
304
- return setIsOpen(false);
305
- }
221
+ onClick: () => setIsOpen(false)
306
222
  }, /*#__PURE__*/_react.default.createElement(_reactFeather.X, {
307
- onClick: function onClick() {
308
- return setIsOpen(false);
309
- }
223
+ onClick: () => setIsOpen(false)
310
224
  }))), isSearchable && /*#__PURE__*/_react.default.createElement("input", (0, _extends2.default)({
311
225
  ref: searchInputModalRef,
312
226
  className: "".concat(RC, "__input"),
@@ -320,130 +234,107 @@ var DropdownLiveSearch = function DropdownLiveSearch(_ref) {
320
234
  disabled: isLoading
321
235
  }),
322
236
  ref: dropdownListRef
323
- }, options.map(function (option) {
324
- return getMarkupForElement(option);
325
- }), !options.length && /*#__PURE__*/_react.default.createElement("div", {
237
+ }, options.map(option => getMarkupForElement(option)), !options.length && /*#__PURE__*/_react.default.createElement("div", {
326
238
  className: "".concat(RC, "__list-item ").concat(RC, "__list-item--no-options")
327
239
  }, noOptionsText)), isLoading && isOpen && /*#__PURE__*/_react.default.createElement(_Spinner.default, {
328
240
  size: options.length <= 3 ? "small" : null
329
241
  }))));
330
242
  };
331
-
332
- var initListContainer = function initListContainer() {
333
- var dropdownList = document.createElement("div");
243
+ const initListContainer = () => {
244
+ const dropdownList = document.createElement("div");
334
245
  dropdownList.setAttribute("id", dropdownId);
335
246
  dropdownList.classList.add("dropdown__container");
336
-
337
247
  if (isMobile) {
338
- dropdownList.addEventListener("click", function (e) {
248
+ dropdownList.addEventListener("click", e => {
339
249
  if (e.target.id === dropdownId) setIsOpen(false);
340
250
  });
341
251
  }
342
-
343
252
  try {
344
253
  var _getListContainer2;
345
-
346
- (_getListContainer2 = getListContainer()) === null || _getListContainer2 === void 0 ? void 0 : _getListContainer2.remove();
254
+ (_getListContainer2 = getListContainer()) === null || _getListContainer2 === void 0 || _getListContainer2.remove();
347
255
  } finally {
348
256
  if (isMobile) {
349
257
  var _getParentNode;
350
-
351
258
  try {
352
259
  var _document$getElementB;
353
-
354
- (_document$getElementB = document.getElementById("mlw-".concat(dropdownId))) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.remove();
260
+ (_document$getElementB = document.getElementById("mlw-".concat(dropdownId))) === null || _document$getElementB === void 0 || _document$getElementB.remove();
355
261
  } catch (e) {}
356
-
357
- var dropdownMobileListWrapper = document.createElement("div");
262
+ const dropdownMobileListWrapper = document.createElement("div");
358
263
  dropdownMobileListWrapper.classList.add("dropdown-live-search-mobile");
359
264
  dropdownMobileListWrapper.setAttribute("id", "mlw-".concat(dropdownId));
360
- dropdownMobileListWrapper === null || dropdownMobileListWrapper === void 0 ? void 0 : dropdownMobileListWrapper.append(dropdownList);
361
- (_getParentNode = getParentNode()) === null || _getParentNode === void 0 ? void 0 : _getParentNode.append(dropdownMobileListWrapper);
265
+ dropdownMobileListWrapper === null || dropdownMobileListWrapper === void 0 || dropdownMobileListWrapper.append(dropdownList);
266
+ (_getParentNode = getParentNode()) === null || _getParentNode === void 0 || _getParentNode.append(dropdownMobileListWrapper);
362
267
  } else {
363
268
  var _getParentNode2;
364
-
365
- (_getParentNode2 = getParentNode()) === null || _getParentNode2 === void 0 ? void 0 : _getParentNode2.append(dropdownList);
269
+ (_getParentNode2 = getParentNode()) === null || _getParentNode2 === void 0 || _getParentNode2.append(dropdownList);
366
270
  }
367
271
  }
368
272
  };
369
-
370
- var renderListContainer = function renderListContainer() {
371
- var lc = getListContainer();
273
+ const renderListContainer = () => {
274
+ const lc = getListContainer();
372
275
  if (!lc) return null;
373
276
  return /*#__PURE__*/(0, _reactDom.createPortal)(getListMarkUp(), lc);
374
277
  };
375
-
376
- (0, _react.useEffect)(function () {
278
+ (0, _react.useEffect)(() => {
377
279
  document.addEventListener("click", handleClickOutside, true);
378
- return function () {
379
- return document.removeEventListener("click", handleClickOutside, true);
380
- };
280
+ return () => document.removeEventListener("click", handleClickOutside, true);
381
281
  }, []);
382
- (0, _react.useEffect)(function () {
282
+ (0, _react.useEffect)(() => {
383
283
  if (options.length === 1 && searchValue === options[0].label) {
384
284
  setSearchValue(options[0].label);
385
285
  onChange(options[0].value);
386
286
  }
387
287
  }, [options]);
388
- (0, _react.useEffect)(function () {
288
+ (0, _react.useEffect)(() => {
389
289
  if (isSearchable && (debouncedSearchTerm || isValueDeleted)) {
390
290
  doRequest(debouncedSearchTerm);
391
291
  if (isValueDeleted) setIsValueDeleted(false);
392
292
  }
393
293
  }, [debouncedSearchTerm, isValueDeleted]);
394
- (0, _react.useEffect)(function () {
294
+ (0, _react.useEffect)(() => {
395
295
  if (isMobile && withMobileLogic) {
396
296
  initListContainer();
397
297
  }
398
298
  }, [isMobile, withMobileLogic]);
399
- (0, _react.useEffect)(function () {
299
+ (0, _react.useEffect)(() => {
400
300
  if (isOpen && isMobile && dropdownListRef !== null && dropdownListRef !== void 0 && dropdownListRef.current && !searchValue) {
401
301
  var _dropdownListRef$curr, _dropdownListRef$curr2, _dropdownListRef$curr3, _dropdownListRef$curr4;
402
-
403
- 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));
404
- 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));
302
+ 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));
303
+ 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));
405
304
  }
406
- }, [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]);
407
- (0, _react.useLayoutEffect)(function () {
408
- var list = document.getElementById("dropdown-live-search-list");
409
-
305
+ }, [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]);
306
+ (0, _react.useLayoutEffect)(() => {
307
+ const list = document.getElementById("dropdown-live-search-list");
410
308
  if ((list || isOpen) && (!withMobileLogic || !isMobile)) {
411
309
  var _dropdownLiveSearchRe;
412
-
413
- var dropdownWidth = dropdownLiveSearchRef === null || dropdownLiveSearchRef === void 0 ? void 0 : (_dropdownLiveSearchRe = dropdownLiveSearchRef.current) === null || _dropdownLiveSearchRe === void 0 ? void 0 : _dropdownLiveSearchRe.clientWidth;
310
+ const dropdownWidth = dropdownLiveSearchRef === null || dropdownLiveSearchRef === void 0 || (_dropdownLiveSearchRe = dropdownLiveSearchRef.current) === null || _dropdownLiveSearchRe === void 0 ? void 0 : _dropdownLiveSearchRe.clientWidth;
414
311
  list.style.minWidth = "".concat(dropdownWidth, "px");
415
312
  }
416
313
  }, [dropdownLiveSearchRef, isOpen, withMobileLogic]);
417
- (0, _react.useEffect)(function () {
314
+ (0, _react.useEffect)(() => {
418
315
  if (!isOpen) {
419
316
  setIsFocusedByClick(false);
420
317
  if (withMobileLogic && isMobile) setSearchValue("");
421
318
  }
422
-
423
319
  if (isOpen && dropdownListRef && dropdownListRef.current) {
424
320
  if (isMobile && withMobileLogic) {
425
321
  var _searchInputModalRef$;
426
-
427
- doRequest("").then(function () {
428
- setTimeout(function () {
429
- var _dropdownListBoxRef$c, _dropdownListBoxRef$c2, _dropdownListHeaderRe, _dropdownListHeaderRe2;
430
-
431
- dropdownListRef.current.style.maxHeight = "".concat((dropdownListBoxRef === null || dropdownListBoxRef === void 0 ? void 0 : (_dropdownListBoxRef$c = dropdownListBoxRef.current) === null || _dropdownListBoxRef$c === void 0 ? void 0 : (_dropdownListBoxRef$c2 = _dropdownListBoxRef$c.getBoundingClientRect()) === null || _dropdownListBoxRef$c2 === void 0 ? void 0 : _dropdownListBoxRef$c2.height) - (dropdownListHeaderRef === null || dropdownListHeaderRef === void 0 ? void 0 : (_dropdownListHeaderRe = dropdownListHeaderRef.current) === null || _dropdownListHeaderRe === void 0 ? void 0 : (_dropdownListHeaderRe2 = _dropdownListHeaderRe.getBoundingClientRect()) === null || _dropdownListHeaderRe2 === void 0 ? void 0 : _dropdownListHeaderRe2.height), "px");
322
+ doRequest("").then(() => {
323
+ setTimeout(() => {
324
+ var _dropdownListBoxRef$c, _dropdownListHeaderRe;
325
+ dropdownListRef.current.style.maxHeight = "".concat((dropdownListBoxRef === null || dropdownListBoxRef === void 0 || (_dropdownListBoxRef$c = dropdownListBoxRef.current) === null || _dropdownListBoxRef$c === void 0 || (_dropdownListBoxRef$c = _dropdownListBoxRef$c.getBoundingClientRect()) === null || _dropdownListBoxRef$c === void 0 ? void 0 : _dropdownListBoxRef$c.height) - (dropdownListHeaderRef === null || dropdownListHeaderRef === void 0 || (_dropdownListHeaderRe = dropdownListHeaderRef.current) === null || _dropdownListHeaderRe === void 0 || (_dropdownListHeaderRe = _dropdownListHeaderRe.getBoundingClientRect()) === null || _dropdownListHeaderRe === void 0 ? void 0 : _dropdownListHeaderRe.height), "px");
432
326
  }, 1);
433
327
  });
434
- searchInputModalRef === null || searchInputModalRef === void 0 ? void 0 : (_searchInputModalRef$ = searchInputModalRef.current) === null || _searchInputModalRef$ === void 0 ? void 0 : _searchInputModalRef$.focus();
328
+ searchInputModalRef === null || searchInputModalRef === void 0 || (_searchInputModalRef$ = searchInputModalRef.current) === null || _searchInputModalRef$ === void 0 || _searchInputModalRef$.focus();
435
329
  }
436
-
437
330
  dropdownListRef.current.addEventListener("scroll", doScrollCallback);
438
331
  }
439
-
440
- return function () {
332
+ return () => {
441
333
  removeEventListener("scroll", doScrollCallback);
442
334
  };
443
335
  }, [isOpen, dropdownListRef]);
444
- (0, _react.useLayoutEffect)(function () {
336
+ (0, _react.useLayoutEffect)(() => {
445
337
  var _getListContainer3;
446
-
447
338
  if (!isMobile) {
448
339
  window.addEventListener("mousewheel", closeList);
449
340
  window.addEventListener("scroll", closeList);
@@ -453,62 +344,51 @@ var DropdownLiveSearch = function DropdownLiveSearch(_ref) {
453
344
  window.removeEventListener("scroll", closeList);
454
345
  window.removeEventListener("touchmove", closeList);
455
346
  }
456
-
457
- (_getListContainer3 = getListContainer()) === null || _getListContainer3 === void 0 ? void 0 : _getListContainer3.addEventListener("click", closeList);
347
+ (_getListContainer3 = getListContainer()) === null || _getListContainer3 === void 0 || _getListContainer3.addEventListener("click", closeList);
458
348
  window.addEventListener("keyup", closeListViaEsc);
459
- return function () {
349
+ return () => {
460
350
  var _getListContainer4;
461
-
462
351
  window.removeEventListener("mousewheel", closeList);
463
352
  window.removeEventListener("scroll", closeList);
464
353
  window.removeEventListener("touchmove", closeList);
465
354
  window.removeEventListener("keyup", closeListViaEsc);
466
- (_getListContainer4 = getListContainer()) === null || _getListContainer4 === void 0 ? void 0 : _getListContainer4.removeEventListener("click", closeList);
355
+ (_getListContainer4 = getListContainer()) === null || _getListContainer4 === void 0 || _getListContainer4.removeEventListener("click", closeList);
467
356
  };
468
357
  }, [getListContainer]);
469
- (0, _react.useEffect)(function () {
470
- var setScrollTopValue = function setScrollTopValue(e) {
358
+ (0, _react.useEffect)(() => {
359
+ const setScrollTopValue = e => {
471
360
  setScrollTop(parseInt(e.target.scrollTop, 10));
472
361
  };
473
-
474
362
  if (isOpen && isMobile && dropdownListRef !== null && dropdownListRef !== void 0 && dropdownListRef.current) {
475
363
  var _dropdownListRef$curr7;
476
-
477
- dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr7 = dropdownListRef.current) === null || _dropdownListRef$curr7 === void 0 ? void 0 : _dropdownListRef$curr7.addEventListener("scroll", setScrollTopValue);
364
+ dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr7 = dropdownListRef.current) === null || _dropdownListRef$curr7 === void 0 || _dropdownListRef$curr7.addEventListener("scroll", setScrollTopValue);
478
365
  }
479
-
480
- return function () {
366
+ return () => {
481
367
  var _dropdownListRef$curr8;
482
-
483
- dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr8 = dropdownListRef.current) === null || _dropdownListRef$curr8 === void 0 ? void 0 : _dropdownListRef$curr8.removeEventListener("scroll", setScrollTopValue);
368
+ dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr8 = dropdownListRef.current) === null || _dropdownListRef$curr8 === void 0 || _dropdownListRef$curr8.removeEventListener("scroll", setScrollTopValue);
484
369
  };
485
370
  }, [isOpen, isMobile, dropdownListRef === null || dropdownListRef === void 0 ? void 0 : dropdownListRef.current]);
486
- (0, _react.useEffect)(function () {
371
+ (0, _react.useEffect)(() => {
487
372
  if (dropdownListRef !== null && dropdownListRef !== void 0 && dropdownListRef.current) {
488
373
  var _dropdownListRef$curr9, _dropdownListRef$curr10;
489
-
490
- 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));
374
+ 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));
491
375
  }
492
376
  }, [scrollTop, dropdownListRef === null || dropdownListRef === void 0 ? void 0 : dropdownListRef.current]);
493
377
  if (!options) return null;
494
378
  return /*#__PURE__*/_react.default.createElement("div", {
495
- className: (0, _classnames.default)(RC, className, (_cn6 = {
496
- disabled: disabled
497
- }, (0, _defineProperty2.default)(_cn6, "".concat(RC, "-mobile"), isMobile), (0, _defineProperty2.default)(_cn6, "".concat(RC, "--focused"), isOpen), _cn6)),
379
+ className: (0, _classnames.default)(RC, className, {
380
+ disabled,
381
+ ["".concat(RC, "-mobile")]: isMobile,
382
+ ["".concat(RC, "--focused")]: isOpen
383
+ }),
498
384
  ref: dropdownLiveSearchRef
499
385
  }, /*#__PURE__*/_react.default.createElement("button", {
500
386
  "data-testid": "dropdown-live-search--".concat(testId || "", "--container"),
501
387
  className: "".concat(RC, "__trigger input__wrap ").concat(isOpen ? "input__wrap--focus" : "", " ").concat(!value ? "placeholder" : "", " ").concat(error ? "error" : ""),
502
- onClick: function onClick() {
503
- return !isSearchable ? setIsOpen(!isOpen) : null;
504
- },
505
- onMouseDown: function onMouseDown() {
506
- return setIsFocusedByClick(true);
507
- },
508
- onFocus: function onFocus() {
509
- return !isFocusedByClick ? setIsOpen(true) : null;
510
- },
511
- tabIndex: tabIndex === null || tabIndex === void 0 ? void 0 : (_tabIndex$toString = tabIndex.toString) === null || _tabIndex$toString === void 0 ? void 0 : _tabIndex$toString.call(tabIndex)
388
+ onClick: () => !isSearchable ? setIsOpen(!isOpen) : null,
389
+ onMouseDown: () => setIsFocusedByClick(true),
390
+ onFocus: () => !isFocusedByClick ? setIsOpen(true) : null,
391
+ tabIndex: tabIndex === null || tabIndex === void 0 || (_tabIndex$toString = tabIndex.toString) === null || _tabIndex$toString === void 0 ? void 0 : _tabIndex$toString.call(tabIndex)
512
392
  }, isSearchable ? /*#__PURE__*/_react.default.createElement("input", (0, _extends2.default)({
513
393
  ref: searchInputRef,
514
394
  className: "".concat(RC, "__input"),
@@ -521,14 +401,12 @@ var DropdownLiveSearch = function DropdownLiveSearch(_ref) {
521
401
  }, attributesOfNativeInput)) : /*#__PURE__*/_react.default.createElement("span", {
522
402
  className: "text"
523
403
  }, labelByValue || placeholder), /*#__PURE__*/_react.default.createElement("span", {
524
- className: (0, _classnames.default)("".concat(RC, "__arrow"), (0, _defineProperty2.default)({}, "".concat(RC, "__arrow_active"), isOpen)),
525
- onClick: function onClick() {
526
- return setIsOpen(!isOpen);
527
- }
404
+ className: (0, _classnames.default)("".concat(RC, "__arrow"), {
405
+ ["".concat(RC, "__arrow_active")]: isOpen
406
+ }),
407
+ onClick: () => setIsOpen(!isOpen)
528
408
  }, isMobile ? /*#__PURE__*/_react.default.createElement(_reactFeather.Code, {
529
409
  className: "mobile-icon"
530
410
  }) : isOpen ? /*#__PURE__*/_react.default.createElement(_reactFeather.ChevronUp, null) : /*#__PURE__*/_react.default.createElement(_reactFeather.ChevronDown, null))), isOpen && (isMobile && withMobileLogic ? renderListContainer() : getListMarkUp()));
531
411
  };
532
-
533
- var _default = DropdownLiveSearch;
534
- exports.default = _default;
412
+ var _default = exports.default = DropdownLiveSearch;