intelicoreact 1.5.33 → 1.5.35

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